Fix #479 Try to make sure hives are always glowing

(cherry picked from commit 636201ce5a)
This commit is contained in:
mezz committed 2015-01-29 00:09:47 -08:00
1 parent 98a2d9c65e
commit 060ca1eb80
1 file changed
+16 -1
@@ -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) {