Update to Minecraft 1.10

This commit is contained in:
md_5 2016-06-09 11:43:49 +10:00
parent 0cd0397a82
commit a8a4bedd2a
161 changed files with 1176 additions and 1147 deletions

View File

@ -9,7 +9,7 @@
} }
public static int getCombinedId(IBlockData iblockdata) { public static int getCombinedId(IBlockData iblockdata) {
@@ -327,7 +327,8 @@ @@ -332,7 +332,8 @@
int j = this.getDropCount(i, world.random); int j = this.getDropCount(i, world.random);
for (int k = 0; k < j; ++k) { for (int k = 0; k < j; ++k) {
@ -19,7 +19,7 @@
Item item = this.getDropType(iblockdata, world.random, i); Item item = this.getDropType(iblockdata, world.random, i);
if (item != null) { if (item != null) {
@@ -863,7 +864,7 @@ @@ -873,7 +874,7 @@
if (hashset.contains(block16)) { if (hashset.contains(block16)) {
for (int i = 0; i < 15; ++i) { for (int i = 0; i < 15; ++i) {
@ -28,7 +28,7 @@
Block.REGISTRY_ID.a(block16.fromLegacyData(i), j); Block.REGISTRY_ID.a(block16.fromLegacyData(i), j);
} }
@@ -872,7 +873,7 @@ @@ -882,7 +883,7 @@
while (iterator2.hasNext()) { while (iterator2.hasNext()) {
IBlockData iblockdata = (IBlockData) iterator2.next(); IBlockData iblockdata = (IBlockData) iterator2.next();
@ -37,7 +37,7 @@
Block.REGISTRY_ID.a(iblockdata, k); Block.REGISTRY_ID.a(iblockdata, k);
} }
@@ -881,6 +882,12 @@ @@ -891,6 +892,12 @@
} }

View File

@ -2,7 +2,7 @@
+++ b/net/minecraft/server/BlockCake.java +++ b/net/minecraft/server/BlockCake.java
@@ -34,7 +34,18 @@ @@ -34,7 +34,18 @@
private void b(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman) { private void b(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman) {
if (entityhuman.l(false)) { if (entityhuman.m(false)) {
entityhuman.b(StatisticList.J); entityhuman.b(StatisticList.J);
- entityhuman.getFoodData().eat(2, 0.1F); - entityhuman.getFoodData().eat(2, 0.1F);
+ // CraftBukkit start + // CraftBukkit start

View File

@ -9,7 +9,7 @@
public class BlockChorusFlower extends Block { public class BlockChorusFlower extends Block {
public static final BlockStateInteger AGE = BlockStateInteger.of("age", 0, 5); public static final BlockStateInteger AGE = BlockStateInteger.of("age", 0, 5);
@@ -68,8 +70,20 @@ @@ -69,8 +71,20 @@
} }
if (flag && a(world, blockposition1, (EnumDirection) null) && world.isEmpty(blockposition.up(2))) { if (flag && a(world, blockposition1, (EnumDirection) null) && world.isEmpty(blockposition.up(2))) {
@ -32,7 +32,7 @@
} else if (i < 4) { } else if (i < 4) {
j = random.nextInt(4); j = random.nextInt(4);
boolean flag2 = false; boolean flag2 = false;
@@ -83,18 +97,53 @@ @@ -84,18 +98,53 @@
BlockPosition blockposition2 = blockposition.shift(enumdirection); BlockPosition blockposition2 = blockposition.shift(enumdirection);
if (world.isEmpty(blockposition2) && world.isEmpty(blockposition2.down()) && a(world, blockposition2, enumdirection.opposite())) { if (world.isEmpty(blockposition2) && world.isEmpty(blockposition2.down()) && a(world, blockposition2, enumdirection.opposite())) {

View File

@ -10,8 +10,8 @@
public static final BlockStateDirection a = BlockDirectional.FACING; public static final BlockStateDirection a = BlockDirectional.FACING;
@@ -30,7 +32,16 @@ @@ -30,7 +32,16 @@
boolean flag1 = tileentitycommand.e(); boolean flag1 = tileentitycommand.g();
boolean flag2 = tileentitycommand.g(); boolean flag2 = tileentitycommand.h();
- if (flag && !flag1) { - if (flag && !flag1) {
+ // CraftBukkit start + // CraftBukkit start
@ -25,8 +25,8 @@
+ +
+ if (eventRedstone.getNewCurrent() > 0 && !(eventRedstone.getOldCurrent() > 0)) { // CraftBukkit + if (eventRedstone.getNewCurrent() > 0 && !(eventRedstone.getOldCurrent() > 0)) { // CraftBukkit
tileentitycommand.a(true); tileentitycommand.a(true);
if (tileentitycommand.j() != TileEntityCommand.Type.SEQUENCE && !flag2) { if (tileentitycommand.k() != TileEntityCommand.Type.SEQUENCE && !flag2) {
boolean flag3 = !tileentitycommand.k() || this.e(world, blockposition, iblockdata); boolean flag3 = !tileentitycommand.l() || this.e(world, blockposition, iblockdata);
@@ -41,7 +52,7 @@ @@ -41,7 +52,7 @@
this.c(world, blockposition); this.c(world, blockposition);
} }

View File

@ -12,7 +12,7 @@
@@ -37,6 +39,10 @@ @@ -37,6 +39,10 @@
public void a(World world, BlockPosition blockposition, IBlockData iblockdata, Entity entity) { public void a(World world, BlockPosition blockposition, IBlockData iblockdata, Entity entity) {
if (!entity.isPassenger() && !entity.isVehicle() && entity.aV() && !world.isClientSide && entity.getBoundingBox().b(iblockdata.c(world, blockposition).a(blockposition))) { if (!entity.isPassenger() && !entity.isVehicle() && entity.aX() && !world.isClientSide && entity.getBoundingBox().b(iblockdata.c(world, blockposition).a(blockposition))) {
+ // CraftBukkit start - Entity in portal + // CraftBukkit start - Entity in portal
+ EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ())); + EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ()));
+ world.getServer().getPluginManager().callEvent(event); + world.getServer().getPluginManager().callEvent(event);

View File

@ -69,6 +69,6 @@
private void flow(World world, BlockPosition blockposition, IBlockData iblockdata, int i) { private void flow(World world, BlockPosition blockposition, IBlockData iblockdata, int i) {
- if (this.h(world, blockposition, iblockdata)) { - if (this.h(world, blockposition, iblockdata)) {
+ if (world.isLoaded(blockposition) && this.h(world, blockposition, iblockdata)) { // CraftBukkit - add isLoaded check + if (world.isLoaded(blockposition) && this.h(world, blockposition, iblockdata)) { // CraftBukkit - add isLoaded check
if (iblockdata.getBlock() != Blocks.AIR) { if (iblockdata.getMaterial() != Material.AIR) {
if (this.material == Material.LAVA) { if (this.material == Material.LAVA) {
this.fizz(world, blockposition); this.fizz(world, blockposition);

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockJukeBox.java --- a/net/minecraft/server/BlockJukeBox.java
+++ b/net/minecraft/server/BlockJukeBox.java +++ b/net/minecraft/server/BlockJukeBox.java
@@ -140,6 +140,11 @@ @@ -144,6 +144,11 @@
} }
public void setRecord(@Nullable ItemStack itemstack) { public void setRecord(@Nullable ItemStack itemstack) {

View File

@ -1,10 +0,0 @@
--- a/net/minecraft/server/BlockMinecartTrackAbstract.java
+++ b/net/minecraft/server/BlockMinecartTrackAbstract.java
@@ -11,6 +11,7 @@
protected static final AxisAlignedBB b = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.15625D, 1.0D);
protected final boolean c;
+ // PAIL: We stage this entire file just to unsynthetic this method. We should rename and AT it in future
public static boolean b(World world, BlockPosition blockposition) {
return i(world.getType(blockposition));
}

View File

@ -19,7 +19,7 @@
+ Entity entity = ItemMonsterEgg.spawnCreature(world, EntityTypes.getName(EntityPigZombie.class), (double) blockposition1.getX() + 0.5D, (double) blockposition1.getY() + 1.1D, (double) blockposition1.getZ() + 0.5D, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NETHER_PORTAL); + Entity entity = ItemMonsterEgg.spawnCreature(world, EntityTypes.getName(EntityPigZombie.class), (double) blockposition1.getX() + 0.5D, (double) blockposition1.getY() + 1.1D, (double) blockposition1.getZ() + 0.5D, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NETHER_PORTAL);
if (entity != null) { if (entity != null) {
entity.portalCooldown = entity.aC(); entity.portalCooldown = entity.aE();
@@ -70,14 +74,16 @@ @@ -70,14 +74,16 @@
BlockPortal.Shape blockportal_shape = new BlockPortal.Shape(world, blockposition, EnumDirection.EnumAxis.X); BlockPortal.Shape blockportal_shape = new BlockPortal.Shape(world, blockposition, EnumDirection.EnumAxis.X);
@ -44,7 +44,7 @@
@@ -108,6 +114,10 @@ @@ -108,6 +114,10 @@
public void a(World world, BlockPosition blockposition, IBlockData iblockdata, Entity entity) { public void a(World world, BlockPosition blockposition, IBlockData iblockdata, Entity entity) {
if (!entity.isPassenger() && !entity.isVehicle() && entity.aV()) { if (!entity.isPassenger() && !entity.isVehicle() && entity.aX()) {
+ // CraftBukkit start - Entity in portal + // CraftBukkit start - Entity in portal
+ EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ())); + EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ()));
+ world.getServer().getPluginManager().callEvent(event); + world.getServer().getPluginManager().callEvent(event);

View File

@ -13,11 +13,12 @@
public class BlockPumpkin extends BlockFacingHorizontal { public class BlockPumpkin extends BlockFacingHorizontal {
private ShapeDetector snowGolemPart; private ShapeDetector snowGolemPart;
@@ -41,17 +47,24 @@ @@ -40,18 +46,25 @@
int i;
int j; int j;
if ((shapedetector_shapedetectorcollection = this.getDetectorSnowGolem().a(world, blockposition)) != null) { + BlockStateListPopulator blockList = new BlockStateListPopulator(world.getWorld()); // CraftBukkit - Use BlockStateListPopulator
+ BlockStateListPopulator blockList = new BlockStateListPopulator(world.getWorld()); // CraftBukkit - Use BlockStateListPopulator if (shapedetector_shapedetectorcollection != null) {
for (i = 0; i < this.getDetectorSnowGolem().b(); ++i) { for (i = 0; i < this.getDetectorSnowGolem().b(); ++i) {
ShapeDetectorBlock shapedetectorblock = shapedetector_shapedetectorcollection.a(0, i, 0); ShapeDetectorBlock shapedetectorblock = shapedetector_shapedetectorcollection.a(0, i, 0);
@ -40,38 +41,38 @@
for (j = 0; j < 120; ++j) { for (j = 0; j < 120; ++j) {
world.addParticle(EnumParticle.SNOW_SHOVEL, (double) blockposition1.getX() + world.random.nextDouble(), (double) blockposition1.getY() + world.random.nextDouble() * 2.5D, (double) blockposition1.getZ() + world.random.nextDouble(), 0.0D, 0.0D, 0.0D, new int[0]); world.addParticle(EnumParticle.SNOW_SHOVEL, (double) blockposition1.getX() + world.random.nextDouble(), (double) blockposition1.getY() + world.random.nextDouble() * 2.5D, (double) blockposition1.getZ() + world.random.nextDouble(), 0.0D, 0.0D, 0.0D, new int[0]);
@@ -62,10 +75,16 @@ @@ -62,12 +75,17 @@
world.update(shapedetectorblock1.getPosition(), Blocks.AIR); world.update(shapedetectorblock1.getPosition(), Blocks.AIR);
} }
+ } // CraftBukkit end + } // CraftBukkit end
} else if ((shapedetector_shapedetectorcollection = this.getDetectorIronGolem().a(world, blockposition)) != null) { } else {
+ BlockStateListPopulator blockList = new BlockStateListPopulator(world.getWorld()); // CraftBukkit - Use BlockStateListPopulator shapedetector_shapedetectorcollection = this.getDetectorIronGolem().a(world, blockposition);
for (i = 0; i < this.getDetectorIronGolem().c(); ++i) { if (shapedetector_shapedetectorcollection != null) {
for (int k = 0; k < this.getDetectorIronGolem().b(); ++k) { for (i = 0; i < this.getDetectorIronGolem().c(); ++i) {
- world.setTypeAndData(shapedetector_shapedetectorcollection.a(i, k, 0).getPosition(), Blocks.AIR.getBlockData(), 2); for (int k = 0; k < this.getDetectorIronGolem().b(); ++k) {
+ // CraftBukkit start - world.setTypeAndData(shapedetector_shapedetectorcollection.a(i, k, 0).getPosition(), Blocks.AIR.getBlockData(), 2);
+ // world.setTypeAndData(shapedetectorcollection.a(i, k, 0).d(), Blocks.AIR.getBlockData(), 2); + // CraftBukkit start
+ BlockPosition pos = shapedetector_shapedetectorcollection.a(i, k, 0).getPosition(); + // world.setTypeAndData(shapedetector_shapedetectorcollection.a(i, k, 0).getPosition(), Blocks.AIR.getBlockData(), 2);
+ blockList.setTypeId(pos.getX(), pos.getY(), pos.getZ(), 0); + BlockPosition pos = shapedetector_shapedetectorcollection.a(i, k, 0).getPosition();
+ // CraftBukkit end + blockList.setTypeId(pos.getX(), pos.getY(), pos.getZ(), 0);
+ // CraftBukkit end
}
} }
}
@@ -74,7 +93,10 @@ @@ -76,7 +94,9 @@
entityirongolem.setPlayerCreated(true); entityirongolem.setPlayerCreated(true);
entityirongolem.setPositionRotation((double) blockposition2.getX() + 0.5D, (double) blockposition2.getY() + 0.05D, (double) blockposition2.getZ() + 0.5D, 0.0F, 0.0F); entityirongolem.setPositionRotation((double) blockposition2.getX() + 0.5D, (double) blockposition2.getY() + 0.05D, (double) blockposition2.getZ() + 0.5D, 0.0F, 0.0F);
- world.addEntity(entityirongolem); - world.addEntity(entityirongolem);
+
+ // CraftBukkit start + // CraftBukkit start
+ if (world.addEntity(entityirongolem, SpawnReason.BUILD_IRONGOLEM)) { + if (world.addEntity(entityirongolem, SpawnReason.BUILD_IRONGOLEM)) {
+ blockList.updateList(); + blockList.updateList();
for (j = 0; j < 120; ++j) { for (j = 0; j < 120; ++j) {
world.addParticle(EnumParticle.SNOWBALL, (double) blockposition2.getX() + world.random.nextDouble(), (double) blockposition2.getY() + world.random.nextDouble() * 3.9D, (double) blockposition2.getZ() + world.random.nextDouble(), 0.0D, 0.0D, 0.0D, new int[0]); world.addParticle(EnumParticle.SNOWBALL, (double) blockposition2.getX() + world.random.nextDouble(), (double) blockposition2.getY() + world.random.nextDouble() * 3.9D, (double) blockposition2.getZ() + world.random.nextDouble(), 0.0D, 0.0D, 0.0D, new int[0]);
@@ -87,6 +109,7 @@ @@ -90,6 +110,7 @@
world.update(shapedetectorblock2.getPosition(), Blocks.AIR); }
} }
} }
+ } // CraftBukkit end + } // CraftBukkit end

View File

@ -8,7 +8,7 @@
+ +
public class BlockRedstoneTorch extends BlockTorch { public class BlockRedstoneTorch extends BlockTorch {
private static Map<World, List<BlockRedstoneTorch.RedstoneUpdateInfo>> g = Maps.newHashMap(); private static final Map<World, List<BlockRedstoneTorch.RedstoneUpdateInfo>> g = Maps.newHashMap();
@@ -14,7 +16,7 @@ @@ -14,7 +16,7 @@
private boolean a(World world, BlockPosition blockposition, boolean flag) { private boolean a(World world, BlockPosition blockposition, boolean flag) {
@ -43,7 +43,7 @@
+ // CraftBukkit end + // CraftBukkit end
world.setTypeAndData(blockposition, Blocks.UNLIT_REDSTONE_TORCH.getBlockData().set(BlockRedstoneTorch.FACING, iblockdata.get(BlockRedstoneTorch.FACING)), 3); world.setTypeAndData(blockposition, Blocks.UNLIT_REDSTONE_TORCH.getBlockData().set(BlockRedstoneTorch.FACING, iblockdata.get(BlockRedstoneTorch.FACING)), 3);
if (this.a(world, blockposition, true)) { if (this.a(world, blockposition, true)) {
world.a((EntityHuman) null, blockposition, SoundEffects.eG, SoundCategory.BLOCKS, 0.5F, 2.6F + (world.random.nextFloat() - world.random.nextFloat()) * 0.8F); world.a((EntityHuman) null, blockposition, SoundEffects.eR, SoundCategory.BLOCKS, 0.5F, 2.6F + (world.random.nextFloat() - world.random.nextFloat()) * 0.8F);
@@ -115,6 +134,15 @@ @@ -115,6 +134,15 @@
} }
} }

View File

@ -82,8 +82,8 @@
break label66; break label66;
@@ -63,11 +107,13 @@ @@ -63,11 +107,13 @@
if (!flag) { if (!flag) {
j = 0;
i = 0; i = 0;
j = 0;
+ treeType = TreeType.REDWOOD; // CraftBukkit + treeType = TreeType.REDWOOD; // CraftBukkit
object = new WorldGenTaiga2(true); object = new WorldGenTaiga2(true);
} }
@ -104,8 +104,8 @@
break label78; break label78;
@@ -89,11 +136,13 @@ @@ -89,11 +136,13 @@
if (!flag) { if (!flag) {
j = 0;
i = 0; i = 0;
j = 0;
+ treeType = TreeType.SMALL_JUNGLE; // CraftBukkit + treeType = TreeType.SMALL_JUNGLE; // CraftBukkit
object = new WorldGenTrees(true, 4 + random.nextInt(7), iblockdata1, iblockdata2, false); object = new WorldGenTrees(true, 4 + random.nextInt(7), iblockdata1, iblockdata2, false);
} }

View File

@ -8,7 +8,7 @@
public class BlockTrapdoor extends Block { public class BlockTrapdoor extends Block {
@@ -94,6 +95,19 @@ @@ -91,6 +92,19 @@
boolean flag = world.isBlockIndirectlyPowered(blockposition); boolean flag = world.isBlockIndirectlyPowered(blockposition);
if (flag || block.getBlockData().m()) { if (flag || block.getBlockData().m()) {

View File

@ -32,20 +32,20 @@
+ org.bukkit.block.Block source = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); + org.bukkit.block.Block source = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
+ org.bukkit.block.Block bukkitBlock = world.getWorld().getBlockAt(blockposition2.getX(), blockposition2.getY(), blockposition2.getZ()); + org.bukkit.block.Block bukkitBlock = world.getWorld().getBlockAt(blockposition2.getX(), blockposition2.getY(), blockposition2.getZ());
+ +
if (flag1 && this.x(world.getType(blockposition3))) { if (flag2 && this.x(world.getType(blockposition3))) {
- world.setTypeAndData(blockposition2, this.getBlockData().set(getDirection(enumdirection2), Boolean.valueOf(true)), 2); - world.setTypeAndData(blockposition2, this.getBlockData().set(getDirection(enumdirection2), Boolean.valueOf(true)), 2);
+ // world.setTypeAndData(blockposition2, this.getBlockData().set(getDirection(enumdirection2), Boolean.valueOf(true)), 2); + // world.setTypeAndData(blockposition2, this.getBlockData().set(getDirection(enumdirection2), Boolean.valueOf(true)), 2);
+ CraftEventFactory.handleBlockSpreadEvent(bukkitBlock, source, this, toLegacyData(this.getBlockData().set(getDirection(enumdirection2), Boolean.valueOf(true)))); + CraftEventFactory.handleBlockSpreadEvent(bukkitBlock, source, this, toLegacyData(this.getBlockData().set(getDirection(enumdirection2), Boolean.valueOf(true))));
} else if (flag2 && this.x(world.getType(blockposition4))) { } else if (flag3 && this.x(world.getType(blockposition4))) {
- world.setTypeAndData(blockposition2, this.getBlockData().set(getDirection(enumdirection3), Boolean.valueOf(true)), 2); - world.setTypeAndData(blockposition2, this.getBlockData().set(getDirection(enumdirection3), Boolean.valueOf(true)), 2);
+ // world.setTypeAndData(blockposition2, this.getBlockData().set(getDirection(enumdirection3), Boolean.valueOf(true)), 2); + // world.setTypeAndData(blockposition2, this.getBlockData().set(getDirection(enumdirection3), Boolean.valueOf(true)), 2);
+ CraftEventFactory.handleBlockSpreadEvent(bukkitBlock, source, this, toLegacyData(this.getBlockData().set(getDirection(enumdirection3), Boolean.valueOf(true)))); + CraftEventFactory.handleBlockSpreadEvent(bukkitBlock, source, this, toLegacyData(this.getBlockData().set(getDirection(enumdirection3), Boolean.valueOf(true))));
} else if (flag1 && world.isEmpty(blockposition3) && this.x(world.getType(blockposition.shift(enumdirection2)))) { } else if (flag2 && world.isEmpty(blockposition3) && this.x(world.getType(blockposition.shift(enumdirection2)))) {
- world.setTypeAndData(blockposition3, this.getBlockData().set(getDirection(enumdirection.opposite()), Boolean.valueOf(true)), 2); - world.setTypeAndData(blockposition3, this.getBlockData().set(getDirection(enumdirection.opposite()), Boolean.valueOf(true)), 2);
+ // world.setTypeAndData(blockposition3, this.getBlockData().set(getDirection(enumdirection.opposite()), Boolean.valueOf(true)), 2); + // world.setTypeAndData(blockposition3, this.getBlockData().set(getDirection(enumdirection.opposite()), Boolean.valueOf(true)), 2);
+ bukkitBlock = world.getWorld().getBlockAt(blockposition3.getX(), blockposition3.getY(), blockposition3.getZ()); + bukkitBlock = world.getWorld().getBlockAt(blockposition3.getX(), blockposition3.getY(), blockposition3.getZ());
+ CraftEventFactory.handleBlockSpreadEvent(bukkitBlock, source, this, toLegacyData(this.getBlockData().set(getDirection(enumdirection.opposite()), Boolean.valueOf(true)))); + CraftEventFactory.handleBlockSpreadEvent(bukkitBlock, source, this, toLegacyData(this.getBlockData().set(getDirection(enumdirection.opposite()), Boolean.valueOf(true))));
} else if (flag2 && world.isEmpty(blockposition4) && this.x(world.getType(blockposition.shift(enumdirection3)))) { } else if (flag3 && world.isEmpty(blockposition4) && this.x(world.getType(blockposition.shift(enumdirection3)))) {
- world.setTypeAndData(blockposition4, this.getBlockData().set(getDirection(enumdirection.opposite()), Boolean.valueOf(true)), 2); - world.setTypeAndData(blockposition4, this.getBlockData().set(getDirection(enumdirection.opposite()), Boolean.valueOf(true)), 2);
+ // world.setTypeAndData(blockposition4, this.getBlockData().set(getDirection(enumdirection.opposite()), Boolean.valueOf(true)), 2); + // world.setTypeAndData(blockposition4, this.getBlockData().set(getDirection(enumdirection.opposite()), Boolean.valueOf(true)), 2);
+ bukkitBlock = world.getWorld().getBlockAt(blockposition4.getX(), blockposition4.getY(), blockposition4.getZ()); + bukkitBlock = world.getWorld().getBlockAt(blockposition4.getX(), blockposition4.getY(), blockposition4.getZ());

View File

@ -59,8 +59,8 @@
+ +
public Chunk(World world, ChunkSnapshot chunksnapshot, int i, int j) { public Chunk(World world, ChunkSnapshot chunksnapshot, int i, int j) {
this(world, i, j); this(world, i, j);
short short0 = 256; boolean flag = true;
@@ -466,7 +503,8 @@ @@ -467,7 +504,8 @@
} }
} }
@ -70,20 +70,7 @@
block.onPlace(this.world, blockposition, iblockdata); block.onPlace(this.world, blockposition, iblockdata);
} }
@@ -547,7 +585,11 @@ @@ -604,7 +642,15 @@
int j = MathHelper.floor(entity.locZ / 16.0D);
if (i != this.locX || j != this.locZ) {
- Chunk.e.warn("Wrong location! (" + i + ", " + j + ") should be (" + this.locX + ", " + this.locZ + "), " + entity, new Object[] { entity});
+ // CraftBukkit start
+ Bukkit.getLogger().warning("Wrong location for " + entity + " in world '" + world.getWorld().getName() + "'!");
+ // Chunk.e.warn("Wrong location! (" + i + ", " + j + ") should be (" + this.locX + ", " + this.locZ + "), " + entity, new Object[] { entity});
+ Bukkit.getLogger().warning("Entity is at " + entity.locX + "," + entity.locZ + " (chunk " + i + "," + j + ") but was stored in chunk " + this.locX + "," + this.locZ);
+ // CraftBukkit end
entity.die();
}
@@ -602,7 +644,15 @@
@Nullable @Nullable
public TileEntity a(BlockPosition blockposition, Chunk.EnumTileEntityState chunk_enumtileentitystate) { public TileEntity a(BlockPosition blockposition, Chunk.EnumTileEntityState chunk_enumtileentitystate) {
@ -100,7 +87,7 @@
if (tileentity == null) { if (tileentity == null) {
if (chunk_enumtileentitystate == Chunk.EnumTileEntityState.IMMEDIATE) { if (chunk_enumtileentitystate == Chunk.EnumTileEntityState.IMMEDIATE) {
@@ -637,6 +687,13 @@ @@ -639,6 +685,13 @@
tileentity.z(); tileentity.z();
this.tileEntities.put(blockposition, tileentity); this.tileEntities.put(blockposition, tileentity);
@ -114,17 +101,18 @@
} }
} }
@@ -680,7 +737,21 @@ @@ -681,9 +734,21 @@
} int i = aentityslice.length;
for (int i = 0; i < this.entitySlices.length; ++i) { for (int j = 0; j < i; ++j) {
- this.world.c((Collection) this.entitySlices[i]); - EntitySlice entityslice = aentityslice[j];
+ // CraftBukkit start + // CraftBukkit start
+ List<Entity> newList = Lists.newArrayList(this.entitySlices[i]); + List<Entity> newList = Lists.newArrayList(aentityslice[j]);
+ java.util.Iterator<Entity> iter = newList.iterator(); + java.util.Iterator<Entity> iter = newList.iterator();
+ while (iter.hasNext()) { + while (iter.hasNext()) {
+ Entity entity = iter.next(); + Entity entity = iter.next();
+
- this.world.c((Collection) entityslice);
+ // Do not pass along players, as doing so can get them stuck outside of time. + // Do not pass along players, as doing so can get them stuck outside of time.
+ // (which for example disables inventory icon updates and prevents block breaking) + // (which for example disables inventory icon updates and prevents block breaking)
+ if (entity instanceof EntityPlayer) { + if (entity instanceof EntityPlayer) {
@ -137,7 +125,7 @@
} }
} }
@@ -738,8 +809,8 @@ @@ -745,8 +810,8 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next(); Entity entity = (Entity) iterator.next();
@ -148,7 +136,7 @@
} }
} }
} }
@@ -802,6 +873,29 @@ @@ -809,6 +874,29 @@
} else { } else {
this.o(); this.o();
chunkgenerator.recreateStructures(this.locX, this.locZ); chunkgenerator.recreateStructures(this.locX, this.locZ);

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/ChunkProviderServer.java --- a/net/minecraft/server/ChunkProviderServer.java
+++ b/net/minecraft/server/ChunkProviderServer.java +++ b/net/minecraft/server/ChunkProviderServer.java
@@ -14,10 +14,16 @@ @@ -14,6 +14,12 @@
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -13,11 +13,6 @@
public class ChunkProviderServer implements IChunkProvider { public class ChunkProviderServer implements IChunkProvider {
private static final Logger a = LogManager.getLogger(); private static final Logger a = LogManager.getLogger();
- private final Set<Long> unloadQueue = Sets.newHashSet();
+ public final Set<Long> unloadQueue = Sets.newHashSet(); // PAIL: private -> public
public final ChunkGenerator chunkGenerator;
private final IChunkLoader chunkLoader;
public final Long2ObjectMap<Chunk> chunks = new Long2ObjectOpenHashMap(8192);
@@ -69,19 +75,74 @@ @@ -69,19 +75,74 @@
Chunk chunk = this.getLoadedChunkAt(i, j); Chunk chunk = this.getLoadedChunkAt(i, j);

View File

@ -44,10 +44,10 @@
- protected Chunk a(World world, int i, int j, NBTTagCompound nbttagcompound) { - protected Chunk a(World world, int i, int j, NBTTagCompound nbttagcompound) {
+ protected Object[] a(World world, int i, int j, NBTTagCompound nbttagcompound) { // CraftBukkit - return Chunk -> Object[] + protected Object[] a(World world, int i, int j, NBTTagCompound nbttagcompound) { // CraftBukkit - return Chunk -> Object[]
if (!nbttagcompound.hasKeyOfType("Level", 10)) { if (!nbttagcompound.hasKeyOfType("Level", 10)) {
ChunkRegionLoader.a.error("Chunk file at " + i + "," + j + " is missing level data, skipping"); ChunkRegionLoader.a.error("Chunk file at {},{} is missing level data, skipping", new Object[] { Integer.valueOf(i), Integer.valueOf(j)});
return null; return null;
@@ -64,10 +92,28 @@ @@ -64,10 +92,28 @@
ChunkRegionLoader.a.error("Chunk file at " + i + "," + j + " is in the wrong location; relocating. (Expected " + i + ", " + j + ", got " + chunk.locX + ", " + chunk.locZ + ")"); ChunkRegionLoader.a.error("Chunk file at {},{} is in the wrong location; relocating. (Expected {}, {}, got {}, {})", new Object[] { Integer.valueOf(i), Integer.valueOf(j), Integer.valueOf(i), Integer.valueOf(j), Integer.valueOf(chunk.locX), Integer.valueOf(chunk.locZ)});
nbttagcompound1.setInt("xPos", i); nbttagcompound1.setInt("xPos", i);
nbttagcompound1.setInt("zPos", j); nbttagcompound1.setInt("zPos", j);
+ +
@ -76,7 +76,7 @@
} }
} }
} }
@@ -296,6 +342,13 @@ @@ -326,6 +372,13 @@
chunk.a(nbttagcompound.getByteArray("Biomes")); chunk.a(nbttagcompound.getByteArray("Biomes"));
} }
@ -90,7 +90,7 @@
NBTTagList nbttaglist1 = nbttagcompound.getList("Entities", 10); NBTTagList nbttaglist1 = nbttagcompound.getList("Entities", 10);
if (nbttaglist1 != null) { if (nbttaglist1 != null) {
@@ -339,7 +392,7 @@ @@ -369,7 +422,7 @@
} }
} }
@ -99,7 +99,29 @@
} }
@Nullable @Nullable
@@ -403,8 +456,14 @@ @@ -397,14 +450,20 @@
}
@Nullable
+ // CraftBukkit start
public static Entity a(NBTTagCompound nbttagcompound, World world, double d0, double d1, double d2, boolean flag) {
+ return spawnEntity(nbttagcompound, world, d0, d1, d2, flag, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.DEFAULT);
+ }
+
+ public static Entity spawnEntity(NBTTagCompound nbttagcompound, World world, double d0, double d1, double d2, boolean flag, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason spawnReason) {
+ // CraftBukkit end
Entity entity = a(nbttagcompound, world);
if (entity == null) {
return null;
} else {
entity.setPositionRotation(d0, d1, d2, entity.yaw, entity.pitch);
- if (flag && !world.addEntity(entity)) {
+ if (flag && !world.addEntity(entity, spawnReason)) { // CraftBukkit
return null;
} else {
if (nbttagcompound.hasKeyOfType("Passengers", 9)) {
@@ -433,8 +492,14 @@
} }
} }
@ -112,6 +134,6 @@
+ public static void a(Entity entity, World world, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason reason) { + public static void a(Entity entity, World world, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason reason) {
+ if (world.addEntity(entity, reason) && entity.isVehicle()) { + if (world.addEntity(entity, reason) && entity.isVehicle()) {
+ // CraftBukkit end + // CraftBukkit end
Iterator iterator = entity.bv().iterator(); Iterator iterator = entity.bx().iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {

View File

@ -11,7 +11,7 @@
public class CommandExecute extends CommandAbstract { public class CommandExecute extends CommandAbstract {
@@ -50,7 +54,10 @@ @@ -55,7 +59,10 @@
} }
String s = a(astring, b0); String s = a(astring, b0);
@ -23,7 +23,7 @@
public String getName() { public String getName() {
return entity.getName(); return entity.getName();
} }
@@ -95,25 +102,57 @@ @@ -100,25 +107,57 @@
return entity.h(); return entity.h();
} }
}; };

View File

@ -3,14 +3,14 @@
@@ -28,6 +28,12 @@ @@ -28,6 +28,12 @@
EntityPlayer entityplayer = astring.length >= 2 ? a(minecraftserver, icommandlistener, astring[1]) : a(icommandlistener); EntityPlayer entityplayer = astring.length >= 2 ? a(minecraftserver, icommandlistener, astring[1]) : a(icommandlistener);
entityplayer.a(worldsettings_enumgamemode); entityplayer.a(enumgamemode);
+ // CraftBukkit start - handle event cancelling the change + // CraftBukkit start - handle event cancelling the change
+ if (entityplayer.playerInteractManager.getGameMode() != worldsettings_enumgamemode) { + if (entityplayer.playerInteractManager.getGameMode() != enumgamemode) {
+ icommandlistener.sendMessage(new ChatComponentText("Failed to set the gamemode of '" + entityplayer.getName() + "'")); + icommandlistener.sendMessage(new ChatComponentText("Failed to set the gamemode of '" + entityplayer.getName() + "'"));
+ return; + return;
+ } + }
+ // CraftBukkit end + // CraftBukkit end
ChatMessage chatmessage = new ChatMessage("gameMode." + worldsettings_enumgamemode.b(), new Object[0]); ChatMessage chatmessage = new ChatMessage("gameMode." + enumgamemode.b(), new Object[0]);
if (icommandlistener.getWorld().getGameRules().getBoolean("sendCommandFeedback")) { if (icommandlistener.getWorld().getGameRules().getBoolean("sendCommandFeedback")) {
@@ -50,10 +56,17 @@ @@ -50,10 +56,17 @@

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/CommandSpreadPlayers.java --- a/net/minecraft/server/CommandSpreadPlayers.java
+++ b/net/minecraft/server/CommandSpreadPlayers.java +++ b/net/minecraft/server/CommandSpreadPlayers.java
@@ -236,9 +236,16 @@ @@ -240,9 +240,16 @@
} }
public List<String> tabComplete(MinecraftServer minecraftserver, ICommandListener icommandlistener, String[] astring, @Nullable BlockPosition blockposition) { public List<String> tabComplete(MinecraftServer minecraftserver, ICommandListener icommandlistener, String[] astring, @Nullable BlockPosition blockposition) {
@ -18,7 +18,7 @@
static class Location2D { static class Location2D {
double a; double a;
@@ -305,7 +312,7 @@ @@ -309,7 +316,7 @@
} }
blockposition = blockposition.down(); blockposition = blockposition.down();
@ -27,7 +27,7 @@
return blockposition.getY() + 1; return blockposition.getY() + 1;
} }
@@ -321,7 +328,7 @@ @@ -325,7 +332,7 @@
} }
blockposition = blockposition.down(); blockposition = blockposition.down();
@ -36,7 +36,7 @@
} while (material == Material.AIR); } while (material == Material.AIR);
return !material.isLiquid() && material != Material.FIRE; return !material.isLiquid() && material != Material.FIRE;
@@ -331,5 +338,12 @@ @@ -335,5 +342,12 @@
this.a = MathHelper.a(random, d0, d2); this.a = MathHelper.a(random, d0, d2);
this.b = MathHelper.a(random, d1, d3); this.b = MathHelper.a(random, d1, d3);
} }

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/CommandTp.java --- a/net/minecraft/server/CommandTp.java
+++ b/net/minecraft/server/CommandTp.java +++ b/net/minecraft/server/CommandTp.java
@@ -98,27 +98,28 @@ @@ -53,17 +53,11 @@
} else { } else {
Entity entity = b(minecraftserver, icommandlistener, astring[astring.length - 1]); Entity entity = b(minecraftserver, icommandlistener, astring[astring.length - 1]);
@ -22,6 +22,7 @@
} }
} }
} }
@@ -126,10 +120,17 @@
} }
public List<String> tabComplete(MinecraftServer minecraftserver, ICommandListener icommandlistener, String[] astring, @Nullable BlockPosition blockposition) { public List<String> tabComplete(MinecraftServer minecraftserver, ICommandListener icommandlistener, String[] astring, @Nullable BlockPosition blockposition) {

View File

@ -20,7 +20,7 @@
public List<ItemStack> b = Lists.newArrayList(); public List<ItemStack> b = Lists.newArrayList();
@@ -19,12 +30,24 @@ @@ -19,12 +30,24 @@
protected List<ICrafting> listeners = Lists.newArrayList(); protected List<ICrafting> listeners = Lists.newArrayList();
private Set<EntityHuman> i = Sets.newHashSet(); private final Set<EntityHuman> i = Sets.newHashSet();
+ // CraftBukkit start + // CraftBukkit start
+ public boolean checkReachable = true; + public boolean checkReachable = true;

View File

@ -8,7 +8,7 @@
public class ContainerBeacon extends Container { public class ContainerBeacon extends Container {
private IInventory beacon; private final IInventory beacon;
private final ContainerBeacon.SlotBeacon f; private final ContainerBeacon.SlotBeacon f;
+ // CraftBukkit start + // CraftBukkit start
+ private CraftInventoryView bukkitEntity = null; + private CraftInventoryView bukkitEntity = null;
@ -18,9 +18,9 @@
public ContainerBeacon(IInventory iinventory, IInventory iinventory1) { public ContainerBeacon(IInventory iinventory, IInventory iinventory1) {
+ player = (PlayerInventory) iinventory; // CraftBukkit - TODO: check this + player = (PlayerInventory) iinventory; // CraftBukkit - TODO: check this
this.beacon = iinventory1; this.beacon = iinventory1;
this.a((Slot) (this.f = new ContainerBeacon.SlotBeacon(iinventory1, 0, 136, 110))); this.f = new ContainerBeacon.SlotBeacon(iinventory1, 0, 136, 110);
byte b0 = 36; this.a((Slot) this.f);
@@ -49,6 +55,7 @@ @@ -50,6 +56,7 @@
} }
public boolean a(EntityHuman entityhuman) { public boolean a(EntityHuman entityhuman) {
@ -28,7 +28,7 @@
return this.beacon.a(entityhuman); return this.beacon.a(entityhuman);
} }
@@ -113,4 +120,17 @@ @@ -114,4 +121,17 @@
return 1; return 1;
} }
} }

View File

@ -11,8 +11,8 @@
public class ContainerChest extends Container { public class ContainerChest extends Container {
private IInventory container; private final IInventory container;
private int f; private final int f;
+ // CraftBukkit start + // CraftBukkit start
+ private CraftInventoryView bukkitEntity = null; + private CraftInventoryView bukkitEntity = null;
+ private PlayerInventory player; + private PlayerInventory player;

View File

@ -11,7 +11,7 @@
public class ContainerDispenser extends Container { public class ContainerDispenser extends Container {
public IInventory items; public final IInventory items;
+ // CraftBukkit start + // CraftBukkit start
+ private CraftInventoryView bukkitEntity = null; + private CraftInventoryView bukkitEntity = null;
+ private PlayerInventory player; + private PlayerInventory player;

View File

@ -34,8 +34,8 @@
+ return new org.bukkit.Location(world.getWorld(), position.getX(), position.getY(), position.getZ()); + return new org.bukkit.Location(world.getWorld(), position.getX(), position.getY(), position.getZ());
+ } + }
}; };
private World world; public World world;
private BlockPosition position; private final BlockPosition position;
@@ -23,6 +41,10 @@ @@ -23,6 +41,10 @@
public int[] costs = new int[3]; public int[] costs = new int[3];
public int[] h = new int[] { -1, -1, -1}; public int[] h = new int[] { -1, -1, -1};
@ -150,19 +150,19 @@
if (!entityhuman.abilities.canInstantlyBuild) { if (!entityhuman.abilities.canInstantlyBuild) {
itemstack1.count -= j; itemstack1.count -= j;
if (itemstack1.count <= 0) { if (itemstack1.count <= 0) {
@@ -227,6 +297,11 @@ @@ -228,6 +298,11 @@
public void b(EntityHuman entityhuman) { public void b(EntityHuman entityhuman) {
super.b(entityhuman); super.b(entityhuman);
+ // CraftBukkit Start - If an enchantable was opened from a null location, set the world to the player's world, preventing a crash + // CraftBukkit Start - If an enchantable was opened from a null location, set the world to the player's world, preventing a crash
+ if(this.world == null) { + if (this.world == null) {
+ this.world = entityhuman.getWorld(); + this.world = entityhuman.getWorld();
+ } + }
+ // CraftBukkit end + // CraftBukkit end
if (!this.world.isClientSide) { if (!this.world.isClientSide) {
for (int i = 0; i < this.enchantSlots.getSize(); ++i) { for (int i = 0; i < this.enchantSlots.getSize(); ++i) {
ItemStack itemstack = this.enchantSlots.splitWithoutUpdate(i); ItemStack itemstack = this.enchantSlots.splitWithoutUpdate(i);
@@ -240,6 +315,7 @@ @@ -241,6 +316,7 @@
} }
public boolean a(EntityHuman entityhuman) { public boolean a(EntityHuman entityhuman) {
@ -170,7 +170,7 @@
return this.world.getType(this.position).getBlock() != Blocks.ENCHANTING_TABLE ? false : entityhuman.e((double) this.position.getX() + 0.5D, (double) this.position.getY() + 0.5D, (double) this.position.getZ() + 0.5D) <= 64.0D; return this.world.getType(this.position).getBlock() != Blocks.ENCHANTING_TABLE ? false : entityhuman.e((double) this.position.getX() + 0.5D, (double) this.position.getY() + 0.5D, (double) this.position.getZ() + 0.5D) <= 64.0D;
} }
@@ -293,4 +369,17 @@ @@ -294,4 +370,17 @@
return itemstack; return itemstack;
} }

View File

@ -33,7 +33,7 @@
this.hopper = iinventory; this.hopper = iinventory;
+ this.player = playerinventory; // CraftBukkit - save player + this.player = playerinventory; // CraftBukkit - save player
iinventory.startOpen(entityhuman); iinventory.startOpen(entityhuman);
byte b0 = 51; boolean flag = true;
@@ -30,6 +51,7 @@ @@ -30,6 +51,7 @@
} }

View File

@ -12,8 +12,8 @@
public class ContainerHorse extends Container { public class ContainerHorse extends Container {
private IInventory a; private final IInventory a;
private EntityHorse f; private final EntityHorse f;
+ // CraftBukkit start + // CraftBukkit start
+ org.bukkit.craftbukkit.inventory.CraftInventoryView bukkitEntity; + org.bukkit.craftbukkit.inventory.CraftInventoryView bukkitEntity;
@ -34,4 +34,4 @@
+ // CraftBukkit end + // CraftBukkit end
this.a = iinventory1; this.a = iinventory1;
this.f = entityhorse; this.f = entityhorse;
byte b0 = 3; boolean flag = true;

View File

@ -9,7 +9,7 @@
public class ContainerMerchant extends Container { public class ContainerMerchant extends Container {
@@ -8,6 +9,19 @@ @@ -8,6 +9,19 @@
private InventoryMerchant f; private final InventoryMerchant f;
private final World g; private final World g;
+ // CraftBukkit start + // CraftBukkit start

View File

@ -66,7 +66,7 @@
} }
public void b(EntityHuman entityhuman) { public void b(EntityHuman entityhuman) {
@@ -146,4 +171,17 @@ @@ -150,4 +175,17 @@
public boolean a(ItemStack itemstack, Slot slot) { public boolean a(ItemStack itemstack, Slot slot) {
return slot.inventory != this.resultInventory && super.a(itemstack, slot); return slot.inventory != this.resultInventory && super.a(itemstack, slot);
} }

View File

@ -15,8 +15,8 @@
- public IInventory resultInventory = new InventoryCraftResult(); - public IInventory resultInventory = new InventoryCraftResult();
+ public InventoryCrafting craftInventory; // CraftBukkit - move initialization into constructor + public InventoryCrafting craftInventory; // CraftBukkit - move initialization into constructor
+ public IInventory resultInventory; // CraftBukkit - move initialization into constructor + public IInventory resultInventory; // CraftBukkit - move initialization into constructor
private World g; private final World g;
private BlockPosition h; private final BlockPosition h;
+ // CraftBukkit start + // CraftBukkit start
+ private CraftInventoryView bukkitEntity = null; + private CraftInventoryView bukkitEntity = null;
+ private PlayerInventory player; + private PlayerInventory player;

View File

@ -17,10 +17,10 @@
public static CraftingManager getInstance() { public static CraftingManager getInstance() {
return CraftingManager.a; return CraftingManager.a;
@@ -177,7 +183,12 @@ @@ -178,7 +184,12 @@
this.registerShapedRecipe(new ItemStack(Blocks.HOPPER), new Object[] { "I I", "ICI", " I ", Character.valueOf('I'), Items.IRON_INGOT, Character.valueOf('C'), Blocks.CHEST});
this.registerShapedRecipe(new ItemStack(Items.ARMOR_STAND, 1), new Object[] { "///", " / ", "/_/", Character.valueOf('/'), Items.STICK, Character.valueOf('_'), new ItemStack(Blocks.STONE_SLAB, 1, BlockDoubleStepAbstract.EnumStoneSlabVariant.STONE.a())}); this.registerShapedRecipe(new ItemStack(Items.ARMOR_STAND, 1), new Object[] { "///", " / ", "/_/", Character.valueOf('/'), Items.STICK, Character.valueOf('_'), new ItemStack(Blocks.STONE_SLAB, 1, BlockDoubleStepAbstract.EnumStoneSlabVariant.STONE.a())});
this.registerShapedRecipe(new ItemStack(Blocks.END_ROD, 4), new Object[] { "/", "#", Character.valueOf('/'), Items.BLAZE_ROD, Character.valueOf('#'), Items.CHORUS_FRUIT_POPPED}); this.registerShapedRecipe(new ItemStack(Blocks.END_ROD, 4), new Object[] { "/", "#", Character.valueOf('/'), Items.BLAZE_ROD, Character.valueOf('#'), Items.CHORUS_FRUIT_POPPED});
this.registerShapedRecipe(new ItemStack(Blocks.di, 1), new Object[] { "XXX", "XXX", "XXX", Character.valueOf('X'), new ItemStack(Items.DYE, 1, EnumColor.WHITE.getInvColorIndex())});
- Collections.sort(this.recipes, new Comparator() { - Collections.sort(this.recipes, new Comparator() {
+ sort(); + sort();
+ } + }
@ -31,7 +31,7 @@
public int a(IRecipe irecipe, IRecipe irecipe1) { public int a(IRecipe irecipe, IRecipe irecipe1) {
return irecipe instanceof ShapelessRecipes && irecipe1 instanceof ShapedRecipes ? 1 : (irecipe1 instanceof ShapelessRecipes && irecipe instanceof ShapedRecipes ? -1 : (irecipe1.a() < irecipe.a() ? -1 : (irecipe1.a() > irecipe.a() ? 1 : 0))); return irecipe instanceof ShapelessRecipes && irecipe1 instanceof ShapedRecipes ? 1 : (irecipe1 instanceof ShapelessRecipes && irecipe instanceof ShapedRecipes ? -1 : (irecipe1.a() < irecipe.a() ? -1 : (irecipe1.a() > irecipe.a() ? 1 : 0)));
} }
@@ -285,13 +296,18 @@ @@ -290,13 +301,18 @@
do { do {
if (!iterator.hasNext()) { if (!iterator.hasNext()) {

View File

@ -12,7 +12,7 @@
import java.net.InetAddress; import java.net.InetAddress;
import java.net.Proxy; import java.net.Proxy;
import java.util.Collections; import java.util.Collections;
@@ -17,10 +16,20 @@ @@ -18,11 +17,21 @@
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -29,14 +29,15 @@
public class DedicatedServer extends MinecraftServer implements IMinecraftServer { public class DedicatedServer extends MinecraftServer implements IMinecraftServer {
private static final Logger LOGGER = LogManager.getLogger(); private static final Logger LOGGER = LogManager.getLogger();
private static final Pattern l = Pattern.compile("^[a-fA-F0-9]{40}$");
- private final List<ServerCommand> serverCommandQueue = Collections.synchronizedList(Lists.newArrayList()); - private final List<ServerCommand> serverCommandQueue = Collections.synchronizedList(Lists.newArrayList());
+ private final List<ServerCommand> serverCommandQueue = Collections.synchronizedList(Lists.<ServerCommand>newArrayList()); // CraftBukkit - fix decompile error + private final List<ServerCommand> serverCommandQueue = Collections.synchronizedList(Lists.<ServerCommand>newArrayList()); // CraftBukkit - fix decompile error
private RemoteStatusListener m; private RemoteStatusListener n;
public final RemoteControlCommandListener remoteControlCommandListener = new RemoteControlCommandListener(this); public final RemoteControlCommandListener remoteControlCommandListener = new RemoteControlCommandListener(this);
private RemoteControlListener o; private RemoteControlListener p;
@@ -30,8 +39,10 @@ @@ -32,8 +41,10 @@
private WorldSettings.EnumGamemode s; private EnumGamemode t;
private boolean t; private boolean u;
- public DedicatedServer(File file, DataConverterManager dataconvertermanager, YggdrasilAuthenticationService yggdrasilauthenticationservice, MinecraftSessionService minecraftsessionservice, GameProfileRepository gameprofilerepository, UserCache usercache) { - public DedicatedServer(File file, DataConverterManager dataconvertermanager, YggdrasilAuthenticationService yggdrasilauthenticationservice, MinecraftSessionService minecraftsessionservice, GameProfileRepository gameprofilerepository, UserCache usercache) {
- super(file, Proxy.NO_PROXY, dataconvertermanager, yggdrasilauthenticationservice, minecraftsessionservice, gameprofilerepository, usercache); - super(file, Proxy.NO_PROXY, dataconvertermanager, yggdrasilauthenticationservice, minecraftsessionservice, gameprofilerepository, usercache);
@ -47,8 +48,12 @@
Thread thread = new Thread("Server Infinisleeper") { Thread thread = new Thread("Server Infinisleeper") {
{ {
this.setDaemon(true); this.setDaemon(true);
@@ -53,13 +64,27 @@ @@ -52,16 +63,30 @@
protected boolean init() throws IOException { };
}
- protected boolean init() throws IOException {
+ public boolean init() throws IOException {
Thread thread = new Thread("Server console handler") { Thread thread = new Thread("Server console handler") {
public void run() { public void run() {
- BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(System.in)); - BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(System.in));
@ -78,7 +83,7 @@
} }
} catch (IOException ioexception) { } catch (IOException ioexception) {
DedicatedServer.LOGGER.error("Exception handling console input", ioexception); DedicatedServer.LOGGER.error("Exception handling console input", ioexception);
@@ -68,6 +93,27 @@ @@ -70,6 +95,27 @@
} }
}; };
@ -105,17 +110,17 @@
+ +
thread.setDaemon(true); thread.setDaemon(true);
thread.start(); thread.start();
DedicatedServer.LOGGER.info("Starting minecraft server version 1.9.4"); DedicatedServer.LOGGER.info("Starting minecraft server version 1.10");
@@ -76,7 +122,7 @@ @@ -78,7 +124,7 @@
} }
DedicatedServer.LOGGER.info("Loading properties"); DedicatedServer.LOGGER.info("Loading properties");
- this.propertyManager = new PropertyManager(new File("server.properties")); - this.propertyManager = new PropertyManager(new File("server.properties"));
+ this.propertyManager = new PropertyManager(this.options); // CraftBukkit - CLI argument support + this.propertyManager = new PropertyManager(this.options); // CraftBukkit - CLI argument support
this.q = new EULA(new File("eula.txt")); this.r = new EULA(new File("eula.txt"));
if (!this.q.a()) { if (!this.r.a()) {
DedicatedServer.LOGGER.info("You need to agree to the EULA in order to run the server. Go to eula.txt for more info."); DedicatedServer.LOGGER.info("You need to agree to the EULA in order to run the server. Go to eula.txt for more info.");
@@ -132,6 +178,8 @@ @@ -134,6 +180,8 @@
return false; return false;
} }
@ -124,7 +129,7 @@
if (!this.getOnlineMode()) { if (!this.getOnlineMode()) {
DedicatedServer.LOGGER.warn("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!"); DedicatedServer.LOGGER.warn("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!");
DedicatedServer.LOGGER.warn("The server will make no attempt to authenticate usernames. Beware."); DedicatedServer.LOGGER.warn("The server will make no attempt to authenticate usernames. Beware.");
@@ -146,7 +194,7 @@ @@ -148,7 +196,7 @@
if (!NameReferencingFileConverter.a(this.propertyManager)) { if (!NameReferencingFileConverter.a(this.propertyManager)) {
return false; return false;
} else { } else {
@ -133,10 +138,10 @@
long j = System.nanoTime(); long j = System.nanoTime();
if (this.S() == null) { if (this.S() == null) {
@@ -204,7 +252,18 @@ @@ -206,7 +254,18 @@
DedicatedServer.LOGGER.info("Starting remote control listener"); DedicatedServer.LOGGER.info("Starting remote control listener");
this.o = new RemoteControlListener(this); this.p = new RemoteControlListener(this);
this.o.a(); this.p.a();
+ this.remoteConsole = new org.bukkit.craftbukkit.command.CraftRemoteConsoleCommandSender(this.remoteControlCommandListener); // CraftBukkit + this.remoteConsole = new org.bukkit.craftbukkit.command.CraftRemoteConsoleCommandSender(this.remoteControlCommandListener); // CraftBukkit
+ } + }
+ +
@ -152,7 +157,21 @@
if (this.aP() > 0L) { if (this.aP() > 0L) {
Thread thread1 = new Thread(new ThreadWatchdog(this)); Thread thread1 = new Thread(new ThreadWatchdog(this));
@@ -297,7 +356,7 @@ @@ -266,7 +325,7 @@
return this.propertyManager.getBoolean("hardcore", false);
}
- protected void a(CrashReport crashreport) {}
+ public void a(CrashReport crashreport) {}
public CrashReport b(CrashReport crashreport) {
crashreport = super.b(crashreport);
@@ -293,11 +352,11 @@
return crashreport;
}
- protected void B() {
+ public void B() {
System.exit(0); System.exit(0);
} }

View File

@ -12,7 +12,7 @@
public DispenseBehaviorProjectile() {} public DispenseBehaviorProjectile() {}
@@ -10,9 +15,38 @@ @@ -10,9 +15,38 @@
EnumDirection enumdirection = BlockDispenser.e(isourceblock.f()); EnumDirection enumdirection = (EnumDirection) isourceblock.e().get(BlockDispenser.FACING);
IProjectile iprojectile = this.a(world, iposition, itemstack); IProjectile iprojectile = this.a(world, iposition, itemstack);
- iprojectile.shoot((double) enumdirection.getAdjacentX(), (double) ((float) enumdirection.getAdjacentY() + 0.1F), (double) enumdirection.getAdjacentZ(), this.getPower(), this.a()); - iprojectile.shoot((double) enumdirection.getAdjacentX(), (double) ((float) enumdirection.getAdjacentY() + 0.1F), (double) enumdirection.getAdjacentZ(), this.getPower(), this.a());

View File

@ -164,7 +164,7 @@
@@ -169,9 +265,48 @@ @@ -169,9 +265,48 @@
ItemBucket itembucket = (ItemBucket) itemstack.getItem(); ItemBucket itembucket = (ItemBucket) itemstack.getItem();
BlockPosition blockposition = isourceblock.getBlockPosition().shift(BlockDispenser.e(isourceblock.f())); BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING));
+ // CraftBukkit start + // CraftBukkit start
+ World world = isourceblock.getWorld(); + World world = isourceblock.getWorld();
@ -246,7 +246,7 @@
itemstack.setItem(item); itemstack.setItem(item);
@@ -220,11 +379,39 @@ @@ -220,11 +379,39 @@
World world = isourceblock.getWorld(); World world = isourceblock.getWorld();
BlockPosition blockposition = isourceblock.getBlockPosition().shift(BlockDispenser.e(isourceblock.f())); BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING));
+ // CraftBukkit start + // CraftBukkit start
+ org.bukkit.block.Block block = world.getWorld().getBlockAt(isourceblock.getBlockPosition().getX(), isourceblock.getBlockPosition().getY(), isourceblock.getBlockPosition().getZ()); + org.bukkit.block.Block block = world.getWorld().getBlockAt(isourceblock.getBlockPosition().getX(), isourceblock.getBlockPosition().getY(), isourceblock.getBlockPosition().getZ());
@ -289,7 +289,7 @@
world.setAir(blockposition); world.setAir(blockposition);
@@ -252,6 +439,30 @@ @@ -252,6 +439,30 @@
World world = isourceblock.getWorld(); World world = isourceblock.getWorld();
BlockPosition blockposition = isourceblock.getBlockPosition().shift(BlockDispenser.e(isourceblock.f())); BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING));
+ // CraftBukkit start + // CraftBukkit start
+ org.bukkit.block.Block block = world.getWorld().getBlockAt(isourceblock.getBlockPosition().getX(), isourceblock.getBlockPosition().getY(), isourceblock.getBlockPosition().getZ()); + org.bukkit.block.Block block = world.getWorld().getBlockAt(isourceblock.getBlockPosition().getX(), isourceblock.getBlockPosition().getY(), isourceblock.getBlockPosition().getZ());
@ -321,7 +321,7 @@
@@ -279,11 +490,40 @@ @@ -279,11 +490,40 @@
protected ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) { protected ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) {
World world = isourceblock.getWorld(); World world = isourceblock.getWorld();
BlockPosition blockposition = isourceblock.getBlockPosition().shift(BlockDispenser.e(isourceblock.f())); BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING));
- EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, (double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D, (EntityLiving) null); - EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, (double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D, (EntityLiving) null);
+ // EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, (double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D, (EntityLiving) null); + // EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, (double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D, (EntityLiving) null);
+ +
@ -355,8 +355,9 @@
+ // CraftBukkit end + // CraftBukkit end
world.addEntity(entitytntprimed); world.addEntity(entitytntprimed);
world.a((EntityHuman) null, entitytntprimed.locX, entitytntprimed.locY, entitytntprimed.locZ, SoundEffects.gk, SoundCategory.BLOCKS, 1.0F, 1.0F); - world.a((EntityHuman) null, entitytntprimed.locX, entitytntprimed.locY, entitytntprimed.locZ, SoundEffects.gz, SoundCategory.BLOCKS, 1.0F, 1.0F);
- --itemstack.count; - --itemstack.count;
+ world.a((EntityHuman) null, entitytntprimed.locX, entitytntprimed.locY, entitytntprimed.locZ, SoundEffects.gk, SoundCategory.BLOCKS, 1.0F, 1.0F);
+ // --itemstack.count; // CraftBukkit - handled above + // --itemstack.count; // CraftBukkit - handled above
return itemstack; return itemstack;
} }

View File

@ -14,8 +14,8 @@
Enchantment.enchantments.a(62, new MinecraftKey("lure"), new EnchantmentLure(Enchantment.Rarity.RARE, EnchantmentSlotType.FISHING_ROD, new EnumItemSlot[] { EnumItemSlot.MAINHAND})); Enchantment.enchantments.a(62, new MinecraftKey("lure"), new EnchantmentLure(Enchantment.Rarity.RARE, EnchantmentSlotType.FISHING_ROD, new EnumItemSlot[] { EnumItemSlot.MAINHAND}));
Enchantment.enchantments.a(70, new MinecraftKey("mending"), new EnchantmentMending(Enchantment.Rarity.RARE, EnumItemSlot.values())); Enchantment.enchantments.a(70, new MinecraftKey("mending"), new EnchantmentMending(Enchantment.Rarity.RARE, EnumItemSlot.values()));
+ // CraftBukkit start + // CraftBukkit start
+ for (Enchantment enchantment : Enchantment.enchantments) { + for (Object enchantment : Enchantment.enchantments) {
+ org.bukkit.enchantments.Enchantment.registerEnchantment(new org.bukkit.craftbukkit.enchantments.CraftEnchantment(enchantment)); + org.bukkit.enchantments.Enchantment.registerEnchantment(new org.bukkit.craftbukkit.enchantments.CraftEnchantment((Enchantment) enchantment));
+ } + }
+ // CraftBukkit end + // CraftBukkit end
} }

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/EnderDragonBattle.java --- a/net/minecraft/server/EnderDragonBattle.java
+++ b/net/minecraft/server/EnderDragonBattle.java +++ b/net/minecraft/server/EnderDragonBattle.java
@@ -249,7 +249,7 @@ @@ -246,7 +246,7 @@
ShapeDetector.ShapeDetectorCollection shapedetector_shapedetectorcollection = this.f.a(this.d, tileentity.getPosition()); ShapeDetector.ShapeDetectorCollection shapedetector_shapedetectorcollection = this.f.a(this.d, tileentity.getPosition());
if (shapedetector_shapedetectorcollection != null) { if (shapedetector_shapedetectorcollection != null) {
@ -9,7 +9,7 @@
if (this.o == null && blockposition.getX() == 0 && blockposition.getZ() == 0) { if (this.o == null && blockposition.getX() == 0 && blockposition.getZ() == 0) {
this.o = blockposition; this.o = blockposition;
@@ -269,7 +269,7 @@ @@ -266,7 +266,7 @@
if (shapedetector_shapedetectorcollection1 != null) { if (shapedetector_shapedetectorcollection1 != null) {
if (this.o == null) { if (this.o == null) {

View File

@ -48,17 +48,17 @@
private static final Logger a = LogManager.getLogger(); private static final Logger a = LogManager.getLogger();
private static final AxisAlignedBB b = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D); private static final AxisAlignedBB b = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
private static double c = 1.0D; private static double c = 1.0D;
@@ -98,6 +137,9 @@ @@ -99,6 +138,9 @@
public boolean glowing; public boolean glowing;
private final Set<String> aG; private final Set<String> aH;
private boolean aH; private boolean aI;
+ public boolean valid; // CraftBukkit + public boolean valid; // CraftBukkit
+ public org.bukkit.projectiles.ProjectileSource projectileSource; // CraftBukkit - For projectiles only + public org.bukkit.projectiles.ProjectileSource projectileSource; // CraftBukkit - For projectiles only
+ public boolean forceExplosionKnockback; // CraftBukkit - SPIGOT-949 + public boolean forceExplosionKnockback; // CraftBukkit - SPIGOT-949
public Entity(World world) { public Entity(World world) {
this.id = Entity.entityCount++; this.id = Entity.entityCount++;
@@ -195,6 +237,33 @@ @@ -197,6 +239,33 @@
} }
protected void setYawPitch(float f, float f1) { protected void setYawPitch(float f, float f1) {
@ -92,8 +92,8 @@
this.yaw = f % 360.0F; this.yaw = f % 360.0F;
this.pitch = f1 % 360.0F; this.pitch = f1 % 360.0F;
} }
@@ -238,7 +307,7 @@ @@ -240,7 +309,7 @@
if (this.ak) { if (this.al) {
MinecraftServer minecraftserver = this.world.getMinecraftServer(); MinecraftServer minecraftserver = this.world.getMinecraftServer();
- if (minecraftserver.getAllowNether()) { - if (minecraftserver.getAllowNether()) {
@ -101,7 +101,7 @@
if (!this.isPassenger()) { if (!this.isPassenger()) {
int i = this.V(); int i = this.V();
@@ -323,6 +392,27 @@ @@ -325,6 +394,27 @@
protected void burnFromLava() { protected void burnFromLava() {
if (!this.fireProof) { if (!this.fireProof) {
this.damageEntity(DamageSource.LAVA, 4.0F); this.damageEntity(DamageSource.LAVA, 4.0F);
@ -129,7 +129,7 @@
this.setOnFire(15); this.setOnFire(15);
} }
} }
@@ -363,6 +453,22 @@ @@ -365,6 +455,22 @@
this.a(this.getBoundingBox().c(d0, d1, d2)); this.a(this.getBoundingBox().c(d0, d1, d2));
this.recalcPosition(); this.recalcPosition();
} else { } else {
@ -208,7 +208,7 @@
+ */ + */
+ // CraftBukkit end + // CraftBukkit end
boolean flag2 = this.ah(); boolean flag2 = this.ai();
@@ -634,7 +765,16 @@ @@ -634,7 +765,16 @@
this.burn(1); this.burn(1);
@ -228,7 +228,7 @@
this.setOnFire(8); this.setOnFire(8);
} }
} }
@@ -748,7 +888,7 @@ @@ -756,7 +896,7 @@
return null; return null;
} }
@ -237,7 +237,7 @@
if (!this.fireProof) { if (!this.fireProof) {
this.damageEntity(DamageSource.FIRE, (float) i); this.damageEntity(DamageSource.FIRE, (float) i);
} }
@@ -914,6 +1054,13 @@ @@ -922,6 +1062,13 @@
} }
public void spawnIn(World world) { public void spawnIn(World world) {
@ -251,7 +251,7 @@
this.world = world; this.world = world;
} }
@@ -1107,6 +1254,18 @@ @@ -1126,6 +1273,18 @@
try { try {
nbttagcompound.set("Pos", this.a(new double[] { this.locX, this.locY, this.locZ})); nbttagcompound.set("Pos", this.a(new double[] { this.locX, this.locY, this.locZ}));
nbttagcompound.set("Motion", this.a(new double[] { this.motX, this.motY, this.motZ})); nbttagcompound.set("Motion", this.a(new double[] { this.motX, this.motY, this.motZ}));
@ -270,7 +270,7 @@
nbttagcompound.set("Rotation", this.a(new float[] { this.yaw, this.pitch})); nbttagcompound.set("Rotation", this.a(new float[] { this.yaw, this.pitch}));
nbttagcompound.setFloat("FallDistance", this.fallDistance); nbttagcompound.setFloat("FallDistance", this.fallDistance);
nbttagcompound.setShort("Fire", (short) this.fireTicks); nbttagcompound.setShort("Fire", (short) this.fireTicks);
@@ -1116,6 +1275,12 @@ @@ -1135,6 +1294,12 @@
nbttagcompound.setBoolean("Invulnerable", this.invulnerable); nbttagcompound.setBoolean("Invulnerable", this.invulnerable);
nbttagcompound.setInt("PortalCooldown", this.portalCooldown); nbttagcompound.setInt("PortalCooldown", this.portalCooldown);
nbttagcompound.a("UUID", this.getUniqueID()); nbttagcompound.a("UUID", this.getUniqueID());
@ -283,7 +283,7 @@
if (this.getCustomName() != null && !this.getCustomName().isEmpty()) { if (this.getCustomName() != null && !this.getCustomName().isEmpty()) {
nbttagcompound.setString("CustomName", this.getCustomName()); nbttagcompound.setString("CustomName", this.getCustomName());
} }
@@ -1187,6 +1352,8 @@ @@ -1210,6 +1375,8 @@
this.motX = nbttaglist1.e(0); this.motX = nbttaglist1.e(0);
this.motY = nbttaglist1.e(1); this.motY = nbttaglist1.e(1);
this.motZ = nbttaglist1.e(2); this.motZ = nbttaglist1.e(2);
@ -292,15 +292,15 @@
if (Math.abs(this.motX) > 10.0D) { if (Math.abs(this.motX) > 10.0D) {
this.motX = 0.0D; this.motX = 0.0D;
} }
@@ -1198,6 +1365,7 @@ @@ -1221,6 +1388,7 @@
if (Math.abs(this.motZ) > 10.0D) { if (Math.abs(this.motZ) > 10.0D) {
this.motZ = 0.0D; this.motZ = 0.0D;
} }
+ // CraftBukkit end */ + // CraftBukkit end */
this.lastX = this.M = this.locX = nbttaglist.e(0); this.locX = nbttaglist.e(0);
this.lastY = this.N = this.locY = nbttaglist.e(1); this.locY = nbttaglist.e(1);
@@ -1246,6 +1414,58 @@ @@ -1278,6 +1446,58 @@
this.setPosition(this.locX, this.locY, this.locZ); this.setPosition(this.locX, this.locY, this.locZ);
} }
@ -359,7 +359,7 @@
} catch (Throwable throwable) { } catch (Throwable throwable) {
CrashReport crashreport = CrashReport.a(throwable, "Loading entity NBT"); CrashReport crashreport = CrashReport.a(throwable, "Loading entity NBT");
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being loaded"); CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being loaded");
@@ -1307,6 +1527,12 @@ @@ -1337,6 +1557,12 @@
public EntityItem a(ItemStack itemstack, float f) { public EntityItem a(ItemStack itemstack, float f) {
if (itemstack.count != 0 && itemstack.getItem() != null) { if (itemstack.count != 0 && itemstack.getItem() != null) {
@ -372,8 +372,8 @@
EntityItem entityitem = new EntityItem(this.world, this.locX, this.locY + (double) f, this.locZ, itemstack); EntityItem entityitem = new EntityItem(this.world, this.locX, this.locY + (double) f, this.locZ, itemstack);
entityitem.q(); entityitem.q();
@@ -1428,6 +1654,24 @@ @@ -1458,6 +1684,24 @@
if (entity.bz() != this) { if (entity.bB() != this) {
throw new IllegalStateException("Use x.startRiding(y), not y.addPassenger(x)"); throw new IllegalStateException("Use x.startRiding(y), not y.addPassenger(x)");
} else { } else {
+ // CraftBukkit start + // CraftBukkit start
@ -394,11 +394,11 @@
+ } + }
+ } + }
+ // CraftBukkit end + // CraftBukkit end
if (!this.world.isClientSide && entity instanceof EntityHuman && !(this.bu() instanceof EntityHuman)) { if (!this.world.isClientSide && entity instanceof EntityHuman && !(this.bw() instanceof EntityHuman)) {
this.passengers.add(0, entity); this.passengers.add(0, entity);
} else { } else {
@@ -1441,6 +1685,22 @@ @@ -1471,6 +1715,22 @@
if (entity.bz() == this) { if (entity.bB() == this) {
throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)"); throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)");
} else { } else {
+ // CraftBukkit start + // CraftBukkit start
@ -420,7 +420,7 @@
this.passengers.remove(entity); this.passengers.remove(entity);
entity.j = 60; entity.j = 60;
} }
@@ -1584,10 +1844,38 @@ @@ -1614,10 +1874,38 @@
} }
public void onLightningStrike(EntityLightning entitylightning) { public void onLightningStrike(EntityLightning entitylightning) {
@ -461,7 +461,7 @@
} }
} }
@@ -1722,19 +2010,67 @@ @@ -1752,19 +2040,67 @@
if (!this.world.isClientSide && !this.dead) { if (!this.world.isClientSide && !this.dead) {
this.world.methodProfiler.a("changeDimension"); this.world.methodProfiler.a("changeDimension");
MinecraftServer minecraftserver = this.h(); MinecraftServer minecraftserver = this.h();
@ -532,7 +532,7 @@
BlockPosition blockposition; BlockPosition blockposition;
if (i == 1) { if (i == 1) {
@@ -1763,12 +2099,18 @@ @@ -1793,12 +2129,18 @@
blockposition = new BlockPosition(this); blockposition = new BlockPosition(this);
} }
@ -552,7 +552,7 @@
if (j == 1 && i == 1) { if (j == 1 && i == 1) {
BlockPosition blockposition1 = worldserver1.q(worldserver1.getSpawn()); BlockPosition blockposition1 = worldserver1.q(worldserver1.getSpawn());
@@ -1776,6 +2118,7 @@ @@ -1806,6 +2148,7 @@
} else { } else {
entity.setPositionRotation(blockposition, entity.yaw, entity.pitch); entity.setPositionRotation(blockposition, entity.yaw, entity.pitch);
} }
@ -560,7 +560,7 @@
boolean flag = entity.attachedToPlayer; boolean flag = entity.attachedToPlayer;
@@ -1783,6 +2126,14 @@ @@ -1813,6 +2156,14 @@
worldserver1.addEntity(entity); worldserver1.addEntity(entity);
entity.attachedToPlayer = flag; entity.attachedToPlayer = flag;
worldserver1.entityJoinedWorld(entity, false); worldserver1.entityJoinedWorld(entity, false);
@ -575,7 +575,7 @@
} }
this.dead = true; this.dead = true;
@@ -1893,6 +2244,11 @@ @@ -1923,6 +2274,11 @@
} }
public void setCustomName(String s) { public void setCustomName(String s) {
@ -587,7 +587,7 @@
this.datawatcher.set(Entity.aA, s); this.datawatcher.set(Entity.aA, s);
} }
@@ -1950,7 +2306,26 @@ @@ -1980,7 +2336,26 @@
} }
public void a(AxisAlignedBB axisalignedbb) { public void a(AxisAlignedBB axisalignedbb) {
@ -615,8 +615,8 @@
} }
public float getHeadHeight() { public float getHeadHeight() {
@@ -2124,7 +2499,7 @@ @@ -2154,7 +2529,7 @@
for (Iterator iterator = this.bv().iterator(); iterator.hasNext(); entity.a(oclass, set)) { for (Iterator iterator = this.bx().iterator(); iterator.hasNext(); entity.a(oclass, set)) {
entity = (Entity) iterator.next(); entity = (Entity) iterator.next();
if (oclass.isAssignableFrom(entity.getClass())) { if (oclass.isAssignableFrom(entity.getClass())) {
- set.add(entity); - set.add(entity);

View File

@ -2,13 +2,13 @@
+++ b/net/minecraft/server/EntityAgeable.java +++ b/net/minecraft/server/EntityAgeable.java
@@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
protected int c; protected int c;
private float bx = -1.0F; private float by = -1.0F;
private float by; private float bz;
+ public boolean ageLocked; // CraftBukkit + public boolean ageLocked; // CraftBukkit
public EntityAgeable(World world) { public EntityAgeable(World world) {
super(world); super(world);
@@ -28,13 +29,16 @@ @@ -28,13 +29,18 @@
if (entityageable != null) { if (entityageable != null) {
entityageable.setAgeRaw(-24000); entityageable.setAgeRaw(-24000);
entityageable.setPositionRotation(this.locX, this.locY, this.locZ, 0.0F, 0.0F); entityageable.setPositionRotation(this.locX, this.locY, this.locZ, 0.0F, 0.0F);
@ -20,13 +20,15 @@
if (!entityhuman.abilities.canInstantlyBuild) { if (!entityhuman.abilities.canInstantlyBuild) {
--itemstack.count; --itemstack.count;
+ if (itemstack.count == 0) { // CraftBukkit - allow less than 0 stacks as "infinite" + // CraftBukkit start - allow less than 0 stacks as "infinite"
+ if (itemstack.count == 0) {
+ entityhuman.inventory.setItem(entityhuman.inventory.itemInHandIndex, (ItemStack) null); + entityhuman.inventory.setItem(entityhuman.inventory.itemInHandIndex, (ItemStack) null);
+ } + }
+ // CraftBukkit end
} }
} }
} }
@@ -97,12 +101,14 @@ @@ -97,12 +103,14 @@
super.b(nbttagcompound); super.b(nbttagcompound);
nbttagcompound.setInt("Age", this.getAge()); nbttagcompound.setInt("Age", this.getAge());
nbttagcompound.setInt("ForcedAge", this.b); nbttagcompound.setInt("ForcedAge", this.b);
@ -41,7 +43,7 @@
} }
public void a(DataWatcherObject<?> datawatcherobject) { public void a(DataWatcherObject<?> datawatcherobject) {
@@ -115,7 +121,7 @@ @@ -115,7 +123,7 @@
public void n() { public void n() {
super.n(); super.n();

View File

@ -11,19 +11,19 @@
import java.util.Map.Entry; import java.util.Map.Entry;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@@ -92,6 +96,22 @@ @@ -96,6 +100,22 @@
} }
+ // CraftBukkit start accessor methods + // CraftBukkit start accessor methods
+ public void refreshEffects() { + public void refreshEffects() {
+ if (!this.hasColor) { + if (!this.hasColor) {
+ this.getDataWatcher().set(EntityAreaEffectCloud.b, Integer.valueOf(PotionUtil.a((Collection) PotionUtil.a(this.e, (Collection) this.effects)))); // PAIL: rename + this.getDataWatcher().set(EntityAreaEffectCloud.b, Integer.valueOf(PotionUtil.a((Collection) PotionUtil.a(this.potionRegistry, (Collection) this.effects)))); // PAIL: rename
+ } + }
+ } + }
+ +
+ public String getType() { + public String getType() {
+ return ((MinecraftKey) PotionRegistry.a.b(this.e)).toString(); // PAIL: rename + return ((MinecraftKey) PotionRegistry.a.b(this.potionRegistry)).toString(); // PAIL: rename
+ } + }
+ +
+ public void setType(String string) { + public void setType(String string) {
@ -34,7 +34,7 @@
public int getColor() { public int getColor() {
return ((Integer) this.getDataWatcher().get(EntityAreaEffectCloud.b)).intValue(); return ((Integer) this.getDataWatcher().get(EntityAreaEffectCloud.b)).intValue();
} }
@@ -238,6 +258,7 @@ @@ -265,6 +285,7 @@
if (!list.isEmpty()) { if (!list.isEmpty()) {
Iterator iterator2 = list.iterator(); Iterator iterator2 = list.iterator();
@ -42,7 +42,7 @@
while (iterator2.hasNext()) { while (iterator2.hasNext()) {
EntityLiving entityliving = (EntityLiving) iterator2.next(); EntityLiving entityliving = (EntityLiving) iterator2.next();
@@ -247,6 +268,17 @@ @@ -274,6 +295,17 @@
double d2 = d0 * d0 + d1 * d1; double d2 = d0 * d0 + d1 * d1;
if (d2 <= (double) (f * f)) { if (d2 <= (double) (f * f)) {
@ -57,6 +57,6 @@
+ if (entity instanceof CraftLivingEntity) { + if (entity instanceof CraftLivingEntity) {
+ EntityLiving entityliving = ((CraftLivingEntity) entity).getHandle(); + EntityLiving entityliving = ((CraftLivingEntity) entity).getHandle();
+ // CraftBukkit end + // CraftBukkit end
this.g.put(entityliving, Integer.valueOf(this.ticksLived + this.reapplicationDelay)); this.au.put(entityliving, Integer.valueOf(this.ticksLived + this.reapplicationDelay));
Iterator iterator3 = arraylist.iterator(); Iterator iterator3 = arraylist.iterator();

View File

@ -15,10 +15,10 @@
+ +
public class EntityArmorStand extends EntityLiving { public class EntityArmorStand extends EntityLiving {
private static final Vector3f bq = new Vector3f(0.0F, 0.0F, 0.0F); private static final Vector3f br = new Vector3f(0.0F, 0.0F, 0.0F);
@@ -362,6 +371,21 @@ @@ -373,6 +382,21 @@
if (itemstack1 == null || (this.bA & 1 << enumitemslot.c() + 8) == 0) { if (itemstack1 == null || (this.bB & 1 << enumitemslot.c() + 8) == 0) {
if (itemstack1 != null || (this.bA & 1 << enumitemslot.c() + 16) == 0) { if (itemstack1 != null || (this.bB & 1 << enumitemslot.c() + 16) == 0) {
ItemStack itemstack2; ItemStack itemstack2;
+ // CraftBukkit start + // CraftBukkit start
+ org.bukkit.inventory.ItemStack armorStandItem = CraftItemStack.asCraftMirror(itemstack1); + org.bukkit.inventory.ItemStack armorStandItem = CraftItemStack.asCraftMirror(itemstack1);
@ -38,7 +38,7 @@
if (entityhuman.abilities.canInstantlyBuild && (itemstack1 == null || itemstack1.getItem() == Item.getItemOf(Blocks.AIR)) && itemstack != null) { if (entityhuman.abilities.canInstantlyBuild && (itemstack1 == null || itemstack1.getItem() == Item.getItemOf(Blocks.AIR)) && itemstack != null) {
itemstack2 = itemstack.cloneItemStack(); itemstack2 = itemstack.cloneItemStack();
@@ -383,6 +407,11 @@ @@ -394,6 +418,11 @@
} }
public boolean damageEntity(DamageSource damagesource, float f) { public boolean damageEntity(DamageSource damagesource, float f) {

View File

@ -21,7 +21,7 @@
if (entityliving instanceof EntityHuman) { if (entityliving instanceof EntityHuman) {
this.fromPlayer = EntityArrow.PickupStatus.ALLOWED; this.fromPlayer = EntityArrow.PickupStatus.ALLOWED;
} }
@@ -229,7 +236,7 @@ @@ -236,7 +243,7 @@
protected void a(MovingObjectPosition movingobjectposition) { protected void a(MovingObjectPosition movingobjectposition) {
Entity entity = movingobjectposition.entity; Entity entity = movingobjectposition.entity;
@ -30,7 +30,7 @@
if (entity != null) { if (entity != null) {
float f = MathHelper.sqrt(this.motX * this.motX + this.motY * this.motY + this.motZ * this.motZ); float f = MathHelper.sqrt(this.motX * this.motX + this.motY * this.motY + this.motZ * this.motZ);
int i = MathHelper.f((double) f * this.damage); int i = MathHelper.f((double) f * this.damage);
@@ -247,7 +254,13 @@ @@ -254,7 +261,13 @@
} }
if (this.isBurning() && !(entity instanceof EntityEnderman)) { if (this.isBurning() && !(entity instanceof EntityEnderman)) {
@ -45,7 +45,7 @@
} }
if (entity.damageEntity(damagesource, (float) i)) { if (entity.damageEntity(damagesource, (float) i)) {
@@ -397,6 +410,20 @@ @@ -410,6 +423,20 @@
public void d(EntityHuman entityhuman) { public void d(EntityHuman entityhuman) {
if (!this.world.isClientSide && this.inGround && this.shake <= 0) { if (!this.world.isClientSide && this.inGround && this.shake <= 0) {
@ -66,7 +66,7 @@
boolean flag = this.fromPlayer == EntityArrow.PickupStatus.ALLOWED || this.fromPlayer == EntityArrow.PickupStatus.CREATIVE_ONLY && entityhuman.abilities.canInstantlyBuild; boolean flag = this.fromPlayer == EntityArrow.PickupStatus.ALLOWED || this.fromPlayer == EntityArrow.PickupStatus.CREATIVE_ONLY && entityhuman.abilities.canInstantlyBuild;
if (this.fromPlayer == EntityArrow.PickupStatus.ALLOWED && !entityhuman.inventory.pickup(this.j())) { if (this.fromPlayer == EntityArrow.PickupStatus.ALLOWED && !entityhuman.inventory.pickup(this.j())) {
@@ -455,6 +482,12 @@ @@ -468,6 +495,12 @@
return (b0 & 1) != 0; return (b0 & 1) != 0;
} }

View File

@ -17,8 +17,8 @@
private static final DataWatcherObject<Integer> a = DataWatcher.a(EntityBoat.class, DataWatcherRegistry.b); private static final DataWatcherObject<Integer> a = DataWatcher.a(EntityBoat.class, DataWatcherRegistry.b);
@@ -32,6 +41,14 @@ @@ -32,6 +41,14 @@
private EntityBoat.EnumStatus aH; private EntityBoat.EnumStatus aI;
private double aI; private double aJ;
+ // CraftBukkit start + // CraftBukkit start
+ // PAIL: Some of these haven't worked since a few updates, and since 1.9 they are less and less applicable. + // PAIL: Some of these haven't worked since a few updates, and since 1.9 they are less and less applicable.
@ -39,7 +39,7 @@
} }
protected boolean playStepSound() { protected boolean playStepSound() {
@@ -91,6 +109,19 @@ @@ -95,6 +113,19 @@
if (damagesource instanceof EntityDamageSourceIndirect && damagesource.getEntity() != null && this.w(damagesource.getEntity())) { if (damagesource instanceof EntityDamageSourceIndirect && damagesource.getEntity() != null && this.w(damagesource.getEntity())) {
return false; return false;
} else { } else {
@ -59,7 +59,7 @@
this.d(-this.q()); this.d(-this.q());
this.b(10); this.b(10);
this.setDamage(this.n() + f * 10.0F); this.setDamage(this.n() + f * 10.0F);
@@ -98,6 +129,15 @@ @@ -102,6 +133,15 @@
boolean flag = damagesource.getEntity() instanceof EntityHuman && ((EntityHuman) damagesource.getEntity()).abilities.canInstantlyBuild; boolean flag = damagesource.getEntity() instanceof EntityHuman && ((EntityHuman) damagesource.getEntity()).abilities.canInstantlyBuild;
if (flag || this.n() > 40.0F) { if (flag || this.n() > 40.0F) {
@ -75,7 +75,7 @@
if (!flag && this.world.getGameRules().getBoolean("doEntityDrops")) { if (!flag && this.world.getGameRules().getBoolean("doEntityDrops")) {
this.a(this.j(), 1, 0.0F); this.a(this.j(), 1, 0.0F);
} }
@@ -115,9 +155,25 @@ @@ -119,9 +159,25 @@
public void collide(Entity entity) { public void collide(Entity entity) {
if (entity instanceof EntityBoat) { if (entity instanceof EntityBoat) {
if (entity.getBoundingBox().b < this.getBoundingBox().e) { if (entity.getBoundingBox().b < this.getBoundingBox().e) {
@ -101,16 +101,16 @@
super.collide(entity); super.collide(entity);
} }
@@ -154,6 +210,8 @@ @@ -158,6 +214,8 @@
return this.getDirection().e(); return this.getDirection().e();
} }
+ private Location lastLocation; // CraftBukkit + private Location lastLocation; // CraftBukkit
+ +
public void m() { public void m() {
this.aH = this.aG; this.aI = this.aH;
this.aG = this.t(); this.aH = this.t();
@@ -174,7 +232,6 @@ @@ -178,7 +236,6 @@
if (this.n() > 0.0F) { if (this.n() > 0.0F) {
this.setDamage(this.n() - 1.0F); this.setDamage(this.n() - 1.0F);
} }
@ -118,7 +118,7 @@
this.lastX = this.locX; this.lastX = this.locX;
this.lastY = this.locY; this.lastY = this.locY;
this.lastZ = this.locZ; this.lastZ = this.locZ;
@@ -198,6 +255,22 @@ @@ -202,6 +259,22 @@
this.motZ = 0.0D; this.motZ = 0.0D;
} }
@ -141,7 +141,7 @@
for (int i = 0; i <= 1; ++i) { for (int i = 0; i <= 1; ++i) {
if (this.a(i)) { if (this.a(i)) {
this.f[i] = (float) ((double) this.f[i] + 0.01D); this.f[i] = (float) ((double) this.f[i] + 0.01D);
@@ -595,6 +668,11 @@ @@ -599,6 +672,11 @@
this.e(this.fallDistance, 1.0F); this.e(this.fallDistance, 1.0F);
if (!this.world.isClientSide && !this.dead) { if (!this.world.isClientSide && !this.dead) {
@ -153,7 +153,7 @@
this.die(); this.die();
if (this.world.getGameRules().getBoolean("doEntityDrops")) { if (this.world.getGameRules().getBoolean("doEntityDrops")) {
int i; int i;
@@ -608,6 +686,7 @@ @@ -612,6 +690,7 @@
} }
} }
} }

View File

@ -10,15 +10,15 @@
+ } + }
+ // CraftBukkit end + // CraftBukkit end
super.n(); super.n();
this.bA = this.bw; this.bB = this.bx;
this.by = this.bx; this.bz = this.by;
@@ -61,7 +66,9 @@ @@ -61,7 +66,9 @@
this.bw += this.bB * 2.0F; this.bx += this.bC * 2.0F;
if (!this.world.isClientSide && !this.isBaby() && !this.isChickenJockey() && --this.bC <= 0) { if (!this.world.isClientSide && !this.isBaby() && !this.isChickenJockey() && --this.bD <= 0) {
this.a(SoundEffects.aa, 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F); this.a(SoundEffects.aa, 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F);
+ this.forceDrops = true; // CraftBukkit + this.forceDrops = true; // CraftBukkit
this.a(Items.EGG, 1); this.a(Items.EGG, 1);
+ this.forceDrops = false; // CraftBukkit + this.forceDrops = false; // CraftBukkit
this.bC = this.random.nextInt(6000) + 6000; this.bD = this.random.nextInt(6000) + 6000;
} }

View File

@ -11,7 +11,7 @@
public class EntityCow extends EntityAnimal { public class EntityCow extends EntityAnimal {
@@ -53,12 +57,22 @@ @@ -57,12 +61,22 @@
public boolean a(EntityHuman entityhuman, EnumHand enumhand, @Nullable ItemStack itemstack) { public boolean a(EntityHuman entityhuman, EnumHand enumhand, @Nullable ItemStack itemstack) {
if (itemstack != null && itemstack.getItem() == Items.BUCKET && !entityhuman.abilities.canInstantlyBuild && !this.isBaby()) { if (itemstack != null && itemstack.getItem() == Items.BUCKET && !entityhuman.abilities.canInstantlyBuild && !this.isBaby()) {

View File

@ -10,7 +10,7 @@
+ +
public abstract class EntityCreature extends EntityInsentient { public abstract class EntityCreature extends EntityInsentient {
public static final UUID bu = UUID.fromString("E199AD21-BA8A-4C53-8D13-6182D5C69D3A"); public static final UUID bv = UUID.fromString("E199AD21-BA8A-4C53-8D13-6182D5C69D3A");
@@ -71,6 +75,7 @@ @@ -71,6 +75,7 @@
if (this instanceof EntityTameableAnimal && ((EntityTameableAnimal) this).isSitting()) { if (this instanceof EntityTameableAnimal && ((EntityTameableAnimal) this).isSitting()) {
@ -26,4 +26,4 @@
+ this.world.getServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE)); // CraftBukkit + this.world.getServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE)); // CraftBukkit
this.unleash(true, true); this.unleash(true, true);
} }
} else if (!this.isLeashed() && this.bw) { } else if (!this.isLeashed() && this.bx) {

View File

@ -11,7 +11,7 @@
public class EntityCreeper extends EntityMonster { public class EntityCreeper extends EntityMonster {
@@ -119,7 +123,7 @@ @@ -123,7 +127,7 @@
} }
public void die(DamageSource damagesource) { public void die(DamageSource damagesource) {
@ -20,7 +20,7 @@
if (this.world.getGameRules().getBoolean("doMobLoot")) { if (this.world.getGameRules().getBoolean("doMobLoot")) {
if (damagesource.getEntity() instanceof EntitySkeleton) { if (damagesource.getEntity() instanceof EntitySkeleton) {
int i = Item.getId(Items.RECORD_13); int i = Item.getId(Items.RECORD_13);
@@ -132,6 +136,7 @@ @@ -136,6 +140,7 @@
this.a(new ItemStack(Items.SKULL, 1, 4), 0.0F); this.a(new ItemStack(Items.SKULL, 1, 4), 0.0F);
} }
} }
@ -28,7 +28,7 @@
} }
@@ -158,9 +163,19 @@ @@ -162,9 +167,19 @@
public void onLightningStrike(EntityLightning entitylightning) { public void onLightningStrike(EntityLightning entitylightning) {
super.onLightningStrike(entitylightning); super.onLightningStrike(entitylightning);
@ -48,19 +48,19 @@
+ +
protected boolean a(EntityHuman entityhuman, EnumHand enumhand, @Nullable ItemStack itemstack) { protected boolean a(EntityHuman entityhuman, EnumHand enumhand, @Nullable ItemStack itemstack) {
if (itemstack != null && itemstack.getItem() == Items.FLINT_AND_STEEL) { if (itemstack != null && itemstack.getItem() == Items.FLINT_AND_STEEL) {
this.world.a(entityhuman, this.locX, this.locY, this.locZ, SoundEffects.bx, this.bA(), 1.0F, this.random.nextFloat() * 0.4F + 0.8F); this.world.a(entityhuman, this.locX, this.locY, this.locZ, SoundEffects.by, this.bC(), 1.0F, this.random.nextFloat() * 0.4F + 0.8F);
@@ -180,9 +195,17 @@ @@ -184,9 +199,17 @@
boolean flag = this.world.getGameRules().getBoolean("mobGriefing"); boolean flag = this.world.getGameRules().getBoolean("mobGriefing");
float f = this.isPowered() ? 2.0F : 1.0F; float f = this.isPowered() ? 2.0F : 1.0F;
- this.aU = true; - this.aV = true;
- this.world.explode(this, this.locX, this.locY, this.locZ, (float) this.explosionRadius * f, flag); - this.world.explode(this, this.locX, this.locY, this.locZ, (float) this.explosionRadius * f, flag);
- this.die(); - this.die();
+ // CraftBukkit start + // CraftBukkit start
+ ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), this.explosionRadius * f, false); + ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), this.explosionRadius * f, false);
+ this.world.getServer().getPluginManager().callEvent(event); + this.world.getServer().getPluginManager().callEvent(event);
+ if (!event.isCancelled()) { + if (!event.isCancelled()) {
+ this.aU = true; + this.aV = true;
+ this.world.createExplosion(this, this.locX, this.locY, this.locZ, event.getRadius(), event.getFire(), flag); + this.world.createExplosion(this, this.locX, this.locY, this.locZ, event.getRadius(), event.getFire(), flag);
+ this.die(); + this.die();
+ } else { + } else {

View File

@ -13,7 +13,7 @@
public class EntityEgg extends EntityProjectile { public class EntityEgg extends EntityProjectile {
public EntityEgg(World world) { public EntityEgg(World world) {
@@ -19,21 +26,37 @@ @@ -23,21 +30,37 @@
movingobjectposition.entity.damageEntity(DamageSource.projectile(this, this.getShooter()), 0.0F); movingobjectposition.entity.damageEntity(DamageSource.projectile(this, this.getShooter()), 0.0F);
} }

View File

@ -12,11 +12,11 @@
+// PAIL: Fixme +// PAIL: Fixme
public class EntityEnderDragon extends EntityInsentient implements IComplex, IMonster { public class EntityEnderDragon extends EntityInsentient implements IComplex, IMonster {
private static final Logger bI = LogManager.getLogger(); private static final Logger bJ = LogManager.getLogger();
@@ -33,6 +38,7 @@ @@ -33,6 +38,7 @@
private final PathPoint[] bN = new PathPoint[24]; private final PathPoint[] bO = new PathPoint[24];
private final int[] bO = new int[24]; private final int[] bP = new int[24];
private final Path bP = new Path(); private final Path bQ = new Path();
+ private Explosion explosionSource = new Explosion(null, this, Double.NaN, Double.NaN, Double.NaN, Float.NaN, true, true); // CraftBukkit - reusable source for CraftTNTPrimed.getSource() + private Explosion explosionSource = new Explosion(null, this, Double.NaN, Double.NaN, Double.NaN, Float.NaN, true, true); // CraftBukkit - reusable source for CraftTNTPrimed.getSource()
public EntityEnderDragon(World world) { public EntityEnderDragon(World world) {
@ -30,7 +30,7 @@
d0 = vec3d.x - this.locX; d0 = vec3d.x - this.locX;
d1 = vec3d.y - this.locY; d1 = vec3d.y - this.locY;
d2 = vec3d.z - this.locZ; d2 = vec3d.z - this.locZ;
@@ -309,7 +315,14 @@ @@ -314,7 +320,14 @@
if (this.currentEnderCrystal.dead) { if (this.currentEnderCrystal.dead) {
this.currentEnderCrystal = null; this.currentEnderCrystal = null;
} else if (this.ticksLived % 10 == 0 && this.getHealth() < this.getMaxHealth()) { } else if (this.ticksLived % 10 == 0 && this.getHealth() < this.getMaxHealth()) {
@ -46,7 +46,7 @@
} }
} }
@@ -382,6 +395,10 @@ @@ -387,6 +400,10 @@
int j1 = MathHelper.floor(axisalignedbb.f); int j1 = MathHelper.floor(axisalignedbb.f);
boolean flag = false; boolean flag = false;
boolean flag1 = false; boolean flag1 = false;
@ -57,7 +57,7 @@
for (int k1 = i; k1 <= l; ++k1) { for (int k1 = i; k1 <= l; ++k1) {
for (int l1 = j; l1 <= i1; ++l1) { for (int l1 = j; l1 <= i1; ++l1) {
@@ -395,7 +412,11 @@ @@ -400,7 +417,11 @@
flag = true; flag = true;
} else if (block != Blocks.BARRIER && block != Blocks.OBSIDIAN && block != Blocks.END_STONE && block != Blocks.BEDROCK && block != Blocks.END_PORTAL && block != Blocks.END_PORTAL_FRAME) { } else if (block != Blocks.BARRIER && block != Blocks.OBSIDIAN && block != Blocks.END_STONE && block != Blocks.BEDROCK && block != Blocks.END_PORTAL && block != Blocks.END_PORTAL_FRAME) {
if (block != Blocks.COMMAND_BLOCK && block != Blocks.dc && block != Blocks.dd && block != Blocks.IRON_BARS && block != Blocks.END_GATEWAY) { if (block != Blocks.COMMAND_BLOCK && block != Blocks.dc && block != Blocks.dd && block != Blocks.IRON_BARS && block != Blocks.END_GATEWAY) {
@ -70,7 +70,7 @@
} else { } else {
flag = true; flag = true;
} }
@@ -407,6 +428,41 @@ @@ -412,6 +433,41 @@
} }
} }

View File

@ -12,7 +12,7 @@
public class EntityEnderPearl extends EntityProjectile { public class EntityEnderPearl extends EntityProjectile {
private EntityLiving d; private EntityLiving d;
@@ -51,21 +57,35 @@ @@ -55,21 +61,35 @@
EntityPlayer entityplayer = (EntityPlayer) entityliving; EntityPlayer entityplayer = (EntityPlayer) entityliving;
if (entityplayer.playerConnection.a().isConnected() && entityplayer.world == this.world && !entityplayer.isSleeping()) { if (entityplayer.playerConnection.a().isConnected() && entityplayer.world == this.world && !entityplayer.isSleeping()) {
@ -52,7 +52,7 @@
} }
- -
- if (entityliving.isPassenger()) { - if (entityliving.isPassenger()) {
- this.stopRiding(); - entityliving.stopRiding();
- } - }
- -
- entityliving.enderTeleportTo(this.locX, this.locY, this.locZ); - entityliving.enderTeleportTo(this.locX, this.locY, this.locZ);

View File

@ -36,7 +36,7 @@
} }
@@ -309,8 +322,12 @@ @@ -320,8 +333,12 @@
boolean flag = movingobjectposition != null && movingobjectposition.a().equals(blockposition); boolean flag = movingobjectposition != null && movingobjectposition.a().equals(blockposition);
if (EntityEnderman.c.contains(block) && flag) { if (EntityEnderman.c.contains(block) && flag) {
@ -51,7 +51,7 @@
} }
} }
@@ -340,8 +357,12 @@ @@ -351,8 +368,12 @@
IBlockData iblockdata2 = this.a.getCarried(); IBlockData iblockdata2 = this.a.getCarried();
if (iblockdata2 != null && this.a(world, blockposition, iblockdata2.getBlock(), iblockdata, iblockdata1)) { if (iblockdata2 != null && this.a(world, blockposition, iblockdata2.getBlock(), iblockdata, iblockdata1)) {

View File

@ -20,7 +20,7 @@
if (this.c > 0) { if (this.c > 0) {
--this.c; --this.c;
} }
@@ -65,6 +72,16 @@ @@ -68,6 +75,16 @@
} }
if (this.targetPlayer != null) { if (this.targetPlayer != null) {
@ -34,10 +34,10 @@
+ } + }
+ +
+ if (!cancelled && targetPlayer != null) { + if (!cancelled && targetPlayer != null) {
double d1 = (this.targetPlayer.locX - this.locX) / d0; double d1 = (this.targetPlayer.locX - this.locX) / 8.0D;
double d2 = (this.targetPlayer.locY + (double) this.targetPlayer.getHeadHeight() / 2.0D - this.locY) / d0; double d2 = (this.targetPlayer.locY + (double) this.targetPlayer.getHeadHeight() / 2.0D - this.locY) / 8.0D;
double d3 = (this.targetPlayer.locZ - this.locZ) / d0; double d3 = (this.targetPlayer.locZ - this.locZ) / 8.0D;
@@ -77,6 +94,8 @@ @@ -80,6 +97,8 @@
this.motY += d2 / d4 * d5 * 0.1D; this.motY += d2 / d4 * d5 * 0.1D;
this.motZ += d3 / d4 * d5 * 0.1D; this.motZ += d3 / d4 * d5 * 0.1D;
} }
@ -46,7 +46,7 @@
} }
this.move(this.motX, this.motY, this.motZ); this.move(this.motX, this.motY, this.motZ);
@@ -151,7 +170,7 @@ @@ -154,7 +173,7 @@
} }
if (this.value > 0) { if (this.value > 0) {
@ -55,7 +55,7 @@
} }
this.die(); this.die();
@@ -173,6 +192,24 @@ @@ -176,6 +195,24 @@
} }
public static int getOrbValue(int i) { public static int getOrbValue(int i) {

View File

@ -18,7 +18,7 @@
this.world.setAir(blockposition); this.world.setAir(blockposition);
} else if (!this.world.isClientSide) { } else if (!this.world.isClientSide) {
this.die(); this.die();
@@ -85,7 +87,7 @@ @@ -88,7 +90,7 @@
if (BlockFalling.i(this.world.getType(new BlockPosition(this.locX, this.locY - 0.009999999776482582D, this.locZ)))) { if (BlockFalling.i(this.world.getType(new BlockPosition(this.locX, this.locY - 0.009999999776482582D, this.locZ)))) {
this.onGround = false; this.onGround = false;
@ -27,7 +27,7 @@
} }
this.motX *= 0.699999988079071D; this.motX *= 0.699999988079071D;
@@ -94,7 +96,13 @@ @@ -97,7 +99,13 @@
if (iblockdata.getBlock() != Blocks.PISTON_EXTENSION) { if (iblockdata.getBlock() != Blocks.PISTON_EXTENSION) {
this.die(); this.die();
if (!this.f) { if (!this.f) {
@ -42,7 +42,7 @@
if (block instanceof BlockFalling) { if (block instanceof BlockFalling) {
((BlockFalling) block).a_(this.world, blockposition); ((BlockFalling) block).a_(this.world, blockposition);
} }
@@ -151,7 +159,9 @@ @@ -154,7 +162,9 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next(); Entity entity = (Entity) iterator.next();

View File

@ -17,7 +17,7 @@
public EntityFireball(World world) { public EntityFireball(World world) {
super(world); super(world);
@@ -36,10 +40,17 @@ @@ -36,12 +40,19 @@
public EntityFireball(World world, EntityLiving entityliving, double d0, double d1, double d2) { public EntityFireball(World world, EntityLiving entityliving, double d0, double d1, double d2) {
super(world); super(world);
this.shooter = entityliving; this.shooter = entityliving;
@ -25,7 +25,9 @@
this.setSize(1.0F, 1.0F); this.setSize(1.0F, 1.0F);
this.setPositionRotation(entityliving.locX, entityliving.locY, entityliving.locZ, entityliving.yaw, entityliving.pitch); this.setPositionRotation(entityliving.locX, entityliving.locY, entityliving.locZ, entityliving.yaw, entityliving.pitch);
this.setPosition(this.locX, this.locY, this.locZ); this.setPosition(this.locX, this.locY, this.locZ);
this.motX = this.motY = this.motZ = 0.0D; this.motX = 0.0D;
this.motY = 0.0D;
this.motZ = 0.0D;
+ // CraftBukkit start - Added setDirection method + // CraftBukkit start - Added setDirection method
+ this.setDirection(d0, d1, d2); + this.setDirection(d0, d1, d2);
+ } + }
@ -35,7 +37,7 @@
d0 += this.random.nextGaussian() * 0.4D; d0 += this.random.nextGaussian() * 0.4D;
d1 += this.random.nextGaussian() * 0.4D; d1 += this.random.nextGaussian() * 0.4D;
d2 += this.random.nextGaussian() * 0.4D; d2 += this.random.nextGaussian() * 0.4D;
@@ -83,6 +94,12 @@ @@ -85,6 +96,12 @@
if (movingobjectposition != null) { if (movingobjectposition != null) {
this.a(movingobjectposition); this.a(movingobjectposition);
@ -48,9 +50,9 @@
} }
this.locX += this.motX; this.locX += this.motX;
@@ -187,6 +204,11 @@ @@ -191,6 +208,11 @@
} else { } else {
this.ao(); this.ap();
if (damagesource.getEntity() != null) { if (damagesource.getEntity() != null) {
+ // CraftBukkit start + // CraftBukkit start
+ if (CraftEventFactory.handleNonLivingEntityDamageEvent(this, damagesource, f)) { + if (CraftEventFactory.handleNonLivingEntityDamageEvent(this, damagesource, f)) {
@ -60,7 +62,7 @@
Vec3D vec3d = damagesource.getEntity().aB(); Vec3D vec3d = damagesource.getEntity().aB();
if (vec3d != null) { if (vec3d != null) {
@@ -200,6 +222,7 @@ @@ -204,6 +226,7 @@
if (damagesource.getEntity() instanceof EntityLiving) { if (damagesource.getEntity() instanceof EntityLiving) {
this.shooter = (EntityLiving) damagesource.getEntity(); this.shooter = (EntityLiving) damagesource.getEntity();

View File

@ -22,9 +22,9 @@
this.hooked = movingobjectposition.entity; this.hooked = movingobjectposition.entity;
this.getDataWatcher().set(EntityFishingHook.c, Integer.valueOf(this.hooked.getId() + 1)); this.getDataWatcher().set(EntityFishingHook.c, Integer.valueOf(this.hooked.getId() + 1));
@@ -266,6 +273,10 @@ @@ -266,6 +273,10 @@
if (this.av <= 0) { if (this.au <= 0) {
this.av = 0;
this.aw = 0; this.aw = 0;
this.ax = 0;
+ // CraftBukkit start + // CraftBukkit start
+ PlayerFishEvent playerFishEvent = new PlayerFishEvent((Player) this.owner.getBukkitEntity(), null, (Fish) this.getBukkitEntity(), PlayerFishEvent.State.FAILED_ATTEMPT); + PlayerFishEvent playerFishEvent = new PlayerFishEvent((Player) this.owner.getBukkitEntity(), null, (Fish) this.getBukkitEntity(), PlayerFishEvent.State.FAILED_ATTEMPT);
+ this.world.getServer().getPluginManager().callEvent(playerFishEvent); + this.world.getServer().getPluginManager().callEvent(playerFishEvent);
@ -33,9 +33,9 @@
} else { } else {
double d10; double d10;
@@ -278,6 +289,13 @@ @@ -278,6 +289,13 @@
if (this.ax > 0) { if (this.aw > 0) {
this.ax -= l; this.aw -= l;
if (this.ax <= 0) { if (this.aw <= 0) {
+ // CraftBukkit start + // CraftBukkit start
+ PlayerFishEvent playerFishEvent = new PlayerFishEvent((Player) this.owner.getBukkitEntity(), null, (Fish) this.getBukkitEntity(), PlayerFishEvent.State.BITE); + PlayerFishEvent playerFishEvent = new PlayerFishEvent((Player) this.owner.getBukkitEntity(), null, (Fish) this.getBukkitEntity(), PlayerFishEvent.State.BITE);
+ this.world.getServer().getPluginManager().callEvent(playerFishEvent); + this.world.getServer().getPluginManager().callEvent(playerFishEvent);
@ -46,7 +46,7 @@
this.motY -= 0.20000000298023224D; this.motY -= 0.20000000298023224D;
this.a(SoundEffects.G, 0.25F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F); this.a(SoundEffects.G, 0.25F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F);
f2 = (float) MathHelper.floor(this.getBoundingBox().b); f2 = (float) MathHelper.floor(this.getBoundingBox().b);
@@ -388,6 +406,14 @@ @@ -390,6 +408,14 @@
int i = 0; int i = 0;
if (this.hooked != null) { if (this.hooked != null) {
@ -61,7 +61,7 @@
this.k(); this.k();
this.world.broadcastEntityEffect(this, (byte) 31); this.world.broadcastEntityEffect(this, (byte) 31);
i = this.hooked instanceof EntityItem ? 3 : 5; i = this.hooked instanceof EntityItem ? 3 : 5;
@@ -400,6 +426,15 @@ @@ -402,6 +428,15 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
ItemStack itemstack = (ItemStack) iterator.next(); ItemStack itemstack = (ItemStack) iterator.next();
EntityItem entityitem = new EntityItem(this.world, this.locX, this.locY, this.locZ, itemstack); EntityItem entityitem = new EntityItem(this.world, this.locX, this.locY, this.locZ, itemstack);
@ -77,9 +77,9 @@
double d0 = this.owner.locX - this.locX; double d0 = this.owner.locX - this.locX;
double d1 = this.owner.locY - this.locY; double d1 = this.owner.locY - this.locY;
double d2 = this.owner.locZ - this.locZ; double d2 = this.owner.locZ - this.locZ;
@@ -410,15 +445,36 @@ @@ -412,15 +447,36 @@
entityitem.motY = d1 * d4 + (double) MathHelper.sqrt(d3) * 0.08D; entityitem.motY = d1 * 0.1D + (double) MathHelper.sqrt(d3) * 0.08D;
entityitem.motZ = d2 * d4; entityitem.motZ = d2 * 0.1D;
this.world.addEntity(entityitem); this.world.addEntity(entityitem);
- this.owner.world.addEntity(new EntityExperienceOrb(this.owner.world, this.owner.locX, this.owner.locY + 0.5D, this.owner.locZ + 0.5D, this.random.nextInt(6) + 1)); - this.owner.world.addEntity(new EntityExperienceOrb(this.owner.world, this.owner.locX, this.owner.locY + 0.5D, this.owner.locZ + 0.5D, this.random.nextInt(6) + 1));
+ // CraftBukkit start - this.random.nextInt(6) + 1 -> playerFishEvent.getExpToDrop() + // CraftBukkit start - this.random.nextInt(6) + 1 -> playerFishEvent.getExpToDrop()

View File

@ -1,12 +1,12 @@
--- a/net/minecraft/server/EntityGhast.java --- a/net/minecraft/server/EntityGhast.java
+++ b/net/minecraft/server/EntityGhast.java +++ b/net/minecraft/server/EntityGhast.java
@@ -155,7 +155,8 @@ @@ -159,7 +159,8 @@
world.a((EntityHuman) null, 1016, new BlockPosition(this.ghast), 0); world.a((EntityHuman) null, 1016, new BlockPosition(this.ghast), 0);
EntityLargeFireball entitylargefireball = new EntityLargeFireball(world, this.ghast, d2, d3, d4); EntityLargeFireball entitylargefireball = new EntityLargeFireball(world, this.ghast, d2, d3, d4);
- entitylargefireball.yield = this.ghast.getPower(); - entitylargefireball.yield = this.ghast.getPower();
+ // CraftBukkit - set bukkitYield when setting explosionpower + // CraftBukkit - set bukkitYield when setting explosionpower
+ entitylargefireball.bukkitYield = entitylargefireball.yield = this.ghast.getPower(); + entitylargefireball.bukkitYield = entitylargefireball.yield = this.ghast.getPower();
entitylargefireball.locX = this.ghast.locX + vec3d.x * d1; entitylargefireball.locX = this.ghast.locX + vec3d.x * 4.0D;
entitylargefireball.locY = this.ghast.locY + (double) (this.ghast.length / 2.0F) + 0.5D; entitylargefireball.locY = this.ghast.locY + (double) (this.ghast.length / 2.0F) + 0.5D;
entitylargefireball.locZ = this.ghast.locZ + vec3d.z * d1; entitylargefireball.locZ = this.ghast.locZ + vec3d.z * 4.0D;

View File

@ -12,7 +12,7 @@
public abstract class EntityHanging extends Entity { public abstract class EntityHanging extends Entity {
private static final Predicate<Entity> c = new Predicate() { private static final Predicate<Entity> c = new Predicate() {
@@ -40,30 +45,39 @@ @@ -41,39 +46,44 @@
this.updateBoundingBox(); this.updateBoundingBox();
} }
@ -21,60 +21,63 @@
- double d0 = (double) this.blockPosition.getX() + 0.5D; - double d0 = (double) this.blockPosition.getX() + 0.5D;
- double d1 = (double) this.blockPosition.getY() + 0.5D; - double d1 = (double) this.blockPosition.getY() + 0.5D;
- double d2 = (double) this.blockPosition.getZ() + 0.5D; - double d2 = (double) this.blockPosition.getZ() + 0.5D;
+ /* CraftBukkit start - bounding box calculation made static (for spawn usage) - double d3 = 0.46875D;
+
+ l is from function l()
+ m is from function m()
+
+ Placing here as it's more likely to be noticed as something which needs to be updated
+ then something in a CraftBukkit file.
+ */
+ public static AxisAlignedBB calculateBoundingBox(Entity entity, BlockPosition blockPosition, EnumDirection direction, int width, int height) {
+ double d0 = (double) blockPosition.getX() + 0.5D;
+ double d1 = (double) blockPosition.getY() + 0.5D;
+ double d2 = (double) blockPosition.getZ() + 0.5D;
double d3 = 0.46875D;
- double d4 = this.a(this.getWidth()); - double d4 = this.a(this.getWidth());
- double d5 = this.a(this.getHeight()); - double d5 = this.a(this.getHeight());
+ double d4 = a(width); -
+ double d5 = a(height);
- d0 -= (double) this.direction.getAdjacentX() * 0.46875D; - d0 -= (double) this.direction.getAdjacentX() * 0.46875D;
- d2 -= (double) this.direction.getAdjacentZ() * 0.46875D; - d2 -= (double) this.direction.getAdjacentZ() * 0.46875D;
+ d0 -= (double) direction.getAdjacentX() * 0.46875D; - d1 += d5;
+ d2 -= (double) direction.getAdjacentZ() * 0.46875D;
d1 += d5;
- EnumDirection enumdirection = this.direction.f(); - EnumDirection enumdirection = this.direction.f();
+ EnumDirection enumdirection = direction.f(); + // CraftBukkit start - break out BB calc into own method
+ public static AxisAlignedBB calculateBoundingBox(Entity entity, BlockPosition blockPosition, EnumDirection direction, int width, int height) {
+ double d0 = (double) blockPosition.getX() + 0.5D;
+ double d1 = (double) blockPosition.getY() + 0.5D;
+ double d2 = (double) blockPosition.getZ() + 0.5D;
+ double d3 = 0.46875D;
+ double d4 = width;
+ double d5 = height;
+
+ d0 -= (double) direction.getAdjacentX() * 0.46875D;
+ d2 -= (double) direction.getAdjacentZ() * 0.46875D;
+ d1 += d5;
+ EnumDirection enumdirection = direction.f();
+
+ d0 += d4 * (double) enumdirection.getAdjacentX();
+ d2 += d4 * (double) enumdirection.getAdjacentZ();
+
+ double d6 = (double) width;
+ double d7 = (double) height;
+ double d8 = (double) width;
d0 += d4 * (double) enumdirection.getAdjacentX(); - d0 += d4 * (double) enumdirection.getAdjacentX();
d2 += d4 * (double) enumdirection.getAdjacentZ(); - d2 += d4 * (double) enumdirection.getAdjacentZ();
- this.locX = d0; - this.locX = d0;
- this.locY = d1; - this.locY = d1;
- this.locZ = d2; - this.locZ = d2;
- double d6 = (double) this.getWidth(); - double d6 = (double) this.getWidth();
- double d7 = (double) this.getHeight(); - double d7 = (double) this.getHeight();
- double d8 = (double) this.getWidth(); - double d8 = (double) this.getWidth();
+ if (entity != null) { -
+ entity.locX = d0;
+ entity.locY = d1;
+ entity.locZ = d2;
+ }
+ double d6 = (double) width;
+ double d7 = (double) height;
+ double d8 = (double) width;
- if (this.direction.k() == EnumDirection.EnumAxis.Z) { - if (this.direction.k() == EnumDirection.EnumAxis.Z) {
+ if (direction.k() == EnumDirection.EnumAxis.Z) { - d8 = 1.0D;
d8 = 1.0D; - } else {
} else { - d6 = 1.0D;
d6 = 1.0D; - }
@@ -72,11 +86,18 @@ + if (direction.k() == EnumDirection.EnumAxis.Z) {
d6 /= 32.0D; + d8 = 1.0D;
d7 /= 32.0D; + } else {
d8 /= 32.0D; + d6 = 1.0D;
+ }
- d6 /= 32.0D;
- d7 /= 32.0D;
- d8 /= 32.0D;
- this.a(new AxisAlignedBB(d0 - d6, d1 - d7, d2 - d8, d0 + d6, d1 + d7, d2 + d8)); - this.a(new AxisAlignedBB(d0 - d6, d1 - d7, d2 - d8, d0 + d6, d1 + d7, d2 + d8));
+ return new AxisAlignedBB(d0 - d6, d1 - d7, d2 - d8, d0 + d6, d1 + d7, d2 + d8); + d6 /= 32.0D;
+ d7 /= 32.0D;
+ d8 /= 32.0D;
+ return new AxisAlignedBB(d0 - d6, d1 - d7, d2 - d8, d0 + d6, d1 + d7, d2 + d8);
+ } + }
+ +
+ protected void updateBoundingBox() { + protected void updateBoundingBox() {
@ -85,12 +88,7 @@
} }
} }
- private double a(int i) { @@ -88,6 +98,24 @@
+ private static double a(int i) {
return i % 32 == 0 ? 0.5D : 0.0D;
}
@@ -87,6 +108,24 @@
if (this.d++ == 100 && !this.world.isClientSide) { if (this.d++ == 100 && !this.world.isClientSide) {
this.d = 0; this.d = 0;
if (!this.dead && !this.survives()) { if (!this.dead && !this.survives()) {
@ -115,7 +113,7 @@
this.die(); this.die();
this.a((Entity) null); this.a((Entity) null);
} }
@@ -137,6 +176,21 @@ @@ -140,6 +168,21 @@
return false; return false;
} else { } else {
if (!this.dead && !this.world.isClientSide) { if (!this.dead && !this.world.isClientSide) {
@ -135,9 +133,9 @@
+ // CraftBukkit end + // CraftBukkit end
+ +
this.die(); this.die();
this.ao(); this.ap();
this.a(damagesource.getEntity()); this.a(damagesource.getEntity());
@@ -148,6 +202,18 @@ @@ -151,6 +194,18 @@
public void move(double d0, double d1, double d2) { public void move(double d0, double d1, double d2) {
if (!this.world.isClientSide && !this.dead && d0 * d0 + d1 * d1 + d2 * d2 > 0.0D) { if (!this.world.isClientSide && !this.dead && d0 * d0 + d1 * d1 + d2 * d2 > 0.0D) {
@ -156,7 +154,7 @@
this.die(); this.die();
this.a((Entity) null); this.a((Entity) null);
} }
@@ -155,7 +221,7 @@ @@ -158,7 +213,7 @@
} }
public void g(double d0, double d1, double d2) { public void g(double d0, double d1, double d2) {

View File

@ -8,25 +8,25 @@
+ +
public class EntityHorse extends EntityAnimal implements IInventoryListener, IJumpable { public class EntityHorse extends EntityAnimal implements IInventoryListener, IJumpable {
private static final Predicate<Entity> bC = new Predicate() { private static final Predicate<Entity> bD = new Predicate() {
@@ -53,6 +55,7 @@ @@ -52,6 +54,7 @@
private String ce; private int ce;
private String[] cf = new String[3]; private String cf;
private boolean cg = false; private final String[] cg = new String[3];
+ public int maxDomestication = 100; // CraftBukkit - store max domestication value + public int maxDomestication = 100; // CraftBukkit - store max domestication value
public EntityHorse(World world) { public EntityHorse(World world) {
super(world); super(world);
@@ -321,7 +324,7 @@ @@ -320,7 +323,7 @@
public void loadChest() { public void loadChest() {
InventoryHorseChest inventoryhorsechest = this.inventoryChest; InventoryHorseChest inventoryhorsechest = this.inventoryChest;
- this.inventoryChest = new InventoryHorseChest("HorseChest", this.dJ()); - this.inventoryChest = new InventoryHorseChest("HorseChest", this.dN());
+ this.inventoryChest = new InventoryHorseChest("HorseChest", this.dJ(), this); // CraftBukkit + this.inventoryChest = new InventoryHorseChest("HorseChest", this.dN(), this); // CraftBukkit
this.inventoryChest.a(this.getName()); this.inventoryChest.a(this.getName());
if (inventoryhorsechest != null) { if (inventoryhorsechest != null) {
inventoryhorsechest.b(this); inventoryhorsechest.b(this);
@@ -474,7 +477,7 @@ @@ -473,7 +476,7 @@
} }
public int getMaxDomestication() { public int getMaxDomestication() {
@ -34,8 +34,8 @@
+ return this.maxDomestication; // CraftBukkit - return stored max domestication instead of 100 + return this.maxDomestication; // CraftBukkit - return stored max domestication instead of 100
} }
protected float ce() { protected float ch() {
@@ -564,7 +567,7 @@ @@ -563,7 +566,7 @@
} }
if (this.getHealth() < this.getMaxHealth() && f > 0.0F) { if (this.getHealth() < this.getMaxHealth() && f > 0.0F) {
@ -44,7 +44,7 @@
flag = true; flag = true;
} }
@@ -655,11 +658,11 @@ @@ -654,11 +657,11 @@
} }
public void die(DamageSource damagesource) { public void die(DamageSource damagesource) {
@ -58,7 +58,7 @@
} }
public void n() { public void n() {
@@ -670,7 +673,7 @@ @@ -669,7 +672,7 @@
super.n(); super.n();
if (!this.world.isClientSide) { if (!this.world.isClientSide) {
if (this.random.nextInt(900) == 0 && this.deathTicks == 0) { if (this.random.nextInt(900) == 0 && this.deathTicks == 0) {
@ -66,8 +66,8 @@
+ this.heal(1.0F, RegainReason.REGEN); // CraftBukkit + this.heal(1.0F, RegainReason.REGEN); // CraftBukkit
} }
if (!this.dn() && !this.isVehicle() && this.random.nextInt(300) == 0 && this.world.getType(new BlockPosition(MathHelper.floor(this.locX), MathHelper.floor(this.locY) - 1, MathHelper.floor(this.locZ))).getBlock() == Blocks.GRASS) { if (!this.dr() && !this.isVehicle() && this.random.nextInt(300) == 0 && this.world.getType(new BlockPosition(MathHelper.floor(this.locX), MathHelper.floor(this.locY) - 1, MathHelper.floor(this.locZ))).getBlock() == Blocks.GRASS) {
@@ -921,6 +924,7 @@ @@ -929,6 +932,7 @@
if (this.getOwnerUUID() != null) { if (this.getOwnerUUID() != null) {
nbttagcompound.setString("OwnerUUID", this.getOwnerUUID().toString()); nbttagcompound.setString("OwnerUUID", this.getOwnerUUID().toString());
} }
@ -75,7 +75,7 @@
if (this.hasChest()) { if (this.hasChest()) {
NBTTagList nbttaglist = new NBTTagList(); NBTTagList nbttaglist = new NBTTagList();
@@ -976,6 +980,12 @@ @@ -984,6 +988,12 @@
this.setOwnerUUID(UUID.fromString(s)); this.setOwnerUUID(UUID.fromString(s));
} }
@ -88,7 +88,7 @@
AttributeInstance attributeinstance = this.getAttributeMap().a("Speed"); AttributeInstance attributeinstance = this.getAttributeMap().a("Speed");
if (attributeinstance != null) { if (attributeinstance != null) {
@@ -1148,6 +1158,18 @@ @@ -1156,6 +1166,18 @@
} }
public void b(int i) { public void b(int i) {

View File

@ -26,11 +26,11 @@
public Container activeContainer; public Container activeContainer;
- protected FoodMetaData foodData = new FoodMetaData(); - protected FoodMetaData foodData = new FoodMetaData();
+ protected FoodMetaData foodData = new FoodMetaData(this); // CraftBukkit - add "this" to constructor + protected FoodMetaData foodData = new FoodMetaData(this); // CraftBukkit - add "this" to constructor
protected int bw; protected int bx;
public float bx;
public float by; public float by;
@@ -53,6 +66,17 @@ public float bz;
private final ItemCooldown bV = this.l(); @@ -52,6 +65,17 @@
private final ItemCooldown bW = this.l();
public EntityFishingHook hookedFish; public EntityFishingHook hookedFish;
+ // CraftBukkit start + // CraftBukkit start
@ -47,7 +47,7 @@
protected ItemCooldown l() { protected ItemCooldown l() {
return new ItemCooldown(); return new ItemCooldown();
} }
@@ -302,7 +326,8 @@ @@ -307,7 +331,8 @@
if (this.world.getDifficulty() == EnumDifficulty.PEACEFUL && this.world.getGameRules().getBoolean("naturalRegeneration")) { if (this.world.getDifficulty() == EnumDifficulty.PEACEFUL && this.world.getGameRules().getBoolean("naturalRegeneration")) {
if (this.getHealth() < this.getMaxHealth() && this.ticksLived % 20 == 0) { if (this.getHealth() < this.getMaxHealth() && this.ticksLived % 20 == 0) {
@ -57,7 +57,7 @@
} }
if (this.foodData.c() && this.ticksLived % 10 == 0) { if (this.foodData.c() && this.ticksLived % 10 == 0) {
@@ -326,7 +351,7 @@ @@ -331,7 +356,7 @@
this.l((float) attributeinstance.getValue()); this.l((float) attributeinstance.getValue());
float f = MathHelper.sqrt(this.motX * this.motX + this.motZ * this.motZ); float f = MathHelper.sqrt(this.motX * this.motX + this.motZ * this.motZ);
@ -66,7 +66,7 @@
if (f > 0.1F) { if (f > 0.1F) {
f = 0.1F; f = 0.1F;
@@ -417,30 +442,36 @@ @@ -423,28 +448,34 @@
public void b(Entity entity, int i) { public void b(Entity entity, int i) {
if (entity != this) { if (entity != this) {
this.addScore(i); this.addScore(i);
@ -91,12 +91,10 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
- ScoreboardObjective scoreboardobjective = (ScoreboardObjective) iterator.next(); - ScoreboardObjective scoreboardobjective = (ScoreboardObjective) iterator.next();
- ScoreboardScore scoreboardscore = this.getScoreboard().getPlayerScoreForObjective(this.getName(), scoreboardobjective);
+ // CraftBukkit start + // CraftBukkit start
+ // ScoreboardObjective scoreboardobjective = (ScoreboardObjective) iterator.next(); + // ScoreboardObjective scoreboardobjective = (ScoreboardObjective) iterator.next();
+ // ScoreboardScore scoreboardscore = this.getScoreboard().getPlayerScoreForObjective(this.getName(), scoreboardobjective);
- scoreboardscore.incrementScore(); - this.getScoreboard().getPlayerScoreForObjective(this.getName(), scoreboardobjective).incrementScore();
+ iterator.next().incrementScore(); + iterator.next().incrementScore();
+ // CraftBukkit end + // CraftBukkit end
} }
@ -105,13 +103,11 @@
} }
- private Collection<ScoreboardObjective> d(Entity entity) { - private Collection<ScoreboardObjective> d(Entity entity) {
- String s = entity instanceof EntityHuman ? entity.getName() : entity.bd();
+ private Collection<ScoreboardScore> d(Entity entity) { // CraftBukkit + private Collection<ScoreboardScore> d(Entity entity) { // CraftBukkit
+ String s = entity instanceof EntityHuman ? entity.getName() : entity.getUniqueID().toString(); String s = entity instanceof EntityHuman ? entity.getName() : entity.bf();
ScoreboardTeam scoreboardteam = this.getScoreboard().getPlayerTeam(this.getName()); ScoreboardTeam scoreboardteam = this.getScoreboard().getPlayerTeam(this.getName());
if (scoreboardteam != null) { @@ -469,7 +500,10 @@
@@ -464,7 +495,10 @@
int j = scoreboardteam1.m().b(); int j = scoreboardteam1.m().b();
if (j >= 0 && j < IScoreboardCriteria.m.length) { if (j >= 0 && j < IScoreboardCriteria.m.length) {
@ -123,7 +119,7 @@
} }
} }
@@ -473,6 +507,7 @@ @@ -478,6 +512,7 @@
@Nullable @Nullable
public EntityItem a(boolean flag) { public EntityItem a(boolean flag) {
@ -131,7 +127,7 @@
return this.a(this.inventory.splitStack(this.inventory.itemInHandIndex, flag && this.inventory.getItemInHand() != null ? this.inventory.getItemInHand().count : 1), false, true); return this.a(this.inventory.splitStack(this.inventory.itemInHandIndex, flag && this.inventory.getItemInHand() != null ? this.inventory.getItemInHand().count : 1), false, true);
} }
@@ -517,6 +552,30 @@ @@ -522,6 +557,30 @@
entityitem.motZ += Math.sin((double) f1) * (double) f; entityitem.motZ += Math.sin((double) f1) * (double) f;
} }
@ -162,7 +158,7 @@
ItemStack itemstack1 = this.a(entityitem); ItemStack itemstack1 = this.a(entityitem);
if (flag1) { if (flag1) {
@@ -615,6 +674,13 @@ @@ -630,6 +689,13 @@
this.a(true, true, false); this.a(true, true, false);
} }
@ -176,7 +172,7 @@
if (nbttagcompound.hasKeyOfType("SpawnX", 99) && nbttagcompound.hasKeyOfType("SpawnY", 99) && nbttagcompound.hasKeyOfType("SpawnZ", 99)) { if (nbttagcompound.hasKeyOfType("SpawnX", 99) && nbttagcompound.hasKeyOfType("SpawnY", 99) && nbttagcompound.hasKeyOfType("SpawnZ", 99)) {
this.e = new BlockPosition(nbttagcompound.getInt("SpawnX"), nbttagcompound.getInt("SpawnY"), nbttagcompound.getInt("SpawnZ")); this.e = new BlockPosition(nbttagcompound.getInt("SpawnX"), nbttagcompound.getInt("SpawnY"), nbttagcompound.getInt("SpawnZ"));
this.f = nbttagcompound.getBoolean("SpawnForced"); this.f = nbttagcompound.getBoolean("SpawnForced");
@@ -652,6 +718,12 @@ @@ -667,6 +733,12 @@
this.foodData.b(nbttagcompound); this.foodData.b(nbttagcompound);
this.abilities.a(nbttagcompound); this.abilities.a(nbttagcompound);
nbttagcompound.set("EnderItems", this.enderChest.h()); nbttagcompound.set("EnderItems", this.enderChest.h());
@ -189,7 +185,7 @@
} }
public boolean damageEntity(DamageSource damagesource, float f) { public boolean damageEntity(DamageSource damagesource, float f) {
@@ -670,7 +742,7 @@ @@ -685,7 +757,7 @@
if (damagesource.r()) { if (damagesource.r()) {
if (this.world.getDifficulty() == EnumDifficulty.PEACEFUL) { if (this.world.getDifficulty() == EnumDifficulty.PEACEFUL) {
@ -198,21 +194,19 @@
} }
if (this.world.getDifficulty() == EnumDifficulty.EASY) { if (this.world.getDifficulty() == EnumDifficulty.EASY) {
@@ -682,7 +754,7 @@ @@ -697,16 +769,35 @@
} }
} }
- if (f == 0.0F) { - return f == 0.0F ? false : super.damageEntity(damagesource, f);
+ if (false && f == 0.0F) { // CraftBukkit - Don't filter out 0 damage + return super.damageEntity(damagesource, f); // CraftBukkit - Don't filter out 0 damage
return false; }
} else { }
Entity entity = damagesource.getEntity();
@@ -698,10 +770,29 @@
} }
public boolean a(EntityHuman entityhuman) { public boolean a(EntityHuman entityhuman) {
- ScoreboardTeamBase scoreboardteambase = this.aO(); - ScoreboardTeamBase scoreboardteambase = this.aQ();
- ScoreboardTeamBase scoreboardteambase1 = entityhuman.aO(); - ScoreboardTeamBase scoreboardteambase1 = entityhuman.aQ();
+ // CraftBukkit start - Change to check OTHER player's scoreboard team according to API + // CraftBukkit start - Change to check OTHER player's scoreboard team according to API
+ // To summarize this method's logic, it's "Can parameter hurt this" + // To summarize this method's logic, it's "Can parameter hurt this"
+ org.bukkit.scoreboard.Team team; + org.bukkit.scoreboard.Team team;
@ -240,7 +234,7 @@
} }
protected void damageArmor(float f) { protected void damageArmor(float f) {
@@ -745,7 +836,12 @@ @@ -750,7 +841,12 @@
return (float) i / (float) this.inventory.armor.length; return (float) i / (float) this.inventory.armor.length;
} }
@ -254,7 +248,7 @@
if (!this.isInvulnerable(damagesource)) { if (!this.isInvulnerable(damagesource)) {
f = this.applyArmorModifier(damagesource, f); f = this.applyArmorModifier(damagesource, f);
f = this.applyMagicModifier(damagesource, f); f = this.applyMagicModifier(damagesource, f);
@@ -765,6 +861,7 @@ @@ -770,6 +866,7 @@
} }
} }
@ -262,7 +256,7 @@
} }
public void openSign(TileEntitySign tileentitysign) {} public void openSign(TileEntitySign tileentitysign) {}
@@ -887,8 +984,15 @@ @@ -894,8 +991,15 @@
if (entity instanceof EntityLiving) { if (entity instanceof EntityLiving) {
f3 = ((EntityLiving) entity).getHealth(); f3 = ((EntityLiving) entity).getHealth();
if (j > 0 && !entity.isBurning()) { if (j > 0 && !entity.isBurning()) {
@ -280,7 +274,7 @@
} }
} }
@@ -918,8 +1022,11 @@ @@ -925,8 +1029,11 @@
EntityLiving entityliving = (EntityLiving) iterator.next(); EntityLiving entityliving = (EntityLiving) iterator.next();
if (entityliving != this && entityliving != entity && !this.r(entityliving) && this.h(entityliving) < 9.0D) { if (entityliving != this && entityliving != entity && !this.r(entityliving) && this.h(entityliving) < 9.0D) {
@ -293,7 +287,7 @@
} }
} }
@@ -928,11 +1035,28 @@ @@ -935,11 +1042,28 @@
} }
if (entity instanceof EntityPlayer && entity.velocityChanged) { if (entity instanceof EntityPlayer && entity.velocityChanged) {
@ -322,7 +316,7 @@
} }
if (flag2) { if (flag2) {
@@ -994,7 +1118,8 @@ @@ -1001,7 +1125,8 @@
if (itemstack3 != null && object instanceof EntityLiving) { if (itemstack3 != null && object instanceof EntityLiving) {
itemstack3.a((EntityLiving) object, this); itemstack3.a((EntityLiving) object, this);
@ -332,7 +326,7 @@
this.a(EnumHand.MAIN_HAND, (ItemStack) null); this.a(EnumHand.MAIN_HAND, (ItemStack) null);
} }
} }
@@ -1004,7 +1129,14 @@ @@ -1011,7 +1136,14 @@
this.a(StatisticList.y, Math.round(f5 * 10.0F)); this.a(StatisticList.y, Math.round(f5 * 10.0F));
if (j > 0) { if (j > 0) {
@ -348,7 +342,7 @@
} }
if (this.world instanceof WorldServer && f5 > 2.0F) { if (this.world instanceof WorldServer && f5 > 2.0F) {
@@ -1093,6 +1225,20 @@ @@ -1100,6 +1232,20 @@
this.stopRiding(); this.stopRiding();
} }
@ -369,7 +363,7 @@
this.setSize(0.2F, 0.2F); this.setSize(0.2F, 0.2F);
if (this.world.isLoaded(blockposition)) { if (this.world.isLoaded(blockposition)) {
EnumDirection enumdirection = (EnumDirection) this.world.getType(blockposition).get(BlockFacingHorizontal.FACING); EnumDirection enumdirection = (EnumDirection) this.world.getType(blockposition).get(BlockFacingHorizontal.FACING);
@@ -1175,6 +1321,23 @@ @@ -1184,6 +1330,23 @@
this.world.everyoneSleeping(); this.world.everyoneSleeping();
} }
@ -393,7 +387,7 @@
this.sleepTicks = flag ? 0 : 100; this.sleepTicks = flag ? 0 : 100;
if (flag2) { if (flag2) {
this.setRespawnPosition(this.bedPosition, false); this.setRespawnPosition(this.bedPosition, false);
@@ -1226,9 +1389,11 @@ @@ -1235,9 +1398,11 @@
if (blockposition != null) { if (blockposition != null) {
this.e = blockposition; this.e = blockposition;
this.f = flag; this.f = flag;

View File

@ -16,7 +16,7 @@
public abstract class EntityInsentient extends EntityLiving { public abstract class EntityInsentient extends EntityLiving {
private static final DataWatcherObject<Byte> a = DataWatcher.a(EntityInsentient.class, DataWatcherRegistry.a); private static final DataWatcherObject<Byte> a = DataWatcher.a(EntityInsentient.class, DataWatcherRegistry.a);
@@ -61,6 +70,9 @@ @@ -52,6 +61,9 @@
this.r(); this.r();
} }
@ -26,20 +26,20 @@
} }
protected void r() {} protected void r() {}
@@ -75,9 +87,10 @@ @@ -66,9 +78,10 @@
} }
public float a(PathType pathtype) { public float a(PathType pathtype) {
- Float float = (Float) this.bA.get(pathtype); - Float float = (Float) this.bB.get(pathtype);
+ // CraftBukkit - decompile error + // CraftBukkit - decompile error
+ Float ofloat = (Float) this.bA.get(pathtype); + Float ofloat = (Float) this.bB.get(pathtype);
- return float == null ? pathtype.a() : float.floatValue(); - return float == null ? pathtype.a() : float.floatValue();
+ return ofloat == null ? pathtype.a() : ofloat.floatValue(); + return ofloat == null ? pathtype.a() : ofloat.floatValue();
} }
public void a(PathType pathtype, float f) { public void a(PathType pathtype, float f) {
@@ -114,7 +127,38 @@ @@ -105,7 +118,38 @@
} }
public void setGoalTarget(@Nullable EntityLiving entityliving) { public void setGoalTarget(@Nullable EntityLiving entityliving) {
@ -78,14 +78,14 @@
} }
public boolean d(Class<? extends EntityLiving> oclass) { public boolean d(Class<? extends EntityLiving> oclass) {
@@ -327,11 +371,20 @@ @@ -350,11 +394,20 @@
public void a(NBTTagCompound nbttagcompound) { public void a(NBTTagCompound nbttagcompound) {
super.a(nbttagcompound); super.a(nbttagcompound);
+ +
+ // CraftBukkit start - If looting or persistence is false only use it if it was set after we started using it + // CraftBukkit start - If looting or persistence is false only use it if it was set after we started using it
if (nbttagcompound.hasKeyOfType("CanPickUpLoot", 1)) { if (nbttagcompound.hasKeyOfType("CanPickUpLoot", 1)) {
- this.l(nbttagcompound.getBoolean("CanPickUpLoot")); - this.m(nbttagcompound.getBoolean("CanPickUpLoot"));
+ boolean data = nbttagcompound.getBoolean("CanPickUpLoot"); + boolean data = nbttagcompound.getBoolean("CanPickUpLoot");
+ if (isLevelAtLeast(nbttagcompound, 1) || data) { + if (isLevelAtLeast(nbttagcompound, 1) || data) {
+ this.l(data); + this.l(data);
@ -101,7 +101,7 @@
NBTTagList nbttaglist; NBTTagList nbttaglist;
int i; int i;
@@ -556,11 +609,11 @@ @@ -579,11 +632,11 @@
double d2 = entityhuman.locZ - this.locZ; double d2 = entityhuman.locZ - this.locZ;
double d3 = d0 * d0 + d1 * d1 + d2 * d2; double d3 = d0 * d0 + d1 * d1 + d2 * d2;
@ -115,7 +115,7 @@
this.die(); this.die();
} else if (d3 < 1024.0D) { } else if (d3 < 1024.0D) {
this.ticksFarFromPlayer = 0; this.ticksFarFromPlayer = 0;
@@ -940,9 +993,21 @@ @@ -965,9 +1018,21 @@
public final boolean a(EntityHuman entityhuman, @Nullable ItemStack itemstack, EnumHand enumhand) { public final boolean a(EntityHuman entityhuman, @Nullable ItemStack itemstack, EnumHand enumhand) {
if (this.isLeashed() && this.getLeashHolder() == entityhuman) { if (this.isLeashed() && this.getLeashHolder() == entityhuman) {
@ -137,9 +137,9 @@
this.setLeashHolder(entityhuman, true); this.setLeashHolder(entityhuman, true);
--itemstack.count; --itemstack.count;
return true; return true;
@@ -962,10 +1027,12 @@ @@ -987,10 +1052,12 @@
if (this.bD) { if (this.bE) {
if (!this.isAlive()) { if (!this.isAlive()) {
+ this.world.getServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), UnleashReason.PLAYER_UNLEASH)); // CraftBukkit + this.world.getServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), UnleashReason.PLAYER_UNLEASH)); // CraftBukkit
this.unleash(true, true); this.unleash(true, true);
@ -150,8 +150,8 @@
this.unleash(true, true); this.unleash(true, true);
} }
} }
@@ -976,7 +1043,9 @@ @@ -1001,7 +1068,9 @@
this.bD = false; this.bE = false;
this.leashHolder = null; this.leashHolder = null;
if (!this.world.isClientSide && flag1) { if (!this.world.isClientSide && flag1) {
+ this.forceDrops = true; // CraftBukkit + this.forceDrops = true; // CraftBukkit
@ -160,7 +160,7 @@
} }
if (!this.world.isClientSide && flag && this.world instanceof WorldServer) { if (!this.world.isClientSide && flag && this.world instanceof WorldServer) {
@@ -1046,6 +1115,7 @@ @@ -1071,6 +1140,7 @@
this.leashHolder = entityleash; this.leashHolder = entityleash;
} else { } else {

View File

@ -44,7 +44,7 @@
this.lastX = this.locX; this.lastX = this.locX;
this.lastY = this.locY; this.lastY = this.locY;
@@ -93,12 +103,20 @@ @@ -96,12 +106,20 @@
this.motY *= -0.5D; this.motY *= -0.5D;
} }
@ -54,7 +54,7 @@
} }
+ // Craftbukkit end */ + // Craftbukkit end */
this.aj(); this.ak();
if (!this.world.isClientSide && this.age >= 6000) { if (!this.world.isClientSide && this.age >= 6000) {
+ // CraftBukkit start - fire ItemDespawnEvent + // CraftBukkit start - fire ItemDespawnEvent
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callItemDespawnEvent(this).isCancelled()) { + if (org.bukkit.craftbukkit.event.CraftEventFactory.callItemDespawnEvent(this).isCancelled()) {
@ -65,7 +65,7 @@
this.die(); this.die();
} }
@@ -140,6 +158,7 @@ @@ -143,6 +161,7 @@
} else if (itemstack1.count + itemstack.count > itemstack1.getMaxStackSize()) { } else if (itemstack1.count + itemstack.count > itemstack1.getMaxStackSize()) {
return false; return false;
} else { } else {
@ -73,7 +73,7 @@
itemstack1.count += itemstack.count; itemstack1.count += itemstack.count;
entityitem.pickupDelay = Math.max(entityitem.pickupDelay, this.pickupDelay); entityitem.pickupDelay = Math.max(entityitem.pickupDelay, this.pickupDelay);
entityitem.age = Math.min(entityitem.age, this.age); entityitem.age = Math.min(entityitem.age, this.age);
@@ -186,6 +205,11 @@ @@ -189,6 +208,11 @@
} else if (this.getItemStack() != null && this.getItemStack().getItem() == Items.NETHER_STAR && damagesource.isExplosion()) { } else if (this.getItemStack() != null && this.getItemStack().getItem() == Items.NETHER_STAR && damagesource.isExplosion()) {
return false; return false;
} else { } else {
@ -82,10 +82,10 @@
+ return false; + return false;
+ } + }
+ // CraftBukkit end + // CraftBukkit end
this.ao(); this.ap();
this.f = (int) ((float) this.f - f); this.f = (int) ((float) this.f - f);
if (this.f <= 0) { if (this.f <= 0) {
@@ -231,7 +255,18 @@ @@ -238,7 +262,18 @@
NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("Item"); NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("Item");
@ -105,7 +105,7 @@
if (this.getItemStack() == null) { if (this.getItemStack() == null) {
this.die(); this.die();
} }
@@ -243,6 +278,26 @@ @@ -250,6 +285,26 @@
ItemStack itemstack = this.getItemStack(); ItemStack itemstack = this.getItemStack();
int i = itemstack.count; int i = itemstack.count;

View File

@ -10,5 +10,5 @@
+ } + }
+ // CraftBukkit end + // CraftBukkit end
this.b(damagesource.getEntity(), false); this.b(damagesource.getEntity(), false);
this.a(SoundEffects.cS, 1.0F, 1.0F); this.a(SoundEffects.cX, 1.0F, 1.0F);
this.setItem((ItemStack) null); this.setItem((ItemStack) null);

View File

@ -25,7 +25,7 @@
this.die(); this.die();
} }
@@ -35,7 +45,8 @@ @@ -39,7 +49,8 @@
public void a(NBTTagCompound nbttagcompound) { public void a(NBTTagCompound nbttagcompound) {
super.a(nbttagcompound); super.a(nbttagcompound);
if (nbttagcompound.hasKeyOfType("ExplosionPower", 99)) { if (nbttagcompound.hasKeyOfType("ExplosionPower", 99)) {

View File

@ -33,7 +33,7 @@
+ // CraftBukkit end + // CraftBukkit end
+ if (true || entityhuman.abilities.canInstantlyBuild) { // CraftBukkit - Process for non-creative as well + if (true || entityhuman.abilities.canInstantlyBuild) { // CraftBukkit - Process for non-creative as well
d0 = 7.0D; d0 = 7.0D;
list = this.world.a(EntityInsentient.class, new AxisAlignedBB(this.locX - d0, this.locY - d0, this.locZ - d0, this.locX + d0, this.locY + d0, this.locZ + d0)); list = this.world.a(EntityInsentient.class, new AxisAlignedBB(this.locX - 7.0D, this.locY - 7.0D, this.locZ - 7.0D, this.locX + 7.0D, this.locY + 7.0D, this.locZ + 7.0D));
iterator = list.iterator(); iterator = list.iterator();
@@ -90,9 +101,20 @@ @@ -90,9 +101,20 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {

View File

@ -49,9 +49,9 @@
public void m() { public void m() {
super.m(); super.m();
if (this.lifeTicks == 2) { if (this.lifeTicks == 2) {
- this.world.a((EntityHuman) null, this.locX, this.locY, this.locZ, SoundEffects.di, SoundCategory.WEATHER, 10000.0F, 0.8F + this.random.nextFloat() * 0.2F); - this.world.a((EntityHuman) null, this.locX, this.locY, this.locZ, SoundEffects.dn, SoundCategory.WEATHER, 10000.0F, 0.8F + this.random.nextFloat() * 0.2F);
+ // CraftBukkit start - Use relative location for far away sounds + // CraftBukkit start - Use relative location for far away sounds
+ // this.world.a((EntityHuman) null, this.locX, this.locY, this.locZ, SoundEffects.dc, SoundCategory.d, 10000.0F, 0.8F + this.random.nextFloat() * 0.2F); + // this.world.a((EntityHuman) null, this.locX, this.locY, this.locZ, SoundEffects.dn, SoundCategory.WEATHER, 10000.0F, 0.8F + this.random.nextFloat() * 0.2F);
+ float pitch = 0.8F + this.random.nextFloat() * 0.2F; + float pitch = 0.8F + this.random.nextFloat() * 0.2F;
+ int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16; + int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16;
+ for (EntityPlayer player : (List<EntityPlayer>) (List) this.world.players) { + for (EntityPlayer player : (List<EntityPlayer>) (List) this.world.players) {
@ -62,13 +62,13 @@
+ double deltaLength = Math.sqrt(distanceSquared); + double deltaLength = Math.sqrt(distanceSquared);
+ double relativeX = player.locX + (deltaX / deltaLength) * viewDistance; + double relativeX = player.locX + (deltaX / deltaLength) * viewDistance;
+ double relativeZ = player.locZ + (deltaZ / deltaLength) * viewDistance; + double relativeZ = player.locZ + (deltaZ / deltaLength) * viewDistance;
+ player.playerConnection.sendPacket(new PacketPlayOutNamedSoundEffect(SoundEffects.di, SoundCategory.WEATHER, relativeX, this.locY, relativeZ, 10000.0F, pitch)); + player.playerConnection.sendPacket(new PacketPlayOutNamedSoundEffect(SoundEffects.dn, SoundCategory.WEATHER, relativeX, this.locY, relativeZ, 10000.0F, pitch));
+ } else { + } else {
+ player.playerConnection.sendPacket(new PacketPlayOutNamedSoundEffect(SoundEffects.di, SoundCategory.WEATHER, this.locX, this.locY, this.locZ, 10000.0F, pitch)); + player.playerConnection.sendPacket(new PacketPlayOutNamedSoundEffect(SoundEffects.dn, SoundCategory.WEATHER, this.locX, this.locY, this.locZ, 10000.0F, pitch));
+ } + }
+ } + }
+ // CraftBukkit end + // CraftBukkit end
this.world.a((EntityHuman) null, this.locX, this.locY, this.locZ, SoundEffects.dh, SoundCategory.WEATHER, 2.0F, 0.5F + this.random.nextFloat() * 0.2F); this.world.a((EntityHuman) null, this.locX, this.locY, this.locZ, SoundEffects.dm, SoundCategory.WEATHER, 2.0F, 0.5F + this.random.nextFloat() * 0.2F);
} }
@@ -57,13 +86,17 @@ @@ -57,13 +86,17 @@

View File

@ -23,10 +23,10 @@
public abstract class EntityLiving extends Entity { public abstract class EntityLiving extends Entity {
private static final UUID a = UUID.fromString("662A6B8D-DA3E-4C1C-8813-96EA6097278D"); private static final UUID a = UUID.fromString("662A6B8D-DA3E-4C1C-8813-96EA6097278D");
@@ -81,6 +97,14 @@ @@ -83,6 +99,14 @@
protected int bo; private BlockPosition bE;
protected int bp; private DamageSource bF;
private BlockPosition bD; private long bG;
+ // CraftBukkit start + // CraftBukkit start
+ public int expToDrop; + public int expToDrop;
+ public int maxAirTicks = 300; + public int maxAirTicks = 300;
@ -38,7 +38,7 @@
public void Q() { public void Q() {
this.damageEntity(DamageSource.OUT_OF_WORLD, Float.MAX_VALUE); this.damageEntity(DamageSource.OUT_OF_WORLD, Float.MAX_VALUE);
@@ -89,7 +113,8 @@ @@ -91,7 +115,8 @@
public EntityLiving(World world) { public EntityLiving(World world) {
super(world); super(world);
this.initAttributes(); this.initAttributes();
@ -46,9 +46,9 @@
+ // CraftBukkit - setHealth(getMaxHealth()) inlined and simplified to skip the instanceof check for EntityPlayer, as getBukkitEntity() is not initialized in constructor + // CraftBukkit - setHealth(getMaxHealth()) inlined and simplified to skip the instanceof check for EntityPlayer, as getBukkitEntity() is not initialized in constructor
+ this.datawatcher.set(EntityLiving.HEALTH, (float) this.getAttributeInstance(GenericAttributes.maxHealth).getValue()); + this.datawatcher.set(EntityLiving.HEALTH, (float) this.getAttributeInstance(GenericAttributes.maxHealth).getValue());
this.i = true; this.i = true;
this.aM = (float) ((Math.random() + 1.0D) * 0.009999999776482582D); this.aN = (float) ((Math.random() + 1.0D) * 0.009999999776482582D);
this.setPosition(this.locX, this.locY, this.locZ); this.setPosition(this.locX, this.locY, this.locZ);
@@ -127,7 +152,13 @@ @@ -129,7 +154,13 @@
double d1 = Math.min((double) (0.2F + f / 15.0F), 2.5D); double d1 = Math.min((double) (0.2F + f / 15.0F), 2.5D);
int i = (int) (150.0D * d1); int i = (int) (150.0D * d1);
@ -63,7 +63,7 @@
} }
} }
@@ -189,7 +220,11 @@ @@ -191,7 +222,11 @@
this.stopRiding(); this.stopRiding();
} }
} else { } else {
@ -76,7 +76,7 @@
} }
if (!this.world.isClientSide) { if (!this.world.isClientSide) {
@@ -246,6 +281,18 @@ @@ -248,6 +283,18 @@
this.world.methodProfiler.b(); this.world.methodProfiler.b();
} }
@ -95,9 +95,9 @@
protected void b(BlockPosition blockposition) { protected void b(BlockPosition blockposition) {
int i = EnchantmentManager.a(Enchantments.j, this); int i = EnchantmentManager.a(Enchantments.j, this);
@@ -261,19 +308,19 @@ @@ -263,19 +310,19 @@
protected void bD() { protected void bF() {
++this.deathTicks; ++this.deathTicks;
- if (this.deathTicks == 20) { - if (this.deathTicks == 20) {
+ if (this.deathTicks >= 20 && !this.dead) { // CraftBukkit - (this.deathTicks == 20) -> (this.deathTicks >= 20 && !this.dead) + if (this.deathTicks >= 20 && !this.dead) { // CraftBukkit - (this.deathTicks == 20) -> (this.deathTicks >= 20 && !this.dead)
@ -124,7 +124,7 @@
this.die(); this.die();
@@ -427,6 +474,17 @@ @@ -430,6 +477,17 @@
} }
} }
@ -132,9 +132,9 @@
+ if (nbttagcompound.hasKey("Bukkit.MaxHealth")) { + if (nbttagcompound.hasKey("Bukkit.MaxHealth")) {
+ NBTBase nbtbase = nbttagcompound.get("Bukkit.MaxHealth"); + NBTBase nbtbase = nbttagcompound.get("Bukkit.MaxHealth");
+ if (nbtbase.getTypeId() == 5) { + if (nbtbase.getTypeId() == 5) {
+ this.getAttributeInstance(GenericAttributes.maxHealth).setValue((double) ((NBTTagFloat) nbtbase).c()); + this.getAttributeInstance(GenericAttributes.maxHealth).setValue(((NBTTagFloat) nbtbase).h()); // PAIL: rename
+ } else if (nbtbase.getTypeId() == 3) { + } else if (nbtbase.getTypeId() == 3) {
+ this.getAttributeInstance(GenericAttributes.maxHealth).setValue((double) ((NBTTagInt) nbtbase).d()); + this.getAttributeInstance(GenericAttributes.maxHealth).setValue(((NBTTagInt) nbtbase).h()); // PAIL: rename
+ } + }
+ } + }
+ // CraftBukkit end + // CraftBukkit end
@ -142,7 +142,7 @@
if (nbttagcompound.hasKeyOfType("Health", 99)) { if (nbttagcompound.hasKeyOfType("Health", 99)) {
this.setHealth(nbttagcompound.getFloat("Health")); this.setHealth(nbttagcompound.getFloat("Health"));
} }
@@ -442,9 +500,15 @@ @@ -449,9 +507,15 @@
} }
@ -158,7 +158,7 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
MobEffectList mobeffectlist = (MobEffectList) iterator.next(); MobEffectList mobeffectlist = (MobEffectList) iterator.next();
MobEffect mobeffect = (MobEffect) this.effects.get(mobeffectlist); MobEffect mobeffect = (MobEffect) this.effects.get(mobeffectlist);
@@ -458,6 +522,16 @@ @@ -465,6 +529,16 @@
this.a(mobeffect, false); this.a(mobeffect, false);
} }
} }
@ -175,7 +175,7 @@
if (this.updateEffects) { if (this.updateEffects) {
if (!this.world.isClientSide) { if (!this.world.isClientSide) {
@@ -555,6 +629,12 @@ @@ -562,6 +636,12 @@
} }
public void addEffect(MobEffect mobeffect) { public void addEffect(MobEffect mobeffect) {
@ -188,7 +188,7 @@
if (this.d(mobeffect)) { if (this.d(mobeffect)) {
MobEffect mobeffect1 = (MobEffect) this.effects.get(mobeffect.getMobEffect()); MobEffect mobeffect1 = (MobEffect) this.effects.get(mobeffect.getMobEffect());
@@ -587,6 +667,12 @@ @@ -594,6 +674,12 @@
@Nullable @Nullable
public MobEffect c(@Nullable MobEffectList mobeffectlist) { public MobEffect c(@Nullable MobEffectList mobeffectlist) {
@ -201,7 +201,7 @@
return (MobEffect) this.effects.remove(mobeffectlist); return (MobEffect) this.effects.remove(mobeffectlist);
} }
@@ -626,20 +712,52 @@ @@ -633,20 +719,52 @@
} }
@ -255,7 +255,7 @@
this.datawatcher.set(EntityLiving.HEALTH, Float.valueOf(MathHelper.a(f, 0.0F, this.getMaxHealth()))); this.datawatcher.set(EntityLiving.HEALTH, Float.valueOf(MathHelper.a(f, 0.0F, this.getMaxHealth())));
} }
@@ -655,14 +773,16 @@ @@ -662,14 +780,16 @@
} else if (damagesource.o() && this.hasEffect(MobEffects.FIRE_RESISTANCE)) { } else if (damagesource.o() && this.hasEffect(MobEffects.FIRE_RESISTANCE)) {
return false; return false;
} else { } else {
@ -275,7 +275,7 @@
this.k(f); this.k(f);
if (damagesource.a()) { if (damagesource.a()) {
f = 0.0F; f = 0.0F;
@@ -681,19 +801,38 @@ @@ -688,20 +808,39 @@
if ((float) this.noDamageTicks > (float) this.maxNoDamageTicks / 2.0F) { if ((float) this.noDamageTicks > (float) this.maxNoDamageTicks / 2.0F) {
if (f <= this.lastDamage) { if (f <= this.lastDamage) {
@ -301,7 +301,8 @@
- this.damageEntity0(damagesource, f); - this.damageEntity0(damagesource, f);
+ // this.damageEntity0(damagesource, f); + // this.damageEntity0(damagesource, f);
+ // CraftBukkit end + // CraftBukkit end
this.hurtTicks = this.az = 10; this.aA = 10;
this.hurtTicks = this.aA;
} }
+ // CraftBukkit start + // CraftBukkit start
@ -313,10 +314,10 @@
+ } + }
+ // CraftBukkit end + // CraftBukkit end
+ +
this.aA = 0.0F; this.aB = 0.0F;
Entity entity = damagesource.getEntity(); Entity entity = damagesource.getEntity();
@@ -833,6 +972,12 @@ @@ -855,6 +994,12 @@
boolean flag = this.lastDamageByPlayerTime > 0; boolean flag = this.lastDamageByPlayerTime > 0;
this.a(flag, i, damagesource); this.a(flag, i, damagesource);
@ -329,7 +330,7 @@
} }
} }
@@ -922,8 +1067,13 @@ @@ -944,8 +1089,13 @@
int i = MathHelper.f((f - 3.0F - f2) * f1); int i = MathHelper.f((f - 3.0F - f2) * f1);
if (i > 0) { if (i > 0) {
@ -344,7 +345,7 @@
int j = MathHelper.floor(this.locX); int j = MathHelper.floor(this.locX);
int k = MathHelper.floor(this.locY - 0.20000000298023224D); int k = MathHelper.floor(this.locY - 0.20000000298023224D);
int l = MathHelper.floor(this.locZ); int l = MathHelper.floor(this.locZ);
@@ -950,8 +1100,8 @@ @@ -972,8 +1122,8 @@
protected float applyArmorModifier(DamageSource damagesource, float f) { protected float applyArmorModifier(DamageSource damagesource, float f) {
if (!damagesource.ignoresArmor()) { if (!damagesource.ignoresArmor()) {
@ -355,7 +356,7 @@
} }
return f; return f;
@@ -963,7 +1113,8 @@ @@ -985,7 +1135,8 @@
} else { } else {
int i; int i;
@ -365,7 +366,7 @@
i = (this.getEffect(MobEffects.RESISTANCE).getAmplifier() + 1) * 5; i = (this.getEffect(MobEffects.RESISTANCE).getAmplifier() + 1) * 5;
int j = 25 - i; int j = 25 - i;
float f1 = f * (float) j; float f1 = f * (float) j;
@@ -984,22 +1135,127 @@ @@ -1006,22 +1157,127 @@
} }
} }
@ -503,15 +504,15 @@
} }
public CombatTracker getCombatTracker() { public CombatTracker getCombatTracker() {
@@ -1065,6 +1321,7 @@ @@ -1088,6 +1344,7 @@
public AttributeMapBase getAttributeMap() { public AttributeMapBase getAttributeMap() {
if (this.bq == null) { if (this.br == null) {
this.bq = new AttributeMapServer(); this.br = new AttributeMapServer();
+ this.craftAttributes = new CraftAttributeMap(bq); // CraftBukkit + this.craftAttributes = new CraftAttributeMap(br); // CraftBukkit // PAIL: rename
} }
return this.bq; return this.br;
@@ -1343,6 +1600,7 @@ @@ -1376,6 +1633,7 @@
} }
if (this.onGround && !this.world.isClientSide) { if (this.onGround && !this.world.isClientSide) {
@ -519,7 +520,7 @@
this.setFlag(7, false); this.setFlag(7, false);
} }
} else { } else {
@@ -1703,6 +1961,7 @@ @@ -1736,6 +1994,7 @@
} }
if (!this.world.isClientSide) { if (!this.world.isClientSide) {
@ -527,7 +528,7 @@
this.setFlag(7, flag); this.setFlag(7, flag);
} }
@@ -1716,6 +1975,13 @@ @@ -1749,6 +2008,13 @@
if (!list.isEmpty()) { if (!list.isEmpty()) {
for (int i = 0; i < list.size(); ++i) { for (int i = 0; i < list.size(); ++i) {
Entity entity = (Entity) list.get(i); Entity entity = (Entity) list.get(i);
@ -541,7 +542,7 @@
this.C(entity); this.C(entity);
} }
@@ -1791,11 +2057,11 @@ @@ -1824,11 +2090,11 @@
} }
public boolean isInteractable() { public boolean isInteractable() {
@ -554,14 +555,14 @@
+ return !this.dead && this.collides; // CraftBukkit + return !this.dead && this.collides; // CraftBukkit
} }
protected void ao() { protected void ap() {
@@ -1932,7 +2198,22 @@ @@ -1965,7 +2231,22 @@
protected void v() { protected void v() {
if (this.bn != null && this.ct()) { if (this.bo != null && this.cx()) {
this.a(this.bn, 16); this.a(this.bo, 16);
- ItemStack itemstack = this.bn.a(this.world, this); - ItemStack itemstack = this.bo.a(this.world, this);
+ // CraftBukkit start - fire PlayerItemConsumeEvent + // CraftBukkit start - fire PlayerItemConsumeEvent
+ org.bukkit.inventory.ItemStack craftItem = CraftItemStack.asBukkitCopy(this.bn); // PAIL: rename + org.bukkit.inventory.ItemStack craftItem = CraftItemStack.asBukkitCopy(this.bo); // PAIL: rename
+ PlayerItemConsumeEvent event = new PlayerItemConsumeEvent((Player) this.getBukkitEntity(), craftItem); + PlayerItemConsumeEvent event = new PlayerItemConsumeEvent((Player) this.getBukkitEntity(), craftItem);
+ world.getServer().getPluginManager().callEvent(event); + world.getServer().getPluginManager().callEvent(event);
+ +
@ -574,12 +575,12 @@
+ return; + return;
+ } + }
+ +
+ ItemStack itemstack = (craftItem.equals(event.getItem())) ? this.bn.a(this.world, this) : CraftItemStack.asNMSCopy(event.getItem()).a(world, this); + ItemStack itemstack = (craftItem.equals(event.getItem())) ? this.bo.a(this.world, this) : CraftItemStack.asNMSCopy(event.getItem()).a(world, this);
+ // CraftBukkit end + // CraftBukkit end
if (itemstack != null && itemstack.count == 0) { if (itemstack != null && itemstack.count == 0) {
itemstack = null; itemstack = null;
@@ -2017,7 +2298,17 @@ @@ -2051,7 +2332,17 @@
} }
if (flag1) { if (flag1) {

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/EntityMinecartAbstract.java --- a/net/minecraft/server/EntityMinecartAbstract.java
+++ b/net/minecraft/server/EntityMinecartAbstract.java +++ b/net/minecraft/server/EntityMinecartAbstract.java
@@ -5,6 +5,15 @@ @@ -6,6 +6,15 @@
import java.util.Map; import java.util.Map;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@ -16,9 +16,9 @@
public abstract class EntityMinecartAbstract extends Entity implements INamableTileEntity { public abstract class EntityMinecartAbstract extends Entity implements INamableTileEntity {
private static final DataWatcherObject<Integer> a = DataWatcher.a(EntityMinecartAbstract.class, DataWatcherRegistry.b); private static final DataWatcherObject<Integer> a = DataWatcher.a(EntityMinecartAbstract.class, DataWatcherRegistry.b);
@@ -22,6 +31,17 @@ @@ -23,6 +32,17 @@
private double ax;
private double ay; private double ay;
private double az;
+ // CraftBukkit start + // CraftBukkit start
+ public boolean slowWhenEmpty = true; + public boolean slowWhenEmpty = true;
@ -34,7 +34,7 @@
public EntityMinecartAbstract(World world) { public EntityMinecartAbstract(World world) {
super(world); super(world);
this.i = true; this.i = true;
@@ -89,6 +109,8 @@ @@ -90,6 +110,8 @@
this.lastX = d0; this.lastX = d0;
this.lastY = d1; this.lastY = d1;
this.lastZ = d2; this.lastZ = d2;
@ -43,7 +43,7 @@
} }
public double ay() { public double ay() {
@@ -100,6 +122,19 @@ @@ -101,6 +123,19 @@
if (this.isInvulnerable(damagesource)) { if (this.isInvulnerable(damagesource)) {
return false; return false;
} else { } else {
@ -62,8 +62,8 @@
+ // CraftBukkit end + // CraftBukkit end
this.e(-this.u()); this.e(-this.u());
this.d(10); this.d(10);
this.ao(); this.ap();
@@ -107,6 +142,15 @@ @@ -108,6 +143,15 @@
boolean flag = damagesource.getEntity() instanceof EntityHuman && ((EntityHuman) damagesource.getEntity()).abilities.canInstantlyBuild; boolean flag = damagesource.getEntity() instanceof EntityHuman && ((EntityHuman) damagesource.getEntity()).abilities.canInstantlyBuild;
if (flag || this.getDamage() > 40.0F) { if (flag || this.getDamage() > 40.0F) {
@ -79,7 +79,7 @@
this.az(); this.az();
if (flag && !this.hasCustomName()) { if (flag && !this.hasCustomName()) {
this.die(); this.die();
@@ -149,6 +193,14 @@ @@ -150,6 +194,14 @@
} }
public void m() { public void m() {
@ -94,20 +94,19 @@
if (this.getType() > 0) { if (this.getType() > 0) {
this.d(this.getType() - 1); this.d(this.getType() - 1);
} }
@@ -169,7 +221,7 @@ @@ -170,7 +222,7 @@
i = this.V(); i = this.V();
if (this.ak) { if (this.al) {
- if (minecraftserver.getAllowNether()) { - if (minecraftserver.getAllowNether()) {
+ if (true || minecraftserver.getAllowNether()) { // CraftBukkit - multi-world should still allow teleport even if default vanilla nether disabled + if (true || minecraftserver.getAllowNether()) { // CraftBukkit - multi-world should still allow teleport even if default vanilla nether disabled
if (!this.isPassenger() && this.al++ >= i) { if (!this.isPassenger() && this.am++ >= i) {
this.al = i; this.am = i;
this.portalCooldown = this.aC(); this.portalCooldown = this.aE();
@@ -266,6 +318,20 @@ @@ -270,6 +322,18 @@
} }
this.setYawPitch(this.yaw, this.pitch); this.setYawPitch(this.yaw, this.pitch);
+
+ // CraftBukkit start + // CraftBukkit start
+ org.bukkit.World bworld = this.world.getWorld(); + org.bukkit.World bworld = this.world.getWorld();
+ Location from = new Location(bworld, prevX, prevY, prevZ, prevYaw, prevPitch); + Location from = new Location(bworld, prevX, prevY, prevZ, prevYaw, prevPitch);
@ -120,11 +119,25 @@
+ this.world.getServer().getPluginManager().callEvent(new org.bukkit.event.vehicle.VehicleMoveEvent(vehicle, from, to)); + this.world.getServer().getPluginManager().callEvent(new org.bukkit.event.vehicle.VehicleMoveEvent(vehicle, from, to));
+ } + }
+ // CraftBukkit end + // CraftBukkit end
+ if (this.v() == EntityMinecartAbstract.EnumMinecartType.RIDEABLE && this.motX * this.motX + this.motZ * this.motZ > 0.01D) {
Iterator iterator = this.world.getEntities(this, this.getBoundingBox().grow(0.20000000298023224D, 0.0D, 0.20000000298023224D)).iterator(); List list = this.world.getEntities(this, this.getBoundingBox().grow(0.20000000298023224D, 0.0D, 0.20000000298023224D), IEntitySelector.a(this));
while (iterator.hasNext()) { @@ -278,6 +342,14 @@
@@ -281,7 +347,7 @@ Entity entity = (Entity) list.get(l);
if (!(entity instanceof EntityHuman) && !(entity instanceof EntityIronGolem) && !(entity instanceof EntityMinecartAbstract) && !this.isVehicle() && !entity.isPassenger()) {
+ // CraftBukkit start
+ VehicleEntityCollisionEvent collisionEvent = new VehicleEntityCollisionEvent(vehicle, entity.getBukkitEntity());
+ this.world.getServer().getPluginManager().callEvent(collisionEvent);
+
+ if (collisionEvent.isCancelled()) {
+ continue;
+ }
+ // CraftBukkit end
entity.startRiding(this);
} else {
entity.collide(this);
@@ -301,7 +373,7 @@
} }
protected double o() { protected double o() {
@ -133,7 +146,7 @@
} }
public void a(int i, int j, int k, boolean flag) {} public void a(int i, int j, int k, boolean flag) {}
@@ -292,16 +358,20 @@ @@ -312,16 +384,20 @@
this.motX = MathHelper.a(this.motX, -d0, d0); this.motX = MathHelper.a(this.motX, -d0, d0);
this.motZ = MathHelper.a(this.motZ, -d0, d0); this.motZ = MathHelper.a(this.motZ, -d0, d0);
if (this.onGround) { if (this.onGround) {
@ -160,7 +173,7 @@
} }
} }
@@ -490,7 +560,7 @@ @@ -509,7 +585,7 @@
} }
protected void r() { protected void r() {
@ -169,35 +182,7 @@
this.motX *= 0.996999979019165D; this.motX *= 0.996999979019165D;
this.motY *= 0.0D; this.motY *= 0.0D;
this.motZ *= 0.996999979019165D; this.motZ *= 0.996999979019165D;
@@ -602,6 +672,17 @@ @@ -854,4 +930,26 @@
if (!this.world.isClientSide) {
if (!entity.noclip && !this.noclip) {
if (!this.w(entity)) {
+ // CraftBukkit start
+ Vehicle vehicle = (Vehicle) this.getBukkitEntity();
+ org.bukkit.entity.Entity hitEntity = (entity == null) ? null : entity.getBukkitEntity();
+
+ VehicleEntityCollisionEvent collisionEvent = new VehicleEntityCollisionEvent(vehicle, hitEntity);
+ this.world.getServer().getPluginManager().callEvent(collisionEvent);
+
+ if (collisionEvent.isCancelled()) {
+ return;
+ }
+ // CraftBukkit end
if (entity instanceof EntityLiving && this.v() == EntityMinecartAbstract.EnumMinecartType.RIDEABLE && this.motX * this.motX + this.motZ * this.motZ > 0.01D && !(entity instanceof EntityHuman) && !(entity instanceof EntityIronGolem) && !this.isVehicle() && !entity.isPassenger()) {
entity.startRiding(this);
}
@@ -610,7 +691,8 @@
double d1 = entity.locZ - this.locZ;
double d2 = d0 * d0 + d1 * d1;
- if (d2 >= 9.999999747378752E-5D) {
+ // CraftBukkit - collision
+ if (d2 >= 9.999999747378752E-5D && !collisionEvent.isCollisionCancelled()) {
d2 = (double) MathHelper.sqrt(d2);
d0 /= d2;
d1 /= d2;
@@ -839,4 +921,26 @@
} }
} }

View File

@ -8,7 +8,7 @@
public abstract class EntityMonster extends EntityCreature implements IMonster { public abstract class EntityMonster extends EntityCreature implements IMonster {
public EntityMonster(World world) { public EntityMonster(World world) {
@@ -75,7 +77,14 @@ @@ -79,7 +81,14 @@
int j = EnchantmentManager.getFireAspectEnchantmentLevel(this); int j = EnchantmentManager.getFireAspectEnchantmentLevel(this);
if (j > 0) { if (j > 0) {

View File

@ -8,7 +8,7 @@
public class EntityMushroomCow extends EntityCow { public class EntityMushroomCow extends EntityCow {
@@ -20,6 +21,14 @@ @@ -24,6 +25,14 @@
return true; return true;
} else if (itemstack != null && itemstack.getItem() == Items.SHEARS && this.getAge() >= 0) { } else if (itemstack != null && itemstack.getItem() == Items.SHEARS && this.getAge() >= 0) {

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/EntityOcelot.java --- a/net/minecraft/server/EntityOcelot.java
+++ b/net/minecraft/server/EntityOcelot.java +++ b/net/minecraft/server/EntityOcelot.java
@@ -55,7 +55,7 @@ @@ -57,7 +57,7 @@
} }
protected boolean isTypeNotPersistent() { protected boolean isTypeNotPersistent() {
@ -9,7 +9,7 @@
} }
protected void initAttributes() { protected void initAttributes() {
@@ -97,6 +97,9 @@ @@ -103,6 +103,9 @@
return entity.damageEntity(DamageSource.mobAttack(this), 3.0F); return entity.damageEntity(DamageSource.mobAttack(this), 3.0F);
} }
@ -19,7 +19,7 @@
public boolean damageEntity(DamageSource damagesource, float f) { public boolean damageEntity(DamageSource damagesource, float f) {
if (this.isInvulnerable(damagesource)) { if (this.isInvulnerable(damagesource)) {
return false; return false;
@@ -108,6 +111,7 @@ @@ -114,6 +117,7 @@
return super.damageEntity(damagesource, f); return super.damageEntity(damagesource, f);
} }
} }
@ -27,7 +27,7 @@
@Nullable @Nullable
protected MinecraftKey J() { protected MinecraftKey J() {
@@ -125,7 +129,8 @@ @@ -131,7 +135,8 @@
} }
if (!this.world.isClientSide) { if (!this.world.isClientSide) {
@ -37,7 +37,7 @@
this.setTamed(true); this.setTamed(true);
this.setCatType(1 + this.world.random.nextInt(3)); this.setCatType(1 + this.world.random.nextInt(3));
this.setOwnerUUID(entityhuman.getUniqueID()); this.setOwnerUUID(entityhuman.getUniqueID());
@@ -234,7 +239,7 @@ @@ -240,7 +245,7 @@
entityocelot.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, 0.0F); entityocelot.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, 0.0F);
entityocelot.setAgeRaw(-24000); entityocelot.setAgeRaw(-24000);

View File

@ -8,8 +8,8 @@
+ +
public class EntityPig extends EntityAnimal { public class EntityPig extends EntityAnimal {
private static final DataWatcherObject<Boolean> bw = DataWatcher.a(EntityPig.class, DataWatcherRegistry.h); private static final DataWatcherObject<Boolean> bx = DataWatcher.a(EntityPig.class, DataWatcherRegistry.h);
@@ -133,6 +135,12 @@ @@ -137,6 +139,12 @@
if (!this.world.isClientSide && !this.dead) { if (!this.world.isClientSide && !this.dead) {
EntityPigZombie entitypigzombie = new EntityPigZombie(this.world); EntityPigZombie entitypigzombie = new EntityPigZombie(this.world);
@ -22,7 +22,7 @@
entitypigzombie.setSlot(EnumItemSlot.MAINHAND, new ItemStack(Items.GOLDEN_SWORD)); entitypigzombie.setSlot(EnumItemSlot.MAINHAND, new ItemStack(Items.GOLDEN_SWORD));
entitypigzombie.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, this.pitch); entitypigzombie.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, this.pitch);
entitypigzombie.setAI(this.hasAI()); entitypigzombie.setAI(this.hasAI());
@@ -141,7 +149,8 @@ @@ -145,7 +153,8 @@
entitypigzombie.setCustomNameVisible(this.getCustomNameVisible()); entitypigzombie.setCustomNameVisible(this.getCustomNameVisible());
} }

View File

@ -19,15 +19,8 @@
+ +
public class EntityPlayer extends EntityHuman implements ICrafting { public class EntityPlayer extends EntityHuman implements ICrafting {
private static final Logger bR = LogManager.getLogger(); private static final Logger bS = LogManager.getLogger();
@@ -38,12 +51,24 @@ @@ -44,6 +57,18 @@
private boolean ch = true;
private long ci = System.currentTimeMillis();
private Entity cj = null;
- private boolean ck;
+ protected boolean ck; // PAIL: private -> protected, rename worldChangeInvuln
private int containerCounter;
public boolean f;
public int ping; public int ping;
public boolean viewingCredits; public boolean viewingCredits;
@ -115,28 +108,26 @@
@@ -193,7 +254,7 @@ @@ -193,7 +254,7 @@
} }
if (this.getHealth() != this.lastHealthSent || this.cc != this.foodData.getFoodLevel() || this.foodData.getSaturationLevel() == 0.0F != this.cd) { if (this.getHealth() != this.lastHealthSent || this.cd != this.foodData.getFoodLevel() || this.foodData.getSaturationLevel() == 0.0F != this.ce) {
- this.playerConnection.sendPacket(new PacketPlayOutUpdateHealth(this.getHealth(), this.foodData.getFoodLevel(), this.foodData.getSaturationLevel())); - this.playerConnection.sendPacket(new PacketPlayOutUpdateHealth(this.getHealth(), this.foodData.getFoodLevel(), this.foodData.getSaturationLevel()));
+ this.playerConnection.sendPacket(new PacketPlayOutUpdateHealth(this.getBukkitEntity().getScaledHealth(), this.foodData.getFoodLevel(), this.foodData.getSaturationLevel())); // CraftBukkit + this.playerConnection.sendPacket(new PacketPlayOutUpdateHealth(this.getBukkitEntity().getScaledHealth(), this.foodData.getFoodLevel(), this.foodData.getSaturationLevel())); // CraftBukkit
this.lastHealthSent = this.getHealth(); this.lastHealthSent = this.getHealth();
this.cc = this.foodData.getFoodLevel(); this.cd = this.foodData.getFoodLevel();
this.cd = this.foodData.getSaturationLevel() == 0.0F; this.ce = this.foodData.getSaturationLevel() == 0.0F;
@@ -214,10 +275,11 @@ @@ -214,6 +275,12 @@
this.a(IScoreboardCriteria.i, MathHelper.f((float) this.bX)); this.a(IScoreboardCriteria.i, MathHelper.f((float) this.bY));
} }
- if (this.getArmorStrength() != this.bY) {
- this.bY = this.getArmorStrength();
- this.a(IScoreboardCriteria.j, MathHelper.f((float) this.bY));
+ // CraftBukkit start - Force max health updates + // CraftBukkit start - Force max health updates
+ if (this.maxHealthCache != this.getMaxHealth()) { + if (this.maxHealthCache != this.getMaxHealth()) {
+ this.getBukkitEntity().updateScaledHealth(); + this.getBukkitEntity().updateScaledHealth();
} + }
+ // CraftBukkit end + // CraftBukkit end
+
if (this.expTotal != this.ca) { if (this.getArmorStrength() != this.bZ) {
this.ca = this.expTotal; this.bZ = this.getArmorStrength();
@@ -238,6 +300,16 @@ this.a(IScoreboardCriteria.j, MathHelper.f((float) this.bZ));
@@ -238,6 +305,16 @@
this.o(); this.o();
} }
@ -153,7 +144,7 @@
} catch (Throwable throwable) { } catch (Throwable throwable) {
CrashReport crashreport = CrashReport.a(throwable, "Ticking player"); CrashReport crashreport = CrashReport.a(throwable, "Ticking player");
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Player being ticked"); CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Player being ticked");
@@ -248,12 +320,11 @@ @@ -248,12 +325,11 @@
} }
private void a(IScoreboardCriteria iscoreboardcriteria, int i) { private void a(IScoreboardCriteria iscoreboardcriteria, int i) {
@ -168,12 +159,12 @@
scoreboardscore.setScore(i); scoreboardscore.setScore(i);
} }
@@ -302,30 +373,79 @@ @@ -302,30 +378,79 @@
boolean flag = this.world.getGameRules().getBoolean("showDeathMessages"); boolean flag = this.world.getGameRules().getBoolean("showDeathMessages");
this.playerConnection.sendPacket(new PacketPlayOutCombatEvent(this.getCombatTracker(), PacketPlayOutCombatEvent.EnumCombatEventType.ENTITY_DIED, flag)); this.playerConnection.sendPacket(new PacketPlayOutCombatEvent(this.getCombatTracker(), PacketPlayOutCombatEvent.EnumCombatEventType.ENTITY_DIED, flag));
- if (flag) { - if (flag) {
- ScoreboardTeamBase scoreboardteambase = this.aO(); - ScoreboardTeamBase scoreboardteambase = this.aQ();
+ // CraftBukkit start - fire PlayerDeathEvent + // CraftBukkit start - fire PlayerDeathEvent
+ if (this.dead) { + if (this.dead) {
+ return; + return;
@ -200,20 +191,20 @@
+ } + }
+ +
+ IChatBaseComponent chatmessage = this.getCombatTracker().getDeathMessage(); + IChatBaseComponent chatmessage = this.getCombatTracker().getDeathMessage();
+
+ String deathmessage = chatmessage.toPlainText();
+ org.bukkit.event.entity.PlayerDeathEvent event = CraftEventFactory.callPlayerDeathEvent(this, loot, deathmessage, keepInventory);
- if (scoreboardteambase != null && scoreboardteambase.getDeathMessageVisibility() != ScoreboardTeamBase.EnumNameTagVisibility.ALWAYS) { - if (scoreboardteambase != null && scoreboardteambase.getDeathMessageVisibility() != ScoreboardTeamBase.EnumNameTagVisibility.ALWAYS) {
- if (scoreboardteambase.getDeathMessageVisibility() == ScoreboardTeamBase.EnumNameTagVisibility.HIDE_FOR_OTHER_TEAMS) { - if (scoreboardteambase.getDeathMessageVisibility() == ScoreboardTeamBase.EnumNameTagVisibility.HIDE_FOR_OTHER_TEAMS) {
- this.server.getPlayerList().a((EntityHuman) this, this.getCombatTracker().getDeathMessage()); - this.server.getPlayerList().a((EntityHuman) this, this.getCombatTracker().getDeathMessage());
- } else if (scoreboardteambase.getDeathMessageVisibility() == ScoreboardTeamBase.EnumNameTagVisibility.HIDE_FOR_OWN_TEAM) { - } else if (scoreboardteambase.getDeathMessageVisibility() == ScoreboardTeamBase.EnumNameTagVisibility.HIDE_FOR_OWN_TEAM) {
- this.server.getPlayerList().b((EntityHuman) this, this.getCombatTracker().getDeathMessage()); - this.server.getPlayerList().b((EntityHuman) this, this.getCombatTracker().getDeathMessage());
+ String deathmessage = chatmessage.toPlainText();
+ org.bukkit.event.entity.PlayerDeathEvent event = CraftEventFactory.callPlayerDeathEvent(this, loot, deathmessage, keepInventory);
+
+ String deathMessage = event.getDeathMessage(); + String deathMessage = event.getDeathMessage();
+ +
+ if (deathMessage != null && deathMessage.length() > 0 && flag) { // TODO: allow plugins to override? + if (deathMessage != null && deathMessage.length() > 0 && flag) { // TODO: allow plugins to override?
+ if (deathMessage.equals(deathmessage)) { + if (deathMessage.equals(deathmessage)) {
+ ScoreboardTeamBase scoreboardteambase = this.aO(); + ScoreboardTeamBase scoreboardteambase = this.aQ();
+ +
+ if (scoreboardteambase != null && scoreboardteambase.getDeathMessageVisibility() != ScoreboardTeamBase.EnumNameTagVisibility.ALWAYS) { + if (scoreboardteambase != null && scoreboardteambase.getDeathMessageVisibility() != ScoreboardTeamBase.EnumNameTagVisibility.ALWAYS) {
+ if (scoreboardteambase.getDeathMessageVisibility() == ScoreboardTeamBase.EnumNameTagVisibility.HIDE_FOR_OTHER_TEAMS) { + if (scoreboardteambase.getDeathMessageVisibility() == ScoreboardTeamBase.EnumNameTagVisibility.HIDE_FOR_OTHER_TEAMS) {
@ -261,7 +252,7 @@
scoreboardscore.incrementScore(); scoreboardscore.incrementScore();
} }
@@ -382,13 +502,15 @@ @@ -382,13 +507,15 @@
} }
private boolean canPvP() { private boolean canPvP() {
@ -272,14 +263,14 @@
@Nullable @Nullable
public Entity c(int i) { public Entity c(int i) {
- this.ck = true; - this.worldChangeInvuln = true;
+ //this.ck = true; // CraftBukkit - Moved down and into PlayerList#changeDimension + // this.worldChangeInvuln = true; // CraftBukkit - Moved down and into PlayerList#changeDimension
if (this.dimension == 1 && i == 1) { if (this.dimension == 1 && i == 1) {
+ this.ck = true; // CraftBukkit - Moved down from above + this.worldChangeInvuln = true; // CraftBukkit - Moved down from above
this.world.kill(this); this.world.kill(this);
if (!this.viewingCredits) { if (!this.viewingCredits) {
this.viewingCredits = true; this.viewingCredits = true;
@@ -409,7 +531,10 @@ @@ -409,7 +536,10 @@
this.b((Statistic) AchievementList.y); this.b((Statistic) AchievementList.y);
} }
@ -291,7 +282,7 @@
this.playerConnection.sendPacket(new PacketPlayOutWorldEvent(1032, BlockPosition.ZERO, 0, false)); this.playerConnection.sendPacket(new PacketPlayOutWorldEvent(1032, BlockPosition.ZERO, 0, false));
this.lastSentExp = -1; this.lastSentExp = -1;
this.lastHealthSent = -1.0F; this.lastHealthSent = -1.0F;
@@ -454,6 +579,7 @@ @@ -454,6 +584,7 @@
} }
public void a(boolean flag, boolean flag1, boolean flag2) { public void a(boolean flag, boolean flag1, boolean flag2) {
@ -299,7 +290,7 @@
if (this.isSleeping()) { if (this.isSleeping()) {
this.x().getTracker().sendPacketToEntity(this, new PacketPlayOutAnimation(this, 2)); this.x().getTracker().sendPacketToEntity(this, new PacketPlayOutAnimation(this, 2));
} }
@@ -532,23 +658,48 @@ @@ -532,23 +663,48 @@
this.playerConnection.sendPacket(new PacketPlayOutOpenSignEditor(tileentitysign.getPosition())); this.playerConnection.sendPacket(new PacketPlayOutOpenSignEditor(tileentitysign.getPosition()));
} }
@ -357,7 +348,7 @@
if (iinventory instanceof ILootable && ((ILootable) iinventory).b() != null && this.isSpectator()) { if (iinventory instanceof ILootable && ((ILootable) iinventory).b() != null && this.isSpectator()) {
this.sendMessage((new ChatMessage("container.spectatorCantOpen", new Object[0])).setChatModifier((new ChatModifier()).setColor(EnumChatFormat.RED))); this.sendMessage((new ChatMessage("container.spectatorCantOpen", new Object[0])).setChatModifier((new ChatModifier()).setColor(EnumChatFormat.RED)));
} else { } else {
@@ -562,18 +713,21 @@ @@ -562,18 +718,21 @@
if (itileinventory.x_() && !this.a(itileinventory.y_()) && !this.isSpectator()) { if (itileinventory.x_() && !this.a(itileinventory.y_()) && !this.isSpectator()) {
this.playerConnection.sendPacket(new PacketPlayOutChat(new ChatMessage("container.isLocked", new Object[] { iinventory.getScoreboardDisplayName()}), (byte) 2)); this.playerConnection.sendPacket(new PacketPlayOutChat(new ChatMessage("container.isLocked", new Object[] { iinventory.getScoreboardDisplayName()}), (byte) 2));
this.playerConnection.sendPacket(new PacketPlayOutNamedSoundEffect(SoundEffects.W, SoundCategory.BLOCKS, this.locX, this.locY, this.locZ, 1.0F, 1.0F)); this.playerConnection.sendPacket(new PacketPlayOutNamedSoundEffect(SoundEffects.W, SoundCategory.BLOCKS, this.locX, this.locY, this.locZ, 1.0F, 1.0F));
@ -381,7 +372,7 @@
this.activeContainer.windowId = this.containerCounter; this.activeContainer.windowId = this.containerCounter;
this.activeContainer.addSlotListener(this); this.activeContainer.addSlotListener(this);
@@ -581,8 +735,14 @@ @@ -581,8 +740,14 @@
} }
public void openTrade(IMerchant imerchant) { public void openTrade(IMerchant imerchant) {
@ -397,7 +388,7 @@
this.activeContainer.windowId = this.containerCounter; this.activeContainer.windowId = this.containerCounter;
this.activeContainer.addSlotListener(this); this.activeContainer.addSlotListener(this);
InventoryMerchant inventorymerchant = ((ContainerMerchant) this.activeContainer).e(); InventoryMerchant inventorymerchant = ((ContainerMerchant) this.activeContainer).e();
@@ -601,14 +761,21 @@ @@ -601,14 +766,21 @@
} }
@ -421,7 +412,7 @@
this.activeContainer.windowId = this.containerCounter; this.activeContainer.windowId = this.containerCounter;
this.activeContainer.addSlotListener(this); this.activeContainer.addSlotListener(this);
} }
@@ -648,6 +815,11 @@ @@ -645,6 +817,11 @@
public void a(Container container, List<ItemStack> list) { public void a(Container container, List<ItemStack> list) {
this.playerConnection.sendPacket(new PacketPlayOutWindowItems(container.windowId, list)); this.playerConnection.sendPacket(new PacketPlayOutWindowItems(container.windowId, list));
this.playerConnection.sendPacket(new PacketPlayOutSetSlot(-1, -1, this.inventory.getCarried())); this.playerConnection.sendPacket(new PacketPlayOutSetSlot(-1, -1, this.inventory.getCarried()));
@ -433,7 +424,7 @@
} }
public void setContainerData(Container container, int i, int j) { public void setContainerData(Container container, int i, int j) {
@@ -662,6 +834,7 @@ @@ -659,6 +836,7 @@
} }
public void closeInventory() { public void closeInventory() {
@ -441,7 +432,7 @@
this.playerConnection.sendPacket(new PacketPlayOutCloseWindow(this.activeContainer.windowId)); this.playerConnection.sendPacket(new PacketPlayOutCloseWindow(this.activeContainer.windowId));
this.s(); this.s();
} }
@@ -743,7 +916,16 @@ @@ -740,7 +918,16 @@
public void triggerHealthUpdate() { public void triggerHealthUpdate() {
this.lastHealthSent = -1.0E8F; this.lastHealthSent = -1.0E8F;
@ -458,24 +449,24 @@
public void b(IChatBaseComponent ichatbasecomponent) { public void b(IChatBaseComponent ichatbasecomponent) {
this.playerConnection.sendPacket(new PacketPlayOutChat(ichatbasecomponent)); this.playerConnection.sendPacket(new PacketPlayOutChat(ichatbasecomponent));
@@ -804,6 +986,8 @@ @@ -801,6 +988,8 @@
} }
public void a(WorldSettings.EnumGamemode worldsettings_enumgamemode) { public void a(EnumGamemode enumgamemode) {
+ getBukkitEntity().setGameMode(org.bukkit.GameMode.getByValue(worldsettings_enumgamemode.getId())); + getBukkitEntity().setGameMode(org.bukkit.GameMode.getByValue(enumgamemode.getId()));
+ /* CraftBukkit start - defer to our setGameMode + /* CraftBukkit start - defer to our setGameMode
this.playerInteractManager.setGameMode(worldsettings_enumgamemode); this.playerInteractManager.setGameMode(enumgamemode);
this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(3, (float) worldsettings_enumgamemode.getId())); this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(3, (float) enumgamemode.getId()));
if (worldsettings_enumgamemode == WorldSettings.EnumGamemode.SPECTATOR) { if (enumgamemode == EnumGamemode.SPECTATOR) {
@@ -814,6 +998,7 @@ @@ -811,6 +1000,7 @@
this.updateAbilities(); this.updateAbilities();
this.cr(); this.cv();
+ // CraftBukkit end */ + // CraftBukkit end */
} }
public boolean isSpectator() { public boolean isSpectator() {
@@ -829,6 +1014,7 @@ @@ -826,6 +1016,7 @@
} }
public boolean a(int i, String s) { public boolean a(int i, String s) {
@ -483,7 +474,7 @@
if ("seed".equals(s) && !this.server.aa()) { if ("seed".equals(s) && !this.server.aa()) {
return true; return true;
} else if (!"tell".equals(s) && !"help".equals(s) && !"me".equals(s) && !"trigger".equals(s)) { } else if (!"tell".equals(s) && !"help".equals(s) && !"me".equals(s) && !"trigger".equals(s)) {
@@ -842,6 +1028,15 @@ @@ -839,6 +1030,15 @@
} else { } else {
return true; return true;
} }
@ -499,20 +490,20 @@
} }
public String A() { public String A() {
@@ -853,6 +1048,12 @@ @@ -850,6 +1050,12 @@
} }
public void a(PacketPlayInSettings packetplayinsettings) { public void a(PacketPlayInSettings packetplayinsettings) {
+ // CraftBukkit start + // CraftBukkit start
+ if (getMainHand() != packetplayinsettings.f()) { // PAIL: rename + if (getMainHand() != packetplayinsettings.getMainHand()) {
+ PlayerChangedMainHandEvent event = new PlayerChangedMainHandEvent(getBukkitEntity(), getMainHand() == EnumMainHand.LEFT ? MainHand.LEFT : MainHand.RIGHT); + PlayerChangedMainHandEvent event = new PlayerChangedMainHandEvent(getBukkitEntity(), getMainHand() == EnumMainHand.LEFT ? MainHand.LEFT : MainHand.RIGHT);
+ this.server.server.getPluginManager().callEvent(event); + this.server.server.getPluginManager().callEvent(event);
+ } + }
+ // CraftBukkit end + // CraftBukkit end
this.locale = packetplayinsettings.a(); this.locale = packetplayinsettings.a();
this.cg = packetplayinsettings.c(); this.ch = packetplayinsettings.c();
this.ch = packetplayinsettings.d(); this.ci = packetplayinsettings.d();
@@ -941,7 +1142,7 @@ @@ -938,7 +1144,7 @@
@Nullable @Nullable
public IChatBaseComponent getPlayerListName() { public IChatBaseComponent getPlayerListName() {
@ -521,7 +512,7 @@
} }
public void a(EnumHand enumhand) { public void a(EnumHand enumhand) {
@@ -958,11 +1159,139 @@ @@ -955,11 +1161,139 @@
} }
public void M() { public void M() {

View File

@ -8,7 +8,7 @@
} }
protected void i() {} protected void i() {}
@@ -162,6 +163,11 @@ @@ -164,6 +165,11 @@
this.e(movingobjectposition.a()); this.e(movingobjectposition.a());
} else { } else {
this.a(movingobjectposition); this.a(movingobjectposition);

View File

@ -12,7 +12,7 @@
+ +
public class EntitySheep extends EntityAnimal { public class EntitySheep extends EntityAnimal {
private static final DataWatcherObject<Byte> bw = DataWatcher.a(EntitySheep.class, DataWatcherRegistry.a); private static final DataWatcherObject<Byte> bx = DataWatcher.a(EntitySheep.class, DataWatcherRegistry.a);
@@ -12,6 +18,13 @@ @@ -12,6 +18,13 @@
public boolean a(EntityHuman entityhuman) { public boolean a(EntityHuman entityhuman) {
return false; return false;
@ -25,8 +25,8 @@
+ } + }
+ // CraftBukkit end + // CraftBukkit end
}, 2, 1); }, 2, 1);
private static final Map<EnumColor, float[]> by = Maps.newEnumMap(EnumColor.class); private static final Map<EnumColor, float[]> bz = Maps.newEnumMap(EnumColor.class);
private int bA; private int bB;
@@ -26,6 +39,7 @@ @@ -26,6 +39,7 @@
this.setSize(0.9F, 1.3F); this.setSize(0.9F, 1.3F);
this.container.setItem(0, new ItemStack(Items.DYE)); this.container.setItem(0, new ItemStack(Items.DYE));
@ -35,7 +35,7 @@
} }
protected void r() { protected void r() {
@@ -125,11 +139,22 @@ @@ -126,11 +140,22 @@
public boolean a(EntityHuman entityhuman, EnumHand enumhand, @Nullable ItemStack itemstack) { public boolean a(EntityHuman entityhuman, EnumHand enumhand, @Nullable ItemStack itemstack) {
if (itemstack != null && itemstack.getItem() == Items.SHEARS && !this.isSheared() && !this.isBaby()) { if (itemstack != null && itemstack.getItem() == Items.SHEARS && !this.isSheared() && !this.isBaby()) {
if (!this.world.isClientSide) { if (!this.world.isClientSide) {
@ -58,10 +58,10 @@
entityitem.motY += (double) (this.random.nextFloat() * 0.05F); entityitem.motY += (double) (this.random.nextFloat() * 0.05F);
entityitem.motX += (double) ((this.random.nextFloat() - this.random.nextFloat()) * 0.1F); entityitem.motX += (double) ((this.random.nextFloat() - this.random.nextFloat()) * 0.1F);
@@ -212,6 +237,12 @@ @@ -217,6 +242,12 @@
} }
public void B() { public void A() {
+ // CraftBukkit start + // CraftBukkit start
+ SheepRegrowWoolEvent event = new SheepRegrowWoolEvent((org.bukkit.entity.Sheep) this.getBukkitEntity()); + SheepRegrowWoolEvent event = new SheepRegrowWoolEvent((org.bukkit.entity.Sheep) this.getBukkitEntity());
+ this.world.getServer().getPluginManager().callEvent(event); + this.world.getServer().getPluginManager().callEvent(event);

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/EntitySilverfish.java --- a/net/minecraft/server/EntitySilverfish.java
+++ b/net/minecraft/server/EntitySilverfish.java +++ b/net/minecraft/server/EntitySilverfish.java
@@ -151,6 +151,11 @@ @@ -156,6 +156,11 @@
IBlockData iblockdata = world.getType(blockposition); IBlockData iblockdata = world.getType(blockposition);
if (BlockMonsterEggs.i(iblockdata)) { if (BlockMonsterEggs.i(iblockdata)) {
@ -12,7 +12,7 @@
world.setTypeAndData(blockposition, Blocks.MONSTER_EGG.getBlockData().set(BlockMonsterEggs.VARIANT, BlockMonsterEggs.EnumMonsterEggVarient.a(iblockdata)), 3); world.setTypeAndData(blockposition, Blocks.MONSTER_EGG.getBlockData().set(BlockMonsterEggs.VARIANT, BlockMonsterEggs.EnumMonsterEggVarient.a(iblockdata)), 3);
this.silverfish.doSpawnEffect(); this.silverfish.doSpawnEffect();
this.silverfish.die(); this.silverfish.die();
@@ -194,6 +199,11 @@ @@ -199,6 +204,11 @@
IBlockData iblockdata = world.getType(blockposition1); IBlockData iblockdata = world.getType(blockposition1);
if (iblockdata.getBlock() == Blocks.MONSTER_EGG) { if (iblockdata.getBlock() == Blocks.MONSTER_EGG) {

View File

@ -11,12 +11,12 @@
private static final DataWatcherObject<Integer> a = DataWatcher.a(EntitySkeleton.class, DataWatcherRegistry.b); private static final DataWatcherObject<Integer> a = DataWatcher.a(EntitySkeleton.class, DataWatcherRegistry.b);
private static final DataWatcherObject<Boolean> b = DataWatcher.a(EntitySkeleton.class, DataWatcherRegistry.h); private static final DataWatcherObject<Boolean> b = DataWatcher.a(EntitySkeleton.class, DataWatcherRegistry.h);
private final PathfinderGoalBowShoot c = new PathfinderGoalBowShoot(this, 1.0D, 20, 15.0F); private final PathfinderGoalBowShoot c = new PathfinderGoalBowShoot(this, 1.0D, 20, 15.0F);
- private final PathfinderGoalMeleeAttack bw = new PathfinderGoalMeleeAttack(this, 1.2D, flag) { - private final PathfinderGoalMeleeAttack bx = new PathfinderGoalMeleeAttack(this, 1.2D, flag) {
+ private final PathfinderGoalMeleeAttack bw = new PathfinderGoalMeleeAttack(this, 1.2D, false) { // CraftBukkit decompile error flag -> false + private final PathfinderGoalMeleeAttack bx = new PathfinderGoalMeleeAttack(this, 1.2D, false) { // CraftBukkit decompile error flag -> false
public void d() { public void d() {
super.d(); super.d();
EntitySkeleton.this.a(false); EntitySkeleton.this.a(false);
@@ -103,7 +104,14 @@ @@ -105,7 +106,14 @@
} }
if (flag) { if (flag) {
@ -32,7 +32,7 @@
} }
} }
} }
@@ -126,7 +134,7 @@ @@ -128,7 +136,7 @@
} }
public void die(DamageSource damagesource) { public void die(DamageSource damagesource) {
@ -41,18 +41,18 @@
if (damagesource.i() instanceof EntityArrow && damagesource.getEntity() instanceof EntityHuman) { if (damagesource.i() instanceof EntityArrow && damagesource.getEntity() instanceof EntityHuman) {
EntityHuman entityhuman = (EntityHuman) damagesource.getEntity(); EntityHuman entityhuman = (EntityHuman) damagesource.getEntity();
double d0 = entityhuman.locX - this.locX; double d0 = entityhuman.locX - this.locX;
@@ -139,6 +147,7 @@ @@ -141,6 +149,7 @@
((EntityCreeper) damagesource.getEntity()).setCausedHeadDrop(); ((EntityCreeper) damagesource.getEntity()).setCausedHeadDrop();
this.a(new ItemStack(Items.SKULL, 1, this.getSkeletonType() == 1 ? 1 : 0), 0.0F); this.a(new ItemStack(Items.SKULL, 1, this.getSkeletonType() == EnumSkeletonType.WITHER ? 1 : 0), 0.0F);
} }
+ super.die(damagesource); // CraftBukkit - moved from above + super.die(damagesource); // CraftBukkit - moved from above
} }
@@ -222,11 +231,30 @@ @@ -234,7 +243,14 @@
}
if (EnchantmentManager.a(Enchantments.ARROW_FIRE, (EntityLiving) this) > 0 || this.getSkeletonType() == 1) { flag = flag || EnchantmentManager.a(Enchantments.ARROW_FIRE, (EntityLiving) this) > 0;
if (flag) {
- entitytippedarrow.setOnFire(100); - entitytippedarrow.setOnFire(100);
+ // CraftBukkit start - call EntityCombustEvent + // CraftBukkit start - call EntityCombustEvent
+ EntityCombustEvent event = new EntityCombustEvent(entitytippedarrow.getBukkitEntity(), 100); + EntityCombustEvent event = new EntityCombustEvent(entitytippedarrow.getBukkitEntity(), 100);
@ -62,8 +62,13 @@
+ entitytippedarrow.setOnFire(event.getDuration()); + entitytippedarrow.setOnFire(event.getDuration());
+ } + }
+ // CraftBukkit end + // CraftBukkit end
+ } }
+
ItemStack itemstack = this.b(EnumHand.OFF_HAND);
@@ -245,8 +261,20 @@
entitytippedarrow.a(new MobEffect(MobEffects.SLOWER_MOVEMENT, 600));
}
+ // CraftBukkit start + // CraftBukkit start
+ org.bukkit.event.entity.EntityShootBowEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityShootBowEvent(this, this.getItemInMainHand(), entitytippedarrow, 0.8F); + org.bukkit.event.entity.EntityShootBowEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityShootBowEvent(this, this.getItemInMainHand(), entitytippedarrow, 0.8F);
+ if (event.isCancelled()) { + if (event.isCancelled()) {
@ -73,12 +78,12 @@
+ +
+ if (event.getProjectile() == entitytippedarrow.getBukkitEntity()) { + if (event.getProjectile() == entitytippedarrow.getBukkitEntity()) {
+ world.addEntity(entitytippedarrow); + world.addEntity(entitytippedarrow);
} + }
+ // CraftBukkit end + // CraftBukkit end
+
this.a(SoundEffects.fo, 1.0F, 1.0F / (this.getRandom().nextFloat() * 0.4F + 0.8F)); this.a(SoundEffects.fz, 1.0F, 1.0F / (this.getRandom().nextFloat() * 0.4F + 0.8F));
- this.world.addEntity(entitytippedarrow); - this.world.addEntity(entitytippedarrow);
+ // this.world.addEntity(entitytippedarrow); // CraftBukkit - moved up + // this.world.addEntity(entitytippedarrow); // CraftBukkit - moved up
} }
public int getSkeletonType() { public EnumSkeletonType getSkeletonType() {

View File

@ -10,7 +10,7 @@
public class EntitySlime extends EntityInsentient implements IMonster { public class EntitySlime extends EntityInsentient implements IMonster {
@@ -136,6 +139,18 @@ @@ -140,6 +143,18 @@
if (!this.world.isClientSide && i > 1 && this.getHealth() <= 0.0F) { if (!this.world.isClientSide && i > 1 && this.getHealth() <= 0.0F) {
int j = 2 + this.random.nextInt(3); int j = 2 + this.random.nextInt(3);
@ -29,7 +29,7 @@
for (int k = 0; k < j; ++k) { for (int k = 0; k < j; ++k) {
float f = ((float) (k % 2) - 0.5F) * (float) i / 4.0F; float f = ((float) (k % 2) - 0.5F) * (float) i / 4.0F;
float f1 = ((float) (k / 2) - 0.5F) * (float) i / 4.0F; float f1 = ((float) (k / 2) - 0.5F) * (float) i / 4.0F;
@@ -151,7 +166,7 @@ @@ -155,7 +170,7 @@
entityslime.setSize(i / 2); entityslime.setSize(i / 2);
entityslime.setPositionRotation(this.locX + (double) f, this.locY + 0.5D, this.locZ + (double) f1, this.random.nextFloat() * 360.0F, 0.0F); entityslime.setPositionRotation(this.locX + (double) f, this.locY + 0.5D, this.locZ + (double) f1, this.random.nextFloat() * 360.0F, 0.0F);

View File

@ -8,7 +8,7 @@
public class EntitySmallFireball extends EntityFireball { public class EntitySmallFireball extends EntityFireball {
public EntitySmallFireball(World world) { public EntitySmallFireball(World world) {
@@ -26,7 +28,14 @@ @@ -30,7 +32,14 @@
flag = movingobjectposition.entity.damageEntity(DamageSource.fireball(this, this.shooter), 5.0F); flag = movingobjectposition.entity.damageEntity(DamageSource.fireball(this, this.shooter), 5.0F);
if (flag) { if (flag) {
this.a(this.shooter, movingobjectposition.entity); this.a(this.shooter, movingobjectposition.entity);
@ -24,7 +24,7 @@
} }
} }
} else { } else {
@@ -39,7 +48,11 @@ @@ -43,7 +52,11 @@
BlockPosition blockposition = movingobjectposition.a().shift(movingobjectposition.direction); BlockPosition blockposition = movingobjectposition.a().shift(movingobjectposition.direction);
if (this.world.isEmpty(blockposition)) { if (this.world.isEmpty(blockposition)) {

View File

@ -12,7 +12,7 @@
public class EntitySnowman extends EntityGolem implements IRangedEntity { public class EntitySnowman extends EntityGolem implements IRangedEntity {
@@ -42,7 +47,7 @@ @@ -46,7 +51,7 @@
} }
if (this.world.getBiome(new BlockPosition(i, 0, k)).a(new BlockPosition(i, j, k)) > 1.0F) { if (this.world.getBiome(new BlockPosition(i, 0, k)).a(new BlockPosition(i, j, k)) > 1.0F) {
@ -21,7 +21,7 @@
} }
if (!this.world.getGameRules().getBoolean("mobGriefing")) { if (!this.world.getGameRules().getBoolean("mobGriefing")) {
@@ -56,7 +61,17 @@ @@ -60,7 +65,17 @@
BlockPosition blockposition = new BlockPosition(i, j, k); BlockPosition blockposition = new BlockPosition(i, j, k);
if (this.world.getType(blockposition).getMaterial() == Material.AIR && this.world.getBiome(new BlockPosition(i, 0, k)).a(blockposition) < 0.8F && Blocks.SNOW_LAYER.canPlace(this.world, blockposition)) { if (this.world.getType(blockposition).getMaterial() == Material.AIR && this.world.getBiome(new BlockPosition(i, 0, k)).a(blockposition) < 0.8F && Blocks.SNOW_LAYER.canPlace(this.world, blockposition)) {

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/EntitySpider.java --- a/net/minecraft/server/EntitySpider.java
+++ b/net/minecraft/server/EntitySpider.java +++ b/net/minecraft/server/EntitySpider.java
@@ -111,7 +111,7 @@ @@ -115,7 +115,7 @@
entityskeleton.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, 0.0F); entityskeleton.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, 0.0F);
entityskeleton.prepare(difficultydamagescaler, (GroupDataEntity) null); entityskeleton.prepare(difficultydamagescaler, (GroupDataEntity) null);

View File

@ -15,7 +15,7 @@
public EntityTNTPrimed(World world) { public EntityTNTPrimed(World world) {
super(world); super(world);
@@ -57,10 +61,13 @@ @@ -60,10 +64,13 @@
--this.c; --this.c;
if (this.c <= 0) { if (this.c <= 0) {
@ -28,9 +28,9 @@
+ this.die(); + this.die();
+ // CraftBukkit end + // CraftBukkit end
} else { } else {
this.aj(); this.ak();
this.world.addParticle(EnumParticle.SMOKE_NORMAL, this.locX, this.locY + 0.5D, this.locZ, 0.0D, 0.0D, 0.0D, new int[0]); this.world.addParticle(EnumParticle.SMOKE_NORMAL, this.locX, this.locY + 0.5D, this.locZ, 0.0D, 0.0D, 0.0D, new int[0]);
@@ -69,9 +76,18 @@ @@ -72,9 +79,18 @@
} }
private void explode() { private void explode() {
@ -38,14 +38,14 @@
+ // CraftBukkit start + // CraftBukkit start
+ // float f = 4.0F; + // float f = 4.0F;
- this.world.explode(this, this.locX, this.locY + (double) (this.length / 16.0F), this.locZ, f, true); - this.world.explode(this, this.locX, this.locY + (double) (this.length / 16.0F), this.locZ, 4.0F, true);
+ org.bukkit.craftbukkit.CraftServer server = this.world.getServer(); + org.bukkit.craftbukkit.CraftServer server = this.world.getServer();
+ +
+ ExplosionPrimeEvent event = new ExplosionPrimeEvent((org.bukkit.entity.Explosive) org.bukkit.craftbukkit.entity.CraftEntity.getEntity(server, this)); + ExplosionPrimeEvent event = new ExplosionPrimeEvent((org.bukkit.entity.Explosive) org.bukkit.craftbukkit.entity.CraftEntity.getEntity(server, this));
+ server.getPluginManager().callEvent(event); + server.getPluginManager().callEvent(event);
+ +
+ if (!event.isCancelled()) { + if (!event.isCancelled()) {
+ this.world.createExplosion(this, this.locX, this.locY + (double) (this.length / 2.0F), this.locZ, event.getRadius(), event.getFire(), true); + this.world.createExplosion(this, this.locX, this.locY + (double) (this.length / 16.0F), this.locZ, event.getRadius(), event.getFire(), true);
+ } + }
+ // CraftBukkit end + // CraftBukkit end
} }

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/EntityThrownExpBottle.java --- a/net/minecraft/server/EntityThrownExpBottle.java
+++ b/net/minecraft/server/EntityThrownExpBottle.java +++ b/net/minecraft/server/EntityThrownExpBottle.java
@@ -20,9 +20,18 @@ @@ -24,9 +24,18 @@
protected void a(MovingObjectPosition movingobjectposition) { protected void a(MovingObjectPosition movingobjectposition) {
if (!this.world.isClientSide) { if (!this.world.isClientSide) {

View File

@ -1,34 +1,25 @@
--- a/net/minecraft/server/EntityTippedArrow.java --- a/net/minecraft/server/EntityTippedArrow.java
+++ b/net/minecraft/server/EntityTippedArrow.java +++ b/net/minecraft/server/EntityTippedArrow.java
@@ -10,7 +10,7 @@
private static final DataWatcherObject<Integer> f = DataWatcher.a(EntityTippedArrow.class, DataWatcherRegistry.b);
private PotionRegistry g;
- private final Set<MobEffect> h;
+ public final Set<MobEffect> h; // CraftBukkit private -> public
public EntityTippedArrow(World world) {
super(world);
@@ -98,6 +98,25 @@ @@ -98,6 +98,25 @@
} }
} }
+ // CraftBukkit start accessor methods + // CraftBukkit start accessor methods
+ public void refreshEffects() { + public void refreshEffects() {
+ this.getDataWatcher().set(EntityTippedArrow.f, Integer.valueOf(PotionUtil.a((Collection) PotionUtil.a(this.g, (Collection) this.h)))); // PAIL: rename + this.getDataWatcher().set(EntityTippedArrow.f, Integer.valueOf(PotionUtil.a((Collection) PotionUtil.a(this.potionRegistry, (Collection) this.effects))));
+ } + }
+ +
+ public String getType() { + public String getType() {
+ return ((MinecraftKey) PotionRegistry.a.b(this.g)).toString(); + return ((MinecraftKey) PotionRegistry.a.b(this.potionRegistry)).toString();
+ } + }
+ +
+ public void setType(String string) { + public void setType(String string) {
+ this.g = PotionRegistry.a.get(new MinecraftKey(string)); + this.potionRegistry = PotionRegistry.a.get(new MinecraftKey(string));
+ this.datawatcher.set(EntityTippedArrow.f, Integer.valueOf(PotionUtil.a((Collection) PotionUtil.a(this.g, (Collection) this.h)))); // PAIL: rename + this.datawatcher.set(EntityTippedArrow.f, Integer.valueOf(PotionUtil.a((Collection) PotionUtil.a(this.potionRegistry, (Collection) this.effects))));
+ } + }
+ +
+ public boolean isTipped() { + public boolean isTipped() {
+ return !(this.h.isEmpty() && this.g == Potions.a); // PAIL: rename + return !(this.effects.isEmpty() && this.potionRegistry == Potions.a); // PAIL: rename
+ } + }
+ // CraftBukkit end + // CraftBukkit end
+ +

View File

@ -30,27 +30,27 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
EntityHuman entityhuman = (EntityHuman) iterator.next(); EntityHuman entityhuman = (EntityHuman) iterator.next();
@@ -120,6 +126,19 @@ @@ -136,6 +142,19 @@
boolean flag = k1 * k1 + l1 * l1 + i2 * i2 >= 128L || this.a % 60 == 0; boolean flag1 = l1 * l1 + i2 * i2 + j2 * j2 >= 128L || this.a % 60 == 0;
boolean flag1 = Math.abs(i1 - this.yRot) >= 1 || Math.abs(j1 - this.xRot) >= 1; boolean flag2 = Math.abs(j1 - this.yRot) >= 1 || Math.abs(k1 - this.xRot) >= 1;
+ // CraftBukkit start - Code moved from below + // CraftBukkit start - Code moved from below
+ if (flag) { + if (flag1) {
+ this.xLoc = j; + this.xLoc = k;
+ this.yLoc = k; + this.yLoc = l;
+ this.zLoc = l; + this.zLoc = i1;
+ } + }
+ +
+ if (flag1) { + if (flag2) {
+ this.yRot = i1; + this.yRot = j1;
+ this.xRot = j1; + this.xRot = k1;
+ } + }
+ // CraftBukkit end + // CraftBukkit end
+ +
if (this.a > 0 || this.tracker instanceof EntityArrow) { if (this.a > 0 || this.tracker instanceof EntityArrow) {
if (k1 >= -32768L && k1 < 32768L && l1 >= -32768L && l1 < 32768L && i2 >= -32768L && i2 < 32768L && this.v <= 400 && !this.x && this.y == this.tracker.onGround) { if (l1 >= -32768L && l1 < 32768L && i2 >= -32768L && i2 < 32768L && j2 >= -32768L && j2 < 32768L && this.v <= 400 && !this.x && this.y == this.tracker.onGround) {
if ((!flag || !flag1) && !(this.tracker instanceof EntityArrow)) { if ((!flag1 || !flag2) && !(this.tracker instanceof EntityArrow)) {
@@ -134,6 +153,11 @@ @@ -150,6 +169,11 @@
} else { } else {
this.y = this.tracker.onGround; this.y = this.tracker.onGround;
this.v = 0; this.v = 0;
@ -62,22 +62,22 @@
this.c(); this.c();
object = new PacketPlayOutEntityTeleport(this.tracker); object = new PacketPlayOutEntityTeleport(this.tracker);
} }
@@ -165,6 +189,7 @@ @@ -181,6 +205,7 @@
} }
this.d(); this.d();
+ /* CraftBukkit start - Code moved up + /* CraftBukkit start - Code moved up
if (flag) { if (flag1) {
this.xLoc = j; this.xLoc = k;
this.yLoc = k; this.yLoc = l;
@@ -175,6 +200,7 @@ @@ -191,6 +216,7 @@
this.yRot = i1; this.yRot = j1;
this.xRot = j1; this.xRot = k1;
} }
+ // CraftBukkit end */ + // CraftBukkit end */
this.x = false; this.x = false;
} else { }
@@ -206,7 +232,27 @@ @@ -206,7 +232,27 @@
++this.a; ++this.a;

View File

@ -40,7 +40,7 @@
} }
} }
@@ -402,7 +417,20 @@ @@ -429,7 +444,20 @@
for (int l = 0; l < k; ++l) { for (int l = 0; l < k; ++l) {
EntityVillager.IMerchantRecipeOption entityvillager_imerchantrecipeoption = aentityvillager_imerchantrecipeoption3[l]; EntityVillager.IMerchantRecipeOption entityvillager_imerchantrecipeoption = aentityvillager_imerchantrecipeoption3[l];

View File

@ -13,9 +13,9 @@
public class EntityWither extends EntityMonster implements IRangedEntity { public class EntityWither extends EntityMonster implements IRangedEntity {
private static final DataWatcherObject<Integer> a = DataWatcher.a(EntityWither.class, DataWatcherRegistry.b); private static final DataWatcherObject<Integer> a = DataWatcher.a(EntityWither.class, DataWatcherRegistry.b);
@@ -180,13 +186,38 @@ @@ -184,13 +190,38 @@
if (this.da() > 0) { if (this.de() > 0) {
i = this.da() - 1; i = this.de() - 1;
if (i <= 0) { if (i <= 0) {
- this.world.createExplosion(this, this.locX, this.locY + (double) this.getHeadHeight(), this.locZ, 7.0F, false, this.world.getGameRules().getBoolean("mobGriefing")); - this.world.createExplosion(this, this.locX, this.locY + (double) this.getHeadHeight(), this.locZ, 7.0F, false, this.world.getGameRules().getBoolean("mobGriefing"));
- this.world.a(1023, new BlockPosition(this), 0); - this.world.a(1023, new BlockPosition(this), 0);
@ -48,14 +48,14 @@
+ // CraftBukkit end + // CraftBukkit end
} }
this.l(i); this.g(i);
if (this.ticksLived % 10 == 0) { if (this.ticksLived % 10 == 0) {
- this.heal(10.0F); - this.heal(10.0F);
+ this.heal(10.0F, EntityRegainHealthEvent.RegainReason.WITHER_SPAWN); // CraftBukkit + this.heal(10.0F, EntityRegainHealthEvent.RegainReason.WITHER_SPAWN); // CraftBukkit
} }
} else { } else {
@@ -277,6 +308,11 @@ @@ -281,6 +312,11 @@
Block block = iblockdata.getBlock(); Block block = iblockdata.getBlock();
if (iblockdata.getMaterial() != Material.AIR && a(block)) { if (iblockdata.getMaterial() != Material.AIR && a(block)) {
@ -67,7 +67,7 @@
flag = this.world.setAir(blockposition, true) || flag; flag = this.world.setAir(blockposition, true) || flag;
} }
} }
@@ -290,7 +326,7 @@ @@ -294,7 +330,7 @@
} }
if (this.ticksLived % 20 == 0) { if (this.ticksLived % 20 == 0) {
@ -75,4 +75,4 @@
+ this.heal(1.0F, EntityRegainHealthEvent.RegainReason.REGEN); // CraftBukkit + this.heal(1.0F, EntityRegainHealthEvent.RegainReason.REGEN); // CraftBukkit
} }
this.bF.setProgress(this.getHealth() / this.getMaxHealth()); this.bG.setProgress(this.getHealth() / this.getMaxHealth());

View File

@ -8,19 +8,21 @@
public class EntityWitherSkull extends EntityFireball { public class EntityWitherSkull extends EntityFireball {
private static final DataWatcherObject<Boolean> e = DataWatcher.a(EntityWitherSkull.class, DataWatcherRegistry.h); private static final DataWatcherObject<Boolean> e = DataWatcher.a(EntityWitherSkull.class, DataWatcherRegistry.h);
@@ -37,9 +39,9 @@ @@ -41,11 +43,11 @@
if (!this.world.isClientSide) { if (!this.world.isClientSide) {
if (movingobjectposition.entity != null) { if (movingobjectposition.entity != null) {
if (this.shooter != null) { if (this.shooter != null) {
- if (movingobjectposition.entity.damageEntity(DamageSource.mobAttack(this.shooter), 8.0F)) { - if (movingobjectposition.entity.damageEntity(DamageSource.mobAttack(this.shooter), 8.0F)) {
+ if (movingobjectposition.entity.damageEntity(DamageSource.projectile(this, shooter), 8.0F)) { // CraftBukkit + if (movingobjectposition.entity.damageEntity(DamageSource.projectile(this, shooter), 8.0F)) { // CraftBukkit
if (!movingobjectposition.entity.isAlive()) { if (movingobjectposition.entity.isAlive()) {
this.a(this.shooter, movingobjectposition.entity);
} else {
- this.shooter.heal(5.0F); - this.shooter.heal(5.0F);
+ this.shooter.heal(5.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.WITHER); // CraftBukkit + this.shooter.heal(5.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.WITHER); // CraftBukkit
} else {
this.a(this.shooter, movingobjectposition.entity);
} }
@@ -63,7 +65,15 @@ }
} else {
@@ -67,7 +69,15 @@
} }
} }

View File

@ -12,7 +12,7 @@
public class EntityWolf extends EntityTameableAnimal { public class EntityWolf extends EntityTameableAnimal {
private static final DataWatcherObject<Float> DATA_HEALTH = DataWatcher.a(EntityWolf.class, DataWatcherRegistry.c); private static final DataWatcherObject<Float> DATA_HEALTH = DataWatcher.a(EntityWolf.class, DataWatcherRegistry.c);
@@ -60,6 +65,22 @@ @@ -61,6 +66,22 @@
this.getAttributeMap().b(GenericAttributes.ATTACK_DAMAGE).setValue(2.0D); this.getAttributeMap().b(GenericAttributes.ATTACK_DAMAGE).setValue(2.0D);
} }
@ -35,7 +35,7 @@
public void setGoalTarget(@Nullable EntityLiving entityliving) { public void setGoalTarget(@Nullable EntityLiving entityliving) {
super.setGoalTarget(entityliving); super.setGoalTarget(entityliving);
if (entityliving == null) { if (entityliving == null) {
@@ -194,9 +215,10 @@ @@ -199,9 +220,10 @@
Entity entity = damagesource.getEntity(); Entity entity = damagesource.getEntity();
if (this.goalSit != null) { if (this.goalSit != null) {
@ -48,7 +48,7 @@
if (entity != null && !(entity instanceof EntityHuman) && !(entity instanceof EntityArrow)) { if (entity != null && !(entity instanceof EntityHuman) && !(entity instanceof EntityArrow)) {
f = (f + 1.0F) / 2.0F; f = (f + 1.0F) / 2.0F;
} }
@@ -237,7 +259,7 @@ @@ -242,7 +264,7 @@
--itemstack.count; --itemstack.count;
} }
@ -57,16 +57,16 @@
return true; return true;
} }
} else if (itemstack.getItem() == Items.DYE) { } else if (itemstack.getItem() == Items.DYE) {
@@ -258,7 +280,7 @@ @@ -263,7 +285,7 @@
this.goalSit.setSitting(!this.isSitting()); this.goalSit.setSitting(!this.isSitting());
this.bd = false; this.be = false;
this.navigation.o(); this.navigation.o();
- this.setGoalTarget((EntityLiving) null); - this.setGoalTarget((EntityLiving) null);
+ this.setGoalTarget((EntityLiving) null, TargetReason.FORGOT_TARGET, true); // CraftBukkit - reason + this.setGoalTarget((EntityLiving) null, TargetReason.FORGOT_TARGET, true); // CraftBukkit - reason
} }
} else if (itemstack != null && itemstack.getItem() == Items.BONE && !this.isAngry()) { } else if (itemstack != null && itemstack.getItem() == Items.BONE && !this.isAngry()) {
if (!entityhuman.abilities.canInstantlyBuild) { if (!entityhuman.abilities.canInstantlyBuild) {
@@ -266,12 +288,14 @@ @@ -271,12 +293,14 @@
} }
if (!this.world.isClientSide) { if (!this.world.isClientSide) {
@ -80,14 +80,5 @@
this.setHealth(20.0F); this.setHealth(20.0F);
+ this.setHealth(this.getMaxHealth()); // CraftBukkit - 20.0 -> getMaxHealth() + this.setHealth(this.getMaxHealth()); // CraftBukkit - 20.0 -> getMaxHealth()
this.setOwnerUUID(entityhuman.getUniqueID()); this.setOwnerUUID(entityhuman.getUniqueID());
this.o(true); this.p(true);
this.world.broadcastEntityEffect(this, (byte) 7); this.world.broadcastEntityEffect(this, (byte) 7);
@@ -353,7 +377,7 @@
}
protected boolean isTypeNotPersistent() {
- return !this.isTamed() && this.ticksLived > 2400;
+ return !this.isTamed() /*&& this.ticksLived > 2400*/; // CraftBukkit
}
public boolean a(EntityLiving entityliving, EntityLiving entityliving1) {

View File

@ -15,9 +15,9 @@
protected static final IAttribute a = (new AttributeRanged((IAttribute) null, "zombie.spawnReinforcements", 0.0D, 0.0D, 1.0D)).a("Spawn Reinforcements Chance"); protected static final IAttribute a = (new AttributeRanged((IAttribute) null, "zombie.spawnReinforcements", 0.0D, 0.0D, 1.0D)).a("Spawn Reinforcements Chance");
@@ -19,6 +26,7 @@ @@ -19,6 +26,7 @@
private boolean bC = false; private boolean bD;
private float bD = -1.0F; private float bE = -1.0F;
private float bE; private float bF;
+ private int lastTick = MinecraftServer.currentTick; // CraftBukkit - add field + private int lastTick = MinecraftServer.currentTick; // CraftBukkit - add field
public EntityZombie(World world) { public EntityZombie(World world) {
@ -59,25 +59,25 @@
+ i *= elapsedTicks; + i *= elapsedTicks;
+ // CraftBukkit end + // CraftBukkit end
this.bB -= i; this.bC -= i;
if (this.bB <= 0) { if (this.bC <= 0) {
@@ -220,7 +240,14 @@ @@ -221,7 +241,14 @@
int i = this.world.getDifficulty().a();
if (this.getItemInMainHand() == null && this.isBurning() && this.random.nextFloat() < (float) i * 0.3F) { if (this.getItemInMainHand() == null) {
- entity.setOnFire(2 * i); if (this.isBurning() && this.random.nextFloat() < f * 0.3F) {
- entity.setOnFire(2 * (int) f);
+ // CraftBukkit start + // CraftBukkit start
+ EntityCombustByEntityEvent event = new EntityCombustByEntityEvent(this.getBukkitEntity(), entity.getBukkitEntity(), 2 * i); + EntityCombustByEntityEvent event = new EntityCombustByEntityEvent(this.getBukkitEntity(), entity.getBukkitEntity(), 2 * (int) f); // PAIL: fixme
+ this.world.getServer().getPluginManager().callEvent(event); + this.world.getServer().getPluginManager().callEvent(event);
+ +
+ if (!event.isCancelled()) { + if (!event.isCancelled()) {
+ entity.setOnFire(event.getDuration()); + entity.setOnFire(event.getDuration());
+ } + }
+ // CraftBukkit end + // CraftBukkit end
} }
}
@@ -323,7 +350,7 @@ if (this.getVillagerType() == EnumZombieType.HUSK && entity instanceof EntityLiving) {
@@ -335,7 +362,7 @@
entityzombie.setCustomNameVisible(entityvillager.getCustomNameVisible()); entityzombie.setCustomNameVisible(entityvillager.getCustomNameVisible());
} }
@ -86,16 +86,16 @@
this.world.a((EntityHuman) null, 1026, new BlockPosition((int) this.locX, (int) this.locY, (int) this.locZ), 0); this.world.a((EntityHuman) null, 1026, new BlockPosition((int) this.locX, (int) this.locY, (int) this.locZ), 0);
} }
@@ -377,7 +404,7 @@ @@ -396,7 +423,7 @@
entitychicken1.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, 0.0F); entitychicken1.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, 0.0F);
entitychicken1.prepare(difficultydamagescaler, (GroupDataEntity) null); entitychicken1.prepare(difficultydamagescaler, (GroupDataEntity) null);
entitychicken1.o(true); entitychicken1.p(true);
- this.world.addEntity(entitychicken1); - this.world.addEntity(entitychicken1);
+ this.world.addEntity(entitychicken1, CreatureSpawnEvent.SpawnReason.MOUNT); // CraftBukkit + this.world.addEntity(entitychicken1, CreatureSpawnEvent.SpawnReason.MOUNT); // CraftBukkit
this.startRiding(entitychicken1); this.startRiding(entitychicken1);
} }
} }
@@ -461,7 +488,7 @@ @@ -480,7 +507,7 @@
entityvillager.setCustomNameVisible(this.getCustomNameVisible()); entityvillager.setCustomNameVisible(this.getCustomNameVisible());
} }
@ -104,7 +104,7 @@
entityvillager.addEffect(new MobEffect(MobEffects.CONFUSION, 200, 0)); entityvillager.addEffect(new MobEffect(MobEffects.CONFUSION, 200, 0));
this.world.a((EntityHuman) null, 1027, new BlockPosition((int) this.locX, (int) this.locY, (int) this.locZ), 0); this.world.a((EntityHuman) null, 1027, new BlockPosition((int) this.locX, (int) this.locY, (int) this.locZ), 0);
} }
@@ -517,11 +544,12 @@ @@ -536,11 +563,12 @@
} }
public void die(DamageSource damagesource) { public void die(DamageSource damagesource) {

View File

@ -64,7 +64,7 @@
this.a(f); this.a(f);
this.foodTickTimer = 0; this.foodTickTimer = 0;
} }
} else if (flag && this.foodLevel >= 18 && entityhuman.cU()) { } else if (flag && this.foodLevel >= 18 && entityhuman.cY()) {
++this.foodTickTimer; ++this.foodTickTimer;
if (this.foodTickTimer >= 80) { if (this.foodTickTimer >= 80) {
- entityhuman.heal(1.0F); - entityhuman.heal(1.0F);

View File

@ -57,8 +57,8 @@
+ } + }
+ // CraftBukkit end + // CraftBukkit end
+ +
if (packethandshakinginsetprotocol.b() > 110) { if (packethandshakinginsetprotocol.b() > 210) {
chatcomponenttext = new ChatComponentText("Outdated server! I\'m still on 1.9.4"); chatcomponenttext = new ChatComponentText("Outdated server! I\'m still on 1.10");
this.b.sendPacket(new PacketLoginOutDisconnect(chatcomponenttext)); this.b.sendPacket(new PacketLoginOutDisconnect(chatcomponenttext));
@@ -26,6 +71,7 @@ @@ -26,6 +71,7 @@
this.b.close(chatcomponenttext); this.b.close(chatcomponenttext);

View File

@ -12,7 +12,7 @@
public class InventoryCraftResult implements IInventory { public class InventoryCraftResult implements IInventory {
private ItemStack[] items = new ItemStack[1]; private final ItemStack[] items = new ItemStack[1];
+ // CraftBukkit start + // CraftBukkit start
+ private int maxStack = MAX_STACK; + private int maxStack = MAX_STACK;

View File

@ -15,8 +15,8 @@
public class InventoryLargeChest implements ITileInventory { public class InventoryLargeChest implements ITileInventory {
@@ -8,6 +15,48 @@ @@ -8,6 +15,48 @@
public ITileInventory left; public final ITileInventory left;
public ITileInventory right; public final ITileInventory right;
+ // CraftBukkit start - add fields and methods + // CraftBukkit start - add fields and methods
+ public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>(); + public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();

View File

@ -12,7 +12,7 @@
public class ItemArmor extends Item { public class ItemArmor extends Item {
private static final int[] n = new int[] { 13, 15, 16, 11}; private static final int[] n = new int[] { 13, 15, 16, 11};
@@ -36,7 +41,33 @@ @@ -32,7 +37,33 @@
} else { } else {
EntityLiving entityliving = (EntityLiving) list.get(0); EntityLiving entityliving = (EntityLiving) list.get(0);
EnumItemSlot enumitemslot = EntityInsentient.d(itemstack); EnumItemSlot enumitemslot = EntityInsentient.d(itemstack);
@ -47,7 +47,7 @@
itemstack1.count = 1; itemstack1.count = 1;
entityliving.setSlot(enumitemslot, itemstack1); entityliving.setSlot(enumitemslot, itemstack1);
@@ -44,7 +75,7 @@ @@ -40,7 +71,7 @@
((EntityInsentient) entityliving).a(enumitemslot, 2.0F); ((EntityInsentient) entityliving).a(enumitemslot, 2.0F);
} }

View File

@ -12,7 +12,7 @@
public class ItemChorusFruit extends ItemFood { public class ItemChorusFruit extends ItemFood {
@@ -22,7 +27,21 @@ @@ -22,6 +27,20 @@
double d4 = MathHelper.a(entityliving.locY + (double) (entityliving.getRandom().nextInt(16) - 8), 0.0D, (double) (world.Z() - 1)); double d4 = MathHelper.a(entityliving.locY + (double) (entityliving.getRandom().nextInt(16) - 8), 0.0D, (double) (world.Z() - 1));
double d5 = entityliving.locZ + (entityliving.getRandom().nextDouble() - 0.5D) * 16.0D; double d5 = entityliving.locZ + (entityliving.getRandom().nextDouble() - 0.5D) * 16.0D;
@ -28,9 +28,8 @@
+ d4 = teleEvent.getTo().getY(); + d4 = teleEvent.getTo().getY();
+ d5 = teleEvent.getTo().getZ(); + d5 = teleEvent.getTo().getZ();
+ } + }
+ // CraftBukkit end
+ +
if (entityliving.k(d3, d4, d5)) { if (entityliving.isPassenger()) {
+ // CraftBukkit end entityliving.stopRiding();
world.a((EntityHuman) null, d0, d1, d2, SoundEffects.af, SoundCategory.PLAYERS, 1.0F, 1.0F); }
entityliving.a(SoundEffects.af, 1.0F, 1.0F);
break;

View File

@ -12,6 +12,6 @@
+ return EnumInteractionResult.PASS; + return EnumInteractionResult.PASS;
+ } + }
+ // CraftBukkit end + // CraftBukkit end
world.a((EntityHuman) null, blockposition, SoundEffects.bm, SoundCategory.BLOCKS, 1.0F, (ItemFireball.j.nextFloat() - ItemFireball.j.nextFloat()) * 0.2F + 1.0F); world.a((EntityHuman) null, blockposition, SoundEffects.bn, SoundCategory.BLOCKS, 1.0F, (ItemFireball.j.nextFloat() - ItemFireball.j.nextFloat()) * 0.2F + 1.0F);
world.setTypeUpdate(blockposition, Blocks.FIRE.getBlockData()); world.setTypeUpdate(blockposition, Blocks.FIRE.getBlockData());
} }

View File

@ -10,6 +10,6 @@
+ return EnumInteractionResult.PASS; + return EnumInteractionResult.PASS;
+ } + }
+ // CraftBukkit end + // CraftBukkit end
world.a(entityhuman, blockposition, SoundEffects.bx, SoundCategory.BLOCKS, 1.0F, ItemFlintAndSteel.j.nextFloat() * 0.4F + 0.8F); world.a(entityhuman, blockposition, SoundEffects.by, SoundCategory.BLOCKS, 1.0F, ItemFlintAndSteel.j.nextFloat() * 0.4F + 0.8F);
world.setTypeAndData(blockposition, Blocks.FIRE.getBlockData(), 11); world.setTypeAndData(blockposition, Blocks.FIRE.getBlockData(), 11);
} }

View File

@ -1,11 +1,9 @@
--- a/net/minecraft/server/ItemMonsterEgg.java --- a/net/minecraft/server/ItemMonsterEgg.java
+++ b/net/minecraft/server/ItemMonsterEgg.java +++ b/net/minecraft/server/ItemMonsterEgg.java
@@ -130,7 +130,11 @@ @@ -131,6 +131,10 @@
}
@Nullable @Nullable
- public static Entity a(World world, @Nullable String s, double d0, double d1, double d2) { public static Entity a(World world, @Nullable String s, double d0, double d1, double d2) {
+ public static Entity a(World world, @Nullable String s, double d0, double d1, double d2) { // CraftBukkit start - delegate to spawnCreature
+ return spawnCreature(world, s, d0, d1, d2, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER_EGG); + return spawnCreature(world, s, d0, d1, d2, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER_EGG);
+ } + }
+ +
@ -14,8 +12,8 @@
Entity entity = null; Entity entity = null;
@@ -143,8 +147,13 @@ @@ -143,8 +147,13 @@
entityinsentient.aP = entityinsentient.yaw; entityinsentient.aQ = entityinsentient.yaw;
entityinsentient.aN = entityinsentient.yaw; entityinsentient.aO = entityinsentient.yaw;
entityinsentient.prepare(world.D(new BlockPosition(entityinsentient)), (GroupDataEntity) null); entityinsentient.prepare(world.D(new BlockPosition(entityinsentient)), (GroupDataEntity) null);
- world.addEntity(entity); - world.addEntity(entity);
- entityinsentient.D(); - entityinsentient.D();

View File

@ -10,7 +10,7 @@
--itemstack.count; --itemstack.count;
} }
world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.fH, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemSnowball.j.nextFloat() * 0.4F + 0.8F)); world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.fS, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemSnowball.j.nextFloat() * 0.4F + 0.8F));
+ */ + */
if (!world.isClientSide) { if (!world.isClientSide) {
EntitySnowball entitysnowball = new EntitySnowball(world, entityhuman); EntitySnowball entitysnowball = new EntitySnowball(world, entityhuman);
@ -22,7 +22,7 @@
+ --itemstack.count; + --itemstack.count;
+ } + }
+ +
+ world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.fH, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemSnowball.j.nextFloat() * 0.4F + 0.8F)); + world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.fS, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemSnowball.j.nextFloat() * 0.4F + 0.8F));
+ } else if (entityhuman instanceof EntityPlayer) { + } else if (entityhuman instanceof EntityPlayer) {
+ ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); + ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory();
+ } + }

View File

@ -20,8 +20,8 @@
public final class ItemStack { public final class ItemStack {
public static final DecimalFormat a = new DecimalFormat("#.##"); public static final DecimalFormat a = new DecimalFormat("#.##");
@@ -47,10 +60,20 @@ @@ -43,10 +56,20 @@
this.k = false; public ItemStack(Item item, int i, int j) {
this.item = item; this.item = item;
this.count = i; this.count = i;
- this.damage = j; - this.damage = j;
@ -44,7 +44,7 @@
} }
@@ -85,11 +108,131 @@ @@ -81,11 +104,131 @@
} }
public EnumInteractionResult placeItem(EntityHuman entityhuman, World world, BlockPosition blockposition, EnumHand enumhand, EnumDirection enumdirection, float f, float f1, float f2) { public EnumInteractionResult placeItem(EntityHuman entityhuman, World world, BlockPosition blockposition, EnumHand enumhand, EnumDirection enumdirection, float f, float f1, float f2) {
@ -177,7 +177,7 @@
return enuminteractionresult; return enuminteractionresult;
} }
@@ -114,7 +257,7 @@ @@ -110,7 +253,7 @@
nbttagcompound.setByte("Count", (byte) this.count); nbttagcompound.setByte("Count", (byte) this.count);
nbttagcompound.setShort("Damage", (short) this.damage); nbttagcompound.setShort("Damage", (short) this.damage);
if (this.tag != null) { if (this.tag != null) {
@ -186,7 +186,7 @@
} }
return nbttagcompound; return nbttagcompound;
@@ -123,13 +266,18 @@ @@ -119,13 +262,18 @@
public void c(NBTTagCompound nbttagcompound) { public void c(NBTTagCompound nbttagcompound) {
this.item = Item.d(nbttagcompound.getString("id")); this.item = Item.d(nbttagcompound.getString("id"));
this.count = nbttagcompound.getByte("Count"); this.count = nbttagcompound.getByte("Count");
@ -206,7 +206,7 @@
if (this.item != null) { if (this.item != null) {
this.item.a(this.tag); this.item.a(this.tag);
} }
@@ -166,11 +314,30 @@ @@ -162,11 +310,30 @@
} }
public void setData(int i) { public void setData(int i) {
@ -239,7 +239,7 @@
} }
public int j() { public int j() {
@@ -218,6 +385,12 @@ @@ -214,6 +381,12 @@
this.count = 0; this.count = 0;
} }
@ -252,7 +252,7 @@
this.damage = 0; this.damage = 0;
} }
@@ -518,6 +691,7 @@ @@ -514,6 +687,7 @@
@Deprecated @Deprecated
public void setItem(Item item) { public void setItem(Item item) {
this.item = item; this.item = item;

Some files were not shown because too many files have changed in this diff Show More