re-add the null check and the permission check
This commit is contained in:
parent
a2e11b1a3a
commit
761fddaa55
|
@ -238,7 +238,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature,
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated( final World w, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, final float hitY, final float hitZ )
|
public boolean onBlockActivated( final World w, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, final float hitY, final float hitZ )
|
||||||
{
|
{
|
||||||
if( player != null )
|
if( player != null && player.inventory.getCurrentItem() != null)
|
||||||
{
|
{
|
||||||
final ItemStack heldItem = player.inventory.getCurrentItem();
|
final ItemStack heldItem = player.inventory.getCurrentItem();
|
||||||
if( Platform.isWrench( player, heldItem, x, y, z ) && player.isSneaking() )
|
if( Platform.isWrench( player, heldItem, x, y, z ) && player.isSneaking() )
|
||||||
|
@ -262,6 +262,13 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BlockEvent.BreakEvent event = new BlockEvent.BreakEvent( x, y, z, w, this, 0, player );
|
||||||
|
MinecraftForge.EVENT_BUS.post( event );
|
||||||
|
if( event.isCanceled() )
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
final ItemStack[] itemDropCandidates = Platform.getBlockDrops( w, x, y, z );
|
final ItemStack[] itemDropCandidates = Platform.getBlockDrops( w, x, y, z );
|
||||||
final ItemStack op = new ItemStack( this );
|
final ItemStack op = new ItemStack( this );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue