Merge pull request #14 from Adubbz/MiscFixes+Changes
Misc Fixes and Changes
This commit is contained in:
commit
79ea461b87
34 changed files with 874 additions and 98 deletions
|
@ -2,6 +2,9 @@ package tdwp_ftw.biomesop.blocks;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import tdwp_ftw.biomesop.mod_BiomesOPlenty;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
|
@ -93,22 +96,23 @@ public class BlockAcaciaLeaves extends BlockLeavesBase
|
|||
*/
|
||||
public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6)
|
||||
{
|
||||
byte b0 = 1;
|
||||
int j1 = b0 + 1;
|
||||
byte var7 = 1;
|
||||
int var8 = var7 + 1;
|
||||
|
||||
if (par1World.checkChunksExist(par2 - j1, par3 - j1, par4 - j1, par2 + j1, par3 + j1, par4 + j1))
|
||||
if (par1World.checkChunksExist(par2 - var8, par3 - var8, par4 - var8, par2 + var8, par3 + var8, par4 + var8))
|
||||
{
|
||||
for (int k1 = -b0; k1 <= b0; ++k1)
|
||||
for (int var9 = -var7; var9 <= var7; ++var9)
|
||||
{
|
||||
for (int l1 = -b0; l1 <= b0; ++l1)
|
||||
for (int var10 = -var7; var10 <= var7; ++var10)
|
||||
{
|
||||
for (int i2 = -b0; i2 <= b0; ++i2)
|
||||
for (int var11 = -var7; var11 <= var7; ++var11)
|
||||
{
|
||||
int j2 = par1World.getBlockId(par2 + k1, par3 + l1, par4 + i2);
|
||||
int var12 = par1World.getBlockId(par2 + var9, par3 + var10, par4 + var11);
|
||||
|
||||
if (Block.blocksList[j2] != null)
|
||||
if (var12 == mod_BiomesOPlenty.acaciaLeaves.blockID)
|
||||
{
|
||||
Block.blocksList[j2].beginLeavesDecay(par1World, par2 + k1, par3 + l1, par4 + i2);
|
||||
int var13 = par1World.getBlockMetadata(par2 + var9, par3 + var10, par4 + var11);
|
||||
par1World.setBlockMetadataWithNotify(par2 + var9, par3 + var10, par4 + var11, var13 | 8, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -220,7 +224,7 @@ public class BlockAcaciaLeaves extends BlockLeavesBase
|
|||
|
||||
if (var12 >= 0)
|
||||
{
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 & -9, 4);
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 & -9, 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -247,7 +251,7 @@ public class BlockAcaciaLeaves extends BlockLeavesBase
|
|||
private void removeLeaves(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
||||
par1World.setBlock(par2, par3, par4, this.blockID, 0, 2);
|
||||
par1World.setBlock(par2, par3, par4, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -10,6 +10,7 @@ import net.minecraft.block.BlockHalfSlab;
|
|||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
@ -80,6 +81,49 @@ public class BlockAcaciaSlab extends BlockHalfSlab
|
|||
return new ItemStack(mod_BiomesOPlenty.acaciaSingleSlab.blockID, 2, par1 & 7);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID)
|
||||
{
|
||||
|
||||
if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ )
|
||||
{
|
||||
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, mod_BiomesOPlenty.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, mod_BiomesOPlenty.acaciaDoubleSlab.blockID);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the slab block name with step type.
|
||||
*/
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
package tdwp_ftw.biomesop.blocks;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import tdwp_ftw.biomesop.mod_BiomesOPlenty;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
|
@ -16,6 +20,7 @@ import net.minecraft.stats.StatList;
|
|||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.IShearable;
|
||||
|
||||
public class BlockAppleLeaves extends BlockLeavesBase
|
||||
{
|
||||
|
@ -53,22 +58,23 @@ public class BlockAppleLeaves extends BlockLeavesBase
|
|||
*/
|
||||
public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6)
|
||||
{
|
||||
byte b0 = 1;
|
||||
int j1 = b0 + 1;
|
||||
byte var7 = 1;
|
||||
int var8 = var7 + 1;
|
||||
|
||||
if (par1World.checkChunksExist(par2 - j1, par3 - j1, par4 - j1, par2 + j1, par3 + j1, par4 + j1))
|
||||
if (par1World.checkChunksExist(par2 - var8, par3 - var8, par4 - var8, par2 + var8, par3 + var8, par4 + var8))
|
||||
{
|
||||
for (int k1 = -b0; k1 <= b0; ++k1)
|
||||
for (int var9 = -var7; var9 <= var7; ++var9)
|
||||
{
|
||||
for (int l1 = -b0; l1 <= b0; ++l1)
|
||||
for (int var10 = -var7; var10 <= var7; ++var10)
|
||||
{
|
||||
for (int i2 = -b0; i2 <= b0; ++i2)
|
||||
for (int var11 = -var7; var11 <= var7; ++var11)
|
||||
{
|
||||
int j2 = par1World.getBlockId(par2 + k1, par3 + l1, par4 + i2);
|
||||
int var12 = par1World.getBlockId(par2 + var9, par3 + var10, par4 + var11);
|
||||
|
||||
if (Block.blocksList[j2] != null)
|
||||
if (var12 == mod_BiomesOPlenty.appleLeaves.blockID)
|
||||
{
|
||||
Block.blocksList[j2].beginLeavesDecay(par1World, par2 + k1, par3 + l1, par4 + i2);
|
||||
int var13 = par1World.getBlockMetadata(par2 + var9, par3 + var10, par4 + var11);
|
||||
par1World.setBlockMetadataWithNotify(par2 + var9, par3 + var10, par4 + var11, var13 | 8, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -118,7 +124,7 @@ public class BlockAppleLeaves extends BlockLeavesBase
|
|||
{
|
||||
this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = 0;
|
||||
}
|
||||
else if (var15 == mod_BiomesOPlenty.appleLeaves.blockID || var15 == mod_BiomesOPlenty.appleLeavesFruitless.blockID)
|
||||
else if (var15 == mod_BiomesOPlenty.appleLeaves.blockID || var15 == mod_BiomesOPlenty.appleLeaves.blockID)
|
||||
{
|
||||
this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = -2;
|
||||
}
|
||||
|
@ -180,7 +186,7 @@ public class BlockAppleLeaves extends BlockLeavesBase
|
|||
|
||||
if (var12 >= 0)
|
||||
{
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 & -9, 4);
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 & -9, 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -207,7 +213,7 @@ public class BlockAppleLeaves extends BlockLeavesBase
|
|||
private void removeLeaves(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
||||
par1World.setBlock(par2, par3, par4, this.blockID, 0, 2);
|
||||
par1World.setBlock(par2, par3, par4, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,6 +2,9 @@ package tdwp_ftw.biomesop.blocks;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import tdwp_ftw.biomesop.mod_BiomesOPlenty;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -53,22 +56,23 @@ public class BlockAppleLeavesFruitless extends BlockLeavesBase
|
|||
*/
|
||||
public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6)
|
||||
{
|
||||
byte b0 = 1;
|
||||
int j1 = b0 + 1;
|
||||
byte var7 = 1;
|
||||
int var8 = var7 + 1;
|
||||
|
||||
if (par1World.checkChunksExist(par2 - j1, par3 - j1, par4 - j1, par2 + j1, par3 + j1, par4 + j1))
|
||||
if (par1World.checkChunksExist(par2 - var8, par3 - var8, par4 - var8, par2 + var8, par3 + var8, par4 + var8))
|
||||
{
|
||||
for (int k1 = -b0; k1 <= b0; ++k1)
|
||||
for (int var9 = -var7; var9 <= var7; ++var9)
|
||||
{
|
||||
for (int l1 = -b0; l1 <= b0; ++l1)
|
||||
for (int var10 = -var7; var10 <= var7; ++var10)
|
||||
{
|
||||
for (int i2 = -b0; i2 <= b0; ++i2)
|
||||
for (int var11 = -var7; var11 <= var7; ++var11)
|
||||
{
|
||||
int j2 = par1World.getBlockId(par2 + k1, par3 + l1, par4 + i2);
|
||||
int var12 = par1World.getBlockId(par2 + var9, par3 + var10, par4 + var11);
|
||||
|
||||
if (Block.blocksList[j2] != null)
|
||||
if (var12 == mod_BiomesOPlenty.appleLeavesFruitless.blockID)
|
||||
{
|
||||
Block.blocksList[j2].beginLeavesDecay(par1World, par2 + k1, par3 + l1, par4 + i2);
|
||||
int var13 = par1World.getBlockMetadata(par2 + var9, par3 + var10, par4 + var11);
|
||||
par1World.setBlockMetadataWithNotify(par2 + var9, par3 + var10, par4 + var11, var13 | 8, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -180,7 +184,7 @@ public class BlockAppleLeavesFruitless extends BlockLeavesBase
|
|||
|
||||
if (var12 >= 0)
|
||||
{
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 & -9, 4);
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 & -9, 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -207,7 +211,7 @@ public class BlockAppleLeavesFruitless extends BlockLeavesBase
|
|||
private void removeLeaves(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
||||
par1World.setBlock(par2, par3, par4, this.blockID, 0, 2);
|
||||
par1World.setBlock(par2, par3, par4, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,6 +2,9 @@ package tdwp_ftw.biomesop.blocks;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import tdwp_ftw.biomesop.mod_BiomesOPlenty;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
|
@ -55,22 +58,23 @@ public class BlockAutumnLeaves extends BlockLeavesBase
|
|||
*/
|
||||
public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6)
|
||||
{
|
||||
byte b0 = 1;
|
||||
int j1 = b0 + 1;
|
||||
byte var7 = 1;
|
||||
int var8 = var7 + 1;
|
||||
|
||||
if (par1World.checkChunksExist(par2 - j1, par3 - j1, par4 - j1, par2 + j1, par3 + j1, par4 + j1))
|
||||
if (par1World.checkChunksExist(par2 - var8, par3 - var8, par4 - var8, par2 + var8, par3 + var8, par4 + var8))
|
||||
{
|
||||
for (int k1 = -b0; k1 <= b0; ++k1)
|
||||
for (int var9 = -var7; var9 <= var7; ++var9)
|
||||
{
|
||||
for (int l1 = -b0; l1 <= b0; ++l1)
|
||||
for (int var10 = -var7; var10 <= var7; ++var10)
|
||||
{
|
||||
for (int i2 = -b0; i2 <= b0; ++i2)
|
||||
for (int var11 = -var7; var11 <= var7; ++var11)
|
||||
{
|
||||
int j2 = par1World.getBlockId(par2 + k1, par3 + l1, par4 + i2);
|
||||
int var12 = par1World.getBlockId(par2 + var9, par3 + var10, par4 + var11);
|
||||
|
||||
if (Block.blocksList[j2] != null)
|
||||
if (var12 == mod_BiomesOPlenty.autumnLeaves.blockID)
|
||||
{
|
||||
Block.blocksList[j2].beginLeavesDecay(par1World, par2 + k1, par3 + l1, par4 + i2);
|
||||
int var13 = par1World.getBlockMetadata(par2 + var9, par3 + var10, par4 + var11);
|
||||
par1World.setBlockMetadataWithNotify(par2 + var9, par3 + var10, par4 + var11, var13 | 8, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -182,7 +186,7 @@ public class BlockAutumnLeaves extends BlockLeavesBase
|
|||
|
||||
if (var12 >= 0)
|
||||
{
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 & -9, 4);
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 & -9, 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -209,7 +213,7 @@ public class BlockAutumnLeaves extends BlockLeavesBase
|
|||
private void removeLeaves(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
||||
par1World.setBlock(par2, par3, par4, this.blockID, 0, 2);
|
||||
par1World.setBlock(par2, par3, par4, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,6 +2,9 @@ package tdwp_ftw.biomesop.blocks;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import tdwp_ftw.biomesop.mod_BiomesOPlenty;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -210,7 +213,7 @@ public class BlockBambooLeaves extends BlockLeavesBase
|
|||
private void removeLeaves(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
||||
par1World.setBlock(par2, par3, par4, 0);
|
||||
par1World.setBlockToAir(par2, par3, par4);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,6 +2,9 @@ package tdwp_ftw.biomesop.blocks;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import tdwp_ftw.biomesop.mod_BiomesOPlenty;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
|
@ -49,24 +52,28 @@ public class BlockBlueLeaves extends BlockLeavesBase
|
|||
return blockIcon[(!isOpaqueCube() ? 0 : 1)];
|
||||
}
|
||||
|
||||
/**
|
||||
* ejects contained items into the world, and notifies neighbours of an update, as appropriate
|
||||
*/
|
||||
public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6)
|
||||
{
|
||||
byte b0 = 1;
|
||||
int j1 = b0 + 1;
|
||||
byte var7 = 1;
|
||||
int var8 = var7 + 1;
|
||||
|
||||
if (par1World.checkChunksExist(par2 - j1, par3 - j1, par4 - j1, par2 + j1, par3 + j1, par4 + j1))
|
||||
if (par1World.checkChunksExist(par2 - var8, par3 - var8, par4 - var8, par2 + var8, par3 + var8, par4 + var8))
|
||||
{
|
||||
for (int k1 = -b0; k1 <= b0; ++k1)
|
||||
for (int var9 = -var7; var9 <= var7; ++var9)
|
||||
{
|
||||
for (int l1 = -b0; l1 <= b0; ++l1)
|
||||
for (int var10 = -var7; var10 <= var7; ++var10)
|
||||
{
|
||||
for (int i2 = -b0; i2 <= b0; ++i2)
|
||||
for (int var11 = -var7; var11 <= var7; ++var11)
|
||||
{
|
||||
int j2 = par1World.getBlockId(par2 + k1, par3 + l1, par4 + i2);
|
||||
int var12 = par1World.getBlockId(par2 + var9, par3 + var10, par4 + var11);
|
||||
|
||||
if (Block.blocksList[j2] != null)
|
||||
if (var12 == mod_BiomesOPlenty.blueLeaves.blockID)
|
||||
{
|
||||
Block.blocksList[j2].beginLeavesDecay(par1World, par2 + k1, par3 + l1, par4 + i2);
|
||||
int var13 = par1World.getBlockMetadata(par2 + var9, par3 + var10, par4 + var11);
|
||||
par1World.setBlockMetadataWithNotify(par2 + var9, par3 + var10, par4 + var11, var13 | 8, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -178,7 +185,7 @@ public class BlockBlueLeaves extends BlockLeavesBase
|
|||
|
||||
if (var12 >= 0)
|
||||
{
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 & -9, 4);
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 & -9, 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -205,7 +212,7 @@ public class BlockBlueLeaves extends BlockLeavesBase
|
|||
private void removeLeaves(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
||||
par1World.setBlock(par2, par3, par4, this.blockID, 0, 2);
|
||||
par1World.setBlock(par2, par3, par4, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,6 +9,7 @@ import net.minecraft.block.BlockHalfSlab;
|
|||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
@ -78,6 +79,49 @@ public class BlockCherrySlab extends BlockHalfSlab
|
|||
return new ItemStack(mod_BiomesOPlenty.cherrySingleSlab.blockID, 2, par1 & 7);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID)
|
||||
{
|
||||
|
||||
if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ )
|
||||
{
|
||||
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, mod_BiomesOPlenty.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, mod_BiomesOPlenty.cherryDoubleSlab.blockID);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the slab block name with step type.
|
||||
*/
|
||||
|
|
|
@ -2,6 +2,9 @@ package tdwp_ftw.biomesop.blocks;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import tdwp_ftw.biomesop.mod_BiomesOPlenty;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
|
@ -54,22 +57,23 @@ public class BlockDarkLeaves extends BlockLeavesBase
|
|||
*/
|
||||
public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6)
|
||||
{
|
||||
byte b0 = 1;
|
||||
int j1 = b0 + 1;
|
||||
byte var7 = 1;
|
||||
int var8 = var7 + 1;
|
||||
|
||||
if (par1World.checkChunksExist(par2 - j1, par3 - j1, par4 - j1, par2 + j1, par3 + j1, par4 + j1))
|
||||
if (par1World.checkChunksExist(par2 - var8, par3 - var8, par4 - var8, par2 + var8, par3 + var8, par4 + var8))
|
||||
{
|
||||
for (int k1 = -b0; k1 <= b0; ++k1)
|
||||
for (int var9 = -var7; var9 <= var7; ++var9)
|
||||
{
|
||||
for (int l1 = -b0; l1 <= b0; ++l1)
|
||||
for (int var10 = -var7; var10 <= var7; ++var10)
|
||||
{
|
||||
for (int i2 = -b0; i2 <= b0; ++i2)
|
||||
for (int var11 = -var7; var11 <= var7; ++var11)
|
||||
{
|
||||
int j2 = par1World.getBlockId(par2 + k1, par3 + l1, par4 + i2);
|
||||
int var12 = par1World.getBlockId(par2 + var9, par3 + var10, par4 + var11);
|
||||
|
||||
if (Block.blocksList[j2] != null)
|
||||
if (var12 == mod_BiomesOPlenty.darkLeaves.blockID)
|
||||
{
|
||||
Block.blocksList[j2].beginLeavesDecay(par1World, par2 + k1, par3 + l1, par4 + i2);
|
||||
int var13 = par1World.getBlockMetadata(par2 + var9, par3 + var10, par4 + var11);
|
||||
par1World.setBlockMetadataWithNotify(par2 + var9, par3 + var10, par4 + var11, var13 | 8, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -181,7 +185,7 @@ public class BlockDarkLeaves extends BlockLeavesBase
|
|||
|
||||
if (var12 >= 0)
|
||||
{
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 & -9, 4);
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 & -9, 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -208,7 +212,7 @@ public class BlockDarkLeaves extends BlockLeavesBase
|
|||
private void removeLeaves(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
||||
par1World.setBlock(par2, par3, par4, this.blockID, 0, 2);
|
||||
par1World.setBlock(par2, par3, par4, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,6 +9,7 @@ import net.minecraft.block.BlockHalfSlab;
|
|||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
@ -78,6 +79,49 @@ public class BlockDarkSlab extends BlockHalfSlab
|
|||
return new ItemStack(mod_BiomesOPlenty.darkSingleSlab.blockID, 2, par1 & 7);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID)
|
||||
{
|
||||
|
||||
if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ )
|
||||
{
|
||||
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, mod_BiomesOPlenty.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, mod_BiomesOPlenty.darkDoubleSlab.blockID);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the slab block name with step type.
|
||||
*/
|
||||
|
|
|
@ -2,6 +2,9 @@ package tdwp_ftw.biomesop.blocks;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import tdwp_ftw.biomesop.mod_BiomesOPlenty;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
|
@ -54,22 +57,23 @@ public class BlockDeadLeaves extends BlockLeavesBase
|
|||
*/
|
||||
public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6)
|
||||
{
|
||||
byte b0 = 1;
|
||||
int j1 = b0 + 1;
|
||||
byte var7 = 1;
|
||||
int var8 = var7 + 1;
|
||||
|
||||
if (par1World.checkChunksExist(par2 - j1, par3 - j1, par4 - j1, par2 + j1, par3 + j1, par4 + j1))
|
||||
if (par1World.checkChunksExist(par2 - var8, par3 - var8, par4 - var8, par2 + var8, par3 + var8, par4 + var8))
|
||||
{
|
||||
for (int k1 = -b0; k1 <= b0; ++k1)
|
||||
for (int var9 = -var7; var9 <= var7; ++var9)
|
||||
{
|
||||
for (int l1 = -b0; l1 <= b0; ++l1)
|
||||
for (int var10 = -var7; var10 <= var7; ++var10)
|
||||
{
|
||||
for (int i2 = -b0; i2 <= b0; ++i2)
|
||||
for (int var11 = -var7; var11 <= var7; ++var11)
|
||||
{
|
||||
int j2 = par1World.getBlockId(par2 + k1, par3 + l1, par4 + i2);
|
||||
int var12 = par1World.getBlockId(par2 + var9, par3 + var10, par4 + var11);
|
||||
|
||||
if (Block.blocksList[j2] != null)
|
||||
if (var12 == mod_BiomesOPlenty.deadLeaves.blockID)
|
||||
{
|
||||
Block.blocksList[j2].beginLeavesDecay(par1World, par2 + k1, par3 + l1, par4 + i2);
|
||||
int var13 = par1World.getBlockMetadata(par2 + var9, par3 + var10, par4 + var11);
|
||||
par1World.setBlockMetadataWithNotify(par2 + var9, par3 + var10, par4 + var11, var13 | 8, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -181,7 +185,7 @@ public class BlockDeadLeaves extends BlockLeavesBase
|
|||
|
||||
if (var12 >= 0)
|
||||
{
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 & -9, 4);
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 & -9, 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -208,7 +212,7 @@ public class BlockDeadLeaves extends BlockLeavesBase
|
|||
private void removeLeaves(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
||||
par1World.setBlock(par2, par3, par4, this.blockID);
|
||||
par1World.setBlock(par2, par3, par4, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,6 +2,9 @@ package tdwp_ftw.biomesop.blocks;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import tdwp_ftw.biomesop.mod_BiomesOPlenty;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -208,7 +211,7 @@ public class BlockFirLeaves extends BlockLeavesBase
|
|||
private void removeLeaves(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
||||
par1World.setBlock(par2, par3, par4, 0);
|
||||
par1World.setBlockToAir(par2, par3, par4);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,6 +9,7 @@ import net.minecraft.block.BlockHalfSlab;
|
|||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
@ -80,6 +81,49 @@ public class BlockFirSlab extends BlockHalfSlab
|
|||
return new ItemStack(mod_BiomesOPlenty.firSingleSlab.blockID, 2, par1 & 7);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID)
|
||||
{
|
||||
|
||||
if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ )
|
||||
{
|
||||
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, mod_BiomesOPlenty.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, mod_BiomesOPlenty.firDoubleSlab.blockID);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the slab block name with step type.
|
||||
*/
|
||||
|
|
|
@ -2,6 +2,9 @@ package tdwp_ftw.biomesop.blocks;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import tdwp_ftw.biomesop.mod_BiomesOPlenty;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -208,7 +211,7 @@ public class BlockHolyLeaves extends BlockLeavesBase
|
|||
private void removeLeaves(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
||||
par1World.setBlock(par2, par3, par4, 0);
|
||||
par1World.setBlockToAir(par2, par3, par4);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,6 +9,7 @@ import net.minecraft.block.BlockHalfSlab;
|
|||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
@ -78,6 +79,49 @@ public class BlockHolySlab extends BlockHalfSlab
|
|||
return new ItemStack(mod_BiomesOPlenty.holySingleSlab.blockID, 2, par1 & 7);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID)
|
||||
{
|
||||
|
||||
if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ )
|
||||
{
|
||||
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, mod_BiomesOPlenty.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, mod_BiomesOPlenty.holyDoubleSlab.blockID);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the slab block name with step type.
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package tdwp_ftw.biomesop.blocks;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
import tdwp_ftw.biomesop.mod_BiomesOPlenty;
|
||||
|
||||
|
@ -7,10 +8,12 @@ import net.minecraft.block.Block;
|
|||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.IShearable;
|
||||
|
||||
public class BlockHolyTallGrass extends Block
|
||||
public class BlockHolyTallGrass extends Block implements IShearable
|
||||
{
|
||||
protected BlockHolyTallGrass(int par1, Material par3Material)
|
||||
{
|
||||
|
@ -33,6 +36,14 @@ public class BlockHolyTallGrass extends Block
|
|||
this(par1, Material.plants);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the ID of the items to drop on destruction.
|
||||
*/
|
||||
public int idDropped(int par1, Random par2Random, int par3)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z
|
||||
*/
|
||||
|
@ -118,4 +129,16 @@ public class BlockHolyTallGrass extends Block
|
|||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
public boolean isShearable(ItemStack item, World world, int x, int y, int z)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public ArrayList<ItemStack> onSheared(ItemStack item, World world, int x, int y, int z, int fortune)
|
||||
{
|
||||
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z)));
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import net.minecraft.block.BlockHalfSlab;
|
|||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
@ -77,6 +78,49 @@ public class BlockMagicSlab extends BlockHalfSlab
|
|||
return new ItemStack(mod_BiomesOPlenty.magicSingleSlab.blockID, 2, par1 & 7);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID)
|
||||
{
|
||||
|
||||
if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ )
|
||||
{
|
||||
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, mod_BiomesOPlenty.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, mod_BiomesOPlenty.magicDoubleSlab.blockID);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the slab block name with step type.
|
||||
*/
|
||||
|
|
|
@ -2,6 +2,9 @@ package tdwp_ftw.biomesop.blocks;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import tdwp_ftw.biomesop.mod_BiomesOPlenty;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -248,7 +251,7 @@ public class BlockMangroveLeaves extends BlockLeavesBase
|
|||
private void removeLeaves(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
||||
par1World.setBlock(par2, par3, par4, 0);
|
||||
par1World.setBlockToAir(par2, par3, par4);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,6 +9,7 @@ import net.minecraft.block.BlockHalfSlab;
|
|||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
@ -78,6 +79,49 @@ public class BlockMangroveSlab extends BlockHalfSlab
|
|||
return new ItemStack(mod_BiomesOPlenty.mangroveSingleSlab.blockID, 2, par1 & 7);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID)
|
||||
{
|
||||
|
||||
if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ )
|
||||
{
|
||||
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, mod_BiomesOPlenty.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, mod_BiomesOPlenty.mangroveDoubleSlab.blockID);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the slab block name with step type.
|
||||
*/
|
||||
|
|
|
@ -9,6 +9,7 @@ import net.minecraft.block.BlockHalfSlab;
|
|||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
@ -77,6 +78,49 @@ public class BlockMudBrickSlab extends BlockHalfSlab
|
|||
return new ItemStack(mod_BiomesOPlenty.mudBrickSingleSlab.blockID, 2, par1 & 7);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID)
|
||||
{
|
||||
|
||||
if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ )
|
||||
{
|
||||
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, mod_BiomesOPlenty.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, mod_BiomesOPlenty.mudBrickDoubleSlab.blockID);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the slab block name with step type.
|
||||
*/
|
||||
|
|
|
@ -2,6 +2,9 @@ package tdwp_ftw.biomesop.blocks;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import tdwp_ftw.biomesop.mod_BiomesOPlenty;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -208,7 +211,7 @@ public class BlockOrangeLeaves extends BlockLeavesBase
|
|||
private void removeLeaves(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
||||
par1World.setBlock(par2, par3, par4, 0);
|
||||
par1World.setBlockToAir(par2, par3, par4);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,6 +2,9 @@ package tdwp_ftw.biomesop.blocks;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import tdwp_ftw.biomesop.mod_BiomesOPlenty;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -248,7 +251,7 @@ public class BlockPalmLeaves extends BlockLeavesBase
|
|||
private void removeLeaves(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
||||
par1World.setBlock(par2, par3, par4, 0);
|
||||
par1World.setBlockToAir(par2, par3, par4);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,6 +9,7 @@ import net.minecraft.block.BlockHalfSlab;
|
|||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
@ -78,6 +79,49 @@ public class BlockPalmSlab extends BlockHalfSlab
|
|||
return new ItemStack(mod_BiomesOPlenty.palmSingleSlab.blockID, 2, par1 & 7);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID)
|
||||
{
|
||||
|
||||
if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ )
|
||||
{
|
||||
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, mod_BiomesOPlenty.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, mod_BiomesOPlenty.palmDoubleSlab.blockID);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the slab block name with step type.
|
||||
*/
|
||||
|
|
|
@ -2,6 +2,9 @@ package tdwp_ftw.biomesop.blocks;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import tdwp_ftw.biomesop.mod_BiomesOPlenty;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -208,7 +211,7 @@ public class BlockPinkLeaves extends BlockLeavesBase
|
|||
private void removeLeaves(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
||||
par1World.setBlock(par2, par3, par4, 0);
|
||||
par1World.setBlockToAir(par2, par3, par4);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,6 +2,9 @@ package tdwp_ftw.biomesop.blocks;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import tdwp_ftw.biomesop.mod_BiomesOPlenty;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -208,7 +211,7 @@ public class BlockRedLeaves extends BlockLeavesBase
|
|||
private void removeLeaves(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
||||
par1World.setBlock(par2, par3, par4, 0);
|
||||
par1World.setBlockToAir(par2, par3, par4);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,6 +9,7 @@ import net.minecraft.block.BlockHalfSlab;
|
|||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
@ -77,6 +78,49 @@ public class BlockRedRockBrickSlab extends BlockHalfSlab
|
|||
return new ItemStack(mod_BiomesOPlenty.redRockBrickSingleSlab.blockID, 2, par1 & 7);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID)
|
||||
{
|
||||
|
||||
if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ )
|
||||
{
|
||||
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, mod_BiomesOPlenty.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, mod_BiomesOPlenty.redRockBrickDoubleSlab.blockID);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the slab block name with step type.
|
||||
*/
|
||||
|
|
|
@ -9,6 +9,7 @@ import net.minecraft.block.BlockHalfSlab;
|
|||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
@ -77,6 +78,49 @@ public class BlockRedRockCobbleSlab extends BlockHalfSlab
|
|||
return new ItemStack(mod_BiomesOPlenty.redRockCobbleSingleSlab.blockID, 2, par1 & 7);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID)
|
||||
{
|
||||
|
||||
if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ )
|
||||
{
|
||||
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, mod_BiomesOPlenty.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, mod_BiomesOPlenty.redRockCobbleDoubleSlab.blockID);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the slab block name with step type.
|
||||
*/
|
||||
|
|
|
@ -2,6 +2,9 @@ package tdwp_ftw.biomesop.blocks;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import tdwp_ftw.biomesop.mod_BiomesOPlenty;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -248,7 +251,7 @@ public class BlockRedwoodLeaves extends BlockLeavesBase
|
|||
private void removeLeaves(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
||||
par1World.setBlock(par2, par3, par4, 0);
|
||||
par1World.setBlockToAir(par2, par3, par4);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,6 +9,7 @@ import net.minecraft.block.BlockHalfSlab;
|
|||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
@ -78,6 +79,49 @@ public class BlockRedwoodSlab extends BlockHalfSlab
|
|||
return new ItemStack(mod_BiomesOPlenty.redwoodSingleSlab.blockID, 2, par1 & 7);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID)
|
||||
{
|
||||
|
||||
if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ )
|
||||
{
|
||||
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, mod_BiomesOPlenty.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, mod_BiomesOPlenty.redwoodDoubleSlab.blockID);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the slab block name with step type.
|
||||
*/
|
||||
|
|
|
@ -2,6 +2,9 @@ package tdwp_ftw.biomesop.blocks;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import tdwp_ftw.biomesop.mod_BiomesOPlenty;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -208,7 +211,7 @@ public class BlockWhiteLeaves extends BlockLeavesBase
|
|||
private void removeLeaves(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
||||
par1World.setBlock(par2, par3, par4, 0);
|
||||
par1World.setBlockToAir(par2, par3, par4);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,6 +2,9 @@ package tdwp_ftw.biomesop.blocks;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import tdwp_ftw.biomesop.mod_BiomesOPlenty;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -248,7 +251,7 @@ public class BlockWillowLeaves extends BlockLeavesBase
|
|||
private void removeLeaves(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
||||
par1World.setBlock(par2, par3, par4, 0);
|
||||
par1World.setBlockToAir(par2, par3, par4);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,6 +9,7 @@ import net.minecraft.block.BlockHalfSlab;
|
|||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
@ -79,6 +80,49 @@ public class BlockWillowSlab extends BlockHalfSlab
|
|||
return new ItemStack(mod_BiomesOPlenty.willowSingleSlab.blockID, 2, par1 & 7);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
if (par5EntityPlayer.getCurrentEquippedItem().itemID == this.blockID)
|
||||
{
|
||||
|
||||
if (world.getBlockMetadata(par2, par3, par4) == 0 /*0 = Slab at bottom half*/ )
|
||||
{
|
||||
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, mod_BiomesOPlenty.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, mod_BiomesOPlenty.willowDoubleSlab.blockID);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the slab block name with step type.
|
||||
*/
|
||||
|
|
|
@ -17,9 +17,13 @@ import tdwp_ftw.biomesop.blocks.BlockDarkSapling;
|
|||
import tdwp_ftw.biomesop.blocks.BlockMagicSapling;
|
||||
import tdwp_ftw.biomesop.blocks.BlockMangroveSapling;
|
||||
import tdwp_ftw.biomesop.blocks.BlockAcaciaSapling;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockSapling;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
import net.minecraftforge.event.ForgeSubscribe;
|
||||
import net.minecraftforge.event.Event.Result;
|
||||
import net.minecraftforge.event.entity.player.BonemealEvent;
|
||||
|
||||
public class BonemealUse
|
||||
|
@ -28,132 +32,242 @@ public class BonemealUse
|
|||
@ForgeSubscribe
|
||||
public void onUseBonemeal(BonemealEvent event)
|
||||
{
|
||||
|
||||
if (event.ID == mod_BiomesOPlenty.firSapling.blockID)
|
||||
{
|
||||
event.setResult(Result.ALLOW);
|
||||
|
||||
if (!event.world.isRemote)
|
||||
{
|
||||
if ((double)event.world.rand.nextFloat() < 0.45D)
|
||||
{
|
||||
((BlockFirSapling)mod_BiomesOPlenty.firSapling).growTree(event.world, event.X, event.Y, event.Z, event.world.rand);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (event.ID == mod_BiomesOPlenty.redwoodSapling.blockID)
|
||||
{
|
||||
event.setResult(Result.ALLOW);
|
||||
|
||||
if (!event.world.isRemote)
|
||||
{
|
||||
if ((double)event.world.rand.nextFloat() < 0.45D)
|
||||
{
|
||||
((BlockRedwoodSapling)mod_BiomesOPlenty.redwoodSapling).growTree(event.world, event.X, event.Y, event.Z, event.world.rand);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (event.ID == mod_BiomesOPlenty.palmSapling.blockID)
|
||||
{
|
||||
event.setResult(Result.ALLOW);
|
||||
|
||||
if (!event.world.isRemote)
|
||||
{
|
||||
if ((double)event.world.rand.nextFloat() < 0.45D)
|
||||
{
|
||||
((BlockPalmSapling)mod_BiomesOPlenty.palmSapling).growTree(event.world, event.X, event.Y, event.Z, event.world.rand);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (event.ID == mod_BiomesOPlenty.redSapling.blockID)
|
||||
{
|
||||
event.setResult(Result.ALLOW);
|
||||
|
||||
if (!event.world.isRemote)
|
||||
{
|
||||
if ((double)event.world.rand.nextFloat() < 0.45D)
|
||||
{
|
||||
((BlockRedSapling)mod_BiomesOPlenty.redSapling).growTree(event.world, event.X, event.Y, event.Z, event.world.rand);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (event.ID == mod_BiomesOPlenty.orangeSapling.blockID)
|
||||
{
|
||||
event.setResult(Result.ALLOW);
|
||||
|
||||
if (!event.world.isRemote)
|
||||
{
|
||||
if ((double)event.world.rand.nextFloat() < 0.45D)
|
||||
{
|
||||
((BlockOrangeSapling)mod_BiomesOPlenty.orangeSapling).growTree(event.world, event.X, event.Y, event.Z, event.world.rand);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (event.ID == mod_BiomesOPlenty.yellowSapling.blockID)
|
||||
{
|
||||
event.setResult(Result.ALLOW);
|
||||
|
||||
if (!event.world.isRemote)
|
||||
{
|
||||
if ((double)event.world.rand.nextFloat() < 0.45D)
|
||||
{
|
||||
((BlockYellowSapling)mod_BiomesOPlenty.yellowSapling).growTree(event.world, event.X, event.Y, event.Z, event.world.rand);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (event.ID == mod_BiomesOPlenty.brownSapling.blockID)
|
||||
{
|
||||
event.setResult(Result.ALLOW);
|
||||
|
||||
if (!event.world.isRemote)
|
||||
{
|
||||
if ((double)event.world.rand.nextFloat() < 0.45D)
|
||||
{
|
||||
((BlockBrownSapling)mod_BiomesOPlenty.brownSapling).growTree(event.world, event.X, event.Y, event.Z, event.world.rand);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (event.ID == mod_BiomesOPlenty.willowSapling.blockID)
|
||||
{
|
||||
event.setResult(Result.ALLOW);
|
||||
|
||||
if (!event.world.isRemote)
|
||||
{
|
||||
if ((double)event.world.rand.nextFloat() < 0.45D)
|
||||
{
|
||||
((BlockWillowSapling)mod_BiomesOPlenty.willowSapling).growTree(event.world, event.X, event.Y, event.Z, event.world.rand);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (event.ID == mod_BiomesOPlenty.appleSapling.blockID)
|
||||
{
|
||||
event.setResult(Result.ALLOW);
|
||||
|
||||
if (!event.world.isRemote)
|
||||
{
|
||||
if ((double)event.world.rand.nextFloat() < 0.45D)
|
||||
{
|
||||
((BlockAppleSapling)mod_BiomesOPlenty.appleSapling).growTree(event.world, event.X, event.Y, event.Z, event.world.rand);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (event.ID == mod_BiomesOPlenty.originSapling.blockID)
|
||||
{
|
||||
if (!event.world.isRemote)
|
||||
{
|
||||
if ((double)event.world.rand.nextFloat() < 0.45D)
|
||||
{
|
||||
((BlockOriginSapling)mod_BiomesOPlenty.originSapling).growTree(event.world, event.X, event.Y, event.Z, event.world.rand);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (event.ID == mod_BiomesOPlenty.pinkSapling.blockID)
|
||||
{
|
||||
event.setResult(Result.ALLOW);
|
||||
|
||||
if (!event.world.isRemote)
|
||||
{
|
||||
if ((double)event.world.rand.nextFloat() < 0.45D)
|
||||
{
|
||||
((BlockPinkSapling)mod_BiomesOPlenty.pinkSapling).growTree(event.world, event.X, event.Y, event.Z, event.world.rand);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (event.ID == mod_BiomesOPlenty.whiteSapling.blockID)
|
||||
{
|
||||
event.setResult(Result.ALLOW);
|
||||
|
||||
if (!event.world.isRemote)
|
||||
{
|
||||
if ((double)event.world.rand.nextFloat() < 0.45D)
|
||||
{
|
||||
((BlockWhiteSapling)mod_BiomesOPlenty.whiteSapling).growTree(event.world, event.X, event.Y, event.Z, event.world.rand);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (event.ID == mod_BiomesOPlenty.darkSapling.blockID)
|
||||
{
|
||||
event.setResult(Result.ALLOW);
|
||||
|
||||
if (!event.world.isRemote)
|
||||
{
|
||||
if ((double)event.world.rand.nextFloat() < 0.45D)
|
||||
{
|
||||
((BlockDarkSapling)mod_BiomesOPlenty.darkSapling).growTree(event.world, event.X, event.Y, event.Z, event.world.rand);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (event.ID == mod_BiomesOPlenty.magicSapling.blockID)
|
||||
{
|
||||
event.setResult(Result.ALLOW);
|
||||
|
||||
if (!event.world.isRemote)
|
||||
{
|
||||
((BlockMagicSapling)mod_BiomesOPlenty.magicSapling).growTree(event.world, event.X, event.Y, event.Z, event.world.rand);
|
||||
if ((double)event.world.rand.nextFloat() < 0.45D)
|
||||
{
|
||||
((BlockMagicSapling)mod_BiomesOPlenty.magicSapling).func_96477_c(event.world, event.X, event.Y, event.Z, event.world.rand);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (event.ID == mod_BiomesOPlenty.mangroveSapling.blockID)
|
||||
{
|
||||
event.setResult(Result.ALLOW);
|
||||
|
||||
if (!event.world.isRemote)
|
||||
{
|
||||
if ((double)event.world.rand.nextFloat() < 0.45D)
|
||||
{
|
||||
((BlockMangroveSapling)mod_BiomesOPlenty.mangroveSapling).growTree(event.world, event.X, event.Y, event.Z, event.world.rand);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (event.ID == mod_BiomesOPlenty.acaciaSapling.blockID)
|
||||
{
|
||||
event.setResult(Result.ALLOW);
|
||||
|
||||
if (!event.world.isRemote)
|
||||
{
|
||||
if ((double)event.world.rand.nextFloat() < 0.45D)
|
||||
{
|
||||
((BlockAcaciaSapling)mod_BiomesOPlenty.acaciaSapling).growTree(event.world, event.X, event.Y, event.Z, event.world.rand);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (event.ID == mod_BiomesOPlenty.holyGrass.blockID)
|
||||
{
|
||||
int var13 = event.X;
|
||||
int var14 = event.Y + 1;
|
||||
int var15 = event.Z;
|
||||
|
||||
for (int i1 = 0; i1 < 128; ++i1)
|
||||
{
|
||||
|
||||
for (int i2 = 0; i2 < i1 / 16; ++i2)
|
||||
{
|
||||
var13 += event.world.rand.nextInt(3) - 1;
|
||||
var14 += (event.world.rand.nextInt(3) - 1) * event.world.rand.nextInt(3) / 2;
|
||||
var15 += event.world.rand.nextInt(3) - 1;
|
||||
}
|
||||
|
||||
if (event.world.getBlockId(var13, var14, var15) == 0)
|
||||
{
|
||||
if (mod_BiomesOPlenty.holyTallGrass.canBlockStay(event.world, var13, var14, var15))
|
||||
{
|
||||
event.setResult(Result.ALLOW);
|
||||
|
||||
if (!event.world.isRemote)
|
||||
{
|
||||
event.world.setBlock(var13, var14, var15, mod_BiomesOPlenty.holyTallGrass.blockID, 0, 0x02);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.item.EnumArmorMaterial;
|
||||
import net.minecraft.item.EnumToolMaterial;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemSlab;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.util.WeightedRandomChestContent;
|
||||
|
@ -508,14 +509,14 @@ public class mod_BiomesOPlenty
|
|||
mediumGrass = (BlockMediumGrass)(new BlockMediumGrass(mediumGrassID)).setHardness(0.0F).setStepSound(Block.soundGrassFootstep).setUnlocalizedName("mediumGrass");
|
||||
duneGrass = (new BlockDuneGrass(duneGrassID)).setHardness(0.0F).setStepSound(Block.soundGrassFootstep).setUnlocalizedName("duneGrass");
|
||||
desertSprouts = (new BlockDesertSprouts(desertSproutsID)).setHardness(0.0F).setStepSound(Block.soundGrassFootstep).setUnlocalizedName("desertSprouts");
|
||||
redRockCobbleDoubleSlab = (BlockHalfSlab)(new BlockRedRockCobbleSlab(redRockCobbleDoubleSlabID, true)).setHardness(1.6F).setResistance(7.5F).setStepSound(Block.soundWoodFootstep).setUnlocalizedName("redRockCobbleSlab");
|
||||
redRockCobbleSingleSlab = (BlockHalfSlab)(new BlockRedRockCobbleSlab(redRockCobbleSingleSlabID, false)).setHardness(1.6F).setResistance(7.5F).setStepSound(Block.soundWoodFootstep).setUnlocalizedName("redRockCobbleSlab");
|
||||
redRockCobbleDoubleSlab = (BlockHalfSlab)(new BlockRedRockCobbleSlab(redRockCobbleDoubleSlabID, true)).setHardness(1.6F).setResistance(7.5F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("redRockCobbleSlab");
|
||||
redRockCobbleSingleSlab = (BlockHalfSlab)(new BlockRedRockCobbleSlab(redRockCobbleSingleSlabID, false)).setHardness(1.6F).setResistance(7.5F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("redRockCobbleSlab");
|
||||
redRockCobbleStairs = (new BlockRedRockCobbleStairs(redRockCobbleStairsID, redRockCobble)).setUnlocalizedName("redRockCobbleStairs");
|
||||
redRockBrickDoubleSlab = (BlockHalfSlab)(new BlockRedRockBrickSlab(redRockBrickDoubleSlabID, true)).setHardness(1.1F).setResistance(7.0F).setStepSound(Block.soundWoodFootstep).setUnlocalizedName("redRockBrickSlab");
|
||||
redRockBrickSingleSlab = (BlockHalfSlab)(new BlockRedRockBrickSlab(redRockBrickSingleSlabID, false)).setHardness(1.1F).setResistance(7.0F).setStepSound(Block.soundWoodFootstep).setUnlocalizedName("redRockBrickSlab");
|
||||
redRockBrickDoubleSlab = (BlockHalfSlab)(new BlockRedRockBrickSlab(redRockBrickDoubleSlabID, true)).setHardness(1.1F).setResistance(7.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("redRockBrickSlab");
|
||||
redRockBrickSingleSlab = (BlockHalfSlab)(new BlockRedRockBrickSlab(redRockBrickSingleSlabID, false)).setHardness(1.1F).setResistance(7.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("redRockBrickSlab");
|
||||
redRockBrickStairs = (new BlockRedRockBrickStairs(redRockBrickStairsID, redRockBrick)).setUnlocalizedName("redRockBrickStairs");
|
||||
mudBrickDoubleSlab = (BlockHalfSlab)(new BlockMudBrickSlab(mudBrickDoubleSlabID, true)).setHardness(1.0F).setResistance(2.0F).setStepSound(Block.soundWoodFootstep).setUnlocalizedName("mudBrickSlab");
|
||||
mudBrickSingleSlab = (BlockHalfSlab)(new BlockMudBrickSlab(mudBrickSingleSlabID, false)).setHardness(1.0F).setResistance(2.0F).setStepSound(Block.soundWoodFootstep).setUnlocalizedName("mudBrickSlab");
|
||||
mudBrickDoubleSlab = (BlockHalfSlab)(new BlockMudBrickSlab(mudBrickDoubleSlabID, true)).setHardness(1.0F).setResistance(2.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("mudBrickSlab");
|
||||
mudBrickSingleSlab = (BlockHalfSlab)(new BlockMudBrickSlab(mudBrickSingleSlabID, false)).setHardness(1.0F).setResistance(2.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("mudBrickSlab");
|
||||
mudBrickStairs = (new BlockMudBrickStairs(mudBrickStairsID, mudBrickBlock)).setUnlocalizedName("mudBrickStairs");
|
||||
mangroveSapling = (new BlockMangroveSapling(mangroveSaplingID)).setHardness(0.0F).setStepSound(Block.soundGrassFootstep).setUnlocalizedName("mangroveSapling");
|
||||
hardSand = (new BlockHardSand(hardSandID)).setHardness(0.7F).setStepSound(Block.soundSandFootstep).setUnlocalizedName("hardSand");
|
||||
|
|
Loading…
Reference in a new issue