From eb70e23b578adb4cac57ae5db46bb5832f18e9ac Mon Sep 17 00:00:00 2001 From: craisinlord Date: Mon, 29 Jun 2026 01:21:31 -0500 Subject: [PATCH] Lurking terror and creeping horror egg fix, elythia terrain adjustments --- .../content/block/CreepingHorrorEggBlock.java | 17 +++++++++-------- .../content/block/LurkingTerrorEggBlock.java | 17 +++++++++-------- .../antarchy/content/entity/BomberEntity.java | 3 +-- .../models/block/creeping_horror_egg_4.json | 3 ++- .../models/block/lurking_terror_egg_4.json | 3 ++- .../slightly_cracked_creeping_horror_egg_4.json | 3 ++- .../slightly_cracked_lurking_terror_egg_4.json | 3 ++- .../very_cracked_creeping_horror_egg_4.json | 3 ++- .../very_cracked_lurking_terror_egg_4.json | 3 ++- .../density_function/elythia_surface.json | 6 +++--- 10 files changed, 34 insertions(+), 27 deletions(-) diff --git a/common/src/main/java/com/craisinlord/antarchy/content/block/CreepingHorrorEggBlock.java b/common/src/main/java/com/craisinlord/antarchy/content/block/CreepingHorrorEggBlock.java index 5d2077aa..f1e2f1d0 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/block/CreepingHorrorEggBlock.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/block/CreepingHorrorEggBlock.java @@ -36,6 +36,7 @@ public class CreepingHorrorEggBlock extends Block { public static final MapCodec CODEC = Block.simpleCodec(CreepingHorrorEggBlock::new); public static final IntegerProperty HATCH = BlockStateProperties.HATCH; public static final IntegerProperty EGGS = BlockStateProperties.EGGS; + private static final float PANIC_HATCH_CHANCE = 0.50F; private static final int MAX_HATCH = 2; private static final int MAX_EGGS = 4; private static final VoxelShape SINGLE_SHAPE = Block.box(3.0D, 0.0D, 3.0D, 13.0D, 7.0D, 13.0D); @@ -105,8 +106,10 @@ public class CreepingHorrorEggBlock extends Block { @Override public void stepOn(Level level, BlockPos pos, BlockState state, Entity entity) { - if (!entity.isSteppingCarefully()) { - this.destroyEgg(level, state, pos, entity, 100); + if (entity instanceof Player && !entity.isSteppingCarefully() && this.destroyEgg(level, state, pos, entity, 100)) { + if (level instanceof ServerLevel serverLevel) { + panicHatchNearby(serverLevel, pos); + } } super.stepOn(level, pos, state, entity); } @@ -128,9 +131,6 @@ public class CreepingHorrorEggBlock extends Block { public void playerDestroy(Level level, Player player, BlockPos pos, BlockState state, BlockEntity blockEntity, net.minecraft.world.item.ItemStack stack) { super.playerDestroy(level, player, pos, state, blockEntity, stack); this.decreaseEggs(level, pos, state); - if (level instanceof ServerLevel serverLevel) { - panicHatchNearby(serverLevel, pos); - } } private static void panicHatchNearby(ServerLevel level, BlockPos origin) { @@ -141,7 +141,7 @@ public class CreepingHorrorEggBlock extends Block { for (int dz = -radius; dz <= radius; dz++) { if (dx == 0 && dy == 0 && dz == 0) continue; mutable.set(origin.getX() + dx, origin.getY() + dy, origin.getZ() + dz); - if (level.random.nextFloat() >= 0.4f) continue; + if (level.random.nextFloat() >= PANIC_HATCH_CHANCE) continue; BlockState nearby = level.getBlockState(mutable); BlockPos immutable = mutable.immutable(); if (nearby.getBlock() instanceof CreepingHorrorEggBlock b) { @@ -167,12 +167,13 @@ public class CreepingHorrorEggBlock extends Block { return level.getBlockState(pos).is(BlockTags.SAND) || level.getBlockState(pos).blocksMotion(); } - private void destroyEgg(Level level, BlockState state, BlockPos pos, Entity entity, int chance) { + private boolean destroyEgg(Level level, BlockState state, BlockPos pos, Entity entity, int chance) { if (level.isClientSide || !this.canDestroyEgg(level, entity) || level.random.nextInt(chance) != 0) { - return; + return false; } level.playSound(null, pos, SoundEvents.TURTLE_EGG_BREAK, SoundSource.BLOCKS, 0.7F, 0.9F + level.random.nextFloat() * 0.2F); this.decreaseEggs(level, pos, state); + return true; } void hatchEggs(ServerLevel level, BlockPos pos, BlockState state, RandomSource random) { diff --git a/common/src/main/java/com/craisinlord/antarchy/content/block/LurkingTerrorEggBlock.java b/common/src/main/java/com/craisinlord/antarchy/content/block/LurkingTerrorEggBlock.java index 4c0d4417..39380d69 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/block/LurkingTerrorEggBlock.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/block/LurkingTerrorEggBlock.java @@ -36,6 +36,7 @@ public class LurkingTerrorEggBlock extends Block { public static final MapCodec CODEC = Block.simpleCodec(LurkingTerrorEggBlock::new); public static final IntegerProperty HATCH = BlockStateProperties.HATCH; public static final IntegerProperty EGGS = BlockStateProperties.EGGS; + private static final float PANIC_HATCH_CHANCE = 0.50F; private static final int MAX_HATCH = 2; private static final int MAX_EGGS = 4; private static final VoxelShape SINGLE_SHAPE = Block.box(3.0D, 0.0D, 3.0D, 13.0D, 7.0D, 13.0D); @@ -105,8 +106,10 @@ public class LurkingTerrorEggBlock extends Block { @Override public void stepOn(Level level, BlockPos pos, BlockState state, Entity entity) { - if (!entity.isSteppingCarefully()) { - this.destroyEgg(level, state, pos, entity, 100); + if (entity instanceof Player && !entity.isSteppingCarefully() && this.destroyEgg(level, state, pos, entity, 100)) { + if (level instanceof ServerLevel serverLevel) { + panicHatchNearby(serverLevel, pos); + } } super.stepOn(level, pos, state, entity); } @@ -128,9 +131,6 @@ public class LurkingTerrorEggBlock extends Block { public void playerDestroy(Level level, Player player, BlockPos pos, BlockState state, BlockEntity blockEntity, net.minecraft.world.item.ItemStack stack) { super.playerDestroy(level, player, pos, state, blockEntity, stack); this.decreaseEggs(level, pos, state); - if (level instanceof ServerLevel serverLevel) { - panicHatchNearby(serverLevel, pos); - } } private static void panicHatchNearby(ServerLevel level, BlockPos origin) { @@ -141,7 +141,7 @@ public class LurkingTerrorEggBlock extends Block { for (int dz = -radius; dz <= radius; dz++) { if (dx == 0 && dy == 0 && dz == 0) continue; mutable.set(origin.getX() + dx, origin.getY() + dy, origin.getZ() + dz); - if (level.random.nextFloat() >= 0.4f) continue; + if (level.random.nextFloat() >= PANIC_HATCH_CHANCE) continue; BlockState nearby = level.getBlockState(mutable); BlockPos immutable = mutable.immutable(); if (nearby.getBlock() instanceof LurkingTerrorEggBlock b) { @@ -167,12 +167,13 @@ public class LurkingTerrorEggBlock extends Block { return level.getBlockState(pos).is(BlockTags.SAND) || level.getBlockState(pos).blocksMotion(); } - private void destroyEgg(Level level, BlockState state, BlockPos pos, Entity entity, int chance) { + private boolean destroyEgg(Level level, BlockState state, BlockPos pos, Entity entity, int chance) { if (level.isClientSide || !this.canDestroyEgg(level, entity) || level.random.nextInt(chance) != 0) { - return; + return false; } level.playSound(null, pos, SoundEvents.TURTLE_EGG_BREAK, SoundSource.BLOCKS, 0.7F, 0.9F + level.random.nextFloat() * 0.2F); this.decreaseEggs(level, pos, state); + return true; } void hatchEggs(ServerLevel level, BlockPos pos, BlockState state, RandomSource random) { diff --git a/common/src/main/java/com/craisinlord/antarchy/content/entity/BomberEntity.java b/common/src/main/java/com/craisinlord/antarchy/content/entity/BomberEntity.java index b2398d8e..dba082b1 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/entity/BomberEntity.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/entity/BomberEntity.java @@ -134,11 +134,10 @@ public class BomberEntity extends Monster implements GeoEntity { @Override public boolean doHurtTarget(Entity target) { - if (!(target instanceof LivingEntity livingTarget)) { + if (!(target instanceof LivingEntity)) { return super.doHurtTarget(target); } - livingTarget.hurt(this.damageSources().mobAttack(this), (float) this.getAttributeValue(Attributes.ATTACK_DAMAGE)); this.primeFuse(); return true; } diff --git a/common/src/main/resources/assets/antarchy/models/block/creeping_horror_egg_4.json b/common/src/main/resources/assets/antarchy/models/block/creeping_horror_egg_4.json index af64531c..e5ba6281 100644 --- a/common/src/main/resources/assets/antarchy/models/block/creeping_horror_egg_4.json +++ b/common/src/main/resources/assets/antarchy/models/block/creeping_horror_egg_4.json @@ -1,6 +1,7 @@ { "parent": "minecraft:block/template_four_turtle_eggs", "textures": { - "all": "antarchy:block/creeping_horror_egg/creeping_horror_egg" + "all": "antarchy:block/creeping_horror_egg/creeping_horror_egg", + "particle": "antarchy:block/creeping_horror_egg/creeping_horror_egg" } } diff --git a/common/src/main/resources/assets/antarchy/models/block/lurking_terror_egg_4.json b/common/src/main/resources/assets/antarchy/models/block/lurking_terror_egg_4.json index a971716e..30d35294 100644 --- a/common/src/main/resources/assets/antarchy/models/block/lurking_terror_egg_4.json +++ b/common/src/main/resources/assets/antarchy/models/block/lurking_terror_egg_4.json @@ -1,6 +1,7 @@ { "parent": "minecraft:block/template_four_turtle_eggs", "textures": { - "all": "antarchy:block/lurking_terror_egg/lurking_terror_egg" + "all": "antarchy:block/lurking_terror_egg/lurking_terror_egg", + "particle": "antarchy:block/lurking_terror_egg/lurking_terror_egg" } } diff --git a/common/src/main/resources/assets/antarchy/models/block/slightly_cracked_creeping_horror_egg_4.json b/common/src/main/resources/assets/antarchy/models/block/slightly_cracked_creeping_horror_egg_4.json index 251150cc..a3863d21 100644 --- a/common/src/main/resources/assets/antarchy/models/block/slightly_cracked_creeping_horror_egg_4.json +++ b/common/src/main/resources/assets/antarchy/models/block/slightly_cracked_creeping_horror_egg_4.json @@ -1,6 +1,7 @@ { "parent": "minecraft:block/template_four_turtle_eggs", "textures": { - "all": "antarchy:block/creeping_horror_egg/creeping_horror_egg_slightly_cracked" + "all": "antarchy:block/creeping_horror_egg/creeping_horror_egg_slightly_cracked", + "particle": "antarchy:block/creeping_horror_egg/creeping_horror_egg_slightly_cracked" } } diff --git a/common/src/main/resources/assets/antarchy/models/block/slightly_cracked_lurking_terror_egg_4.json b/common/src/main/resources/assets/antarchy/models/block/slightly_cracked_lurking_terror_egg_4.json index 7a890da7..884cc982 100644 --- a/common/src/main/resources/assets/antarchy/models/block/slightly_cracked_lurking_terror_egg_4.json +++ b/common/src/main/resources/assets/antarchy/models/block/slightly_cracked_lurking_terror_egg_4.json @@ -1,6 +1,7 @@ { "parent": "minecraft:block/template_four_turtle_eggs", "textures": { - "all": "antarchy:block/lurking_terror_egg/lurking_terror_egg_slightly_cracked" + "all": "antarchy:block/lurking_terror_egg/lurking_terror_egg_slightly_cracked", + "particle": "antarchy:block/lurking_terror_egg/lurking_terror_egg_slightly_cracked" } } diff --git a/common/src/main/resources/assets/antarchy/models/block/very_cracked_creeping_horror_egg_4.json b/common/src/main/resources/assets/antarchy/models/block/very_cracked_creeping_horror_egg_4.json index d034d949..71494d84 100644 --- a/common/src/main/resources/assets/antarchy/models/block/very_cracked_creeping_horror_egg_4.json +++ b/common/src/main/resources/assets/antarchy/models/block/very_cracked_creeping_horror_egg_4.json @@ -1,6 +1,7 @@ { "parent": "minecraft:block/template_four_turtle_eggs", "textures": { - "all": "antarchy:block/creeping_horror_egg/creeping_horror_egg_very_cracked" + "all": "antarchy:block/creeping_horror_egg/creeping_horror_egg_very_cracked", + "particle": "antarchy:block/creeping_horror_egg/creeping_horror_egg_very_cracked" } } diff --git a/common/src/main/resources/assets/antarchy/models/block/very_cracked_lurking_terror_egg_4.json b/common/src/main/resources/assets/antarchy/models/block/very_cracked_lurking_terror_egg_4.json index ca09f12d..c4e1dca5 100644 --- a/common/src/main/resources/assets/antarchy/models/block/very_cracked_lurking_terror_egg_4.json +++ b/common/src/main/resources/assets/antarchy/models/block/very_cracked_lurking_terror_egg_4.json @@ -1,6 +1,7 @@ { "parent": "minecraft:block/template_four_turtle_eggs", "textures": { - "all": "antarchy:block/lurking_terror_egg/lurking_terror_egg_very_cracked" + "all": "antarchy:block/lurking_terror_egg/lurking_terror_egg_very_cracked", + "particle": "antarchy:block/lurking_terror_egg/lurking_terror_egg_very_cracked" } } diff --git a/common/src/main/resources/data/antarchy/worldgen/density_function/elythia_surface.json b/common/src/main/resources/data/antarchy/worldgen/density_function/elythia_surface.json index 59016ffd..869221e0 100644 --- a/common/src/main/resources/data/antarchy/worldgen/density_function/elythia_surface.json +++ b/common/src/main/resources/data/antarchy/worldgen/density_function/elythia_surface.json @@ -6,8 +6,8 @@ "type": "minecraft:y_clamped_gradient", "from_y": -64, "to_y": 220, - "from_value": 1.75, - "to_value": -2.05 + "from_value": 2.20, + "to_value": -1.90 }, "argument2": { "type": "minecraft:add", @@ -70,7 +70,7 @@ }, "argument2": { "type": "minecraft:mul", - "argument1": 0.30, + "argument1": 0.55, "argument2": "minecraft:overworld/continents" } }