Phase 3: the Mangrove Mire poisons anyone without Mire Waders
CI / build-and-smoke-test (push) Failing after 30m44s

- Companion mod zone hazards (zone/ZoneHazards.kt, data in
  data/cobblesurvival/zone_hazards/): in the Mire a player without an
  item from #cobblesurvival:mire_protection gets Poison every 5 seconds,
  with a one-time warning. Potions, milk and golden apples still help.
- Mire Waders: KubeJS leather boots, dropped by the Westmarch and Verdant
  Jungle guardians (the zones before the Mire), per Adrian's boss rule.
- Self-test mire_poisons_without_waders.
- Allow-list Cobblemon's misspelt jigsaw state in
  habitats/parched_peat_bog7.nbt, which test players now reach.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
claudeandClaude Opus 5.5 committed 2026-10-30 01:46:16 +01:00
1 parent 73fe71918f
commit d105f6757d
19 files changed
+197 -15

No files matched your search

@@ -3,20 +3,22 @@ package dev.cobblesurvival.selftest
import dev.cobblesurvival.CobbleSurvival
import dev.cobblesurvival.zone.ZoneSample
import dev.cobblesurvival.zone.Zones
import net.minecraft.gametest.framework.GameTestAssertException
import net.minecraft.core.registries.BuiltInRegistries
import net.minecraft.gametest.framework.GameTestAssertException
import net.minecraft.resources.ResourceLocation
import net.minecraft.server.level.ServerPlayer
import net.minecraft.world.effect.MobEffects
import net.minecraft.world.entity.EquipmentSlot
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.Items
import net.minecraft.world.level.levelgen.Heightmap
/**
* Roadmap Phase 3, hazards as gates, on the island itself (real biomes, real altitude): in Frostpeak and Sunscorch
* a player without the right gear freezes or overheats within a minute or two, while the fur (cold) or hide (heat)
* set holds them off for many minutes; leather armour alone doesn't help. The zones without a hazard are livable
* without gear by day and by night.
* without gear by day and by night. The Mangrove Mire poisons anyone without Mire Waders.
*
* Cold Sweat's insulation doesn't change what counts as too cold or too hot; it slows how fast the body drifts
* there. So the tests reset each player's core temperature to 0, wait, and turn the drift into minutes until the
@@ -42,6 +44,7 @@ object HazardTests {
SelfTestCase("cold_needs_fur", 600, ::cold, islandOnly = true, batch = "hazard_cold"),
SelfTestCase("heat_needs_hide", 600, ::heat, islandOnly = true, batch = "hazard_heat"),
SelfTestCase("lowlands_are_mild", 4000, ::lowlands, islandOnly = true, batch = "hazard_lowlands"),
SelfTestCase("mire_poisons_without_waders", 400, ::mire),
)
/** Frostpeak at noon, its warmest hour. */
@@ -120,6 +123,35 @@ object HazardTests {
}.thenSucceed()
}
/** The Mire's fumes (companion mod zone hazard) poison a player without Mire Waders, and nobody outside it. */
private fun mire(s: Scenario) {
val level = s.level
val mire = Zones.samples["mire"] ?: throw GameTestAssertException("no sample point for the Mire")
val elsewhere = Zones.samples["button_isle"] ?: throw GameTestAssertException("no sample point for Button Isle")
val waders = BuiltInRegistries.ITEM.get(ResourceLocation.fromNamespaceAndPath("cobblesurvival", "mire_waders"))
s.check(waders != Items.AIR) { "the Mire Waders item does not exist" }
val bare = s.player()
val wading = s.player().also { it.setItemSlot(EquipmentSlot.FEET, ItemStack(waders)) }
val outside = s.player()
fun surface(sample: ZoneSample): Double {
level.getChunk(sample.x shr 4, sample.z shr 4)
return level.getHeight(Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, sample.x, sample.z).toDouble()
}
s.helper.startSequence()
.thenExecute {
for (player in listOf(bare, wading)) s.moveTo(player, mire.x + 0.5, surface(mire), mire.z + 0.5)
s.moveTo(outside, elsewhere.x + 0.5, surface(elsewhere), elsewhere.z + 0.5)
}
.thenIdle(220)
.thenExecute {
val poison = MobEffects.POISON
s.check(bare.hasEffect(poison)) { "a player without waders in the Mire isn't poisoned" }
s.check(!wading.hasEffect(poison)) { "a player in Mire Waders got poisoned" }
s.check(!outside.hasEffect(poison)) { "a player on Button Isle got poisoned" }
}
.thenSucceed()
}
private fun dress(player: ServerPlayer, namespace: String, pieces: List<String>) {
val slots = listOf(EquipmentSlot.HEAD, EquipmentSlot.CHEST, EquipmentSlot.LEGS, EquipmentSlot.FEET)
for ((slot, piece) in slots.zip(pieces)) {