diff --git a/src/generated/resources/.cache/b2a5cff36cd7898e89c581bb80c5da767a3f79d1 b/src/generated/resources/.cache/b2a5cff36cd7898e89c581bb80c5da767a3f79d1 index cd2de41b9..fc9fa7e8e 100644 --- a/src/generated/resources/.cache/b2a5cff36cd7898e89c581bb80c5da767a3f79d1 +++ b/src/generated/resources/.cache/b2a5cff36cd7898e89c581bb80c5da767a3f79d1 @@ -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 @@ -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 diff --git a/src/generated/resources/data/minecraft/tags/item/enchantable/durability.json b/src/generated/resources/data/minecraft/tags/item/enchantable/durability.json index bf2c5564f..753c1e308 100644 --- a/src/generated/resources/data/minecraft/tags/item/enchantable/durability.json +++ b/src/generated/resources/data/minecraft/tags/item/enchantable/durability.json @@ -1,5 +1,6 @@ { "values": [ - "deeperdarker:soul_elytra" + "deeperdarker:soul_elytra", + "deeperdarker:sonorous_staff" ] } \ No newline at end of file diff --git a/src/main/java/com/kyanite/deeperdarker/content/items/SonorousStaffItem.java b/src/main/java/com/kyanite/deeperdarker/content/items/SonorousStaffItem.java index 6f8ae9586..53244439e 100644 --- a/src/main/java/com/kyanite/deeperdarker/content/items/SonorousStaffItem.java +++ b/src/main/java/com/kyanite/deeperdarker/content/items/SonorousStaffItem.java @@ -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; @@ -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")); diff --git a/src/main/java/com/kyanite/deeperdarker/content/items/SoulElytraItem.java b/src/main/java/com/kyanite/deeperdarker/content/items/SoulElytraItem.java index da26566c9..9ef53c84c 100644 --- a/src/main/java/com/kyanite/deeperdarker/content/items/SoulElytraItem.java +++ b/src/main/java/com/kyanite/deeperdarker/content/items/SoulElytraItem.java @@ -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 diff --git a/src/main/java/com/kyanite/deeperdarker/datagen/data/DDItemTagsProvider.java b/src/main/java/com/kyanite/deeperdarker/datagen/data/DDItemTagsProvider.java index 4227d5819..d3d304073 100644 --- a/src/main/java/com/kyanite/deeperdarker/datagen/data/DDItemTagsProvider.java +++ b/src/main/java/com/kyanite/deeperdarker/datagen/data/DDItemTagsProvider.java @@ -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()); diff --git a/src/main/java/com/kyanite/deeperdarker/world/otherside/OthersideTeleporter.java b/src/main/java/com/kyanite/deeperdarker/world/otherside/OthersideTeleporter.java index 2e7c767c1..19cb3e5da 100644 --- a/src/main/java/com/kyanite/deeperdarker/world/otherside/OthersideTeleporter.java +++ b/src/main/java/com/kyanite/deeperdarker/world/otherside/OthersideTeleporter.java @@ -36,7 +36,7 @@ public class OthersideTeleporter { private static final int PORTAL_HEIGHT = DeeperDarkerConfig.othersidePortalHeight; public static DimensionTransition getExitPortal(ServerLevel destLevel, Entity entity, BlockPos pos, BlockPos exitPos, WorldBorder destBorder) { - Optional existingPortalPos = findClosestPortalPosition(destLevel, exitPos, destBorder); + Optional existingPortalPos = findExistingPortal(destLevel, exitPos, destBorder); BlockUtil.FoundRectangle portal; DimensionTransition.PostDimensionTransition transition; @@ -64,10 +64,10 @@ public static DimensionTransition getExitPortal(ServerLevel destLevel, Entity en 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 findClosestPortalPosition(ServerLevel level, BlockPos exitPos, WorldBorder worldBorder) { + private static Optional 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) @@ -77,23 +77,23 @@ private static Optional findClosestPortalPosition(ServerLevel level, B .min(Comparator.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);