fix a bug that allows network tool to rotate blocks without the permission.
This commit is contained in:
parent
27fecccec4
commit
3cc48fec60
|
@ -156,6 +156,13 @@ public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench,
|
||||||
}
|
}
|
||||||
|
|
||||||
final Block b = w.getBlock( x, y, z );
|
final Block b = w.getBlock( x, y, z );
|
||||||
|
|
||||||
|
if( b != null )
|
||||||
|
if( ForgeEventFactory.onPlayerInteract( p,
|
||||||
|
b.isAir( w, x, y, z ) ? PlayerInteractEvent.Action.RIGHT_CLICK_AIR : PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK,
|
||||||
|
x, y, z, side, w ).isCanceled() )
|
||||||
|
return false;
|
||||||
|
|
||||||
if( b != null && !p.isSneaking() )
|
if( b != null && !p.isSneaking() )
|
||||||
{
|
{
|
||||||
final TileEntity te = w.getTileEntity( x, y, z );
|
final TileEntity te = w.getTileEntity( x, y, z );
|
||||||
|
@ -192,11 +199,7 @@ public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( b != null )
|
b.onBlockActivated( w, x, y, z, p, side, hitX, hitY, hitZ );
|
||||||
if( !ForgeEventFactory.onPlayerInteract( p,
|
|
||||||
b.isAir( w, x, y, z ) ? PlayerInteractEvent.Action.RIGHT_CLICK_AIR : PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK,
|
|
||||||
x, y, z, side, w ).isCanceled() )
|
|
||||||
b.onBlockActivated( w, x, y, z, p, side, hitX, hitY, hitZ );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue