start metroids

This commit is contained in:
craisinlord committed 2026-07-20 01:08:17 -05:00
1 parent e4b7b76cff
commit c116054a87
110 files changed
+19614 -75

No files matched your search

@@ -32,6 +32,7 @@ public final class AntarchyTags {
public static final TagKey<Block> TERMITE_FOODS = TagKey.create(Registries.BLOCK, id("termite_foods"));
public static final TagKey<Block> UMBRAL_MOSS_REPLACEABLE = TagKey.create(Registries.BLOCK, id("umbral_moss_replaceable"));
public static final TagKey<Block> BLUSH_MOSS_REPLACEABLE = TagKey.create(Registries.BLOCK, id("blush_moss_replaceable"));
public static final TagKey<Block> BIOWART_REPLACEABLE = TagKey.create(Registries.BLOCK, id("biowart_replaceable"));
public static final TagKey<Block> HERCULES_BEETLE_CHARGE_IMMUNE_BLOCKS = TagKey.create(Registries.BLOCK, id("hercules_beetle_charge_immune_blocks"));
public static final TagKey<Block> ELYTHIA_PORTAL_FRAMES = TagKey.create(Registries.BLOCK, id("elythia_portal_frames"));
public static final TagKey<Block> THORAXIS_PORTAL_FRAMES = TagKey.create(Registries.BLOCK, id("thoraxis_portal_frames"));
@@ -125,6 +126,7 @@ public final class AntarchyTags {
public static final TagKey<Biome> MANTIS_OVERWORLD_SPAWN_BIOMES = TagKey.create(Registries.BIOME, id("mantis_overworld_spawn_biomes"));
public static final TagKey<Biome> ELYTHIA_FIREFLY_PARTICLE_BIOMES = TagKey.create(Registries.BIOME, id("elythia_firefly_particle_biomes"));
public static final TagKey<Biome> WILD_CORN_SPAWN_BIOMES = TagKey.create(Registries.BIOME, id("wild_corn_spawn_biomes"));
public static final TagKey<Biome> USES_HORDE_SYSTEM = TagKey.create(Registries.BIOME, id("uses_horde_system"));
private Biomes() {
}
@@ -58,7 +58,8 @@ public final class CreativeTabOrder {
"raw_uranium_block", "raw_titanium_block" -> 7;
case "blood_crystal_block", "small_blood_crystal_bud", "medium_blood_crystal_bud",
"large_blood_crystal_bud", "budding_blood_crystal", "blood_crystal_cluster",
"myrmite", "broodstone", "polished_broodstone", "chiseled_broodstone", "broodstone_bricks",
"myrmite", "biomite", "biomite_turf", "biowart", "biowart_tendrils",
"broodstone", "polished_broodstone", "chiseled_broodstone", "broodstone_bricks",
"broodstone_stairs", "broodstone_slab", "broodstone_wall",
"polished_broodstone_stairs", "polished_broodstone_slab", "polished_broodstone_wall",
"broodstone_brick_stairs", "broodstone_brick_slab", "broodstone_brick_wall",
@@ -73,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" -> 14;
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 "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;
@@ -0,0 +1,26 @@
package com.craisinlord.antarchy.content;
import com.craisinlord.antarchy.Antarchy;
import net.minecraft.core.Holder;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.effect.MobEffect;
import org.jetbrains.annotations.Nullable;
public final class GoopedEffectHooks {
public static final int PROJECTILE_DURATION_TICKS = 20 * 8;
private static final ResourceKey<MobEffect> GOOPED_KEY = ResourceKey.create(
Registries.MOB_EFFECT,
ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "gooped")
);
private GoopedEffectHooks() {
}
@Nullable
public static Holder<MobEffect> holder() {
return BuiltInRegistries.MOB_EFFECT.getHolder(GOOPED_KEY).orElse(null);
}
}
@@ -29,7 +29,10 @@ public final class StinkyBehavior {
if (!(entity.level() instanceof ServerLevel serverLevel)) {
return;
}
if (!entity.isAlive() || entity.tickCount % TRAIL_INTERVAL_TICKS != 0 || !entity.hasEffect(AntarchyObjects.STINKY_EFFECT.get())) {
if (!entity.isAlive() || !entity.hasEffect(AntarchyObjects.STINKY_EFFECT.get())) {
return;
}
if (entity.tickCount % TRAIL_INTERVAL_TICKS != 0) {
return;
}
@@ -0,0 +1,83 @@
package com.craisinlord.antarchy.content.block;
import com.craisinlord.antarchy.content.AntarchyTags;
import com.mojang.serialization.MapCodec;
import net.minecraft.core.BlockPos;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.util.RandomSource;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.BonemealableBlock;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
import java.util.function.Supplier;
public class BiowartBlock extends Block implements BonemealableBlock {
public static final MapCodec<BiowartBlock> CODEC = Block.simpleCodec(BiowartBlock::new);
private static Supplier<? extends Block> biowartTendrils;
public BiowartBlock(BlockBehaviour.Properties properties) {
super(properties);
}
public static void bindTendrils(Supplier<? extends Block> tendrilsSupplier) {
biowartTendrils = tendrilsSupplier;
}
@Override
public MapCodec<BiowartBlock> codec() {
return CODEC;
}
@Override
public boolean isValidBonemealTarget(LevelReader level, BlockPos pos, BlockState state) {
return level.getBlockState(pos.above()).isAir() || hasSpreadTarget(level, pos);
}
@Override
public boolean isBonemealSuccess(Level level, RandomSource random, BlockPos pos, BlockState state) {
return true;
}
@Override
public void performBonemeal(ServerLevel level, RandomSource random, BlockPos pos, BlockState state) {
placeTendrils(level, pos);
BlockPos.MutableBlockPos cursor = new BlockPos.MutableBlockPos();
for (int i = 0; i < 28; i++) {
cursor.setWithOffset(pos, random.nextInt(9) - 4, random.nextInt(3) - 1, random.nextInt(9) - 4);
BlockState target = level.getBlockState(cursor);
if (isBiomite(target)) {
level.setBlock(cursor, this.defaultBlockState(), 3);
placeTendrils(level, cursor);
}
}
}
private static boolean hasSpreadTarget(LevelReader level, BlockPos pos) {
BlockPos.MutableBlockPos cursor = new BlockPos.MutableBlockPos();
for (int x = -3; x <= 3; x++) {
for (int y = -1; y <= 1; y++) {
for (int z = -3; z <= 3; z++) {
cursor.setWithOffset(pos, x, y, z);
if (isBiomite(level.getBlockState(cursor))) {
return true;
}
}
}
}
return false;
}
private static boolean isBiomite(BlockState state) {
return state.is(AntarchyTags.Blocks.BIOWART_REPLACEABLE);
}
private static void placeTendrils(ServerLevel level, BlockPos pos) {
if (biowartTendrils != null && level.isEmptyBlock(pos.above())) {
level.setBlock(pos.above(), biowartTendrils.get().defaultBlockState(), 3);
}
}
}
@@ -0,0 +1,41 @@
package com.craisinlord.antarchy.content.block;
import com.mojang.serialization.MapCodec;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.BushBlock;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
public class BiowartTendrilsBlock extends BushBlock {
public static final MapCodec<BiowartTendrilsBlock> CODEC = Block.simpleCodec(BiowartTendrilsBlock::new);
private static final VoxelShape SHAPE = Block.box(2.0D, 0.0D, 2.0D, 14.0D, 10.0D, 14.0D);
public BiowartTendrilsBlock(BlockBehaviour.Properties properties) {
super(properties);
}
@Override
public MapCodec<BiowartTendrilsBlock> codec() {
return CODEC;
}
@Override
protected boolean mayPlaceOn(BlockState state, BlockGetter level, BlockPos pos) {
return state.getBlock() instanceof BiowartBlock;
}
@Override
protected boolean canSurvive(BlockState state, LevelReader level, BlockPos pos) {
return this.mayPlaceOn(level.getBlockState(pos.below()), level, pos.below());
}
@Override
protected VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) {
return SHAPE;
}
}
@@ -0,0 +1,72 @@
package com.craisinlord.antarchy.content.block;
import com.mojang.serialization.MapCodec;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.Mirror;
import net.minecraft.world.level.block.Rotation;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition;
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<MetroidEggBlock> CODEC = Block.simpleCodec(MetroidEggBlock::new);
public static final BooleanProperty ROTATED = BooleanProperty.create("rotated");
private static final VoxelShape SHAPE = Block.box(1.0D, 0.0D, 0.0D, 15.0D, 16.0D, 16.0D);
public MetroidEggBlock(BlockBehaviour.Properties properties) {
super(properties);
this.registerDefaultState(this.stateDefinition.any().setValue(ROTATED, false));
}
@Override
public MapCodec<MetroidEggBlock> codec() {
return CODEC;
}
@Override
protected VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) {
return SHAPE;
}
@Override
public BlockState getStateForPlacement(BlockPlaceContext context) {
return this.defaultBlockState().setValue(ROTATED, context.getHorizontalDirection().getAxis() == Direction.Axis.X);
}
@Override
protected BlockState rotate(BlockState state, Rotation rotation) {
return rotation == Rotation.CLOCKWISE_90 || rotation == Rotation.COUNTERCLOCKWISE_90
? state.setValue(ROTATED, !state.getValue(ROTATED))
: state;
}
@Override
protected BlockState mirror(BlockState state, Mirror mirror) {
return state;
}
@Override
protected boolean canSurvive(BlockState state, LevelReader level, BlockPos pos) {
return level.getBlockState(pos.below()).isFaceSturdy(level, pos.below(), Direction.UP);
}
@Override
protected BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor level, BlockPos pos, BlockPos neighborPos) {
return state.canSurvive(level, pos) ? super.updateShape(state, direction, neighborState, level, pos, neighborPos) : Blocks.AIR.defaultBlockState();
}
@Override
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
builder.add(ROTATED);
}
}
@@ -0,0 +1,142 @@
package com.craisinlord.antarchy.content.block;
import com.craisinlord.antarchy.Antarchy;
import com.craisinlord.antarchy.content.entity.SpitBugEntity;
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.entity.player.Player;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.Mirror;
import net.minecraft.world.level.block.Rotation;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.level.block.state.properties.IntegerProperty;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
public class SpitBugEggBlock extends Block {
public static final MapCodec<SpitBugEggBlock> CODEC = Block.simpleCodec(SpitBugEggBlock::new);
public static final IntegerProperty HATCH = BlockStateProperties.HATCH;
public static final BooleanProperty ROTATED = BooleanProperty.create("rotated");
private static final int MAX_HATCH = 2;
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 ResourceLocation SPIT_BUG_ID = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "spit_bug");
public SpitBugEggBlock(BlockBehaviour.Properties properties) {
super(properties);
this.registerDefaultState(this.stateDefinition.any().setValue(HATCH, 0).setValue(ROTATED, false));
}
@Override
public MapCodec<SpitBugEggBlock> codec() {
return CODEC;
}
@Override
protected VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) {
return SHAPE;
}
@Override
public BlockState getStateForPlacement(BlockPlaceContext context) {
return this.defaultBlockState().setValue(ROTATED, context.getHorizontalDirection().getAxis() == Direction.Axis.X);
}
@Override
protected BlockState rotate(BlockState state, Rotation rotation) {
return rotation == Rotation.CLOCKWISE_90 || rotation == Rotation.COUNTERCLOCKWISE_90
? state.setValue(ROTATED, !state.getValue(ROTATED))
: state;
}
@Override
protected BlockState mirror(BlockState state, Mirror mirror) {
return state;
}
@Override
protected boolean canSurvive(BlockState state, LevelReader level, BlockPos pos) {
return level.getBlockState(pos.below()).isFaceSturdy(level, pos.below(), Direction.UP);
}
@Override
protected BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor level, BlockPos pos, BlockPos neighborPos) {
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 (!this.shouldUpdateHatchLevel(level, pos)) {
return;
}
int hatch = state.getValue(HATCH);
if (hatch < MAX_HATCH) {
level.setBlock(pos, state.setValue(HATCH, hatch + 1), 2);
level.playSound(null, pos, SoundEvents.TURTLE_EGG_CRACK, SoundSource.BLOCKS, 0.7F, 0.95F + random.nextFloat() * 0.1F);
return;
}
this.hatch(level, pos, random);
}
private boolean shouldUpdateHatchLevel(Level level, BlockPos pos) {
if (level.random.nextInt(PLAYER_PROXIMITY_CHECK_INTERVAL) == 0) {
Player nearbyPlayer = level.getNearestPlayer(pos.getX() + 0.5D, pos.getY() + 0.5D, pos.getZ() + 0.5D, PLAYER_PROXIMITY_RADIUS, false);
if (nearbyPlayer != null && level.random.nextFloat() < PLAYER_PROXIMITY_HATCH_CHANCE) {
return true;
}
}
boolean onAmberMoss = level.getBlockState(pos.below()).getBlock() instanceof AmberMossBlock;
return level.random.nextInt(onAmberMoss ? 150 : 500) == 0;
}
private void hatch(ServerLevel level, BlockPos pos, RandomSource random) {
level.removeBlock(pos, false);
level.playSound(null, pos, SoundEvents.TURTLE_EGG_HATCH, SoundSource.BLOCKS, 0.75F, 0.95F + random.nextFloat() * 0.1F);
@SuppressWarnings("unchecked")
EntityType<SpitBugEntity> spitBugType = (EntityType<SpitBugEntity>) (EntityType<?>) BuiltInRegistries.ENTITY_TYPE.getOptional(SPIT_BUG_ID).orElse(null);
if (spitBugType == null) {
return;
}
SpitBugEntity entity = spitBugType.create(level);
if (entity == null) {
return;
}
double spawnX = pos.getX() + 0.25D + random.nextDouble() * 0.5D;
double spawnZ = pos.getZ() + 0.25D + random.nextDouble() * 0.5D;
entity.moveTo(spawnX, pos.getY() + 0.1D, spawnZ, random.nextFloat() * 360.0F, 0.0F);
level.addFreshEntity(entity);
}
@Override
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
builder.add(HATCH, ROTATED);
}
}
@@ -0,0 +1,38 @@
package com.craisinlord.antarchy.content.client;
import com.craisinlord.antarchy.content.GoopedEffectHooks;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.core.Holder;
import net.minecraft.util.Mth;
import net.minecraft.world.effect.MobEffect;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.entity.player.Player;
public final class GoopedHudRenderer {
private GoopedHudRenderer() {
}
public static void render(GuiGraphics guiGraphics) {
Minecraft minecraft = Minecraft.getInstance();
Player player = minecraft.player;
Holder<MobEffect> gooped = GoopedEffectHooks.holder();
if (player == null || player.isDeadOrDying() || gooped == null) {
return;
}
MobEffectInstance effect = player.getEffect(gooped);
if (effect == null) {
return;
}
float durationFade = effect.isInfiniteDuration()
? 1.0F
: Mth.clamp(effect.getDuration() / 40.0F, 0.25F, 1.0F);
float strength = Mth.clamp((effect.getAmplifier() + 1) / 3.0F, 0.0F, 1.0F);
int alpha = Mth.clamp((int) ((0x38 + 0x20 * strength) * durationFade), 0, 0x70);
int width = minecraft.getWindow().getGuiScaledWidth();
int height = minecraft.getWindow().getGuiScaledHeight();
guiGraphics.fill(0, 0, width, height, (alpha << 24) | 0x16B846);
}
}
@@ -0,0 +1,46 @@
package com.craisinlord.antarchy.content.client;
import net.minecraft.client.Minecraft;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.util.Mth;
import net.minecraft.world.phys.Vec3;
public final class HordeClientState {
private static float targetIntensity;
private static float intensity;
private HordeClientState() {
}
public static void update(float syncedIntensity) {
targetIntensity = Mth.clamp(syncedIntensity, 0.0F, 1.0F);
}
public static float intensity() {
return intensity;
}
public static void tick() {
Minecraft minecraft = Minecraft.getInstance();
if (minecraft.level == null || minecraft.player == null) {
targetIntensity = 0.0F;
}
intensity += (targetIntensity - intensity) * 0.08F;
if (intensity < 0.01F) {
return;
}
if (minecraft.level == null || minecraft.player == null || minecraft.isPaused()) {
return;
}
int count = Math.max(1, (int) (intensity * 5.0F));
Vec3 center = minecraft.player.position();
for (int i = 0; i < count; i++) {
double x = center.x + (minecraft.level.random.nextDouble() - 0.5D) * 18.0D;
double y = center.y + minecraft.level.random.nextDouble() * 5.0D;
double z = center.z + (minecraft.level.random.nextDouble() - 0.5D) * 18.0D;
minecraft.level.addParticle(ParticleTypes.MYCELIUM, x, y, z, 0.0D, 0.015D + intensity * 0.025D, 0.0D);
}
}
}
@@ -0,0 +1,28 @@
package com.craisinlord.antarchy.content.client;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.util.Mth;
public final class HordeHudRenderer {
private HordeHudRenderer() {
}
public static void render(GuiGraphics guiGraphics) {
Minecraft minecraft = Minecraft.getInstance();
if (minecraft.player == null || minecraft.player.isDeadOrDying()) {
return;
}
float intensity = HordeClientState.intensity();
if (intensity <= 0.01F) {
return;
}
float pulse = 0.9F + 0.1F * Mth.sin(minecraft.player.tickCount * ((float) Math.PI * 2.0F / 90.0F));
int alpha = Mth.clamp((int) (intensity * pulse * 0x78), 0, 0x78);
int width = minecraft.getWindow().getGuiScaledWidth();
int height = minecraft.getWindow().getGuiScaledHeight();
guiGraphics.fill(0, 0, width, height, (alpha << 24) | 0xD84A16);
}
}
@@ -1,6 +1,7 @@
package com.craisinlord.antarchy.content.client.renderer;
import com.craisinlord.antarchy.Antarchy;
import com.craisinlord.antarchy.content.client.HordeClientState;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.BufferBuilder;
import com.mojang.blaze3d.vertex.BufferUploader;
@@ -53,9 +54,10 @@ public final class CavarynSkyRenderer {
return;
}
float red = 0.015F;
float green = 0.085F;
float blue = 0.035F;
float intensity = HordeClientState.intensity();
float red = 0.015F + 0.28F * intensity;
float green = 0.085F + 0.18F * intensity;
float blue = 0.035F + 0.02F * intensity;
RenderSystem.depthMask(false);
RenderSystem.setShaderColor(red, green, blue, 1.0F);
@@ -64,7 +66,7 @@ public final class CavarynSkyRenderer {
VertexBuffer.unbind();
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
float starBrightness = 0.8F;
float starBrightness = 0.8F + 0.45F * intensity;
if (orangeStarBuffer == null) {
orangeStarBuffer = buildOrangeStarBuffer();
}
@@ -0,0 +1,56 @@
package com.craisinlord.antarchy.content.client.renderer;
import com.craisinlord.antarchy.content.GoopedEffectHooks;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.core.Holder;
import net.minecraft.world.effect.MobEffect;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity;
import org.jetbrains.annotations.Nullable;
import software.bernie.geckolib.animatable.GeoAnimatable;
import software.bernie.geckolib.cache.object.BakedGeoModel;
import software.bernie.geckolib.renderer.GeoRenderer;
import software.bernie.geckolib.renderer.layer.GeoRenderLayer;
public final class GoopedGeoLayer<T extends GeoAnimatable> extends GeoRenderLayer<T> {
private static final int GOOPED_TINT = 0x6632FF55;
public GoopedGeoLayer(GeoRenderer<T> renderer) {
super(renderer);
}
@Override
public void render(PoseStack poseStack, T animatable, BakedGeoModel bakedModel, @Nullable RenderType renderType,
MultiBufferSource bufferSource, @Nullable VertexConsumer buffer, float partialTick,
int packedLight, int packedOverlay) {
if (!(animatable instanceof Entity entity) || !(entity instanceof LivingEntity livingEntity)) {
return;
}
Holder<MobEffect> gooped = GoopedEffectHooks.holder();
if (gooped == null || !livingEntity.hasEffect(gooped)) {
return;
}
poseStack.pushPose();
poseStack.scale(1.018F, 1.018F, 1.018F);
RenderType goopedRenderType = RenderType.entityTranslucent(this.getRenderer().getTextureLocation(animatable));
VertexConsumer goopedBuffer = bufferSource.getBuffer(goopedRenderType);
this.getRenderer().reRender(
bakedModel,
poseStack,
bufferSource,
animatable,
goopedRenderType,
goopedBuffer,
partialTick,
packedLight,
packedOverlay,
GOOPED_TINT
);
poseStack.popPose();
}
}
@@ -0,0 +1,44 @@
package com.craisinlord.antarchy.content.client.renderer;
import com.craisinlord.antarchy.content.GoopedEffectHooks;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import net.minecraft.client.model.EntityModel;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.entity.LivingEntityRenderer;
import net.minecraft.client.renderer.entity.RenderLayerParent;
import net.minecraft.client.renderer.entity.layers.RenderLayer;
import net.minecraft.core.Holder;
import net.minecraft.world.effect.MobEffect;
import net.minecraft.world.entity.LivingEntity;
public final class GoopedLivingLayer<T extends LivingEntity, M extends EntityModel<T>> extends RenderLayer<T, M> {
private static final int GOOPED_TINT = 0x6632FF55;
public GoopedLivingLayer(RenderLayerParent<T, M> renderer) {
super(renderer);
}
@Override
public void render(PoseStack poseStack, MultiBufferSource buffer, int packedLight, T entity,
float limbSwing, float limbSwingAmount, float partialTick, float ageInTicks,
float netHeadYaw, float headPitch) {
Holder<MobEffect> gooped = GoopedEffectHooks.holder();
if (gooped == null || !entity.hasEffect(gooped)) {
return;
}
poseStack.pushPose();
poseStack.scale(1.018F, 1.018F, 1.018F);
VertexConsumer vertexConsumer = buffer.getBuffer(RenderType.entityTranslucent(this.getTextureLocation(entity)));
this.getParentModel().renderToBuffer(
poseStack,
vertexConsumer,
packedLight,
LivingEntityRenderer.getOverlayCoords(entity, 0.0F),
GOOPED_TINT
);
poseStack.popPose();
}
}
@@ -0,0 +1,71 @@
package com.craisinlord.antarchy.content.command;
import com.craisinlord.antarchy.content.horde.CavarynHordeManager;
import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.arguments.IntegerArgumentType;
import com.mojang.brigadier.context.CommandContext;
import java.util.Collection;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.Commands;
import net.minecraft.commands.arguments.EntityArgument;
import net.minecraft.network.chat.Component;
import net.minecraft.server.level.ServerPlayer;
public final class CavarynCommand {
private CavarynCommand() {
}
public static void register(CommandDispatcher<CommandSourceStack> dispatcher) {
dispatcher.register(
Commands.literal("cavaryn")
.requires(source -> source.hasPermission(2))
.then(Commands.literal("horde")
.then(Commands.literal("get")
.executes(context -> getHordeLevel(context, java.util.List.of(context.getSource().getPlayerOrException())))
.then(Commands.argument("targets", EntityArgument.players())
.executes(context -> getHordeLevel(context, EntityArgument.getPlayers(context, "targets")))))
.then(Commands.literal("set")
.then(Commands.argument("level", IntegerArgumentType.integer(0, CavarynHordeManager.maxHordeLevel()))
.executes(context -> setHordeLevel(context, IntegerArgumentType.getInteger(context, "level"), java.util.List.of(context.getSource().getPlayerOrException())))
.then(Commands.argument("targets", EntityArgument.players())
.executes(context -> setHordeLevel(context, IntegerArgumentType.getInteger(context, "level"), EntityArgument.getPlayers(context, "targets")))))))
);
}
private static int getHordeLevel(CommandContext<CommandSourceStack> context, Collection<ServerPlayer> targets) {
int found = 0;
for (ServerPlayer target : targets) {
int levelValue = CavarynHordeManager.getHordeLevel(target);
if (levelValue < 0) {
context.getSource().sendSuccess(
() -> Component.literal(target.getName().getString() + ": not in Cavaryn"),
false
);
continue;
}
found++;
context.getSource().sendSuccess(
() -> Component.literal(target.getName().getString() + ": Cavaryn horde level " + levelValue + "/" + CavarynHordeManager.maxHordeLevel()),
false
);
}
return found;
}
private static int setHordeLevel(CommandContext<CommandSourceStack> context, int levelValue, Collection<ServerPlayer> targets) {
int changed = 0;
for (ServerPlayer target : targets) {
if (CavarynHordeManager.setHordeLevel(target, levelValue) >= 0) {
changed++;
}
}
int finalChanged = changed;
context.getSource().sendSuccess(
() -> Component.literal("Set Cavaryn horde level to " + levelValue + " for " + finalChanged + " player(s) in Cavaryn"),
true
);
return changed;
}
}
@@ -0,0 +1,26 @@
package com.craisinlord.antarchy.content.effect;
import com.craisinlord.antarchy.Antarchy;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.effect.MobEffect;
import net.minecraft.world.effect.MobEffectCategory;
import net.minecraft.world.entity.ai.attributes.AttributeModifier;
import net.minecraft.world.entity.ai.attributes.Attributes;
public final class GoopedMobEffect extends MobEffect {
public GoopedMobEffect() {
super(MobEffectCategory.HARMFUL, 0x32B84E);
this.addAttributeModifier(
Attributes.ATTACK_SPEED,
ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "gooped_attack_speed"),
-0.3D,
AttributeModifier.Operation.ADD_MULTIPLIED_TOTAL
);
this.addAttributeModifier(
Attributes.MOVEMENT_SPEED,
ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "gooped_movement_speed"),
-0.3D,
AttributeModifier.Operation.ADD_MULTIPLIED_TOTAL
);
}
}
@@ -78,7 +78,6 @@ public class CreepingHorrorEntity extends Monster implements GeoEntity {
if (spawnReason == MobSpawnType.SPAWN_EGG || spawnReason == MobSpawnType.SPAWNER || spawnReason == MobSpawnType.COMMAND) {
return true;
}
BlockPos belowPos = pos.below();
BlockState belowState = level.getBlockState(belowPos);
boolean validSupport = !belowState.is(Blocks.BEDROCK)
@@ -121,7 +121,6 @@ public class JumpyBugEntity extends Monster implements GeoEntity {
if (spawnReason == MobSpawnType.SPAWN_EGG || spawnReason == MobSpawnType.SPAWNER || spawnReason == MobSpawnType.COMMAND) {
return true;
}
return level.getDifficulty() != Difficulty.PEACEFUL
&& Monster.checkMonsterSpawnRules(entityType, level, spawnReason, pos, random);
}
@@ -281,7 +280,7 @@ public class JumpyBugEntity extends Monster implements GeoEntity {
@Override
protected SoundEvent getDeathSound() {
return SoundEvents.SPIDER_DEATH;
return AntarchySoundEvents.JUMPY_BUG_HURT.get();
}
@Override
@@ -66,7 +66,6 @@ public class LurkingTerrorEntity extends Monster implements GeoEntity {
if (spawnReason == MobSpawnType.SPAWN_EGG || spawnReason == MobSpawnType.SPAWNER || spawnReason == MobSpawnType.COMMAND) {
return true;
}
BlockPos belowPos = pos.below();
BlockState belowState = level.getBlockState(belowPos);
boolean validSupport = !belowState.is(Blocks.BEDROCK)
@@ -89,7 +89,6 @@ public class SpitBugEntity extends Monster implements GeoEntity {
if (spawnReason == MobSpawnType.SPAWN_EGG || spawnReason == MobSpawnType.SPAWNER || spawnReason == MobSpawnType.COMMAND) {
return true;
}
return level.getDifficulty() != Difficulty.PEACEFUL
&& level.isEmptyBlock(pos)
&& level.isEmptyBlock(pos.above())
@@ -167,7 +166,7 @@ public class SpitBugEntity extends Monster implements GeoEntity {
@Override
protected SoundEvent getDeathSound() {
return SoundEvents.SPIDER_DEATH;
return AntarchySoundEvents.SPIT_BUG_HURT.get();
}
@Override
@@ -1,13 +1,15 @@
package com.craisinlord.antarchy.content.entity;
import com.craisinlord.antarchy.content.GoopedEffectHooks;
import com.craisinlord.antarchy.content.damage.AntarchyDamageSources;
import net.minecraft.core.Holder;
import net.minecraft.core.particles.ParticleTypes;
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.world.effect.MobEffectInstance;
import net.minecraft.world.effect.MobEffects;
import net.minecraft.world.effect.MobEffect;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity;
@@ -128,7 +130,7 @@ public class SpitBugProjectileEntity extends ThrowableItemProjectile {
this.getBoundingBox().inflate(LINGER_RADIUS, 0.6D, LINGER_RADIUS),
entity -> entity.isAlive() && entity != this.getOwner()
)) {
target.addEffect(new MobEffectInstance(MobEffects.MOVEMENT_SLOWDOWN, 30, 3, false, true, true));
applyGooped(target, 30);
target.makeStuckInBlock(Blocks.HONEY_BLOCK.defaultBlockState(), new Vec3(0.2D, 0.0D, 0.2D));
}
@@ -148,7 +150,7 @@ public class SpitBugProjectileEntity extends ThrowableItemProjectile {
} else {
livingTarget.hurt(this.damageSources().magic(), DIRECT_HIT_DAMAGE);
}
livingTarget.addEffect(new MobEffectInstance(MobEffects.MOVEMENT_SLOWDOWN, 80, 3, false, true, true));
applyGooped(livingTarget, GoopedEffectHooks.PROJECTILE_DURATION_TICKS);
livingTarget.makeStuckInBlock(Blocks.HONEY_BLOCK.defaultBlockState(), new Vec3(0.25D, 0.0D, 0.25D));
}
@@ -172,4 +174,11 @@ public class SpitBugProjectileEntity extends ThrowableItemProjectile {
this.setPos(location.x, location.y + 0.05D, location.z);
this.setDeltaMovement(Vec3.ZERO);
}
private static void applyGooped(LivingEntity target, int durationTicks) {
Holder<MobEffect> gooped = GoopedEffectHooks.holder();
if (gooped != null) {
target.addEffect(new MobEffectInstance(gooped, durationTicks, 0, false, true, true));
}
}
}
@@ -50,6 +50,15 @@ public class TentacleEntity extends Mob implements GeoEntity {
return true;
}
@Override
public boolean fireImmune() {
return true;
}
@Override
public void lavaHurt() {
}
@Override
public void push(net.minecraft.world.entity.Entity entity) {
}
@@ -0,0 +1,816 @@
package com.craisinlord.antarchy.content.horde;
import com.craisinlord.antarchy.Antarchy;
import com.craisinlord.antarchy.content.AntarchySoundEvents;
import com.craisinlord.antarchy.content.AntarchyTags;
import com.craisinlord.antarchy.content.network.HerculesBeetleImpactShakeSync;
import com.craisinlord.antarchy.content.network.HordeIntensitySync;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import net.minecraft.core.BlockPos;
import net.minecraft.core.HolderLookup;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.core.registries.Registries;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.ListTag;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
import net.minecraft.util.Mth;
import net.minecraft.util.RandomSource;
import net.minecraft.world.Difficulty;
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.MobCategory;
import net.minecraft.world.entity.MobSpawnType;
import net.minecraft.world.entity.monster.Enemy;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.ServerLevelAccessor;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.saveddata.SavedData;
import net.minecraft.world.phys.AABB;
import org.jetbrains.annotations.Nullable;
public final class CavarynHordeManager {
private static final ResourceKey<Level> CAVARYN = ResourceKey.create(
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 String DATA_ID = "antarchy_cavaryn_hordes";
private static final int GROUP_RADIUS_BLOCKS = 128;
private static final int ATTENTION_THRESHOLD = 100;
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_MIN_SPAWN_INTERVAL = 20 * 50;
private static final int DORMANT_RANDOM_SPAWN_INTERVAL = 20 * 35;
private static final int AWAKENING_SKIRMISH_INTERVAL = 20 * 8;
private static final int AWAKENING_TICKS = 20 * 25;
private static final int PULSE_INTERVAL_TICKS = 20 * 18;
private static final int RECOVERY_TICKS = 20 * 60;
private static final int ABANDON_TIMEOUT_TICKS = 20 * 20;
private static final int HERCULES_TIMEOUT_TICKS = 20 * 180;
private static final int MAX_HORDE_MOBS_PER_ENCOUNTER = 48;
private static final int MAX_DORMANT_MOBS_PER_AREA = 8;
private static final int MAX_SPAWN_ATTEMPTS_PER_MOB = 18;
private static final double MIN_SPAWN_DISTANCE = 18.0D;
private static final double MAX_SPAWN_DISTANCE = 36.0D;
private CavarynHordeManager() {
}
public static void tick(ServerLevel level) {
if (!level.dimension().equals(CAVARYN)) {
return;
}
HordeData data = get(level);
long gameTime = level.getGameTime();
if (gameTime % PLAYER_CHECK_INTERVAL == 0L) {
tickPlayers(level, data, gameTime);
}
tickEncounters(level, data, gameTime);
if (gameTime % 100L == 0L) {
data.prune(level, gameTime);
}
}
public static void recordMobKill(ServerPlayer player, LivingEntity killed) {
if (!(player.level() instanceof ServerLevel level) || !level.dimension().equals(CAVARYN)) {
return;
}
if (!isHordeBiome(level, player.blockPosition())) {
return;
}
if (isPlayerInActiveEncounter(level, player)) {
return;
}
addAttention(level, player, killed instanceof Enemy || killed.getType().getCategory() == MobCategory.MONSTER ? 18 : 8);
}
public static void recordBlockBreak(ServerPlayer player, BlockState brokenState, BlockPos pos) {
if (!(player.level() instanceof ServerLevel level) || !level.dimension().equals(CAVARYN)) {
return;
}
if (!isHordeBiome(level, pos) || isPlayerInActiveEncounter(level, player)) {
return;
}
addAttention(level, player, isEggOrNest(brokenState) ? 22 : 2);
}
public static boolean isHordeBiome(ServerLevelAccessor level, BlockPos pos) {
return level.getBiome(pos).is(AntarchyTags.Biomes.USES_HORDE_SYSTEM);
}
public static int maxHordeLevel() {
return ATTENTION_THRESHOLD;
}
public static int getHordeLevel(ServerPlayer player) {
if (!(player.level() instanceof ServerLevel level) || !level.dimension().equals(CAVARYN)) {
return -1;
}
PlayerAttention attention = get(level).players.get(player.getUUID());
return attention != null ? attention.attention : 0;
}
public static int setHordeLevel(ServerPlayer player, int levelValue) {
if (!(player.level() instanceof ServerLevel level) || !level.dimension().equals(CAVARYN)) {
return -1;
}
HordeData data = get(level);
PlayerAttention attention = data.players.computeIfAbsent(player.getUUID(), ignored -> new PlayerAttention());
attention.attention = Mth.clamp(levelValue, 0, ATTENTION_THRESHOLD);
attention.areaKey = areaKey(player.blockPosition());
attention.areaTicks = 0;
attention.lastSeenGameTime = level.getGameTime();
if (attention.attention < ATTENTION_THRESHOLD) {
data.encounters.removeIf(encounter -> encounter.center.distSqr(player.blockPosition()) <= GROUP_RADIUS_BLOCKS * GROUP_RADIUS_BLOCKS);
}
data.setDirty();
HordeIntensitySync.send(player, attention.attention / (float) ATTENTION_THRESHOLD);
return attention.attention;
}
private static void tickPlayers(ServerLevel level, HordeData data, long gameTime) {
Set<UUID> seen = new HashSet<>();
for (ServerPlayer player : level.players()) {
if (player.isSpectator()) {
continue;
}
UUID uuid = player.getUUID();
seen.add(uuid);
PlayerAttention attention = data.players.computeIfAbsent(uuid, ignored -> new PlayerAttention());
boolean inHordeBiome = isHordeBiome(level, player.blockPosition());
if (!inHordeBiome) {
attention.fade(6);
data.setDirty();
HordeIntensitySync.send(player, 0.0F);
continue;
}
attention.lastSeenGameTime = gameTime;
BlockPos pos = player.blockPosition();
long currentArea = areaKey(pos);
if (attention.areaKey != currentArea) {
attention.areaKey = currentArea;
attention.areaTicks = 0;
attention.fade(4);
data.setDirty();
} else if (!isPlayerInActiveEncounter(level, player)) {
attention.areaTicks += PLAYER_CHECK_INTERVAL;
if (attention.areaTicks >= AREA_ATTENTION_INTERVAL) {
attention.areaTicks = 0;
attention.add(6);
data.setDirty();
}
}
Encounter encounter = findNearbyEncounter(data, player.blockPosition());
if (encounter == null && attention.attention >= ATTENTION_THRESHOLD) {
startEncounter(level, data, player);
encounter = findNearbyEncounter(data, player.blockPosition());
}
if (encounter == null) {
tickDormantPressure(level, data, player, attention, currentArea, gameTime);
}
HordeIntensitySync.send(player, encounter != null ? encounter.intensity(gameTime) : attention.attention / (float) ATTENTION_THRESHOLD);
}
for (Map.Entry<UUID, PlayerAttention> entry : data.players.entrySet()) {
if (!seen.contains(entry.getKey())) {
entry.getValue().fade(2);
}
}
}
private static void tickEncounters(ServerLevel level, HordeData data, long gameTime) {
Iterator<Encounter> iterator = data.encounters.iterator();
while (iterator.hasNext()) {
Encounter encounter = iterator.next();
List<ServerPlayer> targets = targetsFor(level, encounter);
if (targets.isEmpty()) {
if (encounter.abandonedSince < 0L) {
encounter.abandonedSince = gameTime;
}
if (gameTime - encounter.abandonedSince >= ABANDON_TIMEOUT_TICKS) {
iterator.remove();
data.setDirty();
}
continue;
}
encounter.abandonedSince = -1L;
encounter.center = averageBlockPos(targets);
if (encounter.phase == Phase.AWAKENING && gameTime >= encounter.nextSkirmishTime) {
spawnAwakeningSkirmish(level, encounter, targets);
encounter.nextSkirmishTime = gameTime + AWAKENING_SKIRMISH_INTERVAL;
data.setDirty();
}
if (encounter.phase == Phase.AWAKENING && gameTime >= encounter.nextPulseTime) {
encounter.phase = Phase.SWARMING;
encounter.nextPulseTime = gameTime;
}
if (encounter.phase == Phase.SWARMING && gameTime >= encounter.nextPulseTime) {
spawnPulse(level, encounter, targets);
encounter.wave++;
encounter.nextPulseTime = gameTime + PULSE_INTERVAL_TICKS;
if (encounter.wave >= 4) {
encounter.phase = Phase.HERCULES;
}
data.setDirty();
}
if (encounter.phase == Phase.HERCULES && herculesCleared(level, encounter, gameTime)) {
encounter.phase = Phase.RECOVERY;
encounter.recoveryEndsAt = gameTime + RECOVERY_TICKS;
data.setDirty();
}
if (encounter.phase == Phase.RECOVERY && gameTime >= encounter.recoveryEndsAt) {
fadeAttentionNear(data, encounter.center, 70);
iterator.remove();
data.setDirty();
}
}
}
private static void tickDormantPressure(ServerLevel level, HordeData data, ServerPlayer player, PlayerAttention attention, long areaKey, long gameTime) {
long nextSpawnTime = data.areaSpawnCooldowns.getOrDefault(areaKey, 0L);
if (gameTime < nextSpawnTime || level.getDifficulty() == Difficulty.PEACEFUL) {
return;
}
int existing = countNearbyDirectHordeMobs(level, player.blockPosition(), 48.0D);
if (existing >= 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);
}
}
data.areaSpawnCooldowns.put(areaKey, gameTime + DORMANT_MIN_SPAWN_INTERVAL + level.random.nextInt(DORMANT_RANDOM_SPAWN_INTERVAL));
data.setDirty();
}
private static boolean herculesCleared(ServerLevel level, Encounter encounter, long gameTime) {
if (encounter.herculesIds.isEmpty() || gameTime >= encounter.herculesTimeoutAt) {
return true;
}
for (UUID uuid : encounter.herculesIds) {
Entity entity = level.getEntity(uuid);
if (entity instanceof LivingEntity living && living.isAlive() && !living.isRemoved()) {
return false;
}
}
return true;
}
private static void addAttention(ServerLevel level, ServerPlayer player, int amount) {
HordeData data = get(level);
PlayerAttention attention = data.players.computeIfAbsent(player.getUUID(), ignored -> new PlayerAttention());
attention.lastSeenGameTime = level.getGameTime();
attention.areaKey = areaKey(player.blockPosition());
attention.add(amount);
data.setDirty();
}
private static void startEncounter(ServerLevel level, HordeData data, ServerPlayer seedPlayer) {
Encounter existing = findNearbyEncounter(data, seedPlayer.blockPosition());
if (existing != null) {
return;
}
Encounter encounter = new Encounter();
encounter.id = UUID.randomUUID();
encounter.center = seedPlayer.blockPosition();
encounter.phase = Phase.AWAKENING;
encounter.startedAt = level.getGameTime();
encounter.nextPulseTime = level.getGameTime() + AWAKENING_TICKS;
encounter.nextSkirmishTime = level.getGameTime() + AWAKENING_SKIRMISH_INTERVAL;
encounter.recoveryEndsAt = -1L;
encounter.abandonedSince = -1L;
encounter.herculesTimeoutAt = level.getGameTime() + AWAKENING_TICKS + PULSE_INTERVAL_TICKS * 4L + HERCULES_TIMEOUT_TICKS;
for (ServerPlayer player : targetsFor(level, encounter)) {
encounter.targets.add(player.getUUID());
}
if (encounter.targets.isEmpty()) {
encounter.targets.add(seedPlayer.getUUID());
}
data.encounters.add(encounter);
data.setDirty();
}
private static void spawnAwakeningSkirmish(ServerLevel level, Encounter encounter, List<ServerPlayer> targets) {
if (level.getDifficulty() == Difficulty.PEACEFUL) {
return;
}
int players = Math.max(1, targets.size());
int capacity = Math.max(0, scaleSpawnCount(level, MAX_HORDE_MOBS_PER_ENCOUNTER) - encounter.hordeMobIds.size());
if (capacity <= 0) {
return;
}
List<EntityType<?>> types = new ArrayList<>();
addCommon(types, scaleSpawnCount(level, 2 + players));
addRepeated(types, spitBugType(), scaleSpawnCount(level, Math.max(1, players)));
int spawned = 0;
for (EntityType<?> type : types) {
if (spawned >= capacity || type == null) {
break;
}
ServerPlayer target = targets.get(level.random.nextInt(targets.size()));
if (spawnDirectMob(level, encounter, type, target)) {
spawned++;
}
}
}
private static void spawnPulse(ServerLevel level, Encounter encounter, List<ServerPlayer> targets) {
if (level.getDifficulty() == Difficulty.PEACEFUL) {
return;
}
int players = Math.max(1, targets.size());
int capacity = Math.max(0, scaleSpawnCount(level, MAX_HORDE_MOBS_PER_ENCOUNTER) - encounter.hordeMobIds.size());
if (capacity <= 0) {
return;
}
List<EntityType<?>> 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));
warnHercules(level, encounter.center, targets);
}
}
int spawned = 0;
for (EntityType<?> type : types) {
if (spawned >= capacity || type == null) {
break;
}
ServerPlayer target = targets.get(level.random.nextInt(targets.size()));
if (spawnDirectMob(level, encounter, type, target)) {
spawned++;
}
}
}
private static boolean spawnDirectMob(ServerLevel level, @Nullable Encounter encounter, EntityType<?> type, ServerPlayer target) {
BlockPos spawnPos = findSpawnPos(level, target, type, level.random);
if (spawnPos == null) {
return false;
}
Entity entity = type.create(level);
if (!(entity instanceof Mob mob)) {
return false;
}
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 (!level.addFreshEntity(mob)) {
return false;
}
if (encounter != null) {
encounter.hordeMobIds.add(mob.getUUID());
}
if (type == herculesBeetleType()) {
if (encounter != null) {
encounter.herculesIds.add(mob.getUUID());
}
level.playSound(null, spawnPos, SoundEvents.GENERIC_EXPLODE.value(), SoundSource.HOSTILE, 1.5F, 0.65F);
HerculesBeetleImpactShakeSync.send(target, 28);
} else {
level.playSound(null, spawnPos, SoundEvents.GRAVEL_BREAK, SoundSource.HOSTILE, 0.7F, 0.75F + level.random.nextFloat() * 0.25F);
}
level.sendParticles(net.minecraft.core.particles.ParticleTypes.POOF, spawnPos.getX() + 0.5D, spawnPos.getY() + 0.2D, spawnPos.getZ() + 0.5D, 8, 0.4D, 0.2D, 0.4D, 0.03D);
return true;
}
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();
}
@Nullable
private static BlockPos findSpawnPos(ServerLevel level, ServerPlayer target, EntityType<?> type, RandomSource random) {
BlockPos origin = target.blockPosition();
for (int attempt = 0; attempt < MAX_SPAWN_ATTEMPTS_PER_MOB; attempt++) {
double angle = random.nextDouble() * Math.PI * 2.0D;
double distance = MIN_SPAWN_DISTANCE + random.nextDouble() * (MAX_SPAWN_DISTANCE - MIN_SPAWN_DISTANCE);
BlockPos base = origin.offset(Mth.floor(Math.cos(angle) * distance), random.nextInt(13) - 6, Mth.floor(Math.sin(angle) * distance));
if (!level.hasChunkAt(base) || !isHordeBiome(level, base)) {
continue;
}
BlockPos candidate = findFloor(level, base);
if (candidate == null || !level.hasChunkAt(candidate) || !isHordeBiome(level, candidate)) {
continue;
}
if (candidate.distSqr(target.blockPosition()) < MIN_SPAWN_DISTANCE * MIN_SPAWN_DISTANCE) {
continue;
}
if (!level.noCollision(type.getSpawnAABB(candidate.getX() + 0.5D, candidate.getY(), candidate.getZ() + 0.5D))) {
continue;
}
if (target.hasLineOfSight(new net.minecraft.world.entity.item.ItemEntity(level, candidate.getX() + 0.5D, candidate.getY(), candidate.getZ() + 0.5D, net.minecraft.world.item.ItemStack.EMPTY))) {
continue;
}
return candidate;
}
return null;
}
@Nullable
private static BlockPos findFloor(ServerLevel level, BlockPos start) {
BlockPos.MutableBlockPos cursor = start.mutable();
for (int dy = 0; dy <= 8; dy++) {
cursor.set(start.getX(), start.getY() - dy, start.getZ());
if (isValidFloorSpawn(level, cursor)) {
return cursor.immutable();
}
cursor.set(start.getX(), start.getY() + dy, start.getZ());
if (isValidFloorSpawn(level, cursor)) {
return cursor.immutable();
}
}
return null;
}
private static boolean isValidFloorSpawn(ServerLevel level, BlockPos pos) {
BlockPos below = pos.below();
return level.getBlockState(below).isFaceSturdy(level, below, net.minecraft.core.Direction.UP)
&& level.isEmptyBlock(pos)
&& level.isEmptyBlock(pos.above());
}
private static void addCommon(List<EntityType<?>> 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<EntityType<?>> 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;
}
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));
}
@Nullable
private static EntityType<?> spitBugType() {
return BuiltInRegistries.ENTITY_TYPE.getOptional(SPIT_BUG_ID).orElse(null);
}
@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 void warnHercules(ServerLevel level, BlockPos center, List<ServerPlayer> targets) {
level.playSound(null, center, AntarchySoundEvents.HERCULES_BEETLE_CRY.get(), SoundSource.HOSTILE, 2.0F, 0.65F);
for (ServerPlayer player : targets) {
HerculesBeetleImpactShakeSync.send(player, 35);
}
}
private static boolean isPlayerInActiveEncounter(ServerLevel level, ServerPlayer player) {
HordeData data = get(level);
Encounter encounter = findNearbyEncounter(data, player.blockPosition());
return encounter != null && encounter.phase != Phase.RECOVERY;
}
@Nullable
private static Encounter findNearbyEncounter(HordeData data, BlockPos pos) {
for (Encounter encounter : data.encounters) {
if (encounter.center.distSqr(pos) <= GROUP_RADIUS_BLOCKS * GROUP_RADIUS_BLOCKS) {
return encounter;
}
}
return null;
}
private static List<ServerPlayer> targetsFor(ServerLevel level, Encounter encounter) {
List<ServerPlayer> targets = new ArrayList<>();
for (ServerPlayer player : level.players()) {
if (player.isSpectator() || !isHordeBiome(level, player.blockPosition())) {
continue;
}
if (player.blockPosition().distSqr(encounter.center) <= GROUP_RADIUS_BLOCKS * GROUP_RADIUS_BLOCKS) {
targets.add(player);
encounter.targets.add(player.getUUID());
}
}
return targets;
}
private static BlockPos averageBlockPos(List<ServerPlayer> players) {
int x = 0;
int y = 0;
int z = 0;
for (ServerPlayer player : players) {
x += player.blockPosition().getX();
y += player.blockPosition().getY();
z += player.blockPosition().getZ();
}
int count = Math.max(1, players.size());
return new BlockPos(x / count, y / count, z / count);
}
private static void fadeAttentionNear(HordeData data, BlockPos center, int amount) {
for (PlayerAttention attention : data.players.values()) {
if (BlockPos.of(attention.areaKey).distSqr(center) <= GROUP_RADIUS_BLOCKS * GROUP_RADIUS_BLOCKS) {
attention.attention = Math.max(0, attention.attention - amount);
attention.areaTicks = 0;
}
}
}
private static long areaKey(BlockPos pos) {
return BlockPos.asLong(
Math.floorDiv(pos.getX(), GROUP_RADIUS_BLOCKS) * GROUP_RADIUS_BLOCKS,
Math.floorDiv(pos.getY(), GROUP_RADIUS_BLOCKS) * GROUP_RADIUS_BLOCKS,
Math.floorDiv(pos.getZ(), GROUP_RADIUS_BLOCKS) * GROUP_RADIUS_BLOCKS
);
}
private static boolean isEggOrNest(BlockState state) {
ResourceLocation id = BuiltInRegistries.BLOCK.getKey(state.getBlock());
String path = id.getPath();
return id.getNamespace().equals(Antarchy.MODID) && (path.contains("egg") || path.contains("nest"));
}
private static HordeData get(ServerLevel level) {
return level.getDataStorage().computeIfAbsent(
new SavedData.Factory<HordeData>(HordeData::create, HordeData::load, null),
DATA_ID
);
}
private enum Phase {
AWAKENING,
SWARMING,
HERCULES,
RECOVERY
}
public static final class HordeData extends SavedData {
private static final String PLAYERS_KEY = "Players";
private static final String ENCOUNTERS_KEY = "Encounters";
private static final String AREA_SPAWN_COOLDOWNS_KEY = "AreaSpawnCooldowns";
private final Map<UUID, PlayerAttention> players = new HashMap<>();
private final List<Encounter> encounters = new ArrayList<>();
private final Map<Long, Long> areaSpawnCooldowns = new HashMap<>();
static HordeData create() {
return new HordeData();
}
static HordeData load(CompoundTag tag, HolderLookup.Provider registries) {
HordeData data = new HordeData();
for (net.minecraft.nbt.Tag rawEntry : tag.getList(PLAYERS_KEY, net.minecraft.nbt.Tag.TAG_COMPOUND)) {
CompoundTag entry = (CompoundTag) rawEntry;
data.players.put(entry.getUUID("Player"), PlayerAttention.load(entry));
}
for (net.minecraft.nbt.Tag rawEntry : tag.getList(ENCOUNTERS_KEY, net.minecraft.nbt.Tag.TAG_COMPOUND)) {
data.encounters.add(Encounter.load((CompoundTag) rawEntry));
}
for (net.minecraft.nbt.Tag rawEntry : tag.getList(AREA_SPAWN_COOLDOWNS_KEY, net.minecraft.nbt.Tag.TAG_COMPOUND)) {
CompoundTag entry = (CompoundTag) rawEntry;
data.areaSpawnCooldowns.put(entry.getLong("Area"), entry.getLong("NextSpawnTime"));
}
return data;
}
@Override
public CompoundTag save(CompoundTag tag, HolderLookup.Provider registries) {
ListTag playerList = new ListTag();
for (Map.Entry<UUID, PlayerAttention> entry : this.players.entrySet()) {
CompoundTag playerTag = entry.getValue().save();
playerTag.putUUID("Player", entry.getKey());
playerList.add(playerTag);
}
tag.put(PLAYERS_KEY, playerList);
ListTag encounterList = new ListTag();
for (Encounter encounter : this.encounters) {
encounterList.add(encounter.save());
}
tag.put(ENCOUNTERS_KEY, encounterList);
ListTag areaCooldownList = new ListTag();
for (Map.Entry<Long, Long> entry : this.areaSpawnCooldowns.entrySet()) {
CompoundTag areaTag = new CompoundTag();
areaTag.putLong("Area", entry.getKey());
areaTag.putLong("NextSpawnTime", entry.getValue());
areaCooldownList.add(areaTag);
}
tag.put(AREA_SPAWN_COOLDOWNS_KEY, areaCooldownList);
return tag;
}
private void prune(ServerLevel level, long gameTime) {
this.players.values().removeIf(attention -> attention.attention <= 0 && gameTime - attention.lastSeenGameTime > STALE_ATTENTION_PRUNE_TICKS);
this.areaSpawnCooldowns.entrySet().removeIf(entry -> gameTime - entry.getValue() > STALE_ATTENTION_PRUNE_TICKS);
for (Encounter encounter : this.encounters) {
encounter.hordeMobIds.removeIf(uuid -> {
Entity entity = level.getEntity(uuid);
return entity == null || entity.isRemoved();
});
}
this.setDirty();
}
}
private static final class PlayerAttention {
private int attention;
private int areaTicks;
private long areaKey;
private long lastSeenGameTime;
private void add(int amount) {
this.attention = Mth.clamp(this.attention + amount, 0, ATTENTION_THRESHOLD);
}
private void fade(int amount) {
this.attention = Math.max(0, this.attention - amount);
this.areaTicks = Math.max(0, this.areaTicks - PLAYER_CHECK_INTERVAL);
}
private CompoundTag save() {
CompoundTag tag = new CompoundTag();
tag.putInt("Attention", this.attention);
tag.putInt("AreaTicks", this.areaTicks);
tag.putLong("AreaKey", this.areaKey);
tag.putLong("LastSeenGameTime", this.lastSeenGameTime);
return tag;
}
private static PlayerAttention load(CompoundTag tag) {
PlayerAttention attention = new PlayerAttention();
attention.attention = tag.getInt("Attention");
attention.areaTicks = tag.getInt("AreaTicks");
attention.areaKey = tag.getLong("AreaKey");
attention.lastSeenGameTime = tag.getLong("LastSeenGameTime");
return attention;
}
}
private static final class Encounter {
private UUID id = UUID.randomUUID();
private Phase phase = Phase.AWAKENING;
private BlockPos center = BlockPos.ZERO;
private int wave;
private long startedAt;
private long nextPulseTime;
private long recoveryEndsAt;
private long abandonedSince;
private long herculesTimeoutAt;
private long nextSkirmishTime;
private final Set<UUID> targets = new HashSet<>();
private final Set<UUID> hordeMobIds = new HashSet<>();
private final Set<UUID> herculesIds = new HashSet<>();
private float intensity(long gameTime) {
return switch (this.phase) {
case AWAKENING -> Mth.clamp((gameTime - this.startedAt) / (float) AWAKENING_TICKS, 0.25F, 1.0F);
case SWARMING, HERCULES -> 1.0F;
case RECOVERY -> Mth.clamp((this.recoveryEndsAt - gameTime) / (float) RECOVERY_TICKS, 0.0F, 0.75F);
};
}
private CompoundTag save() {
CompoundTag tag = new CompoundTag();
tag.putUUID("Id", this.id);
tag.putString("Phase", this.phase.name());
tag.putLong("Center", this.center.asLong());
tag.putInt("Wave", this.wave);
tag.putLong("StartedAt", this.startedAt);
tag.putLong("NextPulseTime", this.nextPulseTime);
tag.putLong("RecoveryEndsAt", this.recoveryEndsAt);
tag.putLong("AbandonedSince", this.abandonedSince);
tag.putLong("HerculesTimeoutAt", this.herculesTimeoutAt);
tag.putLong("NextSkirmishTime", this.nextSkirmishTime);
tag.put("Targets", uuidList(this.targets));
tag.put("HordeMobs", uuidList(this.hordeMobIds));
tag.put("Hercules", uuidList(this.herculesIds));
return tag;
}
private static Encounter load(CompoundTag tag) {
Encounter encounter = new Encounter();
encounter.id = tag.getUUID("Id");
encounter.phase = Phase.valueOf(tag.getString("Phase"));
encounter.center = BlockPos.of(tag.getLong("Center"));
encounter.wave = tag.getInt("Wave");
encounter.startedAt = tag.getLong("StartedAt");
encounter.nextPulseTime = tag.getLong("NextPulseTime");
encounter.recoveryEndsAt = tag.getLong("RecoveryEndsAt");
encounter.abandonedSince = tag.getLong("AbandonedSince");
encounter.herculesTimeoutAt = tag.getLong("HerculesTimeoutAt");
encounter.nextSkirmishTime = tag.getLong("NextSkirmishTime");
readUuidList(tag.getList("Targets", net.minecraft.nbt.Tag.TAG_COMPOUND), encounter.targets);
readUuidList(tag.getList("HordeMobs", net.minecraft.nbt.Tag.TAG_COMPOUND), encounter.hordeMobIds);
readUuidList(tag.getList("Hercules", net.minecraft.nbt.Tag.TAG_COMPOUND), encounter.herculesIds);
return encounter;
}
private static ListTag uuidList(Set<UUID> uuids) {
ListTag list = new ListTag();
for (UUID uuid : uuids) {
CompoundTag tag = new CompoundTag();
tag.putUUID("Id", uuid);
list.add(tag);
}
return list;
}
private static void readUuidList(ListTag list, Set<UUID> uuids) {
for (net.minecraft.nbt.Tag rawEntry : list) {
uuids.add(((CompoundTag) rawEntry).getUUID("Id"));
}
}
}
}
@@ -1,6 +1,8 @@
package com.craisinlord.antarchy.content.item;
import com.craisinlord.antarchy.config.AntarchySettings;
import com.craisinlord.antarchy.content.gravity.AntarchyGravityDirection;
import com.craisinlord.antarchy.content.gravity.AntarchyGravityRotationUtil;
import com.craisinlord.antarchy.content.network.ImpactShakePayload;
import com.craisinlord.antarchy.content.network.ImpactShakeSync;
import java.util.HashMap;
@@ -103,8 +105,10 @@ public final class AttitudeAdjusterSlamManager {
return false;
}
PLAYER_SLAMS.put(player.getUUID(), new PlayerSlamState(player.getUUID(), player.serverLevel().dimension().location().toString(), player.serverLevel().getGameTime() + SLAM_TIMEOUT_TICKS, player.fallDistance));
AntarchyGravityDirection gravityDirection = AntarchyGravityRotationUtil.getGravityDownDirection(player) == Direction.UP ? AntarchyGravityDirection.UP : AntarchyGravityDirection.DOWN;
Vec3 motion = player.getDeltaMovement();
player.setDeltaMovement(motion.x * 0.25D, PLAYER_SLAM_START_VELOCITY, motion.z * 0.25D);
Vec3 localMotion = AntarchyGravityRotationUtil.vecWorldToPlayer(motion, gravityDirection);
player.setDeltaMovement(AntarchyGravityRotationUtil.vecPlayerToWorld(new Vec3(localMotion.x * 0.25D, PLAYER_SLAM_START_VELOCITY, localMotion.z * 0.25D), gravityDirection));
player.hurtMarked = true;
player.fallDistance = 0.0F;
player.swing(hand, true);
@@ -164,23 +168,31 @@ public final class AttitudeAdjusterSlamManager {
if (!player.onGround()) {
continue;
}
Direction gravityDown = AntarchyGravityRotationUtil.getGravityDownDirection(player);
Vec3 impactPos = player.position();
BlockPos groundPos = player.getOnPosLegacy();
double impactStrength = Math.max(Math.abs(Math.min(player.getDeltaMovement().y, PLAYER_SLAM_START_VELOCITY)), Math.max(state.startFallDistance, player.fallDistance) * 0.15D);
BlockPos groundPos = getSlamSurfacePos(player, gravityDown);
double localVerticalSpeed = AntarchyGravityRotationUtil.vecWorldToPlayer(player.getDeltaMovement(), gravityDown == Direction.UP ? AntarchyGravityDirection.UP : AntarchyGravityDirection.DOWN).y;
double impactStrength = Math.max(Math.abs(Math.min(localVerticalSpeed, PLAYER_SLAM_START_VELOCITY)), Math.max(state.startFallDistance, player.fallDistance) * 0.15D);
float damage = (float) Mth.clamp(PLAYER_SLAM_BASE_DAMAGE + impactStrength * PLAYER_SLAM_DAMAGE_SCALE * 10.0D, PLAYER_SLAM_BASE_DAMAGE, PLAYER_SLAM_MAX_DAMAGE);
AABB area = new AABB(impactPos.x - PLAYER_SLAM_RADIUS, impactPos.y - 1.5D, impactPos.z - PLAYER_SLAM_RADIUS, impactPos.x + PLAYER_SLAM_RADIUS, impactPos.y + 2.5D, impactPos.z + PLAYER_SLAM_RADIUS);
Vec3 awayFromSurface = new Vec3(-gravityDown.getStepX(), -gravityDown.getStepY(), -gravityDown.getStepZ());
for (LivingEntity target : level.getEntitiesOfClass(LivingEntity.class, area, candidate -> candidate.isAlive() && candidate != player)) {
if (!target.hurt(level.damageSources().playerAttack(player), damage)) {
continue;
}
Vec3 away = horizontalAway(impactPos, target.position(), player.getLookAngle()).scale(PLAYER_SLAM_HORIZONTAL_KNOCKBACK);
double resistanceScale = resistanceScale(target);
target.setDeltaMovement(target.getDeltaMovement().add(away.x * resistanceScale, Math.max(PLAYER_SLAM_UPWARD_KNOCKBACK * resistanceScale, 0.35D), away.z * resistanceScale));
double surfaceKnockback = Math.max(PLAYER_SLAM_UPWARD_KNOCKBACK * resistanceScale, 0.35D);
target.setDeltaMovement(target.getDeltaMovement().add(
away.x * resistanceScale + awayFromSurface.x * surfaceKnockback,
away.y * resistanceScale + awayFromSurface.y * surfaceKnockback,
away.z * resistanceScale + awayFromSurface.z * surfaceKnockback
));
target.hurtMarked = true;
}
playSlamImpact(level, impactPos, groundPos, false);
if (AntarchySettings.attitudeAdjusterBreaksBlocks()) {
breakBlocks(level, player, groundPos);
breakBlocks(level, player, groundPos, gravityDown);
}
if (player.getMainHandItem().getItem() instanceof AttitudeAdjusterItem item) {
player.getCooldowns().addCooldown(item, PLAYER_SLAM_COOLDOWN_TICKS);
@@ -189,9 +201,19 @@ public final class AttitudeAdjusterSlamManager {
}
}
private static void breakBlocks(ServerLevel level, ServerPlayer player, BlockPos center) {
private static BlockPos getSlamSurfacePos(Entity entity, Direction gravityDown) {
if (gravityDown == Direction.UP) {
return BlockPos.containing(entity.getX(), entity.getBoundingBox().maxY + 0.05D, entity.getZ());
}
return entity.getOnPosLegacy();
}
private static void breakBlocks(ServerLevel level, ServerPlayer player, BlockPos center, Direction gravityDown) {
int broken = 0;
for (int y = -1; y <= 0 && broken < MAX_BROKEN_BLOCKS; y++) {
int minY = gravityDown == Direction.UP ? 0 : -1;
int maxY = gravityDown == Direction.UP ? 1 : 0;
Direction supportFace = gravityDown.getOpposite();
for (int y = minY; y <= maxY && broken < MAX_BROKEN_BLOCKS; y++) {
for (int x = -1; x <= 1 && broken < MAX_BROKEN_BLOCKS; x++) {
for (int z = -1; z <= 1 && broken < MAX_BROKEN_BLOCKS; z++) {
BlockPos pos = center.offset(x, y, z);
@@ -200,7 +222,7 @@ public final class AttitudeAdjusterSlamManager {
if (state.isAir() || blockEntity != null || state.getDestroySpeed(level, pos) < 0.0F || state.getDestroySpeed(level, pos) > NORMAL_BREAK_HARDNESS_LIMIT) {
continue;
}
if (!state.isFaceSturdy(level, pos, Direction.UP) && pos.getY() < center.getY()) {
if (!state.isFaceSturdy(level, pos, supportFace) && pos.getY() != center.getY()) {
continue;
}
if (player.gameMode.destroyBlock(pos)) {
@@ -0,0 +1,20 @@
package com.craisinlord.antarchy.content.network;
import com.craisinlord.antarchy.Antarchy;
import io.netty.buffer.ByteBuf;
import net.minecraft.network.codec.ByteBufCodecs;
import net.minecraft.network.codec.StreamCodec;
import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
import net.minecraft.resources.ResourceLocation;
public record HordeIntensityPayload(float intensity) implements CustomPacketPayload {
public static final Type<HordeIntensityPayload> TYPE =
new Type<>(ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "horde_intensity"));
public static final StreamCodec<ByteBuf, HordeIntensityPayload> STREAM_CODEC =
ByteBufCodecs.FLOAT.map(HordeIntensityPayload::new, HordeIntensityPayload::intensity);
@Override
public Type<HordeIntensityPayload> type() {
return TYPE;
}
}
@@ -0,0 +1,22 @@
package com.craisinlord.antarchy.content.network;
import java.util.function.BiConsumer;
import net.minecraft.server.level.ServerPlayer;
public final class HordeIntensitySync {
private static final BiConsumer<ServerPlayer, HordeIntensityPayload> NOOP = (player, payload) -> {
};
private static volatile BiConsumer<ServerPlayer, HordeIntensityPayload> sink = NOOP;
private HordeIntensitySync() {
}
public static void setSink(BiConsumer<ServerPlayer, HordeIntensityPayload> sink) {
HordeIntensitySync.sink = sink == null ? NOOP : sink;
}
public static void send(ServerPlayer player, float intensity) {
sink.accept(player, new HordeIntensityPayload(intensity));
}
}
@@ -0,0 +1,90 @@
package com.craisinlord.antarchy.content.worldgen.cavaryn;
import com.craisinlord.antarchy.Antarchy;
import com.craisinlord.antarchy.content.block.SpitBugEggBlock;
import com.mojang.serialization.Codec;
import java.util.Optional;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.RandomSource;
import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.feature.Feature;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
public final class SpitBugEggPatchFeature extends Feature<NoneFeatureConfiguration> {
private static final ResourceLocation SPIT_BUG_EGG_ID = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "spit_bug_egg");
private static final int SEARCH_RADIUS = 7;
private static final int VERTICAL_SCAN = 18;
private static final int SEARCH_ATTEMPTS = 32;
private static final int MIN_PLACEMENTS = 2;
private static final int MAX_PLACEMENTS = 5;
public SpitBugEggPatchFeature(Codec<NoneFeatureConfiguration> codec) {
super(codec);
}
@Override
public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> context) {
Block eggBlock = getBlock(SPIT_BUG_EGG_ID);
if (eggBlock == null) {
return false;
}
WorldGenLevel level = context.level();
RandomSource random = context.random();
BlockPos origin = context.origin();
boolean placedAny = false;
int placements = 0;
int targetPlacements = MIN_PLACEMENTS + random.nextInt(MAX_PLACEMENTS - MIN_PLACEMENTS + 1);
BlockPos.MutableBlockPos mutable = new BlockPos.MutableBlockPos();
for (int attempt = 0; attempt < SEARCH_ATTEMPTS && placements < targetPlacements; attempt++) {
int x = origin.getX() + random.nextInt(SEARCH_RADIUS * 2 + 1) - SEARCH_RADIUS;
int z = origin.getZ() + random.nextInt(SEARCH_RADIUS * 2 + 1) - SEARCH_RADIUS;
int startY = origin.getY() + random.nextInt(VERTICAL_SCAN * 2 + 1) - VERTICAL_SCAN;
int minY = Math.max(level.getMinBuildHeight() + 1, startY - VERTICAL_SCAN);
int maxY = Math.min(level.getMaxBuildHeight() - 1, startY + VERTICAL_SCAN);
BlockPos spot = null;
for (int y = minY; y <= maxY; y++) {
mutable.set(x, y, z);
if (isValidFloorSpot(level, mutable)) {
spot = mutable.immutable();
break;
}
}
if (spot == null) {
continue;
}
BlockState eggState = eggBlock.defaultBlockState()
.setValue(SpitBugEggBlock.ROTATED, random.nextBoolean());
level.setBlock(spot, eggState, 3);
placedAny = true;
placements++;
}
return placedAny;
}
private static boolean isValidFloorSpot(WorldGenLevel level, BlockPos pos) {
BlockState state = level.getBlockState(pos);
if (!state.isAir()) {
return false;
}
BlockPos belowPos = pos.below();
BlockState belowState = level.getBlockState(belowPos);
return belowState.isFaceSturdy(level, belowPos, Direction.UP);
}
private static Block getBlock(ResourceLocation id) {
Optional<Block> block = BuiltInRegistries.BLOCK.getOptional(id);
return block.orElse(null);
}
}
@@ -0,0 +1,32 @@
package com.craisinlord.antarchy.mixins;
import com.craisinlord.antarchy.content.GoopedEffectHooks;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Holder;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.world.effect.MobEffect;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.level.block.state.BlockState;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(Entity.class)
public abstract class GoopedStepSoundMixin {
@Inject(method = "playStepSound", at = @At("HEAD"), cancellable = true)
private void antarchy$goopedStepSound(BlockPos pos, BlockState state, CallbackInfo ci) {
if (!((Object) this instanceof LivingEntity livingEntity)) {
return;
}
Holder<MobEffect> gooped = GoopedEffectHooks.holder();
if (gooped == null || !livingEntity.hasEffect(gooped)) {
return;
}
livingEntity.playSound(SoundEvents.SLIME_BLOCK_STEP, 0.15F, 1.0F);
ci.cancel();
}
}
@@ -0,0 +1,35 @@
package com.craisinlord.antarchy.mixins;
import com.craisinlord.antarchy.content.AntarchyObjects;
import com.craisinlord.antarchy.content.AntarchySoundEvents;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.sounds.SoundSource;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.player.Player;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(Entity.class)
public abstract class StinkyCrouchMixin {
@Inject(method = "setShiftKeyDown", at = @At("HEAD"))
private void antarchy$playStinkyCrouchSound(boolean crouching, CallbackInfo ci) {
Entity entity = (Entity) (Object) this;
if (!crouching || entity.isShiftKeyDown() || !(entity instanceof Player player) || player.isSpectator()
|| !(player.level() instanceof ServerLevel level) || !player.hasEffect(AntarchyObjects.STINKY_EFFECT.get())) {
return;
}
level.playSound(
null,
player.getX(),
player.getY(),
player.getZ(),
AntarchySoundEvents.STINK_BUG_FART.get(),
SoundSource.PLAYERS,
0.85F,
0.9F + level.random.nextFloat() * 0.2F
);
}
}
@@ -0,0 +1,39 @@
package com.craisinlord.antarchy.mixins.client;
import com.craisinlord.antarchy.content.client.HordeClientState;
import com.mojang.blaze3d.shaders.FogShape;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.Camera;
import net.minecraft.client.renderer.FogRenderer;
import net.minecraft.util.Mth;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.core.registries.Registries;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.material.FogType;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(FogRenderer.class)
public abstract class CavarynHordeFogMixin {
private static final ResourceKey<Level> CAVARYN = ResourceKey.create(
Registries.DIMENSION,
ResourceLocation.fromNamespaceAndPath("antarchy", "cavaryn")
);
@Inject(method = "setupFog", at = @At("TAIL"))
private static void antarchy$hordeFogDistance(Camera camera, FogRenderer.FogMode mode, float renderDistance, boolean thickFog, float partialTick, CallbackInfo ci) {
float intensity = HordeClientState.intensity();
if (intensity <= 0.01F || camera.getEntity() == null || !camera.getEntity().level().dimension().equals(CAVARYN) || camera.getFluidInCamera() != FogType.NONE) {
return;
}
float fogStart = Mth.lerp(intensity, Math.min(renderDistance * 0.55F, 48.0F), 3.5F);
float fogEnd = Mth.lerp(intensity, Math.min(renderDistance, 128.0F), 36.0F);
RenderSystem.setShaderFogStart(Math.min(fogStart, fogEnd * 0.65F));
RenderSystem.setShaderFogEnd(fogEnd);
RenderSystem.setShaderFogShape(FogShape.SPHERE);
}
}
@@ -0,0 +1,37 @@
package com.craisinlord.antarchy.mixins.client;
import com.craisinlord.antarchy.Antarchy;
import com.craisinlord.antarchy.content.client.HordeClientState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.LightTexture;
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.level.dimension.DimensionType;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(LightTexture.class)
public abstract class CavarynHordeLightTextureMixin {
private static final ResourceKey<Level> CAVARYN = ResourceKey.create(
Registries.DIMENSION,
ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "cavaryn")
);
@Inject(method = "getBrightness", at = @At("RETURN"), cancellable = true)
private static void antarchy$hordeAmbientBrightness(DimensionType dimensionType, int lightLevel, CallbackInfoReturnable<Float> cir) {
Minecraft minecraft = Minecraft.getInstance();
float intensity = HordeClientState.intensity();
if (intensity <= 0.01F || minecraft.level == null || !minecraft.level.dimension().equals(CAVARYN)) {
return;
}
float original = cir.getReturnValue();
float hordeAmbient = 0.015F + 0.55F * intensity;
cir.setReturnValue(Mth.clamp(original + hordeAmbient * (1.0F - original), 0.0F, 1.0F));
}
}
@@ -19,9 +19,11 @@
"FrogVariantBootstrapMixin",
"GlowSquidLumenSpawnMixin",
"GlowVinesUnderLeavesMixin",
"GoopedStepSoundMixin",
"ExperimentalSettingsLevelSummaryMixin",
"NightmareSwordDamageMixin",
"PotionBrewingMixin",
"StinkyCrouchMixin",
"VillagerTradesMixin",
"WaterlilyLumenMixin",
"ServerPlayerGameModeMixin",
@@ -60,6 +62,8 @@
],
"client": [
"client.CavarynSkyMixin",
"client.CavarynHordeFogMixin",
"client.CavarynHordeLightTextureMixin",
"client.ElythiaSkyMixin",
"client.ElytraModelAccessor",
"client.FrogRendererElythiaMixin",
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,169 @@
{
"format_version": "1.8.0",
"animations": {
"idle": {
"loop": true,
"animation_length": 1,
"bones": {
"body": {
"scale": {
"0.0": {
"vector": [1, 1, 1]
},
"0.0417": {
"vector": [1.0023, 0.9977, 1.0023]
},
"0.0833": {
"vector": [1.005, 0.995, 1.005]
},
"0.125": {
"vector": [1.008, 0.992, 1.008]
},
"0.1667": {
"vector": [1.0111, 0.9889, 1.0111]
},
"0.2083": {
"vector": [1.0142, 0.9858, 1.0142]
},
"0.25": {
"vector": [1.0172, 0.9828, 1.0172]
},
"0.2917": {
"vector": [1.0199, 0.9801, 1.0199]
},
"0.3333": {
"vector": [1.0222, 0.9778, 1.0222]
},
"0.375": {
"vector": [1.024, 0.976, 1.024]
},
"0.4167": {
"vector": [1.0252, 0.9748, 1.0252]
},
"0.4583": {
"vector": [1.0255, 0.9745, 1.0255]
},
"0.5": {
"vector": [1.025, 0.975, 1.025]
},
"0.5417": {
"vector": [1.0201, 0.9799, 1.0201]
},
"0.5833": {
"vector": [1.0111, 0.9889, 1.0111]
},
"0.625": {
"vector": [1, 1, 1]
},
"0.6667": {
"vector": [0.9889, 1.0111, 0.9889]
},
"0.7083": {
"vector": [0.9799, 1.0201, 0.9799]
},
"0.75": {
"vector": [0.975, 1.025, 0.975]
},
"0.7917": {
"vector": [0.9748, 1.0252, 0.9748]
},
"0.8333": {
"vector": [0.9778, 1.0222, 0.9778]
},
"0.875": {
"vector": [0.9828, 1.0172, 0.9828]
},
"0.9167": {
"vector": [0.9889, 1.0111, 0.9889]
},
"0.9583": {
"vector": [0.995, 1.005, 0.995]
},
"1.0": {
"vector": [1, 1, 1]
}
}
},
"gel": {
"scale": {
"0.0": {
"vector": [0.975, 1.025, 0.975]
},
"0.0417": {
"vector": [0.9748, 1.0252, 0.9748]
},
"0.0833": {
"vector": [0.9778, 1.0222, 0.9778]
},
"0.125": {
"vector": [0.9828, 1.0172, 0.9828]
},
"0.1667": {
"vector": [0.9889, 1.0111, 0.9889]
},
"0.2083": {
"vector": [0.995, 1.005, 0.995]
},
"0.25": {
"vector": [1, 1, 1]
},
"0.2917": {
"vector": [1.0023, 0.9977, 1.0023]
},
"0.3333": {
"vector": [1.005, 0.995, 1.005]
},
"0.375": {
"vector": [1.008, 0.992, 1.008]
},
"0.4167": {
"vector": [1.0111, 0.9889, 1.0111]
},
"0.4583": {
"vector": [1.0142, 0.9858, 1.0142]
},
"0.5": {
"vector": [1.0172, 0.9828, 1.0172]
},
"0.5417": {
"vector": [1.0199, 0.9801, 1.0199]
},
"0.5833": {
"vector": [1.0222, 0.9778, 1.0222]
},
"0.625": {
"vector": [1.024, 0.976, 1.024]
},
"0.6667": {
"vector": [1.0252, 0.9748, 1.0252]
},
"0.7083": {
"vector": [1.0255, 0.9745, 1.0255]
},
"0.75": {
"vector": [1.025, 0.975, 1.025]
},
"0.7917": {
"vector": [1.0201, 0.9799, 1.0201]
},
"0.8333": {
"vector": [1.0111, 0.9889, 1.0111]
},
"0.875": {
"vector": [1, 1, 1]
},
"0.9167": {
"vector": [0.9889, 1.0111, 0.9889]
},
"0.9583": {
"vector": [0.9799, 1.0201, 0.9799]
},
"1.0": {
"vector": [0.975, 1.025, 0.975]
}
}
}
}
}
}
}
@@ -0,0 +1,485 @@
{
"format_version": "1.8.0",
"animations": {
"idle": {
"loop": true,
"animation_length": 1,
"bones": {
"gel": {
"scale": {
"0.0": {
"vector": [0.975, 1.025, 0.975]
},
"0.0417": {
"vector": [0.9748, 1.0252, 0.9748]
},
"0.0833": {
"vector": [0.9778, 1.0222, 0.9778]
},
"0.125": {
"vector": [0.9828, 1.0172, 0.9828]
},
"0.1667": {
"vector": [0.9889, 1.0111, 0.9889]
},
"0.2083": {
"vector": [0.995, 1.005, 0.995]
},
"0.25": {
"vector": [1, 1, 1]
},
"0.2917": {
"vector": [1.0023, 0.9977, 1.0023]
},
"0.3333": {
"vector": [1.005, 0.995, 1.005]
},
"0.375": {
"vector": [1.008, 0.992, 1.008]
},
"0.4167": {
"vector": [1.0111, 0.9889, 1.0111]
},
"0.4583": {
"vector": [1.0142, 0.9858, 1.0142]
},
"0.5": {
"vector": [1.0172, 0.9828, 1.0172]
},
"0.5417": {
"vector": [1.0199, 0.9801, 1.0199]
},
"0.5833": {
"vector": [1.0222, 0.9778, 1.0222]
},
"0.625": {
"vector": [1.024, 0.976, 1.024]
},
"0.6667": {
"vector": [1.0252, 0.9748, 1.0252]
},
"0.7083": {
"vector": [1.0255, 0.9745, 1.0255]
},
"0.75": {
"vector": [1.025, 0.975, 1.025]
},
"0.7917": {
"vector": [1.0201, 0.9799, 1.0201]
},
"0.8333": {
"vector": [1.0111, 0.9889, 1.0111]
},
"0.875": {
"vector": [1, 1, 1]
},
"0.9167": {
"vector": [0.9889, 1.0111, 0.9889]
},
"0.9583": {
"vector": [0.9799, 1.0201, 0.9799]
},
"1.0": {
"vector": [0.975, 1.025, 0.975]
}
}
},
"body": {
"scale": {
"0.0": {
"vector": [1, 1, 1]
},
"0.0417": {
"vector": [1.0023, 0.9977, 1.0023]
},
"0.0833": {
"vector": [1.005, 0.995, 1.005]
},
"0.125": {
"vector": [1.008, 0.992, 1.008]
},
"0.1667": {
"vector": [1.0111, 0.9889, 1.0111]
},
"0.2083": {
"vector": [1.0142, 0.9858, 1.0142]
},
"0.25": {
"vector": [1.0172, 0.9828, 1.0172]
},
"0.2917": {
"vector": [1.0199, 0.9801, 1.0199]
},
"0.3333": {
"vector": [1.0222, 0.9778, 1.0222]
},
"0.375": {
"vector": [1.024, 0.976, 1.024]
},
"0.4167": {
"vector": [1.0252, 0.9748, 1.0252]
},
"0.4583": {
"vector": [1.0255, 0.9745, 1.0255]
},
"0.5": {
"vector": [1.025, 0.975, 1.025]
},
"0.5417": {
"vector": [1.0201, 0.9799, 1.0201]
},
"0.5833": {
"vector": [1.0111, 0.9889, 1.0111]
},
"0.625": {
"vector": [1, 1, 1]
},
"0.6667": {
"vector": [0.9889, 1.0111, 0.9889]
},
"0.7083": {
"vector": [0.9799, 1.0201, 0.9799]
},
"0.75": {
"vector": [0.975, 1.025, 0.975]
},
"0.7917": {
"vector": [0.9748, 1.0252, 0.9748]
},
"0.8333": {
"vector": [0.9778, 1.0222, 0.9778]
},
"0.875": {
"vector": [0.9828, 1.0172, 0.9828]
},
"0.9167": {
"vector": [0.9889, 1.0111, 0.9889]
},
"0.9583": {
"vector": [0.995, 1.005, 0.995]
},
"1.0": {
"vector": [1, 1, 1]
}
}
},
"rightTooth": {
"rotation": {
"0.0": {
"vector": [0, 0, 25]
},
"0.0417": {
"vector": [0, 0, 24.7]
},
"0.0833": {
"vector": [0, 0, 23.89]
},
"0.125": {
"vector": [0, 0, 22.66]
},
"0.1667": {
"vector": [0, 0, 21.11]
},
"0.2083": {
"vector": [0, 0, 19.36]
},
"0.25": {
"vector": [0, 0, 17.5]
},
"0.2917": {
"vector": [0, 0, 15.64]
},
"0.3333": {
"vector": [0, 0, 13.89]
},
"0.375": {
"vector": [0, 0, 12.34]
},
"0.4167": {
"vector": [0, 0, 11.11]
},
"0.4583": {
"vector": [0, 0, 10.3]
},
"0.5": {
"vector": [0, 0, 10]
},
"0.5417": {
"vector": [0, 0, 10.3]
},
"0.5833": {
"vector": [0, 0, 11.11]
},
"0.625": {
"vector": [0, 0, 12.34]
},
"0.6667": {
"vector": [0, 0, 13.89]
},
"0.7083": {
"vector": [0, 0, 15.64]
},
"0.75": {
"vector": [0, 0, 17.5]
},
"0.7917": {
"vector": [0, 0, 19.36]
},
"0.8333": {
"vector": [0, 0, 21.11]
},
"0.875": {
"vector": [0, 0, 22.66]
},
"0.9167": {
"vector": [0, 0, 23.89]
},
"0.9583": {
"vector": [0, 0, 24.7]
},
"1.0": {
"vector": [0, 0, 25]
}
}
},
"rightArm": {
"rotation": {
"0.0": {
"vector": [-25, 0, 0]
},
"0.0417": {
"vector": [-24.58, 0.88, 2.83]
},
"0.0833": {
"vector": [-23.47, 1.86, 5.97]
},
"0.125": {
"vector": [-21.91, 2.82, 9.07]
},
"0.1667": {
"vector": [-20.14, 3.66, 11.75]
},
"0.2083": {
"vector": [-18.4, 4.24, 13.63]
},
"0.25": {
"vector": [-16.94, 4.46, 14.34]
},
"0.2917": {
"vector": [-15.56, 4.24, 13.63]
},
"0.3333": {
"vector": [-14.03, 3.66, 11.75]
},
"0.375": {
"vector": [-12.54, 2.82, 9.07]
},
"0.4167": {
"vector": [-11.25, 1.86, 5.97]
},
"0.4583": {
"vector": [-10.34, 0.88, 2.83]
},
"0.5": {
"vector": [-10, 0, 0]
},
"0.5417": {
"vector": [-10.33, -0.92, -2.96]
},
"0.5833": {
"vector": [-11.22, -2, -6.44]
},
"0.625": {
"vector": [-12.49, -3.1, -9.97]
},
"0.6667": {
"vector": [-13.97, -4.07, -13.08]
},
"0.7083": {
"vector": [-15.49, -4.76, -15.29]
},
"0.75": {
"vector": [-16.87, -5.02, -16.13]
},
"0.7917": {
"vector": [-18.34, -4.76, -15.29]
},
"0.8333": {
"vector": [-20.08, -4.07, -13.08]
},
"0.875": {
"vector": [-21.87, -3.1, -9.97]
},
"0.9167": {
"vector": [-23.44, -2, -6.44]
},
"0.9583": {
"vector": [-24.57, -0.92, -2.96]
},
"1.0": {
"vector": [-25, 0, 0]
}
}
},
"leftTooth": {
"rotation": {
"0.0": {
"vector": [0, 0, -25]
},
"0.0417": {
"vector": [0, 0, -24.7]
},
"0.0833": {
"vector": [0, 0, -23.89]
},
"0.125": {
"vector": [0, 0, -22.66]
},
"0.1667": {
"vector": [0, 0, -21.11]
},
"0.2083": {
"vector": [0, 0, -19.36]
},
"0.25": {
"vector": [0, 0, -17.5]
},
"0.2917": {
"vector": [0, 0, -15.64]
},
"0.3333": {
"vector": [0, 0, -13.89]
},
"0.375": {
"vector": [0, 0, -12.34]
},
"0.4167": {
"vector": [0, 0, -11.11]
},
"0.4583": {
"vector": [0, 0, -10.3]
},
"0.5": {
"vector": [0, 0, -10]
},
"0.5417": {
"vector": [0, 0, -10.3]
},
"0.5833": {
"vector": [0, 0, -11.11]
},
"0.625": {
"vector": [0, 0, -12.34]
},
"0.6667": {
"vector": [0, 0, -13.89]
},
"0.7083": {
"vector": [0, 0, -15.64]
},
"0.75": {
"vector": [0, 0, -17.5]
},
"0.7917": {
"vector": [0, 0, -19.36]
},
"0.8333": {
"vector": [0, 0, -21.11]
},
"0.875": {
"vector": [0, 0, -22.66]
},
"0.9167": {
"vector": [0, 0, -23.89]
},
"0.9583": {
"vector": [0, 0, -24.7]
},
"1.0": {
"vector": [0, 0, -25]
}
}
},
"leftArm": {
"rotation": {
"0.0": {
"vector": [-25, 0, 0]
},
"0.0417": {
"vector": [-24.58, -0.88, -2.83]
},
"0.0833": {
"vector": [-23.47, -1.86, -5.97]
},
"0.125": {
"vector": [-21.91, -2.82, -9.07]
},
"0.1667": {
"vector": [-20.14, -3.66, -11.75]
},
"0.2083": {
"vector": [-18.4, -4.24, -13.63]
},
"0.25": {
"vector": [-16.94, -4.46, -14.33]
},
"0.2917": {
"vector": [-15.56, -4.24, -13.63]
},
"0.3333": {
"vector": [-14.03, -3.66, -11.75]
},
"0.375": {
"vector": [-12.54, -2.82, -9.07]
},
"0.4167": {
"vector": [-11.25, -1.86, -5.97]
},
"0.4583": {
"vector": [-10.34, -0.88, -2.83]
},
"0.5": {
"vector": [-10, 0, 0]
},
"0.5417": {
"vector": [-10.33, 0.92, 2.96]
},
"0.5833": {
"vector": [-11.22, 2, 6.44]
},
"0.625": {
"vector": [-12.49, 3.1, 9.97]
},
"0.6667": {
"vector": [-13.97, 4.07, 13.08]
},
"0.7083": {
"vector": [-15.49, 4.76, 15.29]
},
"0.75": {
"vector": [-16.87, 5.02, 16.13]
},
"0.7917": {
"vector": [-18.34, 4.76, 15.29]
},
"0.8333": {
"vector": [-20.08, 4.07, 13.08]
},
"0.875": {
"vector": [-21.87, 3.1, 9.97]
},
"0.9167": {
"vector": [-23.44, 2, 6.44]
},
"0.9583": {
"vector": [-24.57, 0.92, 2.96]
},
"1.0": {
"vector": [-25, 0, 0]
}
}
}
}
}
}
}
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "antarchy:block/biomite"
}
}
}
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "antarchy:block/biomite_turf"
}
}
}
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "antarchy:block/biowart"
}
}
}
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "antarchy:block/biowart_tendrils"
}
}
}
@@ -0,0 +1,11 @@
{
"variants": {
"rotated=false": {
"model": "antarchy:block/metroid_egg"
},
"rotated=true": {
"model": "antarchy:block/metroid_egg",
"y": 90
}
}
}
@@ -0,0 +1,25 @@
{
"variants": {
"hatch=0,rotated=false": {
"model": "antarchy:block/spit_bug_egg"
},
"hatch=0,rotated=true": {
"model": "antarchy:block/spit_bug_egg",
"y": 90
},
"hatch=1,rotated=false": {
"model": "antarchy:block/spit_bug_egg"
},
"hatch=1,rotated=true": {
"model": "antarchy:block/spit_bug_egg",
"y": 90
},
"hatch=2,rotated=false": {
"model": "antarchy:block/spit_bug_egg"
},
"hatch=2,rotated=true": {
"model": "antarchy:block/spit_bug_egg",
"y": 90
}
}
}
@@ -0,0 +1,166 @@
{
"format_version": "1.12.0",
"minecraft:geometry": [
{
"description": {
"identifier": "geometry.alphametroid",
"texture_width": 128,
"texture_height": 128,
"visible_bounds_width": 4,
"visible_bounds_height": 3.5,
"visible_bounds_offset": [0, 1.25, 0]
},
"bones": [
{
"name": "root",
"pivot": [0, 0, 0]
},
{
"name": "body",
"parent": "root",
"pivot": [0, 0, 0],
"cubes": [
{"origin": [-8, 0, -8], "size": [16, 16, 16], "uv": [0, 0]},
{"origin": [-4, 4, -4], "size": [8, 8, 8], "uv": [92, 110]},
{"origin": [0, 0, -8], "size": [0, 16, 16], "uv": [0, 96]},
{"origin": [-8, 0, 0], "size": [16, 16, 0], "uv": [0, 112]},
{"origin": [-8, 8, -8], "size": [16, 0, 16], "uv": [-16, 112]},
{"origin": [-8.5, 10, -8.5], "size": [17, 10, 17], "uv": [0, 32]},
{"origin": [-6.5, 10, 2.5], "size": [13, 6, 8], "pivot": [0, 10, 8.5], "rotation": [-45, 0, 0], "uv": [0, 59]},
{"origin": [-4.5, 10, -12.5], "size": [9, 7, 4], "uv": [64, 0]},
{"origin": [-4.5, 10, -12.5], "size": [9, 7, 0], "inflate": 0.25, "uv": [92, 19]},
{"origin": [-4.5, 10, -12.5], "size": [9, 7, 0], "inflate": 0.5, "uv": [89, 49]},
{"origin": [-5.5, 13, -10.5], "size": [11, 1, 1], "uv": [64, 11]},
{"origin": [-5, 12.5, -11], "size": [10, 2, 2], "uv": [45, 62]}
]
},
{
"name": "leftFrontThigh",
"parent": "body",
"pivot": [4.5, 11, -8.5],
"cubes": [
{"origin": [3.5, 10, -9.5], "size": [8, 2, 2], "inflate": 0.025, "uv": [64, 13]}
]
},
{
"name": "leftFrontLeg",
"parent": "leftFrontThigh",
"pivot": [11.5, 10, -8.5],
"cubes": [
{"origin": [9.5, 4, -9], "size": [2, 6, 1], "uv": [68, 26]}
]
},
{
"name": "leftFrontFoot",
"parent": "leftFrontLeg",
"pivot": [11.5, 4, -8.5],
"cubes": [
{"origin": [11.5, 4, -8.5], "size": [6, 4, 0], "uv": [116, 0]}
]
},
{
"name": "leftBackThigh",
"parent": "body",
"pivot": [4.5, 10, 1.5],
"cubes": [
{"origin": [3.5, 9, 0.5], "size": [8, 2, 2], "inflate": 0.025, "uv": [64, 13]}
]
},
{
"name": "leftBackLeg",
"parent": "leftBackThigh",
"pivot": [11.5, 9, 1.5],
"cubes": [
{"origin": [9.5, 3, 1], "size": [2, 6, 1], "uv": [68, 26]}
]
},
{
"name": "leftBackFoot",
"parent": "leftBackLeg",
"pivot": [11.5, 3, 1.5],
"cubes": [
{"origin": [11.5, 3, 1.5], "size": [6, 4, 0], "uv": [116, 0]}
]
},
{
"name": "rightFrontThigh",
"parent": "body",
"pivot": [-4.5, 11, -8.5],
"cubes": [
{"origin": [-11.5, 10, -9.5], "size": [8, 2, 2], "inflate": 0.025, "uv": [64, 13], "mirror": true}
]
},
{
"name": "rightFrontLeg",
"parent": "rightFrontThigh",
"pivot": [-11.5, 10, -8.5],
"cubes": [
{"origin": [-11.5, 4, -9], "size": [2, 6, 1], "uv": [68, 26], "mirror": true}
]
},
{
"name": "rightFrontFoot",
"parent": "rightFrontLeg",
"pivot": [-11.5, 4, -8.5],
"cubes": [
{"origin": [-17.5, 4, -8.5], "size": [6, 4, 0], "uv": [116, 0], "mirror": true}
]
},
{
"name": "rightBackThigh",
"parent": "body",
"pivot": [-4.5, 10, 1.5],
"cubes": [
{"origin": [-11.5, 9, 0.5], "size": [8, 2, 2], "inflate": 0.025, "uv": [64, 13], "mirror": true}
]
},
{
"name": "rightBackLeg",
"parent": "rightBackThigh",
"pivot": [-11.5, 9, 1.5],
"cubes": [
{"origin": [-11.5, 3, 1], "size": [2, 6, 1], "uv": [68, 26], "mirror": true}
]
},
{
"name": "rightBackFoot",
"parent": "rightBackLeg",
"pivot": [-11.5, 3, 1.5],
"cubes": [
{"origin": [-17.5, 3, 1.5], "size": [6, 4, 0], "uv": [116, 0], "mirror": true}
]
},
{
"name": "topHeadClawThing",
"parent": "body",
"pivot": [0, 17, -10.5],
"cubes": [
{"origin": [-1, 17, -12.5], "size": [2, 4, 2], "uv": [72, 20]},
{"origin": [-0.5, 21, -12.5], "size": [1, 2, 2], "uv": [68, 39]},
{"origin": [0, 23, -14.5], "size": [0, 3, 3], "uv": [68, 33]}
]
},
{
"name": "leftHeadClawThing",
"parent": "body",
"pivot": [4, 10, -10.5],
"cubes": [
{"origin": [3, 6, -12.5], "size": [2, 4, 2], "uv": [64, 20]},
{"origin": [3.5, 4, -12.5], "size": [1, 2, 2], "uv": [90, 62]},
{"origin": [4, 1, -14.5], "size": [0, 3, 3], "uv": [82, 33]}
]
},
{
"name": "rightHeadClawThing",
"parent": "body",
"pivot": [-4, 10, -10.5],
"cubes": [
{"origin": [-5, 6, -12.5], "size": [2, 4, 2], "uv": [64, 20], "mirror": true},
{"origin": [-4.5, 4, -12.5], "size": [1, 2, 2], "uv": [90, 62], "mirror": true},
{"origin": [-4, 1, -14.5], "size": [0, 3, 3], "uv": [82, 33], "mirror": true}
]
}
]
}
]
}
@@ -0,0 +1,226 @@
{
"format_version": "1.12.0",
"minecraft:geometry": [
{
"description": {
"identifier": "geometry.gammametroid",
"texture_width": 128,
"texture_height": 128,
"visible_bounds_width": 6,
"visible_bounds_height": 3.5,
"visible_bounds_offset": [0, 1.25, 0]
},
"bones": [
{
"name": "root",
"pivot": [0, 0, 0]
},
{
"name": "body",
"parent": "root",
"pivot": [0, 13, -3],
"cubes": [
{"origin": [-8, 2, -8], "size": [16, 16, 16], "uv": [0, 0]},
{"origin": [-4, 6, -4], "size": [8, 8, 8], "uv": [64, 0]},
{"origin": [0, 2, -8], "size": [0, 16, 16], "uv": [52, 57]},
{"origin": [-8, 2, 0], "size": [16, 16, 0], "uv": [64, 16]},
{"origin": [-8.5, 9.9, -8.5], "size": [17, 12, 8], "pivot": [0, 9.9, -0.5], "rotation": [5, 0, 0], "uv": [52, 37]},
{"origin": [-9, 9.75, -1.925], "size": [18, 13, 8], "uv": [0, 37]},
{"origin": [-4.5, 10, -12.5], "size": [9, 7, 4], "uv": [84, 57]},
{"origin": [-4.5, 10, -12.5], "size": [9, 7, 0], "inflate": 0.25, "uv": [100, 84]},
{"origin": [-4.5, 10, -12.5], "size": [9, 7, 0], "inflate": 0.5, "uv": [100, 91]},
{"origin": [-5.5, 13, -10], "size": [11, 1, 1], "inflate": -0.05, "uv": [84, 72]},
{"origin": [-5, 12.5, -10.5], "size": [10, 2, 2], "inflate": -0.05, "uv": [84, 68]},
{"origin": [-5.5, 12, -11], "size": [11, 1, 1], "uv": [84, 72]},
{"origin": [-5, 11.5, -11.5], "size": [10, 2, 2], "uv": [84, 68]},
{"origin": [-5.5, 14, -11], "size": [11, 1, 1], "inflate": 0.05, "uv": [84, 72]},
{"origin": [-5, 13.5, -11.5], "size": [10, 2, 2], "inflate": 0.05, "uv": [84, 68]}
]
},
{
"name": "tail1",
"parent": "body",
"pivot": [0, 21.775, 6.075],
"rotation": [-5, 0, 0],
"cubes": [
{"origin": [-8.5, 9.80386, 6.06833], "size": [17, 12, 8], "uv": [52, 37]}
]
},
{
"name": "tail2",
"parent": "tail1",
"pivot": [0, 20.96821, 14.04442],
"rotation": [-10, 0, 0],
"cubes": [
{"origin": [-7.5, 9.9837, 14.02548], "size": [15, 11, 6], "uv": [0, 58]}
]
},
{
"name": "tail3",
"parent": "tail2",
"pivot": [0, 18.96538, 20.04064],
"rotation": [-5, 0, 0],
"cubes": [
{"origin": [-5.5, 9.99664, 20.00703], "size": [11, 9, 4], "uv": [0, 75]}
]
},
{
"name": "tail4",
"parent": "tail3",
"pivot": [0, 10.03043, 24.00795],
"rotation": [5, 0, 0],
"cubes": [
{"origin": [-1.5, 9.99685, 24.00409], "size": [3, 5, 4], "uv": [0, 88]}
]
},
{
"name": "tail5",
"parent": "tail4",
"pivot": [0, 10.00353, 28.01924],
"rotation": [10, 0, 0],
"cubes": [
{"origin": [-1, 9.99958, 28.00316], "size": [2, 2, 2], "uv": [28, 88]}
]
},
{
"name": "topHeadClawThing",
"parent": "body",
"pivot": [0, 17, -10.5],
"cubes": [
{"origin": [-1, 17, -12.5], "size": [2, 4, 2], "uv": [30, 75]},
{"origin": [-0.5, 21, -13.5], "size": [1, 2, 2], "uv": [84, 88]},
{"origin": [0, 23, -15.5], "size": [0, 3, 3], "uv": [36, 88]}
]
},
{
"name": "leftHeadClawThing",
"parent": "body",
"pivot": [4, 10, -10.5],
"cubes": [
{"origin": [3, 6, -12.5], "size": [2, 4, 2], "uv": [20, 88]},
{"origin": [3.5, 4, -13.5], "size": [1, 2, 2], "uv": [48, 89]},
{"origin": [4, 1, -15.5], "size": [0, 3, 3], "uv": [42, 88]}
]
},
{
"name": "rightHeadClawThing",
"parent": "body",
"pivot": [-4, 10, -10.5],
"cubes": [
{"origin": [-5, 6, -12.5], "size": [2, 4, 2], "uv": [20, 88], "mirror": true},
{"origin": [-4.5, 4, -13.5], "size": [1, 2, 2], "uv": [48, 89], "mirror": true},
{"origin": [-4, 1, -15.5], "size": [0, 3, 3], "uv": [42, 88], "mirror": true}
]
},
{
"name": "leftFrontThigh",
"parent": "root",
"pivot": [4.5, 10, -8.5],
"cubes": [
{"origin": [3.5, 8.5, -9.5], "size": [12, 3, 2], "inflate": 0.025, "uv": [78, 32]}
]
},
{
"name": "leftFrontLeg",
"parent": "leftFrontThigh",
"pivot": [14.5, 10.5, -8.5],
"cubes": [
{"origin": [15.5, 6.5, -9.5], "size": [1, 10, 2], "uv": [14, 88]},
{"origin": [13.5, 8.5, -9], "size": [2, 24, 1], "uv": [42, 58], "mirror": true}
]
},
{
"name": "leftFrontFoot",
"parent": "leftFrontLeg",
"pivot": [16.5, 33.5, -8.5],
"cubes": [
{"origin": [36.5, 33.5, -10], "size": [8, 2, 3], "inflate": 0.25, "pivot": [40.5, 33.5, -3.5], "rotation": [0, 0, 24], "uv": [30, 83], "mirror": true},
{"origin": [12.5, 31.5, -10], "size": [36, 2, 3], "uv": [0, 32], "mirror": true},
{"origin": [39, 29.625, -8.5], "size": [4, 1, 0], "pivot": [39, 31.625, -3.5], "rotation": [0, 0, -24], "uv": [30, 81]}
]
},
{
"name": "leftBackThigh",
"parent": "root",
"pivot": [4.5, 10, 1.5],
"cubes": [
{"origin": [3.5, 8.5, 0.5], "size": [12, 3, 2], "inflate": 0.025, "uv": [78, 32]}
]
},
{
"name": "leftBackLeg",
"parent": "leftBackThigh",
"pivot": [14.5, 10.5, 1.5],
"cubes": [
{"origin": [15.5, 6.5, 0.5], "size": [1, 10, 2], "uv": [14, 88]},
{"origin": [13.5, 8.5, 1], "size": [2, 24, 1], "uv": [42, 58], "mirror": true}
]
},
{
"name": "leftBackFoot",
"parent": "leftBackLeg",
"pivot": [16.5, 33.5, 1.5],
"cubes": [
{"origin": [36.5, 33.5, 0], "size": [8, 2, 3], "inflate": 0.25, "pivot": [40.5, 33.5, -3.5], "rotation": [0, 0, 24], "uv": [30, 83], "mirror": true},
{"origin": [39, 29.625, 1.5], "size": [4, 1, 0], "pivot": [39, 31.625, -3.5], "rotation": [0, 0, -24], "uv": [30, 81]},
{"origin": [12.5, 31.5, 0], "size": [36, 2, 3], "uv": [0, 32], "mirror": true}
]
},
{
"name": "rightFrontThigh",
"parent": "root",
"pivot": [-4.5, 10, -8.5],
"cubes": [
{"origin": [-15.5, 8.5, -9.5], "size": [12, 3, 2], "inflate": 0.025, "uv": [78, 32], "mirror": true}
]
},
{
"name": "rightFrontLeg",
"parent": "rightFrontThigh",
"pivot": [-14.5, 10.5, -8.5],
"cubes": [
{"origin": [-15.5, 8.5, -9], "size": [2, 24, 1], "uv": [42, 58]},
{"origin": [-16.5, 6.5, -9.5], "size": [1, 10, 2], "uv": [14, 88], "mirror": true}
]
},
{
"name": "rightFrontFoot",
"parent": "rightFrontLeg",
"pivot": [-16.5, 33.5, -8.5],
"cubes": [
{"origin": [-48.5, 31.5, -10], "size": [36, 2, 3], "uv": [0, 32]},
{"origin": [-44.5, 33.5, -10], "size": [8, 2, 3], "inflate": 0.25, "pivot": [-40.5, 33.5, -3.5], "rotation": [0, 0, -24], "uv": [30, 83]},
{"origin": [-43, 29.625, -8.5], "size": [4, 1, 0], "pivot": [-39, 31.625, -3.5], "rotation": [0, 0, 24], "uv": [30, 81], "mirror": true}
]
},
{
"name": "rightBackThigh",
"parent": "root",
"pivot": [-4.5, 10, 1.5],
"cubes": [
{"origin": [-15.5, 8.5, 0.5], "size": [12, 3, 2], "inflate": 0.025, "uv": [78, 32], "mirror": true}
]
},
{
"name": "rightBackLeg",
"parent": "rightBackThigh",
"pivot": [-14.5, 10.5, 1.5],
"cubes": [
{"origin": [-15.5, 8.5, 1], "size": [2, 24, 1], "uv": [42, 58]},
{"origin": [-16.5, 6.5, 0.5], "size": [1, 10, 2], "uv": [14, 88], "mirror": true}
]
},
{
"name": "rightBackFoot",
"parent": "rightBackLeg",
"pivot": [-16.5, 33.5, 1.5],
"cubes": [
{"origin": [-48.5, 31.5, 0], "size": [36, 2, 3], "uv": [0, 32]},
{"origin": [-44.5, 33.5, 0], "size": [8, 2, 3], "inflate": 0.25, "pivot": [-40.5, 33.5, -3.5], "rotation": [0, 0, -24], "uv": [30, 83]},
{"origin": [-43, 29.625, 1.5], "size": [4, 1, 0], "pivot": [-39, 31.625, -3.5], "rotation": [0, 0, 24], "uv": [30, 81], "mirror": true}
]
}
]
}
]
}
@@ -0,0 +1,64 @@
{
"format_version": "1.12.0",
"minecraft:geometry": [
{
"description": {
"identifier": "geometry.infantmetroid",
"texture_width": 64,
"texture_height": 64,
"visible_bounds_width": 2,
"visible_bounds_height": 2.5,
"visible_bounds_offset": [0, 0.75, 0]
},
"bones": [
{
"name": "root",
"pivot": [0, 1, -0.5]
},
{
"name": "body",
"parent": "root",
"pivot": [0, 3, -0.5],
"cubes": [
{"origin": [-4, 1, -3.5], "size": [8, 3, 7], "uv": [0, 18]},
{"origin": [-3, 4, -2.5], "size": [6, 2, 5], "uv": [0, 28]},
{"origin": [-4, 0, -1.5], "size": [1, 1, 2], "uv": [30, 26]},
{"origin": [3, 0, -1.5], "size": [1, 1, 2], "uv": [30, 29]}
]
},
{
"name": "gel",
"parent": "body",
"pivot": [0, 2.5, 0],
"cubes": [
{"origin": [-5, 2, -4.5], "size": [10, 9, 9], "uv": [0, 0]}
]
},
{
"name": "eye1",
"parent": "body",
"pivot": [-3, 6, -2.5],
"cubes": [
{"origin": [-4, 5, -3.5], "size": [2, 2, 2], "uv": [30, 18]}
]
},
{
"name": "eye2",
"parent": "body",
"pivot": [0, 6, -1.5],
"cubes": [
{"origin": [-1, 6, -2.5], "size": [2, 2, 2], "uv": [30, 18]}
]
},
{
"name": "eye3",
"parent": "body",
"pivot": [3, 6, -2.5],
"cubes": [
{"origin": [2, 5, -3.5], "size": [2, 2, 2], "uv": [30, 18]}
]
}
]
}
]
}
@@ -0,0 +1,90 @@
{
"format_version": "1.12.0",
"minecraft:geometry": [
{
"description": {
"identifier": "geometry.metroidlarva",
"texture_width": 128,
"texture_height": 128,
"visible_bounds_width": 2,
"visible_bounds_height": 2.5,
"visible_bounds_offset": [0, 0.75, 0]
},
"bones": [
{
"name": "body",
"pivot": [0, 2, 0],
"cubes": [
{"origin": [-5, 1, -4.5], "size": [10, 4, 9], "uv": [0, 26]},
{"origin": [-4, 5, -3.5], "size": [8, 2, 7], "uv": [38, 26]}
]
},
{
"name": "eye1",
"parent": "body",
"pivot": [-4, 7, -3],
"cubes": [
{"origin": [-6, 6, -4.5], "size": [3, 3, 3], "uv": [38, 35]}
]
},
{
"name": "eye2",
"parent": "body",
"pivot": [0, 7, -2],
"cubes": [
{"origin": [-1.5, 7, -3.5], "size": [3, 3, 3], "uv": [38, 35]}
]
},
{
"name": "eye3",
"parent": "body",
"pivot": [4, 7, -3],
"cubes": [
{"origin": [3, 6, -4.5], "size": [3, 3, 3], "uv": [38, 35]}
]
},
{
"name": "gel",
"parent": "body",
"pivot": [0, 2.5, -0.5],
"cubes": [
{"origin": [-7.5, 1.5, 0], "size": [15, 15, 0], "uv": [44, 56]},
{"origin": [-7, 2, -6], "size": [14, 14, 12], "uv": [0, 0]}
]
},
{
"name": "rightTooth",
"parent": "body",
"pivot": [-5, 1, -0.5],
"cubes": [
{"origin": [-6, -3, -1.5], "size": [2, 5, 2], "uv": [0, 39]}
]
},
{
"name": "leftTooth",
"parent": "body",
"pivot": [5, 1, -0.5],
"cubes": [
{"origin": [4, -3, -1.5], "size": [2, 5, 2], "uv": [0, 39], "mirror": true}
]
},
{
"name": "rightArm",
"parent": "body",
"pivot": [-1.5, 1, -4],
"cubes": [
{"origin": [-2, -2, -4.5], "size": [1, 3, 1], "uv": [8, 39]}
]
},
{
"name": "leftArm",
"parent": "body",
"pivot": [1.5, 1, -4],
"cubes": [
{"origin": [1, -2, -4.5], "size": [1, 3, 1], "uv": [8, 39], "mirror": true}
]
}
]
}
]
}
@@ -530,6 +530,7 @@
"effect.antarchy.paralyzed": "Paralyzed",
"effect.antarchy.inverted": "Inverted",
"effect.antarchy.stinky": "Stinky",
"effect.antarchy.gooped": "Gooped",
"effect.antarchy.shrinking": "Shrinking",
"effect.antarchy.growth": "Growth",
"effect.antarchy.bloodglass_ward": "Bloodglass Ward",
@@ -915,6 +916,12 @@
"block.antarchy.molting_vines": "Molting Vines",
"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.biomite": "Biomite",
"block.antarchy.biomite_turf": "Biomite Turf",
"block.antarchy.biowart": "Biowart",
"block.antarchy.biowart_tendrils": "Biowart Tendrils",
"subtitles.antarchy.creeping_horror_growl": "Creeping Horror growls",
"subtitles.antarchy.creeping_horror_hurt": "Creeping Horror hurts",
"subtitles.antarchy.creeping_horror_bite": "Creeping Horror bites",
@@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "antarchy:block/biomite"
}
}
@@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "antarchy:block/biomite_turf"
}
}
@@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "antarchy:block/biowart"
}
}
@@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cross",
"textures": {
"cross": "antarchy:block/biowart_tendrils"
}
}
@@ -0,0 +1,71 @@
{
"format_version": "1.9.0",
"credit": "Made with Blockbench",
"texture_size": [64, 64],
"textures": {
"1": "antarchy:block/metroid_egg",
"particle": "antarchy:block/metroid_egg"
},
"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],
"faces": {
"north": {"uv": [10.5, 0, 13.5, 4], "texture": "#1"},
"east": {"uv": [7, 0, 10.5, 4], "texture": "#1"},
"south": {"uv": [10.5, 4, 13.5, 8], "texture": "#1"},
"west": {"uv": [7, 4, 10.5, 8], "texture": "#1"},
"up": {"uv": [7, 3.5, 4, 0], "texture": "#1"},
"down": {"uv": [6, 11.25, 3, 14.75], "texture": "#1"}
}
},
{
"from": [4, 1, 3],
"to": [12, 9, 13],
"faces": {
"north": {"uv": [13.5, 0, 15.5, 2], "texture": "#1"},
"east": {"uv": [6, 11.5, 8.5, 13.5], "texture": "#1"},
"south": {"uv": [13.5, 2, 15.5, 4], "texture": "#1"},
"west": {"uv": [8.5, 11.75, 11, 13.75], "texture": "#1"},
"up": {"uv": [13, 14.25, 11, 11.75], "texture": "#1"},
"down": {"uv": [15, 11.75, 13, 14.25], "texture": "#1"}
}
},
{
"from": [8, 1, 1],
"to": [8, 16, 15],
"faces": {
"north": {"uv": [0, 0, 0, 3.75], "texture": "#1"},
"east": {"uv": [0, 7.5, 3.5, 11.25], "texture": "#1"},
"south": {"uv": [0, 0, 0, 3.75], "texture": "#1"},
"west": {"uv": [3.5, 7.5, 7, 11.25], "texture": "#1"},
"up": {"uv": [0, 3.5, 0, 0], "texture": "#1"},
"down": {"uv": [0, 0, 0, 3.5], "texture": "#1"}
}
},
{
"from": [2, 1, 8],
"to": [14, 16, 8],
"faces": {
"north": {"uv": [10.5, 8, 13.5, 11.75], "texture": "#1"},
"east": {"uv": [0, 0, 0, 3.75], "texture": "#1"},
"south": {"uv": [0, 11.25, 3, 15], "texture": "#1"},
"west": {"uv": [0, 0, 0, 3.75], "texture": "#1"},
"up": {"uv": [3, 0, 0, 0], "texture": "#1"},
"down": {"uv": [0, 0, 3, 0], "texture": "#1"}
}
}
]
}
@@ -0,0 +1,85 @@
{
"format_version": "1.21.11",
"credit": "Made with Blockbench",
"texture_size": [64, 64],
"textures": {
"0": "antarchy:block/spit_bug_egg",
"particle": "antarchy:block/spit_bug_egg"
},
"elements": [
{
"from": [1, 0, 2],
"to": [15, 16, 14],
"faces": {
"north": {"uv": [0, 0, 3.5, 4], "texture": "#0"},
"east": {"uv": [0, 4, 3, 8], "texture": "#0"},
"south": {"uv": [0, 0, 3.5, 4], "texture": "#0"},
"west": {"uv": [0, 4, 3, 8], "texture": "#0"},
"up": {"uv": [9.5, 7, 6, 4], "texture": "#0", "cullface": "up"},
"down": {"uv": [10.5, 0, 7, 3], "texture": "#0", "cullface": "down"}
}
},
{
"from": [2, 0.1, 3],
"to": [14, 14.1, 13],
"rotation": {"angle": 0, "axis": "y", "origin": [0, 0.1, 0]},
"faces": {
"north": {"uv": [0, 8, 3, 11.5], "texture": "#0"},
"east": {"uv": [3, 8, 5.5, 11.5], "texture": "#0"},
"south": {"uv": [0, 8, 3, 11.5], "texture": "#0"},
"west": {"uv": [3, 8, 5.5, 11.5], "texture": "#0"},
"up": {"uv": [12.5, 5.5, 9.5, 3], "texture": "#0", "cullface": "up"},
"down": {"uv": [13.5, 0, 10.5, 2.5], "texture": "#0", "cullface": "down"}
}
}
],
"display": {
"thirdperson_righthand": {
"rotation": [75, 45, 0],
"translation": [0, 2.5, 0],
"scale": [0.375, 0.375, 0.375]
},
"thirdperson_lefthand": {
"rotation": [0, 90, -55],
"translation": [0, 4, 0.5],
"scale": [0.85, 0.85, 0.85]
},
"firstperson_righthand": {
"rotation": [0, 45, 0],
"scale": [0.4, 0.4, 0.4]
},
"firstperson_lefthand": {
"rotation": [0, -135, 0],
"scale": [0.4, 0.4, 0.4]
},
"ground": {
"translation": [0, 3, 0],
"scale": [0.25, 0.25, 0.25]
},
"gui": {
"rotation": [30, -135, 0],
"scale": [0.625, 0.625, 0.625]
},
"fixed": {
"scale": [0.5, 0.5, 0.5]
}
},
"groups": [
{
"name": "jumpy_bug_egg",
"origin": [0, 0.1, 0],
"scope": 0,
"color": 0,
"children": [
0,
{
"name": "inside",
"origin": [0, 0.1, 0],
"scope": 0,
"color": 0,
"children": [1]
}
]
}
]
}
@@ -0,0 +1,3 @@
{
"parent": "antarchy:block/biomite"
}
@@ -0,0 +1,3 @@
{
"parent": "antarchy:block/biomite_turf"
}
@@ -0,0 +1,3 @@
{
"parent": "antarchy:block/biowart"
}
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "antarchy:block/biowart_tendrils"
}
}
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "antarchy:item/metroid_egg_item"
}
}
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "antarchy:item/spit_bug_egg_item"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 435 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

