made toreterror arena more common
made vanilla squids also spawn kraken
This commit is contained in:
1 parent
84bf436434
commit
02c487f156
7 files changed
+70
-7
No files matched your search
@@ -3,6 +3,7 @@ package com.craisinlord.antarchy.content.entity;
|
|||||||
import com.craisinlord.antarchy.config.AntarchySettings;
|
import com.craisinlord.antarchy.config.AntarchySettings;
|
||||||
import com.craisinlord.antarchy.content.AntarchyObjects;
|
import com.craisinlord.antarchy.content.AntarchyObjects;
|
||||||
import com.craisinlord.antarchy.content.AntarchySoundEvents;
|
import com.craisinlord.antarchy.content.AntarchySoundEvents;
|
||||||
|
import com.craisinlord.antarchy.content.AntarchySoundEvents;
|
||||||
import com.craisinlord.antarchy.content.damage.AntarchyDamageSources;
|
import com.craisinlord.antarchy.content.damage.AntarchyDamageSources;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
@@ -132,6 +133,8 @@ public class ToreterrorEntity extends Monster implements GeoEntity {
|
|||||||
private Vec3 spinDirection = Vec3.ZERO;
|
private Vec3 spinDirection = Vec3.ZERO;
|
||||||
private int spinStrafeSign = 1;
|
private int spinStrafeSign = 1;
|
||||||
private int spinStuckTicks;
|
private int spinStuckTicks;
|
||||||
|
private Vec3 spinProgressAnchor = Vec3.ZERO;
|
||||||
|
private int spinProgressTicks;
|
||||||
private final Map<UUID, Integer> spinHitCooldowns = new HashMap<>();
|
private final Map<UUID, Integer> spinHitCooldowns = new HashMap<>();
|
||||||
|
|
||||||
public ToreterrorEntity(EntityType<? extends ToreterrorEntity> entityType, Level level) {
|
public ToreterrorEntity(EntityType<? extends ToreterrorEntity> entityType, Level level) {
|
||||||
@@ -514,6 +517,16 @@ public class ToreterrorEntity extends Monster implements GeoEntity {
|
|||||||
this.spinStuckTicks = 0;
|
this.spinStuckTicks = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.spinProgressTicks++;
|
||||||
|
if (this.spinProgressTicks >= 20) {
|
||||||
|
if (this.position().distanceToSqr(this.spinProgressAnchor) < 4.0D) {
|
||||||
|
this.beginSpinEnd();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.spinProgressAnchor = this.position();
|
||||||
|
this.spinProgressTicks = 0;
|
||||||
|
}
|
||||||
|
|
||||||
int elapsed = this.spinLoopTotalTicks - this.spinLoopTicks;
|
int elapsed = this.spinLoopTotalTicks - this.spinLoopTicks;
|
||||||
if (elapsed % SPIN_HIT_INTERVAL == 0) {
|
if (elapsed % SPIN_HIT_INTERVAL == 0) {
|
||||||
this.applySpinDamage();
|
this.applySpinDamage();
|
||||||
@@ -679,6 +692,8 @@ public class ToreterrorEntity extends Monster implements GeoEntity {
|
|||||||
this.spinDirection = Vec3.ZERO;
|
this.spinDirection = Vec3.ZERO;
|
||||||
this.spinStrafeSign = 1;
|
this.spinStrafeSign = 1;
|
||||||
this.spinStuckTicks = 0;
|
this.spinStuckTicks = 0;
|
||||||
|
this.spinProgressAnchor = Vec3.ZERO;
|
||||||
|
this.spinProgressTicks = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Vec3 calcLaunchVelocity(Vec3 from, Vec3 to, double minSpeed) {
|
private Vec3 calcLaunchVelocity(Vec3 from, Vec3 to, double minSpeed) {
|
||||||
@@ -699,6 +714,7 @@ public class ToreterrorEntity extends Monster implements GeoEntity {
|
|||||||
if (!(this.level() instanceof ServerLevel serverLevel)) return;
|
if (!(this.level() instanceof ServerLevel serverLevel)) return;
|
||||||
LivingEntity target = this.getTarget();
|
LivingEntity target = this.getTarget();
|
||||||
if (target == null) return;
|
if (target == null) return;
|
||||||
|
this.playSound(AntarchySoundEvents.SQUIDZOOKA_FIRE.get(), 0.8F, 0.9F + this.random.nextFloat() * 0.2F);
|
||||||
Vec3 from = new Vec3(this.getX(), this.getEyeY(), this.getZ());
|
Vec3 from = new Vec3(this.getX(), this.getEyeY(), this.getZ());
|
||||||
Vec3 to = new Vec3(target.getX(), target.getEyeY(), target.getZ());
|
Vec3 to = new Vec3(target.getX(), target.getEyeY(), target.getZ());
|
||||||
Vec3 baseVel = calcLaunchVelocity(from, to, 1.5);
|
Vec3 baseVel = calcLaunchVelocity(from, to, 1.5);
|
||||||
@@ -892,6 +908,8 @@ public class ToreterrorEntity extends Monster implements GeoEntity {
|
|||||||
ToreterrorEntity.this.spinLoopTicks = ToreterrorEntity.this.spinLoopTotalTicks;
|
ToreterrorEntity.this.spinLoopTicks = ToreterrorEntity.this.spinLoopTotalTicks;
|
||||||
ToreterrorEntity.this.spinEndTicks = 0;
|
ToreterrorEntity.this.spinEndTicks = 0;
|
||||||
ToreterrorEntity.this.spinStuckTicks = 0;
|
ToreterrorEntity.this.spinStuckTicks = 0;
|
||||||
|
ToreterrorEntity.this.spinProgressAnchor = ToreterrorEntity.this.position();
|
||||||
|
ToreterrorEntity.this.spinProgressTicks = 0;
|
||||||
ToreterrorEntity.this.spinStrafeSign = ToreterrorEntity.this.random.nextBoolean() ? 1 : -1;
|
ToreterrorEntity.this.spinStrafeSign = ToreterrorEntity.this.random.nextBoolean() ? 1 : -1;
|
||||||
ToreterrorEntity.this.spinHitCooldowns.clear();
|
ToreterrorEntity.this.spinHitCooldowns.clear();
|
||||||
ToreterrorEntity.this.spinDirection = target == null
|
ToreterrorEntity.this.spinDirection = target == null
|
||||||
|
|||||||
+9
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"minecraft:deep_ocean",
|
||||||
|
"minecraft:deep_cold_ocean",
|
||||||
|
"minecraft:deep_lukewarm_ocean",
|
||||||
|
"minecraft:deep_frozen_ocean"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
"type": "integrated_api:generic_structure",
|
"type": "integrated_api:generic_structure",
|
||||||
"start_pool": "antarchy:toreterror_arena/toreterror_arena",
|
"start_pool": "antarchy:toreterror_arena/toreterror_arena",
|
||||||
"size": 2,
|
"size": 2,
|
||||||
"valid_biome_radius_check": 3,
|
"valid_biome_radius_check": 2,
|
||||||
"biomes": "#antarchy:has_structure/toreterror_arena_biomes",
|
"biomes": "#antarchy:has_structure/toreterror_arena_biomes",
|
||||||
"step": "surface_structures",
|
"step": "surface_structures",
|
||||||
"terrain_adaptation": "none",
|
"terrain_adaptation": "none",
|
||||||
|
|||||||
@@ -26,6 +26,14 @@ public final class AntarchyFabric implements ModInitializer {
|
|||||||
Registries.PLACED_FEATURE,
|
Registries.PLACED_FEATURE,
|
||||||
ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "shellstone_lower")
|
ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "shellstone_lower")
|
||||||
);
|
);
|
||||||
|
private static final TagKey<net.minecraft.world.level.biome.Biome> MISSILE_SQUID_SPAWN_BIOMES = TagKey.create(
|
||||||
|
Registries.BIOME,
|
||||||
|
ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "missile_squid_spawn_biomes")
|
||||||
|
);
|
||||||
|
private static final TagKey<net.minecraft.world.level.biome.Biome> OCTOPUS_BOMB_SPAWN_BIOMES = TagKey.create(
|
||||||
|
Registries.BIOME,
|
||||||
|
ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "octopus_bomb_spawn_biomes")
|
||||||
|
);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onInitialize() {
|
public void onInitialize() {
|
||||||
@@ -55,5 +63,17 @@ public final class AntarchyFabric implements ModInitializer {
|
|||||||
GenerationStep.Decoration.UNDERGROUND_ORES,
|
GenerationStep.Decoration.UNDERGROUND_ORES,
|
||||||
SHELLSTONE_LOWER
|
SHELLSTONE_LOWER
|
||||||
);
|
);
|
||||||
|
BiomeModifications.addSpawn(
|
||||||
|
BiomeSelectors.tag(MISSILE_SQUID_SPAWN_BIOMES),
|
||||||
|
net.minecraft.world.entity.MobCategory.MONSTER,
|
||||||
|
AntarchyFabricContent.MISSILE_SQUID.get(),
|
||||||
|
2, 1, 2
|
||||||
|
);
|
||||||
|
BiomeModifications.addSpawn(
|
||||||
|
BiomeSelectors.tag(OCTOPUS_BOMB_SPAWN_BIOMES),
|
||||||
|
net.minecraft.world.entity.MobCategory.MONSTER,
|
||||||
|
AntarchyFabricContent.OCTOPUS_BOMB.get(),
|
||||||
|
2, 1, 2
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -61,10 +61,11 @@ public final class AntarchyFabricEvents {
|
|||||||
if (entity instanceof ServerPlayer sp) {
|
if (entity instanceof ServerPlayer sp) {
|
||||||
BloodglassManager.handleDeath(sp);
|
BloodglassManager.handleDeath(sp);
|
||||||
}
|
}
|
||||||
if (!(entity instanceof MissileSquidEntity missileSquid)) {
|
if (entity instanceof MissileSquidEntity missileSquid) {
|
||||||
return;
|
if (missileSquid.isSpawnedByKraken()) {
|
||||||
}
|
return;
|
||||||
if (missileSquid.isSpawnedByKraken()) {
|
}
|
||||||
|
} else if (entity.getType() != net.minecraft.world.entity.EntityType.SQUID) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!(entity.level() instanceof ServerLevel serverLevel)) {
|
if (!(entity.level() instanceof ServerLevel serverLevel)) {
|
||||||
|
|||||||
+5
-2
@@ -114,8 +114,11 @@ public final class AntarchyNeoForgeEvents {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void onMissileSquidDeath(LivingDeathEvent event) {
|
public static void onMissileSquidDeath(LivingDeathEvent event) {
|
||||||
if (!(event.getEntity() instanceof MissileSquidEntity missileSquid)) return;
|
if (event.getEntity() instanceof MissileSquidEntity missileSquid) {
|
||||||
if (missileSquid.isSpawnedByKraken()) return;
|
if (missileSquid.isSpawnedByKraken()) return;
|
||||||
|
} else if (event.getEntity().getType() != EntityType.SQUID) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!(event.getEntity().level() instanceof ServerLevel serverLevel)) return;
|
if (!(event.getEntity().level() instanceof ServerLevel serverLevel)) return;
|
||||||
|
|
||||||
BlockPos deathPos = event.getEntity().blockPosition();
|
BlockPos deathPos = event.getEntity().blockPosition();
|
||||||
|
|||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"type": "neoforge:add_spawns",
|
||||||
|
"biomes": "#antarchy:octopus_bomb_spawn_biomes",
|
||||||
|
"spawners": [
|
||||||
|
{
|
||||||
|
"type": "antarchy:octopus_bomb",
|
||||||
|
"weight": 2,
|
||||||
|
"minCount": 1,
|
||||||
|
"maxCount": 2
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in new issue
Block a user