From 385ace970ee7b7912419d601b8a0867c4c2794df Mon Sep 17 00:00:00 2001 From: Nate Mortensen Date: Thu, 20 Mar 2014 22:26:30 -0600 Subject: [PATCH] Update CraftBukkit to Minecraft 1.7.5 --- pom.xml | 6 +- .../java/net/minecraft/server/AABBPool.java | 68 --- src/main/java/net/minecraft/server/Block.java | 10 +- .../minecraft/server/BlockButtonAbstract.java | 2 +- .../net/minecraft/server/BlockCactus.java | 2 +- .../java/net/minecraft/server/BlockCake.java | 2 +- .../minecraft/server/BlockDiodeAbstract.java | 2 +- .../net/minecraft/server/BlockDispenser.java | 8 +- .../java/net/minecraft/server/BlockFire.java | 4 +- .../java/net/minecraft/server/BlockGrass.java | 5 +- .../java/net/minecraft/server/BlockIce.java | 2 +- .../net/minecraft/server/BlockLeaves.java | 4 +- .../server/BlockMinecartDetector.java | 6 +- .../net/minecraft/server/BlockMushroom.java | 2 +- .../java/net/minecraft/server/BlockMycel.java | 5 +- .../net/minecraft/server/BlockPortal.java | 4 +- .../server/BlockPressurePlateAbstract.java | 2 +- .../server/BlockPressurePlateBinary.java | 2 +- .../server/BlockPressurePlateWeighted.java | 2 - .../net/minecraft/server/BlockPumpkin.java | 1 + .../java/net/minecraft/server/BlockSkull.java | 6 +- .../java/net/minecraft/server/BlockSnow.java | 4 +- .../java/net/minecraft/server/BlockSoil.java | 2 +- .../net/minecraft/server/BlockTripwire.java | 6 +- .../java/net/minecraft/server/BlockVine.java | 4 +- src/main/java/net/minecraft/server/Chunk.java | 18 +- .../minecraft/server/ChunkProviderServer.java | 14 +- .../minecraft/server/ChunkRegionLoader.java | 2 +- .../server/CommandBlockListenerAbstract.java | 6 +- .../java/net/minecraft/server/Container.java | 50 +-- .../net/minecraft/server/ContainerAnvil.java | 4 +- .../net/minecraft/server/ContainerBeacon.java | 4 +- .../server/ContainerBrewingStand.java | 4 +- .../net/minecraft/server/ContainerChest.java | 2 +- .../minecraft/server/ContainerDispenser.java | 2 +- .../server/ContainerEnchantTable.java | 4 +- .../minecraft/server/ContainerFurnace.java | 2 +- .../net/minecraft/server/ContainerHopper.java | 2 +- .../net/minecraft/server/ContainerHorse.java | 6 +- .../minecraft/server/ContainerMerchant.java | 2 +- .../net/minecraft/server/ContainerPlayer.java | 4 +- .../minecraft/server/ContainerWorkbench.java | 2 +- .../net/minecraft/server/ControllerLook.java | 10 +- .../net/minecraft/server/CrashReport.java | 13 +- .../net/minecraft/server/DedicatedServer.java | 61 +-- .../server/DispenseBehaviorArmor.java | 10 +- .../server/DispenseBehaviorBoat.java | 14 +- .../server/DispenseBehaviorBonemeal.java | 8 +- .../server/DispenseBehaviorEmptyBucket.java | 8 +- .../server/DispenseBehaviorFilledBucket.java | 10 +- .../server/DispenseBehaviorFireball.java | 14 +- .../server/DispenseBehaviorFireworks.java | 6 +- .../server/DispenseBehaviorFlintAndSteel.java | 8 +- .../server/DispenseBehaviorItem.java | 8 +- .../server/DispenseBehaviorMinecart.java | 14 +- .../server/DispenseBehaviorMonsterEgg.java | 6 +- .../server/DispenseBehaviorProjectile.java | 4 +- .../minecraft/server/DispenseBehaviorTNT.java | 8 +- .../net/minecraft/server/Enchantment.java | 2 +- .../java/net/minecraft/server/Entity.java | 287 ++++++------ .../net/minecraft/server/EntityArrow.java | 72 +-- .../net/minecraft/server/EntityBlaze.java | 18 +- .../java/net/minecraft/server/EntityBoat.java | 28 +- .../net/minecraft/server/EntityChicken.java | 50 ++- .../java/net/minecraft/server/EntityCow.java | 12 +- .../net/minecraft/server/EntityCreature.java | 72 +-- .../net/minecraft/server/EntityCreeper.java | 36 +- .../server/EntityDamageSourceIndirect.java | 2 +- .../java/net/minecraft/server/EntityEgg.java | 2 +- .../minecraft/server/EntityEnderCrystal.java | 4 +- .../minecraft/server/EntityEnderDragon.java | 86 ++-- .../minecraft/server/EntityEnderPearl.java | 4 +- .../net/minecraft/server/EntityEnderman.java | 52 +-- .../minecraft/server/EntityExperienceOrb.java | 14 +- .../minecraft/server/EntityFallingBlock.java | 6 +- .../net/minecraft/server/EntityFireball.java | 38 +- .../net/minecraft/server/EntityFireworks.java | 8 +- .../minecraft/server/EntityFishingHook.java | 30 +- .../net/minecraft/server/EntityGhast.java | 42 +- .../net/minecraft/server/EntityHanging.java | 16 +- .../net/minecraft/server/EntityHorse.java | 272 +++++------ .../net/minecraft/server/EntityHuman.java | 250 +++++------ .../minecraft/server/EntityInsentient.java | 116 ++--- .../net/minecraft/server/EntityIronGolem.java | 28 +- .../java/net/minecraft/server/EntityItem.java | 26 +- .../net/minecraft/server/EntityItemFrame.java | 4 +- .../minecraft/server/EntityLargeFireball.java | 2 +- .../net/minecraft/server/EntityLeash.java | 14 +- .../net/minecraft/server/EntityLightning.java | 9 +- .../net/minecraft/server/EntityLiving.java | 423 +++++++++--------- .../net/minecraft/server/EntityMagmaCube.java | 32 +- .../server/EntityMinecartAbstract.java | 64 +-- .../server/EntityMinecartContainer.java | 2 +- .../net/minecraft/server/EntityMonster.java | 28 +- .../minecraft/server/EntityMushroomCow.java | 2 +- .../net/minecraft/server/EntityOcelot.java | 28 +- .../java/net/minecraft/server/EntityPig.java | 20 +- .../net/minecraft/server/EntityPigZombie.java | 14 +- .../net/minecraft/server/EntityPlayer.java | 96 ++-- .../net/minecraft/server/EntityPotion.java | 4 +- .../minecraft/server/EntityProjectile.java | 28 +- .../net/minecraft/server/EntitySheep.java | 14 +- .../minecraft/server/EntitySilverfish.java | 22 +- .../net/minecraft/server/EntitySkeleton.java | 58 +-- .../net/minecraft/server/EntitySlime.java | 72 +-- .../minecraft/server/EntitySmallFireball.java | 2 +- .../net/minecraft/server/EntitySnowman.java | 10 +- .../net/minecraft/server/EntitySpider.java | 14 +- .../net/minecraft/server/EntitySquid.java | 28 +- .../net/minecraft/server/EntityTNTPrimed.java | 8 +- .../server/EntityThrownExpBottle.java | 2 +- .../net/minecraft/server/EntityTracker.java | 2 +- .../minecraft/server/EntityTrackerEntry.java | 32 +- .../net/minecraft/server/EntityWitch.java | 24 +- .../net/minecraft/server/EntityWither.java | 52 +-- .../minecraft/server/EntityWitherSkull.java | 2 +- .../java/net/minecraft/server/EntityWolf.java | 40 +- .../net/minecraft/server/EntityZombie.java | 92 ++-- .../java/net/minecraft/server/Explosion.java | 10 +- .../net/minecraft/server/FoodMetaData.java | 2 +- .../minecraft/server/HandshakeListener.java | 14 +- .../minecraft/server/InventoryCrafting.java | 2 +- .../minecraft/server/InventoryEnderChest.java | 2 +- .../minecraft/server/InventoryHorseChest.java | 2 +- .../minecraft/server/InventoryLargeChest.java | 2 +- .../minecraft/server/InventoryMerchant.java | 2 +- .../server/InventorySubcontainer.java | 2 +- src/main/java/net/minecraft/server/Item.java | 4 +- .../java/net/minecraft/server/ItemBed.java | 2 +- .../java/net/minecraft/server/ItemBoat.java | 8 +- .../java/net/minecraft/server/ItemBow.java | 4 +- .../java/net/minecraft/server/ItemDoor.java | 4 +- .../java/net/minecraft/server/ItemDye.java | 4 +- .../net/minecraft/server/ItemFireball.java | 2 +- .../net/minecraft/server/ItemFishingRod.java | 4 +- .../net/minecraft/server/ItemHanging.java | 2 +- .../java/net/minecraft/server/ItemLeash.java | 6 +- .../net/minecraft/server/ItemMonsterEgg.java | 9 +- .../net/minecraft/server/ItemRedstone.java | 2 +- .../net/minecraft/server/ItemSeedFood.java | 2 +- .../java/net/minecraft/server/ItemSign.java | 2 +- .../java/net/minecraft/server/ItemStack.java | 18 +- .../net/minecraft/server/ItemWaterLily.java | 2 +- .../net/minecraft/server/ItemWorldMap.java | 2 +- .../net/minecraft/server/LoginListener.java | 8 +- .../net/minecraft/server/MinecraftServer.java | 156 +++---- .../net/minecraft/server/MobEffectList.java | 8 +- .../minecraft/server/MobSpawnerAbstract.java | 2 +- .../net/minecraft/server/NetworkManager.java | 137 +++--- .../server/PathfinderGoalBreakDoor.java | 2 +- .../minecraft/server/PathfinderGoalBreed.java | 24 +- .../server/PathfinderGoalEatTile.java | 2 +- .../server/PathfinderGoalMakeLove.java | 8 +- .../server/PathfinderGoalMeleeAttack.java | 10 +- .../minecraft/server/PathfinderGoalPanic.java | 8 +- .../minecraft/server/PathfinderGoalSit.java | 4 +- .../minecraft/server/PathfinderGoalTame.java | 14 +- .../server/PathfinderGoalTarget.java | 4 +- .../net/minecraft/server/PlayerChunk.java | 6 +- .../net/minecraft/server/PlayerChunkMap.java | 123 +++-- .../minecraft/server/PlayerConnection.java | 188 ++++---- .../server/PlayerInteractManager.java | 14 +- .../net/minecraft/server/PlayerInventory.java | 12 +- .../java/net/minecraft/server/PlayerList.java | 88 ++-- .../net/minecraft/server/PlayerSelector.java | 18 +- .../net/minecraft/server/PortalCreator.java | 2 +- .../minecraft/server/PortalTravelAgent.java | 12 +- .../net/minecraft/server/RecipesFurnace.java | 8 +- .../java/net/minecraft/server/RegionFile.java | 2 +- src/main/java/net/minecraft/server/Slot.java | 6 +- .../minecraft/server/SlotFurnaceResult.java | 4 +- .../net/minecraft/server/SpawnerCreature.java | 8 +- .../minecraft/server/StatisticManager.java | 21 +- .../minecraft/server/ThreadCommandReader.java | 2 +- .../server/ThreadPlayerLookupUUID.java | 10 +- .../java/net/minecraft/server/TileEntity.java | 2 +- .../minecraft/server/TileEntityBeacon.java | 6 +- .../server/TileEntityBrewingStand.java | 4 +- .../net/minecraft/server/TileEntityChest.java | 12 +- .../minecraft/server/TileEntityDispenser.java | 2 +- .../minecraft/server/TileEntityFurnace.java | 64 +-- .../minecraft/server/TileEntityHopper.java | 177 ++++++-- .../net/minecraft/server/TileEntitySkull.java | 2 +- src/main/java/net/minecraft/server/Vec3D.java | 153 ------- .../java/net/minecraft/server/Vec3DPool.java | 112 ----- .../java/net/minecraft/server/Village.java | 12 +- .../net/minecraft/server/VillageSiege.java | 6 +- src/main/java/net/minecraft/server/World.java | 274 ++++++------ .../net/minecraft/server/WorldNBTStorage.java | 2 +- .../net/minecraft/server/WorldServer.java | 39 +- .../org/bukkit/craftbukkit/CraftServer.java | 7 +- .../bukkit/craftbukkit/CraftStatistic.java | 24 +- .../bukkit/craftbukkit/CraftTravelAgent.java | 4 +- .../org/bukkit/craftbukkit/CraftWorld.java | 2 +- .../command/VanillaCommandWrapper.java | 38 +- .../bukkit/craftbukkit/entity/CraftArrow.java | 8 +- .../craftbukkit/entity/CraftLivingEntity.java | 2 +- .../craftbukkit/entity/CraftPlayer.java | 26 +- .../craftbukkit/event/CraftEventFactory.java | 3 +- .../generator/CustomChunkGenerator.java | 2 +- .../generator/NormalChunkGenerator.java | 2 +- .../CraftBlockProjectileSource.java | 14 +- .../craftbukkit/util/CraftChatMessage.java | 4 +- .../craftbukkit/util/CraftDamageSource.java | 2 +- .../craftbukkit/util/CraftMagicNumbers.java | 6 +- .../bukkit/StatisticsAndAchievementsTest.java | 4 +- 206 files changed, 2670 insertions(+), 2679 deletions(-) delete mode 100644 src/main/java/net/minecraft/server/AABBPool.java delete mode 100644 src/main/java/net/minecraft/server/Vec3D.java delete mode 100644 src/main/java/net/minecraft/server/Vec3DPool.java diff --git a/pom.xml b/pom.xml index b9bbeef550..9f81af0fb3 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.bukkit craftbukkit jar - 1.7.2-R0.4-SNAPSHOT + 1.7.5-R0.1-SNAPSHOT CraftBukkit http://www.bukkit.org @@ -12,8 +12,8 @@ UTF-8 unknown 4.11 - 1.7.2 - 1_7_R1 + 1.7.5 + 1_7_R2 git-Bukkit- diff --git a/src/main/java/net/minecraft/server/AABBPool.java b/src/main/java/net/minecraft/server/AABBPool.java deleted file mode 100644 index e3b765c616..0000000000 --- a/src/main/java/net/minecraft/server/AABBPool.java +++ /dev/null @@ -1,68 +0,0 @@ -package net.minecraft.server; - -import java.util.ArrayList; -import java.util.List; - -public class AABBPool { - - private final int a; - private final int b; - private final List pool = new ArrayList(); - private int d; - private int largestSize; - private int resizeTime; - - public AABBPool(int i, int j) { - this.a = i; - this.b = j; - } - - public AxisAlignedBB a(double d0, double d1, double d2, double d3, double d4, double d5) { - // CraftBukkit - don't pool objects indefinitely if thread doesn't adhere to contract - if (this.resizeTime == 0) return new AxisAlignedBB(d0, d1, d2, d3, d4, d5); - AxisAlignedBB axisalignedbb; - - if (this.d >= this.pool.size()) { - axisalignedbb = new AxisAlignedBB(d0, d1, d2, d3, d4, d5); - this.pool.add(axisalignedbb); - } else { - axisalignedbb = (AxisAlignedBB) this.pool.get(this.d); - axisalignedbb.b(d0, d1, d2, d3, d4, d5); - } - - ++this.d; - return axisalignedbb; - } - - public void a() { - if (this.d > this.largestSize) { - this.largestSize = this.d; - } - - // CraftBukkit start - Intelligent cache - if ((this.resizeTime++ & 0xff) == 0) { - int newSize = this.pool.size() - (this.pool.size() >> 3); - // newSize will be 87.5%, but if we were not in that range, we clear some of the cache - if (newSize > this.largestSize) { - // Work down from size() to prevent insane array copies - for (int i = this.pool.size() - 1; i > newSize; i--) { - this.pool.remove(i); - } - } - - this.largestSize = 0; - // this.resizeTime = 0; // We do not reset to zero; it doubles for a flag - } - // CraftBukkit end - - this.d = 0; - } - - public int c() { - return this.pool.size(); - } - - public int d() { - return this.d; - } -} diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java index dca832f6fa..14c00c5ae7 100644 --- a/src/main/java/net/minecraft/server/Block.java +++ b/src/main/java/net/minecraft/server/Block.java @@ -408,7 +408,7 @@ public class Block { } public AxisAlignedBB a(World world, int i, int j, int k) { - return AxisAlignedBB.a().a((double) i + this.minX, (double) j + this.minY, (double) k + this.minZ, (double) i + this.maxX, (double) j + this.maxY, (double) k + this.maxZ); + return AxisAlignedBB.a((double) i + this.minX, (double) j + this.minY, (double) k + this.minZ, (double) i + this.maxX, (double) j + this.maxY, (double) k + this.maxZ); } public boolean c() { @@ -599,15 +599,15 @@ public class Block { } private boolean a(Vec3D vec3d) { - return vec3d == null ? false : vec3d.d >= this.minY && vec3d.d <= this.maxY && vec3d.e >= this.minZ && vec3d.e <= this.maxZ; + return vec3d == null ? false : vec3d.b >= this.minY && vec3d.b <= this.maxY && vec3d.c >= this.minZ && vec3d.c <= this.maxZ; } private boolean b(Vec3D vec3d) { - return vec3d == null ? false : vec3d.c >= this.minX && vec3d.c <= this.maxX && vec3d.e >= this.minZ && vec3d.e <= this.maxZ; + return vec3d == null ? false : vec3d.a >= this.minX && vec3d.a <= this.maxX && vec3d.c >= this.minZ && vec3d.c <= this.maxZ; } private boolean c(Vec3D vec3d) { - return vec3d == null ? false : vec3d.c >= this.minX && vec3d.c <= this.maxX && vec3d.d >= this.minY && vec3d.d <= this.maxY; + return vec3d == null ? false : vec3d.a >= this.minX && vec3d.a <= this.maxX && vec3d.b >= this.minY && vec3d.b <= this.maxY; } public void wasExploded(World world, int i, int j, int k, Explosion explosion) {} @@ -681,7 +681,7 @@ public class Block { public void g() {} public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) { - entityhuman.a(StatisticList.C[b(this)], 1); + entityhuman.a(StatisticList.MINE_BLOCK_COUNT[b(this)], 1); entityhuman.a(0.025F); if (this.E() && EnchantmentManager.hasSilkTouchEnchantment(entityhuman)) { ItemStack itemstack = this.j(l); diff --git a/src/main/java/net/minecraft/server/BlockButtonAbstract.java b/src/main/java/net/minecraft/server/BlockButtonAbstract.java index bb358850f9..5627ba47b3 100644 --- a/src/main/java/net/minecraft/server/BlockButtonAbstract.java +++ b/src/main/java/net/minecraft/server/BlockButtonAbstract.java @@ -250,7 +250,7 @@ public abstract class BlockButtonAbstract extends Block { boolean flag = (l & 8) != 0; this.b(l); - List list = world.a(EntityArrow.class, AxisAlignedBB.a().a((double) i + this.minX, (double) j + this.minY, (double) k + this.minZ, (double) i + this.maxX, (double) j + this.maxY, (double) k + this.maxZ)); + List list = world.a(EntityArrow.class, AxisAlignedBB.a((double) i + this.minX, (double) j + this.minY, (double) k + this.minZ, (double) i + this.maxX, (double) j + this.maxY, (double) k + this.maxZ)); boolean flag1 = !list.isEmpty(); // CraftBukkit start - Call interact event when arrows turn on wooden buttons diff --git a/src/main/java/net/minecraft/server/BlockCactus.java b/src/main/java/net/minecraft/server/BlockCactus.java index 421af0449d..57eb59d6bd 100644 --- a/src/main/java/net/minecraft/server/BlockCactus.java +++ b/src/main/java/net/minecraft/server/BlockCactus.java @@ -37,7 +37,7 @@ public class BlockCactus extends Block { public AxisAlignedBB a(World world, int i, int j, int k) { float f = 0.0625F; - return AxisAlignedBB.a().a((double) ((float) i + f), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) ((float) (j + 1) - f), (double) ((float) (k + 1) - f)); + return AxisAlignedBB.a((double) ((float) i + f), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) ((float) (j + 1) - f), (double) ((float) (k + 1) - f)); } public boolean d() { diff --git a/src/main/java/net/minecraft/server/BlockCake.java b/src/main/java/net/minecraft/server/BlockCake.java index df2ae3225b..e65a27052b 100644 --- a/src/main/java/net/minecraft/server/BlockCake.java +++ b/src/main/java/net/minecraft/server/BlockCake.java @@ -31,7 +31,7 @@ public class BlockCake extends Block { float f1 = (float) (1 + l * 2) / 16.0F; float f2 = 0.5F; - return AxisAlignedBB.a().a((double) ((float) i + f1), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) ((float) j + f2 - f), (double) ((float) (k + 1) - f)); + return AxisAlignedBB.a((double) ((float) i + f1), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) ((float) j + f2 - f), (double) ((float) (k + 1) - f)); } public boolean d() { diff --git a/src/main/java/net/minecraft/server/BlockDiodeAbstract.java b/src/main/java/net/minecraft/server/BlockDiodeAbstract.java index 474c011770..ec581e0f4d 100644 --- a/src/main/java/net/minecraft/server/BlockDiodeAbstract.java +++ b/src/main/java/net/minecraft/server/BlockDiodeAbstract.java @@ -97,7 +97,7 @@ public abstract class BlockDiodeAbstract extends BlockDirectional { protected void b(World world, int i, int j, int k, Block block) { int l = world.getData(i, j, k); - if (!this.g((IBlockAccess) world, i, j, k, l)) { + if (!this.g((IBlockAccess) world, i, j, k, l)) { // CraftBukkit - Cast world to IBlockAccess to call the right method. boolean flag = this.a(world, i, j, k, l); if ((this.a && !flag || !this.a && flag) && !world.a(i, j, k, (Block) this)) { diff --git a/src/main/java/net/minecraft/server/BlockDispenser.java b/src/main/java/net/minecraft/server/BlockDispenser.java index c68d183452..a419ef38e8 100644 --- a/src/main/java/net/minecraft/server/BlockDispenser.java +++ b/src/main/java/net/minecraft/server/BlockDispenser.java @@ -89,7 +89,7 @@ public class BlockDispenser extends BlockContainer { } protected IDispenseBehavior a(ItemStack itemstack) { - return (IDispenseBehavior) a.a(itemstack.getItem()); + return (IDispenseBehavior) a.get(itemstack.getItem()); } public void doPhysics(World world, int i, int j, int k, Block block) { @@ -168,9 +168,9 @@ public class BlockDispenser extends BlockContainer { public static IPosition a(ISourceBlock isourceblock) { EnumFacing enumfacing = b(isourceblock.h()); - double d0 = isourceblock.getX() + 0.7D * (double) enumfacing.c(); - double d1 = isourceblock.getY() + 0.7D * (double) enumfacing.d(); - double d2 = isourceblock.getZ() + 0.7D * (double) enumfacing.e(); + double d0 = isourceblock.getX() + 0.7D * (double) enumfacing.getAdjacentX(); + double d1 = isourceblock.getY() + 0.7D * (double) enumfacing.getAdjacentY(); + double d2 = isourceblock.getZ() + 0.7D * (double) enumfacing.getAdjacentZ(); return new Position(d0, d1, d2); } diff --git a/src/main/java/net/minecraft/server/BlockFire.java b/src/main/java/net/minecraft/server/BlockFire.java index 331589a034..ba5e77fca7 100644 --- a/src/main/java/net/minecraft/server/BlockFire.java +++ b/src/main/java/net/minecraft/server/BlockFire.java @@ -85,7 +85,7 @@ public class BlockFire extends Block { fireExtinguished(world, i, j, k); // CraftBukkit - invalid place location } - if (!flag && world.P() && (world.isRainingAt(i, j, k) || world.isRainingAt(i - 1, j, k) || world.isRainingAt(i + 1, j, k) || world.isRainingAt(i, j, k - 1) || world.isRainingAt(i, j, k + 1))) { + if (!flag && world.Q() && (world.isRainingAt(i, j, k) || world.isRainingAt(i - 1, j, k) || world.isRainingAt(i + 1, j, k) || world.isRainingAt(i, j, k - 1) || world.isRainingAt(i, j, k + 1))) { fireExtinguished(world, i, j, k); // CraftBukkit - extinguished by rain } else { int l = world.getData(i, j, k); @@ -135,7 +135,7 @@ public class BlockFire extends Block { j2 /= 2; } - if (j2 > 0 && random.nextInt(l1) <= j2 && (!world.P() || !world.isRainingAt(i1, k1, j1)) && !world.isRainingAt(i1 - 1, k1, k) && !world.isRainingAt(i1 + 1, k1, j1) && !world.isRainingAt(i1, k1, j1 - 1) && !world.isRainingAt(i1, k1, j1 + 1)) { + if (j2 > 0 && random.nextInt(l1) <= j2 && (!world.Q() || !world.isRainingAt(i1, k1, j1)) && !world.isRainingAt(i1 - 1, k1, k) && !world.isRainingAt(i1 + 1, k1, j1) && !world.isRainingAt(i1, k1, j1 - 1) && !world.isRainingAt(i1, k1, j1 + 1)) { int k2 = l + random.nextInt(5) / 4; if (k2 > 15) { diff --git a/src/main/java/net/minecraft/server/BlockGrass.java b/src/main/java/net/minecraft/server/BlockGrass.java index 7b785792a6..bf14bbb0b2 100644 --- a/src/main/java/net/minecraft/server/BlockGrass.java +++ b/src/main/java/net/minecraft/server/BlockGrass.java @@ -7,6 +7,7 @@ import org.apache.logging.log4j.Logger; // CraftBukkit start import org.bukkit.block.BlockState; +import org.bukkit.craftbukkit.util.CraftMagicNumbers; import org.bukkit.event.block.BlockSpreadEvent; import org.bukkit.event.block.BlockFadeEvent; // CraftBukkit end @@ -27,7 +28,7 @@ public class BlockGrass extends Block implements IBlockFragilePlantElement { // CraftBukkit start org.bukkit.World bworld = world.getWorld(); BlockState blockState = bworld.getBlockAt(i, j, k).getState(); - blockState.setTypeId(Block.b(Blocks.DIRT)); + blockState.setType(CraftMagicNumbers.getMaterial(Blocks.DIRT)); BlockFadeEvent event = new BlockFadeEvent(blockState.getBlock(), blockState); world.getServer().getPluginManager().callEvent(event); @@ -47,7 +48,7 @@ public class BlockGrass extends Block implements IBlockFragilePlantElement { // CraftBukkit start org.bukkit.World bworld = world.getWorld(); BlockState blockState = bworld.getBlockAt(i1, j1, k1).getState(); - blockState.setTypeId(Block.b(Blocks.GRASS)); + blockState.setType(CraftMagicNumbers.getMaterial(Blocks.GRASS)); BlockSpreadEvent event = new BlockSpreadEvent(blockState.getBlock(), bworld.getBlockAt(i, j, k), blockState); world.getServer().getPluginManager().callEvent(event); diff --git a/src/main/java/net/minecraft/server/BlockIce.java b/src/main/java/net/minecraft/server/BlockIce.java index e7de2e1829..c0213b66ae 100644 --- a/src/main/java/net/minecraft/server/BlockIce.java +++ b/src/main/java/net/minecraft/server/BlockIce.java @@ -12,7 +12,7 @@ public class BlockIce extends BlockHalfTransparent { } public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) { - entityhuman.a(StatisticList.C[Block.b((Block) this)], 1); + entityhuman.a(StatisticList.MINE_BLOCK_COUNT[Block.b((Block) this)], 1); entityhuman.a(0.025F); if (this.E() && EnchantmentManager.hasSilkTouchEnchantment(entityhuman)) { ItemStack itemstack = this.j(l); diff --git a/src/main/java/net/minecraft/server/BlockLeaves.java b/src/main/java/net/minecraft/server/BlockLeaves.java index 34e803376b..5601432467 100644 --- a/src/main/java/net/minecraft/server/BlockLeaves.java +++ b/src/main/java/net/minecraft/server/BlockLeaves.java @@ -179,8 +179,8 @@ public abstract class BlockLeaves extends BlockTransparent { } public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) { - if (!world.isStatic && entityhuman.bD() != null && entityhuman.bD().getItem() == Items.SHEARS) { - entityhuman.a(StatisticList.C[Block.b((Block) this)], 1); + if (!world.isStatic && entityhuman.bE() != null && entityhuman.bE().getItem() == Items.SHEARS) { + entityhuman.a(StatisticList.MINE_BLOCK_COUNT[Block.b((Block) this)], 1); this.a(world, i, j, k, new ItemStack(Item.getItemOf(this), 1, l & 3)); } else { super.a(world, entityhuman, i, j, k, l); diff --git a/src/main/java/net/minecraft/server/BlockMinecartDetector.java b/src/main/java/net/minecraft/server/BlockMinecartDetector.java index 1278285545..418c92b8c1 100644 --- a/src/main/java/net/minecraft/server/BlockMinecartDetector.java +++ b/src/main/java/net/minecraft/server/BlockMinecartDetector.java @@ -52,7 +52,7 @@ public class BlockMinecartDetector extends BlockMinecartTrackAbstract { boolean flag = (l & 8) != 0; boolean flag1 = false; float f = 0.125F; - List list = world.a(EntityMinecartAbstract.class, AxisAlignedBB.a().a((double) ((float) i + f), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) ((float) (j + 1) - f), (double) ((float) (k + 1) - f))); + List list = world.a(EntityMinecartAbstract.class, AxisAlignedBB.a((double) ((float) i + f), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) ((float) (j + 1) - f), (double) ((float) (k + 1) - f))); if (!list.isEmpty()) { flag1 = true; @@ -102,13 +102,13 @@ public class BlockMinecartDetector extends BlockMinecartTrackAbstract { public int g(World world, int i, int j, int k, int l) { if ((world.getData(i, j, k) & 8) > 0) { float f = 0.125F; - List list = world.a(EntityMinecartCommandBlock.class, AxisAlignedBB.a().a((double) ((float) i + f), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) ((float) (j + 1) - f), (double) ((float) (k + 1) - f))); + List list = world.a(EntityMinecartCommandBlock.class, AxisAlignedBB.a((double) ((float) i + f), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) ((float) (j + 1) - f), (double) ((float) (k + 1) - f))); if (list.size() > 0) { return ((EntityMinecartCommandBlock) list.get(0)).e().g(); } - List list1 = world.a(EntityMinecartAbstract.class, AxisAlignedBB.a().a((double) ((float) i + f), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) ((float) (j + 1) - f), (double) ((float) (k + 1) - f)), IEntitySelector.b); + List list1 = world.a(EntityMinecartAbstract.class, AxisAlignedBB.a((double) ((float) i + f), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) ((float) (j + 1) - f), (double) ((float) (k + 1) - f)), IEntitySelector.c); if (list1.size() > 0) { return Container.b((IInventory) list1.get(0)); diff --git a/src/main/java/net/minecraft/server/BlockMushroom.java b/src/main/java/net/minecraft/server/BlockMushroom.java index 54a399f1ef..75fe4c030c 100644 --- a/src/main/java/net/minecraft/server/BlockMushroom.java +++ b/src/main/java/net/minecraft/server/BlockMushroom.java @@ -64,7 +64,7 @@ public class BlockMushroom extends BlockPlant implements IBlockFragilePlantEleme // CraftBukkit start org.bukkit.World bworld = world.getWorld(); BlockState blockState = bworld.getBlockAt(i1, j1, k1).getState(); - blockState.setTypeId(Block.b(this)); // nms: this.id, 0, 2 + blockState.setType(org.bukkit.craftbukkit.util.CraftMagicNumbers.getMaterial(this)); // nms: this.id, 0, 2 BlockSpreadEvent event = new BlockSpreadEvent(blockState.getBlock(), bworld.getBlockAt(sourceX, sourceY, sourceZ), blockState); world.getServer().getPluginManager().callEvent(event); diff --git a/src/main/java/net/minecraft/server/BlockMycel.java b/src/main/java/net/minecraft/server/BlockMycel.java index 6ac6d94316..a01a6e62a0 100644 --- a/src/main/java/net/minecraft/server/BlockMycel.java +++ b/src/main/java/net/minecraft/server/BlockMycel.java @@ -4,6 +4,7 @@ import java.util.Random; // CraftBukkit start import org.bukkit.block.BlockState; +import org.bukkit.craftbukkit.util.CraftMagicNumbers; import org.bukkit.event.block.BlockFadeEvent; import org.bukkit.event.block.BlockSpreadEvent; // CraftBukkit end @@ -22,7 +23,7 @@ public class BlockMycel extends Block { // CraftBukkit start org.bukkit.World bworld = world.getWorld(); BlockState blockState = bworld.getBlockAt(i, j, k).getState(); - blockState.setTypeId(Block.b(Blocks.DIRT)); + blockState.setType(CraftMagicNumbers.getMaterial(Blocks.DIRT)); BlockFadeEvent event = new BlockFadeEvent(blockState.getBlock(), blockState); world.getServer().getPluginManager().callEvent(event); @@ -42,7 +43,7 @@ public class BlockMycel extends Block { // CraftBukkit start org.bukkit.World bworld = world.getWorld(); BlockState blockState = bworld.getBlockAt(i1, j1, k1).getState(); - blockState.setTypeId(Block.b(this)); + blockState.setType(CraftMagicNumbers.getMaterial(this)); BlockSpreadEvent event = new BlockSpreadEvent(blockState.getBlock(), bworld.getBlockAt(i, j, k), blockState); world.getServer().getPluginManager().callEvent(event); diff --git a/src/main/java/net/minecraft/server/BlockPortal.java b/src/main/java/net/minecraft/server/BlockPortal.java index bec5aa8a50..1356f132cf 100644 --- a/src/main/java/net/minecraft/server/BlockPortal.java +++ b/src/main/java/net/minecraft/server/BlockPortal.java @@ -27,7 +27,7 @@ public class BlockPortal extends BlockHalfTransparent { Entity entity = ItemMonsterEgg.spawnCreature(world, 57, (double) i + 0.5D, (double) l + 1.1D, (double) k + 0.5D, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NETHER_PORTAL); if (entity != null) { - entity.portalCooldown = entity.ai(); + entity.portalCooldown = entity.ah(); } } } @@ -112,7 +112,7 @@ public class BlockPortal extends BlockHalfTransparent { world.getServer().getPluginManager().callEvent(event); // CraftBukkit end - entity.ah(); + entity.ag(); } } diff --git a/src/main/java/net/minecraft/server/BlockPressurePlateAbstract.java b/src/main/java/net/minecraft/server/BlockPressurePlateAbstract.java index 2809e163a0..c2dfc861b7 100644 --- a/src/main/java/net/minecraft/server/BlockPressurePlateAbstract.java +++ b/src/main/java/net/minecraft/server/BlockPressurePlateAbstract.java @@ -126,7 +126,7 @@ public abstract class BlockPressurePlateAbstract extends Block { protected AxisAlignedBB a(int i, int j, int k) { float f = 0.125F; - return AxisAlignedBB.a().a((double) ((float) i + f), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) j + 0.25D, (double) ((float) (k + 1) - f)); + return AxisAlignedBB.a((double) ((float) i + f), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) j + 0.25D, (double) ((float) (k + 1) - f)); } public void remove(World world, int i, int j, int k, Block block, int l) { diff --git a/src/main/java/net/minecraft/server/BlockPressurePlateBinary.java b/src/main/java/net/minecraft/server/BlockPressurePlateBinary.java index 25ef883d56..ce8b9dc703 100644 --- a/src/main/java/net/minecraft/server/BlockPressurePlateBinary.java +++ b/src/main/java/net/minecraft/server/BlockPressurePlateBinary.java @@ -63,7 +63,7 @@ public class BlockPressurePlateBinary extends BlockPressurePlateAbstract { } // CraftBukkit end - if (!entity.az()) { + if (!entity.ay()) { return 15; } } diff --git a/src/main/java/net/minecraft/server/BlockPressurePlateWeighted.java b/src/main/java/net/minecraft/server/BlockPressurePlateWeighted.java index 8bc708fc33..b6f22f02d9 100644 --- a/src/main/java/net/minecraft/server/BlockPressurePlateWeighted.java +++ b/src/main/java/net/minecraft/server/BlockPressurePlateWeighted.java @@ -1,7 +1,5 @@ package net.minecraft.server; -import java.util.List; - import org.bukkit.event.entity.EntityInteractEvent; // CraftBukkit public class BlockPressurePlateWeighted extends BlockPressurePlateAbstract { diff --git a/src/main/java/net/minecraft/server/BlockPumpkin.java b/src/main/java/net/minecraft/server/BlockPumpkin.java index 52ec255b96..a8632a77c6 100644 --- a/src/main/java/net/minecraft/server/BlockPumpkin.java +++ b/src/main/java/net/minecraft/server/BlockPumpkin.java @@ -33,6 +33,7 @@ public class BlockPumpkin extends BlockDirectional { if (world.addEntity(entitysnowman, SpawnReason.BUILD_SNOWMAN)) { blockList.updateList(); } + // CraftBukkit end } for (int l = 0; l < 120; ++l) { diff --git a/src/main/java/net/minecraft/server/BlockSkull.java b/src/main/java/net/minecraft/server/BlockSkull.java index 8e58157b7d..e24b740802 100644 --- a/src/main/java/net/minecraft/server/BlockSkull.java +++ b/src/main/java/net/minecraft/server/BlockSkull.java @@ -156,8 +156,8 @@ public class BlockSkull extends BlockContainer { if (!world.isStatic) { entitywither = new EntityWither(world); entitywither.setPositionRotation((double) i + 0.5D, (double) j - 1.45D, (double) (k + l) + 1.5D, 90.0F, 0.0F); - entitywither.aN = 90.0F; - entitywither.bX(); + entitywither.aM = 90.0F; + entitywither.bZ(); if (world.addEntity(entitywither, SpawnReason.BUILD_WITHER)) { if (!world.isStatic) { @@ -200,7 +200,7 @@ public class BlockSkull extends BlockContainer { if (!world.isStatic) { entitywither = new EntityWither(world); entitywither.setPositionRotation((double) (i + l) + 1.5D, (double) j - 1.45D, (double) k + 0.5D, 0.0F, 0.0F); - entitywither.bX(); + entitywither.bZ(); if (world.addEntity(entitywither, SpawnReason.BUILD_WITHER)) { if (!world.isStatic) { diff --git a/src/main/java/net/minecraft/server/BlockSnow.java b/src/main/java/net/minecraft/server/BlockSnow.java index 37a811ab82..201cb2a6df 100644 --- a/src/main/java/net/minecraft/server/BlockSnow.java +++ b/src/main/java/net/minecraft/server/BlockSnow.java @@ -16,7 +16,7 @@ public class BlockSnow extends Block { int l = world.getData(i, j, k) & 7; float f = 0.125F; - return AxisAlignedBB.a().a((double) i + this.minX, (double) j + this.minY, (double) k + this.minZ, (double) i + this.maxX, (double) ((float) j + (float) l * f), (double) k + this.maxZ); + return AxisAlignedBB.a((double) i + this.minX, (double) j + this.minY, (double) k + this.minZ, (double) i + this.maxX, (double) ((float) j + (float) l * f), (double) k + this.maxZ); } public boolean c() { @@ -67,7 +67,7 @@ public class BlockSnow extends Block { this.a(world, i, j, k, new ItemStack(Items.SNOW_BALL, i1 + 1, 0)); world.setAir(i, j, k); - entityhuman.a(StatisticList.C[Block.b((Block) this)], 1); + entityhuman.a(StatisticList.MINE_BLOCK_COUNT[Block.b((Block) this)], 1); } public Item getDropType(int i, Random random, int j) { diff --git a/src/main/java/net/minecraft/server/BlockSoil.java b/src/main/java/net/minecraft/server/BlockSoil.java index b62cbd8da4..c7a48a6a54 100644 --- a/src/main/java/net/minecraft/server/BlockSoil.java +++ b/src/main/java/net/minecraft/server/BlockSoil.java @@ -17,7 +17,7 @@ public class BlockSoil extends Block { } public AxisAlignedBB a(World world, int i, int j, int k) { - return AxisAlignedBB.a().a((double) (i + 0), (double) (j + 0), (double) (k + 0), (double) (i + 1), (double) (j + 1), (double) (k + 1)); + return AxisAlignedBB.a((double) (i + 0), (double) (j + 0), (double) (k + 0), (double) (i + 1), (double) (j + 1), (double) (k + 1)); } public boolean c() { diff --git a/src/main/java/net/minecraft/server/BlockTripwire.java b/src/main/java/net/minecraft/server/BlockTripwire.java index 347a0aeb68..8c184e9fc0 100644 --- a/src/main/java/net/minecraft/server/BlockTripwire.java +++ b/src/main/java/net/minecraft/server/BlockTripwire.java @@ -76,7 +76,7 @@ public class BlockTripwire extends Block { public void a(World world, int i, int j, int k, int l, EntityHuman entityhuman) { if (!world.isStatic) { - if (entityhuman.bD() != null && entityhuman.bD().getItem() == Items.SHEARS) { + if (entityhuman.bE() != null && entityhuman.bE().getItem() == Items.SHEARS) { world.setData(i, j, k, l | 8, 4); } } @@ -132,7 +132,7 @@ public class BlockTripwire extends Block { int l = world.getData(i, j, k); boolean flag = (l & 1) == 1; boolean flag1 = false; - List list = world.getEntities((Entity) null, AxisAlignedBB.a().a((double) i + this.minX, (double) j + this.minY, (double) k + this.minZ, (double) i + this.maxX, (double) j + this.maxY, (double) k + this.maxZ)); + List list = world.getEntities((Entity) null, AxisAlignedBB.a((double) i + this.minX, (double) j + this.minY, (double) k + this.minZ, (double) i + this.maxX, (double) j + this.maxY, (double) k + this.maxZ)); if (!list.isEmpty()) { Iterator iterator = list.iterator(); @@ -140,7 +140,7 @@ public class BlockTripwire extends Block { while (iterator.hasNext()) { Entity entity = (Entity) iterator.next(); - if (!entity.az()) { + if (!entity.ay()) { flag1 = true; break; } diff --git a/src/main/java/net/minecraft/server/BlockVine.java b/src/main/java/net/minecraft/server/BlockVine.java index 5033a10cf9..3860ee55b6 100644 --- a/src/main/java/net/minecraft/server/BlockVine.java +++ b/src/main/java/net/minecraft/server/BlockVine.java @@ -294,8 +294,8 @@ public class BlockVine extends Block { } public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) { - if (!world.isStatic && entityhuman.bD() != null && entityhuman.bD().getItem() == Items.SHEARS) { - entityhuman.a(StatisticList.C[Block.b((Block) this)], 1); + if (!world.isStatic && entityhuman.bE() != null && entityhuman.bE().getItem() == Items.SHEARS) { + entityhuman.a(StatisticList.MINE_BLOCK_COUNT[Block.b((Block) this)], 1); this.a(world, i, j, k, new ItemStack(Blocks.VINE, 1, 0)); } else { super.a(world, entityhuman, i, j, k, l); diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java index bc3dd41dc4..771eab377b 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -591,7 +591,7 @@ public class Chunk { if (i != this.locX || j != this.locZ) { // CraftBukkit start Bukkit.getLogger().warning("Wrong location for " + entity + " in world '" + world.getWorld().getName() + "'!"); - // t.error("Wrong location! " + entity); + // t.warn("Wrong location! " + entity + " (at " + i + ", " + j + " instead of " + this.locX + ", " + this.locZ + ")"); // Thread.dumpStack(); Bukkit.getLogger().warning("Entity is at " + entity.locX + "," + entity.locZ + " (chunk " + i + "," + j + ") but was stored in chunk " + this.locX + "," + this.locZ); // CraftBukkit end @@ -607,15 +607,15 @@ public class Chunk { k = this.entitySlices.length - 1; } - entity.ah = true; - entity.ai = this.locX; - entity.aj = k; - entity.ak = this.locZ; + entity.ag = true; + entity.ah = this.locX; + entity.ai = k; + entity.aj = this.locZ; this.entitySlices[k].add(entity); } public void b(Entity entity) { - this.a(entity, entity.aj); + this.a(entity, entity.ai); } public void a(Entity entity, int i) { @@ -685,7 +685,7 @@ public class Chunk { // CraftBukkit start } else { System.out.println("Attempted to place a tile entity (" + tileentity + ") at " + tileentity.x + "," + tileentity.y + "," + tileentity.z - + " (" + org.bukkit.Material.getMaterial(Block.b(getType(i, j, k))) + ") where there was no entity tile!"); + + " (" + org.bukkit.craftbukkit.util.CraftMagicNumbers.getMaterial(getType(i, j, k)) + ") where there was no entity tile!"); System.out.println("Chunk coordinates: " + (this.locX * 16) + "," + (this.locZ * 16)); new Exception().printStackTrace(); // CraftBukkit end @@ -714,7 +714,7 @@ public class Chunk { while (iterator.hasNext()) { Entity entity = (Entity) iterator.next(); - entity.X(); + entity.W(); } this.world.a(this.entitySlices[i]); @@ -768,7 +768,7 @@ public class Chunk { if (entity1 != entity && entity1.boundingBox.b(axisalignedbb) && (ientityselector == null || ientityselector.a(entity1))) { list.add(entity1); - Entity[] aentity = entity1.at(); + Entity[] aentity = entity1.as(); if (aentity != null) { for (int i1 = 0; i1 < aentity.length; ++i1) { diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java index bf60f4eb51..5b3c821b7d 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -2,10 +2,11 @@ package net.minecraft.server; import java.io.IOException; import java.util.ArrayList; -import java.util.HashSet; +import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -45,6 +46,13 @@ public class ChunkProviderServer implements IChunkProvider { return this.chunks.containsKey(LongHash.toLong(i, j)); // CraftBukkit } + // CraftBukkit start - Change return type to Collection and return the values of our chunk map + public java.util.Collection a() { + // return this.chunkList; + return this.chunks.values(); + // CraftBukkit end + } + public void queueUnload(int i, int j) { if (this.world.worldProvider.e()) { ChunkCoordinates chunkcoordinates = this.world.getSpawn(); @@ -74,7 +82,7 @@ public class ChunkProviderServer implements IChunkProvider { } } - public void a() { + public void b() { Iterator iterator = this.chunks.values().iterator(); // CraftBukkit while (iterator.hasNext()) { @@ -291,7 +299,7 @@ public class ChunkProviderServer implements IChunkProvider { return true; } - public void b() { + public void c() { if (this.f != null) { this.f.b(); } diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java index d5cf88d9c4..a3b75208cf 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -129,7 +129,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { public void a(World world, Chunk chunk) { // CraftBukkit start - "handle" exception try { - world.F(); + world.G(); } catch (ExceptionWorldConflict ex) { ex.printStackTrace(); } diff --git a/src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java b/src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java index 2f5ee94425..da235e5e8f 100644 --- a/src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java +++ b/src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java @@ -167,12 +167,12 @@ public abstract class CommandBlockListenerAbstract implements ICommandListener { } catch (Throwable exception) { if(this instanceof TileEntityCommandListener) { TileEntityCommandListener listener = (TileEntityCommandListener) this; - MinecraftServer.av().log(Level.WARN, String.format("CommandBlock at (%d,%d,%d) failed to handle command", listener.getChunkCoordinates().x, listener.getChunkCoordinates().y, listener.getChunkCoordinates().z), exception); + MinecraftServer.getLogger().log(Level.WARN, String.format("CommandBlock at (%d,%d,%d) failed to handle command", listener.getChunkCoordinates().x, listener.getChunkCoordinates().y, listener.getChunkCoordinates().z), exception); } else if (this instanceof EntityMinecartCommandBlockListener) { EntityMinecartCommandBlockListener listener = (EntityMinecartCommandBlockListener) this; - MinecraftServer.av().log(Level.WARN, String.format("MinecartCommandBlock at (%d,%d,%d) failed to handle command", listener.getChunkCoordinates().x, listener.getChunkCoordinates().y, listener.getChunkCoordinates().z), exception); + MinecraftServer.getLogger().log(Level.WARN, String.format("MinecartCommandBlock at (%d,%d,%d) failed to handle command", listener.getChunkCoordinates().x, listener.getChunkCoordinates().y, listener.getChunkCoordinates().z), exception); } else { - MinecraftServer.av().log(Level.WARN, String.format("Unknown CommandBlock failed to handle command"), exception); + MinecraftServer.getLogger().log(Level.WARN, String.format("Unknown CommandBlock failed to handle command"), exception); } } } diff --git a/src/main/java/net/minecraft/server/Container.java b/src/main/java/net/minecraft/server/Container.java index 1995968572..bc52beb6ce 100644 --- a/src/main/java/net/minecraft/server/Container.java +++ b/src/main/java/net/minecraft/server/Container.java @@ -21,7 +21,7 @@ public abstract class Container { public List b = new ArrayList(); public List c = new ArrayList(); public int windowId; - private int f = -1; + private int dragType = -1; public int g; // CraftBukkit - private -> public private final Set h = new HashSet(); protected List listeners = new ArrayList(); @@ -125,8 +125,8 @@ public abstract class Container { } else if (playerinventory.getCarried() == null) { this.d(); } else if (this.g == 0) { - this.f = b(j); - if (d(this.f)) { + this.dragType = b(j); + if (d(this.dragType)) { this.g = 1; this.h.clear(); } else { @@ -150,15 +150,15 @@ public abstract class Container { if (slot1 != null && a(slot1, playerinventory.getCarried(), true) && slot1.isAllowed(playerinventory.getCarried()) && playerinventory.getCarried().count >= this.h.size() && this.b(slot1)) { ItemStack itemstack2 = itemstack1.cloneItemStack(); - int j1 = slot1.e() ? slot1.getItem().count : 0; + int j1 = slot1.hasItem() ? slot1.getItem().count : 0; - a(this.h, this.f, itemstack2, j1); + a(this.h, this.dragType, itemstack2, j1); if (itemstack2.count > itemstack2.getMaxStackSize()) { itemstack2.count = itemstack2.getMaxStackSize(); } - if (itemstack2.count > slot1.a()) { - itemstack2.count = slot1.a(); + if (itemstack2.count > slot1.getMaxStackSize()) { + itemstack2.count = slot1.getMaxStackSize(); } l -= itemstack2.count - j1; @@ -179,7 +179,7 @@ public abstract class Container { ItemStack oldCursor = playerinventory.getCarried(); playerinventory.setCarried(CraftItemStack.asNMSCopy(newcursor)); - InventoryDragEvent event = new InventoryDragEvent(view, (newcursor.getType() != org.bukkit.Material.AIR ? newcursor : null), CraftItemStack.asBukkitCopy(oldCursor), this.f == 1, eventmap); // Should be dragButton + InventoryDragEvent event = new InventoryDragEvent(view, (newcursor.getType() != org.bukkit.Material.AIR ? newcursor : null), CraftItemStack.asBukkitCopy(oldCursor), this.dragType == 1, eventmap); entityhuman.world.getServer().getPluginManager().callEvent(event); // Whether or not a change was made to the inventory that requires an update. @@ -244,7 +244,7 @@ public abstract class Container { } slot2 = (Slot) this.c.get(i); - if (slot2 != null && slot2.a(entityhuman)) { + if (slot2 != null && slot2.isAllowed(entityhuman)) { itemstack1 = this.b(entityhuman, i); if (itemstack1 != null) { Item item = itemstack1.getItem(); @@ -272,8 +272,8 @@ public abstract class Container { if (itemstack1 == null) { if (itemstack4 != null && slot2.isAllowed(itemstack4)) { k1 = j == 0 ? itemstack4.count : 1; - if (k1 > slot2.a()) { - k1 = slot2.a(); + if (k1 > slot2.getMaxStackSize()) { + k1 = slot2.getMaxStackSize(); } if (itemstack4.count >= k1) { @@ -284,7 +284,7 @@ public abstract class Container { playerinventory.setCarried((ItemStack) null); } } - } else if (slot2.a(entityhuman)) { + } else if (slot2.isAllowed(entityhuman)) { if (itemstack4 == null) { k1 = j == 0 ? itemstack1.count : (itemstack1.count + 1) / 2; itemstack3 = slot2.a(k1); @@ -297,8 +297,8 @@ public abstract class Container { } else if (slot2.isAllowed(itemstack4)) { if (itemstack1.getItem() == itemstack4.getItem() && itemstack1.getData() == itemstack4.getData() && ItemStack.equals(itemstack1, itemstack4)) { k1 = j == 0 ? itemstack4.count : 1; - if (k1 > slot2.a() - itemstack1.count) { - k1 = slot2.a() - itemstack1.count; + if (k1 > slot2.getMaxStackSize() - itemstack1.count) { + k1 = slot2.getMaxStackSize() - itemstack1.count; } if (k1 > itemstack4.getMaxStackSize() - itemstack1.count) { @@ -311,7 +311,7 @@ public abstract class Container { } itemstack1.count += k1; - } else if (itemstack4.count <= slot2.a()) { + } else if (itemstack4.count <= slot2.getMaxStackSize()) { slot2.set(itemstack4); playerinventory.setCarried(itemstack1); } @@ -334,17 +334,17 @@ public abstract class Container { } } else if (k == 2 && j >= 0 && j < 9) { slot2 = (Slot) this.c.get(i); - if (slot2.a(entityhuman)) { + if (slot2.isAllowed(entityhuman)) { itemstack1 = playerinventory.getItem(j); boolean flag = itemstack1 == null || slot2.inventory == playerinventory && slot2.isAllowed(itemstack1); k1 = -1; if (!flag) { - k1 = playerinventory.j(); + k1 = playerinventory.getFirstEmptySlotIndex(); flag |= k1 > -1; } - if (slot2.e() && flag) { + if (slot2.hasItem() && flag) { itemstack3 = slot2.getItem(); playerinventory.setItem(j, itemstack3.cloneItemStack()); if ((slot2.inventory != playerinventory || !slot2.isAllowed(itemstack1)) && itemstack1 != null) { @@ -359,21 +359,21 @@ public abstract class Container { slot2.set(itemstack1); slot2.a(entityhuman, itemstack3); } - } else if (!slot2.e() && itemstack1 != null && slot2.isAllowed(itemstack1)) { + } else if (!slot2.hasItem() && itemstack1 != null && slot2.isAllowed(itemstack1)) { playerinventory.setItem(j, (ItemStack) null); slot2.set(itemstack1); } } } else if (k == 3 && entityhuman.abilities.canInstantlyBuild && playerinventory.getCarried() == null && i >= 0) { slot2 = (Slot) this.c.get(i); - if (slot2 != null && slot2.e()) { + if (slot2 != null && slot2.hasItem()) { itemstack1 = slot2.getItem().cloneItemStack(); itemstack1.count = itemstack1.getMaxStackSize(); playerinventory.setCarried(itemstack1); } } else if (k == 4 && playerinventory.getCarried() == null && i >= 0) { slot2 = (Slot) this.c.get(i); - if (slot2 != null && slot2.e() && slot2.a(entityhuman)) { + if (slot2 != null && slot2.hasItem() && slot2.isAllowed(entityhuman)) { itemstack1 = slot2.a(j == 0 ? 1 : slot2.getItem().count); slot2.a(entityhuman, itemstack1); entityhuman.drop(itemstack1, true); @@ -381,7 +381,7 @@ public abstract class Container { } else if (k == 6 && i >= 0) { slot2 = (Slot) this.c.get(i); itemstack1 = playerinventory.getCarried(); - if (itemstack1 != null && (slot2 == null || !slot2.e() || !slot2.a(entityhuman))) { + if (itemstack1 != null && (slot2 == null || !slot2.hasItem() || !slot2.isAllowed(entityhuman))) { l = j == 0 ? 0 : this.c.size() - 1; k1 = j == 0 ? 1 : -1; @@ -389,7 +389,7 @@ public abstract class Container { for (int i2 = l; i2 >= 0 && i2 < this.c.size() && itemstack1.count < itemstack1.getMaxStackSize(); i2 += k1) { Slot slot3 = (Slot) this.c.get(i2); - if (slot3.e() && a(slot3, itemstack1, true) && slot3.a(entityhuman) && this.a(itemstack1, slot3) && (l1 != 0 || slot3.getItem().count != slot3.getItem().getMaxStackSize())) { + if (slot3.hasItem() && a(slot3, itemstack1, true) && slot3.isAllowed(entityhuman) && this.a(itemstack1, slot3) && (l1 != 0 || slot3.getItem().count != slot3.getItem().getMaxStackSize())) { int j2 = Math.min(itemstack1.getMaxStackSize() - itemstack1.count, slot3.getItem().count); ItemStack itemstack5 = slot3.a(j2); @@ -536,9 +536,9 @@ public abstract class Container { } public static boolean a(Slot slot, ItemStack itemstack, boolean flag) { - boolean flag1 = slot == null || !slot.e(); + boolean flag1 = slot == null || !slot.hasItem(); - if (slot != null && slot.e() && itemstack != null && itemstack.doMaterialsMatch(slot.getItem()) && ItemStack.equals(slot.getItem(), itemstack)) { + if (slot != null && slot.hasItem() && itemstack != null && itemstack.doMaterialsMatch(slot.getItem()) && ItemStack.equals(slot.getItem(), itemstack)) { int i = flag ? 0 : itemstack.count; flag1 |= slot.getItem().count + i <= itemstack.getMaxStackSize(); diff --git a/src/main/java/net/minecraft/server/ContainerAnvil.java b/src/main/java/net/minecraft/server/ContainerAnvil.java index 24b2d7e257..af8847f137 100644 --- a/src/main/java/net/minecraft/server/ContainerAnvil.java +++ b/src/main/java/net/minecraft/server/ContainerAnvil.java @@ -329,7 +329,7 @@ public class ContainerAnvil extends Container { ItemStack itemstack = null; Slot slot = (Slot) this.c.get(i); - if (slot != null && slot.e()) { + if (slot != null && slot.hasItem()) { ItemStack itemstack1 = slot.getItem(); itemstack = itemstack1.cloneItemStack(); @@ -365,7 +365,7 @@ public class ContainerAnvil extends Container { public void a(String s) { this.n = s; - if (this.getSlot(2).e()) { + if (this.getSlot(2).hasItem()) { ItemStack itemstack = this.getSlot(2).getItem(); if (StringUtils.isBlank(s)) { diff --git a/src/main/java/net/minecraft/server/ContainerBeacon.java b/src/main/java/net/minecraft/server/ContainerBeacon.java index 278b3b760a..b7fa7b4278 100644 --- a/src/main/java/net/minecraft/server/ContainerBeacon.java +++ b/src/main/java/net/minecraft/server/ContainerBeacon.java @@ -58,7 +58,7 @@ public class ContainerBeacon extends Container { ItemStack itemstack = null; Slot slot = (Slot) this.c.get(i); - if (slot != null && slot.e()) { + if (slot != null && slot.hasItem()) { ItemStack itemstack1 = slot.getItem(); itemstack = itemstack1.cloneItemStack(); @@ -68,7 +68,7 @@ public class ContainerBeacon extends Container { } slot.a(itemstack1, itemstack); - } else if (!this.f.e() && this.f.isAllowed(itemstack1) && itemstack1.count == 1) { + } else if (!this.f.hasItem() && this.f.isAllowed(itemstack1) && itemstack1.count == 1) { if (!this.a(itemstack1, 0, 1, false)) { return null; } diff --git a/src/main/java/net/minecraft/server/ContainerBrewingStand.java b/src/main/java/net/minecraft/server/ContainerBrewingStand.java index b3b68d0d24..903489aeb3 100644 --- a/src/main/java/net/minecraft/server/ContainerBrewingStand.java +++ b/src/main/java/net/minecraft/server/ContainerBrewingStand.java @@ -64,12 +64,12 @@ public class ContainerBrewingStand extends Container { ItemStack itemstack = null; Slot slot = (Slot) this.c.get(i); - if (slot != null && slot.e()) { + if (slot != null && slot.hasItem()) { ItemStack itemstack1 = slot.getItem(); itemstack = itemstack1.cloneItemStack(); if ((i < 0 || i > 2) && i != 3) { - if (!this.f.e() && this.f.isAllowed(itemstack1)) { + if (!this.f.hasItem() && this.f.isAllowed(itemstack1)) { if (!this.a(itemstack1, 3, 4, false)) { return null; } diff --git a/src/main/java/net/minecraft/server/ContainerChest.java b/src/main/java/net/minecraft/server/ContainerChest.java index 889e5d5ddc..4e1fcdc3f0 100644 --- a/src/main/java/net/minecraft/server/ContainerChest.java +++ b/src/main/java/net/minecraft/server/ContainerChest.java @@ -71,7 +71,7 @@ public class ContainerChest extends Container { ItemStack itemstack = null; Slot slot = (Slot) this.c.get(i); - if (slot != null && slot.e()) { + if (slot != null && slot.hasItem()) { ItemStack itemstack1 = slot.getItem(); itemstack = itemstack1.cloneItemStack(); diff --git a/src/main/java/net/minecraft/server/ContainerDispenser.java b/src/main/java/net/minecraft/server/ContainerDispenser.java index 9cafc14e05..32187ec1ee 100644 --- a/src/main/java/net/minecraft/server/ContainerDispenser.java +++ b/src/main/java/net/minecraft/server/ContainerDispenser.java @@ -49,7 +49,7 @@ public class ContainerDispenser extends Container { ItemStack itemstack = null; Slot slot = (Slot) this.c.get(i); - if (slot != null && slot.e()) { + if (slot != null && slot.hasItem()) { ItemStack itemstack1 = slot.getItem(); itemstack = itemstack1.cloneItemStack(); diff --git a/src/main/java/net/minecraft/server/ContainerEnchantTable.java b/src/main/java/net/minecraft/server/ContainerEnchantTable.java index cc36e2bb01..528fbc97f8 100644 --- a/src/main/java/net/minecraft/server/ContainerEnchantTable.java +++ b/src/main/java/net/minecraft/server/ContainerEnchantTable.java @@ -226,7 +226,7 @@ public class ContainerEnchantTable extends Container { ItemStack itemstack = null; Slot slot = (Slot) this.c.get(i); - if (slot != null && slot.e()) { + if (slot != null && slot.hasItem()) { ItemStack itemstack1 = slot.getItem(); itemstack = itemstack1.cloneItemStack(); @@ -235,7 +235,7 @@ public class ContainerEnchantTable extends Container { return null; } } else { - if (((Slot) this.c.get(0)).e() || !((Slot) this.c.get(0)).isAllowed(itemstack1)) { + if (((Slot) this.c.get(0)).hasItem() || !((Slot) this.c.get(0)).isAllowed(itemstack1)) { return null; } diff --git a/src/main/java/net/minecraft/server/ContainerFurnace.java b/src/main/java/net/minecraft/server/ContainerFurnace.java index 49757ae46b..2438528281 100644 --- a/src/main/java/net/minecraft/server/ContainerFurnace.java +++ b/src/main/java/net/minecraft/server/ContainerFurnace.java @@ -87,7 +87,7 @@ public class ContainerFurnace extends Container { ItemStack itemstack = null; Slot slot = (Slot) this.c.get(i); - if (slot != null && slot.e()) { + if (slot != null && slot.hasItem()) { ItemStack itemstack1 = slot.getItem(); itemstack = itemstack1.cloneItemStack(); diff --git a/src/main/java/net/minecraft/server/ContainerHopper.java b/src/main/java/net/minecraft/server/ContainerHopper.java index 5c7450ba7d..dca97a4edb 100644 --- a/src/main/java/net/minecraft/server/ContainerHopper.java +++ b/src/main/java/net/minecraft/server/ContainerHopper.java @@ -56,7 +56,7 @@ public class ContainerHopper extends Container { ItemStack itemstack = null; Slot slot = (Slot) this.c.get(i); - if (slot != null && slot.e()) { + if (slot != null && slot.hasItem()) { ItemStack itemstack1 = slot.getItem(); itemstack = itemstack1.cloneItemStack(); diff --git a/src/main/java/net/minecraft/server/ContainerHorse.java b/src/main/java/net/minecraft/server/ContainerHorse.java index 0fc3b73ae0..4a0cbefa8b 100644 --- a/src/main/java/net/minecraft/server/ContainerHorse.java +++ b/src/main/java/net/minecraft/server/ContainerHorse.java @@ -60,14 +60,14 @@ public class ContainerHorse extends Container { } public boolean a(EntityHuman entityhuman) { - return this.a.a(entityhuman) && this.f.isAlive() && this.f.d(entityhuman) < 8.0F; + return this.a.a(entityhuman) && this.f.isAlive() && this.f.e(entityhuman) < 8.0F; } public ItemStack b(EntityHuman entityhuman, int i) { ItemStack itemstack = null; Slot slot = (Slot) this.c.get(i); - if (slot != null && slot.e()) { + if (slot != null && slot.hasItem()) { ItemStack itemstack1 = slot.getItem(); itemstack = itemstack1.cloneItemStack(); @@ -75,7 +75,7 @@ public class ContainerHorse extends Container { if (!this.a(itemstack1, this.a.getSize(), this.c.size(), true)) { return null; } - } else if (this.getSlot(1).isAllowed(itemstack1) && !this.getSlot(1).e()) { + } else if (this.getSlot(1).isAllowed(itemstack1) && !this.getSlot(1).hasItem()) { if (!this.a(itemstack1, 1, 2, false)) { return null; } diff --git a/src/main/java/net/minecraft/server/ContainerMerchant.java b/src/main/java/net/minecraft/server/ContainerMerchant.java index 444ec54703..97f97f3ee6 100644 --- a/src/main/java/net/minecraft/server/ContainerMerchant.java +++ b/src/main/java/net/minecraft/server/ContainerMerchant.java @@ -73,7 +73,7 @@ public class ContainerMerchant extends Container { ItemStack itemstack = null; Slot slot = (Slot) this.c.get(i); - if (slot != null && slot.e()) { + if (slot != null && slot.hasItem()) { ItemStack itemstack1 = slot.getItem(); itemstack = itemstack1.cloneItemStack(); diff --git a/src/main/java/net/minecraft/server/ContainerPlayer.java b/src/main/java/net/minecraft/server/ContainerPlayer.java index 08fb2be0ec..587ee26173 100644 --- a/src/main/java/net/minecraft/server/ContainerPlayer.java +++ b/src/main/java/net/minecraft/server/ContainerPlayer.java @@ -87,7 +87,7 @@ public class ContainerPlayer extends Container { ItemStack itemstack = null; Slot slot = (Slot) this.c.get(i); - if (slot != null && slot.e()) { + if (slot != null && slot.hasItem()) { ItemStack itemstack1 = slot.getItem(); itemstack = itemstack1.cloneItemStack(); @@ -105,7 +105,7 @@ public class ContainerPlayer extends Container { if (!this.a(itemstack1, 9, 45, false)) { return null; } - } else if (itemstack.getItem() instanceof ItemArmor && !((Slot) this.c.get(5 + ((ItemArmor) itemstack.getItem()).b)).e()) { + } else if (itemstack.getItem() instanceof ItemArmor && !((Slot) this.c.get(5 + ((ItemArmor) itemstack.getItem()).b)).hasItem()) { int j = 5 + ((ItemArmor) itemstack.getItem()).b; if (!this.a(itemstack1, j, j + 1, false)) { diff --git a/src/main/java/net/minecraft/server/ContainerWorkbench.java b/src/main/java/net/minecraft/server/ContainerWorkbench.java index 86997a7ffb..37c6105414 100644 --- a/src/main/java/net/minecraft/server/ContainerWorkbench.java +++ b/src/main/java/net/minecraft/server/ContainerWorkbench.java @@ -89,7 +89,7 @@ public class ContainerWorkbench extends Container { ItemStack itemstack = null; Slot slot = (Slot) this.c.get(i); - if (slot != null && slot.e()) { + if (slot != null && slot.hasItem()) { ItemStack itemstack1 = slot.getItem(); itemstack = itemstack1.cloneItemStack(); diff --git a/src/main/java/net/minecraft/server/ControllerLook.java b/src/main/java/net/minecraft/server/ControllerLook.java index a4b4ba7e50..f1e8b3dcee 100644 --- a/src/main/java/net/minecraft/server/ControllerLook.java +++ b/src/main/java/net/minecraft/server/ControllerLook.java @@ -53,20 +53,20 @@ public class ControllerLook { // CraftBukkit end this.a.pitch = this.a(this.a.pitch, f1, this.c); - this.a.aP = this.a(this.a.aP, f, this.b); + this.a.aO = this.a(this.a.aO, f, this.b); } else { - this.a.aP = this.a(this.a.aP, this.a.aN, 10.0F); + this.a.aO = this.a(this.a.aO, this.a.aM, 10.0F); } - float f2 = MathHelper.g(this.a.aP - this.a.aN); + float f2 = MathHelper.g(this.a.aO - this.a.aM); if (!this.a.getNavigation().g()) { if (f2 < -75.0F) { - this.a.aP = this.a.aN - 75.0F; + this.a.aO = this.a.aM - 75.0F; } if (f2 > 75.0F) { - this.a.aP = this.a.aN + 75.0F; + this.a.aO = this.a.aM + 75.0F; } } } diff --git a/src/main/java/net/minecraft/server/CrashReport.java b/src/main/java/net/minecraft/server/CrashReport.java index aa9e9f71b2..7e06002722 100644 --- a/src/main/java/net/minecraft/server/CrashReport.java +++ b/src/main/java/net/minecraft/server/CrashReport.java @@ -181,9 +181,14 @@ public class CrashReport { StackTraceElement[] astacktraceelement = this.c.getStackTrace(); StackTraceElement stacktraceelement = null; StackTraceElement stacktraceelement1 = null; + int k = astacktraceelement.length - j; - if (astacktraceelement != null && astacktraceelement.length - j < astacktraceelement.length) { - stacktraceelement = astacktraceelement[astacktraceelement.length - j]; + if (k < 0) { + System.out.println("Negative index in crash report handler (" + astacktraceelement.length + "/" + j + ")"); + } + + if (astacktraceelement != null && 0 <= k && k < astacktraceelement.length) { + stacktraceelement = astacktraceelement[k]; if (astacktraceelement.length + 1 - j < astacktraceelement.length) { stacktraceelement1 = astacktraceelement[astacktraceelement.length + 1 - j]; } @@ -194,7 +199,7 @@ public class CrashReport { CrashReportSystemDetails crashreportsystemdetails1 = (CrashReportSystemDetails) this.e.get(this.e.size() - 1); crashreportsystemdetails1.b(j); - } else if (astacktraceelement != null && astacktraceelement.length >= j) { + } else if (astacktraceelement != null && astacktraceelement.length >= j && 0 <= k && k < astacktraceelement.length) { this.h = new StackTraceElement[astacktraceelement.length - j]; System.arraycopy(astacktraceelement, 0, this.h, 0, this.h.length); } else { @@ -207,7 +212,7 @@ public class CrashReport { } private static String i() { - String[] astring = new String[] { "Who set us up the TNT?", "Everything\'s going to plan. No, really, that was supposed to happen.", "Uh... Did I do that?", "Oops.", "Why did you do that?", "I feel sad now :(", "My bad.", "I\'m sorry, Dave.", "I let you down. Sorry :(", "On the bright side, I bought you a teddy bear!", "Daisy, daisy...", "Oh - I know what I did wrong!", "Hey, that tickles! Hehehe!", "I blame Dinnerbone.", "You should try our sister game, Minceraft!", "Don\'t be sad. I\'ll do better next time, I promise!", "Don\'t be sad, have a hug! <3", "I just don\'t know what went wrong :(", "Shall we play a game?", "Quite honestly, I wouldn\'t worry myself about that.", "I bet Cylons wouldn\'t have this problem.", "Sorry :(", "Surprise! Haha. Well, this is awkward.", "Would you like a cupcake?", "Hi. I\'m Minecraft, and I\'m a crashaholic.", "Ooh. Shiny.", "This doesn\'t make any sense!", "Why is it breaking :(", "Don\'t do that.", "Ouch. That hurt :(", "You\'re mean.", "This is a token for 1 free hug. Redeem at your nearest Mojangsta: [~~HUG~~]", "There are four lights!"}; + String[] astring = new String[] { "Who set us up the TNT?", "Everything\'s going to plan. No, really, that was supposed to happen.", "Uh... Did I do that?", "Oops.", "Why did you do that?", "I feel sad now :(", "My bad.", "I\'m sorry, Dave.", "I let you down. Sorry :(", "On the bright side, I bought you a teddy bear!", "Daisy, daisy...", "Oh - I know what I did wrong!", "Hey, that tickles! Hehehe!", "I blame Dinnerbone.", "You should try our sister game, Minceraft!", "Don\'t be sad. I\'ll do better next time, I promise!", "Don\'t be sad, have a hug! <3", "I just don\'t know what went wrong :(", "Shall we play a game?", "Quite honestly, I wouldn\'t worry myself about that.", "I bet Cylons wouldn\'t have this problem.", "Sorry :(", "Surprise! Haha. Well, this is awkward.", "Would you like a cupcake?", "Hi. I\'m Minecraft, and I\'m a crashaholic.", "Ooh. Shiny.", "This doesn\'t make any sense!", "Why is it breaking :(", "Don\'t do that.", "Ouch. That hurt :(", "You\'re mean.", "This is a token for 1 free hug. Redeem at your nearest Mojangsta: [~~HUG~~]", "There are four lights!", "But it works on my machine."}; try { return astring[(int) (System.nanoTime() % (long) astring.length)]; diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java index 30ce5f488b..1b05fbf400 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -67,14 +67,14 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer System.setErr(new PrintStream(new LoggerOutputStream(logger, Level.WARN), true)); // CraftBukkit end - h.info("Starting minecraft server version 1.7.2"); + h.info("Starting minecraft server version 1.7.5"); if (Runtime.getRuntime().maxMemory() / 1024L / 1024L < 512L) { h.warn("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\""); } h.info("Loading properties"); this.propertyManager = new PropertyManager(this.options); // CraftBukkit - CLI argument support - if (this.L()) { + if (this.M()) { this.c("127.0.0.1"); } else { this.setOnlineMode(this.propertyManager.getBoolean("online-mode", true)); @@ -88,7 +88,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer this.setTexturePack(this.propertyManager.getString("resource-pack", "")); this.setMotd(this.propertyManager.getString("motd", "A Minecraft Server")); this.setForceGamemode(this.propertyManager.getBoolean("force-gamemode", false)); - this.d(this.propertyManager.getInt("player-idle-timeout", 0)); + this.setIdleTimeout(this.propertyManager.getInt("player-idle-timeout", 0)); if (this.propertyManager.getInt("difficulty", 1) < 0) { this.propertyManager.a("difficulty", Integer.valueOf(0)); } else if (this.propertyManager.getInt("difficulty", 1) > 3) { @@ -106,16 +106,16 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer inetaddress = InetAddress.getByName(this.getServerIp()); } - if (this.J() < 0) { + if (this.K() < 0) { this.setPort(this.propertyManager.getInt("server-port", 25565)); } h.info("Generating keypair"); this.a(MinecraftEncryption.b()); - h.info("Starting Minecraft server on " + (this.getServerIp().length() == 0 ? "*" : this.getServerIp()) + ":" + this.J()); + h.info("Starting Minecraft server on " + (this.getServerIp().length() == 0 ? "*" : this.getServerIp()) + ":" + this.K()); try { - this.ag().a(inetaddress, this.J()); + this.ah().a(inetaddress, this.K()); } catch (Throwable ioexception) { // CraftBukkit - IOException -> Throwable h.warn("**** FAILED TO BIND TO PORT!"); h.warn("The exception was: {}", new Object[] { ioexception.toString()}); @@ -136,7 +136,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer this.convertable = new WorldLoaderServer(server.getWorldContainer()); // CraftBukkit - moved from MinecraftServer constructor long j = System.nanoTime(); - if (this.M() == null) { + if (this.N() == null) { this.k(this.propertyManager.getString("level-name", "world")); } @@ -163,7 +163,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer worldtype = WorldType.NORMAL; } - this.ar(); + this.as(); this.getEnableCommandBlock(); this.l(); this.getSnooperEnabled(); @@ -172,7 +172,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer this.c(MathHelper.a(this.getMaxBuildHeight(), 64, 256)); this.propertyManager.a("max-build-height", Integer.valueOf(this.getMaxBuildHeight())); h.info("Preparing level \"" + this.M() + "\""); - this.a(this.M(), this.M(), k, worldtype, s2); + this.a(this.N(), this.N(), k, worldtype, s2); long i1 = System.nanoTime() - j; String s3 = String.format("%.3fs", new Object[] { Double.valueOf((double) i1 / 1.0E9D)}); @@ -225,7 +225,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer protected void a(CrashReport crashreport) { while (this.isRunning()) { - this.aw(); + this.ax(); try { Thread.sleep(10L); @@ -242,13 +242,13 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer return crashreport; } - protected void s() { + protected void t() { System.exit(0); } - public void u() { // CraftBukkit - protected -> public - super.u(); - this.aw(); + public void v() { // CraftBukkit - protected -> public + super.v(); + this.ax(); } public boolean getAllowNether() { @@ -260,8 +260,8 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer } public void a(MojangStatisticsGenerator mojangstatisticsgenerator) { - mojangstatisticsgenerator.a("whitelist_enabled", Boolean.valueOf(this.ax().getHasWhitelist())); - mojangstatisticsgenerator.a("whitelist_count", Integer.valueOf(this.ax().getWhitelisted().size())); + mojangstatisticsgenerator.a("whitelist_enabled", Boolean.valueOf(this.ay().getHasWhitelist())); + mojangstatisticsgenerator.a("whitelist_count", Integer.valueOf(this.ay().getWhitelisted().size())); super.a(mojangstatisticsgenerator); } @@ -273,7 +273,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer this.i.add(new ServerCommand(s, icommandlistener)); } - public void aw() { + public void ax() { while (!this.i.isEmpty()) { ServerCommand servercommand = (ServerCommand) this.i.remove(0); @@ -288,11 +288,11 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer } } - public boolean V() { + public boolean W() { return true; } - public DedicatedPlayerList ax() { + public DedicatedPlayerList ay() { return (DedicatedPlayerList) super.getPlayerList(); } @@ -322,12 +322,12 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer return file1 != null ? file1.getAbsolutePath() : "No settings file"; } - public void ay() { + public void az() { ServerGUI.a(this); this.o = true; } - public boolean ai() { + public boolean aj() { return this.o; } @@ -346,9 +346,9 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer public boolean a(World world, int i, int j, int k, EntityHuman entityhuman) { if (world.worldProvider.dimension != 0) { return false; - } else if (this.ax().getOPs().isEmpty()) { + } else if (this.ay().getOPs().isEmpty()) { return false; - } else if (this.ax().isOp(entityhuman.getName())) { + } else if (this.ay().isOp(entityhuman.getName())) { return false; } else if (this.getSpawnProtection() <= 0) { return false; @@ -366,21 +366,24 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer return this.propertyManager.getInt("op-permission-level", 4); } - public void d(int i) { - super.d(i); + public void setIdleTimeout(int i) { + super.setIdleTimeout(i); this.propertyManager.a("player-idle-timeout", Integer.valueOf(i)); this.a(); } - public boolean ar() { + public boolean m() { + return this.propertyManager.getBoolean("broadcast-rcon-to-ops", true); + } + + public boolean as() { return this.propertyManager.getBoolean("announce-player-achievements", true); } - public PlayerList getPlayerList() { - return this.ax(); + return this.ay(); } - static Logger az() { + static Logger aA() { return h; } } diff --git a/src/main/java/net/minecraft/server/DispenseBehaviorArmor.java b/src/main/java/net/minecraft/server/DispenseBehaviorArmor.java index 45efc9cd99..9df12c0f62 100644 --- a/src/main/java/net/minecraft/server/DispenseBehaviorArmor.java +++ b/src/main/java/net/minecraft/server/DispenseBehaviorArmor.java @@ -13,10 +13,10 @@ final class DispenseBehaviorArmor extends DispenseBehaviorItem { protected ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) { EnumFacing enumfacing = BlockDispenser.b(isourceblock.h()); - int i = isourceblock.getBlockX() + enumfacing.c(); - int j = isourceblock.getBlockY() + enumfacing.d(); - int k = isourceblock.getBlockZ() + enumfacing.e(); - AxisAlignedBB axisalignedbb = AxisAlignedBB.a().a((double) i, (double) j, (double) k, (double) (i + 1), (double) (j + 1), (double) (k + 1)); + int i = isourceblock.getBlockX() + enumfacing.getAdjacentX(); + int j = isourceblock.getBlockY() + enumfacing.getAdjacentY(); + int k = isourceblock.getBlockZ() + enumfacing.getAdjacentZ(); + AxisAlignedBB axisalignedbb = AxisAlignedBB.a((double) i, (double) j, (double) k, (double) (i + 1), (double) (j + 1), (double) (k + 1)); List list = isourceblock.k().a(EntityLiving.class, axisalignedbb, (IEntitySelector) (new EntitySelectorEquipable(itemstack))); if (list.size() > 0) { @@ -44,7 +44,7 @@ final class DispenseBehaviorArmor extends DispenseBehaviorItem { itemstack.count++; // Chain to handler for new item ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); - IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(eventStack.getItem()); + IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.get(eventStack.getItem()); if (idispensebehavior != IDispenseBehavior.a && idispensebehavior != this) { idispensebehavior.a(isourceblock, eventStack); return itemstack; diff --git a/src/main/java/net/minecraft/server/DispenseBehaviorBoat.java b/src/main/java/net/minecraft/server/DispenseBehaviorBoat.java index cc0b34b5c8..5bd6ec7510 100644 --- a/src/main/java/net/minecraft/server/DispenseBehaviorBoat.java +++ b/src/main/java/net/minecraft/server/DispenseBehaviorBoat.java @@ -14,12 +14,12 @@ final class DispenseBehaviorBoat extends DispenseBehaviorItem { public ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) { EnumFacing enumfacing = BlockDispenser.b(isourceblock.h()); World world = isourceblock.k(); - double d0 = isourceblock.getX() + (double) ((float) enumfacing.c() * 1.125F); - double d1 = isourceblock.getY() + (double) ((float) enumfacing.d() * 1.125F); - double d2 = isourceblock.getZ() + (double) ((float) enumfacing.e() * 1.125F); - int i = isourceblock.getBlockX() + enumfacing.c(); - int j = isourceblock.getBlockY() + enumfacing.d(); - int k = isourceblock.getBlockZ() + enumfacing.e(); + double d0 = isourceblock.getX() + (double) ((float) enumfacing.getAdjacentX() * 1.125F); + double d1 = isourceblock.getY() + (double) ((float) enumfacing.getAdjacentY() * 1.125F); + double d2 = isourceblock.getZ() + (double) ((float) enumfacing.getAdjacentZ() * 1.125F); + int i = isourceblock.getBlockX() + enumfacing.getAdjacentX(); + int j = isourceblock.getBlockY() + enumfacing.getAdjacentY(); + int k = isourceblock.getBlockZ() + enumfacing.getAdjacentZ(); Material material = world.getType(i, j, k).getMaterial(); double d3; @@ -52,7 +52,7 @@ final class DispenseBehaviorBoat extends DispenseBehaviorItem { itemstack.count++; // Chain to handler for new item ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); - IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(eventStack.getItem()); + IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.get(eventStack.getItem()); if (idispensebehavior != IDispenseBehavior.a && idispensebehavior != this) { idispensebehavior.a(isourceblock, eventStack); return itemstack; diff --git a/src/main/java/net/minecraft/server/DispenseBehaviorBonemeal.java b/src/main/java/net/minecraft/server/DispenseBehaviorBonemeal.java index 92b3789f7e..b547bc970a 100644 --- a/src/main/java/net/minecraft/server/DispenseBehaviorBonemeal.java +++ b/src/main/java/net/minecraft/server/DispenseBehaviorBonemeal.java @@ -15,9 +15,9 @@ final class DispenseBehaviorBonemeal extends DispenseBehaviorItem { if (itemstack.getData() == 15) { EnumFacing enumfacing = BlockDispenser.b(isourceblock.h()); World world = isourceblock.k(); - int i = isourceblock.getBlockX() + enumfacing.c(); - int j = isourceblock.getBlockY() + enumfacing.d(); - int k = isourceblock.getBlockZ() + enumfacing.e(); + int i = isourceblock.getBlockX() + enumfacing.getAdjacentX(); + int j = isourceblock.getBlockY() + enumfacing.getAdjacentY(); + int k = isourceblock.getBlockZ() + enumfacing.getAdjacentZ(); // CraftBukkit start org.bukkit.block.Block block = world.getWorld().getBlockAt(isourceblock.getBlockX(), isourceblock.getBlockY(), isourceblock.getBlockZ()); @@ -35,7 +35,7 @@ final class DispenseBehaviorBonemeal extends DispenseBehaviorItem { if (!event.getItem().equals(craftItem)) { // Chain to handler for new item ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); - IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(eventStack.getItem()); + IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.get(eventStack.getItem()); if (idispensebehavior != IDispenseBehavior.a && idispensebehavior != this) { idispensebehavior.a(isourceblock, eventStack); return itemstack; diff --git a/src/main/java/net/minecraft/server/DispenseBehaviorEmptyBucket.java b/src/main/java/net/minecraft/server/DispenseBehaviorEmptyBucket.java index 04693a5515..d7decfced6 100644 --- a/src/main/java/net/minecraft/server/DispenseBehaviorEmptyBucket.java +++ b/src/main/java/net/minecraft/server/DispenseBehaviorEmptyBucket.java @@ -14,9 +14,9 @@ final class DispenseBehaviorEmptyBucket extends DispenseBehaviorItem { public ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) { EnumFacing enumfacing = BlockDispenser.b(isourceblock.h()); World world = isourceblock.k(); - int i = isourceblock.getBlockX() + enumfacing.c(); - int j = isourceblock.getBlockY() + enumfacing.d(); - int k = isourceblock.getBlockZ() + enumfacing.e(); + int i = isourceblock.getBlockX() + enumfacing.getAdjacentX(); + int j = isourceblock.getBlockY() + enumfacing.getAdjacentY(); + int k = isourceblock.getBlockZ() + enumfacing.getAdjacentZ(); Material material = world.getType(i, j, k).getMaterial(); int l = world.getData(i, j, k); Item item; @@ -47,7 +47,7 @@ final class DispenseBehaviorEmptyBucket extends DispenseBehaviorItem { if (!event.getItem().equals(craftItem)) { // Chain to handler for new item ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); - IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(eventStack.getItem()); + IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.get(eventStack.getItem()); if (idispensebehavior != IDispenseBehavior.a && idispensebehavior != this) { idispensebehavior.a(isourceblock, eventStack); return itemstack; diff --git a/src/main/java/net/minecraft/server/DispenseBehaviorFilledBucket.java b/src/main/java/net/minecraft/server/DispenseBehaviorFilledBucket.java index a1a714de29..4a3691a11c 100644 --- a/src/main/java/net/minecraft/server/DispenseBehaviorFilledBucket.java +++ b/src/main/java/net/minecraft/server/DispenseBehaviorFilledBucket.java @@ -20,9 +20,9 @@ final class DispenseBehaviorFilledBucket extends DispenseBehaviorItem { // CraftBukkit start World world = isourceblock.k(); - int x = i + enumfacing.c(); - int y = j + enumfacing.d(); - int z = k + enumfacing.e(); + int x = i + enumfacing.getAdjacentX(); + int y = j + enumfacing.getAdjacentY(); + int z = k + enumfacing.getAdjacentZ(); if (world.isEmpty(x, y, z) || !world.getType(x, y, z).getMaterial().isBuildable()) { org.bukkit.block.Block block = world.getWorld().getBlockAt(i, j, k); CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack); @@ -39,7 +39,7 @@ final class DispenseBehaviorFilledBucket extends DispenseBehaviorItem { if (!event.getItem().equals(craftItem)) { // Chain to handler for new item ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); - IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(eventStack.getItem()); + IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.get(eventStack.getItem()); if (idispensebehavior != IDispenseBehavior.a && idispensebehavior != this) { idispensebehavior.a(isourceblock, eventStack); return itemstack; @@ -50,7 +50,7 @@ final class DispenseBehaviorFilledBucket extends DispenseBehaviorItem { } // CraftBukkit end - if (itembucket.a(isourceblock.k(), i + enumfacing.c(), j + enumfacing.d(), k + enumfacing.e())) { + if (itembucket.a(isourceblock.k(), i + enumfacing.getAdjacentX(), j + enumfacing.getAdjacentY(), k + enumfacing.getAdjacentZ())) { // CraftBukkit start - Handle stacked buckets Item item = Items.BUCKET; if (--itemstack.count == 0) { diff --git a/src/main/java/net/minecraft/server/DispenseBehaviorFireball.java b/src/main/java/net/minecraft/server/DispenseBehaviorFireball.java index 0fd9487bd3..d16f035f7a 100644 --- a/src/main/java/net/minecraft/server/DispenseBehaviorFireball.java +++ b/src/main/java/net/minecraft/server/DispenseBehaviorFireball.java @@ -14,14 +14,14 @@ final class DispenseBehaviorFireball extends DispenseBehaviorItem { public ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) { EnumFacing enumfacing = BlockDispenser.b(isourceblock.h()); IPosition iposition = BlockDispenser.a(isourceblock); - double d0 = iposition.getX() + (double) ((float) enumfacing.c() * 0.3F); - double d1 = iposition.getY() + (double) ((float) enumfacing.c() * 0.3F); - double d2 = iposition.getZ() + (double) ((float) enumfacing.e() * 0.3F); + double d0 = iposition.getX() + (double) ((float) enumfacing.getAdjacentX() * 0.3F); + double d1 = iposition.getY() + (double) ((float) enumfacing.getAdjacentY() * 0.3F); + double d2 = iposition.getZ() + (double) ((float) enumfacing.getAdjacentZ() * 0.3F); World world = isourceblock.k(); Random random = world.random; - double d3 = random.nextGaussian() * 0.05D + (double) enumfacing.c(); - double d4 = random.nextGaussian() * 0.05D + (double) enumfacing.d(); - double d5 = random.nextGaussian() * 0.05D + (double) enumfacing.e(); + double d3 = random.nextGaussian() * 0.05D + (double) enumfacing.getAdjacentX(); + double d4 = random.nextGaussian() * 0.05D + (double) enumfacing.getAdjacentY(); + double d5 = random.nextGaussian() * 0.05D + (double) enumfacing.getAdjacentZ(); // CraftBukkit start ItemStack itemstack1 = itemstack.a(1); @@ -42,7 +42,7 @@ final class DispenseBehaviorFireball extends DispenseBehaviorItem { itemstack.count++; // Chain to handler for new item ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); - IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(eventStack.getItem()); + IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.get(eventStack.getItem()); if (idispensebehavior != IDispenseBehavior.a && idispensebehavior != this) { idispensebehavior.a(isourceblock, eventStack); return itemstack; diff --git a/src/main/java/net/minecraft/server/DispenseBehaviorFireworks.java b/src/main/java/net/minecraft/server/DispenseBehaviorFireworks.java index bb66cb02e1..09a0842baf 100644 --- a/src/main/java/net/minecraft/server/DispenseBehaviorFireworks.java +++ b/src/main/java/net/minecraft/server/DispenseBehaviorFireworks.java @@ -11,9 +11,9 @@ final class DispenseBehaviorFireworks extends DispenseBehaviorItem { public ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) { EnumFacing enumfacing = BlockDispenser.b(isourceblock.h()); - double d0 = isourceblock.getX() + (double) enumfacing.c(); + double d0 = isourceblock.getX() + (double) enumfacing.getAdjacentX(); double d1 = (double) ((float) isourceblock.getBlockY() + 0.2F); - double d2 = isourceblock.getZ() + (double) enumfacing.e(); + double d2 = isourceblock.getZ() + (double) enumfacing.getAdjacentZ(); // CraftBukkit start World world = isourceblock.k(); @@ -35,7 +35,7 @@ final class DispenseBehaviorFireworks extends DispenseBehaviorItem { itemstack.count++; // Chain to handler for new item ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); - IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(eventStack.getItem()); + IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.get(eventStack.getItem()); if (idispensebehavior != IDispenseBehavior.a && idispensebehavior != this) { idispensebehavior.a(isourceblock, eventStack); return itemstack; diff --git a/src/main/java/net/minecraft/server/DispenseBehaviorFlintAndSteel.java b/src/main/java/net/minecraft/server/DispenseBehaviorFlintAndSteel.java index 28f53bfe1a..c4bbd6b373 100644 --- a/src/main/java/net/minecraft/server/DispenseBehaviorFlintAndSteel.java +++ b/src/main/java/net/minecraft/server/DispenseBehaviorFlintAndSteel.java @@ -14,9 +14,9 @@ final class DispenseBehaviorFlintAndSteel extends DispenseBehaviorItem { protected ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) { EnumFacing enumfacing = BlockDispenser.b(isourceblock.h()); World world = isourceblock.k(); - int i = isourceblock.getBlockX() + enumfacing.c(); - int j = isourceblock.getBlockY() + enumfacing.d(); - int k = isourceblock.getBlockZ() + enumfacing.e(); + int i = isourceblock.getBlockX() + enumfacing.getAdjacentX(); + int j = isourceblock.getBlockY() + enumfacing.getAdjacentY(); + int k = isourceblock.getBlockZ() + enumfacing.getAdjacentZ(); // CraftBukkit start org.bukkit.block.Block block = world.getWorld().getBlockAt(isourceblock.getBlockX(), isourceblock.getBlockY(), isourceblock.getBlockZ()); @@ -34,7 +34,7 @@ final class DispenseBehaviorFlintAndSteel extends DispenseBehaviorItem { if (!event.getItem().equals(craftItem)) { // Chain to handler for new item ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); - IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(eventStack.getItem()); + IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.get(eventStack.getItem()); if (idispensebehavior != IDispenseBehavior.a && idispensebehavior != this) { idispensebehavior.a(isourceblock, eventStack); return itemstack; diff --git a/src/main/java/net/minecraft/server/DispenseBehaviorItem.java b/src/main/java/net/minecraft/server/DispenseBehaviorItem.java index 14ca919270..e7196db0fe 100644 --- a/src/main/java/net/minecraft/server/DispenseBehaviorItem.java +++ b/src/main/java/net/minecraft/server/DispenseBehaviorItem.java @@ -41,9 +41,9 @@ public class DispenseBehaviorItem implements IDispenseBehavior { EntityItem entityitem = new EntityItem(world, d0, d1 - 0.3D, d2, itemstack); double d3 = world.random.nextDouble() * 0.1D + 0.2D; - entityitem.motX = (double) enumfacing.c() * d3; + entityitem.motX = (double) enumfacing.getAdjacentX() * d3; entityitem.motY = 0.20000000298023224D; - entityitem.motZ = (double) enumfacing.e() * d3; + entityitem.motZ = (double) enumfacing.getAdjacentZ() * d3; entityitem.motX += world.random.nextGaussian() * 0.007499999832361937D * (double) i; entityitem.motY += world.random.nextGaussian() * 0.007499999832361937D * (double) i; entityitem.motZ += world.random.nextGaussian() * 0.007499999832361937D * (double) i; @@ -69,7 +69,7 @@ public class DispenseBehaviorItem implements IDispenseBehavior { if (!event.getItem().equals(craftItem)) { // Chain to handler for new item ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); - IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(eventStack.getItem()); + IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.get(eventStack.getItem()); if (idispensebehavior != IDispenseBehavior.a && idispensebehavior.getClass() != DispenseBehaviorItem.class) { idispensebehavior.a(isourceblock, eventStack); } else { @@ -93,6 +93,6 @@ public class DispenseBehaviorItem implements IDispenseBehavior { } private int a(EnumFacing enumfacing) { - return enumfacing.c() + 1 + (enumfacing.e() + 1) * 3; + return enumfacing.getAdjacentX() + 1 + (enumfacing.getAdjacentZ() + 1) * 3; } } diff --git a/src/main/java/net/minecraft/server/DispenseBehaviorMinecart.java b/src/main/java/net/minecraft/server/DispenseBehaviorMinecart.java index 0358550a12..3df54aad92 100644 --- a/src/main/java/net/minecraft/server/DispenseBehaviorMinecart.java +++ b/src/main/java/net/minecraft/server/DispenseBehaviorMinecart.java @@ -14,12 +14,12 @@ final class DispenseBehaviorMinecart extends DispenseBehaviorItem { public ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) { EnumFacing enumfacing = BlockDispenser.b(isourceblock.h()); World world = isourceblock.k(); - double d0 = isourceblock.getX() + (double) ((float) enumfacing.c() * 1.125F); - double d1 = isourceblock.getY() + (double) ((float) enumfacing.d() * 1.125F); - double d2 = isourceblock.getZ() + (double) ((float) enumfacing.e() * 1.125F); - int i = isourceblock.getBlockX() + enumfacing.c(); - int j = isourceblock.getBlockY() + enumfacing.d(); - int k = isourceblock.getBlockZ() + enumfacing.e(); + double d0 = isourceblock.getX() + (double) ((float) enumfacing.getAdjacentX() * 1.125F); + double d1 = isourceblock.getY() + (double) ((float) enumfacing.getAdjacentY() * 1.125F); + double d2 = isourceblock.getZ() + (double) ((float) enumfacing.getAdjacentZ() * 1.125F); + int i = isourceblock.getBlockX() + enumfacing.getAdjacentX(); + int j = isourceblock.getBlockY() + enumfacing.getAdjacentY(); + int k = isourceblock.getBlockZ() + enumfacing.getAdjacentZ(); Block block = world.getType(i, j, k); double d3; @@ -52,7 +52,7 @@ final class DispenseBehaviorMinecart extends DispenseBehaviorItem { itemstack.count++; // Chain to handler for new item ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); - IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(eventStack.getItem()); + IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.get(eventStack.getItem()); if (idispensebehavior != IDispenseBehavior.a && idispensebehavior != this) { idispensebehavior.a(isourceblock, eventStack); return itemstack; diff --git a/src/main/java/net/minecraft/server/DispenseBehaviorMonsterEgg.java b/src/main/java/net/minecraft/server/DispenseBehaviorMonsterEgg.java index 2c14ab03e9..c3454101cd 100644 --- a/src/main/java/net/minecraft/server/DispenseBehaviorMonsterEgg.java +++ b/src/main/java/net/minecraft/server/DispenseBehaviorMonsterEgg.java @@ -11,9 +11,9 @@ final class DispenseBehaviorMonsterEgg extends DispenseBehaviorItem { public ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) { EnumFacing enumfacing = BlockDispenser.b(isourceblock.h()); - double d0 = isourceblock.getX() + (double) enumfacing.c(); + double d0 = isourceblock.getX() + (double) enumfacing.getAdjacentX(); double d1 = (double) ((float) isourceblock.getBlockY() + 0.2F); - double d2 = isourceblock.getZ() + (double) enumfacing.e(); + double d2 = isourceblock.getZ() + (double) enumfacing.getAdjacentZ(); // CraftBukkit start World world = isourceblock.k(); @@ -35,7 +35,7 @@ final class DispenseBehaviorMonsterEgg extends DispenseBehaviorItem { itemstack.count++; // Chain to handler for new item ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); - IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(eventStack.getItem()); + IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.get(eventStack.getItem()); if (idispensebehavior != IDispenseBehavior.a && idispensebehavior != this) { idispensebehavior.a(isourceblock, eventStack); return itemstack; diff --git a/src/main/java/net/minecraft/server/DispenseBehaviorProjectile.java b/src/main/java/net/minecraft/server/DispenseBehaviorProjectile.java index 49de3f4189..b90637357b 100644 --- a/src/main/java/net/minecraft/server/DispenseBehaviorProjectile.java +++ b/src/main/java/net/minecraft/server/DispenseBehaviorProjectile.java @@ -20,7 +20,7 @@ public abstract class DispenseBehaviorProjectile extends DispenseBehaviorItem { org.bukkit.block.Block block = world.getWorld().getBlockAt(isourceblock.getBlockX(), isourceblock.getBlockY(), isourceblock.getBlockZ()); CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1); - BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector((double) enumfacing.c(), (double) ((float) enumfacing.d() + 0.1F), (double) enumfacing.e())); + BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector((double) enumfacing.getAdjacentX(), (double) ((float) enumfacing.getAdjacentY() + 0.1F), (double) enumfacing.getAdjacentZ())); if (!BlockDispenser.eventFired) { world.getServer().getPluginManager().callEvent(event); } @@ -34,7 +34,7 @@ public abstract class DispenseBehaviorProjectile extends DispenseBehaviorItem { itemstack.count++; // Chain to handler for new item ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); - IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(eventStack.getItem()); + IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.get(eventStack.getItem()); if (idispensebehavior != IDispenseBehavior.a && idispensebehavior != this) { idispensebehavior.a(isourceblock, eventStack); return itemstack; diff --git a/src/main/java/net/minecraft/server/DispenseBehaviorTNT.java b/src/main/java/net/minecraft/server/DispenseBehaviorTNT.java index 0d7f828b67..d9493393aa 100644 --- a/src/main/java/net/minecraft/server/DispenseBehaviorTNT.java +++ b/src/main/java/net/minecraft/server/DispenseBehaviorTNT.java @@ -12,9 +12,9 @@ final class DispenseBehaviorTNT extends DispenseBehaviorItem { protected ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) { EnumFacing enumfacing = BlockDispenser.b(isourceblock.h()); World world = isourceblock.k(); - int i = isourceblock.getBlockX() + enumfacing.c(); - int j = isourceblock.getBlockY() + enumfacing.d(); - int k = isourceblock.getBlockZ() + enumfacing.e(); + int i = isourceblock.getBlockX() + enumfacing.getAdjacentX(); + int j = isourceblock.getBlockY() + enumfacing.getAdjacentY(); + int k = isourceblock.getBlockZ() + enumfacing.getAdjacentZ(); // CraftBukkit start ItemStack itemstack1 = itemstack.a(1); @@ -35,7 +35,7 @@ final class DispenseBehaviorTNT extends DispenseBehaviorItem { itemstack.count++; // Chain to handler for new item ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); - IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(eventStack.getItem()); + IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.get(eventStack.getItem()); if (idispensebehavior != IDispenseBehavior.a && idispensebehavior != this) { idispensebehavior.a(isourceblock, eventStack); return itemstack; diff --git a/src/main/java/net/minecraft/server/Enchantment.java b/src/main/java/net/minecraft/server/Enchantment.java index 3dffd20814..d96ca7d443 100644 --- a/src/main/java/net/minecraft/server/Enchantment.java +++ b/src/main/java/net/minecraft/server/Enchantment.java @@ -73,7 +73,7 @@ public abstract class Enchantment { return 0; } - public float a(int i, EntityLiving entityliving) { + public float a(int i, EnumMonsterType enummonstertype) { return 0.0F; } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java index f74d937ef4..9d933cba52 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -40,11 +40,11 @@ public abstract class Entity { private static int entityCount; private int id; - public double k; - public boolean l; + public double j; + public boolean k; public Entity passenger; public Entity vehicle; - public boolean o; + public boolean n; public World world; public double lastX; public double lastY; @@ -62,26 +62,27 @@ public abstract class Entity { public final AxisAlignedBB boundingBox; public boolean onGround; public boolean positionChanged; + public boolean F; public boolean G; - public boolean H; public boolean velocityChanged; - protected boolean J; - public boolean K; + protected boolean I; + public boolean J; public boolean dead; public float height; public float width; public float length; + public float O; public float P; public float Q; - public float R; public float fallDistance; private int d; + public double S; public double T; public double U; - public double V; + public float V; public float W; - public float X; - public boolean Y; + public boolean X; + public float Y; public float Z; protected Random random; public int ticksLived; @@ -94,20 +95,20 @@ public abstract class Entity { protected DataWatcher datawatcher; private double g; private double h; - public boolean ah; + public boolean ag; + public int ah; public int ai; public int aj; - public int ak; + public boolean ak; public boolean al; - public boolean am; public int portalCooldown; - protected boolean ao; - protected int ap; + protected boolean an; + protected int ao; public int dimension; - protected int ar; + protected int aq; private boolean invulnerable; public UUID uniqueID; // CraftBukkit - protected -> public - public EnumEntitySize at; + public EnumEntitySize as; public boolean valid; // CraftBukkit public org.bukkit.projectiles.ProjectileSource projectileSource; // CraftBukkit - For projectiles only @@ -121,9 +122,9 @@ public abstract class Entity { public Entity(World world) { this.id = entityCount++; - this.k = 1.0D; + this.j = 1.0D; this.boundingBox = AxisAlignedBB.a(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D); - this.K = true; + this.J = true; this.width = 0.6F; this.length = 1.8F; this.d = 1; @@ -131,7 +132,7 @@ public abstract class Entity { this.maxFireTicks = 1; this.justCreated = true; this.uniqueID = UUID.randomUUID(); - this.at = EnumEntitySize.SIZE_2; + this.as = EnumEntitySize.SIZE_2; this.world = world; this.setPosition(0.0D, 0.0D, 0.0D); if (world != null) { @@ -179,17 +180,17 @@ public abstract class Entity { f2 = f % 2.0F; if ((double) f2 < 0.375D) { - this.at = EnumEntitySize.SIZE_1; + this.as = EnumEntitySize.SIZE_1; } else if ((double) f2 < 0.75D) { - this.at = EnumEntitySize.SIZE_2; + this.as = EnumEntitySize.SIZE_2; } else if ((double) f2 < 1.0D) { - this.at = EnumEntitySize.SIZE_3; + this.as = EnumEntitySize.SIZE_3; } else if ((double) f2 < 1.375D) { - this.at = EnumEntitySize.SIZE_4; + this.as = EnumEntitySize.SIZE_4; } else if ((double) f2 < 1.75D) { - this.at = EnumEntitySize.SIZE_5; + this.as = EnumEntitySize.SIZE_5; } else { - this.at = EnumEntitySize.SIZE_6; + this.as = EnumEntitySize.SIZE_6; } } @@ -232,20 +233,20 @@ public abstract class Entity { float f = this.width / 2.0F; float f1 = this.length; - this.boundingBox.b(d0 - (double) f, d1 - (double) this.height + (double) this.W, d2 - (double) f, d0 + (double) f, d1 - (double) this.height + (double) this.W + (double) f1, d2 + (double) f); + this.boundingBox.b(d0 - (double) f, d1 - (double) this.height + (double) this.V, d2 - (double) f, d0 + (double) f, d1 - (double) this.height + (double) this.V + (double) f1, d2 + (double) f); } public void h() { - this.C(); + this.B(); } - public void C() { + public void B() { this.world.methodProfiler.a("entityBaseTick"); if (this.vehicle != null && this.vehicle.dead) { this.vehicle = null; } - this.P = this.Q; + this.O = this.P; this.lastX = this.locX; this.lastY = this.locY; this.lastZ = this.locZ; @@ -257,12 +258,12 @@ public abstract class Entity { this.world.methodProfiler.a("portal"); MinecraftServer minecraftserver = ((WorldServer) this.world).getMinecraftServer(); - i = this.D(); - if (this.ao) { + i = this.C(); + if (this.an) { if (true || minecraftserver.getAllowNether()) { // CraftBukkit - if (this.vehicle == null && this.ap++ >= i) { - this.ap = i; - this.portalCooldown = this.ai(); + if (this.vehicle == null && this.ao++ >= i) { + this.ao = i; + this.portalCooldown = this.ah(); byte b0; if (this.world.worldProvider.dimension == -1) { @@ -274,15 +275,15 @@ public abstract class Entity { this.b(b0); } - this.ao = false; + this.an = false; } } else { - if (this.ap > 0) { - this.ap -= 4; + if (this.ao > 0) { + this.ao -= 4; } - if (this.ap < 0) { - this.ap = 0; + if (this.ao < 0) { + this.ao = 0; } } @@ -293,7 +294,7 @@ public abstract class Entity { this.world.methodProfiler.b(); } - if (this.isSprinting() && !this.M()) { + if (this.isSprinting() && !this.L()) { int j = MathHelper.floor(this.locX); i = MathHelper.floor(this.locY - 0.20000000298023224D - (double) this.height); @@ -305,7 +306,7 @@ public abstract class Entity { } } - this.N(); + this.M(); if (this.world.isStatic) { this.fireTicks = 0; } else if (this.fireTicks > 0) { @@ -323,13 +324,13 @@ public abstract class Entity { } } - if (this.P()) { - this.E(); + if (this.O()) { + this.D(); this.fallDistance *= 0.5F; } if (this.locY < -64.0D) { - this.G(); + this.F(); } if (!this.world.isStatic) { @@ -340,11 +341,11 @@ public abstract class Entity { this.world.methodProfiler.b(); } - public int D() { + public int C() { return 0; } - protected void E() { + protected void D() { if (!this.fireProof) { // CraftBukkit start - Fallen in lava TODO: this event spams! if (this instanceof EntityLiving) { @@ -396,7 +397,7 @@ public abstract class Entity { this.fireTicks = 0; } - protected void G() { + protected void F() { this.die(); } @@ -411,7 +412,7 @@ public abstract class Entity { // CraftBukkit start - Don't do anything if we aren't moving // We need to do this regardless of whether or not we are moving thanks to portals try { - this.I(); + this.H(); } catch (Throwable throwable) { CrashReport crashreport = CrashReport.a(throwable, "Checking entity block collision"); CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being checked for collision"); @@ -424,20 +425,20 @@ public abstract class Entity { return; } // CraftBukkit end - if (this.Y) { + if (this.X) { this.boundingBox.d(d0, d1, d2); this.locX = (this.boundingBox.a + this.boundingBox.d) / 2.0D; - this.locY = this.boundingBox.b + (double) this.height - (double) this.W; + this.locY = this.boundingBox.b + (double) this.height - (double) this.V; this.locZ = (this.boundingBox.c + this.boundingBox.f) / 2.0D; } else { this.world.methodProfiler.a("move"); - this.W *= 0.4F; + this.V *= 0.4F; double d3 = this.locX; double d4 = this.locY; double d5 = this.locZ; - if (this.J) { - this.J = false; + if (this.I) { + this.I = false; d0 *= 0.25D; d1 *= 0.05000000074505806D; d2 *= 0.25D; @@ -504,7 +505,7 @@ public abstract class Entity { } this.boundingBox.d(0.0D, d1, 0.0D); - if (!this.K && d7 != d1) { + if (!this.J && d7 != d1) { d2 = 0.0D; d1 = 0.0D; d0 = 0.0D; @@ -519,7 +520,7 @@ public abstract class Entity { } this.boundingBox.d(d0, 0.0D, 0.0D); - if (!this.K && d6 != d0) { + if (!this.J && d6 != d0) { d2 = 0.0D; d1 = 0.0D; d0 = 0.0D; @@ -530,7 +531,7 @@ public abstract class Entity { } this.boundingBox.d(0.0D, 0.0D, d2); - if (!this.K && d8 != d2) { + if (!this.J && d8 != d2) { d2 = 0.0D; d1 = 0.0D; d0 = 0.0D; @@ -541,12 +542,12 @@ public abstract class Entity { double d12; int k; - if (this.X > 0.0F && flag1 && (flag || this.W < 0.05F) && (d6 != d0 || d8 != d2)) { + if (this.W > 0.0F && flag1 && (flag || this.V < 0.05F) && (d6 != d0 || d8 != d2)) { d10 = d0; d11 = d1; d12 = d2; d0 = d6; - d1 = (double) this.X; + d1 = (double) this.W; d2 = d8; AxisAlignedBB axisalignedbb1 = this.boundingBox.clone(); @@ -558,7 +559,7 @@ public abstract class Entity { } this.boundingBox.d(0.0D, d1, 0.0D); - if (!this.K && d7 != d1) { + if (!this.J && d7 != d1) { d2 = 0.0D; d1 = 0.0D; d0 = 0.0D; @@ -569,7 +570,7 @@ public abstract class Entity { } this.boundingBox.d(d0, 0.0D, 0.0D); - if (!this.K && d6 != d0) { + if (!this.J && d6 != d0) { d2 = 0.0D; d1 = 0.0D; d0 = 0.0D; @@ -580,18 +581,18 @@ public abstract class Entity { } this.boundingBox.d(0.0D, 0.0D, d2); - if (!this.K && d8 != d2) { + if (!this.J && d8 != d2) { d2 = 0.0D; d1 = 0.0D; d0 = 0.0D; } - if (!this.K && d7 != d1) { + if (!this.J && d7 != d1) { d2 = 0.0D; d1 = 0.0D; d0 = 0.0D; } else { - d1 = (double) (-this.X); + d1 = (double) (-this.W); for (k = 0; k < list.size(); ++k) { d1 = ((AxisAlignedBB) list.get(k)).b(this.boundingBox, d1); @@ -611,12 +612,12 @@ public abstract class Entity { this.world.methodProfiler.b(); this.world.methodProfiler.a("rest"); this.locX = (this.boundingBox.a + this.boundingBox.d) / 2.0D; - this.locY = this.boundingBox.b + (double) this.height - (double) this.W; + this.locY = this.boundingBox.b + (double) this.height - (double) this.V; this.locZ = (this.boundingBox.c + this.boundingBox.f) / 2.0D; this.positionChanged = d6 != d0 || d8 != d2; - this.G = d7 != d1; + this.F = d7 != d1; this.onGround = d7 != d1 && d7 < 0.0D; - this.H = this.positionChanged || this.G; + this.G = this.positionChanged || this.F; this.a(d1, this.onGround); if (d6 != d0) { this.motX = 0.0D; @@ -670,18 +671,18 @@ public abstract class Entity { d11 = 0.0D; } - this.Q = (float) ((double) this.Q + (double) MathHelper.sqrt(d10 * d10 + d12 * d12) * 0.6D); - this.R = (float) ((double) this.R + (double) MathHelper.sqrt(d10 * d10 + d11 * d11 + d12 * d12) * 0.6D); - if (this.R > (float) this.d && block.getMaterial() != Material.AIR) { - this.d = (int) this.R + 1; - if (this.M()) { + this.P = (float) ((double) this.P + (double) MathHelper.sqrt(d10 * d10 + d12 * d12) * 0.6D); + this.Q = (float) ((double) this.Q + (double) MathHelper.sqrt(d10 * d10 + d11 * d11 + d12 * d12) * 0.6D); + if (this.Q > (float) this.d && block.getMaterial() != Material.AIR) { + this.d = (int) this.Q + 1; + if (this.L()) { float f = MathHelper.sqrt(this.motX * this.motX * 0.20000000298023224D + this.motY * this.motY + this.motZ * this.motZ * 0.20000000298023224D) * 0.35F; if (f > 1.0F) { f = 1.0F; } - this.makeSound(this.H(), f, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F); + this.makeSound(this.G(), f, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F); } this.a(l, k, i1, block); @@ -692,7 +693,7 @@ public abstract class Entity { // CraftBukkit start - Move to the top of the method /* try { - this.I(); + this.H(); } catch (Throwable throwable) { CrashReport crashreport = CrashReport.a(throwable, "Checking entity block collision"); CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being checked for collision"); @@ -702,7 +703,7 @@ public abstract class Entity { } */ // CraftBukkit end - boolean flag2 = this.L(); + boolean flag2 = this.K(); if (this.world.e(this.boundingBox.shrink(0.001D, 0.001D, 0.001D))) { this.burn(1); @@ -734,11 +735,11 @@ public abstract class Entity { } } - protected String H() { + protected String G() { return "game.neutral.swim"; } - protected void I() { + protected void H() { int i = MathHelper.floor(this.boundingBox.a + 0.001D); int j = MathHelper.floor(this.boundingBox.b + 0.001D); int k = MathHelper.floor(this.boundingBox.c + 0.001D); @@ -797,7 +798,7 @@ public abstract class Entity { } } - public AxisAlignedBB J() { + public AxisAlignedBB I() { return null; } @@ -817,15 +818,15 @@ public abstract class Entity { } } - public boolean L() { + public boolean K() { return this.inWater || this.world.isRainingAt(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ)) || this.world.isRainingAt(MathHelper.floor(this.locX), MathHelper.floor(this.locY + (double) this.length), MathHelper.floor(this.locZ)); } - public boolean M() { + public boolean L() { return this.inWater; } - public boolean N() { + public boolean M() { if (this.world.a(this.boundingBox.grow(0.0D, -0.4000000059604645D, 0.0D).shrink(0.001D, 0.001D, 0.001D), Material.WATER, this)) { if (!this.inWater && !this.justCreated) { float f = MathHelper.sqrt(this.motX * this.motX * 0.20000000298023224D + this.motY * this.motY + this.motZ * this.motZ * 0.20000000298023224D) * 0.2F; @@ -834,7 +835,7 @@ public abstract class Entity { f = 1.0F; } - this.makeSound(this.O(), f, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F); + this.makeSound(this.N(), f, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F); float f1 = (float) MathHelper.floor(this.boundingBox.b); int i; @@ -864,7 +865,7 @@ public abstract class Entity { return this.inWater; } - protected String O() { + protected String N() { return "game.neutral.swim.splash"; } @@ -889,7 +890,7 @@ public abstract class Entity { return 0.0F; } - public boolean P() { + public boolean O() { return this.world.a(this.boundingBox.grow(-0.10000000149011612D, -0.4000000059604645D, -0.10000000149011612D), Material.LAVA); } @@ -945,7 +946,7 @@ public abstract class Entity { this.lastZ = this.locZ = d2; this.lastYaw = this.yaw = f; this.lastPitch = this.pitch = f1; - this.W = 0.0F; + this.V = 0.0F; double d3 = (double) (this.lastYaw - f); if (d3 < -180.0D) { @@ -961,15 +962,15 @@ public abstract class Entity { } public void setPositionRotation(double d0, double d1, double d2, float f, float f1) { - this.T = this.lastX = this.locX = d0; - this.U = this.lastY = this.locY = d1 + (double) this.height; - this.V = this.lastZ = this.locZ = d2; + this.S = this.lastX = this.locX = d0; + this.T = this.lastY = this.locY = d1 + (double) this.height; + this.U = this.lastZ = this.locZ = d2; this.yaw = f; this.pitch = f1; this.setPosition(this.locX, this.locY, this.locZ); } - public float d(Entity entity) { + public float e(Entity entity) { float f = (float) (this.locX - entity.locX); float f1 = (float) (this.locY - entity.locY); float f2 = (float) (this.locZ - entity.locZ); @@ -993,7 +994,7 @@ public abstract class Entity { return (double) MathHelper.sqrt(d3 * d3 + d4 * d4 + d5 * d5); } - public double e(Entity entity) { + public double f(Entity entity) { double d0 = this.locX - entity.locX; double d1 = this.locY - entity.locY; double d2 = this.locZ - entity.locZ; @@ -1023,8 +1024,8 @@ public abstract class Entity { d1 *= d3; d0 *= 0.05000000074505806D; d1 *= 0.05000000074505806D; - d0 *= (double) (1.0F - this.Z); - d1 *= (double) (1.0F - this.Z); + d0 *= (double) (1.0F - this.Y); + d1 *= (double) (1.0F - this.Y); this.g(-d0, 0.0D, -d1); entity.g(d0, 0.0D, d1); } @@ -1035,10 +1036,10 @@ public abstract class Entity { this.motX += d0; this.motY += d1; this.motZ += d2; - this.am = true; + this.al = true; } - protected void Q() { + protected void P() { this.velocityChanged = true; } @@ -1046,23 +1047,23 @@ public abstract class Entity { if (this.isInvulnerable()) { return false; } else { - this.Q(); + this.P(); return false; } } + public boolean Q() { + return false; + } + public boolean R() { return false; } - public boolean S() { - return false; - } - public void b(Entity entity, int i) {} public boolean c(NBTTagCompound nbttagcompound) { - String s = this.W(); + String s = this.V(); if (!this.dead && s != null) { nbttagcompound.setString("id", s); @@ -1074,7 +1075,7 @@ public abstract class Entity { } public boolean d(NBTTagCompound nbttagcompound) { - String s = this.W(); + String s = this.V(); if (!this.dead && s != null && this.passenger == null) { nbttagcompound.setString("id", s); @@ -1087,7 +1088,7 @@ public abstract class Entity { public void e(NBTTagCompound nbttagcompound) { try { - nbttagcompound.set("Pos", this.a(new double[] { this.locX, this.locY + (double) this.W, this.locZ})); + nbttagcompound.set("Pos", this.a(new double[] { this.locX, this.locY + (double) this.V, this.locZ})); nbttagcompound.set("Motion", this.a(new double[] { this.motX, this.motY, this.motZ})); // CraftBukkit start - Checking for NaN pitch/yaw and resetting to zero @@ -1156,9 +1157,9 @@ public abstract class Entity { } // CraftBukkit end */ - this.lastX = this.T = this.locX = nbttaglist.d(0); - this.lastY = this.U = this.locY = nbttaglist.d(1); - this.lastZ = this.V = this.locZ = nbttaglist.d(2); + this.lastX = this.S = this.locX = nbttaglist.d(0); + this.lastY = this.T = this.locY = nbttaglist.d(1); + this.lastZ = this.U = this.locZ = nbttaglist.d(2); this.lastYaw = this.yaw = nbttaglist2.e(0); this.lastPitch = this.pitch = nbttaglist2.e(1); this.fallDistance = nbttagcompound.getFloat("FallDistance"); @@ -1175,7 +1176,7 @@ public abstract class Entity { this.setPosition(this.locX, this.locY, this.locZ); this.b(this.yaw, this.pitch); this.a(nbttagcompound); - if (this.V()) { + if (this.U()) { this.setPosition(this.locX, this.locY, this.locZ); } @@ -1239,11 +1240,11 @@ public abstract class Entity { } } - protected boolean V() { + protected boolean U() { return true; } - protected final String W() { + protected final String V() { return EntityTypes.b(this); } @@ -1251,7 +1252,7 @@ public abstract class Entity { protected abstract void b(NBTTagCompound nbttagcompound); - public void X() {} + public void W() {} protected NBTTagList a(double... adouble) { NBTTagList nbttaglist = new NBTTagList(); @@ -1326,11 +1327,11 @@ public abstract class Entity { return false; } - public AxisAlignedBB g(Entity entity) { + public AxisAlignedBB h(Entity entity) { return null; } - public void ab() { + public void aa() { if (this.vehicle.dead) { this.vehicle = null; } else { @@ -1339,7 +1340,7 @@ public abstract class Entity { this.motZ = 0.0D; this.h(); if (this.vehicle != null) { - this.vehicle.ac(); + this.vehicle.ab(); this.h += (double) (this.vehicle.yaw - this.vehicle.lastYaw); for (this.g += (double) (this.vehicle.pitch - this.vehicle.lastPitch); this.h >= 180.0D; this.h -= 360.0D) { @@ -1384,17 +1385,17 @@ public abstract class Entity { } } - public void ac() { + public void ab() { if (this.passenger != null) { - this.passenger.setPosition(this.locX, this.locY + this.ae() + this.passenger.ad(), this.locZ); + this.passenger.setPosition(this.locX, this.locY + this.ad() + this.passenger.ac(), this.locZ); } } - public double ad() { + public double ac() { return (double) this.height; } - public double ae() { + public double ad() { return (double) this.length * 0.75D; } @@ -1475,35 +1476,43 @@ public abstract class Entity { this.vehicle.passenger = null; } + if (entity != null) { + for (Entity entity1 = entity.vehicle; entity1 != null; entity1 = entity1.vehicle) { + if (entity1 == this) { + return; + } + } + } + this.vehicle = entity; entity.passenger = this; } } - public float af() { + public float ae() { return 0.1F; } - public Vec3D ag() { + public Vec3D af() { return null; } - public void ah() { + public void ag() { if (this.portalCooldown > 0) { - this.portalCooldown = this.ai(); + this.portalCooldown = this.ah(); } else { double d0 = this.lastX - this.locX; double d1 = this.lastZ - this.locZ; - if (!this.world.isStatic && !this.ao) { - this.ar = Direction.a(d0, d1); + if (!this.world.isStatic && !this.an) { + this.aq = Direction.a(d0, d1); } - this.ao = true; + this.an = true; } } - public int ai() { + public int ah() { return 300; } @@ -1519,7 +1528,7 @@ public abstract class Entity { return !this.fireProof && (this.fireTicks > 0 || flag && this.g(0)); } - public boolean am() { + public boolean al() { return this.vehicle != null; } @@ -1686,8 +1695,8 @@ public abstract class Entity { } } - public void as() { - this.J = true; + public void ar() { + this.I = true; this.fallDistance = 0.0F; } @@ -1701,11 +1710,11 @@ public abstract class Entity { return LocaleI18n.get("entity." + s + ".name"); } - public Entity[] at() { + public Entity[] as() { return null; } - public boolean h(Entity entity) { + public boolean i(Entity entity) { return this == entity; } @@ -1713,11 +1722,11 @@ public abstract class Entity { return 0.0F; } - public boolean av() { + public boolean au() { return true; } - public boolean i(Entity entity) { + public boolean j(Entity entity) { return false; } @@ -1729,7 +1738,7 @@ public abstract class Entity { return this.invulnerable; } - public void j(Entity entity) { + public void k(Entity entity) { this.setPositionRotation(entity.locX, entity.locY, entity.locZ, entity.yaw, entity.pitch); } @@ -1739,7 +1748,7 @@ public abstract class Entity { entity.e(nbttagcompound); this.f(nbttagcompound); this.portalCooldown = entity.portalCooldown; - this.ar = entity.ar; + this.aq = entity.aq; } public void b(int i) { @@ -1762,7 +1771,7 @@ public abstract class Entity { Location exit = exitWorld != null ? minecraftserver.getPlayerList().calculateTarget(enter, minecraftserver.getWorldServer(i)) : null; boolean useTravelAgent = exitWorld != null && !(this.dimension == 1 && exitWorld.dimension == 1); // don't use agent for custom worlds or return from THE_END - TravelAgent agent = exit != null ? (TravelAgent) ((CraftWorld) exit.getWorld()).getHandle().t() : org.bukkit.craftbukkit.CraftTravelAgent.DEFAULT; // return arbitrary TA to compensate for implementation dependent plugins + TravelAgent agent = exit != null ? (TravelAgent) ((CraftWorld) exit.getWorld()).getHandle().getTravelAgent() : org.bukkit.craftbukkit.CraftTravelAgent.DEFAULT; // return arbitrary TA to compensate for implementation dependent plugins EntityPortalEvent event = new EntityPortalEvent(this.getBukkitEntity(), enter, exit, agent); event.useTravelAgent(useTravelAgent); event.getEntity().getServer().getPluginManager().callEvent(event); @@ -1835,15 +1844,15 @@ public abstract class Entity { return true; } - public int ax() { + public int aw() { return 3; } - public int ay() { - return this.ar; + public int ax() { + return this.aq; } - public boolean az() { + public boolean ay() { return false; } @@ -1860,7 +1869,7 @@ public abstract class Entity { return this.uniqueID; } - public boolean aC() { + public boolean aB() { return true; } diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java index 5887ee8f01..b263d82772 100644 --- a/src/main/java/net/minecraft/server/EntityArrow.java +++ b/src/main/java/net/minecraft/server/EntityArrow.java @@ -19,20 +19,20 @@ public class EntityArrow extends Entity implements IProjectile { public int fromPlayer; public int shake; public Entity shooter; - private int j; + private int at; private int au; private double damage = 2.0D; - public int aw; // CraftBukkit - private -> public + public int knockbackStrength; // CraftBukkit - private -> public public EntityArrow(World world) { super(world); - this.k = 10.0D; + this.j = 10.0D; this.a(0.5F, 0.5F); } public EntityArrow(World world, double d0, double d1, double d2) { super(world); - this.k = 10.0D; + this.j = 10.0D; this.a(0.5F, 0.5F); this.setPosition(d0, d1, d2); this.height = 0.0F; @@ -40,7 +40,7 @@ public class EntityArrow extends Entity implements IProjectile { public EntityArrow(World world, EntityLiving entityliving, EntityLiving entityliving1, float f, float f1) { super(world); - this.k = 10.0D; + this.j = 10.0D; this.shooter = entityliving; this.projectileSource = (LivingEntity) entityliving.getBukkitEntity(); // CraftBukkit if (entityliving instanceof EntityHuman) { @@ -69,7 +69,7 @@ public class EntityArrow extends Entity implements IProjectile { public EntityArrow(World world, EntityLiving entityliving, float f) { super(world); - this.k = 10.0D; + this.j = 10.0D; this.shooter = entityliving; this.projectileSource = (LivingEntity) entityliving.getBukkitEntity(); // CraftBukkit if (entityliving instanceof EntityHuman) { @@ -112,7 +112,7 @@ public class EntityArrow extends Entity implements IProjectile { this.lastYaw = this.yaw = (float) (Math.atan2(d0, d2) * 180.0D / 3.1415927410125732D); this.lastPitch = this.pitch = (float) (Math.atan2(d1, (double) f3) * 180.0D / 3.1415927410125732D); - this.j = 0; + this.at = 0; } public void h() { @@ -130,7 +130,7 @@ public class EntityArrow extends Entity implements IProjectile { block.updateShape(this.world, this.d, this.e, this.f); AxisAlignedBB axisalignedbb = block.a(this.world, this.d, this.e, this.f); - if (axisalignedbb != null && axisalignedbb.a(this.world.getVec3DPool().create(this.locX, this.locY, this.locZ))) { + if (axisalignedbb != null && axisalignedbb.a(Vec3D.a(this.locX, this.locY, this.locZ))) { this.inGround = true; } } @@ -143,8 +143,8 @@ public class EntityArrow extends Entity implements IProjectile { int i = this.world.getData(this.d, this.e, this.f); if (block == this.g && i == this.h) { - ++this.j; - if (this.j == 1200) { + ++this.at; + if (this.at == 1200) { this.die(); } } else { @@ -152,19 +152,19 @@ public class EntityArrow extends Entity implements IProjectile { this.motX *= (double) (this.random.nextFloat() * 0.2F); this.motY *= (double) (this.random.nextFloat() * 0.2F); this.motZ *= (double) (this.random.nextFloat() * 0.2F); - this.j = 0; + this.at = 0; this.au = 0; } } else { ++this.au; - Vec3D vec3d = this.world.getVec3DPool().create(this.locX, this.locY, this.locZ); - Vec3D vec3d1 = this.world.getVec3DPool().create(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ); + Vec3D vec3d = Vec3D.a(this.locX, this.locY, this.locZ); + Vec3D vec3d1 = Vec3D.a(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ); MovingObjectPosition movingobjectposition = this.world.rayTrace(vec3d, vec3d1, false, true, false); - vec3d = this.world.getVec3DPool().create(this.locX, this.locY, this.locZ); - vec3d1 = this.world.getVec3DPool().create(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ); + vec3d = Vec3D.a(this.locX, this.locY, this.locZ); + vec3d1 = Vec3D.a(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ); if (movingobjectposition != null) { - vec3d1 = this.world.getVec3DPool().create(movingobjectposition.pos.c, movingobjectposition.pos.d, movingobjectposition.pos.e); + vec3d1 = Vec3D.a(movingobjectposition.pos.a, movingobjectposition.pos.b, movingobjectposition.pos.c); } Entity entity = null; @@ -177,7 +177,7 @@ public class EntityArrow extends Entity implements IProjectile { for (j = 0; j < list.size(); ++j) { Entity entity1 = (Entity) list.get(j); - if (entity1.R() && (entity1 != this.shooter || this.au >= 5)) { + if (entity1.Q() && (entity1 != this.shooter || this.au >= 5)) { f1 = 0.3F; AxisAlignedBB axisalignedbb1 = entity1.boundingBox.grow((double) f1, (double) f1, (double) f1); MovingObjectPosition movingobjectposition1 = axisalignedbb1.a(vec3d, vec3d1); @@ -215,7 +215,7 @@ public class EntityArrow extends Entity implements IProjectile { f2 = MathHelper.sqrt(this.motX * this.motX + this.motY * this.motY + this.motZ * this.motZ); int k = MathHelper.f((double) f2 * this.damage); - if (this.f()) { + if (this.isCritical()) { k += this.random.nextInt(k / 2 + 2); } @@ -244,13 +244,13 @@ public class EntityArrow extends Entity implements IProjectile { EntityLiving entityliving = (EntityLiving) movingobjectposition.entity; if (!this.world.isStatic) { - entityliving.p(entityliving.aZ() + 1); + entityliving.p(entityliving.aY() + 1); } - if (this.aw > 0) { + if (this.knockbackStrength > 0) { f3 = MathHelper.sqrt(this.motX * this.motX + this.motZ * this.motZ); if (f3 > 0.0F) { - movingobjectposition.entity.g(this.motX * (double) this.aw * 0.6000000238418579D / (double) f3, 0.1D, this.motZ * (double) this.aw * 0.6000000238418579D / (double) f3); + movingobjectposition.entity.g(this.motX * (double) this.knockbackStrength * 0.6000000238418579D / (double) f3, 0.1D, this.motZ * (double) this.knockbackStrength * 0.6000000238418579D / (double) f3); } } @@ -282,9 +282,9 @@ public class EntityArrow extends Entity implements IProjectile { this.f = movingobjectposition.d; this.g = this.world.getType(d, e, f); // CraftBukkit - Get correct block for storage this.h = this.world.getData(this.d, this.e, this.f); - this.motX = (double) ((float) (movingobjectposition.pos.c - this.locX)); - this.motY = (double) ((float) (movingobjectposition.pos.d - this.locY)); - this.motZ = (double) ((float) (movingobjectposition.pos.e - this.locZ)); + this.motX = (double) ((float) (movingobjectposition.pos.a - this.locX)); + this.motY = (double) ((float) (movingobjectposition.pos.b - this.locY)); + this.motZ = (double) ((float) (movingobjectposition.pos.c - this.locZ)); f2 = MathHelper.sqrt(this.motX * this.motX + this.motY * this.motY + this.motZ * this.motZ); this.locX -= this.motX / (double) f2 * 0.05000000074505806D; this.locY -= this.motY / (double) f2 * 0.05000000074505806D; @@ -292,14 +292,14 @@ public class EntityArrow extends Entity implements IProjectile { this.makeSound("random.bowhit", 1.0F, 1.2F / (this.random.nextFloat() * 0.2F + 0.9F)); this.inGround = true; this.shake = 7; - this.a(false); + this.setCritical(false); if (this.g.getMaterial() != Material.AIR) { this.g.a(this.world, this.d, this.e, this.f, (Entity) this); } } } - if (this.f()) { + if (this.isCritical()) { for (j = 0; j < 4; ++j) { this.world.addParticle("crit", this.locX + this.motX * (double) j / 4.0D, this.locY + this.motY * (double) j / 4.0D, this.locZ + this.motZ * (double) j / 4.0D, -this.motX, -this.motY + 0.2D, -this.motZ); } @@ -332,7 +332,7 @@ public class EntityArrow extends Entity implements IProjectile { float f4 = 0.99F; f1 = 0.05F; - if (this.M()) { + if (this.L()) { for (int l = 0; l < 4; ++l) { f3 = 0.25F; this.world.addParticle("bubble", this.locX - this.motX * (double) f3, this.locY - this.motY * (double) f3, this.locZ - this.motZ * (double) f3, this.motX, this.motY, this.motZ); @@ -341,7 +341,7 @@ public class EntityArrow extends Entity implements IProjectile { f4 = 0.8F; } - if (this.L()) { + if (this.K()) { this.extinguish(); } @@ -350,7 +350,7 @@ public class EntityArrow extends Entity implements IProjectile { this.motZ *= (double) f4; this.motY -= (double) f1; this.setPosition(this.locX, this.locY, this.locZ); - this.I(); + this.H(); } } @@ -358,7 +358,7 @@ public class EntityArrow extends Entity implements IProjectile { nbttagcompound.setShort("xTile", (short) this.d); nbttagcompound.setShort("yTile", (short) this.e); nbttagcompound.setShort("zTile", (short) this.f); - nbttagcompound.setShort("life", (short) this.j); + nbttagcompound.setShort("life", (short) this.at); nbttagcompound.setByte("inTile", (byte) Block.b(this.g)); nbttagcompound.setByte("inData", (byte) this.h); nbttagcompound.setByte("shake", (byte) this.shake); @@ -371,7 +371,7 @@ public class EntityArrow extends Entity implements IProjectile { this.d = nbttagcompound.getShort("xTile"); this.e = nbttagcompound.getShort("yTile"); this.f = nbttagcompound.getShort("zTile"); - this.j = nbttagcompound.getShort("life"); + this.at = nbttagcompound.getShort("life"); this.g = Block.e(nbttagcompound.getByte("inTile") & 255); this.h = nbttagcompound.getByte("inData") & 255; this.shake = nbttagcompound.getByte("shake") & 255; @@ -430,15 +430,15 @@ public class EntityArrow extends Entity implements IProjectile { return this.damage; } - public void a(int i) { - this.aw = i; + public void setKnockbackStrength(int i) { + this.knockbackStrength = i; } - public boolean av() { + public boolean au() { return false; } - public void a(boolean flag) { + public void setCritical(boolean flag) { byte b0 = this.datawatcher.getByte(16); if (flag) { @@ -448,7 +448,7 @@ public class EntityArrow extends Entity implements IProjectile { } } - public boolean f() { + public boolean isCritical() { byte b0 = this.datawatcher.getByte(16); return (b0 & 1) != 0; diff --git a/src/main/java/net/minecraft/server/EntityBlaze.java b/src/main/java/net/minecraft/server/EntityBlaze.java index fe040f4626..790185c556 100644 --- a/src/main/java/net/minecraft/server/EntityBlaze.java +++ b/src/main/java/net/minecraft/server/EntityBlaze.java @@ -12,8 +12,8 @@ public class EntityBlaze extends EntityMonster { this.b = 10; } - protected void aD() { - super.aD(); + protected void aC() { + super.aC(); this.getAttributeInstance(GenericAttributes.e).setValue(6.0D); } @@ -26,11 +26,11 @@ public class EntityBlaze extends EntityMonster { return "mob.blaze.breathe"; } - protected String aT() { + protected String aS() { return "mob.blaze.hit"; } - protected String aU() { + protected String aT() { return "mob.blaze.death"; } @@ -40,7 +40,7 @@ public class EntityBlaze extends EntityMonster { public void e() { if (!this.world.isStatic) { - if (this.L()) { + if (this.K()) { this.damageEntity(DamageSource.DROWN, 1.0F); } @@ -50,7 +50,7 @@ public class EntityBlaze extends EntityMonster { this.bp = 0.5F + (float) this.random.nextGaussian() * 3.0F; } - if (this.bR() != null && this.bR().locY + (double) this.bR().getHeadHeight() > this.locY + (double) this.getHeadHeight() + (double) this.bp) { + if (this.bT() != null && this.bT().locY + (double) this.bT().getHeadHeight() > this.locY + (double) this.getHeadHeight() + (double) this.bp) { this.motY += (0.30000001192092896D - this.motY) * 0.30000001192092896D; } } @@ -73,7 +73,7 @@ public class EntityBlaze extends EntityMonster { protected void a(Entity entity, float f) { if (this.attackTicks <= 0 && f < 2.0F && entity.boundingBox.e > this.boundingBox.b && entity.boundingBox.b < this.boundingBox.e) { this.attackTicks = 20; - this.m(entity); + this.n(entity); } else if (f < 30.0F) { double d0 = entity.locX - this.locX; double d1 = entity.boundingBox.b + (double) (entity.length / 2.0F) - (this.locY + (double) (this.length / 2.0F)); @@ -118,7 +118,7 @@ public class EntityBlaze extends EntityMonster { } public boolean isBurning() { - return this.bX(); + return this.bZ(); } protected void dropDeathLoot(boolean flag, int i) { @@ -137,7 +137,7 @@ public class EntityBlaze extends EntityMonster { // CraftBukkit end } - public boolean bX() { + public boolean bZ() { return (this.datawatcher.getByte(16) & 1) != 0; } diff --git a/src/main/java/net/minecraft/server/EntityBoat.java b/src/main/java/net/minecraft/server/EntityBoat.java index cc64d606b0..0df3b6bb10 100644 --- a/src/main/java/net/minecraft/server/EntityBoat.java +++ b/src/main/java/net/minecraft/server/EntityBoat.java @@ -48,7 +48,7 @@ public class EntityBoat extends Entity { super(world); this.a = true; this.b = 0.07D; - this.l = true; + this.k = true; this.a(1.5F, 0.6F); this.height = this.length / 2.0F; } @@ -63,15 +63,15 @@ public class EntityBoat extends Entity { this.datawatcher.a(19, new Float(0.0F)); } - public AxisAlignedBB g(Entity entity) { + public AxisAlignedBB h(Entity entity) { return entity.boundingBox; } - public AxisAlignedBB J() { + public AxisAlignedBB I() { return this.boundingBox; } - public boolean S() { + public boolean R() { return true; } @@ -88,7 +88,7 @@ public class EntityBoat extends Entity { this.world.getServer().getPluginManager().callEvent(new org.bukkit.event.vehicle.VehicleCreateEvent((Vehicle) this.getBukkitEntity())); // CraftBukkit } - public double ae() { + public double ad() { return (double) this.length * 0.0D - 0.30000001192092896D; } @@ -112,7 +112,7 @@ public class EntityBoat extends Entity { this.c(-this.i()); this.a(10); this.setDamage(this.getDamage() + f * 10.0F); - this.Q(); + this.P(); boolean flag = damagesource.getEntity() instanceof EntityHuman && ((EntityHuman) damagesource.getEntity()).abilities.canInstantlyBuild; if (flag || this.getDamage() > 40.0F) { @@ -143,7 +143,7 @@ public class EntityBoat extends Entity { } } - public boolean R() { + public boolean Q() { return !this.dead; } @@ -174,7 +174,7 @@ public class EntityBoat extends Entity { for (int i = 0; i < b0; ++i) { double d1 = this.boundingBox.b + (this.boundingBox.e - this.boundingBox.b) * (double) (i + 0) / (double) b0 - 0.125D; double d2 = this.boundingBox.b + (this.boundingBox.e - this.boundingBox.b) * (double) (i + 1) / (double) b0 - 0.125D; - AxisAlignedBB axisalignedbb = AxisAlignedBB.a().a(this.boundingBox.a, d1, this.boundingBox.c, this.boundingBox.d, d2, this.boundingBox.f); + AxisAlignedBB axisalignedbb = AxisAlignedBB.a(this.boundingBox.a, d1, this.boundingBox.c, this.boundingBox.d, d2, this.boundingBox.f); if (this.world.b(axisalignedbb, Material.WATER)) { d0 += 1.0D / (double) b0; @@ -251,10 +251,10 @@ public class EntityBoat extends Entity { if (this.passenger != null && this.passenger instanceof EntityLiving) { EntityLiving entityliving = (EntityLiving) this.passenger; - float f = this.passenger.yaw + -entityliving.be * 90.0F; + float f = this.passenger.yaw + -entityliving.bd * 90.0F; - this.motX += -Math.sin((double) (f * 3.1415927F / 180.0F)) * this.b * (double) entityliving.bf * 0.05000000074505806D; - this.motZ += Math.cos((double) (f * 3.1415927F / 180.0F)) * this.b * (double) entityliving.bf * 0.05000000074505806D; + this.motX += -Math.sin((double) (f * 3.1415927F / 180.0F)) * this.b * (double) entityliving.be * 0.05000000074505806D; + this.motZ += Math.cos((double) (f * 3.1415927F / 180.0F)) * this.b * (double) entityliving.be * 0.05000000074505806D; } // CraftBukkit start - Support unoccupied deceleration else if (unoccupiedDeceleration >= 0) { @@ -397,7 +397,7 @@ public class EntityBoat extends Entity { for (int k1 = 0; k1 < list.size(); ++k1) { Entity entity = (Entity) list.get(k1); - if (entity != this.passenger && entity.S() && entity instanceof EntityBoat) { + if (entity != this.passenger && entity.R() && entity instanceof EntityBoat) { entity.collide(this); } } @@ -411,12 +411,12 @@ public class EntityBoat extends Entity { } } - public void ac() { + public void ab() { if (this.passenger != null) { double d0 = Math.cos((double) this.yaw * 3.141592653589793D / 180.0D) * 0.4D; double d1 = Math.sin((double) this.yaw * 3.141592653589793D / 180.0D) * 0.4D; - this.passenger.setPosition(this.locX + d0, this.locY + this.ae() + this.passenger.ad(), this.locZ + d1); + this.passenger.setPosition(this.locX + d0, this.locY + this.ad() + this.passenger.ac(), this.locZ + d1); } } diff --git a/src/main/java/net/minecraft/server/EntityChicken.java b/src/main/java/net/minecraft/server/EntityChicken.java index b5135b026d..f65ddccba8 100644 --- a/src/main/java/net/minecraft/server/EntityChicken.java +++ b/src/main/java/net/minecraft/server/EntityChicken.java @@ -10,6 +10,7 @@ public class EntityChicken extends EntityAnimal { public float bs; public float bt = 1.0F; public int bu; + public boolean bv; public EntityChicken(World world) { super(world); @@ -25,12 +26,12 @@ public class EntityChicken extends EntityAnimal { this.goalSelector.a(7, new PathfinderGoalRandomLookaround(this)); } - public boolean bk() { + public boolean bj() { return true; } - protected void aD() { - super.aD(); + protected void aC() { + super.aC(); this.getAttributeInstance(GenericAttributes.a).setValue(4.0D); this.getAttributeInstance(GenericAttributes.d).setValue(0.25D); } @@ -71,11 +72,11 @@ public class EntityChicken extends EntityAnimal { return "mob.chicken.say"; } - protected String aT() { + protected String aS() { return "mob.chicken.hurt"; } - protected String aU() { + protected String aT() { return "mob.chicken.hurt"; } @@ -114,6 +115,45 @@ public class EntityChicken extends EntityAnimal { return itemstack != null && itemstack.getItem() instanceof ItemSeeds; } + public void a(NBTTagCompound nbttagcompound) { + super.a(nbttagcompound); + this.bv = nbttagcompound.getBoolean("IsChickenJockey"); + } + + protected int getExpValue(EntityHuman entityhuman) { + return this.bZ() ? 10 : super.getExpValue(entityhuman); + } + + public void b(NBTTagCompound nbttagcompound) { + super.b(nbttagcompound); + nbttagcompound.setBoolean("IsChickenJockey", this.bv); + } + + protected boolean isTypeNotPersistent() { + return this.bZ() && this.passenger == null; + } + + public void ab() { + super.ab(); + float f = MathHelper.sin(this.aM * 3.1415927F / 180.0F); + float f1 = MathHelper.cos(this.aM * 3.1415927F / 180.0F); + float f2 = 0.1F; + float f3 = 0.0F; + + this.passenger.setPosition(this.locX + (double) (f2 * f), this.locY + (double) (this.length * 0.5F) + this.passenger.ac() + (double) f3, this.locZ - (double) (f2 * f1)); + if (this.passenger instanceof EntityLiving) { + ((EntityLiving) this.passenger).aM = this.aM; + } + } + + public boolean bZ() { + return this.bv; + } + + public void i(boolean flag) { + this.bv = flag; + } + public EntityAgeable createChild(EntityAgeable entityageable) { return this.b(entityageable); } diff --git a/src/main/java/net/minecraft/server/EntityCow.java b/src/main/java/net/minecraft/server/EntityCow.java index fb993a60b0..43c1243b15 100644 --- a/src/main/java/net/minecraft/server/EntityCow.java +++ b/src/main/java/net/minecraft/server/EntityCow.java @@ -22,12 +22,12 @@ public class EntityCow extends EntityAnimal { this.goalSelector.a(7, new PathfinderGoalRandomLookaround(this)); } - public boolean bk() { + public boolean bj() { return true; } - protected void aD() { - super.aD(); + protected void aC() { + super.aC(); this.getAttributeInstance(GenericAttributes.a).setValue(10.0D); this.getAttributeInstance(GenericAttributes.d).setValue(0.20000000298023224D); } @@ -36,11 +36,11 @@ public class EntityCow extends EntityAnimal { return "mob.cow.say"; } - protected String aT() { + protected String aS() { return "mob.cow.hurt"; } - protected String aU() { + protected String aT() { return "mob.cow.hurt"; } @@ -48,7 +48,7 @@ public class EntityCow extends EntityAnimal { this.makeSound("mob.cow.step", 0.15F, 1.0F); } - protected float bf() { + protected float be() { return 0.4F; } diff --git a/src/main/java/net/minecraft/server/EntityCreature.java b/src/main/java/net/minecraft/server/EntityCreature.java index 81502c1ad8..ef10d16454 100644 --- a/src/main/java/net/minecraft/server/EntityCreature.java +++ b/src/main/java/net/minecraft/server/EntityCreature.java @@ -25,11 +25,11 @@ public abstract class EntityCreature extends EntityInsentient { super(world); } - protected boolean bN() { + protected boolean bP() { return false; } - protected void bq() { + protected void bp() { this.world.methodProfiler.a("ai"); if (this.bo > 0 && --this.bo == 0) { AttributeInstance attributeinstance = this.getAttributeInstance(GenericAttributes.d); @@ -37,7 +37,7 @@ public abstract class EntityCreature extends EntityInsentient { attributeinstance.b(i); } - this.bn = this.bN(); + this.bn = this.bP(); float f11 = 16.0F; if (this.target == null) { @@ -61,9 +61,9 @@ public abstract class EntityCreature extends EntityInsentient { this.pathEntity = this.world.findPath(this, this.target, f11, true, false, false, true); } } else if (this.target.isAlive()) { - float f1 = this.target.d((Entity) this); + float f1 = this.target.e((Entity) this); - if (this.o(this.target)) { + if (this.p(this.target)) { this.a(this.target, f1); } } else { @@ -88,13 +88,13 @@ public abstract class EntityCreature extends EntityInsentient { this.world.methodProfiler.b(); if (!this.bn && this.target != null && (this.pathEntity == null || this.random.nextInt(20) == 0)) { this.pathEntity = this.world.findPath(this, this.target, f11, true, false, false, true); - } else if (!this.bn && (this.pathEntity == null && this.random.nextInt(180) == 0 || this.random.nextInt(120) == 0 || this.bo > 0) && this.aV < 100) { - this.bO(); + } else if (!this.bn && (this.pathEntity == null && this.random.nextInt(180) == 0 || this.random.nextInt(120) == 0 || this.bo > 0) && this.aU < 100) { + this.bQ(); } int i = MathHelper.floor(this.boundingBox.b + 0.5D); - boolean flag = this.M(); - boolean flag1 = this.P(); + boolean flag = this.L(); + boolean flag1 = this.O(); this.pitch = 0.0F; if (this.pathEntity != null && this.random.nextInt(100) != 0) { @@ -102,7 +102,7 @@ public abstract class EntityCreature extends EntityInsentient { Vec3D vec3d = this.pathEntity.a((Entity) this); double d0 = (double) (this.width * 2.0F); - while (vec3d != null && vec3d.d(this.locX, vec3d.d, this.locZ) < d0 * d0) { + while (vec3d != null && vec3d.d(this.locX, vec3d.b, this.locZ) < d0 * d0) { this.pathEntity.a(); if (this.pathEntity.b()) { vec3d = null; @@ -112,16 +112,16 @@ public abstract class EntityCreature extends EntityInsentient { } } - this.bd = false; + this.bc = false; if (vec3d != null) { - double d1 = vec3d.c - this.locX; - double d2 = vec3d.e - this.locZ; - double d3 = vec3d.d - (double) i; + double d1 = vec3d.a - this.locX; + double d2 = vec3d.c - this.locZ; + double d3 = vec3d.b - (double) i; // CraftBukkit - Math -> TrigMath float f2 = (float) (org.bukkit.craftbukkit.TrigMath.atan2(d2, d1) * 180.0D / 3.1415927410125732D) - 90.0F; float f3 = MathHelper.g(f2 - this.yaw); - this.bf = (float) this.getAttributeInstance(GenericAttributes.d).getValue(); + this.be = (float) this.getAttributeInstance(GenericAttributes.d).getValue(); if (f3 > 30.0F) { f3 = 30.0F; } @@ -138,12 +138,12 @@ public abstract class EntityCreature extends EntityInsentient { this.yaw = (float) (Math.atan2(d5, d4) * 180.0D / 3.1415927410125732D) - 90.0F; f3 = (f4 - this.yaw + 90.0F) * 3.1415927F / 180.0F; - this.be = -MathHelper.sin(f3) * this.bf * 1.0F; - this.bf = MathHelper.cos(f3) * this.bf * 1.0F; + this.bd = -MathHelper.sin(f3) * this.be * 1.0F; + this.be = MathHelper.cos(f3) * this.be * 1.0F; } if (d3 > 0.0D) { - this.bd = true; + this.bc = true; } } @@ -151,22 +151,22 @@ public abstract class EntityCreature extends EntityInsentient { this.a(this.target, 30.0F, 30.0F); } - if (this.positionChanged && !this.bQ()) { - this.bd = true; + if (this.positionChanged && !this.bS()) { + this.bc = true; } if (this.random.nextFloat() < 0.8F && (flag || flag1)) { - this.bd = true; + this.bc = true; } this.world.methodProfiler.b(); } else { - super.bq(); + super.bp(); this.pathEntity = null; } } - protected void bO() { + protected void bQ() { this.world.methodProfiler.a("stroll"); boolean flag = false; int i = -1; @@ -214,7 +214,7 @@ public abstract class EntityCreature extends EntityInsentient { return super.canSpawn() && this.a(i, j, k) >= 0.0F; } - public boolean bQ() { + public boolean bS() { return this.pathEntity != null; } @@ -222,7 +222,7 @@ public abstract class EntityCreature extends EntityInsentient { this.pathEntity = pathentity; } - public Entity bR() { + public Entity bT() { return this.target; } @@ -230,7 +230,7 @@ public abstract class EntityCreature extends EntityInsentient { this.target = entity; } - public boolean bS() { + public boolean bU() { return this.b(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ)); } @@ -243,29 +243,29 @@ public abstract class EntityCreature extends EntityInsentient { this.br = (float) l; } - public ChunkCoordinates bT() { + public ChunkCoordinates bV() { return this.bq; } - public float bU() { + public float bW() { return this.br; } - public void bV() { + public void bX() { this.br = -1.0F; } - public boolean bW() { + public boolean bY() { return this.br != -1.0F; } - protected void bJ() { - super.bJ(); - if (this.bL() && this.getLeashHolder() != null && this.getLeashHolder().world == this.world) { + protected void bL() { + super.bL(); + if (this.bN() && this.getLeashHolder() != null && this.getLeashHolder().world == this.world) { Entity entity = this.getLeashHolder(); this.a((int) entity.locX, (int) entity.locY, (int) entity.locZ, 5); - float f = this.d(entity); + float f = this.e(entity); if (this instanceof EntityTameableAnimal && ((EntityTameableAnimal) this).isSitting()) { if (f > 10.0F) { @@ -301,11 +301,11 @@ public abstract class EntityCreature extends EntityInsentient { this.world.getServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE)); // CraftBukkit this.unleash(true, true); } - } else if (!this.bL() && this.bt) { + } else if (!this.bN() && this.bt) { this.bt = false; this.goalSelector.a(this.bs); this.getNavigation().a(true); - this.bV(); + this.bX(); } } diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java index 3c51de56c6..e5d72b79a5 100644 --- a/src/main/java/net/minecraft/server/EntityCreeper.java +++ b/src/main/java/net/minecraft/server/EntityCreeper.java @@ -26,16 +26,16 @@ public class EntityCreeper extends EntityMonster { this.targetSelector.a(2, new PathfinderGoalHurtByTarget(this, false)); } - protected void aD() { - super.aD(); + protected void aC() { + super.aC(); this.getAttributeInstance(GenericAttributes.d).setValue(0.25D); } - public boolean bk() { + public boolean bj() { return true; } - public int ax() { + public int aw() { return this.getGoalTarget() == null ? 3 : 3 + (int) (this.getHealth() - 1.0F); } @@ -62,7 +62,7 @@ public class EntityCreeper extends EntityMonster { nbttagcompound.setShort("Fuse", (short) this.maxFuseTicks); nbttagcompound.setByte("ExplosionRadius", (byte) this.explosionRadius); - nbttagcompound.setBoolean("ignited", this.ca()); + nbttagcompound.setBoolean("ignited", this.cc()); } public void a(NBTTagCompound nbttagcompound) { @@ -77,18 +77,18 @@ public class EntityCreeper extends EntityMonster { } if (nbttagcompound.getBoolean("ignited")) { - this.cb(); + this.cd(); } } public void h() { if (this.isAlive()) { this.bp = this.fuseTicks; - if (this.ca()) { + if (this.cc()) { this.a(1); } - int i = this.bZ(); + int i = this.cb(); if (i > 0 && this.fuseTicks == 0) { this.makeSound("creeper.primed", 1.0F, 0.5F); @@ -101,18 +101,18 @@ public class EntityCreeper extends EntityMonster { if (this.fuseTicks >= this.maxFuseTicks) { this.fuseTicks = this.maxFuseTicks; - this.cc(); + this.ce(); } } super.h(); } - protected String aT() { + protected String aS() { return "mob.creeper.say"; } - protected String aU() { + protected String aT() { return "mob.creeper.death"; } @@ -159,7 +159,7 @@ public class EntityCreeper extends EntityMonster { } // CraftBukkit end - public boolean m(Entity entity) { + public boolean n(Entity entity) { return true; } @@ -171,7 +171,7 @@ public class EntityCreeper extends EntityMonster { return Items.SULPHUR; } - public int bZ() { + public int cb() { return this.datawatcher.getByte(16); } @@ -203,9 +203,9 @@ public class EntityCreeper extends EntityMonster { if (itemstack != null && itemstack.getItem() == Items.FLINT_AND_STEEL) { this.world.makeSound(this.locX + 0.5D, this.locY + 0.5D, this.locZ + 0.5D, "fire.ignite", 1.0F, this.random.nextFloat() * 0.4F + 0.8F); - entityhuman.ba(); + entityhuman.aZ(); if (!this.world.isStatic) { - this.cb(); + this.cd(); itemstack.damage(1, entityhuman); return true; } @@ -214,7 +214,7 @@ public class EntityCreeper extends EntityMonster { return super.a(entityhuman); } - private void cc() { + private void ce() { if (!this.world.isStatic) { boolean flag = this.world.getGameRules().getBoolean("mobGriefing"); @@ -233,11 +233,11 @@ public class EntityCreeper extends EntityMonster { } } - public boolean ca() { + public boolean cc() { return this.datawatcher.getByte(18) != 0; } - public void cb() { + public void cd() { this.datawatcher.watch(18, Byte.valueOf((byte) 1)); } } diff --git a/src/main/java/net/minecraft/server/EntityDamageSourceIndirect.java b/src/main/java/net/minecraft/server/EntityDamageSourceIndirect.java index 8c4670bab5..552ccd22ad 100644 --- a/src/main/java/net/minecraft/server/EntityDamageSourceIndirect.java +++ b/src/main/java/net/minecraft/server/EntityDamageSourceIndirect.java @@ -19,7 +19,7 @@ public class EntityDamageSourceIndirect extends EntityDamageSource { public IChatBaseComponent getLocalizedDeathMessage(EntityLiving entityliving) { IChatBaseComponent ichatbasecomponent = this.owner == null ? this.p.getScoreboardDisplayName() : this.owner.getScoreboardDisplayName(); - ItemStack itemstack = this.owner instanceof EntityLiving ? ((EntityLiving) this.owner).be() : null; + ItemStack itemstack = this.owner instanceof EntityLiving ? ((EntityLiving) this.owner).bd() : null; String s = "death.attack." + this.translationIndex; String s1 = s + ".item"; diff --git a/src/main/java/net/minecraft/server/EntityEgg.java b/src/main/java/net/minecraft/server/EntityEgg.java index 16d8328b58..f999ddd65e 100644 --- a/src/main/java/net/minecraft/server/EntityEgg.java +++ b/src/main/java/net/minecraft/server/EntityEgg.java @@ -26,7 +26,7 @@ public class EntityEgg extends EntityProjectile { movingobjectposition.entity.damageEntity(DamageSource.projectile(this, this.getShooter()), 0.0F); } - // CraftBukkit start + // CraftBukkit start - Fire PlayerEggThrowEvent boolean hatching = !this.world.isStatic && this.random.nextInt(8) == 0; int numHatching = (this.random.nextInt(32) == 0) ? 4 : 1; if (!hatching) { diff --git a/src/main/java/net/minecraft/server/EntityEnderCrystal.java b/src/main/java/net/minecraft/server/EntityEnderCrystal.java index 51cecfea48..1def068f47 100644 --- a/src/main/java/net/minecraft/server/EntityEnderCrystal.java +++ b/src/main/java/net/minecraft/server/EntityEnderCrystal.java @@ -9,7 +9,7 @@ public class EntityEnderCrystal extends Entity { public EntityEnderCrystal(World world) { super(world); - this.l = true; + this.k = true; this.a(2.0F, 2.0F); this.height = this.length / 2.0F; this.b = 5; @@ -47,7 +47,7 @@ public class EntityEnderCrystal extends Entity { protected void a(NBTTagCompound nbttagcompound) {} - public boolean R() { + public boolean Q() { return true; } diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java index ec347127b4..f53b1834e9 100644 --- a/src/main/java/net/minecraft/server/EntityEnderDragon.java +++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java @@ -18,7 +18,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo public double h; public double i; - public double j; + public double bm; public double[][] bn = new double[64][3]; public int bo = -1; public EntityComplexPart[] children; @@ -43,14 +43,14 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo this.children = new EntityComplexPart[] { this.bq = new EntityComplexPart(this, "head", 6.0F, 6.0F), this.br = new EntityComplexPart(this, "body", 8.0F, 8.0F), this.bs = new EntityComplexPart(this, "tail", 4.0F, 4.0F), this.bt = new EntityComplexPart(this, "tail", 4.0F, 4.0F), this.bu = new EntityComplexPart(this, "tail", 4.0F, 4.0F), this.bv = new EntityComplexPart(this, "wing", 4.0F, 4.0F), this.bw = new EntityComplexPart(this, "wing", 4.0F, 4.0F)}; this.setHealth(this.getMaxHealth()); this.a(16.0F, 8.0F); - this.Y = true; + this.X = true; this.fireProof = true; this.i = 100.0D; - this.al = true; + this.ak = true; } - protected void aD() { - super.aD(); + protected void aC() { + super.aC(); this.getAttributeInstance(GenericAttributes.a).setValue(200.0D); } @@ -99,7 +99,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo f2 = (this.random.nextFloat() - 0.5F) * 8.0F; this.world.addParticle("largeexplode", this.locX + (double) f, this.locY + 2.0D + (double) f1, this.locZ + (double) f2, 0.0D, 0.0D, 0.0D); } else { - this.bN(); + this.bP(); f = 0.2F / (MathHelper.sqrt(this.motX * this.motX + this.motZ * this.motZ) * 10.0F + 1.0F); f *= (float) Math.pow(2.0D, this.motY); if (this.bA) { @@ -129,27 +129,27 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo float f3; if (this.world.isStatic) { - if (this.bh > 0) { - d0 = this.locX + (this.bi - this.locX) / (double) this.bh; - d1 = this.locY + (this.bj - this.locY) / (double) this.bh; - d2 = this.locZ + (this.bk - this.locZ) / (double) this.bh; - d3 = MathHelper.g(this.bl - (double) this.yaw); - this.yaw = (float) ((double) this.yaw + d3 / (double) this.bh); - this.pitch = (float) ((double) this.pitch + (this.bm - (double) this.pitch) / (double) this.bh); - --this.bh; + if (this.bg > 0) { + d0 = this.locX + (this.bh - this.locX) / (double) this.bg; + d1 = this.locY + (this.bi - this.locY) / (double) this.bg; + d2 = this.locZ + (this.bj - this.locZ) / (double) this.bg; + d3 = MathHelper.g(this.bk - (double) this.yaw); + this.yaw = (float) ((double) this.yaw + d3 / (double) this.bg); + this.pitch = (float) ((double) this.pitch + (this.bm - (double) this.pitch) / (double) this.bg); + --this.bg; this.setPosition(d0, d1, d2); this.b(this.yaw, this.pitch); } } else { d0 = this.h - this.locX; d1 = this.i - this.locY; - d2 = this.j - this.locZ; + d2 = this.bm - this.locZ; d3 = d0 * d0 + d1 * d1 + d2 * d2; if (this.bD != null) { this.h = this.bD.locX; - this.j = this.bD.locZ; + this.bm = this.bD.locZ; double d4 = this.h - this.locX; - double d5 = this.j - this.locZ; + double d5 = this.bm - this.locZ; double d6 = Math.sqrt(d4 * d4 + d5 * d5); double d7 = 0.4000000059604645D + d6 / 80.0D - 1.0D; @@ -160,11 +160,11 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo this.i = this.bD.boundingBox.b + d7; } else { this.h += this.random.nextGaussian() * 2.0D; - this.j += this.random.nextGaussian() * 2.0D; + this.bm += this.random.nextGaussian() * 2.0D; } - if (this.bz || d3 < 100.0D || d3 > 22500.0D || this.positionChanged || this.G) { - this.bO(); + if (this.bz || d3 < 100.0D || d3 > 22500.0D || this.positionChanged || this.F) { + this.bQ(); } d1 /= (double) MathHelper.sqrt(d0 * d0 + d2 * d2); @@ -190,15 +190,15 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo d9 = -50.0D; } - Vec3D vec3d = this.world.getVec3DPool().create(this.h - this.locX, this.i - this.locY, this.j - this.locZ).a(); - Vec3D vec3d1 = this.world.getVec3DPool().create((double) MathHelper.sin(this.yaw * 3.1415927F / 180.0F), this.motY, (double) (-MathHelper.cos(this.yaw * 3.1415927F / 180.0F))).a(); + Vec3D vec3d = Vec3D.a(this.h - this.locX, this.i - this.locY, this.bm - this.locZ).a(); + Vec3D vec3d1 = Vec3D.a((double) MathHelper.sin(this.yaw * 3.1415927F / 180.0F), this.motY, (double) (-MathHelper.cos(this.yaw * 3.1415927F / 180.0F))).a(); float f4 = (float) (vec3d1.b(vec3d) + 0.5D) / 1.5F; if (f4 < 0.0F) { f4 = 0.0F; } - this.bg *= 0.8F; + this.bf *= 0.8F; float f5 = MathHelper.sqrt(this.motX * this.motX + this.motZ * this.motZ) * 1.0F + 1.0F; double d10 = Math.sqrt(this.motX * this.motX + this.motZ * this.motZ) * 1.0D + 1.0D; @@ -206,8 +206,8 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo d10 = 40.0D; } - this.bg = (float) ((double) this.bg + d9 * (0.699999988079071D / d10 / (double) f5)); - this.yaw += this.bg * 0.1F; + this.bf = (float) ((double) this.bf + d9 * (0.699999988079071D / d10 / (double) f5)); + this.yaw += this.bf * 0.1F; float f6 = (float) (2.0D / (d10 + 1.0D)); float f7 = 0.06F; @@ -218,7 +218,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo this.move(this.motX, this.motY, this.motZ); } - Vec3D vec3d2 = this.world.getVec3DPool().create(this.motX, this.motY, this.motZ).a(); + Vec3D vec3d2 = Vec3D.a(this.motX, this.motY, this.motZ).a(); float f8 = (float) (vec3d2.b(vec3d1) + 1.0D) / 2.0F; f8 = 0.8F + 0.15F * f8; @@ -227,7 +227,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo this.motY *= 0.9100000262260437D; } - this.aN = this.yaw; + this.aM = this.yaw; this.bq.width = this.bq.length = 3.0F; this.bs.width = this.bs.length = 2.0F; this.bt.width = this.bt.length = 2.0F; @@ -260,8 +260,8 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo double[] adouble = this.b(5, 1.0F); double[] adouble1 = this.b(0, 1.0F); - f3 = MathHelper.sin(this.yaw * 3.1415927F / 180.0F - this.bg * 0.01F); - float f13 = MathHelper.cos(this.yaw * 3.1415927F / 180.0F - this.bg * 0.01F); + f3 = MathHelper.sin(this.yaw * 3.1415927F / 180.0F - this.bf * 0.01F); + float f13 = MathHelper.cos(this.yaw * 3.1415927F / 180.0F - this.bf * 0.01F); this.bq.h(); this.bq.setPositionRotation(this.locX + (double) (f3 * 5.5F * f2), this.locY + (adouble1[1] - adouble[1]) * 1.0D + (double) (f9 * 5.5F), this.locZ - (double) (f13 * 5.5F * f2), 0.0F, 0.0F); @@ -298,7 +298,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo } } - private void bN() { + private void bP() { if (this.bC != null) { if (this.bC.dead) { if (!this.world.isStatic) { @@ -335,7 +335,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo while (iterator.hasNext()) { EntityEnderCrystal entityendercrystal1 = (EntityEnderCrystal) iterator.next(); - double d1 = entityendercrystal1.e(this); + double d1 = entityendercrystal1.f(this); if (d1 < d0) { d0 = d1; @@ -375,7 +375,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo } } - private void bO() { + private void bQ() { this.bz = false; if (this.random.nextInt(2) == 0 && !this.world.players.isEmpty()) { // CraftBukkit start @@ -397,12 +397,12 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo do { this.h = 0.0D; this.i = (double) (70.0F + this.random.nextFloat() * 50.0F); - this.j = 0.0D; + this.bm = 0.0D; this.h += (double) (this.random.nextFloat() * 120.0F - 60.0F); - this.j += (double) (this.random.nextFloat() * 120.0F - 60.0F); + this.bm += (double) (this.random.nextFloat() * 120.0F - 60.0F); double d0 = this.locX - this.h; double d1 = this.locY - this.i; - double d2 = this.locZ - this.j; + double d2 = this.locZ - this.bm; flag = d0 * d0 + d1 * d1 + d2 * d2 > 100.0D; } while (!flag); @@ -507,9 +507,9 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo this.h = this.locX + (double) (f2 * 5.0F) + (double) ((this.random.nextFloat() - 0.5F) * 2.0F); this.i = this.locY + (double) (this.random.nextFloat() * 3.0F) + 1.0D; - this.j = this.locZ - (double) (f3 * 5.0F) + (double) ((this.random.nextFloat() - 0.5F) * 2.0F); + this.bm = this.locZ - (double) (f3 * 5.0F) + (double) ((this.random.nextFloat() - 0.5F) * 2.0F); this.bD = null; - if (damagesource.getEntity() instanceof EntityHuman || damagesource.c()) { + if (damagesource.getEntity() instanceof EntityHuman || damagesource.isExplosion()) { this.dealDamage(damagesource, f); } @@ -524,7 +524,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo return super.damageEntity(damagesource, f); } - protected void aF() { + protected void aE() { if (this.dead) return; // CraftBukkit - can't kill what's already dead ++this.bB; if (this.bB >= 180 && this.bB <= 200) { @@ -555,7 +555,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo } this.move(0.0D, 0.10000000149011612D, 0.0D); - this.aN = this.yaw += 20.0F; + this.aM = this.yaw += 20.0F; if (this.bB == 200 && !this.world.isStatic) { i = this.expToDrop - (10 * this.expToDrop / 12); // CraftBukkit - drop the remaining experience @@ -638,11 +638,11 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo protected void w() {} - public Entity[] at() { + public Entity[] as() { return this.children; } - public boolean R() { + public boolean Q() { return false; } @@ -654,11 +654,11 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo return "mob.enderdragon.growl"; } - protected String aT() { + protected String aS() { return "mob.enderdragon.hit"; } - protected float bf() { + protected float be() { return 5.0F; } diff --git a/src/main/java/net/minecraft/server/EntityEnderPearl.java b/src/main/java/net/minecraft/server/EntityEnderPearl.java index 3a602af079..9e4526e3ed 100644 --- a/src/main/java/net/minecraft/server/EntityEnderPearl.java +++ b/src/main/java/net/minecraft/server/EntityEnderPearl.java @@ -29,8 +29,8 @@ public class EntityEnderPearl extends EntityProjectile { if (this.getShooter() != null && this.getShooter() instanceof EntityPlayer) { EntityPlayer entityplayer = (EntityPlayer) this.getShooter(); - if (entityplayer.playerConnection.b().d() && entityplayer.world == this.world) { - // CraftBukkit start + if (entityplayer.playerConnection.b().isConnected() && entityplayer.world == this.world) { + // CraftBukkit start - Fire PlayerTeleportEvent org.bukkit.craftbukkit.entity.CraftPlayer player = entityplayer.getBukkitEntity(); org.bukkit.Location location = getBukkitEntity().getLocation(); location.setPitch(player.getLocation().getPitch()); diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java index c73bdf7836..0f02e7d62e 100644 --- a/src/main/java/net/minecraft/server/EntityEnderman.java +++ b/src/main/java/net/minecraft/server/EntityEnderman.java @@ -21,11 +21,11 @@ public class EntityEnderman extends EntityMonster { public EntityEnderman(World world) { super(world); this.a(0.6F, 2.9F); - this.X = 1.0F; + this.W = 1.0F; } - protected void aD() { - super.aD(); + protected void aC() { + super.aC(); this.getAttributeInstance(GenericAttributes.a).setValue(40.0D); this.getAttributeInstance(GenericAttributes.d).setValue(0.30000001192092896D); this.getAttributeInstance(GenericAttributes.e).setValue(7.0D); @@ -80,18 +80,18 @@ public class EntityEnderman extends EntityMonster { return false; } else { Vec3D vec3d = entityhuman.j(1.0F).a(); - Vec3D vec3d1 = this.world.getVec3DPool().create(this.locX - entityhuman.locX, this.boundingBox.b + (double) (this.length / 2.0F) - (entityhuman.locY + (double) entityhuman.getHeadHeight()), this.locZ - entityhuman.locZ); + Vec3D vec3d1 = Vec3D.a(this.locX - entityhuman.locX, this.boundingBox.b + (double) (this.length / 2.0F) - (entityhuman.locY + (double) entityhuman.getHeadHeight()), this.locZ - entityhuman.locZ); double d0 = vec3d1.b(); vec3d1 = vec3d1.a(); double d1 = vec3d.b(vec3d1); - return d1 > 1.0D - 0.025D / d0 ? entityhuman.o(this) : false; + return d1 > 1.0D - 0.025D / d0 && entityhuman.p(this); } } public void e() { - if (this.L()) { + if (this.K()) { this.damageEntity(DamageSource.DROWN, 1.0F); } @@ -150,29 +150,29 @@ public class EntityEnderman extends EntityMonster { this.world.addParticle("portal", this.locX + (this.random.nextDouble() - 0.5D) * (double) this.width, this.locY + this.random.nextDouble() * (double) this.length - 0.25D, this.locZ + (this.random.nextDouble() - 0.5D) * (double) this.width, (this.random.nextDouble() - 0.5D) * 2.0D, -this.random.nextDouble(), (this.random.nextDouble() - 0.5D) * 2.0D); } - if (this.world.v() && !this.world.isStatic) { + if (this.world.w() && !this.world.isStatic) { float f = this.d(1.0F); if (f > 0.5F && this.world.i(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) { this.target = null; this.a(false); this.bv = false; - this.bX(); + this.bZ(); } } - if (this.L() || this.isBurning()) { + if (this.K() || this.isBurning()) { this.target = null; this.a(false); this.bv = false; - this.bX(); + this.bZ(); } - if (this.cb() && !this.bv && this.random.nextInt(100) == 0) { + if (this.cd() && !this.bv && this.random.nextInt(100) == 0) { this.a(false); } - this.bd = false; + this.bc = false; if (this.target != null) { this.a(this.target, 100.0F, 100.0F); } @@ -180,12 +180,12 @@ public class EntityEnderman extends EntityMonster { if (!this.world.isStatic && this.isAlive()) { if (this.target != null) { if (this.target instanceof EntityHuman && this.f((EntityHuman) this.target)) { - if (this.target.e((Entity) this) < 16.0D) { - this.bX(); + if (this.target.f((Entity) this) < 16.0D) { + this.bZ(); } this.bs = 0; - } else if (this.target.e((Entity) this) > 256.0D && this.bs++ >= 30 && this.c(this.target)) { + } else if (this.target.f((Entity) this) > 256.0D && this.bs++ >= 30 && this.c(this.target)) { this.bs = 0; } } else { @@ -197,7 +197,7 @@ public class EntityEnderman extends EntityMonster { super.e(); } - protected boolean bX() { + protected boolean bZ() { double d0 = this.locX + (this.random.nextDouble() - 0.5D) * 64.0D; double d1 = this.locY + (double) (this.random.nextInt(64) - 32); double d2 = this.locZ + (this.random.nextDouble() - 0.5D) * 64.0D; @@ -206,13 +206,13 @@ public class EntityEnderman extends EntityMonster { } protected boolean c(Entity entity) { - Vec3D vec3d = this.world.getVec3DPool().create(this.locX - entity.locX, this.boundingBox.b + (double) (this.length / 2.0F) - entity.locY + (double) entity.getHeadHeight(), this.locZ - entity.locZ); + Vec3D vec3d = Vec3D.a(this.locX - entity.locX, this.boundingBox.b + (double) (this.length / 2.0F) - entity.locY + (double) entity.getHeadHeight(), this.locZ - entity.locZ); vec3d = vec3d.a(); double d0 = 16.0D; - double d1 = this.locX + (this.random.nextDouble() - 0.5D) * 8.0D - vec3d.c * d0; - double d2 = this.locY + (double) (this.random.nextInt(16) - 8) - vec3d.d * d0; - double d3 = this.locZ + (this.random.nextDouble() - 0.5D) * 8.0D - vec3d.e * d0; + double d1 = this.locX + (this.random.nextDouble() - 0.5D) * 8.0D - vec3d.a * d0; + double d2 = this.locY + (double) (this.random.nextInt(16) - 8) - vec3d.b * d0; + double d3 = this.locZ + (this.random.nextDouble() - 0.5D) * 8.0D - vec3d.c * d0; return this.k(d1, d2, d3); } @@ -287,14 +287,14 @@ public class EntityEnderman extends EntityMonster { } protected String t() { - return this.cb() ? "mob.endermen.scream" : "mob.endermen.idle"; + return this.cd() ? "mob.endermen.scream" : "mob.endermen.idle"; } - protected String aT() { + protected String aS() { return "mob.endermen.hit"; } - protected String aU() { + protected String aT() { return "mob.endermen.death"; } @@ -348,7 +348,7 @@ public class EntityEnderman extends EntityMonster { this.bv = false; for (int i = 0; i < 64; ++i) { - if (this.bX()) { + if (this.bZ()) { return true; } } @@ -360,7 +360,7 @@ public class EntityEnderman extends EntityMonster { } } - public boolean cb() { + public boolean cd() { return this.datawatcher.getByte(18) > 0; } @@ -371,7 +371,7 @@ public class EntityEnderman extends EntityMonster { static { br[Block.b((Block) Blocks.GRASS)] = true; br[Block.b(Blocks.DIRT)] = true; - br[Block.b(Blocks.SAND)] = true; + br[Block.b((Block) Blocks.SAND)] = true; br[Block.b(Blocks.GRAVEL)] = true; br[Block.b((Block) Blocks.YELLOW_FLOWER)] = true; br[Block.b((Block) Blocks.RED_ROSE)] = true; diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java index d79f69339f..8ed492b9a8 100644 --- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java +++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java @@ -60,7 +60,7 @@ public class EntityExperienceOrb extends Entity { double d0 = 8.0D; if (this.targetTime < this.a - 20 + this.getId() % 100) { - if (this.targetPlayer == null || this.targetPlayer.e(this) > d0 * d0) { + if (this.targetPlayer == null || this.targetPlayer.f(this) > d0 * d0) { this.targetPlayer = this.world.findNearbyPlayer(this, d0); } @@ -109,7 +109,7 @@ public class EntityExperienceOrb extends Entity { } } - public boolean N() { + public boolean M() { return this.world.a(this.boundingBox, Material.WATER, (Entity) this); } @@ -121,7 +121,7 @@ public class EntityExperienceOrb extends Entity { if (this.isInvulnerable()) { return false; } else { - this.Q(); + this.P(); this.d = (int) ((float) this.d - f); if (this.d <= 0) { this.die(); @@ -145,11 +145,11 @@ public class EntityExperienceOrb extends Entity { public void b_(EntityHuman entityhuman) { if (!this.world.isStatic) { - if (this.c == 0 && entityhuman.bu == 0) { - entityhuman.bu = 2; + if (this.c == 0 && entityhuman.bt == 0) { + entityhuman.bt = 2; this.world.makeSound(entityhuman, "random.orb", 0.1F, 0.5F * ((this.random.nextFloat() - this.random.nextFloat()) * 0.7F + 1.8F)); entityhuman.receive(this, 1); - entityhuman.giveExp(CraftEventFactory.callPlayerExpChangeEvent(entityhuman, this.value).getAmount()); // CraftBukkit - this.value to event.getAmount() + entityhuman.giveExp(CraftEventFactory.callPlayerExpChangeEvent(entityhuman, this.value).getAmount()); // CraftBukkit - this.value -> event.getAmount() this.die(); } } @@ -182,7 +182,7 @@ public class EntityExperienceOrb extends Entity { return i >= 2477 ? 2477 : (i >= 1237 ? 1237 : (i >= 617 ? 617 : (i >= 307 ? 307 : (i >= 149 ? 149 : (i >= 73 ? 73 : (i >= 37 ? 37 : (i >= 17 ? 17 : (i >= 7 ? 7 : (i >= 3 ? 3 : 1))))))))); } - public boolean av() { + public boolean au() { return false; } } diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java index 991a765871..bc512172a5 100644 --- a/src/main/java/net/minecraft/server/EntityFallingBlock.java +++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java @@ -38,7 +38,7 @@ public class EntityFallingBlock extends Entity { this.fallHurtAmount = 2.0F; this.id = block; this.data = i; - this.l = true; + this.k = true; this.a(0.98F, 0.98F); this.height = this.length / 2.0F; this.setPosition(d0, d1, d2); @@ -56,7 +56,7 @@ public class EntityFallingBlock extends Entity { protected void c() {} - public boolean R() { + public boolean Q() { return !this.dead; } @@ -94,7 +94,7 @@ public class EntityFallingBlock extends Entity { this.motY *= -0.5D; if (this.world.getType(i, j, k) != Blocks.PISTON_MOVING) { this.die(); - // CraftBukkit start + // CraftBukkit start - fire EntityChangeBlockEvent if (!this.f && this.world.mayPlace(this.id, i, j, k, true, 1, (Entity) null, (ItemStack) null) && !BlockFalling.canFall(this.world, i, j - 1, k) /* mimic the false conditions of setTypeIdAndData */ && i >= -30000000 && k >= -30000000 && i < 30000000 && k < 30000000 && j > 0 && j < 256 && !(this.world.getType(i, j, k) == this.id && this.world.getData(i, j, k) == this.data)) { if (CraftEventFactory.callEntityChangeBlockEvent(this, i, j, k, this.id, this.data).isCancelled()) { return; diff --git a/src/main/java/net/minecraft/server/EntityFireball.java b/src/main/java/net/minecraft/server/EntityFireball.java index 939de5dd3c..0eecaad4bb 100644 --- a/src/main/java/net/minecraft/server/EntityFireball.java +++ b/src/main/java/net/minecraft/server/EntityFireball.java @@ -12,7 +12,7 @@ public abstract class EntityFireball extends Entity { private Block h; private boolean i; public EntityLiving shooter; - private int j; + private int at; private int au; public double dirX; public double dirY; @@ -72,8 +72,8 @@ public abstract class EntityFireball extends Entity { this.setOnFire(1); if (this.i) { if (this.world.getType(this.e, this.f, this.g) == this.h) { - ++this.j; - if (this.j == 600) { + ++this.at; + if (this.at == 600) { this.die(); } @@ -84,20 +84,20 @@ public abstract class EntityFireball extends Entity { this.motX *= (double) (this.random.nextFloat() * 0.2F); this.motY *= (double) (this.random.nextFloat() * 0.2F); this.motZ *= (double) (this.random.nextFloat() * 0.2F); - this.j = 0; + this.at = 0; this.au = 0; } else { ++this.au; } - Vec3D vec3d = this.world.getVec3DPool().create(this.locX, this.locY, this.locZ); - Vec3D vec3d1 = this.world.getVec3DPool().create(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ); + Vec3D vec3d = Vec3D.a(this.locX, this.locY, this.locZ); + Vec3D vec3d1 = Vec3D.a(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ); MovingObjectPosition movingobjectposition = this.world.a(vec3d, vec3d1); - vec3d = this.world.getVec3DPool().create(this.locX, this.locY, this.locZ); - vec3d1 = this.world.getVec3DPool().create(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ); + vec3d = Vec3D.a(this.locX, this.locY, this.locZ); + vec3d1 = Vec3D.a(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ); if (movingobjectposition != null) { - vec3d1 = this.world.getVec3DPool().create(movingobjectposition.pos.c, movingobjectposition.pos.d, movingobjectposition.pos.e); + vec3d1 = Vec3D.a(movingobjectposition.pos.a, movingobjectposition.pos.b, movingobjectposition.pos.c); } Entity entity = null; @@ -107,7 +107,7 @@ public abstract class EntityFireball extends Entity { for (int i = 0; i < list.size(); ++i) { Entity entity1 = (Entity) list.get(i); - if (entity1.R() && (!entity1.h(this.shooter) || this.au >= 25)) { + if (entity1.Q() && (!entity1.i(this.shooter) || this.au >= 25)) { float f = 0.3F; AxisAlignedBB axisalignedbb = entity1.boundingBox.grow((double) f, (double) f, (double) f); MovingObjectPosition movingobjectposition1 = axisalignedbb.a(vec3d, vec3d1); @@ -130,7 +130,7 @@ public abstract class EntityFireball extends Entity { if (movingobjectposition != null) { this.a(movingobjectposition); - // CraftBukkit start + // CraftBukkit start - Fire ProjectileHitEvent if (this.dead) { org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this); } @@ -164,7 +164,7 @@ public abstract class EntityFireball extends Entity { this.yaw = this.lastYaw + (this.yaw - this.lastYaw) * 0.2F; float f2 = this.e(); - if (this.M()) { + if (this.L()) { for (int j = 0; j < 4; ++j) { float f3 = 0.25F; @@ -220,11 +220,11 @@ public abstract class EntityFireball extends Entity { } } - public boolean R() { + public boolean Q() { return true; } - public float af() { + public float ae() { return 1.0F; } @@ -232,7 +232,7 @@ public abstract class EntityFireball extends Entity { if (this.isInvulnerable()) { return false; } else { - this.Q(); + this.P(); if (damagesource.getEntity() != null) { // CraftBukkit start EntityDamageByEntityEvent event = new EntityDamageByEntityEvent(damagesource.getEntity().getBukkitEntity(), this.getBukkitEntity(), org.bukkit.event.entity.EntityDamageEvent.DamageCause.ENTITY_ATTACK, f); @@ -244,12 +244,12 @@ public abstract class EntityFireball extends Entity { } // CraftBukkit end - Vec3D vec3d = damagesource.getEntity().ag(); + Vec3D vec3d = damagesource.getEntity().af(); if (vec3d != null) { - this.motX = vec3d.c; - this.motY = vec3d.d; - this.motZ = vec3d.e; + this.motX = vec3d.a; + this.motY = vec3d.b; + this.motZ = vec3d.c; this.dirX = this.motX * 0.1D; this.dirY = this.motY * 0.1D; this.dirZ = this.motZ * 0.1D; diff --git a/src/main/java/net/minecraft/server/EntityFireworks.java b/src/main/java/net/minecraft/server/EntityFireworks.java index 261262ede2..a228a2cecf 100644 --- a/src/main/java/net/minecraft/server/EntityFireworks.java +++ b/src/main/java/net/minecraft/server/EntityFireworks.java @@ -39,9 +39,9 @@ public class EntityFireworks extends Entity { } public void h() { - this.T = this.locX; - this.U = this.locY; - this.V = this.locZ; + this.S = this.locX; + this.T = this.locY; + this.U = this.locZ; super.h(); this.motX *= 1.15D; this.motZ *= 1.15D; @@ -115,7 +115,7 @@ public class EntityFireworks extends Entity { return super.d(f); } - public boolean av() { + public boolean au() { return false; } } diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java index 9b81376707..2a73b6c41e 100644 --- a/src/main/java/net/minecraft/server/EntityFishingHook.java +++ b/src/main/java/net/minecraft/server/EntityFishingHook.java @@ -18,7 +18,7 @@ public class EntityFishingHook extends Entity { private int g = -1; private int h = -1; private int i = -1; - private Block j; + private Block at; private boolean au; public int a; public EntityHuman owner; @@ -39,12 +39,12 @@ public class EntityFishingHook extends Entity { public EntityFishingHook(World world) { super(world); this.a(0.25F, 0.25F); - this.al = true; + this.ak = true; } public EntityFishingHook(World world, EntityHuman entityhuman) { super(world); - this.al = true; + this.ak = true; this.owner = entityhuman; this.owner.hookedFish = this; this.a(0.25F, 0.25F); @@ -101,9 +101,9 @@ public class EntityFishingHook extends Entity { this.b(this.yaw, this.pitch); } else { if (!this.world.isStatic) { - ItemStack itemstack = this.owner.bD(); + ItemStack itemstack = this.owner.bE(); - if (this.owner.dead || !this.owner.isAlive() || itemstack == null || itemstack.getItem() != Items.FISHING_ROD || this.e(this.owner) > 1024.0D) { + if (this.owner.dead || !this.owner.isAlive() || itemstack == null || itemstack.getItem() != Items.FISHING_ROD || this.f(this.owner) > 1024.0D) { this.die(); this.owner.hookedFish = null; return; @@ -126,7 +126,7 @@ public class EntityFishingHook extends Entity { } if (this.au) { - if (this.world.getType(this.g, this.h, this.i) == this.j) { + if (this.world.getType(this.g, this.h, this.i) == this.at) { ++this.av; if (this.av == 1200) { this.die(); @@ -145,14 +145,14 @@ public class EntityFishingHook extends Entity { ++this.aw; } - Vec3D vec3d = this.world.getVec3DPool().create(this.locX, this.locY, this.locZ); - Vec3D vec3d1 = this.world.getVec3DPool().create(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ); + Vec3D vec3d = Vec3D.a(this.locX, this.locY, this.locZ); + Vec3D vec3d1 = Vec3D.a(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ); MovingObjectPosition movingobjectposition = this.world.a(vec3d, vec3d1); - vec3d = this.world.getVec3DPool().create(this.locX, this.locY, this.locZ); - vec3d1 = this.world.getVec3DPool().create(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ); + vec3d = Vec3D.a(this.locX, this.locY, this.locZ); + vec3d1 = Vec3D.a(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ); if (movingobjectposition != null) { - vec3d1 = this.world.getVec3DPool().create(movingobjectposition.pos.c, movingobjectposition.pos.d, movingobjectposition.pos.e); + vec3d1 = Vec3D.a(movingobjectposition.pos.a, movingobjectposition.pos.b, movingobjectposition.pos.c); } Entity entity = null; @@ -164,7 +164,7 @@ public class EntityFishingHook extends Entity { for (int i = 0; i < list.size(); ++i) { Entity entity1 = (Entity) list.get(i); - if (entity1.R() && (entity1 != this.owner || this.aw >= 5)) { + if (entity1.Q() && (entity1 != this.owner || this.aw >= 5)) { float f = 0.3F; AxisAlignedBB axisalignedbb = entity1.boundingBox.grow((double) f, (double) f, (double) f); MovingObjectPosition movingobjectposition1 = axisalignedbb.a(vec3d, vec3d1); @@ -230,7 +230,7 @@ public class EntityFishingHook extends Entity { for (int j = 0; j < b0; ++j) { double d7 = this.boundingBox.b + (this.boundingBox.e - this.boundingBox.b) * (double) (j + 0) / (double) b0 - 0.125D + 0.125D; double d8 = this.boundingBox.b + (this.boundingBox.e - this.boundingBox.b) * (double) (j + 1) / (double) b0 - 0.125D + 0.125D; - AxisAlignedBB axisalignedbb1 = AxisAlignedBB.a().a(this.boundingBox.a, d7, this.boundingBox.c, this.boundingBox.d, d8, this.boundingBox.f); + AxisAlignedBB axisalignedbb1 = AxisAlignedBB.a(this.boundingBox.a, d7, this.boundingBox.c, this.boundingBox.d, d8, this.boundingBox.f); if (this.world.b(axisalignedbb1, Material.WATER)) { d6 += 1.0D / (double) b0; @@ -344,7 +344,7 @@ public class EntityFishingHook extends Entity { nbttagcompound.setShort("xTile", (short) this.g); nbttagcompound.setShort("yTile", (short) this.h); nbttagcompound.setShort("zTile", (short) this.i); - nbttagcompound.setByte("inTile", (byte) Block.b(this.j)); + nbttagcompound.setByte("inTile", (byte) Block.b(this.at)); nbttagcompound.setByte("shake", (byte) this.a); nbttagcompound.setByte("inGround", (byte) (this.au ? 1 : 0)); } @@ -353,7 +353,7 @@ public class EntityFishingHook extends Entity { this.g = nbttagcompound.getShort("xTile"); this.h = nbttagcompound.getShort("yTile"); this.i = nbttagcompound.getShort("zTile"); - this.j = Block.e(nbttagcompound.getByte("inTile") & 255); + this.at = Block.e(nbttagcompound.getByte("inTile") & 255); this.a = nbttagcompound.getByte("shake") & 255; this.au = nbttagcompound.getByte("inGround") == 1; } diff --git a/src/main/java/net/minecraft/server/EntityGhast.java b/src/main/java/net/minecraft/server/EntityGhast.java index 982e434974..00fd1ec3f4 100644 --- a/src/main/java/net/minecraft/server/EntityGhast.java +++ b/src/main/java/net/minecraft/server/EntityGhast.java @@ -10,7 +10,7 @@ public class EntityGhast extends EntityFlying implements IMonster { public int h; public double i; - public double j; + public double bm; public double bn; private Entity target; private int br; @@ -42,12 +42,12 @@ public class EntityGhast extends EntityFlying implements IMonster { this.datawatcher.a(16, Byte.valueOf((byte) 0)); } - protected void aD() { - super.aD(); + protected void aC() { + super.aC(); this.getAttributeInstance(GenericAttributes.a).setValue(10.0D); } - protected void bq() { + protected void bp() { if (!this.world.isStatic && this.world.difficulty == EnumDifficulty.PEACEFUL) { this.die(); } @@ -55,32 +55,32 @@ public class EntityGhast extends EntityFlying implements IMonster { this.w(); this.bo = this.bp; double d0 = this.i - this.locX; - double d1 = this.j - this.locY; + double d1 = this.bm - this.locY; double d2 = this.bn - this.locZ; double d3 = d0 * d0 + d1 * d1 + d2 * d2; if (d3 < 1.0D || d3 > 3600.0D) { this.i = this.locX + (double) ((this.random.nextFloat() * 2.0F - 1.0F) * 16.0F); - this.j = this.locY + (double) ((this.random.nextFloat() * 2.0F - 1.0F) * 16.0F); + this.bm = this.locY + (double) ((this.random.nextFloat() * 2.0F - 1.0F) * 16.0F); this.bn = this.locZ + (double) ((this.random.nextFloat() * 2.0F - 1.0F) * 16.0F); } if (this.h-- <= 0) { this.h += this.random.nextInt(5) + 2; d3 = (double) MathHelper.sqrt(d3); - if (this.a(this.i, this.j, this.bn, d3)) { + if (this.a(this.i, this.bm, this.bn, d3)) { this.motX += d0 / d3 * 0.1D; this.motY += d1 / d3 * 0.1D; this.motZ += d2 / d3 * 0.1D; } else { this.i = this.locX; - this.j = this.locY; + this.bm = this.locY; this.bn = this.locZ; } } if (this.target != null && this.target.dead) { - // CraftBukkit start + // CraftBukkit start - fire EntityTargetEvent EntityTargetEvent event = new EntityTargetEvent(this.getBukkitEntity(), null, EntityTargetEvent.TargetReason.TARGET_DIED); this.world.getServer().getPluginManager().callEvent(event); @@ -95,7 +95,7 @@ public class EntityGhast extends EntityFlying implements IMonster { } if (this.target == null || this.br-- <= 0) { - // CraftBukkit start + // CraftBukkit start - fire EntityTargetEvent Entity target = this.world.findNearbyVulnerablePlayer(this, 100.0D); if (target != null) { EntityTargetEvent event = new EntityTargetEvent(this.getBukkitEntity(), target.getBukkitEntity(), EntityTargetEvent.TargetReason.CLOSEST_PLAYER); @@ -118,13 +118,13 @@ public class EntityGhast extends EntityFlying implements IMonster { double d4 = 64.0D; - if (this.target != null && this.target.e((Entity) this) < d4 * d4) { + if (this.target != null && this.target.f((Entity) this) < d4 * d4) { double d5 = this.target.locX - this.locX; double d6 = this.target.boundingBox.b + (double) (this.target.length / 2.0F) - (this.locY + (double) (this.length / 2.0F)); double d7 = this.target.locZ - this.locZ; - this.aN = this.yaw = -((float) Math.atan2(d5, d7)) * 180.0F / 3.1415927F; - if (this.o(this.target)) { + this.aM = this.yaw = -((float) Math.atan2(d5, d7)) * 180.0F / 3.1415927F; + if (this.p(this.target)) { if (this.bp == 10) { this.world.a((EntityHuman) null, 1007, (int) this.locX, (int) this.locY, (int) this.locZ, 0); } @@ -139,9 +139,9 @@ public class EntityGhast extends EntityFlying implements IMonster { double d8 = 4.0D; Vec3D vec3d = this.j(1.0F); - entitylargefireball.locX = this.locX + vec3d.c * d8; + entitylargefireball.locX = this.locX + vec3d.a * d8; entitylargefireball.locY = this.locY + (double) (this.length / 2.0F) + 0.5D; - entitylargefireball.locZ = this.locZ + vec3d.e * d8; + entitylargefireball.locZ = this.locZ + vec3d.c * d8; this.world.addEntity(entitylargefireball); this.bp = -40; } @@ -149,7 +149,7 @@ public class EntityGhast extends EntityFlying implements IMonster { --this.bp; } } else { - this.aN = this.yaw = -((float) Math.atan2(this.motX, this.motZ)) * 180.0F / 3.1415927F; + this.aM = this.yaw = -((float) Math.atan2(this.motX, this.motZ)) * 180.0F / 3.1415927F; if (this.bp > 0) { --this.bp; } @@ -167,7 +167,7 @@ public class EntityGhast extends EntityFlying implements IMonster { private boolean a(double d0, double d1, double d2, double d3) { double d4 = (this.i - this.locX) / d3; - double d5 = (this.j - this.locY) / d3; + double d5 = (this.bm - this.locY) / d3; double d6 = (this.bn - this.locZ) / d3; AxisAlignedBB axisalignedbb = this.boundingBox.clone(); @@ -185,11 +185,11 @@ public class EntityGhast extends EntityFlying implements IMonster { return "mob.ghast.moan"; } - protected String aT() { + protected String aS() { return "mob.ghast.scream"; } - protected String aU() { + protected String aT() { return "mob.ghast.death"; } @@ -218,7 +218,7 @@ public class EntityGhast extends EntityFlying implements IMonster { // CraftBukkit end } - protected float bf() { + protected float be() { return 10.0F; } @@ -226,7 +226,7 @@ public class EntityGhast extends EntityFlying implements IMonster { return this.random.nextInt(20) == 0 && super.canSpawn() && this.world.difficulty != EnumDifficulty.PEACEFUL; } - public int bz() { + public int bB() { return 1; } diff --git a/src/main/java/net/minecraft/server/EntityHanging.java b/src/main/java/net/minecraft/server/EntityHanging.java index 670ca65b24..56071ff117 100644 --- a/src/main/java/net/minecraft/server/EntityHanging.java +++ b/src/main/java/net/minecraft/server/EntityHanging.java @@ -105,7 +105,7 @@ public abstract class EntityHanging extends Entity { if (this.e++ == 100 && !this.world.isStatic) { this.e = 0; if (!this.dead && !this.survives()) { - // CraftBukkit start + // CraftBukkit start - fire break events Material material = this.world.getType((int) this.locX, (int) this.locY, (int) this.locZ).getMaterial(); HangingBreakEvent.RemoveCause cause; @@ -199,11 +199,11 @@ public abstract class EntityHanging extends Entity { } } - public boolean R() { + public boolean Q() { return true; } - public boolean i(Entity entity) { + public boolean j(Entity entity) { return entity instanceof EntityHuman ? this.damageEntity(DamageSource.playerAttack((EntityHuman) entity), 0.0F) : false; } @@ -216,7 +216,7 @@ public abstract class EntityHanging extends Entity { return false; } else { if (!this.dead && !this.world.isStatic) { - // CraftBukkit start + // CraftBukkit start - fire break events HangingBreakEvent event = new HangingBreakEvent((Hanging) this.getBukkitEntity(), HangingBreakEvent.RemoveCause.DEFAULT); PaintingBreakEvent paintingEvent = null; if (damagesource.getEntity() != null) { @@ -226,7 +226,7 @@ public abstract class EntityHanging extends Entity { // Fire old painting event until it can be removed paintingEvent = new org.bukkit.event.painting.PaintingBreakByEntityEvent((Painting) this.getBukkitEntity(), damagesource.getEntity() == null ? null : damagesource.getEntity().getBukkitEntity()); } - } else if (damagesource.c()) { + } else if (damagesource.isExplosion()) { event = new HangingBreakEvent((Hanging) this.getBukkitEntity(), HangingBreakEvent.RemoveCause.EXPLOSION); } @@ -243,7 +243,7 @@ public abstract class EntityHanging extends Entity { // CraftBukkit end this.die(); - this.Q(); + this.P(); this.b(damagesource.getEntity()); } @@ -255,7 +255,7 @@ public abstract class EntityHanging extends Entity { if (!this.world.isStatic && !this.dead && d0 * d0 + d1 * d1 + d2 * d2 > 0.0D) { if (this.dead) return; // CraftBukkit - // CraftBukkit start + // CraftBukkit start - fire break events // TODO - Does this need its own cause? Seems to only be triggered by pistons HangingBreakEvent event = new HangingBreakEvent((Hanging) this.getBukkitEntity(), HangingBreakEvent.RemoveCause.PHYSICS); this.world.getServer().getPluginManager().callEvent(event); @@ -334,7 +334,7 @@ public abstract class EntityHanging extends Entity { public abstract void b(Entity entity); - protected boolean V() { + protected boolean U() { return false; } } diff --git a/src/main/java/net/minecraft/server/EntityHorse.java b/src/main/java/net/minecraft/server/EntityHorse.java index d9f2f3ec67..6616ffb0f4 100644 --- a/src/main/java/net/minecraft/server/EntityHorse.java +++ b/src/main/java/net/minecraft/server/EntityHorse.java @@ -69,7 +69,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { public void setType(int i) { this.datawatcher.watch(19, Byte.valueOf((byte) i)); - this.cN(); + this.cP(); } public int getType() { @@ -78,7 +78,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { public void setVariant(int i) { this.datawatcher.watch(20, Integer.valueOf(i)); - this.cN(); + this.cP(); } public int getVariant() { @@ -125,7 +125,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { } } - public boolean bZ() { + public boolean cb() { return !this.isBaby(); } @@ -133,8 +133,8 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { return this.x(2); } - public boolean ce() { - return this.bZ(); + public boolean cg() { + return this.cb(); } public String getOwnerName() { @@ -145,7 +145,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { this.datawatcher.watch(21, s); } - public float cg() { + public float ci() { int i = this.getAge(); return i >= 0 ? 1.0F : 0.5F + (float) (-24000 - i) / -24000.0F * 0.5F; @@ -153,13 +153,13 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { public void a(boolean flag) { if (flag) { - this.a(this.cg()); + this.a(this.ci()); } else { this.a(1.0F); } } - public boolean ch() { + public boolean cj() { return this.br; } @@ -171,12 +171,12 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { this.br = flag; } - public boolean bK() { - return !this.cC() && super.bK(); + public boolean bM() { + return !this.cE() && super.bM(); } protected void o(float f) { - if (f > 6.0F && this.ck()) { + if (f > 6.0F && this.cm()) { this.o(false); } } @@ -185,7 +185,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { return this.x(8); } - public int cj() { + public int cl() { return this.datawatcher.getInt(22); } @@ -199,25 +199,25 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { } } - public boolean ck() { + public boolean cm() { return this.x(32); } - public boolean cl() { + public boolean cn() { return this.x(64); } - public boolean cm() { + public boolean co() { return this.x(16); } - public boolean cn() { + public boolean cp() { return this.bH; } public void d(ItemStack itemstack) { this.datawatcher.watch(22, Integer.valueOf(this.e(itemstack))); - this.cN(); + this.cP(); } public void k(boolean flag) { @@ -257,15 +257,15 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { return this.passenger != null && this.passenger.equals(entity) ? false : super.damageEntity(damagesource, f); } - public int aV() { - return by[this.cj()]; + public int aU() { + return by[this.cl()]; } - public boolean S() { + public boolean R() { return this.passenger == null; } - public boolean cp() { + public boolean cr() { int i = MathHelper.floor(this.locX); int j = MathHelper.floor(this.locZ); @@ -273,15 +273,15 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { return true; } - public void cq() { + public void cs() { if (!this.world.isStatic && this.hasChest()) { this.a(Item.getItemOf(Blocks.CHEST), 1); this.setHasChest(false); } } - private void cJ() { - this.cQ(); + private void cL() { + this.cS(); this.world.makeSound(this, "eating", 1.0F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.2F); } @@ -293,7 +293,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { int i = MathHelper.f(f * 0.5F - 3.0F); if (i > 0) { - // CraftBukkit start + // CraftBukkit start - fire EntityDamageEvent EntityDamageEvent event = CraftEventFactory.callEntityDamageEvent(null, this, EntityDamageEvent.DamageCause.FALL, i); if (!event.isCancelled()) { float damage = (float) event.getDamage(); @@ -325,7 +325,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { } } - private int cK() { + private int cM() { int i = this.getType(); return this.hasChest() /* && (i == 1 || i == 2) */ ? 17 : 2; // CraftBukkit - Remove type check @@ -334,7 +334,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { public void loadChest() { // CraftBukkit - private -> public InventoryHorseChest inventoryhorsechest = this.inventoryChest; - this.inventoryChest = new InventoryHorseChest("HorseChest", this.cK(), this); // CraftBukkit - add this horse + this.inventoryChest = new InventoryHorseChest("HorseChest", this.cM(), this); // CraftBukkit - add this horse this.inventoryChest.a(this.getName()); if (inventoryhorsechest != null) { inventoryhorsechest.b(this); @@ -352,38 +352,38 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { } this.inventoryChest.a(this); - this.cM(); + this.cO(); } - private void cM() { + private void cO() { if (!this.world.isStatic) { this.n(this.inventoryChest.getItem(0) != null); - if (this.cz()) { + if (this.cB()) { this.d(this.inventoryChest.getItem(1)); } } } public void a(InventorySubcontainer inventorysubcontainer) { - int i = this.cj(); - boolean flag = this.cs(); + int i = this.cl(); + boolean flag = this.cu(); this.cM(); if (this.ticksLived > 20) { - if (i == 0 && i != this.cj()) { + if (i == 0 && i != this.cl()) { this.makeSound("mob.horse.armor", 0.5F, 1.0F); - } else if (i != this.cj()) { + } else if (i != this.cl()) { this.makeSound("mob.horse.armor", 0.5F, 1.0F); } - if (!flag && this.cs()) { + if (!flag && this.cu()) { this.makeSound("mob.horse.leather", 0.5F, 1.0F); } } } public boolean canSpawn() { - this.cp(); + this.cr(); return super.canSpawn(); } @@ -410,8 +410,8 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { return this.getAttributeInstance(attributeJumpStrength).getValue(); } - protected String aU() { - this.cQ(); + protected String aT() { + this.cS(); int i = this.getType(); return i == 3 ? "mob.horse.zombie.death" : (i == 4 ? "mob.horse.skeleton.death" : (i != 1 && i != 2 ? "mob.horse.death" : "mob.horse.donkey.death")); @@ -424,10 +424,10 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { return i == 4 ? Items.BONE : (i == 3 ? (flag ? Item.d(0) : Items.ROTTEN_FLESH) : Items.LEATHER); } - protected String aT() { - this.cQ(); + protected String aS() { + this.cS(); if (this.random.nextInt(3) == 0) { - this.cS(); + this.cU(); } int i = this.getType(); @@ -435,14 +435,14 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { return i == 3 ? "mob.horse.zombie.hit" : (i == 4 ? "mob.horse.skeleton.hit" : (i != 1 && i != 2 ? "mob.horse.hit" : "mob.horse.donkey.hit")); } - public boolean cs() { + public boolean cu() { return this.x(4); } protected String t() { - this.cQ(); - if (this.random.nextInt(10) == 0 && !this.bh()) { - this.cS(); + this.cS(); + if (this.random.nextInt(10) == 0 && !this.bg()) { + this.cU(); } int i = this.getType(); @@ -450,9 +450,9 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { return i == 3 ? "mob.horse.zombie.idle" : (i == 4 ? "mob.horse.skeleton.idle" : (i != 1 && i != 2 ? "mob.horse.idle" : "mob.horse.donkey.idle")); } - protected String ct() { - this.cQ(); + protected String cv() { this.cS(); + this.cU(); int i = this.getType(); return i != 3 && i != 4 ? (i != 1 && i != 2 ? "mob.horse.angry" : "mob.horse.donkey.angry") : null; @@ -486,14 +486,14 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { } } - protected void aD() { - super.aD(); - this.bc().b(attributeJumpStrength); + protected void aC() { + super.aC(); + this.bb().b(attributeJumpStrength); this.getAttributeInstance(GenericAttributes.a).setValue(53.0D); this.getAttributeInstance(GenericAttributes.d).setValue(0.22499999403953552D); } - public int bz() { + public int bB() { return 6; } @@ -501,7 +501,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { return this.maxDomestication; // CraftBukkit - return stored max domestication instead of 100 } - protected float bf() { + protected float be() { return 0.8F; } @@ -509,7 +509,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { return 400; } - private void cN() { + private void cP() { this.bQ = null; } @@ -525,18 +525,18 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { if (itemstack != null && itemstack.getItem() == Items.MONSTER_EGG) { return super.a(entityhuman); - } else if (!this.isTame() && this.cC()) { + } else if (!this.isTame() && this.cE()) { return false; - } else if (this.isTame() && this.bZ() && entityhuman.isSneaking()) { + } else if (this.isTame() && this.cb() && entityhuman.isSneaking()) { this.g(entityhuman); return true; - } else if (this.ce() && this.passenger != null) { + } else if (this.cg() && this.passenger != null) { return super.a(entityhuman); } else { if (itemstack != null) { boolean flag = false; - if (this.cz()) { + if (this.cB()) { byte b0 = -1; if (itemstack.getItem() == Items.HORSE_ARMOR_IRON) { @@ -549,7 +549,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { if (b0 >= 0) { if (!this.isTame()) { - this.cH(); + this.cJ(); return true; } @@ -558,7 +558,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { } } - if (!flag && !this.cC()) { + if (!flag && !this.cE()) { float f = 0.0F; short short1 = 0; byte b1 = 0; @@ -605,7 +605,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { flag = true; } - if (!this.bZ() && short1 > 0) { + if (!this.cb() && short1 > 0) { this.a(short1); flag = true; } @@ -616,7 +616,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { } if (flag) { - this.cJ(); + this.cL(); } } @@ -625,18 +625,18 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { return true; } - this.cH(); + this.cJ(); return true; } - if (!flag && this.cA() && !this.hasChest() && itemstack.getItem() == Item.getItemOf(Blocks.CHEST)) { + if (!flag && this.cC() && !this.hasChest() && itemstack.getItem() == Item.getItemOf(Blocks.CHEST)) { this.setHasChest(true); this.makeSound("mob.chickenplop", 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F); flag = true; this.loadChest(); } - if (!flag && this.ce() && !this.cs() && itemstack.getItem() == Items.SADDLE) { + if (!flag && this.cg() && !this.cu() && itemstack.getItem() == Items.SADDLE) { this.g(entityhuman); return true; } @@ -650,7 +650,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { } } - if (this.ce() && this.passenger == null) { + if (this.cg() && this.passenger == null) { if (itemstack != null && itemstack.a(entityhuman, (EntityLiving) this)) { return true; } else { @@ -673,48 +673,48 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { } } - public boolean cz() { + public boolean cB() { return this.getType() == 0; } - public boolean cA() { - int i = this.getType(); - - return i == 2 || i == 1; - } - - protected boolean bh() { - return this.passenger != null && this.cs() ? true : this.ck() || this.cl(); - } - public boolean cC() { int i = this.getType(); + return i == 2 || i == 1; + } + + protected boolean bg() { + return this.passenger != null && this.cu() ? true : this.cm() || this.cn(); + } + + public boolean cE() { + int i = this.getType(); + return i == 3 || i == 4; } - public boolean cD() { - return this.cC() || this.getType() == 2; + public boolean cF() { + return this.cE() || this.getType() == 2; } public boolean c(ItemStack itemstack) { return false; } - private void cP() { + private void cR() { this.bp = 1; } public void die(DamageSource damagesource) { super.die(damagesource); if (!this.world.isStatic) { - this.cI(); + this.cK(); } } public void e() { if (this.random.nextInt(200) == 0) { - this.cP(); + this.cR(); } super.e(); @@ -723,19 +723,19 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { this.heal(1.0F); } - if (!this.ck() && this.passenger == null && this.random.nextInt(300) == 0 && this.world.getType(MathHelper.floor(this.locX), MathHelper.floor(this.locY) - 1, MathHelper.floor(this.locZ)) == Blocks.GRASS) { + if (!this.cm() && this.passenger == null && this.random.nextInt(300) == 0 && this.world.getType(MathHelper.floor(this.locX), MathHelper.floor(this.locY) - 1, MathHelper.floor(this.locZ)) == Blocks.GRASS) { this.o(true); } - if (this.ck() && ++this.bD > 50) { + if (this.cm() && ++this.bD > 50) { this.bD = 0; this.o(false); } - if (this.cm() && !this.bZ() && !this.ck()) { + if (this.co() && !this.cb() && !this.cm()) { EntityHorse entityhorse = this.a(this, 16.0D); - if (entityhorse != null && this.e(entityhorse) > 4.0D) { + if (entityhorse != null && this.f(entityhorse) > 4.0D) { PathEntity pathentity = this.world.findPath(this, entityhorse, 16.0F, true, false, false, true); this.setPathEntity(pathentity); @@ -748,7 +748,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { super.h(); if (this.world.isStatic && this.datawatcher.a()) { this.datawatcher.e(); - this.cN(); + this.cP(); } if (this.bE > 0 && ++this.bE > 30) { @@ -773,7 +773,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { } this.bK = this.bJ; - if (this.ck()) { + if (this.cm()) { this.bJ += (1.0F - this.bJ) * 0.4F + 0.05F; if (this.bJ > 1.0F) { this.bJ = 1.0F; @@ -786,7 +786,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { } this.bM = this.bL; - if (this.cl()) { + if (this.cn()) { this.bK = this.bJ = 0.0F; this.bL += (1.0F - this.bL) * 0.4F + 0.05F; if (this.bL > 1.0F) { @@ -814,15 +814,15 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { } } - private void cQ() { + private void cS() { if (!this.world.isStatic) { this.bE = 1; this.b(128, true); } } - private boolean cR() { - return this.passenger == null && this.vehicle == null && this.isTame() && this.bZ() && !this.cD() && this.getHealth() >= this.getMaxHealth(); + private boolean cT() { + return this.passenger == null && this.vehicle == null && this.isTame() && this.cb() && !this.cF() && this.getHealth() >= this.getMaxHealth(); } public void e(boolean flag) { @@ -841,25 +841,25 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { this.b(64, flag); } - private void cS() { + private void cU() { if (!this.world.isStatic) { this.bF = 1; this.p(true); } } - public void cH() { - this.cS(); - String s = this.ct(); + public void cJ() { + this.cU(); + String s = this.cv(); if (s != null) { - this.makeSound(s, this.bf(), this.bg()); + this.makeSound(s, this.be(), this.bf()); } } - public void cI() { + public void cK() { this.a(this, this.inventoryChest); - this.cq(); + this.cs(); } private void a(Entity entity, InventoryHorseChest inventoryhorsechest) { @@ -881,31 +881,31 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { } public void e(float f, float f1) { - if (this.passenger != null && this.passenger instanceof EntityLiving && this.cs()) { // CraftBukkit - Check type of passenger + if (this.passenger != null && this.passenger instanceof EntityLiving && this.cu()) { this.lastYaw = this.yaw = this.passenger.yaw; this.pitch = this.passenger.pitch * 0.5F; this.b(this.yaw, this.pitch); - this.aP = this.aN = this.yaw; - f = ((EntityLiving) this.passenger).be * 0.5F; - f1 = ((EntityLiving) this.passenger).bf; + this.aO = this.aM = this.yaw; + f = ((EntityLiving) this.passenger).bd * 0.5F; + f1 = ((EntityLiving) this.passenger).be; if (f1 <= 0.0F) { f1 *= 0.25F; this.bP = 0; } - if (this.onGround && this.bt == 0.0F && this.cl() && !this.bI) { + if (this.onGround && this.bt == 0.0F && this.cn() && !this.bI) { f = 0.0F; f1 = 0.0F; } - if (this.bt > 0.0F && !this.ch() && this.onGround) { + if (this.bt > 0.0F && !this.cj() && this.onGround) { this.motY = this.getJumpStrength() * (double) this.bt; if (this.hasEffect(MobEffectList.JUMP)) { this.motY += (double) ((float) (this.getEffect(MobEffectList.JUMP).getAmplifier() + 1) * 0.1F); } this.j(true); - this.am = true; + this.al = true; if (f1 > 0.0F) { float f2 = MathHelper.sin(this.yaw * 3.1415927F / 180.0F); float f3 = MathHelper.cos(this.yaw * 3.1415927F / 180.0F); @@ -918,8 +918,8 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { this.bt = 0.0F; } - this.X = 1.0F; - this.aR = this.bl() * 0.1F; + this.W = 1.0F; + this.aQ = this.bk() * 0.1F; if (!this.world.isStatic) { this.i((float) this.getAttributeInstance(GenericAttributes.d).getValue()); super.e(f, f1); @@ -930,7 +930,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { this.j(false); } - this.aF = this.aG; + this.aE = this.aF; double d0 = this.locX - this.lastX; double d1 = this.locZ - this.lastZ; float f4 = MathHelper.sqrt(d0 * d0 + d1 * d1) * 4.0F; @@ -939,21 +939,21 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { f4 = 1.0F; } - this.aG += (f4 - this.aG) * 0.4F; - this.aH += this.aG; + this.aF += (f4 - this.aF) * 0.4F; + this.aG += this.aF; } else { - this.X = 0.5F; - this.aR = 0.02F; + this.W = 0.5F; + this.aQ = 0.02F; super.e(f, f1); } } public void b(NBTTagCompound nbttagcompound) { super.b(nbttagcompound); - nbttagcompound.setBoolean("EatingHaystack", this.ck()); + nbttagcompound.setBoolean("EatingHaystack", this.cm()); nbttagcompound.setBoolean("ChestedHorse", this.hasChest()); - nbttagcompound.setBoolean("HasReproduced", this.cn()); - nbttagcompound.setBoolean("Bred", this.cm()); + nbttagcompound.setBoolean("HasReproduced", this.cp()); + nbttagcompound.setBoolean("Bred", this.co()); nbttagcompound.setInt("Type", this.getType()); nbttagcompound.setInt("Variant", this.getVariant()); nbttagcompound.setInt("Temper", this.getTemper()); @@ -1005,7 +1005,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { this.maxDomestication = nbttagcompound.getInt("Bukkit.MaxDomestication"); } // CraftBukkit end - AttributeInstance attributeinstance = this.bc().a("Speed"); + AttributeInstance attributeinstance = this.bb().a("Speed"); if (attributeinstance != null) { this.getAttributeInstance(GenericAttributes.d).setValue(attributeinstance.b() * 0.25D); @@ -1044,7 +1044,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { this.inventoryChest.setItem(0, new ItemStack(Items.SADDLE)); } - this.cM(); + this.cO(); } public boolean mate(EntityAnimal entityanimal) { @@ -1055,7 +1055,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { } else { EntityHorse entityhorse = (EntityHorse) entityanimal; - if (this.cR() && entityhorse.cR()) { + if (this.cT() && entityhorse.cT()) { int i = this.getType(); int j = entityhorse.getType(); @@ -1105,13 +1105,13 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { } entityhorse1.setType(k); - double d0 = this.getAttributeInstance(GenericAttributes.a).b() + entityageable.getAttributeInstance(GenericAttributes.a).b() + (double) this.cT(); + double d0 = this.getAttributeInstance(GenericAttributes.a).b() + entityageable.getAttributeInstance(GenericAttributes.a).b() + (double) this.cV(); entityhorse1.getAttributeInstance(GenericAttributes.a).setValue(d0 / 3.0D); - double d1 = this.getAttributeInstance(attributeJumpStrength).b() + entityageable.getAttributeInstance(attributeJumpStrength).b() + this.cU(); + double d1 = this.getAttributeInstance(attributeJumpStrength).b() + entityageable.getAttributeInstance(attributeJumpStrength).b() + this.cW(); entityhorse1.getAttributeInstance(attributeJumpStrength).setValue(d1 / 3.0D); - double d2 = this.getAttributeInstance(GenericAttributes.d).b() + entityageable.getAttributeInstance(GenericAttributes.d).b() + this.cV(); + double d2 = this.getAttributeInstance(GenericAttributes.d).b() + entityageable.getAttributeInstance(GenericAttributes.d).b() + this.cX(); entityhorse1.getAttributeInstance(GenericAttributes.d).setValue(d2 / 3.0D); return entityhorse1; @@ -1147,9 +1147,9 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { } if (j != 4 && j != 3) { - this.getAttributeInstance(GenericAttributes.a).setValue((double) this.cT()); + this.getAttributeInstance(GenericAttributes.a).setValue((double) this.cV()); if (j == 0) { - this.getAttributeInstance(GenericAttributes.d).setValue(this.cV()); + this.getAttributeInstance(GenericAttributes.d).setValue(this.cX()); } else { this.getAttributeInstance(GenericAttributes.d).setValue(0.17499999701976776D); } @@ -1159,7 +1159,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { } if (j != 2 && j != 1) { - this.getAttributeInstance(attributeJumpStrength).setValue(this.cU()); + this.getAttributeInstance(attributeJumpStrength).setValue(this.cW()); } else { this.getAttributeInstance(attributeJumpStrength).setValue(0.5D); } @@ -1168,12 +1168,12 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { return (GroupDataEntity) object; } - protected boolean bk() { + protected boolean bj() { return true; } public void w(int i) { - if (this.cs()) { + if (this.cu()) { // CraftBukkit start - fire HorseJumpEvent, use event power if (i < 0) { i = 0; @@ -1189,37 +1189,37 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { org.bukkit.event.entity.HorseJumpEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callHorseJumpEvent(this, power); if (!event.isCancelled()) { this.bI = true; - this.cS(); + this.cU(); this.bt = event.getPower(); } // CraftBukkit end } } - public void ac() { - super.ac(); + public void ab() { + super.ab(); if (this.bM > 0.0F) { - float f = MathHelper.sin(this.aN * 3.1415927F / 180.0F); - float f1 = MathHelper.cos(this.aN * 3.1415927F / 180.0F); + float f = MathHelper.sin(this.aM * 3.1415927F / 180.0F); + float f1 = MathHelper.cos(this.aM * 3.1415927F / 180.0F); float f2 = 0.7F * this.bM; float f3 = 0.15F * this.bM; - this.passenger.setPosition(this.locX + (double) (f2 * f), this.locY + this.ae() + this.passenger.ad() + (double) f3, this.locZ - (double) (f2 * f1)); + this.passenger.setPosition(this.locX + (double) (f2 * f), this.locY + this.ad() + this.passenger.ac() + (double) f3, this.locZ - (double) (f2 * f1)); if (this.passenger instanceof EntityLiving) { - ((EntityLiving) this.passenger).aN = this.aN; + ((EntityLiving) this.passenger).aM = this.aM; } } } - private float cT() { + private float cV() { return 15.0F + (float) this.random.nextInt(8) + (float) this.random.nextInt(9); } - private double cU() { + private double cW() { return 0.4000000059604645D + this.random.nextDouble() * 0.2D + this.random.nextDouble() * 0.2D + this.random.nextDouble() * 0.2D; } - private double cV() { + private double cX() { return (0.44999998807907104D + this.random.nextDouble() * 0.3D + this.random.nextDouble() * 0.3D + this.random.nextDouble() * 0.3D) * 0.25D; } diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java index c12a08ffd9..81cd30d300 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -27,16 +27,16 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen public Container defaultContainer; public Container activeContainer; protected FoodMetaData foodData = new FoodMetaData(this); // CraftBukkit - add "this" to constructor - protected int br; + protected int bq; + public float br; public float bs; - public float bt; - public int bu; + public int bt; + public double bu; public double bv; public double bw; public double bx; public double by; public double bz; - public double bA; // CraftBukkit start public boolean sleeping; // protected -> public public boolean fauxSleeping; @@ -48,22 +48,22 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen } // CraftBukkit end - public ChunkCoordinates bC; + public ChunkCoordinates bB; public int sleepTicks; // CraftBukkit - private -> public + public float bC; public float bD; - public float bE; private ChunkCoordinates c; private boolean d; private ChunkCoordinates e; public PlayerAbilities abilities = new PlayerAbilities(); - public int oldLevel = -1; // CraftBukkit + public int oldLevel = -1; // CraftBukkit - add field public int expLevel; public int expTotal; public float exp; private ItemStack f; private int g; - protected float bJ = 0.1F; - protected float bK = 0.02F; + protected float bI = 0.1F; + protected float bJ = 0.02F; private int h; private final GameProfile i; public EntityFishingHook hookedFish; @@ -78,13 +78,13 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen ChunkCoordinates chunkcoordinates = world.getSpawn(); this.setPositionRotation((double) chunkcoordinates.x + 0.5D, (double) (chunkcoordinates.y + 1), (double) chunkcoordinates.z + 0.5D, 0.0F, 0.0F); - this.ba = 180.0F; + this.az = 180.0F; this.maxFireTicks = 20; } - protected void aD() { - super.aD(); - this.bc().b(GenericAttributes.e).setValue(1.0D); + protected void aC() { + super.aC(); + this.bb().b(GenericAttributes.e).setValue(1.0D); } protected void c() { @@ -94,19 +94,19 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen this.datawatcher.a(18, Integer.valueOf(0)); } - public boolean bw() { + public boolean bx() { return this.f != null; } - public void by() { + public void bz() { if (this.f != null) { this.f.b(this.world, this, this.g); } - this.bz(); + this.bA(); } - public void bz() { + public void bA() { this.f = null; this.g = 0; if (!this.world.isStatic) { @@ -115,7 +115,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen } public boolean isBlocking() { - return this.bw() && this.f.getItem().d(this.f) == EnumAnimation.BLOCK; + return this.bx() && this.f.getItem().d(this.f) == EnumAnimation.BLOCK; } public void h() { @@ -131,12 +131,12 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen this.p(); } } else { - this.bz(); + this.bA(); } } - if (this.bu > 0) { - --this.bu; + if (this.bt > 0) { + --this.bt; } if (this.isSleeping()) { @@ -148,7 +148,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen if (!this.world.isStatic) { if (!this.j()) { this.a(true, true, false); - } else if (this.world.v()) { + } else if (this.world.w()) { this.a(false, true, true); } } @@ -169,41 +169,41 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen this.extinguish(); } + this.bu = this.bx; this.bv = this.by; this.bw = this.bz; - this.bx = this.bA; - double d0 = this.locX - this.by; - double d1 = this.locY - this.bz; - double d2 = this.locZ - this.bA; + double d0 = this.locX - this.bx; + double d1 = this.locY - this.by; + double d2 = this.locZ - this.bz; double d3 = 10.0D; if (d0 > d3) { - this.bv = this.by = this.locX; + this.bu = this.bx = this.locX; } if (d2 > d3) { - this.bx = this.bA = this.locZ; + this.bw = this.bz = this.locZ; } if (d1 > d3) { - this.bw = this.bz = this.locY; + this.bv = this.by = this.locY; } if (d0 < -d3) { - this.bv = this.by = this.locX; + this.bu = this.by = this.locX; } if (d2 < -d3) { - this.bx = this.bA = this.locZ; + this.bw = this.bz = this.locZ; } if (d1 < -d3) { - this.bw = this.bz = this.locY; + this.bv = this.bz = this.locY; } - this.by += d0 * 0.25D; - this.bA += d2 * 0.25D; - this.bz += d1 * 0.25D; + this.bx += d0 * 0.25D; + this.bz += d2 * 0.25D; + this.by += d1 * 0.25D; if (this.vehicle == null) { this.e = null; } @@ -214,19 +214,19 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen } } - public int D() { + public int C() { return this.abilities.isInvulnerable ? 0 : 80; } - protected String H() { + protected String G() { return "game.player.swim"; } - protected String O() { + protected String N() { return "game.player.swim.splash"; } - public int ai() { + public int ah() { return 10; } @@ -241,11 +241,11 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen if (itemstack.o() == EnumAnimation.EAT) { for (int j = 0; j < i; ++j) { - Vec3D vec3d = this.world.getVec3DPool().create(((double) this.random.nextFloat() - 0.5D) * 0.1D, Math.random() * 0.1D + 0.1D, 0.0D); + Vec3D vec3d = Vec3D.a(((double) this.random.nextFloat() - 0.5D) * 0.1D, Math.random() * 0.1D + 0.1D, 0.0D); vec3d.a(-this.pitch * 3.1415927F / 180.0F); vec3d.b(-this.yaw * 3.1415927F / 180.0F); - Vec3D vec3d1 = this.world.getVec3DPool().create(((double) this.random.nextFloat() - 0.5D) * 0.3D, (double) (-this.random.nextFloat()) * 0.6D - 0.3D, 0.6D); + Vec3D vec3d1 = Vec3D.a(((double) this.random.nextFloat() - 0.5D) * 0.3D, (double) (-this.random.nextFloat()) * 0.6D - 0.3D, 0.6D); vec3d1.a(-this.pitch * 3.1415927F / 180.0F); vec3d1.b(-this.yaw * 3.1415927F / 180.0F); @@ -256,7 +256,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen s = s + "_" + itemstack.getData(); } - this.world.addParticle(s, vec3d1.c, vec3d1.d, vec3d1.e, vec3d.c, vec3d.d + 0.05D, vec3d.e); + this.world.addParticle(s, vec3d1.a, vec3d1.b, vec3d1.c, vec3d.a, vec3d.b + 0.05D, vec3d.c); } this.makeSound("random.eat", 0.5F + 0.5F * (float) this.random.nextInt(2), (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F); @@ -268,7 +268,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen this.c(this.f, 16); int i = this.f.count; - // CraftBukkit start + // CraftBukkit start - fire PlayerItemConsumeEvent org.bukkit.inventory.ItemStack craftItem = CraftItemStack.asBukkitCopy(this.f); PlayerItemConsumeEvent event = new PlayerItemConsumeEvent((Player) this.getBukkitEntity(), craftItem); world.getServer().getPluginManager().callEvent(event); @@ -302,11 +302,11 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen } } - this.bz(); + this.bA(); } } - protected boolean bh() { + protected boolean bg() { return this.getHealth() <= 0.0F || this.isSleeping(); } @@ -339,7 +339,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen */ super.setPassengerOf(entity); if (!this.world.isStatic && this.vehicle == null) { - this.l(originalVehicle); + this.m(originalVehicle); } // CraftBukkit end } else { @@ -347,7 +347,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen } } - public void ab() { + public void aa() { if (!this.world.isStatic && this.isSneaking()) { this.mount((Entity) null); this.setSneaking(false); @@ -358,26 +358,26 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen float f = this.yaw; float f1 = this.pitch; - super.ab(); - this.bs = this.bt; - this.bt = 0.0F; + super.aa(); + this.br = this.bs; + this.bs = 0.0F; this.l(this.locX - d0, this.locY - d1, this.locZ - d2); if (this.vehicle instanceof EntityPig) { this.pitch = f1; this.yaw = f; - this.aN = ((EntityPig) this.vehicle).aN; + this.aM = ((EntityPig) this.vehicle).aM; } } } - protected void bq() { - super.bq(); - this.bb(); + protected void bp() { + super.bp(); + this.ba(); } public void e() { - if (this.br > 0) { - --this.br; + if (this.bq > 0) { + --this.bq; } if (this.world.difficulty == EnumDifficulty.PEACEFUL && this.getHealth() < this.getMaxHealth() && this.world.getGameRules().getBoolean("naturalRegeneration") && this.ticksLived % 20 * 12 == 0) { @@ -386,7 +386,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen } this.inventory.k(); - this.bs = this.bt; + this.br = this.bs; super.e(); AttributeInstance attributeinstance = this.getAttributeInstance(GenericAttributes.d); @@ -394,9 +394,9 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen attributeinstance.setValue((double) this.abilities.b()); } - this.aR = this.bK; + this.aQ = this.bJ; if (this.isSprinting()) { - this.aR = (float) ((double) this.aR + (double) this.bK * 0.3D); + this.aQ = (float) ((double) this.aQ + (double) this.bJ * 0.3D); } this.i((float) attributeinstance.getValue()); @@ -416,8 +416,8 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen f1 = 0.0F; } - this.bt += (f - this.bt) * 0.4F; - this.aK += (f1 - this.aK) * 0.8F; + this.bs += (f - this.bs) * 0.4F; + this.aJ += (f1 - this.aJ) * 0.8F; if (this.getHealth() > 0.0F) { AxisAlignedBB axisalignedbb = null; @@ -434,14 +434,14 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen Entity entity = (Entity) list.get(i); if (!entity.dead) { - this.r(entity); + this.d(entity); } } } } } - private void r(Entity entity) { + private void d(Entity entity) { entity.b_(this); } @@ -473,8 +473,8 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen } if (damagesource != null) { - this.motX = (double) (-MathHelper.cos((this.aA + this.yaw) * 3.1415927F / 180.0F) * 0.1F); - this.motZ = (double) (-MathHelper.sin((this.aA + this.yaw) * 3.1415927F / 180.0F) * 0.1F); + this.motX = (double) (-MathHelper.cos((this.az + this.yaw) * 3.1415927F / 180.0F) * 0.1F); + this.motZ = (double) (-MathHelper.sin((this.az + this.yaw) * 3.1415927F / 180.0F) * 0.1F); } else { this.motX = this.motZ = 0.0D; } @@ -483,11 +483,11 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen this.a(StatisticList.v, 1); } - protected String aT() { + protected String aS() { return "game.player.hurt"; } - protected String aU() { + protected String aT() { return "game.player.die"; } @@ -557,7 +557,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen entityitem.motZ += Math.sin((double) f1) * (double) f; } - // CraftBukkit start + // CraftBukkit start - fire PlayerDropItemEvent Player player = (Player) this.getBukkitEntity(); CraftItem drop = new CraftItem(this.world.getServer(), entityitem); @@ -635,7 +635,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen this.expTotal = nbttagcompound.getInt("XpTotal"); this.setScore(nbttagcompound.getInt("Score")); if (this.sleeping) { - this.bC = new ChunkCoordinates(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ)); + this.bB = new ChunkCoordinates(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ)); this.a(true, true, false); } @@ -711,7 +711,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen } else if (this.abilities.isInvulnerable && !damagesource.ignoresInvulnerability()) { return false; } else { - this.aV = 0; + this.aU = 0; if (this.getHealth() <= 0.0F) { return false; } else { @@ -779,11 +779,11 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen this.inventory.a(f); } - public int aV() { + public int aU() { return this.inventory.l(); } - public float bC() { + public float bD() { int i = 0; ItemStack[] aitemstack = this.inventory.armor; int j = aitemstack.length; @@ -809,14 +809,14 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen f = this.c(damagesource, f); float f1 = f; - f = Math.max(f - this.bs(), 0.0F); - this.m(this.bs() - (f1 - f)); + f = Math.max(f - this.br(), 0.0F); + this.m(this.br() - (f1 - f)); if (f != 0.0F) { this.a(damagesource.f()); float f2 = this.getHealth(); this.setHealth(this.getHealth() - f); - this.aW().a(damagesource, f2, f); + this.aV().a(damagesource, f2, f); } } } @@ -837,8 +837,8 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen public void b(ItemStack itemstack) {} - public boolean p(Entity entity) { - ItemStack itemstack = this.bD(); + public boolean q(Entity entity) { + ItemStack itemstack = this.bE(); ItemStack itemstack1 = itemstack != null ? itemstack.cloneItemStack() : null; if (!entity.c(this)) { @@ -850,7 +850,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen if (itemstack.a(this, (EntityLiving) entity)) { // CraftBukkit - bypass infinite items; <= 0 -> == 0 if (itemstack.count == 0 && !this.abilities.canInstantlyBuild) { - this.bE(); + this.bF(); } return true; @@ -859,9 +859,9 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen return false; } else { - if (itemstack != null && itemstack == this.bD()) { + if (itemstack != null && itemstack == this.bE()) { if (itemstack.count <= 0 && !this.abilities.canInstantlyBuild) { - this.bE(); + this.bF(); } else if (itemstack.count < itemstack1.count && this.abilities.canInstantlyBuild) { itemstack.count = itemstack1.count; } @@ -871,21 +871,21 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen } } - public ItemStack bD() { + public ItemStack bE() { return this.inventory.getItemInHand(); } - public void bE() { + public void bF() { this.inventory.setItem(this.inventory.itemInHandIndex, (ItemStack) null); } - public double ad() { + public double ac() { return (double) (this.height - 0.5F); } public void attack(Entity entity) { - if (entity.av()) { - if (!entity.i(this)) { + if (entity.au()) { + if (!entity.j(this)) { float f = (float) this.getAttributeInstance(GenericAttributes.e).getValue(); int i = 0; float f1 = 0.0F; @@ -900,7 +900,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen } if (f > 0.0F || f1 > 0.0F) { - boolean flag = this.fallDistance > 0.0F && !this.onGround && !this.h_() && !this.M() && !this.hasEffect(MobEffectList.BLINDNESS) && this.vehicle == null && entity instanceof EntityLiving; + boolean flag = this.fallDistance > 0.0F && !this.onGround && !this.h_() && !this.L() && !this.hasEffect(MobEffectList.BLINDNESS) && this.vehicle == null && entity instanceof EntityLiving; if (flag && f > 0.0F) { f *= 1.5F; @@ -937,13 +937,13 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen this.a((Statistic) AchievementList.F); } - this.k(entity); + this.l(entity); if (entity instanceof EntityLiving) { EnchantmentManager.a((EntityLiving) entity, (Entity) this); } EnchantmentManager.b(this, entity); - ItemStack itemstack = this.bD(); + ItemStack itemstack = this.bE(); Object object = entity; if (entity instanceof EntityComplexPart) { @@ -958,7 +958,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen itemstack.a((EntityLiving) object, this); // CraftBukkit - bypass infinite items; <= 0 -> == 0 if (itemstack.count == 0) { - this.bE(); + this.bF(); } } @@ -1015,7 +1015,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen return EnumBedResult.NOT_POSSIBLE_HERE; } - if (this.world.v()) { + if (this.world.w()) { return EnumBedResult.NOT_POSSIBLE_NOW; } @@ -1025,18 +1025,18 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen double d0 = 8.0D; double d1 = 5.0D; - List list = this.world.a(EntityMonster.class, AxisAlignedBB.a().a((double) i - d0, (double) j - d1, (double) k - d0, (double) i + d0, (double) j + d1, (double) k + d0)); + List list = this.world.a(EntityMonster.class, AxisAlignedBB.a((double) i - d0, (double) j - d1, (double) k - d0, (double) i + d0, (double) j + d1, (double) k + d0)); if (!list.isEmpty()) { return EnumBedResult.NOT_SAFE; } } - if (this.am()) { + if (this.al()) { this.mount((Entity) null); } - // CraftBukkit start + // CraftBukkit start - fire PlayerBedEnterEvent if (this.getBukkitEntity() instanceof Player) { Player player = (Player) this.getBukkitEntity(); org.bukkit.block.Block bed = this.world.getWorld().getBlockAt(i, j, k); @@ -1083,7 +1083,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen this.sleeping = true; this.sleepTicks = 0; - this.bC = new ChunkCoordinates(i, j, k); + this.bB = new ChunkCoordinates(i, j, k); this.motX = this.motZ = this.motY = 0.0D; if (!this.world.isStatic) { this.world.everyoneSleeping(); @@ -1093,31 +1093,31 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen } private void w(int i) { + this.bC = 0.0F; this.bD = 0.0F; - this.bE = 0.0F; switch (i) { case 0: - this.bE = -1.8F; + this.bD = -1.8F; break; case 1: - this.bD = 1.8F; + this.bC = 1.8F; break; case 2: - this.bE = 1.8F; + this.bD = 1.8F; break; case 3: - this.bD = -1.8F; + this.bC = -1.8F; } } public void a(boolean flag, boolean flag1, boolean flag2) { this.a(0.6F, 1.8F); this.e_(); - ChunkCoordinates chunkcoordinates = this.bC; - ChunkCoordinates chunkcoordinates1 = this.bC; + ChunkCoordinates chunkcoordinates = this.bB; + ChunkCoordinates chunkcoordinates1 = this.bB; if (chunkcoordinates != null && this.world.getType(chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z) == Blocks.BED) { BlockBed.a(this.world, chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z, false); @@ -1134,7 +1134,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen this.world.everyoneSleeping(); } - // CraftBukkit start + // CraftBukkit start - fire PlayerBedLeaveEvent if (this.getBukkitEntity() instanceof Player) { Player player = (Player) this.getBukkitEntity(); @@ -1157,16 +1157,16 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen } if (flag2) { - this.setRespawnPosition(this.bC, false); + this.setRespawnPosition(this.bB, false); } } private boolean j() { - return this.world.getType(this.bC.x, this.bC.y, this.bC.z) == Blocks.BED; + return this.world.getType(this.bB.x, this.bB.y, this.bB.z) == Blocks.BED; } public static ChunkCoordinates getBed(World world, ChunkCoordinates chunkcoordinates, boolean flag) { - IChunkProvider ichunkprovider = world.K(); + IChunkProvider ichunkprovider = world.L(); ichunkprovider.getChunkAt(chunkcoordinates.x - 3 >> 4, chunkcoordinates.z - 3 >> 4); ichunkprovider.getChunkAt(chunkcoordinates.x + 3 >> 4, chunkcoordinates.z - 3 >> 4); @@ -1232,8 +1232,8 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen public void a(Statistic statistic, int i) {} - public void bj() { - super.bj(); + public void bi() { + super.bi(); this.a(StatisticList.r, 1); if (this.isSprinting()) { this.a(0.8F); @@ -1249,12 +1249,12 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen if (this.abilities.isFlying && this.vehicle == null) { double d3 = this.motY; - float f2 = this.aR; + float f2 = this.aQ; - this.aR = this.abilities.a(); + this.aQ = this.abilities.a(); super.e(f, f1); this.motY = d3 * 0.6D; - this.aR = f2; + this.aQ = f2; } else { super.e(f, f1); } @@ -1262,7 +1262,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen this.checkMovement(this.locX - d0, this.locY - d1, this.locZ - d2); } - public float bl() { + public float bk() { return (float) this.getAttributeInstance(GenericAttributes.d).getValue(); } @@ -1276,7 +1276,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen this.a(StatisticList.m, i); this.a(0.015F * (float) i * 0.01F); } - } else if (this.M()) { + } else if (this.L()) { i = Math.round(MathHelper.sqrt(d0 * d0 + d2 * d2) * 100.0F); if (i > 0) { this.a(StatisticList.i, i); @@ -1348,16 +1348,16 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen } int i = EntityTypes.a(entityliving); - MonsterEggInfo monsteregginfo = (MonsterEggInfo) EntityTypes.a.get(Integer.valueOf(i)); + MonsterEggInfo monsteregginfo = (MonsterEggInfo) EntityTypes.eggInfo.get(Integer.valueOf(i)); if (monsteregginfo != null) { - this.a(monsteregginfo.d, 1); + this.a(monsteregginfo.killEntityStatistic, 1); } } - public void as() { + public void ar() { if (!this.abilities.isFlying) { - super.as(); + super.ar(); } } @@ -1417,7 +1417,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen return (flag || this.foodData.c()) && !this.abilities.isInvulnerable; } - public boolean bP() { + public boolean bQ() { return this.getHealth() > 0.0F && this.getHealth() < this.getMaxHealth(); } @@ -1442,8 +1442,8 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen return true; } - if (this.bD() != null) { - ItemStack itemstack = this.bD(); + if (this.bE() != null) { + ItemStack itemstack = this.bE(); if (itemstack.b(block) || itemstack.a(block) > 1.0F) { return true; @@ -1482,7 +1482,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen this.expTotal = entityhuman.expTotal; this.exp = entityhuman.exp; this.setScore(entityhuman.getScore()); - this.ar = entityhuman.ar; + this.aq = entityhuman.aq; } else if (this.world.getGameRules().getBoolean("keepInventory")) { this.inventory.b(entityhuman.inventory); this.expLevel = entityhuman.expLevel; @@ -1518,7 +1518,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen return i == 0 ? this.inventory.getItemInHand() : this.inventory.armor[i - 1]; } - public ItemStack be() { + public ItemStack bd() { return this.inventory.getItemInHand(); } @@ -1530,7 +1530,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen return this.inventory.armor; } - public boolean aC() { + public boolean aB() { return !this.abilities.isFlying; } @@ -1543,10 +1543,10 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen } public IChatBaseComponent getScoreboardDisplayName() { - // CraftBukkit todo: fun + // CraftBukkit - todo: fun ChatComponentText chatcomponenttext = new ChatComponentText(ScoreboardTeam.getPlayerDisplayName(this.getScoreboardTeam(), this.getName())); - chatcomponenttext.b().a(new ChatClickable(EnumClickAction.SUGGEST_COMMAND, "/msg " + this.getName() + " ")); + chatcomponenttext.getChatModifier().setChatClickable(new ChatClickable(EnumClickAction.SUGGEST_COMMAND, "/msg " + this.getName() + " ")); return chatcomponenttext; } @@ -1558,7 +1558,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen this.getDataWatcher().watch(17, Float.valueOf(f)); } - public float bs() { + public float br() { return this.getDataWatcher().getFloat(17); } diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java index 885a0efc1b..c8b6234266 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java @@ -14,9 +14,9 @@ public abstract class EntityInsentient extends EntityLiving { public int a_; protected int b; - private ControllerLook h; + private ControllerLook lookController; private ControllerMove moveController; - private ControllerJump lookController; + private ControllerJump bm; private EntityAIBodyControl bn; private Navigation navigation; protected final PathfinderGoalSelector goalSelector; @@ -38,9 +38,9 @@ public abstract class EntityInsentient extends EntityLiving { super(world); this.goalSelector = new PathfinderGoalSelector(world != null && world.methodProfiler != null ? world.methodProfiler : null); this.targetSelector = new PathfinderGoalSelector(world != null && world.methodProfiler != null ? world.methodProfiler : null); - this.h = new ControllerLook(this); + this.lookController = new ControllerLook(this); this.moveController = new ControllerMove(this); - this.lookController = new ControllerJump(this); + this.bm = new ControllerJump(this); this.bn = new EntityAIBodyControl(this); this.navigation = new Navigation(this, world); this.bq = new EntitySenses(this); @@ -50,13 +50,13 @@ public abstract class EntityInsentient extends EntityLiving { } } - protected void aD() { - super.aD(); - this.bc().b(GenericAttributes.b).setValue(16.0D); + protected void aC() { + super.aC(); + this.bb().b(GenericAttributes.b).setValue(16.0D); } public ControllerLook getControllerLook() { - return this.h; + return this.lookController; } public ControllerMove getControllerMove() { @@ -64,7 +64,7 @@ public abstract class EntityInsentient extends EntityLiving { } public ControllerJump getControllerJump() { - return this.lookController; + return this.bm; } public Navigation getNavigation() { @@ -103,12 +103,12 @@ public abstract class EntityInsentient extends EntityLiving { String s = this.t(); if (s != null) { - this.makeSound(s, this.bf(), this.bg()); + this.makeSound(s, this.be(), this.bf()); } } - public void C() { - super.C(); + public void B() { + super.B(); this.world.methodProfiler.a("mobBaseTick"); if (this.isAlive() && this.random.nextInt(1000) < this.a_++) { this.a_ = -this.q(); @@ -154,7 +154,7 @@ public abstract class EntityInsentient extends EntityLiving { } protected float f(float f, float f1) { - if (this.bk()) { + if (this.bj()) { this.bn.a(); return f1; } else { @@ -205,7 +205,7 @@ public abstract class EntityInsentient extends EntityLiving { public void b(NBTTagCompound nbttagcompound) { super.b(nbttagcompound); - nbttagcompound.setBoolean("CanPickUpLoot", this.bH()); + nbttagcompound.setBoolean("CanPickUpLoot", this.bJ()); nbttagcompound.setBoolean("PersistenceRequired", this.persistent); NBTTagList nbttaglist = new NBTTagList(); @@ -294,7 +294,7 @@ public abstract class EntityInsentient extends EntityLiving { } public void n(float f) { - this.bf = f; + this.be = f; } public void i(float f) { @@ -305,7 +305,7 @@ public abstract class EntityInsentient extends EntityLiving { public void e() { super.e(); this.world.methodProfiler.a("looting"); - if (!this.world.isStatic && this.bH() && !this.aU && this.world.getGameRules().getBoolean("mobGriefing")) { + if (!this.world.isStatic && this.bJ() && !this.aT && this.world.getGameRules().getBoolean("mobGriefing")) { List list = this.world.a(EntityItem.class, this.boundingBox.grow(1.0D, 0.0D, 1.0D)); Iterator iterator = list.iterator(); @@ -379,7 +379,7 @@ public abstract class EntityInsentient extends EntityLiving { this.world.methodProfiler.b(); } - protected boolean bk() { + protected boolean bj() { return false; } @@ -389,7 +389,7 @@ public abstract class EntityInsentient extends EntityLiving { protected void w() { if (this.persistent) { - this.aV = 0; + this.aU = 0; } else { EntityHuman entityhuman = this.world.findNearbyPlayer(this, -1.0D); @@ -403,17 +403,17 @@ public abstract class EntityInsentient extends EntityLiving { this.die(); } - if (this.aV > 600 && this.random.nextInt(800) == 0 && d3 > 1024.0D) { // CraftBukkit - remove isTypeNotPersistent() check + if (this.aU > 600 && this.random.nextInt(800) == 0 && d3 > 1024.0D) { // CraftBukkit - remove isTypeNotPersistent() check this.die(); } else if (d3 < 1024.0D) { - this.aV = 0; + this.aU = 0; } } } } - protected void bn() { - ++this.aV; + protected void bm() { + ++this.aU; this.world.methodProfiler.a("checkDespawn"); this.w(); this.world.methodProfiler.b(); @@ -430,23 +430,23 @@ public abstract class EntityInsentient extends EntityLiving { this.navigation.f(); this.world.methodProfiler.b(); this.world.methodProfiler.a("mob tick"); - this.bp(); + this.bo(); this.world.methodProfiler.b(); this.world.methodProfiler.a("controls"); this.world.methodProfiler.a("move"); this.moveController.c(); this.world.methodProfiler.c("look"); - this.h.a(); + this.lookController.a(); this.world.methodProfiler.c("jump"); - this.lookController.b(); + this.bm.b(); this.world.methodProfiler.b(); this.world.methodProfiler.b(); } - protected void bq() { - super.bq(); + protected void bp() { + super.bp(); + this.bd = 0.0F; this.be = 0.0F; - this.bf = 0.0F; this.w(); float f = 8.0F; @@ -457,33 +457,33 @@ public abstract class EntityInsentient extends EntityLiving { this.bu = entityhuman; this.g = 10 + this.random.nextInt(20); } else { - this.bg = (this.random.nextFloat() - 0.5F) * 20.0F; + this.bf = (this.random.nextFloat() - 0.5F) * 20.0F; } } if (this.bu != null) { - this.a(this.bu, 10.0F, (float) this.x()); - if (this.g-- <= 0 || this.bu.dead || this.bu.e((Entity) this) > (double) (f * f)) { + this.a(this.bu, 10.0F, (float) this.bv()); + if (this.g-- <= 0 || this.bu.dead || this.bu.f((Entity) this) > (double) (f * f)) { this.bu = null; } } else { if (this.random.nextFloat() < 0.05F) { - this.bg = (this.random.nextFloat() - 0.5F) * 20.0F; + this.bf = (this.random.nextFloat() - 0.5F) * 20.0F; } - this.yaw += this.bg; + this.yaw += this.bf; this.pitch = this.f; } - boolean flag = this.M(); - boolean flag1 = this.P(); + boolean flag = this.L(); + boolean flag1 = this.O(); if (flag || flag1) { - this.bd = this.random.nextFloat() < 0.8F; + this.bc = this.random.nextFloat() < 0.8F; } } - public int x() { + public int bv() { return 40; } @@ -526,11 +526,11 @@ public abstract class EntityInsentient extends EntityLiving { return this.world.b(this.boundingBox) && this.world.getCubes(this, this.boundingBox).isEmpty() && !this.world.containsLiquid(this.boundingBox); } - public int bz() { + public int bB() { return 4; } - public int ax() { + public int aw() { if (this.getGoalTarget() == null) { return 3; } else { @@ -545,7 +545,7 @@ public abstract class EntityInsentient extends EntityLiving { } } - public ItemStack be() { + public ItemStack bd() { return this.equipment[0]; } @@ -591,7 +591,7 @@ public abstract class EntityInsentient extends EntityLiving { } } - protected void bA() { + protected void bC() { if (this.random.nextFloat() < 0.15F * this.world.b(this.locX, this.locY, this.locZ)) { int i = this.random.nextInt(2); float f = this.world.difficulty == EnumDifficulty.HARD ? 0.1F : 0.25F; @@ -709,11 +709,11 @@ public abstract class EntityInsentient extends EntityLiving { } } - protected void bB() { + protected void bD() { float f = this.world.b(this.locX, this.locY, this.locZ); - if (this.be() != null && this.random.nextFloat() < 0.25F * f) { - EnchantmentManager.a(this.random, this.be(), (int) (5.0F + f * (float) this.random.nextInt(18))); + if (this.bd() != null && this.random.nextFloat() < 0.25F * f) { + EnchantmentManager.a(this.random, this.bd(), (int) (5.0F + f * (float) this.random.nextInt(18))); } for (int i = 0; i < 4; ++i) { @@ -730,7 +730,7 @@ public abstract class EntityInsentient extends EntityLiving { return groupdataentity; } - public boolean bC() { + public boolean bE() { return false; } @@ -738,7 +738,7 @@ public abstract class EntityInsentient extends EntityLiving { return this.hasCustomName() ? this.getCustomName() : super.getName(); } - public void bD() { + public void bF() { this.persistent = true; } @@ -766,7 +766,7 @@ public abstract class EntityInsentient extends EntityLiving { this.dropChances[i] = f; } - public boolean bH() { + public boolean bJ() { return this.canPickUpLoot; } @@ -779,8 +779,8 @@ public abstract class EntityInsentient extends EntityLiving { } public final boolean c(EntityHuman entityhuman) { - if (this.bL() && this.getLeashHolder() == entityhuman) { - // CraftBukkit start + if (this.bN() && this.getLeashHolder() == entityhuman) { + // CraftBukkit start - fire PlayerUnleashEntityEvent if (CraftEventFactory.callPlayerUnleashEntityEvent(this, entityhuman).isCancelled()) { ((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutAttachEntity(1, this, this.getLeashHolder())); return false; @@ -791,9 +791,9 @@ public abstract class EntityInsentient extends EntityLiving { } else { ItemStack itemstack = entityhuman.inventory.getItemInHand(); - if (itemstack != null && itemstack.getItem() == Items.LEASH && this.bK()) { + if (itemstack != null && itemstack.getItem() == Items.LEASH && this.bM()) { if (!(this instanceof EntityTameableAnimal) || !((EntityTameableAnimal) this).isTamed()) { - // CraftBukkit start + // CraftBukkit start - fire PlayerLeashEntityEvent if (CraftEventFactory.callPlayerLeashEntityEvent(this, entityhuman, entityhuman).isCancelled()) { ((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutAttachEntity(1, this, this.getLeashHolder())); return false; @@ -805,7 +805,7 @@ public abstract class EntityInsentient extends EntityLiving { } if (entityhuman.getName().equalsIgnoreCase(((EntityTameableAnimal) this).getOwnerName())) { - // CraftBukkit start + // CraftBukkit start - fire PlayerLeashEntityEvent if (CraftEventFactory.callPlayerLeashEntityEvent(this, entityhuman, entityhuman).isCancelled()) { ((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutAttachEntity(1, this, this.getLeashHolder())); return false; @@ -825,9 +825,9 @@ public abstract class EntityInsentient extends EntityLiving { return false; } - protected void bJ() { + protected void bL() { if (this.bx != null) { - this.bN(); + this.bP(); } if (this.bv) { @@ -852,11 +852,11 @@ public abstract class EntityInsentient extends EntityLiving { } } - public boolean bK() { - return !this.bL() && !(this instanceof IMonster); + public boolean bM() { + return !this.bN() && !(this instanceof IMonster); } - public boolean bL() { + public boolean bN() { return this.bv; } @@ -872,7 +872,7 @@ public abstract class EntityInsentient extends EntityLiving { } } - private void bN() { + private void bP() { if (this.bv && this.bx != null) { if (this.bx.hasKeyOfType("UUIDMost", 4) && this.bx.hasKeyOfType("UUIDLeast", 4)) { UUID uuid = new UUID(this.bx.getLong("UUIDMost"), this.bx.getLong("UUIDLeast")); diff --git a/src/main/java/net/minecraft/server/EntityIronGolem.java b/src/main/java/net/minecraft/server/EntityIronGolem.java index 80060e9b1c..afc7e0ee26 100644 --- a/src/main/java/net/minecraft/server/EntityIronGolem.java +++ b/src/main/java/net/minecraft/server/EntityIronGolem.java @@ -31,16 +31,16 @@ public class EntityIronGolem extends EntityGolem { this.datawatcher.a(16, Byte.valueOf((byte) 0)); } - public boolean bk() { + public boolean bj() { return true; } - protected void bp() { + protected void bo() { if (--this.bq <= 0) { this.bq = 70 + this.random.nextInt(50); this.bp = this.world.villages.getClosestVillage(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ), 32); if (this.bp == null) { - this.bV(); + this.bX(); } else { ChunkCoordinates chunkcoordinates = this.bp.getCenter(); @@ -48,11 +48,11 @@ public class EntityIronGolem extends EntityGolem { } } - super.bp(); + super.bo(); } - protected void aD() { - super.aD(); + protected void aC() { + super.aC(); this.getAttributeInstance(GenericAttributes.a).setValue(100.0D); this.getAttributeInstance(GenericAttributes.d).setValue(0.25D); } @@ -61,12 +61,12 @@ public class EntityIronGolem extends EntityGolem { return i; } - protected void n(Entity entity) { - if (entity instanceof IMonster && this.aI().nextInt(20) == 0) { + protected void o(Entity entity) { + if (entity instanceof IMonster && this.aH().nextInt(20) == 0) { this.setGoalTarget((EntityLiving) entity); } - super.n(entity); + super.o(entity); } public void e() { @@ -105,7 +105,7 @@ public class EntityIronGolem extends EntityGolem { this.setPlayerCreated(nbttagcompound.getBoolean("PlayerCreated")); } - public boolean m(Entity entity) { + public boolean n(Entity entity) { this.br = 10; this.world.broadcastEntityEffect(this, (byte) 4); boolean flag = entity.damageEntity(DamageSource.mobAttack(this), (float) (7 + this.random.nextInt(15))); @@ -118,7 +118,7 @@ public class EntityIronGolem extends EntityGolem { return flag; } - public Village bX() { + public Village bZ() { return this.bp; } @@ -127,11 +127,11 @@ public class EntityIronGolem extends EntityGolem { this.world.broadcastEntityEffect(this, (byte) 11); } - protected String aT() { + protected String aS() { return "mob.irongolem.hit"; } - protected String aU() { + protected String aT() { return "mob.irongolem.death"; } @@ -160,7 +160,7 @@ public class EntityIronGolem extends EntityGolem { // CraftBukkit end } - public int bZ() { + public int cb() { return this.bs; } diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java index bbcf6746cd..8343ac9f35 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java @@ -73,7 +73,7 @@ public class EntityItem extends Entity { this.lastY = this.locY; this.lastZ = this.locZ; this.motY -= 0.03999999910593033D; - this.Y = this.j(this.locX, (this.boundingBox.b + this.boundingBox.e) / 2.0D, this.locZ); + this.X = this.j(this.locX, (this.boundingBox.b + this.boundingBox.e) / 2.0D, this.locZ); this.move(this.motX, this.motY, this.motZ); boolean flag = (int) this.lastX != (int) this.locX || (int) this.lastY != (int) this.locY || (int) this.lastZ != (int) this.locZ; @@ -105,7 +105,7 @@ public class EntityItem extends Entity { // ++this.age; // CraftBukkit - Moved up if (!this.world.isStatic && this.age >= 6000) { - // CraftBukkit start + // CraftBukkit start - fire ItemDespawnEvent if (org.bukkit.craftbukkit.event.CraftEventFactory.callItemDespawnEvent(this).isCancelled()) { this.age = 0; return; @@ -164,7 +164,7 @@ public class EntityItem extends Entity { this.age = 4800; } - public boolean N() { + public boolean M() { return this.world.a(this.boundingBox, Material.WATER, (Entity) this); } @@ -175,10 +175,10 @@ public class EntityItem extends Entity { public boolean damageEntity(DamageSource damagesource, float f) { if (this.isInvulnerable()) { return false; - } else if (this.getItemStack() != null && this.getItemStack().getItem() == Items.NETHER_STAR && damagesource.c()) { + } else if (this.getItemStack() != null && this.getItemStack().getItem() == Items.NETHER_STAR && damagesource.isExplosion()) { return false; } else { - this.Q(); + this.P(); this.e = (int) ((float) this.e - f); if (this.e <= 0) { this.die(); @@ -217,7 +217,7 @@ public class EntityItem extends Entity { NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("Item"); - // CraftBukkit start + // CraftBukkit start - Handle missing "Item" compounds if (nbttagcompound1 != null) { ItemStack itemstack = ItemStack.createStack(nbttagcompound1); if (itemstack != null) { @@ -239,7 +239,7 @@ public class EntityItem extends Entity { ItemStack itemstack = this.getItemStack(); int i = itemstack.count; - // CraftBukkit start + // CraftBukkit start - fire PlayerPickupItemEvent int canHold = entityhuman.inventory.canHold(itemstack); int remaining = itemstack.count - canHold; @@ -301,7 +301,7 @@ public class EntityItem extends Entity { return LocaleI18n.get("item." + this.getItemStack().a()); } - public boolean av() { + public boolean au() { return false; } @@ -315,15 +315,7 @@ public class EntityItem extends Entity { public ItemStack getItemStack() { ItemStack itemstack = this.getDataWatcher().getItemStack(10); - if (itemstack == null) { - if (this.world != null) { - d.error("Item entity " + this.getId() + " has no item?!"); - } - - return new ItemStack(Blocks.STONE); - } else { - return itemstack; - } + return itemstack == null ? new ItemStack(Blocks.STONE) : itemstack; } public void setItemStack(ItemStack itemstack) { diff --git a/src/main/java/net/minecraft/server/EntityItemFrame.java b/src/main/java/net/minecraft/server/EntityItemFrame.java index 12d0506494..8d39f5f4ba 100644 --- a/src/main/java/net/minecraft/server/EntityItemFrame.java +++ b/src/main/java/net/minecraft/server/EntityItemFrame.java @@ -23,7 +23,7 @@ public class EntityItemFrame extends EntityHanging { return false; } else if (this.getItem() != null) { if (!this.world.isStatic) { - // CraftBukkit start + // CraftBukkit start - fire EntityDamageEvent org.bukkit.event.entity.EntityDamageEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.handleEntityDamageEvent(this, damagesource, f); if ((event != null && event.isCancelled()) || this.dead) { return true; @@ -136,7 +136,7 @@ public class EntityItemFrame extends EntityHanging { public boolean c(EntityHuman entityhuman) { if (this.getItem() == null) { - ItemStack itemstack = entityhuman.be(); + ItemStack itemstack = entityhuman.bd(); if (itemstack != null && !this.world.isStatic) { this.setItem(itemstack); diff --git a/src/main/java/net/minecraft/server/EntityLargeFireball.java b/src/main/java/net/minecraft/server/EntityLargeFireball.java index d136d2da35..326f7ea6b4 100644 --- a/src/main/java/net/minecraft/server/EntityLargeFireball.java +++ b/src/main/java/net/minecraft/server/EntityLargeFireball.java @@ -20,7 +20,7 @@ public class EntityLargeFireball extends EntityFireball { movingobjectposition.entity.damageEntity(DamageSource.fireball(this, this.shooter), 6.0F); } - // CraftBukkit start + // CraftBukkit start - fire ExplosionPrimeEvent ExplosionPrimeEvent event = new ExplosionPrimeEvent((org.bukkit.entity.Explosive) org.bukkit.craftbukkit.entity.CraftEntity.getEntity(this.world.getServer(), this)); this.world.getServer().getPluginManager().callEvent(event); diff --git a/src/main/java/net/minecraft/server/EntityLeash.java b/src/main/java/net/minecraft/server/EntityLeash.java index 420879946e..ea590d485d 100644 --- a/src/main/java/net/minecraft/server/EntityLeash.java +++ b/src/main/java/net/minecraft/server/EntityLeash.java @@ -41,7 +41,7 @@ public class EntityLeash extends EntityHanging { public void a(NBTTagCompound nbttagcompound) {} public boolean c(EntityHuman entityhuman) { - ItemStack itemstack = entityhuman.be(); + ItemStack itemstack = entityhuman.bd(); boolean flag = false; double d0; List list; @@ -50,13 +50,13 @@ public class EntityLeash extends EntityHanging { if (itemstack != null && itemstack.getItem() == Items.LEASH && !this.world.isStatic) { d0 = 7.0D; - list = this.world.a(EntityInsentient.class, AxisAlignedBB.a().a(this.locX - d0, this.locY - d0, this.locZ - d0, this.locX + d0, this.locY + d0, this.locZ + d0)); + list = this.world.a(EntityInsentient.class, AxisAlignedBB.a(this.locX - d0, this.locY - d0, this.locZ - d0, this.locX + d0, this.locY + d0, this.locZ + d0)); if (list != null) { iterator = list.iterator(); while (iterator.hasNext()) { entityinsentient = (EntityInsentient) iterator.next(); - if (entityinsentient.bL() && entityinsentient.getLeashHolder() == entityhuman) { + if (entityinsentient.bN() && entityinsentient.getLeashHolder() == entityhuman) { // CraftBukkit start if (CraftEventFactory.callPlayerLeashEntityEvent(entityinsentient, this, entityhuman).isCancelled()) { ((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutAttachEntity(1, entityinsentient, entityinsentient.getLeashHolder())); @@ -77,13 +77,13 @@ public class EntityLeash extends EntityHanging { // CraftBukkit end if (true || entityhuman.abilities.canInstantlyBuild) { // CraftBukkit - Process for non-creative as well d0 = 7.0D; - list = this.world.a(EntityInsentient.class, AxisAlignedBB.a().a(this.locX - d0, this.locY - d0, this.locZ - d0, this.locX + d0, this.locY + d0, this.locZ + d0)); + list = this.world.a(EntityInsentient.class, AxisAlignedBB.a(this.locX - d0, this.locY - d0, this.locZ - d0, this.locX + d0, this.locY + d0, this.locZ + d0)); if (list != null) { iterator = list.iterator(); while (iterator.hasNext()) { entityinsentient = (EntityInsentient) iterator.next(); - if (entityinsentient.bL() && entityinsentient.getLeashHolder() == this) { + if (entityinsentient.bN() && entityinsentient.getLeashHolder() == this) { // CraftBukkit start if (CraftEventFactory.callPlayerUnleashEntityEvent(entityinsentient, entityhuman).isCancelled()) { die = false; @@ -112,13 +112,13 @@ public class EntityLeash extends EntityHanging { public static EntityLeash a(World world, int i, int j, int k) { EntityLeash entityleash = new EntityLeash(world, i, j, k); - entityleash.o = true; + entityleash.n = true; world.addEntity(entityleash); return entityleash; } public static EntityLeash b(World world, int i, int j, int k) { - List list = world.a(EntityLeash.class, AxisAlignedBB.a().a((double) i - 1.0D, (double) j - 1.0D, (double) k - 1.0D, (double) i + 1.0D, (double) j + 1.0D, (double) k + 1.0D)); + List list = world.a(EntityLeash.class, AxisAlignedBB.a((double) i - 1.0D, (double) j - 1.0D, (double) k - 1.0D, (double) i + 1.0D, (double) j + 1.0D, (double) k + 1.0D)); if (list != null) { Iterator iterator = list.iterator(); diff --git a/src/main/java/net/minecraft/server/EntityLightning.java b/src/main/java/net/minecraft/server/EntityLightning.java index 36923bb6dd..2fd88c0f24 100644 --- a/src/main/java/net/minecraft/server/EntityLightning.java +++ b/src/main/java/net/minecraft/server/EntityLightning.java @@ -22,16 +22,15 @@ public class EntityLightning extends EntityWeather { super(world); - // CraftBukkit start + // CraftBukkit - Set isEffect this.isEffect = isEffect; - // CraftBukkit end this.setPositionRotation(d0, d1, d2, 0.0F, 0.0F); this.lifeTicks = 2; this.a = this.random.nextLong(); this.c = this.random.nextInt(3) + 1; - // CraftBukkit + // CraftBukkit - add "!isEffect" if (!isEffect && !world.isStatic && world.getGameRules().getBoolean("doFireTick") && (world.difficulty == EnumDifficulty.NORMAL || world.difficulty == EnumDifficulty.HARD) && world.areChunksLoaded(MathHelper.floor(d0), MathHelper.floor(d1), MathHelper.floor(d2), 10)) { int i = MathHelper.floor(d0); int j = MathHelper.floor(d1); @@ -76,7 +75,7 @@ public class EntityLightning extends EntityWeather { --this.c; this.lifeTicks = 1; this.a = this.random.nextLong(); - // CraftBukkit + // CraftBukkit - add "!isEffect" if (!isEffect && !this.world.isStatic && this.world.getGameRules().getBoolean("doFireTick") && this.world.areChunksLoaded(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ), 10)) { int i = MathHelper.floor(this.locX); int j = MathHelper.floor(this.locY); @@ -98,7 +97,7 @@ public class EntityLightning extends EntityWeather { this.world.q = 2; } else { double d0 = 3.0D; - List list = this.world.getEntities(this, AxisAlignedBB.a().a(this.locX - d0, this.locY - d0, this.locZ - d0, this.locX + d0, this.locY + 6.0D + d0, this.locZ + d0)); + List list = this.world.getEntities(this, AxisAlignedBB.a(this.locX - d0, this.locY - d0, this.locZ - d0, this.locX + d0, this.locY + 6.0D + d0, this.locZ + d0)); for (int l = 0; l < list.size(); ++l) { Entity entity = (Entity) list.get(l); diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java index 7211da8382..af5deb93d4 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -21,21 +21,22 @@ public abstract class EntityLiving extends Entity { public CombatTracker combatTracker = new CombatTracker(this); // CraftBukkit - private -> public, remove final public final HashMap effects = new HashMap(); // CraftBukkit - protected -> public private final ItemStack[] g = new ItemStack[5]; - public boolean au; + public boolean at; + public int au; public int av; - public int aw; - public float ax; + public float aw; public int hurtTicks; - public int az; - public float aA; + public int ay; + public float az; public int deathTicks; public int attackTicks; + public float aC; public float aD; public float aE; public float aF; public float aG; - public float aH; public int maxNoDamageTicks = 20; + public float aI; public float aJ; public float aK; public float aL; @@ -43,32 +44,31 @@ public abstract class EntityLiving extends Entity { public float aN; public float aO; public float aP; - public float aQ; - public float aR = 0.02F; + public float aQ = 0.02F; public EntityHuman killer; // CraftBukkit - protected -> public protected int lastDamageByPlayerTime; - protected boolean aU; - protected int aV; + protected boolean aT; + protected int aU; + protected float aV; protected float aW; protected float aX; protected float aY; protected float aZ; - protected float ba; - protected int bb; + protected int ba; public float lastDamage; // CraftBukkit - protected -> public - protected boolean bd; + protected boolean bc; + public float bd; public float be; - public float bf; - protected float bg; - protected int bh; + protected float bf; + protected int bg; + protected double bh; protected double bi; protected double bj; protected double bk; protected double bl; - protected double bm; public boolean updateEffects = true; // CraftBukkit - private -> public public EntityLiving lastDamager; // CraftBukkit - private -> public - private int j; + private int bm; private EntityLiving bn; private int bo; private float bp; @@ -81,16 +81,16 @@ public abstract class EntityLiving extends Entity { public EntityLiving(World world) { super(world); - this.aD(); + this.aC(); // CraftBukkit - setHealth(getMaxHealth()) inlined and simplified to skip the instanceof check for EntityPlayer, as getBukkitEntity() is not initialized in constructor this.datawatcher.watch(6, (float) this.getAttributeInstance(GenericAttributes.a).getValue()); - this.l = true; - this.aM = (float) (Math.random() + 1.0D) * 0.01F; + this.k = true; + this.aL = (float) (Math.random() + 1.0D) * 0.01F; this.setPosition(this.locX, this.locY, this.locZ); - this.aL = (float) Math.random() * 12398.0F; + this.aK = (float) Math.random() * 12398.0F; this.yaw = (float) (Math.random() * 3.1415927410125732D * 2.0D); - this.aP = this.yaw; - this.X = 0.5F; + this.aO = this.yaw; + this.W = 0.5F; } protected void c() { @@ -100,18 +100,18 @@ public abstract class EntityLiving extends Entity { this.datawatcher.a(6, Float.valueOf(1.0F)); } - protected void aD() { - this.bc().b(GenericAttributes.a); - this.bc().b(GenericAttributes.c); - this.bc().b(GenericAttributes.d); - if (!this.bk()) { + protected void aC() { + this.bb().b(GenericAttributes.a); + this.bb().b(GenericAttributes.c); + this.bb().b(GenericAttributes.d); + if (!this.bj()) { this.getAttributeInstance(GenericAttributes.d).setValue(0.10000000149011612D); } } protected void a(double d0, boolean flag) { - if (!this.M()) { - this.N(); + if (!this.L()) { + this.M(); } if (flag && this.fallDistance > 0.0F) { @@ -143,13 +143,13 @@ public abstract class EntityLiving extends Entity { super.a(d0, flag); } - public boolean aE() { + public boolean aD() { return false; } - public void C() { - this.aD = this.aE; - super.C(); + public void B() { + this.aC = this.aD; + super.B(); this.world.methodProfiler.a("livingEntityBaseTick"); if (this.isAlive() && this.inBlock()) { this.damageEntity(DamageSource.STUCK, 1.0F); @@ -162,7 +162,7 @@ public abstract class EntityLiving extends Entity { boolean flag = this instanceof EntityHuman && ((EntityHuman) this).abilities.isInvulnerable; if (this.isAlive() && this.a(Material.WATER)) { - if (!this.aE() && !this.hasEffect(MobEffectList.WATER_BREATHING.id) && !flag) { + if (!this.aD() && !this.hasEffect(MobEffectList.WATER_BREATHING.id) && !flag) { this.setAirTicks(this.j(this.getAirTicks())); if (this.getAirTicks() == -20) { this.setAirTicks(0); @@ -179,7 +179,7 @@ public abstract class EntityLiving extends Entity { } } - if (!this.world.isStatic && this.am() && this.vehicle instanceof EntityLiving) { + if (!this.world.isStatic && this.al() && this.vehicle instanceof EntityLiving) { this.mount((Entity) null); } } else { @@ -190,11 +190,11 @@ public abstract class EntityLiving extends Entity { // CraftBukkit end } - if (this.isAlive() && this.L()) { + if (this.isAlive() && this.K()) { this.extinguish(); } - this.aJ = this.aK; + this.aI = this.aJ; if (this.attackTicks > 0) { --this.attackTicks; } @@ -208,7 +208,7 @@ public abstract class EntityLiving extends Entity { } if (this.getHealth() <= 0.0F) { - this.aF(); + this.aE(); } if (this.lastDamageByPlayerTime > 0) { @@ -224,15 +224,15 @@ public abstract class EntityLiving extends Entity { if (this.lastDamager != null) { if (!this.lastDamager.isAlive()) { this.b((EntityLiving) null); - } else if (this.ticksLived - this.j > 100) { + } else if (this.ticksLived - this.bm > 100) { this.b((EntityLiving) null); } } - this.removeAllEffects(); - this.aZ = this.aY; - this.aO = this.aN; - this.aQ = this.aP; + this.aN(); + this.aY = this.aX; + this.aN = this.aM; + this.aP = this.aO; this.lastYaw = this.yaw; this.lastPitch = this.pitch; this.world.methodProfiler.b(); @@ -242,7 +242,7 @@ public abstract class EntityLiving extends Entity { public int getExpReward() { int exp = this.getExpValue(this.killer); - if (!this.world.isStatic && (this.lastDamageByPlayerTime > 0 || this.alwaysGivesExp()) && this.aG()) { + if (!this.world.isStatic && (this.lastDamageByPlayerTime > 0 || this.alwaysGivesExp()) && this.aF() && this.world.getGameRules().getBoolean("doMobLoot")) { return exp; } else { return 0; @@ -254,7 +254,7 @@ public abstract class EntityLiving extends Entity { return false; } - protected void aF() { + protected void aE() { ++this.deathTicks; if (this.deathTicks >= 20 && !this.dead) { // CraftBukkit - (this.deathTicks == 20) -> (this.deathTicks >= 20 && !this.dead) int i; @@ -282,7 +282,7 @@ public abstract class EntityLiving extends Entity { } } - protected boolean aG() { + protected boolean aF() { return !this.isBaby(); } @@ -300,7 +300,7 @@ public abstract class EntityLiving extends Entity { return false; } - public Random aI() { + public Random aH() { return this.random; } @@ -308,24 +308,24 @@ public abstract class EntityLiving extends Entity { return this.lastDamager; } - public int aK() { - return this.j; + public int aJ() { + return this.bm; } public void b(EntityLiving entityliving) { this.lastDamager = entityliving; - this.j = this.ticksLived; + this.bm = this.ticksLived; } - public EntityLiving aL() { + public EntityLiving aK() { return this.bn; } - public int aM() { + public int aL() { return this.bo; } - public void k(Entity entity) { + public void l(Entity entity) { if (entity instanceof EntityLiving) { this.bn = (EntityLiving) entity; } else { @@ -335,8 +335,8 @@ public abstract class EntityLiving extends Entity { this.bo = this.ticksLived; } - public int aN() { - return this.aV; + public int aM() { + return this.aU; } public void b(NBTTagCompound nbttagcompound) { @@ -345,7 +345,7 @@ public abstract class EntityLiving extends Entity { nbttagcompound.setShort("HurtTime", (short) this.hurtTicks); nbttagcompound.setShort("DeathTime", (short) this.deathTicks); nbttagcompound.setShort("AttackTime", (short) this.attackTicks); - nbttagcompound.setFloat("AbsorptionAmount", this.bs()); + nbttagcompound.setFloat("AbsorptionAmount", this.br()); ItemStack[] aitemstack = this.getEquipment(); int i = aitemstack.length; @@ -359,7 +359,7 @@ public abstract class EntityLiving extends Entity { } } - nbttagcompound.set("Attributes", GenericAttributes.a(this.bc())); + nbttagcompound.set("Attributes", GenericAttributes.a(this.bb())); aitemstack = this.getEquipment(); i = aitemstack.length; @@ -387,7 +387,7 @@ public abstract class EntityLiving extends Entity { public void a(NBTTagCompound nbttagcompound) { this.m(nbttagcompound.getFloat("AbsorptionAmount")); if (nbttagcompound.hasKeyOfType("Attributes", 9) && this.world != null && !this.world.isStatic) { - GenericAttributes.a(this.bc(), nbttagcompound.getList("Attributes", 10)); + GenericAttributes.a(this.bb(), nbttagcompound.getList("Attributes", 10)); } if (nbttagcompound.hasKeyOfType("ActiveEffects", 9)) { @@ -433,7 +433,7 @@ public abstract class EntityLiving extends Entity { this.attackTicks = nbttagcompound.getShort("AttackTime"); } - protected void removeAllEffects() { + protected void aN() { Iterator iterator = this.effects.keySet().iterator(); while (iterator.hasNext()) { @@ -495,7 +495,7 @@ public abstract class EntityLiving extends Entity { } } - public void aP() { + public void removeAllEffects() { Iterator iterator = this.effects.keySet().iterator(); while (iterator.hasNext()) { @@ -551,11 +551,11 @@ public abstract class EntityLiving extends Entity { return true; } - public boolean aR() { + public boolean aQ() { return this.getMonsterType() == EnumMonsterType.UNDEAD; } - public void m(int i) { + public void removeEffect(int i) { MobEffect mobeffect = (MobEffect) this.effects.remove(Integer.valueOf(i)); if (mobeffect != null) { @@ -566,22 +566,22 @@ public abstract class EntityLiving extends Entity { protected void a(MobEffect mobeffect) { this.updateEffects = true; if (!this.world.isStatic) { - MobEffectList.byId[mobeffect.getEffectId()].b(this, this.bc(), mobeffect.getAmplifier()); + MobEffectList.byId[mobeffect.getEffectId()].b(this, this.bb(), mobeffect.getAmplifier()); } } protected void a(MobEffect mobeffect, boolean flag) { this.updateEffects = true; if (flag && !this.world.isStatic) { - MobEffectList.byId[mobeffect.getEffectId()].a(this, this.bc(), mobeffect.getAmplifier()); - MobEffectList.byId[mobeffect.getEffectId()].b(this, this.bc(), mobeffect.getAmplifier()); + MobEffectList.byId[mobeffect.getEffectId()].a(this, this.bb(), mobeffect.getAmplifier()); + MobEffectList.byId[mobeffect.getEffectId()].b(this, this.bb(), mobeffect.getAmplifier()); } } protected void b(MobEffect mobeffect) { this.updateEffects = true; if (!this.world.isStatic) { - MobEffectList.byId[mobeffect.getEffectId()].a(this, this.bc(), mobeffect.getAmplifier()); + MobEffectList.byId[mobeffect.getEffectId()].a(this, this.bb(), mobeffect.getAmplifier()); } } @@ -638,7 +638,7 @@ public abstract class EntityLiving extends Entity { } else if (this.world.isStatic) { return false; } else { - this.aV = 0; + this.aU = 0; if (this.getHealth() <= 0.0F) { return false; } else if (damagesource.o() && this.hasEffect(MobEffectList.FIRE_RESISTANCE)) { @@ -649,7 +649,7 @@ public abstract class EntityLiving extends Entity { f *= 0.75F; } - this.aG = 1.5F; + this.aF = 1.5F; boolean flag = true; // CraftBukkit start @@ -672,13 +672,13 @@ public abstract class EntityLiving extends Entity { flag = false; } else { this.lastDamage = f; - this.ax = this.getHealth(); + this.aw = this.getHealth(); this.noDamageTicks = this.maxNoDamageTicks; this.d(damagesource, f); - this.hurtTicks = this.az = 10; + this.hurtTicks = this.ay = 10; } - this.aA = 0.0F; + this.az = 0.0F; Entity entity = damagesource.getEntity(); if (entity != null) { @@ -702,7 +702,7 @@ public abstract class EntityLiving extends Entity { if (flag) { this.world.broadcastEntityEffect(this, (byte) 2); if (damagesource != DamageSource.DROWN) { - this.Q(); + this.P(); } if (entity != null) { @@ -714,26 +714,26 @@ public abstract class EntityLiving extends Entity { d0 = (Math.random() - Math.random()) * 0.01D; } - this.aA = (float) (Math.atan2(d1, d0) * 180.0D / 3.1415927410125732D) - this.yaw; + this.az = (float) (Math.atan2(d1, d0) * 180.0D / 3.1415927410125732D) - this.yaw; this.a(entity, f, d0, d1); } else { - this.aA = (float) ((int) (Math.random() * 2.0D) * 180); + this.az = (float) ((int) (Math.random() * 2.0D) * 180); } } String s; if (this.getHealth() <= 0.0F) { - s = this.aU(); + s = this.aT(); if (flag && s != null) { - this.makeSound(s, this.bf(), this.bg()); + this.makeSound(s, this.be(), this.bf()); } this.die(damagesource); } else { - s = this.aT(); + s = this.aS(); if (flag && s != null) { - this.makeSound(s, this.bf(), this.bg()); + this.makeSound(s, this.be(), this.bf()); } } @@ -746,32 +746,33 @@ public abstract class EntityLiving extends Entity { this.makeSound("random.break", 0.8F, 0.8F + this.world.random.nextFloat() * 0.4F); for (int i = 0; i < 5; ++i) { - Vec3D vec3d = this.world.getVec3DPool().create(((double) this.random.nextFloat() - 0.5D) * 0.1D, Math.random() * 0.1D + 0.1D, 0.0D); + Vec3D vec3d = Vec3D.a(((double) this.random.nextFloat() - 0.5D) * 0.1D, Math.random() * 0.1D + 0.1D, 0.0D); vec3d.a(-this.pitch * 3.1415927F / 180.0F); vec3d.b(-this.yaw * 3.1415927F / 180.0F); - Vec3D vec3d1 = this.world.getVec3DPool().create(((double) this.random.nextFloat() - 0.5D) * 0.3D, (double) (-this.random.nextFloat()) * 0.6D - 0.3D, 0.6D); + Vec3D vec3d1 = Vec3D.a(((double) this.random.nextFloat() - 0.5D) * 0.3D, (double) (-this.random.nextFloat()) * 0.6D - 0.3D, 0.6D); vec3d1.a(-this.pitch * 3.1415927F / 180.0F); vec3d1.b(-this.yaw * 3.1415927F / 180.0F); vec3d1 = vec3d1.add(this.locX, this.locY + (double) this.getHeadHeight(), this.locZ); - this.world.addParticle("iconcrack_" + Item.b(itemstack.getItem()), vec3d1.c, vec3d1.d, vec3d1.e, vec3d.c, vec3d.d + 0.05D, vec3d.e); + this.world.addParticle("iconcrack_" + Item.b(itemstack.getItem()), vec3d1.a, vec3d1.b, vec3d1.c, vec3d.a, vec3d.b + 0.05D, vec3d.c); } } public void die(DamageSource damagesource) { Entity entity = damagesource.getEntity(); - EntityLiving entityliving = this.aX(); + EntityLiving entityliving = this.aW(); - if (this.bb >= 0 && entityliving != null) { - entityliving.b(this, this.bb); + if (this.ba >= 0 && entityliving != null) { + entityliving.b(this, this.ba); } if (entity != null) { entity.a(this); } - this.aU = true; + this.aT = true; + this.aV().g(); if (!this.world.isStatic) { int i = 0; @@ -779,7 +780,7 @@ public abstract class EntityLiving extends Entity { i = EnchantmentManager.getBonusMonsterLootEnchantmentLevel((EntityLiving) entity); } - if (this.aG() && this.world.getGameRules().getBoolean("doMobLoot")) { + if (this.aF() && this.world.getGameRules().getBoolean("doMobLoot")) { this.dropDeathLoot(this.lastDamageByPlayerTime > 0, i); this.dropEquipment(this.lastDamageByPlayerTime > 0, i); if (false && this.lastDamageByPlayerTime > 0) { // CraftBukkit - move rare item drop call to dropDeathLoot @@ -801,7 +802,7 @@ public abstract class EntityLiving extends Entity { public void a(Entity entity, float f, double d0, double d1) { if (this.random.nextDouble() >= this.getAttributeInstance(GenericAttributes.c).getValue()) { - this.am = true; + this.al = true; float f1 = MathHelper.sqrt(d0 * d0 + d1 * d1); float f2 = 0.4F; @@ -817,11 +818,11 @@ public abstract class EntityLiving extends Entity { } } - protected String aT() { + protected String aS() { return "game.neutral.hurt"; } - protected String aU() { + protected String aT() { return "game.neutral.die"; } @@ -886,7 +887,7 @@ public abstract class EntityLiving extends Entity { return i > 4 ? "game.neutral.hurt.fall.big" : "game.neutral.hurt.fall.small"; } - public int aV() { + public int aU() { int i = 0; ItemStack[] aitemstack = this.getEquipment(); int j = aitemstack.length; @@ -908,7 +909,7 @@ public abstract class EntityLiving extends Entity { protected float b(DamageSource damagesource, float f) { if (!damagesource.ignoresArmor()) { - int i = 25 - this.aV(); + int i = 25 - this.aU(); float f1 = f * (float) i; this.h(f); @@ -962,23 +963,23 @@ public abstract class EntityLiving extends Entity { f = this.c(damagesource, f); float f1 = f; - f = Math.max(f - this.bs(), 0.0F); - this.m(this.bs() - (f1 - f)); + f = Math.max(f - this.br(), 0.0F); + this.m(this.br() - (f1 - f)); if (f != 0.0F) { float f2 = this.getHealth(); this.setHealth(f2 - f); - this.aW().a(damagesource, f2, f); - this.m(this.bs() - f); + this.aV().a(damagesource, f2, f); + this.m(this.br() - f); } } } - public CombatTracker aW() { + public CombatTracker aV() { return this.combatTracker; } - public EntityLiving aX() { + public EntityLiving aW() { return (EntityLiving) (this.combatTracker.c() != null ? this.combatTracker.c() : (this.killer != null ? this.killer : (this.lastDamager != null ? this.lastDamager : null))); } @@ -986,7 +987,7 @@ public abstract class EntityLiving extends Entity { return (float) this.getAttributeInstance(GenericAttributes.a).getValue(); } - public final int aZ() { + public final int aY() { return this.datawatcher.getByte(9); } @@ -998,41 +999,41 @@ public abstract class EntityLiving extends Entity { return this.hasEffect(MobEffectList.FASTER_DIG) ? 6 - (1 + this.getEffect(MobEffectList.FASTER_DIG).getAmplifier()) * 1 : (this.hasEffect(MobEffectList.SLOWER_DIG) ? 6 + (1 + this.getEffect(MobEffectList.SLOWER_DIG).getAmplifier()) * 2 : 6); } - public void ba() { - if (!this.au || this.av >= this.j() / 2 || this.av < 0) { - this.av = -1; - this.au = true; + public void aZ() { + if (!this.at || this.au >= this.j() / 2 || this.au < 0) { + this.au = -1; + this.at = true; if (this.world instanceof WorldServer) { ((WorldServer) this.world).getTracker().a((Entity) this, (Packet) (new PacketPlayOutAnimation(this, 0))); } } } - protected void G() { + protected void F() { this.damageEntity(DamageSource.OUT_OF_WORLD, 4.0F); } - protected void bb() { + protected void ba() { int i = this.j(); - if (this.au) { - ++this.av; - if (this.av >= i) { - this.av = 0; - this.au = false; + if (this.at) { + ++this.au; + if (this.au >= i) { + this.au = 0; + this.at = false; } } else { - this.av = 0; + this.au = 0; } - this.aE = (float) this.av / (float) i; + this.aD = (float) this.au / (float) i; } public AttributeInstance getAttributeInstance(IAttribute iattribute) { - return this.bc().a(iattribute); + return this.bb().a(iattribute); } - public AttributeMapBase bc() { + public AttributeMapBase bb() { if (this.d == null) { this.d = new AttributeMapServer(); } @@ -1044,7 +1045,7 @@ public abstract class EntityLiving extends Entity { return EnumMonsterType.UNDEFINED; } - public abstract ItemStack be(); + public abstract ItemStack bd(); public abstract ItemStack getEquipment(int i); @@ -1065,15 +1066,15 @@ public abstract class EntityLiving extends Entity { public abstract ItemStack[] getEquipment(); - protected float bf() { + protected float be() { return 1.0F; } - protected float bg() { + protected float bf() { return this.isBaby() ? (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.5F : (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F; } - protected boolean bh() { + protected boolean bg() { return this.getHealth() <= 0.0F; } @@ -1081,11 +1082,11 @@ public abstract class EntityLiving extends Entity { this.setPositionRotation(d0, d1, d2, this.yaw, this.pitch); } - public void l(Entity entity) { + public void m(Entity entity) { double d0 = entity.locX; double d1 = entity.boundingBox.b + (double) entity.length; double d2 = entity.locZ; - byte b0 = 3; + byte b0 = 1; for (int i = -b0; i <= b0; ++i) { for (int j = -b0; j < b0; ++j) { @@ -1113,7 +1114,7 @@ public abstract class EntityLiving extends Entity { this.enderTeleportTo(d0, d1, d2); } - protected void bj() { + protected void bi() { this.motY = 0.41999998688697815D; if (this.hasEffect(MobEffectList.JUMP)) { this.motY += (double) ((float) (this.getEffect(MobEffectList.JUMP).getAmplifier() + 1) * 0.1F); @@ -1126,15 +1127,15 @@ public abstract class EntityLiving extends Entity { this.motZ += (double) (MathHelper.cos(f) * 0.2F); } - this.am = true; + this.al = true; } public void e(float f, float f1) { double d0; - if (this.M() && (!(this instanceof EntityHuman) || !((EntityHuman) this).abilities.isFlying)) { + if (this.L() && (!(this instanceof EntityHuman) || !((EntityHuman) this).abilities.isFlying)) { d0 = this.locY; - this.a(f, f1, this.bk() ? 0.04F : 0.02F); + this.a(f, f1, this.bj() ? 0.04F : 0.02F); this.move(this.motX, this.motY, this.motZ); this.motX *= 0.800000011920929D; this.motY *= 0.800000011920929D; @@ -1143,7 +1144,7 @@ public abstract class EntityLiving extends Entity { if (this.positionChanged && this.c(this.motX, this.motY + 0.6000000238418579D - this.locY + d0, this.motZ)) { this.motY = 0.30000001192092896D; } - } else if (this.P() && (!(this instanceof EntityHuman) || !((EntityHuman) this).abilities.isFlying)) { + } else if (this.O() && (!(this instanceof EntityHuman) || !((EntityHuman) this).abilities.isFlying)) { d0 = this.locY; this.a(f, f1, 0.02F); this.move(this.motX, this.motY, this.motZ); @@ -1165,9 +1166,9 @@ public abstract class EntityLiving extends Entity { float f4; if (this.onGround) { - f4 = this.bl() * f3; + f4 = this.bk() * f3; } else { - f4 = this.aR; + f4 = this.aQ; } this.a(f, f1, f4); @@ -1227,7 +1228,7 @@ public abstract class EntityLiving extends Entity { this.motZ *= (double) f2; } - this.aF = this.aG; + this.aE = this.aF; d0 = this.locX - this.lastX; double d1 = this.locZ - this.lastZ; float f6 = MathHelper.sqrt(d0 * d0 + d1 * d1) * 4.0F; @@ -1236,24 +1237,24 @@ public abstract class EntityLiving extends Entity { f6 = 1.0F; } - this.aG += (f6 - this.aG) * 0.4F; - this.aH += this.aG; + this.aF += (f6 - this.aF) * 0.4F; + this.aG += this.aF; } - protected boolean bk() { + protected boolean bj() { return false; } - public float bl() { - return this.bk() ? this.bp : 0.1F; + public float bk() { + return this.bj() ? this.bp : 0.1F; } public void i(float f) { this.bp = f; } - public boolean m(Entity entity) { - this.k(entity); + public boolean n(Entity entity) { + this.l(entity); return false; } @@ -1264,15 +1265,15 @@ public abstract class EntityLiving extends Entity { public void h() { super.h(); if (!this.world.isStatic) { - int i = this.aZ(); + int i = this.aY(); if (i > 0) { - if (this.aw <= 0) { - this.aw = 20 * (30 - i); + if (this.av <= 0) { + this.av = 20 * (30 - i); } - --this.aw; - if (this.aw <= 0) { + --this.av; + if (this.av <= 0) { this.p(i - 1); } } @@ -1294,16 +1295,20 @@ public abstract class EntityLiving extends Entity { this.g[j] = itemstack1 == null ? null : itemstack1.cloneItemStack(); } } + + if (this.ticksLived % 20 == 0) { + this.aV().g(); + } } this.e(); double d0 = this.locX - this.lastX; double d1 = this.locZ - this.lastZ; float f = (float) (d0 * d0 + d1 * d1); - float f1 = this.aN; + float f1 = this.aM; float f2 = 0.0F; - this.aW = this.aX; + this.aV = this.aW; float f3 = 0.0F; if (f > 0.0025000002F) { @@ -1313,7 +1318,7 @@ public abstract class EntityLiving extends Entity { f1 = (float) org.bukkit.craftbukkit.TrigMath.atan2(d1, d0) * 180.0F / 3.1415927F - 90.0F; } - if (this.aE > 0.0F) { + if (this.aD > 0.0F) { f1 = this.yaw; } @@ -1321,7 +1326,7 @@ public abstract class EntityLiving extends Entity { f3 = 0.0F; } - this.aX += (f3 - this.aX) * 0.3F; + this.aW += (f3 - this.aW) * 0.3F; this.world.methodProfiler.a("headTurn"); f2 = this.f(f1, f2); this.world.methodProfiler.b(); @@ -1335,12 +1340,12 @@ public abstract class EntityLiving extends Entity { this.lastYaw += 360.0F; } - while (this.aN - this.aO < -180.0F) { - this.aO -= 360.0F; + while (this.aM - this.aN < -180.0F) { + this.aN -= 360.0F; } - while (this.aN - this.aO >= 180.0F) { - this.aO += 360.0F; + while (this.aM - this.aN >= 180.0F) { + this.aN += 360.0F; } while (this.pitch - this.lastPitch < -180.0F) { @@ -1351,23 +1356,23 @@ public abstract class EntityLiving extends Entity { this.lastPitch += 360.0F; } - while (this.aP - this.aQ < -180.0F) { - this.aQ -= 360.0F; + while (this.aO - this.aP < -180.0F) { + this.aP -= 360.0F; } - while (this.aP - this.aQ >= 180.0F) { - this.aQ += 360.0F; + while (this.aO - this.aP >= 180.0F) { + this.aP += 360.0F; } this.world.methodProfiler.b(); - this.aY += f2; + this.aX += f2; } protected float f(float f, float f1) { - float f2 = MathHelper.g(f - this.aN); + float f2 = MathHelper.g(f - this.aM); - this.aN += f2 * 0.3F; - float f3 = MathHelper.g(this.yaw - this.aN); + this.aM += f2 * 0.3F; + float f3 = MathHelper.g(this.yaw - this.aM); boolean flag = f3 < -90.0F || f3 >= 90.0F; if (f3 < -75.0F) { @@ -1378,9 +1383,9 @@ public abstract class EntityLiving extends Entity { f3 = 75.0F; } - this.aN = this.yaw - f3; + this.aM = this.yaw - f3; if (f3 * f3 > 2500.0F) { - this.aN += f3 * 0.2F; + this.aM += f3 * 0.2F; } if (flag) { @@ -1395,18 +1400,18 @@ public abstract class EntityLiving extends Entity { --this.bq; } - if (this.bh > 0) { - double d0 = this.locX + (this.bi - this.locX) / (double) this.bh; - double d1 = this.locY + (this.bj - this.locY) / (double) this.bh; - double d2 = this.locZ + (this.bk - this.locZ) / (double) this.bh; - double d3 = MathHelper.g(this.bl - (double) this.yaw); + if (this.bg > 0) { + double d0 = this.locX + (this.bh - this.locX) / (double) this.bg; + double d1 = this.locY + (this.bi - this.locY) / (double) this.bg; + double d2 = this.locZ + (this.bj - this.locZ) / (double) this.bg; + double d3 = MathHelper.g(this.bk - (double) this.yaw); - this.yaw = (float) ((double) this.yaw + d3 / (double) this.bh); - this.pitch = (float) ((double) this.pitch + (this.bm - (double) this.pitch) / (double) this.bh); - --this.bh; + this.yaw = (float) ((double) this.yaw + d3 / (double) this.bg); + this.pitch = (float) ((double) this.pitch + (this.bm - (double) this.pitch) / (double) this.bg); + --this.bg; this.setPosition(d0, d1, d2); this.b(this.yaw, this.pitch); - } else if (!this.br()) { + } else if (!this.bq()) { this.motX *= 0.98D; this.motY *= 0.98D; this.motZ *= 0.98D; @@ -1425,30 +1430,30 @@ public abstract class EntityLiving extends Entity { } this.world.methodProfiler.a("ai"); - if (this.bh()) { - this.bd = false; + if (this.bg()) { + this.bc = false; + this.bd = 0.0F; this.be = 0.0F; this.bf = 0.0F; - this.bg = 0.0F; - } else if (this.br()) { - if (this.bk()) { + } else if (this.bq()) { + if (this.bj()) { this.world.methodProfiler.a("newAi"); - this.bn(); + this.bm(); this.world.methodProfiler.b(); } else { this.world.methodProfiler.a("oldAi"); - this.bq(); + this.bp(); this.world.methodProfiler.b(); - this.aP = this.yaw; + this.aO = this.yaw; } } this.world.methodProfiler.b(); this.world.methodProfiler.a("jump"); - if (this.bd) { - if (!this.M() && !this.P()) { + if (this.bc) { + if (!this.L() && !this.O()) { if (this.onGround && this.bq == 0) { - this.bj(); + this.bi(); this.bq = 10; } } else { @@ -1460,22 +1465,22 @@ public abstract class EntityLiving extends Entity { this.world.methodProfiler.b(); this.world.methodProfiler.a("travel"); + this.bd *= 0.98F; this.be *= 0.98F; - this.bf *= 0.98F; - this.bg *= 0.9F; - this.e(this.be, this.bf); + this.bf *= 0.9F; + this.e(this.bd, this.be); this.world.methodProfiler.b(); this.world.methodProfiler.a("push"); if (!this.world.isStatic) { - this.bo(); + this.bn(); } this.world.methodProfiler.b(); } - protected void bn() {} + protected void bm() {} - protected void bo() { + protected void bn() { List list = this.world.getEntities(this, this.boundingBox.grow(0.20000000298023224D, 0.0D, 0.20000000298023224D)); if (list != null && !list.isEmpty()) { @@ -1489,32 +1494,32 @@ public abstract class EntityLiving extends Entity { } // CraftBukkit end - if (entity.S()) { - this.n(entity); + if (entity.R()) { + this.o(entity); } } } } - protected void n(Entity entity) { + protected void o(Entity entity) { entity.collide(this); } - public void ab() { - super.ab(); - this.aW = this.aX; - this.aX = 0.0F; + public void aa() { + super.aa(); + this.aV = this.aW; + this.aW = 0.0F; this.fallDistance = 0.0F; } - protected void bp() {} + protected void bo() {} - protected void bq() { - ++this.aV; + protected void bp() { + ++this.aU; } public void f(boolean flag) { - this.bd = flag; + this.bc = flag; } public void receive(Entity entity, int i) { @@ -1535,11 +1540,11 @@ public abstract class EntityLiving extends Entity { } } - public boolean o(Entity entity) { - return this.world.a(this.world.getVec3DPool().create(this.locX, this.locY + (double) this.getHeadHeight(), this.locZ), this.world.getVec3DPool().create(entity.locX, entity.locY + (double) entity.getHeadHeight(), entity.locZ)) == null; + public boolean p(Entity entity) { + return this.world.a(Vec3D.a(this.locX, this.locY + (double) this.getHeadHeight(), this.locZ), Vec3D.a(entity.locX, entity.locY + (double) entity.getHeadHeight(), entity.locZ)) == null; } - public Vec3D ag() { + public Vec3D af() { return this.j(1.0F); } @@ -1554,7 +1559,7 @@ public abstract class EntityLiving extends Entity { f2 = MathHelper.sin(-this.yaw * 0.017453292F - 3.1415927F); f3 = -MathHelper.cos(-this.pitch * 0.017453292F); f4 = MathHelper.sin(-this.pitch * 0.017453292F); - return this.world.getVec3DPool().create((double) (f2 * f3), (double) f4, (double) (f1 * f3)); + return Vec3D.a((double) (f2 * f3), (double) f4, (double) (f1 * f3)); } else { f1 = this.lastPitch + (this.pitch - this.lastPitch) * f; f2 = this.lastYaw + (this.yaw - this.lastYaw) * f; @@ -1563,19 +1568,19 @@ public abstract class EntityLiving extends Entity { float f5 = -MathHelper.cos(-f1 * 0.017453292F); float f6 = MathHelper.sin(-f1 * 0.017453292F); - return this.world.getVec3DPool().create((double) (f4 * f5), (double) f6, (double) (f3 * f5)); + return Vec3D.a((double) (f4 * f5), (double) f6, (double) (f3 * f5)); } } - public boolean br() { + public boolean bq() { return !this.world.isStatic; } - public boolean R() { + public boolean Q() { return !this.dead; } - public boolean S() { + public boolean R() { return !this.dead; } @@ -1583,15 +1588,15 @@ public abstract class EntityLiving extends Entity { return this.length * 0.85F; } - protected void Q() { + protected void P() { this.velocityChanged = this.random.nextDouble() >= this.getAttributeInstance(GenericAttributes.c).getValue(); } public float getHeadRotation() { - return this.aP; + return this.aO; } - public float bs() { + public float br() { return this.br; } @@ -1614,4 +1619,8 @@ public abstract class EntityLiving extends Entity { public boolean a(ScoreboardTeamBase scoreboardteambase) { return this.getScoreboardTeam() != null ? this.getScoreboardTeam().isAlly(scoreboardteambase) : false; } + + public void bt() {} + + public void bu() {} } diff --git a/src/main/java/net/minecraft/server/EntityMagmaCube.java b/src/main/java/net/minecraft/server/EntityMagmaCube.java index 1fe6b073d4..fd50f11bd3 100644 --- a/src/main/java/net/minecraft/server/EntityMagmaCube.java +++ b/src/main/java/net/minecraft/server/EntityMagmaCube.java @@ -7,8 +7,8 @@ public class EntityMagmaCube extends EntitySlime { this.fireProof = true; } - protected void aD() { - super.aD(); + protected void aC() { + super.aC(); this.getAttributeInstance(GenericAttributes.d).setValue(0.20000000298023224D); } @@ -16,7 +16,7 @@ public class EntityMagmaCube extends EntitySlime { return this.world.difficulty != EnumDifficulty.PEACEFUL && this.world.b(this.boundingBox) && this.world.getCubes(this, this.boundingBox).isEmpty() && !this.world.containsLiquid(this.boundingBox); } - public int aV() { + public int aU() { return this.getSize() * 3; } @@ -24,11 +24,11 @@ public class EntityMagmaCube extends EntitySlime { return 1.0F; } - protected String bN() { + protected String bP() { return "flame"; } - protected EntitySlime bO() { + protected EntitySlime bQ() { return new EntityMagmaCube(this.world); } @@ -61,38 +61,38 @@ public class EntityMagmaCube extends EntitySlime { return false; } - protected int bP() { - return super.bP() * 4; + protected int bR() { + return super.bR() * 4; } - protected void bQ() { + protected void bS() { this.h *= 0.9F; } - protected void bj() { + protected void bi() { this.motY = (double) (0.42F + (float) this.getSize() * 0.1F); - this.am = true; + this.al = true; } protected void b(float f) {} - protected boolean bR() { + protected boolean bT() { return true; } - protected int bS() { - return super.bS() + 2; + protected int bU() { + return super.bU() + 2; } - protected String bT() { + protected String bV() { return this.getSize() > 1 ? "mob.magmacube.big" : "mob.magmacube.small"; } - public boolean P() { + public boolean O() { return false; } - protected boolean bU() { + protected boolean bW() { return true; } } diff --git a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java index b570b00e02..f565028d01 100644 --- a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java +++ b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java @@ -36,7 +36,7 @@ public abstract class EntityMinecartAbstract extends Entity { public EntityMinecartAbstract(World world) { super(world); - this.l = true; + this.k = true; this.a(0.98F, 0.7F); this.height = this.length / 2.0F; } @@ -79,15 +79,15 @@ public abstract class EntityMinecartAbstract extends Entity { this.datawatcher.a(22, Byte.valueOf((byte) 0)); } - public AxisAlignedBB g(Entity entity) { - return entity.S() ? entity.boundingBox : null; + public AxisAlignedBB h(Entity entity) { + return entity.R() ? entity.boundingBox : null; } - public AxisAlignedBB J() { + public AxisAlignedBB I() { return null; } - public boolean S() { + public boolean R() { return true; } @@ -104,7 +104,7 @@ public abstract class EntityMinecartAbstract extends Entity { this.world.getServer().getPluginManager().callEvent(new org.bukkit.event.vehicle.VehicleCreateEvent((Vehicle) this.getBukkitEntity())); // CraftBukkit } - public double ae() { + public double ad() { return (double) this.length * 0.0D - 0.30000001192092896D; } @@ -113,7 +113,7 @@ public abstract class EntityMinecartAbstract extends Entity { if (this.isInvulnerable()) { return false; } else { - // CraftBukkit start + // CraftBukkit start - fire VehicleDamageEvent Vehicle vehicle = (Vehicle) this.getBukkitEntity(); org.bukkit.entity.Entity passenger = (damagesource.getEntity() == null) ? null : damagesource.getEntity().getBukkitEntity(); @@ -129,7 +129,7 @@ public abstract class EntityMinecartAbstract extends Entity { this.j(-this.l()); this.c(10); - this.Q(); + this.P(); this.setDamage(this.getDamage() + f * 10.0F); boolean flag = damagesource.getEntity() instanceof EntityHuman && ((EntityHuman) damagesource.getEntity()).abilities.canInstantlyBuild; @@ -173,7 +173,7 @@ public abstract class EntityMinecartAbstract extends Entity { this.a(itemstack, 0.0F); } - public boolean R() { + public boolean Q() { return !this.dead; } @@ -208,12 +208,12 @@ public abstract class EntityMinecartAbstract extends Entity { this.world.methodProfiler.a("portal"); MinecraftServer minecraftserver = ((WorldServer) this.world).getMinecraftServer(); - i = this.D(); - if (this.ao) { + i = this.C(); + if (this.an) { if (true || minecraftserver.getAllowNether()) { // CraftBukkit - multi-world should still allow teleport even if default vanilla nether disabled - if (this.vehicle == null && this.ap++ >= i) { - this.ap = i; - this.portalCooldown = this.ai(); + if (this.vehicle == null && this.ao++ >= i) { + this.ao = i; + this.portalCooldown = this.ah(); byte b0; if (this.world.worldProvider.dimension == -1) { @@ -225,15 +225,15 @@ public abstract class EntityMinecartAbstract extends Entity { this.b(b0); } - this.ao = false; + this.an = false; } } else { - if (this.ap > 0) { - this.ap -= 4; + if (this.ao > 0) { + this.ao -= 4; } - if (this.ap < 0) { - this.ap = 0; + if (this.ao < 0) { + this.ao = 0; } } @@ -289,7 +289,7 @@ public abstract class EntityMinecartAbstract extends Entity { this.b(d4); } - this.I(); + this.H(); this.pitch = 0.0F; double d6 = this.lastX - this.locX; double d7 = this.lastZ - this.locZ; @@ -329,7 +329,7 @@ public abstract class EntityMinecartAbstract extends Entity { for (int i1 = 0; i1 < list.size(); ++i1) { Entity entity = (Entity) list.get(i1); - if (entity != this.passenger && entity.S() && entity instanceof EntityMinecartAbstract) { + if (entity != this.passenger && entity.R() && entity instanceof EntityMinecartAbstract) { entity.collide(this); } } @@ -365,7 +365,7 @@ public abstract class EntityMinecartAbstract extends Entity { } if (this.onGround) { - // CraftBukkit start + // CraftBukkit start - replace magic numbers with our variables this.motX *= this.derailedX; this.motY *= this.derailedY; this.motZ *= this.derailedZ; @@ -374,7 +374,7 @@ public abstract class EntityMinecartAbstract extends Entity { this.move(this.motX, this.motY, this.motZ); if (!this.onGround) { - // CraftBukkit start + // CraftBukkit start - replace magic numbers with our variables this.motX *= this.flyingX; this.motY *= this.flyingY; this.motZ *= this.flyingZ; @@ -444,7 +444,7 @@ public abstract class EntityMinecartAbstract extends Entity { double d10; if (this.passenger != null && this.passenger instanceof EntityLiving) { - d7 = (double) ((EntityLiving) this.passenger).bf; + d7 = (double) ((EntityLiving) this.passenger).be; if (d7 > 0.0D) { d8 = -Math.sin((double) (this.passenger.yaw * 3.1415927F / 180.0F)); d9 = Math.cos((double) (this.passenger.yaw * 3.1415927F / 180.0F)); @@ -530,7 +530,7 @@ public abstract class EntityMinecartAbstract extends Entity { Vec3D vec3d1 = this.a(this.locX, this.locY, this.locZ); if (vec3d1 != null && vec3d != null) { - double d14 = (vec3d.d - vec3d1.d) * 0.05D; + double d14 = (vec3d.b - vec3d1.b) * 0.05D; d6 = Math.sqrt(this.motX * this.motX + this.motZ * this.motZ); if (d6 > 0.0D) { @@ -538,7 +538,7 @@ public abstract class EntityMinecartAbstract extends Entity { this.motZ = this.motZ / d6 * (d6 + d14); } - this.setPosition(this.locX, vec3d1.d, this.locZ); + this.setPosition(this.locX, vec3d1.b, this.locZ); } int i1 = MathHelper.floor(this.locX); @@ -575,7 +575,7 @@ public abstract class EntityMinecartAbstract extends Entity { } protected void i() { - if (this.passenger != null || !this.slowWhenEmpty) { // CraftBukkit + if (this.passenger != null || !this.slowWhenEmpty) { // CraftBukkit - add !this.slowWhenEmpty this.motX *= 0.996999979019165D; this.motY *= 0.0D; this.motZ *= 0.996999979019165D; @@ -645,7 +645,7 @@ public abstract class EntityMinecartAbstract extends Entity { d1 += 0.5D; } - return this.world.getVec3DPool().create(d0, d1, d2); + return Vec3D.a(d0, d1, d2); } else { return null; } @@ -714,15 +714,15 @@ public abstract class EntityMinecartAbstract extends Entity { d1 *= d3; d0 *= 0.10000000149011612D; d1 *= 0.10000000149011612D; - d0 *= (double) (1.0F - this.Z); - d1 *= (double) (1.0F - this.Z); + d0 *= (double) (1.0F - this.Y); + d1 *= (double) (1.0F - this.Y); d0 *= 0.5D; d1 *= 0.5D; if (entity instanceof EntityMinecartAbstract) { double d4 = entity.locX - this.locX; double d5 = entity.locZ - this.locZ; - Vec3D vec3d = this.world.getVec3DPool().create(d4, 0.0D, d5).a(); - Vec3D vec3d1 = this.world.getVec3DPool().create((double) MathHelper.cos(this.yaw * 3.1415927F / 180.0F), 0.0D, (double) MathHelper.sin(this.yaw * 3.1415927F / 180.0F)).a(); + Vec3D vec3d = Vec3D.a(d4, 0.0D, d5).a(); + Vec3D vec3d1 = Vec3D.a((double) MathHelper.cos(this.yaw * 3.1415927F / 180.0F), 0.0D, (double) MathHelper.sin(this.yaw * 3.1415927F / 180.0F)).a(); double d6 = Math.abs(vec3d.b(vec3d1)); if (d6 < 0.800000011920929D) { diff --git a/src/main/java/net/minecraft/server/EntityMinecartContainer.java b/src/main/java/net/minecraft/server/EntityMinecartContainer.java index 1d997e10f6..9f3f196b5c 100644 --- a/src/main/java/net/minecraft/server/EntityMinecartContainer.java +++ b/src/main/java/net/minecraft/server/EntityMinecartContainer.java @@ -129,7 +129,7 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp public void update() {} public boolean a(EntityHuman entityhuman) { - return this.dead ? false : entityhuman.e(this) <= 64.0D; + return this.dead ? false : entityhuman.f(this) <= 64.0D; } public void startOpen() {} diff --git a/src/main/java/net/minecraft/server/EntityMonster.java b/src/main/java/net/minecraft/server/EntityMonster.java index 88559240ed..6e02e2a5b8 100644 --- a/src/main/java/net/minecraft/server/EntityMonster.java +++ b/src/main/java/net/minecraft/server/EntityMonster.java @@ -10,11 +10,11 @@ public abstract class EntityMonster extends EntityCreature implements IMonster { } public void e() { - this.bb(); + this.ba(); float f = this.d(1.0F); if (f > 0.5F) { - this.aV += 2; + this.aU += 2; } super.e(); @@ -27,18 +27,18 @@ public abstract class EntityMonster extends EntityCreature implements IMonster { } } - protected String H() { + protected String G() { return "game.hostile.swim"; } - protected String O() { + protected String N() { return "game.hostile.swim.splash"; } protected Entity findTarget() { EntityHuman entityhuman = this.world.findNearbyVulnerablePlayer(this, 16.0D); - return entityhuman != null && this.o(entityhuman) ? entityhuman : null; + return entityhuman != null && this.p(entityhuman) ? entityhuman : null; } public boolean damageEntity(DamageSource damagesource, float f) { @@ -75,11 +75,11 @@ public abstract class EntityMonster extends EntityCreature implements IMonster { } } - protected String aT() { + protected String aS() { return "game.hostile.hurt"; } - protected String aU() { + protected String aT() { return "game.hostile.die"; } @@ -87,7 +87,7 @@ public abstract class EntityMonster extends EntityCreature implements IMonster { return i > 4 ? "game.hostile.hurt.fall.big" : "game.hostile.hurt.fall.small"; } - public boolean m(Entity entity) { + public boolean n(Entity entity) { float f = (float) this.getAttributeInstance(GenericAttributes.e).getValue(); int i = 0; @@ -124,7 +124,7 @@ public abstract class EntityMonster extends EntityCreature implements IMonster { protected void a(Entity entity, float f) { if (this.attackTicks <= 0 && f < 2.0F && entity.boundingBox.e > this.boundingBox.b && entity.boundingBox.b < this.boundingBox.e) { this.attackTicks = 20; - this.m(entity); + this.n(entity); } } @@ -142,7 +142,7 @@ public abstract class EntityMonster extends EntityCreature implements IMonster { } else { int l = this.world.getLightLevel(i, j, k); - if (this.world.O()) { + if (this.world.P()) { int i1 = this.world.j; this.world.j = 10; @@ -158,12 +158,12 @@ public abstract class EntityMonster extends EntityCreature implements IMonster { return this.world.difficulty != EnumDifficulty.PEACEFUL && this.j_() && super.canSpawn(); } - protected void aD() { - super.aD(); - this.bc().b(GenericAttributes.e); + protected void aC() { + super.aC(); + this.bb().b(GenericAttributes.e); } - protected boolean aG() { + protected boolean aF() { return true; } } diff --git a/src/main/java/net/minecraft/server/EntityMushroomCow.java b/src/main/java/net/minecraft/server/EntityMushroomCow.java index a5f84c91c8..b4e430611a 100644 --- a/src/main/java/net/minecraft/server/EntityMushroomCow.java +++ b/src/main/java/net/minecraft/server/EntityMushroomCow.java @@ -41,7 +41,7 @@ public class EntityMushroomCow extends EntityCow { entitycow.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, this.pitch); entitycow.setHealth(this.getHealth()); - entitycow.aN = this.aN; + entitycow.aM = this.aM; this.world.addEntity(entitycow); for (int i = 0; i < 5; ++i) { diff --git a/src/main/java/net/minecraft/server/EntityOcelot.java b/src/main/java/net/minecraft/server/EntityOcelot.java index 867abd75ee..e75de9c06e 100644 --- a/src/main/java/net/minecraft/server/EntityOcelot.java +++ b/src/main/java/net/minecraft/server/EntityOcelot.java @@ -27,7 +27,7 @@ public class EntityOcelot extends EntityTameableAnimal { this.datawatcher.a(18, Byte.valueOf((byte) 0)); } - public void bp() { + public void bo() { if (this.getControllerMove().a()) { double d0 = this.getControllerMove().b(); @@ -48,15 +48,15 @@ public class EntityOcelot extends EntityTameableAnimal { } protected boolean isTypeNotPersistent() { - return !this.isTamed(); // CraftBukkit + return !this.isTamed() /*&& this.ticksLived > 2400*/; // CraftBukkit } - public boolean bk() { + public boolean bj() { return true; } - protected void aD() { - super.aD(); + protected void aC() { + super.aC(); this.getAttributeInstance(GenericAttributes.a).setValue(10.0D); this.getAttributeInstance(GenericAttributes.d).setValue(0.30000001192092896D); } @@ -74,18 +74,18 @@ public class EntityOcelot extends EntityTameableAnimal { } protected String t() { - return this.isTamed() ? (this.cc() ? "mob.cat.purr" : (this.random.nextInt(4) == 0 ? "mob.cat.purreow" : "mob.cat.meow")) : ""; + return this.isTamed() ? (this.ce() ? "mob.cat.purr" : (this.random.nextInt(4) == 0 ? "mob.cat.purreow" : "mob.cat.meow")) : ""; + } + + protected String aS() { + return "mob.cat.hitt"; } protected String aT() { return "mob.cat.hitt"; } - protected String aU() { - return "mob.cat.hitt"; - } - - protected float bf() { + protected float be() { return 0.4F; } @@ -93,7 +93,7 @@ public class EntityOcelot extends EntityTameableAnimal { return Items.LEATHER; } - public boolean m(Entity entity) { + public boolean n(Entity entity) { return entity.damageEntity(DamageSource.mobAttack(this), 3.0F); } @@ -117,7 +117,7 @@ public class EntityOcelot extends EntityTameableAnimal { if (entityhuman.getName().equalsIgnoreCase(this.getOwnerName()) && !this.world.isStatic && !this.c(itemstack)) { this.bp.setSitting(!this.isSitting()); } - } else if (this.bq.f() && itemstack != null && itemstack.getItem() == Items.RAW_FISH && entityhuman.e(this) < 9.0D) { + } else if (this.bq.f() && itemstack != null && itemstack.getItem() == Items.RAW_FISH && entityhuman.f(this) < 9.0D) { if (!entityhuman.abilities.canInstantlyBuild) { --itemstack.count; } @@ -173,7 +173,7 @@ public class EntityOcelot extends EntityTameableAnimal { } else { EntityOcelot entityocelot = (EntityOcelot) entityanimal; - return !entityocelot.isTamed() ? false : this.cc() && entityocelot.cc(); + return !entityocelot.isTamed() ? false : this.ce() && entityocelot.ce(); } } diff --git a/src/main/java/net/minecraft/server/EntityPig.java b/src/main/java/net/minecraft/server/EntityPig.java index abb2a6f92d..7e249ad22f 100644 --- a/src/main/java/net/minecraft/server/EntityPig.java +++ b/src/main/java/net/minecraft/server/EntityPig.java @@ -25,22 +25,22 @@ public class EntityPig extends EntityAnimal { this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this)); } - public boolean bk() { + public boolean bj() { return true; } - protected void aD() { - super.aD(); + protected void aC() { + super.aC(); this.getAttributeInstance(GenericAttributes.a).setValue(10.0D); this.getAttributeInstance(GenericAttributes.d).setValue(0.25D); } - protected void bn() { - super.bn(); + protected void bm() { + super.bm(); } - public boolean bC() { - ItemStack itemstack = ((EntityHuman) this.passenger).be(); + public boolean bE() { + ItemStack itemstack = ((EntityHuman) this.passenger).bd(); return itemstack != null && itemstack.getItem() == Items.CARROT_STICK; } @@ -64,11 +64,11 @@ public class EntityPig extends EntityAnimal { return "mob.pig.say"; } - protected String aT() { + protected String aS() { return "mob.pig.say"; } - protected String aU() { + protected String aT() { return "mob.pig.death"; } @@ -157,7 +157,7 @@ public class EntityPig extends EntityAnimal { return itemstack != null && itemstack.getItem() == Items.CARROT; } - public PathfinderGoalPassengerCarrotStick bY() { + public PathfinderGoalPassengerCarrotStick ca() { return this.bp; } diff --git a/src/main/java/net/minecraft/server/EntityPigZombie.java b/src/main/java/net/minecraft/server/EntityPigZombie.java index 533d460556..38d1442224 100644 --- a/src/main/java/net/minecraft/server/EntityPigZombie.java +++ b/src/main/java/net/minecraft/server/EntityPigZombie.java @@ -21,14 +21,14 @@ public class EntityPigZombie extends EntityZombie { this.fireProof = true; } - protected void aD() { - super.aD(); + protected void aC() { + super.aC(); this.getAttributeInstance(bp).setValue(0.0D); this.getAttributeInstance(GenericAttributes.d).setValue(0.5D); this.getAttributeInstance(GenericAttributes.e).setValue(5.0D); } - protected boolean bk() { + protected boolean bj() { return false; } @@ -44,7 +44,7 @@ public class EntityPigZombie extends EntityZombie { this.bu = this.target; if (this.soundDelay > 0 && --this.soundDelay == 0) { - this.makeSound("mob.zombiepig.zpigangry", this.bf() * 2.0F, ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F) * 1.8F); + this.makeSound("mob.zombiepig.zpigangry", this.be() * 2.0F, ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F) * 1.8F); } super.h(); @@ -121,11 +121,11 @@ public class EntityPigZombie extends EntityZombie { return "mob.zombiepig.zpig"; } - protected String aT() { + protected String aS() { return "mob.zombiepig.zpighurt"; } - protected String aU() { + protected String aT() { return "mob.zombiepig.zpigdeath"; } @@ -170,7 +170,7 @@ public class EntityPigZombie extends EntityZombie { } // CraftBukkit end - protected void bA() { + protected void bC() { this.setEquipment(0, new ItemStack(Items.GOLD_SWORD)); } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java index 1dee8b2bed..d90ddb7109 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -29,7 +29,7 @@ import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; public class EntityPlayer extends EntityHuman implements ICrafting { - private static final Logger bM = LogManager.getLogger(); + private static final Logger bL = LogManager.getLogger(); private String locale = "en_US"; public PlayerConnection playerConnection; public final MinecraftServer server; @@ -37,7 +37,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public double d; public double e; public final List chunkCoordIntPairQueue = new LinkedList(); - public final List removeQueue = new LinkedList(); + public final List removeQueue = new LinkedList(); // CraftBukkit - private -> public private final ServerStatisticManager bO; private float bP = Float.MIN_VALUE; private float bQ = -1.0E8F; @@ -45,12 +45,11 @@ public class EntityPlayer extends EntityHuman implements ICrafting { private boolean bS = true; public int lastSentExp = -99999999; // CraftBukkit - private -> public public int invulnerableTicks = 60; // CraftBukkit - private -> public - private int bV; - private EnumChatVisibility bW; - private boolean bX = true; - private long bY = 0L; + private EnumChatVisibility bV; + private boolean bW = true; + private long bX = 0L; private int containerCounter; - public boolean h; + public boolean g; public int ping; public boolean viewingCredits; // CraftBukkit start @@ -68,7 +67,6 @@ public class EntityPlayer extends EntityHuman implements ICrafting { super(worldserver, gameprofile); playerinteractmanager.player = this; this.playerInteractManager = playerinteractmanager; - this.bV = minecraftserver.getPlayerList().o(); ChunkCoordinates chunkcoordinates = worldserver.getSpawn(); int i = chunkcoordinates.x; int j = chunkcoordinates.z; @@ -84,7 +82,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.server = minecraftserver; this.bO = minecraftserver.getPlayerList().i(this.getName()); - this.X = 0.0F; + this.W = 0.0F; this.height = 0.0F; this.setPositionRotation((double) i + 0.5D, (double) k, (double) j + 0.5D, 0.0F, 0.0F); @@ -230,7 +228,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } } - if (this.bY > 0L && this.server.aq() > 0 && MinecraftServer.ap() - this.bY > (long) (this.server.aq() * 1000 * 60)) { + if (this.bX > 0L && this.server.getIdleTimeout() > 0 && MinecraftServer.aq() - this.bX > (long) (this.server.getIdleTimeout() * 1000 * 60)) { this.playerConnection.disconnect("You have been idle for too long!"); } } @@ -259,8 +257,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.bS = this.foodData.e() == 0.0F; } - if (this.getHealth() + this.bs() != this.bP) { - this.bP = this.getHealth() + this.bs(); + if (this.getHealth() + this.br() != this.bP) { + this.bP = this.getHealth() + this.br(); // CraftBukkit - Update ALL the scores! this.world.getServer().getScoreboardManager().updateAllScoresForList(IScoreboardCriteria.f, this.getName(), com.google.common.collect.ImmutableList.of(this)); } @@ -276,11 +274,11 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.playerConnection.sendPacket(new PacketPlayOutExperience(this.exp, this.expTotal, this.expLevel)); } - if (this.ticksLived % 20 * 5 == 0 && !this.x().a(AchievementList.L)) { + if (this.ticksLived % 20 * 5 == 0 && !this.getStatisticManager().a(AchievementList.L)) { this.j(); } - // CraftBukkit start + // CraftBukkit start - initialize oldLevel and fire PlayerLevelChangeEvent if (this.oldLevel == -1) { this.oldLevel = this.expLevel; } @@ -304,14 +302,14 @@ public class EntityPlayer extends EntityHuman implements ICrafting { if (biomebase != null) { String s = biomebase.af; - AchievementSet achievementset = (AchievementSet) this.x().b((Statistic) AchievementList.L); // CraftBukkit - fix decompile error + AchievementSet achievementset = (AchievementSet) this.getStatisticManager().b((Statistic) AchievementList.L); // CraftBukkit - fix decompile error if (achievementset == null) { - achievementset = (AchievementSet) this.x().a(AchievementList.L, new AchievementSet()); + achievementset = (AchievementSet) this.getStatisticManager().a(AchievementList.L, new AchievementSet()); } achievementset.add(s); - if (this.x().b(AchievementList.L) && achievementset.size() == BiomeBase.n.size()) { + if (this.getStatisticManager().b(AchievementList.L) && achievementset.size() == BiomeBase.n.size()) { HashSet hashset = Sets.newHashSet(BiomeBase.n); Iterator iterator = achievementset.iterator(); @@ -340,7 +338,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } public void die(DamageSource damagesource) { - // CraftBukkit start + // CraftBukkit start - fire PlayerDeathEvent if (this.dead) { return; } @@ -362,7 +360,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } } - IChatBaseComponent chatmessage = this.aW().b(); + IChatBaseComponent chatmessage = this.aV().b(); String deathmessage = chatmessage.c(); org.bukkit.event.entity.PlayerDeathEvent event = CraftEventFactory.callPlayerDeathEvent(this, loot, deathmessage); @@ -401,20 +399,21 @@ public class EntityPlayer extends EntityHuman implements ICrafting { scoreboardscore.incrementScore(); } - EntityLiving entityliving = this.aX(); + EntityLiving entityliving = this.aW(); if (entityliving != null) { int i = EntityTypes.a(entityliving); - MonsterEggInfo monsteregginfo = (MonsterEggInfo) EntityTypes.a.get(Integer.valueOf(i)); + MonsterEggInfo monsteregginfo = (MonsterEggInfo) EntityTypes.eggInfo.get(Integer.valueOf(i)); if (monsteregginfo != null) { this.a(monsteregginfo.e, 1); } - entityliving.b(this, this.bb); + entityliving.b(this, this.ba); } this.a(StatisticList.v, 1); + this.aV().g(); } public boolean damageEntity(DamageSource damagesource, float f) { @@ -422,7 +421,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { return false; } else { // CraftBukkit - this.server.getPvP() -> this.world.pvpMode - boolean flag = this.server.V() && this.world.pvpMode && "fall".equals(damagesource.translationIndex); + boolean flag = this.server.W() && this.world.pvpMode && "fall".equals(damagesource.translationIndex); if (!flag && this.invulnerableTicks > 0 && damagesource != DamageSource.OUT_OF_WORLD) { return false; @@ -717,14 +716,16 @@ public class EntityPlayer extends EntityHuman implements ICrafting { MerchantRecipeList merchantrecipelist = imerchant.getOffers(this); if (merchantrecipelist != null) { - try { - PacketDataSerializer packetdataserializer = new PacketDataSerializer(Unpooled.buffer()); + PacketDataSerializer packetdataserializer = new PacketDataSerializer(Unpooled.buffer()); + try { packetdataserializer.writeInt(this.containerCounter); merchantrecipelist.a(packetdataserializer); this.playerConnection.sendPacket(new PacketPlayOutCustomPayload("MC|TrList", packetdataserializer)); } catch (Exception ioexception) { // CraftBukkit - IOException -> Exception - bM.error("Couldn\'t send trade list", ioexception); + bL.error("Couldn\'t send trade list", ioexception); + } finally { + packetdataserializer.release(); } } } @@ -748,7 +749,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public void a(Container container, int i, ItemStack itemstack) { if (!(container.getSlot(i) instanceof SlotResult)) { - if (!this.h) { + if (!this.g) { this.playerConnection.sendPacket(new PacketPlayOutSetSlot(container.windowId, i, itemstack)); } } @@ -779,7 +780,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } public void broadcastCarriedItem() { - if (!this.h) { + if (!this.g) { this.playerConnection.sendPacket(new PacketPlayOutSetSlot(-1, -1, this.inventory.getCarried())); } } @@ -792,14 +793,14 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public void a(float f, float f1, boolean flag, boolean flag1) { if (this.vehicle != null) { if (f >= -1.0F && f <= 1.0F) { - this.be = f; + this.bd = f; } if (f1 >= -1.0F && f1 <= 1.0F) { - this.bf = f1; + this.be = f1; } - this.bd = flag; + this.bc = flag; this.setSneaking(flag1); } } @@ -915,7 +916,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } public boolean a(int i, String s) { - return "seed".equals(s) && !this.server.V() ? true : (!"tell".equals(s) && !"help".equals(s) && !"me".equals(s) ? (this.server.getPlayerList().isOp(this.getName()) ? this.server.l() >= i : false) : true); + return "seed".equals(s) && !this.server.W() ? true : (!"tell".equals(s) && !"help".equals(s) && !"me".equals(s) ? (this.server.getPlayerList().isOp(this.getName()) ? this.server.l() >= i : false) : true); } public String s() { @@ -930,13 +931,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.locale = packetplayinsettings.c(); int i = 256 >> packetplayinsettings.d(); - if (i > 3 && i < 15) { - this.bV = i; + if (i > 3 && i < 20) { + ; } - this.bW = packetplayinsettings.e(); - this.bX = packetplayinsettings.f(); - if (this.server.L() && this.server.K().equals(this.getName())) { + this.bV = packetplayinsettings.e(); + this.bW = packetplayinsettings.f(); + if (this.server.M() && this.server.L().equals(this.getName())) { this.server.a(packetplayinsettings.g()); } @@ -944,10 +945,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } public EnumChatVisibility getChatFlags() { - return this.bW; + return this.bV; } - public void a(String s) { + public void setResourcePack(String s) { this.playerConnection.sendPacket(new PacketPlayOutCustomPayload("MC|RPack", s.getBytes(Charsets.UTF_8))); } @@ -955,15 +956,22 @@ public class EntityPlayer extends EntityHuman implements ICrafting { return new ChunkCoordinates(MathHelper.floor(this.locX), MathHelper.floor(this.locY + 0.5D), MathHelper.floor(this.locZ)); } - public void w() { - this.bY = MinecraftServer.ap(); + public void v() { + this.bX = MinecraftServer.aq(); } - public ServerStatisticManager x() { + public ServerStatisticManager getStatisticManager() { return this.bO; } - // CraftBukkit start + public void d(Entity entity) { + if (entity instanceof EntityHuman) { + this.playerConnection.sendPacket(new PacketPlayOutEntityDestroy(new int[] { entity.getId()})); + } else { + this.removeQueue.add(Integer.valueOf(entity.getId())); + } + } + // CraftBukkit start - Add per-player time and weather. public long timeOffset = 0; public boolean relativeTime = true; @@ -1029,7 +1037,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.expTotal = this.newTotalExp; this.exp = 0; this.deathTicks = 0; - this.aP(); // Should be remapped: removeAllEffects should be remapped to this. + this.removeAllEffects(); this.updateEffects = true; this.activeContainer = this.defaultContainer; this.killer = null; diff --git a/src/main/java/net/minecraft/server/EntityPotion.java b/src/main/java/net/minecraft/server/EntityPotion.java index 72873357d3..69db29f649 100644 --- a/src/main/java/net/minecraft/server/EntityPotion.java +++ b/src/main/java/net/minecraft/server/EntityPotion.java @@ -12,7 +12,7 @@ import org.bukkit.entity.LivingEntity; public class EntityPotion extends EntityProjectile { - public ItemStack item; // CraftBukkit private --> public + public ItemStack item; // CraftBukkit private -> public public EntityPotion(World world) { super(world); @@ -76,7 +76,7 @@ public class EntityPotion extends EntityProjectile { while (iterator.hasNext()) { EntityLiving entityliving = (EntityLiving) iterator.next(); - double d0 = this.e(entityliving); + double d0 = this.f(entityliving); if (d0 < 16.0D) { double d1 = 1.0D - Math.sqrt(d0) / 4.0D; diff --git a/src/main/java/net/minecraft/server/EntityProjectile.java b/src/main/java/net/minecraft/server/EntityProjectile.java index 329aecd855..31492f5c5a 100644 --- a/src/main/java/net/minecraft/server/EntityProjectile.java +++ b/src/main/java/net/minecraft/server/EntityProjectile.java @@ -13,7 +13,7 @@ public abstract class EntityProjectile extends Entity implements IProjectile { public EntityLiving shooter; // CraftBukkit - private -> public public String shooterName; // CraftBukkit - private -> public private int i; - private int j; + private int at; public EntityProjectile(World world) { super(world); @@ -80,9 +80,9 @@ public abstract class EntityProjectile extends Entity implements IProjectile { } public void h() { - this.T = this.locX; - this.U = this.locY; - this.V = this.locZ; + this.S = this.locX; + this.T = this.locY; + this.U = this.locZ; super.h(); if (this.shake > 0) { --this.shake; @@ -103,19 +103,19 @@ public abstract class EntityProjectile extends Entity implements IProjectile { this.motY *= (double) (this.random.nextFloat() * 0.2F); this.motZ *= (double) (this.random.nextFloat() * 0.2F); this.i = 0; - this.j = 0; + this.at = 0; } else { - ++this.j; + ++this.at; } - Vec3D vec3d = this.world.getVec3DPool().create(this.locX, this.locY, this.locZ); - Vec3D vec3d1 = this.world.getVec3DPool().create(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ); + Vec3D vec3d = Vec3D.a(this.locX, this.locY, this.locZ); + Vec3D vec3d1 = Vec3D.a(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ); MovingObjectPosition movingobjectposition = this.world.a(vec3d, vec3d1); - vec3d = this.world.getVec3DPool().create(this.locX, this.locY, this.locZ); - vec3d1 = this.world.getVec3DPool().create(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ); + vec3d = Vec3D.a(this.locX, this.locY, this.locZ); + vec3d1 = Vec3D.a(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ); if (movingobjectposition != null) { - vec3d1 = this.world.getVec3DPool().create(movingobjectposition.pos.c, movingobjectposition.pos.d, movingobjectposition.pos.e); + vec3d1 = Vec3D.a(movingobjectposition.pos.a, movingobjectposition.pos.b, movingobjectposition.pos.c); } if (!this.world.isStatic) { @@ -127,7 +127,7 @@ public abstract class EntityProjectile extends Entity implements IProjectile { for (int i = 0; i < list.size(); ++i) { Entity entity1 = (Entity) list.get(i); - if (entity1.R() && (entity1 != entityliving || this.j >= 5)) { + if (entity1.Q() && (entity1 != entityliving || this.at >= 5)) { float f = 0.3F; AxisAlignedBB axisalignedbb = entity1.boundingBox.grow((double) f, (double) f, (double) f); MovingObjectPosition movingobjectposition1 = axisalignedbb.a(vec3d, vec3d1); @@ -150,7 +150,7 @@ public abstract class EntityProjectile extends Entity implements IProjectile { if (movingobjectposition != null) { if (movingobjectposition.type == EnumMovingObjectType.BLOCK && this.world.getType(movingobjectposition.b, movingobjectposition.c, movingobjectposition.d) == Blocks.PORTAL) { - this.ah(); + this.ag(); } else { this.a(movingobjectposition); // CraftBukkit start @@ -189,7 +189,7 @@ public abstract class EntityProjectile extends Entity implements IProjectile { float f2 = 0.99F; float f3 = this.i(); - if (this.M()) { + if (this.L()) { for (int j = 0; j < 4; ++j) { float f4 = 0.25F; diff --git a/src/main/java/net/minecraft/server/EntitySheep.java b/src/main/java/net/minecraft/server/EntitySheep.java index 9a1a3025ab..47e60923b7 100644 --- a/src/main/java/net/minecraft/server/EntitySheep.java +++ b/src/main/java/net/minecraft/server/EntitySheep.java @@ -32,13 +32,13 @@ public class EntitySheep extends EntityAnimal { this.bq.resultInventory = new InventoryCraftResult(); // CraftBukkit - add result slot for event } - protected boolean bk() { + protected boolean bj() { return true; } - protected void bn() { + protected void bm() { this.br = this.bs.f(); - super.bn(); + super.bm(); } public void e() { @@ -49,8 +49,8 @@ public class EntitySheep extends EntityAnimal { super.e(); } - protected void aD() { - super.aD(); + protected void aC() { + super.aC(); this.getAttributeInstance(GenericAttributes.a).setValue(8.0D); this.getAttributeInstance(GenericAttributes.d).setValue(0.23000000417232513D); } @@ -125,11 +125,11 @@ public class EntitySheep extends EntityAnimal { return "mob.sheep.say"; } - protected String aT() { + protected String aS() { return "mob.sheep.say"; } - protected String aU() { + protected String aT() { return "mob.sheep.say"; } diff --git a/src/main/java/net/minecraft/server/EntitySilverfish.java b/src/main/java/net/minecraft/server/EntitySilverfish.java index 88a90661e0..821e7a35c8 100644 --- a/src/main/java/net/minecraft/server/EntitySilverfish.java +++ b/src/main/java/net/minecraft/server/EntitySilverfish.java @@ -13,8 +13,8 @@ public class EntitySilverfish extends EntityMonster { this.a(0.3F, 0.7F); } - protected void aD() { - super.aD(); + protected void aC() { + super.aC(); this.getAttributeInstance(GenericAttributes.a).setValue(8.0D); this.getAttributeInstance(GenericAttributes.d).setValue(0.6000000238418579D); this.getAttributeInstance(GenericAttributes.e).setValue(1.0D); @@ -34,11 +34,11 @@ public class EntitySilverfish extends EntityMonster { return "mob.silverfish.say"; } - protected String aT() { + protected String aS() { return "mob.silverfish.hit"; } - protected String aU() { + protected String aT() { return "mob.silverfish.kill"; } @@ -57,7 +57,7 @@ public class EntitySilverfish extends EntityMonster { protected void a(Entity entity, float f) { if (this.attackTicks <= 0 && f < 1.2F && entity.boundingBox.e > this.boundingBox.b && entity.boundingBox.b < this.boundingBox.e) { this.attackTicks = 20; - this.m(entity); + this.n(entity); } } @@ -70,12 +70,12 @@ public class EntitySilverfish extends EntityMonster { } public void h() { - this.aN = this.yaw; + this.aM = this.yaw; super.h(); } - protected void bq() { - super.bq(); + protected void bp() { + super.bp(); if (!this.world.isStatic) { int i; int j; @@ -120,7 +120,7 @@ public class EntitySilverfish extends EntityMonster { } } - if (this.target == null && !this.bQ()) { + if (this.target == null && !this.bS()) { i = MathHelper.floor(this.locX); j = MathHelper.floor(this.locY + 0.5D); k = MathHelper.floor(this.locZ); @@ -139,9 +139,9 @@ public class EntitySilverfish extends EntityMonster { this.s(); this.die(); } else { - this.bO(); + this.bQ(); } - } else if (this.target != null && !this.bQ()) { + } else if (this.target != null && !this.bS()) { this.target = null; } } diff --git a/src/main/java/net/minecraft/server/EntitySkeleton.java b/src/main/java/net/minecraft/server/EntitySkeleton.java index da5fd8f98c..cb25df17a5 100644 --- a/src/main/java/net/minecraft/server/EntitySkeleton.java +++ b/src/main/java/net/minecraft/server/EntitySkeleton.java @@ -20,12 +20,12 @@ public class EntitySkeleton extends EntityMonster implements IRangedEntity { this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this, false)); this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget(this, EntityHuman.class, 0, true)); if (world != null && !world.isStatic) { - this.bX(); + this.bZ(); } } - protected void aD() { - super.aD(); + protected void aC() { + super.aC(); this.getAttributeInstance(GenericAttributes.d).setValue(0.25D); } @@ -34,7 +34,7 @@ public class EntitySkeleton extends EntityMonster implements IRangedEntity { this.datawatcher.a(13, new Byte((byte) 0)); } - public boolean bk() { + public boolean bj() { return true; } @@ -42,11 +42,11 @@ public class EntitySkeleton extends EntityMonster implements IRangedEntity { return "mob.skeleton.say"; } - protected String aT() { + protected String aS() { return "mob.skeleton.hurt"; } - protected String aU() { + protected String aT() { return "mob.skeleton.death"; } @@ -54,8 +54,8 @@ public class EntitySkeleton extends EntityMonster implements IRangedEntity { this.makeSound("mob.skeleton.step", 0.15F, 1.0F); } - public boolean m(Entity entity) { - if (super.m(entity)) { + public boolean n(Entity entity) { + if (super.n(entity)) { if (this.getSkeletonType() == 1 && entity instanceof EntityLiving) { ((EntityLiving) entity).addEffect(new MobEffect(MobEffectList.WITHER.id, 200)); } @@ -71,7 +71,7 @@ public class EntitySkeleton extends EntityMonster implements IRangedEntity { } public void e() { - if (this.world.v() && !this.world.isStatic) { + if (this.world.w() && !this.world.isStatic) { float f = this.d(1.0F); if (f > 0.5F && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.world.i(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ))) { @@ -110,12 +110,12 @@ public class EntitySkeleton extends EntityMonster implements IRangedEntity { super.e(); } - public void ab() { - super.ab(); + public void aa() { + super.aa(); if (this.vehicle instanceof EntityCreature) { EntityCreature entitycreature = (EntityCreature) this.vehicle; - this.aN = entitycreature.aN; + this.aM = entitycreature.aM; } } @@ -182,22 +182,22 @@ public class EntitySkeleton extends EntityMonster implements IRangedEntity { return null; // CraftBukkit } - protected void bA() { - super.bA(); + protected void bC() { + super.bC(); this.setEquipment(0, new ItemStack(Items.BOW)); } public GroupDataEntity a(GroupDataEntity groupdataentity) { groupdataentity = super.a(groupdataentity); - if (this.world.worldProvider instanceof WorldProviderHell && this.aI().nextInt(5) > 0) { + if (this.world.worldProvider instanceof WorldProviderHell && this.aH().nextInt(5) > 0) { this.goalSelector.a(4, this.bq); this.setSkeletonType(1); this.setEquipment(0, new ItemStack(Items.STONE_SWORD)); this.getAttributeInstance(GenericAttributes.e).setValue(4.0D); } else { this.goalSelector.a(4, this.bp); - this.bA(); - this.bB(); + this.bC(); + this.bD(); } this.h(this.random.nextFloat() < 0.55F * this.world.b(this.locX, this.locY, this.locZ)); @@ -213,10 +213,10 @@ public class EntitySkeleton extends EntityMonster implements IRangedEntity { return groupdataentity; } - public void bX() { + public void bZ() { this.goalSelector.a((PathfinderGoal) this.bq); this.goalSelector.a((PathfinderGoal) this.bp); - ItemStack itemstack = this.be(); + ItemStack itemstack = this.bd(); if (itemstack != null && itemstack.getItem() == Items.BOW) { this.goalSelector.a(4, this.bp); @@ -227,8 +227,8 @@ public class EntitySkeleton extends EntityMonster implements IRangedEntity { public void a(EntityLiving entityliving, float f) { EntityArrow entityarrow = new EntityArrow(this.world, this, entityliving, 1.6F, (float) (14 - this.world.difficulty.a() * 4)); - int i = EnchantmentManager.getEnchantmentLevel(Enchantment.ARROW_DAMAGE.id, this.be()); - int j = EnchantmentManager.getEnchantmentLevel(Enchantment.ARROW_KNOCKBACK.id, this.be()); + int i = EnchantmentManager.getEnchantmentLevel(Enchantment.ARROW_DAMAGE.id, this.bd()); + int j = EnchantmentManager.getEnchantmentLevel(Enchantment.ARROW_KNOCKBACK.id, this.bd()); entityarrow.b((double) (f * 2.0F) + this.random.nextGaussian() * 0.25D + (double) ((float) this.world.difficulty.a() * 0.11F)); if (i > 0) { @@ -236,15 +236,15 @@ public class EntitySkeleton extends EntityMonster implements IRangedEntity { } if (j > 0) { - entityarrow.a(j); + entityarrow.setKnockbackStrength(j); } - if (EnchantmentManager.getEnchantmentLevel(Enchantment.ARROW_FIRE.id, this.be()) > 0 || this.getSkeletonType() == 1) { + if (EnchantmentManager.getEnchantmentLevel(Enchantment.ARROW_FIRE.id, this.bd()) > 0 || this.getSkeletonType() == 1) { entityarrow.setOnFire(100); } // CraftBukkit start - org.bukkit.event.entity.EntityShootBowEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityShootBowEvent(this, this.be(), entityarrow, 0.8F); + org.bukkit.event.entity.EntityShootBowEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityShootBowEvent(this, this.bd(), entityarrow, 0.8F); if (event.isCancelled()) { event.getProjectile().remove(); return; @@ -255,7 +255,7 @@ public class EntitySkeleton extends EntityMonster implements IRangedEntity { } // CraftBukkit end - this.makeSound("random.bow", 1.0F, 1.0F / (this.aI().nextFloat() * 0.4F + 0.8F)); + this.makeSound("random.bow", 1.0F, 1.0F / (this.aH().nextFloat() * 0.4F + 0.8F)); // this.world.addEntity(entityarrow); // CraftBukkit - moved up } @@ -281,7 +281,7 @@ public class EntitySkeleton extends EntityMonster implements IRangedEntity { this.setSkeletonType(b0); } - this.bX(); + this.bZ(); } public void b(NBTTagCompound nbttagcompound) { @@ -292,11 +292,11 @@ public class EntitySkeleton extends EntityMonster implements IRangedEntity { public void setEquipment(int i, ItemStack itemstack) { super.setEquipment(i, itemstack); if (!this.world.isStatic && i == 0) { - this.bX(); + this.bZ(); } } - public double ad() { - return super.ad() - 0.5D; + public double ac() { + return super.ac() - 0.5D; } } diff --git a/src/main/java/net/minecraft/server/EntitySlime.java b/src/main/java/net/minecraft/server/EntitySlime.java index 87dcb159ff..c05d86c61c 100644 --- a/src/main/java/net/minecraft/server/EntitySlime.java +++ b/src/main/java/net/minecraft/server/EntitySlime.java @@ -11,7 +11,7 @@ public class EntitySlime extends EntityInsentient implements IMonster { public float h; public float i; - public float j; + public float bm; private int jumpDelay; private Entity lastTarget; // CraftBukkit @@ -50,14 +50,20 @@ public class EntitySlime extends EntityInsentient implements IMonster { public void a(NBTTagCompound nbttagcompound) { super.a(nbttagcompound); - this.setSize(nbttagcompound.getInt("Size") + 1); + int i = nbttagcompound.getInt("Size"); + + if (i < 0) { + i = 0; + } + + this.setSize(i + 1); } - protected String bN() { + protected String bP() { return "slime"; } - protected String bT() { + protected String bV() { return "mob.slime." + (this.getSize() > 1 ? "big" : "small"); } @@ -67,7 +73,7 @@ public class EntitySlime extends EntityInsentient implements IMonster { } this.i += (this.h - this.i) * 0.5F; - this.j = this.i; + this.bm = this.i; boolean flag = this.onGround; super.h(); @@ -82,11 +88,11 @@ public class EntitySlime extends EntityInsentient implements IMonster { float f2 = MathHelper.sin(f) * (float) i * 0.5F * f1; float f3 = MathHelper.cos(f) * (float) i * 0.5F * f1; - this.world.addParticle(this.bN(), this.locX + (double) f2, this.boundingBox.b, this.locZ + (double) f3, 0.0D, 0.0D, 0.0D); + this.world.addParticle(this.bP(), this.locX + (double) f2, this.boundingBox.b, this.locZ + (double) f3, 0.0D, 0.0D, 0.0D); } - if (this.bU()) { - this.makeSound(this.bT(), this.bf(), ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F) / 0.8F); + if (this.bW()) { + this.makeSound(this.bV(), this.be(), ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F) / 0.8F); } this.h = -0.5F; @@ -94,14 +100,14 @@ public class EntitySlime extends EntityInsentient implements IMonster { this.h = 1.0F; } - this.bQ(); + this.bS(); if (this.world.isStatic) { i = this.getSize(); this.a(0.6F * (float) i, 0.6F * (float) i); } } - protected void bq() { + protected void bp() { this.w(); // CraftBukkit start Entity entityhuman = this.world.findNearbyVulnerablePlayer(this, 16.0D); // EntityHuman -> Entity @@ -125,35 +131,35 @@ public class EntitySlime extends EntityInsentient implements IMonster { } if (this.onGround && this.jumpDelay-- <= 0) { - this.jumpDelay = this.bP(); + this.jumpDelay = this.bR(); if (entityhuman != null) { this.jumpDelay /= 3; } - this.bd = true; - if (this.bW()) { - this.makeSound(this.bT(), this.bf(), ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F) * 0.8F); + this.bc = true; + if (this.bY()) { + this.makeSound(this.bV(), this.be(), ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F) * 0.8F); } - this.be = 1.0F - this.random.nextFloat() * 2.0F; - this.bf = (float) (1 * this.getSize()); + this.bd = 1.0F - this.random.nextFloat() * 2.0F; + this.be = (float) (1 * this.getSize()); } else { - this.bd = false; + this.bc = false; if (this.onGround) { - this.be = this.bf = 0.0F; + this.bd = this.bf = 0.0F; } } } - protected void bQ() { + protected void bS() { this.h *= 0.6F; } - protected int bP() { + protected int bR() { return this.random.nextInt(20) + 10; } - protected EntitySlime bO() { + protected EntitySlime bQ() { return new EntitySlime(this.world); } @@ -178,7 +184,7 @@ public class EntitySlime extends EntityInsentient implements IMonster { for (int k = 0; k < j; ++k) { float f = ((float) (k % 2) - 0.5F) * (float) i / 4.0F; float f1 = ((float) (k / 2) - 0.5F) * (float) i / 4.0F; - EntitySlime entityslime = this.bO(); + EntitySlime entityslime = this.bQ(); 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); @@ -190,28 +196,28 @@ public class EntitySlime extends EntityInsentient implements IMonster { } public void b_(EntityHuman entityhuman) { - if (this.bR()) { + if (this.bT()) { int i = this.getSize(); - if (this.o(entityhuman) && this.e(entityhuman) < 0.6D * (double) i * 0.6D * (double) i && entityhuman.damageEntity(DamageSource.mobAttack(this), (float) this.bS())) { + if (this.p(entityhuman) && this.f(entityhuman) < 0.6D * (double) i * 0.6D * (double) i && entityhuman.damageEntity(DamageSource.mobAttack(this), (float) this.bU())) { this.makeSound("mob.attack", 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F); } } } - protected boolean bR() { + protected boolean bT() { return this.getSize() > 1; } - protected int bS() { + protected int bU() { return this.getSize(); } - protected String aT() { + protected String aS() { return "mob.slime." + (this.getSize() > 1 ? "big" : "small"); } - protected String aU() { + protected String aT() { return "mob.slime." + (this.getSize() > 1 ? "big" : "small"); } @@ -228,7 +234,7 @@ public class EntitySlime extends EntityInsentient implements IMonster { if (this.getSize() == 1 || this.world.difficulty != EnumDifficulty.PEACEFUL) { BiomeBase biomebase = this.world.getBiome(MathHelper.floor(this.locX), MathHelper.floor(this.locZ)); - if (biomebase == BiomeBase.SWAMPLAND && this.locY > 50.0D && this.locY < 70.0D && this.random.nextFloat() < 0.5F && this.random.nextFloat() < this.world.x() && this.world.getLightLevel(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ)) <= this.random.nextInt(8)) { + if (biomebase == BiomeBase.SWAMPLAND && this.locY > 50.0D && this.locY < 70.0D && this.random.nextFloat() < 0.5F && this.random.nextFloat() < this.world.y() && this.world.getLightLevel(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ)) <= this.random.nextInt(8)) { return super.canSpawn(); } @@ -241,19 +247,19 @@ public class EntitySlime extends EntityInsentient implements IMonster { } } - protected float bf() { + protected float be() { return 0.4F * (float) this.getSize(); } - public int x() { + public int bv() { return 0; } - protected boolean bW() { + protected boolean bY() { return this.getSize() > 0; } - protected boolean bU() { + protected boolean bW() { return this.getSize() > 2; } } diff --git a/src/main/java/net/minecraft/server/EntitySmallFireball.java b/src/main/java/net/minecraft/server/EntitySmallFireball.java index 4d61eec2c1..800b095f2b 100644 --- a/src/main/java/net/minecraft/server/EntitySmallFireball.java +++ b/src/main/java/net/minecraft/server/EntitySmallFireball.java @@ -75,7 +75,7 @@ public class EntitySmallFireball extends EntityFireball { } } - public boolean R() { + public boolean Q() { return false; } diff --git a/src/main/java/net/minecraft/server/EntitySnowman.java b/src/main/java/net/minecraft/server/EntitySnowman.java index 3628bf2f06..b3020b75db 100644 --- a/src/main/java/net/minecraft/server/EntitySnowman.java +++ b/src/main/java/net/minecraft/server/EntitySnowman.java @@ -19,12 +19,12 @@ public class EntitySnowman extends EntityGolem implements IRangedEntity { this.targetSelector.a(1, new PathfinderGoalNearestAttackableTarget(this, EntityInsentient.class, 0, true, false, IMonster.a)); } - public boolean bk() { + public boolean bj() { return true; } - protected void aD() { - super.aD(); + protected void aC() { + super.aC(); this.getAttributeInstance(GenericAttributes.a).setValue(4.0D); this.getAttributeInstance(GenericAttributes.d).setValue(0.20000000298023224D); } @@ -35,7 +35,7 @@ public class EntitySnowman extends EntityGolem implements IRangedEntity { int j = MathHelper.floor(this.locY); int k = MathHelper.floor(this.locZ); - if (this.L()) { + if (this.K()) { this.damageEntity(DamageSource.DROWN, 1.0F); } @@ -88,7 +88,7 @@ public class EntitySnowman extends EntityGolem implements IRangedEntity { float f1 = MathHelper.sqrt(d0 * d0 + d2 * d2) * 0.2F; entitysnowball.shoot(d0, d1 + (double) f1, d2, 1.6F, 12.0F); - this.makeSound("random.bow", 1.0F, 1.0F / (this.aI().nextFloat() * 0.4F + 0.8F)); + this.makeSound("random.bow", 1.0F, 1.0F / (this.aH().nextFloat() * 0.4F + 0.8F)); this.world.addEntity(entitysnowball); } } diff --git a/src/main/java/net/minecraft/server/EntitySpider.java b/src/main/java/net/minecraft/server/EntitySpider.java index e93d3f7071..b151e737fd 100644 --- a/src/main/java/net/minecraft/server/EntitySpider.java +++ b/src/main/java/net/minecraft/server/EntitySpider.java @@ -24,8 +24,8 @@ public class EntitySpider extends EntityMonster { } } - protected void aD() { - super.aD(); + protected void aC() { + super.aC(); this.getAttributeInstance(GenericAttributes.a).setValue(16.0D); this.getAttributeInstance(GenericAttributes.d).setValue(0.800000011920929D); } @@ -46,11 +46,11 @@ public class EntitySpider extends EntityMonster { return "mob.spider.say"; } - protected String aT() { + protected String aS() { return "mob.spider.say"; } - protected String aU() { + protected String aT() { return "mob.spider.death"; } @@ -119,10 +119,10 @@ public class EntitySpider extends EntityMonster { } public boolean h_() { - return this.bX(); + return this.bZ(); } - public void as() {} + public void ar() {} public EnumMonsterType getMonsterType() { return EnumMonsterType.ARTHROPOD; @@ -132,7 +132,7 @@ public class EntitySpider extends EntityMonster { return mobeffect.getEffectId() == MobEffectList.POISON.id ? false : super.d(mobeffect); } - public boolean bX() { + public boolean bZ() { return (this.datawatcher.getByte(16) & 1) != 0; } diff --git a/src/main/java/net/minecraft/server/EntitySquid.java b/src/main/java/net/minecraft/server/EntitySquid.java index bc6e1f4abc..f47ef64310 100644 --- a/src/main/java/net/minecraft/server/EntitySquid.java +++ b/src/main/java/net/minecraft/server/EntitySquid.java @@ -25,8 +25,8 @@ public class EntitySquid extends EntityWaterAnimal { this.by = 1.0F / (this.random.nextFloat() + 1.0F) * 0.2F; } - protected void aD() { - super.aD(); + protected void aC() { + super.aC(); this.getAttributeInstance(GenericAttributes.a).setValue(10.0D); } @@ -34,15 +34,15 @@ public class EntitySquid extends EntityWaterAnimal { return null; } + protected String aS() { + return null; + } + protected String aT() { return null; } - protected String aU() { - return null; - } - - protected float bf() { + protected float be() { return 0.4F; } @@ -68,7 +68,7 @@ public class EntitySquid extends EntityWaterAnimal { } /* CraftBukkit start - Delegate to Entity to use existing inWater value - public boolean M() { + public boolean L() { return this.world.a(this.boundingBox.grow(0.0D, -0.6000000238418579D, 0.0D), Material.WATER, (Entity) this); } // CraftBukkit end */ @@ -87,7 +87,7 @@ public class EntitySquid extends EntityWaterAnimal { } } - if (this.M()) { + if (this.L()) { float f; if (this.bt < 3.1415927F) { @@ -113,8 +113,8 @@ public class EntitySquid extends EntityWaterAnimal { f = MathHelper.sqrt(this.motX * this.motX + this.motZ * this.motZ); // CraftBukkit - Math -> TrigMath - this.aN += (-((float) TrigMath.atan2(this.motX, this.motZ)) * 180.0F / 3.1415927F - this.aN) * 0.1F; - this.yaw = this.aN; + this.aM += (-((float) TrigMath.atan2(this.motX, this.motZ)) * 180.0F / 3.1415927F - this.aM) * 0.1F; + this.yaw = this.aM; this.br += 3.1415927F * this.bz * 1.5F; // CraftBukkit - Math -> TrigMath this.bp += (-((float) TrigMath.atan2((double) f, this.motY)) * 180.0F / 3.1415927F - this.bp) * 0.1F; @@ -135,9 +135,9 @@ public class EntitySquid extends EntityWaterAnimal { this.move(this.motX, this.motY, this.motZ); } - protected void bq() { - ++this.aV; - if (this.aV > 100) { + protected void bp() { + ++this.aU; + if (this.aU > 100) { this.bA = this.bB = this.bC = 0.0F; } else if (this.random.nextInt(50) == 0 || !this.inWater || this.bA == 0.0F && this.bB == 0.0F && this.bC == 0.0F) { float f = this.random.nextFloat() * 3.1415927F * 2.0F; diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java index 92f00427e3..a442cb10a7 100644 --- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java +++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java @@ -6,12 +6,12 @@ public class EntityTNTPrimed extends Entity { public int fuseTicks; private EntityLiving source; - public float yield = 4; // CraftBukkit - public boolean isIncendiary = false; // CraftBukkit + public float yield = 4; // CraftBukkit - add field + public boolean isIncendiary = false; // CraftBukkit - add field public EntityTNTPrimed(World world) { super(world); - this.l = true; + this.k = true; this.a(0.98F, 0.98F); this.height = this.length / 2.0F; } @@ -37,7 +37,7 @@ public class EntityTNTPrimed extends Entity { return false; } - public boolean R() { + public boolean Q() { return !this.dead; } diff --git a/src/main/java/net/minecraft/server/EntityThrownExpBottle.java b/src/main/java/net/minecraft/server/EntityThrownExpBottle.java index a21387df2f..68625a4858 100644 --- a/src/main/java/net/minecraft/server/EntityThrownExpBottle.java +++ b/src/main/java/net/minecraft/server/EntityThrownExpBottle.java @@ -28,7 +28,7 @@ public class EntityThrownExpBottle extends EntityProjectile { protected void a(MovingObjectPosition movingobjectposition) { if (!this.world.isStatic) { - // CraftBukkit moved after event + // CraftBukkit - moved to after event // this.world.triggerEffect(2002, (int) Math.round(this.locX), (int) Math.round(this.locY), (int) Math.round(this.locZ), 0); int i = 3 + this.world.random.nextInt(5) + this.world.random.nextInt(5); diff --git a/src/main/java/net/minecraft/server/EntityTracker.java b/src/main/java/net/minecraft/server/EntityTracker.java index 7447e42586..af440b9ce2 100644 --- a/src/main/java/net/minecraft/server/EntityTracker.java +++ b/src/main/java/net/minecraft/server/EntityTracker.java @@ -203,7 +203,7 @@ public class EntityTracker { while (iterator.hasNext()) { EntityTrackerEntry entitytrackerentry = (EntityTrackerEntry) iterator.next(); - if (entitytrackerentry.tracker != entityplayer && entitytrackerentry.tracker.ai == chunk.locX && entitytrackerentry.tracker.ak == chunk.locZ) { + if (entitytrackerentry.tracker != entityplayer && entitytrackerentry.tracker.ah == chunk.locX && entitytrackerentry.tracker.aj == chunk.locZ) { entitytrackerentry.updatePlayer(entityplayer); } } diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java index 9f818cf04f..c148c4da90 100644 --- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java +++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java @@ -100,15 +100,15 @@ public class EntityTrackerEntry { } this.b(); - } else if (this.m % this.c == 0 || this.tracker.am || this.tracker.getDataWatcher().a()) { + } else if (this.m % this.c == 0 || this.tracker.al || this.tracker.getDataWatcher().a()) { int i; int j; if (this.tracker.vehicle == null) { ++this.v; - i = this.tracker.at.a(this.tracker.locX); + i = this.tracker.as.a(this.tracker.locX); j = MathHelper.floor(this.tracker.locY * 32.0D); - int k = this.tracker.at.a(this.tracker.locZ); + int k = this.tracker.as.a(this.tracker.locZ); int l = MathHelper.d(this.tracker.yaw * 256.0F / 360.0F); int i1 = MathHelper.d(this.tracker.pitch * 256.0F / 360.0F); int j1 = i - this.xLoc; @@ -196,9 +196,9 @@ public class EntityTrackerEntry { this.xRot = j; } - this.xLoc = this.tracker.at.a(this.tracker.locX); + this.xLoc = this.tracker.as.a(this.tracker.locX); this.yLoc = MathHelper.floor(this.tracker.locY * 32.0D); - this.zLoc = this.tracker.at.a(this.tracker.locZ); + this.zLoc = this.tracker.as.a(this.tracker.locZ); this.b(); this.x = true; } @@ -209,7 +209,7 @@ public class EntityTrackerEntry { this.i = i; } - this.tracker.am = false; + this.tracker.al = false; } ++this.m; @@ -248,7 +248,7 @@ public class EntityTrackerEntry { } if (this.tracker instanceof EntityLiving) { - AttributeMapServer attributemapserver = (AttributeMapServer) ((EntityLiving) this.tracker).bc(); + AttributeMapServer attributemapserver = (AttributeMapServer) ((EntityLiving) this.tracker).bb(); Set set = attributemapserver.b(); if (!set.isEmpty()) { @@ -287,13 +287,13 @@ public class EntityTrackerEntry { while (iterator.hasNext()) { EntityPlayer entityplayer = (EntityPlayer) iterator.next(); - entityplayer.removeQueue.add(Integer.valueOf(this.tracker.getId())); + entityplayer.d(this.tracker); } } public void a(EntityPlayer entityplayer) { if (this.trackedPlayers.contains(entityplayer)) { - entityplayer.removeQueue.add(Integer.valueOf(this.tracker.getId())); + entityplayer.d(this.tracker); this.trackedPlayers.remove(entityplayer); } } @@ -304,8 +304,8 @@ public class EntityTrackerEntry { double d1 = entityplayer.locZ - (double) (this.zLoc / 32); if (d0 >= (double) (-this.b) && d0 <= (double) this.b && d1 >= (double) (-this.b) && d1 <= (double) this.b) { - if (!this.trackedPlayers.contains(entityplayer) && (this.d(entityplayer) || this.tracker.o)) { - // CraftBukkit start + if (!this.trackedPlayers.contains(entityplayer) && (this.d(entityplayer) || this.tracker.n)) { + // CraftBukkit start - respect vanish API if (this.tracker instanceof EntityPlayer) { Player player = ((EntityPlayer) this.tracker).getBukkitEntity(); if (!entityplayer.getBukkitEntity().canSee(player)) { @@ -325,7 +325,7 @@ public class EntityTrackerEntry { } if (this.tracker instanceof EntityLiving) { - AttributeMapServer attributemapserver = (AttributeMapServer) ((EntityLiving) this.tracker).bc(); + AttributeMapServer attributemapserver = (AttributeMapServer) ((EntityLiving) this.tracker).bb(); Collection collection = attributemapserver.c(); // CraftBukkit start - If sending own attributes send scaled health instead of current maximum health @@ -378,7 +378,7 @@ public class EntityTrackerEntry { } // CraftBukkit start - Fix for nonsensical head yaw - this.i = MathHelper.d(this.tracker.getHeadRotation() * 256.0F / 360.0F); // tracker.ao() should be getHeadRotation + this.i = MathHelper.d(this.tracker.getHeadRotation() * 256.0F / 360.0F); this.broadcast(new PacketPlayOutEntityHeadRotation(this.tracker, (byte) i)); // CraftBukkit end @@ -395,13 +395,13 @@ public class EntityTrackerEntry { } } else if (this.trackedPlayers.contains(entityplayer)) { this.trackedPlayers.remove(entityplayer); - entityplayer.removeQueue.add(Integer.valueOf(this.tracker.getId())); + entityplayer.d(this.tracker); } } } private boolean d(EntityPlayer entityplayer) { - return entityplayer.r().getPlayerChunkMap().a(entityplayer, this.tracker.ai, this.tracker.ak); + return entityplayer.r().getPlayerChunkMap().a(entityplayer, this.tracker.ah, this.tracker.aj); } public void scanPlayers(List list) { @@ -517,7 +517,7 @@ public class EntityTrackerEntry { public void clear(EntityPlayer entityplayer) { if (this.trackedPlayers.contains(entityplayer)) { this.trackedPlayers.remove(entityplayer); - entityplayer.removeQueue.add(Integer.valueOf(this.tracker.getId())); + entityplayer.d(this.tracker); } } } diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java index 99a8941121..0f5126a421 100644 --- a/src/main/java/net/minecraft/server/EntityWitch.java +++ b/src/main/java/net/minecraft/server/EntityWitch.java @@ -31,11 +31,11 @@ public class EntityWitch extends EntityMonster implements IRangedEntity { return "mob.witch.idle"; } - protected String aT() { + protected String aS() { return "mob.witch.hurt"; } - protected String aU() { + protected String aT() { return "mob.witch.death"; } @@ -43,26 +43,26 @@ public class EntityWitch extends EntityMonster implements IRangedEntity { this.getDataWatcher().watch(21, Byte.valueOf((byte) (flag ? 1 : 0))); } - public boolean bX() { + public boolean bZ() { return this.getDataWatcher().getByte(21) == 1; } - protected void aD() { - super.aD(); + protected void aC() { + super.aC(); this.getAttributeInstance(GenericAttributes.a).setValue(26.0D); this.getAttributeInstance(GenericAttributes.d).setValue(0.25D); } - public boolean bk() { + public boolean bj() { return true; } public void e() { if (!this.world.isStatic) { - if (this.bX()) { + if (this.bZ()) { if (this.bs-- <= 0) { this.a(false); - ItemStack itemstack = this.be(); + ItemStack itemstack = this.bd(); this.setEquipment(0, (ItemStack) null); if (itemstack != null && itemstack.getItem() == Items.POTION) { @@ -90,15 +90,15 @@ public class EntityWitch extends EntityMonster implements IRangedEntity { short1 = 16307; } else if (this.random.nextFloat() < 0.05F && this.getHealth() < this.getMaxHealth()) { short1 = 16341; - } else if (this.random.nextFloat() < 0.25F && this.getGoalTarget() != null && !this.hasEffect(MobEffectList.FASTER_MOVEMENT) && this.getGoalTarget().e(this) > 121.0D) { + } else if (this.random.nextFloat() < 0.25F && this.getGoalTarget() != null && !this.hasEffect(MobEffectList.FASTER_MOVEMENT) && this.getGoalTarget().f(this) > 121.0D) { short1 = 16274; - } else if (this.random.nextFloat() < 0.25F && this.getGoalTarget() != null && !this.hasEffect(MobEffectList.FASTER_MOVEMENT) && this.getGoalTarget().e(this) > 121.0D) { + } else if (this.random.nextFloat() < 0.25F && this.getGoalTarget() != null && !this.hasEffect(MobEffectList.FASTER_MOVEMENT) && this.getGoalTarget().f(this) > 121.0D) { short1 = 16274; } if (short1 > -1) { this.setEquipment(0, new ItemStack(Items.POTION, 1, short1)); - this.bs = this.be().n(); + this.bs = this.bd().n(); this.a(true); AttributeInstance attributeinstance = this.getAttributeInstance(GenericAttributes.d); @@ -152,7 +152,7 @@ public class EntityWitch extends EntityMonster implements IRangedEntity { } public void a(EntityLiving entityliving, float f) { - if (!this.bX()) { + if (!this.bZ()) { EntityPotion entitypotion = new EntityPotion(this.world, this, 32732); entitypotion.pitch -= -20.0F; diff --git a/src/main/java/net/minecraft/server/EntityWither.java b/src/main/java/net/minecraft/server/EntityWither.java index 04d624e9f2..99526b99b1 100644 --- a/src/main/java/net/minecraft/server/EntityWither.java +++ b/src/main/java/net/minecraft/server/EntityWither.java @@ -45,7 +45,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { public void b(NBTTagCompound nbttagcompound) { super.b(nbttagcompound); - nbttagcompound.setInt("Invul", this.bY()); + nbttagcompound.setInt("Invul", this.ca()); } public void a(NBTTagCompound nbttagcompound) { @@ -57,11 +57,11 @@ public class EntityWither extends EntityMonster implements IRangedEntity { return "mob.wither.idle"; } - protected String aT() { + protected String aS() { return "mob.wither.hurt"; } - protected String aU() { + protected String aT() { return "mob.wither.death"; } @@ -75,7 +75,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { Entity entity = this.world.getEntity(this.t(0)); if (entity != null) { - if (this.locY < entity.locY || !this.bZ() && this.locY < entity.locY + 5.0D) { + if (this.locY < entity.locY || !this.cb() && this.locY < entity.locY + 5.0D) { if (this.motY < 0.0D) { this.motY = 0.0D; } @@ -132,11 +132,11 @@ public class EntityWither extends EntityMonster implements IRangedEntity { this.bp[i] = this.b(this.bp[i], f1, 40.0F); this.bq[i] = this.b(this.bq[i], f, 10.0F); } else { - this.bq[i] = this.b(this.bq[i], this.aN, 10.0F); + this.bq[i] = this.b(this.bq[i], this.aM, 10.0F); } } - boolean flag = this.bZ(); + boolean flag = this.cb(); for (j = 0; j < 3; ++j) { double d8 = this.u(j); @@ -149,18 +149,18 @@ public class EntityWither extends EntityMonster implements IRangedEntity { } } - if (this.bY() > 0) { + if (this.ca() > 0) { for (j = 0; j < 3; ++j) { this.world.addParticle("mobSpell", this.locX + this.random.nextGaussian() * 1.0D, this.locY + (double) (this.random.nextFloat() * 3.3F), this.locZ + this.random.nextGaussian() * 1.0D, 0.699999988079071D, 0.699999988079071D, 0.8999999761581421D); } } } - protected void bn() { + protected void bm() { int i; - if (this.bY() > 0) { - i = this.bY() - 1; + if (this.ca() > 0) { + i = this.ca() - 1; if (i <= 0) { // CraftBukkit start ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), 7.0F, false); @@ -180,7 +180,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { this.heal(10.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.WITHER_SPAWN); // CraftBukkit } } else { - super.bn(); + super.bm(); int j; @@ -208,7 +208,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { if (j > 0) { Entity entity = this.world.getEntity(j); - if (entity != null && entity.isAlive() && this.e(entity) <= 900.0D && this.o(entity)) { + if (entity != null && entity.isAlive() && this.f(entity) <= 900.0D && this.p(entity)) { this.a(i + 1, (EntityLiving) entity); this.bt[i - 1] = this.ticksLived + 40 + this.random.nextInt(20); this.bu[i - 1] = 0; @@ -221,7 +221,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { for (int i1 = 0; i1 < 10 && !list.isEmpty(); ++i1) { EntityLiving entityliving = (EntityLiving) list.get(this.random.nextInt(list.size())); - if (entityliving != this && entityliving.isAlive() && this.o(entityliving)) { + if (entityliving != this && entityliving.isAlive() && this.p(entityliving)) { if (entityliving instanceof EntityHuman) { if (!((EntityHuman) entityliving).abilities.isInvulnerable) { this.b(i, entityliving.getId()); @@ -285,14 +285,14 @@ public class EntityWither extends EntityMonster implements IRangedEntity { } } - public void bX() { + public void bZ() { this.s(220); this.setHealth(this.getMaxHealth() / 3.0F); } - public void as() {} + public void ar() {} - public int aV() { + public int aU() { return 4; } @@ -300,7 +300,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { if (i <= 0) { return this.locX; } else { - float f = (this.aN + (float) (180 * (i - 1))) / 180.0F * 3.1415927F; + float f = (this.aM + (float) (180 * (i - 1))) / 180.0F * 3.1415927F; float f1 = MathHelper.cos(f); return this.locX + (double) f1 * 1.3D; @@ -315,7 +315,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { if (i <= 0) { return this.locZ; } else { - float f = (this.aN + (float) (180 * (i - 1))) / 180.0F * 3.1415927F; + float f = (this.aM + (float) (180 * (i - 1))) / 180.0F * 3.1415927F; float f1 = MathHelper.sin(f); return this.locZ + (double) f1 * 1.3D; @@ -369,12 +369,12 @@ public class EntityWither extends EntityMonster implements IRangedEntity { return false; } else if (damagesource == DamageSource.DROWN) { return false; - } else if (this.bY() > 0) { + } else if (this.ca() > 0) { return false; } else { Entity entity; - if (this.bZ()) { + if (this.cb()) { entity = damagesource.i(); if (entity instanceof EntityArrow) { return false; @@ -416,25 +416,25 @@ public class EntityWither extends EntityMonster implements IRangedEntity { } protected void w() { - this.aV = 0; + this.aU = 0; } protected void b(float f) {} public void addEffect(MobEffect mobeffect) {} - protected boolean bk() { + protected boolean bj() { return true; } - protected void aD() { - super.aD(); + protected void aC() { + super.aC(); this.getAttributeInstance(GenericAttributes.a).setValue(300.0D); this.getAttributeInstance(GenericAttributes.d).setValue(0.6000000238418579D); this.getAttributeInstance(GenericAttributes.b).setValue(40.0D); } - public int bY() { + public int ca() { return this.datawatcher.getInt(20); } @@ -450,7 +450,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { this.datawatcher.watch(17 + i, Integer.valueOf(j)); } - public boolean bZ() { + public boolean cb() { return this.getHealth() <= this.getMaxHealth() / 2.0F; } diff --git a/src/main/java/net/minecraft/server/EntityWitherSkull.java b/src/main/java/net/minecraft/server/EntityWitherSkull.java index 2d428f9d39..d749175f99 100644 --- a/src/main/java/net/minecraft/server/EntityWitherSkull.java +++ b/src/main/java/net/minecraft/server/EntityWitherSkull.java @@ -71,7 +71,7 @@ public class EntityWitherSkull extends EntityFireball { } } - public boolean R() { + public boolean Q() { return false; } diff --git a/src/main/java/net/minecraft/server/EntityWolf.java b/src/main/java/net/minecraft/server/EntityWolf.java index 7359a12bc1..097f4f5694 100644 --- a/src/main/java/net/minecraft/server/EntityWolf.java +++ b/src/main/java/net/minecraft/server/EntityWolf.java @@ -30,8 +30,8 @@ public class EntityWolf extends EntityTameableAnimal { this.setTamed(false); } - protected void aD() { - super.aD(); + protected void aC() { + super.aC(); this.getAttributeInstance(GenericAttributes.d).setValue(0.30000001192092896D); if (this.isTamed()) { this.getAttributeInstance(GenericAttributes.a).setValue(20.0D); @@ -40,7 +40,7 @@ public class EntityWolf extends EntityTameableAnimal { } } - public boolean bk() { + public boolean bj() { return true; } @@ -53,7 +53,7 @@ public class EntityWolf extends EntityTameableAnimal { } } - protected void bp() { + protected void bo() { this.datawatcher.watch(18, Float.valueOf(this.getHealth())); } @@ -87,15 +87,15 @@ public class EntityWolf extends EntityTameableAnimal { return this.isAngry() ? "mob.wolf.growl" : (this.random.nextInt(3) == 0 ? (this.isTamed() && this.datawatcher.getFloat(18) < (this.getMaxHealth() / 2) ? "mob.wolf.whine" : "mob.wolf.panting") : "mob.wolf.bark"); } - protected String aT() { + protected String aS() { return "mob.wolf.hurt"; } - protected String aU() { + protected String aT() { return "mob.wolf.death"; } - protected float bf() { + protected float be() { return 0.4F; } @@ -105,7 +105,7 @@ public class EntityWolf extends EntityTameableAnimal { public void e() { super.e(); - if (!this.world.isStatic && this.bs && !this.bt && !this.bQ() && this.onGround) { + if (!this.world.isStatic && this.bs && !this.bt && !this.bS() && this.onGround) { this.bt = true; this.bu = 0.0F; this.bv = 0.0F; @@ -116,24 +116,24 @@ public class EntityWolf extends EntityTameableAnimal { public void h() { super.h(); this.br = this.bq; - if (this.ci()) { + if (this.ck()) { this.bq += (1.0F - this.bq) * 0.4F; } else { this.bq += (0.0F - this.bq) * 0.4F; } - if (this.ci()) { + if (this.ck()) { this.g = 10; } - if (this.L()) { + if (this.K()) { this.bs = true; this.bt = false; this.bu = 0.0F; this.bv = 0.0F; } else if ((this.bs || this.bt) && this.bt) { if (this.bu == 0.0F) { - this.makeSound("mob.wolf.shake", this.bf(), (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F); + this.makeSound("mob.wolf.shake", this.be(), (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F); } this.bv = this.bu; @@ -163,8 +163,8 @@ public class EntityWolf extends EntityTameableAnimal { return this.length * 0.8F; } - public int x() { - return this.isSitting() ? 20 : super.x(); + public int bv() { + return this.isSitting() ? 20 : super.bv(); } public boolean damageEntity(DamageSource damagesource, float f) { @@ -182,7 +182,7 @@ public class EntityWolf extends EntityTameableAnimal { } } - public boolean m(Entity entity) { + public boolean n(Entity entity) { int i = this.isTamed() ? 4 : 2; return entity.damageEntity(DamageSource.mobAttack(this), (float) i); @@ -233,7 +233,7 @@ public class EntityWolf extends EntityTameableAnimal { if (entityhuman.getName().equalsIgnoreCase(this.getOwnerName()) && !this.world.isStatic && !this.c(itemstack)) { this.bp.setSitting(!this.isSitting()); - this.bd = false; + this.bc = false; this.setPathEntity((PathEntity) null); this.setTarget((Entity) null); this.setGoalTarget((EntityLiving) null); @@ -274,7 +274,7 @@ public class EntityWolf extends EntityTameableAnimal { return itemstack == null ? false : (!(itemstack.getItem() instanceof ItemFood) ? false : ((ItemFood) itemstack.getItem()).i()); } - public int bz() { + public int bB() { return 8; } @@ -330,16 +330,16 @@ public class EntityWolf extends EntityTameableAnimal { } else { EntityWolf entitywolf = (EntityWolf) entityanimal; - return !entitywolf.isTamed() ? false : (entitywolf.isSitting() ? false : this.cc() && entitywolf.cc()); + return !entitywolf.isTamed() ? false : (entitywolf.isSitting() ? false : this.ce() && entitywolf.ce()); } } - public boolean ci() { + public boolean ck() { return this.datawatcher.getByte(19) == 1; } protected boolean isTypeNotPersistent() { - return !this.isTamed(); // CraftBukkit + return !this.isTamed() /*&& this.ticksLived > 2400*/; // CraftBukkit } public boolean a(EntityLiving entityliving, EntityLiving entityliving1) { diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java index 6c6e03edcd..b751d01c2a 100644 --- a/src/main/java/net/minecraft/server/EntityZombie.java +++ b/src/main/java/net/minecraft/server/EntityZombie.java @@ -1,8 +1,10 @@ package net.minecraft.server; import java.util.Calendar; +import java.util.List; import java.util.UUID; + //CraftBukkit start import org.bukkit.craftbukkit.entity.CraftLivingEntity; import org.bukkit.event.entity.EntityCombustByEntityEvent; @@ -19,7 +21,7 @@ public class EntityZombie extends EntityMonster { private boolean bu = false; private float bv = -1.0F; private float bw; - private int lastTick = MinecraftServer.currentTick; // CraftBukkit + private int lastTick = MinecraftServer.currentTick; // CraftBukkit - add field public EntityZombie(World world) { super(world); @@ -38,12 +40,12 @@ public class EntityZombie extends EntityMonster { this.a(0.6F, 1.8F); } - protected void aD() { - super.aD(); + protected void aC() { + super.aC(); this.getAttributeInstance(GenericAttributes.b).setValue(40.0D); this.getAttributeInstance(GenericAttributes.d).setValue(0.23000000417232513D); this.getAttributeInstance(GenericAttributes.e).setValue(3.0D); - this.bc().b(bp).setValue(this.random.nextDouble() * 0.10000000149011612D); + this.bb().b(bp).setValue(this.random.nextDouble() * 0.10000000149011612D); } protected void c() { @@ -53,8 +55,8 @@ public class EntityZombie extends EntityMonster { this.getDataWatcher().a(14, Byte.valueOf((byte) 0)); } - public int aV() { - int i = super.aV() + 2; + public int aU() { + int i = super.aU() + 2; if (i > 20) { i = 20; @@ -63,11 +65,11 @@ public class EntityZombie extends EntityMonster { return i; } - protected boolean bk() { + protected boolean bj() { return true; } - public boolean bX() { + public boolean bZ() { return this.bu; } @@ -117,7 +119,7 @@ public class EntityZombie extends EntityMonster { } public void e() { - if (this.world.v() && !this.world.isStatic && !this.isBaby()) { + if (this.world.w() && !this.world.isStatic && !this.isBaby()) { float f = this.d(1.0F); if (f > 0.5F && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.world.i(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ))) { @@ -149,6 +151,10 @@ public class EntityZombie extends EntityMonster { } } + if (this.al() && this.getGoalTarget() != null && this.vehicle instanceof EntityChicken) { + ((EntityInsentient) this.vehicle).getNavigation().a(this.getNavigation().e(), 1.5D); + } + super.e(); } @@ -158,8 +164,8 @@ public class EntityZombie extends EntityMonster { } else { EntityLiving entityliving = this.getGoalTarget(); - if (entityliving == null && this.bR() instanceof EntityLiving) { - entityliving = (EntityLiving) this.bR(); + if (entityliving == null && this.bT() instanceof EntityLiving) { + entityliving = (EntityLiving) this.bT(); } if (entityliving == null && damagesource.getEntity() instanceof EntityLiving) { @@ -196,8 +202,8 @@ public class EntityZombie extends EntityMonster { } public void h() { - if (!this.world.isStatic && this.ca()) { - int i = this.cc(); + if (!this.world.isStatic && this.cc()) { + int i = this.ce(); // CraftBukkit start - Use wall time instead of ticks for villager conversion int elapsedTicks = MinecraftServer.currentTick - this.lastTick; @@ -207,20 +213,20 @@ public class EntityZombie extends EntityMonster { this.bt -= i; if (this.bt <= 0) { - this.cb(); + this.cd(); } } super.h(); } - public boolean m(Entity entity) { - boolean flag = super.m(entity); + public boolean n(Entity entity) { + boolean flag = super.n(entity); if (flag) { int i = this.world.difficulty.a(); - if (this.be() == null && this.isBurning() && this.random.nextFloat() < (float) i * 0.3F) { + if (this.bd() == null && this.isBurning() && this.random.nextFloat() < (float) i * 0.3F) { // CraftBukkit start EntityCombustByEntityEvent event = new EntityCombustByEntityEvent(this.getBukkitEntity(), entity.getBukkitEntity(), 2 * i); this.world.getServer().getPluginManager().callEvent(event); @@ -239,11 +245,11 @@ public class EntityZombie extends EntityMonster { return "mob.zombie.say"; } - protected String aT() { + protected String aS() { return "mob.zombie.hurt"; } - protected String aU() { + protected String aT() { return "mob.zombie.death"; } @@ -274,8 +280,8 @@ public class EntityZombie extends EntityMonster { } // CraftBukkit end - protected void bA() { - super.bA(); + protected void bC() { + super.bC(); if (this.random.nextFloat() < (this.world.difficulty == EnumDifficulty.HARD ? 0.05F : 0.01F)) { int i = this.random.nextInt(3); @@ -297,8 +303,8 @@ public class EntityZombie extends EntityMonster { nbttagcompound.setBoolean("IsVillager", true); } - nbttagcompound.setInt("ConversionTime", this.ca() ? this.bt : -1); - nbttagcompound.setBoolean("CanBreakDoors", this.bX()); + nbttagcompound.setInt("ConversionTime", this.cc() ? this.bt : -1); + nbttagcompound.setBoolean("CanBreakDoors", this.bZ()); } public void a(NBTTagCompound nbttagcompound) { @@ -327,7 +333,7 @@ public class EntityZombie extends EntityMonster { EntityZombie entityzombie = new EntityZombie(this.world); - entityzombie.j(entityliving); + entityzombie.k(entityliving); this.world.kill(entityliving); entityzombie.a((GroupDataEntity) null); entityzombie.setVillager(true); @@ -358,12 +364,30 @@ public class EntityZombie extends EntityMonster { if (groupdatazombie.a) { this.setBaby(true); + if ((double) this.world.random.nextFloat() < 0.05D) { + List list = this.world.a(EntityChicken.class, this.boundingBox.grow(5.0D, 3.0D, 5.0D), IEntitySelector.b); + + if (!list.isEmpty()) { + EntityChicken entitychicken = (EntityChicken) list.get(0); + + entitychicken.i(true); + this.mount(entitychicken); + } + } else if ((double) this.world.random.nextFloat() < 0.05D) { + EntityChicken entitychicken1 = new EntityChicken(this.world); + + entitychicken1.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, 0.0F); + entitychicken1.a((GroupDataEntity) null); + entitychicken1.i(true); + this.world.addEntity(entitychicken1); + this.mount(entitychicken1); + } } } this.a(this.random.nextFloat() < f * 0.1F); - this.bA(); - this.bB(); + this.bC(); + this.bD(); if (this.getEquipment(4) == null) { Calendar calendar = this.world.V(); @@ -390,7 +414,7 @@ public class EntityZombie extends EntityMonster { } public boolean a(EntityHuman entityhuman) { - ItemStack itemstack = entityhuman.bD(); + ItemStack itemstack = entityhuman.bE(); if (itemstack != null && itemstack.getItem() == Items.GOLDEN_APPLE && itemstack.getData() == 0 && this.isVillager() && this.hasEffect(MobEffectList.WEAKNESS)) { if (!entityhuman.abilities.canInstantlyBuild) { @@ -414,25 +438,25 @@ public class EntityZombie extends EntityMonster { protected void a(int i) { this.bt = i; this.getDataWatcher().watch(14, Byte.valueOf((byte) 1)); - this.m(MobEffectList.WEAKNESS.id); + this.removeEffect(MobEffectList.WEAKNESS.id); this.addEffect(new MobEffect(MobEffectList.INCREASE_DAMAGE.id, i, Math.min(this.world.difficulty.a() - 1, 0))); this.world.broadcastEntityEffect(this, (byte) 16); } protected boolean isTypeNotPersistent() { - return !this.ca(); + return !this.cc(); } - public boolean ca() { + public boolean cc() { return this.getDataWatcher().getByte(14) == 1; } - protected void cb() { + protected void cd() { EntityVillager entityvillager = new EntityVillager(this.world); - entityvillager.j(this); + entityvillager.k(this); entityvillager.a((GroupDataEntity) null); - entityvillager.cb(); + entityvillager.cd(); if (this.isBaby()) { entityvillager.setAge(-24000); } @@ -443,7 +467,7 @@ public class EntityZombie extends EntityMonster { this.world.a((EntityHuman) null, 1017, (int) this.locX, (int) this.locY, (int) this.locZ, 0); } - protected int cc() { + protected int ce() { int i = 1; if (this.random.nextFloat() < 0.01F) { diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java index 39e5b5bee7..d6ac7287b1 100644 --- a/src/main/java/net/minecraft/server/Explosion.java +++ b/src/main/java/net/minecraft/server/Explosion.java @@ -31,7 +31,7 @@ public class Explosion { public float size; public List blocks = new ArrayList(); private Map l = new HashMap(); - public boolean wasCanceled = false; // CraftBukkit + public boolean wasCanceled = false; // CraftBukkit - add field public Explosion(World world, Entity entity, double d0, double d1, double d2, float f) { this.world = world; @@ -110,8 +110,8 @@ public class Explosion { int k1 = MathHelper.floor(this.posY + (double) this.size + 1.0D); int l1 = MathHelper.floor(this.posZ - (double) this.size - 1.0D); int i2 = MathHelper.floor(this.posZ + (double) this.size + 1.0D); - List list = this.world.getEntities(this.source, AxisAlignedBB.a().a((double) i, (double) k, (double) l1, (double) j, (double) k1, (double) i2)); - Vec3D vec3d = this.world.getVec3DPool().create(this.posX, this.posY, this.posZ); + List list = this.world.getEntities(this.source, AxisAlignedBB.a((double) i, (double) k, (double) l1, (double) j, (double) k1, (double) i2)); + Vec3D vec3d = Vec3D.a(this.posX, this.posY, this.posZ); for (int j2 = 0; j2 < list.size(); ++j2) { Entity entity = (Entity) list.get(j2); @@ -149,7 +149,7 @@ public class Explosion { entity.motY += d1 * d11; entity.motZ += d2 * d11; if (entity instanceof EntityHuman) { - this.l.put((EntityHuman) entity, this.world.getVec3DPool().create(d0 * d10, d1 * d10, d2 * d10)); + this.l.put((EntityHuman) entity, Vec3D.a(d0 * d10, d1 * d10, d2 * d10)); } } } else { @@ -173,7 +173,7 @@ public class Explosion { entity.motY += d1 * d10; entity.motZ += d2 * d10; if (entity instanceof EntityHuman) { - this.l.put((EntityHuman) entity, this.world.getVec3DPool().create(d0 * d10, d1 * d10, d2 * d10)); + this.l.put((EntityHuman) entity, Vec3D.a(d0 * d10, d1 * d10, d2 * d10)); } } } diff --git a/src/main/java/net/minecraft/server/FoodMetaData.java b/src/main/java/net/minecraft/server/FoodMetaData.java index 39c41b8789..4e91fe91d6 100644 --- a/src/main/java/net/minecraft/server/FoodMetaData.java +++ b/src/main/java/net/minecraft/server/FoodMetaData.java @@ -60,7 +60,7 @@ public class FoodMetaData { } } - if (entityhuman.world.getGameRules().getBoolean("naturalRegeneration") && this.foodLevel >= 18 && entityhuman.bP()) { + if (entityhuman.world.getGameRules().getBoolean("naturalRegeneration") && this.foodLevel >= 18 && entityhuman.bQ()) { ++this.foodTickTimer; if (this.foodTickTimer >= 80) { // CraftBukkit - added RegainReason diff --git a/src/main/java/net/minecraft/server/HandshakeListener.java b/src/main/java/net/minecraft/server/HandshakeListener.java index 54ecbdfa33..e5992f8516 100644 --- a/src/main/java/net/minecraft/server/HandshakeListener.java +++ b/src/main/java/net/minecraft/server/HandshakeListener.java @@ -9,7 +9,7 @@ import java.util.HashMap; public class HandshakeListener implements PacketHandshakingInListener { - // CraftBukkit start + // CraftBukkit start - add fields private static final HashMap throttleTracker = new HashMap(); private static int throttleCounter = 0; // CraftBukkit end @@ -28,7 +28,7 @@ public class HandshakeListener implements PacketHandshakingInListener { this.b.a(EnumProtocol.LOGIN); ChatComponentText chatcomponenttext; - // CraftBukkit start + // CraftBukkit start - Connection throttle try { long currentTime = System.currentTimeMillis(); long connectionThrottle = MinecraftServer.getServer().server.getConnectionThrottle(); @@ -39,7 +39,7 @@ public class HandshakeListener implements PacketHandshakingInListener { throttleTracker.put(address, currentTime); chatcomponenttext = new ChatComponentText("Connection throttled! Please wait before reconnecting."); this.b.handle(new PacketLoginOutDisconnect(chatcomponenttext), new GenericFutureListener[0]); - this.b.a(chatcomponenttext); // Should be close + this.b.close(chatcomponenttext); return; } @@ -64,13 +64,13 @@ public class HandshakeListener implements PacketHandshakingInListener { // CraftBukkit end if (packethandshakinginsetprotocol.d() > 4) { - chatcomponenttext = new ChatComponentText("Outdated server! I\'m still on 1.7.2"); + chatcomponenttext = new ChatComponentText("Outdated server! I\'m still on 1.7.5"); this.b.handle(new PacketLoginOutDisconnect(chatcomponenttext), new GenericFutureListener[0]); - this.b.a((IChatBaseComponent) chatcomponenttext); + this.b.close(chatcomponenttext); } else if (packethandshakinginsetprotocol.d() < 4) { - chatcomponenttext = new ChatComponentText("Outdated client! Please use 1.7.2"); + chatcomponenttext = new ChatComponentText("Outdated client! Please use 1.7.5"); this.b.handle(new PacketLoginOutDisconnect(chatcomponenttext), new GenericFutureListener[0]); - this.b.a((IChatBaseComponent) chatcomponenttext); + this.b.close(chatcomponenttext); } else { this.b.a((PacketListener) (new LoginListener(this.a, this.b))); ((LoginListener) this.b.getPacketListener()).hostname = packethandshakinginsetprotocol.b + ":" + packethandshakinginsetprotocol.c; // CraftBukkit - set hostname diff --git a/src/main/java/net/minecraft/server/InventoryCrafting.java b/src/main/java/net/minecraft/server/InventoryCrafting.java index 30d22c61ef..f1c891e39b 100644 --- a/src/main/java/net/minecraft/server/InventoryCrafting.java +++ b/src/main/java/net/minecraft/server/InventoryCrafting.java @@ -14,7 +14,7 @@ public class InventoryCrafting implements IInventory { private int b; private Container c; - // CraftBukkit start + // CraftBukkit start - add fields public List transaction = new java.util.ArrayList(); public IRecipe currentRecipe; public IInventory resultInventory; diff --git a/src/main/java/net/minecraft/server/InventoryEnderChest.java b/src/main/java/net/minecraft/server/InventoryEnderChest.java index ecaf354cfc..0d9b2891c0 100644 --- a/src/main/java/net/minecraft/server/InventoryEnderChest.java +++ b/src/main/java/net/minecraft/server/InventoryEnderChest.java @@ -10,7 +10,7 @@ public class InventoryEnderChest extends InventorySubcontainer { private TileEntityEnderChest a; - // CraftBukkit start + // CraftBukkit start - add fields and methods public List transaction = new java.util.ArrayList(); public org.bukkit.entity.Player player; private int maxStack = MAX_STACK; diff --git a/src/main/java/net/minecraft/server/InventoryHorseChest.java b/src/main/java/net/minecraft/server/InventoryHorseChest.java index 54a9a7d708..01289950d3 100644 --- a/src/main/java/net/minecraft/server/InventoryHorseChest.java +++ b/src/main/java/net/minecraft/server/InventoryHorseChest.java @@ -12,7 +12,7 @@ public class InventoryHorseChest extends InventorySubcontainer { super(s, false, i); } - // CraftBukkit start + // CraftBukkit start - add fields and methods public List transaction = new java.util.ArrayList(); private EntityHorse horse; private int maxStack = MAX_STACK; diff --git a/src/main/java/net/minecraft/server/InventoryLargeChest.java b/src/main/java/net/minecraft/server/InventoryLargeChest.java index 575d59fbf0..d117358fac 100644 --- a/src/main/java/net/minecraft/server/InventoryLargeChest.java +++ b/src/main/java/net/minecraft/server/InventoryLargeChest.java @@ -13,7 +13,7 @@ public class InventoryLargeChest implements IInventory { public IInventory left; // CraftBukkit - private -> public public IInventory right; // CraftBukkit - private -> public - // CraftBukkit start + // CraftBukkit start - add fields and methods public List transaction = new java.util.ArrayList(); public ItemStack[] getContents() { diff --git a/src/main/java/net/minecraft/server/InventoryMerchant.java b/src/main/java/net/minecraft/server/InventoryMerchant.java index 37eb8faedd..a04e9be96f 100644 --- a/src/main/java/net/minecraft/server/InventoryMerchant.java +++ b/src/main/java/net/minecraft/server/InventoryMerchant.java @@ -14,7 +14,7 @@ public class InventoryMerchant implements IInventory { private MerchantRecipe recipe; private int e; - // CraftBukkit start + // CraftBukkit start - add fields and methods public List transaction = new java.util.ArrayList(); private int maxStack = MAX_STACK; diff --git a/src/main/java/net/minecraft/server/InventorySubcontainer.java b/src/main/java/net/minecraft/server/InventorySubcontainer.java index e2d16fca29..e7c8aa8144 100644 --- a/src/main/java/net/minecraft/server/InventorySubcontainer.java +++ b/src/main/java/net/minecraft/server/InventorySubcontainer.java @@ -31,7 +31,7 @@ public abstract class InventorySubcontainer implements IInventory { // CraftBukk } public ItemStack getItem(int i) { - return this.items[i]; + return i >= 0 && i < this.items.length ? this.items[i] : null; } public ItemStack splitStack(int i, int j) { diff --git a/src/main/java/net/minecraft/server/Item.java b/src/main/java/net/minecraft/server/Item.java index 351436c85f..8d56cc3046 100644 --- a/src/main/java/net/minecraft/server/Item.java +++ b/src/main/java/net/minecraft/server/Item.java @@ -213,7 +213,7 @@ public class Item { REGISTRY.a(2266, "record_11", (new ItemRecord("11")).c("record").f("record_11")); REGISTRY.a(2267, "record_wait", (new ItemRecord("wait")).c("record").f("record_wait")); HashSet hashset = Sets.newHashSet(new Block[] { Blocks.AIR, Blocks.BREWING_STAND, Blocks.BED, Blocks.NETHER_WART, Blocks.CAULDRON, Blocks.FLOWER_POT, Blocks.CROPS, Blocks.SUGAR_CANE_BLOCK, Blocks.CAKE_BLOCK, Blocks.SKULL, Blocks.PISTON_EXTENSION, Blocks.PISTON_MOVING, Blocks.GLOWING_REDSTONE_ORE, Blocks.DIODE_ON, Blocks.PUMPKIN_STEM, Blocks.SIGN_POST, Blocks.REDSTONE_COMPARATOR_ON, Blocks.TRIPWIRE, Blocks.REDSTONE_LAMP_ON, Blocks.MELON_STEM, Blocks.REDSTONE_TORCH_OFF, Blocks.REDSTONE_COMPARATOR_OFF, Blocks.REDSTONE_WIRE, Blocks.WALL_SIGN, Blocks.DIODE_OFF, Blocks.IRON_DOOR_BLOCK, Blocks.WOODEN_DOOR}); - Iterator iterator = Block.REGISTRY.b().iterator(); + Iterator iterator = Block.REGISTRY.keySet().iterator(); while (iterator.hasNext()) { String s = (String) iterator.next(); @@ -462,7 +462,7 @@ public class Item { double d0 = entityhuman.lastX + (entityhuman.locX - entityhuman.lastX) * (double) f; double d1 = entityhuman.lastY + (entityhuman.locY - entityhuman.lastY) * (double) f + 1.62D - (double) entityhuman.height; double d2 = entityhuman.lastZ + (entityhuman.locZ - entityhuman.lastZ) * (double) f; - Vec3D vec3d = world.getVec3DPool().create(d0, d1, d2); + Vec3D vec3d = Vec3D.a(d0, d1, d2); float f3 = MathHelper.cos(-f2 * 0.017453292F - 3.1415927F); float f4 = MathHelper.sin(-f2 * 0.017453292F - 3.1415927F); float f5 = -MathHelper.cos(-f1 * 0.017453292F); diff --git a/src/main/java/net/minecraft/server/ItemBed.java b/src/main/java/net/minecraft/server/ItemBed.java index 7e63b182c4..9b749bf8fd 100644 --- a/src/main/java/net/minecraft/server/ItemBed.java +++ b/src/main/java/net/minecraft/server/ItemBed.java @@ -37,7 +37,7 @@ public class ItemBed extends Item { if (entityhuman.a(i, j, k, l, itemstack) && entityhuman.a(i + b0, j, k + b1, l, itemstack)) { if (world.isEmpty(i, j, k) && world.isEmpty(i + b0, j, k + b1) && World.a((IBlockAccess) world, i, j - 1, k) && World.a((IBlockAccess) world, i + b0, j - 1, k + b1)) { - // CraftBukkit start + // CraftBukkit start - fire BlockPlaceEvent // world.setTypeAndData(i, j, k, blockbed, i1, 3); if (!ItemBlock.processBlockPlace(world, entityhuman, null, i, j, k, blockbed, i1, clickedX, clickedY, clickedZ)) { return false; diff --git a/src/main/java/net/minecraft/server/ItemBoat.java b/src/main/java/net/minecraft/server/ItemBoat.java index 30310e2c9e..29c97e21a7 100644 --- a/src/main/java/net/minecraft/server/ItemBoat.java +++ b/src/main/java/net/minecraft/server/ItemBoat.java @@ -16,7 +16,7 @@ public class ItemBoat extends Item { double d0 = entityhuman.lastX + (entityhuman.locX - entityhuman.lastX) * (double) f; double d1 = entityhuman.lastY + (entityhuman.locY - entityhuman.lastY) * (double) f + 1.62D - (double) entityhuman.height; double d2 = entityhuman.lastZ + (entityhuman.locZ - entityhuman.lastZ) * (double) f; - Vec3D vec3d = world.getVec3DPool().create(d0, d1, d2); + Vec3D vec3d = Vec3D.a(d0, d1, d2); float f3 = MathHelper.cos(-f2 * 0.017453292F - 3.1415927F); float f4 = MathHelper.sin(-f2 * 0.017453292F - 3.1415927F); float f5 = -MathHelper.cos(-f1 * 0.017453292F); @@ -33,15 +33,15 @@ public class ItemBoat extends Item { Vec3D vec3d2 = entityhuman.j(f); boolean flag = false; float f9 = 1.0F; - List list = world.getEntities(entityhuman, entityhuman.boundingBox.a(vec3d2.c * d3, vec3d2.d * d3, vec3d2.e * d3).grow((double) f9, (double) f9, (double) f9)); + List list = world.getEntities(entityhuman, entityhuman.boundingBox.a(vec3d2.a * d3, vec3d2.b * d3, vec3d2.c * d3).grow((double) f9, (double) f9, (double) f9)); int i; for (i = 0; i < list.size(); ++i) { Entity entity = (Entity) list.get(i); - if (entity.R()) { - float f10 = entity.af(); + if (entity.Q()) { + float f10 = entity.ae(); AxisAlignedBB axisalignedbb = entity.boundingBox.grow((double) f10, (double) f10, (double) f10); if (axisalignedbb.a(vec3d)) { diff --git a/src/main/java/net/minecraft/server/ItemBow.java b/src/main/java/net/minecraft/server/ItemBow.java index 59d543ca20..b3472dd1b2 100644 --- a/src/main/java/net/minecraft/server/ItemBow.java +++ b/src/main/java/net/minecraft/server/ItemBow.java @@ -29,7 +29,7 @@ public class ItemBow extends Item { EntityArrow entityarrow = new EntityArrow(world, entityhuman, f * 2.0F); if (f == 1.0F) { - entityarrow.a(true); + entityarrow.setCritical(true); } int k = EnchantmentManager.getEnchantmentLevel(Enchantment.ARROW_DAMAGE.id, itemstack); @@ -41,7 +41,7 @@ public class ItemBow extends Item { int l = EnchantmentManager.getEnchantmentLevel(Enchantment.ARROW_KNOCKBACK.id, itemstack); if (l > 0) { - entityarrow.a(l); + entityarrow.setKnockbackStrength(l); } if (EnchantmentManager.getEnchantmentLevel(Enchantment.ARROW_FIRE.id, itemstack) > 0) { diff --git a/src/main/java/net/minecraft/server/ItemDoor.java b/src/main/java/net/minecraft/server/ItemDoor.java index 29dc1330b0..dcb400cb1e 100644 --- a/src/main/java/net/minecraft/server/ItemDoor.java +++ b/src/main/java/net/minecraft/server/ItemDoor.java @@ -30,7 +30,7 @@ public class ItemDoor extends Item { } else { int i1 = MathHelper.floor((double) ((entityhuman.yaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3; - // CraftBukkit start + // CraftBukkit start - fire BlockPlaceEvent if (!place(world, i, j, k, i1, block, entityhuman, clickedX, clickedY, clickedZ)) { return false; } @@ -83,7 +83,7 @@ public class ItemDoor extends Item { flag2 = true; } - // CraftBukkit start + // CraftBukkit start - fire BlockPlaceEvent if (entityhuman != null) { if (!ItemBlock.processBlockPlace(world, entityhuman, null, i, j, k, block, l, clickedX, clickedY, clickedZ)) { ((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutBlockChange(i, j + 1, k, world)); diff --git a/src/main/java/net/minecraft/server/ItemDye.java b/src/main/java/net/minecraft/server/ItemDye.java index e5d210f464..064e9685a5 100644 --- a/src/main/java/net/minecraft/server/ItemDye.java +++ b/src/main/java/net/minecraft/server/ItemDye.java @@ -68,7 +68,7 @@ public class ItemDye extends Item { if (world.isEmpty(i, j, k)) { int j1 = Blocks.COCOA.getPlacedData(world, i, j, k, l, f, f1, f2, 0); - // CraftBukkit start + // CraftBukkit start - fire BlockPlaceEvent // world.setTypeAndData(i, j, k, Blocks.COCOA, j1, 2); if (!ItemBlock.processBlockPlace(world, entityhuman, itemstack, i, j, k, Blocks.COCOA, j1, clickedX, clickedY, clickedZ)) { return false; @@ -88,7 +88,7 @@ public class ItemDye extends Item { } public static boolean a(ItemStack itemstack, World world, int i, int j, int k) { - // CraftBukkit start + // CraftBukkit start - add EntityHuman parameter return a(itemstack, world, i, j, k, null); } diff --git a/src/main/java/net/minecraft/server/ItemFireball.java b/src/main/java/net/minecraft/server/ItemFireball.java index d7c795e415..9f8291ed43 100644 --- a/src/main/java/net/minecraft/server/ItemFireball.java +++ b/src/main/java/net/minecraft/server/ItemFireball.java @@ -38,7 +38,7 @@ public class ItemFireball extends Item { return false; } else { if (world.getType(i, j, k).getMaterial() == Material.AIR) { - // CraftBukkit start + // CraftBukkit start - fire BlockIgniteEvent if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, i, j, k, org.bukkit.event.block.BlockIgniteEvent.IgniteCause.FIREBALL, entityhuman).isCancelled()) { if (!entityhuman.abilities.canInstantlyBuild) { --itemstack.count; diff --git a/src/main/java/net/minecraft/server/ItemFishingRod.java b/src/main/java/net/minecraft/server/ItemFishingRod.java index 2f34151b2b..4451a9f68f 100644 --- a/src/main/java/net/minecraft/server/ItemFishingRod.java +++ b/src/main/java/net/minecraft/server/ItemFishingRod.java @@ -15,7 +15,7 @@ public class ItemFishingRod extends Item { int i = entityhuman.hookedFish.e(); itemstack.damage(i, entityhuman); - entityhuman.ba(); + entityhuman.aZ(); } else { // CraftBukkit start EntityFishingHook hook = new EntityFishingHook(world, entityhuman); @@ -31,7 +31,7 @@ public class ItemFishingRod extends Item { world.addEntity(hook); // CraftBukkit - moved creation up } - entityhuman.ba(); + entityhuman.aZ(); } return itemstack; diff --git a/src/main/java/net/minecraft/server/ItemHanging.java b/src/main/java/net/minecraft/server/ItemHanging.java index 6708453986..d88d36ac0e 100644 --- a/src/main/java/net/minecraft/server/ItemHanging.java +++ b/src/main/java/net/minecraft/server/ItemHanging.java @@ -29,7 +29,7 @@ public class ItemHanging extends Item { } else { if (entityhanging != null && entityhanging.survives()) { if (!world.isStatic) { - // CraftBukkit start + // CraftBukkit start - fire HangingPlaceEvent Player who = (entityhuman == null) ? null : (Player) entityhuman.getBukkitEntity(); org.bukkit.block.Block blockClicked = world.getWorld().getBlockAt(i, j, k); org.bukkit.block.BlockFace blockFace = org.bukkit.craftbukkit.block.CraftBlock.notchToBlockFace(l); diff --git a/src/main/java/net/minecraft/server/ItemLeash.java b/src/main/java/net/minecraft/server/ItemLeash.java index e24b2a8d0f..8655b9f1f6 100644 --- a/src/main/java/net/minecraft/server/ItemLeash.java +++ b/src/main/java/net/minecraft/server/ItemLeash.java @@ -30,7 +30,7 @@ public class ItemLeash extends Item { EntityLeash entityleash = EntityLeash.b(world, i, j, k); boolean flag = false; double d0 = 7.0D; - List list = world.a(EntityInsentient.class, AxisAlignedBB.a().a((double) i - d0, (double) j - d0, (double) k - d0, (double) i + d0, (double) j + d0, (double) k + d0)); + List list = world.a(EntityInsentient.class, AxisAlignedBB.a((double) i - d0, (double) j - d0, (double) k - d0, (double) i + d0, (double) j + d0, (double) k + d0)); if (list != null) { Iterator iterator = list.iterator(); @@ -38,11 +38,11 @@ public class ItemLeash extends Item { while (iterator.hasNext()) { EntityInsentient entityinsentient = (EntityInsentient) iterator.next(); - if (entityinsentient.bL() && entityinsentient.getLeashHolder() == entityhuman) { + if (entityinsentient.bN() && entityinsentient.getLeashHolder() == entityhuman) { if (entityleash == null) { entityleash = EntityLeash.a(world, i, j, k); - // CraftBukkit start + // CraftBukkit start - fire HangingPlaceEvent HangingPlaceEvent event = new HangingPlaceEvent((org.bukkit.entity.Hanging) entityleash.getBukkitEntity(), entityhuman != null ? (org.bukkit.entity.Player) entityhuman.getBukkitEntity() : null, world.getWorld().getBlockAt(i, j, k), org.bukkit.block.BlockFace.SELF); world.getServer().getPluginManager().callEvent(event); diff --git a/src/main/java/net/minecraft/server/ItemMonsterEgg.java b/src/main/java/net/minecraft/server/ItemMonsterEgg.java index a41184ea6a..0adb4e47f6 100644 --- a/src/main/java/net/minecraft/server/ItemMonsterEgg.java +++ b/src/main/java/net/minecraft/server/ItemMonsterEgg.java @@ -19,7 +19,8 @@ public class ItemMonsterEgg extends Item { } public boolean interactWith(ItemStack itemstack, EntityHuman entityhuman, World world, int i, int j, int k, int l, float f, float f1, float f2) { - if (world.isStatic || itemstack.getData() == 48 || itemstack.getData() == 49 || itemstack.getData() == 63 || itemstack.getData() == 64) { // CraftBukkit + // CraftBukkit - check ItemStack data + if (world.isStatic || itemstack.getData() == 48 || itemstack.getData() == 49 || itemstack.getData() == 63 || itemstack.getData() == 64) { return true; } else { Block block = world.getType(i, j, k); @@ -98,7 +99,7 @@ public class ItemMonsterEgg extends Item { public static Entity spawnCreature(World world, int i, double d0, double d1, double d2, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason spawnReason) { // CraftBukkit end - if (!EntityTypes.a.containsKey(Integer.valueOf(i))) { + if (!EntityTypes.eggInfo.containsKey(Integer.valueOf(i))) { return null; } else { Entity entity = null; @@ -109,8 +110,8 @@ public class ItemMonsterEgg extends Item { EntityInsentient entityinsentient = (EntityInsentient) entity; entity.setPositionRotation(d0, d1, d2, MathHelper.g(world.random.nextFloat() * 360.0F), 0.0F); - entityinsentient.aP = entityinsentient.yaw; - entityinsentient.aN = entityinsentient.yaw; + entityinsentient.aO = entityinsentient.yaw; + entityinsentient.aM = entityinsentient.yaw; entityinsentient.a((GroupDataEntity) null); world.addEntity(entity, spawnReason); // CraftBukkit entityinsentient.r(); diff --git a/src/main/java/net/minecraft/server/ItemRedstone.java b/src/main/java/net/minecraft/server/ItemRedstone.java index 78e66fb910..dea1548e29 100644 --- a/src/main/java/net/minecraft/server/ItemRedstone.java +++ b/src/main/java/net/minecraft/server/ItemRedstone.java @@ -42,7 +42,7 @@ public class ItemRedstone extends Item { return false; } else { if (Blocks.REDSTONE_WIRE.canPlace(world, i, j, k)) { - // CraftBukkit start + // CraftBukkit start - fire BlockPlaceEvent // --itemstack.count; // world.setTypeUpdate(i, j, k, Blocks.REDSTONE_WIRE); if (!ItemBlock.processBlockPlace(world, entityhuman, itemstack, i, j, k, Blocks.REDSTONE_WIRE, 0, clickedX, clickedY, clickedZ)) { diff --git a/src/main/java/net/minecraft/server/ItemSeedFood.java b/src/main/java/net/minecraft/server/ItemSeedFood.java index eec8b5f8aa..0b3e5e5048 100644 --- a/src/main/java/net/minecraft/server/ItemSeedFood.java +++ b/src/main/java/net/minecraft/server/ItemSeedFood.java @@ -17,7 +17,7 @@ public class ItemSeedFood extends ItemFood { return false; } else if (entityhuman.a(i, j, k, l, itemstack) && entityhuman.a(i, j + 1, k, l, itemstack)) { if (world.getType(i, j, k) == this.c && world.isEmpty(i, j + 1, k)) { - // CraftBukkit start + // CraftBukkit start - fire BlockPlaceEvent // world.setTypeUpdate(i, j + 1, k, this.b); if (!ItemBlock.processBlockPlace(world, entityhuman, null, i, j + 1, k, this.b, 0, clickedX, clickedY, clickedZ)) { return false; diff --git a/src/main/java/net/minecraft/server/ItemSign.java b/src/main/java/net/minecraft/server/ItemSign.java index 8362602ca4..b04a2de1be 100644 --- a/src/main/java/net/minecraft/server/ItemSign.java +++ b/src/main/java/net/minecraft/server/ItemSign.java @@ -41,7 +41,7 @@ public class ItemSign extends Item { } else if (world.isStatic) { return true; } else { - // CraftBukkit start + // CraftBukkit start - fire BlockPlaceEvent final Block block; if (l == 1) { int i1 = MathHelper.floor((double) ((entityhuman.yaw + 180.0F) * 16.0F / 360.0F) + 0.5D) & 15; diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java index b308e035c2..791467ba51 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java @@ -78,7 +78,7 @@ public final class ItemStack { boolean flag = this.getItem().interactWith(this, entityhuman, world, i, j, k, l, f, f1, f2); if (flag) { - entityhuman.a(StatisticList.E[Item.b(this.item)], 1); + entityhuman.a(StatisticList.USE_ITEM_COUNT[Item.b(this.item)], 1); } return flag; @@ -204,15 +204,15 @@ public final class ItemStack { public void damage(int i, EntityLiving entityliving) { if (!(entityliving instanceof EntityHuman) || !((EntityHuman) entityliving).abilities.canInstantlyBuild) { if (this.g()) { - if (this.isDamaged(i, entityliving.aI())) { + if (this.isDamaged(i, entityliving.aH())) { entityliving.a(this); --this.count; if (entityliving instanceof EntityHuman) { EntityHuman entityhuman = (EntityHuman) entityliving; - entityhuman.a(StatisticList.F[Item.b(this.item)], 1); + entityhuman.a(StatisticList.BREAK_ITEM_COUNT[Item.b(this.item)], 1); if (this.count == 0 && this.getItem() instanceof ItemBow) { - entityhuman.bE(); + entityhuman.bF(); } } @@ -236,7 +236,7 @@ public final class ItemStack { boolean flag = this.item.a(this, entityliving, (EntityLiving) entityhuman); if (flag) { - entityhuman.a(StatisticList.E[Item.b(this.item)], 1); + entityhuman.a(StatisticList.USE_ITEM_COUNT[Item.b(this.item)], 1); } } @@ -244,7 +244,7 @@ public final class ItemStack { boolean flag = this.item.a(this, world, block, i, j, k, entityhuman); if (flag) { - entityhuman.a(StatisticList.E[Item.b(this.item)], 1); + entityhuman.a(StatisticList.USE_ITEM_COUNT[Item.b(this.item)], 1); } } @@ -303,7 +303,7 @@ public final class ItemStack { } public void a(World world, EntityHuman entityhuman, int i) { - entityhuman.a(StatisticList.D[Item.b(this.item)], i); + entityhuman.a(StatisticList.CRAFT_BLOCK_COUNT[Item.b(this.item)], i); this.item.d(this, world, entityhuman); } @@ -480,8 +480,8 @@ public final class ItemStack { NBTTagCompound nbttagcompound = new NBTTagCompound(); this.save(nbttagcompound); - ichatbasecomponent.b().a(new ChatHoverable(EnumHoverAction.SHOW_ITEM, new ChatComponentText(nbttagcompound.toString()))); - ichatbasecomponent.b().setColor(this.w().e); + ichatbasecomponent.getChatModifier().a(new ChatHoverable(EnumHoverAction.SHOW_ITEM, new ChatComponentText(nbttagcompound.toString()))); + ichatbasecomponent.getChatModifier().setColor(this.w().e); } return ichatbasecomponent; diff --git a/src/main/java/net/minecraft/server/ItemWaterLily.java b/src/main/java/net/minecraft/server/ItemWaterLily.java index 2d55d5299a..0b31994370 100644 --- a/src/main/java/net/minecraft/server/ItemWaterLily.java +++ b/src/main/java/net/minecraft/server/ItemWaterLily.java @@ -27,7 +27,7 @@ public class ItemWaterLily extends ItemWithAuxData { } if (world.getType(i, j, k).getMaterial() == Material.WATER && world.getData(i, j, k) == 0 && world.isEmpty(i, j + 1, k)) { - // CraftBukkit start + // CraftBukkit start - fire BlockPlaceEvent // world.setTypeUpdate(i, j + 1, k, Blocks.WATER_LILY); if (!processBlockPlace(world, entityhuman, null, i, j + 1, k, Blocks.WATER_LILY, 0, clickedX, clickedY, clickedZ)) { return itemstack; diff --git a/src/main/java/net/minecraft/server/ItemWorldMap.java b/src/main/java/net/minecraft/server/ItemWorldMap.java index 39d7632c83..c08cccaffb 100644 --- a/src/main/java/net/minecraft/server/ItemWorldMap.java +++ b/src/main/java/net/minecraft/server/ItemWorldMap.java @@ -43,7 +43,7 @@ public class ItemWorldMap extends ItemWorldMapBase { } public void a(World world, Entity entity, WorldMap worldmap) { - // CraftBukkit + // CraftBukkit - world.worldProvider -> ((WorldServer) world) if (((WorldServer) world).dimension == worldmap.map && entity instanceof EntityHuman) { int i = 1 << worldmap.scale; int j = worldmap.centerX; diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java index 6beac826c1..dddd9aa37f 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -53,7 +53,7 @@ public class LoginListener implements PacketLoginInListener { ChatComponentText chatcomponenttext = new ChatComponentText(s); this.networkManager.handle(new PacketLoginOutDisconnect(chatcomponenttext), new GenericFutureListener[0]); - this.networkManager.a((IChatBaseComponent) chatcomponenttext); + this.networkManager.close(chatcomponenttext); } catch (Exception exception) { c.error("Error whilst disconnecting player", exception); } @@ -66,7 +66,7 @@ public class LoginListener implements PacketLoginInListener { this.i = new GameProfile(uuid.toString().replaceAll("-", ""), this.i.getName()); } - // CraftBukkit start + // CraftBukkit start - fire PlayerLoginEvent EntityPlayer s = this.server.getPlayerList().attemptLogin(this, this.i, this.hostname); if (s == null) { @@ -97,7 +97,7 @@ public class LoginListener implements PacketLoginInListener { this.i = packetlogininstart.c(); if (this.server.getOnlineMode() && !this.networkManager.c()) { this.g = EnumProtocolState.KEY; - this.networkManager.handle(new PacketLoginOutEncryptionBegin(this.j, this.server.I().getPublic(), this.e), new GenericFutureListener[0]); + this.networkManager.handle(new PacketLoginOutEncryptionBegin(this.j, this.server.J().getPublic(), this.e), new GenericFutureListener[0]); } else { this.g = EnumProtocolState.READY_TO_ACCEPT; } @@ -105,7 +105,7 @@ public class LoginListener implements PacketLoginInListener { public void a(PacketLoginInEncryptionBegin packetlogininencryptionbegin) { Validate.validState(this.g == EnumProtocolState.KEY, "Unexpected key packet", new Object[0]); - PrivateKey privatekey = this.server.I().getPrivate(); + PrivateKey privatekey = this.server.J().getPrivate(); if (!Arrays.equals(this.e, packetlogininencryptionbegin.b(privatekey))) { throw new IllegalStateException("Invalid nonce!"); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java index 6a01982933..6788c5d3c5 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -46,7 +46,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo private static final Logger h = LogManager.getLogger(); private static MinecraftServer i; public Convertable convertable; // CraftBukkit - private final -> public - private final MojangStatisticsGenerator k = new MojangStatisticsGenerator("server", this, ap()); + private final MojangStatisticsGenerator k = new MojangStatisticsGenerator("server", this, aq()); public File universe; // CraftBukkit - private final -> public private final List m = new ArrayList(); private final ICommandHandler n; @@ -89,7 +89,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo private final MinecraftSessionService S; private long T = 0L; - // CraftBukkit start + // CraftBukkit start - add fields public List worlds = new ArrayList(); public org.bukkit.craftbukkit.CraftServer server; public OptionSet options; @@ -208,7 +208,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo if (j == 0) { IDataManager idatamanager = new ServerNBTManager(server.getWorldContainer(), s1, true); - if (this.P()) { + if (this.Q()) { world = new DemoWorldServer(this, idatamanager, s1, dimension, this.methodProfiler); } else { // world =, b0 to dimension, added Environment and gen @@ -262,7 +262,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldInitEvent(world.getWorld())); world.addIWorldAccess(new WorldManager(this, world)); - if (!this.L()) { + if (!this.M()) { world.getWorldData().setGameType(this.getGamemode()); } @@ -285,7 +285,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo this.b("menu.generatingTerrain"); byte b0 = 0; - // CraftBukkit start + // CraftBukkit start - fire WorldLoadEvent and handle whether or not to keep the spawn in memory for (int m = 0; m < this.worlds.size(); ++m) { WorldServer worldserver = this.worlds.get(m); h.info("Preparing start region for level " + m + " (Seed: " + worldserver.getSeed() + ")"); @@ -294,12 +294,12 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo } ChunkCoordinates chunkcoordinates = worldserver.getSpawn(); - long j = ap(); + long j = aq(); i = 0; for (int k = -192; k <= 192 && this.isRunning(); k += 16) { for (int l = -192; l <= 192 && this.isRunning(); l += 16) { - long i1 = ap(); + long i1 = aq(); if (i1 - j > 1000L) { this.a_("Preparing spawn area", i * 100 / 625); @@ -316,7 +316,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(world.getWorld())); } // CraftBukkit end - this.m(); + this.n(); } public abstract boolean getGenerateStructures(); @@ -329,13 +329,15 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo public abstract int l(); + public abstract boolean m(); + protected void a_(String s, int i) { this.d = s; this.e = i; h.info(s + ": " + i + "%"); } - protected void m() { + protected void n() { this.d = null; this.e = 0; @@ -344,7 +346,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo protected void saveChunks(boolean flag) throws ExceptionWorldConflict { // CraftBukkit - added throws if (!this.L) { - // CraftBukkit start + // CraftBukkit start - fire WorldSaveEvent // WorldServer[] aworldserver = this.worldServer; int i = this.worlds.size(); @@ -376,8 +378,8 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo } // CraftBukkit end - if (this.ag() != null) { - this.ag().b(); + if (this.ah() != null) { + this.ah().b(); } if (this.t != null) { @@ -422,15 +424,15 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo public void run() { try { if (this.init()) { - long i = ap(); + long i = aq(); long j = 0L; this.p.setMOTD(new ChatComponentText(this.motd)); - this.p.setServerInfo(new ServerPingServerData("1.7.2", 4)); + this.p.setServerInfo(new ServerPingServerData("1.7.5", 4)); this.a(this.p); while (this.isRunning) { - long k = ap(); + long k = aq(); long l = k - i; if (l > 2000L && i - this.O >= 15000L) { @@ -448,17 +450,17 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo j += l; i = k; if (this.worlds.get(0).everyoneDeeplySleeping()) { // CraftBukkit - this.t(); + this.u(); j = 0L; } else { while (j > 50L) { MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit j -= 50L; - this.t(); + this.u(); } } - Thread.sleep(1L); + Thread.sleep(Math.max(1L, 50L - j)); this.N = true; } } else { @@ -474,7 +476,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo crashreport = this.b(new CrashReport("Exception in server tick loop", throwable)); } - File file1 = new File(new File(this.r(), "crash-reports"), "crash-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + "-server.txt"); + File file1 = new File(new File(this.s(), "crash-reports"), "crash-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + "-server.txt"); if (crashreport.a(file1)) { h.error("This crash report has been saved to: " + file1.getAbsolutePath()); @@ -496,7 +498,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo } catch (Exception e) { } // CraftBukkit end - this.s(); + this.t(); } } } @@ -518,22 +520,23 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo serverping.setFavicon("data:image/png;base64," + bytebuf1.toString(Charsets.UTF_8)); } catch (Exception exception) { h.error("Couldn\'t load server icon", exception); + } finally { + bytebuf.release(); } } } - protected File r() { + protected File s() { return new File("."); } protected void a(CrashReport crashreport) {} - protected void s() {} + protected void t() {} - protected void t() throws ExceptionWorldConflict { // CraftBukkit - added throws + protected void u() throws ExceptionWorldConflict { // CraftBukkit - added throws long i = System.nanoTime(); - AxisAlignedBB.a().a(); ++this.ticks; if (this.Q) { this.Q = false; @@ -542,12 +545,12 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo } this.methodProfiler.a("root"); - this.u(); + this.v(); if (i - this.T >= 5000000000L) { this.T = i; - this.p.setPlayerSample(new ServerPingPlayerSample(this.C(), this.B())); - GameProfile[] agameprofile = new GameProfile[Math.min(this.B(), 12)]; - int j = MathHelper.nextInt(this.q, 0, this.B() - agameprofile.length); + this.p.setPlayerSample(new ServerPingPlayerSample(this.D(), this.C())); + GameProfile[] agameprofile = new GameProfile[Math.min(this.C(), 12)]; + int j = MathHelper.nextInt(this.q, 0, this.C() - agameprofile.length); for (int k = 0; k < agameprofile.length; ++k) { agameprofile[k] = ((EntityPlayer) this.t.players.get(j + k)).getProfile(); @@ -580,7 +583,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo this.methodProfiler.b(); } - public void u() { + public void v() { this.methodProfiler.a("levels"); // CraftBukkit start @@ -611,7 +614,6 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo this.methodProfiler.a(worldserver.getWorldData().getName()); this.methodProfiler.a("pools"); - worldserver.getVec3DPool().a(); this.methodProfiler.b(); /* Drop global time updates if (this.ticks % 20 == 0) { @@ -652,7 +654,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo } this.methodProfiler.c("connection"); - this.ag().c(); + this.ah().c(); this.methodProfiler.c("players"); this.t.tick(); this.methodProfiler.c("tickables"); @@ -745,7 +747,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo } if (flag) { - dedicatedserver.ay(); + dedicatedserver.az(); } // */ @@ -774,12 +776,12 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo } } - public void w() { + public void x() { // (new ThreadServerApplication(this, "Server thread")).start(); // CraftBukkit - prevent abuse } public File d(String s) { - return new File(this.r(), s); + return new File(this.s(), s); } public void info(String s) { @@ -802,27 +804,27 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo // CraftBukkit end } - public String x() { + public String y() { return this.serverIp; } - public int y() { + public int z() { return this.s; } - public String z() { + public String A() { return this.motd; } public String getVersion() { - return "1.7.2"; - } - - public int B() { - return this.t.getPlayerCount(); + return "1.7.5"; } public int C() { + return this.t.getPlayerCount(); + } + + public int D() { return this.t.getMaxPlayers(); } @@ -857,7 +859,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo // CraftBukkit end } - // CraftBukkit start + // CraftBukkit start - fire RemoteServerCommandEvent public String g(final String s) { // final parameter Waitable waitable = new Waitable() { @Override @@ -981,11 +983,11 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo return this.n; } - public KeyPair I() { + public KeyPair J() { return this.F; } - public int J() { + public int K() { return this.s; } @@ -993,7 +995,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo this.s = i; } - public String K() { + public String L() { return this.G; } @@ -1001,11 +1003,11 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo this.G = s; } - public boolean L() { + public boolean M() { return this.G != null; } - public String M() { + public String N() { return this.H; } @@ -1018,7 +1020,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo } public void a(EnumDifficulty enumdifficulty) { - // CraftBukkit start + // CraftBukkit start - Use worlds list for iteration for (int j = 0; j < this.worlds.size(); ++j) { WorldServer worldserver = this.worlds.get(j); // CraftBukkit end @@ -1027,7 +1029,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo if (worldserver.getWorldData().isHardcore()) { worldserver.difficulty = EnumDifficulty.HARD; worldserver.setSpawnFlags(true, true); - } else if (this.L()) { + } else if (this.M()) { worldserver.difficulty = enumdifficulty; worldserver.setSpawnFlags(worldserver.difficulty != EnumDifficulty.PEACEFUL, true); } else { @@ -1042,7 +1044,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo return true; } - public boolean P() { + public boolean Q() { return this.demoMode; } @@ -1058,7 +1060,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo return this.convertable; } - public void S() { + public void T() { this.L = true; this.getConvertable().d(); @@ -1087,16 +1089,16 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo public void a(MojangStatisticsGenerator mojangstatisticsgenerator) { mojangstatisticsgenerator.a("whitelist_enabled", Boolean.valueOf(false)); mojangstatisticsgenerator.a("whitelist_count", Integer.valueOf(0)); - mojangstatisticsgenerator.a("players_current", Integer.valueOf(this.B())); - mojangstatisticsgenerator.a("players_max", Integer.valueOf(this.C())); + mojangstatisticsgenerator.a("players_current", Integer.valueOf(this.C())); + mojangstatisticsgenerator.a("players_max", Integer.valueOf(this.D())); mojangstatisticsgenerator.a("players_seen", Integer.valueOf(this.t.getSeenPlayers().length)); mojangstatisticsgenerator.a("uses_auth", Boolean.valueOf(this.onlineMode)); - mojangstatisticsgenerator.a("gui_state", this.ai() ? "enabled" : "disabled"); - mojangstatisticsgenerator.a("run_time", Long.valueOf((ap() - mojangstatisticsgenerator.g()) / 60L * 1000L)); + mojangstatisticsgenerator.a("gui_state", this.aj() ? "enabled" : "disabled"); + mojangstatisticsgenerator.a("run_time", Long.valueOf((aq() - mojangstatisticsgenerator.g()) / 60L * 1000L)); mojangstatisticsgenerator.a("avg_tick_ms", Integer.valueOf((int) (MathHelper.a(this.f) * 1.0E-6D))); int i = 0; - // CraftBukkit start + // CraftBukkit start - use worlds list for iteration for (int j = 0; j < this.worlds.size(); ++j) { WorldServer worldserver = this.worlds.get(j); if (worldServer != null) { @@ -1110,7 +1112,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo mojangstatisticsgenerator.a("world[" + i + "][generator_name]", worlddata.getType().name()); mojangstatisticsgenerator.a("world[" + i + "][generator_version]", Integer.valueOf(worlddata.getType().getVersion())); mojangstatisticsgenerator.a("world[" + i + "][height]", Integer.valueOf(this.D)); - mojangstatisticsgenerator.a("world[" + i + "][chunks_loaded]", Integer.valueOf(worldserver.K().getLoadedChunks())); + mojangstatisticsgenerator.a("world[" + i + "][chunks_loaded]", Integer.valueOf(worldserver.L().getLoadedChunks())); ++i; } } @@ -1119,17 +1121,17 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo } public void b(MojangStatisticsGenerator mojangstatisticsgenerator) { - mojangstatisticsgenerator.a("singleplayer", Boolean.valueOf(this.L())); - mojangstatisticsgenerator.a("server_brand", this.getServerModName()); - mojangstatisticsgenerator.a("gui_supported", GraphicsEnvironment.isHeadless() ? "headless" : "supported"); - mojangstatisticsgenerator.a("dedicated", Boolean.valueOf(this.V())); + mojangstatisticsgenerator.b("singleplayer", Boolean.valueOf(this.M())); + mojangstatisticsgenerator.b("server_brand", this.getServerModName()); + mojangstatisticsgenerator.b("gui_supported", GraphicsEnvironment.isHeadless() ? "headless" : "supported"); + mojangstatisticsgenerator.b("dedicated", Boolean.valueOf(this.W())); } public boolean getSnooperEnabled() { return true; } - public abstract boolean V(); + public abstract boolean W(); public boolean getOnlineMode() { return this.server.getOnlineMode(); // CraftBukkit @@ -1202,28 +1204,28 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo } public void a(EnumGamemode enumgamemode) { - // CraftBukkit start + // CraftBukkit start - use worlds list for iteration for (int i = 0; i < this.worlds.size(); ++i) { getServer().worlds.get(i).getWorldData().setGameType(enumgamemode); // CraftBukkit end } } - public ServerConnection ag() { + public ServerConnection ah() { return this.o; } - public boolean ai() { + public boolean aj() { return false; } public abstract String a(EnumGamemode enumgamemode, boolean flag); - public int aj() { + public int ak() { return this.ticks; } - public void ak() { + public void al() { this.Q = true; } @@ -1251,19 +1253,19 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo return this.R; } - public Proxy ao() { + public Proxy ap() { return this.c; } - public static long ap() { + public static long aq() { return System.currentTimeMillis(); } - public int aq() { + public int getIdleTimeout() { return this.E; } - public void d(int i) { + public void setIdleTimeout(int i) { this.E = i; } @@ -1271,23 +1273,23 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo return new ChatComponentText(this.getName()); } - public boolean ar() { + public boolean as() { return true; } - public MinecraftSessionService as() { + public MinecraftSessionService at() { return this.S; } - public ServerPing at() { + public ServerPing au() { return this.p; } - public void au() { + public void av() { this.T = 0L; } - public static Logger av() { + public static Logger getLogger() { return h; } diff --git a/src/main/java/net/minecraft/server/MobEffectList.java b/src/main/java/net/minecraft/server/MobEffectList.java index c6effa9f2f..dbbe63ce79 100644 --- a/src/main/java/net/minecraft/server/MobEffectList.java +++ b/src/main/java/net/minecraft/server/MobEffectList.java @@ -97,8 +97,8 @@ public class MobEffectList { if (!entityliving.world.isStatic) { ((EntityHuman) entityliving).getFoodData().eat(i + 1, 1.0F); } - } else if ((this.id != HEAL.id || entityliving.aR()) && (this.id != HARM.id || !entityliving.aR())) { - if (this.id == HARM.id && !entityliving.aR() || this.id == HEAL.id && entityliving.aR()) { + } else if ((this.id != HEAL.id || entityliving.aQ()) && (this.id != HARM.id || !entityliving.aQ())) { + if (this.id == HARM.id && !entityliving.aQ() || this.id == HEAL.id && entityliving.aQ()) { entityliving.damageEntity(DamageSource.MAGIC, (float) (6 << i)); } } else { @@ -115,8 +115,8 @@ public class MobEffectList { // CraftBukkit end int j; - if ((this.id != HEAL.id || entityliving1.aR()) && (this.id != HARM.id || !entityliving1.aR())) { - if (this.id == HARM.id && !entityliving1.aR() || this.id == HEAL.id && entityliving1.aR()) { + if ((this.id != HEAL.id || entityliving1.aQ()) && (this.id != HARM.id || !entityliving1.aQ())) { + if (this.id == HARM.id && !entityliving1.aQ() || this.id == HEAL.id && entityliving1.aQ()) { j = (int) (d0 * (double) (6 << i) + 0.5D); if (entityliving == null) { entityliving1.damageEntity(DamageSource.MAGIC, (float) j); diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java index 67c3397dd3..06f9b1f247 100644 --- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java +++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java @@ -81,7 +81,7 @@ public abstract class MobSpawnerAbstract { return; } - int j = this.a().a(entity.getClass(), AxisAlignedBB.a().a((double) this.b(), (double) this.c(), (double) this.d(), (double) (this.b() + 1), (double) (this.c() + 1), (double) (this.d() + 1)).grow((double) (this.spawnRange * 2), 4.0D, (double) (this.spawnRange * 2))).size(); + int j = this.a().a(entity.getClass(), AxisAlignedBB.a((double) this.b(), (double) this.c(), (double) this.d(), (double) (this.b() + 1), (double) (this.c() + 1), (double) (this.d() + 1)).grow((double) (this.spawnRange * 2), 4.0D, (double) (this.spawnRange * 2))).size(); if (j >= this.maxNearbyEntities) { this.j(); diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java index 8f829bb969..9ff1694da3 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java @@ -23,98 +23,100 @@ import org.apache.logging.log4j.MarkerManager; public class NetworkManager extends SimpleChannelInboundHandler { - private static final Logger g = LogManager.getLogger(); + private static final Logger i = LogManager.getLogger(); public static final Marker a = MarkerManager.getMarker("NETWORK"); public static final Marker b = MarkerManager.getMarker("NETWORK_PACKETS", a); - public static final AttributeKey c = new AttributeKey("protocol"); - public static final AttributeKey d = new AttributeKey("receivable_packets"); - public static final AttributeKey e = new AttributeKey("sendable_packets"); - public static final NioEventLoopGroup f = new NioEventLoopGroup(0, (new ThreadFactoryBuilder()).setNameFormat("Netty Client IO #%d").setDaemon(true).build()); - private final boolean h; - private final Queue i = Queues.newConcurrentLinkedQueue(); - private final Queue j = Queues.newConcurrentLinkedQueue(); - private Channel k; - private SocketAddress l; - private PacketListener m; - private EnumProtocol n; - private IChatBaseComponent o; + public static final Marker c = MarkerManager.getMarker("NETWORK_STAT", a); + public static final AttributeKey d = new AttributeKey("protocol"); + public static final AttributeKey e = new AttributeKey("receivable_packets"); + public static final AttributeKey f = new AttributeKey("sendable_packets"); + public static final NioEventLoopGroup g = new NioEventLoopGroup(0, (new ThreadFactoryBuilder()).setNameFormat("Netty Client IO #%d").setDaemon(true).build()); + public static final NetworkStatistics h = new NetworkStatistics(); + private final boolean j; + private final Queue k = Queues.newConcurrentLinkedQueue(); + private final Queue l = Queues.newConcurrentLinkedQueue(); + private Channel m; + private SocketAddress n; + private PacketListener o; + private EnumProtocol p; + private IChatBaseComponent q; public NetworkManager(boolean flag) { - this.h = flag; + this.j = flag; } public void channelActive(ChannelHandlerContext channelhandlercontext) throws Exception { // CraftBukkit - throws Exception super.channelActive(channelhandlercontext); - this.k = channelhandlercontext.channel(); - this.l = this.k.remoteAddress(); + this.m = channelhandlercontext.channel(); + this.n = this.m.remoteAddress(); this.a(EnumProtocol.HANDSHAKING); } public void a(EnumProtocol enumprotocol) { - this.n = (EnumProtocol) this.k.attr(c).getAndSet(enumprotocol); - this.k.attr(d).set(enumprotocol.a(this.h)); - this.k.attr(e).set(enumprotocol.b(this.h)); - this.k.config().setAutoRead(true); - g.debug("Enabled auto read"); + this.p = (EnumProtocol) this.m.attr(d).getAndSet(enumprotocol); + this.m.attr(e).set(enumprotocol.a(this.j)); + this.m.attr(f).set(enumprotocol.b(this.j)); + this.m.config().setAutoRead(true); + i.debug("Enabled auto read"); } public void channelInactive(ChannelHandlerContext channelhandlercontext) { - this.a((IChatBaseComponent) (new ChatMessage("disconnect.endOfStream", new Object[0]))); + this.close(new ChatMessage("disconnect.endOfStream", new Object[0])); } public void exceptionCaught(ChannelHandlerContext channelhandlercontext, Throwable throwable) { - this.a((IChatBaseComponent) (new ChatMessage("disconnect.genericReason", new Object[] { "Internal Exception: " + throwable}))); + this.close(new ChatMessage("disconnect.genericReason", new Object[] { "Internal Exception: " + throwable})); } protected void a(ChannelHandlerContext channelhandlercontext, Packet packet) { - if (this.k.isOpen()) { + if (this.m.isOpen()) { if (packet.a()) { - packet.handle(this.m); + packet.handle(this.o); } else { - this.i.add(packet); + this.k.add(packet); } } } public void a(PacketListener packetlistener) { Validate.notNull(packetlistener, "packetListener", new Object[0]); - g.debug("Set listener of {} to {}", new Object[] { this, packetlistener}); - this.m = packetlistener; + i.debug("Set listener of {} to {}", new Object[] { this, packetlistener}); + this.o = packetlistener; } public void handle(Packet packet, GenericFutureListener... agenericfuturelistener) { - if (this.k != null && this.k.isOpen()) { + if (this.m != null && this.m.isOpen()) { this.h(); this.b(packet, agenericfuturelistener); } else { - this.j.add(new QueuedPacket(packet, agenericfuturelistener)); + this.l.add(new QueuedPacket(packet, agenericfuturelistener)); } } private void b(Packet packet, GenericFutureListener[] agenericfuturelistener) { EnumProtocol enumprotocol = EnumProtocol.a(packet); - EnumProtocol enumprotocol1 = (EnumProtocol) this.k.attr(c).get(); + EnumProtocol enumprotocol1 = (EnumProtocol) this.m.attr(d).get(); if (enumprotocol1 != enumprotocol) { - g.debug("Disabled auto read"); - this.k.config().setAutoRead(false); + i.debug("Disabled auto read"); + this.m.config().setAutoRead(false); } - if (this.k.eventLoop().inEventLoop()) { + if (this.m.eventLoop().inEventLoop()) { if (enumprotocol != enumprotocol1) { this.a(enumprotocol); } - this.k.writeAndFlush(packet).addListeners(agenericfuturelistener).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); + this.m.writeAndFlush(packet).addListeners(agenericfuturelistener).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); } else { - this.k.eventLoop().execute(new QueuedProtocolSwitch(this, enumprotocol, enumprotocol1, packet, agenericfuturelistener)); + this.m.eventLoop().execute(new QueuedProtocolSwitch(this, enumprotocol, enumprotocol1, packet, agenericfuturelistener)); } } private void h() { - if (this.k != null && this.k.isOpen()) { - while (!this.j.isEmpty()) { - QueuedPacket queuedpacket = (QueuedPacket) this.j.poll(); + if (this.m != null && this.m.isOpen()) { + while (!this.l.isEmpty()) { + QueuedPacket queuedpacket = (QueuedPacket) this.l.poll(); this.b(QueuedPacket.a(queuedpacket), QueuedPacket.b(queuedpacket)); } @@ -123,69 +125,68 @@ public class NetworkManager extends SimpleChannelInboundHandler { public void a() { this.h(); - EnumProtocol enumprotocol = (EnumProtocol) this.k.attr(c).get(); + EnumProtocol enumprotocol = (EnumProtocol) this.m.attr(d).get(); - if (this.n != enumprotocol) { - if (this.n != null) { - this.m.a(this.n, enumprotocol); + if (this.p != enumprotocol) { + if (this.p != null) { + this.o.a(this.p, enumprotocol); } - this.n = enumprotocol; + this.p = enumprotocol; } - if (this.m != null) { - for (int i = 1000; !this.i.isEmpty() && i >= 0; --i) { - Packet packet = (Packet) this.i.poll(); + if (this.o != null) { + for (int i = 1000; !this.k.isEmpty() && i >= 0; --i) { + Packet packet = (Packet) this.k.poll(); // CraftBukkit start - if (!this.d() || !this.k.config().isAutoRead()) { // Should be isConnected + if (!this.isConnected() || !this.m.config().isAutoRead()) { continue; } // CraftBukkit end - - packet.handle(this.m); + packet.handle(this.o); } - this.m.a(); + this.o.a(); } - this.k.flush(); + this.m.flush(); } public SocketAddress getSocketAddress() { - return this.l; + return this.n; } - public void a(IChatBaseComponent ichatbasecomponent) { - if (this.k.isOpen()) { - this.k.close(); - this.o = ichatbasecomponent; + public void close(IChatBaseComponent ichatbasecomponent) { + if (this.m.isOpen()) { + this.m.close(); + this.q = ichatbasecomponent; } } public boolean c() { - return this.k instanceof LocalChannel || this.k instanceof LocalServerChannel; + return this.m instanceof LocalChannel || this.m instanceof LocalServerChannel; } public void a(SecretKey secretkey) { - this.k.pipeline().addBefore("splitter", "decrypt", new PacketDecrypter(MinecraftEncryption.a(2, secretkey))); - this.k.pipeline().addBefore("prepender", "encrypt", new PacketEncrypter(MinecraftEncryption.a(1, secretkey))); + this.m.pipeline().addBefore("splitter", "decrypt", new PacketDecrypter(MinecraftEncryption.a(2, secretkey))); + this.m.pipeline().addBefore("prepender", "encrypt", new PacketEncrypter(MinecraftEncryption.a(1, secretkey))); } - public boolean d() { - return this.k != null && this.k.isOpen(); + public boolean isConnected() { + return this.m != null && this.m.isOpen(); } public PacketListener getPacketListener() { - return this.m; - } - - public IChatBaseComponent f() { return this.o; } + public IChatBaseComponent f() { + return this.q; + } + public void g() { - this.k.config().setAutoRead(false); + this.m.config().setAutoRead(false); } protected void channelRead0(ChannelHandlerContext channelhandlercontext, Object object) { @@ -193,6 +194,6 @@ public class NetworkManager extends SimpleChannelInboundHandler { } static Channel a(NetworkManager networkmanager) { - return networkmanager.k; + return networkmanager.m; } } diff --git a/src/main/java/net/minecraft/server/PathfinderGoalBreakDoor.java b/src/main/java/net/minecraft/server/PathfinderGoalBreakDoor.java index 60be62b475..35d54982e1 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalBreakDoor.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalBreakDoor.java @@ -31,7 +31,7 @@ public class PathfinderGoalBreakDoor extends PathfinderGoalDoorInteract { public void e() { super.e(); - if (this.a.aI().nextInt(20) == 0) { + if (this.a.aH().nextInt(20) == 0) { this.a.world.triggerEffect(1010, this.b, this.c, this.d, 0); } diff --git a/src/main/java/net/minecraft/server/PathfinderGoalBreed.java b/src/main/java/net/minecraft/server/PathfinderGoalBreed.java index 50d4ff96dd..eb48c70c29 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalBreed.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalBreed.java @@ -20,7 +20,7 @@ public class PathfinderGoalBreed extends PathfinderGoal { } public boolean a() { - if (!this.d.cc()) { + if (!this.d.ce()) { return false; } else { this.e = this.f(); @@ -29,7 +29,7 @@ public class PathfinderGoalBreed extends PathfinderGoal { } public boolean b() { - return this.e.isAlive() && this.e.cc() && this.b < 60; + return this.e.isAlive() && this.e.ce() && this.b < 60; } public void d() { @@ -38,10 +38,10 @@ public class PathfinderGoalBreed extends PathfinderGoal { } public void e() { - this.d.getControllerLook().a(this.e, 10.0F, (float) this.d.x()); + this.d.getControllerLook().a(this.e, 10.0F, (float) this.d.bv()); this.d.getNavigation().a((Entity) this.e, this.c); ++this.b; - if (this.b >= 60 && this.d.e(this.e) < 9.0D) { + if (this.b >= 60 && this.d.f(this.e) < 9.0D) { this.g(); } } @@ -56,9 +56,9 @@ public class PathfinderGoalBreed extends PathfinderGoal { while (iterator.hasNext()) { EntityAnimal entityanimal1 = (EntityAnimal) iterator.next(); - if (this.d.mate(entityanimal1) && this.d.e(entityanimal1) < d0) { + if (this.d.mate(entityanimal1) && this.d.f(entityanimal1) < d0) { entityanimal = entityanimal1; - d0 = this.d.e(entityanimal1); + d0 = this.d.f(entityanimal1); } } @@ -74,10 +74,10 @@ public class PathfinderGoalBreed extends PathfinderGoal { entityageable.persistent = true; } // CraftBukkit end - EntityHuman entityhuman = this.d.cb(); + EntityHuman entityhuman = this.d.cd(); - if (entityhuman == null && this.e.cb() != null) { - entityhuman = this.e.cb(); + if (entityhuman == null && this.e.cd() != null) { + entityhuman = this.e.cd(); } if (entityhuman != null) { @@ -89,12 +89,12 @@ public class PathfinderGoalBreed extends PathfinderGoal { this.d.setAge(6000); this.e.setAge(6000); - this.d.cd(); - this.e.cd(); + this.d.cf(); + this.e.cf(); entityageable.setAge(-24000); entityageable.setPositionRotation(this.d.locX, this.d.locY, this.d.locZ, 0.0F, 0.0F); this.a.addEntity(entityageable, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.BREEDING); // CraftBukkit - added SpawnReason - Random random = this.d.aI(); + Random random = this.d.aH(); for (int i = 0; i < 7; ++i) { double d0 = random.nextGaussian() * 0.02D; diff --git a/src/main/java/net/minecraft/server/PathfinderGoalEatTile.java b/src/main/java/net/minecraft/server/PathfinderGoalEatTile.java index 5b75a158f3..54813cd326 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalEatTile.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalEatTile.java @@ -18,7 +18,7 @@ public class PathfinderGoalEatTile extends PathfinderGoal { } public boolean a() { - if (this.b.aI().nextInt(this.b.isBaby() ? 50 : 1000) != 0) { + if (this.b.aH().nextInt(this.b.isBaby() ? 50 : 1000) != 0) { return false; } else { int i = MathHelper.floor(this.b.locX); diff --git a/src/main/java/net/minecraft/server/PathfinderGoalMakeLove.java b/src/main/java/net/minecraft/server/PathfinderGoalMakeLove.java index 62891b565c..e4e0817584 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalMakeLove.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalMakeLove.java @@ -17,7 +17,7 @@ public class PathfinderGoalMakeLove extends PathfinderGoal { public boolean a() { if (this.b.getAge() != 0) { return false; - } else if (this.b.aI().nextInt(500) != 0) { + } else if (this.b.aH().nextInt(500) != 0) { return false; } else { this.a = this.d.villages.getClosestVillage(MathHelper.floor(this.b.locX), MathHelper.floor(this.b.locY), MathHelper.floor(this.b.locZ), 0); @@ -56,13 +56,13 @@ public class PathfinderGoalMakeLove extends PathfinderGoal { public void e() { --this.e; this.b.getControllerLook().a(this.c, 10.0F, 30.0F); - if (this.b.e(this.c) > 2.25D) { + if (this.b.f(this.c) > 2.25D) { this.b.getNavigation().a((Entity) this.c, 0.25D); - } else if (this.e == 0 && this.c.bY()) { + } else if (this.e == 0 && this.c.ca()) { this.g(); } - if (this.b.aI().nextInt(35) == 0) { + if (this.b.aH().nextInt(35) == 0) { this.d.broadcastEntityEffect(this.b, (byte) 12); } } diff --git a/src/main/java/net/minecraft/server/PathfinderGoalMeleeAttack.java b/src/main/java/net/minecraft/server/PathfinderGoalMeleeAttack.java index f98e994873..6dd1cd5098 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalMeleeAttack.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalMeleeAttack.java @@ -74,11 +74,11 @@ public class PathfinderGoalMeleeAttack extends PathfinderGoal { double d1 = (double) (this.b.width * 2.0F * this.b.width * 2.0F + entityliving.width); --this.h; - if ((this.e || this.b.getEntitySenses().canSee(entityliving)) && this.h <= 0 && (this.i == 0.0D && this.j == 0.0D && this.k == 0.0D || entityliving.e(this.i, this.j, this.k) >= 1.0D || this.b.aI().nextFloat() < 0.05F)) { + if ((this.e || this.b.getEntitySenses().canSee(entityliving)) && this.h <= 0 && (this.i == 0.0D && this.j == 0.0D && this.k == 0.0D || entityliving.e(this.i, this.j, this.k) >= 1.0D || this.b.aH().nextFloat() < 0.05F)) { this.i = entityliving.locX; this.j = entityliving.boundingBox.b; this.k = entityliving.locZ; - this.h = 4 + this.b.aI().nextInt(7); + this.h = 4 + this.b.aH().nextInt(7); if (d0 > 1024.0D) { this.h += 10; } else if (d0 > 256.0D) { @@ -93,11 +93,11 @@ public class PathfinderGoalMeleeAttack extends PathfinderGoal { this.c = Math.max(this.c - 1, 0); if (d0 <= d1 && this.c <= 20) { this.c = 20; - if (this.b.be() != null) { - this.b.ba(); + if (this.b.bd() != null) { + this.b.aZ(); } - this.b.m(entityliving); + this.b.n(entityliving); } } } diff --git a/src/main/java/net/minecraft/server/PathfinderGoalPanic.java b/src/main/java/net/minecraft/server/PathfinderGoalPanic.java index 082e7e484a..905746491b 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalPanic.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalPanic.java @@ -23,9 +23,9 @@ public class PathfinderGoalPanic extends PathfinderGoal { if (vec3d == null) { return false; } else { - this.c = vec3d.c; - this.d = vec3d.d; - this.e = vec3d.e; + this.c = vec3d.a; + this.d = vec3d.b; + this.e = vec3d.c; return true; } } @@ -37,7 +37,7 @@ public class PathfinderGoalPanic extends PathfinderGoal { public boolean b() { // CraftBukkit start - introduce a temporary timeout hack until this is fixed properly - if ((this.a.ticksLived - this.a.aK()) > 100) { + if ((this.a.ticksLived - this.a.aJ()) > 100) { this.a.b((EntityLiving) null); return false; } diff --git a/src/main/java/net/minecraft/server/PathfinderGoalSit.java b/src/main/java/net/minecraft/server/PathfinderGoalSit.java index c518a01a64..ca88feafe3 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalSit.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalSit.java @@ -13,14 +13,14 @@ public class PathfinderGoalSit extends PathfinderGoal { public boolean a() { if (!this.entity.isTamed()) { return this.willSit && this.entity.getGoalTarget() == null; // CraftBukkit - Allow sitting for wild animals - } else if (this.entity.M()) { + } else if (this.entity.L()) { return false; } else if (!this.entity.onGround) { return false; } else { EntityLiving entityliving = this.entity.getOwner(); - return entityliving == null ? true : (this.entity.e(entityliving) < 144.0D && entityliving.getLastDamager() != null ? false : this.willSit); + return entityliving == null ? true : (this.entity.f(entityliving) < 144.0D && entityliving.getLastDamager() != null ? false : this.willSit); } } diff --git a/src/main/java/net/minecraft/server/PathfinderGoalTame.java b/src/main/java/net/minecraft/server/PathfinderGoalTame.java index 37ddec7812..bf5c2d9706 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalTame.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalTame.java @@ -21,9 +21,9 @@ public class PathfinderGoalTame extends PathfinderGoal { if (vec3d == null) { return false; } else { - this.c = vec3d.c; - this.d = vec3d.d; - this.e = vec3d.e; + this.c = vec3d.a; + this.d = vec3d.b; + this.e = vec3d.c; return true; } } else { @@ -40,13 +40,13 @@ public class PathfinderGoalTame extends PathfinderGoal { } public void e() { - if (this.entity.aI().nextInt(50) == 0) { + if (this.entity.aH().nextInt(50) == 0) { if (this.entity.passenger instanceof EntityHuman) { int i = this.entity.getTemper(); int j = this.entity.getMaxDomestication(); - // CraftBukkit - if (j > 0 && this.entity.aI().nextInt(j) < i && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTameEvent(this.entity, (EntityHuman) this.entity.passenger).isCancelled() && this.entity.passenger instanceof EntityHuman) { + // CraftBukkit - fire EntityTameEvent + if (j > 0 && this.entity.aH().nextInt(j) < i && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTameEvent(this.entity, (EntityHuman) this.entity.passenger).isCancelled() && this.entity.passenger instanceof EntityHuman) { this.entity.h((EntityHuman) this.entity.passenger); this.entity.world.broadcastEntityEffect(this.entity, (byte) 7); return; @@ -65,7 +65,7 @@ public class PathfinderGoalTame extends PathfinderGoal { } // this.entity.passenger = null; // CraftBukkit end - this.entity.cH(); + this.entity.cJ(); this.entity.world.broadcastEntityEffect(this.entity, (byte) 6); } } diff --git a/src/main/java/net/minecraft/server/PathfinderGoalTarget.java b/src/main/java/net/minecraft/server/PathfinderGoalTarget.java index c7698f7a41..84122eb72b 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalTarget.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalTarget.java @@ -36,7 +36,7 @@ public abstract class PathfinderGoalTarget extends PathfinderGoal { } else { double d0 = this.f(); - if (this.c.e(entityliving) > d0 * d0) { + if (this.c.f(entityliving) > d0 * d0) { return false; } else { if (this.d) { @@ -144,7 +144,7 @@ public abstract class PathfinderGoalTarget extends PathfinderGoal { } private boolean a(EntityLiving entityliving) { - this.e = 10 + this.c.aI().nextInt(5); + this.e = 10 + this.c.aH().nextInt(5); PathEntity pathentity = this.c.getNavigation().a(entityliving); if (pathentity == null) { diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java index db688eca43..3cd80660bc 100644 --- a/src/main/java/net/minecraft/server/PlayerChunk.java +++ b/src/main/java/net/minecraft/server/PlayerChunk.java @@ -17,7 +17,7 @@ class PlayerChunk { private int f; private long g; final PlayerChunkMap playerChunkMap; - // CraftBukkit start + // CraftBukkit start - add fields private final HashMap players = new HashMap(); private boolean loaded = false; private Runnable loadedRunnable = new Runnable() { @@ -37,14 +37,14 @@ class PlayerChunk { public void a(final EntityPlayer entityplayer) { // CraftBukkit - added final to argument if (this.b.contains(entityplayer)) { - throw new IllegalStateException("Failed to add player. " + entityplayer + " already is in chunk " + this.location.x + ", " + this.location.z); + PlayerChunkMap.c().debug("Failed to add player. {} already is in chunk {}, {}", new Object[] { entityplayer, Integer.valueOf(this.location.x), Integer.valueOf(this.location.z)}); } else { if (this.b.isEmpty()) { this.g = PlayerChunkMap.a(this.playerChunkMap).getTime(); } this.b.add(entityplayer); - // CraftBukkit start + // CraftBukkit start - use async chunk io Runnable playerRunnable; if (this.loaded) { playerRunnable = null; diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java index 4e0398c756..90776db4ef 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -1,6 +1,7 @@ package net.minecraft.server; import java.util.ArrayList; +import java.util.Iterator; import java.util.List; // CraftBukkit start @@ -9,27 +10,25 @@ import java.util.Queue; import java.util.LinkedList; // CraftBukkit end +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + public class PlayerChunkMap { + private static final Logger a = LogManager.getLogger(); private final WorldServer world; private final List managedPlayers = new ArrayList(); - private final LongHashMap c = new LongHashMap(); - private final Queue d = new java.util.concurrent.ConcurrentLinkedQueue(); // CraftBukkit ArrayList -> ConcurrentLinkedQueue + private final LongHashMap d = new LongHashMap(); private final Queue e = new java.util.concurrent.ConcurrentLinkedQueue(); // CraftBukkit ArrayList -> ConcurrentLinkedQueue - private final int f; - private long g; - private final int[][] h = new int[][] { { 1, 0}, { 0, 1}, { -1, 0}, { 0, -1}}; - private boolean wasNotEmpty; // CraftBukkit + private final Queue f = new java.util.concurrent.ConcurrentLinkedQueue(); // CraftBukkit ArrayList -> ConcurrentLinkedQueue + private int g; + private long h; + private final int[][] i = new int[][] { { 1, 0}, { 0, 1}, { -1, 0}, { 0, -1}}; + private boolean wasNotEmpty; // CraftBukkit - add field - public PlayerChunkMap(WorldServer worldserver, int i) { - if (i > 15) { - throw new IllegalArgumentException("Too big view radius!"); - } else if (i < 3) { - throw new IllegalArgumentException("Too small view radius!"); - } else { - this.f = i; - this.world = worldserver; - } + public PlayerChunkMap(WorldServer worldserver) { + this.world = worldserver; + this.a(worldserver.getMinecraftServer().getPlayerList().o()); } public WorldServer a() { @@ -41,18 +40,18 @@ public class PlayerChunkMap { int j; PlayerChunk playerchunk; - if (i - this.g > 8000L) { - this.g = i; + if (i - this.h > 8000L) { + this.h = i; // CraftBukkit start - Use iterator - java.util.Iterator iterator = this.e.iterator(); + java.util.Iterator iterator = this.f.iterator(); while (iterator.hasNext()) { playerchunk = (PlayerChunk) iterator.next(); playerchunk.b(); playerchunk.a(); } } else { - java.util.Iterator iterator = this.d.iterator(); + java.util.Iterator iterator = this.e.iterator(); while (iterator.hasNext()) { playerchunk = (PlayerChunk) iterator.next(); @@ -62,13 +61,13 @@ public class PlayerChunkMap { } } - // this.d.clear(); // CraftBukkit - Removals are already covered + // this.e.clear(); // CraftBukkit - Removals are already covered if (this.managedPlayers.isEmpty()) { if (!wasNotEmpty) return; // CraftBukkit - Only do unload when we go from non-empty to empty WorldProvider worldprovider = this.world.worldProvider; if (!worldprovider.e()) { - this.world.chunkProviderServer.a(); + this.world.chunkProviderServer.b(); } // CraftBukkit start wasNotEmpty = false; @@ -78,19 +77,25 @@ public class PlayerChunkMap { // CraftBukkit end } + public boolean a(int i, int j) { + long k = (long) i + 2147483647L | (long) j + 2147483647L << 32; + + return this.d.getEntry(k) != null; + } + private PlayerChunk a(int i, int j, boolean flag) { long k = (long) i + 2147483647L | (long) j + 2147483647L << 32; - PlayerChunk playerchunk = (PlayerChunk) this.c.getEntry(k); + PlayerChunk playerchunk = (PlayerChunk) this.d.getEntry(k); if (playerchunk == null && flag) { playerchunk = new PlayerChunk(this, i, j); - this.c.put(k, playerchunk); - this.e.add(playerchunk); + this.d.put(k, playerchunk); + this.f.add(playerchunk); } return playerchunk; } - // CraftBukkit start + // CraftBukkit start - add method public final boolean isChunkInUse(int x, int z) { PlayerChunk pi = a(x, z, false); if (pi != null) { @@ -119,8 +124,8 @@ public class PlayerChunkMap { // CraftBukkit start - Load nearby chunks first List chunkList = new LinkedList(); - for (int k = i - this.f; k <= i + this.f; ++k) { - for (int l = j - this.f; l <= j + this.f; ++l) { + for (int k = i - this.g; k <= i + this.g; ++k) { + for (int l = j - this.g; l <= j + this.g; ++l) { chunkList.add(new ChunkCoordIntPair(k, l)); } } @@ -138,7 +143,7 @@ public class PlayerChunkMap { public void b(EntityPlayer entityplayer) { ArrayList arraylist = new ArrayList(entityplayer.chunkCoordIntPairQueue); int i = 0; - int j = this.f; + int j = this.g; int k = (int) entityplayer.locX >> 4; int l = (int) entityplayer.locZ >> 4; int i1 = 0; @@ -154,7 +159,7 @@ public class PlayerChunkMap { for (k1 = 1; k1 <= j * 2; ++k1) { for (int l1 = 0; l1 < 2; ++l1) { - int[] aint = this.h[i++ % 4]; + int[] aint = this.i[i++ % 4]; for (int i2 = 0; i2 < k1; ++i2) { i1 += aint[0]; @@ -170,8 +175,8 @@ public class PlayerChunkMap { i %= 4; for (k1 = 0; k1 < j * 2; ++k1) { - i1 += this.h[i][0]; - j1 += this.h[i][1]; + i1 += this.i[i][0]; + j1 += this.i[i][1]; chunkcoordintpair = PlayerChunk.a(this.a(k + i1, l + j1, true)); if (arraylist.contains(chunkcoordintpair)) { entityplayer.chunkCoordIntPairQueue.add(chunkcoordintpair); @@ -183,8 +188,8 @@ public class PlayerChunkMap { int i = (int) entityplayer.d >> 4; int j = (int) entityplayer.e >> 4; - for (int k = i - this.f; k <= i + this.f; ++k) { - for (int l = j - this.f; l <= j + this.f; ++l) { + for (int k = i - this.g; k <= i + this.g; ++k) { + for (int l = j - this.g; l <= j + this.g; ++l) { PlayerChunk playerchunk = this.a(k, l, false); if (playerchunk != null) { @@ -213,7 +218,7 @@ public class PlayerChunkMap { if (d2 >= 64.0D) { int k = (int) entityplayer.d >> 4; int l = (int) entityplayer.e >> 4; - int i1 = this.f; + int i1 = this.g; int j1 = i - k; int k1 = j - l; List chunksToLoad = new LinkedList(); // CraftBukkit @@ -256,27 +261,69 @@ public class PlayerChunkMap { public boolean a(EntityPlayer entityplayer, int i, int j) { PlayerChunk playerchunk = this.a(i, j, false); - return playerchunk == null ? false : PlayerChunk.b(playerchunk).contains(entityplayer) && !entityplayer.chunkCoordIntPairQueue.contains(PlayerChunk.a(playerchunk)); + return playerchunk != null && PlayerChunk.b(playerchunk).contains(entityplayer) && !entityplayer.chunkCoordIntPairQueue.contains(PlayerChunk.a(playerchunk)); + } + + public void a(int i) { + i = MathHelper.a(i, 3, 20); + if (i != this.g) { + int j = i - this.g; + Iterator iterator = this.managedPlayers.iterator(); + + while (iterator.hasNext()) { + EntityPlayer entityplayer = (EntityPlayer) iterator.next(); + int k = (int) entityplayer.locX >> 4; + int l = (int) entityplayer.locZ >> 4; + int i1; + int j1; + + if (j > 0) { + for (i1 = k - i; i1 <= k + i; ++i1) { + for (j1 = l - i; j1 <= l + i; ++j1) { + PlayerChunk playerchunk = this.a(i1, j1, true); + + if (!PlayerChunk.b(playerchunk).contains(entityplayer)) { + playerchunk.a(entityplayer); + } + } + } + } else { + for (i1 = k - this.g; i1 <= k + this.g; ++i1) { + for (j1 = l - this.g; j1 <= l + this.g; ++j1) { + if (!this.a(i1, j1, k, l, i)) { + this.a(i1, j1, true).b(entityplayer); + } + } + } + } + } + + this.g = i; + } } public static int getFurthestViewableBlock(int i) { return i * 16 - 16; } + static Logger c() { + return a; + } + static WorldServer a(PlayerChunkMap playerchunkmap) { return playerchunkmap.world; } static LongHashMap b(PlayerChunkMap playerchunkmap) { - return playerchunkmap.c; + return playerchunkmap.d; } static Queue c(PlayerChunkMap playermanager) { // CraftBukkit List -> Queue - return playermanager.e; + return playermanager.f; } static Queue d(PlayerChunkMap playermanager) { // CraftBukkit List -> Queue - return playermanager.d; + return playermanager.e; } // CraftBukkit start - Sorter to load nearby chunks first diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java index 3e8517c6b8..10c2ee7200 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -87,7 +87,7 @@ public class PlayerConnection implements PacketPlayInListener { this.player = entityplayer; entityplayer.playerConnection = this; - // CraftBukkit start + // CraftBukkit start - add fields and methods this.server = minecraftserver.server; } @@ -151,7 +151,7 @@ public class PlayerConnection implements PacketPlayInListener { } public void disconnect(String s) { - // CraftBukkit start + // CraftBukkit start - fire PlayerKickEvent String leaveMessage = EnumChatFormat.YELLOW + this.player.getName() + " left the game."; PlayerKickEvent event = new PlayerKickEvent(this.server.getPlayer(this.player), s, leaveMessage); @@ -199,7 +199,7 @@ public class PlayerConnection implements PacketPlayInListener { } } - // CraftBukkit start + // CraftBukkit start - fire PlayerMoveEvent Player player = this.getPlayer(); Location from = new Location(player.getWorld(), lastPosX, lastPosY, lastPosZ, lastYaw, lastPitch); // Get the Players previous Event location. Location to = player.getLocation().clone(); // Start off the To location as the Players current location. @@ -266,7 +266,7 @@ public class PlayerConnection implements PacketPlayInListener { float f = this.player.yaw; float f1 = this.player.pitch; - this.player.vehicle.ac(); + this.player.vehicle.ab(); d1 = this.player.locX; d2 = this.player.locY; d3 = this.player.locZ; @@ -277,10 +277,10 @@ public class PlayerConnection implements PacketPlayInListener { this.player.onGround = packetplayinflying.i(); this.player.i(); - this.player.W = 0.0F; + this.player.V = 0.0F; this.player.setLocation(d1, d2, d3, f, f1); if (this.player.vehicle != null) { - this.player.vehicle.ac(); + this.player.vehicle.ab(); } this.minecraftServer.getPlayerList().d(this.player); @@ -356,7 +356,7 @@ public class PlayerConnection implements PacketPlayInListener { // CraftBukkit end double d10 = d7 * d7 + d8 * d8 + d9 * d9; - if (d10 > 100.0D && this.checkMovement && (!this.minecraftServer.L() || !this.minecraftServer.K().equals(this.player.getName()))) { // CraftBukkit - Added this.checkMovement condition to solve this check being triggered by teleports + if (d10 > 100.0D && this.checkMovement && (!this.minecraftServer.M() || !this.minecraftServer.L().equals(this.player.getName()))) { // CraftBukkit - Added this.checkMovement condition to solve this check being triggered by teleports c.warn(this.player.getName() + " moved too quickly! " + d4 + "," + d5 + "," + d6 + " (" + d7 + ", " + d8 + ", " + d9 + ")"); this.a(this.y, this.z, this.q, this.player.yaw, this.player.pitch); return; @@ -366,7 +366,7 @@ public class PlayerConnection implements PacketPlayInListener { boolean flag = worldserver.getCubes(this.player, this.player.boundingBox.clone().shrink((double) f4, (double) f4, (double) f4)).isEmpty(); if (this.player.onGround && !packetplayinflying.i() && d5 > 0.0D) { - this.player.bj(); + this.player.bi(); } this.player.move(d4, d5, d6); @@ -474,9 +474,9 @@ public class PlayerConnection implements PacketPlayInListener { if (this.player.dead) return; // CraftBukkit WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension); - this.player.w(); + this.player.v(); if (packetplayinblockdig.g() == 4) { - // CraftBukkit start + // CraftBukkit start - limit how quickly items can be dropped // If the ticks aren't the same then the count starts from 0 and we update the lastDropTick. if (this.lastDropTick != MinecraftServer.currentTick) { this.dropCount = 0; @@ -495,7 +495,7 @@ public class PlayerConnection implements PacketPlayInListener { } else if (packetplayinblockdig.g() == 3) { this.player.a(true); } else if (packetplayinblockdig.g() == 5) { - this.player.by(); + this.player.bz(); } else { boolean flag = false; @@ -534,7 +534,7 @@ public class PlayerConnection implements PacketPlayInListener { if (!this.minecraftServer.a(worldserver, i, j, k, this.player)) { this.player.playerInteractManager.dig(i, j, k, packetplayinblockdig.f()); } else { - // CraftBukkit start + // CraftBukkit start - fire PlayerInteractEvent CraftEventFactory.callPlayerInteractEvent(this.player, Action.LEFT_CLICK_BLOCK, i, j, k, packetplayinblockdig.f(), this.player.inventory.getItemInHand()); this.player.playerConnection.sendPacket(new PacketPlayOutBlockChange(i, j, k, worldserver)); // Update any tile entity data for this block @@ -593,7 +593,7 @@ public class PlayerConnection implements PacketPlayInListener { int k = packetplayinblockplace.e(); int l = packetplayinblockplace.getFace(); - this.player.w(); + this.player.v(); if (packetplayinblockplace.getFace() == 255) { if (itemstack == null) { return; @@ -614,7 +614,7 @@ public class PlayerConnection implements PacketPlayInListener { } else if (packetplayinblockplace.d() >= this.minecraftServer.getMaxBuildHeight() - 1 && (packetplayinblockplace.getFace() == 1 || packetplayinblockplace.d() >= this.minecraftServer.getMaxBuildHeight())) { ChatMessage chatmessage = new ChatMessage("build.tooHigh", new Object[] { Integer.valueOf(this.minecraftServer.getMaxBuildHeight())}); - chatmessage.b().setColor(EnumChatFormat.RED); + chatmessage.getChatModifier().setColor(EnumChatFormat.RED); this.player.playerConnection.sendPacket(new PacketPlayOutChat(chatmessage)); flag = true; } else { @@ -667,12 +667,12 @@ public class PlayerConnection implements PacketPlayInListener { } if (itemstack == null || itemstack.n() == 0) { - this.player.h = true; + this.player.g = true; this.player.inventory.items[this.player.inventory.itemInHandIndex] = ItemStack.b(this.player.inventory.items[this.player.inventory.itemInHandIndex]); Slot slot = this.player.activeContainer.a((IInventory) this.player.inventory, this.player.inventory.itemInHandIndex); this.player.activeContainer.b(); - this.player.h = false; + this.player.g = false; // CraftBukkit - TODO CHECK IF NEEDED -- new if structure might not need 'always'. Kept it in for now, but may be able to remove in future if (!ItemStack.matches(this.player.inventory.getItemInHand(), packetplayinblockplace.getItemStack()) || always) { this.sendPacket(new PacketPlayOutSetSlot(this.player.activeContainer.windowId, slot.rawSlotIndex, this.player.inventory.getItemInHand())); @@ -689,12 +689,12 @@ public class PlayerConnection implements PacketPlayInListener { } // CraftBukkit end c.info(this.player.getName() + " lost connection: " + ichatbasecomponent.c()); // CraftBukkit - Don't toString the component - this.minecraftServer.au(); + this.minecraftServer.av(); // CraftBukkit start - Replace vanilla quit message handling with our own. /* ChatMessage chatmessage = new ChatMessage("multiplayer.player.left", new Object[] { this.player.getScoreboardDisplayName()}); - chatmessage.b().setColor(EnumChatFormat.YELLOW); + chatmessage.getChatModifier().setColor(EnumChatFormat.YELLOW); this.minecraftServer.getPlayerList().sendMessage(chatmessage); */ @@ -704,7 +704,7 @@ public class PlayerConnection implements PacketPlayInListener { this.minecraftServer.getPlayerList().sendMessage(CraftChatMessage.fromString(quitMessage)); } // CraftBukkit end - if (this.minecraftServer.L() && this.player.getName().equals(this.minecraftServer.K())) { + if (this.minecraftServer.M() && this.player.getName().equals(this.minecraftServer.L())) { c.info("Stopping singleplayer server as player logged out"); this.minecraftServer.safeShutdown(); } @@ -753,13 +753,13 @@ public class PlayerConnection implements PacketPlayInListener { this.server.getPluginManager().callEvent(event); if (event.isCancelled()) { this.sendPacket(new PacketPlayOutHeldItemSlot(this.player.inventory.itemInHandIndex)); - this.player.w(); + this.player.v(); return; } // CraftBukkit end this.player.inventory.itemInHandIndex = packetplayinhelditemslot.c(); - this.player.w(); + this.player.v(); } else { c.warn(this.player.getName() + " tried to set an invalid carried item"); this.disconnect("Nope!"); // CraftBukkit @@ -770,10 +770,10 @@ public class PlayerConnection implements PacketPlayInListener { if (this.player.dead || this.player.getChatFlags() == EnumChatVisibility.HIDDEN) { // CraftBukkit - dead men tell no tales ChatMessage chatmessage = new ChatMessage("chat.cannotSend", new Object[0]); - chatmessage.b().setColor(EnumChatFormat.RED); + chatmessage.getChatModifier().setColor(EnumChatFormat.RED); this.sendPacket(new PacketPlayOutChat(chatmessage)); } else { - this.player.w(); + this.player.v(); String s = packetplayinchat.c(); s = StringUtils.normalizeSpace(s); @@ -822,7 +822,7 @@ public class PlayerConnection implements PacketPlayInListener { } else if (this.player.getChatFlags() == EnumChatVisibility.SYSTEM) { // Re-add "Command Only" flag check ChatMessage chatmessage = new ChatMessage("chat.cannotSend", new Object[0]); - chatmessage.b().setColor(EnumChatFormat.RED); + chatmessage.getChatModifier().setColor(EnumChatFormat.RED); this.sendPacket(new PacketPlayOutChat(chatmessage)); } else if (true) { this.chat(s, packetplayinchat.a()); @@ -862,7 +862,7 @@ public class PlayerConnection implements PacketPlayInListener { } } - // CraftBukkit start + // CraftBukkit start - add method public void chat(String s, boolean async) { if (s.isEmpty() || this.player.getChatFlags() == EnumChatVisibility.HIDDEN) { return; @@ -937,7 +937,7 @@ public class PlayerConnection implements PacketPlayInListener { // CraftBukkit end private void handleCommand(String s) { - // CraftBukkit start + // CraftBukkit start - whole method CraftPlayer player = this.getPlayer(); PlayerCommandPreprocessEvent event = new PlayerCommandPreprocessEvent(player, s, new LazyPlayerSet()); @@ -948,7 +948,7 @@ public class PlayerConnection implements PacketPlayInListener { } try { - this.c.info(event.getPlayer().getName() + " issued server command: " + event.getMessage()); // CraftBukkit + this.c.info(event.getPlayer().getName() + " issued server command: " + event.getMessage()); if (this.server.dispatchCommand(event.getPlayer(), event.getMessage().substring(1))) { return; } @@ -963,7 +963,7 @@ public class PlayerConnection implements PacketPlayInListener { public void a(PacketPlayInArmAnimation packetplayinarmanimation) { if (this.player.dead) return; // CraftBukkit - this.player.w(); + this.player.v(); if (packetplayinarmanimation.d() == 1) { // CraftBukkit start - Raytrace to look for 'rogue armswings' float f = 1.0F; @@ -972,7 +972,7 @@ public class PlayerConnection implements PacketPlayInListener { double d0 = this.player.lastX + (this.player.locX - this.player.lastX) * (double) f; double d1 = this.player.lastY + (this.player.locY - this.player.lastY) * (double) f + 1.62D - (double) this.player.height; double d2 = this.player.lastZ + (this.player.locZ - this.player.lastZ) * (double) f; - Vec3D vec3d = this.player.world.getVec3DPool().create(d0, d1, d2); + Vec3D vec3d = Vec3D.a(d0, d1, d2); float f3 = MathHelper.cos(-f2 * 0.017453292F - 3.1415927F); float f4 = MathHelper.sin(-f2 * 0.017453292F - 3.1415927F); @@ -995,7 +995,7 @@ public class PlayerConnection implements PacketPlayInListener { if (event.isCancelled()) return; // CraftBukkit end - this.player.ba(); + this.player.aZ(); } } @@ -1003,7 +1003,7 @@ public class PlayerConnection implements PacketPlayInListener { // CraftBukkit start if (this.player.dead) return; - this.player.w(); + this.player.v(); if (packetplayinentityaction.d() == 1 || packetplayinentityaction.d() == 2) { PlayerToggleSneakEvent event = new PlayerToggleSneakEvent(this.getPlayer(), packetplayinentityaction.d() == 1); this.server.getPluginManager().callEvent(event); @@ -1048,16 +1048,16 @@ public class PlayerConnection implements PacketPlayInListener { WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension); Entity entity = packetplayinuseentity.a((World) worldserver); - this.player.w(); + this.player.v(); if (entity != null) { - boolean flag = this.player.o(entity); + boolean flag = this.player.p(entity); double d0 = 36.0D; if (!flag) { d0 = 9.0D; } - if (this.player.e(entity) < d0) { + if (this.player.f(entity) < d0) { ItemStack itemInHand = this.player.inventory.getItemInHand(); // CraftBukkit if (packetplayinuseentity.c() == EnumEntityUseAction.INTERACT) { // CraftBukkit start @@ -1085,7 +1085,7 @@ public class PlayerConnection implements PacketPlayInListener { } // CraftBukkit end - this.player.p(entity); + this.player.q(entity); // CraftBukkit start if (itemInHand != null && itemInHand.count <= -1) { @@ -1112,7 +1112,7 @@ public class PlayerConnection implements PacketPlayInListener { } public void a(PacketPlayInClientCommand packetplayinclientcommand) { - this.player.w(); + this.player.v(); EnumClientCommand enumclientcommand = packetplayinclientcommand.c(); switch (ClientCommandOrdinalWrapper.a[enumclientcommand.ordinal()]) { @@ -1120,9 +1120,9 @@ public class PlayerConnection implements PacketPlayInListener { if (this.player.viewingCredits) { this.minecraftServer.getPlayerList().changeDimension(this.player, 0, PlayerTeleportEvent.TeleportCause.END_PORTAL); // CraftBukkit - reroute logic through custom portal management } else if (this.player.r().getWorldData().isHardcore()) { - if (this.minecraftServer.L() && this.player.getName().equals(this.minecraftServer.K())) { + if (this.minecraftServer.M() && this.player.getName().equals(this.minecraftServer.L())) { this.player.playerConnection.disconnect("You have died. Game over, man, it\'s game over!"); - this.minecraftServer.S(); + this.minecraftServer.T(); } else { BanEntry banentry = new BanEntry(this.player.getName()); @@ -1140,7 +1140,7 @@ public class PlayerConnection implements PacketPlayInListener { break; case 2: - this.player.x().a(this.player); + this.player.getStatisticManager().a(this.player); break; case 3: @@ -1159,7 +1159,7 @@ public class PlayerConnection implements PacketPlayInListener { public void a(PacketPlayInWindowClick packetplayinwindowclick) { if (this.player.dead) return; // CraftBukkit - this.player.w(); + this.player.v(); if (this.player.activeContainer.windowId == packetplayinwindowclick.c() && this.player.activeContainer.c(this.player)) { // CraftBukkit start - Call InventoryClickEvent if (packetplayinwindowclick.d() < -1 && packetplayinwindowclick.d() != -999) { @@ -1200,10 +1200,10 @@ public class PlayerConnection implements PacketPlayInListener { if (cursor != null) { action = packetplayinwindowclick.e() == 0 ? InventoryAction.PLACE_ALL : InventoryAction.PLACE_ONE; } - } else if (slot.a(player)) { // Should be Slot.isPlayerAllowed + } else if (slot.isAllowed(player)) { if (cursor == null) { action = packetplayinwindowclick.e() == 0 ? InventoryAction.PICKUP_ALL : InventoryAction.PICKUP_HALF; - } else if (slot.isAllowed(cursor)) { // Should be Slot.isItemAllowed + } else if (slot.isAllowed(cursor)) { if (clickedItem.doMaterialsMatch(cursor) && ItemStack.equals(clickedItem, cursor)) { int toPlace = packetplayinwindowclick.e() == 0 ? cursor.count : 1; toPlace = Math.min(toPlace, clickedItem.getMaxStackSize() - clickedItem.count); @@ -1217,7 +1217,7 @@ public class PlayerConnection implements PacketPlayInListener { } else if (toPlace != 0) { action = InventoryAction.PLACE_SOME; } - } else if (cursor.count <= slot.a()) { // Should be Slot.getMaxStackSize() + } else if (cursor.count <= slot.getMaxStackSize()) { action = InventoryAction.SWAP_WITH_CURSOR; } } else if (cursor.getItem() == clickedItem.getItem() && (!cursor.usesData() || cursor.getData() == clickedItem.getData()) && ItemStack.equals(cursor, clickedItem)) { @@ -1243,7 +1243,7 @@ public class PlayerConnection implements PacketPlayInListener { action = InventoryAction.NOTHING; } else { Slot slot = this.player.activeContainer.getSlot(packetplayinwindowclick.d()); - if (slot != null && slot.a(this.player) && slot.e()) { // Should be Slot.hasItem() + if (slot != null && slot.isAllowed(this.player) && slot.hasItem()) { action = InventoryAction.MOVE_TO_OTHER_INVENTORY; } else { action = InventoryAction.NOTHING; @@ -1254,21 +1254,21 @@ public class PlayerConnection implements PacketPlayInListener { if (packetplayinwindowclick.e() >= 0 && packetplayinwindowclick.e() < 9) { click = ClickType.NUMBER_KEY; Slot clickedSlot = this.player.activeContainer.getSlot(packetplayinwindowclick.d()); - if (clickedSlot.a(player)) { + if (clickedSlot.isAllowed(player)) { ItemStack hotbar = this.player.inventory.getItem(packetplayinwindowclick.e()); boolean canCleanSwap = hotbar == null || (clickedSlot.inventory == player.inventory && clickedSlot.isAllowed(hotbar)); // the slot will accept the hotbar item - if (clickedSlot.e()) { + if (clickedSlot.hasItem()) { if (canCleanSwap) { action = InventoryAction.HOTBAR_SWAP; } else { - int firstEmptySlot = player.inventory.j(); // Should be Inventory.firstEmpty() + int firstEmptySlot = player.inventory.getFirstEmptySlotIndex(); if (firstEmptySlot > -1) { action = InventoryAction.HOTBAR_MOVE_AND_READD; } else { action = InventoryAction.NOTHING; // This is not sane! Mojang: You should test for other slots of same type } } - } else if (!clickedSlot.e() && hotbar != null && clickedSlot.isAllowed(hotbar)) { + } else if (!clickedSlot.hasItem() && hotbar != null && clickedSlot.isAllowed(hotbar)) { action = InventoryAction.HOTBAR_SWAP; } else { action = InventoryAction.NOTHING; @@ -1286,7 +1286,7 @@ public class PlayerConnection implements PacketPlayInListener { action = InventoryAction.NOTHING; } else { Slot slot = this.player.activeContainer.getSlot(packetplayinwindowclick.d()); - if (slot != null && slot.e() && player.abilities.canInstantlyBuild && player.inventory.getCarried() == null) { + if (slot != null && slot.hasItem() && player.abilities.canInstantlyBuild && player.inventory.getCarried() == null) { action = InventoryAction.CLONE_STACK; } else { action = InventoryAction.NOTHING; @@ -1301,7 +1301,7 @@ public class PlayerConnection implements PacketPlayInListener { if (packetplayinwindowclick.e() == 0) { click = ClickType.DROP; Slot slot = this.player.activeContainer.getSlot(packetplayinwindowclick.d()); - if (slot != null && slot.e() && slot.a(player) && slot.getItem() != null && slot.getItem().getItem() != Item.getItemOf(Blocks.AIR)) { + if (slot != null && slot.hasItem() && slot.isAllowed(player) && slot.getItem() != null && slot.getItem().getItem() != Item.getItemOf(Blocks.AIR)) { action = InventoryAction.DROP_ONE_SLOT; } else { action = InventoryAction.NOTHING; @@ -1309,7 +1309,7 @@ public class PlayerConnection implements PacketPlayInListener { } else if (packetplayinwindowclick.e() == 1) { click = ClickType.CONTROL_DROP; Slot slot = this.player.activeContainer.getSlot(packetplayinwindowclick.d()); - if (slot != null && slot.e() && slot.a(player) && slot.getItem() != null && slot.getItem().getItem() != Item.getItemOf(Blocks.AIR)) { + if (slot != null && slot.hasItem() && slot.isAllowed(player) && slot.getItem() != null && slot.getItem().getItem() != Item.getItemOf(Blocks.AIR)) { action = InventoryAction.DROP_ALL_SLOT; } else { action = InventoryAction.NOTHING; @@ -1420,10 +1420,10 @@ public class PlayerConnection implements PacketPlayInListener { if (ItemStack.matches(packetplayinwindowclick.g(), itemstack)) { this.player.playerConnection.sendPacket(new PacketPlayOutTransaction(packetplayinwindowclick.c(), packetplayinwindowclick.f(), true)); - this.player.h = true; + this.player.g = true; this.player.activeContainer.b(); this.player.broadcastCarriedItem(); - this.player.h = false; + this.player.g = false; } else { this.n.a(this.player.activeContainer.windowId, Short.valueOf(packetplayinwindowclick.f())); this.player.playerConnection.sendPacket(new PacketPlayOutTransaction(packetplayinwindowclick.c(), packetplayinwindowclick.f(), false)); @@ -1446,7 +1446,7 @@ public class PlayerConnection implements PacketPlayInListener { } public void a(PacketPlayInEnchantItem packetplayinenchantitem) { - this.player.w(); + this.player.v(); if (this.player.activeContainer.windowId == packetplayinenchantitem.c() && this.player.activeContainer.c(this.player)) { this.player.activeContainer.a((EntityHuman) this.player, packetplayinenchantitem.d()); this.player.activeContainer.b(); @@ -1456,18 +1456,18 @@ public class PlayerConnection implements PacketPlayInListener { public void a(PacketPlayInSetCreativeSlot packetplayinsetcreativeslot) { if (this.player.playerInteractManager.isCreative()) { boolean flag = packetplayinsetcreativeslot.c() < 0; - ItemStack itemstack = packetplayinsetcreativeslot.d(); + ItemStack itemstack = packetplayinsetcreativeslot.getItemStack(); boolean flag1 = packetplayinsetcreativeslot.c() >= 1 && packetplayinsetcreativeslot.c() < 36 + PlayerInventory.getHotbarSize(); // CraftBukkit - Add invalidItems check boolean flag2 = itemstack == null || itemstack.getItem() != null && !invalidItems.contains(Item.b(itemstack.getItem())); boolean flag3 = itemstack == null || itemstack.getData() >= 0 && itemstack.count <= 64 && itemstack.count > 0; // CraftBukkit start - Call click event - if (flag || (flag1 && !ItemStack.matches(this.player.defaultContainer.getSlot(packetplayinsetcreativeslot.c()).getItem(), packetplayinsetcreativeslot.d()))) { // Insist on valid slot + if (flag || (flag1 && !ItemStack.matches(this.player.defaultContainer.getSlot(packetplayinsetcreativeslot.c()).getItem(), packetplayinsetcreativeslot.getItemStack()))) { // Insist on valid slot org.bukkit.entity.HumanEntity player = this.player.getBukkitEntity(); InventoryView inventory = new CraftInventoryView(player, player.getInventory(), this.player.defaultContainer); - org.bukkit.inventory.ItemStack item = CraftItemStack.asBukkitCopy(packetplayinsetcreativeslot.d()); // Should be packet107setcreativeslot.newitem + org.bukkit.inventory.ItemStack item = CraftItemStack.asBukkitCopy(packetplayinsetcreativeslot.getItemStack()); SlotType type = SlotType.QUICKBAR; if (flag) { @@ -1533,7 +1533,7 @@ public class PlayerConnection implements PacketPlayInListener { public void a(PacketPlayInUpdateSign packetplayinupdatesign) { if (this.player.dead) return; // CraftBukkit - this.player.w(); + this.player.v(); WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension); if (worldserver.isLoaded(packetplayinupdatesign.c(), packetplayinupdatesign.d(), packetplayinupdatesign.e())) { @@ -1613,12 +1613,12 @@ public class PlayerConnection implements PacketPlayInListener { } public void a(PacketPlayInAbilities packetplayinabilities) { - // CraftBukkit start - d() should be isFlying() - if (this.player.abilities.canFly && this.player.abilities.isFlying != packetplayinabilities.d()) { - PlayerToggleFlightEvent event = new PlayerToggleFlightEvent(this.server.getPlayer(this.player), packetplayinabilities.d()); + // CraftBukkit start + if (this.player.abilities.canFly && this.player.abilities.isFlying != packetplayinabilities.isFlying()) { + PlayerToggleFlightEvent event = new PlayerToggleFlightEvent(this.server.getPlayer(this.player), packetplayinabilities.isFlying()); this.server.getPluginManager().callEvent(event); if (!event.isCancelled()) { - this.player.abilities.isFlying = packetplayinabilities.d(); // Actually set the player's flying status + this.player.abilities.isFlying = packetplayinabilities.isFlying(); // Actually set the player's flying status } else { this.player.updateAbilities(); // Tell the player their ability was reverted } @@ -1644,6 +1644,7 @@ public class PlayerConnection implements PacketPlayInListener { } public void a(PacketPlayInCustomPayload packetplayincustompayload) { + PacketDataSerializer packetdataserializer; ItemStack itemstack; ItemStack itemstack1; @@ -1654,42 +1655,72 @@ public class PlayerConnection implements PacketPlayInListener { // CraftBukkit end if ("MC|BEdit".equals(packetplayincustompayload.c())) { - try { - itemstack = (new PacketDataSerializer(Unpooled.wrappedBuffer(packetplayincustompayload.e()))).c(); - if (!ItemBookAndQuill.a(itemstack.getTag())) { - throw new IOException("Invalid book tag!"); - } + packetdataserializer = new PacketDataSerializer(Unpooled.wrappedBuffer(packetplayincustompayload.e())); - itemstack1 = this.player.inventory.getItemInHand(); - if (itemstack.getItem() == Items.BOOK_AND_QUILL && itemstack.getItem() == itemstack1.getItem()) { - CraftEventFactory.handleEditBookEvent(player, itemstack); // CraftBukkit + try { + itemstack = packetdataserializer.c(); + if (itemstack != null) { + if (!ItemBookAndQuill.a(itemstack.getTag())) { + throw new IOException("Invalid book tag!"); + } + + itemstack1 = this.player.inventory.getItemInHand(); + if (itemstack1 == null) { + return; + } + + if (itemstack.getItem() == Items.BOOK_AND_QUILL && itemstack.getItem() == itemstack1.getItem()) { + itemstack1.a("pages", (NBTBase) itemstack.getTag().getList("pages", 8)); + } + + return; } // CraftBukkit start - } catch (Throwable exception) { + } catch (Exception exception) { c.error("Couldn\'t handle book info", exception); this.disconnect("Invalid book data!"); + return; // CraftBukkit end + } finally { + packetdataserializer.release(); } + + return; } else if ("MC|BSign".equals(packetplayincustompayload.c())) { + packetdataserializer = new PacketDataSerializer(Unpooled.wrappedBuffer(packetplayincustompayload.e())); + try { - itemstack = (new PacketDataSerializer(Unpooled.wrappedBuffer(packetplayincustompayload.e()))).c(); + itemstack = packetdataserializer.c(); + if (itemstack == null) { + return; + } + if (!ItemWrittenBook.a(itemstack.getTag())) { throw new IOException("Invalid book tag!"); } itemstack1 = this.player.inventory.getItemInHand(); - if (itemstack.getItem() == Items.WRITTEN_BOOK && itemstack1.getItem() == Items.BOOK_AND_QUILL) { - CraftEventFactory.handleEditBookEvent(player, itemstack); // CraftBukkit + if (itemstack1 != null) { + if (itemstack.getItem() == Items.WRITTEN_BOOK && itemstack1.getItem() == Items.BOOK_AND_QUILL) { + CraftEventFactory.handleEditBookEvent(player, itemstack); // CraftBukkit + } + + return; } // CraftBukkit start } catch (Throwable exception1) { c.error("Couldn\'t sign book", exception1); this.disconnect("Invalid book data!"); // CraftBukkit end + return; + } finally { + packetdataserializer.release(); } + + return; } else { - DataInputStream datainputstream; int i; + DataInputStream datainputstream; if ("MC|TrSel".equals(packetplayincustompayload.c())) { try { @@ -1710,8 +1741,9 @@ public class PlayerConnection implements PacketPlayInListener { if (!this.minecraftServer.getEnableCommandBlock()) { this.player.sendMessage(new ChatMessage("advMode.notEnabled", new Object[0])); } else if (this.player.a(2, "") && this.player.abilities.canInstantlyBuild) { + packetdataserializer = new PacketDataSerializer(Unpooled.wrappedBuffer(packetplayincustompayload.e())); + try { - PacketDataSerializer packetdataserializer = new PacketDataSerializer(Unpooled.wrappedBuffer(packetplayincustompayload.e())); byte b0 = packetdataserializer.readByte(); CommandBlockListenerAbstract commandblocklistenerabstract = null; @@ -1741,6 +1773,8 @@ public class PlayerConnection implements PacketPlayInListener { c.error("Couldn\'t set command block", exception3); this.disconnect("Invalid CommandBlock data!"); // CraftBukkit end + } finally { + packetdataserializer.release(); } } else { this.player.sendMessage(new ChatMessage("advMode.notAllowed", new Object[0])); @@ -1754,7 +1788,7 @@ public class PlayerConnection implements PacketPlayInListener { ContainerBeacon containerbeacon = (ContainerBeacon) this.player.activeContainer; Slot slot = containerbeacon.getSlot(0); - if (slot.e()) { + if (slot.hasItem()) { slot.a(1); TileEntityBeacon tileentitybeacon = containerbeacon.e(); diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java index bceba7bca8..2db45ad4b9 100644 --- a/src/main/java/net/minecraft/server/PlayerInteractManager.java +++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java @@ -225,7 +225,7 @@ public class PlayerInteractManager { } public boolean breakBlock(int i, int j, int k) { - // CraftBukkit start + // CraftBukkit start - fire BlockBreakEvent BlockBreakEvent event = null; if (this.player instanceof EntityPlayer) { @@ -245,7 +245,7 @@ public class PlayerInteractManager { event.setCancelled(this.gamemode.isAdventure() && !this.player.d(i, j, k)); // Sword + Creative mode pre-cancel - event.setCancelled(event.isCancelled() || (this.gamemode.d() && this.player.be() != null && this.player.be().getItem() instanceof ItemSword)); + event.setCancelled(event.isCancelled() || (this.gamemode.d() && this.player.bd() != null && this.player.bd().getItem() instanceof ItemSword)); // Calculate default block experience Block nmsBlock = this.world.getType(i, j, k); @@ -277,7 +277,7 @@ public class PlayerInteractManager { if (false && this.gamemode.isAdventure() && !this.player.d(i, j, k)) { // Never trigger // CraftBukkit end return false; - } else if (false && this.gamemode.d() && this.player.be() != null && this.player.be().getItem() instanceof ItemSword) { // CraftBukkit - never trigger + } else if (false && this.gamemode.d() && this.player.bd() != null && this.player.bd().getItem() instanceof ItemSword) { // CraftBukkit - never trigger return false; } else { Block block = this.world.getType(i, j, k); @@ -297,13 +297,13 @@ public class PlayerInteractManager { if (this.isCreative()) { this.player.playerConnection.sendPacket(new PacketPlayOutBlockChange(i, j, k, this.world)); } else { - ItemStack itemstack = this.player.bD(); + ItemStack itemstack = this.player.bE(); boolean flag1 = this.player.a(block); if (itemstack != null) { itemstack.a(this.world, block, i, j, k, this.player); if (itemstack.count == 0) { - this.player.bE(); + this.player.bF(); } } @@ -342,7 +342,7 @@ public class PlayerInteractManager { entityhuman.inventory.items[entityhuman.inventory.itemInHandIndex] = null; } - if (!entityhuman.bw()) { + if (!entityhuman.bx()) { ((EntityPlayer) entityhuman).updateInventory(entityhuman.defaultContainer); } @@ -352,7 +352,7 @@ public class PlayerInteractManager { public boolean interact(EntityHuman entityhuman, World world, ItemStack itemstack, int i, int j, int k, int l, float f, float f1, float f2) { /* CraftBukkit start - whole method - if ((!entityhuman.isSneaking() || entityhuman.be() == null) && world.getType(i, j, k).interact(world, i, j, k, entityhuman, l, f, f1, f2)) { + if ((!entityhuman.isSneaking() || entityhuman.bd() == null) && world.getType(i, j, k).interact(world, i, j, k, entityhuman, l, f, f1, f2)) { return true; } else if (itemstack == null) { return false; diff --git a/src/main/java/net/minecraft/server/PlayerInventory.java b/src/main/java/net/minecraft/server/PlayerInventory.java index c9cc47ad21..83cbb97c04 100644 --- a/src/main/java/net/minecraft/server/PlayerInventory.java +++ b/src/main/java/net/minecraft/server/PlayerInventory.java @@ -18,7 +18,7 @@ public class PlayerInventory implements IInventory { private ItemStack g; public boolean e; - // CraftBukkit start + // CraftBukkit start - add fields and methods public List transaction = new java.util.ArrayList(); private int maxStack = MAX_STACK; @@ -99,7 +99,7 @@ public class PlayerInventory implements IInventory { } // CraftBukkit end - public int j() { + public int getFirstEmptySlotIndex() { for (int i = 0; i < this.items.length; ++i) { if (this.items[i] == null) { return i; @@ -153,7 +153,7 @@ public class PlayerInventory implements IInventory { int j; if (itemstack.getMaxStackSize() == 1) { - j = this.j(); + j = this.getFirstEmptySlotIndex(); if (j < 0) { return i; } else { @@ -166,7 +166,7 @@ public class PlayerInventory implements IInventory { } else { j = this.firstPartial(itemstack); if (j < 0) { - j = this.j(); + j = this.getFirstEmptySlotIndex(); } if (j < 0) { @@ -235,7 +235,7 @@ public class PlayerInventory implements IInventory { int i; if (itemstack.i()) { - i = this.j(); + i = this.getFirstEmptySlotIndex(); if (i >= 0) { this.items[i] = ItemStack.b(itemstack); this.items[i].c = 5; @@ -494,7 +494,7 @@ public class PlayerInventory implements IInventory { } public boolean a(EntityHuman entityhuman) { - return this.player.dead ? false : entityhuman.e(this.player) <= 64.0D; + return this.player.dead ? false : entityhuman.f(this.player) <= 64.0D; } public boolean c(ItemStack itemstack) { diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java index 4383275396..1943dbf0d8 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -39,19 +39,19 @@ import org.bukkit.util.Vector; public abstract class PlayerList { - private static final Logger d = LogManager.getLogger(); - private static final SimpleDateFormat e = new SimpleDateFormat("yyyy-MM-dd \'at\' HH:mm:ss z"); + private static final Logger c = LogManager.getLogger(); + private static final SimpleDateFormat d = new SimpleDateFormat("yyyy-MM-dd \'at\' HH:mm:ss z"); private final MinecraftServer server; public final List players = new java.util.concurrent.CopyOnWriteArrayList(); // CraftBukkit - ArrayList -> CopyOnWriteArrayList: Iterator safety private final BanList banByName = new BanList(new File("banned-players.txt")); private final BanList banByIP = new BanList(new File("banned-ips.txt")); private final Set operators = new HashSet(); private final Set whitelist = new java.util.LinkedHashSet(); // CraftBukkit - HashSet -> LinkedHashSet - private final Map k = Maps.newHashMap(); + private final Map j = Maps.newHashMap(); public IPlayerFileData playerFileData; // CraftBukkit - private -> public public boolean hasWhitelist; // CraftBukkit - private -> public protected int maxPlayers; - protected int c; + protected int m; private EnumGamemode n; private boolean o; private int p; @@ -84,14 +84,14 @@ public abstract class PlayerList { } // CraftBukkit - add world to 'logged in' message. - d.info(entityplayer.getName() + "[" + s + "] logged in with entity id " + entityplayer.getId() + " at ([" + entityplayer.world.worldData.getName() + "] " + entityplayer.locX + ", " + entityplayer.locY + ", " + entityplayer.locZ + ")"); + c.info(entityplayer.getName() + "[" + s + "] logged in with entity id " + entityplayer.getId() + " at ([" + entityplayer.world.worldData.getName() + "] " + entityplayer.locX + ", " + entityplayer.locY + ", " + entityplayer.locZ + ")"); WorldServer worldserver = this.server.getWorldServer(entityplayer.dimension); ChunkCoordinates chunkcoordinates = worldserver.getSpawn(); this.a(entityplayer, (EntityPlayer) null, worldserver); PlayerConnection playerconnection = new PlayerConnection(this.server, networkmanager, entityplayer); - // CraftBukkit start -- Don't send a higher than 60 MaxPlayer size, otherwise the PlayerInfo window won't render correctly. + // CraftBukkit start - Don't send a higher than 60 MaxPlayer size, otherwise the PlayerInfo window won't render correctly. int maxPlayers = this.getMaxPlayers(); if (maxPlayers > 60) { maxPlayers = 60; @@ -103,21 +103,21 @@ public abstract class PlayerList { playerconnection.sendPacket(new PacketPlayOutSpawnPosition(chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z)); playerconnection.sendPacket(new PacketPlayOutAbilities(entityplayer.abilities)); playerconnection.sendPacket(new PacketPlayOutHeldItemSlot(entityplayer.inventory.itemInHandIndex)); - entityplayer.x().d(); - entityplayer.x().b(entityplayer); + entityplayer.getStatisticManager().d(); + entityplayer.getStatisticManager().updateStatistics(entityplayer); this.a((ScoreboardServer) worldserver.getScoreboard(), entityplayer); - this.server.au(); + this.server.av(); /* CraftBukkit start - login message is handled in the event ChatMessage chatmessage = new ChatMessage("multiplayer.player.joined", new Object[] { entityplayer.getScoreboardDisplayName()}); - chatmessage.b().setColor(EnumChatFormat.YELLOW); + chatmessage.getChatModifier().setColor(EnumChatFormat.YELLOW); this.sendMessage(chatmessage); // CraftBukkit end*/ this.c(entityplayer); playerconnection.a(entityplayer.locX, entityplayer.locY, entityplayer.locZ, entityplayer.yaw, entityplayer.pitch); this.b(entityplayer, worldserver); if (this.server.getResourcePack().length() > 0) { - entityplayer.a(this.server.getResourcePack()); + entityplayer.setResourcePack(this.server.getResourcePack()); } Iterator iterator = entityplayer.getEffects().iterator(); @@ -133,10 +133,10 @@ public abstract class PlayerList { Entity entity = EntityTypes.a(nbttagcompound.getCompound("Riding"), worldserver); if (entity != null) { - entity.o = true; + entity.n = true; worldserver.addEntity(entity); entityplayer.mount(entity); - entity.o = false; + entity.n = false; } } } @@ -194,10 +194,10 @@ public abstract class PlayerList { NBTTagCompound nbttagcompound = this.server.worlds.get(0).getWorldData().i(); NBTTagCompound nbttagcompound1; - if (entityplayer.getName().equals(this.server.K()) && nbttagcompound != null) { + if (entityplayer.getName().equals(this.server.L()) && nbttagcompound != null) { entityplayer.f(nbttagcompound); nbttagcompound1 = nbttagcompound; - d.debug("loading single player"); + c.debug("loading single player"); } else { nbttagcompound1 = this.playerFileData.load(entityplayer); } @@ -207,7 +207,7 @@ public abstract class PlayerList { protected void b(EntityPlayer entityplayer) { this.playerFileData.save(entityplayer); - ServerStatisticManager serverstatisticmanager = (ServerStatisticManager) this.k.get(entityplayer.getName()); + ServerStatisticManager serverstatisticmanager = (ServerStatisticManager) this.j.get(entityplayer.getName()); if (serverstatisticmanager != null) { serverstatisticmanager.b(); @@ -286,13 +286,13 @@ public abstract class PlayerList { if (entityplayer.vehicle != null && !(entityplayer.vehicle instanceof EntityPlayer)) { // CraftBukkit - Don't remove players worldserver.removeEntity(entityplayer.vehicle); - d.debug("removing player mount"); + c.debug("removing player mount"); } worldserver.kill(entityplayer); worldserver.getPlayerChunkMap().removePlayer(entityplayer); this.players.remove(entityplayer); - this.k.remove(entityplayer.getName()); + this.j.remove(entityplayer.getName()); ChunkIOExecutor.adjustPoolSize(this.getPlayerCount()); // CraftBukkit // CraftBukkit start - .name -> .listName, replace sendAll with loop @@ -328,7 +328,7 @@ public abstract class PlayerList { String s = "You are banned from this server!\nReason: " + banentry.getReason(); if (banentry.getExpires() != null) { - s = s + "\nYour ban will be removed on " + e.format(banentry.getExpires()); + s = s + "\nYour ban will be removed on " + d.format(banentry.getExpires()); } // return s; @@ -346,7 +346,7 @@ public abstract class PlayerList { String s2 = "Your IP address is banned from this server!\nReason: " + banentry1.getReason(); if (banentry1.getExpires() != null) { - s2 = s2 + "\nYour ban will be removed on " + e.format(banentry1.getExpires()); + s2 = s2 + "\nYour ban will be removed on " + d.format(banentry1.getExpires()); } // return s2; @@ -391,7 +391,7 @@ public abstract class PlayerList { /* CraftBukkit start Object object; - if (this.server.P()) { + if (this.server.Q()) { object = new DemoPlayerInteractManager(this.server.getWorldServer(0)); } else { object = new PlayerInteractManager(this.server.getWorldServer(0)); @@ -422,7 +422,7 @@ public abstract class PlayerList { entityplayer.dimension = i; Object object; - if (this.server.P()) { + if (this.server.Q()) { object = new DemoPlayerInteractManager(this.server.getWorldServer(entityplayer.dimension)); } else { object = new PlayerInteractManager(this.server.getWorldServer(entityplayer.dimension)); @@ -443,7 +443,7 @@ public abstract class PlayerList { ChunkCoordinates chunkcoordinates1; - // CraftBukkit start + // CraftBukkit start - fire PlayerRespawnEvent if (location == null) { boolean isBedSpawn = false; CraftWorld cworld = (CraftWorld) this.server.server.getWorld(entityplayer.spawnWorld); @@ -501,9 +501,9 @@ public abstract class PlayerList { // CraftBukkit start // Don't re-add player to player list if disconnected if (!entityplayer.playerConnection.isDisconnected()) { - worldserver.getPlayerChunkMap().addPlayer(entityplayer1); - worldserver.addEntity(entityplayer1); - this.players.add(entityplayer1); + worldserver.getPlayerChunkMap().addPlayer(entityplayer1); + worldserver.addEntity(entityplayer1); + this.players.add(entityplayer1); } // Added from changeDimension this.updateClient(entityplayer1); // Update health, etc... @@ -564,7 +564,7 @@ public abstract class PlayerList { } } - TravelAgent agent = exit != null ? (TravelAgent) ((CraftWorld) exit.getWorld()).getHandle().t() : org.bukkit.craftbukkit.CraftTravelAgent.DEFAULT; // return arbitrary TA to compensate for implementation dependent plugins + TravelAgent agent = exit != null ? (TravelAgent) ((CraftWorld) exit.getWorld()).getHandle().getTravelAgent() : org.bukkit.craftbukkit.CraftTravelAgent.DEFAULT; // return arbitrary TA to compensate for implementation dependent plugins PlayerPortalEvent event = new PlayerPortalEvent(entityplayer.getBukkitEntity(), enter, exit, agent, cause); event.useTravelAgent(useTravelAgent); Bukkit.getServer().getPluginManager().callEvent(event); @@ -581,7 +581,7 @@ public abstract class PlayerList { Vector velocity = entityplayer.getBukkitEntity().getVelocity(); boolean before = exitWorld.chunkProviderServer.forceChunkLoad; exitWorld.chunkProviderServer.forceChunkLoad = true; - exitWorld.t().adjustExit(entityplayer, exit, velocity); // Should be getTravelAgent + exitWorld.getTravelAgent().adjustExit(entityplayer, exit, velocity); exitWorld.chunkProviderServer.forceChunkLoad = before; this.moveToWorld(entityplayer, exitWorld.dimension, true, exit, false); // Vanilla doesn't check for suffocation when handling portals, so neither should we @@ -669,7 +669,7 @@ public abstract class PlayerList { worldserver1.addEntity(entity); entity.setPositionRotation(d0, entity.locY, d1, entity.yaw, entity.pitch); worldserver1.entityJoinedWorld(entity, false); - worldserver1.t().a(entity, d3, d4, d5, f); + worldserver1.getTravelAgent().a(entity, d3, d4, d5, f); } worldserver.methodProfiler.b(); @@ -746,7 +746,7 @@ public abstract class PlayerList { // worldserver1.s().a(entity, d3, d4, d5, f); if (portal) { Vector velocity = entity.getBukkitEntity().getVelocity(); - worldserver1.t().adjustExit(entity, exit, velocity); // Should be getTravelAgent + worldserver1.getTravelAgent().adjustExit(entity, exit, velocity); // Should be getTravelAgent entity.setPositionRotation(exit.getX(), exit.getY(), exit.getZ(), exit.getYaw(), exit.getPitch()); if (entity.motX != velocity.getX() || entity.motY != velocity.getY() || entity.motZ != velocity.getZ()) { entity.getBukkitEntity().setVelocity(velocity); @@ -854,7 +854,7 @@ public abstract class PlayerList { public boolean isOp(String s) { // CraftBukkit - fix reference to worldserver array - return this.operators.contains(s.trim().toLowerCase()) || this.server.L() && this.server.worlds.get(0).getWorldData().allowCommands() && this.server.K().equalsIgnoreCase(s) || this.o; + return this.operators.contains(s.trim().toLowerCase()) || this.server.M() && this.server.worlds.get(0).getWorldData().allowCommands() && this.server.L().equalsIgnoreCase(s) || this.o; } public EntityPlayer getPlayer(String s) { @@ -875,7 +875,7 @@ public abstract class PlayerList { public List a(ChunkCoordinates chunkcoordinates, int i, int j, int k, int l, int i1, int j1, Map map, String s, String s1, World world) { if (this.players.isEmpty()) { - return null; + return Collections.emptyList(); } else { Object object = new ArrayList(); boolean flag = k < 0; @@ -1031,7 +1031,7 @@ public abstract class PlayerList { public void b(EntityPlayer entityplayer, WorldServer worldserver) { entityplayer.playerConnection.sendPacket(new PacketPlayOutUpdateTime(worldserver.getTime(), worldserver.getDayTime(), worldserver.getGameRules().getBoolean("doDaylightCycle"))); - if (worldserver.P()) { + if (worldserver.Q()) { // CraftBukkit start - handle player weather // entityplayer.playerConnection.sendPacket(new PacketPlayOutGameStateChange(1, 0.0F)); // entityplayer.playerConnection.sendPacket(new PacketPlayOutGameStateChange(7, worldserver.j(1.0F))); @@ -1084,7 +1084,7 @@ public abstract class PlayerList { } public int o() { - return this.c; + return this.m; } public MinecraftServer getServer() { @@ -1129,14 +1129,30 @@ public abstract class PlayerList { } public ServerStatisticManager i(String s) { - ServerStatisticManager serverstatisticmanager = (ServerStatisticManager) this.k.get(s); + ServerStatisticManager serverstatisticmanager = (ServerStatisticManager) this.j.get(s); if (serverstatisticmanager == null) { serverstatisticmanager = new ServerStatisticManager(this.server, new File(this.server.getWorldServer(0).getDataManager().getDirectory(), "stats/" + s + ".json")); serverstatisticmanager.a(); - this.k.put(s, serverstatisticmanager); + this.j.put(s, serverstatisticmanager); } return serverstatisticmanager; } + + public void a(int i) { + this.m = i; + if (this.server.worldServer != null) { + WorldServer[] aworldserver = this.server.worldServer; + int j = aworldserver.length; + + for (int k = 0; k < j; ++k) { + WorldServer worldserver = aworldserver[k]; + + if (worldserver != null) { + worldserver.getPlayerChunkMap().a(i); + } + } + } + } } diff --git a/src/main/java/net/minecraft/server/PlayerSelector.java b/src/main/java/net/minecraft/server/PlayerSelector.java index 4705769da9..e7615d3d48 100644 --- a/src/main/java/net/minecraft/server/PlayerSelector.java +++ b/src/main/java/net/minecraft/server/PlayerSelector.java @@ -33,7 +33,7 @@ public class PlayerSelector { } public static EntityPlayer[] getPlayers(ICommandListener icommandlistener, String s) { - // CraftBukkit start + // CraftBukkit start - disable playerselections for ICommandListeners other than command blocks if (!(icommandlistener instanceof CommandBlockListenerAbstract)) { return null; } @@ -41,9 +41,7 @@ public class PlayerSelector { Matcher matcher = a.matcher(s); - if (!matcher.matches()) { - return null; - } else { + if (matcher.matches()) { Map map = h(matcher.group(2)); String s1 = matcher.group(1); int i = c(s1); @@ -111,18 +109,20 @@ public class PlayerSelector { List list; if (!s1.equals("p") && !s1.equals("a")) { - if (!s1.equals("r")) { - return null; - } else { + if (s1.equals("r")) { list = MinecraftServer.getServer().getPlayerList().a(chunkcoordinates, i, j, 0, j1, k, l, map1, s2, s3, world); Collections.shuffle(list); list = list.subList(0, Math.min(i1, list.size())); - return list != null && !list.isEmpty() ? (EntityPlayer[]) list.toArray(new EntityPlayer[0]) : new EntityPlayer[0]; + return list.isEmpty() ? new EntityPlayer[0] : (EntityPlayer[]) list.toArray(new EntityPlayer[list.size()]); + } else { + return null; } } else { list = MinecraftServer.getServer().getPlayerList().a(chunkcoordinates, i, j, i1, j1, k, l, map1, s2, s3, world); - return list != null && !list.isEmpty() ? (EntityPlayer[]) list.toArray(new EntityPlayer[0]) : new EntityPlayer[0]; + return list.isEmpty() ? new EntityPlayer[0] : (EntityPlayer[]) list.toArray(new EntityPlayer[list.size()]); } + } else { + return null; } } diff --git a/src/main/java/net/minecraft/server/PortalCreator.java b/src/main/java/net/minecraft/server/PortalCreator.java index 416aaeaa4a..70dda39c7a 100644 --- a/src/main/java/net/minecraft/server/PortalCreator.java +++ b/src/main/java/net/minecraft/server/PortalCreator.java @@ -12,7 +12,7 @@ public class PortalCreator { private ChunkCoordinates f; private int g; private int h; - java.util.Collection blocks; // CraftBukkit + java.util.Collection blocks; // CraftBukkit - add field public PortalCreator(World world, int i, int j, int k, int l) { this.a = world; diff --git a/src/main/java/net/minecraft/server/PortalTravelAgent.java b/src/main/java/net/minecraft/server/PortalTravelAgent.java index 9d954af5c8..140d1faa00 100644 --- a/src/main/java/net/minecraft/server/PortalTravelAgent.java +++ b/src/main/java/net/minecraft/server/PortalTravelAgent.java @@ -140,7 +140,7 @@ public class PortalTravelAgent { for (int l1 = i1 - short1; l1 <= i1 + short1; ++l1) { double d6 = (double) l1 + 0.5D - z; // CraftBukkit - for (int i2 = this.a.R() - 1; i2 >= 0; --i2) { + for (int i2 = this.a.S() - 1; i2 >= 0; --i2) { if (this.a.getType(k1, i2, l1) == Blocks.PORTAL) { while (this.a.getType(k1, i2 - 1, l1) == Blocks.PORTAL) { --i2; @@ -215,7 +215,7 @@ public class PortalTravelAgent { j2 = 1; } - int k2 = entity.ay(); + int k2 = entity.ax(); if (j2 > -1) { int l2 = Direction.h[j2]; @@ -364,7 +364,7 @@ public class PortalTravelAgent { d2 = (double) j2 + 0.5D - z; // CraftBukkit label274: - for (k2 = this.a.R() - 1; k2 >= 0; --k2) { + for (k2 = this.a.S() - 1; k2 >= 0; --k2) { if (this.a.isEmpty(i2, k2, j2)) { while (k2 > 0 && this.a.isEmpty(i2, k2 - 1, j2)) { --k2; @@ -415,7 +415,7 @@ public class PortalTravelAgent { d2 = (double) j2 + 0.5D - z; // CraftBukkit label222: - for (k2 = this.a.R() - 1; k2 >= 0; --k2) { + for (k2 = this.a.S() - 1; k2 >= 0; --k2) { if (this.a.isEmpty(i2, k2, j2)) { while (k2 > 0 && this.a.isEmpty(i2, k2 - 1, j2)) { --k2; @@ -471,8 +471,8 @@ public class PortalTravelAgent { i1 = 70; } - if (i1 > this.a.R() - 10) { - i1 = this.a.R() - 10; + if (i1 > this.a.S() - 10) { + i1 = this.a.S() - 10; } j5 = i1; diff --git a/src/main/java/net/minecraft/server/RecipesFurnace.java b/src/main/java/net/minecraft/server/RecipesFurnace.java index bf6ddb4d2b..c474d54870 100644 --- a/src/main/java/net/minecraft/server/RecipesFurnace.java +++ b/src/main/java/net/minecraft/server/RecipesFurnace.java @@ -10,7 +10,7 @@ public class RecipesFurnace { private static final RecipesFurnace a = new RecipesFurnace(); public Map recipes = new HashMap(); // CraftBukkit - private -> public private Map c = new HashMap(); - public Map customRecipes = new HashMap(); // CraftBukkit + public Map customRecipes = new HashMap(); // CraftBukkit - add field public static RecipesFurnace getInstance() { return a; @@ -63,14 +63,14 @@ public class RecipesFurnace { this.c.put(itemstack1, Float.valueOf(f)); } - // CraftBukkit start + // CraftBukkit start - add method public void registerRecipe(ItemStack itemstack, ItemStack itemstack1) { this.customRecipes.put(itemstack, itemstack1); } // CraftBukkit end public ItemStack getResult(ItemStack itemstack) { - // CraftBukkit start + // CraftBukkit start - initialize to customRecipes boolean vanilla = false; Iterator iterator = this.customRecipes.entrySet().iterator(); // CraftBukkit end @@ -79,7 +79,7 @@ public class RecipesFurnace { do { if (!iterator.hasNext()) { - // CraftBukkit start + // CraftBukkit start - fall back to vanilla recipes if (!vanilla && recipes.size() != 0) { iterator = this.recipes.entrySet().iterator(); vanilla = true; diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java index a771a64089..e9cb09f9f6 100644 --- a/src/main/java/net/minecraft/server/RegionFile.java +++ b/src/main/java/net/minecraft/server/RegionFile.java @@ -244,7 +244,7 @@ public class RegionFile { } } - this.b(i, j, (int) (MinecraftServer.ap() / 1000L)); + this.b(i, j, (int) (MinecraftServer.aq() / 1000L)); } catch (IOException ioexception) { ioexception.printStackTrace(); } diff --git a/src/main/java/net/minecraft/server/Slot.java b/src/main/java/net/minecraft/server/Slot.java index 2371c24377..ac9e04cf94 100644 --- a/src/main/java/net/minecraft/server/Slot.java +++ b/src/main/java/net/minecraft/server/Slot.java @@ -43,7 +43,7 @@ public class Slot { return this.inventory.getItem(this.index); } - public boolean e() { + public boolean hasItem() { return this.getItem() != null; } @@ -56,7 +56,7 @@ public class Slot { this.inventory.update(); } - public int a() { + public int getMaxStackSize() { return this.inventory.getMaxStackSize(); } @@ -68,7 +68,7 @@ public class Slot { return iinventory == this.inventory && i == this.index; } - public boolean a(EntityHuman entityhuman) { + public boolean isAllowed(EntityHuman entityhuman) { return true; } } diff --git a/src/main/java/net/minecraft/server/SlotFurnaceResult.java b/src/main/java/net/minecraft/server/SlotFurnaceResult.java index 8c177583b9..9b8e39bc4b 100644 --- a/src/main/java/net/minecraft/server/SlotFurnaceResult.java +++ b/src/main/java/net/minecraft/server/SlotFurnaceResult.java @@ -20,7 +20,7 @@ public class SlotFurnaceResult extends Slot { } public ItemStack a(int i) { - if (this.e()) { + if (this.hasItem()) { this.b += Math.min(i, this.getItem().count); } @@ -55,7 +55,7 @@ public class SlotFurnaceResult extends Slot { i = j; } - // CraftBukkit start + // CraftBukkit start - fire FurnaceExtractEvent Player player = (Player) a.getBukkitEntity(); TileEntityFurnace furnace = ((TileEntityFurnace) this.inventory); org.bukkit.block.Block block = a.world.getWorld().getBlockAt(furnace.x, furnace.y, furnace.z); diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java index f514b78979..2ef15d2aa7 100644 --- a/src/main/java/net/minecraft/server/SpawnerCreature.java +++ b/src/main/java/net/minecraft/server/SpawnerCreature.java @@ -22,7 +22,7 @@ public final class SpawnerCreature { Chunk chunk = world.getChunkAt(i, j); int k = i * 16 + world.random.nextInt(16); int l = j * 16 + world.random.nextInt(16); - int i1 = world.random.nextInt(chunk == null ? world.R() : chunk.h() + 16 - 1); + int i1 = world.random.nextInt(chunk == null ? world.S() : chunk.h() + 16 - 1); return new ChunkPosition(k, i1, l); } @@ -47,7 +47,7 @@ public final class SpawnerCreature { for (int i1 = -b0; i1 <= b0; ++i1) { boolean flag3 = l == -b0 || l == b0 || i1 == -b0 || i1 == b0; - // CraftBukkit start + // CraftBukkit start - use LongHash and LongObjectHashMap long chunkCoords = LongHash.toLong(l + k, i1 + j); if (!flag3) { @@ -96,7 +96,7 @@ public final class SpawnerCreature { label110: while (iterator.hasNext()) { - // CraftBukkit start + // CraftBukkit start = use LongHash and LongObjectHashMap long key = ((Long) iterator.next()).longValue(); if (!this.a.get(key)) { @@ -160,7 +160,7 @@ public final class SpawnerCreature { groupdataentity = entityinsentient.a(groupdataentity); worldserver.addEntity(entityinsentient, SpawnReason.NATURAL); // CraftBukkit end - if (j2 >= entityinsentient.bz()) { + if (j2 >= entityinsentient.bB()) { continue label110; } } diff --git a/src/main/java/net/minecraft/server/StatisticManager.java b/src/main/java/net/minecraft/server/StatisticManager.java index 86d186a569..e86e21b159 100644 --- a/src/main/java/net/minecraft/server/StatisticManager.java +++ b/src/main/java/net/minecraft/server/StatisticManager.java @@ -1,17 +1,18 @@ package net.minecraft.server; - -import java.util.HashMap; + import java.util.Map; - + +import net.minecraft.util.com.google.common.collect.Maps; + public class StatisticManager { - protected final Map a = new HashMap(); + protected final Map a = Maps.newConcurrentMap(); public StatisticManager() { } public boolean a(Achievement achievement) { - return this.a((Statistic) achievement) > 0; + return this.getStatisticValue((Statistic) achievement) > 0; } public boolean b(Achievement achievement) { @@ -20,17 +21,17 @@ public class StatisticManager { public void b(EntityHuman entityhuman, Statistic statistic, int i) { if (!statistic.d() || this.b((Achievement) statistic)) { - // CraftBukkit start - org.bukkit.event.Cancellable cancellable = org.bukkit.craftbukkit.event.CraftEventFactory.handleStatisticsIncrease(entityhuman, statistic, a(statistic), i); + // CraftBukkit start - fire Statistic events + org.bukkit.event.Cancellable cancellable = org.bukkit.craftbukkit.event.CraftEventFactory.handleStatisticsIncrease(entityhuman, statistic, this.getStatisticValue(statistic), i); if (cancellable != null && cancellable.isCancelled()) { return; } // CraftBukkit end - this.a(entityhuman, statistic, this.a(statistic) + i); + this.setStatistic(entityhuman, statistic, this.getStatisticValue(statistic) + i); } } - public void a(EntityHuman entityhuman, Statistic statistic, int i) { + public void setStatistic(EntityHuman entityhuman, Statistic statistic, int i) { StatisticWrapper statisticwrapper = (StatisticWrapper) this.a.get(statistic); if (statisticwrapper == null) { @@ -41,7 +42,7 @@ public class StatisticManager { statisticwrapper.a(i); } - public int a(Statistic statistic) { + public int getStatisticValue(Statistic statistic) { StatisticWrapper statisticwrapper = (StatisticWrapper) this.a.get(statistic); return statisticwrapper == null ? 0 : statisticwrapper.a(); diff --git a/src/main/java/net/minecraft/server/ThreadCommandReader.java b/src/main/java/net/minecraft/server/ThreadCommandReader.java index 1826d2a35d..0e24bd7dbd 100644 --- a/src/main/java/net/minecraft/server/ThreadCommandReader.java +++ b/src/main/java/net/minecraft/server/ThreadCommandReader.java @@ -39,7 +39,7 @@ class ThreadCommandReader extends Thread { // CraftBukkit end } } catch (IOException ioexception) { - DedicatedServer.az().error("Exception handling console input", ioexception); + DedicatedServer.aA().error("Exception handling console input", ioexception); } } } diff --git a/src/main/java/net/minecraft/server/ThreadPlayerLookupUUID.java b/src/main/java/net/minecraft/server/ThreadPlayerLookupUUID.java index cc96775888..f48ce534b8 100644 --- a/src/main/java/net/minecraft/server/ThreadPlayerLookupUUID.java +++ b/src/main/java/net/minecraft/server/ThreadPlayerLookupUUID.java @@ -22,12 +22,12 @@ class ThreadPlayerLookupUUID extends Thread { public void run() { try { - String s = (new BigInteger(MinecraftEncryption.a(LoginListener.a(this.a), LoginListener.b(this.a).I().getPublic(), LoginListener.c(this.a)))).toString(16); + String s = (new BigInteger(MinecraftEncryption.a(LoginListener.a(this.a), LoginListener.b(this.a).J().getPublic(), LoginListener.c(this.a)))).toString(16); - LoginListener.a(this.a, LoginListener.b(this.a).as().hasJoinedServer(new GameProfile((String) null, LoginListener.d(this.a).getName()), s)); + LoginListener.a(this.a, LoginListener.b(this.a).at().hasJoinedServer(new GameProfile((String) null, LoginListener.d(this.a).getName()), s)); if (LoginListener.d(this.a) != null) { - // CraftBukkit start - if (!this.a.networkManager.d()) { + // CraftBukkit start - fire PlayerPreLoginEvent + if (!this.a.networkManager.isConnected()) { return; } @@ -72,7 +72,7 @@ class ThreadPlayerLookupUUID extends Thread { } catch (AuthenticationUnavailableException authenticationunavailableexception) { this.a.disconnect("Authentication servers are down. Please try again later, sorry!"); LoginListener.e().error("Couldn\'t verify username because servers are unavailable"); - // CraftBukkit start + // CraftBukkit start - catch all exceptions } catch (Exception exception) { this.a.disconnect("Failed to verify username!"); LoginListener.b(this.a).server.getLogger().log(java.util.logging.Level.WARNING, "Exception verifying " + LoginListener.d(this.a).getName(), exception); diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java index 811f1a45f2..2a3d647c60 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java @@ -173,7 +173,7 @@ public class TileEntity { a(TileEntityFlowerPot.class, "FlowerPot"); } - // CraftBukkit start + // CraftBukkit start - add method public InventoryHolder getOwner() { org.bukkit.block.BlockState state = world.getWorld().getBlockAt(x, y, z).getState(); if (state instanceof InventoryHolder) return (InventoryHolder) state; diff --git a/src/main/java/net/minecraft/server/TileEntityBeacon.java b/src/main/java/net/minecraft/server/TileEntityBeacon.java index cdbcf86d5c..fbc7874f71 100644 --- a/src/main/java/net/minecraft/server/TileEntityBeacon.java +++ b/src/main/java/net/minecraft/server/TileEntityBeacon.java @@ -17,7 +17,7 @@ public class TileEntityBeacon extends TileEntity implements IInventory { private int n; private ItemStack inventorySlot; private String p; - // CraftBukkit start + // CraftBukkit start - add fields and methods public List transaction = new java.util.ArrayList(); private int maxStack = MAX_STACK; @@ -60,7 +60,7 @@ public class TileEntityBeacon extends TileEntity implements IInventory { b0 = 1; } - AxisAlignedBB axisalignedbb = AxisAlignedBB.a().a((double) this.x, (double) this.y, (double) this.z, (double) (this.x + 1), (double) (this.y + 1), (double) (this.z + 1)).grow(d0, d0, d0); + AxisAlignedBB axisalignedbb = AxisAlignedBB.a((double) this.x, (double) this.y, (double) this.z, (double) (this.x + 1), (double) (this.y + 1), (double) (this.z + 1)).grow(d0, d0, d0); axisalignedbb.e = (double) this.world.getHeight(); List list = this.world.a(EntityHuman.class, axisalignedbb); @@ -125,7 +125,7 @@ public class TileEntityBeacon extends TileEntity implements IInventory { } if (!this.world.isStatic && this.l == 4 && i < this.l) { - Iterator iterator = this.world.a(EntityHuman.class, AxisAlignedBB.a().a((double) this.x, (double) this.y, (double) this.z, (double) this.x, (double) (this.y - 4), (double) this.z).grow(10.0D, 5.0D, 10.0D)).iterator(); + Iterator iterator = this.world.a(EntityHuman.class, AxisAlignedBB.a((double) this.x, (double) this.y, (double) this.z, (double) this.x, (double) (this.y - 4), (double) this.z).grow(10.0D, 5.0D, 10.0D)).iterator(); while (iterator.hasNext()) { EntityHuman entityhuman = (EntityHuman) iterator.next(); diff --git a/src/main/java/net/minecraft/server/TileEntityBrewingStand.java b/src/main/java/net/minecraft/server/TileEntityBrewingStand.java index e3cd41e4b8..73869f37bc 100644 --- a/src/main/java/net/minecraft/server/TileEntityBrewingStand.java +++ b/src/main/java/net/minecraft/server/TileEntityBrewingStand.java @@ -17,11 +17,11 @@ public class TileEntityBrewingStand extends TileEntity implements IWorldInventor private int l; private Item m; private String n; - private int lastTick = MinecraftServer.currentTick; // CraftBukkit + private int lastTick = MinecraftServer.currentTick; // CraftBukkit - add field public TileEntityBrewingStand() {} - // CraftBukkit start + // CraftBukkit start - add fields and methods public List transaction = new java.util.ArrayList(); private int maxStack = 64; diff --git a/src/main/java/net/minecraft/server/TileEntityChest.java b/src/main/java/net/minecraft/server/TileEntityChest.java index 51336f7b39..4f45dba322 100644 --- a/src/main/java/net/minecraft/server/TileEntityChest.java +++ b/src/main/java/net/minecraft/server/TileEntityChest.java @@ -25,7 +25,7 @@ public class TileEntityChest extends TileEntity implements IInventory { public TileEntityChest() {} - // CraftBukkit start + // CraftBukkit start - add fields and methods public List transaction = new java.util.ArrayList(); private int maxStack = MAX_STACK; @@ -239,9 +239,13 @@ public class TileEntityChest extends TileEntity implements IInventory { } private boolean a(int i, int j, int k) { - Block block = this.world.getType(i, j, k); + if (this.world == null) { + return false; + } else { + Block block = this.world.getType(i, j, k); - return block instanceof BlockChest && ((BlockChest) block).a == this.j(); + return block instanceof BlockChest && ((BlockChest) block).a == this.j(); + } } public void h() { @@ -254,7 +258,7 @@ public class TileEntityChest extends TileEntity implements IInventory { if (!this.world.isStatic && this.o != 0 && (this.ticks + this.x + this.y + this.z) % 200 == 0) { this.o = 0; f = 5.0F; - List list = this.world.a(EntityHuman.class, AxisAlignedBB.a().a((double) ((float) this.x - f), (double) ((float) this.y - f), (double) ((float) this.z - f), (double) ((float) (this.x + 1) + f), (double) ((float) (this.y + 1) + f), (double) ((float) (this.z + 1) + f))); + List list = this.world.a(EntityHuman.class, AxisAlignedBB.a((double) ((float) this.x - f), (double) ((float) this.y - f), (double) ((float) this.z - f), (double) ((float) (this.x + 1) + f), (double) ((float) (this.y + 1) + f), (double) ((float) (this.z + 1) + f))); Iterator iterator = list.iterator(); while (iterator.hasNext()) { diff --git a/src/main/java/net/minecraft/server/TileEntityDispenser.java b/src/main/java/net/minecraft/server/TileEntityDispenser.java index ab914623d3..81204b667c 100644 --- a/src/main/java/net/minecraft/server/TileEntityDispenser.java +++ b/src/main/java/net/minecraft/server/TileEntityDispenser.java @@ -15,7 +15,7 @@ public class TileEntityDispenser extends TileEntity implements IInventory { private Random j = new Random(); protected String a; - // CraftBukkit start + // CraftBukkit start - add fields and methods public List transaction = new java.util.ArrayList(); private int maxStack = MAX_STACK; diff --git a/src/main/java/net/minecraft/server/TileEntityFurnace.java b/src/main/java/net/minecraft/server/TileEntityFurnace.java index 945969a3b6..8f8771cca8 100644 --- a/src/main/java/net/minecraft/server/TileEntityFurnace.java +++ b/src/main/java/net/minecraft/server/TileEntityFurnace.java @@ -21,7 +21,7 @@ public class TileEntityFurnace extends TileEntity implements IWorldInventory { public int cookTime; private String o; - // CraftBukkit start + // CraftBukkit start - add fields and methods private int lastTick = MinecraftServer.currentTick; private int maxStack = MAX_STACK; public List transaction = new java.util.ArrayList(); @@ -183,49 +183,51 @@ public class TileEntityFurnace extends TileEntity implements IWorldInventory { // CraftBukkit end if (this.burnTime > 0) { - this.burnTime -= elapsedTicks; // CraftBukkit + this.burnTime -= elapsedTicks; // CraftBukkit - use elapsedTicks in place of constant } if (!this.world.isStatic) { - // CraftBukkit start - Handle multiple elapsed ticks - if (this.burnTime <= 0 && this.canBurn() && this.items[1] != null) { // CraftBukkit - == to <= - CraftItemStack fuel = CraftItemStack.asCraftMirror(this.items[1]); + if (this.burnTime != 0 || this.items[1] != null && this.items[0] != null) { + // CraftBukkit start - Handle multiple elapsed ticks + if (this.burnTime <= 0 && this.canBurn()) { // CraftBukkit - == to <= + CraftItemStack fuel = CraftItemStack.asCraftMirror(this.items[1]); - FurnaceBurnEvent furnaceBurnEvent = new FurnaceBurnEvent(this.world.getWorld().getBlockAt(this.x, this.y, this.z), fuel, fuelTime(this.items[1])); - this.world.getServer().getPluginManager().callEvent(furnaceBurnEvent); + FurnaceBurnEvent furnaceBurnEvent = new FurnaceBurnEvent(this.world.getWorld().getBlockAt(this.x, this.y, this.z), fuel, fuelTime(this.items[1])); + this.world.getServer().getPluginManager().callEvent(furnaceBurnEvent); - if (furnaceBurnEvent.isCancelled()) { - return; - } + if (furnaceBurnEvent.isCancelled()) { + return; + } - this.ticksForCurrentFuel = furnaceBurnEvent.getBurnTime(); - this.burnTime += this.ticksForCurrentFuel; - if (this.burnTime > 0 && furnaceBurnEvent.isBurning()) { - // CraftBukkit end - flag1 = true; - if (this.items[1] != null) { - --this.items[1].count; - if (this.items[1].count == 0) { - Item item = this.items[1].getItem().t(); + this.ticksForCurrentFuel = furnaceBurnEvent.getBurnTime(); + this.burnTime += this.ticksForCurrentFuel; + if (this.burnTime > 0 && furnaceBurnEvent.isBurning()) { + // CraftBukkit end + flag1 = true; + if (this.items[1] != null) { + --this.items[1].count; + if (this.items[1].count == 0) { + Item item = this.items[1].getItem().t(); - this.items[1] = item != null ? new ItemStack(item) : null; + this.items[1] = item != null ? new ItemStack(item) : null; + } } } } - } - /* CraftBukkit start - Moved up - if (this.isBurning() && this.canBurn()) { - ++this.cookTime; - if (this.cookTime == 200) { + /* CraftBukkit start - Moved up + if (this.isBurning() && this.canBurn()) { + ++this.cookTime; + if (this.cookTime == 200) { + this.cookTime = 0; + this.burn(); + flag1 = true; + } + } else { this.cookTime = 0; - this.burn(); - flag1 = true; } - } else { - this.cookTime = 0; + */ } - // CraftBukkit end */ if (flag != this.burnTime > 0) { flag1 = true; @@ -253,7 +255,7 @@ public class TileEntityFurnace extends TileEntity implements IWorldInventory { if (this.canBurn()) { ItemStack itemstack = RecipesFurnace.getInstance().getResult(this.items[0]); - // CraftBukkit start + // CraftBukkit start - fire FurnaceSmeltEvent CraftItemStack source = CraftItemStack.asCraftMirror(this.items[0]); org.bukkit.inventory.ItemStack result = CraftItemStack.asBukkitCopy(itemstack); diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java index 730eb78c59..563d9c8094 100644 --- a/src/main/java/net/minecraft/server/TileEntityHopper.java +++ b/src/main/java/net/minecraft/server/TileEntityHopper.java @@ -17,7 +17,7 @@ public class TileEntityHopper extends TileEntity implements IHopper { private String i; private int j = -1; - // CraftBukkit start + // CraftBukkit start - add fields and methods public List transaction = new java.util.ArrayList(); private int maxStack = MAX_STACK; @@ -178,9 +178,16 @@ public class TileEntityHopper extends TileEntity implements IHopper { public boolean i() { if (this.world != null && !this.world.isStatic) { if (!this.j() && BlockHopper.c(this.p())) { - boolean flag = this.k(); + boolean flag = false; + + if (!this.k()) { + flag = this.x(); + } + + if (!this.l()) { + flag = suckInItems(this) || flag; + } - flag = suckInItems(this) || flag; if (flag) { this.c(8); this.update(); @@ -195,50 +202,136 @@ public class TileEntityHopper extends TileEntity implements IHopper { } private boolean k() { - IInventory iinventory = this.l(); + ItemStack[] aitemstack = this.a; + int i = aitemstack.length; + + for (int j = 0; j < i; ++j) { + ItemStack itemstack = aitemstack[j]; + + if (itemstack != null) { + return false; + } + } + + return true; + } + + private boolean l() { + ItemStack[] aitemstack = this.a; + int i = aitemstack.length; + + for (int j = 0; j < i; ++j) { + ItemStack itemstack = aitemstack[j]; + + if (itemstack == null || itemstack.count != itemstack.getMaxStackSize()) { + return false; + } + } + + return true; + } + + private boolean x() { + IInventory iinventory = this.y(); if (iinventory == null) { return false; } else { - for (int i = 0; i < this.getSize(); ++i) { - if (this.getItem(i) != null) { - ItemStack itemstack = this.getItem(i).cloneItemStack(); - // CraftBukkit start - Call event when pushing items into other inventories - CraftItemStack oitemstack = CraftItemStack.asCraftMirror(this.splitStack(i, 1)); + int i = Facing.OPPOSITE_FACING[BlockHopper.b(this.p())]; - Inventory destinationInventory; - // Have to special case large chests as they work oddly - if (iinventory instanceof InventoryLargeChest) { - destinationInventory = new org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest((InventoryLargeChest) iinventory); - } else { - destinationInventory = iinventory.getOwner().getInventory(); - } + if (this.a(iinventory, i)) { + return false; + } else { + for (int j = 0; j < this.getSize(); ++j) { + if (this.getItem(j) != null) { + ItemStack itemstack = this.getItem(j).cloneItemStack(); + // CraftBukkit start - Call event when pushing items into other inventories + CraftItemStack oitemstack = CraftItemStack.asCraftMirror(this.splitStack(j, 1)); - InventoryMoveItemEvent event = new InventoryMoveItemEvent(this.getOwner().getInventory(), oitemstack.clone(), destinationInventory, true); - this.getWorld().getServer().getPluginManager().callEvent(event); - if (event.isCancelled()) { - this.setItem(i, itemstack); - this.c(8); // Delay hopper checks - return false; - } - ItemStack itemstack1 = addItem(iinventory, CraftItemStack.asNMSCopy(event.getItem()), Facing.OPPOSITE_FACING[BlockHopper.b(this.p())]); - - if (itemstack1 == null || itemstack1.count == 0) { - if (event.getItem().equals(oitemstack)) { - iinventory.update(); + Inventory destinationInventory; + // Have to special case large chests as they work oddly + if (iinventory instanceof InventoryLargeChest) { + destinationInventory = new org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest((InventoryLargeChest) iinventory); } else { - this.setItem(i, itemstack); + destinationInventory = iinventory.getOwner().getInventory(); } - // CraftBukkit end - return true; - } - this.setItem(i, itemstack); + InventoryMoveItemEvent event = new InventoryMoveItemEvent(this.getOwner().getInventory(), oitemstack.clone(), destinationInventory, true); + this.getWorld().getServer().getPluginManager().callEvent(event); + if (event.isCancelled()) { + this.setItem(i, itemstack); + this.c(8); // Delay hopper checks + return false; + } + ItemStack itemstack1 = addItem(iinventory, CraftItemStack.asNMSCopy(event.getItem()), i); + + if (itemstack1 == null || itemstack1.count == 0) { + if (event.getItem().equals(oitemstack)) { + iinventory.update(); + } else { + this.setItem(j, itemstack); + } + // CraftBukkit end + return true; + } + + this.setItem(j, itemstack); + } + } + + return false; + } + } + } + + private boolean a(IInventory iinventory, int i) { + if (iinventory instanceof IWorldInventory && i > -1) { + IWorldInventory iworldinventory = (IWorldInventory) iinventory; + int[] aint = iworldinventory.getSlotsForFace(i); + + for (int j = 0; j < aint.length; ++j) { + ItemStack itemstack = iworldinventory.getItem(aint[j]); + + if (itemstack == null || itemstack.count != itemstack.getMaxStackSize()) { + return false; } } + } else { + int k = iinventory.getSize(); - return false; + for (int l = 0; l < k; ++l) { + ItemStack itemstack1 = iinventory.getItem(l); + + if (itemstack1 == null || itemstack1.count != itemstack1.getMaxStackSize()) { + return false; + } + } } + + return true; + } + + private static boolean b(IInventory iinventory, int i) { + if (iinventory instanceof IWorldInventory && i > -1) { + IWorldInventory iworldinventory = (IWorldInventory) iinventory; + int[] aint = iworldinventory.getSlotsForFace(i); + + for (int j = 0; j < aint.length; ++j) { + if (iworldinventory.getItem(aint[j]) != null) { + return false; + } + } + } else { + int k = iinventory.getSize(); + + for (int l = 0; l < k; ++l) { + if (iinventory.getItem(l) != null) { + return false; + } + } + } + + return true; } public static boolean suckInItems(IHopper ihopper) { @@ -247,6 +340,10 @@ public class TileEntityHopper extends TileEntity implements IHopper { if (iinventory != null) { byte b0 = 0; + if (b(iinventory, b0)) { + return false; + } + if (iinventory instanceof IWorldInventory && b0 > -1) { IWorldInventory iworldinventory = (IWorldInventory) iinventory; int[] aint = iworldinventory.getSlotsForFace(b0); @@ -266,7 +363,7 @@ public class TileEntityHopper extends TileEntity implements IHopper { } } } else { - EntityItem entityitem = getEntityItemAt(ihopper.getWorld(), ihopper.x(), ihopper.aD() + 1.0D, ihopper.aE()); + EntityItem entityitem = getEntityItemAt(ihopper.getWorld(), ihopper.aC(), ihopper.aD() + 1.0D, ihopper.aE()); if (entityitem != null) { return addEntityItem(ihopper, entityitem); @@ -416,18 +513,18 @@ public class TileEntityHopper extends TileEntity implements IHopper { return itemstack; } - private IInventory l() { + private IInventory y() { int i = BlockHopper.b(this.p()); return getInventoryAt(this.getWorld(), (double) (this.x + Facing.b[i]), (double) (this.y + Facing.c[i]), (double) (this.z + Facing.d[i])); } public static IInventory getSourceInventory(IHopper ihopper) { - return getInventoryAt(ihopper.getWorld(), ihopper.x(), ihopper.aD() + 1.0D, ihopper.aE()); + return getInventoryAt(ihopper.getWorld(), ihopper.aC(), ihopper.aD() + 1.0D, ihopper.aE()); } public static EntityItem getEntityItemAt(World world, double d0, double d1, double d2) { - List list = world.a(EntityItem.class, AxisAlignedBB.a().a(d0, d1, d2, d0 + 1.0D, d1 + 1.0D, d2 + 1.0D), IEntitySelector.a); + List list = world.a(EntityItem.class, AxisAlignedBB.a(d0, d1, d2, d0 + 1.0D, d1 + 1.0D, d2 + 1.0D), IEntitySelector.a); return list.size() > 0 ? (EntityItem) list.get(0) : null; } @@ -451,7 +548,7 @@ public class TileEntityHopper extends TileEntity implements IHopper { } if (iinventory == null) { - List list = world.getEntities((Entity) null, AxisAlignedBB.a().a(d0, d1, d2, d0 + 1.0D, d1 + 1.0D, d2 + 1.0D), IEntitySelector.b); + List list = world.getEntities((Entity) null, AxisAlignedBB.a(d0, d1, d2, d0 + 1.0D, d1 + 1.0D, d2 + 1.0D), IEntitySelector.c); if (list != null && list.size() > 0) { iinventory = (IInventory) list.get(world.random.nextInt(list.size())); @@ -465,7 +562,7 @@ public class TileEntityHopper extends TileEntity implements IHopper { return itemstack.getItem() != itemstack1.getItem() ? false : (itemstack.getData() != itemstack1.getData() ? false : (itemstack.count > itemstack.getMaxStackSize() ? false : ItemStack.equals(itemstack, itemstack1))); } - public double x() { + public double aC() { return (double) this.x; } diff --git a/src/main/java/net/minecraft/server/TileEntitySkull.java b/src/main/java/net/minecraft/server/TileEntitySkull.java index c4946ed4f2..b241cfeee7 100644 --- a/src/main/java/net/minecraft/server/TileEntitySkull.java +++ b/src/main/java/net/minecraft/server/TileEntitySkull.java @@ -44,7 +44,7 @@ public class TileEntitySkull extends TileEntity { this.i = i; } - // CraftBukkit start + // CraftBukkit start - add method public int getRotation() { return this.i; } diff --git a/src/main/java/net/minecraft/server/Vec3D.java b/src/main/java/net/minecraft/server/Vec3D.java deleted file mode 100644 index a668e18f63..0000000000 --- a/src/main/java/net/minecraft/server/Vec3D.java +++ /dev/null @@ -1,153 +0,0 @@ -package net.minecraft.server; - -public class Vec3D { - - public static final Vec3DPool a = new Vec3DPool(-1, -1); - public final Vec3DPool b; - public double c; - public double d; - public double e; - public Vec3D next; // CraftBukkit - - public static Vec3D a(double d0, double d1, double d2) { - return new Vec3D(a, d0, d1, d2); - } - - protected Vec3D(Vec3DPool vec3dpool, double d0, double d1, double d2) { - if (d0 == -0.0D) { - d0 = 0.0D; - } - - if (d1 == -0.0D) { - d1 = 0.0D; - } - - if (d2 == -0.0D) { - d2 = 0.0D; - } - - this.c = d0; - this.d = d1; - this.e = d2; - this.b = vec3dpool; - } - - protected Vec3D b(double d0, double d1, double d2) { - this.c = d0; - this.d = d1; - this.e = d2; - return this; - } - - public Vec3D a() { - double d0 = (double) MathHelper.sqrt(this.c * this.c + this.d * this.d + this.e * this.e); - - return d0 < 1.0E-4D ? this.b.create(0.0D, 0.0D, 0.0D) : this.b.create(this.c / d0, this.d / d0, this.e / d0); - } - - public double b(Vec3D vec3d) { - return this.c * vec3d.c + this.d * vec3d.d + this.e * vec3d.e; - } - - public Vec3D add(double d0, double d1, double d2) { - return this.b.create(this.c + d0, this.d + d1, this.e + d2); - } - - public double d(Vec3D vec3d) { - double d0 = vec3d.c - this.c; - double d1 = vec3d.d - this.d; - double d2 = vec3d.e - this.e; - - return (double) MathHelper.sqrt(d0 * d0 + d1 * d1 + d2 * d2); - } - - public double distanceSquared(Vec3D vec3d) { - double d0 = vec3d.c - this.c; - double d1 = vec3d.d - this.d; - double d2 = vec3d.e - this.e; - - return d0 * d0 + d1 * d1 + d2 * d2; - } - - public double d(double d0, double d1, double d2) { - double d3 = d0 - this.c; - double d4 = d1 - this.d; - double d5 = d2 - this.e; - - return d3 * d3 + d4 * d4 + d5 * d5; - } - - public double b() { - return (double) MathHelper.sqrt(this.c * this.c + this.d * this.d + this.e * this.e); - } - - public Vec3D b(Vec3D vec3d, double d0) { - double d1 = vec3d.c - this.c; - double d2 = vec3d.d - this.d; - double d3 = vec3d.e - this.e; - - if (d1 * d1 < 1.0000000116860974E-7D) { - return null; - } else { - double d4 = (d0 - this.c) / d1; - - return d4 >= 0.0D && d4 <= 1.0D ? this.b.create(this.c + d1 * d4, this.d + d2 * d4, this.e + d3 * d4) : null; - } - } - - public Vec3D c(Vec3D vec3d, double d0) { - double d1 = vec3d.c - this.c; - double d2 = vec3d.d - this.d; - double d3 = vec3d.e - this.e; - - if (d2 * d2 < 1.0000000116860974E-7D) { - return null; - } else { - double d4 = (d0 - this.d) / d2; - - return d4 >= 0.0D && d4 <= 1.0D ? this.b.create(this.c + d1 * d4, this.d + d2 * d4, this.e + d3 * d4) : null; - } - } - - public Vec3D d(Vec3D vec3d, double d0) { - double d1 = vec3d.c - this.c; - double d2 = vec3d.d - this.d; - double d3 = vec3d.e - this.e; - - if (d3 * d3 < 1.0000000116860974E-7D) { - return null; - } else { - double d4 = (d0 - this.e) / d3; - - return d4 >= 0.0D && d4 <= 1.0D ? this.b.create(this.c + d1 * d4, this.d + d2 * d4, this.e + d3 * d4) : null; - } - } - - public String toString() { - return "(" + this.c + ", " + this.d + ", " + this.e + ")"; - } - - public void a(float f) { - float f1 = MathHelper.cos(f); - float f2 = MathHelper.sin(f); - double d0 = this.c; - double d1 = this.d * (double) f1 + this.e * (double) f2; - double d2 = this.e * (double) f1 - this.d * (double) f2; - - this.c = d0; - this.d = d1; - this.e = d2; - } - - public void b(float f) { - float f1 = MathHelper.cos(f); - float f2 = MathHelper.sin(f); - double d0 = this.c * (double) f1 + this.e * (double) f2; - double d1 = this.d; - double d2 = this.e * (double) f1 - this.c * (double) f2; - - this.c = d0; - this.d = d1; - this.e = d2; - } -} diff --git a/src/main/java/net/minecraft/server/Vec3DPool.java b/src/main/java/net/minecraft/server/Vec3DPool.java deleted file mode 100644 index f8e54c2344..0000000000 --- a/src/main/java/net/minecraft/server/Vec3DPool.java +++ /dev/null @@ -1,112 +0,0 @@ -package net.minecraft.server; - -import java.util.ArrayList; -import java.util.List; - -public class Vec3DPool { - - private final int a; - private final int b; - // CraftBukkit start - // private final List pool = new ArrayList(); - private Vec3D freelist = null; - private Vec3D alloclist = null; - private Vec3D freelisthead = null; - private Vec3D alloclisthead = null; - private int total_size = 0; - // CraftBukkit end - private int position; - private int largestSize; - private int resizeTime; - - public Vec3DPool(int i, int j) { - this.a = i; - this.b = j; - } - - public final Vec3D create(double d0, double d1, double d2) { // CraftBukkit - Add final - if (this.resizeTime == 0) return Vec3D.a(d0, d1, d2); // CraftBukkit - Don't pool objects indefinitely if thread doesn't adhere to contract - Vec3D vec3d; - - if (this.freelist == null) { // CraftBukkit - vec3d = new Vec3D(this, d0, d1, d2); - this.total_size++; // CraftBukkit - } else { - // CraftBukkit start - vec3d = this.freelist; - this.freelist = vec3d.next; - // CraftBukkit end - vec3d.b(d0, d1, d2); - } - - // CraftBukkit start - if (this.alloclist == null) { - this.alloclisthead = vec3d; - } - vec3d.next = this.alloclist; // Add to allocated list - this.alloclist = vec3d; - // CraftBukkit end - ++this.position; - return vec3d; - } - - // CraftBukkit start - Offer back vector (can save LOTS of unneeded bloat) - works about 90% of the time - public void release(Vec3D v) { - if (this.alloclist == v) { - this.alloclist = v.next; // Pop off alloc list - // Push on to free list - if (this.freelist == null) this.freelisthead = v; - v.next = this.freelist; - this.freelist = v; - this.position--; - } - } - // CraftBukkit end - - public void a() { - if (this.position > this.largestSize) { - this.largestSize = this.position; - } - - // CraftBukkit start - Intelligent cache - // Take any allocated blocks and put them on free list - if (this.alloclist != null) { - if (this.freelist == null) { - this.freelist = this.alloclist; - this.freelisthead = this.alloclisthead; - } - else { - this.alloclisthead.next = this.freelist; - this.freelist = this.alloclist; - this.freelisthead = this.alloclisthead; - } - this.alloclist = null; - } - if ((this.resizeTime++ & 0xff) == 0) { - int newSize = total_size - (total_size >> 3); - if (newSize > this.largestSize) { // newSize will be 87.5%, but if we were not in that range, we clear some of the cache - for (int i = total_size; i > newSize; i--) { - freelist = freelist.next; - } - total_size = newSize; - } - this.largestSize = 0; - // this.f = 0; // We do not reset to zero; it doubles for a flag - } - - this.position = 0; - // CraftBukkit end - } - - public int c() { - return this.total_size; // CraftBukkit - } - - public int d() { - return this.position; - } - - private boolean e() { - return this.b < 0 || this.a < 0; - } -} diff --git a/src/main/java/net/minecraft/server/Village.java b/src/main/java/net/minecraft/server/Village.java index 1e08de2b0f..89f1b74e7f 100644 --- a/src/main/java/net/minecraft/server/Village.java +++ b/src/main/java/net/minecraft/server/Village.java @@ -50,7 +50,7 @@ public class Village { if (vec3d != null) { EntityIronGolem entityirongolem = new EntityIronGolem(this.world); - entityirongolem.setPosition(vec3d.c, vec3d.d, vec3d.e); + entityirongolem.setPosition(vec3d.a, vec3d.b, vec3d.c); this.world.addEntity(entityirongolem, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.VILLAGE_DEFENSE); // CraftBukkit ++this.ironGolemCount; } @@ -64,7 +64,7 @@ public class Village { int j2 = k + this.world.random.nextInt(16) - 8; if (this.a(l1, i2, j2) && this.b(l1, i2, j2, l, i1, j1)) { - return this.world.getVec3DPool().create((double) l1, (double) i2, (double) j2); + return Vec3D.a((double) l1, (double) i2, (double) j2); } } @@ -93,13 +93,13 @@ public class Village { } private void countPopulation() { - List list = this.world.a(EntityIronGolem.class, AxisAlignedBB.a().a((double) (this.center.x - this.size), (double) (this.center.y - 4), (double) (this.center.z - this.size), (double) (this.center.x + this.size), (double) (this.center.y + 4), (double) (this.center.z + this.size))); + List list = this.world.a(EntityIronGolem.class, AxisAlignedBB.a((double) (this.center.x - this.size), (double) (this.center.y - 4), (double) (this.center.z - this.size), (double) (this.center.x + this.size), (double) (this.center.y + 4), (double) (this.center.z + this.size))); this.ironGolemCount = list.size(); } private void k() { - List list = this.world.a(EntityVillager.class, AxisAlignedBB.a().a((double) (this.center.x - this.size), (double) (this.center.y - 4), (double) (this.center.z - this.size), (double) (this.center.x + this.size), (double) (this.center.y + 4), (double) (this.center.z + this.size))); + List list = this.world.a(EntityVillager.class, AxisAlignedBB.a((double) (this.center.x - this.size), (double) (this.center.y - 4), (double) (this.center.z - this.size), (double) (this.center.x + this.size), (double) (this.center.y + 4), (double) (this.center.z + this.size))); this.population = list.size(); if (this.population == 0) { @@ -233,7 +233,7 @@ public class Village { for (int i = 0; i < this.aggressors.size(); ++i) { VillageAggressor villageaggressor1 = (VillageAggressor) this.aggressors.get(i); - double d1 = villageaggressor1.a.e(entityliving); + double d1 = villageaggressor1.a.f(entityliving); if (d1 <= d0) { villageaggressor = villageaggressor1; @@ -256,7 +256,7 @@ public class Village { EntityHuman entityhuman1 = this.world.a(s); if (entityhuman1 != null) { - double d1 = entityhuman1.e(entityliving); + double d1 = entityhuman1.f(entityliving); if (d1 <= d0) { entityhuman = entityhuman1; diff --git a/src/main/java/net/minecraft/server/VillageSiege.java b/src/main/java/net/minecraft/server/VillageSiege.java index 7cf4fbe453..fc83932b3d 100644 --- a/src/main/java/net/minecraft/server/VillageSiege.java +++ b/src/main/java/net/minecraft/server/VillageSiege.java @@ -28,7 +28,7 @@ public class VillageSiege { return; } } else { - if (this.world.v()) { + if (this.world.w()) { this.c = 0; return; } @@ -146,7 +146,7 @@ public class VillageSiege { return false; } - entityzombie.setPositionRotation(vec3d.c, vec3d.d, vec3d.e, this.world.random.nextFloat() * 360.0F, 0.0F); + entityzombie.setPositionRotation(vec3d.a, vec3d.b, vec3d.c, this.world.random.nextFloat() * 360.0F, 0.0F); this.world.addEntity(entityzombie, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.VILLAGE_INVASION); // CraftBukkit ChunkCoordinates chunkcoordinates = this.f.getCenter(); @@ -163,7 +163,7 @@ public class VillageSiege { if (this.f.a(i1, j1, k1) && SpawnerCreature.a(EnumCreatureType.MONSTER, this.world, i1, j1, k1)) { // CraftBukkit - add Return - return this.world.getVec3DPool().create((double) i1, (double) j1, (double) k1); + return Vec3D.a((double) i1, (double) j1, (double) k1); } } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java index 4a42bb450a..2f514b5e1a 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -56,13 +56,12 @@ public abstract class World implements IBlockAccess { public final PersistentVillage villages; protected final VillageSiege siegeManager = new VillageSiege(this); public final MethodProfiler methodProfiler; - private final Vec3DPool J = new Vec3DPool(300, 2000); - private final Calendar K = Calendar.getInstance(); + private final Calendar J = Calendar.getInstance(); public Scoreboard scoreboard = new Scoreboard(); // CraftBukkit - protected -> public public boolean isStatic; // CraftBukkit start - public, longhashset protected LongHashSet chunkTickList = new LongHashSet(); - private int L; + private int K; public boolean allowMonsters; public boolean allowAnimals; // Added the following @@ -72,8 +71,8 @@ public abstract class World implements IBlockAccess { public boolean populating; private int tickPosition; // CraftBukkit end - private ArrayList M; - private boolean N; + private ArrayList L; + private boolean M; int[] I; public BiomeBase getBiome(int i, int j) { @@ -124,10 +123,10 @@ public abstract class World implements IBlockAccess { this.ticksPerMonsterSpawns = this.getServer().getTicksPerMonsterSpawns(); // CraftBukkit // CraftBukkit end - this.L = this.random.nextInt(12000); + this.K = this.random.nextInt(12000); this.allowMonsters = true; this.allowAnimals = true; - this.M = new ArrayList(); + this.L = new ArrayList(); this.I = new int['\u8000']; this.dataManager = idatamanager; this.methodProfiler = methodprofiler; @@ -177,7 +176,7 @@ public abstract class World implements IBlockAccess { this.villages.a(this); } - this.A(); + this.B(); this.a(); this.getServer().addWorld(this.world); // CraftBukkit @@ -652,7 +651,7 @@ public abstract class World implements IBlockAccess { return this.worldProvider.h[this.getLightLevel(i, j, k)]; } - public boolean v() { + public boolean w() { return this.j < 4; } @@ -665,14 +664,14 @@ public abstract class World implements IBlockAccess { } public MovingObjectPosition rayTrace(Vec3D vec3d, Vec3D vec3d1, boolean flag, boolean flag1, boolean flag2) { - if (!Double.isNaN(vec3d.c) && !Double.isNaN(vec3d.d) && !Double.isNaN(vec3d.e)) { - if (!Double.isNaN(vec3d1.c) && !Double.isNaN(vec3d1.d) && !Double.isNaN(vec3d1.e)) { - int i = MathHelper.floor(vec3d1.c); - int j = MathHelper.floor(vec3d1.d); - int k = MathHelper.floor(vec3d1.e); - int l = MathHelper.floor(vec3d.c); - int i1 = MathHelper.floor(vec3d.d); - int j1 = MathHelper.floor(vec3d.e); + if (!Double.isNaN(vec3d.a) && !Double.isNaN(vec3d.b) && !Double.isNaN(vec3d.c)) { + if (!Double.isNaN(vec3d1.a) && !Double.isNaN(vec3d1.b) && !Double.isNaN(vec3d1.c)) { + int i = MathHelper.floor(vec3d1.a); + int j = MathHelper.floor(vec3d1.b); + int k = MathHelper.floor(vec3d1.c); + int l = MathHelper.floor(vec3d.a); + int i1 = MathHelper.floor(vec3d.b); + int j1 = MathHelper.floor(vec3d.c); Block block = this.getType(l, i1, j1); int k1 = this.getData(l, i1, j1); @@ -689,7 +688,7 @@ public abstract class World implements IBlockAccess { k1 = 200; while (k1-- >= 0) { - if (Double.isNaN(vec3d.c) || Double.isNaN(vec3d.d) || Double.isNaN(vec3d.e)) { + if (Double.isNaN(vec3d.a) || Double.isNaN(vec3d.b) || Double.isNaN(vec3d.c)) { return null; } @@ -731,20 +730,20 @@ public abstract class World implements IBlockAccess { double d3 = 999.0D; double d4 = 999.0D; double d5 = 999.0D; - double d6 = vec3d1.c - vec3d.c; - double d7 = vec3d1.d - vec3d.d; - double d8 = vec3d1.e - vec3d.e; + double d6 = vec3d1.a - vec3d.a; + double d7 = vec3d1.b - vec3d.b; + double d8 = vec3d1.c - vec3d.c; if (flag3) { - d3 = (d0 - vec3d.c) / d6; + d3 = (d0 - vec3d.a) / d6; } if (flag4) { - d4 = (d1 - vec3d.d) / d7; + d4 = (d1 - vec3d.b) / d7; } if (flag5) { - d5 = (d2 - vec3d.e) / d8; + d5 = (d2 - vec3d.c) / d8; } boolean flag6 = false; @@ -757,9 +756,9 @@ public abstract class World implements IBlockAccess { b0 = 5; } - vec3d.c = d0; - vec3d.d += d7 * d3; - vec3d.e += d8 * d3; + vec3d.a = d0; + vec3d.b += d7 * d3; + vec3d.c += d8 * d3; } else if (d4 < d5) { if (j > i1) { b0 = 0; @@ -767,9 +766,9 @@ public abstract class World implements IBlockAccess { b0 = 1; } - vec3d.c += d6 * d4; - vec3d.d = d1; - vec3d.e += d8 * d4; + vec3d.a += d6 * d4; + vec3d.b = d1; + vec3d.c += d8 * d4; } else { if (k > j1) { b0 = 2; @@ -777,29 +776,29 @@ public abstract class World implements IBlockAccess { b0 = 3; } - vec3d.c += d6 * d5; - vec3d.d += d7 * d5; - vec3d.e = d2; + vec3d.a += d6 * d5; + vec3d.b += d7 * d5; + vec3d.c = d2; } - Vec3D vec3d2 = this.getVec3DPool().create(vec3d.c, vec3d.d, vec3d.e); + Vec3D vec3d2 = Vec3D.a(vec3d.a, vec3d.b, vec3d.c); - l = (int) (vec3d2.c = (double) MathHelper.floor(vec3d.c)); + l = (int) (vec3d2.a = (double) MathHelper.floor(vec3d.a)); if (b0 == 5) { --l; - ++vec3d2.c; + ++vec3d2.a; } - i1 = (int) (vec3d2.d = (double) MathHelper.floor(vec3d.d)); + i1 = (int) (vec3d2.b = (double) MathHelper.floor(vec3d.b)); if (b0 == 1) { --i1; - ++vec3d2.d; + ++vec3d2.b; } - j1 = (int) (vec3d2.e = (double) MathHelper.floor(vec3d.e)); + j1 = (int) (vec3d2.c = (double) MathHelper.floor(vec3d.c)); if (b0 == 3) { --j1; - ++vec3d2.e; + ++vec3d2.c; } Block block1 = this.getType(l, i1, j1); @@ -810,14 +809,12 @@ public abstract class World implements IBlockAccess { MovingObjectPosition movingobjectposition2 = block1.a(this, l, i1, j1, vec3d, vec3d1); if (movingobjectposition2 != null) { - vec3d2.b.release(vec3d2); // CraftBukkit return movingobjectposition2; } } else { movingobjectposition1 = new MovingObjectPosition(l, i1, j1, b0, vec3d, false); } } - vec3d2.b.release(vec3d2); // CraftBukkit } return flag2 ? movingobjectposition1 : null; @@ -877,7 +874,7 @@ public abstract class World implements IBlockAccess { int i = MathHelper.floor(entity.locX / 16.0D); int j = MathHelper.floor(entity.locZ / 16.0D); - boolean flag = entity.o; + boolean flag = entity.n; if (entity instanceof EntityHuman) { flag = true; @@ -967,10 +964,10 @@ public abstract class World implements IBlockAccess { this.everyoneSleeping(); } - int i = entity.ai; - int j = entity.ak; + int i = entity.ah; + int j = entity.aj; - if (entity.ah && this.isChunkLoaded(i, j)) { + if (entity.ag && this.isChunkLoaded(i, j)) { this.getChunkAt(i, j).b(entity); } @@ -992,7 +989,7 @@ public abstract class World implements IBlockAccess { } public List getCubes(Entity entity, AxisAlignedBB axisalignedbb) { - this.M.clear(); + this.L.clear(); int i = MathHelper.floor(axisalignedbb.a); int j = MathHelper.floor(axisalignedbb.d + 1.0D); int k = MathHelper.floor(axisalignedbb.b); @@ -1012,7 +1009,7 @@ public abstract class World implements IBlockAccess { block = Blocks.STONE; } - block.a(this, k1, i2, l1, axisalignedbb, this.M, entity); + block.a(this, k1, i2, l1, axisalignedbb, this.L, entity); } } } @@ -1022,23 +1019,23 @@ public abstract class World implements IBlockAccess { List list = this.getEntities(entity, axisalignedbb.grow(d0, d0, d0)); for (int j2 = 0; j2 < list.size(); ++j2) { - AxisAlignedBB axisalignedbb1 = ((Entity) list.get(j2)).J(); + AxisAlignedBB axisalignedbb1 = ((Entity) list.get(j2)).I(); if (axisalignedbb1 != null && axisalignedbb1.b(axisalignedbb)) { - this.M.add(axisalignedbb1); + this.L.add(axisalignedbb1); } - axisalignedbb1 = entity.g((Entity) list.get(j2)); + axisalignedbb1 = entity.h((Entity) list.get(j2)); if (axisalignedbb1 != null && axisalignedbb1.b(axisalignedbb)) { - this.M.add(axisalignedbb1); + this.L.add(axisalignedbb1); } } - return this.M; + return this.L; } public List a(AxisAlignedBB axisalignedbb) { - this.M.clear(); + this.L.clear(); int i = MathHelper.floor(axisalignedbb.a); int j = MathHelper.floor(axisalignedbb.d + 1.0D); int k = MathHelper.floor(axisalignedbb.b); @@ -1058,13 +1055,13 @@ public abstract class World implements IBlockAccess { block = Blocks.BEDROCK; } - block.a(this, k1, i2, l1, axisalignedbb, this.M, (Entity) null); + block.a(this, k1, i2, l1, axisalignedbb, this.L, (Entity) null); } } } } - return this.M; + return this.L; } public int a(float f) { @@ -1090,7 +1087,7 @@ public abstract class World implements IBlockAccess { return this.worldProvider.a(this.worldData.getDayTime(), f); } - public float x() { + public float y() { return WorldProvider.a[this.worldProvider.a(this.worldData.getDayTime())]; } @@ -1177,9 +1174,9 @@ public abstract class World implements IBlockAccess { for (i = 0; i < this.f.size(); ++i) { entity = (Entity) this.f.get(i); - j = entity.ai; - k = entity.ak; - if (entity.ah && this.isChunkLoaded(j, k)) { + j = entity.ah; + k = entity.aj; + if (entity.ag && this.isChunkLoaded(j, k)) { this.getChunkAt(j, k).b(entity); } } @@ -1226,9 +1223,9 @@ public abstract class World implements IBlockAccess { this.methodProfiler.b(); this.methodProfiler.a("remove"); if (entity.dead) { - j = entity.ai; - k = entity.ak; - if (entity.ah && this.isChunkLoaded(j, k)) { + j = entity.ah; + k = entity.aj; + if (entity.ag && this.isChunkLoaded(j, k)) { this.getChunkAt(j, k).b(entity); } @@ -1240,7 +1237,7 @@ public abstract class World implements IBlockAccess { } this.methodProfiler.c("blockEntities"); - this.N = true; + this.M = true; Iterator iterator = this.tileEntityList.iterator(); while (iterator.hasNext()) { @@ -1275,7 +1272,7 @@ public abstract class World implements IBlockAccess { } } - this.N = false; + this.M = false; if (!this.b.isEmpty()) { this.tileEntityList.removeAll(this.b); this.b.clear(); @@ -1318,7 +1315,7 @@ public abstract class World implements IBlockAccess { } public void a(Collection collection) { - if (this.N) { + if (this.M) { this.a.addAll(collection); } else { this.tileEntityList.addAll(collection); @@ -1335,15 +1332,15 @@ public abstract class World implements IBlockAccess { byte b0 = 32; if (!flag || this.b(i - b0, 0, j - b0, i + b0, 0, j + b0)) { - entity.T = entity.locX; - entity.U = entity.locY; - entity.V = entity.locZ; + entity.S = entity.locX; + entity.T = entity.locY; + entity.U = entity.locZ; entity.lastYaw = entity.yaw; entity.lastPitch = entity.pitch; - if (flag && entity.ah) { + if (flag && entity.ag) { ++entity.ticksLived; if (entity.vehicle != null) { - entity.ab(); + entity.aa(); } else { entity.h(); } @@ -1351,15 +1348,15 @@ public abstract class World implements IBlockAccess { this.methodProfiler.a("chunkCheck"); if (Double.isNaN(entity.locX) || Double.isInfinite(entity.locX)) { - entity.locX = entity.T; + entity.locX = entity.S; } if (Double.isNaN(entity.locY) || Double.isInfinite(entity.locY)) { - entity.locY = entity.U; + entity.locY = entity.T; } if (Double.isNaN(entity.locZ) || Double.isInfinite(entity.locZ)) { - entity.locZ = entity.V; + entity.locZ = entity.U; } if (Double.isNaN((double) entity.pitch) || Double.isInfinite((double) entity.pitch)) { @@ -1374,21 +1371,21 @@ public abstract class World implements IBlockAccess { int l = MathHelper.floor(entity.locY / 16.0D); int i1 = MathHelper.floor(entity.locZ / 16.0D); - if (!entity.ah || entity.ai != k || entity.aj != l || entity.ak != i1) { - if (entity.ah && this.isChunkLoaded(entity.ai, entity.ak)) { - this.getChunkAt(entity.ai, entity.ak).a(entity, entity.aj); + if (!entity.ag || entity.ah != k || entity.ai != l || entity.aj != i1) { + if (entity.ag && this.isChunkLoaded(entity.ah, entity.aj)) { + this.getChunkAt(entity.ah, entity.aj).a(entity, entity.ai); } if (this.isChunkLoaded(k, i1)) { - entity.ah = true; + entity.ag = true; this.getChunkAt(k, i1).a(entity); } else { - entity.ah = false; + entity.ag = false; } } this.methodProfiler.b(); - if (flag && entity.ah && entity.passenger != null) { + if (flag && entity.ag && entity.passenger != null) { if (!entity.passenger.dead && entity.passenger.vehicle == entity) { this.playerJoinedWorld(entity.passenger); } else { @@ -1409,7 +1406,7 @@ public abstract class World implements IBlockAccess { for (int i = 0; i < list.size(); ++i) { Entity entity1 = (Entity) list.get(i); - if (!entity1.dead && entity1.l && entity1 != entity) { + if (!entity1.dead && entity1.k && entity1 != entity) { return false; } } @@ -1524,7 +1521,7 @@ public abstract class World implements IBlockAccess { return false; } else { boolean flag = false; - Vec3D vec3d = this.getVec3DPool().create(0.0D, 0.0D, 0.0D); + Vec3D vec3d = Vec3D.a(0.0D, 0.0D, 0.0D); for (int k1 = i; k1 < j; ++k1) { for (int l1 = k; l1 < l; ++l1) { @@ -1543,15 +1540,14 @@ public abstract class World implements IBlockAccess { } } - if (vec3d.b() > 0.0D && entity.aC()) { + if (vec3d.b() > 0.0D && entity.aB()) { vec3d = vec3d.a(); double d1 = 0.014D; - entity.motX += vec3d.c * d1; - entity.motY += vec3d.d * d1; - entity.motZ += vec3d.e * d1; + entity.motX += vec3d.a * d1; + entity.motY += vec3d.b * d1; + entity.motZ += vec3d.c * d1; } - vec3d.b.release(vec3d); // CraftBukkit - pop it - we're done return flag; } @@ -1628,28 +1624,32 @@ public abstract class World implements IBlockAccess { double d0 = 1.0D / ((axisalignedbb.d - axisalignedbb.a) * 2.0D + 1.0D); double d1 = 1.0D / ((axisalignedbb.e - axisalignedbb.b) * 2.0D + 1.0D); double d2 = 1.0D / ((axisalignedbb.f - axisalignedbb.c) * 2.0D + 1.0D); - int i = 0; - int j = 0; - Vec3D vec3d2 = vec3d.b.create(0, 0, 0); // CraftBukkit - for (float f = 0.0F; f <= 1.0F; f = (float) ((double) f + d0)) { - for (float f1 = 0.0F; f1 <= 1.0F; f1 = (float) ((double) f1 + d1)) { - for (float f2 = 0.0F; f2 <= 1.0F; f2 = (float) ((double) f2 + d2)) { - double d3 = axisalignedbb.a + (axisalignedbb.d - axisalignedbb.a) * (double) f; - double d4 = axisalignedbb.b + (axisalignedbb.e - axisalignedbb.b) * (double) f1; - double d5 = axisalignedbb.c + (axisalignedbb.f - axisalignedbb.c) * (double) f2; + if (d0 >= 0.0D && d1 >= 0.0D && d2 >= 0.0D) { + int i = 0; + int j = 0; - if (this.a(vec3d2.b(d3, d4, d5), vec3d) == null) { // CraftBukkit - ++i; + Vec3D vec3d2 = vec3d.a(0, 0, 0); // CraftBukkit + for (float f = 0.0F; f <= 1.0F; f = (float) ((double) f + d0)) { + for (float f1 = 0.0F; f1 <= 1.0F; f1 = (float) ((double) f1 + d1)) { + for (float f2 = 0.0F; f2 <= 1.0F; f2 = (float) ((double) f2 + d2)) { + double d3 = axisalignedbb.a + (axisalignedbb.d - axisalignedbb.a) * (double) f; + double d4 = axisalignedbb.b + (axisalignedbb.e - axisalignedbb.b) * (double) f1; + double d5 = axisalignedbb.c + (axisalignedbb.f - axisalignedbb.c) * (double) f2; + + if (this.a(vec3d2.b(d3, d4, d5), vec3d) == null) { // CraftBukkit + ++i; + } + + ++j; } - - ++j; } } - } - vec3d2.b.release(vec3d2); // CraftBukkit - return (float) i / (float) j; + return (float) i / (float) j; + } else { + return 0.0F; + } } public boolean douseFire(EntityHuman entityhuman, int i, int j, int k, int l) { @@ -1692,7 +1692,7 @@ public abstract class World implements IBlockAccess { int l; TileEntity tileentity1; - if (this.N) { + if (this.M) { for (l = 0; l < this.a.size(); ++l) { tileentity1 = (TileEntity) this.a.get(l); if (!tileentity1.r() && tileentity1.x == i && tileentity1.y == j && tileentity1.z == k) { @@ -1728,7 +1728,7 @@ public abstract class World implements IBlockAccess { public void setTileEntity(int i, int j, int k, TileEntity tileentity) { if (tileentity != null && !tileentity.r()) { - if (this.N) { + if (this.M) { tileentity.x = i; tileentity.y = j; tileentity.z = k; @@ -1758,7 +1758,7 @@ public abstract class World implements IBlockAccess { public void p(int i, int j, int k) { TileEntity tileentity = this.getTileEntity(i, j, k); - if (tileentity != null && this.N) { + if (tileentity != null && this.M) { tileentity.s(); this.a.remove(tileentity); } else { @@ -1782,7 +1782,7 @@ public abstract class World implements IBlockAccess { public boolean q(int i, int j, int k) { AxisAlignedBB axisalignedbb = this.getType(i, j, k).a(this, i, j, k); - return axisalignedbb != null && axisalignedbb.b() >= 1.0D; + return axisalignedbb != null && axisalignedbb.a() >= 1.0D; } public static boolean a(IBlockAccess iblockaccess, int i, int j, int k) { @@ -1808,7 +1808,7 @@ public abstract class World implements IBlockAccess { } } - public void A() { + public void B() { int i = this.a(1.0F); if (i != this.j) { @@ -1902,7 +1902,7 @@ public abstract class World implements IBlockAccess { } } - protected void B() { + protected void C() { // this.chunkTickList.clear(); // CraftBukkit - removed this.methodProfiler.a("buildList"); @@ -1910,30 +1910,31 @@ public abstract class World implements IBlockAccess { EntityHuman entityhuman; int j; int k; + int l; for (i = 0; i < this.players.size(); ++i) { entityhuman = (EntityHuman) this.players.get(i); j = MathHelper.floor(entityhuman.locX / 16.0D); k = MathHelper.floor(entityhuman.locZ / 16.0D); - byte b0 = 7; + l = this.p(); - for (int l = -b0; l <= b0; ++l) { - for (int i1 = -b0; i1 <= b0; ++i1) { + for (int i1 = -l; i1 <= l; ++i1) { + for (int j1 = -l; j1 <= l; ++j1) { // CraftBukkit start - Don't tick chunks queued for unload ChunkProviderServer chunkProviderServer = ((WorldServer) entityhuman.world).chunkProviderServer; - if (chunkProviderServer.unloadQueue.contains(l + j, i1 + k)) { + if (chunkProviderServer.unloadQueue.contains(i1 + j, j1 + k)) { continue; } // CraftBukkit end - this.chunkTickList.add(org.bukkit.craftbukkit.util.LongHash.toLong(l + j, i1 + k)); // CraftBukkit + this.chunkTickList.add(org.bukkit.craftbukkit.util.LongHash.toLong(i1 + j, j1 + k)); // CraftBukkit } } } this.methodProfiler.b(); - if (this.L > 0) { - --this.L; + if (this.K > 0) { + --this.K; } this.methodProfiler.a("playerCheckLight"); @@ -1942,17 +1943,18 @@ public abstract class World implements IBlockAccess { entityhuman = (EntityHuman) this.players.get(i); j = MathHelper.floor(entityhuman.locX) + this.random.nextInt(11) - 5; k = MathHelper.floor(entityhuman.locY) + this.random.nextInt(11) - 5; - int j1 = MathHelper.floor(entityhuman.locZ) + this.random.nextInt(11) - 5; - - this.t(j, k, j1); + l = MathHelper.floor(entityhuman.locZ) + this.random.nextInt(11) - 5; + this.t(j, k, l); } this.methodProfiler.b(); } + protected abstract int p(); + protected void a(int i, int j, Chunk chunk) { this.methodProfiler.c("moodSound"); - if (this.L == 0 && !this.isStatic) { + if (this.K == 0 && !this.isStatic) { this.k = this.k * 3 + 1013904223; int k = this.k >> 2; int l = k & 15; @@ -1967,7 +1969,7 @@ public abstract class World implements IBlockAccess { if (entityhuman != null && entityhuman.e((double) l + 0.5D, (double) j1 + 0.5D, (double) i1 + 0.5D) > 4.0D) { this.makeSound((double) l + 0.5D, (double) j1 + 0.5D, (double) i1 + 0.5D, "ambient.cave.cave", 0.7F, 0.8F + this.random.nextFloat() * 0.2F); - this.L = this.random.nextInt(12000) + 6000; + this.K = this.random.nextInt(12000) + 6000; } } } @@ -1977,7 +1979,7 @@ public abstract class World implements IBlockAccess { } protected void g() { - this.B(); + this.C(); } public boolean r(int i, int j, int k) { @@ -2275,7 +2277,7 @@ public abstract class World implements IBlockAccess { Entity entity2 = (Entity) list.get(i); if (entity2 != entity) { - double d1 = entity.e(entity2); + double d1 = entity.f(entity2); if (d1 <= d0) { entity1 = entity2; @@ -2509,7 +2511,7 @@ public abstract class World implements IBlockAccess { } if (entityhuman1.isInvisible()) { - float f = entityhuman1.bC(); + float f = entityhuman1.bD(); if (f < 0.1F) { f = 0.1F; @@ -2538,7 +2540,7 @@ public abstract class World implements IBlockAccess { return null; } - public void F() throws ExceptionWorldConflict { // CraftBukkit - added throws + public void G() throws ExceptionWorldConflict { // CraftBukkit - added throws this.dataManager.checkSession(); } @@ -2572,7 +2574,7 @@ public abstract class World implements IBlockAccess { public void broadcastEntityEffect(Entity entity, byte b0) {} - public IChunkProvider K() { + public IChunkProvider L() { return this.chunkProvider; } @@ -2612,16 +2614,16 @@ public abstract class World implements IBlockAccess { return this.m + (this.n - this.m) * f; } - public boolean O() { + public boolean P() { return (double) this.h(1.0F) > 0.9D; } - public boolean P() { + public boolean Q() { return (double) this.j(1.0F) > 0.2D; } public boolean isRainingAt(int i, int j, int k) { - if (!this.P()) { + if (!this.Q()) { return false; } else if (!this.i(i, j, k)) { return false; @@ -2683,7 +2685,7 @@ public abstract class World implements IBlockAccess { return 256; } - public int R() { + public int S() { return this.worldProvider.g ? 128 : 256; } @@ -2695,7 +2697,7 @@ public abstract class World implements IBlockAccess { } public ChunkPosition b(String s, int i, int j, int k) { - return this.K().findNearestMapFeature(this, s, i, j, k); + return this.L().findNearestMapFeature(this, s, i, j, k); } public CrashReportSystemDetails a(CrashReport crashreport) { @@ -2722,16 +2724,12 @@ public abstract class World implements IBlockAccess { } } - public Vec3DPool getVec3DPool() { - return this.J; - } - public Calendar V() { if (this.getTime() % 600L == 0L) { - this.K.setTimeInMillis(MinecraftServer.ap()); + this.J.setTimeInMillis(MinecraftServer.aq()); } - return this.K; + return this.J; } public Scoreboard getScoreboard() { @@ -2767,7 +2765,7 @@ public abstract class World implements IBlockAccess { boolean flag = this.difficulty == EnumDifficulty.HARD; if (this.isLoaded(i, j, k)) { - float f1 = this.x(); + float f1 = this.y(); f += MathHelper.a((float) this.getChunkAtWorldCoords(i, k).s / 3600000.0F, 0.0F, 1.0F) * (flag ? 1.0F : 0.75F); f += f1 * 0.25F; diff --git a/src/main/java/net/minecraft/server/WorldNBTStorage.java b/src/main/java/net/minecraft/server/WorldNBTStorage.java index c7ec2fdca4..f0666a3642 100644 --- a/src/main/java/net/minecraft/server/WorldNBTStorage.java +++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java @@ -24,7 +24,7 @@ public class WorldNBTStorage implements IDataManager, IPlayerFileData { private final File baseDir; private final File playerDir; private final File dataDir; - private final long sessionId = MinecraftServer.ap(); + private final long sessionId = MinecraftServer.aq(); private final String f; private UUID uuid = null; // CraftBukkit diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java index b9b967f376..4e0861e4ed 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -54,7 +54,7 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate // CraftBukkit end this.server = minecraftserver; this.tracker = new EntityTracker(this); - this.manager = new PlayerChunkMap(this, minecraftserver.getPlayerList().o()); + this.manager = new PlayerChunkMap(this); if (this.entitiesById == null) { this.entitiesById = new IntHashMap(); } @@ -219,7 +219,7 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate } public BiomeMeta a(EnumCreatureType enumcreaturetype, int i, int j, int k) { - List list = this.K().getMobsFor(enumcreaturetype, i, j, k); + List list = this.L().getMobsFor(enumcreaturetype, i, j, k); return list != null && !list.isEmpty() ? (BiomeMeta) WeightedRandom.a(this.random, (Collection) list) : null; } @@ -326,7 +326,7 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate int k1; int l1; - if (this.random.nextInt(100000) == 0 && this.P() && this.O()) { + if (this.random.nextInt(100000) == 0 && this.Q() && this.P()) { this.k = this.k * 3 + 1013904223; i1 = this.k >> 2; j1 = k + (i1 & 15); @@ -357,7 +357,7 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate // CraftBukkit end } - if (this.P() && this.e(j1 + k, l1, k1 + l, true)) { + if (this.Q() && this.e(j1 + k, l1, k1 + l, true)) { // CraftBukkit start BlockState blockState = this.getWorld().getBlockAt(j1 + k, l1, k1 + l).getState(); blockState.setTypeId(Block.b(Blocks.SNOW)); @@ -370,7 +370,7 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate // CraftBukkit end } - if (this.P()) { + if (this.Q()) { BiomeBase biomebase = this.getBiome(j1 + k, k1 + l); if (biomebase.e()) { @@ -765,17 +765,28 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate } this.chunkProvider.saveChunks(flag, iprogressupdate); + // CraftBukkit - List -> Collection + Collection list = this.chunkProviderServer.a(); + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) { + Chunk chunk = (Chunk) iterator.next(); + + if (!this.manager.a(chunk.locX, chunk.locZ)) { + this.chunkProviderServer.queueUnload(chunk.locX, chunk.locZ); + } + } } } public void flushSave() { if (this.chunkProvider.canSave()) { - this.chunkProvider.b(); + this.chunkProvider.c(); } } protected void a() throws ExceptionWorldConflict { // CraftBukkit - added throws - this.F(); + this.G(); this.dataManager.saveWorldData(this.worldData, this.server.getPlayerList().q()); // CraftBukkit start - save worldMaps once, rather than once per shared world if (!(this instanceof SecondaryWorldServer)) { @@ -787,7 +798,7 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate protected void a(Entity entity) { super.a(entity); this.entitiesById.a(entity.getId(), entity); - Entity[] aentity = entity.at(); + Entity[] aentity = entity.as(); if (aentity != null) { for (int i = 0; i < aentity.length; ++i) { @@ -799,7 +810,7 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate protected void b(Entity entity) { super.b(entity); this.entitiesById.d(entity.getId()); - Entity[] aentity = entity.at(); + Entity[] aentity = entity.as(); if (aentity != null) { for (int i = 0; i < aentity.length; ++i) { @@ -915,7 +926,7 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate } protected void o() { - boolean flag = this.P(); + boolean flag = this.Q(); super.o(); /* CraftBukkit start @@ -927,7 +938,7 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate this.server.getPlayerList().a(new PacketPlayOutGameStateChange(8, this.p), this.worldProvider.dimension); } - if (flag != this.P()) { + if (flag != this.Q()) { if (flag) { this.server.getPlayerList().sendAll(new PacketPlayOutGameStateChange(2, 0.0F)); } else { @@ -949,6 +960,10 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate } } + protected int p() { + return this.server.getPlayerList().o(); + } + public MinecraftServer getMinecraftServer() { return this.server; } @@ -961,7 +976,7 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate return this.manager; } - public PortalTravelAgent t() { + public PortalTravelAgent getTravelAgent() { return this.Q; } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index e6c85758a4..04f8a6931e 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -43,6 +43,7 @@ import net.minecraft.server.CommandKick; import net.minecraft.server.CommandKill; import net.minecraft.server.CommandList; import net.minecraft.server.CommandMe; +import net.minecraft.server.CommandNetstat; import net.minecraft.server.CommandOp; import net.minecraft.server.CommandPardon; import net.minecraft.server.CommandPardonIP; @@ -432,6 +433,8 @@ public final class CraftServer implements Server { commandMap.register("minecraft", new VanillaCommandWrapper(new CommandWeather(), "/weather [duration in seconds]")); commandMap.register("minecraft", new VanillaCommandWrapper(new CommandWhitelist(), "/whitelist (add|remove) \n/whitelist (on|off|list|reload)")); commandMap.register("minecraft", new VanillaCommandWrapper(new CommandXp(), "/xp [player]\n/xp L [player]")); + // This is what is in the lang file, I swear. + commandMap.register("minecraft", new VanillaCommandWrapper(new CommandNetstat(), "/list")); } private void loadPlugin(Plugin plugin) { @@ -1609,11 +1612,11 @@ public final class CraftServer implements Server { } public void setIdleTimeout(int threshold) { - console.d(threshold); // Should be setIdleTimeout + console.setIdleTimeout(threshold); } public int getIdleTimeout() { - return console.aq(); // Should be getIdleTimeout + return console.getIdleTimeout(); } @Deprecated diff --git a/src/main/java/org/bukkit/craftbukkit/CraftStatistic.java b/src/main/java/org/bukkit/craftbukkit/CraftStatistic.java index 7190c5702f..24c8bf24cd 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftStatistic.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftStatistic.java @@ -54,7 +54,7 @@ public class CraftStatistic { private CraftStatistic() {} public static org.bukkit.Achievement getBukkitAchievement(net.minecraft.server.Achievement achievement) { - return getBukkitAchievementByName(achievement.e); + return getBukkitAchievementByName(achievement.name); } public static org.bukkit.Achievement getBukkitAchievementByName(String name) { @@ -62,7 +62,7 @@ public class CraftStatistic { } public static org.bukkit.Statistic getBukkitStatistic(net.minecraft.server.Statistic statistic) { - return getBukkitStatisticByName(statistic.e); + return getBukkitStatisticByName(statistic.name); } public static org.bukkit.Statistic getBukkitStatisticByName(String name) { @@ -88,26 +88,26 @@ public class CraftStatistic { } public static net.minecraft.server.Statistic getNMSStatistic(org.bukkit.Statistic statistic) { - return StatisticList.a(statistics.inverse().get(statistic)); + return StatisticList.getStatistic(statistics.inverse().get(statistic)); } public static net.minecraft.server.Achievement getNMSAchievement(org.bukkit.Achievement achievement) { - return (net.minecraft.server.Achievement) StatisticList.a(achievements.inverse().get(achievement)); + return (net.minecraft.server.Achievement) StatisticList.getStatistic(achievements.inverse().get(achievement)); } public static net.minecraft.server.Statistic getMaterialStatistic(org.bukkit.Statistic stat, Material material) { try { if (stat == Statistic.MINE_BLOCK) { - return StatisticList.C[material.getId()]; + return StatisticList.MINE_BLOCK_COUNT[material.getId()]; } if (stat == Statistic.CRAFT_ITEM) { - return StatisticList.D[material.getId()]; + return StatisticList.CRAFT_BLOCK_COUNT[material.getId()]; } if (stat == Statistic.USE_ITEM) { - return StatisticList.E[material.getId()]; + return StatisticList.USE_ITEM_COUNT[material.getId()]; } if (stat == Statistic.BREAK_ITEM) { - return StatisticList.F[material.getId()]; + return StatisticList.BREAK_ITEM_COUNT[material.getId()]; } } catch (ArrayIndexOutOfBoundsException e) { return null; @@ -116,21 +116,21 @@ public class CraftStatistic { } public static net.minecraft.server.Statistic getEntityStatistic(org.bukkit.Statistic stat, EntityType entity) { - MonsterEggInfo monsteregginfo = (MonsterEggInfo) EntityTypes.a.get(Integer.valueOf(entity.getTypeId())); + MonsterEggInfo monsteregginfo = (MonsterEggInfo) EntityTypes.eggInfo.get(Integer.valueOf(entity.getTypeId())); if (monsteregginfo != null) { - return monsteregginfo.d; + return monsteregginfo.killEntityStatistic; } return null; } public static EntityType getEntityTypeFromStatistic(net.minecraft.server.Statistic statistic) { - String statisticString = statistic.e; + String statisticString = statistic.name; return EntityType.fromName(statisticString.substring(statisticString.lastIndexOf(".") + 1)); } public static Material getMaterialFromStatistic(net.minecraft.server.Statistic statistic) { - String statisticString = statistic.e; + String statisticString = statistic.name; int id; try { id = Integer.valueOf(statisticString.substring(statisticString.lastIndexOf(".") + 1)); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftTravelAgent.java b/src/main/java/org/bukkit/craftbukkit/CraftTravelAgent.java index 123315981e..f7ca6a3f72 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftTravelAgent.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftTravelAgent.java @@ -41,13 +41,13 @@ public class CraftTravelAgent extends PortalTravelAgent implements TravelAgent { } public Location findPortal(Location location) { - PortalTravelAgent pta = ((CraftWorld) location.getWorld()).getHandle().t(); // Should be getTravelAgent + PortalTravelAgent pta = ((CraftWorld) location.getWorld()).getHandle().getTravelAgent(); ChunkCoordinates found = pta.findPortal(location.getX(), location.getY(), location.getZ(), this.getSearchRadius()); return found != null ? new Location(location.getWorld(), found.x, found.y, found.z, location.getYaw(), location.getPitch()) : null; } public boolean createPortal(Location location) { - PortalTravelAgent pta = ((CraftWorld) location.getWorld()).getHandle().t(); + PortalTravelAgent pta = ((CraftWorld) location.getWorld()).getHandle().getTravelAgent(); return pta.createPortal(location.getX(), location.getY(), location.getZ(), this.getCreationRadius()); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 2c1fbb5378..a4ede348ff 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -1011,7 +1011,7 @@ public class CraftWorld implements World { entity = new EntityItemFrame(world, (int) x, (int) y, (int) z, dir); } else if (LeashHitch.class.isAssignableFrom(clazz)) { entity = new EntityLeash(world, (int) x, (int) y, (int) z); - entity.o = true; + entity.n = true; } if (entity != null && !((EntityHanging) entity).survives()) { diff --git a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java index 455f3df0db..f63300fcee 100644 --- a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java +++ b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java @@ -35,16 +35,16 @@ public final class VanillaCommandWrapper extends VanillaCommand { protected final CommandAbstract vanillaCommand; public VanillaCommandWrapper(CommandAbstract vanillaCommand) { - super(vanillaCommand.c()); + super(vanillaCommand.getCommand()); this.vanillaCommand = vanillaCommand; } public VanillaCommandWrapper(CommandAbstract vanillaCommand, String usage) { - super(vanillaCommand.c()); + super(vanillaCommand.getCommand()); this.vanillaCommand = vanillaCommand; this.description = "A Mojang provided command."; this.usageMessage = usage; - this.setPermission("minecraft.command." + vanillaCommand.c()); + this.setPermission("minecraft.command." + vanillaCommand.getCommand()); } @Override @@ -57,14 +57,14 @@ public final class VanillaCommandWrapper extends VanillaCommand { WorldServer[] prev = MinecraftServer.getServer().worldServer; MinecraftServer.getServer().worldServer = new WorldServer[]{(WorldServer) icommandlistener.getWorld()}; try { - vanillaCommand.b(icommandlistener, args); + vanillaCommand.execute(icommandlistener, args); } catch (ExceptionUsage exceptionusage) { ChatMessage chatmessage = new ChatMessage("commands.generic.usage", new Object[] {new ChatMessage(exceptionusage.getMessage(), exceptionusage.a())}); - chatmessage.b().setColor(EnumChatFormat.RED); + chatmessage.getChatModifier().setColor(EnumChatFormat.RED); icommandlistener.sendMessage(chatmessage); } catch (CommandException commandexception) { ChatMessage chatmessage = new ChatMessage(commandexception.getMessage(), commandexception.a()); - chatmessage.b().setColor(EnumChatFormat.RED); + chatmessage.getChatModifier().setColor(EnumChatFormat.RED); icommandlistener.sendMessage(chatmessage); } finally { MinecraftServer.getServer().worldServer = prev; @@ -77,7 +77,7 @@ public final class VanillaCommandWrapper extends VanillaCommand { Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(args, "Arguments cannot be null"); Validate.notNull(alias, "Alias cannot be null"); - return (List) vanillaCommand.a(getListener(sender), args); + return (List) vanillaCommand.tabComplete(getListener(sender), args); } public final int dispatchVanillaCommandBlock(CommandBlockListenerAbstract icommandlistener, String s) { @@ -95,7 +95,7 @@ public final class VanillaCommandWrapper extends VanillaCommand { WorldServer[] prev = MinecraftServer.getServer().worldServer; MinecraftServer.getServer().worldServer = new WorldServer[]{(WorldServer) icommandlistener.getWorld()}; try { - if (vanillaCommand.a(icommandlistener)) { + if (vanillaCommand.canUse(icommandlistener)) { if (i > -1) { EntityPlayer aentityplayer[] = PlayerSelector.getPlayers(icommandlistener, as[i]); String s2 = as[i]; @@ -105,12 +105,12 @@ public final class VanillaCommandWrapper extends VanillaCommand { EntityPlayer entityplayer = aentityplayer1[l]; as[i] = entityplayer.getName(); try { - vanillaCommand.b(icommandlistener, as); + vanillaCommand.execute(icommandlistener, as); j++; continue; } catch (CommandException commandexception1) { ChatMessage chatmessage4 = new ChatMessage(commandexception1.getMessage(), commandexception1.a()); - chatmessage4.b().setColor(EnumChatFormat.RED); + chatmessage4.getChatModifier().setColor(EnumChatFormat.RED); icommandlistener.sendMessage(chatmessage4); l++; } @@ -118,34 +118,34 @@ public final class VanillaCommandWrapper extends VanillaCommand { as[i] = s2; } else { - vanillaCommand.b(icommandlistener, as); + vanillaCommand.execute(icommandlistener, as); j++; } } else { ChatMessage chatmessage = new ChatMessage("commands.generic.permission", new Object[0]); - chatmessage.b().setColor(EnumChatFormat.RED); + chatmessage.getChatModifier().setColor(EnumChatFormat.RED); icommandlistener.sendMessage(chatmessage); } } catch (ExceptionUsage exceptionusage) { ChatMessage chatmessage1 = new ChatMessage("commands.generic.usage", new Object[] { new ChatMessage(exceptionusage.getMessage(), exceptionusage.a()) }); - chatmessage1.b().setColor(EnumChatFormat.RED); + chatmessage1.getChatModifier().setColor(EnumChatFormat.RED); icommandlistener.sendMessage(chatmessage1); } catch (CommandException commandexception) { ChatMessage chatmessage2 = new ChatMessage(commandexception.getMessage(), commandexception.a()); - chatmessage2.b().setColor(EnumChatFormat.RED); + chatmessage2.getChatModifier().setColor(EnumChatFormat.RED); icommandlistener.sendMessage(chatmessage2); } catch (Throwable throwable) { ChatMessage chatmessage3 = new ChatMessage("commands.generic.exception", new Object[0]); - chatmessage3.b().setColor(EnumChatFormat.RED); + chatmessage3.getChatModifier().setColor(EnumChatFormat.RED); icommandlistener.sendMessage(chatmessage3); if(icommandlistener instanceof TileEntityCommandListener) { TileEntityCommandListener listener = (TileEntityCommandListener) icommandlistener; - MinecraftServer.av().log(Level.WARN, String.format("CommandBlock at (%d,%d,%d) failed to handle command", listener.getChunkCoordinates().x, listener.getChunkCoordinates().y, listener.getChunkCoordinates().z), throwable); + MinecraftServer.getLogger().log(Level.WARN, String.format("CommandBlock at (%d,%d,%d) failed to handle command", listener.getChunkCoordinates().x, listener.getChunkCoordinates().y, listener.getChunkCoordinates().z), throwable); } else if (icommandlistener instanceof EntityMinecartCommandBlockListener) { EntityMinecartCommandBlockListener listener = (EntityMinecartCommandBlockListener) icommandlistener; - MinecraftServer.av().log(Level.WARN, String.format("MinecartCommandBlock at (%d,%d,%d) failed to handle command", listener.getChunkCoordinates().x, listener.getChunkCoordinates().y, listener.getChunkCoordinates().z), throwable); + MinecraftServer.getLogger().log(Level.WARN, String.format("MinecartCommandBlock at (%d,%d,%d) failed to handle command", listener.getChunkCoordinates().x, listener.getChunkCoordinates().y, listener.getChunkCoordinates().z), throwable); } else { - MinecraftServer.av().log(Level.WARN, String.format("Unknown CommandBlock failed to handle command"), throwable); + MinecraftServer.getLogger().log(Level.WARN, String.format("Unknown CommandBlock failed to handle command"), throwable); } } finally { MinecraftServer.getServer().worldServer = prev; @@ -174,7 +174,7 @@ public final class VanillaCommandWrapper extends VanillaCommand { private int getPlayerListSize(String as[]) { for (int i = 0; i < as.length; i++) { - if (vanillaCommand.a(as, i) && PlayerSelector.isList(as[i])) { + if (vanillaCommand.isListStart(as, i) && PlayerSelector.isList(as[i])) { return i; } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java index 4c319a7fb8..4f8d47d6e5 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java @@ -17,19 +17,19 @@ public class CraftArrow extends AbstractProjectile implements Arrow { public void setKnockbackStrength(int knockbackStrength) { Validate.isTrue(knockbackStrength >= 0, "Knockback cannot be negative"); - getHandle().a(knockbackStrength); + getHandle().setKnockbackStrength(knockbackStrength); } public int getKnockbackStrength() { - return getHandle().aw; + return getHandle().knockbackStrength; } public boolean isCritical() { - return getHandle().f(); + return getHandle().isCritical(); } public void setCritical(boolean critical) { - getHandle().a(critical); + getHandle().setCritical(critical); } public ProjectileSource getShooter() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java index 9cdb0c1822..c1f1782988 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -348,7 +348,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { } public boolean hasLineOfSight(Entity other) { - return getHandle().o(((CraftEntity) other).getHandle()); + return getHandle().p(((CraftEntity) other).getHandle()); } public boolean getRemoveWhenFarAway() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 60b0435ebd..da574e0b7a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -522,8 +522,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player { if (achievement.hasParent() && !hasAchievement(achievement.getParent())) { awardAchievement(achievement.getParent()); } - getHandle().x().a(getHandle(), CraftStatistic.getNMSAchievement(achievement), 1); - getHandle().x().b(getHandle()); + getHandle().getStatisticManager().setStatistic(getHandle(), CraftStatistic.getNMSAchievement(achievement), 1); + getHandle().getStatisticManager().updateStatistics(getHandle()); } @Override @@ -534,13 +534,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { removeAchievement(achieve); } } - getHandle().x().a(getHandle(), CraftStatistic.getNMSAchievement(achievement), 0); + getHandle().getStatisticManager().setStatistic(getHandle(), CraftStatistic.getNMSAchievement(achievement), 0); } @Override public boolean hasAchievement(Achievement achievement) { Validate.notNull(achievement, "Achievement cannot be null"); - return getHandle().x().a(CraftStatistic.getNMSAchievement(achievement)); + return getHandle().getStatisticManager().a(CraftStatistic.getNMSAchievement(achievement)); } @Override @@ -557,7 +557,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { public int getStatistic(Statistic statistic) { Validate.notNull(statistic, "Statistic cannot be null"); Validate.isTrue(statistic.getType() == Type.UNTYPED, "Must supply additional paramater for this statistic"); - return getHandle().x().a(CraftStatistic.getNMSStatistic(statistic)); + return getHandle().getStatisticManager().getStatisticValue(CraftStatistic.getNMSStatistic(statistic)); } @Override @@ -578,7 +578,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { Validate.isTrue(statistic.getType() == Type.UNTYPED, "Must supply additional paramater for this statistic"); Validate.isTrue(newValue >= 0, "Value must be greater than or equal to 0"); net.minecraft.server.Statistic nmsStatistic = CraftStatistic.getNMSStatistic(statistic); - getHandle().x().a(getHandle(), nmsStatistic, newValue); + getHandle().getStatisticManager().setStatistic(getHandle(), nmsStatistic, newValue); } @Override @@ -598,7 +598,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { Validate.isTrue(statistic.getType() == Type.BLOCK || statistic.getType() == Type.ITEM, "This statistic does not take a Material parameter"); net.minecraft.server.Statistic nmsStatistic = CraftStatistic.getMaterialStatistic(statistic, material); Validate.notNull(nmsStatistic, "The supplied Material does not have a corresponding statistic"); - return getHandle().x().a(nmsStatistic); + return getHandle().getStatisticManager().getStatisticValue(nmsStatistic); } @Override @@ -621,7 +621,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { Validate.isTrue(statistic.getType() == Type.BLOCK || statistic.getType() == Type.ITEM, "This statistic does not take a Material parameter"); net.minecraft.server.Statistic nmsStatistic = CraftStatistic.getMaterialStatistic(statistic, material); Validate.notNull(nmsStatistic, "The supplied Material does not have a corresponding statistic"); - getHandle().x().a(getHandle(), nmsStatistic, newValue); + getHandle().getStatisticManager().setStatistic(getHandle(), nmsStatistic, newValue); } @Override @@ -641,7 +641,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { Validate.isTrue(statistic.getType() == Type.ENTITY, "This statistic does not take an EntityType parameter"); net.minecraft.server.Statistic nmsStatistic = CraftStatistic.getEntityStatistic(statistic, entityType); Validate.notNull(nmsStatistic, "The supplied EntityType does not have a corresponding statistic"); - return getHandle().x().a(nmsStatistic); + return getHandle().getStatisticManager().getStatisticValue(nmsStatistic); } @Override @@ -664,7 +664,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { Validate.isTrue(statistic.getType() == Type.ENTITY, "This statistic does not take an EntityType parameter"); net.minecraft.server.Statistic nmsStatistic = CraftStatistic.getEntityStatistic(statistic, entityType); Validate.notNull(nmsStatistic, "The supplied EntityType does not have a corresponding statistic"); - getHandle().x().a(getHandle(), nmsStatistic, newValue); + getHandle().getStatisticManager().setStatistic(getHandle(), nmsStatistic, newValue); } @Override @@ -1011,7 +1011,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { public void setResourcePack(String url) { Validate.notNull(url, "Resource pack URL cannot be null"); - getHandle().a(url); // should be setResourcePack + getHandle().setResourcePack(url); } public void addChannel(String channel) { @@ -1225,7 +1225,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void updateScaledHealth() { - AttributeMapServer attributemapserver = (AttributeMapServer) getHandle().bc(); + AttributeMapServer attributemapserver = (AttributeMapServer) getHandle().bb(); Set set = attributemapserver.b(); injectScaledMaxHealth(set, true); @@ -1250,6 +1250,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } continue; } - collection.add(new AttributeModifiable(getHandle().bc(), (new AttributeRanged("generic.maxHealth", scaledHealth ? healthScale : getMaxHealth(), 0.0D, Float.MAX_VALUE)).a("Max Health").a(true))); + collection.add(new AttributeModifiable(getHandle().bb(), (new AttributeRanged("generic.maxHealth", scaledHealth ? healthScale : getMaxHealth(), 0.0D, Float.MAX_VALUE)).a("Max Health").a(true))); } } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java index a91ffb1755..2911d601fd 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -393,8 +393,7 @@ public class CraftEventFactory { } public static EntityDamageEvent handleEntityDamageEvent(Entity entity, DamageSource source, float damage) { - // Should be isExplosion - if (source.c()) { + if (source.isExplosion()) { return null; } else if (source instanceof EntityDamageSource) { Entity damager = source.getEntity(); diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java index 096af8e834..dc509dfa28 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java @@ -226,5 +226,5 @@ public class CustomChunkGenerator extends InternalChunkGenerator { return "CustomChunkGenerator"; } - public void b() {} + public void c() {} } diff --git a/src/main/java/org/bukkit/craftbukkit/generator/NormalChunkGenerator.java b/src/main/java/org/bukkit/craftbukkit/generator/NormalChunkGenerator.java index 8af999183f..ceab581644 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/NormalChunkGenerator.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/NormalChunkGenerator.java @@ -82,5 +82,5 @@ public class NormalChunkGenerator extends InternalChunkGenerator { return "NormalWorldGenerator"; } - public void b() {} + public void c() {} } diff --git a/src/main/java/org/bukkit/craftbukkit/projectiles/CraftBlockProjectileSource.java b/src/main/java/org/bukkit/craftbukkit/projectiles/CraftBlockProjectileSource.java index f3550458e9..0959a09e2e 100644 --- a/src/main/java/org/bukkit/craftbukkit/projectiles/CraftBlockProjectileSource.java +++ b/src/main/java/org/bukkit/craftbukkit/projectiles/CraftBlockProjectileSource.java @@ -83,13 +83,13 @@ public class CraftBlockProjectileSource implements BlockProjectileSource { ((EntityArrow) launch).fromPlayer = 1; ((EntityArrow) launch).projectileSource = this; } else if (Fireball.class.isAssignableFrom(projectile)) { - double d0 = iposition.getX() + (double) ((float) enumfacing.c() * 0.3F); - double d1 = iposition.getY() + (double) ((float) enumfacing.c() * 0.3F); - double d2 = iposition.getZ() + (double) ((float) enumfacing.e() * 0.3F); + double d0 = iposition.getX() + (double) ((float) enumfacing.getAdjacentX() * 0.3F); + double d1 = iposition.getY() + (double) ((float) enumfacing.getAdjacentY() * 0.3F); + double d2 = iposition.getZ() + (double) ((float) enumfacing.getAdjacentZ() * 0.3F); Random random = world.random; - double d3 = random.nextGaussian() * 0.05D + (double) enumfacing.c(); - double d4 = random.nextGaussian() * 0.05D + (double) enumfacing.d(); - double d5 = random.nextGaussian() * 0.05D + (double) enumfacing.e(); + double d3 = random.nextGaussian() * 0.05D + (double) enumfacing.getAdjacentX(); + double d4 = random.nextGaussian() * 0.05D + (double) enumfacing.getAdjacentY(); + double d5 = random.nextGaussian() * 0.05D + (double) enumfacing.getAdjacentZ(); if (SmallFireball.class.isAssignableFrom(projectile)) { launch = new EntitySmallFireball(world, d0, d1, d2, d3, d4, d5); @@ -129,7 +129,7 @@ public class CraftBlockProjectileSource implements BlockProjectileSource { b *= 1.25F; } // Copied from DispenseBehaviorProjectile - ((IProjectile) launch).shoot((double) enumfacing.c(), (double) ((float) enumfacing.d() + 0.1F), (double) enumfacing.e(), b, a); + ((IProjectile) launch).shoot((double) enumfacing.getAdjacentX(), (double) ((float) enumfacing.getAdjacentY() + 0.1F), (double) enumfacing.getAdjacentZ(), b, a); } if (velocity != null) { diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java index 66368f4fdb..2b57bf88bd 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java @@ -85,9 +85,9 @@ public final class CraftChatMessage { currentChatComponent = null; break; case 3: - modifier.a(new ChatClickable(EnumClickAction.OPEN_URL, match)); // Should be setChatClickable + modifier.setChatClickable(new ChatClickable(EnumClickAction.OPEN_URL, match)); appendNewComponent(matcher.end(groupId)); - modifier.a((ChatClickable) null); + modifier.setChatClickable((ChatClickable) null); } currentIndex = matcher.end(groupId); } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftDamageSource.java b/src/main/java/org/bukkit/craftbukkit/util/CraftDamageSource.java index 23ae7ff29d..0a72a953d0 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftDamageSource.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftDamageSource.java @@ -18,7 +18,7 @@ public final class CraftDamageSource extends DamageSource { } // Check fire - if (original.c()) { + if (original.isExplosion()) { newSource.n(); } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java index 43adac1363..54e2f5d617 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -93,14 +93,14 @@ public final class CraftMagicNumbers implements UnsafeValues { @Override public List tabCompleteInternalMaterialName(String token, List completions) { - return StringUtil.copyPartialMatches(token, Item.REGISTRY.b(), completions); + return StringUtil.copyPartialMatches(token, Item.REGISTRY.keySet(), completions); } @Override public ItemStack modifyItemStack(ItemStack stack, String arguments) { net.minecraft.server.ItemStack nmsStack = CraftItemStack.asNMSCopy(stack); - nmsStack.setTag((NBTTagCompound) MojangsonParser.a(arguments)); + nmsStack.setTag((NBTTagCompound) MojangsonParser.parse(arguments)); stack.setItemMeta(CraftItemStack.getItemMeta(nmsStack)); @@ -122,7 +122,7 @@ public final class CraftMagicNumbers implements UnsafeValues { List matches = new ArrayList(); Iterator iterator = StatisticList.b.iterator(); while (iterator.hasNext()) { - String statistic = ((net.minecraft.server.Statistic) iterator.next()).e; + String statistic = ((net.minecraft.server.Statistic) iterator.next()).name; if (statistic.startsWith(token)) { matches.add(statistic); } diff --git a/src/test/java/org/bukkit/StatisticsAndAchievementsTest.java b/src/test/java/org/bukkit/StatisticsAndAchievementsTest.java index 306c2a41e6..41e6a89a65 100644 --- a/src/test/java/org/bukkit/StatisticsAndAchievementsTest.java +++ b/src/test/java/org/bukkit/StatisticsAndAchievementsTest.java @@ -22,7 +22,7 @@ public class StatisticsAndAchievementsTest extends AbstractTestingBase { public void verifyAchievementMapping() throws Throwable { List achievements = Lists.newArrayList(Achievement.values()); for (net.minecraft.server.Achievement achievement : (List) AchievementList.e) { - String name = achievement.e; + String name = achievement.name; String message = String.format("org.bukkit.Achievement is missing: '%s'", name); @@ -43,7 +43,7 @@ public class StatisticsAndAchievementsTest extends AbstractTestingBase { if (statistic instanceof net.minecraft.server.Achievement) { continue; } - String name = statistic.e; + String name = statistic.name; String message = String.format("org.bukkit.Statistic is missing: '%s'", name);