Update to Minecraft 1.7

This commit is contained in:
Dinnerbone 2011-06-29 23:02:25 +01:00
parent a98c7ba2c7
commit a679e7f380
67 changed files with 829 additions and 678 deletions

View File

@ -39,7 +39,7 @@
<dependency> <dependency>
<groupId>org.bukkit</groupId> <groupId>org.bukkit</groupId>
<artifactId>minecraft-server</artifactId> <artifactId>minecraft-server</artifactId>
<version>1.6.6_01</version> <version>1.7</version>
<type>jar</type> <type>jar</type>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>

View File

@ -26,38 +26,38 @@ public class Block {
public static final BlockGrass GRASS = (BlockGrass) (new BlockGrass(2)).c(0.6F).a(g).a("grass"); 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 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 COBBLESTONE = (new Block(4, 16, Material.STONE)).c(2.0F).b(10.0F).a(h).a("stonebrick");
public static final Block WOOD = (new Block(5, 4, Material.WOOD)).c(2.0F).b(5.0F).a(e).a("wood").k(); public static final Block WOOD = (new Block(5, 4, Material.WOOD)).c(2.0F).b(5.0F).a(e).a("wood").g();
public static final Block SAPLING = (new BlockSapling(6, 15)).c(0.0F).a(g).a("sapling").k(); public static final Block SAPLING = (new BlockSapling(6, 15)).c(0.0F).a(g).a("sapling").g();
public static final Block BEDROCK = (new Block(7, 17, Material.STONE)).c(-1.0F).b(6000000.0F).a(h).a("bedrock").j(); public static final Block BEDROCK = (new Block(7, 17, Material.STONE)).i().b(6000000.0F).a(h).a("bedrock").n();
public static final Block WATER = (new BlockFlowing(8, Material.WATER)).c(100.0F).f(3).a("water").j().k(); public static final Block WATER = (new BlockFlowing(8, Material.WATER)).c(100.0F).f(3).a("water").n().g();
public static final Block STATIONARY_WATER = (new BlockStationary(9, Material.WATER)).c(100.0F).f(3).a("water").j().k(); public static final Block STATIONARY_WATER = (new BlockStationary(9, Material.WATER)).c(100.0F).f(3).a("water").n().g();
public static final Block LAVA = (new BlockFlowing(10, Material.LAVA)).c(0.0F).a(1.0F).f(255).a("lava").j().k(); public static final Block LAVA = (new BlockFlowing(10, Material.LAVA)).c(0.0F).a(1.0F).f(255).a("lava").n().g();
public static final Block STATIONARY_LAVA = (new BlockStationary(11, Material.LAVA)).c(100.0F).a(1.0F).f(255).a("lava").j().k(); public static final Block STATIONARY_LAVA = (new BlockStationary(11, Material.LAVA)).c(100.0F).a(1.0F).f(255).a("lava").n().g();
public static final Block SAND = (new BlockSand(12, 18)).c(0.5F).a(l).a("sand"); 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 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 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 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 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").k(); public static final Block LOG = (new BlockLog(17)).c(2.0F).a(e).a("log").g();
public static final BlockLeaves LEAVES = (BlockLeaves) (new BlockLeaves(18, 52)).c(0.2F).f(1).a(g).a("leaves").j().k(); public static final BlockLeaves LEAVES = (BlockLeaves) (new BlockLeaves(18, 52)).c(0.2F).f(1).a(g).a("leaves").n().g();
public static final Block SPONGE = (new BlockSponge(19)).c(0.6F).a(g).a("sponge"); 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 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_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 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").k(); public static final Block DISPENSER = (new BlockDispenser(23)).c(3.5F).a(h).a("dispenser").g();
public static final Block SANDSTONE = (new BlockSandStone(24)).a(h).c(0.8F).a("sandStone"); public static final Block SANDSTONE = (new BlockSandStone(24)).a(h).c(0.8F).a("sandStone");
public static final Block NOTE_BLOCK = (new BlockNote(25)).c(0.8F).a("musicBlock").k(); public static final Block NOTE_BLOCK = (new BlockNote(25)).c(0.8F).a("musicBlock").g();
public static final Block BED = (new BlockBed(26)).c(0.2F).a("bed").j().k(); public static final Block BED = (new BlockBed(26)).c(0.2F).a("bed").n().g();
public static final Block GOLDEN_RAIL = (new BlockMinecartTrack(27, 179, true)).c(0.7F).a(i).a("goldenRail").k(); public static final Block GOLDEN_RAIL = (new BlockMinecartTrack(27, 179, true)).c(0.7F).a(i).a("goldenRail").g();
public static final Block DETECTOR_RAIL = (new BlockMinecartDetector(28, 195)).c(0.7F).a(i).a("detectorRail").k(); public static final Block DETECTOR_RAIL = (new BlockMinecartDetector(28, 195)).c(0.7F).a(i).a("detectorRail").g();
public static final Block W = null; public static final Block PISTON_STICKY = (new BlockPiston(29, 106, true)).a("pistonStickyBase").g();
public static final Block WEB = (new BlockWeb(30, 11)).a("web"); 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 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 BlockDeadBush DEAD_BUSH = (BlockDeadBush) (new BlockDeadBush(32, 55)).c(0.0F).a(g).a("deadbush");
public static final Block aa = null; public static final Block PISTON = (new BlockPiston(33, 107, false)).a("pistonBase").g();
public static final Block ab = null; public static final BlockPistonExtension PISTON_EXTENSION = (BlockPistonExtension) (new BlockPistonExtension(34, 107)).g();
public static final Block WOOL = (new BlockCloth()).c(0.8F).a(k).a("cloth").k(); public static final Block WOOL = (new BlockCloth()).c(0.8F).a(k).a("cloth").g();
public static final Block ad = null; 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 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 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 BROWN_MUSHROOM = (BlockFlower) (new BlockMushroom(39, 29)).c(0.0F).a(g).a(0.125F).a("mushroom");
@ -71,53 +71,53 @@ public class Block {
public static final Block BOOKSHELF = (new BlockBookshelf(47, 35)).c(1.5F).a(e).a("bookshelf"); 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 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(10.0F).b(2000.0F).a(h).a("obsidian"); public static final Block OBSIDIAN = (new BlockObsidian(49, 37)).c(10.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").k(); public static final Block TORCH = (new BlockTorch(50, 80)).c(0.0F).a(0.9375F).a(e).a("torch").g();
public static final BlockFire FIRE = (BlockFire) (new BlockFire(51, 31)).c(0.0F).a(1.0F).a(e).a("fire").j().k(); public static final BlockFire FIRE = (BlockFire) (new BlockFire(51, 31)).c(0.0F).a(1.0F).a(e).a("fire").n().g();
public static final Block MOB_SPAWNER = (new BlockMobSpawner(52, 65)).c(5.0F).a(i).a("mobSpawner").j(); public static final Block MOB_SPAWNER = (new BlockMobSpawner(52, 65)).c(5.0F).a(i).a("mobSpawner").n();
public static final Block WOOD_STAIRS = (new BlockStairs(53, WOOD)).a("stairsWood").k(); public static final Block WOOD_STAIRS = (new BlockStairs(53, WOOD)).a("stairsWood").g();
public static final Block CHEST = (new BlockChest(54)).c(2.5F).a(e).a("chest").k(); public static final Block CHEST = (new BlockChest(54)).c(2.5F).a(e).a("chest").g();
public static final Block REDSTONE_WIRE = (new BlockRedstoneWire(55, 164)).c(0.0F).a(d).a("redstoneDust").j().k(); public static final Block REDSTONE_WIRE = (new BlockRedstoneWire(55, 164)).c(0.0F).a(d).a("redstoneDust").n().g();
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_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 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 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").j().k(); public static final Block CROPS = (new BlockCrops(59, 88)).c(0.0F).a(g).a("crops").n().g();
public static final Block SOIL = (new BlockSoil(60)).c(0.6F).a(f).a("farmland"); public static final Block SOIL = (new BlockSoil(60)).c(0.6F).a(f).a("farmland");
public static final Block FURNACE = (new BlockFurnace(61, false)).c(3.5F).a(h).a("furnace").k(); public static final Block FURNACE = (new BlockFurnace(61, false)).c(3.5F).a(h).a("furnace").g();
public static final Block BURNING_FURNACE = (new BlockFurnace(62, true)).c(3.5F).a(h).a(0.875F).a("furnace").k(); public static final Block BURNING_FURNACE = (new BlockFurnace(62, true)).c(3.5F).a(h).a(0.875F).a("furnace").g();
public static final Block SIGN_POST = (new BlockSign(63, TileEntitySign.class, true)).c(1.0F).a(e).a("sign").j().k(); public static final Block SIGN_POST = (new BlockSign(63, TileEntitySign.class, true)).c(1.0F).a(e).a("sign").n().g();
public static final Block WOODEN_DOOR = (new BlockDoor(64, Material.WOOD)).c(3.0F).a(e).a("doorWood").j().k(); public static final Block WOODEN_DOOR = (new BlockDoor(64, Material.WOOD)).c(3.0F).a(e).a("doorWood").n().g();
public static final Block LADDER = (new BlockLadder(65, 83)).c(0.4F).a(e).a("ladder").k(); public static final Block LADDER = (new BlockLadder(65, 83)).c(0.4F).a(e).a("ladder").g();
public static final Block RAILS = (new BlockMinecartTrack(66, 128, false)).c(0.7F).a(i).a("rail").k(); public static final Block RAILS = (new BlockMinecartTrack(66, 128, false)).c(0.7F).a(i).a("rail").g();
public static final Block COBBLESTONE_STAIRS = (new BlockStairs(67, COBBLESTONE)).a("stairsStone").k(); public static final Block COBBLESTONE_STAIRS = (new BlockStairs(67, COBBLESTONE)).a("stairsStone").g();
public static final Block WALL_SIGN = (new BlockSign(68, TileEntitySign.class, false)).c(1.0F).a(e).a("sign").j().k(); public static final Block WALL_SIGN = (new BlockSign(68, TileEntitySign.class, false)).c(1.0F).a(e).a("sign").n().g();
public static final Block LEVER = (new BlockLever(69, 96)).c(0.5F).a(e).a("lever").k(); public static final Block LEVER = (new BlockLever(69, 96)).c(0.5F).a(e).a("lever").g();
public static final Block STONE_PLATE = (new BlockPressurePlate(70, STONE.textureId, EnumMobType.MOBS, Material.STONE)).c(0.5F).a(h).a("pressurePlate").k(); public static final Block STONE_PLATE = (new BlockPressurePlate(70, STONE.textureId, EnumMobType.MOBS, Material.STONE)).c(0.5F).a(h).a("pressurePlate").g();
public static final Block IRON_DOOR_BLOCK = (new BlockDoor(71, Material.ORE)).c(5.0F).a(i).a("doorIron").j().k(); public static final Block IRON_DOOR_BLOCK = (new BlockDoor(71, Material.ORE)).c(5.0F).a(i).a("doorIron").n().g();
public static final Block WOOD_PLATE = (new BlockPressurePlate(72, WOOD.textureId, EnumMobType.EVERYTHING, Material.WOOD)).c(0.5F).a(e).a("pressurePlate").k(); public static final Block WOOD_PLATE = (new BlockPressurePlate(72, WOOD.textureId, EnumMobType.EVERYTHING, Material.WOOD)).c(0.5F).a(e).a("pressurePlate").g();
public static final Block REDSTONE_ORE = (new BlockRedstoneOre(73, 51, false)).c(3.0F).b(5.0F).a(h).a("oreRedstone").k(); public static final Block REDSTONE_ORE = (new BlockRedstoneOre(73, 51, false)).c(3.0F).b(5.0F).a(h).a("oreRedstone").g();
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").k(); public static final Block GLOWING_REDSTONE_ORE = (new BlockRedstoneOre(74, 51, true)).a(0.625F).c(3.0F).b(5.0F).a(h).a("oreRedstone").g();
public static final Block REDSTONE_TORCH_OFF = (new BlockRedstoneTorch(75, 115, false)).c(0.0F).a(e).a("notGate").k(); public static final Block REDSTONE_TORCH_OFF = (new BlockRedstoneTorch(75, 115, false)).c(0.0F).a(e).a("notGate").g();
public static final Block REDSTONE_TORCH_ON = (new BlockRedstoneTorch(76, 99, true)).c(0.0F).a(0.5F).a(e).a("notGate").k(); public static final Block REDSTONE_TORCH_ON = (new BlockRedstoneTorch(76, 99, true)).c(0.0F).a(0.5F).a(e).a("notGate").g();
public static final Block STONE_BUTTON = (new BlockButton(77, STONE.textureId)).c(0.5F).a(h).a("button").k(); public static final Block STONE_BUTTON = (new BlockButton(77, STONE.textureId)).c(0.5F).a(h).a("button").g();
public static final Block SNOW = (new BlockSnow(78, 66)).c(0.1F).a(k).a("snow"); public static final Block SNOW = (new BlockSnow(78, 66)).c(0.1F).a(k).a("snow");
public static final Block ICE = (new BlockIce(79, 67)).c(0.5F).f(3).a(j).a("ice"); 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 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 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 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").j(); public static final Block SUGAR_CANE_BLOCK = (new BlockReed(83, 73)).c(0.0F).a(g).a("reeds").n();
public static final Block JUKEBOX = (new BlockJukeBox(84, 74)).c(2.0F).b(10.0F).a(h).a("jukebox").k(); public static final Block JUKEBOX = (new BlockJukeBox(84, 74)).c(2.0F).b(10.0F).a(h).a("jukebox").g();
public static final Block FENCE = (new BlockFence(85, 4)).c(2.0F).b(5.0F).a(e).a("fence").k(); public static final Block FENCE = (new BlockFence(85, 4)).c(2.0F).b(5.0F).a(e).a("fence").g();
public static final Block PUMPKIN = (new BlockPumpkin(86, 102, false)).c(1.0F).a(e).a("pumpkin").k(); public static final Block PUMPKIN = (new BlockPumpkin(86, 102, false)).c(1.0F).a(e).a("pumpkin").g();
public static final Block NETHERRACK = (new BlockBloodStone(87, 103)).c(0.4F).a(h).a("hellrock"); 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 SOUL_SAND = (new BlockSlowSand(88, 104)).c(0.5F).a(l).a("hellsand");
public static final Block GLOWSTONE = (new BlockLightStone(89, 105, Material.STONE)).c(0.3F).a(j).a(1.0F).a("lightgem"); public static final Block GLOWSTONE = (new BlockLightStone(89, 105, Material.STONE)).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 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").k(); public static final Block JACK_O_LANTERN = (new BlockPumpkin(91, 102, true)).c(1.0F).a(e).a(1.0F).a("litpumpkin").g();
public static final Block CAKE_BLOCK = (new BlockCake(92, 121)).c(0.5F).a(k).a("cake").j().k(); public static final Block CAKE_BLOCK = (new BlockCake(92, 121)).c(0.5F).a(k).a("cake").n().g();
public static final Block DIODE_OFF = (new BlockDiode(93, false)).c(0.0F).a(e).a("diode").j().k(); public static final Block DIODE_OFF = (new BlockDiode(93, false)).c(0.0F).a(e).a("diode").n().g();
public static final Block DIODE_ON = (new BlockDiode(94, true)).c(0.0F).a(0.625F).a(e).a("diode").j().k(); public static final Block DIODE_ON = (new BlockDiode(94, true)).c(0.0F).a(0.625F).a(e).a("diode").n().g();
public static final Block LOCKED_CHEST = (new BlockLockedChest(95)).c(0.0F).a(1.0F).a(e).a("lockedchest").a(true).k(); public static final Block LOCKED_CHEST = (new BlockLockedChest(95)).c(0.0F).a(1.0F).a(e).a("lockedchest").a(true).g();
public static final Block TRAP_DOOR = (new BlockTrapdoor(96, Material.WOOD)).c(3.0F).a(e).a("trapdoor").j().k(); public static final Block TRAP_DOOR = (new BlockTrapdoor(96, Material.WOOD)).c(3.0F).a(e).a("trapdoor").n().g();
public int textureId; public int textureId;
public final int id; public final int id;
protected float strength; protected float strength;
@ -156,12 +156,12 @@ public class Block {
} }
} }
private Block k() { protected Block g() {
t[this.id] = true; t[this.id] = true;
return this; return this;
} }
protected void f() {} protected void h() {}
protected Block(int i, int j, Material material) { protected Block(int i, int j, Material material) {
this(i, material); this(i, material);
@ -201,6 +201,15 @@ public class Block {
return this; return this;
} }
protected Block i() {
this.c(-1.0F);
return this;
}
public float j() {
return this.strength;
}
protected Block a(boolean flag) { protected Block a(boolean flag) {
n[this.id] = flag; n[this.id] = flag;
return this; return this;
@ -228,14 +237,14 @@ public class Block {
} }
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, ArrayList arraylist) {
AxisAlignedBB axisalignedbb1 = this.d(world, i, j, k); AxisAlignedBB axisalignedbb1 = this.e(world, i, j, k);
if (axisalignedbb1 != null && axisalignedbb.a(axisalignedbb1)) { if (axisalignedbb1 != null && axisalignedbb.a(axisalignedbb1)) {
arraylist.add(axisalignedbb1); arraylist.add(axisalignedbb1);
} }
} }
public AxisAlignedBB d(World world, int i, int j, int k) { 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.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);
} }
@ -244,10 +253,10 @@ public class Block {
} }
public boolean a(int i, boolean flag) { public boolean a(int i, boolean flag) {
return this.m_(); return this.k_();
} }
public boolean m_() { public boolean k_() {
return true; return true;
} }
@ -261,7 +270,7 @@ public class Block {
return 10; return 10;
} }
public void e(World world, int i, int j, int k) {} public void c(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) {}
@ -277,7 +286,7 @@ public class Block {
return this.strength < 0.0F ? 0.0F : (!entityhuman.b(this) ? 1.0F / this.strength / 100.0F : entityhuman.a(this) / this.strength / 30.0F); return this.strength < 0.0F ? 0.0F : (!entityhuman.b(this) ? 1.0F / this.strength / 100.0F : entityhuman.a(this) / this.strength / 30.0F);
} }
public void b_(World world, int i, int j, int k, int l) { public final void g(World world, int i, int j, int k, int l) {
this.dropNaturally(world, i, j, k, l, 1.0F); this.dropNaturally(world, i, j, k, l, 1.0F);
} }
@ -291,21 +300,27 @@ public class Block {
int k1 = this.a(l, world.random); int k1 = this.a(l, world.random);
if (k1 > 0) { if (k1 > 0) {
float f1 = 0.7F; this.a(world, i, j, k, new ItemStack(k1, 1, this.a_(l)));
double d0 = (double) (world.random.nextFloat() * f1) + (double) (1.0F - f1) * 0.5D; }
double d1 = (double) (world.random.nextFloat() * f1) + (double) (1.0F - f1) * 0.5D; }
double d2 = (double) (world.random.nextFloat() * f1) + (double) (1.0F - f1) * 0.5D; }
EntityItem entityitem = new EntityItem(world, (double) i + d0, (double) j + d1, (double) k + d2, new ItemStack(k1, 1, this.b(l))); }
}
protected void a(World world, int i, int j, int k, ItemStack itemstack) {
if (!world.isStatic) {
float f = 0.7F;
double d0 = (double) (world.random.nextFloat() * f) + (double) (1.0F - f) * 0.5D;
double d1 = (double) (world.random.nextFloat() * f) + (double) (1.0F - f) * 0.5D;
double d2 = (double) (world.random.nextFloat() * f) + (double) (1.0F - f) * 0.5D;
EntityItem entityitem = new EntityItem(world, (double) i + d0, (double) j + d1, (double) k + d2, itemstack);
entityitem.pickupDelay = 10; entityitem.pickupDelay = 10;
world.addEntity(entityitem); world.addEntity(entityitem);
} }
} }
}
}
}
protected int b(int i) { protected int a_(int i) {
return 0; return 0;
} }
@ -419,7 +434,7 @@ public class Block {
return vec3d == null ? false : vec3d.a >= this.minX && vec3d.a <= this.maxX && vec3d.b >= this.minY && vec3d.b <= this.maxY; return vec3d == null ? false : vec3d.a >= this.minX && vec3d.a <= this.maxX && vec3d.b >= this.minY && vec3d.b <= this.maxY;
} }
public void c(World world, int i, int j, int k) {} public void d(World world, int i, int j, int k) {}
public boolean canPlace(World world, int i, int j, int k, int l) { public boolean canPlace(World world, int i, int j, int k, int l) {
return this.canPlace(world, i, j, k); return this.canPlace(world, i, j, k);
@ -455,13 +470,13 @@ public class Block {
public void a(World world, int i, int j, int k, Entity entity) {} public void a(World world, int i, int j, int k, Entity entity) {}
public boolean c(World world, int i, int j, int k, int l) { public boolean d(World world, int i, int j, int k, int l) {
return false; return false;
} }
public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) { public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
entityhuman.a(StatisticList.C[this.id], 1); entityhuman.a(StatisticList.C[this.id], 1);
this.b_(world, i, j, k, l); this.g(world, i, j, k, l);
} }
public boolean f(World world, int i, int j, int k) { public boolean f(World world, int i, int j, int k) {
@ -475,35 +490,42 @@ public class Block {
return this; return this;
} }
public String g() { public String k() {
return StatisticCollector.a(this.h() + ".name"); return StatisticCollector.a(this.l() + ".name");
} }
public String h() { public String l() {
return this.name; return this.name;
} }
public void a(World world, int i, int j, int k, int l, int i1) {} public void a(World world, int i, int j, int k, int l, int i1) {}
public boolean i() { public boolean m() {
return this.br; return this.br;
} }
protected Block j() { protected Block n() {
this.br = false; this.br = false;
return this; return this;
} }
public int f() {
return this.material.j();
}
static { static {
Item.byId[WOOL.id] = (new ItemCloth(WOOL.id - 256)).a("cloth"); Item.byId[WOOL.id] = (new ItemCloth(WOOL.id - 256)).a("cloth");
Item.byId[LOG.id] = (new ItemLog(LOG.id - 256)).a("log"); Item.byId[LOG.id] = (new ItemLog(LOG.id - 256)).a("log");
Item.byId[STEP.id] = (new ItemStep(STEP.id - 256)).a("stoneSlab"); Item.byId[STEP.id] = (new ItemStep(STEP.id - 256)).a("stoneSlab");
Item.byId[SAPLING.id] = (new ItemSapling(SAPLING.id - 256)).a("sapling"); Item.byId[SAPLING.id] = (new ItemSapling(SAPLING.id - 256)).a("sapling");
Item.byId[LEAVES.id] = (new ItemLeaves(LEAVES.id - 256)).a("leaves");
Item.byId[PISTON.id] = new ItemPiston(PISTON.id - 256);
Item.byId[PISTON_STICKY.id] = new ItemPiston(PISTON_STICKY.id - 256);
for (int i = 0; i < 256; ++i) { for (int i = 0; i < 256; ++i) {
if (byId[i] != null && Item.byId[i] == null) { if (byId[i] != null && Item.byId[i] == null) {
Item.byId[i] = new ItemBlock(i - 256); Item.byId[i] = new ItemBlock(i - 256);
byId[i].f(); byId[i].h();
} }
} }

View File

@ -11,7 +11,7 @@ public class BlockButton extends Block {
this.a(true); this.a(true);
} }
public AxisAlignedBB d(World world, int i, int j, int k) { public AxisAlignedBB e(World world, int i, int j, int k) {
return null; return null;
} }
@ -28,11 +28,11 @@ public class BlockButton extends Block {
} }
public boolean canPlace(World world, int i, int j, int k, int l) { public boolean canPlace(World world, int i, int j, int k, int l) {
return l == 2 && world.d(i, j, k + 1) ? true : (l == 3 && world.d(i, j, k - 1) ? true : (l == 4 && world.d(i + 1, j, k) ? true : l == 5 && world.d(i - 1, j, k))); 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)));
} }
public boolean canPlace(World world, int i, int j, int k) { public boolean canPlace(World world, int i, int j, int k) {
return world.d(i - 1, j, k) ? true : (world.d(i + 1, j, k) ? true : (world.d(i, j, k - 1) ? true : world.d(i, j, k + 1))); 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)));
} }
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) {
@ -40,13 +40,13 @@ public class BlockButton extends Block {
int j1 = i1 & 8; int j1 = i1 & 8;
i1 &= 7; i1 &= 7;
if (l == 2 && world.d(i, j, k + 1)) { if (l == 2 && world.e(i, j, k + 1)) {
i1 = 4; i1 = 4;
} else if (l == 3 && world.d(i, j, k - 1)) { } else if (l == 3 && world.e(i, j, k - 1)) {
i1 = 3; i1 = 3;
} else if (l == 4 && world.d(i + 1, j, k)) { } else if (l == 4 && world.e(i + 1, j, k)) {
i1 = 2; i1 = 2;
} else if (l == 5 && world.d(i - 1, j, k)) { } else if (l == 5 && world.e(i - 1, j, k)) {
i1 = 1; i1 = 1;
} else { } else {
i1 = this.g(world, i, j, k); i1 = this.g(world, i, j, k);
@ -56,7 +56,7 @@ public class BlockButton extends Block {
} }
private int g(World world, int i, int j, int k) { private int g(World world, int i, int j, int k) {
return world.d(i - 1, j, k) ? 1 : (world.d(i + 1, j, k) ? 2 : (world.d(i, j, k - 1) ? 3 : (world.d(i, j, k + 1) ? 4 : 1))); 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)));
} }
public void doPhysics(World world, int i, int j, int k, int l) { public void doPhysics(World world, int i, int j, int k, int l) {
@ -64,24 +64,24 @@ public class BlockButton extends Block {
int i1 = world.getData(i, j, k) & 7; int i1 = world.getData(i, j, k) & 7;
boolean flag = false; boolean flag = false;
if (!world.d(i - 1, j, k) && i1 == 1) { if (!world.e(i - 1, j, k) && i1 == 1) {
flag = true; flag = true;
} }
if (!world.d(i + 1, j, k) && i1 == 2) { if (!world.e(i + 1, j, k) && i1 == 2) {
flag = true; flag = true;
} }
if (!world.d(i, j, k - 1) && i1 == 3) { if (!world.e(i, j, k - 1) && i1 == 3) {
flag = true; flag = true;
} }
if (!world.d(i, j, k + 1) && i1 == 4) { if (!world.e(i, j, k + 1) && i1 == 4) {
flag = true; flag = true;
} }
if (flag) { if (flag) {
this.b_(world, i, j, k, world.getData(i, j, k)); this.g(world, i, j, k, world.getData(i, j, k));
world.setTypeId(i, j, k, 0); world.setTypeId(i, j, k, 0);
} }
} }
@ -89,7 +89,7 @@ public class BlockButton extends Block {
private boolean h(World world, int i, int j, int k) { private boolean h(World world, int i, int j, int k) {
if (!this.canPlace(world, i, j, k)) { if (!this.canPlace(world, i, j, k)) {
this.b_(world, i, j, k, world.getData(i, j, k)); this.g(world, i, j, k, world.getData(i, j, k));
world.setTypeId(i, j, k, 0); world.setTypeId(i, j, k, 0);
return false; return false;
} else { } else {
@ -194,7 +194,7 @@ public class BlockButton extends Block {
return (iblockaccess.getData(i, j, k) & 8) > 0; return (iblockaccess.getData(i, j, k) & 8) > 0;
} }
public boolean c(World world, int i, int j, int k, int l) { public boolean d(World world, int i, int j, int k, int l) {
int i1 = world.getData(i, j, k); int i1 = world.getData(i, j, k);
if ((i1 & 8) == 0) { if ((i1 & 8) == 0) {

View File

@ -35,7 +35,7 @@ public class BlockCactus extends Block {
} }
} }
public AxisAlignedBB d(World world, int i, int j, int k) { public AxisAlignedBB e(World world, int i, int j, int k) {
float f = 0.0625F; 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.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));
@ -59,7 +59,7 @@ public class BlockCactus extends Block {
public void doPhysics(World world, int i, int j, int k, int l) { public void doPhysics(World world, int i, int j, int k, int l) {
if (!this.f(world, i, j, k)) { if (!this.f(world, i, j, k)) {
this.b_(world, i, j, k, world.getData(i, j, k)); this.g(world, i, j, k, world.getData(i, j, k));
world.setTypeId(i, j, k, 0); world.setTypeId(i, j, k, 0);
} }
} }

View File

@ -25,8 +25,8 @@ public class BlockDispenser extends BlockContainer {
return Block.DISPENSER.id; return Block.DISPENSER.id;
} }
public void e(World world, int i, int j, int k) { public void c(World world, int i, int j, int k) {
super.e(world, i, j, k); super.c(world, i, j, k);
this.g(world, i, j, k); this.g(world, i, j, k);
} }

View File

@ -50,9 +50,9 @@ public class BlockDoor extends Block {
return false; return false;
} }
public AxisAlignedBB d(World world, int i, int j, int k) { public AxisAlignedBB e(World world, int i, int j, int k) {
this.a(world, i, j, k); this.a(world, i, j, k);
return super.d(world, i, j, k); return super.e(world, i, j, k);
} }
public void a(IBlockAccess iblockaccess, int i, int j, int k) { public void a(IBlockAccess iblockaccess, int i, int j, int k) {
@ -150,7 +150,7 @@ public class BlockDoor extends Block {
flag = true; flag = true;
} }
if (!world.d(i, j - 1, k)) { if (!world.e(i, j - 1, k)) {
world.setTypeId(i, j, k, 0); world.setTypeId(i, j, k, 0);
flag = true; flag = true;
if (world.getTypeId(i, j + 1, k) == this.id) { if (world.getTypeId(i, j + 1, k) == this.id) {
@ -160,7 +160,7 @@ public class BlockDoor extends Block {
if (flag) { if (flag) {
if (!world.isStatic) { if (!world.isStatic) {
this.b_(world, i, j, k, i1); this.g(world, i, j, k, i1);
} }
} else if (l > 0 && Block.byId[l].isPowerSource()) { } else if (l > 0 && Block.byId[l].isPowerSource()) {
boolean flag1 = world.isBlockIndirectlyPowered(i, j, k) || world.isBlockIndirectlyPowered(i, j + 1, k); boolean flag1 = world.isBlockIndirectlyPowered(i, j, k) || world.isBlockIndirectlyPowered(i, j + 1, k);
@ -199,7 +199,7 @@ public class BlockDoor extends Block {
} }
public boolean canPlace(World world, int i, int j, int k) { public boolean canPlace(World world, int i, int j, int k) {
return j >= 127 ? false : world.d(i, j - 1, k) && super.canPlace(world, i, j, k) && super.canPlace(world, i, j + 1, k); return j >= 127 ? false : world.e(i, j - 1, k) && super.canPlace(world, i, j, k) && super.canPlace(world, i, j + 1, k);
} }
public static boolean e(int i) { public static boolean e(int i) {

View File

@ -18,7 +18,7 @@ public class BlockFire extends Block {
this.a(true); this.a(true);
} }
public void f() { public void h() {
this.a(Block.WOOD.id, 5, 20); this.a(Block.WOOD.id, 5, 20);
this.a(Block.FENCE.id, 5, 20); this.a(Block.FENCE.id, 5, 20);
this.a(Block.WOOD_STAIRS.id, 5, 20); this.a(Block.WOOD_STAIRS.id, 5, 20);
@ -35,7 +35,7 @@ public class BlockFire extends Block {
this.b[i] = k; this.b[i] = k;
} }
public AxisAlignedBB d(World world, int i, int j, int k) { public AxisAlignedBB e(World world, int i, int j, int k) {
return null; return null;
} }
@ -73,7 +73,7 @@ public class BlockFire extends Block {
world.c(i, j, k, this.id, this.c()); world.c(i, j, k, this.id, this.c());
if (!flag && !this.g(world, i, j, k)) { if (!flag && !this.g(world, i, j, k)) {
if (!world.d(i, j - 1, k) || l > 3) { if (!world.e(i, j - 1, k) || l > 3) {
world.setTypeId(i, j, k, 0); world.setTypeId(i, j, k, 0);
} }
} else if (!flag && !this.b(world, i, j - 1, k) && l == 15 && random.nextInt(4) == 0) { } else if (!flag && !this.b(world, i, j - 1, k) && l == 15 && random.nextInt(4) == 0) {
@ -167,7 +167,7 @@ public class BlockFire extends Block {
} }
if (flag) { if (flag) {
Block.TNT.postBreak(world, i, j, k, 0); Block.TNT.postBreak(world, i, j, k, 1);
} }
} }
} }
@ -182,18 +182,18 @@ public class BlockFire extends Block {
if (!world.isEmpty(i, j, k)) { if (!world.isEmpty(i, j, k)) {
return 0; return 0;
} else { } else {
int l = this.g(world, i + 1, j, k, b0); int l = this.f(world, i + 1, j, k, b0);
l = this.g(world, i - 1, j, k, l); l = this.f(world, i - 1, j, k, l);
l = this.g(world, i, j - 1, k, l); l = this.f(world, i, j - 1, k, l);
l = this.g(world, i, j + 1, k, l); l = this.f(world, i, j + 1, k, l);
l = this.g(world, i, j, k - 1, l); l = this.f(world, i, j, k - 1, l);
l = this.g(world, i, j, k + 1, l); l = this.f(world, i, j, k + 1, l);
return l; return l;
} }
} }
public boolean m_() { public boolean k_() {
return false; return false;
} }
@ -201,25 +201,25 @@ public class BlockFire extends Block {
return this.a[iblockaccess.getTypeId(i, j, k)] > 0; return this.a[iblockaccess.getTypeId(i, j, k)] > 0;
} }
public int g(World world, int i, int j, int k, int l) { public int f(World world, int i, int j, int k, int l) {
int i1 = this.a[world.getTypeId(i, j, k)]; int i1 = this.a[world.getTypeId(i, j, k)];
return i1 > l ? i1 : l; return i1 > l ? i1 : l;
} }
public boolean canPlace(World world, int i, int j, int k) { public boolean canPlace(World world, int i, int j, int k) {
return world.d(i, j - 1, k) || this.g(world, i, j, k); return world.e(i, j - 1, k) || this.g(world, i, j, k);
} }
public void doPhysics(World world, int i, int j, int k, int l) { public void doPhysics(World world, int i, int j, int k, int l) {
if (!world.d(i, j - 1, k) && !this.g(world, i, j, k)) { if (!world.e(i, j - 1, k) && !this.g(world, i, j, k)) {
world.setTypeId(i, j, k, 0); world.setTypeId(i, j, k, 0);
} }
} }
public void e(World world, int i, int j, int k) { public void c(World world, int i, int j, int k) {
if (world.getTypeId(i, j - 1, k) != Block.OBSIDIAN.id || !Block.PORTAL.a_(world, i, j, k)) { if (world.getTypeId(i, j - 1, k) != Block.OBSIDIAN.id || !Block.PORTAL.a_(world, i, j, k)) {
if (!world.d(i, j - 1, k) && !this.g(world, i, j, k)) { if (!world.e(i, j - 1, k) && !this.g(world, i, j, k)) {
world.setTypeId(i, j, k, 0); world.setTypeId(i, j, k, 0);
} else { } else {
world.c(i, j, k, this.id, this.c()); world.c(i, j, k, this.id, this.c());

View File

@ -152,7 +152,7 @@ public class BlockFlowing extends BlockFluids {
if (this.material == Material.LAVA) { if (this.material == Material.LAVA) {
this.h(world, i, j, k); this.h(world, i, j, k);
} else { } else {
Block.byId[i1].b_(world, i, j, k, world.getData(i, j, k)); Block.byId[i1].g(world, i, j, k, world.getData(i, j, k));
} }
} }
@ -292,8 +292,8 @@ public class BlockFlowing extends BlockFluids {
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.k(world, i, j, k));
} }
public void e(World world, int i, int j, int k) { public void c(World world, int i, int j, int k) {
super.e(world, i, j, k); super.c(world, i, j, k);
if (world.getTypeId(i, j, k) == this.id) { if (world.getTypeId(i, j, k) == this.id) {
world.c(i, j, k, this.id, this.c()); world.c(i, j, k, this.id, this.c());
} }

View File

@ -38,7 +38,7 @@ public class BlockIce extends BlockBreakable {
} }
// CraftBukkit end // CraftBukkit end
this.b_(world, i, j, k, world.getData(i, j, k)); this.g(world, i, j, k, world.getData(i, j, k));
world.setTypeId(i, j, k, Block.STATIONARY_WATER.id); world.setTypeId(i, j, k, Block.STATIONARY_WATER.id);
} }
} }

View File

@ -126,7 +126,7 @@ public class BlockLeaves extends BlockLeavesBase {
if (event.isCancelled()) return; if (event.isCancelled()) return;
// CraftBukkit end // CraftBukkit end
this.b_(world, i, j, k, world.getData(i, j, k)); this.g(world, i, j, k, world.getData(i, j, k));
world.setTypeId(i, j, k, 0); world.setTypeId(i, j, k, 0);
} }
@ -138,7 +138,16 @@ public class BlockLeaves extends BlockLeavesBase {
return Block.SAPLING.id; return Block.SAPLING.id;
} }
protected int b(int i) { public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
if (!world.isStatic && entityhuman.G() != null && entityhuman.G().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 {
super.a(world, entityhuman, i, j, k, l);
}
}
protected int a_(int i) {
return i & 3; return i & 3;
} }

View File

@ -8,7 +8,7 @@ public class BlockLever extends Block {
super(i, j, Material.ORIENTABLE); super(i, j, Material.ORIENTABLE);
} }
public AxisAlignedBB d(World world, int i, int j, int k) { public AxisAlignedBB e(World world, int i, int j, int k) {
return null; return null;
} }
@ -21,11 +21,11 @@ public class BlockLever extends Block {
} }
public boolean canPlace(World world, int i, int j, int k, int l) { public boolean canPlace(World world, int i, int j, int k, int l) {
return l == 1 && world.d(i, j - 1, k) ? true : (l == 2 && world.d(i, j, k + 1) ? true : (l == 3 && world.d(i, j, k - 1) ? true : (l == 4 && world.d(i + 1, j, k) ? true : l == 5 && world.d(i - 1, j, k)))); 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))));
} }
public boolean canPlace(World world, int i, int j, int k) { public boolean canPlace(World world, int i, int j, int k) {
return world.d(i - 1, j, k) ? true : (world.d(i + 1, j, k) ? true : (world.d(i, j, k - 1) ? true : (world.d(i, j, k + 1) ? true : world.d(i, j - 1, 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))));
} }
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) {
@ -34,28 +34,28 @@ public class BlockLever extends Block {
i1 &= 7; i1 &= 7;
i1 = -1; i1 = -1;
if (l == 1 && world.d(i, j - 1, k)) { if (l == 1 && world.e(i, j - 1, k)) {
i1 = 5 + world.random.nextInt(2); i1 = 5 + world.random.nextInt(2);
} }
if (l == 2 && world.d(i, j, k + 1)) { if (l == 2 && world.e(i, j, k + 1)) {
i1 = 4; i1 = 4;
} }
if (l == 3 && world.d(i, j, k - 1)) { if (l == 3 && world.e(i, j, k - 1)) {
i1 = 3; i1 = 3;
} }
if (l == 4 && world.d(i + 1, j, k)) { if (l == 4 && world.e(i + 1, j, k)) {
i1 = 2; i1 = 2;
} }
if (l == 5 && world.d(i - 1, j, k)) { if (l == 5 && world.e(i - 1, j, k)) {
i1 = 1; i1 = 1;
} }
if (i1 == -1) { if (i1 == -1) {
this.b_(world, i, j, k, world.getData(i, j, k)); this.g(world, i, j, k, world.getData(i, j, k));
world.setTypeId(i, j, k, 0); world.setTypeId(i, j, k, 0);
} else { } else {
world.setData(i, j, k, i1 + j1); world.setData(i, j, k, i1 + j1);
@ -67,32 +67,32 @@ public class BlockLever extends Block {
int i1 = world.getData(i, j, k) & 7; int i1 = world.getData(i, j, k) & 7;
boolean flag = false; boolean flag = false;
if (!world.d(i - 1, j, k) && i1 == 1) { if (!world.e(i - 1, j, k) && i1 == 1) {
flag = true; flag = true;
} }
if (!world.d(i + 1, j, k) && i1 == 2) { if (!world.e(i + 1, j, k) && i1 == 2) {
flag = true; flag = true;
} }
if (!world.d(i, j, k - 1) && i1 == 3) { if (!world.e(i, j, k - 1) && i1 == 3) {
flag = true; flag = true;
} }
if (!world.d(i, j, k + 1) && i1 == 4) { if (!world.e(i, j, k + 1) && i1 == 4) {
flag = true; flag = true;
} }
if (!world.d(i, j - 1, k) && i1 == 5) { if (!world.e(i, j - 1, k) && i1 == 5) {
flag = true; flag = true;
} }
if (!world.d(i, j - 1, k) && i1 == 6) { if (!world.e(i, j - 1, k) && i1 == 6) {
flag = true; flag = true;
} }
if (flag) { if (flag) {
this.b_(world, i, j, k, world.getData(i, j, k)); this.g(world, i, j, k, world.getData(i, j, k));
world.setTypeId(i, j, k, 0); world.setTypeId(i, j, k, 0);
} }
} }
@ -100,7 +100,7 @@ public class BlockLever extends Block {
private boolean g(World world, int i, int j, int k) { private boolean g(World world, int i, int j, int k) {
if (!this.canPlace(world, i, j, k)) { if (!this.canPlace(world, i, j, k)) {
this.b_(world, i, j, k, world.getData(i, j, k)); this.g(world, i, j, k, world.getData(i, j, k));
world.setTypeId(i, j, k, 0); world.setTypeId(i, j, k, 0);
return false; return false;
} else { } else {
@ -198,7 +198,7 @@ public class BlockLever extends Block {
return (iblockaccess.getData(i, j, k) & 8) > 0; return (iblockaccess.getData(i, j, k) & 8) > 0;
} }
public boolean c(World world, int i, int j, int k, int l) { public boolean d(World world, int i, int j, int k, int l) {
int i1 = world.getData(i, j, k); int i1 = world.getData(i, j, k);
if ((i1 & 8) == 0) { if ((i1 & 8) == 0) {

View File

@ -25,7 +25,7 @@ public class BlockMinecartDetector extends BlockMinecartTrack {
int l = world.getData(i, j, k); int l = world.getData(i, j, k);
if ((l & 8) == 0) { if ((l & 8) == 0) {
this.g(world, i, j, k, l); this.f(world, i, j, k, l);
} }
} }
} }
@ -35,7 +35,7 @@ public class BlockMinecartDetector extends BlockMinecartTrack {
int l = world.getData(i, j, k); int l = world.getData(i, j, k);
if ((l & 8) != 0) { if ((l & 8) != 0) {
this.g(world, i, j, k, l); this.f(world, i, j, k, l);
} }
} }
} }
@ -44,11 +44,11 @@ public class BlockMinecartDetector extends BlockMinecartTrack {
return (iblockaccess.getData(i, j, k) & 8) != 0; return (iblockaccess.getData(i, j, k) & 8) != 0;
} }
public boolean c(World world, int i, int j, int k, int l) { public boolean d(World world, int i, int j, int k, int l) {
return (world.getData(i, j, k) & 8) == 0 ? false : l == 1; return (world.getData(i, j, k) & 8) == 0 ? false : l == 1;
} }
private void g(World world, int i, int j, int k, int l) { private void f(World world, int i, int j, int k, int l) {
boolean flag = (l & 8) != 0; boolean flag = (l & 8) != 0;
boolean flag1 = false; boolean flag1 = false;
float f = 0.125F; float f = 0.125F;

View File

@ -47,6 +47,6 @@ public class BlockMushroom extends BlockFlower {
} }
public boolean f(World world, int i, int j, int k) { public boolean f(World world, int i, int j, int k) {
return j >= 0 && j < 128 ? world.j(i, j, k) < 13 && this.c(world.getTypeId(i, j - 1, k)) : false; return j >= 0 && j < 128 ? world.k(i, j, k) < 13 && this.c(world.getTypeId(i, j - 1, k)) : false;
} }
} }

View File

@ -13,7 +13,7 @@ public class BlockPortal extends BlockBreakable {
super(i, j, Material.PORTAL, false); super(i, j, Material.PORTAL, false);
} }
public AxisAlignedBB d(World world, int i, int j, int k) { public AxisAlignedBB e(World world, int i, int j, int k) {
return null; return null;
} }
@ -166,7 +166,7 @@ public class BlockPortal extends BlockBreakable {
world.getServer().getPluginManager().callEvent(event); world.getServer().getPluginManager().callEvent(event);
// CraftBukkit end // CraftBukkit end
entity.O(); entity.P();
} }
} }
} }

View File

@ -26,7 +26,7 @@ public class BlockPressurePlate extends Block {
return 20; return 20;
} }
public AxisAlignedBB d(World world, int i, int j, int k) { public AxisAlignedBB e(World world, int i, int j, int k) {
return null; return null;
} }
@ -39,20 +39,20 @@ public class BlockPressurePlate extends Block {
} }
public boolean canPlace(World world, int i, int j, int k) { public boolean canPlace(World world, int i, int j, int k) {
return world.d(i, j - 1, k); return world.e(i, j - 1, k);
} }
public void e(World world, int i, int j, int k) {} public void c(World world, int i, int j, int k) {}
public void doPhysics(World world, int i, int j, int k, int l) { public void doPhysics(World world, int i, int j, int k, int l) {
boolean flag = false; boolean flag = false;
if (!world.d(i, j - 1, k)) { if (!world.e(i, j - 1, k)) {
flag = true; flag = true;
} }
if (flag) { if (flag) {
this.b_(world, i, j, k, world.getData(i, j, k)); this.g(world, i, j, k, world.getData(i, j, k));
world.setTypeId(i, j, k, 0); world.setTypeId(i, j, k, 0);
} }
} }
@ -174,7 +174,7 @@ public class BlockPressurePlate extends Block {
return iblockaccess.getData(i, j, k) > 0; return iblockaccess.getData(i, j, k) > 0;
} }
public boolean c(World world, int i, int j, int k, int l) { public boolean d(World world, int i, int j, int k, int l) {
return world.getData(i, j, k) == 0 ? false : l == 1; return world.getData(i, j, k) == 0 ? false : l == 1;
} }

View File

@ -33,14 +33,14 @@ public class BlockPumpkin extends Block {
return i == 1 ? this.textureId : (i == 0 ? this.textureId : (i == 3 ? this.textureId + 1 + 16 : this.textureId + 16)); return i == 1 ? this.textureId : (i == 0 ? this.textureId : (i == 3 ? this.textureId + 1 + 16 : this.textureId + 16));
} }
public void e(World world, int i, int j, int k) { public void c(World world, int i, int j, int k) {
super.e(world, i, j, k); super.c(world, i, j, k);
} }
public boolean canPlace(World world, int i, int j, int k) { public boolean canPlace(World world, int i, int j, int k) {
int l = world.getTypeId(i, j, k); int l = world.getTypeId(i, j, k);
return (l == 0 || Block.byId[l].material.isReplacable()) && world.d(i, j - 1, k); return (l == 0 || Block.byId[l].material.isReplacable()) && world.e(i, j - 1, k);
} }
public void postPlace(World world, int i, int j, int k, EntityLiving entityliving) { public void postPlace(World world, int i, int j, int k, EntityLiving entityliving) {

View File

@ -46,9 +46,9 @@ public class BlockRedstoneTorch extends BlockTorch {
return 2; return 2;
} }
public void e(World world, int i, int j, int k) { public void c(World world, int i, int j, int k) {
if (world.getData(i, j, k) == 0) { if (world.getData(i, j, k) == 0) {
super.e(world, i, j, k); super.c(world, i, j, k);
} }
if (this.isOn) { if (this.isOn) {
@ -148,7 +148,7 @@ public class BlockRedstoneTorch extends BlockTorch {
world.c(i, j, k, this.id, this.c()); world.c(i, j, k, this.id, this.c());
} }
public boolean c(World world, int i, int j, int k, int l) { public boolean d(World world, int i, int j, int k, int l) {
return l == 0 ? this.a(world, i, j, k, l) : false; return l == 0 ? this.a(world, i, j, k, l) : false;
} }

View File

@ -21,7 +21,7 @@ public class BlockRedstoneWire extends Block {
return this.textureId; return this.textureId;
} }
public AxisAlignedBB d(World world, int i, int j, int k) { public AxisAlignedBB e(World world, int i, int j, int k) {
return null; return null;
} }
@ -34,7 +34,7 @@ public class BlockRedstoneWire extends Block {
} }
public boolean canPlace(World world, int i, int j, int k) { public boolean canPlace(World world, int i, int j, int k) {
return world.d(i, j - 1, k); return world.e(i, j - 1, k);
} }
private void g(World world, int i, int j, int k) { private void g(World world, int i, int j, int k) {
@ -88,11 +88,11 @@ public class BlockRedstoneWire extends Block {
l1 = this.getPower(world, j2, j, k2, l1); l1 = this.getPower(world, j2, j, k2, l1);
} }
if (world.d(j2, j, k2) && !world.d(i, j + 1, k)) { if (world.e(j2, j, k2) && !world.e(i, j + 1, k)) {
if (j2 != l || j + 1 != i1 || k2 != j1) { if (j2 != l || j + 1 != i1 || k2 != j1) {
l1 = this.getPower(world, j2, j + 1, k2, l1); l1 = this.getPower(world, j2, j + 1, k2, l1);
} }
} else if (!world.d(j2, j, k2) && (j2 != l || j - 1 != i1 || k2 != j1)) { } else if (!world.e(j2, j, k2) && (j2 != l || j - 1 != i1 || k2 != j1)) {
l1 = this.getPower(world, j2, j - 1, k2, l1); l1 = this.getPower(world, j2, j - 1, k2, l1);
} }
} }
@ -140,7 +140,7 @@ public class BlockRedstoneWire extends Block {
++k2; ++k2;
} }
if (world.d(j2, j, k2)) { if (world.e(j2, j, k2)) {
l2 += 2; l2 += 2;
} }
@ -191,8 +191,8 @@ public class BlockRedstoneWire extends Block {
} }
} }
public void e(World world, int i, int j, int k) { public void c(World world, int i, int j, int k) {
super.e(world, i, j, k); super.c(world, i, j, k);
if (!world.isStatic) { if (!world.isStatic) {
this.g(world, i, j, k); this.g(world, i, j, k);
world.applyPhysics(i, j + 1, k, this.id); world.applyPhysics(i, j + 1, k, this.id);
@ -201,25 +201,25 @@ public class BlockRedstoneWire extends Block {
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);
this.h(world, i, j, k + 1); this.h(world, i, j, k + 1);
if (world.d(i - 1, j, k)) { if (world.e(i - 1, j, k)) {
this.h(world, i - 1, j + 1, k); this.h(world, i - 1, j + 1, k);
} else { } else {
this.h(world, i - 1, j - 1, k); this.h(world, i - 1, j - 1, k);
} }
if (world.d(i + 1, j, k)) { if (world.e(i + 1, j, k)) {
this.h(world, i + 1, j + 1, k); this.h(world, i + 1, j + 1, k);
} else { } else {
this.h(world, i + 1, j - 1, k); this.h(world, i + 1, j - 1, k);
} }
if (world.d(i, j, k - 1)) { if (world.e(i, j, k - 1)) {
this.h(world, i, j + 1, k - 1); this.h(world, i, j + 1, k - 1);
} else { } else {
this.h(world, i, j - 1, k - 1); this.h(world, i, j - 1, k - 1);
} }
if (world.d(i, j, k + 1)) { if (world.e(i, j, k + 1)) {
this.h(world, i, j + 1, k + 1); this.h(world, i, j + 1, k + 1);
} else { } else {
this.h(world, i, j - 1, k + 1); this.h(world, i, j - 1, k + 1);
@ -237,25 +237,25 @@ public class BlockRedstoneWire extends Block {
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);
this.h(world, i, j, k + 1); this.h(world, i, j, k + 1);
if (world.d(i - 1, j, k)) { if (world.e(i - 1, j, k)) {
this.h(world, i - 1, j + 1, k); this.h(world, i - 1, j + 1, k);
} else { } else {
this.h(world, i - 1, j - 1, k); this.h(world, i - 1, j - 1, k);
} }
if (world.d(i + 1, j, k)) { if (world.e(i + 1, j, k)) {
this.h(world, i + 1, j + 1, k); this.h(world, i + 1, j + 1, k);
} else { } else {
this.h(world, i + 1, j - 1, k); this.h(world, i + 1, j - 1, k);
} }
if (world.d(i, j, k - 1)) { if (world.e(i, j, k - 1)) {
this.h(world, i, j + 1, k - 1); this.h(world, i, j + 1, k - 1);
} else { } else {
this.h(world, i, j - 1, k - 1); this.h(world, i, j - 1, k - 1);
} }
if (world.d(i, j, k + 1)) { if (world.e(i, j, k + 1)) {
this.h(world, i, j + 1, k + 1); this.h(world, i, j + 1, k + 1);
} else { } else {
this.h(world, i, j - 1, k + 1); this.h(world, i, j - 1, k + 1);
@ -280,7 +280,7 @@ public class BlockRedstoneWire extends Block {
boolean flag = this.canPlace(world, i, j, k); boolean flag = this.canPlace(world, i, j, k);
if (!flag) { if (!flag) {
this.b_(world, i, j, k, i1); this.g(world, i, j, k, i1);
world.setTypeId(i, j, k, 0); world.setTypeId(i, j, k, 0);
} else { } else {
this.g(world, i, j, k); this.g(world, i, j, k);
@ -294,7 +294,7 @@ public class BlockRedstoneWire extends Block {
return Item.REDSTONE.id; return Item.REDSTONE.id;
} }
public boolean c(World world, int i, int j, int k, int l) { public boolean d(World world, int i, int j, int k, int l) {
return !this.a ? false : this.a(world, i, j, k, l); return !this.a ? false : this.a(world, i, j, k, l);
} }
@ -306,25 +306,25 @@ public class BlockRedstoneWire extends Block {
} else if (l == 1) { } else if (l == 1) {
return true; return true;
} else { } else {
boolean flag = b(iblockaccess, i - 1, j, k) || !iblockaccess.d(i - 1, j, k) && b(iblockaccess, i - 1, j - 1, k); boolean flag = c(iblockaccess, i - 1, j, k, 1) || !iblockaccess.e(i - 1, j, k) && c(iblockaccess, i - 1, j - 1, k, -1);
boolean flag1 = b(iblockaccess, i + 1, j, k) || !iblockaccess.d(i + 1, j, k) && b(iblockaccess, i + 1, j - 1, k); boolean flag1 = c(iblockaccess, i + 1, j, k, 3) || !iblockaccess.e(i + 1, j, k) && c(iblockaccess, i + 1, j - 1, k, -1);
boolean flag2 = b(iblockaccess, i, j, k - 1) || !iblockaccess.d(i, j, k - 1) && b(iblockaccess, i, j - 1, k - 1); boolean flag2 = c(iblockaccess, i, j, k - 1, 2) || !iblockaccess.e(i, j, k - 1) && c(iblockaccess, i, j - 1, k - 1, -1);
boolean flag3 = b(iblockaccess, i, j, k + 1) || !iblockaccess.d(i, j, k + 1) && b(iblockaccess, i, j - 1, k + 1); boolean flag3 = c(iblockaccess, i, j, k + 1, 0) || !iblockaccess.e(i, j, k + 1) && c(iblockaccess, i, j - 1, k + 1, -1);
if (!iblockaccess.d(i, j + 1, k)) { if (!iblockaccess.e(i, j + 1, k)) {
if (iblockaccess.d(i - 1, j, k) && b(iblockaccess, i - 1, j + 1, k)) { if (iblockaccess.e(i - 1, j, k) && c(iblockaccess, i - 1, j + 1, k, -1)) {
flag = true; flag = true;
} }
if (iblockaccess.d(i + 1, j, k) && b(iblockaccess, i + 1, j + 1, k)) { if (iblockaccess.e(i + 1, j, k) && c(iblockaccess, i + 1, j + 1, k, -1)) {
flag1 = true; flag1 = true;
} }
if (iblockaccess.d(i, j, k - 1) && b(iblockaccess, i, j + 1, k - 1)) { if (iblockaccess.e(i, j, k - 1) && c(iblockaccess, i, j + 1, k - 1, -1)) {
flag2 = true; flag2 = true;
} }
if (iblockaccess.d(i, j, k + 1) && b(iblockaccess, i, j + 1, k + 1)) { if (iblockaccess.e(i, j, k + 1) && c(iblockaccess, i, j + 1, k + 1, -1)) {
flag3 = true; flag3 = true;
} }
} }
@ -337,9 +337,21 @@ public class BlockRedstoneWire extends Block {
return this.a; return this.a;
} }
public static boolean b(IBlockAccess iblockaccess, int i, int j, int k) { public static boolean c(IBlockAccess iblockaccess, int i, int j, int k, int l) {
int l = iblockaccess.getTypeId(i, j, k); int i1 = iblockaccess.getTypeId(i, j, k);
return l == Block.REDSTONE_WIRE.id ? true : (l == 0 ? false : Block.byId[l].isPowerSource()); if (i1 == Block.REDSTONE_WIRE.id) {
return true;
} else if (i1 == 0) {
return false;
} else if (Block.byId[i1].isPowerSource()) {
return true;
} else if (i1 != Block.DIODE_OFF.id && i1 != Block.DIODE_ON.id) {
return false;
} else {
int j1 = iblockaccess.getData(i, j, k);
return l == BedBlockTextures.b[j1 & 3];
}
} }
} }

View File

@ -60,7 +60,7 @@ public class BlockSapling extends BlockFlower {
// CraftBukkit end // CraftBukkit end
} }
protected int b(int i) { protected int a_(int i) {
return i & 3; return i & 3;
} }

View File

@ -20,7 +20,7 @@ public class BlockSign extends BlockContainer {
this.a(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f1, 0.5F + f); this.a(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f1, 0.5F + f);
} }
public AxisAlignedBB d(World world, int i, int j, int k) { public AxisAlignedBB e(World world, int i, int j, int k) {
return null; return null;
} }
@ -101,7 +101,7 @@ public class BlockSign extends BlockContainer {
} }
if (flag) { if (flag) {
this.b_(world, i, j, k, world.getData(i, j, k)); this.g(world, i, j, k, world.getData(i, j, k));
world.setTypeId(i, j, k, 0); world.setTypeId(i, j, k, 0);
} }

View File

@ -12,7 +12,7 @@ public class BlockSnow extends Block {
this.a(true); this.a(true);
} }
public AxisAlignedBB d(World world, int i, int j, int k) { public AxisAlignedBB e(World world, int i, int j, int k) {
int l = world.getData(i, j, k) & 7; 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.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;
@ -45,7 +45,7 @@ public class BlockSnow extends Block {
private boolean g(World world, int i, int j, int k) { private boolean g(World world, int i, int j, int k) {
if (!this.canPlace(world, i, j, k)) { if (!this.canPlace(world, i, j, k)) {
this.b_(world, i, j, k, world.getData(i, j, k)); this.g(world, i, j, k, world.getData(i, j, k));
world.setTypeId(i, j, k, 0); world.setTypeId(i, j, k, 0);
return false; return false;
} else { } else {
@ -89,7 +89,7 @@ public class BlockSnow extends Block {
} }
// CraftBukkit end // CraftBukkit end
this.b_(world, i, j, k, world.getData(i, j, k)); this.g(world, i, j, k, world.getData(i, j, k));
world.setTypeId(i, j, k, 0); world.setTypeId(i, j, k, 0);
} }
} }

View File

@ -17,7 +17,7 @@ public class BlockSoil extends Block {
this.f(255); this.f(255);
} }
public AxisAlignedBB d(World world, int i, int j, int k) { 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.b((double) (i + 0), (double) (j + 0), (double) (k + 0), (double) (i + 1), (double) (j + 1), (double) (k + 1));
} }

View File

@ -2,6 +2,7 @@ package net.minecraft.server;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Random; import java.util.Random;
@ -261,7 +262,7 @@ public class Chunk {
this.c(i, k); this.c(i, k);
this.e.a(i, j, k, i1); this.e.a(i, j, k, i1);
if (l != 0) { if (l != 0) {
Block.byId[l].e(this.world, l1, j, i2); Block.byId[l].c(this.world, l1, j, i2);
} }
this.o = true; this.o = true;
@ -298,7 +299,7 @@ public class Chunk {
this.world.a(EnumSkyBlock.BLOCK, k1, j, l1, k1, j, l1); this.world.a(EnumSkyBlock.BLOCK, k1, j, l1, k1, j, l1);
this.c(i, k); this.c(i, k);
if (l != 0 && !this.world.isStatic) { if (l != 0 && !this.world.isStatic) {
Block.byId[l].e(this.world, k1, j, l1); Block.byId[l].c(this.world, k1, j, l1);
} }
this.o = true; this.o = true;
@ -371,15 +372,15 @@ public class Chunk {
k = this.entitySlices.length - 1; k = this.entitySlices.length - 1;
} }
entity.bF = true; entity.bG = true;
entity.bG = this.x; entity.bH = this.x;
entity.bH = k; entity.bI = k;
entity.bI = this.z; entity.bJ = this.z;
this.entitySlices[k].add(entity); this.entitySlices[k].add(entity);
} }
public void b(Entity entity) { public void b(Entity entity) {
this.a(entity, entity.bH); this.a(entity, entity.bI);
} }
public void a(Entity entity, int i) { public void a(Entity entity, int i) {
@ -411,12 +412,17 @@ public class Chunk {
BlockContainer blockcontainer = (BlockContainer) Block.byId[l]; BlockContainer blockcontainer = (BlockContainer) Block.byId[l];
blockcontainer.e(this.world, this.x * 16 + i, j, this.z * 16 + k); blockcontainer.c(this.world, this.x * 16 + i, j, this.z * 16 + k);
tileentity = (TileEntity) this.tileEntities.get(chunkposition); tileentity = (TileEntity) this.tileEntities.get(chunkposition);
} }
if (tileentity != null && tileentity.g()) {
this.tileEntities.remove(chunkposition);
return null;
} else {
return tileentity; return tileentity;
} }
}
public void a(TileEntity tileentity) { public void a(TileEntity tileentity) {
int i = tileentity.x - this.x * 16; int i = tileentity.x - this.x * 16;
@ -424,6 +430,9 @@ public class Chunk {
int k = tileentity.z - this.z * 16; int k = tileentity.z - this.z * 16;
this.a(i, j, k, tileentity); this.a(i, j, k, tileentity);
if (this.c) {
this.world.c.add(tileentity);
}
} }
public void a(int i, int j, int k, TileEntity tileentity) { public void a(int i, int j, int k, TileEntity tileentity) {
@ -434,14 +443,7 @@ public class Chunk {
tileentity.y = j; tileentity.y = j;
tileentity.z = this.z * 16 + k; tileentity.z = this.z * 16 + k;
if (this.getTypeId(i, j, k) != 0 && Block.byId[this.getTypeId(i, j, k)] instanceof BlockContainer) { if (this.getTypeId(i, j, k) != 0 && Block.byId[this.getTypeId(i, j, k)] instanceof BlockContainer) {
if (this.c) { tileentity.j();
if (this.tileEntities.get(chunkposition) != null) {
this.world.c.remove(this.tileEntities.get(chunkposition));
}
this.world.c.add(tileentity);
}
this.tileEntities.put(chunkposition, tileentity); this.tileEntities.put(chunkposition, tileentity);
} else { } else {
System.out.println("Attempted to place a tile entity where there was no entity tile!"); System.out.println("Attempted to place a tile entity where there was no entity tile!");
@ -452,13 +454,17 @@ public class Chunk {
ChunkPosition chunkposition = new ChunkPosition(i, j, k); ChunkPosition chunkposition = new ChunkPosition(i, j, k);
if (this.c) { if (this.c) {
this.world.c.remove(this.tileEntities.remove(chunkposition)); TileEntity tileentity = (TileEntity) this.tileEntities.remove(chunkposition);
if (tileentity != null) {
tileentity.h();
}
} }
} }
public void addEntities() { public void addEntities() {
this.c = true; this.c = true;
this.world.c.addAll(this.tileEntities.values()); this.world.a(this.tileEntities.values());
for (int i = 0; i < this.entitySlices.length; ++i) { for (int i = 0; i < this.entitySlices.length; ++i) {
this.world.a(this.entitySlices[i]); this.world.a(this.entitySlices[i]);
@ -467,7 +473,13 @@ public class Chunk {
public void removeEntities() { public void removeEntities() {
this.c = false; this.c = false;
this.world.c.removeAll(this.tileEntities.values()); Iterator iterator = this.tileEntities.values().iterator();
while (iterator.hasNext()) {
TileEntity tileentity = (TileEntity) iterator.next();
tileentity.h();
}
for (int i = 0; i < this.entitySlices.length; ++i) { for (int i = 0; i < this.entitySlices.length; ++i) {
// CraftBukkit start // CraftBukkit start

View File

@ -53,7 +53,7 @@ public class ContainerWorkbench extends Container {
public void a(EntityHuman entityhuman) { public void a(EntityHuman entityhuman) {
super.a(entityhuman); super.a(entityhuman);
if (!this.c.isStatic) {
for (int i = 0; i < 9; ++i) { for (int i = 0; i < 9; ++i) {
ItemStack itemstack = this.craftInventory.getItem(i); ItemStack itemstack = this.craftInventory.getItem(i);
@ -62,6 +62,7 @@ public class ContainerWorkbench extends Container {
} }
} }
} }
}
public boolean b(EntityHuman entityhuman) { public boolean b(EntityHuman entityhuman) {
return this.c.getTypeId(this.h, this.i, this.j) != Block.WORKBENCH.id ? false : entityhuman.d((double) this.h + 0.5D, (double) this.i + 0.5D, (double) this.j + 0.5D) <= 64.0D; return this.c.getTypeId(this.h, this.i, this.j) != Block.WORKBENCH.id ? false : entityhuman.d((double) this.h + 0.5D, (double) this.i + 0.5D, (double) this.j + 0.5D) <= 64.0D;

View File

@ -76,6 +76,8 @@ public class CraftingManager {
this.registerShapedRecipe(new ItemStack(Block.STONE_PLATE, 1), new Object[] { "##", Character.valueOf('#'), Block.STONE}); this.registerShapedRecipe(new ItemStack(Block.STONE_PLATE, 1), new Object[] { "##", Character.valueOf('#'), Block.STONE});
this.registerShapedRecipe(new ItemStack(Block.WOOD_PLATE, 1), new Object[] { "##", Character.valueOf('#'), Block.WOOD}); this.registerShapedRecipe(new ItemStack(Block.WOOD_PLATE, 1), new Object[] { "##", Character.valueOf('#'), Block.WOOD});
this.registerShapedRecipe(new ItemStack(Block.DISPENSER, 1), new Object[] { "###", "#X#", "#R#", Character.valueOf('#'), Block.COBBLESTONE, Character.valueOf('X'), Item.BOW, Character.valueOf('R'), Item.REDSTONE}); this.registerShapedRecipe(new ItemStack(Block.DISPENSER, 1), new Object[] { "###", "#X#", "#R#", Character.valueOf('#'), Block.COBBLESTONE, Character.valueOf('X'), Item.BOW, Character.valueOf('R'), Item.REDSTONE});
this.registerShapedRecipe(new ItemStack(Block.PISTON, 1), new Object[] { "TTT", "#X#", "#R#", Character.valueOf('#'), Block.COBBLESTONE, Character.valueOf('X'), Item.IRON_INGOT, Character.valueOf('R'), Item.REDSTONE, Character.valueOf('T'), Block.WOOD});
this.registerShapedRecipe(new ItemStack(Block.PISTON_STICKY, 1), new Object[] { "S", "P", Character.valueOf('S'), Item.SLIME_BALL, Character.valueOf('P'), Block.PISTON});
this.registerShapedRecipe(new ItemStack(Item.BED, 1), new Object[] { "###", "XXX", Character.valueOf('#'), Block.WOOL, Character.valueOf('X'), Block.WOOD}); this.registerShapedRecipe(new ItemStack(Item.BED, 1), new Object[] { "###", "XXX", Character.valueOf('#'), Block.WOOL, Character.valueOf('X'), Block.WOOD});
Collections.sort(this.b, new RecipeSorter(this)); Collections.sort(this.b, new RecipeSorter(this));
System.out.println(this.b.size() + " recipes"); System.out.println(this.b.size() + " recipes");

View File

@ -76,13 +76,14 @@ public abstract class Entity {
private boolean justCreated; private boolean justCreated;
protected boolean fireProof; protected boolean fireProof;
protected DataWatcher datawatcher; protected DataWatcher datawatcher;
public float bF;
private double d; private double d;
private double e; private double e;
public boolean bF; public boolean bG;
public int bG;
public int bH; public int bH;
public int bI; public int bI;
public boolean bJ; public int bJ;
public boolean bK;
public UUID uniqueId = UUID.randomUUID(); // CraftBukkit public UUID uniqueId = UUID.randomUUID(); // CraftBukkit
public Entity(World world) { public Entity(World world) {
@ -117,7 +118,8 @@ public abstract class Entity {
this.justCreated = true; this.justCreated = true;
this.fireProof = false; this.fireProof = false;
this.datawatcher = new DataWatcher(); this.datawatcher = new DataWatcher();
this.bF = false; this.bF = 0.0F;
this.bG = false;
this.world = world; this.world = world;
this.setPosition(0.0D, 0.0D, 0.0D); this.setPosition(0.0D, 0.0D, 0.0D);
this.datawatcher.a(0, Byte.valueOf((byte) 0)); this.datawatcher.a(0, Byte.valueOf((byte) 0));
@ -126,7 +128,7 @@ public abstract class Entity {
protected abstract void b(); protected abstract void b();
public DataWatcher Z() { public DataWatcher aa() {
return this.datawatcher; return this.datawatcher;
} }
@ -195,11 +197,11 @@ public abstract class Entity {
this.boundingBox.c(d0 - (double) f, d1 - (double) this.height + (double) this.br, d2 - (double) f, d0 + (double) f, d1 - (double) this.height + (double) this.br + (double) f1, d2 + (double) f); this.boundingBox.c(d0 - (double) f, d1 - (double) this.height + (double) this.br, d2 - (double) f, d0 + (double) f, d1 - (double) this.height + (double) this.br + (double) f1, d2 + (double) f);
} }
public void o_() { public void m_() {
this.Q(); this.R();
} }
public void Q() { public void R() {
if (this.vehicle != null && this.vehicle.dead) { if (this.vehicle != null && this.vehicle.dead) {
this.vehicle = null; this.vehicle = null;
} }
@ -274,12 +276,12 @@ public abstract class Entity {
} }
} }
if (this.ad()) { if (this.ae()) {
this.aa(); this.ab();
} }
if (this.locY < -64.0D) { if (this.locY < -64.0D) {
this.X(); this.Y();
} }
if (!this.world.isStatic) { if (!this.world.isStatic) {
@ -290,7 +292,7 @@ public abstract class Entity {
this.justCreated = false; this.justCreated = false;
} }
protected void aa() { protected void ab() {
if (!this.fireProof) { if (!this.fireProof) {
// CraftBukkit start - TODO: this event spams! // CraftBukkit start - TODO: this event spams!
if (this instanceof EntityLiving) { if (this instanceof EntityLiving) {
@ -328,7 +330,7 @@ public abstract class Entity {
} }
} }
protected void X() { protected void Y() {
this.die(); this.die();
} }
@ -599,7 +601,7 @@ public abstract class Entity {
} }
} }
boolean flag2 = this.ab(); boolean flag2 = this.ac();
if (this.world.d(this.boundingBox.shrink(0.0010D, 0.0010D, 0.0010D))) { if (this.world.d(this.boundingBox.shrink(0.0010D, 0.0010D, 0.0010D))) {
this.burn(1); this.burn(1);
@ -672,11 +674,11 @@ public abstract class Entity {
} }
} }
public boolean ab() { public boolean ac() {
return this.bA || this.world.s(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ)); return this.bA || this.world.s(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ));
} }
public boolean ac() { public boolean ad() {
return this.bA; return this.bA;
} }
@ -685,7 +687,7 @@ public abstract class Entity {
} }
public boolean a(Material material) { public boolean a(Material material) {
double d0 = this.locY + (double) this.s(); double d0 = this.locY + (double) this.t();
int i = MathHelper.floor(this.locX); int i = MathHelper.floor(this.locX);
int j = MathHelper.d((float) MathHelper.floor(d0)); int j = MathHelper.d((float) MathHelper.floor(d0));
int k = MathHelper.floor(this.locZ); int k = MathHelper.floor(this.locZ);
@ -701,11 +703,11 @@ public abstract class Entity {
} }
} }
public float s() { public float t() {
return 0.0F; return 0.0F;
} }
public boolean ad() { public boolean ae() {
return this.world.a(this.boundingBox.b(-0.10000000149011612D, -0.4000000059604645D, -0.10000000149011612D), Material.LAVA); return this.world.a(this.boundingBox.b(-0.10000000149011612D, -0.4000000059604645D, -0.10000000149011612D), Material.LAVA);
} }
@ -734,7 +736,17 @@ public abstract class Entity {
int j = MathHelper.floor(this.locY - (double) this.height + d0); int j = MathHelper.floor(this.locY - (double) this.height + d0);
int k = MathHelper.floor(this.locZ); int k = MathHelper.floor(this.locZ);
return this.world.a(MathHelper.floor(this.boundingBox.a), MathHelper.floor(this.boundingBox.b), MathHelper.floor(this.boundingBox.c), MathHelper.floor(this.boundingBox.d), MathHelper.floor(this.boundingBox.e), MathHelper.floor(this.boundingBox.f)) ? this.world.m(i, j, k) : 0.0F; if (this.world.a(MathHelper.floor(this.boundingBox.a), MathHelper.floor(this.boundingBox.b), MathHelper.floor(this.boundingBox.c), MathHelper.floor(this.boundingBox.d), MathHelper.floor(this.boundingBox.e), MathHelper.floor(this.boundingBox.f))) {
float f1 = this.world.n(i, j, k);
if (f1 < this.bF) {
f1 = this.bF;
}
return f1;
} else {
return this.bF;
}
} }
public void spawnIn(World world) { public void spawnIn(World world) {
@ -846,16 +858,16 @@ public abstract class Entity {
this.motZ += d2; this.motZ += d2;
} }
protected void ae() { protected void af() {
this.velocityChanged = true; this.velocityChanged = true;
} }
public boolean damageEntity(Entity entity, int i) { public boolean damageEntity(Entity entity, int i) {
this.ae(); this.af();
return false; return false;
} }
public boolean n_() { public boolean l_() {
return false; return false;
} }
@ -866,7 +878,7 @@ public abstract class Entity {
public void c(Entity entity, int i) {} public void c(Entity entity, int i) {}
public boolean c(NBTTagCompound nbttagcompound) { public boolean c(NBTTagCompound nbttagcompound) {
String s = this.af(); String s = this.ag();
if (!this.dead && s != null) { if (!this.dead && s != null) {
nbttagcompound.setString("id", s); nbttagcompound.setString("id", s);
@ -987,7 +999,7 @@ public abstract class Entity {
// CraftBukkit end // CraftBukkit end
} }
protected final String af() { protected final String ag() {
return EntityTypes.b(this); return EntityTypes.b(this);
} }
@ -1039,20 +1051,20 @@ public abstract class Entity {
return entityitem; return entityitem;
} }
public boolean S() { public boolean T() {
return !this.dead; return !this.dead;
} }
public boolean J() { public boolean K() {
for (int i = 0; i < 8; ++i) { for (int i = 0; i < 8; ++i) {
float f = ((float) ((i >> 0) % 2) - 0.5F) * this.length * 0.9F; float f = ((float) ((i >> 0) % 2) - 0.5F) * this.length * 0.9F;
float f1 = ((float) ((i >> 1) % 2) - 0.5F) * 0.1F; float f1 = ((float) ((i >> 1) % 2) - 0.5F) * 0.1F;
float f2 = ((float) ((i >> 2) % 2) - 0.5F) * this.length * 0.9F; float f2 = ((float) ((i >> 2) % 2) - 0.5F) * this.length * 0.9F;
int j = MathHelper.floor(this.locX + (double) f); int j = MathHelper.floor(this.locX + (double) f);
int k = MathHelper.floor(this.locY + (double) this.s() + (double) f1); int k = MathHelper.floor(this.locY + (double) this.t() + (double) f1);
int l = MathHelper.floor(this.locZ + (double) f2); int l = MathHelper.floor(this.locZ + (double) f2);
if (this.world.d(j, k, l)) { if (this.world.e(j, k, l)) {
return true; return true;
} }
} }
@ -1068,14 +1080,14 @@ public abstract class Entity {
return null; return null;
} }
public void D() { public void E() {
if (this.vehicle.dead) { if (this.vehicle.dead) {
this.vehicle = null; this.vehicle = null;
} else { } else {
this.motX = 0.0D; this.motX = 0.0D;
this.motY = 0.0D; this.motY = 0.0D;
this.motZ = 0.0D; this.motZ = 0.0D;
this.o_(); this.m_();
if (this.vehicle != null) { if (this.vehicle != null) {
this.vehicle.f(); this.vehicle.f();
this.e += (double) (this.vehicle.yaw - this.vehicle.lastYaw); this.e += (double) (this.vehicle.yaw - this.vehicle.lastYaw);
@ -1125,10 +1137,10 @@ public abstract class Entity {
} }
public void f() { public void f() {
this.passenger.setPosition(this.locX, this.locY + this.m() + this.passenger.H(), this.locZ); this.passenger.setPosition(this.locX, this.locY + this.m() + this.passenger.I(), this.locZ);
} }
public double H() { public double I() {
return (double) this.height; return (double) this.height;
} }
@ -1196,11 +1208,11 @@ public abstract class Entity {
} }
} }
public Vec3D Y() { public Vec3D Z() {
return null; return null;
} }
public void O() {} public void P() {}
public ItemStack[] getEquipment() { public ItemStack[] getEquipment() {
return null; return null;
@ -1256,13 +1268,13 @@ public abstract class Entity {
double d4 = d1 - (double) j; double d4 = d1 - (double) j;
double d5 = d2 - (double) k; double d5 = d2 - (double) k;
if (this.world.d(i, j, k)) { if (this.world.e(i, j, k)) {
boolean flag = !this.world.d(i - 1, j, k); boolean flag = !this.world.e(i - 1, j, k);
boolean flag1 = !this.world.d(i + 1, j, k); boolean flag1 = !this.world.e(i + 1, j, k);
boolean flag2 = !this.world.d(i, j - 1, k); boolean flag2 = !this.world.e(i, j - 1, k);
boolean flag3 = !this.world.d(i, j + 1, k); boolean flag3 = !this.world.e(i, j + 1, k);
boolean flag4 = !this.world.d(i, j, k - 1); boolean flag4 = !this.world.e(i, j, k - 1);
boolean flag5 = !this.world.d(i, j, k + 1); boolean flag5 = !this.world.e(i, j, k + 1);
byte b0 = -1; byte b0 = -1;
double d6 = 9999.0D; double d6 = 9999.0D;

View File

@ -41,7 +41,7 @@ public class EntityArrow extends Entity {
this.shooter = entityliving; this.shooter = entityliving;
this.fromPlayer = entityliving instanceof EntityHuman; this.fromPlayer = entityliving instanceof EntityHuman;
this.b(0.5F, 0.5F); this.b(0.5F, 0.5F);
this.setPositionRotation(entityliving.locX, entityliving.locY + (double) entityliving.s(), entityliving.locZ, entityliving.yaw, entityliving.pitch); this.setPositionRotation(entityliving.locX, entityliving.locY + (double) entityliving.t(), entityliving.locZ, entityliving.yaw, entityliving.pitch);
this.locX -= (double) (MathHelper.cos(this.yaw / 180.0F * 3.1415927F) * 0.16F); this.locX -= (double) (MathHelper.cos(this.yaw / 180.0F * 3.1415927F) * 0.16F);
this.locY -= 0.10000000149011612D; this.locY -= 0.10000000149011612D;
this.locZ -= (double) (MathHelper.sin(this.yaw / 180.0F * 3.1415927F) * 0.16F); this.locZ -= (double) (MathHelper.sin(this.yaw / 180.0F * 3.1415927F) * 0.16F);
@ -77,8 +77,8 @@ public class EntityArrow extends Entity {
this.j = 0; this.j = 0;
} }
public void o_() { public void m_() {
super.o_(); super.m_();
if (this.lastPitch == 0.0F && this.lastYaw == 0.0F) { if (this.lastPitch == 0.0F && this.lastYaw == 0.0F) {
float f = MathHelper.a(this.motX * this.motX + this.motZ * this.motZ); float f = MathHelper.a(this.motX * this.motX + this.motZ * this.motZ);
@ -90,7 +90,7 @@ public class EntityArrow extends Entity {
if (i > 0) { if (i > 0) {
Block.byId[i].a(this.world, this.d, this.e, this.f); Block.byId[i].a(this.world, this.d, this.e, this.f);
AxisAlignedBB axisalignedbb = Block.byId[i].d(this.world, this.d, this.e, this.f); AxisAlignedBB axisalignedbb = Block.byId[i].e(this.world, this.d, this.e, this.f);
if (axisalignedbb != null && axisalignedbb.a(Vec3D.create(this.locX, this.locY, this.locZ))) { if (axisalignedbb != null && axisalignedbb.a(Vec3D.create(this.locX, this.locY, this.locZ))) {
this.inGround = true; this.inGround = true;
@ -139,7 +139,7 @@ public class EntityArrow extends Entity {
for (int k = 0; k < list.size(); ++k) { for (int k = 0; k < list.size(); ++k) {
Entity entity1 = (Entity) list.get(k); Entity entity1 = (Entity) list.get(k);
if (entity1.n_() && (entity1 != this.shooter || this.k >= 5)) { if (entity1.l_() && (entity1 != this.shooter || this.k >= 5)) {
f1 = 0.3F; f1 = 0.3F;
AxisAlignedBB axisalignedbb1 = entity1.boundingBox.b((double) f1, (double) f1, (double) f1); AxisAlignedBB axisalignedbb1 = entity1.boundingBox.b((double) f1, (double) f1, (double) f1);
MovingObjectPosition movingobjectposition1 = axisalignedbb1.a(vec3d, vec3d1); MovingObjectPosition movingobjectposition1 = axisalignedbb1.a(vec3d, vec3d1);
@ -245,7 +245,7 @@ public class EntityArrow extends Entity {
float f3 = 0.99F; float f3 = 0.99F;
f1 = 0.03F; f1 = 0.03F;
if (this.ac()) { if (this.ad()) {
for (int l = 0; l < 4; ++l) { for (int l = 0; l < 4; ++l) {
float f4 = 0.25F; float f4 = 0.25F;

View File

@ -107,7 +107,7 @@ public class EntityBoat extends Entity {
this.c = -this.c; this.c = -this.c;
this.b = 10; this.b = 10;
this.damage += i * 10; this.damage += i * 10;
this.ae(); this.af();
if (this.damage > 40) { if (this.damage > 40) {
// CraftBukkit start // CraftBukkit start
@ -143,11 +143,11 @@ public class EntityBoat extends Entity {
} }
} }
public boolean n_() { public boolean l_() {
return !this.dead; return !this.dead;
} }
public void o_() { public void m_() {
// CraftBukkit start // CraftBukkit start
double prevX = this.locX; double prevX = this.locX;
double prevY = this.locY; double prevY = this.locY;
@ -156,7 +156,7 @@ public class EntityBoat extends Entity {
float prevPitch = this.pitch; float prevPitch = this.pitch;
// CraftBukkit end // CraftBukkit end
super.o_(); super.m_();
if (this.b > 0) { if (this.b > 0) {
--this.b; --this.b;
} }
@ -386,7 +386,7 @@ public class EntityBoat extends Entity {
double d0 = Math.cos((double) this.yaw * 3.141592653589793D / 180.0D) * 0.4D; double d0 = Math.cos((double) this.yaw * 3.141592653589793D / 180.0D) * 0.4D;
double d1 = Math.sin((double) this.yaw * 3.141592653589793D / 180.0D) * 0.4D; double d1 = Math.sin((double) this.yaw * 3.141592653589793D / 180.0D) * 0.4D;
this.passenger.setPosition(this.locX + d0, this.locY + this.m() + this.passenger.H(), this.locZ + d1); this.passenger.setPosition(this.locX + d0, this.locY + this.m() + this.passenger.I(), this.locZ + d1);
} }
} }

View File

@ -44,7 +44,7 @@ public class EntityCreature extends EntityLiving {
if (this.target != null) { if (this.target != null) {
this.pathEntity = this.world.findPath(this, this.target, f); this.pathEntity = this.world.findPath(this, this.target, f);
} }
} else if (!this.target.S()) { } else if (!this.target.T()) {
// CraftBukkit start // CraftBukkit start
EntityTargetEvent event = new EntityTargetEvent(this.getBukkitEntity(), null, EntityTargetEvent.TargetReason.TARGET_DIED); EntityTargetEvent event = new EntityTargetEvent(this.getBukkitEntity(), null, EntityTargetEvent.TargetReason.TARGET_DIED);
this.world.getServer().getPluginManager().callEvent(event); this.world.getServer().getPluginManager().callEvent(event);
@ -70,35 +70,12 @@ public class EntityCreature extends EntityLiving {
if (!this.e && this.target != null && (this.pathEntity == null || this.random.nextInt(20) == 0)) { if (!this.e && this.target != null && (this.pathEntity == null || this.random.nextInt(20) == 0)) {
this.pathEntity = this.world.findPath(this, this.target, f); this.pathEntity = this.world.findPath(this, this.target, f);
} else if (!this.e && (this.pathEntity == null && this.random.nextInt(80) == 0 || this.random.nextInt(80) == 0)) { } else if (!this.e && (this.pathEntity == null && this.random.nextInt(80) == 0 || this.random.nextInt(80) == 0)) {
boolean flag = false; this.B();
int i = -1;
int j = -1;
int k = -1;
float f2 = -99999.0F;
for (int l = 0; l < 10; ++l) {
int i1 = MathHelper.floor(this.locX + (double) this.random.nextInt(13) - 6.0D);
int j1 = MathHelper.floor(this.locY + (double) this.random.nextInt(7) - 3.0D);
int k1 = MathHelper.floor(this.locZ + (double) this.random.nextInt(13) - 6.0D);
float f3 = this.a(i1, j1, k1);
if (f3 > f2) {
f2 = f3;
i = i1;
j = j1;
k = k1;
flag = true;
}
} }
if (flag) { int i = MathHelper.floor(this.boundingBox.b + 0.5D);
this.pathEntity = this.world.a(this, i, j, k, 10.0F); boolean flag = this.ad();
} boolean flag1 = this.ae();
}
int l1 = MathHelper.floor(this.boundingBox.b + 0.5D);
boolean flag1 = this.ac();
boolean flag2 = this.ad();
this.pitch = 0.0F; this.pitch = 0.0F;
if (this.pathEntity != null && this.random.nextInt(100) != 0) { if (this.pathEntity != null && this.random.nextInt(100) != 0) {
@ -119,37 +96,37 @@ public class EntityCreature extends EntityLiving {
if (vec3d != null) { if (vec3d != null) {
double d1 = vec3d.a - this.locX; double d1 = vec3d.a - this.locX;
double d2 = vec3d.c - this.locZ; double d2 = vec3d.c - this.locZ;
double d3 = vec3d.b - (double) l1; double d3 = vec3d.b - (double) i;
// CraftBukkit - Math -> TrigMath // CraftBukkit - Math -> TrigMath
float f4 = (float) (TrigMath.atan2(d2, d1) * 180.0D / 3.1415927410125732D) - 90.0F; float f2 = (float) (TrigMath.atan2(d2, d1) * 180.0D / 3.1415927410125732D) - 90.0F;
float f5 = f4 - this.yaw; float f3 = f2 - this.yaw;
for (this.aA = this.aE; f5 < -180.0F; f5 += 360.0F) { for (this.aA = this.aE; f3 < -180.0F; f3 += 360.0F) {
; ;
} }
while (f5 >= 180.0F) { while (f3 >= 180.0F) {
f5 -= 360.0F; f3 -= 360.0F;
} }
if (f5 > 30.0F) { if (f3 > 30.0F) {
f5 = 30.0F; f3 = 30.0F;
} }
if (f5 < -30.0F) { if (f3 < -30.0F) {
f5 = -30.0F; f3 = -30.0F;
} }
this.yaw += f5; this.yaw += f3;
if (this.e && this.target != null) { if (this.e && this.target != null) {
double d4 = this.target.locX - this.locX; double d4 = this.target.locX - this.locX;
double d5 = this.target.locZ - this.locZ; double d5 = this.target.locZ - this.locZ;
float f6 = this.yaw; float f4 = this.yaw;
this.yaw = (float) (Math.atan2(d5, d4) * 180.0D / 3.1415927410125732D) - 90.0F; this.yaw = (float) (Math.atan2(d5, d4) * 180.0D / 3.1415927410125732D) - 90.0F;
f5 = (f6 - this.yaw + 90.0F) * 3.1415927F / 180.0F; f3 = (f4 - this.yaw + 90.0F) * 3.1415927F / 180.0F;
this.az = -MathHelper.sin(f5) * this.aA * 1.0F; this.az = -MathHelper.sin(f3) * this.aA * 1.0F;
this.aA = MathHelper.cos(f5) * this.aA * 1.0F; this.aA = MathHelper.cos(f3) * this.aA * 1.0F;
} }
if (d3 > 0.0D) { if (d3 > 0.0D) {
@ -161,11 +138,11 @@ public class EntityCreature extends EntityLiving {
this.a(this.target, 30.0F, 30.0F); this.a(this.target, 30.0F, 30.0F);
} }
if (this.positionChanged && !this.B()) { if (this.positionChanged && !this.C()) {
this.aC = true; this.aC = true;
} }
if (this.random.nextFloat() < 0.8F && (flag1 || flag2)) { if (this.random.nextFloat() < 0.8F && (flag || flag1)) {
this.aC = true; this.aC = true;
} }
} else { } else {
@ -174,6 +151,33 @@ public class EntityCreature extends EntityLiving {
} }
} }
protected void B() {
boolean flag = false;
int i = -1;
int j = -1;
int k = -1;
float f = -99999.0F;
for (int l = 0; l < 10; ++l) {
int i1 = MathHelper.floor(this.locX + (double) this.random.nextInt(13) - 6.0D);
int j1 = MathHelper.floor(this.locY + (double) this.random.nextInt(7) - 3.0D);
int k1 = MathHelper.floor(this.locZ + (double) this.random.nextInt(13) - 6.0D);
float f1 = this.a(i1, j1, k1);
if (f1 > f) {
f = f1;
i = i1;
j = j1;
k = k1;
flag = true;
}
}
if (flag) {
this.pathEntity = this.world.a(this, i, j, k, 10.0F);
}
}
protected void a(Entity entity, float f) {} protected void a(Entity entity, float f) {}
protected void b(Entity entity, float f) {} protected void b(Entity entity, float f) {}
@ -194,7 +198,7 @@ public class EntityCreature extends EntityLiving {
return super.d() && this.a(i, j, k) >= 0.0F; return super.d() && this.a(i, j, k) >= 0.0F;
} }
public boolean B() { public boolean C() {
return this.pathEntity != null; return this.pathEntity != null;
} }
@ -202,7 +206,7 @@ public class EntityCreature extends EntityLiving {
this.pathEntity = pathentity; this.pathEntity = pathentity;
} }
public Entity E() { public Entity F() {
return this.target; return this.target;
} }

View File

@ -46,7 +46,7 @@ public class EntityCreeper extends EntityMonster {
} }
} }
public void o_() { public void m_() {
this.b = this.fuseTicks; this.b = this.fuseTicks;
if (this.world.isStatic) { if (this.world.isStatic) {
int i = this.x(); int i = this.x();
@ -65,7 +65,7 @@ public class EntityCreeper extends EntityMonster {
} }
} }
super.o_(); super.m_();
if (this.target == null && this.fuseTicks > 0) { if (this.target == null && this.fuseTicks > 0) {
this.e(-1); this.e(-1);
--this.fuseTicks; --this.fuseTicks;

View File

@ -34,7 +34,7 @@ public class EntityEgg extends Entity {
super(world); super(world);
this.thrower = entityliving; this.thrower = entityliving;
this.b(0.25F, 0.25F); this.b(0.25F, 0.25F);
this.setPositionRotation(entityliving.locX, entityliving.locY + (double) entityliving.s(), entityliving.locZ, entityliving.yaw, entityliving.pitch); this.setPositionRotation(entityliving.locX, entityliving.locY + (double) entityliving.t(), entityliving.locZ, entityliving.yaw, entityliving.pitch);
this.locX -= (double) (MathHelper.cos(this.yaw / 180.0F * 3.1415927F) * 0.16F); this.locX -= (double) (MathHelper.cos(this.yaw / 180.0F * 3.1415927F) * 0.16F);
this.locY -= 0.10000000149011612D; this.locY -= 0.10000000149011612D;
this.locZ -= (double) (MathHelper.sin(this.yaw / 180.0F * 3.1415927F) * 0.16F); this.locZ -= (double) (MathHelper.sin(this.yaw / 180.0F * 3.1415927F) * 0.16F);
@ -78,11 +78,11 @@ public class EntityEgg extends Entity {
this.h = 0; this.h = 0;
} }
public void o_() { public void m_() {
this.bo = this.locX; this.bo = this.locX;
this.bp = this.locY; this.bp = this.locY;
this.bq = this.locZ; this.bq = this.locZ;
super.o_(); super.m_();
if (this.a > 0) { if (this.a > 0) {
--this.a; --this.a;
} }
@ -127,7 +127,7 @@ public class EntityEgg extends Entity {
for (int j = 0; j < list.size(); ++j) { for (int j = 0; j < list.size(); ++j) {
Entity entity1 = (Entity) list.get(j); Entity entity1 = (Entity) list.get(j);
if (entity1.n_() && (entity1 != this.thrower || this.i >= 5)) { if (entity1.l_() && (entity1 != this.thrower || this.i >= 5)) {
float f = 0.3F; float f = 0.3F;
AxisAlignedBB axisalignedbb = entity1.boundingBox.b((double) f, (double) f, (double) f); AxisAlignedBB axisalignedbb = entity1.boundingBox.b((double) f, (double) f, (double) f);
MovingObjectPosition movingobjectposition1 = axisalignedbb.a(vec3d, vec3d1); MovingObjectPosition movingobjectposition1 = axisalignedbb.a(vec3d, vec3d1);
@ -293,7 +293,7 @@ public class EntityEgg extends Entity {
float f2 = 0.99F; float f2 = 0.99F;
float f3 = 0.03F; float f3 = 0.03F;
if (this.ac()) { if (this.ad()) {
for (int i1 = 0; i1 < 4; ++i1) { for (int i1 = 0; i1 < 4; ++i1) {
float f4 = 0.25F; float f4 = 0.25F;

View File

@ -60,8 +60,8 @@ public class EntityFireball extends Entity {
this.e = d2 / d3 * 0.1D; this.e = d2 / d3 * 0.1D;
} }
public void o_() { public void m_() {
super.o_(); super.m_();
this.fireTicks = 10; this.fireTicks = 10;
if (this.a > 0) { if (this.a > 0) {
--this.a; --this.a;
@ -106,7 +106,7 @@ public class EntityFireball extends Entity {
for (int j = 0; j < list.size(); ++j) { for (int j = 0; j < list.size(); ++j) {
Entity entity1 = (Entity) list.get(j); Entity entity1 = (Entity) list.get(j);
if (entity1.n_() && (entity1 != this.shooter || this.l >= 25)) { if (entity1.l_() && (entity1 != this.shooter || this.l >= 25)) {
float f = 0.3F; float f = 0.3F;
AxisAlignedBB axisalignedbb = entity1.boundingBox.b((double) f, (double) f, (double) f); AxisAlignedBB axisalignedbb = entity1.boundingBox.b((double) f, (double) f, (double) f);
MovingObjectPosition movingobjectposition1 = axisalignedbb.a(vec3d, vec3d1); MovingObjectPosition movingobjectposition1 = axisalignedbb.a(vec3d, vec3d1);
@ -195,7 +195,7 @@ public class EntityFireball extends Entity {
this.yaw = this.lastYaw + (this.yaw - this.lastYaw) * 0.2F; this.yaw = this.lastYaw + (this.yaw - this.lastYaw) * 0.2F;
float f2 = 0.95F; float f2 = 0.95F;
if (this.ac()) { if (this.ad()) {
for (int k = 0; k < 4; ++k) { for (int k = 0; k < 4; ++k) {
float f3 = 0.25F; float f3 = 0.25F;
@ -233,14 +233,14 @@ public class EntityFireball extends Entity {
this.j = nbttagcompound.c("inGround") == 1; this.j = nbttagcompound.c("inGround") == 1;
} }
public boolean n_() { public boolean l_() {
return true; return true;
} }
public boolean damageEntity(Entity entity, int i) { public boolean damageEntity(Entity entity, int i) {
this.ae(); this.af();
if (entity != null) { if (entity != null) {
Vec3D vec3d = entity.Y(); Vec3D vec3d = entity.Z();
if (vec3d != null) { if (vec3d != null) {
this.motX = vec3d.a; this.motX = vec3d.a;

View File

@ -31,12 +31,12 @@ public class EntityFish extends Entity {
public EntityFish(World world) { public EntityFish(World world) {
super(world); super(world);
this.b(0.25F, 0.25F); this.b(0.25F, 0.25F);
this.bJ = true; this.bK = true;
} }
public EntityFish(World world, EntityHuman entityhuman) { public EntityFish(World world, EntityHuman entityhuman) {
super(world); super(world);
this.bJ = true; this.bK = true;
this.owner = entityhuman; this.owner = entityhuman;
this.owner.hookedFish = this; this.owner.hookedFish = this;
this.b(0.25F, 0.25F); this.b(0.25F, 0.25F);
@ -78,8 +78,8 @@ public class EntityFish extends Entity {
this.i = 0; this.i = 0;
} }
public void o_() { public void m_() {
super.o_(); super.m_();
if (this.l > 0) { if (this.l > 0) {
double d0 = this.locX + (this.m - this.locX) / (double) this.l; double d0 = this.locX + (this.m - this.locX) / (double) this.l;
double d1 = this.locY + (this.n - this.locY) / (double) this.l; double d1 = this.locY + (this.n - this.locY) / (double) this.l;
@ -102,9 +102,9 @@ public class EntityFish extends Entity {
this.c(this.yaw, this.pitch); this.c(this.yaw, this.pitch);
} else { } else {
if (!this.world.isStatic) { if (!this.world.isStatic) {
ItemStack itemstack = this.owner.F(); ItemStack itemstack = this.owner.G();
if (this.owner.dead || !this.owner.S() || itemstack == null || itemstack.getItem() != Item.FISHING_ROD || this.g(this.owner) > 1024.0D) { if (this.owner.dead || !this.owner.T() || itemstack == null || itemstack.getItem() != Item.FISHING_ROD || this.g(this.owner) > 1024.0D) {
this.die(); this.die();
this.owner.hookedFish = null; this.owner.hookedFish = null;
return; return;
@ -167,7 +167,7 @@ public class EntityFish extends Entity {
for (int j = 0; j < list.size(); ++j) { for (int j = 0; j < list.size(); ++j) {
Entity entity1 = (Entity) list.get(j); Entity entity1 = (Entity) list.get(j);
if (entity1.n_() && (entity1 != this.owner || this.j >= 5)) { if (entity1.l_() && (entity1 != this.owner || this.j >= 5)) {
float f = 0.3F; float f = 0.3F;
AxisAlignedBB axisalignedbb = entity1.boundingBox.b((double) f, (double) f, (double) f); AxisAlignedBB axisalignedbb = entity1.boundingBox.b((double) f, (double) f, (double) f);
MovingObjectPosition movingobjectposition1 = axisalignedbb.a(vec3d, vec3d1); MovingObjectPosition movingobjectposition1 = axisalignedbb.a(vec3d, vec3d1);

View File

@ -28,8 +28,8 @@ public class EntityGhast extends EntityFlying implements IMonster {
this.datawatcher.a(16, Byte.valueOf((byte) 0)); this.datawatcher.a(16, Byte.valueOf((byte) 0));
} }
public void o_() { public void m_() {
super.o_(); super.m_();
byte b0 = this.datawatcher.a(16); byte b0 = this.datawatcher.a(16);
this.texture = b0 == 1 ? "/mob/ghast_fire.png" : "/mob/ghast.png"; this.texture = b0 == 1 ? "/mob/ghast_fire.png" : "/mob/ghast.png";
@ -40,7 +40,7 @@ public class EntityGhast extends EntityFlying implements IMonster {
this.die(); this.die();
} }
this.T(); this.U();
this.e = this.f; this.e = this.f;
double d0 = this.b - this.locX; double d0 = this.b - this.locX;
double d1 = this.c - this.locY; double d1 = this.c - this.locY;

View File

@ -71,7 +71,7 @@ public abstract class EntityHuman extends EntityLiving {
this.datawatcher.a(16, Byte.valueOf((byte) 0)); this.datawatcher.a(16, Byte.valueOf((byte) 0));
} }
public void o_() { public void m_() {
if (this.isSleeping()) { if (this.isSleeping()) {
++this.sleepTicks; ++this.sleepTicks;
if (this.sleepTicks > 100) { if (this.sleepTicks > 100) {
@ -92,9 +92,9 @@ public abstract class EntityHuman extends EntityLiving {
} }
} }
super.o_(); super.m_();
if (!this.world.isStatic && this.activeContainer != null && !this.activeContainer.b(this)) { if (!this.world.isStatic && this.activeContainer != null && !this.activeContainer.b(this)) {
this.x(); this.y();
this.activeContainer = this.defaultContainer; this.activeContainer = this.defaultContainer;
} }
@ -139,20 +139,20 @@ public abstract class EntityHuman extends EntityLiving {
} }
} }
protected boolean C() { protected boolean D() {
return this.health <= 0 || this.isSleeping(); return this.health <= 0 || this.isSleeping();
} }
protected void x() { protected void y() {
this.activeContainer = this.defaultContainer; this.activeContainer = this.defaultContainer;
} }
public void D() { public void E() {
double d0 = this.locX; double d0 = this.locX;
double d1 = this.locY; double d1 = this.locY;
double d2 = this.locZ; double d2 = this.locZ;
super.D(); super.E();
this.n = this.o; this.n = this.o;
this.o = 0.0F; this.o = 0.0F;
this.i(this.locX - d0, this.locY - d1, this.locZ - d2); this.i(this.locX - d0, this.locY - d1, this.locZ - d2);
@ -172,7 +172,7 @@ public abstract class EntityHuman extends EntityLiving {
this.aa = (float) this.q / 8.0F; this.aa = (float) this.q / 8.0F;
} }
public void u() { public void v() {
// CraftBukkit - spawnMonsters -> allowMonsters // CraftBukkit - spawnMonsters -> allowMonsters
if (!this.world.allowMonsters && this.health < 20 && this.ticksLived % 20 * 12 == 0) { if (!this.world.allowMonsters && this.health < 20 && this.ticksLived % 20 * 12 == 0) {
this.b(1); this.b(1);
@ -180,7 +180,7 @@ public abstract class EntityHuman extends EntityLiving {
this.inventory.f(); this.inventory.f();
this.n = this.o; this.n = this.o;
super.u(); super.v();
float f = MathHelper.a(this.motX * this.motX + this.motZ * this.motZ); float f = MathHelper.a(this.motX * this.motX + this.motZ * this.motZ);
// CraftBukkit - Math -> TrigMath // CraftBukkit - Math -> TrigMath
float f1 = (float) TrigMath.atan(-this.motY * 0.20000000298023224D) * 15.0F; float f1 = (float) TrigMath.atan(-this.motY * 0.20000000298023224D) * 15.0F;
@ -248,7 +248,7 @@ public abstract class EntityHuman extends EntityLiving {
} }
} }
public void E() { public void F() {
this.a(this.inventory.splitStack(this.inventory.itemInHandIndex, 1), false); this.a(this.inventory.splitStack(this.inventory.itemInHandIndex, 1), false);
} }
@ -258,7 +258,7 @@ public abstract class EntityHuman extends EntityLiving {
public void a(ItemStack itemstack, boolean flag) { public void a(ItemStack itemstack, boolean flag) {
if (itemstack != null) { if (itemstack != null) {
EntityItem entityitem = new EntityItem(this.world, this.locX, this.locY - 0.30000001192092896D + (double) this.s(), this.locZ, itemstack); EntityItem entityitem = new EntityItem(this.world, this.locX, this.locY - 0.30000001192092896D + (double) this.t(), this.locZ, itemstack);
entityitem.pickupDelay = 40; entityitem.pickupDelay = 40;
float f = 0.1F; float f = 0.1F;
@ -372,11 +372,11 @@ public abstract class EntityHuman extends EntityLiving {
public void receive(Entity entity, int i) {} public void receive(Entity entity, int i) {}
public float s() { public float t() {
return 0.12F; return 0.12F;
} }
protected void j_() { protected void s() {
this.height = 1.62F; this.height = 1.62F;
} }
@ -437,7 +437,7 @@ public abstract class EntityHuman extends EntityLiving {
} }
} }
protected boolean t() { protected boolean j_() {
return false; return false;
} }
@ -451,7 +451,7 @@ public abstract class EntityHuman extends EntityLiving {
} }
} }
if (!(entityliving instanceof EntityHuman) || this.t()) { if (!(entityliving instanceof EntityHuman) || this.j_()) {
List list = this.world.a(EntityWolf.class, AxisAlignedBB.b(this.locX, this.locY, this.locZ, this.locX + 1.0D, this.locY + 1.0D, this.locZ + 1.0D).b(16.0D, 4.0D, 16.0D)); List list = this.world.a(EntityWolf.class, AxisAlignedBB.b(this.locX, this.locY, this.locZ, this.locX + 1.0D, this.locY + 1.0D, this.locZ + 1.0D).b(16.0D, 4.0D, 16.0D));
Iterator iterator = list.iterator(); Iterator iterator = list.iterator();
@ -459,7 +459,7 @@ public abstract class EntityHuman extends EntityLiving {
Entity entity = (Entity) iterator.next(); Entity entity = (Entity) iterator.next();
EntityWolf entitywolf1 = (EntityWolf) entity; EntityWolf entitywolf1 = (EntityWolf) entity;
if (entitywolf1.isTamed() && entitywolf1.E() == null && this.name.equals(entitywolf1.getOwnerName()) && (!flag || !entitywolf1.isSitting())) { if (entitywolf1.isTamed() && entitywolf1.F() == null && this.name.equals(entitywolf1.getOwnerName()) && (!flag || !entitywolf1.isSitting())) {
// CraftBukkit start // CraftBukkit start
org.bukkit.entity.Entity bukkitTarget = entity == null ? null : entityliving.getBukkitEntity(); org.bukkit.entity.Entity bukkitTarget = entity == null ? null : entityliving.getBukkitEntity();
@ -502,32 +502,32 @@ public abstract class EntityHuman extends EntityLiving {
public void c(Entity entity) { public void c(Entity entity) {
if (!entity.a(this)) { if (!entity.a(this)) {
ItemStack itemstack = this.F(); ItemStack itemstack = this.G();
if (itemstack != null && entity instanceof EntityLiving) { if (itemstack != null && entity instanceof EntityLiving) {
itemstack.a((EntityLiving) entity); itemstack.a((EntityLiving) entity);
// CraftBukkit - bypass infinite items; <= 0 -> == 0 // CraftBukkit - bypass infinite items; <= 0 -> == 0
if (itemstack.count == 0) { if (itemstack.count == 0) {
itemstack.a(this); itemstack.a(this);
this.G(); this.H();
} }
} }
} }
} }
public ItemStack F() { public ItemStack G() {
return this.inventory.getItemInHand(); return this.inventory.getItemInHand();
} }
public void G() { public void H() {
this.inventory.setItem(this.inventory.itemInHandIndex, (ItemStack) null); this.inventory.setItem(this.inventory.itemInHandIndex, (ItemStack) null);
} }
public double H() { public double I() {
return (double) (this.height - 0.5F); return (double) (this.height - 0.5F);
} }
public void k_() { public void w() {
this.q = -1; this.q = -1;
this.p = true; this.p = true;
} }
@ -562,19 +562,19 @@ public abstract class EntityHuman extends EntityLiving {
} }
// CraftBukkit end // CraftBukkit end
ItemStack itemstack = this.F(); ItemStack itemstack = this.G();
if (itemstack != null && entity instanceof EntityLiving) { if (itemstack != null && entity instanceof EntityLiving) {
itemstack.a((EntityLiving) entity, this); itemstack.a((EntityLiving) entity, this);
// CraftBukkit - bypass infinite items; <= 0 -> == 0 // CraftBukkit - bypass infinite items; <= 0 -> == 0
if (itemstack.count == 0) { if (itemstack.count == 0) {
itemstack.a(this); itemstack.a(this);
this.G(); this.H();
} }
} }
if (entity instanceof EntityLiving) { if (entity instanceof EntityLiving) {
if (entity.S()) { if (entity.T()) {
this.a((EntityLiving) entity, true); this.a((EntityLiving) entity, true);
} }
@ -593,13 +593,13 @@ public abstract class EntityHuman extends EntityLiving {
} }
} }
public boolean J() { public boolean K() {
return !this.sleeping && super.J(); return !this.sleeping && super.K();
} }
public EnumBedError a(int i, int j, int k) { public EnumBedError a(int i, int j, int k) {
if (!this.world.isStatic) { if (!this.world.isStatic) {
if (this.isSleeping() || !this.S()) { if (this.isSleeping() || !this.T()) {
return EnumBedError.OTHER_PROBLEM; return EnumBedError.OTHER_PROBLEM;
} }
@ -695,13 +695,13 @@ public abstract class EntityHuman extends EntityLiving {
public void a(boolean flag, boolean flag1, boolean flag2) { public void a(boolean flag, boolean flag1, boolean flag2) {
this.b(0.6F, 1.8F); this.b(0.6F, 1.8F);
this.j_(); this.s();
ChunkCoordinates chunkcoordinates = this.A; ChunkCoordinates chunkcoordinates = this.A;
ChunkCoordinates chunkcoordinates1 = this.A; ChunkCoordinates chunkcoordinates1 = this.A;
if (chunkcoordinates != null && this.world.getTypeId(chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z) == Block.BED.id) { if (chunkcoordinates != null && this.world.getTypeId(chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z) == Block.BED.id) {
BlockBed.a(this.world, chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z, false); BlockBed.a(this.world, chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z, false);
chunkcoordinates1 = BlockBed.g(this.world, chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z, 0); chunkcoordinates1 = BlockBed.f(this.world, chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z, 0);
if (chunkcoordinates1 == null) { if (chunkcoordinates1 == null) {
chunkcoordinates1 = new ChunkCoordinates(chunkcoordinates.x, chunkcoordinates.y + 1, chunkcoordinates.z); chunkcoordinates1 = new ChunkCoordinates(chunkcoordinates.x, chunkcoordinates.y + 1, chunkcoordinates.z);
} }
@ -755,7 +755,7 @@ public abstract class EntityHuman extends EntityLiving {
if (world.getTypeId(chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z) != Block.BED.id) { if (world.getTypeId(chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z) != Block.BED.id) {
return null; return null;
} else { } else {
ChunkCoordinates chunkcoordinates1 = BlockBed.g(world, chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z, 0); ChunkCoordinates chunkcoordinates1 = BlockBed.f(world, chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z, 0);
return chunkcoordinates1; return chunkcoordinates1;
} }
@ -790,8 +790,8 @@ public abstract class EntityHuman extends EntityLiving {
public void a(Statistic statistic, int i) {} public void a(Statistic statistic, int i) {}
protected void N() { protected void O() {
super.N(); super.O();
this.a(StatisticList.u, 1); this.a(StatisticList.u, 1);
} }
@ -813,7 +813,7 @@ public abstract class EntityHuman extends EntityLiving {
if (i > 0) { if (i > 0) {
this.a(StatisticList.q, i); this.a(StatisticList.q, i);
} }
} else if (this.ac()) { } else if (this.ad()) {
i = Math.round(MathHelper.a(d0 * d0 + d2 * d2) * 100.0F); i = Math.round(MathHelper.a(d0 * d0 + d2 * d2) * 100.0F);
if (i > 0) { if (i > 0) {
this.a(StatisticList.m, i); this.a(StatisticList.m, i);
@ -871,7 +871,7 @@ public abstract class EntityHuman extends EntityLiving {
} }
} }
public void O() { public void P() {
if (this.D > 0) { if (this.D > 0) {
this.D = 10; this.D = 10;
} else { } else {

View File

@ -41,8 +41,8 @@ public class EntityItem extends Entity {
protected void b() {} protected void b() {}
public void o_() { public void m_() {
super.o_(); super.m_();
// CraftBukkit start // CraftBukkit start
int currentTick = (int) (System.currentTimeMillis() / 50); int currentTick = (int) (System.currentTimeMillis() / 50);
this.pickupDelay -= (currentTick - this.lastTick); this.pickupDelay -= (currentTick - this.lastTick);
@ -96,7 +96,7 @@ public class EntityItem extends Entity {
} }
public boolean damageEntity(Entity entity, int i) { public boolean damageEntity(Entity entity, int i) {
this.ae(); this.af();
this.f -= i; this.f -= i;
if (this.f <= 0) { if (this.f <= 0) {
this.die(); this.die();

View File

@ -80,10 +80,10 @@ public abstract class EntityLiving extends Entity {
protected void b() {} protected void b() {}
public boolean e(Entity entity) { public boolean e(Entity entity) {
return this.world.a(Vec3D.create(this.locX, this.locY + (double) this.s(), this.locZ), Vec3D.create(entity.locX, entity.locY + (double) entity.s(), entity.locZ)) == null; return this.world.a(Vec3D.create(this.locX, this.locY + (double) this.t(), this.locZ), Vec3D.create(entity.locX, entity.locY + (double) entity.t(), entity.locZ)) == null;
} }
public boolean n_() { public boolean l_() {
return !this.dead; return !this.dead;
} }
@ -91,7 +91,7 @@ public abstract class EntityLiving extends Entity {
return !this.dead; return !this.dead;
} }
public float s() { public float t() {
return this.width * 0.85F; return this.width * 0.85F;
} }
@ -99,7 +99,7 @@ public abstract class EntityLiving extends Entity {
return 80; return 80;
} }
public void P() { public void Q() {
String s = this.g(); String s = this.g();
if (s != null) { if (s != null) {
@ -107,15 +107,15 @@ public abstract class EntityLiving extends Entity {
} }
} }
public void Q() { public void R() {
this.Z = this.aa; this.Z = this.aa;
super.Q(); super.R();
if (this.random.nextInt(1000) < this.a++) { if (this.random.nextInt(1000) < this.a++) {
this.a = -this.e(); this.a = -this.e();
this.P(); this.Q();
} }
if (this.S() && this.J()) { if (this.T() && this.K()) {
// CraftBukkit start // CraftBukkit start
EntityDamageEvent event = new EntityDamageEvent(this.getBukkitEntity(), EntityDamageEvent.DamageCause.SUFFOCATION, 1); EntityDamageEvent event = new EntityDamageEvent(this.getBukkitEntity(), EntityDamageEvent.DamageCause.SUFFOCATION, 1);
this.world.getServer().getPluginManager().callEvent(event); this.world.getServer().getPluginManager().callEvent(event);
@ -132,7 +132,7 @@ public abstract class EntityLiving extends Entity {
int i; int i;
if (this.S() && this.a(Material.WATER) && !this.b_()) { if (this.T() && this.a(Material.WATER) && !this.b_()) {
--this.airTicks; --this.airTicks;
if (this.airTicks == -20) { if (this.airTicks == -20) {
this.airTicks = 0; this.airTicks = 0;
@ -176,7 +176,7 @@ public abstract class EntityLiving extends Entity {
if (this.health <= 0) { if (this.health <= 0) {
++this.deathTicks; ++this.deathTicks;
if (this.deathTicks > 20) { if (this.deathTicks > 20) {
this.W(); this.X();
this.die(); this.die();
for (i = 0; i < 20; ++i) { for (i = 0; i < 20; ++i) {
@ -195,7 +195,7 @@ public abstract class EntityLiving extends Entity {
this.lastPitch = this.pitch; this.lastPitch = this.pitch;
} }
public void R() { public void S() {
for (int i = 0; i < 20; ++i) { for (int i = 0; i < 20; ++i) {
double d0 = this.random.nextGaussian() * 0.02D; double d0 = this.random.nextGaussian() * 0.02D;
double d1 = this.random.nextGaussian() * 0.02D; double d1 = this.random.nextGaussian() * 0.02D;
@ -206,15 +206,15 @@ public abstract class EntityLiving extends Entity {
} }
} }
public void D() { public void E() {
super.D(); super.E();
this.M = this.N; this.M = this.N;
this.N = 0.0F; this.N = 0.0F;
} }
public void o_() { public void m_() {
super.o_(); super.m_();
this.u(); this.v();
double d0 = this.locX - this.lastX; double d0 = this.locX - this.lastX;
double d1 = this.locZ - this.lastZ; double d1 = this.locZ - this.lastZ;
float f = MathHelper.a(d0 * d0 + d1 * d1); float f = MathHelper.a(d0 * d0 + d1 * d1);
@ -361,7 +361,7 @@ public abstract class EntityLiving extends Entity {
this.af = 0.0F; this.af = 0.0F;
if (flag) { if (flag) {
this.world.a(this, (byte) 2); this.world.a(this, (byte) 2);
this.ae(); this.af();
if (entity != null) { if (entity != null) {
double d0 = entity.locX - this.locX; double d0 = entity.locX - this.locX;
@ -439,13 +439,13 @@ public abstract class EntityLiving extends Entity {
this.ak = true; this.ak = true;
if (!this.world.isStatic) { if (!this.world.isStatic) {
this.r(); this.q();
} }
this.world.a(this, (byte) 3); this.world.a(this, (byte) 3);
} }
protected void r() { protected void q() {
int i = this.j(); int i = this.j();
// CraftBukkit start - whole method // CraftBukkit start - whole method
@ -498,7 +498,7 @@ public abstract class EntityLiving extends Entity {
public void a(float f, float f1) { public void a(float f, float f1) {
double d0; double d0;
if (this.ac()) { if (this.ad()) {
d0 = this.locY; d0 = this.locY;
this.a(f, f1, 0.02F); this.a(f, f1, 0.02F);
this.move(this.motX, this.motY, this.motZ); this.move(this.motX, this.motY, this.motZ);
@ -509,7 +509,7 @@ public abstract class EntityLiving extends Entity {
if (this.positionChanged && this.b(this.motX, this.motY + 0.6000000238418579D - this.locY + d0, this.motZ)) { if (this.positionChanged && this.b(this.motX, this.motY + 0.6000000238418579D - this.locY + d0, this.motZ)) {
this.motY = 0.30000001192092896D; this.motY = 0.30000001192092896D;
} }
} else if (this.ad()) { } else if (this.ae()) {
d0 = this.locY; d0 = this.locY;
this.a(f, f1, 0.02F); this.a(f, f1, 0.02F);
this.move(this.motX, this.motY, this.motZ); this.move(this.motX, this.motY, this.motZ);
@ -624,7 +624,7 @@ public abstract class EntityLiving extends Entity {
this.attackTicks = nbttagcompound.d("AttackTime"); this.attackTicks = nbttagcompound.d("AttackTime");
} }
public boolean S() { public boolean T() {
return !this.dead && this.health > 0; return !this.dead && this.health > 0;
} }
@ -632,7 +632,7 @@ public abstract class EntityLiving extends Entity {
return false; return false;
} }
public void u() { public void v() {
if (this.aq > 0) { if (this.aq > 0) {
double d0 = this.locX + (this.ar - this.locX) / (double) this.aq; double d0 = this.locX + (this.ar - this.locX) / (double) this.aq;
double d1 = this.locY + (this.as - this.locY) / (double) this.aq; double d1 = this.locY + (this.as - this.locY) / (double) this.aq;
@ -671,7 +671,7 @@ public abstract class EntityLiving extends Entity {
} }
} }
if (this.C()) { if (this.D()) {
this.aC = false; this.aC = false;
this.az = 0.0F; this.az = 0.0F;
this.aA = 0.0F; this.aA = 0.0F;
@ -680,8 +680,8 @@ public abstract class EntityLiving extends Entity {
this.c_(); this.c_();
} }
boolean flag = this.ac(); boolean flag = this.ad();
boolean flag1 = this.ad(); boolean flag1 = this.ae();
if (this.aC) { if (this.aC) {
if (flag) { if (flag) {
@ -689,7 +689,7 @@ public abstract class EntityLiving extends Entity {
} else if (flag1) { } else if (flag1) {
this.motY += 0.03999999910593033D; this.motY += 0.03999999910593033D;
} else if (this.onGround) { } else if (this.onGround) {
this.N(); this.O();
} }
} }
@ -710,22 +710,22 @@ public abstract class EntityLiving extends Entity {
} }
} }
protected boolean C() { protected boolean D() {
return this.health <= 0; return this.health <= 0;
} }
protected void N() { protected void O() {
this.motY = 0.41999998688697815D; this.motY = 0.41999998688697815D;
} }
protected boolean l_() { protected boolean h_() {
return true; return true;
} }
protected void T() { protected void U() {
EntityHuman entityhuman = this.world.findNearbyPlayer(this, -1.0D); EntityHuman entityhuman = this.world.findNearbyPlayer(this, -1.0D);
if (this.l_() && entityhuman != null) { if (this.h_() && entityhuman != null) {
double d0 = entityhuman.locX - this.locX; double d0 = entityhuman.locX - this.locX;
double d1 = entityhuman.locY - this.locY; double d1 = entityhuman.locY - this.locY;
double d2 = entityhuman.locZ - this.locZ; double d2 = entityhuman.locZ - this.locZ;
@ -749,7 +749,7 @@ public abstract class EntityLiving extends Entity {
++this.ay; ++this.ay;
EntityHuman entityhuman = this.world.findNearbyPlayer(this, -1.0D); EntityHuman entityhuman = this.world.findNearbyPlayer(this, -1.0D);
this.T(); this.U();
this.az = 0.0F; this.az = 0.0F;
this.aA = 0.0F; this.aA = 0.0F;
float f = 8.0F; float f = 8.0F;
@ -765,7 +765,7 @@ public abstract class EntityLiving extends Entity {
} }
if (this.b != null) { if (this.b != null) {
this.a(this.b, 10.0F, (float) this.v()); this.a(this.b, 10.0F, (float) this.u());
if (this.aF-- <= 0 || this.b.dead || this.b.g(this) > (double) (f * f)) { if (this.aF-- <= 0 || this.b.dead || this.b.g(this) > (double) (f * f)) {
this.b = null; this.b = null;
} }
@ -778,15 +778,15 @@ public abstract class EntityLiving extends Entity {
this.pitch = this.aD; this.pitch = this.aD;
} }
boolean flag = this.ac(); boolean flag = this.ad();
boolean flag1 = this.ad(); boolean flag1 = this.ae();
if (flag || flag1) { if (flag || flag1) {
this.aC = this.random.nextFloat() < 0.8F; this.aC = this.random.nextFloat() < 0.8F;
} }
} }
protected int v() { protected int u() {
return 40; return 40;
} }
@ -798,9 +798,9 @@ public abstract class EntityLiving extends Entity {
if (entity instanceof EntityLiving) { if (entity instanceof EntityLiving) {
EntityLiving entityliving = (EntityLiving) entity; EntityLiving entityliving = (EntityLiving) entity;
d2 = this.locY + (double) this.s() - (entityliving.locY + (double) entityliving.s()); d2 = this.locY + (double) this.t() - (entityliving.locY + (double) entityliving.t());
} else { } else {
d2 = (entity.boundingBox.b + entity.boundingBox.e) / 2.0D - (this.locY + (double) this.s()); d2 = (entity.boundingBox.b + entity.boundingBox.e) / 2.0D - (this.locY + (double) this.t());
} }
double d3 = (double) MathHelper.a(d0 * d0 + d1 * d1); double d3 = (double) MathHelper.a(d0 * d0 + d1 * d1);
@ -811,11 +811,11 @@ public abstract class EntityLiving extends Entity {
this.yaw = this.b(this.yaw, f2, f); this.yaw = this.b(this.yaw, f2, f);
} }
public boolean U() { public boolean V() {
return this.b != null; return this.b != null;
} }
public Entity V() { public Entity W() {
return this.b; return this.b;
} }
@ -841,13 +841,13 @@ public abstract class EntityLiving extends Entity {
return f + f3; return f + f3;
} }
public void W() {} public void X() {}
public boolean d() { public boolean d() {
return this.world.containsEntity(this.boundingBox) && this.world.getEntities(this, this.boundingBox).size() == 0 && !this.world.c(this.boundingBox); return this.world.containsEntity(this.boundingBox) && this.world.getEntities(this, this.boundingBox).size() == 0 && !this.world.c(this.boundingBox);
} }
protected void X() { protected void Y() {
// CraftBukkit start // CraftBukkit start
EntityDamageByBlockEvent event = new EntityDamageByBlockEvent(null, this.getBukkitEntity(), EntityDamageEvent.DamageCause.VOID, 4); EntityDamageByBlockEvent event = new EntityDamageByBlockEvent(null, this.getBukkitEntity(), EntityDamageEvent.DamageCause.VOID, 4);
this.world.getServer().getPluginManager().callEvent(event); this.world.getServer().getPluginManager().callEvent(event);
@ -860,7 +860,7 @@ public abstract class EntityLiving extends Entity {
// CraftBukkit end // CraftBukkit end
} }
public Vec3D Y() { public Vec3D Z() {
return this.b(1.0F); return this.b(1.0F);
} }

View File

@ -114,7 +114,7 @@ public class EntityMinecart extends Entity implements IInventory {
this.c = -this.c; this.c = -this.c;
this.b = 10; this.b = 10;
this.ae(); this.af();
this.damage += i * 10; this.damage += i * 10;
if (this.damage > 40) { if (this.damage > 40) {
if (this.passenger != null) { if (this.passenger != null) {
@ -175,7 +175,7 @@ public class EntityMinecart extends Entity implements IInventory {
} }
} }
public boolean n_() { public boolean l_() {
return !this.dead; return !this.dead;
} }
@ -210,7 +210,7 @@ public class EntityMinecart extends Entity implements IInventory {
super.die(); super.die();
} }
public void o_() { public void m_() {
// CraftBukkit start // CraftBukkit start
double prevX = this.locX; double prevX = this.locX;
double prevY = this.locY; double prevY = this.locY;
@ -476,15 +476,15 @@ public class EntityMinecart extends Entity implements IInventory {
this.motX += this.motX / d20 * d21; this.motX += this.motX / d20 * d21;
this.motZ += this.motZ / d20 * d21; this.motZ += this.motZ / d20 * d21;
} else if (i1 == 1) { } else if (i1 == 1) {
if (this.world.d(i - 1, j, k)) { if (this.world.e(i - 1, j, k)) {
this.motX = 0.02D; this.motX = 0.02D;
} else if (this.world.d(i + 1, j, k)) { } else if (this.world.e(i + 1, j, k)) {
this.motX = -0.02D; this.motX = -0.02D;
} }
} else if (i1 == 0) { } else if (i1 == 0) {
if (this.world.d(i, j, k - 1)) { if (this.world.e(i, j, k - 1)) {
this.motZ = 0.02D; this.motZ = 0.02D;
} else if (this.world.d(i, j, k + 1)) { } else if (this.world.e(i, j, k + 1)) {
this.motZ = -0.02D; this.motZ = -0.02D;
} }
} }

View File

@ -16,18 +16,18 @@ public class EntityMonster extends EntityCreature implements IMonster {
this.health = 20; this.health = 20;
} }
public void u() { public void v() {
float f = this.c(1.0F); float f = this.c(1.0F);
if (f > 0.5F) { if (f > 0.5F) {
this.ay += 2; this.ay += 2;
} }
super.u(); super.v();
} }
public void o_() { public void m_() {
super.o_(); super.m_();
if (!this.world.isStatic && this.world.spawnMonsters == 0) { if (!this.world.isStatic && this.world.spawnMonsters == 0) {
this.die(); this.die();
} }
@ -92,7 +92,7 @@ public class EntityMonster extends EntityCreature implements IMonster {
} }
protected float a(int i, int j, int k) { protected float a(int i, int j, int k) {
return 0.5F - this.world.m(i, j, k); return 0.5F - this.world.n(i, j, k);
} }
public void b(NBTTagCompound nbttagcompound) { public void b(NBTTagCompound nbttagcompound) {

View File

@ -117,7 +117,7 @@ public class EntityPainting extends Entity {
return i == 32 ? 0.5F : (i == 64 ? 0.5F : 0.0F); return i == 32 ? 0.5F : (i == 64 ? 0.5F : 0.0F);
} }
public void o_() { public void m_() {
if (this.f++ == 100 && !this.world.isStatic) { if (this.f++ == 100 && !this.world.isStatic) {
this.f = 0; this.f = 0;
if (!this.h()) { if (!this.h()) {
@ -194,7 +194,7 @@ public class EntityPainting extends Entity {
} }
} }
public boolean n_() { public boolean l_() {
return true; return true;
} }
@ -210,7 +210,7 @@ public class EntityPainting extends Entity {
// CraftBukkit end // CraftBukkit end
this.die(); this.die();
this.ae(); this.af();
this.world.addEntity(new EntityItem(this.world, this.locX, this.locY, this.locZ, new ItemStack(Item.PAINTING))); this.world.addEntity(new EntityItem(this.world, this.locX, this.locY, this.locZ, new ItemStack(Item.PAINTING)));
} }

View File

@ -21,13 +21,13 @@ public class EntityPigZombie extends EntityZombie {
this.fireProof = true; this.fireProof = true;
} }
public void o_() { public void m_() {
this.aE = this.target != null ? 0.95F : 0.5F; this.aE = this.target != null ? 0.95F : 0.5F;
if (this.soundDelay > 0 && --this.soundDelay == 0) { if (this.soundDelay > 0 && --this.soundDelay == 0) {
this.world.makeSound(this, "mob.zombiepig.zpigangry", this.k() * 2.0F, ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F) * 1.8F); this.world.makeSound(this, "mob.zombiepig.zpigangry", this.k() * 2.0F, ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F) * 1.8F);
} }
super.o_(); super.m_();
} }
public boolean d() { public boolean d() {
@ -48,8 +48,8 @@ public class EntityPigZombie extends EntityZombie {
return this.angerLevel == 0 ? null : super.findTarget(); return this.angerLevel == 0 ? null : super.findTarget();
} }
public void u() { public void v() {
super.u(); super.v();
} }
public boolean damageEntity(Entity entity, int i) { public boolean damageEntity(Entity entity, int i) {

View File

@ -21,10 +21,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public double e; public double e;
public List chunkCoordIntPairQueue = new LinkedList(); public List chunkCoordIntPairQueue = new LinkedList();
public Set playerChunkCoordIntPairs = new HashSet(); public Set playerChunkCoordIntPairs = new HashSet();
private int bK = -99999999; private int bL = -99999999;
private int bL = 60; private int bM = 60;
private ItemStack[] bM = new ItemStack[] { null, null, null, null, null}; private ItemStack[] bN = new ItemStack[] { null, null, null, null, null};
private int bN = 0; private int bO = 0;
public boolean h; public boolean h;
public EntityPlayer(MinecraftServer minecraftserver, World world, String s, ItemInWorldManager iteminworldmanager) { public EntityPlayer(MinecraftServer minecraftserver, World world, String s, ItemInWorldManager iteminworldmanager) {
@ -87,33 +87,33 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
} }
public ItemStack[] getEquipment() { public ItemStack[] getEquipment() {
return this.bM; return this.bN;
} }
protected void j_() { protected void s() {
this.height = 0.0F; this.height = 0.0F;
} }
public float s() { public float t() {
return 1.62F; return 1.62F;
} }
public void o_() { public void m_() {
this.itemInWorldManager.a(); this.itemInWorldManager.a();
--this.bL; --this.bM;
this.activeContainer.a(); this.activeContainer.a();
for (int i = 0; i < 5; ++i) { for (int i = 0; i < 5; ++i) {
ItemStack itemstack = this.b_(i); ItemStack itemstack = this.c_(i);
if (itemstack != this.bM[i]) { if (itemstack != this.bN[i]) {
this.b.getTracker(this.dimension).a(this, new Packet5EntityEquipment(this.id, i, itemstack)); this.b.getTracker(this.dimension).a(this, new Packet5EntityEquipment(this.id, i, itemstack));
this.bM[i] = itemstack; this.bN[i] = itemstack;
} }
} }
} }
public ItemStack b_(int i) { public ItemStack c_(int i) {
return i == 0 ? this.inventory.getItemInHand() : this.inventory.armor[i - 1]; return i == 0 ? this.inventory.getItemInHand() : this.inventory.armor[i - 1];
} }
@ -152,12 +152,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
bworld.dropItemNaturally(bukkitEntity.getLocation(), stack); bworld.dropItemNaturally(bukkitEntity.getLocation(), stack);
} }
this.x(); this.y();
// CraftBukkit end // CraftBukkit end
} }
public boolean damageEntity(Entity entity, int i) { public boolean damageEntity(Entity entity, int i) {
if (this.bL > 0) { if (this.bM > 0) {
return false; return false;
} else { } else {
// CraftBukkit - this.b.pvpMode -> this.world.pvpMode // CraftBukkit - this.b.pvpMode -> this.world.pvpMode
@ -179,7 +179,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
} }
} }
protected boolean t() { protected boolean j_() {
return this.b.pvpMode; return this.b.pvpMode;
} }
@ -188,7 +188,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
} }
public void a(boolean flag) { public void a(boolean flag) {
super.o_(); super.m_();
for (int i = 0; i < this.inventory.getSize(); ++i) { for (int i = 0; i < this.inventory.getSize(); ++i) {
ItemStack itemstack = this.inventory.getItem(i); ItemStack itemstack = this.inventory.getItem(i);
@ -228,6 +228,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
if (this.E) { if (this.E) {
if (this.b.propertyManager.getBoolean("allow-nether", true)) { if (this.b.propertyManager.getBoolean("allow-nether", true)) {
if (this.activeContainer != this.defaultContainer) {
this.y();
}
if (this.vehicle != null) { if (this.vehicle != null) {
this.mount(this.vehicle); this.mount(this.vehicle);
} else { } else {
@ -255,15 +259,15 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
--this.D; --this.D;
} }
if (this.health != this.bK) { if (this.health != this.bL) {
this.netServerHandler.sendPacket(new Packet8UpdateHealth(this.health)); this.netServerHandler.sendPacket(new Packet8UpdateHealth(this.health));
this.bK = this.health; this.bL = this.health;
} }
} }
private void a(TileEntity tileentity) { private void a(TileEntity tileentity) {
if (tileentity != null) { if (tileentity != null) {
Packet packet = tileentity.e(); Packet packet = tileentity.f();
if (packet != null) { if (packet != null) {
this.netServerHandler.sendPacket(packet); this.netServerHandler.sendPacket(packet);
@ -271,8 +275,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
} }
} }
public void u() { public void v() {
super.u(); super.v();
} }
public void receive(Entity entity, int i) { public void receive(Entity entity, int i) {
@ -292,7 +296,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.activeContainer.a(); this.activeContainer.a();
} }
public void k_() { public void w() {
if (!this.p) { if (!this.p) {
this.q = -1; this.q = -1;
this.p = true; this.p = true;
@ -302,7 +306,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
} }
} }
public void w() {} public void x() {}
public EnumBedError a(int i, int j, int k) { public EnumBedError a(int i, int j, int k) {
EnumBedError enumbederror = super.a(i, j, k); EnumBedError enumbederror = super.a(i, j, k);
@ -354,39 +358,39 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
super.a(d0, flag); super.a(d0, flag);
} }
private void ah() { private void ai() {
this.bN = this.bN % 100 + 1; this.bO = this.bO % 100 + 1;
} }
public void b(int i, int j, int k) { public void b(int i, int j, int k) {
this.ah(); this.ai();
this.netServerHandler.sendPacket(new Packet100OpenWindow(this.bN, 1, "Crafting", 9)); this.netServerHandler.sendPacket(new Packet100OpenWindow(this.bO, 1, "Crafting", 9));
this.activeContainer = new ContainerWorkbench(this.inventory, this.world, i, j, k); this.activeContainer = new ContainerWorkbench(this.inventory, this.world, i, j, k);
this.activeContainer.windowId = this.bN; this.activeContainer.windowId = this.bO;
this.activeContainer.a((ICrafting) this); this.activeContainer.a((ICrafting) this);
} }
public void a(IInventory iinventory) { public void a(IInventory iinventory) {
this.ah(); this.ai();
this.netServerHandler.sendPacket(new Packet100OpenWindow(this.bN, 0, iinventory.getName(), iinventory.getSize())); this.netServerHandler.sendPacket(new Packet100OpenWindow(this.bO, 0, iinventory.getName(), iinventory.getSize()));
this.activeContainer = new ContainerChest(this.inventory, iinventory); this.activeContainer = new ContainerChest(this.inventory, iinventory);
this.activeContainer.windowId = this.bN; this.activeContainer.windowId = this.bO;
this.activeContainer.a((ICrafting) this); this.activeContainer.a((ICrafting) this);
} }
public void a(TileEntityFurnace tileentityfurnace) { public void a(TileEntityFurnace tileentityfurnace) {
this.ah(); this.ai();
this.netServerHandler.sendPacket(new Packet100OpenWindow(this.bN, 2, tileentityfurnace.getName(), tileentityfurnace.getSize())); this.netServerHandler.sendPacket(new Packet100OpenWindow(this.bO, 2, tileentityfurnace.getName(), tileentityfurnace.getSize()));
this.activeContainer = new ContainerFurnace(this.inventory, tileentityfurnace); this.activeContainer = new ContainerFurnace(this.inventory, tileentityfurnace);
this.activeContainer.windowId = this.bN; this.activeContainer.windowId = this.bO;
this.activeContainer.a((ICrafting) this); this.activeContainer.a((ICrafting) this);
} }
public void a(TileEntityDispenser tileentitydispenser) { public void a(TileEntityDispenser tileentitydispenser) {
this.ah(); this.ai();
this.netServerHandler.sendPacket(new Packet100OpenWindow(this.bN, 3, tileentitydispenser.getName(), tileentitydispenser.getSize())); this.netServerHandler.sendPacket(new Packet100OpenWindow(this.bO, 3, tileentitydispenser.getName(), tileentitydispenser.getSize()));
this.activeContainer = new ContainerDispenser(this.inventory, tileentitydispenser); this.activeContainer = new ContainerDispenser(this.inventory, tileentitydispenser);
this.activeContainer.windowId = this.bN; this.activeContainer.windowId = this.bO;
this.activeContainer.a((ICrafting) this); this.activeContainer.a((ICrafting) this);
} }
@ -413,18 +417,18 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public void a(ItemStack itemstack) {} public void a(ItemStack itemstack) {}
public void x() { public void y() {
this.netServerHandler.sendPacket(new Packet101CloseWindow(this.activeContainer.windowId)); this.netServerHandler.sendPacket(new Packet101CloseWindow(this.activeContainer.windowId));
this.z(); this.A();
} }
public void y() { public void z() {
if (!this.h) { if (!this.h) {
this.netServerHandler.sendPacket(new Packet103SetSlot(-1, -1, this.inventory.j())); this.netServerHandler.sendPacket(new Packet103SetSlot(-1, -1, this.inventory.j()));
} }
} }
public void z() { public void A() {
this.activeContainer.a((EntityHuman) this); this.activeContainer.a((EntityHuman) this);
this.activeContainer = this.defaultContainer; this.activeContainer = this.defaultContainer;
} }
@ -451,7 +455,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
} }
} }
public void A() { public void B() {
if (this.vehicle != null) { if (this.vehicle != null) {
this.mount(this.vehicle); this.mount(this.vehicle);
} }
@ -465,8 +469,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
} }
} }
public void B() { public void C() {
this.bK = -99999999; this.bL = -99999999;
} }
public void a(String s) { public void a(String s) {

View File

@ -26,7 +26,7 @@ public class EntitySkeleton extends EntityMonster {
return "mob.skeletonhurt"; return "mob.skeletonhurt";
} }
public void u() { public void v() {
if (this.world.d()) { if (this.world.d()) {
float f = this.c(1.0F); float f = this.c(1.0F);
@ -42,7 +42,7 @@ public class EntitySkeleton extends EntityMonster {
} }
} }
super.u(); super.v();
} }
protected void a(Entity entity, float f) { protected void a(Entity entity, float f) {
@ -54,7 +54,7 @@ public class EntitySkeleton extends EntityMonster {
EntityArrow entityarrow = new EntityArrow(this.world, this); EntityArrow entityarrow = new EntityArrow(this.world, this);
++entityarrow.locY; ++entityarrow.locY;
double d2 = entity.locY + (double) entity.s() - 0.20000000298023224D - entityarrow.locY; double d2 = entity.locY + (double) entity.t() - 0.20000000298023224D - entityarrow.locY;
float f1 = MathHelper.a(d0 * d0 + d1 * d1) * 0.2F; float f1 = MathHelper.a(d0 * d0 + d1 * d1) * 0.2F;
this.world.makeSound(this, "random.bow", 1.0F, 1.0F / (this.random.nextFloat() * 0.4F + 0.8F)); this.world.makeSound(this, "random.bow", 1.0F, 1.0F / (this.random.nextFloat() * 0.4F + 0.8F));
@ -80,7 +80,7 @@ public class EntitySkeleton extends EntityMonster {
return Item.ARROW.id; return Item.ARROW.id;
} }
protected void r() { protected void q() {
// CraftBukkit start - whole method // CraftBukkit start - whole method
java.util.List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>(); java.util.List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>();

View File

@ -32,7 +32,7 @@ public class EntitySnowball extends Entity {
super(world); super(world);
this.shooter = entityliving; this.shooter = entityliving;
this.b(0.25F, 0.25F); this.b(0.25F, 0.25F);
this.setPositionRotation(entityliving.locX, entityliving.locY + (double) entityliving.s(), entityliving.locZ, entityliving.yaw, entityliving.pitch); this.setPositionRotation(entityliving.locX, entityliving.locY + (double) entityliving.t(), entityliving.locZ, entityliving.yaw, entityliving.pitch);
this.locX -= (double) (MathHelper.cos(this.yaw / 180.0F * 3.1415927F) * 0.16F); this.locX -= (double) (MathHelper.cos(this.yaw / 180.0F * 3.1415927F) * 0.16F);
this.locY -= 0.10000000149011612D; this.locY -= 0.10000000149011612D;
this.locZ -= (double) (MathHelper.sin(this.yaw / 180.0F * 3.1415927F) * 0.16F); this.locZ -= (double) (MathHelper.sin(this.yaw / 180.0F * 3.1415927F) * 0.16F);
@ -76,11 +76,11 @@ public class EntitySnowball extends Entity {
this.h = 0; this.h = 0;
} }
public void o_() { public void m_() {
this.bo = this.locX; this.bo = this.locX;
this.bp = this.locY; this.bp = this.locY;
this.bq = this.locZ; this.bq = this.locZ;
super.o_(); super.m_();
if (this.a > 0) { if (this.a > 0) {
--this.a; --this.a;
} }
@ -125,7 +125,7 @@ public class EntitySnowball extends Entity {
for (int j = 0; j < list.size(); ++j) { for (int j = 0; j < list.size(); ++j) {
Entity entity1 = (Entity) list.get(j); Entity entity1 = (Entity) list.get(j);
if (entity1.n_() && (entity1 != this.shooter || this.i >= 5)) { if (entity1.l_() && (entity1 != this.shooter || this.i >= 5)) {
float f = 0.3F; float f = 0.3F;
AxisAlignedBB axisalignedbb = entity1.boundingBox.b((double) f, (double) f, (double) f); AxisAlignedBB axisalignedbb = entity1.boundingBox.b((double) f, (double) f, (double) f);
MovingObjectPosition movingobjectposition1 = axisalignedbb.a(vec3d, vec3d1); MovingObjectPosition movingobjectposition1 = axisalignedbb.a(vec3d, vec3d1);
@ -209,7 +209,7 @@ public class EntitySnowball extends Entity {
float f2 = 0.99F; float f2 = 0.99F;
float f3 = 0.03F; float f3 = 0.03F;
if (this.ac()) { if (this.ad()) {
for (int l = 0; l < 4; ++l) { for (int l = 0; l < 4; ++l) {
float f4 = 0.25F; float f4 = 0.25F;

View File

@ -54,7 +54,7 @@ public class EntitySquid extends EntityWaterAnimal {
return 0; return 0;
} }
protected void r() { protected void q() {
// CraftBukkit start - whole method // CraftBukkit start - whole method
java.util.List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>(); java.util.List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>();
@ -79,12 +79,12 @@ public class EntitySquid extends EntityWaterAnimal {
return false; return false;
} }
public boolean ac() { public boolean ad() {
return this.world.a(this.boundingBox.b(0.0D, -0.6000000238418579D, 0.0D), Material.WATER, this); return this.world.a(this.boundingBox.b(0.0D, -0.6000000238418579D, 0.0D), Material.WATER, this);
} }
public void u() { public void v() {
super.u(); super.v();
this.b = this.a; this.b = this.a;
this.f = this.c; this.f = this.c;
this.h = this.g; this.h = this.g;
@ -97,7 +97,7 @@ public class EntitySquid extends EntityWaterAnimal {
} }
} }
if (this.ac()) { if (this.ad()) {
float f; float f;
if (this.g < 3.1415927F) { if (this.g < 3.1415927F) {
@ -151,5 +151,7 @@ public class EntitySquid extends EntityWaterAnimal {
this.o = -0.1F + this.random.nextFloat() * 0.2F; this.o = -0.1F + this.random.nextFloat() * 0.2F;
this.p = MathHelper.sin(f) * 0.2F; this.p = MathHelper.sin(f) * 0.2F;
} }
this.U();
} }
} }

View File

@ -41,11 +41,11 @@ public class EntityTNTPrimed extends Entity {
return false; return false;
} }
public boolean n_() { public boolean l_() {
return !this.dead; return !this.dead;
} }
public void o_() { public void m_() {
this.lastX = this.locX; this.lastX = this.locX;
this.lastY = this.locY; this.lastY = this.locY;
this.lastZ = this.locZ; this.lastZ = this.locZ;

View File

@ -108,7 +108,7 @@ public class EntityTrackerEntry {
this.a((Packet) object); this.a((Packet) object);
} }
DataWatcher datawatcher = this.tracker.Z(); DataWatcher datawatcher = this.tracker.aa();
if (datawatcher.a()) { if (datawatcher.a()) {
this.b((Packet) (new Packet40EntityMetadata(this.tracker.id, datawatcher))); this.b((Packet) (new Packet40EntityMetadata(this.tracker.id, datawatcher)));

View File

@ -72,8 +72,8 @@ public class EntityWeatherStorm extends EntityWeather {
} }
} }
public void o_() { public void m_() {
super.o_(); super.m_();
if (this.lifeTicks == 2) { if (this.lifeTicks == 2) {
this.world.makeSound(this.locX, this.locY, this.locZ, "ambient.weather.thunder", 10000.0F, 0.8F + this.random.nextFloat() * 0.2F); this.world.makeSound(this.locX, this.locY, this.locZ, "ambient.weather.thunder", 10000.0F, 0.8F + this.random.nextFloat() * 0.2F);
this.world.makeSound(this.locX, this.locY, this.locZ, "random.explode", 2.0F, 0.5F + this.random.nextFloat() * 0.2F); this.world.makeSound(this.locX, this.locY, this.locZ, "random.explode", 2.0F, 0.5F + this.random.nextFloat() * 0.2F);

View File

@ -63,7 +63,7 @@ public class EntityWolf extends EntityAnimal {
} }
} }
protected boolean l_() { protected boolean h_() {
return !this.isTamed(); return !this.isTamed();
} }
@ -89,7 +89,7 @@ public class EntityWolf extends EntityAnimal {
protected void c_() { protected void c_() {
super.c_(); super.c_();
if (!this.e && !this.B() && this.isTamed() && this.vehicle == null) { if (!this.e && !this.C() && this.isTamed() && this.vehicle == null) {
EntityHuman entityhuman = this.world.a(this.getOwnerName()); EntityHuman entityhuman = this.world.a(this.getOwnerName());
if (entityhuman != null) { if (entityhuman != null) {
@ -98,10 +98,10 @@ public class EntityWolf extends EntityAnimal {
if (f > 5.0F) { if (f > 5.0F) {
this.c(entityhuman, f); this.c(entityhuman, f);
} }
} else if (!this.ac()) { } else if (!this.ad()) {
this.setSitting(true); this.setSitting(true);
} }
} else if (this.target == null && !this.B() && !this.isTamed() && this.world.random.nextInt(100) == 0) { } else if (this.target == null && !this.C() && !this.isTamed() && this.world.random.nextInt(100) == 0) {
List list = this.world.a(EntitySheep.class, AxisAlignedBB.b(this.locX, this.locY, this.locZ, this.locX + 1.0D, this.locY + 1.0D, this.locZ + 1.0D).b(16.0D, 4.0D, 16.0D)); List list = this.world.a(EntitySheep.class, AxisAlignedBB.b(this.locX, this.locY, this.locZ, this.locX + 1.0D, this.locY + 1.0D, this.locZ + 1.0D).b(16.0D, 4.0D, 16.0D));
if (!list.isEmpty()) { if (!list.isEmpty()) {
@ -119,7 +119,7 @@ public class EntityWolf extends EntityAnimal {
} }
} }
if (this.ac()) { if (this.ad()) {
this.setSitting(false); this.setSitting(false);
} }
@ -128,11 +128,11 @@ public class EntityWolf extends EntityAnimal {
} }
} }
public void u() { public void v() {
super.u(); super.v();
this.a = false; this.a = false;
if (this.U() && !this.B() && !this.isAngry()) { if (this.V() && !this.C() && !this.isAngry()) {
Entity entity = this.V(); Entity entity = this.W();
if (entity instanceof EntityHuman) { if (entity instanceof EntityHuman) {
EntityHuman entityhuman = (EntityHuman) entity; EntityHuman entityhuman = (EntityHuman) entity;
@ -148,7 +148,7 @@ public class EntityWolf extends EntityAnimal {
} }
} }
if (!this.Y && this.f && !this.g && !this.B() && this.onGround) { if (!this.Y && this.f && !this.g && !this.C() && this.onGround) {
this.g = true; this.g = true;
this.h = 0.0F; this.h = 0.0F;
this.i = 0.0F; this.i = 0.0F;
@ -156,8 +156,8 @@ public class EntityWolf extends EntityAnimal {
} }
} }
public void o_() { public void m_() {
super.o_(); super.m_();
this.c = this.b; this.c = this.b;
if (this.a) { if (this.a) {
this.b += (1.0F - this.b) * 0.4F; this.b += (1.0F - this.b) * 0.4F;
@ -169,7 +169,7 @@ public class EntityWolf extends EntityAnimal {
this.aF = 10; this.aF = 10;
} }
if (this.ab()) { if (this.ac()) {
this.f = true; this.f = true;
this.g = false; this.g = false;
this.h = 0.0F; this.h = 0.0F;
@ -202,12 +202,12 @@ public class EntityWolf extends EntityAnimal {
} }
} }
public float s() { public float t() {
return this.width * 0.8F; return this.width * 0.8F;
} }
protected int v() { protected int u() {
return this.isSitting() ? 20 : super.v(); return this.isSitting() ? 20 : super.u();
} }
private void c(Entity entity, float f) { private void c(Entity entity, float f) {
@ -220,7 +220,7 @@ public class EntityWolf extends EntityAnimal {
for (int l = 0; l <= 4; ++l) { for (int l = 0; l <= 4; ++l) {
for (int i1 = 0; i1 <= 4; ++i1) { for (int i1 = 0; i1 <= 4; ++i1) {
if ((l < 1 || i1 < 1 || l > 3 || i1 > 3) && this.world.d(i + l, k - 1, j + i1) && !this.world.d(i + l, k, j + i1) && !this.world.d(i + l, k + 1, j + i1)) { if ((l < 1 || i1 < 1 || l > 3 || i1 > 3) && this.world.e(i + l, k - 1, j + i1) && !this.world.e(i + l, k, j + i1) && !this.world.e(i + l, k + 1, j + i1)) {
this.setPositionRotation((double) ((float) (i + l) + 0.5F), (double) k, (double) ((float) (j + i1) + 0.5F), this.yaw, this.pitch); this.setPositionRotation((double) ((float) (i + l) + 0.5F), (double) k, (double) ((float) (j + i1) + 0.5F), this.yaw, this.pitch);
return; return;
} }

View File

@ -11,7 +11,7 @@ public class EntityZombie extends EntityMonster {
this.damage = 5; this.damage = 5;
} }
public void u() { public void v() {
if (this.world.d()) { if (this.world.d()) {
float f = this.c(1.0F); float f = this.c(1.0F);
@ -27,7 +27,7 @@ public class EntityZombie extends EntityMonster {
} }
} }
super.u(); super.v();
} }
protected String g() { protected String g() {

View File

@ -234,7 +234,7 @@ public class Explosion {
// CraftBukkit // CraftBukkit
Block.byId[i1].dropNaturally(this.world, j, k, l, this.world.getData(j, k, l), event.getYield()); Block.byId[i1].dropNaturally(this.world, j, k, l, this.world.getData(j, k, l), event.getYield());
this.world.setTypeId(j, k, l, 0); this.world.setTypeId(j, k, l, 0);
Block.byId[i1].c(this.world, j, k, l); Block.byId[i1].d(this.world, j, k, l);
} }
} }
} }

View File

@ -77,7 +77,6 @@ public class InventoryPlayer implements IInventory {
return -1; return -1;
} }
private int e(ItemStack itemstack) { private int e(ItemStack itemstack) {
int i = itemstack.id; int i = itemstack.id;
int j = itemstack.count; int j = itemstack.count;
@ -285,7 +284,7 @@ public class InventoryPlayer implements IInventory {
} }
public boolean b(Block block) { public boolean b(Block block) {
if (block.material != Material.STONE && block.material != Material.ORE && block.material != Material.SNOW_BLOCK && block.material != Material.SNOW_LAYER) { if (block.material.i()) {
return true; return true;
} else { } else {
ItemStack itemstack = this.getItem(this.itemInHandIndex); ItemStack itemstack = this.getItem(this.itemInHandIndex);
@ -307,7 +306,7 @@ public class InventoryPlayer implements IInventory {
j += k1; j += k1;
k += i1; k += i1;
int l1 = ((ItemArmor) this.armor[l].getItem()).bk; int l1 = ((ItemArmor) this.armor[l].getItem()).bl;
i += l1; i += l1;
} }

View File

@ -40,7 +40,7 @@ public class ItemBed extends Item {
b0 = 1; b0 = 1;
} }
if (world.isEmpty(i, j, k) && world.isEmpty(i + b0, j, k + b1) && world.d(i, j - 1, k) && world.d(i + b0, j - 1, k + b1)) { if (world.isEmpty(i, j, k) && world.isEmpty(i + b0, j, k + b1) && world.e(i, j - 1, k) && world.e(i + b0, j - 1, k + b1)) {
CraftBlockState blockState = CraftBlockState.getBlockState(world, i, j, k); // CraftBukkit CraftBlockState blockState = CraftBlockState.getBlockState(world, i, j, k); // CraftBukkit
world.setTypeIdAndData(i, j, k, blockbed.id, i1); world.setTypeIdAndData(i, j, k, blockbed.id, i1);

View File

@ -114,6 +114,6 @@ public class ItemBlock extends Item {
} }
public String a() { public String a() {
return Block.byId[this.id].h(); return Block.byId[this.id].l();
} }
} }

View File

@ -54,8 +54,8 @@ public class ItemDoor extends Item {
b0 = 1; b0 = 1;
} }
int j1 = (world.d(i - b0, j, k - b1) ? 1 : 0) + (world.d(i - b0, j + 1, k - b1) ? 1 : 0); int j1 = (world.e(i - b0, j, k - b1) ? 1 : 0) + (world.e(i - b0, j + 1, k - b1) ? 1 : 0);
int k1 = (world.d(i + b0, j, k + b1) ? 1 : 0) + (world.d(i + b0, j + 1, k + b1) ? 1 : 0); int k1 = (world.e(i + b0, j, k + b1) ? 1 : 0) + (world.e(i + b0, j + 1, k + b1) ? 1 : 0);
boolean flag = world.getTypeId(i - b0, j, k - b1) == block.id || world.getTypeId(i - b0, j + 1, k - b1) == block.id; boolean flag = world.getTypeId(i - b0, j, k - b1) == block.id || world.getTypeId(i - b0, j + 1, k - b1) == block.id;
boolean flag1 = world.getTypeId(i + b0, j, k + b1) == block.id || world.getTypeId(i + b0, j + 1, k + b1) == block.id; boolean flag1 = world.getTypeId(i + b0, j, k + b1) == block.id || world.getTypeId(i + b0, j + 1, k + b1) == block.id;
boolean flag2 = false; boolean flag2 = false;

View File

@ -167,13 +167,13 @@ public class ItemInWorldManager {
this.world.a(this.player, 2001, i, j, k, l + this.world.getData(i, j, k) * 256); this.world.a(this.player, 2001, i, j, k, l + this.world.getData(i, j, k) * 256);
boolean flag = this.b(i, j, k); boolean flag = this.b(i, j, k);
ItemStack itemstack = this.player.F(); ItemStack itemstack = this.player.G();
if (itemstack != null) { if (itemstack != null) {
itemstack.a(l, i, j, k, this.player); itemstack.a(l, i, j, k, this.player);
if (itemstack.count == 0) { if (itemstack.count == 0) {
itemstack.a(this.player); itemstack.a(this.player);
this.player.G(); this.player.H();
} }
} }

View File

@ -95,7 +95,7 @@ public class ItemWorldMap extends ItemWorldMapBase {
j5 = chunk.getTypeId(l4 + k3, k4 - 1, j4 + l3); j5 = chunk.getTypeId(l4 + k3, k4 - 1, j4 + l3);
if (j5 == 0) { if (j5 == 0) {
flag1 = false; flag1 = false;
} else if (k4 > 0 && j5 > 0 && Block.byId[j5].material.A == MaterialMapColor.b) { } else if (k4 > 0 && j5 > 0 && Block.byId[j5].material.C == MaterialMapColor.b) {
flag1 = false; flag1 = false;
} }
@ -152,7 +152,7 @@ public class ItemWorldMap extends ItemWorldMapBase {
i5 = 0; i5 = 0;
if (j4 > 0) { if (j4 > 0) {
MaterialMapColor materialmapcolor = Block.byId[j4].material.A; MaterialMapColor materialmapcolor = Block.byId[j4].material.C;
if (materialmapcolor == MaterialMapColor.n) { if (materialmapcolor == MaterialMapColor.n) {
d2 = (double) i4 * 0.1D + (double) (k1 + j2 & 1) * 0.2D; d2 = (double) i4 * 0.1D + (double) (k1 + j2 & 1) * 0.2D;

View File

@ -89,7 +89,7 @@ public class MinecraftServer implements Runnable, ICommandListener {
System.setErr(new PrintStream(new LoggerOutputStream(log, Level.SEVERE), true)); System.setErr(new PrintStream(new LoggerOutputStream(log, Level.SEVERE), true));
// CraftBukkit end // CraftBukkit end
log.info("Starting minecraft server version Beta 1.6.6"); log.info("Starting minecraft server version Beta 1.7");
if (Runtime.getRuntime().maxMemory() / 1024L / 1024L < 512L) { if (Runtime.getRuntime().maxMemory() / 1024L / 1024L < 512L) {
log.warning("**** NOT ENOUGH RAM!"); log.warning("**** NOT ENOUGH RAM!");
log.warning("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\""); log.warning("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\"");

View File

@ -63,8 +63,8 @@ public class NetLoginHandler extends NetHandler {
public void a(Packet1Login packet1login) { public void a(Packet1Login packet1login) {
this.g = packet1login.name; this.g = packet1login.name;
if (packet1login.a != 13) { if (packet1login.a != 14) {
if (packet1login.a > 13) { if (packet1login.a > 14) {
this.disconnect("Outdated server!"); this.disconnect("Outdated server!");
} else { } else {
this.disconnect("Outdated client!"); this.disconnect("Outdated client!");

View File

@ -102,7 +102,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
s = event.getReason(); s = event.getReason();
// CraftBukkit end // CraftBukkit end
this.player.A(); this.player.B();
this.sendPacket(new Packet255KickDisconnect(s)); this.sendPacket(new Packet255KickDisconnect(s));
this.networkManager.d(); this.networkManager.d();
@ -427,7 +427,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension); WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
if (packet14blockdig.e == 4) { if (packet14blockdig.e == 4) {
this.player.E(); this.player.F();
} else { } else {
boolean flag = worldserver.weirdIsOpCache = worldserver.dimension != 0 || this.minecraftServer.serverConfigurationManager.isOp(this.player.name); // CraftBukkit boolean flag = worldserver.weirdIsOpCache = worldserver.dimension != 0 || this.minecraftServer.serverConfigurationManager.isOp(this.player.name); // CraftBukkit
boolean flag1 = false; boolean flag1 = false;
@ -800,7 +800,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
this.server.getPluginManager().callEvent(event); this.server.getPluginManager().callEvent(event);
// CraftBukkit end // CraftBukkit end
this.player.k_(); this.player.w();
} }
} }
@ -889,7 +889,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
public void a(Packet101CloseWindow packet101closewindow) { public void a(Packet101CloseWindow packet101closewindow) {
if (this.player.dead) return; // CraftBukkit if (this.player.dead) return; // CraftBukkit
this.player.z(); this.player.A();
} }
public void a(Packet102WindowClick packet102windowclick) { public void a(Packet102WindowClick packet102windowclick) {
@ -902,7 +902,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
this.player.netServerHandler.sendPacket(new Packet106Transaction(packet102windowclick.a, packet102windowclick.d, true)); this.player.netServerHandler.sendPacket(new Packet106Transaction(packet102windowclick.a, packet102windowclick.d, true));
this.player.h = true; this.player.h = true;
this.player.activeContainer.a(); this.player.activeContainer.a();
this.player.y(); this.player.z();
this.player.h = false; this.player.h = false;
} else { } else {
this.n.put(Integer.valueOf(this.player.activeContainer.windowId), Short.valueOf(packet102windowclick.d)); this.n.put(Integer.valueOf(this.player.activeContainer.windowId), Short.valueOf(packet102windowclick.d));

View File

@ -182,7 +182,7 @@ class PlayerInstance {
private void sendTileEntity(TileEntity tileentity) { private void sendTileEntity(TileEntity tileentity) {
if (tileentity != null) { if (tileentity != null) {
Packet packet = tileentity.e(); Packet packet = tileentity.f();
if (packet != null) { if (packet != null) {
this.sendAll(packet); this.sendAll(packet);

View File

@ -268,7 +268,7 @@ public class ServerConfigurationManager {
worldserver.addEntity(entityplayer1); worldserver.addEntity(entityplayer1);
this.players.add(entityplayer1); this.players.add(entityplayer1);
this.updateClient(entityplayer1); // CraftBukkit this.updateClient(entityplayer1); // CraftBukkit
entityplayer1.w(); entityplayer1.x();
return entityplayer1; return entityplayer1;
} }
@ -613,6 +613,6 @@ public class ServerConfigurationManager {
public void updateClient(EntityPlayer entityplayer) { public void updateClient(EntityPlayer entityplayer) {
entityplayer.updateInventory(entityplayer.defaultContainer); entityplayer.updateInventory(entityplayer.defaultContainer);
entityplayer.B(); entityplayer.C();
} }
} }

View File

@ -93,7 +93,7 @@ public final class SpawnerCreature {
int j2 = chunkposition.y; int j2 = chunkposition.y;
int k2 = chunkposition.z; int k2 = chunkposition.z;
if (!world.d(i2, j2, k2) && world.getMaterial(i2, j2, k2) == enumcreaturetype.c()) { if (!world.e(i2, j2, k2) && world.getMaterial(i2, j2, k2) == enumcreaturetype.c()) {
int l2 = 0; int l2 = 0;
for (int i3 = 0; i3 < 3; ++i3) { for (int i3 = 0; i3 < 3; ++i3) {
@ -155,7 +155,7 @@ public final class SpawnerCreature {
} }
private static boolean a(EnumCreatureType enumcreaturetype, World world, int i, int j, int k) { private static boolean a(EnumCreatureType enumcreaturetype, World world, int i, int j, int k) {
return enumcreaturetype.c() == Material.WATER ? world.getMaterial(i, j, k).isLiquid() && !world.d(i, j + 1, k) : world.d(i, j - 1, k) && !world.d(i, j, k) && !world.getMaterial(i, j, k).isLiquid() && !world.d(i, j + 1, k); return enumcreaturetype.c() == Material.WATER ? world.getMaterial(i, j, k).isLiquid() && !world.e(i, j + 1, k) : world.e(i, j - 1, k) && !world.e(i, j, k) && !world.getMaterial(i, j, k).isLiquid() && !world.e(i, j + 1, k);
} }
private static void a(EntityLiving entityliving, World world, float f, float f1, float f2) { private static void a(EntityLiving entityliving, World world, float f, float f1, float f2) {
@ -198,7 +198,7 @@ public final class SpawnerCreature {
int j1; int j1;
for (j1 = l; j1 > 2 && !world.d(j, j1 - 1, k); --j1) { for (j1 = l; j1 > 2 && !world.e(j, j1 - 1, k); --j1) {
; ;
} }
@ -228,7 +228,7 @@ public final class SpawnerCreature {
PathPoint pathpoint = pathentity.c(); PathPoint pathpoint = pathentity.c();
if (Math.abs((double) pathpoint.a - entityhuman.locX) < 1.5D && Math.abs((double) pathpoint.c - entityhuman.locZ) < 1.5D && Math.abs((double) pathpoint.b - entityhuman.locY) < 1.5D) { if (Math.abs((double) pathpoint.a - entityhuman.locX) < 1.5D && Math.abs((double) pathpoint.c - entityhuman.locZ) < 1.5D && Math.abs((double) pathpoint.b - entityhuman.locY) < 1.5D) {
ChunkCoordinates chunkcoordinates = BlockBed.g(world, MathHelper.floor(entityhuman.locX), MathHelper.floor(entityhuman.locY), MathHelper.floor(entityhuman.locZ), 1); ChunkCoordinates chunkcoordinates = BlockBed.f(world, MathHelper.floor(entityhuman.locX), MathHelper.floor(entityhuman.locY), MathHelper.floor(entityhuman.locZ), 1);
if (chunkcoordinates == null) { if (chunkcoordinates == null) {
chunkcoordinates = new ChunkCoordinates(j, j1 + 1, k); chunkcoordinates = new ChunkCoordinates(j, j1 + 1, k);
@ -239,7 +239,7 @@ public final class SpawnerCreature {
world.addEntity(entityliving, SpawnReason.BED); world.addEntity(entityliving, SpawnReason.BED);
a(entityliving, world, (float) chunkcoordinates.x + 0.5F, (float) chunkcoordinates.y, (float) chunkcoordinates.z + 0.5F); a(entityliving, world, (float) chunkcoordinates.x + 0.5F, (float) chunkcoordinates.y, (float) chunkcoordinates.z + 0.5F);
entityhuman.a(true, false, false); entityhuman.a(true, false, false);
entityliving.P(); entityliving.Q();
flag = true; flag = true;
flag1 = true; flag1 = true;
} }

View File

@ -35,13 +35,16 @@ public class TileEntityMobSpawner extends TileEntity {
this.b -= 360.0D; this.b -= 360.0D;
} }
if (!this.world.isStatic) {
if (this.spawnDelay == -1) { if (this.spawnDelay == -1) {
this.c(); this.c();
} }
if (this.spawnDelay > 0) { if (this.spawnDelay > 0) {
--this.spawnDelay; --this.spawnDelay;
} else { return;
}
byte b0 = 4; byte b0 = 4;
for (int i = 0; i < b0; ++i) { for (int i = 0; i < b0; ++i) {
@ -83,16 +86,16 @@ public class TileEntityMobSpawner extends TileEntity {
this.world.a("flame", d0, d1, d2, 0.0D, 0.0D, 0.0D); this.world.a("flame", d0, d1, d2, 0.0D, 0.0D, 0.0D);
} }
entityliving.R(); entityliving.S();
this.c(); this.c();
} }
} }
} }
}
super.g_(); super.g_();
} }
} }
}
private void c() { private void c() {
this.spawnDelay = 200 + this.world.random.nextInt(600); this.spawnDelay = 200 + this.world.random.nextInt(600);

View File

@ -28,7 +28,7 @@ public class TileEntitySign extends TileEntity {
} }
} }
public Packet e() { public Packet f() {
String[] astring = new String[4]; String[] astring = new String[4];
for (int i = 0; i < 4; ++i) { for (int i = 0; i < 4; ++i) {

View File

@ -1,6 +1,7 @@
package net.minecraft.server; package net.minecraft.server;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
@ -36,12 +37,13 @@ public class World implements IBlockAccess {
private TreeSet E = new TreeSet(); private TreeSet E = new TreeSet();
private Set F = new HashSet(); private Set F = new HashSet();
public List c = new ArrayList(); public List c = new ArrayList();
private List G = new ArrayList();
public List players = new ArrayList(); public List players = new ArrayList();
public List e = new ArrayList(); public List e = new ArrayList();
private long G = 16777215L; private long H = 16777215L;
public int f = 0; public int f = 0;
protected int g = (new Random()).nextInt(); protected int g = (new Random()).nextInt();
protected int h = 1013904223; protected final int h = 1013904223;
protected float i; protected float i;
protected float j; protected float j;
protected float k; protected float k;
@ -49,7 +51,7 @@ public class World implements IBlockAccess {
protected int m = 0; protected int m = 0;
public int n = 0; public int n = 0;
public boolean suppressPhysics = false; public boolean suppressPhysics = false;
private long H = System.currentTimeMillis(); private long I = System.currentTimeMillis();
protected int p = 40; protected int p = 40;
public int spawnMonsters; public int spawnMonsters;
public Random random = new Random(); public Random random = new Random();
@ -60,16 +62,17 @@ public class World implements IBlockAccess {
protected final IDataManager w; protected final IDataManager w;
public WorldData worldData; // CraftBukkit - protected -> public public WorldData worldData; // CraftBukkit - protected -> public
public boolean isLoading; public boolean isLoading;
private boolean I; private boolean J;
public WorldMapCollection worldMaps; public WorldMapCollection worldMaps;
private ArrayList J = new ArrayList(); private ArrayList K = new ArrayList();
private int K = 0; private boolean L;
private int M = 0;
public boolean allowMonsters = true; // CraftBukkit - private -> public public boolean allowMonsters = true; // CraftBukkit - private -> public
public boolean allowAnimals = true; // CraftBukkit - private -> public public boolean allowAnimals = true; // CraftBukkit - private -> public
static int A = 0; static int A = 0;
private Set N = new HashSet(); private Set P = new HashSet();
private int O; private int Q;
private List P; private List R;
public boolean isStatic; public boolean isStatic;
public WorldChunkManager getWorldChunkManager() { public WorldChunkManager getWorldChunkManager() {
@ -107,8 +110,8 @@ public class World implements IBlockAccess {
this.world = new CraftWorld((WorldServer) this, gen, env); this.world = new CraftWorld((WorldServer) this, gen, env);
// CraftBukkit end // CraftBukkit end
this.O = this.random.nextInt(12000); this.Q = this.random.nextInt(12000);
this.P = new ArrayList(); this.R = new ArrayList();
this.isStatic = false; this.isStatic = false;
this.w = idatamanager; this.w = idatamanager;
this.worldMaps = new WorldMapCollection(idatamanager); this.worldMaps = new WorldMapCollection(idatamanager);
@ -407,7 +410,7 @@ public class World implements IBlockAccess {
this.b(i, k, j, i, l, j); this.b(i, k, j, i, l, j);
} }
public void h(int i, int j, int k) { public void i(int i, int j, int k) {
for (int l = 0; l < this.u.size(); ++l) { for (int l = 0; l < this.u.size(); ++l) {
((IWorldAccess) this.u.get(l)).a(i, j, k, i, j, k); ((IWorldAccess) this.u.get(l)).a(i, j, k, i, j, k);
} }
@ -454,7 +457,7 @@ public class World implements IBlockAccess {
return this.getChunkAt(i >> 4, k >> 4).c(i & 15, j, k & 15); return this.getChunkAt(i >> 4, k >> 4).c(i & 15, j, k & 15);
} }
public int j(int i, int j, int k) { public int k(int i, int j, int k) {
if (j < 0) { if (j < 0) {
return 0; return 0;
} else { } else {
@ -520,7 +523,7 @@ public class World implements IBlockAccess {
} }
} }
public boolean l(int i, int j, int k) { public boolean m(int i, int j, int k) {
if (i >= -32000000 && k >= -32000000 && i < 32000000 && k <= 32000000) { if (i >= -32000000 && k >= -32000000 && i < 32000000 && k <= 32000000) {
if (j < 0) { if (j < 0) {
return false; return false;
@ -558,7 +561,7 @@ public class World implements IBlockAccess {
if (!this.worldProvider.e || enumskyblock != EnumSkyBlock.SKY) { if (!this.worldProvider.e || enumskyblock != EnumSkyBlock.SKY) {
if (this.isLoaded(i, j, k)) { if (this.isLoaded(i, j, k)) {
if (enumskyblock == EnumSkyBlock.SKY) { if (enumskyblock == EnumSkyBlock.SKY) {
if (this.l(i, j, k)) { if (this.m(i, j, k)) {
l = 15; l = 15;
} }
} else if (enumskyblock == EnumSkyBlock.BLOCK) { } else if (enumskyblock == EnumSkyBlock.BLOCK) {
@ -619,7 +622,7 @@ public class World implements IBlockAccess {
} }
} }
public float m(int i, int j, int k) { public float n(int i, int j, int k) {
return this.worldProvider.f[this.getLightLevel(i, j, k)]; return this.worldProvider.f[this.getLightLevel(i, j, k)];
} }
@ -648,7 +651,7 @@ public class World implements IBlockAccess {
int l1 = this.getData(l, i1, j1); int l1 = this.getData(l, i1, j1);
Block block = Block.byId[k1]; Block block = Block.byId[k1];
if ((!flag1 || block == null || block.d(this, l, i1, j1) != null) && k1 > 0 && block.a(l1, flag)) { if ((!flag1 || block == null || block.e(this, l, i1, j1) != null) && k1 > 0 && block.a(l1, flag)) {
MovingObjectPosition movingobjectposition = block.a(this, l, i1, j1, vec3d, vec3d1); MovingObjectPosition movingobjectposition = block.a(this, l, i1, j1, vec3d, vec3d1);
if (movingobjectposition != null) { if (movingobjectposition != null) {
@ -776,7 +779,7 @@ public class World implements IBlockAccess {
int j2 = this.getData(l, i1, j1); int j2 = this.getData(l, i1, j1);
Block block1 = Block.byId[i2]; Block block1 = Block.byId[i2];
if ((!flag1 || block1 == null || block1.d(this, l, i1, j1) != null) && i2 > 0 && block1.a(j2, flag)) { if ((!flag1 || block1 == null || block1.e(this, l, i1, j1) != null) && i2 > 0 && block1.a(j2, flag)) {
MovingObjectPosition movingobjectposition1 = block1.a(this, l, i1, j1, vec3d, vec3d1); MovingObjectPosition movingobjectposition1 = block1.a(this, l, i1, j1, vec3d, vec3d1);
if (movingobjectposition1 != null) { if (movingobjectposition1 != null) {
@ -906,10 +909,10 @@ public class World implements IBlockAccess {
this.everyoneSleeping(); this.everyoneSleeping();
} }
int i = entity.bG; int i = entity.bH;
int j = entity.bI; int j = entity.bJ;
if (entity.bF && this.isChunkLoaded(i, j)) { if (entity.bG && this.isChunkLoaded(i, j)) {
this.getChunkAt(i, j).b(entity); this.getChunkAt(i, j).b(entity);
} }
@ -922,7 +925,7 @@ public class World implements IBlockAccess {
} }
public List getEntities(Entity entity, AxisAlignedBB axisalignedbb) { public List getEntities(Entity entity, AxisAlignedBB axisalignedbb) {
this.J.clear(); this.K.clear();
int i = MathHelper.floor(axisalignedbb.a); int i = MathHelper.floor(axisalignedbb.a);
int j = MathHelper.floor(axisalignedbb.d + 1.0D); int j = MathHelper.floor(axisalignedbb.d + 1.0D);
int k = MathHelper.floor(axisalignedbb.b); int k = MathHelper.floor(axisalignedbb.b);
@ -937,7 +940,7 @@ public class World implements IBlockAccess {
Block block = Block.byId[this.getTypeId(k1, i2, l1)]; Block block = Block.byId[this.getTypeId(k1, i2, l1)];
if (block != null) { if (block != null) {
block.a(this, k1, i2, l1, axisalignedbb, this.J); block.a(this, k1, i2, l1, axisalignedbb, this.K);
} }
} }
} }
@ -951,16 +954,16 @@ public class World implements IBlockAccess {
AxisAlignedBB axisalignedbb1 = ((Entity) list.get(j2)).e_(); AxisAlignedBB axisalignedbb1 = ((Entity) list.get(j2)).e_();
if (axisalignedbb1 != null && axisalignedbb1.a(axisalignedbb)) { if (axisalignedbb1 != null && axisalignedbb1.a(axisalignedbb)) {
this.J.add(axisalignedbb1); this.K.add(axisalignedbb1);
} }
axisalignedbb1 = entity.a_((Entity) list.get(j2)); axisalignedbb1 = entity.a_((Entity) list.get(j2));
if (axisalignedbb1 != null && axisalignedbb1.a(axisalignedbb)) { if (axisalignedbb1 != null && axisalignedbb1.a(axisalignedbb)) {
this.J.add(axisalignedbb1); this.K.add(axisalignedbb1);
} }
} }
return this.J; return this.K;
} }
public int a(float f) { public int a(float f) {
@ -1058,7 +1061,7 @@ public class World implements IBlockAccess {
continue; continue;
} }
// CraftBukkit end // CraftBukkit end
entity.o_(); entity.m_();
if (entity.dead) { if (entity.dead) {
this.e.remove(i--); this.e.remove(i--);
} }
@ -1071,9 +1074,9 @@ public class World implements IBlockAccess {
for (i = 0; i < this.D.size(); ++i) { for (i = 0; i < this.D.size(); ++i) {
entity = (Entity) this.D.get(i); entity = (Entity) this.D.get(i);
j = entity.bG; j = entity.bH;
k = entity.bI; k = entity.bJ;
if (entity.bF && this.isChunkLoaded(j, k)) { if (entity.bG && this.isChunkLoaded(j, k)) {
this.getChunkAt(j, k).b(entity); this.getChunkAt(j, k).b(entity);
} }
} }
@ -1100,9 +1103,9 @@ public class World implements IBlockAccess {
} }
if (entity.dead) { if (entity.dead) {
j = entity.bG; j = entity.bH;
k = entity.bI; k = entity.bJ;
if (entity.bF && this.isChunkLoaded(j, k)) { if (entity.bG && this.isChunkLoaded(j, k)) {
this.getChunkAt(j, k).b(entity); this.getChunkAt(j, k).b(entity);
} }
@ -1111,11 +1114,58 @@ public class World implements IBlockAccess {
} }
} }
for (i = 0; i < this.c.size(); ++i) { this.L = true;
TileEntity tileentity = (TileEntity) this.c.get(i); Iterator iterator = this.c.iterator();
while (iterator.hasNext()) {
TileEntity tileentity = (TileEntity) iterator.next();
if (!tileentity.g()) {
tileentity.g_(); tileentity.g_();
} }
if (tileentity.g()) {
iterator.remove();
Chunk chunk = this.getChunkAt(tileentity.x >> 4, tileentity.z >> 4);
if (chunk != null) {
chunk.e(tileentity.x & 15, tileentity.y, tileentity.z & 15);
}
}
}
this.L = false;
if (!this.G.isEmpty()) {
Iterator iterator1 = this.G.iterator();
while (iterator1.hasNext()) {
TileEntity tileentity1 = (TileEntity) iterator1.next();
if (!tileentity1.g()) {
if (!this.c.contains(tileentity1)) {
this.c.add(tileentity1);
}
Chunk chunk1 = this.getChunkAt(tileentity1.x >> 4, tileentity1.z >> 4);
if (chunk1 != null) {
chunk1.a(tileentity1.x & 15, tileentity1.y, tileentity1.z & 15, tileentity1);
}
this.notify(tileentity1.x, tileentity1.y, tileentity1.z);
}
}
this.G.clear();
}
}
public void a(Collection collection) {
if (this.L) {
this.G.addAll(collection);
} else {
this.c.addAll(collection);
}
} }
public void playerJoinedWorld(Entity entity) { public void playerJoinedWorld(Entity entity) {
@ -1133,11 +1183,11 @@ public class World implements IBlockAccess {
entity.bq = entity.locZ; entity.bq = entity.locZ;
entity.lastYaw = entity.yaw; entity.lastYaw = entity.yaw;
entity.lastPitch = entity.pitch; entity.lastPitch = entity.pitch;
if (flag && entity.bF) { if (flag && entity.bG) {
if (entity.vehicle != null) { if (entity.vehicle != null) {
entity.D(); entity.E();
} else { } else {
entity.o_(); entity.m_();
} }
} }
@ -1165,20 +1215,20 @@ public class World implements IBlockAccess {
int l = MathHelper.floor(entity.locY / 16.0D); int l = MathHelper.floor(entity.locY / 16.0D);
int i1 = MathHelper.floor(entity.locZ / 16.0D); int i1 = MathHelper.floor(entity.locZ / 16.0D);
if (!entity.bF || entity.bG != k || entity.bH != l || entity.bI != i1) { if (!entity.bG || entity.bH != k || entity.bI != l || entity.bJ != i1) {
if (entity.bF && this.isChunkLoaded(entity.bG, entity.bI)) { if (entity.bG && this.isChunkLoaded(entity.bH, entity.bJ)) {
this.getChunkAt(entity.bG, entity.bI).a(entity, entity.bH); this.getChunkAt(entity.bH, entity.bJ).a(entity, entity.bI);
} }
if (this.isChunkLoaded(k, i1)) { if (this.isChunkLoaded(k, i1)) {
entity.bF = true; entity.bG = true;
this.getChunkAt(k, i1).a(entity); this.getChunkAt(k, i1).a(entity);
} else { } else {
entity.bF = false; entity.bG = false;
} }
} }
if (flag && entity.bF && entity.passenger != null) { if (flag && entity.bG && entity.passenger != null) {
if (!entity.passenger.dead && entity.passenger.vehicle == entity) { if (!entity.passenger.dead && entity.passenger.vehicle == entity) {
this.playerJoinedWorld(entity.passenger); this.playerJoinedWorld(entity.passenger);
} else { } else {
@ -1474,20 +1524,40 @@ public class World implements IBlockAccess {
} }
public void setTileEntity(int i, int j, int k, TileEntity tileentity) { public void setTileEntity(int i, int j, int k, TileEntity tileentity) {
if (!tileentity.g()) {
if (this.L) {
tileentity.x = i;
tileentity.y = j;
tileentity.z = k;
this.G.add(tileentity);
} else {
this.c.add(tileentity);
Chunk chunk = this.getChunkAt(i >> 4, k >> 4); Chunk chunk = this.getChunkAt(i >> 4, k >> 4);
if (chunk != null) { if (chunk != null) {
chunk.a(i & 15, j, k & 15, tileentity); chunk.a(i & 15, j, k & 15, tileentity);
} }
} }
}
}
public void o(int i, int j, int k) { public void o(int i, int j, int k) {
TileEntity tileentity = this.getTileEntity(i, j, k);
if (tileentity != null && this.L) {
tileentity.h();
} else {
if (tileentity != null) {
this.c.remove(tileentity);
}
Chunk chunk = this.getChunkAt(i >> 4, k >> 4); Chunk chunk = this.getChunkAt(i >> 4, k >> 4);
if (chunk != null) { if (chunk != null) {
chunk.e(i & 15, j, k & 15); chunk.e(i & 15, j, k & 15);
} }
} }
}
public boolean p(int i, int j, int k) { public boolean p(int i, int j, int k) {
Block block = Block.byId[this.getTypeId(i, j, k)]; Block block = Block.byId[this.getTypeId(i, j, k)];
@ -1495,23 +1565,23 @@ public class World implements IBlockAccess {
return block == null ? false : block.a(); return block == null ? false : block.a();
} }
public boolean d(int i, int j, int k) { public boolean e(int i, int j, int k) {
Block block = Block.byId[this.getTypeId(i, j, k)]; Block block = Block.byId[this.getTypeId(i, j, k)];
return block == null ? false : block.material.h() && block.b(); return block == null ? false : block.material.h() && block.b();
} }
public boolean doLighting() { public boolean doLighting() {
if (this.K >= 50) { if (this.M >= 50) {
return false; return false;
} else { } else {
++this.K; ++this.M;
boolean flag;
try { try {
int i = 500; int i = 500;
boolean flag;
while (this.C.size() > 0) { while (this.C.size() > 0) {
--i; --i;
if (i <= 0) { if (i <= 0) {
@ -1523,11 +1593,10 @@ public class World implements IBlockAccess {
} }
flag = false; flag = false;
} finally {
--this.K;
}
return flag; return flag;
} finally {
--this.M;
}
} }
} }
@ -1547,10 +1616,7 @@ public class World implements IBlockAccess {
int k1 = (l + i) / 2; int k1 = (l + i) / 2;
int l1 = (j1 + k) / 2; int l1 = (j1 + k) / 2;
if (!this.isLoaded(k1, 64, l1)) { if (this.isLoaded(k1, 64, l1)) {
return;
}
if (this.getChunkAtWorldCoords(k1, l1).isEmpty()) { if (this.getChunkAtWorldCoords(k1, l1).isEmpty()) {
return; return;
} }
@ -1579,6 +1645,9 @@ public class World implements IBlockAccess {
System.out.println("More than " + j2 + " updates, aborting lighting updates"); System.out.println("More than " + j2 + " updates, aborting lighting updates");
this.C.clear(); this.C.clear();
} }
return;
}
} finally { } finally {
--A; --A;
} }
@ -1754,7 +1823,7 @@ public class World implements IBlockAccess {
} }
protected void j() { protected void j() {
this.N.clear(); this.P.clear();
int i; int i;
int j; int j;
@ -1770,16 +1839,16 @@ public class World implements IBlockAccess {
for (k = -b0; k <= b0; ++k) { for (k = -b0; k <= b0; ++k) {
for (l = -b0; l <= b0; ++l) { for (l = -b0; l <= b0; ++l) {
this.N.add(new ChunkCoordIntPair(k + i, l + j)); this.P.add(new ChunkCoordIntPair(k + i, l + j));
} }
} }
} }
if (this.O > 0) { if (this.Q > 0) {
--this.O; --this.Q;
} }
Iterator iterator = this.N.iterator(); Iterator iterator = this.P.iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
ChunkCoordIntPair chunkcoordintpair = (ChunkCoordIntPair) iterator.next(); ChunkCoordIntPair chunkcoordintpair = (ChunkCoordIntPair) iterator.next();
@ -1791,8 +1860,8 @@ public class World implements IBlockAccess {
int k1; int k1;
int l1; int l1;
if (this.O == 0) { if (this.Q == 0) {
this.g = this.g * 3 + this.h; this.g = this.g * 3 + 1013904223;
k = this.g >> 2; k = this.g >> 2;
l = k & 15; l = k & 15;
j1 = k >> 8 & 15; j1 = k >> 8 & 15;
@ -1800,18 +1869,18 @@ public class World implements IBlockAccess {
l1 = chunk.getTypeId(l, k1, j1); l1 = chunk.getTypeId(l, k1, j1);
l += i; l += i;
j1 += j; j1 += j;
if (l1 == 0 && this.j(l, k1, j1) <= this.random.nextInt(8) && this.a(EnumSkyBlock.SKY, l, k1, j1) <= 0) { if (l1 == 0 && this.k(l, k1, j1) <= this.random.nextInt(8) && this.a(EnumSkyBlock.SKY, l, k1, j1) <= 0) {
EntityHuman entityhuman1 = this.a((double) l + 0.5D, (double) k1 + 0.5D, (double) j1 + 0.5D, 8.0D); EntityHuman entityhuman1 = this.a((double) l + 0.5D, (double) k1 + 0.5D, (double) j1 + 0.5D, 8.0D);
if (entityhuman1 != null && entityhuman1.d((double) l + 0.5D, (double) k1 + 0.5D, (double) j1 + 0.5D) > 4.0D) { if (entityhuman1 != null && entityhuman1.d((double) l + 0.5D, (double) k1 + 0.5D, (double) j1 + 0.5D) > 4.0D) {
this.makeSound((double) l + 0.5D, (double) k1 + 0.5D, (double) j1 + 0.5D, "ambient.cave.cave", 0.7F, 0.8F + this.random.nextFloat() * 0.2F); this.makeSound((double) l + 0.5D, (double) k1 + 0.5D, (double) j1 + 0.5D, "ambient.cave.cave", 0.7F, 0.8F + this.random.nextFloat() * 0.2F);
this.O = this.random.nextInt(12000) + 6000; this.Q = this.random.nextInt(12000) + 6000;
} }
} }
} }
if (this.random.nextInt(100000) == 0 && this.v() && this.u()) { if (this.random.nextInt(100000) == 0 && this.v() && this.u()) {
this.g = this.g * 3 + this.h; this.g = this.g * 3 + 1013904223;
k = this.g >> 2; k = this.g >> 2;
l = i + (k & 15); l = i + (k & 15);
j1 = j + (k >> 8 & 15); j1 = j + (k >> 8 & 15);
@ -1825,7 +1894,7 @@ public class World implements IBlockAccess {
int i2; int i2;
if (this.random.nextInt(16) == 0) { if (this.random.nextInt(16) == 0) {
this.g = this.g * 3 + this.h; this.g = this.g * 3 + 1013904223;
k = this.g >> 2; k = this.g >> 2;
l = k & 15; l = k & 15;
j1 = k >> 8 & 15; j1 = k >> 8 & 15;
@ -1861,7 +1930,7 @@ public class World implements IBlockAccess {
} }
for (k = 0; k < 80; ++k) { for (k = 0; k < 80; ++k) {
this.g = this.g * 3 + this.h; this.g = this.g * 3 + 1013904223;
l = this.g >> 2; l = this.g >> 2;
j1 = l & 15; j1 = l & 15;
k1 = l >> 8 & 15; k1 = l >> 8 & 15;
@ -1909,7 +1978,7 @@ public class World implements IBlockAccess {
} }
public List b(Entity entity, AxisAlignedBB axisalignedbb) { public List b(Entity entity, AxisAlignedBB axisalignedbb) {
this.P.clear(); this.R.clear();
int i = MathHelper.floor((axisalignedbb.a - 2.0D) / 16.0D); int i = MathHelper.floor((axisalignedbb.a - 2.0D) / 16.0D);
int j = MathHelper.floor((axisalignedbb.d + 2.0D) / 16.0D); int j = MathHelper.floor((axisalignedbb.d + 2.0D) / 16.0D);
int k = MathHelper.floor((axisalignedbb.c - 2.0D) / 16.0D); int k = MathHelper.floor((axisalignedbb.c - 2.0D) / 16.0D);
@ -1918,12 +1987,12 @@ public class World implements IBlockAccess {
for (int i1 = i; i1 <= j; ++i1) { for (int i1 = i; i1 <= j; ++i1) {
for (int j1 = k; j1 <= l; ++j1) { for (int j1 = k; j1 <= l; ++j1) {
if (this.isChunkLoaded(i1, j1)) { if (this.isChunkLoaded(i1, j1)) {
this.getChunkAt(i1, j1).a(entity, axisalignedbb, this.P); this.getChunkAt(i1, j1).a(entity, axisalignedbb, this.R);
} }
} }
} }
return this.P; return this.R;
} }
public List a(Class oclass, AxisAlignedBB axisalignedbb) { public List a(Class oclass, AxisAlignedBB axisalignedbb) {
@ -1992,7 +2061,7 @@ public class World implements IBlockAccess {
int j1 = this.getTypeId(j, k, l); int j1 = this.getTypeId(j, k, l);
Block block = Block.byId[j1]; Block block = Block.byId[j1];
Block block1 = Block.byId[i]; Block block1 = Block.byId[i];
AxisAlignedBB axisalignedbb = block1.d(this, j, k, l); AxisAlignedBB axisalignedbb = block1.e(this, j, k, l);
if (flag) { if (flag) {
axisalignedbb = null; axisalignedbb = null;
@ -2053,7 +2122,7 @@ public class World implements IBlockAccess {
public boolean isBlockFacePowered(int i, int j, int k, int l) { public boolean isBlockFacePowered(int i, int j, int k, int l) {
int i1 = this.getTypeId(i, j, k); int i1 = this.getTypeId(i, j, k);
return i1 == 0 ? false : Block.byId[i1].c(this, i, j, k, l); return i1 == 0 ? false : Block.byId[i1].d(this, i, j, k, l);
} }
public boolean isBlockPowered(int i, int j, int k) { public boolean isBlockPowered(int i, int j, int k) {
@ -2061,7 +2130,7 @@ public class World implements IBlockAccess {
} }
public boolean isBlockFaceIndirectlyPowered(int i, int j, int k, int l) { public boolean isBlockFaceIndirectlyPowered(int i, int j, int k, int l) {
if (this.d(i, j, k)) { if (this.e(i, j, k)) {
return this.isBlockPowered(i, j, k); return this.isBlockPowered(i, j, k);
} else { } else {
int i1 = this.getTypeId(i, j, k); int i1 = this.getTypeId(i, j, k);
@ -2206,7 +2275,7 @@ public class World implements IBlockAccess {
} }
public void everyoneSleeping() { public void everyoneSleeping() {
this.I = !this.players.isEmpty(); this.J = !this.players.isEmpty();
Iterator iterator = this.players.iterator(); Iterator iterator = this.players.iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
@ -2214,7 +2283,7 @@ public class World implements IBlockAccess {
// CraftBukkit // CraftBukkit
if (!entityhuman.isSleeping() && !entityhuman.fauxSleeping) { if (!entityhuman.isSleeping() && !entityhuman.fauxSleeping) {
this.I = false; this.J = false;
break; break;
} }
} }
@ -2231,7 +2300,7 @@ public class World implements IBlockAccess {
// CraftBukkit end // CraftBukkit end
protected void s() { protected void s() {
this.I = false; this.J = false;
Iterator iterator = this.players.iterator(); Iterator iterator = this.players.iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
@ -2246,7 +2315,7 @@ public class World implements IBlockAccess {
} }
public boolean everyoneDeeplySleeping() { public boolean everyoneDeeplySleeping() {
if (this.I && !this.isStatic) { if (this.J && !this.isStatic) {
Iterator iterator = this.players.iterator(); Iterator iterator = this.players.iterator();
// CraftBukkit - This allows us to assume that some people are in bed but not really, allowing time to pass in spite of AFKers // CraftBukkit - This allows us to assume that some people are in bed but not really, allowing time to pass in spite of AFKers

View File

@ -65,7 +65,7 @@ import org.bukkit.util.config.ConfigurationNode;
public final class CraftServer implements Server { public final class CraftServer implements Server {
private final String serverName = "Craftbukkit"; private final String serverName = "Craftbukkit";
private final String serverVersion; private final String serverVersion;
private final String protocolVersion = "1.6.6"; private final String protocolVersion = "1.7";
private final ServicesManager servicesManager = new SimpleServicesManager(); private final ServicesManager servicesManager = new SimpleServicesManager();
private final BukkitScheduler scheduler = new CraftScheduler(this); private final BukkitScheduler scheduler = new CraftScheduler(this);
private final SimpleCommandMap commandMap = new SimpleCommandMap(this); private final SimpleCommandMap commandMap = new SimpleCommandMap(this);