From 63f4f7abf64808c96b3b1521121f0432162440cb Mon Sep 17 00:00:00 2001 From: Adubbz Date: Sun, 7 Apr 2013 18:22:52 +1000 Subject: [PATCH] Fixed crash on right clicking on slabs with nothing in your hand --- .../biomesop/blocks/BlockAcaciaSlab.java | 62 +++++++++--------- .../biomesop/blocks/BlockCherrySlab.java | 62 +++++++++--------- .../biomesop/blocks/BlockDarkSlab.java | 63 ++++++++++--------- .../biomesop/blocks/BlockFirSlab.java | 62 +++++++++--------- .../biomesop/blocks/BlockHolySlab.java | 62 +++++++++--------- .../biomesop/blocks/BlockMagicSlab.java | 62 +++++++++--------- .../biomesop/blocks/BlockMangroveSlab.java | 62 +++++++++--------- .../biomesop/blocks/BlockMudBrickSlab.java | 62 +++++++++--------- .../biomesop/blocks/BlockPalmSlab.java | 62 +++++++++--------- .../blocks/BlockRedRockBrickSlab.java | 62 +++++++++--------- .../blocks/BlockRedRockCobbleSlab.java | 62 +++++++++--------- .../biomesop/blocks/BlockRedwoodSlab.java | 62 +++++++++--------- .../biomesop/blocks/BlockWillowSlab.java | 62 +++++++++--------- 13 files changed, 429 insertions(+), 378 deletions(-) diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockAcaciaSlab.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockAcaciaSlab.java index 0758b6951..b1cb9a8d7 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockAcaciaSlab.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockAcaciaSlab.java @@ -87,40 +87,44 @@ public class BlockAcaciaSlab extends BlockHalfSlab */ public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { - if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) + if (par5EntityPlayer.getCurrentEquippedItem() != null) { - - if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ ) + if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) { - if (par6 == 1 /*1 = top of the block*/) + + if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ ) { - if (!par5EntityPlayer.capabilities.isCreativeMode) - { - --par5EntityPlayer.getCurrentEquippedItem().stackSize; - } - - world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); - world.setBlock(par2, par3, par4, BOPBlocks.acaciaDoubleSlab.blockID); - - return true; - } - } - - if (world.getBlockMetadata(par2, par3, par4) == 8 /*8 = Slab at top half*/ ) - { - if (par6 == 0 /*0 = bottom of the block*/) - { - if (!par5EntityPlayer.capabilities.isCreativeMode) - { - --par5EntityPlayer.getCurrentEquippedItem().stackSize; - } - - world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); - world.setBlock(par2, par3, par4, BOPBlocks.acaciaDoubleSlab.blockID); - - return true; + if (par6 == 1 /*1 = top of the block*/) + { + if (!par5EntityPlayer.capabilities.isCreativeMode) + { + --par5EntityPlayer.getCurrentEquippedItem().stackSize; + } + + world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); + world.setBlock(par2, par3, par4, BOPBlocks.acaciaDoubleSlab.blockID); + + return true; + } + } + + if (world.getBlockMetadata(par2, par3, par4) == 8 /*8 = Slab at top half*/ ) + { + if (par6 == 0 /*0 = bottom of the block*/) + { + if (!par5EntityPlayer.capabilities.isCreativeMode) + { + --par5EntityPlayer.getCurrentEquippedItem().stackSize; + } + + world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); + world.setBlock(par2, par3, par4, BOPBlocks.acaciaDoubleSlab.blockID); + + return true; + } } } + return false; } return false; } diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockCherrySlab.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockCherrySlab.java index f644a7c56..4852f4b17 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockCherrySlab.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockCherrySlab.java @@ -85,40 +85,44 @@ public class BlockCherrySlab extends BlockHalfSlab */ public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { - if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) + if (par5EntityPlayer.getCurrentEquippedItem() != null) { - - if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ ) + if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) { - if (par6 == 1 /*1 = top of the block*/) + + if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ ) { - if (!par5EntityPlayer.capabilities.isCreativeMode) - { - --par5EntityPlayer.getCurrentEquippedItem().stackSize; - } - - world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); - world.setBlock(par2, par3, par4, BOPBlocks.cherryDoubleSlab.blockID); - - return true; - } - } - - if (world.getBlockMetadata(par2, par3, par4) == 8 /*8 = Slab at top half*/ ) - { - if (par6 == 0 /*0 = bottom of the block*/) - { - if (!par5EntityPlayer.capabilities.isCreativeMode) - { - --par5EntityPlayer.getCurrentEquippedItem().stackSize; - } - - world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); - world.setBlock(par2, par3, par4, BOPBlocks.cherryDoubleSlab.blockID); - - return true; + if (par6 == 1 /*1 = top of the block*/) + { + if (!par5EntityPlayer.capabilities.isCreativeMode) + { + --par5EntityPlayer.getCurrentEquippedItem().stackSize; + } + + world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); + world.setBlock(par2, par3, par4, BOPBlocks.cherryDoubleSlab.blockID); + + return true; + } + } + + if (world.getBlockMetadata(par2, par3, par4) == 8 /*8 = Slab at top half*/ ) + { + if (par6 == 0 /*0 = bottom of the block*/) + { + if (!par5EntityPlayer.capabilities.isCreativeMode) + { + --par5EntityPlayer.getCurrentEquippedItem().stackSize; + } + + world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); + world.setBlock(par2, par3, par4, BOPBlocks.cherryDoubleSlab.blockID); + + return true; + } } } + return false; } return false; } diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockDarkSlab.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockDarkSlab.java index f1f42bd85..fa5e82f48 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockDarkSlab.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockDarkSlab.java @@ -85,44 +85,47 @@ public class BlockDarkSlab extends BlockHalfSlab */ public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { - if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) + if (par5EntityPlayer.getCurrentEquippedItem() != null) { - - if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ ) + if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) { - if (par6 == 1 /*1 = top of the block*/) + + if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ ) { - if (!par5EntityPlayer.capabilities.isCreativeMode) - { - --par5EntityPlayer.getCurrentEquippedItem().stackSize; - } - - world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); - world.setBlock(par2, par3, par4, BOPBlocks.darkDoubleSlab.blockID); - - return true; - } - } - - if (world.getBlockMetadata(par2, par3, par4) == 8 /*8 = Slab at top half*/ ) - { - if (par6 == 0 /*0 = bottom of the block*/) - { - if (!par5EntityPlayer.capabilities.isCreativeMode) - { - --par5EntityPlayer.getCurrentEquippedItem().stackSize; - } - - world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); - world.setBlock(par2, par3, par4, BOPBlocks.darkDoubleSlab.blockID); - - return true; + if (par6 == 1 /*1 = top of the block*/) + { + if (!par5EntityPlayer.capabilities.isCreativeMode) + { + --par5EntityPlayer.getCurrentEquippedItem().stackSize; + } + + world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); + world.setBlock(par2, par3, par4, BOPBlocks.darkDoubleSlab.blockID); + + return true; + } + } + + if (world.getBlockMetadata(par2, par3, par4) == 8 /*8 = Slab at top half*/ ) + { + if (par6 == 0 /*0 = bottom of the block*/) + { + if (!par5EntityPlayer.capabilities.isCreativeMode) + { + --par5EntityPlayer.getCurrentEquippedItem().stackSize; + } + + world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); + world.setBlock(par2, par3, par4, BOPBlocks.darkDoubleSlab.blockID); + + return true; + } } } + return false; } return false; } - /** * Returns the slab block name with step type. */ diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockFirSlab.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockFirSlab.java index df217bf7f..e8cc62f84 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockFirSlab.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockFirSlab.java @@ -87,40 +87,44 @@ public class BlockFirSlab extends BlockHalfSlab */ public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { - if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) + if (par5EntityPlayer.getCurrentEquippedItem() != null) { - - if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ ) + if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) { - if (par6 == 1 /*1 = top of the block*/) + + if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ ) { - if (!par5EntityPlayer.capabilities.isCreativeMode) - { - --par5EntityPlayer.getCurrentEquippedItem().stackSize; - } - - world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); - world.setBlock(par2, par3, par4, BOPBlocks.firDoubleSlab.blockID); - - return true; - } - } - - if (world.getBlockMetadata(par2, par3, par4) == 8 /*8 = Slab at top half*/ ) - { - if (par6 == 0 /*0 = bottom of the block*/) - { - if (!par5EntityPlayer.capabilities.isCreativeMode) - { - --par5EntityPlayer.getCurrentEquippedItem().stackSize; - } - - world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); - world.setBlock(par2, par3, par4, BOPBlocks.firDoubleSlab.blockID); - - return true; + if (par6 == 1 /*1 = top of the block*/) + { + if (!par5EntityPlayer.capabilities.isCreativeMode) + { + --par5EntityPlayer.getCurrentEquippedItem().stackSize; + } + + world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); + world.setBlock(par2, par3, par4, BOPBlocks.firDoubleSlab.blockID); + + return true; + } + } + + if (world.getBlockMetadata(par2, par3, par4) == 8 /*8 = Slab at top half*/ ) + { + if (par6 == 0 /*0 = bottom of the block*/) + { + if (!par5EntityPlayer.capabilities.isCreativeMode) + { + --par5EntityPlayer.getCurrentEquippedItem().stackSize; + } + + world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); + world.setBlock(par2, par3, par4, BOPBlocks.firDoubleSlab.blockID); + + return true; + } } } + return false; } return false; } diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockHolySlab.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockHolySlab.java index 1da71dd3a..f143d8a67 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockHolySlab.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockHolySlab.java @@ -85,40 +85,44 @@ public class BlockHolySlab extends BlockHalfSlab */ public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { - if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) + if (par5EntityPlayer.getCurrentEquippedItem() != null) { - - if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ ) + if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) { - if (par6 == 1 /*1 = top of the block*/) + + if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ ) { - if (!par5EntityPlayer.capabilities.isCreativeMode) - { - --par5EntityPlayer.getCurrentEquippedItem().stackSize; - } - - world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); - world.setBlock(par2, par3, par4, BOPBlocks.holyDoubleSlab.blockID); - - return true; - } - } - - if (world.getBlockMetadata(par2, par3, par4) == 8 /*8 = Slab at top half*/ ) - { - if (par6 == 0 /*0 = bottom of the block*/) - { - if (!par5EntityPlayer.capabilities.isCreativeMode) - { - --par5EntityPlayer.getCurrentEquippedItem().stackSize; - } - - world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); - world.setBlock(par2, par3, par4, BOPBlocks.holyDoubleSlab.blockID); - - return true; + if (par6 == 1 /*1 = top of the block*/) + { + if (!par5EntityPlayer.capabilities.isCreativeMode) + { + --par5EntityPlayer.getCurrentEquippedItem().stackSize; + } + + world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); + world.setBlock(par2, par3, par4, BOPBlocks.holyDoubleSlab.blockID); + + return true; + } + } + + if (world.getBlockMetadata(par2, par3, par4) == 8 /*8 = Slab at top half*/ ) + { + if (par6 == 0 /*0 = bottom of the block*/) + { + if (!par5EntityPlayer.capabilities.isCreativeMode) + { + --par5EntityPlayer.getCurrentEquippedItem().stackSize; + } + + world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); + world.setBlock(par2, par3, par4, BOPBlocks.holyDoubleSlab.blockID); + + return true; + } } } + return false; } return false; } diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockMagicSlab.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockMagicSlab.java index 96a3f6bf3..c7ab05400 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockMagicSlab.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockMagicSlab.java @@ -84,40 +84,44 @@ public class BlockMagicSlab extends BlockHalfSlab */ public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { - if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) + if (par5EntityPlayer.getCurrentEquippedItem() != null) { - - if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ ) + if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) { - if (par6 == 1 /*1 = top of the block*/) + + if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ ) { - if (!par5EntityPlayer.capabilities.isCreativeMode) - { - --par5EntityPlayer.getCurrentEquippedItem().stackSize; - } - - world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); - world.setBlock(par2, par3, par4, BOPBlocks.magicDoubleSlab.blockID); - - return true; - } - } - - if (world.getBlockMetadata(par2, par3, par4) == 8 /*8 = Slab at top half*/ ) - { - if (par6 == 0 /*0 = bottom of the block*/) - { - if (!par5EntityPlayer.capabilities.isCreativeMode) - { - --par5EntityPlayer.getCurrentEquippedItem().stackSize; - } - - world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); - world.setBlock(par2, par3, par4, BOPBlocks.magicDoubleSlab.blockID); - - return true; + if (par6 == 1 /*1 = top of the block*/) + { + if (!par5EntityPlayer.capabilities.isCreativeMode) + { + --par5EntityPlayer.getCurrentEquippedItem().stackSize; + } + + world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); + world.setBlock(par2, par3, par4, BOPBlocks.magicDoubleSlab.blockID); + + return true; + } + } + + if (world.getBlockMetadata(par2, par3, par4) == 8 /*8 = Slab at top half*/ ) + { + if (par6 == 0 /*0 = bottom of the block*/) + { + if (!par5EntityPlayer.capabilities.isCreativeMode) + { + --par5EntityPlayer.getCurrentEquippedItem().stackSize; + } + + world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); + world.setBlock(par2, par3, par4, BOPBlocks.magicDoubleSlab.blockID); + + return true; + } } } + return false; } return false; } diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockMangroveSlab.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockMangroveSlab.java index b0fde8557..a1451ccc9 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockMangroveSlab.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockMangroveSlab.java @@ -85,40 +85,44 @@ public class BlockMangroveSlab extends BlockHalfSlab */ public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { - if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) + if (par5EntityPlayer.getCurrentEquippedItem() != null) { - - if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ ) + if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) { - if (par6 == 1 /*1 = top of the block*/) + + if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ ) { - if (!par5EntityPlayer.capabilities.isCreativeMode) - { - --par5EntityPlayer.getCurrentEquippedItem().stackSize; - } - - world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); - world.setBlock(par2, par3, par4, BOPBlocks.mangroveDoubleSlab.blockID); - - return true; - } - } - - if (world.getBlockMetadata(par2, par3, par4) == 8 /*8 = Slab at top half*/ ) - { - if (par6 == 0 /*0 = bottom of the block*/) - { - if (!par5EntityPlayer.capabilities.isCreativeMode) - { - --par5EntityPlayer.getCurrentEquippedItem().stackSize; - } - - world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); - world.setBlock(par2, par3, par4, BOPBlocks.mangroveDoubleSlab.blockID); - - return true; + if (par6 == 1 /*1 = top of the block*/) + { + if (!par5EntityPlayer.capabilities.isCreativeMode) + { + --par5EntityPlayer.getCurrentEquippedItem().stackSize; + } + + world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); + world.setBlock(par2, par3, par4, BOPBlocks.mangroveDoubleSlab.blockID); + + return true; + } + } + + if (world.getBlockMetadata(par2, par3, par4) == 8 /*8 = Slab at top half*/ ) + { + if (par6 == 0 /*0 = bottom of the block*/) + { + if (!par5EntityPlayer.capabilities.isCreativeMode) + { + --par5EntityPlayer.getCurrentEquippedItem().stackSize; + } + + world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); + world.setBlock(par2, par3, par4, BOPBlocks.mangroveDoubleSlab.blockID); + + return true; + } } } + return false; } return false; } diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockMudBrickSlab.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockMudBrickSlab.java index 074b26445..ed59d755b 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockMudBrickSlab.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockMudBrickSlab.java @@ -84,40 +84,44 @@ public class BlockMudBrickSlab extends BlockHalfSlab */ public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { - if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) + if (par5EntityPlayer.getCurrentEquippedItem() != null) { - - if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ ) + if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) { - if (par6 == 1 /*1 = top of the block*/) + + if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ ) { - if (!par5EntityPlayer.capabilities.isCreativeMode) - { - --par5EntityPlayer.getCurrentEquippedItem().stackSize; - } - - world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); - world.setBlock(par2, par3, par4, BOPBlocks.mudBrickDoubleSlab.blockID); - - return true; - } - } - - if (world.getBlockMetadata(par2, par3, par4) == 8 /*8 = Slab at top half*/ ) - { - if (par6 == 0 /*0 = bottom of the block*/) - { - if (!par5EntityPlayer.capabilities.isCreativeMode) - { - --par5EntityPlayer.getCurrentEquippedItem().stackSize; - } - - world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); - world.setBlock(par2, par3, par4, BOPBlocks.mudBrickDoubleSlab.blockID); - - return true; + if (par6 == 1 /*1 = top of the block*/) + { + if (!par5EntityPlayer.capabilities.isCreativeMode) + { + --par5EntityPlayer.getCurrentEquippedItem().stackSize; + } + + world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); + world.setBlock(par2, par3, par4, BOPBlocks.mudBrickDoubleSlab.blockID); + + return true; + } + } + + if (world.getBlockMetadata(par2, par3, par4) == 8 /*8 = Slab at top half*/ ) + { + if (par6 == 0 /*0 = bottom of the block*/) + { + if (!par5EntityPlayer.capabilities.isCreativeMode) + { + --par5EntityPlayer.getCurrentEquippedItem().stackSize; + } + + world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); + world.setBlock(par2, par3, par4, BOPBlocks.mudBrickDoubleSlab.blockID); + + return true; + } } } + return false; } return false; } diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockPalmSlab.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockPalmSlab.java index 5700f4ef2..1fb9ae107 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockPalmSlab.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockPalmSlab.java @@ -85,40 +85,44 @@ public class BlockPalmSlab extends BlockHalfSlab */ public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { - if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) + if (par5EntityPlayer.getCurrentEquippedItem() != null) { - - if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ ) + if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) { - if (par6 == 1 /*1 = top of the block*/) + + if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ ) { - if (!par5EntityPlayer.capabilities.isCreativeMode) - { - --par5EntityPlayer.getCurrentEquippedItem().stackSize; - } - - world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); - world.setBlock(par2, par3, par4, BOPBlocks.palmDoubleSlab.blockID); - - return true; - } - } - - if (world.getBlockMetadata(par2, par3, par4) == 8 /*8 = Slab at top half*/ ) - { - if (par6 == 0 /*0 = bottom of the block*/) - { - if (!par5EntityPlayer.capabilities.isCreativeMode) - { - --par5EntityPlayer.getCurrentEquippedItem().stackSize; - } - - world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); - world.setBlock(par2, par3, par4, BOPBlocks.palmDoubleSlab.blockID); - - return true; + if (par6 == 1 /*1 = top of the block*/) + { + if (!par5EntityPlayer.capabilities.isCreativeMode) + { + --par5EntityPlayer.getCurrentEquippedItem().stackSize; + } + + world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); + world.setBlock(par2, par3, par4, BOPBlocks.palmDoubleSlab.blockID); + + return true; + } + } + + if (world.getBlockMetadata(par2, par3, par4) == 8 /*8 = Slab at top half*/ ) + { + if (par6 == 0 /*0 = bottom of the block*/) + { + if (!par5EntityPlayer.capabilities.isCreativeMode) + { + --par5EntityPlayer.getCurrentEquippedItem().stackSize; + } + + world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); + world.setBlock(par2, par3, par4, BOPBlocks.palmDoubleSlab.blockID); + + return true; + } } } + return false; } return false; } diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockRedRockBrickSlab.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockRedRockBrickSlab.java index bfc45a50b..88d3a13be 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockRedRockBrickSlab.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockRedRockBrickSlab.java @@ -84,40 +84,44 @@ public class BlockRedRockBrickSlab extends BlockHalfSlab */ public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { - if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) + if (par5EntityPlayer.getCurrentEquippedItem() != null) { - - if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ ) + if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) { - if (par6 == 1 /*1 = top of the block*/) + + if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ ) { - if (!par5EntityPlayer.capabilities.isCreativeMode) - { - --par5EntityPlayer.getCurrentEquippedItem().stackSize; - } - - world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); - world.setBlock(par2, par3, par4, BOPBlocks.redRockBrickDoubleSlab.blockID); - - return true; - } - } - - if (world.getBlockMetadata(par2, par3, par4) == 8 /*8 = Slab at top half*/ ) - { - if (par6 == 0 /*0 = bottom of the block*/) - { - if (!par5EntityPlayer.capabilities.isCreativeMode) - { - --par5EntityPlayer.getCurrentEquippedItem().stackSize; - } - - world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); - world.setBlock(par2, par3, par4, BOPBlocks.redRockBrickDoubleSlab.blockID); - - return true; + if (par6 == 1 /*1 = top of the block*/) + { + if (!par5EntityPlayer.capabilities.isCreativeMode) + { + --par5EntityPlayer.getCurrentEquippedItem().stackSize; + } + + world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); + world.setBlock(par2, par3, par4, BOPBlocks.redRockBrickDoubleSlab.blockID); + + return true; + } + } + + if (world.getBlockMetadata(par2, par3, par4) == 8 /*8 = Slab at top half*/ ) + { + if (par6 == 0 /*0 = bottom of the block*/) + { + if (!par5EntityPlayer.capabilities.isCreativeMode) + { + --par5EntityPlayer.getCurrentEquippedItem().stackSize; + } + + world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); + world.setBlock(par2, par3, par4, BOPBlocks.redRockBrickDoubleSlab.blockID); + + return true; + } } } + return false; } return false; } diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockRedRockCobbleSlab.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockRedRockCobbleSlab.java index fb1f1f671..fe3c838e5 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockRedRockCobbleSlab.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockRedRockCobbleSlab.java @@ -84,40 +84,44 @@ public class BlockRedRockCobbleSlab extends BlockHalfSlab */ public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { - if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) + if (par5EntityPlayer.getCurrentEquippedItem() != null) { - - if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ ) + if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) { - if (par6 == 1 /*1 = top of the block*/) + + if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ ) { - if (!par5EntityPlayer.capabilities.isCreativeMode) - { - --par5EntityPlayer.getCurrentEquippedItem().stackSize; - } - - world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); - world.setBlock(par2, par3, par4, BOPBlocks.redRockCobbleDoubleSlab.blockID); - - return true; - } - } - - if (world.getBlockMetadata(par2, par3, par4) == 8 /*8 = Slab at top half*/ ) - { - if (par6 == 0 /*0 = bottom of the block*/) - { - if (!par5EntityPlayer.capabilities.isCreativeMode) - { - --par5EntityPlayer.getCurrentEquippedItem().stackSize; - } - - world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); - world.setBlock(par2, par3, par4, BOPBlocks.redRockCobbleDoubleSlab.blockID); - - return true; + if (par6 == 1 /*1 = top of the block*/) + { + if (!par5EntityPlayer.capabilities.isCreativeMode) + { + --par5EntityPlayer.getCurrentEquippedItem().stackSize; + } + + world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); + world.setBlock(par2, par3, par4, BOPBlocks.redRockCobbleDoubleSlab.blockID); + + return true; + } + } + + if (world.getBlockMetadata(par2, par3, par4) == 8 /*8 = Slab at top half*/ ) + { + if (par6 == 0 /*0 = bottom of the block*/) + { + if (!par5EntityPlayer.capabilities.isCreativeMode) + { + --par5EntityPlayer.getCurrentEquippedItem().stackSize; + } + + world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); + world.setBlock(par2, par3, par4, BOPBlocks.redRockCobbleDoubleSlab.blockID); + + return true; + } } } + return false; } return false; } diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockRedwoodSlab.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockRedwoodSlab.java index 3723d1d8e..b6d901857 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockRedwoodSlab.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockRedwoodSlab.java @@ -85,40 +85,44 @@ public class BlockRedwoodSlab extends BlockHalfSlab */ public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { - if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) + if (par5EntityPlayer.getCurrentEquippedItem() != null) { - - if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ ) + if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) { - if (par6 == 1 /*1 = top of the block*/) + + if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ ) { - if (!par5EntityPlayer.capabilities.isCreativeMode) - { - --par5EntityPlayer.getCurrentEquippedItem().stackSize; - } - - world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); - world.setBlock(par2, par3, par4, BOPBlocks.redwoodDoubleSlab.blockID); - - return true; - } - } - - if (world.getBlockMetadata(par2, par3, par4) == 8 /*8 = Slab at top half*/ ) - { - if (par6 == 0 /*0 = bottom of the block*/) - { - if (!par5EntityPlayer.capabilities.isCreativeMode) - { - --par5EntityPlayer.getCurrentEquippedItem().stackSize; - } - - world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); - world.setBlock(par2, par3, par4, BOPBlocks.redwoodDoubleSlab.blockID); - - return true; + if (par6 == 1 /*1 = top of the block*/) + { + if (!par5EntityPlayer.capabilities.isCreativeMode) + { + --par5EntityPlayer.getCurrentEquippedItem().stackSize; + } + + world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); + world.setBlock(par2, par3, par4, BOPBlocks.redwoodDoubleSlab.blockID); + + return true; + } + } + + if (world.getBlockMetadata(par2, par3, par4) == 8 /*8 = Slab at top half*/ ) + { + if (par6 == 0 /*0 = bottom of the block*/) + { + if (!par5EntityPlayer.capabilities.isCreativeMode) + { + --par5EntityPlayer.getCurrentEquippedItem().stackSize; + } + + world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); + world.setBlock(par2, par3, par4, BOPBlocks.redwoodDoubleSlab.blockID); + + return true; + } } } + return false; } return false; } diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockWillowSlab.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockWillowSlab.java index 5d63837aa..ee19d27d8 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockWillowSlab.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockWillowSlab.java @@ -86,40 +86,44 @@ public class BlockWillowSlab extends BlockHalfSlab */ public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { - if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) + if (par5EntityPlayer.getCurrentEquippedItem() != null) { - - if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ ) + if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID) { - if (par6 == 1 /*1 = top of the block*/) + + if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ ) { - if (!par5EntityPlayer.capabilities.isCreativeMode) - { - --par5EntityPlayer.getCurrentEquippedItem().stackSize; - } - - world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); - world.setBlock(par2, par3, par4, BOPBlocks.willowDoubleSlab.blockID); - - return true; - } - } - - if (world.getBlockMetadata(par2, par3, par4) == 8 /*8 = Slab at top half*/ ) - { - if (par6 == 0 /*0 = bottom of the block*/) - { - if (!par5EntityPlayer.capabilities.isCreativeMode) - { - --par5EntityPlayer.getCurrentEquippedItem().stackSize; - } - - world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); - world.setBlock(par2, par3, par4, BOPBlocks.willowDoubleSlab.blockID); - - return true; + if (par6 == 1 /*1 = top of the block*/) + { + if (!par5EntityPlayer.capabilities.isCreativeMode) + { + --par5EntityPlayer.getCurrentEquippedItem().stackSize; + } + + world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); + world.setBlock(par2, par3, par4, BOPBlocks.willowDoubleSlab.blockID); + + return true; + } + } + + if (world.getBlockMetadata(par2, par3, par4) == 8 /*8 = Slab at top half*/ ) + { + if (par6 == 0 /*0 = bottom of the block*/) + { + if (!par5EntityPlayer.capabilities.isCreativeMode) + { + --par5EntityPlayer.getCurrentEquippedItem().stackSize; + } + + world.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.stepSound.getPlaceSound(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); + world.setBlock(par2, par3, par4, BOPBlocks.willowDoubleSlab.blockID); + + return true; + } } } + return false; } return false; }