Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-19 13:00:06 +01:00
SPIGOT-4769: PlayerPortalEvent does not have correct cause when entering end
Dieser Commit ist enthalten in:
Ursprung
f4dc98074c
Commit
112c84e1e3
@ -1,20 +1,28 @@
|
|||||||
--- a/net/minecraft/server/BlockEnderPortal.java
|
--- a/net/minecraft/server/BlockEnderPortal.java
|
||||||
+++ b/net/minecraft/server/BlockEnderPortal.java
|
+++ b/net/minecraft/server/BlockEnderPortal.java
|
||||||
@@ -1,5 +1,7 @@
|
@@ -1,5 +1,10 @@
|
||||||
package net.minecraft.server;
|
package net.minecraft.server;
|
||||||
|
|
||||||
+import org.bukkit.event.entity.EntityPortalEnterEvent; // CraftBukkit
|
+// CraftBukkit start
|
||||||
|
+import org.bukkit.event.entity.EntityPortalEnterEvent;
|
||||||
|
+import org.bukkit.event.player.PlayerTeleportEvent;
|
||||||
|
+// CraftBukkit end
|
||||||
+
|
+
|
||||||
public class BlockEnderPortal extends BlockTileEntity {
|
public class BlockEnderPortal extends BlockTileEntity {
|
||||||
|
|
||||||
protected static final VoxelShape a = Block.a(0.0D, 0.0D, 0.0D, 16.0D, 12.0D, 16.0D);
|
protected static final VoxelShape a = Block.a(0.0D, 0.0D, 0.0D, 16.0D, 12.0D, 16.0D);
|
||||||
@@ -21,6 +23,10 @@
|
@@ -21,6 +26,15 @@
|
||||||
@Override
|
@Override
|
||||||
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
|
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
|
||||||
if (!world.isClientSide && !entity.isPassenger() && !entity.isVehicle() && entity.canPortal() && VoxelShapes.c(VoxelShapes.a(entity.getBoundingBox().d((double) (-blockposition.getX()), (double) (-blockposition.getY()), (double) (-blockposition.getZ()))), iblockdata.getShape(world, blockposition), OperatorBoolean.AND)) {
|
if (!world.isClientSide && !entity.isPassenger() && !entity.isVehicle() && entity.canPortal() && VoxelShapes.c(VoxelShapes.a(entity.getBoundingBox().d((double) (-blockposition.getX()), (double) (-blockposition.getY()), (double) (-blockposition.getZ()))), iblockdata.getShape(world, blockposition), OperatorBoolean.AND)) {
|
||||||
+ // CraftBukkit start - Entity in portal
|
+ // CraftBukkit start - Entity in portal
|
||||||
+ EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ()));
|
+ EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ()));
|
||||||
+ world.getServer().getPluginManager().callEvent(event);
|
+ world.getServer().getPluginManager().callEvent(event);
|
||||||
|
+
|
||||||
|
+ if (entity instanceof EntityPlayer) {
|
||||||
|
+ ((EntityPlayer) entity).a(world.worldProvider.getDimensionManager() == DimensionManager.THE_END ? DimensionManager.OVERWORLD : DimensionManager.THE_END, PlayerTeleportEvent.TeleportCause.END_PORTAL);
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
entity.a(world.worldProvider.getDimensionManager() == DimensionManager.THE_END ? DimensionManager.OVERWORLD : DimensionManager.THE_END);
|
entity.a(world.worldProvider.getDimensionManager() == DimensionManager.THE_END ? DimensionManager.OVERWORLD : DimensionManager.THE_END);
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren