Skip to content

Commit

Permalink
Merge branch 'neoforge-1.21' into neo1.21-otherside_revamp
Browse files Browse the repository at this point in the history
  • Loading branch information
NewJumper authored Nov 16, 2024
2 parents 52762ed + ae0d6bf commit 9a8358b
Show file tree
Hide file tree
Showing 123 changed files with 488 additions and 459 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'net.neoforged.gradle.userdev' version '7.0.162'
id 'net.neoforged.gradle.userdev' version '7.0.165'
}
tasks.named('wrapper', Wrapper).configure { distributionType = Wrapper.DistributionType.BIN }

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ emi_version=1.1.12
mod_id=deeperdarker
mod_name=Deeper and Darker
mod_license=AGPL-3.0
mod_version=1.3.2
mod_version=1.3.4
mod_group_id=com.kyanite.deeperdarker
mod_authors=Kyanite Team
mod_credits=NewJumperr, nitro_dynamite18, angxdd, pr_ib, JustJussi, Rotch_Gwylt, DanielArtist
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// 1.21 2024-10-10T21:20:28.0250668 Registries
// 1.21 2024-11-06T14:48:57.830265 Registries
65c8c67a4ec7ef0ce6846fb2f4d921cc6ceb02e2 data/deeperdarker/damage_type/bite.json
0b65c61bd1e5086d0f3685566cc6cecf6e324516 data/deeperdarker/damage_type/ring.json
dede162345c14db637f3dd9a20ca9319e037ae9d data/deeperdarker/dimension/otherside.json
67f8cd0621b1c3614da8c1910f6b7bcb61660293 data/deeperdarker/dimension_type/otherside.json
0f715fda6f60117cf74eadf94c1590aea34761a3 data/deeperdarker/dimension_type/otherside.json
ad453d5b708fe189495a8e5d4ce2531d9898a555 data/deeperdarker/enchantment/catalysis.json
d5b5b78cce29a3e1eec213a0d1540c21d58a3d34 data/deeperdarker/enchantment/sculk_smite.json
729673e1d51f7ee33e7f94cff8b59ee030844d8b data/deeperdarker/painting_variant/abstraction.json
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.21 2024-08-26T18:36:59.6353817 Languages: en_us for mod: deeperdarker
5314038eb99a4542981b40ccf14cfcec0f4fb07e assets/deeperdarker/lang/en_us.json
// 1.21 2024-09-13T23:51:44.7054691 Languages: en_us for mod: deeperdarker
6132e96471df232a0f1f9146e582eefc5ffaa47d assets/deeperdarker/lang/en_us.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.21 2024-09-03T18:26:51.3070092 Tags for minecraft:item mod id deeperdarker
// 1.21 2024-10-17T10:27:49.2110636 Tags for minecraft:item mod id deeperdarker
9d236ad52ffab14efb6405a34d837dafff77e363 data/c/tags/item/ores.json
ec4e45d46ce1593f9bb4b226a1e3d143bc0942c6 data/c/tags/item/ores/coal.json
dc2be5311ef04baad7565936ffafc6dcea324cf1 data/c/tags/item/ores/copper.json
Expand All @@ -23,7 +23,7 @@ ec4e45d46ce1593f9bb4b226a1e3d143bc0942c6 data/minecraft/tags/item/coal_ores.json
dc2be5311ef04baad7565936ffafc6dcea324cf1 data/minecraft/tags/item/copper_ores.json
84c6024e42063deecc27f59b5a97328b415f4a05 data/minecraft/tags/item/diamond_ores.json
41a0ed1cf9fcf4b0f4e41d3155f010eb069e2edc data/minecraft/tags/item/emerald_ores.json
d0b6527a3244189c04b06295e1dc213419922973 data/minecraft/tags/item/enchantable/durability.json
7b02b576df083630e66072bf2d0f07f1e6ac4a26 data/minecraft/tags/item/enchantable/durability.json
d0b6527a3244189c04b06295e1dc213419922973 data/minecraft/tags/item/enchantable/equippable.json
7dbce4cb80be16ec44f3472f112147a1d7ba8e61 data/minecraft/tags/item/fence_gates.json
81a54dc6ee81c739615aa27a3e28b941ba65077e data/minecraft/tags/item/flowers.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@
"tag.item.deeperdarker.bloom_stems": "Blooming Stems",
"tag.item.deeperdarker.dampens_vibrations": "Dampens Vibrations",
"tag.item.deeperdarker.echo_logs": "Echo Logs",
"tag.item.deeperdarker.resonarium_armor": "Resonarium Armor",
"tag.item.deeperdarker.scutes": "Scutes",
"tooltips.deeperdarker.crystallized_amber.item": "Contains %s",
"tooltips.deeperdarker.crystallized_amber.leech": "Contains Sculk Leech",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"ambient_light": 0.05,
"bed_works": true,
"coordinate_scale": 1.0,
"effects": "minecraft:the_nether",
"effects": "deeperdarker:otherside_effects",
"fixed_time": 18000,
"has_ceiling": true,
"has_raids": false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"values": [
"deeperdarker:soul_elytra"
"deeperdarker:soul_elytra",
"deeperdarker:sonorous_staff"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
import com.kyanite.deeperdarker.network.UseTransmitterPacket;
import com.kyanite.deeperdarker.util.DDArmorMaterials;
import com.kyanite.deeperdarker.util.DDTags;
import com.kyanite.deeperdarker.world.otherside.OthersideDimension;
import it.unimi.dsi.fastutil.objects.Object2IntMap;
import net.minecraft.client.model.BoatModel;
import net.minecraft.client.model.ChestBoatModel;
import net.minecraft.client.renderer.DimensionSpecialEffects;
import net.minecraft.client.renderer.Sheets;
import net.minecraft.client.renderer.blockentity.BlockEntityRenderers;
import net.minecraft.client.renderer.blockentity.HangingSignRenderer;
Expand Down Expand Up @@ -66,6 +68,7 @@
import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent;
import net.neoforged.neoforge.client.event.EntityRenderersEvent;
import net.neoforged.neoforge.client.event.InputEvent;
import net.neoforged.neoforge.client.event.RegisterDimensionSpecialEffectsEvent;
import net.neoforged.neoforge.client.event.RegisterKeyMappingsEvent;
import net.neoforged.neoforge.event.AnvilUpdateEvent;
import net.neoforged.neoforge.event.brewing.RegisterBrewingRecipesEvent;
Expand Down Expand Up @@ -288,6 +291,11 @@ public static void clientSetup(final FMLClientSetupEvent event) {
EntityRenderers.register(DDEntities.STALKER.get(), StalkerRenderer::new);
}

@SubscribeEvent
public static void registerDimensionEffects(final RegisterDimensionSpecialEffectsEvent event) {
event.register(OthersideDimension.OTHERSIDE_EFFECTS, new DimensionSpecialEffects.NetherEffects());
}

@SubscribeEvent
public static void registerKeybinds(final RegisterKeyMappingsEvent event) {
event.register(Keybinds.BOOST);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,10 @@ public DimensionTransition getPortalDestination(ServerLevel level, Entity pEntit
ServerLevel destServerLevel = level.getServer().getLevel(destLevel);
if(destServerLevel == null) return null;

boolean isOtherside = destServerLevel.dimension() == OthersideDimension.OTHERSIDE_LEVEL;
WorldBorder destBorder = destServerLevel.getWorldBorder();
double scale = DimensionType.getTeleportationScale(level.dimensionType(), destServerLevel.dimensionType());
BlockPos destPos = destBorder.clampToBounds(pEntity.getX() * scale, pEntity.getY(), pEntity.getZ() * scale);
return OthersideTeleporter.getExitPortal(destServerLevel, pEntity, pos, destPos, isOtherside, destBorder);
return OthersideTeleporter.getExitPortal(destServerLevel, pEntity, pos, destPos, destBorder);
}

public static class PortalSpawnEvent extends BlockEvent implements ICancellableEvent {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.kyanite.deeperdarker.content.items;

import com.kyanite.deeperdarker.content.DDItems;
import net.minecraft.core.BlockPos;
import net.minecraft.core.component.DataComponents;
import net.minecraft.core.particles.ParticleTypes;
Expand Down Expand Up @@ -86,6 +87,11 @@ public void inventoryTick(ItemStack stack, Level level, Entity entity, int slotI
}
}

@Override
public boolean isValidRepairItem(ItemStack stack, ItemStack repairCandidate) {
return repairCandidate.is(DDItems.SOUL_CRYSTAL);
}

@Override
public boolean isFoil(ItemStack stack) {
return super.isFoil(stack) || (stack.has(DataComponents.CUSTOM_DATA) && stack.getOrDefault(DataComponents.CUSTOM_DATA, CustomData.EMPTY).copyTag().getBoolean("charged"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static ItemAttributeModifiers createAttributes() {

@Override
public boolean isValidRepairItem(ItemStack toRepair, ItemStack repair) {
return repair.is(DDItems.SOUL_CRYSTAL.get());
return repair.is(DDItems.SOUL_CRYSTAL);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ protected void addTranslations() {

add("tag.item." + DeeperDarker.MOD_ID + ".bloom_stems", "Blooming Stems");
add("tag.item." + DeeperDarker.MOD_ID + ".echo_logs", "Echo Logs");
add("tag.item." + DeeperDarker.MOD_ID + ".resonarium_armor", "Resonarium Armor");
add("tag.item." + DeeperDarker.MOD_ID + ".dampens_vibrations", "Dampens Vibrations");
add("tag.item." + DeeperDarker.MOD_ID + ".scutes", "Scutes");

Expand All @@ -159,8 +160,7 @@ private String convertToName(String key) {
StringBuilder builder = new StringBuilder(key.substring(0, 1).toUpperCase() + key.substring(1));
for(int i = 1; i < builder.length(); i++) {
if(builder.charAt(i) == '_') {
builder.deleteCharAt(i);
builder.replace(i, i + 1, " " + Character.toUpperCase(builder.charAt(i)));
builder.replace(i, i + 2, " " + Character.toUpperCase(builder.charAt(i + 1)));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ protected void addTags(HolderLookup.@NotNull Provider provider) {
tag(ItemTags.CHEST_ARMOR).add(DDItems.RESONARIUM_CHESTPLATE.get(), DDItems.WARDEN_CHESTPLATE.get());
tag(ItemTags.LEG_ARMOR).add(DDItems.RESONARIUM_LEGGINGS.get(), DDItems.WARDEN_LEGGINGS.get());
tag(ItemTags.FOOT_ARMOR).add(DDItems.RESONARIUM_BOOTS.get(), DDItems.WARDEN_BOOTS.get());
tag(ItemTags.DURABILITY_ENCHANTABLE).add(DDItems.SOUL_ELYTRA.get());
tag(ItemTags.DURABILITY_ENCHANTABLE).add(DDItems.SOUL_ELYTRA.get(), DDItems.SONOROUS_STAFF.get());
tag(ItemTags.EQUIPPABLE_ENCHANTABLE).add(DDItems.SOUL_ELYTRA.get());

tag(DDTags.Items.RESONARIUM_ARMOR).add(DDItems.RESONARIUM_HELMET.get(), DDItems.RESONARIUM_CHESTPLATE.get(), DDItems.RESONARIUM_LEGGINGS.get(), DDItems.RESONARIUM_BOOTS.get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
import net.minecraft.core.registries.Registries;
import net.minecraft.data.worldgen.BootstrapContext;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.valueproviders.ConstantInt;
import net.minecraft.world.entity.ai.village.poi.PoiType;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.dimension.BuiltinDimensionTypes;
import net.minecraft.world.level.dimension.DimensionType;
import net.neoforged.neoforge.registries.DeferredHolder;
import net.neoforged.neoforge.registries.DeferredRegister;
Expand All @@ -20,9 +20,10 @@
public class OthersideDimension {
public static final ResourceKey<Level> OTHERSIDE_LEVEL = ResourceKey.create(Registries.DIMENSION, DeeperDarker.rl("otherside"));
public static final ResourceKey<DimensionType> OTHERSIDE = ResourceKey.create(Registries.DIMENSION_TYPE, DeeperDarker.rl("otherside"));
public static final ResourceLocation OTHERSIDE_EFFECTS = DeeperDarker.rl("otherside_effects");

public static void bootstrap(BootstrapContext<DimensionType> context) {
context.register(OTHERSIDE, new DimensionType(OptionalLong.of(18000L), false, true, false, true, 1, true, false, 0, 128, 128, DDTags.Blocks.INFINIBURN_OTHERSIDE, BuiltinDimensionTypes.NETHER_EFFECTS, 0.05f, new DimensionType.MonsterSettings(true, false, ConstantInt.of(7), 15)));
context.register(OTHERSIDE, new DimensionType(OptionalLong.of(18000L), false, true, false, true, 1, true, false, 0, 128, 128, DDTags.Blocks.INFINIBURN_OTHERSIDE, OTHERSIDE_EFFECTS, 0.05f, new DimensionType.MonsterSettings(true, false, ConstantInt.of(7), 15)));
}

public static final DeferredRegister<PoiType> POI = DeferredRegister.create(Registries.POINT_OF_INTEREST_TYPE, DeeperDarker.MOD_ID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@
import net.minecraft.BlockUtil;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.Vec3i;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.util.Mth;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityDimensions;
import net.minecraft.world.entity.ai.village.poi.PoiManager;
import net.minecraft.world.entity.ai.village.poi.PoiRecord;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
Expand All @@ -20,6 +23,7 @@
import net.minecraft.world.level.portal.PortalShape;
import net.minecraft.world.phys.Vec3;

import java.util.Comparator;
import java.util.Optional;

public class OthersideTeleporter {
Expand All @@ -31,12 +35,13 @@ public class OthersideTeleporter {
private static final int PORTAL_WIDTH = DeeperDarkerConfig.othersidePortalWidth;
private static final int PORTAL_HEIGHT = DeeperDarkerConfig.othersidePortalHeight;

public static DimensionTransition getExitPortal(ServerLevel destLevel, Entity entity, BlockPos pos, BlockPos exitPos, boolean isOtherside, WorldBorder destBorder) {
Optional<BlockPos> closestPos = destLevel.getPortalForcer().findClosestPortalPosition(exitPos, isOtherside, destBorder);
public static DimensionTransition getExitPortal(ServerLevel destLevel, Entity entity, BlockPos pos, BlockPos exitPos, WorldBorder destBorder) {
Optional<BlockPos> existingPortalPos = findExistingPortal(destLevel, exitPos, destBorder);
BlockUtil.FoundRectangle portal;
DimensionTransition.PostDimensionTransition transition;
if(closestPos.isPresent()) {
BlockPos blockPos = closestPos.get();

if(existingPortalPos.isPresent()) {
BlockPos blockPos = existingPortalPos.get();
BlockState destState = destLevel.getBlockState(blockPos);
portal = BlockUtil.getLargestRectangleAround(
blockPos,
Expand All @@ -49,36 +54,46 @@ public static DimensionTransition getExitPortal(ServerLevel destLevel, Entity en
transition = DimensionTransition.PLAY_PORTAL_SOUND.then(entity1 -> entity1.placePortalTicket(blockPos));
} else {
Direction.Axis direction = entity.level().getBlockState(pos).getOptionalValue(OthersidePortalBlock.AXIS).orElse(Direction.Axis.X);
Optional<BlockUtil.FoundRectangle> rectangle = makePortal(destLevel, exitPos, direction);
if(rectangle.isEmpty()) {
DeeperDarker.LOGGER.error("Unable to create a portal, likely target out of worldborder");
Optional<BlockUtil.FoundRectangle> newPortal = makePortal(destLevel, exitPos, direction);
if(newPortal.isEmpty()) {
DeeperDarker.LOGGER.error("Unable to create a portal, likely target out of world border");
return null;
}

portal = rectangle.get();
portal = newPortal.get();
transition = DimensionTransition.PLAY_PORTAL_SOUND.then(DimensionTransition.PLACE_PORTAL_TICKET);
}

return getDimensionTransitionFromExit(entity, pos, portal, destLevel, transition);
return transitionFromExit(entity, pos, portal, destLevel, transition);
}

private static Optional<BlockPos> findExistingPortal(ServerLevel level, BlockPos exitPos, WorldBorder worldBorder) {
PoiManager poimanager = level.getPoiManager();
poimanager.ensureLoadedAndValid(level, exitPos, 128);
return poimanager.getInSquare(poi -> poi.is(OthersideDimension.OTHERSIDE_PORTAL), exitPos, 128, PoiManager.Occupancy.ANY)
.map(PoiRecord::getPos)
.filter(worldBorder::isWithinBounds)
.filter(pos -> level.getBlockState(pos).hasProperty(BlockStateProperties.HORIZONTAL_AXIS))
.min(Comparator.<BlockPos>comparingDouble(pos -> pos.distSqr(exitPos)).thenComparingInt(Vec3i::getY));
}

private static DimensionTransition getDimensionTransitionFromExit(Entity entity, BlockPos pos, BlockUtil.FoundRectangle rectangle, ServerLevel level, DimensionTransition.PostDimensionTransition postTransition) {
private static DimensionTransition transitionFromExit(Entity entity, BlockPos pos, BlockUtil.FoundRectangle rectangle, ServerLevel level, DimensionTransition.PostDimensionTransition postTransition) {
BlockState state = entity.level().getBlockState(pos);
Direction.Axis axis;
Vec3 vec3;
if(state.hasProperty(BlockStateProperties.HORIZONTAL_AXIS)) {
axis = state.getValue(BlockStateProperties.HORIZONTAL_AXIS);
BlockUtil.FoundRectangle portal = BlockUtil.getLargestRectangleAround(pos, axis, MAX_WIDTH, Direction.Axis.Y, MAX_HEIGHT, p_351016_ -> entity.level().getBlockState(p_351016_) == state);
BlockUtil.FoundRectangle portal = BlockUtil.getLargestRectangleAround(pos, axis, MAX_WIDTH, Direction.Axis.Y, MAX_HEIGHT, blockPos -> entity.level().getBlockState(blockPos) == state);
vec3 = entity.getRelativePortalPosition(axis, portal);
} else {
axis = Direction.Axis.X;
vec3 = new Vec3(0.5, 0.0, 0.0);
}

return createDimensionTransition(level, rectangle, axis, vec3, entity, entity.getDeltaMovement(), entity.getYRot(), entity.getXRot(), postTransition);
return createTransition(level, rectangle, axis, vec3, entity, entity.getDeltaMovement(), entity.getYRot(), entity.getXRot(), postTransition);
}

private static DimensionTransition createDimensionTransition(ServerLevel level, BlockUtil.FoundRectangle rectangle, Direction.Axis axis, Vec3 offset, Entity entity, Vec3 speed, float yRot, float xRot, DimensionTransition.PostDimensionTransition postTransition) {
private static DimensionTransition createTransition(ServerLevel level, BlockUtil.FoundRectangle rectangle, Direction.Axis axis, Vec3 offset, Entity entity, Vec3 speed, float yRot, float xRot, DimensionTransition.PostDimensionTransition postTransition) {
BlockPos cornerPos = rectangle.minCorner;
BlockState cornerState = level.getBlockState(cornerPos);
Direction.Axis axis1 = cornerState.getOptionalValue(BlockStateProperties.HORIZONTAL_AXIS).orElse(Direction.Axis.X);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"deeperdarker:sculk_snapper",
"deeperdarker:shattered",
"deeperdarker:shriek_worm",
"deeperdarker:sludge",
"deeperdarker:stalker",
"minecraft:phantom",
"minecraft:warden"
]
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"type": "mekanism:crushing",
"input": {
"ingredient": {
"item": "deeperdarker:gloomslate_brick_slab"
}
"count": 1,
"item": "deeperdarker:gloomslate_brick_slab"
},
"output": {
"item": "deeperdarker:gloomslate_tile_slab"
"count": 1,
"id": "deeperdarker:gloomslate_tile_slab"
},
"neoforge:conditions": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"type": "mekanism:crushing",
"input": {
"ingredient": {
"item": "deeperdarker:gloomslate_brick_stairs"
}
"count": 1,
"item": "deeperdarker:gloomslate_brick_stairs"
},
"output": {
"item": "deeperdarker:gloomslate_tile_stairs"
"count": 1,
"id": "deeperdarker:gloomslate_tile_stairs"
},
"neoforge:conditions": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"type": "mekanism:crushing",
"input": {
"ingredient": {
"item": "deeperdarker:gloomslate_brick_wall"
}
"count": 1,
"item": "deeperdarker:gloomslate_brick_wall"
},
"output": {
"item": "deeperdarker:gloomslate_tile_wall"
"count": 1,
"id": "deeperdarker:gloomslate_tile_wall"
},
"neoforge:conditions": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"type": "mekanism:crushing",
"input": {
"ingredient": {
"item": "deeperdarker:gloomslate_bricks"
}
"count": 1,
"item": "deeperdarker:gloomslate_bricks"
},
"output": {
"item": "deeperdarker:gloomslate_tiles"
"count": 1,
"id": "deeperdarker:gloomslate_tiles"
},
"neoforge:conditions": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"type": "mekanism:crushing",
"input": {
"ingredient": {
"item": "deeperdarker:cut_gloomslate_slab"
}
"count": 1,
"item": "deeperdarker:cut_gloomslate_slab"
},
"output": {
"item": "deeperdarker:polished_gloomslate_slab"
"count": 1,
"id": "deeperdarker:polished_gloomslate_slab"
},
"neoforge:conditions": [
{
Expand Down
Loading

0 comments on commit 9a8358b

Please sign in to comment.