Fix PortalCreateEvent again (#1324)

This commit is contained in:
prplz 2018-08-12 09:18:30 +10:00 committed by Daniel Ennis
parent 90d1b73601
commit 8ad4c1e475

View File

@ -1,11 +1,11 @@
From 53121b6463406e4fa83e4f49da16b28cf25f400a Mon Sep 17 00:00:00 2001
From 0e37166c412ab13ae4514136d1313cf404909ef7 Mon Sep 17 00:00:00 2001
From: MiniDigger <admin@minidigger.me>
Date: Sun, 18 Mar 2018 15:44:44 +0100
Subject: [PATCH] Call PortalCreateEvent for exit portals
diff --git a/src/main/java/net/minecraft/server/PortalTravelAgent.java b/src/main/java/net/minecraft/server/PortalTravelAgent.java
index 402d8d7d63..7444f4621e 100644
index 402d8d7d..72b85bf6 100644
--- a/src/main/java/net/minecraft/server/PortalTravelAgent.java
+++ b/src/main/java/net/minecraft/server/PortalTravelAgent.java
@@ -48,6 +48,9 @@ public class PortalTravelAgent {
@ -25,7 +25,7 @@ index 402d8d7d63..7444f4621e 100644
- this.world.setTypeUpdate(new BlockPosition(k1, l1, i2), flag2 ? Blocks.OBSIDIAN.getBlockData() : Blocks.AIR.getBlockData());
+ // Paper start
+ BlockPosition pos = new BlockPosition(k1, l1, i2);
+ nmsBlocks.putIfAbsent(pos, flag2 ? Blocks.OBSIDIAN.getBlockData() : Blocks.AIR.getBlockData());
+ nmsBlocks.put(pos, flag2 ? Blocks.OBSIDIAN.getBlockData() : Blocks.AIR.getBlockData());
+ bukkitBlocks.add(this.world.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ()));
+ // Paper end
}
@ -60,7 +60,7 @@ index 402d8d7d63..7444f4621e 100644
- this.world.setTypeUpdate(blockposition_mutableblockposition, flag1 ? Blocks.OBSIDIAN.getBlockData() : Blocks.AIR.getBlockData());
+ // Paper start
+ BlockPosition pos = new BlockPosition(j3, k3, l3);
+ nmsBlocks.putIfAbsent(pos, flag1 ? Blocks.OBSIDIAN.getBlockData() : Blocks.AIR.getBlockData());
+ nmsBlocks.put(pos, flag1 ? Blocks.OBSIDIAN.getBlockData() : Blocks.AIR.getBlockData());
+ bukkitBlocks.add(this.world.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ()));
+ // Paper end
}
@ -73,7 +73,7 @@ index 402d8d7d63..7444f4621e 100644
- this.world.setTypeAndData(blockposition_mutableblockposition, Blocks.OBSIDIAN.getBlockData(), 3);
+ // Paper start
+ BlockPosition pos = new BlockPosition(blockposition_mutableblockposition.getX(), blockposition_mutableblockposition.getY(), blockposition_mutableblockposition.getZ());
+ nmsBlocks.putIfAbsent(pos, Blocks.OBSIDIAN.getBlockData());
+ nmsBlocks.put(pos, Blocks.OBSIDIAN.getBlockData());
+ bukkitBlocks.add(this.world.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ()));
+ // Paper end
}
@ -87,7 +87,7 @@ index 402d8d7d63..7444f4621e 100644
+
+ // Paper start
+ BlockPosition pos = new BlockPosition(blockposition_mutableblockposition.getX(), blockposition_mutableblockposition.getY(), blockposition_mutableblockposition.getZ());
+ nmsBlocks.putIfAbsent(pos, iblockdata);
+ nmsBlocks.put(pos, iblockdata);
+ bukkitBlocks.add(this.world.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ()));
+ // Paper end
}
@ -104,5 +104,5 @@ index 402d8d7d63..7444f4621e 100644
}
--
2.18.0
2.18.0.windows.1