diff --git a/pom.xml b/pom.xml
index fbb3478af8..e061ce6a64 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
org.bukkit
craftbukkit
jar
- 1.2.5-R5.1-SNAPSHOT
+ 1.3.1-R0.1-SNAPSHOT
CraftBukkit
http://www.bukkit.org
@@ -51,14 +51,14 @@
org.bukkit
bukkit
- 1.2.5-R5.1-SNAPSHOT
+ 1.3.1-R0.1-SNAPSHOT
jar
compile
org.bukkit
minecraft-server
- 1.2.5
+ 1.3.1
jar
compile
diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java
index 6e229d5b78..ae4ab83aeb 100644
--- a/src/main/java/net/minecraft/server/Block.java
+++ b/src/main/java/net/minecraft/server/Block.java
@@ -1,10 +1,11 @@
package net.minecraft.server;
-import java.util.ArrayList;
+import java.util.List;
import java.util.Random;
public class Block {
+ private CreativeModeTab creativeTab;
public static final StepSound d = new StepSound("stone", 1.0F, 1.0F);
public static final StepSound e = new StepSound("wood", 1.0F, 1.0F);
public static final StepSound f = new StepSound("gravel", 1.0F, 1.0F);
@@ -21,137 +22,149 @@ public class Block {
public static final int[] lightEmission = new int[4096];
public static final boolean[] r = new boolean[4096];
public static boolean[] s = new boolean[4096];
- public static final Block STONE = (new BlockStone(1, 1)).c(1.5F).b(10.0F).a(h).a("stone");
- public static final BlockGrass GRASS = (BlockGrass) (new BlockGrass(2)).c(0.6F).a(g).a("grass");
- public static final Block DIRT = (new BlockDirt(3, 2)).c(0.5F).a(f).a("dirt");
- public static final Block COBBLESTONE = (new Block(4, 16, Material.STONE)).c(2.0F).b(10.0F).a(h).a("stonebrick");
- public static final Block WOOD = (new BlockWood(5)).c(2.0F).b(5.0F).a(e).a("wood").j();
- public static final Block SAPLING = (new BlockSapling(6, 15)).c(0.0F).a(g).a("sapling").j();
- public static final Block BEDROCK = (new Block(7, 17, Material.STONE)).l().b(6000000.0F).a(h).a("bedrock").s();
- public static final Block WATER = (new BlockFlowing(8, Material.WATER)).c(100.0F).f(3).a("water").s().j();
- public static final Block STATIONARY_WATER = (new BlockStationary(9, Material.WATER)).c(100.0F).f(3).a("water").s().j();
- public static final Block LAVA = (new BlockFlowing(10, Material.LAVA)).c(0.0F).a(1.0F).f(255).a("lava").s().j();
- public static final Block STATIONARY_LAVA = (new BlockStationary(11, Material.LAVA)).c(100.0F).a(1.0F).f(255).a("lava").s().j();
- public static final Block SAND = (new BlockSand(12, 18)).c(0.5F).a(l).a("sand");
- public static final Block GRAVEL = (new BlockGravel(13, 19)).c(0.6F).a(f).a("gravel");
- public static final Block GOLD_ORE = (new BlockOre(14, 32)).c(3.0F).b(5.0F).a(h).a("oreGold");
- public static final Block IRON_ORE = (new BlockOre(15, 33)).c(3.0F).b(5.0F).a(h).a("oreIron");
- public static final Block COAL_ORE = (new BlockOre(16, 34)).c(3.0F).b(5.0F).a(h).a("oreCoal");
- public static final Block LOG = (new BlockLog(17)).c(2.0F).a(e).a("log").j();
- public static final BlockLeaves LEAVES = (BlockLeaves) (new BlockLeaves(18, 52)).c(0.2F).f(1).a(g).a("leaves").j();
- public static final Block SPONGE = (new BlockSponge(19)).c(0.6F).a(g).a("sponge");
- public static final Block GLASS = (new BlockGlass(20, 49, Material.SHATTERABLE, false)).c(0.3F).a(j).a("glass");
- public static final Block LAPIS_ORE = (new BlockOre(21, 160)).c(3.0F).b(5.0F).a(h).a("oreLapis");
- public static final Block LAPIS_BLOCK = (new Block(22, 144, Material.STONE)).c(3.0F).b(5.0F).a(h).a("blockLapis");
- public static final Block DISPENSER = (new BlockDispenser(23)).c(3.5F).a(h).a("dispenser").j();
- public static final Block SANDSTONE = (new BlockSandStone(24)).a(h).c(0.8F).a("sandStone").j();
- public static final Block NOTE_BLOCK = (new BlockNote(25)).c(0.8F).a("musicBlock").j();
- public static final Block BED = (new BlockBed(26)).c(0.2F).a("bed").s().j();
- public static final Block GOLDEN_RAIL = (new BlockMinecartTrack(27, 179, true)).c(0.7F).a(i).a("goldenRail").j();
- public static final Block DETECTOR_RAIL = (new BlockMinecartDetector(28, 195)).c(0.7F).a(i).a("detectorRail").j();
- public static final Block PISTON_STICKY = (new BlockPiston(29, 106, true)).a("pistonStickyBase").j();
- public static final Block WEB = (new BlockWeb(30, 11)).f(1).c(4.0F).a("web");
- public static final BlockLongGrass LONG_GRASS = (BlockLongGrass) (new BlockLongGrass(31, 39)).c(0.0F).a(g).a("tallgrass");
- public static final BlockDeadBush DEAD_BUSH = (BlockDeadBush) (new BlockDeadBush(32, 55)).c(0.0F).a(g).a("deadbush");
- public static final Block PISTON = (new BlockPiston(33, 107, false)).a("pistonBase").j();
- public static final BlockPistonExtension PISTON_EXTENSION = (BlockPistonExtension) (new BlockPistonExtension(34, 107)).j();
- public static final Block WOOL = (new BlockCloth()).c(0.8F).a(k).a("cloth").j();
+ public static final Block STONE = (new BlockStone(1, 1)).c(1.5F).b(10.0F).a(h).b("stone");
+ public static final BlockGrass GRASS = (BlockGrass) (new BlockGrass(2)).c(0.6F).a(g).b("grass");
+ public static final Block DIRT = (new BlockDirt(3, 2)).c(0.5F).a(f).b("dirt");
+ public static final Block COBBLESTONE = (new Block(4, 16, Material.STONE)).c(2.0F).b(10.0F).a(h).b("stonebrick").a(CreativeModeTab.b);
+ public static final Block WOOD = (new BlockWood(5)).c(2.0F).b(5.0F).a(e).b("wood").p();
+ public static final Block SAPLING = (new BlockSapling(6, 15)).c(0.0F).a(g).b("sapling").p();
+ public static final Block BEDROCK = (new Block(7, 17, Material.STONE)).q().b(6000000.0F).a(h).b("bedrock").v().a(CreativeModeTab.b);
+ public static final Block WATER = (new BlockFlowing(8, Material.WATER)).c(100.0F).h(3).b("water").v().p();
+ public static final Block STATIONARY_WATER = (new BlockStationary(9, Material.WATER)).c(100.0F).h(3).b("water").v().p();
+ public static final Block LAVA = (new BlockFlowing(10, Material.LAVA)).c(0.0F).a(1.0F).h(255).b("lava").v().p();
+ public static final Block STATIONARY_LAVA = (new BlockStationary(11, Material.LAVA)).c(100.0F).a(1.0F).h(255).b("lava").v().p();
+ public static final Block SAND = (new BlockSand(12, 18)).c(0.5F).a(l).b("sand");
+ public static final Block GRAVEL = (new BlockGravel(13, 19)).c(0.6F).a(f).b("gravel");
+ public static final Block GOLD_ORE = (new BlockOre(14, 32)).c(3.0F).b(5.0F).a(h).b("oreGold");
+ public static final Block IRON_ORE = (new BlockOre(15, 33)).c(3.0F).b(5.0F).a(h).b("oreIron");
+ public static final Block COAL_ORE = (new BlockOre(16, 34)).c(3.0F).b(5.0F).a(h).b("oreCoal");
+ public static final Block LOG = (new BlockLog(17)).c(2.0F).a(e).b("log").p();
+ public static final BlockLeaves LEAVES = (BlockLeaves) (new BlockLeaves(18, 52)).c(0.2F).h(1).a(g).b("leaves").p();
+ public static final Block SPONGE = (new BlockSponge(19)).c(0.6F).a(g).b("sponge");
+ public static final Block GLASS = (new BlockGlass(20, 49, Material.SHATTERABLE, false)).c(0.3F).a(j).b("glass");
+ public static final Block LAPIS_ORE = (new BlockOre(21, 160)).c(3.0F).b(5.0F).a(h).b("oreLapis");
+ public static final Block LAPIS_BLOCK = (new Block(22, 144, Material.STONE)).c(3.0F).b(5.0F).a(h).b("blockLapis").a(CreativeModeTab.b);
+ public static final Block DISPENSER = (new BlockDispenser(23)).c(3.5F).a(h).b("dispenser").p();
+ public static final Block SANDSTONE = (new BlockSandStone(24)).a(h).c(0.8F).b("sandStone").p();
+ public static final Block NOTE_BLOCK = (new BlockNote(25)).c(0.8F).b("musicBlock").p();
+ public static final Block BED = (new BlockBed(26)).c(0.2F).b("bed").v().p();
+ public static final Block GOLDEN_RAIL = (new BlockMinecartTrack(27, 179, true)).c(0.7F).a(i).b("goldenRail").p();
+ public static final Block DETECTOR_RAIL = (new BlockMinecartDetector(28, 195)).c(0.7F).a(i).b("detectorRail").p();
+ public static final Block PISTON_STICKY = (new BlockPiston(29, 106, true)).b("pistonStickyBase").p();
+ public static final Block WEB = (new BlockWeb(30, 11)).h(1).c(4.0F).b("web");
+ public static final BlockLongGrass LONG_GRASS = (BlockLongGrass) (new BlockLongGrass(31, 39)).c(0.0F).a(g).b("tallgrass");
+ public static final BlockDeadBush DEAD_BUSH = (BlockDeadBush) (new BlockDeadBush(32, 55)).c(0.0F).a(g).b("deadbush");
+ public static final Block PISTON = (new BlockPiston(33, 107, false)).b("pistonBase").p();
+ public static final BlockPistonExtension PISTON_EXTENSION = (BlockPistonExtension) (new BlockPistonExtension(34, 107)).p();
+ public static final Block WOOL = (new BlockCloth()).c(0.8F).a(k).b("cloth").p();
public static final BlockPistonMoving PISTON_MOVING = new BlockPistonMoving(36);
- public static final BlockFlower YELLOW_FLOWER = (BlockFlower) (new BlockFlower(37, 13)).c(0.0F).a(g).a("flower");
- public static final BlockFlower RED_ROSE = (BlockFlower) (new BlockFlower(38, 12)).c(0.0F).a(g).a("rose");
- public static final BlockFlower BROWN_MUSHROOM = (BlockFlower) (new BlockMushroom(39, 29)).c(0.0F).a(g).a(0.125F).a("mushroom");
- public static final BlockFlower RED_MUSHROOM = (BlockFlower) (new BlockMushroom(40, 28)).c(0.0F).a(g).a("mushroom");
- public static final Block GOLD_BLOCK = (new BlockOreBlock(41, 23)).c(3.0F).b(10.0F).a(i).a("blockGold");
- public static final Block IRON_BLOCK = (new BlockOreBlock(42, 22)).c(5.0F).b(10.0F).a(i).a("blockIron");
- public static final Block DOUBLE_STEP = (new BlockStep(43, true)).c(2.0F).b(10.0F).a(h).a("stoneSlab");
- public static final Block STEP = (new BlockStep(44, false)).c(2.0F).b(10.0F).a(h).a("stoneSlab");
- public static final Block BRICK = (new Block(45, 7, Material.STONE)).c(2.0F).b(10.0F).a(h).a("brick");
- public static final Block TNT = (new BlockTNT(46, 8)).c(0.0F).a(g).a("tnt");
- public static final Block BOOKSHELF = (new BlockBookshelf(47, 35)).c(1.5F).a(e).a("bookshelf");
- public static final Block MOSSY_COBBLESTONE = (new Block(48, 36, Material.STONE)).c(2.0F).b(10.0F).a(h).a("stoneMoss");
- public static final Block OBSIDIAN = (new BlockObsidian(49, 37)).c(50.0F).b(2000.0F).a(h).a("obsidian");
- public static final Block TORCH = (new BlockTorch(50, 80)).c(0.0F).a(0.9375F).a(e).a("torch").j();
- public static final BlockFire FIRE = (BlockFire) (new BlockFire(51, 31)).c(0.0F).a(1.0F).a(e).a("fire").s();
- public static final Block MOB_SPAWNER = (new BlockMobSpawner(52, 65)).c(5.0F).a(i).a("mobSpawner").s();
- public static final Block WOOD_STAIRS = (new BlockStairs(53, WOOD)).a("stairsWood").j();
- public static final Block CHEST = (new BlockChest(54)).c(2.5F).a(e).a("chest").j();
- public static final Block REDSTONE_WIRE = (new BlockRedstoneWire(55, 164)).c(0.0F).a(d).a("redstoneDust").s().j();
- public static final Block DIAMOND_ORE = (new BlockOre(56, 50)).c(3.0F).b(5.0F).a(h).a("oreDiamond");
- public static final Block DIAMOND_BLOCK = (new BlockOreBlock(57, 24)).c(5.0F).b(10.0F).a(i).a("blockDiamond");
- public static final Block WORKBENCH = (new BlockWorkbench(58)).c(2.5F).a(e).a("workbench");
- public static final Block CROPS = (new BlockCrops(59, 88)).c(0.0F).a(g).a("crops").s().j();
- public static final Block SOIL = (new BlockSoil(60)).c(0.6F).a(f).a("farmland").j();
- public static final Block FURNACE = (new BlockFurnace(61, false)).c(3.5F).a(h).a("furnace").j();
- public static final Block BURNING_FURNACE = (new BlockFurnace(62, true)).c(3.5F).a(h).a(0.875F).a("furnace").j();
- public static final Block SIGN_POST = (new BlockSign(63, TileEntitySign.class, true)).c(1.0F).a(e).a("sign").s().j();
- public static final Block WOODEN_DOOR = (new BlockDoor(64, Material.WOOD)).c(3.0F).a(e).a("doorWood").s().j();
- public static final Block LADDER = (new BlockLadder(65, 83)).c(0.4F).a(e).a("ladder").j();
- public static final Block RAILS = (new BlockMinecartTrack(66, 128, false)).c(0.7F).a(i).a("rail").j();
- public static final Block COBBLESTONE_STAIRS = (new BlockStairs(67, COBBLESTONE)).a("stairsStone").j();
- public static final Block WALL_SIGN = (new BlockSign(68, TileEntitySign.class, false)).c(1.0F).a(e).a("sign").s().j();
- public static final Block LEVER = (new BlockLever(69, 96)).c(0.5F).a(e).a("lever").j();
- public static final Block STONE_PLATE = (new BlockPressurePlate(70, STONE.textureId, EnumMobType.MOBS, Material.STONE)).c(0.5F).a(h).a("pressurePlate").j();
- public static final Block IRON_DOOR_BLOCK = (new BlockDoor(71, Material.ORE)).c(5.0F).a(i).a("doorIron").s().j();
- public static final Block WOOD_PLATE = (new BlockPressurePlate(72, WOOD.textureId, EnumMobType.EVERYTHING, Material.WOOD)).c(0.5F).a(e).a("pressurePlate").j();
- public static final Block REDSTONE_ORE = (new BlockRedstoneOre(73, 51, false)).c(3.0F).b(5.0F).a(h).a("oreRedstone").j();
- 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").j();
- public static final Block REDSTONE_TORCH_OFF = (new BlockRedstoneTorch(75, 115, false)).c(0.0F).a(e).a("notGate").j();
- public static final Block REDSTONE_TORCH_ON = (new BlockRedstoneTorch(76, 99, true)).c(0.0F).a(0.5F).a(e).a("notGate").j();
- public static final Block STONE_BUTTON = (new BlockButton(77, STONE.textureId)).c(0.5F).a(h).a("button").j();
- public static final Block SNOW = (new BlockSnow(78, 66)).c(0.1F).a(k).a("snow").f(0);
- public static final Block ICE = (new BlockIce(79, 67)).c(0.5F).f(3).a(j).a("ice");
- public static final Block SNOW_BLOCK = (new BlockSnowBlock(80, 66)).c(0.2F).a(k).a("snow");
- public static final Block CACTUS = (new BlockCactus(81, 70)).c(0.4F).a(k).a("cactus");
- public static final Block CLAY = (new BlockClay(82, 72)).c(0.6F).a(f).a("clay");
- public static final Block SUGAR_CANE_BLOCK = (new BlockReed(83, 73)).c(0.0F).a(g).a("reeds").s();
- public static final Block JUKEBOX = (new BlockJukeBox(84, 74)).c(2.0F).b(10.0F).a(h).a("jukebox").j();
- public static final Block FENCE = (new BlockFence(85, 4)).c(2.0F).b(5.0F).a(e).a("fence");
- public static final Block PUMPKIN = (new BlockPumpkin(86, 102, false)).c(1.0F).a(e).a("pumpkin").j();
- public static final Block NETHERRACK = (new BlockBloodStone(87, 103)).c(0.4F).a(h).a("hellrock");
- public static final Block SOUL_SAND = (new BlockSlowSand(88, 104)).c(0.5F).a(l).a("hellsand");
- public static final Block GLOWSTONE = (new BlockLightStone(89, 105, Material.SHATTERABLE)).c(0.3F).a(j).a(1.0F).a("lightgem");
- public static final BlockPortal PORTAL = (BlockPortal) (new BlockPortal(90, 14)).c(-1.0F).a(j).a(0.75F).a("portal");
- public static final Block JACK_O_LANTERN = (new BlockPumpkin(91, 102, true)).c(1.0F).a(e).a(1.0F).a("litpumpkin").j();
- public static final Block CAKE_BLOCK = (new BlockCake(92, 121)).c(0.5F).a(k).a("cake").s().j();
- public static final Block DIODE_OFF = (new BlockDiode(93, false)).c(0.0F).a(e).a("diode").s().j();
- public static final Block DIODE_ON = (new BlockDiode(94, true)).c(0.0F).a(0.625F).a(e).a("diode").s().j();
- public static final Block LOCKED_CHEST = (new BlockLockedChest(95)).c(0.0F).a(1.0F).a(e).a("lockedchest").a(true).j();
- public static final Block TRAP_DOOR = (new BlockTrapdoor(96, Material.WOOD)).c(3.0F).a(e).a("trapdoor").s().j();
- public static final Block MONSTER_EGGS = (new BlockMonsterEggs(97)).c(0.75F);
- public static final Block SMOOTH_BRICK = (new BlockSmoothBrick(98)).c(1.5F).b(10.0F).a(h).a("stonebricksmooth");
- public static final Block BIG_MUSHROOM_1 = (new BlockHugeMushroom(99, Material.WOOD, 142, 0)).c(0.2F).a(e).a("mushroom").j();
- public static final Block BIG_MUSHROOM_2 = (new BlockHugeMushroom(100, Material.WOOD, 142, 1)).c(0.2F).a(e).a("mushroom").j();
- public static final Block IRON_FENCE = (new BlockThinFence(101, 85, 85, Material.ORE, true)).c(5.0F).b(10.0F).a(i).a("fenceIron");
- public static final Block THIN_GLASS = (new BlockThinFence(102, 49, 148, Material.SHATTERABLE, false)).c(0.3F).a(j).a("thinGlass");
- public static final Block MELON = (new BlockMelon(103)).c(1.0F).a(e).a("melon");
- public static final Block PUMPKIN_STEM = (new BlockStem(104, PUMPKIN)).c(0.0F).a(e).a("pumpkinStem").j();
- public static final Block MELON_STEM = (new BlockStem(105, MELON)).c(0.0F).a(e).a("pumpkinStem").j();
- public static final Block VINE = (new BlockVine(106)).c(0.2F).a(g).a("vine").j();
- public static final Block FENCE_GATE = (new BlockFenceGate(107, 4)).c(2.0F).b(5.0F).a(e).a("fenceGate").j();
- public static final Block BRICK_STAIRS = (new BlockStairs(108, BRICK)).a("stairsBrick").j();
- public static final Block STONE_STAIRS = (new BlockStairs(109, SMOOTH_BRICK)).a("stairsStoneBrickSmooth").j();
- public static final BlockMycel MYCEL = (BlockMycel) (new BlockMycel(110)).c(0.6F).a(g).a("mycel");
- public static final Block WATER_LILY = (new BlockWaterLily(111, 76)).c(0.0F).a(g).a("waterlily");
- public static final Block NETHER_BRICK = (new Block(112, 224, Material.STONE)).c(2.0F).b(10.0F).a(h).a("netherBrick");
- public static final Block NETHER_FENCE = (new BlockFence(113, 224, Material.STONE)).c(2.0F).b(10.0F).a(h).a("netherFence");
- public static final Block NETHER_BRICK_STAIRS = (new BlockStairs(114, NETHER_BRICK)).a("stairsNetherBrick").j();
- public static final Block NETHER_WART = (new BlockNetherWart(115)).a("netherStalk").j();
- public static final Block ENCHANTMENT_TABLE = (new BlockEnchantmentTable(116)).c(5.0F).b(2000.0F).a("enchantmentTable");
- public static final Block BREWING_STAND = (new BlockBrewingStand(117)).c(0.5F).a(0.125F).a("brewingStand").j();
- public static final Block CAULDRON = (new BlockCauldron(118)).c(2.0F).a("cauldron").j();
+ public static final BlockFlower YELLOW_FLOWER = (BlockFlower) (new BlockFlower(37, 13)).c(0.0F).a(g).b("flower");
+ public static final BlockFlower RED_ROSE = (BlockFlower) (new BlockFlower(38, 12)).c(0.0F).a(g).b("rose");
+ public static final BlockFlower BROWN_MUSHROOM = (BlockFlower) (new BlockMushroom(39, 29)).c(0.0F).a(g).a(0.125F).b("mushroom");
+ public static final BlockFlower RED_MUSHROOM = (BlockFlower) (new BlockMushroom(40, 28)).c(0.0F).a(g).b("mushroom");
+ public static final Block GOLD_BLOCK = (new BlockOreBlock(41, 23)).c(3.0F).b(10.0F).a(i).b("blockGold");
+ public static final Block IRON_BLOCK = (new BlockOreBlock(42, 22)).c(5.0F).b(10.0F).a(i).b("blockIron");
+ public static final BlockStepAbstract DOUBLE_STEP = (BlockStepAbstract) (new BlockStep(43, true)).c(2.0F).b(10.0F).a(h).b("stoneSlab");
+ public static final BlockStepAbstract STEP = (BlockStepAbstract) (new BlockStep(44, false)).c(2.0F).b(10.0F).a(h).b("stoneSlab");
+ public static final Block BRICK = (new Block(45, 7, Material.STONE)).c(2.0F).b(10.0F).a(h).b("brick").a(CreativeModeTab.b);
+ public static final Block TNT = (new BlockTNT(46, 8)).c(0.0F).a(g).b("tnt");
+ public static final Block BOOKSHELF = (new BlockBookshelf(47, 35)).c(1.5F).a(e).b("bookshelf");
+ public static final Block MOSSY_COBBLESTONE = (new Block(48, 36, Material.STONE)).c(2.0F).b(10.0F).a(h).b("stoneMoss").a(CreativeModeTab.b);
+ public static final Block OBSIDIAN = (new BlockObsidian(49, 37)).c(50.0F).b(2000.0F).a(h).b("obsidian");
+ public static final Block TORCH = (new BlockTorch(50, 80)).c(0.0F).a(0.9375F).a(e).b("torch").p();
+ public static final BlockFire FIRE = (BlockFire) (new BlockFire(51, 31)).c(0.0F).a(1.0F).a(e).b("fire").v();
+ public static final Block MOB_SPAWNER = (new BlockMobSpawner(52, 65)).c(5.0F).a(i).b("mobSpawner").v();
+ public static final Block WOOD_STAIRS = (new BlockStairs(53, WOOD, 0)).b("stairsWood").p();
+ public static final Block CHEST = (new BlockChest(54)).c(2.5F).a(e).b("chest").p();
+ public static final Block REDSTONE_WIRE = (new BlockRedstoneWire(55, 164)).c(0.0F).a(d).b("redstoneDust").v().p();
+ public static final Block DIAMOND_ORE = (new BlockOre(56, 50)).c(3.0F).b(5.0F).a(h).b("oreDiamond");
+ public static final Block DIAMOND_BLOCK = (new BlockOreBlock(57, 24)).c(5.0F).b(10.0F).a(i).b("blockDiamond");
+ public static final Block WORKBENCH = (new BlockWorkbench(58)).c(2.5F).a(e).b("workbench");
+ public static final Block CROPS = (new BlockCrops(59, 88)).c(0.0F).a(g).b("crops").v().p();
+ public static final Block SOIL = (new BlockSoil(60)).c(0.6F).a(f).b("farmland").p();
+ public static final Block FURNACE = (new BlockFurnace(61, false)).c(3.5F).a(h).b("furnace").p().a(CreativeModeTab.c);
+ public static final Block BURNING_FURNACE = (new BlockFurnace(62, true)).c(3.5F).a(h).a(0.875F).b("furnace").p();
+ public static final Block SIGN_POST = (new BlockSign(63, TileEntitySign.class, true)).c(1.0F).a(e).b("sign").v().p();
+ public static final Block WOODEN_DOOR = (new BlockDoor(64, Material.WOOD)).c(3.0F).a(e).b("doorWood").v().p();
+ public static final Block LADDER = (new BlockLadder(65, 83)).c(0.4F).a(e).b("ladder").p();
+ public static final Block RAILS = (new BlockMinecartTrack(66, 128, false)).c(0.7F).a(i).b("rail").p();
+ public static final Block COBBLESTONE_STAIRS = (new BlockStairs(67, COBBLESTONE, 0)).b("stairsStone").p();
+ public static final Block WALL_SIGN = (new BlockSign(68, TileEntitySign.class, false)).c(1.0F).a(e).b("sign").v().p();
+ public static final Block LEVER = (new BlockLever(69, 96)).c(0.5F).a(e).b("lever").p();
+ public static final Block STONE_PLATE = (new BlockPressurePlate(70, STONE.textureId, EnumMobType.MOBS, Material.STONE)).c(0.5F).a(h).b("pressurePlate").p();
+ public static final Block IRON_DOOR_BLOCK = (new BlockDoor(71, Material.ORE)).c(5.0F).a(i).b("doorIron").v().p();
+ public static final Block WOOD_PLATE = (new BlockPressurePlate(72, WOOD.textureId, EnumMobType.EVERYTHING, Material.WOOD)).c(0.5F).a(e).b("pressurePlate").p();
+ public static final Block REDSTONE_ORE = (new BlockRedstoneOre(73, 51, false)).c(3.0F).b(5.0F).a(h).b("oreRedstone").p().a(CreativeModeTab.b);
+ public static final Block GLOWING_REDSTONE_ORE = (new BlockRedstoneOre(74, 51, true)).a(0.625F).c(3.0F).b(5.0F).a(h).b("oreRedstone").p();
+ public static final Block REDSTONE_TORCH_OFF = (new BlockRedstoneTorch(75, 115, false)).c(0.0F).a(e).b("notGate").p();
+ public static final Block REDSTONE_TORCH_ON = (new BlockRedstoneTorch(76, 99, true)).c(0.0F).a(0.5F).a(e).b("notGate").p().a(CreativeModeTab.d);
+ public static final Block STONE_BUTTON = (new BlockButton(77, STONE.textureId)).c(0.5F).a(h).b("button").p();
+ public static final Block SNOW = (new BlockSnow(78, 66)).c(0.1F).a(k).b("snow").p().h(0);
+ public static final Block ICE = (new BlockIce(79, 67)).c(0.5F).h(3).a(j).b("ice");
+ public static final Block SNOW_BLOCK = (new BlockSnowBlock(80, 66)).c(0.2F).a(k).b("snow");
+ public static final Block CACTUS = (new BlockCactus(81, 70)).c(0.4F).a(k).b("cactus");
+ public static final Block CLAY = (new BlockClay(82, 72)).c(0.6F).a(f).b("clay");
+ public static final Block SUGAR_CANE_BLOCK = (new BlockReed(83, 73)).c(0.0F).a(g).b("reeds").v();
+ public static final Block JUKEBOX = (new BlockJukeBox(84, 74)).c(2.0F).b(10.0F).a(h).b("jukebox").p();
+ public static final Block FENCE = (new BlockFence(85, 4)).c(2.0F).b(5.0F).a(e).b("fence");
+ public static final Block PUMPKIN = (new BlockPumpkin(86, 102, false)).c(1.0F).a(e).b("pumpkin").p();
+ public static final Block NETHERRACK = (new BlockBloodStone(87, 103)).c(0.4F).a(h).b("hellrock");
+ public static final Block SOUL_SAND = (new BlockSlowSand(88, 104)).c(0.5F).a(l).b("hellsand");
+ public static final Block GLOWSTONE = (new BlockLightStone(89, 105, Material.SHATTERABLE)).c(0.3F).a(j).a(1.0F).b("lightgem");
+ public static final BlockPortal PORTAL = (BlockPortal) (new BlockPortal(90, 14)).c(-1.0F).a(j).a(0.75F).b("portal");
+ public static final Block JACK_O_LANTERN = (new BlockPumpkin(91, 102, true)).c(1.0F).a(e).a(1.0F).b("litpumpkin").p();
+ public static final Block CAKE_BLOCK = (new BlockCake(92, 121)).c(0.5F).a(k).b("cake").v().p();
+ public static final Block DIODE_OFF = (new BlockDiode(93, false)).c(0.0F).a(e).b("diode").v().p();
+ public static final Block DIODE_ON = (new BlockDiode(94, true)).c(0.0F).a(0.625F).a(e).b("diode").v().p();
+ public static final Block LOCKED_CHEST = (new BlockLockedChest(95)).c(0.0F).a(1.0F).a(e).b("lockedchest").b(true).p();
+ public static final Block TRAP_DOOR = (new BlockTrapdoor(96, Material.WOOD)).c(3.0F).a(e).b("trapdoor").v().p();
+ public static final Block MONSTER_EGGS = (new BlockMonsterEggs(97)).c(0.75F).b("monsterStoneEgg");
+ public static final Block SMOOTH_BRICK = (new BlockSmoothBrick(98)).c(1.5F).b(10.0F).a(h).b("stonebricksmooth");
+ public static final Block BIG_MUSHROOM_1 = (new BlockHugeMushroom(99, Material.WOOD, 142, 0)).c(0.2F).a(e).b("mushroom").p();
+ public static final Block BIG_MUSHROOM_2 = (new BlockHugeMushroom(100, Material.WOOD, 142, 1)).c(0.2F).a(e).b("mushroom").p();
+ public static final Block IRON_FENCE = (new BlockThinFence(101, 85, 85, Material.ORE, true)).c(5.0F).b(10.0F).a(i).b("fenceIron");
+ public static final Block THIN_GLASS = (new BlockThinFence(102, 49, 148, Material.SHATTERABLE, false)).c(0.3F).a(j).b("thinGlass");
+ public static final Block MELON = (new BlockMelon(103)).c(1.0F).a(e).b("melon");
+ public static final Block PUMPKIN_STEM = (new BlockStem(104, PUMPKIN)).c(0.0F).a(e).b("pumpkinStem").p();
+ public static final Block MELON_STEM = (new BlockStem(105, MELON)).c(0.0F).a(e).b("pumpkinStem").p();
+ public static final Block VINE = (new BlockVine(106)).c(0.2F).a(g).b("vine").p();
+ public static final Block FENCE_GATE = (new BlockFenceGate(107, 4)).c(2.0F).b(5.0F).a(e).b("fenceGate").p();
+ public static final Block BRICK_STAIRS = (new BlockStairs(108, BRICK, 0)).b("stairsBrick").p();
+ public static final Block STONE_STAIRS = (new BlockStairs(109, SMOOTH_BRICK, 0)).b("stairsStoneBrickSmooth").p();
+ public static final BlockMycel MYCEL = (BlockMycel) (new BlockMycel(110)).c(0.6F).a(g).b("mycel");
+ public static final Block WATER_LILY = (new BlockWaterLily(111, 76)).c(0.0F).a(g).b("waterlily");
+ public static final Block NETHER_BRICK = (new Block(112, 224, Material.STONE)).c(2.0F).b(10.0F).a(h).b("netherBrick").a(CreativeModeTab.b);
+ public static final Block NETHER_FENCE = (new BlockFence(113, 224, Material.STONE)).c(2.0F).b(10.0F).a(h).b("netherFence");
+ public static final Block NETHER_BRICK_STAIRS = (new BlockStairs(114, NETHER_BRICK, 0)).b("stairsNetherBrick").p();
+ public static final Block NETHER_WART = (new BlockNetherWart(115)).b("netherStalk").p();
+ public static final Block ENCHANTMENT_TABLE = (new BlockEnchantmentTable(116)).c(5.0F).b(2000.0F).b("enchantmentTable");
+ public static final Block BREWING_STAND = (new BlockBrewingStand(117)).c(0.5F).a(0.125F).b("brewingStand").p();
+ public static final Block CAULDRON = (new BlockCauldron(118)).c(2.0F).b("cauldron").p();
public static final Block ENDER_PORTAL = (new BlockEnderPortal(119, Material.PORTAL)).c(-1.0F).b(6000000.0F);
- public static final Block ENDER_PORTAL_FRAME = (new BlockEnderPortalFrame(120)).a(j).a(0.125F).c(-1.0F).a("endPortalFrame").j().b(6000000.0F);
- public static final Block WHITESTONE = (new Block(121, 175, Material.STONE)).c(3.0F).b(15.0F).a(h).a("whiteStone");
- public static final Block DRAGON_EGG = (new BlockDragonEgg(122, 167)).c(3.0F).b(15.0F).a(h).a(0.125F).a("dragonEgg");
- public static final Block REDSTONE_LAMP_OFF = (new BlockRedstoneLamp(123, false)).c(0.3F).a(j).a("redstoneLight");
- public static final Block REDSTONE_LAMP_ON = (new BlockRedstoneLamp(124, true)).c(0.3F).a(j).a("redstoneLight");
+ public static final Block ENDER_PORTAL_FRAME = (new BlockEnderPortalFrame(120)).a(j).a(0.125F).c(-1.0F).b("endPortalFrame").p().b(6000000.0F).a(CreativeModeTab.c);
+ public static final Block WHITESTONE = (new Block(121, 175, Material.STONE)).c(3.0F).b(15.0F).a(h).b("whiteStone").a(CreativeModeTab.b);
+ public static final Block DRAGON_EGG = (new BlockDragonEgg(122, 167)).c(3.0F).b(15.0F).a(h).a(0.125F).b("dragonEgg");
+ public static final Block REDSTONE_LAMP_OFF = (new BlockRedstoneLamp(123, false)).c(0.3F).a(j).b("redstoneLight").a(CreativeModeTab.d);
+ public static final Block REDSTONE_LAMP_ON = (new BlockRedstoneLamp(124, true)).c(0.3F).a(j).b("redstoneLight");
+ public static final BlockStepAbstract WOOD_DOUBLE_STEP = (BlockStepAbstract) (new BlockWoodStep(125, true)).c(2.0F).b(5.0F).a(e).b("woodSlab");
+ public static final BlockStepAbstract WOOD_STEP = (BlockStepAbstract) (new BlockWoodStep(126, false)).c(2.0F).b(5.0F).a(e).b("woodSlab");
+ public static final Block COCOA = (new BlockCocoa(127)).c(0.2F).b(5.0F).a(e).b("cocoa").p();
+ public static final Block SANDSTONE_STAIRS = (new BlockStairs(128, SANDSTONE, 0)).b("stairsSandStone").p();
+ public static final Block EMERALD_ORE = (new BlockOre(129, 171)).c(3.0F).b(5.0F).a(h).b("oreEmerald");
+ public static final Block ENDER_CHEST = (new BlockEnderChest(130)).c(22.5F).b(1000.0F).a(h).b("enderChest").p().a(0.5F);
+ public static final BlockTripwireHook TRIPWIRE_SOURCE = (BlockTripwireHook) (new BlockTripwireHook(131)).b("tripWireSource").p();
+ public static final Block TRIPWIRE = (new BlockTripwire(132)).b("tripWire").p();
+ public static final Block EMERALD_BLOCK = (new BlockOreBlock(133, 25)).c(5.0F).b(10.0F).a(i).b("blockEmerald");
+ public static final Block SPRUCE_WOOD_STAIRS = (new BlockStairs(134, WOOD, 1)).b("stairsWoodSpruce").p();
+ public static final Block BIRCH_WOOD_STAIRS = (new BlockStairs(135, WOOD, 2)).b("stairsWoodBirch").p();
+ public static final Block JUNGLE_WOOD_STAIRS = (new BlockStairs(136, WOOD, 3)).b("stairsWoodJungle").p();
public int textureId;
public final int id;
protected float strength;
protected float durability;
- protected boolean bR;
- protected boolean bS;
- protected boolean bT;
+ protected boolean cd;
+ protected boolean ce;
+ protected boolean cf;
protected boolean isTileEntity;
public double minX;
public double minY;
@@ -160,16 +173,16 @@ public class Block {
public double maxY;
public double maxZ;
public StepSound stepSound;
- public float cc;
+ public float co;
public final Material material;
public float frictionFactor;
private String name;
protected Block(int i, Material material) {
- this.bR = true;
- this.bS = true;
+ this.cd = true;
+ this.ce = true;
this.stepSound = d;
- this.cc = 1.0F;
+ this.co = 1.0F;
this.frictionFactor = 0.6F;
if (byId[i] != null) {
throw new IllegalArgumentException("Slot " + i + " is already occupied by " + byId[i] + " when adding " + this);
@@ -178,18 +191,18 @@ public class Block {
byId[i] = this;
this.id = i;
this.a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
- n[i] = this.a();
- lightBlock[i] = this.a() ? 255 : 0;
+ n[i] = this.d();
+ lightBlock[i] = this.d() ? 255 : 0;
p[i] = !material.blocksLight();
}
}
- protected Block j() {
+ protected Block p() {
r[this.id] = true;
return this;
}
- protected void k() {}
+ protected void r_() {}
protected Block(int i, int j, Material material) {
this(i, material);
@@ -201,7 +214,7 @@ public class Block {
return this;
}
- protected Block f(int i) {
+ protected Block h(int i) {
lightBlock[this.id] = i;
return this;
}
@@ -216,21 +229,21 @@ public class Block {
return this;
}
- public static boolean g(int i) {
+ public static boolean i(int i) {
Block block = byId[i];
- return block == null ? false : block.material.j() && block.b();
+ return block == null ? false : block.material.k() && block.c();
}
- public boolean b() {
+ public boolean c() {
return true;
}
- public boolean b(IBlockAccess iblockaccess, int i, int j, int k) {
+ public boolean c(IBlockAccess iblockaccess, int i, int j, int k) {
return !this.material.isSolid();
}
- public int c() {
+ public int b() {
return 0;
}
@@ -243,25 +256,25 @@ public class Block {
return this;
}
- protected Block l() {
+ protected Block q() {
this.c(-1.0F);
return this;
}
- public float m() {
+ public float m(World world, int i, int j, int k) {
return this.strength;
}
- protected Block a(boolean flag) {
- this.bT = flag;
+ protected Block b(boolean flag) {
+ this.cf = flag;
return this;
}
- public boolean n() {
- return this.bT;
+ public boolean r() {
+ return this.cf;
}
- public boolean o() {
+ public boolean s() {
return this.isTileEntity;
}
@@ -274,7 +287,7 @@ public class Block {
this.maxZ = (double) f5;
}
- public boolean b(IBlockAccess iblockaccess, int i, int j, int k, int l) {
+ public boolean d(IBlockAccess iblockaccess, int i, int j, int k, int l) {
return iblockaccess.getMaterial(i, j, k).isBuildable();
}
@@ -286,43 +299,43 @@ public class Block {
return this.textureId;
}
- public void a(World world, int i, int j, int k, AxisAlignedBB axisalignedbb, ArrayList arraylist) {
+ public void a(World world, int i, int j, int k, AxisAlignedBB axisalignedbb, List list, Entity entity) {
AxisAlignedBB axisalignedbb1 = this.e(world, i, j, k);
if (axisalignedbb1 != null && axisalignedbb.a(axisalignedbb1)) {
- arraylist.add(axisalignedbb1);
+ list.add(axisalignedbb1);
}
}
public AxisAlignedBB e(World world, int i, int j, int k) {
- 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);
+ return AxisAlignedBB.a().a((double) i + this.minX, (double) j + this.minY, (double) k + this.minZ, (double) i + this.maxX, (double) j + this.maxY, (double) k + this.maxZ);
}
- public boolean a() {
+ public boolean d() {
return true;
}
public boolean a(int i, boolean flag) {
- return this.E_();
+ return this.l();
}
- public boolean E_() {
+ public boolean l() {
return true;
}
- public void a(World world, int i, int j, int k, Random random) {}
+ public void b(World world, int i, int j, int k, Random random) {}
public void postBreak(World world, int i, int j, int k, int l) {}
public void doPhysics(World world, int i, int j, int k, int l) {}
- public int d() {
+ public int p_() {
return 10;
}
public void onPlace(World world, int i, int j, int k) {}
- public void remove(World world, int i, int j, int k) {}
+ public void remove(World world, int i, int j, int k, int l, int i1) {}
public int a(Random random) {
return 1;
@@ -332,11 +345,13 @@ public class Block {
return this.id;
}
- public float getDamage(EntityHuman entityhuman) {
- return this.strength < 0.0F ? 0.0F : (!entityhuman.b(this) ? 1.0F / this.strength / 100.0F : entityhuman.a(this) / this.strength / 30.0F);
+ public float getDamage(EntityHuman entityhuman, World world, int i, int j, int k) {
+ float f = this.m(world, i, j, k);
+
+ return f < 0.0F ? 0.0F : (!entityhuman.b(this) ? 1.0F / f / 100.0F : entityhuman.a(this) / f / 30.0F);
}
- public final void b(World world, int i, int j, int k, int l, int i1) {
+ public final void c(World world, int i, int j, int k, int l, int i1) {
this.dropNaturally(world, i, j, k, l, 1.0F, i1);
}
@@ -370,6 +385,17 @@ public class Block {
}
}
+ protected void g(World world, int i, int j, int k, int l) {
+ if (!world.isStatic) {
+ while (l > 0) {
+ int i1 = EntityExperienceOrb.getOrbValue(l);
+
+ l -= i1;
+ world.addEntity(new EntityExperienceOrb(world, (double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D, i1));
+ }
+ }
+ }
+
protected int getDropData(int i) {
return 0;
}
@@ -382,12 +408,12 @@ public class Block {
this.updateShape(world, i, j, k);
vec3d = vec3d.add((double) (-i), (double) (-j), (double) (-k));
vec3d1 = vec3d1.add((double) (-i), (double) (-j), (double) (-k));
- Vec3D vec3d2 = vec3d.a(vec3d1, this.minX);
- Vec3D vec3d3 = vec3d.a(vec3d1, this.maxX);
- Vec3D vec3d4 = vec3d.b(vec3d1, this.minY);
- Vec3D vec3d5 = vec3d.b(vec3d1, this.maxY);
- Vec3D vec3d6 = vec3d.c(vec3d1, this.minZ);
- Vec3D vec3d7 = vec3d.c(vec3d1, this.maxZ);
+ Vec3D vec3d2 = vec3d.b(vec3d1, this.minX);
+ Vec3D vec3d3 = vec3d.b(vec3d1, this.maxX);
+ Vec3D vec3d4 = vec3d.c(vec3d1, this.minY);
+ Vec3D vec3d5 = vec3d.c(vec3d1, this.maxY);
+ Vec3D vec3d6 = vec3d.d(vec3d1, this.minZ);
+ Vec3D vec3d7 = vec3d.d(vec3d1, this.maxZ);
if (!this.a(vec3d2)) {
vec3d2 = null;
@@ -415,27 +441,27 @@ public class Block {
Vec3D vec3d8 = null;
- if (vec3d2 != null && (vec3d8 == null || vec3d.b(vec3d2) < vec3d.b(vec3d8))) {
+ if (vec3d2 != null && (vec3d8 == null || vec3d.distanceSquared(vec3d2) < vec3d.distanceSquared(vec3d8))) {
vec3d8 = vec3d2;
}
- if (vec3d3 != null && (vec3d8 == null || vec3d.b(vec3d3) < vec3d.b(vec3d8))) {
+ if (vec3d3 != null && (vec3d8 == null || vec3d.distanceSquared(vec3d3) < vec3d.distanceSquared(vec3d8))) {
vec3d8 = vec3d3;
}
- if (vec3d4 != null && (vec3d8 == null || vec3d.b(vec3d4) < vec3d.b(vec3d8))) {
+ if (vec3d4 != null && (vec3d8 == null || vec3d.distanceSquared(vec3d4) < vec3d.distanceSquared(vec3d8))) {
vec3d8 = vec3d4;
}
- if (vec3d5 != null && (vec3d8 == null || vec3d.b(vec3d5) < vec3d.b(vec3d8))) {
+ if (vec3d5 != null && (vec3d8 == null || vec3d.distanceSquared(vec3d5) < vec3d.distanceSquared(vec3d8))) {
vec3d8 = vec3d5;
}
- if (vec3d6 != null && (vec3d8 == null || vec3d.b(vec3d6) < vec3d.b(vec3d8))) {
+ if (vec3d6 != null && (vec3d8 == null || vec3d.distanceSquared(vec3d6) < vec3d.distanceSquared(vec3d8))) {
vec3d8 = vec3d6;
}
- if (vec3d7 != null && (vec3d8 == null || vec3d.b(vec3d7) < vec3d.b(vec3d8))) {
+ if (vec3d7 != null && (vec3d8 == null || vec3d.distanceSquared(vec3d7) < vec3d.distanceSquared(vec3d8))) {
vec3d8 = vec3d7;
}
@@ -493,16 +519,16 @@ public class Block {
public boolean canPlace(World world, int i, int j, int k) {
int l = world.getTypeId(i, j, k);
- return l == 0 || byId[l].material.isReplacable();
+ return l == 0 || byId[l].material.isReplaceable();
}
- public boolean interact(World world, int i, int j, int k, EntityHuman entityhuman) {
+ public boolean interact(World world, int i, int j, int k, EntityHuman entityhuman, int l, float f, float f1, float f2) {
return false;
}
public void b(World world, int i, int j, int k, Entity entity) {}
- public void postPlace(World world, int i, int j, int k, int l) {}
+ public void postPlace(World world, int i, int j, int k, int l, float f, float f1, float f2) {}
public void attack(World world, int i, int j, int k, EntityHuman entityhuman) {}
@@ -520,7 +546,7 @@ public class Block {
public void a(World world, int i, int j, int k, Entity entity) {}
- public boolean d(World world, int i, int j, int k, int l) {
+ public boolean c(World world, int i, int j, int k, int l) {
return false;
}
@@ -528,9 +554,9 @@ public class Block {
public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
entityhuman.a(StatisticList.C[this.id], 1);
- entityhuman.c(0.025F);
- if (this.h() && EnchantmentManager.hasSilkTouchEnchantment(entityhuman.inventory)) {
- ItemStack itemstack = this.a_(l);
+ entityhuman.j(0.025F);
+ if (this.q_() && EnchantmentManager.hasSilkTouchEnchantment(entityhuman.inventory)) {
+ ItemStack itemstack = this.c_(l);
if (itemstack != null) {
this.a(world, i, j, k, itemstack);
@@ -538,18 +564,18 @@ public class Block {
} else {
int i1 = EnchantmentManager.getBonusBlockLootEnchantmentLevel(entityhuman.inventory);
- this.b(world, i, j, k, l, i1);
+ this.c(world, i, j, k, l, i1);
}
}
- protected boolean h() {
- return this.b() && !this.isTileEntity;
+ protected boolean q_() {
+ return this.c() && !this.isTileEntity;
}
- protected ItemStack a_(int i) {
+ protected ItemStack c_(int i) {
int j = 0;
- if (this.id >= 0 && this.id < Item.byId.length && Item.byId[this.id].e()) {
+ if (this.id >= 0 && this.id < Item.byId.length && Item.byId[this.id].k()) {
j = i;
}
@@ -560,74 +586,91 @@ public class Block {
return this.a(random);
}
- public boolean f(World world, int i, int j, int k) {
+ public boolean d(World world, int i, int j, int k) {
return true;
}
public void postPlace(World world, int i, int j, int k, EntityLiving entityliving) {}
- public Block a(String s) {
+ public Block b(String s) {
this.name = "tile." + s;
return this;
}
public String getName() {
- return LocaleI18n.get(this.q() + ".name");
+ return LocaleI18n.get(this.a() + ".name");
}
- public String q() {
+ public String a() {
return this.name;
}
- public void a(World world, int i, int j, int k, int l, int i1) {}
+ public void b(World world, int i, int j, int k, int l, int i1) {}
- public boolean r() {
- return this.bS;
+ public boolean u() {
+ return this.ce;
}
- protected Block s() {
- this.bS = false;
+ protected Block v() {
+ this.ce = false;
return this;
}
- public int g() {
+ public int e() {
return this.material.getPushReaction();
}
public void a(World world, int i, int j, int k, Entity entity, float f) {}
+ public Block a(CreativeModeTab creativemodetab) {
+ this.creativeTab = creativemodetab;
+ return this;
+ }
+
+ public void a(World world, int i, int j, int k, int l, EntityHuman entityhuman) {}
+
+ public void h(World world, int i, int j, int k, int l) {}
+
+ public void f(World world, int i, int j, int k) {}
+
+ public void a(World world, long i, long j) {}
+
static {
- Item.byId[WOOL.id] = (new ItemCloth(WOOL.id - 256)).a("cloth");
- Item.byId[LOG.id] = (new ItemWithAuxData(LOG.id - 256, LOG)).a("log");
- Item.byId[WOOD.id] = (new ItemWithAuxData(WOOD.id - 256, WOOD)).a("wood");
- Item.byId[SMOOTH_BRICK.id] = (new ItemWithAuxData(SMOOTH_BRICK.id - 256, SMOOTH_BRICK)).a("stonebricksmooth");
- Item.byId[SANDSTONE.id] = (new ItemWithAuxData(SANDSTONE.id - 256, SANDSTONE)).a("sandStone");
- Item.byId[STEP.id] = (new ItemStep(STEP.id - 256)).a("stoneSlab");
- Item.byId[SAPLING.id] = (new ItemSapling(SAPLING.id - 256)).a("sapling");
- Item.byId[LEAVES.id] = (new ItemLeaves(LEAVES.id - 256)).a("leaves");
- Item.byId[VINE.id] = new ItemColoredBlock(VINE.id - 256, false);
- Item.byId[LONG_GRASS.id] = (new ItemColoredBlock(LONG_GRASS.id - 256, true)).a(new String[] { "shrub", "grass", "fern"});
+ Item.byId[WOOL.id] = (new ItemCloth(WOOL.id - 256)).b("cloth");
+ Item.byId[LOG.id] = (new ItemLog(LOG.id - 256, LOG)).b("log");
+ Item.byId[WOOD.id] = (new ItemWood(WOOD.id - 256, WOOD)).b("wood");
+ Item.byId[MONSTER_EGGS.id] = (new ItemMonsterEggs(MONSTER_EGGS.id - 256)).b("monsterStoneEgg");
+ Item.byId[SMOOTH_BRICK.id] = (new ItemSmoothStone(SMOOTH_BRICK.id - 256, SMOOTH_BRICK)).b("stonebricksmooth");
+ Item.byId[SANDSTONE.id] = (new ItemSandStone(SANDSTONE.id - 256, SANDSTONE)).b("sandStone");
+ Item.byId[STEP.id] = (new ItemStep(STEP.id - 256, STEP, DOUBLE_STEP, false)).b("stoneSlab");
+ Item.byId[DOUBLE_STEP.id] = (new ItemStep(DOUBLE_STEP.id - 256, STEP, DOUBLE_STEP, true)).b("stoneSlab");
+ Item.byId[WOOD_STEP.id] = (new ItemStep(WOOD_STEP.id - 256, WOOD_STEP, WOOD_DOUBLE_STEP, false)).b("woodSlab");
+ Item.byId[WOOD_DOUBLE_STEP.id] = (new ItemStep(WOOD_DOUBLE_STEP.id - 256, WOOD_STEP, WOOD_DOUBLE_STEP, true)).b("woodSlab");
+ Item.byId[SAPLING.id] = (new ItemSapling(SAPLING.id - 256)).b("sapling");
+ Item.byId[LEAVES.id] = (new ItemLeaves(LEAVES.id - 256)).b("leaves");
+ Item.byId[VINE.id] = new ItemWithAuxData(VINE.id - 256, false);
+ Item.byId[LONG_GRASS.id] = (new ItemWithAuxData(LONG_GRASS.id - 256, true)).a(new String[] { "shrub", "grass", "fern"});
Item.byId[WATER_LILY.id] = new ItemWaterLily(WATER_LILY.id - 256);
Item.byId[PISTON.id] = new ItemPiston(PISTON.id - 256);
Item.byId[PISTON_STICKY.id] = new ItemPiston(PISTON_STICKY.id - 256);
- Item.byId[BIG_MUSHROOM_1.id] = new ItemWithAuxData(BIG_MUSHROOM_1.id - 256, BIG_MUSHROOM_1); // CraftBukkit
- Item.byId[BIG_MUSHROOM_2.id] = new ItemWithAuxData(BIG_MUSHROOM_2.id - 256, BIG_MUSHROOM_2); // CraftBukkit
- Item.byId[MOB_SPAWNER.id] = new ItemWithAuxData(MOB_SPAWNER.id - 256, MOB_SPAWNER); // CraftBukkit
+ Item.byId[BIG_MUSHROOM_1.id] = new ItemWithAuxData(BIG_MUSHROOM_1.id - 256, false); // CraftBukkit
+ Item.byId[BIG_MUSHROOM_2.id] = new ItemWithAuxData(BIG_MUSHROOM_2.id - 256, false); // CraftBukkit
+ Item.byId[MOB_SPAWNER.id] = new ItemWithAuxData(MOB_SPAWNER.id - 256, false); // CraftBukkit
for (int i = 0; i < 256; ++i) {
if (byId[i] != null) {
if (Item.byId[i] == null) {
Item.byId[i] = new ItemBlock(i - 256);
- byId[i].k();
+ byId[i].r_();
}
boolean flag = false;
- if (i > 0 && byId[i].c() == 10) {
+ if (i > 0 && byId[i].b() == 10) {
flag = true;
}
- if (i > 0 && byId[i] instanceof BlockStep) {
+ if (i > 0 && byId[i] instanceof BlockStepAbstract) {
flag = true;
}
@@ -639,6 +682,10 @@ public class Block {
flag = true;
}
+ if (lightBlock[i] == 0) {
+ flag = true;
+ }
+
s[i] = flag;
}
}
diff --git a/src/main/java/net/minecraft/server/BlockBloodStone.java b/src/main/java/net/minecraft/server/BlockBloodStone.java
index b69fbf5802..fb891933e6 100644
--- a/src/main/java/net/minecraft/server/BlockBloodStone.java
+++ b/src/main/java/net/minecraft/server/BlockBloodStone.java
@@ -6,6 +6,7 @@ public class BlockBloodStone extends Block {
public BlockBloodStone(int i, int j) {
super(i, j, Material.STONE);
+ this.a(CreativeModeTab.b);
}
// CraftBukkit start
diff --git a/src/main/java/net/minecraft/server/BlockButton.java b/src/main/java/net/minecraft/server/BlockButton.java
index aa3c685656..43d95f7231 100644
--- a/src/main/java/net/minecraft/server/BlockButton.java
+++ b/src/main/java/net/minecraft/server/BlockButton.java
@@ -8,88 +8,89 @@ public class BlockButton extends Block {
protected BlockButton(int i, int j) {
super(i, j, Material.ORIENTABLE);
- this.a(true);
+ this.b(true);
+ this.a(CreativeModeTab.d);
}
public AxisAlignedBB e(World world, int i, int j, int k) {
return null;
}
- public int d() {
+ public int p_() {
return 20;
}
- public boolean a() {
+ public boolean d() {
return false;
}
- public boolean b() {
+ public boolean c() {
return false;
}
public boolean canPlace(World world, int i, int j, int k, int l) {
- return l == 2 && world.e(i, j, k + 1) ? true : (l == 3 && world.e(i, j, k - 1) ? true : (l == 4 && world.e(i + 1, j, k) ? true : l == 5 && world.e(i - 1, j, k)));
+ return l == 2 && world.s(i, j, k + 1) ? true : (l == 3 && world.s(i, j, k - 1) ? true : (l == 4 && world.s(i + 1, j, k) ? true : l == 5 && world.s(i - 1, j, k)));
}
public boolean canPlace(World world, int i, int j, int k) {
- return world.e(i - 1, j, k) ? true : (world.e(i + 1, j, k) ? true : (world.e(i, j, k - 1) ? true : world.e(i, j, k + 1)));
+ return world.s(i - 1, j, k) ? true : (world.s(i + 1, j, k) ? true : (world.s(i, j, k - 1) ? true : world.s(i, j, k + 1)));
}
- public void postPlace(World world, int i, int j, int k, int l) {
+ public void postPlace(World world, int i, int j, int k, int l, float f, float f1, float f2) {
int i1 = world.getData(i, j, k);
int j1 = i1 & 8;
i1 &= 7;
- if (l == 2 && world.e(i, j, k + 1)) {
+ if (l == 2 && world.s(i, j, k + 1)) {
i1 = 4;
- } else if (l == 3 && world.e(i, j, k - 1)) {
+ } else if (l == 3 && world.s(i, j, k - 1)) {
i1 = 3;
- } else if (l == 4 && world.e(i + 1, j, k)) {
+ } else if (l == 4 && world.s(i + 1, j, k)) {
i1 = 2;
- } else if (l == 5 && world.e(i - 1, j, k)) {
+ } else if (l == 5 && world.s(i - 1, j, k)) {
i1 = 1;
} else {
- i1 = this.g(world, i, j, k);
+ i1 = this.l(world, i, j, k);
}
world.setData(i, j, k, i1 + j1);
}
- private int g(World world, int i, int j, int k) {
- return world.e(i - 1, j, k) ? 1 : (world.e(i + 1, j, k) ? 2 : (world.e(i, j, k - 1) ? 3 : (world.e(i, j, k + 1) ? 4 : 1)));
+ private int l(World world, int i, int j, int k) {
+ return world.s(i - 1, j, k) ? 1 : (world.s(i + 1, j, k) ? 2 : (world.s(i, j, k - 1) ? 3 : (world.s(i, j, k + 1) ? 4 : 1)));
}
public void doPhysics(World world, int i, int j, int k, int l) {
- if (this.h(world, i, j, k)) {
+ if (this.n(world, i, j, k)) {
int i1 = world.getData(i, j, k) & 7;
boolean flag = false;
- if (!world.e(i - 1, j, k) && i1 == 1) {
+ if (!world.s(i - 1, j, k) && i1 == 1) {
flag = true;
}
- if (!world.e(i + 1, j, k) && i1 == 2) {
+ if (!world.s(i + 1, j, k) && i1 == 2) {
flag = true;
}
- if (!world.e(i, j, k - 1) && i1 == 3) {
+ if (!world.s(i, j, k - 1) && i1 == 3) {
flag = true;
}
- if (!world.e(i, j, k + 1) && i1 == 4) {
+ if (!world.s(i, j, k + 1) && i1 == 4) {
flag = true;
}
if (flag) {
- this.b(world, i, j, k, world.getData(i, j, k), 0);
+ this.c(world, i, j, k, world.getData(i, j, k), 0);
world.setTypeId(i, j, k, 0);
}
}
}
- private boolean h(World world, int i, int j, int k) {
+ private boolean n(World world, int i, int j, int k) {
if (!this.canPlace(world, i, j, k)) {
- this.b(world, i, j, k, world.getData(i, j, k), 0);
+ this.c(world, i, j, k, world.getData(i, j, k), 0);
world.setTypeId(i, j, k, 0);
return false;
} else {
@@ -122,79 +123,77 @@ public class BlockButton extends Block {
}
public void attack(World world, int i, int j, int k, EntityHuman entityhuman) {
- this.interact(world, i, j, k, entityhuman);
+ this.interact(world, i, j, k, entityhuman, 0, 0.0F, 0.0F, 0.0F);
}
- public boolean interact(World world, int i, int j, int k, EntityHuman entityhuman) {
- int l = world.getData(i, j, k);
- int i1 = l & 7;
- int j1 = 8 - (l & 8);
+ public boolean interact(World world, int i, int j, int k, EntityHuman entityhuman, int l, float f, float f1, float f2) {
+ int i1 = world.getData(i, j, k);
+ int j1 = i1 & 7;
+ int k1 = 8 - (i1 & 8);
- if (j1 == 0) {
+ if (k1 == 0) {
return true;
} else {
// CraftBukkit start
org.bukkit.block.Block block = world.getWorld().getBlockAt(i, j, k);
- int old = (j1 != 8) ? 1 : 0;
- int current = (j1 == 8) ? 1 : 0;
+ int old = (k1 != 8) ? 1 : 0;
+ int current = (k1 == 8) ? 1 : 0;
BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(block, old, current);
world.getServer().getPluginManager().callEvent(eventRedstone);
- if ((eventRedstone.getNewCurrent() > 0) != (j1 == 8)) {
+ if ((eventRedstone.getNewCurrent() > 0) != (k1 == 8)) {
return true;
}
// CraftBukkit end
- world.setData(i, j, k, i1 + j1);
- world.b(i, j, k, i, j, k);
+ world.setData(i, j, k, j1 + k1);
+ world.d(i, j, k, i, j, k);
world.makeSound((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D, "random.click", 0.3F, 0.6F);
world.applyPhysics(i, j, k, this.id);
- if (i1 == 1) {
+ if (j1 == 1) {
world.applyPhysics(i - 1, j, k, this.id);
- } else if (i1 == 2) {
+ } else if (j1 == 2) {
world.applyPhysics(i + 1, j, k, this.id);
- } else if (i1 == 3) {
+ } else if (j1 == 3) {
world.applyPhysics(i, j, k - 1, this.id);
- } else if (i1 == 4) {
+ } else if (j1 == 4) {
world.applyPhysics(i, j, k + 1, this.id);
} else {
world.applyPhysics(i, j - 1, k, this.id);
}
- world.c(i, j, k, this.id, this.d());
+ world.a(i, j, k, this.id, this.p_());
return true;
}
}
- public void remove(World world, int i, int j, int k) {
- int l = world.getData(i, j, k);
-
- if ((l & 8) > 0) {
+ public void remove(World world, int i, int j, int k, int l, int i1) {
+ if ((i1 & 8) > 0) {
world.applyPhysics(i, j, k, this.id);
- int i1 = l & 7;
+ int j1 = i1 & 7;
- if (i1 == 1) {
+ if (j1 == 1) {
world.applyPhysics(i - 1, j, k, this.id);
- } else if (i1 == 2) {
+ } else if (j1 == 2) {
world.applyPhysics(i + 1, j, k, this.id);
- } else if (i1 == 3) {
+ } else if (j1 == 3) {
world.applyPhysics(i, j, k - 1, this.id);
- } else if (i1 == 4) {
+ } else if (j1 == 4) {
world.applyPhysics(i, j, k + 1, this.id);
} else {
world.applyPhysics(i, j - 1, k, this.id);
}
}
- super.remove(world, i, j, k);
+ super.remove(world, i, j, k, l, i1);
}
public boolean a(IBlockAccess iblockaccess, int i, int j, int k, int l) {
return (iblockaccess.getData(i, j, k) & 8) > 0;
}
- public boolean d(World world, int i, int j, int k, int l) {
+ public boolean c(World world, int i, int j, int k, int l) {
int i1 = world.getData(i, j, k);
if ((i1 & 8) == 0) {
@@ -210,7 +209,7 @@ public class BlockButton extends Block {
return true;
}
- public void a(World world, int i, int j, int k, Random random) {
+ public void b(World world, int i, int j, int k, Random random) {
if (!world.isStatic) {
int l = world.getData(i, j, k);
@@ -221,7 +220,9 @@ public class BlockButton extends Block {
BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(block, 1, 0);
world.getServer().getPluginManager().callEvent(eventRedstone);
- if (eventRedstone.getNewCurrent() > 0) return;
+ if (eventRedstone.getNewCurrent() > 0) {
+ return;
+ }
// CraftBukkit end
world.setData(i, j, k, l & 7);
@@ -241,7 +242,7 @@ public class BlockButton extends Block {
}
world.makeSound((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D, "random.click", 0.3F, 0.5F);
- world.b(i, j, k, i, j, k);
+ world.d(i, j, k, i, j, k);
}
}
}
diff --git a/src/main/java/net/minecraft/server/BlockCactus.java b/src/main/java/net/minecraft/server/BlockCactus.java
index 1997a86381..87f2b36977 100644
--- a/src/main/java/net/minecraft/server/BlockCactus.java
+++ b/src/main/java/net/minecraft/server/BlockCactus.java
@@ -8,10 +8,11 @@ public class BlockCactus extends Block {
protected BlockCactus(int i, int j) {
super(i, j, Material.CACTUS);
- this.a(true);
+ this.b(true);
+ this.a(CreativeModeTab.c);
}
- public void a(World world, int i, int j, int k, Random random) {
+ public void b(World world, int i, int j, int k, Random random) {
if (world.isEmpty(i, j + 1, k)) {
int l;
@@ -35,37 +36,37 @@ public class BlockCactus extends Block {
public AxisAlignedBB e(World world, int i, int j, int k) {
float f = 0.0625F;
- return AxisAlignedBB.b((double) ((float) i + f), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) ((float) (j + 1) - f), (double) ((float) (k + 1) - f));
+ return AxisAlignedBB.a().a((double) ((float) i + f), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) ((float) (j + 1) - f), (double) ((float) (k + 1) - f));
}
public int a(int i) {
return i == 1 ? this.textureId - 1 : (i == 0 ? this.textureId + 1 : this.textureId);
}
- public boolean b() {
+ public boolean c() {
return false;
}
- public boolean a() {
+ public boolean d() {
return false;
}
- public int c() {
+ public int b() {
return 13;
}
public boolean canPlace(World world, int i, int j, int k) {
- return !super.canPlace(world, i, j, k) ? false : this.f(world, i, j, k);
+ return !super.canPlace(world, i, j, k) ? false : this.d(world, i, j, k);
}
public void doPhysics(World world, int i, int j, int k, int l) {
- if (!this.f(world, i, j, k)) {
- this.b(world, i, j, k, world.getData(i, j, k), 0);
+ if (!this.d(world, i, j, k)) {
+ this.c(world, i, j, k, world.getData(i, j, k), 0);
world.setTypeId(i, j, k, 0);
}
}
- public boolean f(World world, int i, int j, int k) {
+ public boolean d(World world, int i, int j, int k) {
if (world.getMaterial(i - 1, j, k).isBuildable()) {
return false;
} else if (world.getMaterial(i + 1, j, k).isBuildable()) {
diff --git a/src/main/java/net/minecraft/server/BlockCauldron.java b/src/main/java/net/minecraft/server/BlockCauldron.java
deleted file mode 100644
index ba44496150..0000000000
--- a/src/main/java/net/minecraft/server/BlockCauldron.java
+++ /dev/null
@@ -1,97 +0,0 @@
-package net.minecraft.server;
-
-import java.util.ArrayList;
-import java.util.Random;
-
-public class BlockCauldron extends Block {
-
- public BlockCauldron(int i) {
- super(i, Material.ORE);
- this.textureId = 154;
- }
-
- public int a(int i, int j) {
- return i == 1 ? 138 : (i == 0 ? 155 : 154);
- }
-
- public void a(World world, int i, int j, int k, AxisAlignedBB axisalignedbb, ArrayList arraylist) {
- this.a(0.0F, 0.0F, 0.0F, 1.0F, 0.3125F, 1.0F);
- super.a(world, i, j, k, axisalignedbb, arraylist);
- float f = 0.125F;
-
- this.a(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
- super.a(world, i, j, k, axisalignedbb, arraylist);
- this.a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
- super.a(world, i, j, k, axisalignedbb, arraylist);
- this.a(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
- super.a(world, i, j, k, axisalignedbb, arraylist);
- this.a(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
- super.a(world, i, j, k, axisalignedbb, arraylist);
- this.f();
- }
-
- public void f() {
- this.a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
- }
-
- public boolean a() {
- return false;
- }
-
- public int c() {
- return 24;
- }
-
- public boolean b() {
- return false;
- }
-
- public boolean interact(World world, int i, int j, int k, EntityHuman entityhuman) {
- if (world.isStatic) {
- return true;
- } else {
- ItemStack itemstack = entityhuman.inventory.getItemInHand();
-
- if (itemstack == null) {
- return true;
- } else {
- int l = world.getData(i, j, k);
-
- if (itemstack.id == Item.WATER_BUCKET.id) {
- if (l < 3) {
- if (!entityhuman.abilities.canInstantlyBuild) {
- entityhuman.inventory.setItem(entityhuman.inventory.itemInHandIndex, new ItemStack(Item.BUCKET));
- }
-
- world.setData(i, j, k, 3);
- }
-
- return true;
- } else {
- if (itemstack.id == Item.GLASS_BOTTLE.id && l > 0) {
- ItemStack itemstack1 = new ItemStack(Item.POTION, 1, 0);
-
- if (!entityhuman.inventory.pickup(itemstack1)) {
- world.addEntity(new EntityItem(world, (double) i + 0.5D, (double) j + 1.5D, (double) k + 0.5D, itemstack1));
- } else if (entityhuman instanceof EntityPlayer) { // CraftBukkit
- ((EntityPlayer) entityhuman).updateInventory(entityhuman.defaultContainer); // CraftBukkit
- }
-
- --itemstack.count;
- if (itemstack.count <= 0) {
- entityhuman.inventory.setItem(entityhuman.inventory.itemInHandIndex, (ItemStack) null);
- }
-
- world.setData(i, j, k, l - 1);
- }
-
- return true;
- }
- }
- }
- }
-
- public int getDropType(int i, Random random, int j) {
- return Item.CAULDRON.id;
- }
-}
diff --git a/src/main/java/net/minecraft/server/BlockCrops.java b/src/main/java/net/minecraft/server/BlockCrops.java
index dfdbc746a3..58d31cc954 100644
--- a/src/main/java/net/minecraft/server/BlockCrops.java
+++ b/src/main/java/net/minecraft/server/BlockCrops.java
@@ -7,23 +7,24 @@ public class BlockCrops extends BlockFlower {
protected BlockCrops(int i, int j) {
super(i, j);
this.textureId = j;
- this.a(true);
+ this.b(true);
float f = 0.5F;
this.a(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f);
+ this.a((CreativeModeTab) null);
}
- protected boolean d(int i) {
+ protected boolean d_(int i) {
return i == Block.SOIL.id;
}
- public void a(World world, int i, int j, int k, Random random) {
- super.a(world, i, j, k, random);
+ public void b(World world, int i, int j, int k, Random random) {
+ super.b(world, i, j, k, random);
if (world.getLightLevel(i, j + 1, k) >= 9) {
int l = world.getData(i, j, k);
if (l < 7) {
- float f = this.i(world, i, j, k);
+ float f = this.l(world, i, j, k);
if (random.nextInt((int) (25.0F / f) + 1) == 0) {
org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, i, j, k, this.id, ++l); // CraftBukkit
@@ -32,11 +33,11 @@ public class BlockCrops extends BlockFlower {
}
}
- public void g(World world, int i, int j, int k) {
+ public void c_(World world, int i, int j, int k) {
world.setData(i, j, k, 7);
}
- private float i(World world, int i, int j, int k) {
+ private float l(World world, int i, int j, int k) {
float f = 1.0F;
int l = world.getTypeId(i, j, k - 1);
int i1 = world.getTypeId(i, j, k + 1);
@@ -85,7 +86,7 @@ public class BlockCrops extends BlockFlower {
return this.textureId + j;
}
- public int c() {
+ public int b() {
return 6;
}
diff --git a/src/main/java/net/minecraft/server/BlockDispenser.java b/src/main/java/net/minecraft/server/BlockDispenser.java
index 8a00967479..c6636f27ad 100644
--- a/src/main/java/net/minecraft/server/BlockDispenser.java
+++ b/src/main/java/net/minecraft/server/BlockDispenser.java
@@ -14,9 +14,10 @@ public class BlockDispenser extends BlockContainer {
protected BlockDispenser(int i) {
super(i, Material.STONE);
this.textureId = 45;
+ this.a(CreativeModeTab.d);
}
- public int d() {
+ public int p_() {
return 4;
}
@@ -26,10 +27,10 @@ public class BlockDispenser extends BlockContainer {
public void onPlace(World world, int i, int j, int k) {
super.onPlace(world, i, j, k);
- this.g(world, i, j, k);
+ this.l(world, i, j, k);
}
- private void g(World world, int i, int j, int k) {
+ private void l(World world, int i, int j, int k) {
if (!world.isStatic) {
int l = world.getTypeId(i, j, k - 1);
int i1 = world.getTypeId(i, j, k + 1);
@@ -61,7 +62,7 @@ public class BlockDispenser extends BlockContainer {
return i == 1 ? this.textureId + 17 : (i == 0 ? this.textureId + 17 : (i == 3 ? this.textureId + 1 : this.textureId));
}
- public boolean interact(World world, int i, int j, int k, EntityHuman entityhuman) {
+ public boolean interact(World world, int i, int j, int k, EntityHuman entityhuman, int l, float f, float f1, float f2) {
if (world.isStatic) {
return true;
} else {
@@ -75,7 +76,7 @@ public class BlockDispenser extends BlockContainer {
}
}
- // CraftBukkit - priv to public
+ // CraftBukkit - private to public
public void dispense(World world, int i, int j, int k, Random random) {
int l = world.getData(i, j, k);
byte b0 = 0;
@@ -94,103 +95,53 @@ public class BlockDispenser extends BlockContainer {
TileEntityDispenser tileentitydispenser = (TileEntityDispenser) world.getTileEntity(i, j, k);
if (tileentitydispenser != null) {
- // CraftBukkit start
- int dispenseSlot = tileentitydispenser.findDispenseSlot();
- ItemStack itemstack = null;
- if (dispenseSlot > -1) {
- itemstack = tileentitydispenser.getContents()[dispenseSlot];
+ int i1 = tileentitydispenser.i();
- // Copy item stack, because we want it to have 1 item
- itemstack = new ItemStack(itemstack.id, 1, itemstack.getData(), itemstack.getEnchantments());
- }
- // CraftBukkit end
-
- double d0 = (double) i + (double) b0 * 0.6D + 0.5D;
- double d1 = (double) j + 0.5D;
- double d2 = (double) k + (double) b1 * 0.6D + 0.5D;
-
- if (itemstack == null) {
+ if (i1 < 0) {
world.triggerEffect(1001, i, j, k, 0);
} else {
- // CraftBukkit start
- double d3 = random.nextDouble() * 0.1D + 0.2D;
- double motX = (double) b0 * d3;
- double motY = 0.20000000298023224D;
- double motZ = (double) b1 * d3;
- motX += random.nextGaussian() * 0.007499999832361937D * 6.0D;
- motY += random.nextGaussian() * 0.007499999832361937D * 6.0D;
- motZ += random.nextGaussian() * 0.007499999832361937D * 6.0D;
+ double d0 = (double) i + (double) b0 * 0.6D + 0.5D;
+ double d1 = (double) j + 0.5D;
+ double d2 = (double) k + (double) b1 * 0.6D + 0.5D;
+ ItemStack itemstack = tileentitydispenser.getItem(i1);
+ int j1 = a(tileentitydispenser, world, itemstack, random, i, j, k, b0, b1, d0, d1, d2);
- org.bukkit.block.Block block = world.getWorld().getBlockAt(i, j, k);
- org.bukkit.inventory.ItemStack bukkitItem = new CraftItemStack(itemstack).clone();
-
- BlockDispenseEvent event = new BlockDispenseEvent(block, bukkitItem, new org.bukkit.util.Vector(motX, motY, motZ));
- world.getServer().getPluginManager().callEvent(event);
-
- if (event.isCancelled()) {
- return;
- }
-
- if (event.getItem().equals(bukkitItem)) {
- // Actually remove the item
- tileentitydispenser.splitStack(dispenseSlot, 1);
- }
-
- motX = event.getVelocity().getX();
- motY = event.getVelocity().getY();
- motZ = event.getVelocity().getZ();
-
- itemstack = CraftItemStack.createNMSItemStack(event.getItem());
- // CraftBukkit end
-
- if (itemstack.id == Item.ARROW.id) {
- EntityArrow entityarrow = new EntityArrow(world, d0, d1, d2);
-
- entityarrow.shoot((double) b0, 0.10000000149011612D, (double) b1, 1.1F, 6.0F);
- entityarrow.fromPlayer = true;
- world.addEntity(entityarrow);
- world.triggerEffect(1002, i, j, k, 0);
- } else if (itemstack.id == Item.EGG.id) {
- EntityEgg entityegg = new EntityEgg(world, d0, d1, d2);
-
- entityegg.a((double) b0, 0.10000000149011612D, (double) b1, 1.1F, 6.0F);
- world.addEntity(entityegg);
- world.triggerEffect(1002, i, j, k, 0);
- } else if (itemstack.id == Item.SNOW_BALL.id) {
- EntitySnowball entitysnowball = new EntitySnowball(world, d0, d1, d2);
-
- entitysnowball.a((double) b0, 0.10000000149011612D, (double) b1, 1.1F, 6.0F);
- world.addEntity(entitysnowball);
- world.triggerEffect(1002, i, j, k, 0);
- } else if (itemstack.id == Item.POTION.id && ItemPotion.c(itemstack.getData())) {
- EntityPotion entitypotion = new EntityPotion(world, d0, d1, d2, itemstack.getData());
-
- entitypotion.a((double) b0, 0.10000000149011612D, (double) b1, 1.375F, 3.0F);
- world.addEntity(entitypotion);
- world.triggerEffect(1002, i, j, k, 0);
- } else if (itemstack.id == Item.EXP_BOTTLE.id) {
- EntityThrownExpBottle entitythrownexpbottle = new EntityThrownExpBottle(world, d0, d1, d2);
-
- entitythrownexpbottle.a((double) b0, 0.10000000149011612D, (double) b1, 1.375F, 3.0F);
- world.addEntity(entitythrownexpbottle);
- world.triggerEffect(1002, i, j, k, 0);
- } else if (itemstack.id == Item.MONSTER_EGG.id) {
- ItemMonsterEgg.a(world, itemstack.getData(), d0 + (double) b0 * 0.3D, d1 - 0.3D, d2 + (double) b1 * 0.3D);
- world.triggerEffect(1002, i, j, k, 0);
- } else if (itemstack.id == Item.FIREBALL.id) {
- EntitySmallFireball entitysmallfireball = new EntitySmallFireball(world, d0 + (double) b0 * 0.3D, d1, d2 + (double) b1 * 0.3D, (double) b0 + random.nextGaussian() * 0.05D, random.nextGaussian() * 0.05D, (double) b1 + random.nextGaussian() * 0.05D);
-
- world.addEntity(entitysmallfireball);
- world.triggerEffect(1009, i, j, k, 0);
- } else {
- EntityItem entityitem = new EntityItem(world, d0, d1 - 0.3D, d2, itemstack);
+ if (j1 == 1) {
+ tileentitydispenser.splitStack(i1, 1);
+ } else if (j1 == 0) {
// CraftBukkit start
- // double d3 = random.nextDouble() * 0.1D + 0.2D; // Moved up
- entityitem.motX = motX;
- entityitem.motY = motY;
- entityitem.motZ = motZ;
+ double d3 = random.nextDouble() * 0.1D + 0.2D;
+ double motX = (double) b0 * d3;
+ double motY = 0.20000000298023224D;
+ double motZ = (double) b1 * d3;
+ motX += random.nextGaussian() * 0.007499999832361937D * 6.0D;
+ motY += random.nextGaussian() * 0.007499999832361937D * 6.0D;
+ motZ += random.nextGaussian() * 0.007499999832361937D * 6.0D;
+
+ org.bukkit.block.Block block = world.getWorld().getBlockAt(i, j, k);
+ org.bukkit.inventory.ItemStack bukkitItem = new CraftItemStack(itemstack).clone();
+
+ BlockDispenseEvent event = new BlockDispenseEvent(block, bukkitItem, new org.bukkit.util.Vector(motX, motY, motZ));
+ world.getServer().getPluginManager().callEvent(event);
+
+ if (event.isCancelled()) {
+ return;
+ }
+
+ if (event.getItem().equals(bukkitItem)) {
+ // Actually remove the item
+ tileentitydispenser.splitStack(i1, 1);
+ }
+
+ motX = event.getVelocity().getX();
+ motY = event.getVelocity().getY();
+ motZ = event.getVelocity().getZ();
+
+ itemstack = CraftItemStack.createNMSItemStack(event.getItem());
+
+ a(world, itemstack, random, motX, motY, motZ, d0, d1, d2);
// CraftBukkit end
- world.addEntity(entityitem);
+
world.triggerEffect(1000, i, j, k, 0);
}
@@ -204,18 +155,18 @@ public class BlockDispenser extends BlockContainer {
boolean flag = world.isBlockIndirectlyPowered(i, j, k) || world.isBlockIndirectlyPowered(i, j + 1, k);
if (flag) {
- world.c(i, j, k, this.id, this.d());
+ world.a(i, j, k, this.id, this.p_());
}
}
}
- public void a(World world, int i, int j, int k, Random random) {
+ public void b(World world, int i, int j, int k, Random random) {
if (!world.isStatic && (world.isBlockIndirectlyPowered(i, j, k) || world.isBlockIndirectlyPowered(i, j + 1, k))) {
this.dispense(world, i, j, k, random);
}
}
- public TileEntity a_() {
+ public TileEntity a(World world) {
return new TileEntityDispenser();
}
@@ -239,12 +190,12 @@ public class BlockDispenser extends BlockContainer {
}
}
- public void remove(World world, int i, int j, int k) {
+ public void remove(World world, int i, int j, int k, int l, int i1) {
TileEntityDispenser tileentitydispenser = (TileEntityDispenser) world.getTileEntity(i, j, k);
if (tileentitydispenser != null) {
- for (int l = 0; l < tileentitydispenser.getSize(); ++l) {
- ItemStack itemstack = tileentitydispenser.getItem(l);
+ for (int j1 = 0; j1 < tileentitydispenser.getSize(); ++j1) {
+ ItemStack itemstack = tileentitydispenser.getItem(j1);
if (itemstack != null) {
float f = this.a.nextFloat() * 0.8F + 0.1F;
@@ -252,14 +203,14 @@ public class BlockDispenser extends BlockContainer {
float f2 = this.a.nextFloat() * 0.8F + 0.1F;
while (itemstack.count > 0) {
- int i1 = this.a.nextInt(21) + 10;
+ int k1 = this.a.nextInt(21) + 10;
- if (i1 > itemstack.count) {
- i1 = itemstack.count;
+ if (k1 > itemstack.count) {
+ k1 = itemstack.count;
}
- itemstack.count -= i1;
- EntityItem entityitem = new EntityItem(world, (double) ((float) i + f), (double) ((float) j + f1), (double) ((float) k + f2), new ItemStack(itemstack.id, i1, itemstack.getData()));
+ itemstack.count -= k1;
+ EntityItem entityitem = new EntityItem(world, (double) ((float) i + f), (double) ((float) j + f1), (double) ((float) k + f2), new ItemStack(itemstack.id, k1, itemstack.getData()));
if (itemstack.hasTag()) {
entityitem.itemStack.setTag((NBTTagCompound) itemstack.getTag().clone());
@@ -276,6 +227,150 @@ public class BlockDispenser extends BlockContainer {
}
}
- super.remove(world, i, j, k);
+ super.remove(world, i, j, k, l, i1);
+ }
+
+ // CraftBukkit start - change of method signature!
+ private static void a(World world, ItemStack itemstack, Random random, double motX, double motY, double motZ, double d0, double d1, double d2) {
+ EntityItem entityitem = new EntityItem(world, d0, d1 - 0.3D, d2, itemstack);
+ // double d3 = random.nextDouble() * 0.1D + 0.2D; // Moved up
+
+ entityitem.motX = motX;
+ entityitem.motY = motY;
+ entityitem.motZ = motZ;
+ world.addEntity(entityitem);
+ }
+ // CraftBukkit end
+
+ private static int a(TileEntityDispenser tileentitydispenser, World world, ItemStack itemstack, Random random, int i, int j, int k, int l, int i1, double d0, double d1, double d2) {
+ float f = 1.1F;
+ byte b0 = 6;
+
+ if (itemstack.id == Item.ARROW.id) {
+ EntityArrow entityarrow = new EntityArrow(world, d0, d1, d2);
+
+ entityarrow.shoot((double) l, 0.10000000149011612D, (double) i1, f, (float) b0);
+ entityarrow.fromPlayer = 1;
+ world.addEntity(entityarrow);
+ world.triggerEffect(1002, i, j, k, 0);
+ return 1;
+ } else if (itemstack.id == Item.EGG.id) {
+ EntityEgg entityegg = new EntityEgg(world, d0, d1, d2);
+
+ entityegg.c((double) l, 0.10000000149011612D, (double) i1, f, (float) b0);
+ world.addEntity(entityegg);
+ world.triggerEffect(1002, i, j, k, 0);
+ return 1;
+ } else if (itemstack.id == Item.SNOW_BALL.id) {
+ EntitySnowball entitysnowball = new EntitySnowball(world, d0, d1, d2);
+
+ entitysnowball.c((double) l, 0.10000000149011612D, (double) i1, f, (float) b0);
+ world.addEntity(entitysnowball);
+ world.triggerEffect(1002, i, j, k, 0);
+ return 1;
+ } else if (itemstack.id == Item.POTION.id && ItemPotion.g(itemstack.getData())) {
+ EntityPotion entitypotion = new EntityPotion(world, d0, d1, d2, itemstack.getData());
+
+ entitypotion.c((double) l, 0.10000000149011612D, (double) i1, f * 1.25F, (float) b0 * 0.5F);
+ world.addEntity(entitypotion);
+ world.triggerEffect(1002, i, j, k, 0);
+ return 1;
+ } else if (itemstack.id == Item.EXP_BOTTLE.id) {
+ EntityThrownExpBottle entitythrownexpbottle = new EntityThrownExpBottle(world, d0, d1, d2);
+
+ entitythrownexpbottle.c((double) l, 0.10000000149011612D, (double) i1, f * 1.25F, (float) b0 * 0.5F);
+ world.addEntity(entitythrownexpbottle);
+ world.triggerEffect(1002, i, j, k, 0);
+ return 1;
+ } else if (itemstack.id == Item.MONSTER_EGG.id) {
+ ItemMonsterEgg.a(world, itemstack.getData(), d0 + (double) l * 0.3D, d1 - 0.3D, d2 + (double) i1 * 0.3D);
+ world.triggerEffect(1002, i, j, k, 0);
+ return 1;
+ } else if (itemstack.id == Item.FIREBALL.id) {
+ EntitySmallFireball entitysmallfireball = new EntitySmallFireball(world, d0 + (double) l * 0.3D, d1, d2 + (double) i1 * 0.3D, (double) l + random.nextGaussian() * 0.05D, random.nextGaussian() * 0.05D, (double) i1 + random.nextGaussian() * 0.05D);
+
+ world.addEntity(entitysmallfireball);
+ world.triggerEffect(1009, i, j, k, 0);
+ return 1;
+ } else if (itemstack.id != Item.LAVA_BUCKET.id && itemstack.id != Item.WATER_BUCKET.id) {
+ if (itemstack.id == Item.BUCKET.id) {
+ int j1 = i + l;
+ int k1 = k + i1;
+ Material material = world.getMaterial(j1, j, k1);
+ int l1 = world.getData(j1, j, k1);
+
+ if (material == Material.WATER && l1 == 0) {
+ world.setTypeId(j1, j, k1, 0);
+ if (--itemstack.count == 0) {
+ itemstack.id = Item.WATER_BUCKET.id;
+ itemstack.count = 1;
+ } else if (tileentitydispenser.a(new ItemStack(Item.WATER_BUCKET)) < 0) {
+ a(world, new ItemStack(Item.WATER_BUCKET), random, 6, l, i1, d0, d1, d2);
+ }
+
+ return 2;
+ } else if (material == Material.LAVA && l1 == 0) {
+ world.setTypeId(j1, j, k1, 0);
+ if (--itemstack.count == 0) {
+ itemstack.id = Item.LAVA_BUCKET.id;
+ itemstack.count = 1;
+ } else if (tileentitydispenser.a(new ItemStack(Item.LAVA_BUCKET)) < 0) {
+ a(world, new ItemStack(Item.LAVA_BUCKET), random, 6, l, i1, d0, d1, d2);
+ }
+
+ return 2;
+ } else {
+ return 0;
+ }
+ } else if (itemstack.getItem() instanceof ItemMinecart) {
+ d0 = (double) i + (l < 0 ? (double) l * 0.8D : (double) ((float) l * 1.8F)) + (double) ((float) Math.abs(i1) * 0.5F);
+ d2 = (double) k + (i1 < 0 ? (double) i1 * 0.8D : (double) ((float) i1 * 1.8F)) + (double) ((float) Math.abs(l) * 0.5F);
+ if (BlockMinecartTrack.d_(world, i + l, j, k + i1)) {
+ d1 = (double) ((float) j + 0.5F);
+ } else {
+ if (!world.isEmpty(i + l, j, k + i1) || !BlockMinecartTrack.d_(world, i + l, j - 1, k + i1)) {
+ return 0;
+ }
+
+ d1 = (double) ((float) j - 0.5F);
+ }
+
+ EntityMinecart entityminecart = new EntityMinecart(world, d0, d1, d2, ((ItemMinecart) itemstack.getItem()).a);
+
+ world.addEntity(entityminecart);
+ world.triggerEffect(1000, i, j, k, 0);
+ return 1;
+ } else if (itemstack.id == Item.BOAT.id) {
+ d0 = (double) i + (l < 0 ? (double) l * 0.8D : (double) ((float) l * 1.8F)) + (double) ((float) Math.abs(i1) * 0.5F);
+ d2 = (double) k + (i1 < 0 ? (double) i1 * 0.8D : (double) ((float) i1 * 1.8F)) + (double) ((float) Math.abs(l) * 0.5F);
+ if (world.getMaterial(i + l, j, k + i1) == Material.WATER) {
+ d1 = (double) ((float) j + 1.0F);
+ } else {
+ if (!world.isEmpty(i + l, j, k + i1) || world.getMaterial(i + l, j - 1, k + i1) != Material.WATER) {
+ return 0;
+ }
+
+ d1 = (double) j;
+ }
+
+ EntityBoat entityboat = new EntityBoat(world, d0, d1, d2);
+
+ world.addEntity(entityboat);
+ world.triggerEffect(1000, i, j, k, 0);
+ return 1;
+ } else {
+ return 0;
+ }
+ } else {
+ ItemBucket itembucket = (ItemBucket) itemstack.getItem();
+
+ if (itembucket.a(world, (double) i, (double) j, (double) k, i + l, j, k + i1)) {
+ itemstack.id = Item.BUCKET.id;
+ itemstack.count = 1;
+ return 2;
+ } else {
+ return 0;
+ }
+ }
}
}
diff --git a/src/main/java/net/minecraft/server/BlockDoor.java b/src/main/java/net/minecraft/server/BlockDoor.java
index 8ce6fc8d4a..933e27557f 100644
--- a/src/main/java/net/minecraft/server/BlockDoor.java
+++ b/src/main/java/net/minecraft/server/BlockDoor.java
@@ -19,21 +19,21 @@ public class BlockDoor extends Block {
this.a(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f1, 0.5F + f);
}
- public boolean a() {
+ public boolean d() {
return false;
}
- public boolean b(IBlockAccess iblockaccess, int i, int j, int k) {
- int l = this.e(iblockaccess, i, j, k);
+ public boolean c(IBlockAccess iblockaccess, int i, int j, int k) {
+ int l = this.b_(iblockaccess, i, j, k);
return (l & 4) != 0;
}
- public boolean b() {
+ public boolean c() {
return false;
}
- public int c() {
+ public int b() {
return 7;
}
@@ -43,18 +43,18 @@ public class BlockDoor extends Block {
}
public void updateShape(IBlockAccess iblockaccess, int i, int j, int k) {
- this.d(this.e(iblockaccess, i, j, k));
+ this.e(this.b_(iblockaccess, i, j, k));
}
- public int c(IBlockAccess iblockaccess, int i, int j, int k) {
- return this.e(iblockaccess, i, j, k) & 3;
+ public int d(IBlockAccess iblockaccess, int i, int j, int k) {
+ return this.b_(iblockaccess, i, j, k) & 3;
}
- public boolean d(IBlockAccess iblockaccess, int i, int j, int k) {
- return (this.e(iblockaccess, i, j, k) & 4) != 0;
+ public boolean a_(IBlockAccess iblockaccess, int i, int j, int k) {
+ return (this.b_(iblockaccess, i, j, k) & 4) != 0;
}
- private void d(int i) {
+ private void e(int i) {
float f = 0.1875F;
this.a(0.0F, 0.0F, 0.0F, 1.0F, 2.0F, 1.0F);
@@ -63,58 +63,66 @@ public class BlockDoor extends Block {
boolean flag1 = (i & 16) != 0;
if (j == 0) {
- if (!flag) {
- this.a(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
- } else if (!flag1) {
- this.a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
+ if (flag) {
+ if (!flag1) {
+ this.a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
+ } else {
+ this.a(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
+ }
} else {
- this.a(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
+ this.a(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
}
} else if (j == 1) {
- if (!flag) {
- this.a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
- } else if (!flag1) {
- this.a(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+ if (flag) {
+ if (!flag1) {
+ this.a(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+ } else {
+ this.a(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
+ }
} else {
- this.a(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
+ this.a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
}
} else if (j == 2) {
- if (!flag) {
- this.a(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
- } else if (!flag1) {
- this.a(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
+ if (flag) {
+ if (!flag1) {
+ this.a(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
+ } else {
+ this.a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
+ }
} else {
- this.a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
+ this.a(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
}
} else if (j == 3) {
- if (!flag) {
- this.a(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
- } else if (!flag1) {
- this.a(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
+ if (flag) {
+ if (!flag1) {
+ this.a(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
+ } else {
+ this.a(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+ }
} else {
- this.a(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+ this.a(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
}
}
}
public void attack(World world, int i, int j, int k, EntityHuman entityhuman) {
- this.interact(world, i, j, k, entityhuman);
+ this.interact(world, i, j, k, entityhuman, 0, 0.0F, 0.0F, 0.0F);
}
- public boolean interact(World world, int i, int j, int k, EntityHuman entityhuman) {
+ public boolean interact(World world, int i, int j, int k, EntityHuman entityhuman, int l, float f, float f1, float f2) {
if (this.material == Material.ORE) {
return true;
} else {
- int l = this.e((IBlockAccess) world, i, j, k);
- int i1 = l & 7;
+ int i1 = this.b_(world, i, j, k);
+ int j1 = i1 & 7;
- i1 ^= 4;
- if ((l & 8) != 0) {
- world.setData(i, j - 1, k, i1);
- world.b(i, j - 1, k, i, j, k);
+ j1 ^= 4;
+ if ((i1 & 8) == 0) {
+ world.setData(i, j, k, j1);
+ world.d(i, j, k, i, j, k);
} else {
- world.setData(i, j, k, i1);
- world.b(i, j, k, i, j, k);
+ world.setData(i, j - 1, k, j1);
+ world.d(i, j - 1, k, i, j, k);
}
world.a(entityhuman, 1003, i, j, k, 0);
@@ -123,19 +131,19 @@ public class BlockDoor extends Block {
}
public void setDoor(World world, int i, int j, int k, boolean flag) {
- int l = this.e((IBlockAccess) world, i, j, k);
+ int l = this.b_(world, i, j, k);
boolean flag1 = (l & 4) != 0;
if (flag1 != flag) {
int i1 = l & 7;
i1 ^= 4;
- if ((l & 8) != 0) {
- world.setData(i, j - 1, k, i1);
- world.b(i, j - 1, k, i, j, k);
- } else {
+ if ((l & 8) == 0) {
world.setData(i, j, k, i1);
- world.b(i, j, k, i, j, k);
+ world.d(i, j, k, i, j, k);
+ } else {
+ world.setData(i, j - 1, k, i1);
+ world.d(i, j - 1, k, i, j, k);
}
world.a((EntityHuman) null, 1003, i, j, k, 0);
@@ -145,14 +153,7 @@ public class BlockDoor extends Block {
public void doPhysics(World world, int i, int j, int k, int l) {
int i1 = world.getData(i, j, k);
- if ((i1 & 8) != 0) {
- if (world.getTypeId(i, j - 1, k) != this.id) {
- world.setTypeId(i, j, k, 0);
- }
- else if (l > 0 && l != this.id) { // CraftBukkit
- this.doPhysics(world, i, j - 1, k, l);
- }
- } else {
+ if ((i1 & 8) == 0) {
boolean flag = false;
if (world.getTypeId(i, j + 1, k) != this.id) {
@@ -160,7 +161,7 @@ public class BlockDoor extends Block {
flag = true;
}
- if (!world.e(i, j - 1, k)) {
+ if (!world.t(i, j - 1, k)) {
world.setTypeId(i, j, k, 0);
flag = true;
if (world.getTypeId(i, j + 1, k) == this.id) {
@@ -170,7 +171,7 @@ public class BlockDoor extends Block {
if (flag) {
if (!world.isStatic) {
- this.b(world, i, j, k, i1, 0);
+ this.c(world, i, j, k, i1, 0);
}
// CraftBukkit start
} else if (l > 0 && Block.byId[l].isPowerSource()) {
@@ -191,6 +192,13 @@ public class BlockDoor extends Block {
}
// CraftBukkit end
}
+ } else {
+ if (world.getTypeId(i, j - 1, k) != this.id) {
+ world.setTypeId(i, j, k, 0);
+ }
+ else if (l > 0 && l != this.id) { // CraftBukkit
+ this.doPhysics(world, i, j - 1, k, l);
+ }
}
}
@@ -204,14 +212,14 @@ public class BlockDoor extends Block {
}
public boolean canPlace(World world, int i, int j, int k) {
- return j >= 255 ? false : world.e(i, j - 1, k) && super.canPlace(world, i, j, k) && super.canPlace(world, i, j + 1, k);
+ return j >= 255 ? false : world.t(i, j - 1, k) && super.canPlace(world, i, j, k) && super.canPlace(world, i, j + 1, k);
}
- public int g() {
+ public int e() {
return 1;
}
- public int e(IBlockAccess iblockaccess, int i, int j, int k) {
+ public int b_(IBlockAccess iblockaccess, int i, int j, int k) {
int l = iblockaccess.getData(i, j, k);
boolean flag = (l & 8) != 0;
int i1;
@@ -226,8 +234,7 @@ public class BlockDoor extends Block {
}
boolean flag1 = (j1 & 1) != 0;
- int k1 = i1 & 7 | (flag ? 8 : 0) | (flag1 ? 16 : 0);
- return k1;
+ return i1 & 7 | (flag ? 8 : 0) | (flag1 ? 16 : 0);
}
}
diff --git a/src/main/java/net/minecraft/server/BlockDragonEgg.java b/src/main/java/net/minecraft/server/BlockDragonEgg.java
index f97b7cf12a..9c0ec84689 100644
--- a/src/main/java/net/minecraft/server/BlockDragonEgg.java
+++ b/src/main/java/net/minecraft/server/BlockDragonEgg.java
@@ -11,22 +11,22 @@ public class BlockDragonEgg extends Block {
}
public void onPlace(World world, int i, int j, int k) {
- world.c(i, j, k, this.id, this.d());
+ world.a(i, j, k, this.id, this.p_());
}
public void doPhysics(World world, int i, int j, int k, int l) {
- world.c(i, j, k, this.id, this.d());
+ world.a(i, j, k, this.id, this.p_());
}
- public void a(World world, int i, int j, int k, Random random) {
- this.g(world, i, j, k);
+ public void b(World world, int i, int j, int k, Random random) {
+ this.l(world, i, j, k);
}
- private void g(World world, int i, int j, int k) {
+ private void l(World world, int i, int j, int k) {
if (BlockSand.canFall(world, i, j - 1, k) && j >= 0) {
byte b0 = 32;
- if (!BlockSand.instaFall && world.a(i - b0, j - b0, k - b0, i + b0, j + b0, k + b0)) {
+ if (!BlockSand.instaFall && world.c(i - b0, j - b0, k - b0, i + b0, j + b0, k + b0)) {
// CraftBukkit - added data
EntityFallingBlock entityfallingblock = new EntityFallingBlock(world, (double) ((float) i + 0.5F), (double) ((float) j + 0.5F), (double) ((float) k + 0.5F), this.id, world.getData(i, j, k));
@@ -45,16 +45,16 @@ public class BlockDragonEgg extends Block {
}
}
- public boolean interact(World world, int i, int j, int k, EntityHuman entityhuman) {
- this.h(world, i, j, k);
+ public boolean interact(World world, int i, int j, int k, EntityHuman entityhuman, int l, float f, float f1, float f2) {
+ this.n(world, i, j, k);
return true;
}
public void attack(World world, int i, int j, int k, EntityHuman entityhuman) {
- this.h(world, i, j, k);
+ this.n(world, i, j, k);
}
- private void h(World world, int i, int j, int k) {
+ private void n(World world, int i, int j, int k) {
if (world.getTypeId(i, j, k) == this.id) {
if (!world.isStatic) {
for (int l = 0; l < 1000; ++l) {
@@ -72,6 +72,7 @@ public class BlockDragonEgg extends Block {
if (event.isCancelled()) {
return;
}
+
i1 = event.getToBlock().getX();
j1 = event.getToBlock().getY();
k1 = event.getToBlock().getZ();
@@ -100,23 +101,19 @@ public class BlockDragonEgg extends Block {
}
}
- public int d() {
+ public int p_() {
return 3;
}
- public boolean canPlace(World world, int i, int j, int k) {
- return super.canPlace(world, i, j, k);
- }
-
- public boolean a() {
+ public boolean d() {
return false;
}
- public boolean b() {
+ public boolean c() {
return false;
}
- public int c() {
+ public int b() {
return 27;
}
}
diff --git a/src/main/java/net/minecraft/server/BlockFire.java b/src/main/java/net/minecraft/server/BlockFire.java
index 3a4ce88131..5d1ebab66a 100644
--- a/src/main/java/net/minecraft/server/BlockFire.java
+++ b/src/main/java/net/minecraft/server/BlockFire.java
@@ -15,13 +15,18 @@ public class BlockFire extends Block {
protected BlockFire(int i, int j) {
super(i, j, Material.FIRE);
- this.a(true);
+ this.b(true);
}
- public void k() {
+ public void r_() {
this.a(Block.WOOD.id, 5, 20);
+ this.a(Block.WOOD_DOUBLE_STEP.id, 5, 20);
+ this.a(Block.WOOD_STEP.id, 5, 20);
this.a(Block.FENCE.id, 5, 20);
this.a(Block.WOOD_STAIRS.id, 5, 20);
+ this.a(Block.BIRCH_WOOD_STAIRS.id, 5, 20);
+ this.a(Block.SPRUCE_WOOD_STAIRS.id, 5, 20);
+ this.a(Block.JUNGLE_WOOD_STAIRS.id, 5, 20);
this.a(Block.LOG.id, 5, 5);
this.a(Block.LEAVES.id, 30, 60);
this.a(Block.BOOKSHELF.id, 30, 20);
@@ -40,15 +45,15 @@ public class BlockFire extends Block {
return null;
}
- public boolean a() {
+ public boolean d() {
return false;
}
- public boolean b() {
+ public boolean c() {
return false;
}
- public int c() {
+ public int b() {
return 3;
}
@@ -56,11 +61,11 @@ public class BlockFire extends Block {
return 0;
}
- public int d() {
+ public int p_() {
return 30;
}
- public void a(World world, int i, int j, int k, Random random) {
+ public void b(World world, int i, int j, int k, Random random) {
boolean flag = world.getTypeId(i, j - 1, k) == Block.NETHERRACK.id;
if (world.worldProvider instanceof WorldProviderTheEnd && world.getTypeId(i, j - 1, k) == Block.BEDROCK.id) {
@@ -68,11 +73,11 @@ public class BlockFire extends Block {
}
if (!this.canPlace(world, i, j, k)) {
- fireExtinguished(world, i, j, k); // CraftBukkit - invalid place location
+ fireExtinguished(world, i, j, k); // CraftBukkit - invalid place location
}
- if (!flag && world.x() && (world.y(i, j, k) || world.y(i - 1, j, k) || world.y(i + 1, j, k) || world.y(i, j, k - 1) || world.y(i, j, k + 1))) {
- fireExtinguished(world, i, j, k); // CraftBukkit - extinguished by rain
+ if (!flag && world.J() && (world.B(i, j, k) || world.B(i - 1, j, k) || world.B(i + 1, j, k) || world.B(i, j, k - 1) || world.B(i, j, k + 1))) {
+ fireExtinguished(world, i, j, k); // CraftBukkit - extinguished by rain
} else {
int l = world.getData(i, j, k);
@@ -80,15 +85,15 @@ public class BlockFire extends Block {
world.setRawData(i, j, k, l + random.nextInt(3) / 2);
}
- world.c(i, j, k, this.id, this.d() + random.nextInt(10));
- if (!flag && !this.g(world, i, j, k)) {
- if (!world.e(i, j - 1, k) || l > 3) {
- fireExtinguished(world, i, j, k); // CraftBukkit - burn out
+ world.a(i, j, k, this.id, this.p_() + random.nextInt(10));
+ if (!flag && !this.l(world, i, j, k)) {
+ if (!world.t(i, j - 1, k) || l > 3) {
+ fireExtinguished(world, i, j, k); // CraftBukkit - burn out
}
- } else if (!flag && !this.c(world, i, j - 1, k) && l == 15 && random.nextInt(4) == 0) {
- fireExtinguished(world, i, j, k); // CraftBukkit - burn out
+ } else if (!flag && !this.d((IBlockAccess) world, i, j - 1, k) && l == 15 && random.nextInt(4) == 0) {
+ fireExtinguished(world, i, j, k); // CraftBukkit - burn out
} else {
- boolean flag1 = world.z(i, j, k);
+ boolean flag1 = world.C(i, j, k);
byte b0 = 0;
if (flag1) {
@@ -102,7 +107,7 @@ public class BlockFire extends Block {
this.a(world, i, j, k - 1, 300 + b0, random, l);
this.a(world, i, j, k + 1, 300 + b0, random, l);
- // CraftBukkit start - Call to stop spread of fire.
+ // CraftBukkit start - call to stop spread of fire
org.bukkit.Server server = world.getServer();
org.bukkit.World bworld = world.getWorld();
@@ -120,7 +125,7 @@ public class BlockFire extends Block {
l1 += (k1 - (j + 1)) * 100;
}
- int i2 = this.h(world, i1, k1, j1);
+ int i2 = this.n(world, i1, k1, j1);
if (i2 > 0) {
int j2 = (i2 + 40) / (l + 30);
@@ -129,13 +134,14 @@ public class BlockFire extends Block {
j2 /= 2;
}
- if (j2 > 0 && random.nextInt(l1) <= j2 && (!world.x() || !world.y(i1, k1, j1)) && !world.y(i1 - 1, k1, k) && !world.y(i1 + 1, k1, j1) && !world.y(i1, k1, j1 - 1) && !world.y(i1, k1, j1 + 1)) {
+ if (j2 > 0 && random.nextInt(l1) <= j2 && (!world.J() || !world.B(i1, k1, j1)) && !world.B(i1 - 1, k1, k) && !world.B(i1 + 1, k1, j1) && !world.B(i1, k1, j1 - 1) && !world.B(i1, k1, j1 + 1)) {
int k2 = l + random.nextInt(5) / 4;
if (k2 > 15) {
k2 = 15;
}
- // CraftBukkit start - Call to stop spread of fire.
+
+ // CraftBukkit start - call to stop spread of fire
org.bukkit.block.Block block = bworld.getBlockAt(i1, k1, j1);
if (block.getTypeId() != Block.FIRE.id) {
@@ -173,6 +179,7 @@ public class BlockFire extends Block {
if (random.nextInt(l) < j1) {
boolean flag = world.getTypeId(i, j, k) == Block.TNT.id;
+
// CraftBukkit start
org.bukkit.block.Block theBlock = world.getWorld().getBlockAt(i, j, k);
@@ -184,7 +191,7 @@ public class BlockFire extends Block {
}
// CraftBukkit end
- if (random.nextInt(i1 + 10) < 5 && !world.y(i, j, k)) {
+ if (random.nextInt(i1 + 10) < 5 && !world.B(i, j, k)) {
int k1 = i1 + random.nextInt(5) / 4;
if (k1 > 15) {
@@ -202,60 +209,61 @@ public class BlockFire extends Block {
}
}
- private boolean g(World world, int i, int j, int k) {
- return this.c(world, i + 1, j, k) ? true : (this.c(world, i - 1, j, k) ? true : (this.c(world, i, j - 1, k) ? true : (this.c(world, i, j + 1, k) ? true : (this.c(world, i, j, k - 1) ? true : this.c(world, i, j, k + 1)))));
+ private boolean l(World world, int i, int j, int k) {
+ return this.d((IBlockAccess) world, i + 1, j, k) ? true : (this.d((IBlockAccess) world, i - 1, j, k) ? true : (this.d((IBlockAccess) world, i, j - 1, k) ? true : (this.d((IBlockAccess) world, i, j + 1, k) ? true : (this.d((IBlockAccess) world, i, j, k - 1) ? true : this.d((IBlockAccess) world, i, j, k + 1)))));
}
- private int h(World world, int i, int j, int k) {
+ private int n(World world, int i, int j, int k) {
byte b0 = 0;
if (!world.isEmpty(i, j, k)) {
return 0;
} else {
- int l = this.f(world, i + 1, j, k, b0);
+ int l = this.e(world, i + 1, j, k, b0);
- l = this.f(world, i - 1, j, k, l);
- l = this.f(world, i, j - 1, k, l);
- l = this.f(world, i, j + 1, k, l);
- l = this.f(world, i, j, k - 1, l);
- l = this.f(world, i, j, k + 1, l);
+ l = this.e(world, i - 1, j, k, l);
+ l = this.e(world, i, j - 1, k, l);
+ l = this.e(world, i, j + 1, k, l);
+ l = this.e(world, i, j, k - 1, l);
+ l = this.e(world, i, j, k + 1, l);
return l;
}
}
- public boolean E_() {
+ public boolean l() {
return false;
}
- public boolean c(IBlockAccess iblockaccess, int i, int j, int k) {
+ public boolean d(IBlockAccess iblockaccess, int i, int j, int k) {
return this.a[iblockaccess.getTypeId(i, j, k)] > 0;
}
- public int f(World world, int i, int j, int k, int l) {
+ public int e(World world, int i, int j, int k, int l) {
int i1 = this.a[world.getTypeId(i, j, k)];
return i1 > l ? i1 : l;
}
public boolean canPlace(World world, int i, int j, int k) {
- return world.e(i, j - 1, k) || this.g(world, i, j, k);
+ return world.t(i, j - 1, k) || this.l(world, i, j, k);
}
public void doPhysics(World world, int i, int j, int k, int l) {
- if (!world.e(i, j - 1, k) && !this.g(world, i, j, k)) {
- fireExtinguished(world, i, j, k); // CraftBukkit - fuel block gone
+ if (!world.t(i, j - 1, k) && !this.l(world, i, j, k)) {
+ fireExtinguished(world, i, j, k); // CraftBukkit - fuel block gone
}
}
public void onPlace(World world, int i, int j, int k) {
- if (world.worldProvider.dimension > 0 || world.getTypeId(i, j - 1, k) != Block.OBSIDIAN.id || !Block.PORTAL.b_(world, i, j, k)) {
- if (!world.e(i, j - 1, k) && !this.g(world, i, j, k)) {
- fireExtinguished(world, i, j, k); // CraftBukkit - fuel block broke
+ if (world.worldProvider.dimension > 0 || world.getTypeId(i, j - 1, k) != Block.OBSIDIAN.id || !Block.PORTAL.i_(world, i, j, k)) {
+ if (!world.t(i, j - 1, k) && !this.l(world, i, j, k)) {
+ fireExtinguished(world, i, j, k); // CraftBukkit - fuel block broke
} else {
- world.c(i, j, k, this.id, this.d() + world.random.nextInt(10));
+ world.a(i, j, k, this.id, this.p_() + world.random.nextInt(10));
}
}
}
+
// CraftBukkit start
private void fireExtinguished(World world, int x, int y, int z) {
if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world.getWorld().getBlockAt(x, y, z), 0).isCancelled() == false) {
diff --git a/src/main/java/net/minecraft/server/BlockFlowing.java b/src/main/java/net/minecraft/server/BlockFlowing.java
index 347733f2b6..e5f44a9014 100644
--- a/src/main/java/net/minecraft/server/BlockFlowing.java
+++ b/src/main/java/net/minecraft/server/BlockFlowing.java
@@ -17,26 +17,25 @@ public class BlockFlowing extends BlockFluids {
super(i, material);
}
- private void i(World world, int i, int j, int k) {
+ private void l(World world, int i, int j, int k) {
int l = world.getData(i, j, k);
world.setRawTypeIdAndData(i, j, k, this.id + 1, l);
- world.b(i, j, k, i, j, k);
- world.notify(i, j, k);
+ world.d(i, j, k, i, j, k);
}
- public boolean b(IBlockAccess iblockaccess, int i, int j, int k) {
+ public boolean c(IBlockAccess iblockaccess, int i, int j, int k) {
return this.material != Material.LAVA;
}
- public void a(World world, int i, int j, int k, Random random) {
+ public void b(World world, int i, int j, int k, Random random) {
// CraftBukkit start
org.bukkit.World bworld = world.getWorld();
org.bukkit.Server server = world.getServer();
org.bukkit.block.Block source = bworld == null ? null : bworld.getBlockAt(i, j, k);
// CraftBukkit end
- int l = this.g(world, i, j, k);
+ int l = this.f_(world, i, j, k);
byte b0 = 1;
if (this.material == Material.LAVA && !world.worldProvider.d) {
@@ -50,18 +49,18 @@ public class BlockFlowing extends BlockFluids {
byte b1 = -100;
this.a = 0;
- int j1 = this.f(world, i - 1, j, k, b1);
+ int j1 = this.e(world, i - 1, j, k, b1);
- j1 = this.f(world, i + 1, j, k, j1);
- j1 = this.f(world, i, j, k - 1, j1);
- j1 = this.f(world, i, j, k + 1, j1);
+ j1 = this.e(world, i + 1, j, k, j1);
+ j1 = this.e(world, i, j, k - 1, j1);
+ j1 = this.e(world, i, j, k + 1, j1);
i1 = j1 + b0;
if (i1 >= 8 || j1 < 0) {
i1 = -1;
}
- if (this.g(world, i, j + 1, k) >= 0) {
- int k1 = this.g(world, i, j + 1, k);
+ if (this.f_(world, i, j + 1, k) >= 0) {
+ int k1 = this.f_(world, i, j + 1, k);
if (k1 >= 8) {
i1 = k1;
@@ -83,23 +82,25 @@ public class BlockFlowing extends BlockFluids {
flag = false;
}
- if (i1 != l) {
+ if (i1 == l) {
+ if (flag) {
+ this.l(world, i, j, k);
+ }
+ } else {
l = i1;
if (i1 < 0) {
world.setTypeId(i, j, k, 0);
} else {
world.setData(i, j, k, i1);
- world.c(i, j, k, this.id, this.d());
+ world.a(i, j, k, this.id, this.p_());
world.applyPhysics(i, j, k, this.id);
}
- } else if (flag) {
- this.i(world, i, j, k);
}
} else {
- this.i(world, i, j, k);
+ this.l(world, i, j, k);
}
- if (this.l(world, i, j - 1, k)) {
+ if (this.p(world, i, j - 1, k)) {
// CraftBukkit start - send "down" to the server
BlockFromToEvent event = new BlockFromToEvent(source, BlockFace.DOWN);
if (server != null) {
@@ -114,14 +115,14 @@ public class BlockFlowing extends BlockFluids {
}
if (l >= 8) {
- world.setTypeIdAndData(i, j - 1, k, this.id, l);
+ this.flow(world, i, j - 1, k, l);
} else {
- world.setTypeIdAndData(i, j - 1, k, this.id, l + 8);
+ this.flow(world, i, j - 1, k, l + 8);
}
}
// CraftBukkit end
- } else if (l >= 0 && (l == 0 || this.k(world, i, j - 1, k))) {
- boolean[] aboolean = this.j(world, i, j, k);
+ } else if (l >= 0 && (l == 0 || this.o(world, i, j - 1, k))) {
+ boolean[] aboolean = this.n(world, i, j, k);
i1 = l + b0;
if (l >= 8) {
@@ -155,14 +156,14 @@ public class BlockFlowing extends BlockFluids {
}
private void flow(World world, int i, int j, int k, int l) {
- if (this.l(world, i, j, k)) {
+ if (this.p(world, i, j, k)) {
int i1 = world.getTypeId(i, j, k);
if (i1 > 0) {
if (this.material == Material.LAVA) {
this.fizz(world, i, j, k);
} else {
- Block.byId[i1].b(world, i, j, k, world.getData(i, j, k), 0);
+ Block.byId[i1].c(world, i, j, k, world.getData(i, j, k), 0);
}
}
@@ -170,7 +171,7 @@ public class BlockFlowing extends BlockFluids {
}
}
- private int c(World world, int i, int j, int k, int l, int i1) {
+ private int d(World world, int i, int j, int k, int l, int i1) {
int j1 = 1000;
for (int k1 = 0; k1 < 4; ++k1) {
@@ -194,13 +195,13 @@ public class BlockFlowing extends BlockFluids {
++i2;
}
- if (!this.k(world, l1, j, i2) && (world.getMaterial(l1, j, i2) != this.material || world.getData(l1, j, i2) != 0)) {
- if (!this.k(world, l1, j - 1, i2)) {
+ if (!this.o(world, l1, j, i2) && (world.getMaterial(l1, j, i2) != this.material || world.getData(l1, j, i2) != 0)) {
+ if (!this.o(world, l1, j - 1, i2)) {
return l;
}
if (l < 4) {
- int j2 = this.c(world, l1, j, i2, l + 1, k1);
+ int j2 = this.d(world, l1, j, i2, l + 1, k1);
if (j2 < j1) {
j1 = j2;
@@ -213,7 +214,7 @@ public class BlockFlowing extends BlockFluids {
return j1;
}
- private boolean[] j(World world, int i, int j, int k) {
+ private boolean[] n(World world, int i, int j, int k) {
int l;
int i1;
@@ -238,11 +239,11 @@ public class BlockFlowing extends BlockFluids {
++j1;
}
- if (!this.k(world, i1, j, j1) && (world.getMaterial(i1, j, j1) != this.material || world.getData(i1, j, j1) != 0)) {
- if (!this.k(world, i1, j - 1, j1)) {
- this.c[l] = 0;
+ if (!this.o(world, i1, j, j1) && (world.getMaterial(i1, j, j1) != this.material || world.getData(i1, j, j1) != 0)) {
+ if (this.o(world, i1, j - 1, j1)) {
+ this.c[l] = this.d(world, i1, j, j1, 1, l);
} else {
- this.c[l] = this.c(world, i1, j, j1, 1, l);
+ this.c[l] = 0;
}
}
}
@@ -262,7 +263,7 @@ public class BlockFlowing extends BlockFluids {
return this.b;
}
- private boolean k(World world, int i, int j, int k) {
+ private boolean o(World world, int i, int j, int k) {
int l = world.getTypeId(i, j, k);
if (l != Block.WOODEN_DOOR.id && l != Block.IRON_DOOR_BLOCK.id && l != Block.SIGN_POST.id && l != Block.LADDER.id && l != Block.SUGAR_CANE_BLOCK.id) {
@@ -278,8 +279,8 @@ public class BlockFlowing extends BlockFluids {
}
}
- protected int f(World world, int i, int j, int k, int l) {
- int i1 = this.g(world, i, j, k);
+ protected int e(World world, int i, int j, int k, int l) {
+ int i1 = this.f_(world, i, j, k);
if (i1 < 0) {
return l;
@@ -296,16 +297,16 @@ public class BlockFlowing extends BlockFluids {
}
}
- private boolean l(World world, int i, int j, int k) {
+ private boolean p(World world, int i, int j, int k) {
Material material = world.getMaterial(i, j, k);
- return material == this.material ? false : (material == Material.LAVA ? false : !this.k(world, i, j, k));
+ return material == this.material ? false : (material == Material.LAVA ? false : !this.o(world, i, j, k));
}
public void onPlace(World world, int i, int j, int k) {
super.onPlace(world, i, j, k);
if (world.getTypeId(i, j, k) == this.id) {
- world.c(i, j, k, this.id, this.d());
+ world.a(i, j, k, this.id, this.p_());
}
}
}
diff --git a/src/main/java/net/minecraft/server/BlockGrass.java b/src/main/java/net/minecraft/server/BlockGrass.java
index c3f068763e..79a007c856 100644
--- a/src/main/java/net/minecraft/server/BlockGrass.java
+++ b/src/main/java/net/minecraft/server/BlockGrass.java
@@ -13,17 +13,18 @@ public class BlockGrass extends Block {
protected BlockGrass(int i) {
super(i, Material.GRASS);
this.textureId = 3;
- this.a(true);
+ this.b(true);
+ this.a(CreativeModeTab.b);
}
public int a(int i, int j) {
return i == 1 ? 0 : (i == 0 ? 2 : 3);
}
- public void a(World world, int i, int j, int k, Random random) {
+ public void b(World world, int i, int j, int k, Random random) {
if (!world.isStatic) {
if (world.getLightLevel(i, j + 1, k) < 4 && Block.lightBlock[world.getTypeId(i, j + 1, k)] > 2) {
- // CraftBukkit start - reuse getLightLevel
+ // CraftBukkit start
org.bukkit.World bworld = world.getWorld();
BlockState blockState = bworld.getBlockAt(i, j, k).getState();
blockState.setTypeId(Block.DIRT.id);
@@ -46,7 +47,7 @@ public class BlockGrass extends Block {
// CraftBukkit start
org.bukkit.World bworld = world.getWorld();
BlockState blockState = bworld.getBlockAt(i1, j1, k1).getState();
- blockState.setTypeId(this.id);
+ blockState.setTypeId(Block.GRASS.id);
BlockSpreadEvent event = new BlockSpreadEvent(blockState.getBlock(), bworld.getBlockAt(i, j, k), blockState);
world.getServer().getPluginManager().callEvent(event);
diff --git a/src/main/java/net/minecraft/server/BlockIce.java b/src/main/java/net/minecraft/server/BlockIce.java
index 7895543d0f..b6791ce9e3 100644
--- a/src/main/java/net/minecraft/server/BlockIce.java
+++ b/src/main/java/net/minecraft/server/BlockIce.java
@@ -7,15 +7,33 @@ public class BlockIce extends BlockHalfTransparant {
public BlockIce(int i, int j) {
super(i, j, Material.ICE, false);
this.frictionFactor = 0.98F;
- this.a(true);
+ this.b(true);
+ this.a(CreativeModeTab.b);
}
public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
- super.a(world, entityhuman, i, j, k, l);
- Material material = world.getMaterial(i, j - 1, k);
+ entityhuman.a(StatisticList.C[this.id], 1);
+ entityhuman.j(0.025F);
+ if (this.q_() && EnchantmentManager.hasSilkTouchEnchantment(entityhuman.inventory)) {
+ ItemStack itemstack = this.c_(l);
- if (material.isSolid() || material.isLiquid()) {
- world.setTypeId(i, j, k, Block.WATER.id);
+ if (itemstack != null) {
+ this.a(world, i, j, k, itemstack);
+ }
+ } else {
+ if (world.worldProvider.d) {
+ world.setTypeId(i, j, k, 0);
+ return;
+ }
+
+ int i1 = EnchantmentManager.getBonusBlockLootEnchantmentLevel(entityhuman.inventory);
+
+ this.c(world, i, j, k, l, i1);
+ Material material = world.getMaterial(i, j - 1, k);
+
+ if (material.isSolid() || material.isLiquid()) {
+ world.setTypeId(i, j, k, Block.WATER.id);
+ }
}
}
@@ -23,24 +41,25 @@ public class BlockIce extends BlockHalfTransparant {
return 0;
}
- public void a(World world, int i, int j, int k, Random random) {
- if (world.a(EnumSkyBlock.BLOCK, i, j, k) > 11 - Block.lightBlock[this.id]) {
+ public void b(World world, int i, int j, int k, Random random) {
+ if (world.b(EnumSkyBlock.BLOCK, i, j, k) > 11 - Block.lightBlock[this.id]) {
// CraftBukkit start
if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world.getWorld().getBlockAt(i, j, k), Block.STATIONARY_WATER.id).isCancelled()) {
return;
}
// CraftBukkit end
- this.b(world, i, j, k, world.getData(i, j, k), 0);
+ if (world.worldProvider.d) {
+ world.setTypeId(i, j, k, 0);
+ return;
+ }
+
+ this.c(world, i, j, k, world.getData(i, j, k), 0);
world.setTypeId(i, j, k, Block.STATIONARY_WATER.id);
}
}
- public int g() {
+ public int e() {
return 0;
}
-
- protected ItemStack a_(int i) {
- return null;
- }
}
diff --git a/src/main/java/net/minecraft/server/BlockLeaves.java b/src/main/java/net/minecraft/server/BlockLeaves.java
index ade3bed2f4..7f7066b5b6 100644
--- a/src/main/java/net/minecraft/server/BlockLeaves.java
+++ b/src/main/java/net/minecraft/server/BlockLeaves.java
@@ -6,29 +6,31 @@ import org.bukkit.event.block.LeavesDecayEvent; // CraftBukkit
public class BlockLeaves extends BlockTransparant {
- private int c;
- int[] a;
+ private int cr;
+ public static final String[] a = new String[] { "oak", "spruce", "birch", "jungle"};
+ int[] b;
protected BlockLeaves(int i, int j) {
super(i, j, Material.LEAVES, false);
- this.c = j;
- this.a(true);
+ this.cr = j;
+ this.b(true);
+ this.a(CreativeModeTab.c);
}
- public void remove(World world, int i, int j, int k) {
+ public void remove(World world, int i, int j, int k, int l, int i1) {
byte b0 = 1;
- int l = b0 + 1;
+ int j1 = b0 + 1;
- if (world.a(i - l, j - l, k - l, i + l, j + l, k + l)) {
- for (int i1 = -b0; i1 <= b0; ++i1) {
- for (int j1 = -b0; j1 <= b0; ++j1) {
- for (int k1 = -b0; k1 <= b0; ++k1) {
- int l1 = world.getTypeId(i + i1, j + j1, k + k1);
+ if (world.c(i - j1, j - j1, k - j1, i + j1, j + j1, k + j1)) {
+ for (int k1 = -b0; k1 <= b0; ++k1) {
+ for (int l1 = -b0; l1 <= b0; ++l1) {
+ for (int i2 = -b0; i2 <= b0; ++i2) {
+ int j2 = world.getTypeId(i + k1, j + l1, k + i2);
- if (l1 == Block.LEAVES.id) {
- int i2 = world.getData(i + i1, j + j1, k + k1);
+ if (j2 == Block.LEAVES.id) {
+ int k2 = world.getData(i + k1, j + l1, k + i2);
- world.setRawData(i + i1, j + j1, k + k1, i2 | 8);
+ world.setRawData(i + k1, j + l1, k + i2, k2 | 8);
}
}
}
@@ -36,7 +38,7 @@ public class BlockLeaves extends BlockTransparant {
}
}
- public void a(World world, int i, int j, int k, Random random) {
+ public void b(World world, int i, int j, int k, Random random) {
if (!world.isStatic) {
int l = world.getData(i, j, k);
@@ -47,13 +49,13 @@ public class BlockLeaves extends BlockTransparant {
int j1 = b1 * b1;
int k1 = b1 / 2;
- if (this.a == null) {
- this.a = new int[b1 * b1 * b1];
+ if (this.b == null) {
+ this.b = new int[b1 * b1 * b1];
}
int l1;
- if (world.a(i - i1, j - i1, k - i1, i + i1, j + i1, k + i1)) {
+ if (world.c(i - i1, j - i1, k - i1, i + i1, j + i1, k + i1)) {
int i2;
int j2;
int k2;
@@ -63,11 +65,11 @@ public class BlockLeaves extends BlockTransparant {
for (j2 = -b0; j2 <= b0; ++j2) {
k2 = world.getTypeId(i + l1, j + i2, k + j2);
if (k2 == Block.LOG.id) {
- this.a[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = 0;
+ this.b[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = 0;
} else if (k2 == Block.LEAVES.id) {
- this.a[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = -2;
+ this.b[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = -2;
} else {
- this.a[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = -1;
+ this.b[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = -1;
}
}
}
@@ -77,29 +79,29 @@ public class BlockLeaves extends BlockTransparant {
for (i2 = -b0; i2 <= b0; ++i2) {
for (j2 = -b0; j2 <= b0; ++j2) {
for (k2 = -b0; k2 <= b0; ++k2) {
- if (this.a[(i2 + k1) * j1 + (j2 + k1) * b1 + k2 + k1] == l1 - 1) {
- if (this.a[(i2 + k1 - 1) * j1 + (j2 + k1) * b1 + k2 + k1] == -2) {
- this.a[(i2 + k1 - 1) * j1 + (j2 + k1) * b1 + k2 + k1] = l1;
+ if (this.b[(i2 + k1) * j1 + (j2 + k1) * b1 + k2 + k1] == l1 - 1) {
+ if (this.b[(i2 + k1 - 1) * j1 + (j2 + k1) * b1 + k2 + k1] == -2) {
+ this.b[(i2 + k1 - 1) * j1 + (j2 + k1) * b1 + k2 + k1] = l1;
}
- if (this.a[(i2 + k1 + 1) * j1 + (j2 + k1) * b1 + k2 + k1] == -2) {
- this.a[(i2 + k1 + 1) * j1 + (j2 + k1) * b1 + k2 + k1] = l1;
+ if (this.b[(i2 + k1 + 1) * j1 + (j2 + k1) * b1 + k2 + k1] == -2) {
+ this.b[(i2 + k1 + 1) * j1 + (j2 + k1) * b1 + k2 + k1] = l1;
}
- if (this.a[(i2 + k1) * j1 + (j2 + k1 - 1) * b1 + k2 + k1] == -2) {
- this.a[(i2 + k1) * j1 + (j2 + k1 - 1) * b1 + k2 + k1] = l1;
+ if (this.b[(i2 + k1) * j1 + (j2 + k1 - 1) * b1 + k2 + k1] == -2) {
+ this.b[(i2 + k1) * j1 + (j2 + k1 - 1) * b1 + k2 + k1] = l1;
}
- if (this.a[(i2 + k1) * j1 + (j2 + k1 + 1) * b1 + k2 + k1] == -2) {
- this.a[(i2 + k1) * j1 + (j2 + k1 + 1) * b1 + k2 + k1] = l1;
+ if (this.b[(i2 + k1) * j1 + (j2 + k1 + 1) * b1 + k2 + k1] == -2) {
+ this.b[(i2 + k1) * j1 + (j2 + k1 + 1) * b1 + k2 + k1] = l1;
}
- if (this.a[(i2 + k1) * j1 + (j2 + k1) * b1 + (k2 + k1 - 1)] == -2) {
- this.a[(i2 + k1) * j1 + (j2 + k1) * b1 + (k2 + k1 - 1)] = l1;
+ if (this.b[(i2 + k1) * j1 + (j2 + k1) * b1 + (k2 + k1 - 1)] == -2) {
+ this.b[(i2 + k1) * j1 + (j2 + k1) * b1 + (k2 + k1 - 1)] = l1;
}
- if (this.a[(i2 + k1) * j1 + (j2 + k1) * b1 + k2 + k1 + 1] == -2) {
- this.a[(i2 + k1) * j1 + (j2 + k1) * b1 + k2 + k1 + 1] = l1;
+ if (this.b[(i2 + k1) * j1 + (j2 + k1) * b1 + k2 + k1 + 1] == -2) {
+ this.b[(i2 + k1) * j1 + (j2 + k1) * b1 + k2 + k1 + 1] = l1;
}
}
}
@@ -108,25 +110,27 @@ public class BlockLeaves extends BlockTransparant {
}
}
- l1 = this.a[k1 * j1 + k1 * b1 + k1];
+ l1 = this.b[k1 * j1 + k1 * b1 + k1];
if (l1 >= 0) {
world.setRawData(i, j, k, l & -9);
} else {
- this.g(world, i, j, k);
+ this.l(world, i, j, k);
}
}
}
}
- private void g(World world, int i, int j, int k) {
+ private void l(World world, int i, int j, int k) {
// CraftBukkit start
LeavesDecayEvent event = new LeavesDecayEvent(world.getWorld().getBlockAt(i, j, k));
world.getServer().getPluginManager().callEvent(event);
- if (event.isCancelled()) return;
+ if (event.isCancelled()) {
+ return;
+ }
// CraftBukkit end
- this.b(world, i, j, k, world.getData(i, j, k), 0);
+ this.c(world, i, j, k, world.getData(i, j, k), 0);
world.setTypeId(i, j, k, 0);
}
@@ -159,7 +163,7 @@ public class BlockLeaves extends BlockTransparant {
}
public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
- if (!world.isStatic && entityhuman.U() != null && entityhuman.U().id == Item.SHEARS.id) {
+ if (!world.isStatic && entityhuman.bC() != null && entityhuman.bC().id == Item.SHEARS.id) {
entityhuman.a(StatisticList.C[this.id], 1);
this.a(world, i, j, k, new ItemStack(Block.LEAVES.id, 1, l & 3));
} else {
@@ -171,15 +175,11 @@ public class BlockLeaves extends BlockTransparant {
return i & 3;
}
- public boolean a() {
- return !this.b;
+ public boolean d() {
+ return !this.c;
}
public int a(int i, int j) {
return (j & 3) == 1 ? this.textureId + 80 : ((j & 3) == 3 ? this.textureId + 144 : this.textureId);
}
-
- public void b(World world, int i, int j, int k, Entity entity) {
- super.b(world, i, j, k, entity);
- }
}
diff --git a/src/main/java/net/minecraft/server/BlockLever.java b/src/main/java/net/minecraft/server/BlockLever.java
index 11a07ae40c..df25656d05 100644
--- a/src/main/java/net/minecraft/server/BlockLever.java
+++ b/src/main/java/net/minecraft/server/BlockLever.java
@@ -6,105 +6,143 @@ public class BlockLever extends Block {
protected BlockLever(int i, int j) {
super(i, j, Material.ORIENTABLE);
+ this.a(CreativeModeTab.d);
}
public AxisAlignedBB e(World world, int i, int j, int k) {
return null;
}
- public boolean a() {
+ public boolean d() {
return false;
}
- public boolean b() {
+ public boolean c() {
return false;
}
- public int c() {
+ public int b() {
return 12;
}
public boolean canPlace(World world, int i, int j, int k, int l) {
- return l == 1 && world.e(i, j - 1, k) ? true : (l == 2 && world.e(i, j, k + 1) ? true : (l == 3 && world.e(i, j, k - 1) ? true : (l == 4 && world.e(i + 1, j, k) ? true : l == 5 && world.e(i - 1, j, k))));
+ return l == 0 && world.s(i, j + 1, k) ? true : (l == 1 && world.t(i, j - 1, k) ? true : (l == 2 && world.s(i, j, k + 1) ? true : (l == 3 && world.s(i, j, k - 1) ? true : (l == 4 && world.s(i + 1, j, k) ? true : l == 5 && world.s(i - 1, j, k)))));
}
public boolean canPlace(World world, int i, int j, int k) {
- return world.e(i - 1, j, k) ? true : (world.e(i + 1, j, k) ? true : (world.e(i, j, k - 1) ? true : (world.e(i, j, k + 1) ? true : world.e(i, j - 1, k))));
+ return world.s(i - 1, j, k) ? true : (world.s(i + 1, j, k) ? true : (world.s(i, j, k - 1) ? true : (world.s(i, j, k + 1) ? true : (world.t(i, j - 1, k) ? true : world.s(i, j + 1, k)))));
}
- public void postPlace(World world, int i, int j, int k, int l) {
+ public void postPlace(World world, int i, int j, int k, int l, float f, float f1, float f2) {
int i1 = world.getData(i, j, k);
int j1 = i1 & 8;
i1 &= 7;
i1 = -1;
- if (l == 1 && world.e(i, j - 1, k)) {
+ if (l == 0 && world.s(i, j + 1, k)) {
+ i1 = world.random.nextBoolean() ? 0 : 7;
+ }
+
+ if (l == 1 && world.t(i, j - 1, k)) {
i1 = 5 + world.random.nextInt(2);
}
- if (l == 2 && world.e(i, j, k + 1)) {
+ if (l == 2 && world.s(i, j, k + 1)) {
i1 = 4;
}
- if (l == 3 && world.e(i, j, k - 1)) {
+ if (l == 3 && world.s(i, j, k - 1)) {
i1 = 3;
}
- if (l == 4 && world.e(i + 1, j, k)) {
+ if (l == 4 && world.s(i + 1, j, k)) {
i1 = 2;
}
- if (l == 5 && world.e(i - 1, j, k)) {
+ if (l == 5 && world.s(i - 1, j, k)) {
i1 = 1;
}
if (i1 == -1) {
- this.b(world, i, j, k, world.getData(i, j, k), 0);
+ this.c(world, i, j, k, world.getData(i, j, k), 0);
world.setTypeId(i, j, k, 0);
} else {
world.setData(i, j, k, i1 + j1);
}
}
+ public static int d(int i) {
+ switch (i) {
+ case 0:
+ return 0;
+
+ case 1:
+ return 5;
+
+ case 2:
+ return 4;
+
+ case 3:
+ return 3;
+
+ case 4:
+ return 2;
+
+ case 5:
+ return 1;
+
+ default:
+ return -1;
+ }
+ }
+
public void doPhysics(World world, int i, int j, int k, int l) {
- if (this.g(world, i, j, k)) {
+ if (this.l(world, i, j, k)) {
int i1 = world.getData(i, j, k) & 7;
boolean flag = false;
- if (!world.e(i - 1, j, k) && i1 == 1) {
+ if (!world.s(i - 1, j, k) && i1 == 1) {
flag = true;
}
- if (!world.e(i + 1, j, k) && i1 == 2) {
+ if (!world.s(i + 1, j, k) && i1 == 2) {
flag = true;
}
- if (!world.e(i, j, k - 1) && i1 == 3) {
+ if (!world.s(i, j, k - 1) && i1 == 3) {
flag = true;
}
- if (!world.e(i, j, k + 1) && i1 == 4) {
+ if (!world.s(i, j, k + 1) && i1 == 4) {
flag = true;
}
- if (!world.e(i, j - 1, k) && i1 == 5) {
+ if (!world.t(i, j - 1, k) && i1 == 5) {
flag = true;
}
- if (!world.e(i, j - 1, k) && i1 == 6) {
+ if (!world.t(i, j - 1, k) && i1 == 6) {
+ flag = true;
+ }
+
+ if (!world.s(i, j + 1, k) && i1 == 0) {
+ flag = true;
+ }
+
+ if (!world.s(i, j + 1, k) && i1 == 7) {
flag = true;
}
if (flag) {
- this.b(world, i, j, k, world.getData(i, j, k), 0);
+ this.c(world, i, j, k, world.getData(i, j, k), 0);
world.setTypeId(i, j, k, 0);
}
}
}
- private boolean g(World world, int i, int j, int k) {
+ private boolean l(World world, int i, int j, int k) {
if (!this.canPlace(world, i, j, k)) {
- this.b(world, i, j, k, world.getData(i, j, k), 0);
+ this.c(world, i, j, k, world.getData(i, j, k), 0);
world.setTypeId(i, j, k, 0);
return false;
} else {
@@ -124,6 +162,11 @@ public class BlockLever extends Block {
this.a(0.5F - f, 0.2F, 0.0F, 0.5F + f, 0.8F, f * 2.0F);
} else if (l == 4) {
this.a(0.5F - f, 0.2F, 1.0F - f * 2.0F, 0.5F + f, 0.8F, 1.0F);
+ } else if (l != 5 && l != 6) {
+ if (l == 0 || l == 7) {
+ f = 0.25F;
+ this.a(0.5F - f, 0.4F, 0.5F - f, 0.5F + f, 1.0F, 0.5F + f);
+ }
} else {
f = 0.25F;
this.a(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.6F, 0.5F + f);
@@ -131,42 +174,46 @@ public class BlockLever extends Block {
}
public void attack(World world, int i, int j, int k, EntityHuman entityhuman) {
- this.interact(world, i, j, k, entityhuman);
+ this.interact(world, i, j, k, entityhuman, 0, 0.0F, 0.0F, 0.0F);
}
- public boolean interact(World world, int i, int j, int k, EntityHuman entityhuman) {
+ public boolean interact(World world, int i, int j, int k, EntityHuman entityhuman, int l, float f, float f1, float f2) {
if (world.isStatic) {
return true;
} else {
- int l = world.getData(i, j, k);
- int i1 = l & 7;
- int j1 = 8 - (l & 8);
+ int i1 = world.getData(i, j, k);
+ int j1 = i1 & 7;
+ int k1 = 8 - (i1 & 8);
// CraftBukkit start - Interact Lever
org.bukkit.block.Block block = world.getWorld().getBlockAt(i, j, k);
- int old = (j1 != 8) ? 1 : 0;
- int current = (j1 == 8) ? 1 : 0;
+ int old = (k1 != 8) ? 1 : 0;
+ int current = (k1 == 8) ? 1 : 0;
BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(block, old, current);
world.getServer().getPluginManager().callEvent(eventRedstone);
- if ((eventRedstone.getNewCurrent() > 0) != (j1 == 8)) {
+ if ((eventRedstone.getNewCurrent() > 0) != (k1 == 8)) {
return true;
}
// CraftBukkit end
- world.setData(i, j, k, i1 + j1);
- world.b(i, j, k, i, j, k);
- world.makeSound((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D, "random.click", 0.3F, j1 > 0 ? 0.6F : 0.5F);
+ world.setData(i, j, k, j1 + k1);
+ world.d(i, j, k, i, j, k);
+ world.makeSound((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D, "random.click", 0.3F, k1 > 0 ? 0.6F : 0.5F);
world.applyPhysics(i, j, k, this.id);
- if (i1 == 1) {
+ if (j1 == 1) {
world.applyPhysics(i - 1, j, k, this.id);
- } else if (i1 == 2) {
+ } else if (j1 == 2) {
world.applyPhysics(i + 1, j, k, this.id);
- } else if (i1 == 3) {
+ } else if (j1 == 3) {
world.applyPhysics(i, j, k - 1, this.id);
- } else if (i1 == 4) {
+ } else if (j1 == 4) {
world.applyPhysics(i, j, k + 1, this.id);
+ } else if (j1 != 5 && j1 != 6) {
+ if (j1 == 0 || j1 == 7) {
+ world.applyPhysics(i, j + 1, k, this.id);
+ }
} else {
world.applyPhysics(i, j - 1, k, this.id);
}
@@ -175,34 +222,36 @@ public class BlockLever extends Block {
}
}
- public void remove(World world, int i, int j, int k) {
- int l = world.getData(i, j, k);
-
- if ((l & 8) > 0) {
+ public void remove(World world, int i, int j, int k, int l, int i1) {
+ if ((i1 & 8) > 0) {
world.applyPhysics(i, j, k, this.id);
- int i1 = l & 7;
+ int j1 = i1 & 7;
- if (i1 == 1) {
+ if (j1 == 1) {
world.applyPhysics(i - 1, j, k, this.id);
- } else if (i1 == 2) {
+ } else if (j1 == 2) {
world.applyPhysics(i + 1, j, k, this.id);
- } else if (i1 == 3) {
+ } else if (j1 == 3) {
world.applyPhysics(i, j, k - 1, this.id);
- } else if (i1 == 4) {
+ } else if (j1 == 4) {
world.applyPhysics(i, j, k + 1, this.id);
+ } else if (j1 != 5 && j1 != 6) {
+ if (j1 == 0 || j1 == 7) {
+ world.applyPhysics(i, j + 1, k, this.id);
+ }
} else {
world.applyPhysics(i, j - 1, k, this.id);
}
}
- super.remove(world, i, j, k);
+ super.remove(world, i, j, k, l, i1);
}
public boolean a(IBlockAccess iblockaccess, int i, int j, int k, int l) {
return (iblockaccess.getData(i, j, k) & 8) > 0;
}
- public boolean d(World world, int i, int j, int k, int l) {
+ public boolean c(World world, int i, int j, int k, int l) {
int i1 = world.getData(i, j, k);
if ((i1 & 8) == 0) {
@@ -210,7 +259,7 @@ public class BlockLever extends Block {
} else {
int j1 = i1 & 7;
- return j1 == 6 && l == 1 ? true : (j1 == 5 && l == 1 ? true : (j1 == 4 && l == 2 ? true : (j1 == 3 && l == 3 ? true : (j1 == 2 && l == 4 ? true : j1 == 1 && l == 5))));
+ return j1 == 0 && l == 0 ? true : (j1 == 7 && l == 0 ? true : (j1 == 6 && l == 1 ? true : (j1 == 5 && l == 1 ? true : (j1 == 4 && l == 2 ? true : (j1 == 3 && l == 3 ? true : (j1 == 2 && l == 4 ? true : j1 == 1 && l == 5))))));
}
}
diff --git a/src/main/java/net/minecraft/server/BlockMinecartDetector.java b/src/main/java/net/minecraft/server/BlockMinecartDetector.java
index 5f4bb85d7b..b5689bfa7c 100644
--- a/src/main/java/net/minecraft/server/BlockMinecartDetector.java
+++ b/src/main/java/net/minecraft/server/BlockMinecartDetector.java
@@ -9,10 +9,10 @@ public class BlockMinecartDetector extends BlockMinecartTrack {
public BlockMinecartDetector(int i, int j) {
super(i, j, true);
- this.a(true);
+ this.b(true);
}
- public int d() {
+ public int p_() {
return 20;
}
@@ -25,17 +25,17 @@ public class BlockMinecartDetector extends BlockMinecartTrack {
int l = world.getData(i, j, k);
if ((l & 8) == 0) {
- this.f(world, i, j, k, l);
+ this.e(world, i, j, k, l);
}
}
}
- public void a(World world, int i, int j, int k, Random random) {
+ public void b(World world, int i, int j, int k, Random random) {
if (!world.isStatic) {
int l = world.getData(i, j, k);
if ((l & 8) != 0) {
- this.f(world, i, j, k, l);
+ this.e(world, i, j, k, l);
}
}
}
@@ -44,17 +44,17 @@ public class BlockMinecartDetector extends BlockMinecartTrack {
return (iblockaccess.getData(i, j, k) & 8) != 0;
}
- public boolean d(World world, int i, int j, int k, int l) {
+ public boolean c(World world, int i, int j, int k, int l) {
return (world.getData(i, j, k) & 8) == 0 ? false : l == 1;
}
- private void f(World world, int i, int j, int k, int l) {
+ private void e(World world, int i, int j, int k, int l) {
boolean flag = (l & 8) != 0;
boolean flag1 = false;
float f = 0.125F;
- List list = world.a(EntityMinecart.class, AxisAlignedBB.b((double) ((float) i + f), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) ((float) (j + 1) - f), (double) ((float) (k + 1) - f)));
+ List list = world.a(EntityMinecart.class, AxisAlignedBB.a().a((double) ((float) i + f), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) ((float) (j + 1) - f), (double) ((float) (k + 1) - f)));
- if (list.size() > 0) {
+ if (!list.isEmpty()) {
flag1 = true;
}
@@ -73,18 +73,18 @@ public class BlockMinecartDetector extends BlockMinecartTrack {
world.setData(i, j, k, l | 8);
world.applyPhysics(i, j, k, this.id);
world.applyPhysics(i, j - 1, k, this.id);
- world.b(i, j, k, i, j, k);
+ world.d(i, j, k, i, j, k);
}
if (!flag1 && flag) {
world.setData(i, j, k, l & 7);
world.applyPhysics(i, j, k, this.id);
world.applyPhysics(i, j - 1, k, this.id);
- world.b(i, j, k, i, j, k);
+ world.d(i, j, k, i, j, k);
}
if (flag1) {
- world.c(i, j, k, this.id, this.d());
+ world.a(i, j, k, this.id, this.p_());
}
}
}
diff --git a/src/main/java/net/minecraft/server/BlockMinecartTrack.java b/src/main/java/net/minecraft/server/BlockMinecartTrack.java
index 528fdd843d..662430c6db 100644
--- a/src/main/java/net/minecraft/server/BlockMinecartTrack.java
+++ b/src/main/java/net/minecraft/server/BlockMinecartTrack.java
@@ -6,7 +6,7 @@ public class BlockMinecartTrack extends Block {
private final boolean a;
- public static final boolean g(World world, int i, int j, int k) {
+ public static final boolean d_(World world, int i, int j, int k) {
int l = world.getTypeId(i, j, k);
return l == Block.RAILS.id || l == Block.GOLDEN_RAIL.id || l == Block.DETECTOR_RAIL.id;
@@ -20,9 +20,10 @@ public class BlockMinecartTrack extends Block {
super(i, j, Material.ORIENTABLE);
this.a = flag;
this.a(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F);
+ this.a(CreativeModeTab.e);
}
- public boolean i() {
+ public boolean n() {
return this.a;
}
@@ -30,7 +31,7 @@ public class BlockMinecartTrack extends Block {
return null;
}
- public boolean a() {
+ public boolean d() {
return false;
}
@@ -61,11 +62,11 @@ public class BlockMinecartTrack extends Block {
return this.textureId;
}
- public boolean b() {
+ public boolean c() {
return false;
}
- public int c() {
+ public int b() {
return 9;
}
@@ -74,14 +75,14 @@ public class BlockMinecartTrack extends Block {
}
public boolean canPlace(World world, int i, int j, int k) {
- return world.e(i, j - 1, k);
+ return world.t(i, j - 1, k);
}
public void onPlace(World world, int i, int j, int k) {
if (!world.isStatic) {
this.a(world, i, j, k, true);
if (this.id == Block.GOLDEN_RAIL.id) {
- // this.doPhysics(world, i, j, k, this.id); // CraftBukkit - Fix issues with rails
+ // this.doPhysics(world, i, j, k, this.id); // CraftBukkit - fix issues with rails
}
}
}
@@ -97,28 +98,28 @@ public class BlockMinecartTrack extends Block {
boolean flag = false;
- if (!world.e(i, j - 1, k)) {
+ if (!world.t(i, j - 1, k)) {
flag = true;
}
- if (j1 == 2 && !world.e(i + 1, j, k)) {
+ if (j1 == 2 && !world.t(i + 1, j, k)) {
flag = true;
}
- if (j1 == 3 && !world.e(i - 1, j, k)) {
+ if (j1 == 3 && !world.t(i - 1, j, k)) {
flag = true;
}
- if (j1 == 4 && !world.e(i, j, k - 1)) {
+ if (j1 == 4 && !world.t(i, j, k - 1)) {
flag = true;
}
- if (j1 == 5 && !world.e(i, j, k + 1)) {
+ if (j1 == 5 && !world.t(i, j, k + 1)) {
flag = true;
}
if (flag) {
- this.b(world, i, j, k, world.getData(i, j, k), 0);
+ this.c(world, i, j, k, world.getData(i, j, k), 0);
world.setTypeId(i, j, k, 0);
} else if (this.id == Block.GOLDEN_RAIL.id) {
boolean flag1 = world.isBlockIndirectlyPowered(i, j, k);
@@ -255,7 +256,7 @@ public class BlockMinecartTrack extends Block {
return false;
}
- public int g() {
+ public int e() {
return 0;
}
diff --git a/src/main/java/net/minecraft/server/BlockMushroom.java b/src/main/java/net/minecraft/server/BlockMushroom.java
index c9f1143d1b..177cfaf311 100644
--- a/src/main/java/net/minecraft/server/BlockMushroom.java
+++ b/src/main/java/net/minecraft/server/BlockMushroom.java
@@ -19,10 +19,10 @@ public class BlockMushroom extends BlockFlower {
float f = 0.2F;
this.a(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 2.0F, 0.5F + f);
- this.a(true);
+ this.b(true);
}
- public void a(World world, int i, int j, int k, Random random) {
+ public void b(World world, int i, int j, int k, Random random) {
if (random.nextInt(25) == 0) {
byte b0 = 4;
int l = 5;
@@ -49,7 +49,7 @@ public class BlockMushroom extends BlockFlower {
k1 = k + random.nextInt(3) - 1;
for (int l1 = 0; l1 < 4; ++l1) {
- if (world.isEmpty(i1, j1, k1) && this.f(world, i1, j1, k1)) {
+ if (world.isEmpty(i1, j1, k1) && this.d(world, i1, j1, k1)) {
i = i1;
j = j1;
k = k1;
@@ -60,7 +60,7 @@ public class BlockMushroom extends BlockFlower {
k1 = k + random.nextInt(3) - 1;
}
- if (world.isEmpty(i1, j1, k1) && this.f(world, i1, j1, k1)) {
+ if (world.isEmpty(i1, j1, k1) && this.d(world, i1, j1, k1)) {
// CraftBukkit start
org.bukkit.World bworld = world.getWorld();
BlockState blockState = bworld.getBlockAt(i1, j1, k1).getState();
@@ -78,18 +78,18 @@ public class BlockMushroom extends BlockFlower {
}
public boolean canPlace(World world, int i, int j, int k) {
- return super.canPlace(world, i, j, k) && this.f(world, i, j, k);
+ return super.canPlace(world, i, j, k) && this.d(world, i, j, k);
}
- protected boolean d(int i) {
+ protected boolean d_(int i) {
return Block.n[i];
}
- public boolean f(World world, int i, int j, int k) {
+ public boolean d(World world, int i, int j, int k) {
if (j >= 0 && j < 256) {
int l = world.getTypeId(i, j - 1, k);
- return l == Block.MYCEL.id || world.m(i, j, k) < 13 && this.d(l);
+ return l == Block.MYCEL.id || world.k(i, j, k) < 13 && this.d_(l);
} else {
return false;
}
@@ -113,6 +113,7 @@ public class BlockMushroom extends BlockFlower {
event = new StructureGrowEvent(location, TreeType.RED_MUSHROOM, bonemeal, player, new ArrayList());
worldgenhugemushroom = new WorldGenHugeMushroom(1);
}
+
if (worldgenhugemushroom != null && event != null) {
grown = worldgenhugemushroom.grow((org.bukkit.BlockChangeDelegate)world, random, i, j, k, event, itemstack, world.getWorld());
if (event.isFromBonemeal() && itemstack != null) {
diff --git a/src/main/java/net/minecraft/server/BlockMycel.java b/src/main/java/net/minecraft/server/BlockMycel.java
index d0d51e2ed9..6dbf49f70f 100644
--- a/src/main/java/net/minecraft/server/BlockMycel.java
+++ b/src/main/java/net/minecraft/server/BlockMycel.java
@@ -13,14 +13,15 @@ public class BlockMycel extends Block {
protected BlockMycel(int i) {
super(i, Material.GRASS);
this.textureId = 77;
- this.a(true);
+ this.b(true);
+ this.a(CreativeModeTab.b);
}
public int a(int i, int j) {
return i == 1 ? 78 : (i == 0 ? 2 : 77);
}
- public void a(World world, int i, int j, int k, Random random) {
+ public void b(World world, int i, int j, int k, Random random) {
if (!world.isStatic) {
if (world.getLightLevel(i, j + 1, k) < 4 && Block.lightBlock[world.getTypeId(i, j + 1, k)] > 2) {
// CraftBukkit start
diff --git a/src/main/java/net/minecraft/server/BlockNetherWart.java b/src/main/java/net/minecraft/server/BlockNetherWart.java
index 8230de9846..9c4b7761cd 100644
--- a/src/main/java/net/minecraft/server/BlockNetherWart.java
+++ b/src/main/java/net/minecraft/server/BlockNetherWart.java
@@ -6,39 +6,36 @@ public class BlockNetherWart extends BlockFlower {
protected BlockNetherWart(int i) {
super(i, 226);
- this.a(true);
+ this.b(true);
float f = 0.5F;
this.a(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f);
+ this.a((CreativeModeTab) null);
}
- protected boolean d(int i) {
+ protected boolean d_(int i) {
return i == Block.SOUL_SAND.id;
}
- public boolean f(World world, int i, int j, int k) {
- return this.d(world.getTypeId(i, j - 1, k));
+ public boolean d(World world, int i, int j, int k) {
+ return this.d_(world.getTypeId(i, j - 1, k));
}
- public void a(World world, int i, int j, int k, Random random) {
+ public void b(World world, int i, int j, int k, Random random) {
int l = world.getData(i, j, k);
- if (l < 3) {
- BiomeBase biomebase = world.getBiome(i, k);
-
- if (biomebase instanceof BiomeHell && random.nextInt(10) == 0) {
- org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, i, j, k, this.id, ++l); // CraftBukkit
- }
+ if (l < 3 && random.nextInt(10) == 0) {
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, i, j, k, this.id, ++l); // CraftBukkit
}
- super.a(world, i, j, k, random);
+ super.b(world, i, j, k, random);
}
public int a(int i, int j) {
return j >= 3 ? this.textureId + 2 : (j > 0 ? this.textureId + 1 : this.textureId);
}
- public int c() {
+ public int b() {
return 6;
}
diff --git a/src/main/java/net/minecraft/server/BlockPiston.java b/src/main/java/net/minecraft/server/BlockPiston.java
index b33e4bb57a..2944eca761 100644
--- a/src/main/java/net/minecraft/server/BlockPiston.java
+++ b/src/main/java/net/minecraft/server/BlockPiston.java
@@ -1,6 +1,6 @@
package net.minecraft.server;
-import java.util.ArrayList;
+import java.util.List;
// CraftBukkit start
import org.bukkit.craftbukkit.block.CraftBlock;
@@ -11,63 +11,64 @@ import org.bukkit.event.block.BlockPistonExtendEvent;
public class BlockPiston extends Block {
private boolean a;
- private static boolean b;
public BlockPiston(int i, int j, boolean flag) {
super(i, j, Material.PISTON);
this.a = flag;
this.a(h);
this.c(0.5F);
+ this.a(CreativeModeTab.d);
}
public int a(int i, int j) {
- int k = d(j);
+ int k = e(j);
- return k > 5 ? this.textureId : (i == k ? (!e(j) && this.minX <= 0.0D && this.minY <= 0.0D && this.minZ <= 0.0D && this.maxX >= 1.0D && this.maxY >= 1.0D && this.maxZ >= 1.0D ? this.textureId : 110) : (i == Facing.OPPOSITE_FACING[k] ? 109 : 108));
+ return k > 5 ? this.textureId : (i == k ? (!f(j) && this.minX <= 0.0D && this.minY <= 0.0D && this.minZ <= 0.0D && this.maxX >= 1.0D && this.maxY >= 1.0D && this.maxZ >= 1.0D ? this.textureId : 110) : (i == Facing.OPPOSITE_FACING[k] ? 109 : 108));
}
- public int c() {
+ public int b() {
return 16;
}
- public boolean a() {
+ public boolean d() {
return false;
}
- public boolean interact(World world, int i, int j, int k, EntityHuman entityhuman) {
+ public boolean interact(World world, int i, int j, int k, EntityHuman entityhuman, int l, float f, float f1, float f2) {
return false;
}
public void postPlace(World world, int i, int j, int k, EntityLiving entityliving) {
- int l = c(world, i, j, k, (EntityHuman) entityliving);
+ int l = b(world, i, j, k, (EntityHuman) entityliving);
world.setData(i, j, k, l);
- if (!world.isStatic && !b) {
- this.g(world, i, j, k);
+ if (!world.isStatic) {
+ this.l(world, i, j, k);
}
}
public void doPhysics(World world, int i, int j, int k, int l) {
- if (!world.isStatic && !b) {
- this.g(world, i, j, k);
+ if (!world.isStatic) {
+ this.l(world, i, j, k);
}
}
public void onPlace(World world, int i, int j, int k) {
- if (!world.isStatic && world.getTileEntity(i, j, k) == null && !b) {
- this.g(world, i, j, k);
+ if (!world.isStatic && world.getTileEntity(i, j, k) == null) {
+ this.l(world, i, j, k);
}
}
- private void g(World world, int i, int j, int k) {
+ private void l(World world, int i, int j, int k) {
int l = world.getData(i, j, k);
- int i1 = d(l);
- boolean flag = this.f(world, i, j, k, i1);
+ int i1 = e(l);
- if (l != 7) {
- if (flag && !e(l)) {
+ if (i1 != 7) {
+ boolean flag = this.e(world, i, j, k, i1);
+
+ if (flag && !f(l)) {
// CraftBukkit start
- int length = g(world, i, j, k, i1);
+ int length = i(world, i, j, k, i1);
if (length >= 0) {
org.bukkit.block.Block block = world.getWorld().getBlockAt(i, j, k);
@@ -79,10 +80,9 @@ public class BlockPiston extends Block {
}
// CraftBukkit end
- world.setRawData(i, j, k, i1 | 8);
- world.playNote(i, j, k, 0, i1);
+ world.playNote(i, j, k, this.id, 0, i1);
}
- } else if (!flag && e(l)) {
+ } else if (!flag && f(l)) {
// CraftBukkit start
org.bukkit.block.Block block = world.getWorld().getBlockAt(i, j, k);
@@ -94,20 +94,24 @@ public class BlockPiston extends Block {
}
// CraftBukkit end
- world.setRawData(i, j, k, i1);
- world.playNote(i, j, k, 1, i1);
+ world.playNote(i, j, k, this.id, 1, i1);
}
}
}
- private boolean f(World world, int i, int j, int k, int l) {
+ private boolean e(World world, int i, int j, int k, int l) {
return l != 0 && world.isBlockFaceIndirectlyPowered(i, j - 1, k, 0) ? true : (l != 1 && world.isBlockFaceIndirectlyPowered(i, j + 1, k, 1) ? true : (l != 2 && world.isBlockFaceIndirectlyPowered(i, j, k - 1, 2) ? true : (l != 3 && world.isBlockFaceIndirectlyPowered(i, j, k + 1, 3) ? true : (l != 5 && world.isBlockFaceIndirectlyPowered(i + 1, j, k, 5) ? true : (l != 4 && world.isBlockFaceIndirectlyPowered(i - 1, j, k, 4) ? true : (world.isBlockFaceIndirectlyPowered(i, j, k, 0) ? true : (world.isBlockFaceIndirectlyPowered(i, j + 2, k, 1) ? true : (world.isBlockFaceIndirectlyPowered(i, j + 1, k - 1, 2) ? true : (world.isBlockFaceIndirectlyPowered(i, j + 1, k + 1, 3) ? true : (world.isBlockFaceIndirectlyPowered(i - 1, j + 1, k, 4) ? true : world.isBlockFaceIndirectlyPowered(i + 1, j + 1, k, 5)))))))))));
}
- public void a(World world, int i, int j, int k, int l, int i1) {
- b = true;
+ public void b(World world, int i, int j, int k, int l, int i1) {
if (l == 0) {
- if (this.h(world, i, j, k, i1)) {
+ world.setRawData(i, j, k, i1 | 8);
+ } else {
+ world.setRawData(i, j, k, i1);
+ }
+
+ if (l == 0) {
+ if (this.j(world, i, j, k, i1)) {
world.setData(i, j, k, i1 | 8);
world.makeSound((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D, "tile.piston.out", 0.5F, world.random.nextFloat() * 0.25F + 0.6F);
} else {
@@ -116,8 +120,8 @@ public class BlockPiston extends Block {
} else if (l == 1) {
TileEntity tileentity = world.getTileEntity(i + Facing.b[i1], j + Facing.c[i1], k + Facing.d[i1]);
- if (tileentity != null && tileentity instanceof TileEntityPiston) {
- ((TileEntityPiston) tileentity).g();
+ if (tileentity instanceof TileEntityPiston) {
+ ((TileEntityPiston) tileentity).i();
}
world.setRawTypeIdAndData(i, j, k, Block.PISTON_MOVING.id, i1);
@@ -133,49 +137,41 @@ public class BlockPiston extends Block {
if (i2 == Block.PISTON_MOVING.id) {
TileEntity tileentity1 = world.getTileEntity(j1, k1, l1);
- if (tileentity1 != null && tileentity1 instanceof TileEntityPiston) {
+ if (tileentity1 instanceof TileEntityPiston) {
TileEntityPiston tileentitypiston = (TileEntityPiston) tileentity1;
- if (tileentitypiston.f() == i1 && tileentitypiston.e()) {
- tileentitypiston.g();
- i2 = tileentitypiston.c();
- j2 = tileentitypiston.k();
+ if (tileentitypiston.c() == i1 && tileentitypiston.b()) {
+ tileentitypiston.i();
+ i2 = tileentitypiston.a();
+ j2 = tileentitypiston.n();
flag = true;
}
}
}
- if (!flag && i2 > 0 && a(i2, world, j1, k1, l1, false) && (Block.byId[i2].g() == 0 || i2 == Block.PISTON.id || i2 == Block.PISTON_STICKY.id)) {
+ if (!flag && i2 > 0 && a(i2, world, j1, k1, l1, false) && (Block.byId[i2].e() == 0 || i2 == Block.PISTON.id || i2 == Block.PISTON_STICKY.id)) {
i += Facing.b[i1];
j += Facing.c[i1];
k += Facing.d[i1];
world.setRawTypeIdAndData(i, j, k, Block.PISTON_MOVING.id, j2);
world.setTileEntity(i, j, k, BlockPistonMoving.a(i2, j2, i1, false, false));
- b = false;
world.setTypeId(j1, k1, l1, 0);
- b = true;
} else if (!flag) {
- b = false;
world.setTypeId(i + Facing.b[i1], j + Facing.c[i1], k + Facing.d[i1], 0);
- b = true;
}
} else {
- b = false;
world.setTypeId(i + Facing.b[i1], j + Facing.c[i1], k + Facing.d[i1], 0);
- b = true;
}
world.makeSound((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D, "tile.piston.in", 0.5F, world.random.nextFloat() * 0.15F + 0.6F);
}
-
- b = false;
}
public void updateShape(IBlockAccess iblockaccess, int i, int j, int k) {
int l = iblockaccess.getData(i, j, k);
- if (e(l)) {
- switch (d(l)) {
+ if (f(l)) {
+ switch (e(l)) {
case 0:
this.a(0.0F, 0.25F, 0.0F, 1.0F, 1.0F, 1.0F);
break;
@@ -208,9 +204,9 @@ public class BlockPiston extends Block {
this.a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
}
- public void a(World world, int i, int j, int k, AxisAlignedBB axisalignedbb, ArrayList arraylist) {
+ public void a(World world, int i, int j, int k, AxisAlignedBB axisalignedbb, List list, Entity entity) {
this.a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
- super.a(world, i, j, k, axisalignedbb, arraylist);
+ super.a(world, i, j, k, axisalignedbb, list, entity);
}
public AxisAlignedBB e(World world, int i, int j, int k) {
@@ -218,20 +214,20 @@ public class BlockPiston extends Block {
return super.e(world, i, j, k);
}
- public boolean b() {
+ public boolean c() {
return false;
}
- public static int d(int i) {
+ public static int e(int i) {
if ((i & 7) >= Facing.OPPOSITE_FACING.length) return 0; // CraftBukkit - check for AIOOB on piston data
return i & 7;
}
- public static boolean e(int i) {
+ public static boolean f(int i) {
return (i & 8) != 0;
}
- private static int c(World world, int i, int j, int k, EntityHuman entityhuman) {
+ public static int b(World world, int i, int j, int k, EntityHuman entityhuman) {
if (MathHelper.abs((float) entityhuman.locX - (float) i) < 2.0F && MathHelper.abs((float) entityhuman.locZ - (float) k) < 2.0F) {
double d0 = entityhuman.locY + 1.82D - (double) entityhuman.height;
@@ -254,18 +250,18 @@ public class BlockPiston extends Block {
return false;
} else {
if (i != Block.PISTON.id && i != Block.PISTON_STICKY.id) {
- if (Block.byId[i].m() == -1.0F) {
+ if (Block.byId[i].m(world, j, k, l) == -1.0F) {
return false;
}
- if (Block.byId[i].g() == 2) {
+ if (Block.byId[i].e() == 2) {
return false;
}
- if (!flag && Block.byId[i].g() == 1) {
+ if (!flag && Block.byId[i].e() == 1) {
return false;
}
- } else if (e(world.getData(j, k, l))) {
+ } else if (f(world.getData(j, k, l))) {
return false;
}
@@ -273,8 +269,8 @@ public class BlockPiston extends Block {
}
}
- // CraftBukkit - boolean -> int
- private static int g(World world, int i, int j, int k, int l) {
+ // CraftBukkit - change return from boolean to int
+ private static int i(World world, int i, int j, int k, int l) {
int i1 = i + Facing.b[l];
int j1 = j + Facing.c[l];
int k1 = k + Facing.d[l];
@@ -293,7 +289,7 @@ public class BlockPiston extends Block {
return -1; // CraftBukkit
}
- if (Block.byId[i2].g() != 1) {
+ if (Block.byId[i2].e() != 1) {
if (l1 == 12) {
return -1; // CraftBukkit
}
@@ -311,7 +307,7 @@ public class BlockPiston extends Block {
}
}
- private boolean h(World world, int i, int j, int k, int l) {
+ private boolean j(World world, int i, int j, int k, int l) {
int i1 = i + Facing.b[l];
int j1 = j + Facing.c[l];
int k1 = k + Facing.d[l];
@@ -331,7 +327,7 @@ public class BlockPiston extends Block {
return false;
}
- if (Block.byId[i2].g() != 1) {
+ if (Block.byId[i2].e() != 1) {
if (l1 == 12) {
return false;
}
@@ -343,7 +339,7 @@ public class BlockPiston extends Block {
continue;
}
- Block.byId[i2].b(world, i1, j1, k1, world.getData(i1, j1, k1), 0);
+ Block.byId[i2].c(world, i1, j1, k1, world.getData(i1, j1, k1), 0);
world.setTypeId(i1, j1, k1, 0);
}
}
@@ -356,10 +352,10 @@ public class BlockPiston extends Block {
int l2 = world.getData(l1, i2, j2);
if (k2 == this.id && l1 == i && i2 == j && j2 == k) {
- world.setRawTypeIdAndData(i1, j1, k1, Block.PISTON_MOVING.id, l | (this.a ? 8 : 0));
+ world.setRawTypeIdAndData(i1, j1, k1, Block.PISTON_MOVING.id, l | (this.a ? 8 : 0), false);
world.setTileEntity(i1, j1, k1, BlockPistonMoving.a(Block.PISTON_EXTENSION.id, l | (this.a ? 8 : 0), l, true, false));
} else {
- world.setRawTypeIdAndData(i1, j1, k1, Block.PISTON_MOVING.id, l2);
+ world.setRawTypeIdAndData(i1, j1, k1, Block.PISTON_MOVING.id, l2, false);
world.setTileEntity(i1, j1, k1, BlockPistonMoving.a(k2, l2, l, true, false));
}
diff --git a/src/main/java/net/minecraft/server/BlockPistonExtension.java b/src/main/java/net/minecraft/server/BlockPistonExtension.java
index e6a7b186e0..289671756c 100644
--- a/src/main/java/net/minecraft/server/BlockPistonExtension.java
+++ b/src/main/java/net/minecraft/server/BlockPistonExtension.java
@@ -1,6 +1,6 @@
package net.minecraft.server;
-import java.util.ArrayList;
+import java.util.List;
import java.util.Random;
public class BlockPistonExtension extends Block {
@@ -13,41 +13,40 @@ public class BlockPistonExtension extends Block {
this.c(0.5F);
}
- public void remove(World world, int i, int j, int k) {
- super.remove(world, i, j, k);
- int l = world.getData(i, j, k);
- if (l > 5 || l < 0) return; // CraftBukkit - fixed a piston AIOOBE issue.
- int i1 = Facing.OPPOSITE_FACING[b(l)];
+ public void remove(World world, int i, int j, int k, int l, int i1) {
+ super.remove(world, i, j, k, l, i1);
+ if (i1 > 5 || i1 < 0) return; // CraftBukkit - fixed a piston AIOOBE issue
+ int j1 = Facing.OPPOSITE_FACING[f(i1)];
- i += Facing.b[i1];
- j += Facing.c[i1];
- k += Facing.d[i1];
- int j1 = world.getTypeId(i, j, k);
+ i += Facing.b[j1];
+ j += Facing.c[j1];
+ k += Facing.d[j1];
+ int k1 = world.getTypeId(i, j, k);
- if (j1 == Block.PISTON.id || j1 == Block.PISTON_STICKY.id) {
- l = world.getData(i, j, k);
- if (BlockPiston.e(l)) {
- Block.byId[j1].b(world, i, j, k, l, 0);
+ if (k1 == Block.PISTON.id || k1 == Block.PISTON_STICKY.id) {
+ i1 = world.getData(i, j, k);
+ if (BlockPiston.f(i1)) {
+ Block.byId[k1].c(world, i, j, k, i1, 0);
world.setTypeId(i, j, k, 0);
}
}
}
public int a(int i, int j) {
- int k = b(j);
+ int k = f(j);
- return i == k ? (this.a >= 0 ? this.a : ((j & 8) != 0 ? this.textureId - 1 : this.textureId)) : (i == Facing.OPPOSITE_FACING[k] ? 107 : 108);
+ return i == k ? (this.a >= 0 ? this.a : ((j & 8) != 0 ? this.textureId - 1 : this.textureId)) : (k < 6 && i == Facing.OPPOSITE_FACING[k] ? 107 : 108);
}
- public int c() {
+ public int b() {
return 17;
}
- public boolean a() {
+ public boolean d() {
return false;
}
- public boolean b() {
+ public boolean c() {
return false;
}
@@ -63,50 +62,50 @@ public class BlockPistonExtension extends Block {
return 0;
}
- public void a(World world, int i, int j, int k, AxisAlignedBB axisalignedbb, ArrayList arraylist) {
+ public void a(World world, int i, int j, int k, AxisAlignedBB axisalignedbb, List list, Entity entity) {
int l = world.getData(i, j, k);
- switch (b(l)) {
+ switch (f(l)) {
case 0:
this.a(0.0F, 0.0F, 0.0F, 1.0F, 0.25F, 1.0F);
- super.a(world, i, j, k, axisalignedbb, arraylist);
+ super.a(world, i, j, k, axisalignedbb, list, entity);
this.a(0.375F, 0.25F, 0.375F, 0.625F, 1.0F, 0.625F);
- super.a(world, i, j, k, axisalignedbb, arraylist);
+ super.a(world, i, j, k, axisalignedbb, list, entity);
break;
case 1:
this.a(0.0F, 0.75F, 0.0F, 1.0F, 1.0F, 1.0F);
- super.a(world, i, j, k, axisalignedbb, arraylist);
+ super.a(world, i, j, k, axisalignedbb, list, entity);
this.a(0.375F, 0.0F, 0.375F, 0.625F, 0.75F, 0.625F);
- super.a(world, i, j, k, axisalignedbb, arraylist);
+ super.a(world, i, j, k, axisalignedbb, list, entity);
break;
case 2:
this.a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.25F);
- super.a(world, i, j, k, axisalignedbb, arraylist);
+ super.a(world, i, j, k, axisalignedbb, list, entity);
this.a(0.25F, 0.375F, 0.25F, 0.75F, 0.625F, 1.0F);
- super.a(world, i, j, k, axisalignedbb, arraylist);
+ super.a(world, i, j, k, axisalignedbb, list, entity);
break;
case 3:
this.a(0.0F, 0.0F, 0.75F, 1.0F, 1.0F, 1.0F);
- super.a(world, i, j, k, axisalignedbb, arraylist);
+ super.a(world, i, j, k, axisalignedbb, list, entity);
this.a(0.25F, 0.375F, 0.0F, 0.75F, 0.625F, 0.75F);
- super.a(world, i, j, k, axisalignedbb, arraylist);
+ super.a(world, i, j, k, axisalignedbb, list, entity);
break;
case 4:
this.a(0.0F, 0.0F, 0.0F, 0.25F, 1.0F, 1.0F);
- super.a(world, i, j, k, axisalignedbb, arraylist);
+ super.a(world, i, j, k, axisalignedbb, list, entity);
this.a(0.375F, 0.25F, 0.25F, 0.625F, 0.75F, 1.0F);
- super.a(world, i, j, k, axisalignedbb, arraylist);
+ super.a(world, i, j, k, axisalignedbb, list, entity);
break;
case 5:
this.a(0.75F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
- super.a(world, i, j, k, axisalignedbb, arraylist);
+ super.a(world, i, j, k, axisalignedbb, list, entity);
this.a(0.0F, 0.375F, 0.25F, 0.75F, 0.625F, 0.75F);
- super.a(world, i, j, k, axisalignedbb, arraylist);
+ super.a(world, i, j, k, axisalignedbb, list, entity);
}
this.a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
@@ -115,7 +114,7 @@ public class BlockPistonExtension extends Block {
public void updateShape(IBlockAccess iblockaccess, int i, int j, int k) {
int l = iblockaccess.getData(i, j, k);
- switch (b(l)) {
+ switch (f(l)) {
case 0:
this.a(0.0F, 0.0F, 0.0F, 1.0F, 0.25F, 1.0F);
break;
@@ -142,8 +141,8 @@ public class BlockPistonExtension extends Block {
}
public void doPhysics(World world, int i, int j, int k, int l) {
- int i1 = b(world.getData(i, j, k));
- if (i1 > 5 || i1 < 0) return; // CraftBukkit - fixed a piston AIOOBE issue.
+ int i1 = f(world.getData(i, j, k));
+ if (i1 > 5 || i1 < 0) return; // CraftBukkit - fixed a piston AIOOBE issue
int j1 = world.getTypeId(i - Facing.b[i1], j - Facing.c[i1], k - Facing.d[i1]);
if (j1 != Block.PISTON.id && j1 != Block.PISTON_STICKY.id) {
@@ -153,7 +152,7 @@ public class BlockPistonExtension extends Block {
}
}
- public static int b(int i) {
+ public static int f(int i) {
return i & 7;
}
}
diff --git a/src/main/java/net/minecraft/server/BlockPortal.java b/src/main/java/net/minecraft/server/BlockPortal.java
index 057f526b0a..c18a9750a3 100644
--- a/src/main/java/net/minecraft/server/BlockPortal.java
+++ b/src/main/java/net/minecraft/server/BlockPortal.java
@@ -11,6 +11,22 @@ public class BlockPortal extends BlockHalfTransparant {
public BlockPortal(int i, int j) {
super(i, j, Material.PORTAL, false);
+ this.b(true);
+ }
+
+ public void b(World world, int i, int j, int k, Random random) {
+ super.b(world, i, j, k, random);
+ if (world.worldProvider.d() && random.nextInt(2000) < world.difficulty) {
+ int l;
+
+ for (l = j; !world.t(i, l, k) && l > 0; --l) {
+ ;
+ }
+
+ if (l > 0 && !world.s(i, l + 1, k)) {
+ ItemMonsterEgg.a(world, 57, (double) i + 0.5D, (double) l + 1.1D, (double) k + 0.5D);
+ }
+ }
}
public AxisAlignedBB e(World world, int i, int j, int k) {
@@ -32,15 +48,15 @@ public class BlockPortal extends BlockHalfTransparant {
}
}
- public boolean a() {
+ public boolean d() {
return false;
}
- public boolean b() {
+ public boolean c() {
return false;
}
- public boolean b_(World world, int i, int j, int k) {
+ public boolean i_(World world, int i, int j, int k) {
byte b0 = 0;
byte b1 = 0;
@@ -146,8 +162,10 @@ public class BlockPortal extends BlockHalfTransparant {
if (flag && flag1) {
world.setTypeId(i, j, k, 0);
- } else if ((world.getTypeId(i + b0, j, k + b1) != Block.OBSIDIAN.id || world.getTypeId(i - b0, j, k - b1) != this.id) && (world.getTypeId(i - b0, j, k - b1) != Block.OBSIDIAN.id || world.getTypeId(i + b0, j, k + b1) != this.id)) {
- world.setTypeId(i, j, k, 0);
+ } else {
+ if ((world.getTypeId(i + b0, j, k + b1) != Block.OBSIDIAN.id || world.getTypeId(i - b0, j, k - b1) != this.id) && (world.getTypeId(i - b0, j, k - b1) != Block.OBSIDIAN.id || world.getTypeId(i + b0, j, k + b1) != this.id)) {
+ world.setTypeId(i, j, k, 0);
+ }
}
} else {
world.setTypeId(i, j, k, 0);
@@ -166,7 +184,7 @@ public class BlockPortal extends BlockHalfTransparant {
world.getServer().getPluginManager().callEvent(event);
// CraftBukkit end
- entity.ad();
+ entity.aa();
}
}
}
diff --git a/src/main/java/net/minecraft/server/BlockPressurePlate.java b/src/main/java/net/minecraft/server/BlockPressurePlate.java
index e15ee3b527..d05e69875f 100644
--- a/src/main/java/net/minecraft/server/BlockPressurePlate.java
+++ b/src/main/java/net/minecraft/server/BlockPressurePlate.java
@@ -15,13 +15,14 @@ public class BlockPressurePlate extends Block {
protected BlockPressurePlate(int i, int j, EnumMobType enummobtype, Material material) {
super(i, j, material);
this.a = enummobtype;
- this.a(true);
+ this.a(CreativeModeTab.d);
+ this.b(true);
float f = 0.0625F;
this.a(f, 0.0F, f, 1.0F - f, 0.03125F, 1.0F - f);
}
- public int d() {
+ public int p_() {
return 20;
}
@@ -29,41 +30,39 @@ public class BlockPressurePlate extends Block {
return null;
}
- public boolean a() {
+ public boolean d() {
return false;
}
- public boolean b() {
+ public boolean c() {
return false;
}
- public boolean b(IBlockAccess iblockaccess, int i, int j, int k) {
+ public boolean c(IBlockAccess iblockaccess, int i, int j, int k) {
return true;
}
public boolean canPlace(World world, int i, int j, int k) {
- return world.e(i, j - 1, k) || world.getTypeId(i, j - 1, k) == Block.FENCE.id;
+ return world.t(i, j - 1, k) || BlockFence.c(world.getTypeId(i, j - 1, k));
}
- public void onPlace(World world, int i, int j, int k) {}
-
public void doPhysics(World world, int i, int j, int k, int l) {
boolean flag = false;
- if (!world.e(i, j - 1, k) && world.getTypeId(i, j - 1, k) != Block.FENCE.id) {
+ if (!world.t(i, j - 1, k) && !BlockFence.c(world.getTypeId(i, j - 1, k))) {
flag = true;
}
if (flag) {
- this.b(world, i, j, k, world.getData(i, j, k), 0);
+ this.c(world, i, j, k, world.getData(i, j, k), 0);
world.setTypeId(i, j, k, 0);
}
}
- public void a(World world, int i, int j, int k, Random random) {
+ public void b(World world, int i, int j, int k, Random random) {
if (!world.isStatic) {
if (world.getData(i, j, k) != 0) {
- this.g(world, i, j, k);
+ this.l(world, i, j, k);
}
}
}
@@ -71,30 +70,30 @@ public class BlockPressurePlate extends Block {
public void a(World world, int i, int j, int k, Entity entity) {
if (!world.isStatic) {
if (world.getData(i, j, k) != 1) {
- this.g(world, i, j, k);
+ this.l(world, i, j, k);
}
}
}
- private void g(World world, int i, int j, int k) {
+ private void l(World world, int i, int j, int k) {
boolean flag = world.getData(i, j, k) == 1;
boolean flag1 = false;
float f = 0.125F;
List list = null;
if (this.a == EnumMobType.EVERYTHING) {
- list = world.getEntities((Entity) null, AxisAlignedBB.b((double) ((float) i + f), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) j + 0.25D, (double) ((float) (k + 1) - f)));
+ list = world.getEntities((Entity) null, AxisAlignedBB.a().a((double) ((float) i + f), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) j + 0.25D, (double) ((float) (k + 1) - f)));
}
if (this.a == EnumMobType.MOBS) {
- list = world.a(EntityLiving.class, AxisAlignedBB.b((double) ((float) i + f), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) j + 0.25D, (double) ((float) (k + 1) - f)));
+ list = world.a(EntityLiving.class, AxisAlignedBB.a().a((double) ((float) i + f), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) j + 0.25D, (double) ((float) (k + 1) - f)));
}
if (this.a == EnumMobType.PLAYERS) {
- list = world.a(EntityHuman.class, AxisAlignedBB.b((double) ((float) i + f), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) j + 0.25D, (double) ((float) (k + 1) - f)));
+ list = world.a(EntityHuman.class, AxisAlignedBB.a().a((double) ((float) i + f), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) j + 0.25D, (double) ((float) (k + 1) - f)));
}
- if (list.size() > 0) {
+ if (!list.isEmpty()) {
flag1 = true;
}
@@ -116,6 +115,7 @@ public class BlockPressurePlate extends Block {
} else {
continue;
}
+
if (cancellable.isCancelled()) {
return;
}
@@ -134,7 +134,7 @@ public class BlockPressurePlate extends Block {
world.setData(i, j, k, 1);
world.applyPhysics(i, j, k, this.id);
world.applyPhysics(i, j - 1, k, this.id);
- world.b(i, j, k, i, j, k);
+ world.d(i, j, k, i, j, k);
world.makeSound((double) i + 0.5D, (double) j + 0.1D, (double) k + 0.5D, "random.click", 0.3F, 0.6F);
}
@@ -142,24 +142,22 @@ public class BlockPressurePlate extends Block {
world.setData(i, j, k, 0);
world.applyPhysics(i, j, k, this.id);
world.applyPhysics(i, j - 1, k, this.id);
- world.b(i, j, k, i, j, k);
+ world.d(i, j, k, i, j, k);
world.makeSound((double) i + 0.5D, (double) j + 0.1D, (double) k + 0.5D, "random.click", 0.3F, 0.5F);
}
if (flag1) {
- world.c(i, j, k, this.id, this.d());
+ world.a(i, j, k, this.id, this.p_());
}
}
- public void remove(World world, int i, int j, int k) {
- int l = world.getData(i, j, k);
-
- if (l > 0) {
+ public void remove(World world, int i, int j, int k, int l, int i1) {
+ if (i1 > 0) {
world.applyPhysics(i, j, k, this.id);
world.applyPhysics(i, j - 1, k, this.id);
}
- super.remove(world, i, j, k);
+ super.remove(world, i, j, k, l, i1);
}
public void updateShape(IBlockAccess iblockaccess, int i, int j, int k) {
@@ -177,7 +175,7 @@ public class BlockPressurePlate extends Block {
return iblockaccess.getData(i, j, k) > 0;
}
- public boolean d(World world, int i, int j, int k, int l) {
+ public boolean c(World world, int i, int j, int k, int l) {
return world.getData(i, j, k) == 0 ? false : l == 1;
}
@@ -193,7 +191,7 @@ public class BlockPressurePlate extends Block {
this.a(0.5F - f, 0.5F - f1, 0.5F - f2, 0.5F + f, 0.5F + f1, 0.5F + f2);
}
- public int g() {
+ public int e() {
return 1;
}
}
diff --git a/src/main/java/net/minecraft/server/BlockPumpkin.java b/src/main/java/net/minecraft/server/BlockPumpkin.java
index a7c33bc917..86ec54eb04 100644
--- a/src/main/java/net/minecraft/server/BlockPumpkin.java
+++ b/src/main/java/net/minecraft/server/BlockPumpkin.java
@@ -13,8 +13,9 @@ public class BlockPumpkin extends BlockDirectional {
protected BlockPumpkin(int i, int j, boolean flag) {
super(i, Material.PUMPKIN);
this.textureId = j;
- this.a(true);
+ this.b(true);
this.a = flag;
+ this.a(CreativeModeTab.b);
}
public int a(int i, int j) {
@@ -42,7 +43,7 @@ public class BlockPumpkin extends BlockDirectional {
if (world.suppressPhysics) return; // CraftBukkit
if (world.getTypeId(i, j - 1, k) == Block.SNOW_BLOCK.id && world.getTypeId(i, j - 2, k) == Block.SNOW_BLOCK.id) {
if (!world.isStatic) {
- // CraftBukkit start - Use BlockStateListPopulator
+ // CraftBukkit start - use BlockStateListPopulator
BlockStateListPopulator blockList = new BlockStateListPopulator(world.getWorld());
blockList.setTypeId(i, j, k, 0);
@@ -66,12 +67,13 @@ public class BlockPumpkin extends BlockDirectional {
boolean flag1 = world.getTypeId(i, j - 1, k - 1) == Block.IRON_BLOCK.id && world.getTypeId(i, j - 1, k + 1) == Block.IRON_BLOCK.id;
if (flag || flag1) {
- // CraftBukkit start - Use BlockStateListPopulator
+ // CraftBukkit start - use BlockStateListPopulator
BlockStateListPopulator blockList = new BlockStateListPopulator(world.getWorld());
blockList.setTypeId(i, j, k, 0);
blockList.setTypeId(i, j - 1, k, 0);
blockList.setTypeId(i, j - 2, k, 0);
+
if (flag) {
blockList.setTypeId(i - 1, j - 1, k, 0);
blockList.setTypeId(i + 1, j - 1, k, 0);
@@ -82,7 +84,7 @@ public class BlockPumpkin extends BlockDirectional {
EntityIronGolem entityirongolem = new EntityIronGolem(world);
- entityirongolem.b(true);
+ entityirongolem.f(true);
entityirongolem.setPositionRotation((double) i + 0.5D, (double) j - 1.95D, (double) k + 0.5D, 0.0F, 0.0F);
if (world.addEntity(entityirongolem, SpawnReason.BUILD_IRONGOLEM)) {
for (int i1 = 0; i1 < 120; ++i1) {
@@ -99,7 +101,7 @@ public class BlockPumpkin extends BlockDirectional {
public boolean canPlace(World world, int i, int j, int k) {
int l = world.getTypeId(i, j, k);
- return (l == 0 || Block.byId[l].material.isReplacable()) && world.e(i, j - 1, k);
+ return (l == 0 || Block.byId[l].material.isReplaceable()) && world.t(i, j - 1, k);
}
public void postPlace(World world, int i, int j, int k, EntityLiving entityliving) {
diff --git a/src/main/java/net/minecraft/server/BlockRedstoneLamp.java b/src/main/java/net/minecraft/server/BlockRedstoneLamp.java
index 5aa16d6484..6bdd14aad2 100644
--- a/src/main/java/net/minecraft/server/BlockRedstoneLamp.java
+++ b/src/main/java/net/minecraft/server/BlockRedstoneLamp.java
@@ -2,9 +2,7 @@ package net.minecraft.server;
import java.util.Random;
-// CraftBukkit start
-import org.bukkit.craftbukkit.event.CraftEventFactory;
-// CraftBukkit end
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
public class BlockRedstoneLamp extends Block {
@@ -22,13 +20,14 @@ public class BlockRedstoneLamp extends Block {
public void onPlace(World world, int i, int j, int k) {
if (!world.isStatic) {
if (this.a && !world.isBlockIndirectlyPowered(i, j, k)) {
- world.c(i, j, k, this.id, 4);
+ world.a(i, j, k, this.id, 4);
} else if (!this.a && world.isBlockIndirectlyPowered(i, j, k)) {
// CraftBukkit start
if (CraftEventFactory.callRedstoneChange(world, i, j, k, 0, 15).getNewCurrent() != 15) {
return;
}
// CraftBukkit end
+
world.setTypeId(i, j, k, Block.REDSTONE_LAMP_ON.id);
}
}
@@ -37,25 +36,27 @@ public class BlockRedstoneLamp extends Block {
public void doPhysics(World world, int i, int j, int k, int l) {
if (!world.isStatic) {
if (this.a && !world.isBlockIndirectlyPowered(i, j, k)) {
- world.c(i, j, k, this.id, 4);
+ world.a(i, j, k, this.id, 4);
} else if (!this.a && world.isBlockIndirectlyPowered(i, j, k)) {
// CraftBukkit start
if (CraftEventFactory.callRedstoneChange(world, i, j, k, 0, 15).getNewCurrent() != 15) {
return;
}
// CraftBukkit end
+
world.setTypeId(i, j, k, Block.REDSTONE_LAMP_ON.id);
}
}
}
- public void a(World world, int i, int j, int k, Random random) {
+ public void b(World world, int i, int j, int k, Random random) {
if (!world.isStatic && this.a && !world.isBlockIndirectlyPowered(i, j, k)) {
// CraftBukkit start
if (CraftEventFactory.callRedstoneChange(world, i, j, k, 15, 0).getNewCurrent() != 0) {
return;
}
// CraftBukkit end
+
world.setTypeId(i, j, k, Block.REDSTONE_LAMP_OFF.id);
}
}
diff --git a/src/main/java/net/minecraft/server/BlockRedstoneOre.java b/src/main/java/net/minecraft/server/BlockRedstoneOre.java
index 7811b87a31..123d8fd23b 100644
--- a/src/main/java/net/minecraft/server/BlockRedstoneOre.java
+++ b/src/main/java/net/minecraft/server/BlockRedstoneOre.java
@@ -11,18 +11,18 @@ public class BlockRedstoneOre extends Block {
public BlockRedstoneOre(int i, int j, boolean flag) {
super(i, j, Material.STONE);
if (flag) {
- this.a(true);
+ this.b(true);
}
this.a = flag;
}
- public int d() {
+ public int p_() {
return 30;
}
public void attack(World world, int i, int j, int k, EntityHuman entityhuman) {
- this.g(world, i, j, k);
+ this.l(world, i, j, k);
super.attack(world, i, j, k, entityhuman);
}
@@ -31,33 +31,33 @@ public class BlockRedstoneOre extends Block {
if (entity instanceof EntityHuman) {
org.bukkit.event.player.PlayerInteractEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent((EntityHuman) entity, org.bukkit.event.block.Action.PHYSICAL, i, j, k, -1, null);
if (!event.isCancelled()) {
- this.g(world, i, j, k);
+ this.l(world, i, j, k);
super.b(world, i, j, k, entity);
}
} else {
EntityInteractEvent event = new EntityInteractEvent(entity.getBukkitEntity(), world.getWorld().getBlockAt(i, j, k));
world.getServer().getPluginManager().callEvent(event);
if (!event.isCancelled()) {
- this.g(world, i, j, k);
+ this.l(world, i, j, k);
super.b(world, i, j, k, entity);
}
}
// CraftBukkit end
}
- public boolean interact(World world, int i, int j, int k, EntityHuman entityhuman) {
- this.g(world, i, j, k);
- return super.interact(world, i, j, k, entityhuman);
+ public boolean interact(World world, int i, int j, int k, EntityHuman entityhuman, int l, float f, float f1, float f2) {
+ this.l(world, i, j, k);
+ return super.interact(world, i, j, k, entityhuman, l, f, f1, f2);
}
- private void g(World world, int i, int j, int k) {
- this.h(world, i, j, k);
+ private void l(World world, int i, int j, int k) {
+ this.n(world, i, j, k);
if (this.id == Block.REDSTONE_ORE.id) {
world.setTypeId(i, j, k, Block.GLOWING_REDSTONE_ORE.id);
}
}
- public void a(World world, int i, int j, int k, Random random) {
+ public void b(World world, int i, int j, int k, Random random) {
if (this.id == Block.GLOWING_REDSTONE_ORE.id) {
world.setTypeId(i, j, k, Block.REDSTONE_ORE.id);
}
@@ -75,7 +75,16 @@ public class BlockRedstoneOre extends Block {
return 4 + random.nextInt(2);
}
- private void h(World world, int i, int j, int k) {
+ public void dropNaturally(World world, int i, int j, int k, int l, float f, int i1) {
+ super.dropNaturally(world, i, j, k, l, f, i1);
+ if (this.getDropType(l, world.random, i1) != this.id) {
+ int j1 = 1 + world.random.nextInt(5);
+
+ this.g(world, i, j, k, j1);
+ }
+ }
+
+ private void n(World world, int i, int j, int k) {
Random random = world.random;
double d0 = 0.0625D;
@@ -114,7 +123,7 @@ public class BlockRedstoneOre extends Block {
}
}
- protected ItemStack a_(int i) {
+ protected ItemStack c_(int i) {
return new ItemStack(Block.REDSTONE_ORE);
}
}
diff --git a/src/main/java/net/minecraft/server/BlockRedstoneTorch.java b/src/main/java/net/minecraft/server/BlockRedstoneTorch.java
index 21c7593eb5..2904401cf8 100644
--- a/src/main/java/net/minecraft/server/BlockRedstoneTorch.java
+++ b/src/main/java/net/minecraft/server/BlockRedstoneTorch.java
@@ -1,7 +1,10 @@
package net.minecraft.server;
import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import java.util.Random;
import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
@@ -9,21 +12,26 @@ import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
public class BlockRedstoneTorch extends BlockTorch {
private boolean isOn = false;
- private static List b = new ArrayList();
+ private static Map b = new HashMap();
public int a(int i, int j) {
return i == 1 ? Block.REDSTONE_WIRE.a(i, j) : super.a(i, j);
}
private boolean a(World world, int i, int j, int k, boolean flag) {
+ if (!b.containsKey(world)) {
+ b.put(world, new ArrayList());
+ }
+
if (flag) {
- b.add(new RedstoneUpdateInfo(i, j, k, world.getTime()));
+ ((List) b.get(world)).add(new RedstoneUpdateInfo(i, j, k, world.getTime()));
}
int l = 0;
+ Iterator iterator = ((List) b.get(world)).iterator();
- for (int i1 = 0; i1 < b.size(); ++i1) {
- RedstoneUpdateInfo redstoneupdateinfo = (RedstoneUpdateInfo) b.get(i1);
+ while (iterator.hasNext()) {
+ RedstoneUpdateInfo redstoneupdateinfo = (RedstoneUpdateInfo) iterator.next();
if (redstoneupdateinfo.a == i && redstoneupdateinfo.b == j && redstoneupdateinfo.c == k) {
++l;
@@ -39,10 +47,11 @@ public class BlockRedstoneTorch extends BlockTorch {
protected BlockRedstoneTorch(int i, int j, boolean flag) {
super(i, j);
this.isOn = flag;
- this.a(true);
+ this.b(true);
+ this.a((CreativeModeTab) null);
}
- public int d() {
+ public int p_() {
return 2;
}
@@ -61,7 +70,7 @@ public class BlockRedstoneTorch extends BlockTorch {
}
}
- public void remove(World world, int i, int j, int k) {
+ public void remove(World world, int i, int j, int k, int l, int i1) {
if (this.isOn) {
world.applyPhysics(i, j - 1, k, this.id);
world.applyPhysics(i, j + 1, k, this.id);
@@ -82,17 +91,18 @@ public class BlockRedstoneTorch extends BlockTorch {
}
}
- private boolean g(World world, int i, int j, int k) {
+ private boolean l(World world, int i, int j, int k) {
int l = world.getData(i, j, k);
return l == 5 && world.isBlockFaceIndirectlyPowered(i, j - 1, k, 0) ? true : (l == 3 && world.isBlockFaceIndirectlyPowered(i, j, k - 1, 2) ? true : (l == 4 && world.isBlockFaceIndirectlyPowered(i, j, k + 1, 3) ? true : (l == 1 && world.isBlockFaceIndirectlyPowered(i - 1, j, k, 4) ? true : l == 2 && world.isBlockFaceIndirectlyPowered(i + 1, j, k, 5))));
}
- public void a(World world, int i, int j, int k, Random random) {
- boolean flag = this.g(world, i, j, k);
+ public void b(World world, int i, int j, int k, Random random) {
+ boolean flag = this.l(world, i, j, k);
+ List list = (List) b.get(world);
- while (b.size() > 0 && world.getTime() - ((RedstoneUpdateInfo) b.get(0)).d > 60L) {
- b.remove(0);
+ while (list != null && !list.isEmpty() && world.getTime() - ((RedstoneUpdateInfo) list.get(0)).d > 60L) {
+ list.remove(0);
}
// CraftBukkit start
@@ -145,10 +155,10 @@ public class BlockRedstoneTorch extends BlockTorch {
public void doPhysics(World world, int i, int j, int k, int l) {
super.doPhysics(world, i, j, k, l);
- world.c(i, j, k, this.id, this.d());
+ world.a(i, j, k, this.id, this.p_());
}
- public boolean d(World world, int i, int j, int k, int l) {
+ public boolean c(World world, int i, int j, int k, int l) {
return l == 0 ? this.a(world, i, j, k, l) : false;
}
@@ -159,4 +169,15 @@ public class BlockRedstoneTorch extends BlockTorch {
public boolean isPowerSource() {
return true;
}
+
+ public void a(World world, long i, long j) {
+ List list = (List) b.get(world);
+ RedstoneUpdateInfo redstoneupdateinfo;
+
+ if (list != null) {
+ for (Iterator iterator = list.iterator(); iterator.hasNext(); redstoneupdateinfo.d += i) {
+ redstoneupdateinfo = (RedstoneUpdateInfo) iterator.next();
+ }
+ }
+ }
}
diff --git a/src/main/java/net/minecraft/server/BlockRedstoneWire.java b/src/main/java/net/minecraft/server/BlockRedstoneWire.java
index e36b7a2321..0b656b53d2 100644
--- a/src/main/java/net/minecraft/server/BlockRedstoneWire.java
+++ b/src/main/java/net/minecraft/server/BlockRedstoneWire.java
@@ -2,6 +2,7 @@ package net.minecraft.server;
import java.util.ArrayList;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.Random;
import java.util.Set;
@@ -25,30 +26,31 @@ public class BlockRedstoneWire extends Block {
return null;
}
- public boolean a() {
+ public boolean d() {
return false;
}
- public boolean b() {
+ public boolean c() {
return false;
}
- public int c() {
+ public int b() {
return 5;
}
public boolean canPlace(World world, int i, int j, int k) {
- return world.e(i, j - 1, k) || world.getTypeId(i, j - 1, k) == Block.GLOWSTONE.id;
+ return world.t(i, j - 1, k) || world.getTypeId(i, j - 1, k) == Block.GLOWSTONE.id;
}
- private void g(World world, int i, int j, int k) {
+ private void l(World world, int i, int j, int k) {
this.a(world, i, j, k, i, j, k);
ArrayList arraylist = new ArrayList(this.b);
this.b.clear();
+ Iterator iterator = arraylist.iterator();
- for (int l = 0; l < arraylist.size(); ++l) {
- ChunkPosition chunkposition = (ChunkPosition) arraylist.get(l);
+ while (iterator.hasNext()) {
+ ChunkPosition chunkposition = (ChunkPosition) iterator.next();
world.applyPhysics(chunkposition.x, chunkposition.y, chunkposition.z, this.id);
}
@@ -92,11 +94,11 @@ public class BlockRedstoneWire extends Block {
l1 = this.getPower(world, j2, j, k2, l1);
}
- if (world.e(j2, j, k2) && !world.e(i, j + 1, k)) {
+ if (world.s(j2, j, k2) && !world.s(i, j + 1, k)) {
if (j2 != l || j + 1 != i1 || k2 != j1) {
l1 = this.getPower(world, j2, j + 1, k2, l1);
}
- } else if (!world.e(j2, j, k2) && (j2 != l || j - 1 != i1 || k2 != j1)) {
+ } else if (!world.s(j2, j, k2) && (j2 != l || j - 1 != i1 || k2 != j1)) {
l1 = this.getPower(world, j2, j - 1, k2, l1);
}
}
@@ -120,7 +122,7 @@ public class BlockRedstoneWire extends Block {
if (k1 != l1) {
world.suppressPhysics = true;
world.setData(i, j, k, l1);
- world.b(i, j, k, i, j, k);
+ world.d(i, j, k, i, j, k);
world.suppressPhysics = false;
for (i2 = 0; i2 < 4; ++i2) {
@@ -144,7 +146,7 @@ public class BlockRedstoneWire extends Block {
++k2;
}
- if (world.e(j2, j, k2)) {
+ if (world.s(j2, j, k2)) {
l2 += 2;
}
@@ -183,7 +185,7 @@ public class BlockRedstoneWire extends Block {
}
}
- private void h(World world, int i, int j, int k) {
+ private void n(World world, int i, int j, int k) {
if (world.getTypeId(i, j, k) == this.id) {
world.applyPhysics(i, j, k, this.id);
world.applyPhysics(i - 1, j, k, this.id);
@@ -199,41 +201,41 @@ public class BlockRedstoneWire extends Block {
if (world.suppressPhysics) return; // CraftBukkit
super.onPlace(world, i, j, k);
if (!world.isStatic) {
- this.g(world, i, j, k);
+ this.l(world, i, j, k);
world.applyPhysics(i, j + 1, k, this.id);
world.applyPhysics(i, j - 1, k, this.id);
- this.h(world, i - 1, j, k);
- this.h(world, i + 1, j, k);
- this.h(world, i, j, k - 1);
- this.h(world, i, j, k + 1);
- if (world.e(i - 1, j, k)) {
- this.h(world, i - 1, j + 1, k);
+ this.n(world, i - 1, j, k);
+ this.n(world, i + 1, j, k);
+ this.n(world, i, j, k - 1);
+ this.n(world, i, j, k + 1);
+ if (world.s(i - 1, j, k)) {
+ this.n(world, i - 1, j + 1, k);
} else {
- this.h(world, i - 1, j - 1, k);
+ this.n(world, i - 1, j - 1, k);
}
- if (world.e(i + 1, j, k)) {
- this.h(world, i + 1, j + 1, k);
+ if (world.s(i + 1, j, k)) {
+ this.n(world, i + 1, j + 1, k);
} else {
- this.h(world, i + 1, j - 1, k);
+ this.n(world, i + 1, j - 1, k);
}
- if (world.e(i, j, k - 1)) {
- this.h(world, i, j + 1, k - 1);
+ if (world.s(i, j, k - 1)) {
+ this.n(world, i, j + 1, k - 1);
} else {
- this.h(world, i, j - 1, k - 1);
+ this.n(world, i, j - 1, k - 1);
}
- if (world.e(i, j, k + 1)) {
- this.h(world, i, j + 1, k + 1);
+ if (world.s(i, j, k + 1)) {
+ this.n(world, i, j + 1, k + 1);
} else {
- this.h(world, i, j - 1, k + 1);
+ this.n(world, i, j - 1, k + 1);
}
}
}
- public void remove(World world, int i, int j, int k) {
- super.remove(world, i, j, k);
+ public void remove(World world, int i, int j, int k, int l, int i1) {
+ super.remove(world, i, j, k, l, i1);
if (!world.isStatic) {
world.applyPhysics(i, j + 1, k, this.id);
world.applyPhysics(i, j - 1, k, this.id);
@@ -241,33 +243,33 @@ public class BlockRedstoneWire extends Block {
world.applyPhysics(i - 1, j, k, this.id);
world.applyPhysics(i, j, k + 1, this.id);
world.applyPhysics(i, j, k - 1, this.id);
- this.g(world, i, j, k);
- this.h(world, i - 1, j, k);
- this.h(world, i + 1, j, k);
- this.h(world, i, j, k - 1);
- this.h(world, i, j, k + 1);
- if (world.e(i - 1, j, k)) {
- this.h(world, i - 1, j + 1, k);
+ this.l(world, i, j, k);
+ this.n(world, i - 1, j, k);
+ this.n(world, i + 1, j, k);
+ this.n(world, i, j, k - 1);
+ this.n(world, i, j, k + 1);
+ if (world.s(i - 1, j, k)) {
+ this.n(world, i - 1, j + 1, k);
} else {
- this.h(world, i - 1, j - 1, k);
+ this.n(world, i - 1, j - 1, k);
}
- if (world.e(i + 1, j, k)) {
- this.h(world, i + 1, j + 1, k);
+ if (world.s(i + 1, j, k)) {
+ this.n(world, i + 1, j + 1, k);
} else {
- this.h(world, i + 1, j - 1, k);
+ this.n(world, i + 1, j - 1, k);
}
- if (world.e(i, j, k - 1)) {
- this.h(world, i, j + 1, k - 1);
+ if (world.s(i, j, k - 1)) {
+ this.n(world, i, j + 1, k - 1);
} else {
- this.h(world, i, j - 1, k - 1);
+ this.n(world, i, j - 1, k - 1);
}
- if (world.e(i, j, k + 1)) {
- this.h(world, i, j + 1, k + 1);
+ if (world.s(i, j, k + 1)) {
+ this.n(world, i, j + 1, k + 1);
} else {
- this.h(world, i, j - 1, k + 1);
+ this.n(world, i, j - 1, k + 1);
}
}
}
@@ -288,11 +290,11 @@ public class BlockRedstoneWire extends Block {
int i1 = world.getData(i, j, k);
boolean flag = this.canPlace(world, i, j, k);
- if (!flag) {
- this.b(world, i, j, k, i1, 0);
- world.setTypeId(i, j, k, 0);
+ if (flag) {
+ this.l(world, i, j, k);
} else {
- this.g(world, i, j, k);
+ this.c(world, i, j, k, i1, 0);
+ world.setTypeId(i, j, k, 0);
}
super.doPhysics(world, i, j, k, l);
@@ -303,7 +305,7 @@ public class BlockRedstoneWire extends Block {
return Item.REDSTONE.id;
}
- public boolean d(World world, int i, int j, int k, int l) {
+ public boolean c(World world, int i, int j, int k, int l) {
return !this.a ? false : this.a(world, i, j, k, l);
}
@@ -315,25 +317,25 @@ public class BlockRedstoneWire extends Block {
} else if (l == 1) {
return true;
} else {
- boolean flag = d(iblockaccess, i - 1, j, k, 1) || !iblockaccess.e(i - 1, j, k) && d(iblockaccess, i - 1, j - 1, k, -1);
- boolean flag1 = d(iblockaccess, i + 1, j, k, 3) || !iblockaccess.e(i + 1, j, k) && d(iblockaccess, i + 1, j - 1, k, -1);
- boolean flag2 = d(iblockaccess, i, j, k - 1, 2) || !iblockaccess.e(i, j, k - 1) && d(iblockaccess, i, j - 1, k - 1, -1);
- boolean flag3 = d(iblockaccess, i, j, k + 1, 0) || !iblockaccess.e(i, j, k + 1) && d(iblockaccess, i, j - 1, k + 1, -1);
+ boolean flag = f(iblockaccess, i - 1, j, k, 1) || !iblockaccess.s(i - 1, j, k) && f(iblockaccess, i - 1, j - 1, k, -1);
+ boolean flag1 = f(iblockaccess, i + 1, j, k, 3) || !iblockaccess.s(i + 1, j, k) && f(iblockaccess, i + 1, j - 1, k, -1);
+ boolean flag2 = f(iblockaccess, i, j, k - 1, 2) || !iblockaccess.s(i, j, k - 1) && f(iblockaccess, i, j - 1, k - 1, -1);
+ boolean flag3 = f(iblockaccess, i, j, k + 1, 0) || !iblockaccess.s(i, j, k + 1) && f(iblockaccess, i, j - 1, k + 1, -1);
- if (!iblockaccess.e(i, j + 1, k)) {
- if (iblockaccess.e(i - 1, j, k) && d(iblockaccess, i - 1, j + 1, k, -1)) {
+ if (!iblockaccess.s(i, j + 1, k)) {
+ if (iblockaccess.s(i - 1, j, k) && f(iblockaccess, i - 1, j + 1, k, -1)) {
flag = true;
}
- if (iblockaccess.e(i + 1, j, k) && d(iblockaccess, i + 1, j + 1, k, -1)) {
+ if (iblockaccess.s(i + 1, j, k) && f(iblockaccess, i + 1, j + 1, k, -1)) {
flag1 = true;
}
- if (iblockaccess.e(i, j, k - 1) && d(iblockaccess, i, j + 1, k - 1, -1)) {
+ if (iblockaccess.s(i, j, k - 1) && f(iblockaccess, i, j + 1, k - 1, -1)) {
flag2 = true;
}
- if (iblockaccess.e(i, j, k + 1) && d(iblockaccess, i, j + 1, k + 1, -1)) {
+ if (iblockaccess.s(i, j, k + 1) && f(iblockaccess, i, j + 1, k + 1, -1)) {
flag3 = true;
}
}
@@ -346,7 +348,7 @@ public class BlockRedstoneWire extends Block {
return this.a;
}
- public static boolean c(IBlockAccess iblockaccess, int i, int j, int k, int l) {
+ public static boolean e(IBlockAccess iblockaccess, int i, int j, int k, int l) {
int i1 = iblockaccess.getTypeId(i, j, k);
if (i1 == Block.REDSTONE_WIRE.id) {
@@ -362,8 +364,8 @@ public class BlockRedstoneWire extends Block {
}
}
- public static boolean d(IBlockAccess iblockaccess, int i, int j, int k, int l) {
- if (c(iblockaccess, i, j, k, l)) {
+ public static boolean f(IBlockAccess iblockaccess, int i, int j, int k, int l) {
+ if (e(iblockaccess, i, j, k, l)) {
return true;
} else {
int i1 = iblockaccess.getTypeId(i, j, k);
diff --git a/src/main/java/net/minecraft/server/BlockReed.java b/src/main/java/net/minecraft/server/BlockReed.java
index 58f90fab6b..1b459a1940 100644
--- a/src/main/java/net/minecraft/server/BlockReed.java
+++ b/src/main/java/net/minecraft/server/BlockReed.java
@@ -10,10 +10,10 @@ public class BlockReed extends Block {
float f = 0.375F;
this.a(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 1.0F, 0.5F + f);
- this.a(true);
+ this.b(true);
}
- public void a(World world, int i, int j, int k, Random random) {
+ public void b(World world, int i, int j, int k, Random random) {
if (world.isEmpty(i, j + 1, k)) {
int l;
@@ -41,17 +41,17 @@ public class BlockReed extends Block {
}
public void doPhysics(World world, int i, int j, int k, int l) {
- this.g(world, i, j, k);
+ this.k_(world, i, j, k);
}
- protected final void g(World world, int i, int j, int k) {
- if (!this.f(world, i, j, k)) {
- this.b(world, i, j, k, world.getData(i, j, k), 0);
+ protected final void k_(World world, int i, int j, int k) {
+ if (!this.d(world, i, j, k)) {
+ this.c(world, i, j, k, world.getData(i, j, k), 0);
world.setTypeId(i, j, k, 0);
}
}
- public boolean f(World world, int i, int j, int k) {
+ public boolean d(World world, int i, int j, int k) {
return this.canPlace(world, i, j, k);
}
@@ -63,15 +63,15 @@ public class BlockReed extends Block {
return Item.SUGAR_CANE.id;
}
- public boolean a() {
+ public boolean d() {
return false;
}
- public boolean b() {
+ public boolean c() {
return false;
}
- public int c() {
+ public int b() {
return 1;
}
}
diff --git a/src/main/java/net/minecraft/server/BlockSand.java b/src/main/java/net/minecraft/server/BlockSand.java
index 487eb084d1..053b75e7eb 100644
--- a/src/main/java/net/minecraft/server/BlockSand.java
+++ b/src/main/java/net/minecraft/server/BlockSand.java
@@ -8,27 +8,30 @@ public class BlockSand extends Block {
public BlockSand(int i, int j) {
super(i, j, Material.SAND);
+ this.a(CreativeModeTab.b);
}
public void onPlace(World world, int i, int j, int k) {
- world.c(i, j, k, this.id, this.d());
+ world.a(i, j, k, this.id, this.p_());
}
public void doPhysics(World world, int i, int j, int k, int l) {
- world.c(i, j, k, this.id, this.d());
+ world.a(i, j, k, this.id, this.p_());
}
- public void a(World world, int i, int j, int k, Random random) {
- this.h(world, i, j, k);
+ public void b(World world, int i, int j, int k, Random random) {
+ if (!world.isStatic) {
+ this.l(world, i, j, k);
+ }
}
- private void h(World world, int i, int j, int k) {
+ private void l(World world, int i, int j, int k) {
if (canFall(world, i, j - 1, k) && j >= 0) {
byte b0 = 32;
- if (!instaFall && world.a(i - b0, j - b0, k - b0, i + b0, j + b0, k + b0)) {
+ if (!instaFall && world.c(i - b0, j - b0, k - b0, i + b0, j + b0, k + b0)) {
if (!world.isStatic) {
- // CraftBukkit - Change call to add data
+ // CraftBukkit - change call to add data
EntityFallingBlock entityfallingblock = new EntityFallingBlock(world, (double) ((float) i + 0.5F), (double) ((float) j + 0.5F), (double) ((float) k + 0.5F), this.id, world.getData(i, j, k));
world.addEntity(entityfallingblock);
@@ -47,7 +50,7 @@ public class BlockSand extends Block {
}
}
- public int d() {
+ public int p_() {
return 3;
}
diff --git a/src/main/java/net/minecraft/server/BlockSapling.java b/src/main/java/net/minecraft/server/BlockSapling.java
index 27853ae71c..9495da10e9 100644
--- a/src/main/java/net/minecraft/server/BlockSapling.java
+++ b/src/main/java/net/minecraft/server/BlockSapling.java
@@ -11,16 +11,19 @@ import org.bukkit.event.world.StructureGrowEvent;
public class BlockSapling extends BlockFlower {
+ public static final String[] a = new String[] { "oak", "spruce", "birch", "jungle"};
+
protected BlockSapling(int i, int j) {
super(i, j);
float f = 0.4F;
this.a(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 2.0F, 0.5F + f);
+ this.a(CreativeModeTab.c);
}
- public void a(World world, int i, int j, int k, Random random) {
+ public void b(World world, int i, int j, int k, Random random) {
if (!world.isStatic) {
- super.a(world, i, j, k, random);
+ super.b(world, i, j, k, random);
if (world.getLightLevel(i, j + 1, k) >= 9 && random.nextInt(7) == 0) {
int l = world.getData(i, j, k);
@@ -43,12 +46,12 @@ public class BlockSapling extends BlockFlower {
int l = world.getData(i, j, k) & 3;
int i1 = 0;
int j1 = 0;
+ boolean flag = false;
// CraftBukkit start - records tree generation and calls StructureGrowEvent
StructureGrowDelegate delegate = new StructureGrowDelegate(world);
TreeType treeType = null;
TreeGenerator gen = null;
boolean grownTree = false;
- boolean flag = false;
if (l == 1) {
treeType = TreeType.REDWOOD;
@@ -59,7 +62,7 @@ public class BlockSapling extends BlockFlower {
} else if (l == 3) {
for (i1 = 0; i1 >= -1; --i1) {
for (j1 = 0; j1 >= -1; --j1) {
- if (this.f(world, i + i1, j, k + j1, 3) && this.f(world, i + i1 + 1, j, k + j1, 3) && this.f(world, i + i1, j, k + j1 + 1, 3) && this.f(world, i + i1 + 1, j, k + j1 + 1, 3)) {
+ if (this.e(world, i + i1, j, k + j1, 3) && this.e(world, i + i1 + 1, j, k + j1, 3) && this.e(world, i + i1, j, k + j1 + 1, 3) && this.e(world, i + i1 + 1, j, k + j1 + 1, 3)) {
treeType = TreeType.JUNGLE;
gen = new WorldGenMegaTree(false, 10 + random.nextInt(20), 3, 3);
flag = true;
@@ -95,6 +98,7 @@ public class BlockSapling extends BlockFlower {
} else {
world.setRawTypeId(i, j, k, 0);
}
+
grownTree = gen.generate(delegate, random, i + i1, j, k + j1);
if (grownTree) {
Location location = new Location(world.getWorld(), i, j, k);
@@ -124,7 +128,7 @@ public class BlockSapling extends BlockFlower {
// CraftBukkit end
}
- public boolean f(World world, int i, int j, int k, int l) {
+ public boolean e(World world, int i, int j, int k, int l) {
return world.getTypeId(i, j, k) == this.id && (world.getData(i, j, k) & 3) == l;
}
diff --git a/src/main/java/net/minecraft/server/BlockSign.java b/src/main/java/net/minecraft/server/BlockSign.java
index 2d57b776e4..329a3d41f3 100644
--- a/src/main/java/net/minecraft/server/BlockSign.java
+++ b/src/main/java/net/minecraft/server/BlockSign.java
@@ -52,23 +52,23 @@ public class BlockSign extends BlockContainer {
}
}
- public int c() {
+ public int b() {
return -1;
}
- public boolean b() {
+ public boolean c() {
return false;
}
- public boolean b(IBlockAccess iblockaccess, int i, int j, int k) {
+ public boolean c(IBlockAccess iblockaccess, int i, int j, int k) {
return true;
}
- public boolean a() {
+ public boolean d() {
return false;
}
- public TileEntity a_() {
+ public TileEntity a(World world) {
try {
return (TileEntity) this.a.newInstance();
} catch (Exception exception) {
@@ -109,7 +109,7 @@ public class BlockSign extends BlockContainer {
}
if (flag) {
- this.b(world, i, j, k, world.getData(i, j, k), 0);
+ this.c(world, i, j, k, world.getData(i, j, k), 0);
world.setTypeId(i, j, k, 0);
}
diff --git a/src/main/java/net/minecraft/server/BlockSnow.java b/src/main/java/net/minecraft/server/BlockSnow.java
index 52db4965ae..ecade8e23a 100644
--- a/src/main/java/net/minecraft/server/BlockSnow.java
+++ b/src/main/java/net/minecraft/server/BlockSnow.java
@@ -7,20 +7,21 @@ public class BlockSnow extends Block {
protected BlockSnow(int i, int j) {
super(i, j, Material.SNOW_LAYER);
this.a(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F);
- this.a(true);
+ this.b(true);
+ this.a(CreativeModeTab.c);
}
public AxisAlignedBB e(World world, int i, int j, int k) {
int l = world.getData(i, j, k) & 7;
- return l >= 3 ? AxisAlignedBB.b((double) i + this.minX, (double) j + this.minY, (double) k + this.minZ, (double) i + this.maxX, (double) ((float) j + 0.5F), (double) k + this.maxZ) : null;
+ return l >= 3 ? AxisAlignedBB.a().a((double) i + this.minX, (double) j + this.minY, (double) k + this.minZ, (double) i + this.maxX, (double) ((float) j + 0.5F), (double) k + this.maxZ) : null;
}
- public boolean a() {
+ public boolean d() {
return false;
}
- public boolean b() {
+ public boolean c() {
return false;
}
@@ -34,16 +35,16 @@ public class BlockSnow extends Block {
public boolean canPlace(World world, int i, int j, int k) {
int l = world.getTypeId(i, j - 1, k);
- return l != 0 && (l == Block.LEAVES.id || Block.byId[l].a()) ? world.getMaterial(i, j - 1, k).isSolid() : false;
+ return l != 0 && (l == Block.LEAVES.id || Block.byId[l].d()) ? world.getMaterial(i, j - 1, k).isSolid() : false;
}
public void doPhysics(World world, int i, int j, int k, int l) {
- this.g(world, i, j, k);
+ this.n(world, i, j, k);
}
- private boolean g(World world, int i, int j, int k) {
+ private boolean n(World world, int i, int j, int k) {
if (!this.canPlace(world, i, j, k)) {
- this.b(world, i, j, k, world.getData(i, j, k), 0);
+ this.c(world, i, j, k, world.getData(i, j, k), 0);
world.setRawTypeId(i, j, k, 0); // CraftBukkit
world.notify(i, j, k); // CraftBukkit - Notify clients of the reversion
return false;
@@ -74,15 +75,15 @@ public class BlockSnow extends Block {
return 0;
}
- public void a(World world, int i, int j, int k, Random random) {
- if (world.a(EnumSkyBlock.BLOCK, i, j, k) > 11) {
+ public void b(World world, int i, int j, int k, Random random) {
+ if (world.b(EnumSkyBlock.BLOCK, i, j, k) > 11) {
// CraftBukkit start
if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world.getWorld().getBlockAt(i, j, k), 0).isCancelled()) {
return;
}
// CraftBukkit end
- this.b(world, i, j, k, world.getData(i, j, k), 0);
+ this.c(world, i, j, k, world.getData(i, j, k), 0);
world.setTypeId(i, j, k, 0);
}
}
diff --git a/src/main/java/net/minecraft/server/BlockSoil.java b/src/main/java/net/minecraft/server/BlockSoil.java
index 1c2c201e25..6804187a23 100644
--- a/src/main/java/net/minecraft/server/BlockSoil.java
+++ b/src/main/java/net/minecraft/server/BlockSoil.java
@@ -9,20 +9,20 @@ public class BlockSoil extends Block {
protected BlockSoil(int i) {
super(i, Material.EARTH);
this.textureId = 87;
- this.a(true);
+ this.b(true);
this.a(0.0F, 0.0F, 0.0F, 1.0F, 0.9375F, 1.0F);
- this.f(255);
+ this.h(255);
}
public AxisAlignedBB e(World world, int i, int j, int k) {
- return AxisAlignedBB.b((double) (i + 0), (double) (j + 0), (double) (k + 0), (double) (i + 1), (double) (j + 1), (double) (k + 1));
+ return AxisAlignedBB.a().a((double) (i + 0), (double) (j + 0), (double) (k + 0), (double) (i + 1), (double) (j + 1), (double) (k + 1));
}
- public boolean a() {
+ public boolean d() {
return false;
}
- public boolean b() {
+ public boolean c() {
return false;
}
@@ -30,13 +30,13 @@ public class BlockSoil extends Block {
return i == 1 && j > 0 ? this.textureId - 1 : (i == 1 ? this.textureId : 2);
}
- public void a(World world, int i, int j, int k, Random random) {
- if (!this.h(world, i, j, k) && !world.y(i, j + 1, k)) {
+ public void b(World world, int i, int j, int k, Random random) {
+ if (!this.n(world, i, j, k) && !world.B(i, j + 1, k)) {
int l = world.getData(i, j, k);
if (l > 0) {
world.setData(i, j, k, l - 1);
- } else if (!this.g(world, i, j, k)) {
+ } else if (!this.l(world, i, j, k)) {
world.setTypeId(i, j, k, Block.DIRT.id);
}
} else {
@@ -45,8 +45,8 @@ public class BlockSoil extends Block {
}
public void a(World world, int i, int j, int k, Entity entity, float f) {
- if (world.random.nextFloat() < f - 0.5F) {
- // CraftBukkit start - Interact Soil
+ if (!world.isStatic && world.random.nextFloat() < f - 0.5F) {
+ // CraftBukkit start - interact soil
org.bukkit.event.Cancellable cancellable;
if (entity instanceof EntityHuman) {
cancellable = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent((EntityHuman) entity, org.bukkit.event.block.Action.PHYSICAL, i, j, k, -1, null);
@@ -64,7 +64,7 @@ public class BlockSoil extends Block {
}
}
- private boolean g(World world, int i, int j, int k) {
+ private boolean l(World world, int i, int j, int k) {
byte b0 = 0;
for (int l = i - b0; l <= i + b0; ++l) {
@@ -80,7 +80,7 @@ public class BlockSoil extends Block {
return false;
}
- private boolean h(World world, int i, int j, int k) {
+ private boolean n(World world, int i, int j, int k) {
for (int l = i - 4; l <= i + 4; ++l) {
for (int i1 = j; i1 <= j + 1; ++i1) {
for (int j1 = k - 4; j1 <= k + 4; ++j1) {
diff --git a/src/main/java/net/minecraft/server/BlockStationary.java b/src/main/java/net/minecraft/server/BlockStationary.java
index a3a266d796..d9ef03fe85 100644
--- a/src/main/java/net/minecraft/server/BlockStationary.java
+++ b/src/main/java/net/minecraft/server/BlockStationary.java
@@ -11,41 +11,41 @@ public class BlockStationary extends BlockFluids {
protected BlockStationary(int i, Material material) {
super(i, material);
- this.a(false);
+ this.b(false);
if (material == Material.LAVA) {
- this.a(true);
+ this.b(true);
}
}
- public boolean b(IBlockAccess iblockaccess, int i, int j, int k) {
+ public boolean c(IBlockAccess iblockaccess, int i, int j, int k) {
return this.material != Material.LAVA;
}
public void doPhysics(World world, int i, int j, int k, int l) {
super.doPhysics(world, i, j, k, l);
if (world.getTypeId(i, j, k) == this.id) {
- this.i(world, i, j, k);
+ this.l(world, i, j, k);
}
}
- private void i(World world, int i, int j, int k) {
+ private void l(World world, int i, int j, int k) {
int l = world.getData(i, j, k);
world.suppressPhysics = true;
world.setRawTypeIdAndData(i, j, k, this.id - 1, l);
- world.b(i, j, k, i, j, k);
- world.c(i, j, k, this.id - 1, this.d());
+ world.d(i, j, k, i, j, k);
+ world.a(i, j, k, this.id - 1, this.p_());
world.suppressPhysics = false;
}
- public void a(World world, int i, int j, int k, Random random) {
+ public void b(World world, int i, int j, int k, Random random) {
if (this.material == Material.LAVA) {
int l = random.nextInt(3);
int i1;
int j1;
- // CraftBukkit start - prevent lava putting something on fire.
+ // CraftBukkit start - prevent lava putting something on fire
org.bukkit.World bworld = world.getWorld();
BlockIgniteEvent.IgniteCause igniteCause = BlockIgniteEvent.IgniteCause.LAVA;
// CraftBukkit end
@@ -56,8 +56,8 @@ public class BlockStationary extends BlockFluids {
k += random.nextInt(3) - 1;
j1 = world.getTypeId(i, j, k);
if (j1 == 0) {
- if (this.j(world, i - 1, j, k) || this.j(world, i + 1, j, k) || this.j(world, i, j, k - 1) || this.j(world, i, j, k + 1) || this.j(world, i, j - 1, k) || this.j(world, i, j + 1, k)) {
- // CraftBukkit start - prevent lava putting something on fire.
+ if (this.n(world, i - 1, j, k) || this.n(world, i + 1, j, k) || this.n(world, i, j, k - 1) || this.n(world, i, j, k + 1) || this.n(world, i, j - 1, k) || this.n(world, i, j + 1, k)) {
+ // CraftBukkit start - prevent lava putting something on fire
org.bukkit.block.Block block = bworld.getBlockAt(i, j, k);
if (block.getTypeId() != Block.FIRE.id) {
if (CraftEventFactory.callEvent(new BlockIgniteEvent(block, igniteCause, null)).isCancelled()) {
@@ -81,8 +81,8 @@ public class BlockStationary extends BlockFluids {
for (int k1 = 0; k1 < 3; ++k1) {
i = i1 + random.nextInt(3) - 1;
k = j1 + random.nextInt(3) - 1;
- if (world.isEmpty(i, j + 1, k) && this.j(world, i, j, k)) {
- // CraftBukkit start - prevent lava putting something on fire.
+ if (world.isEmpty(i, j + 1, k) && this.n(world, i, j, k)) {
+ // CraftBukkit start - prevent lava putting something on fire
org.bukkit.block.Block block = bworld.getBlockAt(i, j + 1, k);
if (block.getTypeId() != Block.FIRE.id) {
if (CraftEventFactory.callEvent(new BlockIgniteEvent(block, igniteCause, null)).isCancelled()) {
@@ -98,7 +98,7 @@ public class BlockStationary extends BlockFluids {
}
}
- private boolean j(World world, int i, int j, int k) {
+ private boolean n(World world, int i, int j, int k) {
return world.getMaterial(i, j, k).isBurnable();
}
}
diff --git a/src/main/java/net/minecraft/server/BlockStem.java b/src/main/java/net/minecraft/server/BlockStem.java
index 513aab6204..d8a2c1d0dd 100644
--- a/src/main/java/net/minecraft/server/BlockStem.java
+++ b/src/main/java/net/minecraft/server/BlockStem.java
@@ -11,20 +11,21 @@ public class BlockStem extends BlockFlower {
protected BlockStem(int i, Block block) {
super(i, 111);
this.blockFruit = block;
- this.a(true);
+ this.b(true);
float f = 0.125F;
this.a(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f);
+ this.a((CreativeModeTab) null);
}
- protected boolean d(int i) {
+ protected boolean d_(int i) {
return i == Block.SOIL.id;
}
- public void a(World world, int i, int j, int k, Random random) {
- super.a(world, i, j, k, random);
+ public void b(World world, int i, int j, int k, Random random) {
+ super.b(world, i, j, k, random);
if (world.getLightLevel(i, j + 1, k) >= 9) {
- float f = this.i(world, i, j, k);
+ float f = this.n(world, i, j, k);
if (random.nextInt((int) (25.0F / f) + 1) == 0) {
int l = world.getData(i, j, k);
@@ -79,11 +80,11 @@ public class BlockStem extends BlockFlower {
}
}
- public void g(World world, int i, int j, int k) {
+ public void l(World world, int i, int j, int k) {
world.setData(i, j, k, 7);
}
- private float i(World world, int i, int j, int k) {
+ private float n(World world, int i, int j, int k) {
float f = 1.0F;
int l = world.getTypeId(i, j, k - 1);
int i1 = world.getTypeId(i, j, k + 1);
@@ -141,7 +142,7 @@ public class BlockStem extends BlockFlower {
this.a(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, (float) this.maxY, 0.5F + f);
}
- public int c() {
+ public int b() {
return 19;
}
@@ -174,10 +175,6 @@ public class BlockStem extends BlockFlower {
}
public int getDropType(int i, Random random, int j) {
- if (i == 7) {
- ;
- }
-
return -1;
}
diff --git a/src/main/java/net/minecraft/server/BlockTNT.java b/src/main/java/net/minecraft/server/BlockTNT.java
index 212b3a175f..df7bb644d6 100644
--- a/src/main/java/net/minecraft/server/BlockTNT.java
+++ b/src/main/java/net/minecraft/server/BlockTNT.java
@@ -6,6 +6,7 @@ public class BlockTNT extends Block {
public BlockTNT(int i, int j) {
super(i, j, Material.TNT);
+ this.a(CreativeModeTab.d);
}
public int a(int i) {
@@ -28,7 +29,7 @@ public class BlockTNT extends Block {
}
public int a(Random random) {
- return 0;
+ return 1;
}
public void wasExploded(World world, int i, int j, int k) {
@@ -42,9 +43,7 @@ public class BlockTNT extends Block {
public void postBreak(World world, int i, int j, int k, int l) {
if (!world.isStatic) {
- if ((l & 1) == 0) {
- this.a(world, i, j, k, new ItemStack(Block.TNT.id, 1, 0));
- } else {
+ if ((l & 1) == 1) {
EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, (double) ((float) i + 0.5F), (double) ((float) j + 0.5F), (double) ((float) k + 0.5F));
world.addEntity(entitytntprimed);
@@ -53,21 +52,17 @@ public class BlockTNT extends Block {
}
}
- public void attack(World world, int i, int j, int k, EntityHuman entityhuman) {
- super.attack(world, i, j, k, entityhuman);
- }
-
- public boolean interact(World world, int i, int j, int k, EntityHuman entityhuman) {
- if (entityhuman.U() != null && entityhuman.U().id == Item.FLINT_AND_STEEL.id) {
+ public boolean interact(World world, int i, int j, int k, EntityHuman entityhuman, int l, float f, float f1, float f2) {
+ if (entityhuman.bC() != null && entityhuman.bC().id == Item.FLINT_AND_STEEL.id) {
this.postBreak(world, i, j, k, 1);
world.setTypeId(i, j, k, 0);
return true;
} else {
- return super.interact(world, i, j, k, entityhuman);
+ return super.interact(world, i, j, k, entityhuman, l, f, f1, f2);
}
}
- protected ItemStack a_(int i) {
+ protected ItemStack c_(int i) {
return null;
}
}
diff --git a/src/main/java/net/minecraft/server/BlockTrapdoor.java b/src/main/java/net/minecraft/server/BlockTrapdoor.java
index 3a27631512..cd735dc7da 100644
--- a/src/main/java/net/minecraft/server/BlockTrapdoor.java
+++ b/src/main/java/net/minecraft/server/BlockTrapdoor.java
@@ -15,21 +15,22 @@ public class BlockTrapdoor extends Block {
float f1 = 1.0F;
this.a(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f1, 0.5F + f);
+ this.a(CreativeModeTab.d);
}
- public boolean a() {
+ public boolean d() {
return false;
}
- public boolean b() {
+ public boolean c() {
return false;
}
- public boolean b(IBlockAccess iblockaccess, int i, int j, int k) {
- return !e(iblockaccess.getData(i, j, k));
+ public boolean c(IBlockAccess iblockaccess, int i, int j, int k) {
+ return !g(iblockaccess.getData(i, j, k));
}
- public int c() {
+ public int b() {
return 0;
}
@@ -39,7 +40,7 @@ public class BlockTrapdoor extends Block {
}
public void updateShape(IBlockAccess iblockaccess, int i, int j, int k) {
- this.d(iblockaccess.getData(i, j, k));
+ this.e(iblockaccess.getData(i, j, k));
}
public void f() {
@@ -48,11 +49,11 @@ public class BlockTrapdoor extends Block {
this.a(0.0F, 0.5F - f / 2.0F, 0.0F, 1.0F, 0.5F + f / 2.0F, 1.0F);
}
- public void d(int i) {
+ public void e(int i) {
float f = 0.1875F;
this.a(0.0F, 0.0F, 0.0F, 1.0F, f, 1.0F);
- if (e(i)) {
+ if (g(i)) {
if ((i & 3) == 0) {
this.a(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
}
@@ -72,16 +73,16 @@ public class BlockTrapdoor extends Block {
}
public void attack(World world, int i, int j, int k, EntityHuman entityhuman) {
- this.interact(world, i, j, k, entityhuman);
+ this.interact(world, i, j, k, entityhuman, 0, 0.0F, 0.0F, 0.0F);
}
- public boolean interact(World world, int i, int j, int k, EntityHuman entityhuman) {
+ public boolean interact(World world, int i, int j, int k, EntityHuman entityhuman, int l, float f, float f1, float f2) {
if (this.material == Material.ORE) {
return true;
} else {
- int l = world.getData(i, j, k);
+ int i1 = world.getData(i, j, k);
- world.setData(i, j, k, l ^ 4);
+ world.setData(i, j, k, i1 ^ 4);
world.a(entityhuman, 1003, i, j, k, 0);
return true;
}
@@ -119,9 +120,9 @@ public class BlockTrapdoor extends Block {
--j1;
}
- if (!h(world.getTypeId(j1, j, k1))) {
+ if (!j(world.getTypeId(j1, j, k1))) {
world.setTypeId(i, j, k, 0);
- this.b(world, i, j, k, i1, 0);
+ this.c(world, i, j, k, i1, 0);
}
// CraftBukkit start
@@ -148,7 +149,7 @@ public class BlockTrapdoor extends Block {
return super.a(world, i, j, k, vec3d, vec3d1);
}
- public void postPlace(World world, int i, int j, int k, int l) {
+ public void postPlace(World world, int i, int j, int k, int l, float f, float f1, float f2) {
byte b0 = 0;
if (l == 2) {
@@ -193,21 +194,21 @@ public class BlockTrapdoor extends Block {
--i;
}
- return h(world.getTypeId(i, j, k));
+ return j(world.getTypeId(i, j, k));
}
}
- public static boolean e(int i) {
+ public static boolean g(int i) {
return (i & 4) != 0;
}
- private static boolean h(int i) {
+ private static boolean j(int i) {
if (i <= 0) {
return false;
} else {
Block block = Block.byId[i];
- return block != null && block.material.j() && block.b() || block == Block.GLOWSTONE;
+ return block != null && block.material.k() && block.c() || block == Block.GLOWSTONE;
}
}
}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 223ed0875f..31cdcd5547 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -1,6 +1,6 @@
package net.minecraft.server;
-// import java.util.ArrayList; // CraftBukkit
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
@@ -11,7 +11,6 @@ import java.util.Random;
// CraftBukkit start
import org.bukkit.Bukkit;
import org.bukkit.Location;
-import org.bukkit.craftbukkit.util.UnsafeList;
// CraftBukkit end
public class Chunk {
@@ -58,7 +57,7 @@ public class Chunk {
this.heightMap = new int[256];
for (int k = 0; k < this.entitySlices.length; ++k) {
- this.entitySlices[k] = new UnsafeList(); // CraftBukkit - use UnsafeList
+ this.entitySlices[k] = new ArrayList();
}
Arrays.fill(this.b, -999);
@@ -104,22 +103,22 @@ public class Chunk {
return this.heightMap[j << 4 | i];
}
- public int g() {
+ public int h() {
for (int i = this.sections.length - 1; i >= 0; --i) {
if (this.sections[i] != null) {
- return this.sections[i].c();
+ return this.sections[i].d();
}
}
return 0;
}
- public ChunkSection[] h() {
+ public ChunkSection[] i() {
return this.sections;
}
public void initLighting() {
- int i = this.g();
+ int i = this.h();
int j;
int k;
@@ -152,7 +151,7 @@ public class Chunk {
if (chunksection != null) {
chunksection.c(j, i1 & 15, k, l);
- this.world.o((this.x << 4) + j, i1, (this.z << 4) + k);
+ this.world.n((this.x << 4) + j, i1, (this.z << 4) + k);
}
}
@@ -175,15 +174,13 @@ public class Chunk {
}
}
- public void loadNOP() {}
-
private void e(int i, int j) {
this.c[i + j * 16] = true;
this.s = true;
}
- private void o() {
- MethodProfiler.a("recheckGaps");
+ private void q() {
+ this.world.methodProfiler.a("recheckGaps");
if (this.world.areChunksLoaded(this.x * 16 + 8, 0, this.z * 16 + 8, 16)) {
for (int i = 0; i < 16; ++i) {
for (int j = 0; j < 16; ++j) {
@@ -221,7 +218,7 @@ public class Chunk {
this.s = false;
}
- MethodProfiler.a();
+ this.world.methodProfiler.b();
}
private void g(int i, int j, int k) {
@@ -237,7 +234,7 @@ public class Chunk {
private void d(int i, int j, int k, int l) {
if (l > k && this.world.areChunksLoaded(i, 0, j, 16)) {
for (int i1 = k; i1 < l; ++i1) {
- this.world.b(EnumSkyBlock.SKY, i, i1, j);
+ this.world.c(EnumSkyBlock.SKY, i, i1, j);
}
this.l = true;
@@ -272,7 +269,7 @@ public class Chunk {
chunksection = this.sections[l1 >> 4];
if (chunksection != null) {
chunksection.c(i, l1 & 15, k, 15);
- this.world.o((this.x << 4) + i, l1, (this.z << 4) + k);
+ this.world.n((this.x << 4) + i, l1, (this.z << 4) + k);
}
}
} else {
@@ -280,7 +277,7 @@ public class Chunk {
chunksection = this.sections[l1 >> 4];
if (chunksection != null) {
chunksection.c(i, l1 & 15, k, 0);
- this.world.o((this.x << 4) + i, l1, (this.z << 4) + k);
+ this.world.n((this.x << 4) + i, l1, (this.z << 4) + k);
}
}
}
@@ -365,8 +362,9 @@ public class Chunk {
int k1 = this.heightMap[j1];
int l1 = this.getTypeId(i, j, k);
+ int i2 = this.getData(i, j, k);
- if (l1 == l && this.getData(i, j, k) == i1) {
+ if (l1 == l && i2 == i1) {
return false;
} else {
ChunkSection chunksection = this.sections[j >> 4];
@@ -381,15 +379,19 @@ public class Chunk {
flag = j >= k1;
}
- chunksection.a(i, j & 15, k, l);
- int i2 = this.x * 16 + i;
- int j2 = this.z * 16 + k;
+ int j2 = this.x * 16 + i;
+ int k2 = this.z * 16 + k;
+ if (l1 != 0 && !this.world.isStatic) {
+ Block.byId[l1].h(this.world, j2, j, k2, i2);
+ }
+
+ chunksection.a(i, j & 15, k, l);
if (l1 != 0) {
if (!this.world.isStatic) {
- Block.byId[l1].remove(this.world, i2, j, j2);
+ Block.byId[l1].remove(this.world, j2, j, k2, l1, i2);
} else if (Block.byId[l1] instanceof BlockContainer && l1 != l) {
- this.world.q(i2, j, j2);
+ this.world.q(j2, j, k2);
}
}
@@ -415,14 +417,14 @@ public class Chunk {
if (l != 0) {
if (!this.world.isStatic) {
- Block.byId[l].onPlace(this.world, i2, j, j2);
+ Block.byId[l].onPlace(this.world, j2, j, k2);
}
if (Block.byId[l] instanceof BlockContainer) {
tileentity = this.e(i, j, k);
if (tileentity == null) {
- tileentity = ((BlockContainer) Block.byId[l]).a_();
- this.world.setTileEntity(i2, j, j2, tileentity);
+ tileentity = ((BlockContainer) Block.byId[l]).a(this.world);
+ this.world.setTileEntity(j2, j, k2, tileentity);
}
if (tileentity != null) {
@@ -474,7 +476,7 @@ public class Chunk {
public int getBrightness(EnumSkyBlock enumskyblock, int i, int j, int k) {
ChunkSection chunksection = this.sections[j >> 4];
- return chunksection == null ? enumskyblock.c : (enumskyblock == EnumSkyBlock.SKY ? chunksection.c(i, j & 15, k) : (enumskyblock == EnumSkyBlock.BLOCK ? chunksection.d(i, j & 15, k) : enumskyblock.c));
+ return chunksection == null ? (this.d(i, j, k) ? enumskyblock.c : 0) : (enumskyblock == EnumSkyBlock.SKY ? chunksection.c(i, j & 15, k) : (enumskyblock == EnumSkyBlock.BLOCK ? chunksection.d(i, j & 15, k) : enumskyblock.c));
}
public void a(EnumSkyBlock enumskyblock, int i, int j, int k, int l) {
@@ -490,11 +492,7 @@ public class Chunk {
if (!this.world.worldProvider.e) {
chunksection.c(i, j & 15, k, l);
}
- } else {
- if (enumskyblock != EnumSkyBlock.BLOCK) {
- return;
- }
-
+ } else if (enumskyblock == EnumSkyBlock.BLOCK) {
chunksection.d(i, j & 15, k, l);
}
}
@@ -545,15 +543,15 @@ public class Chunk {
k = this.entitySlices.length - 1;
}
- entity.bZ = true;
- entity.ca = this.x;
- entity.cb = k;
- entity.cc = this.z;
+ entity.ag = true;
+ entity.ah = this.x;
+ entity.ai = k;
+ entity.aj = this.z;
this.entitySlices[k].add(entity);
}
public void b(Entity entity) {
- this.a(entity, entity.cb);
+ this.a(entity, entity.ai);
}
public void a(Entity entity, int i) {
@@ -579,19 +577,19 @@ public class Chunk {
if (tileentity == null) {
int l = this.getTypeId(i, j, k);
- if (l <= 0 || !Block.byId[l].o()) {
+ if (l <= 0 || !Block.byId[l].s()) {
return null;
}
if (tileentity == null) {
- tileentity = ((BlockContainer) Block.byId[l]).a_();
+ tileentity = ((BlockContainer) Block.byId[l]).a(this.world);
this.world.setTileEntity(this.x * 16 + i, j, this.z * 16 + k, tileentity);
}
tileentity = (TileEntity) this.tileEntities.get(chunkposition);
}
- if (tileentity != null && tileentity.l()) {
+ if (tileentity != null && tileentity.p()) {
this.tileEntities.remove(chunkposition);
return null;
} else {
@@ -613,12 +611,12 @@ public class Chunk {
public void a(int i, int j, int k, TileEntity tileentity) {
ChunkPosition chunkposition = new ChunkPosition(i, j, k);
- tileentity.world = this.world;
+ tileentity.a(this.world);
tileentity.x = this.x * 16 + i;
tileentity.y = j;
tileentity.z = this.z * 16 + k;
if (this.getTypeId(i, j, k) != 0 && Block.byId[this.getTypeId(i, j, k)] instanceof BlockContainer) {
- tileentity.m();
+ tileentity.q();
this.tileEntities.put(chunkposition, tileentity);
// CraftBukkit start
} else {
@@ -645,9 +643,13 @@ public class Chunk {
public void addEntities() {
this.d = true;
this.world.a(this.tileEntities.values());
+ List[] alist = this.entitySlices;
+ int i = alist.length;
- for (int i = 0; i < this.entitySlices.length; ++i) {
- this.world.a(this.entitySlices[i]);
+ for (int j = 0; j < i; ++j) {
+ List list = alist[j];
+
+ this.world.a(list);
}
}
@@ -661,9 +663,12 @@ public class Chunk {
this.world.a(tileentity);
}
- for (int i = 0; i < this.entitySlices.length; ++i) {
+ List[] alist = this.entitySlices;
+ int i = alist.length;
+
+ for (int j = 0; j < i; ++j) {
// CraftBukkit start
- java.util.Iterator