summaryrefslogtreecommitdiffstats
path: root/nms-patches/EntityEnderCrystal.patch
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2016-03-01 08:32:46 +1100
committermd_5 <git@md-5.net>2016-03-01 09:32:45 +1100
commitaa008dff0f9bedbe88e1fe79831776b0a52eb90a (patch)
treecb520e0f4cc5d683fb9b7fb95de37480a7443dfb /nms-patches/EntityEnderCrystal.patch
parente1ebe524a78e27f6a2829ed4574fded3779094e1 (diff)
downloadcraftbukkit-aa008dff0f9bedbe88e1fe79831776b0a52eb90a.tar
craftbukkit-aa008dff0f9bedbe88e1fe79831776b0a52eb90a.tar.gz
craftbukkit-aa008dff0f9bedbe88e1fe79831776b0a52eb90a.tar.lz
craftbukkit-aa008dff0f9bedbe88e1fe79831776b0a52eb90a.tar.xz
craftbukkit-aa008dff0f9bedbe88e1fe79831776b0a52eb90a.zip
Update to Minecraft 1.9
Diffstat (limited to 'nms-patches/EntityEnderCrystal.patch')
-rw-r--r--nms-patches/EntityEnderCrystal.patch57
1 files changed, 28 insertions, 29 deletions
diff --git a/nms-patches/EntityEnderCrystal.patch b/nms-patches/EntityEnderCrystal.patch
index 3e39d778..41f4cf39 100644
--- a/nms-patches/EntityEnderCrystal.patch
+++ b/nms-patches/EntityEnderCrystal.patch
@@ -1,7 +1,8 @@
--- a/net/minecraft/server/EntityEnderCrystal.java
+++ b/net/minecraft/server/EntityEnderCrystal.java
-@@ -1,5 +1,10 @@
- package net.minecraft.server;
+@@ -2,6 +2,11 @@
+
+ import com.google.common.base.Optional;
+// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftEventFactory;
@@ -10,21 +11,21 @@
+
public class EntityEnderCrystal extends Entity {
- public int a;
-@@ -32,7 +37,11 @@
- int k = MathHelper.floor(this.locZ);
+ private static final DataWatcherObject<Optional<BlockPosition>> b = DataWatcher.a(EntityEnderCrystal.class, DataWatcherRegistry.k);
+@@ -38,7 +43,11 @@
+ BlockPosition blockposition = new BlockPosition(this);
- if (this.world.worldProvider instanceof WorldProviderTheEnd && this.world.getType(new BlockPosition(i, j, k)).getBlock() != Blocks.FIRE) {
-- this.world.setTypeUpdate(new BlockPosition(i, j, k), Blocks.FIRE.getBlockData());
-+ // CraftBukkit start
-+ if (!CraftEventFactory.callBlockIgniteEvent(this.world, i, j, k, this).isCancelled()) {
-+ this.world.setTypeUpdate(new BlockPosition(i, j, k), Blocks.FIRE.getBlockData());
-+ }
-+ // CraftBukkit end
+ if (this.world.worldProvider instanceof WorldProviderTheEnd && this.world.getType(blockposition).getBlock() != Blocks.FIRE) {
+- this.world.setTypeUpdate(blockposition, Blocks.FIRE.getBlockData());
++ // CraftBukkit start
++ if (!CraftEventFactory.callBlockIgniteEvent(this.world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), this).isCancelled()) {
++ this.world.setTypeUpdate(blockposition, Blocks.FIRE.getBlockData());
++ }
++ // CraftBukkit end
+ }
}
- }
-@@ -50,11 +59,24 @@
+@@ -74,9 +83,22 @@
return false;
} else {
if (!this.dead && !this.world.isClientSide) {
@@ -33,20 +34,18 @@
+ return false;
+ }
+ // CraftBukkit end
- this.b = 0;
- if (this.b <= 0) {
- this.die();
- if (!this.world.isClientSide) {
-- this.world.explode((Entity) null, this.locX, this.locY, this.locZ, 6.0F, true);
-+ // CraftBukkit start
-+ ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), 6.0F, false);
-+ this.world.getServer().getPluginManager().callEvent(event);
-+ if (event.isCancelled()) {
-+ this.dead = false;
-+ return false;
-+ }
-+ this.world.createExplosion(this, this.locX, this.locY, this.locZ, event.getRadius(), event.getFire(), true);
-+ // CraftBukkit end
- }
+ this.die();
+ if (!this.world.isClientSide) {
+- this.world.explode((Entity) null, this.locX, this.locY, this.locZ, 6.0F, true);
++ // CraftBukkit start
++ ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), 6.0F, true);
++ this.world.getServer().getPluginManager().callEvent(event);
++ if (event.isCancelled()) {
++ this.dead = false;
++ return false;
++ }
++ this.world.explode(this, this.locX, this.locY, this.locZ, event.getRadius(), event.getFire());
++ // CraftBukkit end
+ this.a(damagesource);
}
}