Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
at develop 562 lines 24 kB view raw
1package net.minecraft.server; 2 3import com.legacyminecraft.poseidon.PoseidonConfig; 4import uk.betacraft.uberbukkit.UberbukkitConfig; 5 6import java.util.ArrayList; 7import java.util.Arrays; 8import java.util.List; 9import java.util.Optional; 10import java.util.Random; 11 12public class Block { 13 14 public static final StepSound d = new StepSound("stone", 1.0F, 1.0F); 15 public static final StepSound e = new StepSound("wood", 1.0F, 1.0F); 16 public static final StepSound f = new StepSound("gravel", 1.0F, 1.0F); 17 public static final StepSound g = new StepSound("grass", 1.0F, 1.0F); 18 public static final StepSound h = new StepSound("stone", 1.0F, 1.0F); 19 public static final StepSound i = new StepSound("stone", 1.0F, 1.5F); 20 public static final StepSound j = new StepSoundStone("stone", 1.0F, 1.0F); 21 public static final StepSound k = new StepSound("cloth", 1.0F, 1.0F); 22 public static final StepSound l = new StepSoundSand("sand", 1.0F, 1.0F); 23 public static final Block[] byId = new Block[256]; 24 public static final boolean[] n = new boolean[256]; 25 public static final boolean[] o = new boolean[256]; 26 public static final boolean[] isTileEntity = new boolean[256]; 27 public static final int[] q = new int[256]; 28 public static final boolean[] r = new boolean[256]; 29 public static final int[] s = new int[256]; 30 public static final boolean[] t = new boolean[256]; 31 public static final Block STONE = (new BlockStone(1, 1)).c(1.5F).b(10.0F).a(h).a("stone"); 32 public static final BlockGrass GRASS = (BlockGrass) (new BlockGrass(2)).c(0.6F).a(g).a("grass"); 33 public static final Block DIRT = (new BlockDirt(3, 2)).c(0.5F).a(f).a("dirt"); 34 public static final Block COBBLESTONE = (new Block(4, 16, Material.STONE)).c(2.0F).b(10.0F).a(h).a("stonebrick"); 35 public static final Block WOOD = (new Block(5, 4, Material.WOOD)).c(2.0F).b(5.0F).a(e).a("wood").g(); 36 public static final Block SAPLING = (new BlockSapling(6, 15)).c(0.0F).a(g).a("sapling").g(); 37 public static final Block BEDROCK = (new Block(7, 17, Material.STONE)).i().b(6000000.0F).a(h).a("bedrock").n(); 38 public static final Block WATER = (new BlockFlowing(8, Material.WATER)).c(100.0F).f(3).a("water").n().g(); 39 public static final Block STATIONARY_WATER = (new BlockStationary(9, Material.WATER)).c(100.0F).f(3).a("water").n().g(); 40 public static final Block LAVA = (new BlockFlowing(10, Material.LAVA)).c(0.0F).a(1.0F).f(255).a("lava").n().g(); 41 public static final Block STATIONARY_LAVA = (new BlockStationary(11, Material.LAVA)).c(100.0F).a(1.0F).f(255).a("lava").n().g(); 42 public static final Block SAND = (new BlockSand(12, 18)).c(0.5F).a(l).a("sand"); 43 public static final Block GRAVEL = (new BlockGravel(13, 19)).c(0.6F).a(f).a("gravel"); 44 public static final Block GOLD_ORE = (new BlockOre(14, 32)).c(3.0F).b(5.0F).a(h).a("oreGold"); 45 public static final Block IRON_ORE = (new BlockOre(15, 33)).c(3.0F).b(5.0F).a(h).a("oreIron"); 46 public static final Block COAL_ORE = (new BlockOre(16, 34)).c(3.0F).b(5.0F).a(h).a("oreCoal"); 47 public static final Block LOG = (new BlockLog(17)).c(2.0F).a(e).a("log").g(); 48 public static final BlockLeaves LEAVES = (BlockLeaves) (new BlockLeaves(18, 52)).c(0.2F).f(1).a(g).a("leaves").n().g(); 49 public static final Block SPONGE = (new BlockSponge(19)).c(0.6F).a(g).a("sponge"); 50 public static final Block GLASS = (new BlockGlass(20, 49, Material.SHATTERABLE, false)).c(0.3F).a(j).a("glass"); 51 public static final Block LAPIS_ORE = (new BlockOre(21, 160)).c(3.0F).b(5.0F).a(h).a("oreLapis"); 52 public static final Block LAPIS_BLOCK = (new Block(22, 144, Material.STONE)).c(3.0F).b(5.0F).a(h).a("blockLapis"); 53 public static final Block DISPENSER = (new BlockDispenser(23)).c(3.5F).a(h).a("dispenser").g(); 54 public static final Block SANDSTONE = (new BlockSandStone(24)).a(h).c(0.8F).a("sandStone"); 55 public static final Block NOTE_BLOCK = (new BlockNote(25)).c(0.8F).a("musicBlock").g(); 56 public static final Block BED = (new BlockBed(26)).c(0.2F).a("bed").n().g(); 57 public static final Block GOLDEN_RAIL = (new BlockMinecartTrack(27, 179, true)).c(0.7F).a(i).a("goldenRail").g(); 58 public static final Block DETECTOR_RAIL = (new BlockMinecartDetector(28, 195)).c(0.7F).a(i).a("detectorRail").g(); 59 public static final Block PISTON_STICKY = (new BlockPiston(29, 106, true)).a("pistonStickyBase").g(); 60 public static final Block WEB = (new BlockWeb(30, 11)).f(1).c(4.0F).a("web"); 61 public static final BlockLongGrass LONG_GRASS = (BlockLongGrass) (new BlockLongGrass(31, 39)).c(0.0F).a(g).a("tallgrass"); 62 public static final BlockDeadBush DEAD_BUSH = (BlockDeadBush) (new BlockDeadBush(32, 55)).c(0.0F).a(g).a("deadbush"); 63 public static final Block PISTON = (new BlockPiston(33, 107, false)).a("pistonBase").g(); 64 public static final BlockPistonExtension PISTON_EXTENSION = (BlockPistonExtension) (new BlockPistonExtension(34, 107)).g(); 65 public static final Block WOOL = (new BlockCloth()).c(0.8F).a(k).a("cloth").g(); 66 public static final BlockPistonMoving PISTON_MOVING = new BlockPistonMoving(36); 67 public static final BlockFlower YELLOW_FLOWER = (BlockFlower) (new BlockFlower(37, 13)).c(0.0F).a(g).a("flower"); 68 public static final BlockFlower RED_ROSE = (BlockFlower) (new BlockFlower(38, 12)).c(0.0F).a(g).a("rose"); 69 public static final BlockFlower BROWN_MUSHROOM = (BlockFlower) (new BlockMushroom(39, 29)).c(0.0F).a(g).a(0.125F).a("mushroom"); 70 public static final BlockFlower RED_MUSHROOM = (BlockFlower) (new BlockMushroom(40, 28)).c(0.0F).a(g).a("mushroom"); 71 public static final Block GOLD_BLOCK = (new BlockOreBlock(41, 23)).c(3.0F).b(10.0F).a(i).a("blockGold"); 72 public static final Block IRON_BLOCK = (new BlockOreBlock(42, 22)).c(5.0F).b(10.0F).a(i).a("blockIron"); 73 public static final Block DOUBLE_STEP = (new BlockStep(43, true)).c(2.0F).b(10.0F).a(h).a("stoneSlab"); 74 public static final Block STEP = (new BlockStep(44, false)).c(2.0F).b(10.0F).a(h).a("stoneSlab"); 75 public static final Block BRICK = (new Block(45, 7, Material.STONE)).c(2.0F).b(10.0F).a(h).a("brick"); 76 public static final Block TNT = (new BlockTNT(46, 8)).c(0.0F).a(g).a("tnt"); 77 public static final Block BOOKSHELF = (new BlockBookshelf(47, 35)).c(1.5F).a(e).a("bookshelf"); 78 public static final Block MOSSY_COBBLESTONE = (new Block(48, 36, Material.STONE)).c(2.0F).b(10.0F).a(h).a("stoneMoss"); 79 public static final Block OBSIDIAN = (new BlockObsidian(49, 37)).c(10.0F).b(2000.0F).a(h).a("obsidian"); 80 public static final Block TORCH = (new BlockTorch(50, 80)).c(0.0F).a(0.9375F).a(e).a("torch").g(); 81 public static final BlockFire FIRE = (BlockFire) (new BlockFire(51, 31)).c(0.0F).a(1.0F).a(e).a("fire").n().g(); 82 public static final Block MOB_SPAWNER = (new BlockMobSpawner(52, 65)).c(5.0F).a(i).a("mobSpawner").n(); 83 public static final Block WOOD_STAIRS = (new BlockStairs(53, WOOD)).a("stairsWood").g(); 84 public static final Block CHEST = (new BlockChest(54)).c(2.5F).a(e).a("chest").g(); 85 public static final Block REDSTONE_WIRE = (new BlockRedstoneWire(55, 164)).c(0.0F).a(d).a("redstoneDust").n().g(); 86 public static final Block DIAMOND_ORE = (new BlockOre(56, 50)).c(3.0F).b(5.0F).a(h).a("oreDiamond"); 87 public static final Block DIAMOND_BLOCK = (new BlockOreBlock(57, 24)).c(5.0F).b(10.0F).a(i).a("blockDiamond"); 88 public static final Block WORKBENCH = (new BlockWorkbench(58)).c(2.5F).a(e).a("workbench"); 89 public static final Block CROPS = (new BlockCrops(59, 88)).c(0.0F).a(g).a("crops").n().g(); 90 public static final Block SOIL = (new BlockSoil(60)).c(0.6F).a(f).a("farmland"); 91 public static final Block FURNACE = (new BlockFurnace(61, false)).c(3.5F).a(h).a("furnace").g(); 92 public static final Block BURNING_FURNACE = (new BlockFurnace(62, true)).c(3.5F).a(h).a(0.875F).a("furnace").g(); 93 public static final Block SIGN_POST = (new BlockSign(63, TileEntitySign.class, true)).c(1.0F).a(e).a("sign").n().g(); 94 public static final Block WOODEN_DOOR = (new BlockDoor(64, Material.WOOD)).c(3.0F).a(e).a("doorWood").n().g(); 95 public static final Block LADDER = (new BlockLadder(65, 83)).c(0.4F).a(e).a("ladder").g(); 96 public static final Block RAILS = (new BlockMinecartTrack(66, 128, false)).c(0.7F).a(i).a("rail").g(); 97 public static final Block COBBLESTONE_STAIRS = (new BlockStairs(67, COBBLESTONE)).a("stairsStone").g(); 98 public static final Block WALL_SIGN = (new BlockSign(68, TileEntitySign.class, false)).c(1.0F).a(e).a("sign").n().g(); 99 public static final Block LEVER = (new BlockLever(69, 96)).c(0.5F).a(e).a("lever").g(); 100 public static final Block STONE_PLATE = (new BlockPressurePlate(70, STONE.textureId, EnumMobType.MOBS, Material.STONE)).c(0.5F).a(h).a("pressurePlate").g(); 101 public static final Block IRON_DOOR_BLOCK = (new BlockDoor(71, Material.ORE)).c(5.0F).a(i).a("doorIron").n().g(); 102 public static final Block WOOD_PLATE = (new BlockPressurePlate(72, WOOD.textureId, EnumMobType.EVERYTHING, Material.WOOD)).c(0.5F).a(e).a("pressurePlate").g(); 103 public static final Block REDSTONE_ORE = (new BlockRedstoneOre(73, 51, false)).c(3.0F).b(5.0F).a(h).a("oreRedstone").g(); 104 public static final Block GLOWING_REDSTONE_ORE = (new BlockRedstoneOre(74, 51, true)).a(0.625F).c(3.0F).b(5.0F).a(h).a("oreRedstone").g(); 105 public static final Block REDSTONE_TORCH_OFF = (new BlockRedstoneTorch(75, 115, false)).c(0.0F).a(e).a("notGate").g(); 106 public static final Block REDSTONE_TORCH_ON = (new BlockRedstoneTorch(76, 99, true)).c(0.0F).a(0.5F).a(e).a("notGate").g(); 107 public static final Block STONE_BUTTON = (new BlockButton(77, STONE.textureId)).c(0.5F).a(h).a("button").g(); 108 public static final Block SNOW = (new BlockSnow(78, 66)).c(0.1F).a(k).a("snow"); 109 public static final Block ICE = (new BlockIce(79, 67)).c(0.5F).f(3).a(j).a("ice"); 110 public static final Block SNOW_BLOCK = (new BlockSnowBlock(80, 66)).c(0.2F).a(k).a("snow"); 111 public static final Block CACTUS = (new BlockCactus(81, 70)).c(0.4F).a(k).a("cactus"); 112 public static final Block CLAY = (new BlockClay(82, 72)).c(0.6F).a(f).a("clay"); 113 public static final Block SUGAR_CANE_BLOCK = (new BlockReed(83, 73)).c(0.0F).a(g).a("reeds").n(); 114 public static final Block JUKEBOX = (new BlockJukeBox(84, 74)).c(2.0F).b(10.0F).a(h).a("jukebox").g(); 115 public static final Block FENCE = (new BlockFence(85, 4)).c(2.0F).b(5.0F).a(e).a("fence").g(); 116 public static final Block PUMPKIN = (new BlockPumpkin(86, 102, false)).c(1.0F).a(e).a("pumpkin").g(); 117 public static final Block NETHERRACK = (new BlockBloodStone(87, 103)).c(0.4F).a(h).a("hellrock"); 118 public static final Block SOUL_SAND = (new BlockSlowSand(88, 104)).c(0.5F).a(l).a("hellsand"); 119 // uberbukkit 120 public static final Block GLOWSTONE = !UberbukkitConfig.getInstance().getBoolean("mechanics.glowstone_pre1_6_6", false) ? (new BlockLightStone(89, 105, Material.STONE)).c(0.3F).a(j).a(1.0F).a("lightgem") : (new BlockLightStone(89, 105, Material.SHATTERABLE)).c(0.3F).a(j).a(1.0F).a("lightgem"); 121 public static final BlockPortal PORTAL = (BlockPortal) (new BlockPortal(90, 14)).c(-1.0F).a(j).a(0.75F).a("portal"); 122 public static final Block JACK_O_LANTERN = (new BlockPumpkin(91, 102, true)).c(1.0F).a(e).a(1.0F).a("litpumpkin").g(); 123 public static final Block CAKE_BLOCK = (new BlockCake(92, 121)).c(0.5F).a(k).a("cake").n().g(); 124 public static final Block DIODE_OFF = (new BlockDiode(93, false)).c(0.0F).a(e).a("diode").n().g(); 125 public static final Block DIODE_ON = (new BlockDiode(94, true)).c(0.0F).a(0.625F).a(e).a("diode").n().g(); 126 // uberbukkit 127 public static final Block LOCKED_CHEST = !UberbukkitConfig.getInstance().getBoolean("worldgen.generate_steveco_chests", false) ? (new BlockLockedChest(95)).c(0.0F).a(1.0F).a(e).a("lockedchest").a(true).g() : (new BlockLockedChest(95)).c(-1.0F).a(1.0F).a(e).a("lockedchest").g(); 128 public static final Block TRAP_DOOR = (new BlockTrapdoor(96, Material.WOOD)).c(3.0F).a(e).a("trapdoor").n().g(); 129 public static final List<Integer> leafDecayBlacklist = Arrays.asList(PoseidonConfig.getInstance().getTreeBlacklistIDs()); 130 public int textureId; 131 public final int id; 132 protected float strength; 133 protected float durability; 134 protected boolean bq; 135 protected boolean br; 136 public double minX; 137 public double minY; 138 public double minZ; 139 public double maxX; 140 public double maxY; 141 public double maxZ; 142 public StepSound stepSound; 143 public float bz; 144 public final Material material; 145 public float frictionFactor; 146 private String name; 147 148 protected Block(int i, Material material) { 149 this.bq = true; 150 this.br = true; 151 this.stepSound = d; 152 this.bz = 1.0F; 153 this.frictionFactor = 0.6F; 154 if (byId[i] != null) { 155 throw new IllegalArgumentException("Slot " + i + " is already occupied by " + byId[i] + " when adding " + this); 156 } else { 157 this.material = material; 158 byId[i] = this; 159 this.id = i; 160 this.a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); 161 o[i] = this.a(); 162 q[i] = this.a() ? 255 : 0; 163 r[i] = !material.blocksLight(); 164 isTileEntity[i] = false; 165 } 166 } 167 168 protected Block g() { 169 t[this.id] = true; 170 return this; 171 } 172 173 protected void h() { 174 } 175 176 protected Block(int i, int j, Material material) { 177 this(i, material); 178 this.textureId = j; 179 } 180 181 protected Block a(StepSound stepsound) { 182 this.stepSound = stepsound; 183 return this; 184 } 185 186 protected Block f(int i) { 187 q[this.id] = i; 188 return this; 189 } 190 191 protected Block a(float f) { 192 s[this.id] = (int) (15.0F * f); 193 return this; 194 } 195 196 protected Block b(float f) { 197 this.durability = f * 3.0F; 198 return this; 199 } 200 201 public boolean b() { 202 return true; 203 } 204 205 protected Block c(float f) { 206 this.strength = f; 207 if (this.durability < f * 5.0F) { 208 this.durability = f * 5.0F; 209 } 210 211 return this; 212 } 213 214 protected Block i() { 215 this.c(-1.0F); 216 return this; 217 } 218 219 public float j() { 220 return this.strength; 221 } 222 223 protected Block a(boolean flag) { 224 n[this.id] = flag; 225 return this; 226 } 227 228 public void a(float f, float f1, float f2, float f3, float f4, float f5) { 229 this.minX = (double) f; 230 this.minY = (double) f1; 231 this.minZ = (double) f2; 232 this.maxX = (double) f3; 233 this.maxY = (double) f4; 234 this.maxZ = (double) f5; 235 } 236 237 public boolean b(IBlockAccess iblockaccess, int i, int j, int k, int l) { 238 return iblockaccess.getMaterial(i, j, k).isBuildable(); 239 } 240 241 public int a(int i, int j) { 242 return this.a(i); 243 } 244 245 public int a(int i) { 246 return this.textureId; 247 } 248 249 public void a(World world, int i, int j, int k, AxisAlignedBB axisalignedbb, ArrayList arraylist) { 250 AxisAlignedBB axisalignedbb1 = this.e(world, i, j, k); 251 252 if (axisalignedbb1 != null && axisalignedbb.a(axisalignedbb1)) { 253 arraylist.add(axisalignedbb1); 254 } 255 } 256 257 public AxisAlignedBB e(World world, int i, int j, int k) { 258 return AxisAlignedBB.b((double) i + this.minX, (double) j + this.minY, (double) k + this.minZ, (double) i + this.maxX, (double) j + this.maxY, (double) k + this.maxZ); 259 } 260 261 public boolean a() { 262 return true; 263 } 264 265 public boolean a(int i, boolean flag) { 266 return this.k_(); 267 } 268 269 public boolean k_() { 270 return true; 271 } 272 273 public void a(World world, int i, int j, int k, Random random) { 274 } 275 276 public void postBreak(World world, int i, int j, int k, int l) { 277 } 278 279 public void doPhysics(World world, int i, int j, int k, int l) { 280 } 281 282 public int c() { 283 return 10; 284 } 285 286 public void c(World world, int i, int j, int k) { 287 } 288 289 public void remove(World world, int i, int j, int k) { 290 } 291 292 public int a(Random random) { 293 return 1; 294 } 295 296 public int a(int i, Random random) { 297 return this.id; 298 } 299 300 public float getDamage(EntityHuman entityhuman) { 301 return this.strength < 0.0F ? 0.0F : (!entityhuman.b(this) ? 1.0F / this.strength / 100.0F : entityhuman.a(this) / this.strength / 30.0F); 302 } 303 304 public final void g(World world, int i, int j, int k, int l) { 305 this.dropNaturally(world, i, j, k, l, 1.0F); 306 } 307 308 public void dropNaturally(World world, int i, int j, int k, int l, float f) { 309 if (!world.isStatic) { 310 int i1 = this.a(world.random); 311 312 for (int j1 = 0; j1 < i1; ++j1) { 313 // CraftBukkit - <= to < to allow for plugins to completely disable block drops from explosions 314 if (world.random.nextFloat() < f) { 315 int k1 = this.a(l, world.random); 316 if (k1 > 0) { 317 this.a(world, i, j, k, new ItemStack(k1, 1, this.a_(l))); 318 } 319 } 320 } 321 } 322 } 323 324 protected void a(World world, int i, int j, int k, ItemStack itemstack) { 325 if (!world.isStatic) { 326 float f = 0.7F; 327 double d0 = (double) (world.random.nextFloat() * f) + (double) (1.0F - f) * 0.5D; 328 double d1 = (double) (world.random.nextFloat() * f) + (double) (1.0F - f) * 0.5D; 329 double d2 = (double) (world.random.nextFloat() * f) + (double) (1.0F - f) * 0.5D; 330 EntityItem entityitem = new EntityItem(world, (double) i + d0, (double) j + d1, (double) k + d2, itemstack); 331 332 entityitem.pickupDelay = 10; 333 world.addEntity(entityitem); 334 } 335 } 336 337 protected int a_(int i) { 338 return 0; 339 } 340 341 public float a(Entity entity) { 342 return this.durability / 5.0F; 343 } 344 345 public MovingObjectPosition a(World world, int i, int j, int k, Vec3D vec3d, Vec3D vec3d1) { 346 this.a(world, i, j, k); 347 vec3d = vec3d.add((double) (-i), (double) (-j), (double) (-k)); 348 vec3d1 = vec3d1.add((double) (-i), (double) (-j), (double) (-k)); 349 Vec3D vec3d2 = vec3d.a(vec3d1, this.minX); 350 Vec3D vec3d3 = vec3d.a(vec3d1, this.maxX); 351 Vec3D vec3d4 = vec3d.b(vec3d1, this.minY); 352 Vec3D vec3d5 = vec3d.b(vec3d1, this.maxY); 353 Vec3D vec3d6 = vec3d.c(vec3d1, this.minZ); 354 Vec3D vec3d7 = vec3d.c(vec3d1, this.maxZ); 355 356 if (!this.a(vec3d2)) { 357 vec3d2 = null; 358 } 359 360 if (!this.a(vec3d3)) { 361 vec3d3 = null; 362 } 363 364 if (!this.b(vec3d4)) { 365 vec3d4 = null; 366 } 367 368 if (!this.b(vec3d5)) { 369 vec3d5 = null; 370 } 371 372 if (!this.c(vec3d6)) { 373 vec3d6 = null; 374 } 375 376 if (!this.c(vec3d7)) { 377 vec3d7 = null; 378 } 379 380 Vec3D vec3d8 = null; 381 382 if (vec3d2 != null && (vec3d8 == null || vec3d.a(vec3d2) < vec3d.a(vec3d8))) { 383 vec3d8 = vec3d2; 384 } 385 386 if (vec3d3 != null && (vec3d8 == null || vec3d.a(vec3d3) < vec3d.a(vec3d8))) { 387 vec3d8 = vec3d3; 388 } 389 390 if (vec3d4 != null && (vec3d8 == null || vec3d.a(vec3d4) < vec3d.a(vec3d8))) { 391 vec3d8 = vec3d4; 392 } 393 394 if (vec3d5 != null && (vec3d8 == null || vec3d.a(vec3d5) < vec3d.a(vec3d8))) { 395 vec3d8 = vec3d5; 396 } 397 398 if (vec3d6 != null && (vec3d8 == null || vec3d.a(vec3d6) < vec3d.a(vec3d8))) { 399 vec3d8 = vec3d6; 400 } 401 402 if (vec3d7 != null && (vec3d8 == null || vec3d.a(vec3d7) < vec3d.a(vec3d8))) { 403 vec3d8 = vec3d7; 404 } 405 406 if (vec3d8 == null) { 407 return null; 408 } else { 409 byte b0 = -1; 410 411 if (vec3d8 == vec3d2) { 412 b0 = 4; 413 } 414 415 if (vec3d8 == vec3d3) { 416 b0 = 5; 417 } 418 419 if (vec3d8 == vec3d4) { 420 b0 = 0; 421 } 422 423 if (vec3d8 == vec3d5) { 424 b0 = 1; 425 } 426 427 if (vec3d8 == vec3d6) { 428 b0 = 2; 429 } 430 431 if (vec3d8 == vec3d7) { 432 b0 = 3; 433 } 434 435 return new MovingObjectPosition(i, j, k, b0, vec3d8.add((double) i, (double) j, (double) k)); 436 } 437 } 438 439 private boolean a(Vec3D vec3d) { 440 return vec3d == null ? false : vec3d.b >= this.minY && vec3d.b <= this.maxY && vec3d.c >= this.minZ && vec3d.c <= this.maxZ; 441 } 442 443 private boolean b(Vec3D vec3d) { 444 return vec3d == null ? false : vec3d.a >= this.minX && vec3d.a <= this.maxX && vec3d.c >= this.minZ && vec3d.c <= this.maxZ; 445 } 446 447 private boolean c(Vec3D vec3d) { 448 return vec3d == null ? false : vec3d.a >= this.minX && vec3d.a <= this.maxX && vec3d.b >= this.minY && vec3d.b <= this.maxY; 449 } 450 451 public void d(World world, int i, int j, int k) { 452 } 453 454 public boolean canPlace(World world, int i, int j, int k, int l) { 455 return this.canPlace(world, i, j, k); 456 } 457 458 public boolean canPlace(World world, int i, int j, int k) { 459 int l = world.getTypeId(i, j, k); 460 461 return l == 0 || byId[l].material.isReplacable(); 462 } 463 464 public boolean interact(World world, int i, int j, int k, EntityHuman entityhuman) { 465 return false; 466 } 467 468 public void b(World world, int i, int j, int k, Entity entity) { 469 } 470 471 public void postPlace(World world, int i, int j, int k, int l) { 472 } 473 474 public void b(World world, int i, int j, int k, EntityHuman entityhuman) { 475 } 476 477 public void a(World world, int i, int j, int k, Entity entity, Vec3D vec3d) { 478 } 479 480 public void a(IBlockAccess iblockaccess, int i, int j, int k) { 481 } 482 483 public boolean a(IBlockAccess iblockaccess, int i, int j, int k, int l) { 484 return false; 485 } 486 487 public boolean isPowerSource() { 488 return false; 489 } 490 491 public void a(World world, int i, int j, int k, Entity entity) { 492 } 493 494 public boolean d(World world, int i, int j, int k, int l) { 495 return false; 496 } 497 498 public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) { 499 entityhuman.a(StatisticList.C[this.id], 1); 500 this.g(world, i, j, k, l); 501 } 502 503 public boolean f(World world, int i, int j, int k) { 504 return true; 505 } 506 507 public void postPlace(World world, int i, int j, int k, EntityLiving entityliving) { 508 } 509 510 public Block a(String s) { 511 this.name = "tile." + s; 512 return this; 513 } 514 515 public String k() { 516 return StatisticCollector.a(this.l() + ".name"); 517 } 518 519 public String l() { 520 return this.name; 521 } 522 523 public void a(World world, int i, int j, int k, int l, int i1) { 524 } 525 526 public boolean m() { 527 return this.br; 528 } 529 530 protected Block n() { 531 this.br = false; 532 return this; 533 } 534 535 public int e() { 536 return this.material.j(); 537 } 538 539 static { 540 Item.byId[WOOL.id] = (new ItemCloth(WOOL.id - 256)).a("cloth"); 541 Item.byId[LOG.id] = (new ItemLog(LOG.id - 256)).a("log"); 542 Item.byId[STEP.id] = (new ItemStep(STEP.id - 256)).a("stoneSlab"); 543 Item.byId[SAPLING.id] = (new ItemSapling(SAPLING.id - 256)).a("sapling"); 544 Item.byId[LEAVES.id] = (new ItemLeaves(LEAVES.id - 256)).a("leaves"); 545 Item.byId[PISTON.id] = new ItemPiston(PISTON.id - 256); 546 Item.byId[PISTON_STICKY.id] = new ItemPiston(PISTON_STICKY.id - 256); 547 // Make different data values of tallgrass, farmland & cake block placeable by hand 548 Item.byId[LONG_GRASS.id] = new ItemLongGrass(LONG_GRASS.id - 256).a("tallgrass"); 549 Item.byId[SOIL.id] = new ItemSoil(SOIL.id - 256).a("farmland"); 550 Item.byId[CAKE_BLOCK.id] = new ItemCake(CAKE_BLOCK.id - 256); 551 552 for (int i = 0; i < 256; ++i) { 553 if (byId[i] != null && Item.byId[i] == null) { 554 Item.byId[i] = new ItemBlock(i - 256); 555 byId[i].h(); 556 } 557 } 558 559 r[0] = true; 560 StatisticList.b(); 561 } 562}