From c57fa19eea33b1832bded51484fa61b196a52736 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 23 Mar 2013 11:00:20 +1100 Subject: [PATCH] Remove broken saddle pig event --- ...now-reset-text-attributes.-Fixes-BU.patch} | 2 +- ...-Fires-vehicle-events-for-saddled-pi.patch | 94 ------------------- 2 files changed, 1 insertion(+), 95 deletions(-) rename CraftBukkit-Patches/{0043-ANSI-color-codes-now-reset-text-attributes.-Fixes-BU.patch => 0042-ANSI-color-codes-now-reset-text-attributes.-Fixes-BU.patch} (98%) delete mode 100644 CraftBukkit-Patches/0042-Adds-BUKKIT-3821-Fires-vehicle-events-for-saddled-pi.patch diff --git a/CraftBukkit-Patches/0043-ANSI-color-codes-now-reset-text-attributes.-Fixes-BU.patch b/CraftBukkit-Patches/0042-ANSI-color-codes-now-reset-text-attributes.-Fixes-BU.patch similarity index 98% rename from CraftBukkit-Patches/0043-ANSI-color-codes-now-reset-text-attributes.-Fixes-BU.patch rename to CraftBukkit-Patches/0042-ANSI-color-codes-now-reset-text-attributes.-Fixes-BU.patch index 6f3b71a2d4..d40fc888b5 100644 --- a/CraftBukkit-Patches/0043-ANSI-color-codes-now-reset-text-attributes.-Fixes-BU.patch +++ b/CraftBukkit-Patches/0042-ANSI-color-codes-now-reset-text-attributes.-Fixes-BU.patch @@ -1,4 +1,4 @@ -From 475514889958ee40a71012cd24665b094fd7c0a5 Mon Sep 17 00:00:00 2001 +From a2a29eb62901c4375eb1809df2fd166e6ac12492 Mon Sep 17 00:00:00 2001 From: James Clarke Date: Sat, 26 Jan 2013 10:39:45 +0000 Subject: [PATCH] ANSI color codes now reset text attributes. Fixes BUKKIT-3508 diff --git a/CraftBukkit-Patches/0042-Adds-BUKKIT-3821-Fires-vehicle-events-for-saddled-pi.patch b/CraftBukkit-Patches/0042-Adds-BUKKIT-3821-Fires-vehicle-events-for-saddled-pi.patch deleted file mode 100644 index 120390aa20..0000000000 --- a/CraftBukkit-Patches/0042-Adds-BUKKIT-3821-Fires-vehicle-events-for-saddled-pi.patch +++ /dev/null @@ -1,94 +0,0 @@ -From f793fd756eb3639cd221fa0c11a6205dc0339cc3 Mon Sep 17 00:00:00 2001 -From: TheCryoknight -Date: Wed, 20 Mar 2013 12:20:30 -0500 -Subject: [PATCH] Adds BUKKIT-3821 - Fires vehicle events for saddled pigs - ---- - src/main/java/net/minecraft/server/EntityPig.java | 52 ++++++++++++++++++++++- - 1 file changed, 51 insertions(+), 1 deletion(-) - -diff --git a/src/main/java/net/minecraft/server/EntityPig.java b/src/main/java/net/minecraft/server/EntityPig.java -index e9fe7cf..9c9af40 100644 ---- a/src/main/java/net/minecraft/server/EntityPig.java -+++ b/src/main/java/net/minecraft/server/EntityPig.java -@@ -1,6 +1,15 @@ - package net.minecraft.server; - --import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit -+//CraftBukkit start -+import org.bukkit.Location; -+import org.bukkit.craftbukkit.event.CraftEventFactory; -+import org.bukkit.entity.Vehicle; -+import org.bukkit.event.vehicle.VehicleCreateEvent; -+import org.bukkit.event.vehicle.VehicleDestroyEvent; -+import org.bukkit.event.vehicle.VehicleEnterEvent; -+import org.bukkit.event.vehicle.VehicleMoveEvent; -+import org.bukkit.event.vehicle.VehicleUpdateEvent; -+//CraftBukkit end - - public class EntityPig extends EntityAnimal { - -@@ -78,6 +87,13 @@ public class EntityPig extends EntityAnimal { - if (super.a_(entityhuman)) { - return true; - } else if (this.hasSaddle() && !this.world.isStatic && (this.passenger == null || this.passenger == entityhuman)) { -+ // CraftBukkit start -+ VehicleEnterEvent enterEvent = new VehicleEnterEvent((Vehicle) this.getBukkitEntity(), entityhuman.getBukkitEntity()); -+ this.world.getServer().getPluginManager().callEvent(enterEvent); -+ if (enterEvent.isCancelled()) { -+ return false; -+ } -+ // CraftBukkit end - entityhuman.mount(this); - return true; - } else { -@@ -117,7 +133,17 @@ public class EntityPig extends EntityAnimal { - public void setSaddle(boolean flag) { - if (flag) { - this.datawatcher.watch(16, Byte.valueOf((byte) 1)); -+ this.world.getServer().getPluginManager().callEvent(new VehicleCreateEvent((Vehicle) this.getBukkitEntity())); // CraftBukkit - } else { -+ // CraftBukkit start -+ Vehicle vehicle = (Vehicle) this.getBukkitEntity(); -+ VehicleDestroyEvent destroyEvent = new VehicleDestroyEvent(vehicle, passenger.getBukkitEntity()); -+ this.world.getServer().getPluginManager().callEvent(destroyEvent); -+ -+ if (destroyEvent.isCancelled()) { -+ return; -+ } -+ // CraftBukkit end - this.datawatcher.watch(16, Byte.valueOf((byte) 0)); - } - } -@@ -161,4 +187,28 @@ public class EntityPig extends EntityAnimal { - public EntityAgeable createChild(EntityAgeable entityageable) { - return this.b(entityageable); - } -+ -+ // CraftBukkit start -+ public void l_() { -+ final double prevX = this.locX; -+ final double prevY = this.locY; -+ final double prevZ = this.locZ; -+ final float prevYaw = this.yaw; -+ final float prevPitch = this.pitch; -+ -+ super.l_(); -+ -+ if (this.passenger != null && this.hasSaddle()) { -+ final org.bukkit.World bukkitWorld = this.world.getWorld(); -+ final Location fromLoc = new Location(bukkitWorld, prevX, prevY, prevZ, prevYaw, prevPitch); -+ final Location toLoc = new Location(bukkitWorld, this.locX, this.locY, this.locZ, this.yaw, this.pitch); -+ final Vehicle vehicle = (Vehicle) this.getBukkitEntity(); -+ -+ this.world.getServer().getPluginManager().callEvent(new VehicleUpdateEvent(vehicle)); -+ if (!fromLoc.equals(toLoc)) { -+ this.world.getServer().getPluginManager().callEvent(new VehicleMoveEvent(vehicle, fromLoc, toLoc)); -+ } -+ } -+ } -+ // CraftBukkit end - } --- -1.8.1-rc2 -