Fixed crash on right clicking on slabs with nothing in your hand

This commit is contained in:
Adubbz 2013-04-07 18:22:52 +10:00
parent 9b2eb5f2c5
commit 63f4f7abf6
13 changed files with 429 additions and 378 deletions

View File

@ -86,6 +86,8 @@ public class BlockAcaciaSlab extends BlockHalfSlab
* Called upon block activation (right click on the block.) * Called upon block activation (right click on the block.)
*/ */
public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{
if (par5EntityPlayer.getCurrentEquippedItem() != null)
{ {
if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID)
{ {
@ -124,6 +126,8 @@ public class BlockAcaciaSlab extends BlockHalfSlab
} }
return false; return false;
} }
return false;
}
/** /**
* Returns the slab block name with step type. * Returns the slab block name with step type.

View File

@ -84,6 +84,8 @@ public class BlockCherrySlab extends BlockHalfSlab
* Called upon block activation (right click on the block.) * Called upon block activation (right click on the block.)
*/ */
public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{
if (par5EntityPlayer.getCurrentEquippedItem() != null)
{ {
if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID)
{ {
@ -122,6 +124,8 @@ public class BlockCherrySlab extends BlockHalfSlab
} }
return false; return false;
} }
return false;
}
/** /**
* Returns the slab block name with step type. * Returns the slab block name with step type.

View File

@ -84,6 +84,8 @@ public class BlockDarkSlab extends BlockHalfSlab
* Called upon block activation (right click on the block.) * Called upon block activation (right click on the block.)
*/ */
public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{
if (par5EntityPlayer.getCurrentEquippedItem() != null)
{ {
if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID)
{ {
@ -122,7 +124,8 @@ public class BlockDarkSlab extends BlockHalfSlab
} }
return false; return false;
} }
return false;
}
/** /**
* Returns the slab block name with step type. * Returns the slab block name with step type.
*/ */

View File

@ -86,6 +86,8 @@ public class BlockFirSlab extends BlockHalfSlab
* Called upon block activation (right click on the block.) * Called upon block activation (right click on the block.)
*/ */
public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{
if (par5EntityPlayer.getCurrentEquippedItem() != null)
{ {
if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID)
{ {
@ -124,6 +126,8 @@ public class BlockFirSlab extends BlockHalfSlab
} }
return false; return false;
} }
return false;
}
/** /**
* Returns the slab block name with step type. * Returns the slab block name with step type.

View File

@ -84,6 +84,8 @@ public class BlockHolySlab extends BlockHalfSlab
* Called upon block activation (right click on the block.) * Called upon block activation (right click on the block.)
*/ */
public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{
if (par5EntityPlayer.getCurrentEquippedItem() != null)
{ {
if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID)
{ {
@ -122,6 +124,8 @@ public class BlockHolySlab extends BlockHalfSlab
} }
return false; return false;
} }
return false;
}
/** /**
* Returns the slab block name with step type. * Returns the slab block name with step type.

View File

@ -83,6 +83,8 @@ public class BlockMagicSlab extends BlockHalfSlab
* Called upon block activation (right click on the block.) * Called upon block activation (right click on the block.)
*/ */
public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{
if (par5EntityPlayer.getCurrentEquippedItem() != null)
{ {
if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID)
{ {
@ -121,6 +123,8 @@ public class BlockMagicSlab extends BlockHalfSlab
} }
return false; return false;
} }
return false;
}
/** /**
* Returns the slab block name with step type. * Returns the slab block name with step type.

View File

@ -84,6 +84,8 @@ public class BlockMangroveSlab extends BlockHalfSlab
* Called upon block activation (right click on the block.) * Called upon block activation (right click on the block.)
*/ */
public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{
if (par5EntityPlayer.getCurrentEquippedItem() != null)
{ {
if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID)
{ {
@ -122,6 +124,8 @@ public class BlockMangroveSlab extends BlockHalfSlab
} }
return false; return false;
} }
return false;
}
/** /**
* Returns the slab block name with step type. * Returns the slab block name with step type.

View File

@ -83,6 +83,8 @@ public class BlockMudBrickSlab extends BlockHalfSlab
* Called upon block activation (right click on the block.) * Called upon block activation (right click on the block.)
*/ */
public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{
if (par5EntityPlayer.getCurrentEquippedItem() != null)
{ {
if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID)
{ {
@ -121,6 +123,8 @@ public class BlockMudBrickSlab extends BlockHalfSlab
} }
return false; return false;
} }
return false;
}
/** /**
* Returns the slab block name with step type. * Returns the slab block name with step type.

View File

@ -84,6 +84,8 @@ public class BlockPalmSlab extends BlockHalfSlab
* Called upon block activation (right click on the block.) * Called upon block activation (right click on the block.)
*/ */
public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{
if (par5EntityPlayer.getCurrentEquippedItem() != null)
{ {
if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID)
{ {
@ -122,6 +124,8 @@ public class BlockPalmSlab extends BlockHalfSlab
} }
return false; return false;
} }
return false;
}
/** /**
* Returns the slab block name with step type. * Returns the slab block name with step type.

View File

@ -83,6 +83,8 @@ public class BlockRedRockBrickSlab extends BlockHalfSlab
* Called upon block activation (right click on the block.) * Called upon block activation (right click on the block.)
*/ */
public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{
if (par5EntityPlayer.getCurrentEquippedItem() != null)
{ {
if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID)
{ {
@ -121,6 +123,8 @@ public class BlockRedRockBrickSlab extends BlockHalfSlab
} }
return false; return false;
} }
return false;
}
/** /**
* Returns the slab block name with step type. * Returns the slab block name with step type.

View File

@ -83,6 +83,8 @@ public class BlockRedRockCobbleSlab extends BlockHalfSlab
* Called upon block activation (right click on the block.) * Called upon block activation (right click on the block.)
*/ */
public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{
if (par5EntityPlayer.getCurrentEquippedItem() != null)
{ {
if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID)
{ {
@ -121,6 +123,8 @@ public class BlockRedRockCobbleSlab extends BlockHalfSlab
} }
return false; return false;
} }
return false;
}
/** /**
* Returns the slab block name with step type. * Returns the slab block name with step type.

View File

@ -84,6 +84,8 @@ public class BlockRedwoodSlab extends BlockHalfSlab
* Called upon block activation (right click on the block.) * Called upon block activation (right click on the block.)
*/ */
public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{
if (par5EntityPlayer.getCurrentEquippedItem() != null)
{ {
if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID)
{ {
@ -122,6 +124,8 @@ public class BlockRedwoodSlab extends BlockHalfSlab
} }
return false; return false;
} }
return false;
}
/** /**
* Returns the slab block name with step type. * Returns the slab block name with step type.

View File

@ -85,6 +85,8 @@ public class BlockWillowSlab extends BlockHalfSlab
* Called upon block activation (right click on the block.) * Called upon block activation (right click on the block.)
*/ */
public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{
if (par5EntityPlayer.getCurrentEquippedItem() != null)
{ {
if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID)
{ {
@ -123,6 +125,8 @@ public class BlockWillowSlab extends BlockHalfSlab
} }
return false; return false;
} }
return false;
}
/** /**
* Returns the slab block name with step type. * Returns the slab block name with step type.