Updated Upstream (CraftBukkit) (#4663)

This commit is contained in:
Mariell 2020-10-17 22:42:18 +02:00 committed by GitHub
parent 8319e912f4
commit 63d6aac46a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 35 additions and 35 deletions

View File

@ -117,7 +117,7 @@ index 8cd7c8d5d1a20239ffb3b064f8bd0b7a45cfc63f..cd7866f2251f68f24801eacc55800907
private String entityKeyString;
diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java
index cfbca7cfde3160e888e14c5bb3bc48267f1cb599..67fdd560f8136d83a13f75e265d5f5dd11871375 100644
index b8f0653e3e82824a62dfe64348a33ab6432b4e17..b9ffd000c97111678d45fd55dc9c207ebadc140e 100644
--- a/src/main/java/net/minecraft/server/TileEntity.java
+++ b/src/main/java/net/minecraft/server/TileEntity.java
@@ -51,6 +51,15 @@ public abstract class TileEntity implements KeyedObject { // Paper
@ -137,18 +137,18 @@ index cfbca7cfde3160e888e14c5bb3bc48267f1cb599..67fdd560f8136d83a13f75e265d5f5dd
@Nullable
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 82f9b1ad68012c6ea72337108bb3363a0f3a1f46..c4d7430cfe037ed65b49d2cc9c3d95002368fdc1 100644
index e753eb4c5edc466a1948cd575ccf827dd3c9bd9e..b1804d274e95d2e51018acd1159a9dfa1573d3be 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -143,6 +143,7 @@ import net.minecraft.server.EntityZombieHusk;
import net.minecraft.server.EntityZombieVillager;
@@ -144,6 +144,7 @@ import net.minecraft.server.EntityZombieVillager;
import net.minecraft.server.IChatBaseComponent;
import net.minecraft.server.NBTBase;
import net.minecraft.server.NBTTagCompound;
+import org.bukkit.Chunk; // Paper
import org.bukkit.EntityEffect;
import org.bukkit.Location;
import org.bukkit.Server;
@@ -184,6 +185,12 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@@ -185,6 +186,12 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
this.entity = entity;
}

View File

@ -117,10 +117,10 @@ index a807933d65a22dc1b15eda4dee819af72006fff3..25a4bd5a216798d01da33e54da4ab0e2
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index c4d7430cfe037ed65b49d2cc9c3d95002368fdc1..cee519adaad3f784640bb4d91b53b107054c5e58 100644
index b1804d274e95d2e51018acd1159a9dfa1573d3be..37f7ab8cb46312ce4a7fb53f3b394c1a6c478126 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -1032,4 +1032,12 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@@ -1033,4 +1033,12 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
return spigot;
}
// Spigot end

View File

@ -17,10 +17,10 @@ index b5e1ae8efb7165547e228d2c9d6d84a72b772df5..fb18d519961f5130e7b6907d24305b35
static {
ConfigurationSerialization.registerClass(CraftOfflinePlayer.class);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 10f96056700c88cc8e83477877788e3443cecefd..e7125c8a3a4b8374e3a5ea37dc097d383ba8bdc3 100644
index 37f7ab8cb46312ce4a7fb53f3b394c1a6c478126..b8aa6056c88c8fe2661318d799694d0cc3792e64 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -422,10 +422,41 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@@ -423,10 +423,41 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
public void setVelocity(Vector velocity) {
Preconditions.checkArgument(velocity != null, "velocity");
velocity.checkFinite();

View File

@ -49,10 +49,10 @@ index 259713339217660e8b81a9500f57c6995ea59dde..8eb20c6b9a88d5d4056f91df1f496d3d
if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, blockposition).isCancelled()) {
Entity vehicle = entity.getVehicle();
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 833ea97631563c7e4f35a232c5f3f371e6eff689..80dfa39fdf736225c3c1ad4bf510c250c0e87dba 100644
index b8aa6056c88c8fe2661318d799694d0cc3792e64..7dccddf91d2f6a8c422a378db6a0c9fc836ec9f2 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -1070,5 +1070,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@@ -1071,5 +1071,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
Location origin = getHandle().origin;
return origin == null ? null : origin.clone();
}

View File

