From 060ca1eb80a9d2da9a7084cc1cc7bdcdde35abb9 Mon Sep 17 00:00:00 2001 From: mezz Date: Wed, 28 Jan 2015 23:48:21 -0800 Subject: [PATCH] Fix #479 Try to make sure hives are always glowing (cherry picked from commit 636201ce5afca3e477002484c7e54e3a99215f0e) --- .../forestry/apiculture/gadgets/TileSwarm.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/main/java/forestry/apiculture/gadgets/TileSwarm.java b/src/main/java/forestry/apiculture/gadgets/TileSwarm.java index e0bb93925..2f59e7156 100755 --- a/src/main/java/forestry/apiculture/gadgets/TileSwarm.java +++ b/src/main/java/forestry/apiculture/gadgets/TileSwarm.java @@ -15,6 +15,7 @@ import forestry.core.inventory.InventoryAdapter; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.EnumSkyBlock; public class TileSwarm extends TileEntity { @@ -22,7 +23,21 @@ public class TileSwarm extends TileEntity { @Override public boolean canUpdate() { - return false; + return true; + } + + // Hack to make sure that hives glow. + // TODO: remove when Mojang fixes this bug: https://bugs.mojang.com/browse/MC-3329 + // Hives should not need to tick normally. + private boolean updatedLight; + + @Override + public void updateEntity() { + super.updateEntity(); + + if (worldObj.isRemote && !updatedLight && worldObj.getWorldTime() % 20 == 0) { + updatedLight = worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord, zCoord); + } } public TileSwarm setContained(ItemStack[] bees) {