swing through grass fix

ruined arena structure
kraken multipart fix
logspam elythia worldgen fix
rolly polly bonemeal
This commit is contained in:
craisinlord committed 2026-07-07 13:02:01 -05:00
1 parent 60405560c2
commit ae76303716
39 files changed
+1025 -358

No files matched your search

@@ -17,6 +17,7 @@ public final class AntarchySettings {
private static boolean duplicatorTreeEnabled = true;
private static boolean glowingTorchflowers = true;
private static boolean glowVinesUnderLeaves = true;
private static boolean swingThroughGrassEnabled = true;
private static boolean sizeChangingRaysEnabled = true;
private static double sizeRayMinScale = 0.1D;
private static double sizeRayMaxScale = 10.0D;
@@ -100,9 +101,9 @@ public final class AntarchySettings {
private static double mantisMovementSpeed = 0.42D;
private static double mantisFlyingSpeed = 0.77D;
private static boolean mantisIgnoreLightLevel = false;
private static double alphaMantisHealth = 500.0D;
private static double alphaMantisHealth = 250.0D;
private static double alphaMantisAttackDamage = 18.0D;
private static double alphaMantisMovementSpeed = 0.42D;
private static double alphaMantisMovementSpeed = 0.546D;
private static double alphaMantisFlyingSpeed = 0.77D;
private static int alphaMantisSummonIntervalTicks = 300;
private static int alphaMantisMaxMinions = 4;
@@ -240,7 +241,7 @@ public final class AntarchySettings {
private static final int reverieAmbientPulseIntervalMaxTicks = 19;
private static double emperorScorpionHealth = 400.0D;
private static double emperorScorpionAttackDamage = 28.0D;
private static double emperorScorpionMovementSpeed = 0.32D;
private static double emperorScorpionMovementSpeed = 0.384D;
private static double emperorScorpionArmor = 25.0D;
private static double emperorScorpionKnockbackResistance = 0.8D;
private static double emperorScorpionFollowRange = 40.0D;
@@ -540,6 +541,10 @@ public final class AntarchySettings {
return glowVinesUnderLeaves;
}
public static boolean swingThroughGrassEnabled() {
return swingThroughGrassEnabled;
}
public static boolean sizeChangingRaysEnabled() {
return sizeChangingRaysEnabled;
}
@@ -984,6 +989,10 @@ public final class AntarchySettings {
glowVinesUnderLeaves = value;
}
public static void setSwingThroughGrassEnabled(boolean value) {
swingThroughGrassEnabled = value;
}
public static void setSizeChangingRaysEnabled(boolean value) {
sizeChangingRaysEnabled = value;
}
@@ -6,7 +6,7 @@ import java.nio.file.Files;
import java.nio.file.Path;
public final class ConfigResetGuard {
public static final int RESET_GENERATION = 1;
public static final int RESET_GENERATION = 2;
private static final String MARKER_FILE_NAME = ".config_generation";
private ConfigResetGuard() {
@@ -33,7 +33,7 @@ import java.util.List;
import java.util.Set;
/**
* Multiblock bush grown with bonemeal. The origin block (this one) carries the
* Multiblock bush grown with bonemeal. The origin block carries the
* loot/age; the rest of the footprint is filled with invisible
* {@link BigBushPartBlock}s.
*
@@ -75,7 +75,7 @@ public class BigBushBlock extends BushBlock implements BonemealableBlock {
return state.getValue(AGE) == 0 ? SMALL_SHAPE : Shapes.block();
}
/** All part positions belonging to a bush with the given origin state/pos (origin itself excluded). */
/** All part positions belonging to a bush with the given origin state/pos */
public static List<BlockPos> partPositions(BlockState state, BlockPos origin) {
List<BlockPos> positions = new ArrayList<>();
int age = state.getValue(AGE);
@@ -106,7 +106,7 @@ public class BigBushBlock extends BushBlock implements BonemealableBlock {
return positions;
}
/** Ground-level columns of the footprint; each needs a sturdy block below it. */
/** Ground columns of the footprint, each needs a sturdy block below it. */
public static List<BlockPos> supportColumns(BlockState state, BlockPos origin) {
List<BlockPos> columns = new ArrayList<>();
int age = state.getValue(AGE);
@@ -247,7 +247,6 @@ public class BigBushBlock extends BushBlock implements BonemealableBlock {
return;
}
if (!target.origin().equals(pos)) {
// Relocating the origin: removing it cascades and clears the old parts.
level.removeBlock(pos, false);
}
placeStage(level, target.origin(), target.state());
@@ -25,7 +25,7 @@ import org.jetbrains.annotations.Nullable;
* Invisible filler block for the grown {@link BigBushBlock} footprint. Breaking a
* part destroys the whole bush (drops come from the origin's loot table). The one
* part directly two above the origin of a stage-3 bush renders the top slice of
* the oversized cross model (CAP=true).
* the oversized cross model
*/
public class BigBushPartBlock extends Block {
public static final MapCodec<BigBushPartBlock> CODEC = Block.simpleCodec(BigBushPartBlock::new);
@@ -113,8 +113,6 @@ public class BigBushPartBlock extends Block {
level.removeBlock(pos, false);
return;
}
// Grown bushes need sturdy support under the whole footprint; break with
// drops if any of it is gone (mirrors plants popping when their dirt breaks).
BlockState originState = level.getBlockState(origin);
if (!originState.canSurvive(level, origin)) {
level.destroyBlock(origin, true);
@@ -19,6 +19,7 @@ import net.minecraft.world.entity.Mob;
import net.minecraft.world.entity.MobSpawnType;
import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
import net.minecraft.world.entity.ai.attributes.Attributes;
import net.minecraft.world.entity.ai.goal.MeleeAttackGoal;
import net.minecraft.world.entity.monster.Monster;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.ServerLevelAccessor;
@@ -91,6 +92,16 @@ public class AlphaMantisEntity extends MantisEntity {
return false;
}
@Override
protected MeleeAttackGoal createCombatGoal() {
return new MeleeAttackGoal(this, this.getCombatSpeed(), true);
}
@Override
protected double getCombatSpeed() {
return 1.05D;
}
@Override
public void tick() {
super.tick();
@@ -155,6 +166,18 @@ public class AlphaMantisEntity extends MantisEntity {
this.playSound(com.craisinlord.antarchy.content.AntarchySoundEvents.MANTIS_AMBIENT.get(), 2.0F, 0.6F);
}
@Override
protected void onActiveTarget(LivingEntity target) {
if (this.flyBurstTicks > 0 || this.flyCooldownTicks > 0) {
this.stopFlightBurst();
}
}
@Override
protected boolean shouldStartFlightBurst() {
return false;
}
@Override
public void setTarget(@Nullable LivingEntity target) {
super.setTarget(target);
@@ -3,6 +3,7 @@ package com.craisinlord.antarchy.content.entity;
import com.craisinlord.antarchy.content.AntarchySoundEvents;
import com.craisinlord.antarchy.Antarchy;
import com.craisinlord.antarchy.content.AntarchyObjects;
import com.craisinlord.antarchy.config.AntarchySettings;
import com.craisinlord.antarchy.content.damage.AntarchyDamageSources;
import net.minecraft.core.BlockPos;
import net.minecraft.core.registries.Registries;
@@ -25,18 +26,17 @@ import net.minecraft.world.entity.MobSpawnType;
import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
import net.minecraft.world.entity.ai.attributes.Attributes;
import net.minecraft.world.entity.ai.goal.FloatGoal;
import net.minecraft.world.level.levelgen.Heightmap;
import net.minecraft.world.entity.ai.goal.LookAtPlayerGoal;
import net.minecraft.world.entity.ai.goal.MeleeAttackGoal;
import net.minecraft.world.entity.ai.goal.LookAtPlayerGoal;
import net.minecraft.world.entity.ai.goal.RandomLookAroundGoal;
import net.minecraft.world.entity.ai.goal.RandomStrollGoal;
import net.minecraft.world.entity.ai.goal.target.HurtByTargetGoal;
import net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal;
import net.minecraft.world.entity.monster.Monster;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.levelgen.Heightmap;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.ServerLevelAccessor;
import net.minecraft.world.phys.Vec3;
import net.minecraft.world.entity.player.Player;
import org.jetbrains.annotations.Nullable;
import software.bernie.geckolib.animatable.GeoEntity;
import software.bernie.geckolib.animatable.instance.AnimatableInstanceCache;
@@ -84,15 +84,12 @@ public class EmperorScorpionEntity extends Monster implements GeoEntity {
new ServerBossEvent(this.getDisplayName(), BossEvent.BossBarColor.PURPLE, BossEvent.BossBarOverlay.PROGRESS);
private int attackAnimTicks = 0;
private int attackHitTick = 0;
private int attackCooldownTicks = 0;
private int stingCooldownTicks = 0;
private int agroAnimTicks = 0;
private int summonCooldown = 0;
private boolean attackDamageApplied = false;
private boolean stingAttackActive = false;
private boolean hasAgroed = false;
@Nullable private LivingEntity attackTarget;
public EmperorScorpionEntity(EntityType<? extends EmperorScorpionEntity> entityType, Level level) {
super(entityType, level);
@@ -102,13 +99,13 @@ public class EmperorScorpionEntity extends Monster implements GeoEntity {
public static AttributeSupplier.Builder createAttributes() {
return Monster.createMonsterAttributes()
.add(Attributes.MAX_HEALTH, 400.0D)
.add(Attributes.MOVEMENT_SPEED, 0.32D)
.add(Attributes.ATTACK_DAMAGE, 28.0D)
.add(Attributes.ARMOR, 25.0D)
.add(Attributes.MAX_HEALTH, AntarchySettings.emperorScorpionHealth())
.add(Attributes.MOVEMENT_SPEED, AntarchySettings.emperorScorpionMovementSpeed())
.add(Attributes.ATTACK_DAMAGE, AntarchySettings.emperorScorpionAttackDamage())
.add(Attributes.ARMOR, AntarchySettings.emperorScorpionArmor())
.add(Attributes.ARMOR_TOUGHNESS, 10.0D)
.add(Attributes.KNOCKBACK_RESISTANCE, 0.8D)
.add(Attributes.FOLLOW_RANGE, 40.0D);
.add(Attributes.KNOCKBACK_RESISTANCE, AntarchySettings.emperorScorpionKnockbackResistance())
.add(Attributes.FOLLOW_RANGE, AntarchySettings.emperorScorpionFollowRange());
}
public static boolean canSpawn(EntityType<EmperorScorpionEntity> entityType, ServerLevelAccessor level,
@@ -128,10 +125,40 @@ public class EmperorScorpionEntity extends Monster implements GeoEntity {
@Override
protected void registerGoals() {
this.goalSelector.addGoal(0, new FloatGoal(this));
this.goalSelector.addGoal(1, new EmperorScorpionAttackGoal());
this.goalSelector.addGoal(5, new RandomStrollGoal(this, 0.8D));
this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 12.0F));
this.goalSelector.addGoal(7, new RandomLookAroundGoal(this));
this.goalSelector.addGoal(1, new MeleeAttackGoal(this, 1.2D, true));
this.goalSelector.addGoal(5, new RandomStrollGoal(this, 0.8D) {
@Override
public boolean canUse() {
return !EmperorScorpionEntity.this.isInCombat() && super.canUse();
}
@Override
public boolean canContinueToUse() {
return !EmperorScorpionEntity.this.isInCombat() && super.canContinueToUse();
}
});
this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 12.0F) {
@Override
public boolean canUse() {
return !EmperorScorpionEntity.this.isInCombat() && super.canUse();
}
@Override
public boolean canContinueToUse() {
return !EmperorScorpionEntity.this.isInCombat() && super.canContinueToUse();
}
});
this.goalSelector.addGoal(7, new RandomLookAroundGoal(this) {
@Override
public boolean canUse() {
return !EmperorScorpionEntity.this.isInCombat() && super.canUse();
}
@Override
public boolean canContinueToUse() {
return !EmperorScorpionEntity.this.isInCombat() && super.canContinueToUse();
}
});
this.targetSelector.addGoal(1, new HurtByTargetGoal(this));
this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, true));
}
@@ -150,19 +177,14 @@ public class EmperorScorpionEntity extends Monster implements GeoEntity {
public void tick() {
super.tick();
this.bossEvent.setProgress(this.getHealth() / this.getMaxHealth());
if (this.attackCooldownTicks > 0) {
this.attackCooldownTicks--;
}
if (this.stingCooldownTicks > 0) {
this.stingCooldownTicks--;
}
if (this.attackAnimTicks > 0) {
if (!this.level().isClientSide) {
this.tickAttackWindup();
}
this.attackAnimTicks--;
if (this.attackAnimTicks <= 0) {
this.resetAttackState();
this.attackDamageApplied = false;
this.stingAttackActive = false;
}
}
if (this.agroAnimTicks > 0) {
@@ -226,123 +248,63 @@ public class EmperorScorpionEntity extends Monster implements GeoEntity {
@Override
public boolean doHurtTarget(Entity target) {
return this.performSnapAttack(target);
}
private boolean performSnapAttack(Entity target) {
boolean hurt = super.doHurtTarget(target);
if (hurt) {
boolean usedSting = false;
if (target instanceof LivingEntity livingTarget && this.shouldUseSting(livingTarget)) {
this.stingAttackActive = true;
this.attackAnimTicks = STING_ATTACK_ANIM_TICKS;
this.attackDamageApplied = false;
this.level().broadcastEntityEvent(this, STING_ATTACK_ANIM_EVENT);
usedSting = this.performStingAttack(livingTarget);
if (usedSting) {
this.stingCooldownTicks = STING_ATTACK_COOLDOWN_TICKS;
}
} else {
this.stingAttackActive = false;
this.attackAnimTicks = SNAP_ATTACK_ANIM_TICKS;
this.attackDamageApplied = false;
this.level().broadcastEntityEvent(this, SNAP_ATTACK_ANIM_EVENT);
}
if (!usedSting) {
this.playSound(AntarchySoundEvents.EMPEROR_SCORPION_ATTACK.get(), 0.9F, 0.95F + this.random.nextFloat() * 0.08F);
}
}
return hurt;
}
private boolean performStingAttack(Entity target) {
if (!(target instanceof LivingEntity living)) {
return false;
}
if (!(this.level() instanceof ServerLevel serverLevel)) {
return false;
}
boolean hurtAny = false;
for (LivingEntity living : serverLevel.getEntitiesOfClass(LivingEntity.class,
this.getBoundingBox().inflate(STING_AOE_RADIUS),
entity -> entity != this
&& entity.isAlive()
&& !(entity instanceof EmperorScorpionEntity)
&& !(entity instanceof ScorpionEntity))) {
if (living.hurt(AntarchyDamageSources.emperorScorpionSting(serverLevel, this), STING_DAMAGE)) {
hurtAny = true;
boolean hurt = living.hurt(AntarchyDamageSources.emperorScorpionSting(serverLevel, this), STING_DAMAGE);
if (hurt) {
int poisonDuration = this.level().getDifficulty() == Difficulty.HARD
? POISON_DURATION_TICKS * 2 : POISON_DURATION_TICKS;
living.addEffect(new MobEffectInstance(MobEffects.POISON, poisonDuration, 1));
living.addEffect(new MobEffectInstance(MobEffects.WEAKNESS, WEAKNESS_DURATION_TICKS, 0));
}
}
if (hurtAny) {
this.playSound(AntarchySoundEvents.EMPEROR_SCORPION_ATTACK.get(), 1.0F, 0.9F + this.random.nextFloat() * 0.08F);
}
return hurtAny;
}
private void beginSnapAttack(LivingEntity target) {
this.attackTarget = target;
this.attackAnimTicks = SNAP_ATTACK_ANIM_TICKS;
this.attackHitTick = SNAP_ATTACK_HIT_TICK;
this.attackCooldownTicks = SNAP_ATTACK_COOLDOWN_TICKS;
this.attackDamageApplied = false;
this.stingAttackActive = false;
this.getNavigation().stop();
this.level().broadcastEntityEvent(this, SNAP_ATTACK_ANIM_EVENT);
this.commitLunge(target, 0.42D, 0.10D);
}
private void beginStingAttack(LivingEntity target) {
this.attackTarget = target;
this.attackAnimTicks = STING_ATTACK_ANIM_TICKS;
this.attackHitTick = STING_ATTACK_HIT_TICK;
this.attackCooldownTicks = STING_ATTACK_COOLDOWN_TICKS;
this.stingCooldownTicks = STING_ATTACK_COOLDOWN_TICKS;
this.attackDamageApplied = false;
this.stingAttackActive = true;
this.getNavigation().stop();
this.level().broadcastEntityEvent(this, STING_ATTACK_ANIM_EVENT);
this.commitLunge(target, 0.55D, 0.14D);
}
private void tickAttackWindup() {
if (this.attackTarget == null || !this.attackTarget.isAlive()) {
this.resetAttackState();
return;
}
this.getLookControl().setLookAt(this.attackTarget, 30.0F, 30.0F);
if (!this.attackDamageApplied && this.attackAnimTicks == this.attackHitTick) {
if (this.stingAttackActive) {
this.attackDamageApplied = true;
this.performStingAttack(this.attackTarget);
} else if (this.distanceToSqr(this.attackTarget) <= this.getAttackReachSqr(this.attackTarget)) {
this.attackDamageApplied = true;
this.performSnapAttack(this.attackTarget);
}
}
if (this.attackAnimTicks <= 0) {
this.resetAttackState();
}
}
private double getAttackReachSqr(LivingEntity target) {
double reach = this.getBbWidth() * 1.9D + target.getBbWidth();
return reach * reach + 1.5D;
}
private void resetAttackState() {
this.attackAnimTicks = 0;
this.attackHitTick = 0;
this.attackDamageApplied = false;
this.stingAttackActive = false;
this.attackTarget = null;
}
private void commitLunge(LivingEntity target, double horizontalSpeed, double verticalSpeed) {
Vec3 lunge = target.position().subtract(this.position());
Vec3 horizontal = new Vec3(lunge.x, 0.0D, lunge.z);
if (horizontal.lengthSqr() < 1.0E-4D) {
return;
}
horizontal = horizontal.normalize().scale(horizontalSpeed);
this.setDeltaMovement(this.getDeltaMovement().add(horizontal.x, verticalSpeed, horizontal.z));
this.hasImpulse = true;
return hurt;
}
private boolean shouldUseSting(LivingEntity target) {
return this.stingCooldownTicks <= 0
&& this.distanceToSqr(target) <= this.getAttackReachSqr(target) + 2.0D
&& (this.getHealth() <= this.getMaxHealth() * 0.6F || this.random.nextFloat() < 0.45F);
&& target.isAlive()
&& (this.getHealth() <= this.getMaxHealth() * 0.8F || this.random.nextFloat() < 0.35F);
}
private boolean isAttackLocked() {
return this.attackAnimTicks > 0 || this.agroAnimTicks > 0;
}
private boolean isInCombat() {
return this.getTarget() != null || this.isAttackLocked();
}
@Override
public void handleEntityEvent(byte id) {
if (id == SNAP_ATTACK_ANIM_EVENT) {
@@ -442,43 +404,4 @@ public class EmperorScorpionEntity extends Monster implements GeoEntity {
super.remove(reason);
this.bossEvent.removeAllPlayers();
}
private final class EmperorScorpionAttackGoal extends MeleeAttackGoal {
private EmperorScorpionAttackGoal() {
super(EmperorScorpionEntity.this, 1.15D, true);
}
@Override
public void tick() {
if (EmperorScorpionEntity.this.attackTarget != null) {
EmperorScorpionEntity.this.getLookControl().setLookAt(
EmperorScorpionEntity.this.attackTarget, 30.0F, 30.0F);
}
super.tick();
}
@Override
public boolean canContinueToUse() {
return EmperorScorpionEntity.this.isAttackLocked() || super.canContinueToUse();
}
@Override
protected void checkAndPerformAttack(LivingEntity enemy) {
if (EmperorScorpionEntity.this.isAttackLocked()) {
return;
}
if (this.canPerformAttack(enemy)
&& this.isTimeToAttack()
&& EmperorScorpionEntity.this.attackCooldownTicks <= 0) {
this.resetAttackCooldown();
if (EmperorScorpionEntity.this.shouldUseSting(enemy)) {
EmperorScorpionEntity.this.beginStingAttack(enemy);
} else {
EmperorScorpionEntity.this.beginSnapAttack(enemy);
}
return;
}
super.checkAndPerformAttack(enemy);
}
}
}
@@ -64,9 +64,9 @@ public class MantisEntity extends Monster implements GeoEntity {
net.minecraft.network.syncher.SynchedEntityData.defineId(MantisEntity.class, net.minecraft.network.syncher.EntityDataSerializers.INT);
private final AnimatableInstanceCache geoCache = GeckoLibUtil.createInstanceCache(this);
private int attackAnimationTicks;
private int flyBurstTicks;
private int flyCooldownTicks;
protected int attackAnimationTicks;
protected int flyBurstTicks;
protected int flyCooldownTicks;
private int debugLogTicks = 0;
public MantisEntity(EntityType<? extends MantisEntity> entityType, Level level) {
@@ -147,8 +147,8 @@ public class MantisEntity extends Monster implements GeoEntity {
@Override
protected void registerGoals() {
this.goalSelector.addGoal(1, new FloatGoal(this));
this.goalSelector.addGoal(2, new MeleeAttackGoal(this, COMBAT_SPEED, true));
this.goalSelector.addGoal(3, new WaterAvoidingRandomStrollGoal(this, WANDER_SPEED));
this.goalSelector.addGoal(2, this.createCombatGoal());
this.goalSelector.addGoal(3, this.createIdleStrollGoal());
HurtByTargetGoal hurtByTargetGoal = new HurtByTargetGoal(this);
this.targetSelector.addGoal(1, hurtByTargetGoal);
@@ -156,6 +156,14 @@ public class MantisEntity extends Monster implements GeoEntity {
this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, 5, true, false, null));
}
protected MeleeAttackGoal createCombatGoal() {
return new MeleeAttackGoal(this, this.getCombatSpeed(), true);
}
protected WaterAvoidingRandomStrollGoal createIdleStrollGoal() {
return new WaterAvoidingRandomStrollGoal(this, WANDER_SPEED);
}
@Override
protected PathNavigation createNavigation(Level level) {
GroundPathNavigation navigation = new GroundPathNavigation(this, level);
@@ -206,8 +214,9 @@ public class MantisEntity extends Monster implements GeoEntity {
LivingEntity target = this.getTarget();
if (target != null && target.isAlive()) {
this.onActiveTarget(target);
this.getLookControl().setLookAt(target, 30.0F, 30.0F);
} else if (this.flyBurstTicks <= 0 && this.flyCooldownTicks <= 0 && this.onGround() && this.random.nextInt(180) == 0) {
} else if (this.shouldStartFlightBurst()) {
this.startFlightBurst();
}
@@ -264,6 +273,26 @@ public class MantisEntity extends Monster implements GeoEntity {
super.setYBodyRot(yBodyRot);
}
protected double getCombatSpeed() {
return COMBAT_SPEED;
}
protected void onActiveTarget(LivingEntity target) {
}
protected boolean shouldStartFlightBurst() {
return this.flyBurstTicks <= 0
&& this.flyCooldownTicks <= 0
&& this.onGround()
&& this.random.nextInt(180) == 0;
}
protected void stopFlightBurst() {
this.flyBurstTicks = 0;
this.flyCooldownTicks = 0;
this.setNoGravity(false);
}
private void startFlightBurst() {
this.flyBurstTicks = 40 + this.random.nextInt(30);
this.flyCooldownTicks = 160 + this.random.nextInt(80);
@@ -5,6 +5,9 @@ import com.craisinlord.antarchy.content.AntarchyTags;
import java.util.EnumSet;
import net.minecraft.core.BlockPos;
import net.minecraft.core.particles.ItemParticleOption;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.syncher.EntityDataAccessor;
import net.minecraft.network.syncher.EntityDataSerializers;
import net.minecraft.network.syncher.SynchedEntityData;
@@ -21,21 +24,29 @@ import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.Mob;
import net.minecraft.world.entity.PathfinderMob;
import net.minecraft.world.entity.TamableAnimal;
import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
import net.minecraft.world.entity.ai.attributes.Attributes;
import net.minecraft.world.entity.ai.goal.FloatGoal;
import net.minecraft.world.entity.ai.goal.Goal;
import net.minecraft.world.entity.ai.goal.LookAtPlayerGoal;
import net.minecraft.world.entity.ai.goal.MoveToBlockGoal;
import net.minecraft.world.entity.ai.goal.PanicGoal;
import net.minecraft.world.entity.ai.goal.RandomLookAroundGoal;
import net.minecraft.world.entity.ai.goal.TemptGoal;
import net.minecraft.world.entity.ai.goal.WaterAvoidingRandomStrollGoal;
import net.minecraft.world.entity.ai.util.DefaultRandomPos;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.Ingredient;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.BedBlock;
import net.minecraft.world.level.block.ComposterBlock;
import net.minecraft.world.level.block.CropBlock;
import net.minecraft.world.level.block.LevelEvent;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.Vec3;
import org.jetbrains.annotations.Nullable;
@@ -55,7 +66,6 @@ public class RollyPollyEntity extends TamableAnimal implements GeoEntity {
private static final RawAnimation ROLLING_ANIM = RawAnimation.begin().thenLoop("roll");
private static final RawAnimation UNROLL_ANIM = RawAnimation.begin().thenPlay("normal_mode");
// ANIMATION_STATE only syncs the roll transitions; idle/walk/rolling are derived client-side
private static final int ANIM_NONE = 0;
private static final int ANIM_ROLL_UP = 2;
private static final int ANIM_UNROLL = 4;
@@ -77,6 +87,7 @@ public class RollyPollyEntity extends TamableAnimal implements GeoEntity {
private boolean unrolling;
private int defensiveCurlTicks;
private int tumbleTicks;
private boolean hasCompost;
public RollyPollyEntity(EntityType<? extends RollyPollyEntity> entityType, Level level) {
super(entityType, level);
@@ -106,21 +117,24 @@ public class RollyPollyEntity extends TamableAnimal implements GeoEntity {
return !RollyPollyEntity.this.isRolled() && !RollyPollyEntity.this.isTame() && super.canUse();
}
});
this.goalSelector.addGoal(2, new SnuggleOnBedGoal());
this.goalSelector.addGoal(3, new TemptGoal(this, 1.1D, Ingredient.of(AntarchyTags.Items.ROLLY_POLLY_FOOD), false) {
this.goalSelector.addGoal(2, new FertilizeCropGoal());
this.goalSelector.addGoal(3, new EatCompostItemGoal());
this.goalSelector.addGoal(4, new SnuggleOnBedGoal());
this.goalSelector.addGoal(5, new TemptGoal(this, 1.1D, Ingredient.of(AntarchyTags.Items.ROLLY_POLLY_FOOD), false) {
@Override
public boolean canUse() {
return !RollyPollyEntity.this.isRolled() && super.canUse();
}
});
this.goalSelector.addGoal(4, new WaterAvoidingRandomStrollGoal(this, 1.0D) {
this.goalSelector.addGoal(6, new RollingStrollGoal());
this.goalSelector.addGoal(7, new WaterAvoidingRandomStrollGoal(this, 1.0D) {
@Override
public boolean canUse() {
return !RollyPollyEntity.this.isRolled() && !RollyPollyEntity.this.isVehicle() && super.canUse();
}
});
this.goalSelector.addGoal(5, new LookAtPlayerGoal(this, Player.class, 8.0F));
this.goalSelector.addGoal(6, new RandomLookAroundGoal(this));
this.goalSelector.addGoal(8, new LookAtPlayerGoal(this, Player.class, 8.0F));
this.goalSelector.addGoal(9, new RandomLookAroundGoal(this));
}
@Override
@@ -132,7 +146,7 @@ public class RollyPollyEntity extends TamableAnimal implements GeoEntity {
public InteractionResult mobInteract(Player player, InteractionHand hand) {
ItemStack stack = player.getItemInHand(hand);
if (this.isFood(stack)) {
if (this.isFood(stack) && (!this.isTame() || this.getHealth() < this.getMaxHealth())) {
if (!this.level().isClientSide) {
if (!player.getAbilities().instabuild) {
stack.shrink(1);
@@ -147,7 +161,7 @@ public class RollyPollyEntity extends TamableAnimal implements GeoEntity {
} else {
this.level().broadcastEntityEvent(this, (byte) 6);
}
} else if (this.getHealth() < this.getMaxHealth()) {
} else {
this.heal(4.0F);
this.level().broadcastEntityEvent(this, (byte) 7);
}
@@ -155,6 +169,21 @@ public class RollyPollyEntity extends TamableAnimal implements GeoEntity {
return InteractionResult.sidedSuccess(this.level().isClientSide);
}
if (!this.hasCompost && isCompostable(stack)) {
if (!this.level().isClientSide) {
ItemStack eaten = stack.copyWithCount(1);
if (!player.getAbilities().instabuild) {
stack.shrink(1);
}
this.eatCompost(eaten);
}
return InteractionResult.sidedSuccess(this.level().isClientSide);
}
if (this.isFood(stack)) {
return InteractionResult.sidedSuccess(this.level().isClientSide);
}
if (this.isTame() && stack.isEmpty() && !player.isShiftKeyDown() && !player.isPassengerOfSameVehicle(this)) {
if (!this.level().isClientSide) {
player.startRiding(this);
@@ -171,6 +200,19 @@ public class RollyPollyEntity extends TamableAnimal implements GeoEntity {
return null;
}
private static boolean isCompostable(ItemStack stack) {
return !stack.isEmpty() && ComposterBlock.COMPOSTABLES.containsKey(stack.getItem());
}
private void eatCompost(ItemStack eaten) {
this.hasCompost = true;
this.playSound(this.getEatingSound(eaten), 0.9F, 1.2F);
if (this.level() instanceof ServerLevel serverLevel) {
serverLevel.sendParticles(new ItemParticleOption(ParticleTypes.ITEM, eaten),
this.getX(), this.getY(0.6D), this.getZ(), 6, 0.1D, 0.1D, 0.1D, 0.05D);
}
}
public boolean isRolled() {
return this.entityData.get(ROLLED);
}
@@ -357,6 +399,18 @@ public class RollyPollyEntity extends TamableAnimal implements GeoEntity {
return super.causeFallDamage(fallDistance, multiplier, damageSource);
}
@Override
public void addAdditionalSaveData(CompoundTag tag) {
super.addAdditionalSaveData(tag);
tag.putBoolean("HasCompost", this.hasCompost);
}
@Override
public void readAdditionalSaveData(CompoundTag tag) {
super.readAdditionalSaveData(tag);
this.hasCompost = tag.getBoolean("HasCompost");
}
@Override
public void registerControllers(AnimatableManager.ControllerRegistrar controllers) {
controllers.add(new AnimationController<>(this, "main_controller", 2, this::mainAnimController));
@@ -381,11 +435,9 @@ public class RollyPollyEntity extends TamableAnimal implements GeoEntity {
return state.setAndContinue(ROLLING_ANIM);
}
if (controller.getCurrentAnimation() == null) {
// Just loaded in while rolled — snap into the held ball pose
controller.setAnimationSpeed(1.0D);
return state.setAndContinue(ROLL_UP_ANIM);
}
// Stationary while rolled: freeze on the current ball frame instead of spinning in place
controller.setAnimationSpeed(0.0D);
return PlayState.CONTINUE;
}
@@ -399,7 +451,262 @@ public class RollyPollyEntity extends TamableAnimal implements GeoEntity {
return this.geoCache;
}
/** Like a cat, a tamed rolly polly wanders over and curls up on the bed while its owner sleeps. */
private class EatCompostItemGoal extends Goal {
@Nullable
private ItemEntity targetItem;
private int scanCooldown;
EatCompostItemGoal() {
this.setFlags(EnumSet.of(Goal.Flag.MOVE));
}
@Override
public boolean canUse() {
if (RollyPollyEntity.this.hasCompost
|| RollyPollyEntity.this.isRolled()
|| RollyPollyEntity.this.isVehicle()
|| RollyPollyEntity.this.defensiveCurlTicks > 0) {
return false;
}
if (this.scanCooldown > 0) {
this.scanCooldown--;
return false;
}
this.scanCooldown = 20;
this.targetItem = this.findNearestCompostItem();
return this.targetItem != null;
}
@Override
public boolean canContinueToUse() {
return !RollyPollyEntity.this.hasCompost
&& !RollyPollyEntity.this.isRolled()
&& !RollyPollyEntity.this.isVehicle()
&& this.targetItem != null
&& this.targetItem.isAlive()
&& isCompostable(this.targetItem.getItem());
}
@Override
public void start() {
if (this.targetItem != null) {
RollyPollyEntity.this.getNavigation().moveTo(this.targetItem, 1.1D);
}
}
@Override
public void stop() {
this.targetItem = null;
RollyPollyEntity.this.getNavigation().stop();
}
@Override
public void tick() {
if (this.targetItem == null) {
return;
}
RollyPollyEntity.this.getLookControl().setLookAt(this.targetItem);
if (RollyPollyEntity.this.tickCount % 10 == 0) {
RollyPollyEntity.this.getNavigation().moveTo(this.targetItem, 1.1D);
}
if (RollyPollyEntity.this.distanceToSqr(this.targetItem) < 2.0D) {
ItemStack stack = this.targetItem.getItem();
ItemStack eaten = stack.copyWithCount(1);
stack.shrink(1);
if (stack.isEmpty()) {
this.targetItem.discard();
} else {
this.targetItem.setItem(stack.copy());
}
RollyPollyEntity.this.eatCompost(eaten);
}
}
@Nullable
private ItemEntity findNearestCompostItem() {
ItemEntity nearest = null;
double nearestDist = Double.MAX_VALUE;
for (ItemEntity item : RollyPollyEntity.this.level().getEntitiesOfClass(ItemEntity.class,
RollyPollyEntity.this.getBoundingBox().inflate(8.0D, 4.0D, 8.0D),
item -> item.isAlive() && isCompostable(item.getItem()))) {
double dist = RollyPollyEntity.this.distanceToSqr(item);
if (dist < nearestDist) {
nearest = item;
nearestDist = dist;
}
}
return nearest;
}
}
private class FertilizeCropGoal extends MoveToBlockGoal {
private static final int ROLL_ON_CROP_TICKS = 20;
private int rollTicks;
FertilizeCropGoal() {
super(RollyPollyEntity.this, 1.1D, 8, 2);
}
@Override
public boolean canUse() {
return RollyPollyEntity.this.hasCompost
&& !RollyPollyEntity.this.isRolled()
&& !RollyPollyEntity.this.isVehicle()
&& RollyPollyEntity.this.defensiveCurlTicks <= 0
&& super.canUse();
}
@Override
public boolean canContinueToUse() {
return RollyPollyEntity.this.hasCompost
&& !RollyPollyEntity.this.isVehicle()
&& super.canContinueToUse();
}
@Override
protected int nextStartTick(PathfinderMob mob) {
return reducedTickDelay(40 + mob.getRandom().nextInt(40));
}
@Override
protected boolean isValidTarget(LevelReader level, BlockPos pos) {
BlockState state = level.getBlockState(pos);
return state.getBlock() instanceof CropBlock crop && !crop.isMaxAge(state);
}
@Override
protected BlockPos getMoveToTarget() {
return this.blockPos;
}
@Override
public double acceptedDistance() {
return 1.75D;
}
@Override
public void start() {
this.rollTicks = 0;
super.start();
}
@Override
public void stop() {
super.stop();
if (RollyPollyEntity.this.isRolled() && RollyPollyEntity.this.rollTransitionTicks <= 0) {
RollyPollyEntity.this.startUnroll();
}
}
@Override
public void tick() {
super.tick();
if (!this.isReachedTarget()) {
this.rollTicks = 0;
return;
}
RollyPollyEntity.this.getNavigation().stop();
if (!RollyPollyEntity.this.isRolled()) {
if (RollyPollyEntity.this.rollTransitionTicks <= 0) {
RollyPollyEntity.this.startRollUp();
}
return;
}
if (RollyPollyEntity.this.rollTransitionTicks > 0) {
return;
}
if (++this.rollTicks >= ROLL_ON_CROP_TICKS) {
this.fertilize();
}
}
private void fertilize() {
if (RollyPollyEntity.this.level() instanceof ServerLevel serverLevel) {
BlockState state = serverLevel.getBlockState(this.blockPos);
if (state.getBlock() instanceof CropBlock crop && !crop.isMaxAge(state)) {
crop.performBonemeal(serverLevel, RollyPollyEntity.this.random, this.blockPos, state);
serverLevel.levelEvent(LevelEvent.PARTICLES_AND_SOUND_PLANT_GROWTH, this.blockPos, 15);
}
}
RollyPollyEntity.this.hasCompost = false;
RollyPollyEntity.this.startUnroll();
}
}
private class RollingStrollGoal extends Goal {
@Nullable
private Vec3 targetPos;
private int rollingTicks;
private int maxRollingTicks;
private boolean startedMoving;
private boolean finished;
RollingStrollGoal() {
this.setFlags(EnumSet.of(Goal.Flag.MOVE));
}
@Override
public boolean canUse() {
if (RollyPollyEntity.this.isRolled()
|| RollyPollyEntity.this.isVehicle()
|| RollyPollyEntity.this.defensiveCurlTicks > 0
|| RollyPollyEntity.this.hasCompost
|| RollyPollyEntity.this.rollTransitionTicks > 0) {
return false;
}
if (RollyPollyEntity.this.getRandom().nextInt(reducedTickDelay(240)) != 0) {
return false;
}
this.targetPos = DefaultRandomPos.getPos(RollyPollyEntity.this, 16, 4);
return this.targetPos != null;
}
@Override
public boolean canContinueToUse() {
return !this.finished
&& this.rollingTicks < this.maxRollingTicks
&& !RollyPollyEntity.this.isVehicle()
&& !RollyPollyEntity.this.hasCompost;
}
@Override
public void start() {
this.rollingTicks = 0;
this.maxRollingTicks = this.adjustedTickDelay(140 + RollyPollyEntity.this.getRandom().nextInt(100));
this.startedMoving = false;
this.finished = false;
RollyPollyEntity.this.startRollUp();
}
@Override
public void stop() {
this.targetPos = null;
RollyPollyEntity.this.getNavigation().stop();
if (RollyPollyEntity.this.isRolled() && RollyPollyEntity.this.rollTransitionTicks <= 0) {
RollyPollyEntity.this.startUnroll();
}
}
@Override
public void tick() {
if (RollyPollyEntity.this.rollTransitionTicks > 0 || this.targetPos == null) {
return;
}
this.rollingTicks++;
if (RollyPollyEntity.this.getNavigation().isDone()) {
if (this.startedMoving) {
this.finished = true;
} else {
RollyPollyEntity.this.getNavigation().moveTo(
this.targetPos.x, this.targetPos.y, this.targetPos.z,
AntarchySettings.rollyPollyRollSpeedMultiplier());
this.startedMoving = true;
}
}
}
}
private class SnuggleOnBedGoal extends Goal {
@Nullable
private Player ownerPlayer;
@@ -428,7 +735,6 @@ public class RollyPollyEntity extends TamableAnimal implements GeoEntity {
return false;
}
this.ownerPlayer = player;
// Aim for the pillow end of the bed, next to the sleeper's head
this.bedPos = stateAt.getOptionalValue(BedBlock.FACING)
.map(direction -> pos.relative(direction.getOpposite()))
.orElse(pos);
@@ -467,7 +773,11 @@ public class RollyPollyEntity extends TamableAnimal implements GeoEntity {
}
if (RollyPollyEntity.this.distanceToSqr(this.ownerPlayer) > 2.5D) {
this.onBedTicks = 0;
if (!RollyPollyEntity.this.isRolled()) {
if (RollyPollyEntity.this.isRolled()) {
if (RollyPollyEntity.this.rollTransitionTicks <= 0) {
RollyPollyEntity.this.startUnroll();
}
} else {
RollyPollyEntity.this.getNavigation().moveTo(
this.bedPos.getX() + 0.5D, this.bedPos.getY() + 1.0D, this.bedPos.getZ() + 0.5D, 1.1D);
}
@@ -6,6 +6,8 @@ import com.craisinlord.antarchy.content.AntarchySoundEvents;
import com.craisinlord.antarchy.content.damage.AntarchyDamageSources;
import com.craisinlord.antarchy.content.entity.MissileSquidEntity;
import com.craisinlord.antarchy.content.entity.OctopusBombEntity;
import com.craisinlord.antarchy.content.entity.multipart.MultipartEntityOwner;
import com.craisinlord.antarchy.content.entity.multipart.MultipartLayout;
import com.craisinlord.antarchy.content.damage.AntarchyDamageTypes;
import java.util.List;
@@ -60,7 +62,7 @@ import software.bernie.geckolib.animation.RawAnimation;
import software.bernie.geckolib.animation.keyframe.event.builtin.AutoPlayingSoundKeyframeHandler;
import software.bernie.geckolib.util.GeckoLibUtil;
public class KrakenEntity extends Monster implements GeoEntity {
public class KrakenEntity extends Monster implements GeoEntity, MultipartEntityOwner {
private static final EntityDataAccessor<Integer> ATTACK_STATE = SynchedEntityData.defineId(KrakenEntity.class, EntityDataSerializers.INT);
private static final EntityDataAccessor<Boolean> ROARING = SynchedEntityData.defineId(KrakenEntity.class, EntityDataSerializers.BOOLEAN);
private static final EntityDataAccessor<Boolean> PHASE_TWO = SynchedEntityData.defineId(KrakenEntity.class, EntityDataSerializers.BOOLEAN);
@@ -127,6 +129,9 @@ public class KrakenEntity extends Monster implements GeoEntity {
private float orbitDirection = 1.0F;
private boolean stormActive;
@Nullable
private Entity[] multipartParts;
public KrakenEntity(EntityType<? extends Monster> entityType, Level level) {
super(entityType, level);
this.moveControl = new FlyingMoveControl(this, 20, true);
@@ -149,6 +154,22 @@ public class KrakenEntity extends Monster implements GeoEntity {
return level.getFluidState(pos).is(FluidTags.WATER) && level.getFluidState(pos.above()).is(FluidTags.WATER);
}
@Override
public MultipartLayout antarchy$getMultipartLayout() {
return KrakenMultipartLayout.INSTANCE;
}
@Override
@Nullable
public Entity[] antarchy$getMultipartParts() {
return this.multipartParts;
}
@Override
public void antarchy$setMultipartParts(@Nullable Entity[] parts) {
this.multipartParts = parts;
}
@Override
protected void defineSynchedData(SynchedEntityData.Builder builder) {
super.defineSynchedData(builder);
@@ -6,43 +6,67 @@ import com.craisinlord.antarchy.content.entity.multipart.MultipartPartDefinition
public final class KrakenMultipartLayout implements MultipartLayout {
public static final KrakenMultipartLayout INSTANCE = new KrakenMultipartLayout();
public static final MultipartPartDefinition TENTACLE_MASS = new MultipartPartDefinition(
"tentacle_mass",
7.5F,
14.0F,
0.90F,
-0.35D,
14.00D,
0.00D,
true
);
public static final MultipartPartDefinition HEAD = new MultipartPartDefinition(
"head",
3.0F,
2.8F,
9.0F,
4.0F,
1.00F,
2.15D,
5.35D,
1.50D,
28.00D,
0.00D,
true
);
public static final MultipartPartDefinition BACK_HEAD = new MultipartPartDefinition(
"back_head",
4.8F,
4.4F,
5.5F,
4.5F,
1.10F,
0.70D,
6.55D,
31.00D,
0.00D,
true
);
public static final MultipartPartDefinition TENTACLE_MASS = new MultipartPartDefinition(
"tentacle_mass",
8.5F,
3.4F,
0.90F,
-0.35D,
1.70D,
public static final MultipartPartDefinition MANTLE = new MultipartPartDefinition(
"mantle",
8.0F,
7.0F,
1.00F,
0.60D,
34.50D,
0.00D,
true
);
public static final MultipartPartDefinition CREST = new MultipartPartDefinition(
"crest",
4.5F,
4.0F,
1.10F,
0.55D,
41.50D,
0.00D,
true
);
private static final MultipartPartDefinition[] PARTS = {
TENTACLE_MASS,
HEAD,
BACK_HEAD,
TENTACLE_MASS
MANTLE,
CREST
};
private KrakenMultipartLayout() {
@@ -7,6 +7,9 @@ import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.Level;
public final class MultipartFramework {
private static final org.slf4j.Logger LOGGER = org.slf4j.LoggerFactory.getLogger(MultipartFramework.class);
private static boolean warnedMissingFactory;
public interface PartFactory {
Entity create(MultipartEntityOwner owner, int partIndex, MultipartPartDefinition spec);
}
@@ -43,6 +46,15 @@ public final class MultipartFramework {
}
public static Entity[] createMultipartParts(MultipartEntityOwner owner) {
if (partFactory == null) {
if (!warnedMissingFactory) {
warnedMissingFactory = true;
LOGGER.warn("Multipart part factory has not been bootstrapped on this platform; "
+ "multipart entities will fall back to their base hitbox only");
}
return new Entity[0];
}
MultipartLayout layout = owner.antarchy$getMultipartLayout();
MultipartPartDefinition[] parts = layout.parts();
Entity[] created = new Entity[parts.length];
@@ -66,7 +66,7 @@ public class WaterCannonItem extends ProjectileWeaponItem implements GeoItem {
level.playSound(null, player.getX(), player.getY(), player.getZ(),
AntarchySoundEvents.WATER_CANNON_FIRE.get(), SoundSource.PLAYERS,
0.8F, 0.9F + level.getRandom().nextFloat() * 0.2F);
0.22F, 0.9F + level.getRandom().nextFloat() * 0.2F);
if (!level.isClientSide()) {
WaterBombEntity bomb = new WaterBombEntity(level, player);
@@ -36,8 +36,8 @@ public class ElythiaFloraFeature extends Feature<NoneFeatureConfiguration> {
RandomSource random = context.random();
BlockPos origin = context.origin();
int attempts = switch (this.variant) {
case FOREST -> 240;
case MEADOW -> 110;
case FOREST -> 185;
case MEADOW -> 95;
case TORCHFLOWER_FIELDS -> 60;
case BUTTERFLY_FIELDS -> 150;
case FLOWER_FOREST_MILKWEED -> 14;
@@ -171,33 +171,30 @@ public class ElythiaFloraFeature extends Feature<NoneFeatureConfiguration> {
float roll = random.nextFloat();
if (this.variant == Variant.MEADOW) {
if (roll < 0.40F) {
if (roll < 0.34F) {
return placeSingle(level, plantPos, Blocks.SHORT_GRASS);
}
if (roll < 0.80F) {
if (roll < 0.78F) {
return placeSingle(level, plantPos, veryShortGrass());
}
if (roll < 0.88F) {
return placeVeryTall(level, plantPos, veryTallGrass());
}
if (roll < 0.98F) {
if (roll < 0.81F) {
return placeDouble(level, plantPos, Blocks.TALL_GRASS.defaultBlockState());
}
return placeSingle(level, plantPos, Blocks.SHORT_GRASS);
}
if (roll < 0.24F) {
return placeSingle(level, plantPos, Blocks.SHORT_GRASS);
}
if (roll < 0.60F) {
return placeSingle(level, plantPos, veryShortGrass());
}
if (roll < 0.74F) {
if (roll < 0.14F) {
return placeSingle(level, plantPos, Blocks.SHORT_GRASS);
}
if (roll < 0.52F) {
return placeSingle(level, plantPos, veryShortGrass());
}
if (roll < 0.72F) {
return placeSingle(level, plantPos, Blocks.FERN);
}
if (roll < 0.84F) {
if (roll < 0.80F) {
return placeDouble(level, plantPos, Blocks.TALL_GRASS.defaultBlockState());
}
if (roll < 0.96F) {
if (roll < 0.84F) {
return placeVeryTall(level, plantPos, veryTallGrass());
}
return placeDouble(level, plantPos, Blocks.LARGE_FERN.defaultBlockState());
@@ -220,7 +217,7 @@ public class ElythiaFloraFeature extends Feature<NoneFeatureConfiguration> {
}
boolean placed = false;
int bushAttempts = 10 + random.nextInt(6);
int bushAttempts = 12 + random.nextInt(7);
for (int i = 0; i < bushAttempts; i++) {
int x = origin.getX() + random.nextInt(radius * 2 + 1) - radius;
int z = origin.getZ() + random.nextInt(radius * 2 + 1) - radius;
@@ -0,0 +1,131 @@
package com.craisinlord.antarchy.mixins.client;
import com.craisinlord.antarchy.config.AntarchySettings;
import net.minecraft.client.Minecraft;
import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.client.renderer.GameRenderer;
import net.minecraft.core.BlockPos;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.EntityHitResult;
import net.minecraft.world.phys.HitResult;
import net.minecraft.world.phys.Vec3;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.ModifyArg;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
@Mixin(GameRenderer.class)
public abstract class GameRendererSwingThroughGrassMixin {
@Shadow
private Minecraft minecraft;
@Shadow
private static HitResult filterHitResult(HitResult hitResult, Vec3 eyePosition, double range) {
throw new AssertionError();
}
@Unique
private Double antarchy$swingThroughReachSq;
@Inject(
method = "pick(Lnet/minecraft/world/entity/Entity;DDF)Lnet/minecraft/world/phys/HitResult;",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/world/phys/HitResult;getLocation()Lnet/minecraft/world/phys/Vec3;"
),
locals = LocalCapture.CAPTURE_FAILHARD
)
private void antarchy$cacheSwingThroughReach(
Entity entity,
double blockInteractionRange,
double entityInteractionRange,
float partialTick,
CallbackInfoReturnable<HitResult> cir,
double maxRange,
double maxRangeSq,
Vec3 eyePosition,
HitResult hitResult
) {
this.antarchy$swingThroughReachSq = null;
if (!AntarchySettings.swingThroughGrassEnabled()) {
return;
}
if (!(hitResult instanceof BlockHitResult blockHitResult) || hitResult.getType() != HitResult.Type.BLOCK) {
return;
}
ClientLevel level = this.minecraft.level;
if (level == null) {
return;
}
BlockPos blockPos = blockHitResult.getBlockPos();
if (level.getBlockState(blockPos).getCollisionShape(level, blockPos).isEmpty()) {
this.antarchy$swingThroughReachSq = maxRangeSq;
}
}
@ModifyArg(
method = "pick(Lnet/minecraft/world/entity/Entity;DDF)Lnet/minecraft/world/phys/HitResult;",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/world/entity/projectile/ProjectileUtil;getEntityHitResult(Lnet/minecraft/world/entity/Entity;Lnet/minecraft/world/phys/Vec3;Lnet/minecraft/world/phys/Vec3;Lnet/minecraft/world/phys/AABB;Ljava/util/function/Predicate;D)Lnet/minecraft/world/phys/EntityHitResult;"
),
index = 5
)
private double antarchy$useOriginalReachForEntityRaycast(double rangeSq) {
return this.antarchy$swingThroughReachSq == null ? rangeSq : this.antarchy$swingThroughReachSq;
}
@Inject(
method = "pick(Lnet/minecraft/world/entity/Entity;DDF)Lnet/minecraft/world/phys/HitResult;",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/world/phys/EntityHitResult;getLocation()Lnet/minecraft/world/phys/Vec3;"
),
cancellable = true,
locals = LocalCapture.CAPTURE_FAILHARD
)
private void antarchy$preferAttackableEntityBehindGrass(
Entity entity,
double blockInteractionRange,
double entityInteractionRange,
float partialTick,
CallbackInfoReturnable<HitResult> cir,
double maxRange,
double maxRangeSq,
Vec3 eyePosition,
HitResult blockHitResult,
double blockHitDistanceSq,
Vec3 viewVector,
Vec3 reachEnd,
float unused,
AABB aabb,
EntityHitResult entityHitResult
) {
if (this.antarchy$swingThroughReachSq == null || entityHitResult == null) {
return;
}
Entity hitEntity = entityHitResult.getEntity();
if (!(hitEntity instanceof LivingEntity)
|| hitEntity.isSpectator()
|| !hitEntity.isAttackable()
|| this.minecraft.player == null
|| hitEntity == this.minecraft.player.getVehicle()) {
return;
}
if (eyePosition.distanceToSqr(hitEntity.position()) < this.antarchy$swingThroughReachSq) {
cir.setReturnValue(filterHitResult(entityHitResult, eyePosition, entityInteractionRange));
}
}
}
@@ -53,6 +53,7 @@
"client.CavarynSkyMixin",
"client.ElythiaSkyMixin",
"client.ElytraModelAccessor",
"client.GameRendererSwingThroughGrassMixin",
"client.LightningBoltRendererMixin",
"client.LivingEntityRendererBigBushMixin",
"client.MountedVehicleCameraMixin",
@@ -2136,6 +2136,11 @@
"spin_attack": {
"loop": true,
"animation_length": 0.2917,
"sound_effects": {
"0.0": {
"effect": "antarchy:toreterror_spin|1.1|0.95"
}
},
"bones": {
"R_arm": {
"rotation": {
@@ -3,22 +3,6 @@
"pools": [
{
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:iron_sword",
"weight": 18,
"functions": [
{
"function": "minecraft:enchant_with_levels",
"levels": {
"type": "minecraft:uniform",
"min": 5.0,
"max": 18.0
},
"options": "#minecraft:on_random_loot"
}
]
},
{
"type": "minecraft:item",
"name": "minecraft:bow",
@@ -35,32 +19,6 @@
}
]
},
{
"type": "minecraft:item",
"name": "minecraft:crossbow",
"weight": 15,
"functions": [
{
"function": "minecraft:enchant_with_levels",
"levels": {
"type": "minecraft:uniform",
"min": 6.0,
"max": 20.0
},
"options": "#minecraft:on_random_loot"
}
]
},
{
"type": "minecraft:item",
"name": "antarchy:battle_axe",
"weight": 10
},
{
"type": "minecraft:item",
"name": "antarchy:scorpion_whip",
"weight": 8
},
{
"type": "minecraft:item",
"name": "minecraft:shield",
@@ -141,21 +99,6 @@
}
]
},
{
"type": "minecraft:item",
"name": "minecraft:amethyst_shard",
"weight": 8,
"functions": [
{
"function": "minecraft:set_count",
"count": {
"type": "minecraft:uniform",
"min": 2.0,
"max": 6.0
}
}
]
},
{
"type": "minecraft:item",
"name": "minecraft:experience_bottle",
@@ -180,7 +123,7 @@
"function": "minecraft:set_components",
"components": {
"minecraft:potion_contents": {
"potion": "minecraft:swiftness"
"potion": "antarchy:shrinking"
}
}
}
@@ -210,7 +153,7 @@
"function": "minecraft:set_components",
"components": {
"minecraft:potion_contents": {
"potion": "minecraft:regeneration"
"potion": "antarchy:inverted"
}
}
}
@@ -251,6 +194,36 @@
}
}
]
},
{
"type": "minecraft:item",
"name": "antarchy:uranium_nugget",
"weight": 3,
"functions": [
{
"function": "minecraft:set_count",
"count": {
"type": "minecraft:uniform",
"min": 1.0,
"max": 2.0
}
}
]
},
{
"type": "minecraft:item",
"name": "antarchy:titanium_nugget",
"weight": 3,
"functions": [
{
"function": "minecraft:set_count",
"count": {
"type": "minecraft:uniform",
"min": 1.0,
"max": 2.0
}
}
]
}
],
"rolls": {
@@ -6,27 +6,17 @@
{
"type": "minecraft:item",
"name": "antarchy:ultimate_sword",
"weight": 8
"weight": 2
},
{
"type": "minecraft:item",
"name": "antarchy:ultimate_bow",
"weight": 8
"weight": 2
},
{
"type": "minecraft:item",
"name": "antarchy:ultimate_crossbow",
"weight": 8
},
{
"type": "minecraft:item",
"name": "antarchy:battle_axe",
"weight": 14
},
{
"type": "minecraft:item",
"name": "antarchy:scorpion_whip",
"weight": 12
"weight": 2
},
{
"type": "minecraft:item",
@@ -206,6 +196,58 @@
}
}
]
},
{
"type": "minecraft:item",
"name": "antarchy:uranium_nugget",
"weight": 4,
"functions": [
{
"function": "minecraft:set_count",
"count": {
"type": "minecraft:uniform",
"min": 1.0,
"max": 2.0
}
}
]
},
{
"type": "minecraft:item",
"name": "antarchy:titanium_nugget",
"weight": 4,
"functions": [
{
"function": "minecraft:set_count",
"count": {
"type": "minecraft:uniform",
"min": 1.0,
"max": 2.0
}
}
]
},
{
"type": "minecraft:item",
"name": "antarchy:uranium_ingot",
"weight": 2,
"functions": [
{
"function": "minecraft:set_count",
"count": 1
}
]
},
{
"type": "minecraft:item",
"name": "antarchy:titanium_ingot",
"weight": 2,
"functions": [
{
"function": "minecraft:set_count",
"count": 1
}
]
}
],
"rolls": {
@@ -195,6 +195,36 @@
}
}
]
},
{
"type": "minecraft:item",
"name": "antarchy:uranium_nugget",
"weight": 4,
"functions": [
{
"function": "minecraft:set_count",
"count": {
"type": "minecraft:uniform",
"min": 1.0,
"max": 2.0
}
}
]
},
{
"type": "minecraft:item",
"name": "antarchy:titanium_nugget",
"weight": 4,
"functions": [
{
"function": "minecraft:set_count",
"count": {
"type": "minecraft:uniform",
"min": 1.0,
"max": 2.0
}
}
]
}
],
"rolls": {
@@ -205,21 +235,6 @@
},
{
"entries": [
{
"type": "minecraft:item",
"name": "antarchy:ultimate_sword",
"weight": 2
},
{
"type": "minecraft:item",
"name": "antarchy:ultimate_bow",
"weight": 2
},
{
"type": "minecraft:item",
"name": "antarchy:ultimate_crossbow",
"weight": 2
},
{
"type": "minecraft:item",
"name": "minecraft:diamond_sword",
@@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"antarchy:elythia_meadow"
]
}
@@ -59,8 +59,8 @@
],
[],
[
"antarchy:elythia_large_tuff_boulders",
"antarchy:elythia_tuff_boulders",
"antarchy:elythia_meadow_large_tuff_boulders",
"antarchy:elythia_meadow_tuff_boulders",
"antarchy:elythia_meadow_flora",
"antarchy:elythia_brown_ant_nests",
"antarchy:elythia_rainbow_ant_nests",
@@ -1,6 +1,10 @@
{
"type": "minecraft:cache_once",
"argument": {
"type": "minecraft:clamp",
"min": -10.0,
"max": 10.0,
"input": {
"type": "minecraft:add",
"argument1": {
"type": "minecraft:y_clamped_gradient",
@@ -78,4 +82,5 @@
}
}
}
}
}
@@ -80,8 +80,6 @@
"depth": "minecraft:overworld/depth",
"erosion": "minecraft:overworld/erosion",
"final_density": {
"type": "minecraft:min",
"argument1": {
"type": "minecraft:squeeze",
"argument": {
"type": "minecraft:mul",
@@ -125,17 +123,9 @@
"input": "antarchy:elythia_surface",
"max_exclusive": 1.5625,
"min_inclusive": -1000000.0,
"when_in_range": {
"type": "minecraft:min",
"argument1": "antarchy:elythia_surface",
"argument2": 1000000.0
},
"when_in_range": "antarchy:elythia_surface",
"when_out_of_range": {
"type": "minecraft:max",
"argument1": {
"type": "minecraft:min",
"argument1": {
"type": "minecraft:min",
"argument1": {
"type": "minecraft:add",
"argument1": {
@@ -184,10 +174,6 @@
}
}
},
"argument2": 1000000.0
},
"argument2": 1000000.0
},
"argument2": {
"type": "minecraft:range_choice",
"input": "minecraft:overworld/caves/pillars",
@@ -208,8 +194,6 @@
}
}
},
"argument2": 1000000.0
},
"fluid_level_floodedness": {
"type": "minecraft:noise",
"noise": "minecraft:aquifer_fluid_level_floodedness",
@@ -267,12 +251,18 @@
"if_true": {
"type": "minecraft:vertical_gradient",
"random_name": "minecraft:bedrock_floor",
"true_at_and_below": { "absolute": -60 },
"false_at_and_above": { "absolute": -56 }
"true_at_and_below": {
"absolute": -60
},
"false_at_and_above": {
"absolute": -56
}
},
"then_run": {
"type": "minecraft:block",
"result_state": { "Name": "minecraft:bedrock" }
"result_state": {
"Name": "minecraft:bedrock"
}
}
},
{
@@ -398,7 +388,9 @@
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:biome",
"biome_is": ["antarchy:elythia_river"]
"biome_is": [
"antarchy:elythia_river"
]
},
"then_run": {
"type": "minecraft:sequence",
@@ -422,7 +414,9 @@
},
"then_run": {
"type": "minecraft:block",
"result_state": { "Name": "minecraft:sand" }
"result_state": {
"Name": "minecraft:sand"
}
}
}
},
@@ -439,7 +433,9 @@
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:grass_block",
"Properties": { "snowy": "false" }
"Properties": {
"snowy": "false"
}
}
}
},
@@ -453,7 +449,9 @@
},
"then_run": {
"type": "minecraft:block",
"result_state": { "Name": "minecraft:dirt" }
"result_state": {
"Name": "minecraft:dirt"
}
}
},
{
@@ -466,7 +464,9 @@
},
"then_run": {
"type": "minecraft:block",
"result_state": { "Name": "minecraft:dirt" }
"result_state": {
"Name": "minecraft:dirt"
}
}
}
]
@@ -476,11 +476,16 @@
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:biome",
"biome_is": ["antarchy:elythia_ocean", "antarchy:elythia_coral_spikes"]
"biome_is": [
"antarchy:elythia_ocean",
"antarchy:elythia_coral_spikes"
]
},
"then_run": {
"type": "minecraft:condition",
"if_true": { "type": "minecraft:above_preliminary_surface" },
"if_true": {
"type": "minecraft:above_preliminary_surface"
},
"then_run": {
"type": "minecraft:sequence",
"sequence": [
@@ -506,12 +511,16 @@
},
"then_run": {
"type": "minecraft:block",
"result_state": { "Name": "minecraft:sand" }
"result_state": {
"Name": "minecraft:sand"
}
}
},
{
"type": "minecraft:block",
"result_state": { "Name": "minecraft:sand" }
"result_state": {
"Name": "minecraft:sand"
}
}
]
}
@@ -527,7 +536,9 @@
},
"then_run": {
"type": "minecraft:block",
"result_state": { "Name": "antarchy:shellstone" }
"result_state": {
"Name": "antarchy:shellstone"
}
}
},
{
@@ -541,12 +552,16 @@
},
"then_run": {
"type": "minecraft:block",
"result_state": { "Name": "antarchy:shellstone" }
"result_state": {
"Name": "antarchy:shellstone"
}
}
},
{
"type": "minecraft:block",
"result_state": { "Name": "antarchy:shellstone" }
"result_state": {
"Name": "antarchy:shellstone"
}
}
]
}
@@ -556,7 +571,9 @@
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:biome",
"biome_is": ["antarchy:elythia_beach"]
"biome_is": [
"antarchy:elythia_beach"
]
},
"then_run": {
"type": "minecraft:sequence",
@@ -572,7 +589,9 @@
},
"then_run": {
"type": "minecraft:block",
"result_state": { "Name": "minecraft:sand" }
"result_state": {
"Name": "minecraft:sand"
}
}
},
{
@@ -586,7 +605,9 @@
},
"then_run": {
"type": "minecraft:block",
"result_state": { "Name": "minecraft:sand" }
"result_state": {
"Name": "minecraft:sand"
}
}
},
{
@@ -600,7 +621,9 @@
},
"then_run": {
"type": "minecraft:block",
"result_state": { "Name": "minecraft:sandstone" }
"result_state": {
"Name": "minecraft:sandstone"
}
}
},
{
@@ -614,7 +637,9 @@
},
"then_run": {
"type": "minecraft:block",
"result_state": { "Name": "antarchy:shellstone" }
"result_state": {
"Name": "antarchy:shellstone"
}
}
}
]
@@ -622,7 +647,9 @@
},
{
"type": "minecraft:condition",
"if_true": { "type": "minecraft:above_preliminary_surface" },
"if_true": {
"type": "minecraft:above_preliminary_surface"
},
"then_run": {
"type": "minecraft:sequence",
"sequence": [
@@ -650,7 +677,9 @@
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:grass_block",
"Properties": { "snowy": "false" }
"Properties": {
"snowy": "false"
}
}
}
},
@@ -664,12 +693,16 @@
},
"then_run": {
"type": "minecraft:block",
"result_state": { "Name": "minecraft:rooted_dirt" }
"result_state": {
"Name": "minecraft:rooted_dirt"
}
}
},
{
"type": "minecraft:block",
"result_state": { "Name": "minecraft:moss_block" }
"result_state": {
"Name": "minecraft:moss_block"
}
}
]
}
@@ -695,12 +728,16 @@
},
"then_run": {
"type": "minecraft:block",
"result_state": { "Name": "minecraft:rooted_dirt" }
"result_state": {
"Name": "minecraft:rooted_dirt"
}
}
},
{
"type": "minecraft:block",
"result_state": { "Name": "minecraft:coarse_dirt" }
"result_state": {
"Name": "minecraft:coarse_dirt"
}
}
]
}
@@ -715,7 +752,9 @@
},
"then_run": {
"type": "minecraft:block",
"result_state": { "Name": "minecraft:dirt" }
"result_state": {
"Name": "minecraft:dirt"
}
}
}
]
@@ -726,14 +765,20 @@
"if_true": {
"type": "minecraft:vertical_gradient",
"random_name": "minecraft:deepslate",
"true_at_and_below": { "absolute": -8 },
"false_at_and_above": { "absolute": 0 }
"true_at_and_below": {
"absolute": -8
},
"false_at_and_above": {
"absolute": 0
}
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:deepslate",
"Properties": { "axis": "y" }
"Properties": {
"axis": "y"
}
}
}
}
@@ -0,0 +1,19 @@
{
"feature": "antarchy:elythia_large_tuff_boulder",
"placement": [
{
"type": "minecraft:rarity_filter",
"chance": 40
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:heightmap",
"heightmap": "WORLD_SURFACE_WG"
},
{
"type": "minecraft:biome"
}
]
}
@@ -0,0 +1,19 @@
{
"feature": "antarchy:elythia_tuff_boulder",
"placement": [
{
"type": "minecraft:rarity_filter",
"chance": 12
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:heightmap",
"heightmap": "WORLD_SURFACE_WG"
},
{
"type": "minecraft:biome"
}
]
}
@@ -0,0 +1,22 @@
{
"type": "integrated_api:generic_structure",
"start_pool": "antarchy:ruined_arena/ruined_arena",
"size": 2,
"terrain_height_radius_check": 4,
"allowed_terrain_height_range": 14,
"valid_biome_radius_check": 1,
"biomes": "#antarchy:has_structure/ruined_anrea_biomes",
"step": "surface_structures",
"enhanced_terrain_adaptation": {
"type": "integrated_api:none"
},
"project_start_to_heightmap": "WORLD_SURFACE_WG",
"start_height": {
"type": "minecraft:constant",
"value": {
"absolute": 0
}
},
"spawn_overrides": {},
"liquid_settings": "ignore_waterlogging"
}
@@ -7,6 +7,10 @@
{
"structure": "antarchy:fallen_kingdom_castle",
"weight": 1
},
{
"structure": "antarchy:ruined_arena",
"weight": 1
}
],
"placement": {
@@ -0,0 +1,22 @@
{
"name": "antarchy:ruined_arena/ruined_arena",
"fallback": "minecraft:empty",
"elements": [
{
"weight": 1,
"element": {
"location": "antarchy:ruined_arena/ruined_arena",
"processors": "antarchy:generic_processor",
"projection": "rigid",
"enhanced_terrain_adaptation": {
"type": "integrated_api:custom",
"carves": true,
"beards": true,
"kernel_size": 35,
"kernel_distance": 35
},
"element_type": "integrated_api:integrated_api_single_pool_element"
}
}
]
}
@@ -3,6 +3,7 @@
"values": [
"antarchy:toreterror_arena",
"antarchy:fallen_kingdom_castle",
"antarchy:ruined_arena",
"antarchy:trayaurus_lab"
]
}
@@ -174,6 +174,7 @@ public final class AntarchyConfigModuleFabric {
|| name.equals("duplicatorTreeEnabled")
|| name.equals("glowingTorchflowers")
|| name.equals("glowVinesUnderLeaves")
|| name.equals("swingThroughGrassEnabled")
|| name.equals("entitySpecificFireOverlayEnabled")
|| name.equals("dreamSandEnabled")
|| name.startsWith("dreamSand")
@@ -853,7 +853,7 @@ public final class AntarchyFabricContent {
.build("mantis"));
public static final DeferredHolder<EntityType<?>, EntityType<AlphaMantisEntity>> ALPHA_MANTIS = ENTITY_TYPES.register("alpha_mantis",
() -> EntityType.Builder.of(AlphaMantisEntity::new, MobCategory.MONSTER)
.sized(4.0F, 3.25F)
.sized(4.25F, 3.35F)
.clientTrackingRange(10)
.build("alpha_mantis"));
public static final DeferredHolder<EntityType<?>, EntityType<RollyPollyEntity>> ROLLY_POLLY = ENTITY_TYPES.register("rolly_polly",
@@ -53,8 +53,11 @@ public final class AntarchyFabricEvents {
ComposterBlock.COMPOSTABLES.put(AntarchyFabricContent.UMBRAL_MOSS_CARPET.get().asItem(), 0.3f);
ComposterBlock.COMPOSTABLES.put(AntarchyFabricContent.AMBER_MOSS_BLOCK.get().asItem(), 0.65f);
ComposterBlock.COMPOSTABLES.put(AntarchyFabricContent.AMBER_MOSS_CARPET.get().asItem(), 0.3f);
ComposterBlock.COMPOSTABLES.put(AntarchyFabricContent.BIG_BUSH.get().asItem(), 0.65f);
ComposterBlock.COMPOSTABLES.put(AntarchyFabricContent.CREEPVINE.get().asItem(), 0.3f);
ComposterBlock.COMPOSTABLES.put(AntarchyFabricContent.HUSHWEED.get().asItem(), 0.65f);
ComposterBlock.COMPOSTABLES.put(AntarchyFabricContent.VERY_SHORT_GRASS.get().asItem(), 0.3f);
ComposterBlock.COMPOSTABLES.put(AntarchyFabricContent.VERY_TALL_GRASS.get().asItem(), 0.5f);
ComposterBlock.COMPOSTABLES.put(AntarchyFabricContent.CORNEA_EAR.get(), 0.65f);
ServerLivingEntityEvents.AFTER_DEATH.register((entity, damageSource) -> {
@@ -350,6 +350,7 @@ public final class AntarchyConfigModuleNeoforge {
AntarchySettings.setDuplicatorTreeEnabled(AntarchyMiscConfig.duplicatorTreeEnabled());
AntarchySettings.setGlowingTorchflowers(AntarchyMiscConfig.glowingTorchflowers());
AntarchySettings.setGlowVinesUnderLeaves(AntarchyMiscConfig.glowVinesUnderLeaves());
AntarchySettings.setSwingThroughGrassEnabled(AntarchyMiscConfig.swingThroughGrassEnabled());
AntarchySettings.setEntitySpecificFireOverlayEnabled(AntarchyMiscConfig.entitySpecificFireOverlayEnabled());
AntarchySettings.setBloodCrystalArmorShieldRechargeTicks(AntarchyToolsConfig.bloodCrystalArmorShieldRechargeTicks());
@@ -40,6 +40,7 @@ public final class AntarchyMiscConfig {
private static final ModConfigSpec.BooleanValue DUPLICATOR_TREE_ENABLED;
private static final ModConfigSpec.BooleanValue GLOWING_TORCHFLOWERS;
private static final ModConfigSpec.BooleanValue GLOW_VINES_UNDER_LEAVES;
private static final ModConfigSpec.BooleanValue SWING_THROUGH_GRASS_ENABLED;
private static final ModConfigSpec.BooleanValue ENTITY_SPECIFIC_FIRE_OVERLAY_ENABLED;
static {
@@ -120,6 +121,7 @@ public final class AntarchyMiscConfig {
DUPLICATOR_TREE_ENABLED = b.comment("If false, duplicator trees do not generate and duplicator saplings produce nothing.").define("duplicatorTreeEnabled", true);
GLOWING_TORCHFLOWERS = b.comment("Whether fully-grown torchflower blocks emit light.") .define("glowingTorchflowers", true);
GLOW_VINES_UNDER_LEAVES = b.comment("Whether glow vines can be placed and survive when attached under leaf blocks.") .define("glowVinesUnderLeaves", true);
SWING_THROUGH_GRASS_ENABLED = b.comment("If true, empty collision plants like grass do not block melee target picking.") .define("swingThroughGrassEnabled", true);
ENTITY_SPECIFIC_FIRE_OVERLAY_ENABLED = b.comment("If true, burning entities use soul fire / dream fire overlays where appropriate.") .define("entitySpecificFireOverlayEnabled", true);
b.pop();
@@ -141,6 +143,7 @@ public final class AntarchyMiscConfig {
static boolean duplicatorTreeEnabled() { return DUPLICATOR_TREE_ENABLED.get(); }
static boolean glowingTorchflowers() { return GLOWING_TORCHFLOWERS.get(); }
static boolean glowVinesUnderLeaves() { return GLOW_VINES_UNDER_LEAVES.get(); }
static boolean swingThroughGrassEnabled() { return SWING_THROUGH_GRASS_ENABLED.get(); }
static boolean entitySpecificFireOverlayEnabled() { return ENTITY_SPECIFIC_FIRE_OVERLAY_ENABLED.get(); }
static double hushweedSporeLifetimeSeconds() { return HUSHWEED_SPORE_LIFETIME_SECONDS.get(); }
@@ -390,9 +390,9 @@ public final class AntarchyMobsConfig {
// Alpha Mantis
b.push("alphaMantis");
ALPHA_MANTIS_HEALTH = b.comment("Base max health.") .defineInRange("health", 500.0D, 1.0D, 32768.0D);
ALPHA_MANTIS_HEALTH = b.comment("Base max health.") .defineInRange("health", 250.0D, 1.0D, 32768.0D);
ALPHA_MANTIS_ATTACK_DAMAGE = b.comment("Base attack damage.") .defineInRange("attackDamage", 18.0D, 0.0D, 1024.0D);
ALPHA_MANTIS_MOVEMENT_SPEED = b.comment("Base movement speed.") .defineInRange("movementSpeed", 0.42D, 0.0D, 10.0D);
ALPHA_MANTIS_MOVEMENT_SPEED = b.comment("Base movement speed.") .defineInRange("movementSpeed", 0.546D, 0.0D, 10.0D);
ALPHA_MANTIS_FLYING_SPEED = b.comment("Base flying speed.") .defineInRange("flyingSpeed", 0.77D, 0.0D, 10.0D);
ALPHA_MANTIS_SUMMON_INTERVAL_TICKS = b.comment("Ticks between mantis minion summons while in combat.") .defineInRange("summonIntervalTicks", 300, 20, 72000);
ALPHA_MANTIS_MAX_MINIONS = b.comment("Maximum summoned mantises alive near the alpha at once.") .defineInRange("maxMinions", 4, 0, 32);
@@ -1115,8 +1115,11 @@ public final class AntarchyNeoForgeEvents {
ComposterBlock.COMPOSTABLES.put(AntarchyNeoforgeBlocks.UMBRAL_MOSS_CARPET.get().asItem(), 0.3f);
ComposterBlock.COMPOSTABLES.put(AntarchyNeoforgeBlocks.AMBER_MOSS_BLOCK.get().asItem(), 0.65f);
ComposterBlock.COMPOSTABLES.put(AntarchyNeoforgeBlocks.AMBER_MOSS_CARPET.get().asItem(), 0.3f);
ComposterBlock.COMPOSTABLES.put(AntarchyNeoforgeBlocks.BIG_BUSH.get().asItem(), 0.65f);
ComposterBlock.COMPOSTABLES.put(AntarchyNeoforgeBlocks.CREEPVINE.get().asItem(), 0.3f);
ComposterBlock.COMPOSTABLES.put(AntarchyNeoforgeBlocks.HUSHWEED.get().asItem(), 0.65f);
ComposterBlock.COMPOSTABLES.put(AntarchyNeoforgeBlocks.VERY_SHORT_GRASS.get().asItem(), 0.3f);
ComposterBlock.COMPOSTABLES.put(AntarchyNeoforgeBlocks.VERY_TALL_GRASS.get().asItem(), 0.5f);
ComposterBlock.COMPOSTABLES.put(AntarchyNeoforgeItems.CORNEA_EAR.get(), 0.65f);
});
}
@@ -98,6 +98,7 @@ public class AntarchyNeoforgeCreativeModeTabs {
event.accept(AntarchyNeoforgeItems.TORCHFLOWER_BUSH_ITEM.get());
event.accept(AntarchyNeoforgeItems.BIG_BUSH_ITEM.get());
event.accept(AntarchyNeoforgeItems.VERY_SHORT_GRASS_ITEM.get());
event.accept(AntarchyNeoforgeItems.VERY_TALL_GRASS_ITEM.get());
event.accept(AntarchyNeoforgeItems.HUSHWEED_ITEM.get());
event.accept(AntarchyNeoforgeItems.AMBER_LICHEN_ITEM.get());
event.accept(AntarchyNeoforgeItems.CREEPVINE_ITEM.get());
@@ -97,7 +97,7 @@ public final class AntarchyNeoforgeEntites {
.build("mantis"));
public static final DeferredHolder<EntityType<?>, EntityType<AlphaMantisEntity>> ALPHA_MANTIS = ENTITY_TYPES.register("alpha_mantis",
() -> EntityType.Builder.of(AlphaMantisEntity::new, MobCategory.MONSTER)
.sized(4.0F, 3.25F)
.sized(4.25F, 3.35F)
.clientTrackingRange(10)
.build("alpha_mantis"));
public static final DeferredHolder<EntityType<?>, EntityType<RollyPollyEntity>> ROLLY_POLLY = ENTITY_TYPES.register("rolly_polly",