@@ -0,0 +1,6 @@
{
"animation": {
"frametime": 16,
"interpolate": true
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

@@ -0,0 +1,6 @@
{
"animation": {
"frametime": 16,
"interpolate": true
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 690 B

@@ -0,0 +1,6 @@
{
"animation": {
"frametime": 16,
"interpolate": true
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

@@ -0,0 +1,12 @@
{
"animation": {
"frametime": 140,
"interpolate": true,
"frames": [
0,
1,
0,
2
]
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 576 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 415 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 390 B

@@ -0,0 +1,20 @@
{
"type": "minecraft:block",
"pools": [
{
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"name": "antarchy:biomite"
}
],
"rolls": 1.0
}
],
"random_sequence": "antarchy:blocks/biomite"
}
@@ -0,0 +1,20 @@
{
"type": "minecraft:block",
"pools": [
{
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"name": "antarchy:biomite_turf"
}
],
"rolls": 1.0
}
],
"random_sequence": "antarchy:blocks/biomite_turf"
}
@@ -0,0 +1,20 @@
{
"type": "minecraft:block",
"pools": [
{
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"name": "antarchy:biowart"
}
],
"rolls": 1.0
}
],
"random_sequence": "antarchy:blocks/biowart"
}
@@ -0,0 +1,20 @@
{
"type": "minecraft:block",
"pools": [
{
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"name": "antarchy:biowart_tendrils"
}
],
"rolls": 1.0
}
],
"random_sequence": "antarchy:blocks/biowart_tendrils"
}
@@ -0,0 +1,20 @@
{
"type": "minecraft:block",
"pools": [
{
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"name": "antarchy:metroid_egg"
}
],
"rolls": 1.0
}
],
"random_sequence": "antarchy:blocks/metroid_egg"
}
@@ -0,0 +1,20 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1.0,
"entries": [
{
"type": "minecraft:item",
"name": "antarchy:spit_bug_egg"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
}
],
"random_sequence": "antarchy:blocks/spit_bug_egg"
}
@@ -4,7 +4,7 @@
{
"rolls": {
"type": "minecraft:uniform",
"min": 1,
"min": 2,
"max": 3
},
"entries": [
@@ -22,8 +22,8 @@
{
"rolls": {
"type": "minecraft:uniform",
"min": 1,
"max": 2
"min": 2,
"max": 4
},
"entries": [
{
@@ -0,0 +1,7 @@
{
"replace": false,
"values": [
"antarchy:biomite",
"antarchy:biomite_turf"
]
}
@@ -0,0 +1,5 @@
{
"values": [
"#antarchy:is_cavaryn"
]
}
@@ -58,7 +58,8 @@
"antarchy:brooding_tunnels_hanging_creeproots",
"antarchy:molting_vines",
"antarchy:ground_molting_vines",
"antarchy:jumpy_bug_egg_ceiling"
"antarchy:jumpy_bug_egg_ceiling",
"antarchy:spit_bug_egg_patch"
]
],
"creature_spawn_probability": 0.12,
@@ -69,22 +70,16 @@
"weight": 95,
"minCount": 1,
"maxCount": 3
},
{
"type": "antarchy:spit_bug",
"weight": 95,
"minCount": 2,
"maxCount": 5
}
],
"creature": [],
"ambient": [
"creature": [
{
"type": "antarchy:stink_bug",
"weight": 10,
"minCount": 1,
"maxCount": 3
}
}],
"ambient": [
],
"axolotls": [],
"underground_water_creature": [],
@@ -61,33 +61,15 @@
"creature_spawn_probability": 0.06,
"spawners": {
"monster": [
{
"type": "antarchy:creeping_horror",
"weight": 95,
"minCount": 2,
"maxCount": 5
},
{
"type": "antarchy:lurking_terror",
"weight": 95,
"minCount": 2,
"maxCount": 5
},
{
"type": "antarchy:hercules_beetle",
"weight": 5,
"minCount": 1,
"maxCount": 1
}
],
"creature": [],
"ambient": [
"creature": [
{
"type": "antarchy:stink_bug",
"weight": 10,
"minCount": 1,
"maxCount": 3
}
}],
"ambient": [
],
"axolotls": [],
"underground_water_creature": [],
@@ -50,27 +50,15 @@
"creature_spawn_probability": 0.09,
"spawners": {
"monster": [
{
"type": "antarchy:creeping_horror",
"weight": 95,
"minCount": 2,
"maxCount": 5
},
{
"type": "antarchy:lurking_terror",
"weight": 95,
"minCount": 2,
"maxCount": 5
}
],
"creature": [],
"ambient": [
"creature": [
{
"type": "antarchy:stink_bug",
"weight": 40,
"minCount": 2,
"maxCount": 4
}
}],
"ambient": [
],
"axolotls": [],
"underground_water_creature": [],
@@ -0,0 +1,4 @@
{
"type": "antarchy:spit_bug_egg_patch",
"config": {}
}
@@ -0,0 +1,31 @@
{
"feature": "antarchy:spit_bug_egg_patch",
"placement": [
{
"type": "minecraft:count",
"count": {
"type": "minecraft:uniform",
"min_inclusive": 1,
"max_inclusive": 2
}
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:height_range",
"height": {
"type": "minecraft:uniform",
"min_inclusive": {
"absolute": 5
},
"max_inclusive": {
"absolute": 190
}
}
},
{
"type": "minecraft:biome"
}
]
}
@@ -11,6 +11,8 @@
"antarchy:blush_moss_carpet",
"antarchy:amber_moss_block",
"antarchy:amber_moss_carpet",
"antarchy:biowart",
"antarchy:biowart_tendrils",
"antarchy:glowcap_mushroom_block"
]
}
@@ -98,6 +98,8 @@
"antarchy:broodstone_uranium_ore",
"antarchy:broodstone_titanium_ore",
"antarchy:bile_vein",
"antarchy:biomite",
"antarchy:biomite_turf",
"antarchy:chiten_block",
"antarchy:chiten_spike"
]
@@ -15,6 +15,7 @@ import com.craisinlord.antarchy.content.entity.lucid.LucidEyeProjectileEntity;
import com.craisinlord.antarchy.content.item.ScorpionWhipTetherSync;
import com.craisinlord.antarchy.content.network.ImpactShakeSync;
import com.craisinlord.antarchy.content.network.HerculesBeetleImpactShakeSync;
import com.craisinlord.antarchy.content.network.HordeIntensitySync;
import com.craisinlord.antarchy.content.portal.PermanentPortalType;
import net.fabricmc.fabric.api.registry.FabricBrewingRecipeRegistryBuilder;
import net.minecraft.core.Holder;
@@ -423,6 +424,7 @@ public final class AntarchyFabricContent {
ScorpionWhipTetherSync.setSink(AntarchyFabricNetworking::syncScorpionWhipTether);
HerculesBeetleImpactShakeSync.setSink((player, ticks) -> net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking.send(player, new com.craisinlord.antarchy.content.network.HerculesBeetleImpactShakePayload(ticks)));
ImpactShakeSync.setSink((player, payload) -> net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking.send(player, payload));
HordeIntensitySync.setSink((player, payload) -> net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking.send(player, payload));
BloodCrystalKatanaItem.setTrailCallback(AntarchyFabricNetworking::syncKatanaTrail);
com.craisinlord.antarchy.content.gravity.AntarchyGravityApi.setSyncDispatcher(AntarchyFabricNetworking::syncGravityEntity);
AntarchyFabricEvents.register();
@@ -14,7 +14,9 @@ import com.craisinlord.antarchy.content.entity.kraken.KrakenEntity;
import com.craisinlord.antarchy.content.gravity.AntarchyGravityApi;
import com.craisinlord.antarchy.content.gravity.AntarchyGravityDirection;
import com.craisinlord.antarchy.content.gravity.AntarchyGravityTransition;
import com.craisinlord.antarchy.content.horde.CavarynHordeManager;
import com.craisinlord.antarchy.content.portal.PermanentPortalManager;
import com.craisinlord.antarchy.content.command.CavarynCommand;
import com.craisinlord.antarchy.content.command.CaterpillarCommand;
import com.craisinlord.antarchy.content.command.GravityCommand;
import com.craisinlord.antarchy.content.item.MinersDreamExcavationManager;
@@ -22,6 +24,7 @@ import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
import net.fabricmc.fabric.api.entity.event.v1.ServerLivingEntityEvents;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents;
import net.fabricmc.fabric.api.event.player.AttackEntityCallback;
import net.fabricmc.fabric.api.event.player.PlayerBlockBreakEvents;
import net.minecraft.server.level.ServerPlayer;
import com.craisinlord.antarchy.content.SquidzookaDispenseBehavior;
import com.craisinlord.antarchy.content.RpoLauncherDispenseBehavior;
@@ -52,6 +55,7 @@ public final class AntarchyFabricEvents {
public static void register() {
CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) -> {
CavarynCommand.register(dispatcher);
GravityCommand.register(dispatcher);
CaterpillarCommand.register(dispatcher);
});
@@ -80,6 +84,9 @@ public final class AntarchyFabricEvents {
BloodglassManager.handleDeath(sp);
}
PermanentPortalManager.handleSacrifice(entity);
if (entity.getKillCredit() instanceof ServerPlayer killer) {
CavarynHordeManager.recordMobKill(killer, entity);
}
if (entity instanceof MissileSquidEntity missileSquid) {
if (missileSquid.isSpawnedByKraken()) {
return;
@@ -118,10 +125,16 @@ public final class AntarchyFabricEvents {
}
return InteractionResult.PASS;
});
PlayerBlockBreakEvents.AFTER.register((world, player, pos, state, blockEntity) -> {
if (!world.isClientSide && player instanceof ServerPlayer serverPlayer) {
CavarynHordeManager.recordBlockBreak(serverPlayer, state, pos);
}
});
ServerTickEvents.END_SERVER_TICK.register(server -> {
Set<UUID> activeThisTick = new HashSet<>();
for (ServerLevel level : server.getAllLevels()) {
CavarynHordeManager.tick(level);
tickInvertedPlayers(level, activeThisTick);
tickDuctTapePlayers(level);
tickIchorPlayers(level);
@@ -7,6 +7,7 @@ import com.craisinlord.antarchy.fabric.registry.AntarchyFabricMisc;
import com.craisinlord.antarchy.Antarchy;
import com.craisinlord.antarchy.content.client.CameraShakeClientState;
import com.craisinlord.antarchy.content.client.HerculesBeetleImpactShakeClientState;
import com.craisinlord.antarchy.content.client.HordeClientState;
import com.craisinlord.antarchy.content.client.renderer.*;
import com.craisinlord.antarchy.content.client.particle.*;
import com.craisinlord.antarchy.content.client.renderer.AntiwaterFluidRenderer;
@@ -340,6 +341,9 @@ public final class AntarchyFabricClientBootstrap {
BlockRenderLayerMap.INSTANCE.putBlock(AntarchyFabricBlocks.TITANIUM_BARS.get(), RenderType.cutout());
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.BIOWART_TENDRILS.get(), RenderType.cutout());
BlockRenderLayerMap.INSTANCE.putBlock(AntarchyFabricBlocks.HANGING_CREEPROOTS.get(), RenderType.cutout());
BlockRenderLayerMap.INSTANCE.putBlock(AntarchyFabricBlocks.MOLTING_VINES.get(), RenderType.cutout());
BlockRenderLayerMap.INSTANCE.putBlock(AntarchyFabricBlocks.GLOWCAP_MUSHROOM.get(), RenderType.cutout());
@@ -413,6 +417,7 @@ public final class AntarchyFabricClientBootstrap {
if (entityType == EntityType.PLAYER) {
if (renderer instanceof net.minecraft.client.renderer.entity.player.PlayerRenderer playerRenderer) {
registrationHelper.register(new ParalyzedStonePlayerLayer(playerRenderer));
registrationHelper.register(new GoopedLivingLayer(playerRenderer));
registrationHelper.register(new BrutalflyElytraLayer(playerRenderer));
registrationHelper.register(new FallenKingCrownLayer(playerRenderer));
}
@@ -426,9 +431,11 @@ public final class AntarchyFabricClientBootstrap {
software.bernie.geckolib.renderer.GeoEntityRenderer geoRenderer =
(software.bernie.geckolib.renderer.GeoEntityRenderer) (Object) renderer;
geoRenderer.addRenderLayer(new ParalyzedStoneGeoLayer(geoRenderer));
geoRenderer.addRenderLayer(new GoopedGeoLayer(geoRenderer));
return;
}
registrationHelper.register(new ParalyzedStoneLivingLayer(renderer));
registrationHelper.register(new GoopedLivingLayer(renderer));
});
}
@@ -436,6 +443,7 @@ public final class AntarchyFabricClientBootstrap {
ClientTickEvents.END_CLIENT_TICK.register(client -> {
CameraShakeClientState.tick();
HerculesBeetleImpactShakeClientState.tick();
HordeClientState.tick();
if (client.player != null) {
ParalyzedClientHandler.clampPlayerInput(client.player);
}
@@ -460,6 +468,8 @@ public final class AntarchyFabricClientBootstrap {
ReverieTrailHandler.register();
HudRenderCallback.EVENT.register((guiGraphics, partialTick) -> {
DreadHudRenderer.render(guiGraphics);
com.craisinlord.antarchy.content.client.HordeHudRenderer.render(guiGraphics);
com.craisinlord.antarchy.content.client.GoopedHudRenderer.render(guiGraphics);
ParalyzedHudRenderer.render(guiGraphics);
BrutalflyElytraHudRenderer.render(guiGraphics);
JumpyBootsHudRenderer.render(guiGraphics);
@@ -2,6 +2,7 @@ package com.craisinlord.antarchy.fabric.network;
import com.craisinlord.antarchy.content.client.BloodglassClientState;
import com.craisinlord.antarchy.content.client.BrutalflyElytraClientState;
import com.craisinlord.antarchy.content.client.HordeClientState;
import com.craisinlord.antarchy.content.client.ScorpionWhipTetherClientState;
import com.craisinlord.antarchy.content.client.ThoraxisWeatherClientState;
import com.craisinlord.antarchy.content.entity.multipart.MultipartFramework;
@@ -58,5 +59,7 @@ public final class AntarchyFabricClientNetworking {
context.client().execute(() -> AntarchyFabricNetworking.triggerHerculesBeetleImpactShake(payload.durationTicks())));
ClientPlayNetworking.registerGlobalReceiver(ImpactShakePayload.TYPE, (payload, context) ->
context.client().execute(() -> AntarchyFabricNetworking.triggerImpactShake(payload)));
ClientPlayNetworking.registerGlobalReceiver(HordeIntensityPayload.TYPE, (payload, context) ->
context.client().execute(() -> HordeClientState.update(payload.intensity())));
}
}
@@ -76,6 +76,7 @@ public final class AntarchyFabricNetworking {
PayloadTypeRegistry.playS2C().register(ThoraxisWeatherPayload.TYPE, ThoraxisWeatherPayload.STREAM_CODEC);
PayloadTypeRegistry.playS2C().register(HerculesBeetleImpactShakePayload.TYPE, HerculesBeetleImpactShakePayload.STREAM_CODEC);
PayloadTypeRegistry.playS2C().register(ImpactShakePayload.TYPE, ImpactShakePayload.STREAM_CODEC);
PayloadTypeRegistry.playS2C().register(HordeIntensityPayload.TYPE, HordeIntensityPayload.STREAM_CODEC);
PayloadTypeRegistry.playC2S().register(GravityGunPrimaryPayload.TYPE, GravityGunPrimaryPayload.STREAM_CODEC);
PayloadTypeRegistry.playC2S().register(GravityGunScrollPayload.TYPE, GravityGunScrollPayload.STREAM_CODEC);
@@ -660,6 +660,22 @@ public final class AntarchyFabricBlocks {
() -> new Block(nyxiteProperties()));
public static final DeferredBlock<Block> BIOMITE = BLOCKS.register("biomite",
() -> new Block(BlockBehaviour.Properties.ofFullCopy(Blocks.NETHERRACK)));
public static final DeferredBlock<Block> BIOMITE_TURF = BLOCKS.register("biomite_turf",
() -> new Block(BlockBehaviour.Properties.ofFullCopy(Blocks.NETHERRACK)));
public static final DeferredBlock<BiowartBlock> BIOWART = BLOCKS.register("biowart",
() -> new BiowartBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.MOSS_BLOCK)));
public static final DeferredBlock<BiowartTendrilsBlock> BIOWART_TENDRILS = BLOCKS.register("biowart_tendrils",
() -> new BiowartTendrilsBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.MOSS_CARPET).noCollission().noOcclusion()));
public static final DeferredBlock<Block> MYRMITE_COAL_ORE = BLOCKS.register("myrmite_coal_ore",
() -> createOre(Blocks.COAL_ORE, 0, 2));
@@ -806,10 +822,23 @@ public final class AntarchyFabricBlocks {
() -> new JumpyBugEggBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.TURTLE_EGG)));
public static final DeferredBlock<SpitBugEggBlock> SPIT_BUG_EGG = BLOCKS.register("spit_bug_egg",
() -> new SpitBugEggBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.TURTLE_EGG)));
public static final DeferredBlock<MetroidEggBlock> METROID_EGG = BLOCKS.register("metroid_egg",
() -> new MetroidEggBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.TURTLE_EGG)));
public static final DeferredBlock<LurkingTerrorEggBlock> LURKING_TERROR_EGG = BLOCKS.register("lurking_terror_egg",
() -> new LurkingTerrorEggBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.TURTLE_EGG)));
static {
BiowartBlock.bindTendrils(BIOWART_TENDRILS);
}
public static final DeferredBlock<WaspNestBlock> WASP_NEST = BLOCKS.register("wasp_nest",
() -> new WaspNestBlock(AntarchyFabricBlocks::waspNestBlockEntityType, BlockBehaviour.Properties.ofFullCopy(Blocks.BEE_NEST)));
@@ -634,6 +634,10 @@ public final class AntarchyFabricItems {
public static final DeferredItem<net.minecraft.world.item.BlockItem> NYXITE_ITEM = ITEMS.registerSimpleBlockItem(AntarchyFabricBlocks.NYXITE);
public static final DeferredItem<net.minecraft.world.item.BlockItem> MYRMITE_ITEM = ITEMS.registerSimpleBlockItem(AntarchyFabricBlocks.MYRMITE);
public static final DeferredItem<net.minecraft.world.item.BlockItem> BIOMITE_ITEM = ITEMS.registerSimpleBlockItem(AntarchyFabricBlocks.BIOMITE);
public static final DeferredItem<net.minecraft.world.item.BlockItem> BIOMITE_TURF_ITEM = ITEMS.registerSimpleBlockItem(AntarchyFabricBlocks.BIOMITE_TURF);
public static final DeferredItem<net.minecraft.world.item.BlockItem> BIOWART_ITEM = ITEMS.registerSimpleBlockItem(AntarchyFabricBlocks.BIOWART);
public static final DeferredItem<net.minecraft.world.item.BlockItem> BIOWART_TENDRILS_ITEM = ITEMS.registerSimpleBlockItem(AntarchyFabricBlocks.BIOWART_TENDRILS);
public static final DeferredItem<net.minecraft.world.item.BlockItem> BROODSTONE_ITEM = ITEMS.registerSimpleBlockItem(AntarchyFabricBlocks.BROODSTONE);
public static final DeferredItem<net.minecraft.world.item.BlockItem> POLISHED_BROODSTONE_ITEM = ITEMS.registerSimpleBlockItem(AntarchyFabricBlocks.POLISHED_BROODSTONE);
public static final DeferredItem<net.minecraft.world.item.BlockItem> CHISELED_BROODSTONE_ITEM = ITEMS.registerSimpleBlockItem(AntarchyFabricBlocks.CHISELED_BROODSTONE);
@@ -787,6 +791,8 @@ public final class AntarchyFabricItems {
public static final DeferredItem<net.minecraft.world.item.BlockItem> BED_BUG_EGG_ITEM = ITEMS.registerSimpleBlockItem(AntarchyFabricBlocks.BED_BUG_EGG);
public static final DeferredItem<net.minecraft.world.item.BlockItem> CREEPING_HORROR_EGG_ITEM = ITEMS.registerSimpleBlockItem(AntarchyFabricBlocks.CREEPING_HORROR_EGG);
public static final DeferredItem<net.minecraft.world.item.BlockItem> JUMPY_BUG_EGG_ITEM = ITEMS.registerSimpleBlockItem(AntarchyFabricBlocks.JUMPY_BUG_EGG);
public static final DeferredItem<net.minecraft.world.item.BlockItem> SPIT_BUG_EGG_ITEM = ITEMS.registerSimpleBlockItem(AntarchyFabricBlocks.SPIT_BUG_EGG);
public static final DeferredItem<net.minecraft.world.item.BlockItem> METROID_EGG_ITEM = ITEMS.registerSimpleBlockItem(AntarchyFabricBlocks.METROID_EGG);
public static final DeferredItem<net.minecraft.world.item.BlockItem> LURKING_TERROR_EGG_ITEM = ITEMS.registerSimpleBlockItem(AntarchyFabricBlocks.LURKING_TERROR_EGG);
@@ -44,6 +44,7 @@ import com.craisinlord.antarchy.fabric.registry.DeferredHolder;
import com.craisinlord.antarchy.fabric.registry.DeferredItem;
import com.craisinlord.antarchy.fabric.registry.DeferredRegister;
import com.craisinlord.antarchy.content.effect.DreadMobEffect;
import com.craisinlord.antarchy.content.effect.GoopedMobEffect;
import com.craisinlord.antarchy.content.effect.GrowthMobEffect;
import com.craisinlord.antarchy.content.effect.InvertedMobEffect;
import com.craisinlord.antarchy.content.effect.ParalyzedMobEffect;
@@ -495,6 +496,9 @@ public final class AntarchyFabricMisc {
public static final DeferredHolder<MobEffect, StinkyMobEffect> STINKY = MOB_EFFECTS.register("stinky", StinkyMobEffect::new);
public static final DeferredHolder<MobEffect, GoopedMobEffect> GOOPED = MOB_EFFECTS.register("gooped", GoopedMobEffect::new);
public static final DeferredHolder<MobEffect, com.craisinlord.antarchy.content.effect.BloodglassWardEffect> BLOODGLASS_WARD = MOB_EFFECTS.register("bloodglass_ward", com.craisinlord.antarchy.content.effect.BloodglassWardEffect::new);
@@ -849,6 +853,8 @@ public final class AntarchyFabricMisc {
public static final DeferredHolder<Feature<?>, com.craisinlord.antarchy.content.worldgen.cavaryn.JumpyBugEggCeilingFeature> JUMPY_BUG_EGG_CEILING = FEATURES.register("jumpy_bug_egg_ceiling",
() -> new com.craisinlord.antarchy.content.worldgen.cavaryn.JumpyBugEggCeilingFeature(NoneFeatureConfiguration.CODEC));
public static final DeferredHolder<Feature<?>, com.craisinlord.antarchy.content.worldgen.cavaryn.SpitBugEggPatchFeature> SPIT_BUG_EGG_PATCH = FEATURES.register("spit_bug_egg_patch",
() -> new com.craisinlord.antarchy.content.worldgen.cavaryn.SpitBugEggPatchFeature(NoneFeatureConfiguration.CODEC));
public static final DeferredHolder<Feature<?>, com.craisinlord.antarchy.content.worldgen.cavaryn.RollyCavesGiantCavernFeature> ROLLY_CAVES_GIANT_CAVERN = FEATURES.register("rolly_caves_giant_cavern",
() -> new com.craisinlord.antarchy.content.worldgen.cavaryn.RollyCavesGiantCavernFeature(NoneFeatureConfiguration.CODEC));
Loaded 100 of 110 files, more files were not shown because too many files have changed in this diff. Show more