summaryrefslogtreecommitdiffstats
path: root/nms-patches
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2015-05-21 17:28:21 +1000
committermd_5 <git@md-5.net>2015-05-21 17:28:21 +1000
commit65fba7fb1041d1f722ec8c042964d99639830f23 (patch)
tree88feb1d50eb9ba82bf93b85536867971a50648c2 /nms-patches
parent6ff4221581b49824b1ea6715bb4b24681b80939e (diff)
downloadcraftbukkit-65fba7fb1041d1f722ec8c042964d99639830f23.tar
craftbukkit-65fba7fb1041d1f722ec8c042964d99639830f23.tar.gz
craftbukkit-65fba7fb1041d1f722ec8c042964d99639830f23.tar.lz
craftbukkit-65fba7fb1041d1f722ec8c042964d99639830f23.tar.xz
craftbukkit-65fba7fb1041d1f722ec8c042964d99639830f23.zip
SPIGOT-834: Stop EnderMites from spawning when EnderPearl event is cancelled.
Diffstat (limited to 'nms-patches')
-rw-r--r--nms-patches/EntityEnderPearl.patch30
1 files changed, 23 insertions, 7 deletions
diff --git a/nms-patches/EntityEnderPearl.patch b/nms-patches/EntityEnderPearl.patch
index 645715b8..1129ef5b 100644
--- a/nms-patches/EntityEnderPearl.patch
+++ b/nms-patches/EntityEnderPearl.patch
@@ -1,5 +1,5 @@
---- /home/matt/mc-dev-private//net/minecraft/server/EntityEnderPearl.java 2015-02-26 22:40:22.523608140 +0000
-+++ src/main/java/net/minecraft/server/EntityEnderPearl.java 2015-02-26 22:40:22.523608140 +0000
+--- ../work/decompile-c2c33c10/net/minecraft/server/EntityEnderPearl.java 2015-05-21 17:27:14.743333223 +1000
++++ src/main/java/net/minecraft/server/EntityEnderPearl.java 2015-05-21 17:27:14.743333223 +1000
@@ -1,5 +1,11 @@
package net.minecraft.server;
@@ -12,12 +12,16 @@
public class EntityEnderPearl extends EntityProjectile {
private EntityLiving c;
-@@ -41,13 +47,27 @@
- this.world.addEntity(entityendermite);
- }
+@@ -33,21 +39,35 @@
+ EntityPlayer entityplayer = (EntityPlayer) entityliving;
-- if (entityliving.au()) {
-- entityliving.mount((Entity) null);
+ if (entityplayer.playerConnection.a().g() && entityplayer.world == this.world && !entityplayer.isSleeping()) {
+- if (this.random.nextFloat() < 0.05F && this.world.getGameRules().getBoolean("doMobSpawning")) {
+- EntityEndermite entityendermite = new EntityEndermite(this.world);
+-
+- entityendermite.a(true);
+- entityendermite.setPositionRotation(entityliving.locX, entityliving.locY, entityliving.locZ, entityliving.yaw, entityliving.pitch);
+- this.world.addEntity(entityendermite);
+ // CraftBukkit start - Fire PlayerTeleportEvent
+ org.bukkit.craftbukkit.entity.CraftPlayer player = entityplayer.getBukkitEntity();
+ org.bukkit.Location location = getBukkitEntity().getLocation();
@@ -28,6 +32,14 @@
+ Bukkit.getPluginManager().callEvent(teleEvent);
+
+ if (!teleEvent.isCancelled() && !entityplayer.playerConnection.isDisconnected()) {
++ if (this.random.nextFloat() < 0.05F && this.world.getGameRules().getBoolean("doMobSpawning")) {
++ EntityEndermite entityendermite = new EntityEndermite(this.world);
++
++ entityendermite.a(true);
++ entityendermite.setPositionRotation(entityliving.locX, entityliving.locY, entityliving.locZ, entityliving.yaw, entityliving.pitch);
++ this.world.addEntity(entityendermite);
++ }
++
+ if (entityliving.au()) {
+ entityliving.mount((Entity) null);
+ }
@@ -39,6 +51,10 @@
+ CraftEventFactory.entityDamage = null;
}
-
+- if (entityliving.au()) {
+- entityliving.mount((Entity) null);
+- }
+-
- entityliving.enderTeleportTo(this.locX, this.locY, this.locZ);
- entityliving.fallDistance = 0.0F;
- entityliving.damageEntity(DamageSource.FALL, 5.0F);