mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-21 20:42:17 +00:00
Merge branch 'development' into 1.8
Conflicts: src/main/java/mekanism/common/tile/TileEntitySalinationController.java src/main/java/mekanism/common/util/MekanismUtils.java src/main/java/mekanism/generators/common/block/BlockGenerator.java
This commit is contained in:
commit
514b6962d2
12 files changed
+138
-231
No files matched your search
@@ -9,6 +9,8 @@ import mekanism.common.MekanismBlocks;
|
||||
import mekanism.common.base.ISustainedInventory;
|
||||
import mekanism.common.tile.TileEntityBasicBlock;
|
||||
import mekanism.common.tile.TileEntityGasTank;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -30,8 +32,6 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockGasTank extends BlockContainer
|
||||
{
|
||||
public Random machineRand = new Random();
|
||||
|
||||
public BlockGasTank()
|
||||
{
|
||||
super(Material.iron);
|
||||
@@ -80,7 +80,7 @@ public class BlockGasTank extends BlockContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int facing, float playerX, float playerY, float playerZ)
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int side, float playerX, float playerY, float playerZ)
|
||||
{
|
||||
if(ItemAttacher.canAttach(entityplayer.getCurrentEquippedItem()))
|
||||
{
|
||||
@@ -93,46 +93,27 @@ public class BlockGasTank extends BlockContainer
|
||||
}
|
||||
|
||||
TileEntityGasTank tileEntity = (TileEntityGasTank)world.getTileEntity(x, y, z);
|
||||
int metadata = world.getBlockMetadata(x, y, z);
|
||||
|
||||
if(entityplayer.getCurrentEquippedItem() != null)
|
||||
{
|
||||
Item tool = entityplayer.getCurrentEquippedItem().getItem();
|
||||
|
||||
if(ModAPIManager.INSTANCE.hasAPI("BuildCraftAPI|tools") && tool instanceof IToolWrench && !tool.getUnlocalizedName().contains("omniwrench"))
|
||||
if(MekanismUtils.hasUsableWrench(entityplayer, x, y, z))
|
||||
{
|
||||
if(((IToolWrench)tool).canWrench(entityplayer, x, y, z))
|
||||
if(entityplayer.isSneaking())
|
||||
{
|
||||
if(entityplayer.isSneaking())
|
||||
{
|
||||
dismantleBlock(world, x, y, z, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
((IToolWrench)tool).wrenchUsed(entityplayer, x, y, z);
|
||||
|
||||
int change = 0;
|
||||
|
||||
switch(tileEntity.facing)
|
||||
{
|
||||
case 3:
|
||||
change = 5;
|
||||
break;
|
||||
case 5:
|
||||
change = 2;
|
||||
break;
|
||||
case 2:
|
||||
change = 4;
|
||||
break;
|
||||
case 4:
|
||||
change = 3;
|
||||
break;
|
||||
}
|
||||
|
||||
tileEntity.setFacing((short)change);
|
||||
world.notifyBlocksOfNeighborChange(x, y, z, this);
|
||||
dismantleBlock(world, x, y, z, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
if(ModAPIManager.INSTANCE.hasAPI("BuildCraftAPI|tools") && tool instanceof IToolWrench)
|
||||
((IToolWrench)tool).wrenchUsed(entityplayer, x, y, z);
|
||||
|
||||
int change = ForgeDirection.ROTATION_MATRIX[ForgeDirection.UP.ordinal()][tileEntity.facing];
|
||||
|
||||
tileEntity.setFacing((short)change);
|
||||
world.notifyBlocksOfNeighborChange(x, y, z, this);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user