13
0
geforkt von Mirrors/Paper

Updated Upstream (CraftBukkit)

Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

CraftBukkit Changes:
01334e7d #616: Fix exception on entity portal teleport attempt
Dieser Commit ist enthalten in:
Shane Freeder 2020-01-14 21:43:50 +00:00
Ursprung a7b7d83c8c
Commit 10159aa459
15 geänderte Dateien mit 33 neuen und 120 gelöschten Zeilen

Datei anzeigen

@ -39,7 +39,7 @@ index 1eca7f354..8b85956e5 100644
entitywitch.prepare(this.world, this.world.getDamageScaler(new BlockPosition(entitywitch)), EnumMobSpawn.CONVERSION, (GroupDataEntity) null, (NBTTagCompound) null);
entitywitch.setNoAI(this.isNoAI());
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index e192f5f93..4b5d5e518 100644
index 72b8677f2..2d454a3c3 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -0,0 +0,0 @@ public class CraftEventFactory {

Datei anzeigen

@ -93,7 +93,7 @@ index 2e4c9d426..724b78b5d 100644
this.c(((MovingObjectPositionBlock) movingobjectposition).getBlockPosition());
} else {
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index e69d73c45..c1eb5a05c 100644
index 95973558e..c45b7c15f 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -0,0 +0,0 @@ public class CraftEventFactory {

Datei anzeigen

@ -19,18 +19,18 @@ index 62e793b71..5de4ec052 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 2ed5ff412..909f446c6 100644
index 4fcba0c0d..6314c4a19 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
// CraftBukkit start - EntityPortalEvent
// SPIGOT-5136 - don't fire event for CraftEntity.teleport
- int searchRadius = 128;
+ int searchRadius = world.paperConfig.portalSearchRadius; // Paper - use portal search radius as default
if (location == null) {
Location enter = this.getBukkitEntity().getLocation();
Location exit = new Location(worldserver1.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ());
blockposition = new BlockPosition(d0, this.locY(), d1);
// CraftBukkit start
- EntityPortalEvent event = CraftEventFactory.callEntityPortalEvent(this, worldserver1, blockposition, 128);
+ EntityPortalEvent event = CraftEventFactory.callEntityPortalEvent(this, worldserver1, blockposition, world.paperConfig.portalSearchRadius); // Paper - use portal search radius
if (event == null) {
return null;
}
diff --git a/src/main/java/net/minecraft/server/PortalTravelAgent.java b/src/main/java/net/minecraft/server/PortalTravelAgent.java
index 503e3016a..b5f224e3b 100644
--- a/src/main/java/net/minecraft/server/PortalTravelAgent.java

Datei anzeigen

@ -69,7 +69,7 @@ index aaed8c0ae..0ff92aea5 100644
((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutBlockChange(world, blockposition)); // SPIGOT-4238: needed when looking through entity
((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); // SPIGOT-4541
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index d74c9d811..d329a0c1b 100644
index 317a5bf4e..f006b441a 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -0,0 +0,0 @@ public class CraftEventFactory {

Datei anzeigen

@ -18,7 +18,7 @@ index f72bb0c13..0447800d9 100644
this.die();
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 4b5d5e518..e69d73c45 100644
index 2d454a3c3..95973558e 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -0,0 +0,0 @@ import org.bukkit.entity.ThrownPotion;

Datei anzeigen

@ -93,7 +93,7 @@ index c7c600b80..64c327669 100644
int k = MathHelper.floor(entity.locY() / 16.0D);
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 88d7808b2..579ad1c43 100644
index 464301a1f..85f16bdb8 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke

Datei anzeigen

@ -72,7 +72,7 @@ index 608be9e70..011efc6f5 100644
event.getProjectile().remove();
return;
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 060671a58..13598e3bb 100644
index f9b0f39f7..caf277439 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -0,0 +0,0 @@ import net.minecraft.server.GeneratorAccess;

Datei anzeigen

@ -8,7 +8,7 @@ Plugins can cancel this if they want to ensure experience orbs do not lose impor
metadata such as spawn reason, or conditionally move data from source to target.
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index b8e5c6322..060671a58 100644
index dbda8b35a..f9b0f39f7 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -0,0 +0,0 @@ public class CraftEventFactory {

Datei anzeigen

@ -1,87 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Tue, 14 Jan 2020 09:12:55 +0000
Subject: [PATCH] Fix entity teleportation exceptions
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 58e79df57..810a5edb6 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
return teleportTo(dimensionmanager, null);
}
+ // Paper start
+ private EntityPortalEvent callEntityPortalEvent(WorldServer worldserver1, BlockPosition blockposition, int searchRadius) {
+ Location enter = this.getBukkitEntity().getLocation();
+ Location exit = new Location(worldserver1.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ());
+
+ EntityPortalEvent event = new EntityPortalEvent(this.getBukkitEntity(), enter, exit, searchRadius);
+ event.getEntity().getServer().getPluginManager().callEvent(event);
+ if (event.isCancelled() || event.getTo() == null || event.getTo().getWorld() == null || !this.isAlive()) {
+ return null;
+ }
+
+ return event;
+ }
+ // paper end
@Nullable
public Entity teleportTo(DimensionManager dimensionmanager, BlockPosition location) {
// CraftBukkit end
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
// CraftBukkit start - EntityPortalEvent
// SPIGOT-5136 - don't fire event for CraftEntity.teleport
int searchRadius = world.paperConfig.portalSearchRadius; // Paper - use portal search radius as default
- if (location == null) {
+ if (location == null) { /* // Paper - move up
Location enter = this.getBukkitEntity().getLocation();
Location exit = new Location(worldserver1.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ());
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
worldserver1 = ((CraftWorld) exit.getWorld()).getHandle();
blockposition = new BlockPosition(exit.getX(), exit.getY(), exit.getZ());
searchRadius = event.getSearchRadius();
- }
+ */} // Paper - move up
// CraftBukkit end
if (blockposition == null) { // CraftBukkit
+ ;
if (dimensionmanager1.getType() == DimensionManager.THE_END && dimensionmanager == DimensionManager.OVERWORLD) { // CraftBukkit
- blockposition = worldserver1.getHighestBlockYAt(HeightMap.Type.MOTION_BLOCKING_NO_LEAVES, worldserver1.getSpawn());
+ EntityPortalEvent portalEvent = callEntityPortalEvent(worldserver1, worldserver1.getHighestBlockYAt(HeightMap.Type.MOTION_BLOCKING_NO_LEAVES, worldserver1.getSpawn()), 1); // Paper - EntityPortalEvent - hardcode 1, no search here
+ // Paper start
+ if (portalEvent == null) return null;
+ Location exit = portalEvent.getTo();
+ worldserver1 = ((CraftWorld) exit.getWorld()).getHandle();
+ blockposition = new BlockPosition(exit.getX(), exit.getY(), exit.getZ());
+ //Paper end
} else if (dimensionmanager.getType() == DimensionManager.THE_END) { // CraftBukkit
- blockposition = worldserver1.getDimensionSpawn();
+ EntityPortalEvent portalEvent = callEntityPortalEvent(worldserver1, worldserver1.getDimensionSpawn(), 1); // Paper - EntityPortalEvent - hardcode 1, no search here
+ // Paper start
+ if (portalEvent == null) return null;
+ Location exit = portalEvent.getTo();
+ worldserver1 = ((CraftWorld) exit.getWorld()).getHandle();
+ blockposition = new BlockPosition(exit.getX(), exit.getY(), exit.getZ());
+ //Paper end
} else {
double d0 = this.locX();
double d1 = this.locZ();
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
Vec3D vec3d1 = this.getPortalOffset();
blockposition = new BlockPosition(d0, this.locY(), d1);
+ // Paper start - EntityPortalEvent
+ EntityPortalEvent portalEvent = callEntityPortalEvent(worldserver1, blockposition, searchRadius);
+ if (portalEvent == null) return null;
+ Location exit = portalEvent.getTo();
+ worldserver1 = ((CraftWorld) exit.getWorld()).getHandle();
+ blockposition = new BlockPosition(exit.getX(), exit.getY(), exit.getZ());
+ searchRadius = portalEvent.getSearchRadius();
+ // Paper end
ShapeDetector.Shape shapedetector_shape = worldserver1.getTravelAgent().findPortal(blockposition, vec3d, this.getPortalDirection(), vec3d1.x, vec3d1.y, this instanceof EntityHuman, searchRadius); // CraftBukkit - search radius
if (shapedetector_shape == null) {
--

Datei anzeigen

@ -15,7 +15,7 @@ items and experience which is otherwise only properly possible by using
internal code.
diff --git a/src/main/java/net/minecraft/server/CombatTracker.java b/src/main/java/net/minecraft/server/CombatTracker.java
index 6daa400d27..38fe29f8a2 100644
index 6daa400d2..38fe29f8a 100644
--- a/src/main/java/net/minecraft/server/CombatTracker.java
+++ b/src/main/java/net/minecraft/server/CombatTracker.java
@@ -0,0 +0,0 @@ public class CombatTracker {
@ -27,7 +27,7 @@ index 6daa400d27..38fe29f8a2 100644
int i = this.f ? 300 : 100;
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 75343a4386..b03316bc8c 100644
index d2d49ba47..f110e5241 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@ -47,7 +47,7 @@ index 75343a4386..b03316bc8c 100644
protected void k(double d0, double d1, double d2) {
diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java
index b51662ee99..e6032e3edc 100644
index b51662ee9..e6032e3ed 100644
--- a/src/main/java/net/minecraft/server/EntityArmorStand.java
+++ b/src/main/java/net/minecraft/server/EntityArmorStand.java
@@ -0,0 +0,0 @@ public class EntityArmorStand extends EntityLiving {
@ -61,7 +61,7 @@ index b51662ee99..e6032e3edc 100644
}
diff --git a/src/main/java/net/minecraft/server/EntityFox.java b/src/main/java/net/minecraft/server/EntityFox.java
index 97ffd93462..bd62ac3ed8 100644
index 97ffd9346..bd62ac3ed 100644
--- a/src/main/java/net/minecraft/server/EntityFox.java
+++ b/src/main/java/net/minecraft/server/EntityFox.java
@@ -0,0 +0,0 @@ public class EntityFox extends EntityAnimal {
@ -94,7 +94,7 @@ index 97ffd93462..bd62ac3ed8 100644
public static boolean a(EntityFox entityfox, EntityLiving entityliving) {
diff --git a/src/main/java/net/minecraft/server/EntityHorseChestedAbstract.java b/src/main/java/net/minecraft/server/EntityHorseChestedAbstract.java
index 80717ad9ac..53aac5bccd 100644
index 80717ad9a..53aac5bcc 100644
--- a/src/main/java/net/minecraft/server/EntityHorseChestedAbstract.java
+++ b/src/main/java/net/minecraft/server/EntityHorseChestedAbstract.java
@@ -0,0 +0,0 @@ public abstract class EntityHorseChestedAbstract extends EntityHorseAbstract {
@ -119,7 +119,7 @@ index 80717ad9ac..53aac5bccd 100644
public void b(NBTTagCompound nbttagcompound) {
super.b(nbttagcompound);
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 1592a705f6..b59b39d418 100644
index 1592a705f..b59b39d41 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
@ -279,7 +279,7 @@ index 1592a705f6..b59b39d418 100644
return this.isBaby() ? (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.5F : (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F;
}
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index ee28106859..9068aeeec8 100644
index 0ac63f0ba..02a1b2029 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@ -330,7 +330,7 @@ index ee28106859..9068aeeec8 100644
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftSound.java b/src/main/java/org/bukkit/craftbukkit/CraftSound.java
index 90fdf89c81..b761a41dcd 100644
index 90fdf89c8..b761a41dc 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftSound.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftSound.java
@@ -0,0 +0,0 @@ public enum CraftSound {
@ -357,7 +357,7 @@ index 90fdf89c81..b761a41dcd 100644
this.minecraftKey = minecraftKey;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 4b45986257..d9440753f5 100644
index 4b4598625..d9440753f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -378,7 +378,7 @@ index 4b45986257..d9440753f5 100644
public void injectScaledMaxHealth(Collection<AttributeInstance> collection, boolean force) {
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index d329a0c1b1..c0fd2948e3 100644
index f006b441a..39ce40bd5 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -0,0 +0,0 @@ public class CraftEventFactory {

Datei anzeigen

@ -34,7 +34,7 @@ index ba3e6b882..2265b01e6 100644
this.activeContainer = this.defaultContainer;
}
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 0a1f82c10..9fd94b884 100644
index 225721d1f..0ac63f0ba 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@ -168,7 +168,7 @@ index 78a328099..b93bafb3f 100644
// Check if the fromWorld and toWorld are the same.
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 13598e3bb..bb48d44ff 100644
index caf277439..f931fa48b 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -0,0 +0,0 @@ public class CraftEventFactory {

Datei anzeigen

@ -20,7 +20,7 @@ index c145e27cc..671587631 100644
+ }
}
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index c1eb5a05c..b8e5c6322 100644
index c45b7c15f..dbda8b35a 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -0,0 +0,0 @@ public class CraftEventFactory {

Datei anzeigen

@ -32,7 +32,7 @@ index 277f7618e..1dbeb209e 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 68e3c7dad..5ccdb389a 100644
index 5a168037f..d6da1efd4 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Vanished players don't have rights
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 3458333c9..6ef5d2ebd 100644
index 189542b91..c2ca16968 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@ -76,7 +76,7 @@ index 143be566c..08c83c62d 100644
if (operatorboolean.apply(false, false)) {
throw (IllegalArgumentException) SystemUtils.c(new IllegalArgumentException());
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index c6f41d8a6..1fbecceb9 100644
index 6742c991f..b6d904007 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@ -127,7 +127,7 @@ index c6f41d8a6..1fbecceb9 100644
public boolean p_() {
return this.isClientSide;
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index bb48d44ff..d74c9d811 100644
index f931fa48b..317a5bf4e 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -0,0 +0,0 @@ public class CraftEventFactory {

@ -1 +1 @@
Subproject commit e8cb2f513b316706aaf8dd47cfff39aad647dce2
Subproject commit 01334e7dcba25af640f308c64078c32387349e57