renamed mobs

feather rising and chronosphere enchants
underside ruins structure
This commit is contained in:
craisinlord committed 2026-09-11 23:47:01 -05:00
1 parent 326c503ddb
commit 8812938d79
379 files changed
+4267 -2002

No files matched your search

@@ -385,19 +385,19 @@ public final class AntarchySettings {
private static double bedBugAttackDamage = 4.0D;
private static double bedBugMovementSpeed = 0.24D;
private static double bedBugArmor = 2.0D;
private static double jumpyBugHealth = 100.0D;
private static double jumpyBugPounceDamage = 12.0D;
private static double jumpyBugCamouflageAlpha = 0.18D;
private static double springbugHealth = 100.0D;
private static double springbugPounceDamage = 12.0D;
private static double springbugCamouflageAlpha = 0.18D;
private static double brutalflyArmor = 10.0D;
private static double brutalflyArmorToughness = 5.0D;
private static double brutalflyKnockbackResistance = 0.7D;
private static double brutalflyMovementSpeed = 0.34D;
private static double brutalflyFlyingSpeed = 0.55D;
private static double cloudSharkHealth = 40.0D;
private static double cloudSharkAttackDamage = 5.0D;
private static double cloudSharkMovementSpeed = 0.34D;
private static double cloudSharkFlyingSpeed = 0.5D;
private static double cloudSharkKnockbackResistance = 0.2D;
private static double stratosharkHealth = 40.0D;
private static double stratosharkAttackDamage = 5.0D;
private static double stratosharkMovementSpeed = 0.34D;
private static double stratosharkFlyingSpeed = 0.5D;
private static double stratosharkKnockbackResistance = 0.2D;
private static double krakenMovementSpeed = 0.24D;
private static double krakenFlyingSpeed = 0.24D;
private static double krakenKnockbackResistance = 0.8D;
@@ -452,10 +452,10 @@ public final class AntarchySettings {
private static double molewormHealth = 8.0D;
private static double molewormAttackDamage = 1.0D;
private static double molewormMovementSpeed = 0.25D;
private static double triffidHealth = 160.0D;
private static double triffidAttackDamage = 10.0D;
private static double triffidGrabDamage = 15.0D;
private static int triffidSweepHitCooldownTicks = 10;
private static double flytrapHealth = 160.0D;
private static double flytrapAttackDamage = 10.0D;
private static double flytrapGrabDamage = 15.0D;
private static int flytrapSweepHitCooldownTicks = 10;
private static double molevoreHealth = 140.0D;
private static double molevoreAttackDamage = 10.0D;
private static double molevoreMovementSpeed = 0.27D;
@@ -538,10 +538,10 @@ public final class AntarchySettings {
private static int waterBombLifetimeTicks = 120;
private static double waterBombGravity = 0.12D;
private static double waterBombKnockback = 1.2D;
private static double creepingHorrorHealth = 15.0D;
private static double creepingHorrorAttackDamage = 6.0D;
private static double lurkingTerrorHealth = 15.0D;
private static double lurkingTerrorAttackDamage = 6.0D;
private static double crawlingBlightHealth = 15.0D;
private static double crawlingBlightAttackDamage = 6.0D;
private static double skulkingFrightHealth = 15.0D;
private static double skulkingFrightAttackDamage = 6.0D;
private static double manticoreHealth = 40.0D;
private static double manticoreAttackDamage = 7.0D;
private static int manticoreStingPoisonTicks = 100;
@@ -597,7 +597,7 @@ public final class AntarchySettings {
private static double glimmerHealth = 20.0D;
private static double lucidArmorToughness = 2.0D;
private static double triffidArmorToughness = 3.0D;
private static double flytrapArmorToughness = 3.0D;
private static double basiliskArmorToughness = 5.0D;
private static double nightmareMobArmorToughness = 5.0D;
private static double alphaMantisArmorToughness = 4.0D;
@@ -2505,14 +2505,14 @@ public final class AntarchySettings {
public static double bedBugArmor() { return bedBugArmor; }
public static void setBedBugArmor(double value) { bedBugArmor = value; }
public static double jumpyBugHealth() { return jumpyBugHealth; }
public static void setJumpyBugHealth(double value) { jumpyBugHealth = value; }
public static double springbugHealth() { return springbugHealth; }
public static void setSpringbugHealth(double value) { springbugHealth = value; }
public static double jumpyBugPounceDamage() { return jumpyBugPounceDamage; }
public static void setJumpyBugPounceDamage(double value) { jumpyBugPounceDamage = value; }
public static double springbugPounceDamage() { return springbugPounceDamage; }
public static void setSpringbugPounceDamage(double value) { springbugPounceDamage = value; }
public static double jumpyBugCamouflageAlpha() { return jumpyBugCamouflageAlpha; }
public static void setJumpyBugCamouflageAlpha(double value) { jumpyBugCamouflageAlpha = value; }
public static double springbugCamouflageAlpha() { return springbugCamouflageAlpha; }
public static void setSpringbugCamouflageAlpha(double value) { springbugCamouflageAlpha = value; }
public static double brutalflyArmor() { return brutalflyArmor; }
public static void setBrutalflyArmor(double value) { brutalflyArmor = value; }
@@ -2529,20 +2529,20 @@ public final class AntarchySettings {
public static double brutalflyFlyingSpeed() { return brutalflyFlyingSpeed; }
public static void setBrutalflyFlyingSpeed(double value) { brutalflyFlyingSpeed = value; }
public static double cloudSharkHealth() { return cloudSharkHealth; }
public static void setCloudSharkHealth(double value) { cloudSharkHealth = value; }
public static double stratosharkHealth() { return stratosharkHealth; }
public static void setStratosharkHealth(double value) { stratosharkHealth = value; }
public static double cloudSharkAttackDamage() { return cloudSharkAttackDamage; }
public static void setCloudSharkAttackDamage(double value) { cloudSharkAttackDamage = value; }
public static double stratosharkAttackDamage() { return stratosharkAttackDamage; }
public static void setStratosharkAttackDamage(double value) { stratosharkAttackDamage = value; }
public static double cloudSharkMovementSpeed() { return cloudSharkMovementSpeed; }
public static void setCloudSharkMovementSpeed(double value) { cloudSharkMovementSpeed = value; }
public static double stratosharkMovementSpeed() { return stratosharkMovementSpeed; }
public static void setStratosharkMovementSpeed(double value) { stratosharkMovementSpeed = value; }
public static double cloudSharkFlyingSpeed() { return cloudSharkFlyingSpeed; }
public static void setCloudSharkFlyingSpeed(double value) { cloudSharkFlyingSpeed = value; }
public static double stratosharkFlyingSpeed() { return stratosharkFlyingSpeed; }
public static void setStratosharkFlyingSpeed(double value) { stratosharkFlyingSpeed = value; }
public static double cloudSharkKnockbackResistance() { return cloudSharkKnockbackResistance; }
public static void setCloudSharkKnockbackResistance(double value) { cloudSharkKnockbackResistance = value; }
public static double stratosharkKnockbackResistance() { return stratosharkKnockbackResistance; }
public static void setStratosharkKnockbackResistance(double value) { stratosharkKnockbackResistance = value; }
public static double krakenMovementSpeed() { return krakenMovementSpeed; }
public static void setKrakenMovementSpeed(double value) { krakenMovementSpeed = value; }
@@ -2706,17 +2706,17 @@ public final class AntarchySettings {
public static double molewormMovementSpeed() { return molewormMovementSpeed; }
public static void setMolewormMovementSpeed(double value) { molewormMovementSpeed = value; }
public static double triffidHealth() { return triffidHealth; }
public static void setTriffidHealth(double value) { triffidHealth = value; }
public static double flytrapHealth() { return flytrapHealth; }
public static void setFlytrapHealth(double value) { flytrapHealth = value; }
public static double triffidAttackDamage() { return triffidAttackDamage; }
public static void setTriffidAttackDamage(double value) { triffidAttackDamage = value; }
public static double flytrapAttackDamage() { return flytrapAttackDamage; }
public static void setFlytrapAttackDamage(double value) { flytrapAttackDamage = value; }
public static double triffidGrabDamage() { return triffidGrabDamage; }
public static void setTriffidGrabDamage(double value) { triffidGrabDamage = value; }
public static double flytrapGrabDamage() { return flytrapGrabDamage; }
public static void setFlytrapGrabDamage(double value) { flytrapGrabDamage = value; }
public static int triffidSweepHitCooldownTicks() { return triffidSweepHitCooldownTicks; }
public static void setTriffidSweepHitCooldownTicks(int value) { triffidSweepHitCooldownTicks = value; }
public static int flytrapSweepHitCooldownTicks() { return flytrapSweepHitCooldownTicks; }
public static void setFlytrapSweepHitCooldownTicks(int value) { flytrapSweepHitCooldownTicks = value; }
public static double molevoreHealth() { return molevoreHealth; }
public static void setMolevoreHealth(double value) { molevoreHealth = value; }
@@ -2875,14 +2875,14 @@ public final class AntarchySettings {
public static double waterBombKnockback() { return waterBombKnockback; }
public static void setWaterBombKnockback(double v) { waterBombKnockback = v; }
public static double creepingHorrorHealth() { return creepingHorrorHealth; }
public static void setCreepingHorrorHealth(double v) { creepingHorrorHealth = v; }
public static double creepingHorrorAttackDamage() { return creepingHorrorAttackDamage; }
public static void setCreepingHorrorAttackDamage(double v) { creepingHorrorAttackDamage = v; }
public static double lurkingTerrorHealth() { return lurkingTerrorHealth; }
public static void setLurkingTerrorHealth(double v) { lurkingTerrorHealth = v; }
public static double lurkingTerrorAttackDamage() { return lurkingTerrorAttackDamage; }
public static void setLurkingTerrorAttackDamage(double v) { lurkingTerrorAttackDamage = v; }
public static double crawlingBlightHealth() { return crawlingBlightHealth; }
public static void setCrawlingBlightHealth(double v) { crawlingBlightHealth = v; }
public static double crawlingBlightAttackDamage() { return crawlingBlightAttackDamage; }
public static void setCrawlingBlightAttackDamage(double v) { crawlingBlightAttackDamage = v; }
public static double skulkingFrightHealth() { return skulkingFrightHealth; }
public static void setSkulkingFrightHealth(double v) { skulkingFrightHealth = v; }
public static double skulkingFrightAttackDamage() { return skulkingFrightAttackDamage; }
public static void setSkulkingFrightAttackDamage(double v) { skulkingFrightAttackDamage = v; }
public static double manticoreHealth() { return manticoreHealth; }
public static void setManticoreHealth(double v) { manticoreHealth = v; }
public static double manticoreAttackDamage() { return manticoreAttackDamage; }
@@ -2991,7 +2991,7 @@ public final class AntarchySettings {
public static void setGlimmerHealth(double v) { glimmerHealth = v; }
public static double lucidArmorToughness() { return lucidArmorToughness; }
public static double triffidArmorToughness() { return triffidArmorToughness; }
public static double flytrapArmorToughness() { return flytrapArmorToughness; }
public static double basiliskArmorToughness() { return basiliskArmorToughness; }
public static double nightmareMobArmorToughness() { return nightmareMobArmorToughness; }
public static double alphaMantisArmorToughness() { return alphaMantisArmorToughness; }
@@ -9,9 +9,9 @@ import com.craisinlord.antarchy.content.entity.HerculesBeetleEntity;
import com.craisinlord.antarchy.content.entity.HushProjectileEntity;
import com.craisinlord.antarchy.content.entity.StinkBugEntity;
import com.craisinlord.antarchy.content.entity.WaterBombEntity;
import com.craisinlord.antarchy.content.entity.TriffidEntity;
import com.craisinlord.antarchy.content.entity.CreepingHorrorEntity;
import com.craisinlord.antarchy.content.entity.LurkingTerrorEntity;
import com.craisinlord.antarchy.content.entity.FlytrapEntity;
import com.craisinlord.antarchy.content.entity.CrawlingBlightEntity;
import com.craisinlord.antarchy.content.entity.SkulkingFrightEntity;
import com.craisinlord.antarchy.content.entity.ToreterrorEntity;
import com.craisinlord.antarchy.content.entity.WaspEntity;
import com.craisinlord.antarchy.content.entity.brutalfly.BrutalflyEntity;
@@ -125,7 +125,7 @@ public final class AntarchyObjects {
@SuppressWarnings("unchecked")
public static Supplier<EntityType<ReverieEntity>> REVERIE = (Supplier<EntityType<ReverieEntity>>) UNBOUND;
@SuppressWarnings("unchecked")
public static Supplier<EntityType<TriffidEntity>> TRIFFID = (Supplier<EntityType<TriffidEntity>>) UNBOUND;
public static Supplier<EntityType<FlytrapEntity>> FLYTRAP = (Supplier<EntityType<FlytrapEntity>>) UNBOUND;
@SuppressWarnings("unchecked")
public static Supplier<EntityType<BrutalflyEntity>> BRUTALFLY = (Supplier<EntityType<BrutalflyEntity>>) UNBOUND;
@SuppressWarnings("unchecked")
@@ -137,9 +137,9 @@ public final class AntarchyObjects {
@SuppressWarnings("unchecked")
public static Supplier<EntityType<WaterBombEntity>> WATER_BOMB = (Supplier<EntityType<WaterBombEntity>>) UNBOUND;
@SuppressWarnings("unchecked")
public static Supplier<EntityType<CreepingHorrorEntity>> CREEPING_HORROR = (Supplier<EntityType<CreepingHorrorEntity>>) UNBOUND;
public static Supplier<EntityType<CrawlingBlightEntity>> CRAWLING_BLIGHT = (Supplier<EntityType<CrawlingBlightEntity>>) UNBOUND;
@SuppressWarnings("unchecked")
public static Supplier<EntityType<LurkingTerrorEntity>> LURKING_TERROR = (Supplier<EntityType<LurkingTerrorEntity>>) UNBOUND;
public static Supplier<EntityType<SkulkingFrightEntity>> SKULKING_FRIGHT = (Supplier<EntityType<SkulkingFrightEntity>>) UNBOUND;
@SuppressWarnings("unchecked")
public static Supplier<EntityType<com.craisinlord.antarchy.content.entity.ManticoreEntity>> MANTICORE = (Supplier<EntityType<com.craisinlord.antarchy.content.entity.ManticoreEntity>>) UNBOUND;
@SuppressWarnings("unchecked")
@@ -262,7 +262,7 @@ public final class AntarchyObjects {
@SuppressWarnings("unchecked")
public static Supplier<Block> CLOUD_BLOCK = (Supplier<Block>) UNBOUND;
@SuppressWarnings("unchecked")
public static Supplier<Block> TRIFFID_GOO_BLOCK = (Supplier<Block>) UNBOUND;
public static Supplier<Block> FLYTRAP_GOO_BLOCK = (Supplier<Block>) UNBOUND;
@SuppressWarnings("unchecked")
public static Supplier<Block> PALE_NYXITE = (Supplier<Block>) UNBOUND;
@SuppressWarnings("unchecked")
@@ -344,9 +344,9 @@ public final class AntarchyObjects {
@SuppressWarnings("unchecked")
public static Supplier<Block> BED_BUG_EGG = (Supplier<Block>) UNBOUND;
@SuppressWarnings("unchecked")
public static Supplier<Block> CREEPING_HORROR_EGGS = (Supplier<Block>) UNBOUND;
public static Supplier<Block> CRAWLING_BLIGHT_EGGS = (Supplier<Block>) UNBOUND;
@SuppressWarnings("unchecked")
public static Supplier<Block> LURKING_TERROR_EGGS = (Supplier<Block>) UNBOUND;
public static Supplier<Block> SKULKING_FRIGHT_EGGS = (Supplier<Block>) UNBOUND;
@SuppressWarnings("unchecked")
public static Supplier<Block> WASP_NEST = (Supplier<Block>) UNBOUND;
@SuppressWarnings("unchecked")
@@ -441,14 +441,14 @@ public final class AntarchyObjects {
Supplier<EntityType<CaterpillarEntity>> caterpillar,
Supplier<EntityType<ButterflyEntity>> butterfly,
Supplier<EntityType<ReverieEntity>> reverie,
Supplier<EntityType<TriffidEntity>> triffid,
Supplier<EntityType<FlytrapEntity>> flytrap,
Supplier<EntityType<BrutalflyEntity>> brutalfly,
Supplier<EntityType<BrutalflyOrbEntity>> brutalflyOrb,
Supplier<EntityType<HushProjectileEntity>> hushProjectile,
Supplier<EntityType<ToreterrorEntity>> toreterror,
Supplier<EntityType<WaterBombEntity>> waterBomb,
Supplier<EntityType<CreepingHorrorEntity>> creepingHorror,
Supplier<EntityType<LurkingTerrorEntity>> lurkingTerror,
Supplier<EntityType<CrawlingBlightEntity>> crawlingBlight,
Supplier<EntityType<SkulkingFrightEntity>> skulkingFright,
Supplier<EntityType<StinkBugEntity>> stinkBug,
Supplier<EntityType<com.craisinlord.antarchy.content.entity.CheepEntity>> cheep,
Supplier<EntityType<com.craisinlord.antarchy.content.entity.DorrieEntity>> dorrie,
@@ -477,7 +477,7 @@ public final class AntarchyObjects {
Supplier<Block> shellstoneBrickSlab,
Supplier<Block> shellstoneBrickWall,
Supplier<Block> cloudBlock,
Supplier<Block> triffidGooBlock,
Supplier<Block> flytrapGooBlock,
Supplier<Block> paleNyxite,
Supplier<Block> nyxiteSpike,
Supplier<Block> chitinBlock,
@@ -509,8 +509,8 @@ public final class AntarchyObjects {
Supplier<Block> orangeMilkweed,
Supplier<Block> pinkMilkweed,
Supplier<Block> bedBugEggs,
Supplier<Block> creepingHorrorEggs,
Supplier<Block> lurkingTerrorEggs,
Supplier<Block> crawlingBlightEggs,
Supplier<Block> skulkingFrightEggs,
Supplier<Block> waspNest,
Supplier<Block> hushweed,
Supplier<Block> squirrelNestBlock,
@@ -542,14 +542,14 @@ public final class AntarchyObjects {
CATERPILLAR = caterpillar;
BUTTERFLY = butterfly;
REVERIE = reverie;
TRIFFID = triffid;
FLYTRAP = flytrap;
BRUTALFLY = brutalfly;
BRUTALFLY_ORB = brutalflyOrb;
HUSH_PROJECTILE = hushProjectile;
TORETERROR = toreterror;
WATER_BOMB = waterBomb;
CREEPING_HORROR = creepingHorror;
LURKING_TERROR = lurkingTerror;
CRAWLING_BLIGHT = crawlingBlight;
SKULKING_FRIGHT = skulkingFright;
STINK_BUG = stinkBug;
CHEEP = cheep;
DORRIE = dorrie;
@@ -578,7 +578,7 @@ public final class AntarchyObjects {
SHELLSTONE_BRICK_SLAB = shellstoneBrickSlab;
SHELLSTONE_BRICK_WALL = shellstoneBrickWall;
CLOUD_BLOCK = cloudBlock;
TRIFFID_GOO_BLOCK = triffidGooBlock;
FLYTRAP_GOO_BLOCK = flytrapGooBlock;
PALE_NYXITE = paleNyxite;
NYXITE_SPIKE = nyxiteSpike;
CHITIN_BLOCK = chitinBlock;
@@ -610,8 +610,8 @@ public final class AntarchyObjects {
ORANGE_MILKWEED = orangeMilkweed;
PINK_MILKWEED = pinkMilkweed;
BED_BUG_EGG = bedBugEggs;
CREEPING_HORROR_EGGS = creepingHorrorEggs;
LURKING_TERROR_EGGS = lurkingTerrorEggs;
CRAWLING_BLIGHT_EGGS = crawlingBlightEggs;
SKULKING_FRIGHT_EGGS = skulkingFrightEggs;
WASP_NEST = waspNest;
HUSHWEED = hushweed;
SQUIRREL_NEST_BLOCK = squirrelNestBlock;
@@ -23,11 +23,11 @@ public final class AntarchySoundEvents {
public static Supplier<SoundEvent> ANT_BITE = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> ANT_GATHER = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> ANT_NEST = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> CLOUD_SHARK_BITE = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> CLOUD_SHARK_IDLE = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> CLOUD_SHARK_HURT = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> CLOUD_SHARK_DEATH = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> CLOUD_SHARK_FLY = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> STRATOSHARK_BITE = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> STRATOSHARK_IDLE = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> STRATOSHARK_HURT = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> STRATOSHARK_DEATH = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> STRATOSHARK_FLY = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> CATERPILLAR_IDLE = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> CATERPILLAR_HURT = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> CATERPILLAR_CRAWL = (Supplier<SoundEvent>) UNBOUND;
@@ -91,12 +91,12 @@ public final class AntarchySoundEvents {
public static Supplier<SoundEvent> NIGHTMARE_DEATH = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> NIGHTMARE_BITE = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> NIGHTMARE_FLAP = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> TRIFFID_ATTACK = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> TRIFFID_GRAB = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> TRIFFID_HURT = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> TRIFFID_DEATH = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> TRIFFID_HISS = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> TRIFFID_GROWL = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> FLYTRAP_ATTACK = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> FLYTRAP_GRAB = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> FLYTRAP_HURT = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> FLYTRAP_DEATH = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> FLYTRAP_HISS = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> FLYTRAP_GROWL = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> MANTIS_AMBIENT = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> MANTIS_HURT = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> MANTIS_ATTACK = (Supplier<SoundEvent>) UNBOUND;
@@ -145,13 +145,13 @@ public final class AntarchySoundEvents {
public static Supplier<SoundEvent> STINK_BUG_IDLE = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> CAVARYN_HEARTBEAT = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> ROLLY_POLLY_IDLE = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> CREEPING_HORROR_GROWL = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> CREEPING_HORROR_HURT = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> CREEPING_HORROR_BITE = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> LURKING_TERROR_SNARL = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> LURKING_TERROR_HURT = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> LURKING_TERROR_BITE = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> LURKING_TERROR_FLY_LOOP = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> CRAWLING_BLIGHT_GROWL = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> CRAWLING_BLIGHT_HURT = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> CRAWLING_BLIGHT_BITE = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> SKULKING_FRIGHT_SNARL = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> SKULKING_FRIGHT_HURT = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> SKULKING_FRIGHT_BITE = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> SKULKING_FRIGHT_FLY_LOOP = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> DUCT_TAPE_USE = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> HERCULES_BEETLE_IDLE = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> HERCULES_BEETLE_HURT = (Supplier<SoundEvent>) UNBOUND;
@@ -159,10 +159,10 @@ public final class AntarchySoundEvents {
public static Supplier<SoundEvent> HERCULES_BEETLE_CRY = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> HERCULES_BEETLE_CHARGE_START = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> HERCULES_BEETLE_KNOCKED_DOWN = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> JUMPY_BUG_IDLE = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> SPRINGBUG_IDLE = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> SPIT_BUG_IDLE = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> JUMPY_BUG_HURT = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> JUMPY_BUG_JUMP = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> SPRINGBUG_HURT = (Supplier<SoundEvent>) UNBOUND;
public static Supplier<SoundEvent> SPRINGBUG_JUMP = (Supplier<SoundEvent>) UNBOUND;
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;
@@ -235,11 +235,11 @@ public final class AntarchySoundEvents {
Supplier<SoundEvent> antBite,
Supplier<SoundEvent> antGather,
Supplier<SoundEvent> antNest,
Supplier<SoundEvent> cloudSharkBite,
Supplier<SoundEvent> cloudSharkIdle,
Supplier<SoundEvent> cloudSharkHurt,
Supplier<SoundEvent> cloudSharkDeath,
Supplier<SoundEvent> cloudSharkFly,
Supplier<SoundEvent> stratosharkBite,
Supplier<SoundEvent> stratosharkIdle,
Supplier<SoundEvent> stratosharkHurt,
Supplier<SoundEvent> stratosharkDeath,
Supplier<SoundEvent> stratosharkFly,
Supplier<SoundEvent> caterpillarIdle,
Supplier<SoundEvent> caterpillarHurt,
Supplier<SoundEvent> caterpillarCrawl,
@@ -299,12 +299,12 @@ public final class AntarchySoundEvents {
Supplier<SoundEvent> nightmareDeath,
Supplier<SoundEvent> nightmareBite,
Supplier<SoundEvent> nightmareFlap,
Supplier<SoundEvent> triffidAttack,
Supplier<SoundEvent> triffidGrab,
Supplier<SoundEvent> triffidHurt,
Supplier<SoundEvent> triffidDeath,
Supplier<SoundEvent> triffidHiss,
Supplier<SoundEvent> triffidGrowl,
Supplier<SoundEvent> flytrapAttack,
Supplier<SoundEvent> flytrapGrab,
Supplier<SoundEvent> flytrapHurt,
Supplier<SoundEvent> flytrapDeath,
Supplier<SoundEvent> flytrapHiss,
Supplier<SoundEvent> flytrapGrowl,
Supplier<SoundEvent> mantisAmbient,
Supplier<SoundEvent> mantisHurt,
Supplier<SoundEvent> mantisAttack,
@@ -353,13 +353,13 @@ public final class AntarchySoundEvents {
Supplier<SoundEvent> stinkBugIdle,
Supplier<SoundEvent> cavarynHeartbeat,
Supplier<SoundEvent> rollyPollyIdle,
Supplier<SoundEvent> creepingHorrorGrowl,
Supplier<SoundEvent> creepingHorrorHurt,
Supplier<SoundEvent> creepingHorrorBite,
Supplier<SoundEvent> lurkingTerrorSnarl,
Supplier<SoundEvent> lurkingTerrorHurt,
Supplier<SoundEvent> lurkingTerrorBite,
Supplier<SoundEvent> lurkingTerrorFlyLoop,
Supplier<SoundEvent> crawlingBlightGrowl,
Supplier<SoundEvent> crawlingBlightHurt,
Supplier<SoundEvent> crawlingBlightBite,
Supplier<SoundEvent> skulkingFrightSnarl,
Supplier<SoundEvent> skulkingFrightHurt,
Supplier<SoundEvent> skulkingFrightBite,
Supplier<SoundEvent> skulkingFrightFlyLoop,
Supplier<SoundEvent> ductTapeUse,
Supplier<SoundEvent> herculesBeetleIdle,
Supplier<SoundEvent> herculesBeetleHurt,
@@ -367,10 +367,10 @@ public final class AntarchySoundEvents {
Supplier<SoundEvent> herculesBeetleCry,
Supplier<SoundEvent> herculesBeetleChargeStart,
Supplier<SoundEvent> herculesBeetleKnockedDown,
Supplier<SoundEvent> jumpyBugIdle,
Supplier<SoundEvent> springbugIdle,
Supplier<SoundEvent> spitBugIdle,
Supplier<SoundEvent> jumpyBugHurt,
Supplier<SoundEvent> jumpyBugJump,
Supplier<SoundEvent> springbugHurt,
Supplier<SoundEvent> springbugJump,
Supplier<SoundEvent> spitBugHurt,
Supplier<SoundEvent> spitBugSpit,
Supplier<SoundEvent> brutalflySpit,
@@ -439,11 +439,11 @@ public final class AntarchySoundEvents {
ANT_BITE = antBite;
ANT_GATHER = antGather;
ANT_NEST = antNest;
CLOUD_SHARK_BITE = cloudSharkBite;
CLOUD_SHARK_IDLE = cloudSharkIdle;
CLOUD_SHARK_HURT = cloudSharkHurt;
CLOUD_SHARK_DEATH = cloudSharkDeath;
CLOUD_SHARK_FLY = cloudSharkFly;
STRATOSHARK_BITE = stratosharkBite;
STRATOSHARK_IDLE = stratosharkIdle;
STRATOSHARK_HURT = stratosharkHurt;
STRATOSHARK_DEATH = stratosharkDeath;
STRATOSHARK_FLY = stratosharkFly;
CATERPILLAR_IDLE = caterpillarIdle;
CATERPILLAR_HURT = caterpillarHurt;
CATERPILLAR_CRAWL = caterpillarCrawl;
@@ -503,12 +503,12 @@ public final class AntarchySoundEvents {
NIGHTMARE_DEATH = nightmareDeath;
NIGHTMARE_BITE = nightmareBite;
NIGHTMARE_FLAP = nightmareFlap;
TRIFFID_ATTACK = triffidAttack;
TRIFFID_GRAB = triffidGrab;
TRIFFID_HURT = triffidHurt;
TRIFFID_DEATH = triffidDeath;
TRIFFID_HISS = triffidHiss;
TRIFFID_GROWL = triffidGrowl;
FLYTRAP_ATTACK = flytrapAttack;
FLYTRAP_GRAB = flytrapGrab;
FLYTRAP_HURT = flytrapHurt;
FLYTRAP_DEATH = flytrapDeath;
FLYTRAP_HISS = flytrapHiss;
FLYTRAP_GROWL = flytrapGrowl;
MANTIS_AMBIENT = mantisAmbient;
MANTIS_HURT = mantisHurt;
MANTIS_ATTACK = mantisAttack;
@@ -557,13 +557,13 @@ public final class AntarchySoundEvents {
STINK_BUG_IDLE = stinkBugIdle;
CAVARYN_HEARTBEAT = cavarynHeartbeat;
ROLLY_POLLY_IDLE = rollyPollyIdle;
CREEPING_HORROR_GROWL = creepingHorrorGrowl;
CREEPING_HORROR_HURT = creepingHorrorHurt;
CREEPING_HORROR_BITE = creepingHorrorBite;
LURKING_TERROR_SNARL = lurkingTerrorSnarl;
LURKING_TERROR_HURT = lurkingTerrorHurt;
LURKING_TERROR_BITE = lurkingTerrorBite;
LURKING_TERROR_FLY_LOOP = lurkingTerrorFlyLoop;
CRAWLING_BLIGHT_GROWL = crawlingBlightGrowl;
CRAWLING_BLIGHT_HURT = crawlingBlightHurt;
CRAWLING_BLIGHT_BITE = crawlingBlightBite;
SKULKING_FRIGHT_SNARL = skulkingFrightSnarl;
SKULKING_FRIGHT_HURT = skulkingFrightHurt;
SKULKING_FRIGHT_BITE = skulkingFrightBite;
SKULKING_FRIGHT_FLY_LOOP = skulkingFrightFlyLoop;
DUCT_TAPE_USE = ductTapeUse;
HERCULES_BEETLE_IDLE = herculesBeetleIdle;
HERCULES_BEETLE_HURT = herculesBeetleHurt;
@@ -571,10 +571,10 @@ public final class AntarchySoundEvents {
HERCULES_BEETLE_CRY = herculesBeetleCry;
HERCULES_BEETLE_CHARGE_START = herculesBeetleChargeStart;
HERCULES_BEETLE_KNOCKED_DOWN = herculesBeetleKnockedDown;
JUMPY_BUG_IDLE = jumpyBugIdle;
SPRINGBUG_IDLE = springbugIdle;
SPIT_BUG_IDLE = spitBugIdle;
JUMPY_BUG_HURT = jumpyBugHurt;
JUMPY_BUG_JUMP = jumpyBugJump;
SPRINGBUG_HURT = springbugHurt;
SPRINGBUG_JUMP = springbugJump;
SPIT_BUG_HURT = spitBugHurt;
SPIT_BUG_SPIT = spitBugSpit;
BRUTALFLY_SPIT = brutalflySpit;
@@ -76,7 +76,7 @@ public final class AntarchyTags {
public static final TagKey<EntityType<?>> CRITTER_CAGE_BLACKLIST = TagKey.create(Registries.ENTITY_TYPE, id("critter_cage_blacklist"));
public static final TagKey<EntityType<?>> PARALYSIS_IMMUNE = TagKey.create(Registries.ENTITY_TYPE, id("paralysis_immune"));
public static final TagKey<EntityType<?>> HUSHWEED_TARGETS = TagKey.create(Registries.ENTITY_TYPE, id("hushweed_targets"));
public static final TagKey<EntityType<?>> TRIFFID_PREY = TagKey.create(Registries.ENTITY_TYPE, id("triffid_prey"));
public static final TagKey<EntityType<?>> FLYTRAP_PREY = TagKey.create(Registries.ENTITY_TYPE, id("flytrap_prey"));
public static final TagKey<EntityType<?>> STINKY_REPELLED_HOSTILES = TagKey.create(Registries.ENTITY_TYPE, id("stinky_repelled_hostiles"));
public static final TagKey<EntityType<?>> SCORPION_WHIP_IMMUNE = TagKey.create(Registries.ENTITY_TYPE, id("scorpion_whip_immune"));
public static final TagKey<EntityType<?>> SCORPION_WHIP_BLACKLIST = TagKey.create(Registries.ENTITY_TYPE, id("scorpion_whip_blacklist"));
@@ -1,9 +1,9 @@
package com.craisinlord.antarchy.content.block;
import com.craisinlord.antarchy.content.AntarchyObjects;
import com.craisinlord.antarchy.content.entity.CreepingHorrorEntity;
import com.craisinlord.antarchy.content.entity.CrawlingBlightEntity;
import com.craisinlord.antarchy.content.block.AmberMossBlock;
import com.craisinlord.antarchy.content.block.LurkingTerrorEggBlock;
import com.craisinlord.antarchy.content.block.SkulkingFrightEggBlock;
import com.craisinlord.antarchy.content.horde.CavarynHordeManager;
import com.mojang.serialization.MapCodec;
import net.minecraft.core.BlockPos;
@@ -33,8 +33,8 @@ import net.minecraft.world.level.block.state.properties.IntegerProperty;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
public class CreepingHorrorEggBlock extends Block {
public static final MapCodec<CreepingHorrorEggBlock> CODEC = Block.simpleCodec(CreepingHorrorEggBlock::new);
public class CrawlingBlightEggBlock extends Block {
public static final MapCodec<CrawlingBlightEggBlock> CODEC = Block.simpleCodec(CrawlingBlightEggBlock::new);
public static final IntegerProperty HATCH = BlockStateProperties.HATCH;
public static final IntegerProperty EGGS = BlockStateProperties.EGGS;
private static final float PANIC_HATCH_CHANCE = 0.25F;
@@ -44,13 +44,13 @@ public class CreepingHorrorEggBlock extends Block {
private static final VoxelShape SINGLE_SHAPE = Block.box(3.0D, 0.0D, 3.0D, 13.0D, 7.0D, 13.0D);
private static final VoxelShape MULTI_SHAPE = Block.box(1.0D, 0.0D, 1.0D, 15.0D, 7.0D, 15.0D);
public CreepingHorrorEggBlock(BlockBehaviour.Properties properties) {
public CrawlingBlightEggBlock(BlockBehaviour.Properties properties) {
super(properties);
this.registerDefaultState(this.stateDefinition.any().setValue(HATCH, 0).setValue(EGGS, 1));
}
@Override
public MapCodec<CreepingHorrorEggBlock> codec() {
public MapCodec<CrawlingBlightEggBlock> codec() {
return CODEC;
}
@@ -145,9 +145,9 @@ public class CreepingHorrorEggBlock extends Block {
mutable.set(origin.getX() + dx, origin.getY() + dy, origin.getZ() + dz);
BlockState nearby = level.getBlockState(mutable);
BlockPos immutable = mutable.immutable();
if (nearby.getBlock() instanceof CreepingHorrorEggBlock b) {
if (nearby.getBlock() instanceof CrawlingBlightEggBlock b) {
b.hatchPanickedEggs(level, immutable, nearby, level.random);
} else if (nearby.getBlock() instanceof LurkingTerrorEggBlock b) {
} else if (nearby.getBlock() instanceof SkulkingFrightEggBlock b) {
b.hatchPanickedEggs(level, immutable, nearby, level.random);
}
}
@@ -195,7 +195,7 @@ public class CreepingHorrorEggBlock extends Block {
level.playSound(null, pos, SoundEvents.TURTLE_EGG_HATCH, SoundSource.BLOCKS, 0.75F, 0.95F + random.nextFloat() * 0.1F);
for (int i = 0; i < eggsToHatch; i++) {
CreepingHorrorEntity entity = AntarchyObjects.CREEPING_HORROR.get().create(level);
CrawlingBlightEntity entity = AntarchyObjects.CRAWLING_BLIGHT.get().create(level);
if (entity == null) {
continue;
}
@@ -240,7 +240,7 @@ public class CreepingHorrorEggBlock extends Block {
}
private boolean canDestroyEgg(Level level, Entity entity) {
if (entity instanceof CreepingHorrorEntity || entity instanceof Bat) {
if (entity instanceof CrawlingBlightEntity || entity instanceof Bat) {
return false;
}
if (entity instanceof net.minecraft.world.entity.LivingEntity) {
@@ -15,13 +15,13 @@ import net.minecraft.world.phys.shapes.EntityCollisionContext;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
public class TriffidGooBlock extends Block {
public class FlytrapGooBlock extends Block {
private static final double BOUNCE_VELOCITY_THRESHOLD = 0.6;
private static final double MAX_SINK_SPEED = 0.05;
private static final double SPRINT_VELOCITY_THRESHOLD = 0.1;
public TriffidGooBlock(BlockBehaviour.Properties properties) {
public FlytrapGooBlock(BlockBehaviour.Properties properties) {
super(properties);
}
@@ -0,0 +1,54 @@
package com.craisinlord.antarchy.content.block;
import com.craisinlord.antarchy.content.block.entity.QueenTrailSpawnMarkerBlockEntity;
import com.mojang.serialization.MapCodec;
import java.util.function.Supplier;
import net.minecraft.core.BlockPos;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.BaseEntityBlock;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.RenderShape;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityTicker;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
public final class QueenTrailSpawnMarkerBlock extends BaseEntityBlock {
private final Supplier<? extends BlockEntityType<QueenTrailSpawnMarkerBlockEntity>> blockEntityTypeSupplier;
private final MapCodec<QueenTrailSpawnMarkerBlock> codec;
public QueenTrailSpawnMarkerBlock(Supplier<? extends BlockEntityType<QueenTrailSpawnMarkerBlockEntity>> blockEntityTypeSupplier, BlockBehaviour.Properties properties) {
super(properties);
this.blockEntityTypeSupplier = blockEntityTypeSupplier;
this.codec = Block.simpleCodec(ignored -> this);
}
@Override
public MapCodec<QueenTrailSpawnMarkerBlock> codec() {
return this.codec;
}
@Override
protected RenderShape getRenderShape(BlockState state) {
return RenderShape.INVISIBLE;
}
@Override
public BlockEntity newBlockEntity(BlockPos pos, BlockState state) {
return new QueenTrailSpawnMarkerBlockEntity(pos, state, this.blockEntityTypeSupplier);
}
@Override
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> blockEntityType) {
if (level.isClientSide) {
return null;
}
return createTickerHelper(blockEntityType, this.blockEntityTypeSupplier.get(), (tickLevel, tickPos, tickState, marker) -> {
if (tickLevel instanceof ServerLevel serverLevel) {
QueenTrailSpawnMarkerBlockEntity.serverTick(serverLevel, marker);
}
});
}
}
@@ -1,9 +1,9 @@
package com.craisinlord.antarchy.content.block;
import com.craisinlord.antarchy.content.AntarchyObjects;
import com.craisinlord.antarchy.content.entity.LurkingTerrorEntity;
import com.craisinlord.antarchy.content.entity.SkulkingFrightEntity;
import com.craisinlord.antarchy.content.block.AmberMossBlock;
import com.craisinlord.antarchy.content.block.CreepingHorrorEggBlock;
import com.craisinlord.antarchy.content.block.CrawlingBlightEggBlock;
import com.craisinlord.antarchy.content.horde.CavarynHordeManager;
import com.mojang.serialization.MapCodec;
import net.minecraft.core.BlockPos;
@@ -33,8 +33,8 @@ import net.minecraft.world.level.block.state.properties.IntegerProperty;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
public class LurkingTerrorEggBlock extends Block {
public static final MapCodec<LurkingTerrorEggBlock> CODEC = Block.simpleCodec(LurkingTerrorEggBlock::new);
public class SkulkingFrightEggBlock extends Block {
public static final MapCodec<SkulkingFrightEggBlock> CODEC = Block.simpleCodec(SkulkingFrightEggBlock::new);
public static final IntegerProperty HATCH = BlockStateProperties.HATCH;
public static final IntegerProperty EGGS = BlockStateProperties.EGGS;
private static final float PANIC_HATCH_CHANCE = 0.25F;
@@ -44,13 +44,13 @@ public class LurkingTerrorEggBlock extends Block {
private static final VoxelShape SINGLE_SHAPE = Block.box(3.0D, 0.0D, 3.0D, 13.0D, 7.0D, 13.0D);
private static final VoxelShape MULTI_SHAPE = Block.box(1.0D, 0.0D, 1.0D, 15.0D, 7.0D, 15.0D);
public LurkingTerrorEggBlock(BlockBehaviour.Properties properties) {
public SkulkingFrightEggBlock(BlockBehaviour.Properties properties) {
super(properties);
this.registerDefaultState(this.stateDefinition.any().setValue(HATCH, 0).setValue(EGGS, 1));
}
@Override
public MapCodec<LurkingTerrorEggBlock> codec() {
public MapCodec<SkulkingFrightEggBlock> codec() {
return CODEC;
}
@@ -145,9 +145,9 @@ public class LurkingTerrorEggBlock extends Block {
mutable.set(origin.getX() + dx, origin.getY() + dy, origin.getZ() + dz);
BlockState nearby = level.getBlockState(mutable);
BlockPos immutable = mutable.immutable();
if (nearby.getBlock() instanceof LurkingTerrorEggBlock b) {
if (nearby.getBlock() instanceof SkulkingFrightEggBlock b) {
b.hatchPanickedEggs(level, immutable, nearby, level.random);
} else if (nearby.getBlock() instanceof CreepingHorrorEggBlock b) {
} else if (nearby.getBlock() instanceof CrawlingBlightEggBlock b) {
b.hatchPanickedEggs(level, immutable, nearby, level.random);
}
}
@@ -195,7 +195,7 @@ public class LurkingTerrorEggBlock extends Block {
level.playSound(null, pos, SoundEvents.TURTLE_EGG_HATCH, SoundSource.BLOCKS, 0.75F, 0.95F + random.nextFloat() * 0.1F);
for (int i = 0; i < eggsToHatch; i++) {
LurkingTerrorEntity entity = AntarchyObjects.LURKING_TERROR.get().create(level);
SkulkingFrightEntity entity = AntarchyObjects.SKULKING_FRIGHT.get().create(level);
if (entity == null) {
continue;
}
@@ -240,7 +240,7 @@ public class LurkingTerrorEggBlock extends Block {
}
private boolean canDestroyEgg(Level level, Entity entity) {
if (entity instanceof LurkingTerrorEntity || entity instanceof Bat) {
if (entity instanceof SkulkingFrightEntity || entity instanceof Bat) {
return false;
}
if (entity instanceof net.minecraft.world.entity.LivingEntity) {
@@ -1,7 +1,7 @@
package com.craisinlord.antarchy.content.block;
import com.craisinlord.antarchy.Antarchy;
import com.craisinlord.antarchy.content.entity.JumpyBugEntity;
import com.craisinlord.antarchy.content.entity.SpringbugEntity;
import com.craisinlord.antarchy.content.horde.CavarynHordeManager;
import com.mojang.serialization.MapCodec;
import net.minecraft.core.BlockPos;
@@ -32,8 +32,8 @@ import net.minecraft.world.level.block.state.properties.IntegerProperty;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
public class JumpyBugEggBlock extends Block {
public static final MapCodec<JumpyBugEggBlock> CODEC = Block.simpleCodec(JumpyBugEggBlock::new);
public class SpringbugEggBlock extends Block {
public static final MapCodec<SpringbugEggBlock> CODEC = Block.simpleCodec(SpringbugEggBlock::new);
public static final IntegerProperty HATCH = BlockStateProperties.HATCH;
public static final BooleanProperty HANGING = BlockStateProperties.HANGING;
public static final BooleanProperty ROTATED = BooleanProperty.create("rotated");
@@ -44,15 +44,15 @@ public class JumpyBugEggBlock extends Block {
private static final int PLAYER_PROXIMITY_CHECK_INTERVAL = 200;
private static final VoxelShape FLOOR_SHAPE = Block.box(1.5D, 0.0D, 1.5D, 14.5D, 16.0D, 14.5D);
private static final VoxelShape CEILING_SHAPE = Block.box(1.5D, 0.0D, 1.5D, 14.5D, 16.0D, 14.5D);
private static final ResourceLocation JUMPY_BUG_ID = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "jumpy_bug");
private static final ResourceLocation SPRINGBUG_ID = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "springbug");
public JumpyBugEggBlock(BlockBehaviour.Properties properties) {
public SpringbugEggBlock(BlockBehaviour.Properties properties) {
super(properties);
this.registerDefaultState(this.stateDefinition.any().setValue(HATCH, 0).setValue(HANGING, false).setValue(ROTATED, false));
}
@Override
public MapCodec<JumpyBugEggBlock> codec() {
public MapCodec<SpringbugEggBlock> codec() {
return CODEC;
}
@@ -142,11 +142,11 @@ public class JumpyBugEggBlock extends Block {
level.removeBlock(pos, false);
level.playSound(null, pos, SoundEvents.TURTLE_EGG_HATCH, SoundSource.BLOCKS, 0.75F, 0.95F + random.nextFloat() * 0.1F);
@SuppressWarnings("unchecked")
EntityType<JumpyBugEntity> jumpyBugType = (EntityType<JumpyBugEntity>) (EntityType<?>) BuiltInRegistries.ENTITY_TYPE.getOptional(JUMPY_BUG_ID).orElse(null);
if (jumpyBugType == null) {
EntityType<SpringbugEntity> springbugType = (EntityType<SpringbugEntity>) (EntityType<?>) BuiltInRegistries.ENTITY_TYPE.getOptional(SPRINGBUG_ID).orElse(null);
if (springbugType == null) {
return;
}
JumpyBugEntity entity = jumpyBugType.create(level);
SpringbugEntity entity = springbugType.create(level);
if (entity == null) {
return;
}
@@ -0,0 +1,77 @@
package com.craisinlord.antarchy.content.block;
import com.craisinlord.antarchy.content.block.entity.UnderVaultBlockEntity;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Mirror;
import net.minecraft.world.level.block.Rotation;
import net.minecraft.world.level.block.VaultBlock;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityTicker;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.state.properties.DirectionProperty;
import java.util.function.Supplier;
public final class UnderVaultBlock extends VaultBlock {
public static final DirectionProperty UNDER_FACING = DirectionProperty.create("under_facing", Direction.values());
private final Supplier<? extends BlockEntityType<UnderVaultBlockEntity>> blockEntityType;
public UnderVaultBlock(Supplier<? extends BlockEntityType<UnderVaultBlockEntity>> blockEntityType, BlockBehaviour.Properties properties) {
super(properties);
this.blockEntityType = blockEntityType;
this.registerDefaultState(this.defaultBlockState().setValue(UNDER_FACING, Direction.NORTH));
}
@Override
protected void createBlockStateDefinition(StateDefinition.Builder<net.minecraft.world.level.block.Block, BlockState> builder) {
super.createBlockStateDefinition(builder);
builder.add(UNDER_FACING);
}
@Override
public BlockState getStateForPlacement(BlockPlaceContext context) {
if (context.getClickedFace() != Direction.DOWN) {
return null;
}
return this.defaultBlockState()
.setValue(FACING, context.getHorizontalDirection().getOpposite())
.setValue(UNDER_FACING, Direction.DOWN);
}
@Override
public BlockState rotate(BlockState state, Rotation rotation) {
return super.rotate(state, rotation).setValue(UNDER_FACING, rotation.rotate(state.getValue(UNDER_FACING)));
}
@Override
public BlockState mirror(BlockState state, Mirror mirror) {
return super.mirror(state, mirror).setValue(UNDER_FACING, mirror.getRotation(state.getValue(UNDER_FACING)).rotate(state.getValue(UNDER_FACING)));
}
@Override
public BlockEntity newBlockEntity(BlockPos pos, BlockState state) {
return new UnderVaultBlockEntity(pos, state, blockEntityType);
}
@Override
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> type) {
if (this.blockEntityType == null || type != this.blockEntityType.get()) {
return null;
}
if (level.isClientSide) {
return (BlockEntityTicker<T>) (BlockEntityTicker<UnderVaultBlockEntity>) UnderVaultBlockEntity::clientTick;
}
return (BlockEntityTicker<T>) (BlockEntityTicker<UnderVaultBlockEntity>) ((serverLevel, pos, blockState, blockEntity) -> {
if (serverLevel instanceof ServerLevel levelServer) {
UnderVaultBlockEntity.serverTick(levelServer, pos, blockState, blockEntity);
}
});
}
}
@@ -0,0 +1,79 @@
package com.craisinlord.antarchy.content.block;
import com.craisinlord.antarchy.content.AntarchyObjects;
import com.craisinlord.antarchy.content.block.entity.UndertrialSpawnerBlockEntity;
import com.mojang.serialization.MapCodec;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.BaseEntityBlock;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.RenderShape;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityTicker;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.entity.trialspawner.TrialSpawnerState;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.level.block.state.properties.EnumProperty;
import java.util.function.Supplier;
public final class UndertrialSpawnerBlock extends BaseEntityBlock {
public static final MapCodec<UndertrialSpawnerBlock> CODEC = MapCodec.unit(() -> new UndertrialSpawnerBlock(null, BlockBehaviour.Properties.of()));
public static final EnumProperty<TrialSpawnerState> STATE = BlockStateProperties.TRIAL_SPAWNER_STATE;
public static final BooleanProperty OMINOUS = BlockStateProperties.OMINOUS;
private final Supplier<? extends BlockEntityType<UndertrialSpawnerBlockEntity>> blockEntityType;
public UndertrialSpawnerBlock(Supplier<? extends BlockEntityType<UndertrialSpawnerBlockEntity>> blockEntityType, BlockBehaviour.Properties properties) {
super(properties);
this.blockEntityType = blockEntityType;
this.registerDefaultState(this.stateDefinition.any()
.setValue(STATE, TrialSpawnerState.INACTIVE)
.setValue(OMINOUS, false));
}
@Override
public MapCodec<UndertrialSpawnerBlock> codec() {
return CODEC;
}
@Override
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
builder.add(STATE, OMINOUS);
}
@Override
public BlockState getStateForPlacement(BlockPlaceContext context) {
return context.getClickedFace() == Direction.DOWN ? this.defaultBlockState() : null;
}
@Override
protected RenderShape getRenderShape(BlockState state) {
return RenderShape.MODEL;
}
@Override
public BlockEntity newBlockEntity(BlockPos pos, BlockState state) {
return new UndertrialSpawnerBlockEntity(pos, state, blockEntityType);
}
@Override
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> blockEntityType) {
if (this.blockEntityType == null || blockEntityType != this.blockEntityType.get()) {
return null;
}
if (level.isClientSide) {
return (BlockEntityTicker<T>) (BlockEntityTicker<UndertrialSpawnerBlockEntity>) UndertrialSpawnerBlockEntity::clientTick;
}
return (BlockEntityTicker<T>) (BlockEntityTicker<UndertrialSpawnerBlockEntity>) ((tickLevel, tickPos, tickState, blockEntity) -> {
if (tickLevel instanceof net.minecraft.server.level.ServerLevel serverLevel) {
UndertrialSpawnerBlockEntity.serverTick(serverLevel, tickPos, tickState, blockEntity);
}
});
}
}
@@ -0,0 +1,97 @@
package com.craisinlord.antarchy.content.block.entity;
import com.craisinlord.antarchy.content.entity.royal.QueenEntity;
import java.util.UUID;
import java.util.function.Supplier;
import net.minecraft.core.BlockPos;
import net.minecraft.core.HolderLookup;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.Difficulty;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
import org.jetbrains.annotations.Nullable;
public final class QueenTrailSpawnMarkerBlockEntity extends BlockEntity {
private static final double ACTIVATION_DISTANCE_SQUARED = 96.0D * 96.0D;
private long siteId;
private BlockPos spawnPos = BlockPos.ZERO;
private BlockPos homePos = BlockPos.ZERO;
private float yaw;
private boolean configured;
private boolean consumed;
@Nullable
private UUID queenUuid;
public QueenTrailSpawnMarkerBlockEntity(BlockPos pos, BlockState state, Supplier<? extends BlockEntityType<QueenTrailSpawnMarkerBlockEntity>> typeSupplier) {
super(typeSupplier.get(), pos, state);
}
public void configure(long siteId, BlockPos spawnPos, BlockPos homePos, float yaw) {
this.siteId = siteId;
this.spawnPos = spawnPos.immutable();
this.homePos = homePos.immutable();
this.yaw = yaw;
this.configured = true;
this.setChanged();
}
public long getSiteId() {
return this.siteId;
}
public BlockPos getSpawnPos() {
return this.spawnPos;
}
public boolean isConfigured() {
return this.configured;
}
public static void serverTick(ServerLevel level, QueenTrailSpawnMarkerBlockEntity marker) {
if (!marker.configured || marker.consumed || level.getDifficulty() == Difficulty.PEACEFUL) {
return;
}
if (Math.floorMod(level.getGameTime(), 20L) != Math.floorMod(marker.siteId, 20L)) {
return;
}
boolean nearbyPlayer = level.players().stream().anyMatch(player -> !player.isSpectator()
&& player.distanceToSqr(marker.spawnPos.getX() + 0.5D, marker.spawnPos.getY() + 0.5D, marker.spawnPos.getZ() + 0.5D) <= ACTIVATION_DISTANCE_SQUARED);
if (!nearbyPlayer || !level.hasChunkAt(marker.spawnPos)) {
return;
}
QueenEntity queen = QueenEntity.spawnFromUndersideTrail(level, marker.spawnPos, marker.homePos, marker.siteId, marker.yaw);
if (queen != null) {
marker.consumed = true;
marker.queenUuid = queen.getUUID();
marker.setChanged();
}
}
@Override
protected void saveAdditional(CompoundTag tag, HolderLookup.Provider registries) {
super.saveAdditional(tag, registries);
tag.putLong("site_id", this.siteId);
tag.putLong("spawn_pos", this.spawnPos.asLong());
tag.putLong("home_pos", this.homePos.asLong());
tag.putFloat("yaw", this.yaw);
tag.putBoolean("configured", this.configured);
tag.putBoolean("consumed", this.consumed);
if (this.queenUuid != null) {
tag.putUUID("queen_uuid", this.queenUuid);
}
}
@Override
protected void loadAdditional(CompoundTag tag, HolderLookup.Provider registries) {
super.loadAdditional(tag, registries);
this.siteId = tag.getLong("site_id");
this.spawnPos = BlockPos.of(tag.getLong("spawn_pos"));
this.homePos = BlockPos.of(tag.getLong("home_pos"));
this.yaw = tag.getFloat("yaw");
this.configured = tag.getBoolean("configured");
this.consumed = tag.getBoolean("consumed");
this.queenUuid = tag.hasUUID("queen_uuid") ? tag.getUUID("queen_uuid") : null;
}
}
@@ -0,0 +1,97 @@
package com.craisinlord.antarchy.content.block.entity;
import com.craisinlord.antarchy.Antarchy;
import net.minecraft.core.BlockPos;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.core.particles.SimpleParticleType;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.game.ClientGamePacketListener;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.entity.vault.VaultConfig;
import net.minecraft.world.level.block.entity.vault.VaultState;
import net.minecraft.world.level.block.entity.vault.VaultBlockEntity;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.phys.Vec3;
import java.util.Optional;
import java.util.function.Supplier;
public final class UnderVaultBlockEntity extends BlockEntity {
private final VaultBlockEntity vaultData;
public UnderVaultBlockEntity(BlockPos pos, BlockState state, Supplier<? extends BlockEntityType<UnderVaultBlockEntity>> type) {
super(type.get(), pos, state);
this.vaultData = new VaultBlockEntity(pos, Blocks.VAULT.defaultBlockState());
this.vaultData.setConfig(createConfig());
}
private static VaultConfig createConfig() {
return new VaultConfig(ResourceKey.create(net.minecraft.core.registries.Registries.LOOT_TABLE,
ResourceLocation.withDefaultNamespace("chests/trial_chambers/reward")), 4.0D, 4.0D,
new ItemStack(BuiltInRegistries.ITEM.get(ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "undertrial_key"))),
Optional.empty());
}
public static void serverTick(ServerLevel level, BlockPos pos, BlockState state, UnderVaultBlockEntity blockEntity) {
blockEntity.vaultData.setLevel(level);
VaultBlockEntity.Server.tick(level, pos, state, blockEntity.vaultData.getConfig(), blockEntity.vaultData.getServerData(), blockEntity.vaultData.getSharedData());
}
public static void clientTick(Level level, BlockPos pos, BlockState state, UnderVaultBlockEntity blockEntity) {
blockEntity.vaultData.setLevel(level);
VaultBlockEntity.Client.tick(level, pos, state, blockEntity.vaultData.getClientData(), blockEntity.vaultData.getSharedData());
if (level instanceof ClientLevel clientLevel && clientLevel.random.nextInt(4) == 0
&& (vaultState(state) == VaultState.ACTIVE || vaultState(state) == VaultState.UNLOCKING)) {
Player player = clientLevel.getNearestPlayer(pos.getX() + 0.5D, pos.getY() + 0.5D, pos.getZ() + 0.5D, 8.0D, false);
if (player != null) {
Vec3 start = Vec3.atCenterOf(pos);
Vec3 end = player.position().add(0.0D, player.getBbHeight() * 0.5D, 0.0D);
double progress = 0.15D + clientLevel.random.nextDouble() * 0.7D;
Vec3 point = start.lerp(end, progress);
clientLevel.addParticle((SimpleParticleType) BuiltInRegistries.PARTICLE_TYPE.get(ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "undervault_connection")), point.x, point.y, point.z, 0.0D, 0.0D, 0.0D);
}
}
}
@Override
protected void loadAdditional(CompoundTag tag, net.minecraft.core.HolderLookup.Provider registries) {
vaultData.loadCustomOnly(tag, registries);
}
@Override
protected void saveAdditional(CompoundTag tag, net.minecraft.core.HolderLookup.Provider registries) {
tag.merge(vaultData.saveCustomOnly(registries));
}
@Override
public CompoundTag getUpdateTag(net.minecraft.core.HolderLookup.Provider registries) {
return vaultData.saveCustomOnly(registries);
}
@Override
public Packet<ClientGamePacketListener> getUpdatePacket() {
return net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket.create(this);
}
public VaultBlockEntity getVaultData() {
return vaultData;
}
private static VaultState vaultState(BlockState state) {
return (VaultState) state.getValues().entrySet().stream()
.filter(entry -> entry.getKey().getName().equals("vault_state"))
.findFirst()
.orElseThrow()
.getValue();
}
}
@@ -0,0 +1,144 @@
package com.craisinlord.antarchy.content.block.entity;
import com.craisinlord.antarchy.content.AntarchyObjects;
import com.craisinlord.antarchy.content.block.UndertrialSpawnerBlock;
import com.craisinlord.antarchy.Antarchy;
import net.minecraft.core.BlockPos;
import net.minecraft.core.particles.SimpleParticleType;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.NbtOps;
import net.minecraft.resources.RegistryOps;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.core.registries.Registries;
import net.minecraft.world.effect.MobEffect;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.entity.Mob;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.trialspawner.TrialSpawner;
import net.minecraft.world.level.block.entity.trialspawner.TrialSpawnerState;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.AABB;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import java.util.function.Supplier;
public final class UndertrialSpawnerBlockEntity extends BlockEntity implements TrialSpawner.StateAccessor {
private static final String SPAWNER_TAG = "trial_spawner";
private static final int EFFECT_DURATION = 3600;
private TrialSpawner trialSpawner;
private TrialSpawnerState previousClientState;
private double clientSpin;
private double clientOldSpin;
public UndertrialSpawnerBlockEntity(BlockPos pos, BlockState state, Supplier<? extends net.minecraft.world.level.block.entity.BlockEntityType<UndertrialSpawnerBlockEntity>> type) {
super(type.get(), pos, state);
this.trialSpawner = new TrialSpawner(this, net.minecraft.world.level.block.entity.trialspawner.PlayerDetector.INCLUDING_CREATIVE_PLAYERS,
net.minecraft.world.level.block.entity.trialspawner.PlayerDetector.EntitySelector.SELECT_FROM_LEVEL);
this.previousClientState = state.getValue(UndertrialSpawnerBlock.STATE);
}
public static void serverTick(ServerLevel level, BlockPos pos, BlockState state, UndertrialSpawnerBlockEntity blockEntity) {
Set<UUID> before = new HashSet<>();
for (Mob mob : level.getEntitiesOfClass(Mob.class, new AABB(pos).inflate(16.0D))) {
before.add(mob.getUUID());
}
blockEntity.trialSpawner.tickServer(level, pos, state.getValue(UndertrialSpawnerBlock.OMINOUS));
for (Mob mob : level.getEntitiesOfClass(Mob.class, new AABB(pos).inflate(16.0D))) {
if (!before.contains(mob.getUUID())) {
blockEntity.applyUndertrialEffects(mob);
}
}
}
public static void clientTick(Level level, BlockPos pos, BlockState state, UndertrialSpawnerBlockEntity blockEntity) {
TrialSpawnerState currentState = state.getValue(UndertrialSpawnerBlock.STATE);
blockEntity.clientOldSpin = blockEntity.clientSpin;
if (currentState == TrialSpawnerState.ACTIVE || currentState == TrialSpawnerState.WAITING_FOR_REWARD_EJECTION) {
blockEntity.clientSpin = (blockEntity.clientSpin + 4.0D) % 360.0D;
}
if (currentState == TrialSpawnerState.ACTIVE || currentState == TrialSpawnerState.WAITING_FOR_REWARD_EJECTION) {
if (level.random.nextInt(2) == 0) {
level.addParticle(blockEntity.particle("undertrial_omen"), pos.getX() + 0.5D + (level.random.nextDouble() - 0.5D) * 0.7D,
pos.getY() + 0.45D + level.random.nextDouble() * 0.35D,
pos.getZ() + 0.5D + (level.random.nextDouble() - 0.5D) * 0.7D, 0.0D, 0.01D, 0.0D);
}
} else if (currentState == TrialSpawnerState.WAITING_FOR_PLAYERS && blockEntity.previousClientState != currentState) {
for (int i = 0; i < 12; i++) {
level.addParticle(blockEntity.particle("undertrial_spawner_detection"), pos.getX() + 0.5D + (level.random.nextDouble() - 0.5D) * 1.4D,
pos.getY() + 0.15D + level.random.nextDouble() * 0.7D,
pos.getZ() + 0.5D + (level.random.nextDouble() - 0.5D) * 1.4D, 0.0D, 0.0D, 0.0D);
}
}
blockEntity.previousClientState = currentState;
}
private SimpleParticleType particle(String id) {
return (SimpleParticleType) BuiltInRegistries.PARTICLE_TYPE.get(ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, id));
}
private void applyUndertrialEffects(Mob mob) {
mob.addEffect(new MobEffectInstance(AntarchyObjects.INVERTED_EFFECT.get(), EFFECT_DURATION, 0, false, true, true));
int roll = mob.getRandom().nextInt(100);
if (roll < 30) {
mob.addEffect(new MobEffectInstance(effect("contracted"), EFFECT_DURATION, 0, false, true, true));
} else if (roll < 50) {
mob.addEffect(new MobEffectInstance(effect("shrinking"), EFFECT_DURATION, 0, false, true, true));
} else if (roll < 65) {
mob.addEffect(new MobEffectInstance(effect("growth"), EFFECT_DURATION, 0, false, true, true));
}
}
private static net.minecraft.core.Holder<MobEffect> effect(String path) {
return BuiltInRegistries.MOB_EFFECT.getHolderOrThrow(ResourceKey.create(Registries.MOB_EFFECT,
ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, path)));
}
@Override
protected void loadAdditional(CompoundTag tag, net.minecraft.core.HolderLookup.Provider registries) {
super.loadAdditional(tag, registries);
if (tag.contains(SPAWNER_TAG)) {
trialSpawner.codec().parse(RegistryOps.create(NbtOps.INSTANCE, registries), tag.get(SPAWNER_TAG)).result().ifPresent(decoded -> {
trialSpawner = decoded;
});
}
}
@Override
protected void saveAdditional(CompoundTag tag, net.minecraft.core.HolderLookup.Provider registries) {
super.saveAdditional(tag, registries);
trialSpawner.codec().encodeStart(RegistryOps.create(NbtOps.INSTANCE, registries), trialSpawner).result()
.ifPresent(encoded -> tag.put(SPAWNER_TAG, encoded));
}
@Override
public void setState(Level level, TrialSpawnerState state) {
level.setBlockAndUpdate(worldPosition, getBlockState().setValue(UndertrialSpawnerBlock.STATE, state));
}
@Override
public TrialSpawnerState getState() {
return getBlockState().getValue(UndertrialSpawnerBlock.STATE);
}
@Override
public void markUpdated() {
setChanged();
if (level != null) {
level.sendBlockUpdated(worldPosition, getBlockState(), getBlockState(), 3);
}
}
public TrialSpawner getTrialSpawner() {
return trialSpawner;
}
public double getClientSpin(float partialTick) {
return this.clientOldSpin + (this.clientSpin - this.clientOldSpin) * partialTick;
}
}
@@ -1,23 +1,23 @@
package com.craisinlord.antarchy.content.client.model;
import com.craisinlord.antarchy.Antarchy;
import com.craisinlord.antarchy.content.entity.CreepingHorrorEntity;
import com.craisinlord.antarchy.content.entity.CrawlingBlightEntity;
import net.minecraft.resources.ResourceLocation;
import software.bernie.geckolib.model.GeoModel;
public class CreepingHorrorModel extends GeoModel<CreepingHorrorEntity> {
public class CrawlingBlightModel extends GeoModel<CrawlingBlightEntity> {
@Override
public ResourceLocation getModelResource(CreepingHorrorEntity animatable) {
return ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "geo/creeping_horror.geo.json");
public ResourceLocation getModelResource(CrawlingBlightEntity animatable) {
return ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "geo/crawling_blight.geo.json");
}
@Override
public ResourceLocation getTextureResource(CreepingHorrorEntity animatable) {
return ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "textures/entity/creeping_horror.png");
public ResourceLocation getTextureResource(CrawlingBlightEntity animatable) {
return ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "textures/entity/crawling_blight.png");
}
@Override
public ResourceLocation getAnimationResource(CreepingHorrorEntity animatable) {
return ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "animations/creeping_horror.animation.json");
public ResourceLocation getAnimationResource(CrawlingBlightEntity animatable) {
return ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "animations/crawling_blight.animation.json");
}
}
@@ -1,27 +1,27 @@
package com.craisinlord.antarchy.content.client.model;
import com.craisinlord.antarchy.Antarchy;
import com.craisinlord.antarchy.content.entity.TriffidEntity;
import com.craisinlord.antarchy.content.entity.FlytrapEntity;
import net.minecraft.resources.ResourceLocation;
import software.bernie.geckolib.model.GeoModel;
public class TriffidModel extends GeoModel<TriffidEntity> {
private static final ResourceLocation MODEL = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "geo/triffid.geo.json");
private static final ResourceLocation TEXTURE = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "textures/entity/triffid.png");
private static final ResourceLocation ANIMATION = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "animations/triffid.animation.json");
public class FlytrapModel extends GeoModel<FlytrapEntity> {
private static final ResourceLocation MODEL = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "geo/flytrap.geo.json");
private static final ResourceLocation TEXTURE = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "textures/entity/flytrap.png");
private static final ResourceLocation ANIMATION = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "animations/flytrap.animation.json");
@Override
public ResourceLocation getModelResource(TriffidEntity animatable) {
public ResourceLocation getModelResource(FlytrapEntity animatable) {
return MODEL;
}
@Override
public ResourceLocation getTextureResource(TriffidEntity animatable) {
public ResourceLocation getTextureResource(FlytrapEntity animatable) {
return TEXTURE;
}
@Override
public ResourceLocation getAnimationResource(TriffidEntity animatable) {
public ResourceLocation getAnimationResource(FlytrapEntity animatable) {
return ANIMATION;
}
}
@@ -1,23 +0,0 @@
package com.craisinlord.antarchy.content.client.model;
import com.craisinlord.antarchy.Antarchy;
import com.craisinlord.antarchy.content.entity.LurkingTerrorEntity;
import net.minecraft.resources.ResourceLocation;
import software.bernie.geckolib.model.GeoModel;
public class LurkingTerrorModel extends GeoModel<LurkingTerrorEntity> {
@Override
public ResourceLocation getModelResource(LurkingTerrorEntity animatable) {
return ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "geo/lurking_terror.geo.json");
}
@Override
public ResourceLocation getTextureResource(LurkingTerrorEntity animatable) {
return ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "textures/entity/lurking_terror.png");
}
@Override
public ResourceLocation getAnimationResource(LurkingTerrorEntity animatable) {
return ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "animations/lurking_terror.animation.json");
}
}
@@ -0,0 +1,23 @@
package com.craisinlord.antarchy.content.client.model;
import com.craisinlord.antarchy.Antarchy;
import com.craisinlord.antarchy.content.entity.SkulkingFrightEntity;
import net.minecraft.resources.ResourceLocation;
import software.bernie.geckolib.model.GeoModel;
public class SkulkingFrightModel extends GeoModel<SkulkingFrightEntity> {
@Override
public ResourceLocation getModelResource(SkulkingFrightEntity animatable) {
return ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "geo/skulking_fright.geo.json");
}
@Override
public ResourceLocation getTextureResource(SkulkingFrightEntity animatable) {
return ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "textures/entity/skulking_fright.png");
}
@Override
public ResourceLocation getAnimationResource(SkulkingFrightEntity animatable) {
return ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "animations/skulking_fright.animation.json");
}
}
@@ -1,26 +1,26 @@
package com.craisinlord.antarchy.content.client.model;
import com.craisinlord.antarchy.Antarchy;
import com.craisinlord.antarchy.content.entity.JumpyBugEntity;
import com.craisinlord.antarchy.content.entity.SpringbugEntity;
import net.minecraft.resources.ResourceLocation;
import software.bernie.geckolib.model.GeoModel;
public class JumpyBugModel extends GeoModel<JumpyBugEntity> {
public class SpringbugModel extends GeoModel<SpringbugEntity> {
public static final ResourceLocation EMISSIVE_TEXTURE =
ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "textures/entity/jumpy_bug_emissive.png");
ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "textures/entity/springbug_emissive.png");
@Override
public ResourceLocation getModelResource(JumpyBugEntity animatable) {
return ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "geo/jumpy_bug.geo.json");
public ResourceLocation getModelResource(SpringbugEntity animatable) {
return ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "geo/springbug.geo.json");
}
@Override
public ResourceLocation getTextureResource(JumpyBugEntity animatable) {
return ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "textures/entity/jumpy_bug.png");
public ResourceLocation getTextureResource(SpringbugEntity animatable) {
return ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "textures/entity/springbug.png");
}
@Override
public ResourceLocation getAnimationResource(JumpyBugEntity animatable) {
return ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "animations/jumpy_bug.animation.json");
public ResourceLocation getAnimationResource(SpringbugEntity animatable) {
return ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "animations/springbug.animation.json");
}
}
@@ -1,28 +1,28 @@
package com.craisinlord.antarchy.content.client.model;
import com.craisinlord.antarchy.Antarchy;
import com.craisinlord.antarchy.content.entity.cloud_shark.CloudSharkEntity;
import com.craisinlord.antarchy.content.entity.stratoshark.StratosharkEntity;
import net.minecraft.resources.ResourceLocation;
import software.bernie.geckolib.model.GeoModel;
public class CloudSharkModel extends GeoModel<CloudSharkEntity> {
public class StratosharkModel extends GeoModel<StratosharkEntity> {
public static final ResourceLocation BASE_TEXTURE =
ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "textures/entity/cloud_shark/cloud_shark.png");
ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "textures/entity/stratoshark/stratoshark.png");
public static final ResourceLocation EMISSIVE_TEXTURE =
ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "textures/entity/cloud_shark/cloud_shark_emissive.png");
ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "textures/entity/stratoshark/stratoshark_emissive.png");
@Override
public ResourceLocation getModelResource(CloudSharkEntity animatable) {
return ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "geo/cloud_shark.geo.json");
public ResourceLocation getModelResource(StratosharkEntity animatable) {
return ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "geo/stratoshark.geo.json");
}
@Override
public ResourceLocation getTextureResource(CloudSharkEntity animatable) {
public ResourceLocation getTextureResource(StratosharkEntity animatable) {
return BASE_TEXTURE;
}
@Override
public ResourceLocation getAnimationResource(CloudSharkEntity animatable) {
return ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "animations/cloud_shark.animation.json");
public ResourceLocation getAnimationResource(StratosharkEntity animatable) {
return ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "animations/stratoshark.animation.json");
}
}
@@ -0,0 +1,73 @@
package com.craisinlord.antarchy.content.client.particle;
import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.client.particle.Particle;
import net.minecraft.client.particle.ParticleProvider;
import net.minecraft.client.particle.ParticleRenderType;
import net.minecraft.client.particle.SpriteSet;
import net.minecraft.client.particle.TextureSheetParticle;
import net.minecraft.core.particles.SimpleParticleType;
public final class UndertrialParticle extends TextureSheetParticle {
private final SpriteSet sprites;
private final boolean animated;
private UndertrialParticle(ClientLevel level, double x, double y, double z, double xd, double yd, double zd,
SpriteSet sprites, boolean animated) {
super(level, x, y, z, xd, yd, zd);
this.sprites = sprites;
this.animated = animated;
this.xd = xd;
this.yd = yd;
this.zd = zd;
this.gravity = 0.0F;
this.friction = 0.96F;
this.hasPhysics = false;
this.quadSize = animated ? 0.16F + this.random.nextFloat() * 0.08F : 0.2F + this.random.nextFloat() * 0.1F;
this.lifetime = animated ? 10 : 24;
this.setAlpha(0.9F);
this.pickSprite(sprites);
}
@Override
public void tick() {
super.tick();
if (this.animated) {
this.setSprite(this.sprites.get(this.age, this.lifetime));
}
this.setAlpha(0.9F * (1.0F - (float) this.age / (float) this.lifetime));
}
@Override
public ParticleRenderType getRenderType() {
return ParticleRenderType.PARTICLE_SHEET_TRANSLUCENT;
}
public static final class DetectionProvider implements ParticleProvider<SimpleParticleType> {
private final SpriteSet sprites;
public DetectionProvider(SpriteSet sprites) {
this.sprites = sprites;
}
@Override
public Particle createParticle(SimpleParticleType type, ClientLevel level, double x, double y, double z,
double xd, double yd, double zd) {
return new UndertrialParticle(level, x, y, z, xd, yd, zd, this.sprites, true);
}
}
public static final class OmenProvider implements ParticleProvider<SimpleParticleType> {
private final SpriteSet sprites;
public OmenProvider(SpriteSet sprites) {
this.sprites = sprites;
}
@Override
public Particle createParticle(SimpleParticleType type, ClientLevel level, double x, double y, double z,
double xd, double yd, double zd) {
return new UndertrialParticle(level, x, y, z, xd, yd, zd, this.sprites, false);
}
}
}
@@ -1,7 +1,7 @@
package com.craisinlord.antarchy.content.client.renderer;
import com.craisinlord.antarchy.content.client.model.CreepingHorrorModel;
import com.craisinlord.antarchy.content.entity.CreepingHorrorEntity;
import com.craisinlord.antarchy.content.client.model.CrawlingBlightModel;
import com.craisinlord.antarchy.content.entity.CrawlingBlightEntity;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.math.Axis;
@@ -11,15 +11,15 @@ import org.jetbrains.annotations.Nullable;
import software.bernie.geckolib.cache.object.BakedGeoModel;
import software.bernie.geckolib.renderer.GeoEntityRenderer;
public class CreepingHorrorRenderer extends GeoEntityRenderer<CreepingHorrorEntity> {
public CreepingHorrorRenderer(EntityRendererProvider.Context context) {
super(context, new CreepingHorrorModel());
public class CrawlingBlightRenderer extends GeoEntityRenderer<CrawlingBlightEntity> {
public CrawlingBlightRenderer(EntityRendererProvider.Context context) {
super(context, new CrawlingBlightModel());
this.shadowRadius = 0.5F;
this.withScale(0.85F);
}
@Override
public void preRender(PoseStack poseStack, CreepingHorrorEntity animatable, BakedGeoModel model, @Nullable MultiBufferSource bufferSource, @Nullable VertexConsumer buffer, boolean isReRender, float partialTick, int packedLight, int packedOverlay, int colour) {
public void preRender(PoseStack poseStack, CrawlingBlightEntity animatable, BakedGeoModel model, @Nullable MultiBufferSource bufferSource, @Nullable VertexConsumer buffer, boolean isReRender, float partialTick, int packedLight, int packedOverlay, int colour) {
super.preRender(poseStack, animatable, model, bufferSource, buffer, isReRender, partialTick, packedLight, packedOverlay, colour);
if (animatable.isWallClimbing()) {
poseStack.mulPose(Axis.XP.rotationDegrees(-90.0F));
@@ -0,0 +1,18 @@
package com.craisinlord.antarchy.content.client.renderer;
import com.craisinlord.antarchy.content.client.model.FlytrapModel;
import com.craisinlord.antarchy.content.entity.FlytrapEntity;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import software.bernie.geckolib.renderer.GeoEntityRenderer;
public class FlytrapRenderer extends GeoEntityRenderer<FlytrapEntity> {
public FlytrapRenderer(EntityRendererProvider.Context context) {
super(context, new FlytrapModel());
this.shadowRadius = 1.4F;
}
@Override
protected float getDeathMaxRotation(FlytrapEntity animatable) {
return 0.0F;
}
}
@@ -1,14 +0,0 @@
package com.craisinlord.antarchy.content.client.renderer;
import com.craisinlord.antarchy.content.client.model.LurkingTerrorModel;
import com.craisinlord.antarchy.content.entity.LurkingTerrorEntity;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import software.bernie.geckolib.renderer.GeoEntityRenderer;
public class LurkingTerrorRenderer extends GeoEntityRenderer<LurkingTerrorEntity> {
public LurkingTerrorRenderer(EntityRendererProvider.Context context) {
super(context, new LurkingTerrorModel());
this.shadowRadius = 0.5F;
this.withScale(0.85F);
}
}
@@ -0,0 +1,14 @@
package com.craisinlord.antarchy.content.client.renderer;
import com.craisinlord.antarchy.content.client.model.SkulkingFrightModel;
import com.craisinlord.antarchy.content.entity.SkulkingFrightEntity;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import software.bernie.geckolib.renderer.GeoEntityRenderer;
public class SkulkingFrightRenderer extends GeoEntityRenderer<SkulkingFrightEntity> {
public SkulkingFrightRenderer(EntityRendererProvider.Context context) {
super(context, new SkulkingFrightModel());
this.shadowRadius = 0.5F;
this.withScale(0.85F);
}
}
@@ -1,7 +1,7 @@
package com.craisinlord.antarchy.content.client.renderer;
import com.craisinlord.antarchy.content.client.model.JumpyBugModel;
import com.craisinlord.antarchy.content.entity.JumpyBugEntity;
import com.craisinlord.antarchy.content.client.model.SpringbugModel;
import com.craisinlord.antarchy.content.entity.SpringbugEntity;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.math.Axis;
@@ -16,26 +16,26 @@ import software.bernie.geckolib.renderer.GeoEntityRenderer;
import software.bernie.geckolib.renderer.layer.GeoRenderLayer;
import software.bernie.geckolib.util.Color;
public class JumpyBugRenderer extends GeoEntityRenderer<JumpyBugEntity> {
public JumpyBugRenderer(EntityRendererProvider.Context context) {
super(context, new JumpyBugModel());
public class SpringbugRenderer extends GeoEntityRenderer<SpringbugEntity> {
public SpringbugRenderer(EntityRendererProvider.Context context) {
super(context, new SpringbugModel());
this.shadowRadius = 6.0F;
this.addRenderLayer(new JumpyBugEmissiveLayer(this));
this.addRenderLayer(new SpringbugEmissiveLayer(this));
}
@Override
public RenderType getRenderType(JumpyBugEntity animatable, ResourceLocation texture, @Nullable MultiBufferSource bufferSource, float partialTick) {
public RenderType getRenderType(SpringbugEntity animatable, ResourceLocation texture, @Nullable MultiBufferSource bufferSource, float partialTick) {
return animatable.isCamouflaged() ? RenderType.entityTranslucent(texture) : RenderType.entityCutoutNoCull(texture);
}
@Override
public Color getRenderColor(JumpyBugEntity animatable, float partialTick, int packedLight) {
public Color getRenderColor(SpringbugEntity animatable, float partialTick, int packedLight) {
int alpha = Math.max(10, Math.min(255, Math.round(animatable.getVisualAlpha(partialTick) * 255.0F)));
return Color.ofRGBA(255, 255, 255, alpha);
}
@Override
public void preRender(PoseStack poseStack, JumpyBugEntity animatable, BakedGeoModel model, @Nullable MultiBufferSource bufferSource, @Nullable VertexConsumer buffer, boolean isReRender, float partialTick, int packedLight, int packedOverlay, int colour) {
public void preRender(PoseStack poseStack, SpringbugEntity animatable, BakedGeoModel model, @Nullable MultiBufferSource bufferSource, @Nullable VertexConsumer buffer, boolean isReRender, float partialTick, int packedLight, int packedOverlay, int colour) {
super.preRender(poseStack, animatable, model, bufferSource, buffer, isReRender, partialTick, packedLight, packedOverlay, colour);
this.shadowRadius = animatable.isCamouflaged() ? 1.0F : 6.0F;
@@ -45,18 +45,18 @@ public class JumpyBugRenderer extends GeoEntityRenderer<JumpyBugEntity> {
}
}
private static final class JumpyBugEmissiveLayer extends GeoRenderLayer<JumpyBugEntity> {
private JumpyBugEmissiveLayer(GeoEntityRenderer<JumpyBugEntity> renderer) {
private static final class SpringbugEmissiveLayer extends GeoRenderLayer<SpringbugEntity> {
private SpringbugEmissiveLayer(GeoEntityRenderer<SpringbugEntity> renderer) {
super(renderer);
}
@Override
public void render(PoseStack poseStack, JumpyBugEntity animatable, BakedGeoModel bakedModel, @Nullable RenderType renderType,
public void render(PoseStack poseStack, SpringbugEntity animatable, BakedGeoModel bakedModel, @Nullable RenderType renderType,
MultiBufferSource bufferSource, @Nullable VertexConsumer buffer, float partialTick,
int packedLight, int packedOverlay) {
RenderType emissiveType = animatable.isCamouflaged()
? RenderType.entityTranslucent(JumpyBugModel.EMISSIVE_TEXTURE)
: RenderType.eyes(JumpyBugModel.EMISSIVE_TEXTURE);
? RenderType.entityTranslucent(SpringbugModel.EMISSIVE_TEXTURE)
: RenderType.eyes(SpringbugModel.EMISSIVE_TEXTURE);
int alpha = Math.max(10, Math.min(255, Math.round(animatable.getVisualAlpha(partialTick) * 255.0F)));
int colour = (alpha << 24) | 0x00FFFFFF;
VertexConsumer emissiveBuffer = bufferSource.getBuffer(emissiveType);
@@ -1,7 +1,7 @@
package com.craisinlord.antarchy.content.client.renderer;
import com.craisinlord.antarchy.content.client.model.CloudSharkModel;
import com.craisinlord.antarchy.content.entity.cloud_shark.CloudSharkEntity;
import com.craisinlord.antarchy.content.client.model.StratosharkModel;
import com.craisinlord.antarchy.content.entity.stratoshark.StratosharkEntity;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import net.minecraft.client.renderer.MultiBufferSource;
@@ -14,30 +14,30 @@ import software.bernie.geckolib.cache.object.BakedGeoModel;
import software.bernie.geckolib.renderer.GeoEntityRenderer;
import software.bernie.geckolib.renderer.layer.GeoRenderLayer;
public class CloudSharkRenderer extends GeoEntityRenderer<CloudSharkEntity> {
public class StratosharkRenderer extends GeoEntityRenderer<StratosharkEntity> {
private static final float SHADOW_RADIUS = 0.6F;
public CloudSharkRenderer(EntityRendererProvider.Context context) {
super(context, new CloudSharkModel());
public StratosharkRenderer(EntityRendererProvider.Context context) {
super(context, new StratosharkModel());
this.shadowRadius = SHADOW_RADIUS;
this.addRenderLayer(new CloudSharkEmissiveLayer(this));
this.addRenderLayer(new StratosharkEmissiveLayer(this));
}
@Override
public RenderType getRenderType(CloudSharkEntity animatable, ResourceLocation texture, @Nullable MultiBufferSource bufferSource, float partialTick) {
public RenderType getRenderType(StratosharkEntity animatable, ResourceLocation texture, @Nullable MultiBufferSource bufferSource, float partialTick) {
return RenderType.entityCutoutNoCull(texture);
}
private static final class CloudSharkEmissiveLayer extends GeoRenderLayer<CloudSharkEntity> {
private CloudSharkEmissiveLayer(GeoEntityRenderer<CloudSharkEntity> renderer) {
private static final class StratosharkEmissiveLayer extends GeoRenderLayer<StratosharkEntity> {
private StratosharkEmissiveLayer(GeoEntityRenderer<StratosharkEntity> renderer) {
super(renderer);
}
@Override
public void render(PoseStack poseStack, CloudSharkEntity animatable, BakedGeoModel bakedModel, @Nullable RenderType renderType,
public void render(PoseStack poseStack, StratosharkEntity animatable, BakedGeoModel bakedModel, @Nullable RenderType renderType,
MultiBufferSource bufferSource, @Nullable VertexConsumer buffer, float partialTick,
int packedLight, int packedOverlay) {
RenderType emissiveType = RenderType.eyes(CloudSharkModel.EMISSIVE_TEXTURE);
RenderType emissiveType = RenderType.eyes(StratosharkModel.EMISSIVE_TEXTURE);
VertexConsumer emissiveBuffer = bufferSource.getBuffer(emissiveType);
this.getRenderer().reRender(
bakedModel,
@@ -1,18 +0,0 @@
package com.craisinlord.antarchy.content.client.renderer;
import com.craisinlord.antarchy.content.client.model.TriffidModel;
import com.craisinlord.antarchy.content.entity.TriffidEntity;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import software.bernie.geckolib.renderer.GeoEntityRenderer;
public class TriffidRenderer extends GeoEntityRenderer<TriffidEntity> {
public TriffidRenderer(EntityRendererProvider.Context context) {
super(context, new TriffidModel());
this.shadowRadius = 1.4F;
}
@Override
protected float getDeathMaxRotation(TriffidEntity animatable) {
return 0.0F;
}
}
@@ -0,0 +1,21 @@
package com.craisinlord.antarchy.content.client.renderer;
import com.craisinlord.antarchy.content.block.entity.UnderVaultBlockEntity;
import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.blockentity.BlockEntityRenderer;
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
import net.minecraft.client.renderer.blockentity.VaultRenderer;
public final class UnderVaultRenderer implements BlockEntityRenderer<UnderVaultBlockEntity> {
private final VaultRenderer delegate;
public UnderVaultRenderer(BlockEntityRendererProvider.Context context) {
this.delegate = new VaultRenderer(context);
}
@Override
public void render(UnderVaultBlockEntity blockEntity, float partialTick, PoseStack poseStack, MultiBufferSource bufferSource, int packedLight, int packedOverlay) {
this.delegate.render(blockEntity.getVaultData(), partialTick, poseStack, bufferSource, packedLight, packedOverlay);
}
}
@@ -0,0 +1,35 @@
package com.craisinlord.antarchy.content.client.renderer;
import com.craisinlord.antarchy.content.block.entity.UndertrialSpawnerBlockEntity;
import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.blockentity.BlockEntityRenderer;
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
import net.minecraft.client.renderer.blockentity.SpawnerRenderer;
import net.minecraft.client.renderer.entity.EntityRenderDispatcher;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.Level;
public final class UndertrialSpawnerRenderer implements BlockEntityRenderer<UndertrialSpawnerBlockEntity> {
private final EntityRenderDispatcher entityRenderer;
public UndertrialSpawnerRenderer(BlockEntityRendererProvider.Context context) {
this.entityRenderer = context.getEntityRenderer();
}
@Override
public void render(UndertrialSpawnerBlockEntity blockEntity, float partialTick, PoseStack poseStack,
MultiBufferSource buffer, int packedLight, int packedOverlay) {
Level level = blockEntity.getLevel();
if (level == null) {
return;
}
var spawner = blockEntity.getTrialSpawner();
var data = spawner.getData();
Entity entity = data.getOrCreateDisplayEntity(spawner, level, spawner.getState());
if (entity != null) {
SpawnerRenderer.renderEntityInSpawner(partialTick, poseStack, buffer, packedLight, entity,
entityRenderer, blockEntity.getClientSpin(partialTick), blockEntity.getClientSpin(partialTick));
}
}
}
@@ -0,0 +1,101 @@
package com.craisinlord.antarchy.content.command;
import com.craisinlord.antarchy.Antarchy;
import com.craisinlord.antarchy.content.block.entity.QueenTrailSpawnMarkerBlockEntity;
import com.craisinlord.antarchy.content.worldgen.thoraxis.QueenTrailGrid;
import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.context.CommandContext;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.Commands;
import net.minecraft.core.BlockPos;
import net.minecraft.core.registries.Registries;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.util.Mth;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.entity.BlockEntity;
public final class QueenLocateCommand {
private static final ResourceKey<Level> THORAXIS = ResourceKey.create(
Registries.DIMENSION,
ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "thoraxis")
);
private static final int SEARCH_RADIUS_CELLS = 8;
private static final int MAX_SITE_CHECKS = 64;
private QueenLocateCommand() {
}
public static void register(CommandDispatcher<CommandSourceStack> dispatcher) {
dispatcher.register(Commands.literal("locatequeen")
.requires(source -> source.hasPermission(2))
.executes(QueenLocateCommand::locate));
}
private static int locate(CommandContext<CommandSourceStack> context) {
CommandSourceStack source = context.getSource();
ServerLevel thoraxis = source.getServer().getLevel(THORAXIS);
if (thoraxis == null) {
source.sendFailure(Component.literal("Thoraxis is not available."));
return 0;
}
int originX = Mth.floor(source.getPosition().x);
int originZ = Mth.floor(source.getPosition().z);
int cellX = Math.floorDiv(originX, QueenTrailGrid.SPACING);
int cellZ = Math.floorDiv(originZ, QueenTrailGrid.SPACING);
List<QueenTrailGrid.Site> sites = new ArrayList<>();
for (int x = cellX - SEARCH_RADIUS_CELLS; x <= cellX + SEARCH_RADIUS_CELLS; x++) {
for (int z = cellZ - SEARCH_RADIUS_CELLS; z <= cellZ + SEARCH_RADIUS_CELLS; z++) {
sites.add(QueenTrailGrid.site(thoraxis.getSeed(), x, z));
}
}
sites.sort(Comparator.comparingDouble(site -> distanceSquared(originX, originZ, site)));
int checks = Math.min(MAX_SITE_CHECKS, sites.size());
for (int index = 0; index < checks; index++) {
QueenTrailGrid.Site site = sites.get(index);
thoraxis.getChunk(site.terminalX() >> 4, site.terminalZ() >> 4);
QueenTrailSpawnMarkerBlockEntity marker = findMarker(thoraxis, site);
if (marker == null) {
continue;
}
BlockPos spawn = marker.getSpawnPos();
int distance = Mth.floor(Math.sqrt(distanceSquared(originX, originZ, site)));
source.sendSuccess(() -> Component.literal(
"Nearest Queen spawn in antarchy:thoraxis: ["
+ spawn.getX() + ", " + spawn.getY() + ", " + spawn.getZ()
+ "] (" + distance + " blocks away)"
), false);
return distance;
}
source.sendFailure(Component.literal("No configured Queen spawn was found within the search area."));
return 0;
}
private static QueenTrailSpawnMarkerBlockEntity findMarker(ServerLevel level, QueenTrailGrid.Site site) {
BlockPos.MutableBlockPos cursor = new BlockPos.MutableBlockPos(site.terminalX(), level.getMinBuildHeight(), site.terminalZ());
for (int y = level.getMinBuildHeight(); y < level.getMaxBuildHeight(); y++) {
cursor.setY(y);
BlockEntity blockEntity = level.getBlockEntity(cursor);
if (blockEntity instanceof QueenTrailSpawnMarkerBlockEntity marker
&& marker.isConfigured()
&& marker.getSiteId() == site.id()) {
return marker;
}
}
return null;
}
private static double distanceSquared(int originX, int originZ, QueenTrailGrid.Site site) {
double dx = site.terminalX() - originX;
double dz = site.terminalZ() - originZ;
return dx * dx + dz * dz;
}
}
@@ -358,11 +358,11 @@ public final class CreativeTabContents {
entry("glowcap_mushroom_block", "natural_blocks"),
entry("infested_rooted_dirt", "natural_blocks"),
entry("infested_coarse_dirt", "natural_blocks"),
entry("triffid_goo_block", "natural_blocks"),
entry("flytrap_goo_block", "natural_blocks"),
entry("bed_bug_egg", "natural_blocks"),
entry("creeping_horror_egg", "natural_blocks"),
entry("lurking_terror_egg", "natural_blocks"),
entry("jumpy_bug_egg", "natural_blocks"),
entry("crawling_blight_egg", "natural_blocks"),
entry("skulking_fright_egg", "natural_blocks"),
entry("springbug_egg", "natural_blocks"),
entry("spit_bug_egg", "natural_blocks"),
entry("jerry_egg", "natural_blocks"),
entry("wasp_nest", "natural_blocks"),
@@ -392,6 +392,9 @@ public final class CreativeTabContents {
entry("cloud_bucket", "tools_and_utilities"),
entry("cheep_bucket", "tools_and_utilities"),
entry("lucid_anchor", "tools_and_utilities"),
entry("undertrial_spawner", "tools_and_utilities"),
entry("undervault", "tools_and_utilities"),
entry("undertrial_key", "tools_and_utilities"),
entry("reverie_bottle", "tools_and_utilities"),
entry("glimmer_bottle", "tools_and_utilities"),
entry("critter_cage", "tools_and_utilities"),
@@ -463,7 +466,7 @@ public final class CreativeTabContents {
entry("fallen_king_crown", "combat"),
entry("brutalfly_elytra", "combat"),
entry("manticore_wings", "combat"),
entry("jumpy_boots", "combat"),
entry("springy_boots", "combat"),
entry("raw_uranium_scrap", "ingredients"),
entry("raw_titanium_scrap", "ingredients"),
entry("bluestone", "redstone_blocks"),
@@ -473,8 +476,8 @@ public final class CreativeTabContents {
entry("titanium_nugget", "ingredients"),
entry("uranium_ingot", "ingredients"),
entry("titanium_ingot", "ingredients"),
entry("cloud_shark_fin", "ingredients"),
entry("cloud_shark_fin_soup", "ingredients"),
entry("stratoshark_fin", "ingredients"),
entry("stratoshark_fin_soup", "ingredients"),
entry("basilisk_fang", "ingredients"),
entry("nightmare_scale", "ingredients"),
entry("molevore_nose", "ingredients"),
@@ -497,13 +500,13 @@ public final class CreativeTabContents {
entry("brutalfly_wing", "ingredients"),
entry("manticore_wing", "ingredients"),
entry("primordial_scute", "ingredients"),
entry("triffid_goo", "ingredients"),
entry("flytrap_goo", "ingredients"),
entry("vortex_charge", "ingredients"),
entry("emperor_scorpion_stinger", "ingredients"),
entry("kraken_tooth", "ingredients"),
entry("kraken_tentacle", "ingredients"),
entry("kraken_kalamari", "ingredients"),
entry("jumpy_bug_leg", "ingredients"),
entry("springbug_leg", "ingredients"),
entry("cornea_ear", "ingredients"),
entry("corn", "ingredients"),
entry("high_fructose_corn_syrup", "ingredients"),
@@ -559,17 +562,17 @@ public final class CreativeTabContents {
entry("alpha_mantis_spawn_egg", "spawn_eggs"),
entry("rolly_polly_spawn_egg", "spawn_eggs"),
entry("molevore_spawn_egg", "spawn_eggs"),
entry("triffid_spawn_egg", "spawn_eggs"),
entry("flytrap_spawn_egg", "spawn_eggs"),
entry("apple_cow_spawn_egg", "spawn_eggs"),
entry("golden_apple_cow_spawn_egg", "spawn_eggs"),
entry("enchanted_golden_apple_cow_spawn_egg", "spawn_eggs"),
entry("dr_trayaurus_spawn_egg", "spawn_eggs"),
entry("wasp_spawn_egg", "spawn_eggs"),
entry("bomber_spawn_egg", "spawn_eggs"),
entry("jumpy_bug_spawn_egg", "spawn_eggs"),
entry("springbug_spawn_egg", "spawn_eggs"),
entry("spit_bug_spawn_egg", "spawn_eggs"),
entry("stink_bug_spawn_egg", "spawn_eggs"),
entry("cloud_shark_spawn_egg", "spawn_eggs"),
entry("stratoshark_spawn_egg", "spawn_eggs"),
entry("kraken_spawn_egg", "spawn_eggs"),
entry("missile_squid_spawn_egg", "spawn_eggs"),
entry("octopus_bomb_spawn_egg", "spawn_eggs"),
@@ -581,8 +584,8 @@ public final class CreativeTabContents {
entry("basilisk_spawn_egg", "spawn_eggs"),
entry("emperor_scorpion_spawn_egg", "spawn_eggs"),
entry("toreterror_spawn_egg", "spawn_eggs"),
entry("creeping_horror_spawn_egg", "spawn_eggs"),
entry("lurking_terror_spawn_egg", "spawn_eggs"),
entry("crawling_blight_spawn_egg", "spawn_eggs"),
entry("skulking_fright_spawn_egg", "spawn_eggs"),
entry("hercules_beetle_spawn_egg", "spawn_eggs"),
entry("jerry_spawn_egg", "spawn_eggs"),
entry("dorrie_spawn_egg", "spawn_eggs"),
@@ -62,20 +62,20 @@ public final class AntarchyDamageSources {
);
}
public static DamageSource triffidMauling(ServerLevel level, Entity attacker) {
public static DamageSource flytrapMauling(ServerLevel level, Entity attacker) {
return new DamageSource(
level.registryAccess()
.registryOrThrow(Registries.DAMAGE_TYPE)
.getHolderOrThrow(AntarchyDamageTypes.TRIFFID_MAULING),
.getHolderOrThrow(AntarchyDamageTypes.FLYTRAP_MAULING),
attacker
);
}
public static DamageSource triffidSwallow(ServerLevel level, Entity attacker) {
public static DamageSource flytrapSwallow(ServerLevel level, Entity attacker) {
return new DamageSource(
level.registryAccess()
.registryOrThrow(Registries.DAMAGE_TYPE)
.getHolderOrThrow(AntarchyDamageTypes.TRIFFID_SWALLOW),
.getHolderOrThrow(AntarchyDamageTypes.FLYTRAP_SWALLOW),
attacker
);
}
@@ -125,11 +125,11 @@ public final class AntarchyDamageSources {
);
}
public static DamageSource jumpyBugJump(ServerLevel level, Entity attacker) {
public static DamageSource springbugJump(ServerLevel level, Entity attacker) {
return new DamageSource(
level.registryAccess()
.registryOrThrow(Registries.DAMAGE_TYPE)
.getHolderOrThrow(AntarchyDamageTypes.JUMPY_BUG_JUMP),
.getHolderOrThrow(AntarchyDamageTypes.SPRINGBUG_JUMP),
attacker
);
}
@@ -43,16 +43,16 @@ public final class AntarchyDamageTypes {
ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "emperor_scorpion_sting")
);
public static final ResourceKey<DamageType> TRIFFID_MAULING =
public static final ResourceKey<DamageType> FLYTRAP_MAULING =
ResourceKey.create(
Registries.DAMAGE_TYPE,
ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "triffid_mauling")
ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "flytrap_mauling")
);
public static final ResourceKey<DamageType> TRIFFID_SWALLOW =
public static final ResourceKey<DamageType> FLYTRAP_SWALLOW =
ResourceKey.create(
Registries.DAMAGE_TYPE,
ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "triffid_swallow")
ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "flytrap_swallow")
);
public static final ResourceKey<DamageType> CORNEA_STALK_PRICK =
@@ -91,10 +91,10 @@ public final class AntarchyDamageTypes {
ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "spit_bug_disrespect")
);
public static final ResourceKey<DamageType> JUMPY_BUG_JUMP =
public static final ResourceKey<DamageType> SPRINGBUG_JUMP =
ResourceKey.create(
Registries.DAMAGE_TYPE,
ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "jumpy_bug_jump")
ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "springbug_jump")
);
public static final ResourceKey<DamageType> HERCULES_BEETLE_OBLITERATION =
@@ -0,0 +1,47 @@
package com.craisinlord.antarchy.content.enchantment;
import com.craisinlord.antarchy.Antarchy;
import net.minecraft.core.HolderLookup;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.enchantment.Enchantment;
import net.minecraft.world.item.enchantment.EnchantmentHelper;
import net.minecraft.world.item.enchantment.ItemEnchantments;
public final class AntarchyEnchantments {
public static final ResourceKey<Enchantment> FEATHER_RISING = key("feather_rising");
public static final ResourceKey<Enchantment> CHRONOSPHERE = key("chronosphere");
private AntarchyEnchantments() {
}
public static int featherRisingLevel(LivingEntity entity) {
return level(entity, EquipmentSlot.FEET, FEATHER_RISING);
}
public static int chronosphereLevel(LivingEntity entity) {
return level(entity, EquipmentSlot.CHEST, CHRONOSPHERE);
}
public static int level(LivingEntity entity, EquipmentSlot slot, ResourceKey<Enchantment> key) {
var enchantment = entity.level().registryAccess().lookupOrThrow(Registries.ENCHANTMENT).get(key);
return enchantment.map(holder -> EnchantmentHelper.getItemEnchantmentLevel(holder, entity.getItemBySlot(slot))).orElse(0);
}
public static void ensure(ItemStack stack, HolderLookup.Provider registries, ResourceKey<Enchantment> key, int level) {
var enchantment = registries.lookupOrThrow(Registries.ENCHANTMENT).getOrThrow(key);
ItemEnchantments.Mutable enchantments = new ItemEnchantments.Mutable(stack.getEnchantments());
if (enchantments.getLevel(enchantment) < level) {
enchantments.set(enchantment, level);
EnchantmentHelper.setEnchantments(stack, enchantments.toImmutable().withTooltip(true));
}
}
private static ResourceKey<Enchantment> key(String path) {
return ResourceKey.create(Registries.ENCHANTMENT, ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, path));
}
}
@@ -42,9 +42,9 @@ import software.bernie.geckolib.animation.PlayState;
import software.bernie.geckolib.animation.RawAnimation;
import software.bernie.geckolib.util.GeckoLibUtil;
public class CreepingHorrorEntity extends Monster implements GeoEntity {
public class CrawlingBlightEntity extends Monster implements GeoEntity {
private static final EntityDataAccessor<Boolean> CLIMBING =
SynchedEntityData.defineId(CreepingHorrorEntity.class, EntityDataSerializers.BOOLEAN);
SynchedEntityData.defineId(CrawlingBlightEntity.class, EntityDataSerializers.BOOLEAN);
private static final RawAnimation IDLE_ANIM = RawAnimation.begin().thenLoop("idle");
private static final RawAnimation WALK_ANIM = RawAnimation.begin().thenLoop("walk");
@@ -54,7 +54,7 @@ public class CreepingHorrorEntity extends Monster implements GeoEntity {
private final AnimatableInstanceCache geoCache = GeckoLibUtil.createInstanceCache(this);
private int attackAnimTicks = 0;
public CreepingHorrorEntity(EntityType<? extends CreepingHorrorEntity> type, Level level) {
public CrawlingBlightEntity(EntityType<? extends CrawlingBlightEntity> type, Level level) {
super(type, level);
}
@@ -71,19 +71,19 @@ public class CreepingHorrorEntity extends Monster implements GeoEntity {
public static AttributeSupplier.Builder createAttributes() {
return Mob.createMobAttributes()
.add(Attributes.MAX_HEALTH, AntarchySettings.creepingHorrorHealth())
.add(Attributes.MAX_HEALTH, AntarchySettings.crawlingBlightHealth())
.add(Attributes.MOVEMENT_SPEED, 0.38D)
.add(Attributes.ATTACK_DAMAGE, AntarchySettings.creepingHorrorAttackDamage())
.add(Attributes.ATTACK_DAMAGE, AntarchySettings.crawlingBlightAttackDamage())
.add(Attributes.FOLLOW_RANGE, 16.0D);
}
@Override
public net.minecraft.world.entity.SpawnGroupData finalizeSpawn(net.minecraft.world.level.ServerLevelAccessor level, net.minecraft.world.DifficultyInstance difficulty, net.minecraft.world.entity.MobSpawnType spawnReason, net.minecraft.world.entity.SpawnGroupData spawnData) {
ConfiguredMobSpawnUtil.applyConfiguredHealth(this, AntarchySettings.creepingHorrorHealth());
ConfiguredMobSpawnUtil.applyConfiguredHealth(this, AntarchySettings.crawlingBlightHealth());
return super.finalizeSpawn(level, difficulty, spawnReason, spawnData);
}
public static boolean canSpawn(EntityType<CreepingHorrorEntity> entityType, ServerLevelAccessor level, MobSpawnType spawnReason, BlockPos pos, RandomSource random) {
public static boolean canSpawn(EntityType<CrawlingBlightEntity> entityType, ServerLevelAccessor level, MobSpawnType spawnReason, BlockPos pos, RandomSource random) {
if (spawnReason == MobSpawnType.SPAWN_EGG || spawnReason == MobSpawnType.SPAWNER || spawnReason == MobSpawnType.COMMAND) {
return true;
}
@@ -133,7 +133,7 @@ public class CreepingHorrorEntity extends Monster implements GeoEntity {
.triggerableAnim("attack", ATTACK_ANIM));
}
private PlayState mainAnimController(AnimationState<CreepingHorrorEntity> state) {
private PlayState mainAnimController(AnimationState<CrawlingBlightEntity> state) {
if (attackAnimTicks > 0) {
return state.setAndContinue(ATTACK_ANIM);
}
@@ -152,7 +152,7 @@ public class CreepingHorrorEntity extends Monster implements GeoEntity {
public boolean doHurtTarget(net.minecraft.world.entity.Entity target) {
boolean result = super.doHurtTarget(target);
if (result) {
this.playSound(AntarchySoundEvents.CREEPING_HORROR_BITE.get(), 1.0F, 0.95F + this.random.nextFloat() * 0.1F);
this.playSound(AntarchySoundEvents.CRAWLING_BLIGHT_BITE.get(), 1.0F, 0.95F + this.random.nextFloat() * 0.1F);
this.setAttackAnimTicks(20);
this.level().broadcastEntityEvent(this, ATTACK_ANIM_EVENT);
}
@@ -172,17 +172,17 @@ public class CreepingHorrorEntity extends Monster implements GeoEntity {
@Override
protected SoundEvent getAmbientSound() {
return AntarchySoundEvents.CREEPING_HORROR_GROWL.get();
return AntarchySoundEvents.CRAWLING_BLIGHT_GROWL.get();
}
@Override
protected SoundEvent getHurtSound(net.minecraft.world.damagesource.DamageSource source) {
return AntarchySoundEvents.CREEPING_HORROR_HURT.get();
return AntarchySoundEvents.CRAWLING_BLIGHT_HURT.get();
}
@Override
protected SoundEvent getDeathSound() {
return AntarchySoundEvents.CREEPING_HORROR_HURT.get();
return AntarchySoundEvents.CRAWLING_BLIGHT_HURT.get();
}
@Override
@@ -46,9 +46,9 @@ import software.bernie.geckolib.animation.PlayState;
import software.bernie.geckolib.animation.RawAnimation;
import software.bernie.geckolib.util.GeckoLibUtil;
public class TriffidEntity extends Monster implements GeoEntity {
private static final EntityDataAccessor<Integer> ACTION_STATE = SynchedEntityData.defineId(TriffidEntity.class, EntityDataSerializers.INT);
private static final EntityDataAccessor<Boolean> AWAKE = SynchedEntityData.defineId(TriffidEntity.class, EntityDataSerializers.BOOLEAN);
public class FlytrapEntity extends Monster implements GeoEntity {
private static final EntityDataAccessor<Integer> ACTION_STATE = SynchedEntityData.defineId(FlytrapEntity.class, EntityDataSerializers.INT);
private static final EntityDataAccessor<Boolean> AWAKE = SynchedEntityData.defineId(FlytrapEntity.class, EntityDataSerializers.BOOLEAN);
private static final int ACTION_NONE = 0;
private static final int ACTION_SWEEP = 1;
private static final int ACTION_GRAB = 2;
@@ -88,29 +88,29 @@ public class TriffidEntity extends Monster implements GeoEntity {
private boolean grabDamageApplied;
private int preySearchCooldown = 0;
public TriffidEntity(EntityType<? extends TriffidEntity> entityType, Level level) {
public FlytrapEntity(EntityType<? extends FlytrapEntity> entityType, Level level) {
super(entityType, level);
this.xpReward = 15;
}
public static AttributeSupplier.Builder createAttributes() {
return Monster.createMonsterAttributes()
.add(Attributes.MAX_HEALTH, AntarchySettings.triffidHealth())
.add(Attributes.ATTACK_DAMAGE, AntarchySettings.triffidAttackDamage())
.add(Attributes.MAX_HEALTH, AntarchySettings.flytrapHealth())
.add(Attributes.ATTACK_DAMAGE, AntarchySettings.flytrapAttackDamage())
.add(Attributes.FOLLOW_RANGE, FOLLOW_RANGE)
.add(Attributes.KNOCKBACK_RESISTANCE, 1.0D)
.add(Attributes.MOVEMENT_SPEED, 0.0D)
.add(Attributes.ARMOR_TOUGHNESS, AntarchySettings.triffidArmorToughness());
.add(Attributes.ARMOR_TOUGHNESS, AntarchySettings.flytrapArmorToughness());
}
@Override
public net.minecraft.world.entity.SpawnGroupData finalizeSpawn(net.minecraft.world.level.ServerLevelAccessor level, net.minecraft.world.DifficultyInstance difficulty,
MobSpawnType spawnReason, net.minecraft.world.entity.SpawnGroupData spawnData) {
ConfiguredMobSpawnUtil.applyConfiguredHealth(this, AntarchySettings.triffidHealth());
ConfiguredMobSpawnUtil.applyConfiguredHealth(this, AntarchySettings.flytrapHealth());
return super.finalizeSpawn(level, difficulty, spawnReason, spawnData);
}
public static boolean canSpawn(EntityType<TriffidEntity> entityType, LevelAccessor level, MobSpawnType spawnReason, BlockPos pos, RandomSource random) {
public static boolean canSpawn(EntityType<FlytrapEntity> entityType, LevelAccessor level, MobSpawnType spawnReason, BlockPos pos, RandomSource random) {
if (pos.getY() < level.getMinBuildHeight() || pos.getY() + 7 >= level.getMaxBuildHeight()) {
return false;
}
@@ -164,7 +164,7 @@ public class TriffidEntity extends Monster implements GeoEntity {
this.goalSelector.addGoal(0, new FloatGoal(this));
this.goalSelector.addGoal(1, new LookAtPlayerGoal(this, Player.class, 16.0F));
this.targetSelector.addGoal(1, new HurtByTargetGoal(this));
this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, LivingEntity.class, 10, true, false, TriffidEntity::isValidPreyTarget));
this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, LivingEntity.class, 10, true, false, FlytrapEntity::isValidPreyTarget));
}
@Override
@@ -175,7 +175,7 @@ public class TriffidEntity extends Monster implements GeoEntity {
.triggerableAnim("death", DEATH_ANIM));
}
private PlayState mainAnimController(AnimationState<TriffidEntity> state) {
private PlayState mainAnimController(AnimationState<FlytrapEntity> state) {
return switch (this.getActionState()) {
case ACTION_SWEEP -> state.setAndContinue(SWEEP_ANIM);
case ACTION_GRAB -> state.setAndContinue(GRAB_ANIM);
@@ -284,10 +284,10 @@ public class TriffidEntity extends Monster implements GeoEntity {
}
if (!this.isAwake()) {
return this.random.nextInt(24) == 0 ? AntarchySoundEvents.TRIFFID_HISS.get() : null;
return this.random.nextInt(24) == 0 ? AntarchySoundEvents.FLYTRAP_HISS.get() : null;
}
return this.getTarget() != null ? AntarchySoundEvents.TRIFFID_GROWL.get() : null;
return this.getTarget() != null ? AntarchySoundEvents.FLYTRAP_GROWL.get() : null;
}
@Override
@@ -301,12 +301,12 @@ public class TriffidEntity extends Monster implements GeoEntity {
@Override
protected SoundEvent getHurtSound(DamageSource damageSource) {
return AntarchySoundEvents.TRIFFID_HURT.get();
return AntarchySoundEvents.FLYTRAP_HURT.get();
}
@Override
protected SoundEvent getDeathSound() {
return AntarchySoundEvents.TRIFFID_DEATH.get();
return AntarchySoundEvents.FLYTRAP_DEATH.get();
}
@Override
@@ -357,7 +357,7 @@ public class TriffidEntity extends Monster implements GeoEntity {
this.attackCooldown = SWEEP_COOLDOWN_TICKS;
this.actionStartYaw = this.getAngleTo(target) - 100.0F;
this.setYRot(this.actionStartYaw);
this.playSound(AntarchySoundEvents.TRIFFID_ATTACK.get(), 0.9F, 0.75F);
this.playSound(AntarchySoundEvents.FLYTRAP_ATTACK.get(), 0.9F, 0.75F);
}
private void tickSweepAttack() {
@@ -392,7 +392,7 @@ public class TriffidEntity extends Monster implements GeoEntity {
List<LivingEntity> candidates = this.level().getEntitiesOfClass(
LivingEntity.class,
this.getBoundingBox().inflate(SWEEP_RANGE, 1.0D, SWEEP_RANGE),
TriffidEntity::isValidLivePrey
FlytrapEntity::isValidLivePrey
);
for (LivingEntity candidate : candidates) {
@@ -412,8 +412,8 @@ public class TriffidEntity extends Monster implements GeoEntity {
// shield or armor effect can absorb the damage and make hurt() return false without
// granting the vanilla invulnerability window, which would otherwise let this attack
// re-attempt damage on the same entity every single tick of the active window.
this.sweepHitCooldowns.put(candidate.getUUID(), AntarchySettings.triffidSweepHitCooldownTicks());
candidate.hurt(AntarchyDamageSources.triffidMauling(serverLevel, this), (float) AntarchySettings.triffidAttackDamage());
this.sweepHitCooldowns.put(candidate.getUUID(), AntarchySettings.flytrapSweepHitCooldownTicks());
candidate.hurt(AntarchyDamageSources.flytrapMauling(serverLevel, this), (float) AntarchySettings.flytrapAttackDamage());
}
}
@@ -424,7 +424,7 @@ public class TriffidEntity extends Monster implements GeoEntity {
this.grabTargetId = target.getId();
this.grabDamageApplied = false;
this.setYRot(this.getAngleTo(target));
this.playSound(AntarchySoundEvents.TRIFFID_GRAB.get(), 0.8F, 0.85F);
this.playSound(AntarchySoundEvents.FLYTRAP_GRAB.get(), 0.8F, 0.85F);
}
private void tickGrabAttack() {
@@ -443,9 +443,9 @@ public class TriffidEntity extends Monster implements GeoEntity {
if (!this.grabDamageApplied && elapsed >= GRAB_DAMAGE_TICK) {
this.grabDamageApplied = true;
if (this.level() instanceof ServerLevel serverLevel) {
grabTarget.hurt(AntarchyDamageSources.triffidSwallow(serverLevel, this), (float) AntarchySettings.triffidGrabDamage());
grabTarget.hurt(AntarchyDamageSources.flytrapSwallow(serverLevel, this), (float) AntarchySettings.flytrapGrabDamage());
} else {
grabTarget.hurt(this.damageSources().mobAttack(this), (float) AntarchySettings.triffidGrabDamage());
grabTarget.hurt(this.damageSources().mobAttack(this), (float) AntarchySettings.flytrapGrabDamage());
}
}
@@ -496,7 +496,7 @@ public class TriffidEntity extends Monster implements GeoEntity {
return !this.level().getEntitiesOfClass(
LivingEntity.class,
this.getBoundingBox().inflate(WAKE_RANGE, 4.0D, WAKE_RANGE),
TriffidEntity::isValidLivePrey
FlytrapEntity::isValidLivePrey
).isEmpty();
}
@@ -505,7 +505,7 @@ public class TriffidEntity extends Monster implements GeoEntity {
List<LivingEntity> candidates = this.level().getEntitiesOfClass(
LivingEntity.class,
this.getBoundingBox().inflate(FOLLOW_RANGE, 6.0D, FOLLOW_RANGE),
TriffidEntity::isValidLivePrey
FlytrapEntity::isValidLivePrey
);
LivingEntity best = null;
double bestDistance = Double.MAX_VALUE;
@@ -527,15 +527,15 @@ public class TriffidEntity extends Monster implements GeoEntity {
private void syncConfiguredAttributes() {
if (this.getAttribute(Attributes.MAX_HEALTH) != null) {
this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(AntarchySettings.triffidHealth());
this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(AntarchySettings.flytrapHealth());
}
if (this.getAttribute(Attributes.ATTACK_DAMAGE) != null) {
this.getAttribute(Attributes.ATTACK_DAMAGE).setBaseValue(AntarchySettings.triffidAttackDamage());
this.getAttribute(Attributes.ATTACK_DAMAGE).setBaseValue(AntarchySettings.flytrapAttackDamage());
}
}
private static boolean isLowHealthPrey(LivingEntity target) {
return target.getHealth() <= Math.max((float) AntarchySettings.triffidGrabDamage(), target.getMaxHealth() * 0.35F);
return target.getHealth() <= Math.max((float) AntarchySettings.flytrapGrabDamage(), target.getMaxHealth() * 0.35F);
}
private int getActionState() {
@@ -573,6 +573,6 @@ public class TriffidEntity extends Monster implements GeoEntity {
if (target instanceof Player player) {
return !player.isCreative() && !player.isSpectator();
}
return target.getType().is(AntarchyTags.Entities.TRIFFID_PREY);
return target.getType().is(AntarchyTags.Entities.FLYTRAP_PREY);
}
}
@@ -37,7 +37,7 @@ import software.bernie.geckolib.animation.PlayState;
import software.bernie.geckolib.animation.RawAnimation;
import software.bernie.geckolib.util.GeckoLibUtil;
public class LurkingTerrorEntity extends Monster implements GeoEntity {
public class SkulkingFrightEntity extends Monster implements GeoEntity {
private static final RawAnimation IDLE_ANIM = RawAnimation.begin().thenLoop("idle");
private static final RawAnimation WALK_ANIM = RawAnimation.begin().thenLoop("walk");
private static final RawAnimation FLY_ANIM = RawAnimation.begin().thenLoop("fly");
@@ -48,16 +48,16 @@ public class LurkingTerrorEntity extends Monster implements GeoEntity {
private final AnimatableInstanceCache geoCache = GeckoLibUtil.createInstanceCache(this);
private int attackAnimTicks = 0;
public LurkingTerrorEntity(EntityType<? extends LurkingTerrorEntity> type, Level level) {
public SkulkingFrightEntity(EntityType<? extends SkulkingFrightEntity> type, Level level) {
super(type, level);
this.moveControl = new FlyingMoveControl(this, 10, true);
}
public static AttributeSupplier.Builder createAttributes() {
return Mob.createMobAttributes()
.add(Attributes.MAX_HEALTH, AntarchySettings.lurkingTerrorHealth())
.add(Attributes.MAX_HEALTH, AntarchySettings.skulkingFrightHealth())
.add(Attributes.MOVEMENT_SPEED, 0.35D)
.add(Attributes.ATTACK_DAMAGE, AntarchySettings.lurkingTerrorAttackDamage())
.add(Attributes.ATTACK_DAMAGE, AntarchySettings.skulkingFrightAttackDamage())
.add(Attributes.FOLLOW_RANGE, 16.0D)
.add(Attributes.FLYING_SPEED, 0.55D);
}
@@ -65,11 +65,11 @@ public class LurkingTerrorEntity extends Monster implements GeoEntity {
@Override
public net.minecraft.world.entity.SpawnGroupData finalizeSpawn(ServerLevelAccessor level, net.minecraft.world.DifficultyInstance difficulty,
MobSpawnType spawnReason, net.minecraft.world.entity.SpawnGroupData spawnData) {
ConfiguredMobSpawnUtil.applyConfiguredHealth(this, AntarchySettings.lurkingTerrorHealth());
ConfiguredMobSpawnUtil.applyConfiguredHealth(this, AntarchySettings.skulkingFrightHealth());
return super.finalizeSpawn(level, difficulty, spawnReason, spawnData);
}
public static boolean canSpawn(EntityType<LurkingTerrorEntity> entityType, ServerLevelAccessor level, MobSpawnType spawnReason, BlockPos pos, RandomSource random) {
public static boolean canSpawn(EntityType<SkulkingFrightEntity> entityType, ServerLevelAccessor level, MobSpawnType spawnReason, BlockPos pos, RandomSource random) {
if (spawnReason == MobSpawnType.SPAWN_EGG || spawnReason == MobSpawnType.SPAWNER || spawnReason == MobSpawnType.COMMAND) {
return true;
}
@@ -120,7 +120,7 @@ public class LurkingTerrorEntity extends Monster implements GeoEntity {
.triggerableAnim("attackair", ATTACK_AIR_ANIM));
}
private PlayState mainAnimController(AnimationState<LurkingTerrorEntity> state) {
private PlayState mainAnimController(AnimationState<SkulkingFrightEntity> state) {
if (attackAnimTicks > 0) {
if (!this.onGround()) {
return state.setAndContinue(ATTACK_AIR_ANIM);
@@ -145,7 +145,7 @@ public class LurkingTerrorEntity extends Monster implements GeoEntity {
public boolean doHurtTarget(net.minecraft.world.entity.Entity target) {
boolean result = super.doHurtTarget(target);
if (result) {
this.playSound(AntarchySoundEvents.LURKING_TERROR_BITE.get(), 1.0F, 0.95F + this.random.nextFloat() * 0.1F);
this.playSound(AntarchySoundEvents.SKULKING_FRIGHT_BITE.get(), 1.0F, 0.95F + this.random.nextFloat() * 0.1F);
this.setAttackAnimTicks(20);
this.level().broadcastEntityEvent(this, ATTACK_ANIM_EVENT);
}
@@ -154,17 +154,17 @@ public class LurkingTerrorEntity extends Monster implements GeoEntity {
@Override
protected SoundEvent getAmbientSound() {
return AntarchySoundEvents.LURKING_TERROR_SNARL.get();
return AntarchySoundEvents.SKULKING_FRIGHT_SNARL.get();
}
@Override
protected SoundEvent getHurtSound(net.minecraft.world.damagesource.DamageSource source) {
return AntarchySoundEvents.LURKING_TERROR_HURT.get();
return AntarchySoundEvents.SKULKING_FRIGHT_HURT.get();
}
@Override
protected SoundEvent getDeathSound() {
return AntarchySoundEvents.LURKING_TERROR_HURT.get();
return AntarchySoundEvents.SKULKING_FRIGHT_HURT.get();
}
@Override
@@ -182,7 +182,7 @@ public class LurkingTerrorEntity extends Monster implements GeoEntity {
super.tick();
CavarynBurrowingMobBehavior.moveOutOfBlocks(this);
if (!this.level().isClientSide() && !this.onGround() && this.tickCount % 80 == 0) {
this.playSound(AntarchySoundEvents.LURKING_TERROR_FLY_LOOP.get(), 0.45F, 0.95F + this.random.nextFloat() * 0.1F);
this.playSound(AntarchySoundEvents.SKULKING_FRIGHT_FLY_LOOP.get(), 0.45F, 0.95F + this.random.nextFloat() * 0.1F);
}
if (attackAnimTicks > 0) this.setAttackAnimTicks(attackAnimTicks - 1);
}
@@ -61,13 +61,13 @@ import software.bernie.geckolib.util.GeckoLibUtil;
import java.util.EnumSet;
import java.util.function.IntFunction;
public class JumpyBugEntity extends Monster implements GeoEntity {
public class SpringbugEntity extends Monster implements GeoEntity {
private static final EntityDataAccessor<Boolean> CAMOUFLAGED =
SynchedEntityData.defineId(JumpyBugEntity.class, EntityDataSerializers.BOOLEAN);
SynchedEntityData.defineId(SpringbugEntity.class, EntityDataSerializers.BOOLEAN);
private static final EntityDataAccessor<Boolean> CLINGING_TO_CEILING =
SynchedEntityData.defineId(JumpyBugEntity.class, EntityDataSerializers.BOOLEAN);
SynchedEntityData.defineId(SpringbugEntity.class, EntityDataSerializers.BOOLEAN);
private static final EntityDataAccessor<Integer> ATTACK_STATE =
SynchedEntityData.defineId(JumpyBugEntity.class, EntityDataSerializers.INT);
SynchedEntityData.defineId(SpringbugEntity.class, EntityDataSerializers.INT);
private static final String POUNCE_COOLDOWN_KEY = "PounceCooldown";
private static final String RECOVERY_TICKS_KEY = "RecoveryTicks";
@@ -121,20 +121,20 @@ public class JumpyBugEntity extends Monster implements GeoEntity {
private float visualAlpha = 1.0F;
private float previousVisualAlpha = 1.0F;
public JumpyBugEntity(EntityType<? extends JumpyBugEntity> entityType, Level level) {
public SpringbugEntity(EntityType<? extends SpringbugEntity> entityType, Level level) {
super(entityType, level);
this.xpReward = 6;
}
public static AttributeSupplier.Builder createAttributes() {
return Mob.createMobAttributes()
.add(Attributes.MAX_HEALTH, AntarchySettings.jumpyBugHealth())
.add(Attributes.ATTACK_DAMAGE, AntarchySettings.jumpyBugPounceDamage())
.add(Attributes.MAX_HEALTH, AntarchySettings.springbugHealth())
.add(Attributes.ATTACK_DAMAGE, AntarchySettings.springbugPounceDamage())
.add(Attributes.MOVEMENT_SPEED, DEFAULT_MOVEMENT_SPEED)
.add(Attributes.FOLLOW_RANGE, DEFAULT_FOLLOW_RANGE);
}
public static boolean canSpawn(EntityType<JumpyBugEntity> entityType, ServerLevelAccessor level, MobSpawnType spawnReason, BlockPos pos, RandomSource random) {
public static boolean canSpawn(EntityType<SpringbugEntity> entityType, ServerLevelAccessor level, MobSpawnType spawnReason, BlockPos pos, RandomSource random) {
if (spawnReason == MobSpawnType.SPAWN_EGG || spawnReason == MobSpawnType.SPAWNER || spawnReason == MobSpawnType.COMMAND) {
return true;
}
@@ -200,9 +200,9 @@ public class JumpyBugEntity extends Monster implements GeoEntity {
public SpawnGroupData finalizeSpawn(ServerLevelAccessor level, DifficultyInstance difficulty, MobSpawnType spawnReason, @Nullable SpawnGroupData spawnGroupData) {
AttributeInstance maxHealthAttribute = this.getAttribute(Attributes.MAX_HEALTH);
if (maxHealthAttribute != null) {
maxHealthAttribute.setBaseValue(AntarchySettings.jumpyBugHealth());
maxHealthAttribute.setBaseValue(AntarchySettings.springbugHealth());
}
this.setHealth((float) AntarchySettings.jumpyBugHealth());
this.setHealth((float) AntarchySettings.springbugHealth());
return super.finalizeSpawn(level, difficulty, spawnReason, spawnGroupData);
}
@@ -298,23 +298,23 @@ public class JumpyBugEntity extends Monster implements GeoEntity {
@Override
public boolean doHurtTarget(Entity target) {
return target instanceof LivingEntity livingTarget && this.level() instanceof ServerLevel serverLevel
? livingTarget.hurt(AntarchyDamageSources.jumpyBugJump(serverLevel, this), (float) this.getAttributeValue(Attributes.ATTACK_DAMAGE))
? livingTarget.hurt(AntarchyDamageSources.springbugJump(serverLevel, this), (float) this.getAttributeValue(Attributes.ATTACK_DAMAGE))
: super.doHurtTarget(target);
}
@Override
protected SoundEvent getAmbientSound() {
return AntarchySoundEvents.JUMPY_BUG_IDLE.get();
return AntarchySoundEvents.SPRINGBUG_IDLE.get();
}
@Override
protected SoundEvent getHurtSound(DamageSource damageSource) {
return AntarchySoundEvents.JUMPY_BUG_HURT.get();
return AntarchySoundEvents.SPRINGBUG_HURT.get();
}
@Override
protected SoundEvent getDeathSound() {
return AntarchySoundEvents.JUMPY_BUG_HURT.get();
return AntarchySoundEvents.SPRINGBUG_HURT.get();
}
@Override
@@ -381,10 +381,10 @@ public class JumpyBugEntity extends Monster implements GeoEntity {
}
private float getTargetVisualAlpha() {
return this.isCamouflaged() ? (float) AntarchySettings.jumpyBugCamouflageAlpha() : 1.0F;
return this.isCamouflaged() ? (float) AntarchySettings.springbugCamouflageAlpha() : 1.0F;
}
private PlayState mainAnimController(AnimationState<JumpyBugEntity> state) {
private PlayState mainAnimController(AnimationState<SpringbugEntity> state) {
AttackState attackState = this.getAttackState();
if (attackState == AttackState.CLINGING) {
return state.setAndContinue(HANGING_ANIM);
@@ -424,9 +424,9 @@ public class JumpyBugEntity extends Monster implements GeoEntity {
LivingEntity target = this.getTarget();
if (target != null && target.isAlive() && this.distanceToSqr(target) <= POUNCE_LAND_DAMAGE_RANGE * POUNCE_LAND_DAMAGE_RANGE) {
if (this.level() instanceof ServerLevel serverLevel) {
target.hurt(AntarchyDamageSources.jumpyBugJump(serverLevel, this), (float) AntarchySettings.jumpyBugPounceDamage());
target.hurt(AntarchyDamageSources.springbugJump(serverLevel, this), (float) AntarchySettings.springbugPounceDamage());
} else {
target.hurt(this.damageSources().mobAttack(this), (float) AntarchySettings.jumpyBugPounceDamage());
target.hurt(this.damageSources().mobAttack(this), (float) AntarchySettings.springbugPounceDamage());
}
}
this.finishPounce(false);
@@ -604,7 +604,7 @@ public class JumpyBugEntity extends Monster implements GeoEntity {
Mth.clamp(localDelta.z * 0.18D, -0.35D, 0.35D)
));
this.hasImpulse = true;
this.playSound(AntarchySoundEvents.JUMPY_BUG_JUMP.get(), 1.0F, 0.95F + this.random.nextFloat() * 0.1F);
this.playSound(AntarchySoundEvents.SPRINGBUG_JUMP.get(), 1.0F, 0.95F + this.random.nextFloat() * 0.1F);
}
private void cancelLeap() {
@@ -629,7 +629,7 @@ public class JumpyBugEntity extends Monster implements GeoEntity {
double upward = POUNCE_UPWARD_SPEED + Mth.clamp(to.y * 0.08D, -0.04D, 0.22D);
this.setDeltaMovement(this.toWorld(direction.x * POUNCE_HORIZONTAL_SPEED, upward, direction.z * POUNCE_HORIZONTAL_SPEED));
this.hasImpulse = true;
this.playSound(AntarchySoundEvents.JUMPY_BUG_JUMP.get(), 1.0F, 0.95F + this.random.nextFloat() * 0.1F);
this.playSound(AntarchySoundEvents.SPRINGBUG_JUMP.get(), 1.0F, 0.95F + this.random.nextFloat() * 0.1F);
}
private void beginCeilingDrop(LivingEntity target) {
@@ -647,7 +647,7 @@ public class JumpyBugEntity extends Monster implements GeoEntity {
Vec3 direction = horizontal.lengthSqr() > 1.0E-4D ? horizontal.normalize() : this.toLocalPlane(target.getLookAngle()).normalize();
this.setDeltaMovement(this.toWorld(direction.x * CEILING_DROP_HORIZONTAL_SPEED, CEILING_DROP_UPWARD_SPEED, direction.z * CEILING_DROP_HORIZONTAL_SPEED));
this.hasImpulse = true;
this.playSound(AntarchySoundEvents.JUMPY_BUG_JUMP.get(), 1.0F, 0.9F + this.random.nextFloat() * 0.1F);
this.playSound(AntarchySoundEvents.SPRINGBUG_JUMP.get(), 1.0F, 0.9F + this.random.nextFloat() * 0.1F);
}
private void finishPounce(boolean keepMomentum) {
@@ -706,24 +706,24 @@ public class JumpyBugEntity extends Monster implements GeoEntity {
@Override
public boolean canUse() {
LivingEntity target = JumpyBugEntity.this.getTarget();
LivingEntity target = SpringbugEntity.this.getTarget();
return target != null
&& target.isAlive()
&& !JumpyBugEntity.this.isPouncing()
&& !JumpyBugEntity.this.isLeapingToCeiling()
&& !JumpyBugEntity.this.isClingingToCeiling()
&& JumpyBugEntity.this.distanceToSqr(target) <= MELEE_RANGE_SQR;
&& !SpringbugEntity.this.isPouncing()
&& !SpringbugEntity.this.isLeapingToCeiling()
&& !SpringbugEntity.this.isClingingToCeiling()
&& SpringbugEntity.this.distanceToSqr(target) <= MELEE_RANGE_SQR;
}
@Override
public boolean canContinueToUse() {
LivingEntity target = JumpyBugEntity.this.getTarget();
LivingEntity target = SpringbugEntity.this.getTarget();
return target != null
&& target.isAlive()
&& !JumpyBugEntity.this.isPouncing()
&& !JumpyBugEntity.this.isLeapingToCeiling()
&& !JumpyBugEntity.this.isClingingToCeiling()
&& JumpyBugEntity.this.distanceToSqr(target) <= CONTINUE_RANGE_SQR;
&& !SpringbugEntity.this.isPouncing()
&& !SpringbugEntity.this.isLeapingToCeiling()
&& !SpringbugEntity.this.isClingingToCeiling()
&& SpringbugEntity.this.distanceToSqr(target) <= CONTINUE_RANGE_SQR;
}
@Override
@@ -733,17 +733,17 @@ public class JumpyBugEntity extends Monster implements GeoEntity {
@Override
public void tick() {
LivingEntity target = JumpyBugEntity.this.getTarget();
LivingEntity target = SpringbugEntity.this.getTarget();
if (target == null) return;
JumpyBugEntity.this.getLookControl().setLookAt(target, 30.0F, 30.0F);
JumpyBugEntity.this.getNavigation().moveTo(target, 1.1D);
SpringbugEntity.this.getLookControl().setLookAt(target, 30.0F, 30.0F);
SpringbugEntity.this.getNavigation().moveTo(target, 1.1D);
if (this.attackCooldown > 0) {
this.attackCooldown--;
}
if (this.attackCooldown <= 0 && JumpyBugEntity.this.distanceToSqr(target) <= MELEE_RANGE_SQR) {
JumpyBugEntity.this.doHurtTarget(target);
if (this.attackCooldown <= 0 && SpringbugEntity.this.distanceToSqr(target) <= MELEE_RANGE_SQR) {
SpringbugEntity.this.doHurtTarget(target);
this.attackCooldown = ATTACK_COOLDOWN;
}
}
@@ -756,25 +756,25 @@ public class JumpyBugEntity extends Monster implements GeoEntity {
@Override
public boolean canUse() {
LivingEntity target = JumpyBugEntity.this.getTarget();
LivingEntity target = SpringbugEntity.this.getTarget();
return target != null
&& target.isAlive()
&& JumpyBugEntity.this.canUseAmbush()
&& JumpyBugEntity.this.pounceCooldownTicks <= 0
&& JumpyBugEntity.this.preferPounceThisWindow
&& (JumpyBugEntity.this.hasLineOfSight(target) || JumpyBugEntity.this.distanceToSqr(target) <= 9.0D);
&& SpringbugEntity.this.canUseAmbush()
&& SpringbugEntity.this.pounceCooldownTicks <= 0
&& SpringbugEntity.this.preferPounceThisWindow
&& (SpringbugEntity.this.hasLineOfSight(target) || SpringbugEntity.this.distanceToSqr(target) <= 9.0D);
}
@Override
public boolean canContinueToUse() {
return JumpyBugEntity.this.isPouncing();
return SpringbugEntity.this.isPouncing();
}
@Override
public void start() {
LivingEntity target = JumpyBugEntity.this.getTarget();
LivingEntity target = SpringbugEntity.this.getTarget();
if (target != null) {
JumpyBugEntity.this.beginPounce(target);
SpringbugEntity.this.beginPounce(target);
}
}
}
@@ -789,91 +789,91 @@ public class JumpyBugEntity extends Monster implements GeoEntity {
@Override
public boolean canUse() {
if (!JumpyBugEntity.this.canUseAmbush() || JumpyBugEntity.this.isClingingToCeiling()) {
if (!SpringbugEntity.this.canUseAmbush() || SpringbugEntity.this.isClingingToCeiling()) {
return false;
}
if (JumpyBugEntity.this.ceilingSearchCooldownTicks > 0) {
if (SpringbugEntity.this.ceilingSearchCooldownTicks > 0) {
return false;
}
LivingEntity target = JumpyBugEntity.this.getTarget();
LivingEntity target = SpringbugEntity.this.getTarget();
boolean targetFarAway = target != null
&& JumpyBugEntity.this.distanceToSqr(target) > 12.0D * 12.0D;
&& SpringbugEntity.this.distanceToSqr(target) > 12.0D * 12.0D;
boolean noTarget = target == null;
if (!noTarget && !targetFarAway) {
return false;
}
if (JumpyBugEntity.this.random.nextInt(noTarget ? 8 : 14) != 0) {
if (SpringbugEntity.this.random.nextInt(noTarget ? 8 : 14) != 0) {
return false;
}
this.targetCeiling = JumpyBugEntity.this.findCeilingForLeap();
JumpyBugEntity.this.ceilingSearchCooldownTicks = CEILING_SEARCH_COOLDOWN;
this.targetCeiling = SpringbugEntity.this.findCeilingForLeap();
SpringbugEntity.this.ceilingSearchCooldownTicks = CEILING_SEARCH_COOLDOWN;
return this.targetCeiling != null;
}
@Override
public boolean canContinueToUse() {
if (JumpyBugEntity.this.isClingingToCeiling() || JumpyBugEntity.this.isLeapingToCeiling()) {
if (SpringbugEntity.this.isClingingToCeiling() || SpringbugEntity.this.isLeapingToCeiling()) {
return true;
}
LivingEntity target = JumpyBugEntity.this.getTarget();
boolean allowedTarget = target == null || JumpyBugEntity.this.distanceToSqr(target) > CEILING_AMBUSH_RANGE_SQR;
LivingEntity target = SpringbugEntity.this.getTarget();
boolean allowedTarget = target == null || SpringbugEntity.this.distanceToSqr(target) > CEILING_AMBUSH_RANGE_SQR;
return this.targetCeiling != null
&& allowedTarget
&& JumpyBugEntity.this.canUseAmbush();
&& SpringbugEntity.this.canUseAmbush();
}
@Override
public void start() {
if (this.targetCeiling != null) {
BlockPos ceiling = this.targetCeiling;
if (JumpyBugEntity.this.isAlignedBelowCeiling(ceiling) && ceiling.getY() - JumpyBugEntity.this.getY() <= JumpyBugEntity.this.directCeilingSearchHeight()) {
JumpyBugEntity.this.beginClinging();
if (SpringbugEntity.this.isAlignedBelowCeiling(ceiling) && ceiling.getY() - SpringbugEntity.this.getY() <= SpringbugEntity.this.directCeilingSearchHeight()) {
SpringbugEntity.this.beginClinging();
}
}
}
@Override
public void stop() {
if (JumpyBugEntity.this.isClingingToCeiling()) {
JumpyBugEntity.this.stopClinging();
} else if (JumpyBugEntity.this.isLeapingToCeiling()) {
JumpyBugEntity.this.cancelLeap();
if (SpringbugEntity.this.isClingingToCeiling()) {
SpringbugEntity.this.stopClinging();
} else if (SpringbugEntity.this.isLeapingToCeiling()) {
SpringbugEntity.this.cancelLeap();
}
this.targetCeiling = null;
}
@Override
public void tick() {
if (JumpyBugEntity.this.isClingingToCeiling()) {
LivingEntity target = JumpyBugEntity.this.getTarget();
if (SpringbugEntity.this.isClingingToCeiling()) {
LivingEntity target = SpringbugEntity.this.getTarget();
if (target != null) {
JumpyBugEntity.this.getLookControl().setLookAt(target, 30.0F, 30.0F);
if (JumpyBugEntity.this.pounceCooldownTicks <= 0
&& JumpyBugEntity.this.distanceToSqr(target) <= CEILING_TRIGGER_RANGE_SQR
&& JumpyBugEntity.this.hasLineOfSight(target)) {
JumpyBugEntity.this.beginCeilingDrop(target);
SpringbugEntity.this.getLookControl().setLookAt(target, 30.0F, 30.0F);
if (SpringbugEntity.this.pounceCooldownTicks <= 0
&& SpringbugEntity.this.distanceToSqr(target) <= CEILING_TRIGGER_RANGE_SQR
&& SpringbugEntity.this.hasLineOfSight(target)) {
SpringbugEntity.this.beginCeilingDrop(target);
}
}
return;
}
if (JumpyBugEntity.this.isLeapingToCeiling() || this.targetCeiling == null) {
if (SpringbugEntity.this.isLeapingToCeiling() || this.targetCeiling == null) {
return;
}
BlockPos ceiling = this.targetCeiling;
JumpyBugEntity.this.getLookControl().setLookAt(ceiling.getX() + 0.5D, ceiling.getY() - 1.0D, ceiling.getZ() + 0.5D, 20.0F, 20.0F);
if (!JumpyBugEntity.this.isUsableCeiling(ceiling)) {
SpringbugEntity.this.getLookControl().setLookAt(ceiling.getX() + 0.5D, ceiling.getY() - 1.0D, ceiling.getZ() + 0.5D, 20.0F, 20.0F);
if (!SpringbugEntity.this.isUsableCeiling(ceiling)) {
this.targetCeiling = null;
return;
}
if (JumpyBugEntity.this.isAlignedBelowCeiling(ceiling)) {
if (JumpyBugEntity.this.onGround()) {
JumpyBugEntity.this.beginLeapToCeiling(ceiling);
if (SpringbugEntity.this.isAlignedBelowCeiling(ceiling)) {
if (SpringbugEntity.this.onGround()) {
SpringbugEntity.this.beginLeapToCeiling(ceiling);
}
} else {
JumpyBugEntity.this.getNavigation().moveTo(ceiling.getX() + 0.5D, JumpyBugEntity.this.getY(), ceiling.getZ() + 0.5D, 1.05D);
SpringbugEntity.this.getNavigation().moveTo(ceiling.getX() + 0.5D, SpringbugEntity.this.getY(), ceiling.getZ() + 0.5D, 1.05D);
}
}
}
@@ -885,13 +885,13 @@ public class JumpyBugEntity extends Monster implements GeoEntity {
@Override
public boolean canUse() {
LivingEntity target = JumpyBugEntity.this.getTarget();
LivingEntity target = SpringbugEntity.this.getTarget();
return target != null
&& target.isAlive()
&& !JumpyBugEntity.this.isClingingToCeiling()
&& !JumpyBugEntity.this.isPouncing()
&& !JumpyBugEntity.this.isLeapingToCeiling()
&& JumpyBugEntity.this.recoveryTicks <= 0;
&& !SpringbugEntity.this.isClingingToCeiling()
&& !SpringbugEntity.this.isPouncing()
&& !SpringbugEntity.this.isLeapingToCeiling()
&& SpringbugEntity.this.recoveryTicks <= 0;
}
@Override
@@ -901,53 +901,53 @@ public class JumpyBugEntity extends Monster implements GeoEntity {
@Override
public void tick() {
LivingEntity target = JumpyBugEntity.this.getTarget();
LivingEntity target = SpringbugEntity.this.getTarget();
if (target == null) {
return;
}
JumpyBugEntity.this.getLookControl().setLookAt(target, 30.0F, 30.0F);
double distSqr = JumpyBugEntity.this.distanceToSqr(target);
SpringbugEntity.this.getLookControl().setLookAt(target, 30.0F, 30.0F);
double distSqr = SpringbugEntity.this.distanceToSqr(target);
if (distSqr <= MELEE_WALK_RANGE * MELEE_WALK_RANGE) {
JumpyBugEntity.this.getNavigation().moveTo(target, 1.05D);
SpringbugEntity.this.getNavigation().moveTo(target, 1.05D);
} else if (distSqr > CHASE_LEAP_RANGE_SQR) {
if (JumpyBugEntity.this.onGround() && JumpyBugEntity.this.chaseJumpCooldownTicks <= 0) {
Vec3 dir = JumpyBugEntity.this.toLocalPlane(target.position().subtract(JumpyBugEntity.this.position())).normalize();
JumpyBugEntity.this.setDeltaMovement(JumpyBugEntity.this.toWorld(
if (SpringbugEntity.this.onGround() && SpringbugEntity.this.chaseJumpCooldownTicks <= 0) {
Vec3 dir = SpringbugEntity.this.toLocalPlane(target.position().subtract(SpringbugEntity.this.position())).normalize();
SpringbugEntity.this.setDeltaMovement(SpringbugEntity.this.toWorld(
dir.x * CHASE_LEAP_HORIZONTAL,
CHASE_LEAP_VERTICAL,
dir.z * CHASE_LEAP_HORIZONTAL
));
JumpyBugEntity.this.hasImpulse = true;
JumpyBugEntity.this.chaseJumpCooldownTicks = CHASE_JUMP_COOLDOWN;
SpringbugEntity.this.hasImpulse = true;
SpringbugEntity.this.chaseJumpCooldownTicks = CHASE_JUMP_COOLDOWN;
}
JumpyBugEntity.this.getNavigation().stop();
SpringbugEntity.this.getNavigation().stop();
} else {
JumpyBugEntity.this.getNavigation().moveTo(target, 1.05D);
SpringbugEntity.this.getNavigation().moveTo(target, 1.05D);
}
}
}
private final class WanderGoal extends RandomStrollGoal {
private WanderGoal() {
super(JumpyBugEntity.this, 0.8D);
super(SpringbugEntity.this, 0.8D);
}
@Override
public boolean canUse() {
return !JumpyBugEntity.this.isClingingToCeiling()
&& !JumpyBugEntity.this.isPouncing()
&& !JumpyBugEntity.this.isLeapingToCeiling()
&& JumpyBugEntity.this.getTarget() == null
return !SpringbugEntity.this.isClingingToCeiling()
&& !SpringbugEntity.this.isPouncing()
&& !SpringbugEntity.this.isLeapingToCeiling()
&& SpringbugEntity.this.getTarget() == null
&& super.canUse();
}
@Override
public boolean canContinueToUse() {
return !JumpyBugEntity.this.isClingingToCeiling()
&& !JumpyBugEntity.this.isPouncing()
&& !JumpyBugEntity.this.isLeapingToCeiling()
return !SpringbugEntity.this.isClingingToCeiling()
&& !SpringbugEntity.this.isPouncing()
&& !SpringbugEntity.this.isLeapingToCeiling()
&& super.canContinueToUse();
}
}
@@ -35,7 +35,9 @@ public class LucidEyeProjectileEntity extends ThrowableItemProjectile {
@Override
protected double getDefaultGravity() {
return -0.03;
// Gravity is expressed in the projectile's local frame, so the generic
// Underside hook mirrors this pearl's special rising arc below Y=0.
return -0.03D;
}
@Override
@@ -15,6 +15,7 @@ import java.util.Set;
import java.util.UUID;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.sounds.AbstractTickableSoundInstance;
import net.minecraft.client.sounds.SoundManager;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Holder;
import net.minecraft.core.HolderSet;
@@ -78,7 +79,8 @@ public class DimensionalTearEntity extends Entity implements GeoEntity {
private static final Map<UUID, Set<UUID>> QUEEN_TEAR_IDS = new HashMap<>();
private final AnimatableInstanceCache geoCache = GeckoLibUtil.createInstanceCache(this);
private boolean idleSoundStarted;
@Nullable
private TearIdleSoundInstance idleSound;
private UUID linkedTearId;
@Nullable
private DimensionalTearEntity linkedTear;
@@ -453,11 +455,15 @@ public class DimensionalTearEntity extends Entity implements GeoEntity {
}
private void tickIdleSound() {
if (this.idleSoundStarted || this.getTearState() == TearState.OPENING) {
SoundManager soundManager = Minecraft.getInstance().getSoundManager();
if (this.getTearState() == TearState.OPENING) {
return;
}
this.idleSoundStarted = true;
Minecraft.getInstance().getSoundManager().play(new TearIdleSoundInstance(this));
if (this.idleSound != null && soundManager.isActive(this.idleSound)) {
return;
}
this.idleSound = new TearIdleSoundInstance(this);
soundManager.play(this.idleSound);
}
private void tickClientParticles() {
@@ -15,6 +15,7 @@ import net.minecraft.network.protocol.game.ClientboundClearTitlesPacket;
import net.minecraft.network.protocol.game.ClientboundSetSubtitleTextPacket;
import net.minecraft.network.protocol.game.ClientboundSetTitleTextPacket;
import net.minecraft.network.protocol.game.ClientboundSetTitlesAnimationPacket;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.BossEvent;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.effect.MobEffectInstance;
@@ -86,9 +87,21 @@ public class KingEntity extends RoyalBossEntity {
private static final double CHAIN_LIGHTNING_JUMP_RANGE = 9.0D;
private static final int ICE_FREEZE_PER_TICK = 7;
private static final int BEHAVIOR_SCORE_CAP = 12;
/** Keep the tree-bound patrol safely inside the authored tree footprint. */
private static final double TREE_ORBIT_RADIUS = 128.0D;
private static final double TREE_ORBIT_ANGLE_STEP = 0.014D;
private static final int TREE_ORBIT_PATH_SAMPLES = 16;
@Nullable
private Vec3 patrolCenter;
@Nullable
private Vec3 treePatrolCenter;
@Nullable
private Vec3 treePatrolWaypoint;
private double treePatrolMinimumY;
private double treePatrolMaximumY;
private double treePatrolAngle;
private boolean treePatrolBound;
private int patrolCooldownTicks;
private int decreeCooldownTicks;
private int activeDecreeTicks;
@@ -133,6 +146,25 @@ public class KingEntity extends RoyalBossEntity {
return createBaseAttributes(AntarchySettings.kingHealth(), AntarchySettings.kingAttackDamage());
}
public void setTreePatrolHome(Vec3 center, double minimumY, double maximumY, double angle) {
this.treePatrolCenter = center;
this.treePatrolMinimumY = minimumY;
this.treePatrolMaximumY = maximumY;
this.treePatrolAngle = angle;
this.treePatrolWaypoint = null;
this.treePatrolBound = true;
}
public boolean isTreePatrolFor(Vec3 center) {
return this.treePatrolBound && this.treePatrolCenter != null
&& this.treePatrolCenter.distanceToSqr(center) < 1.0D;
}
@Override
protected boolean shouldClearObstruction() {
return this.getTarget() != null;
}
@Override
protected String geoName() {
return "king";
@@ -351,6 +383,10 @@ public class KingEntity extends RoyalBossEntity {
}
this.setRoyalFlying(true);
this.decreeRetreatPressure = false;
if (this.treePatrolBound && this.treePatrolCenter != null) {
this.tickTreePatrol();
return;
}
if (this.patrolCenter == null || this.position().distanceToSqr(this.patrolCenter) > 64.0D * 64.0D) {
this.patrolCenter = this.position();
}
@@ -366,6 +402,58 @@ public class KingEntity extends RoyalBossEntity {
}
}
private void tickTreePatrol() {
Vec3 center = this.treePatrolCenter;
if (center == null) {
return;
}
this.treePatrolAngle += TREE_ORBIT_ANGLE_STEP;
if (this.treePatrolAngle >= Math.PI * 2.0D) {
this.treePatrolAngle -= Math.PI * 2.0D;
}
Vec3 waypoint = this.treePatrolWaypoint;
if (waypoint == null || this.position().distanceToSqr(waypoint) < 36.0D) {
waypoint = this.findTreePatrolWaypoint(center, this.treePatrolAngle);
this.treePatrolWaypoint = waypoint;
}
if (waypoint != null) {
this.getMoveControl().setWantedPosition(waypoint.x, waypoint.y, waypoint.z, 1.0D);
this.getLookControl().setLookAt(center.x,
(this.treePatrolMinimumY + this.treePatrolMaximumY) * 0.5D,
center.z, 30.0F, 30.0F);
}
}
@Nullable
private Vec3 findTreePatrolWaypoint(Vec3 center, double angle) {
for (int attempt = 0; attempt < 10; attempt++) {
double candidateAngle = angle + attempt * 0.22D;
double x = center.x + Math.cos(candidateAngle) * TREE_ORBIT_RADIUS;
double z = center.z + Math.sin(candidateAngle) * TREE_ORBIT_RADIUS;
double vertical = 0.5D + 0.5D * Math.sin(candidateAngle);
double y = this.treePatrolMinimumY
+ (this.treePatrolMaximumY - this.treePatrolMinimumY) * vertical;
Vec3 candidate = new Vec3(x, y, z);
if (this.clearTreePatrolPath(candidate)) {
return candidate;
}
}
return null;
}
private boolean clearTreePatrolPath(Vec3 destination) {
Vec3 start = this.position();
for (int sample = 1; sample <= TREE_ORBIT_PATH_SAMPLES; sample++) {
double progress = sample / (double) TREE_ORBIT_PATH_SAMPLES;
Vec3 point = start.lerp(destination, progress);
AABB box = this.getBoundingBox().move(point.x - this.getX(), point.y - this.getY(), point.z - this.getZ());
if (!this.level().noCollision(this, box)) {
return false;
}
}
return true;
}
private void tickRoyalPunishment() {
if (this.exileTarget == null && this.titheTarget == null && this.targetShotPlayer == null && this.sealedTarget == null) {
return;
@@ -1013,6 +1101,31 @@ public class KingEntity extends RoyalBossEntity {
return super.hurt(source, amount);
}
@Override
public void addAdditionalSaveData(CompoundTag tag) {
super.addAdditionalSaveData(tag);
tag.putBoolean("TreePatrolBound", this.treePatrolBound);
if (this.treePatrolCenter != null) {
tag.putDouble("TreePatrolCenterX", this.treePatrolCenter.x);
tag.putDouble("TreePatrolCenterY", this.treePatrolCenter.y);
tag.putDouble("TreePatrolCenterZ", this.treePatrolCenter.z);
tag.putDouble("TreePatrolMinimumY", this.treePatrolMinimumY);
tag.putDouble("TreePatrolMaximumY", this.treePatrolMaximumY);
tag.putDouble("TreePatrolAngle", this.treePatrolAngle);
}
}
@Override
public void readAdditionalSaveData(CompoundTag tag) {
super.readAdditionalSaveData(tag);
if (tag.getBoolean("TreePatrolBound") && tag.contains("TreePatrolCenterX")
&& tag.contains("TreePatrolCenterY") && tag.contains("TreePatrolCenterZ")) {
this.setTreePatrolHome(
new Vec3(tag.getDouble("TreePatrolCenterX"), tag.getDouble("TreePatrolCenterY"), tag.getDouble("TreePatrolCenterZ")),
tag.getDouble("TreePatrolMinimumY"), tag.getDouble("TreePatrolMaximumY"), tag.getDouble("TreePatrolAngle"));
}
}
public static boolean blocksHealingAround(LivingEntity target) {
if (target.level().isClientSide) return false;
return target.level().getEntitiesOfClass(KingEntity.class, target.getBoundingBox().inflate(128.0D),
@@ -6,6 +6,9 @@ import com.craisinlord.antarchy.content.AntarchyObjects;
import com.craisinlord.antarchy.content.AntarchyTags;
import com.craisinlord.antarchy.content.entity.ManticoreEntity;
import com.craisinlord.antarchy.content.gravity.AntarchyGravityApi;
import com.craisinlord.antarchy.content.gravity.AntarchyGravityDirection;
import com.craisinlord.antarchy.content.gravity.AntarchyGravityTransition;
import com.craisinlord.antarchy.content.worldgen.thoraxis.ThoraxisUndersideManager;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
@@ -31,6 +34,7 @@ import net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal;
import net.minecraft.world.entity.MobSpawnType;
import net.minecraft.world.level.Level;
import net.minecraft.world.phys.Vec3;
import net.minecraft.world.phys.AABB;
import com.craisinlord.antarchy.content.entity.royal.beam.RoyalBeamSettings;
import com.craisinlord.antarchy.content.entity.royal.beam.RoyalBeamTerrainMode;
import com.craisinlord.antarchy.content.entity.royal.beam.RoyalBeamElement;
@@ -73,6 +77,9 @@ public class QueenEntity extends RoyalBossEntity {
private int idleWanderCooldownTicks;
private final RoyalEffectController royalEffects = new RoyalEffectController();
private final Map<UUID, Vec3> frozenVelocities = new HashMap<>();
private long naturalTrailSiteId = Long.MIN_VALUE;
@Nullable
private BlockPos naturalTrailHome;
public QueenEntity(EntityType<? extends QueenEntity> entityType, Level level) {
super(entityType, level);
@@ -270,6 +277,29 @@ public class QueenEntity extends RoyalBossEntity {
return;
}
this.idleWanderCooldownTicks = 80 + this.random.nextInt(80);
if (this.naturalTrailHome != null) {
double distanceSquared = this.distanceToSqr(
this.naturalTrailHome.getX() + 0.5D,
this.naturalTrailHome.getY() + 0.5D,
this.naturalTrailHome.getZ() + 0.5D
);
if (distanceSquared > 48.0D * 48.0D) {
this.getMoveControl().setWantedPosition(
this.naturalTrailHome.getX() + 0.5D,
this.naturalTrailHome.getY() + 0.5D,
this.naturalTrailHome.getZ() + 0.5D,
1.0D
);
return;
}
double angle = this.random.nextDouble() * Mth.TWO_PI;
double radius = 6.0D + this.random.nextDouble() * 22.0D;
double wx = this.naturalTrailHome.getX() + 0.5D + Math.cos(angle) * radius;
double wz = this.naturalTrailHome.getZ() + 0.5D + Math.sin(angle) * radius;
double wy = this.naturalTrailHome.getY() - 2.0D - this.random.nextDouble() * 7.0D;
this.getMoveControl().setWantedPosition(wx, wy, wz, 0.7D);
return;
}
double angle = this.random.nextDouble() * Mth.TWO_PI;
double radius = 6.0D + this.random.nextDouble() * 14.0D;
double wx = this.getX() + Math.cos(angle) * radius;
@@ -277,6 +307,39 @@ public class QueenEntity extends RoyalBossEntity {
this.getMoveControl().setWantedPosition(wx, this.groundYBelow(wx, wz), wz, 0.7D);
}
@Nullable
public static QueenEntity spawnFromUndersideTrail(ServerLevel level, BlockPos spawnPos, BlockPos homePos, long siteId, float yaw) {
if (!ThoraxisUndersideManager.isThoraxis(level) || spawnPos.getY() >= 0) {
return null;
}
AABB siteBounds = new AABB(homePos).inflate(160.0D);
java.util.List<QueenEntity> existing = level.getEntitiesOfClass(QueenEntity.class, siteBounds,
queen -> queen.naturalTrailSiteId == siteId && queen.isAlive());
if (!existing.isEmpty()) {
return existing.getFirst();
}
if (!level.hasChunksAt(spawnPos.offset(-16, -2, -16), spawnPos.offset(16, 18, 16))) {
return null;
}
QueenEntity queen = AntarchyObjects.QUEEN.get().create(level);
if (queen == null) {
return null;
}
queen.moveTo(spawnPos.getX() + 0.5D, spawnPos.getY(), spawnPos.getZ() + 0.5D, yaw, 0.0F);
if (!level.noCollision(queen, queen.getBoundingBox())) {
return null;
}
queen.finalizeSpawn(level, level.getCurrentDifficultyAt(spawnPos), MobSpawnType.CHUNK_GENERATION, null);
queen.naturalTrailSiteId = siteId;
queen.naturalTrailHome = homePos.immutable();
queen.setPersistenceRequired();
queen.setNoGravity(false);
ThoraxisUndersideManager.applyUndersideInversion(queen);
AntarchyGravityApi.setAirborneGravityDirection(queen, AntarchyGravityDirection.UP, true, new AntarchyGravityTransition(12));
queen.resetFallDistance();
return level.addFreshEntity(queen) ? queen : null;
}
private int cooldown(int base) {
return this.royalEffects.active("acceleration") ? Math.max(20, base / 2) : base;
}
@@ -625,6 +688,10 @@ public class QueenEntity extends RoyalBossEntity {
tag.putInt("GravityStompCooldownTicks", this.gravityStompCooldownTicks);
tag.putInt("AccelerationCooldownTicks", this.accelerationCooldownTicks);
tag.putInt("BlackHoleCooldownTicks", this.blackHoleCooldownTicks);
if (this.naturalTrailHome != null) {
tag.putLong("NaturalTrailSiteId", this.naturalTrailSiteId);
tag.putLong("NaturalTrailHome", this.naturalTrailHome.asLong());
}
}
@Override
@@ -636,5 +703,9 @@ public class QueenEntity extends RoyalBossEntity {
this.crushingGravityCooldownTicks = Math.max(0, tag.getInt("CrushingGravityCooldownTicks"));
this.accelerationCooldownTicks = Math.max(0, tag.getInt("AccelerationCooldownTicks"));
this.blackHoleCooldownTicks = Math.max(0, tag.getInt("BlackHoleCooldownTicks"));
if (tag.contains("NaturalTrailHome")) {
this.naturalTrailSiteId = tag.getLong("NaturalTrailSiteId");
this.naturalTrailHome = BlockPos.of(tag.getLong("NaturalTrailHome"));
}
}
}
@@ -263,6 +263,10 @@ public abstract class RoyalBossEntity extends Monster implements GeoEntity, Mult
return 0.35D;
}
protected boolean shouldClearObstruction() {
return true;
}
protected double biteApproachSpeed() {
return 1.3D;
}
@@ -397,7 +401,8 @@ public abstract class RoyalBossEntity extends Monster implements GeoEntity, Mult
@Override
public void tick() {
super.tick();
if (!this.level().isClientSide
if (this.shouldClearObstruction()
&& !this.level().isClientSide
&& !this.isDeadOrDying()
&& this.tickCount % OBSTRUCTION_CLEAR_INTERVAL_TICKS == 0
&& this.isInWall()) {
@@ -1,4 +1,4 @@
package com.craisinlord.antarchy.content.entity.cloud_shark;
package com.craisinlord.antarchy.content.entity.stratoshark;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.entity.player.Player;
@@ -47,24 +47,24 @@ public final class SharknadoManager {
}
public boolean tryFormOrJoin(CloudSharkEntity shark, ServerLevel level) {
public boolean tryFormOrJoin(StratosharkEntity shark, ServerLevel level) {
if (tryJoinExisting(shark)) return true;
List<CloudSharkEntity> soloNearby = getSoloSharksNear(shark, level);
List<StratosharkEntity> soloNearby = getSoloSharksNear(shark, level);
if (soloNearby.size() + 1 < MIN_SHARKS_TO_FORM) return false;
UUID myUuid = shark.getUUID();
for (CloudSharkEntity other : soloNearby) {
for (StratosharkEntity other : soloNearby) {
if (other.getUUID().compareTo(myUuid) < 0) return false;
}
List<CloudSharkEntity> all = new ArrayList<>();
List<StratosharkEntity> all = new ArrayList<>();
all.add(shark);
all.addAll(soloNearby);
formTornado(all, level);
return true;
}
private void formTornado(List<CloudSharkEntity> sharks, ServerLevel level) {
private void formTornado(List<StratosharkEntity> sharks, ServerLevel level) {
UUID id = UUID.randomUUID();
SharknadoEntry entry = new SharknadoEntry(id);
int idx = 0;
@@ -72,7 +72,7 @@ public final class SharknadoManager {
for (int tier = 2; tier >= 0; tier--) {
for (int slot = 0; slot < TIER_MAX_SLOTS[tier]; slot++) {
if (idx >= sharks.size()) break outer;
CloudSharkEntity s = sharks.get(idx++);
StratosharkEntity s = sharks.get(idx++);
entry.add(s, tier, slot);
sharkToTornado.put(s.getUUID(), id);
s.onJoinSharknado(id, tier, slot);
@@ -87,7 +87,7 @@ public final class SharknadoManager {
tornadoes.put(id, entry);
}
private boolean tryJoinExisting(CloudSharkEntity shark) {
private boolean tryJoinExisting(StratosharkEntity shark) {
UUID bestId = null;
double bestDistSqr = FORM_SEARCH_RADIUS_SQR;
@@ -210,7 +210,7 @@ public final class SharknadoManager {
}
public void unregisterShark(CloudSharkEntity shark) {
public void unregisterShark(StratosharkEntity shark) {
UUID tornadoId = sharkToTornado.remove(shark.getUUID());
if (tornadoId == null) return;
SharknadoEntry entry = tornadoes.get(tornadoId);
@@ -275,10 +275,10 @@ public final class SharknadoManager {
}
private List<CloudSharkEntity> getSoloSharksNear(CloudSharkEntity seeker, ServerLevel level) {
List<CloudSharkEntity> result = new ArrayList<>();
for (CloudSharkEntity other : level.getEntitiesOfClass(
CloudSharkEntity.class, seeker.getBoundingBox().inflate(FORM_SEARCH_RADIUS))) {
private List<StratosharkEntity> getSoloSharksNear(StratosharkEntity seeker, ServerLevel level) {
List<StratosharkEntity> result = new ArrayList<>();
for (StratosharkEntity other : level.getEntitiesOfClass(
StratosharkEntity.class, seeker.getBoundingBox().inflate(FORM_SEARCH_RADIUS))) {
if (other == seeker) continue;
if (sharkToTornado.containsKey(other.getUUID())) continue;
double dx = other.getX() - seeker.getX();
@@ -303,11 +303,11 @@ public final class SharknadoManager {
SharknadoEntry(UUID id) { this.id = id; }
void add(CloudSharkEntity shark, int tier, int slot) {
void add(StratosharkEntity shark, int tier, int slot) {
slots.add(new SharkSlot(shark, tier, slot));
}
void removeShark(CloudSharkEntity shark) {
void removeShark(StratosharkEntity shark) {
slots.removeIf(s -> s.shark == shark);
}
@@ -386,11 +386,11 @@ public final class SharknadoManager {
}
private static final class SharkSlot {
final CloudSharkEntity shark;
final StratosharkEntity shark;
final int tier;
final int slot;
SharkSlot(CloudSharkEntity shark, int tier, int slot) {
SharkSlot(StratosharkEntity shark, int tier, int slot) {
this.shark = shark;
this.tier = tier;
this.slot = slot;
@@ -1,4 +1,4 @@
package com.craisinlord.antarchy.content.entity.cloud_shark;
package com.craisinlord.antarchy.content.entity.stratoshark;
import com.craisinlord.antarchy.config.AntarchySettings;
import com.craisinlord.antarchy.content.AntarchySoundEvents;
@@ -45,7 +45,7 @@ import software.bernie.geckolib.util.GeckoLibUtil;
import java.util.EnumSet;
import java.util.UUID;
public class CloudSharkEntity extends Monster implements GeoEntity {
public class StratosharkEntity extends Monster implements GeoEntity {
private static final double PATROL_SPEED = 0.95D;
private static final double STRAFE_SPEED = 1.2D;
private static final double DIVE_SPEED = 1.9D;
@@ -72,7 +72,7 @@ public class CloudSharkEntity extends Monster implements GeoEntity {
private static final net.minecraft.network.syncher.EntityDataAccessor<Integer> ANIMATION_STATE =
net.minecraft.network.syncher.SynchedEntityData.defineId(
CloudSharkEntity.class, net.minecraft.network.syncher.EntityDataSerializers.INT);
StratosharkEntity.class, net.minecraft.network.syncher.EntityDataSerializers.INT);
@Nullable private Vec3 patrolTarget;
@Nullable private Vec3 recoveryTarget;
@Nullable private Vec3 strafeTarget;
@@ -98,7 +98,7 @@ public class CloudSharkEntity extends Monster implements GeoEntity {
private final AnimatableInstanceCache geoCache = GeckoLibUtil.createInstanceCache(this);
public CloudSharkEntity(EntityType<? extends Monster> entityType, Level level) {
public StratosharkEntity(EntityType<? extends Monster> entityType, Level level) {
super(entityType, level);
this.moveControl = new FlyingMoveControl(this, 20, true);
this.xpReward = 8;
@@ -106,23 +106,23 @@ public class CloudSharkEntity extends Monster implements GeoEntity {
public static AttributeSupplier.Builder createAttributes() {
return Mob.createMobAttributes()
.add(Attributes.MAX_HEALTH, AntarchySettings.cloudSharkHealth())
.add(Attributes.ATTACK_DAMAGE, AntarchySettings.cloudSharkAttackDamage())
.add(Attributes.MOVEMENT_SPEED, AntarchySettings.cloudSharkMovementSpeed())
.add(Attributes.FLYING_SPEED, AntarchySettings.cloudSharkFlyingSpeed())
.add(Attributes.MAX_HEALTH, AntarchySettings.stratosharkHealth())
.add(Attributes.ATTACK_DAMAGE, AntarchySettings.stratosharkAttackDamage())
.add(Attributes.MOVEMENT_SPEED, AntarchySettings.stratosharkMovementSpeed())
.add(Attributes.FLYING_SPEED, AntarchySettings.stratosharkFlyingSpeed())
.add(Attributes.FOLLOW_RANGE, 40.0D)
.add(Attributes.KNOCKBACK_RESISTANCE, AntarchySettings.cloudSharkKnockbackResistance());
.add(Attributes.KNOCKBACK_RESISTANCE, AntarchySettings.stratosharkKnockbackResistance());
}
@Override
public net.minecraft.world.entity.SpawnGroupData finalizeSpawn(net.minecraft.world.level.ServerLevelAccessor level, net.minecraft.world.DifficultyInstance difficulty, net.minecraft.world.entity.MobSpawnType spawnReason, net.minecraft.world.entity.SpawnGroupData spawnData) {
com.craisinlord.antarchy.content.entity.ConfiguredMobSpawnUtil.applyConfiguredHealth(this, AntarchySettings.cloudSharkHealth());
com.craisinlord.antarchy.content.entity.ConfiguredMobSpawnUtil.applyConfiguredHealth(this, AntarchySettings.stratosharkHealth());
return super.finalizeSpawn(level, difficulty, spawnReason, spawnData);
}
private static final int MIN_SPAWN_HEIGHT_ABOVE_TERRAIN = 16;
public static boolean canSpawn(EntityType<CloudSharkEntity> entityType, ServerLevelAccessor level,
public static boolean canSpawn(EntityType<StratosharkEntity> entityType, ServerLevelAccessor level,
MobSpawnType spawnReason, BlockPos pos, RandomSource random) {
if (level.getDifficulty() == Difficulty.PEACEFUL || !level.getFluidState(pos).isEmpty()) {
return false;
@@ -149,9 +149,9 @@ public class CloudSharkEntity extends Monster implements GeoEntity {
this.goalSelector.addGoal(1, new SharknadoOrbitGoal(this));
HurtByTargetGoal hurtByTargetGoal = new HurtByTargetGoal(this);
hurtByTargetGoal.setAlertOthers(CloudSharkEntity.class);
hurtByTargetGoal.setAlertOthers(StratosharkEntity.class);
this.targetSelector.addGoal(1, hurtByTargetGoal);
this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, CloudSharkEntity::isTargetablePlayer));
this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, StratosharkEntity::isTargetablePlayer));
}
private static boolean isTargetablePlayer(LivingEntity target) {
@@ -325,7 +325,7 @@ public class CloudSharkEntity extends Monster implements GeoEntity {
Vec3 knockback = horizontal.scale(0.7D).add(sideways.scale(0.45D));
Vec3 worldKnockback = this.toWorld(knockback.x, 0.28D, knockback.z);
livingTarget.push(worldKnockback.x, worldKnockback.y, worldKnockback.z);
this.playSound(AntarchySoundEvents.CLOUD_SHARK_BITE.get(), 1.0F, 0.85F + this.random.nextFloat() * 0.2F);
this.playSound(AntarchySoundEvents.STRATOSHARK_BITE.get(), 1.0F, 0.85F + this.random.nextFloat() * 0.2F);
}
return hurt;
}
@@ -343,10 +343,10 @@ public class CloudSharkEntity extends Monster implements GeoEntity {
protected SoundEvent getAmbientSound() { return null; }
@Override
protected SoundEvent getHurtSound(DamageSource damageSource) { return AntarchySoundEvents.CLOUD_SHARK_HURT.get(); }
protected SoundEvent getHurtSound(DamageSource damageSource) { return AntarchySoundEvents.STRATOSHARK_HURT.get(); }
@Override
protected SoundEvent getDeathSound() { return AntarchySoundEvents.CLOUD_SHARK_DEATH.get(); }
protected SoundEvent getDeathSound() { return AntarchySoundEvents.STRATOSHARK_DEATH.get(); }
@Override
protected float getSoundVolume() { return 0.9F; }
@@ -389,7 +389,7 @@ public class CloudSharkEntity extends Monster implements GeoEntity {
return;
}
this.playSound(AntarchySoundEvents.CLOUD_SHARK_FLY.get(), 0.7F, 1.0F);
this.playSound(AntarchySoundEvents.STRATOSHARK_FLY.get(), 0.7F, 1.0F);
this.flySoundCooldown = FLY_SOUND_INTERVAL_TICKS;
}
@@ -555,7 +555,7 @@ public class CloudSharkEntity extends Monster implements GeoEntity {
}
}
private PlayState mainAnimController(AnimationState<CloudSharkEntity> state) {
private PlayState mainAnimController(AnimationState<StratosharkEntity> state) {
return switch (this.getAnimationState()) {
case ANIM_ATTACK -> state.setAndContinue(ATTACK_ANIM);
case ANIM_SWIM -> state.setAndContinue(SWIM_ANIM);
@@ -663,9 +663,9 @@ public class CloudSharkEntity extends Monster implements GeoEntity {
private static final class SharknadoOrbitGoal extends Goal {
private final CloudSharkEntity shark;
private final StratosharkEntity shark;
SharknadoOrbitGoal(CloudSharkEntity shark) {
SharknadoOrbitGoal(StratosharkEntity shark) {
this.shark = shark;
this.setFlags(EnumSet.of(Flag.MOVE));
}
@@ -13,6 +13,8 @@ public interface AntarchyGravityAccess {
void antarchy$setGravityState(AntarchyGravityDirection direction, boolean forced, AntarchyGravityTransition transition);
void antarchy$setAirborneGravityState(AntarchyGravityDirection direction, boolean forced, AntarchyGravityTransition transition);
void antarchy$applySyncedGravityState(
AntarchyGravityDirection direction,
AntarchyGravityDirection previousDirection,
@@ -77,6 +77,10 @@ public final class AntarchyGravityApi {
access(entity).antarchy$setGravityState(direction, true, transition);
}
public static void setAirborneGravityDirection(Entity entity, AntarchyGravityDirection direction, boolean forced, AntarchyGravityTransition transition) {
access(entity).antarchy$setAirborneGravityState(direction, forced, transition);
}
public static void clearForcedGravity(Entity entity) {
access(entity).antarchy$setGravityState(AntarchyGravityDirection.DOWN, false, AntarchyGravityTransition.INSTANT);
}
@@ -2,12 +2,15 @@ package com.craisinlord.antarchy.content.item;
import com.craisinlord.antarchy.config.AntarchySettings;
import com.craisinlord.antarchy.content.AntarchyObjects;
import com.craisinlord.antarchy.content.enchantment.AntarchyEnchantments;
import java.util.List;
import net.minecraft.ChatFormatting;
import net.minecraft.core.Holder;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.EquipmentSlotGroup;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.ai.attributes.AttributeModifier;
import net.minecraft.world.entity.ai.attributes.Attributes;
import net.minecraft.world.item.ArmorItem;
@@ -16,6 +19,7 @@ import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.TooltipFlag;
import net.minecraft.world.item.component.ItemAttributeModifiers;
import net.minecraft.world.level.Level;
public class BloodCrystalArmorItem extends ArmorItem {
private final Type armorType;
@@ -83,12 +87,25 @@ public class BloodCrystalArmorItem extends ArmorItem {
return builder.build();
}
@Override
public void inventoryTick(ItemStack stack, Level level, Entity entity, int slotId, boolean isSelected) {
super.inventoryTick(stack, level, entity, slotId, isSelected);
if (this.armorType == Type.BOOTS) {
AntarchyEnchantments.ensure(stack, level.registryAccess(), AntarchyEnchantments.FEATHER_RISING, 1);
}
}
@Override
public void onCraftedBy(ItemStack stack, Level level, Player player) {
super.onCraftedBy(stack, level, player);
if (this.armorType == Type.BOOTS) {
AntarchyEnchantments.ensure(stack, level.registryAccess(), AntarchyEnchantments.FEATHER_RISING, 1);
}
}
@Override
public void appendHoverText(ItemStack stack, Item.TooltipContext context, List<Component> tooltipComponents, TooltipFlag tooltipFlag) {
tooltipComponents.add(Component.translatable("item.antarchy.blood_crystal_armor.tooltip").withStyle(ChatFormatting.RED));
if (this.armorType == Type.BOOTS) {
tooltipComponents.add(Component.translatable("item.antarchy.blood_crystal_boots.tooltip2").withStyle(ChatFormatting.DARK_RED));
}
super.appendHoverText(stack, context, tooltipComponents, tooltipFlag);
}
}
@@ -9,14 +9,14 @@ import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.TooltipFlag;
import net.minecraft.world.level.block.Block;
public class TriffidGooBlockItem extends BlockItem {
public TriffidGooBlockItem(Block block, Properties properties) {
public class FlytrapGooBlockItem extends BlockItem {
public FlytrapGooBlockItem(Block block, Properties properties) {
super(block, properties);
}
@Override
public void appendHoverText(ItemStack stack, Item.TooltipContext context, List<Component> tooltipComponents, TooltipFlag tooltipFlag) {
tooltipComponents.add(Component.translatable("tooltip.antarchy.triffid_goo_block").withStyle(ChatFormatting.DARK_GREEN));
tooltipComponents.add(Component.translatable("tooltip.antarchy.flytrap_goo_block").withStyle(ChatFormatting.DARK_GREEN));
super.appendHoverText(stack, context, tooltipComponents, tooltipFlag);
}
}
@@ -1,10 +1,10 @@
package com.craisinlord.antarchy.content.item;
import com.craisinlord.antarchy.content.block.BedBugEggBlock;
import com.craisinlord.antarchy.content.block.CreepingHorrorEggBlock;
import com.craisinlord.antarchy.content.block.CrawlingBlightEggBlock;
import com.craisinlord.antarchy.content.block.JerryEggBlock;
import com.craisinlord.antarchy.content.block.JumpyBugEggBlock;
import com.craisinlord.antarchy.content.block.LurkingTerrorEggBlock;
import com.craisinlord.antarchy.content.block.SpringbugEggBlock;
import com.craisinlord.antarchy.content.block.SkulkingFrightEggBlock;
import com.craisinlord.antarchy.content.block.SpitBugEggBlock;
import java.util.List;
import net.minecraft.ChatFormatting;
@@ -34,9 +34,9 @@ public class JerryNucleusItem extends Item {
BlockState state = context.getLevel().getBlockState(context.getClickedPos());
Block block = state.getBlock();
boolean handled = block instanceof BedBugEggBlock
|| block instanceof CreepingHorrorEggBlock
|| block instanceof LurkingTerrorEggBlock
|| block instanceof JumpyBugEggBlock
|| block instanceof CrawlingBlightEggBlock
|| block instanceof SkulkingFrightEggBlock
|| block instanceof SpringbugEggBlock
|| block instanceof SpitBugEggBlock
|| block instanceof JerryEggBlock
|| block instanceof TurtleEggBlock;
@@ -51,11 +51,11 @@ public class JerryNucleusItem extends Item {
BlockPos pos = context.getClickedPos();
if (block instanceof BedBugEggBlock eggBlock) {
eggBlock.hatchWithNucleus(serverLevel, pos, state);
} else if (block instanceof CreepingHorrorEggBlock eggBlock) {
} else if (block instanceof CrawlingBlightEggBlock eggBlock) {
eggBlock.hatchWithNucleus(serverLevel, pos, state);
} else if (block instanceof LurkingTerrorEggBlock eggBlock) {
} else if (block instanceof SkulkingFrightEggBlock eggBlock) {
eggBlock.hatchWithNucleus(serverLevel, pos, state);
} else if (block instanceof JumpyBugEggBlock eggBlock) {
} else if (block instanceof SpringbugEggBlock eggBlock) {
eggBlock.hatchWithNucleus(serverLevel, pos);
} else if (block instanceof SpitBugEggBlock eggBlock) {
eggBlock.hatchWithNucleus(serverLevel, pos);
@@ -20,7 +20,7 @@ import net.minecraft.world.level.block.state.BlockState;
import org.joml.Vector3f;
public final class MinersDreamExcavation {
private static final Vector3f TRIFFID_GOO_COLOR = new Vector3f(0.35F, 0.85F, 0.4F);
private static final Vector3f FLYTRAP_GOO_COLOR = new Vector3f(0.35F, 0.85F, 0.4F);
private static final int SLICES_BETWEEN_RUMBLE = 4;
private final UUID owner;
@@ -126,7 +126,7 @@ public final class MinersDreamExcavation {
level.sendParticles(new BlockParticleOption(ParticleTypes.BLOCK, state),
pos.getX() + 0.5D, pos.getY() + 0.5D, pos.getZ() + 0.5D, 2, 0.25D, 0.25D, 0.25D, 0.02D);
if (random.nextFloat() < 0.2F) {
level.sendParticles(new DustParticleOptions(TRIFFID_GOO_COLOR, 1.0F),
level.sendParticles(new DustParticleOptions(FLYTRAP_GOO_COLOR, 1.0F),
pos.getX() + 0.5D, pos.getY() + 0.5D, pos.getZ() + 0.5D, 1, 0.2D, 0.2D, 0.2D, 0.0D);
}
}
@@ -125,9 +125,6 @@ public class RoyalAssailantArmorItem extends ArmorItem {
if (this.armorType == Type.CHESTPLATE) {
tooltipComponents.add(Component.translatable("tooltip.antarchy.royal_assailant_chestplate.invert").withStyle(ChatFormatting.AQUA));
}
if (this.armorType == Type.BOOTS) {
tooltipComponents.add(Component.translatable("tooltip.antarchy.royal_assailant_boots.fall").withStyle(ChatFormatting.AQUA));
}
super.appendHoverText(stack, context, tooltipComponents, tooltipFlag);
}
@@ -1,6 +1,6 @@
package com.craisinlord.antarchy.content.item;
public final class JumpyBootsHelper {
public final class SpringyBootsHelper {
public static final int CHARGE_TICKS_MAX = 30;
public static final int PRIME_WINDOW_TICKS = 15;
public static final int COOLDOWN_TICKS = 40;
@@ -8,9 +8,9 @@ public final class JumpyBootsHelper {
public static final float MAX_VERTICAL_BOOST = 2.0F;
public static final float SPRINT_FORWARD_BOOST = 0.3F;
public static final long FALL_PROTECTION_TICKS = 120L;
public static final String FALL_PROTECTION_NBT_KEY = "antarchy:jumpy_boots_protection_until";
public static final String FALL_PROTECTION_NBT_KEY = "antarchy:springy_boots_protection_until";
private JumpyBootsHelper() {
private SpringyBootsHelper() {
}
public static float verticalBoostFor(int chargeTicks) {
@@ -11,13 +11,13 @@ import net.minecraft.world.item.TooltipFlag;
import java.util.List;
public final class JumpyBootsItem extends ArmorItem {
public JumpyBootsItem(Holder<ArmorMaterial> material, Properties properties) {
public final class SpringyBootsItem extends ArmorItem {
public SpringyBootsItem(Holder<ArmorMaterial> material, Properties properties) {
super(material, Type.BOOTS, properties);
}
public static boolean isWearingJumpyBoots(net.minecraft.world.entity.LivingEntity entity) {
return entity != null && entity.getItemBySlot(net.minecraft.world.entity.EquipmentSlot.FEET).getItem() instanceof JumpyBootsItem;
public static boolean isWearingSpringyBoots(net.minecraft.world.entity.LivingEntity entity) {
return entity != null && entity.getItemBySlot(net.minecraft.world.entity.EquipmentSlot.FEET).getItem() instanceof SpringyBootsItem;
}
@Override
@@ -27,7 +27,7 @@ public final class JumpyBootsItem extends ArmorItem {
@Override
public void appendHoverText(ItemStack stack, Item.TooltipContext context, List<Component> tooltipComponents, TooltipFlag tooltipFlag) {
tooltipComponents.add(Component.translatable("tooltip.antarchy.jumpy_boots").withStyle(ChatFormatting.DARK_RED));
tooltipComponents.add(Component.translatable("tooltip.antarchy.springy_boots").withStyle(ChatFormatting.DARK_RED));
super.appendHoverText(stack, context, tooltipComponents, tooltipFlag);
}
}
@@ -9,14 +9,14 @@ import net.minecraft.world.item.TooltipFlag;
import java.util.List;
public class CloudSharkFinSoupItem extends Item {
public CloudSharkFinSoupItem(Properties properties) {
public class StratosharkFinSoupItem extends Item {
public StratosharkFinSoupItem(Properties properties) {
super(properties);
}
@Override
public void appendHoverText(ItemStack stack, TooltipContext context, List<Component> tooltipComponents, TooltipFlag tooltipFlag) {
tooltipComponents.add(Component.translatable("tooltip.antarchy.cloud_shark_fin_soup").withStyle(ChatFormatting.GRAY));
tooltipComponents.add(Component.translatable("tooltip.antarchy.stratoshark_fin_soup").withStyle(ChatFormatting.GRAY));
super.appendHoverText(stack, context, tooltipComponents, tooltipFlag);
}
}
@@ -1,12 +1,11 @@
package com.craisinlord.antarchy.content.item.royal;
import com.craisinlord.antarchy.config.AntarchySettings;
import com.craisinlord.antarchy.content.enchantment.AntarchyEnchantments;
import com.craisinlord.antarchy.content.item.RoyalAssailantArmorItem;
import net.minecraft.core.HolderLookup;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.enchantment.Enchantment;
import net.minecraft.world.item.enchantment.EnchantmentHelper;
@@ -24,6 +23,10 @@ public final class RoyalGearHelper {
}
public static void ensureRoyalArmorEnchantments(ItemStack stack, HolderLookup.Provider registries) {
if (stack.getItem() instanceof RoyalAssailantArmorItem armor
&& armor.getArmorType() == net.minecraft.world.item.ArmorItem.Type.BOOTS) {
AntarchyEnchantments.ensure(stack, registries, AntarchyEnchantments.FEATHER_RISING, 1);
}
if (!AntarchySettings.royalArmorComesEnchanted()) {
return;
}
@@ -44,8 +47,4 @@ public final class RoyalGearHelper {
}
}
public static boolean hasUpwardFallImmunityBoots(LivingEntity entity) {
return entity.getItemBySlot(EquipmentSlot.FEET).getItem() instanceof RoyalAssailantArmorItem armor
&& armor.getArmorType() == net.minecraft.world.item.ArmorItem.Type.BOOTS;
}
}
@@ -1,24 +0,0 @@
package com.craisinlord.antarchy.content.network;
import com.craisinlord.antarchy.Antarchy;
import io.netty.buffer.ByteBuf;
import net.minecraft.network.codec.ByteBufCodecs;
import net.minecraft.network.codec.StreamCodec;
import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
import net.minecraft.resources.ResourceLocation;
public record JumpyBootsLaunchPayload(int chargeTicks, boolean sprinting) implements CustomPacketPayload {
public static final Type<JumpyBootsLaunchPayload> TYPE =
new Type<>(ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "jumpy_boots_launch"));
public static final StreamCodec<ByteBuf, JumpyBootsLaunchPayload> STREAM_CODEC =
StreamCodec.composite(
ByteBufCodecs.VAR_INT, JumpyBootsLaunchPayload::chargeTicks,
ByteBufCodecs.BOOL, JumpyBootsLaunchPayload::sprinting,
JumpyBootsLaunchPayload::new
);
@Override
public Type<JumpyBootsLaunchPayload> type() {
return TYPE;
}
}
@@ -0,0 +1,24 @@
package com.craisinlord.antarchy.content.network;
import com.craisinlord.antarchy.Antarchy;
import io.netty.buffer.ByteBuf;
import net.minecraft.network.codec.ByteBufCodecs;
import net.minecraft.network.codec.StreamCodec;
import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
import net.minecraft.resources.ResourceLocation;
public record SpringyBootsLaunchPayload(int chargeTicks, boolean sprinting) implements CustomPacketPayload {
public static final Type<SpringyBootsLaunchPayload> TYPE =
new Type<>(ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "springy_boots_launch"));
public static final StreamCodec<ByteBuf, SpringyBootsLaunchPayload> STREAM_CODEC =
StreamCodec.composite(
ByteBufCodecs.VAR_INT, SpringyBootsLaunchPayload::chargeTicks,
ByteBufCodecs.BOOL, SpringyBootsLaunchPayload::sprinting,
SpringyBootsLaunchPayload::new
);
@Override
public Type<SpringyBootsLaunchPayload> type() {
return TYPE;
}
}
@@ -0,0 +1,65 @@
package com.craisinlord.antarchy.content.time;
import com.craisinlord.antarchy.content.enchantment.AntarchyEnchantments;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
public final class ChronosphereManager {
public static final double RATE = 0.35D;
private static final Map<UUID, UUID> ACTIVE_FIELDS = new HashMap<>();
private ChronosphereManager() {
}
public static void refresh(ServerPlayer player) {
if (!(player.level() instanceof ServerLevel level)) {
return;
}
int enchantmentLevel = AntarchyEnchantments.chronosphereLevel(player);
UUID playerId = player.getUUID();
UUID fieldId = ACTIVE_FIELDS.get(playerId);
TimeDilationFieldEntity field = fieldId != null && level.getEntity(fieldId) instanceof TimeDilationFieldEntity existing
? existing
: null;
if (enchantmentLevel <= 0 || !player.isAlive()) {
ACTIVE_FIELDS.remove(playerId);
if (field != null) {
field.discard();
}
return;
}
List<TimeDilationFieldEntity> fields = new ArrayList<>();
if (field == null) {
for (var entity : level.getAllEntities()) {
if (entity instanceof TimeDilationFieldEntity candidate && candidate.isChronosphere() && candidate.isOwnedBy(player)) {
fields.add(candidate);
}
}
}
if (field == null && fields.isEmpty()) {
field = TimeDilationApi.createField(level, player.position(), radius(enchantmentLevel), RATE, -1, player.getUUID(), false);
field.configureChronosphere(player);
} else if (field == null) {
field = fields.getFirst();
field.configureChronosphere(player);
for (int index = 1; index < fields.size(); index++) {
fields.get(index).discard();
}
}
field.setFieldRadius(radius(enchantmentLevel));
ACTIVE_FIELDS.put(playerId, field.getUUID());
}
public static double radius(int level) {
return switch (level) {
case 1 -> 1.5D;
case 2 -> 2.5D;
default -> 3.5D;
};
}
}
@@ -121,11 +121,15 @@ public final class TimeDilationApi {
}
public static boolean consumeTick(Entity entity, String timerKey) {
double rate = getRate(entity);
if (Math.abs(rate - TimeDilationMath.NORMAL_RATE) < 0.001D || !(entity instanceof TimeDilationEntityAccess access)) {
return true;
return consumeTicks(entity, timerKey) > 0;
}
return access.antarchy$consumeTimeDilationTick(timerKey, rate);
public static int consumeTicks(Entity entity, String timerKey) {
double rate = getRate(entity);
if (entity instanceof TimeDilationEntityAccess access) {
return access.antarchy$consumeTimeDilationTicks(timerKey, rate);
}
return 1;
}
public static int scaleCooldownTicks(Entity entity, int ticks) {
@@ -11,6 +11,8 @@ public interface TimeDilationEntityAccess {
boolean antarchy$consumeTimeDilationTick(String timerKey, double rate);
int antarchy$consumeTimeDilationTicks(String timerKey, double rate);
boolean antarchy$isInTimeDilationMove();
void antarchy$setInTimeDilationMove(boolean inMove);
@@ -11,6 +11,9 @@ import net.minecraft.network.syncher.EntityDataSerializers;
import net.minecraft.network.syncher.SynchedEntityData;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.projectile.Projectile;
import net.minecraft.world.level.Level;
import net.minecraft.world.phys.Vec3;
import java.util.UUID;
@@ -32,6 +35,7 @@ public class TimeDilationFieldEntity extends Entity {
private UUID anchorId;
private int missingAnchorTicks;
private boolean visual = true;
private boolean chronosphere;
public TimeDilationFieldEntity(EntityType<? extends TimeDilationFieldEntity> entityType, Level level) {
super(entityType, level);
@@ -67,11 +71,26 @@ public class TimeDilationFieldEntity extends Entity {
this.missingAnchorTicks = 0;
}
public void configureChronosphere(Entity owner) {
this.ownerId = owner.getUUID();
this.attachTo(owner);
this.durationTicks = -1;
this.visual = false;
this.chronosphere = true;
}
public boolean isChronosphere() {
return this.chronosphere;
}
public boolean affects(Entity entity) {
if (entity instanceof RoyalBlackHoleEntity || this.isOwnedBy(entity)
|| this.anchorId != null && this.anchorId.equals(entity.getUUID())) {
return false;
}
if (this.chronosphere && !(entity instanceof LivingEntity || entity instanceof Projectile || entity instanceof ItemEntity)) {
return false;
}
if (this.ownerId != null && this.level() instanceof ServerLevel level
&& level.getEntity(this.ownerId) instanceof QueenEntity) {
return !entity.getType().is(AntarchyTags.Entities.QUEEN_DOES_NOT_ATTACK);
@@ -103,6 +122,18 @@ public class TimeDilationFieldEntity extends Entity {
: anchor.position();
this.setPos(center.x, center.y, center.z);
this.missingAnchorTicks = 0;
if (this.chronosphere && this.age % 20 == 0) {
if (!(anchor instanceof net.minecraft.server.level.ServerPlayer player)) {
this.discard();
return;
}
int levelValue = com.craisinlord.antarchy.content.enchantment.AntarchyEnchantments.chronosphereLevel(player);
if (levelValue <= 0) {
this.discard();
return;
}
this.setFieldRadius(ChronosphereManager.radius(levelValue));
}
} else if (++this.missingAnchorTicks > 20) {
this.discard();
return;
@@ -165,6 +196,7 @@ public class TimeDilationFieldEntity extends Entity {
this.ownerId = tag.hasUUID("OwnerUuid") ? tag.getUUID("OwnerUuid") : null;
this.anchorId = tag.hasUUID("AnchorUuid") ? tag.getUUID("AnchorUuid") : null;
this.visual = !tag.contains("Visual") || tag.getBoolean("Visual");
this.chronosphere = tag.getBoolean("Chronosphere");
}
@Override
@@ -180,5 +212,6 @@ public class TimeDilationFieldEntity extends Entity {
tag.putUUID("AnchorUuid", this.anchorId);
}
tag.putBoolean("Visual", this.visual);
tag.putBoolean("Chronosphere", this.chronosphere);
}
}
@@ -56,6 +56,7 @@ public final class TimeDilationManager {
private static void syncFieldSnapshots(ServerLevel level, List<TimeDilationFieldEntity> fields, TrackingState tracking) {
List<TimeDilationFieldSnapshot> snapshots = fields.stream()
.filter(field -> !field.isChronosphere())
.map(field -> new TimeDilationFieldSnapshot(
field.getX(), field.getY(), field.getZ(), field.fieldRadius(), field.fieldRate(),
field.fieldAge(), field.fieldDurationTicks()))
@@ -2,8 +2,8 @@ package com.craisinlord.antarchy.content.worldgen.cavaryn;
import com.craisinlord.antarchy.Antarchy;
import com.craisinlord.antarchy.content.AntarchyObjects;
import com.craisinlord.antarchy.content.block.CreepingHorrorEggBlock;
import com.craisinlord.antarchy.content.block.LurkingTerrorEggBlock;
import com.craisinlord.antarchy.content.block.CrawlingBlightEggBlock;
import com.craisinlord.antarchy.content.block.SkulkingFrightEggBlock;
import com.mojang.serialization.Codec;
import java.util.ArrayList;
import java.util.List;
@@ -45,7 +45,7 @@ public final class CavarynEggPatchFeature extends Feature<NoneFeatureConfigurati
return false;
}
EggType eggType = random.nextBoolean() ? EggType.CREEPING_HORROR : EggType.LURKING_TERROR;
EggType eggType = random.nextBoolean() ? EggType.CRAWLING_BLIGHT : EggType.SKULKING_FRIGHT;
return carveCavityAndPlaceEggs(level, center, random, eggType, amberMossBlock);
}
@@ -144,11 +144,11 @@ public final class CavarynEggPatchFeature extends Feature<NoneFeatureConfigurati
}
}
BlockState eggState = eggType == EggType.CREEPING_HORROR
? AntarchyObjects.CREEPING_HORROR_EGGS.get().defaultBlockState()
: AntarchyObjects.LURKING_TERROR_EGGS.get().defaultBlockState();
BlockState eggState = eggType == EggType.CRAWLING_BLIGHT
? AntarchyObjects.CRAWLING_BLIGHT_EGGS.get().defaultBlockState()
: AntarchyObjects.SKULKING_FRIGHT_EGGS.get().defaultBlockState();
eggState = eggState.setValue(
eggType == EggType.CREEPING_HORROR ? CreepingHorrorEggBlock.EGGS : LurkingTerrorEggBlock.EGGS,
eggType == EggType.CRAWLING_BLIGHT ? CrawlingBlightEggBlock.EGGS : SkulkingFrightEggBlock.EGGS,
1 + random.nextInt(4));
level.setBlock(eggPos, eggState, 3);
placedAny = true;
@@ -163,7 +163,7 @@ public final class CavarynEggPatchFeature extends Feature<NoneFeatureConfigurati
}
private enum EggType {
CREEPING_HORROR,
LURKING_TERROR
CRAWLING_BLIGHT,
SKULKING_FRIGHT
}
}
@@ -1,7 +1,7 @@
package com.craisinlord.antarchy.content.worldgen.cavaryn;
import com.craisinlord.antarchy.Antarchy;
import com.craisinlord.antarchy.content.block.JumpyBugEggBlock;
import com.craisinlord.antarchy.content.block.SpringbugEggBlock;
import com.mojang.serialization.Codec;
import java.util.Optional;
import net.minecraft.core.BlockPos;
@@ -16,20 +16,20 @@ import net.minecraft.world.level.levelgen.feature.Feature;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
public final class JumpyBugEggCeilingFeature extends Feature<NoneFeatureConfiguration> {
private static final ResourceLocation JUMPY_BUG_EGG_ID = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "jumpy_bug_egg");
public final class SpringbugEggCeilingFeature extends Feature<NoneFeatureConfiguration> {
private static final ResourceLocation SPRINGBUG_EGG_ID = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "springbug_egg");
private static final int SEARCH_RADIUS = 8;
private static final int VERTICAL_SCAN = 24;
private static final int SEARCH_ATTEMPTS = 24;
private static final int MAX_PLACEMENTS = 3;
public JumpyBugEggCeilingFeature(Codec<NoneFeatureConfiguration> codec) {
public SpringbugEggCeilingFeature(Codec<NoneFeatureConfiguration> codec) {
super(codec);
}
@Override
public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> context) {
Block eggBlock = getBlock(JUMPY_BUG_EGG_ID);
Block eggBlock = getBlock(SPRINGBUG_EGG_ID);
if (eggBlock == null) {
return false;
}
@@ -61,8 +61,8 @@ public final class JumpyBugEggCeilingFeature extends Feature<NoneFeatureConfigur
continue;
}
BlockState eggState = eggBlock.defaultBlockState()
.setValue(JumpyBugEggBlock.HANGING, true)
.setValue(JumpyBugEggBlock.ROTATED, random.nextBoolean());
.setValue(SpringbugEggBlock.HANGING, true)
.setValue(SpringbugEggBlock.ROTATED, random.nextBoolean());
level.setBlock(spot, eggState, 3);
placedAny = true;
placements++;
@@ -1,7 +1,7 @@
package com.craisinlord.antarchy.content.worldgen.elythia;
import com.craisinlord.antarchy.content.AntarchyObjects;
import com.craisinlord.antarchy.content.entity.TriffidEntity;
import com.craisinlord.antarchy.content.entity.FlytrapEntity;
import com.mojang.serialization.Codec;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
@@ -18,11 +18,11 @@ import net.minecraft.world.level.levelgen.feature.Feature;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
public final class TriffidPatchFeature extends Feature<NoneFeatureConfiguration> {
public final class FlytrapPatchFeature extends Feature<NoneFeatureConfiguration> {
private static final int PATCH_RADIUS = 5;
private static final double PATCH_RADIUS_SQR = 30.25D;
public TriffidPatchFeature(Codec<NoneFeatureConfiguration> codec) {
public FlytrapPatchFeature(Codec<NoneFeatureConfiguration> codec) {
super(codec);
}
@@ -45,18 +45,18 @@ public final class TriffidPatchFeature extends Feature<NoneFeatureConfiguration>
return false;
}
TriffidEntity triffid = AntarchyObjects.TRIFFID.get().create(serverLevel.getLevel());
if (triffid == null) {
FlytrapEntity flytrap = AntarchyObjects.FLYTRAP.get().create(serverLevel.getLevel());
if (flytrap == null) {
return false;
}
DifficultyInstance difficulty = serverLevel.getCurrentDifficultyAt(center);
triffid.moveTo(center.getX() + 0.5D, center.getY() + 1.0D, center.getZ() + 0.5D, random.nextFloat() * 360.0F, 0.0F);
triffid.finalizeSpawn(serverLevel, difficulty, MobSpawnType.CHUNK_GENERATION, null);
triffid.setPersistenceRequired();
flytrap.moveTo(center.getX() + 0.5D, center.getY() + 1.0D, center.getZ() + 0.5D, random.nextFloat() * 360.0F, 0.0F);
flytrap.finalizeSpawn(serverLevel, difficulty, MobSpawnType.CHUNK_GENERATION, null);
flytrap.setPersistenceRequired();
layPatch(level, center, random);
serverLevel.addFreshEntity(triffid);
serverLevel.addFreshEntity(flytrap);
return true;
}
@@ -133,7 +133,7 @@ public final class TriffidPatchFeature extends Feature<NoneFeatureConfiguration>
return null;
}
BlockState goo = AntarchyObjects.TRIFFID_GOO_BLOCK.get().defaultBlockState();
BlockState goo = AntarchyObjects.FLYTRAP_GOO_BLOCK.get().defaultBlockState();
BlockState mud = Blocks.MUD.defaultBlockState();
if (normalizedDistance < 0.32D) {
@@ -1,6 +1,8 @@
package com.craisinlord.antarchy.content.worldgen.elythia;
import com.craisinlord.antarchy.Antarchy;
import com.craisinlord.antarchy.content.AntarchyObjects;
import com.craisinlord.antarchy.content.entity.royal.KingEntity;
import com.mojang.serialization.Codec;
import net.minecraft.core.BlockPos;
import net.minecraft.resources.ResourceLocation;
@@ -17,7 +19,10 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.LiquidSetting
import net.minecraft.world.level.levelgen.structure.templatesystem.StructurePlaceSettings;
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate;
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplateManager;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.Vec3;
import java.util.List;
import java.util.Optional;
/** Places the authored King's Tree as independently generated chunk slices on a fixed world grid. */
@@ -83,6 +88,7 @@ public final class KingsTreeGridFeature extends Feature<NoneFeatureConfiguration
StructureTemplateManager templates = level.getLevel().getStructureManager();
RandomSource random = context.random();
boolean placed = false;
boolean centralTilePlaced = false;
for (int tileX = minTileX; tileX <= maxTileX; tileX++) {
for (int tileZ = minTileZ; tileZ <= maxTileZ; tileZ++) {
@@ -91,12 +97,46 @@ public final class KingsTreeGridFeature extends Feature<NoneFeatureConfiguration
continue;
}
BlockPos tileOrigin = treeBottomOrigin.offset(centerX + tileX * 16, 0, centerZ + tileZ * 16);
placed |= template.get().placeInWorld(level, tileOrigin, tileOrigin, settings, random, 2);
boolean tilePlaced = template.get().placeInWorld(level, tileOrigin, tileOrigin, settings, random, 2);
placed |= tilePlaced;
centralTilePlaced |= tileX == 0 && tileZ == 0 && tilePlaced;
}
}
if (centralTilePlaced) {
spawnTreeKing(level, centerX, centerZ, baseY);
}
return placed;
}
private static void spawnTreeKing(WorldGenLevel level, int centerX, int centerZ, int baseY) {
var serverLevel = level.getLevel();
Vec3 treeCenter = new Vec3(centerX + 0.5D, 0.0D, centerZ + 0.5D);
AABB searchBox = new AABB(
centerX - 512.0D, level.getMinBuildHeight(), centerZ - 512.0D,
centerX + 512.0D, level.getMaxBuildHeight(), centerZ + 512.0D);
List<KingEntity> treeKings = serverLevel.getEntitiesOfClass(KingEntity.class, searchBox,
king -> king.isAlive() && king.isTreePatrolFor(treeCenter));
if (!treeKings.isEmpty()) {
// Repair older worlds that already contain duplicate tree-bound Kings.
for (int index = 1; index < treeKings.size(); index++) {
treeKings.get(index).discard();
}
return;
}
KingEntity king = AntarchyObjects.KING.get().create(serverLevel);
if (king == null) {
return;
}
double minimumY = baseY + 24.0D;
double maximumY = baseY + 304.0D;
double spawnY = (minimumY + maximumY) * 0.5D;
// Start just outside the central trunk, inside the tree's authored footprint.
king.moveTo(centerX + 48.5D, spawnY, centerZ + 0.5D, 90.0F, 0.0F);
king.setTreePatrolHome(treeCenter, minimumY, maximumY, 0.0D);
king.setPersistenceRequired();
serverLevel.addFreshEntity(king);
}
private static ResourceLocation tileLocation(int tileX, int tileZ) {
return ResourceLocation.fromNamespaceAndPath(
Antarchy.MODID,
@@ -0,0 +1,237 @@
package com.craisinlord.antarchy.content.worldgen.thoraxis;
import com.craisinlord.antarchy.Antarchy;
import com.craisinlord.antarchy.content.block.entity.QueenTrailSpawnMarkerBlockEntity;
import net.minecraft.core.BlockPos;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.ChunkPos;
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.entity.BlockEntity;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.feature.Feature;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
public final class QueenHavocTrailFeature extends Feature<NoneFeatureConfiguration> {
private static final ResourceLocation DREAM_SAND = id("dream_sand");
private static final ResourceLocation DREAM_SANDSTONE = id("dream_sandstone");
private static final ResourceLocation CUT_DREAM_SANDSTONE = id("cut_dream_sandstone");
private static final ResourceLocation DREAM_FIRE = id("dream_fire_ceiling");
private static final ResourceLocation SPAWN_MARKER = id("queen_trail_spawn_marker");
private static final int CHAMBER_RADIUS = 30;
private static final int CHAMBER_DEPTH = 20;
public QueenHavocTrailFeature() {
super(NoneFeatureConfiguration.CODEC);
}
@Override
public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> context) {
WorldGenLevel level = context.level();
ChunkPos chunk = new ChunkPos(context.origin());
int cellX = Math.floorDiv(chunk.getMiddleBlockX(), QueenTrailGrid.SPACING);
int cellZ = Math.floorDiv(chunk.getMiddleBlockZ(), QueenTrailGrid.SPACING);
boolean placed = false;
for (int x = cellX - 1; x <= cellX + 1; x++) {
for (int z = cellZ - 1; z <= cellZ + 1; z++) {
QueenTrailGrid.Site site = QueenTrailGrid.site(level.getSeed(), x, z);
placed |= placeSiteSlice(level, chunk, site);
}
}
return placed;
}
private static boolean placeSiteSlice(WorldGenLevel level, ChunkPos chunk, QueenTrailGrid.Site site) {
int reach = site.length() + CHAMBER_RADIUS;
if (site.terminalX() + reach < chunk.getMinBlockX() || site.terminalX() - reach > chunk.getMaxBlockX()
|| site.terminalZ() + reach < chunk.getMinBlockZ() || site.terminalZ() - reach > chunk.getMaxBlockZ()) {
return false;
}
boolean placed = placeChamber(level, chunk, site);
for (int index = 0; index < site.footprints(); index++) {
double progress = index / (double) Math.max(1, site.footprints() - 1);
double distance = 18.0D + (site.footprints() - 1 - index) * site.stride();
double side = (index & 1) == 0 ? -2.5D : 2.5D;
double centerX = site.terminalX() - site.directionX() * distance - site.directionZ() * side;
double centerZ = site.terminalZ() - site.directionZ() * distance + site.directionX() * side;
placed |= placeFootprint(level, chunk, site, index, progress, centerX, centerZ);
if (index % 4 == 2) {
double craterSide = ((site.id() >>> (index & 31)) & 1L) == 0L ? -5.0D : 5.0D;
placed |= placeCrater(level, chunk, site, index, progress,
centerX - site.directionZ() * craterSide,
centerZ + site.directionX() * craterSide);
}
}
if (contains(chunk, site.terminalX(), site.terminalZ())) {
placed |= placeMarker(level, site);
}
return placed;
}
private static boolean placeFootprint(WorldGenLevel level, ChunkPos chunk, QueenTrailGrid.Site site, int index,
double progress, double centerX, double centerZ) {
boolean placed = false;
int minX = Math.max(chunk.getMinBlockX(), (int) Math.floor(centerX - 4.0D));
int maxX = Math.min(chunk.getMaxBlockX(), (int) Math.ceil(centerX + 4.0D));
int minZ = Math.max(chunk.getMinBlockZ(), (int) Math.floor(centerZ - 4.0D));
int maxZ = Math.min(chunk.getMaxBlockZ(), (int) Math.ceil(centerZ + 4.0D));
for (int x = minX; x <= maxX; x++) {
for (int z = minZ; z <= maxZ; z++) {
double dx = x + 0.5D - centerX;
double dz = z + 0.5D - centerZ;
double forward = dx * site.directionX() + dz * site.directionZ();
double lateral = -dx * site.directionZ() + dz * site.directionX();
boolean pad = square((forward + 0.5D) / 2.5D) + square(lateral / 2.0D) <= 1.0D;
boolean toes = toe(forward, lateral, -1.5D) || toe(forward, lateral, 0.0D) || toe(forward, lateral, 1.5D);
if (!pad && !toes) {
continue;
}
int depth = progress > 0.78D ? 3 : progress > 0.35D ? 2 : 1;
double fireChance = 0.12D + progress * 0.48D;
placed |= carvePrintColumn(level, x, z, depth, unit(site.id(), x, z, index) < fireChance,
index % 3 == 0 ? CUT_DREAM_SANDSTONE : DREAM_SANDSTONE);
}
}
return placed;
}
private static boolean placeCrater(WorldGenLevel level, ChunkPos chunk, QueenTrailGrid.Site site, int index,
double progress, double centerX, double centerZ) {
int radius = progress > 0.65D ? 4 : 3;
boolean placed = false;
for (int x = Math.max(chunk.getMinBlockX(), (int) centerX - radius); x <= Math.min(chunk.getMaxBlockX(), (int) centerX + radius); x++) {
for (int z = Math.max(chunk.getMinBlockZ(), (int) centerZ - radius); z <= Math.min(chunk.getMaxBlockZ(), (int) centerZ + radius); z++) {
double distance = square((x + 0.5D - centerX) / radius) + square((z + 0.5D - centerZ) / radius);
if (distance <= 1.0D && unit(site.id() ^ 0x6A09E667F3BCC909L, x, z, index) > distance * 0.35D) {
placed |= carvePrintColumn(level, x, z, distance < 0.32D ? 2 : 1,
unit(site.id(), z, x, index + 31) < 0.35D + progress * 0.35D, DREAM_SANDSTONE);
}
}
}
return placed;
}
private static boolean placeChamber(WorldGenLevel level, ChunkPos chunk, QueenTrailGrid.Site site) {
int minX = Math.max(chunk.getMinBlockX(), site.terminalX() - CHAMBER_RADIUS);
int maxX = Math.min(chunk.getMaxBlockX(), site.terminalX() + CHAMBER_RADIUS);
int minZ = Math.max(chunk.getMinBlockZ(), site.terminalZ() - CHAMBER_RADIUS);
int maxZ = Math.min(chunk.getMaxBlockZ(), site.terminalZ() + CHAMBER_RADIUS);
boolean placed = false;
for (int x = minX; x <= maxX; x++) {
for (int z = minZ; z <= maxZ; z++) {
int dx = x - site.terminalX();
int dz = z - site.terminalZ();
int distanceSquared = dx * dx + dz * dz;
if (distanceSquared > CHAMBER_RADIUS * CHAMBER_RADIUS) {
continue;
}
BlockPos ceiling = findCeiling(level, x, z);
if (ceiling == null) {
continue;
}
for (int depth = 1; depth <= CHAMBER_DEPTH; depth++) {
BlockPos air = ceiling.below(depth);
if (!level.getBlockState(air).isAir()) {
level.setBlock(air, Blocks.AIR.defaultBlockState(), 2);
}
}
double edge = Math.sqrt(distanceSquared) / CHAMBER_RADIUS;
if (edge > 0.58D && unit(site.id() ^ 0xBB67AE8584CAA73BL, x, z, 0) < 0.18D + edge * 0.22D) {
placeCeilingFire(level, ceiling);
}
placed = true;
}
}
return placed;
}
private static boolean placeMarker(WorldGenLevel level, QueenTrailGrid.Site site) {
BlockPos ceiling = findCeiling(level, site.terminalX(), site.terminalZ());
if (ceiling == null) {
return false;
}
Block markerBlock = block(SPAWN_MARKER, Blocks.BARRIER);
BlockPos markerPos = ceiling.above(4);
level.setBlock(markerPos, markerBlock.defaultBlockState(), 2);
BlockEntity blockEntity = level.getBlockEntity(markerPos);
if (!(blockEntity instanceof QueenTrailSpawnMarkerBlockEntity marker)) {
return false;
}
BlockPos spawnPos = new BlockPos(site.terminalX(), ceiling.getY() - 17, site.terminalZ());
BlockPos homePos = new BlockPos(site.terminalX(), ceiling.getY() - 2, site.terminalZ());
float yaw = (float) Math.toDegrees(Math.atan2(site.directionZ(), site.directionX())) - 90.0F;
marker.configure(site.id(), spawnPos, homePos, yaw);
return true;
}
private static boolean carvePrintColumn(WorldGenLevel level, int x, int z, int depth, boolean fire, ResourceLocation backingId) {
BlockPos ceiling = findCeiling(level, x, z);
if (ceiling == null) {
return false;
}
BlockPos backing = ceiling.above(depth);
level.setBlock(backing, block(backingId, Blocks.SANDSTONE).defaultBlockState(), 2);
for (int offset = 0; offset < depth; offset++) {
level.setBlock(ceiling.above(offset), Blocks.AIR.defaultBlockState(), 2);
}
if (fire) {
placeCeilingFire(level, backing);
}
return true;
}
private static void placeCeilingFire(WorldGenLevel level, BlockPos support) {
BlockPos firePos = support.below();
if (level.getBlockState(firePos).isAir()) {
level.setBlock(firePos, block(DREAM_FIRE, Blocks.SOUL_FIRE).defaultBlockState(), 2);
}
}
private static BlockPos findCeiling(WorldGenLevel level, int x, int z) {
BlockPos.MutableBlockPos cursor = new BlockPos.MutableBlockPos(x, -8, z);
int minimum = Math.max(level.getMinBuildHeight() + 20, -240);
for (int y = -8; y >= minimum; y--) {
cursor.setY(y);
if (isDreamSurface(level.getBlockState(cursor)) && level.getBlockState(cursor.below()).isAir()) {
return cursor.immutable();
}
}
return null;
}
private static boolean isDreamSurface(BlockState state) {
ResourceLocation id = BuiltInRegistries.BLOCK.getKey(state.getBlock());
return DREAM_SAND.equals(id) || DREAM_SANDSTONE.equals(id) || CUT_DREAM_SANDSTONE.equals(id);
}
private static boolean contains(ChunkPos chunk, int x, int z) {
return x >= chunk.getMinBlockX() && x <= chunk.getMaxBlockX() && z >= chunk.getMinBlockZ() && z <= chunk.getMaxBlockZ();
}
private static boolean toe(double forward, double lateral, double toeCenter) {
return square((forward - 2.2D) / 1.25D) + square((lateral - toeCenter) / 0.8D) <= 1.0D;
}
private static double square(double value) {
return value * value;
}
private static double unit(long seed, int x, int z, int salt) {
long value = seed ^ (long) x * 0x9E3779B97F4A7C15L ^ (long) z * 0xC2B2AE3D27D4EB4FL ^ (long) salt * 0x165667B19E3779F9L;
value ^= value >>> 30;
value *= 0xBF58476D1CE4E5B9L;
value ^= value >>> 27;
return (value >>> 11) * 0x1.0p-53;
}
private static Block block(ResourceLocation id, Block fallback) {
return BuiltInRegistries.BLOCK.getOptional(id).orElse(fallback);
}
private static ResourceLocation id(String path) {
return ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, path);
}
}
@@ -0,0 +1,38 @@
package com.craisinlord.antarchy.content.worldgen.thoraxis;
import net.minecraft.util.RandomSource;
public final class QueenTrailGrid {
public static final int SPACING = 1_536;
private static final int JITTER_MARGIN = 256;
private QueenTrailGrid() {
}
public static Site site(long worldSeed, int cellX, int cellZ) {
long seed = mix(worldSeed ^ 0x51A7E4D39B20C16DL, cellX, cellZ);
RandomSource random = RandomSource.create(seed);
int usable = SPACING - JITTER_MARGIN * 2;
int x = cellX * SPACING + JITTER_MARGIN + random.nextInt(usable);
int z = cellZ * SPACING + JITTER_MARGIN + random.nextInt(usable);
double angle = random.nextDouble() * Math.PI * 2.0D;
int footprints = 16 + random.nextInt(7);
int stride = 6 + random.nextInt(2);
return new Site(seed, x, z, Math.cos(angle), Math.sin(angle), footprints, stride);
}
private static long mix(long seed, int x, int z) {
long value = seed ^ (long) x * 0x9E3779B97F4A7C15L ^ (long) z * 0xC2B2AE3D27D4EB4FL;
value ^= value >>> 30;
value *= 0xBF58476D1CE4E5B9L;
value ^= value >>> 27;
value *= 0x94D049BB133111EBL;
return value ^ value >>> 31;
}
public record Site(long id, int terminalX, int terminalZ, double directionX, double directionZ, int footprints, int stride) {
public int length() {
return this.footprints * this.stride + 18;
}
}
}
@@ -0,0 +1,83 @@
package com.craisinlord.antarchy.content.worldgen.thoraxis;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.levelgen.Heightmap;
import net.minecraft.world.level.levelgen.feature.Feature;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
public final class ThoraxisTransitionThroatFeature extends Feature<NoneFeatureConfiguration> {
public ThoraxisTransitionThroatFeature() {
super(NoneFeatureConfiguration.CODEC);
}
@Override
public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> context) {
WorldGenLevel level = context.level();
BlockPos origin = context.origin();
BlockPos center = new BlockPos(origin.getX(), ThoraxisUndersideManager.GRAVITY_FLIP_Y, origin.getZ());
int upperSurface = level.getHeight(Heightmap.Types.WORLD_SURFACE_WG, center.getX(), center.getZ()) - 1;
int undersideSurface = findUndersideSurface(level, center);
if (upperSurface < ThoraxisUndersideManager.GRAVITY_FLIP_Y || undersideSurface < level.getMinBuildHeight()) {
return false;
}
long seed = context.random().nextLong();
for (int y = undersideSurface; y <= upperSurface; y++) {
int layerOffsetX = noise(seed, Math.floorDiv(y, 5), 17) * 2;
int layerOffsetZ = noise(seed, Math.floorDiv(y, 5), 31) * 2;
double radiusX = 3.5D + noise01(seed, Math.floorDiv(y, 11), 43) * 2.0D;
double radiusZ = 3.5D + noise01(seed, Math.floorDiv(y, 13), 59) * 2.0D;
for (int x = -7; x <= 7; x++) {
for (int z = -7; z <= 7; z++) {
double dx = x - layerOffsetX;
double dz = z - layerOffsetZ;
double distance = Math.sqrt((dx * dx) / (radiusX * radiusX) + (dz * dz) / (radiusZ * radiusZ));
double edgeNoise = noise01(seed, x * 3 + Math.floorDiv(y, 3), z * 3 + 71);
if (distance <= 0.72D + edgeNoise * 0.42D) {
level.setBlock(center.offset(x, y, z), Blocks.AIR.defaultBlockState(), 2);
}
}
}
}
return true;
}
private static int findUndersideSurface(WorldGenLevel level, BlockPos center) {
int minY = level.getMinBuildHeight();
int firstSolid = Integer.MIN_VALUE;
for (int y = ThoraxisUndersideManager.GRAVITY_FLIP_Y - 1; y >= minY; y--) {
if (!level.getBlockState(center.atY(y)).isAir()) {
firstSolid = y;
break;
}
}
if (firstSolid == Integer.MIN_VALUE) {
return minY;
}
int y = firstSolid;
while (y > minY && !level.getBlockState(center.atY(y - 1)).isAir()) {
y--;
}
return y;
}
private static double noise01(long seed, int x, int z) {
long value = seed + 0x9E3779B97F4A7C15L;
value ^= x * 0x632BE59BD9B4E019L;
value ^= z * 0xC6BC279692B5CC83L;
value = (value ^ (value >>> 30)) * 0xBF58476D1CE4E5B9L;
value = (value ^ (value >>> 27)) * 0x94D049BB133111EBL;
value ^= value >>> 31;
return (value >>> 11) * 0x1.0p-53;
}
private static int noise(long seed, int x, int z) {
return noise01(seed, x, z) < 0.5D ? -1 : 1;
}
}
@@ -14,22 +14,25 @@ import java.util.WeakHashMap;
import java.util.UUID;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.projectile.Projectile;
import net.minecraft.world.level.ServerLevelAccessor;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.Vec3;
public final class ThoraxisUndersideManager {
public static final int GRAVITY_FLIP_Y = 0;
private static final ResourceLocation THORAXIS_DIMENSION = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "thoraxis");
private static final net.minecraft.resources.ResourceLocation THORAXIS_DIMENSION = net.minecraft.resources.ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "thoraxis");
private static final AntarchyGravityTransition TRANSITION = new AntarchyGravityTransition(12);
private static final AntarchyGravityTransition THROAT_TRANSITION = new AntarchyGravityTransition(20);
private static final int EFFECT_DURATION_TICKS = 50;
private static final int EFFECT_REFRESH_THRESHOLD_TICKS = 10;
private static final int DISCOVERY_INTERVAL_TICKS = 5;
@@ -40,6 +43,9 @@ public final class ThoraxisUndersideManager {
private static final int ENTER_UNDERSIDE_Y = GRAVITY_FLIP_Y - 4;
private static final int EXIT_UNDERSIDE_Y = GRAVITY_FLIP_Y + 4;
private static final int FLIP_COOLDOWN_TICKS = 40;
private static final int CROSSING_TIMEOUT_TICKS = 30;
private static final int SETTLE_TIMEOUT_TICKS = 70;
private static final double MIN_CROSSING_SPEED = 0.48D;
private static final Map<ServerLevel, TrackingState> STATES = new WeakHashMap<>();
private ThoraxisUndersideManager() {
@@ -59,6 +65,7 @@ public final class ThoraxisUndersideManager {
long startNanos = System.nanoTime();
long now = level.getGameTime();
tickPlayerTransitions(level, tracking, now);
int discoveredLiving = 0;
int discoveredItems = 0;
if (now % DISCOVERY_INTERVAL_TICKS == 0L) {
@@ -78,6 +85,9 @@ public final class ThoraxisUndersideManager {
}
if (entity instanceof LivingEntity living) {
if (living instanceof Player) {
continue;
}
boolean hasEffect = living.hasEffect(AntarchyObjects.INVERTED_EFFECT.get());
int threshold = hasEffect ? EXIT_UNDERSIDE_Y : ENTER_UNDERSIDE_Y;
if (living.getY() < threshold) {
@@ -150,6 +160,7 @@ public final class ThoraxisUndersideManager {
private final Set<Entity> entities = Collections.newSetFromMap(new IdentityHashMap<>());
private final Set<Entity> forcedItems = Collections.newSetFromMap(new IdentityHashMap<>());
private final Map<UUID, Long> lastFlipTick = new java.util.HashMap<>();
private final Map<UUID, PlayerCrossing> playerCrossings = new java.util.HashMap<>();
private long lastDiagnosticTick = Long.MIN_VALUE / 2L;
private DiscoveryStats discover(ServerLevel level) {
@@ -178,6 +189,105 @@ public final class ThoraxisUndersideManager {
entities.clear();
forcedItems.clear();
lastFlipTick.clear();
playerCrossings.clear();
}
}
private static void tickPlayerTransitions(ServerLevel level, TrackingState tracking, long now) {
tracking.playerCrossings.keySet().removeIf(uuid -> level.getPlayerByUUID(uuid) == null);
for (ServerPlayer player : level.players()) {
PlayerCrossing crossing = tracking.playerCrossings.get(player.getUUID());
if (crossing != null) {
tickPlayerCrossing(player, crossing, tracking, now);
continue;
}
if (player.isSpectator()) {
continue;
}
if (isCrossingGravityBoundary(player) && flipReady(tracking, player.getUUID(), now)) {
boolean toUnderside = AntarchyGravityApi.getGravityDirection(player) == AntarchyGravityDirection.DOWN;
if (!toUnderside) {
refreshInvertedEffect(player);
}
tracking.playerCrossings.put(player.getUUID(), new PlayerCrossing(toUnderside));
continue;
}
MobEffectInstance effect = player.getEffect(AntarchyObjects.INVERTED_EFFECT.get());
if (player.getY() < ENTER_UNDERSIDE_Y) {
refreshInvertedEffect(player);
} else if (effect != null && isUndersideEffect(effect) && player.getY() < EXIT_UNDERSIDE_Y) {
refreshInvertedEffect(player);
}
}
}
private static void tickPlayerCrossing(ServerPlayer player, PlayerCrossing crossing, TrackingState tracking, long now) {
crossing.ticks++;
Vec3 velocity = AntarchyGravityApi.getWorldVelocity(player);
if (!crossing.flipped) {
if (!crossing.toUnderside) {
refreshInvertedEffect(player);
}
if (crossing.ticks > CROSSING_TIMEOUT_TICKS
|| (crossing.toUnderside && velocity.y > 0.08D)
|| (!crossing.toUnderside && velocity.y < -0.08D)) {
tracking.playerCrossings.remove(player.getUUID());
return;
}
AABB bounds = player.getBoundingBox();
boolean clear = crossing.toUnderside ? bounds.maxY < GRAVITY_FLIP_Y : bounds.minY > EXIT_UNDERSIDE_Y;
if (!clear) {
return;
}
AntarchyGravityDirection destination = crossing.toUnderside
? AntarchyGravityDirection.UP
: AntarchyGravityDirection.DOWN;
AntarchyGravityApi.setAirborneGravityDirection(player, destination, crossing.toUnderside, THROAT_TRANSITION);
player.resetFallDistance();
crossing.flipped = true;
crossing.ticks = 0;
tracking.lastFlipTick.put(player.getUUID(), now);
if (crossing.toUnderside) {
refreshInvertedEffect(player);
} else {
player.removeEffect(AntarchyObjects.INVERTED_EFFECT.get());
}
return;
}
if (crossing.toUnderside) {
refreshInvertedEffect(player);
}
if (player.onGround() || crossing.ticks >= SETTLE_TIMEOUT_TICKS) {
tracking.playerCrossings.remove(player.getUUID());
}
}
private static boolean isCrossingGravityBoundary(ServerPlayer player) {
Vec3 velocity = AntarchyGravityApi.getWorldVelocity(player);
AABB swept = player.getBoundingBox().expandTowards(velocity.scale(-1.0D)).inflate(0.08D);
AntarchyGravityDirection direction = AntarchyGravityApi.getGravityDirection(player);
return direction == AntarchyGravityDirection.DOWN
? swept.minY < GRAVITY_FLIP_Y && swept.maxY >= GRAVITY_FLIP_Y && velocity.y <= -MIN_CROSSING_SPEED
: swept.minY <= GRAVITY_FLIP_Y && swept.maxY > GRAVITY_FLIP_Y && velocity.y >= MIN_CROSSING_SPEED;
}
private static boolean isUndersideEffect(MobEffectInstance effect) {
return effect.isAmbient() && !effect.isVisible();
}
private static final class PlayerCrossing {
private final boolean toUnderside;
private int ticks;
private boolean flipped;
private PlayerCrossing(boolean toUnderside) {
this.toUnderside = toUnderside;
}
}
@@ -225,6 +335,32 @@ public final class ThoraxisUndersideManager {
return level.dimension().location().equals(THORAXIS_DIMENSION);
}
/** True only while an entity is physically below Thoraxis' gravity boundary. */
public static boolean isInUnderside(Entity entity) {
return isThoraxis(entity.level()) && entity.getY() < GRAVITY_FLIP_Y;
}
/**
* Keeps projectile gravity positional: UP below Y=0 in Thoraxis and DOWN
* everywhere else. World velocity is preserved when the gravity frame changes.
*/
public static void updateProjectileGravity(Projectile projectile) {
boolean inUnderside = isInUnderside(projectile);
AntarchyGravityDirection desiredDirection = inUnderside
? AntarchyGravityDirection.UP
: AntarchyGravityDirection.DOWN;
boolean stateMismatch = AntarchyGravityApi.getGravityDirection(projectile) != desiredDirection
|| AntarchyGravityApi.isGravityForced(projectile) != inUnderside;
if (stateMismatch) {
AntarchyGravityApi.setAirborneGravityDirection(
projectile,
desiredDirection,
inUnderside,
AntarchyGravityTransition.INSTANT
);
}
}
public static boolean isAboveUndersideExit(Entity entity) {
return isThoraxis(entity.level()) && entity.getY() >= EXIT_UNDERSIDE_Y;
}
@@ -232,7 +368,6 @@ public final class ThoraxisUndersideManager {
/** True while an entity is in the region where the underside gravity rule applies. */
public static boolean shouldInvertInUnderside(Entity entity) {
return AntarchyGravityApi.isGravityInverted(entity)
&& isThoraxis(entity.level())
&& entity.getY() < GRAVITY_FLIP_Y;
&& isInUnderside(entity);
}
}
@@ -34,7 +34,9 @@ public abstract class AbstractArrowGravityMixin {
original.call(self);
return;
}
// Vanilla applies gravity as -getGravity(). Negate that acceleration to
// mirror the projectile's arc for the inverted Underside gravity.
double gravity = self.getGravity();
self.setDeltaMovement(self.getDeltaMovement().add(0.0D, gravity, 0.0D));
self.setDeltaMovement(self.getDeltaMovement().add(0.0D, -gravity, 0.0D));
}
}
@@ -3,7 +3,6 @@ package com.craisinlord.antarchy.mixins.gravity;
import com.craisinlord.antarchy.content.gravity.AntarchyGravityApi;
import com.craisinlord.antarchy.content.gravity.AntarchyGravityDirection;
import com.craisinlord.antarchy.content.gravity.AntarchyGravityRotationUtil;
import com.craisinlord.antarchy.config.AntarchySettings;
import com.craisinlord.antarchy.content.worldgen.thoraxis.ThoraxisUndersideManager;
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
@@ -55,8 +54,6 @@ public abstract class CrossbowItemGravityMixin {
}
private static boolean antarchy$shouldFixProjectileSpawn(LivingEntity shooter) {
return ThoraxisUndersideManager.shouldInvertInUnderside(shooter)
&& (!(shooter instanceof net.minecraft.world.entity.player.Player)
|| AntarchySettings.invertProjectilesFromInvertedPlayers());
return ThoraxisUndersideManager.shouldInvertInUnderside(shooter);
}
}
@@ -195,6 +195,16 @@ public abstract class EntityGravityMixin implements AntarchyGravityAccess {
}
}
@Override
public void antarchy$setAirborneGravityState(AntarchyGravityDirection direction, boolean forced, AntarchyGravityTransition transition) {
Entity entity = this.antarchy$entity();
net.minecraft.world.phys.Vec3 worldVelocity = AntarchyGravityApi.getWorldVelocity(entity);
this.antarchy$setGravityState(direction, forced, transition);
AntarchyGravityApi.setWorldVelocity(entity, worldVelocity);
entity.setOnGround(false);
entity.resetFallDistance();
}
@Override
public void antarchy$applySyncedGravityState(
AntarchyGravityDirection direction,
@@ -154,9 +154,11 @@ public abstract class EntityMoveMixin {
boolean movedY = movement.y != collided.y;
boolean movedZ = movement.z != collided.z;
boolean pressingIntoCeiling = movedY && movement.y > 0.0D;
boolean supportedByCeiling = entity.onGround()
|| !entity.level().noCollision(entity, aabb.move(0.0D, 1.0E-5D, 0.0D));
float maxUpStep = entity.maxUpStep();
if (!(maxUpStep > 0.0F) || !(pressingIntoCeiling || entity.onGround()) || !(movedX || movedZ)) {
if (!(maxUpStep > 0.0F) || !(pressingIntoCeiling || supportedByCeiling) || !(movedX || movedZ)) {
cir.setReturnValue(PortalGunCollisionHelper.resolveCollision(entity, aabb, movement, collided));
return;
}
@@ -181,6 +183,46 @@ public abstract class EntityMoveMixin {
}
}
// Exact candidate heights can still fail for composite ceiling shapes
// (notably corner stairs). Mirror the older three-phase step routine:
// move away from the ceiling, cross the obstruction, then settle back
// toward the new ceiling surface.
Vec3 awayFromCeiling = Entity.collideBoundingBox(
entity,
new Vec3(0.0D, -(double) maxUpStep, 0.0D),
steppedBox,
entity.level(),
stepShapes
);
if (awayFromCeiling.y < -1.0E-7D) {
AABB awayBox = steppedBox.move(awayFromCeiling);
Vec3 acrossStep = Entity.collideBoundingBox(
entity,
new Vec3(movement.x, 0.0D, movement.z),
awayBox,
entity.level(),
stepShapes
);
if (acrossStep.horizontalDistanceSqr() > collided.horizontalDistanceSqr()) {
AABB acrossBox = awayBox.move(acrossStep);
Vec3 settleToCeiling = Entity.collideBoundingBox(
entity,
new Vec3(0.0D, -awayFromCeiling.y, 0.0D),
acrossBox,
entity.level(),
stepShapes
);
double initialVerticalOffset = steppedBox.maxY - aabb.maxY;
Vec3 stepped = acrossStep.add(
0.0D,
initialVerticalOffset + awayFromCeiling.y + settleToCeiling.y,
0.0D
);
cir.setReturnValue(PortalGunCollisionHelper.resolveCollision(entity, aabb, movement, stepped));
return;
}
}
cir.setReturnValue(PortalGunCollisionHelper.resolveCollision(entity, aabb, movement, collided));
}
@@ -1,20 +1,36 @@
package com.craisinlord.antarchy.mixins.gravity;
import com.craisinlord.antarchy.content.gravity.AntarchyGravityApi;
import com.craisinlord.antarchy.content.gravity.AntarchyGravityDirection;
import com.craisinlord.antarchy.content.gravity.AntarchyGravityRotationUtil;
import com.craisinlord.antarchy.config.AntarchySettings;
import com.craisinlord.antarchy.content.worldgen.thoraxis.ThoraxisUndersideManager;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.projectile.Projectile;
import net.minecraft.world.phys.Vec2;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyVariable;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(Projectile.class)
/*
* Flips generic projectile gravity for inverted shooters.
* Gives every projectile a gravity frame based on its own position in Thoraxis.
* A shooter can influence the initial aim, but cannot leave a projectile inverted
* after it exits the Underside.
*/
public abstract class ProjectileGravityMixin {
@Inject(method = "shootFromRotation", at = @At("HEAD"))
private void antarchy$prepareGravityAwareShot(
Entity shooter,
float xRot,
float yRot,
float rotationOffset,
float velocity,
float inaccuracy,
CallbackInfo ci
) {
ThoraxisUndersideManager.updateProjectileGravity((Projectile) (Object) this);
}
@Inject(method = "tick", at = @At("HEAD"))
private void antarchy$updateUndersideGravity(CallbackInfo ci) {
ThoraxisUndersideManager.updateProjectileGravity((Projectile) (Object) this);
}
}
@@ -35,7 +35,9 @@ public abstract class ThrowableProjectileGravityMixin {
original.call(self);
return;
}
// Vanilla applies gravity as -getGravity(). Negate that acceleration to
// mirror the projectile's arc for the inverted Underside gravity.
double gravity = self.getGravity();
self.setDeltaMovement(self.getDeltaMovement().add(0.0D, gravity, 0.0D));
self.setDeltaMovement(self.getDeltaMovement().add(0.0D, -gravity, 0.0D));
}
}
@@ -28,8 +28,10 @@ public abstract class EntityTimeDilationStateMixin implements TimeDilationEntity
@Override
public void antarchy$setTimeDilationRate(double rate) {
double previousRate = this.antarchy$timeDilationRate;
this.antarchy$timeDilationRate = TimeDilationMath.clampRate(rate);
if (this.antarchy$timeDilationRate >= TimeDilationMath.NORMAL_RATE) {
if (previousRate != TimeDilationMath.NORMAL_RATE
&& this.antarchy$timeDilationRate == TimeDilationMath.NORMAL_RATE) {
this.antarchy$timeDilationTimerProgress.clear();
}
}
@@ -46,20 +48,25 @@ public abstract class EntityTimeDilationStateMixin implements TimeDilationEntity
@Override
public boolean antarchy$consumeTimeDilationTick(String timerKey, double rate) {
return this.antarchy$consumeTimeDilationTicks(timerKey, rate) > 0;
}
@Override
public int antarchy$consumeTimeDilationTicks(String timerKey, double rate) {
double clampedRate = TimeDilationMath.clampRate(rate);
if (Math.abs(clampedRate - TimeDilationMath.NORMAL_RATE) < 0.001D) {
return true;
return 1;
}
double progress = this.antarchy$timeDilationTimerProgress.getOrDefault(timerKey, 0.0D) + clampedRate;
int wholeTicks = (int) Math.floor(progress + 1.0E-9D);
if (wholeTicks <= 0) {
this.antarchy$timeDilationTimerProgress.put(timerKey, progress);
return false;
return 0;
}
this.antarchy$timeDilationTimerProgress.put(timerKey, progress - wholeTicks);
return true;
return wholeTicks;
}
@Override
@@ -0,0 +1,21 @@
package com.craisinlord.antarchy.mixins.time;
import com.craisinlord.antarchy.content.time.ChronosphereManager;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.item.ItemStack;
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(LivingEntity.class)
public abstract class LivingEntityChronosphereEquipmentMixin {
@Inject(method = "onEquipItem", at = @At("TAIL"))
private void antarchy$refreshChronosphere(EquipmentSlot slot, ItemStack oldStack, ItemStack newStack, CallbackInfo callback) {
if (slot == EquipmentSlot.CHEST && (Object) this instanceof ServerPlayer player) {
ChronosphereManager.refresh(player);
}
}
}
@@ -0,0 +1,30 @@
package com.craisinlord.antarchy.mixins.time;
import com.craisinlord.antarchy.content.time.TimeDilationApi;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.core.component.DataComponents;
import net.minecraft.world.item.ItemStack;
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.Redirect;
@Mixin(LivingEntity.class)
public abstract class LivingEntityFoodUseTimeDilationMixin {
@Shadow
protected abstract void updatingUsingItem();
@Redirect(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/LivingEntity;updatingUsingItem()V"))
private void antarchy$advanceFoodUse(LivingEntity entity) {
ItemStack stack = entity.getUseItem();
if (stack.isEmpty() || stack.get(DataComponents.FOOD) == null) {
this.updatingUsingItem();
return;
}
int ticks = TimeDilationApi.consumeTicks(entity, "living_food_use");
for (int i = 0; i < ticks && entity.isUsingItem(); i++) {
this.updatingUsingItem();
}
}
}
@@ -0,0 +1,20 @@
package com.craisinlord.antarchy.mixins.time;
import com.craisinlord.antarchy.content.time.TimeDilationApi;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemCooldowns;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(Player.class)
public abstract class PlayerCooldownTimeDilationMixin {
@Redirect(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/item/ItemCooldowns;tick()V"))
private void antarchy$advanceCooldowns(ItemCooldowns cooldowns) {
Player player = (Player) (Object) this;
int ticks = TimeDilationApi.consumeTicks(player, "player_item_cooldowns");
for (int i = 0; i < ticks; i++) {
cooldowns.tick();
}
}
}
@@ -96,6 +96,9 @@
"time.LivingEntityTimeDilationMixin",
"time.LivingEntityTimeDilationCleanupMixin",
"time.LivingEntityAttackCooldownTimeDilationMixin",
"time.PlayerCooldownTimeDilationMixin",
"time.LivingEntityFoodUseTimeDilationMixin",
"time.LivingEntityChronosphereEquipmentMixin",
"time.LookControlTimeDilationMixin",
"time.MeleeAttackGoalTimeDilationMixin",
"time.MobAttackTimeDilationMixin",
@@ -0,0 +1,76 @@
{
"variants": {
"eggs=1,hatch=0": [
{ "model": "antarchy:block/crawling_blight_egg_1" },
{ "model": "antarchy:block/crawling_blight_egg_1", "y": 90 },
{ "model": "antarchy:block/crawling_blight_egg_1", "y": 180 },
{ "model": "antarchy:block/crawling_blight_egg_1", "y": 270 }
],
"eggs=1,hatch=1": [
{ "model": "antarchy:block/slightly_cracked_crawling_blight_egg_1" },
{ "model": "antarchy:block/slightly_cracked_crawling_blight_egg_1", "y": 90 },
{ "model": "antarchy:block/slightly_cracked_crawling_blight_egg_1", "y": 180 },
{ "model": "antarchy:block/slightly_cracked_crawling_blight_egg_1", "y": 270 }
],
"eggs=1,hatch=2": [
{ "model": "antarchy:block/very_cracked_crawling_blight_egg_1" },
{ "model": "antarchy:block/very_cracked_crawling_blight_egg_1", "y": 90 },
{ "model": "antarchy:block/very_cracked_crawling_blight_egg_1", "y": 180 },
{ "model": "antarchy:block/very_cracked_crawling_blight_egg_1", "y": 270 }
],
"eggs=2,hatch=0": [
{ "model": "antarchy:block/crawling_blight_egg_2" },
{ "model": "antarchy:block/crawling_blight_egg_2", "y": 90 },
{ "model": "antarchy:block/crawling_blight_egg_2", "y": 180 },
{ "model": "antarchy:block/crawling_blight_egg_2", "y": 270 }
],
"eggs=2,hatch=1": [
{ "model": "antarchy:block/slightly_cracked_crawling_blight_egg_2" },
{ "model": "antarchy:block/slightly_cracked_crawling_blight_egg_2", "y": 90 },
{ "model": "antarchy:block/slightly_cracked_crawling_blight_egg_2", "y": 180 },
{ "model": "antarchy:block/slightly_cracked_crawling_blight_egg_2", "y": 270 }
],
"eggs=2,hatch=2": [
{ "model": "antarchy:block/very_cracked_crawling_blight_egg_2" },
{ "model": "antarchy:block/very_cracked_crawling_blight_egg_2", "y": 90 },
{ "model": "antarchy:block/very_cracked_crawling_blight_egg_2", "y": 180 },
{ "model": "antarchy:block/very_cracked_crawling_blight_egg_2", "y": 270 }
],
"eggs=3,hatch=0": [
{ "model": "antarchy:block/crawling_blight_egg_3" },
{ "model": "antarchy:block/crawling_blight_egg_3", "y": 90 },
{ "model": "antarchy:block/crawling_blight_egg_3", "y": 180 },
{ "model": "antarchy:block/crawling_blight_egg_3", "y": 270 }
],
"eggs=3,hatch=1": [
{ "model": "antarchy:block/slightly_cracked_crawling_blight_egg_3" },
{ "model": "antarchy:block/slightly_cracked_crawling_blight_egg_3", "y": 90 },
{ "model": "antarchy:block/slightly_cracked_crawling_blight_egg_3", "y": 180 },
{ "model": "antarchy:block/slightly_cracked_crawling_blight_egg_3", "y": 270 }
],
"eggs=3,hatch=2": [
{ "model": "antarchy:block/very_cracked_crawling_blight_egg_3" },
{ "model": "antarchy:block/very_cracked_crawling_blight_egg_3", "y": 90 },
{ "model": "antarchy:block/very_cracked_crawling_blight_egg_3", "y": 180 },
{ "model": "antarchy:block/very_cracked_crawling_blight_egg_3", "y": 270 }
],
"eggs=4,hatch=0": [
{ "model": "antarchy:block/crawling_blight_egg_4" },
{ "model": "antarchy:block/crawling_blight_egg_4", "y": 90 },
{ "model": "antarchy:block/crawling_blight_egg_4", "y": 180 },
{ "model": "antarchy:block/crawling_blight_egg_4", "y": 270 }
],
"eggs=4,hatch=1": [
{ "model": "antarchy:block/slightly_cracked_crawling_blight_egg_4" },
{ "model": "antarchy:block/slightly_cracked_crawling_blight_egg_4", "y": 90 },
{ "model": "antarchy:block/slightly_cracked_crawling_blight_egg_4", "y": 180 },
{ "model": "antarchy:block/slightly_cracked_crawling_blight_egg_4", "y": 270 }
],
"eggs=4,hatch=2": [
{ "model": "antarchy:block/very_cracked_crawling_blight_egg_4" },
{ "model": "antarchy:block/very_cracked_crawling_blight_egg_4", "y": 90 },
{ "model": "antarchy:block/very_cracked_crawling_blight_egg_4", "y": 180 },
{ "model": "antarchy:block/very_cracked_crawling_blight_egg_4", "y": 270 }
]
}
}
@@ -1,76 +0,0 @@
{
"variants": {
"eggs=1,hatch=0": [
{ "model": "antarchy:block/creeping_horror_egg_1" },
{ "model": "antarchy:block/creeping_horror_egg_1", "y": 90 },
{ "model": "antarchy:block/creeping_horror_egg_1", "y": 180 },
{ "model": "antarchy:block/creeping_horror_egg_1", "y": 270 }
],
"eggs=1,hatch=1": [
{ "model": "antarchy:block/slightly_cracked_creeping_horror_egg_1" },
{ "model": "antarchy:block/slightly_cracked_creeping_horror_egg_1", "y": 90 },
{ "model": "antarchy:block/slightly_cracked_creeping_horror_egg_1", "y": 180 },
{ "model": "antarchy:block/slightly_cracked_creeping_horror_egg_1", "y": 270 }
],
"eggs=1,hatch=2": [
{ "model": "antarchy:block/very_cracked_creeping_horror_egg_1" },
{ "model": "antarchy:block/very_cracked_creeping_horror_egg_1", "y": 90 },
{ "model": "antarchy:block/very_cracked_creeping_horror_egg_1", "y": 180 },
{ "model": "antarchy:block/very_cracked_creeping_horror_egg_1", "y": 270 }
],
"eggs=2,hatch=0": [
{ "model": "antarchy:block/creeping_horror_egg_2" },
{ "model": "antarchy:block/creeping_horror_egg_2", "y": 90 },
{ "model": "antarchy:block/creeping_horror_egg_2", "y": 180 },
{ "model": "antarchy:block/creeping_horror_egg_2", "y": 270 }
],
"eggs=2,hatch=1": [
{ "model": "antarchy:block/slightly_cracked_creeping_horror_egg_2" },
{ "model": "antarchy:block/slightly_cracked_creeping_horror_egg_2", "y": 90 },
{ "model": "antarchy:block/slightly_cracked_creeping_horror_egg_2", "y": 180 },
{ "model": "antarchy:block/slightly_cracked_creeping_horror_egg_2", "y": 270 }
],
"eggs=2,hatch=2": [
{ "model": "antarchy:block/very_cracked_creeping_horror_egg_2" },
{ "model": "antarchy:block/very_cracked_creeping_horror_egg_2", "y": 90 },
{ "model": "antarchy:block/very_cracked_creeping_horror_egg_2", "y": 180 },
{ "model": "antarchy:block/very_cracked_creeping_horror_egg_2", "y": 270 }
],
"eggs=3,hatch=0": [
{ "model": "antarchy:block/creeping_horror_egg_3" },
{ "model": "antarchy:block/creeping_horror_egg_3", "y": 90 },
{ "model": "antarchy:block/creeping_horror_egg_3", "y": 180 },
{ "model": "antarchy:block/creeping_horror_egg_3", "y": 270 }
],
"eggs=3,hatch=1": [
{ "model": "antarchy:block/slightly_cracked_creeping_horror_egg_3" },
{ "model": "antarchy:block/slightly_cracked_creeping_horror_egg_3", "y": 90 },
{ "model": "antarchy:block/slightly_cracked_creeping_horror_egg_3", "y": 180 },
{ "model": "antarchy:block/slightly_cracked_creeping_horror_egg_3", "y": 270 }
],
"eggs=3,hatch=2": [
{ "model": "antarchy:block/very_cracked_creeping_horror_egg_3" },
{ "model": "antarchy:block/very_cracked_creeping_horror_egg_3", "y": 90 },
{ "model": "antarchy:block/very_cracked_creeping_horror_egg_3", "y": 180 },
{ "model": "antarchy:block/very_cracked_creeping_horror_egg_3", "y": 270 }
],
"eggs=4,hatch=0": [
{ "model": "antarchy:block/creeping_horror_egg_4" },
{ "model": "antarchy:block/creeping_horror_egg_4", "y": 90 },
{ "model": "antarchy:block/creeping_horror_egg_4", "y": 180 },
{ "model": "antarchy:block/creeping_horror_egg_4", "y": 270 }
],
"eggs=4,hatch=1": [
{ "model": "antarchy:block/slightly_cracked_creeping_horror_egg_4" },
{ "model": "antarchy:block/slightly_cracked_creeping_horror_egg_4", "y": 90 },
{ "model": "antarchy:block/slightly_cracked_creeping_horror_egg_4", "y": 180 },
{ "model": "antarchy:block/slightly_cracked_creeping_horror_egg_4", "y": 270 }
],
"eggs=4,hatch=2": [
{ "model": "antarchy:block/very_cracked_creeping_horror_egg_4" },
{ "model": "antarchy:block/very_cracked_creeping_horror_egg_4", "y": 90 },
{ "model": "antarchy:block/very_cracked_creeping_horror_egg_4", "y": 180 },
{ "model": "antarchy:block/very_cracked_creeping_horror_egg_4", "y": 270 }
]
}
}
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "antarchy:block/flytrap_goo_block"
}
}
}
@@ -1,76 +0,0 @@
{
"variants": {
"eggs=1,hatch=0": [
{ "model": "antarchy:block/lurking_terror_egg_1" },
{ "model": "antarchy:block/lurking_terror_egg_1", "y": 90 },
{ "model": "antarchy:block/lurking_terror_egg_1", "y": 180 },
{ "model": "antarchy:block/lurking_terror_egg_1", "y": 270 }
],
"eggs=1,hatch=1": [
{ "model": "antarchy:block/slightly_cracked_lurking_terror_egg_1" },
{ "model": "antarchy:block/slightly_cracked_lurking_terror_egg_1", "y": 90 },
{ "model": "antarchy:block/slightly_cracked_lurking_terror_egg_1", "y": 180 },
{ "model": "antarchy:block/slightly_cracked_lurking_terror_egg_1", "y": 270 }
],
"eggs=1,hatch=2": [
{ "model": "antarchy:block/very_cracked_lurking_terror_egg_1" },
{ "model": "antarchy:block/very_cracked_lurking_terror_egg_1", "y": 90 },
{ "model": "antarchy:block/very_cracked_lurking_terror_egg_1", "y": 180 },
{ "model": "antarchy:block/very_cracked_lurking_terror_egg_1", "y": 270 }
],
"eggs=2,hatch=0": [
{ "model": "antarchy:block/lurking_terror_egg_2" },
{ "model": "antarchy:block/lurking_terror_egg_2", "y": 90 },
{ "model": "antarchy:block/lurking_terror_egg_2", "y": 180 },
{ "model": "antarchy:block/lurking_terror_egg_2", "y": 270 }
],
"eggs=2,hatch=1": [
{ "model": "antarchy:block/slightly_cracked_lurking_terror_egg_2" },
{ "model": "antarchy:block/slightly_cracked_lurking_terror_egg_2", "y": 90 },
{ "model": "antarchy:block/slightly_cracked_lurking_terror_egg_2", "y": 180 },
{ "model": "antarchy:block/slightly_cracked_lurking_terror_egg_2", "y": 270 }
],
"eggs=2,hatch=2": [
{ "model": "antarchy:block/very_cracked_lurking_terror_egg_2" },
{ "model": "antarchy:block/very_cracked_lurking_terror_egg_2", "y": 90 },
{ "model": "antarchy:block/very_cracked_lurking_terror_egg_2", "y": 180 },
{ "model": "antarchy:block/very_cracked_lurking_terror_egg_2", "y": 270 }
],
"eggs=3,hatch=0": [
{ "model": "antarchy:block/lurking_terror_egg_3" },
{ "model": "antarchy:block/lurking_terror_egg_3", "y": 90 },
{ "model": "antarchy:block/lurking_terror_egg_3", "y": 180 },
{ "model": "antarchy:block/lurking_terror_egg_3", "y": 270 }
],
"eggs=3,hatch=1": [
{ "model": "antarchy:block/slightly_cracked_lurking_terror_egg_3" },
{ "model": "antarchy:block/slightly_cracked_lurking_terror_egg_3", "y": 90 },
{ "model": "antarchy:block/slightly_cracked_lurking_terror_egg_3", "y": 180 },
{ "model": "antarchy:block/slightly_cracked_lurking_terror_egg_3", "y": 270 }
],
"eggs=3,hatch=2": [
{ "model": "antarchy:block/very_cracked_lurking_terror_egg_3" },
{ "model": "antarchy:block/very_cracked_lurking_terror_egg_3", "y": 90 },
{ "model": "antarchy:block/very_cracked_lurking_terror_egg_3", "y": 180 },
{ "model": "antarchy:block/very_cracked_lurking_terror_egg_3", "y": 270 }
],
"eggs=4,hatch=0": [
{ "model": "antarchy:block/lurking_terror_egg_4" },
{ "model": "antarchy:block/lurking_terror_egg_4", "y": 90 },
{ "model": "antarchy:block/lurking_terror_egg_4", "y": 180 },
{ "model": "antarchy:block/lurking_terror_egg_4", "y": 270 }
],
"eggs=4,hatch=1": [
{ "model": "antarchy:block/slightly_cracked_lurking_terror_egg_4" },
{ "model": "antarchy:block/slightly_cracked_lurking_terror_egg_4", "y": 90 },
{ "model": "antarchy:block/slightly_cracked_lurking_terror_egg_4", "y": 180 },
{ "model": "antarchy:block/slightly_cracked_lurking_terror_egg_4", "y": 270 }
],
"eggs=4,hatch=2": [
{ "model": "antarchy:block/very_cracked_lurking_terror_egg_4" },
{ "model": "antarchy:block/very_cracked_lurking_terror_egg_4", "y": 90 },
{ "model": "antarchy:block/very_cracked_lurking_terror_egg_4", "y": 180 },
{ "model": "antarchy:block/very_cracked_lurking_terror_egg_4", "y": 270 }
]
}
}
@@ -0,0 +1,76 @@
{
"variants": {
"eggs=1,hatch=0": [
{ "model": "antarchy:block/skulking_fright_egg_1" },
{ "model": "antarchy:block/skulking_fright_egg_1", "y": 90 },
{ "model": "antarchy:block/skulking_fright_egg_1", "y": 180 },
{ "model": "antarchy:block/skulking_fright_egg_1", "y": 270 }
],
"eggs=1,hatch=1": [
{ "model": "antarchy:block/slightly_cracked_skulking_fright_egg_1" },
{ "model": "antarchy:block/slightly_cracked_skulking_fright_egg_1", "y": 90 },
{ "model": "antarchy:block/slightly_cracked_skulking_fright_egg_1", "y": 180 },
{ "model": "antarchy:block/slightly_cracked_skulking_fright_egg_1", "y": 270 }
],
"eggs=1,hatch=2": [
{ "model": "antarchy:block/very_cracked_skulking_fright_egg_1" },
{ "model": "antarchy:block/very_cracked_skulking_fright_egg_1", "y": 90 },
{ "model": "antarchy:block/very_cracked_skulking_fright_egg_1", "y": 180 },
{ "model": "antarchy:block/very_cracked_skulking_fright_egg_1", "y": 270 }
],
"eggs=2,hatch=0": [
{ "model": "antarchy:block/skulking_fright_egg_2" },
{ "model": "antarchy:block/skulking_fright_egg_2", "y": 90 },
{ "model": "antarchy:block/skulking_fright_egg_2", "y": 180 },
{ "model": "antarchy:block/skulking_fright_egg_2", "y": 270 }
],
"eggs=2,hatch=1": [
{ "model": "antarchy:block/slightly_cracked_skulking_fright_egg_2" },
{ "model": "antarchy:block/slightly_cracked_skulking_fright_egg_2", "y": 90 },
{ "model": "antarchy:block/slightly_cracked_skulking_fright_egg_2", "y": 180 },
{ "model": "antarchy:block/slightly_cracked_skulking_fright_egg_2", "y": 270 }
],
"eggs=2,hatch=2": [
{ "model": "antarchy:block/very_cracked_skulking_fright_egg_2" },
{ "model": "antarchy:block/very_cracked_skulking_fright_egg_2", "y": 90 },
{ "model": "antarchy:block/very_cracked_skulking_fright_egg_2", "y": 180 },
{ "model": "antarchy:block/very_cracked_skulking_fright_egg_2", "y": 270 }
],
"eggs=3,hatch=0": [
{ "model": "antarchy:block/skulking_fright_egg_3" },
{ "model": "antarchy:block/skulking_fright_egg_3", "y": 90 },
{ "model": "antarchy:block/skulking_fright_egg_3", "y": 180 },
{ "model": "antarchy:block/skulking_fright_egg_3", "y": 270 }
],
"eggs=3,hatch=1": [
{ "model": "antarchy:block/slightly_cracked_skulking_fright_egg_3" },
{ "model": "antarchy:block/slightly_cracked_skulking_fright_egg_3", "y": 90 },
{ "model": "antarchy:block/slightly_cracked_skulking_fright_egg_3", "y": 180 },
{ "model": "antarchy:block/slightly_cracked_skulking_fright_egg_3", "y": 270 }
],
"eggs=3,hatch=2": [
{ "model": "antarchy:block/very_cracked_skulking_fright_egg_3" },
{ "model": "antarchy:block/very_cracked_skulking_fright_egg_3", "y": 90 },
{ "model": "antarchy:block/very_cracked_skulking_fright_egg_3", "y": 180 },
{ "model": "antarchy:block/very_cracked_skulking_fright_egg_3", "y": 270 }
],
"eggs=4,hatch=0": [
{ "model": "antarchy:block/skulking_fright_egg_4" },
{ "model": "antarchy:block/skulking_fright_egg_4", "y": 90 },
{ "model": "antarchy:block/skulking_fright_egg_4", "y": 180 },
{ "model": "antarchy:block/skulking_fright_egg_4", "y": 270 }
],
"eggs=4,hatch=1": [
{ "model": "antarchy:block/slightly_cracked_skulking_fright_egg_4" },
{ "model": "antarchy:block/slightly_cracked_skulking_fright_egg_4", "y": 90 },
{ "model": "antarchy:block/slightly_cracked_skulking_fright_egg_4", "y": 180 },
{ "model": "antarchy:block/slightly_cracked_skulking_fright_egg_4", "y": 270 }
],
"eggs=4,hatch=2": [
{ "model": "antarchy:block/very_cracked_skulking_fright_egg_4" },
{ "model": "antarchy:block/very_cracked_skulking_fright_egg_4", "y": 90 },
{ "model": "antarchy:block/very_cracked_skulking_fright_egg_4", "y": 180 },
{ "model": "antarchy:block/very_cracked_skulking_fright_egg_4", "y": 270 }
]
}
}
@@ -1,18 +1,18 @@
{
"variants": {
"hanging=false,rotated=false": {
"model": "antarchy:block/jumpy_bug_egg"
"model": "antarchy:block/springbug_egg"
},
"hanging=false,rotated=true": {
"model": "antarchy:block/jumpy_bug_egg",
"model": "antarchy:block/springbug_egg",
"y": 90
},
"hanging=true,rotated=false": {
"model": "antarchy:block/jumpy_bug_egg",
"model": "antarchy:block/springbug_egg",
"x": 180
},
"hanging=true,rotated=true": {
"model": "antarchy:block/jumpy_bug_egg",
"model": "antarchy:block/springbug_egg",
"x": 180,
"y": 90
}
@@ -1,7 +0,0 @@
{
"variants": {
"": {
"model": "antarchy:block/triffid_goo_block"
}
}
}
@@ -0,0 +1,10 @@
{
"variants": {
"trial_spawner_state=inactive": {"model": "antarchy:block/undertrial_spawner_inactive", "x": 90},
"trial_spawner_state=waiting_for_players": {"model": "antarchy:block/undertrial_spawner_inactive", "x": 90},
"trial_spawner_state=active": {"model": "antarchy:block/undertrial_spawner_active", "x": 90},
"trial_spawner_state=waiting_for_reward_ejection": {"model": "antarchy:block/undertrial_spawner_active", "x": 90},
"trial_spawner_state=ejecting_reward": {"model": "antarchy:block/undertrial_spawner_ejecting_reward", "x": 90},
"trial_spawner_state=cooldown": {"model": "antarchy:block/undertrial_spawner_inactive", "x": 90}
}
}
@@ -0,0 +1,28 @@
{
"variants": {
"vault_state=inactive,under_facing=north": {"model": "antarchy:block/undervault_off"},
"vault_state=inactive,under_facing=south": {"model": "antarchy:block/undervault_off", "y": 180},
"vault_state=inactive,under_facing=east": {"model": "antarchy:block/undervault_off", "y": 90},
"vault_state=inactive,under_facing=west": {"model": "antarchy:block/undervault_off", "y": 270},
"vault_state=inactive,under_facing=up": {"model": "antarchy:block/undervault_off", "x": 270},
"vault_state=inactive,under_facing=down": {"model": "antarchy:block/undervault_off", "x": 90},
"vault_state=active,under_facing=north": {"model": "antarchy:block/undervault_on"},
"vault_state=active,under_facing=south": {"model": "antarchy:block/undervault_on", "y": 180},
"vault_state=active,under_facing=east": {"model": "antarchy:block/undervault_on", "y": 90},
"vault_state=active,under_facing=west": {"model": "antarchy:block/undervault_on", "y": 270},
"vault_state=active,under_facing=up": {"model": "antarchy:block/undervault_on", "x": 270},
"vault_state=active,under_facing=down": {"model": "antarchy:block/undervault_on", "x": 90},
"vault_state=unlocking,under_facing=north": {"model": "antarchy:block/undervault_on"},
"vault_state=unlocking,under_facing=south": {"model": "antarchy:block/undervault_on", "y": 180},
"vault_state=unlocking,under_facing=east": {"model": "antarchy:block/undervault_on", "y": 90},
"vault_state=unlocking,under_facing=west": {"model": "antarchy:block/undervault_on", "y": 270},
"vault_state=unlocking,under_facing=up": {"model": "antarchy:block/undervault_on", "x": 270},
"vault_state=unlocking,under_facing=down": {"model": "antarchy:block/undervault_on", "x": 90},
"vault_state=ejecting,under_facing=north": {"model": "antarchy:block/undervault_ejecting"},
"vault_state=ejecting,under_facing=south": {"model": "antarchy:block/undervault_ejecting", "y": 180},
"vault_state=ejecting,under_facing=east": {"model": "antarchy:block/undervault_ejecting", "y": 90},
"vault_state=ejecting,under_facing=west": {"model": "antarchy:block/undervault_ejecting", "y": 270},
"vault_state=ejecting,under_facing=up": {"model": "antarchy:block/undervault_ejecting", "x": 270},
"vault_state=ejecting,under_facing=down": {"model": "antarchy:block/undervault_ejecting", "x": 90}
}
}
@@ -3,7 +3,7 @@
"minecraft:geometry": [
{
"description": {
"identifier": "geometry.creepinghorror",
"identifier": "geometry.crawlingblight",
"texture_width": 256,
"texture_height": 256,
"visible_bounds_width": 9,
@@ -3,7 +3,7 @@
"minecraft:geometry": [
{
"description": {
"identifier": "geometry.triffid",
"identifier": "geometry.flytrap",
"texture_width": 256,
"texture_height": 256,
"visible_bounds_width": 8,
@@ -3,7 +3,7 @@
"minecraft:geometry": [
{
"description": {
"identifier": "geometry.lurkingterror",
"identifier": "geometry.skulkingfright",
"texture_width": 128,
"texture_height": 128,
"visible_bounds_width": 8,
Loaded 100 of 379 files, more files were not shown because too many files have changed in this diff. Show more