Fixed rendering of lighting for enchanter.

This commit is contained in:
CrazyPants committed 2014-07-23 21:14:01 +08:00
1 parent 44e21ba066
commit 2ba7a0f264
2 files changed
+12 -5

No files matched your search

@@ -39,6 +39,7 @@ public class BlockEnchanter extends BlockEio implements IGuiHandler, IResourceTo
protected BlockEnchanter() {
super(ModObject.blockEnchanter.unlocalisedName, TileEnchanter.class);
setBlockTextureName("enderio:blockEnchanter");
setLightOpacity(4);
}
@Override
@@ -47,11 +48,6 @@ public class BlockEnchanter extends BlockEio implements IGuiHandler, IResourceTo
EnderIO.guiHandler.registerGuiHandler(GuiHandler.GUI_ID_ENCHANTER, this);
}
@Override
public int getLightOpacity() {
return 4;
}
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack) {
super.onBlockPlacedBy(world, x, y, z, player, stack);
@@ -12,6 +12,8 @@ import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import crazypants.enderio.EnderIO;
import crazypants.enderio.conduit.ConduitUtil;
import crazypants.enderio.config.Config;
import crazypants.render.BoundingBox;
import crazypants.render.CubeRenderer;
import crazypants.render.IconUtil;
@@ -52,6 +54,15 @@ public class EnchanterRenderer implements ISimpleBlockRenderingHandler, IItemRen
Tessellator tes = Tessellator.instance;
tes.addTranslation(x, y, z);
tes.setColorOpaque_F(1, 1, 1);
int brightness;
if(world == null) {
brightness = 15 << 20 | 15 << 4;
} else {
brightness = world.getLightBrightnessForSkyBlocks(x, y, z, 0);
}
tes.setBrightness(brightness);
IIcon[] icons = new IIcon[6];
for(int i=0;i<icons.length;i++) {