diff --git a/Xplat/src/main/java/vazkii/botania/api/BotaniaAPI.java b/Xplat/src/main/java/vazkii/botania/api/BotaniaAPI.java index 3584f24a10..f0a45d664f 100644 --- a/Xplat/src/main/java/vazkii/botania/api/BotaniaAPI.java +++ b/Xplat/src/main/java/vazkii/botania/api/BotaniaAPI.java @@ -213,7 +213,9 @@ default boolean hasSolegnoliaAround(Entity e) { default void sparkleFX(Level world, double x, double y, double z, float r, float g, float b, float size, int m) {} - default void registerCorporeaNodeDetector(CorporeaNodeDetector detector) { + default void registerCorporeaNodeDetector(CorporeaNodeDetector detector) {} + default boolean isInGaiaArena(Level level, double x, double y, double z) { + return false; } } diff --git a/Xplat/src/main/java/vazkii/botania/common/entity/GaiaGuardianEntity.java b/Xplat/src/main/java/vazkii/botania/common/entity/GaiaGuardianEntity.java index 2377bd48a9..97c92f88da 100644 --- a/Xplat/src/main/java/vazkii/botania/common/entity/GaiaGuardianEntity.java +++ b/Xplat/src/main/java/vazkii/botania/common/entity/GaiaGuardianEntity.java @@ -567,7 +567,7 @@ private static int countGaiaGuardiansAround(Level world, BlockPos source) { } @NotNull - private static AABB getArenaBB(@NotNull BlockPos source) { + public static AABB getArenaBB(@NotNull BlockPos source) { double range = 15.0; return new AABB(source.getX() + 0.5 - range, source.getY() + 0.5 - range, source.getZ() + 0.5 - range, source.getX() + 0.5 + range, source.getY() + 0.5 + range, source.getZ() + 0.5 + range); } diff --git a/Xplat/src/main/java/vazkii/botania/common/impl/BotaniaAPIImpl.java b/Xplat/src/main/java/vazkii/botania/common/impl/BotaniaAPIImpl.java index 2bc72c603b..c5c5e4655c 100644 --- a/Xplat/src/main/java/vazkii/botania/common/impl/BotaniaAPIImpl.java +++ b/Xplat/src/main/java/vazkii/botania/common/impl/BotaniaAPIImpl.java @@ -22,6 +22,8 @@ import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; +import net.minecraft.world.phys.AABB; +import net.minecraft.world.phys.Vec3; import org.jetbrains.annotations.NotNull; @@ -31,6 +33,8 @@ import vazkii.botania.api.internal.ManaNetwork; import vazkii.botania.client.fx.SparkleParticleData; import vazkii.botania.common.block.flower.functional.SolegnoliaBlockEntity; +import vazkii.botania.common.brew.BotaniaBrews; +import vazkii.botania.common.entity.GaiaGuardianEntity; import vazkii.botania.common.handler.BotaniaSounds; import vazkii.botania.common.handler.EquipmentHandler; import vazkii.botania.common.handler.ManaNetworkHandler; @@ -173,7 +177,7 @@ public Ingredient getRepairIngredient() { @Override public int apiVersion() { - return 2; + return 3; } @Override @@ -263,4 +267,15 @@ public void registerPaintableBlock(ResourceLocation block, Function guardianEntities = level.getEntitiesOfClass(GaiaGuardianEntity.class, AABB.ofSize(new Vec3(x, y, z), GaiaGuardianEntity.ARENA_RANGE * 4, GaiaGuardianEntity.ARENA_RANGE * 4, GaiaGuardianEntity.ARENA_RANGE * 4)); + for (GaiaGuardianEntity guardianEntity : guardianEntities) { + if (GaiaGuardianEntity.getArenaBB(guardianEntity.getSource()).contains(x, y, z)) { + return true; + } + } + return false; + } }