diff --git a/common/src/main/java/com/craisinlord/antarchy/config/AntarchySettings.java b/common/src/main/java/com/craisinlord/antarchy/config/AntarchySettings.java index c69b958b..e109f2e3 100644 --- a/common/src/main/java/com/craisinlord/antarchy/config/AntarchySettings.java +++ b/common/src/main/java/com/craisinlord/antarchy/config/AntarchySettings.java @@ -522,6 +522,14 @@ public final class AntarchySettings { private static double creepingHorrorAttackDamage = 6.0D; private static double lurkingTerrorHealth = 15.0D; private static double lurkingTerrorAttackDamage = 6.0D; + private static double jerryInfantHealth = 20.0D; + private static double jerryInfantAttackDamage = 2.0D; + private static double jerryMatureHealth = 40.0D; + private static double jerryMatureAttackDamage = 3.5D; + private static double jerryAlphaHealth = 60.0D; + private static double jerryAlphaAttackDamage = 6.0D; + private static double jerryGammaHealth = 60.0D; + private static double jerryGammaAttackDamage = 7.0D; private static double cheepHealth = 8.0D; private static double cheepAttackDamage = 3.0D; private static double dorrieHealth = 60.0D; @@ -2789,6 +2797,22 @@ public final class AntarchySettings { public static void setLurkingTerrorHealth(double v) { lurkingTerrorHealth = v; } public static double lurkingTerrorAttackDamage() { return lurkingTerrorAttackDamage; } public static void setLurkingTerrorAttackDamage(double v) { lurkingTerrorAttackDamage = v; } + public static double jerryInfantHealth() { return jerryInfantHealth; } + public static void setJerryInfantHealth(double v) { jerryInfantHealth = v; } + public static double jerryInfantAttackDamage() { return jerryInfantAttackDamage; } + public static void setJerryInfantAttackDamage(double v) { jerryInfantAttackDamage = v; } + public static double jerryMatureHealth() { return jerryMatureHealth; } + public static void setJerryMatureHealth(double v) { jerryMatureHealth = v; } + public static double jerryMatureAttackDamage() { return jerryMatureAttackDamage; } + public static void setJerryMatureAttackDamage(double v) { jerryMatureAttackDamage = v; } + public static double jerryAlphaHealth() { return jerryAlphaHealth; } + public static void setJerryAlphaHealth(double v) { jerryAlphaHealth = v; } + public static double jerryAlphaAttackDamage() { return jerryAlphaAttackDamage; } + public static void setJerryAlphaAttackDamage(double v) { jerryAlphaAttackDamage = v; } + public static double jerryGammaHealth() { return jerryGammaHealth; } + public static void setJerryGammaHealth(double v) { jerryGammaHealth = v; } + public static double jerryGammaAttackDamage() { return jerryGammaAttackDamage; } + public static void setJerryGammaAttackDamage(double v) { jerryGammaAttackDamage = v; } public static double cheepHealth() { return cheepHealth; } public static void setCheepHealth(double v) { cheepHealth = v; } public static double cheepAttackDamage() { return cheepAttackDamage; } diff --git a/common/src/main/java/com/craisinlord/antarchy/content/CreativeTabOrder.java b/common/src/main/java/com/craisinlord/antarchy/content/CreativeTabOrder.java index 3b85d77f..cc1fafd8 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/CreativeTabOrder.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/CreativeTabOrder.java @@ -74,7 +74,7 @@ public final class CreativeTabOrder { "dead_star_coral", "dead_star_coral_fan", "dead_star_coral_block" -> 11; case "dream_torch", "dream_lantern", "dream_campfire", "dream_fire", "dream_fire_ceiling" -> 12; case "antimetal_scaffolding" -> 13; - case "infested_rooted_dirt", "infested_coarse_dirt", "bed_bug_egg", "creeping_horror_egg", "lurking_terror_egg", "jumpy_bug_egg", "spit_bug_egg", "metroid_egg" -> 14; + case "infested_rooted_dirt", "infested_coarse_dirt", "bed_bug_egg", "creeping_horror_egg", "lurking_terror_egg", "jumpy_bug_egg", "spit_bug_egg", "jerry_egg" -> 14; case "ultimate_pickaxe", "ultimate_axe", "ultimate_shovel", "ultimate_hoe", "duct_tape", "diamond_minecart", "critter_cage", "gravity_sculk_sensor", "miners_dream" -> 15; case "bile_bucket", "ichor_bucket", "antiwater_bucket", "cloud_bucket", "lumen_bucket" -> 16; @@ -101,7 +101,8 @@ public final class CreativeTabOrder { "uranium_ingot", "titanium_ingot", "lucid_eye", "mantis_claw", "hercules_horn", "jumpy_bug_leg", "brutalfly_wing", "cornea_ear", "primordial_scute", "triffid_goo", "vortex_eye", - "king_scale", "queen_scale", "chiten", "stink_bug", "corn", "high_fructose_corn_syrup" -> 22; + "king_scale", "queen_scale", "chiten", "jerry_nucleus", "carapace", + "stink_bug", "corn", "high_fructose_corn_syrup" -> 22; case "reverie_bottle", "glimmer_bottle", "root_beer" -> 24; case "easter_bunny_spawn_egg", "flying_squirrel_spawn_egg", "caterpillar_spawn_egg", "butterfly_spawn_egg", "reverie_spawn_egg", "brutalfly_spawn_egg", @@ -114,7 +115,7 @@ public final class CreativeTabOrder { "nightmare_spawn_egg", "bed_bug_spawn_egg", "lucid_spawn_egg", "scorpion_spawn_egg", "basilisk_spawn_egg", "emperor_scorpion_spawn_egg", "toreterror_spawn_egg", "dorrie_spawn_egg", "glimmer_spawn_egg", "ouranwood_deer_spawn_egg", "elka_spawn_egg", - "hercules_beetle_spawn_egg", "creeping_horror_spawn_egg", "lurking_terror_spawn_egg" -> 25; + "hercules_beetle_spawn_egg", "creeping_horror_spawn_egg", "lurking_terror_spawn_egg", "jerry_spawn_egg" -> 25; default -> 99; }; } @@ -357,9 +358,11 @@ public final class CreativeTabOrder { case "king_scale" -> 22; case "queen_scale" -> 23; case "chiten" -> 24; - case "stink_bug" -> 25; - case "corn" -> 26; - case "high_fructose_corn_syrup" -> 27; + case "jerry_nucleus" -> 25; + case "carapace" -> 26; + case "stink_bug" -> 27; + case "corn" -> 28; + case "high_fructose_corn_syrup" -> 29; default -> 0; }; } diff --git a/common/src/main/java/com/craisinlord/antarchy/content/block/BiowartTendrilsBlock.java b/common/src/main/java/com/craisinlord/antarchy/content/block/BiowartTendrilsBlock.java index ca57f6b8..a36c6d1c 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/block/BiowartTendrilsBlock.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/block/BiowartTendrilsBlock.java @@ -26,7 +26,7 @@ public class BiowartTendrilsBlock extends BushBlock { @Override protected boolean mayPlaceOn(BlockState state, BlockGetter level, BlockPos pos) { - return state.getBlock() instanceof BiowartBlock; + return super.mayPlaceOn(state, level, pos); } @Override diff --git a/common/src/main/java/com/craisinlord/antarchy/content/block/MetroidEggBlock.java b/common/src/main/java/com/craisinlord/antarchy/content/block/JerryEggBlock.java similarity index 61% rename from common/src/main/java/com/craisinlord/antarchy/content/block/MetroidEggBlock.java rename to common/src/main/java/com/craisinlord/antarchy/content/block/JerryEggBlock.java index 1ad663d8..78ef5040 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/block/MetroidEggBlock.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/block/JerryEggBlock.java @@ -1,8 +1,17 @@ package com.craisinlord.antarchy.content.block; +import com.craisinlord.antarchy.Antarchy; +import com.craisinlord.antarchy.content.entity.JerryEntity; import com.mojang.serialization.MapCodec; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.sounds.SoundEvents; +import net.minecraft.sounds.SoundSource; +import net.minecraft.util.RandomSource; +import net.minecraft.world.entity.EntityType; import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.LevelAccessor; @@ -18,18 +27,20 @@ import net.minecraft.world.level.block.state.properties.BooleanProperty; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; -public class MetroidEggBlock extends Block { - public static final MapCodec CODEC = Block.simpleCodec(MetroidEggBlock::new); +public class JerryEggBlock extends Block { + public static final MapCodec CODEC = Block.simpleCodec(JerryEggBlock::new); public static final BooleanProperty ROTATED = BooleanProperty.create("rotated"); + private static final ResourceLocation JERRY_ID = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "jerry"); + private static final int HATCH_CHECK_INTERVAL = 1200; private static final VoxelShape SHAPE = Block.box(1.0D, 0.0D, 0.0D, 15.0D, 16.0D, 16.0D); - public MetroidEggBlock(BlockBehaviour.Properties properties) { + public JerryEggBlock(BlockBehaviour.Properties properties) { super(properties); this.registerDefaultState(this.stateDefinition.any().setValue(ROTATED, false)); } @Override - public MapCodec codec() { + public MapCodec codec() { return CODEC; } @@ -65,6 +76,26 @@ public class MetroidEggBlock extends Block { return state.canSurvive(level, pos) ? super.updateShape(state, direction, neighborState, level, pos, neighborPos) : Blocks.AIR.defaultBlockState(); } + @Override + protected boolean isRandomlyTicking(BlockState state) { + return true; + } + + @Override + protected void randomTick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) { + if (random.nextInt(HATCH_CHECK_INTERVAL) != 0) { + return; + } + EntityType entityType = BuiltInRegistries.ENTITY_TYPE.get(JERRY_ID); + if (entityType.create(level) instanceof JerryEntity jerry) { + jerry.setStage(JerryEntity.Stage.INFANT); + jerry.moveTo(pos.getX() + 0.5D, pos.getY() + 0.15D, pos.getZ() + 0.5D, random.nextFloat() * 360.0F, 0.0F); + level.addFreshEntity(jerry); + level.destroyBlock(pos, false); + level.playSound(null, pos, SoundEvents.TURTLE_EGG_HATCH, SoundSource.HOSTILE, 0.8F, 0.8F + random.nextFloat() * 0.2F); + } + } + @Override protected void createBlockStateDefinition(StateDefinition.Builder builder) { builder.add(ROTATED); diff --git a/common/src/main/java/com/craisinlord/antarchy/content/block/JumpyBugEggBlock.java b/common/src/main/java/com/craisinlord/antarchy/content/block/JumpyBugEggBlock.java index e506d77a..a37ae85a 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/block/JumpyBugEggBlock.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/block/JumpyBugEggBlock.java @@ -40,8 +40,8 @@ public class JumpyBugEggBlock extends Block { private static final double PLAYER_PROXIMITY_RADIUS = 12.0D; private static final float PLAYER_PROXIMITY_HATCH_CHANCE = 0.25F; private static final int PLAYER_PROXIMITY_CHECK_INTERVAL = 200; - private static final VoxelShape FLOOR_SHAPE = Block.box(1.0D, 0.0D, 1.0D, 15.0D, 16.0D, 15.0D); - private static final VoxelShape CEILING_SHAPE = Block.box(1.0D, 0.0D, 1.0D, 15.0D, 16.0D, 15.0D); + private static final VoxelShape FLOOR_SHAPE = Block.box(1.5D, 0.0D, 1.5D, 14.5D, 16.0D, 14.5D); + private static final VoxelShape CEILING_SHAPE = Block.box(1.5D, 0.0D, 1.5D, 14.5D, 16.0D, 14.5D); private static final ResourceLocation JUMPY_BUG_ID = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "jumpy_bug"); public JumpyBugEggBlock(BlockBehaviour.Properties properties) { diff --git a/common/src/main/java/com/craisinlord/antarchy/content/block/SpitBugEggBlock.java b/common/src/main/java/com/craisinlord/antarchy/content/block/SpitBugEggBlock.java index 65c676b1..a674c328 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/block/SpitBugEggBlock.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/block/SpitBugEggBlock.java @@ -39,7 +39,7 @@ public class SpitBugEggBlock extends Block { private static final double PLAYER_PROXIMITY_RADIUS = 12.0D; private static final float PLAYER_PROXIMITY_HATCH_CHANCE = 0.25F; private static final int PLAYER_PROXIMITY_CHECK_INTERVAL = 200; - private static final VoxelShape SHAPE = Block.box(1.0D, 0.0D, 1.0D, 15.0D, 16.0D, 15.0D); + private static final VoxelShape SHAPE = Block.box(1.5D, 0.0D, 1.5D, 14.5D, 16.0D, 14.5D); private static final ResourceLocation SPIT_BUG_ID = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "spit_bug"); public SpitBugEggBlock(BlockBehaviour.Properties properties) { diff --git a/common/src/main/java/com/craisinlord/antarchy/content/client/HordeClientState.java b/common/src/main/java/com/craisinlord/antarchy/content/client/HordeClientState.java index 87405147..f14c5312 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/client/HordeClientState.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/client/HordeClientState.java @@ -1,11 +1,20 @@ package com.craisinlord.antarchy.content.client; +import com.craisinlord.antarchy.Antarchy; import net.minecraft.client.Minecraft; import net.minecraft.core.particles.ParticleTypes; +import net.minecraft.core.registries.Registries; +import net.minecraft.resources.ResourceKey; +import net.minecraft.resources.ResourceLocation; import net.minecraft.util.Mth; +import net.minecraft.world.level.Level; import net.minecraft.world.phys.Vec3; public final class HordeClientState { + private static final ResourceKey CAVARYN = ResourceKey.create( + Registries.DIMENSION, + ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "cavaryn") + ); private static float targetIntensity; private static float intensity; @@ -22,7 +31,7 @@ public final class HordeClientState { public static void tick() { Minecraft minecraft = Minecraft.getInstance(); - if (minecraft.level == null || minecraft.player == null) { + if (minecraft.level == null || minecraft.player == null || !minecraft.level.dimension().equals(CAVARYN)) { targetIntensity = 0.0F; } diff --git a/common/src/main/java/com/craisinlord/antarchy/content/client/HordeHudRenderer.java b/common/src/main/java/com/craisinlord/antarchy/content/client/HordeHudRenderer.java index b3c7629b..2de22d11 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/client/HordeHudRenderer.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/client/HordeHudRenderer.java @@ -1,16 +1,26 @@ package com.craisinlord.antarchy.content.client; +import com.craisinlord.antarchy.Antarchy; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; +import net.minecraft.core.registries.Registries; +import net.minecraft.resources.ResourceKey; +import net.minecraft.resources.ResourceLocation; import net.minecraft.util.Mth; +import net.minecraft.world.level.Level; public final class HordeHudRenderer { + private static final ResourceKey CAVARYN = ResourceKey.create( + Registries.DIMENSION, + ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "cavaryn") + ); + private HordeHudRenderer() { } public static void render(GuiGraphics guiGraphics) { Minecraft minecraft = Minecraft.getInstance(); - if (minecraft.player == null || minecraft.player.isDeadOrDying()) { + if (minecraft.level == null || minecraft.player == null || minecraft.player.isDeadOrDying() || !minecraft.level.dimension().equals(CAVARYN)) { return; } diff --git a/common/src/main/java/com/craisinlord/antarchy/content/client/model/JerryModel.java b/common/src/main/java/com/craisinlord/antarchy/content/client/model/JerryModel.java new file mode 100644 index 00000000..de32da7c --- /dev/null +++ b/common/src/main/java/com/craisinlord/antarchy/content/client/model/JerryModel.java @@ -0,0 +1,27 @@ +package com.craisinlord.antarchy.content.client.model; + +import com.craisinlord.antarchy.Antarchy; +import com.craisinlord.antarchy.content.entity.JerryEntity; +import net.minecraft.resources.ResourceLocation; +import software.bernie.geckolib.model.GeoModel; + +public class JerryModel extends GeoModel { + @Override + public ResourceLocation getModelResource(JerryEntity animatable) { + return ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "geo/" + stageName(animatable) + "_jerry.geo.json"); + } + + @Override + public ResourceLocation getTextureResource(JerryEntity animatable) { + return ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "textures/entity/jerry/" + stageName(animatable) + "_jerry.png"); + } + + @Override + public ResourceLocation getAnimationResource(JerryEntity animatable) { + return ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "animations/" + stageName(animatable) + "_jerry.animation.json"); + } + + private static String stageName(JerryEntity animatable) { + return animatable.getStage().getSerializedName(); + } +} diff --git a/common/src/main/java/com/craisinlord/antarchy/content/client/renderer/JerryRenderer.java b/common/src/main/java/com/craisinlord/antarchy/content/client/renderer/JerryRenderer.java new file mode 100644 index 00000000..b377b997 --- /dev/null +++ b/common/src/main/java/com/craisinlord/antarchy/content/client/renderer/JerryRenderer.java @@ -0,0 +1,25 @@ +package com.craisinlord.antarchy.content.client.renderer; + +import com.craisinlord.antarchy.content.client.model.JerryModel; +import com.craisinlord.antarchy.content.entity.JerryEntity; +import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.entity.EntityRendererProvider; +import net.minecraft.resources.ResourceLocation; +import org.jetbrains.annotations.Nullable; +import software.bernie.geckolib.renderer.GeoEntityRenderer; + +public class JerryRenderer extends GeoEntityRenderer { + public JerryRenderer(EntityRendererProvider.Context context) { + super(context, new JerryModel()); + this.shadowRadius = 0.7F; + } + + @Override + public RenderType getRenderType(JerryEntity animatable, ResourceLocation texture, @Nullable MultiBufferSource bufferSource, float partialTick) { + JerryEntity.Stage stage = animatable.getStage(); + return stage == JerryEntity.Stage.INFANT || stage == JerryEntity.Stage.MATURE + ? RenderType.entityTranslucent(texture) + : RenderType.entityCutoutNoCull(texture); + } +} diff --git a/common/src/main/java/com/craisinlord/antarchy/content/effect/GoopedMobEffect.java b/common/src/main/java/com/craisinlord/antarchy/content/effect/GoopedMobEffect.java index cfc5a5fd..097bc889 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/effect/GoopedMobEffect.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/effect/GoopedMobEffect.java @@ -8,18 +8,20 @@ import net.minecraft.world.entity.ai.attributes.AttributeModifier; import net.minecraft.world.entity.ai.attributes.Attributes; public final class GoopedMobEffect extends MobEffect { + private static final double SLOWDOWN_PER_LEVEL = -0.3D; + public GoopedMobEffect() { super(MobEffectCategory.HARMFUL, 0x32B84E); this.addAttributeModifier( Attributes.ATTACK_SPEED, ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "gooped_attack_speed"), - -0.3D, + SLOWDOWN_PER_LEVEL, AttributeModifier.Operation.ADD_MULTIPLIED_TOTAL ); this.addAttributeModifier( Attributes.MOVEMENT_SPEED, ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "gooped_movement_speed"), - -0.3D, + SLOWDOWN_PER_LEVEL, AttributeModifier.Operation.ADD_MULTIPLIED_TOTAL ); } diff --git a/common/src/main/java/com/craisinlord/antarchy/content/entity/CavarynBurrowingMobBehavior.java b/common/src/main/java/com/craisinlord/antarchy/content/entity/CavarynBurrowingMobBehavior.java new file mode 100644 index 00000000..3653f918 --- /dev/null +++ b/common/src/main/java/com/craisinlord/antarchy/content/entity/CavarynBurrowingMobBehavior.java @@ -0,0 +1,39 @@ +package com.craisinlord.antarchy.content.entity; + +import net.minecraft.server.level.ServerLevel; +import net.minecraft.world.entity.Mob; +import net.minecraft.world.phys.AABB; +import net.minecraft.world.phys.Vec3; + +public final class CavarynBurrowingMobBehavior { + private static final int MAX_UPWARD_SEARCH = 8; + + private CavarynBurrowingMobBehavior() { + } + + public static void moveOutOfBlocks(Mob mob) { + if (!(mob.level() instanceof ServerLevel level) || !mob.isAlive()) { + return; + } + AABB box = mob.getBoundingBox(); + if (level.noCollision(mob, box)) { + return; + } + + double startY = mob.getY(); + for (int offset = 1; offset <= MAX_UPWARD_SEARCH; offset++) { + double candidateY = Math.floor(startY) + offset; + AABB candidateBox = box.move(0.0D, candidateY - startY, 0.0D); + if (!level.noCollision(mob, candidateBox)) { + continue; + } + + mob.setPos(mob.getX(), candidateY, mob.getZ()); + Vec3 motion = mob.getDeltaMovement(); + mob.setDeltaMovement(motion.x, Math.max(0.0D, motion.y), motion.z); + mob.fallDistance = 0.0F; + mob.getNavigation().stop(); + return; + } + } +} diff --git a/common/src/main/java/com/craisinlord/antarchy/content/entity/CreepingHorrorEntity.java b/common/src/main/java/com/craisinlord/antarchy/content/entity/CreepingHorrorEntity.java index 70a7e795..108a9ac7 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/entity/CreepingHorrorEntity.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/entity/CreepingHorrorEntity.java @@ -169,7 +169,9 @@ public class CreepingHorrorEntity extends Monster implements GeoEntity { @Override public void tick() { + CavarynBurrowingMobBehavior.moveOutOfBlocks(this); super.tick(); + CavarynBurrowingMobBehavior.moveOutOfBlocks(this); if (attackAnimTicks > 0) attackAnimTicks--; if (this.level().isClientSide()) return; @@ -194,4 +196,9 @@ public class CreepingHorrorEntity extends Monster implements GeoEntity { this.getNavigation().stop(); } } + + @Override + public boolean isInWall() { + return false; + } } diff --git a/common/src/main/java/com/craisinlord/antarchy/content/entity/HerculesBeetleEntity.java b/common/src/main/java/com/craisinlord/antarchy/content/entity/HerculesBeetleEntity.java index a50cc0fe..c124caee 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/entity/HerculesBeetleEntity.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/entity/HerculesBeetleEntity.java @@ -275,7 +275,9 @@ public class HerculesBeetleEntity extends TamableAnimal implements GeoEntity, Fl @Override public void tick() { + CavarynBurrowingMobBehavior.moveOutOfBlocks(this); super.tick(); + CavarynBurrowingMobBehavior.moveOutOfBlocks(this); if (this.level().isClientSide) { return; @@ -322,10 +324,6 @@ public class HerculesBeetleEntity extends TamableAnimal implements GeoEntity, Fl this.playSound(AntarchySoundEvents.MANTIS_FLY_LOOP.get(), 0.5F, 0.85F + this.random.nextFloat() * 0.1F); } - if (!this.level().isClientSide && !this.isKnockedDown() && this.isInWall()) { - this.breakBlocksForSuffocation(); - } - if (this.isKnockedDown()) { this.tickKnockedDown(); } else if (this.chargeTicksRemaining > 0 || this.getAnimationState() == ANIM_CHARGE) { @@ -1058,6 +1056,11 @@ public class HerculesBeetleEntity extends TamableAnimal implements GeoEntity, Fl return false; } + @Override + public boolean isInWall() { + return false; + } + @Override protected void checkFallDamage(double y, boolean onGround, BlockState state, BlockPos pos) { } @@ -1079,8 +1082,8 @@ public class HerculesBeetleEntity extends TamableAnimal implements GeoEntity, Fl @Override public boolean canAttack(LivingEntity target) { - if (this.isTame() && target instanceof Player) { - return false; + if (target instanceof Player player) { + return !this.isTame() && !player.isCreative() && !player.isSpectator() && super.canAttack(target); } return super.canAttack(target); } @@ -1226,13 +1229,18 @@ public class HerculesBeetleEntity extends TamableAnimal implements GeoEntity, Fl public boolean canUse() { return !HerculesBeetleEntity.this.isTame() && !HerculesBeetleEntity.this.isKnockedDown() - && HerculesBeetleEntity.this.getTarget() != null; + && HerculesBeetleEntity.this.getTarget() != null + && HerculesBeetleEntity.this.canAttack(HerculesBeetleEntity.this.getTarget()); } @Override public boolean canContinueToUse() { LivingEntity target = HerculesBeetleEntity.this.getTarget(); - return target != null && target.isAlive() && !HerculesBeetleEntity.this.isTame() && !HerculesBeetleEntity.this.isKnockedDown(); + return target != null + && target.isAlive() + && !HerculesBeetleEntity.this.isTame() + && !HerculesBeetleEntity.this.isKnockedDown() + && HerculesBeetleEntity.this.canAttack(target); } @Override @@ -1241,6 +1249,11 @@ public class HerculesBeetleEntity extends TamableAnimal implements GeoEntity, Fl if (target == null) { return; } + if (!HerculesBeetleEntity.this.canAttack(target)) { + HerculesBeetleEntity.this.setTarget(null); + HerculesBeetleEntity.this.getNavigation().stop(); + return; + } HerculesBeetleEntity.this.getLookControl().setLookAt(target, 30.0F, 20.0F); diff --git a/common/src/main/java/com/craisinlord/antarchy/content/entity/JerryEntity.java b/common/src/main/java/com/craisinlord/antarchy/content/entity/JerryEntity.java new file mode 100644 index 00000000..c3686f3c --- /dev/null +++ b/common/src/main/java/com/craisinlord/antarchy/content/entity/JerryEntity.java @@ -0,0 +1,428 @@ +package com.craisinlord.antarchy.content.entity; + +import com.craisinlord.antarchy.config.AntarchySettings; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.network.syncher.EntityDataAccessor; +import net.minecraft.network.syncher.EntityDataSerializers; +import net.minecraft.network.syncher.SynchedEntityData; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.util.ByIdMap; +import net.minecraft.util.Mth; +import net.minecraft.util.StringRepresentable; +import net.minecraft.world.Difficulty; +import net.minecraft.world.DifficultyInstance; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.InteractionResult; +import net.minecraft.world.damagesource.DamageSource; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.entity.Mob; +import net.minecraft.world.entity.MobSpawnType; +import net.minecraft.world.entity.SpawnGroupData; +import net.minecraft.world.entity.ai.attributes.AttributeSupplier; +import net.minecraft.world.entity.ai.attributes.Attributes; +import net.minecraft.world.entity.ai.goal.Goal; +import net.minecraft.world.entity.ai.goal.LookAtPlayerGoal; +import net.minecraft.world.entity.ai.goal.MeleeAttackGoal; +import net.minecraft.world.entity.ai.goal.RandomLookAroundGoal; +import net.minecraft.world.entity.ai.goal.target.HurtByTargetGoal; +import net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal; +import net.minecraft.world.entity.monster.Monster; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.SpawnEggItem; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.ServerLevelAccessor; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.phys.Vec3; +import org.jetbrains.annotations.Nullable; +import software.bernie.geckolib.animatable.GeoEntity; +import software.bernie.geckolib.animatable.instance.AnimatableInstanceCache; +import software.bernie.geckolib.animation.AnimatableManager; +import software.bernie.geckolib.animation.AnimationController; +import software.bernie.geckolib.animation.AnimationState; +import software.bernie.geckolib.animation.PlayState; +import software.bernie.geckolib.animation.RawAnimation; +import software.bernie.geckolib.util.GeckoLibUtil; + +import java.util.Locale; +import java.util.Objects; +import java.util.function.IntFunction; + +public class JerryEntity extends Monster implements GeoEntity { + private static final EntityDataAccessor STAGE = + SynchedEntityData.defineId(JerryEntity.class, EntityDataSerializers.INT); + private static final EntityDataAccessor ATTACK_ANIM_TICKS = + SynchedEntityData.defineId(JerryEntity.class, EntityDataSerializers.INT); + + private static final String STAGE_KEY = "JerryStage"; + private static final String STAGE_AGE_KEY = "JerryStageAge"; + private static final int GROWTH_TICKS = 24000; + private static final int ATTACH_DAMAGE_INTERVAL = 20; + private static final int ATTACK_ANIM_DURATION = 16; + + private static final RawAnimation IDLE_ANIM = RawAnimation.begin().thenLoop("idle"); + private static final RawAnimation FLOAT_ANIM = RawAnimation.begin().thenLoop("float"); + private static final RawAnimation WALK_ANIM = RawAnimation.begin().thenLoop("walk"); + private static final RawAnimation ATTACK_ANIM = RawAnimation.begin().thenPlay("attack"); + + private final AnimatableInstanceCache geoCache = GeckoLibUtil.createInstanceCache(this); + private int stageAgeTicks; + private int attachDamageTicks; + private int attackCooldownTicks; + + public JerryEntity(EntityType entityType, Level level) { + super(entityType, level); + this.xpReward = 12; + } + + public static AttributeSupplier.Builder createAttributes() { + return Mob.createMobAttributes() + .add(Attributes.MAX_HEALTH, AntarchySettings.jerryInfantHealth()) + .add(Attributes.MOVEMENT_SPEED, 0.36D) + .add(Attributes.ATTACK_DAMAGE, AntarchySettings.jerryInfantAttackDamage()) + .add(Attributes.FOLLOW_RANGE, 28.0D) + .add(Attributes.FLYING_SPEED, 0.45D); + } + + public static boolean canSpawn(EntityType entityType, ServerLevelAccessor level, MobSpawnType spawnReason, net.minecraft.core.BlockPos pos, net.minecraft.util.RandomSource random) { + if (spawnReason == MobSpawnType.SPAWN_EGG || spawnReason == MobSpawnType.SPAWNER || spawnReason == MobSpawnType.COMMAND) { + return true; + } + return level.getDifficulty() != Difficulty.PEACEFUL + && Mob.checkMobSpawnRules(entityType, level, spawnReason, pos, random) + && level.getMaxLocalRawBrightness(pos) <= 2; + } + + @Override + protected void defineSynchedData(SynchedEntityData.Builder builder) { + super.defineSynchedData(builder); + builder.define(STAGE, Stage.INFANT.id()); + builder.define(ATTACK_ANIM_TICKS, 0); + } + + @Override + protected void registerGoals() { + this.goalSelector.addGoal(1, new GammaMeleeGoal()); + this.goalSelector.addGoal(5, new LookAtPlayerGoal(this, Player.class, 12.0F)); + this.goalSelector.addGoal(6, new RandomLookAroundGoal(this)); + this.targetSelector.addGoal(1, new HurtByTargetGoal(this)); + this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, true)); + } + + @Override + @Nullable + public SpawnGroupData finalizeSpawn(ServerLevelAccessor level, DifficultyInstance difficulty, MobSpawnType spawnReason, @Nullable SpawnGroupData spawnGroupData) { + if (spawnReason == MobSpawnType.SPAWN_EGG) { + this.setStage(this.random.nextBoolean() ? Stage.ALPHA : Stage.GAMMA); + } + this.applyStageAttributes(this.getStage(), true); + return super.finalizeSpawn(level, difficulty, spawnReason, spawnGroupData); + } + + @Override + public void tick() { + super.tick(); + + if (this.getStage() == Stage.GAMMA) { + this.setNoGravity(false); + } else { + this.setNoGravity(true); + this.fallDistance = 0.0F; + } + + int attackTicks = this.entityData.get(ATTACK_ANIM_TICKS); + if (attackTicks > 0) { + this.entityData.set(ATTACK_ANIM_TICKS, attackTicks - 1); + } + + if (this.level().isClientSide) { + return; + } + + this.tickGrowth(); + if (this.attackCooldownTicks > 0) { + this.attackCooldownTicks--; + } + + Stage stage = this.getStage(); + if (stage == Stage.INFANT || stage == Stage.MATURE) { + this.tickAttachedForm(stage); + } else if (stage == Stage.ALPHA) { + this.tickAlpha(); + } + } + + private void tickGrowth() { + Stage stage = this.getStage(); + if (stage == Stage.ALPHA || stage == Stage.GAMMA) { + return; + } + this.stageAgeTicks++; + if (this.stageAgeTicks < GROWTH_TICKS) { + return; + } + this.stageAgeTicks = 0; + this.setStage(stage == Stage.INFANT ? Stage.MATURE : (this.random.nextBoolean() ? Stage.ALPHA : Stage.GAMMA)); + } + + private void tickAttachedForm(Stage stage) { + LivingEntity target = this.getTarget(); + if (target == null || !target.isAlive()) { + this.drift(); + return; + } + + Vec3 targetPos = target.getEyePosition().add(0.0D, -0.15D, 0.0D); + Vec3 toTarget = targetPos.subtract(this.position()); + double distance = toTarget.length(); + if (distance > 0.01D) { + Vec3 motion = toTarget.normalize().scale(stage == Stage.INFANT ? 0.16D : 0.19D); + this.setDeltaMovement(this.getDeltaMovement().scale(0.55D).add(motion)); + } + if (distance < 1.15D) { + this.setPos(targetPos.x, targetPos.y, targetPos.z); + this.setDeltaMovement(Vec3.ZERO); + if (++this.attachDamageTicks >= ATTACH_DAMAGE_INTERVAL) { + this.attachDamageTicks = 0; + target.hurt(this.damageSources().mobAttack(this), (float) stage.attackDamage()); + } + } else { + this.attachDamageTicks = 0; + } + } + + private void tickAlpha() { + LivingEntity target = this.getTarget(); + if (target == null || !target.isAlive()) { + this.drift(); + return; + } + + Stage stage = this.getStage(); + Vec3 targetPos = target.getEyePosition().add(0.0D, -0.35D, 0.0D); + Vec3 toTarget = targetPos.subtract(this.position()); + double distance = toTarget.length(); + this.faceTarget(target); + if (distance > 0.01D) { + this.setDeltaMovement(this.getDeltaMovement().scale(0.65D).add(toTarget.normalize().scale(0.22D))); + } + if (distance < 2.1D && this.attackCooldownTicks <= 0) { + this.faceTarget(target); + this.attackCooldownTicks = 24; + this.entityData.set(ATTACK_ANIM_TICKS, ATTACK_ANIM_DURATION); + target.hurt(this.damageSources().mobAttack(this), (float) stage.attackDamage()); + } + } + + private void faceTarget(LivingEntity target) { + Vec3 toTarget = target.position().subtract(this.position()); + if (toTarget.horizontalDistanceSqr() <= 0.0001D) { + return; + } + float targetYaw = (float) (Mth.atan2(toTarget.z, toTarget.x) * (180.0F / Math.PI)) - 90.0F; + this.setYRot(Mth.approachDegrees(this.getYRot(), targetYaw, 30.0F)); + this.yBodyRot = this.getYRot(); + this.yHeadRot = this.getYRot(); + this.getLookControl().setLookAt(target, 30.0F, 30.0F); + } + + private void drift() { + if (this.tickCount % 45 == 0) { + this.setDeltaMovement( + (this.random.nextDouble() - 0.5D) * 0.12D, + (this.random.nextDouble() - 0.5D) * 0.08D, + (this.random.nextDouble() - 0.5D) * 0.12D + ); + } + } + + @Override + public boolean doHurtTarget(Entity target) { + this.entityData.set(ATTACK_ANIM_TICKS, ATTACK_ANIM_DURATION); + if (target instanceof LivingEntity living) { + this.faceTarget(living); + } + return target instanceof LivingEntity living + ? living.hurt(this.damageSources().mobAttack(this), (float) this.getAttributeValue(Attributes.ATTACK_DAMAGE)) + : super.doHurtTarget(target); + } + + @Override + public InteractionResult mobInteract(Player player, InteractionHand hand) { + ItemStack stack = player.getItemInHand(hand); + if (this.isAdultStage() && stack.getItem() instanceof SpawnEggItem spawnEggItem && spawnEggItem.getType(stack) == this.getType()) { + if (this.level() instanceof ServerLevel serverLevel && this.getType().create(serverLevel) instanceof JerryEntity infant) { + infant.setStage(Stage.INFANT); + infant.moveTo(this.getX(), this.getY(), this.getZ(), this.random.nextFloat() * 360.0F, 0.0F); + infant.finalizeSpawn(serverLevel, serverLevel.getCurrentDifficultyAt(infant.blockPosition()), MobSpawnType.MOB_SUMMONED, null); + serverLevel.addFreshEntity(infant); + if (!player.getAbilities().instabuild) { + stack.shrink(1); + } + } + return InteractionResult.sidedSuccess(this.level().isClientSide); + } + return super.mobInteract(player, hand); + } + + @Override + public void registerControllers(AnimatableManager.ControllerRegistrar controllers) { + controllers.add(new AnimationController<>(this, "main_controller", 3, this::mainAnimController)); + controllers.add(new AnimationController<>(this, "attack_controller", 0, this::attackAnimController)); + } + + private PlayState mainAnimController(AnimationState state) { + Stage stage = this.getStage(); + if (stage == Stage.GAMMA) { + return state.setAndContinue(state.isMoving() ? WALK_ANIM : IDLE_ANIM); + } + if (stage == Stage.ALPHA && this.entityData.get(ATTACK_ANIM_TICKS) > 0) { + return state.setAndContinue(ATTACK_ANIM); + } + if (stage == Stage.ALPHA) { + return state.setAndContinue(state.isMoving() ? FLOAT_ANIM : IDLE_ANIM); + } + return state.setAndContinue(IDLE_ANIM); + } + + private PlayState attackAnimController(AnimationState state) { + if (this.getStage() == Stage.GAMMA && this.entityData.get(ATTACK_ANIM_TICKS) > 0) { + return state.setAndContinue(ATTACK_ANIM); + } + return PlayState.STOP; + } + + @Override + public AnimatableInstanceCache getAnimatableInstanceCache() { + return this.geoCache; + } + + @Override + public boolean causeFallDamage(float fallDistance, float multiplier, DamageSource source) { + return false; + } + + @Override + protected void checkFallDamage(double y, boolean onGround, BlockState state, net.minecraft.core.BlockPos pos) { + } + + @Override + public void addAdditionalSaveData(CompoundTag tag) { + super.addAdditionalSaveData(tag); + tag.putString(STAGE_KEY, this.getStage().getSerializedName()); + tag.putInt(STAGE_AGE_KEY, this.stageAgeTicks); + } + + @Override + public void readAdditionalSaveData(CompoundTag tag) { + super.readAdditionalSaveData(tag); + this.setStage(Stage.byName(tag.getString(STAGE_KEY))); + this.stageAgeTicks = tag.getInt(STAGE_AGE_KEY); + this.applyStageAttributes(this.getStage(), false); + } + + public Stage getStage() { + return Stage.byId(this.entityData.get(STAGE)); + } + + public void setStage(Stage stage) { + Stage previous = this.getStage(); + this.entityData.set(STAGE, stage.id()); + this.applyStageAttributes(stage, true); + if (previous != stage) { + this.stageAgeTicks = 0; + this.refreshDimensions(); + } + } + + private void applyStageAttributes(Stage stage, boolean fillIfNew) { + double oldMaxHealth = this.getMaxHealth(); + float healthRatio = oldMaxHealth > 0.0D ? this.getHealth() / (float) oldMaxHealth : 1.0F; + Objects.requireNonNull(this.getAttribute(Attributes.MAX_HEALTH)).setBaseValue(stage.maxHealth()); + Objects.requireNonNull(this.getAttribute(Attributes.ATTACK_DAMAGE)).setBaseValue(stage.attackDamage()); + if (fillIfNew && this.getHealth() <= 0.0F) { + this.setHealth(this.getMaxHealth()); + } else { + this.setHealth(Mth.clamp((float) (this.getMaxHealth() * healthRatio), 1.0F, this.getMaxHealth())); + } + } + + private boolean isAdultStage() { + Stage stage = this.getStage(); + return stage == Stage.ALPHA || stage == Stage.GAMMA; + } + + private class GammaMeleeGoal extends MeleeAttackGoal { + GammaMeleeGoal() { + super(JerryEntity.this, 1.35D, false); + } + + @Override + public boolean canUse() { + return JerryEntity.this.getStage() == Stage.GAMMA && super.canUse(); + } + + @Override + public boolean canContinueToUse() { + return JerryEntity.this.getStage() == Stage.GAMMA && super.canContinueToUse(); + } + } + + public enum Stage implements StringRepresentable { + INFANT(0, "infant"), + MATURE(1, "mature"), + ALPHA(2, "alpha"), + GAMMA(3, "gamma"); + + private static final IntFunction BY_ID = ByIdMap.continuous(Stage::id, values(), ByIdMap.OutOfBoundsStrategy.ZERO); + private final int id; + private final String name; + + Stage(int id, String name) { + this.id = id; + this.name = name; + } + + public int id() { + return this.id; + } + + public double maxHealth() { + return switch (this) { + case INFANT -> AntarchySettings.jerryInfantHealth(); + case MATURE -> AntarchySettings.jerryMatureHealth(); + case ALPHA -> AntarchySettings.jerryAlphaHealth(); + case GAMMA -> AntarchySettings.jerryGammaHealth(); + }; + } + + public double attackDamage() { + return switch (this) { + case INFANT -> AntarchySettings.jerryInfantAttackDamage(); + case MATURE -> AntarchySettings.jerryMatureAttackDamage(); + case ALPHA -> AntarchySettings.jerryAlphaAttackDamage(); + case GAMMA -> AntarchySettings.jerryGammaAttackDamage(); + }; + } + + public static Stage byId(int id) { + return BY_ID.apply(id); + } + + public static Stage byName(String name) { + for (Stage stage : values()) { + if (stage.name.equals(name.toLowerCase(Locale.ROOT))) { + return stage; + } + } + return INFANT; + } + + @Override + public String getSerializedName() { + return this.name; + } + } +} diff --git a/common/src/main/java/com/craisinlord/antarchy/content/entity/JumpyBugEntity.java b/common/src/main/java/com/craisinlord/antarchy/content/entity/JumpyBugEntity.java index edf3f967..c1c62755 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/entity/JumpyBugEntity.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/entity/JumpyBugEntity.java @@ -190,7 +190,9 @@ public class JumpyBugEntity extends Monster implements GeoEntity { this.visualAlpha += (targetAlpha - this.visualAlpha) * 0.25F; } + CavarynBurrowingMobBehavior.moveOutOfBlocks(this); super.tick(); + CavarynBurrowingMobBehavior.moveOutOfBlocks(this); if (this.level().isClientSide) { return; @@ -226,6 +228,11 @@ public class JumpyBugEntity extends Monster implements GeoEntity { this.updateCamouflage(); } + @Override + public boolean isInWall() { + return false; + } + @Override public void travel(Vec3 travelVector) { if (this.isClingingToCeiling()) { diff --git a/common/src/main/java/com/craisinlord/antarchy/content/entity/LurkingTerrorEntity.java b/common/src/main/java/com/craisinlord/antarchy/content/entity/LurkingTerrorEntity.java index 991110c4..f01d8b87 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/entity/LurkingTerrorEntity.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/entity/LurkingTerrorEntity.java @@ -163,13 +163,20 @@ public class LurkingTerrorEntity extends Monster implements GeoEntity { @Override public void tick() { + CavarynBurrowingMobBehavior.moveOutOfBlocks(this); super.tick(); + CavarynBurrowingMobBehavior.moveOutOfBlocks(this); if (!this.level().isClientSide() && !this.onGround() && this.tickCount % 80 == 0) { this.playSound(AntarchySoundEvents.LURKING_TERROR_FLY_LOOP.get(), 0.45F, 0.95F + this.random.nextFloat() * 0.1F); } if (!this.level().isClientSide() && attackAnimTicks > 0) attackAnimTicks--; } + @Override + public boolean isInWall() { + return false; + } + @Override public boolean causeFallDamage(float fallDistance, float multiplier, net.minecraft.world.damagesource.DamageSource source) { return false; diff --git a/common/src/main/java/com/craisinlord/antarchy/content/entity/SpitBugEntity.java b/common/src/main/java/com/craisinlord/antarchy/content/entity/SpitBugEntity.java index 71d47806..14d0fadf 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/entity/SpitBugEntity.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/entity/SpitBugEntity.java @@ -125,7 +125,9 @@ public class SpitBugEntity extends Monster implements GeoEntity { @Override public void tick() { + CavarynBurrowingMobBehavior.moveOutOfBlocks(this); super.tick(); + CavarynBurrowingMobBehavior.moveOutOfBlocks(this); if (this.level().isClientSide) { return; } @@ -143,6 +145,11 @@ public class SpitBugEntity extends Monster implements GeoEntity { } } + @Override + public boolean isInWall() { + return false; + } + @Override public boolean doHurtTarget(net.minecraft.world.entity.Entity target) { boolean hurt = target instanceof LivingEntity livingTarget && this.level() instanceof ServerLevel serverLevel diff --git a/common/src/main/java/com/craisinlord/antarchy/content/horde/CavarynHordeDefinitions.java b/common/src/main/java/com/craisinlord/antarchy/content/horde/CavarynHordeDefinitions.java new file mode 100644 index 00000000..28faaf6a --- /dev/null +++ b/common/src/main/java/com/craisinlord/antarchy/content/horde/CavarynHordeDefinitions.java @@ -0,0 +1,261 @@ +package com.craisinlord.antarchy.content.horde; + +import com.craisinlord.antarchy.Antarchy; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import java.io.Reader; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import net.minecraft.core.Holder; +import net.minecraft.core.HolderSet; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.core.registries.Registries; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.server.packs.resources.Resource; +import net.minecraft.server.packs.resources.ResourceManager; +import net.minecraft.tags.TagKey; +import net.minecraft.util.Mth; +import net.minecraft.util.RandomSource; +import net.minecraft.world.Difficulty; +import net.minecraft.world.entity.EntityType; + +public final class CavarynHordeDefinitions { + private static final String DIRECTORY = "cavaryn_hordes"; + private static ResourceManager cachedManager; + private static Map definitions = Map.of(); + private static Set> configuredTypes = Set.of(); + + private CavarynHordeDefinitions() { + } + + public static Definition get(ServerLevel level, ResourceLocation id) { + reloadIfNeeded(level.getServer().getResourceManager()); + return definitions.getOrDefault(id, Definition.EMPTY); + } + + public static boolean isConfiguredHordeType(ServerLevel level, EntityType type) { + reloadIfNeeded(level.getServer().getResourceManager()); + return configuredTypes.contains(type); + } + + private static void reloadIfNeeded(ResourceManager manager) { + if (cachedManager == manager) { + return; + } + + Map loaded = new HashMap<>(); + manager.listResources(DIRECTORY, location -> location.getPath().endsWith(".json")).forEach((location, resource) -> { + String path = location.getPath(); + String idPath = path.substring((DIRECTORY + "/").length(), path.length() - ".json".length()); + ResourceLocation id = ResourceLocation.fromNamespaceAndPath(location.getNamespace(), idPath); + try { + loaded.put(id, Definition.fromJson(resource)); + } catch (Exception exception) { + Antarchy.LOGGER.warn("Failed to load Cavaryn horde definition {}", location, exception); + } + }); + Set> types = new HashSet<>(); + for (Definition definition : loaded.values()) { + definition.addTypesTo(types); + } + definitions = Map.copyOf(loaded); + configuredTypes = Set.copyOf(types); + cachedManager = manager; + } + + public record Definition(int maxActive, List entries) { + private static final Definition EMPTY = new Definition(0, List.of()); + + private static Definition fromJson(Resource resource) throws Exception { + try (Reader reader = resource.openAsReader()) { + JsonObject json = JsonParser.parseReader(reader).getAsJsonObject(); + int maxActive = getInt(json, "max_active", 0); + JsonArray rawEntries = json.getAsJsonArray("entries"); + if (rawEntries == null) { + return new Definition(maxActive, List.of()); + } + + List entries = new ArrayList<>(); + for (JsonElement rawEntry : rawEntries) { + if (rawEntry.isJsonObject()) { + Entry entry = Entry.fromJson(rawEntry.getAsJsonObject()); + if (entry != null) { + entries.add(entry); + } + } + } + return new Definition(maxActive, List.copyOf(entries)); + } + } + + public int resolvedMaxActive(ServerLevel level, int fallback) { + return this.maxActive > 0 ? scaleSpawnCount(level, this.maxActive) : fallback; + } + + public List buildSpawnList(ServerLevel level, int players, boolean highAttention, RandomSource random) { + if (level.getDifficulty() == Difficulty.PEACEFUL || this.entries.isEmpty()) { + return List.of(); + } + + List choices = new ArrayList<>(); + for (Entry entry : this.entries) { + int count = entry.count(players, highAttention); + count = scaleSpawnCount(level, count); + for (int i = 0; i < count; i++) { + EntityType type = entry.randomType(random); + if (type != null) { + choices.add(new SpawnChoice(type, entry.trackCompletion, entry.heavyArrivalEffect)); + } + } + } + Collections.shuffle(choices); + return choices; + } + + public boolean shouldWarn() { + for (Entry entry : this.entries) { + if (entry.warning) { + return true; + } + } + return false; + } + + private void addTypesTo(Set> types) { + for (Entry entry : this.entries) { + entry.addTypesTo(types); + } + } + } + + public record SpawnChoice(EntityType type, boolean trackCompletion, boolean heavyArrivalEffect) { + } + + private static final class Entry { + private final TagKey> entityTag; + private final int weight; + private final int baseCount; + private final int highAttentionBaseCount; + private final int perPlayerCount; + private final int perPlayers; + private final int perPlayersCount; + private final int minCount; + private final int maxCount; + private final boolean warning; + private final boolean trackCompletion; + private final boolean heavyArrivalEffect; + + private Entry(TagKey> entityTag, int weight, int baseCount, int highAttentionBaseCount, int perPlayerCount, + int perPlayers, int perPlayersCount, int minCount, int maxCount, boolean warning, + boolean trackCompletion, boolean heavyArrivalEffect) { + this.entityTag = entityTag; + this.weight = Math.max(1, weight); + this.baseCount = baseCount; + this.highAttentionBaseCount = highAttentionBaseCount; + this.perPlayerCount = perPlayerCount; + this.perPlayers = perPlayers; + this.perPlayersCount = perPlayersCount; + this.minCount = minCount; + this.maxCount = maxCount; + this.warning = warning; + this.trackCompletion = trackCompletion; + this.heavyArrivalEffect = heavyArrivalEffect; + } + + private static Entry fromJson(JsonObject json) { + String tagId = getString(json, "entity_tag", ""); + ResourceLocation tagLocation = ResourceLocation.tryParse(tagId); + if (tagLocation == null) { + Antarchy.LOGGER.warn("Skipping Cavaryn horde entry with invalid entity_tag '{}'", tagId); + return null; + } + + return new Entry( + TagKey.create(Registries.ENTITY_TYPE, tagLocation), + getInt(json, "weight", 1), + getInt(json, "base_count", 0), + getInt(json, "high_attention_base_count", -1), + getInt(json, "per_player_count", 0), + getInt(json, "per_players", 0), + getInt(json, "per_players_count", 1), + getInt(json, "min_count", 0), + getInt(json, "max_count", Integer.MAX_VALUE), + getBoolean(json, "warning", false), + getBoolean(json, "track_completion", false), + getBoolean(json, "heavy_arrival_effect", false) + ); + } + + private int count(int players, boolean highAttention) { + int count = highAttention && this.highAttentionBaseCount >= 0 ? this.highAttentionBaseCount : this.baseCount; + count += this.perPlayerCount * Math.max(0, players); + if (this.perPlayers > 0) { + count += (Math.max(0, players) / this.perPlayers) * this.perPlayersCount; + } + count = Math.max(this.minCount, count); + return Math.min(this.maxCount, count); + } + + private EntityType randomType(RandomSource random) { + Optional>> tag = BuiltInRegistries.ENTITY_TYPE.getTag(this.entityTag); + if (tag.isEmpty()) { + return null; + } + + List> weightedTypes = new ArrayList<>(); + for (Holder> holder : tag.get()) { + EntityType type = holder.value(); + for (int i = 0; i < this.weight; i++) { + weightedTypes.add(type); + } + } + if (weightedTypes.isEmpty()) { + return null; + } + return weightedTypes.get(random.nextInt(weightedTypes.size())); + } + + private void addTypesTo(Set> types) { + Optional>> tag = BuiltInRegistries.ENTITY_TYPE.getTag(this.entityTag); + tag.ifPresent(entityTypes -> { + for (Holder> holder : entityTypes) { + types.add(holder.value()); + } + }); + } + } + + private static int scaleSpawnCount(ServerLevel level, int baseCount) { + if (baseCount <= 0 || level.getDifficulty() == Difficulty.PEACEFUL) { + return 0; + } + float multiplier = switch (level.getDifficulty()) { + case PEACEFUL -> 0.0F; + case EASY -> 0.65F; + case NORMAL -> 1.0F; + case HARD -> 1.35F; + }; + return Math.max(1, Mth.ceil(baseCount * multiplier)); + } + + private static String getString(JsonObject json, String key, String fallback) { + return json.has(key) ? json.get(key).getAsString() : fallback; + } + + private static int getInt(JsonObject json, String key, int fallback) { + return json.has(key) ? json.get(key).getAsInt() : fallback; + } + + private static boolean getBoolean(JsonObject json, String key, boolean fallback) { + return json.has(key) ? json.get(key).getAsBoolean() : fallback; + } +} diff --git a/common/src/main/java/com/craisinlord/antarchy/content/horde/CavarynHordeManager.java b/common/src/main/java/com/craisinlord/antarchy/content/horde/CavarynHordeManager.java index edc88e4c..98754980 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/horde/CavarynHordeManager.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/horde/CavarynHordeManager.java @@ -48,11 +48,12 @@ public final class CavarynHordeManager { Registries.DIMENSION, ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "cavaryn") ); - private static final ResourceLocation JUMPY_BUG_ID = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "jumpy_bug"); - private static final ResourceLocation SPIT_BUG_ID = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "spit_bug"); - private static final ResourceLocation CREEPING_HORROR_ID = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "creeping_horror"); - private static final ResourceLocation LURKING_TERROR_ID = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "lurking_terror"); - private static final ResourceLocation HERCULES_BEETLE_ID = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "hercules_beetle"); + private static final ResourceLocation DORMANT_HORDE = hordeId("dormant"); + private static final ResourceLocation AWAKENING_HORDE = hordeId("awakening"); + private static final ResourceLocation WAVE_ONE_HORDE = hordeId("wave_1"); + private static final ResourceLocation WAVE_TWO_HORDE = hordeId("wave_2"); + private static final ResourceLocation WAVE_THREE_HORDE = hordeId("wave_3"); + private static final ResourceLocation FINAL_HORDE = hordeId("final"); private static final String DATA_ID = "antarchy_cavaryn_hordes"; private static final int GROUP_RADIUS_BLOCKS = 128; @@ -60,6 +61,7 @@ public final class CavarynHordeManager { private static final int STALE_ATTENTION_PRUNE_TICKS = 20 * 60 * 20; private static final int PLAYER_CHECK_INTERVAL = 20; private static final int AREA_ATTENTION_INTERVAL = 20 * 45; + private static final int DORMANT_ATTENTION_DECAY_INTERVAL = 20 * 15; private static final int DORMANT_MIN_SPAWN_INTERVAL = 20 * 50; private static final int DORMANT_RANDOM_SPAWN_INTERVAL = 20 * 35; private static final int AWAKENING_SKIRMISH_INTERVAL = 20 * 8; @@ -162,9 +164,16 @@ public final class CavarynHordeManager { UUID uuid = player.getUUID(); seen.add(uuid); PlayerAttention attention = data.players.computeIfAbsent(uuid, ignored -> new PlayerAttention()); + if (!player.isAlive()) { + attention.fade(10); + data.setDirty(); + HordeIntensitySync.send(player, 0.0F); + continue; + } + boolean inHordeBiome = isHordeBiome(level, player.blockPosition()); if (!inHordeBiome) { - attention.fade(6); + attention.fade(10); data.setDirty(); HordeIntensitySync.send(player, 0.0F); continue; @@ -176,7 +185,7 @@ public final class CavarynHordeManager { if (attention.areaKey != currentArea) { attention.areaKey = currentArea; attention.areaTicks = 0; - attention.fade(4); + attention.fade(8); data.setDirty(); } else if (!isPlayerInActiveEncounter(level, player)) { attention.areaTicks += PLAYER_CHECK_INTERVAL; @@ -184,6 +193,9 @@ public final class CavarynHordeManager { attention.areaTicks = 0; attention.add(6); data.setDirty(); + } else if (gameTime % DORMANT_ATTENTION_DECAY_INTERVAL == 0L) { + attention.fade(1); + data.setDirty(); } } @@ -200,7 +212,7 @@ public final class CavarynHordeManager { for (Map.Entry entry : data.players.entrySet()) { if (!seen.contains(entry.getKey())) { - entry.getValue().fade(2); + entry.getValue().fade(4); } } } @@ -260,19 +272,17 @@ public final class CavarynHordeManager { return; } + CavarynHordeDefinitions.Definition definition = CavarynHordeDefinitions.get(level, DORMANT_HORDE); int existing = countNearbyDirectHordeMobs(level, player.blockPosition(), 48.0D); - if (existing >= scaleSpawnCount(level, MAX_DORMANT_MOBS_PER_AREA)) { + if (existing >= definition.resolvedMaxActive(level, scaleSpawnCount(level, MAX_DORMANT_MOBS_PER_AREA))) { data.areaSpawnCooldowns.put(areaKey, gameTime + DORMANT_MIN_SPAWN_INTERVAL); data.setDirty(); return; } - int count = scaleSpawnCount(level, attention.attention >= ATTENTION_THRESHOLD * 2 / 3 ? 2 : 1); - for (int i = 0; i < count; i++) { - EntityType type = level.random.nextBoolean() ? creepingHorrorType() : lurkingTerrorType(); - if (type != null) { - spawnDirectMob(level, null, type, player); - } + boolean highAttention = attention.attention >= ATTENTION_THRESHOLD * 2 / 3; + for (CavarynHordeDefinitions.SpawnChoice choice : definition.buildSpawnList(level, 1, highAttention, level.random)) { + spawnDirectMob(level, null, choice, player); } data.areaSpawnCooldowns.put(areaKey, gameTime + DORMANT_MIN_SPAWN_INTERVAL + level.random.nextInt(DORMANT_RANDOM_SPAWN_INTERVAL)); data.setDirty(); @@ -336,16 +346,15 @@ public final class CavarynHordeManager { return; } - List> types = new ArrayList<>(); - addCommon(types, scaleSpawnCount(level, 2 + players)); - addRepeated(types, spitBugType(), scaleSpawnCount(level, Math.max(1, players))); + List choices = CavarynHordeDefinitions.get(level, AWAKENING_HORDE) + .buildSpawnList(level, players, false, level.random); int spawned = 0; - for (EntityType type : types) { - if (spawned >= capacity || type == null) { + for (CavarynHordeDefinitions.SpawnChoice choice : choices) { + if (spawned >= capacity) { break; } ServerPlayer target = targets.get(level.random.nextInt(targets.size())); - if (spawnDirectMob(level, encounter, type, target)) { + if (spawnDirectMob(level, encounter, choice, target)) { spawned++; } } @@ -362,39 +371,26 @@ public final class CavarynHordeManager { return; } - List> types = new ArrayList<>(); - switch (encounter.wave) { - case 0 -> addCommon(types, scaleSpawnCount(level, 12 + players * 3)); - case 1 -> { - addCommon(types, scaleSpawnCount(level, 14 + players * 3)); - addRepeated(types, spitBugType(), scaleSpawnCount(level, 2 + players)); - } - case 2 -> { - addCommon(types, scaleSpawnCount(level, 16 + players * 4)); - addRepeated(types, spitBugType(), scaleSpawnCount(level, 3 + players)); - addRepeated(types, jumpyBugType(), scaleSpawnCount(level, 1 + players)); - } - default -> { - int beetles = Math.min(scaleSpawnCount(level, 1 + players / 3), 3); - addRepeated(types, herculesBeetleType(), beetles); - addCommon(types, scaleSpawnCount(level, 8 + players * 2)); + CavarynHordeDefinitions.Definition definition = CavarynHordeDefinitions.get(level, hordeForWave(encounter.wave)); + if (definition.shouldWarn()) { warnHercules(level, encounter.center, targets); - } } + List choices = definition.buildSpawnList(level, players, false, level.random); int spawned = 0; - for (EntityType type : types) { - if (spawned >= capacity || type == null) { + for (CavarynHordeDefinitions.SpawnChoice choice : choices) { + if (spawned >= capacity) { break; } ServerPlayer target = targets.get(level.random.nextInt(targets.size())); - if (spawnDirectMob(level, encounter, type, target)) { + if (spawnDirectMob(level, encounter, choice, target)) { spawned++; } } } - private static boolean spawnDirectMob(ServerLevel level, @Nullable Encounter encounter, EntityType type, ServerPlayer target) { + private static boolean spawnDirectMob(ServerLevel level, @Nullable Encounter encounter, CavarynHordeDefinitions.SpawnChoice choice, ServerPlayer target) { + EntityType type = choice.type(); BlockPos spawnPos = findSpawnPos(level, target, type, level.random); if (spawnPos == null) { return false; @@ -405,17 +401,21 @@ public final class CavarynHordeManager { } mob.moveTo(spawnPos.getX() + 0.5D, spawnPos.getY(), spawnPos.getZ() + 0.5D, level.random.nextFloat() * 360.0F, 0.0F); mob.finalizeSpawn(level, level.getCurrentDifficultyAt(spawnPos), MobSpawnType.EVENT, null); - mob.setTarget(target); + if (mob.canAttack(target)) { + mob.setTarget(target); + } if (!level.addFreshEntity(mob)) { return false; } if (encounter != null) { encounter.hordeMobIds.add(mob.getUUID()); } - if (type == herculesBeetleType()) { + if (choice.trackCompletion()) { if (encounter != null) { encounter.herculesIds.add(mob.getUUID()); } + } + if (choice.heavyArrivalEffect()) { level.playSound(null, spawnPos, SoundEvents.GENERIC_EXPLODE.value(), SoundSource.HOSTILE, 1.5F, 0.65F); HerculesBeetleImpactShakeSync.send(target, 28); } else { @@ -427,16 +427,7 @@ public final class CavarynHordeManager { private static int countNearbyDirectHordeMobs(ServerLevel level, BlockPos center, double radius) { AABB box = new AABB(center).inflate(radius); - EntityType creepingHorror = creepingHorrorType(); - EntityType lurkingTerror = lurkingTerrorType(); - EntityType spitBug = spitBugType(); - EntityType jumpyBug = jumpyBugType(); - return level.getEntitiesOfClass(Mob.class, box, mob -> - mob.getType() == creepingHorror - || mob.getType() == lurkingTerror - || mob.getType() == spitBug - || mob.getType() == jumpyBug - ).size(); + return level.getEntitiesOfClass(Mob.class, box, mob -> CavarynHordeDefinitions.isConfiguredHordeType(level, mob.getType())).size(); } @Nullable @@ -490,26 +481,6 @@ public final class CavarynHordeManager { && level.isEmptyBlock(pos.above()); } - private static void addCommon(List> types, int count) { - EntityType creepingHorror = creepingHorrorType(); - EntityType lurkingTerror = lurkingTerrorType(); - for (int i = 0; i < count; i++) { - EntityType type = i % 2 == 0 ? creepingHorror : lurkingTerror; - if (type != null) { - types.add(type); - } - } - } - - private static void addRepeated(List> types, @Nullable EntityType type, int count) { - if (type == null) { - return; - } - for (int i = 0; i < count; i++) { - types.add(type); - } - } - private static int scaleSpawnCount(ServerLevel level, int baseCount) { if (baseCount <= 0 || level.getDifficulty() == Difficulty.PEACEFUL) { return 0; @@ -523,29 +494,17 @@ public final class CavarynHordeManager { return Math.max(1, Mth.ceil(baseCount * multiplier)); } - @Nullable - private static EntityType spitBugType() { - return BuiltInRegistries.ENTITY_TYPE.getOptional(SPIT_BUG_ID).orElse(null); + private static ResourceLocation hordeForWave(int wave) { + return switch (wave) { + case 0 -> WAVE_ONE_HORDE; + case 1 -> WAVE_TWO_HORDE; + case 2 -> WAVE_THREE_HORDE; + default -> FINAL_HORDE; + }; } - @Nullable - private static EntityType jumpyBugType() { - return BuiltInRegistries.ENTITY_TYPE.getOptional(JUMPY_BUG_ID).orElse(null); - } - - @Nullable - private static EntityType creepingHorrorType() { - return BuiltInRegistries.ENTITY_TYPE.getOptional(CREEPING_HORROR_ID).orElse(null); - } - - @Nullable - private static EntityType lurkingTerrorType() { - return BuiltInRegistries.ENTITY_TYPE.getOptional(LURKING_TERROR_ID).orElse(null); - } - - @Nullable - private static EntityType herculesBeetleType() { - return BuiltInRegistries.ENTITY_TYPE.getOptional(HERCULES_BEETLE_ID).orElse(null); + private static ResourceLocation hordeId(String path) { + return ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, path); } private static void warnHercules(ServerLevel level, BlockPos center, List targets) { @@ -574,7 +533,7 @@ public final class CavarynHordeManager { private static List targetsFor(ServerLevel level, Encounter encounter) { List targets = new ArrayList<>(); for (ServerPlayer player : level.players()) { - if (player.isSpectator() || !isHordeBiome(level, player.blockPosition())) { + if (!isValidHordeTarget(player) || !isHordeBiome(level, player.blockPosition())) { continue; } if (player.blockPosition().distSqr(encounter.center) <= GROUP_RADIUS_BLOCKS * GROUP_RADIUS_BLOCKS) { @@ -585,6 +544,10 @@ public final class CavarynHordeManager { return targets; } + private static boolean isValidHordeTarget(ServerPlayer player) { + return player.isAlive() && !player.isCreative() && !player.isSpectator(); + } + private static BlockPos averageBlockPos(List players) { int x = 0; int y = 0; diff --git a/common/src/main/resources/assets/antarchy/animations/alpha_metroid.animation.json b/common/src/main/resources/assets/antarchy/animations/alpha_jerry.animation.json similarity index 100% rename from common/src/main/resources/assets/antarchy/animations/alpha_metroid.animation.json rename to common/src/main/resources/assets/antarchy/animations/alpha_jerry.animation.json diff --git a/common/src/main/resources/assets/antarchy/animations/gamma_metroid.animation.json b/common/src/main/resources/assets/antarchy/animations/gamma_jerry.animation.json similarity index 100% rename from common/src/main/resources/assets/antarchy/animations/gamma_metroid.animation.json rename to common/src/main/resources/assets/antarchy/animations/gamma_jerry.animation.json diff --git a/common/src/main/resources/assets/antarchy/animations/infant_metroid.animation.json b/common/src/main/resources/assets/antarchy/animations/infant_jerry.animation.json similarity index 100% rename from common/src/main/resources/assets/antarchy/animations/infant_metroid.animation.json rename to common/src/main/resources/assets/antarchy/animations/infant_jerry.animation.json diff --git a/common/src/main/resources/assets/antarchy/animations/metroid_larva.animation.json b/common/src/main/resources/assets/antarchy/animations/mature_jerry.animation.json similarity index 100% rename from common/src/main/resources/assets/antarchy/animations/metroid_larva.animation.json rename to common/src/main/resources/assets/antarchy/animations/mature_jerry.animation.json diff --git a/common/src/main/resources/assets/antarchy/blockstates/metroid_egg.json b/common/src/main/resources/assets/antarchy/blockstates/jerry_egg.json similarity index 51% rename from common/src/main/resources/assets/antarchy/blockstates/metroid_egg.json rename to common/src/main/resources/assets/antarchy/blockstates/jerry_egg.json index 8fb5111b..7f040df5 100644 --- a/common/src/main/resources/assets/antarchy/blockstates/metroid_egg.json +++ b/common/src/main/resources/assets/antarchy/blockstates/jerry_egg.json @@ -1,10 +1,10 @@ { "variants": { "rotated=false": { - "model": "antarchy:block/metroid_egg" + "model": "antarchy:block/jerry_egg" }, "rotated=true": { - "model": "antarchy:block/metroid_egg", + "model": "antarchy:block/jerry_egg", "y": 90 } } diff --git a/common/src/main/resources/assets/antarchy/blockstates/molting_vines.json b/common/src/main/resources/assets/antarchy/blockstates/molting_vines.json index 6a95fab2..1d62c6ba 100644 --- a/common/src/main/resources/assets/antarchy/blockstates/molting_vines.json +++ b/common/src/main/resources/assets/antarchy/blockstates/molting_vines.json @@ -1,22 +1,52 @@ { - "variants": { - "growth_direction=up,top_cap=true,bottom_cap=false,broodfruit=false": { - "model": "antarchy:block/molting_vines_top" + "multipart": [ + { + "when": { + "broodfruit": "true" + }, + "apply": { + "model": "antarchy:block/molting_vines_broodfruit" + } }, - "growth_direction=up,top_cap=false,bottom_cap=false,broodfruit=false": { - "model": "antarchy:block/molting_vines" + { + "when": { + "broodfruit": "false", + "growth_direction": "up", + "top_cap": "true" + }, + "apply": { + "model": "antarchy:block/molting_vines_top" + } }, - "growth_direction=up,top_cap=false,bottom_cap=false,broodfruit=true": { - "model": "antarchy:block/molting_vines_broodfruit" + { + "when": { + "broodfruit": "false", + "growth_direction": "up", + "top_cap": "false" + }, + "apply": { + "model": "antarchy:block/molting_vines" + } }, - "growth_direction=down,top_cap=false,bottom_cap=true,broodfruit=false": { - "model": "antarchy:block/molting_vines_bottom" + { + "when": { + "broodfruit": "false", + "growth_direction": "down", + "bottom_cap": "true" + }, + "apply": { + "model": "antarchy:block/molting_vines_bottom" + } }, - "growth_direction=down,top_cap=false,bottom_cap=false,broodfruit=false": { - "model": "antarchy:block/molting_vines" - }, - "growth_direction=down,top_cap=false,bottom_cap=false,broodfruit=true": { - "model": "antarchy:block/molting_vines_broodfruit" + { + "when": { + "broodfruit": "false", + "growth_direction": "down", + "bottom_cap": "false" + }, + "apply": { + "model": "antarchy:block/molting_vines" + } } - } + ] } diff --git a/common/src/main/resources/assets/antarchy/blockstates/ouranwood_squirrel_nest.json b/common/src/main/resources/assets/antarchy/blockstates/ouranwood_squirrel_nest.json new file mode 100644 index 00000000..c20fb35d --- /dev/null +++ b/common/src/main/resources/assets/antarchy/blockstates/ouranwood_squirrel_nest.json @@ -0,0 +1,13 @@ +{ + "variants": { + "squirrels=1": { + "model": "antarchy:block/ouranwood_squirrel_nest" + }, + "squirrels=2": { + "model": "antarchy:block/ouranwood_squirrel_nest" + }, + "squirrels=3": { + "model": "antarchy:block/ouranwood_squirrel_nest" + } + } +} diff --git a/common/src/main/resources/assets/antarchy/geo/alpha_metroid.geo.json b/common/src/main/resources/assets/antarchy/geo/alpha_jerry.geo.json similarity index 99% rename from common/src/main/resources/assets/antarchy/geo/alpha_metroid.geo.json rename to common/src/main/resources/assets/antarchy/geo/alpha_jerry.geo.json index b71ed9bc..3c11cff8 100644 --- a/common/src/main/resources/assets/antarchy/geo/alpha_metroid.geo.json +++ b/common/src/main/resources/assets/antarchy/geo/alpha_jerry.geo.json @@ -3,7 +3,7 @@ "minecraft:geometry": [ { "description": { - "identifier": "geometry.alphametroid", + "identifier": "geometry.alphajerry", "texture_width": 128, "texture_height": 128, "visible_bounds_width": 4, @@ -163,4 +163,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/common/src/main/resources/assets/antarchy/geo/gamma_metroid.geo.json b/common/src/main/resources/assets/antarchy/geo/gamma_jerry.geo.json similarity index 99% rename from common/src/main/resources/assets/antarchy/geo/gamma_metroid.geo.json rename to common/src/main/resources/assets/antarchy/geo/gamma_jerry.geo.json index 9dd5fa7e..a8dc5c5f 100644 --- a/common/src/main/resources/assets/antarchy/geo/gamma_metroid.geo.json +++ b/common/src/main/resources/assets/antarchy/geo/gamma_jerry.geo.json @@ -3,7 +3,7 @@ "minecraft:geometry": [ { "description": { - "identifier": "geometry.gammametroid", + "identifier": "geometry.gammajerry", "texture_width": 128, "texture_height": 128, "visible_bounds_width": 6, @@ -223,4 +223,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/common/src/main/resources/assets/antarchy/geo/infant_metroid.geo.json b/common/src/main/resources/assets/antarchy/geo/infant_jerry.geo.json similarity index 96% rename from common/src/main/resources/assets/antarchy/geo/infant_metroid.geo.json rename to common/src/main/resources/assets/antarchy/geo/infant_jerry.geo.json index 4cf93fab..73636285 100644 --- a/common/src/main/resources/assets/antarchy/geo/infant_metroid.geo.json +++ b/common/src/main/resources/assets/antarchy/geo/infant_jerry.geo.json @@ -3,7 +3,7 @@ "minecraft:geometry": [ { "description": { - "identifier": "geometry.infantmetroid", + "identifier": "geometry.infantjerry", "texture_width": 64, "texture_height": 64, "visible_bounds_width": 2, @@ -61,4 +61,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/common/src/main/resources/assets/antarchy/geo/metroid_larva.geo.json b/common/src/main/resources/assets/antarchy/geo/mature_jerry.geo.json similarity index 97% rename from common/src/main/resources/assets/antarchy/geo/metroid_larva.geo.json rename to common/src/main/resources/assets/antarchy/geo/mature_jerry.geo.json index 0818c981..84278a68 100644 --- a/common/src/main/resources/assets/antarchy/geo/metroid_larva.geo.json +++ b/common/src/main/resources/assets/antarchy/geo/mature_jerry.geo.json @@ -3,7 +3,7 @@ "minecraft:geometry": [ { "description": { - "identifier": "geometry.metroidlarva", + "identifier": "geometry.maturejerry", "texture_width": 128, "texture_height": 128, "visible_bounds_width": 2, @@ -87,4 +87,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/common/src/main/resources/assets/antarchy/lang/en_us.json b/common/src/main/resources/assets/antarchy/lang/en_us.json index 22318a15..ed0e1e47 100644 --- a/common/src/main/resources/assets/antarchy/lang/en_us.json +++ b/common/src/main/resources/assets/antarchy/lang/en_us.json @@ -351,6 +351,8 @@ "item.antarchy.mantis_claw": "Mantis Claw", "item.antarchy.king_scale": "King Scale", "item.antarchy.queen_scale": "Queen Scale", + "item.antarchy.jerry_nucleus": "Jerry Nucleus", + "item.antarchy.carapace": "Carapace", "item.antarchy.jumpy_bug_leg": "Jumpy Bug Leg", "item.antarchy.jumpy_boots": "Jumpy Boots", "tooltip.antarchy.jumpy_boots": "Sneak to charge, then jump to spring upward.", @@ -917,11 +919,14 @@ "item.antarchy.broodfruit": "Broodfruit", "block.antarchy.jumpy_bug_egg": "Jumpy Bug Egg", "block.antarchy.spit_bug_egg": "Spit Bug Egg", - "block.antarchy.metroid_egg": "Metroid Egg", + "block.antarchy.jerry_egg": "Jerry Egg", + "entity.antarchy.jerry": "Jerry", + "item.antarchy.jerry_spawn_egg": "Jerry Spawn Egg", "block.antarchy.biomite": "Biomite", "block.antarchy.biomite_turf": "Biomite Turf", "block.antarchy.biowart": "Biowart", "block.antarchy.biowart_tendrils": "Biowart Tendrils", + "biome.antarchy.biowart_caves": "Biowart Caves", "subtitles.antarchy.creeping_horror_growl": "Creeping Horror growls", "subtitles.antarchy.creeping_horror_hurt": "Creeping Horror hurts", "subtitles.antarchy.creeping_horror_bite": "Creeping Horror bites", diff --git a/common/src/main/resources/assets/antarchy/models/block/amber_moss_carpet_side_small.json b/common/src/main/resources/assets/antarchy/models/block/amber_moss_carpet_side_small.json index 279f1af9..573900eb 100644 --- a/common/src/main/resources/assets/antarchy/models/block/amber_moss_carpet_side_small.json +++ b/common/src/main/resources/assets/antarchy/models/block/amber_moss_carpet_side_small.json @@ -1,6 +1,18 @@ { - "parent": "minecraft:block/mossy_carpet_side", + "ambientocclusion": true, "textures": { + "particle": "#side", "side": "antarchy:block/amber_moss/amber_moss_carpet" - } + }, + "elements": [ + { + "from": [0, 0, 0.1], + "to": [16, 8, 0.1], + "shade": true, + "faces": { + "north": {"uv": [16, 8, 0, 16], "texture": "#side"}, + "south": {"uv": [0, 8, 16, 16], "texture": "#side"} + } + } + ] } diff --git a/common/src/main/resources/assets/antarchy/models/block/biomite_turf.json b/common/src/main/resources/assets/antarchy/models/block/biomite_turf.json index cd947023..46c3a9be 100644 --- a/common/src/main/resources/assets/antarchy/models/block/biomite_turf.json +++ b/common/src/main/resources/assets/antarchy/models/block/biomite_turf.json @@ -1,6 +1,8 @@ { - "parent": "minecraft:block/cube_all", + "parent": "minecraft:block/cube_bottom_top", "textures": { - "all": "antarchy:block/biomite_turf" + "bottom": "antarchy:block/biomite", + "top": "antarchy:block/biowart", + "side": "antarchy:block/biomite_turf" } } diff --git a/common/src/main/resources/assets/antarchy/models/block/metroid_egg.json b/common/src/main/resources/assets/antarchy/models/block/jerry_egg.json similarity index 76% rename from common/src/main/resources/assets/antarchy/models/block/metroid_egg.json rename to common/src/main/resources/assets/antarchy/models/block/jerry_egg.json index f2b551bf..f73564b1 100644 --- a/common/src/main/resources/assets/antarchy/models/block/metroid_egg.json +++ b/common/src/main/resources/assets/antarchy/models/block/jerry_egg.json @@ -3,25 +3,13 @@ "credit": "Made with Blockbench", "texture_size": [64, 64], "textures": { - "1": "antarchy:block/metroid_egg", - "particle": "antarchy:block/metroid_egg" + "1": "antarchy:block/jerry_egg", + "particle": "antarchy:block/biomite" }, "elements": [ { - "from": [1, 0, 0], - "to": [15, 14, 16], - "faces": { - "north": {"uv": [7, 8, 10.5, 11.5], "texture": "#1"}, - "east": {"uv": [0, 0, 4, 3.5], "texture": "#1"}, - "south": {"uv": [7, 8, 10.5, 11.5], "texture": "#1"}, - "west": {"uv": [0, 0, 4, 3.5], "texture": "#1"}, - "up": {"uv": [3.5, 7.5, 0, 3.5], "texture": "#1"}, - "down": {"uv": [7, 3.5, 3.5, 7.5], "texture": "#1"} - } - }, - { - "from": [2, 0.025, 1], - "to": [14, 16.025, 15], + "from": [2, 0, 1], + "to": [14, 16, 15], "faces": { "north": {"uv": [10.5, 0, 13.5, 4], "texture": "#1"}, "east": {"uv": [7, 0, 10.5, 4], "texture": "#1"}, @@ -68,4 +56,4 @@ } } ] -} +} \ No newline at end of file diff --git a/common/src/main/resources/assets/antarchy/models/block/ouranwood_hanging_sign.json b/common/src/main/resources/assets/antarchy/models/block/ouranwood_hanging_sign.json index 36129379..66978fbd 100644 --- a/common/src/main/resources/assets/antarchy/models/block/ouranwood_hanging_sign.json +++ b/common/src/main/resources/assets/antarchy/models/block/ouranwood_hanging_sign.json @@ -1,6 +1,5 @@ { - "parent": "minecraft:block/template_hanging_sign", "textures": { - "texture": "antarchy:models/ouranwood/ouranwood_hanging_sign" + "particle": "antarchy:models/ouranwood/ouranwood_hanging_sign" } } diff --git a/common/src/main/resources/assets/antarchy/models/block/ouranwood_sign.json b/common/src/main/resources/assets/antarchy/models/block/ouranwood_sign.json index e83e9659..3da2694c 100644 --- a/common/src/main/resources/assets/antarchy/models/block/ouranwood_sign.json +++ b/common/src/main/resources/assets/antarchy/models/block/ouranwood_sign.json @@ -1,6 +1,5 @@ { - "parent": "minecraft:block/template_sign", "textures": { - "texture": "antarchy:models/ouranwood/ouranwood_sign" + "particle": "antarchy:models/ouranwood/ouranwood_sign" } } diff --git a/common/src/main/resources/assets/antarchy/models/block/ouranwood_squirrel_nest.json b/common/src/main/resources/assets/antarchy/models/block/ouranwood_squirrel_nest.json new file mode 100644 index 00000000..3a6f548f --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/block/ouranwood_squirrel_nest.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "minecraft:block/coarse_dirt" + } +} diff --git a/common/src/main/resources/assets/antarchy/models/block/ouranwood_wall_hanging_sign.json b/common/src/main/resources/assets/antarchy/models/block/ouranwood_wall_hanging_sign.json index 3839e8d4..66978fbd 100644 --- a/common/src/main/resources/assets/antarchy/models/block/ouranwood_wall_hanging_sign.json +++ b/common/src/main/resources/assets/antarchy/models/block/ouranwood_wall_hanging_sign.json @@ -1,6 +1,5 @@ { - "parent": "minecraft:block/template_wall_hanging_sign", "textures": { - "texture": "antarchy:models/ouranwood/ouranwood_hanging_sign" + "particle": "antarchy:models/ouranwood/ouranwood_hanging_sign" } } diff --git a/common/src/main/resources/assets/antarchy/models/block/ouranwood_wall_sign.json b/common/src/main/resources/assets/antarchy/models/block/ouranwood_wall_sign.json index cf57f349..3da2694c 100644 --- a/common/src/main/resources/assets/antarchy/models/block/ouranwood_wall_sign.json +++ b/common/src/main/resources/assets/antarchy/models/block/ouranwood_wall_sign.json @@ -1,6 +1,5 @@ { - "parent": "minecraft:block/template_wall_sign", "textures": { - "texture": "antarchy:models/ouranwood/ouranwood_sign" + "particle": "antarchy:models/ouranwood/ouranwood_sign" } } diff --git a/common/src/main/resources/assets/antarchy/models/block/peach_hanging_sign.json b/common/src/main/resources/assets/antarchy/models/block/peach_hanging_sign.json index 27016fe3..2717aebc 100644 --- a/common/src/main/resources/assets/antarchy/models/block/peach_hanging_sign.json +++ b/common/src/main/resources/assets/antarchy/models/block/peach_hanging_sign.json @@ -1,6 +1,5 @@ { - "parent": "minecraft:block/template_hanging_sign", "textures": { - "texture": "antarchy:block/peach/peach_hanging" + "particle": "antarchy:block/peach/peach_hanging" } } diff --git a/common/src/main/resources/assets/antarchy/models/block/peach_sign.json b/common/src/main/resources/assets/antarchy/models/block/peach_sign.json index f9541b44..3d19dc12 100644 --- a/common/src/main/resources/assets/antarchy/models/block/peach_sign.json +++ b/common/src/main/resources/assets/antarchy/models/block/peach_sign.json @@ -1,6 +1,5 @@ { - "parent": "minecraft:block/template_sign", "textures": { - "texture": "antarchy:item/peach_sign" + "particle": "antarchy:item/peach_sign" } } diff --git a/common/src/main/resources/assets/antarchy/models/block/peach_wall_hanging_sign.json b/common/src/main/resources/assets/antarchy/models/block/peach_wall_hanging_sign.json index d317123c..2717aebc 100644 --- a/common/src/main/resources/assets/antarchy/models/block/peach_wall_hanging_sign.json +++ b/common/src/main/resources/assets/antarchy/models/block/peach_wall_hanging_sign.json @@ -1,6 +1,5 @@ { - "parent": "minecraft:block/template_wall_hanging_sign", "textures": { - "texture": "antarchy:block/peach/peach_hanging" + "particle": "antarchy:block/peach/peach_hanging" } } diff --git a/common/src/main/resources/assets/antarchy/models/block/peach_wall_sign.json b/common/src/main/resources/assets/antarchy/models/block/peach_wall_sign.json index a32a7405..3d19dc12 100644 --- a/common/src/main/resources/assets/antarchy/models/block/peach_wall_sign.json +++ b/common/src/main/resources/assets/antarchy/models/block/peach_wall_sign.json @@ -1,6 +1,5 @@ { - "parent": "minecraft:block/template_wall_sign", "textures": { - "texture": "antarchy:item/peach_sign" + "particle": "antarchy:item/peach_sign" } } diff --git a/common/src/main/resources/assets/antarchy/models/item/metroid_egg.json b/common/src/main/resources/assets/antarchy/models/item/carapace.json similarity index 57% rename from common/src/main/resources/assets/antarchy/models/item/metroid_egg.json rename to common/src/main/resources/assets/antarchy/models/item/carapace.json index e4e58116..33c0b13e 100644 --- a/common/src/main/resources/assets/antarchy/models/item/metroid_egg.json +++ b/common/src/main/resources/assets/antarchy/models/item/carapace.json @@ -1,6 +1,6 @@ { "parent": "minecraft:item/generated", "textures": { - "layer0": "antarchy:item/metroid_egg_item" + "layer0": "antarchy:item/carapace" } } diff --git a/common/src/main/resources/assets/antarchy/models/item/jerry_egg.json b/common/src/main/resources/assets/antarchy/models/item/jerry_egg.json new file mode 100644 index 00000000..cc407bf7 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/item/jerry_egg.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "antarchy:item/jerry_egg_item" + } +} diff --git a/common/src/main/resources/assets/antarchy/models/item/jerry_nucleus.json b/common/src/main/resources/assets/antarchy/models/item/jerry_nucleus.json new file mode 100644 index 00000000..e74f38c8 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/item/jerry_nucleus.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "antarchy:item/jerry_nucleus" + } +} diff --git a/common/src/main/resources/assets/antarchy/models/item/jerry_spawn_egg.json b/common/src/main/resources/assets/antarchy/models/item/jerry_spawn_egg.json new file mode 100644 index 00000000..ddd15597 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/models/item/jerry_spawn_egg.json @@ -0,0 +1,3 @@ +{ + "parent": "minecraft:item/template_spawn_egg" +} diff --git a/common/src/main/resources/assets/antarchy/textures/block/jerry_egg.png b/common/src/main/resources/assets/antarchy/textures/block/jerry_egg.png new file mode 100644 index 00000000..40102682 Binary files /dev/null and b/common/src/main/resources/assets/antarchy/textures/block/jerry_egg.png differ diff --git a/common/src/main/resources/assets/antarchy/textures/block/metroid_egg.png b/common/src/main/resources/assets/antarchy/textures/block/metroid_egg.png deleted file mode 100644 index 04c4863f..00000000 Binary files a/common/src/main/resources/assets/antarchy/textures/block/metroid_egg.png and /dev/null differ diff --git a/common/src/main/resources/assets/antarchy/textures/entity/metroid/alpha_metroid.png b/common/src/main/resources/assets/antarchy/textures/entity/jerry/alpha_jerry.png similarity index 100% rename from common/src/main/resources/assets/antarchy/textures/entity/metroid/alpha_metroid.png rename to common/src/main/resources/assets/antarchy/textures/entity/jerry/alpha_jerry.png diff --git a/common/src/main/resources/assets/antarchy/textures/entity/metroid/gamma_metroid.png b/common/src/main/resources/assets/antarchy/textures/entity/jerry/gamma_jerry.png similarity index 100% rename from common/src/main/resources/assets/antarchy/textures/entity/metroid/gamma_metroid.png rename to common/src/main/resources/assets/antarchy/textures/entity/jerry/gamma_jerry.png diff --git a/common/src/main/resources/assets/antarchy/textures/entity/metroid/infant_metroid.png b/common/src/main/resources/assets/antarchy/textures/entity/jerry/infant_jerry.png similarity index 100% rename from common/src/main/resources/assets/antarchy/textures/entity/metroid/infant_metroid.png rename to common/src/main/resources/assets/antarchy/textures/entity/jerry/infant_jerry.png diff --git a/common/src/main/resources/assets/antarchy/textures/entity/metroid/metroid_larva.png b/common/src/main/resources/assets/antarchy/textures/entity/jerry/mature_jerry.png similarity index 100% rename from common/src/main/resources/assets/antarchy/textures/entity/metroid/metroid_larva.png rename to common/src/main/resources/assets/antarchy/textures/entity/jerry/mature_jerry.png diff --git a/common/src/main/resources/assets/antarchy/textures/entity/unstable_ant.png b/common/src/main/resources/assets/antarchy/textures/entity/unstable_ant.png new file mode 100644 index 00000000..9f12cfc8 Binary files /dev/null and b/common/src/main/resources/assets/antarchy/textures/entity/unstable_ant.png differ diff --git a/common/src/main/resources/assets/antarchy/textures/item/carapace.png b/common/src/main/resources/assets/antarchy/textures/item/carapace.png new file mode 100644 index 00000000..e6b73ca2 Binary files /dev/null and b/common/src/main/resources/assets/antarchy/textures/item/carapace.png differ diff --git a/common/src/main/resources/assets/antarchy/textures/item/metroid_egg_item.png b/common/src/main/resources/assets/antarchy/textures/item/jerry_egg_item.png similarity index 100% rename from common/src/main/resources/assets/antarchy/textures/item/metroid_egg_item.png rename to common/src/main/resources/assets/antarchy/textures/item/jerry_egg_item.png diff --git a/common/src/main/resources/assets/antarchy/textures/item/jerry_nucleus.png b/common/src/main/resources/assets/antarchy/textures/item/jerry_nucleus.png new file mode 100644 index 00000000..c37a4bd5 Binary files /dev/null and b/common/src/main/resources/assets/antarchy/textures/item/jerry_nucleus.png differ diff --git a/common/src/main/resources/data/antarchy/cavaryn_hordes/awakening.json b/common/src/main/resources/data/antarchy/cavaryn_hordes/awakening.json new file mode 100644 index 00000000..191bcc1a --- /dev/null +++ b/common/src/main/resources/data/antarchy/cavaryn_hordes/awakening.json @@ -0,0 +1,17 @@ +{ + "entries": [ + { + "entity_tag": "antarchy:horde_common", + "weight": 1, + "base_count": 2, + "per_player_count": 1 + }, + { + "entity_tag": "antarchy:horde_spitters", + "weight": 1, + "base_count": 0, + "per_player_count": 1, + "min_count": 1 + } + ] +} diff --git a/common/src/main/resources/data/antarchy/cavaryn_hordes/dormant.json b/common/src/main/resources/data/antarchy/cavaryn_hordes/dormant.json new file mode 100644 index 00000000..7e4904c5 --- /dev/null +++ b/common/src/main/resources/data/antarchy/cavaryn_hordes/dormant.json @@ -0,0 +1,11 @@ +{ + "max_active": 8, + "entries": [ + { + "entity_tag": "antarchy:horde_common", + "weight": 1, + "base_count": 1, + "high_attention_base_count": 2 + } + ] +} diff --git a/common/src/main/resources/data/antarchy/cavaryn_hordes/final.json b/common/src/main/resources/data/antarchy/cavaryn_hordes/final.json new file mode 100644 index 00000000..8256f994 --- /dev/null +++ b/common/src/main/resources/data/antarchy/cavaryn_hordes/final.json @@ -0,0 +1,21 @@ +{ + "entries": [ + { + "entity_tag": "antarchy:horde_bosses", + "weight": 1, + "base_count": 1, + "per_players": 3, + "per_players_count": 1, + "max_count": 3, + "warning": true, + "track_completion": true, + "heavy_arrival_effect": true + }, + { + "entity_tag": "antarchy:horde_common", + "weight": 1, + "base_count": 8, + "per_player_count": 2 + } + ] +} diff --git a/common/src/main/resources/data/antarchy/cavaryn_hordes/wave_1.json b/common/src/main/resources/data/antarchy/cavaryn_hordes/wave_1.json new file mode 100644 index 00000000..cc3c987b --- /dev/null +++ b/common/src/main/resources/data/antarchy/cavaryn_hordes/wave_1.json @@ -0,0 +1,10 @@ +{ + "entries": [ + { + "entity_tag": "antarchy:horde_common", + "weight": 1, + "base_count": 12, + "per_player_count": 3 + } + ] +} diff --git a/common/src/main/resources/data/antarchy/cavaryn_hordes/wave_2.json b/common/src/main/resources/data/antarchy/cavaryn_hordes/wave_2.json new file mode 100644 index 00000000..8f1be480 --- /dev/null +++ b/common/src/main/resources/data/antarchy/cavaryn_hordes/wave_2.json @@ -0,0 +1,16 @@ +{ + "entries": [ + { + "entity_tag": "antarchy:horde_common", + "weight": 1, + "base_count": 14, + "per_player_count": 3 + }, + { + "entity_tag": "antarchy:horde_spitters", + "weight": 1, + "base_count": 2, + "per_player_count": 1 + } + ] +} diff --git a/common/src/main/resources/data/antarchy/cavaryn_hordes/wave_3.json b/common/src/main/resources/data/antarchy/cavaryn_hordes/wave_3.json new file mode 100644 index 00000000..99ab3991 --- /dev/null +++ b/common/src/main/resources/data/antarchy/cavaryn_hordes/wave_3.json @@ -0,0 +1,22 @@ +{ + "entries": [ + { + "entity_tag": "antarchy:horde_common", + "weight": 1, + "base_count": 16, + "per_player_count": 4 + }, + { + "entity_tag": "antarchy:horde_spitters", + "weight": 1, + "base_count": 3, + "per_player_count": 1 + }, + { + "entity_tag": "antarchy:horde_jumpers", + "weight": 1, + "base_count": 1, + "per_player_count": 1 + } + ] +} diff --git a/common/src/main/resources/data/antarchy/dimension/cavaryn.json b/common/src/main/resources/data/antarchy/dimension/cavaryn.json index d8346bba..2e514481 100644 --- a/common/src/main/resources/data/antarchy/dimension/cavaryn.json +++ b/common/src/main/resources/data/antarchy/dimension/cavaryn.json @@ -66,6 +66,36 @@ }, "biome": "antarchy:glowcap_caves" }, + { + "parameters": { + "temperature": [ + -1.0, + 1.0 + ], + "humidity": [ + 0.15, + 0.85 + ], + "continentalness": [ + -1.0, + 1.0 + ], + "erosion": [ + -1.0, + 1.0 + ], + "weirdness": [ + 0.45, + 1.0 + ], + "depth": [ + -2.0, + -0.1 + ], + "offset": 0.0 + }, + "biome": "antarchy:biowart_caves" + }, { "parameters": { "temperature": [ diff --git a/common/src/main/resources/data/antarchy/loot_table/blocks/metroid_egg.json b/common/src/main/resources/data/antarchy/loot_table/blocks/jerry_egg.json similarity index 74% rename from common/src/main/resources/data/antarchy/loot_table/blocks/metroid_egg.json rename to common/src/main/resources/data/antarchy/loot_table/blocks/jerry_egg.json index fc9a4354..1c029f55 100644 --- a/common/src/main/resources/data/antarchy/loot_table/blocks/metroid_egg.json +++ b/common/src/main/resources/data/antarchy/loot_table/blocks/jerry_egg.json @@ -10,11 +10,11 @@ "entries": [ { "type": "minecraft:item", - "name": "antarchy:metroid_egg" + "name": "antarchy:jerry_egg" } ], "rolls": 1.0 } ], - "random_sequence": "antarchy:blocks/metroid_egg" + "random_sequence": "antarchy:blocks/jerry_egg" } diff --git a/common/src/main/resources/data/antarchy/loot_table/entities/jerry.json b/common/src/main/resources/data/antarchy/loot_table/entities/jerry.json new file mode 100644 index 00000000..efe5ce89 --- /dev/null +++ b/common/src/main/resources/data/antarchy/loot_table/entities/jerry.json @@ -0,0 +1,91 @@ +{ + "type": "minecraft:entity", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "antarchy:jerry_nucleus", + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1.0, + "max": 2.0 + } + }, + { + "function": "minecraft:enchanted_count_increase", + "enchantment": "minecraft:looting", + "count": { + "type": "minecraft:uniform", + "min": 0.0, + "max": 1.0 + } + } + ] + } + ], + "conditions": [ + { + "condition": "minecraft:killed_by_player" + } + ] + }, + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "antarchy:carapace", + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1.0, + "max": 2.0 + } + }, + { + "function": "minecraft:enchanted_count_increase", + "enchantment": "minecraft:looting", + "count": { + "type": "minecraft:uniform", + "min": 0.0, + "max": 1.0 + } + } + ] + } + ], + "conditions": [ + { + "condition": "minecraft:killed_by_player" + }, + { + "condition": "minecraft:any_of", + "terms": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{JerryStage:\"alpha\"}" + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{JerryStage:\"gamma\"}" + } + } + ] + } + ] + } + ], + "random_sequence": "antarchy:entities/jerry" +} diff --git a/common/src/main/resources/data/antarchy/recipe/big_bertha_hilt.json b/common/src/main/resources/data/antarchy/recipe/big_bertha_hilt.json index 2bdad513..e79685e8 100644 --- a/common/src/main/resources/data/antarchy/recipe/big_bertha_hilt.json +++ b/common/src/main/resources/data/antarchy/recipe/big_bertha_hilt.json @@ -17,7 +17,7 @@ "item": "antarchy:jumpy_bug_leg" }, "D": { - "item": "antarchy:chiten" + "item": "antarchy:jerry_nucleus" }, "E": { "item": "antarchy:rainbow_sugar" diff --git a/common/src/main/resources/data/antarchy/tags/entity_type/horde_bosses.json b/common/src/main/resources/data/antarchy/tags/entity_type/horde_bosses.json new file mode 100644 index 00000000..69e3896e --- /dev/null +++ b/common/src/main/resources/data/antarchy/tags/entity_type/horde_bosses.json @@ -0,0 +1,5 @@ +{ + "values": [ + "antarchy:hercules_beetle" + ] +} diff --git a/common/src/main/resources/data/antarchy/tags/entity_type/horde_common.json b/common/src/main/resources/data/antarchy/tags/entity_type/horde_common.json new file mode 100644 index 00000000..3cc117aa --- /dev/null +++ b/common/src/main/resources/data/antarchy/tags/entity_type/horde_common.json @@ -0,0 +1,6 @@ +{ + "values": [ + "antarchy:creeping_horror", + "antarchy:lurking_terror" + ] +} diff --git a/common/src/main/resources/data/antarchy/tags/entity_type/horde_jumpers.json b/common/src/main/resources/data/antarchy/tags/entity_type/horde_jumpers.json new file mode 100644 index 00000000..298fd78a --- /dev/null +++ b/common/src/main/resources/data/antarchy/tags/entity_type/horde_jumpers.json @@ -0,0 +1,5 @@ +{ + "values": [ + "antarchy:jumpy_bug" + ] +} diff --git a/common/src/main/resources/data/antarchy/tags/entity_type/horde_spitters.json b/common/src/main/resources/data/antarchy/tags/entity_type/horde_spitters.json new file mode 100644 index 00000000..39f6a107 --- /dev/null +++ b/common/src/main/resources/data/antarchy/tags/entity_type/horde_spitters.json @@ -0,0 +1,5 @@ +{ + "values": [ + "antarchy:spit_bug" + ] +} diff --git a/common/src/main/resources/data/antarchy/tags/worldgen/biome/is_cavaryn.json b/common/src/main/resources/data/antarchy/tags/worldgen/biome/is_cavaryn.json index 18f8377d..8f87b48f 100644 --- a/common/src/main/resources/data/antarchy/tags/worldgen/biome/is_cavaryn.json +++ b/common/src/main/resources/data/antarchy/tags/worldgen/biome/is_cavaryn.json @@ -2,6 +2,7 @@ "values": [ "antarchy:cavaryn", "antarchy:glowcap_caves", + "antarchy:biowart_caves", "antarchy:brooding_tunnels", "antarchy:rolly_caves" ] diff --git a/common/src/main/resources/data/antarchy/worldgen/biome/biowart_caves.json b/common/src/main/resources/data/antarchy/worldgen/biome/biowart_caves.json new file mode 100644 index 00000000..e9d0741d --- /dev/null +++ b/common/src/main/resources/data/antarchy/worldgen/biome/biowart_caves.json @@ -0,0 +1,83 @@ +{ + "has_precipitation": false, + "temperature": 0.58, + "downfall": 0.25, + "effects": { + "fog_color": 7639848, + "water_color": 9453328, + "water_fog_color": 5643034, + "sky_color": 5007935, + "grass_color": 4569361, + "foliage_color": 6018898, + "grass_color_modifier": "none", + "mood_sound": { + "sound": "minecraft:ambient.cave", + "tick_delay": 60000, + "block_search_extent": 8, + "offset": 2.0 + }, + "particle": { + "probability": 0.004, + "options": { + "type": "antarchy:orange_ash" + } + } + }, + "spawn_costs": { + "antarchy:jerry": { + "energy_budget": 0.8, + "charge": 4 + } + }, + "carvers": { + "air": [], + "liquid": [] + }, + "features": [ + [], + [], + [], + [], + [], + [], + [], + [], + [ + "antarchy:cavaryn_bile_veins", + "antarchy:cavaryn_bile_cysts", + "antarchy:termite_nest" + ], + [ + "antarchy:biowart_patch", + "antarchy:cavaryn_creepvine", + "antarchy:cavaryn_hanging_creeproots", + "antarchy:jerry_egg_patch" + ], + [] + ], + "creature_spawn_probability": 0.08, + "spawners": { + "monster": [ + { + "type": "antarchy:jerry", + "weight": 65, + "minCount": 1, + "maxCount": 2 + } + ], + "creature": [ + { + "type": "antarchy:stink_bug", + "weight": 12, + "minCount": 1, + "maxCount": 3 + } + ], + "ambient": [], + "axolotls": [], + "underground_water_creature": [], + "water_creature": [], + "water_ambient": [], + "misc": [] + } +} diff --git a/common/src/main/resources/data/antarchy/worldgen/configured_feature/biowart_patch.json b/common/src/main/resources/data/antarchy/worldgen/configured_feature/biowart_patch.json new file mode 100644 index 00000000..67b566b8 --- /dev/null +++ b/common/src/main/resources/data/antarchy/worldgen/configured_feature/biowart_patch.json @@ -0,0 +1,37 @@ +{ + "type": "minecraft:vegetation_patch", + "config": { + "surface": "floor", + "depth": 1, + "vertical_range": 5, + "extra_bottom_block_chance": 0.0, + "extra_edge_column_chance": 0.55, + "vegetation_chance": 0.72, + "xz_radius": { + "type": "minecraft:uniform", + "min_inclusive": 3, + "max_inclusive": 6 + }, + "replaceable": "#antarchy:biowart_replaceable", + "ground_state": { + "type": "minecraft:simple_state_provider", + "state": { + "Name": "antarchy:biowart" + } + }, + "vegetation_feature": { + "feature": { + "type": "minecraft:simple_block", + "config": { + "to_place": { + "type": "minecraft:simple_state_provider", + "state": { + "Name": "antarchy:biowart_tendrils" + } + } + } + }, + "placement": [] + } + } +} diff --git a/common/src/main/resources/data/antarchy/worldgen/configured_feature/jerry_egg_patch.json b/common/src/main/resources/data/antarchy/worldgen/configured_feature/jerry_egg_patch.json new file mode 100644 index 00000000..15732cb3 --- /dev/null +++ b/common/src/main/resources/data/antarchy/worldgen/configured_feature/jerry_egg_patch.json @@ -0,0 +1,42 @@ +{ + "type": "minecraft:random_patch", + "config": { + "tries": 10, + "xz_spread": 5, + "y_spread": 2, + "feature": { + "feature": { + "type": "minecraft:simple_block", + "config": { + "to_place": { + "type": "minecraft:simple_state_provider", + "state": { + "Name": "antarchy:jerry_egg", + "Properties": { + "rotated": "false" + } + } + } + } + }, + "placement": [ + { + "type": "minecraft:block_predicate_filter", + "predicate": { + "type": "minecraft:matching_blocks", + "offset": [ + 0, + -1, + 0 + ], + "blocks": [ + "antarchy:biomite", + "antarchy:biomite_turf", + "antarchy:biowart" + ] + } + } + ] + } + } +} diff --git a/common/src/main/resources/data/antarchy/worldgen/noise_settings/cavaryn.json b/common/src/main/resources/data/antarchy/worldgen/noise_settings/cavaryn.json index 22fbb2c6..5f4002c4 100644 --- a/common/src/main/resources/data/antarchy/worldgen/noise_settings/cavaryn.json +++ b/common/src/main/resources/data/antarchy/worldgen/noise_settings/cavaryn.json @@ -169,6 +169,40 @@ } } }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": ["antarchy:biowart_caves"] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "floor", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "antarchy:biomite_turf" + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "antarchy:biomite" + } + } + ] + } + }, { "type": "minecraft:condition", "if_true": { diff --git a/common/src/main/resources/data/antarchy/worldgen/placed_feature/biowart_patch.json b/common/src/main/resources/data/antarchy/worldgen/placed_feature/biowart_patch.json new file mode 100644 index 00000000..1be9c317 --- /dev/null +++ b/common/src/main/resources/data/antarchy/worldgen/placed_feature/biowart_patch.json @@ -0,0 +1,27 @@ +{ + "feature": "antarchy:biowart_patch", + "placement": [ + { + "type": "minecraft:count", + "count": 18 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:uniform", + "min_inclusive": { + "above_bottom": 8 + }, + "max_inclusive": { + "below_top": 16 + } + } + }, + { + "type": "minecraft:biome" + } + ] +} diff --git a/common/src/main/resources/data/antarchy/worldgen/placed_feature/broodstone_titanium_ore.json b/common/src/main/resources/data/antarchy/worldgen/placed_feature/broodstone_titanium_ore.json index 826fa935..cef0c67f 100644 --- a/common/src/main/resources/data/antarchy/worldgen/placed_feature/broodstone_titanium_ore.json +++ b/common/src/main/resources/data/antarchy/worldgen/placed_feature/broodstone_titanium_ore.json @@ -3,7 +3,7 @@ "placement": [ { "type": "minecraft:rarity_filter", - "chance": 24 + "chance": 6 }, { "type": "minecraft:in_square" diff --git a/common/src/main/resources/data/antarchy/worldgen/placed_feature/broodstone_uranium_ore.json b/common/src/main/resources/data/antarchy/worldgen/placed_feature/broodstone_uranium_ore.json index 02bf55f7..ac0d13bd 100644 --- a/common/src/main/resources/data/antarchy/worldgen/placed_feature/broodstone_uranium_ore.json +++ b/common/src/main/resources/data/antarchy/worldgen/placed_feature/broodstone_uranium_ore.json @@ -3,7 +3,7 @@ "placement": [ { "type": "minecraft:rarity_filter", - "chance": 20 + "chance": 5 }, { "type": "minecraft:in_square" diff --git a/common/src/main/resources/data/antarchy/worldgen/placed_feature/jerry_egg_patch.json b/common/src/main/resources/data/antarchy/worldgen/placed_feature/jerry_egg_patch.json new file mode 100644 index 00000000..7997b753 --- /dev/null +++ b/common/src/main/resources/data/antarchy/worldgen/placed_feature/jerry_egg_patch.json @@ -0,0 +1,31 @@ +{ + "feature": "antarchy:jerry_egg_patch", + "placement": [ + { + "type": "minecraft:count", + "count": { + "type": "minecraft:uniform", + "min_inclusive": 1, + "max_inclusive": 3 + } + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:uniform", + "min_inclusive": { + "above_bottom": 8 + }, + "max_inclusive": { + "below_top": 16 + } + } + }, + { + "type": "minecraft:biome" + } + ] +} diff --git a/common/src/main/resources/data/minecraft/tags/block/dirt.json b/common/src/main/resources/data/minecraft/tags/block/dirt.json index 3a6c14b4..0cd9680b 100644 --- a/common/src/main/resources/data/minecraft/tags/block/dirt.json +++ b/common/src/main/resources/data/minecraft/tags/block/dirt.json @@ -5,6 +5,7 @@ "antarchy:infested_coarse_dirt", "antarchy:umbral_moss_block", "antarchy:blush_moss_block", - "antarchy:amber_moss_block" + "antarchy:amber_moss_block", + "antarchy:biowart" ] } diff --git a/common/src/main/resources/data/minecraft/tags/entity_type/arthropod.json b/common/src/main/resources/data/minecraft/tags/entity_type/arthropod.json index 445a31c7..042bce23 100644 --- a/common/src/main/resources/data/minecraft/tags/entity_type/arthropod.json +++ b/common/src/main/resources/data/minecraft/tags/entity_type/arthropod.json @@ -17,6 +17,7 @@ "antarchy:lurking_terror", "antarchy:rolly_polly", "antarchy:scorpion", - "antarchy:emperor_scorpion" + "antarchy:emperor_scorpion", + "antarchy:jerry" ] } diff --git a/fabric/src/main/java/com/craisinlord/antarchy/fabric/client/AntarchyFabricClientBootstrap.java b/fabric/src/main/java/com/craisinlord/antarchy/fabric/client/AntarchyFabricClientBootstrap.java index bbb84061..5e58b645 100644 --- a/fabric/src/main/java/com/craisinlord/antarchy/fabric/client/AntarchyFabricClientBootstrap.java +++ b/fabric/src/main/java/com/craisinlord/antarchy/fabric/client/AntarchyFabricClientBootstrap.java @@ -141,6 +141,7 @@ public final class AntarchyFabricClientBootstrap { EntityRendererRegistry.register(AntarchyFabricEntities.CREEPING_HORROR.get(), CreepingHorrorRenderer::new); EntityRendererRegistry.register(AntarchyFabricEntities.LURKING_TERROR.get(), LurkingTerrorRenderer::new); EntityRendererRegistry.register(AntarchyFabricEntities.HERCULES_BEETLE.get(), HerculesBeetleRenderer::new); + EntityRendererRegistry.register(AntarchyFabricEntities.JERRY.get(), JerryRenderer::new); EntityRendererRegistry.register(AntarchyFabricEntities.JUMPY_BUG.get(), JumpyBugRenderer::new); EntityRendererRegistry.register(AntarchyFabricEntities.SPIT_BUG.get(), SpitBugRenderer::new); EntityRendererRegistry.register(AntarchyFabricEntities.SPIT_BUG_PROJECTILE.get(), SpitBugProjectileRenderer::new); @@ -342,7 +343,7 @@ public final class AntarchyFabricClientBootstrap { BlockRenderLayerMap.INSTANCE.putBlock(AntarchyFabricBlocks.CLOUD_BLOCK.get(), RenderType.translucent()); BlockRenderLayerMap.INSTANCE.putBlock(AntarchyFabricBlocks.JUMPY_BUG_EGG.get(), RenderType.translucent()); BlockRenderLayerMap.INSTANCE.putBlock(AntarchyFabricBlocks.SPIT_BUG_EGG.get(), RenderType.translucent()); - BlockRenderLayerMap.INSTANCE.putBlock(AntarchyFabricBlocks.METROID_EGG.get(), RenderType.translucent()); + BlockRenderLayerMap.INSTANCE.putBlock(AntarchyFabricBlocks.JERRY_EGG.get(), RenderType.translucent()); BlockRenderLayerMap.INSTANCE.putBlock(AntarchyFabricBlocks.BIOWART_TENDRILS.get(), RenderType.cutout()); BlockRenderLayerMap.INSTANCE.putBlock(AntarchyFabricBlocks.HANGING_CREEPROOTS.get(), RenderType.cutout()); BlockRenderLayerMap.INSTANCE.putBlock(AntarchyFabricBlocks.MOLTING_VINES.get(), RenderType.cutout()); diff --git a/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricBlocks.java b/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricBlocks.java index 5a56c21f..934e546a 100644 --- a/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricBlocks.java +++ b/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricBlocks.java @@ -665,15 +665,15 @@ public final class AntarchyFabricBlocks { public static final DeferredBlock BIOMITE_TURF = BLOCKS.register("biomite_turf", - () -> new Block(BlockBehaviour.Properties.ofFullCopy(Blocks.NETHERRACK))); + () -> new Block(BlockBehaviour.Properties.ofFullCopy(Blocks.NETHERRACK).lightLevel(state -> 2))); public static final DeferredBlock BIOWART = BLOCKS.register("biowart", - () -> new BiowartBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.MOSS_BLOCK))); + () -> new BiowartBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.MOSS_BLOCK).lightLevel(state -> 2))); public static final DeferredBlock BIOWART_TENDRILS = BLOCKS.register("biowart_tendrils", - () -> new BiowartTendrilsBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.MOSS_CARPET).noCollission().noOcclusion())); + () -> new BiowartTendrilsBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.MOSS_CARPET).lightLevel(state -> 2).noCollission().noOcclusion())); public static final DeferredBlock MYRMITE_COAL_ORE = BLOCKS.register("myrmite_coal_ore", @@ -826,8 +826,8 @@ public final class AntarchyFabricBlocks { () -> new SpitBugEggBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.TURTLE_EGG))); - public static final DeferredBlock METROID_EGG = BLOCKS.register("metroid_egg", - () -> new MetroidEggBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.TURTLE_EGG))); + public static final DeferredBlock JERRY_EGG = BLOCKS.register("jerry_egg", + () -> new JerryEggBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.TURTLE_EGG).randomTicks())); public static final DeferredBlock LURKING_TERROR_EGG = BLOCKS.register("lurking_terror_egg", diff --git a/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricEntities.java b/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricEntities.java index af2c704d..2c8d33f7 100644 --- a/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricEntities.java +++ b/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricEntities.java @@ -552,6 +552,7 @@ public final class AntarchyFabricEntities { .sized(0.5F, 0.5F) .clientTrackingRange(8) .updateInterval(1) + .fireImmune() .build("krakens_grasp_trident")); public static final DeferredHolder, EntityType> TENTACLE = ENTITY_TYPES.register("tentacle", @@ -651,6 +652,13 @@ public final class AntarchyFabricEntities { .build("lurking_terror")); + public static final DeferredHolder, EntityType> JERRY = ENTITY_TYPES.register("jerry", + () -> EntityType.Builder.of(com.craisinlord.antarchy.content.entity.JerryEntity::new, MobCategory.MONSTER) + .sized(1.4F, 1.4F) + .clientTrackingRange(10) + .build("jerry")); + + public static final DeferredHolder, EntityType> CHEEP = ENTITY_TYPES.register("cheep", () -> EntityType.Builder.of(com.craisinlord.antarchy.content.entity.CheepEntity::new, MobCategory.WATER_AMBIENT) .sized(1.0F, 1.2F) diff --git a/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricEntityAttributes.java b/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricEntityAttributes.java index cd20fd82..37b2aea2 100644 --- a/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricEntityAttributes.java +++ b/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricEntityAttributes.java @@ -312,6 +312,7 @@ public final class AntarchyFabricEntityAttributes { FabricDefaultAttributeRegistry.register(AntarchyFabricEntities.TORETERROR.get(), ToreterrorEntity.createAttributes().build()); FabricDefaultAttributeRegistry.register(AntarchyFabricEntities.CREEPING_HORROR.get(), com.craisinlord.antarchy.content.entity.CreepingHorrorEntity.createAttributes().build()); FabricDefaultAttributeRegistry.register(AntarchyFabricEntities.LURKING_TERROR.get(), com.craisinlord.antarchy.content.entity.LurkingTerrorEntity.createAttributes().build()); + FabricDefaultAttributeRegistry.register(AntarchyFabricEntities.JERRY.get(), com.craisinlord.antarchy.content.entity.JerryEntity.createAttributes().build()); FabricDefaultAttributeRegistry.register(AntarchyFabricEntities.CHEEP.get(), com.craisinlord.antarchy.content.entity.CheepEntity.createAttributes().build()); FabricDefaultAttributeRegistry.register(AntarchyFabricEntities.DORRIE.get(), com.craisinlord.antarchy.content.entity.DorrieEntity.createAttributes().build()); FabricDefaultAttributeRegistry.register(AntarchyFabricEntities.HERCULES_BEETLE.get(), com.craisinlord.antarchy.content.entity.HerculesBeetleEntity.createAttributes().build()); diff --git a/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricItems.java b/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricItems.java index e38b0a58..1955c584 100644 --- a/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricItems.java +++ b/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricItems.java @@ -792,7 +792,7 @@ public final class AntarchyFabricItems { public static final DeferredItem CREEPING_HORROR_EGG_ITEM = ITEMS.registerSimpleBlockItem(AntarchyFabricBlocks.CREEPING_HORROR_EGG); public static final DeferredItem JUMPY_BUG_EGG_ITEM = ITEMS.registerSimpleBlockItem(AntarchyFabricBlocks.JUMPY_BUG_EGG); public static final DeferredItem SPIT_BUG_EGG_ITEM = ITEMS.registerSimpleBlockItem(AntarchyFabricBlocks.SPIT_BUG_EGG); - public static final DeferredItem METROID_EGG_ITEM = ITEMS.registerSimpleBlockItem(AntarchyFabricBlocks.METROID_EGG); + public static final DeferredItem JERRY_EGG_ITEM = ITEMS.registerSimpleBlockItem(AntarchyFabricBlocks.JERRY_EGG); public static final DeferredItem LURKING_TERROR_EGG_ITEM = ITEMS.registerSimpleBlockItem(AntarchyFabricBlocks.LURKING_TERROR_EGG); @@ -887,6 +887,12 @@ public final class AntarchyFabricItems { public static final DeferredItem CHITEN = ITEMS.registerSimpleItem("chiten", new Item.Properties().rarity(Rarity.UNCOMMON)); + public static final DeferredItem JERRY_NUCLEUS = ITEMS.registerSimpleItem("jerry_nucleus", new Item.Properties().rarity(Rarity.UNCOMMON)); + + + public static final DeferredItem CARAPACE = ITEMS.registerSimpleItem("carapace", new Item.Properties().rarity(Rarity.UNCOMMON)); + + public static final DeferredItem STINK_BUG_ITEM = ITEMS.registerSimpleItem("stink_bug", new Item.Properties().rarity(Rarity.UNCOMMON)); @@ -1575,6 +1581,8 @@ public final class AntarchyFabricItems { public static final DeferredItem HERCULES_BEETLE_SPAWN_EGG = ITEMS.register("hercules_beetle_spawn_egg", () -> new DeferredSpawnEggItem(AntarchyFabricEntities.HERCULES_BEETLE, 0x6B1F2A, 0xD4AF37, new Item.Properties().rarity(Rarity.RARE))); + public static final DeferredItem JERRY_SPAWN_EGG = ITEMS.register("jerry_spawn_egg", + () -> new DeferredSpawnEggItem(AntarchyFabricEntities.JERRY, 0x6D2232, 0x8ED34A, new Item.Properties())); public static final DeferredItem TORETERROR_SPAWN_EGG = ITEMS.register("toreterror_spawn_egg", diff --git a/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricSpawnPlacements.java b/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricSpawnPlacements.java index 3d8245fa..aeb5ecd7 100644 --- a/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricSpawnPlacements.java +++ b/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricSpawnPlacements.java @@ -293,6 +293,7 @@ public final class AntarchyFabricSpawnPlacements { SpawnPlacements.register(AntarchyFabricEntities.TORETERROR.get(), SpawnPlacementTypes.ON_GROUND, Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, ToreterrorEntity::canSpawn); SpawnPlacements.register(AntarchyFabricEntities.CREEPING_HORROR.get(), SpawnPlacementTypes.ON_GROUND, Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, com.craisinlord.antarchy.content.entity.CreepingHorrorEntity::canSpawn); SpawnPlacements.register(AntarchyFabricEntities.LURKING_TERROR.get(), SpawnPlacementTypes.ON_GROUND, Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, com.craisinlord.antarchy.content.entity.LurkingTerrorEntity::canSpawn); + SpawnPlacements.register(AntarchyFabricEntities.JERRY.get(), SpawnPlacementTypes.ON_GROUND, Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, com.craisinlord.antarchy.content.entity.JerryEntity::canSpawn); SpawnPlacements.register(AntarchyFabricEntities.TERMITE.get(), SpawnPlacementTypes.ON_GROUND, Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, net.minecraft.world.entity.animal.Animal::checkAnimalSpawnRules); SpawnPlacements.register(AntarchyFabricEntities.ROLLY_POLLY.get(), SpawnPlacementTypes.ON_GROUND, Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, com.craisinlord.antarchy.content.entity.RollyPollyEntity::canSpawn); } diff --git a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/AntarchyConfigModuleNeoforge.java b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/AntarchyConfigModuleNeoforge.java index b63544f9..c298e18a 100644 --- a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/AntarchyConfigModuleNeoforge.java +++ b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/AntarchyConfigModuleNeoforge.java @@ -202,6 +202,14 @@ public final class AntarchyConfigModuleNeoforge { AntarchySettings.setCreepingHorrorAttackDamage(AntarchyMobsConfig.creepingHorrorAttackDamage()); AntarchySettings.setLurkingTerrorHealth(AntarchyMobsConfig.lurkingTerrorHealth()); AntarchySettings.setLurkingTerrorAttackDamage(AntarchyMobsConfig.lurkingTerrorAttackDamage()); + AntarchySettings.setJerryInfantHealth(AntarchyMobsConfig.jerryInfantHealth()); + AntarchySettings.setJerryInfantAttackDamage(AntarchyMobsConfig.jerryInfantAttackDamage()); + AntarchySettings.setJerryMatureHealth(AntarchyMobsConfig.jerryMatureHealth()); + AntarchySettings.setJerryMatureAttackDamage(AntarchyMobsConfig.jerryMatureAttackDamage()); + AntarchySettings.setJerryAlphaHealth(AntarchyMobsConfig.jerryAlphaHealth()); + AntarchySettings.setJerryAlphaAttackDamage(AntarchyMobsConfig.jerryAlphaAttackDamage()); + AntarchySettings.setJerryGammaHealth(AntarchyMobsConfig.jerryGammaHealth()); + AntarchySettings.setJerryGammaAttackDamage(AntarchyMobsConfig.jerryGammaAttackDamage()); AntarchySettings.setCheepHealth(AntarchyMobsConfig.cheepHealth()); AntarchySettings.setCheepAttackDamage(AntarchyMobsConfig.cheepAttackDamage()); AntarchySettings.setDorrieHealth(AntarchyMobsConfig.dorrieHealth()); diff --git a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/AntarchyMobsConfig.java b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/AntarchyMobsConfig.java index 2d66fcba..631b93c5 100644 --- a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/AntarchyMobsConfig.java +++ b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/AntarchyMobsConfig.java @@ -205,6 +205,17 @@ public final class AntarchyMobsConfig { private static final ModConfigSpec.DoubleValue LURKING_TERROR_HEALTH; private static final ModConfigSpec.DoubleValue LURKING_TERROR_ATTACK_DAMAGE; + // Jerry + + private static final ModConfigSpec.DoubleValue JERRY_INFANT_HEALTH; + private static final ModConfigSpec.DoubleValue JERRY_INFANT_ATTACK_DAMAGE; + private static final ModConfigSpec.DoubleValue JERRY_MATURE_HEALTH; + private static final ModConfigSpec.DoubleValue JERRY_MATURE_ATTACK_DAMAGE; + private static final ModConfigSpec.DoubleValue JERRY_ALPHA_HEALTH; + private static final ModConfigSpec.DoubleValue JERRY_ALPHA_ATTACK_DAMAGE; + private static final ModConfigSpec.DoubleValue JERRY_GAMMA_HEALTH; + private static final ModConfigSpec.DoubleValue JERRY_GAMMA_ATTACK_DAMAGE; + // Cheep @@ -553,6 +564,17 @@ public final class AntarchyMobsConfig { LURKING_TERROR_ATTACK_DAMAGE = b.comment("Base attack damage.").defineInRange("attackDamage", 6.0D, 0.0D, 1024.0D); b.pop(); + b.push("jerry"); + JERRY_INFANT_HEALTH = b.comment("Infant Jerry max health.").defineInRange("infantHealth", 20.0D, 1.0D, 32768.0D); + JERRY_INFANT_ATTACK_DAMAGE = b.comment("Infant Jerry damage per attached damage tick.").defineInRange("infantAttackDamage", 2.0D, 0.0D, 1024.0D); + JERRY_MATURE_HEALTH = b.comment("Mature Jerry max health.").defineInRange("matureHealth", 40.0D, 1.0D, 32768.0D); + JERRY_MATURE_ATTACK_DAMAGE = b.comment("Mature Jerry damage per attached damage tick.").defineInRange("matureAttackDamage", 3.5D, 0.0D, 1024.0D); + JERRY_ALPHA_HEALTH = b.comment("Alpha Jerry max health.").defineInRange("alphaHealth", 60.0D, 1.0D, 32768.0D); + JERRY_ALPHA_ATTACK_DAMAGE = b.comment("Alpha Jerry attack damage.").defineInRange("alphaAttackDamage", 6.0D, 0.0D, 1024.0D); + JERRY_GAMMA_HEALTH = b.comment("Gamma Jerry max health.").defineInRange("gammaHealth", 60.0D, 1.0D, 32768.0D); + JERRY_GAMMA_ATTACK_DAMAGE = b.comment("Gamma Jerry melee attack damage.").defineInRange("gammaAttackDamage", 7.0D, 0.0D, 1024.0D); + b.pop(); + b.push("cheep"); CHEEP_HEALTH = b.comment("Base max health.").defineInRange("health", 8.0D, 1.0D, 32768.0D); CHEEP_ATTACK_DAMAGE = b.comment("Base attack damage.").defineInRange("attackDamage", 3.0D, 0.0D, 1024.0D); @@ -748,6 +770,14 @@ public final class AntarchyMobsConfig { static double creepingHorrorAttackDamage() { return CREEPING_HORROR_ATTACK_DAMAGE.get(); } static double lurkingTerrorHealth() { return LURKING_TERROR_HEALTH.get(); } static double lurkingTerrorAttackDamage() { return LURKING_TERROR_ATTACK_DAMAGE.get(); } + static double jerryInfantHealth() { return JERRY_INFANT_HEALTH.get(); } + static double jerryInfantAttackDamage() { return JERRY_INFANT_ATTACK_DAMAGE.get(); } + static double jerryMatureHealth() { return JERRY_MATURE_HEALTH.get(); } + static double jerryMatureAttackDamage() { return JERRY_MATURE_ATTACK_DAMAGE.get(); } + static double jerryAlphaHealth() { return JERRY_ALPHA_HEALTH.get(); } + static double jerryAlphaAttackDamage() { return JERRY_ALPHA_ATTACK_DAMAGE.get(); } + static double jerryGammaHealth() { return JERRY_GAMMA_HEALTH.get(); } + static double jerryGammaAttackDamage() { return JERRY_GAMMA_ATTACK_DAMAGE.get(); } static double cheepHealth() { return CHEEP_HEALTH.get(); } static double cheepAttackDamage() { return CHEEP_ATTACK_DAMAGE.get(); } static double dorrieHealth() { return DORRIE_HEALTH.get(); } diff --git a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/client/AntarchyNeoForgeClient.java b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/client/AntarchyNeoForgeClient.java index 55e47622..721f2d45 100644 --- a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/client/AntarchyNeoForgeClient.java +++ b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/client/AntarchyNeoForgeClient.java @@ -146,6 +146,7 @@ public final class AntarchyNeoForgeClient { event.registerEntityRenderer(AntarchyNeoforgeEntites.CREEPING_HORROR.get(), context -> withParalyzedGeoLayer(new com.craisinlord.antarchy.content.client.renderer.CreepingHorrorRenderer(context))); event.registerEntityRenderer(AntarchyNeoforgeEntites.LURKING_TERROR.get(), context -> withParalyzedGeoLayer(new com.craisinlord.antarchy.content.client.renderer.LurkingTerrorRenderer(context))); event.registerEntityRenderer(AntarchyNeoforgeEntites.HERCULES_BEETLE.get(), context -> withParalyzedGeoLayer(new com.craisinlord.antarchy.content.client.renderer.HerculesBeetleRenderer(context))); + event.registerEntityRenderer(AntarchyNeoforgeEntites.JERRY.get(), context -> withParalyzedGeoLayer(new com.craisinlord.antarchy.content.client.renderer.JerryRenderer(context))); event.registerEntityRenderer(AntarchyNeoforgeEntites.JUMPY_BUG.get(), context -> withParalyzedGeoLayer(new com.craisinlord.antarchy.content.client.renderer.JumpyBugRenderer(context))); event.registerEntityRenderer(AntarchyNeoforgeEntites.SPIT_BUG.get(), context -> withParalyzedGeoLayer(new com.craisinlord.antarchy.content.client.renderer.SpitBugRenderer(context))); event.registerEntityRenderer(AntarchyNeoforgeEntites.SPIT_BUG_PROJECTILE.get(), com.craisinlord.antarchy.content.client.renderer.SpitBugProjectileRenderer::new); @@ -590,7 +591,7 @@ public final class AntarchyNeoForgeClient { ItemBlockRenderTypes.setRenderLayer(AntarchyNeoforgeBlocks.CLOUD_BLOCK.get(), RenderType.translucent()); ItemBlockRenderTypes.setRenderLayer(AntarchyNeoforgeBlocks.JUMPY_BUG_EGG.get(), RenderType.translucent()); ItemBlockRenderTypes.setRenderLayer(AntarchyNeoforgeBlocks.SPIT_BUG_EGG.get(), RenderType.translucent()); - ItemBlockRenderTypes.setRenderLayer(AntarchyNeoforgeBlocks.METROID_EGG.get(), RenderType.translucent()); + ItemBlockRenderTypes.setRenderLayer(AntarchyNeoforgeBlocks.JERRY_EGG.get(), RenderType.translucent()); ItemBlockRenderTypes.setRenderLayer(AntarchyNeoforgeBlocks.BIOWART_TENDRILS.get(), RenderType.cutout()); ItemBlockRenderTypes.setRenderLayer(AntarchyNeoforgeBlocks.HANGING_CREEPROOTS.get(), RenderType.cutout()); ItemBlockRenderTypes.setRenderLayer(AntarchyNeoforgeBlocks.MOLTING_VINES.get(), RenderType.cutout()); diff --git a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeBlocks.java b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeBlocks.java index ba395c0e..f5c38607 100644 --- a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeBlocks.java +++ b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeBlocks.java @@ -251,11 +251,11 @@ public final class AntarchyNeoforgeBlocks { public static final DeferredBlock BIOMITE = BLOCKS.register("biomite", () -> new Block(BlockBehaviour.Properties.ofFullCopy(Blocks.NETHERRACK))); public static final DeferredBlock BIOMITE_TURF = BLOCKS.register("biomite_turf", - () -> new Block(BlockBehaviour.Properties.ofFullCopy(Blocks.NETHERRACK))); + () -> new Block(BlockBehaviour.Properties.ofFullCopy(Blocks.NETHERRACK).lightLevel(state -> 2))); public static final DeferredBlock BIOWART = BLOCKS.register("biowart", - () -> new BiowartBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.MOSS_BLOCK))); + () -> new BiowartBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.MOSS_BLOCK).lightLevel(state -> 2))); public static final DeferredBlock BIOWART_TENDRILS = BLOCKS.register("biowart_tendrils", - () -> new BiowartTendrilsBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.MOSS_CARPET).noCollission().noOcclusion())); + () -> new BiowartTendrilsBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.MOSS_CARPET).lightLevel(state -> 2).noCollission().noOcclusion())); public static final DeferredBlock MYRMITE_COAL_ORE = BLOCKS.register("myrmite_coal_ore", () -> createOre(Blocks.COAL_ORE, 0, 2)); public static final DeferredBlock BROODSTONE = BLOCKS.register("broodstone", @@ -334,8 +334,8 @@ public final class AntarchyNeoforgeBlocks { () -> new JumpyBugEggBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.TURTLE_EGG))); public static final DeferredBlock SPIT_BUG_EGG = BLOCKS.register("spit_bug_egg", () -> new SpitBugEggBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.TURTLE_EGG))); - public static final DeferredBlock METROID_EGG = BLOCKS.register("metroid_egg", - () -> new MetroidEggBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.TURTLE_EGG))); + public static final DeferredBlock JERRY_EGG = BLOCKS.register("jerry_egg", + () -> new JerryEggBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.TURTLE_EGG).randomTicks())); public static final DeferredBlock LURKING_TERROR_EGG = BLOCKS.register("lurking_terror_egg", () -> new LurkingTerrorEggBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.TURTLE_EGG))); diff --git a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeCreativeModeTabs.java b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeCreativeModeTabs.java index 91c32de8..8893e369 100644 --- a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeCreativeModeTabs.java +++ b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeCreativeModeTabs.java @@ -89,6 +89,7 @@ public class AntarchyNeoforgeCreativeModeTabs { event.accept(AntarchyNeoforgeItems.CREEPING_HORROR_SPAWN_EGG.get()); event.accept(AntarchyNeoforgeItems.LURKING_TERROR_SPAWN_EGG.get()); event.accept(AntarchyNeoforgeItems.HERCULES_BEETLE_SPAWN_EGG.get()); + event.accept(AntarchyNeoforgeItems.JERRY_SPAWN_EGG.get()); event.accept(AntarchyNeoforgeItems.DORRIE_SPAWN_EGG.get()); event.accept(AntarchyNeoforgeItems.OURANWOOD_DEER_SPAWN_EGG.get()); event.accept(AntarchyNeoforgeItems.GLIMMER_SPAWN_EGG.get()); @@ -124,7 +125,7 @@ public class AntarchyNeoforgeCreativeModeTabs { event.accept(AntarchyNeoforgeItems.LURKING_TERROR_EGG_ITEM.get()); event.accept(AntarchyNeoforgeItems.JUMPY_BUG_EGG_ITEM.get()); event.accept(AntarchyNeoforgeItems.SPIT_BUG_EGG_ITEM.get()); - event.accept(AntarchyNeoforgeItems.METROID_EGG_ITEM.get()); + event.accept(AntarchyNeoforgeItems.JERRY_EGG_ITEM.get()); event.accept(AntarchyNeoforgeItems.WASP_NEST_ITEM.get()); event.accept(AntarchyNeoforgeItems.RED_ANT_NEST_ITEM.get()); event.accept(AntarchyNeoforgeItems.BROWN_ANT_NEST_ITEM.get()); diff --git a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeEntites.java b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeEntites.java index 5908cab6..329c8de6 100644 --- a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeEntites.java +++ b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeEntites.java @@ -19,6 +19,7 @@ import com.craisinlord.antarchy.content.entity.glimmer.GlimmerEntity; import com.craisinlord.antarchy.content.entity.HushProjectileEntity; import com.craisinlord.antarchy.content.entity.CritterCageProjectileEntity; import com.craisinlord.antarchy.content.entity.HerculesBeetleEntity; +import com.craisinlord.antarchy.content.entity.JerryEntity; import com.craisinlord.antarchy.content.entity.JumpyBugEntity; import com.craisinlord.antarchy.content.entity.AlphaMantisEntity; import com.craisinlord.antarchy.content.entity.RollyPollyEntity; @@ -282,6 +283,7 @@ public final class AntarchyNeoforgeEntites { .sized(0.5F, 0.5F) .clientTrackingRange(8) .updateInterval(1) + .fireImmune() .build("krakens_grasp_trident")); public static final DeferredHolder, EntityType> TENTACLE = ENTITY_TYPES.register("tentacle", @@ -350,6 +352,11 @@ public final class AntarchyNeoforgeEntites { .sized(1.3F, 1.5F) .clientTrackingRange(10) .build("lurking_terror")); + public static final DeferredHolder, EntityType> JERRY = ENTITY_TYPES.register("jerry", + () -> EntityType.Builder.of(JerryEntity::new, MobCategory.MONSTER) + .sized(1.4F, 1.4F) + .clientTrackingRange(10) + .build("jerry")); public static final DeferredHolder, EntityType> CHEEP = ENTITY_TYPES.register("cheep", () -> EntityType.Builder.of(CheepEntity::new, MobCategory.WATER_AMBIENT) .sized(1.0F, 1.2F) diff --git a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeEntityAttributes.java b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeEntityAttributes.java index ba13ab9b..a9be0cd4 100644 --- a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeEntityAttributes.java +++ b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeEntityAttributes.java @@ -70,6 +70,7 @@ public class AntarchyNeoforgeEntityAttributes { event.put(AntarchyNeoforgeEntites.TORETERROR.get(), ToreterrorEntity.createAttributes().build()); event.put(AntarchyNeoforgeEntites.CREEPING_HORROR.get(), CreepingHorrorEntity.createAttributes().build()); event.put(AntarchyNeoforgeEntites.LURKING_TERROR.get(), LurkingTerrorEntity.createAttributes().build()); + event.put(AntarchyNeoforgeEntites.JERRY.get(), JerryEntity.createAttributes().build()); AttributeSupplier redAntAttributes = buildAntAttributes(AntarchySettings.redAntHealth(), AntarchySettings.redAntMovementSpeed(), AntarchySettings.redAntAttackDamage()).build(); AttributeSupplier brownAntAttributes = buildAntAttributes(AntarchySettings.brownAntHealth(), AntarchySettings.brownAntMovementSpeed(), AntarchySettings.brownAntAttackDamage()).build(); diff --git a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeItems.java b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeItems.java index 57df292d..7942d8ea 100644 --- a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeItems.java +++ b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeItems.java @@ -351,7 +351,7 @@ public final class AntarchyNeoforgeItems { public static final DeferredItem CREEPING_HORROR_EGG_ITEM = ITEMS.registerSimpleBlockItem(AntarchyNeoforgeBlocks.CREEPING_HORROR_EGG); public static final DeferredItem JUMPY_BUG_EGG_ITEM = ITEMS.registerSimpleBlockItem(AntarchyNeoforgeBlocks.JUMPY_BUG_EGG); public static final DeferredItem SPIT_BUG_EGG_ITEM = ITEMS.registerSimpleBlockItem(AntarchyNeoforgeBlocks.SPIT_BUG_EGG); - public static final DeferredItem METROID_EGG_ITEM = ITEMS.registerSimpleBlockItem(AntarchyNeoforgeBlocks.METROID_EGG); + public static final DeferredItem JERRY_EGG_ITEM = ITEMS.registerSimpleBlockItem(AntarchyNeoforgeBlocks.JERRY_EGG); public static final DeferredItem LURKING_TERROR_EGG_ITEM = ITEMS.registerSimpleBlockItem(AntarchyNeoforgeBlocks.LURKING_TERROR_EGG); public static final DeferredItem WASP_NEST_ITEM = ITEMS.registerSimpleBlockItem(AntarchyNeoforgeBlocks.WASP_NEST); public static final DeferredItem HUSHWEED_ITEM = ITEMS.registerSimpleBlockItem(AntarchyNeoforgeBlocks.HUSHWEED); @@ -402,6 +402,8 @@ public final class AntarchyNeoforgeItems { public static final DeferredItem QUEEN_SCALE = ITEMS.register("queen_scale", () -> new MobComingSoonTooltipItem(new Item.Properties().rarity(Rarity.RARE))); public static final DeferredItem CHITEN = ITEMS.registerSimpleItem("chiten", new Item.Properties().rarity(Rarity.UNCOMMON)); + public static final DeferredItem JERRY_NUCLEUS = ITEMS.registerSimpleItem("jerry_nucleus", new Item.Properties().rarity(Rarity.UNCOMMON)); + public static final DeferredItem CARAPACE = ITEMS.registerSimpleItem("carapace", new Item.Properties().rarity(Rarity.UNCOMMON)); public static final DeferredItem STINK_BUG = ITEMS.registerSimpleItem("stink_bug", new Item.Properties().rarity(Rarity.UNCOMMON)); public static final DeferredItem JUMPY_BUG_LEG = ITEMS.registerSimpleItem("jumpy_bug_leg", new Item.Properties().rarity(Rarity.UNCOMMON)); public static final DeferredItem JUMPY_BOOTS = ITEMS.register("jumpy_boots", @@ -784,6 +786,8 @@ public final class AntarchyNeoforgeItems { () -> new DeferredSpawnEggItem(AntarchyNeoforgeEntites.LURKING_TERROR, 0x2D5A1B, 0x8B0000, new Item.Properties())); public static final DeferredItem HERCULES_BEETLE_SPAWN_EGG = ITEMS.register("hercules_beetle_spawn_egg", () -> new DeferredSpawnEggItem(AntarchyNeoforgeEntites.HERCULES_BEETLE, 0x6B1F2A, 0xD4AF37, new Item.Properties().rarity(Rarity.RARE))); + public static final DeferredItem JERRY_SPAWN_EGG = ITEMS.register("jerry_spawn_egg", + () -> new DeferredSpawnEggItem(AntarchyNeoforgeEntites.JERRY, 0x6D2232, 0x8ED34A, new Item.Properties())); public static final DeferredItem TORETERROR_SPAWN_EGG = ITEMS.register("toreterror_spawn_egg", () -> new DeferredSpawnEggItem(AntarchyNeoforgeEntites.TORETERROR, 0x90EE90, 0x5C4033, new Item.Properties().rarity(Rarity.EPIC))); public static final DeferredItem CHEEP_SPAWN_EGG = ITEMS.register("cheep_spawn_egg", diff --git a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeSpawnPlacements.java b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeSpawnPlacements.java index 678491f3..6f569e52 100644 --- a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeSpawnPlacements.java +++ b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeSpawnPlacements.java @@ -52,6 +52,7 @@ public class AntarchyNeoforgeSpawnPlacements { event.register(AntarchyNeoforgeEntites.EMPEROR_SCORPION.get(), SpawnPlacementTypes.ON_GROUND, Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, EmperorScorpionEntity::canSpawn, RegisterSpawnPlacementsEvent.Operation.OR); event.register(AntarchyNeoforgeEntites.CREEPING_HORROR.get(), SpawnPlacementTypes.ON_GROUND, Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, CreepingHorrorEntity::canSpawn, RegisterSpawnPlacementsEvent.Operation.OR); event.register(AntarchyNeoforgeEntites.LURKING_TERROR.get(), SpawnPlacementTypes.ON_GROUND, Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, LurkingTerrorEntity::canSpawn, RegisterSpawnPlacementsEvent.Operation.OR); + event.register(AntarchyNeoforgeEntites.JERRY.get(), SpawnPlacementTypes.ON_GROUND, Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, JerryEntity::canSpawn, RegisterSpawnPlacementsEvent.Operation.OR); event.register(AntarchyNeoforgeEntites.TERMITE.get(), SpawnPlacementTypes.ON_GROUND, Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, net.minecraft.world.entity.animal.Animal::checkAnimalSpawnRules, RegisterSpawnPlacementsEvent.Operation.OR); event.register(AntarchyNeoforgeEntites.ROLLY_POLLY.get(), SpawnPlacementTypes.ON_GROUND, Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, com.craisinlord.antarchy.content.entity.RollyPollyEntity::canSpawn, RegisterSpawnPlacementsEvent.Operation.OR); event.register(AntarchyNeoforgeEntites.CHEEP.get(), SpawnPlacementTypes.IN_WATER, Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, AbstractFish::checkSurfaceWaterAnimalSpawnRules, RegisterSpawnPlacementsEvent.Operation.OR);