remove wrench methods in favor of UE way
UE has it so why should i have my own methods for the same thing
This commit is contained in:
parent
64be07516c
commit
f4eb3e6aa6
3 changed files with 5 additions and 47 deletions
|
@ -190,7 +190,6 @@ public class AssemblyLine
|
|||
|
||||
boolean ic2 = Loader.isModLoaded("IC2");
|
||||
boolean ue = Loader.isModLoaded("BasicComponents");
|
||||
|
||||
createStandardRecipes();
|
||||
if (ic2)
|
||||
{
|
||||
|
|
|
@ -8,7 +8,6 @@ import net.minecraft.world.IBlockAccess;
|
|||
import net.minecraft.world.World;
|
||||
import universalelectricity.prefab.block.BlockAdvanced;
|
||||
import assemblyline.common.AssemblyLine;
|
||||
import buildcraft.api.tools.IToolWrench;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
|
@ -41,43 +40,5 @@ public class BlockALMachine extends BlockAdvanced
|
|||
{
|
||||
return this.machine_icon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
/**
|
||||
* Check if the player is holding a wrench or an electric item. If so, do not open the GUI.
|
||||
*/
|
||||
if (player.inventory.getCurrentItem() != null)
|
||||
{
|
||||
System.out.println(player.inventory.getCurrentItem());
|
||||
if (isHoldingWrench(player))
|
||||
{
|
||||
if (player.isSneaking())
|
||||
{
|
||||
if (this.onSneakUseWrench(world, x, y, z, player, side, hitX, hitY, hitZ))
|
||||
return true;
|
||||
if (this.onSneakMachineActivated(world, x, y, z, player, side, hitX, hitY, hitZ))
|
||||
return true;
|
||||
}
|
||||
if (this.onUseWrench(world, x, y, z, player, side, hitX, hitY, hitZ))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return super.onBlockActivated(world, x, y, z, player, side, hitX, hitY, hitZ);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the player is holding a foreign wrench.
|
||||
*/
|
||||
public static boolean isHoldingWrench(EntityPlayer player)
|
||||
{
|
||||
if (player.getCurrentEquippedItem() != null)
|
||||
{
|
||||
return (AssemblyLine.ic2Wrench != null && player.getCurrentEquippedItem().isItemEqual(AssemblyLine.ic2Wrench) || player.getCurrentEquippedItem().getItem() instanceof IToolWrench);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -39,20 +39,18 @@ public class BlockConveyorBelt extends BlockALMachine
|
|||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
TileEntity t = world.getBlockTileEntity(x, y, z);
|
||||
|
||||
if (t != null && t instanceof TileEntityConveyorBelt)
|
||||
if (world.getBlockTileEntity(x, y, z) instanceof TileEntityConveyorBelt)
|
||||
{
|
||||
TileEntityConveyorBelt tileEntity = (TileEntityConveyorBelt) t;
|
||||
TileEntityConveyorBelt tileEntity = (TileEntityConveyorBelt) world.getBlockTileEntity(x, y, z);
|
||||
|
||||
if (tileEntity.getSlant() == SlantType.UP || tileEntity.getSlant() == SlantType.DOWN)
|
||||
{
|
||||
this.setBlockBounds(0f, 0f, 0f, 1f, 0.98f, 1f);
|
||||
this.setBlockBounds(0f, 0f, 0f, 1f, 0.96f, 1f);
|
||||
return;
|
||||
}
|
||||
if (tileEntity.getSlant() == SlantType.TOP)
|
||||
{
|
||||
this.setBlockBounds(0f, 0.68f, 0f, 1f, 0.98f, 1f);
|
||||
this.setBlockBounds(0f, 0.68f, 0f, 1f, 0.96f, 1f);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue