mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-23 11:06:29 +01:00
Updated CraftBukkit to 1.2
This commit is contained in:
parent
e9ca87000c
commit
543c4879fe
6
pom.xml
6
pom.xml
@ -4,7 +4,7 @@
|
|||||||
<groupId>org.bukkit</groupId>
|
<groupId>org.bukkit</groupId>
|
||||||
<artifactId>craftbukkit</artifactId>
|
<artifactId>craftbukkit</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<version>1.1-R6-SNAPSHOT</version>
|
<version>1.2.2-R0-SNAPSHOT</version>
|
||||||
<name>CraftBukkit</name>
|
<name>CraftBukkit</name>
|
||||||
<url>http://www.bukkit.org</url>
|
<url>http://www.bukkit.org</url>
|
||||||
|
|
||||||
@ -51,14 +51,14 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bukkit</groupId>
|
<groupId>org.bukkit</groupId>
|
||||||
<artifactId>bukkit</artifactId>
|
<artifactId>bukkit</artifactId>
|
||||||
<version>1.1-R6</version>
|
<version>1.2.2-R0-SNAPSHOT</version>
|
||||||
<type>jar</type>
|
<type>jar</type>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bukkit</groupId>
|
<groupId>org.bukkit</groupId>
|
||||||
<artifactId>minecraft-server</artifactId>
|
<artifactId>minecraft-server</artifactId>
|
||||||
<version>1.1_02</version>
|
<version>1.2.2</version>
|
||||||
<type>jar</type>
|
<type>jar</type>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
@ -14,33 +14,31 @@ public class Block {
|
|||||||
public static final StepSound j = new StepSoundStone("stone", 1.0F, 1.0F);
|
public static final StepSound j = new StepSoundStone("stone", 1.0F, 1.0F);
|
||||||
public static final StepSound k = new StepSound("cloth", 1.0F, 1.0F);
|
public static final StepSound k = new StepSound("cloth", 1.0F, 1.0F);
|
||||||
public static final StepSound l = new StepSoundSand("sand", 1.0F, 1.0F);
|
public static final StepSound l = new StepSoundSand("sand", 1.0F, 1.0F);
|
||||||
public static final Block[] byId = new Block[256];
|
public static final Block[] byId = new Block[4096];
|
||||||
public static final boolean[] n = new boolean[256];
|
public static final boolean[] n = new boolean[4096];
|
||||||
public static final boolean[] o = new boolean[256];
|
public static final int[] lightBlock = new int[4096];
|
||||||
public static final boolean[] isTileEntity = new boolean[256];
|
public static final boolean[] p = new boolean[4096];
|
||||||
public static final int[] lightBlock = new int[256];
|
public static final int[] lightEmission = new int[4096];
|
||||||
public static final boolean[] r = new boolean[256];
|
public static final boolean[] r = new boolean[4096];
|
||||||
public static final int[] lightEmission = new int[256];
|
public static boolean[] s = new boolean[4096];
|
||||||
public static final boolean[] t = new boolean[256];
|
|
||||||
public static boolean[] u = new boolean[256];
|
|
||||||
public static final Block STONE = (new BlockStone(1, 1)).c(1.5F).b(10.0F).a(h).a("stone");
|
public static final Block STONE = (new BlockStone(1, 1)).c(1.5F).b(10.0F).a(h).a("stone");
|
||||||
public static final BlockGrass GRASS = (BlockGrass) (new BlockGrass(2)).c(0.6F).a(g).a("grass");
|
public static final 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").i();
|
public static final Block WOOD = (new Block(5, 4, Material.WOOD)).c(2.0F).b(5.0F).a(e).a("wood").i();
|
||||||
public static final Block SAPLING = (new BlockSapling(6, 15)).c(0.0F).a(g).a("sapling").i();
|
public static final Block SAPLING = (new BlockSapling(6, 15)).c(0.0F).a(g).a("sapling").i();
|
||||||
public static final Block BEDROCK = (new Block(7, 17, Material.STONE)).k().b(6000000.0F).a(h).a("bedrock").p();
|
public static final Block BEDROCK = (new Block(7, 17, Material.STONE)).k().b(6000000.0F).a(h).a("bedrock").r();
|
||||||
public static final Block WATER = (new BlockFlowing(8, Material.WATER)).c(100.0F).g(3).a("water").p().i();
|
public static final Block WATER = (new BlockFlowing(8, Material.WATER)).c(100.0F).f(3).a("water").r().i();
|
||||||
public static final Block STATIONARY_WATER = (new BlockStationary(9, Material.WATER)).c(100.0F).g(3).a("water").p().i();
|
public static final Block STATIONARY_WATER = (new BlockStationary(9, Material.WATER)).c(100.0F).f(3).a("water").r().i();
|
||||||
public static final Block LAVA = (new BlockFlowing(10, Material.LAVA)).c(0.0F).a(1.0F).g(255).a("lava").p().i();
|
public static final Block LAVA = (new BlockFlowing(10, Material.LAVA)).c(0.0F).a(1.0F).f(255).a("lava").r().i();
|
||||||
public static final Block STATIONARY_LAVA = (new BlockStationary(11, Material.LAVA)).c(100.0F).a(1.0F).g(255).a("lava").p().i();
|
public static final Block STATIONARY_LAVA = (new BlockStationary(11, Material.LAVA)).c(100.0F).a(1.0F).f(255).a("lava").r().i();
|
||||||
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").i();
|
public static final Block LOG = (new BlockLog(17)).c(2.0F).a(e).a("log").i();
|
||||||
public static final BlockLeaves LEAVES = (BlockLeaves) (new BlockLeaves(18, 52)).c(0.2F).g(1).a(g).a("leaves").i();
|
public static final BlockLeaves LEAVES = (BlockLeaves) (new BlockLeaves(18, 52)).c(0.2F).f(1).a(g).a("leaves").i();
|
||||||
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");
|
||||||
@ -48,11 +46,11 @@ public class Block {
|
|||||||
public static final Block DISPENSER = (new BlockDispenser(23)).c(3.5F).a(h).a("dispenser").i();
|
public static final Block DISPENSER = (new BlockDispenser(23)).c(3.5F).a(h).a("dispenser").i();
|
||||||
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").i();
|
public static final Block NOTE_BLOCK = (new BlockNote(25)).c(0.8F).a("musicBlock").i();
|
||||||
public static final Block BED = (new BlockBed(26)).c(0.2F).a("bed").p().i();
|
public static final Block BED = (new BlockBed(26)).c(0.2F).a("bed").r().i();
|
||||||
public static final Block GOLDEN_RAIL = (new BlockMinecartTrack(27, 179, true)).c(0.7F).a(i).a("goldenRail").i();
|
public static final Block GOLDEN_RAIL = (new BlockMinecartTrack(27, 179, true)).c(0.7F).a(i).a("goldenRail").i();
|
||||||
public static final Block DETECTOR_RAIL = (new BlockMinecartDetector(28, 195)).c(0.7F).a(i).a("detectorRail").i();
|
public static final Block DETECTOR_RAIL = (new BlockMinecartDetector(28, 195)).c(0.7F).a(i).a("detectorRail").i();
|
||||||
public static final Block PISTON_STICKY = (new BlockPiston(29, 106, true)).a("pistonStickyBase").i();
|
public static final Block PISTON_STICKY = (new BlockPiston(29, 106, true)).a("pistonStickyBase").i();
|
||||||
public static final Block WEB = (new BlockWeb(30, 11)).g(1).c(4.0F).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 PISTON = (new BlockPiston(33, 107, false)).a("pistonBase").i();
|
public static final Block PISTON = (new BlockPiston(33, 107, false)).a("pistonBase").i();
|
||||||
@ -73,39 +71,39 @@ public class Block {
|
|||||||
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(50.0F).b(2000.0F).a(h).a("obsidian");
|
public static final Block OBSIDIAN = (new BlockObsidian(49, 37)).c(50.0F).b(2000.0F).a(h).a("obsidian");
|
||||||
public static final Block TORCH = (new BlockTorch(50, 80)).c(0.0F).a(0.9375F).a(e).a("torch").i();
|
public static final Block TORCH = (new BlockTorch(50, 80)).c(0.0F).a(0.9375F).a(e).a("torch").i();
|
||||||
public static final BlockFire FIRE = (BlockFire) (new BlockFire(51, 31)).c(0.0F).a(1.0F).a(e).a("fire").p();
|
public static final BlockFire FIRE = (BlockFire) (new BlockFire(51, 31)).c(0.0F).a(1.0F).a(e).a("fire").r();
|
||||||
public static final Block MOB_SPAWNER = (new BlockMobSpawner(52, 65)).c(5.0F).a(i).a("mobSpawner").p();
|
public static final Block MOB_SPAWNER = (new BlockMobSpawner(52, 65)).c(5.0F).a(i).a("mobSpawner").r();
|
||||||
public static final Block WOOD_STAIRS = (new BlockStairs(53, WOOD)).a("stairsWood").i();
|
public static final Block WOOD_STAIRS = (new BlockStairs(53, WOOD)).a("stairsWood").i();
|
||||||
public static final Block CHEST = (new BlockChest(54)).c(2.5F).a(e).a("chest").i();
|
public static final Block CHEST = (new BlockChest(54)).c(2.5F).a(e).a("chest").i();
|
||||||
public static final Block REDSTONE_WIRE = (new BlockRedstoneWire(55, 164)).c(0.0F).a(d).a("redstoneDust").p().i();
|
public static final Block REDSTONE_WIRE = (new BlockRedstoneWire(55, 164)).c(0.0F).a(d).a("redstoneDust").r().i();
|
||||||
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").p().i();
|
public static final Block CROPS = (new BlockCrops(59, 88)).c(0.0F).a(g).a("crops").r().i();
|
||||||
public static final Block SOIL = (new BlockSoil(60)).c(0.6F).a(f).a("farmland").i();
|
public static final Block SOIL = (new BlockSoil(60)).c(0.6F).a(f).a("farmland").i();
|
||||||
public static final Block FURNACE = (new BlockFurnace(61, false)).c(3.5F).a(h).a("furnace").i();
|
public static final Block FURNACE = (new BlockFurnace(61, false)).c(3.5F).a(h).a("furnace").i();
|
||||||
public static final Block BURNING_FURNACE = (new BlockFurnace(62, true)).c(3.5F).a(h).a(0.875F).a("furnace").i();
|
public static final Block BURNING_FURNACE = (new BlockFurnace(62, true)).c(3.5F).a(h).a(0.875F).a("furnace").i();
|
||||||
public static final Block SIGN_POST = (new BlockSign(63, TileEntitySign.class, true)).c(1.0F).a(e).a("sign").p().i();
|
public static final Block SIGN_POST = (new BlockSign(63, TileEntitySign.class, true)).c(1.0F).a(e).a("sign").r().i();
|
||||||
public static final Block WOODEN_DOOR = (new BlockDoor(64, Material.WOOD)).c(3.0F).a(e).a("doorWood").p().i();
|
public static final Block WOODEN_DOOR = (new BlockDoor(64, Material.WOOD)).c(3.0F).a(e).a("doorWood").r().i();
|
||||||
public static final Block LADDER = (new BlockLadder(65, 83)).c(0.4F).a(e).a("ladder").i();
|
public static final Block LADDER = (new BlockLadder(65, 83)).c(0.4F).a(e).a("ladder").i();
|
||||||
public static final Block RAILS = (new BlockMinecartTrack(66, 128, false)).c(0.7F).a(i).a("rail").i();
|
public static final Block RAILS = (new BlockMinecartTrack(66, 128, false)).c(0.7F).a(i).a("rail").i();
|
||||||
public static final Block COBBLESTONE_STAIRS = (new BlockStairs(67, COBBLESTONE)).a("stairsStone").i();
|
public static final Block COBBLESTONE_STAIRS = (new BlockStairs(67, COBBLESTONE)).a("stairsStone").i();
|
||||||
public static final Block WALL_SIGN = (new BlockSign(68, TileEntitySign.class, false)).c(1.0F).a(e).a("sign").p().i();
|
public static final Block WALL_SIGN = (new BlockSign(68, TileEntitySign.class, false)).c(1.0F).a(e).a("sign").r().i();
|
||||||
public static final Block LEVER = (new BlockLever(69, 96)).c(0.5F).a(e).a("lever").i();
|
public static final Block LEVER = (new BlockLever(69, 96)).c(0.5F).a(e).a("lever").i();
|
||||||
public static final Block STONE_PLATE = (new BlockPressurePlate(70, STONE.textureId, EnumMobType.MOBS, Material.STONE)).c(0.5F).a(h).a("pressurePlate").i();
|
public static final Block STONE_PLATE = (new BlockPressurePlate(70, STONE.textureId, EnumMobType.MOBS, Material.STONE)).c(0.5F).a(h).a("pressurePlate").i();
|
||||||
public static final Block IRON_DOOR_BLOCK = (new BlockDoor(71, Material.ORE)).c(5.0F).a(i).a("doorIron").p().i();
|
public static final Block IRON_DOOR_BLOCK = (new BlockDoor(71, Material.ORE)).c(5.0F).a(i).a("doorIron").r().i();
|
||||||
public static final Block WOOD_PLATE = (new BlockPressurePlate(72, WOOD.textureId, EnumMobType.EVERYTHING, Material.WOOD)).c(0.5F).a(e).a("pressurePlate").i();
|
public static final Block WOOD_PLATE = (new BlockPressurePlate(72, WOOD.textureId, EnumMobType.EVERYTHING, Material.WOOD)).c(0.5F).a(e).a("pressurePlate").i();
|
||||||
public static final Block REDSTONE_ORE = (new BlockRedstoneOre(73, 51, false)).c(3.0F).b(5.0F).a(h).a("oreRedstone").i();
|
public static final Block REDSTONE_ORE = (new BlockRedstoneOre(73, 51, false)).c(3.0F).b(5.0F).a(h).a("oreRedstone").i();
|
||||||
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").i();
|
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").i();
|
||||||
public static final Block REDSTONE_TORCH_OFF = (new BlockRedstoneTorch(75, 115, false)).c(0.0F).a(e).a("notGate").i();
|
public static final Block REDSTONE_TORCH_OFF = (new BlockRedstoneTorch(75, 115, false)).c(0.0F).a(e).a("notGate").i();
|
||||||
public static final Block REDSTONE_TORCH_ON = (new BlockRedstoneTorch(76, 99, true)).c(0.0F).a(0.5F).a(e).a("notGate").i();
|
public static final Block REDSTONE_TORCH_ON = (new BlockRedstoneTorch(76, 99, true)).c(0.0F).a(0.5F).a(e).a("notGate").i();
|
||||||
public static final Block STONE_BUTTON = (new BlockButton(77, STONE.textureId)).c(0.5F).a(h).a("button").i();
|
public static final Block STONE_BUTTON = (new BlockButton(77, STONE.textureId)).c(0.5F).a(h).a("button").i();
|
||||||
public static final Block SNOW = (new BlockSnow(78, 66)).c(0.1F).a(k).a("snow").g(0);
|
public static final Block SNOW = (new BlockSnow(78, 66)).c(0.1F).a(k).a("snow").f(0);
|
||||||
public static final Block ICE = (new BlockIce(79, 67)).c(0.5F).g(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").p();
|
public static final Block SUGAR_CANE_BLOCK = (new BlockReed(83, 73)).c(0.0F).a(g).a("reeds").r();
|
||||||
public static final Block JUKEBOX = (new BlockJukeBox(84, 74)).c(2.0F).b(10.0F).a(h).a("jukebox").i();
|
public static final Block JUKEBOX = (new BlockJukeBox(84, 74)).c(2.0F).b(10.0F).a(h).a("jukebox").i();
|
||||||
public static final Block FENCE = (new BlockFence(85, 4)).c(2.0F).b(5.0F).a(e).a("fence");
|
public static final Block FENCE = (new BlockFence(85, 4)).c(2.0F).b(5.0F).a(e).a("fence");
|
||||||
public static final Block PUMPKIN = (new BlockPumpkin(86, 102, false)).c(1.0F).a(e).a("pumpkin").i();
|
public static final Block PUMPKIN = (new BlockPumpkin(86, 102, false)).c(1.0F).a(e).a("pumpkin").i();
|
||||||
@ -114,11 +112,11 @@ public class Block {
|
|||||||
public static final Block GLOWSTONE = (new BlockLightStone(89, 105, Material.SHATTERABLE)).c(0.3F).a(j).a(1.0F).a("lightgem");
|
public static final Block GLOWSTONE = (new BlockLightStone(89, 105, Material.SHATTERABLE)).c(0.3F).a(j).a(1.0F).a("lightgem");
|
||||||
public static final BlockPortal PORTAL = (BlockPortal) (new BlockPortal(90, 14)).c(-1.0F).a(j).a(0.75F).a("portal");
|
public static final 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").i();
|
public static final Block JACK_O_LANTERN = (new BlockPumpkin(91, 102, true)).c(1.0F).a(e).a(1.0F).a("litpumpkin").i();
|
||||||
public static final Block CAKE_BLOCK = (new BlockCake(92, 121)).c(0.5F).a(k).a("cake").p().i();
|
public static final Block CAKE_BLOCK = (new BlockCake(92, 121)).c(0.5F).a(k).a("cake").r().i();
|
||||||
public static final Block DIODE_OFF = (new BlockDiode(93, false)).c(0.0F).a(e).a("diode").p().i();
|
public static final Block DIODE_OFF = (new BlockDiode(93, false)).c(0.0F).a(e).a("diode").r().i();
|
||||||
public static final Block DIODE_ON = (new BlockDiode(94, true)).c(0.0F).a(0.625F).a(e).a("diode").p().i();
|
public static final Block DIODE_ON = (new BlockDiode(94, true)).c(0.0F).a(0.625F).a(e).a("diode").r().i();
|
||||||
public static final Block LOCKED_CHEST = (new BlockLockedChest(95)).c(0.0F).a(1.0F).a(e).a("lockedchest").a(true).i();
|
public static final Block LOCKED_CHEST = (new BlockLockedChest(95)).c(0.0F).a(1.0F).a(e).a("lockedchest").a(true).i();
|
||||||
public static final Block TRAP_DOOR = (new BlockTrapdoor(96, Material.WOOD)).c(3.0F).a(e).a("trapdoor").p().i();
|
public static final Block TRAP_DOOR = (new BlockTrapdoor(96, Material.WOOD)).c(3.0F).a(e).a("trapdoor").r().i();
|
||||||
public static final Block MONSTER_EGGS = (new BlockMonsterEggs(97)).c(0.75F);
|
public static final Block MONSTER_EGGS = (new BlockMonsterEggs(97)).c(0.75F);
|
||||||
public static final Block SMOOTH_BRICK = (new BlockSmoothBrick(98)).c(1.5F).b(10.0F).a(h).a("stonebricksmooth");
|
public static final Block SMOOTH_BRICK = (new BlockSmoothBrick(98)).c(1.5F).b(10.0F).a(h).a("stonebricksmooth");
|
||||||
public static final Block BIG_MUSHROOM_1 = (new BlockHugeMushroom(99, Material.WOOD, 142, 0)).c(0.2F).a(e).a("mushroom").i();
|
public static final Block BIG_MUSHROOM_1 = (new BlockHugeMushroom(99, Material.WOOD, 142, 0)).c(0.2F).a(e).a("mushroom").i();
|
||||||
@ -145,12 +143,16 @@ public class Block {
|
|||||||
public static final Block ENDER_PORTAL_FRAME = (new BlockEnderPortalFrame(120)).a(j).a(0.125F).c(-1.0F).a("endPortalFrame").i().b(6000000.0F);
|
public static final Block ENDER_PORTAL_FRAME = (new BlockEnderPortalFrame(120)).a(j).a(0.125F).c(-1.0F).a("endPortalFrame").i().b(6000000.0F);
|
||||||
public static final Block WHITESTONE = (new Block(121, 175, Material.STONE)).c(3.0F).b(15.0F).a(h).a("whiteStone");
|
public static final Block WHITESTONE = (new Block(121, 175, Material.STONE)).c(3.0F).b(15.0F).a(h).a("whiteStone");
|
||||||
public static final Block DRAGON_EGG = (new BlockDragonEgg(122, 167)).c(3.0F).b(15.0F).a(h).a(0.125F).a("dragonEgg");
|
public static final Block DRAGON_EGG = (new BlockDragonEgg(122, 167)).c(3.0F).b(15.0F).a(h).a(0.125F).a("dragonEgg");
|
||||||
|
public static final Block REDSTONE_LAMP_OFF = (new BlockRedstoneLamp(123, false)).c(0.3F).a(j).a("redstoneLight");
|
||||||
|
public static final Block REDSTONE_LAMP_ON = (new BlockRedstoneLamp(124, true)).c(0.3F).a(j).a("redstoneLight");
|
||||||
public int textureId;
|
public int textureId;
|
||||||
public final int id;
|
public final int id;
|
||||||
protected float strength;
|
protected float strength;
|
||||||
protected float durability;
|
protected float durability;
|
||||||
protected boolean bR;
|
protected boolean bR;
|
||||||
protected boolean bS;
|
protected boolean bS;
|
||||||
|
protected boolean bT;
|
||||||
|
protected boolean isTileEntity;
|
||||||
public double minX;
|
public double minX;
|
||||||
public double minY;
|
public double minY;
|
||||||
public double minZ;
|
public double minZ;
|
||||||
@ -158,7 +160,7 @@ public class Block {
|
|||||||
public double maxY;
|
public double maxY;
|
||||||
public double maxZ;
|
public double maxZ;
|
||||||
public StepSound stepSound;
|
public StepSound stepSound;
|
||||||
public float ca;
|
public float cc;
|
||||||
public final Material material;
|
public final Material material;
|
||||||
public float frictionFactor;
|
public float frictionFactor;
|
||||||
private String name;
|
private String name;
|
||||||
@ -167,7 +169,7 @@ public class Block {
|
|||||||
this.bR = true;
|
this.bR = true;
|
||||||
this.bS = true;
|
this.bS = true;
|
||||||
this.stepSound = d;
|
this.stepSound = d;
|
||||||
this.ca = 1.0F;
|
this.cc = 1.0F;
|
||||||
this.frictionFactor = 0.6F;
|
this.frictionFactor = 0.6F;
|
||||||
if (byId[i] != null) {
|
if (byId[i] != null) {
|
||||||
throw new IllegalArgumentException("Slot " + i + " is already occupied by " + byId[i] + " when adding " + this);
|
throw new IllegalArgumentException("Slot " + i + " is already occupied by " + byId[i] + " when adding " + this);
|
||||||
@ -176,15 +178,14 @@ public class Block {
|
|||||||
byId[i] = this;
|
byId[i] = this;
|
||||||
this.id = i;
|
this.id = i;
|
||||||
this.a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
this.a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||||
o[i] = this.a();
|
n[i] = this.a();
|
||||||
lightBlock[i] = this.a() ? 255 : 0;
|
lightBlock[i] = this.a() ? 255 : 0;
|
||||||
r[i] = !material.blocksLight();
|
p[i] = !material.blocksLight();
|
||||||
isTileEntity[i] = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Block i() {
|
protected Block i() {
|
||||||
t[this.id] = true;
|
r[this.id] = true;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -200,7 +201,7 @@ public class Block {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Block g(int i) {
|
protected Block f(int i) {
|
||||||
lightBlock[this.id] = i;
|
lightBlock[this.id] = i;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@ -215,10 +216,20 @@ public class Block {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean g(int i) {
|
||||||
|
Block block = byId[i];
|
||||||
|
|
||||||
|
return block == null ? false : block.material.j() && block.b();
|
||||||
|
}
|
||||||
|
|
||||||
public boolean b() {
|
public boolean b() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean b(IBlockAccess iblockaccess, int i, int j, int k) {
|
||||||
|
return !this.material.isSolid();
|
||||||
|
}
|
||||||
|
|
||||||
public int c() {
|
public int c() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -242,10 +253,18 @@ public class Block {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected Block a(boolean flag) {
|
protected Block a(boolean flag) {
|
||||||
n[this.id] = flag;
|
this.bT = flag;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean m() {
|
||||||
|
return this.bT;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean n() {
|
||||||
|
return this.isTileEntity;
|
||||||
|
}
|
||||||
|
|
||||||
public void a(float f, float f1, float f2, float f3, float f4, float f5) {
|
public void a(float f, float f1, float f2, float f3, float f4, float f5) {
|
||||||
this.minX = (double) f;
|
this.minX = (double) f;
|
||||||
this.minY = (double) f1;
|
this.minY = (double) f1;
|
||||||
@ -284,10 +303,10 @@ public class Block {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean a(int i, boolean flag) {
|
public boolean a(int i, boolean flag) {
|
||||||
return this.x_();
|
return this.F_();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean x_() {
|
public boolean F_() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -510,7 +529,7 @@ public class Block {
|
|||||||
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);
|
||||||
entityhuman.c(0.025F);
|
entityhuman.c(0.025F);
|
||||||
if (this.b() && !isTileEntity[this.id] && EnchantmentManager.hasSilkTouchEnchantment(entityhuman.inventory)) {
|
if (this.b() && !this.isTileEntity && EnchantmentManager.hasSilkTouchEnchantment(entityhuman.inventory)) {
|
||||||
ItemStack itemstack = this.a_(l);
|
ItemStack itemstack = this.a_(l);
|
||||||
|
|
||||||
if (itemstack != null) {
|
if (itemstack != null) {
|
||||||
@ -549,20 +568,20 @@ public class Block {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return LocaleI18n.get(this.n() + ".name");
|
return LocaleI18n.get(this.p() + ".name");
|
||||||
}
|
}
|
||||||
|
|
||||||
public String n() {
|
public String p() {
|
||||||
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 o() {
|
public boolean q() {
|
||||||
return this.bS;
|
return this.bS;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Block p() {
|
protected Block r() {
|
||||||
this.bS = false;
|
this.bS = false;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@ -609,11 +628,15 @@ public class Block {
|
|||||||
flag = true;
|
flag = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
u[i] = flag;
|
if (p[i]) {
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
s[i] = flag;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
r[0] = true;
|
p[0] = true;
|
||||||
StatisticList.b();
|
StatisticList.b();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,19 +38,19 @@ public class BlockDispenser extends BlockContainer {
|
|||||||
int k1 = world.getTypeId(i + 1, j, k);
|
int k1 = world.getTypeId(i + 1, j, k);
|
||||||
byte b0 = 3;
|
byte b0 = 3;
|
||||||
|
|
||||||
if (Block.o[l] && !Block.o[i1]) {
|
if (Block.n[l] && !Block.n[i1]) {
|
||||||
b0 = 3;
|
b0 = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Block.o[i1] && !Block.o[l]) {
|
if (Block.n[i1] && !Block.n[l]) {
|
||||||
b0 = 2;
|
b0 = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Block.o[j1] && !Block.o[k1]) {
|
if (Block.n[j1] && !Block.n[k1]) {
|
||||||
b0 = 5;
|
b0 = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Block.o[k1] && !Block.o[j1]) {
|
if (Block.n[k1] && !Block.n[j1]) {
|
||||||
b0 = 4;
|
b0 = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -167,6 +167,20 @@ public class BlockDispenser extends BlockContainer {
|
|||||||
entitypotion.a((double) b0, 0.10000000149011612D, (double) b1, 1.375F, 3.0F);
|
entitypotion.a((double) b0, 0.10000000149011612D, (double) b1, 1.375F, 3.0F);
|
||||||
world.addEntity(entitypotion);
|
world.addEntity(entitypotion);
|
||||||
world.triggerEffect(1002, i, j, k, 0);
|
world.triggerEffect(1002, i, j, k, 0);
|
||||||
|
} else if (itemstack.id == Item.EXP_BOTTLE.id) {
|
||||||
|
EntityThrownExpBottle entitythrownexpbottle = new EntityThrownExpBottle(world, d0, d1, d2);
|
||||||
|
|
||||||
|
entitythrownexpbottle.a((double) b0, 0.10000000149011612D, (double) b1, 1.375F, 3.0F);
|
||||||
|
world.addEntity(entitythrownexpbottle);
|
||||||
|
world.triggerEffect(1002, i, j, k, 0);
|
||||||
|
} else if (itemstack.id == Item.MONSTER_EGG.id) {
|
||||||
|
ItemMonsterEgg.a(world, itemstack.getData(), d0 + (double) b0 * 0.3D, d1 - 0.3D, d2 + (double) b1 * 0.3D);
|
||||||
|
world.triggerEffect(1002, i, j, k, 0);
|
||||||
|
} else if (itemstack.id == Item.FIREBALL.id) {
|
||||||
|
EntitySmallFireball entitysmallfireball = new EntitySmallFireball(world, d0 + (double) b0 * 0.3D, d1, d2 + (double) b1 * 0.3D, (double) b0 + random.nextGaussian() * 0.05D, random.nextGaussian() * 0.05D, (double) b1 + random.nextGaussian() * 0.05D);
|
||||||
|
|
||||||
|
world.addEntity(entitysmallfireball);
|
||||||
|
world.triggerEffect(1009, i, j, k, 0);
|
||||||
} else {
|
} else {
|
||||||
EntityItem entityitem = new EntityItem(world, d0, d1 - 0.3D, d2, itemstack);
|
EntityItem entityitem = new EntityItem(world, d0, d1 - 0.3D, d2, itemstack);
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
|
@ -19,33 +19,16 @@ public class BlockDoor extends Block {
|
|||||||
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 int a(int i, int j) {
|
|
||||||
if (i != 0 && i != 1) {
|
|
||||||
int k = this.e(j);
|
|
||||||
|
|
||||||
if ((k == 0 || k == 2) ^ i <= 3) {
|
|
||||||
return this.textureId;
|
|
||||||
} else {
|
|
||||||
int l = k / 2 + (i & 1 ^ k);
|
|
||||||
|
|
||||||
l += (j & 4) / 4;
|
|
||||||
int i1 = this.textureId - (j & 8) * 2;
|
|
||||||
|
|
||||||
if ((l & 1) != 0) {
|
|
||||||
i1 = -i1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return i1;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return this.textureId;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean a() {
|
public boolean a() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean b(IBlockAccess iblockaccess, int i, int j, int k) {
|
||||||
|
int l = this.e(iblockaccess, i, j, k);
|
||||||
|
|
||||||
|
return (l & 4) != 0;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean b() {
|
public boolean b() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -60,27 +43,57 @@ public class BlockDoor extends Block {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void updateShape(IBlockAccess iblockaccess, int i, int j, int k) {
|
public void updateShape(IBlockAccess iblockaccess, int i, int j, int k) {
|
||||||
this.d(this.e(iblockaccess.getData(i, j, k)));
|
this.d(this.e(iblockaccess, i, j, k));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void d(int i) {
|
public int c(IBlockAccess iblockaccess, int i, int j, int k) {
|
||||||
|
return this.e(iblockaccess, i, j, k) & 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean d(IBlockAccess iblockaccess, int i, int j, int k) {
|
||||||
|
return (this.e(iblockaccess, i, j, k) & 4) != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void d(int i) {
|
||||||
float f = 0.1875F;
|
float f = 0.1875F;
|
||||||
|
|
||||||
this.a(0.0F, 0.0F, 0.0F, 1.0F, 2.0F, 1.0F);
|
this.a(0.0F, 0.0F, 0.0F, 1.0F, 2.0F, 1.0F);
|
||||||
if (i == 0) {
|
int j = i & 3;
|
||||||
this.a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
|
boolean flag = (i & 4) != 0;
|
||||||
}
|
boolean flag1 = (i & 16) != 0;
|
||||||
|
|
||||||
if (i == 1) {
|
if (j == 0) {
|
||||||
this.a(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
if (!flag) {
|
||||||
}
|
this.a(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
|
||||||
|
} else if (!flag1) {
|
||||||
if (i == 2) {
|
this.a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
|
||||||
this.a(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
|
} else {
|
||||||
}
|
this.a(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
|
||||||
|
}
|
||||||
if (i == 3) {
|
} else if (j == 1) {
|
||||||
this.a(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
|
if (!flag) {
|
||||||
|
this.a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
|
||||||
|
} else if (!flag1) {
|
||||||
|
this.a(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||||
|
} else {
|
||||||
|
this.a(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
|
||||||
|
}
|
||||||
|
} else if (j == 2) {
|
||||||
|
if (!flag) {
|
||||||
|
this.a(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||||
|
} else if (!flag1) {
|
||||||
|
this.a(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
|
||||||
|
} else {
|
||||||
|
this.a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
|
||||||
|
}
|
||||||
|
} else if (j == 3) {
|
||||||
|
if (!flag) {
|
||||||
|
this.a(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
|
||||||
|
} else if (!flag1) {
|
||||||
|
this.a(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
|
||||||
|
} else {
|
||||||
|
this.a(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,46 +105,40 @@ public class BlockDoor extends Block {
|
|||||||
if (this.material == Material.ORE) {
|
if (this.material == Material.ORE) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
int l = world.getData(i, j, k);
|
int l = this.e((IBlockAccess) world, i, j, k);
|
||||||
|
int i1 = l & 7;
|
||||||
|
|
||||||
|
i1 ^= 4;
|
||||||
if ((l & 8) != 0) {
|
if ((l & 8) != 0) {
|
||||||
if (world.getTypeId(i, j - 1, k) == this.id) {
|
world.setData(i, j - 1, k, i1);
|
||||||
this.interact(world, i, j - 1, k, entityhuman);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
if (world.getTypeId(i, j + 1, k) == this.id) {
|
|
||||||
world.setData(i, j + 1, k, (l ^ 4) + 8);
|
|
||||||
}
|
|
||||||
|
|
||||||
world.setData(i, j, k, l ^ 4);
|
|
||||||
world.b(i, j - 1, k, i, j, k);
|
world.b(i, j - 1, k, i, j, k);
|
||||||
world.a(entityhuman, 1003, i, j, k, 0);
|
} else {
|
||||||
return true;
|
world.setData(i, j, k, i1);
|
||||||
|
world.b(i, j, k, i, j, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
world.a(entityhuman, 1003, i, j, k, 0);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDoor(World world, int i, int j, int k, boolean flag) {
|
public void setDoor(World world, int i, int j, int k, boolean flag) {
|
||||||
int l = world.getData(i, j, k);
|
int l = this.e((IBlockAccess) world, i, j, k);
|
||||||
|
boolean flag1 = (l & 4) != 0;
|
||||||
|
|
||||||
if ((l & 8) != 0) {
|
if (flag1 != flag) {
|
||||||
if (world.getTypeId(i, j - 1, k) == this.id) {
|
int i1 = l & 7;
|
||||||
this.setDoor(world, i, j - 1, k, flag);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
boolean flag1 = (world.getData(i, j, k) & 4) > 0;
|
|
||||||
|
|
||||||
if (flag1 != flag) {
|
i1 ^= 4;
|
||||||
if (world.getTypeId(i, j + 1, k) == this.id) {
|
if ((l & 8) != 0) {
|
||||||
world.setData(i, j + 1, k, (l ^ 4) + 8);
|
world.setData(i, j - 1, k, i1);
|
||||||
}
|
|
||||||
|
|
||||||
world.setData(i, j, k, l ^ 4);
|
|
||||||
world.b(i, j - 1, k, i, j, k);
|
world.b(i, j - 1, k, i, j, k);
|
||||||
world.a((EntityHuman) null, 1003, i, j, k, 0);
|
} else {
|
||||||
|
world.setData(i, j, k, i1);
|
||||||
|
world.b(i, j, k, i, j, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
world.a((EntityHuman) null, 1003, i, j, k, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -196,19 +203,31 @@ public class BlockDoor extends Block {
|
|||||||
return super.a(world, i, j, k, vec3d, vec3d1);
|
return super.a(world, i, j, k, vec3d, vec3d1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int e(int i) {
|
|
||||||
return (i & 4) == 0 ? i - 1 & 3 : i & 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean canPlace(World world, int i, int j, int k) {
|
public boolean canPlace(World world, int i, int j, int k) {
|
||||||
return j >= world.height - 1 ? false : world.e(i, j - 1, k) && super.canPlace(world, i, j, k) && super.canPlace(world, i, j + 1, k);
|
return j >= 255 ? false : world.e(i, j - 1, k) && super.canPlace(world, i, j, k) && super.canPlace(world, i, j + 1, k);
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean f(int i) {
|
|
||||||
return (i & 4) != 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int g() {
|
public int g() {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int e(IBlockAccess iblockaccess, int i, int j, int k) {
|
||||||
|
int l = iblockaccess.getData(i, j, k);
|
||||||
|
boolean flag = (l & 8) != 0;
|
||||||
|
int i1;
|
||||||
|
int j1;
|
||||||
|
|
||||||
|
if (flag) {
|
||||||
|
i1 = iblockaccess.getData(i, j - 1, k);
|
||||||
|
j1 = l;
|
||||||
|
} else {
|
||||||
|
i1 = l;
|
||||||
|
j1 = iblockaccess.getData(i, j + 1, k);
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean flag1 = (j1 & 1) != 0;
|
||||||
|
int k1 = i1 & 7 | (flag ? 8 : 0) | (flag1 ? 16 : 0);
|
||||||
|
|
||||||
|
return k1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@ public class BlockFire extends Block {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int d() {
|
public int d() {
|
||||||
return 40;
|
return 30;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void a(World world, int i, int j, int k, Random random) {
|
public void a(World world, int i, int j, int k, Random random) {
|
||||||
@ -74,7 +74,7 @@ public class BlockFire extends Block {
|
|||||||
fireExtinguished(world, i, j, k); // CraftBukkit - invalid place location
|
fireExtinguished(world, i, j, k); // CraftBukkit - invalid place location
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!flag && world.w() && (world.v(i, j, k) || world.v(i - 1, j, k) || world.v(i + 1, j, k) || world.v(i, j, k - 1) || world.v(i, j, k + 1))) {
|
if (!flag && world.x() && (world.y(i, j, k) || world.y(i - 1, j, k) || world.y(i + 1, j, k) || world.y(i, j, k - 1) || world.y(i, j, k + 1))) {
|
||||||
fireExtinguished(world, i, j, k); // CraftBukkit - extinguished by rain
|
fireExtinguished(world, i, j, k); // CraftBukkit - extinguished by rain
|
||||||
} else {
|
} else {
|
||||||
int l = world.getData(i, j, k);
|
int l = world.getData(i, j, k);
|
||||||
@ -83,20 +83,27 @@ public class BlockFire extends Block {
|
|||||||
world.setRawData(i, j, k, l + random.nextInt(3) / 2);
|
world.setRawData(i, j, k, l + random.nextInt(3) / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
world.c(i, j, k, this.id, this.d());
|
world.c(i, j, k, this.id, this.d() + random.nextInt(10));
|
||||||
if (!flag && !this.g(world, i, j, k)) {
|
if (!flag && !this.g(world, i, j, k)) {
|
||||||
if (!world.e(i, j - 1, k) || l > 3) {
|
if (!world.e(i, j - 1, k) || l > 3) {
|
||||||
fireExtinguished(world, i, j, k); // CraftBukkit - burn out
|
fireExtinguished(world, i, j, k); // CraftBukkit - burn out
|
||||||
}
|
}
|
||||||
} else if (!flag && !this.b(world, i, j - 1, k) && l == 15 && random.nextInt(4) == 0) {
|
} else if (!flag && !this.c(world, i, j - 1, k) && l == 15 && random.nextInt(4) == 0) {
|
||||||
fireExtinguished(world, i, j, k); // CraftBukkit - burn out
|
fireExtinguished(world, i, j, k); // CraftBukkit - burn out
|
||||||
} else {
|
} else {
|
||||||
this.a(world, i + 1, j, k, 300, random, l);
|
boolean flag1 = world.z(i, j, k);
|
||||||
this.a(world, i - 1, j, k, 300, random, l);
|
byte b0 = 0;
|
||||||
this.a(world, i, j - 1, k, 250, random, l);
|
|
||||||
this.a(world, i, j + 1, k, 250, random, l);
|
if (flag1) {
|
||||||
this.a(world, i, j, k - 1, 300, random, l);
|
b0 = -50;
|
||||||
this.a(world, i, j, k + 1, 300, random, l);
|
}
|
||||||
|
|
||||||
|
this.a(world, i + 1, j, k, 300 + b0, random, l);
|
||||||
|
this.a(world, i - 1, j, k, 300 + b0, random, l);
|
||||||
|
this.a(world, i, j - 1, k, 250 + b0, random, l);
|
||||||
|
this.a(world, i, j + 1, k, 250 + b0, random, l);
|
||||||
|
this.a(world, i, j, k - 1, 300 + b0, random, l);
|
||||||
|
this.a(world, i, j, k + 1, 300 + b0, random, l);
|
||||||
|
|
||||||
// CraftBukkit start - Call to stop spread of fire.
|
// CraftBukkit start - Call to stop spread of fire.
|
||||||
org.bukkit.Server server = world.getServer();
|
org.bukkit.Server server = world.getServer();
|
||||||
@ -121,7 +128,11 @@ public class BlockFire extends Block {
|
|||||||
if (i2 > 0) {
|
if (i2 > 0) {
|
||||||
int j2 = (i2 + 40) / (l + 30);
|
int j2 = (i2 + 40) / (l + 30);
|
||||||
|
|
||||||
if (j2 > 0 && random.nextInt(l1) <= j2 && (!world.w() || !world.v(i1, k1, j1)) && !world.v(i1 - 1, k1, k) && !world.v(i1 + 1, k1, j1) && !world.v(i1, k1, j1 - 1) && !world.v(i1, k1, j1 + 1)) {
|
if (flag1) {
|
||||||
|
j2 /= 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (j2 > 0 && random.nextInt(l1) <= j2 && (!world.x() || !world.y(i1, k1, j1)) && !world.y(i1 - 1, k1, k) && !world.y(i1 + 1, k1, j1) && !world.y(i1, k1, j1 - 1) && !world.y(i1, k1, j1 + 1)) {
|
||||||
int k2 = l + random.nextInt(5) / 4;
|
int k2 = l + random.nextInt(5) / 4;
|
||||||
|
|
||||||
if (k2 > 15) {
|
if (k2 > 15) {
|
||||||
@ -176,7 +187,7 @@ public class BlockFire extends Block {
|
|||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
if (random.nextInt(i1 + 10) < 5 && !world.v(i, j, k)) {
|
if (random.nextInt(i1 + 10) < 5 && !world.y(i, j, k)) {
|
||||||
int k1 = i1 + random.nextInt(5) / 4;
|
int k1 = i1 + random.nextInt(5) / 4;
|
||||||
|
|
||||||
if (k1 > 15) {
|
if (k1 > 15) {
|
||||||
@ -195,7 +206,7 @@ public class BlockFire extends Block {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean g(World world, int i, int j, int k) {
|
private boolean g(World world, int i, int j, int k) {
|
||||||
return this.b(world, i + 1, j, k) ? true : (this.b(world, i - 1, j, k) ? true : (this.b(world, i, j - 1, k) ? true : (this.b(world, i, j + 1, k) ? true : (this.b(world, i, j, k - 1) ? true : this.b(world, i, j, k + 1)))));
|
return this.c(world, i + 1, j, k) ? true : (this.c(world, i - 1, j, k) ? true : (this.c(world, i, j - 1, k) ? true : (this.c(world, i, j + 1, k) ? true : (this.c(world, i, j, k - 1) ? true : this.c(world, i, j, k + 1)))));
|
||||||
}
|
}
|
||||||
|
|
||||||
private int h(World world, int i, int j, int k) {
|
private int h(World world, int i, int j, int k) {
|
||||||
@ -215,11 +226,11 @@ public class BlockFire extends Block {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean x_() {
|
public boolean F_() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean b(IBlockAccess iblockaccess, int i, int j, int k) {
|
public boolean c(IBlockAccess iblockaccess, int i, int j, int k) {
|
||||||
return this.a[iblockaccess.getTypeId(i, j, k)] > 0;
|
return this.a[iblockaccess.getTypeId(i, j, k)] > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -244,7 +255,7 @@ public class BlockFire extends Block {
|
|||||||
if (!world.e(i, j - 1, k) && !this.g(world, i, j, k)) {
|
if (!world.e(i, j - 1, k) && !this.g(world, i, j, k)) {
|
||||||
fireExtinguished(world, i, j, k); // CraftBukkit - fuel block broke
|
fireExtinguished(world, i, j, k); // CraftBukkit - fuel block broke
|
||||||
} else {
|
} else {
|
||||||
world.c(i, j, k, this.id, this.d());
|
world.c(i, j, k, this.id, this.d() + world.random.nextInt(10));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,10 @@ public class BlockFlowing extends BlockFluids {
|
|||||||
world.notify(i, j, k);
|
world.notify(i, j, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean b(IBlockAccess iblockaccess, int i, int j, int k) {
|
||||||
|
return this.material != Material.LAVA;
|
||||||
|
}
|
||||||
|
|
||||||
public void a(World world, int i, int j, int k, Random random) {
|
public void a(World world, int i, int j, int k, Random random) {
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
org.bukkit.World bworld = world.getWorld();
|
org.bukkit.World bworld = world.getWorld();
|
||||||
@ -35,7 +39,7 @@ public class BlockFlowing extends BlockFluids {
|
|||||||
int l = this.g(world, i, j, k);
|
int l = this.g(world, i, j, k);
|
||||||
byte b0 = 1;
|
byte b0 = 1;
|
||||||
|
|
||||||
if (this.material == Material.LAVA && !world.worldProvider.e) {
|
if (this.material == Material.LAVA && !world.worldProvider.d) {
|
||||||
b0 = 2;
|
b0 = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,19 +31,19 @@ public class BlockFurnace extends BlockContainer {
|
|||||||
int k1 = world.getTypeId(i + 1, j, k);
|
int k1 = world.getTypeId(i + 1, j, k);
|
||||||
byte b0 = 3;
|
byte b0 = 3;
|
||||||
|
|
||||||
if (Block.o[l] && !Block.o[i1]) {
|
if (Block.n[l] && !Block.n[i1]) {
|
||||||
b0 = 3;
|
b0 = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Block.o[i1] && !Block.o[l]) {
|
if (Block.n[i1] && !Block.n[l]) {
|
||||||
b0 = 2;
|
b0 = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Block.o[j1] && !Block.o[k1]) {
|
if (Block.n[j1] && !Block.n[k1]) {
|
||||||
b0 = 5;
|
b0 = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Block.o[k1] && !Block.o[j1]) {
|
if (Block.n[k1] && !Block.n[j1]) {
|
||||||
b0 = 4;
|
b0 = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,14 +139,27 @@ public class BlockLeaves extends BlockTransparant {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void dropNaturally(World world, int i, int j, int k, int l, float f, int i1) {
|
public void dropNaturally(World world, int i, int j, int k, int l, float f, int i1) {
|
||||||
super.dropNaturally(world, i, j, k, l, f, i1);
|
if (!world.isStatic) {
|
||||||
if (!world.isStatic && (l & 3) == 0 && world.random.nextInt(200) == 0) {
|
byte b0 = 20;
|
||||||
this.a(world, i, j, k, new ItemStack(Item.APPLE, 1, 0));
|
|
||||||
|
if ((l & 3) == 3) {
|
||||||
|
b0 = 40;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (world.random.nextInt(b0) == 0) {
|
||||||
|
int j1 = this.getDropType(l, world.random, i1);
|
||||||
|
|
||||||
|
this.a(world, i, j, k, new ItemStack(j1, 1, this.getDropData(l)));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((l & 3) == 0 && world.random.nextInt(200) == 0) {
|
||||||
|
this.a(world, i, j, k, new ItemStack(Item.APPLE, 1, 0));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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) {
|
||||||
if (!world.isStatic && entityhuman.Q() != null && entityhuman.Q().id == Item.SHEARS.id) {
|
if (!world.isStatic && entityhuman.T() != null && entityhuman.T().id == Item.SHEARS.id) {
|
||||||
entityhuman.a(StatisticList.C[this.id], 1);
|
entityhuman.a(StatisticList.C[this.id], 1);
|
||||||
this.a(world, i, j, k, new ItemStack(Block.LEAVES.id, 1, l & 3));
|
this.a(world, i, j, k, new ItemStack(Block.LEAVES.id, 1, l & 3));
|
||||||
} else {
|
} else {
|
||||||
@ -163,7 +176,7 @@ public class BlockLeaves extends BlockTransparant {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int a(int i, int j) {
|
public int a(int i, int j) {
|
||||||
return (j & 3) == 1 ? this.textureId + 80 : this.textureId;
|
return (j & 3) == 1 ? this.textureId + 80 : ((j & 3) == 3 ? this.textureId + 144 : this.textureId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void b(World world, int i, int j, int k, Entity entity) {
|
public void b(World world, int i, int j, int k, Entity entity) {
|
||||||
|
@ -1,265 +0,0 @@
|
|||||||
package net.minecraft.server;
|
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
public class BlockMinecartTrack extends Block {
|
|
||||||
|
|
||||||
private final boolean a;
|
|
||||||
|
|
||||||
public static final boolean g(World world, int i, int j, int k) {
|
|
||||||
int l = world.getTypeId(i, j, k);
|
|
||||||
|
|
||||||
return l == Block.RAILS.id || l == Block.GOLDEN_RAIL.id || l == Block.DETECTOR_RAIL.id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static final boolean d(int i) {
|
|
||||||
return i == Block.RAILS.id || i == Block.GOLDEN_RAIL.id || i == Block.DETECTOR_RAIL.id;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected BlockMinecartTrack(int i, int j, boolean flag) {
|
|
||||||
super(i, j, Material.ORIENTABLE);
|
|
||||||
this.a = flag;
|
|
||||||
this.a(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean h() {
|
|
||||||
return this.a;
|
|
||||||
}
|
|
||||||
|
|
||||||
public AxisAlignedBB e(World world, int i, int j, int k) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean a() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MovingObjectPosition a(World world, int i, int j, int k, Vec3D vec3d, Vec3D vec3d1) {
|
|
||||||
this.updateShape(world, i, j, k);
|
|
||||||
return super.a(world, i, j, k, vec3d, vec3d1);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateShape(IBlockAccess iblockaccess, int i, int j, int k) {
|
|
||||||
int l = iblockaccess.getData(i, j, k);
|
|
||||||
|
|
||||||
if (l >= 2 && l <= 5) {
|
|
||||||
this.a(0.0F, 0.0F, 0.0F, 1.0F, 0.625F, 1.0F);
|
|
||||||
} else {
|
|
||||||
this.a(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public int a(int i, int j) {
|
|
||||||
if (this.a) {
|
|
||||||
if (this.id == Block.GOLDEN_RAIL.id && (j & 8) == 0) {
|
|
||||||
return this.textureId - 16;
|
|
||||||
}
|
|
||||||
} else if (j >= 6) {
|
|
||||||
return this.textureId - 16;
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.textureId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean b() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int c() {
|
|
||||||
return 9;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int a(Random random) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean canPlace(World world, int i, int j, int k) {
|
|
||||||
return world.e(i, j - 1, k);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onPlace(World world, int i, int j, int k) {
|
|
||||||
if (!world.isStatic) {
|
|
||||||
this.a(world, i, j, k, true);
|
|
||||||
if (this.id == Block.GOLDEN_RAIL.id) {
|
|
||||||
//this.doPhysics(world, i, j, k, this.id); // CraftBukkit - Fix dupe with pistons
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void doPhysics(World world, int i, int j, int k, int l) {
|
|
||||||
if (!world.isStatic) {
|
|
||||||
int i1 = world.getData(i, j, k);
|
|
||||||
int j1 = i1;
|
|
||||||
|
|
||||||
if (this.a) {
|
|
||||||
j1 = i1 & 7;
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean flag = false;
|
|
||||||
|
|
||||||
if (!world.e(i, j - 1, k)) {
|
|
||||||
flag = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (j1 == 2 && !world.e(i + 1, j, k)) {
|
|
||||||
flag = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (j1 == 3 && !world.e(i - 1, j, k)) {
|
|
||||||
flag = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (j1 == 4 && !world.e(i, j, k - 1)) {
|
|
||||||
flag = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (j1 == 5 && !world.e(i, j, k + 1)) {
|
|
||||||
flag = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (flag) {
|
|
||||||
this.b(world, i, j, k, world.getData(i, j, k), 0);
|
|
||||||
world.setTypeId(i, j, k, 0);
|
|
||||||
} else if (this.id == Block.GOLDEN_RAIL.id) {
|
|
||||||
boolean flag1 = world.isBlockIndirectlyPowered(i, j, k) || world.isBlockIndirectlyPowered(i, j + 1, k);
|
|
||||||
|
|
||||||
flag1 = flag1 || this.a(world, i, j, k, i1, true, 0) || this.a(world, i, j, k, i1, false, 0);
|
|
||||||
boolean flag2 = false;
|
|
||||||
|
|
||||||
if (flag1 && (i1 & 8) == 0) {
|
|
||||||
world.setData(i, j, k, j1 | 8);
|
|
||||||
flag2 = true;
|
|
||||||
} else if (!flag1 && (i1 & 8) != 0) {
|
|
||||||
world.setData(i, j, k, j1);
|
|
||||||
flag2 = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (flag2) {
|
|
||||||
world.applyPhysics(i, j - 1, k, this.id);
|
|
||||||
if (j1 == 2 || j1 == 3 || j1 == 4 || j1 == 5) {
|
|
||||||
world.applyPhysics(i, j + 1, k, this.id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (l > 0 && Block.byId[l].isPowerSource() && !this.a && MinecartTrackLogic.a(new MinecartTrackLogic(this, world, i, j, k)) == 3) {
|
|
||||||
this.a(world, i, j, k, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void a(World world, int i, int j, int k, boolean flag) {
|
|
||||||
if (!world.isStatic) {
|
|
||||||
(new MinecartTrackLogic(this, world, i, j, k)).a(world.isBlockIndirectlyPowered(i, j, k), flag);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean a(World world, int i, int j, int k, int l, boolean flag, int i1) {
|
|
||||||
if (i1 >= 8) {
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
int j1 = l & 7;
|
|
||||||
boolean flag1 = true;
|
|
||||||
|
|
||||||
switch (j1) {
|
|
||||||
case 0:
|
|
||||||
if (flag) {
|
|
||||||
++k;
|
|
||||||
} else {
|
|
||||||
--k;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 1:
|
|
||||||
if (flag) {
|
|
||||||
--i;
|
|
||||||
} else {
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 2:
|
|
||||||
if (flag) {
|
|
||||||
--i;
|
|
||||||
} else {
|
|
||||||
++i;
|
|
||||||
++j;
|
|
||||||
flag1 = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
j1 = 1;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 3:
|
|
||||||
if (flag) {
|
|
||||||
--i;
|
|
||||||
++j;
|
|
||||||
flag1 = false;
|
|
||||||
} else {
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
|
|
||||||
j1 = 1;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 4:
|
|
||||||
if (flag) {
|
|
||||||
++k;
|
|
||||||
} else {
|
|
||||||
--k;
|
|
||||||
++j;
|
|
||||||
flag1 = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
j1 = 0;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 5:
|
|
||||||
if (flag) {
|
|
||||||
++k;
|
|
||||||
++j;
|
|
||||||
flag1 = false;
|
|
||||||
} else {
|
|
||||||
--k;
|
|
||||||
}
|
|
||||||
|
|
||||||
j1 = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.a(world, i, j, k, flag, i1, j1) ? true : flag1 && this.a(world, i, j - 1, k, flag, i1, j1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean a(World world, int i, int j, int k, boolean flag, int l, int i1) {
|
|
||||||
int j1 = world.getTypeId(i, j, k);
|
|
||||||
|
|
||||||
if (j1 == Block.GOLDEN_RAIL.id) {
|
|
||||||
int k1 = world.getData(i, j, k);
|
|
||||||
int l1 = k1 & 7;
|
|
||||||
|
|
||||||
if (i1 == 1 && (l1 == 0 || l1 == 4 || l1 == 5)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (i1 == 0 && (l1 == 1 || l1 == 2 || l1 == 3)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((k1 & 8) != 0) {
|
|
||||||
if (!world.isBlockIndirectlyPowered(i, j, k) && !world.isBlockIndirectlyPowered(i, j + 1, k)) {
|
|
||||||
return this.a(world, i, j, k, k1, flag, l + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int g() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static boolean a(BlockMinecartTrack blockminecarttrack) {
|
|
||||||
return blockminecarttrack.a;
|
|
||||||
}
|
|
||||||
}
|
|
@ -77,14 +77,14 @@ public class BlockMushroom extends BlockFlower {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected boolean d(int i) {
|
protected boolean d(int i) {
|
||||||
return Block.o[i];
|
return Block.n[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean f(World world, int i, int j, int k) {
|
public boolean f(World world, int i, int j, int k) {
|
||||||
if (j >= 0 && j < world.height) {
|
if (j >= 0 && j < 256) {
|
||||||
int l = world.getTypeId(i, j - 1, k);
|
int l = world.getTypeId(i, j - 1, k);
|
||||||
|
|
||||||
return l == Block.MYCEL.id || world.k(i, j, k) < 13 && this.d(l);
|
return l == Block.MYCEL.id || world.m(i, j, k) < 13 && this.d(l);
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -16,18 +16,18 @@ public class BlockNetherWart extends BlockFlower {
|
|||||||
return i == Block.SOUL_SAND.id;
|
return i == Block.SOUL_SAND.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean f(World world, int i, int j, int k) {
|
||||||
|
return this.d(world.getTypeId(i, j - 1, k));
|
||||||
|
}
|
||||||
|
|
||||||
public void a(World world, int i, int j, int k, Random random) {
|
public void a(World world, int i, int j, int k, Random random) {
|
||||||
int l = world.getData(i, j, k);
|
int l = world.getData(i, j, k);
|
||||||
|
|
||||||
if (l < 3) {
|
if (l < 3) {
|
||||||
WorldChunkManager worldchunkmanager = world.getWorldChunkManager();
|
BiomeBase biomebase = world.getBiome(i, k);
|
||||||
|
|
||||||
if (worldchunkmanager != null) {
|
if (biomebase instanceof BiomeHell && random.nextInt(10) == 0) {
|
||||||
BiomeBase biomebase = worldchunkmanager.getBiome(i, k);
|
org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, i, j, k, this.id, ++l); // CraftBukkit
|
||||||
|
|
||||||
if (biomebase instanceof BiomeHell && random.nextInt(15) == 0) {
|
|
||||||
org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, i, j, k, this.id, ++l); // CraftBukkit
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ public class BlockPiston extends Block {
|
|||||||
if (tileentitypiston.f() == i1 && tileentitypiston.e()) {
|
if (tileentitypiston.f() == i1 && tileentitypiston.e()) {
|
||||||
tileentitypiston.g();
|
tileentitypiston.g();
|
||||||
i2 = tileentitypiston.c();
|
i2 = tileentitypiston.c();
|
||||||
j2 = tileentitypiston.j();
|
j2 = tileentitypiston.k();
|
||||||
flag = true;
|
flag = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -213,6 +213,11 @@ public class BlockPiston extends Block {
|
|||||||
super.a(world, i, j, k, axisalignedbb, arraylist);
|
super.a(world, i, j, k, axisalignedbb, arraylist);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AxisAlignedBB e(World world, int i, int j, int k) {
|
||||||
|
this.updateShape(world, i, j, k);
|
||||||
|
return super.e(world, i, j, k);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean b() {
|
public boolean b() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -277,7 +282,7 @@ public class BlockPiston extends Block {
|
|||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
if (l1 < 13) {
|
if (l1 < 13) {
|
||||||
if (j1 <= 0 || j1 >= world.height - 1) {
|
if (j1 <= 0 || j1 >= 255) {
|
||||||
return -1; // CraftBukkit
|
return -1; // CraftBukkit
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -316,7 +321,7 @@ public class BlockPiston extends Block {
|
|||||||
int i2;
|
int i2;
|
||||||
|
|
||||||
if (l1 < 13) {
|
if (l1 < 13) {
|
||||||
if (j1 <= 0 || j1 >= world.height - 1) {
|
if (j1 <= 0 || j1 >= 255) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,7 +166,7 @@ public class BlockPortal extends BlockHalfTransparant {
|
|||||||
world.getServer().getPluginManager().callEvent(event);
|
world.getServer().getPluginManager().callEvent(event);
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
entity.Y();
|
entity.ac();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,6 +38,10 @@ public class BlockPressurePlate extends Block {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean b(IBlockAccess iblockaccess, int i, int j, int k) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean canPlace(World world, int i, int j, int k) {
|
public boolean canPlace(World world, int i, int j, int k) {
|
||||||
return world.e(i, j - 1, k) || world.getTypeId(i, j - 1, k) == Block.FENCE.id;
|
return world.e(i, j - 1, k) || world.getTypeId(i, j - 1, k) == Block.FENCE.id;
|
||||||
}
|
}
|
||||||
@ -80,7 +84,7 @@ public class BlockPressurePlate extends Block {
|
|||||||
List list = null;
|
List list = null;
|
||||||
|
|
||||||
if (this.a == EnumMobType.EVERYTHING) {
|
if (this.a == EnumMobType.EVERYTHING) {
|
||||||
list = world.getEntities(null, AxisAlignedBB.b((double) ((float) i + f), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) j + 0.25D, (double) ((float) (k + 1) - f)));
|
list = world.getEntities((Entity) null, AxisAlignedBB.b((double) ((float) i + f), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) j + 0.25D, (double) ((float) (k + 1) - f)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.a == EnumMobType.MOBS) {
|
if (this.a == EnumMobType.MOBS) {
|
||||||
|
@ -2,7 +2,7 @@ package net.minecraft.server;
|
|||||||
|
|
||||||
import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
|
import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
|
||||||
|
|
||||||
public class BlockPumpkin extends Block {
|
public class BlockPumpkin extends BlockDirectional {
|
||||||
|
|
||||||
private boolean a;
|
private boolean a;
|
||||||
|
|
||||||
@ -38,18 +38,58 @@ public class BlockPumpkin extends Block {
|
|||||||
if (world.suppressPhysics) return; // CraftBukkit
|
if (world.suppressPhysics) return; // CraftBukkit
|
||||||
if (world.getTypeId(i, j - 1, k) == Block.SNOW_BLOCK.id && world.getTypeId(i, j - 2, k) == Block.SNOW_BLOCK.id) {
|
if (world.getTypeId(i, j - 1, k) == Block.SNOW_BLOCK.id && world.getTypeId(i, j - 2, k) == Block.SNOW_BLOCK.id) {
|
||||||
if (!world.isStatic && world.getServer().getServer().spawnAnimals) { // CraftBukkit - make snowmen obey spawning rules
|
if (!world.isStatic && world.getServer().getServer().spawnAnimals) { // CraftBukkit - make snowmen obey spawning rules
|
||||||
world.setTypeId(i, j, k, 0);
|
world.setRawTypeId(i, j, k, 0);
|
||||||
world.setTypeId(i, j - 1, k, 0);
|
world.setRawTypeId(i, j - 1, k, 0);
|
||||||
world.setTypeId(i, j - 2, k, 0);
|
world.setRawTypeId(i, j - 2, k, 0);
|
||||||
EntitySnowman entitysnowman = new EntitySnowman(world);
|
EntitySnowman entitysnowman = new EntitySnowman(world);
|
||||||
|
|
||||||
entitysnowman.setPositionRotation((double) i + 0.5D, (double) j - 1.95D, (double) k + 0.5D, 0.0F, 0.0F);
|
entitysnowman.setPositionRotation((double) i + 0.5D, (double) j - 1.95D, (double) k + 0.5D, 0.0F, 0.0F);
|
||||||
world.addEntity(entitysnowman, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.BUILD_SNOWMAN); // CraftBukkit
|
world.addEntity(entitysnowman, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.BUILD_SNOWMAN); // CraftBukkit
|
||||||
|
world.update(i, j, k, 0);
|
||||||
|
world.update(i, j - 1, k, 0);
|
||||||
|
world.update(i, j - 2, k, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int l = 0; l < 120; ++l) {
|
for (int l = 0; l < 120; ++l) {
|
||||||
world.a("snowshovel", (double) i + world.random.nextDouble(), (double) (j - 2) + world.random.nextDouble() * 2.5D, (double) k + world.random.nextDouble(), 0.0D, 0.0D, 0.0D);
|
world.a("snowshovel", (double) i + world.random.nextDouble(), (double) (j - 2) + world.random.nextDouble() * 2.5D, (double) k + world.random.nextDouble(), 0.0D, 0.0D, 0.0D);
|
||||||
}
|
}
|
||||||
|
} else if (world.getTypeId(i, j - 1, k) == Block.IRON_BLOCK.id && world.getTypeId(i, j - 2, k) == Block.IRON_BLOCK.id) {
|
||||||
|
boolean flag = world.getTypeId(i - 1, j - 1, k) == Block.IRON_BLOCK.id && world.getTypeId(i + 1, j - 1, k) == Block.IRON_BLOCK.id;
|
||||||
|
boolean flag1 = world.getTypeId(i, j - 1, k - 1) == Block.IRON_BLOCK.id && world.getTypeId(i, j - 1, k + 1) == Block.IRON_BLOCK.id;
|
||||||
|
|
||||||
|
if (flag || flag1) {
|
||||||
|
world.setRawTypeId(i, j, k, 0);
|
||||||
|
world.setRawTypeId(i, j - 1, k, 0);
|
||||||
|
world.setRawTypeId(i, j - 2, k, 0);
|
||||||
|
if (flag) {
|
||||||
|
world.setRawTypeId(i - 1, j - 1, k, 0);
|
||||||
|
world.setRawTypeId(i + 1, j - 1, k, 0);
|
||||||
|
} else {
|
||||||
|
world.setRawTypeId(i, j - 1, k - 1, 0);
|
||||||
|
world.setRawTypeId(i, j - 1, k + 1, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
EntityIronGolem entityirongolem = new EntityIronGolem(world);
|
||||||
|
|
||||||
|
entityirongolem.b(true);
|
||||||
|
entityirongolem.setPositionRotation((double) i + 0.5D, (double) j - 1.95D, (double) k + 0.5D, 0.0F, 0.0F);
|
||||||
|
world.addEntity(entityirongolem);
|
||||||
|
|
||||||
|
for (int i1 = 0; i1 < 120; ++i1) {
|
||||||
|
world.a("snowballpoof", (double) i + world.random.nextDouble(), (double) (j - 2) + world.random.nextDouble() * 3.9D, (double) k + world.random.nextDouble(), 0.0D, 0.0D, 0.0D);
|
||||||
|
}
|
||||||
|
|
||||||
|
world.update(i, j, k, 0);
|
||||||
|
world.update(i, j - 1, k, 0);
|
||||||
|
world.update(i, j - 2, k, 0);
|
||||||
|
if (flag) {
|
||||||
|
world.update(i - 1, j - 1, k, 0);
|
||||||
|
world.update(i + 1, j - 1, k, 0);
|
||||||
|
} else {
|
||||||
|
world.update(i, j - 1, k - 1, 0);
|
||||||
|
world.update(i, j - 1, k + 1, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ public class BlockRedstoneTorch extends BlockTorch {
|
|||||||
public void a(World world, int i, int j, int k, Random random) {
|
public void a(World world, int i, int j, int k, Random random) {
|
||||||
boolean flag = this.g(world, i, j, k);
|
boolean flag = this.g(world, i, j, k);
|
||||||
|
|
||||||
while (b.size() > 0 && world.getTime() - ((RedstoneUpdateInfo) b.get(0)).d > 100L) {
|
while (b.size() > 0 && world.getTime() - ((RedstoneUpdateInfo) b.get(0)).d > 60L) {
|
||||||
b.remove(0);
|
b.remove(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +38,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.e(i, j - 1, k);
|
return world.e(i, j - 1, k) || world.getTypeId(i, j - 1, k) == Block.GLOWSTONE.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void g(World world, int i, int j, int k) {
|
private void g(World world, int i, int j, int k) {
|
||||||
|
@ -37,7 +37,7 @@ public class BlockSapling extends BlockFlower {
|
|||||||
|
|
||||||
public int a(int i, int j) {
|
public int a(int i, int j) {
|
||||||
j &= 3;
|
j &= 3;
|
||||||
return j == 1 ? 63 : (j == 2 ? 79 : super.a(i, j));
|
return j == 1 ? 63 : (j == 2 ? 79 : (j == 3 ? 30 : super.a(i, j)));
|
||||||
}
|
}
|
||||||
|
|
||||||
// CraftBukkit - added bonemeal, player and itemstack
|
// CraftBukkit - added bonemeal, player and itemstack
|
||||||
|
@ -60,6 +60,10 @@ public class BlockSign extends BlockContainer {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean b(IBlockAccess iblockaccess, int i, int j, int k) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean a() {
|
public boolean a() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ public class BlockSoil extends Block {
|
|||||||
this.textureId = 87;
|
this.textureId = 87;
|
||||||
this.a(true);
|
this.a(true);
|
||||||
this.a(0.0F, 0.0F, 0.0F, 1.0F, 0.9375F, 1.0F);
|
this.a(0.0F, 0.0F, 0.0F, 1.0F, 0.9375F, 1.0F);
|
||||||
this.g(255);
|
this.f(255);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AxisAlignedBB e(World world, int i, int j, int k) {
|
public AxisAlignedBB e(World world, int i, int j, int k) {
|
||||||
@ -34,7 +34,7 @@ public class BlockSoil extends Block {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void a(World world, int i, int j, int k, Random random) {
|
public void a(World world, int i, int j, int k, Random random) {
|
||||||
if (!this.h(world, i, j, k) && !world.v(i, j + 1, k)) {
|
if (!this.h(world, i, j, k) && !world.y(i, j + 1, k)) {
|
||||||
int l = world.getData(i, j, k);
|
int l = world.getData(i, j, k);
|
||||||
|
|
||||||
if (l > 0) {
|
if (l > 0) {
|
||||||
|
@ -14,6 +14,10 @@ public class BlockStationary extends BlockFluids {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean b(IBlockAccess iblockaccess, int i, int j, int k) {
|
||||||
|
return this.material != Material.LAVA;
|
||||||
|
}
|
||||||
|
|
||||||
public void doPhysics(World world, int i, int j, int k, int l) {
|
public void doPhysics(World world, int i, int j, int k, int l) {
|
||||||
super.doPhysics(world, i, j, k, l);
|
super.doPhysics(world, i, j, k, l);
|
||||||
if (world.getTypeId(i, j, k) == this.id) {
|
if (world.getTypeId(i, j, k) == this.id) {
|
||||||
@ -35,17 +39,19 @@ public class BlockStationary extends BlockFluids {
|
|||||||
if (this.material == Material.LAVA) {
|
if (this.material == Material.LAVA) {
|
||||||
int l = random.nextInt(3);
|
int l = random.nextInt(3);
|
||||||
|
|
||||||
|
int i1;
|
||||||
|
int j1;
|
||||||
|
|
||||||
// CraftBukkit start - prevent lava putting something on fire.
|
// CraftBukkit start - prevent lava putting something on fire.
|
||||||
org.bukkit.World bworld = world.getWorld();
|
org.bukkit.World bworld = world.getWorld();
|
||||||
BlockIgniteEvent.IgniteCause igniteCause = BlockIgniteEvent.IgniteCause.LAVA;
|
BlockIgniteEvent.IgniteCause igniteCause = BlockIgniteEvent.IgniteCause.LAVA;
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
for (int i1 = 0; i1 < l; ++i1) {
|
for (i1 = 0; i1 < l; ++i1) {
|
||||||
i += random.nextInt(3) - 1;
|
i += random.nextInt(3) - 1;
|
||||||
++j;
|
++j;
|
||||||
k += random.nextInt(3) - 1;
|
k += random.nextInt(3) - 1;
|
||||||
int j1 = world.getTypeId(i, j, k);
|
j1 = world.getTypeId(i, j, k);
|
||||||
|
|
||||||
if (j1 == 0) {
|
if (j1 == 0) {
|
||||||
if (this.j(world, i - 1, j, k) || this.j(world, i + 1, j, k) || this.j(world, i, j, k - 1) || this.j(world, i, j, k + 1) || this.j(world, i, j - 1, k) || this.j(world, i, j + 1, k)) {
|
if (this.j(world, i - 1, j, k) || this.j(world, i + 1, j, k) || this.j(world, i, j, k - 1) || this.j(world, i, j, k + 1) || this.j(world, i, j - 1, k) || this.j(world, i, j + 1, k)) {
|
||||||
// CraftBukkit start - prevent lava putting something on fire.
|
// CraftBukkit start - prevent lava putting something on fire.
|
||||||
@ -68,6 +74,19 @@ public class BlockStationary extends BlockFluids {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (l == 0) {
|
||||||
|
i1 = i;
|
||||||
|
j1 = k;
|
||||||
|
|
||||||
|
for (int k1 = 0; k1 < 3; ++k1) {
|
||||||
|
i = i1 + random.nextInt(3) - 1;
|
||||||
|
k = j1 + random.nextInt(3) - 1;
|
||||||
|
if (world.isEmpty(i, j + 1, k) && this.j(world, i, j, k)) {
|
||||||
|
world.setTypeId(i, j + 1, k, Block.FIRE.id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ public class BlockTNT extends Block {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void attack(World world, int i, int j, int k, EntityHuman entityhuman) {
|
public void attack(World world, int i, int j, int k, EntityHuman entityhuman) {
|
||||||
if (entityhuman.Q() != null && entityhuman.Q().id == Item.FLINT_AND_STEEL.id) {
|
if (entityhuman.T() != null && entityhuman.T().id == Item.FLINT_AND_STEEL.id) {
|
||||||
world.setRawData(i, j, k, 1);
|
world.setRawData(i, j, k, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,6 +25,10 @@ public class BlockTrapdoor extends Block {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean b(IBlockAccess iblockaccess, int i, int j, int k) {
|
||||||
|
return !e(iblockaccess.getData(i, j, k));
|
||||||
|
}
|
||||||
|
|
||||||
public int c() {
|
public int c() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -115,7 +119,7 @@ public class BlockTrapdoor extends Block {
|
|||||||
--j1;
|
--j1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!f(world.getTypeId(j1, j, k1))) {
|
if (!h(world.getTypeId(j1, j, k1))) {
|
||||||
world.setTypeId(i, j, k, 0);
|
world.setTypeId(i, j, k, 0);
|
||||||
this.b(world, i, j, k, i1, 0);
|
this.b(world, i, j, k, i1, 0);
|
||||||
}
|
}
|
||||||
@ -189,7 +193,7 @@ public class BlockTrapdoor extends Block {
|
|||||||
--i;
|
--i;
|
||||||
}
|
}
|
||||||
|
|
||||||
return f(world.getTypeId(i, j, k));
|
return h(world.getTypeId(i, j, k));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -197,7 +201,7 @@ public class BlockTrapdoor extends Block {
|
|||||||
return (i & 4) != 0;
|
return (i & 4) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean f(int i) {
|
private static boolean h(int i) {
|
||||||
if (i <= 0) {
|
if (i <= 0) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,259 +0,0 @@
|
|||||||
package net.minecraft.server;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.OutputStream;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class ChunkLoader implements IChunkLoader {
|
|
||||||
|
|
||||||
private File a;
|
|
||||||
private boolean b;
|
|
||||||
|
|
||||||
public ChunkLoader(File file1, boolean flag) {
|
|
||||||
this.a = file1;
|
|
||||||
this.b = flag;
|
|
||||||
}
|
|
||||||
|
|
||||||
private File a(int i, int j) {
|
|
||||||
String s = "c." + Integer.toString(i, 36) + "." + Integer.toString(j, 36) + ".dat";
|
|
||||||
String s1 = Integer.toString(i & 63, 36);
|
|
||||||
String s2 = Integer.toString(j & 63, 36);
|
|
||||||
File file1 = new File(this.a, s1);
|
|
||||||
|
|
||||||
if (!file1.exists()) {
|
|
||||||
if (!this.b) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
file1.mkdir();
|
|
||||||
}
|
|
||||||
|
|
||||||
file1 = new File(file1, s2);
|
|
||||||
if (!file1.exists()) {
|
|
||||||
if (!this.b) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
file1.mkdir();
|
|
||||||
}
|
|
||||||
|
|
||||||
file1 = new File(file1, s);
|
|
||||||
return !file1.exists() && !this.b ? null : file1;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Chunk a(World world, int i, int j) {
|
|
||||||
File file1 = this.a(i, j);
|
|
||||||
|
|
||||||
if (file1 != null && file1.exists()) {
|
|
||||||
try {
|
|
||||||
FileInputStream fileinputstream = new FileInputStream(file1);
|
|
||||||
NBTTagCompound nbttagcompound = NBTCompressedStreamTools.a((InputStream) fileinputstream);
|
|
||||||
|
|
||||||
if (!nbttagcompound.hasKey("Level")) {
|
|
||||||
System.out.println("Chunk file at " + i + "," + j + " is missing level data, skipping");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!nbttagcompound.getCompound("Level").hasKey("Blocks")) {
|
|
||||||
System.out.println("Chunk file at " + i + "," + j + " is missing block data, skipping");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
Chunk chunk = a(world, nbttagcompound.getCompound("Level"));
|
|
||||||
|
|
||||||
if (!chunk.a(i, j)) {
|
|
||||||
System.out.println("Chunk file at " + i + "," + j + " is in the wrong location; relocating. (Expected " + i + ", " + j + ", got " + chunk.x + ", " + chunk.z + ")");
|
|
||||||
nbttagcompound.getCompound("Level").setInt("xPos", i); // CraftBukkit - .getCompound("Level")
|
|
||||||
nbttagcompound.getCompound("Level").setInt("zPos", j); // CraftBukkit - .getCompound("Level")
|
|
||||||
chunk = a(world, nbttagcompound.getCompound("Level"));
|
|
||||||
}
|
|
||||||
|
|
||||||
chunk.h();
|
|
||||||
return chunk;
|
|
||||||
} catch (Exception exception) {
|
|
||||||
exception.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void a(World world, Chunk chunk) {
|
|
||||||
world.l();
|
|
||||||
File file1 = this.a(chunk.x, chunk.z);
|
|
||||||
|
|
||||||
if (file1.exists()) {
|
|
||||||
WorldData worlddata = world.getWorldData();
|
|
||||||
|
|
||||||
worlddata.b(worlddata.g() - file1.length());
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
File file2 = new File(this.a, "tmp_chunk.dat");
|
|
||||||
FileOutputStream fileoutputstream = new FileOutputStream(file2);
|
|
||||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
|
||||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
|
||||||
|
|
||||||
nbttagcompound.set("Level", nbttagcompound1);
|
|
||||||
a(chunk, world, nbttagcompound1);
|
|
||||||
NBTCompressedStreamTools.a(nbttagcompound, (OutputStream) fileoutputstream);
|
|
||||||
fileoutputstream.close();
|
|
||||||
if (file1.exists()) {
|
|
||||||
file1.delete();
|
|
||||||
}
|
|
||||||
|
|
||||||
file2.renameTo(file1);
|
|
||||||
WorldData worlddata1 = world.getWorldData();
|
|
||||||
|
|
||||||
worlddata1.b(worlddata1.g() + file1.length());
|
|
||||||
} catch (Exception exception) {
|
|
||||||
exception.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void a(Chunk chunk, World world, NBTTagCompound nbttagcompound) {
|
|
||||||
world.l();
|
|
||||||
nbttagcompound.setInt("xPos", chunk.x);
|
|
||||||
nbttagcompound.setInt("zPos", chunk.z);
|
|
||||||
nbttagcompound.setLong("LastUpdate", world.getTime());
|
|
||||||
nbttagcompound.setByteArray("Blocks", chunk.blocks);
|
|
||||||
nbttagcompound.setByteArray("Data", chunk.g.a);
|
|
||||||
nbttagcompound.setByteArray("SkyLight", chunk.h.a);
|
|
||||||
nbttagcompound.setByteArray("BlockLight", chunk.i.a);
|
|
||||||
nbttagcompound.setByteArray("HeightMap", chunk.heightMap);
|
|
||||||
nbttagcompound.setBoolean("TerrainPopulated", chunk.done);
|
|
||||||
chunk.s = false;
|
|
||||||
NBTTagList nbttaglist = new NBTTagList();
|
|
||||||
|
|
||||||
Iterator iterator;
|
|
||||||
NBTTagCompound nbttagcompound1;
|
|
||||||
|
|
||||||
for (int i = 0; i < chunk.entitySlices.length; ++i) {
|
|
||||||
iterator = chunk.entitySlices[i].iterator();
|
|
||||||
|
|
||||||
while (iterator.hasNext()) {
|
|
||||||
Entity entity = (Entity) iterator.next();
|
|
||||||
|
|
||||||
chunk.s = true;
|
|
||||||
nbttagcompound1 = new NBTTagCompound();
|
|
||||||
if (entity.c(nbttagcompound1)) {
|
|
||||||
nbttaglist.add(nbttagcompound1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
nbttagcompound.set("Entities", nbttaglist);
|
|
||||||
NBTTagList nbttaglist1 = new NBTTagList();
|
|
||||||
|
|
||||||
iterator = chunk.tileEntities.values().iterator();
|
|
||||||
|
|
||||||
while (iterator.hasNext()) {
|
|
||||||
TileEntity tileentity = (TileEntity) iterator.next();
|
|
||||||
|
|
||||||
nbttagcompound1 = new NBTTagCompound();
|
|
||||||
tileentity.b(nbttagcompound1);
|
|
||||||
nbttaglist1.add(nbttagcompound1);
|
|
||||||
}
|
|
||||||
|
|
||||||
nbttagcompound.set("TileEntities", nbttaglist1);
|
|
||||||
List list = world.a(chunk, false);
|
|
||||||
|
|
||||||
if (list != null) {
|
|
||||||
long j = world.getTime();
|
|
||||||
NBTTagList nbttaglist2 = new NBTTagList();
|
|
||||||
Iterator iterator1 = list.iterator();
|
|
||||||
|
|
||||||
while (iterator1.hasNext()) {
|
|
||||||
NextTickListEntry nextticklistentry = (NextTickListEntry) iterator1.next();
|
|
||||||
NBTTagCompound nbttagcompound2 = new NBTTagCompound();
|
|
||||||
|
|
||||||
nbttagcompound2.setInt("i", nextticklistentry.d);
|
|
||||||
nbttagcompound2.setInt("x", nextticklistentry.a);
|
|
||||||
nbttagcompound2.setInt("y", nextticklistentry.b);
|
|
||||||
nbttagcompound2.setInt("z", nextticklistentry.c);
|
|
||||||
nbttagcompound2.setInt("t", (int) (nextticklistentry.e - j));
|
|
||||||
nbttaglist2.add(nbttagcompound2);
|
|
||||||
}
|
|
||||||
|
|
||||||
nbttagcompound.set("TileTicks", nbttaglist2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Chunk a(World world, NBTTagCompound nbttagcompound) {
|
|
||||||
int i = nbttagcompound.getInt("xPos");
|
|
||||||
int j = nbttagcompound.getInt("zPos");
|
|
||||||
Chunk chunk = new Chunk(world, i, j);
|
|
||||||
|
|
||||||
chunk.blocks = nbttagcompound.getByteArray("Blocks");
|
|
||||||
chunk.g = new NibbleArray(nbttagcompound.getByteArray("Data"), world.heightBits);
|
|
||||||
chunk.h = new NibbleArray(nbttagcompound.getByteArray("SkyLight"), world.heightBits);
|
|
||||||
chunk.i = new NibbleArray(nbttagcompound.getByteArray("BlockLight"), world.heightBits);
|
|
||||||
chunk.heightMap = nbttagcompound.getByteArray("HeightMap");
|
|
||||||
chunk.done = nbttagcompound.getBoolean("TerrainPopulated");
|
|
||||||
if (!chunk.g.a()) {
|
|
||||||
chunk.g = new NibbleArray(chunk.blocks.length, world.heightBits);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (chunk.heightMap == null || !chunk.h.a()) {
|
|
||||||
chunk.heightMap = new byte[256];
|
|
||||||
chunk.h = new NibbleArray(chunk.blocks.length, world.heightBits);
|
|
||||||
chunk.initLighting();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!chunk.i.a()) {
|
|
||||||
chunk.i = new NibbleArray(chunk.blocks.length, world.heightBits);
|
|
||||||
chunk.a();
|
|
||||||
}
|
|
||||||
|
|
||||||
NBTTagList nbttaglist = nbttagcompound.getList("Entities");
|
|
||||||
|
|
||||||
if (nbttaglist != null) {
|
|
||||||
for (int k = 0; k < nbttaglist.size(); ++k) {
|
|
||||||
NBTTagCompound nbttagcompound1 = (NBTTagCompound) nbttaglist.get(k);
|
|
||||||
Entity entity = EntityTypes.a(nbttagcompound1, world);
|
|
||||||
|
|
||||||
chunk.s = true;
|
|
||||||
if (entity != null) {
|
|
||||||
chunk.a(entity);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
NBTTagList nbttaglist1 = nbttagcompound.getList("TileEntities");
|
|
||||||
|
|
||||||
if (nbttaglist1 != null) {
|
|
||||||
for (int l = 0; l < nbttaglist1.size(); ++l) {
|
|
||||||
NBTTagCompound nbttagcompound2 = (NBTTagCompound) nbttaglist1.get(l);
|
|
||||||
TileEntity tileentity = TileEntity.c(nbttagcompound2);
|
|
||||||
|
|
||||||
if (tileentity != null) {
|
|
||||||
chunk.a(tileentity);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (nbttagcompound.hasKey("TileTicks")) {
|
|
||||||
NBTTagList nbttaglist2 = nbttagcompound.getList("TileTicks");
|
|
||||||
|
|
||||||
if (nbttaglist2 != null) {
|
|
||||||
for (int i1 = 0; i1 < nbttaglist2.size(); ++i1) {
|
|
||||||
NBTTagCompound nbttagcompound3 = (NBTTagCompound) nbttaglist2.get(i1);
|
|
||||||
|
|
||||||
world.d(nbttagcompound3.getInt("x"), nbttagcompound3.getInt("y"), nbttagcompound3.getInt("z"), nbttagcompound3.getInt("i"), nbttagcompound3.getInt("t"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return chunk;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void a() {}
|
|
||||||
|
|
||||||
public void b() {}
|
|
||||||
|
|
||||||
public void b(World world, Chunk chunk) {}
|
|
||||||
}
|
|
@ -32,7 +32,7 @@ public class ChunkProviderServer implements IChunkProvider {
|
|||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
public ChunkProviderServer(WorldServer worldserver, IChunkLoader ichunkloader, IChunkProvider ichunkprovider) {
|
public ChunkProviderServer(WorldServer worldserver, IChunkLoader ichunkloader, IChunkProvider ichunkprovider) {
|
||||||
this.emptyChunk = new EmptyChunk(worldserver, new byte[256 * worldserver.height], 0, 0);
|
this.emptyChunk = new EmptyChunk(worldserver, 0, 0);
|
||||||
this.world = worldserver;
|
this.world = worldserver;
|
||||||
this.e = ichunkloader;
|
this.e = ichunkloader;
|
||||||
this.chunkProvider = ichunkprovider;
|
this.chunkProvider = ichunkprovider;
|
||||||
@ -135,7 +135,7 @@ public class ChunkProviderServer implements IChunkProvider {
|
|||||||
Chunk chunk = this.e.a(this.world, i, j);
|
Chunk chunk = this.e.a(this.world, i, j);
|
||||||
|
|
||||||
if (chunk != null) {
|
if (chunk != null) {
|
||||||
chunk.t = this.world.getTime();
|
chunk.n = this.world.getTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
return chunk;
|
return chunk;
|
||||||
@ -159,7 +159,7 @@ public class ChunkProviderServer implements IChunkProvider {
|
|||||||
public void saveChunk(Chunk chunk) { // CraftBukkit - private -> public
|
public void saveChunk(Chunk chunk) { // CraftBukkit - private -> public
|
||||||
if (this.e != null) {
|
if (this.e != null) {
|
||||||
try {
|
try {
|
||||||
chunk.t = this.world.getTime();
|
chunk.n = this.world.getTime();
|
||||||
this.e.a(this.world, chunk);
|
this.e.a(this.world, chunk);
|
||||||
} catch (Exception ioexception) { // CraftBukkit - IOException -> Exception
|
} catch (Exception ioexception) { // CraftBukkit - IOException -> Exception
|
||||||
ioexception.printStackTrace();
|
ioexception.printStackTrace();
|
||||||
@ -193,7 +193,7 @@ public class ChunkProviderServer implements IChunkProvider {
|
|||||||
this.world.getServer().getPluginManager().callEvent(new ChunkPopulateEvent(chunk.bukkitChunk));
|
this.world.getServer().getPluginManager().callEvent(new ChunkPopulateEvent(chunk.bukkitChunk));
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
chunk.f();
|
chunk.e();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -204,13 +204,13 @@ public class ChunkProviderServer implements IChunkProvider {
|
|||||||
for (int j = 0; j < this.chunkList.size(); ++j) {
|
for (int j = 0; j < this.chunkList.size(); ++j) {
|
||||||
Chunk chunk = (Chunk) this.chunkList.get(j);
|
Chunk chunk = (Chunk) this.chunkList.get(j);
|
||||||
|
|
||||||
if (flag && !chunk.r) {
|
if (flag) {
|
||||||
this.saveChunkNOP(chunk);
|
this.saveChunkNOP(chunk);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chunk.a(flag)) {
|
if (chunk.a(flag)) {
|
||||||
this.saveChunk(chunk);
|
this.saveChunk(chunk);
|
||||||
chunk.q = false;
|
chunk.l = false;
|
||||||
++i;
|
++i;
|
||||||
if (i == 24 && !flag) {
|
if (i == 24 && !flag) {
|
||||||
return false;
|
return false;
|
||||||
@ -266,7 +266,7 @@ public class ChunkProviderServer implements IChunkProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String d() {
|
public String d() {
|
||||||
return "ServerChunkCache: " + this.chunks.values().size() + " Drop: " + this.unloadQueue.size();
|
return "ServerChunkCache: " + this.chunks.values().size() + " Drop: " + this.unloadQueue.size(); // CraftBukkit
|
||||||
}
|
}
|
||||||
|
|
||||||
public List getMobsFor(EnumCreatureType enumcreaturetype, int i, int j, int k) {
|
public List getMobsFor(EnumCreatureType enumcreaturetype, int i, int j, int k) {
|
||||||
|
@ -1,8 +1,14 @@
|
|||||||
package net.minecraft.server;
|
package net.minecraft.server;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.DataInput;
|
||||||
|
import java.io.DataInputStream;
|
||||||
|
import java.io.DataOutput;
|
||||||
|
import java.io.DataOutputStream;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException; // CraftBukkit
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@ -43,43 +49,47 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
|||||||
nbttagcompound = NBTCompressedStreamTools.a((DataInput) datainputstream);
|
nbttagcompound = NBTCompressedStreamTools.a((DataInput) datainputstream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return this.a(world, i, j, nbttagcompound);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Chunk a(World world, int i, int j, NBTTagCompound nbttagcompound) {
|
||||||
if (!nbttagcompound.hasKey("Level")) {
|
if (!nbttagcompound.hasKey("Level")) {
|
||||||
System.out.println("Chunk file at " + i + "," + j + " is missing level data, skipping");
|
System.out.println("Chunk file at " + i + "," + j + " is missing level data, skipping");
|
||||||
return null;
|
return null;
|
||||||
} else if (!nbttagcompound.getCompound("Level").hasKey("Blocks")) {
|
} else if (!nbttagcompound.getCompound("Level").hasKey("Sections")) {
|
||||||
System.out.println("Chunk file at " + i + "," + j + " is missing block data, skipping");
|
System.out.println("Chunk file at " + i + "," + j + " is missing block data, skipping");
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
Chunk chunk = ChunkLoader.a(world, nbttagcompound.getCompound("Level"));
|
Chunk chunk = this.a(world, nbttagcompound.getCompound("Level"));
|
||||||
|
|
||||||
if (!chunk.a(i, j)) {
|
if (!chunk.a(i, j)) {
|
||||||
System.out.println("Chunk file at " + i + "," + j + " is in the wrong location; relocating. (Expected " + i + ", " + j + ", got " + chunk.x + ", " + chunk.z + ")");
|
System.out.println("Chunk file at " + i + "," + j + " is in the wrong location; relocating. (Expected " + i + ", " + j + ", got " + chunk.x + ", " + chunk.z + ")");
|
||||||
nbttagcompound.getCompound("Level").setInt("xPos", i); // CraftBukkit - .getCompound("Level")
|
nbttagcompound.getCompound("Level").setInt("xPos", i); // CraftBukkit - .getCompound("Level")
|
||||||
nbttagcompound.getCompound("Level").setInt("zPos", j); // CraftBukkit - .getCompound("Level")
|
nbttagcompound.getCompound("Level").setInt("zPos", j); // CraftBukkit - .getCompound("Level")
|
||||||
chunk = ChunkLoader.a(world, nbttagcompound.getCompound("Level"));
|
chunk = this.a(world, nbttagcompound.getCompound("Level"));
|
||||||
}
|
}
|
||||||
|
|
||||||
chunk.h();
|
chunk.i();
|
||||||
return chunk;
|
return chunk;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void a(World world, Chunk chunk) {
|
public void a(World world, Chunk chunk) {
|
||||||
world.l();
|
world.m();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
||||||
|
|
||||||
nbttagcompound.set("Level", nbttagcompound1);
|
nbttagcompound.set("Level", nbttagcompound1);
|
||||||
ChunkLoader.a(chunk, world, nbttagcompound1);
|
this.a(chunk, world, nbttagcompound1);
|
||||||
this.a(chunk.j(), nbttagcompound);
|
this.a(chunk.k(), nbttagcompound);
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
exception.printStackTrace();
|
exception.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void a(ChunkCoordIntPair chunkcoordintpair, NBTTagCompound nbttagcompound) {
|
protected void a(ChunkCoordIntPair chunkcoordintpair, NBTTagCompound nbttagcompound) {
|
||||||
Object object = this.c;
|
Object object = this.c;
|
||||||
|
|
||||||
synchronized (this.c) {
|
synchronized (this.c) {
|
||||||
@ -134,4 +144,169 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
|||||||
public void a() {}
|
public void a() {}
|
||||||
|
|
||||||
public void b() {}
|
public void b() {}
|
||||||
|
|
||||||
|
private void a(Chunk chunk, World world, NBTTagCompound nbttagcompound) {
|
||||||
|
world.m();
|
||||||
|
nbttagcompound.setInt("xPos", chunk.x);
|
||||||
|
nbttagcompound.setInt("zPos", chunk.z);
|
||||||
|
nbttagcompound.setLong("LastUpdate", world.getTime());
|
||||||
|
nbttagcompound.setIntArray("HeightMap", chunk.heightMap);
|
||||||
|
nbttagcompound.setBoolean("TerrainPopulated", chunk.done);
|
||||||
|
ChunkSection[] achunksection = chunk.h();
|
||||||
|
NBTTagList nbttaglist = new NBTTagList("Sections");
|
||||||
|
ChunkSection[] achunksection1 = achunksection;
|
||||||
|
int i = achunksection.length;
|
||||||
|
|
||||||
|
NBTTagCompound nbttagcompound1;
|
||||||
|
|
||||||
|
for (int j = 0; j < i; ++j) {
|
||||||
|
ChunkSection chunksection = achunksection1[j];
|
||||||
|
|
||||||
|
if (chunksection != null && chunksection.f() != 0) {
|
||||||
|
nbttagcompound1 = new NBTTagCompound();
|
||||||
|
nbttagcompound1.setByte("Y", (byte) (chunksection.c() >> 4 & 255));
|
||||||
|
nbttagcompound1.setByteArray("Blocks", chunksection.g());
|
||||||
|
if (chunksection.h() != null) {
|
||||||
|
nbttagcompound1.setByteArray("Add", chunksection.h().a);
|
||||||
|
}
|
||||||
|
|
||||||
|
nbttagcompound1.setByteArray("Data", chunksection.i().a);
|
||||||
|
nbttagcompound1.setByteArray("SkyLight", chunksection.k().a);
|
||||||
|
nbttagcompound1.setByteArray("BlockLight", chunksection.j().a);
|
||||||
|
nbttaglist.add(nbttagcompound1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
nbttagcompound.set("Sections", nbttaglist);
|
||||||
|
nbttagcompound.setByteArray("Biomes", chunk.l());
|
||||||
|
chunk.m = false;
|
||||||
|
NBTTagList nbttaglist1 = new NBTTagList();
|
||||||
|
|
||||||
|
Iterator iterator;
|
||||||
|
|
||||||
|
for (i = 0; i < chunk.entitySlices.length; ++i) {
|
||||||
|
iterator = chunk.entitySlices[i].iterator();
|
||||||
|
|
||||||
|
while (iterator.hasNext()) {
|
||||||
|
Entity entity = (Entity) iterator.next();
|
||||||
|
|
||||||
|
chunk.m = true;
|
||||||
|
nbttagcompound1 = new NBTTagCompound();
|
||||||
|
if (entity.c(nbttagcompound1)) {
|
||||||
|
nbttaglist1.add(nbttagcompound1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
nbttagcompound.set("Entities", nbttaglist1);
|
||||||
|
NBTTagList nbttaglist2 = new NBTTagList();
|
||||||
|
|
||||||
|
iterator = chunk.tileEntities.values().iterator();
|
||||||
|
|
||||||
|
while (iterator.hasNext()) {
|
||||||
|
TileEntity tileentity = (TileEntity) iterator.next();
|
||||||
|
|
||||||
|
nbttagcompound1 = new NBTTagCompound();
|
||||||
|
tileentity.b(nbttagcompound1);
|
||||||
|
nbttaglist2.add(nbttagcompound1);
|
||||||
|
}
|
||||||
|
|
||||||
|
nbttagcompound.set("TileEntities", nbttaglist2);
|
||||||
|
List list = world.a(chunk, false);
|
||||||
|
|
||||||
|
if (list != null) {
|
||||||
|
long k = world.getTime();
|
||||||
|
NBTTagList nbttaglist3 = new NBTTagList();
|
||||||
|
Iterator iterator1 = list.iterator();
|
||||||
|
|
||||||
|
while (iterator1.hasNext()) {
|
||||||
|
NextTickListEntry nextticklistentry = (NextTickListEntry) iterator1.next();
|
||||||
|
NBTTagCompound nbttagcompound2 = new NBTTagCompound();
|
||||||
|
|
||||||
|
nbttagcompound2.setInt("i", nextticklistentry.d);
|
||||||
|
nbttagcompound2.setInt("x", nextticklistentry.a);
|
||||||
|
nbttagcompound2.setInt("y", nextticklistentry.b);
|
||||||
|
nbttagcompound2.setInt("z", nextticklistentry.c);
|
||||||
|
nbttagcompound2.setInt("t", (int) (nextticklistentry.e - k));
|
||||||
|
nbttaglist3.add(nbttagcompound2);
|
||||||
|
}
|
||||||
|
|
||||||
|
nbttagcompound.set("TileTicks", nbttaglist3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Chunk a(World world, NBTTagCompound nbttagcompound) {
|
||||||
|
int i = nbttagcompound.getInt("xPos");
|
||||||
|
int j = nbttagcompound.getInt("zPos");
|
||||||
|
Chunk chunk = new Chunk(world, i, j);
|
||||||
|
|
||||||
|
chunk.heightMap = nbttagcompound.getIntArray("HeightMap");
|
||||||
|
chunk.done = nbttagcompound.getBoolean("TerrainPopulated");
|
||||||
|
NBTTagList nbttaglist = nbttagcompound.getList("Sections");
|
||||||
|
byte b0 = 16;
|
||||||
|
ChunkSection[] achunksection = new ChunkSection[b0];
|
||||||
|
|
||||||
|
for (int k = 0; k < nbttaglist.size(); ++k) {
|
||||||
|
NBTTagCompound nbttagcompound1 = (NBTTagCompound) nbttaglist.get(k);
|
||||||
|
byte b1 = nbttagcompound1.getByte("Y");
|
||||||
|
ChunkSection chunksection = new ChunkSection(b1 << 4);
|
||||||
|
|
||||||
|
chunksection.a(nbttagcompound1.getByteArray("Blocks"));
|
||||||
|
if (nbttagcompound1.hasKey("Add")) {
|
||||||
|
chunksection.a(new NibbleArray(nbttagcompound1.getByteArray("Add"), 4));
|
||||||
|
}
|
||||||
|
|
||||||
|
chunksection.b(new NibbleArray(nbttagcompound1.getByteArray("Data"), 4));
|
||||||
|
chunksection.d(new NibbleArray(nbttagcompound1.getByteArray("SkyLight"), 4));
|
||||||
|
chunksection.c(new NibbleArray(nbttagcompound1.getByteArray("BlockLight"), 4));
|
||||||
|
chunksection.d();
|
||||||
|
achunksection[b1] = chunksection;
|
||||||
|
}
|
||||||
|
|
||||||
|
chunk.a(achunksection);
|
||||||
|
if (nbttagcompound.hasKey("Biomes")) {
|
||||||
|
chunk.a(nbttagcompound.getByteArray("Biomes"));
|
||||||
|
}
|
||||||
|
|
||||||
|
NBTTagList nbttaglist1 = nbttagcompound.getList("Entities");
|
||||||
|
|
||||||
|
if (nbttaglist1 != null) {
|
||||||
|
for (int l = 0; l < nbttaglist1.size(); ++l) {
|
||||||
|
NBTTagCompound nbttagcompound2 = (NBTTagCompound) nbttaglist1.get(l);
|
||||||
|
Entity entity = EntityTypes.a(nbttagcompound2, world);
|
||||||
|
|
||||||
|
chunk.m = true;
|
||||||
|
if (entity != null) {
|
||||||
|
chunk.a(entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
NBTTagList nbttaglist2 = nbttagcompound.getList("TileEntities");
|
||||||
|
|
||||||
|
if (nbttaglist2 != null) {
|
||||||
|
for (int i1 = 0; i1 < nbttaglist2.size(); ++i1) {
|
||||||
|
NBTTagCompound nbttagcompound3 = (NBTTagCompound) nbttaglist2.get(i1);
|
||||||
|
TileEntity tileentity = TileEntity.c(nbttagcompound3);
|
||||||
|
|
||||||
|
if (tileentity != null) {
|
||||||
|
chunk.a(tileentity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nbttagcompound.hasKey("TileTicks")) {
|
||||||
|
NBTTagList nbttaglist3 = nbttagcompound.getList("TileTicks");
|
||||||
|
|
||||||
|
if (nbttaglist3 != null) {
|
||||||
|
for (int j1 = 0; j1 < nbttaglist3.size(); ++j1) {
|
||||||
|
NBTTagCompound nbttagcompound4 = (NBTTagCompound) nbttaglist3.get(j1);
|
||||||
|
|
||||||
|
world.d(nbttagcompound4.getInt("x"), nbttagcompound4.getInt("y"), nbttagcompound4.getInt("z"), nbttagcompound4.getInt("i"), nbttagcompound4.getInt("t"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return chunk;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -177,7 +177,7 @@ public abstract class Container {
|
|||||||
slot1.set((ItemStack) null);
|
slot1.set((ItemStack) null);
|
||||||
}
|
}
|
||||||
|
|
||||||
slot1.b(playerinventory.getCarried());
|
slot1.c(playerinventory.getCarried());
|
||||||
} else if (slot1.isAllowed(itemstack3)) {
|
} else if (slot1.isAllowed(itemstack3)) {
|
||||||
if (itemstack2.id == itemstack3.id && (!itemstack2.usesData() || itemstack2.getData() == itemstack3.getData()) && ItemStack.equals(itemstack2, itemstack3)) {
|
if (itemstack2.id == itemstack3.id && (!itemstack2.usesData() || itemstack2.getData() == itemstack3.getData()) && ItemStack.equals(itemstack2, itemstack3)) {
|
||||||
l = j == 0 ? itemstack3.count : 1;
|
l = j == 0 ? itemstack3.count : 1;
|
||||||
@ -203,12 +203,12 @@ public abstract class Container {
|
|||||||
l = itemstack2.count;
|
l = itemstack2.count;
|
||||||
if (l > 0 && l + itemstack3.count <= itemstack3.getMaxStackSize()) {
|
if (l > 0 && l + itemstack3.count <= itemstack3.getMaxStackSize()) {
|
||||||
itemstack3.count += l;
|
itemstack3.count += l;
|
||||||
itemstack2.a(l);
|
itemstack2 = slot1.a(l);
|
||||||
if (itemstack2.count == 0) {
|
if (itemstack2.count == 0) {
|
||||||
slot1.set((ItemStack) null);
|
slot1.set((ItemStack) null);
|
||||||
}
|
}
|
||||||
|
|
||||||
slot1.b(playerinventory.getCarried());
|
slot1.c(playerinventory.getCarried());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ public class ContainerBrewingStand extends Container {
|
|||||||
|
|
||||||
public void addSlotListener(ICrafting icrafting) {
|
public void addSlotListener(ICrafting icrafting) {
|
||||||
super.addSlotListener(icrafting);
|
super.addSlotListener(icrafting);
|
||||||
icrafting.setContainerData(this, 0, this.brewingStand.h());
|
icrafting.setContainerData(this, 0, this.brewingStand.i());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void a() {
|
public void a() {
|
||||||
@ -46,12 +46,12 @@ public class ContainerBrewingStand extends Container {
|
|||||||
for (int i = 0; i < this.listeners.size(); ++i) {
|
for (int i = 0; i < this.listeners.size(); ++i) {
|
||||||
ICrafting icrafting = (ICrafting) this.listeners.get(i);
|
ICrafting icrafting = (ICrafting) this.listeners.get(i);
|
||||||
|
|
||||||
if (this.b != this.brewingStand.h()) {
|
if (this.b != this.brewingStand.i()) {
|
||||||
icrafting.setContainerData(this, 0, this.brewingStand.h());
|
icrafting.setContainerData(this, 0, this.brewingStand.i());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.b = this.brewingStand.h();
|
this.b = this.brewingStand.i();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean b(EntityHuman entityhuman) {
|
public boolean b(EntityHuman entityhuman) {
|
||||||
@ -79,8 +79,12 @@ public class ContainerBrewingStand extends Container {
|
|||||||
} else if (!this.a(itemstack1, 4, 40, false)) {
|
} else if (!this.a(itemstack1, 4, 40, false)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
} else if (!this.a(itemstack1, 4, 40, true)) {
|
} else {
|
||||||
return null;
|
if (!this.a(itemstack1, 4, 40, true)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
slot.a(itemstack1, itemstack);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (itemstack1.count == 0) {
|
if (itemstack1.count == 0) {
|
||||||
@ -93,7 +97,7 @@ public class ContainerBrewingStand extends Container {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
slot.b(itemstack1);
|
slot.c(itemstack1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return itemstack;
|
return itemstack;
|
||||||
|
@ -71,7 +71,7 @@ public class ContainerDispenser extends Container {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
slot.b(itemstack1);
|
slot.c(itemstack1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return itemstack;
|
return itemstack;
|
||||||
|
@ -146,9 +146,9 @@ public class ContainerEnchantTable extends Container {
|
|||||||
public boolean a(EntityHuman entityhuman, int i) {
|
public boolean a(EntityHuman entityhuman, int i) {
|
||||||
ItemStack itemstack = this.enchantSlots.getItem(0);
|
ItemStack itemstack = this.enchantSlots.getItem(0);
|
||||||
|
|
||||||
if (this.costs[i] > 0 && itemstack != null && entityhuman.expLevel >= this.costs[i]) {
|
if (this.costs[i] > 0 && itemstack != null && (entityhuman.expLevel >= this.costs[i] || entityhuman.abilities.canInstantlyBuild)) {
|
||||||
if (!this.world.isStatic) {
|
if (!this.world.isStatic) {
|
||||||
List list = EnchantmentManager.a(this.l, itemstack, this.costs[i]);
|
List list = EnchantmentManager.b(this.l, itemstack, this.costs[i]);
|
||||||
|
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
Map<org.bukkit.enchantments.Enchantment, Integer> enchants = new HashMap<org.bukkit.enchantments.Enchantment, Integer>();
|
Map<org.bukkit.enchantments.Enchantment, Integer> enchants = new HashMap<org.bukkit.enchantments.Enchantment, Integer>();
|
||||||
@ -189,7 +189,7 @@ public class ContainerEnchantTable extends Container {
|
|||||||
public void a(EntityHuman entityhuman) {
|
public void a(EntityHuman entityhuman) {
|
||||||
super.a(entityhuman);
|
super.a(entityhuman);
|
||||||
if (!this.world.isStatic) {
|
if (!this.world.isStatic) {
|
||||||
ItemStack itemstack = this.enchantSlots.getItem(0);
|
ItemStack itemstack = this.enchantSlots.splitWithoutUpdate(0);
|
||||||
|
|
||||||
if (itemstack != null) {
|
if (itemstack != null) {
|
||||||
entityhuman.drop(itemstack);
|
entityhuman.drop(itemstack);
|
||||||
@ -228,7 +228,7 @@ public class ContainerEnchantTable extends Container {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
slot.b(itemstack1);
|
slot.c(itemstack1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return itemstack;
|
return itemstack;
|
||||||
|
@ -73,6 +73,17 @@ public class ContainerEnchantTableSubcontainer implements IInventory {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ItemStack splitWithoutUpdate(int i) {
|
||||||
|
if (this.items[i] != null) {
|
||||||
|
ItemStack itemstack = this.items[i];
|
||||||
|
|
||||||
|
this.items[i] = null;
|
||||||
|
return itemstack;
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void setItem(int i, ItemStack itemstack) {
|
public void setItem(int i, ItemStack itemstack) {
|
||||||
this.items[i] = itemstack;
|
this.items[i] = itemstack;
|
||||||
if (itemstack != null && itemstack.count > this.getMaxStackSize()) {
|
if (itemstack != null && itemstack.count > this.getMaxStackSize()) {
|
||||||
|
@ -94,6 +94,8 @@ public class ContainerFurnace extends Container {
|
|||||||
if (!this.a(itemstack1, 3, 39, true)) {
|
if (!this.a(itemstack1, 3, 39, true)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
slot.a(itemstack1, itemstack);
|
||||||
} else if (i >= 3 && i < 30) {
|
} else if (i >= 3 && i < 30) {
|
||||||
if (!this.a(itemstack1, 30, 39, false)) {
|
if (!this.a(itemstack1, 30, 39, false)) {
|
||||||
return null;
|
return null;
|
||||||
@ -116,7 +118,7 @@ public class ContainerFurnace extends Container {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
slot.b(itemstack1);
|
slot.c(itemstack1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return itemstack;
|
return itemstack;
|
||||||
|
@ -72,13 +72,14 @@ public class ContainerPlayer extends Container {
|
|||||||
super.a(entityhuman);
|
super.a(entityhuman);
|
||||||
|
|
||||||
for (int i = 0; i < 4; ++i) {
|
for (int i = 0; i < 4; ++i) {
|
||||||
ItemStack itemstack = this.craftInventory.getItem(i);
|
ItemStack itemstack = this.craftInventory.splitWithoutUpdate(i);
|
||||||
|
|
||||||
if (itemstack != null) {
|
if (itemstack != null) {
|
||||||
entityhuman.drop(itemstack);
|
entityhuman.drop(itemstack);
|
||||||
this.craftInventory.setItem(i, (ItemStack) null);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.resultInventory.setItem(0, (ItemStack) null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean b(EntityHuman entityhuman) {
|
public boolean b(EntityHuman entityhuman) {
|
||||||
@ -97,6 +98,8 @@ public class ContainerPlayer extends Container {
|
|||||||
if (!this.a(itemstack1, 9, 45, true)) {
|
if (!this.a(itemstack1, 9, 45, true)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
slot.a(itemstack1, itemstack);
|
||||||
} else if (i >= 9 && i < 36) {
|
} else if (i >= 9 && i < 36) {
|
||||||
if (!this.a(itemstack1, 36, 45, false)) {
|
if (!this.a(itemstack1, 36, 45, false)) {
|
||||||
return null;
|
return null;
|
||||||
@ -119,7 +122,7 @@ public class ContainerPlayer extends Container {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
slot.b(itemstack1);
|
slot.c(itemstack1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return itemstack;
|
return itemstack;
|
||||||
|
@ -71,7 +71,7 @@ public class ContainerWorkbench extends Container {
|
|||||||
super.a(entityhuman);
|
super.a(entityhuman);
|
||||||
if (!this.c.isStatic) {
|
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.splitWithoutUpdate(i);
|
||||||
|
|
||||||
if (itemstack != null) {
|
if (itemstack != null) {
|
||||||
entityhuman.drop(itemstack);
|
entityhuman.drop(itemstack);
|
||||||
@ -97,6 +97,8 @@ public class ContainerWorkbench extends Container {
|
|||||||
if (!this.a(itemstack1, 10, 46, true)) {
|
if (!this.a(itemstack1, 10, 46, true)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
slot.a(itemstack1, itemstack);
|
||||||
} else if (i >= 10 && i < 37) {
|
} else if (i >= 10 && i < 37) {
|
||||||
if (!this.a(itemstack1, 37, 46, false)) {
|
if (!this.a(itemstack1, 37, 46, false)) {
|
||||||
return null;
|
return null;
|
||||||
@ -119,7 +121,7 @@ public class ContainerWorkbench extends Container {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
slot.b(itemstack1);
|
slot.c(itemstack1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return itemstack;
|
return itemstack;
|
||||||
|
@ -44,13 +44,13 @@ public class CraftingManager {
|
|||||||
this.registerShapedRecipe(new ItemStack(Block.GLOWSTONE, 1), new Object[] { "##", "##", Character.valueOf('#'), Item.GLOWSTONE_DUST});
|
this.registerShapedRecipe(new ItemStack(Block.GLOWSTONE, 1), new Object[] { "##", "##", Character.valueOf('#'), Item.GLOWSTONE_DUST});
|
||||||
this.registerShapedRecipe(new ItemStack(Block.WOOL, 1), new Object[] { "##", "##", Character.valueOf('#'), Item.STRING});
|
this.registerShapedRecipe(new ItemStack(Block.WOOL, 1), new Object[] { "##", "##", Character.valueOf('#'), Item.STRING});
|
||||||
this.registerShapedRecipe(new ItemStack(Block.TNT, 1), new Object[] { "X#X", "#X#", "X#X", Character.valueOf('X'), Item.SULPHUR, Character.valueOf('#'), Block.SAND});
|
this.registerShapedRecipe(new ItemStack(Block.TNT, 1), new Object[] { "X#X", "#X#", "X#X", Character.valueOf('X'), Item.SULPHUR, Character.valueOf('#'), Block.SAND});
|
||||||
this.registerShapedRecipe(new ItemStack(Block.STEP, 3, 3), new Object[] { "###", Character.valueOf('#'), Block.COBBLESTONE});
|
this.registerShapedRecipe(new ItemStack(Block.STEP, 6, 3), new Object[] { "###", Character.valueOf('#'), Block.COBBLESTONE});
|
||||||
this.registerShapedRecipe(new ItemStack(Block.STEP, 3, 0), new Object[] { "###", Character.valueOf('#'), Block.STONE});
|
this.registerShapedRecipe(new ItemStack(Block.STEP, 6, 0), new Object[] { "###", Character.valueOf('#'), Block.STONE});
|
||||||
this.registerShapedRecipe(new ItemStack(Block.STEP, 3, 1), new Object[] { "###", Character.valueOf('#'), Block.SANDSTONE});
|
this.registerShapedRecipe(new ItemStack(Block.STEP, 6, 1), new Object[] { "###", Character.valueOf('#'), Block.SANDSTONE});
|
||||||
this.registerShapedRecipe(new ItemStack(Block.STEP, 3, 2), new Object[] { "###", Character.valueOf('#'), Block.WOOD});
|
this.registerShapedRecipe(new ItemStack(Block.STEP, 6, 2), new Object[] { "###", Character.valueOf('#'), Block.WOOD});
|
||||||
this.registerShapedRecipe(new ItemStack(Block.STEP, 3, 4), new Object[] { "###", Character.valueOf('#'), Block.BRICK});
|
this.registerShapedRecipe(new ItemStack(Block.STEP, 6, 4), new Object[] { "###", Character.valueOf('#'), Block.BRICK});
|
||||||
this.registerShapedRecipe(new ItemStack(Block.STEP, 3, 5), new Object[] { "###", Character.valueOf('#'), Block.SMOOTH_BRICK});
|
this.registerShapedRecipe(new ItemStack(Block.STEP, 6, 5), new Object[] { "###", Character.valueOf('#'), Block.SMOOTH_BRICK});
|
||||||
this.registerShapedRecipe(new ItemStack(Block.LADDER, 2), new Object[] { "# #", "###", "# #", Character.valueOf('#'), Item.STICK});
|
this.registerShapedRecipe(new ItemStack(Block.LADDER, 3), new Object[] { "# #", "###", "# #", Character.valueOf('#'), Item.STICK});
|
||||||
this.registerShapedRecipe(new ItemStack(Item.WOOD_DOOR, 1), new Object[] { "##", "##", "##", Character.valueOf('#'), Block.WOOD});
|
this.registerShapedRecipe(new ItemStack(Item.WOOD_DOOR, 1), new Object[] { "##", "##", "##", Character.valueOf('#'), Block.WOOD});
|
||||||
this.registerShapedRecipe(new ItemStack(Block.TRAP_DOOR, 2), new Object[] { "###", "###", Character.valueOf('#'), Block.WOOD});
|
this.registerShapedRecipe(new ItemStack(Block.TRAP_DOOR, 2), new Object[] { "###", "###", Character.valueOf('#'), Block.WOOD});
|
||||||
this.registerShapedRecipe(new ItemStack(Item.IRON_DOOR, 1), new Object[] { "##", "##", "##", Character.valueOf('#'), Item.IRON_INGOT});
|
this.registerShapedRecipe(new ItemStack(Item.IRON_DOOR, 1), new Object[] { "##", "##", "##", Character.valueOf('#'), Item.IRON_INGOT});
|
||||||
@ -99,6 +99,8 @@ public class CraftingManager {
|
|||||||
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});
|
||||||
this.registerShapedRecipe(new ItemStack(Block.ENCHANTMENT_TABLE, 1), new Object[] { " B ", "D#D", "###", Character.valueOf('#'), Block.OBSIDIAN, Character.valueOf('B'), Item.BOOK, Character.valueOf('D'), Item.DIAMOND});
|
this.registerShapedRecipe(new ItemStack(Block.ENCHANTMENT_TABLE, 1), new Object[] { " B ", "D#D", "###", Character.valueOf('#'), Block.OBSIDIAN, Character.valueOf('B'), Item.BOOK, Character.valueOf('D'), Item.DIAMOND});
|
||||||
this.registerShapelessRecipe(new ItemStack(Item.EYE_OF_ENDER, 1), new Object[] { Item.ENDER_PEARL, Item.BLAZE_POWDER});
|
this.registerShapelessRecipe(new ItemStack(Item.EYE_OF_ENDER, 1), new Object[] { Item.ENDER_PEARL, Item.BLAZE_POWDER});
|
||||||
|
this.registerShapelessRecipe(new ItemStack(Item.FIREBALL, 3), new Object[] { Item.SULPHUR, Item.BLAZE_POWDER, Item.COAL});
|
||||||
|
this.registerShapelessRecipe(new ItemStack(Item.FIREBALL, 3), new Object[] { Item.SULPHUR, Item.BLAZE_POWDER, new ItemStack(Item.COAL, 1, 1)});
|
||||||
//Collections.sort(this.b, new RecipeSorter(this)); // CraftBukkit - removed; see below
|
//Collections.sort(this.b, new RecipeSorter(this)); // CraftBukkit - removed; see below
|
||||||
this.sort(); // CraftBukkit - moved sort to a separate method
|
this.sort(); // CraftBukkit - moved sort to a separate method
|
||||||
System.out.println(this.recipies.size() + " recipes");
|
System.out.println(this.recipies.size() + " recipes");
|
||||||
|
@ -191,11 +191,11 @@ public abstract class Entity {
|
|||||||
this.boundingBox.c(d0 - (double) f, d1 - (double) this.height + (double) this.bO, d2 - (double) f, d0 + (double) f, d1 - (double) this.height + (double) this.bO + (double) f1, d2 + (double) f);
|
this.boundingBox.c(d0 - (double) f, d1 - (double) this.height + (double) this.bO, d2 - (double) f, d0 + (double) f, d1 - (double) this.height + (double) this.bO + (double) f1, d2 + (double) f);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void y_() {
|
public void G_() {
|
||||||
this.am();
|
this.az();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void am() {
|
public void az() {
|
||||||
// MethodProfiler.a("entityBaseTick"); // CraftBukkit - not in production code
|
// MethodProfiler.a("entityBaseTick"); // CraftBukkit - not in production code
|
||||||
if (this.vehicle != null && this.vehicle.dead) {
|
if (this.vehicle != null && this.vehicle.dead) {
|
||||||
this.vehicle = null;
|
this.vehicle = null;
|
||||||
@ -210,7 +210,7 @@ public abstract class Entity {
|
|||||||
this.lastYaw = this.yaw;
|
this.lastYaw = this.yaw;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (this.isSprinting()) {
|
if (this.isSprinting() && !this.aT()) {
|
||||||
int j = MathHelper.floor(this.locX);
|
int j = MathHelper.floor(this.locX);
|
||||||
int k = MathHelper.floor(this.locY - 0.20000000298023224D - (double) this.height);
|
int k = MathHelper.floor(this.locY - 0.20000000298023224D - (double) this.height);
|
||||||
|
|
||||||
@ -222,7 +222,7 @@ public abstract class Entity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.i_()) {
|
if (this.h_()) {
|
||||||
if (!this.bV && !this.justCreated) {
|
if (!this.bV && !this.justCreated) {
|
||||||
float f = MathHelper.sqrt(this.motX * this.motX * 0.20000000298023224D + this.motY * this.motY + this.motZ * this.motZ * 0.20000000298023224D) * 0.2F;
|
float f = MathHelper.sqrt(this.motX * this.motX * 0.20000000298023224D + this.motY * this.motY + this.motZ * this.motZ * 0.20000000298023224D) * 0.2F;
|
||||||
|
|
||||||
@ -284,13 +284,13 @@ public abstract class Entity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.aL()) {
|
if (this.aU()) {
|
||||||
this.aG();
|
this.aP();
|
||||||
this.fallDistance *= 0.5F;
|
this.fallDistance *= 0.5F;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.locY < -64.0D) {
|
if (this.locY < -64.0D) {
|
||||||
this.az();
|
this.aH();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.world.isStatic) {
|
if (!this.world.isStatic) {
|
||||||
@ -302,7 +302,7 @@ public abstract class Entity {
|
|||||||
// MethodProfiler.a(); // CraftBukkit - not in production code
|
// MethodProfiler.a(); // CraftBukkit - not in production code
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void aG() {
|
protected void aP() {
|
||||||
if (!this.fireProof) {
|
if (!this.fireProof) {
|
||||||
// CraftBukkit start - fallen in lava TODO: this event spams!
|
// CraftBukkit start - fallen in lava TODO: this event spams!
|
||||||
if (this instanceof EntityLiving) {
|
if (this instanceof EntityLiving) {
|
||||||
@ -352,7 +352,7 @@ public abstract class Entity {
|
|||||||
this.fireTicks = 0;
|
this.fireTicks = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void az() {
|
protected void aH() {
|
||||||
this.die();
|
this.die();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -389,7 +389,7 @@ public abstract class Entity {
|
|||||||
double d6 = d1;
|
double d6 = d1;
|
||||||
double d7 = d2;
|
double d7 = d2;
|
||||||
AxisAlignedBB axisalignedbb = this.boundingBox.clone();
|
AxisAlignedBB axisalignedbb = this.boundingBox.clone();
|
||||||
boolean flag = this.onGround && this.isSneaking();
|
boolean flag = this.onGround && this.isSneaking() && this instanceof EntityHuman;
|
||||||
|
|
||||||
if (flag) {
|
if (flag) {
|
||||||
double d8;
|
double d8;
|
||||||
@ -618,7 +618,7 @@ public abstract class Entity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean flag2 = this.aJ();
|
boolean flag2 = this.aS();
|
||||||
|
|
||||||
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);
|
||||||
@ -683,7 +683,7 @@ public abstract class Entity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.b(this.fallDistance);
|
this.a(this.fallDistance);
|
||||||
this.fallDistance = 0.0F;
|
this.fallDistance = 0.0F;
|
||||||
}
|
}
|
||||||
} else if (d0 < 0.0D) {
|
} else if (d0 < 0.0D) {
|
||||||
@ -691,7 +691,7 @@ public abstract class Entity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public AxisAlignedBB h_() {
|
public AxisAlignedBB h() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -717,21 +717,21 @@ public abstract class Entity {
|
|||||||
return this.fireProof;
|
return this.fireProof;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void b(float f) {
|
protected void a(float f) {
|
||||||
if (this.passenger != null) {
|
if (this.passenger != null) {
|
||||||
this.passenger.b(f);
|
this.passenger.a(f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean aJ() {
|
public boolean aS() {
|
||||||
return this.bV || this.world.v(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ));
|
return this.bV || this.world.y(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ));
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean aK() {
|
public boolean aT() {
|
||||||
return this.bV;
|
return this.bV;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean i_() {
|
public boolean h_() {
|
||||||
return this.world.a(this.boundingBox.grow(0.0D, -0.4000000059604645D, 0.0D).shrink(0.0010D, 0.0010D, 0.0010D), Material.WATER, this);
|
return this.world.a(this.boundingBox.grow(0.0D, -0.4000000059604645D, 0.0D).shrink(0.0010D, 0.0010D, 0.0010D), Material.WATER, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -756,7 +756,7 @@ public abstract class Entity {
|
|||||||
return 0.0F;
|
return 0.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean aL() {
|
public boolean aU() {
|
||||||
return this.world.a(this.boundingBox.grow(-0.10000000149011612D, -0.4000000059604645D, -0.10000000149011612D), Material.LAVA);
|
return this.world.a(this.boundingBox.grow(-0.10000000149011612D, -0.4000000059604645D, -0.10000000149011612D), Material.LAVA);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -779,15 +779,15 @@ public abstract class Entity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public float a(float f) {
|
public float b(float f) {
|
||||||
int i = MathHelper.floor(this.locX);
|
int i = MathHelper.floor(this.locX);
|
||||||
int j = MathHelper.floor(this.locZ);
|
int j = MathHelper.floor(this.locZ);
|
||||||
|
|
||||||
if (this.world.isLoaded(i, this.world.height / 2, j)) {
|
if (this.world.isLoaded(i, 0, j)) {
|
||||||
double d0 = (this.boundingBox.e - this.boundingBox.b) * 0.66D;
|
double d0 = (this.boundingBox.e - this.boundingBox.b) * 0.66D;
|
||||||
int k = MathHelper.floor(this.locY - (double) this.height + d0);
|
int k = MathHelper.floor(this.locY - (double) this.height + d0);
|
||||||
|
|
||||||
return this.world.m(i, k, j);
|
return this.world.p(i, k, j);
|
||||||
} else {
|
} else {
|
||||||
return 0.0F;
|
return 0.0F;
|
||||||
}
|
}
|
||||||
@ -834,7 +834,7 @@ public abstract class Entity {
|
|||||||
this.setPosition(this.locX, this.locY, this.locZ);
|
this.setPosition(this.locX, this.locY, this.locZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
public float h(Entity entity) {
|
public float i(Entity entity) {
|
||||||
float f = (float) (this.locX - entity.locX);
|
float f = (float) (this.locX - entity.locX);
|
||||||
float f1 = (float) (this.locY - entity.locY);
|
float f1 = (float) (this.locY - entity.locY);
|
||||||
float f2 = (float) (this.locZ - entity.locZ);
|
float f2 = (float) (this.locZ - entity.locZ);
|
||||||
@ -858,7 +858,7 @@ public abstract class Entity {
|
|||||||
return (double) MathHelper.sqrt(d3 * d3 + d4 * d4 + d5 * d5);
|
return (double) MathHelper.sqrt(d3 * d3 + d4 * d4 + d5 * d5);
|
||||||
}
|
}
|
||||||
|
|
||||||
public double i(Entity entity) {
|
public double j(Entity entity) {
|
||||||
double d0 = this.locX - entity.locX;
|
double d0 = this.locX - entity.locX;
|
||||||
double d1 = this.locY - entity.locY;
|
double d1 = this.locY - entity.locY;
|
||||||
double d2 = this.locZ - entity.locZ;
|
double d2 = this.locZ - entity.locZ;
|
||||||
@ -903,12 +903,16 @@ public abstract class Entity {
|
|||||||
this.ce = true;
|
this.ce = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void aM() {
|
protected void aV() {
|
||||||
this.velocityChanged = true;
|
this.velocityChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||||
this.aM();
|
this.aV();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean o_() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -916,14 +920,10 @@ public abstract class Entity {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean f_() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void b(Entity entity, int i) {}
|
public void b(Entity entity, int i) {}
|
||||||
|
|
||||||
public boolean c(NBTTagCompound nbttagcompound) {
|
public boolean c(NBTTagCompound nbttagcompound) {
|
||||||
String s = this.aN();
|
String s = this.aW();
|
||||||
|
|
||||||
if (!this.dead && s != null) {
|
if (!this.dead && s != null) {
|
||||||
nbttagcompound.setString("id", s);
|
nbttagcompound.setString("id", s);
|
||||||
@ -1048,7 +1048,7 @@ public abstract class Entity {
|
|||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final String aN() {
|
protected final String aW() {
|
||||||
return EntityTypes.b(this);
|
return EntityTypes.b(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1125,20 +1125,20 @@ public abstract class Entity {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AxisAlignedBB a_(Entity entity) {
|
public AxisAlignedBB b_(Entity entity) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void N() {
|
public void Q() {
|
||||||
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.y_();
|
this.G_();
|
||||||
if (this.vehicle != null) {
|
if (this.vehicle != null) {
|
||||||
this.vehicle.i();
|
this.vehicle.i_();
|
||||||
this.f += (double) (this.vehicle.yaw - this.vehicle.lastYaw);
|
this.f += (double) (this.vehicle.yaw - this.vehicle.lastYaw);
|
||||||
|
|
||||||
for (this.e += (double) (this.vehicle.pitch - this.vehicle.lastPitch); this.f >= 180.0D; this.f -= 360.0D) {
|
for (this.e += (double) (this.vehicle.pitch - this.vehicle.lastPitch); this.f >= 180.0D; this.f -= 360.0D) {
|
||||||
@ -1185,15 +1185,15 @@ public abstract class Entity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void i() {
|
public void i_() {
|
||||||
this.passenger.setPosition(this.locX, this.locY + this.q() + this.passenger.S(), this.locZ);
|
this.passenger.setPosition(this.locX, this.locY + this.x_() + this.passenger.V(), this.locZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
public double S() {
|
public double V() {
|
||||||
return (double) this.height;
|
return (double) this.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double q() {
|
public double x_() {
|
||||||
return (double) this.length * 0.75D;
|
return (double) this.length * 0.75D;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1274,22 +1274,22 @@ public abstract class Entity {
|
|||||||
return 0.1F;
|
return 0.1F;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vec3D aA() {
|
public Vec3D aI() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Y() {}
|
public void ac() {}
|
||||||
|
|
||||||
public ItemStack[] getEquipment() {
|
public ItemStack[] getEquipment() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isBurning() {
|
public boolean isBurning() {
|
||||||
return this.fireTicks > 0 || this.k(0);
|
return this.fireTicks > 0 || this.j(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isSneaking() {
|
public boolean isSneaking() {
|
||||||
return this.k(1);
|
return this.j(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSneak(boolean flag) {
|
public void setSneak(boolean flag) {
|
||||||
@ -1297,18 +1297,18 @@ public abstract class Entity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isSprinting() {
|
public boolean isSprinting() {
|
||||||
return this.k(3);
|
return this.j(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSprinting(boolean flag) {
|
public void setSprinting(boolean flag) {
|
||||||
this.a(3, flag);
|
this.a(3, flag);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void h(boolean flag) {
|
public void i(boolean flag) {
|
||||||
this.a(4, flag);
|
this.a(4, flag);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean k(int i) {
|
protected boolean j(int i) {
|
||||||
return (this.datawatcher.getByte(0) & 1 << i) != 0;
|
return (this.datawatcher.getByte(0) & 1 << i) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1367,7 +1367,7 @@ public abstract class Entity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void a(EntityLiving entityliving) {}
|
public void c(EntityLiving entityliving) {}
|
||||||
|
|
||||||
protected boolean g(double d0, double d1, double d2) {
|
protected boolean g(double d0, double d1, double d2) {
|
||||||
int i = MathHelper.floor(d0);
|
int i = MathHelper.floor(d0);
|
||||||
@ -1449,7 +1449,7 @@ public abstract class Entity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void s() {
|
public void u() {
|
||||||
this.bC = true;
|
this.bC = true;
|
||||||
this.fallDistance = 0.0F;
|
this.fallDistance = 0.0F;
|
||||||
}
|
}
|
||||||
@ -1464,11 +1464,19 @@ public abstract class Entity {
|
|||||||
return LocaleI18n.get("entity." + s + ".name");
|
return LocaleI18n.get("entity." + s + ".name");
|
||||||
}
|
}
|
||||||
|
|
||||||
public Entity[] aR() {
|
public Entity[] ba() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean a(Entity entity) {
|
public boolean a_(Entity entity) {
|
||||||
return this == entity;
|
return this == entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public float aq() {
|
||||||
|
return 0.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean k_() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
52
src/main/java/net/minecraft/server/EntityAgeable.java
Normal file
52
src/main/java/net/minecraft/server/EntityAgeable.java
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
package net.minecraft.server;
|
||||||
|
|
||||||
|
public abstract class EntityAgeable extends EntityCreature {
|
||||||
|
public boolean ageLocked = false; // CraftBukkit
|
||||||
|
|
||||||
|
public EntityAgeable(World world) {
|
||||||
|
super(world);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void b() {
|
||||||
|
super.b();
|
||||||
|
this.datawatcher.a(12, new Integer(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getAge() {
|
||||||
|
return this.datawatcher.getInt(12);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAge(int i) {
|
||||||
|
this.datawatcher.watch(12, Integer.valueOf(i));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void b(NBTTagCompound nbttagcompound) {
|
||||||
|
super.b(nbttagcompound);
|
||||||
|
nbttagcompound.setInt("Age", this.getAge());
|
||||||
|
nbttagcompound.setBoolean("AgeLocked", this.ageLocked); // CraftBukkit
|
||||||
|
}
|
||||||
|
|
||||||
|
public void a(NBTTagCompound nbttagcompound) {
|
||||||
|
super.a(nbttagcompound);
|
||||||
|
this.setAge(nbttagcompound.getInt("Age"));
|
||||||
|
this.ageLocked = nbttagcompound.getBoolean("AgeLocked"); // CraftBukkit
|
||||||
|
}
|
||||||
|
|
||||||
|
public void e() {
|
||||||
|
super.e();
|
||||||
|
int i = this.getAge();
|
||||||
|
|
||||||
|
if (ageLocked) return; // CraftBukkit
|
||||||
|
if (i < 0) {
|
||||||
|
++i;
|
||||||
|
this.setAge(i);
|
||||||
|
} else if (i > 0) {
|
||||||
|
--i;
|
||||||
|
this.setAge(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isBaby() {
|
||||||
|
return this.getAge() < 0;
|
||||||
|
}
|
||||||
|
}
|
@ -1,258 +0,0 @@
|
|||||||
package net.minecraft.server;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public abstract class EntityAnimal extends EntityCreature implements IAnimal {
|
|
||||||
|
|
||||||
private int love;
|
|
||||||
private int b = 0;
|
|
||||||
public boolean ageLocked = false; // CraftBukkit
|
|
||||||
|
|
||||||
public EntityAnimal(World world) {
|
|
||||||
super(world);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void b() {
|
|
||||||
super.b();
|
|
||||||
this.datawatcher.a(12, new Integer(0));
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getAge() {
|
|
||||||
return this.datawatcher.getInt(12);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAge(int i) {
|
|
||||||
this.datawatcher.watch(12, Integer.valueOf(i));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void d() {
|
|
||||||
super.d();
|
|
||||||
int i = this.getAge();
|
|
||||||
|
|
||||||
if (!ageLocked) { // CraftBukkit
|
|
||||||
if (i < 0) {
|
|
||||||
++i;
|
|
||||||
this.setAge(i);
|
|
||||||
} else if (i > 0) {
|
|
||||||
--i;
|
|
||||||
this.setAge(i);
|
|
||||||
}
|
|
||||||
} // CraftBukkit
|
|
||||||
|
|
||||||
if (this.love > 0) {
|
|
||||||
--this.love;
|
|
||||||
String s = "heart";
|
|
||||||
|
|
||||||
if (this.love % 10 == 0) {
|
|
||||||
double d0 = this.random.nextGaussian() * 0.02D;
|
|
||||||
double d1 = this.random.nextGaussian() * 0.02D;
|
|
||||||
double d2 = this.random.nextGaussian() * 0.02D;
|
|
||||||
|
|
||||||
this.world.a(s, this.locX + (double) (this.random.nextFloat() * this.width * 2.0F) - (double) this.width, this.locY + 0.5D + (double) (this.random.nextFloat() * this.length), this.locZ + (double) (this.random.nextFloat() * this.width * 2.0F) - (double) this.width, d0, d1, d2);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.b = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void a(Entity entity, float f) {
|
|
||||||
if (entity instanceof EntityHuman) {
|
|
||||||
if (f < 3.0F) {
|
|
||||||
double d0 = entity.locX - this.locX;
|
|
||||||
double d1 = entity.locZ - this.locZ;
|
|
||||||
|
|
||||||
this.yaw = (float) (Math.atan2(d1, d0) * 180.0D / 3.1415927410125732D) - 90.0F;
|
|
||||||
this.e = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
EntityHuman entityhuman = (EntityHuman) entity;
|
|
||||||
|
|
||||||
if (entityhuman.Q() == null || !this.a(entityhuman.Q())) {
|
|
||||||
this.target = null;
|
|
||||||
}
|
|
||||||
} else if (entity instanceof EntityAnimal) {
|
|
||||||
EntityAnimal entityanimal = (EntityAnimal) entity;
|
|
||||||
|
|
||||||
if (this.getAge() > 0 && entityanimal.getAge() < 0) {
|
|
||||||
if ((double) f < 2.5D) {
|
|
||||||
this.e = true;
|
|
||||||
}
|
|
||||||
} else if (this.love > 0 && entityanimal.love > 0) {
|
|
||||||
if (entityanimal.target == null) {
|
|
||||||
entityanimal.target = this;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (entityanimal.target == this && (double) f < 3.5D) {
|
|
||||||
++entityanimal.love;
|
|
||||||
++this.love;
|
|
||||||
++this.b;
|
|
||||||
if (this.b % 4 == 0) {
|
|
||||||
this.world.a("heart", this.locX + (double) (this.random.nextFloat() * this.width * 2.0F) - (double) this.width, this.locY + 0.5D + (double) (this.random.nextFloat() * this.length), this.locZ + (double) (this.random.nextFloat() * this.width * 2.0F) - (double) this.width, 0.0D, 0.0D, 0.0D);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.b == 60) {
|
|
||||||
this.b((EntityAnimal) entity);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.b = 0;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.b = 0;
|
|
||||||
this.target = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void b(EntityAnimal entityanimal) {
|
|
||||||
EntityAnimal entityanimal1 = this.createChild(entityanimal);
|
|
||||||
|
|
||||||
if (entityanimal1 != null) {
|
|
||||||
this.setAge(6000);
|
|
||||||
entityanimal.setAge(6000);
|
|
||||||
this.love = 0;
|
|
||||||
this.b = 0;
|
|
||||||
this.target = null;
|
|
||||||
entityanimal.target = null;
|
|
||||||
entityanimal.b = 0;
|
|
||||||
entityanimal.love = 0;
|
|
||||||
entityanimal1.setAge(-24000);
|
|
||||||
entityanimal1.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, this.pitch);
|
|
||||||
|
|
||||||
for (int i = 0; i < 7; ++i) {
|
|
||||||
double d0 = this.random.nextGaussian() * 0.02D;
|
|
||||||
double d1 = this.random.nextGaussian() * 0.02D;
|
|
||||||
double d2 = this.random.nextGaussian() * 0.02D;
|
|
||||||
|
|
||||||
this.world.a("heart", this.locX + (double) (this.random.nextFloat() * this.width * 2.0F) - (double) this.width, this.locY + 0.5D + (double) (this.random.nextFloat() * this.length), this.locZ + (double) (this.random.nextFloat() * this.width * 2.0F) - (double) this.width, d0, d1, d2);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.world.addEntity(entityanimal1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected abstract EntityAnimal createChild(EntityAnimal entityanimal);
|
|
||||||
|
|
||||||
protected void b(Entity entity, float f) {}
|
|
||||||
|
|
||||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
|
||||||
this.f = 60;
|
|
||||||
this.target = null;
|
|
||||||
this.love = 0;
|
|
||||||
return super.damageEntity(damagesource, i);
|
|
||||||
}
|
|
||||||
|
|
||||||
public float a(int i, int j, int k) {
|
|
||||||
return this.world.getTypeId(i, j - 1, k) == Block.GRASS.id ? 10.0F : this.world.m(i, j, k) - 0.5F;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void b(NBTTagCompound nbttagcompound) {
|
|
||||||
super.b(nbttagcompound);
|
|
||||||
nbttagcompound.setInt("Age", this.getAge());
|
|
||||||
nbttagcompound.setInt("InLove", this.love);
|
|
||||||
nbttagcompound.setBoolean("AgeLocked", this.ageLocked); // CraftBukkit
|
|
||||||
}
|
|
||||||
|
|
||||||
public void a(NBTTagCompound nbttagcompound) {
|
|
||||||
super.a(nbttagcompound);
|
|
||||||
this.setAge(nbttagcompound.getInt("Age"));
|
|
||||||
this.love = nbttagcompound.getInt("InLove");
|
|
||||||
this.ageLocked = nbttagcompound.getBoolean("AgeLocked"); // CraftBukkit
|
|
||||||
}
|
|
||||||
|
|
||||||
protected Entity findTarget() {
|
|
||||||
if (this.f > 0) {
|
|
||||||
return null;
|
|
||||||
} else {
|
|
||||||
float f = 8.0F;
|
|
||||||
List list;
|
|
||||||
int i;
|
|
||||||
EntityAnimal entityanimal;
|
|
||||||
|
|
||||||
if (this.love > 0) {
|
|
||||||
list = this.world.a(this.getClass(), this.boundingBox.grow((double) f, (double) f, (double) f));
|
|
||||||
|
|
||||||
for (i = 0; i < list.size(); ++i) {
|
|
||||||
entityanimal = (EntityAnimal) list.get(i);
|
|
||||||
if (entityanimal != this && entityanimal.love > 0) {
|
|
||||||
return entityanimal;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (this.getAge() == 0) {
|
|
||||||
list = this.world.a(EntityHuman.class, this.boundingBox.grow((double) f, (double) f, (double) f));
|
|
||||||
|
|
||||||
for (i = 0; i < list.size(); ++i) {
|
|
||||||
EntityHuman entityhuman = (EntityHuman) list.get(i);
|
|
||||||
|
|
||||||
if (entityhuman.Q() != null && this.a(entityhuman.Q())) {
|
|
||||||
return entityhuman;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (this.getAge() > 0) {
|
|
||||||
list = this.world.a(this.getClass(), this.boundingBox.grow((double) f, (double) f, (double) f));
|
|
||||||
|
|
||||||
for (i = 0; i < list.size(); ++i) {
|
|
||||||
entityanimal = (EntityAnimal) list.get(i);
|
|
||||||
if (entityanimal != this && entityanimal.getAge() < 0) {
|
|
||||||
return entityanimal;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean canSpawn() {
|
|
||||||
int i = MathHelper.floor(this.locX);
|
|
||||||
int j = MathHelper.floor(this.boundingBox.b);
|
|
||||||
int k = MathHelper.floor(this.locZ);
|
|
||||||
|
|
||||||
return this.world.getTypeId(i, j - 1, k) == Block.GRASS.id && this.world.k(i, j, k) > 8 && super.canSpawn();
|
|
||||||
}
|
|
||||||
|
|
||||||
public int h() {
|
|
||||||
return 120;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected boolean d_() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected int getExpValue(EntityHuman entityhuman) {
|
|
||||||
return 1 + this.world.random.nextInt(3);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected boolean a(ItemStack itemstack) {
|
|
||||||
return itemstack.id == Item.WHEAT.id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean b(EntityHuman entityhuman) {
|
|
||||||
ItemStack itemstack = entityhuman.inventory.getItemInHand();
|
|
||||||
|
|
||||||
if (itemstack != null && this.a(itemstack) && this.getAge() == 0) {
|
|
||||||
--itemstack.count;
|
|
||||||
if (itemstack.count <= 0) {
|
|
||||||
entityhuman.inventory.setItem(entityhuman.inventory.itemInHandIndex, (ItemStack) null);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.love = 600;
|
|
||||||
this.target = null;
|
|
||||||
|
|
||||||
for (int i = 0; i < 7; ++i) {
|
|
||||||
double d0 = this.random.nextGaussian() * 0.02D;
|
|
||||||
double d1 = this.random.nextGaussian() * 0.02D;
|
|
||||||
double d2 = this.random.nextGaussian() * 0.02D;
|
|
||||||
|
|
||||||
this.world.a("heart", this.locX + (double) (this.random.nextFloat() * this.width * 2.0F) - (double) this.width, this.locY + 0.5D + (double) (this.random.nextFloat() * this.length), this.locZ + (double) (this.random.nextFloat() * this.width * 2.0F) - (double) this.width, d0, d1, d2);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return super.b(entityhuman);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isBaby() {
|
|
||||||
return this.getAge() < 0;
|
|
||||||
}
|
|
||||||
}
|
|
@ -39,6 +39,30 @@ public class EntityArrow extends Entity {
|
|||||||
this.height = 0.0F;
|
this.height = 0.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public EntityArrow(World world, EntityLiving entityliving, EntityLiving entityliving1, float f, float f1) {
|
||||||
|
super(world);
|
||||||
|
this.shooter = entityliving;
|
||||||
|
this.fromPlayer = entityliving instanceof EntityHuman;
|
||||||
|
this.locY = entityliving.locY + (double) entityliving.getHeadHeight() - 0.10000000149011612D;
|
||||||
|
double d0 = entityliving1.locX - entityliving.locX;
|
||||||
|
double d1 = entityliving1.locY + (double) entityliving1.getHeadHeight() - 0.699999988079071D - this.locY;
|
||||||
|
double d2 = entityliving1.locZ - entityliving.locZ;
|
||||||
|
double d3 = (double) MathHelper.sqrt(d0 * d0 + d2 * d2);
|
||||||
|
|
||||||
|
if (d3 >= 1.0E-7D) {
|
||||||
|
float f2 = (float) (Math.atan2(d2, d0) * 180.0D / 3.1415927410125732D) - 90.0F;
|
||||||
|
float f3 = (float) (-(Math.atan2(d1, d3) * 180.0D / 3.1415927410125732D));
|
||||||
|
double d4 = d0 / d3;
|
||||||
|
double d5 = d2 / d3;
|
||||||
|
|
||||||
|
this.setPositionRotation(entityliving.locX + d4, this.locY, entityliving.locZ + d5, f2, f3);
|
||||||
|
this.height = 0.0F;
|
||||||
|
float f4 = (float) d3 * 0.2F;
|
||||||
|
|
||||||
|
this.shoot(d0, d1 + (double) f4, d2, f, f1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public EntityArrow(World world, EntityLiving entityliving, float f) {
|
public EntityArrow(World world, EntityLiving entityliving, float f) {
|
||||||
super(world);
|
super(world);
|
||||||
this.shooter = entityliving;
|
this.shooter = entityliving;
|
||||||
@ -80,8 +104,8 @@ public class EntityArrow extends Entity {
|
|||||||
this.k = 0;
|
this.k = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void y_() {
|
public void G_() {
|
||||||
super.y_();
|
super.G_();
|
||||||
if (this.lastPitch == 0.0F && this.lastYaw == 0.0F) {
|
if (this.lastPitch == 0.0F && this.lastYaw == 0.0F) {
|
||||||
float f = MathHelper.sqrt(this.motX * this.motX + this.motZ * this.motZ);
|
float f = MathHelper.sqrt(this.motX * this.motX + this.motZ * this.motZ);
|
||||||
|
|
||||||
@ -143,7 +167,7 @@ public class EntityArrow extends Entity {
|
|||||||
for (k = 0; k < list.size(); ++k) {
|
for (k = 0; k < list.size(); ++k) {
|
||||||
Entity entity1 = (Entity) list.get(k);
|
Entity entity1 = (Entity) list.get(k);
|
||||||
|
|
||||||
if (entity1.e_() && (entity1 != this.shooter || this.l >= 5)) {
|
if (entity1.o_() && (entity1 != this.shooter || this.l >= 5)) {
|
||||||
f1 = 0.3F;
|
f1 = 0.3F;
|
||||||
AxisAlignedBB axisalignedbb1 = entity1.boundingBox.grow((double) f1, (double) f1, (double) f1);
|
AxisAlignedBB axisalignedbb1 = entity1.boundingBox.grow((double) f1, (double) f1, (double) f1);
|
||||||
MovingObjectPosition movingobjectposition1 = axisalignedbb1.a(vec3d, vec3d1);
|
MovingObjectPosition movingobjectposition1 = axisalignedbb1.a(vec3d, vec3d1);
|
||||||
@ -200,7 +224,7 @@ public class EntityArrow extends Entity {
|
|||||||
// CraftBukkit - entity.damageEntity -> event function
|
// CraftBukkit - entity.damageEntity -> event function
|
||||||
if (org.bukkit.craftbukkit.event.CraftEventFactory.handleProjectileEvent(projectile, entity, damagesource, l)) {
|
if (org.bukkit.craftbukkit.event.CraftEventFactory.handleProjectileEvent(projectile, entity, damagesource, l)) {
|
||||||
if (movingobjectposition.entity instanceof EntityLiving) {
|
if (movingobjectposition.entity instanceof EntityLiving) {
|
||||||
++((EntityLiving) movingobjectposition.entity).aJ;
|
++((EntityLiving) movingobjectposition.entity).aI;
|
||||||
if (this.n > 0) {
|
if (this.n > 0) {
|
||||||
float f3 = MathHelper.sqrt(this.motX * this.motX + this.motZ * this.motZ);
|
float f3 = MathHelper.sqrt(this.motX * this.motX + this.motZ * this.motZ);
|
||||||
|
|
||||||
@ -273,7 +297,7 @@ public class EntityArrow extends Entity {
|
|||||||
float f4 = 0.99F;
|
float f4 = 0.99F;
|
||||||
|
|
||||||
f1 = 0.05F;
|
f1 = 0.05F;
|
||||||
if (this.aK()) {
|
if (this.aT()) {
|
||||||
for (int i1 = 0; i1 < 4; ++i1) {
|
for (int i1 = 0; i1 < 4; ++i1) {
|
||||||
float f5 = 0.25F;
|
float f5 = 0.25F;
|
||||||
|
|
||||||
@ -345,11 +369,15 @@ public class EntityArrow extends Entity {
|
|||||||
this.damage = d0;
|
this.damage = d0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double j() {
|
public double k() {
|
||||||
return this.damage;
|
return this.damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void b(int i) {
|
public void b(int i) {
|
||||||
this.n = i;
|
this.n = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean k_() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,15 +26,15 @@ public class EntityBlaze extends EntityMonster {
|
|||||||
this.datawatcher.a(16, new Byte((byte) 0));
|
this.datawatcher.a(16, new Byte((byte) 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String c_() {
|
protected String i() {
|
||||||
return "mob.blaze.breathe";
|
return "mob.blaze.breathe";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String m() {
|
protected String j() {
|
||||||
return "mob.blaze.hit";
|
return "mob.blaze.hit";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String n() {
|
protected String k() {
|
||||||
return "mob.blaze.death";
|
return "mob.blaze.death";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,13 +46,13 @@ public class EntityBlaze extends EntityMonster {
|
|||||||
super.die(damagesource);
|
super.die(damagesource);
|
||||||
}
|
}
|
||||||
|
|
||||||
public float a(float f) {
|
public float b(float f) {
|
||||||
return 1.0F;
|
return 1.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void d() {
|
public void e() {
|
||||||
if (!this.world.isStatic) {
|
if (!this.world.isStatic) {
|
||||||
if (this.aJ()) {
|
if (this.aS()) {
|
||||||
this.damageEntity(DamageSource.DROWN, 1);
|
this.damageEntity(DamageSource.DROWN, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ public class EntityBlaze extends EntityMonster {
|
|||||||
this.a = 0.5F + (float) this.random.nextGaussian() * 3.0F;
|
this.a = 0.5F + (float) this.random.nextGaussian() * 3.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.F() != null && this.F().locY + (double) this.F().getHeadHeight() > this.locY + (double) this.getHeadHeight() + (double) this.a) {
|
if (this.H() != null && this.H().locY + (double) this.H().getHeadHeight() > this.locY + (double) this.getHeadHeight() + (double) this.a) {
|
||||||
this.motY += (0.30000001192092896D - this.motY) * 0.30000001192092896D;
|
this.motY += (0.30000001192092896D - this.motY) * 0.30000001192092896D;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -79,13 +79,13 @@ public class EntityBlaze extends EntityMonster {
|
|||||||
this.world.a("largesmoke", this.locX + (this.random.nextDouble() - 0.5D) * (double) this.width, this.locY + this.random.nextDouble() * (double) this.length, this.locZ + (this.random.nextDouble() - 0.5D) * (double) this.width, 0.0D, 0.0D, 0.0D);
|
this.world.a("largesmoke", this.locX + (this.random.nextDouble() - 0.5D) * (double) this.width, this.locY + this.random.nextDouble() * (double) this.length, this.locZ + (this.random.nextDouble() - 0.5D) * (double) this.width, 0.0D, 0.0D, 0.0D);
|
||||||
}
|
}
|
||||||
|
|
||||||
super.d();
|
super.e();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void a(Entity entity, float f) {
|
protected void a(Entity entity, float f) {
|
||||||
if (this.attackTicks <= 0 && f < 2.0F && entity.boundingBox.e > this.boundingBox.b && entity.boundingBox.b < this.boundingBox.e) {
|
if (this.attackTicks <= 0 && f < 2.0F && entity.boundingBox.e > this.boundingBox.b && entity.boundingBox.b < this.boundingBox.e) {
|
||||||
this.attackTicks = 20;
|
this.attackTicks = 20;
|
||||||
this.d(entity);
|
this.a(entity);
|
||||||
} else if (f < 30.0F) {
|
} else if (f < 30.0F) {
|
||||||
double d0 = entity.locX - this.locX;
|
double d0 = entity.locX - this.locX;
|
||||||
double d1 = entity.boundingBox.b + (double) (entity.length / 2.0F) - (this.locY + (double) (this.length / 2.0F));
|
double d1 = entity.boundingBox.b + (double) (entity.length / 2.0F) - (this.locY + (double) (this.length / 2.0F));
|
||||||
@ -123,7 +123,7 @@ public class EntityBlaze extends EntityMonster {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void b(float f) {}
|
protected void a(float f) {}
|
||||||
|
|
||||||
public void b(NBTTagCompound nbttagcompound) {
|
public void b(NBTTagCompound nbttagcompound) {
|
||||||
super.b(nbttagcompound);
|
super.b(nbttagcompound);
|
||||||
@ -138,7 +138,7 @@ public class EntityBlaze extends EntityMonster {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isBurning() {
|
public boolean isBurning() {
|
||||||
return this.B();
|
return this.A();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void dropDeathLoot(boolean flag, int i) {
|
protected void dropDeathLoot(boolean flag, int i) {
|
||||||
@ -156,7 +156,7 @@ public class EntityBlaze extends EntityMonster {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean B() {
|
public boolean A() {
|
||||||
return (this.datawatcher.getByte(16) & 1) != 0;
|
return (this.datawatcher.getByte(16) & 1) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -172,7 +172,7 @@ public class EntityBlaze extends EntityMonster {
|
|||||||
this.datawatcher.watch(16, Byte.valueOf(b0));
|
this.datawatcher.watch(16, Byte.valueOf(b0));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean z() {
|
protected boolean D() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -61,15 +61,15 @@ public class EntityBoat extends Entity {
|
|||||||
this.datawatcher.a(19, new Integer(0));
|
this.datawatcher.a(19, new Integer(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
public AxisAlignedBB a_(Entity entity) {
|
public AxisAlignedBB b_(Entity entity) {
|
||||||
return entity.boundingBox;
|
return entity.boundingBox;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AxisAlignedBB h_() {
|
public AxisAlignedBB h() {
|
||||||
return this.boundingBox;
|
return this.boundingBox;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean f_() {
|
public boolean e_() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,7 +86,7 @@ public class EntityBoat extends Entity {
|
|||||||
this.world.getServer().getPluginManager().callEvent(new VehicleCreateEvent((Vehicle) this.getBukkitEntity())); // CraftBukkit
|
this.world.getServer().getPluginManager().callEvent(new VehicleCreateEvent((Vehicle) this.getBukkitEntity())); // CraftBukkit
|
||||||
}
|
}
|
||||||
|
|
||||||
public double q() {
|
public double x_() {
|
||||||
return (double) this.length * 0.0D - 0.30000001192092896D;
|
return (double) this.length * 0.0D - 0.30000001192092896D;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,10 +105,10 @@ public class EntityBoat extends Entity {
|
|||||||
// i = event.getDamage(); // TODO Why don't we do this?
|
// i = event.getDamage(); // TODO Why don't we do this?
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
this.d(-this.l());
|
this.d(-this.m());
|
||||||
this.c(10);
|
this.c(10);
|
||||||
this.setDamage(this.getDamage() + i * 10);
|
this.setDamage(this.getDamage() + i * 10);
|
||||||
this.aM();
|
this.aV();
|
||||||
if (this.getDamage() > 40) {
|
if (this.getDamage() > 40) {
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
VehicleDestroyEvent destroyEvent = new VehicleDestroyEvent(vehicle, attacker);
|
VehicleDestroyEvent destroyEvent = new VehicleDestroyEvent(vehicle, attacker);
|
||||||
@ -143,11 +143,11 @@ public class EntityBoat extends Entity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean e_() {
|
public boolean o_() {
|
||||||
return !this.dead;
|
return !this.dead;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void y_() {
|
public void G_() {
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
double prevX = this.locX;
|
double prevX = this.locX;
|
||||||
double prevY = this.locY;
|
double prevY = this.locY;
|
||||||
@ -156,9 +156,9 @@ public class EntityBoat extends Entity {
|
|||||||
float prevPitch = this.pitch;
|
float prevPitch = this.pitch;
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
super.y_();
|
super.G_();
|
||||||
if (this.k() > 0) {
|
if (this.l() > 0) {
|
||||||
this.c(this.k() - 1);
|
this.c(this.l() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.getDamage() > 0) {
|
if (this.getDamage() > 0) {
|
||||||
@ -379,7 +379,7 @@ public class EntityBoat extends Entity {
|
|||||||
for (l = 0; l < list.size(); ++l) {
|
for (l = 0; l < list.size(); ++l) {
|
||||||
Entity entity = (Entity) list.get(l);
|
Entity entity = (Entity) list.get(l);
|
||||||
|
|
||||||
if (entity != this.passenger && entity.f_() && entity instanceof EntityBoat) {
|
if (entity != this.passenger && entity.e_() && entity instanceof EntityBoat) {
|
||||||
entity.collide(this);
|
entity.collide(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -402,12 +402,12 @@ public class EntityBoat extends Entity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void i() {
|
public void i_() {
|
||||||
if (this.passenger != null) {
|
if (this.passenger != null) {
|
||||||
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.q() + this.passenger.S(), this.locZ + d1);
|
this.passenger.setPosition(this.locX + d0, this.locY + this.x_() + this.passenger.V(), this.locZ + d1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -439,7 +439,7 @@ public class EntityBoat extends Entity {
|
|||||||
this.datawatcher.watch(17, Integer.valueOf(i));
|
this.datawatcher.watch(17, Integer.valueOf(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
public int k() {
|
public int l() {
|
||||||
return this.datawatcher.getInt(17);
|
return this.datawatcher.getInt(17);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -447,7 +447,7 @@ public class EntityBoat extends Entity {
|
|||||||
this.datawatcher.watch(18, Integer.valueOf(i));
|
this.datawatcher.watch(18, Integer.valueOf(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
public int l() {
|
public int m() {
|
||||||
return this.datawatcher.getInt(18);
|
return this.datawatcher.getInt(18);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,14 +20,28 @@ public class EntityChicken extends EntityAnimal {
|
|||||||
this.texture = "/mob/chicken.png";
|
this.texture = "/mob/chicken.png";
|
||||||
this.b(0.3F, 0.7F);
|
this.b(0.3F, 0.7F);
|
||||||
this.j = this.random.nextInt(6000) + 6000;
|
this.j = this.random.nextInt(6000) + 6000;
|
||||||
|
float f = 0.25F;
|
||||||
|
|
||||||
|
this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
||||||
|
this.goalSelector.a(1, new PathfinderGoalPanic(this, 0.38F));
|
||||||
|
this.goalSelector.a(2, new PathfinderGoalBreed(this, f));
|
||||||
|
this.goalSelector.a(3, new PathfinderGoalTempt(this, 0.25F, Item.WHEAT.id, false));
|
||||||
|
this.goalSelector.a(4, new PathfinderGoalFollowParent(this, 0.28F));
|
||||||
|
this.goalSelector.a(5, new PathfinderGoalRandomStroll(this, f));
|
||||||
|
this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F));
|
||||||
|
this.goalSelector.a(7, new PathfinderGoalRandomLookaround(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean c_() {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMaxHealth() {
|
public int getMaxHealth() {
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void d() {
|
public void e() {
|
||||||
super.d();
|
super.e();
|
||||||
this.h = this.b;
|
this.h = this.b;
|
||||||
this.g = this.c;
|
this.g = this.c;
|
||||||
this.c = (float) ((double) this.c + (double) (this.onGround ? -1 : 4) * 0.3D);
|
this.c = (float) ((double) this.c + (double) (this.onGround ? -1 : 4) * 0.3D);
|
||||||
@ -56,7 +70,7 @@ public class EntityChicken extends EntityAnimal {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void b(float f) {}
|
protected void a(float f) {}
|
||||||
|
|
||||||
public void b(NBTTagCompound nbttagcompound) {
|
public void b(NBTTagCompound nbttagcompound) {
|
||||||
super.b(nbttagcompound);
|
super.b(nbttagcompound);
|
||||||
@ -66,15 +80,15 @@ public class EntityChicken extends EntityAnimal {
|
|||||||
super.a(nbttagcompound);
|
super.a(nbttagcompound);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String c_() {
|
protected String i() {
|
||||||
return "mob.chicken";
|
return "mob.chicken";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String m() {
|
protected String j() {
|
||||||
return "mob.chickenhurt";
|
return "mob.chickenhurt";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String n() {
|
protected String k() {
|
||||||
return "mob.chickenhurt";
|
return "mob.chickenhurt";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,7 +115,7 @@ public class EntityChicken extends EntityAnimal {
|
|||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
}
|
}
|
||||||
|
|
||||||
protected EntityAnimal createChild(EntityAnimal entityanimal) {
|
public EntityAnimal createChild(EntityAnimal entityanimal) {
|
||||||
return new EntityChicken(this.world);
|
return new EntityChicken(this.world);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,19 @@ public class EntityCow extends EntityAnimal {
|
|||||||
super(world);
|
super(world);
|
||||||
this.texture = "/mob/cow.png";
|
this.texture = "/mob/cow.png";
|
||||||
this.b(0.9F, 1.3F);
|
this.b(0.9F, 1.3F);
|
||||||
|
this.ak().a(true);
|
||||||
|
this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
||||||
|
this.goalSelector.a(1, new PathfinderGoalPanic(this, 0.38F));
|
||||||
|
this.goalSelector.a(2, new PathfinderGoalBreed(this, 0.2F));
|
||||||
|
this.goalSelector.a(3, new PathfinderGoalTempt(this, 0.25F, Item.WHEAT.id, false));
|
||||||
|
this.goalSelector.a(4, new PathfinderGoalFollowParent(this, 0.25F));
|
||||||
|
this.goalSelector.a(5, new PathfinderGoalRandomStroll(this, 0.2F));
|
||||||
|
this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F));
|
||||||
|
this.goalSelector.a(7, new PathfinderGoalRandomLookaround(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean c_() {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMaxHealth() {
|
public int getMaxHealth() {
|
||||||
@ -29,19 +42,19 @@ public class EntityCow extends EntityAnimal {
|
|||||||
super.a(nbttagcompound);
|
super.a(nbttagcompound);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String c_() {
|
protected String i() {
|
||||||
return "mob.cow";
|
return "mob.cow";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String m() {
|
protected String j() {
|
||||||
return "mob.cowhurt";
|
return "mob.cowhurt";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String n() {
|
protected String k() {
|
||||||
return "mob.cowhurt";
|
return "mob.cowhurt";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected float o() {
|
protected float p() {
|
||||||
return 0.4F;
|
return 0.4F;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,7 +102,7 @@ public class EntityCow extends EntityAnimal {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected EntityAnimal createChild(EntityAnimal entityanimal) {
|
public EntityAnimal createChild(EntityAnimal entityanimal) {
|
||||||
return new EntityCow(this.world);
|
return new EntityCow(this.world);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,17 +17,17 @@ public abstract class EntityCreature extends EntityLiving {
|
|||||||
super(world);
|
super(world);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean v() {
|
protected boolean E() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void m_() {
|
protected void d_() {
|
||||||
// MethodProfiler.a("ai"); // CraftBukkit - not in production code
|
// MethodProfiler.a("ai"); // CraftBukkit - not in production code
|
||||||
if (this.f > 0) {
|
if (this.f > 0) {
|
||||||
--this.f;
|
--this.f;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.e = this.v();
|
this.e = this.E();
|
||||||
float f = 16.0F;
|
float f = 16.0F;
|
||||||
|
|
||||||
if (this.target == null) {
|
if (this.target == null) {
|
||||||
@ -48,7 +48,7 @@ public abstract class EntityCreature extends EntityLiving {
|
|||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
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, true, false, false, true);
|
||||||
}
|
}
|
||||||
} else if (!this.target.isAlive()) {
|
} else if (!this.target.isAlive()) {
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
@ -64,9 +64,9 @@ public abstract class EntityCreature extends EntityLiving {
|
|||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
} else {
|
} else {
|
||||||
float f1 = this.target.h(this);
|
float f1 = this.target.i(this);
|
||||||
|
|
||||||
if (this.g(this.target)) {
|
if (this.h(this.target)) {
|
||||||
this.a(this.target, f1);
|
this.a(this.target, f1);
|
||||||
} else {
|
} else {
|
||||||
this.b(this.target, f1);
|
this.b(this.target, f1);
|
||||||
@ -75,19 +75,19 @@ public abstract class EntityCreature extends EntityLiving {
|
|||||||
|
|
||||||
// MethodProfiler.a(); // CraftBukkit - not in production code
|
// MethodProfiler.a(); // CraftBukkit - not in production code
|
||||||
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, true, false, false, true);
|
||||||
} else if (!this.e && (this.pathEntity == null && this.random.nextInt(180) == 0 || this.random.nextInt(120) == 0 || this.f > 0) && this.aV < 100) {
|
} else if (!this.e && (this.pathEntity == null && this.random.nextInt(180) == 0 || this.random.nextInt(120) == 0 || this.f > 0) && this.aV < 100) {
|
||||||
this.D();
|
this.F();
|
||||||
}
|
}
|
||||||
|
|
||||||
int i = MathHelper.floor(this.boundingBox.b + 0.5D);
|
int i = MathHelper.floor(this.boundingBox.b + 0.5D);
|
||||||
boolean flag = this.aK();
|
boolean flag = this.aT();
|
||||||
boolean flag1 = this.aL();
|
boolean flag1 = this.aU();
|
||||||
|
|
||||||
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) {
|
||||||
// MethodProfiler.a("followpath"); // CraftBukkit - not in production code
|
// MethodProfiler.a("followpath"); // CraftBukkit - not in production code
|
||||||
Vec3D vec3d = this.pathEntity.a(this);
|
Vec3D vec3d = this.pathEntity.a((Entity) this);
|
||||||
double d0 = (double) (this.width * 2.0F);
|
double d0 = (double) (this.width * 2.0F);
|
||||||
|
|
||||||
while (vec3d != null && vec3d.d(this.locX, vec3d.b, this.locZ) < d0 * d0) {
|
while (vec3d != null && vec3d.d(this.locX, vec3d.b, this.locZ) < d0 * d0) {
|
||||||
@ -96,7 +96,7 @@ public abstract class EntityCreature extends EntityLiving {
|
|||||||
vec3d = null;
|
vec3d = null;
|
||||||
this.pathEntity = null;
|
this.pathEntity = null;
|
||||||
} else {
|
} else {
|
||||||
vec3d = this.pathEntity.a(this);
|
vec3d = this.pathEntity.a((Entity) this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -146,7 +146,7 @@ public abstract class EntityCreature extends EntityLiving {
|
|||||||
this.a(this.target, 30.0F, 30.0F);
|
this.a(this.target, 30.0F, 30.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.positionChanged && !this.E()) {
|
if (this.positionChanged && !this.G()) {
|
||||||
this.aZ = true;
|
this.aZ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -156,12 +156,12 @@ public abstract class EntityCreature extends EntityLiving {
|
|||||||
|
|
||||||
// MethodProfiler.a(); // CraftBukkit - not in production code
|
// MethodProfiler.a(); // CraftBukkit - not in production code
|
||||||
} else {
|
} else {
|
||||||
super.m_();
|
super.d_();
|
||||||
this.pathEntity = null;
|
this.pathEntity = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void D() {
|
protected void F() {
|
||||||
// MethodProfiler.a("stroll"); // CraftBukkit - not in production code
|
// MethodProfiler.a("stroll"); // CraftBukkit - not in production code
|
||||||
boolean flag = false;
|
boolean flag = false;
|
||||||
int i = -1;
|
int i = -1;
|
||||||
@ -185,7 +185,7 @@ public abstract class EntityCreature extends EntityLiving {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (flag) {
|
if (flag) {
|
||||||
this.pathEntity = this.world.a(this, i, j, k, 10.0F);
|
this.pathEntity = this.world.a(this, i, j, k, 10.0F, true, false, false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// MethodProfiler.a(); // CraftBukkit - not in production code
|
// MethodProfiler.a(); // CraftBukkit - not in production code
|
||||||
@ -211,7 +211,7 @@ public abstract class EntityCreature extends EntityLiving {
|
|||||||
return super.canSpawn() && this.a(i, j, k) >= 0.0F;
|
return super.canSpawn() && this.a(i, j, k) >= 0.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean E() {
|
public boolean G() {
|
||||||
return this.pathEntity != null;
|
return this.pathEntity != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -219,7 +219,7 @@ public abstract class EntityCreature extends EntityLiving {
|
|||||||
this.pathEntity = pathentity;
|
this.pathEntity = pathentity;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Entity F() {
|
public Entity H() {
|
||||||
return this.target;
|
return this.target;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -227,13 +227,17 @@ public abstract class EntityCreature extends EntityLiving {
|
|||||||
this.target = entity;
|
this.target = entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected float G() {
|
protected float D_() {
|
||||||
float f = super.G();
|
if (this.c_()) {
|
||||||
|
return 1.0F;
|
||||||
|
} else {
|
||||||
|
float f = super.D_();
|
||||||
|
|
||||||
if (this.f > 0) {
|
if (this.f > 0) {
|
||||||
f *= 2.0F;
|
f *= 2.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
return f;
|
||||||
}
|
}
|
||||||
|
|
||||||
return f;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,19 @@ public class EntityCreeper extends EntityMonster {
|
|||||||
public EntityCreeper(World world) {
|
public EntityCreeper(World world) {
|
||||||
super(world);
|
super(world);
|
||||||
this.texture = "/mob/creeper.png";
|
this.texture = "/mob/creeper.png";
|
||||||
|
this.goalSelector.a(1, new PathfinderGoalFloat(this));
|
||||||
|
this.goalSelector.a(2, new PathfinderGoalSwell(this));
|
||||||
|
this.goalSelector.a(3, new PathfinderGoalAvoidPlayer(this, EntityOcelot.class, 6.0F, 0.25F, 0.3F));
|
||||||
|
this.goalSelector.a(4, new PathfinderGoalMeleeAttack(this, 0.25F, false));
|
||||||
|
this.goalSelector.a(5, new PathfinderGoalRandomStroll(this, 0.2F));
|
||||||
|
this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F));
|
||||||
|
this.goalSelector.a(6, new PathfinderGoalRandomLookaround(this));
|
||||||
|
this.targetSelector.a(1, new PathfinderGoalNearestAttackableTarget(this, EntityHuman.class, 16.0F, 0, false));
|
||||||
|
this.targetSelector.a(2, new PathfinderGoalHurtByTarget(this, false));
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean c_() {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMaxHealth() {
|
public int getMaxHealth() {
|
||||||
@ -34,22 +47,10 @@ public class EntityCreeper extends EntityMonster {
|
|||||||
this.datawatcher.watch(17, Byte.valueOf((byte) (nbttagcompound.getBoolean("powered") ? 1 : 0)));
|
this.datawatcher.watch(17, Byte.valueOf((byte) (nbttagcompound.getBoolean("powered") ? 1 : 0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void b(Entity entity, float f) {
|
public void G_() {
|
||||||
if (!this.world.isStatic) {
|
if (this.isAlive()) {
|
||||||
if (this.fuseTicks > 0) {
|
this.b = this.fuseTicks;
|
||||||
this.b(-1);
|
int i = this.A();
|
||||||
--this.fuseTicks;
|
|
||||||
if (this.fuseTicks < 0) {
|
|
||||||
this.fuseTicks = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void y_() {
|
|
||||||
this.b = this.fuseTicks;
|
|
||||||
if (this.world.isStatic) {
|
|
||||||
int i = this.B();
|
|
||||||
|
|
||||||
if (i > 0 && this.fuseTicks == 0) {
|
if (i > 0 && this.fuseTicks == 0) {
|
||||||
this.world.makeSound(this, "random.fuse", 1.0F, 0.5F);
|
this.world.makeSound(this, "random.fuse", 1.0F, 0.5F);
|
||||||
@ -62,24 +63,30 @@ public class EntityCreeper extends EntityMonster {
|
|||||||
|
|
||||||
if (this.fuseTicks >= 30) {
|
if (this.fuseTicks >= 30) {
|
||||||
this.fuseTicks = 30;
|
this.fuseTicks = 30;
|
||||||
|
// CraftBukkit start
|
||||||
|
float radius = this.isPowered() ? 6.0F : 3.0F;
|
||||||
|
|
||||||
|
ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), radius, false);
|
||||||
|
this.world.getServer().getPluginManager().callEvent(event);
|
||||||
|
|
||||||
|
if (!event.isCancelled()) {
|
||||||
|
this.world.createExplosion(this, this.locX, this.locY, this.locZ, event.getRadius(), event.getFire());
|
||||||
|
this.die();
|
||||||
|
} else {
|
||||||
|
this.fuseTicks = 0;
|
||||||
|
}
|
||||||
|
// CraftBukkit end
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
super.y_();
|
super.G_();
|
||||||
if (this.target == null && this.fuseTicks > 0) {
|
|
||||||
this.b(-1);
|
|
||||||
--this.fuseTicks;
|
|
||||||
if (this.fuseTicks < 0) {
|
|
||||||
this.fuseTicks = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String m() {
|
protected String j() {
|
||||||
return "mob.creeper";
|
return "mob.creeper";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String n() {
|
protected String k() {
|
||||||
return "mob.creeperdeath";
|
return "mob.creeperdeath";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,42 +97,8 @@ public class EntityCreeper extends EntityMonster {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void a(Entity entity, float f) {
|
public boolean a(Entity entity) {
|
||||||
if (!this.world.isStatic) {
|
return true;
|
||||||
int i = this.B();
|
|
||||||
|
|
||||||
if ((i > 0 || f >= 3.0F) && (i <= 0 || f >= 7.0F)) {
|
|
||||||
this.b(-1);
|
|
||||||
--this.fuseTicks;
|
|
||||||
if (this.fuseTicks < 0) {
|
|
||||||
this.fuseTicks = 0;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (this.fuseTicks == 0) {
|
|
||||||
this.world.makeSound(this, "random.fuse", 1.0F, 0.5F);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.b(1);
|
|
||||||
++this.fuseTicks;
|
|
||||||
if (this.fuseTicks >= 30) {
|
|
||||||
// CraftBukkit start
|
|
||||||
float radius = this.isPowered() ? 6.0F : 3.0F;
|
|
||||||
|
|
||||||
ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), radius, false);
|
|
||||||
this.world.getServer().getPluginManager().callEvent(event);
|
|
||||||
|
|
||||||
if (!event.isCancelled()) {
|
|
||||||
this.world.createExplosion(this, this.locX, this.locY, this.locZ, event.getRadius(), event.getFire());
|
|
||||||
this.die();
|
|
||||||
} else {
|
|
||||||
this.fuseTicks = 0;
|
|
||||||
}
|
|
||||||
// CraftBukkit end
|
|
||||||
}
|
|
||||||
|
|
||||||
this.e = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isPowered() {
|
public boolean isPowered() {
|
||||||
@ -136,11 +109,11 @@ public class EntityCreeper extends EntityMonster {
|
|||||||
return Item.SULPHUR.id;
|
return Item.SULPHUR.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int B() {
|
public int A() {
|
||||||
return this.datawatcher.getByte(16);
|
return this.datawatcher.getByte(16);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void b(int i) {
|
public void c(int i) {
|
||||||
this.datawatcher.watch(16, Byte.valueOf((byte) i));
|
this.datawatcher.watch(16, Byte.valueOf((byte) i));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ public class EntityEnderCrystal extends Entity {
|
|||||||
this.datawatcher.a(8, Integer.valueOf(this.b));
|
this.datawatcher.a(8, Integer.valueOf(this.b));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void y_() {
|
public void G_() {
|
||||||
this.lastX = this.locX;
|
this.lastX = this.locX;
|
||||||
this.lastY = this.locY;
|
this.lastY = this.locY;
|
||||||
this.lastZ = this.locZ;
|
this.lastZ = this.locZ;
|
||||||
@ -41,7 +41,7 @@ public class EntityEnderCrystal extends Entity {
|
|||||||
|
|
||||||
protected void a(NBTTagCompound nbttagcompound) {}
|
protected void a(NBTTagCompound nbttagcompound) {}
|
||||||
|
|
||||||
public boolean e_() {
|
public boolean o_() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ public class EntityEnderDragon extends EntityComplex {
|
|||||||
return adouble;
|
return adouble;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void d() {
|
public void e() {
|
||||||
this.n = this.o;
|
this.n = this.o;
|
||||||
if (!this.world.isStatic) {
|
if (!this.world.isStatic) {
|
||||||
this.datawatcher.watch(16, Integer.valueOf(this.health));
|
this.datawatcher.watch(16, Integer.valueOf(this.health));
|
||||||
@ -104,7 +104,7 @@ public class EntityEnderDragon extends EntityComplex {
|
|||||||
f1 = (this.random.nextFloat() - 0.5F) * 8.0F;
|
f1 = (this.random.nextFloat() - 0.5F) * 8.0F;
|
||||||
this.world.a("largeexplode", this.locX + (double) f, this.locY + 2.0D + (double) d05, this.locZ + (double) f1, 0.0D, 0.0D, 0.0D);
|
this.world.a("largeexplode", this.locX + (double) f, this.locY + 2.0D + (double) d05, this.locZ + (double) f1, 0.0D, 0.0D, 0.0D);
|
||||||
} else {
|
} else {
|
||||||
this.v();
|
this.A();
|
||||||
f = 0.2F / (MathHelper.sqrt(this.motX * this.motX + this.motZ * this.motZ) * 10.0F + 1.0F);
|
f = 0.2F / (MathHelper.sqrt(this.motX * this.motX + this.motZ * this.motZ) * 10.0F + 1.0F);
|
||||||
f *= (float) Math.pow(2.0D, this.motY);
|
f *= (float) Math.pow(2.0D, this.motY);
|
||||||
if (this.q) {
|
if (this.q) {
|
||||||
@ -184,7 +184,7 @@ public class EntityEnderDragon extends EntityComplex {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.p || d3 < 100.0D || d3 > 22500.0D || this.positionChanged || this.bz) {
|
if (this.p || d3 < 100.0D || d3 > 22500.0D || this.positionChanged || this.bz) {
|
||||||
this.B();
|
this.E();
|
||||||
}
|
}
|
||||||
|
|
||||||
d1 /= (double) MathHelper.sqrt(d0 * d0 + d2 * d2);
|
d1 /= (double) MathHelper.sqrt(d0 * d0 + d2 * d2);
|
||||||
@ -280,14 +280,14 @@ public class EntityEnderDragon extends EntityComplex {
|
|||||||
float f11 = MathHelper.sin(f10);
|
float f11 = MathHelper.sin(f10);
|
||||||
float f12 = MathHelper.cos(f10);
|
float f12 = MathHelper.cos(f10);
|
||||||
|
|
||||||
this.h.y_();
|
this.h.G_();
|
||||||
this.h.setPositionRotation(this.locX + (double) (f11 * 0.5F), this.locY, this.locZ - (double) (f12 * 0.5F), 0.0F, 0.0F);
|
this.h.setPositionRotation(this.locX + (double) (f11 * 0.5F), this.locY, this.locZ - (double) (f12 * 0.5F), 0.0F, 0.0F);
|
||||||
this.l.y_();
|
this.l.G_();
|
||||||
this.l.setPositionRotation(this.locX + (double) (f12 * 4.5F), this.locY + 2.0D, this.locZ + (double) (f11 * 4.5F), 0.0F, 0.0F);
|
this.l.setPositionRotation(this.locX + (double) (f12 * 4.5F), this.locY + 2.0D, this.locZ + (double) (f11 * 4.5F), 0.0F, 0.0F);
|
||||||
this.m.y_();
|
this.m.G_();
|
||||||
this.m.setPositionRotation(this.locX - (double) (f12 * 4.5F), this.locY + 2.0D, this.locZ - (double) (f11 * 4.5F), 0.0F, 0.0F);
|
this.m.setPositionRotation(this.locX - (double) (f12 * 4.5F), this.locY + 2.0D, this.locZ - (double) (f11 * 4.5F), 0.0F, 0.0F);
|
||||||
if (!this.world.isStatic) {
|
if (!this.world.isStatic) {
|
||||||
this.z();
|
this.D();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.world.isStatic && this.at == 0) {
|
if (!this.world.isStatic && this.at == 0) {
|
||||||
@ -302,7 +302,7 @@ public class EntityEnderDragon extends EntityComplex {
|
|||||||
f3 = MathHelper.sin(this.yaw * 3.1415927F / 180.0F - this.aY * 0.01F);
|
f3 = MathHelper.sin(this.yaw * 3.1415927F / 180.0F - this.aY * 0.01F);
|
||||||
float f13 = MathHelper.cos(this.yaw * 3.1415927F / 180.0F - this.aY * 0.01F);
|
float f13 = MathHelper.cos(this.yaw * 3.1415927F / 180.0F - this.aY * 0.01F);
|
||||||
|
|
||||||
this.g.y_();
|
this.g.G_();
|
||||||
this.g.setPositionRotation(this.locX + (double) (f3 * 5.5F * f1), this.locY + (adouble1[1] - adouble[1]) * 1.0D + (double) (f9 * 5.5F), this.locZ - (double) (f13 * 5.5F * f1), 0.0F, 0.0F);
|
this.g.setPositionRotation(this.locX + (double) (f3 * 5.5F * f1), this.locY + (adouble1[1] - adouble[1]) * 1.0D + (double) (f9 * 5.5F), this.locZ - (double) (f13 * 5.5F * f1), 0.0F, 0.0F);
|
||||||
|
|
||||||
for (int j = 0; j < 3; ++j) {
|
for (int j = 0; j < 3; ++j) {
|
||||||
@ -327,7 +327,7 @@ public class EntityEnderDragon extends EntityComplex {
|
|||||||
float f17 = 1.5F;
|
float f17 = 1.5F;
|
||||||
float f18 = (float) (j + 1) * 2.0F;
|
float f18 = (float) (j + 1) * 2.0F;
|
||||||
|
|
||||||
entitycomplexpart.y_();
|
entitycomplexpart.G_();
|
||||||
entitycomplexpart.setPositionRotation(this.locX - (double) ((f11 * f17 + f15 * f18) * f1), this.locY + (adouble2[1] - adouble[1]) * 1.0D - (double) ((f18 + f17) * f9) + 1.5D, this.locZ + (double) ((f12 * f17 + f16 * f18) * f1), 0.0F, 0.0F);
|
entitycomplexpart.setPositionRotation(this.locX - (double) ((f11 * f17 + f15 * f18) * f1), this.locY + (adouble2[1] - adouble[1]) * 1.0D - (double) ((f18 + f17) * f9) + 1.5D, this.locZ + (double) ((f12 * f17 + f16 * f18) * f1), 0.0F, 0.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -337,7 +337,7 @@ public class EntityEnderDragon extends EntityComplex {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void v() {
|
private void A() {
|
||||||
if (this.s != null) {
|
if (this.s != null) {
|
||||||
if (this.s.dead) {
|
if (this.s.dead) {
|
||||||
if (!this.world.isStatic) {
|
if (!this.world.isStatic) {
|
||||||
@ -366,7 +366,7 @@ public class EntityEnderDragon extends EntityComplex {
|
|||||||
|
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
Entity entity = (Entity) iterator.next();
|
Entity entity = (Entity) iterator.next();
|
||||||
double d1 = entity.i(this);
|
double d1 = entity.j(this);
|
||||||
|
|
||||||
if (d1 < d0) {
|
if (d1 < d0) {
|
||||||
d0 = d1;
|
d0 = d1;
|
||||||
@ -378,14 +378,7 @@ public class EntityEnderDragon extends EntityComplex {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void z() {
|
private void D() {}
|
||||||
if (this.ticksLived % 20 == 0) {
|
|
||||||
Vec3D vec3d = this.e(1.0F);
|
|
||||||
double d0 = 0.0D;
|
|
||||||
double d1 = -1.0D;
|
|
||||||
double d2 = 0.0D;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void a(List list) {
|
private void a(List list) {
|
||||||
double d0 = (this.h.boundingBox.a + this.h.boundingBox.d) / 2.0D;
|
double d0 = (this.h.boundingBox.a + this.h.boundingBox.d) / 2.0D;
|
||||||
@ -427,7 +420,7 @@ public class EntityEnderDragon extends EntityComplex {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void B() {
|
private void E() {
|
||||||
this.p = false;
|
this.p = false;
|
||||||
if (this.random.nextInt(2) == 0 && this.world.players.size() > 0) {
|
if (this.random.nextInt(2) == 0 && this.world.players.size() > 0) {
|
||||||
this.u = (Entity) this.world.players.get(this.random.nextInt(this.world.players.size()));
|
this.u = (Entity) this.world.players.get(this.random.nextInt(this.world.players.size()));
|
||||||
@ -542,7 +535,7 @@ public class EntityEnderDragon extends EntityComplex {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void an() {
|
protected void aA() {
|
||||||
++this.r;
|
++this.r;
|
||||||
if (this.r >= 180 && this.r <= 200) {
|
if (this.r >= 180 && this.r <= 200) {
|
||||||
float f = (this.random.nextFloat() - 0.5F) * 8.0F;
|
float f = (this.random.nextFloat() - 0.5F) * 8.0F;
|
||||||
@ -586,54 +579,54 @@ public class EntityEnderDragon extends EntityComplex {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.a(MathHelper.floor(this.locX), MathHelper.floor(this.locZ));
|
this.a(MathHelper.floor(this.locX), MathHelper.floor(this.locZ));
|
||||||
this.ay();
|
this.aG();
|
||||||
this.die();
|
this.die();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void a(int i, int j) {
|
private void a(int i, int j) {
|
||||||
int k = this.world.height / 2;
|
byte b0 = 64;
|
||||||
|
|
||||||
BlockEnderPortal.a = true;
|
BlockEnderPortal.a = true;
|
||||||
byte b0 = 4;
|
byte b1 = 4;
|
||||||
|
|
||||||
// CraftBukkit start - Replace any "this.world" in the following with just "world"!
|
// CraftBukkit start - Replace any "this.world" in the following with just "world"!
|
||||||
EntityCreatePortalEvent event = new EntityCreatePortalEvent((org.bukkit.entity.LivingEntity) this.getBukkitEntity(), new ArrayList<BlockState>(), PortalType.ENDER);
|
EntityCreatePortalEvent event = new EntityCreatePortalEvent((org.bukkit.entity.LivingEntity) this.getBukkitEntity(), new ArrayList<BlockState>(), PortalType.ENDER);
|
||||||
BlockStateListPopulator world = new BlockStateListPopulator(this.world.getWorld(), event.getBlocks());
|
BlockStateListPopulator world = new BlockStateListPopulator(this.world.getWorld(), event.getBlocks());
|
||||||
|
|
||||||
for (int l = k - 1; l <= k + 32; ++l) {
|
for (int k = b0 - 1; k <= b0 + 32; ++k) {
|
||||||
for (int i1 = i - b0; i1 <= i + b0; ++i1) {
|
for (int l = i - b1; l <= i + b1; ++l) {
|
||||||
for (int j1 = j - b0; j1 <= j + b0; ++j1) {
|
for (int i1 = j - b1; i1 <= j + b1; ++i1) {
|
||||||
double d0 = (double) (i1 - i);
|
double d0 = (double) (l - i);
|
||||||
double d1 = (double) (j1 - j);
|
double d1 = (double) (i1 - j);
|
||||||
double d2 = (double) MathHelper.sqrt(d0 * d0 + d1 * d1);
|
double d2 = (double) MathHelper.sqrt(d0 * d0 + d1 * d1);
|
||||||
|
|
||||||
if (d2 <= (double) b0 - 0.5D) {
|
if (d2 <= (double) b1 - 0.5D) {
|
||||||
if (l < k) {
|
if (k < b0) {
|
||||||
if (d2 <= (double) (b0 - 1) - 0.5D) {
|
if (d2 <= (double) (b1 - 1) - 0.5D) {
|
||||||
world.setTypeId(i1, l, j1, Block.BEDROCK.id);
|
this.world.setTypeId(l, k, i1, Block.BEDROCK.id);
|
||||||
}
|
}
|
||||||
} else if (l > k) {
|
} else if (k > b0) {
|
||||||
world.setTypeId(i1, l, j1, 0);
|
this.world.setTypeId(l, k, i1, 0);
|
||||||
} else if (d2 > (double) (b0 - 1) - 0.5D) {
|
} else if (d2 > (double) (b1 - 1) - 0.5D) {
|
||||||
world.setTypeId(i1, l, j1, Block.BEDROCK.id);
|
this.world.setTypeId(l, k, i1, Block.BEDROCK.id);
|
||||||
} else {
|
} else {
|
||||||
world.setTypeId(i1, l, j1, Block.ENDER_PORTAL.id);
|
this.world.setTypeId(l, k, i1, Block.ENDER_PORTAL.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
world.setTypeId(i, k + 0, j, Block.BEDROCK.id);
|
this.world.setTypeId(i, b0 + 0, j, Block.BEDROCK.id);
|
||||||
world.setTypeId(i, k + 1, j, Block.BEDROCK.id);
|
this.world.setTypeId(i, b0 + 1, j, Block.BEDROCK.id);
|
||||||
world.setTypeId(i, k + 2, j, Block.BEDROCK.id);
|
this.world.setTypeId(i, b0 + 2, j, Block.BEDROCK.id);
|
||||||
world.setTypeId(i - 1, k + 2, j, Block.TORCH.id);
|
this.world.setTypeId(i - 1, b0 + 2, j, Block.TORCH.id);
|
||||||
world.setTypeId(i + 1, k + 2, j, Block.TORCH.id);
|
this.world.setTypeId(i + 1, b0 + 2, j, Block.TORCH.id);
|
||||||
world.setTypeId(i, k + 2, j - 1, Block.TORCH.id);
|
this.world.setTypeId(i, b0 + 2, j - 1, Block.TORCH.id);
|
||||||
world.setTypeId(i, k + 2, j + 1, Block.TORCH.id);
|
this.world.setTypeId(i, b0 + 2, j + 1, Block.TORCH.id);
|
||||||
world.setTypeId(i, k + 3, j, Block.BEDROCK.id);
|
this.world.setTypeId(i, b0 + 3, j, Block.BEDROCK.id);
|
||||||
world.setTypeId(i, k + 4, j, Block.DRAGON_EGG.id);
|
this.world.setTypeId(i, b0 + 4, j, Block.DRAGON_EGG.id);
|
||||||
|
|
||||||
this.world.getServer().getPluginManager().callEvent(event);
|
this.world.getServer().getPluginManager().callEvent(event);
|
||||||
|
|
||||||
@ -647,13 +640,13 @@ public class EntityEnderDragon extends EntityComplex {
|
|||||||
BlockEnderPortal.a = false;
|
BlockEnderPortal.a = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void au() {}
|
protected void aF() {}
|
||||||
|
|
||||||
public Entity[] aR() {
|
public Entity[] ba() {
|
||||||
return this.children;
|
return this.children;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean e_() {
|
public boolean o_() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,8 +63,8 @@ public class EntityEnderman extends EntityMonster {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public float a(float f) {
|
public float b(float f) {
|
||||||
return super.a(f);
|
return super.b(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean c(EntityHuman entityhuman) {
|
private boolean c(EntityHuman entityhuman) {
|
||||||
@ -73,19 +73,19 @@ public class EntityEnderman extends EntityMonster {
|
|||||||
if (itemstack != null && itemstack.id == Block.PUMPKIN.id) {
|
if (itemstack != null && itemstack.id == Block.PUMPKIN.id) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
Vec3D vec3d = entityhuman.e(1.0F).b();
|
Vec3D vec3d = entityhuman.f(1.0F).b();
|
||||||
Vec3D vec3d1 = Vec3D.create(this.locX - entityhuman.locX, this.boundingBox.b + (double) (this.length / 2.0F) - (entityhuman.locY + (double) entityhuman.getHeadHeight()), this.locZ - entityhuman.locZ);
|
Vec3D vec3d1 = Vec3D.create(this.locX - entityhuman.locX, this.boundingBox.b + (double) (this.length / 2.0F) - (entityhuman.locY + (double) entityhuman.getHeadHeight()), this.locZ - entityhuman.locZ);
|
||||||
double d0 = vec3d1.c();
|
double d0 = vec3d1.c();
|
||||||
|
|
||||||
vec3d1 = vec3d1.b();
|
vec3d1 = vec3d1.b();
|
||||||
double d1 = vec3d.a(vec3d1);
|
double d1 = vec3d.a(vec3d1);
|
||||||
|
|
||||||
return d1 > 1.0D - 0.025D / d0 ? entityhuman.g(this) : false;
|
return d1 > 1.0D - 0.025D / d0 ? entityhuman.h(this) : false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void d() {
|
public void e() {
|
||||||
if (this.aJ()) {
|
if (this.aS()) {
|
||||||
this.damageEntity(DamageSource.DROWN, 1);
|
this.damageEntity(DamageSource.DROWN, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,17 +139,17 @@ public class EntityEnderman extends EntityMonster {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.world.e() && !this.world.isStatic) {
|
if (this.world.e() && !this.world.isStatic) {
|
||||||
float f = this.a(1.0F);
|
float f = this.b(1.0F);
|
||||||
|
|
||||||
if (f > 0.5F && this.world.isChunkLoaded(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) {
|
if (f > 0.5F && this.world.isChunkLoaded(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) {
|
||||||
this.target = null;
|
this.target = null;
|
||||||
this.w_();
|
this.x();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.aJ()) {
|
if (this.aS()) {
|
||||||
this.target = null;
|
this.target = null;
|
||||||
this.w_();
|
this.x();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.aZ = false;
|
this.aZ = false;
|
||||||
@ -162,12 +162,12 @@ public class EntityEnderman extends EntityMonster {
|
|||||||
if (this.target instanceof EntityHuman && this.c((EntityHuman) this.target)) {
|
if (this.target instanceof EntityHuman && this.c((EntityHuman) this.target)) {
|
||||||
this.aW = this.aX = 0.0F;
|
this.aW = this.aX = 0.0F;
|
||||||
this.bb = 0.0F;
|
this.bb = 0.0F;
|
||||||
if (this.target.i(this) < 16.0D) {
|
if (this.target.j(this) < 16.0D) {
|
||||||
this.w_();
|
this.x();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.g = 0;
|
this.g = 0;
|
||||||
} else if (this.target.i(this) > 256.0D && this.g++ >= 30 && this.f(this.target)) {
|
} else if (this.target.j(this) > 256.0D && this.g++ >= 30 && this.e(this.target)) {
|
||||||
this.g = 0;
|
this.g = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -175,10 +175,10 @@ public class EntityEnderman extends EntityMonster {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
super.d();
|
super.e();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean w_() {
|
protected boolean x() {
|
||||||
double d0 = this.locX + (this.random.nextDouble() - 0.5D) * 64.0D;
|
double d0 = this.locX + (this.random.nextDouble() - 0.5D) * 64.0D;
|
||||||
double d1 = this.locY + (double) (this.random.nextInt(64) - 32);
|
double d1 = this.locY + (double) (this.random.nextInt(64) - 32);
|
||||||
double d2 = this.locZ + (this.random.nextDouble() - 0.5D) * 64.0D;
|
double d2 = this.locZ + (this.random.nextDouble() - 0.5D) * 64.0D;
|
||||||
@ -186,7 +186,7 @@ public class EntityEnderman extends EntityMonster {
|
|||||||
return this.b(d0, d1, d2);
|
return this.b(d0, d1, d2);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean f(Entity entity) {
|
protected boolean e(Entity entity) {
|
||||||
Vec3D vec3d = Vec3D.create(this.locX - entity.locX, this.boundingBox.b + (double) (this.length / 2.0F) - entity.locY + (double) entity.getHeadHeight(), this.locZ - entity.locZ);
|
Vec3D vec3d = Vec3D.create(this.locX - entity.locX, this.boundingBox.b + (double) (this.length / 2.0F) - entity.locY + (double) entity.getHeadHeight(), this.locZ - entity.locZ);
|
||||||
|
|
||||||
vec3d = vec3d.b();
|
vec3d = vec3d.b();
|
||||||
@ -267,15 +267,15 @@ public class EntityEnderman extends EntityMonster {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String c_() {
|
protected String i() {
|
||||||
return "mob.endermen.idle";
|
return "mob.endermen.idle";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String m() {
|
protected String j() {
|
||||||
return "mob.endermen.hit";
|
return "mob.endermen.hit";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String n() {
|
protected String k() {
|
||||||
return "mob.endermen.death";
|
return "mob.endermen.death";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -319,7 +319,7 @@ public class EntityEnderman extends EntityMonster {
|
|||||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||||
if (damagesource instanceof EntityDamageSourceIndirect) {
|
if (damagesource instanceof EntityDamageSourceIndirect) {
|
||||||
for (int j = 0; j < 64; ++j) {
|
for (int j = 0; j < 64; ++j) {
|
||||||
if (this.w_()) {
|
if (this.x()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,8 +34,8 @@ public class EntityExperienceOrb extends Entity {
|
|||||||
|
|
||||||
protected void b() {}
|
protected void b() {}
|
||||||
|
|
||||||
public void y_() {
|
public void G_() {
|
||||||
super.y_();
|
super.G_();
|
||||||
if (this.c > 0) {
|
if (this.c > 0) {
|
||||||
--this.c;
|
--this.c;
|
||||||
}
|
}
|
||||||
@ -102,7 +102,7 @@ public class EntityExperienceOrb extends Entity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean i_() {
|
public boolean h_() {
|
||||||
return this.world.a(this.boundingBox, Material.WATER, this);
|
return this.world.a(this.boundingBox, Material.WATER, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,7 +111,7 @@ public class EntityExperienceOrb extends Entity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||||
this.aM();
|
this.aV();
|
||||||
this.d -= i;
|
this.d -= i;
|
||||||
if (this.d <= 0) {
|
if (this.d <= 0) {
|
||||||
this.die();
|
this.die();
|
||||||
@ -144,7 +144,7 @@ public class EntityExperienceOrb extends Entity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int g() {
|
public int y_() {
|
||||||
return this.value;
|
return this.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -170,4 +170,8 @@ public class EntityExperienceOrb extends Entity {
|
|||||||
|
|
||||||
return i >= 2477 ? 2477 : (i >= 1237 ? 1237 : (i >= 617 ? 617 : (i >= 307 ? 307 : (i >= 149 ? 149 : (i >= 73 ? 73 : (i >= 37 ? 37 : (i >= 17 ? 17 : (i >= 7 ? 7 : (i >= 3 ? 3 : 1)))))))));
|
return i >= 2477 ? 2477 : (i >= 1237 ? 1237 : (i >= 617 ? 617 : (i >= 307 ? 307 : (i >= 149 ? 149 : (i >= 73 ? 73 : (i >= 37 ? 37 : (i >= 17 ? 17 : (i >= 7 ? 7 : (i >= 3 ? 3 : 1)))))))));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean k_() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,11 +33,11 @@ public class EntityFallingBlock extends Entity {
|
|||||||
|
|
||||||
protected void b() {}
|
protected void b() {}
|
||||||
|
|
||||||
public boolean e_() {
|
public boolean o_() {
|
||||||
return !this.dead;
|
return !this.dead;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void y_() {
|
public void G_() {
|
||||||
if (this.id == 0) {
|
if (this.id == 0) {
|
||||||
this.die();
|
this.die();
|
||||||
} else {
|
} else {
|
||||||
@ -71,7 +71,7 @@ public class EntityFallingBlock extends Entity {
|
|||||||
this.b(this.id, 1);
|
this.b(this.id, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (this.b > 100 && !this.world.isStatic) {
|
} else if (this.b > 100 && !this.world.isStatic && (j < 1 || j > 256) || this.b > 600) {
|
||||||
this.b(this.id, 1);
|
this.b(this.id, 1);
|
||||||
this.die();
|
this.die();
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,18 @@ public class EntityFireball extends Entity {
|
|||||||
|
|
||||||
protected void b() {}
|
protected void b() {}
|
||||||
|
|
||||||
|
public EntityFireball(World world, double d0, double d1, double d2, double d3, double d4, double d5) {
|
||||||
|
super(world);
|
||||||
|
this.b(1.0F, 1.0F);
|
||||||
|
this.setPositionRotation(d0, d1, d2, this.yaw, this.pitch);
|
||||||
|
this.setPosition(d0, d1, d2);
|
||||||
|
double d6 = (double) MathHelper.sqrt(d3 * d3 + d4 * d4 + d5 * d5);
|
||||||
|
|
||||||
|
this.dirX = d3 / d6 * 0.1D;
|
||||||
|
this.dirY = d4 / d6 * 0.1D;
|
||||||
|
this.dirZ = d5 / d6 * 0.1D;
|
||||||
|
}
|
||||||
|
|
||||||
public EntityFireball(World world, EntityLiving entityliving, double d0, double d1, double d2) {
|
public EntityFireball(World world, EntityLiving entityliving, double d0, double d1, double d2) {
|
||||||
super(world);
|
super(world);
|
||||||
this.shooter = entityliving;
|
this.shooter = entityliving;
|
||||||
@ -58,121 +70,121 @@ public class EntityFireball extends Entity {
|
|||||||
this.dirZ = d2 / d3 * 0.1D;
|
this.dirZ = d2 / d3 * 0.1D;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void y_() {
|
public void G_() {
|
||||||
super.y_();
|
if (!this.world.isStatic && (this.shooter != null && this.shooter.dead || !this.world.isLoaded((int) this.locX, (int) this.locY, (int) this.locZ))) {
|
||||||
this.setOnFire(1);
|
|
||||||
if (!this.world.isStatic && (this.shooter == null || this.shooter.dead)) {
|
|
||||||
this.die();
|
this.die();
|
||||||
}
|
} else {
|
||||||
|
super.G_();
|
||||||
|
this.setOnFire(1);
|
||||||
|
if (this.i) {
|
||||||
|
int i = this.world.getTypeId(this.e, this.f, this.g);
|
||||||
|
|
||||||
if (this.i) {
|
if (i == this.h) {
|
||||||
int i = this.world.getTypeId(this.e, this.f, this.g);
|
++this.j;
|
||||||
|
if (this.j == 600) {
|
||||||
|
this.die();
|
||||||
|
}
|
||||||
|
|
||||||
if (i == this.h) {
|
return;
|
||||||
++this.j;
|
|
||||||
if (this.j == 1200) {
|
|
||||||
this.die();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
this.i = false;
|
||||||
|
this.motX *= (double) (this.random.nextFloat() * 0.2F);
|
||||||
|
this.motY *= (double) (this.random.nextFloat() * 0.2F);
|
||||||
|
this.motZ *= (double) (this.random.nextFloat() * 0.2F);
|
||||||
|
this.j = 0;
|
||||||
|
this.k = 0;
|
||||||
|
} else {
|
||||||
|
++this.k;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.i = false;
|
Vec3D vec3d = Vec3D.create(this.locX, this.locY, this.locZ);
|
||||||
this.motX *= (double) (this.random.nextFloat() * 0.2F);
|
Vec3D vec3d1 = Vec3D.create(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ);
|
||||||
this.motY *= (double) (this.random.nextFloat() * 0.2F);
|
MovingObjectPosition movingobjectposition = this.world.a(vec3d, vec3d1);
|
||||||
this.motZ *= (double) (this.random.nextFloat() * 0.2F);
|
|
||||||
this.j = 0;
|
|
||||||
this.k = 0;
|
|
||||||
} else {
|
|
||||||
++this.k;
|
|
||||||
}
|
|
||||||
|
|
||||||
Vec3D vec3d = Vec3D.create(this.locX, this.locY, this.locZ);
|
vec3d = Vec3D.create(this.locX, this.locY, this.locZ);
|
||||||
Vec3D vec3d1 = Vec3D.create(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ);
|
vec3d1 = Vec3D.create(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ);
|
||||||
MovingObjectPosition movingobjectposition = this.world.a(vec3d, vec3d1);
|
if (movingobjectposition != null) {
|
||||||
|
vec3d1 = Vec3D.create(movingobjectposition.pos.a, movingobjectposition.pos.b, movingobjectposition.pos.c);
|
||||||
|
}
|
||||||
|
|
||||||
vec3d = Vec3D.create(this.locX, this.locY, this.locZ);
|
Entity entity = null;
|
||||||
vec3d1 = Vec3D.create(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ);
|
List list = this.world.getEntities(this, this.boundingBox.a(this.motX, this.motY, this.motZ).grow(1.0D, 1.0D, 1.0D));
|
||||||
if (movingobjectposition != null) {
|
double d0 = 0.0D;
|
||||||
vec3d1 = Vec3D.create(movingobjectposition.pos.a, movingobjectposition.pos.b, movingobjectposition.pos.c);
|
|
||||||
}
|
|
||||||
|
|
||||||
Entity entity = null;
|
for (int j = 0; j < list.size(); ++j) {
|
||||||
List list = this.world.getEntities(this, this.boundingBox.a(this.motX, this.motY, this.motZ).grow(1.0D, 1.0D, 1.0D));
|
Entity entity1 = (Entity) list.get(j);
|
||||||
double d0 = 0.0D;
|
|
||||||
|
|
||||||
for (int j = 0; j < list.size(); ++j) {
|
if (entity1.o_() && (!entity1.a_((Entity) this.shooter) || this.k >= 25)) {
|
||||||
Entity entity1 = (Entity) list.get(j);
|
float f = 0.3F;
|
||||||
|
AxisAlignedBB axisalignedbb = entity1.boundingBox.grow((double) f, (double) f, (double) f);
|
||||||
|
MovingObjectPosition movingobjectposition1 = axisalignedbb.a(vec3d, vec3d1);
|
||||||
|
|
||||||
if (entity1.e_() && (!entity1.a((Entity) this.shooter) || this.k >= 25)) {
|
if (movingobjectposition1 != null) {
|
||||||
float f = 0.3F;
|
double d1 = vec3d.distanceSquared(movingobjectposition1.pos); // CraftBukkit - distance efficiency
|
||||||
AxisAlignedBB axisalignedbb = entity1.boundingBox.grow((double) f, (double) f, (double) f);
|
|
||||||
MovingObjectPosition movingobjectposition1 = axisalignedbb.a(vec3d, vec3d1);
|
|
||||||
|
|
||||||
if (movingobjectposition1 != null) {
|
if (d1 < d0 || d0 == 0.0D) {
|
||||||
double d1 = vec3d.distanceSquared(movingobjectposition1.pos); // CraftBukkit - distance efficiency
|
entity = entity1;
|
||||||
|
d0 = d1;
|
||||||
if (d1 < d0 || d0 == 0.0D) {
|
}
|
||||||
entity = entity1;
|
|
||||||
d0 = d1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (entity != null) {
|
if (entity != null) {
|
||||||
movingobjectposition = new MovingObjectPosition(entity);
|
movingobjectposition = new MovingObjectPosition(entity);
|
||||||
}
|
|
||||||
|
|
||||||
if (movingobjectposition != null) {
|
|
||||||
this.a(movingobjectposition);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.locX += this.motX;
|
|
||||||
this.locY += this.motY;
|
|
||||||
this.locZ += this.motZ;
|
|
||||||
float f1 = MathHelper.sqrt(this.motX * this.motX + this.motZ * this.motZ);
|
|
||||||
|
|
||||||
this.yaw = (float) (Math.atan2(this.motX, this.motZ) * 180.0D / 3.1415927410125732D);
|
|
||||||
|
|
||||||
for (this.pitch = (float) (Math.atan2(this.motY, (double) f1) * 180.0D / 3.1415927410125732D); this.pitch - this.lastPitch < -180.0F; this.lastPitch -= 360.0F) {
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (this.pitch - this.lastPitch >= 180.0F) {
|
|
||||||
this.lastPitch += 360.0F;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (this.yaw - this.lastYaw < -180.0F) {
|
|
||||||
this.lastYaw -= 360.0F;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (this.yaw - this.lastYaw >= 180.0F) {
|
|
||||||
this.lastYaw += 360.0F;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.pitch = this.lastPitch + (this.pitch - this.lastPitch) * 0.2F;
|
|
||||||
this.yaw = this.lastYaw + (this.yaw - this.lastYaw) * 0.2F;
|
|
||||||
float f2 = 0.95F;
|
|
||||||
|
|
||||||
if (this.aK()) {
|
|
||||||
for (int k = 0; k < 4; ++k) {
|
|
||||||
float f3 = 0.25F;
|
|
||||||
|
|
||||||
this.world.a("bubble", this.locX - this.motX * (double) f3, this.locY - this.motY * (double) f3, this.locZ - this.motZ * (double) f3, this.motX, this.motY, this.motZ);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
f2 = 0.8F;
|
if (movingobjectposition != null) {
|
||||||
}
|
this.a(movingobjectposition);
|
||||||
|
}
|
||||||
|
|
||||||
this.motX += this.dirX;
|
this.locX += this.motX;
|
||||||
this.motY += this.dirY;
|
this.locY += this.motY;
|
||||||
this.motZ += this.dirZ;
|
this.locZ += this.motZ;
|
||||||
this.motX *= (double) f2;
|
float f1 = MathHelper.sqrt(this.motX * this.motX + this.motZ * this.motZ);
|
||||||
this.motY *= (double) f2;
|
|
||||||
this.motZ *= (double) f2;
|
this.yaw = (float) (Math.atan2(this.motX, this.motZ) * 180.0D / 3.1415927410125732D);
|
||||||
this.world.a("smoke", this.locX, this.locY + 0.5D, this.locZ, 0.0D, 0.0D, 0.0D);
|
|
||||||
this.setPosition(this.locX, this.locY, this.locZ);
|
for (this.pitch = (float) (Math.atan2(this.motY, (double) f1) * 180.0D / 3.1415927410125732D); this.pitch - this.lastPitch < -180.0F; this.lastPitch -= 360.0F) {
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (this.pitch - this.lastPitch >= 180.0F) {
|
||||||
|
this.lastPitch += 360.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (this.yaw - this.lastYaw < -180.0F) {
|
||||||
|
this.lastYaw -= 360.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (this.yaw - this.lastYaw >= 180.0F) {
|
||||||
|
this.lastYaw += 360.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.pitch = this.lastPitch + (this.pitch - this.lastPitch) * 0.2F;
|
||||||
|
this.yaw = this.lastYaw + (this.yaw - this.lastYaw) * 0.2F;
|
||||||
|
float f2 = 0.95F;
|
||||||
|
|
||||||
|
if (this.aT()) {
|
||||||
|
for (int k = 0; k < 4; ++k) {
|
||||||
|
float f3 = 0.25F;
|
||||||
|
|
||||||
|
this.world.a("bubble", this.locX - this.motX * (double) f3, this.locY - this.motY * (double) f3, this.locZ - this.motZ * (double) f3, this.motX, this.motY, this.motZ);
|
||||||
|
}
|
||||||
|
|
||||||
|
f2 = 0.8F;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.motX += this.dirX;
|
||||||
|
this.motY += this.dirY;
|
||||||
|
this.motZ += this.dirZ;
|
||||||
|
this.motX *= (double) f2;
|
||||||
|
this.motY *= (double) f2;
|
||||||
|
this.motZ *= (double) f2;
|
||||||
|
this.world.a("smoke", this.locX, this.locY + 0.5D, this.locZ, 0.0D, 0.0D, 0.0D);
|
||||||
|
this.setPosition(this.locX, this.locY, this.locZ);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void a(MovingObjectPosition movingobjectposition) {
|
protected void a(MovingObjectPosition movingobjectposition) {
|
||||||
@ -221,7 +233,7 @@ public class EntityFireball extends Entity {
|
|||||||
this.i = nbttagcompound.getByte("inGround") == 1;
|
this.i = nbttagcompound.getByte("inGround") == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean e_() {
|
public boolean o_() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -230,9 +242,9 @@ public class EntityFireball extends Entity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||||
this.aM();
|
this.aV();
|
||||||
if (damagesource.getEntity() != null) {
|
if (damagesource.getEntity() != null) {
|
||||||
Vec3D vec3d = damagesource.getEntity().aA();
|
Vec3D vec3d = damagesource.getEntity().aI();
|
||||||
|
|
||||||
if (vec3d != null) {
|
if (vec3d != null) {
|
||||||
this.motX = vec3d.a;
|
this.motX = vec3d.a;
|
||||||
@ -253,7 +265,7 @@ public class EntityFireball extends Entity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public float a(float f) {
|
public float b(float f) {
|
||||||
return 1.0F;
|
return 1.0F;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -74,8 +74,8 @@ public class EntityFishingHook extends Entity {
|
|||||||
this.i = 0;
|
this.i = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void y_() {
|
public void G_() {
|
||||||
super.y_();
|
super.G_();
|
||||||
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;
|
||||||
@ -98,9 +98,9 @@ public class EntityFishingHook 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.Q();
|
ItemStack itemstack = this.owner.T();
|
||||||
|
|
||||||
if (this.owner.dead || !this.owner.isAlive() || itemstack == null || itemstack.getItem() != Item.FISHING_ROD || this.i(this.owner) > 1024.0D) {
|
if (this.owner.dead || !this.owner.isAlive() || itemstack == null || itemstack.getItem() != Item.FISHING_ROD || this.j(this.owner) > 1024.0D) {
|
||||||
this.die();
|
this.die();
|
||||||
this.owner.hookedFish = null;
|
this.owner.hookedFish = null;
|
||||||
return;
|
return;
|
||||||
@ -163,7 +163,7 @@ public class EntityFishingHook 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.e_() && (entity1 != this.owner || this.j >= 5)) {
|
if (entity1.o_() && (entity1 != this.owner || this.j >= 5)) {
|
||||||
float f = 0.3F;
|
float f = 0.3F;
|
||||||
AxisAlignedBB axisalignedbb = entity1.boundingBox.grow((double) f, (double) f, (double) f);
|
AxisAlignedBB axisalignedbb = entity1.boundingBox.grow((double) f, (double) f, (double) f);
|
||||||
MovingObjectPosition movingobjectposition1 = axisalignedbb.a(vec3d, vec3d1);
|
MovingObjectPosition movingobjectposition1 = axisalignedbb.a(vec3d, vec3d1);
|
||||||
@ -242,7 +242,7 @@ public class EntityFishingHook extends Entity {
|
|||||||
} else {
|
} else {
|
||||||
short short1 = 500;
|
short short1 = 500;
|
||||||
|
|
||||||
if (this.world.v(MathHelper.floor(this.locX), MathHelper.floor(this.locY) + 1, MathHelper.floor(this.locZ))) {
|
if (this.world.y(MathHelper.floor(this.locX), MathHelper.floor(this.locY) + 1, MathHelper.floor(this.locZ))) {
|
||||||
short1 = 300;
|
short1 = 300;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -308,7 +308,7 @@ public class EntityFishingHook extends Entity {
|
|||||||
this.h = nbttagcompound.getByte("inGround") == 1;
|
this.h = nbttagcompound.getByte("inGround") == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int j() {
|
public int k() {
|
||||||
byte b0 = 0;
|
byte b0 = 0;
|
||||||
|
|
||||||
if (this.hooked != null) {
|
if (this.hooked != null) {
|
||||||
|
@ -46,19 +46,19 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
|||||||
return 10;
|
return 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void y_() {
|
public void G_() {
|
||||||
super.y_();
|
super.G_();
|
||||||
byte b0 = this.datawatcher.getByte(16);
|
byte b0 = this.datawatcher.getByte(16);
|
||||||
|
|
||||||
this.texture = b0 == 1 ? "/mob/ghast_fire.png" : "/mob/ghast.png";
|
this.texture = b0 == 1 ? "/mob/ghast_fire.png" : "/mob/ghast.png";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void m_() {
|
protected void d_() {
|
||||||
if (!this.world.isStatic && this.world.difficulty == 0) {
|
if (!this.world.isStatic && this.world.difficulty == 0) {
|
||||||
this.die();
|
this.die();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.au();
|
this.aF();
|
||||||
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;
|
||||||
@ -122,13 +122,13 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
|||||||
|
|
||||||
double d4 = 64.0D;
|
double d4 = 64.0D;
|
||||||
|
|
||||||
if (this.target != null && this.target.i(this) < d4 * d4) {
|
if (this.target != null && this.target.j(this) < d4 * d4) {
|
||||||
double d5 = this.target.locX - this.locX;
|
double d5 = this.target.locX - this.locX;
|
||||||
double d6 = this.target.boundingBox.b + (double) (this.target.length / 2.0F) - (this.locY + (double) (this.length / 2.0F));
|
double d6 = this.target.boundingBox.b + (double) (this.target.length / 2.0F) - (this.locY + (double) (this.length / 2.0F));
|
||||||
double d7 = this.target.locZ - this.locZ;
|
double d7 = this.target.locZ - this.locZ;
|
||||||
|
|
||||||
this.V = this.yaw = -((float) Math.atan2(d5, d7)) * 180.0F / 3.1415927F;
|
this.V = this.yaw = -((float) Math.atan2(d5, d7)) * 180.0F / 3.1415927F;
|
||||||
if (this.g(this.target)) {
|
if (this.h(this.target)) {
|
||||||
if (this.f == 10) {
|
if (this.f == 10) {
|
||||||
this.world.a((EntityHuman) null, 1007, (int) this.locX, (int) this.locY, (int) this.locZ, 0);
|
this.world.a((EntityHuman) null, 1007, (int) this.locX, (int) this.locY, (int) this.locZ, 0);
|
||||||
}
|
}
|
||||||
@ -138,7 +138,7 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
|||||||
this.world.a((EntityHuman) null, 1008, (int) this.locX, (int) this.locY, (int) this.locZ, 0);
|
this.world.a((EntityHuman) null, 1008, (int) this.locX, (int) this.locY, (int) this.locZ, 0);
|
||||||
EntityFireball entityfireball = new EntityFireball(this.world, this, d5, d6, d7);
|
EntityFireball entityfireball = new EntityFireball(this.world, this, d5, d6, d7);
|
||||||
double d8 = 4.0D;
|
double d8 = 4.0D;
|
||||||
Vec3D vec3d = this.e(1.0F);
|
Vec3D vec3d = this.f(1.0F);
|
||||||
|
|
||||||
entityfireball.locX = this.locX + vec3d.a * d8;
|
entityfireball.locX = this.locX + vec3d.a * d8;
|
||||||
entityfireball.locY = this.locY + (double) (this.length / 2.0F) + 0.5D;
|
entityfireball.locY = this.locY + (double) (this.length / 2.0F) + 0.5D;
|
||||||
@ -182,15 +182,15 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String c_() {
|
protected String i() {
|
||||||
return "mob.ghast.moan";
|
return "mob.ghast.moan";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String m() {
|
protected String j() {
|
||||||
return "mob.ghast.scream";
|
return "mob.ghast.scream";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String n() {
|
protected String k() {
|
||||||
return "mob.ghast.death";
|
return "mob.ghast.death";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -219,7 +219,7 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
|||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
}
|
}
|
||||||
|
|
||||||
protected float o() {
|
protected float p() {
|
||||||
return 10.0F;
|
return 10.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -227,7 +227,7 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
|||||||
return this.random.nextInt(20) == 0 && super.canSpawn() && this.world.difficulty > 0;
|
return this.random.nextInt(20) == 0 && super.canSpawn() && this.world.difficulty > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int p() {
|
public int q() {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -96,43 +96,43 @@ public abstract class EntityHuman extends EntityLiving {
|
|||||||
this.datawatcher.a(17, Byte.valueOf((byte) 0));
|
this.datawatcher.a(17, Byte.valueOf((byte) 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean I() {
|
public boolean L() {
|
||||||
return this.d != null;
|
return this.d != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void J() {
|
public void M() {
|
||||||
if (this.d != null) {
|
if (this.d != null) {
|
||||||
this.d.a(this.world, this, this.e);
|
this.d.b(this.world, this, this.e);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.K();
|
this.N();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void K() {
|
public void N() {
|
||||||
this.d = null;
|
this.d = null;
|
||||||
this.e = 0;
|
this.e = 0;
|
||||||
if (!this.world.isStatic) {
|
if (!this.world.isStatic) {
|
||||||
this.h(false);
|
this.i(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean L() {
|
public boolean O() {
|
||||||
return this.I() && Item.byId[this.d.id].d(this.d) == EnumAnimation.d;
|
return this.L() && Item.byId[this.d.id].d(this.d) == EnumAnimation.d;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void y_() {
|
public void G_() {
|
||||||
if (this.d != null) {
|
if (this.d != null) {
|
||||||
ItemStack itemstack = this.inventory.getItemInHand();
|
ItemStack itemstack = this.inventory.getItemInHand();
|
||||||
|
|
||||||
if (itemstack != this.d) {
|
if (itemstack != this.d) {
|
||||||
this.K();
|
this.N();
|
||||||
} else {
|
} else {
|
||||||
if (this.e <= 25 && this.e % 4 == 0) {
|
if (this.e <= 25 && this.e % 4 == 0) {
|
||||||
this.b(itemstack, 5);
|
this.b(itemstack, 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (--this.e == 0 && !this.world.isStatic) {
|
if (--this.e == 0 && !this.world.isStatic) {
|
||||||
this.H();
|
this.K();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -148,7 +148,7 @@ public abstract class EntityHuman extends EntityLiving {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!this.world.isStatic) {
|
if (!this.world.isStatic) {
|
||||||
if (!this.B()) {
|
if (!this.G()) {
|
||||||
this.a(true, true, false);
|
this.a(true, true, false);
|
||||||
} else if (this.world.e()) {
|
} else if (this.world.e()) {
|
||||||
this.a(false, true, true);
|
this.a(false, true, true);
|
||||||
@ -161,7 +161,7 @@ public abstract class EntityHuman extends EntityLiving {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
super.y_();
|
super.G_();
|
||||||
if (!this.world.isStatic && this.activeContainer != null && !this.activeContainer.b(this)) {
|
if (!this.world.isStatic && this.activeContainer != null && !this.activeContainer.b(this)) {
|
||||||
this.closeInventory();
|
this.closeInventory();
|
||||||
this.activeContainer = this.defaultContainer;
|
this.activeContainer = this.defaultContainer;
|
||||||
@ -245,7 +245,7 @@ public abstract class EntityHuman extends EntityLiving {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void H() {
|
protected void K() {
|
||||||
if (this.d != null) {
|
if (this.d != null) {
|
||||||
this.b(this.d, 16);
|
this.b(this.d, 16);
|
||||||
int i = this.d.count;
|
int i = this.d.count;
|
||||||
@ -258,11 +258,11 @@ public abstract class EntityHuman extends EntityLiving {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.K();
|
this.N();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean M() {
|
protected boolean P() {
|
||||||
return this.getHealth() <= 0 || this.isSleeping();
|
return this.getHealth() <= 0 || this.isSleeping();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -271,23 +271,23 @@ public abstract class EntityHuman extends EntityLiving {
|
|||||||
this.activeContainer = this.defaultContainer;
|
this.activeContainer = this.defaultContainer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void N() {
|
public void Q() {
|
||||||
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.N();
|
super.Q();
|
||||||
this.r = this.s;
|
this.r = this.s;
|
||||||
this.s = 0.0F;
|
this.s = 0.0F;
|
||||||
this.h(this.locX - d0, this.locY - d1, this.locZ - d2);
|
this.h(this.locX - d0, this.locY - d1, this.locZ - d2);
|
||||||
}
|
}
|
||||||
|
|
||||||
private int v() {
|
private int E() {
|
||||||
return this.hasEffect(MobEffectList.FASTER_DIG) ? 6 - (1 + this.getEffect(MobEffectList.FASTER_DIG).getAmplifier()) * 1 : (this.hasEffect(MobEffectList.SLOWER_DIG) ? 6 + (1 + this.getEffect(MobEffectList.SLOWER_DIG).getAmplifier()) * 2 : 6);
|
return this.hasEffect(MobEffectList.FASTER_DIG) ? 6 - (1 + this.getEffect(MobEffectList.FASTER_DIG).getAmplifier()) * 1 : (this.hasEffect(MobEffectList.SLOWER_DIG) ? 6 + (1 + this.getEffect(MobEffectList.SLOWER_DIG).getAmplifier()) * 2 : 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void m_() {
|
protected void d_() {
|
||||||
int i = this.v();
|
int i = this.E();
|
||||||
|
|
||||||
if (this.t) {
|
if (this.t) {
|
||||||
++this.u;
|
++this.u;
|
||||||
@ -302,7 +302,7 @@ public abstract class EntityHuman extends EntityLiving {
|
|||||||
this.ao = (float) this.u / (float) i;
|
this.ao = (float) this.u / (float) i;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void d() {
|
public void e() {
|
||||||
if (this.o > 0) {
|
if (this.o > 0) {
|
||||||
--this.o;
|
--this.o;
|
||||||
}
|
}
|
||||||
@ -314,7 +314,7 @@ public abstract class EntityHuman extends EntityLiving {
|
|||||||
|
|
||||||
this.inventory.i();
|
this.inventory.i();
|
||||||
this.r = this.s;
|
this.r = this.s;
|
||||||
super.d();
|
super.e();
|
||||||
this.al = this.P;
|
this.al = this.P;
|
||||||
this.am = this.Q;
|
this.am = this.Q;
|
||||||
if (this.isSprinting()) {
|
if (this.isSprinting()) {
|
||||||
@ -348,14 +348,14 @@ public abstract class EntityHuman extends EntityLiving {
|
|||||||
Entity entity = (Entity) list.get(i);
|
Entity entity = (Entity) list.get(i);
|
||||||
|
|
||||||
if (!entity.dead) {
|
if (!entity.dead) {
|
||||||
this.k(entity);
|
this.l(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void k(Entity entity) {
|
private void l(Entity entity) {
|
||||||
entity.a_(this);
|
entity.a_(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -389,22 +389,24 @@ public abstract class EntityHuman extends EntityLiving {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected int f(int i) {
|
protected int b_(int i) {
|
||||||
int j = EnchantmentManager.getOxygenEnchantmentLevel(this.inventory);
|
int j = EnchantmentManager.getOxygenEnchantmentLevel(this.inventory);
|
||||||
|
|
||||||
return j > 0 && this.random.nextInt(j + 1) > 0 ? i : super.f(i);
|
return j > 0 && this.random.nextInt(j + 1) > 0 ? i : super.b_(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void O() {
|
public EntityItem R() {
|
||||||
this.a(this.inventory.splitStack(this.inventory.itemInHandIndex, 1), false);
|
return this.a(this.inventory.splitStack(this.inventory.itemInHandIndex, 1), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void drop(ItemStack itemstack) {
|
public EntityItem drop(ItemStack itemstack) {
|
||||||
this.a(itemstack, false);
|
return this.a(itemstack, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void a(ItemStack itemstack, boolean flag) {
|
public EntityItem a(ItemStack itemstack, boolean flag) {
|
||||||
if (itemstack != null) {
|
if (itemstack == null) {
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
EntityItem entityitem = new EntityItem(this.world, this.locX, this.locY - 0.30000001192092896D + (double) this.getHeadHeight(), this.locZ, itemstack);
|
EntityItem entityitem = new EntityItem(this.world, this.locX, this.locY - 0.30000001192092896D + (double) this.getHeadHeight(), this.locZ, itemstack);
|
||||||
|
|
||||||
entityitem.pickupDelay = 40;
|
entityitem.pickupDelay = 40;
|
||||||
@ -440,12 +442,13 @@ public abstract class EntityHuman extends EntityLiving {
|
|||||||
|
|
||||||
if (event.isCancelled()) {
|
if (event.isCancelled()) {
|
||||||
player.getInventory().addItem(drop.getItemStack());
|
player.getInventory().addItem(drop.getItemStack());
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
this.a(entityitem);
|
this.a(entityitem);
|
||||||
this.a(StatisticList.v, 1);
|
this.a(StatisticList.v, 1);
|
||||||
|
return entityitem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -548,7 +551,7 @@ public abstract class EntityHuman extends EntityLiving {
|
|||||||
return 0.12F;
|
return 0.12F;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void r_() {
|
protected void A() {
|
||||||
this.height = 1.62F;
|
this.height = 1.62F;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -645,7 +648,7 @@ public abstract class EntityHuman extends EntityLiving {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean z() {
|
protected boolean C_() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -659,7 +662,7 @@ public abstract class EntityHuman extends EntityLiving {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(entityliving instanceof EntityHuman) || this.z()) {
|
if (!(entityliving instanceof EntityHuman) || this.C_()) {
|
||||||
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).grow(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).grow(16.0D, 4.0D, 16.0D));
|
||||||
Iterator iterator = list.iterator();
|
Iterator iterator = list.iterator();
|
||||||
|
|
||||||
@ -667,7 +670,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.F() == null && this.name.equals(entitywolf1.getOwnerName()) && (!flag || !entitywolf1.isSitting())) {
|
if (entitywolf1.isTamed() && entitywolf1.H() == 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();
|
||||||
|
|
||||||
@ -692,16 +695,16 @@ public abstract class EntityHuman extends EntityLiving {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void g(int i) {
|
protected void f(int i) {
|
||||||
this.inventory.d(i);
|
this.inventory.e(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int P() {
|
public int S() {
|
||||||
return this.inventory.j();
|
return this.inventory.j();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void c(DamageSource damagesource, int i) {
|
protected void c(DamageSource damagesource, int i) {
|
||||||
if (!damagesource.ignoresArmor() && this.L()) {
|
if (!damagesource.ignoresArmor() && this.O()) {
|
||||||
i = 1 + i >> 1;
|
i = 1 + i >> 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -721,146 +724,150 @@ public abstract class EntityHuman extends EntityLiving {
|
|||||||
|
|
||||||
public void e(Entity entity) {
|
public void e(Entity entity) {
|
||||||
if (!entity.b(this)) {
|
if (!entity.b(this)) {
|
||||||
ItemStack itemstack = this.Q();
|
ItemStack itemstack = this.T();
|
||||||
|
|
||||||
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.R();
|
this.U();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack Q() {
|
public ItemStack T() {
|
||||||
return this.inventory.getItemInHand();
|
return this.inventory.getItemInHand();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void R() {
|
public void U() {
|
||||||
this.inventory.setItem(this.inventory.itemInHandIndex, (ItemStack) null);
|
this.inventory.setItem(this.inventory.itemInHandIndex, (ItemStack) null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public double S() {
|
public double V() {
|
||||||
return (double) (this.height - 0.5F);
|
return (double) (this.height - 0.5F);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void s_() {
|
public void D() {
|
||||||
if (!this.t || this.u >= this.v() / 2 || this.u < 0) {
|
if (!this.t || this.u >= this.E() / 2 || this.u < 0) {
|
||||||
this.u = -1;
|
this.u = -1;
|
||||||
this.t = true;
|
this.t = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void attack(Entity entity) {
|
public void attack(Entity entity) {
|
||||||
int i = this.inventory.a(entity);
|
if (entity.k_()) {
|
||||||
|
int i = this.inventory.a(entity);
|
||||||
|
|
||||||
if (this.hasEffect(MobEffectList.INCREASE_DAMAGE)) {
|
if (this.hasEffect(MobEffectList.INCREASE_DAMAGE)) {
|
||||||
i += 3 << this.getEffect(MobEffectList.INCREASE_DAMAGE).getAmplifier();
|
i += 3 << this.getEffect(MobEffectList.INCREASE_DAMAGE).getAmplifier();
|
||||||
}
|
|
||||||
|
|
||||||
if (this.hasEffect(MobEffectList.WEAKNESS)) {
|
|
||||||
i -= 2 << this.getEffect(MobEffectList.WEAKNESS).getAmplifier();
|
|
||||||
}
|
|
||||||
|
|
||||||
int j = 0;
|
|
||||||
int k = 0;
|
|
||||||
|
|
||||||
if (entity instanceof EntityLiving) {
|
|
||||||
k = EnchantmentManager.a(this.inventory, (EntityLiving) entity);
|
|
||||||
j += EnchantmentManager.getKnockbackEnchantmentLevel(this.inventory, (EntityLiving) entity);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.isSprinting()) {
|
|
||||||
++j;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (i > 0 || k > 0) {
|
|
||||||
boolean flag = this.fallDistance > 0.0F && !this.onGround && !this.r() && !this.aK() && !this.hasEffect(MobEffectList.BLINDNESS) && this.vehicle == null && entity instanceof EntityLiving;
|
|
||||||
|
|
||||||
if (flag) {
|
|
||||||
i += this.random.nextInt(i / 2 + 2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// CraftBukkit start - Don't call the event when the entity is human since it will be called with damageEntity
|
if (this.hasEffect(MobEffectList.WEAKNESS)) {
|
||||||
if ((entity instanceof EntityLiving || entity instanceof EntityComplexPart || entity instanceof EntityEnderCrystal) && !(entity instanceof EntityHuman)) {
|
i -= 2 << this.getEffect(MobEffectList.WEAKNESS).getAmplifier();
|
||||||
org.bukkit.entity.Entity damager = this.getBukkitEntity();
|
|
||||||
org.bukkit.entity.Entity damagee = (entity == null) ? null : entity.getBukkitEntity();
|
|
||||||
|
|
||||||
EntityDamageByEntityEvent event = new EntityDamageByEntityEvent(damager, damagee, EntityDamageEvent.DamageCause.ENTITY_ATTACK, i);
|
|
||||||
Bukkit.getPluginManager().callEvent(event);
|
|
||||||
|
|
||||||
if (event.isCancelled() || event.getDamage() == 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
i = event.getDamage();
|
|
||||||
}
|
|
||||||
// CraftBukkit end
|
|
||||||
|
|
||||||
i += k;
|
|
||||||
boolean flag1 = entity.damageEntity(DamageSource.playerAttack(this), i);
|
|
||||||
|
|
||||||
// CraftBukkit start - Return when the damage fails so that the item will not lose durability
|
|
||||||
if (!flag1) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// CraftBukkit end
|
|
||||||
|
|
||||||
if (flag1) {
|
|
||||||
if (j > 0) {
|
|
||||||
entity.b_((double) (-MathHelper.sin(this.yaw * 3.1415927F / 180.0F) * (float) j * 0.5F), 0.1D, (double) (MathHelper.cos(this.yaw * 3.1415927F / 180.0F) * (float) j * 0.5F));
|
|
||||||
this.motX *= 0.6D;
|
|
||||||
this.motZ *= 0.6D;
|
|
||||||
this.setSprinting(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (flag) {
|
|
||||||
this.c(entity);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (k > 0) {
|
|
||||||
this.d(entity);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (i >= 18) {
|
|
||||||
this.a((Statistic) AchievementList.E);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemStack itemstack = this.Q();
|
int j = 0;
|
||||||
|
int k = 0;
|
||||||
if (itemstack != null && entity instanceof EntityLiving) {
|
|
||||||
itemstack.a((EntityLiving) entity, this);
|
|
||||||
// CraftBukkit - bypass infinite items; <= 0 -> == 0
|
|
||||||
if (itemstack.count == 0) {
|
|
||||||
itemstack.a(this);
|
|
||||||
this.R();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (entity instanceof EntityLiving) {
|
if (entity instanceof EntityLiving) {
|
||||||
if (entity.isAlive()) {
|
k = EnchantmentManager.a(this.inventory, (EntityLiving) entity);
|
||||||
this.a((EntityLiving) entity, true);
|
j += EnchantmentManager.getKnockbackEnchantmentLevel(this.inventory, (EntityLiving) entity);
|
||||||
}
|
|
||||||
|
|
||||||
this.a(StatisticList.w, i);
|
|
||||||
int l = EnchantmentManager.getFireAspectEnchantmentLevel(this.inventory, (EntityLiving) entity);
|
|
||||||
|
|
||||||
if (l > 0) {
|
|
||||||
// CraftBukkit start - raise a combust event when somebody hits with a fire enchanted item
|
|
||||||
EntityCombustByEntityEvent combustEvent = new EntityCombustByEntityEvent(this.getBukkitEntity(), entity.getBukkitEntity(), l * 4);
|
|
||||||
Bukkit.getPluginManager().callEvent(combustEvent);
|
|
||||||
|
|
||||||
if (!combustEvent.isCancelled()) {
|
|
||||||
entity.setOnFire(combustEvent.getDuration());
|
|
||||||
}
|
|
||||||
// CraftBukkit end
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.c(0.3F);
|
if (this.isSprinting()) {
|
||||||
|
++j;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i > 0 || k > 0) {
|
||||||
|
boolean flag = this.fallDistance > 0.0F && !this.onGround && !this.t() && !this.aT() && !this.hasEffect(MobEffectList.BLINDNESS) && this.vehicle == null && entity instanceof EntityLiving;
|
||||||
|
|
||||||
|
if (flag) {
|
||||||
|
i += this.random.nextInt(i / 2 + 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
// CraftBukkit start - Don't call the event when the entity is human since it will be called with damageEntity
|
||||||
|
if ((entity instanceof EntityLiving || entity instanceof EntityComplexPart || entity instanceof EntityEnderCrystal) && !(entity instanceof EntityHuman)) {
|
||||||
|
org.bukkit.entity.Entity damager = this.getBukkitEntity();
|
||||||
|
org.bukkit.entity.Entity damagee = (entity == null) ? null : entity.getBukkitEntity();
|
||||||
|
|
||||||
|
EntityDamageByEntityEvent event = new EntityDamageByEntityEvent(damager, damagee, EntityDamageEvent.DamageCause.ENTITY_ATTACK, i);
|
||||||
|
Bukkit.getPluginManager().callEvent(event);
|
||||||
|
|
||||||
|
if (event.isCancelled() || event.getDamage() == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
i = event.getDamage();
|
||||||
|
}
|
||||||
|
// CraftBukkit end
|
||||||
|
|
||||||
|
i += k;
|
||||||
|
boolean flag1 = entity.damageEntity(DamageSource.playerAttack(this), i);
|
||||||
|
|
||||||
|
// CraftBukkit start - Return when the damage fails so that the item will not lose durability
|
||||||
|
if (!flag1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// CraftBukkit end
|
||||||
|
|
||||||
|
if (flag1) {
|
||||||
|
if (j > 0) {
|
||||||
|
entity.b_((double) (-MathHelper.sin(this.yaw * 3.1415927F / 180.0F) * (float) j * 0.5F), 0.1D, (double) (MathHelper.cos(this.yaw * 3.1415927F / 180.0F) * (float) j * 0.5F));
|
||||||
|
this.motX *= 0.6D;
|
||||||
|
this.motZ *= 0.6D;
|
||||||
|
this.setSprinting(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flag) {
|
||||||
|
this.c(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (k > 0) {
|
||||||
|
this.d(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i >= 18) {
|
||||||
|
this.a((Statistic) AchievementList.E);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.g(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
ItemStack itemstack = this.T();
|
||||||
|
|
||||||
|
if (itemstack != null && entity instanceof EntityLiving) {
|
||||||
|
itemstack.a((EntityLiving) entity, this);
|
||||||
|
// CraftBukkit - bypass infinite items; <= 0 -> == 0
|
||||||
|
if (itemstack.count == 0) {
|
||||||
|
itemstack.a(this);
|
||||||
|
this.U();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (entity instanceof EntityLiving) {
|
||||||
|
if (entity.isAlive()) {
|
||||||
|
this.a((EntityLiving) entity, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.a(StatisticList.w, i);
|
||||||
|
int l = EnchantmentManager.getFireAspectEnchantmentLevel(this.inventory, (EntityLiving) entity);
|
||||||
|
|
||||||
|
if (l > 0) {
|
||||||
|
// CraftBukkit start - raise a combust event when somebody hits with a fire enchanted item
|
||||||
|
EntityCombustByEntityEvent combustEvent = new EntityCombustByEntityEvent(this.getBukkitEntity(), entity.getBukkitEntity(), l * 4);
|
||||||
|
Bukkit.getPluginManager().callEvent(combustEvent);
|
||||||
|
|
||||||
|
if (!combustEvent.isCancelled()) {
|
||||||
|
entity.setOnFire(combustEvent.getDuration());
|
||||||
|
}
|
||||||
|
// CraftBukkit end
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.c(0.3F);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -888,7 +895,7 @@ public abstract class EntityHuman extends EntityLiving {
|
|||||||
return EnumBedResult.OTHER_PROBLEM;
|
return EnumBedResult.OTHER_PROBLEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.world.worldProvider.d) {
|
if (!this.world.worldProvider.d()) {
|
||||||
return EnumBedResult.NOT_POSSIBLE_HERE;
|
return EnumBedResult.NOT_POSSIBLE_HERE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -927,7 +934,7 @@ public abstract class EntityHuman extends EntityLiving {
|
|||||||
this.height = 0.2F;
|
this.height = 0.2F;
|
||||||
if (this.world.isLoaded(i, j, k)) {
|
if (this.world.isLoaded(i, j, k)) {
|
||||||
int l = this.world.getData(i, j, k);
|
int l = this.world.getData(i, j, k);
|
||||||
int i1 = BlockBed.d(l);
|
int i1 = BlockBed.b(l);
|
||||||
float f = 0.5F;
|
float f = 0.5F;
|
||||||
float f1 = 0.5F;
|
float f1 = 0.5F;
|
||||||
|
|
||||||
@ -990,7 +997,7 @@ public abstract class EntityHuman extends EntityLiving {
|
|||||||
if (this.fauxSleeping && !this.sleeping) return; // CraftBukkit - Can't leave bed if not in one!
|
if (this.fauxSleeping && !this.sleeping) return; // CraftBukkit - Can't leave bed if not in one!
|
||||||
|
|
||||||
this.b(0.6F, 1.8F);
|
this.b(0.6F, 1.8F);
|
||||||
this.r_();
|
this.A();
|
||||||
ChunkCoordinates chunkcoordinates = this.F;
|
ChunkCoordinates chunkcoordinates = this.F;
|
||||||
ChunkCoordinates chunkcoordinates1 = this.F;
|
ChunkCoordinates chunkcoordinates1 = this.F;
|
||||||
|
|
||||||
@ -1036,12 +1043,12 @@ public abstract class EntityHuman extends EntityLiving {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean B() {
|
private boolean G() {
|
||||||
return this.world.getTypeId(this.F.x, this.F.y, this.F.z) == Block.BED.id;
|
return this.world.getTypeId(this.F.x, this.F.y, this.F.z) == Block.BED.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ChunkCoordinates getBed(World world, ChunkCoordinates chunkcoordinates) {
|
public static ChunkCoordinates getBed(World world, ChunkCoordinates chunkcoordinates) {
|
||||||
IChunkProvider ichunkprovider = world.p();
|
IChunkProvider ichunkprovider = world.q();
|
||||||
|
|
||||||
ichunkprovider.getChunkAt(chunkcoordinates.x - 3 >> 4, chunkcoordinates.z - 3 >> 4);
|
ichunkprovider.getChunkAt(chunkcoordinates.x - 3 >> 4, chunkcoordinates.z - 3 >> 4);
|
||||||
ichunkprovider.getChunkAt(chunkcoordinates.x + 3 >> 4, chunkcoordinates.z - 3 >> 4);
|
ichunkprovider.getChunkAt(chunkcoordinates.x + 3 >> 4, chunkcoordinates.z - 3 >> 4);
|
||||||
@ -1085,8 +1092,8 @@ public abstract class EntityHuman extends EntityLiving {
|
|||||||
|
|
||||||
public void a(Statistic statistic, int i) {}
|
public void a(Statistic statistic, int i) {}
|
||||||
|
|
||||||
protected void o_() {
|
protected void ab() {
|
||||||
super.o_();
|
super.ab();
|
||||||
this.a(StatisticList.u, 1);
|
this.a(StatisticList.u, 1);
|
||||||
if (this.isSprinting()) {
|
if (this.isSprinting()) {
|
||||||
this.c(0.8F);
|
this.c(0.8F);
|
||||||
@ -1125,13 +1132,13 @@ public abstract class EntityHuman extends EntityLiving {
|
|||||||
this.a(StatisticList.q, i);
|
this.a(StatisticList.q, i);
|
||||||
this.c(0.015F * (float) i * 0.01F);
|
this.c(0.015F * (float) i * 0.01F);
|
||||||
}
|
}
|
||||||
} else if (this.aK()) {
|
} else if (this.aT()) {
|
||||||
i = Math.round(MathHelper.sqrt(d0 * d0 + d2 * d2) * 100.0F);
|
i = Math.round(MathHelper.sqrt(d0 * d0 + d2 * d2) * 100.0F);
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
this.a(StatisticList.m, i);
|
this.a(StatisticList.m, i);
|
||||||
this.c(0.015F * (float) i * 0.01F);
|
this.c(0.015F * (float) i * 0.01F);
|
||||||
}
|
}
|
||||||
} else if (this.r()) {
|
} else if (this.t()) {
|
||||||
if (d1 > 0.0D) {
|
if (d1 > 0.0D) {
|
||||||
this.a(StatisticList.o, (int) Math.round(d1 * 100.0D));
|
this.a(StatisticList.o, (int) Math.round(d1 * 100.0D));
|
||||||
}
|
}
|
||||||
@ -1163,7 +1170,7 @@ public abstract class EntityHuman extends EntityLiving {
|
|||||||
this.a(StatisticList.r, i);
|
this.a(StatisticList.r, i);
|
||||||
if (this.c == null) {
|
if (this.c == null) {
|
||||||
this.c = new ChunkCoordinates(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ));
|
this.c = new ChunkCoordinates(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ));
|
||||||
} else if (this.c.a(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ)) >= 1000.0D) {
|
} else if (this.c.b(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ)) >= 1000.0D) {
|
||||||
this.a((Statistic) AchievementList.q, 1);
|
this.a((Statistic) AchievementList.q, 1);
|
||||||
}
|
}
|
||||||
} else if (this.vehicle instanceof EntityBoat) {
|
} else if (this.vehicle instanceof EntityBoat) {
|
||||||
@ -1175,23 +1182,23 @@ public abstract class EntityHuman extends EntityLiving {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void b(float f) {
|
protected void a(float f) {
|
||||||
if (!this.abilities.canFly) {
|
if (!this.abilities.canFly) {
|
||||||
if (f >= 2.0F) {
|
if (f >= 2.0F) {
|
||||||
this.a(StatisticList.n, (int) Math.round((double) f * 100.0D));
|
this.a(StatisticList.n, (int) Math.round((double) f * 100.0D));
|
||||||
}
|
}
|
||||||
|
|
||||||
super.b(f);
|
super.a(f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void a(EntityLiving entityliving) {
|
public void c(EntityLiving entityliving) {
|
||||||
if (entityliving instanceof EntityMonster) {
|
if (entityliving instanceof EntityMonster) {
|
||||||
this.a((Statistic) AchievementList.s);
|
this.a((Statistic) AchievementList.s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Y() {
|
public void ac() {
|
||||||
if (this.I > 0) {
|
if (this.I > 0) {
|
||||||
this.I = 10;
|
this.I = 10;
|
||||||
} else {
|
} else {
|
||||||
@ -1246,7 +1253,7 @@ public abstract class EntityHuman extends EntityLiving {
|
|||||||
return (flag || this.foodData.b()) && !this.abilities.isInvulnerable;
|
return (flag || this.foodData.b()) && !this.abilities.isInvulnerable;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean ab() {
|
public boolean af() {
|
||||||
return this.getHealth() > 0 && this.getHealth() < this.getMaxHealth();
|
return this.getHealth() > 0 && this.getHealth() < this.getMaxHealth();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1255,7 +1262,7 @@ public abstract class EntityHuman extends EntityLiving {
|
|||||||
this.d = itemstack;
|
this.d = itemstack;
|
||||||
this.e = i;
|
this.e = i;
|
||||||
if (!this.world.isStatic) {
|
if (!this.world.isStatic) {
|
||||||
this.h(true);
|
this.i(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1289,4 +1296,8 @@ public abstract class EntityHuman extends EntityLiving {
|
|||||||
this.exp = entityhuman.exp;
|
this.exp = entityhuman.exp;
|
||||||
this.q = entityhuman.q;
|
this.q = entityhuman.q;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected boolean g_() {
|
||||||
|
return !this.abilities.isFlying;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,10 +8,9 @@ import org.bukkit.event.player.PlayerPickupItemEvent;
|
|||||||
public class EntityItem extends Entity {
|
public class EntityItem extends Entity {
|
||||||
|
|
||||||
public ItemStack itemStack;
|
public ItemStack itemStack;
|
||||||
private int e;
|
|
||||||
public int age = 0;
|
public int age = 0;
|
||||||
public int pickupDelay;
|
public int pickupDelay;
|
||||||
private int f = 5;
|
private int e = 5;
|
||||||
public float d = (float) (Math.random() * 3.141592653589793D * 2.0D);
|
public float d = (float) (Math.random() * 3.141592653589793D * 2.0D);
|
||||||
private int lastTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit
|
private int lastTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit
|
||||||
|
|
||||||
@ -47,8 +46,8 @@ public class EntityItem extends Entity {
|
|||||||
|
|
||||||
protected void b() {}
|
protected void b() {}
|
||||||
|
|
||||||
public void y_() {
|
public void G_() {
|
||||||
super.y_();
|
super.G_();
|
||||||
// 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);
|
||||||
@ -86,7 +85,6 @@ public class EntityItem extends Entity {
|
|||||||
this.motY *= -0.5D;
|
this.motY *= -0.5D;
|
||||||
}
|
}
|
||||||
|
|
||||||
++this.e;
|
|
||||||
++this.age;
|
++this.age;
|
||||||
if (this.age >= 6000) {
|
if (this.age >= 6000) {
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
@ -99,7 +97,11 @@ public class EntityItem extends Entity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean i_() {
|
public void k() {
|
||||||
|
this.age = 4800;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean h_() {
|
||||||
return this.world.a(this.boundingBox, Material.WATER, this);
|
return this.world.a(this.boundingBox, Material.WATER, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -108,9 +110,9 @@ public class EntityItem extends Entity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||||
this.aM();
|
this.aV();
|
||||||
this.f -= i;
|
this.e -= i;
|
||||||
if (this.f <= 0) {
|
if (this.e <= 0) {
|
||||||
this.die();
|
this.die();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -118,14 +120,14 @@ public class EntityItem extends Entity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void b(NBTTagCompound nbttagcompound) {
|
public void b(NBTTagCompound nbttagcompound) {
|
||||||
nbttagcompound.setShort("Health", (short) ((byte) this.f));
|
nbttagcompound.setShort("Health", (short) ((byte) this.e));
|
||||||
nbttagcompound.setShort("Age", (short) this.age);
|
nbttagcompound.setShort("Age", (short) this.age);
|
||||||
if (this.itemStack != null) // CraftBukkit - Nullchex!
|
if (this.itemStack != null) // CraftBukkit - Nullchex!
|
||||||
nbttagcompound.setCompound("Item", this.itemStack.save(new NBTTagCompound()));
|
nbttagcompound.setCompound("Item", this.itemStack.save(new NBTTagCompound()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void a(NBTTagCompound nbttagcompound) {
|
public void a(NBTTagCompound nbttagcompound) {
|
||||||
this.f = nbttagcompound.getShort("Health") & 255;
|
this.e = nbttagcompound.getShort("Health") & 255;
|
||||||
this.age = nbttagcompound.getShort("Age");
|
this.age = nbttagcompound.getShort("Age");
|
||||||
NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("Item");
|
NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("Item");
|
||||||
|
|
||||||
@ -187,4 +189,8 @@ public class EntityItem extends Entity {
|
|||||||
if (this.itemStack == null) return LocaleI18n.get("item.unknown"); // CraftBukkit - nullcheck
|
if (this.itemStack == null) return LocaleI18n.get("item.unknown"); // CraftBukkit - nullcheck
|
||||||
return LocaleI18n.get("item." + this.itemStack.k());
|
return LocaleI18n.get("item." + this.itemStack.k());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean k_() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -60,17 +60,26 @@ public abstract class EntityLiving extends Entity {
|
|||||||
public float aF;
|
public float aF;
|
||||||
public EntityHuman killer = null; // CraftBukkit - prot to pub
|
public EntityHuman killer = null; // CraftBukkit - prot to pub
|
||||||
protected int lastDamageByPlayerTime = 0;
|
protected int lastDamageByPlayerTime = 0;
|
||||||
protected EntityLiving lastDamager = null;
|
public EntityLiving lastDamager = null; // CraftBukkit - priv to pub
|
||||||
|
private int c = 0;
|
||||||
|
private EntityLiving d = null;
|
||||||
|
public int aI = 0;
|
||||||
public int aJ = 0;
|
public int aJ = 0;
|
||||||
public int aK = 0;
|
|
||||||
public HashMap effects = new HashMap(); // CraftBukkit - protected -> public
|
public HashMap effects = new HashMap(); // CraftBukkit - protected -> public
|
||||||
private boolean b = true;
|
private boolean e = true;
|
||||||
private int c;
|
private int f;
|
||||||
private ControllerLook lookController;
|
private ControllerLook lookController;
|
||||||
private ControllerMove moveController;
|
private ControllerMove moveController;
|
||||||
private ControllerJump jumpController;
|
private ControllerJump jumpController;
|
||||||
|
private EntityAIBodyControl senses;
|
||||||
private Navigation navigation;
|
private Navigation navigation;
|
||||||
protected PathfinderGoalSelector goalSelector = new PathfinderGoalSelector();
|
protected PathfinderGoalSelector goalSelector = new PathfinderGoalSelector();
|
||||||
|
protected PathfinderGoalSelector targetSelector = new PathfinderGoalSelector();
|
||||||
|
private EntityLiving l;
|
||||||
|
private EntitySenses m;
|
||||||
|
private float n;
|
||||||
|
private ChunkCoordinates o = new ChunkCoordinates(0, 0, 0);
|
||||||
|
private float p = -1.0F;
|
||||||
protected int aN;
|
protected int aN;
|
||||||
protected double aO;
|
protected double aO;
|
||||||
protected double aP;
|
protected double aP;
|
||||||
@ -86,8 +95,8 @@ public abstract class EntityLiving extends Entity {
|
|||||||
protected boolean aZ = false;
|
protected boolean aZ = false;
|
||||||
protected float ba = 0.0F;
|
protected float ba = 0.0F;
|
||||||
protected float bb = 0.7F;
|
protected float bb = 0.7F;
|
||||||
private int h = 0;
|
private int q = 0;
|
||||||
private Entity i;
|
private Entity r;
|
||||||
protected int bc = 0;
|
protected int bc = 0;
|
||||||
public int expToDrop = 0; // CraftBukkit
|
public int expToDrop = 0; // CraftBukkit
|
||||||
public int maxAirTicks = 300; // CraftBukkit
|
public int maxAirTicks = 300; // CraftBukkit
|
||||||
@ -96,9 +105,11 @@ public abstract class EntityLiving extends Entity {
|
|||||||
super(world);
|
super(world);
|
||||||
this.bf = true;
|
this.bf = true;
|
||||||
this.lookController = new ControllerLook(this);
|
this.lookController = new ControllerLook(this);
|
||||||
this.moveController = new ControllerMove(this, this.bb);
|
this.moveController = new ControllerMove(this);
|
||||||
this.jumpController = new ControllerJump(this);
|
this.jumpController = new ControllerJump(this);
|
||||||
this.navigation = new PathfinderNavigation(this, world);
|
this.senses = new EntityAIBodyControl(this);
|
||||||
|
this.navigation = new Navigation(this, world, 16.0F);
|
||||||
|
this.m = new EntitySenses(this);
|
||||||
this.U = (float) (Math.random() + 1.0D) * 0.01F;
|
this.U = (float) (Math.random() + 1.0D) * 0.01F;
|
||||||
this.setPosition(this.locX, this.locY, this.locZ);
|
this.setPosition(this.locX, this.locY, this.locZ);
|
||||||
this.T = (float) Math.random() * 12398.0F;
|
this.T = (float) Math.random() * 12398.0F;
|
||||||
@ -119,35 +130,115 @@ public abstract class EntityLiving extends Entity {
|
|||||||
return this.jumpController;
|
return this.jumpController;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Navigation ah() {
|
public Navigation ak() {
|
||||||
return this.navigation;
|
return this.navigation;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Random ai() {
|
public EntitySenses al() {
|
||||||
|
return this.m;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Random am() {
|
||||||
return this.random;
|
return this.random;
|
||||||
}
|
}
|
||||||
|
|
||||||
public EntityLiving aj() {
|
public EntityLiving an() {
|
||||||
return this.lastDamager;
|
return this.lastDamager;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int ak() {
|
public EntityLiving ao() {
|
||||||
|
return this.d;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void g(Entity entity) {
|
||||||
|
if (entity instanceof EntityLiving) {
|
||||||
|
this.d = (EntityLiving) entity;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int ap() {
|
||||||
return this.aV;
|
return this.aV;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void b() {
|
public float aq() {
|
||||||
this.datawatcher.a(8, Integer.valueOf(this.c));
|
return this.X;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean g(Entity entity) {
|
public float ar() {
|
||||||
|
return this.n;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void d(float f) {
|
||||||
|
this.n = f;
|
||||||
|
this.e(f);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean a(Entity entity) {
|
||||||
|
this.g(entity);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EntityLiving as() {
|
||||||
|
return this.l;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void b(EntityLiving entityliving) {
|
||||||
|
this.l = entityliving;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean a(Class oclass) {
|
||||||
|
return EntityCreeper.class != oclass && EntityGhast.class != oclass;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void z() {}
|
||||||
|
|
||||||
|
public boolean at() {
|
||||||
|
return this.e(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ));
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean e(int i, int j, int k) {
|
||||||
|
return this.p == -1.0F ? true : this.o.c(i, j, k) < this.p * this.p;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void b(int i, int j, int k, int l) {
|
||||||
|
this.o.a(i, j, k);
|
||||||
|
this.p = (float) l;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ChunkCoordinates au() {
|
||||||
|
return this.o;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float av() {
|
||||||
|
return this.p;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void aw() {
|
||||||
|
this.p = -1.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean ax() {
|
||||||
|
return this.p != -1.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void a(EntityLiving entityliving) {
|
||||||
|
this.lastDamager = entityliving;
|
||||||
|
this.c = this.lastDamager != null ? 60 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void b() {
|
||||||
|
this.datawatcher.a(8, Integer.valueOf(this.f));
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean h(Entity entity) {
|
||||||
return this.world.a(Vec3D.create(this.locX, this.locY + (double) this.getHeadHeight(), this.locZ), Vec3D.create(entity.locX, entity.locY + (double) entity.getHeadHeight(), entity.locZ)) == null;
|
return this.world.a(Vec3D.create(this.locX, this.locY + (double) this.getHeadHeight(), this.locZ), Vec3D.create(entity.locX, entity.locY + (double) entity.getHeadHeight(), entity.locZ)) == null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean e_() {
|
public boolean o_() {
|
||||||
return !this.dead;
|
return !this.dead;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean f_() {
|
public boolean e_() {
|
||||||
return !this.dead;
|
return !this.dead;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -155,25 +246,25 @@ public abstract class EntityLiving extends Entity {
|
|||||||
return this.length * 0.85F;
|
return this.length * 0.85F;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int h() {
|
public int m() {
|
||||||
return 80;
|
return 80;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void al() {
|
public void ay() {
|
||||||
String s = this.c_();
|
String s = this.i();
|
||||||
|
|
||||||
if (s != null) {
|
if (s != null) {
|
||||||
this.world.makeSound(this, s, this.o(), this.v());
|
this.world.makeSound(this, s, this.p(), this.A());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void am() {
|
public void az() {
|
||||||
this.an = this.ao;
|
this.an = this.ao;
|
||||||
super.am();
|
super.az();
|
||||||
// MethodProfiler.a("mobBaseTick"); // CraftBukkit - not in production code
|
// MethodProfiler.a("mobBaseTick"); // CraftBukkit - not in production code
|
||||||
if (this.random.nextInt(1000) < this.a++) {
|
if (this.random.nextInt(1000) < this.a++) {
|
||||||
this.a = -this.h();
|
this.a = -this.m();
|
||||||
this.al();
|
this.ay();
|
||||||
}
|
}
|
||||||
|
|
||||||
// CraftBukkit start - don't inline the damage, perform it with an event
|
// CraftBukkit start - don't inline the damage, perform it with an event
|
||||||
@ -191,8 +282,8 @@ public abstract class EntityLiving extends Entity {
|
|||||||
this.extinguish();
|
this.extinguish();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.isAlive() && this.a(Material.WATER) && !this.f() && !this.effects.containsKey(Integer.valueOf(MobEffectList.WATER_BREATHING.id))) {
|
if (this.isAlive() && this.a(Material.WATER) && !this.f_() && !this.effects.containsKey(Integer.valueOf(MobEffectList.WATER_BREATHING.id))) {
|
||||||
this.setAirTicks(this.f(this.getAirTicks()));
|
this.setAirTicks(this.b_(this.getAirTicks()));
|
||||||
if (this.getAirTicks() == -20) {
|
if (this.getAirTicks() == -20) {
|
||||||
this.setAirTicks(0);
|
this.setAirTicks(0);
|
||||||
|
|
||||||
@ -237,7 +328,7 @@ public abstract class EntityLiving extends Entity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.health <= 0) {
|
if (this.health <= 0) {
|
||||||
this.an();
|
this.aA();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.lastDamageByPlayerTime > 0) {
|
if (this.lastDamageByPlayerTime > 0) {
|
||||||
@ -246,7 +337,21 @@ public abstract class EntityLiving extends Entity {
|
|||||||
this.killer = null;
|
this.killer = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.aB();
|
if (this.d != null && !this.d.isAlive()) {
|
||||||
|
this.d = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.lastDamager != null) {
|
||||||
|
if (!this.lastDamager.isAlive()) {
|
||||||
|
this.a((EntityLiving) null);
|
||||||
|
} else if (this.c > 0) {
|
||||||
|
--this.c;
|
||||||
|
} else {
|
||||||
|
this.a((EntityLiving) null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.aJ();
|
||||||
this.ac = this.ab;
|
this.ac = this.ab;
|
||||||
this.W = this.V;
|
this.W = this.V;
|
||||||
this.Y = this.X;
|
this.Y = this.X;
|
||||||
@ -267,7 +372,7 @@ public abstract class EntityLiving extends Entity {
|
|||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
protected void an() {
|
protected void aA() {
|
||||||
++this.deathTicks;
|
++this.deathTicks;
|
||||||
if (this.deathTicks >= 20 && !this.dead) { // CraftBukkit - (this.deathTicks == 20) -> (this.deathTicks >= 20 && !this.dead).
|
if (this.deathTicks >= 20 && !this.dead) { // CraftBukkit - (this.deathTicks == 20) -> (this.deathTicks >= 20 && !this.dead).
|
||||||
int i;
|
int i;
|
||||||
@ -282,7 +387,7 @@ public abstract class EntityLiving extends Entity {
|
|||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
this.ay();
|
this.aG();
|
||||||
this.die();
|
this.die();
|
||||||
|
|
||||||
for (i = 0; i < 20; ++i) {
|
for (i = 0; i < 20; ++i) {
|
||||||
@ -295,7 +400,7 @@ public abstract class EntityLiving extends Entity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected int f(int i) {
|
protected int b_(int i) {
|
||||||
return i - 1;
|
return i - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -307,7 +412,7 @@ public abstract class EntityLiving extends Entity {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ao() {
|
public void aB() {
|
||||||
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;
|
||||||
@ -318,27 +423,27 @@ public abstract class EntityLiving extends Entity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void N() {
|
public void Q() {
|
||||||
super.N();
|
super.Q();
|
||||||
this.Z = this.aa;
|
this.Z = this.aa;
|
||||||
this.aa = 0.0F;
|
this.aa = 0.0F;
|
||||||
this.fallDistance = 0.0F;
|
this.fallDistance = 0.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void y_() {
|
public void G_() {
|
||||||
super.y_();
|
super.G_();
|
||||||
if (this.aJ > 0) {
|
if (this.aI > 0) {
|
||||||
if (this.aK <= 0) {
|
if (this.aJ <= 0) {
|
||||||
this.aK = 60;
|
this.aJ = 60;
|
||||||
}
|
}
|
||||||
|
|
||||||
--this.aK;
|
--this.aJ;
|
||||||
if (this.aK <= 0) {
|
if (this.aJ <= 0) {
|
||||||
--this.aJ;
|
--this.aI;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.d();
|
this.e();
|
||||||
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.sqrt(d0 * d0 + d1 * d1);
|
float f = MathHelper.sqrt(d0 * d0 + d1 * d1);
|
||||||
@ -364,46 +469,49 @@ public abstract class EntityLiving extends Entity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.aa += (f3 - this.aa) * 0.3F;
|
this.aa += (f3 - this.aa) * 0.3F;
|
||||||
|
if (this.c_()) {
|
||||||
|
this.senses.a();
|
||||||
|
} else {
|
||||||
|
float f4;
|
||||||
|
|
||||||
float f4;
|
for (f4 = f1 - this.V; f4 < -180.0F; f4 += 360.0F) {
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
for (f4 = f1 - this.V; f4 < -180.0F; f4 += 360.0F) {
|
while (f4 >= 180.0F) {
|
||||||
;
|
f4 -= 360.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (f4 >= 180.0F) {
|
this.V += f4 * 0.3F;
|
||||||
f4 -= 360.0F;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.V += f4 * 0.3F;
|
float f5;
|
||||||
|
|
||||||
float f5;
|
for (f5 = this.yaw - this.V; f5 < -180.0F; f5 += 360.0F) {
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
for (f5 = this.yaw - this.V; f5 < -180.0F; f5 += 360.0F) {
|
while (f5 >= 180.0F) {
|
||||||
;
|
f5 -= 360.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (f5 >= 180.0F) {
|
boolean flag = f5 < -90.0F || f5 >= 90.0F;
|
||||||
f5 -= 360.0F;
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean flag = f5 < -90.0F || f5 >= 90.0F;
|
if (f5 < -75.0F) {
|
||||||
|
f5 = -75.0F;
|
||||||
|
}
|
||||||
|
|
||||||
if (f5 < -75.0F) {
|
if (f5 >= 75.0F) {
|
||||||
f5 = -75.0F;
|
f5 = 75.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (f5 >= 75.0F) {
|
this.V = this.yaw - f5;
|
||||||
f5 = 75.0F;
|
if (f5 * f5 > 2500.0F) {
|
||||||
}
|
this.V += f5 * 0.2F;
|
||||||
|
}
|
||||||
|
|
||||||
this.V = this.yaw - f5;
|
if (flag) {
|
||||||
if (f5 * f5 > 2500.0F) {
|
f2 *= -1.0F;
|
||||||
this.V += f5 * 0.2F;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (flag) {
|
|
||||||
f2 *= -1.0F;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
while (this.yaw - this.lastYaw < -180.0F) {
|
while (this.yaw - this.lastYaw < -180.0F) {
|
||||||
@ -430,6 +538,14 @@ public abstract class EntityLiving extends Entity {
|
|||||||
this.lastPitch += 360.0F;
|
this.lastPitch += 360.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
while (this.X - this.Y < -180.0F) {
|
||||||
|
this.Y -= 360.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (this.X - this.Y >= 180.0F) {
|
||||||
|
this.Y += 360.0F;
|
||||||
|
}
|
||||||
|
|
||||||
this.ab += f2;
|
this.ab += f2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -506,6 +622,10 @@ public abstract class EntityLiving extends Entity {
|
|||||||
Entity entity = damagesource.getEntity();
|
Entity entity = damagesource.getEntity();
|
||||||
|
|
||||||
if (entity != null) {
|
if (entity != null) {
|
||||||
|
if (entity instanceof EntityLiving) {
|
||||||
|
this.a((EntityLiving) entity);
|
||||||
|
}
|
||||||
|
|
||||||
if (entity instanceof EntityHuman) {
|
if (entity instanceof EntityHuman) {
|
||||||
this.lastDamageByPlayerTime = 60;
|
this.lastDamageByPlayerTime = 60;
|
||||||
this.killer = (EntityHuman) entity;
|
this.killer = (EntityHuman) entity;
|
||||||
@ -521,7 +641,7 @@ public abstract class EntityLiving extends Entity {
|
|||||||
|
|
||||||
if (flag) {
|
if (flag) {
|
||||||
this.world.broadcastEntityEffect(this, (byte) 2);
|
this.world.broadcastEntityEffect(this, (byte) 2);
|
||||||
this.aM();
|
this.aV();
|
||||||
if (entity != null) {
|
if (entity != null) {
|
||||||
double d0 = entity.locX - this.locX;
|
double d0 = entity.locX - this.locX;
|
||||||
|
|
||||||
@ -540,12 +660,12 @@ public abstract class EntityLiving extends Entity {
|
|||||||
|
|
||||||
if (this.health <= 0) {
|
if (this.health <= 0) {
|
||||||
if (flag) {
|
if (flag) {
|
||||||
this.world.makeSound(this, this.n(), this.o(), this.v());
|
this.world.makeSound(this, this.k(), this.p(), this.A());
|
||||||
}
|
}
|
||||||
|
|
||||||
this.die(damagesource);
|
this.die(damagesource);
|
||||||
} else if (flag) {
|
} else if (flag) {
|
||||||
this.world.makeSound(this, this.m(), this.o(), this.v());
|
this.world.makeSound(this, this.j(), this.p(), this.A());
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -553,22 +673,22 @@ public abstract class EntityLiving extends Entity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private float v() {
|
private float A() {
|
||||||
return this.isBaby() ? (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.5F : (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F;
|
return this.isBaby() ? (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.5F : (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int P() {
|
public int S() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void g(int i) {}
|
protected void f(int i) {}
|
||||||
|
|
||||||
protected int d(DamageSource damagesource, int i) {
|
protected int d(DamageSource damagesource, int i) {
|
||||||
if (!damagesource.ignoresArmor()) {
|
if (!damagesource.ignoresArmor()) {
|
||||||
int j = 25 - this.P();
|
int j = 25 - this.S();
|
||||||
int k = i * j + this.ar;
|
int k = i * j + this.ar;
|
||||||
|
|
||||||
this.g(i);
|
this.f(i);
|
||||||
i = k / 25;
|
i = k / 25;
|
||||||
this.ar = k % 25;
|
this.ar = k % 25;
|
||||||
}
|
}
|
||||||
@ -595,19 +715,19 @@ public abstract class EntityLiving extends Entity {
|
|||||||
this.health -= i;
|
this.health -= i;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected float o() {
|
protected float p() {
|
||||||
return 1.0F;
|
return 1.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String c_() {
|
protected String i() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String m() {
|
protected String j() {
|
||||||
return "damage.hurtflesh";
|
return "damage.hurtflesh";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String n() {
|
protected String k() {
|
||||||
return "damage.hurtflesh";
|
return "damage.hurtflesh";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -635,7 +755,7 @@ public abstract class EntityLiving extends Entity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (entity != null) {
|
if (entity != null) {
|
||||||
entity.a(this);
|
entity.c(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.az = true;
|
this.az = true;
|
||||||
@ -648,12 +768,21 @@ public abstract class EntityLiving extends Entity {
|
|||||||
|
|
||||||
if (!this.isBaby()) {
|
if (!this.isBaby()) {
|
||||||
this.dropDeathLoot(this.lastDamageByPlayerTime > 0, i);
|
this.dropDeathLoot(this.lastDamageByPlayerTime > 0, i);
|
||||||
|
if (this.lastDamageByPlayerTime > 0) {
|
||||||
|
int j = this.random.nextInt(200) - i;
|
||||||
|
|
||||||
|
if (j < 5) {
|
||||||
|
this.b(j <= 0 ? 1 : 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.world.broadcastEntityEffect(this, (byte) 3);
|
this.world.broadcastEntityEffect(this, (byte) 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void b(int i) {}
|
||||||
|
|
||||||
protected void dropDeathLoot(boolean flag, int i) {
|
protected void dropDeathLoot(boolean flag, int i) {
|
||||||
int j = this.getLootId();
|
int j = this.getLootId();
|
||||||
|
|
||||||
@ -680,8 +809,8 @@ public abstract class EntityLiving extends Entity {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void b(float f) {
|
protected void a(float f) {
|
||||||
super.b(f);
|
super.a(f);
|
||||||
int i = (int) Math.ceil((double) (f - 3.0F));
|
int i = (int) Math.ceil((double) (f - 3.0F));
|
||||||
|
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
@ -715,9 +844,9 @@ 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.aK()) {
|
if (this.aT()) {
|
||||||
d0 = this.locY;
|
d0 = this.locY;
|
||||||
this.a(f, f1, 0.02F);
|
this.a(f, f1, this.c_() ? 0.04F : 0.02F);
|
||||||
this.move(this.motX, this.motY, this.motZ);
|
this.move(this.motX, this.motY, this.motZ);
|
||||||
this.motX *= 0.800000011920929D;
|
this.motX *= 0.800000011920929D;
|
||||||
this.motY *= 0.800000011920929D;
|
this.motY *= 0.800000011920929D;
|
||||||
@ -726,7 +855,7 @@ public abstract class EntityLiving extends Entity {
|
|||||||
if (this.positionChanged && this.d(this.motX, this.motY + 0.6000000238418579D - this.locY + d0, this.motZ)) {
|
if (this.positionChanged && this.d(this.motX, this.motY + 0.6000000238418579D - this.locY + d0, this.motZ)) {
|
||||||
this.motY = 0.30000001192092896D;
|
this.motY = 0.30000001192092896D;
|
||||||
}
|
}
|
||||||
} else if (this.aL()) {
|
} else if (this.aU()) {
|
||||||
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);
|
||||||
@ -750,7 +879,19 @@ public abstract class EntityLiving extends Entity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
float f3 = 0.16277136F / (f2 * f2 * f2);
|
float f3 = 0.16277136F / (f2 * f2 * f2);
|
||||||
float f4 = this.onGround ? this.al * f3 : this.am;
|
float f4;
|
||||||
|
|
||||||
|
if (this.onGround) {
|
||||||
|
if (this.c_()) {
|
||||||
|
f4 = this.ar();
|
||||||
|
} else {
|
||||||
|
f4 = this.al;
|
||||||
|
}
|
||||||
|
|
||||||
|
f4 *= f3;
|
||||||
|
} else {
|
||||||
|
f4 = this.am;
|
||||||
|
}
|
||||||
|
|
||||||
this.a(f, f1, f4);
|
this.a(f, f1, f4);
|
||||||
f2 = 0.91F;
|
f2 = 0.91F;
|
||||||
@ -763,7 +904,7 @@ public abstract class EntityLiving extends Entity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.r()) {
|
if (this.t()) {
|
||||||
float f5 = 0.15F;
|
float f5 = 0.15F;
|
||||||
|
|
||||||
if (this.motX < (double) (-f5)) {
|
if (this.motX < (double) (-f5)) {
|
||||||
@ -787,13 +928,15 @@ public abstract class EntityLiving extends Entity {
|
|||||||
this.motY = -0.15D;
|
this.motY = -0.15D;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.isSneaking() && this.motY < 0.0D) {
|
boolean flag = this.isSneaking() && this instanceof EntityHuman;
|
||||||
|
|
||||||
|
if (flag && this.motY < 0.0D) {
|
||||||
this.motY = 0.0D;
|
this.motY = 0.0D;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.move(this.motX, this.motY, this.motZ);
|
this.move(this.motX, this.motY, this.motZ);
|
||||||
if (this.positionChanged && this.r()) {
|
if (this.positionChanged && this.t()) {
|
||||||
this.motY = 0.2D;
|
this.motY = 0.2D;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -816,12 +959,13 @@ public abstract class EntityLiving extends Entity {
|
|||||||
this.aF += this.aE;
|
this.aF += this.aE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean r() {
|
public boolean t() {
|
||||||
int i = MathHelper.floor(this.locX);
|
int i = MathHelper.floor(this.locX);
|
||||||
int j = MathHelper.floor(this.boundingBox.b);
|
int j = MathHelper.floor(this.boundingBox.b);
|
||||||
int k = MathHelper.floor(this.locZ);
|
int k = MathHelper.floor(this.locZ);
|
||||||
|
int l = this.world.getTypeId(i, j, k);
|
||||||
|
|
||||||
return this.world.getTypeId(i, j, k) == Block.LADDER.id;
|
return l == Block.LADDER.id || l == Block.VINE.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void b(NBTTagCompound nbttagcompound) {
|
public void b(NBTTagCompound nbttagcompound) {
|
||||||
@ -875,25 +1019,21 @@ public abstract class EntityLiving extends Entity {
|
|||||||
return !this.dead && this.health > 0;
|
return !this.dead && this.health > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean f() {
|
public boolean f_() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void d(float f) {
|
public void e(float f) {
|
||||||
this.aX = f;
|
this.aX = f;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void e(boolean flag) {
|
public void f(boolean flag) {
|
||||||
this.aZ = flag;
|
this.aZ = flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
public float ar() {
|
public void e() {
|
||||||
return this.bb;
|
if (this.q > 0) {
|
||||||
}
|
--this.q;
|
||||||
|
|
||||||
public void d() {
|
|
||||||
if (this.h > 0) {
|
|
||||||
--this.h;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.aN > 0) {
|
if (this.aN > 0) {
|
||||||
@ -935,35 +1075,39 @@ public abstract class EntityLiving extends Entity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MethodProfiler.a("ai"); // CraftBukkit - not in production code
|
// MethodProfiler.a("ai"); // CraftBukkit - not in production code
|
||||||
if (this.M()) {
|
if (this.P()) {
|
||||||
this.aZ = false;
|
this.aZ = false;
|
||||||
this.aW = 0.0F;
|
this.aW = 0.0F;
|
||||||
this.aX = 0.0F;
|
this.aX = 0.0F;
|
||||||
this.aY = 0.0F;
|
this.aY = 0.0F;
|
||||||
} else if (this.at()) {
|
} else if (this.aE()) {
|
||||||
if (this.as()) {
|
if (this.c_()) {
|
||||||
this.av();
|
MethodProfiler.a("newAi");
|
||||||
|
this.z_();
|
||||||
|
MethodProfiler.a();
|
||||||
} else {
|
} else {
|
||||||
this.m_();
|
MethodProfiler.a("oldAi");
|
||||||
|
this.d_();
|
||||||
|
MethodProfiler.a();
|
||||||
this.X = this.yaw;
|
this.X = this.yaw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// MethodProfiler.a(); // CraftBukkit - not in production code
|
// MethodProfiler.a(); // CraftBukkit - not in production code
|
||||||
boolean flag = this.aK();
|
boolean flag = this.aT();
|
||||||
boolean flag1 = this.aL();
|
boolean flag1 = this.aU();
|
||||||
|
|
||||||
if (this.aZ) {
|
if (this.aZ) {
|
||||||
if (flag) {
|
if (flag) {
|
||||||
this.motY += 0.03999999910593033D;
|
this.motY += 0.03999999910593033D;
|
||||||
} else if (flag1) {
|
} else if (flag1) {
|
||||||
this.motY += 0.03999999910593033D;
|
this.motY += 0.03999999910593033D;
|
||||||
} else if (this.onGround && this.h == 0) {
|
} else if (this.onGround && this.q == 0) {
|
||||||
this.o_();
|
this.ab();
|
||||||
this.h = 10;
|
this.q = 10;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.h = 0;
|
this.q = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.aW *= 0.98F;
|
this.aW *= 0.98F;
|
||||||
@ -971,7 +1115,7 @@ public abstract class EntityLiving extends Entity {
|
|||||||
this.aY *= 0.9F;
|
this.aY *= 0.9F;
|
||||||
float f = this.al;
|
float f = this.al;
|
||||||
|
|
||||||
this.al *= this.G();
|
this.al *= this.D_();
|
||||||
this.a(this.aW, this.aX);
|
this.a(this.aW, this.aX);
|
||||||
this.al = f;
|
this.al = f;
|
||||||
// MethodProfiler.a("push"); // CraftBukkit - not in production code
|
// MethodProfiler.a("push"); // CraftBukkit - not in production code
|
||||||
@ -981,7 +1125,7 @@ public abstract class EntityLiving extends Entity {
|
|||||||
for (int j = 0; j < list1.size(); ++j) {
|
for (int j = 0; j < list1.size(); ++j) {
|
||||||
Entity entity = (Entity) list1.get(j);
|
Entity entity = (Entity) list1.get(j);
|
||||||
|
|
||||||
if (entity.f_()) {
|
if (entity.e_()) {
|
||||||
entity.collide(this);
|
entity.collide(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -990,23 +1134,23 @@ public abstract class EntityLiving extends Entity {
|
|||||||
// MethodProfiler.a(); // CraftBukkit - not in production code
|
// MethodProfiler.a(); // CraftBukkit - not in production code
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean as() {
|
protected boolean c_() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean at() {
|
protected boolean aE() {
|
||||||
return !this.world.isStatic;
|
return !this.world.isStatic;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean M() {
|
protected boolean P() {
|
||||||
return this.health <= 0;
|
return this.health <= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean L() {
|
public boolean O() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void o_() {
|
protected void ab() {
|
||||||
this.motY = 0.41999998688697815D;
|
this.motY = 0.41999998688697815D;
|
||||||
if (this.hasEffect(MobEffectList.JUMP)) {
|
if (this.hasEffect(MobEffectList.JUMP)) {
|
||||||
this.motY += (double) ((float) (this.getEffect(MobEffectList.JUMP).getAmplifier() + 1) * 0.1F);
|
this.motY += (double) ((float) (this.getEffect(MobEffectList.JUMP).getAmplifier() + 1) * 0.1F);
|
||||||
@ -1022,11 +1166,11 @@ public abstract class EntityLiving extends Entity {
|
|||||||
this.ce = true;
|
this.ce = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean d_() {
|
protected boolean n() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void au() {
|
protected void aF() {
|
||||||
EntityHuman entityhuman = this.world.findNearbyPlayer(this, -1.0D);
|
EntityHuman entityhuman = this.world.findNearbyPlayer(this, -1.0D);
|
||||||
|
|
||||||
if (entityhuman != null) {
|
if (entityhuman != null) {
|
||||||
@ -1035,11 +1179,11 @@ public abstract class EntityLiving extends Entity {
|
|||||||
double d2 = entityhuman.locZ - this.locZ;
|
double d2 = entityhuman.locZ - this.locZ;
|
||||||
double d3 = d0 * d0 + d1 * d1 + d2 * d2;
|
double d3 = d0 * d0 + d1 * d1 + d2 * d2;
|
||||||
|
|
||||||
if (this.d_() && d3 > 16384.0D) {
|
if (this.n() && d3 > 16384.0D) {
|
||||||
this.die();
|
this.die();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.aV > 600 && this.random.nextInt(800) == 0 && d3 > 1024.0D && this.d_()) {
|
if (this.aV > 600 && this.random.nextInt(800) == 0 && d3 > 1024.0D && this.n()) {
|
||||||
this.die();
|
this.die();
|
||||||
} else if (d3 < 1024.0D) {
|
} else if (d3 < 1024.0D) {
|
||||||
this.aV = 0;
|
this.aV = 0;
|
||||||
@ -1047,25 +1191,40 @@ public abstract class EntityLiving extends Entity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void av() {
|
protected void z_() {
|
||||||
++this.aV;
|
++this.aV;
|
||||||
this.au();
|
//MethodProfiler.a("checkDespawn"); // CraftBukkit - not in production code
|
||||||
if (this.lastDamager != null && !this.lastDamager.isAlive()) {
|
this.aF();
|
||||||
this.lastDamager = null;
|
//MethodProfiler.a(); // CraftBukkit - not in production code
|
||||||
}
|
//MethodProfiler.a("sensing"); // CraftBukkit - not in production code
|
||||||
|
this.m.a();
|
||||||
|
//MethodProfiler.a(); // CraftBukkit - not in production code
|
||||||
|
//MethodProfiler.a("targetSelector"); // CraftBukkit - not in production code
|
||||||
|
this.targetSelector.a();
|
||||||
|
//MethodProfiler.a(); // CraftBukkit - not in production code
|
||||||
|
//MethodProfiler.a("goalSelector"); // CraftBukkit - not in production code
|
||||||
this.goalSelector.a();
|
this.goalSelector.a();
|
||||||
this.navigation.a();
|
//MethodProfiler.a(); // CraftBukkit - not in production code
|
||||||
this.moveController.a();
|
//MethodProfiler.a("navigation"); // CraftBukkit - not in production code
|
||||||
|
this.navigation.d();
|
||||||
|
//MethodProfiler.a(); // CraftBukkit - not in production code
|
||||||
|
//MethodProfiler.a("mob tick"); // CraftBukkit - not in production code
|
||||||
|
this.g();
|
||||||
|
//MethodProfiler.a(); // CraftBukkit - not in production code
|
||||||
|
//MethodProfiler.a("controls"); // CraftBukkit - not in production code
|
||||||
|
this.moveController.c();
|
||||||
this.lookController.a();
|
this.lookController.a();
|
||||||
this.jumpController.b();
|
this.jumpController.b();
|
||||||
|
//MethodProfiler.a(); // CraftBukkit - not in production code
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void m_() {
|
protected void g() {}
|
||||||
|
|
||||||
|
protected void d_() {
|
||||||
++this.aV;
|
++this.aV;
|
||||||
EntityHuman entityhuman = this.world.findNearbyPlayer(this, -1.0D);
|
EntityHuman entityhuman = this.world.findNearbyPlayer(this, -1.0D);
|
||||||
|
|
||||||
this.au();
|
this.aF();
|
||||||
this.aW = 0.0F;
|
this.aW = 0.0F;
|
||||||
this.aX = 0.0F;
|
this.aX = 0.0F;
|
||||||
float f = 8.0F;
|
float f = 8.0F;
|
||||||
@ -1073,17 +1232,17 @@ public abstract class EntityLiving extends Entity {
|
|||||||
if (this.random.nextFloat() < 0.02F) {
|
if (this.random.nextFloat() < 0.02F) {
|
||||||
entityhuman = this.world.findNearbyPlayer(this, (double) f);
|
entityhuman = this.world.findNearbyPlayer(this, (double) f);
|
||||||
if (entityhuman != null) {
|
if (entityhuman != null) {
|
||||||
this.i = entityhuman;
|
this.r = entityhuman;
|
||||||
this.bc = 10 + this.random.nextInt(20);
|
this.bc = 10 + this.random.nextInt(20);
|
||||||
} else {
|
} else {
|
||||||
this.aY = (this.random.nextFloat() - 0.5F) * 20.0F;
|
this.aY = (this.random.nextFloat() - 0.5F) * 20.0F;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.i != null) {
|
if (this.r != null) {
|
||||||
this.a(this.i, 10.0F, (float) this.x());
|
this.a(this.r, 10.0F, (float) this.C());
|
||||||
if (this.bc-- <= 0 || this.i.dead || this.i.i(this) > (double) (f * f)) {
|
if (this.bc-- <= 0 || this.r.dead || this.r.j(this) > (double) (f * f)) {
|
||||||
this.i = null;
|
this.r = null;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (this.random.nextFloat() < 0.05F) {
|
if (this.random.nextFloat() < 0.05F) {
|
||||||
@ -1094,15 +1253,15 @@ public abstract class EntityLiving extends Entity {
|
|||||||
this.pitch = this.ba;
|
this.pitch = this.ba;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean flag = this.aK();
|
boolean flag = this.aT();
|
||||||
boolean flag1 = this.aL();
|
boolean flag1 = this.aU();
|
||||||
|
|
||||||
if (flag || flag1) {
|
if (flag || flag1) {
|
||||||
this.aZ = this.random.nextFloat() < 0.8F;
|
this.aZ = this.random.nextFloat() < 0.8F;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int x() {
|
public int C() {
|
||||||
return 40;
|
return 40;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1127,14 +1286,6 @@ public abstract class EntityLiving extends Entity {
|
|||||||
this.yaw = this.b(this.yaw, f2, f);
|
this.yaw = this.b(this.yaw, f2, f);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean aw() {
|
|
||||||
return this.i != null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Entity ax() {
|
|
||||||
return this.i;
|
|
||||||
}
|
|
||||||
|
|
||||||
private float b(float f, float f1, float f2) {
|
private float b(float f, float f1, float f2) {
|
||||||
float f3;
|
float f3;
|
||||||
|
|
||||||
@ -1157,13 +1308,13 @@ public abstract class EntityLiving extends Entity {
|
|||||||
return f + f3;
|
return f + f3;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ay() {}
|
public void aG() {}
|
||||||
|
|
||||||
public boolean canSpawn() {
|
public boolean canSpawn() {
|
||||||
return this.world.containsEntity(this.boundingBox) && this.world.getCubes(this, this.boundingBox).size() == 0 && !this.world.containsLiquid(this.boundingBox);
|
return this.world.containsEntity(this.boundingBox) && this.world.getCubes(this, this.boundingBox).size() == 0 && !this.world.containsLiquid(this.boundingBox);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void az() {
|
protected void aH() {
|
||||||
// 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);
|
||||||
@ -1176,11 +1327,11 @@ public abstract class EntityLiving extends Entity {
|
|||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vec3D aA() {
|
public Vec3D aI() {
|
||||||
return this.e(1.0F);
|
return this.f(1.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vec3D e(float f) {
|
public Vec3D f(float f) {
|
||||||
float f1;
|
float f1;
|
||||||
float f2;
|
float f2;
|
||||||
float f3;
|
float f3;
|
||||||
@ -1204,7 +1355,7 @@ public abstract class EntityLiving extends Entity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int p() {
|
public int q() {
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1212,7 +1363,7 @@ public abstract class EntityLiving extends Entity {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void aB() {
|
protected void aJ() {
|
||||||
Iterator iterator = this.effects.keySet().iterator();
|
Iterator iterator = this.effects.keySet().iterator();
|
||||||
|
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
@ -1227,7 +1378,7 @@ public abstract class EntityLiving extends Entity {
|
|||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (this.b) {
|
if (this.e) {
|
||||||
if (!this.world.isStatic) {
|
if (!this.world.isStatic) {
|
||||||
if (!this.effects.isEmpty()) {
|
if (!this.effects.isEmpty()) {
|
||||||
i = PotionBrewer.a(this.effects.values());
|
i = PotionBrewer.a(this.effects.values());
|
||||||
@ -1237,7 +1388,7 @@ public abstract class EntityLiving extends Entity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.b = false;
|
this.e = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.random.nextBoolean()) {
|
if (this.random.nextBoolean()) {
|
||||||
@ -1252,7 +1403,7 @@ public abstract class EntityLiving extends Entity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void aC() {
|
public void aK() {
|
||||||
Iterator iterator = this.effects.keySet().iterator();
|
Iterator iterator = this.effects.keySet().iterator();
|
||||||
|
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
@ -1302,23 +1453,23 @@ public abstract class EntityLiving extends Entity {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean aE() {
|
public boolean aM() {
|
||||||
return this.getMonsterType() == MonsterType.UNDEAD;
|
return this.getMonsterType() == MonsterType.UNDEAD;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void b(MobEffect mobeffect) {
|
protected void b(MobEffect mobeffect) {
|
||||||
this.b = true;
|
this.e = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void c(MobEffect mobeffect) {
|
protected void c(MobEffect mobeffect) {
|
||||||
this.b = true;
|
this.e = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void d(MobEffect mobeffect) {
|
protected void d(MobEffect mobeffect) {
|
||||||
this.b = true;
|
this.e = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected float G() {
|
protected float D_() {
|
||||||
float f = 1.0F;
|
float f = 1.0F;
|
||||||
|
|
||||||
if (this.hasEffect(MobEffectList.FASTER_MOVEMENT)) {
|
if (this.hasEffect(MobEffectList.FASTER_MOVEMENT)) {
|
||||||
|
@ -16,19 +16,19 @@ public class EntityMagmaCube extends EntitySlime {
|
|||||||
return this.world.difficulty > 0 && this.world.containsEntity(this.boundingBox) && this.world.getCubes(this, this.boundingBox).size() == 0 && !this.world.containsLiquid(this.boundingBox);
|
return this.world.difficulty > 0 && this.world.containsEntity(this.boundingBox) && this.world.getCubes(this, this.boundingBox).size() == 0 && !this.world.containsLiquid(this.boundingBox);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int P() {
|
public int S() {
|
||||||
return this.getSize() * 3;
|
return this.getSize() * 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
public float a(float f) {
|
public float b(float f) {
|
||||||
return 1.0F;
|
return 1.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String v() {
|
protected String A() {
|
||||||
return "flame";
|
return "flame";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected EntitySlime z() {
|
protected EntitySlime D() {
|
||||||
return new EntityMagmaCube(this.world);
|
return new EntityMagmaCube(this.world);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,46 +59,46 @@ public class EntityMagmaCube extends EntitySlime {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected int B() {
|
protected int E() {
|
||||||
return super.B() * 4;
|
return super.E() * 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void C() {
|
protected void F() {
|
||||||
this.a *= 0.9F;
|
this.a *= 0.9F;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void o_() {
|
protected void ab() {
|
||||||
this.motY = (double) (0.42F + (float) this.getSize() * 0.1F);
|
this.motY = (double) (0.42F + (float) this.getSize() * 0.1F);
|
||||||
this.ce = true;
|
this.ce = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void b(float f) {}
|
protected void a(float f) {}
|
||||||
|
|
||||||
protected boolean D() {
|
protected boolean G() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected int E() {
|
protected int H() {
|
||||||
return super.E() + 2;
|
return super.H() + 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String m() {
|
protected String j() {
|
||||||
return "mob.slime";
|
return "mob.slime";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String n() {
|
protected String k() {
|
||||||
return "mob.slime";
|
return "mob.slime";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String F() {
|
protected String J() {
|
||||||
return this.getSize() > 1 ? "mob.magmacube.big" : "mob.magmacube.small";
|
return this.getSize() > 1 ? "mob.magmacube.big" : "mob.magmacube.small";
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean aL() {
|
public boolean aU() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean H() {
|
protected boolean K() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -90,15 +90,15 @@ public class EntityMinecart extends Entity implements IInventory {
|
|||||||
this.datawatcher.a(19, new Integer(0));
|
this.datawatcher.a(19, new Integer(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
public AxisAlignedBB a_(Entity entity) {
|
public AxisAlignedBB b_(Entity entity) {
|
||||||
return entity.boundingBox;
|
return entity.boundingBox;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AxisAlignedBB h_() {
|
public AxisAlignedBB h() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean f_() {
|
public boolean e_() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,7 +116,7 @@ public class EntityMinecart extends Entity implements IInventory {
|
|||||||
this.world.getServer().getPluginManager().callEvent(new VehicleCreateEvent((Vehicle) this.getBukkitEntity())); // CraftBukkit
|
this.world.getServer().getPluginManager().callEvent(new VehicleCreateEvent((Vehicle) this.getBukkitEntity())); // CraftBukkit
|
||||||
}
|
}
|
||||||
|
|
||||||
public double q() {
|
public double x_() {
|
||||||
return (double) this.length * 0.0D - 0.30000001192092896D;
|
return (double) this.length * 0.0D - 0.30000001192092896D;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -136,9 +136,9 @@ public class EntityMinecart extends Entity implements IInventory {
|
|||||||
i = event.getDamage();
|
i = event.getDamage();
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
this.d(-this.m());
|
this.e(-this.n());
|
||||||
this.c(10);
|
this.d(10);
|
||||||
this.aM();
|
this.aV();
|
||||||
this.setDamage(this.getDamage() + i * 10);
|
this.setDamage(this.getDamage() + i * 10);
|
||||||
if (this.getDamage() > 40) {
|
if (this.getDamage() > 40) {
|
||||||
if (this.passenger != null) {
|
if (this.passenger != null) {
|
||||||
@ -200,7 +200,7 @@ public class EntityMinecart extends Entity implements IInventory {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean e_() {
|
public boolean o_() {
|
||||||
return !this.dead;
|
return !this.dead;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -236,7 +236,7 @@ public class EntityMinecart extends Entity implements IInventory {
|
|||||||
super.die();
|
super.die();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void y_() {
|
public void G_() {
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
double prevX = this.locX;
|
double prevX = this.locX;
|
||||||
double prevY = this.locY;
|
double prevY = this.locY;
|
||||||
@ -245,15 +245,15 @@ public class EntityMinecart extends Entity implements IInventory {
|
|||||||
float prevPitch = this.pitch;
|
float prevPitch = this.pitch;
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
if (this.l() > 0) {
|
if (this.m() > 0) {
|
||||||
this.c(this.l() - 1);
|
this.d(this.m() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.getDamage() > 0) {
|
if (this.getDamage() > 0) {
|
||||||
this.setDamage(this.getDamage() - 1);
|
this.setDamage(this.getDamage() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.j() && this.random.nextInt(4) == 0) {
|
if (this.k() && this.random.nextInt(4) == 0) {
|
||||||
this.world.a("largesmoke", this.locX, this.locY + 0.8D, this.locZ, 0.0D, 0.0D, 0.0D);
|
this.world.a("largesmoke", this.locX, this.locY + 0.8D, this.locZ, 0.0D, 0.0D, 0.0D);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -598,7 +598,7 @@ public class EntityMinecart extends Entity implements IInventory {
|
|||||||
for (int l1 = 0; l1 < list.size(); ++l1) {
|
for (int l1 = 0; l1 < list.size(); ++l1) {
|
||||||
Entity entity = (Entity) list.get(l1);
|
Entity entity = (Entity) list.get(l1);
|
||||||
|
|
||||||
if (entity != this.passenger && entity.f_() && entity instanceof EntityMinecart) {
|
if (entity != this.passenger && entity.e_() && entity instanceof EntityMinecart) {
|
||||||
entity.collide(this);
|
entity.collide(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -851,6 +851,17 @@ public class EntityMinecart extends Entity implements IInventory {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ItemStack splitWithoutUpdate(int i) {
|
||||||
|
if (this.items[i] != null) {
|
||||||
|
ItemStack itemstack = this.items[i];
|
||||||
|
|
||||||
|
this.items[i] = null;
|
||||||
|
return itemstack;
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void setItem(int i, ItemStack itemstack) {
|
public void setItem(int i, ItemStack itemstack) {
|
||||||
this.items[i] = itemstack;
|
this.items[i] = itemstack;
|
||||||
if (itemstack != null && itemstack.count > this.getMaxStackSize()) {
|
if (itemstack != null && itemstack.count > this.getMaxStackSize()) {
|
||||||
@ -859,7 +870,7 @@ public class EntityMinecart extends Entity implements IInventory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "Minecart";
|
return "container.minecart";
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMaxStackSize() {
|
public int getMaxStackSize() {
|
||||||
@ -900,10 +911,10 @@ public class EntityMinecart extends Entity implements IInventory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean a(EntityHuman entityhuman) {
|
public boolean a(EntityHuman entityhuman) {
|
||||||
return this.dead ? false : entityhuman.i(this) <= 64.0D;
|
return this.dead ? false : entityhuman.j(this) <= 64.0D;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean j() {
|
protected boolean k() {
|
||||||
return (this.datawatcher.getByte(16) & 1) != 0;
|
return (this.datawatcher.getByte(16) & 1) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -927,19 +938,19 @@ public class EntityMinecart extends Entity implements IInventory {
|
|||||||
return this.datawatcher.getInt(19);
|
return this.datawatcher.getInt(19);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void c(int i) {
|
public void d(int i) {
|
||||||
this.datawatcher.watch(17, Integer.valueOf(i));
|
this.datawatcher.watch(17, Integer.valueOf(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
public int l() {
|
public int m() {
|
||||||
return this.datawatcher.getInt(17);
|
return this.datawatcher.getInt(17);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void d(int i) {
|
public void e(int i) {
|
||||||
this.datawatcher.watch(18, Integer.valueOf(i));
|
this.datawatcher.watch(18, Integer.valueOf(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
public int m() {
|
public int n() {
|
||||||
return this.datawatcher.getInt(18);
|
return this.datawatcher.getInt(18);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,18 +17,18 @@ public abstract class EntityMonster extends EntityCreature implements IMonster {
|
|||||||
this.aA = 5;
|
this.aA = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void d() {
|
public void e() {
|
||||||
float f = this.a(1.0F);
|
float f = this.b(1.0F);
|
||||||
|
|
||||||
if (f > 0.5F) {
|
if (f > 0.5F) {
|
||||||
this.aV += 2;
|
this.aV += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
super.d();
|
super.e();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void y_() {
|
public void G_() {
|
||||||
super.y_();
|
super.G_();
|
||||||
if (!this.world.isStatic && this.world.difficulty == 0) {
|
if (!this.world.isStatic && this.world.difficulty == 0) {
|
||||||
this.die();
|
this.die();
|
||||||
}
|
}
|
||||||
@ -37,7 +37,7 @@ public abstract class EntityMonster extends EntityCreature implements IMonster {
|
|||||||
protected Entity findTarget() {
|
protected Entity findTarget() {
|
||||||
EntityHuman entityhuman = this.world.findNearbyVulnerablePlayer(this, 16.0D);
|
EntityHuman entityhuman = this.world.findNearbyVulnerablePlayer(this, 16.0D);
|
||||||
|
|
||||||
return entityhuman != null && this.g(entityhuman) ? entityhuman : null;
|
return entityhuman != null && this.h(entityhuman) ? entityhuman : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||||
@ -73,7 +73,7 @@ public abstract class EntityMonster extends EntityCreature implements IMonster {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean d(Entity entity) {
|
public boolean a(Entity entity) {
|
||||||
int i = this.damage;
|
int i = this.damage;
|
||||||
|
|
||||||
if (this.hasEffect(MobEffectList.INCREASE_DAMAGE)) {
|
if (this.hasEffect(MobEffectList.INCREASE_DAMAGE)) {
|
||||||
@ -108,12 +108,12 @@ public abstract class EntityMonster extends EntityCreature implements IMonster {
|
|||||||
protected void a(Entity entity, float f) {
|
protected void a(Entity entity, float f) {
|
||||||
if (this.attackTicks <= 0 && f < 2.0F && entity.boundingBox.e > this.boundingBox.b && entity.boundingBox.b < this.boundingBox.e) {
|
if (this.attackTicks <= 0 && f < 2.0F && entity.boundingBox.e > this.boundingBox.b && entity.boundingBox.b < this.boundingBox.e) {
|
||||||
this.attackTicks = 20;
|
this.attackTicks = 20;
|
||||||
this.d(entity);
|
this.a(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public float a(int i, int j, int k) {
|
public float a(int i, int j, int k) {
|
||||||
return 0.5F - this.world.m(i, j, k);
|
return 0.5F - this.world.p(i, j, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void b(NBTTagCompound nbttagcompound) {
|
public void b(NBTTagCompound nbttagcompound) {
|
||||||
@ -124,7 +124,7 @@ public abstract class EntityMonster extends EntityCreature implements IMonster {
|
|||||||
super.a(nbttagcompound);
|
super.a(nbttagcompound);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean z() {
|
protected boolean D() {
|
||||||
int i = MathHelper.floor(this.locX);
|
int i = MathHelper.floor(this.locX);
|
||||||
int j = MathHelper.floor(this.boundingBox.b);
|
int j = MathHelper.floor(this.boundingBox.b);
|
||||||
int k = MathHelper.floor(this.locZ);
|
int k = MathHelper.floor(this.locZ);
|
||||||
@ -134,12 +134,12 @@ public abstract class EntityMonster extends EntityCreature implements IMonster {
|
|||||||
} else {
|
} else {
|
||||||
int l = this.world.getLightLevel(i, j, k);
|
int l = this.world.getLightLevel(i, j, k);
|
||||||
|
|
||||||
if (this.world.v()) {
|
if (this.world.w()) {
|
||||||
int i1 = this.world.k;
|
int i1 = this.world.f;
|
||||||
|
|
||||||
this.world.k = 10;
|
this.world.f = 10;
|
||||||
l = this.world.getLightLevel(i, j, k);
|
l = this.world.getLightLevel(i, j, k);
|
||||||
this.world.k = i1;
|
this.world.f = i1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return l <= this.random.nextInt(8);
|
return l <= this.random.nextInt(8);
|
||||||
@ -147,6 +147,6 @@ public abstract class EntityMonster extends EntityCreature implements IMonster {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean canSpawn() {
|
public boolean canSpawn() {
|
||||||
return this.z() && super.canSpawn();
|
return this.D() && super.canSpawn();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,16 +25,18 @@ public class EntityMushroomCow extends EntityCow {
|
|||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
this.die();
|
this.die();
|
||||||
EntityCow entitycow = new EntityCow(this.world);
|
|
||||||
|
|
||||||
entitycow.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, this.pitch);
|
|
||||||
entitycow.setHealth(this.getHealth());
|
|
||||||
entitycow.V = this.V;
|
|
||||||
this.world.addEntity(entitycow);
|
|
||||||
this.world.a("largeexplode", this.locX, this.locY + (double) (this.length / 2.0F), this.locZ, 0.0D, 0.0D, 0.0D);
|
this.world.a("largeexplode", this.locX, this.locY + (double) (this.length / 2.0F), this.locZ, 0.0D, 0.0D, 0.0D);
|
||||||
|
if (!this.world.isStatic) {
|
||||||
|
EntityCow entitycow = new EntityCow(this.world);
|
||||||
|
|
||||||
for (int i = 0; i < 5; ++i) {
|
entitycow.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, this.pitch);
|
||||||
this.world.addEntity(new EntityItem(this.world, this.locX, this.locY + (double) this.length, this.locZ, new ItemStack(Block.RED_MUSHROOM)));
|
entitycow.setHealth(this.getHealth());
|
||||||
|
entitycow.V = this.V;
|
||||||
|
this.world.addEntity(entitycow);
|
||||||
|
|
||||||
|
for (int i = 0; i < 5; ++i) {
|
||||||
|
this.world.addEntity(new EntityItem(this.world, this.locX, this.locY + (double) this.length, this.locZ, new ItemStack(Block.RED_MUSHROOM)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -43,7 +45,7 @@ public class EntityMushroomCow extends EntityCow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected EntityAnimal createChild(EntityAnimal entityanimal) {
|
public EntityAnimal createChild(EntityAnimal entityanimal) {
|
||||||
return new EntityMushroomCow(this.world);
|
return new EntityMushroomCow(this.world);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -120,7 +120,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 y_() {
|
public void G_() {
|
||||||
if (this.f++ == 100 && !this.world.isStatic) {
|
if (this.f++ == 100 && !this.world.isStatic) {
|
||||||
this.f = 0;
|
this.f = 0;
|
||||||
if (!this.survives()) {
|
if (!this.survives()) {
|
||||||
@ -207,7 +207,7 @@ public class EntityPainting extends Entity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean e_() {
|
public boolean o_() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -235,7 +235,7 @@ public class EntityPainting extends Entity {
|
|||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
this.die();
|
this.die();
|
||||||
this.aM();
|
this.aV();
|
||||||
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)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,6 +6,21 @@ public class EntityPig extends EntityAnimal {
|
|||||||
super(world);
|
super(world);
|
||||||
this.texture = "/mob/pig.png";
|
this.texture = "/mob/pig.png";
|
||||||
this.b(0.9F, 0.9F);
|
this.b(0.9F, 0.9F);
|
||||||
|
this.ak().a(true);
|
||||||
|
float f = 0.25F;
|
||||||
|
|
||||||
|
this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
||||||
|
this.goalSelector.a(1, new PathfinderGoalPanic(this, 0.38F));
|
||||||
|
this.goalSelector.a(2, new PathfinderGoalBreed(this, f));
|
||||||
|
this.goalSelector.a(3, new PathfinderGoalTempt(this, 0.25F, Item.WHEAT.id, false));
|
||||||
|
this.goalSelector.a(4, new PathfinderGoalFollowParent(this, 0.28F));
|
||||||
|
this.goalSelector.a(5, new PathfinderGoalRandomStroll(this, f));
|
||||||
|
this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F));
|
||||||
|
this.goalSelector.a(7, new PathfinderGoalRandomLookaround(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean c_() {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMaxHealth() {
|
public int getMaxHealth() {
|
||||||
@ -27,15 +42,15 @@ public class EntityPig extends EntityAnimal {
|
|||||||
this.setSaddle(nbttagcompound.getBoolean("Saddle"));
|
this.setSaddle(nbttagcompound.getBoolean("Saddle"));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String c_() {
|
protected String i() {
|
||||||
return "mob.pig";
|
return "mob.pig";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String m() {
|
protected String j() {
|
||||||
return "mob.pig";
|
return "mob.pig";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String n() {
|
protected String k() {
|
||||||
return "mob.pigdeath";
|
return "mob.pigdeath";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,14 +98,14 @@ public class EntityPig extends EntityAnimal {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void b(float f) {
|
protected void a(float f) {
|
||||||
super.b(f);
|
super.a(f);
|
||||||
if (f > 5.0F && this.passenger instanceof EntityHuman) {
|
if (f > 5.0F && this.passenger instanceof EntityHuman) {
|
||||||
((EntityHuman) this.passenger).a((Statistic) AchievementList.u);
|
((EntityHuman) this.passenger).a((Statistic) AchievementList.u);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected EntityAnimal createChild(EntityAnimal entityanimal) {
|
public EntityAnimal createChild(EntityAnimal entityanimal) {
|
||||||
return new EntityPig(this.world);
|
return new EntityPig(this.world);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,17 +23,17 @@ public class EntityPigZombie extends EntityZombie {
|
|||||||
this.fireProof = true;
|
this.fireProof = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean as() {
|
protected boolean c_() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void y_() {
|
public void G_() {
|
||||||
this.bb = this.target != null ? 0.95F : 0.5F;
|
this.bb = 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.o() * 2.0F, ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F) * 1.8F);
|
this.world.makeSound(this, "mob.zombiepig.zpigangry", this.p() * 2.0F, ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F) * 1.8F);
|
||||||
}
|
}
|
||||||
|
|
||||||
super.y_();
|
super.G_();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canSpawn() {
|
public boolean canSpawn() {
|
||||||
@ -54,8 +54,8 @@ public class EntityPigZombie extends EntityZombie {
|
|||||||
return this.angerLevel == 0 ? null : super.findTarget();
|
return this.angerLevel == 0 ? null : super.findTarget();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void d() {
|
public void e() {
|
||||||
super.d();
|
super.e();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||||
@ -70,17 +70,17 @@ public class EntityPigZombie extends EntityZombie {
|
|||||||
if (entity1 instanceof EntityPigZombie) {
|
if (entity1 instanceof EntityPigZombie) {
|
||||||
EntityPigZombie entitypigzombie = (EntityPigZombie) entity1;
|
EntityPigZombie entitypigzombie = (EntityPigZombie) entity1;
|
||||||
|
|
||||||
entitypigzombie.f(entity);
|
entitypigzombie.e(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.f(entity);
|
this.e(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.damageEntity(damagesource, i);
|
return super.damageEntity(damagesource, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void f(Entity entity) {
|
private void e(Entity entity) {
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
org.bukkit.entity.Entity bukkitTarget = entity == null ? null : entity.getBukkitEntity();
|
org.bukkit.entity.Entity bukkitTarget = entity == null ? null : entity.getBukkitEntity();
|
||||||
|
|
||||||
@ -103,15 +103,15 @@ public class EntityPigZombie extends EntityZombie {
|
|||||||
this.soundDelay = this.random.nextInt(40);
|
this.soundDelay = this.random.nextInt(40);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String c_() {
|
protected String i() {
|
||||||
return "mob.zombiepig.zpig";
|
return "mob.zombiepig.zpig";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String m() {
|
protected String j() {
|
||||||
return "mob.zombiepig.zpighurt";
|
return "mob.zombiepig.zpighurt";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String n() {
|
protected String k() {
|
||||||
return "mob.zombiepig.zpigdeath";
|
return "mob.zombiepig.zpigdeath";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -135,6 +135,25 @@ public class EntityPigZombie extends EntityZombie {
|
|||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void b(int i) {
|
||||||
|
if (i > 0) {
|
||||||
|
ItemStack itemstack = new ItemStack(Item.GOLD_SWORD);
|
||||||
|
|
||||||
|
EnchantmentManager.a(this.random, itemstack, 5);
|
||||||
|
this.a(itemstack, 0.0F);
|
||||||
|
} else {
|
||||||
|
int j = this.random.nextInt(3);
|
||||||
|
|
||||||
|
if (j == 0) {
|
||||||
|
this.b(Item.GOLD_INGOT.id, 1);
|
||||||
|
} else if (j == 1) {
|
||||||
|
this.b(Item.GOLD_SWORD.id, 1);
|
||||||
|
} else if (j == 2) {
|
||||||
|
this.b(Item.GOLD_HELMET.id, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected int getLootId() {
|
protected int getLootId() {
|
||||||
return Item.ROTTEN_FLESH.id;
|
return Item.ROTTEN_FLESH.id;
|
||||||
}
|
}
|
||||||
|
@ -46,9 +46,9 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
|||||||
int j = chunkcoordinates.z;
|
int j = chunkcoordinates.z;
|
||||||
int k = chunkcoordinates.y;
|
int k = chunkcoordinates.y;
|
||||||
|
|
||||||
if (!world.worldProvider.f) {
|
if (!world.worldProvider.e) {
|
||||||
i += this.random.nextInt(20) - 10;
|
i += this.random.nextInt(20) - 10;
|
||||||
k = world.f(i, j);
|
k = world.g(i, j);
|
||||||
j += this.random.nextInt(20) - 10;
|
j += this.random.nextInt(20) - 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,7 +127,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
|||||||
return this.ck;
|
return this.ck;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void r_() {
|
protected void A() {
|
||||||
this.height = 0.0F;
|
this.height = 0.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -135,7 +135,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
|||||||
return 1.62F;
|
return 1.62F;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void y_() {
|
public void G_() {
|
||||||
this.itemInWorldManager.c();
|
this.itemInWorldManager.c();
|
||||||
--this.invulnerableTicks;
|
--this.invulnerableTicks;
|
||||||
this.activeContainer.a();
|
this.activeContainer.a();
|
||||||
@ -216,7 +216,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean z() {
|
protected boolean C_() {
|
||||||
return this.server.pvpMode;
|
return this.server.pvpMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -225,12 +225,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void a(boolean flag) {
|
public void a(boolean flag) {
|
||||||
super.y_();
|
super.G_();
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
if (itemstack != null && Item.byId[itemstack.id].n_() && this.netServerHandler.lowPriorityCount() <= 2) {
|
if (itemstack != null && Item.byId[itemstack.id].t_() && this.netServerHandler.lowPriorityCount() <= 2) {
|
||||||
Packet packet = ((ItemWorldMapBase) Item.byId[itemstack.id]).c(itemstack, this.world, this);
|
Packet packet = ((ItemWorldMapBase) Item.byId[itemstack.id]).c(itemstack, this.world, this);
|
||||||
|
|
||||||
if (packet != null) {
|
if (packet != null) {
|
||||||
@ -241,6 +241,17 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
|||||||
|
|
||||||
if (flag && !this.chunkCoordIntPairQueue.isEmpty()) {
|
if (flag && !this.chunkCoordIntPairQueue.isEmpty()) {
|
||||||
ChunkCoordIntPair chunkcoordintpair = (ChunkCoordIntPair) this.chunkCoordIntPairQueue.get(0);
|
ChunkCoordIntPair chunkcoordintpair = (ChunkCoordIntPair) this.chunkCoordIntPairQueue.get(0);
|
||||||
|
double d0 = chunkcoordintpair.a(this);
|
||||||
|
|
||||||
|
for (int j = 0; j < this.chunkCoordIntPairQueue.size(); ++j) {
|
||||||
|
ChunkCoordIntPair chunkcoordintpair1 = (ChunkCoordIntPair) this.chunkCoordIntPairQueue.get(j);
|
||||||
|
double d1 = chunkcoordintpair1.a(this);
|
||||||
|
|
||||||
|
if (d1 < d0) {
|
||||||
|
chunkcoordintpair = chunkcoordintpair1;
|
||||||
|
d0 = d1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (chunkcoordintpair != null) {
|
if (chunkcoordintpair != null) {
|
||||||
boolean flag1 = false;
|
boolean flag1 = false;
|
||||||
@ -253,12 +264,18 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
|||||||
if (flag1) {
|
if (flag1) {
|
||||||
WorldServer worldserver = this.server.getWorldServer(this.dimension);
|
WorldServer worldserver = this.server.getWorldServer(this.dimension);
|
||||||
|
|
||||||
this.chunkCoordIntPairQueue.remove(chunkcoordintpair);
|
if (worldserver.isLoaded(chunkcoordintpair.x << 4, 0, chunkcoordintpair.z << 4)) {
|
||||||
this.netServerHandler.sendPacket(new Packet51MapChunk(chunkcoordintpair.x * 16, 0, chunkcoordintpair.z * 16, 16, worldserver.height, 16, worldserver));
|
Chunk chunk = worldserver.getChunkAt(chunkcoordintpair.x, chunkcoordintpair.z);
|
||||||
List list = worldserver.getTileEntities(chunkcoordintpair.x * 16, 0, chunkcoordintpair.z * 16, chunkcoordintpair.x * 16 + 16, worldserver.height, chunkcoordintpair.z * 16 + 16);
|
|
||||||
|
|
||||||
for (int j = 0; j < list.size(); ++j) {
|
if (chunk.done) {
|
||||||
this.a((TileEntity) list.get(j));
|
this.chunkCoordIntPairQueue.remove(chunkcoordintpair);
|
||||||
|
this.netServerHandler.sendPacket(new Packet51MapChunk(worldserver.getChunkAt(chunkcoordintpair.x, chunkcoordintpair.z), true, 0));
|
||||||
|
List list = worldserver.getTileEntities(chunkcoordintpair.x * 16, 0, chunkcoordintpair.z * 16, chunkcoordintpair.x * 16 + 16, 256, chunkcoordintpair.z * 16 + 16);
|
||||||
|
|
||||||
|
for (int k = 0; k < list.size(); ++k) {
|
||||||
|
this.a((TileEntity) list.get(k));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -359,7 +376,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
|||||||
|
|
||||||
private void a(TileEntity tileentity) {
|
private void a(TileEntity tileentity) {
|
||||||
if (tileentity != null) {
|
if (tileentity != null) {
|
||||||
Packet packet = tileentity.k();
|
Packet packet = tileentity.d();
|
||||||
|
|
||||||
if (packet != null) {
|
if (packet != null) {
|
||||||
this.netServerHandler.sendPacket(packet);
|
this.netServerHandler.sendPacket(packet);
|
||||||
@ -388,7 +405,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
|||||||
this.activeContainer.a();
|
this.activeContainer.a();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void s_() {
|
public void D() {
|
||||||
if (!this.t) {
|
if (!this.t) {
|
||||||
this.u = -1;
|
this.u = -1;
|
||||||
this.t = true;
|
this.t = true;
|
||||||
@ -398,7 +415,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void B() {}
|
public void E() {}
|
||||||
|
|
||||||
public EnumBedResult a(int i, int j, int k) {
|
public EnumBedResult a(int i, int j, int k) {
|
||||||
EnumBedResult enumbedresult = super.a(i, j, k);
|
EnumBedResult enumbedresult = super.a(i, j, k);
|
||||||
@ -563,7 +580,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
|||||||
|
|
||||||
public void closeInventory() {
|
public void closeInventory() {
|
||||||
this.netServerHandler.sendPacket(new Packet101CloseWindow(this.activeContainer.windowId));
|
this.netServerHandler.sendPacket(new Packet101CloseWindow(this.activeContainer.windowId));
|
||||||
this.E();
|
this.H();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void broadcastCarriedItem() {
|
public void broadcastCarriedItem() {
|
||||||
@ -572,7 +589,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void E() {
|
public void H() {
|
||||||
this.activeContainer.a((EntityHuman) this);
|
this.activeContainer.a((EntityHuman) this);
|
||||||
this.activeContainer = this.defaultContainer;
|
this.activeContainer = this.defaultContainer;
|
||||||
}
|
}
|
||||||
@ -590,7 +607,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void F() {
|
public void I() {
|
||||||
if (this.vehicle != null) {
|
if (this.vehicle != null) {
|
||||||
this.mount(this.vehicle);
|
this.mount(this.vehicle);
|
||||||
}
|
}
|
||||||
@ -604,7 +621,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void t_() {
|
public void J() {
|
||||||
this.cf = -99999999;
|
this.cf = -99999999;
|
||||||
this.lastSentExp = -1; // CraftBukkit - Added to reset
|
this.lastSentExp = -1; // CraftBukkit - Added to reset
|
||||||
}
|
}
|
||||||
@ -616,9 +633,9 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
|||||||
this.netServerHandler.sendPacket(new Packet3Chat(s1));
|
this.netServerHandler.sendPacket(new Packet3Chat(s1));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void H() {
|
protected void K() {
|
||||||
this.netServerHandler.sendPacket(new Packet38EntityStatus(this.id, (byte) 9));
|
this.netServerHandler.sendPacket(new Packet38EntityStatus(this.id, (byte) 9));
|
||||||
super.H();
|
super.K();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void a(ItemStack itemstack, int i) {
|
public void a(ItemStack itemstack, int i) {
|
||||||
|
@ -63,7 +63,7 @@ public class EntityPotion extends EntityProjectile {
|
|||||||
|
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
Entity entity = (Entity) iterator.next();
|
Entity entity = (Entity) iterator.next();
|
||||||
double d0 = this.i(entity);
|
double d0 = this.j(entity);
|
||||||
|
|
||||||
if (d0 < 16.0D) {
|
if (d0 < 16.0D) {
|
||||||
double d1 = 1.0D - Math.sqrt(d0) / 4.0D;
|
double d1 = 1.0D - Math.sqrt(d0) / 4.0D;
|
||||||
|
@ -82,11 +82,11 @@ public abstract class EntityProjectile extends Entity {
|
|||||||
this.h = 0;
|
this.h = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void y_() {
|
public void G_() {
|
||||||
this.bL = this.locX;
|
this.bL = this.locX;
|
||||||
this.bM = this.locY;
|
this.bM = this.locY;
|
||||||
this.bN = this.locZ;
|
this.bN = this.locZ;
|
||||||
super.y_();
|
super.G_();
|
||||||
if (this.shake > 0) {
|
if (this.shake > 0) {
|
||||||
--this.shake;
|
--this.shake;
|
||||||
}
|
}
|
||||||
@ -131,7 +131,7 @@ public abstract class EntityProjectile 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.e_() && (entity1 != this.shooter || this.i >= 5)) {
|
if (entity1.o_() && (entity1 != this.shooter || this.i >= 5)) {
|
||||||
float f = 0.3F;
|
float f = 0.3F;
|
||||||
AxisAlignedBB axisalignedbb = entity1.boundingBox.grow((double) f, (double) f, (double) f);
|
AxisAlignedBB axisalignedbb = entity1.boundingBox.grow((double) f, (double) f, (double) f);
|
||||||
MovingObjectPosition movingobjectposition1 = axisalignedbb.a(vec3d, vec3d1);
|
MovingObjectPosition movingobjectposition1 = axisalignedbb.a(vec3d, vec3d1);
|
||||||
@ -190,7 +190,7 @@ public abstract class EntityProjectile extends Entity {
|
|||||||
float f2 = 0.99F;
|
float f2 = 0.99F;
|
||||||
float f3 = this.e();
|
float f3 = this.e();
|
||||||
|
|
||||||
if (this.aK()) {
|
if (this.aT()) {
|
||||||
for (int k = 0; k < 4; ++k) {
|
for (int k = 0; k < 4; ++k) {
|
||||||
float f4 = 0.25F;
|
float f4 = 0.25F;
|
||||||
|
|
||||||
|
@ -12,11 +12,41 @@ public class EntitySheep extends EntityAnimal {
|
|||||||
|
|
||||||
public static final float[][] a = new float[][] { { 1.0F, 1.0F, 1.0F}, { 0.95F, 0.7F, 0.2F}, { 0.9F, 0.5F, 0.85F}, { 0.6F, 0.7F, 0.95F}, { 0.9F, 0.9F, 0.2F}, { 0.5F, 0.8F, 0.1F}, { 0.95F, 0.7F, 0.8F}, { 0.3F, 0.3F, 0.3F}, { 0.6F, 0.6F, 0.6F}, { 0.3F, 0.6F, 0.7F}, { 0.7F, 0.4F, 0.9F}, { 0.2F, 0.4F, 0.8F}, { 0.5F, 0.4F, 0.3F}, { 0.4F, 0.5F, 0.2F}, { 0.8F, 0.3F, 0.3F}, { 0.1F, 0.1F, 0.1F}};
|
public static final float[][] a = new float[][] { { 1.0F, 1.0F, 1.0F}, { 0.95F, 0.7F, 0.2F}, { 0.9F, 0.5F, 0.85F}, { 0.6F, 0.7F, 0.95F}, { 0.9F, 0.9F, 0.2F}, { 0.5F, 0.8F, 0.1F}, { 0.95F, 0.7F, 0.8F}, { 0.3F, 0.3F, 0.3F}, { 0.6F, 0.6F, 0.6F}, { 0.3F, 0.6F, 0.7F}, { 0.7F, 0.4F, 0.9F}, { 0.2F, 0.4F, 0.8F}, { 0.5F, 0.4F, 0.3F}, { 0.4F, 0.5F, 0.2F}, { 0.8F, 0.3F, 0.3F}, { 0.1F, 0.1F, 0.1F}};
|
||||||
private int b;
|
private int b;
|
||||||
|
private PathfinderGoalEatTile c = new PathfinderGoalEatTile(this);
|
||||||
|
|
||||||
public EntitySheep(World world) {
|
public EntitySheep(World world) {
|
||||||
super(world);
|
super(world);
|
||||||
this.texture = "/mob/sheep.png";
|
this.texture = "/mob/sheep.png";
|
||||||
this.b(0.9F, 1.3F);
|
this.b(0.9F, 1.3F);
|
||||||
|
float f = 0.23F;
|
||||||
|
|
||||||
|
this.ak().a(true);
|
||||||
|
this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
||||||
|
this.goalSelector.a(1, new PathfinderGoalPanic(this, 0.38F));
|
||||||
|
this.goalSelector.a(2, new PathfinderGoalBreed(this, f));
|
||||||
|
this.goalSelector.a(3, new PathfinderGoalTempt(this, 0.25F, Item.WHEAT.id, false));
|
||||||
|
this.goalSelector.a(4, new PathfinderGoalFollowParent(this, 0.25F));
|
||||||
|
this.goalSelector.a(5, this.c);
|
||||||
|
this.goalSelector.a(6, new PathfinderGoalRandomStroll(this, f));
|
||||||
|
this.goalSelector.a(7, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F));
|
||||||
|
this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean c_() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void z_() {
|
||||||
|
this.b = this.c.f();
|
||||||
|
super.z_();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void e() {
|
||||||
|
if (this.world.isStatic) {
|
||||||
|
this.b = Math.max(0, this.b - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
super.e();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMaxHealth() {
|
public int getMaxHealth() {
|
||||||
@ -44,86 +74,6 @@ public class EntitySheep extends EntityAnimal {
|
|||||||
return Block.WOOL.id;
|
return Block.WOOL.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void d() {
|
|
||||||
super.d();
|
|
||||||
if (this.b > 0) {
|
|
||||||
--this.b;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void o_() {
|
|
||||||
if (this.b <= 0) {
|
|
||||||
super.o_();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void m_() {
|
|
||||||
super.m_();
|
|
||||||
int i;
|
|
||||||
int j;
|
|
||||||
int k;
|
|
||||||
|
|
||||||
if (!this.E() && this.b <= 0 && (this.isBaby() && this.random.nextInt(50) == 0 || this.random.nextInt(1000) == 0)) {
|
|
||||||
i = MathHelper.floor(this.locX);
|
|
||||||
j = MathHelper.floor(this.locY);
|
|
||||||
k = MathHelper.floor(this.locZ);
|
|
||||||
if (this.world.getTypeId(i, j, k) == Block.LONG_GRASS.id && this.world.getData(i, j, k) == 1 || this.world.getTypeId(i, j - 1, k) == Block.GRASS.id) {
|
|
||||||
this.b = 40;
|
|
||||||
this.world.broadcastEntityEffect(this, (byte) 10);
|
|
||||||
}
|
|
||||||
} else if (this.b == 4) {
|
|
||||||
i = MathHelper.floor(this.locX);
|
|
||||||
j = MathHelper.floor(this.locY);
|
|
||||||
k = MathHelper.floor(this.locZ);
|
|
||||||
boolean flag = false;
|
|
||||||
|
|
||||||
if (this.world.getTypeId(i, j, k) == Block.LONG_GRASS.id) {
|
|
||||||
// CraftBukkit start
|
|
||||||
if (!CraftEventFactory.callEntityChangeBlockEvent(this.getBukkitEntity(), this.world.getWorld().getBlockAt(i, j, k), Material.AIR).isCancelled()) {
|
|
||||||
this.world.triggerEffect(2001, i, j, k, Block.LONG_GRASS.id + 256);
|
|
||||||
this.world.setTypeId(i, j, k, 0);
|
|
||||||
flag = true;
|
|
||||||
}
|
|
||||||
// CraftBukkit end
|
|
||||||
} else if (this.world.getTypeId(i, j - 1, k) == Block.GRASS.id) {
|
|
||||||
// CraftBukkit start
|
|
||||||
if (!CraftEventFactory.callEntityChangeBlockEvent(this.getBukkitEntity(), this.world.getWorld().getBlockAt(i, j - 1, k), Material.DIRT).isCancelled()) {
|
|
||||||
this.world.triggerEffect(2001, i, j - 1, k, Block.GRASS.id);
|
|
||||||
this.world.setTypeId(i, j - 1, k, Block.DIRT.id);
|
|
||||||
flag = true;
|
|
||||||
}
|
|
||||||
// CraftBukkit end
|
|
||||||
}
|
|
||||||
|
|
||||||
if (flag) {
|
|
||||||
// CraftBukkit start
|
|
||||||
if (!this.isBaby()) {
|
|
||||||
org.bukkit.event.entity.SheepRegrowWoolEvent event = new org.bukkit.event.entity.SheepRegrowWoolEvent((Sheep) this.getBukkitEntity());
|
|
||||||
this.world.getServer().getPluginManager().callEvent(event);
|
|
||||||
|
|
||||||
if (!event.isCancelled()) {
|
|
||||||
this.setSheared(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// CraftBukkit end
|
|
||||||
|
|
||||||
if (this.isBaby()) {
|
|
||||||
int l = this.getAge() + 1200;
|
|
||||||
|
|
||||||
if (l > 0) {
|
|
||||||
l = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.setAge(l);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected boolean v() {
|
|
||||||
return this.b > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean b(EntityHuman entityhuman) {
|
public boolean b(EntityHuman entityhuman) {
|
||||||
ItemStack itemstack = entityhuman.inventory.getItemInHand();
|
ItemStack itemstack = entityhuman.inventory.getItemInHand();
|
||||||
|
|
||||||
@ -168,15 +118,15 @@ public class EntitySheep extends EntityAnimal {
|
|||||||
this.setColor(nbttagcompound.getByte("Color"));
|
this.setColor(nbttagcompound.getByte("Color"));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String c_() {
|
protected String i() {
|
||||||
return "mob.sheep";
|
return "mob.sheep";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String m() {
|
protected String j() {
|
||||||
return "mob.sheep";
|
return "mob.sheep";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String n() {
|
protected String k() {
|
||||||
return "mob.sheep";
|
return "mob.sheep";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -210,7 +160,7 @@ public class EntitySheep extends EntityAnimal {
|
|||||||
return i < 5 ? 15 : (i < 10 ? 7 : (i < 15 ? 8 : (i < 18 ? 12 : (random.nextInt(500) == 0 ? 6 : 0))));
|
return i < 5 ? 15 : (i < 10 ? 7 : (i < 15 ? 8 : (i < 18 ? 12 : (random.nextInt(500) == 0 ? 6 : 0))));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected EntityAnimal createChild(EntityAnimal entityanimal) {
|
public EntityAnimal createChild(EntityAnimal entityanimal) {
|
||||||
EntitySheep entitysheep = (EntitySheep) entityanimal;
|
EntitySheep entitysheep = (EntitySheep) entityanimal;
|
||||||
EntitySheep entitysheep1 = new EntitySheep(this.world);
|
EntitySheep entitysheep1 = new EntitySheep(this.world);
|
||||||
|
|
||||||
@ -222,4 +172,25 @@ public class EntitySheep extends EntityAnimal {
|
|||||||
|
|
||||||
return entitysheep1;
|
return entitysheep1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void z() {
|
||||||
|
// CraftBukkit start
|
||||||
|
org.bukkit.event.entity.SheepRegrowWoolEvent event = new org.bukkit.event.entity.SheepRegrowWoolEvent((Sheep) this.getBukkitEntity());
|
||||||
|
this.world.getServer().getPluginManager().callEvent(event);
|
||||||
|
|
||||||
|
if (!event.isCancelled()) {
|
||||||
|
this.setSheared(false);
|
||||||
|
}
|
||||||
|
// CraftBukkit end
|
||||||
|
|
||||||
|
if (this.isBaby()) {
|
||||||
|
int i = this.getAge() + 1200;
|
||||||
|
|
||||||
|
if (i > 0) {
|
||||||
|
i = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setAge(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,26 +14,52 @@ public class EntitySkeleton extends EntityMonster {
|
|||||||
public EntitySkeleton(World world) {
|
public EntitySkeleton(World world) {
|
||||||
super(world);
|
super(world);
|
||||||
this.texture = "/mob/skeleton.png";
|
this.texture = "/mob/skeleton.png";
|
||||||
|
this.bb = 0.25F;
|
||||||
|
this.goalSelector.a(1, new PathfinderGoalFloat(this));
|
||||||
|
this.goalSelector.a(2, new PathfinderGoalRestrictSun(this));
|
||||||
|
this.goalSelector.a(3, new PathfinderGoalFleeSun(this, this.bb));
|
||||||
|
this.goalSelector.a(4, new PathfinderGoalArrowAttack(this, this.bb, 1, 60));
|
||||||
|
this.goalSelector.a(5, new PathfinderGoalRandomStroll(this, this.bb));
|
||||||
|
this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F));
|
||||||
|
this.goalSelector.a(6, new PathfinderGoalRandomLookaround(this));
|
||||||
|
this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this, false));
|
||||||
|
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget(this, EntityHuman.class, 16.0F, 0, false));
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean c_() {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMaxHealth() {
|
public int getMaxHealth() {
|
||||||
return 20;
|
return 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String c_() {
|
protected String i() {
|
||||||
return "mob.skeleton";
|
return "mob.skeleton";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String m() {
|
protected String j() {
|
||||||
return "mob.skeletonhurt";
|
return "mob.skeletonhurt";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String n() {
|
protected String k() {
|
||||||
return "mob.skeletonhurt";
|
return "mob.skeletonhurt";
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
public MonsterType getMonsterType() {
|
||||||
return super.damageEntity(damagesource, i);
|
return MonsterType.UNDEAD;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void e() {
|
||||||
|
if (this.world.e() && !this.world.isStatic) {
|
||||||
|
float f = this.b(1.0F);
|
||||||
|
|
||||||
|
if (f > 0.5F && this.world.isChunkLoaded(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) {
|
||||||
|
this.setOnFire(8);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
super.e();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void die(DamageSource damagesource) {
|
public void die(DamageSource damagesource) {
|
||||||
@ -49,66 +75,6 @@ public class EntitySkeleton extends EntityMonster {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void d() {
|
|
||||||
if (this.world.e() && !this.world.isStatic) {
|
|
||||||
float f = this.a(1.0F);
|
|
||||||
|
|
||||||
if (f > 0.5F && this.world.isChunkLoaded(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) {
|
|
||||||
// CraftBukkit start
|
|
||||||
EntityCombustEvent event = new EntityCombustEvent(this.getBukkitEntity(), 8);
|
|
||||||
this.world.getServer().getPluginManager().callEvent(event);
|
|
||||||
|
|
||||||
if (!event.isCancelled()) {
|
|
||||||
this.setOnFire(event.getDuration());
|
|
||||||
}
|
|
||||||
// CraftBukkit end
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
super.d();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void a(Entity entity, float f) {
|
|
||||||
if (f < 10.0F) {
|
|
||||||
double d0 = entity.locX - this.locX;
|
|
||||||
double d1 = entity.locZ - this.locZ;
|
|
||||||
|
|
||||||
if (this.attackTicks == 0) {
|
|
||||||
EntityArrow entityarrow = new EntityArrow(this.world, this, 1.0F);
|
|
||||||
double d2 = entity.locY + (double) entity.getHeadHeight() - 0.699999988079071D - entityarrow.locY;
|
|
||||||
float f1 = MathHelper.sqrt(d0 * d0 + d1 * d1) * 0.2F;
|
|
||||||
|
|
||||||
// this.world.makeSound(this, "random.bow", 1.0F, 1.0F / (this.random.nextFloat() * 0.4F + 0.8F)); // CraftBukkit - moved down
|
|
||||||
// this.world.addEntity(entityarrow); // CraftBukkit - moved down
|
|
||||||
entityarrow.shoot(d0, d2 + (double) f1, d1, 1.6F, 12.0F);
|
|
||||||
this.attackTicks = 60;
|
|
||||||
|
|
||||||
// CraftBukkit start
|
|
||||||
EntityShootBowEvent event = CraftEventFactory.callEntityShootBowEvent(this, null, entityarrow, 0.5F);
|
|
||||||
if (event.isCancelled()) {
|
|
||||||
if (event.getProjectile() != null) {
|
|
||||||
event.getProjectile().remove();
|
|
||||||
}
|
|
||||||
} else if (event.getProjectile() == entityarrow.getBukkitEntity()) {
|
|
||||||
world.addEntity(entityarrow);
|
|
||||||
}
|
|
||||||
this.world.makeSound(this, "random.bow", 1.0F, 1.0F / (this.random.nextFloat() * 0.4F + 0.8F));
|
|
||||||
// CraftBukkit end
|
|
||||||
}
|
|
||||||
|
|
||||||
this.yaw = (float) (Math.atan2(d1, d0) * 180.0D / 3.1415927410125732D) - 90.0F;
|
|
||||||
this.e = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void b(NBTTagCompound nbttagcompound) {
|
|
||||||
super.b(nbttagcompound);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void a(NBTTagCompound nbttagcompound) {
|
|
||||||
super.a(nbttagcompound);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected int getLootId() {
|
protected int getLootId() {
|
||||||
return Item.ARROW.id;
|
return Item.ARROW.id;
|
||||||
}
|
}
|
||||||
@ -131,7 +97,14 @@ public class EntitySkeleton extends EntityMonster {
|
|||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
}
|
}
|
||||||
|
|
||||||
public MonsterType getMonsterType() {
|
protected void b(int i) {
|
||||||
return MonsterType.UNDEAD;
|
if (i > 0) {
|
||||||
|
ItemStack itemstack = new ItemStack(Item.BOW);
|
||||||
|
|
||||||
|
EnchantmentManager.a(this.random, itemstack, 5);
|
||||||
|
this.a(itemstack, 0.0F);
|
||||||
|
} else {
|
||||||
|
this.b(Item.BOW.id, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,15 +52,15 @@ public class EntitySlime extends EntityLiving implements IMonster {
|
|||||||
this.setSize(nbttagcompound.getInt("Size") + 1);
|
this.setSize(nbttagcompound.getInt("Size") + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String v() {
|
protected String A() {
|
||||||
return "slime";
|
return "slime";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String F() {
|
protected String J() {
|
||||||
return "mob.slime";
|
return "mob.slime";
|
||||||
}
|
}
|
||||||
|
|
||||||
public void y_() {
|
public void G_() {
|
||||||
if (!this.world.isStatic && this.world.difficulty == 0 && this.getSize() > 0) {
|
if (!this.world.isStatic && this.world.difficulty == 0 && this.getSize() > 0) {
|
||||||
this.dead = true;
|
this.dead = true;
|
||||||
}
|
}
|
||||||
@ -69,7 +69,7 @@ public class EntitySlime extends EntityLiving implements IMonster {
|
|||||||
this.c = this.b;
|
this.c = this.b;
|
||||||
boolean flag = this.onGround;
|
boolean flag = this.onGround;
|
||||||
|
|
||||||
super.y_();
|
super.G_();
|
||||||
if (this.onGround && !flag) {
|
if (this.onGround && !flag) {
|
||||||
int i = this.getSize();
|
int i = this.getSize();
|
||||||
|
|
||||||
@ -79,21 +79,21 @@ public class EntitySlime extends EntityLiving implements IMonster {
|
|||||||
float f2 = MathHelper.sin(f) * (float) i * 0.5F * f1;
|
float f2 = MathHelper.sin(f) * (float) i * 0.5F * f1;
|
||||||
float f3 = MathHelper.cos(f) * (float) i * 0.5F * f1;
|
float f3 = MathHelper.cos(f) * (float) i * 0.5F * f1;
|
||||||
|
|
||||||
this.world.a(this.v(), this.locX + (double) f2, this.boundingBox.b, this.locZ + (double) f3, 0.0D, 0.0D, 0.0D);
|
this.world.a(this.A(), this.locX + (double) f2, this.boundingBox.b, this.locZ + (double) f3, 0.0D, 0.0D, 0.0D);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.H()) {
|
if (this.K()) {
|
||||||
this.world.makeSound(this, this.F(), this.o(), ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F) / 0.8F);
|
this.world.makeSound(this, this.J(), this.p(), ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F) / 0.8F);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.a = -0.5F;
|
this.a = -0.5F;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.C();
|
this.F();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void m_() {
|
protected void d_() {
|
||||||
this.au();
|
this.aF();
|
||||||
EntityHuman entityhuman = this.world.findNearbyVulnerablePlayer(this, 16.0D);
|
EntityHuman entityhuman = this.world.findNearbyVulnerablePlayer(this, 16.0D);
|
||||||
|
|
||||||
if (entityhuman != null) {
|
if (entityhuman != null) {
|
||||||
@ -101,14 +101,14 @@ public class EntitySlime extends EntityLiving implements IMonster {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.onGround && this.jumpDelay-- <= 0) {
|
if (this.onGround && this.jumpDelay-- <= 0) {
|
||||||
this.jumpDelay = this.B();
|
this.jumpDelay = this.E();
|
||||||
if (entityhuman != null) {
|
if (entityhuman != null) {
|
||||||
this.jumpDelay /= 3;
|
this.jumpDelay /= 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.aZ = true;
|
this.aZ = true;
|
||||||
if (this.J()) {
|
if (this.M()) {
|
||||||
this.world.makeSound(this, this.F(), this.o(), ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F) * 0.8F);
|
this.world.makeSound(this, this.J(), this.p(), ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F) * 0.8F);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.a = 1.0F;
|
this.a = 1.0F;
|
||||||
@ -122,15 +122,15 @@ public class EntitySlime extends EntityLiving implements IMonster {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void C() {
|
protected void F() {
|
||||||
this.a *= 0.6F;
|
this.a *= 0.6F;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected int B() {
|
protected int E() {
|
||||||
return this.random.nextInt(20) + 10;
|
return this.random.nextInt(20) + 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected EntitySlime z() {
|
protected EntitySlime D() {
|
||||||
return new EntitySlime(this.world);
|
return new EntitySlime(this.world);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -155,7 +155,7 @@ public class EntitySlime extends EntityLiving implements IMonster {
|
|||||||
for (int k = 0; k < j; ++k) {
|
for (int k = 0; k < j; ++k) {
|
||||||
float f = ((float) (k % 2) - 0.5F) * (float) i / 4.0F;
|
float f = ((float) (k % 2) - 0.5F) * (float) i / 4.0F;
|
||||||
float f1 = ((float) (k / 2) - 0.5F) * (float) i / 4.0F;
|
float f1 = ((float) (k / 2) - 0.5F) * (float) i / 4.0F;
|
||||||
EntitySlime entityslime = this.z();
|
EntitySlime entityslime = this.D();
|
||||||
|
|
||||||
entityslime.setSize(i / 2);
|
entityslime.setSize(i / 2);
|
||||||
entityslime.setPositionRotation(this.locX + (double) f, this.locY + 0.5D, this.locZ + (double) f1, this.random.nextFloat() * 360.0F, 0.0F);
|
entityslime.setPositionRotation(this.locX + (double) f, this.locY + 0.5D, this.locZ + (double) f1, this.random.nextFloat() * 360.0F, 0.0F);
|
||||||
@ -167,28 +167,28 @@ public class EntitySlime extends EntityLiving implements IMonster {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void a_(EntityHuman entityhuman) {
|
public void a_(EntityHuman entityhuman) {
|
||||||
if (this.D()) {
|
if (this.G()) {
|
||||||
int i = this.getSize();
|
int i = this.getSize();
|
||||||
|
|
||||||
if (this.g(entityhuman) && (double) this.h(entityhuman) < 0.6D * (double) i && entityhuman.damageEntity(DamageSource.mobAttack(this), this.E())) {
|
if (this.h(entityhuman) && (double) this.i(entityhuman) < 0.6D * (double) i && entityhuman.damageEntity(DamageSource.mobAttack(this), this.H())) {
|
||||||
this.world.makeSound(this, "mob.slimeattack", 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F);
|
this.world.makeSound(this, "mob.slimeattack", 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean D() {
|
protected boolean G() {
|
||||||
return this.getSize() > 1;
|
return this.getSize() > 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected int E() {
|
protected int H() {
|
||||||
return this.getSize();
|
return this.getSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String m() {
|
protected String j() {
|
||||||
return "mob.slime";
|
return "mob.slime";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String n() {
|
protected String k() {
|
||||||
return "mob.slime";
|
return "mob.slime";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -202,19 +202,19 @@ public class EntitySlime extends EntityLiving implements IMonster {
|
|||||||
return (this.getSize() == 1 || this.world.difficulty > 0) && this.random.nextInt(10) == 0 && chunk.a(987234911L).nextInt(10) == 0 && this.locY < 40.0D ? super.canSpawn() : false;
|
return (this.getSize() == 1 || this.world.difficulty > 0) && this.random.nextInt(10) == 0 && chunk.a(987234911L).nextInt(10) == 0 && this.locY < 40.0D ? super.canSpawn() : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected float o() {
|
protected float p() {
|
||||||
return 0.4F * (float) this.getSize();
|
return 0.4F * (float) this.getSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int x() {
|
public int C() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean J() {
|
protected boolean M() {
|
||||||
return this.getSize() > 1;
|
return this.getSize() > 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean H() {
|
protected boolean K() {
|
||||||
return this.getSize() > 2;
|
return this.getSize() > 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,11 @@ public class EntitySmallFireball extends EntityFireball {
|
|||||||
this.b(0.3125F, 0.3125F);
|
this.b(0.3125F, 0.3125F);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public EntitySmallFireball(World world, double d0, double d1, double d2, double d3, double d4, double d5) {
|
||||||
|
super(world, d0, d1, d2, d3, d4, d5);
|
||||||
|
this.b(0.3125F, 0.3125F);
|
||||||
|
}
|
||||||
|
|
||||||
protected void a(MovingObjectPosition movingobjectposition) {
|
protected void a(MovingObjectPosition movingobjectposition) {
|
||||||
if (!this.world.isStatic) {
|
if (!this.world.isStatic) {
|
||||||
// CraftBukkit start - projectile hit event
|
// CraftBukkit start - projectile hit event
|
||||||
@ -84,7 +89,7 @@ public class EntitySmallFireball extends EntityFireball {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean e_() {
|
public boolean o_() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,36 +13,41 @@ public class EntitySnowman extends EntityGolem {
|
|||||||
super(world);
|
super(world);
|
||||||
this.texture = "/mob/snowman.png";
|
this.texture = "/mob/snowman.png";
|
||||||
this.b(0.4F, 1.8F);
|
this.b(0.4F, 1.8F);
|
||||||
|
this.ak().a(true);
|
||||||
|
this.goalSelector.a(1, new PathfinderGoalArrowAttack(this, 0.25F, 2, 20));
|
||||||
|
this.goalSelector.a(2, new PathfinderGoalRandomStroll(this, 0.2F));
|
||||||
|
this.goalSelector.a(3, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F));
|
||||||
|
this.goalSelector.a(4, new PathfinderGoalRandomLookaround(this));
|
||||||
|
this.targetSelector.a(1, new PathfinderGoalNearestAttackableTarget(this, EntityMonster.class, 16.0F, 0, true));
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean c_() {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMaxHealth() {
|
public int getMaxHealth() {
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void d() {
|
public void e() {
|
||||||
super.d();
|
super.e();
|
||||||
if (this.target == null && !this.E() && this.world.random.nextInt(100) == 0) {
|
if (this.aS()) {
|
||||||
List list = this.world.a(EntityMonster.class, AxisAlignedBB.b(this.locX, this.locY, this.locZ, this.locX + 1.0D, this.locY + 1.0D, this.locZ + 1.0D).grow(16.0D, 4.0D, 16.0D));
|
this.damageEntity(DamageSource.DROWN, 1);
|
||||||
|
|
||||||
if (!list.isEmpty()) {
|
|
||||||
this.setTarget((Entity) list.get(this.world.random.nextInt(list.size())));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int i = MathHelper.floor(this.locX);
|
int i = MathHelper.floor(this.locX);
|
||||||
int j = MathHelper.floor(this.locY);
|
int j = MathHelper.floor(this.locZ);
|
||||||
int k = MathHelper.floor(this.locZ);
|
|
||||||
|
|
||||||
if (this.world.getWorldChunkManager().a(i, j, k) > 1.0F) {
|
if (this.world.getBiome(i, j).h() > 1.0F) {
|
||||||
this.damageEntity(DamageSource.BURN, 1);
|
this.damageEntity(DamageSource.BURN, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < 4; ++i) {
|
for (i = 0; i < 4; ++i) {
|
||||||
j = MathHelper.floor(this.locX + (double) ((float) (i % 2 * 2 - 1) * 0.25F));
|
j = MathHelper.floor(this.locX + (double) ((float) (i % 2 * 2 - 1) * 0.25F));
|
||||||
k = MathHelper.floor(this.locY);
|
int k = MathHelper.floor(this.locY);
|
||||||
int l = MathHelper.floor(this.locZ + (double) ((float) (i / 2 % 2 * 2 - 1) * 0.25F));
|
int l = MathHelper.floor(this.locZ + (double) ((float) (i / 2 % 2 * 2 - 1) * 0.25F));
|
||||||
|
|
||||||
if (this.world.getTypeId(j, k, l) == 0 && this.world.getWorldChunkManager().a(j, k, l) < 0.8F && Block.SNOW.canPlace(this.world, j, k, l)) {
|
if (this.world.getTypeId(j, k, l) == 0 && this.world.getBiome(j, l).h() < 0.8F && Block.SNOW.canPlace(this.world, j, k, l)) {
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
BlockState blockState = this.world.getWorld().getBlockAt(j, k, l).getState();
|
BlockState blockState = this.world.getWorld().getBlockAt(j, k, l).getState();
|
||||||
blockState.setTypeId(Block.SNOW.id);
|
blockState.setTypeId(Block.SNOW.id);
|
||||||
@ -58,27 +63,6 @@ public class EntitySnowman extends EntityGolem {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void a(Entity entity, float f) {
|
|
||||||
if (f < 10.0F) {
|
|
||||||
double d0 = entity.locX - this.locX;
|
|
||||||
double d1 = entity.locZ - this.locZ;
|
|
||||||
|
|
||||||
if (this.attackTicks == 0) {
|
|
||||||
EntitySnowball entitysnowball = new EntitySnowball(this.world, this);
|
|
||||||
double d2 = entity.locY + (double) entity.getHeadHeight() - 1.100000023841858D - entitysnowball.locY;
|
|
||||||
float f1 = MathHelper.sqrt(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.addEntity(entitysnowball);
|
|
||||||
entitysnowball.a(d0, d2 + (double) f1, d1, 1.6F, 12.0F);
|
|
||||||
this.attackTicks = 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.yaw = (float) (Math.atan2(d1, d0) * 180.0D / 3.1415927410125732D) - 90.0F;
|
|
||||||
this.e = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void b(NBTTagCompound nbttagcompound) {
|
public void b(NBTTagCompound nbttagcompound) {
|
||||||
super.b(nbttagcompound);
|
super.b(nbttagcompound);
|
||||||
}
|
}
|
||||||
|
@ -22,12 +22,12 @@ public class EntitySpider extends EntityMonster {
|
|||||||
this.datawatcher.a(16, new Byte((byte) 0));
|
this.datawatcher.a(16, new Byte((byte) 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void d() {
|
public void e() {
|
||||||
super.d();
|
super.e();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void y_() {
|
public void G_() {
|
||||||
super.y_();
|
super.G_();
|
||||||
if (!this.world.isStatic) {
|
if (!this.world.isStatic) {
|
||||||
this.a(this.positionChanged);
|
this.a(this.positionChanged);
|
||||||
}
|
}
|
||||||
@ -37,7 +37,7 @@ public class EntitySpider extends EntityMonster {
|
|||||||
return 16;
|
return 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double q() {
|
public double x_() {
|
||||||
return (double) this.length * 0.75D - 0.5D;
|
return (double) this.length * 0.75D - 0.5D;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ public class EntitySpider extends EntityMonster {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected Entity findTarget() {
|
protected Entity findTarget() {
|
||||||
float f = this.a(1.0F);
|
float f = this.b(1.0F);
|
||||||
|
|
||||||
if (f < 0.5F) {
|
if (f < 0.5F) {
|
||||||
double d0 = 16.0D;
|
double d0 = 16.0D;
|
||||||
@ -57,20 +57,20 @@ public class EntitySpider extends EntityMonster {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String c_() {
|
protected String i() {
|
||||||
return "mob.spider";
|
return "mob.spider";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String m() {
|
protected String j() {
|
||||||
return "mob.spider";
|
return "mob.spider";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String n() {
|
protected String k() {
|
||||||
return "mob.spiderdeath";
|
return "mob.spiderdeath";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void a(Entity entity, float f) {
|
protected void a(Entity entity, float f) {
|
||||||
float f1 = this.a(1.0F);
|
float f1 = this.b(1.0F);
|
||||||
|
|
||||||
if (f1 > 0.5F && this.random.nextInt(100) == 0) {
|
if (f1 > 0.5F && this.random.nextInt(100) == 0) {
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
@ -137,11 +137,11 @@ public class EntitySpider extends EntityMonster {
|
|||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean r() {
|
public boolean t() {
|
||||||
return this.u();
|
return this.w();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void s() {}
|
public void u() {}
|
||||||
|
|
||||||
public MonsterType getMonsterType() {
|
public MonsterType getMonsterType() {
|
||||||
return MonsterType.ARTHROPOD;
|
return MonsterType.ARTHROPOD;
|
||||||
@ -151,7 +151,7 @@ public class EntitySpider extends EntityMonster {
|
|||||||
return mobeffect.getEffectId() == MobEffectList.POISON.id ? false : super.a(mobeffect);
|
return mobeffect.getEffectId() == MobEffectList.POISON.id ? false : super.a(mobeffect);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean u() {
|
public boolean w() {
|
||||||
return (this.datawatcher.getByte(16) & 1) != 0;
|
return (this.datawatcher.getByte(16) & 1) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,19 +38,19 @@ public class EntitySquid extends EntityWaterAnimal {
|
|||||||
super.a(nbttagcompound);
|
super.a(nbttagcompound);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String c_() {
|
protected String i() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String m() {
|
protected String j() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String n() {
|
protected String k() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected float o() {
|
protected float p() {
|
||||||
return 0.4F;
|
return 0.4F;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,12 +75,12 @@ public class EntitySquid extends EntityWaterAnimal {
|
|||||||
return super.b(entityhuman);
|
return super.b(entityhuman);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean aK() {
|
public boolean aT() {
|
||||||
return this.world.a(this.boundingBox.grow(0.0D, -0.6000000238418579D, 0.0D), Material.WATER, this);
|
return this.world.a(this.boundingBox.grow(0.0D, -0.6000000238418579D, 0.0D), Material.WATER, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void d() {
|
public void e() {
|
||||||
super.d();
|
super.e();
|
||||||
this.b = this.a;
|
this.b = this.a;
|
||||||
this.g = this.c;
|
this.g = this.c;
|
||||||
this.i = this.h;
|
this.i = this.h;
|
||||||
@ -93,7 +93,7 @@ public class EntitySquid extends EntityWaterAnimal {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.aK()) {
|
if (this.aT()) {
|
||||||
float f;
|
float f;
|
||||||
|
|
||||||
if (this.h < 3.1415927F) {
|
if (this.h < 3.1415927F) {
|
||||||
@ -139,7 +139,7 @@ public class EntitySquid extends EntityWaterAnimal {
|
|||||||
this.move(this.motX, this.motY, this.motZ);
|
this.move(this.motX, this.motY, this.motZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void m_() {
|
protected void d_() {
|
||||||
++this.aV;
|
++this.aV;
|
||||||
if (this.aV > 100) {
|
if (this.aV > 100) {
|
||||||
this.o = this.p = this.q = 0.0F;
|
this.o = this.p = this.q = 0.0F;
|
||||||
@ -151,10 +151,10 @@ public class EntitySquid extends EntityWaterAnimal {
|
|||||||
this.q = MathHelper.sin(f) * 0.2F;
|
this.q = MathHelper.sin(f) * 0.2F;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.au();
|
this.aF();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canSpawn() {
|
public boolean canSpawn() {
|
||||||
return this.locY > 45.0D && this.locY < (double) this.world.seaLevel && super.canSpawn();
|
return this.locY > 45.0D && this.locY < 63.0D && super.canSpawn();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,9 +26,9 @@ public class EntityTNTPrimed extends Entity {
|
|||||||
this.setPosition(d0, d1, d2);
|
this.setPosition(d0, d1, d2);
|
||||||
float f = (float) (Math.random() * 3.1415927410125732D * 2.0D);
|
float f = (float) (Math.random() * 3.1415927410125732D * 2.0D);
|
||||||
|
|
||||||
this.motX = (double) (-MathHelper.sin(f * 3.1415927F / 180.0F) * 0.02F);
|
this.motX = (double) (-((float) Math.sin((double) f)) * 0.02F);
|
||||||
this.motY = 0.20000000298023224D;
|
this.motY = 0.20000000298023224D;
|
||||||
this.motZ = (double) (-MathHelper.cos(f * 3.1415927F / 180.0F) * 0.02F);
|
this.motZ = (double) (-((float) Math.cos((double) f)) * 0.02F);
|
||||||
this.fuseTicks = 80;
|
this.fuseTicks = 80;
|
||||||
this.lastX = d0;
|
this.lastX = d0;
|
||||||
this.lastY = d1;
|
this.lastY = d1;
|
||||||
@ -41,11 +41,11 @@ public class EntityTNTPrimed extends Entity {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean e_() {
|
public boolean o_() {
|
||||||
return !this.dead;
|
return !this.dead;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void y_() {
|
public void G_() {
|
||||||
this.lastX = this.locX;
|
this.lastX = this.locX;
|
||||||
this.lastY = this.locY;
|
this.lastY = this.locY;
|
||||||
this.lastZ = this.locZ;
|
this.lastZ = this.locZ;
|
||||||
|
@ -51,6 +51,8 @@ public class EntityTracker {
|
|||||||
this.addEntity(entity, 64, 10, true);
|
this.addEntity(entity, 64, 10, true);
|
||||||
} else if (entity instanceof EntityPotion) {
|
} else if (entity instanceof EntityPotion) {
|
||||||
this.addEntity(entity, 64, 10, true);
|
this.addEntity(entity, 64, 10, true);
|
||||||
|
} else if (entity instanceof EntityThrownExpBottle) {
|
||||||
|
this.addEntity(entity, 64, 10, true);
|
||||||
} else if (entity instanceof EntityItem) {
|
} else if (entity instanceof EntityItem) {
|
||||||
this.addEntity(entity, 64, 20, true);
|
this.addEntity(entity, 64, 20, true);
|
||||||
} else if (entity instanceof EntityMinecart) {
|
} else if (entity instanceof EntityMinecart) {
|
||||||
@ -128,7 +130,7 @@ public class EntityTracker {
|
|||||||
EntityTrackerEntry entitytrackerentry = (EntityTrackerEntry) iterator.next();
|
EntityTrackerEntry entitytrackerentry = (EntityTrackerEntry) iterator.next();
|
||||||
|
|
||||||
entitytrackerentry.track(this.world.players); // CraftBukkit
|
entitytrackerentry.track(this.world.players); // CraftBukkit
|
||||||
if (entitytrackerentry.m && entitytrackerentry.tracker instanceof EntityPlayer) {
|
if (entitytrackerentry.n && entitytrackerentry.tracker instanceof EntityPlayer) {
|
||||||
arraylist.add((EntityPlayer) entitytrackerentry.tracker);
|
arraylist.add((EntityPlayer) entitytrackerentry.tracker);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,17 +16,18 @@ public class EntityTrackerEntry {
|
|||||||
public int zLoc;
|
public int zLoc;
|
||||||
public int yRot;
|
public int yRot;
|
||||||
public int xRot;
|
public int xRot;
|
||||||
public double i;
|
public int i;
|
||||||
public double j;
|
public double j;
|
||||||
public double k;
|
public double k;
|
||||||
public int l = 0;
|
public double l;
|
||||||
private double o;
|
public int m = 0;
|
||||||
private double p;
|
private double p;
|
||||||
private double q;
|
private double q;
|
||||||
private boolean r = false;
|
private double r;
|
||||||
|
private boolean s = false;
|
||||||
private boolean isMoving;
|
private boolean isMoving;
|
||||||
private int t = 0;
|
private int u = 0;
|
||||||
public boolean m = false;
|
public boolean n = false;
|
||||||
public Set trackedPlayers = new HashSet();
|
public Set trackedPlayers = new HashSet();
|
||||||
|
|
||||||
public EntityTrackerEntry(Entity entity, int i, int j, boolean flag) {
|
public EntityTrackerEntry(Entity entity, int i, int j, boolean flag) {
|
||||||
@ -39,6 +40,7 @@ public class EntityTrackerEntry {
|
|||||||
this.zLoc = MathHelper.floor(entity.locZ * 32.0D);
|
this.zLoc = MathHelper.floor(entity.locZ * 32.0D);
|
||||||
this.yRot = MathHelper.d(entity.yaw * 256.0F / 360.0F);
|
this.yRot = MathHelper.d(entity.yaw * 256.0F / 360.0F);
|
||||||
this.xRot = MathHelper.d(entity.pitch * 256.0F / 360.0F);
|
this.xRot = MathHelper.d(entity.pitch * 256.0F / 360.0F);
|
||||||
|
this.i = MathHelper.d(entity.aq() * 256.0F / 360.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean equals(Object object) {
|
public boolean equals(Object object) {
|
||||||
@ -50,18 +52,18 @@ public class EntityTrackerEntry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void track(List list) {
|
public void track(List list) {
|
||||||
this.m = false;
|
this.n = false;
|
||||||
if (!this.r || this.tracker.e(this.o, this.p, this.q) > 16.0D) {
|
if (!this.s || this.tracker.e(this.p, this.q, this.r) > 16.0D) {
|
||||||
this.o = this.tracker.locX;
|
this.p = this.tracker.locX;
|
||||||
this.p = this.tracker.locY;
|
this.q = this.tracker.locY;
|
||||||
this.q = this.tracker.locZ;
|
this.r = this.tracker.locZ;
|
||||||
this.r = true;
|
this.s = true;
|
||||||
this.m = true;
|
this.n = true;
|
||||||
this.scanPlayers(list);
|
this.scanPlayers(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
++this.t;
|
++this.u;
|
||||||
if (++this.l % this.c == 0 || this.tracker.ce) {
|
if (this.m++ % this.c == 0 || this.tracker.ce) {
|
||||||
int i = MathHelper.floor(this.tracker.locX * 32.0D);
|
int i = MathHelper.floor(this.tracker.locX * 32.0D);
|
||||||
int j = MathHelper.floor(this.tracker.locY * 32.0D);
|
int j = MathHelper.floor(this.tracker.locY * 32.0D);
|
||||||
int k = MathHelper.floor(this.tracker.locZ * 32.0D);
|
int k = MathHelper.floor(this.tracker.locZ * 32.0D);
|
||||||
@ -87,7 +89,7 @@ public class EntityTrackerEntry {
|
|||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
if (j1 >= -128 && j1 < 128 && k1 >= -128 && k1 < 128 && l1 >= -128 && l1 < 128 && this.t <= 400) {
|
if (j1 >= -128 && j1 < 128 && k1 >= -128 && k1 < 128 && l1 >= -128 && l1 < 128 && this.u <= 400) {
|
||||||
if (flag && flag1) {
|
if (flag && flag1) {
|
||||||
object = new Packet33RelEntityMoveLook(this.tracker.id, (byte) j1, (byte) k1, (byte) l1, (byte) l, (byte) i1);
|
object = new Packet33RelEntityMoveLook(this.tracker.id, (byte) j1, (byte) k1, (byte) l1, (byte) l, (byte) i1);
|
||||||
} else if (flag) {
|
} else if (flag) {
|
||||||
@ -96,7 +98,7 @@ public class EntityTrackerEntry {
|
|||||||
object = new Packet32EntityLook(this.tracker.id, (byte) l, (byte) i1);
|
object = new Packet32EntityLook(this.tracker.id, (byte) l, (byte) i1);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.t = 0;
|
this.u = 0;
|
||||||
this.tracker.locX = (double) i / 32.0D;
|
this.tracker.locX = (double) i / 32.0D;
|
||||||
this.tracker.locY = (double) j / 32.0D;
|
this.tracker.locY = (double) j / 32.0D;
|
||||||
this.tracker.locZ = (double) k / 32.0D;
|
this.tracker.locZ = (double) k / 32.0D;
|
||||||
@ -109,17 +111,17 @@ public class EntityTrackerEntry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.isMoving) {
|
if (this.isMoving) {
|
||||||
double d0 = this.tracker.motX - this.i;
|
double d0 = this.tracker.motX - this.j;
|
||||||
double d1 = this.tracker.motY - this.j;
|
double d1 = this.tracker.motY - this.k;
|
||||||
double d2 = this.tracker.motZ - this.k;
|
double d2 = this.tracker.motZ - this.l;
|
||||||
double d3 = 0.02D;
|
double d3 = 0.02D;
|
||||||
double d4 = d0 * d0 + d1 * d1 + d2 * d2;
|
double d4 = d0 * d0 + d1 * d1 + d2 * d2;
|
||||||
|
|
||||||
if (d4 > d3 * d3 || d4 > 0.0D && this.tracker.motX == 0.0D && this.tracker.motY == 0.0D && this.tracker.motZ == 0.0D) {
|
if (d4 > d3 * d3 || d4 > 0.0D && this.tracker.motX == 0.0D && this.tracker.motY == 0.0D && this.tracker.motZ == 0.0D) {
|
||||||
this.i = this.tracker.motX;
|
this.j = this.tracker.motX;
|
||||||
this.j = this.tracker.motY;
|
this.k = this.tracker.motY;
|
||||||
this.k = this.tracker.motZ;
|
this.l = this.tracker.motZ;
|
||||||
this.broadcast(new Packet28EntityVelocity(this.tracker.id, this.i, this.j, this.k));
|
this.broadcast(new Packet28EntityVelocity(this.tracker.id, this.j, this.k, this.l));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,6 +134,14 @@ public class EntityTrackerEntry {
|
|||||||
if (datawatcher.a()) {
|
if (datawatcher.a()) {
|
||||||
this.broadcastIncludingSelf(new Packet40EntityMetadata(this.tracker.id, datawatcher));
|
this.broadcastIncludingSelf(new Packet40EntityMetadata(this.tracker.id, datawatcher));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int i2 = MathHelper.d(this.tracker.aq() * 256.0F / 360.0F);
|
||||||
|
|
||||||
|
if (Math.abs(i2 - this.i) >= 4) {
|
||||||
|
this.broadcast(new Packet35EntityHeadRotation(this.tracker.id, (byte) i2));
|
||||||
|
this.i = i2;
|
||||||
|
}
|
||||||
|
|
||||||
/* CraftBukkit start - code moved up
|
/* CraftBukkit start - code moved up
|
||||||
if (flag) {
|
if (flag) {
|
||||||
this.xLoc = i;
|
this.xLoc = i;
|
||||||
@ -310,6 +320,8 @@ public class EntityTrackerEntry {
|
|||||||
return new Packet23VehicleSpawn(this.tracker, 61);
|
return new Packet23VehicleSpawn(this.tracker, 61);
|
||||||
} else if (this.tracker instanceof EntityPotion) {
|
} else if (this.tracker instanceof EntityPotion) {
|
||||||
return new Packet23VehicleSpawn(this.tracker, 73, ((EntityPotion) this.tracker).getPotionValue());
|
return new Packet23VehicleSpawn(this.tracker, 73, ((EntityPotion) this.tracker).getPotionValue());
|
||||||
|
} else if (this.tracker instanceof EntityThrownExpBottle) {
|
||||||
|
return new Packet23VehicleSpawn(this.tracker, 75);
|
||||||
} else if (this.tracker instanceof EntityEnderPearl) {
|
} else if (this.tracker instanceof EntityEnderPearl) {
|
||||||
return new Packet23VehicleSpawn(this.tracker, 65);
|
return new Packet23VehicleSpawn(this.tracker, 65);
|
||||||
} else if (this.tracker instanceof EntityEnderSignal) {
|
} else if (this.tracker instanceof EntityEnderSignal) {
|
||||||
|
@ -73,8 +73,8 @@ public class EntityWeatherLighting extends EntityWeather {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void y_() {
|
public void G_() {
|
||||||
super.y_();
|
super.G_();
|
||||||
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);
|
||||||
@ -118,7 +118,7 @@ public class EntityWeatherLighting extends EntityWeather {
|
|||||||
entity.a(this);
|
entity.a(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.world.s = 2;
|
this.world.n = 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,487 +0,0 @@
|
|||||||
package net.minecraft.server;
|
|
||||||
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
// CraftBukkit start
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.craftbukkit.entity.CraftEntity;
|
|
||||||
import org.bukkit.craftbukkit.event.CraftEventFactory;
|
|
||||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
|
||||||
import org.bukkit.event.entity.EntityDamageEvent;
|
|
||||||
import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason;
|
|
||||||
import org.bukkit.event.entity.EntityTargetEvent;
|
|
||||||
// CraftBukkit end
|
|
||||||
|
|
||||||
public class EntityWolf extends EntityAnimal {
|
|
||||||
|
|
||||||
private boolean a = false;
|
|
||||||
private float b;
|
|
||||||
private float c;
|
|
||||||
private boolean g;
|
|
||||||
private boolean h;
|
|
||||||
private float i;
|
|
||||||
private float j;
|
|
||||||
|
|
||||||
public EntityWolf(World world) {
|
|
||||||
super(world);
|
|
||||||
this.texture = "/mob/wolf.png";
|
|
||||||
this.b(0.8F, 0.8F);
|
|
||||||
this.bb = 1.1F;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getMaxHealth() {
|
|
||||||
return this.isTamed() ? 20 : 8;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void b() {
|
|
||||||
super.b();
|
|
||||||
this.datawatcher.a(16, Byte.valueOf((byte) 0));
|
|
||||||
this.datawatcher.a(17, "");
|
|
||||||
this.datawatcher.a(18, new Integer(this.getHealth()));
|
|
||||||
}
|
|
||||||
|
|
||||||
protected boolean g_() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void b(NBTTagCompound nbttagcompound) {
|
|
||||||
super.b(nbttagcompound);
|
|
||||||
nbttagcompound.setBoolean("Angry", this.isAngry());
|
|
||||||
nbttagcompound.setBoolean("Sitting", this.isSitting());
|
|
||||||
if (this.getOwnerName() == null) {
|
|
||||||
nbttagcompound.setString("Owner", "");
|
|
||||||
} else {
|
|
||||||
nbttagcompound.setString("Owner", this.getOwnerName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void a(NBTTagCompound nbttagcompound) {
|
|
||||||
super.a(nbttagcompound);
|
|
||||||
this.setAngry(nbttagcompound.getBoolean("Angry"));
|
|
||||||
this.setSitting(nbttagcompound.getBoolean("Sitting"));
|
|
||||||
String s = nbttagcompound.getString("Owner");
|
|
||||||
|
|
||||||
if (s.length() > 0) {
|
|
||||||
this.setOwnerName(s);
|
|
||||||
this.setTamed(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected boolean d_() {
|
|
||||||
return this.isAngry();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected String c_() {
|
|
||||||
return this.isAngry() ? "mob.wolf.growl" : (this.random.nextInt(3) == 0 ? (this.isTamed() && this.datawatcher.getInt(18) < 10 ? "mob.wolf.whine" : "mob.wolf.panting") : "mob.wolf.bark");
|
|
||||||
}
|
|
||||||
|
|
||||||
protected String m() {
|
|
||||||
return "mob.wolf.hurt";
|
|
||||||
}
|
|
||||||
|
|
||||||
protected String n() {
|
|
||||||
return "mob.wolf.death";
|
|
||||||
}
|
|
||||||
|
|
||||||
protected float o() {
|
|
||||||
return 0.4F;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected int getLootId() {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void m_() {
|
|
||||||
super.m_();
|
|
||||||
if (!this.e && !this.E() && this.isTamed() && this.vehicle == null) {
|
|
||||||
EntityHuman entityhuman = this.world.a(this.getOwnerName());
|
|
||||||
|
|
||||||
if (entityhuman != null) {
|
|
||||||
float f = entityhuman.h(this);
|
|
||||||
|
|
||||||
if (f > 5.0F) {
|
|
||||||
this.c(entityhuman, f);
|
|
||||||
}
|
|
||||||
} else if (!this.aK()) {
|
|
||||||
this.setSitting(true);
|
|
||||||
}
|
|
||||||
} else if (this.target == null && !this.E() && !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).grow(16.0D, 4.0D, 16.0D));
|
|
||||||
|
|
||||||
if (!list.isEmpty()) {
|
|
||||||
// CraftBukkit start
|
|
||||||
Entity entity = (Entity) list.get(this.world.random.nextInt(list.size()));
|
|
||||||
org.bukkit.entity.Entity bukkitTarget = entity == null ? null : entity.getBukkitEntity();
|
|
||||||
|
|
||||||
EntityTargetEvent event = new EntityTargetEvent(this.getBukkitEntity(), bukkitTarget, EntityTargetEvent.TargetReason.RANDOM_TARGET);
|
|
||||||
this.world.getServer().getPluginManager().callEvent(event);
|
|
||||||
|
|
||||||
if (!event.isCancelled() || event.getTarget() != null) {
|
|
||||||
this.setTarget(entity);
|
|
||||||
}
|
|
||||||
// CraftBukkit end
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.aK()) {
|
|
||||||
this.setSitting(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.world.isStatic) {
|
|
||||||
this.datawatcher.watch(18, Integer.valueOf(this.getHealth()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void d() {
|
|
||||||
super.d();
|
|
||||||
this.a = false;
|
|
||||||
if (this.aw() && !this.E() && !this.isAngry()) {
|
|
||||||
Entity entity = this.ax();
|
|
||||||
|
|
||||||
if (entity instanceof EntityHuman) {
|
|
||||||
EntityHuman entityhuman = (EntityHuman) entity;
|
|
||||||
ItemStack itemstack = entityhuman.inventory.getItemInHand();
|
|
||||||
|
|
||||||
if (itemstack != null) {
|
|
||||||
if (!this.isTamed() && itemstack.id == Item.BONE.id) {
|
|
||||||
this.a = true;
|
|
||||||
} else if (this.isTamed() && Item.byId[itemstack.id] instanceof ItemFood) {
|
|
||||||
this.a = ((ItemFood) Item.byId[itemstack.id]).q();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.world.isStatic && this.g && !this.h && !this.E() && this.onGround) {
|
|
||||||
this.h = true;
|
|
||||||
this.i = 0.0F;
|
|
||||||
this.j = 0.0F;
|
|
||||||
this.world.broadcastEntityEffect(this, (byte) 8);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void y_() {
|
|
||||||
super.y_();
|
|
||||||
this.c = this.b;
|
|
||||||
if (this.a) {
|
|
||||||
this.b += (1.0F - this.b) * 0.4F;
|
|
||||||
} else {
|
|
||||||
this.b += (0.0F - this.b) * 0.4F;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.a) {
|
|
||||||
this.bc = 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.aJ()) {
|
|
||||||
this.g = true;
|
|
||||||
this.h = false;
|
|
||||||
this.i = 0.0F;
|
|
||||||
this.j = 0.0F;
|
|
||||||
} else if ((this.g || this.h) && this.h) {
|
|
||||||
if (this.i == 0.0F) {
|
|
||||||
this.world.makeSound(this, "mob.wolf.shake", this.o(), (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.j = this.i;
|
|
||||||
this.i += 0.05F;
|
|
||||||
if (this.j >= 2.0F) {
|
|
||||||
this.g = false;
|
|
||||||
this.h = false;
|
|
||||||
this.j = 0.0F;
|
|
||||||
this.i = 0.0F;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.i > 0.4F) {
|
|
||||||
float f = (float) this.boundingBox.b;
|
|
||||||
int i = (int) (MathHelper.sin((this.i - 0.4F) * 3.1415927F) * 7.0F);
|
|
||||||
|
|
||||||
for (int j = 0; j < i; ++j) {
|
|
||||||
float f1 = (this.random.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F;
|
|
||||||
float f2 = (this.random.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F;
|
|
||||||
|
|
||||||
this.world.a("splash", this.locX + (double) f1, (double) (f + 0.8F), this.locZ + (double) f2, this.motX, this.motY, this.motZ);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public float getHeadHeight() {
|
|
||||||
return this.length * 0.8F;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int x() {
|
|
||||||
return this.isSitting() ? 20 : super.x();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void c(Entity entity, float f) {
|
|
||||||
PathEntity pathentity = this.world.findPath(this, entity, 16.0F);
|
|
||||||
|
|
||||||
if (pathentity == null && f > 12.0F) {
|
|
||||||
int i = MathHelper.floor(entity.locX) - 2;
|
|
||||||
int j = MathHelper.floor(entity.locZ) - 2;
|
|
||||||
int k = MathHelper.floor(entity.boundingBox.b);
|
|
||||||
|
|
||||||
for (int l = 0; l <= 4; ++l) {
|
|
||||||
for (int i1 = 0; i1 <= 4; ++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);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.setPathEntity(pathentity);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected boolean v() {
|
|
||||||
return this.isSitting() || this.h;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
|
||||||
Entity entity = damagesource.getEntity();
|
|
||||||
|
|
||||||
this.setSitting(false);
|
|
||||||
if (entity != null && !(entity instanceof EntityHuman) && !(entity instanceof EntityArrow)) {
|
|
||||||
i = (i + 1) / 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!super.damageEntity(damagesource, i)) {
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
if (!this.isTamed() && !this.isAngry()) {
|
|
||||||
if (entity instanceof EntityHuman) {
|
|
||||||
// CraftBukkit start
|
|
||||||
org.bukkit.entity.Entity bukkitTarget = entity == null ? null : entity.getBukkitEntity();
|
|
||||||
|
|
||||||
EntityTargetEvent event = new EntityTargetEvent(this.getBukkitEntity(), bukkitTarget, EntityTargetEvent.TargetReason.TARGET_ATTACKED_ENTITY);
|
|
||||||
this.world.getServer().getPluginManager().callEvent(event);
|
|
||||||
|
|
||||||
if (!event.isCancelled()) {
|
|
||||||
if (event.getTarget() == null) {
|
|
||||||
this.target = null;
|
|
||||||
} else {
|
|
||||||
this.setAngry(true);
|
|
||||||
this.target = ((CraftEntity) event.getTarget()).getHandle();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// CraftBukkit end
|
|
||||||
}
|
|
||||||
|
|
||||||
if (entity instanceof EntityArrow && ((EntityArrow) entity).shooter != null) {
|
|
||||||
entity = ((EntityArrow) entity).shooter;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (entity instanceof EntityLiving) {
|
|
||||||
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).grow(16.0D, 4.0D, 16.0D));
|
|
||||||
Iterator iterator = list.iterator();
|
|
||||||
|
|
||||||
while (iterator.hasNext()) {
|
|
||||||
Entity entity1 = (Entity) iterator.next();
|
|
||||||
EntityWolf entitywolf = (EntityWolf) entity1;
|
|
||||||
|
|
||||||
if (!entitywolf.isTamed() && entitywolf.target == null) {
|
|
||||||
// CraftBukkit start
|
|
||||||
org.bukkit.entity.Entity bukkitTarget = entity == null ? null : entity.getBukkitEntity();
|
|
||||||
|
|
||||||
EntityTargetEvent event = new EntityTargetEvent(this.getBukkitEntity(), bukkitTarget, EntityTargetEvent.TargetReason.TARGET_ATTACKED_ENTITY);
|
|
||||||
this.world.getServer().getPluginManager().callEvent(event);
|
|
||||||
|
|
||||||
if (!event.isCancelled()) {
|
|
||||||
if (event.getTarget() == null) {
|
|
||||||
this.target = null;
|
|
||||||
} else {
|
|
||||||
entitywolf.target = (Entity) entity;
|
|
||||||
if (entity instanceof EntityHuman) {
|
|
||||||
entitywolf.setAngry(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// CraftBukkit end
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (entity != this && entity != null) {
|
|
||||||
if (this.isTamed() && entity instanceof EntityHuman && ((EntityHuman) entity).name.equalsIgnoreCase(this.getOwnerName())) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.target = entity;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected Entity findTarget() {
|
|
||||||
return this.isAngry() ? this.world.findNearbyPlayer(this, 16.0D) : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void a(Entity entity, float f) {
|
|
||||||
if (f > 2.0F && f < 6.0F && this.random.nextInt(10) == 0) {
|
|
||||||
if (this.onGround) {
|
|
||||||
double d0 = entity.locX - this.locX;
|
|
||||||
double d1 = entity.locZ - this.locZ;
|
|
||||||
float f1 = MathHelper.sqrt(d0 * d0 + d1 * d1);
|
|
||||||
|
|
||||||
this.motX = d0 / (double) f1 * 0.5D * 0.800000011920929D + this.motX * 0.20000000298023224D;
|
|
||||||
this.motZ = d1 / (double) f1 * 0.5D * 0.800000011920929D + this.motZ * 0.20000000298023224D;
|
|
||||||
this.motY = 0.4000000059604645D;
|
|
||||||
}
|
|
||||||
} else if ((double) f < 1.5D && entity.boundingBox.e > this.boundingBox.b && entity.boundingBox.b < this.boundingBox.e) {
|
|
||||||
this.attackTicks = 20;
|
|
||||||
byte b0 = 2;
|
|
||||||
|
|
||||||
if (this.isTamed()) {
|
|
||||||
b0 = 4;
|
|
||||||
}
|
|
||||||
// CraftBukkit start
|
|
||||||
org.bukkit.entity.Entity damager = this.getBukkitEntity();
|
|
||||||
org.bukkit.entity.Entity damagee = entity == null ? null : entity.getBukkitEntity();
|
|
||||||
|
|
||||||
EntityDamageByEntityEvent event = new EntityDamageByEntityEvent(damager, damagee, EntityDamageEvent.DamageCause.ENTITY_ATTACK, b0);
|
|
||||||
Bukkit.getPluginManager().callEvent(event);
|
|
||||||
|
|
||||||
if (event.isCancelled()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
entity.damageEntity(DamageSource.mobAttack(this), event.getDamage());
|
|
||||||
// CraftBukkit end
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean b(EntityHuman entityhuman) {
|
|
||||||
ItemStack itemstack = entityhuman.inventory.getItemInHand();
|
|
||||||
|
|
||||||
if (!this.isTamed()) {
|
|
||||||
if (itemstack != null && itemstack.id == Item.BONE.id && !this.isAngry()) {
|
|
||||||
--itemstack.count;
|
|
||||||
if (itemstack.count <= 0) {
|
|
||||||
entityhuman.inventory.setItem(entityhuman.inventory.itemInHandIndex, (ItemStack) null);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.world.isStatic) {
|
|
||||||
// CraftBukkit start - added event call and isCancelled check.
|
|
||||||
if (this.random.nextInt(3) == 0 && !CraftEventFactory.callEntityTameEvent(this, entityhuman).isCancelled()) {
|
|
||||||
// CraftBukkit end
|
|
||||||
this.setTamed(true);
|
|
||||||
this.setPathEntity((PathEntity) null);
|
|
||||||
this.setSitting(true);
|
|
||||||
this.setHealth(20);
|
|
||||||
this.setOwnerName(entityhuman.name);
|
|
||||||
this.a(true);
|
|
||||||
this.world.broadcastEntityEffect(this, (byte) 7);
|
|
||||||
} else {
|
|
||||||
this.a(false);
|
|
||||||
this.world.broadcastEntityEffect(this, (byte) 6);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (itemstack != null && Item.byId[itemstack.id] instanceof ItemFood) {
|
|
||||||
ItemFood itemfood = (ItemFood) Item.byId[itemstack.id];
|
|
||||||
|
|
||||||
if (itemfood.q() && this.datawatcher.getInt(18) < 20) {
|
|
||||||
--itemstack.count;
|
|
||||||
this.heal(itemfood.getNutrition(), RegainReason.EATING); // CraftBukkit
|
|
||||||
if (itemstack.count <= 0) {
|
|
||||||
entityhuman.inventory.setItem(entityhuman.inventory.itemInHandIndex, (ItemStack) null);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (entityhuman.name.equalsIgnoreCase(this.getOwnerName())) {
|
|
||||||
if (!this.world.isStatic) {
|
|
||||||
this.setSitting(!this.isSitting());
|
|
||||||
this.aZ = false;
|
|
||||||
this.setPathEntity((PathEntity) null);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return super.b(entityhuman);
|
|
||||||
}
|
|
||||||
|
|
||||||
void a(boolean flag) {
|
|
||||||
String s = "heart";
|
|
||||||
|
|
||||||
if (!flag) {
|
|
||||||
s = "smoke";
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < 7; ++i) {
|
|
||||||
double d0 = this.random.nextGaussian() * 0.02D;
|
|
||||||
double d1 = this.random.nextGaussian() * 0.02D;
|
|
||||||
double d2 = this.random.nextGaussian() * 0.02D;
|
|
||||||
|
|
||||||
this.world.a(s, this.locX + (double) (this.random.nextFloat() * this.width * 2.0F) - (double) this.width, this.locY + 0.5D + (double) (this.random.nextFloat() * this.length), this.locZ + (double) (this.random.nextFloat() * this.width * 2.0F) - (double) this.width, d0, d1, d2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public int p() {
|
|
||||||
return 8;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getOwnerName() {
|
|
||||||
return this.datawatcher.getString(17);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOwnerName(String s) {
|
|
||||||
this.datawatcher.watch(17, s);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isSitting() {
|
|
||||||
return (this.datawatcher.getByte(16) & 1) != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSitting(boolean flag) {
|
|
||||||
byte b0 = this.datawatcher.getByte(16);
|
|
||||||
|
|
||||||
if (flag) {
|
|
||||||
this.datawatcher.watch(16, Byte.valueOf((byte) (b0 | 1)));
|
|
||||||
} else {
|
|
||||||
this.datawatcher.watch(16, Byte.valueOf((byte) (b0 & -2)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isAngry() {
|
|
||||||
return (this.datawatcher.getByte(16) & 2) != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAngry(boolean flag) {
|
|
||||||
byte b0 = this.datawatcher.getByte(16);
|
|
||||||
|
|
||||||
if (flag) {
|
|
||||||
this.datawatcher.watch(16, Byte.valueOf((byte) (b0 | 2)));
|
|
||||||
} else {
|
|
||||||
this.datawatcher.watch(16, Byte.valueOf((byte) (b0 & -3)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isTamed() {
|
|
||||||
return (this.datawatcher.getByte(16) & 4) != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTamed(boolean flag) {
|
|
||||||
byte b0 = this.datawatcher.getByte(16);
|
|
||||||
|
|
||||||
if (flag) {
|
|
||||||
this.datawatcher.watch(16, Byte.valueOf((byte) (b0 | 4)));
|
|
||||||
} else {
|
|
||||||
this.datawatcher.watch(16, Byte.valueOf((byte) (b0 & -5)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected EntityAnimal createChild(EntityAnimal entityanimal) {
|
|
||||||
return new EntityWolf(this.world);
|
|
||||||
}
|
|
||||||
}
|
|
@ -7,30 +7,38 @@ public class EntityZombie extends EntityMonster {
|
|||||||
public EntityZombie(World world) {
|
public EntityZombie(World world) {
|
||||||
super(world);
|
super(world);
|
||||||
this.texture = "/mob/zombie.png";
|
this.texture = "/mob/zombie.png";
|
||||||
this.bb = 0.5F;
|
this.bb = 0.23F;
|
||||||
this.damage = 4;
|
this.damage = 4;
|
||||||
this.goalSelector.a(1, new PathfinderGoalFloat(this));
|
this.ak().b(true);
|
||||||
this.goalSelector.a(2, new PathfinderGoalMeleeAttack(this, world, 16.0F));
|
this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
||||||
this.goalSelector.a(3, new PathfinderGoalRandomStroll(this));
|
this.goalSelector.a(1, new PathfinderGoalBreakDoor(this));
|
||||||
this.goalSelector.a(4, new PathfinderGoalLookAtPlayer(this, world, 8.0F));
|
this.goalSelector.a(2, new PathfinderGoalMeleeAttack(this, EntityHuman.class, this.bb, false));
|
||||||
this.goalSelector.a(4, new PathfinderGoalRandomLookaround(this));
|
this.goalSelector.a(3, new PathfinderGoalMeleeAttack(this, EntityVillager.class, this.bb, true));
|
||||||
|
this.goalSelector.a(4, new PathfinderGoalMoveTowardsRestriction(this, this.bb));
|
||||||
|
this.goalSelector.a(5, new PathfinderGoalMoveThroughVillage(this, this.bb, false));
|
||||||
|
this.goalSelector.a(6, new PathfinderGoalRandomStroll(this, this.bb));
|
||||||
|
this.goalSelector.a(7, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F));
|
||||||
|
this.goalSelector.a(7, new PathfinderGoalRandomLookaround(this));
|
||||||
|
this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this, false));
|
||||||
|
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget(this, EntityHuman.class, 16.0F, 0, true));
|
||||||
|
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget(this, EntityVillager.class, 16.0F, 0, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMaxHealth() {
|
public int getMaxHealth() {
|
||||||
return 20;
|
return 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int P() {
|
public int S() {
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean as() {
|
protected boolean c_() {
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void d() {
|
public void e() {
|
||||||
if (this.world.e() && !this.world.isStatic) {
|
if (this.world.e() && !this.world.isStatic) {
|
||||||
float f = this.a(1.0F);
|
float f = this.b(1.0F);
|
||||||
|
|
||||||
if (f > 0.5F && this.world.isChunkLoaded(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) {
|
if (f > 0.5F && this.world.isChunkLoaded(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) {
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
@ -44,18 +52,18 @@ public class EntityZombie extends EntityMonster {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
super.d();
|
super.e();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String c_() {
|
protected String i() {
|
||||||
return "mob.zombie";
|
return "mob.zombie";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String m() {
|
protected String j() {
|
||||||
return "mob.zombiehurt";
|
return "mob.zombiehurt";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String n() {
|
protected String k() {
|
||||||
return "mob.zombiedeath";
|
return "mob.zombiedeath";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,4 +74,23 @@ public class EntityZombie extends EntityMonster {
|
|||||||
public MonsterType getMonsterType() {
|
public MonsterType getMonsterType() {
|
||||||
return MonsterType.UNDEAD;
|
return MonsterType.UNDEAD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void b(int i) {
|
||||||
|
switch (this.random.nextInt(4)) {
|
||||||
|
case 0:
|
||||||
|
this.b(Item.IRON_SWORD.id, 1);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
this.b(Item.IRON_HELMET.id, 1);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
this.b(Item.IRON_INGOT.id, 1);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 3:
|
||||||
|
this.b(Item.IRON_SPADE.id, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ public class Explosion {
|
|||||||
f1 -= (Block.byId[k1].a(this.source) + 0.3F) * f2;
|
f1 -= (Block.byId[k1].a(this.source) + 0.3F) * f2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (f1 > 0.0F && i1 < world.height && i1 >= 0) { // CraftBukkit - Don't wrap explosions
|
if (f1 > 0.0F && i1 < 256 && i1 >= 0) { // CraftBukkit - Don't wrap explosions
|
||||||
this.blocks.add(new ChunkPosition(l, i1, j1));
|
this.blocks.add(new ChunkPosition(l, i1, j1));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -256,7 +256,7 @@ public class Explosion {
|
|||||||
i1 = this.world.getTypeId(j, k, l);
|
i1 = this.world.getTypeId(j, k, l);
|
||||||
int j1 = this.world.getTypeId(j, k - 1, l);
|
int j1 = this.world.getTypeId(j, k - 1, l);
|
||||||
|
|
||||||
if (i1 == 0 && Block.o[j1] && this.h.nextInt(3) == 0) {
|
if (i1 == 0 && Block.n[j1] && this.h.nextInt(3) == 0) {
|
||||||
this.world.setTypeId(j, k, l, Block.FIRE.id);
|
this.world.setTypeId(j, k, l, Block.FIRE.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ public class FoodMetaData {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.foodLevel >= 18 && entityhuman.ab()) {
|
if (this.foodLevel >= 18 && entityhuman.af()) {
|
||||||
++this.foodTickTimer;
|
++this.foodTickTimer;
|
||||||
if (this.foodTickTimer >= 80) {
|
if (this.foodTickTimer >= 80) {
|
||||||
// CraftBukkit - added RegainReason.
|
// CraftBukkit - added RegainReason.
|
||||||
|
@ -16,6 +16,8 @@ public interface IInventory {
|
|||||||
|
|
||||||
ItemStack splitStack(int i, int j);
|
ItemStack splitStack(int i, int j);
|
||||||
|
|
||||||
|
ItemStack splitWithoutUpdate(int i);
|
||||||
|
|
||||||
void setItem(int i, ItemStack itemstack);
|
void setItem(int i, ItemStack itemstack);
|
||||||
|
|
||||||
String getName();
|
String getName();
|
||||||
|
@ -54,6 +54,17 @@ public class InventoryCraftResult implements IInventory {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ItemStack splitWithoutUpdate(int i) {
|
||||||
|
if (this.items[i] != null) {
|
||||||
|
ItemStack itemstack = this.items[i];
|
||||||
|
|
||||||
|
this.items[i] = null;
|
||||||
|
return itemstack;
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void setItem(int i, ItemStack itemstack) {
|
public void setItem(int i, ItemStack itemstack) {
|
||||||
this.items[i] = itemstack;
|
this.items[i] = itemstack;
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,18 @@ public class InventoryCrafting implements IInventory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "Crafting";
|
return "container.crafting";
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack splitWithoutUpdate(int i) {
|
||||||
|
if (this.items[i] != null) {
|
||||||
|
ItemStack itemstack = this.items[i];
|
||||||
|
|
||||||
|
this.items[i] = null;
|
||||||
|
return itemstack;
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack splitStack(int i, int j) {
|
public ItemStack splitStack(int i, int j) {
|
||||||
|
@ -77,6 +77,10 @@ public class InventoryLargeChest implements IInventory {
|
|||||||
return i >= this.left.getSize() ? this.right.splitStack(i - this.left.getSize(), j) : this.left.splitStack(i, j);
|
return i >= this.left.getSize() ? this.right.splitStack(i - this.left.getSize(), j) : this.left.splitStack(i, j);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ItemStack splitWithoutUpdate(int i) {
|
||||||
|
return i >= this.left.getSize() ? this.right.splitWithoutUpdate(i - this.left.getSize()) : this.left.splitWithoutUpdate(i);
|
||||||
|
}
|
||||||
|
|
||||||
public void setItem(int i, ItemStack itemstack) {
|
public void setItem(int i, ItemStack itemstack) {
|
||||||
if (i >= this.left.getSize()) {
|
if (i >= this.left.getSize()) {
|
||||||
this.right.setItem(i - this.left.getSize(), itemstack);
|
this.right.setItem(i - this.left.getSize(), itemstack);
|
||||||
|
@ -25,8 +25,8 @@ public class ItemBlock extends Item {
|
|||||||
int i1 = world.getTypeId(i, j, k);
|
int i1 = world.getTypeId(i, j, k);
|
||||||
|
|
||||||
if (i1 == Block.SNOW.id) {
|
if (i1 == Block.SNOW.id) {
|
||||||
l = 0;
|
l = 1;
|
||||||
} else if (i1 != Block.VINE.id) {
|
} else if (i1 != Block.VINE.id && i1 != Block.LONG_GRASS.id && i1 != Block.DEAD_BUSH.id) {
|
||||||
if (l == 0) {
|
if (l == 0) {
|
||||||
--j;
|
--j;
|
||||||
}
|
}
|
||||||
@ -56,7 +56,7 @@ public class ItemBlock extends Item {
|
|||||||
return false;
|
return false;
|
||||||
} else if (!entityhuman.d(i, j, k)) {
|
} else if (!entityhuman.d(i, j, k)) {
|
||||||
return false;
|
return false;
|
||||||
} else if (j == world.height - 1 && Block.byId[this.id].material.isBuildable()) {
|
} else if (j == 255 && Block.byId[this.id].material.isBuildable()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
@ -82,8 +82,8 @@ public class ItemBlock extends Item {
|
|||||||
if (Block.byId[id] != null) {
|
if (Block.byId[id] != null) {
|
||||||
Block.byId[id].postPlace(world, i, j, k, l);
|
Block.byId[id].postPlace(world, i, j, k, l);
|
||||||
Block.byId[id].postPlace(world, i, j, k, entityhuman);
|
Block.byId[id].postPlace(world, i, j, k, entityhuman);
|
||||||
|
// CraftBukkit end
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
|
||||||
|
|
||||||
world.makeSound((double) ((float) i + 0.5F), (double) ((float) j + 0.5F), (double) ((float) k + 0.5F), block.stepSound.getName(), (block.stepSound.getVolume1() + 1.0F) / 2.0F, block.stepSound.getVolume2() * 0.8F);
|
world.makeSound((double) ((float) i + 0.5F), (double) ((float) j + 0.5F), (double) ((float) k + 0.5F), block.stepSound.getName(), (block.stepSound.getVolume1() + 1.0F) / 2.0F, block.stepSound.getVolume2() * 0.8F);
|
||||||
--itemstack.count;
|
--itemstack.count;
|
||||||
@ -96,10 +96,10 @@ public class ItemBlock extends Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String a(ItemStack itemstack) {
|
public String a(ItemStack itemstack) {
|
||||||
return Block.byId[this.id].n();
|
return Block.byId[this.id].p();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return Block.byId[this.id].n();
|
return Block.byId[this.id].p();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ public class ItemBoat extends Item {
|
|||||||
if (movingobjectposition == null) {
|
if (movingobjectposition == null) {
|
||||||
return itemstack;
|
return itemstack;
|
||||||
} else {
|
} else {
|
||||||
Vec3D vec3d2 = entityhuman.e(f);
|
Vec3D vec3d2 = entityhuman.f(f);
|
||||||
boolean flag = false;
|
boolean flag = false;
|
||||||
float f9 = 1.0F;
|
float f9 = 1.0F;
|
||||||
List list = world.getEntities(entityhuman, entityhuman.boundingBox.a(vec3d2.a * d3, vec3d2.b * d3, vec3d2.c * d3).grow((double) f9, (double) f9, (double) f9));
|
List list = world.getEntities(entityhuman, entityhuman.boundingBox.a(vec3d2.a * d3, vec3d2.b * d3, vec3d2.c * d3).grow((double) f9, (double) f9, (double) f9));
|
||||||
@ -44,7 +44,7 @@ public class ItemBoat extends Item {
|
|||||||
for (int i = 0; i < list.size(); ++i) {
|
for (int i = 0; i < list.size(); ++i) {
|
||||||
Entity entity = (Entity) list.get(i);
|
Entity entity = (Entity) list.get(i);
|
||||||
|
|
||||||
if (entity.e_()) {
|
if (entity.o_()) {
|
||||||
float f10 = entity.j_();
|
float f10 = entity.j_();
|
||||||
AxisAlignedBB axisalignedbb = entity.boundingBox.grow((double) f10, (double) f10, (double) f10);
|
AxisAlignedBB axisalignedbb = entity.boundingBox.grow((double) f10, (double) f10, (double) f10);
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ public class ItemBow extends Item {
|
|||||||
public void a(ItemStack itemstack, World world, EntityHuman entityhuman, int i) {
|
public void a(ItemStack itemstack, World world, EntityHuman entityhuman, int i) {
|
||||||
boolean flag = entityhuman.abilities.canInstantlyBuild || EnchantmentManager.getEnchantmentLevel(Enchantment.ARROW_INFINITE.id, itemstack) > 0;
|
boolean flag = entityhuman.abilities.canInstantlyBuild || EnchantmentManager.getEnchantmentLevel(Enchantment.ARROW_INFINITE.id, itemstack) > 0;
|
||||||
|
|
||||||
if (flag || entityhuman.inventory.c(Item.ARROW.id)) {
|
if (flag || entityhuman.inventory.d(Item.ARROW.id)) {
|
||||||
int j = this.c(itemstack) - i;
|
int j = this.c(itemstack) - i;
|
||||||
float f = (float) j / 20.0F;
|
float f = (float) j / 20.0F;
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ public class ItemBow extends Item {
|
|||||||
int k = EnchantmentManager.getEnchantmentLevel(Enchantment.ARROW_DAMAGE.id, itemstack);
|
int k = EnchantmentManager.getEnchantmentLevel(Enchantment.ARROW_DAMAGE.id, itemstack);
|
||||||
|
|
||||||
if (k > 0) {
|
if (k > 0) {
|
||||||
entityarrow.a(entityarrow.j() + (double) k * 0.5D + 0.5D);
|
entityarrow.a(entityarrow.k() + (double) k * 0.5D + 0.5D);
|
||||||
}
|
}
|
||||||
|
|
||||||
int l = EnchantmentManager.getEnchantmentLevel(Enchantment.ARROW_KNOCKBACK.id, itemstack);
|
int l = EnchantmentManager.getEnchantmentLevel(Enchantment.ARROW_KNOCKBACK.id, itemstack);
|
||||||
@ -66,7 +66,7 @@ public class ItemBow extends Item {
|
|||||||
itemstack.damage(1, entityhuman);
|
itemstack.damage(1, entityhuman);
|
||||||
world.makeSound(entityhuman, "random.bow", 1.0F, 1.0F / (c.nextFloat() * 0.4F + 1.2F) + f * 0.5F);
|
world.makeSound(entityhuman, "random.bow", 1.0F, 1.0F / (c.nextFloat() * 0.4F + 1.2F) + f * 0.5F);
|
||||||
if (!flag) {
|
if (!flag) {
|
||||||
entityhuman.inventory.b(Item.ARROW.id);
|
entityhuman.inventory.c(Item.ARROW.id);
|
||||||
} else {
|
} else {
|
||||||
entityarrow.fromPlayer = false;
|
entityarrow.fromPlayer = false;
|
||||||
}
|
}
|
||||||
@ -86,7 +86,7 @@ public class ItemBow extends Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack a(ItemStack itemstack, World world, EntityHuman entityhuman) {
|
public ItemStack a(ItemStack itemstack, World world, EntityHuman entityhuman) {
|
||||||
if (entityhuman.abilities.canInstantlyBuild || entityhuman.inventory.c(Item.ARROW.id)) {
|
if (entityhuman.abilities.canInstantlyBuild || entityhuman.inventory.d(Item.ARROW.id)) {
|
||||||
entityhuman.a(itemstack, this.c(itemstack));
|
entityhuman.a(itemstack, this.c(itemstack));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +51,6 @@ public class ItemBucket extends Item {
|
|||||||
return itemstack;
|
return itemstack;
|
||||||
}
|
}
|
||||||
world.setTypeId(i, j, k, 0);
|
world.setTypeId(i, j, k, 0);
|
||||||
|
|
||||||
if (entityhuman.abilities.canInstantlyBuild) {
|
if (entityhuman.abilities.canInstantlyBuild) {
|
||||||
return itemstack;
|
return itemstack;
|
||||||
}
|
}
|
||||||
@ -68,7 +67,6 @@ public class ItemBucket extends Item {
|
|||||||
return itemstack;
|
return itemstack;
|
||||||
}
|
}
|
||||||
world.setTypeId(i, j, k, 0);
|
world.setTypeId(i, j, k, 0);
|
||||||
|
|
||||||
if (entityhuman.abilities.canInstantlyBuild) {
|
if (entityhuman.abilities.canInstantlyBuild) {
|
||||||
return itemstack;
|
return itemstack;
|
||||||
}
|
}
|
||||||
|
@ -88,11 +88,6 @@ public class ItemDoor extends Item {
|
|||||||
flag2 = true;
|
flag2 = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flag2) {
|
|
||||||
l = l - 1 & 3;
|
|
||||||
l += 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
CraftBlockState blockState = CraftBlockState.getBlockState(world, i, j, k); // CraftBukkit
|
CraftBlockState blockState = CraftBlockState.getBlockState(world, i, j, k); // CraftBukkit
|
||||||
world.suppressPhysics = true;
|
world.suppressPhysics = true;
|
||||||
world.setTypeIdAndData(i, j, k, block.id, l);
|
world.setTypeIdAndData(i, j, k, block.id, l);
|
||||||
@ -106,7 +101,7 @@ public class ItemDoor extends Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
world.setTypeIdAndData(i, j + 1, k, block.id, l + 8);
|
world.setTypeIdAndData(i, j + 1, k, block.id, 8 | (flag2 ? 1 : 0));
|
||||||
world.suppressPhysics = false;
|
world.suppressPhysics = false;
|
||||||
world.applyPhysics(i, j, k, block.id);
|
world.applyPhysics(i, j, k, block.id);
|
||||||
world.applyPhysics(i, j + 1, k, block.id);
|
world.applyPhysics(i, j + 1, k, block.id);
|
||||||
|
@ -12,10 +12,10 @@ public class ItemFishingRod extends Item {
|
|||||||
|
|
||||||
public ItemStack a(ItemStack itemstack, World world, EntityHuman entityhuman) {
|
public ItemStack a(ItemStack itemstack, World world, EntityHuman entityhuman) {
|
||||||
if (entityhuman.hookedFish != null) {
|
if (entityhuman.hookedFish != null) {
|
||||||
int i = entityhuman.hookedFish.j();
|
int i = entityhuman.hookedFish.k();
|
||||||
|
|
||||||
itemstack.damage(i, entityhuman);
|
itemstack.damage(i, entityhuman);
|
||||||
entityhuman.s_();
|
entityhuman.D();
|
||||||
} else {
|
} else {
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
PlayerFishEvent playerFishEvent = new PlayerFishEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), null, PlayerFishEvent.State.FISHING);
|
PlayerFishEvent playerFishEvent = new PlayerFishEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), null, PlayerFishEvent.State.FISHING);
|
||||||
@ -31,7 +31,7 @@ public class ItemFishingRod extends Item {
|
|||||||
world.addEntity(new EntityFishingHook(world, entityhuman));
|
world.addEntity(new EntityFishingHook(world, entityhuman));
|
||||||
}
|
}
|
||||||
|
|
||||||
entityhuman.s_();
|
entityhuman.D();
|
||||||
}
|
}
|
||||||
|
|
||||||
return itemstack;
|
return itemstack;
|
||||||
|
@ -4,20 +4,20 @@ public class ItemFood extends Item {
|
|||||||
|
|
||||||
public final int a;
|
public final int a;
|
||||||
private final int b;
|
private final int b;
|
||||||
private final float bS;
|
private final float bU;
|
||||||
private final boolean bT;
|
private final boolean bV;
|
||||||
private boolean bU;
|
private boolean bW;
|
||||||
private int bV;
|
|
||||||
private int bW;
|
|
||||||
private int bX;
|
private int bX;
|
||||||
private float bY;
|
private int bY;
|
||||||
|
private int bZ;
|
||||||
|
private float ca;
|
||||||
|
|
||||||
public ItemFood(int i, int j, float f, boolean flag) {
|
public ItemFood(int i, int j, float f, boolean flag) {
|
||||||
super(i);
|
super(i);
|
||||||
this.a = 32;
|
this.a = 32;
|
||||||
this.b = j;
|
this.b = j;
|
||||||
this.bT = flag;
|
this.bV = flag;
|
||||||
this.bS = f;
|
this.bU = f;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemFood(int i, int j, boolean flag) {
|
public ItemFood(int i, int j, boolean flag) {
|
||||||
@ -36,8 +36,8 @@ public class ItemFood extends Item {
|
|||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
if (!world.isStatic && this.bV > 0 && world.random.nextFloat() < this.bY) {
|
if (!world.isStatic && this.bX > 0 && world.random.nextFloat() < this.ca) {
|
||||||
entityhuman.addEffect(new MobEffect(this.bV, this.bW * 20, this.bX));
|
entityhuman.addEffect(new MobEffect(this.bX, this.bY * 20, this.bZ));
|
||||||
}
|
}
|
||||||
|
|
||||||
return itemstack;
|
return itemstack;
|
||||||
@ -52,7 +52,7 @@ public class ItemFood extends Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack a(ItemStack itemstack, World world, EntityHuman entityhuman) {
|
public ItemStack a(ItemStack itemstack, World world, EntityHuman entityhuman) {
|
||||||
if (entityhuman.b(this.bU)) {
|
if (entityhuman.b(this.bW)) {
|
||||||
entityhuman.a(itemstack, this.c(itemstack));
|
entityhuman.a(itemstack, this.c(itemstack));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,23 +64,23 @@ public class ItemFood extends Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public float getSaturationModifier() {
|
public float getSaturationModifier() {
|
||||||
return this.bS;
|
return this.bU;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean q() {
|
public boolean q() {
|
||||||
return this.bT;
|
return this.bV;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemFood a(int i, int j, int k, float f) {
|
public ItemFood a(int i, int j, int k, float f) {
|
||||||
this.bV = i;
|
this.bX = i;
|
||||||
this.bW = j;
|
this.bY = j;
|
||||||
this.bX = k;
|
this.bZ = k;
|
||||||
this.bY = f;
|
this.ca = f;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemFood r() {
|
public ItemFood r() {
|
||||||
this.bU = true;
|
this.bW = true;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -226,20 +226,20 @@ public class ItemInWorldManager {
|
|||||||
int l = this.world.getTypeId(i, j, k);
|
int l = this.world.getTypeId(i, j, k);
|
||||||
int i1 = this.world.getData(i, j, k);
|
int i1 = this.world.getData(i, j, k);
|
||||||
|
|
||||||
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) << 12));
|
||||||
boolean flag = this.b(i, j, k);
|
boolean flag = this.b(i, j, k);
|
||||||
|
|
||||||
if (this.isCreative()) {
|
if (this.isCreative()) {
|
||||||
((EntityPlayer) this.player).netServerHandler.sendPacket(new Packet53BlockChange(i, j, k, this.world));
|
((EntityPlayer) this.player).netServerHandler.sendPacket(new Packet53BlockChange(i, j, k, this.world));
|
||||||
} else {
|
} else {
|
||||||
ItemStack itemstack = this.player.Q();
|
ItemStack itemstack = this.player.T();
|
||||||
boolean flag1 = this.player.b(Block.byId[l]);
|
boolean flag1 = this.player.b(Block.byId[l]);
|
||||||
|
|
||||||
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.R();
|
this.player.U();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@ public class ItemMonsterEgg extends Item {
|
|||||||
|
|
||||||
public ItemMonsterEgg(int i) {
|
public ItemMonsterEgg(int i) {
|
||||||
super(i);
|
super(i);
|
||||||
this.e(1);
|
|
||||||
this.a(true);
|
this.a(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -12,21 +11,38 @@ public class ItemMonsterEgg extends Item {
|
|||||||
if (world.isStatic || itemstack.getData() == 48 || itemstack.getData() == 49 || itemstack.getData() == 63) { // CraftBukkit
|
if (world.isStatic || itemstack.getData() == 48 || itemstack.getData() == 49 || itemstack.getData() == 63) { // CraftBukkit
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
int i1 = world.getTypeId(i, j, k);
|
||||||
|
|
||||||
i += Facing.b[l];
|
i += Facing.b[l];
|
||||||
j += Facing.c[l];
|
j += Facing.c[l];
|
||||||
k += Facing.d[l];
|
k += Facing.d[l];
|
||||||
Entity entity = EntityTypes.a(itemstack.getData(), world);
|
double d0 = 0.0D;
|
||||||
|
|
||||||
if (entity != null && entity instanceof EntityLiving) { // CraftBukkit
|
if (l == 1 && i1 == Block.FENCE.id || i1 == Block.NETHER_FENCE.id) {
|
||||||
if (!entityhuman.abilities.canInstantlyBuild) {
|
d0 = 0.5D;
|
||||||
--itemstack.count;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
entity.setPositionRotation((double) i + 0.5D, (double) j, (double) k + 0.5D, 0.0F, 0.0F);
|
if (a(world, itemstack.getData(), (double) i + 0.5D, (double) j + d0, (double) k + 0.5D) && !entityhuman.abilities.canInstantlyBuild) {
|
||||||
world.addEntity(entity, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER_EGG); // CraftBukkit
|
--itemstack.count;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean a(World world, int i, double d0, double d1, double d2) {
|
||||||
|
if (!EntityTypes.a.containsKey(Integer.valueOf(i))) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
Entity entity = EntityTypes.a(i, world);
|
||||||
|
|
||||||
|
if (entity != null && entity instanceof EntityLiving) { // CraftBukkit
|
||||||
|
entity.setPositionRotation(d0, d1, d2, world.random.nextFloat() * 360.0F, 0.0F);
|
||||||
|
world.addEntity(entity, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER_EGG); // CraftBukkit
|
||||||
|
((EntityLiving) entity).ay();
|
||||||
|
}
|
||||||
|
|
||||||
|
return entity != null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -58,16 +58,14 @@ public class ItemRedstone extends Item {
|
|||||||
BlockPlaceEvent event = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, clickedX, clickedY, clickedZ);
|
BlockPlaceEvent event = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, clickedX, clickedY, clickedZ);
|
||||||
blockState.update(true);
|
blockState.update(true);
|
||||||
|
|
||||||
|
world.suppressPhysics = false;
|
||||||
if (event.isCancelled() || !event.canBuild()) {
|
if (event.isCancelled() || !event.canBuild()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
world.suppressPhysics = false;
|
|
||||||
|
|
||||||
world.setTypeId(i, j, k, Block.REDSTONE_WIRE.id);
|
|
||||||
world.update(i, j, k, Block.REDSTONE_WIRE.id); // Must take place after BlockPlaceEvent, we need to update all other blocks.
|
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
--itemstack.count; // CraftBukkit - ORDER MATTERS
|
--itemstack.count;
|
||||||
|
world.setTypeId(i, j, k, Block.REDSTONE_WIRE.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -20,8 +20,8 @@ public class ItemReed extends Item {
|
|||||||
int i1 = world.getTypeId(i, j, k);
|
int i1 = world.getTypeId(i, j, k);
|
||||||
|
|
||||||
if (i1 == Block.SNOW.id) {
|
if (i1 == Block.SNOW.id) {
|
||||||
l = 0;
|
l = 1;
|
||||||
} else if (i1 != Block.VINE.id) {
|
} else if (i1 != Block.VINE.id && i1 != Block.LONG_GRASS.id && i1 != Block.DEAD_BUSH.id) {
|
||||||
if (l == 0) {
|
if (l == 0) {
|
||||||
--j;
|
--j;
|
||||||
}
|
}
|
||||||
|
@ -150,7 +150,7 @@ public final class ItemStack {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setData(int i) {
|
public void setData(int i) {
|
||||||
this.damage = (this.id > 0) && (this.id < 256) ? Item.byId[this.id].filterData(i) : i; // CraftBukkit
|
this.damage = (this.id > 0) && (this.id < Block.byId.length) ? Item.byId[this.id].filterData(i) : i; // CraftBukkit
|
||||||
}
|
}
|
||||||
|
|
||||||
public int i() {
|
public int i() {
|
||||||
@ -263,8 +263,8 @@ public final class ItemStack {
|
|||||||
Item.byId[this.id].a(this, world, entity, i, flag);
|
Item.byId[this.id].a(this, world, entity, i, flag);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void c(World world, EntityHuman entityhuman) {
|
public void a(World world, EntityHuman entityhuman, int i) {
|
||||||
entityhuman.a(StatisticList.D[this.id], this.count);
|
entityhuman.a(StatisticList.D[this.id], i);
|
||||||
Item.byId[this.id].d(this, world, entityhuman);
|
Item.byId[this.id].d(this, world, entityhuman);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -280,7 +280,7 @@ public final class ItemStack {
|
|||||||
return this.getItem().d(this);
|
return this.getItem().d(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void a(World world, EntityHuman entityhuman, int i) {
|
public void b(World world, EntityHuman entityhuman, int i) {
|
||||||
this.getItem().a(this, world, entityhuman, i);
|
this.getItem().a(this, world, entityhuman, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,10 +23,6 @@ public class ItemStep extends ItemBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean interactWith(ItemStack itemstack, EntityHuman entityhuman, World world, int i, int j, int k, int l) {
|
public boolean interactWith(ItemStack itemstack, EntityHuman entityhuman, World world, int i, int j, int k, int l) {
|
||||||
if (l != 1) {
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (itemstack.count == 0) {
|
if (itemstack.count == 0) {
|
||||||
return false;
|
return false;
|
||||||
} else if (!entityhuman.d(i, j, k)) {
|
} else if (!entityhuman.d(i, j, k)) {
|
||||||
@ -34,8 +30,10 @@ public class ItemStep extends ItemBlock {
|
|||||||
} else {
|
} else {
|
||||||
int i1 = world.getTypeId(i, j, k);
|
int i1 = world.getTypeId(i, j, k);
|
||||||
int j1 = world.getData(i, j, k);
|
int j1 = world.getData(i, j, k);
|
||||||
|
int k1 = j1 & 7;
|
||||||
|
boolean flag = (j1 & 8) != 0;
|
||||||
|
|
||||||
if (l == 1 && i1 == Block.STEP.id && j1 == itemstack.getData()) {
|
if ((l == 1 && !flag || l == 0 && flag) && i1 == Block.STEP.id && k1 == itemstack.getData()) {
|
||||||
/* CraftBukkit start - handle this in super
|
/* CraftBukkit start - handle this in super
|
||||||
if (world.setTypeIdAndData(i, j, k, Block.DOUBLE_STEP.id, j1)) {
|
if (world.setTypeIdAndData(i, j, k, Block.DOUBLE_STEP.id, j1)) {
|
||||||
world.makeSound((double) ((float) i + 0.5F), (double) ((float) j + 0.5F), (double) ((float) k + 0.5F), Block.DOUBLE_STEP.stepSound.getName(), (Block.DOUBLE_STEP.stepSound.getVolume1() + 1.0F) / 2.0F, Block.DOUBLE_STEP.stepSound.getVolume2() * 0.8F);
|
world.makeSound((double) ((float) i + 0.5F), (double) ((float) j + 0.5F), (double) ((float) k + 0.5F), Block.DOUBLE_STEP.stepSound.getName(), (Block.DOUBLE_STEP.stepSound.getVolume1() + 1.0F) / 2.0F, Block.DOUBLE_STEP.stepSound.getVolume2() * 0.8F);
|
||||||
|
@ -48,7 +48,7 @@ public class ItemWorldMap extends ItemWorldMapBase {
|
|||||||
int i1 = MathHelper.floor(entity.locZ - (double) k) / i + short2 / 2;
|
int i1 = MathHelper.floor(entity.locZ - (double) k) / i + short2 / 2;
|
||||||
int j1 = 128 / i;
|
int j1 = 128 / i;
|
||||||
|
|
||||||
if (world.worldProvider.f) {
|
if (world.worldProvider.e) {
|
||||||
j1 /= 2;
|
j1 /= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ public class ItemWorldMap extends ItemWorldMapBase {
|
|||||||
int l4;
|
int l4;
|
||||||
int i5;
|
int i5;
|
||||||
|
|
||||||
if (world.worldProvider.f) {
|
if (world.worldProvider.e) {
|
||||||
l4 = i3 + j3 * 231871;
|
l4 = i3 + j3 * 231871;
|
||||||
l4 = l4 * l4 * 31287121 + l4 * 11;
|
l4 = l4 * l4 * 31287121 + l4 * 11;
|
||||||
if ((l4 >> 20 & 1) == 0) {
|
if ((l4 >> 20 & 1) == 0) {
|
||||||
@ -106,7 +106,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.E == MaterialMapColor.b) {
|
} else if (k4 > 0 && j5 > 0 && Block.byId[j5].material.F == MaterialMapColor.b) {
|
||||||
flag1 = false;
|
flag1 = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -164,7 +164,7 @@ public class ItemWorldMap extends ItemWorldMapBase {
|
|||||||
|
|
||||||
i5 = 0;
|
i5 = 0;
|
||||||
if (j4 > 0) {
|
if (j4 > 0) {
|
||||||
MaterialMapColor materialmapcolor = Block.byId[j4].material.E;
|
MaterialMapColor materialmapcolor = Block.byId[j4].material.F;
|
||||||
|
|
||||||
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;
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user