diff options
author | md_5 <git@md-5.net> | 2018-07-15 10:00:00 +1000 |
---|---|---|
committer | md_5 <git@md-5.net> | 2018-07-15 10:00:00 +1000 |
commit | 421c1728c81e2f729dff88da2ac96535d2b8e5e8 (patch) | |
tree | 6c51d93e811d1eb86b68461a42fc5cf03b168b0c /nms-patches/EntityTypes.patch | |
parent | 57ab4cfc6f4ff526d44319d9b8c79f6848db2de7 (diff) | |
download | craftbukkit-421c1728c81e2f729dff88da2ac96535d2b8e5e8.tar craftbukkit-421c1728c81e2f729dff88da2ac96535d2b8e5e8.tar.gz craftbukkit-421c1728c81e2f729dff88da2ac96535d2b8e5e8.tar.lz craftbukkit-421c1728c81e2f729dff88da2ac96535d2b8e5e8.tar.xz craftbukkit-421c1728c81e2f729dff88da2ac96535d2b8e5e8.zip |
Update to Minecraft 1.13-pre7
Diffstat (limited to 'nms-patches/EntityTypes.patch')
-rw-r--r-- | nms-patches/EntityTypes.patch | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/nms-patches/EntityTypes.patch b/nms-patches/EntityTypes.patch new file mode 100644 index 00000000..8b0f7041 --- /dev/null +++ b/nms-patches/EntityTypes.patch @@ -0,0 +1,39 @@ +--- a/net/minecraft/server/EntityTypes.java ++++ b/net/minecraft/server/EntityTypes.java +@@ -148,10 +148,16 @@ + + @Nullable + public T a(World world, @Nullable NBTTagCompound nbttagcompound, @Nullable IChatBaseComponent ichatbasecomponent, @Nullable EntityHuman entityhuman, BlockPosition blockposition, boolean flag, boolean flag1) { ++ // CraftBukkit start ++ return spawnCreature(world, nbttagcompound, ichatbasecomponent, entityhuman, blockposition, flag, flag1, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER_EGG); ++ } ++ ++ @Nullable ++ public T spawnCreature(World world, @Nullable NBTTagCompound nbttagcompound, @Nullable IChatBaseComponent ichatbasecomponent, @Nullable EntityHuman entityhuman, BlockPosition blockposition, boolean flag, boolean flag1, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason spawnReason) { + Entity entity = this.b(world, nbttagcompound, ichatbasecomponent, entityhuman, blockposition, flag, flag1); + +- world.addEntity(entity); +- return entity; ++ return world.addEntity(entity, spawnReason) ? (T) entity : null; // Don't return an entity when CreatureSpawnEvent is canceled ++ // CraftBukkit end + } + + @Nullable +@@ -185,7 +191,7 @@ + } + + a(world, entityhuman, entity, nbttagcompound); +- return entity; ++ return (T) entity; // CraftBukkit - decompile error + } + } + +@@ -240,7 +246,7 @@ + + @Nullable + public T a(World world) { +- return (Entity) this.aU.apply(world); ++ return this.aU.apply(world); // CraftBukkit - decompile error + } + + @Nullable |