2016-03-02 17:41:59 +01:00
|
|
|
--- a/net/minecraft/server/TileEntityEndGateway.java
|
|
|
|
+++ b/net/minecraft/server/TileEntityEndGateway.java
|
2018-12-06 00:00:00 +01:00
|
|
|
@@ -6,6 +6,12 @@
|
2016-05-10 13:47:39 +02:00
|
|
|
import javax.annotation.Nullable;
|
2016-03-02 17:41:59 +01:00
|
|
|
import org.apache.logging.log4j.LogManager;
|
|
|
|
import org.apache.logging.log4j.Logger;
|
2016-05-10 13:47:39 +02:00
|
|
|
+// CraftBukkit start
|
2016-03-02 17:41:59 +01:00
|
|
|
+import org.bukkit.Bukkit;
|
|
|
|
+import org.bukkit.Location;
|
|
|
|
+import org.bukkit.craftbukkit.entity.CraftPlayer;
|
|
|
|
+import org.bukkit.event.player.PlayerTeleportEvent;
|
2016-05-10 13:47:39 +02:00
|
|
|
+// CraftBukkit end
|
2016-03-02 17:41:59 +01:00
|
|
|
|
2016-11-17 02:41:03 +01:00
|
|
|
public class TileEntityEndGateway extends TileEntityEnderPortal implements ITickable {
|
2016-03-02 17:41:59 +01:00
|
|
|
|
2020-08-11 23:00:00 +02:00
|
|
|
@@ -117,7 +123,7 @@
|
|
|
|
public void b(Entity entity) {
|
2020-07-22 10:48:16 +02:00
|
|
|
if (this.world instanceof WorldServer && !this.f()) {
|
|
|
|
this.c = 100;
|
|
|
|
- if (this.exitPortal == null && this.world.getDimensionKey() == World.THE_END) {
|
|
|
|
+ if (this.exitPortal == null && this.world.getTypeKey() == DimensionManager.THE_END) { // CraftBukkit - work in alternate worlds
|
|
|
|
this.a((WorldServer) this.world);
|
|
|
|
}
|
|
|
|
|
2020-08-11 23:00:00 +02:00
|
|
|
@@ -142,6 +148,27 @@
|
2020-06-25 02:00:00 +02:00
|
|
|
entity1 = entity.getRootVehicle();
|
|
|
|
}
|
2016-03-02 17:41:59 +01:00
|
|
|
|
|
|
|
+ // CraftBukkit start - Fire PlayerTeleportEvent
|
2020-06-25 02:00:00 +02:00
|
|
|
+ if (entity1 instanceof EntityPlayer) {
|
|
|
|
+ org.bukkit.craftbukkit.entity.CraftPlayer player = (CraftPlayer) entity1.getBukkitEntity();
|
2016-03-02 17:41:59 +01:00
|
|
|
+ org.bukkit.Location location = new Location(world.getWorld(), (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D);
|
|
|
|
+ location.setPitch(player.getLocation().getPitch());
|
|
|
|
+ location.setYaw(player.getLocation().getYaw());
|
|
|
|
+
|
|
|
|
+ PlayerTeleportEvent teleEvent = new PlayerTeleportEvent(player, player.getLocation(), location, PlayerTeleportEvent.TeleportCause.END_GATEWAY);
|
|
|
|
+ Bukkit.getPluginManager().callEvent(teleEvent);
|
|
|
|
+ if (teleEvent.isCancelled()) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
2020-08-11 23:00:00 +02:00
|
|
|
+ entity1.resetPortalCooldown();
|
2020-06-25 04:16:41 +02:00
|
|
|
+ ((EntityPlayer) entity1).playerConnection.teleport(teleEvent.getTo());
|
2020-06-25 02:00:00 +02:00
|
|
|
+ this.h(); // CraftBukkit - call at end of method
|
2016-03-02 17:41:59 +01:00
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
|
|
|
+
|
2020-08-11 23:00:00 +02:00
|
|
|
entity1.resetPortalCooldown();
|
2020-06-25 02:00:00 +02:00
|
|
|
entity1.enderTeleportAndLoad((double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D);
|
2016-03-02 17:41:59 +01:00
|
|
|
}
|
2020-08-11 23:00:00 +02:00
|
|
|
@@ -246,7 +273,7 @@
|
2019-12-10 23:00:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
private void a(WorldServer worldserver, BlockPosition blockposition) {
|
2020-08-11 23:00:00 +02:00
|
|
|
- WorldGenerator.END_GATEWAY.b((WorldGenFeatureConfiguration) WorldGenEndGatewayConfiguration.a(this.getPosition(), false)).a(worldserver, worldserver.getChunkProvider().getChunkGenerator(), new Random(), blockposition);
|
|
|
|
+ WorldGenerator.END_GATEWAY.b(WorldGenEndGatewayConfiguration.a(this.getPosition(), false)).a(worldserver, worldserver.getChunkProvider().getChunkGenerator(), new Random(), blockposition); // CraftBukkit - decompile error
|
2019-12-10 23:00:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public void a(BlockPosition blockposition, boolean flag) {
|