From 3f8deb946adf1f8eac23e84011097383769ff34e Mon Sep 17 00:00:00 2001 From: Aidan Brady Date: Mon, 8 Jul 2013 18:52:03 -0400 Subject: [PATCH] Re-enabled face culling, re-fixed getPickBlock() --- common/mekanism/client/RenderMechanicalPipe.java | 1 - common/mekanism/client/RenderPressurizedTube.java | 1 - common/mekanism/client/RenderUniversalCable.java | 1 - common/mekanism/client/TransmitterRenderer.java | 1 - common/mekanism/common/BlockBasic.java | 7 +++++++ common/mekanism/common/TileEntityBasicBlock.java | 6 +----- 6 files changed, 8 insertions(+), 9 deletions(-) diff --git a/common/mekanism/client/RenderMechanicalPipe.java b/common/mekanism/client/RenderMechanicalPipe.java index f0ccea1f4..e7a725181 100644 --- a/common/mekanism/client/RenderMechanicalPipe.java +++ b/common/mekanism/client/RenderMechanicalPipe.java @@ -40,7 +40,6 @@ public class RenderMechanicalPipe extends TileEntitySpecialRenderer GL11.glPushMatrix(); GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F); GL11.glScalef(1.0F, -1F, -1F); - GL11.glDisable(GL11.GL_CULL_FACE); boolean[] connectable = PipeUtils.getConnections(tileEntity); diff --git a/common/mekanism/client/RenderPressurizedTube.java b/common/mekanism/client/RenderPressurizedTube.java index 2fb4f6b4f..d132a5d05 100644 --- a/common/mekanism/client/RenderPressurizedTube.java +++ b/common/mekanism/client/RenderPressurizedTube.java @@ -44,7 +44,6 @@ public class RenderPressurizedTube extends TileEntitySpecialRenderer GL11.glPushMatrix(); GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F); GL11.glScalef(1.0F, -1F, -1F); - GL11.glDisable(GL11.GL_CULL_FACE); boolean[] connectable = new boolean[] {false, false, false, false, false, false}; diff --git a/common/mekanism/client/RenderUniversalCable.java b/common/mekanism/client/RenderUniversalCable.java index 01454ec52..4dfdf32b1 100644 --- a/common/mekanism/client/RenderUniversalCable.java +++ b/common/mekanism/client/RenderUniversalCable.java @@ -37,7 +37,6 @@ public class RenderUniversalCable extends TileEntitySpecialRenderer GL11.glPushMatrix(); GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F); GL11.glScalef(1.0F, -1F, -1F); - GL11.glDisable(GL11.GL_CULL_FACE); boolean[] connectable = CableUtils.getConnections(tileEntity); diff --git a/common/mekanism/client/TransmitterRenderer.java b/common/mekanism/client/TransmitterRenderer.java index e0eff15b3..6917af144 100644 --- a/common/mekanism/client/TransmitterRenderer.java +++ b/common/mekanism/client/TransmitterRenderer.java @@ -22,7 +22,6 @@ public class TransmitterRenderer implements ISimpleBlockRenderingHandler GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(180F, 0.0F, -1.0F, 0.0F); GL11.glTranslated(0.0F, -1.0F, 0.0F); - GL11.glDisable(GL11.GL_CULL_FACE); switch(metadata) { diff --git a/common/mekanism/common/BlockBasic.java b/common/mekanism/common/BlockBasic.java index 3dfea1394..5cc105bbd 100644 --- a/common/mekanism/common/BlockBasic.java +++ b/common/mekanism/common/BlockBasic.java @@ -18,6 +18,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Icon; +import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.liquids.LiquidContainerRegistry; @@ -383,4 +384,10 @@ public class BlockBasic extends Block } } } + + @Override + public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) + { + return new ItemStack(blockID, 1, world.getBlockMetadata(x, y, z)); + } } \ No newline at end of file diff --git a/common/mekanism/common/TileEntityBasicBlock.java b/common/mekanism/common/TileEntityBasicBlock.java index 1c016284c..1c1120757 100644 --- a/common/mekanism/common/TileEntityBasicBlock.java +++ b/common/mekanism/common/TileEntityBasicBlock.java @@ -10,7 +10,6 @@ import mekanism.api.Object3D; import mekanism.common.PacketHandler.Transmission; import mekanism.common.network.PacketDataRequest; import mekanism.common.network.PacketTileEntity; -import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -139,9 +138,6 @@ public abstract class TileEntityBasicBlock extends TileEntity implements IWrench @Override public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - int id = worldObj.getBlockId(xCoord, yCoord, zCoord); - int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord); - ItemStack drop = new ItemStack(id, 1, meta); - return drop; + return getBlockType().getPickBlock(null, worldObj, xCoord, yCoord, zCoord); } }