added back rolly polly, fixed various issues, antiwater sponge behavior, expiremental settings disabled natively, farbic keybind conflict fix natively

This commit is contained in:
craisinlord committed 2026-07-19 02:11:55 -05:00
1 parent cc5ab10de7
commit e4b7b76cff
79 files changed
+952 -328

No files matched your search

@@ -18,6 +18,8 @@ public final class AntarchySettings {
private static boolean glowingTorchflowers = true;
private static boolean glowVinesUnderLeaves = true;
private static boolean swingThroughGrassEnabled = true;
private static boolean fabricKeybindingConflictFixEnabled = true;
private static boolean experimentalSettingsPopupDisabled = true;
private static boolean sizeChangingRaysEnabled = true;
private static double sizeRayMinScale = 0.1D;
private static double sizeRayMaxScale = 10.0D;
@@ -49,11 +51,11 @@ public final class AntarchySettings {
private static double ultimateCrossbowAttackDamage = 8.0D;
private static double ultimateCrossbowChargeSpeedMultiplier = 0.25D;
private static double ultimateMaceDamageMultiplier = 1.5D;
private static double battleAxeAttackDamage = 44.0D;
private static double battleAxeAttackDamage = 46.0D;
private static double bigBerthaAttackDamage = 55.0D;
private static double bigBerthaReachBonus = 3.0D;
private static double bigBerthaAttackSpeed = -3.0D;
private static double attitudeAdjusterBaseDamage = 40.0D;
private static double attitudeAdjusterBaseDamage = 47.0D;
private static boolean attitudeAdjusterBreaksBlocks = true;
private static double krakensGraspAttackDamage = 16.0D;
private static double krakensGraspAttackSpeed = -2.9D;
@@ -119,11 +121,15 @@ public final class AntarchySettings {
private static double alphaMantisFlyingSpeed = 0.77D;
private static int alphaMantisSummonIntervalTicks = 300;
private static int alphaMantisMaxMinions = 4;
private static double rollyPollyHealth = 12.0D;
private static double rollyPollyHealth = 25.0D;
private static double rollyPollyMovementSpeed = 0.3D;
private static double rollyPollyRollSpeedMultiplier = 2.2D;
private static double rollyPollyTumbleDamage = 1.0D;
private static int rollyPollyTameChance = 3;
private static double rollyPollyBowlingDamage = 3.0D;
private static double rollyPollyBowlingKnockback = 0.8D;
private static double rollyPollyArmor = 2.0D;
private static double rollyPollyRolledArmorBonus = 16.0D;
private static double krakenProjectileDamageTakenMultiplier = 0.5D;
private static boolean krakenSquidSpawnEnabled = true;
private static boolean krakenMassSpawnEnabled = true;
@@ -168,6 +174,7 @@ public final class AntarchySettings {
private static double dreamSandGravityMultiplier = 0.45D;
private static double dreamSandFallDamageMultiplier = 0.35D;
private static double dreamSandEffectDurationSeconds = 7.0D;
private static double dreamSandFallingBlockGravityMultiplier = 0.4D;
private static boolean ichorWitherEnabled = true;
private static int nightmareHelmetArmorValue = 3;
private static int nightmareChestplateArmorValue = 8;
@@ -273,7 +280,7 @@ public final class AntarchySettings {
private static double emperorScorpionMovementSpeed = 0.384D;
private static double emperorScorpionArmor = 22.0D;
private static double emperorScorpionKnockbackResistance = 0.8D;
private static double emperorScorpionFollowRange = 40.0D;
private static double emperorScorpionFollowRange = 80.0D;
private static int emperorScorpionXpReward = 25;
private static int emperorScorpionClawAnimTicks = 23;
private static int emperorScorpionClawHitTick = 12;
@@ -284,7 +291,9 @@ public final class AntarchySettings {
private static int emperorScorpionPoisonTicks = 300;
private static int emperorScorpionWeaknessTicks = 120;
private static int emperorScorpionSummonIntervalTicks = 140;
private static int emperorScorpionMaxSummonedScorpions = 8;
private static int emperorScorpionMaxSummonedScorpions = 4;
private static int emperorScorpionMaxNearbyScorpions = 3;
private static int emperorScorpionHardenCooldownTicks = 2400;
private static double scorpionHealth = 30.0D;
private static double scorpionAttackDamage = 5.0D;
private static double scorpionMovementSpeed = 0.29D;
@@ -581,6 +590,14 @@ public final class AntarchySettings {
return swingThroughGrassEnabled;
}
public static boolean fabricKeybindingConflictFixEnabled() {
return fabricKeybindingConflictFixEnabled;
}
public static boolean experimentalSettingsPopupDisabled() {
return experimentalSettingsPopupDisabled;
}
public static boolean sizeChangingRaysEnabled() {
return sizeChangingRaysEnabled;
}
@@ -904,6 +921,22 @@ public final class AntarchySettings {
return rollyPollyTameChance;
}
public static double rollyPollyBowlingDamage() {
return rollyPollyBowlingDamage;
}
public static double rollyPollyBowlingKnockback() {
return rollyPollyBowlingKnockback;
}
public static double rollyPollyArmor() {
return rollyPollyArmor;
}
public static double rollyPollyRolledArmorBonus() {
return rollyPollyRolledArmorBonus;
}
public static double waspHealth() {
return waspHealth;
}
@@ -1111,6 +1144,14 @@ public final class AntarchySettings {
swingThroughGrassEnabled = value;
}
public static void setFabricKeybindingConflictFixEnabled(boolean value) {
fabricKeybindingConflictFixEnabled = value;
}
public static void setExperimentalSettingsPopupDisabled(boolean value) {
experimentalSettingsPopupDisabled = value;
}
public static void setSizeChangingRaysEnabled(boolean value) {
sizeChangingRaysEnabled = value;
}
@@ -1438,6 +1479,22 @@ public final class AntarchySettings {
rollyPollyTameChance = value;
}
public static void setRollyPollyBowlingDamage(double value) {
rollyPollyBowlingDamage = value;
}
public static void setRollyPollyBowlingKnockback(double value) {
rollyPollyBowlingKnockback = value;
}
public static void setRollyPollyArmor(double value) {
rollyPollyArmor = value;
}
public static void setRollyPollyRolledArmorBonus(double value) {
rollyPollyRolledArmorBonus = value;
}
public static void setKrakenProjectileDamageTakenMultiplier(double value) {
krakenProjectileDamageTakenMultiplier = value;
}
@@ -1671,6 +1728,14 @@ public final class AntarchySettings {
dreamSandEffectDurationSeconds = value;
}
public static double dreamSandFallingBlockGravityMultiplier() {
return dreamSandFallingBlockGravityMultiplier;
}
public static void setDreamSandFallingBlockGravityMultiplier(double value) {
dreamSandFallingBlockGravityMultiplier = value;
}
public static boolean ichorWitherEnabled() {
return ichorWitherEnabled;
}
@@ -2075,6 +2140,12 @@ public final class AntarchySettings {
public static int emperorScorpionMaxSummonedScorpions() { return emperorScorpionMaxSummonedScorpions; }
public static void setEmperorScorpionMaxSummonedScorpions(int value) { emperorScorpionMaxSummonedScorpions = value; }
public static int emperorScorpionMaxNearbyScorpions() { return emperorScorpionMaxNearbyScorpions; }
public static void setEmperorScorpionMaxNearbyScorpions(int value) { emperorScorpionMaxNearbyScorpions = value; }
public static int emperorScorpionHardenCooldownTicks() { return emperorScorpionHardenCooldownTicks; }
public static void setEmperorScorpionHardenCooldownTicks(int value) { emperorScorpionHardenCooldownTicks = value; }
public static double scorpionHealth() { return scorpionHealth; }
public static void setScorpionHealth(double value) { scorpionHealth = 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 = 2;
public static final int RESET_GENERATION = 3;
private static final String MARKER_FILE_NAME = ".config_generation";
private ConfigResetGuard() {
@@ -156,6 +156,9 @@ public final class AntarchySoundEvents {
public static Supplier<SoundEvent> SPIT_BUG_HURT = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> SPIT_BUG_SPIT = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> BRUTALFLY_SPIT = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> ROLLY_POLLY_WHEEL_MODE = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> ROLLY_POLLY_NORMAL_MODE = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> ROLLY_POLLY_ROLL = (Supplier<SoundEvent>) UNBOUND;
private AntarchySoundEvents() {
}
@@ -307,7 +310,10 @@ public final class AntarchySoundEvents {
Supplier<SoundEvent> jumpyBugJump,
Supplier<SoundEvent> spitBugHurt,
Supplier<SoundEvent> spitBugSpit,
Supplier<SoundEvent> brutalflySpit
Supplier<SoundEvent> brutalflySpit,
Supplier<SoundEvent> rollyPollyWheelMode,
Supplier<SoundEvent> rollyPollyNormalMode,
Supplier<SoundEvent> rollyPollyRoll
) {
SQUIDZOOKA_FIRE = squidzookaFire;
SHRINK_RAY_SOUND = shrinkRaySound;
@@ -456,5 +462,8 @@ public final class AntarchySoundEvents {
SPIT_BUG_HURT = spitBugHurt;
SPIT_BUG_SPIT = spitBugSpit;
BRUTALFLY_SPIT = brutalflySpit;
ROLLY_POLLY_WHEEL_MODE = rollyPollyWheelMode;
ROLLY_POLLY_NORMAL_MODE = rollyPollyNormalMode;
ROLLY_POLLY_ROLL = rollyPollyRoll;
}
}
@@ -114,6 +114,7 @@ public final class AntarchyTags {
public static final class Fluids {
public static final TagKey<Fluid> LUMEN = TagKey.create(Registries.FLUID, id("lumen"));
public static final TagKey<Fluid> GIANT_LILY_PAD_SUPPORTING_FLUIDS = TagKey.create(Registries.FLUID, id("giant_lily_pad_supporting_fluids"));
public static final TagKey<Fluid> ANTIWATER = TagKey.create(Registries.FLUID, id("antiwater"));
private Fluids() {
}
@@ -324,7 +324,7 @@ public class BedBugEntity extends Animal implements GeoEntity {
return state.setAndContinue(BITE_ANIM);
}
if (this.getDeltaMovement().horizontalDistanceSqr() > 0.003D) {
if (state.isMoving()) {
state.getController().setAnimationSpeed(1.15D);
return state.setAndContinue(WALK_ANIM);
}
@@ -106,7 +106,7 @@ public class EmperorScorpionEntity extends Monster implements GeoEntity {
private int attackAnimTicks;
private int clawCooldownTicks;
private int stingCooldownTicks;
private int hardenCooldownTicks = AntarchySettings.emperorScorpionSummonIntervalTicks();
private int hardenCooldownTicks = AntarchySettings.emperorScorpionHardenCooldownTicks();
private int hardenCastTicks;
private int hardenCastSpawnTicks;
private int hardenStateTicks;
@@ -331,7 +331,8 @@ public class EmperorScorpionEntity extends Monster implements GeoEntity {
switch (this.getHardenPhase()) {
case CASTING -> {
if (this.hardenCastTicks % this.hardenCastSpawnTicks == 0
&& this.hardenSummonedScorpions < AntarchySettings.emperorScorpionMaxSummonedScorpions()) {
&& this.hardenSummonedScorpions < AntarchySettings.emperorScorpionMaxSummonedScorpions()
&& this.countNearbyScorpionMinions() < AntarchySettings.emperorScorpionMaxNearbyScorpions()) {
this.summonScorpionMinion();
this.hardenSummonedScorpions++;
if (this.hardenSummonedScorpions >= AntarchySettings.emperorScorpionMaxSummonedScorpions()) {
@@ -407,6 +408,16 @@ public class EmperorScorpionEntity extends Monster implements GeoEntity {
this.setAggressive(false);
}
private static final double NEARBY_SCORPION_CHECK_RADIUS = 24.0D;
private int countNearbyScorpionMinions() {
return this.level().getEntitiesOfClass(
ScorpionEntity.class,
this.getBoundingBox().inflate(NEARBY_SCORPION_CHECK_RADIUS),
Entity::isAlive
).size();
}
private void summonScorpionMinion() {
if (!(this.level() instanceof ServerLevel serverLevel)) {
return;
@@ -318,7 +318,7 @@ public class HerculesBeetleEntity extends TamableAnimal implements GeoEntity, Fl
this.flightCooldown--;
}
if (this.isFlying() && this.tickCount % 16 == 0) {
if (this.isFlying() && this.tickCount % 32 == 0) {
this.playSound(AntarchySoundEvents.MANTIS_FLY_LOOP.get(), 0.5F, 0.85F + this.random.nextFloat() * 0.1F);
}
@@ -2,6 +2,7 @@ package com.craisinlord.antarchy.content.entity;
import com.craisinlord.antarchy.config.AntarchySettings;
import com.craisinlord.antarchy.content.AntarchyObjects;
import com.craisinlord.antarchy.content.AntarchyTags;
import java.util.UUID;
import net.minecraft.core.particles.DustParticleOptions;
import net.minecraft.nbt.CompoundTag;
@@ -9,6 +10,7 @@ import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.projectile.ThrowableItemProjectile;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.Items;
@@ -20,10 +22,13 @@ import net.minecraft.world.phys.Vec3;
public class HushProjectileEntity extends ThrowableItemProjectile {
private static final int DREAD_DURATION_TICKS = 300;
private static final double TRAVEL_SPEED = 0.27D;
private static final int RETARGET_GRACE_TICKS = 60;
private static final double RETARGET_SEARCH_RADIUS = 16.0D;
private static final DustParticleOptions HUSH_PARTICLES = new DustParticleOptions(new org.joml.Vector3f(1.0F, 0.05F, 0.05F), 1.0F);
private static final String TARGET_UUID_KEY = "HushTarget";
private UUID targetUuid;
private int retargetGraceTicksRemaining;
public HushProjectileEntity(EntityType<? extends HushProjectileEntity> entityType, Level level) {
super(entityType, level);
@@ -85,9 +90,23 @@ public class HushProjectileEntity extends ThrowableItemProjectile {
this.getBoundingBox().inflate(48.0D),
entity -> entity.isAlive() && entity.getUUID().equals(this.targetUuid)
).stream().findFirst().orElse(null);
if (target == null) {
this.discard();
return;
target = this.findReplacementTarget();
if (target != null) {
this.targetUuid = target.getUUID();
this.retargetGraceTicksRemaining = 0;
} else {
if (this.retargetGraceTicksRemaining <= 0) {
this.retargetGraceTicksRemaining = RETARGET_GRACE_TICKS;
}
if (--this.retargetGraceTicksRemaining <= 0) {
this.discard();
}
return;
}
} else {
this.retargetGraceTicksRemaining = 0;
}
Vec3 toTarget = target.getEyePosition().subtract(this.position());
@@ -101,6 +120,19 @@ public class HushProjectileEntity extends ThrowableItemProjectile {
this.setDeltaMovement(this.getDeltaMovement().lerp(desired, 0.1D));
}
private LivingEntity findReplacementTarget() {
return this.level().getEntitiesOfClass(
LivingEntity.class,
this.getBoundingBox().inflate(RETARGET_SEARCH_RADIUS),
entity -> entity.isAlive()
&& !entity.getUUID().equals(this.targetUuid)
&& entity.getType().is(AntarchyTags.Entities.HUSHWEED_TARGETS)
&& (!(entity instanceof Player player) || (!player.isCreative() && !player.isSpectator())))
.stream()
.min(java.util.Comparator.comparingDouble(this::distanceToSqr))
.orElse(null);
}
@Override
protected void onHitEntity(EntityHitResult result) {
super.onHitEntity(result);
@@ -165,7 +165,7 @@ public class LurkingTerrorEntity extends Monster implements GeoEntity {
@Override
public void tick() {
super.tick();
if (!this.level().isClientSide() && !this.onGround() && this.tickCount % 40 == 0) {
if (!this.level().isClientSide() && !this.onGround() && this.tickCount % 80 == 0) {
this.playSound(AntarchySoundEvents.LURKING_TERROR_FLY_LOOP.get(), 0.45F, 0.95F + this.random.nextFloat() * 0.1F);
}
if (!this.level().isClientSide() && attackAnimTicks > 0) attackAnimTicks--;
@@ -206,7 +206,7 @@ public class MantisEntity extends Monster implements GeoEntity {
if (this.flyBurstTicks > 0) {
this.flyBurstTicks--;
if (this.flyBurstTicks % 8 == 0) {
if (this.flyBurstTicks % 16 == 0) {
this.playSound(AntarchySoundEvents.MANTIS_FLY_LOOP.get(), 0.45F, 0.95F + this.random.nextFloat() * 0.1F);
}
}
@@ -1,5 +1,6 @@
package com.craisinlord.antarchy.content.entity;
import com.craisinlord.antarchy.Antarchy;
import com.craisinlord.antarchy.config.AntarchySettings;
import com.craisinlord.antarchy.content.AntarchyTags;
import com.craisinlord.antarchy.content.AntarchySoundEvents;
@@ -12,25 +13,27 @@ import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.syncher.EntityDataAccessor;
import net.minecraft.network.syncher.EntityDataSerializers;
import net.minecraft.network.syncher.SynchedEntityData;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.tags.BlockTags;
import net.minecraft.tags.DamageTypeTags;
import net.minecraft.advancements.CriteriaTriggers;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.AgeableMob;
import net.minecraft.world.entity.Entity;
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.AttributeInstance;
import net.minecraft.world.entity.ai.attributes.AttributeModifier;
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.FollowOwnerGoal;
import net.minecraft.world.entity.ai.goal.Goal;
import net.minecraft.world.entity.ai.goal.LookAtPlayerGoal;
import net.minecraft.world.entity.ai.goal.MoveToBlockGoal;
@@ -38,6 +41,8 @@ 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.goal.target.OwnerHurtByTargetGoal;
import net.minecraft.world.entity.ai.goal.target.OwnerHurtTargetGoal;
import net.minecraft.world.entity.ai.util.DefaultRandomPos;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.player.Player;
@@ -77,7 +82,9 @@ public class RollyPollyEntity extends TamableAnimal implements GeoEntity {
private static final int ROLL_UP_TICKS = 15;
private static final int UNROLL_TICKS = 9;
private static final int DEFENSIVE_CURL_TICKS = 100;
private static final int TUMBLE_DAMAGE_INTERVAL_TICKS = 30;
private static final int ROLL_SOUND_INTERVAL_TICKS = 25;
private static final ResourceLocation ROLLED_ARMOR_MODIFIER_ID =
ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "rolly_polly_rolled_armor");
private static final EntityDataAccessor<Integer> ANIMATION_STATE =
SynchedEntityData.defineId(RollyPollyEntity.class, EntityDataSerializers.INT);
@@ -89,8 +96,8 @@ public class RollyPollyEntity extends TamableAnimal implements GeoEntity {
private int rollTransitionTicks;
private boolean unrolling;
private int defensiveCurlTicks;
private int tumbleTicks;
private boolean hasCompost;
private int rollSoundCooldown;
public RollyPollyEntity(EntityType<? extends RollyPollyEntity> entityType, Level level) {
super(entityType, level);
@@ -108,6 +115,8 @@ public class RollyPollyEntity extends TamableAnimal implements GeoEntity {
return Mob.createMobAttributes()
.add(Attributes.MAX_HEALTH, AntarchySettings.rollyPollyHealth())
.add(Attributes.MOVEMENT_SPEED, AntarchySettings.rollyPollyMovementSpeed())
.add(Attributes.ATTACK_DAMAGE, AntarchySettings.rollyPollyBowlingDamage())
.add(Attributes.ARMOR, AntarchySettings.rollyPollyArmor())
.add(Attributes.FOLLOW_RANGE, 16.0D);
}
@@ -128,24 +137,28 @@ public class RollyPollyEntity extends TamableAnimal implements GeoEntity {
return !RollyPollyEntity.this.isRolled() && !RollyPollyEntity.this.isTame() && super.canUse();
}
});
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) {
this.goalSelector.addGoal(2, new BowlingAttackGoal());
this.goalSelector.addGoal(3, new FertilizeCropGoal());
this.goalSelector.addGoal(4, new EatCompostItemGoal());
this.goalSelector.addGoal(5, new SnuggleOnBedGoal());
this.goalSelector.addGoal(6, 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(6, new RollingStrollGoal());
this.goalSelector.addGoal(7, new WaterAvoidingRandomStrollGoal(this, 1.0D) {
this.goalSelector.addGoal(7, new FollowOwnerGoal(this, 1.1D, 10.0F, 2.0F));
this.goalSelector.addGoal(8, new RollingStrollGoal());
this.goalSelector.addGoal(9, new WaterAvoidingRandomStrollGoal(this, 1.0D) {
@Override
public boolean canUse() {
return !RollyPollyEntity.this.isRolled() && !RollyPollyEntity.this.isVehicle() && super.canUse();
return !RollyPollyEntity.this.isRolled() && super.canUse();
}
});
this.goalSelector.addGoal(8, new LookAtPlayerGoal(this, Player.class, 8.0F));
this.goalSelector.addGoal(9, new RandomLookAroundGoal(this));
this.goalSelector.addGoal(10, new LookAtPlayerGoal(this, Player.class, 8.0F));
this.goalSelector.addGoal(11, new RandomLookAroundGoal(this));
this.targetSelector.addGoal(1, new OwnerHurtByTargetGoal(this));
this.targetSelector.addGoal(2, new OwnerHurtTargetGoal(this));
}
@Override
@@ -198,13 +211,6 @@ public class RollyPollyEntity extends TamableAnimal implements GeoEntity {
return InteractionResult.sidedSuccess(this.level().isClientSide);
}
if (this.isTame() && stack.isEmpty() && !player.isShiftKeyDown() && !player.isPassengerOfSameVehicle(this)) {
if (!this.level().isClientSide) {
player.startRiding(this);
}
return InteractionResult.sidedSuccess(this.level().isClientSide);
}
return super.mobInteract(player, hand);
}
@@ -235,34 +241,36 @@ public class RollyPollyEntity extends TamableAnimal implements GeoEntity {
this.entityData.set(ROLLED, rolled);
}
/** Toggles wheel mode; called from the ridden-roll keybind payload. */
public void handleRollToggle(ServerPlayer player) {
if (!this.isTame() || this.getControllingPassenger() != player) {
return;
}
if (this.rollTransitionTicks > 0) {
return;
}
if (this.isRolled()) {
this.startUnroll();
} else {
this.startRollUp();
}
}
private void startRollUp() {
this.setRolled(true);
this.unrolling = false;
this.rollTransitionTicks = ROLL_UP_TICKS;
this.setAnimationState(ANIM_ROLL_UP);
this.playSound(SoundEvents.ARMADILLO_ROLL, 0.8F, 1.0F);
this.playSound(AntarchySoundEvents.ROLLY_POLLY_WHEEL_MODE.get(), 0.8F, 1.0F);
this.applyRolledArmorBonus();
}
private void startUnroll() {
this.unrolling = true;
this.rollTransitionTicks = UNROLL_TICKS;
this.setAnimationState(ANIM_UNROLL);
this.playSound(SoundEvents.ARMADILLO_UNROLL_START, 0.8F, 1.0F);
this.playSound(AntarchySoundEvents.ROLLY_POLLY_NORMAL_MODE.get(), 0.8F, 1.0F);
this.removeRolledArmorBonus();
}
private void applyRolledArmorBonus() {
AttributeInstance armor = this.getAttribute(Attributes.ARMOR);
if (armor != null && armor.getModifier(ROLLED_ARMOR_MODIFIER_ID) == null) {
armor.addTransientModifier(new AttributeModifier(
ROLLED_ARMOR_MODIFIER_ID, AntarchySettings.rollyPollyRolledArmorBonus(), AttributeModifier.Operation.ADD_VALUE));
}
}
private void removeRolledArmorBonus() {
AttributeInstance armor = this.getAttribute(Attributes.ARMOR);
if (armor != null) {
armor.removeModifier(ROLLED_ARMOR_MODIFIER_ID);
}
}
@Override
@@ -272,14 +280,14 @@ public class RollyPollyEntity extends TamableAnimal implements GeoEntity {
private void stopDefensiveCurl() {
this.defensiveCurlTicks = 0;
if (this.isRolled() && !this.isVehicle()) {
if (this.isRolled()) {
this.startUnroll();
}
}
@Override
public boolean hurt(DamageSource source, float amount) {
if (this.isRolled()) {
if (this.isRolled() && source.is(DamageTypeTags.IS_PROJECTILE)) {
amount *= 0.25F;
}
boolean hurt = super.hurt(source, amount);
@@ -313,29 +321,27 @@ public class RollyPollyEntity extends TamableAnimal implements GeoEntity {
if (this.defensiveCurlTicks > 0) {
this.defensiveCurlTicks--;
this.getNavigation().stop();
if (this.defensiveCurlTicks <= 0 && this.isRolled() && !this.isVehicle()) {
if (this.defensiveCurlTicks <= 0 && this.isRolled()) {
this.startUnroll();
}
}
this.tickTumbleDamage();
this.tickRollSound();
}
private void tickTumbleDamage() {
if (!this.isRolled() || this.rollTransitionTicks > 0
|| !(this.getControllingPassenger() instanceof Player rider)) {
this.tumbleTicks = 0;
private void tickRollSound() {
if (!this.isRolled() || this.rollTransitionTicks > 0 || this.getDeltaMovement().horizontalDistanceSqr() <= 0.003D) {
this.rollSoundCooldown = 0;
return;
}
boolean moving = this.getDeltaMovement().horizontalDistanceSqr() > 0.003D;
boolean helmeted = !rider.getItemBySlot(EquipmentSlot.HEAD).isEmpty();
if (!moving || helmeted) {
if (this.rollSoundCooldown > 0) {
this.rollSoundCooldown--;
return;
}
if (++this.tumbleTicks >= TUMBLE_DAMAGE_INTERVAL_TICKS) {
this.tumbleTicks = 0;
rider.hurt(this.damageSources().generic(), (float) AntarchySettings.rollyPollyTumbleDamage());
}
this.rollSoundCooldown = ROLL_SOUND_INTERVAL_TICKS;
this.playSound(AntarchySoundEvents.ROLLY_POLLY_ROLL.get(), 0.7F, 0.9F + this.random.nextFloat() * 0.2F);
}
private int getAnimationState() {
@@ -346,70 +352,15 @@ public class RollyPollyEntity extends TamableAnimal implements GeoEntity {
this.entityData.set(ANIMATION_STATE, state);
}
@Override
@Nullable
public LivingEntity getControllingPassenger() {
if (!this.isTame()) {
return null;
}
Entity passenger = this.getFirstPassenger();
return passenger instanceof LivingEntity living ? living : null;
}
@Override
public boolean canAddPassenger(Entity passenger) {
return this.getPassengers().isEmpty();
}
@Override
protected void positionRider(Entity passenger, MoveFunction moveFunction) {
if (this.hasPassenger(passenger)) {
// When rolled the rider tucks into the center of the ball; otherwise sits on the shell
double yOffset = this.isRolled() ? -0.25D : 0.45D;
moveFunction.accept(passenger, this.getX(), this.getY() + yOffset, this.getZ());
}
}
@Override
public void travel(Vec3 travelVector) {
if (this.defensiveCurlTicks > 0 && !this.isVehicle()) {
if (this.defensiveCurlTicks > 0) {
super.travel(Vec3.ZERO);
return;
}
super.travel(travelVector);
}
@Override
protected void tickRidden(Player player, Vec3 travelVector) {
super.tickRidden(player, travelVector);
this.setRot(player.getYHeadRot(), player.getXRot() * 0.5F);
this.yRotO = this.yBodyRot = this.yHeadRot = this.getYRot();
}
@Override
protected Vec3 getRiddenInput(Player player, Vec3 travelVector) {
if (this.rollTransitionTicks > 0) {
// Hold still while rolling up / unrolling
return Vec3.ZERO;
}
float forward = player.zza;
float strafe = player.xxa * 0.5F;
if (forward < 0.0F) {
forward *= 0.4F;
}
if (this.isRolled()) {
// Rolling is fast but drifty
strafe *= 0.35F;
}
return new Vec3(strafe, 0.0D, forward);
}
@Override
protected float getRiddenSpeed(Player player) {
return (float) (this.getAttributeValue(Attributes.MOVEMENT_SPEED)
* (this.isRolled() ? AntarchySettings.rollyPollyRollSpeedMultiplier() : 1.0D));
}
@Override
public boolean causeFallDamage(float fallDistance, float multiplier, DamageSource damageSource) {
if (this.isRolled()) {
@@ -483,7 +434,6 @@ public class RollyPollyEntity extends TamableAnimal implements GeoEntity {
public boolean canUse() {
if (RollyPollyEntity.this.hasCompost
|| RollyPollyEntity.this.isRolled()
|| RollyPollyEntity.this.isVehicle()
|| RollyPollyEntity.this.defensiveCurlTicks > 0) {
return false;
}
@@ -500,7 +450,6 @@ public class RollyPollyEntity extends TamableAnimal implements GeoEntity {
public boolean canContinueToUse() {
return !RollyPollyEntity.this.hasCompost
&& !RollyPollyEntity.this.isRolled()
&& !RollyPollyEntity.this.isVehicle()
&& this.targetItem != null
&& this.targetItem.isAlive()
&& isCompostable(this.targetItem.getItem());
@@ -571,7 +520,6 @@ public class RollyPollyEntity extends TamableAnimal implements GeoEntity {
public boolean canUse() {
return RollyPollyEntity.this.hasCompost
&& !RollyPollyEntity.this.isRolled()
&& !RollyPollyEntity.this.isVehicle()
&& RollyPollyEntity.this.defensiveCurlTicks <= 0
&& super.canUse();
}
@@ -579,7 +527,6 @@ public class RollyPollyEntity extends TamableAnimal implements GeoEntity {
@Override
public boolean canContinueToUse() {
return RollyPollyEntity.this.hasCompost
&& !RollyPollyEntity.this.isVehicle()
&& super.canContinueToUse();
}
@@ -653,6 +600,84 @@ public class RollyPollyEntity extends TamableAnimal implements GeoEntity {
}
}
private class BowlingAttackGoal extends Goal {
private static final double CHARGE_SPEED = 1.3D;
private static final double HIT_RANGE_SQR = 1.75D * 1.75D;
private static final int ATTACK_COOLDOWN_TICKS = 20;
private int attackCooldown;
BowlingAttackGoal() {
this.setFlags(EnumSet.of(Goal.Flag.MOVE, Goal.Flag.LOOK));
}
@Override
public boolean canUse() {
LivingEntity target = RollyPollyEntity.this.getTarget();
return RollyPollyEntity.this.isTame()
&& target != null
&& target.isAlive();
}
@Override
public boolean canContinueToUse() {
return this.canUse();
}
@Override
public void start() {
this.attackCooldown = 0;
if (!RollyPollyEntity.this.isRolled() && RollyPollyEntity.this.rollTransitionTicks <= 0) {
RollyPollyEntity.this.startRollUp();
}
}
@Override
public void stop() {
RollyPollyEntity.this.getNavigation().stop();
if (RollyPollyEntity.this.isRolled() && RollyPollyEntity.this.rollTransitionTicks <= 0) {
RollyPollyEntity.this.startUnroll();
}
}
@Override
public void tick() {
LivingEntity target = RollyPollyEntity.this.getTarget();
if (target == null) {
return;
}
RollyPollyEntity.this.getLookControl().setLookAt(target, 30.0F, 30.0F);
if (this.attackCooldown > 0) {
this.attackCooldown--;
}
if (!RollyPollyEntity.this.isRolled() || RollyPollyEntity.this.rollTransitionTicks > 0) {
return;
}
RollyPollyEntity.this.getNavigation().moveTo(target, CHARGE_SPEED);
if (this.attackCooldown <= 0 && RollyPollyEntity.this.distanceToSqr(target) <= HIT_RANGE_SQR) {
this.attackCooldown = ATTACK_COOLDOWN_TICKS;
this.performBowlingHit(target);
}
}
private void performBowlingHit(LivingEntity target) {
boolean hurt = target.hurt(RollyPollyEntity.this.damageSources().mobAttack(RollyPollyEntity.this), (float) RollyPollyEntity.this.getAttributeValue(Attributes.ATTACK_DAMAGE));
if (!hurt) {
return;
}
double dx = RollyPollyEntity.this.getX() - target.getX();
double dz = RollyPollyEntity.this.getZ() - target.getZ();
target.knockback(AntarchySettings.rollyPollyBowlingKnockback(), dx, dz);
RollyPollyEntity.this.playSound(AntarchySoundEvents.ROLLY_POLLY_ROLL.get(), 1.0F, 0.8F + RollyPollyEntity.this.random.nextFloat() * 0.2F);
}
}
private class RollingStrollGoal extends Goal {
@Nullable
private Vec3 targetPos;
@@ -668,7 +693,6 @@ public class RollyPollyEntity extends TamableAnimal implements GeoEntity {
@Override
public boolean canUse() {
if (RollyPollyEntity.this.isRolled()
|| RollyPollyEntity.this.isVehicle()
|| RollyPollyEntity.this.defensiveCurlTicks > 0
|| RollyPollyEntity.this.hasCompost
|| RollyPollyEntity.this.rollTransitionTicks > 0) {
@@ -685,7 +709,6 @@ public class RollyPollyEntity extends TamableAnimal implements GeoEntity {
public boolean canContinueToUse() {
return !this.finished
&& this.rollingTicks < this.maxRollingTicks
&& !RollyPollyEntity.this.isVehicle()
&& !RollyPollyEntity.this.hasCompost;
}
@@ -739,7 +762,7 @@ public class RollyPollyEntity extends TamableAnimal implements GeoEntity {
@Override
public boolean canUse() {
if (!RollyPollyEntity.this.isTame() || RollyPollyEntity.this.isVehicle()) {
if (!RollyPollyEntity.this.isTame()) {
return false;
}
if (!(RollyPollyEntity.this.getOwner() instanceof Player player) || !player.isSleeping()) {
@@ -763,7 +786,6 @@ public class RollyPollyEntity extends TamableAnimal implements GeoEntity {
@Override
public boolean canContinueToUse() {
return RollyPollyEntity.this.isTame()
&& !RollyPollyEntity.this.isVehicle()
&& this.ownerPlayer != null
&& this.ownerPlayer.isSleeping()
&& this.bedPos != null;
@@ -88,7 +88,7 @@ public class StinkBugEntity extends Animal implements GeoEntity {
if (this.fartAnimationTicks > 0) {
this.fartAnimationTicks--;
if (this.fartAnimationTicks == FART_RELEASE_TICKS && this.pendingFartBurst && !this.level().isClientSide()) {
this.playSound(AntarchySoundEvents.STINK_BUG_FART.get(), 0.85F, 0.9F + this.random.nextFloat() * 0.1F);
this.playSound(AntarchySoundEvents.STINK_BUG_FART.get(), 1.7F, 0.9F + this.random.nextFloat() * 0.1F);
StinkyBehavior.emitBurst(this, STINK_BURST_PARTICLES);
StinkyBehavior.applyBurstStinkyEffect(this, STINK_BURST_RADIUS, STINK_BURST_DURATION_TICKS);
this.pendingFartBurst = false;
@@ -10,6 +10,7 @@ import net.minecraft.core.Direction;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.sounds.SoundSource;
import net.minecraft.stats.Stats;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.effect.MobEffectInstance;
@@ -58,6 +59,7 @@ public final class CorneaEarItem extends Item {
}
level.setBlock(plantPos, stalkState, Block.UPDATE_ALL);
level.playSound(null, plantPos, stalkState.getSoundType().getPlaceSound(), SoundSource.BLOCKS, 1.0F, 1.0F);
ItemStack stack = context.getItemInHand();
Player player = context.getPlayer();
if (player == null || !player.getAbilities().instabuild) {
@@ -1,20 +0,0 @@
package com.craisinlord.antarchy.content.network;
import com.craisinlord.antarchy.Antarchy;
import io.netty.buffer.ByteBuf;
import net.minecraft.network.codec.StreamCodec;
import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
import net.minecraft.resources.ResourceLocation;
/** C2S: the rider pressed the roll keybind — toggle the rolly polly's wheel mode. */
public record RollyPollyRollPayload() implements CustomPacketPayload {
public static final Type<RollyPollyRollPayload> TYPE =
new Type<>(ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "rolly_polly_roll"));
public static final StreamCodec<ByteBuf, RollyPollyRollPayload> STREAM_CODEC =
StreamCodec.unit(new RollyPollyRollPayload());
@Override
public Type<RollyPollyRollPayload> type() {
return TYPE;
}
}
@@ -1,10 +1,56 @@
package com.craisinlord.antarchy.content.worldgen.ants;
import com.craisinlord.antarchy.Antarchy;
import com.mojang.serialization.Codec;
import java.util.Optional;
import net.minecraft.core.BlockPos;
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.Blocks;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.feature.configurations.SimpleBlockConfiguration;
public class TermiteNestFeature extends SurfaceAntNestFeature {
private static final ResourceLocation MYRMITE_ID = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "myrmite");
private static final ResourceLocation BROODSTONE_ID = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "broodstone");
public TermiteNestFeature(Codec<SimpleBlockConfiguration> codec) {
super(codec);
}
@Override
protected boolean isValidNestGround(BlockState nestGroundState) {
return super.isValidNestGround(nestGroundState)
|| nestGroundState.is(getBlock(MYRMITE_ID))
|| nestGroundState.is(getBlock(BROODSTONE_ID));
}
@Override
protected void decorateAroundNest(WorldGenLevel level, BlockPos center, RandomSource random) {
for (int xOffset = -1; xOffset <= 1; xOffset++) {
for (int zOffset = -1; zOffset <= 1; zOffset++) {
if (xOffset == 0 && zOffset == 0) {
continue;
}
if (Math.abs(xOffset) == 1 && Math.abs(zOffset) == 1 && random.nextBoolean()) {
continue;
}
BlockPos targetPos = center.offset(xOffset, 0, zOffset);
BlockState targetState = level.getBlockState(targetPos);
if (this.isValidNestGround(targetState)) {
level.setBlock(targetPos, Blocks.ROOTED_DIRT.defaultBlockState(), 2);
}
}
}
}
private static Block getBlock(ResourceLocation id) {
Optional<Block> block = BuiltInRegistries.BLOCK.getOptional(id);
return block.orElse(null);
}
}
@@ -29,6 +29,8 @@ public final class CavarynBileVeinFeature extends Feature<NoneFeatureConfigurati
private static final int VERTICAL_SCAN = 12;
private static final float BRANCH_CHANCE = 0.12f;
private static final float LIQUID_POCKET_CHANCE = 0.008f;
private static final int MAX_DISTANCE_FROM_START = 16;
private static final int MAX_DISTANCE_FROM_START_SQR = MAX_DISTANCE_FROM_START * MAX_DISTANCE_FROM_START;
public CavarynBileVeinFeature(Codec<NoneFeatureConfiguration> codec) {
super(codec);
@@ -36,21 +38,25 @@ public final class CavarynBileVeinFeature extends Feature<NoneFeatureConfigurati
@Override
public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> context) {
Block bileVeinBlock = getBlock(BILE_VEIN_ID);
Block bileBlock = getBlock(BILE_ID);
if (bileVeinBlock == null || !(bileBlock instanceof LiquidBlock)) {
try {
Block bileVeinBlock = getBlock(BILE_VEIN_ID);
Block bileBlock = getBlock(BILE_ID);
if (bileVeinBlock == null || !(bileBlock instanceof LiquidBlock)) {
return false;
}
WorldGenLevel level = context.level();
RandomSource random = context.random();
BlockPos start = findStart(level, context.origin(), random);
if (start == null) {
return false;
}
return growVeinNetwork(level, start, bileVeinBlock, bileBlock, random);
} catch (RuntimeException exception) {
return false;
}
WorldGenLevel level = context.level();
RandomSource random = context.random();
BlockPos start = findStart(level, context.origin(), random);
if (start == null) {
return false;
}
return growVeinNetwork(level, start, bileVeinBlock, bileBlock, random);
}
private static BlockPos findStart(WorldGenLevel level, BlockPos origin, RandomSource random) {
@@ -81,12 +87,12 @@ public final class CavarynBileVeinFeature extends Feature<NoneFeatureConfigurati
boolean placedAny = false;
Direction mainDir = Direction.values()[random.nextInt(6)];
placedAny |= growArm(level, start, mainDir, 45 + random.nextInt(25), visited, pendingBranches, veinBlock, bileBlock, random);
placedAny |= growArm(level, start, start, mainDir, 45 + random.nextInt(25), visited, pendingBranches, veinBlock, bileBlock, random);
for (BranchStart branch : pendingBranches) {
Direction branchDir = perpendiculars(branch.dir())[random.nextInt(4)];
int branchLen = 15 + random.nextInt(20);
growArm(level, branch.pos(), branchDir, branchLen, visited, null, veinBlock, bileBlock, random);
growArm(level, start, branch.pos(), branchDir, branchLen, visited, null, veinBlock, bileBlock, random);
}
return placedAny;
@@ -94,6 +100,7 @@ public final class CavarynBileVeinFeature extends Feature<NoneFeatureConfigurati
private boolean growArm(
WorldGenLevel level,
BlockPos networkOrigin,
BlockPos start,
Direction initialDir,
int maxSteps,
@@ -108,6 +115,10 @@ public final class CavarynBileVeinFeature extends Feature<NoneFeatureConfigurati
boolean placedAny = false;
for (int step = 0; step < maxSteps; step++) {
if (current.distSqr(networkOrigin) > MAX_DISTANCE_FROM_START_SQR) {
break;
}
if (visited.contains(current)) {
current = current.relative(biasedNextDir(dir, random));
continue;
@@ -0,0 +1,27 @@
package com.craisinlord.antarchy.mixins;
import com.craisinlord.antarchy.Antarchy;
import com.craisinlord.antarchy.config.AntarchySettings;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.item.FallingBlockEntity;
import net.minecraft.world.level.block.state.BlockState;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(FallingBlockEntity.class)
public abstract class DreamSandFallingSpeedMixin {
private static final ResourceLocation DREAM_SAND_ID = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "dream_sand");
@Shadow public abstract BlockState getBlockState();
@Inject(method = "getDefaultGravity", at = @At("RETURN"), cancellable = true)
private void antarchy$slowDreamSandFall(CallbackInfoReturnable<Double> cir) {
if (BuiltInRegistries.BLOCK.getKey(this.getBlockState().getBlock()).equals(DREAM_SAND_ID)) {
cir.setReturnValue(cir.getReturnValue() * AntarchySettings.dreamSandFallingBlockGravityMultiplier());
}
}
}
@@ -0,0 +1,18 @@
package com.craisinlord.antarchy.mixins;
import com.craisinlord.antarchy.config.AntarchySettings;
import net.minecraft.world.level.storage.LevelSummary;
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(value = LevelSummary.class, priority = 1001)
public abstract class ExperimentalSettingsLevelSummaryMixin {
@Inject(method = "isExperimental", at = @At("RETURN"), cancellable = true)
private void antarchy$hideExperimentalStatus(CallbackInfoReturnable<Boolean> cir) {
if (AntarchySettings.experimentalSettingsPopupDisabled()) {
cir.setReturnValue(false);
}
}
}
@@ -0,0 +1,76 @@
package com.craisinlord.antarchy.mixins;
import com.craisinlord.antarchy.content.AntarchyTags;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.BucketPickup;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.LiquidBlock;
import net.minecraft.world.level.block.SpongeBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.FluidState;
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(SpongeBlock.class)
public abstract class SpongeAntiwaterMixin {
private static final int MAX_DEPTH = 6;
private static final int MAX_COUNT = 65;
private static final Direction[] ALL_DIRECTIONS = Direction.values();
@Inject(method = "tryAbsorbWater", at = @At("TAIL"))
private void antarchy$tryAbsorbAntiwater(Level level, BlockPos pos, CallbackInfo ci) {
if (!level.getBlockState(pos).is(Blocks.SPONGE)) {
return;
}
if (antarchy$removeAntiwaterBreadthFirstSearch(level, pos) > 1) {
level.setBlock(pos, Blocks.WET_SPONGE.defaultBlockState(), 2);
level.playSound(null, pos, SoundEvents.SPONGE_ABSORB, SoundSource.BLOCKS, 1.0F, 1.0F);
}
}
private static int antarchy$removeAntiwaterBreadthFirstSearch(Level level, BlockPos origin) {
return BlockPos.breadthFirstTraversal(
origin,
MAX_DEPTH,
MAX_COUNT,
(pos, consumer) -> {
for (Direction direction : ALL_DIRECTIONS) {
consumer.accept(pos.relative(direction));
}
},
pos -> antarchy$tryRemoveAntiwaterAt(level, origin, pos)
);
}
private static boolean antarchy$tryRemoveAntiwaterAt(Level level, BlockPos origin, BlockPos pos) {
if (pos.equals(origin)) {
return true;
}
BlockState state = level.getBlockState(pos);
FluidState fluidState = level.getFluidState(pos);
if (!fluidState.is(AntarchyTags.Fluids.ANTIWATER)) {
return false;
}
Block block = state.getBlock();
if (block instanceof BucketPickup bucketPickup && !bucketPickup.pickupBlock(null, level, pos, state).isEmpty()) {
return true;
}
if (block instanceof LiquidBlock) {
level.setBlock(pos, Blocks.AIR.defaultBlockState(), 3);
return true;
}
return false;
}
}
@@ -0,0 +1,22 @@
package com.craisinlord.antarchy.mixins.client;
import com.craisinlord.antarchy.config.AntarchySettings;
import com.mojang.serialization.Lifecycle;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.worldselection.CreateWorldScreen;
import net.minecraft.client.gui.screens.worldselection.WorldOpenFlows;
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(WorldOpenFlows.class)
public abstract class ExperimentalSettingsPopupMixin {
@Inject(method = "confirmWorldCreation", at = @At("HEAD"), cancellable = true)
private static void antarchy$skipExperimentalSettingsPopup(Minecraft minecraft, CreateWorldScreen screen, Lifecycle lifecycle, Runnable callback, boolean skipWarnings, CallbackInfo ci) {
if (AntarchySettings.experimentalSettingsPopupDisabled() && lifecycle == Lifecycle.experimental() && !skipWarnings) {
callback.run();
ci.cancel();
}
}
}
@@ -10,6 +10,7 @@
"BlockEntityTypeSignMixin",
"BloodglassMixin",
"DreamFireBlockMixin",
"DreamSandFallingSpeedMixin",
"DreamSandLowGravityMixin",
"FireVisualBaseFireBlockMixin",
"FireVisualEntityMixin",
@@ -18,11 +19,13 @@
"FrogVariantBootstrapMixin",
"GlowSquidLumenSpawnMixin",
"GlowVinesUnderLeavesMixin",
"ExperimentalSettingsLevelSummaryMixin",
"NightmareSwordDamageMixin",
"PotionBrewingMixin",
"VillagerTradesMixin",
"WaterlilyLumenMixin",
"ServerPlayerGameModeMixin",
"SpongeAntiwaterMixin",
"SquidzookaEnchantMixin",
"SquidzookaMultishotMixin",
"gravity.AbstractArrowGravityMixin",
@@ -61,6 +64,7 @@
"client.ElytraModelAccessor",
"client.FrogRendererElythiaMixin",
"client.GameRendererSwingThroughGrassMixin",
"client.ExperimentalSettingsPopupMixin",
"client.KrakensGraspChargePoseMixin",
"client.LightningBoltRendererMixin",
"client.MountedVehicleCameraMixin",
@@ -924,6 +924,9 @@
"subtitles.antarchy.stink_bug_fart": "Stinkwanze furzt",
"subtitles.antarchy.stink_bug_idle": "Stinkwanze ist zu hören",
"subtitles.antarchy.rolly_polly_idle": "Rollassel ist zu hören",
"subtitles.antarchy.rolly_polly_wheel_mode": "Rollassel rollt sich ein",
"subtitles.antarchy.rolly_polly_normal_mode": "Rollassel rollt sich aus",
"subtitles.antarchy.rolly_polly_roll": "Rollassel rollt",
"subtitles.antarchy.hercules_beetle_idle": "Herkuleskäfer ist zu hören",
"subtitles.antarchy.hercules_beetle_hurt": "Herkuleskäfer wird verletzt",
"subtitles.antarchy.hercules_beetle_attack": "Herkuleskäfer greift an",
@@ -925,6 +925,9 @@
"subtitles.antarchy.stink_bug_fart": "Stink Bug farts",
"subtitles.antarchy.stink_bug_idle": "Stink Bug idles",
"subtitles.antarchy.rolly_polly_idle": "Rolly Polly idles",
"subtitles.antarchy.rolly_polly_wheel_mode": "Rolly Polly curls up",
"subtitles.antarchy.rolly_polly_normal_mode": "Rolly Polly uncurls",
"subtitles.antarchy.rolly_polly_roll": "Rolly Polly rolls",
"subtitles.antarchy.hercules_beetle_idle": "Hercules Beetle idles",
"subtitles.antarchy.hercules_beetle_hurt": "Hercules Beetle hurts",
"subtitles.antarchy.hercules_beetle_attack": "Hercules Beetle attacks",
@@ -924,6 +924,9 @@
"subtitles.antarchy.stink_bug_fart": "Chinche apestosa se tira un pedo",
"subtitles.antarchy.stink_bug_idle": "Chinche apestosa hace ruido",
"subtitles.antarchy.rolly_polly_idle": "Cochinilla hace ruido",
"subtitles.antarchy.rolly_polly_wheel_mode": "La cochinilla se enrolla",
"subtitles.antarchy.rolly_polly_normal_mode": "La cochinilla se desenrolla",
"subtitles.antarchy.rolly_polly_roll": "La cochinilla rueda",
"subtitles.antarchy.hercules_beetle_idle": "Escarabajo hércules hace ruido",
"subtitles.antarchy.hercules_beetle_hurt": "Escarabajo hércules recibe daño",
"subtitles.antarchy.hercules_beetle_attack": "Escarabajo hércules ataca",
@@ -924,6 +924,9 @@
"subtitles.antarchy.stink_bug_fart": "Punaise puante pète",
"subtitles.antarchy.stink_bug_idle": "Punaise puante se fait entendre",
"subtitles.antarchy.rolly_polly_idle": "Cloporte se fait entendre",
"subtitles.antarchy.rolly_polly_wheel_mode": "Le cloporte s'enroule",
"subtitles.antarchy.rolly_polly_normal_mode": "Le cloporte se déroule",
"subtitles.antarchy.rolly_polly_roll": "Le cloporte roule",
"subtitles.antarchy.hercules_beetle_idle": "Scarabée Hercule se fait entendre",
"subtitles.antarchy.hercules_beetle_hurt": "Scarabée Hercule est blessé",
"subtitles.antarchy.hercules_beetle_attack": "Scarabée Hercule attaque",
@@ -924,6 +924,9 @@
"subtitles.antarchy.stink_bug_fart": "La cimice puzzolente scoreggia",
"subtitles.antarchy.stink_bug_idle": "La cimice puzzolente emette un verso",
"subtitles.antarchy.rolly_polly_idle": "Il porcellino di terra emette un verso",
"subtitles.antarchy.rolly_polly_wheel_mode": "Il porcellino di terra si arrotola",
"subtitles.antarchy.rolly_polly_normal_mode": "Il porcellino di terra si srotola",
"subtitles.antarchy.rolly_polly_roll": "Il porcellino di terra rotola",
"subtitles.antarchy.hercules_beetle_idle": "Lo scarabeo Ercole emette un verso",
"subtitles.antarchy.hercules_beetle_hurt": "Lo scarabeo Ercole si ferisce",
"subtitles.antarchy.hercules_beetle_attack": "Lo scarabeo Ercole attacca",
@@ -924,6 +924,9 @@
"subtitles.antarchy.stink_bug_fart": "カメムシが屁をする",
"subtitles.antarchy.stink_bug_idle": "カメムシが鳴く",
"subtitles.antarchy.rolly_polly_idle": "ダンゴムシが鳴く",
"subtitles.antarchy.rolly_polly_wheel_mode": "ダンゴムシが丸まる",
"subtitles.antarchy.rolly_polly_normal_mode": "ダンゴムシが伸びる",
"subtitles.antarchy.rolly_polly_roll": "ダンゴムシが転がる",
"subtitles.antarchy.hercules_beetle_idle": "ヘラクレスオオカブトが鳴く",
"subtitles.antarchy.hercules_beetle_hurt": "ヘラクレスオオカブトが傷つく",
"subtitles.antarchy.hercules_beetle_attack": "ヘラクレスオオカブトが攻撃する",
@@ -924,6 +924,9 @@
"subtitles.antarchy.stink_bug_fart": "노린재 방귀를 뀝니다",
"subtitles.antarchy.stink_bug_idle": "노린재 소리를 냅니다",
"subtitles.antarchy.rolly_polly_idle": "공벌레 소리를 냅니다",
"subtitles.antarchy.rolly_polly_wheel_mode": "공벌레가 몸을 맙니다",
"subtitles.antarchy.rolly_polly_normal_mode": "공벌레가 몸을 폅니다",
"subtitles.antarchy.rolly_polly_roll": "공벌레가 구릅니다",
"subtitles.antarchy.hercules_beetle_idle": "헤라클레스장수풍뎅이 소리를 냅니다",
"subtitles.antarchy.hercules_beetle_hurt": "헤라클레스장수풍뎅이 다칩니다",
"subtitles.antarchy.hercules_beetle_attack": "헤라클레스장수풍뎅이 공격합니다",
@@ -924,6 +924,9 @@
"subtitles.antarchy.stink_bug_fart": "Percevejo-fedorento solta pum",
"subtitles.antarchy.stink_bug_idle": "Percevejo-fedorento faz barulho",
"subtitles.antarchy.rolly_polly_idle": "Tatuzinho-de-jardim faz barulho",
"subtitles.antarchy.rolly_polly_wheel_mode": "Tatuzinho-de-jardim se enrola",
"subtitles.antarchy.rolly_polly_normal_mode": "Tatuzinho-de-jardim se desenrola",
"subtitles.antarchy.rolly_polly_roll": "Tatuzinho-de-jardim rola",
"subtitles.antarchy.hercules_beetle_idle": "Besouro-hércules faz barulho",
"subtitles.antarchy.hercules_beetle_hurt": "Besouro-hércules se machuca",
"subtitles.antarchy.hercules_beetle_attack": "Besouro-hércules ataca",
@@ -924,6 +924,9 @@
"subtitles.antarchy.stink_bug_fart": "臭屁虫放屁",
"subtitles.antarchy.stink_bug_idle": "臭屁虫发出动静",
"subtitles.antarchy.rolly_polly_idle": "鼠妇发出动静",
"subtitles.antarchy.rolly_polly_wheel_mode": "鼠妇蜷缩起来",
"subtitles.antarchy.rolly_polly_normal_mode": "鼠妇展开身体",
"subtitles.antarchy.rolly_polly_roll": "鼠妇滚动",
"subtitles.antarchy.hercules_beetle_idle": "赫拉克勒斯甲虫发出动静",
"subtitles.antarchy.hercules_beetle_hurt": "赫拉克勒斯甲虫受伤",
"subtitles.antarchy.hercules_beetle_attack": "赫拉克勒斯甲虫攻击",
@@ -924,6 +924,9 @@
"subtitles.antarchy.stink_bug_fart": "臭屁蟲放屁",
"subtitles.antarchy.stink_bug_idle": "臭屁蟲發出動靜",
"subtitles.antarchy.rolly_polly_idle": "鼠婦發出動靜",
"subtitles.antarchy.rolly_polly_wheel_mode": "鼠婦蜷縮起來",
"subtitles.antarchy.rolly_polly_normal_mode": "鼠婦展開身體",
"subtitles.antarchy.rolly_polly_roll": "鼠婦滾動",
"subtitles.antarchy.hercules_beetle_idle": "赫拉克勒斯甲蟲發出動靜",
"subtitles.antarchy.hercules_beetle_hurt": "赫拉克勒斯甲蟲受傷",
"subtitles.antarchy.hercules_beetle_attack": "赫拉克勒斯甲蟲攻擊",
@@ -660,6 +660,30 @@
}
]
},
"rolly_polly_wheel_mode": {
"subtitle": "subtitles.antarchy.rolly_polly_wheel_mode",
"sounds": [
{
"name": "antarchy:mob/rolly_polly/wheel_mode"
}
]
},
"rolly_polly_normal_mode": {
"subtitle": "subtitles.antarchy.rolly_polly_normal_mode",
"sounds": [
{
"name": "antarchy:mob/rolly_polly/nromal_mode"
}
]
},
"rolly_polly_roll": {
"subtitle": "subtitles.antarchy.rolly_polly_roll",
"sounds": [
{
"name": "antarchy:mob/rolly_polly/roll1"
}
]
},
"thoraxis_nightmare_wastes_ambient": {
"subtitle": "subtitles.antarchy.thoraxis_nightmare_wastes_ambient",
"sounds": [
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

@@ -0,0 +1,5 @@
{
"animation": {
"frametime": 7
}
}
@@ -0,0 +1,39 @@
{
"type": "minecraft:entity",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "antarchy:raw_bug_meat",
"functions": [
{
"function": "minecraft:set_count",
"count": {
"type": "minecraft:uniform",
"min": 1.0,
"max": 2.0
}
},
{
"function": "minecraft:enchanted_count_increase",
"enchantment": "minecraft:looting",
"count": {
"type": "minecraft:uniform",
"min": 0.0,
"max": 1.0
}
}
]
}
],
"conditions": [
{
"condition": "minecraft:killed_by_player"
}
]
}
],
"random_sequence": "antarchy:entities/bed_bug"
}
@@ -0,0 +1,7 @@
{
"replace": false,
"values": [
"antarchy:antiwater",
"antarchy:flowing_antiwater"
]
}
@@ -1,8 +1,8 @@
{
"type": "minecraft:random_patch",
"config": {
"tries": 6,
"xz_spread": 3,
"tries": 12,
"xz_spread": 4,
"y_spread": 1,
"feature": "antarchy:cornea_stalk_single"
}
@@ -1,8 +1,8 @@
{
"type": "minecraft:random_patch",
"config": {
"tries": 6,
"xz_spread": 3,
"tries": 12,
"xz_spread": 4,
"y_spread": 1,
"feature": "antarchy:patch_ceiling_cornea_stalk_single"
}
@@ -3,7 +3,7 @@
"placement": [
{
"type": "minecraft:rarity_filter",
"chance": 36
"chance": 144
},
{
"type": "minecraft:in_square"
@@ -3,7 +3,7 @@
"placement": [
{
"type": "minecraft:rarity_filter",
"chance": 14
"chance": 56
},
{
"type": "minecraft:in_square"
@@ -15,6 +15,7 @@
"antarchy:hercules_beetle",
"antarchy:creeping_horror",
"antarchy:lurking_terror",
"antarchy:rolly_polly",
"antarchy:scorpion",
"antarchy:emperor_scorpion"
]