summaryrefslogtreecommitdiffstats
path: root/nms-patches/EntityAgeable.patch
diff options
context:
space:
mode:
authorThinkofdeath <thinkofdeath@spigotmc.org>2014-11-26 08:32:16 +1100
committermd_5 <git@md-5.net>2014-11-28 17:16:30 +1100
commit24557bc2b37deb6a0edf497d547471832457b1dd (patch)
treec560572889a3b0b34964a0cddb35dc87fda3c914 /nms-patches/EntityAgeable.patch
parenta4805dbd77da057cc1ea0bf344379bc6e53ca1f6 (diff)
downloadcraftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar
craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.gz
craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.lz
craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.xz
craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.zip
Update to Minecraft 1.8
For more information please see http://www.spigotmc.org/
Diffstat (limited to 'nms-patches/EntityAgeable.patch')
-rw-r--r--nms-patches/EntityAgeable.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/nms-patches/EntityAgeable.patch b/nms-patches/EntityAgeable.patch
new file mode 100644
index 00000000..f1fe109b
--- /dev/null
+++ b/nms-patches/EntityAgeable.patch
@@ -0,0 +1,48 @@
+--- ../work/decompile-bb26c12b/net/minecraft/server/EntityAgeable.java 2014-11-27 08:59:46.649422075 +1100
++++ src/main/java/net/minecraft/server/EntityAgeable.java 2014-11-27 08:42:10.144850927 +1100
+@@ -7,6 +7,7 @@
+ protected int c;
+ private float bk = -1.0F;
+ private float bl;
++ public boolean ageLocked = false; // CraftBukkit
+
+ public EntityAgeable(World world) {
+ super(world);
+@@ -27,14 +28,14 @@
+ if (entityageable != null) {
+ entityageable.setAgeRaw(-24000);
+ entityageable.setPositionRotation(this.locX, this.locY, this.locZ, 0.0F, 0.0F);
+- this.world.addEntity(entityageable);
++ this.world.addEntity(entityageable, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER_EGG); // CraftBukkit
+ if (itemstack.hasName()) {
+ entityageable.setCustomName(itemstack.getName());
+ }
+
+ if (!entityhuman.abilities.canInstantlyBuild) {
+ --itemstack.count;
+- if (itemstack.count <= 0) {
++ if (itemstack.count == 0) { // CraftBukkit - allow less than 0 stacks as "infinite"
+ entityhuman.inventory.setItem(entityhuman.inventory.itemInHandIndex, (ItemStack) null);
+ }
+ }
+@@ -99,17 +100,19 @@
+ super.b(nbttagcompound);
+ nbttagcompound.setInt("Age", this.getAge());
+ nbttagcompound.setInt("ForcedAge", this.b);
++ nbttagcompound.setBoolean("AgeLocked", this.ageLocked); // CraftBukkit
+ }
+
+ public void a(NBTTagCompound nbttagcompound) {
+ super.a(nbttagcompound);
+ this.setAgeRaw(nbttagcompound.getInt("Age"));
+ this.b = nbttagcompound.getInt("ForcedAge");
++ this.ageLocked = nbttagcompound.getBoolean("AgeLocked"); // CraftBukkit
+ }
+
+ public void m() {
+ super.m();
+- if (this.world.isStatic) {
++ if (this.world.isStatic || ageLocked) { // CraftBukkit
+ if (this.c > 0) {
+ if (this.c % 4 == 0) {
+ this.world.addParticle(EnumParticle.VILLAGER_HAPPY, this.locX + (double) (this.random.nextFloat() * this.width * 2.0F) - (double) this.width, this.locY + 0.5D + (double) (this.random.nextFloat() * this.length), this.locZ + (double) (this.random.nextFloat() * this.width * 2.0F) - (double) this.width, 0.0D, 0.0D, 0.0D, new int[0]);