mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-30 06:24:06 +01:00
Update CraftBukkit to 1.6.1
This commit is contained in:
parent
f887b76a25
commit
6c09066e22
15
maps.yml
Normal file
15
maps.yml
Normal file
@ -0,0 +1,15 @@
|
||||
members:
|
||||
"org/bukkit/entity/Damageable _INVALID_damage (I)V": damage
|
||||
"org/bukkit/entity/Damageable _INVALID_damage (ILorg/bukkit/entity/Entity;)V": damage
|
||||
"org/bukkit/entity/Damageable _INVALID_getHealth ()I": getHealth
|
||||
"org/bukkit/entity/Damageable _INVALID_setHealth (I)V": setHealth
|
||||
"org/bukkit/entity/Damageable _INVALID_getMaxHealth ()I": getMaxHealth
|
||||
"org/bukkit/entity/Damageable _INVALID_setMaxHealth (I)V": setMaxHealth
|
||||
"org/bukkit/entity/LivingEntity _INVALID_getLastDamage ()I": getLastDamage
|
||||
"org/bukkit/entity/LivingEntity _INVALID_setLastDamage (I)V": setLastDamage
|
||||
"org/bukkit/event/entity/EntityDamageEvent _INVALID_getDamage ()I": getDamage
|
||||
"org/bukkit/event/entity/EntityDamageEvent _INVALID_setDamage (I)V": setDamage
|
||||
"org/bukkit/event/vehicle/VehicleDamageEvent _INVALID_getDamage ()I": getDamage
|
||||
"org/bukkit/event/vehicle/VehicleDamageEvent _INVALID_setDamage (I)V": setDamage
|
||||
"org/bukkit/event/entity/EntityRegainHealthEvent _INVALID_getAmount ()I": getAmount
|
||||
"org/bukkit/event/entity/EntityRegainHealthEvent _INVALID_setAmount (I)V": setAmount
|
30
pom.xml
30
pom.xml
@ -4,7 +4,7 @@
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.5.2-R1.1-SNAPSHOT</version>
|
||||
<version>1.6.1-R0.1-SNAPSHOT</version>
|
||||
<name>CraftBukkit</name>
|
||||
<url>http://www.bukkit.org</url>
|
||||
|
||||
@ -12,8 +12,8 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<api.version>unknown</api.version>
|
||||
<junit.version>4.11</junit.version>
|
||||
<minecraft.version>1.5.2</minecraft.version>
|
||||
<minecraft_version>1_5_R3</minecraft_version>
|
||||
<minecraft.version>1.6.1</minecraft.version>
|
||||
<minecraft_version>1_6_R1</minecraft_version>
|
||||
</properties>
|
||||
|
||||
<scm>
|
||||
@ -206,7 +206,7 @@
|
||||
</manifestSections>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
@ -278,8 +278,8 @@
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>2.0.2</version>
|
||||
<configuration>
|
||||
<source>1.5</source>
|
||||
<target>1.5</target>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
@ -294,6 +294,24 @@
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>com.wolvereness</groupId>
|
||||
<artifactId>overmapped</artifactId>
|
||||
<version>0.0.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>map</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<maps>${basedir}/maps.yml</maps>
|
||||
<input>${basedir}/target/${project.artifactId}-${project.version}.jar</input>
|
||||
<original>${basedir}/target/unmapped-${project.artifactId}-${project.version}.jar</original>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
|
@ -8,9 +8,9 @@ public class AABBPool {
|
||||
private final int a;
|
||||
private final int b;
|
||||
private final List pool = new ArrayList();
|
||||
private int d = 0;
|
||||
private int largestSize = 0;
|
||||
private int resizeTime = 0;
|
||||
private int d;
|
||||
private int largestSize;
|
||||
private int resizeTime;
|
||||
|
||||
public AABBPool(int i, int j) {
|
||||
this.a = i;
|
||||
|
@ -6,188 +6,194 @@ import java.util.Random;
|
||||
public class Block {
|
||||
|
||||
private CreativeModeTab creativeTab;
|
||||
public static final StepSound f = new StepSound("stone", 1.0F, 1.0F);
|
||||
public static final StepSound g = new StepSound("wood", 1.0F, 1.0F);
|
||||
public static final StepSound h = new StepSound("gravel", 1.0F, 1.0F);
|
||||
public static final StepSound i = new StepSound("grass", 1.0F, 1.0F);
|
||||
public static final StepSound j = new StepSound("stone", 1.0F, 1.0F);
|
||||
public static final StepSound k = new StepSound("stone", 1.0F, 1.5F);
|
||||
public static final StepSound l = new StepSoundStone("stone", 1.0F, 1.0F);
|
||||
public static final StepSound m = new StepSound("cloth", 1.0F, 1.0F);
|
||||
public static final StepSound n = new StepSound("sand", 1.0F, 1.0F);
|
||||
public static final StepSound o = new StepSound("snow", 1.0F, 1.0F);
|
||||
public static final StepSound p = new StepSoundLadder("ladder", 1.0F, 1.0F);
|
||||
public static final StepSound q = new StepSoundAnvil("anvil", 0.3F, 1.0F);
|
||||
protected String f;
|
||||
public static final StepSound g = new StepSound("stone", 1.0F, 1.0F);
|
||||
public static final StepSound h = new StepSound("wood", 1.0F, 1.0F);
|
||||
public static final StepSound i = new StepSound("gravel", 1.0F, 1.0F);
|
||||
public static final StepSound j = new StepSound("grass", 1.0F, 1.0F);
|
||||
public static final StepSound k = new StepSound("stone", 1.0F, 1.0F);
|
||||
public static final StepSound l = new StepSound("stone", 1.0F, 1.5F);
|
||||
public static final StepSound m = new StepSoundStone("stone", 1.0F, 1.0F);
|
||||
public static final StepSound n = new StepSound("cloth", 1.0F, 1.0F);
|
||||
public static final StepSound o = new StepSound("sand", 1.0F, 1.0F);
|
||||
public static final StepSound p = new StepSound("snow", 1.0F, 1.0F);
|
||||
public static final StepSound q = new StepSoundLadder("ladder", 1.0F, 1.0F);
|
||||
public static final StepSound r = new StepSoundAnvil("anvil", 0.3F, 1.0F);
|
||||
public static final Block[] byId = new Block[4096];
|
||||
public static final boolean[] s = new boolean[4096];
|
||||
public static final boolean[] t = new boolean[4096];
|
||||
public static final int[] lightBlock = new int[4096];
|
||||
public static final boolean[] u = new boolean[4096];
|
||||
public static final boolean[] v = new boolean[4096];
|
||||
public static final int[] lightEmission = new int[4096];
|
||||
public static boolean[] w = new boolean[4096];
|
||||
public static final Block STONE = (new BlockStone(1)).c(1.5F).b(10.0F).a(j).c("stone");
|
||||
public static final BlockGrass GRASS = (BlockGrass) (new BlockGrass(2)).c(0.6F).a(i).c("grass");
|
||||
public static final Block DIRT = (new BlockDirt(3)).c(0.5F).a(h).c("dirt");
|
||||
public static final Block COBBLESTONE = (new Block(4, Material.STONE)).c(2.0F).b(10.0F).a(j).c("stonebrick").a(CreativeModeTab.b);
|
||||
public static final Block WOOD = (new BlockWood(5)).c(2.0F).b(5.0F).a(g).c("wood");
|
||||
public static final Block SAPLING = (new BlockSapling(6)).c(0.0F).a(i).c("sapling");
|
||||
public static final Block BEDROCK = (new Block(7, Material.STONE)).r().b(6000000.0F).a(j).c("bedrock").D().a(CreativeModeTab.b);
|
||||
public static final BlockFluids WATER = (BlockFluids) (new BlockFlowing(8, Material.WATER)).c(100.0F).k(3).c("water").D();
|
||||
public static final Block STATIONARY_WATER = (new BlockStationary(9, Material.WATER)).c(100.0F).k(3).c("water").D();
|
||||
public static final BlockFluids LAVA = (BlockFluids) (new BlockFlowing(10, Material.LAVA)).c(0.0F).a(1.0F).c("lava").D();
|
||||
public static final Block STATIONARY_LAVA = (new BlockStationary(11, Material.LAVA)).c(100.0F).a(1.0F).c("lava").D();
|
||||
public static final Block SAND = (new BlockSand(12)).c(0.5F).a(n).c("sand");
|
||||
public static final Block GRAVEL = (new BlockGravel(13)).c(0.6F).a(h).c("gravel");
|
||||
public static final Block GOLD_ORE = (new BlockOre(14)).c(3.0F).b(5.0F).a(j).c("oreGold");
|
||||
public static final Block IRON_ORE = (new BlockOre(15)).c(3.0F).b(5.0F).a(j).c("oreIron");
|
||||
public static final Block COAL_ORE = (new BlockOre(16)).c(3.0F).b(5.0F).a(j).c("oreCoal");
|
||||
public static final Block LOG = (new BlockLog(17)).c(2.0F).a(g).c("log");
|
||||
public static final BlockLeaves LEAVES = (BlockLeaves) (new BlockLeaves(18)).c(0.2F).k(1).a(i).c("leaves");
|
||||
public static final Block SPONGE = (new BlockSponge(19)).c(0.6F).a(i).c("sponge");
|
||||
public static final Block GLASS = (new BlockGlass(20, Material.SHATTERABLE, false)).c(0.3F).a(l).c("glass");
|
||||
public static final Block LAPIS_ORE = (new BlockOre(21)).c(3.0F).b(5.0F).a(j).c("oreLapis");
|
||||
public static final Block LAPIS_BLOCK = (new Block(22, Material.STONE)).c(3.0F).b(5.0F).a(j).c("blockLapis").a(CreativeModeTab.b);
|
||||
public static final Block DISPENSER = (new BlockDispenser(23)).c(3.5F).a(j).c("dispenser");
|
||||
public static final Block SANDSTONE = (new BlockSandStone(24)).a(j).c(0.8F).c("sandStone");
|
||||
public static final Block NOTE_BLOCK = (new BlockNote(25)).c(0.8F).c("musicBlock");
|
||||
public static final Block BED = (new BlockBed(26)).c(0.2F).c("bed").D();
|
||||
public static final Block GOLDEN_RAIL = (new BlockPoweredRail(27)).c(0.7F).a(k).c("goldenRail");
|
||||
public static final Block DETECTOR_RAIL = (new BlockMinecartDetector(28)).c(0.7F).a(k).c("detectorRail");
|
||||
public static boolean[] x = new boolean[4096];
|
||||
public static final Block STONE = (new BlockStone(1)).c(1.5F).b(10.0F).a(k).c("stone").d("stone");
|
||||
public static final BlockGrass GRASS = (BlockGrass) (new BlockGrass(2)).c(0.6F).a(j).c("grass").d("grass");
|
||||
public static final Block DIRT = (new BlockDirt(3)).c(0.5F).a(i).c("dirt").d("dirt");
|
||||
public static final Block COBBLESTONE = (new Block(4, Material.STONE)).c(2.0F).b(10.0F).a(k).c("stonebrick").a(CreativeModeTab.b).d("cobblestone");
|
||||
public static final Block WOOD = (new BlockWood(5)).c(2.0F).b(5.0F).a(h).c("wood").d("planks");
|
||||
public static final Block SAPLING = (new BlockSapling(6)).c(0.0F).a(j).c("sapling").d("sapling");
|
||||
public static final Block BEDROCK = (new Block(7, Material.STONE)).r().b(6000000.0F).a(k).c("bedrock").C().a(CreativeModeTab.b).d("bedrock");
|
||||
public static final BlockFluids WATER = (BlockFluids) (new BlockFlowing(8, Material.WATER)).c(100.0F).k(3).c("water").C().d("water_flow");
|
||||
public static final Block STATIONARY_WATER = (new BlockStationary(9, Material.WATER)).c(100.0F).k(3).c("water").C().d("water_still");
|
||||
public static final BlockFluids LAVA = (BlockFluids) (new BlockFlowing(10, Material.LAVA)).c(0.0F).a(1.0F).c("lava").C().d("lava_flow");
|
||||
public static final Block STATIONARY_LAVA = (new BlockStationary(11, Material.LAVA)).c(100.0F).a(1.0F).c("lava").C().d("lava_still");
|
||||
public static final Block SAND = (new BlockSand(12)).c(0.5F).a(o).c("sand").d("sand");
|
||||
public static final Block GRAVEL = (new BlockGravel(13)).c(0.6F).a(i).c("gravel").d("gravel");
|
||||
public static final Block GOLD_ORE = (new BlockOre(14)).c(3.0F).b(5.0F).a(k).c("oreGold").d("gold_ore");
|
||||
public static final Block IRON_ORE = (new BlockOre(15)).c(3.0F).b(5.0F).a(k).c("oreIron").d("iron_ore");
|
||||
public static final Block COAL_ORE = (new BlockOre(16)).c(3.0F).b(5.0F).a(k).c("oreCoal").d("coal_ore");
|
||||
public static final Block LOG = (new BlockLog(17)).c(2.0F).a(h).c("log").d("log");
|
||||
public static final BlockLeaves LEAVES = (BlockLeaves) (new BlockLeaves(18)).c(0.2F).k(1).a(j).c("leaves").d("leaves");
|
||||
public static final Block SPONGE = (new BlockSponge(19)).c(0.6F).a(j).c("sponge").d("sponge");
|
||||
public static final Block GLASS = (new BlockGlass(20, Material.SHATTERABLE, false)).c(0.3F).a(m).c("glass").d("glass");
|
||||
public static final Block LAPIS_ORE = (new BlockOre(21)).c(3.0F).b(5.0F).a(k).c("oreLapis").d("lapis_ore");
|
||||
public static final Block LAPIS_BLOCK = (new Block(22, Material.STONE)).c(3.0F).b(5.0F).a(k).c("blockLapis").a(CreativeModeTab.b).d("lapis_block");
|
||||
public static final Block DISPENSER = (new BlockDispenser(23)).c(3.5F).a(k).c("dispenser").d("dispenser");
|
||||
public static final Block SANDSTONE = (new BlockSandStone(24)).a(k).c(0.8F).c("sandStone").d("sandstone");
|
||||
public static final Block NOTE_BLOCK = (new BlockNote(25)).c(0.8F).c("musicBlock").d("noteblock");
|
||||
public static final Block BED = (new BlockBed(26)).c(0.2F).c("bed").C().d("bed");
|
||||
public static final Block GOLDEN_RAIL = (new BlockPoweredRail(27)).c(0.7F).a(l).c("goldenRail").d("rail_golden");
|
||||
public static final Block DETECTOR_RAIL = (new BlockMinecartDetector(28)).c(0.7F).a(l).c("detectorRail").d("rail_detector");
|
||||
public static final BlockPiston PISTON_STICKY = (BlockPiston) (new BlockPiston(29, true)).c("pistonStickyBase");
|
||||
public static final Block WEB = (new BlockWeb(30)).k(1).c(4.0F).c("web");
|
||||
public static final BlockLongGrass LONG_GRASS = (BlockLongGrass) (new BlockLongGrass(31)).c(0.0F).a(i).c("tallgrass");
|
||||
public static final BlockDeadBush DEAD_BUSH = (BlockDeadBush) (new BlockDeadBush(32)).c(0.0F).a(i).c("deadbush");
|
||||
public static final Block WEB = (new BlockWeb(30)).k(1).c(4.0F).c("web").d("web");
|
||||
public static final BlockLongGrass LONG_GRASS = (BlockLongGrass) (new BlockLongGrass(31)).c(0.0F).a(j).c("tallgrass");
|
||||
public static final BlockDeadBush DEAD_BUSH = (BlockDeadBush) (new BlockDeadBush(32)).c(0.0F).a(j).c("deadbush").d("deadbush");
|
||||
public static final BlockPiston PISTON = (BlockPiston) (new BlockPiston(33, false)).c("pistonBase");
|
||||
public static final BlockPistonExtension PISTON_EXTENSION = new BlockPistonExtension(34);
|
||||
public static final Block WOOL = (new BlockCloth()).c(0.8F).a(m).c("cloth");
|
||||
public static final Block WOOL = (new BlockCloth(35, Material.CLOTH)).c(0.8F).a(n).c("cloth").d("wool_colored");
|
||||
public static final BlockPistonMoving PISTON_MOVING = new BlockPistonMoving(36);
|
||||
public static final BlockFlower YELLOW_FLOWER = (BlockFlower) (new BlockFlower(37)).c(0.0F).a(i).c("flower");
|
||||
public static final BlockFlower RED_ROSE = (BlockFlower) (new BlockFlower(38)).c(0.0F).a(i).c("rose");
|
||||
public static final BlockFlower BROWN_MUSHROOM = (BlockFlower) (new BlockMushroom(39, "mushroom_brown")).c(0.0F).a(i).a(0.125F).c("mushroom");
|
||||
public static final BlockFlower RED_MUSHROOM = (BlockFlower) (new BlockMushroom(40, "mushroom_red")).c(0.0F).a(i).c("mushroom");
|
||||
public static final Block GOLD_BLOCK = (new BlockOreBlock(41)).c(3.0F).b(10.0F).a(k).c("blockGold");
|
||||
public static final Block IRON_BLOCK = (new BlockOreBlock(42)).c(5.0F).b(10.0F).a(k).c("blockIron");
|
||||
public static final BlockStepAbstract DOUBLE_STEP = (BlockStepAbstract) (new BlockStep(43, true)).c(2.0F).b(10.0F).a(j).c("stoneSlab");
|
||||
public static final BlockStepAbstract STEP = (BlockStepAbstract) (new BlockStep(44, false)).c(2.0F).b(10.0F).a(j).c("stoneSlab");
|
||||
public static final Block BRICK = (new Block(45, Material.STONE)).c(2.0F).b(10.0F).a(j).c("brick").a(CreativeModeTab.b);
|
||||
public static final Block TNT = (new BlockTNT(46)).c(0.0F).a(i).c("tnt");
|
||||
public static final Block BOOKSHELF = (new BlockBookshelf(47)).c(1.5F).a(g).c("bookshelf");
|
||||
public static final Block MOSSY_COBBLESTONE = (new Block(48, Material.STONE)).c(2.0F).b(10.0F).a(j).c("stoneMoss").a(CreativeModeTab.b);
|
||||
public static final Block OBSIDIAN = (new BlockObsidian(49)).c(50.0F).b(2000.0F).a(j).c("obsidian");
|
||||
public static final Block TORCH = (new BlockTorch(50)).c(0.0F).a(0.9375F).a(g).c("torch");
|
||||
public static final BlockFire FIRE = (BlockFire) (new BlockFire(51)).c(0.0F).a(1.0F).a(g).c("fire").D();
|
||||
public static final Block MOB_SPAWNER = (new BlockMobSpawner(52)).c(5.0F).a(k).c("mobSpawner").D();
|
||||
public static final BlockFlower YELLOW_FLOWER = (BlockFlower) (new BlockFlower(37)).c(0.0F).a(j).c("flower").d("flower_dandelion");
|
||||
public static final BlockFlower RED_ROSE = (BlockFlower) (new BlockFlower(38)).c(0.0F).a(j).c("rose").d("flower_rose");
|
||||
public static final BlockFlower BROWN_MUSHROOM = (BlockFlower) (new BlockMushroom(39)).c(0.0F).a(j).a(0.125F).c("mushroom").d("mushroom_brown");
|
||||
public static final BlockFlower RED_MUSHROOM = (BlockFlower) (new BlockMushroom(40)).c(0.0F).a(j).c("mushroom").d("mushroom_red");
|
||||
public static final Block GOLD_BLOCK = (new BlockOreBlock(41)).c(3.0F).b(10.0F).a(l).c("blockGold").d("gold_block");
|
||||
public static final Block IRON_BLOCK = (new BlockOreBlock(42)).c(5.0F).b(10.0F).a(l).c("blockIron").d("iron_block");
|
||||
public static final BlockStepAbstract DOUBLE_STEP = (BlockStepAbstract) (new BlockStep(43, true)).c(2.0F).b(10.0F).a(k).c("stoneSlab");
|
||||
public static final BlockStepAbstract STEP = (BlockStepAbstract) (new BlockStep(44, false)).c(2.0F).b(10.0F).a(k).c("stoneSlab");
|
||||
public static final Block BRICK = (new Block(45, Material.STONE)).c(2.0F).b(10.0F).a(k).c("brick").a(CreativeModeTab.b).d("brick");
|
||||
public static final Block TNT = (new BlockTNT(46)).c(0.0F).a(j).c("tnt").d("tnt");
|
||||
public static final Block BOOKSHELF = (new BlockBookshelf(47)).c(1.5F).a(h).c("bookshelf").d("bookshelf");
|
||||
public static final Block MOSSY_COBBLESTONE = (new Block(48, Material.STONE)).c(2.0F).b(10.0F).a(k).c("stoneMoss").a(CreativeModeTab.b).d("cobblestone_mossy");
|
||||
public static final Block OBSIDIAN = (new BlockObsidian(49)).c(50.0F).b(2000.0F).a(k).c("obsidian").d("obsidian");
|
||||
public static final Block TORCH = (new BlockTorch(50)).c(0.0F).a(0.9375F).a(h).c("torch").d("torch_on");
|
||||
public static final BlockFire FIRE = (BlockFire) (new BlockFire(51)).c(0.0F).a(1.0F).a(h).c("fire").C().d("fire");
|
||||
public static final Block MOB_SPAWNER = (new BlockMobSpawner(52)).c(5.0F).a(l).c("mobSpawner").C().d("mob_spawner");
|
||||
public static final Block WOOD_STAIRS = (new BlockStairs(53, WOOD, 0)).c("stairsWood");
|
||||
public static final BlockChest CHEST = (BlockChest) (new BlockChest(54, 0)).c(2.5F).a(g).c("chest");
|
||||
public static final BlockRedstoneWire REDSTONE_WIRE = (BlockRedstoneWire) (new BlockRedstoneWire(55)).c(0.0F).a(f).c("redstoneDust").D();
|
||||
public static final Block DIAMOND_ORE = (new BlockOre(56)).c(3.0F).b(5.0F).a(j).c("oreDiamond");
|
||||
public static final Block DIAMOND_BLOCK = (new BlockOreBlock(57)).c(5.0F).b(10.0F).a(k).c("blockDiamond");
|
||||
public static final Block WORKBENCH = (new BlockWorkbench(58)).c(2.5F).a(g).c("workbench");
|
||||
public static final Block CROPS = (new BlockCrops(59)).c("crops");
|
||||
public static final Block SOIL = (new BlockSoil(60)).c(0.6F).a(h).c("farmland");
|
||||
public static final Block FURNACE = (new BlockFurnace(61, false)).c(3.5F).a(j).c("furnace").a(CreativeModeTab.c);
|
||||
public static final Block BURNING_FURNACE = (new BlockFurnace(62, true)).c(3.5F).a(j).a(0.875F).c("furnace");
|
||||
public static final Block SIGN_POST = (new BlockSign(63, TileEntitySign.class, true)).c(1.0F).a(g).c("sign").D();
|
||||
public static final Block WOODEN_DOOR = (new BlockDoor(64, Material.WOOD)).c(3.0F).a(g).c("doorWood").D();
|
||||
public static final Block LADDER = (new BlockLadder(65)).c(0.4F).a(p).c("ladder");
|
||||
public static final Block RAILS = (new BlockMinecartTrack(66)).c(0.7F).a(k).c("rail");
|
||||
public static final BlockChest CHEST = (BlockChest) (new BlockChest(54, 0)).c(2.5F).a(h).c("chest");
|
||||
public static final BlockRedstoneWire REDSTONE_WIRE = (BlockRedstoneWire) (new BlockRedstoneWire(55)).c(0.0F).a(g).c("redstoneDust").C().d("redstone_dust");
|
||||
public static final Block DIAMOND_ORE = (new BlockOre(56)).c(3.0F).b(5.0F).a(k).c("oreDiamond").d("diamond_ore");
|
||||
public static final Block DIAMOND_BLOCK = (new BlockOreBlock(57)).c(5.0F).b(10.0F).a(l).c("blockDiamond").d("diamond_block");
|
||||
public static final Block WORKBENCH = (new BlockWorkbench(58)).c(2.5F).a(h).c("workbench").d("crafting_table");
|
||||
public static final Block CROPS = (new BlockCrops(59)).c("crops").d("wheat");
|
||||
public static final Block SOIL = (new BlockSoil(60)).c(0.6F).a(i).c("farmland").d("farmland");
|
||||
public static final Block FURNACE = (new BlockFurnace(61, false)).c(3.5F).a(k).c("furnace").a(CreativeModeTab.c);
|
||||
public static final Block BURNING_FURNACE = (new BlockFurnace(62, true)).c(3.5F).a(k).a(0.875F).c("furnace");
|
||||
public static final Block SIGN_POST = (new BlockSign(63, TileEntitySign.class, true)).c(1.0F).a(h).c("sign").C();
|
||||
public static final Block WOODEN_DOOR = (new BlockDoor(64, Material.WOOD)).c(3.0F).a(h).c("doorWood").C().d("door_wood");
|
||||
public static final Block LADDER = (new BlockLadder(65)).c(0.4F).a(q).c("ladder").d("ladder");
|
||||
public static final Block RAILS = (new BlockMinecartTrack(66)).c(0.7F).a(l).c("rail").d("rail_normal");
|
||||
public static final Block COBBLESTONE_STAIRS = (new BlockStairs(67, COBBLESTONE, 0)).c("stairsStone");
|
||||
public static final Block WALL_SIGN = (new BlockSign(68, TileEntitySign.class, false)).c(1.0F).a(g).c("sign").D();
|
||||
public static final Block LEVER = (new BlockLever(69)).c(0.5F).a(g).c("lever");
|
||||
public static final Block STONE_PLATE = (new BlockPressurePlateBinary(70, "stone", Material.STONE, EnumMobType.MOBS)).c(0.5F).a(j).c("pressurePlate");
|
||||
public static final Block IRON_DOOR_BLOCK = (new BlockDoor(71, Material.ORE)).c(5.0F).a(k).c("doorIron").D();
|
||||
public static final Block WOOD_PLATE = (new BlockPressurePlateBinary(72, "wood", Material.WOOD, EnumMobType.EVERYTHING)).c(0.5F).a(g).c("pressurePlate");
|
||||
public static final Block REDSTONE_ORE = (new BlockRedstoneOre(73, false)).c(3.0F).b(5.0F).a(j).c("oreRedstone").a(CreativeModeTab.b);
|
||||
public static final Block GLOWING_REDSTONE_ORE = (new BlockRedstoneOre(74, true)).a(0.625F).c(3.0F).b(5.0F).a(j).c("oreRedstone");
|
||||
public static final Block REDSTONE_TORCH_OFF = (new BlockRedstoneTorch(75, false)).c(0.0F).a(g).c("notGate");
|
||||
public static final Block REDSTONE_TORCH_ON = (new BlockRedstoneTorch(76, true)).c(0.0F).a(0.5F).a(g).c("notGate").a(CreativeModeTab.d);
|
||||
public static final Block STONE_BUTTON = (new BlockStoneButton(77)).c(0.5F).a(j).c("button");
|
||||
public static final Block SNOW = (new BlockSnow(78)).c(0.1F).a(o).c("snow").k(0);
|
||||
public static final Block ICE = (new BlockIce(79)).c(0.5F).k(3).a(l).c("ice");
|
||||
public static final Block SNOW_BLOCK = (new BlockSnowBlock(80)).c(0.2F).a(o).c("snow");
|
||||
public static final Block CACTUS = (new BlockCactus(81)).c(0.4F).a(m).c("cactus");
|
||||
public static final Block CLAY = (new BlockClay(82)).c(0.6F).a(h).c("clay");
|
||||
public static final Block SUGAR_CANE_BLOCK = (new BlockReed(83)).c(0.0F).a(i).c("reeds").D();
|
||||
public static final Block JUKEBOX = (new BlockJukeBox(84)).c(2.0F).b(10.0F).a(j).c("jukebox");
|
||||
public static final Block FENCE = (new BlockFence(85, "wood", Material.WOOD)).c(2.0F).b(5.0F).a(g).c("fence");
|
||||
public static final Block PUMPKIN = (new BlockPumpkin(86, false)).c(1.0F).a(g).c("pumpkin");
|
||||
public static final Block NETHERRACK = (new BlockBloodStone(87)).c(0.4F).a(j).c("hellrock");
|
||||
public static final Block SOUL_SAND = (new BlockSlowSand(88)).c(0.5F).a(n).c("hellsand");
|
||||
public static final Block GLOWSTONE = (new BlockLightStone(89, Material.SHATTERABLE)).c(0.3F).a(l).a(1.0F).c("lightgem");
|
||||
public static final BlockPortal PORTAL = (BlockPortal) (new BlockPortal(90)).c(-1.0F).a(l).a(0.75F).c("portal");
|
||||
public static final Block JACK_O_LANTERN = (new BlockPumpkin(91, true)).c(1.0F).a(g).a(1.0F).c("litpumpkin");
|
||||
public static final Block CAKE_BLOCK = (new BlockCake(92)).c(0.5F).a(m).c("cake").D();
|
||||
public static final BlockRepeater DIODE_OFF = (BlockRepeater) (new BlockRepeater(93, false)).c(0.0F).a(g).c("diode").D();
|
||||
public static final BlockRepeater DIODE_ON = (BlockRepeater) (new BlockRepeater(94, true)).c(0.0F).a(0.625F).a(g).c("diode").D();
|
||||
public static final Block LOCKED_CHEST = (new BlockLockedChest(95)).c(0.0F).a(1.0F).a(g).c("lockedchest").b(true);
|
||||
public static final Block TRAP_DOOR = (new BlockTrapdoor(96, Material.WOOD)).c(3.0F).a(g).c("trapdoor").D();
|
||||
public static final Block WALL_SIGN = (new BlockSign(68, TileEntitySign.class, false)).c(1.0F).a(h).c("sign").C();
|
||||
public static final Block LEVER = (new BlockLever(69)).c(0.5F).a(h).c("lever").d("lever");
|
||||
public static final Block STONE_PLATE = (new BlockPressurePlateBinary(70, "stone", Material.STONE, EnumMobType.MOBS)).c(0.5F).a(k).c("pressurePlate");
|
||||
public static final Block IRON_DOOR_BLOCK = (new BlockDoor(71, Material.ORE)).c(5.0F).a(l).c("doorIron").C().d("door_iron");
|
||||
public static final Block WOOD_PLATE = (new BlockPressurePlateBinary(72, "planks_oak", Material.WOOD, EnumMobType.EVERYTHING)).c(0.5F).a(h).c("pressurePlate");
|
||||
public static final Block REDSTONE_ORE = (new BlockRedstoneOre(73, false)).c(3.0F).b(5.0F).a(k).c("oreRedstone").a(CreativeModeTab.b).d("redstone_ore");
|
||||
public static final Block GLOWING_REDSTONE_ORE = (new BlockRedstoneOre(74, true)).a(0.625F).c(3.0F).b(5.0F).a(k).c("oreRedstone").d("redstone_ore");
|
||||
public static final Block REDSTONE_TORCH_OFF = (new BlockRedstoneTorch(75, false)).c(0.0F).a(h).c("notGate").d("redstone_torch_off");
|
||||
public static final Block REDSTONE_TORCH_ON = (new BlockRedstoneTorch(76, true)).c(0.0F).a(0.5F).a(h).c("notGate").a(CreativeModeTab.d).d("redstone_torch_on");
|
||||
public static final Block STONE_BUTTON = (new BlockStoneButton(77)).c(0.5F).a(k).c("button");
|
||||
public static final Block SNOW = (new BlockSnow(78)).c(0.1F).a(p).c("snow").k(0).d("snow");
|
||||
public static final Block ICE = (new BlockIce(79)).c(0.5F).k(3).a(m).c("ice").d("ice");
|
||||
public static final Block SNOW_BLOCK = (new BlockSnowBlock(80)).c(0.2F).a(p).c("snow").d("snow");
|
||||
public static final Block CACTUS = (new BlockCactus(81)).c(0.4F).a(n).c("cactus").d("cactus");
|
||||
public static final Block CLAY = (new BlockClay(82)).c(0.6F).a(i).c("clay").d("clay");
|
||||
public static final Block SUGAR_CANE_BLOCK = (new BlockReed(83)).c(0.0F).a(j).c("reeds").C().d("reeds");
|
||||
public static final Block JUKEBOX = (new BlockJukeBox(84)).c(2.0F).b(10.0F).a(k).c("jukebox").d("jukebox");
|
||||
public static final Block FENCE = (new BlockFence(85, "planks_oak", Material.WOOD)).c(2.0F).b(5.0F).a(h).c("fence");
|
||||
public static final Block PUMPKIN = (new BlockPumpkin(86, false)).c(1.0F).a(h).c("pumpkin").d("pumpkin");
|
||||
public static final Block NETHERRACK = (new BlockBloodStone(87)).c(0.4F).a(k).c("hellrock").d("netherrack");
|
||||
public static final Block SOUL_SAND = (new BlockSlowSand(88)).c(0.5F).a(o).c("hellsand").d("soul_sand");
|
||||
public static final Block GLOWSTONE = (new BlockLightStone(89, Material.SHATTERABLE)).c(0.3F).a(m).a(1.0F).c("lightgem").d("glowstone");
|
||||
public static final BlockPortal PORTAL = (BlockPortal) (new BlockPortal(90)).c(-1.0F).a(m).a(0.75F).c("portal").d("portal");
|
||||
public static final Block JACK_O_LANTERN = (new BlockPumpkin(91, true)).c(1.0F).a(h).a(1.0F).c("litpumpkin").d("pumpkin");
|
||||
public static final Block CAKE_BLOCK = (new BlockCake(92)).c(0.5F).a(n).c("cake").C().d("cake");
|
||||
public static final BlockRepeater DIODE_OFF = (BlockRepeater) (new BlockRepeater(93, false)).c(0.0F).a(h).c("diode").C().d("repeater_off");
|
||||
public static final BlockRepeater DIODE_ON = (BlockRepeater) (new BlockRepeater(94, true)).c(0.0F).a(0.625F).a(h).c("diode").C().d("repeater_on");
|
||||
public static final Block LOCKED_CHEST = (new BlockLockedChest(95)).c(0.0F).a(1.0F).a(h).c("lockedchest").b(true);
|
||||
public static final Block TRAP_DOOR = (new BlockTrapdoor(96, Material.WOOD)).c(3.0F).a(h).c("trapdoor").C().d("trapdoor");
|
||||
public static final Block MONSTER_EGGS = (new BlockMonsterEggs(97)).c(0.75F).c("monsterStoneEgg");
|
||||
public static final Block SMOOTH_BRICK = (new BlockSmoothBrick(98)).c(1.5F).b(10.0F).a(j).c("stonebricksmooth");
|
||||
public static final Block BIG_MUSHROOM_1 = (new BlockHugeMushroom(99, Material.WOOD, 0)).c(0.2F).a(g).c("mushroom");
|
||||
public static final Block BIG_MUSHROOM_2 = (new BlockHugeMushroom(100, Material.WOOD, 1)).c(0.2F).a(g).c("mushroom");
|
||||
public static final Block IRON_FENCE = (new BlockThinFence(101, "fenceIron", "fenceIron", Material.ORE, true)).c(5.0F).b(10.0F).a(k).c("fenceIron");
|
||||
public static final Block THIN_GLASS = (new BlockThinFence(102, "glass", "thinglass_top", Material.SHATTERABLE, false)).c(0.3F).a(l).c("thinGlass");
|
||||
public static final Block MELON = (new BlockMelon(103)).c(1.0F).a(g).c("melon");
|
||||
public static final Block PUMPKIN_STEM = (new BlockStem(104, PUMPKIN)).c(0.0F).a(g).c("pumpkinStem");
|
||||
public static final Block MELON_STEM = (new BlockStem(105, MELON)).c(0.0F).a(g).c("pumpkinStem");
|
||||
public static final Block VINE = (new BlockVine(106)).c(0.2F).a(i).c("vine");
|
||||
public static final Block FENCE_GATE = (new BlockFenceGate(107)).c(2.0F).b(5.0F).a(g).c("fenceGate");
|
||||
public static final Block SMOOTH_BRICK = (new BlockSmoothBrick(98)).c(1.5F).b(10.0F).a(k).c("stonebricksmooth").d("stonebrick");
|
||||
public static final Block BIG_MUSHROOM_1 = (new BlockHugeMushroom(99, Material.WOOD, 0)).c(0.2F).a(h).c("mushroom").d("mushroom_block");
|
||||
public static final Block BIG_MUSHROOM_2 = (new BlockHugeMushroom(100, Material.WOOD, 1)).c(0.2F).a(h).c("mushroom").d("mushroom_block");
|
||||
public static final Block IRON_FENCE = (new BlockThinFence(101, "iron_bars", "iron_bars", Material.ORE, true)).c(5.0F).b(10.0F).a(l).c("fenceIron");
|
||||
public static final Block THIN_GLASS = (new BlockThinFence(102, "glass", "glass_pane_top", Material.SHATTERABLE, false)).c(0.3F).a(m).c("thinGlass");
|
||||
public static final Block MELON = (new BlockMelon(103)).c(1.0F).a(h).c("melon").d("melon");
|
||||
public static final Block PUMPKIN_STEM = (new BlockStem(104, PUMPKIN)).c(0.0F).a(h).c("pumpkinStem").d("pumpkin_stem");
|
||||
public static final Block MELON_STEM = (new BlockStem(105, MELON)).c(0.0F).a(h).c("pumpkinStem").d("melon_stem");
|
||||
public static final Block VINE = (new BlockVine(106)).c(0.2F).a(j).c("vine").d("vine");
|
||||
public static final Block FENCE_GATE = (new BlockFenceGate(107)).c(2.0F).b(5.0F).a(h).c("fenceGate");
|
||||
public static final Block BRICK_STAIRS = (new BlockStairs(108, BRICK, 0)).c("stairsBrick");
|
||||
public static final Block STONE_STAIRS = (new BlockStairs(109, SMOOTH_BRICK, 0)).c("stairsStoneBrickSmooth");
|
||||
public static final BlockMycel MYCEL = (BlockMycel) (new BlockMycel(110)).c(0.6F).a(i).c("mycel");
|
||||
public static final Block WATER_LILY = (new BlockWaterLily(111)).c(0.0F).a(i).c("waterlily");
|
||||
public static final Block NETHER_BRICK = (new Block(112, Material.STONE)).c(2.0F).b(10.0F).a(j).c("netherBrick").a(CreativeModeTab.b);
|
||||
public static final Block NETHER_FENCE = (new BlockFence(113, "netherBrick", Material.STONE)).c(2.0F).b(10.0F).a(j).c("netherFence");
|
||||
public static final BlockMycel MYCEL = (BlockMycel) (new BlockMycel(110)).c(0.6F).a(j).c("mycel").d("mycelium");
|
||||
public static final Block WATER_LILY = (new BlockWaterLily(111)).c(0.0F).a(j).c("waterlily").d("waterlily");
|
||||
public static final Block NETHER_BRICK = (new Block(112, Material.STONE)).c(2.0F).b(10.0F).a(k).c("netherBrick").a(CreativeModeTab.b).d("nether_brick");
|
||||
public static final Block NETHER_FENCE = (new BlockFence(113, "nether_brick", Material.STONE)).c(2.0F).b(10.0F).a(k).c("netherFence");
|
||||
public static final Block NETHER_BRICK_STAIRS = (new BlockStairs(114, NETHER_BRICK, 0)).c("stairsNetherBrick");
|
||||
public static final Block NETHER_WART = (new BlockNetherWart(115)).c("netherStalk");
|
||||
public static final Block ENCHANTMENT_TABLE = (new BlockEnchantmentTable(116)).c(5.0F).b(2000.0F).c("enchantmentTable");
|
||||
public static final Block BREWING_STAND = (new BlockBrewingStand(117)).c(0.5F).a(0.125F).c("brewingStand");
|
||||
public static final BlockCauldron CAULDRON = (BlockCauldron) (new BlockCauldron(118)).c(2.0F).c("cauldron");
|
||||
public static final Block NETHER_WART = (new BlockNetherWart(115)).c("netherStalk").d("nether_wart");
|
||||
public static final Block ENCHANTMENT_TABLE = (new BlockEnchantmentTable(116)).c(5.0F).b(2000.0F).c("enchantmentTable").d("enchanting_table");
|
||||
public static final Block BREWING_STAND = (new BlockBrewingStand(117)).c(0.5F).a(0.125F).c("brewingStand").d("brewing_stand");
|
||||
public static final BlockCauldron CAULDRON = (BlockCauldron) (new BlockCauldron(118)).c(2.0F).c("cauldron").d("cauldron");
|
||||
public static final Block ENDER_PORTAL = (new BlockEnderPortal(119, Material.PORTAL)).c(-1.0F).b(6000000.0F);
|
||||
public static final Block ENDER_PORTAL_FRAME = (new BlockEnderPortalFrame(120)).a(l).a(0.125F).c(-1.0F).c("endPortalFrame").b(6000000.0F).a(CreativeModeTab.c);
|
||||
public static final Block WHITESTONE = (new Block(121, Material.STONE)).c(3.0F).b(15.0F).a(j).c("whiteStone").a(CreativeModeTab.b);
|
||||
public static final Block DRAGON_EGG = (new BlockDragonEgg(122)).c(3.0F).b(15.0F).a(j).a(0.125F).c("dragonEgg");
|
||||
public static final Block REDSTONE_LAMP_OFF = (new BlockRedstoneLamp(123, false)).c(0.3F).a(l).c("redstoneLight").a(CreativeModeTab.d);
|
||||
public static final Block REDSTONE_LAMP_ON = (new BlockRedstoneLamp(124, true)).c(0.3F).a(l).c("redstoneLight");
|
||||
public static final BlockStepAbstract WOOD_DOUBLE_STEP = (BlockStepAbstract) (new BlockWoodStep(125, true)).c(2.0F).b(5.0F).a(g).c("woodSlab");
|
||||
public static final BlockStepAbstract WOOD_STEP = (BlockStepAbstract) (new BlockWoodStep(126, false)).c(2.0F).b(5.0F).a(g).c("woodSlab");
|
||||
public static final Block COCOA = (new BlockCocoa(127)).c(0.2F).b(5.0F).a(g).c("cocoa");
|
||||
public static final Block ENDER_PORTAL_FRAME = (new BlockEnderPortalFrame(120)).a(m).a(0.125F).c(-1.0F).c("endPortalFrame").b(6000000.0F).a(CreativeModeTab.c).d("endframe");
|
||||
public static final Block WHITESTONE = (new Block(121, Material.STONE)).c(3.0F).b(15.0F).a(k).c("whiteStone").a(CreativeModeTab.b).d("end_stone");
|
||||
public static final Block DRAGON_EGG = (new BlockDragonEgg(122)).c(3.0F).b(15.0F).a(k).a(0.125F).c("dragonEgg").d("dragon_egg");
|
||||
public static final Block REDSTONE_LAMP_OFF = (new BlockRedstoneLamp(123, false)).c(0.3F).a(m).c("redstoneLight").a(CreativeModeTab.d).d("redstone_lamp_off");
|
||||
public static final Block REDSTONE_LAMP_ON = (new BlockRedstoneLamp(124, true)).c(0.3F).a(m).c("redstoneLight").d("redstone_lamp_on");
|
||||
public static final BlockStepAbstract WOOD_DOUBLE_STEP = (BlockStepAbstract) (new BlockWoodStep(125, true)).c(2.0F).b(5.0F).a(h).c("woodSlab");
|
||||
public static final BlockStepAbstract WOOD_STEP = (BlockStepAbstract) (new BlockWoodStep(126, false)).c(2.0F).b(5.0F).a(h).c("woodSlab");
|
||||
public static final Block COCOA = (new BlockCocoa(127)).c(0.2F).b(5.0F).a(h).c("cocoa").d("cocoa");
|
||||
public static final Block SANDSTONE_STAIRS = (new BlockStairs(128, SANDSTONE, 0)).c("stairsSandStone");
|
||||
public static final Block EMERALD_ORE = (new BlockOre(129)).c(3.0F).b(5.0F).a(j).c("oreEmerald");
|
||||
public static final Block ENDER_CHEST = (new BlockEnderChest(130)).c(22.5F).b(1000.0F).a(j).c("enderChest").a(0.5F);
|
||||
public static final BlockTripwireHook TRIPWIRE_SOURCE = (BlockTripwireHook) (new BlockTripwireHook(131)).c("tripWireSource");
|
||||
public static final Block TRIPWIRE = (new BlockTripwire(132)).c("tripWire");
|
||||
public static final Block EMERALD_BLOCK = (new BlockOreBlock(133)).c(5.0F).b(10.0F).a(k).c("blockEmerald");
|
||||
public static final Block EMERALD_ORE = (new BlockOre(129)).c(3.0F).b(5.0F).a(k).c("oreEmerald").d("emerald_ore");
|
||||
public static final Block ENDER_CHEST = (new BlockEnderChest(130)).c(22.5F).b(1000.0F).a(k).c("enderChest").a(0.5F);
|
||||
public static final BlockTripwireHook TRIPWIRE_SOURCE = (BlockTripwireHook) (new BlockTripwireHook(131)).c("tripWireSource").d("trip_wire_source");
|
||||
public static final Block TRIPWIRE = (new BlockTripwire(132)).c("tripWire").d("trip_wire");
|
||||
public static final Block EMERALD_BLOCK = (new BlockOreBlock(133)).c(5.0F).b(10.0F).a(l).c("blockEmerald").d("emerald_block");
|
||||
public static final Block SPRUCE_WOOD_STAIRS = (new BlockStairs(134, WOOD, 1)).c("stairsWoodSpruce");
|
||||
public static final Block BIRCH_WOOD_STAIRS = (new BlockStairs(135, WOOD, 2)).c("stairsWoodBirch");
|
||||
public static final Block JUNGLE_WOOD_STAIRS = (new BlockStairs(136, WOOD, 3)).c("stairsWoodJungle");
|
||||
public static final Block COMMAND = (new BlockCommand(137)).c("commandBlock");
|
||||
public static final BlockBeacon BEACON = (BlockBeacon) (new BlockBeacon(138)).c("beacon").a(1.0F);
|
||||
public static final Block COMMAND = (new BlockCommand(137)).r().b(6000000.0F).c("commandBlock").d("command_block");
|
||||
public static final BlockBeacon BEACON = (BlockBeacon) (new BlockBeacon(138)).c("beacon").a(1.0F).d("beacon");
|
||||
public static final Block COBBLE_WALL = (new BlockCobbleWall(139, COBBLESTONE)).c("cobbleWall");
|
||||
public static final Block FLOWER_POT = (new BlockFlowerPot(140)).c(0.0F).a(f).c("flowerPot");
|
||||
public static final Block CARROTS = (new BlockCarrots(141)).c("carrots");
|
||||
public static final Block POTATOES = (new BlockPotatoes(142)).c("potatoes");
|
||||
public static final Block WOOD_BUTTON = (new BlockWoodButton(143)).c(0.5F).a(g).c("button");
|
||||
public static final Block SKULL = (new BlockSkull(144)).c(1.0F).a(j).c("skull");
|
||||
public static final Block ANVIL = (new BlockAnvil(145)).c(5.0F).a(q).b(2000.0F).c("anvil");
|
||||
public static final Block TRAPPED_CHEST = (new BlockChest(146, 1)).c(2.5F).a(g).c("chestTrap");
|
||||
public static final Block GOLD_PLATE = (new BlockPressurePlateWeighted(147, "blockGold", Material.ORE, 64)).c(0.5F).a(g).c("weightedPlate_light");
|
||||
public static final Block IRON_PLATE = (new BlockPressurePlateWeighted(148, "blockIron", Material.ORE, 640)).c(0.5F).a(g).c("weightedPlate_heavy");
|
||||
public static final BlockRedstoneComparator REDSTONE_COMPARATOR_OFF = (BlockRedstoneComparator) (new BlockRedstoneComparator(149, false)).c(0.0F).a(g).c("comparator").D();
|
||||
public static final BlockRedstoneComparator REDSTONE_COMPARATOR_ON = (BlockRedstoneComparator) (new BlockRedstoneComparator(150, true)).c(0.0F).a(0.625F).a(g).c("comparator").D();
|
||||
public static final BlockDaylightDetector DAYLIGHT_DETECTOR = (BlockDaylightDetector) (new BlockDaylightDetector(151)).c(0.2F).a(g).c("daylightDetector");
|
||||
public static final Block REDSTONE_BLOCK = (new BlockRedstone(152)).c(5.0F).b(10.0F).a(k).c("blockRedstone");
|
||||
public static final Block QUARTZ_ORE = (new BlockOre(153)).c(3.0F).b(5.0F).a(j).c("netherquartz");
|
||||
public static final BlockHopper HOPPER = (BlockHopper) (new BlockHopper(154)).c(3.0F).b(8.0F).a(g).c("hopper");
|
||||
public static final Block QUARTZ_BLOCK = (new BlockQuartz(155)).a(j).c(0.8F).c("quartzBlock");
|
||||
public static final Block FLOWER_POT = (new BlockFlowerPot(140)).c(0.0F).a(g).c("flowerPot").d("flower_pot");
|
||||
public static final Block CARROTS = (new BlockCarrots(141)).c("carrots").d("carrots");
|
||||
public static final Block POTATOES = (new BlockPotatoes(142)).c("potatoes").d("potatoes");
|
||||
public static final Block WOOD_BUTTON = (new BlockWoodButton(143)).c(0.5F).a(h).c("button");
|
||||
public static final Block SKULL = (new BlockSkull(144)).c(1.0F).a(k).c("skull").d("skull");
|
||||
public static final Block ANVIL = (new BlockAnvil(145)).c(5.0F).a(r).b(2000.0F).c("anvil");
|
||||
public static final Block TRAPPED_CHEST = (new BlockChest(146, 1)).c(2.5F).a(h).c("chestTrap");
|
||||
public static final Block GOLD_PLATE = (new BlockPressurePlateWeighted(147, "gold_block", Material.ORE, 64)).c(0.5F).a(h).c("weightedPlate_light");
|
||||
public static final Block IRON_PLATE = (new BlockPressurePlateWeighted(148, "iron_block", Material.ORE, 640)).c(0.5F).a(h).c("weightedPlate_heavy");
|
||||
public static final BlockRedstoneComparator REDSTONE_COMPARATOR_OFF = (BlockRedstoneComparator) (new BlockRedstoneComparator(149, false)).c(0.0F).a(h).c("comparator").C().d("comparator_off");
|
||||
public static final BlockRedstoneComparator REDSTONE_COMPARATOR_ON = (BlockRedstoneComparator) (new BlockRedstoneComparator(150, true)).c(0.0F).a(0.625F).a(h).c("comparator").C().d("comparator_on");
|
||||
public static final BlockDaylightDetector DAYLIGHT_DETECTOR = (BlockDaylightDetector) (new BlockDaylightDetector(151)).c(0.2F).a(h).c("daylightDetector").d("daylight_detector");
|
||||
public static final Block REDSTONE_BLOCK = (new BlockRedstone(152)).c(5.0F).b(10.0F).a(l).c("blockRedstone").d("redstone_block");
|
||||
public static final Block QUARTZ_ORE = (new BlockOre(153)).c(3.0F).b(5.0F).a(k).c("netherquartz").d("quartz_ore");
|
||||
public static final BlockHopper HOPPER = (BlockHopper) (new BlockHopper(154)).c(3.0F).b(8.0F).a(h).c("hopper").d("hopper");
|
||||
public static final Block QUARTZ_BLOCK = (new BlockQuartz(155)).a(k).c(0.8F).c("quartzBlock").d("quartz_block");
|
||||
public static final Block QUARTZ_STAIRS = (new BlockStairs(156, QUARTZ_BLOCK, 0)).c("stairsQuartz");
|
||||
public static final Block ACTIVATOR_RAIL = (new BlockPoweredRail(157)).c(0.7F).a(k).c("activatorRail");
|
||||
public static final Block DROPPER = (new BlockDropper(158)).c(3.5F).a(j).c("dropper");
|
||||
public static final Block ACTIVATOR_RAIL = (new BlockPoweredRail(157)).c(0.7F).a(l).c("activatorRail").d("rail_activator");
|
||||
public static final Block DROPPER = (new BlockDropper(158)).c(3.5F).a(k).c("dropper").d("dropper");
|
||||
public static final Block STAINED_HARDENED_CLAY = (new BlockCloth(159, Material.STONE)).c(1.25F).b(7.0F).a(k).c("clayHardenedStained").d("hardened_clay_stained");
|
||||
public static final Block HAY_BLOCK = (new BlockHay(170)).c(0.5F).a(j).c("hayBlock").a(CreativeModeTab.b).d("hay_block");
|
||||
public static final Block WOOL_CARPET = (new BlockCarpet(171)).c(0.1F).a(n).c("woolCarpet").k(0);
|
||||
public static final Block HARDENED_CLAY = (new Block(172, Material.STONE)).c(1.25F).b(7.0F).a(k).c("clayHardened").a(CreativeModeTab.b).d("hardened_clay");
|
||||
public static final Block COAL_BLOCK = (new Block(173, Material.STONE)).c(5.0F).b(10.0F).a(k).c("blockCoal").a(CreativeModeTab.b).d("coal_block");
|
||||
public final int id;
|
||||
protected float strength;
|
||||
protected float durability;
|
||||
protected boolean cC = true;
|
||||
protected boolean cD = true;
|
||||
protected boolean cE;
|
||||
protected boolean cI = true;
|
||||
protected boolean cJ = true;
|
||||
protected boolean cK;
|
||||
protected boolean isTileEntity;
|
||||
protected double minX;
|
||||
protected double minY;
|
||||
@ -196,14 +202,14 @@ public class Block {
|
||||
protected double maxY;
|
||||
protected double maxZ;
|
||||
public StepSound stepSound;
|
||||
public float cN;
|
||||
public float cT;
|
||||
public final Material material;
|
||||
public float frictionFactor;
|
||||
private String name;
|
||||
|
||||
protected Block(int i, Material material) {
|
||||
this.stepSound = f;
|
||||
this.cN = 1.0F;
|
||||
this.stepSound = g;
|
||||
this.cT = 1.0F;
|
||||
this.frictionFactor = 0.6F;
|
||||
if (byId[i] != null) {
|
||||
throw new IllegalArgumentException("Slot " + i + " is already occupied by " + byId[i] + " when adding " + this);
|
||||
@ -212,9 +218,9 @@ public class Block {
|
||||
byId[i] = this;
|
||||
this.id = i;
|
||||
this.a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
s[i] = this.c();
|
||||
t[i] = this.c();
|
||||
lightBlock[i] = this.c() ? 255 : 0;
|
||||
u[i] = !material.blocksLight();
|
||||
v[i] = !material.blocksLight();
|
||||
}
|
||||
}
|
||||
|
||||
@ -277,12 +283,12 @@ public class Block {
|
||||
}
|
||||
|
||||
protected Block b(boolean flag) {
|
||||
this.cE = flag;
|
||||
this.cK = flag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isTicking() {
|
||||
return this.cE;
|
||||
return this.cK;
|
||||
}
|
||||
|
||||
public boolean t() {
|
||||
@ -305,7 +311,7 @@ public class Block {
|
||||
public void a(World world, int i, int j, int k, AxisAlignedBB axisalignedbb, List list, Entity entity) {
|
||||
AxisAlignedBB axisalignedbb1 = this.b(world, i, j, k);
|
||||
|
||||
if (axisalignedbb1 != null && axisalignedbb.a(axisalignedbb1)) {
|
||||
if (axisalignedbb1 != null && axisalignedbb.b(axisalignedbb1)) {
|
||||
list.add(axisalignedbb1);
|
||||
}
|
||||
}
|
||||
@ -587,9 +593,9 @@ public class Block {
|
||||
|
||||
public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
|
||||
entityhuman.a(StatisticList.C[this.id], 1);
|
||||
entityhuman.j(0.025F);
|
||||
entityhuman.a(0.025F);
|
||||
if (this.r_() && EnchantmentManager.hasSilkTouchEnchantment(entityhuman)) {
|
||||
ItemStack itemstack = this.c_(l);
|
||||
ItemStack itemstack = this.d_(l);
|
||||
|
||||
if (itemstack != null) {
|
||||
this.b(world, i, j, k, itemstack);
|
||||
@ -605,10 +611,10 @@ public class Block {
|
||||
return this.b() && !this.isTileEntity;
|
||||
}
|
||||
|
||||
protected ItemStack c_(int i) {
|
||||
protected ItemStack d_(int i) {
|
||||
int j = 0;
|
||||
|
||||
if (this.id >= 0 && this.id < Item.byId.length && Item.byId[this.id].m()) {
|
||||
if (this.id >= 0 && this.id < Item.byId.length && Item.byId[this.id].n()) {
|
||||
j = i;
|
||||
}
|
||||
|
||||
@ -644,12 +650,12 @@ public class Block {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean C() {
|
||||
return this.cD;
|
||||
public boolean B() {
|
||||
return this.cJ;
|
||||
}
|
||||
|
||||
protected Block D() {
|
||||
this.cD = false;
|
||||
protected Block C() {
|
||||
this.cJ = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -698,9 +704,16 @@ public class Block {
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected Block d(String s) {
|
||||
this.f = s;
|
||||
return this;
|
||||
}
|
||||
|
||||
static {
|
||||
Item.byId[WOOL.id] = (new ItemCloth(WOOL.id - 256)).b("cloth");
|
||||
Item.byId[LOG.id] = (new ItemMultiTexture(LOG.id - 256, LOG, BlockLog.a)).b("log");
|
||||
Item.byId[STAINED_HARDENED_CLAY.id] = (new ItemCloth(STAINED_HARDENED_CLAY.id - 256)).b("clayHardenedStained");
|
||||
Item.byId[WOOL_CARPET.id] = (new ItemCloth(WOOL_CARPET.id - 256)).b("woolCarpet");
|
||||
Item.byId[LOG.id] = (new ItemMultiTexture(LOG.id - 256, LOG, BlockLog.b)).b("log");
|
||||
Item.byId[WOOD.id] = (new ItemMultiTexture(WOOD.id - 256, WOOD, BlockWood.a)).b("wood");
|
||||
Item.byId[MONSTER_EGGS.id] = (new ItemMultiTexture(MONSTER_EGGS.id - 256, MONSTER_EGGS, BlockMonsterEggs.a)).b("monsterStoneEgg");
|
||||
Item.byId[SMOOTH_BRICK.id] = (new ItemMultiTexture(SMOOTH_BRICK.id - 256, SMOOTH_BRICK, BlockSmoothBrick.a)).b("stonebricksmooth");
|
||||
@ -747,7 +760,7 @@ public class Block {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
if (u[i]) {
|
||||
if (v[i]) {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
@ -755,11 +768,11 @@ public class Block {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
w[i] = flag;
|
||||
x[i] = flag;
|
||||
}
|
||||
}
|
||||
|
||||
u[0] = true;
|
||||
v[0] = true;
|
||||
StatisticList.b();
|
||||
}
|
||||
|
||||
|
@ -84,17 +84,17 @@ public class BlockCactus extends Block {
|
||||
org.bukkit.block.Block damager = world.getWorld().getBlockAt(i, j, k);
|
||||
org.bukkit.entity.Entity damagee = (entity == null) ? null : entity.getBukkitEntity();
|
||||
|
||||
EntityDamageByBlockEvent event = new EntityDamageByBlockEvent(damager, damagee, org.bukkit.event.entity.EntityDamageEvent.DamageCause.CONTACT, 1);
|
||||
EntityDamageByBlockEvent event = new EntityDamageByBlockEvent(damager, damagee, org.bukkit.event.entity.EntityDamageEvent.DamageCause.CONTACT, 1D);
|
||||
world.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
if (!event.isCancelled()) {
|
||||
damagee.setLastDamageCause(event);
|
||||
entity.damageEntity(DamageSource.CACTUS, event.getDamage());
|
||||
entity.damageEntity(DamageSource.CACTUS, (float) event.getDamage());
|
||||
}
|
||||
return;
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
entity.damageEntity(DamageSource.CACTUS, 1);
|
||||
entity.damageEntity(DamageSource.CACTUS, 1.0F);
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ public class BlockCocoa extends BlockDirectional {
|
||||
public void a(World world, int i, int j, int k, Random random) {
|
||||
if (!this.f(world, i, j, k)) {
|
||||
this.c(world, i, j, k, world.getData(i, j, k), 0);
|
||||
world.setAir(i, j, k);
|
||||
world.setTypeIdAndData(i, j, k, 0, 0, 2);
|
||||
} else if (world.random.nextInt(5) == 0) {
|
||||
int l = world.getData(i, j, k);
|
||||
int i1 = c(l);
|
||||
@ -33,7 +33,7 @@ public class BlockCocoa extends BlockDirectional {
|
||||
k += Direction.b[l];
|
||||
int i1 = world.getTypeId(i, j, k);
|
||||
|
||||
return i1 == Block.LOG.id && BlockLog.d(world.getData(i, j, k)) == 3;
|
||||
return i1 == Block.LOG.id && BlockLog.f(world.getData(i, j, k)) == 3;
|
||||
}
|
||||
|
||||
public int d() {
|
||||
@ -96,7 +96,7 @@ public class BlockCocoa extends BlockDirectional {
|
||||
public void doPhysics(World world, int i, int j, int k, int l) {
|
||||
if (!this.f(world, i, j, k)) {
|
||||
this.c(world, i, j, k, world.getData(i, j, k), 0);
|
||||
world.setAir(i, j, k);
|
||||
world.setTypeIdAndData(i, j, k, 0, 0, 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -70,14 +70,18 @@ public class BlockCommand extends BlockContainer {
|
||||
public int b_(World world, int i, int j, int k, int l) {
|
||||
TileEntity tileentity = world.getTileEntity(i, j, k);
|
||||
|
||||
return tileentity != null && tileentity instanceof TileEntityCommand ? ((TileEntityCommand) tileentity).d() : 0;
|
||||
return tileentity != null && tileentity instanceof TileEntityCommand ? ((TileEntityCommand) tileentity).f() : 0;
|
||||
}
|
||||
|
||||
public void postPlace(World world, int i, int j, int k, EntityLiving entityliving, ItemStack itemstack) {
|
||||
TileEntityCommand tileentitycommand = (TileEntityCommand) world.getTileEntity(i, j, k);
|
||||
|
||||
if (itemstack.hasName()) {
|
||||
tileentitycommand.c(itemstack.getName());
|
||||
tileentitycommand.b(itemstack.getName());
|
||||
}
|
||||
}
|
||||
|
||||
public int a(Random random) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -12,11 +12,11 @@ public class BlockCrops extends BlockFlower {
|
||||
this.a(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f);
|
||||
this.a((CreativeModeTab) null);
|
||||
this.c(0.0F);
|
||||
this.a(Block.i); // CraftBukkit - i -> Block.i, decompile error
|
||||
this.D();
|
||||
this.a(j);
|
||||
this.C();
|
||||
}
|
||||
|
||||
protected boolean f_(int i) {
|
||||
protected boolean g_(int i) {
|
||||
return i == Block.SOIL.id;
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ public class BlockDaylightDetector extends BlockContainer {
|
||||
public void onPlace(World world, int i, int j, int k) {}
|
||||
|
||||
public void i_(World world, int i, int j, int k) {
|
||||
if (!world.worldProvider.f) {
|
||||
if (!world.worldProvider.g) {
|
||||
int l = world.getData(i, j, k);
|
||||
int i1 = world.b(EnumSkyBlock.SKY, i, j, k) - world.j;
|
||||
float f = world.d(1.0F);
|
||||
|
@ -109,7 +109,7 @@ public abstract class BlockDiodeAbstract extends BlockDirectional {
|
||||
b0 = -2;
|
||||
}
|
||||
|
||||
world.a(i, j, k, this.id, this.i_(i1), b0);
|
||||
world.a(i, j, k, this.id, this.k_(i1), b0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -246,10 +246,10 @@ public abstract class BlockDiodeAbstract extends BlockDirectional {
|
||||
}
|
||||
|
||||
protected int h(int i) {
|
||||
return this.i_(i);
|
||||
return this.k_(i);
|
||||
}
|
||||
|
||||
protected abstract int i_(int i);
|
||||
protected abstract int k_(int i);
|
||||
|
||||
protected abstract BlockDiodeAbstract i();
|
||||
|
||||
|
@ -30,19 +30,19 @@ public class BlockDispenser extends BlockContainer {
|
||||
int k1 = world.getTypeId(i + 1, j, k);
|
||||
byte b0 = 3;
|
||||
|
||||
if (Block.s[l] && !Block.s[i1]) {
|
||||
if (Block.t[l] && !Block.t[i1]) {
|
||||
b0 = 3;
|
||||
}
|
||||
|
||||
if (Block.s[i1] && !Block.s[l]) {
|
||||
if (Block.t[i1] && !Block.t[l]) {
|
||||
b0 = 2;
|
||||
}
|
||||
|
||||
if (Block.s[j1] && !Block.s[k1]) {
|
||||
if (Block.t[j1] && !Block.t[k1]) {
|
||||
b0 = 5;
|
||||
}
|
||||
|
||||
if (Block.s[k1] && !Block.s[j1]) {
|
||||
if (Block.t[k1] && !Block.t[j1]) {
|
||||
b0 = 4;
|
||||
}
|
||||
|
||||
@ -167,7 +167,7 @@ public class BlockDispenser extends BlockContainer {
|
||||
}
|
||||
|
||||
public static IPosition a(ISourceBlock isourceblock) {
|
||||
EnumFacing enumfacing = j_(isourceblock.h());
|
||||
EnumFacing enumfacing = l_(isourceblock.h());
|
||||
double d0 = isourceblock.getX() + 0.7D * (double) enumfacing.c();
|
||||
double d1 = isourceblock.getY() + 0.7D * (double) enumfacing.d();
|
||||
double d2 = isourceblock.getZ() + 0.7D * (double) enumfacing.e();
|
||||
@ -175,7 +175,7 @@ public class BlockDispenser extends BlockContainer {
|
||||
return new Position(d0, d1, d2);
|
||||
}
|
||||
|
||||
public static EnumFacing j_(int i) {
|
||||
public static EnumFacing l_(int i) {
|
||||
return EnumFacing.a(i & 7);
|
||||
}
|
||||
|
||||
|
@ -6,17 +6,8 @@ import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
|
||||
|
||||
public class BlockDoor extends Block {
|
||||
|
||||
private static final String[] a = new String[] { "doorWood_lower", "doorWood_upper", "doorIron_lower", "doorIron_upper"};
|
||||
private final int b;
|
||||
|
||||
protected BlockDoor(int i, Material material) {
|
||||
super(i, material);
|
||||
if (material == Material.ORE) {
|
||||
this.b = 2;
|
||||
} else {
|
||||
this.b = 0;
|
||||
}
|
||||
|
||||
float f = 0.5F;
|
||||
float f1 = 1.0F;
|
||||
|
||||
|
@ -7,14 +7,14 @@ import org.bukkit.event.inventory.InventoryMoveItemEvent;
|
||||
|
||||
public class BlockDropper extends BlockDispenser {
|
||||
|
||||
private final IDispenseBehavior cR = new DispenseBehaviorItem();
|
||||
private final IDispenseBehavior cX = new DispenseBehaviorItem();
|
||||
|
||||
protected BlockDropper(int i) {
|
||||
super(i);
|
||||
}
|
||||
|
||||
protected IDispenseBehavior a(ItemStack itemstack) {
|
||||
return this.cR;
|
||||
return this.cX;
|
||||
}
|
||||
|
||||
public TileEntity b(World world) {
|
||||
@ -64,7 +64,7 @@ public class BlockDropper extends BlockDispenser {
|
||||
itemstack1 = itemstack.cloneItemStack();
|
||||
}
|
||||
} else {
|
||||
itemstack1 = this.cR.a(sourceblock, itemstack);
|
||||
itemstack1 = this.cX.a(sourceblock, itemstack);
|
||||
if (itemstack1 != null && itemstack1.count == 0) {
|
||||
itemstack1 = null;
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import org.bukkit.event.entity.EntityPortalEnterEvent; // CraftBukkit
|
||||
|
||||
public class BlockEnderPortal extends BlockContainer {
|
||||
|
||||
public static boolean a = false;
|
||||
public static boolean a;
|
||||
|
||||
protected BlockEnderPortal(int i, Material material) {
|
||||
super(i, material);
|
||||
@ -44,7 +44,7 @@ public class BlockEnderPortal extends BlockContainer {
|
||||
EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), i, j, k));
|
||||
world.getServer().getPluginManager().callEvent(event);
|
||||
// CraftBukkit end
|
||||
entity.c(1);
|
||||
entity.b(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -34,6 +34,8 @@ public class BlockFire extends Block {
|
||||
this.a(Block.LONG_GRASS.id, 60, 100);
|
||||
this.a(Block.WOOL.id, 30, 60);
|
||||
this.a(Block.VINE.id, 15, 100);
|
||||
this.a(Block.COAL_BLOCK.id, 5, 5);
|
||||
this.a(Block.HAY_BLOCK.id, 60, 20);
|
||||
}
|
||||
|
||||
private void a(int i, int j, int k) {
|
||||
@ -77,7 +79,7 @@ public class BlockFire extends Block {
|
||||
fireExtinguished(world, i, j, k); // CraftBukkit - invalid place location
|
||||
}
|
||||
|
||||
if (!flag && world.P() && (world.F(i, j, k) || world.F(i - 1, j, k) || world.F(i + 1, j, k) || world.F(i, j, k - 1) || world.F(i, j, k + 1))) {
|
||||
if (!flag && world.Q() && (world.F(i, j, k) || world.F(i - 1, j, k) || world.F(i + 1, j, k) || world.F(i, j, k - 1) || world.F(i, j, k + 1))) {
|
||||
fireExtinguished(world, i, j, k); // CraftBukkit - extinguished by rain
|
||||
} else {
|
||||
int l = world.getData(i, j, k);
|
||||
@ -127,7 +129,7 @@ public class BlockFire extends Block {
|
||||
j2 /= 2;
|
||||
}
|
||||
|
||||
if (j2 > 0 && random.nextInt(l1) <= j2 && (!world.P() || !world.F(i1, k1, j1)) && !world.F(i1 - 1, k1, k) && !world.F(i1 + 1, k1, j1) && !world.F(i1, k1, j1 - 1) && !world.F(i1, k1, j1 + 1)) {
|
||||
if (j2 > 0 && random.nextInt(l1) <= j2 && (!world.Q() || !world.F(i1, k1, j1)) && !world.F(i1 - 1, k1, k) && !world.F(i1 + 1, k1, j1) && !world.F(i1, k1, j1 - 1) && !world.F(i1, k1, j1 + 1)) {
|
||||
int k2 = l + random.nextInt(5) / 4;
|
||||
|
||||
if (k2 > 15) {
|
||||
@ -250,7 +252,7 @@ public class BlockFire extends Block {
|
||||
}
|
||||
|
||||
public void onPlace(World world, int i, int j, int k) {
|
||||
if (world.worldProvider.dimension > 0 || world.getTypeId(i, j - 1, k) != Block.OBSIDIAN.id || !Block.PORTAL.n_(world, i, j, k)) {
|
||||
if (world.worldProvider.dimension > 0 || world.getTypeId(i, j - 1, k) != Block.OBSIDIAN.id || !Block.PORTAL.o_(world, i, j, k)) {
|
||||
if (!world.w(i, j - 1, k) && !this.k(world, i, j, k)) {
|
||||
fireExtinguished(world, i, j, k); // CraftBukkit - fuel block broke
|
||||
} else {
|
||||
|
@ -9,7 +9,7 @@ import org.bukkit.event.block.BlockFromToEvent;
|
||||
|
||||
public class BlockFlowing extends BlockFluids {
|
||||
|
||||
int a = 0;
|
||||
int a;
|
||||
boolean[] b = new boolean[4];
|
||||
int[] c = new int[4];
|
||||
|
||||
@ -34,64 +34,64 @@ public class BlockFlowing extends BlockFluids {
|
||||
org.bukkit.block.Block source = bworld == null ? null : bworld.getBlockAt(i, j, k);
|
||||
// CraftBukkit end
|
||||
|
||||
int l = this.k_(world, i, j, k);
|
||||
int l = this.l_(world, i, j, k);
|
||||
byte b0 = 1;
|
||||
|
||||
if (this.material == Material.LAVA && !world.worldProvider.e) {
|
||||
if (this.material == Material.LAVA && !world.worldProvider.f) {
|
||||
b0 = 2;
|
||||
}
|
||||
|
||||
boolean flag = true;
|
||||
int i1;
|
||||
int i1 = this.a(world);
|
||||
int j1;
|
||||
|
||||
if (l > 0) {
|
||||
byte b1 = -100;
|
||||
|
||||
this.a = 0;
|
||||
int j1 = this.d(world, i - 1, j, k, b1);
|
||||
int k1 = this.d(world, i - 1, j, k, b1);
|
||||
|
||||
j1 = this.d(world, i + 1, j, k, j1);
|
||||
j1 = this.d(world, i, j, k - 1, j1);
|
||||
j1 = this.d(world, i, j, k + 1, j1);
|
||||
i1 = j1 + b0;
|
||||
if (i1 >= 8 || j1 < 0) {
|
||||
i1 = -1;
|
||||
k1 = this.d(world, i + 1, j, k, k1);
|
||||
k1 = this.d(world, i, j, k - 1, k1);
|
||||
k1 = this.d(world, i, j, k + 1, k1);
|
||||
j1 = k1 + b0;
|
||||
if (j1 >= 8 || k1 < 0) {
|
||||
j1 = -1;
|
||||
}
|
||||
|
||||
if (this.k_(world, i, j + 1, k) >= 0) {
|
||||
int k1 = this.k_(world, i, j + 1, k);
|
||||
if (this.l_(world, i, j + 1, k) >= 0) {
|
||||
int l1 = this.l_(world, i, j + 1, k);
|
||||
|
||||
if (k1 >= 8) {
|
||||
i1 = k1;
|
||||
if (l1 >= 8) {
|
||||
j1 = l1;
|
||||
} else {
|
||||
i1 = k1 + 8;
|
||||
j1 = l1 + 8;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.a >= 2 && this.material == Material.WATER) {
|
||||
if (world.getMaterial(i, j - 1, k).isBuildable()) {
|
||||
i1 = 0;
|
||||
j1 = 0;
|
||||
} else if (world.getMaterial(i, j - 1, k) == this.material && world.getData(i, j - 1, k) == 0) {
|
||||
i1 = 0;
|
||||
j1 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.material == Material.LAVA && l < 8 && i1 < 8 && i1 > l && random.nextInt(4) != 0) {
|
||||
i1 = l;
|
||||
flag = false;
|
||||
if (this.material == Material.LAVA && l < 8 && j1 < 8 && j1 > l && random.nextInt(4) != 0) {
|
||||
i1 *= 4;
|
||||
}
|
||||
|
||||
if (i1 == l) {
|
||||
if (j1 == l) {
|
||||
if (flag) {
|
||||
this.k(world, i, j, k);
|
||||
}
|
||||
} else {
|
||||
l = i1;
|
||||
if (i1 < 0) {
|
||||
l = j1;
|
||||
if (j1 < 0) {
|
||||
world.setAir(i, j, k);
|
||||
} else {
|
||||
world.setData(i, j, k, i1, 2);
|
||||
world.a(i, j, k, this.id, this.a(world));
|
||||
world.setData(i, j, k, j1, 2);
|
||||
world.a(i, j, k, this.id, i1);
|
||||
world.applyPhysics(i, j, k, this.id);
|
||||
}
|
||||
}
|
||||
@ -123,12 +123,12 @@ public class BlockFlowing extends BlockFluids {
|
||||
} else if (l >= 0 && (l == 0 || this.n(world, i, j - 1, k))) {
|
||||
boolean[] aboolean = this.m(world, i, j, k);
|
||||
|
||||
i1 = l + b0;
|
||||
j1 = l + b0;
|
||||
if (l >= 8) {
|
||||
i1 = 1;
|
||||
j1 = 1;
|
||||
}
|
||||
|
||||
if (i1 >= 8) {
|
||||
if (j1 >= 8) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -145,7 +145,7 @@ public class BlockFlowing extends BlockFluids {
|
||||
}
|
||||
|
||||
if (!event.isCancelled()) {
|
||||
this.flow(world, i + currentFace.getModX(), j, k + currentFace.getModZ(), i1);
|
||||
this.flow(world, i + currentFace.getModX(), j, k + currentFace.getModZ(), j1);
|
||||
}
|
||||
}
|
||||
index++;
|
||||
@ -279,7 +279,7 @@ public class BlockFlowing extends BlockFluids {
|
||||
}
|
||||
|
||||
protected int d(World world, int i, int j, int k, int l) {
|
||||
int i1 = this.k_(world, i, j, k);
|
||||
int i1 = this.l_(world, i, j, k);
|
||||
|
||||
if (i1 < 0) {
|
||||
return l;
|
||||
@ -310,6 +310,6 @@ public class BlockFlowing extends BlockFluids {
|
||||
}
|
||||
|
||||
public boolean l() {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -13,15 +13,15 @@ public class BlockIce extends BlockHalfTransparant {
|
||||
|
||||
public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
|
||||
entityhuman.a(StatisticList.C[this.id], 1);
|
||||
entityhuman.j(0.025F);
|
||||
entityhuman.a(0.025F);
|
||||
if (this.r_() && EnchantmentManager.hasSilkTouchEnchantment(entityhuman)) {
|
||||
ItemStack itemstack = this.c_(l);
|
||||
ItemStack itemstack = this.d_(l);
|
||||
|
||||
if (itemstack != null) {
|
||||
this.b(world, i, j, k, itemstack);
|
||||
}
|
||||
} else {
|
||||
if (world.worldProvider.e) {
|
||||
if (world.worldProvider.f) {
|
||||
world.setAir(i, j, k);
|
||||
return;
|
||||
}
|
||||
@ -49,7 +49,7 @@ public class BlockIce extends BlockHalfTransparant {
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
if (world.worldProvider.e) {
|
||||
if (world.worldProvider.f) {
|
||||
world.setAir(i, j, k);
|
||||
return;
|
||||
}
|
||||
|
@ -7,8 +7,8 @@ import org.bukkit.event.block.LeavesDecayEvent; // CraftBukkit
|
||||
public class BlockLeaves extends BlockTransparant {
|
||||
|
||||
public static final String[] a = new String[] { "oak", "spruce", "birch", "jungle"};
|
||||
public static final String[][] b = new String[][] { { "leaves", "leaves_spruce", "leaves", "leaves_jungle"}, { "leaves_opaque", "leaves_spruce_opaque", "leaves_opaque", "leaves_jungle_opaque"}};
|
||||
private IIcon[][] cR = new IIcon[2][];
|
||||
public static final String[][] b = new String[][] { { "leaves_oak", "leaves_spruce", "leaves_birch", "leaves_jungle"}, { "leaves_oak_opaque", "leaves_spruce_opaque", "leaves_birch_opaque", "leaves_jungle_opaque"}};
|
||||
private IIcon[][] cX = new IIcon[2][];
|
||||
int[] c;
|
||||
|
||||
protected BlockLeaves(int i) {
|
||||
@ -178,7 +178,7 @@ public class BlockLeaves extends BlockTransparant {
|
||||
}
|
||||
|
||||
public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
|
||||
if (!world.isStatic && entityhuman.cd() != null && entityhuman.cd().id == Item.SHEARS.id) {
|
||||
if (!world.isStatic && entityhuman.bt() != null && entityhuman.bt().id == Item.SHEARS.id) {
|
||||
entityhuman.a(StatisticList.C[this.id], 1);
|
||||
this.b(world, i, j, k, new ItemStack(Block.LEAVES.id, 1, l & 3));
|
||||
} else {
|
||||
@ -194,7 +194,7 @@ public class BlockLeaves extends BlockTransparant {
|
||||
return !this.d;
|
||||
}
|
||||
|
||||
protected ItemStack c_(int i) {
|
||||
protected ItemStack d_(int i) {
|
||||
return new ItemStack(this.id, 1, i & 3);
|
||||
}
|
||||
}
|
||||
|
@ -14,11 +14,8 @@ import org.bukkit.event.world.StructureGrowEvent;
|
||||
|
||||
public class BlockMushroom extends BlockFlower {
|
||||
|
||||
private final String a;
|
||||
|
||||
protected BlockMushroom(int i, String s) {
|
||||
protected BlockMushroom(int i) {
|
||||
super(i);
|
||||
this.a = s;
|
||||
float f = 0.2F;
|
||||
|
||||
this.a(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 2.0F, 0.5F + f);
|
||||
@ -68,7 +65,7 @@ public class BlockMushroom extends BlockFlower {
|
||||
// CraftBukkit start
|
||||
org.bukkit.World bworld = world.getWorld();
|
||||
BlockState blockState = bworld.getBlockAt(i1, j1, k1).getState();
|
||||
blockState.setTypeId(this.id);
|
||||
blockState.setTypeId(this.id); // nms: this.id, 0, 2
|
||||
|
||||
BlockSpreadEvent event = new BlockSpreadEvent(blockState.getBlock(), bworld.getBlockAt(sourceX, sourceY, sourceZ), blockState);
|
||||
world.getServer().getPluginManager().callEvent(event);
|
||||
@ -85,15 +82,15 @@ public class BlockMushroom extends BlockFlower {
|
||||
return super.canPlace(world, i, j, k) && this.f(world, i, j, k);
|
||||
}
|
||||
|
||||
protected boolean f_(int i) {
|
||||
return Block.s[i];
|
||||
protected boolean g_(int i) {
|
||||
return Block.t[i];
|
||||
}
|
||||
|
||||
public boolean f(World world, int i, int j, int k) {
|
||||
if (j >= 0 && j < 256) {
|
||||
int l = world.getTypeId(i, j - 1, k);
|
||||
|
||||
return l == Block.MYCEL.id || world.m(i, j, k) < 13 && this.f_(l);
|
||||
return l == Block.MYCEL.id || world.m(i, j, k) < 13 && this.g_(l);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
@ -4,8 +4,6 @@ import java.util.Random;
|
||||
|
||||
public class BlockNetherWart extends BlockFlower {
|
||||
|
||||
private static final String[] a = new String[] { "netherStalk_0", "netherStalk_1", "netherStalk_2"};
|
||||
|
||||
protected BlockNetherWart(int i) {
|
||||
super(i);
|
||||
this.b(true);
|
||||
@ -15,12 +13,12 @@ public class BlockNetherWart extends BlockFlower {
|
||||
this.a((CreativeModeTab) null);
|
||||
}
|
||||
|
||||
protected boolean f_(int i) {
|
||||
protected boolean g_(int i) {
|
||||
return i == Block.SOUL_SAND.id;
|
||||
}
|
||||
|
||||
public boolean f(World world, int i, int j, int k) {
|
||||
return this.f_(world.getTypeId(i, j - 1, k));
|
||||
return this.g_(world.getTypeId(i, j - 1, k));
|
||||
}
|
||||
|
||||
public void a(World world, int i, int j, int k, Random random) {
|
||||
|
@ -15,7 +15,7 @@ public class BlockPiston extends Block {
|
||||
public BlockPiston(int i, boolean flag) {
|
||||
super(i, Material.PISTON);
|
||||
this.a = flag;
|
||||
this.a(j);
|
||||
this.a(k);
|
||||
this.c(0.5F);
|
||||
this.a(CreativeModeTab.d);
|
||||
}
|
||||
@ -173,6 +173,8 @@ public class BlockPiston extends Block {
|
||||
int l = iblockaccess.getData(i, j, k);
|
||||
|
||||
if (e(l)) {
|
||||
float f = 0.25F;
|
||||
|
||||
switch (d(l)) {
|
||||
case 0:
|
||||
this.a(0.0F, 0.25F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
@ -5,11 +5,9 @@ import java.util.Random;
|
||||
|
||||
public class BlockPistonExtension extends Block {
|
||||
|
||||
private IIcon a = null;
|
||||
|
||||
public BlockPistonExtension(int i) {
|
||||
super(i, Material.PISTON);
|
||||
this.a(j);
|
||||
this.a(k);
|
||||
this.c(0.5F);
|
||||
}
|
||||
|
||||
@ -58,6 +56,11 @@ public class BlockPistonExtension extends Block {
|
||||
|
||||
public void a(World world, int i, int j, int k, AxisAlignedBB axisalignedbb, List list, Entity entity) {
|
||||
int l = world.getData(i, j, k);
|
||||
float f = 0.25F;
|
||||
float f1 = 0.375F;
|
||||
float f2 = 0.625F;
|
||||
float f3 = 0.25F;
|
||||
float f4 = 0.75F;
|
||||
|
||||
switch (d(l)) {
|
||||
case 0:
|
||||
@ -107,6 +110,7 @@ public class BlockPistonExtension extends Block {
|
||||
|
||||
public void updateShape(IBlockAccess iblockaccess, int i, int j, int k) {
|
||||
int l = iblockaccess.getData(i, j, k);
|
||||
float f = 0.25F;
|
||||
|
||||
switch (d(l)) {
|
||||
case 0:
|
||||
|
@ -60,7 +60,7 @@ public class BlockPortal extends BlockHalfTransparant {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean n_(World world, int i, int j, int k) {
|
||||
public boolean o_(World world, int i, int j, int k) {
|
||||
byte b0 = 0;
|
||||
byte b1 = 0;
|
||||
|
||||
|
@ -13,14 +13,14 @@ public abstract class BlockPressurePlateAbstract extends Block {
|
||||
this.a = s;
|
||||
this.a(CreativeModeTab.d);
|
||||
this.b(true);
|
||||
this.b_(this.d(15));
|
||||
this.c_(this.d(15));
|
||||
}
|
||||
|
||||
public void updateShape(IBlockAccess iblockaccess, int i, int j, int k) {
|
||||
this.b_(iblockaccess.getData(i, j, k));
|
||||
this.c_(iblockaccess.getData(i, j, k));
|
||||
}
|
||||
|
||||
protected void b_(int i) {
|
||||
protected void c_(int i) {
|
||||
boolean flag = this.c(i) > 0;
|
||||
float f = 0.0625F;
|
||||
|
||||
@ -52,13 +52,13 @@ public abstract class BlockPressurePlateAbstract extends Block {
|
||||
}
|
||||
|
||||
public boolean canPlace(World world, int i, int j, int k) {
|
||||
return world.w(i, j - 1, k) || BlockFence.l_(world.getTypeId(i, j - 1, k));
|
||||
return world.w(i, j - 1, k) || BlockFence.n_(world.getTypeId(i, j - 1, k));
|
||||
}
|
||||
|
||||
public void doPhysics(World world, int i, int j, int k, int l) {
|
||||
boolean flag = false;
|
||||
|
||||
if (!world.w(i, j - 1, k) && !BlockFence.l_(world.getTypeId(i, j - 1, k))) {
|
||||
if (!world.w(i, j - 1, k) && !BlockFence.n_(world.getTypeId(i, j - 1, k))) {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ public class BlockPressurePlateBinary extends BlockPressurePlateAbstract {
|
||||
list = world.a(EntityHuman.class, this.a(i, j, k));
|
||||
}
|
||||
|
||||
if (!list.isEmpty()) {
|
||||
if (list != null && !list.isEmpty()) {
|
||||
Iterator iterator = list.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@ -63,7 +63,7 @@ public class BlockPressurePlateBinary extends BlockPressurePlateAbstract {
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
if (!entity.at()) {
|
||||
if (!entity.as()) {
|
||||
return 15;
|
||||
}
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ public class BlockRedstoneOre extends Block {
|
||||
}
|
||||
}
|
||||
|
||||
protected ItemStack c_(int i) {
|
||||
protected ItemStack d_(int i) {
|
||||
return new ItemStack(Block.REDSTONE_ORE);
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
|
||||
|
||||
public class BlockRedstoneTorch extends BlockTorch {
|
||||
|
||||
private boolean isOn = false;
|
||||
private boolean isOn;
|
||||
private static Map b = new HashMap();
|
||||
|
||||
private boolean a(World world, int i, int j, int k, boolean flag) {
|
||||
|
@ -13,7 +13,6 @@ import org.bukkit.event.world.StructureGrowEvent;
|
||||
public class BlockSapling extends BlockFlower {
|
||||
|
||||
public static final String[] a = new String[] { "oak", "spruce", "birch", "jungle"};
|
||||
private static final String[] b = new String[] { "sapling", "sapling_spruce", "sapling_birch", "sapling_jungle"};
|
||||
|
||||
protected BlockSapling(int i) {
|
||||
super(i);
|
||||
|
@ -154,8 +154,8 @@ public class BlockSkull extends BlockContainer {
|
||||
if (!world.isStatic) {
|
||||
entitywither = new EntityWither(world);
|
||||
entitywither.setPositionRotation((double) i + 0.5D, (double) j - 1.45D, (double) (k + i1) + 1.5D, 90.0F, 0.0F);
|
||||
entitywither.ay = 90.0F;
|
||||
entitywither.m();
|
||||
entitywither.aN = 90.0F;
|
||||
entitywither.bP();
|
||||
|
||||
if (world.addEntity(entitywither, SpawnReason.BUILD_WITHER)) {
|
||||
blockList.updateList();
|
||||
@ -191,7 +191,7 @@ public class BlockSkull extends BlockContainer {
|
||||
if (!world.isStatic) {
|
||||
entitywither = new EntityWither(world);
|
||||
entitywither.setPositionRotation((double) (i + i1) + 1.5D, (double) j - 1.45D, (double) k + 0.5D, 0.0F, 0.0F);
|
||||
entitywither.m();
|
||||
entitywither.bP();
|
||||
|
||||
if (world.addEntity(entitywither, SpawnReason.BUILD_WITHER)) {
|
||||
blockList.updateList();
|
||||
|
@ -18,7 +18,7 @@ public class BlockStem extends BlockFlower {
|
||||
this.a((CreativeModeTab) null);
|
||||
}
|
||||
|
||||
protected boolean f_(int i) {
|
||||
protected boolean g_(int i) {
|
||||
return i == Block.SOIL.id;
|
||||
}
|
||||
|
||||
|
@ -76,7 +76,7 @@ public class BlockTripwire extends Block {
|
||||
|
||||
public void a(World world, int i, int j, int k, int l, EntityHuman entityhuman) {
|
||||
if (!world.isStatic) {
|
||||
if (entityhuman.cd() != null && entityhuman.cd().id == Item.SHEARS.id) {
|
||||
if (entityhuman.bt() != null && entityhuman.bt().id == Item.SHEARS.id) {
|
||||
world.setData(i, j, k, l | 8, 4);
|
||||
}
|
||||
}
|
||||
@ -140,7 +140,7 @@ public class BlockTripwire extends Block {
|
||||
while (iterator.hasNext()) {
|
||||
Entity entity = (Entity) iterator.next();
|
||||
|
||||
if (!entity.at()) {
|
||||
if (!entity.as()) {
|
||||
flag1 = true;
|
||||
break;
|
||||
}
|
||||
|
@ -29,65 +29,66 @@ public class BlockVine extends Block {
|
||||
}
|
||||
|
||||
public void updateShape(IBlockAccess iblockaccess, int i, int j, int k) {
|
||||
float f = 0.0625F;
|
||||
int l = iblockaccess.getData(i, j, k);
|
||||
float f = 1.0F;
|
||||
float f1 = 1.0F;
|
||||
float f2 = 1.0F;
|
||||
float f3 = 0.0F;
|
||||
float f3 = 1.0F;
|
||||
float f4 = 0.0F;
|
||||
float f5 = 0.0F;
|
||||
float f6 = 0.0F;
|
||||
boolean flag = l > 0;
|
||||
|
||||
if ((l & 2) != 0) {
|
||||
f3 = Math.max(f3, 0.0625F);
|
||||
f = 0.0F;
|
||||
f4 = Math.max(f4, 0.0625F);
|
||||
f1 = 0.0F;
|
||||
f4 = 1.0F;
|
||||
f2 = 0.0F;
|
||||
f5 = 1.0F;
|
||||
f3 = 0.0F;
|
||||
f6 = 1.0F;
|
||||
flag = true;
|
||||
}
|
||||
|
||||
if ((l & 8) != 0) {
|
||||
f = Math.min(f, 0.9375F);
|
||||
f3 = 1.0F;
|
||||
f1 = 0.0F;
|
||||
f1 = Math.min(f1, 0.9375F);
|
||||
f4 = 1.0F;
|
||||
f2 = 0.0F;
|
||||
f5 = 1.0F;
|
||||
f3 = 0.0F;
|
||||
f6 = 1.0F;
|
||||
flag = true;
|
||||
}
|
||||
|
||||
if ((l & 4) != 0) {
|
||||
f5 = Math.max(f5, 0.0625F);
|
||||
f2 = 0.0F;
|
||||
f = 0.0F;
|
||||
f3 = 1.0F;
|
||||
f6 = Math.max(f6, 0.0625F);
|
||||
f3 = 0.0F;
|
||||
f1 = 0.0F;
|
||||
f4 = 1.0F;
|
||||
f2 = 0.0F;
|
||||
f5 = 1.0F;
|
||||
flag = true;
|
||||
}
|
||||
|
||||
if ((l & 1) != 0) {
|
||||
f2 = Math.min(f2, 0.9375F);
|
||||
f5 = 1.0F;
|
||||
f = 0.0F;
|
||||
f3 = 1.0F;
|
||||
f3 = Math.min(f3, 0.9375F);
|
||||
f6 = 1.0F;
|
||||
f1 = 0.0F;
|
||||
f4 = 1.0F;
|
||||
f2 = 0.0F;
|
||||
f5 = 1.0F;
|
||||
flag = true;
|
||||
}
|
||||
|
||||
if (!flag && this.d(iblockaccess.getTypeId(i, j + 1, k))) {
|
||||
f1 = Math.min(f1, 0.9375F);
|
||||
f4 = 1.0F;
|
||||
f = 0.0F;
|
||||
f3 = 1.0F;
|
||||
f2 = 0.0F;
|
||||
f2 = Math.min(f2, 0.9375F);
|
||||
f5 = 1.0F;
|
||||
f1 = 0.0F;
|
||||
f4 = 1.0F;
|
||||
f3 = 0.0F;
|
||||
f6 = 1.0F;
|
||||
}
|
||||
|
||||
this.a(f, f1, f2, f3, f4, f5);
|
||||
this.a(f1, f2, f3, f4, f5, f6);
|
||||
}
|
||||
|
||||
public AxisAlignedBB b(World world, int i, int j, int k) {
|
||||
@ -300,7 +301,7 @@ public class BlockVine extends Block {
|
||||
}
|
||||
|
||||
public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
|
||||
if (!world.isStatic && entityhuman.cd() != null && entityhuman.cd().id == Item.SHEARS.id) {
|
||||
if (!world.isStatic && entityhuman.bt() != null && entityhuman.bt().id == Item.SHEARS.id) {
|
||||
entityhuman.a(StatisticList.C[this.id], 1);
|
||||
this.b(world, i, j, k, new ItemStack(Block.VINE, 1, 0));
|
||||
} else {
|
||||
|
@ -31,24 +31,16 @@ public class Chunk {
|
||||
public long n;
|
||||
public boolean seenByPlayer;
|
||||
public int p;
|
||||
public long q;
|
||||
private int u;
|
||||
boolean q;
|
||||
|
||||
public Chunk(World world, int i, int j) {
|
||||
this.sections = new ChunkSection[16];
|
||||
this.s = new byte[256];
|
||||
this.b = new int[256];
|
||||
this.c = new boolean[256];
|
||||
this.t = false;
|
||||
this.tileEntities = new HashMap();
|
||||
this.done = false;
|
||||
this.l = false;
|
||||
this.m = false;
|
||||
this.n = 0L;
|
||||
this.seenByPlayer = false;
|
||||
this.p = 0;
|
||||
this.u = 4096;
|
||||
this.q = false;
|
||||
this.entitySlices = new List[16];
|
||||
this.world = world;
|
||||
this.x = i;
|
||||
@ -85,7 +77,7 @@ public class Chunk {
|
||||
int k1 = j1 >> 4;
|
||||
|
||||
if (this.sections[k1] == null) {
|
||||
this.sections[k1] = new ChunkSection(k1 << 4, !world.worldProvider.f);
|
||||
this.sections[k1] = new ChunkSection(k1 << 4, !world.worldProvider.g);
|
||||
}
|
||||
|
||||
this.sections[k1].setTypeId(l, j1 & 15, i1, b0);
|
||||
@ -145,7 +137,7 @@ public class Chunk {
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.world.worldProvider.f) {
|
||||
if (!this.world.worldProvider.g) {
|
||||
l = 15;
|
||||
int i1 = i + 16 - 1;
|
||||
|
||||
@ -266,7 +258,7 @@ public class Chunk {
|
||||
int l1;
|
||||
int i2;
|
||||
|
||||
if (!this.world.worldProvider.f) {
|
||||
if (!this.world.worldProvider.g) {
|
||||
ChunkSection chunksection;
|
||||
|
||||
if (i1 < l) {
|
||||
@ -322,7 +314,7 @@ public class Chunk {
|
||||
this.p = l1;
|
||||
}
|
||||
|
||||
if (!this.world.worldProvider.f) {
|
||||
if (!this.world.worldProvider.g) {
|
||||
this.d(j1 - 1, k1, i2, j2);
|
||||
this.d(j1 + 1, k1, i2, j2);
|
||||
this.d(j1, k1 - 1, i2, j2);
|
||||
@ -380,7 +372,7 @@ public class Chunk {
|
||||
return false;
|
||||
}
|
||||
|
||||
chunksection = this.sections[j >> 4] = new ChunkSection(j >> 4 << 4, !this.world.worldProvider.f);
|
||||
chunksection = this.sections[j >> 4] = new ChunkSection(j >> 4 << 4, !this.world.worldProvider.g);
|
||||
flag = j >= k1;
|
||||
}
|
||||
|
||||
@ -488,20 +480,20 @@ public class Chunk {
|
||||
public int getBrightness(EnumSkyBlock enumskyblock, int i, int j, int k) {
|
||||
ChunkSection chunksection = this.sections[j >> 4];
|
||||
|
||||
return chunksection == null ? (this.d(i, j, k) ? enumskyblock.c : 0) : (enumskyblock == EnumSkyBlock.SKY ? (this.world.worldProvider.f ? 0 : chunksection.getSkyLight(i, j & 15, k)) : (enumskyblock == EnumSkyBlock.BLOCK ? chunksection.getEmittedLight(i, j & 15, k) : enumskyblock.c));
|
||||
return chunksection == null ? (this.d(i, j, k) ? enumskyblock.c : 0) : (enumskyblock == EnumSkyBlock.SKY ? (this.world.worldProvider.g ? 0 : chunksection.getSkyLight(i, j & 15, k)) : (enumskyblock == EnumSkyBlock.BLOCK ? chunksection.getEmittedLight(i, j & 15, k) : enumskyblock.c));
|
||||
}
|
||||
|
||||
public void a(EnumSkyBlock enumskyblock, int i, int j, int k, int l) {
|
||||
ChunkSection chunksection = this.sections[j >> 4];
|
||||
|
||||
if (chunksection == null) {
|
||||
chunksection = this.sections[j >> 4] = new ChunkSection(j >> 4 << 4, !this.world.worldProvider.f);
|
||||
chunksection = this.sections[j >> 4] = new ChunkSection(j >> 4 << 4, !this.world.worldProvider.g);
|
||||
this.initLighting();
|
||||
}
|
||||
|
||||
this.l = true;
|
||||
if (enumskyblock == EnumSkyBlock.SKY) {
|
||||
if (!this.world.worldProvider.f) {
|
||||
if (!this.world.worldProvider.g) {
|
||||
chunksection.setSkyLight(i, j & 15, k, l);
|
||||
}
|
||||
} else if (enumskyblock == EnumSkyBlock.BLOCK) {
|
||||
@ -513,9 +505,9 @@ public class Chunk {
|
||||
ChunkSection chunksection = this.sections[j >> 4];
|
||||
|
||||
if (chunksection == null) {
|
||||
return !this.world.worldProvider.f && l < EnumSkyBlock.SKY.c ? EnumSkyBlock.SKY.c - l : 0;
|
||||
return !this.world.worldProvider.g && l < EnumSkyBlock.SKY.c ? EnumSkyBlock.SKY.c - l : 0;
|
||||
} else {
|
||||
int i1 = this.world.worldProvider.f ? 0 : chunksection.getSkyLight(i, j & 15, k);
|
||||
int i1 = this.world.worldProvider.g ? 0 : chunksection.getSkyLight(i, j & 15, k);
|
||||
|
||||
if (i1 > 0) {
|
||||
a = true;
|
||||
@ -661,6 +653,14 @@ public class Chunk {
|
||||
this.world.a(this.tileEntities.values());
|
||||
|
||||
for (int i = 0; i < this.entitySlices.length; ++i) {
|
||||
Iterator iterator = this.entitySlices[i].iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
Entity entity = (Entity) iterator.next();
|
||||
|
||||
entity.P();
|
||||
}
|
||||
|
||||
this.world.a(this.entitySlices[i]);
|
||||
}
|
||||
}
|
||||
@ -717,14 +717,14 @@ public class Chunk {
|
||||
for (int l = 0; l < list1.size(); ++l) {
|
||||
Entity entity1 = (Entity) list1.get(l);
|
||||
|
||||
if (entity1 != entity && entity1.boundingBox.a(axisalignedbb) && (ientityselector == null || ientityselector.a(entity1))) {
|
||||
if (entity1 != entity && entity1.boundingBox.b(axisalignedbb) && (ientityselector == null || ientityselector.a(entity1))) {
|
||||
list.add(entity1);
|
||||
Entity[] aentity = entity1.an();
|
||||
Entity[] aentity = entity1.am();
|
||||
|
||||
if (aentity != null) {
|
||||
for (int i1 = 0; i1 < aentity.length; ++i1) {
|
||||
entity1 = aentity[i1];
|
||||
if (entity1 != entity && entity1.boundingBox.a(axisalignedbb) && (ientityselector == null || ientityselector.a(entity1))) {
|
||||
if (entity1 != entity && entity1.boundingBox.b(axisalignedbb) && (ientityselector == null || ientityselector.a(entity1))) {
|
||||
list.add(entity1);
|
||||
}
|
||||
}
|
||||
@ -756,7 +756,7 @@ public class Chunk {
|
||||
for (int l = 0; l < list1.size(); ++l) {
|
||||
Entity entity = (Entity) list1.get(l);
|
||||
|
||||
if (oclass.isAssignableFrom(entity.getClass()) && entity.boundingBox.a(axisalignedbb) && (ientityselector == null || ientityselector.a(entity))) {
|
||||
if (oclass.isAssignableFrom(entity.getClass()) && entity.boundingBox.b(axisalignedbb) && (ientityselector == null || ientityselector.a(entity))) {
|
||||
list.add(entity);
|
||||
}
|
||||
}
|
||||
@ -828,7 +828,7 @@ public class Chunk {
|
||||
}
|
||||
|
||||
public void k() {
|
||||
if (this.t && !this.world.worldProvider.f) {
|
||||
if (this.t && !this.world.worldProvider.g) {
|
||||
this.q();
|
||||
}
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ public class ChunkRegionLoader implements IAsyncChunkSaver, IChunkLoader {
|
||||
public void a(World world, Chunk chunk) {
|
||||
// CraftBukkit start - "handle" exception
|
||||
try {
|
||||
world.F();
|
||||
world.G();
|
||||
} catch (ExceptionWorldConflict ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
@ -210,9 +210,10 @@ public class ChunkRegionLoader implements IAsyncChunkSaver, IChunkLoader {
|
||||
nbttagcompound.setLong("LastUpdate", world.getTime());
|
||||
nbttagcompound.setIntArray("HeightMap", chunk.heightMap);
|
||||
nbttagcompound.setBoolean("TerrainPopulated", chunk.done);
|
||||
nbttagcompound.setLong("InhabitedTime", chunk.q);
|
||||
ChunkSection[] achunksection = chunk.i();
|
||||
NBTTagList nbttaglist = new NBTTagList("Sections");
|
||||
boolean flag = !world.worldProvider.f;
|
||||
boolean flag = !world.worldProvider.g;
|
||||
ChunkSection[] achunksection1 = achunksection;
|
||||
int i = achunksection.length;
|
||||
|
||||
@ -307,10 +308,11 @@ public class ChunkRegionLoader implements IAsyncChunkSaver, IChunkLoader {
|
||||
|
||||
chunk.heightMap = nbttagcompound.getIntArray("HeightMap");
|
||||
chunk.done = nbttagcompound.getBoolean("TerrainPopulated");
|
||||
chunk.q = nbttagcompound.getLong("InhabitedTime");
|
||||
NBTTagList nbttaglist = nbttagcompound.getList("Sections");
|
||||
byte b0 = 16;
|
||||
ChunkSection[] achunksection = new ChunkSection[b0];
|
||||
boolean flag = !world.worldProvider.f;
|
||||
boolean flag = !world.worldProvider.g;
|
||||
|
||||
for (int k = 0; k < nbttaglist.size(); ++k) {
|
||||
NBTTagCompound nbttagcompound1 = (NBTTagCompound) nbttaglist.get(k);
|
||||
|
@ -20,10 +20,9 @@ public abstract class Container {
|
||||
|
||||
public List b = new ArrayList();
|
||||
public List c = new ArrayList();
|
||||
public int windowId = 0;
|
||||
private short a = 0;
|
||||
public int windowId;
|
||||
private int f = -1;
|
||||
public int g = 0; // CraftBukkit - private -> public
|
||||
public int g; // CraftBukkit - private -> public
|
||||
private final Set h = new HashSet();
|
||||
protected List listeners = new ArrayList();
|
||||
private Set i = new HashSet();
|
||||
@ -151,7 +150,7 @@ public abstract class Container {
|
||||
|
||||
if (slot1 != null && a(slot1, playerinventory.getCarried(), true) && slot1.isAllowed(playerinventory.getCarried()) && playerinventory.getCarried().count >= this.h.size() && this.b(slot1)) {
|
||||
ItemStack itemstack2 = itemstack1.cloneItemStack();
|
||||
int j1 = slot1.d() ? slot1.getItem().count : 0;
|
||||
int j1 = slot1.e() ? slot1.getItem().count : 0;
|
||||
|
||||
a(this.h, this.f, itemstack2, j1);
|
||||
if (itemstack2.count > itemstack2.getMaxStackSize()) {
|
||||
@ -276,11 +275,9 @@ public abstract class Container {
|
||||
k1 = slot2.a();
|
||||
}
|
||||
|
||||
// CraftBukkit start
|
||||
if (itemstack4.count >= k1) {
|
||||
slot2.set(itemstack4.a(k1));
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
if (itemstack4.count == 0) {
|
||||
playerinventory.setCarried((ItemStack) null);
|
||||
@ -331,7 +328,7 @@ public abstract class Container {
|
||||
}
|
||||
}
|
||||
|
||||
slot2.e();
|
||||
slot2.f();
|
||||
}
|
||||
}
|
||||
} else if (k == 2 && j >= 0 && j < 9) {
|
||||
@ -346,7 +343,7 @@ public abstract class Container {
|
||||
flag |= k1 > -1;
|
||||
}
|
||||
|
||||
if (slot2.d() && flag) {
|
||||
if (slot2.e() && flag) {
|
||||
itemstack3 = slot2.getItem();
|
||||
playerinventory.setItem(j, itemstack3.cloneItemStack());
|
||||
if ((slot2.inventory != playerinventory || !slot2.isAllowed(itemstack1)) && itemstack1 != null) {
|
||||
@ -361,21 +358,21 @@ public abstract class Container {
|
||||
slot2.set(itemstack1);
|
||||
slot2.a(entityhuman, itemstack3);
|
||||
}
|
||||
} else if (!slot2.d() && itemstack1 != null && slot2.isAllowed(itemstack1)) {
|
||||
} else if (!slot2.e() && itemstack1 != null && slot2.isAllowed(itemstack1)) {
|
||||
playerinventory.setItem(j, (ItemStack) null);
|
||||
slot2.set(itemstack1);
|
||||
}
|
||||
}
|
||||
} else if (k == 3 && entityhuman.abilities.canInstantlyBuild && playerinventory.getCarried() == null && i >= 0) {
|
||||
slot2 = (Slot) this.c.get(i);
|
||||
if (slot2 != null && slot2.d()) {
|
||||
if (slot2 != null && slot2.e()) {
|
||||
itemstack1 = slot2.getItem().cloneItemStack();
|
||||
itemstack1.count = itemstack1.getMaxStackSize();
|
||||
playerinventory.setCarried(itemstack1);
|
||||
}
|
||||
} else if (k == 4 && playerinventory.getCarried() == null && i >= 0) {
|
||||
slot2 = (Slot) this.c.get(i);
|
||||
if (slot2 != null && slot2.d() && slot2.a(entityhuman)) {
|
||||
if (slot2 != null && slot2.e() && slot2.a(entityhuman)) {
|
||||
itemstack1 = slot2.a(j == 0 ? 1 : slot2.getItem().count);
|
||||
slot2.a(entityhuman, itemstack1);
|
||||
entityhuman.drop(itemstack1);
|
||||
@ -383,7 +380,7 @@ public abstract class Container {
|
||||
} else if (k == 6 && i >= 0) {
|
||||
slot2 = (Slot) this.c.get(i);
|
||||
itemstack1 = playerinventory.getCarried();
|
||||
if (itemstack1 != null && (slot2 == null || !slot2.d() || !slot2.a(entityhuman))) {
|
||||
if (itemstack1 != null && (slot2 == null || !slot2.e() || !slot2.a(entityhuman))) {
|
||||
l = j == 0 ? 0 : this.c.size() - 1;
|
||||
k1 = j == 0 ? 1 : -1;
|
||||
|
||||
@ -391,7 +388,7 @@ public abstract class Container {
|
||||
for (int i2 = l; i2 >= 0 && i2 < this.c.size() && itemstack1.count < itemstack1.getMaxStackSize(); i2 += k1) {
|
||||
Slot slot3 = (Slot) this.c.get(i2);
|
||||
|
||||
if (slot3.d() && a(slot3, itemstack1, true) && slot3.a(entityhuman) && this.a(itemstack1, slot3) && (l1 != 0 || slot3.getItem().count != slot3.getItem().getMaxStackSize())) {
|
||||
if (slot3.e() && a(slot3, itemstack1, true) && slot3.a(entityhuman) && this.a(itemstack1, slot3) && (l1 != 0 || slot3.getItem().count != slot3.getItem().getMaxStackSize())) {
|
||||
int j2 = Math.min(itemstack1.getMaxStackSize() - itemstack1.count, slot3.getItem().count);
|
||||
ItemStack itemstack5 = slot3.a(j2);
|
||||
|
||||
@ -473,12 +470,12 @@ public abstract class Container {
|
||||
if (l <= itemstack.getMaxStackSize()) {
|
||||
itemstack.count = 0;
|
||||
itemstack1.count = l;
|
||||
slot.e();
|
||||
slot.f();
|
||||
flag1 = true;
|
||||
} else if (itemstack1.count < itemstack.getMaxStackSize()) {
|
||||
itemstack.count -= itemstack.getMaxStackSize() - itemstack1.count;
|
||||
itemstack1.count = itemstack.getMaxStackSize();
|
||||
slot.e();
|
||||
slot.f();
|
||||
flag1 = true;
|
||||
}
|
||||
}
|
||||
@ -503,7 +500,7 @@ public abstract class Container {
|
||||
itemstack1 = slot.getItem();
|
||||
if (itemstack1 == null) {
|
||||
slot.set(itemstack.cloneItemStack());
|
||||
slot.e();
|
||||
slot.f();
|
||||
itemstack.count = 0;
|
||||
flag1 = true;
|
||||
break;
|
||||
@ -538,9 +535,9 @@ public abstract class Container {
|
||||
}
|
||||
|
||||
public static boolean a(Slot slot, ItemStack itemstack, boolean flag) {
|
||||
boolean flag1 = slot == null || !slot.d();
|
||||
boolean flag1 = slot == null || !slot.e();
|
||||
|
||||
if (slot != null && slot.d() && itemstack != null && itemstack.doMaterialsMatch(slot.getItem()) && ItemStack.equals(slot.getItem(), itemstack)) {
|
||||
if (slot != null && slot.e() && itemstack != null && itemstack.doMaterialsMatch(slot.getItem()) && ItemStack.equals(slot.getItem(), itemstack)) {
|
||||
int i = flag ? 0 : itemstack.count;
|
||||
|
||||
flag1 |= slot.getItem().count + i <= itemstack.getMaxStackSize();
|
||||
|
@ -3,6 +3,8 @@ package net.minecraft.server;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import org.bukkit.craftbukkit.inventory.CraftInventoryView; // CraftBukkit
|
||||
|
||||
public class ContainerAnvil extends Container {
|
||||
@ -13,8 +15,8 @@ public class ContainerAnvil extends Container {
|
||||
private int i;
|
||||
private int j;
|
||||
private int k;
|
||||
public int a = 0;
|
||||
private int l = 0;
|
||||
public int a;
|
||||
private int l;
|
||||
private String m;
|
||||
private final EntityHuman n;
|
||||
// CraftBukkit start
|
||||
@ -202,7 +204,13 @@ public class ContainerAnvil extends Container {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.m != null && this.m.length() > 0 && !this.m.equalsIgnoreCase(this.n.getLocale().c(itemstack.a())) && !this.m.equals(itemstack.getName())) {
|
||||
if (StringUtils.isBlank(this.m)) {
|
||||
if (itemstack.hasName()) {
|
||||
j = itemstack.g() ? 7 : itemstack.count * 5;
|
||||
i += j;
|
||||
itemstack1.t();
|
||||
}
|
||||
} else if (!this.m.equals(itemstack.getName())) {
|
||||
j = itemstack.g() ? 7 : itemstack.count * 5;
|
||||
i += j;
|
||||
if (itemstack.hasName()) {
|
||||
@ -260,7 +268,6 @@ public class ContainerAnvil extends Container {
|
||||
}
|
||||
|
||||
if (j == i && j > 0 && this.a >= 40) {
|
||||
// this.h.getLogger().info("Naming an item only, cost too high; giving discount to cap cost to 39 levels"); // CraftBukkit - remove debug
|
||||
this.a = 39;
|
||||
}
|
||||
|
||||
@ -319,7 +326,7 @@ public class ContainerAnvil extends Container {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.c.get(i);
|
||||
|
||||
if (slot != null && slot.d()) {
|
||||
if (slot != null && slot.e()) {
|
||||
ItemStack itemstack1 = slot.getItem();
|
||||
|
||||
itemstack = itemstack1.cloneItemStack();
|
||||
@ -340,7 +347,7 @@ public class ContainerAnvil extends Container {
|
||||
if (itemstack1.count == 0) {
|
||||
slot.set((ItemStack) null);
|
||||
} else {
|
||||
slot.e();
|
||||
slot.f();
|
||||
}
|
||||
|
||||
if (itemstack1.count == itemstack.count) {
|
||||
@ -355,8 +362,14 @@ public class ContainerAnvil extends Container {
|
||||
|
||||
public void a(String s) {
|
||||
this.m = s;
|
||||
if (this.getSlot(2).d()) {
|
||||
this.getSlot(2).getItem().c(this.m);
|
||||
if (this.getSlot(2).e()) {
|
||||
ItemStack itemstack = this.getSlot(2).getItem();
|
||||
|
||||
if (StringUtils.isBlank(s)) {
|
||||
itemstack.t();
|
||||
} else {
|
||||
itemstack.c(this.m);
|
||||
}
|
||||
}
|
||||
|
||||
this.e();
|
||||
|
@ -45,10 +45,6 @@ public class ContainerBeacon extends Container {
|
||||
icrafting.setContainerData(this, 2, this.i);
|
||||
}
|
||||
|
||||
public void b() {
|
||||
super.b();
|
||||
}
|
||||
|
||||
public TileEntityBeacon e() {
|
||||
return this.a;
|
||||
}
|
||||
@ -62,7 +58,7 @@ public class ContainerBeacon extends Container {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.c.get(i);
|
||||
|
||||
if (slot != null && slot.d()) {
|
||||
if (slot != null && slot.e()) {
|
||||
ItemStack itemstack1 = slot.getItem();
|
||||
|
||||
itemstack = itemstack1.cloneItemStack();
|
||||
@ -72,7 +68,7 @@ public class ContainerBeacon extends Container {
|
||||
}
|
||||
|
||||
slot.a(itemstack1, itemstack);
|
||||
} else if (!this.f.d() && this.f.isAllowed(itemstack1) && itemstack1.count == 1) {
|
||||
} else if (!this.f.e() && this.f.isAllowed(itemstack1) && itemstack1.count == 1) {
|
||||
if (!this.a(itemstack1, 0, 1, false)) {
|
||||
return null;
|
||||
}
|
||||
@ -91,7 +87,7 @@ public class ContainerBeacon extends Container {
|
||||
if (itemstack1.count == 0) {
|
||||
slot.set((ItemStack) null);
|
||||
} else {
|
||||
slot.e();
|
||||
slot.f();
|
||||
}
|
||||
|
||||
if (itemstack1.count == itemstack.count) {
|
||||
|
@ -9,7 +9,7 @@ public class ContainerBrewingStand extends Container {
|
||||
|
||||
private TileEntityBrewingStand brewingStand;
|
||||
private final Slot f;
|
||||
private int g = 0;
|
||||
private int g;
|
||||
// CraftBukkit start
|
||||
private CraftInventoryView bukkitEntity = null;
|
||||
private PlayerInventory player;
|
||||
@ -64,16 +64,16 @@ public class ContainerBrewingStand extends Container {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.c.get(i);
|
||||
|
||||
if (slot != null && slot.d()) {
|
||||
if (slot != null && slot.e()) {
|
||||
ItemStack itemstack1 = slot.getItem();
|
||||
|
||||
itemstack = itemstack1.cloneItemStack();
|
||||
if ((i < 0 || i > 2) && i != 3) {
|
||||
if (!this.f.d() && this.f.isAllowed(itemstack1)) {
|
||||
if (!this.f.e() && this.f.isAllowed(itemstack1)) {
|
||||
if (!this.a(itemstack1, 3, 4, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if (SlotPotionBottle.a_(itemstack)) {
|
||||
} else if (SlotPotionBottle.b_(itemstack)) {
|
||||
if (!this.a(itemstack1, 0, 3, false)) {
|
||||
return null;
|
||||
}
|
||||
@ -99,7 +99,7 @@ public class ContainerBrewingStand extends Container {
|
||||
if (itemstack1.count == 0) {
|
||||
slot.set((ItemStack) null);
|
||||
} else {
|
||||
slot.e();
|
||||
slot.f();
|
||||
}
|
||||
|
||||
if (itemstack1.count == itemstack.count) {
|
||||
|
@ -71,7 +71,7 @@ public class ContainerChest extends Container {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.c.get(i);
|
||||
|
||||
if (slot != null && slot.d()) {
|
||||
if (slot != null && slot.e()) {
|
||||
ItemStack itemstack1 = slot.getItem();
|
||||
|
||||
itemstack = itemstack1.cloneItemStack();
|
||||
@ -86,7 +86,7 @@ public class ContainerChest extends Container {
|
||||
if (itemstack1.count == 0) {
|
||||
slot.set((ItemStack) null);
|
||||
} else {
|
||||
slot.e();
|
||||
slot.f();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@ public class ContainerDispenser extends Container {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.c.get(i);
|
||||
|
||||
if (slot != null && slot.d()) {
|
||||
if (slot != null && slot.e()) {
|
||||
ItemStack itemstack1 = slot.getItem();
|
||||
|
||||
itemstack = itemstack1.cloneItemStack();
|
||||
@ -64,7 +64,7 @@ public class ContainerDispenser extends Container {
|
||||
if (itemstack1.count == 0) {
|
||||
slot.set((ItemStack) null);
|
||||
} else {
|
||||
slot.e();
|
||||
slot.f();
|
||||
}
|
||||
|
||||
if (itemstack1.count == itemstack.count) {
|
||||
|
@ -125,7 +125,7 @@ public class ContainerEnchantTable extends Container {
|
||||
// CraftBukkit start
|
||||
CraftItemStack item = CraftItemStack.asCraftMirror(itemstack);
|
||||
PrepareItemEnchantEvent event = new PrepareItemEnchantEvent(player, this.getBukkitView(), this.world.getWorld().getBlockAt(this.x, this.y, this.z), item, this.costs, i);
|
||||
event.setCancelled(!itemstack.w());
|
||||
event.setCancelled(!itemstack.x());
|
||||
this.world.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
if (event.isCancelled()) {
|
||||
@ -229,7 +229,7 @@ public class ContainerEnchantTable extends Container {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.c.get(i);
|
||||
|
||||
if (slot != null && slot.d()) {
|
||||
if (slot != null && slot.e()) {
|
||||
ItemStack itemstack1 = slot.getItem();
|
||||
|
||||
itemstack = itemstack1.cloneItemStack();
|
||||
@ -238,7 +238,7 @@ public class ContainerEnchantTable extends Container {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
if (((Slot) this.c.get(0)).d() || !((Slot) this.c.get(0)).isAllowed(itemstack1)) {
|
||||
if (((Slot) this.c.get(0)).e() || !((Slot) this.c.get(0)).isAllowed(itemstack1)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -254,7 +254,7 @@ public class ContainerEnchantTable extends Container {
|
||||
if (itemstack1.count == 0) {
|
||||
slot.set((ItemStack) null);
|
||||
} else {
|
||||
slot.e();
|
||||
slot.f();
|
||||
}
|
||||
|
||||
if (itemstack1.count == itemstack.count) {
|
||||
|
@ -8,9 +8,9 @@ import org.bukkit.craftbukkit.inventory.CraftInventoryView;
|
||||
public class ContainerFurnace extends Container {
|
||||
|
||||
private TileEntityFurnace furnace;
|
||||
private int f = 0;
|
||||
private int g = 0;
|
||||
private int h = 0;
|
||||
private int f;
|
||||
private int g;
|
||||
private int h;
|
||||
|
||||
// CraftBukkit start
|
||||
private CraftInventoryView bukkitEntity = null;
|
||||
@ -87,7 +87,7 @@ public class ContainerFurnace extends Container {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.c.get(i);
|
||||
|
||||
if (slot != null && slot.d()) {
|
||||
if (slot != null && slot.e()) {
|
||||
ItemStack itemstack1 = slot.getItem();
|
||||
|
||||
itemstack = itemstack1.cloneItemStack();
|
||||
@ -120,7 +120,7 @@ public class ContainerFurnace extends Container {
|
||||
if (itemstack1.count == 0) {
|
||||
slot.set((ItemStack) null);
|
||||
} else {
|
||||
slot.e();
|
||||
slot.f();
|
||||
}
|
||||
|
||||
if (itemstack1.count == itemstack.count) {
|
||||
|
@ -56,7 +56,7 @@ public class ContainerHopper extends Container {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.c.get(i);
|
||||
|
||||
if (slot != null && slot.d()) {
|
||||
if (slot != null && slot.e()) {
|
||||
ItemStack itemstack1 = slot.getItem();
|
||||
|
||||
itemstack = itemstack1.cloneItemStack();
|
||||
@ -71,7 +71,7 @@ public class ContainerHopper extends Container {
|
||||
if (itemstack1.count == 0) {
|
||||
slot.set((ItemStack) null);
|
||||
} else {
|
||||
slot.e();
|
||||
slot.f();
|
||||
}
|
||||
}
|
||||
|
||||
|
104
src/main/java/net/minecraft/server/ContainerHorse.java
Normal file
104
src/main/java/net/minecraft/server/ContainerHorse.java
Normal file
@ -0,0 +1,104 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
// CraftBukkit start
|
||||
import org.bukkit.craftbukkit.inventory.CraftInventory;
|
||||
import org.bukkit.craftbukkit.inventory.CraftInventoryView;
|
||||
import org.bukkit.inventory.InventoryView;
|
||||
// CraftBukkit end
|
||||
|
||||
public class ContainerHorse extends Container {
|
||||
|
||||
private IInventory a;
|
||||
private EntityHorse f;
|
||||
|
||||
// CraftBukkit start
|
||||
org.bukkit.craftbukkit.inventory.CraftInventoryView bukkitEntity;
|
||||
PlayerInventory player;
|
||||
|
||||
@Override
|
||||
public InventoryView getBukkitView() {
|
||||
if (bukkitEntity != null) {
|
||||
return bukkitEntity;
|
||||
}
|
||||
|
||||
CraftInventory inventory = new org.bukkit.craftbukkit.inventory.CraftInventoryHorse(this.a);
|
||||
return bukkitEntity = new CraftInventoryView(player.player.getBukkitEntity(), inventory, this);
|
||||
}
|
||||
|
||||
public ContainerHorse(IInventory iinventory, IInventory iinventory1, EntityHorse entityhorse) {
|
||||
player = (PlayerInventory) iinventory;
|
||||
// CraftBukkit end
|
||||
this.a = iinventory1;
|
||||
this.f = entityhorse;
|
||||
byte b0 = 3;
|
||||
|
||||
iinventory1.startOpen();
|
||||
int i = (b0 - 4) * 18;
|
||||
|
||||
this.a(new SlotHorseSaddle(this, iinventory1, 0, 8, 18));
|
||||
this.a(new SlotHorseArmor(this, iinventory1, 1, 8, 36, entityhorse));
|
||||
int j;
|
||||
int k;
|
||||
|
||||
if (entityhorse.ca()) {
|
||||
for (j = 0; j < b0; ++j) {
|
||||
for (k = 0; k < 5; ++k) {
|
||||
this.a(new Slot(iinventory1, 2 + k + j * 5, 80 + k * 18, 18 + j * 18));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (j = 0; j < 3; ++j) {
|
||||
for (k = 0; k < 9; ++k) {
|
||||
this.a(new Slot(iinventory, k + j * 9 + 9, 8 + k * 18, 102 + j * 18 + i));
|
||||
}
|
||||
}
|
||||
|
||||
for (j = 0; j < 9; ++j) {
|
||||
this.a(new Slot(iinventory, j, 8 + j * 18, 160 + i));
|
||||
}
|
||||
}
|
||||
|
||||
public boolean a(EntityHuman entityhuman) {
|
||||
return this.a.a(entityhuman) && this.f.d(entityhuman) < 8.0F;
|
||||
}
|
||||
|
||||
public ItemStack b(EntityHuman entityhuman, int i) {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.c.get(i);
|
||||
|
||||
if (slot != null && slot.e()) {
|
||||
ItemStack itemstack1 = slot.getItem();
|
||||
|
||||
itemstack = itemstack1.cloneItemStack();
|
||||
if (i < this.a.getSize()) {
|
||||
if (!this.a(itemstack1, this.a.getSize(), this.c.size(), true)) {
|
||||
return null;
|
||||
}
|
||||
} else if (this.getSlot(1).isAllowed(itemstack1)) {
|
||||
if (!this.a(itemstack1, 1, 2, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if (this.getSlot(0).isAllowed(itemstack1)) {
|
||||
if (!this.a(itemstack1, 0, 1, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if (this.a.getSize() <= 2 || !this.a(itemstack1, 2, this.a.getSize(), false)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (itemstack1.count == 0) {
|
||||
slot.set((ItemStack) null);
|
||||
} else {
|
||||
slot.f();
|
||||
}
|
||||
}
|
||||
|
||||
return itemstack;
|
||||
}
|
||||
|
||||
public void b(EntityHuman entityhuman) {
|
||||
super.b(entityhuman);
|
||||
this.a.g();
|
||||
}
|
||||
}
|
@ -72,7 +72,7 @@ public class ContainerMerchant extends Container {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.c.get(i);
|
||||
|
||||
if (slot != null && slot.d()) {
|
||||
if (slot != null && slot.e()) {
|
||||
ItemStack itemstack1 = slot.getItem();
|
||||
|
||||
itemstack = itemstack1.cloneItemStack();
|
||||
@ -97,7 +97,7 @@ public class ContainerMerchant extends Container {
|
||||
if (itemstack1.count == 0) {
|
||||
slot.set((ItemStack) null);
|
||||
} else {
|
||||
slot.e();
|
||||
slot.f();
|
||||
}
|
||||
|
||||
if (itemstack1.count == itemstack.count) {
|
||||
@ -112,7 +112,7 @@ public class ContainerMerchant extends Container {
|
||||
|
||||
public void b(EntityHuman entityhuman) {
|
||||
super.b(entityhuman);
|
||||
this.merchant.a((EntityHuman) null);
|
||||
this.merchant.a_((EntityHuman) null);
|
||||
super.b(entityhuman);
|
||||
if (!this.g.isStatic) {
|
||||
ItemStack itemstack = this.f.splitWithoutUpdate(0);
|
||||
|
@ -9,7 +9,7 @@ public class ContainerPlayer extends Container {
|
||||
|
||||
public InventoryCrafting craftInventory = new InventoryCrafting(this, 2, 2);
|
||||
public IInventory resultInventory = new InventoryCraftResult();
|
||||
public boolean g = false;
|
||||
public boolean g;
|
||||
private final EntityHuman h;
|
||||
// CraftBukkit start
|
||||
private CraftInventoryView bukkitEntity = null;
|
||||
@ -87,7 +87,7 @@ public class ContainerPlayer extends Container {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.c.get(i);
|
||||
|
||||
if (slot != null && slot.d()) {
|
||||
if (slot != null && slot.e()) {
|
||||
ItemStack itemstack1 = slot.getItem();
|
||||
|
||||
itemstack = itemstack1.cloneItemStack();
|
||||
@ -105,7 +105,7 @@ public class ContainerPlayer extends Container {
|
||||
if (!this.a(itemstack1, 9, 45, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if (itemstack.getItem() instanceof ItemArmor && !((Slot) this.c.get(5 + ((ItemArmor) itemstack.getItem()).b)).d()) {
|
||||
} else if (itemstack.getItem() instanceof ItemArmor && !((Slot) this.c.get(5 + ((ItemArmor) itemstack.getItem()).b)).e()) {
|
||||
int j = 5 + ((ItemArmor) itemstack.getItem()).b;
|
||||
|
||||
if (!this.a(itemstack1, j, j + 1, false)) {
|
||||
@ -126,7 +126,7 @@ public class ContainerPlayer extends Container {
|
||||
if (itemstack1.count == 0) {
|
||||
slot.set((ItemStack) null);
|
||||
} else {
|
||||
slot.e();
|
||||
slot.f();
|
||||
}
|
||||
|
||||
if (itemstack1.count == itemstack.count) {
|
||||
|
@ -89,7 +89,7 @@ public class ContainerWorkbench extends Container {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.c.get(i);
|
||||
|
||||
if (slot != null && slot.d()) {
|
||||
if (slot != null && slot.e()) {
|
||||
ItemStack itemstack1 = slot.getItem();
|
||||
|
||||
itemstack = itemstack1.cloneItemStack();
|
||||
@ -114,7 +114,7 @@ public class ContainerWorkbench extends Container {
|
||||
if (itemstack1.count == 0) {
|
||||
slot.set((ItemStack) null);
|
||||
} else {
|
||||
slot.e();
|
||||
slot.f();
|
||||
}
|
||||
|
||||
if (itemstack1.count == itemstack.count) {
|
||||
|
@ -4,16 +4,16 @@ import org.bukkit.craftbukkit.TrigMath; // CraftBukkit
|
||||
|
||||
public class ControllerLook {
|
||||
|
||||
private EntityLiving a;
|
||||
private EntityInsentient a;
|
||||
private float b;
|
||||
private float c;
|
||||
private boolean d = false;
|
||||
private boolean d;
|
||||
private double e;
|
||||
private double f;
|
||||
private double g;
|
||||
|
||||
public ControllerLook(EntityLiving entityliving) {
|
||||
this.a = entityliving;
|
||||
public ControllerLook(EntityInsentient entityinsentient) {
|
||||
this.a = entityinsentient;
|
||||
}
|
||||
|
||||
public void a(Entity entity, float f, float f1) {
|
||||
@ -53,20 +53,20 @@ public class ControllerLook {
|
||||
// CraftBukkit end
|
||||
|
||||
this.a.pitch = this.a(this.a.pitch, f1, this.c);
|
||||
this.a.aA = this.a(this.a.aA, f, this.b);
|
||||
this.a.aP = this.a(this.a.aP, f, this.b);
|
||||
} else {
|
||||
this.a.aA = this.a(this.a.aA, this.a.ax, 10.0F);
|
||||
this.a.aP = this.a(this.a.aP, this.a.aN, 10.0F);
|
||||
}
|
||||
|
||||
float f2 = MathHelper.g(this.a.aA - this.a.ay);
|
||||
float f2 = MathHelper.g(this.a.aP - this.a.aN);
|
||||
|
||||
if (!this.a.getNavigation().f()) {
|
||||
if (!this.a.getNavigation().g()) {
|
||||
if (f2 < -75.0F) {
|
||||
this.a.aA = this.a.ay - 75.0F;
|
||||
this.a.aP = this.a.aN - 75.0F;
|
||||
}
|
||||
|
||||
if (f2 > 75.0F) {
|
||||
this.a.aA = this.a.ay + 75.0F;
|
||||
this.a.aP = this.a.aN + 75.0F;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,38 +2,38 @@ package net.minecraft.server;
|
||||
|
||||
public class ControllerMove {
|
||||
|
||||
private EntityLiving a;
|
||||
private EntityInsentient a;
|
||||
private double b;
|
||||
private double c;
|
||||
private double d;
|
||||
private float e;
|
||||
private boolean f = false;
|
||||
private double e;
|
||||
private boolean f;
|
||||
|
||||
public ControllerMove(EntityLiving entityliving) {
|
||||
this.a = entityliving;
|
||||
this.b = entityliving.locX;
|
||||
this.c = entityliving.locY;
|
||||
this.d = entityliving.locZ;
|
||||
public ControllerMove(EntityInsentient entityinsentient) {
|
||||
this.a = entityinsentient;
|
||||
this.b = entityinsentient.locX;
|
||||
this.c = entityinsentient.locY;
|
||||
this.d = entityinsentient.locZ;
|
||||
}
|
||||
|
||||
public boolean a() {
|
||||
return this.f;
|
||||
}
|
||||
|
||||
public float b() {
|
||||
public double b() {
|
||||
return this.e;
|
||||
}
|
||||
|
||||
public void a(double d0, double d1, double d2, float f) {
|
||||
public void a(double d0, double d1, double d2, double d3) {
|
||||
this.b = d0;
|
||||
this.c = d1;
|
||||
this.d = d2;
|
||||
this.e = f;
|
||||
this.e = d3;
|
||||
this.f = true;
|
||||
}
|
||||
|
||||
public void c() {
|
||||
this.a.f(0.0F);
|
||||
this.a.n(0.0F);
|
||||
if (this.f) {
|
||||
this.f = false;
|
||||
int i = MathHelper.floor(this.a.boundingBox.b + 0.5D);
|
||||
@ -47,7 +47,7 @@ public class ControllerMove {
|
||||
float f = (float) (org.bukkit.craftbukkit.TrigMath.atan2(d1, d0) * 180.0D / 3.1415927410125732D) - 90.0F;
|
||||
|
||||
this.a.yaw = this.a(this.a.yaw, f, 30.0F);
|
||||
this.a.e(this.e * this.a.bE());
|
||||
this.a.i((float) (this.e * this.a.a(GenericAttributes.d).e()));
|
||||
if (d2 > 0.0D && d0 * d0 + d1 * d1 < 1.0D) {
|
||||
this.a.getControllerJump().a();
|
||||
}
|
||||
|
@ -42,6 +42,8 @@ public class CraftingManager {
|
||||
this.registerShapedRecipe(new ItemStack(Block.NETHER_FENCE, 6), new Object[] { "###", "###", Character.valueOf('#'), Block.NETHER_BRICK});
|
||||
this.registerShapedRecipe(new ItemStack(Block.FENCE_GATE, 1), new Object[] { "#W#", "#W#", Character.valueOf('#'), Item.STICK, Character.valueOf('W'), Block.WOOD});
|
||||
this.registerShapedRecipe(new ItemStack(Block.JUKEBOX, 1), new Object[] { "###", "#X#", "###", Character.valueOf('#'), Block.WOOD, Character.valueOf('X'), Item.DIAMOND});
|
||||
this.registerShapedRecipe(new ItemStack(Item.LEASH, 2), new Object[] { "~~ ", "~O ", " ~", Character.valueOf('~'), Item.STRING, Character.valueOf('O'), Item.SLIME_BALL});
|
||||
this.registerShapedRecipe(new ItemStack(Block.HAY_BLOCK, 1), new Object[] { "###", "###", "###", Character.valueOf('#'), Item.WHEAT});
|
||||
this.registerShapedRecipe(new ItemStack(Block.NOTE_BLOCK, 1), new Object[] { "###", "#X#", "###", Character.valueOf('#'), Block.WOOD, Character.valueOf('X'), Item.REDSTONE});
|
||||
this.registerShapedRecipe(new ItemStack(Block.BOOKSHELF, 1), new Object[] { "###", "XXX", "###", Character.valueOf('#'), Block.WOOD, Character.valueOf('X'), Item.BOOK});
|
||||
this.registerShapedRecipe(new ItemStack(Block.SNOW_BLOCK, 1), new Object[] { "##", "##", Character.valueOf('#'), Item.SNOW_BALL});
|
||||
@ -110,9 +112,10 @@ public class CraftingManager {
|
||||
this.registerShapedRecipe(new ItemStack(Block.QUARTZ_STAIRS, 4), new Object[] { "# ", "## ", "###", Character.valueOf('#'), Block.QUARTZ_BLOCK});
|
||||
this.registerShapedRecipe(new ItemStack(Item.PAINTING, 1), new Object[] { "###", "#X#", "###", Character.valueOf('#'), Item.STICK, Character.valueOf('X'), Block.WOOL});
|
||||
this.registerShapedRecipe(new ItemStack(Item.ITEM_FRAME, 1), new Object[] { "###", "#X#", "###", Character.valueOf('#'), Item.STICK, Character.valueOf('X'), Item.LEATHER});
|
||||
this.registerShapedRecipe(new ItemStack(Item.GOLDEN_APPLE, 1, 0), new Object[] { "###", "#X#", "###", Character.valueOf('#'), Item.GOLD_NUGGET, Character.valueOf('X'), Item.APPLE});
|
||||
this.registerShapedRecipe(new ItemStack(Item.GOLDEN_APPLE, 1, 0), new Object[] { "###", "#X#", "###", Character.valueOf('#'), Item.GOLD_INGOT, Character.valueOf('X'), Item.APPLE});
|
||||
this.registerShapedRecipe(new ItemStack(Item.GOLDEN_APPLE, 1, 1), new Object[] { "###", "#X#", "###", Character.valueOf('#'), Block.GOLD_BLOCK, Character.valueOf('X'), Item.APPLE});
|
||||
this.registerShapedRecipe(new ItemStack(Item.CARROT_GOLDEN, 1, 0), new Object[] { "###", "#X#", "###", Character.valueOf('#'), Item.GOLD_NUGGET, Character.valueOf('X'), Item.CARROT});
|
||||
this.registerShapedRecipe(new ItemStack(Item.SPECKLED_MELON, 1), new Object[] { "###", "#X#", "###", Character.valueOf('#'), Item.GOLD_NUGGET, Character.valueOf('X'), Item.MELON});
|
||||
this.registerShapedRecipe(new ItemStack(Block.LEVER, 1), new Object[] { "X", "#", Character.valueOf('#'), Block.COBBLESTONE, Character.valueOf('X'), Item.STICK});
|
||||
this.registerShapedRecipe(new ItemStack(Block.TRIPWIRE_SOURCE, 2), new Object[] { "I", "S", "#", Character.valueOf('#'), Block.WOOD, Character.valueOf('S'), Item.STICK, Character.valueOf('I'), Item.IRON_INGOT});
|
||||
this.registerShapedRecipe(new ItemStack(Block.REDSTONE_TORCH_ON, 1), new Object[] { "X", "#", Character.valueOf('#'), Item.STICK, Character.valueOf('X'), Item.REDSTONE});
|
||||
@ -141,7 +144,6 @@ public class CraftingManager {
|
||||
this.registerShapedRecipe(new ItemStack(Block.HOPPER), new Object[] { "I I", "ICI", " I ", Character.valueOf('I'), Item.IRON_INGOT, Character.valueOf('C'), Block.CHEST});
|
||||
// Collections.sort(this.recipes, new RecipeSorter(this)); // CraftBukkit - moved below
|
||||
this.sort(); // CraftBukkit - call new sort method
|
||||
System.out.println(this.recipes.size() + " recipes");
|
||||
}
|
||||
|
||||
// CraftBukkit start
|
||||
|
@ -18,7 +18,7 @@ public class CrashReport {
|
||||
private final Throwable b;
|
||||
private final CrashReportSystemDetails c = new CrashReportSystemDetails(this, "System Details");
|
||||
private final List d = new ArrayList();
|
||||
private File e = null;
|
||||
private File e;
|
||||
private boolean f = true;
|
||||
private StackTraceElement[] g = new StackTraceElement[0];
|
||||
|
||||
@ -130,7 +130,7 @@ public class CrashReport {
|
||||
return stringbuilder.toString();
|
||||
}
|
||||
|
||||
public boolean a(File file1, IConsoleLogManager iconsolelogmanager) {
|
||||
public boolean a(File file1, IConsoleLogManager iconsolelogmanager) {
|
||||
if (this.e != null) {
|
||||
return false;
|
||||
} else {
|
||||
|
@ -19,21 +19,21 @@ import org.bukkit.event.server.ServerCommandEvent;
|
||||
|
||||
public class DedicatedServer extends MinecraftServer implements IMinecraftServer {
|
||||
|
||||
private final List k = Collections.synchronizedList(new ArrayList());
|
||||
private final IConsoleLogManager l;
|
||||
private RemoteStatusListener m;
|
||||
private RemoteControlListener n;
|
||||
private final List l = Collections.synchronizedList(new ArrayList());
|
||||
private final IConsoleLogManager m;
|
||||
private RemoteStatusListener n;
|
||||
private RemoteControlListener o;
|
||||
public PropertyManager propertyManager; // CraftBukkit - private -> public
|
||||
private boolean generateStructures;
|
||||
private EnumGamemode q;
|
||||
private ServerConnection r;
|
||||
private boolean s = false;
|
||||
private EnumGamemode r;
|
||||
private ServerConnection s;
|
||||
private boolean t;
|
||||
|
||||
// CraftBukkit start - Signature changed
|
||||
public DedicatedServer(joptsimple.OptionSet options) {
|
||||
super(options);
|
||||
// CraftBukkit end
|
||||
this.l = new ConsoleLogManager("Minecraft-Server", (String) null, (String) null); // CraftBukkit - null last argument
|
||||
this.m = new ConsoleLogManager("Minecraft-Server", (String) null, (String) null); // CraftBukkit - null last argument
|
||||
new ThreadSleepForever(this);
|
||||
}
|
||||
|
||||
@ -48,18 +48,18 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
System.setErr(new PrintStream(new LoggerOutputStream(this.getLogger().getLogger(), Level.SEVERE), true));
|
||||
// CraftBukkit end
|
||||
|
||||
this.getLogger().info("Starting minecraft server version 1.5.2");
|
||||
this.getLogger().info("Starting minecraft server version 1.6.1");
|
||||
if (Runtime.getRuntime().maxMemory() / 1024L / 1024L < 512L) {
|
||||
this.getLogger().warning("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\"");
|
||||
}
|
||||
|
||||
this.getLogger().info("Loading properties");
|
||||
this.propertyManager = new PropertyManager(this.options, this.getLogger()); // CraftBukkit - CLI argument support
|
||||
if (this.I()) {
|
||||
this.d("127.0.0.1");
|
||||
if (this.K()) {
|
||||
this.c("127.0.0.1");
|
||||
} else {
|
||||
this.setOnlineMode(this.propertyManager.getBoolean("online-mode", true));
|
||||
this.d(this.propertyManager.getString("server-ip", ""));
|
||||
this.c(this.propertyManager.getString("server-ip", ""));
|
||||
}
|
||||
|
||||
this.setSpawnAnimals(this.propertyManager.getBoolean("spawn-animals", true));
|
||||
@ -78,24 +78,24 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
this.generateStructures = this.propertyManager.getBoolean("generate-structures", true);
|
||||
int i = this.propertyManager.getInt("gamemode", EnumGamemode.SURVIVAL.a());
|
||||
|
||||
this.q = WorldSettings.a(i);
|
||||
this.getLogger().info("Default game type: " + this.q);
|
||||
this.r = WorldSettings.a(i);
|
||||
this.getLogger().info("Default game type: " + this.r);
|
||||
InetAddress inetaddress = null;
|
||||
|
||||
if (this.getServerIp().length() > 0) {
|
||||
inetaddress = InetAddress.getByName(this.getServerIp());
|
||||
}
|
||||
|
||||
if (this.G() < 0) {
|
||||
if (this.I() < 0) {
|
||||
this.setPort(this.propertyManager.getInt("server-port", 25565));
|
||||
}
|
||||
|
||||
this.getLogger().info("Generating keypair");
|
||||
this.a(MinecraftEncryption.b());
|
||||
this.getLogger().info("Starting Minecraft server on " + (this.getServerIp().length() == 0 ? "*" : this.getServerIp()) + ":" + this.G());
|
||||
this.getLogger().info("Starting Minecraft server on " + (this.getServerIp().length() == 0 ? "*" : this.getServerIp()) + ":" + this.I());
|
||||
|
||||
try {
|
||||
this.r = new DedicatedServerConnection(this, inetaddress, this.G());
|
||||
this.s = new DedicatedServerConnection(this, inetaddress, this.I());
|
||||
} catch (Throwable ioexception) { // CraftBukkit - IOException -> Throwable
|
||||
this.getLogger().warning("**** FAILED TO BIND TO PORT!");
|
||||
this.getLogger().warning("The exception was: {0}", new Object[] { ioexception.toString()});
|
||||
@ -116,8 +116,8 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
this.convertable = new WorldLoaderServer(server.getWorldContainer()); // CraftBukkit - moved from MinecraftServer constructor
|
||||
long j = System.nanoTime();
|
||||
|
||||
if (this.J() == null) {
|
||||
this.l(this.propertyManager.getString("level-name", "world"));
|
||||
if (this.L() == null) {
|
||||
this.k(this.propertyManager.getString("level-name", "world"));
|
||||
}
|
||||
|
||||
String s = this.propertyManager.getString("level-seed", "");
|
||||
@ -147,22 +147,22 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
this.d((this.getMaxBuildHeight() + 8) / 16 * 16);
|
||||
this.d(MathHelper.a(this.getMaxBuildHeight(), 64, 256));
|
||||
this.propertyManager.a("max-build-height", Integer.valueOf(this.getMaxBuildHeight()));
|
||||
this.getLogger().info("Preparing level \"" + this.J() + "\"");
|
||||
this.a(this.J(), this.J(), k, worldtype, s2);
|
||||
this.getLogger().info("Preparing level \"" + this.L() + "\"");
|
||||
this.a(this.L(), this.L(), k, worldtype, s2);
|
||||
long i1 = System.nanoTime() - j;
|
||||
String s3 = String.format("%.3fs", new Object[] { Double.valueOf((double) i1 / 1.0E9D)});
|
||||
|
||||
this.getLogger().info("Done (" + s3 + ")! For help, type \"help\" or \"?\"");
|
||||
if (this.propertyManager.getBoolean("enable-query", false)) {
|
||||
this.getLogger().info("Starting GS4 status listener");
|
||||
this.m = new RemoteStatusListener(this);
|
||||
this.m.a();
|
||||
this.n = new RemoteStatusListener(this);
|
||||
this.n.a();
|
||||
}
|
||||
|
||||
if (this.propertyManager.getBoolean("enable-rcon", false)) {
|
||||
this.getLogger().info("Starting remote control listener");
|
||||
this.n = new RemoteControlListener(this);
|
||||
this.n.a();
|
||||
this.o = new RemoteControlListener(this);
|
||||
this.o.a();
|
||||
this.remoteConsole = new org.bukkit.craftbukkit.command.CraftRemoteConsoleCommandSender(); // CraftBukkit
|
||||
}
|
||||
|
||||
@ -188,7 +188,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
}
|
||||
|
||||
public EnumGamemode getGamemode() {
|
||||
return this.q;
|
||||
return this.r;
|
||||
}
|
||||
|
||||
public int getDifficulty() {
|
||||
@ -201,7 +201,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
|
||||
protected void a(CrashReport crashreport) {
|
||||
while (this.isRunning()) {
|
||||
this.an();
|
||||
this.ar();
|
||||
|
||||
try {
|
||||
Thread.sleep(10L);
|
||||
@ -218,13 +218,13 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
return crashreport;
|
||||
}
|
||||
|
||||
protected void p() {
|
||||
protected void r() {
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public void r() { // CraftBukkit - protected -> public
|
||||
super.r();
|
||||
this.an();
|
||||
public void t() { // CraftBukkit - protected -> public
|
||||
super.t();
|
||||
this.ar();
|
||||
}
|
||||
|
||||
public boolean getAllowNether() {
|
||||
@ -236,8 +236,8 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
}
|
||||
|
||||
public void a(MojangStatisticsGenerator mojangstatisticsgenerator) {
|
||||
mojangstatisticsgenerator.a("whitelist_enabled", Boolean.valueOf(this.ao().getHasWhitelist()));
|
||||
mojangstatisticsgenerator.a("whitelist_count", Integer.valueOf(this.ao().getWhitelisted().size()));
|
||||
mojangstatisticsgenerator.a("whitelist_enabled", Boolean.valueOf(this.as().getHasWhitelist()));
|
||||
mojangstatisticsgenerator.a("whitelist_count", Integer.valueOf(this.as().getWhitelisted().size()));
|
||||
super.a(mojangstatisticsgenerator);
|
||||
}
|
||||
|
||||
@ -246,12 +246,12 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
}
|
||||
|
||||
public void issueCommand(String s, ICommandListener icommandlistener) {
|
||||
this.k.add(new ServerCommand(s, icommandlistener));
|
||||
this.l.add(new ServerCommand(s, icommandlistener));
|
||||
}
|
||||
|
||||
public void an() {
|
||||
while (!this.k.isEmpty()) {
|
||||
ServerCommand servercommand = (ServerCommand) this.k.remove(0);
|
||||
public void ar() {
|
||||
while (!this.l.isEmpty()) {
|
||||
ServerCommand servercommand = (ServerCommand) this.l.remove(0);
|
||||
|
||||
// CraftBukkit start - ServerCommand for preprocessing
|
||||
ServerCommandEvent event = new ServerCommandEvent(this.console, servercommand.command);
|
||||
@ -264,16 +264,16 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
}
|
||||
}
|
||||
|
||||
public boolean T() {
|
||||
public boolean V() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public DedicatedPlayerList ao() {
|
||||
public DedicatedPlayerList as() {
|
||||
return (DedicatedPlayerList) super.getPlayerList();
|
||||
}
|
||||
|
||||
public ServerConnection ae() {
|
||||
return this.r;
|
||||
public ServerConnection ag() {
|
||||
return this.s;
|
||||
}
|
||||
|
||||
public int a(String s, int i) {
|
||||
@ -302,13 +302,13 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
return file1 != null ? file1.getAbsolutePath() : "No settings file";
|
||||
}
|
||||
|
||||
public void ap() {
|
||||
public void at() {
|
||||
ServerGUI.a(this);
|
||||
this.s = true;
|
||||
this.t = true;
|
||||
}
|
||||
|
||||
public boolean ag() {
|
||||
return this.s;
|
||||
public boolean ai() {
|
||||
return this.t;
|
||||
}
|
||||
|
||||
public String a(EnumGamemode enumgamemode, boolean flag) {
|
||||
@ -326,9 +326,9 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
public boolean a(World world, int i, int j, int k, EntityHuman entityhuman) {
|
||||
if (world.worldProvider.dimension != 0) {
|
||||
return false;
|
||||
} else if (this.ao().getOPs().isEmpty()) {
|
||||
} else if (this.as().getOPs().isEmpty()) {
|
||||
return false;
|
||||
} else if (this.ao().isOp(entityhuman.name)) {
|
||||
} else if (this.as().isOp(entityhuman.getName())) {
|
||||
return false;
|
||||
} else if (this.getSpawnProtection() <= 0) {
|
||||
return false;
|
||||
@ -343,10 +343,14 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
}
|
||||
|
||||
public IConsoleLogManager getLogger() {
|
||||
return this.l;
|
||||
return this.m;
|
||||
}
|
||||
|
||||
public int k() {
|
||||
return this.propertyManager.getInt("op-permission-level", 4);
|
||||
}
|
||||
|
||||
public PlayerList getPlayerList() {
|
||||
return this.ao();
|
||||
return this.as();
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ public class DedicatedServerConnectionThread extends Thread {
|
||||
|
||||
private final List a = Collections.synchronizedList(new ArrayList());
|
||||
private final HashMap b = new HashMap();
|
||||
private int c = 0;
|
||||
private int c;
|
||||
private final ServerSocket d;
|
||||
private ServerConnection e;
|
||||
private final InetAddress f;
|
||||
|
@ -12,7 +12,7 @@ final class DispenseBehaviorArmor extends DispenseBehaviorItem {
|
||||
DispenseBehaviorArmor() {}
|
||||
|
||||
protected ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) {
|
||||
EnumFacing enumfacing = BlockDispenser.j_(isourceblock.h());
|
||||
EnumFacing enumfacing = BlockDispenser.l_(isourceblock.h());
|
||||
int i = isourceblock.getBlockX() + enumfacing.c();
|
||||
int j = isourceblock.getBlockY() + enumfacing.d();
|
||||
int k = isourceblock.getBlockZ() + enumfacing.e();
|
||||
@ -22,7 +22,7 @@ final class DispenseBehaviorArmor extends DispenseBehaviorItem {
|
||||
if (list.size() > 0) {
|
||||
EntityLiving entityliving = (EntityLiving) list.get(0);
|
||||
int l = entityliving instanceof EntityHuman ? 1 : 0;
|
||||
int i1 = EntityLiving.b(itemstack);
|
||||
int i1 = EntityInsentient.b(itemstack);
|
||||
|
||||
// CraftBukkit start
|
||||
ItemStack itemstack1 = itemstack.a(1);
|
||||
@ -54,7 +54,10 @@ final class DispenseBehaviorArmor extends DispenseBehaviorItem {
|
||||
|
||||
itemstack1.count = 1;
|
||||
entityliving.setEquipment(i1 - l, itemstack1);
|
||||
entityliving.a(i1, 2.0F);
|
||||
if (entityliving instanceof EntityInsentient) {
|
||||
((EntityInsentient) entityliving).a(i1, 2.0F);
|
||||
}
|
||||
|
||||
// --itemstack.count; // CraftBukkit - handled above
|
||||
return itemstack;
|
||||
} else {
|
||||
|
@ -12,7 +12,7 @@ final class DispenseBehaviorBoat extends DispenseBehaviorItem {
|
||||
DispenseBehaviorBoat() {}
|
||||
|
||||
public ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) {
|
||||
EnumFacing enumfacing = BlockDispenser.j_(isourceblock.h());
|
||||
EnumFacing enumfacing = BlockDispenser.l_(isourceblock.h());
|
||||
World world = isourceblock.k();
|
||||
double d0 = isourceblock.getX() + (double) ((float) enumfacing.c() * 1.125F);
|
||||
double d1 = isourceblock.getY() + (double) ((float) enumfacing.d() * 1.125F);
|
||||
|
@ -13,7 +13,7 @@ final class DispenseBehaviorBonemeal extends DispenseBehaviorItem {
|
||||
|
||||
protected ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) {
|
||||
if (itemstack.getData() == 15) {
|
||||
EnumFacing enumfacing = BlockDispenser.j_(isourceblock.h());
|
||||
EnumFacing enumfacing = BlockDispenser.l_(isourceblock.h());
|
||||
World world = isourceblock.k();
|
||||
int i = isourceblock.getBlockX() + enumfacing.c();
|
||||
int j = isourceblock.getBlockY() + enumfacing.d();
|
||||
|
@ -12,7 +12,7 @@ final class DispenseBehaviorEmptyBucket extends DispenseBehaviorItem {
|
||||
DispenseBehaviorEmptyBucket() {}
|
||||
|
||||
public ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) {
|
||||
EnumFacing enumfacing = BlockDispenser.j_(isourceblock.h());
|
||||
EnumFacing enumfacing = BlockDispenser.l_(isourceblock.h());
|
||||
World world = isourceblock.k();
|
||||
int i = isourceblock.getBlockX() + enumfacing.c();
|
||||
int j = isourceblock.getBlockY() + enumfacing.d();
|
||||
|
@ -16,7 +16,7 @@ final class DispenseBehaviorFilledBucket extends DispenseBehaviorItem {
|
||||
int i = isourceblock.getBlockX();
|
||||
int j = isourceblock.getBlockY();
|
||||
int k = isourceblock.getBlockZ();
|
||||
EnumFacing enumfacing = BlockDispenser.j_(isourceblock.h());
|
||||
EnumFacing enumfacing = BlockDispenser.l_(isourceblock.h());
|
||||
|
||||
// CraftBukkit start
|
||||
World world = isourceblock.k();
|
||||
@ -50,7 +50,7 @@ final class DispenseBehaviorFilledBucket extends DispenseBehaviorItem {
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
if (itembucket.a(isourceblock.k(), (double) i, (double) j, (double) k, i + enumfacing.c(), j + enumfacing.d(), k + enumfacing.e())) {
|
||||
if (itembucket.a(isourceblock.k(), i + enumfacing.c(), j + enumfacing.d(), k + enumfacing.e())) {
|
||||
// CraftBukkit start - Handle stacked buckets
|
||||
Item item = Item.BUCKET;
|
||||
if (--itemstack.count == 0) {
|
||||
|
@ -12,7 +12,7 @@ final class DispenseBehaviorFireball extends DispenseBehaviorItem {
|
||||
DispenseBehaviorFireball() {}
|
||||
|
||||
public ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) {
|
||||
EnumFacing enumfacing = BlockDispenser.j_(isourceblock.h());
|
||||
EnumFacing enumfacing = BlockDispenser.l_(isourceblock.h());
|
||||
IPosition iposition = BlockDispenser.a(isourceblock);
|
||||
double d0 = iposition.getX() + (double) ((float) enumfacing.c() * 0.3F);
|
||||
double d1 = iposition.getY() + (double) ((float) enumfacing.c() * 0.3F);
|
||||
|
@ -10,7 +10,7 @@ final class DispenseBehaviorFireworks extends DispenseBehaviorItem {
|
||||
DispenseBehaviorFireworks() {}
|
||||
|
||||
public ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) {
|
||||
EnumFacing enumfacing = BlockDispenser.j_(isourceblock.h());
|
||||
EnumFacing enumfacing = BlockDispenser.l_(isourceblock.h());
|
||||
double d0 = isourceblock.getX() + (double) enumfacing.c();
|
||||
double d1 = (double) ((float) isourceblock.getBlockY() + 0.2F);
|
||||
double d2 = isourceblock.getZ() + (double) enumfacing.e();
|
||||
|
@ -12,7 +12,7 @@ final class DispenseBehaviorFlintAndSteel extends DispenseBehaviorItem {
|
||||
DispenseBehaviorFlintAndSteel() {}
|
||||
|
||||
protected ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) {
|
||||
EnumFacing enumfacing = BlockDispenser.j_(isourceblock.h());
|
||||
EnumFacing enumfacing = BlockDispenser.l_(isourceblock.h());
|
||||
World world = isourceblock.k();
|
||||
int i = isourceblock.getBlockX() + enumfacing.c();
|
||||
int j = isourceblock.getBlockY() + enumfacing.d();
|
||||
|
@ -13,12 +13,12 @@ public class DispenseBehaviorItem implements IDispenseBehavior {
|
||||
ItemStack itemstack1 = this.b(isourceblock, itemstack);
|
||||
|
||||
this.a(isourceblock);
|
||||
this.a(isourceblock, BlockDispenser.j_(isourceblock.h()));
|
||||
this.a(isourceblock, BlockDispenser.l_(isourceblock.h()));
|
||||
return itemstack1;
|
||||
}
|
||||
|
||||
protected ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) {
|
||||
EnumFacing enumfacing = BlockDispenser.j_(isourceblock.h());
|
||||
EnumFacing enumfacing = BlockDispenser.l_(isourceblock.h());
|
||||
IPosition iposition = BlockDispenser.a(isourceblock);
|
||||
ItemStack itemstack1 = itemstack.a(1);
|
||||
|
||||
|
@ -12,7 +12,7 @@ final class DispenseBehaviorMinecart extends DispenseBehaviorItem {
|
||||
DispenseBehaviorMinecart() {}
|
||||
|
||||
public ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) {
|
||||
EnumFacing enumfacing = BlockDispenser.j_(isourceblock.h());
|
||||
EnumFacing enumfacing = BlockDispenser.l_(isourceblock.h());
|
||||
World world = isourceblock.k();
|
||||
double d0 = isourceblock.getX() + (double) ((float) enumfacing.c() * 1.125F);
|
||||
double d1 = isourceblock.getY() + (double) ((float) enumfacing.d() * 1.125F);
|
||||
@ -23,10 +23,10 @@ final class DispenseBehaviorMinecart extends DispenseBehaviorItem {
|
||||
int l = world.getTypeId(i, j, k);
|
||||
double d3;
|
||||
|
||||
if (BlockMinecartTrackAbstract.d_(l)) {
|
||||
if (BlockMinecartTrackAbstract.e_(l)) {
|
||||
d3 = 0.0D;
|
||||
} else {
|
||||
if (l != 0 || !BlockMinecartTrackAbstract.d_(world.getTypeId(i, j - 1, k))) {
|
||||
if (l != 0 || !BlockMinecartTrackAbstract.e_(world.getTypeId(i, j - 1, k))) {
|
||||
return this.b.a(isourceblock, itemstack);
|
||||
}
|
||||
|
||||
@ -63,6 +63,10 @@ final class DispenseBehaviorMinecart extends DispenseBehaviorItem {
|
||||
EntityMinecartAbstract entityminecartabstract = EntityMinecartAbstract.a(world, event.getVelocity().getX(), event.getVelocity().getY(), event.getVelocity().getZ(), ((ItemMinecart) itemstack1.getItem()).a);
|
||||
// CraftBukkit end
|
||||
|
||||
if (itemstack.hasName()) {
|
||||
entityminecartabstract.a(itemstack.getName());
|
||||
}
|
||||
|
||||
world.addEntity(entityminecartabstract);
|
||||
// itemstack.a(1); // CraftBukkit - handled during event processing
|
||||
return itemstack;
|
||||
|
@ -10,7 +10,7 @@ final class DispenseBehaviorMonsterEgg extends DispenseBehaviorItem {
|
||||
DispenseBehaviorMonsterEgg() {}
|
||||
|
||||
public ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) {
|
||||
EnumFacing enumfacing = BlockDispenser.j_(isourceblock.h());
|
||||
EnumFacing enumfacing = BlockDispenser.l_(isourceblock.h());
|
||||
double d0 = isourceblock.getX() + (double) enumfacing.c();
|
||||
double d1 = (double) ((float) isourceblock.getBlockY() + 0.2F);
|
||||
double d2 = isourceblock.getZ() + (double) enumfacing.e();
|
||||
@ -47,7 +47,7 @@ final class DispenseBehaviorMonsterEgg extends DispenseBehaviorItem {
|
||||
Entity entity = ItemMonsterEgg.a(isourceblock.k(), itemstack.getData(), event.getVelocity().getX(), event.getVelocity().getY(), event.getVelocity().getZ());
|
||||
|
||||
if (entity instanceof EntityLiving && itemstack.hasName()) {
|
||||
((EntityLiving) entity).setCustomName(itemstack.getName());
|
||||
((EntityInsentient) entity).setCustomName(itemstack.getName());
|
||||
}
|
||||
|
||||
// itemstack.a(1); // Handled during event processing
|
||||
|
@ -12,7 +12,7 @@ public abstract class DispenseBehaviorProjectile extends DispenseBehaviorItem {
|
||||
public ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) {
|
||||
World world = isourceblock.k();
|
||||
IPosition iposition = BlockDispenser.a(isourceblock);
|
||||
EnumFacing enumfacing = BlockDispenser.j_(isourceblock.h());
|
||||
EnumFacing enumfacing = BlockDispenser.l_(isourceblock.h());
|
||||
IProjectile iprojectile = this.a(world, iposition);
|
||||
|
||||
// CraftBukkit start
|
||||
|
@ -10,7 +10,7 @@ final class DispenseBehaviorTNT extends DispenseBehaviorItem {
|
||||
DispenseBehaviorTNT() {}
|
||||
|
||||
protected ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) {
|
||||
EnumFacing enumfacing = BlockDispenser.j_(isourceblock.h());
|
||||
EnumFacing enumfacing = BlockDispenser.l_(isourceblock.h());
|
||||
World world = isourceblock.k();
|
||||
int i = isourceblock.getBlockX() + enumfacing.c();
|
||||
int j = isourceblock.getBlockY() + enumfacing.d();
|
||||
|
@ -71,8 +71,8 @@ public abstract class Enchantment {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int a(int i, EntityLiving entityliving) {
|
||||
return 0;
|
||||
public float a(int i, EntityLiving entityliving) {
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
public boolean a(Enchantment enchantment) {
|
||||
@ -106,7 +106,6 @@ public abstract class Enchantment {
|
||||
for (int j = 0; j < i; ++j) {
|
||||
Enchantment enchantment = aenchantment[j];
|
||||
|
||||
|
||||
if (enchantment != null) {
|
||||
arraylist.add(enchantment);
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ public abstract class Entity {
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
private static int entityCount = 0;
|
||||
private static int entityCount;
|
||||
public int id;
|
||||
public double l;
|
||||
public boolean m;
|
||||
@ -108,42 +108,20 @@ public abstract class Entity {
|
||||
private boolean invulnerable;
|
||||
public UUID uniqueID; // CraftBukkit - private -> public
|
||||
public EnumEntitySize at;
|
||||
public boolean valid = false; // CraftBukkit
|
||||
public boolean valid; // CraftBukkit
|
||||
|
||||
public Entity(World world) {
|
||||
this.id = entityCount++;
|
||||
this.l = 1.0D;
|
||||
this.m = false;
|
||||
this.boundingBox = AxisAlignedBB.a(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
|
||||
this.onGround = false;
|
||||
this.I = false;
|
||||
this.velocityChanged = false;
|
||||
this.L = true;
|
||||
this.dead = false;
|
||||
this.height = 0.0F;
|
||||
this.width = 0.6F;
|
||||
this.length = 1.8F;
|
||||
this.Q = 0.0F;
|
||||
this.R = 0.0F;
|
||||
this.S = 0.0F;
|
||||
this.fallDistance = 0.0F;
|
||||
this.c = 1;
|
||||
this.X = 0.0F;
|
||||
this.Y = 0.0F;
|
||||
this.Z = false;
|
||||
this.aa = 0.0F;
|
||||
this.random = new Random();
|
||||
this.ticksLived = 0;
|
||||
this.maxFireTicks = 1;
|
||||
this.fireTicks = 0;
|
||||
this.inWater = false;
|
||||
this.noDamageTicks = 0;
|
||||
this.justCreated = true;
|
||||
this.fireProof = false;
|
||||
this.datawatcher = new DataWatcher();
|
||||
this.ai = false;
|
||||
this.as = 0;
|
||||
this.invulnerable = false;
|
||||
this.uniqueID = UUID.randomUUID();
|
||||
this.at = EnumEntitySize.SIZE_2;
|
||||
this.world = world;
|
||||
@ -279,7 +257,7 @@ public abstract class Entity {
|
||||
b0 = -1;
|
||||
}
|
||||
|
||||
this.c(b0);
|
||||
this.b(b0);
|
||||
}
|
||||
|
||||
this.ap = false;
|
||||
@ -324,7 +302,7 @@ public abstract class Entity {
|
||||
}
|
||||
} else {
|
||||
if (this.fireTicks % 20 == 0) {
|
||||
this.damageEntity(DamageSource.BURN, 1);
|
||||
this.damageEntity(DamageSource.BURN, 1.0F);
|
||||
}
|
||||
|
||||
--this.fireTicks;
|
||||
@ -342,7 +320,6 @@ public abstract class Entity {
|
||||
|
||||
if (!this.world.isStatic) {
|
||||
this.a(0, this.fireTicks > 0);
|
||||
this.a(2, this.vehicle != null);
|
||||
}
|
||||
|
||||
this.justCreated = false;
|
||||
@ -363,12 +340,12 @@ public abstract class Entity {
|
||||
org.bukkit.block.Block damager = null; // ((WorldServer) this.l).getWorld().getBlockAt(i, j, k);
|
||||
org.bukkit.entity.Entity damagee = this.getBukkitEntity();
|
||||
|
||||
EntityDamageByBlockEvent event = new EntityDamageByBlockEvent(damager, damagee, EntityDamageEvent.DamageCause.LAVA, 4);
|
||||
EntityDamageByBlockEvent event = new EntityDamageByBlockEvent(damager, damagee, EntityDamageEvent.DamageCause.LAVA, 4D);
|
||||
server.getPluginManager().callEvent(event);
|
||||
|
||||
if (!event.isCancelled()) {
|
||||
damagee.setLastDamageCause(event);
|
||||
this.damageEntity(DamageSource.LAVA, event.getDamage());
|
||||
this.damageEntity(DamageSource.LAVA, (float) event.getDamage());
|
||||
}
|
||||
|
||||
if (this.fireTicks <= 0) {
|
||||
@ -549,7 +526,7 @@ public abstract class Entity {
|
||||
d2 = d8;
|
||||
AxisAlignedBB axisalignedbb1 = this.boundingBox.clone();
|
||||
|
||||
this.boundingBox.c(axisalignedbb);
|
||||
this.boundingBox.d(axisalignedbb);
|
||||
list = this.world.getCubes(this, this.boundingBox.a(d6, d1, d8));
|
||||
|
||||
for (k = 0; k < list.size(); ++k) {
|
||||
@ -603,7 +580,7 @@ public abstract class Entity {
|
||||
d0 = d10;
|
||||
d1 = d11;
|
||||
d2 = d12;
|
||||
this.boundingBox.c(axisalignedbb1);
|
||||
this.boundingBox.d(axisalignedbb1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -653,7 +630,7 @@ public abstract class Entity {
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
if (this.f_() && !flag && this.vehicle == null) {
|
||||
if (this.e_() && !flag && this.vehicle == null) {
|
||||
int l = MathHelper.floor(this.locX);
|
||||
|
||||
k = MathHelper.floor(this.locY - 0.20000000298023224D - (double) this.height);
|
||||
@ -691,7 +668,16 @@ public abstract class Entity {
|
||||
}
|
||||
}
|
||||
|
||||
this.C();
|
||||
try {
|
||||
this.C();
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.a(throwable, "Checking entity tile collision");
|
||||
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being checked for collision");
|
||||
|
||||
this.a(crashreportsystemdetails);
|
||||
throw new ReportedException(crashreport);
|
||||
}
|
||||
|
||||
boolean flag2 = this.F();
|
||||
|
||||
if (this.world.e(this.boundingBox.shrink(0.001D, 0.001D, 0.001D))) {
|
||||
@ -739,7 +725,15 @@ public abstract class Entity {
|
||||
int j2 = this.world.getTypeId(k1, l1, i2);
|
||||
|
||||
if (j2 > 0) {
|
||||
Block.byId[j2].a(this.world, k1, l1, i2, this);
|
||||
try {
|
||||
Block.byId[j2].a(this.world, k1, l1, i2, this);
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.a(throwable, "Colliding entity with tile");
|
||||
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Tile being collided with");
|
||||
|
||||
CrashReportSystemDetails.a(crashreportsystemdetails, k1, l1, i2, j2, this.world.getData(k1, l1, i2));
|
||||
throw new ReportedException(crashreport);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -762,14 +756,14 @@ public abstract class Entity {
|
||||
this.world.makeSound(this, s, f, f1);
|
||||
}
|
||||
|
||||
protected boolean f_() {
|
||||
protected boolean e_() {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void a(double d0, boolean flag) {
|
||||
if (flag) {
|
||||
if (this.fallDistance > 0.0F) {
|
||||
this.a(this.fallDistance);
|
||||
this.b(this.fallDistance);
|
||||
this.fallDistance = 0.0F;
|
||||
}
|
||||
} else if (d0 < 0.0D) {
|
||||
@ -781,9 +775,9 @@ public abstract class Entity {
|
||||
return null;
|
||||
}
|
||||
|
||||
protected void burn(int i) {
|
||||
protected void burn(float i) { // CraftBukkit - int -> float
|
||||
if (!this.fireProof) {
|
||||
this.damageEntity(DamageSource.FIRE, i);
|
||||
this.damageEntity(DamageSource.FIRE, (float) i);
|
||||
}
|
||||
}
|
||||
|
||||
@ -791,9 +785,9 @@ public abstract class Entity {
|
||||
return this.fireProof;
|
||||
}
|
||||
|
||||
protected void a(float f) {
|
||||
protected void b(float f) {
|
||||
if (this.passenger != null) {
|
||||
this.passenger.a(f);
|
||||
this.passenger.b(f);
|
||||
}
|
||||
}
|
||||
|
||||
@ -889,7 +883,7 @@ public abstract class Entity {
|
||||
}
|
||||
}
|
||||
|
||||
public float c(float f) {
|
||||
public float d(float f) {
|
||||
int i = MathHelper.floor(this.locX);
|
||||
int j = MathHelper.floor(this.locZ);
|
||||
|
||||
@ -1018,7 +1012,7 @@ public abstract class Entity {
|
||||
this.velocityChanged = true;
|
||||
}
|
||||
|
||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||
public boolean damageEntity(DamageSource damagesource, float f) {
|
||||
if (this.isInvulnerable()) {
|
||||
return false;
|
||||
} else {
|
||||
@ -1035,10 +1029,10 @@ public abstract class Entity {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void c(Entity entity, int i) {}
|
||||
public void b(Entity entity, int i) {}
|
||||
|
||||
public boolean c(NBTTagCompound nbttagcompound) {
|
||||
String s = this.P();
|
||||
String s = this.O();
|
||||
|
||||
if (!this.dead && s != null) {
|
||||
nbttagcompound.setString("id", s);
|
||||
@ -1050,7 +1044,7 @@ public abstract class Entity {
|
||||
}
|
||||
|
||||
public boolean d(NBTTagCompound nbttagcompound) {
|
||||
String s = this.P();
|
||||
String s = this.O();
|
||||
|
||||
if (!this.dead && s != null && this.passenger == null) {
|
||||
nbttagcompound.setString("id", s);
|
||||
@ -1162,7 +1156,8 @@ public abstract class Entity {
|
||||
|
||||
// Reset the persistence for tamed animals
|
||||
if (entity instanceof EntityTameableAnimal && !isLevelAtLeast(nbttagcompound, 2) && !nbttagcompound.getBoolean("PersistenceRequired")) {
|
||||
entity.persistent = !entity.isTypeNotPersistent();
|
||||
EntityInsentient entityinsentient = (EntityInsentient) entity;
|
||||
entityinsentient.persistent = !entityinsentient.isTypeNotPersistent();
|
||||
}
|
||||
}
|
||||
// CraftBukkit end
|
||||
@ -1215,7 +1210,7 @@ public abstract class Entity {
|
||||
}
|
||||
}
|
||||
|
||||
protected final String P() {
|
||||
protected final String O() {
|
||||
return EntityTypes.b(this);
|
||||
}
|
||||
|
||||
@ -1223,6 +1218,8 @@ public abstract class Entity {
|
||||
|
||||
protected abstract void b(NBTTagCompound nbttagcompound);
|
||||
|
||||
public void P() {}
|
||||
|
||||
protected NBTTagList a(double... adouble) {
|
||||
NBTTagList nbttaglist = new NBTTagList();
|
||||
double[] adouble1 = adouble;
|
||||
@ -1260,11 +1257,15 @@ public abstract class Entity {
|
||||
}
|
||||
|
||||
public EntityItem a(ItemStack itemstack, float f) {
|
||||
EntityItem entityitem = new EntityItem(this.world, this.locX, this.locY + (double) f, this.locZ, itemstack);
|
||||
if (itemstack.count == 0) {
|
||||
return null;
|
||||
} else {
|
||||
EntityItem entityitem = new EntityItem(this.world, this.locX, this.locY + (double) f, this.locZ, itemstack);
|
||||
|
||||
entityitem.pickupDelay = 10;
|
||||
this.world.addEntity(entityitem);
|
||||
return entityitem;
|
||||
entityitem.pickupDelay = 10;
|
||||
this.world.addEntity(entityitem);
|
||||
return entityitem;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isAlive() {
|
||||
@ -1288,7 +1289,7 @@ public abstract class Entity {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean a_(EntityHuman entityhuman) {
|
||||
public boolean c(EntityHuman entityhuman) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1354,12 +1355,6 @@ public abstract class Entity {
|
||||
|
||||
public void U() {
|
||||
if (this.passenger != null) {
|
||||
if (!(this.passenger instanceof EntityHuman) || !((EntityHuman) this.passenger).cg()) {
|
||||
this.passenger.U = this.U;
|
||||
this.passenger.V = this.V + this.W() + this.passenger.V();
|
||||
this.passenger.W = this.W;
|
||||
}
|
||||
|
||||
this.passenger.setPosition(this.locX, this.locY + this.W() + this.passenger.V(), this.locZ);
|
||||
}
|
||||
}
|
||||
@ -1430,43 +1425,6 @@ public abstract class Entity {
|
||||
}
|
||||
}
|
||||
|
||||
public void h(Entity entity) {
|
||||
double d0 = this.locX;
|
||||
double d1 = this.locY;
|
||||
double d2 = this.locZ;
|
||||
|
||||
if (entity != null) {
|
||||
d0 = entity.locX;
|
||||
d1 = entity.boundingBox.b + (double) entity.length;
|
||||
d2 = entity.locZ;
|
||||
}
|
||||
|
||||
for (double d3 = -1.5D; d3 < 2.0D; ++d3) {
|
||||
for (double d4 = -1.5D; d4 < 2.0D; ++d4) {
|
||||
if (d3 != 0.0D || d4 != 0.0D) {
|
||||
int i = (int) (this.locX + d3);
|
||||
int j = (int) (this.locZ + d4);
|
||||
AxisAlignedBB axisalignedbb = this.boundingBox.c(d3, 1.0D, d4);
|
||||
|
||||
if (this.world.a(axisalignedbb).isEmpty()) {
|
||||
if (this.world.w(i, (int) this.locY, j)) {
|
||||
this.setPositionRotation(this.locX + d3, this.locY + 1.0D, this.locZ + d4, this.yaw, this.pitch);
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.world.w(i, (int) this.locY - 1, j) || this.world.getMaterial(i, (int) this.locY - 1, j) == Material.WATER) {
|
||||
d0 = this.locX + d3;
|
||||
d1 = this.locY + 1.0D;
|
||||
d2 = this.locZ + d4;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.setPositionRotation(d0, d1, d2, this.yaw, this.pitch);
|
||||
}
|
||||
|
||||
public float X() {
|
||||
return 0.1F;
|
||||
}
|
||||
@ -1501,11 +1459,11 @@ public abstract class Entity {
|
||||
public void setEquipment(int i, ItemStack itemstack) {}
|
||||
|
||||
public boolean isBurning() {
|
||||
return this.fireTicks > 0 || this.f(0);
|
||||
return !this.fireProof && (this.fireTicks > 0 || this.f(0));
|
||||
}
|
||||
|
||||
public boolean af() {
|
||||
return this.vehicle != null || this.f(2);
|
||||
public boolean ae() {
|
||||
return this.vehicle != null;
|
||||
}
|
||||
|
||||
public boolean isSneaking() {
|
||||
@ -1573,12 +1531,12 @@ public abstract class Entity {
|
||||
}
|
||||
}
|
||||
|
||||
EntityDamageEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDamageEvent(entitylightning, this, EntityDamageEvent.DamageCause.LIGHTNING, 5);
|
||||
EntityDamageEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDamageEvent(entitylightning, this, EntityDamageEvent.DamageCause.LIGHTNING, 5D);
|
||||
if (event.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.burn(event.getDamage());
|
||||
this.burn((float) event.getDamage());
|
||||
// CraftBukkit end
|
||||
|
||||
++this.fireTicks;
|
||||
@ -1671,7 +1629,7 @@ public abstract class Entity {
|
||||
}
|
||||
}
|
||||
|
||||
public void al() {
|
||||
public void ak() {
|
||||
this.K = true;
|
||||
this.fallDistance = 0.0F;
|
||||
}
|
||||
@ -1686,11 +1644,11 @@ public abstract class Entity {
|
||||
return LocaleI18n.get("entity." + s + ".name");
|
||||
}
|
||||
|
||||
public Entity[] an() {
|
||||
public Entity[] am() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean i(Entity entity) {
|
||||
public boolean h(Entity entity) {
|
||||
return this == entity;
|
||||
}
|
||||
|
||||
@ -1698,11 +1656,11 @@ public abstract class Entity {
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
public boolean ap() {
|
||||
public boolean ao() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean j(Entity entity) {
|
||||
public boolean i(Entity entity) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1714,7 +1672,7 @@ public abstract class Entity {
|
||||
return this.invulnerable;
|
||||
}
|
||||
|
||||
public void k(Entity entity) {
|
||||
public void j(Entity entity) {
|
||||
this.setPositionRotation(entity.locX, entity.locY, entity.locZ, entity.yaw, entity.pitch);
|
||||
}
|
||||
|
||||
@ -1727,7 +1685,7 @@ public abstract class Entity {
|
||||
this.as = entity.as;
|
||||
}
|
||||
|
||||
public void c(int i) {
|
||||
public void b(int i) {
|
||||
if (!this.world.isStatic && !this.dead) {
|
||||
this.world.methodProfiler.a("changeDimension");
|
||||
MinecraftServer minecraftserver = MinecraftServer.getServer();
|
||||
@ -1767,6 +1725,13 @@ public abstract class Entity {
|
||||
// CraftBukkit end
|
||||
|
||||
this.dimension = i;
|
||||
/* CraftBukkit start - TODO: Check if we need this
|
||||
if (j == 1 && i == 1) {
|
||||
worldserver1 = minecraftserver.getWorldServer(0);
|
||||
this.dimension = 0;
|
||||
}
|
||||
// CraftBukkit end */
|
||||
|
||||
this.world.kill(this);
|
||||
this.dead = false;
|
||||
this.world.methodProfiler.a("reposition");
|
||||
@ -1782,6 +1747,14 @@ public abstract class Entity {
|
||||
|
||||
if (entity != null) {
|
||||
entity.a(this, true);
|
||||
/* CraftBukkit start - We need to do this...
|
||||
if (j == 1 && i == 1) {
|
||||
ChunkCoordinates chunkcoordinates = worldserver1.getSpawn();
|
||||
|
||||
chunkcoordinates.y = this.world.i(chunkcoordinates.x, chunkcoordinates.z);
|
||||
entity.setPositionRotation((double) chunkcoordinates.x, (double) chunkcoordinates.y, (double) chunkcoordinates.z, entity.yaw, entity.pitch);
|
||||
}
|
||||
// CraftBukkit end */
|
||||
worldserver1.addEntity(entity);
|
||||
// CraftBukkit start - Forward the CraftEntity to the new entity
|
||||
this.getBukkitEntity().setHandle(entity);
|
||||
@ -1805,15 +1778,15 @@ public abstract class Entity {
|
||||
return true;
|
||||
}
|
||||
|
||||
public int ar() {
|
||||
public int aq() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
public int as() {
|
||||
public int ar() {
|
||||
return this.as;
|
||||
}
|
||||
|
||||
public boolean at() {
|
||||
public boolean as() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1826,7 +1799,11 @@ public abstract class Entity {
|
||||
crashreportsystemdetails.a("Entity\'s Momentum", String.format("%.2f, %.2f, %.2f", new Object[] { Double.valueOf(this.motX), Double.valueOf(this.motY), Double.valueOf(this.motZ)}));
|
||||
}
|
||||
|
||||
public boolean aw() {
|
||||
public UUID getUniqueID() {
|
||||
return this.uniqueID;
|
||||
}
|
||||
|
||||
public boolean av() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -2,8 +2,8 @@ package net.minecraft.server;
|
||||
|
||||
public abstract class EntityAgeable extends EntityCreature {
|
||||
|
||||
private float d = -1.0F;
|
||||
private float e;
|
||||
private float bp = -1.0F;
|
||||
private float bq;
|
||||
public boolean ageLocked = false; // CraftBukkit
|
||||
|
||||
public EntityAgeable(World world) {
|
||||
@ -12,34 +12,38 @@ public abstract class EntityAgeable extends EntityCreature {
|
||||
|
||||
public abstract EntityAgeable createChild(EntityAgeable entityageable);
|
||||
|
||||
public boolean a_(EntityHuman entityhuman) {
|
||||
public boolean a(EntityHuman entityhuman) {
|
||||
ItemStack itemstack = entityhuman.inventory.getItemInHand();
|
||||
|
||||
if (itemstack != null && itemstack.id == Item.MONSTER_EGG.id && !this.world.isStatic) {
|
||||
Class oclass = EntityTypes.a(itemstack.getData());
|
||||
if (itemstack != null && itemstack.id == Item.MONSTER_EGG.id) {
|
||||
if (!this.world.isStatic) {
|
||||
Class oclass = EntityTypes.a(itemstack.getData());
|
||||
|
||||
if (oclass != null && oclass.isAssignableFrom(this.getClass())) {
|
||||
EntityAgeable entityageable = this.createChild(this);
|
||||
if (oclass != null && oclass.isAssignableFrom(this.getClass())) {
|
||||
EntityAgeable entityageable = this.createChild(this);
|
||||
|
||||
if (entityageable != null) {
|
||||
entityageable.setAge(-24000);
|
||||
entityageable.setPositionRotation(this.locX, this.locY, this.locZ, 0.0F, 0.0F);
|
||||
this.world.addEntity(entityageable, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER_EGG); // CraftBukkit
|
||||
if (itemstack.hasName()) {
|
||||
entityageable.setCustomName(itemstack.getName());
|
||||
}
|
||||
if (entityageable != null) {
|
||||
entityageable.setAge(-24000);
|
||||
entityageable.setPositionRotation(this.locX, this.locY, this.locZ, 0.0F, 0.0F);
|
||||
this.world.addEntity(entityageable, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER_EGG); // CraftBukkit
|
||||
if (itemstack.hasName()) {
|
||||
entityageable.setCustomName(itemstack.getName());
|
||||
}
|
||||
|
||||
if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
--itemstack.count;
|
||||
if (itemstack.count == 0) { // CraftBukkit - allow less than 0 stacks as "infinite"
|
||||
entityhuman.inventory.setItem(entityhuman.inventory.itemInHandIndex, (ItemStack) null);
|
||||
if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
--itemstack.count;
|
||||
if (itemstack.count == 0) { // CraftBukkit - allow less than 0 stacks as "infinite"
|
||||
entityhuman.inventory.setItem(entityhuman.inventory.itemInHandIndex, (ItemStack) null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return super.a_(entityhuman);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
protected void a() {
|
||||
@ -51,6 +55,17 @@ public abstract class EntityAgeable extends EntityCreature {
|
||||
return this.datawatcher.getInt(12);
|
||||
}
|
||||
|
||||
public void a(int i) {
|
||||
int j = this.getAge();
|
||||
|
||||
j += i * 20;
|
||||
if (j > 0) {
|
||||
j = 0;
|
||||
}
|
||||
|
||||
this.setAge(j);
|
||||
}
|
||||
|
||||
public void setAge(int i) {
|
||||
this.datawatcher.watch(12, Integer.valueOf(i));
|
||||
this.a(this.isBaby());
|
||||
@ -90,20 +105,20 @@ public abstract class EntityAgeable extends EntityCreature {
|
||||
}
|
||||
|
||||
public void a(boolean flag) {
|
||||
this.j(flag ? 0.5F : 1.0F);
|
||||
this.a(flag ? 0.5F : 1.0F);
|
||||
}
|
||||
|
||||
protected final void a(float f, float f1) {
|
||||
boolean flag = this.d > 0.0F;
|
||||
boolean flag = this.bp > 0.0F;
|
||||
|
||||
this.d = f;
|
||||
this.e = f1;
|
||||
this.bp = f;
|
||||
this.bq = f1;
|
||||
if (!flag) {
|
||||
this.j(1.0F);
|
||||
this.a(1.0F);
|
||||
}
|
||||
}
|
||||
|
||||
private void j(float f) {
|
||||
super.a(this.d * f, this.e * f);
|
||||
protected final void a(float f) {
|
||||
super.a(this.bp * f, this.bq * f);
|
||||
}
|
||||
}
|
||||
|
@ -12,14 +12,14 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
private int d = -1;
|
||||
private int e = -1;
|
||||
private int f = -1;
|
||||
private int g = 0;
|
||||
private int h = 0;
|
||||
private boolean inGround = false;
|
||||
public int fromPlayer = 0;
|
||||
public int shake = 0;
|
||||
private int g;
|
||||
private int h;
|
||||
private boolean inGround;
|
||||
public int fromPlayer;
|
||||
public int shake;
|
||||
public Entity shooter;
|
||||
private int j;
|
||||
private int au = 0;
|
||||
private int au;
|
||||
private double damage = 2.0D;
|
||||
private int aw;
|
||||
|
||||
@ -237,12 +237,12 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
// if (movingobjectposition.entity.damageEntity(damagesource, i1)) { // CraftBukkit - moved up
|
||||
// if (movingobjectposition.entity.damageEntity(damagesource, (float) i1)) { // CraftBukkit - moved up
|
||||
if (movingobjectposition.entity instanceof EntityLiving) {
|
||||
EntityLiving entityliving = (EntityLiving) movingobjectposition.entity;
|
||||
|
||||
if (!this.world.isStatic) {
|
||||
entityliving.r(entityliving.bM() + 1);
|
||||
entityliving.m(entityliving.aQ() + 1);
|
||||
}
|
||||
|
||||
if (this.aw > 0) {
|
||||
@ -386,7 +386,7 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
EntityItem item = new EntityItem(this.world, this.locX, this.locY, this.locZ, itemstack);
|
||||
|
||||
PlayerPickupItemEvent event = new PlayerPickupItemEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), new org.bukkit.craftbukkit.entity.CraftItem(this.world.getServer(), this, item), 0);
|
||||
event.setCancelled(!entityhuman.canPickUpLoot);
|
||||
// event.setCancelled(!entityhuman.canPickUpLoot); TODO
|
||||
this.world.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
if (event.isCancelled()) {
|
||||
@ -409,7 +409,7 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean f_() {
|
||||
protected boolean e_() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -425,7 +425,7 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
this.aw = i;
|
||||
}
|
||||
|
||||
public boolean ap() {
|
||||
public boolean ao() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -2,19 +2,19 @@ package net.minecraft.server;
|
||||
|
||||
public class EntityBlaze extends EntityMonster {
|
||||
|
||||
private float d = 0.5F;
|
||||
private int e;
|
||||
private int f;
|
||||
private float bp = 0.5F;
|
||||
private int bq;
|
||||
private int br;
|
||||
|
||||
public EntityBlaze(World world) {
|
||||
super(world);
|
||||
this.texture = "/mob/fire.png";
|
||||
this.fireProof = true;
|
||||
this.be = 10;
|
||||
this.b = 10;
|
||||
}
|
||||
|
||||
public int getMaxHealth() {
|
||||
return 20;
|
||||
protected void ax() {
|
||||
super.ax();
|
||||
this.a(GenericAttributes.e).a(6.0D);
|
||||
}
|
||||
|
||||
protected void a() {
|
||||
@ -22,35 +22,35 @@ public class EntityBlaze extends EntityMonster {
|
||||
this.datawatcher.a(16, new Byte((byte) 0));
|
||||
}
|
||||
|
||||
protected String bb() {
|
||||
protected String r() {
|
||||
return "mob.blaze.breathe";
|
||||
}
|
||||
|
||||
protected String bc() {
|
||||
protected String aK() {
|
||||
return "mob.blaze.hit";
|
||||
}
|
||||
|
||||
protected String bd() {
|
||||
protected String aL() {
|
||||
return "mob.blaze.death";
|
||||
}
|
||||
|
||||
public float c(float f) {
|
||||
public float d(float f) {
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
public void c() {
|
||||
if (!this.world.isStatic) {
|
||||
if (this.F()) {
|
||||
this.damageEntity(DamageSource.DROWN, 1);
|
||||
this.damageEntity(DamageSource.DROWN, 1.0F);
|
||||
}
|
||||
|
||||
--this.e;
|
||||
if (this.e <= 0) {
|
||||
this.e = 100;
|
||||
this.d = 0.5F + (float) this.random.nextGaussian() * 3.0F;
|
||||
--this.bq;
|
||||
if (this.bq <= 0) {
|
||||
this.bq = 100;
|
||||
this.bp = 0.5F + (float) this.random.nextGaussian() * 3.0F;
|
||||
}
|
||||
|
||||
if (this.l() != null && this.l().locY + (double) this.l().getHeadHeight() > this.locY + (double) this.getHeadHeight() + (double) this.d) {
|
||||
if (this.bJ() != null && this.bJ().locY + (double) this.bJ().getHeadHeight() > this.locY + (double) this.getHeadHeight() + (double) this.bp) {
|
||||
this.motY += (0.30000001192092896D - this.motY) * 0.30000001192092896D;
|
||||
}
|
||||
}
|
||||
@ -80,19 +80,19 @@ public class EntityBlaze extends EntityMonster {
|
||||
double d2 = entity.locZ - this.locZ;
|
||||
|
||||
if (this.attackTicks == 0) {
|
||||
++this.f;
|
||||
if (this.f == 1) {
|
||||
++this.br;
|
||||
if (this.br == 1) {
|
||||
this.attackTicks = 60;
|
||||
this.a(true);
|
||||
} else if (this.f <= 4) {
|
||||
} else if (this.br <= 4) {
|
||||
this.attackTicks = 6;
|
||||
} else {
|
||||
this.attackTicks = 100;
|
||||
this.f = 0;
|
||||
this.br = 0;
|
||||
this.a(false);
|
||||
}
|
||||
|
||||
if (this.f > 1) {
|
||||
if (this.br > 1) {
|
||||
float f1 = MathHelper.c(f) * 0.5F;
|
||||
|
||||
this.world.a((EntityHuman) null, 1009, (int) this.locX, (int) this.locY, (int) this.locZ, 0);
|
||||
@ -107,18 +107,18 @@ public class EntityBlaze extends EntityMonster {
|
||||
}
|
||||
|
||||
this.yaw = (float) (Math.atan2(d2, d0) * 180.0D / 3.1415927410125732D) - 90.0F;
|
||||
this.b = true;
|
||||
this.bn = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected void a(float f) {}
|
||||
protected void b(float f) {}
|
||||
|
||||
protected int getLootId() {
|
||||
return Item.BLAZE_ROD.id;
|
||||
}
|
||||
|
||||
public boolean isBurning() {
|
||||
return this.m();
|
||||
return this.bP();
|
||||
}
|
||||
|
||||
protected void dropDeathLoot(boolean flag, int i) {
|
||||
@ -136,7 +136,7 @@ public class EntityBlaze extends EntityMonster {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean m() {
|
||||
public boolean bP() {
|
||||
return (this.datawatcher.getByte(16) & 1) != 0;
|
||||
}
|
||||
|
||||
@ -155,8 +155,4 @@ public class EntityBlaze extends EntityMonster {
|
||||
protected boolean i_() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public int c(Entity entity) {
|
||||
return 6;
|
||||
}
|
||||
}
|
||||
|
@ -53,14 +53,14 @@ public class EntityBoat extends Entity {
|
||||
this.height = this.length / 2.0F;
|
||||
}
|
||||
|
||||
protected boolean f_() {
|
||||
protected boolean e_() {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void a() {
|
||||
this.datawatcher.a(17, new Integer(0));
|
||||
this.datawatcher.a(18, new Integer(1));
|
||||
this.datawatcher.a(19, new Integer(0));
|
||||
this.datawatcher.a(19, new Float(0.0F));
|
||||
}
|
||||
|
||||
public AxisAlignedBB g(Entity entity) {
|
||||
@ -92,7 +92,7 @@ public class EntityBoat extends Entity {
|
||||
return (double) this.length * 0.0D - 0.30000001192092896D;
|
||||
}
|
||||
|
||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||
public boolean damageEntity(DamageSource damagesource, float f) {
|
||||
if (this.isInvulnerable()) {
|
||||
return false;
|
||||
} else if (!this.world.isStatic && !this.dead) {
|
||||
@ -100,7 +100,7 @@ public class EntityBoat extends Entity {
|
||||
Vehicle vehicle = (Vehicle) this.getBukkitEntity();
|
||||
org.bukkit.entity.Entity attacker = (damagesource.getEntity() == null) ? null : damagesource.getEntity().getBukkitEntity();
|
||||
|
||||
VehicleDamageEvent event = new VehicleDamageEvent(vehicle, attacker, i);
|
||||
VehicleDamageEvent event = new VehicleDamageEvent(vehicle, attacker, (double) f);
|
||||
this.world.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
if (event.isCancelled()) {
|
||||
@ -109,19 +109,19 @@ public class EntityBoat extends Entity {
|
||||
// i = event.getDamage(); // TODO Why don't we do this?
|
||||
// CraftBukkit end
|
||||
|
||||
this.h(-this.h());
|
||||
this.b(10);
|
||||
this.setDamage(this.getDamage() + i * 10);
|
||||
this.c(-this.h());
|
||||
this.a(10);
|
||||
this.setDamage(this.getDamage() + f * 10.0F);
|
||||
this.J();
|
||||
boolean flag = damagesource.getEntity() instanceof EntityHuman && ((EntityHuman) damagesource.getEntity()).abilities.canInstantlyBuild;
|
||||
|
||||
if (flag || this.getDamage() > 40) {
|
||||
if (flag || this.getDamage() > 40.0F) {
|
||||
// CraftBukkit start
|
||||
VehicleDestroyEvent destroyEvent = new VehicleDestroyEvent(vehicle, attacker);
|
||||
this.world.getServer().getPluginManager().callEvent(destroyEvent);
|
||||
|
||||
if (destroyEvent.isCancelled()) {
|
||||
this.setDamage(40); // Maximize damage so this doesn't get triggered again right away
|
||||
this.setDamage(40F); // Maximize damage so this doesn't get triggered again right away
|
||||
return true;
|
||||
}
|
||||
// CraftBukkit end
|
||||
@ -157,12 +157,12 @@ public class EntityBoat extends Entity {
|
||||
// CraftBukkit end
|
||||
|
||||
super.l_();
|
||||
if (this.g() > 0) {
|
||||
this.b(this.g() - 1);
|
||||
if (this.e() > 0) {
|
||||
this.a(this.e() - 1);
|
||||
}
|
||||
|
||||
if (this.getDamage() > 0) {
|
||||
this.setDamage(this.getDamage() - 1);
|
||||
if (this.getDamage() > 0.0F) {
|
||||
this.setDamage(this.getDamage() - 1.0F);
|
||||
}
|
||||
|
||||
this.lastX = this.locX;
|
||||
@ -248,9 +248,14 @@ public class EntityBoat extends Entity {
|
||||
this.motY += 0.007000000216066837D;
|
||||
}
|
||||
|
||||
if (this.passenger != null) {
|
||||
this.motX += this.passenger.motX * this.b;
|
||||
this.motZ += this.passenger.motZ * this.b;
|
||||
if (this.passenger != null && this.passenger instanceof EntityLiving) {
|
||||
d4 = (double) ((EntityLiving) this.passenger).bf;
|
||||
if (d4 > 0.0D) {
|
||||
d5 = -Math.sin((double) (this.passenger.yaw * 3.1415927F / 180.0F));
|
||||
d10 = Math.cos((double) (this.passenger.yaw * 3.1415927F / 180.0F));
|
||||
this.motX += d5 * this.b * 0.05000000074505806D;
|
||||
this.motZ += d10 * this.b * 0.05000000074505806D;
|
||||
}
|
||||
}
|
||||
// CraftBukkit start - Support unoccupied deceleration
|
||||
else if (unoccupiedDeceleration >= 0) {
|
||||
@ -420,7 +425,7 @@ public class EntityBoat extends Entity {
|
||||
|
||||
protected void a(NBTTagCompound nbttagcompound) {}
|
||||
|
||||
public boolean a_(EntityHuman entityhuman) {
|
||||
public boolean c(EntityHuman entityhuman) {
|
||||
if (this.passenger != null && this.passenger instanceof EntityHuman && this.passenger != entityhuman) {
|
||||
return true;
|
||||
} else {
|
||||
@ -432,23 +437,23 @@ public class EntityBoat extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
public void setDamage(int i) {
|
||||
this.datawatcher.watch(19, Integer.valueOf(i));
|
||||
public void setDamage(float f) {
|
||||
this.datawatcher.watch(19, Float.valueOf(f));
|
||||
}
|
||||
|
||||
public int getDamage() {
|
||||
return this.datawatcher.getInt(19);
|
||||
public float getDamage() {
|
||||
return this.datawatcher.getFloat(19);
|
||||
}
|
||||
|
||||
public void b(int i) {
|
||||
public void a(int i) {
|
||||
this.datawatcher.watch(17, Integer.valueOf(i));
|
||||
}
|
||||
|
||||
public int g() {
|
||||
public int e() {
|
||||
return this.datawatcher.getInt(17);
|
||||
}
|
||||
|
||||
public void h(int i) {
|
||||
public void c(int i) {
|
||||
this.datawatcher.watch(18, Integer.valueOf(i));
|
||||
}
|
||||
|
||||
|
@ -2,80 +2,78 @@ package net.minecraft.server;
|
||||
|
||||
public class EntityChicken extends EntityAnimal {
|
||||
|
||||
public boolean d = false;
|
||||
public float e = 0.0F;
|
||||
public float f = 0.0F;
|
||||
public float g;
|
||||
public float h;
|
||||
public float i = 1.0F;
|
||||
public int j;
|
||||
public float bp;
|
||||
public float bq;
|
||||
public float br;
|
||||
public float bs;
|
||||
public float bt = 1.0F;
|
||||
public int bu;
|
||||
|
||||
public EntityChicken(World world) {
|
||||
super(world);
|
||||
this.texture = "/mob/chicken.png";
|
||||
this.a(0.3F, 0.7F);
|
||||
this.j = this.random.nextInt(6000) + 6000;
|
||||
float f = 0.25F;
|
||||
|
||||
this.bu = this.random.nextInt(6000) + 6000;
|
||||
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.SEEDS.id, false));
|
||||
this.goalSelector.a(4, new PathfinderGoalFollowParent(this, 0.28F));
|
||||
this.goalSelector.a(5, new PathfinderGoalRandomStroll(this, f));
|
||||
this.goalSelector.a(1, new PathfinderGoalPanic(this, 1.4D));
|
||||
this.goalSelector.a(2, new PathfinderGoalBreed(this, 1.0D));
|
||||
this.goalSelector.a(3, new PathfinderGoalTempt(this, 1.0D, Item.SEEDS.id, false));
|
||||
this.goalSelector.a(4, new PathfinderGoalFollowParent(this, 1.1D));
|
||||
this.goalSelector.a(5, new PathfinderGoalRandomStroll(this, 1.0D));
|
||||
this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F));
|
||||
this.goalSelector.a(7, new PathfinderGoalRandomLookaround(this));
|
||||
}
|
||||
|
||||
public boolean bh() {
|
||||
public boolean bb() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public int getMaxHealth() {
|
||||
return 4;
|
||||
protected void ax() {
|
||||
super.ax();
|
||||
this.a(GenericAttributes.a).a(4.0D);
|
||||
this.a(GenericAttributes.d).a(0.25D);
|
||||
}
|
||||
|
||||
public void c() {
|
||||
super.c();
|
||||
this.h = this.e;
|
||||
this.g = this.f;
|
||||
this.f = (float) ((double) this.f + (double) (this.onGround ? -1 : 4) * 0.3D);
|
||||
if (this.f < 0.0F) {
|
||||
this.f = 0.0F;
|
||||
this.bs = this.bp;
|
||||
this.br = this.bq;
|
||||
this.bq = (float) ((double) this.bq + (double) (this.onGround ? -1 : 4) * 0.3D);
|
||||
if (this.bq < 0.0F) {
|
||||
this.bq = 0.0F;
|
||||
}
|
||||
|
||||
if (this.f > 1.0F) {
|
||||
this.f = 1.0F;
|
||||
if (this.bq > 1.0F) {
|
||||
this.bq = 1.0F;
|
||||
}
|
||||
|
||||
if (!this.onGround && this.i < 1.0F) {
|
||||
this.i = 1.0F;
|
||||
if (!this.onGround && this.bt < 1.0F) {
|
||||
this.bt = 1.0F;
|
||||
}
|
||||
|
||||
this.i = (float) ((double) this.i * 0.9D);
|
||||
this.bt = (float) ((double) this.bt * 0.9D);
|
||||
if (!this.onGround && this.motY < 0.0D) {
|
||||
this.motY *= 0.6D;
|
||||
}
|
||||
|
||||
this.e += this.i * 2.0F;
|
||||
if (!this.isBaby() && !this.world.isStatic && --this.j <= 0) {
|
||||
this.bp += this.bt * 2.0F;
|
||||
if (!this.isBaby() && !this.world.isStatic && --this.bu <= 0) {
|
||||
this.makeSound("mob.chicken.plop", 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F);
|
||||
this.b(Item.EGG.id, 1);
|
||||
this.j = this.random.nextInt(6000) + 6000;
|
||||
this.bu = this.random.nextInt(6000) + 6000;
|
||||
}
|
||||
}
|
||||
|
||||
protected void a(float f) {}
|
||||
protected void b(float f) {}
|
||||
|
||||
protected String bb() {
|
||||
protected String r() {
|
||||
return "mob.chicken.say";
|
||||
}
|
||||
|
||||
protected String bc() {
|
||||
protected String aK() {
|
||||
return "mob.chicken.hurt";
|
||||
}
|
||||
|
||||
protected String bd() {
|
||||
protected String aL() {
|
||||
return "mob.chicken.hurt";
|
||||
}
|
||||
|
||||
|
@ -9,36 +9,37 @@ public class EntityCow extends EntityAnimal {
|
||||
|
||||
public EntityCow(World world) {
|
||||
super(world);
|
||||
this.texture = "/mob/cow.png";
|
||||
this.a(0.9F, 1.3F);
|
||||
this.getNavigation().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(1, new PathfinderGoalPanic(this, 2.0D));
|
||||
this.goalSelector.a(2, new PathfinderGoalBreed(this, 1.0D));
|
||||
this.goalSelector.a(3, new PathfinderGoalTempt(this, 1.25D, Item.WHEAT.id, false));
|
||||
this.goalSelector.a(4, new PathfinderGoalFollowParent(this, 1.25D));
|
||||
this.goalSelector.a(5, new PathfinderGoalRandomStroll(this, 1.0D));
|
||||
this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F));
|
||||
this.goalSelector.a(7, new PathfinderGoalRandomLookaround(this));
|
||||
}
|
||||
|
||||
public boolean bh() {
|
||||
public boolean bb() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public int getMaxHealth() {
|
||||
return 10;
|
||||
protected void ax() {
|
||||
super.ax();
|
||||
this.a(GenericAttributes.a).a(10.0D);
|
||||
this.a(GenericAttributes.d).a(0.20000000298023224D);
|
||||
}
|
||||
|
||||
protected String bb() {
|
||||
protected String r() {
|
||||
return "mob.cow.say";
|
||||
}
|
||||
|
||||
protected String bc() {
|
||||
protected String aK() {
|
||||
return "mob.cow.hurt";
|
||||
}
|
||||
|
||||
protected String bd() {
|
||||
protected String aL() {
|
||||
return "mob.cow.hurt";
|
||||
}
|
||||
|
||||
@ -46,7 +47,7 @@ public class EntityCow extends EntityAnimal {
|
||||
this.makeSound("mob.cow.step", 0.15F, 1.0F);
|
||||
}
|
||||
|
||||
protected float ba() {
|
||||
protected float aW() {
|
||||
return 0.4F;
|
||||
}
|
||||
|
||||
@ -75,10 +76,10 @@ public class EntityCow extends EntityAnimal {
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
public boolean a_(EntityHuman entityhuman) {
|
||||
public boolean a(EntityHuman entityhuman) {
|
||||
ItemStack itemstack = entityhuman.inventory.getItemInHand();
|
||||
|
||||
if (itemstack != null && itemstack.id == Item.BUCKET.id) {
|
||||
if (itemstack != null && itemstack.id == Item.BUCKET.id && !entityhuman.abilities.canInstantlyBuild) {
|
||||
// CraftBukkit start - Got milk?
|
||||
org.bukkit.Location loc = this.getBukkitEntity().getLocation();
|
||||
org.bukkit.event.player.PlayerBucketFillEvent event = CraftEventFactory.callPlayerBucketFillEvent(entityhuman, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), -1, itemstack, Item.MILK_BUCKET);
|
||||
@ -96,7 +97,7 @@ public class EntityCow extends EntityAnimal {
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return super.a_(entityhuman);
|
||||
return super.a(entityhuman);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,33 +1,43 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
// CraftBukkit start
|
||||
import org.bukkit.craftbukkit.entity.CraftEntity;
|
||||
import org.bukkit.event.entity.EntityTargetEvent;
|
||||
// CraftBukkit end
|
||||
|
||||
public abstract class EntityCreature extends EntityLiving {
|
||||
public abstract class EntityCreature extends EntityInsentient {
|
||||
|
||||
public static final UUID h = UUID.fromString("E199AD21-BA8A-4C53-8D13-6182D5C69D3A");
|
||||
public static final AttributeModifier i = (new AttributeModifier(h, "Fleeing speed bonus", 2.0D, 2)).a(false);
|
||||
public PathEntity pathEntity; // CraftBukkit - private -> public
|
||||
public Entity target; // CraftBukkit - protected -> public
|
||||
protected boolean b = false;
|
||||
protected int c = 0;
|
||||
protected boolean bn;
|
||||
protected int bo;
|
||||
private ChunkCoordinates bq = new ChunkCoordinates(0, 0, 0);
|
||||
private float br = -1.0F;
|
||||
private PathfinderGoal bs = new PathfinderGoalMoveTowardsRestriction(this, 1.0D);
|
||||
private boolean bt;
|
||||
|
||||
public EntityCreature(World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
protected boolean h() {
|
||||
protected boolean bF() {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void bq() {
|
||||
protected void bh() {
|
||||
this.world.methodProfiler.a("ai");
|
||||
if (this.c > 0) {
|
||||
--this.c;
|
||||
if (this.bo > 0 && --this.bo == 0) {
|
||||
AttributeInstance attributeinstance = this.a(GenericAttributes.d);
|
||||
|
||||
attributeinstance.b(i);
|
||||
}
|
||||
|
||||
this.b = this.h();
|
||||
float f = 16.0F;
|
||||
this.bn = this.bF();
|
||||
float f11 = 16.0F;
|
||||
|
||||
if (this.target == null) {
|
||||
// CraftBukkit start
|
||||
@ -47,12 +57,12 @@ public abstract class EntityCreature extends EntityLiving {
|
||||
// CraftBukkit end
|
||||
|
||||
if (this.target != null) {
|
||||
this.pathEntity = this.world.findPath(this, this.target, f, true, false, false, true);
|
||||
this.pathEntity = this.world.findPath(this, this.target, f11, true, false, false, true);
|
||||
}
|
||||
} else if (this.target.isAlive()) {
|
||||
float f1 = this.target.d((Entity) this);
|
||||
|
||||
if (this.n(this.target)) {
|
||||
if (this.o(this.target)) {
|
||||
this.a(this.target, f1);
|
||||
}
|
||||
} else {
|
||||
@ -71,10 +81,10 @@ public abstract class EntityCreature extends EntityLiving {
|
||||
}
|
||||
|
||||
this.world.methodProfiler.b();
|
||||
if (!this.b && this.target != null && (this.pathEntity == null || this.random.nextInt(20) == 0)) {
|
||||
this.pathEntity = this.world.findPath(this, this.target, f, true, false, false, true);
|
||||
} else if (!this.b && (this.pathEntity == null && this.random.nextInt(180) == 0 || this.random.nextInt(120) == 0 || this.c > 0) && this.bC < 100) {
|
||||
this.i();
|
||||
if (!this.bn && this.target != null && (this.pathEntity == null || this.random.nextInt(20) == 0)) {
|
||||
this.pathEntity = this.world.findPath(this, this.target, f11, true, false, false, true);
|
||||
} else if (!this.bn && (this.pathEntity == null && this.random.nextInt(180) == 0 || this.random.nextInt(120) == 0 || this.bo > 0) && this.aV < 100) {
|
||||
this.bG();
|
||||
}
|
||||
|
||||
int i = MathHelper.floor(this.boundingBox.b + 0.5D);
|
||||
@ -97,7 +107,7 @@ public abstract class EntityCreature extends EntityLiving {
|
||||
}
|
||||
}
|
||||
|
||||
this.bG = false;
|
||||
this.bd = false;
|
||||
if (vec3d != null) {
|
||||
double d1 = vec3d.c - this.locX;
|
||||
double d2 = vec3d.e - this.locZ;
|
||||
@ -106,7 +116,7 @@ public abstract class EntityCreature extends EntityLiving {
|
||||
float f2 = (float) (org.bukkit.craftbukkit.TrigMath.atan2(d2, d1) * 180.0D / 3.1415927410125732D) - 90.0F;
|
||||
float f3 = MathHelper.g(f2 - this.yaw);
|
||||
|
||||
this.bE = this.bI;
|
||||
this.bf = (float) this.a(GenericAttributes.d).e();
|
||||
if (f3 > 30.0F) {
|
||||
f3 = 30.0F;
|
||||
}
|
||||
@ -116,19 +126,19 @@ public abstract class EntityCreature extends EntityLiving {
|
||||
}
|
||||
|
||||
this.yaw += f3;
|
||||
if (this.b && this.target != null) {
|
||||
if (this.bn && this.target != null) {
|
||||
double d4 = this.target.locX - this.locX;
|
||||
double d5 = this.target.locZ - this.locZ;
|
||||
float f4 = this.yaw;
|
||||
|
||||
this.yaw = (float) (Math.atan2(d5, d4) * 180.0D / 3.1415927410125732D) - 90.0F;
|
||||
f3 = (f4 - this.yaw + 90.0F) * 3.1415927F / 180.0F;
|
||||
this.bD = -MathHelper.sin(f3) * this.bE * 1.0F;
|
||||
this.bE = MathHelper.cos(f3) * this.bE * 1.0F;
|
||||
this.be = -MathHelper.sin(f3) * this.bf * 1.0F;
|
||||
this.bf = MathHelper.cos(f3) * this.bf * 1.0F;
|
||||
}
|
||||
|
||||
if (d3 > 0.0D) {
|
||||
this.bG = true;
|
||||
this.bd = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -136,22 +146,22 @@ public abstract class EntityCreature extends EntityLiving {
|
||||
this.a(this.target, 30.0F, 30.0F);
|
||||
}
|
||||
|
||||
if (this.positionChanged && !this.k()) {
|
||||
this.bG = true;
|
||||
if (this.positionChanged && !this.bI()) {
|
||||
this.bd = true;
|
||||
}
|
||||
|
||||
if (this.random.nextFloat() < 0.8F && (flag || flag1)) {
|
||||
this.bG = true;
|
||||
this.bd = true;
|
||||
}
|
||||
|
||||
this.world.methodProfiler.b();
|
||||
} else {
|
||||
super.bq();
|
||||
super.bh();
|
||||
this.pathEntity = null;
|
||||
}
|
||||
}
|
||||
|
||||
protected void i() {
|
||||
protected void bG() {
|
||||
this.world.methodProfiler.a("stroll");
|
||||
boolean flag = false;
|
||||
int i = -1;
|
||||
@ -199,7 +209,7 @@ public abstract class EntityCreature extends EntityLiving {
|
||||
return super.canSpawn() && this.a(i, j, k) >= 0.0F;
|
||||
}
|
||||
|
||||
public boolean k() {
|
||||
public boolean bI() {
|
||||
return this.pathEntity != null;
|
||||
}
|
||||
|
||||
@ -207,7 +217,7 @@ public abstract class EntityCreature extends EntityLiving {
|
||||
this.pathEntity = pathentity;
|
||||
}
|
||||
|
||||
public Entity l() {
|
||||
public Entity bJ() {
|
||||
return this.target;
|
||||
}
|
||||
|
||||
@ -215,13 +225,79 @@ public abstract class EntityCreature extends EntityLiving {
|
||||
this.target = entity;
|
||||
}
|
||||
|
||||
public float bE() {
|
||||
float f = super.bE();
|
||||
public boolean bK() {
|
||||
return this.b(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ));
|
||||
}
|
||||
|
||||
if (this.c > 0 && !this.bh()) {
|
||||
f *= 2.0F;
|
||||
public boolean b(int i, int j, int k) {
|
||||
return this.br == -1.0F ? true : this.bq.e(i, j, k) < this.br * this.br;
|
||||
}
|
||||
|
||||
public void b(int i, int j, int k, int l) {
|
||||
this.bq.b(i, j, k);
|
||||
this.br = (float) l;
|
||||
}
|
||||
|
||||
public ChunkCoordinates bL() {
|
||||
return this.bq;
|
||||
}
|
||||
|
||||
public float bM() {
|
||||
return this.br;
|
||||
}
|
||||
|
||||
public void bN() {
|
||||
this.br = -1.0F;
|
||||
}
|
||||
|
||||
public boolean bO() {
|
||||
return this.br != -1.0F;
|
||||
}
|
||||
|
||||
protected void bB() {
|
||||
super.bB();
|
||||
if (this.bD() && this.bE() != null && this.bE().world == this.world) {
|
||||
Entity entity = this.bE();
|
||||
|
||||
this.b((int) entity.locX, (int) entity.locY, (int) entity.locZ, 5);
|
||||
float f = this.d(entity);
|
||||
|
||||
if (this instanceof EntityTameableAnimal && ((EntityTameableAnimal) this).isSitting()) {
|
||||
if (f > 10.0F) {
|
||||
this.i(true);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.bt) {
|
||||
this.goalSelector.a(2, this.bs);
|
||||
this.getNavigation().a(false);
|
||||
this.bt = true;
|
||||
}
|
||||
|
||||
if (f > 4.0F) {
|
||||
this.getNavigation().a(entity, 1.0D);
|
||||
}
|
||||
|
||||
if (f > 6.0F) {
|
||||
double d0 = (entity.locX - this.locX) / (double) f;
|
||||
double d1 = (entity.locY - this.locY) / (double) f;
|
||||
double d2 = (entity.locZ - this.locZ) / (double) f;
|
||||
|
||||
this.motX += d0 * Math.abs(d0) * 0.4D;
|
||||
this.motY += d1 * Math.abs(d1) * 0.4D;
|
||||
this.motZ += d2 * Math.abs(d2) * 0.4D;
|
||||
}
|
||||
|
||||
if (f > 10.0F) {
|
||||
this.i(true);
|
||||
}
|
||||
} else if (!this.bD() && this.bt) {
|
||||
this.bt = false;
|
||||
this.goalSelector.a(this.bs);
|
||||
this.getNavigation().a(true);
|
||||
this.bN();
|
||||
}
|
||||
|
||||
return f;
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import org.bukkit.event.entity.ExplosionPrimeEvent;
|
||||
|
||||
public class EntityCreeper extends EntityMonster {
|
||||
|
||||
private int d;
|
||||
private int bp;
|
||||
private int fuseTicks;
|
||||
private int maxFuseTicks = 30;
|
||||
private int explosionRadius = 3;
|
||||
@ -15,38 +15,38 @@ public class EntityCreeper extends EntityMonster {
|
||||
|
||||
public EntityCreeper(World world) {
|
||||
super(world);
|
||||
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(3, new PathfinderGoalAvoidPlayer(this, EntityOcelot.class, 6.0F, 1.0D, 1.2D));
|
||||
this.goalSelector.a(4, new PathfinderGoalMeleeAttack(this, 1.0D, false));
|
||||
this.goalSelector.a(5, new PathfinderGoalRandomStroll(this, 0.8D));
|
||||
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, true));
|
||||
this.targetSelector.a(1, new PathfinderGoalNearestAttackableTarget(this, EntityHuman.class, 0, true));
|
||||
this.targetSelector.a(2, new PathfinderGoalHurtByTarget(this, false));
|
||||
}
|
||||
|
||||
public boolean bh() {
|
||||
protected void ax() {
|
||||
super.ax();
|
||||
this.a(GenericAttributes.d).a(0.25D);
|
||||
}
|
||||
|
||||
public boolean bb() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public int ar() {
|
||||
return this.getGoalTarget() == null ? 3 : 3 + (this.health - 1);
|
||||
public int aq() {
|
||||
return this.getGoalTarget() == null ? 3 : 3 + (int) (this.getHealth() - 1.0F);
|
||||
}
|
||||
|
||||
protected void a(float f) {
|
||||
super.a(f);
|
||||
protected void b(float f) {
|
||||
super.b(f);
|
||||
this.fuseTicks = (int) ((float) this.fuseTicks + f * 1.5F);
|
||||
if (this.fuseTicks > this.maxFuseTicks - 5) {
|
||||
this.fuseTicks = this.maxFuseTicks - 5;
|
||||
}
|
||||
}
|
||||
|
||||
public int getMaxHealth() {
|
||||
return 20;
|
||||
}
|
||||
|
||||
protected void a() {
|
||||
super.a();
|
||||
this.datawatcher.a(16, Byte.valueOf((byte) -1));
|
||||
@ -77,8 +77,8 @@ public class EntityCreeper extends EntityMonster {
|
||||
|
||||
public void l_() {
|
||||
if (this.isAlive()) {
|
||||
this.d = this.fuseTicks;
|
||||
int i = this.o();
|
||||
this.bp = this.fuseTicks;
|
||||
int i = this.bR();
|
||||
|
||||
if (i > 0 && this.fuseTicks == 0) {
|
||||
this.makeSound("random.fuse", 1.0F, 0.5F);
|
||||
@ -112,11 +112,11 @@ public class EntityCreeper extends EntityMonster {
|
||||
super.l_();
|
||||
}
|
||||
|
||||
protected String bc() {
|
||||
protected String aK() {
|
||||
return "mob.creeper.say";
|
||||
}
|
||||
|
||||
protected String bd() {
|
||||
protected String aL() {
|
||||
return "mob.creeper.death";
|
||||
}
|
||||
|
||||
@ -173,7 +173,7 @@ public class EntityCreeper extends EntityMonster {
|
||||
return Item.SULPHUR.id;
|
||||
}
|
||||
|
||||
public int o() {
|
||||
public int bR() {
|
||||
return this.datawatcher.getByte(16);
|
||||
}
|
||||
|
||||
|
@ -17,13 +17,13 @@ public class EntityDamageSourceIndirect extends EntityDamageSource {
|
||||
return this.owner;
|
||||
}
|
||||
|
||||
public String getLocalizedDeathMessage(EntityLiving entityliving) {
|
||||
public ChatMessage getLocalizedDeathMessage(EntityLiving entityliving) {
|
||||
String s = this.owner == null ? this.p.getScoreboardDisplayName() : this.owner.getScoreboardDisplayName();
|
||||
ItemStack itemstack = this.owner instanceof EntityLiving ? ((EntityLiving) this.owner).bG() : null;
|
||||
ItemStack itemstack = this.owner instanceof EntityLiving ? ((EntityLiving) this.owner).aV() : null;
|
||||
String s1 = "death.attack." + this.translationIndex;
|
||||
String s2 = s1 + ".item";
|
||||
|
||||
return itemstack != null && itemstack.hasName() && LocaleI18n.b(s2) ? LocaleI18n.get(s2, new Object[] { entityliving.getScoreboardDisplayName(), s, itemstack.getName()}) : LocaleI18n.get(s1, new Object[] { entityliving.getScoreboardDisplayName(), s});
|
||||
return itemstack != null && itemstack.hasName() && LocaleI18n.b(s2) ? ChatMessage.b(s2, new Object[] { entityliving.getScoreboardDisplayName(), s, itemstack.getName()}) : ChatMessage.b(s1, new Object[] { entityliving.getScoreboardDisplayName(), s});
|
||||
}
|
||||
|
||||
// CraftBukkit start
|
||||
|
@ -23,7 +23,7 @@ public class EntityEgg extends EntityProjectile {
|
||||
|
||||
protected void a(MovingObjectPosition movingobjectposition) {
|
||||
if (movingobjectposition.entity != null) {
|
||||
movingobjectposition.entity.damageEntity(DamageSource.projectile(this, this.getShooter()), 0);
|
||||
movingobjectposition.entity.damageEntity(DamageSource.projectile(this, this.getShooter()), 0.0F);
|
||||
}
|
||||
|
||||
// CraftBukkit start
|
||||
|
@ -4,7 +4,7 @@ import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
|
||||
|
||||
public class EntityEnderCrystal extends Entity {
|
||||
|
||||
public int a = 0;
|
||||
public int a;
|
||||
public int b;
|
||||
|
||||
public EntityEnderCrystal(World world) {
|
||||
@ -16,7 +16,7 @@ public class EntityEnderCrystal extends Entity {
|
||||
this.a = this.random.nextInt(100000);
|
||||
}
|
||||
|
||||
protected boolean f_() {
|
||||
protected boolean e_() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -51,13 +51,13 @@ public class EntityEnderCrystal extends Entity {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||
public boolean damageEntity(DamageSource damagesource, float f) {
|
||||
if (this.isInvulnerable()) {
|
||||
return false;
|
||||
} else {
|
||||
if (!this.dead && !this.world.isStatic) {
|
||||
// CraftBukkit start - All non-living entities need this
|
||||
if (CraftEventFactory.handleNonLivingEntityDamageEvent(this, damagesource, i)) {
|
||||
if (CraftEventFactory.handleNonLivingEntityDamageEvent(this, damagesource, f)) {
|
||||
return false;
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
@ -12,68 +12,67 @@ import org.bukkit.event.entity.EntityRegainHealthEvent;
|
||||
import org.bukkit.Bukkit;
|
||||
// CraftBukkit end
|
||||
|
||||
public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
public class EntityEnderDragon extends EntityInsentient implements IComplex, IMonster {
|
||||
|
||||
public double a;
|
||||
public double b;
|
||||
public double c;
|
||||
public double[][] d = new double[64][3];
|
||||
public int e = -1;
|
||||
public double h;
|
||||
public double i;
|
||||
public double j;
|
||||
public double[][] bn = new double[64][3];
|
||||
public int bo = -1;
|
||||
public EntityComplexPart[] children;
|
||||
public EntityComplexPart g;
|
||||
public EntityComplexPart h;
|
||||
public EntityComplexPart i;
|
||||
public EntityComplexPart j;
|
||||
public EntityComplexPart bK;
|
||||
public EntityComplexPart bL;
|
||||
public EntityComplexPart bM;
|
||||
public float bN = 0.0F;
|
||||
public float bO = 0.0F;
|
||||
public boolean bP = false;
|
||||
public boolean bQ = false;
|
||||
private Entity bT;
|
||||
public int bR = 0;
|
||||
public EntityEnderCrystal bS = null;
|
||||
public EntityComplexPart bq;
|
||||
public EntityComplexPart br;
|
||||
public EntityComplexPart bs;
|
||||
public EntityComplexPart bt;
|
||||
public EntityComplexPart bu;
|
||||
public EntityComplexPart bv;
|
||||
public EntityComplexPart bw;
|
||||
public float bx;
|
||||
public float by;
|
||||
public boolean bz;
|
||||
public boolean bA;
|
||||
private Entity bD;
|
||||
public int bB;
|
||||
public EntityEnderCrystal bC;
|
||||
private Explosion explosionSource = new Explosion(null, this, Double.NaN, Double.NaN, Double.NaN, Float.NaN); // CraftBukkit - reusable source for CraftTNTPrimed.getSource()
|
||||
|
||||
public EntityEnderDragon(World world) {
|
||||
super(world);
|
||||
this.children = new EntityComplexPart[] { this.g = new EntityComplexPart(this, "head", 6.0F, 6.0F), this.h = new EntityComplexPart(this, "body", 8.0F, 8.0F), this.i = new EntityComplexPart(this, "tail", 4.0F, 4.0F), this.j = new EntityComplexPart(this, "tail", 4.0F, 4.0F), this.bK = new EntityComplexPart(this, "tail", 4.0F, 4.0F), this.bL = new EntityComplexPart(this, "wing", 4.0F, 4.0F), this.bM = new EntityComplexPart(this, "wing", 4.0F, 4.0F)};
|
||||
this.children = new EntityComplexPart[] { this.bq = new EntityComplexPart(this, "head", 6.0F, 6.0F), this.br = new EntityComplexPart(this, "body", 8.0F, 8.0F), this.bs = new EntityComplexPart(this, "tail", 4.0F, 4.0F), this.bt = new EntityComplexPart(this, "tail", 4.0F, 4.0F), this.bu = new EntityComplexPart(this, "tail", 4.0F, 4.0F), this.bv = new EntityComplexPart(this, "wing", 4.0F, 4.0F), this.bw = new EntityComplexPart(this, "wing", 4.0F, 4.0F)};
|
||||
this.setHealth(this.getMaxHealth());
|
||||
this.texture = "/mob/enderdragon/ender.png";
|
||||
this.a(16.0F, 8.0F);
|
||||
this.Z = true;
|
||||
this.fireProof = true;
|
||||
this.b = 100.0D;
|
||||
this.i = 100.0D;
|
||||
this.am = true;
|
||||
}
|
||||
|
||||
public int getMaxHealth() {
|
||||
return 200;
|
||||
protected void ax() {
|
||||
super.ax();
|
||||
this.a(GenericAttributes.a).a(200.0D);
|
||||
}
|
||||
|
||||
protected void a() {
|
||||
super.a();
|
||||
this.datawatcher.a(16, new Integer(this.getMaxHealth()));
|
||||
}
|
||||
|
||||
public double[] b(int i, float f) {
|
||||
if (this.health <= 0) {
|
||||
if (this.getHealth() <= 0.0F) {
|
||||
f = 0.0F;
|
||||
}
|
||||
|
||||
f = 1.0F - f;
|
||||
int j = this.e - i * 1 & 63;
|
||||
int k = this.e - i * 1 - 1 & 63;
|
||||
int j = this.bo - i * 1 & 63;
|
||||
int k = this.bo - i * 1 - 1 & 63;
|
||||
double[] adouble = new double[3];
|
||||
double d0 = this.d[j][0];
|
||||
double d1 = MathHelper.g(this.d[k][0] - d0);
|
||||
double d0 = this.bn[j][0];
|
||||
double d1 = MathHelper.g(this.bn[k][0] - d0);
|
||||
|
||||
adouble[0] = d0 + d1 * (double) f;
|
||||
d0 = this.d[j][1];
|
||||
d1 = this.d[k][1] - d0;
|
||||
d0 = this.bn[j][1];
|
||||
d1 = this.bn[k][1] - d0;
|
||||
adouble[1] = d0 + d1 * (double) f;
|
||||
adouble[2] = this.d[j][2] + (this.d[k][2] - this.d[j][2]) * (double) f;
|
||||
adouble[2] = this.bn[j][2] + (this.bn[k][2] - this.bn[j][2]) * (double) f;
|
||||
return adouble;
|
||||
}
|
||||
|
||||
@ -81,48 +80,46 @@ public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
float f;
|
||||
float f1;
|
||||
|
||||
if (!this.world.isStatic) {
|
||||
this.datawatcher.watch(16, Integer.valueOf(this.getScaledHealth())); // CraftBukkit - this.health -> this.getScaledHealth()
|
||||
} else {
|
||||
f = MathHelper.cos(this.bO * 3.1415927F * 2.0F);
|
||||
f1 = MathHelper.cos(this.bN * 3.1415927F * 2.0F);
|
||||
if (this.world.isStatic) {
|
||||
f = MathHelper.cos(this.by * 3.1415927F * 2.0F);
|
||||
f1 = MathHelper.cos(this.bx * 3.1415927F * 2.0F);
|
||||
if (f1 <= -0.3F && f >= -0.3F) {
|
||||
this.world.a(this.locX, this.locY, this.locZ, "mob.enderdragon.wings", 5.0F, 0.8F + this.random.nextFloat() * 0.3F, false);
|
||||
}
|
||||
}
|
||||
|
||||
this.bN = this.bO;
|
||||
this.bx = this.by;
|
||||
float f2;
|
||||
|
||||
if (this.health <= 0) {
|
||||
if (this.getHealth() <= 0.0F) {
|
||||
f = (this.random.nextFloat() - 0.5F) * 8.0F;
|
||||
f1 = (this.random.nextFloat() - 0.5F) * 4.0F;
|
||||
f2 = (this.random.nextFloat() - 0.5F) * 8.0F;
|
||||
this.world.addParticle("largeexplode", this.locX + (double) f, this.locY + 2.0D + (double) f1, this.locZ + (double) f2, 0.0D, 0.0D, 0.0D);
|
||||
} else {
|
||||
this.h();
|
||||
this.bF();
|
||||
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);
|
||||
if (this.bQ) {
|
||||
this.bO += f * 0.5F;
|
||||
if (this.bA) {
|
||||
this.by += f * 0.5F;
|
||||
} else {
|
||||
this.bO += f;
|
||||
this.by += f;
|
||||
}
|
||||
|
||||
this.yaw = MathHelper.g(this.yaw);
|
||||
if (this.e < 0) {
|
||||
for (int d05 = 0; d05 < this.d.length; ++d05) {
|
||||
this.d[d05][0] = (double) this.yaw;
|
||||
this.d[d05][1] = this.locY;
|
||||
if (this.bo < 0) {
|
||||
for (int d05 = 0; d05 < this.bn.length; ++d05) {
|
||||
this.bn[d05][0] = (double) this.yaw;
|
||||
this.bn[d05][1] = this.locY;
|
||||
}
|
||||
}
|
||||
|
||||
if (++this.e == this.d.length) {
|
||||
this.e = 0;
|
||||
if (++this.bo == this.bn.length) {
|
||||
this.bo = 0;
|
||||
}
|
||||
|
||||
this.d[this.e][0] = (double) this.yaw;
|
||||
this.d[this.e][1] = this.locY;
|
||||
this.bn[this.bo][0] = (double) this.yaw;
|
||||
this.bn[this.bo][1] = this.locY;
|
||||
double d0;
|
||||
double d1;
|
||||
double d2;
|
||||
@ -130,27 +127,27 @@ public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
float f3;
|
||||
|
||||
if (this.world.isStatic) {
|
||||
if (this.bu > 0) {
|
||||
d0 = this.locX + (this.bv - this.locX) / (double) this.bu;
|
||||
d1 = this.locY + (this.bw - this.locY) / (double) this.bu;
|
||||
d2 = this.locZ + (this.bx - this.locZ) / (double) this.bu;
|
||||
d3 = MathHelper.g(this.by - (double) this.yaw);
|
||||
this.yaw = (float) ((double) this.yaw + d3 / (double) this.bu);
|
||||
this.pitch = (float) ((double) this.pitch + (this.bz - (double) this.pitch) / (double) this.bu);
|
||||
--this.bu;
|
||||
if (this.bh > 0) {
|
||||
d0 = this.locX + (this.bi - this.locX) / (double) this.bh;
|
||||
d1 = this.locY + (this.bj - this.locY) / (double) this.bh;
|
||||
d2 = this.locZ + (this.bk - this.locZ) / (double) this.bh;
|
||||
d3 = MathHelper.g(this.bl - (double) this.yaw);
|
||||
this.yaw = (float) ((double) this.yaw + d3 / (double) this.bh);
|
||||
this.pitch = (float) ((double) this.pitch + (this.bm - (double) this.pitch) / (double) this.bh);
|
||||
--this.bh;
|
||||
this.setPosition(d0, d1, d2);
|
||||
this.b(this.yaw, this.pitch);
|
||||
}
|
||||
} else {
|
||||
d0 = this.a - this.locX;
|
||||
d1 = this.b - this.locY;
|
||||
d2 = this.c - this.locZ;
|
||||
d0 = this.h - this.locX;
|
||||
d1 = this.i - this.locY;
|
||||
d2 = this.j - this.locZ;
|
||||
d3 = d0 * d0 + d1 * d1 + d2 * d2;
|
||||
if (this.bT != null) {
|
||||
this.a = this.bT.locX;
|
||||
this.c = this.bT.locZ;
|
||||
double d4 = this.a - this.locX;
|
||||
double d5 = this.c - this.locZ;
|
||||
if (this.bD != null) {
|
||||
this.h = this.bD.locX;
|
||||
this.j = this.bD.locZ;
|
||||
double d4 = this.h - this.locX;
|
||||
double d5 = this.j - this.locZ;
|
||||
double d6 = Math.sqrt(d4 * d4 + d5 * d5);
|
||||
double d7 = 0.4000000059604645D + d6 / 80.0D - 1.0D;
|
||||
|
||||
@ -158,14 +155,14 @@ public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
d7 = 10.0D;
|
||||
}
|
||||
|
||||
this.b = this.bT.boundingBox.b + d7;
|
||||
this.i = this.bD.boundingBox.b + d7;
|
||||
} else {
|
||||
this.a += this.random.nextGaussian() * 2.0D;
|
||||
this.c += this.random.nextGaussian() * 2.0D;
|
||||
this.h += this.random.nextGaussian() * 2.0D;
|
||||
this.j += this.random.nextGaussian() * 2.0D;
|
||||
}
|
||||
|
||||
if (this.bP || d3 < 100.0D || d3 > 22500.0D || this.positionChanged || this.H) {
|
||||
this.i();
|
||||
if (this.bz || d3 < 100.0D || d3 > 22500.0D || this.positionChanged || this.H) {
|
||||
this.bG();
|
||||
}
|
||||
|
||||
d1 /= (double) MathHelper.sqrt(d0 * d0 + d2 * d2);
|
||||
@ -191,7 +188,7 @@ public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
d9 = -50.0D;
|
||||
}
|
||||
|
||||
Vec3D vec3d = this.world.getVec3DPool().create(this.a - this.locX, this.b - this.locY, this.c - this.locZ).a();
|
||||
Vec3D vec3d = this.world.getVec3DPool().create(this.h - this.locX, this.i - this.locY, this.j - this.locZ).a();
|
||||
Vec3D vec3d1 = this.world.getVec3DPool().create((double) MathHelper.sin(this.yaw * 3.1415927F / 180.0F), this.motY, (double) (-MathHelper.cos(this.yaw * 3.1415927F / 180.0F))).a();
|
||||
float f4 = (float) (vec3d1.b(vec3d) + 0.5D) / 1.5F;
|
||||
|
||||
@ -199,7 +196,7 @@ public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
f4 = 0.0F;
|
||||
}
|
||||
|
||||
this.bF *= 0.8F;
|
||||
this.bg *= 0.8F;
|
||||
float f5 = MathHelper.sqrt(this.motX * this.motX + this.motZ * this.motZ) * 1.0F + 1.0F;
|
||||
double d10 = Math.sqrt(this.motX * this.motX + this.motZ * this.motZ) * 1.0D + 1.0D;
|
||||
|
||||
@ -207,13 +204,13 @@ public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
d10 = 40.0D;
|
||||
}
|
||||
|
||||
this.bF = (float) ((double) this.bF + d9 * (0.699999988079071D / d10 / (double) f5));
|
||||
this.yaw += this.bF * 0.1F;
|
||||
this.bg = (float) ((double) this.bg + d9 * (0.699999988079071D / d10 / (double) f5));
|
||||
this.yaw += this.bg * 0.1F;
|
||||
float f6 = (float) (2.0D / (d10 + 1.0D));
|
||||
float f7 = 0.06F;
|
||||
|
||||
this.a(0.0F, -1.0F, f7 * (f4 * f6 + (1.0F - f6)));
|
||||
if (this.bQ) {
|
||||
if (this.bA) {
|
||||
this.move(this.motX * 0.800000011920929D, this.motY * 0.800000011920929D, this.motZ * 0.800000011920929D);
|
||||
} else {
|
||||
this.move(this.motX, this.motY, this.motZ);
|
||||
@ -228,17 +225,17 @@ public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
this.motY *= 0.9100000262260437D;
|
||||
}
|
||||
|
||||
this.ay = this.yaw;
|
||||
this.g.width = this.g.length = 3.0F;
|
||||
this.i.width = this.i.length = 2.0F;
|
||||
this.j.width = this.j.length = 2.0F;
|
||||
this.bK.width = this.bK.length = 2.0F;
|
||||
this.h.length = 3.0F;
|
||||
this.h.width = 5.0F;
|
||||
this.bL.length = 2.0F;
|
||||
this.bL.width = 4.0F;
|
||||
this.bM.length = 3.0F;
|
||||
this.bM.width = 4.0F;
|
||||
this.aN = this.yaw;
|
||||
this.bq.width = this.bq.length = 3.0F;
|
||||
this.bs.width = this.bs.length = 2.0F;
|
||||
this.bt.width = this.bt.length = 2.0F;
|
||||
this.bu.width = this.bu.length = 2.0F;
|
||||
this.br.length = 3.0F;
|
||||
this.br.width = 5.0F;
|
||||
this.bv.length = 2.0F;
|
||||
this.bv.width = 4.0F;
|
||||
this.bw.length = 3.0F;
|
||||
this.bw.width = 4.0F;
|
||||
f1 = (float) (this.b(5, 1.0F)[1] - this.b(10, 1.0F)[1]) * 10.0F / 180.0F * 3.1415927F;
|
||||
f2 = MathHelper.cos(f1);
|
||||
float f9 = -MathHelper.sin(f1);
|
||||
@ -246,40 +243,40 @@ public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
float f11 = MathHelper.sin(f10);
|
||||
float f12 = MathHelper.cos(f10);
|
||||
|
||||
this.h.l_();
|
||||
this.h.setPositionRotation(this.locX + (double) (f11 * 0.5F), this.locY, this.locZ - (double) (f12 * 0.5F), 0.0F, 0.0F);
|
||||
this.bL.l_();
|
||||
this.bL.setPositionRotation(this.locX + (double) (f12 * 4.5F), this.locY + 2.0D, this.locZ + (double) (f11 * 4.5F), 0.0F, 0.0F);
|
||||
this.bM.l_();
|
||||
this.bM.setPositionRotation(this.locX - (double) (f12 * 4.5F), this.locY + 2.0D, this.locZ - (double) (f11 * 4.5F), 0.0F, 0.0F);
|
||||
this.br.l_();
|
||||
this.br.setPositionRotation(this.locX + (double) (f11 * 0.5F), this.locY, this.locZ - (double) (f12 * 0.5F), 0.0F, 0.0F);
|
||||
this.bv.l_();
|
||||
this.bv.setPositionRotation(this.locX + (double) (f12 * 4.5F), this.locY + 2.0D, this.locZ + (double) (f11 * 4.5F), 0.0F, 0.0F);
|
||||
this.bw.l_();
|
||||
this.bw.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 && this.hurtTicks == 0) {
|
||||
this.a(this.world.getEntities(this, this.bL.boundingBox.grow(4.0D, 2.0D, 4.0D).d(0.0D, -2.0D, 0.0D)));
|
||||
this.a(this.world.getEntities(this, this.bM.boundingBox.grow(4.0D, 2.0D, 4.0D).d(0.0D, -2.0D, 0.0D)));
|
||||
this.b(this.world.getEntities(this, this.g.boundingBox.grow(1.0D, 1.0D, 1.0D)));
|
||||
this.a(this.world.getEntities(this, this.bv.boundingBox.grow(4.0D, 2.0D, 4.0D).d(0.0D, -2.0D, 0.0D)));
|
||||
this.a(this.world.getEntities(this, this.bw.boundingBox.grow(4.0D, 2.0D, 4.0D).d(0.0D, -2.0D, 0.0D)));
|
||||
this.b(this.world.getEntities(this, this.bq.boundingBox.grow(1.0D, 1.0D, 1.0D)));
|
||||
}
|
||||
|
||||
double[] adouble = this.b(5, 1.0F);
|
||||
double[] adouble1 = this.b(0, 1.0F);
|
||||
|
||||
f3 = MathHelper.sin(this.yaw * 3.1415927F / 180.0F - this.bF * 0.01F);
|
||||
float f13 = MathHelper.cos(this.yaw * 3.1415927F / 180.0F - this.bF * 0.01F);
|
||||
f3 = MathHelper.sin(this.yaw * 3.1415927F / 180.0F - this.bg * 0.01F);
|
||||
float f13 = MathHelper.cos(this.yaw * 3.1415927F / 180.0F - this.bg * 0.01F);
|
||||
|
||||
this.g.l_();
|
||||
this.g.setPositionRotation(this.locX + (double) (f3 * 5.5F * f2), this.locY + (adouble1[1] - adouble[1]) * 1.0D + (double) (f9 * 5.5F), this.locZ - (double) (f13 * 5.5F * f2), 0.0F, 0.0F);
|
||||
this.bq.l_();
|
||||
this.bq.setPositionRotation(this.locX + (double) (f3 * 5.5F * f2), this.locY + (adouble1[1] - adouble[1]) * 1.0D + (double) (f9 * 5.5F), this.locZ - (double) (f13 * 5.5F * f2), 0.0F, 0.0F);
|
||||
|
||||
for (int j = 0; j < 3; ++j) {
|
||||
EntityComplexPart entitycomplexpart = null;
|
||||
|
||||
if (j == 0) {
|
||||
entitycomplexpart = this.i;
|
||||
entitycomplexpart = this.bs;
|
||||
}
|
||||
|
||||
if (j == 1) {
|
||||
entitycomplexpart = this.j;
|
||||
entitycomplexpart = this.bt;
|
||||
}
|
||||
|
||||
if (j == 2) {
|
||||
entitycomplexpart = this.bK;
|
||||
entitycomplexpart = this.bu;
|
||||
}
|
||||
|
||||
double[] adouble2 = this.b(12 + j * 2, 1.0F);
|
||||
@ -294,26 +291,26 @@ public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
}
|
||||
|
||||
if (!this.world.isStatic) {
|
||||
this.bQ = this.a(this.g.boundingBox) | this.a(this.h.boundingBox);
|
||||
this.bA = this.a(this.bq.boundingBox) | this.a(this.br.boundingBox);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void h() {
|
||||
if (this.bS != null) {
|
||||
if (this.bS.dead) {
|
||||
private void bF() {
|
||||
if (this.bC != null) {
|
||||
if (this.bC.dead) {
|
||||
if (!this.world.isStatic) {
|
||||
this.a(this.g, DamageSource.explosion((Explosion) null), 10);
|
||||
this.a(this.bq, DamageSource.explosion((Explosion) null), 10.0F);
|
||||
}
|
||||
|
||||
this.bS = null;
|
||||
} else if (this.ticksLived % 10 == 0 && this.health < this.maxHealth) { // CraftBukkit - this.getMaxHealth() -> this.maxHealth
|
||||
this.bC = null;
|
||||
} else if (this.ticksLived % 10 == 0 && this.getHealth() < this.maxHealth) { // CraftBukkit - this.getMaxHealth() -> this.maxHealth
|
||||
// CraftBukkit start
|
||||
EntityRegainHealthEvent event = new EntityRegainHealthEvent(this.getBukkitEntity(), 1, EntityRegainHealthEvent.RegainReason.ENDER_CRYSTAL);
|
||||
EntityRegainHealthEvent event = new EntityRegainHealthEvent(this.getBukkitEntity(), 1.0D, EntityRegainHealthEvent.RegainReason.ENDER_CRYSTAL);
|
||||
this.world.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
if (!event.isCancelled()) {
|
||||
this.setHealth(this.getHealth() + event.getAmount());
|
||||
this.setHealth((float) (this.getHealth() + event.getAmount()));
|
||||
}
|
||||
// CraftBukkit end
|
||||
}
|
||||
@ -336,13 +333,13 @@ public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
}
|
||||
}
|
||||
|
||||
this.bS = entityendercrystal;
|
||||
this.bC = entityendercrystal;
|
||||
}
|
||||
}
|
||||
|
||||
private void a(List list) {
|
||||
double d0 = (this.h.boundingBox.a + this.h.boundingBox.d) / 2.0D;
|
||||
double d1 = (this.h.boundingBox.c + this.h.boundingBox.f) / 2.0D;
|
||||
double d0 = (this.br.boundingBox.a + this.br.boundingBox.d) / 2.0D;
|
||||
double d1 = (this.br.boundingBox.c + this.br.boundingBox.f) / 2.0D;
|
||||
Iterator iterator = list.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@ -363,32 +360,32 @@ public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
Entity entity = (Entity) list.get(i);
|
||||
|
||||
if (entity instanceof EntityLiving) {
|
||||
entity.damageEntity(DamageSource.mobAttack(this), 10);
|
||||
entity.damageEntity(DamageSource.mobAttack(this), 10.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void i() {
|
||||
this.bP = false;
|
||||
private void bG() {
|
||||
this.bz = false;
|
||||
if (this.random.nextInt(2) == 0 && !this.world.players.isEmpty()) {
|
||||
this.bT = (Entity) this.world.players.get(this.random.nextInt(this.world.players.size()));
|
||||
this.bD = (Entity) this.world.players.get(this.random.nextInt(this.world.players.size()));
|
||||
} else {
|
||||
boolean flag = false;
|
||||
|
||||
do {
|
||||
this.a = 0.0D;
|
||||
this.b = (double) (70.0F + this.random.nextFloat() * 50.0F);
|
||||
this.c = 0.0D;
|
||||
this.a += (double) (this.random.nextFloat() * 120.0F - 60.0F);
|
||||
this.c += (double) (this.random.nextFloat() * 120.0F - 60.0F);
|
||||
double d0 = this.locX - this.a;
|
||||
double d1 = this.locY - this.b;
|
||||
double d2 = this.locZ - this.c;
|
||||
this.h = 0.0D;
|
||||
this.i = (double) (70.0F + this.random.nextFloat() * 50.0F);
|
||||
this.j = 0.0D;
|
||||
this.h += (double) (this.random.nextFloat() * 120.0F - 60.0F);
|
||||
this.j += (double) (this.random.nextFloat() * 120.0F - 60.0F);
|
||||
double d0 = this.locX - this.h;
|
||||
double d1 = this.locY - this.i;
|
||||
double d2 = this.locZ - this.j;
|
||||
|
||||
flag = d0 * d0 + d1 * d1 + d2 * d2 > 100.0D;
|
||||
} while (!flag);
|
||||
|
||||
this.bT = null;
|
||||
this.bD = null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -477,37 +474,37 @@ public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
return flag;
|
||||
}
|
||||
|
||||
public boolean a(EntityComplexPart entitycomplexpart, DamageSource damagesource, int i) {
|
||||
if (entitycomplexpart != this.g) {
|
||||
i = i / 4 + 1;
|
||||
public boolean a(EntityComplexPart entitycomplexpart, DamageSource damagesource, float f) {
|
||||
if (entitycomplexpart != this.bq) {
|
||||
f = f / 4.0F + 1.0F;
|
||||
}
|
||||
|
||||
float f = this.yaw * 3.1415927F / 180.0F;
|
||||
float f1 = MathHelper.sin(f);
|
||||
float f2 = MathHelper.cos(f);
|
||||
float f1 = this.yaw * 3.1415927F / 180.0F;
|
||||
float f2 = MathHelper.sin(f1);
|
||||
float f3 = MathHelper.cos(f1);
|
||||
|
||||
this.a = this.locX + (double) (f1 * 5.0F) + (double) ((this.random.nextFloat() - 0.5F) * 2.0F);
|
||||
this.b = this.locY + (double) (this.random.nextFloat() * 3.0F) + 1.0D;
|
||||
this.c = this.locZ - (double) (f2 * 5.0F) + (double) ((this.random.nextFloat() - 0.5F) * 2.0F);
|
||||
this.bT = null;
|
||||
this.h = this.locX + (double) (f2 * 5.0F) + (double) ((this.random.nextFloat() - 0.5F) * 2.0F);
|
||||
this.i = this.locY + (double) (this.random.nextFloat() * 3.0F) + 1.0D;
|
||||
this.j = this.locZ - (double) (f3 * 5.0F) + (double) ((this.random.nextFloat() - 0.5F) * 2.0F);
|
||||
this.bD = null;
|
||||
if (damagesource.getEntity() instanceof EntityHuman || damagesource.c()) {
|
||||
this.dealDamage(damagesource, i);
|
||||
this.dealDamage(damagesource, f);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||
public boolean damageEntity(DamageSource damagesource, float f) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean dealDamage(DamageSource damagesource, int i) { // CraftBukkit - protected -> public
|
||||
return super.damageEntity(damagesource, i);
|
||||
public boolean dealDamage(DamageSource damagesource, float f) { // CraftBukkit - protected -> public
|
||||
return super.damageEntity(damagesource, f);
|
||||
}
|
||||
|
||||
protected void aS() {
|
||||
++this.bR;
|
||||
if (this.bR >= 180 && this.bR <= 200) {
|
||||
protected void az() {
|
||||
++this.bB;
|
||||
if (this.bB >= 180 && this.bB <= 200) {
|
||||
float f = (this.random.nextFloat() - 0.5F) * 8.0F;
|
||||
float f1 = (this.random.nextFloat() - 0.5F) * 4.0F;
|
||||
float f2 = (this.random.nextFloat() - 0.5F) * 8.0F;
|
||||
@ -519,7 +516,7 @@ public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
int j;
|
||||
|
||||
if (!this.world.isStatic) {
|
||||
if (this.bR > 150 && this.bR % 5 == 0) {
|
||||
if (this.bB > 150 && this.bB % 5 == 0) {
|
||||
i = expToDrop / 12; // CraftBukkit - drop experience as dragon falls from sky. use experience drop from death event. This is now set in getExpReward()
|
||||
|
||||
while (i > 0) {
|
||||
@ -529,14 +526,14 @@ public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.bR == 1) {
|
||||
if (this.bB == 1) {
|
||||
this.world.d(1018, (int) this.locX, (int) this.locY, (int) this.locZ, 0);
|
||||
}
|
||||
}
|
||||
|
||||
this.move(0.0D, 0.10000000149011612D, 0.0D);
|
||||
this.ay = this.yaw += 20.0F;
|
||||
if (this.bR == 200 && !this.world.isStatic) {
|
||||
this.aN = this.yaw += 20.0F;
|
||||
if (this.bB == 200 && !this.world.isStatic) {
|
||||
i = expToDrop - 10 * (expToDrop / 12); // CraftBukkit - drop the remaining experience
|
||||
|
||||
while (i > 0) {
|
||||
@ -616,9 +613,9 @@ public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
BlockEnderPortal.a = false;
|
||||
}
|
||||
|
||||
protected void bn() {}
|
||||
protected void bk() {}
|
||||
|
||||
public Entity[] an() {
|
||||
public Entity[] am() {
|
||||
return this.children;
|
||||
}
|
||||
|
||||
@ -626,19 +623,19 @@ public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
return false;
|
||||
}
|
||||
|
||||
public World d() {
|
||||
public World b() {
|
||||
return this.world;
|
||||
}
|
||||
|
||||
protected String bb() {
|
||||
protected String r() {
|
||||
return "mob.enderdragon.growl";
|
||||
}
|
||||
|
||||
protected String bc() {
|
||||
protected String aK() {
|
||||
return "mob.enderdragon.hit";
|
||||
}
|
||||
|
||||
protected float ba() {
|
||||
protected float aW() {
|
||||
return 5.0F;
|
||||
}
|
||||
|
||||
|
@ -43,13 +43,13 @@ public class EntityEnderPearl extends EntityProjectile {
|
||||
entityplayer.playerConnection.teleport(teleEvent.getTo());
|
||||
this.getShooter().fallDistance = 0.0F;
|
||||
|
||||
EntityDamageByEntityEvent damageEvent = new EntityDamageByEntityEvent(this.getBukkitEntity(), player, EntityDamageByEntityEvent.DamageCause.FALL, 5);
|
||||
EntityDamageByEntityEvent damageEvent = new EntityDamageByEntityEvent(this.getBukkitEntity(), player, EntityDamageByEntityEvent.DamageCause.FALL, 5.0D);
|
||||
Bukkit.getPluginManager().callEvent(damageEvent);
|
||||
|
||||
if (!damageEvent.isCancelled() && !entityplayer.playerConnection.disconnected) {
|
||||
entityplayer.invulnerableTicks = -1; // Remove spawning invulnerability
|
||||
player.setLastDamageCause(damageEvent);
|
||||
entityplayer.damageEntity(DamageSource.FALL, damageEvent.getDamage());
|
||||
entityplayer.damageEntity(DamageSource.FALL, (float) damageEvent.getDamage());
|
||||
}
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
@ -1,5 +1,7 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
// CraftBukkit start
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
@ -8,21 +10,25 @@ import org.bukkit.event.entity.EntityTeleportEvent;
|
||||
|
||||
public class EntityEnderman extends EntityMonster {
|
||||
|
||||
private static boolean[] d = new boolean[256];
|
||||
private int e = 0;
|
||||
private int f = 0;
|
||||
private boolean g;
|
||||
private static final UUID bp = UUID.fromString("020E0DFB-87AE-4653-9556-831010E291A0");
|
||||
private static final AttributeModifier bq = (new AttributeModifier(bp, "Attacking speed boost", 6.199999809265137D, 0)).a(false);
|
||||
private static boolean[] br = new boolean[256];
|
||||
private int bs;
|
||||
private int bt;
|
||||
private Entity bu;
|
||||
private boolean bv;
|
||||
|
||||
public EntityEnderman(World world) {
|
||||
super(world);
|
||||
this.texture = "/mob/enderman.png";
|
||||
this.bI = 0.2F;
|
||||
this.a(0.6F, 2.9F);
|
||||
this.Y = 1.0F;
|
||||
}
|
||||
|
||||
public int getMaxHealth() {
|
||||
return 40;
|
||||
protected void ax() {
|
||||
super.ax();
|
||||
this.a(GenericAttributes.a).a(40.0D);
|
||||
this.a(GenericAttributes.d).a(0.30000001192092896D);
|
||||
this.a(GenericAttributes.e).a(7.0D);
|
||||
}
|
||||
|
||||
protected void a() {
|
||||
@ -48,48 +54,57 @@ public class EntityEnderman extends EntityMonster {
|
||||
EntityHuman entityhuman = this.world.findNearbyVulnerablePlayer(this, 64.0D);
|
||||
|
||||
if (entityhuman != null) {
|
||||
if (this.e(entityhuman)) {
|
||||
this.g = true;
|
||||
if (this.f == 0) {
|
||||
if (this.f(entityhuman)) {
|
||||
this.bv = true;
|
||||
if (this.bt == 0) {
|
||||
this.world.makeSound(entityhuman, "mob.endermen.stare", 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
if (this.f++ == 5) {
|
||||
this.f = 0;
|
||||
if (this.bt++ == 5) {
|
||||
this.bt = 0;
|
||||
this.a(true);
|
||||
return entityhuman;
|
||||
}
|
||||
} else {
|
||||
this.f = 0;
|
||||
this.bt = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private boolean e(EntityHuman entityhuman) {
|
||||
private boolean f(EntityHuman entityhuman) {
|
||||
ItemStack itemstack = entityhuman.inventory.armor[3];
|
||||
|
||||
if (itemstack != null && itemstack.id == Block.PUMPKIN.id) {
|
||||
return false;
|
||||
} else {
|
||||
Vec3D vec3d = entityhuman.i(1.0F).a();
|
||||
Vec3D vec3d = entityhuman.j(1.0F).a();
|
||||
Vec3D vec3d1 = this.world.getVec3DPool().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.b();
|
||||
|
||||
vec3d1 = vec3d1.a();
|
||||
double d1 = vec3d.b(vec3d1);
|
||||
|
||||
return d1 > 1.0D - 0.025D / d0 ? entityhuman.n(this) : false;
|
||||
return d1 > 1.0D - 0.025D / d0 ? entityhuman.o(this) : false;
|
||||
}
|
||||
}
|
||||
|
||||
public void c() {
|
||||
if (this.F()) {
|
||||
this.damageEntity(DamageSource.DROWN, 1);
|
||||
this.damageEntity(DamageSource.DROWN, 1.0F);
|
||||
}
|
||||
|
||||
this.bI = this.target != null ? 6.5F : 0.3F;
|
||||
if (this.bu != this.target) {
|
||||
AttributeInstance attributeinstance = this.a(GenericAttributes.d);
|
||||
|
||||
attributeinstance.b(bq);
|
||||
if (this.target != null) {
|
||||
attributeinstance.a(bq);
|
||||
}
|
||||
}
|
||||
|
||||
this.bu = this.target;
|
||||
int i;
|
||||
|
||||
if (!this.world.isStatic && this.world.getGameRules().getBoolean("mobGriefing")) {
|
||||
@ -103,7 +118,7 @@ public class EntityEnderman extends EntityMonster {
|
||||
j = MathHelper.floor(this.locY + this.random.nextDouble() * 3.0D);
|
||||
k = MathHelper.floor(this.locZ - 2.0D + this.random.nextDouble() * 4.0D);
|
||||
l = this.world.getTypeId(i, j, k);
|
||||
if (d[l]) {
|
||||
if (br[l]) {
|
||||
// CraftBukkit start - Pickup event
|
||||
if (!CraftEventFactory.callEntityChangeBlockEvent(this, this.world.getWorld().getBlockAt(i, j, k), org.bukkit.Material.AIR).isCancelled()) {
|
||||
this.setCarriedId(this.world.getTypeId(i, j, k));
|
||||
@ -136,55 +151,53 @@ public class EntityEnderman extends EntityMonster {
|
||||
}
|
||||
|
||||
if (this.world.v() && !this.world.isStatic) {
|
||||
float f = this.c(1.0F);
|
||||
float f = this.d(1.0F);
|
||||
|
||||
if (f > 0.5F && this.world.l(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.a(false);
|
||||
this.g = false;
|
||||
this.m();
|
||||
this.bv = false;
|
||||
this.bP();
|
||||
}
|
||||
}
|
||||
|
||||
if (this.F() || this.isBurning()) {
|
||||
this.target = null;
|
||||
this.a(false);
|
||||
this.g = false;
|
||||
this.m();
|
||||
this.bv = false;
|
||||
this.bP();
|
||||
}
|
||||
|
||||
if (this.q() && !this.g && this.random.nextInt(100) == 0) {
|
||||
if (this.bT() && !this.bv && this.random.nextInt(100) == 0) {
|
||||
this.a(false);
|
||||
}
|
||||
|
||||
this.bG = false;
|
||||
this.bd = false;
|
||||
if (this.target != null) {
|
||||
this.a(this.target, 100.0F, 100.0F);
|
||||
}
|
||||
|
||||
if (!this.world.isStatic && this.isAlive()) {
|
||||
if (this.target != null) {
|
||||
if (this.target instanceof EntityHuman && this.e((EntityHuman) this.target)) {
|
||||
this.bD = this.bE = 0.0F;
|
||||
this.bI = 0.0F;
|
||||
if (this.target instanceof EntityHuman && this.f((EntityHuman) this.target)) {
|
||||
if (this.target.e((Entity) this) < 16.0D) {
|
||||
this.m();
|
||||
this.bP();
|
||||
}
|
||||
|
||||
this.e = 0;
|
||||
} else if (this.target.e((Entity) this) > 256.0D && this.e++ >= 30 && this.p(this.target)) {
|
||||
this.e = 0;
|
||||
this.bs = 0;
|
||||
} else if (this.target.e((Entity) this) > 256.0D && this.bs++ >= 30 && this.c(this.target)) {
|
||||
this.bs = 0;
|
||||
}
|
||||
} else {
|
||||
this.a(false);
|
||||
this.e = 0;
|
||||
this.bs = 0;
|
||||
}
|
||||
}
|
||||
|
||||
super.c();
|
||||
}
|
||||
|
||||
protected boolean m() {
|
||||
protected boolean bP() {
|
||||
double d0 = this.locX + (this.random.nextDouble() - 0.5D) * 64.0D;
|
||||
double d1 = this.locY + (double) (this.random.nextInt(64) - 32);
|
||||
double d2 = this.locZ + (this.random.nextDouble() - 0.5D) * 64.0D;
|
||||
@ -192,7 +205,7 @@ public class EntityEnderman extends EntityMonster {
|
||||
return this.j(d0, d1, d2);
|
||||
}
|
||||
|
||||
protected boolean p(Entity entity) {
|
||||
protected boolean c(Entity entity) {
|
||||
Vec3D vec3d = this.world.getVec3DPool().create(this.locX - entity.locX, this.boundingBox.b + (double) (this.length / 2.0F) - entity.locY + (double) entity.getHeadHeight(), this.locZ - entity.locZ);
|
||||
|
||||
vec3d = vec3d.a();
|
||||
@ -273,15 +286,15 @@ public class EntityEnderman extends EntityMonster {
|
||||
}
|
||||
}
|
||||
|
||||
protected String bb() {
|
||||
return this.q() ? "mob.endermen.scream" : "mob.endermen.idle";
|
||||
protected String r() {
|
||||
return this.bT() ? "mob.endermen.scream" : "mob.endermen.idle";
|
||||
}
|
||||
|
||||
protected String bc() {
|
||||
protected String aK() {
|
||||
return "mob.endermen.hit";
|
||||
}
|
||||
|
||||
protected String bd() {
|
||||
protected String aL() {
|
||||
return "mob.endermen.death";
|
||||
}
|
||||
|
||||
@ -322,32 +335,32 @@ public class EntityEnderman extends EntityMonster {
|
||||
return this.datawatcher.getByte(17);
|
||||
}
|
||||
|
||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||
public boolean damageEntity(DamageSource damagesource, float f) {
|
||||
if (this.isInvulnerable()) {
|
||||
return false;
|
||||
} else {
|
||||
this.a(true);
|
||||
if (damagesource instanceof EntityDamageSource && damagesource.getEntity() instanceof EntityHuman) {
|
||||
this.g = true;
|
||||
this.bv = true;
|
||||
}
|
||||
|
||||
if (damagesource instanceof EntityDamageSourceIndirect) {
|
||||
this.g = false;
|
||||
this.bv = false;
|
||||
|
||||
for (int j = 0; j < 64; ++j) {
|
||||
if (this.m()) {
|
||||
for (int i = 0; i < 64; ++i) {
|
||||
if (this.bP()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
} else {
|
||||
return super.damageEntity(damagesource, i);
|
||||
return super.damageEntity(damagesource, f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean q() {
|
||||
public boolean bT() {
|
||||
return this.datawatcher.getByte(18) > 0;
|
||||
}
|
||||
|
||||
@ -355,24 +368,20 @@ public class EntityEnderman extends EntityMonster {
|
||||
this.datawatcher.watch(18, Byte.valueOf((byte) (flag ? 1 : 0)));
|
||||
}
|
||||
|
||||
public int c(Entity entity) {
|
||||
return 7;
|
||||
}
|
||||
|
||||
static {
|
||||
d[Block.GRASS.id] = true;
|
||||
d[Block.DIRT.id] = true;
|
||||
d[Block.SAND.id] = true;
|
||||
d[Block.GRAVEL.id] = true;
|
||||
d[Block.YELLOW_FLOWER.id] = true;
|
||||
d[Block.RED_ROSE.id] = true;
|
||||
d[Block.BROWN_MUSHROOM.id] = true;
|
||||
d[Block.RED_MUSHROOM.id] = true;
|
||||
d[Block.TNT.id] = true;
|
||||
d[Block.CACTUS.id] = true;
|
||||
d[Block.CLAY.id] = true;
|
||||
d[Block.PUMPKIN.id] = true;
|
||||
d[Block.MELON.id] = true;
|
||||
d[Block.MYCEL.id] = true;
|
||||
br[Block.GRASS.id] = true;
|
||||
br[Block.DIRT.id] = true;
|
||||
br[Block.SAND.id] = true;
|
||||
br[Block.GRAVEL.id] = true;
|
||||
br[Block.YELLOW_FLOWER.id] = true;
|
||||
br[Block.RED_ROSE.id] = true;
|
||||
br[Block.BROWN_MUSHROOM.id] = true;
|
||||
br[Block.RED_MUSHROOM.id] = true;
|
||||
br[Block.TNT.id] = true;
|
||||
br[Block.CACTUS.id] = true;
|
||||
br[Block.CLAY.id] = true;
|
||||
br[Block.PUMPKIN.id] = true;
|
||||
br[Block.MELON.id] = true;
|
||||
br[Block.MYCEL.id] = true;
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import org.bukkit.event.entity.EntityTargetEvent;
|
||||
public class EntityExperienceOrb extends Entity {
|
||||
|
||||
public int a;
|
||||
public int b = 0;
|
||||
public int b;
|
||||
public int c;
|
||||
private int d = 5;
|
||||
public int value; // CraftBukkit - private -> public
|
||||
@ -27,7 +27,7 @@ public class EntityExperienceOrb extends Entity {
|
||||
this.value = i;
|
||||
}
|
||||
|
||||
protected boolean f_() {
|
||||
protected boolean e_() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -119,15 +119,15 @@ public class EntityExperienceOrb extends Entity {
|
||||
}
|
||||
|
||||
protected void burn(int i) {
|
||||
this.damageEntity(DamageSource.FIRE, i);
|
||||
this.damageEntity(DamageSource.FIRE, (float) i);
|
||||
}
|
||||
|
||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||
public boolean damageEntity(DamageSource damagesource, float f) {
|
||||
if (this.isInvulnerable()) {
|
||||
return false;
|
||||
} else {
|
||||
this.J();
|
||||
this.d -= i;
|
||||
this.d = (int) ((float) this.d - f);
|
||||
if (this.d <= 0) {
|
||||
this.die();
|
||||
}
|
||||
@ -150,8 +150,8 @@ public class EntityExperienceOrb extends Entity {
|
||||
|
||||
public void b_(EntityHuman entityhuman) {
|
||||
if (!this.world.isStatic) {
|
||||
if (this.c == 0 && entityhuman.bT == 0) {
|
||||
entityhuman.bT = 2;
|
||||
if (this.c == 0 && entityhuman.bv == 0) {
|
||||
entityhuman.bv = 2;
|
||||
this.makeSound("random.orb", 0.1F, 0.5F * ((this.random.nextFloat() - this.random.nextFloat()) * 0.7F + 1.8F));
|
||||
entityhuman.receive(this, 1);
|
||||
entityhuman.giveExp(CraftEventFactory.callPlayerExpChangeEvent(entityhuman, this.value).getAmount()); // CraftBukkit - this.value to event.getAmount()
|
||||
@ -187,7 +187,7 @@ 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)))))))));
|
||||
}
|
||||
|
||||
public boolean ap() {
|
||||
public boolean ao() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -22,13 +22,9 @@ public class EntityFallingBlock extends Entity {
|
||||
|
||||
public EntityFallingBlock(World world) {
|
||||
super(world);
|
||||
this.c = 0;
|
||||
this.dropItem = true;
|
||||
this.f = false;
|
||||
this.hurtEntities = false;
|
||||
this.fallHurtMax = 40;
|
||||
this.fallHurtAmount = 2.0F;
|
||||
this.tileEntityData = null;
|
||||
}
|
||||
|
||||
public EntityFallingBlock(World world, double d0, double d1, double d2, int i) {
|
||||
@ -37,13 +33,9 @@ public class EntityFallingBlock extends Entity {
|
||||
|
||||
public EntityFallingBlock(World world, double d0, double d1, double d2, int i, int j) {
|
||||
super(world);
|
||||
this.c = 0;
|
||||
this.dropItem = true;
|
||||
this.f = false;
|
||||
this.hurtEntities = false;
|
||||
this.fallHurtMax = 40;
|
||||
this.fallHurtAmount = 2.0F;
|
||||
this.tileEntityData = null;
|
||||
this.id = i;
|
||||
this.data = j;
|
||||
this.m = true;
|
||||
@ -58,7 +50,7 @@ public class EntityFallingBlock extends Entity {
|
||||
this.lastZ = d2;
|
||||
}
|
||||
|
||||
protected boolean f_() {
|
||||
protected boolean e_() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -150,7 +142,7 @@ public class EntityFallingBlock extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
protected void a(float f) {
|
||||
protected void b(float f) {
|
||||
if (this.hurtEntities) {
|
||||
int i = MathHelper.f(f - 1.0F);
|
||||
|
||||
@ -163,14 +155,14 @@ public class EntityFallingBlock extends Entity {
|
||||
Entity entity = (Entity) iterator.next();
|
||||
|
||||
// CraftBukkit start
|
||||
int damage = Math.min(MathHelper.d((float) i * this.fallHurtAmount), this.fallHurtMax);
|
||||
float damage = (float) Math.min(MathHelper.d((float) i * this.fallHurtAmount), this.fallHurtMax);
|
||||
|
||||
EntityDamageEvent event = CraftEventFactory.callEntityDamageEvent(this, entity, EntityDamageEvent.DamageCause.FALLING_BLOCK, damage);
|
||||
if (event.isCancelled()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
entity.damageEntity(damagesource, event.getDamage());
|
||||
entity.damageEntity(damagesource, (float) event.getDamage());
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
|
@ -7,11 +7,11 @@ public abstract class EntityFireball extends Entity {
|
||||
private int e = -1;
|
||||
private int f = -1;
|
||||
private int g = -1;
|
||||
private int h = 0;
|
||||
private boolean i = false;
|
||||
private int h;
|
||||
private boolean i;
|
||||
public EntityLiving shooter;
|
||||
private int j;
|
||||
private int au = 0;
|
||||
private int au;
|
||||
public double dirX;
|
||||
public double dirY;
|
||||
public double dirZ;
|
||||
@ -106,7 +106,7 @@ public abstract class EntityFireball extends Entity {
|
||||
for (int j = 0; j < list.size(); ++j) {
|
||||
Entity entity1 = (Entity) list.get(j);
|
||||
|
||||
if (entity1.K() && (!entity1.i(this.shooter) || this.au >= 25)) {
|
||||
if (entity1.K() && (!entity1.h(this.shooter) || this.au >= 25)) {
|
||||
float f = 0.3F;
|
||||
AxisAlignedBB axisalignedbb = entity1.boundingBox.grow((double) f, (double) f, (double) f);
|
||||
MovingObjectPosition movingobjectposition1 = axisalignedbb.a(vec3d, vec3d1);
|
||||
@ -227,7 +227,7 @@ public abstract class EntityFireball extends Entity {
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||
public boolean damageEntity(DamageSource damagesource, float f) {
|
||||
if (this.isInvulnerable()) {
|
||||
return false;
|
||||
} else {
|
||||
@ -255,7 +255,7 @@ public abstract class EntityFireball extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
public float c(float f) {
|
||||
public float d(float f) {
|
||||
return 1.0F;
|
||||
}
|
||||
}
|
||||
|
@ -111,11 +111,11 @@ public class EntityFireworks extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
public float c(float f) {
|
||||
return super.c(f);
|
||||
public float d(float f) {
|
||||
return super.d(f);
|
||||
}
|
||||
|
||||
public boolean ap() {
|
||||
public boolean ao() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -13,14 +13,14 @@ public class EntityFishingHook extends Entity {
|
||||
private int d = -1;
|
||||
private int e = -1;
|
||||
private int f = -1;
|
||||
private int g = 0;
|
||||
private boolean h = false;
|
||||
public int a = 0;
|
||||
private int g;
|
||||
private boolean h;
|
||||
public int a;
|
||||
public EntityHuman owner;
|
||||
private int i;
|
||||
private int j = 0;
|
||||
private int au = 0;
|
||||
public Entity hooked = null;
|
||||
private int j;
|
||||
private int au;
|
||||
public Entity hooked;
|
||||
private int av;
|
||||
private double aw;
|
||||
private double ax;
|
||||
@ -93,7 +93,7 @@ public class EntityFishingHook extends Entity {
|
||||
this.b(this.yaw, this.pitch);
|
||||
} else {
|
||||
if (!this.world.isStatic) {
|
||||
ItemStack itemstack = this.owner.cd();
|
||||
ItemStack itemstack = this.owner.bt();
|
||||
|
||||
if (this.owner.dead || !this.owner.isAlive() || itemstack == null || itemstack.getItem() != Item.FISHING_ROD || this.e(this.owner) > 1024.0D) {
|
||||
this.die();
|
||||
@ -180,7 +180,7 @@ public class EntityFishingHook extends Entity {
|
||||
if (movingobjectposition != null) {
|
||||
org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this); // Craftbukkit - Call event
|
||||
if (movingobjectposition.entity != null) {
|
||||
if (movingobjectposition.entity.damageEntity(DamageSource.projectile(this, this.owner), 0)) {
|
||||
if (movingobjectposition.entity.damageEntity(DamageSource.projectile(this, this.owner), 0.0F)) {
|
||||
this.hooked = movingobjectposition.entity;
|
||||
}
|
||||
} else {
|
||||
|
@ -8,33 +8,32 @@ import org.bukkit.event.entity.EntityTargetEvent;
|
||||
|
||||
public class EntityGhast extends EntityFlying implements IMonster {
|
||||
|
||||
public int b = 0;
|
||||
public double c;
|
||||
public double d;
|
||||
public double e;
|
||||
private Entity target = null;
|
||||
private int i = 0;
|
||||
public int f = 0;
|
||||
public int g = 0;
|
||||
public int h;
|
||||
public double i;
|
||||
public double j;
|
||||
public double bn;
|
||||
private Entity target;
|
||||
private int br;
|
||||
public int bo;
|
||||
public int bp;
|
||||
private int explosionPower = 1;
|
||||
|
||||
public EntityGhast(World world) {
|
||||
super(world);
|
||||
this.texture = "/mob/ghast.png";
|
||||
this.a(4.0F, 4.0F);
|
||||
this.fireProof = true;
|
||||
this.be = 5;
|
||||
this.b = 5;
|
||||
}
|
||||
|
||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||
public boolean damageEntity(DamageSource damagesource, float f) {
|
||||
if (this.isInvulnerable()) {
|
||||
return false;
|
||||
} else if ("fireball".equals(damagesource.n()) && damagesource.getEntity() instanceof EntityHuman) {
|
||||
super.damageEntity(damagesource, 1000);
|
||||
super.damageEntity(damagesource, 1000.0F);
|
||||
((EntityHuman) damagesource.getEntity()).a((Statistic) AchievementList.y);
|
||||
return true;
|
||||
} else {
|
||||
return super.damageEntity(damagesource, i);
|
||||
return super.damageEntity(damagesource, f);
|
||||
}
|
||||
}
|
||||
|
||||
@ -43,46 +42,40 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
this.datawatcher.a(16, Byte.valueOf((byte) 0));
|
||||
}
|
||||
|
||||
public int getMaxHealth() {
|
||||
return 10;
|
||||
protected void ax() {
|
||||
super.ax();
|
||||
this.a(GenericAttributes.a).a(10.0D);
|
||||
}
|
||||
|
||||
public void l_() {
|
||||
super.l_();
|
||||
byte b0 = this.datawatcher.getByte(16);
|
||||
|
||||
this.texture = b0 == 1 ? "/mob/ghast_fire.png" : "/mob/ghast.png";
|
||||
}
|
||||
|
||||
protected void bq() {
|
||||
protected void bh() {
|
||||
if (!this.world.isStatic && this.world.difficulty == 0) {
|
||||
this.die();
|
||||
}
|
||||
|
||||
this.bn();
|
||||
this.f = this.g;
|
||||
double d0 = this.c - this.locX;
|
||||
double d1 = this.d - this.locY;
|
||||
double d2 = this.e - this.locZ;
|
||||
this.bk();
|
||||
this.bo = this.bp;
|
||||
double d0 = this.i - this.locX;
|
||||
double d1 = this.j - this.locY;
|
||||
double d2 = this.bn - this.locZ;
|
||||
double d3 = d0 * d0 + d1 * d1 + d2 * d2;
|
||||
|
||||
if (d3 < 1.0D || d3 > 3600.0D) {
|
||||
this.c = this.locX + (double) ((this.random.nextFloat() * 2.0F - 1.0F) * 16.0F);
|
||||
this.d = this.locY + (double) ((this.random.nextFloat() * 2.0F - 1.0F) * 16.0F);
|
||||
this.e = this.locZ + (double) ((this.random.nextFloat() * 2.0F - 1.0F) * 16.0F);
|
||||
this.i = this.locX + (double) ((this.random.nextFloat() * 2.0F - 1.0F) * 16.0F);
|
||||
this.j = this.locY + (double) ((this.random.nextFloat() * 2.0F - 1.0F) * 16.0F);
|
||||
this.bn = this.locZ + (double) ((this.random.nextFloat() * 2.0F - 1.0F) * 16.0F);
|
||||
}
|
||||
|
||||
if (this.b-- <= 0) {
|
||||
this.b += this.random.nextInt(5) + 2;
|
||||
if (this.h-- <= 0) {
|
||||
this.h += this.random.nextInt(5) + 2;
|
||||
d3 = (double) MathHelper.sqrt(d3);
|
||||
if (this.a(this.c, this.d, this.e, d3)) {
|
||||
if (this.a(this.i, this.j, this.bn, d3)) {
|
||||
this.motX += d0 / d3 * 0.1D;
|
||||
this.motY += d1 / d3 * 0.1D;
|
||||
this.motZ += d2 / d3 * 0.1D;
|
||||
} else {
|
||||
this.c = this.locX;
|
||||
this.d = this.locY;
|
||||
this.e = this.locZ;
|
||||
this.i = this.locX;
|
||||
this.j = this.locY;
|
||||
this.bn = this.locZ;
|
||||
}
|
||||
}
|
||||
|
||||
@ -101,7 +94,7 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
if (this.target == null || this.i-- <= 0) {
|
||||
if (this.target == null || this.br-- <= 0) {
|
||||
// CraftBukkit start
|
||||
Entity target = this.world.findNearbyVulnerablePlayer(this, 100.0D);
|
||||
if (target != null) {
|
||||
@ -119,7 +112,7 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
// CraftBukkit end
|
||||
|
||||
if (this.target != null) {
|
||||
this.i = 20;
|
||||
this.br = 20;
|
||||
}
|
||||
}
|
||||
|
||||
@ -130,41 +123,41 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
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;
|
||||
|
||||
this.ay = this.yaw = -((float) Math.atan2(d5, d7)) * 180.0F / 3.1415927F;
|
||||
if (this.n(this.target)) {
|
||||
if (this.g == 10) {
|
||||
this.aN = this.yaw = -((float) Math.atan2(d5, d7)) * 180.0F / 3.1415927F;
|
||||
if (this.o(this.target)) {
|
||||
if (this.bp == 10) {
|
||||
this.world.a((EntityHuman) null, 1007, (int) this.locX, (int) this.locY, (int) this.locZ, 0);
|
||||
}
|
||||
|
||||
++this.g;
|
||||
if (this.g == 20) {
|
||||
++this.bp;
|
||||
if (this.bp == 20) {
|
||||
this.world.a((EntityHuman) null, 1008, (int) this.locX, (int) this.locY, (int) this.locZ, 0);
|
||||
EntityLargeFireball entitylargefireball = new EntityLargeFireball(this.world, this, d5, d6, d7);
|
||||
|
||||
// CraftBukkit - set yield when setting explosionpower
|
||||
entitylargefireball.yield = entitylargefireball.e = this.explosionPower;
|
||||
double d8 = 4.0D;
|
||||
Vec3D vec3d = this.i(1.0F);
|
||||
Vec3D vec3d = this.j(1.0F);
|
||||
|
||||
entitylargefireball.locX = this.locX + vec3d.c * d8;
|
||||
entitylargefireball.locY = this.locY + (double) (this.length / 2.0F) + 0.5D;
|
||||
entitylargefireball.locZ = this.locZ + vec3d.e * d8;
|
||||
this.world.addEntity(entitylargefireball);
|
||||
this.g = -40;
|
||||
this.bp = -40;
|
||||
}
|
||||
} else if (this.g > 0) {
|
||||
--this.g;
|
||||
} else if (this.bp > 0) {
|
||||
--this.bp;
|
||||
}
|
||||
} else {
|
||||
this.ay = this.yaw = -((float) Math.atan2(this.motX, this.motZ)) * 180.0F / 3.1415927F;
|
||||
if (this.g > 0) {
|
||||
--this.g;
|
||||
this.aN = this.yaw = -((float) Math.atan2(this.motX, this.motZ)) * 180.0F / 3.1415927F;
|
||||
if (this.bp > 0) {
|
||||
--this.bp;
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.world.isStatic) {
|
||||
byte b0 = this.datawatcher.getByte(16);
|
||||
byte b1 = (byte) (this.g > 10 ? 1 : 0);
|
||||
byte b1 = (byte) (this.bp > 10 ? 1 : 0);
|
||||
|
||||
if (b0 != b1) {
|
||||
this.datawatcher.watch(16, Byte.valueOf(b1));
|
||||
@ -173,9 +166,9 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
}
|
||||
|
||||
private boolean a(double d0, double d1, double d2, double d3) {
|
||||
double d4 = (this.c - this.locX) / d3;
|
||||
double d5 = (this.d - this.locY) / d3;
|
||||
double d6 = (this.e - this.locZ) / d3;
|
||||
double d4 = (this.i - this.locX) / d3;
|
||||
double d5 = (this.j - this.locY) / d3;
|
||||
double d6 = (this.bn - this.locZ) / d3;
|
||||
AxisAlignedBB axisalignedbb = this.boundingBox.clone();
|
||||
|
||||
for (int i = 1; (double) i < d3; ++i) {
|
||||
@ -188,15 +181,15 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected String bb() {
|
||||
protected String r() {
|
||||
return "mob.ghast.moan";
|
||||
}
|
||||
|
||||
protected String bc() {
|
||||
protected String aK() {
|
||||
return "mob.ghast.scream";
|
||||
}
|
||||
|
||||
protected String bd() {
|
||||
protected String aL() {
|
||||
return "mob.ghast.death";
|
||||
}
|
||||
|
||||
@ -225,7 +218,7 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
protected float ba() {
|
||||
protected float aW() {
|
||||
return 10.0F;
|
||||
}
|
||||
|
||||
@ -233,7 +226,7 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
return this.random.nextInt(20) == 0 && super.canSpawn() && this.world.difficulty > 0;
|
||||
}
|
||||
|
||||
public int by() {
|
||||
public int br() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -20,8 +20,6 @@ public abstract class EntityHanging extends Entity {
|
||||
|
||||
public EntityHanging(World world) {
|
||||
super(world);
|
||||
this.e = 0;
|
||||
this.direction = 0;
|
||||
this.height = 0.0F;
|
||||
this.a(0.5F, 0.5F);
|
||||
}
|
||||
@ -39,7 +37,7 @@ public abstract class EntityHanging extends Entity {
|
||||
this.direction = i;
|
||||
this.lastYaw = this.yaw = (float) (i * 90);
|
||||
float f = (float) this.d();
|
||||
float f1 = (float) this.g();
|
||||
float f1 = (float) this.e();
|
||||
float f2 = (float) this.d();
|
||||
|
||||
if (i != 2 && i != 0) {
|
||||
@ -74,33 +72,36 @@ public abstract class EntityHanging extends Entity {
|
||||
}
|
||||
|
||||
if (i == 2) {
|
||||
f3 -= this.b(this.d());
|
||||
f3 -= this.c(this.d());
|
||||
}
|
||||
|
||||
if (i == 1) {
|
||||
f5 += this.b(this.d());
|
||||
f5 += this.c(this.d());
|
||||
}
|
||||
|
||||
if (i == 0) {
|
||||
f3 += this.b(this.d());
|
||||
f3 += this.c(this.d());
|
||||
}
|
||||
|
||||
if (i == 3) {
|
||||
f5 -= this.b(this.d());
|
||||
f5 -= this.c(this.d());
|
||||
}
|
||||
|
||||
f4 += this.b(this.g());
|
||||
f4 += this.c(this.e());
|
||||
this.setPosition((double) f3, (double) f4, (double) f5);
|
||||
float f7 = -0.03125F;
|
||||
|
||||
this.boundingBox.b((double) (f3 - f - f7), (double) (f4 - f1 - f7), (double) (f5 - f2 - f7), (double) (f3 + f + f7), (double) (f4 + f1 + f7), (double) (f5 + f2 + f7));
|
||||
}
|
||||
|
||||
private float b(int i) {
|
||||
private float c(int i) {
|
||||
return i == 32 ? 0.5F : (i == 64 ? 0.5F : 0.0F);
|
||||
}
|
||||
|
||||
public void l_() {
|
||||
this.lastX = this.locX;
|
||||
this.lastY = this.locY;
|
||||
this.lastZ = this.locZ;
|
||||
if (this.e++ == 100 && !this.world.isStatic) {
|
||||
this.e = 0;
|
||||
if (!this.dead && !this.survives()) {
|
||||
@ -132,7 +133,7 @@ public abstract class EntityHanging extends Entity {
|
||||
// CraftBukkit end
|
||||
|
||||
this.die();
|
||||
this.h();
|
||||
this.b((Entity) null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -142,7 +143,7 @@ public abstract class EntityHanging extends Entity {
|
||||
return false;
|
||||
} else {
|
||||
int i = Math.max(1, this.d() / 16);
|
||||
int j = Math.max(1, this.g() / 16);
|
||||
int j = Math.max(1, this.e() / 16);
|
||||
int k = this.x;
|
||||
int l = this.y;
|
||||
int i1 = this.z;
|
||||
@ -163,7 +164,7 @@ public abstract class EntityHanging extends Entity {
|
||||
i1 = MathHelper.floor(this.locZ - (double) ((float) this.d() / 32.0F));
|
||||
}
|
||||
|
||||
l = MathHelper.floor(this.locY - (double) ((float) this.g() / 32.0F));
|
||||
l = MathHelper.floor(this.locY - (double) ((float) this.e() / 32.0F));
|
||||
|
||||
for (int j1 = 0; j1 < i; ++j1) {
|
||||
for (int k1 = 0; k1 < j; ++k1) {
|
||||
@ -202,11 +203,11 @@ public abstract class EntityHanging extends Entity {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean j(Entity entity) {
|
||||
return entity instanceof EntityHuman ? this.damageEntity(DamageSource.playerAttack((EntityHuman) entity), 0) : false;
|
||||
public boolean i(Entity entity) {
|
||||
return entity instanceof EntityHuman ? this.damageEntity(DamageSource.playerAttack((EntityHuman) entity), 0.0F) : false;
|
||||
}
|
||||
|
||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||
public boolean damageEntity(DamageSource damagesource, float f) {
|
||||
if (this.isInvulnerable()) {
|
||||
return false;
|
||||
} else {
|
||||
@ -239,17 +240,7 @@ public abstract class EntityHanging extends Entity {
|
||||
|
||||
this.die();
|
||||
this.J();
|
||||
EntityHuman entityhuman = null;
|
||||
|
||||
if (damagesource.getEntity() instanceof EntityHuman) {
|
||||
entityhuman = (EntityHuman) damagesource.getEntity();
|
||||
}
|
||||
|
||||
if (entityhuman != null && entityhuman.abilities.canInstantlyBuild) {
|
||||
return true;
|
||||
}
|
||||
|
||||
this.h();
|
||||
this.b(damagesource.getEntity());
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -261,14 +252,14 @@ public abstract class EntityHanging extends Entity {
|
||||
if (dead) return; // CraftBukkit
|
||||
|
||||
this.die();
|
||||
this.h();
|
||||
this.b((Entity) null);
|
||||
}
|
||||
}
|
||||
|
||||
public void g(double d0, double d1, double d2) {
|
||||
if (false && !this.world.isStatic && !this.dead && d0 * d0 + d1 * d1 + d2 * d2 > 0.0D) { // CraftBukkit - not needed
|
||||
this.die();
|
||||
this.h();
|
||||
this.b((Entity) null);
|
||||
}
|
||||
}
|
||||
|
||||
@ -325,7 +316,7 @@ public abstract class EntityHanging extends Entity {
|
||||
|
||||
public abstract int d();
|
||||
|
||||
public abstract int g();
|
||||
public abstract int e();
|
||||
|
||||
public abstract void h();
|
||||
public abstract void b(Entity entity);
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
884
src/main/java/net/minecraft/server/EntityInsentient.java
Normal file
884
src/main/java/net/minecraft/server/EntityInsentient.java
Normal file
@ -0,0 +1,884 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
//CraftBukkit start
|
||||
import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
import org.bukkit.event.entity.EntityDamageByBlockEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.event.entity.EntityRegainHealthEvent;
|
||||
//CraftBukkit end
|
||||
|
||||
public abstract class EntityInsentient extends EntityLiving {
|
||||
|
||||
public int a_;
|
||||
protected int b;
|
||||
private ControllerLook h;
|
||||
private ControllerMove moveController;
|
||||
private ControllerJump lookController;
|
||||
private EntityAIBodyControl bn;
|
||||
private Navigation navigation;
|
||||
protected final PathfinderGoalSelector goalSelector;
|
||||
protected final PathfinderGoalSelector targetSelector;
|
||||
private EntityLiving goalTarget;
|
||||
private EntitySenses bq;
|
||||
private ItemStack[] equipment = new ItemStack[5];
|
||||
public float[] dropChances = new float[5]; // CraftBukkit - protected -> public
|
||||
public boolean canPickUpLoot; // CraftBukkit - private -> public
|
||||
public boolean persistent; // CraftBukkit - private -> public
|
||||
protected float f;
|
||||
private Entity bu;
|
||||
protected int g;
|
||||
private boolean bv;
|
||||
private Entity bw;
|
||||
private NBTTagCompound bx;
|
||||
|
||||
public EntityInsentient(World world) {
|
||||
super(world);
|
||||
this.goalSelector = new PathfinderGoalSelector(world != null && world.methodProfiler != null ? world.methodProfiler : null);
|
||||
this.targetSelector = new PathfinderGoalSelector(world != null && world.methodProfiler != null ? world.methodProfiler : null);
|
||||
this.h = new ControllerLook(this);
|
||||
this.moveController = new ControllerMove(this);
|
||||
this.lookController = new ControllerJump(this);
|
||||
this.bn = new EntityAIBodyControl(this);
|
||||
this.navigation = new Navigation(this, world);
|
||||
this.bq = new EntitySenses(this);
|
||||
|
||||
for (int i = 0; i < this.dropChances.length; ++i) {
|
||||
this.dropChances[i] = 0.085F;
|
||||
}
|
||||
}
|
||||
|
||||
protected void ax() {
|
||||
super.ax();
|
||||
this.aT().b(GenericAttributes.b).a(16.0D);
|
||||
}
|
||||
|
||||
public ControllerLook getControllerLook() {
|
||||
return this.h;
|
||||
}
|
||||
|
||||
public ControllerMove getControllerMove() {
|
||||
return this.moveController;
|
||||
}
|
||||
|
||||
public ControllerJump getControllerJump() {
|
||||
return this.lookController;
|
||||
}
|
||||
|
||||
public Navigation getNavigation() {
|
||||
return this.navigation;
|
||||
}
|
||||
|
||||
public EntitySenses getEntitySenses() {
|
||||
return this.bq;
|
||||
}
|
||||
|
||||
public EntityLiving getGoalTarget() {
|
||||
return this.goalTarget;
|
||||
}
|
||||
|
||||
public void setGoalTarget(EntityLiving entityliving) {
|
||||
this.goalTarget = entityliving;
|
||||
}
|
||||
|
||||
public boolean a(Class oclass) {
|
||||
return EntityCreeper.class != oclass && EntityGhast.class != oclass;
|
||||
}
|
||||
|
||||
public void n() {}
|
||||
|
||||
protected void a() {
|
||||
super.a();
|
||||
this.datawatcher.a(11, Byte.valueOf((byte) 0));
|
||||
this.datawatcher.a(10, "");
|
||||
}
|
||||
|
||||
public int o() {
|
||||
return 80;
|
||||
}
|
||||
|
||||
public void p() {
|
||||
String s = this.r();
|
||||
|
||||
if (s != null) {
|
||||
this.makeSound(s, this.aW(), this.aX());
|
||||
}
|
||||
}
|
||||
|
||||
public void x() {
|
||||
super.x();
|
||||
this.world.methodProfiler.a("mobBaseTick");
|
||||
if (this.isAlive() && this.random.nextInt(1000) < this.a_++) {
|
||||
this.a_ = -this.o();
|
||||
this.p();
|
||||
}
|
||||
|
||||
this.world.methodProfiler.b();
|
||||
}
|
||||
|
||||
protected int getExpValue(EntityHuman entityhuman) {
|
||||
if (this.b > 0) {
|
||||
int i = this.b;
|
||||
ItemStack[] aitemstack = this.getEquipment();
|
||||
|
||||
for (int j = 0; j < aitemstack.length; ++j) {
|
||||
if (aitemstack[j] != null && this.dropChances[j] <= 1.0F) {
|
||||
i += 1 + this.random.nextInt(3);
|
||||
}
|
||||
}
|
||||
|
||||
return i;
|
||||
} else {
|
||||
return this.b;
|
||||
}
|
||||
}
|
||||
|
||||
public void q() {
|
||||
for (int i = 0; i < 20; ++i) {
|
||||
double d0 = this.random.nextGaussian() * 0.02D;
|
||||
double d1 = this.random.nextGaussian() * 0.02D;
|
||||
double d2 = this.random.nextGaussian() * 0.02D;
|
||||
double d3 = 10.0D;
|
||||
|
||||
this.world.addParticle("explode", this.locX + (double) (this.random.nextFloat() * this.width * 2.0F) - (double) this.width - d0 * d3, this.locY + (double) (this.random.nextFloat() * this.length) - d1 * d3, this.locZ + (double) (this.random.nextFloat() * this.width * 2.0F) - (double) this.width - d2 * d3, d0, d1, d2);
|
||||
}
|
||||
}
|
||||
|
||||
public void l_() {
|
||||
super.l_();
|
||||
if (!this.world.isStatic) {
|
||||
this.bB();
|
||||
}
|
||||
}
|
||||
|
||||
protected float f(float f, float f1) {
|
||||
if (this.bb()) {
|
||||
this.bn.a();
|
||||
return f1;
|
||||
} else {
|
||||
return super.f(f, f1);
|
||||
}
|
||||
}
|
||||
|
||||
protected String r() {
|
||||
return null;
|
||||
}
|
||||
|
||||
protected int getLootId() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected void dropDeathLoot(boolean flag, int i) {
|
||||
// CraftBukkit start - Whole method
|
||||
List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>();
|
||||
int j = this.getLootId();
|
||||
|
||||
if (j > 0) {
|
||||
int k = this.random.nextInt(3);
|
||||
|
||||
if (i > 0) {
|
||||
k += this.random.nextInt(i + 1);
|
||||
}
|
||||
|
||||
if (k > 0) {
|
||||
loot.add(new org.bukkit.inventory.ItemStack(j, k));
|
||||
}
|
||||
}
|
||||
|
||||
// Determine rare item drops and add them to the loot
|
||||
if (this.lastDamageByPlayerTime > 0) {
|
||||
int k = this.random.nextInt(200) - i;
|
||||
|
||||
if (k < 5) {
|
||||
ItemStack itemstack = this.l(k <= 0 ? 1 : 0);
|
||||
if (itemstack != null) {
|
||||
loot.add(org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemstack));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CraftEventFactory.callEntityDeathEvent(this, loot); // raise event even for those times when the entity does not drop loot
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
public void b(NBTTagCompound nbttagcompound) {
|
||||
super.b(nbttagcompound);
|
||||
nbttagcompound.setBoolean("CanPickUpLoot", this.bz());
|
||||
nbttagcompound.setBoolean("PersistenceRequired", this.persistent);
|
||||
NBTTagList nbttaglist = new NBTTagList();
|
||||
|
||||
NBTTagCompound nbttagcompound1;
|
||||
|
||||
for (int i = 0; i < this.equipment.length; ++i) {
|
||||
nbttagcompound1 = new NBTTagCompound();
|
||||
if (this.equipment[i] != null) {
|
||||
this.equipment[i].save(nbttagcompound1);
|
||||
}
|
||||
|
||||
nbttaglist.add(nbttagcompound1);
|
||||
}
|
||||
|
||||
nbttagcompound.set("Equipment", nbttaglist);
|
||||
NBTTagList nbttaglist1 = new NBTTagList();
|
||||
|
||||
for (int j = 0; j < this.dropChances.length; ++j) {
|
||||
nbttaglist1.add(new NBTTagFloat(j + "", this.dropChances[j]));
|
||||
}
|
||||
|
||||
nbttagcompound.set("DropChances", nbttaglist1);
|
||||
nbttagcompound.setString("CustomName", this.getCustomName());
|
||||
nbttagcompound.setBoolean("CustomNameVisible", this.getCustomNameVisible());
|
||||
nbttagcompound.setBoolean("Leashed", this.bv);
|
||||
if (this.bw != null) {
|
||||
nbttagcompound1 = new NBTTagCompound("Leash");
|
||||
if (this.bw instanceof EntityLiving) {
|
||||
nbttagcompound1.setLong("UUIDMost", this.bw.getUniqueID().getMostSignificantBits());
|
||||
nbttagcompound1.setLong("UUIDLeast", this.bw.getUniqueID().getLeastSignificantBits());
|
||||
} else if (this.bw instanceof EntityHanging) {
|
||||
EntityHanging entityhanging = (EntityHanging) this.bw;
|
||||
|
||||
nbttagcompound1.setInt("X", entityhanging.x);
|
||||
nbttagcompound1.setInt("Y", entityhanging.y);
|
||||
nbttagcompound1.setInt("Z", entityhanging.z);
|
||||
}
|
||||
|
||||
nbttagcompound.set("Leash", nbttagcompound1);
|
||||
}
|
||||
}
|
||||
|
||||
public void a(NBTTagCompound nbttagcompound) {
|
||||
super.a(nbttagcompound);
|
||||
this.h(nbttagcompound.getBoolean("CanPickUpLoot"));
|
||||
this.persistent = nbttagcompound.getBoolean("PersistenceRequired");
|
||||
|
||||
// CraftBukkit start - If looting or persistence is false only use it if it was set after we started using it
|
||||
boolean data = nbttagcompound.getBoolean("CanPickUpLoot");
|
||||
if (isLevelAtLeast(nbttagcompound, 1) || data) {
|
||||
this.canPickUpLoot = data;
|
||||
}
|
||||
|
||||
data = nbttagcompound.getBoolean("PersistenceRequired");
|
||||
if (isLevelAtLeast(nbttagcompound, 1) || data) {
|
||||
this.persistent = data;
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
if (nbttagcompound.hasKey("CustomName") && nbttagcompound.getString("CustomName").length() > 0) {
|
||||
this.setCustomName(nbttagcompound.getString("CustomName"));
|
||||
}
|
||||
|
||||
this.setCustomNameVisible(nbttagcompound.getBoolean("CustomNameVisible"));
|
||||
NBTTagList nbttaglist;
|
||||
int i;
|
||||
|
||||
if (nbttagcompound.hasKey("Equipment")) {
|
||||
nbttaglist = nbttagcompound.getList("Equipment");
|
||||
|
||||
for (i = 0; i < this.equipment.length; ++i) {
|
||||
this.equipment[i] = ItemStack.createStack((NBTTagCompound) nbttaglist.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
if (nbttagcompound.hasKey("DropChances")) {
|
||||
nbttaglist = nbttagcompound.getList("DropChances");
|
||||
|
||||
for (i = 0; i < nbttaglist.size(); ++i) {
|
||||
this.dropChances[i] = ((NBTTagFloat) nbttaglist.get(i)).data;
|
||||
}
|
||||
}
|
||||
|
||||
this.bv = nbttagcompound.getBoolean("Leashed");
|
||||
if (this.bv && nbttagcompound.hasKey("Leash")) {
|
||||
this.bx = nbttagcompound.getCompound("Leash");
|
||||
}
|
||||
}
|
||||
|
||||
public void n(float f) {
|
||||
this.bf = f;
|
||||
}
|
||||
|
||||
public void i(float f) {
|
||||
super.i(f);
|
||||
this.n(f);
|
||||
}
|
||||
|
||||
public void c() {
|
||||
super.c();
|
||||
this.world.methodProfiler.a("looting");
|
||||
if (!this.world.isStatic && this.bz() && !this.aU && this.world.getGameRules().getBoolean("mobGriefing")) {
|
||||
List list = this.world.a(EntityItem.class, this.boundingBox.grow(1.0D, 0.0D, 1.0D));
|
||||
Iterator iterator = list.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
EntityItem entityitem = (EntityItem) iterator.next();
|
||||
|
||||
if (!entityitem.dead && entityitem.getItemStack() != null) {
|
||||
ItemStack itemstack = entityitem.getItemStack();
|
||||
int i = b(itemstack);
|
||||
|
||||
if (i > -1) {
|
||||
boolean flag = true;
|
||||
ItemStack itemstack1 = this.getEquipment(i);
|
||||
|
||||
if (itemstack1 != null) {
|
||||
if (i == 0) {
|
||||
if (itemstack.getItem() instanceof ItemSword && !(itemstack1.getItem() instanceof ItemSword)) {
|
||||
flag = true;
|
||||
} else if (itemstack.getItem() instanceof ItemSword && itemstack1.getItem() instanceof ItemSword) {
|
||||
ItemSword itemsword = (ItemSword) itemstack.getItem();
|
||||
ItemSword itemsword1 = (ItemSword) itemstack1.getItem();
|
||||
|
||||
if (itemsword.g() == itemsword1.g()) {
|
||||
flag = itemstack.getData() > itemstack1.getData() || itemstack.hasTag() && !itemstack1.hasTag();
|
||||
} else {
|
||||
flag = itemsword.g() > itemsword1.g();
|
||||
}
|
||||
} else {
|
||||
flag = false;
|
||||
}
|
||||
} else if (itemstack.getItem() instanceof ItemArmor && !(itemstack1.getItem() instanceof ItemArmor)) {
|
||||
flag = true;
|
||||
} else if (itemstack.getItem() instanceof ItemArmor && itemstack1.getItem() instanceof ItemArmor) {
|
||||
ItemArmor itemarmor = (ItemArmor) itemstack.getItem();
|
||||
ItemArmor itemarmor1 = (ItemArmor) itemstack1.getItem();
|
||||
|
||||
if (itemarmor.c == itemarmor1.c) {
|
||||
flag = itemstack.getData() > itemstack1.getData() || itemstack.hasTag() && !itemstack1.hasTag();
|
||||
} else {
|
||||
flag = itemarmor.c > itemarmor1.c;
|
||||
}
|
||||
} else {
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (flag) {
|
||||
if (itemstack1 != null && this.random.nextFloat() - 0.1F < this.dropChances[i]) {
|
||||
this.a(itemstack1, 0.0F);
|
||||
}
|
||||
|
||||
this.setEquipment(i, itemstack);
|
||||
this.dropChances[i] = 2.0F;
|
||||
this.persistent = true;
|
||||
this.receive(entityitem, 1);
|
||||
entityitem.die();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.world.methodProfiler.b();
|
||||
}
|
||||
|
||||
protected boolean bb() {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected boolean isTypeNotPersistent() {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void bk() {
|
||||
if (this.persistent) {
|
||||
this.aV = 0;
|
||||
} else {
|
||||
EntityHuman entityhuman = this.world.findNearbyPlayer(this, -1.0D);
|
||||
|
||||
if (entityhuman != null) {
|
||||
double d0 = entityhuman.locX - this.locX;
|
||||
double d1 = entityhuman.locY - this.locY;
|
||||
double d2 = entityhuman.locZ - this.locZ;
|
||||
double d3 = d0 * d0 + d1 * d1 + d2 * d2;
|
||||
|
||||
if (d3 > 16384.0D) { // CraftBukkit - remove isTypeNotPersistent() check
|
||||
this.die();
|
||||
}
|
||||
|
||||
if (this.aV > 600 && this.random.nextInt(800) == 0 && d3 > 1024.0D) { // CraftBukkit - remove isTypeNotPersistent() check
|
||||
this.die();
|
||||
} else if (d3 < 1024.0D) {
|
||||
this.aV = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void be() {
|
||||
++this.aV;
|
||||
this.world.methodProfiler.a("checkDespawn");
|
||||
this.bk();
|
||||
this.world.methodProfiler.b();
|
||||
this.world.methodProfiler.a("sensing");
|
||||
this.bq.a();
|
||||
this.world.methodProfiler.b();
|
||||
this.world.methodProfiler.a("targetSelector");
|
||||
this.targetSelector.a();
|
||||
this.world.methodProfiler.b();
|
||||
this.world.methodProfiler.a("goalSelector");
|
||||
this.goalSelector.a();
|
||||
this.world.methodProfiler.b();
|
||||
this.world.methodProfiler.a("navigation");
|
||||
this.navigation.f();
|
||||
this.world.methodProfiler.b();
|
||||
this.world.methodProfiler.a("mob tick");
|
||||
this.bg();
|
||||
this.world.methodProfiler.b();
|
||||
this.world.methodProfiler.a("controls");
|
||||
this.world.methodProfiler.a("move");
|
||||
this.moveController.c();
|
||||
this.world.methodProfiler.c("look");
|
||||
this.h.a();
|
||||
this.world.methodProfiler.c("jump");
|
||||
this.lookController.b();
|
||||
this.world.methodProfiler.b();
|
||||
this.world.methodProfiler.b();
|
||||
}
|
||||
|
||||
protected void bh() {
|
||||
super.bh();
|
||||
this.be = 0.0F;
|
||||
this.bf = 0.0F;
|
||||
this.bk();
|
||||
float f = 8.0F;
|
||||
|
||||
if (this.random.nextFloat() < 0.02F) {
|
||||
EntityHuman entityhuman = this.world.findNearbyPlayer(this, (double) f);
|
||||
|
||||
if (entityhuman != null) {
|
||||
this.bu = entityhuman;
|
||||
this.g = 10 + this.random.nextInt(20);
|
||||
} else {
|
||||
this.bg = (this.random.nextFloat() - 0.5F) * 20.0F;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.bu != null) {
|
||||
this.a(this.bu, 10.0F, (float) this.bl());
|
||||
if (this.g-- <= 0 || this.bu.dead || this.bu.e((Entity) this) > (double) (f * f)) {
|
||||
this.bu = null;
|
||||
}
|
||||
} else {
|
||||
if (this.random.nextFloat() < 0.05F) {
|
||||
this.bg = (this.random.nextFloat() - 0.5F) * 20.0F;
|
||||
}
|
||||
|
||||
this.yaw += this.bg;
|
||||
this.pitch = this.f;
|
||||
}
|
||||
|
||||
boolean flag = this.G();
|
||||
boolean flag1 = this.I();
|
||||
|
||||
if (flag || flag1) {
|
||||
this.bd = this.random.nextFloat() < 0.8F;
|
||||
}
|
||||
}
|
||||
|
||||
public int bl() {
|
||||
return 40;
|
||||
}
|
||||
|
||||
public void a(Entity entity, float f, float f1) {
|
||||
double d0 = entity.locX - this.locX;
|
||||
double d1 = entity.locZ - this.locZ;
|
||||
double d2;
|
||||
|
||||
if (entity instanceof EntityLiving) {
|
||||
EntityLiving entityliving = (EntityLiving) entity;
|
||||
|
||||
d2 = entityliving.locY + (double) entityliving.getHeadHeight() - (this.locY + (double) this.getHeadHeight());
|
||||
} else {
|
||||
d2 = (entity.boundingBox.b + entity.boundingBox.e) / 2.0D - (this.locY + (double) this.getHeadHeight());
|
||||
}
|
||||
|
||||
double d3 = (double) MathHelper.sqrt(d0 * d0 + d1 * d1);
|
||||
float f2 = (float) (Math.atan2(d1, d0) * 180.0D / 3.1415927410125732D) - 90.0F;
|
||||
float f3 = (float) (-(Math.atan2(d2, d3) * 180.0D / 3.1415927410125732D));
|
||||
|
||||
this.pitch = this.b(this.pitch, f3, f1);
|
||||
this.yaw = this.b(this.yaw, f2, f);
|
||||
}
|
||||
|
||||
private float b(float f, float f1, float f2) {
|
||||
float f3 = MathHelper.g(f1 - f);
|
||||
|
||||
if (f3 > f2) {
|
||||
f3 = f2;
|
||||
}
|
||||
|
||||
if (f3 < -f2) {
|
||||
f3 = -f2;
|
||||
}
|
||||
|
||||
return f + f3;
|
||||
}
|
||||
|
||||
public boolean canSpawn() {
|
||||
return this.world.b(this.boundingBox) && this.world.getCubes(this, this.boundingBox).isEmpty() && !this.world.containsLiquid(this.boundingBox);
|
||||
}
|
||||
|
||||
public int br() {
|
||||
return 4;
|
||||
}
|
||||
|
||||
public int aq() {
|
||||
if (this.getGoalTarget() == null) {
|
||||
return 3;
|
||||
} else {
|
||||
int i = (int) (this.getHealth() - this.maxHealth * 0.33F); // CraftBukkit - this.getMaxHealth() -> this.maxHealth
|
||||
|
||||
i -= (3 - this.world.difficulty) * 4;
|
||||
if (i < 0) {
|
||||
i = 0;
|
||||
}
|
||||
|
||||
return i + 3;
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStack aV() {
|
||||
return this.equipment[0];
|
||||
}
|
||||
|
||||
public ItemStack getEquipment(int i) {
|
||||
return this.equipment[i];
|
||||
}
|
||||
|
||||
public ItemStack o(int i) {
|
||||
return this.equipment[i + 1];
|
||||
}
|
||||
|
||||
public void setEquipment(int i, ItemStack itemstack) {
|
||||
this.equipment[i] = itemstack;
|
||||
}
|
||||
|
||||
public ItemStack[] getEquipment() {
|
||||
return this.equipment;
|
||||
}
|
||||
|
||||
protected void dropEquipment(boolean flag, int i) {
|
||||
for (int j = 0; j < this.getEquipment().length; ++j) {
|
||||
ItemStack itemstack = this.getEquipment(j);
|
||||
boolean flag1 = this.dropChances[j] > 1.0F;
|
||||
|
||||
if (itemstack != null && (flag || flag1) && this.random.nextFloat() - (float) i * 0.01F < this.dropChances[j]) {
|
||||
if (!flag1 && itemstack.g()) {
|
||||
int k = Math.max(itemstack.l() - 25, 1);
|
||||
int l = itemstack.l() - this.random.nextInt(this.random.nextInt(k) + 1);
|
||||
|
||||
if (l > k) {
|
||||
l = k;
|
||||
}
|
||||
|
||||
if (l < 1) {
|
||||
l = 1;
|
||||
}
|
||||
|
||||
itemstack.setData(l);
|
||||
}
|
||||
|
||||
this.a(itemstack, 0.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void bs() {
|
||||
if (this.random.nextFloat() < 0.15F * this.world.b(this.locX, this.locY, this.locZ)) {
|
||||
int i = this.random.nextInt(2);
|
||||
float f = this.world.difficulty == 3 ? 0.1F : 0.25F;
|
||||
|
||||
if (this.random.nextFloat() < 0.095F) {
|
||||
++i;
|
||||
}
|
||||
|
||||
if (this.random.nextFloat() < 0.095F) {
|
||||
++i;
|
||||
}
|
||||
|
||||
if (this.random.nextFloat() < 0.095F) {
|
||||
++i;
|
||||
}
|
||||
|
||||
for (int j = 3; j >= 0; --j) {
|
||||
ItemStack itemstack = this.o(j);
|
||||
|
||||
if (j < 3 && this.random.nextFloat() < f) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (itemstack == null) {
|
||||
Item item = a(j + 1, i);
|
||||
|
||||
if (item != null) {
|
||||
this.setEquipment(j + 1, new ItemStack(item));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static int b(ItemStack itemstack) {
|
||||
if (itemstack.id != Block.PUMPKIN.id && itemstack.id != Item.SKULL.id) {
|
||||
if (itemstack.getItem() instanceof ItemArmor) {
|
||||
switch (((ItemArmor) itemstack.getItem()).b) {
|
||||
case 0:
|
||||
return 4;
|
||||
|
||||
case 1:
|
||||
return 3;
|
||||
|
||||
case 2:
|
||||
return 2;
|
||||
|
||||
case 3:
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
} else {
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
||||
public static Item a(int i, int j) {
|
||||
switch (i) {
|
||||
case 4:
|
||||
if (j == 0) {
|
||||
return Item.LEATHER_HELMET;
|
||||
} else if (j == 1) {
|
||||
return Item.GOLD_HELMET;
|
||||
} else if (j == 2) {
|
||||
return Item.CHAINMAIL_HELMET;
|
||||
} else if (j == 3) {
|
||||
return Item.IRON_HELMET;
|
||||
} else if (j == 4) {
|
||||
return Item.DIAMOND_HELMET;
|
||||
}
|
||||
|
||||
case 3:
|
||||
if (j == 0) {
|
||||
return Item.LEATHER_CHESTPLATE;
|
||||
} else if (j == 1) {
|
||||
return Item.GOLD_CHESTPLATE;
|
||||
} else if (j == 2) {
|
||||
return Item.CHAINMAIL_CHESTPLATE;
|
||||
} else if (j == 3) {
|
||||
return Item.IRON_CHESTPLATE;
|
||||
} else if (j == 4) {
|
||||
return Item.DIAMOND_CHESTPLATE;
|
||||
}
|
||||
|
||||
case 2:
|
||||
if (j == 0) {
|
||||
return Item.LEATHER_LEGGINGS;
|
||||
} else if (j == 1) {
|
||||
return Item.GOLD_LEGGINGS;
|
||||
} else if (j == 2) {
|
||||
return Item.CHAINMAIL_LEGGINGS;
|
||||
} else if (j == 3) {
|
||||
return Item.IRON_LEGGINGS;
|
||||
} else if (j == 4) {
|
||||
return Item.DIAMOND_LEGGINGS;
|
||||
}
|
||||
|
||||
case 1:
|
||||
if (j == 0) {
|
||||
return Item.LEATHER_BOOTS;
|
||||
} else if (j == 1) {
|
||||
return Item.GOLD_BOOTS;
|
||||
} else if (j == 2) {
|
||||
return Item.CHAINMAIL_BOOTS;
|
||||
} else if (j == 3) {
|
||||
return Item.IRON_BOOTS;
|
||||
} else if (j == 4) {
|
||||
return Item.DIAMOND_BOOTS;
|
||||
}
|
||||
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
protected void bt() {
|
||||
float f = this.world.b(this.locX, this.locY, this.locZ);
|
||||
|
||||
if (this.aV() != null && this.random.nextFloat() < 0.25F * f) {
|
||||
EnchantmentManager.a(this.random, this.aV(), (int) (5.0F + f * (float) this.random.nextInt(18)));
|
||||
}
|
||||
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
ItemStack itemstack = this.o(i);
|
||||
|
||||
if (itemstack != null && this.random.nextFloat() < 0.5F * f) {
|
||||
EnchantmentManager.a(this.random, itemstack, (int) (5.0F + f * (float) this.random.nextInt(18)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public GroupDataEntity a(GroupDataEntity groupdataentity) {
|
||||
this.a(GenericAttributes.b).a(new AttributeModifier("Random spawn bonus", this.random.nextGaussian() * 0.05D, 1));
|
||||
return groupdataentity;
|
||||
}
|
||||
|
||||
public boolean bu() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getLocalizedName() {
|
||||
return this.hasCustomName() ? this.getCustomName() : super.getLocalizedName();
|
||||
}
|
||||
|
||||
public void bv() {
|
||||
this.persistent = true;
|
||||
}
|
||||
|
||||
public void setCustomName(String s) {
|
||||
this.datawatcher.watch(10, s);
|
||||
}
|
||||
|
||||
public String getCustomName() {
|
||||
return this.datawatcher.getString(10);
|
||||
}
|
||||
|
||||
public boolean hasCustomName() {
|
||||
return this.datawatcher.getString(10).length() > 0;
|
||||
}
|
||||
|
||||
public void setCustomNameVisible(boolean flag) {
|
||||
this.datawatcher.watch(11, Byte.valueOf((byte) (flag ? 1 : 0)));
|
||||
}
|
||||
|
||||
public boolean getCustomNameVisible() {
|
||||
return this.datawatcher.getByte(11) == 1;
|
||||
}
|
||||
|
||||
public void a(int i, float f) {
|
||||
this.dropChances[i] = f;
|
||||
}
|
||||
|
||||
public boolean bz() {
|
||||
return this.canPickUpLoot;
|
||||
}
|
||||
|
||||
public void h(boolean flag) {
|
||||
this.canPickUpLoot = flag;
|
||||
}
|
||||
|
||||
public boolean bA() {
|
||||
return this.persistent;
|
||||
}
|
||||
|
||||
public final boolean c(EntityHuman entityhuman) {
|
||||
if (this.bD() && this.bE() == entityhuman) {
|
||||
this.i(true);
|
||||
return true;
|
||||
} else {
|
||||
ItemStack itemstack = entityhuman.inventory.getItemInHand();
|
||||
|
||||
if (itemstack != null && itemstack.id == Item.LEASH.id && this.bC()) {
|
||||
if (!(this instanceof EntityTameableAnimal) || !((EntityTameableAnimal) this).isTamed()) {
|
||||
this.b(entityhuman, true);
|
||||
--itemstack.count;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (entityhuman.getName().equalsIgnoreCase(((EntityTameableAnimal) this).getOwnerName())) {
|
||||
this.b(entityhuman, true);
|
||||
--itemstack.count;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return this.a(entityhuman) ? true : super.c(entityhuman);
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean a(EntityHuman entityhuman) {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void bB() {
|
||||
if (this.bx != null) {
|
||||
this.bF();
|
||||
}
|
||||
|
||||
if (this.bv) {
|
||||
if (this.bw == null || this.bw.dead) {
|
||||
this.i(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void i(boolean flag) {
|
||||
if (this.bv) {
|
||||
this.bv = false;
|
||||
this.bw = null;
|
||||
if (!this.world.isStatic) {
|
||||
this.b(Item.LEASH.id, 1);
|
||||
}
|
||||
|
||||
if (!this.world.isStatic && flag && this.world instanceof WorldServer) {
|
||||
((WorldServer) this.world).getTracker().a((Entity) this, (Packet) (new Packet39AttachEntity(1, this, (Entity) null)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean bC() {
|
||||
return !this.bD() && !(this instanceof IMonster);
|
||||
}
|
||||
|
||||
public boolean bD() {
|
||||
return this.bv;
|
||||
}
|
||||
|
||||
public Entity bE() {
|
||||
return this.bw;
|
||||
}
|
||||
|
||||
public void b(Entity entity, boolean flag) {
|
||||
this.bv = true;
|
||||
this.bw = entity;
|
||||
if (!this.world.isStatic && flag && this.world instanceof WorldServer) {
|
||||
((WorldServer) this.world).getTracker().a((Entity) this, (Packet) (new Packet39AttachEntity(1, this, this.bw)));
|
||||
}
|
||||
}
|
||||
|
||||
private void bF() {
|
||||
if (this.bv && this.bx != null) {
|
||||
if (this.bx.hasKey("UUIDMost") && this.bx.hasKey("UUIDLeast")) {
|
||||
UUID uuid = new UUID(this.bx.getLong("UUIDMost"), this.bx.getLong("UUIDLeast"));
|
||||
List list = this.world.a(EntityLiving.class, this.boundingBox.grow(10.0D, 10.0D, 10.0D));
|
||||
Iterator iterator = list.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
EntityLiving entityliving = (EntityLiving) iterator.next();
|
||||
|
||||
if (entityliving.getUniqueID().equals(uuid)) {
|
||||
this.bw = entityliving;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (this.bx.hasKey("X") && this.bx.hasKey("Y") && this.bx.hasKey("Z")) {
|
||||
int i = this.bx.getInt("X");
|
||||
int j = this.bx.getInt("Y");
|
||||
int k = this.bx.getInt("Z");
|
||||
EntityLeash entityleash = EntityLeash.b(this.world, i, j, k);
|
||||
|
||||
if (entityleash == null) {
|
||||
entityleash = EntityLeash.a(this.world, i, j, k);
|
||||
}
|
||||
|
||||
this.bw = entityleash;
|
||||
} else {
|
||||
this.i(false);
|
||||
}
|
||||
}
|
||||
|
||||
this.bx = null;
|
||||
}
|
||||
}
|
@ -4,27 +4,26 @@ import org.bukkit.craftbukkit.inventory.CraftItemStack; // CraftBukkit
|
||||
|
||||
public class EntityIronGolem extends EntityGolem {
|
||||
|
||||
private int e = 0;
|
||||
Village d = null;
|
||||
private int f;
|
||||
private int g;
|
||||
private int bq;
|
||||
Village bp;
|
||||
private int br;
|
||||
private int bs;
|
||||
|
||||
public EntityIronGolem(World world) {
|
||||
super(world);
|
||||
this.texture = "/mob/villager_golem.png";
|
||||
this.a(1.4F, 2.9F);
|
||||
this.getNavigation().a(true);
|
||||
this.goalSelector.a(1, new PathfinderGoalMeleeAttack(this, 0.25F, true));
|
||||
this.goalSelector.a(2, new PathfinderGoalMoveTowardsTarget(this, 0.22F, 32.0F));
|
||||
this.goalSelector.a(3, new PathfinderGoalMoveThroughVillage(this, 0.16F, true));
|
||||
this.goalSelector.a(4, new PathfinderGoalMoveTowardsRestriction(this, 0.16F));
|
||||
this.goalSelector.a(1, new PathfinderGoalMeleeAttack(this, 1.0D, true));
|
||||
this.goalSelector.a(2, new PathfinderGoalMoveTowardsTarget(this, 0.9D, 32.0F));
|
||||
this.goalSelector.a(3, new PathfinderGoalMoveThroughVillage(this, 0.6D, true));
|
||||
this.goalSelector.a(4, new PathfinderGoalMoveTowardsRestriction(this, 1.0D));
|
||||
this.goalSelector.a(5, new PathfinderGoalOfferFlower(this));
|
||||
this.goalSelector.a(6, new PathfinderGoalRandomStroll(this, 0.16F));
|
||||
this.goalSelector.a(6, new PathfinderGoalRandomStroll(this, 0.6D));
|
||||
this.goalSelector.a(7, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F));
|
||||
this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this));
|
||||
this.targetSelector.a(1, new PathfinderGoalDefendVillage(this));
|
||||
this.targetSelector.a(2, new PathfinderGoalHurtByTarget(this, false));
|
||||
this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, IMonster.a));
|
||||
this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget(this, EntityInsentient.class, 0, false, true, IMonster.a));
|
||||
}
|
||||
|
||||
protected void a() {
|
||||
@ -32,50 +31,52 @@ public class EntityIronGolem extends EntityGolem {
|
||||
this.datawatcher.a(16, Byte.valueOf((byte) 0));
|
||||
}
|
||||
|
||||
public boolean bh() {
|
||||
public boolean bb() {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void bp() {
|
||||
if (--this.e <= 0) {
|
||||
this.e = 70 + this.random.nextInt(50);
|
||||
this.d = this.world.villages.getClosestVillage(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ), 32);
|
||||
if (this.d == null) {
|
||||
this.aO();
|
||||
protected void bg() {
|
||||
if (--this.bq <= 0) {
|
||||
this.bq = 70 + this.random.nextInt(50);
|
||||
this.bp = this.world.villages.getClosestVillage(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ), 32);
|
||||
if (this.bp == null) {
|
||||
this.bN();
|
||||
} else {
|
||||
ChunkCoordinates chunkcoordinates = this.d.getCenter();
|
||||
ChunkCoordinates chunkcoordinates = this.bp.getCenter();
|
||||
|
||||
this.b(chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z, (int) ((float) this.d.getSize() * 0.6F));
|
||||
this.b(chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z, (int) ((float) this.bp.getSize() * 0.6F));
|
||||
}
|
||||
}
|
||||
|
||||
super.bp();
|
||||
super.bg();
|
||||
}
|
||||
|
||||
public int getMaxHealth() {
|
||||
return 100;
|
||||
protected void ax() {
|
||||
super.ax();
|
||||
this.a(GenericAttributes.a).a(100.0D);
|
||||
this.a(GenericAttributes.d).a(0.25D);
|
||||
}
|
||||
|
||||
protected int h(int i) {
|
||||
return i;
|
||||
}
|
||||
|
||||
protected void o(Entity entity) {
|
||||
if (entity instanceof IMonster && this.aE().nextInt(20) == 0) {
|
||||
protected void n(Entity entity) {
|
||||
if (entity instanceof IMonster && this.aB().nextInt(20) == 0) {
|
||||
this.setGoalTarget((EntityLiving) entity);
|
||||
}
|
||||
|
||||
super.o(entity);
|
||||
super.n(entity);
|
||||
}
|
||||
|
||||
public void c() {
|
||||
super.c();
|
||||
if (this.f > 0) {
|
||||
--this.f;
|
||||
if (this.br > 0) {
|
||||
--this.br;
|
||||
}
|
||||
|
||||
if (this.g > 0) {
|
||||
--this.g;
|
||||
if (this.bs > 0) {
|
||||
--this.bs;
|
||||
}
|
||||
|
||||
if (this.motX * this.motX + this.motZ * this.motZ > 2.500000277905201E-7D && this.random.nextInt(5) == 0) {
|
||||
@ -91,12 +92,12 @@ public class EntityIronGolem extends EntityGolem {
|
||||
}
|
||||
|
||||
public boolean a(Class oclass) {
|
||||
return this.p() && EntityHuman.class.isAssignableFrom(oclass) ? false : super.a(oclass);
|
||||
return this.bS() && EntityHuman.class.isAssignableFrom(oclass) ? false : super.a(oclass);
|
||||
}
|
||||
|
||||
public void b(NBTTagCompound nbttagcompound) {
|
||||
super.b(nbttagcompound);
|
||||
nbttagcompound.setBoolean("PlayerCreated", this.p());
|
||||
nbttagcompound.setBoolean("PlayerCreated", this.bS());
|
||||
}
|
||||
|
||||
public void a(NBTTagCompound nbttagcompound) {
|
||||
@ -105,9 +106,9 @@ public class EntityIronGolem extends EntityGolem {
|
||||
}
|
||||
|
||||
public boolean m(Entity entity) {
|
||||
this.f = 10;
|
||||
this.br = 10;
|
||||
this.world.broadcastEntityEffect(this, (byte) 4);
|
||||
boolean flag = entity.damageEntity(DamageSource.mobAttack(this), 7 + this.random.nextInt(15));
|
||||
boolean flag = entity.damageEntity(DamageSource.mobAttack(this), (float) (7 + this.random.nextInt(15)));
|
||||
|
||||
if (flag) {
|
||||
entity.motY += 0.4000000059604645D;
|
||||
@ -117,24 +118,24 @@ public class EntityIronGolem extends EntityGolem {
|
||||
return flag;
|
||||
}
|
||||
|
||||
public Village m() {
|
||||
return this.d;
|
||||
public Village bP() {
|
||||
return this.bp;
|
||||
}
|
||||
|
||||
public void a(boolean flag) {
|
||||
this.g = flag ? 400 : 0;
|
||||
this.bs = flag ? 400 : 0;
|
||||
this.world.broadcastEntityEffect(this, (byte) 11);
|
||||
}
|
||||
|
||||
protected String bb() {
|
||||
protected String r() {
|
||||
return "none";
|
||||
}
|
||||
|
||||
protected String bc() {
|
||||
protected String aK() {
|
||||
return "mob.irongolem.hit";
|
||||
}
|
||||
|
||||
protected String bd() {
|
||||
protected String aL() {
|
||||
return "mob.irongolem.death";
|
||||
}
|
||||
|
||||
@ -163,11 +164,11 @@ public class EntityIronGolem extends EntityGolem {
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
public int o() {
|
||||
return this.g;
|
||||
public int bR() {
|
||||
return this.bs;
|
||||
}
|
||||
|
||||
public boolean p() {
|
||||
public boolean bS() {
|
||||
return (this.datawatcher.getByte(16) & 1) != 0;
|
||||
}
|
||||
|
||||
@ -182,8 +183,8 @@ public class EntityIronGolem extends EntityGolem {
|
||||
}
|
||||
|
||||
public void die(DamageSource damagesource) {
|
||||
if (!this.p() && this.killer != null && this.d != null) {
|
||||
this.d.a(this.killer.getName(), -5);
|
||||
if (!this.bS() && this.killer != null && this.bp != null) {
|
||||
this.bp.a(this.killer.getName(), -5);
|
||||
}
|
||||
|
||||
super.die(damagesource);
|
||||
|
@ -14,7 +14,6 @@ public class EntityItem extends Entity {
|
||||
|
||||
public EntityItem(World world, double d0, double d1, double d2) {
|
||||
super(world);
|
||||
this.age = 0;
|
||||
this.d = 5;
|
||||
this.c = (float) (Math.random() * 3.141592653589793D * 2.0D);
|
||||
this.a(0.25F, 0.25F);
|
||||
@ -36,13 +35,12 @@ public class EntityItem extends Entity {
|
||||
this.setItemStack(itemstack);
|
||||
}
|
||||
|
||||
protected boolean f_() {
|
||||
protected boolean e_() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public EntityItem(World world) {
|
||||
super(world);
|
||||
this.age = 0;
|
||||
this.d = 5;
|
||||
this.c = (float) (Math.random() * 3.141592653589793D * 2.0D);
|
||||
this.a(0.25F, 0.25F);
|
||||
@ -79,7 +77,7 @@ public class EntityItem extends Entity {
|
||||
}
|
||||
|
||||
if (!this.world.isStatic) {
|
||||
this.g();
|
||||
this.e();
|
||||
}
|
||||
}
|
||||
|
||||
@ -113,7 +111,7 @@ public class EntityItem extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
private void g() {
|
||||
private void e() {
|
||||
Iterator iterator = this.world.a(EntityItem.class, this.boundingBox.grow(0.5D, 0.0D, 0.5D)).iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@ -136,7 +134,7 @@ public class EntityItem extends Entity {
|
||||
return false;
|
||||
} else if (itemstack1.hasTag() && !itemstack1.getTag().equals(itemstack.getTag())) {
|
||||
return false;
|
||||
} else if (itemstack1.getItem().m() && itemstack1.getData() != itemstack.getData()) {
|
||||
} else if (itemstack1.getItem().n() && itemstack1.getData() != itemstack.getData()) {
|
||||
return false;
|
||||
} else if (itemstack1.count < itemstack.count) {
|
||||
return entityitem.a(this);
|
||||
@ -164,17 +162,17 @@ public class EntityItem extends Entity {
|
||||
}
|
||||
|
||||
protected void burn(int i) {
|
||||
this.damageEntity(DamageSource.FIRE, i);
|
||||
this.damageEntity(DamageSource.FIRE, (float) i);
|
||||
}
|
||||
|
||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||
public boolean damageEntity(DamageSource damagesource, float f) {
|
||||
if (this.isInvulnerable()) {
|
||||
return false;
|
||||
} else if (this.getItemStack() != null && this.getItemStack().id == Item.NETHER_STAR.id && damagesource.c()) {
|
||||
return false;
|
||||
} else {
|
||||
this.J();
|
||||
this.d -= i;
|
||||
this.d = (int) ((float) this.d - f);
|
||||
if (this.d <= 0) {
|
||||
this.die();
|
||||
}
|
||||
@ -225,7 +223,7 @@ public class EntityItem extends Entity {
|
||||
if (this.pickupDelay <= 0 && canHold > 0) {
|
||||
itemstack.count = canHold;
|
||||
PlayerPickupItemEvent event = new PlayerPickupItemEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), (org.bukkit.entity.Item) this.getBukkitEntity(), remaining);
|
||||
event.setCancelled(!entityhuman.canPickUpLoot);
|
||||
// event.setCancelled(!entityhuman.canPickUpLoot); TODO
|
||||
this.world.getServer().getPluginManager().callEvent(event);
|
||||
itemstack.count = canHold + remaining;
|
||||
|
||||
@ -268,14 +266,14 @@ public class EntityItem extends Entity {
|
||||
return LocaleI18n.get("item." + this.getItemStack().a());
|
||||
}
|
||||
|
||||
public boolean ap() {
|
||||
public boolean ao() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void c(int i) {
|
||||
super.c(i);
|
||||
public void b(int i) {
|
||||
super.b(i);
|
||||
if (!this.world.isStatic) {
|
||||
this.g();
|
||||
this.e();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ public class EntityLargeFireball extends EntityFireball {
|
||||
protected void a(MovingObjectPosition movingobjectposition) {
|
||||
if (!this.world.isStatic) {
|
||||
if (movingobjectposition.entity != null) {
|
||||
movingobjectposition.entity.damageEntity(DamageSource.fireball(this, this.shooter), 6);
|
||||
movingobjectposition.entity.damageEntity(DamageSource.fireball(this, this.shooter), 6.0F);
|
||||
}
|
||||
|
||||
// CraftBukkit start
|
||||
|
@ -7,7 +7,7 @@ import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
|
||||
public class EntityLightning extends EntityWeather {
|
||||
|
||||
private int lifeTicks;
|
||||
public long a = 0L;
|
||||
public long a;
|
||||
private int c;
|
||||
|
||||
// CraftBukkit start
|
||||
@ -32,7 +32,7 @@ public class EntityLightning extends EntityWeather {
|
||||
this.c = this.random.nextInt(3) + 1;
|
||||
|
||||
// CraftBukkit
|
||||
if (!isEffect && !world.isStatic && world.difficulty >= 2 && world.areChunksLoaded(MathHelper.floor(d0), MathHelper.floor(d1), MathHelper.floor(d2), 10)) {
|
||||
if (!isEffect && !world.isStatic && world.getGameRules().getBoolean("doFireTick") && world.difficulty >= 2 && world.areChunksLoaded(MathHelper.floor(d0), MathHelper.floor(d1), MathHelper.floor(d2), 10)) {
|
||||
int i = MathHelper.floor(d0);
|
||||
int j = MathHelper.floor(d1);
|
||||
int k = MathHelper.floor(d2);
|
||||
@ -77,7 +77,7 @@ public class EntityLightning extends EntityWeather {
|
||||
this.lifeTicks = 1;
|
||||
this.a = this.random.nextLong();
|
||||
// CraftBukkit
|
||||
if (!this.isEffect && !this.world.isStatic && this.world.areChunksLoaded(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ), 10)) {
|
||||
if (!isEffect && !this.world.isStatic && this.world.getGameRules().getBoolean("doFireTick") && this.world.areChunksLoaded(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ), 10)) {
|
||||
int i = MathHelper.floor(this.locX);
|
||||
int j = MathHelper.floor(this.locY);
|
||||
int k = MathHelper.floor(this.locZ);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -4,28 +4,31 @@ public class EntityMagmaCube extends EntitySlime {
|
||||
|
||||
public EntityMagmaCube(World world) {
|
||||
super(world);
|
||||
this.texture = "/mob/lava.png";
|
||||
this.fireProof = true;
|
||||
this.aO = 0.2F;
|
||||
}
|
||||
|
||||
protected void ax() {
|
||||
super.ax();
|
||||
this.a(GenericAttributes.d).a(0.20000000298023224D);
|
||||
}
|
||||
|
||||
public boolean canSpawn() {
|
||||
return this.world.difficulty > 0 && this.world.b(this.boundingBox) && this.world.getCubes(this, this.boundingBox).isEmpty() && !this.world.containsLiquid(this.boundingBox);
|
||||
}
|
||||
|
||||
public int aZ() {
|
||||
public int aM() {
|
||||
return this.getSize() * 3;
|
||||
}
|
||||
|
||||
public float c(float f) {
|
||||
public float d(float f) {
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
protected String h() {
|
||||
protected String bF() {
|
||||
return "flame";
|
||||
}
|
||||
|
||||
protected EntitySlime i() {
|
||||
protected EntitySlime bG() {
|
||||
return new EntityMagmaCube(this.world);
|
||||
}
|
||||
|
||||
@ -58,38 +61,38 @@ public class EntityMagmaCube extends EntitySlime {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected int j() {
|
||||
return super.j() * 4;
|
||||
protected int bH() {
|
||||
return super.bH() * 4;
|
||||
}
|
||||
|
||||
protected void k() {
|
||||
this.b *= 0.9F;
|
||||
protected void bI() {
|
||||
this.h *= 0.9F;
|
||||
}
|
||||
|
||||
protected void bl() {
|
||||
protected void ba() {
|
||||
this.motY = (double) (0.42F + (float) this.getSize() * 0.1F);
|
||||
this.an = true;
|
||||
}
|
||||
|
||||
protected void a(float f) {}
|
||||
protected void b(float f) {}
|
||||
|
||||
protected boolean l() {
|
||||
protected boolean bJ() {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected int m() {
|
||||
return super.m() + 2;
|
||||
protected int bK() {
|
||||
return super.bK() + 2;
|
||||
}
|
||||
|
||||
protected String bc() {
|
||||
protected String aK() {
|
||||
return "mob.slime." + (this.getSize() > 1 ? "big" : "small");
|
||||
}
|
||||
|
||||
protected String bd() {
|
||||
protected String aL() {
|
||||
return "mob.slime." + (this.getSize() > 1 ? "big" : "small");
|
||||
}
|
||||
|
||||
protected String n() {
|
||||
protected String bL() {
|
||||
return this.getSize() > 1 ? "mob.magmacube.big" : "mob.magmacube.small";
|
||||
}
|
||||
|
||||
@ -97,7 +100,7 @@ public class EntityMagmaCube extends EntitySlime {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected boolean o() {
|
||||
protected boolean bM() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,6 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
|
||||
public EntityMinecartAbstract(World world) {
|
||||
super(world);
|
||||
this.a = false;
|
||||
this.m = true;
|
||||
this.a(0.98F, 0.7F);
|
||||
this.height = this.length / 2.0F;
|
||||
@ -66,14 +65,14 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean f_() {
|
||||
protected boolean e_() {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void a() {
|
||||
this.datawatcher.a(17, new Integer(0));
|
||||
this.datawatcher.a(18, new Integer(1));
|
||||
this.datawatcher.a(19, new Integer(0));
|
||||
this.datawatcher.a(19, new Float(0.0F));
|
||||
this.datawatcher.a(20, new Integer(0));
|
||||
this.datawatcher.a(21, new Integer(6));
|
||||
this.datawatcher.a(22, Byte.valueOf((byte) 0));
|
||||
@ -93,7 +92,7 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
|
||||
public EntityMinecartAbstract(World world, double d0, double d1, double d2) {
|
||||
this(world);
|
||||
this.setPosition(d0, d1 + (double) this.height, d2);
|
||||
this.setPosition(d0, d1, d2);
|
||||
this.motX = 0.0D;
|
||||
this.motY = 0.0D;
|
||||
this.motZ = 0.0D;
|
||||
@ -108,7 +107,7 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
return (double) this.length * 0.0D - 0.30000001192092896D;
|
||||
}
|
||||
|
||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||
public boolean damageEntity(DamageSource damagesource, float f) {
|
||||
if (!this.world.isStatic && !this.dead) {
|
||||
if (this.isInvulnerable()) {
|
||||
return false;
|
||||
@ -117,23 +116,23 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
Vehicle vehicle = (Vehicle) this.getBukkitEntity();
|
||||
org.bukkit.entity.Entity passenger = (damagesource.getEntity() == null) ? null : damagesource.getEntity().getBukkitEntity();
|
||||
|
||||
VehicleDamageEvent event = new VehicleDamageEvent(vehicle, passenger, i);
|
||||
VehicleDamageEvent event = new VehicleDamageEvent(vehicle, passenger, f);
|
||||
this.world.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
if (event.isCancelled()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
i = event.getDamage();
|
||||
f = (float) event.getDamage();
|
||||
// CraftBukkit end
|
||||
|
||||
this.j(-this.k());
|
||||
this.i(10);
|
||||
this.h(-this.k());
|
||||
this.c(10);
|
||||
this.J();
|
||||
this.setDamage(this.getDamage() + i * 10);
|
||||
this.setDamage(this.getDamage() + f * 10.0F);
|
||||
boolean flag = damagesource.getEntity() instanceof EntityHuman && ((EntityHuman) damagesource.getEntity()).abilities.canInstantlyBuild;
|
||||
|
||||
if (flag || this.getDamage() > 40) {
|
||||
if (flag || this.getDamage() > 40.0F) {
|
||||
if (this.passenger != null) {
|
||||
this.passenger.mount(this);
|
||||
}
|
||||
@ -198,11 +197,11 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
}
|
||||
|
||||
if (this.j() > 0) {
|
||||
this.i(this.j() - 1);
|
||||
this.c(this.j() - 1);
|
||||
}
|
||||
|
||||
if (this.getDamage() > 0) {
|
||||
this.setDamage(this.getDamage() - 1);
|
||||
if (this.getDamage() > 0.0F) {
|
||||
this.setDamage(this.getDamage() - 1.0F);
|
||||
}
|
||||
|
||||
if (this.locY < -64.0D) {
|
||||
@ -229,7 +228,7 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
b0 = -1;
|
||||
}
|
||||
|
||||
this.c(b0);
|
||||
this.b(b0);
|
||||
}
|
||||
|
||||
this.ap = false;
|
||||
@ -285,7 +284,7 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
double d5 = 0.0078125D;
|
||||
int l = this.world.getTypeId(j, i, k);
|
||||
|
||||
if (BlockMinecartTrackAbstract.d_(l)) {
|
||||
if (BlockMinecartTrackAbstract.e_(l)) {
|
||||
int i1 = this.world.getData(j, i, k);
|
||||
|
||||
this.a(j, i, k, d4, d5, l, i1);
|
||||
@ -447,14 +446,20 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
this.motZ = d6 * d3 / d4;
|
||||
double d7;
|
||||
double d8;
|
||||
double d9;
|
||||
double d10;
|
||||
|
||||
if (this.passenger != null) {
|
||||
d7 = this.passenger.motX * this.passenger.motX + this.passenger.motZ * this.passenger.motZ;
|
||||
d8 = this.motX * this.motX + this.motZ * this.motZ;
|
||||
if (d7 > 1.0E-4D && d8 < 0.01D) {
|
||||
this.motX += this.passenger.motX * 0.1D;
|
||||
this.motZ += this.passenger.motZ * 0.1D;
|
||||
flag1 = false;
|
||||
if (this.passenger != null && this.passenger instanceof EntityLiving) {
|
||||
d7 = (double) ((EntityLiving) this.passenger).bf;
|
||||
if (d7 > 0.0D) {
|
||||
d8 = -Math.sin((double) (this.passenger.yaw * 3.1415927F / 180.0F));
|
||||
d9 = Math.cos((double) (this.passenger.yaw * 3.1415927F / 180.0F));
|
||||
d10 = this.motX * this.motX + this.motZ * this.motZ;
|
||||
if (d10 < 0.01D) {
|
||||
this.motX += d8 * 0.1D;
|
||||
this.motZ += d9 * 0.1D;
|
||||
flag1 = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -473,8 +478,8 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
|
||||
d7 = 0.0D;
|
||||
d8 = (double) i + 0.5D + (double) aint[0][0] * 0.5D;
|
||||
double d9 = (double) k + 0.5D + (double) aint[0][2] * 0.5D;
|
||||
double d10 = (double) i + 0.5D + (double) aint[1][0] * 0.5D;
|
||||
d9 = (double) k + 0.5D + (double) aint[0][2] * 0.5D;
|
||||
d10 = (double) i + 0.5D + (double) aint[1][0] * 0.5D;
|
||||
double d11 = (double) k + 0.5D + (double) aint[1][2] * 0.5D;
|
||||
|
||||
d2 = d10 - d8;
|
||||
@ -598,7 +603,7 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
|
||||
int l = this.world.getTypeId(i, j, k);
|
||||
|
||||
if (BlockMinecartTrackAbstract.d_(l)) {
|
||||
if (BlockMinecartTrackAbstract.e_(l)) {
|
||||
int i1 = this.world.getData(i, j, k);
|
||||
|
||||
d1 = (double) j;
|
||||
@ -654,9 +659,9 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
|
||||
protected void a(NBTTagCompound nbttagcompound) {
|
||||
if (nbttagcompound.getBoolean("CustomDisplayTile")) {
|
||||
this.k(nbttagcompound.getInt("DisplayTile"));
|
||||
this.l(nbttagcompound.getInt("DisplayData"));
|
||||
this.m(nbttagcompound.getInt("DisplayOffset"));
|
||||
this.i(nbttagcompound.getInt("DisplayTile"));
|
||||
this.j(nbttagcompound.getInt("DisplayData"));
|
||||
this.k(nbttagcompound.getInt("DisplayOffset"));
|
||||
}
|
||||
|
||||
if (nbttagcompound.hasKey("CustomName") && nbttagcompound.getString("CustomName").length() > 0) {
|
||||
@ -764,15 +769,15 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
public void setDamage(int i) {
|
||||
this.datawatcher.watch(19, Integer.valueOf(i));
|
||||
public void setDamage(float f) {
|
||||
this.datawatcher.watch(19, Float.valueOf(f));
|
||||
}
|
||||
|
||||
public int getDamage() {
|
||||
return this.datawatcher.getInt(19);
|
||||
public float getDamage() {
|
||||
return this.datawatcher.getFloat(19);
|
||||
}
|
||||
|
||||
public void i(int i) {
|
||||
public void c(int i) {
|
||||
this.datawatcher.watch(17, Integer.valueOf(i));
|
||||
}
|
||||
|
||||
@ -780,7 +785,7 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
return this.datawatcher.getInt(17);
|
||||
}
|
||||
|
||||
public void j(int i) {
|
||||
public void h(int i) {
|
||||
this.datawatcher.watch(18, Integer.valueOf(i));
|
||||
}
|
||||
|
||||
@ -820,12 +825,12 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
return 6;
|
||||
}
|
||||
|
||||
public void k(int i) {
|
||||
public void i(int i) {
|
||||
this.getDataWatcher().watch(20, Integer.valueOf(i & '\uffff' | this.o() << 16));
|
||||
this.a(true);
|
||||
}
|
||||
|
||||
public void l(int i) {
|
||||
public void j(int i) {
|
||||
Block block = this.m();
|
||||
int j = block == null ? 0 : block.id;
|
||||
|
||||
@ -833,7 +838,7 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
this.a(true);
|
||||
}
|
||||
|
||||
public void m(int i) {
|
||||
public void k(int i) {
|
||||
this.getDataWatcher().watch(21, Integer.valueOf(i));
|
||||
this.a(true);
|
||||
}
|
||||
|
@ -148,9 +148,9 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp
|
||||
return 64;
|
||||
}
|
||||
|
||||
public void c(int i) {
|
||||
public void b(int i) {
|
||||
this.b = false;
|
||||
super.c(i);
|
||||
super.b(i);
|
||||
}
|
||||
|
||||
public void die() {
|
||||
@ -224,7 +224,7 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp
|
||||
}
|
||||
}
|
||||
|
||||
public boolean a_(EntityHuman entityhuman) {
|
||||
public boolean c(EntityHuman entityhuman) {
|
||||
if (!this.world.isStatic) {
|
||||
entityhuman.openContainer(this);
|
||||
}
|
||||
|
@ -6,15 +6,15 @@ public abstract class EntityMonster extends EntityCreature implements IMonster {
|
||||
|
||||
public EntityMonster(World world) {
|
||||
super(world);
|
||||
this.be = 5;
|
||||
this.b = 5;
|
||||
}
|
||||
|
||||
public void c() {
|
||||
this.br();
|
||||
float f = this.c(1.0F);
|
||||
this.aS();
|
||||
float f = this.d(1.0F);
|
||||
|
||||
if (f > 0.5F) {
|
||||
this.bC += 2;
|
||||
this.aV += 2;
|
||||
}
|
||||
|
||||
super.c();
|
||||
@ -30,13 +30,13 @@ public abstract class EntityMonster extends EntityCreature implements IMonster {
|
||||
protected Entity findTarget() {
|
||||
EntityHuman entityhuman = this.world.findNearbyVulnerablePlayer(this, 16.0D);
|
||||
|
||||
return entityhuman != null && this.n(entityhuman) ? entityhuman : null;
|
||||
return entityhuman != null && this.o(entityhuman) ? entityhuman : null;
|
||||
}
|
||||
|
||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||
public boolean damageEntity(DamageSource damagesource, float f) {
|
||||
if (this.isInvulnerable()) {
|
||||
return false;
|
||||
} else if (super.damageEntity(damagesource, i)) {
|
||||
} else if (super.damageEntity(damagesource, f)) {
|
||||
Entity entity = damagesource.getEntity();
|
||||
|
||||
if (this.passenger != entity && this.vehicle != entity) {
|
||||
@ -68,36 +68,27 @@ public abstract class EntityMonster extends EntityCreature implements IMonster {
|
||||
}
|
||||
|
||||
public boolean m(Entity entity) {
|
||||
int i = this.c(entity);
|
||||
|
||||
if (this.hasEffect(MobEffectList.INCREASE_DAMAGE)) {
|
||||
i += 3 << this.getEffect(MobEffectList.INCREASE_DAMAGE).getAmplifier();
|
||||
}
|
||||
|
||||
if (this.hasEffect(MobEffectList.WEAKNESS)) {
|
||||
i -= 2 << this.getEffect(MobEffectList.WEAKNESS).getAmplifier();
|
||||
}
|
||||
|
||||
int j = 0;
|
||||
float f = (float) this.a(GenericAttributes.e).e();
|
||||
int i = 0;
|
||||
|
||||
if (entity instanceof EntityLiving) {
|
||||
i += EnchantmentManager.a((EntityLiving) this, (EntityLiving) entity);
|
||||
j += EnchantmentManager.getKnockbackEnchantmentLevel(this, (EntityLiving) entity);
|
||||
f += EnchantmentManager.a((EntityLiving) this, (EntityLiving) entity);
|
||||
i += EnchantmentManager.getKnockbackEnchantmentLevel(this, (EntityLiving) entity);
|
||||
}
|
||||
|
||||
boolean flag = entity.damageEntity(DamageSource.mobAttack(this), i);
|
||||
boolean flag = entity.damageEntity(DamageSource.mobAttack(this), f);
|
||||
|
||||
if (flag) {
|
||||
if (j > 0) {
|
||||
entity.g((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));
|
||||
if (i > 0) {
|
||||
entity.g((double) (-MathHelper.sin(this.yaw * 3.1415927F / 180.0F) * (float) i * 0.5F), 0.1D, (double) (MathHelper.cos(this.yaw * 3.1415927F / 180.0F) * (float) i * 0.5F));
|
||||
this.motX *= 0.6D;
|
||||
this.motZ *= 0.6D;
|
||||
}
|
||||
|
||||
int k = EnchantmentManager.getFireAspectEnchantmentLevel(this);
|
||||
int j = EnchantmentManager.getFireAspectEnchantmentLevel(this);
|
||||
|
||||
if (k > 0) {
|
||||
entity.setOnFire(k * 4);
|
||||
if (j > 0) {
|
||||
entity.setOnFire(j * 4);
|
||||
}
|
||||
|
||||
if (entity instanceof EntityLiving) {
|
||||
@ -129,7 +120,7 @@ public abstract class EntityMonster extends EntityCreature implements IMonster {
|
||||
} else {
|
||||
int l = this.world.getLightLevel(i, j, k);
|
||||
|
||||
if (this.world.O()) {
|
||||
if (this.world.P()) {
|
||||
int i1 = this.world.j;
|
||||
|
||||
this.world.j = 10;
|
||||
@ -142,10 +133,11 @@ public abstract class EntityMonster extends EntityCreature implements IMonster {
|
||||
}
|
||||
|
||||
public boolean canSpawn() {
|
||||
return this.i_() && super.canSpawn();
|
||||
return this.world.difficulty > 0 && this.i_() && super.canSpawn();
|
||||
}
|
||||
|
||||
public int c(Entity entity) {
|
||||
return 2;
|
||||
protected void ax() {
|
||||
super.ax();
|
||||
this.aT().b(GenericAttributes.e);
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user