mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-29 11:42:55 +01:00
Use correct update flag and blockdata for portals
Fixes GH-1286
This commit is contained in:
parent
751317f21b
commit
03028e52a3
1 changed files with 5 additions and 14 deletions
|
@ -8,15 +8,6 @@ diff --git a/src/main/java/net/minecraft/server/PortalTravelAgent.java b/src/mai
|
|||
index 402d8d7d6..ba8d15431 100644
|
||||
--- a/src/main/java/net/minecraft/server/PortalTravelAgent.java
|
||||
+++ b/src/main/java/net/minecraft/server/PortalTravelAgent.java
|
||||
@@ -12,7 +12,7 @@ import org.bukkit.util.Vector;
|
||||
|
||||
public class PortalTravelAgent {
|
||||
|
||||
- private static final BlockPortal a = (BlockPortal) Blocks.NETHER_PORTAL;
|
||||
+ private static final BlockPortal a = (BlockPortal) Blocks.NETHER_PORTAL; private static final BlockPortal PORTAL_BLOCK = a; // Paper - OBFHELPER
|
||||
public final WorldServer world; // Paper - private -> public
|
||||
private final Random c;
|
||||
private final Long2ObjectMap<PortalTravelAgent.ChunkCoordinatesPortal> d = new Long2ObjectOpenHashMap(4096);
|
||||
@@ -48,6 +48,9 @@ public class PortalTravelAgent {
|
||||
byte b0 = 1;
|
||||
byte b1 = 0;
|
||||
|
@ -96,16 +87,16 @@ index 402d8d7d6..ba8d15431 100644
|
|||
+
|
||||
+ // Paper start
|
||||
+ BlockPosition pos = new BlockPosition(blockposition_mutableblockposition.getX(), blockposition_mutableblockposition.getY(), blockposition_mutableblockposition.getZ());
|
||||
+ nmsBlocks.putIfAbsent(pos, PORTAL_BLOCK.getBlockData());
|
||||
+ nmsBlocks.putIfAbsent(pos, iblockdata);
|
||||
+ bukkitBlocks.add(this.world.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ()));
|
||||
+ // paper end
|
||||
+ // Paper end
|
||||
}
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
+ org.bukkit.event.world.PortalCreateEvent event = new org.bukkit.event.world.PortalCreateEvent(bukkitBlocks, this.world.getWorld(), org.bukkit.event.world.PortalCreateEvent.CreateReason.OBC_DESTINATION);
|
||||
+ if (event.callEvent()) {
|
||||
+ nmsBlocks.forEach((pos, data) -> this.world.setTypeAndData(pos, data, 2));
|
||||
+ nmsBlocks.forEach((pos, data) -> this.world.setTypeAndData(pos, data, 18)); // keep flag in sync with removed call above
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
|
|
Loading…
Reference in a new issue