Fixed last PR and removed unneeded Textures

This commit is contained in:
CovertJaguar 2013-04-29 12:11:25 -07:00
parent 437a870ab0
commit 62f374e40d
2 changed files with 42 additions and 55 deletions

View file

@ -20,7 +20,7 @@ import cpw.mods.fml.relauncher.SideOnly;
public class BlockHopper extends BlockBuildCraft {
private static icons[3];
private static Icon icon;
public BlockHopper(int blockId) {
super(blockId, Material.iron);
@ -52,12 +52,14 @@ public class BlockHopper extends BlockBuildCraft {
super.onBlockActivated(world, x, y, z, entityplayer, par6, par7, par8, par9);
// Drop through if the player is sneaking
if (entityplayer.isSneaking())
if (entityplayer.isSneaking()) {
return false;
}
if (entityplayer.getCurrentEquippedItem() != null) {
if (entityplayer.getCurrentEquippedItem().getItem() instanceof IItemPipe)
if (entityplayer.getCurrentEquippedItem().getItem() instanceof IItemPipe) {
return false;
}
}
if (!CoreProxy.proxy.isRenderWorld(world)) {
@ -67,7 +69,7 @@ public class BlockHopper extends BlockBuildCraft {
return true;
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@SuppressWarnings({"unchecked", "rawtypes"})
@Override
public void addCreativeItems(ArrayList itemList) {
itemList.add(new ItemStack(this));
@ -75,20 +77,13 @@ public class BlockHopper extends BlockBuildCraft {
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister par1IconRegister)
{
icons = new Icon[3];
icons[0] = par1IconRegister.registerIcon("buildcraft:hopperBottom");
icons[1] = par1IconRegister.registerIcon("buildcraft:hopperTop");
icons[2] = par1IconRegister.registerIcon("buildcraft:hopperSide");
}
@Override
@SideOnly(Side.CLIENT)
public Icon getIcon(int par1, int par2)
{
if (par1 < 2) return icons[par2];
return icons[3];
public void registerIcons(IconRegister par1IconRegister) {
icon = par1IconRegister.registerIcon("buildcraft:hopperBottom");
}
@Override
@SideOnly(Side.CLIENT)
public Icon getIcon(int par1, int par2) {
return icon;
}
}

View file

@ -1,12 +1,10 @@
/**
* Copyright (c) SpaceToad, 2011
* http://www.mod-buildcraft.com
* Copyright (c) SpaceToad, 2011 http://www.mod-buildcraft.com
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* BuildCraft is distributed under the terms of the Minecraft Mod Public License
* 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package buildcraft.factory;
import java.util.ArrayList;
@ -19,7 +17,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Icon;
import net.minecraft.util.Icon;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.liquids.LiquidContainerRegistry;
@ -36,8 +34,9 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockRefinery extends BlockContainer {
private static Icon[] icons;
private static Icon icon;
public BlockRefinery(int i) {
super(i, Material.iron);
@ -75,14 +74,15 @@ public class BlockRefinery extends BlockContainer {
ForgeDirection orientation = Utils.get2dOrientation(new Position(entityliving.posX, entityliving.posY, entityliving.posZ), new Position(i, j, k));
world.setBlockMetadataWithNotify(i, j, k, orientation.getOpposite().ordinal(),1);
world.setBlockMetadataWithNotify(i, j, k, orientation.getOpposite().ordinal(), 1);
}
@Override
public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityplayer, int par6, float par7, float par8, float par9) {
// Drop through if the player is sneaking
if (entityplayer.isSneaking())
if (entityplayer.isSneaking()) {
return false;
}
Item equipped = entityplayer.getCurrentEquippedItem() != null ? entityplayer.getCurrentEquippedItem().getItem() : null;
if (equipped instanceof IToolWrench && ((IToolWrench) equipped).canWrench(entityplayer, i, j, k)) {
@ -90,19 +90,19 @@ public class BlockRefinery extends BlockContainer {
int meta = world.getBlockMetadata(i, j, k);
switch (ForgeDirection.values()[meta]) {
case WEST:
world.setBlockMetadataWithNotify(i, j, k, ForgeDirection.SOUTH.ordinal(),0);
break;
case EAST:
world.setBlockMetadataWithNotify(i, j, k, ForgeDirection.NORTH.ordinal(),0);
break;
case NORTH:
world.setBlockMetadataWithNotify(i, j, k, ForgeDirection.WEST.ordinal(),0);
break;
case SOUTH:
default:
world.setBlockMetadataWithNotify(i, j, k, ForgeDirection.EAST.ordinal(),0);
break;
case WEST:
world.setBlockMetadataWithNotify(i, j, k, ForgeDirection.SOUTH.ordinal(), 0);
break;
case EAST:
world.setBlockMetadataWithNotify(i, j, k, ForgeDirection.NORTH.ordinal(), 0);
break;
case NORTH:
world.setBlockMetadataWithNotify(i, j, k, ForgeDirection.WEST.ordinal(), 0);
break;
case SOUTH:
default:
world.setBlockMetadataWithNotify(i, j, k, ForgeDirection.EAST.ordinal(), 0);
break;
}
((IToolWrench) equipped).wrenchUsed(entityplayer, i, j, k);
world.markBlockForUpdate(i, j, k);
@ -130,7 +130,7 @@ public class BlockRefinery extends BlockContainer {
return true;
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@SuppressWarnings({"unchecked", "rawtypes"})
@Override
public void addCreativeItems(ArrayList itemList) {
itemList.add(new ItemStack(this));
@ -138,21 +138,13 @@ public class BlockRefinery extends BlockContainer {
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister par1IconRegister)
{
icons = new Icon[6];
icons[ForgeDirection.DOWN.ordinal()] = par1IconRegister.registerIcon("buildcraft:refineryBottom");
icons[ForgeDirection.UP.ordinal()] = par1IconRegister.registerIcon("buildcraft:refineryTop");
icons[ForgeDirection.NORTH.ordinal()] = par1IconRegister.registerIcon("buildcraft:refineryFront");
icons[ForgeDirection.SOUTH.ordinal()] = par1IconRegister.registerIcon("buildcraft:refineryBack");
icons[ForgeDirection.EAST.ordinal()] = par1IconRegister.registerIcon("buildcraft:refineryEast");
icons[ForgeDirection.WEST.ordinal()] = par1IconRegister.registerIcon("buildcraft:refineryWest");
public void registerIcons(IconRegister par1IconRegister) {
icon = par1IconRegister.registerIcon("buildcraft:refineryBack");
}
@Override
@SideOnly(Side.CLIENT)
public Icon getIcon(int par1, int par2)
{
return icons[par1];
public Icon getIcon(int par1, int par2) {
return icon;
}
}