diff --git a/Xplat/src/main/java/vazkii/botania/api/configdata/LooniumStructureConfiguration.java b/Xplat/src/main/java/vazkii/botania/api/configdata/LooniumStructureConfiguration.java index 6336fbbe6c..8a270a2adb 100644 --- a/Xplat/src/main/java/vazkii/botania/api/configdata/LooniumStructureConfiguration.java +++ b/Xplat/src/main/java/vazkii/botania/api/configdata/LooniumStructureConfiguration.java @@ -11,6 +11,7 @@ import net.minecraft.world.level.levelgen.structure.StructureSpawnOverride; import vazkii.botania.api.BotaniaAPI; +import vazkii.botania.common.block.flower.functional.LooniumBlockEntity; import java.util.List; import java.util.Optional; @@ -46,6 +47,10 @@ public class LooniumStructureConfiguration { if (lsc.spawnedMobs != null && lsc.spawnedMobs.isEmpty()) { return DataResult.error(() -> "Spawned mobs cannot be empty"); } + if (lsc.manaCost > LooniumBlockEntity.DEFAULT_COST) { + return DataResult.error(() -> "Mana costs above %d are currently not supported" + .formatted(LooniumBlockEntity.DEFAULT_COST)); + } return DataResult.success(lsc); }); public static final ResourceLocation DEFAULT_CONFIG_ID = new ResourceLocation(BotaniaAPI.MODID, "default"); diff --git a/Xplat/src/main/java/vazkii/botania/common/block/flower/functional/LooniumBlockEntity.java b/Xplat/src/main/java/vazkii/botania/common/block/flower/functional/LooniumBlockEntity.java index eedff3cc4d..2be8058b53 100644 --- a/Xplat/src/main/java/vazkii/botania/common/block/flower/functional/LooniumBlockEntity.java +++ b/Xplat/src/main/java/vazkii/botania/common/block/flower/functional/LooniumBlockEntity.java @@ -274,7 +274,7 @@ private void spawnMob(ServerLevel world, LooniumMobSpawnData pickedMobType, world.levelEvent(LevelEvent.PARTICLES_MOBBLOCK_SPAWN, getBlockPos(), 0); world.gameEvent(mob, GameEvent.ENTITY_PLACE, mob.position()); - addMana(-DEFAULT_COST); + addMana(-pickedConfig.manaCost); sync(); }