Skip to content

Commit

Permalink
Fix block rotation.
Browse files Browse the repository at this point in the history
  • Loading branch information
gamerforEA committed Mar 23, 2015
1 parent 4b5e70b commit 39aa626
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/main/java/appeng/items/tools/ToolNetworkTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ public boolean serverSideToolLogic(ItemStack is, EntityPlayer p, World w, int x,
Block b = w.getBlock(x, y, z);
if (b != null && !p.isSneaking())
{
// TODO gamerforEA code start
if (ToolQuartzWrench.callBlockBreakEvent(x, y, z, w, p)) return false;
// TODO gamerforEA code end

TileEntity te = w.getTileEntity(x, y, z);
if (!(te instanceof IGridHost))
{
Expand Down Expand Up @@ -154,13 +158,13 @@ public boolean doesSneakBypassUse(World world, int x, int y, int z, EntityPlayer
@Override
public boolean canWrench(ItemStack is, EntityPlayer player, int x, int y, int z)
{
return !ToolQuartzWrench.callBlockBreakEvent(x, y, z, player.worldObj, player);
return !ToolQuartzWrench.callBlockBreakEvent(x, y, z, player.worldObj, player); // TODO gamerforEA call event
}

@Override
public boolean canWrench(EntityPlayer player, int x, int y, int z)
{
return !ToolQuartzWrench.callBlockBreakEvent(x, y, z, player.worldObj, player);
return !ToolQuartzWrench.callBlockBreakEvent(x, y, z, player.worldObj, player); // TODO gamerforEA call event
}

@Override
Expand Down
10 changes: 8 additions & 2 deletions src/main/java/appeng/items/tools/quartz/ToolQuartzWrench.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ public boolean onItemUseFirst(ItemStack is, EntityPlayer player, World world, in
{
if (Platform.isClient()) return !world.isRemote;

// TODO gamerforEA code start
if (callBlockBreakEvent(x, y, z, world, player)) return false;
// TODO gamerforEA code end

ForgeDirection mySide = ForgeDirection.getOrientation(side);
if (b.rotateBlock(world, x, y, z, mySide))
{
Expand All @@ -56,13 +60,13 @@ public boolean doesSneakBypassUse(World world, int x, int y, int z, EntityPlayer
@Override
public boolean canWrench(ItemStack is, EntityPlayer player, int x, int y, int z)
{
return !callBlockBreakEvent(x, y, z, player.worldObj, player);
return !callBlockBreakEvent(x, y, z, player.worldObj, player); // TODO gamerforEA call event
}

@Override
public boolean canWrench(EntityPlayer player, int x, int y, int z)
{
return !callBlockBreakEvent(x, y, z, player.worldObj, player);
return !callBlockBreakEvent(x, y, z, player.worldObj, player); // TODO gamerforEA call event
}

@Override
Expand All @@ -71,6 +75,7 @@ public void wrenchUsed(EntityPlayer player, int x, int y, int z)
player.swingItem();
}

// TODO gamerforEA code start
/**
*
* @param x - X coord
Expand All @@ -85,4 +90,5 @@ public static boolean callBlockBreakEvent(int x, int y, int z, World w, EntityPl
BreakEvent event = new BreakEvent(x, y, z, w, w.getBlock(x, y, z), w.getBlockMetadata(x, y, z), p);
return MinecraftForge.EVENT_BUS.post(event);
}
// TODO gamerforEA code end
}

0 comments on commit 39aa626

Please sign in to comment.