This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site.
package net.minecraft.src; import java.util.Random; import java.util.List; public class BlockCustomPlate extends BlockContainer { public BlockCustomPlate(int i) { super(i, Material.wood); } public int tickRate() { return 20; } public TileEntity createNewTileEntity(World w) { return new TileEntityRecordingPlate(); } public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 6 * (1F / 16F), 1.0F); } public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { return null; } public boolean isOpaqueCube() { return false; } public boolean renderAsNormalBlock() { return false; } public int getRenderType() { return -1; } public void updateTick(World w, int i, int j, int k, Random carl) { int metadata = w.getBlockMetadata(i, j, k); List players = w.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(i, j, k, i + 1, j + 1, k + 1)); if(!players.isEmpty()) { w.setBlockMetadataWithNotify(i, j, k, 1); }else{ w.setBlockMetadataWithNotify(i, j, k, 0); } if(metadata != w.getBlockMetadata(i, j, k)) { w.playSoundEffect((double)i + 0.5D, (double)j + 0.1D, (double)k + 0.5D, "random.click", 0.3F, 0.6F); } Position p = new Position(i, j, k); Position[] neighbors = p.getNeighbors(w, new int[] {mod_CustomPad.CustomWire.blockID}); for(Position current: neighbors) { BlockCustomWire t = (BlockTimeWire)Block.blocksList[w.getBlockId(current.x, current.y, current.z)]; t.updateWire(w, current.x, current.y, current.z); } } }
Don worry about the end stuff, the problem is that the sound doesnt play when im standing in it.