From 8f716c98f08fe46172a2c7536299570f8d2eae0f Mon Sep 17 00:00:00 2001 From: Vincent Lee Date: Wed, 28 Nov 2018 23:57:29 -0600 Subject: [PATCH] Consistentify whether GoG behaviours are enabled by a skyblock world or the GoG jar (all gameplay now only checks for the presence of the jar). Closes #2754 --- .../vazkii/botania/common/block/decor/BlockManaFlame.java | 4 ++-- .../vazkii/botania/common/world/SkyblockWorldEvents.java | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/vazkii/botania/common/block/decor/BlockManaFlame.java b/src/main/java/vazkii/botania/common/block/decor/BlockManaFlame.java index 1fcfa0fa5..2cf5483ba 100644 --- a/src/main/java/vazkii/botania/common/block/decor/BlockManaFlame.java +++ b/src/main/java/vazkii/botania/common/block/decor/BlockManaFlame.java @@ -31,12 +31,12 @@ import net.minecraftforge.fml.common.Optional; import net.minecraftforge.items.ItemHandlerHelper; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.common.Botania; import vazkii.botania.common.block.BlockMod; import vazkii.botania.common.block.tile.TileManaFlame; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -import vazkii.botania.common.world.WorldTypeSkyblock; import javax.annotation.Nonnull; import java.util.Random; @@ -98,7 +98,7 @@ public class BlockManaFlame extends BlockMod implements ILexiconable { @Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing s, float xs, float ys, float zs) { - if(WorldTypeSkyblock.isWorldSkyblock(world)) { + if(Botania.gardenOfGlassLoaded) { ItemStack stack = player.getHeldItem(hand); if(!stack.isEmpty() && stack.getItem() == Item.getItemFromBlock(Blocks.SAPLING) && !player.inventory.hasItemStack(new ItemStack(ModItems.lexicon))) { if(!world.isRemote) { diff --git a/src/main/java/vazkii/botania/common/world/SkyblockWorldEvents.java b/src/main/java/vazkii/botania/common/world/SkyblockWorldEvents.java index a3026f33c..32c27df44 100644 --- a/src/main/java/vazkii/botania/common/world/SkyblockWorldEvents.java +++ b/src/main/java/vazkii/botania/common/world/SkyblockWorldEvents.java @@ -29,6 +29,7 @@ import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.event.world.BlockEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.items.ItemHandlerHelper; +import vazkii.botania.common.Botania; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.tile.TileManaFlame; import vazkii.botania.common.item.ModItems; @@ -71,7 +72,7 @@ public final class SkyblockWorldEvents { @SubscribeEvent public static void onPlayerInteract(PlayerInteractEvent.RightClickBlock event) { - if(WorldTypeSkyblock.isWorldSkyblock(event.getWorld())) { + if(Botania.gardenOfGlassLoaded) { ItemStack equipped = event.getItemStack(); if(equipped.isEmpty() && event.getEntityPlayer().isSneaking()) { Block block = event.getWorld().getBlockState(event.getPos()).getBlock(); @@ -112,7 +113,7 @@ public final class SkyblockWorldEvents { @SubscribeEvent public static void onDrops(BlockEvent.HarvestDropsEvent event) { - if(WorldTypeSkyblock.isWorldSkyblock(event.getWorld()) && event.getState().getBlock() == Blocks.TALLGRASS) { + if(Botania.gardenOfGlassLoaded && event.getState().getBlock() == Blocks.TALLGRASS) { ItemStack stackToRemove = ItemStack.EMPTY; for(ItemStack stack : event.getDrops()) if(stack.getItem() == Items.WHEAT_SEEDS && event.getWorld().rand.nextInt(4) == 0) {