summaryrefslogtreecommitdiffstats
path: root/nms-patches/EntityHorse.patch
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2016-11-17 12:41:03 +1100
committermd_5 <git@md-5.net>2016-11-17 12:41:03 +1100
commitc25ddf063a808e3adb749e22017661f403c5fb7e (patch)
treeb2efcff512be12fd3e38cf8c36386148ce6ab4ae /nms-patches/EntityHorse.patch
parent51263e97187a84338f89698eef187284055a682a (diff)
downloadcraftbukkit-c25ddf063a808e3adb749e22017661f403c5fb7e.tar
craftbukkit-c25ddf063a808e3adb749e22017661f403c5fb7e.tar.gz
craftbukkit-c25ddf063a808e3adb749e22017661f403c5fb7e.tar.lz
craftbukkit-c25ddf063a808e3adb749e22017661f403c5fb7e.tar.xz
craftbukkit-c25ddf063a808e3adb749e22017661f403c5fb7e.zip
Update to Minecraft 1.11
Diffstat (limited to 'nms-patches/EntityHorse.patch')
-rw-r--r--nms-patches/EntityHorse.patch109
1 files changed, 0 insertions, 109 deletions
diff --git a/nms-patches/EntityHorse.patch b/nms-patches/EntityHorse.patch
deleted file mode 100644
index b8d8829f..00000000
--- a/nms-patches/EntityHorse.patch
+++ /dev/null
@@ -1,109 +0,0 @@
---- a/net/minecraft/server/EntityHorse.java
-+++ b/net/minecraft/server/EntityHorse.java
-@@ -7,6 +7,8 @@
- import java.util.UUID;
- import javax.annotation.Nullable;
-
-+import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason; // CraftBukkit
-+
- public class EntityHorse extends EntityAnimal implements IInventoryListener, IJumpable {
-
- private static final Predicate<Entity> bD = new Predicate() {
-@@ -52,6 +54,7 @@
- private int ce;
- private String cf;
- private final String[] cg = new String[3];
-+ public int maxDomestication = 100; // CraftBukkit - store max domestication value
-
- public EntityHorse(World world) {
- super(world);
-@@ -320,7 +323,7 @@
- public void loadChest() {
- InventoryHorseChest inventoryhorsechest = this.inventoryChest;
-
-- this.inventoryChest = new InventoryHorseChest("HorseChest", this.dN());
-+ this.inventoryChest = new InventoryHorseChest("HorseChest", this.dN(), this); // CraftBukkit
- this.inventoryChest.a(this.getName());
- if (inventoryhorsechest != null) {
- inventoryhorsechest.b(this);
-@@ -473,7 +476,7 @@
- }
-
- public int getMaxDomestication() {
-- return 100;
-+ return this.maxDomestication; // CraftBukkit - return stored max domestication instead of 100
- }
-
- protected float ch() {
-@@ -563,7 +566,7 @@
- }
-
- if (this.getHealth() < this.getMaxHealth() && f > 0.0F) {
-- this.heal(f);
-+ this.heal(f, RegainReason.EATING); // CraftBukkit
- flag = true;
- }
-
-@@ -654,11 +657,11 @@
- }
-
- public void die(DamageSource damagesource) {
-- super.die(damagesource);
-+ // super.die(damagesource); // Moved down
- if (!this.world.isClientSide) {
- this.dropChest();
- }
--
-+ super.die(damagesource); // CraftBukkit
- }
-
- public void n() {
-@@ -669,7 +672,7 @@
- super.n();
- if (!this.world.isClientSide) {
- if (this.random.nextInt(900) == 0 && this.deathTicks == 0) {
-- this.heal(1.0F);
-+ this.heal(1.0F, RegainReason.REGEN); // CraftBukkit
- }
-
- if (!this.dr() && !this.isVehicle() && this.random.nextInt(300) == 0 && this.world.getType(new BlockPosition(MathHelper.floor(this.locX), MathHelper.floor(this.locY) - 1, MathHelper.floor(this.locZ))).getBlock() == Blocks.GRASS) {
-@@ -929,6 +932,7 @@
- if (this.getOwnerUUID() != null) {
- nbttagcompound.setString("OwnerUUID", this.getOwnerUUID().toString());
- }
-+ nbttagcompound.setInt("Bukkit.MaxDomestication", this.maxDomestication); // CraftBukkit
-
- if (this.hasChest()) {
- NBTTagList nbttaglist = new NBTTagList();
-@@ -984,6 +988,12 @@
- this.setOwnerUUID(UUID.fromString(s));
- }
-
-+ // CraftBukkit start
-+ if (nbttagcompound.hasKey("Bukkit.MaxDomestication")) {
-+ this.maxDomestication = nbttagcompound.getInt("Bukkit.MaxDomestication");
-+ }
-+ // CraftBukkit end
-+
- AttributeInstance attributeinstance = this.getAttributeMap().a("Speed");
-
- if (attributeinstance != null) {
-@@ -1156,6 +1166,18 @@
- }
-
- public void b(int i) {
-+ // CraftBukkit start
-+ float power;
-+ if (i >= 90) {
-+ power = 1.0F;
-+ } else {
-+ power = 0.4F + 0.4F * (float) i / 90.0F;
-+ }
-+ org.bukkit.event.entity.HorseJumpEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callHorseJumpEvent(this, power);
-+ if (event.isCancelled()) {
-+ return;
-+ }
-+ // CraftBukkit end
- this.canSlide = true;
- this.setStanding();
- }