@ -13,7 +13,7 @@ also Avoid NPE during CraftBlockEntityState load if could not get TE
If Tile Entity was null, correct Sign to return empty lines instead of null
diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java
index 6c4c804797fbbe73d179c6ed089427e64d0ebff4..338cf8c896a6fc869eb9c54d39ad5713f6fcc377 100644
index cea42d98aa6e1f96df0fa70234086dceb124fbbf..34d92491830c99172bec5251fa80300b6315e5ef 100644
--- a/src/main/java/net/minecraft/server/TileEntity.java
+++ b/src/main/java/net/minecraft/server/TileEntity.java
@@ -33,6 +33,7 @@ public abstract class TileEntity implements KeyedObject { // Paper
@ -31,8 +31,8 @@ index 6c4c804797fbbe73d179c6ed089427e64d0ebff4..338cf8c896a6fc869eb9c54d39ad5713
- this.persistentDataContainer = new CraftPersistentDataContainer(DATA_TYPE_REGISTRY);
+ this.persistentDataContainer.clear(); // Paper - clear instead of reinit
NBTTagCompound persistentDataTag = nbttagcompound.getCompound("PublicBukkitValues");
if (persistentDataTag != null) {
NBTBase persistentDataTag = nbttagcompound.get("PublicBukkitValues");
if (persistentDataTag instanceof NBTTagCompound) {
@@ -231,7 +232,12 @@ public abstract class TileEntity implements KeyedObject { // Paper
}

View File

@ -21,10 +21,10 @@ check is essentially the same as this.getHandle() == other.getHandle()
However, replaced it too to make it clearer of intent.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 1d3e4d5c88368f89f8b6da40788592362df8c87f..d55383d8fb471fe3441dbbc8e9344b42f1d7465b 100644
index 7dccddf91d2f6a8c422a378db6a0c9fc836ec9f2..a22c576ea6cc4115d53e51d710bd7ce55487dc65 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -738,14 +738,15 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@@ -739,14 +739,15 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
return false;
}
final CraftEntity other = (CraftEntity) obj;

View File

@ -96,10 +96,10 @@ index d6c86ce6a6a23ac8e889b0a9e7b8b7b8513ba5d1..21c0450d10e34ba066325af1b1bf7732
if (entity.valid) {
MinecraftServer.LOGGER.error("Attempted Double World add on " + entity, new Throwable());
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 61cadd53ca0125585da7fa33bfb8a82908f35cd2..423e6c3d4dc0266b70eae2dfa0aca6d4cc5442c5 100644
index a22c576ea6cc4115d53e51d710bd7ce55487dc65..22ac5f2bf0f2e4214855f3b1eb259a67b4c60776 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -1076,5 +1076,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@@ -1077,5 +1077,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
public boolean fromMobSpawner() {
return getHandle().spawnedViaMobSpawner;
}

View File

@ -2495,7 +2495,7 @@ index b49420bdbdd00148fc5f9a21d3f4953457b2cdc6..032464901e02392df4966c68cce8d06f
} finally {
playerChunkMap.callbackExecutor.run();
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
index 4036970f4831f49eb0f35e3c11743623ac2eabb5..5612f2f4d3cd76192868ff300f6affb7c6cb1c64 100644
index 10e84aa154d8a84a591ef1a16c14b3421c484bc7..efafe3247e302539a851b7fce0a9d7be79d64f99 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@@ -6,6 +6,7 @@ import it.unimi.dsi.fastutil.longs.LongOpenHashSet;
@ -4094,10 +4094,10 @@ index e741d1f966869b057652a93a1ef1785ad152f303..204ad44454732345be78c5c428dfb178
// Spigot start
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 423e6c3d4dc0266b70eae2dfa0aca6d4cc5442c5..fb6fa1d15dc7d189a38e2cc78d9c7d24cf0af752 100644
index 22ac5f2bf0f2e4214855f3b1eb259a67b4c60776..f36c85802dc2d6260058b2a77f225f32624775cb 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -501,6 +501,28 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@@ -502,6 +502,28 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
entity.setHeadRotation(yaw);
}

View File

@ -16,7 +16,7 @@ We further improve it by making a copy of the nbt tag with only the memory
it needs, so that we dont have to hold a copy to the entire compound.
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
index f18cb4aedc4a6536bf45db591b6d2b64cefce676..5eb14b330d3f175e22650f292aa6c040f24e9492 100644
index f26740cd0f6a7758dc45cbacd4919d38bbdbb1c4..4e40067d75a1bce92a3804b99ee76ffc43411b75 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@@ -156,15 +156,9 @@ public class ChunkRegionLoader {
@ -26,9 +26,9 @@ index f18cb4aedc4a6536bf45db591b6d2b64cefce676..5eb14b330d3f175e22650f292aa6c040
- object = new Chunk(worldserver.getMinecraftWorld(), chunkcoordintpair, biomestorage, chunkconverter, (TickList) object1, (TickList) object2, j, achunksection, (chunk) -> {
- loadEntities(nbttagcompound1, chunk);
- // CraftBukkit start - load chunk persistent data from nbt
- NBTTagCompound persistentBase = nbttagcompound1.getCompound("BukkitValues");
- if (persistentBase != null) {
- chunk.persistentDataContainer.putAll(nbttagcompound1);
- NBTBase persistentBase = nbttagcompound1.get("ChunkBukkitValues");
- if (persistentBase instanceof NBTTagCompound) {
- chunk.persistentDataContainer.putAll((NBTTagCompound) persistentBase);
- }
- // CraftBukkit end
- });
@ -78,9 +78,9 @@ index f18cb4aedc4a6536bf45db591b6d2b64cefce676..5eb14b330d3f175e22650f292aa6c040
+ return (chunk) -> {
+ loadEntities(nbt, chunk);
+ // CraftBukkit start - load chunk persistent data from nbt
+ NBTBase persistentBase = nbt.get("BukkitValues"); // Paper - use NBTBase & #get
+ if (persistentBase instanceof NBTTagCompound) { // Paper - instanceof to check nullability & type; previous was if(true)
+ chunk.persistentDataContainer.putAll((NBTTagCompound) persistentBase); // Paper
+ NBTBase persistentBase = nbt.get("ChunkBukkitValues");
+ if (persistentBase instanceof NBTTagCompound) {
+ chunk.persistentDataContainer.putAll((NBTTagCompound) persistentBase);
+ }
+ // CraftBukkit end
+ };

View File

@ -40,10 +40,10 @@ index d903460c32213fa2d5362671efc9e96b142daf9a..3e6ccdd5b54dbe51d4ee9ec979cbc2d0
return !this.justCreated && this.M.getDouble(TagsFluid.LAVA) > 0.0D;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index fb6fa1d15dc7d189a38e2cc78d9c7d24cf0af752..e3026d54cb6b6e8fe9164a1bc7d5500c62ba7211 100644
index f36c85802dc2d6260058b2a77f225f32624775cb..eae7509b5b072cba86015aad1e878aa752fc7b33 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -1103,5 +1103,33 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@@ -1104,5 +1104,33 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
public org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason getEntitySpawnReason() {
return getHandle().spawnReason;
}

View File

@ -57,10 +57,10 @@ index 16664a446192c77903ff1f10989c7afab703eb49..05b3a7478195037927cd1a902b603862
this.player.playerConnection.sendPacket(new PacketPlayOutPosition(d0 - d3, d1 - d4, d2 - d5, f - f2, f1 - f3, set, this.teleportAwait));
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index b1fdc5737d332c6210d57793468da1eda8f8b9d2..6ceb2d50c59b63a337364605f8a5280d905f2662 100644
index eae7509b5b072cba86015aad1e878aa752fc7b33..e19db32edc5124a86e8123dcc13be9f5a439ee74 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -547,7 +547,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@@ -548,7 +548,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
}
// entity.setLocation() throws no event, and so cannot be cancelled

View File

@ -19,10 +19,10 @@ index ebdbbeb1b55b428dde3ab1c9691cb153c6c2fe76..28e2d3f0a5e2ab084175bf0bba88816f
// Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index c08fe368409137c33501aaca369e99a0924f0339..0f419d3e0621c71d43f85aa852bc3fc5405f1cf6 100644
index e19db32edc5124a86e8123dcc13be9f5a439ee74..f7d751348ca358a80bafc7f92c635eac316bc4cb 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -1131,5 +1131,9 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@@ -1132,5 +1132,9 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
public boolean isInLava() {
return getHandle().isInLava();
}

@ -1 +1 @@
Subproject commit 4ef13f94d6a4042e0dadd622666a50cee7468d26
Subproject commit b8dd5ec216c567d97f3b3d3e23c9b493b61ce962