geforkt von Mirrors/Paper
Relookup Entity Save ID if was null during precache
Should fix #1280 Citizens hijacks entity map, and im guessing under the right conditions the result might actually be null during entity creation Pre the cache patch, the id is looked up on save, so it was fine. Now, if its null and the save ID is requested, we will try to look it up again and cache it if found.
Dieser Commit ist enthalten in:
Ursprung
119ae29b37
Commit
3c8a4cb1bb
@ -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 358c99227..5b5f102e2 100644
|
||||
index b4a7db2b66..30d3e19de8 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntity.java
|
||||
@@ -0,0 +0,0 @@ public abstract class TileEntity implements KeyedObject {
|
||||
@ -39,7 +39,7 @@ index 358c99227..5b5f102e2 100644
|
||||
return null;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntitySign.java b/src/main/java/net/minecraft/server/TileEntitySign.java
|
||||
index 54b719d91..3f2c5b2d5 100644
|
||||
index 54b719d917..3f2c5b2d5c 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntitySign.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntitySign.java
|
||||
@@ -0,0 +0,0 @@ public class TileEntitySign extends TileEntity {
|
||||
@ -52,7 +52,7 @@ index 54b719d91..3f2c5b2d5 100644
|
||||
};
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
||||
index 46670c346..a9d3f12bc 100644
|
||||
index 46670c3466..a9d3f12bc6 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
||||
@@ -0,0 +0,0 @@ public class CraftBlock implements Block {
|
||||
@ -79,7 +79,7 @@ index 46670c346..a9d3f12bc 100644
|
||||
|
||||
switch (material) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
|
||||
index 266f87d7f..fe112812d 100644
|
||||
index 266f87d7f1..fe112812d1 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
|
||||
@@ -0,0 +0,0 @@ public class CraftBlockEntityState<T extends TileEntity> extends CraftBlockState
|
||||
@ -129,7 +129,7 @@ index 266f87d7f..fe112812d 100644
|
||||
|
||||
private T createSnapshot(T tileEntity) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java
|
||||
index 7a8d44529..97b4e6910 100644
|
||||
index 7a8d445299..97b4e6910d 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java
|
||||
@@ -0,0 +0,0 @@ public class CraftSign extends CraftBlockEntityState<TileEntitySign> implements
|
||||
|
@ -6,7 +6,7 @@ Subject: [PATCH] Add MinecraftKey Information to Objects
|
||||
Stores the reference to the objects respective MinecraftKey
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index ed39b122e..3a8902bf1 100644
|
||||
index ed39b122ec..06c72b95f3 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -0,0 +0,0 @@ import org.bukkit.event.entity.EntityPortalEvent;
|
||||
@ -23,16 +23,21 @@ index ed39b122e..3a8902bf1 100644
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
+ public final MinecraftKey entityKey = EntityTypes.getKey(this);
|
||||
+ public final String entityKeyString = entityKey != null ? entityKey.toString() : null;
|
||||
+ private String entityKeyString = null;
|
||||
+ private MinecraftKey entityKey = getMinecraftKey();
|
||||
+
|
||||
+ @Override
|
||||
+ public MinecraftKey getMinecraftKey() {
|
||||
+ if (entityKey == null) {
|
||||
+ entityKey = EntityTypes.getKey(this);
|
||||
+ entityKeyString = entityKey != null ? entityKey.toString() : null;
|
||||
+ }
|
||||
+ return entityKey;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public String getMinecraftKeyString() {
|
||||
+ getMinecraftKey(); // Try to load if it doesn't exists. see: https://github.com/PaperMC/Paper/issues/1280
|
||||
+ return entityKeyString;
|
||||
+ }
|
||||
@Nullable
|
||||
@ -40,14 +45,14 @@ index ed39b122e..3a8902bf1 100644
|
||||
- MinecraftKey minecraftkey = EntityTypes.a(this);
|
||||
-
|
||||
- return minecraftkey == null ? null : minecraftkey.toString();
|
||||
+ return entityKeyString;
|
||||
+ return getMinecraftKeyString();
|
||||
+ // Paper end
|
||||
}
|
||||
|
||||
protected abstract void a(NBTTagCompound nbttagcompound);
|
||||
diff --git a/src/main/java/net/minecraft/server/KeyedObject.java b/src/main/java/net/minecraft/server/KeyedObject.java
|
||||
new file mode 100644
|
||||
index 000000000..61c2b993c
|
||||
index 0000000000..61c2b993c9
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/minecraft/server/KeyedObject.java
|
||||
@@ -0,0 +0,0 @@
|
||||
@ -60,7 +65,7 @@ index 000000000..61c2b993c
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java
|
||||
index 5a5a588e7..672ba3134 100644
|
||||
index 5a5a588e7c..0176ca530c 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntity.java
|
||||
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger;
|
||||
@ -79,16 +84,21 @@ index 5a5a588e7..672ba3134 100644
|
||||
- @Nullable
|
||||
- public static MinecraftKey a(Class<? extends TileEntity> oclass) {
|
||||
+ // Paper start
|
||||
+ public final MinecraftKey tileEntityKey = getKey(this.getClass());
|
||||
+ public final String tileEntityKeyString = tileEntityKey != null ? tileEntityKey.toString() : null;
|
||||
+ private String tileEntityKeyString = null;
|
||||
+ private MinecraftKey tileEntityKey = getMinecraftKey();
|
||||
+
|
||||
+ @Override
|
||||
+ public MinecraftKey getMinecraftKey() {
|
||||
+ if (tileEntityKey == null) {
|
||||
+ tileEntityKey = getKey(this.getClass());
|
||||
+ tileEntityKeyString = tileEntityKey != null ? tileEntityKey.toString() : null;
|
||||
+ }
|
||||
+ return tileEntityKey;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public String getMinecraftKeyString() {
|
||||
+ getMinecraftKey(); // Try to load if it doesn't exists.
|
||||
+ return tileEntityKeyString;
|
||||
+ }
|
||||
+ @Nullable public static MinecraftKey getKey(Class<? extends TileEntity> oclass) { return a(oclass); } // Paper - OBFHELPER
|
||||
|
@ -9,7 +9,7 @@ This should hopefully avoid duplicate entities ever being created
|
||||
if the entity was to end up in 2 different chunk slices
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index 6de053781..be0b411e5 100644
|
||||
index eaee492010..1787607622 100644
|
||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||
@@ -0,0 +0,0 @@ public class Chunk {
|
||||
@ -46,7 +46,7 @@ index 6de053781..be0b411e5 100644
|
||||
+
|
||||
this.markDirty();
|
||||
entity.setCurrentChunk(this);
|
||||
entityCounts.increment(entity.entityKeyString);
|
||||
entityCounts.increment(entity.getMinecraftKeyString());
|
||||
@@ -0,0 +0,0 @@ public class Chunk {
|
||||
|
||||
// Paper start
|
||||
@ -59,9 +59,9 @@ index 6de053781..be0b411e5 100644
|
||||
+ }
|
||||
this.markDirty();
|
||||
entity.setCurrentChunk(null);
|
||||
entityCounts.decrement(entity.entityKeyString);
|
||||
entityCounts.decrement(entity.getMinecraftKeyString());
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 7188d0c99..b3120d7cc 100644
|
||||
index fdabb1e369..89f9bd347b 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 ICommandListener, KeyedObject { // Paper
|
||||
|
@ -14,7 +14,7 @@ And since minecart hoppers are used _very_ rarely near we can avoid alot of sear
|
||||
Combined, this adds up a lot.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index d6f6cfef2..08d6ef09a 100644
|
||||
index 42d27e0362..be386716be 100644
|
||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||
@@ -0,0 +0,0 @@ public class Chunk {
|
||||
@ -34,7 +34,7 @@ index d6f6cfef2..08d6ef09a 100644
|
||||
@@ -0,0 +0,0 @@ public class Chunk {
|
||||
// Paper start
|
||||
entity.setCurrentChunk(this);
|
||||
entityCounts.increment(entity.entityKeyString);
|
||||
entityCounts.increment(entity.getMinecraftKeyString());
|
||||
+ if (entity instanceof EntityItem) {
|
||||
+ itemCounts[k]++;
|
||||
+ } else if (entity instanceof IInventory) {
|
||||
@ -46,7 +46,7 @@ index d6f6cfef2..08d6ef09a 100644
|
||||
@@ -0,0 +0,0 @@ public class Chunk {
|
||||
// Paper start
|
||||
entity.setCurrentChunk(null);
|
||||
entityCounts.decrement(entity.entityKeyString);
|
||||
entityCounts.decrement(entity.getMinecraftKeyString());
|
||||
+ if (entity instanceof EntityItem) {
|
||||
+ itemCounts[i]--;
|
||||
+ } else if (entity instanceof IInventory) {
|
||||
|
@ -11,7 +11,7 @@ So avoid looking up scoreboards and short circuit to the "not on a team"
|
||||
logic which is most likely to be true.
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index b241c0380..a4c94845b 100644
|
||||
index b241c0380d..a4c94845b8 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
||||
@ -25,7 +25,7 @@ index b241c0380..a4c94845b 100644
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/CommandScoreboard.java b/src/main/java/net/minecraft/server/CommandScoreboard.java
|
||||
index ec9a87239..b08274d93 100644
|
||||
index ec9a87239a..b08274d933 100644
|
||||
--- a/src/main/java/net/minecraft/server/CommandScoreboard.java
|
||||
+++ b/src/main/java/net/minecraft/server/CommandScoreboard.java
|
||||
@@ -0,0 +0,0 @@ public class CommandScoreboard extends CommandAbstract {
|
||||
@ -37,7 +37,7 @@ index ec9a87239..b08274d93 100644
|
||||
|
||||
if (scoreboard.addPlayerToTeam(s2, s)) {
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 804104818..f547dbfd0 100644
|
||||
index 9d6e684d26..a03a809d61 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 ICommandListener, KeyedObject { // Paper
|
||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Don't allow entities to ride themselves - #572
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 6d1e61e23..92b2bcb86 100644
|
||||
index 26a76ec972..d156563b08 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 ICommandListener, KeyedObject { // Paper
|
||||
|
@ -7,7 +7,7 @@ Had some issue with this in past, and this is the vanilla logic.
|
||||
Potentially an old CB change that's no longer needed.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index daf97bce3..87b82f908 100644
|
||||
index ff854e1ab9..fd193bbece 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 ICommandListener, KeyedObject { // Paper
|
||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Drop falling block and tnt entities at the specified height
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index 0094d1a87..4da846719 100644
|
||||
index 0094d1a87d..4da846719d 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
||||
@ -24,7 +24,7 @@ index 0094d1a87..4da846719 100644
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 4540bf9f9..d358ab26a 100644
|
||||
index 459bdbd6ec..335d2ce4cb 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 ICommandListener, KeyedObject { // Paper
|
||||
@ -36,7 +36,7 @@ index 4540bf9f9..d358ab26a 100644
|
||||
public EntityItem a(ItemStack itemstack, float f) {
|
||||
if (itemstack.isEmpty()) {
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java
|
||||
index 579e51a0a..2ba5d51a5 100644
|
||||
index 579e51a0aa..2ba5d51a5f 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityFallingBlock.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java
|
||||
@@ -0,0 +0,0 @@ public class EntityFallingBlock extends Entity {
|
||||
@ -58,7 +58,7 @@ index 579e51a0a..2ba5d51a5 100644
|
||||
blockposition = new BlockPosition(this);
|
||||
boolean flag = this.block.getBlock() == Blocks.dS;
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
|
||||
index 44b2d4735..0d70dd1d2 100644
|
||||
index 44b2d47351..0d70dd1d22 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
|
||||
@@ -0,0 +0,0 @@ public class EntityTNTPrimed extends Entity {
|
||||
|
@ -33,7 +33,7 @@ But for those who are ok with leaving this inconsistent behavior, you may use WA
|
||||
It is recommended you regenerate the entities, as these were legit entities, and deserve your love.
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index 14c8edeff..e3f6557e1 100644
|
||||
index 14c8edeffc..e3f6557e1f 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
||||
@ -78,7 +78,7 @@ index 14c8edeff..e3f6557e1 100644
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index 04adf4e3c..b31c301ec 100644
|
||||
index f1815d3766..7a62fae332 100644
|
||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||
@@ -0,0 +0,0 @@
|
||||
@ -145,7 +145,7 @@ index 04adf4e3c..b31c301ec 100644
|
||||
this.world.a((Collection) entityslice);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 0d3af8cb7..7188d0c99 100644
|
||||
index 93ab050fa6..fdabb1e369 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 ICommandListener, KeyedObject { // Paper
|
||||
@ -157,7 +157,7 @@ index 0d3af8cb7..7188d0c99 100644
|
||||
this.uniqueID = uuid;
|
||||
this.ar = this.uniqueID.toString();
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index 994d4bbb8..1244baf45 100644
|
||||
index 994d4bbb84..1244baf45a 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler {
|
||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Entity Origin API
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index d358ab26a..011cf59c0 100644
|
||||
index 335d2ce4cb..cea987f33e 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 ICommandListener, KeyedObject { // Paper
|
||||
@ -51,7 +51,7 @@ index d358ab26a..011cf59c0 100644
|
||||
NBTTagList nbttaglist = new NBTTagList();
|
||||
double[] adouble1 = adouble;
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java
|
||||
index 2ba5d51a5..abdc2dea9 100644
|
||||
index 2ba5d51a5f..abdc2dea9b 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityFallingBlock.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java
|
||||
@@ -0,0 +0,0 @@ public class EntityFallingBlock extends Entity {
|
||||
@ -70,7 +70,7 @@ index 2ba5d51a5..abdc2dea9 100644
|
||||
|
||||
public void a(boolean flag) {
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
|
||||
index 0d70dd1d2..bb0904f86 100644
|
||||
index 0d70dd1d22..bb0904f865 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
|
||||
@@ -0,0 +0,0 @@ public class EntityTNTPrimed extends Entity {
|
||||
@ -89,7 +89,7 @@ index 0d70dd1d2..bb0904f86 100644
|
||||
|
||||
@Nullable
|
||||
diff --git a/src/main/java/net/minecraft/server/NBTTagList.java b/src/main/java/net/minecraft/server/NBTTagList.java
|
||||
index bc6383669..ca9eb2f3b 100644
|
||||
index bc6383669e..ca9eb2f3b2 100644
|
||||
--- a/src/main/java/net/minecraft/server/NBTTagList.java
|
||||
+++ b/src/main/java/net/minecraft/server/NBTTagList.java
|
||||
@@ -0,0 +0,0 @@ public class NBTTagList extends NBTBase {
|
||||
@ -101,7 +101,7 @@ index bc6383669..ca9eb2f3b 100644
|
||||
if (i >= 0 && i < this.list.size()) {
|
||||
NBTBase nbtbase = (NBTBase) this.list.get(i);
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 26d4bd690..31b765dea 100644
|
||||
index 26d4bd690b..31b765deaf 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 IBlockAccess {
|
||||
@ -118,7 +118,7 @@ index 26d4bd690..31b765dea 100644
|
||||
flag = true;
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
index 833e3111d..6c23e88a5 100644
|
||||
index 833e3111de..6c23e88a54 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -0,0 +0,0 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
|
@ -14,7 +14,7 @@ Specially with servers using smaller mob spawn ranges than view distance, as wel
|
||||
This patch returns mob counting to use all loaded chunks, and 17x17 division.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index da7b59434..1157bc7eb 100644
|
||||
index e9a44098d9..6c86d3b6bc 100644
|
||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||
@@ -0,0 +0,0 @@ public class Chunk {
|
||||
@ -25,10 +25,10 @@ index da7b59434..1157bc7eb 100644
|
||||
// Paper start
|
||||
+ if (!this.entitySlices[i].remove(entity)) { return; }
|
||||
entity.setCurrentChunk(null);
|
||||
entityCounts.decrement(entity.entityKeyString);
|
||||
entityCounts.decrement(entity.getMinecraftKeyString());
|
||||
if (entity instanceof EntityItem) {
|
||||
diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
|
||||
index 45a83ae99..ed22607d9 100644
|
||||
index 45a83ae995..ed22607d91 100644
|
||||
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java
|
||||
+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java
|
||||
@@ -0,0 +0,0 @@ public final class SpawnerCreature {
|
||||
|
@ -6,7 +6,7 @@ Subject: [PATCH] Mark chunk dirty anytime entities change to guarantee it
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index b31c301ec..6de053781 100644
|
||||
index 7a62fae332..eaee492010 100644
|
||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||
@@ -0,0 +0,0 @@ public class Chunk {
|
||||
@ -15,7 +15,7 @@ index b31c301ec..6de053781 100644
|
||||
// Paper start
|
||||
+ this.markDirty();
|
||||
entity.setCurrentChunk(this);
|
||||
entityCounts.increment(entity.entityKeyString);
|
||||
entityCounts.increment(entity.getMinecraftKeyString());
|
||||
if (entity instanceof EntityItem) {
|
||||
@@ -0,0 +0,0 @@ public class Chunk {
|
||||
|
||||
@ -23,6 +23,6 @@ index b31c301ec..6de053781 100644
|
||||
if (!this.entitySlices[i].remove(entity)) { return; }
|
||||
+ this.markDirty();
|
||||
entity.setCurrentChunk(null);
|
||||
entityCounts.decrement(entity.entityKeyString);
|
||||
entityCounts.decrement(entity.getMinecraftKeyString());
|
||||
if (entity instanceof EntityItem) {
|
||||
--
|
@ -11,7 +11,7 @@ Subject: [PATCH] Optimize Hoppers
|
||||
* Skip subsequent InventoryMoveItemEvents if a plugin does not use the item after first event fire for an iteration
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index 9fd76dcc9..363e03b65 100644
|
||||
index 9fd76dcc90..363e03b65d 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
||||
@ -28,7 +28,7 @@ index 9fd76dcc9..363e03b65 100644
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index fcf6bac08..3092913f5 100644
|
||||
index fcf6bac08f..3092913f5b 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs
|
||||
@ -40,7 +40,7 @@ index fcf6bac08..3092913f5 100644
|
||||
this.methodProfiler.a(() -> {
|
||||
return worldserver.getWorldData().getName();
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java
|
||||
index 5b5f102e2..3f6b34489 100644
|
||||
index 30d3e19de8..54bfbfc6bc 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntity.java
|
||||
@@ -0,0 +0,0 @@ public abstract class TileEntity implements KeyedObject {
|
||||
@ -60,7 +60,7 @@ index 5b5f102e2..3f6b34489 100644
|
||||
|
||||
this.g = iblockdata.getBlock().toLegacyData(iblockdata);
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java
|
||||
index e9315f2d5..5198a590a 100644
|
||||
index e9315f2d5c..5198a590a7 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntityHopper.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntityHopper.java
|
||||
@@ -0,0 +0,0 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
|
||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Option to use vanilla per-world scoreboard coloring on names
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index abc1aabdd..6ea608ba9 100644
|
||||
index abc1aabdd8..6ea608ba9a 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
||||
@ -19,7 +19,7 @@ index abc1aabdd..6ea608ba9 100644
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 87b82f908..fa9319aff 100644
|
||||
index fd193bbece..89e42c0a46 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 ICommandListener, KeyedObject { // Paper
|
||||
@ -31,7 +31,7 @@ index 87b82f908..fa9319aff 100644
|
||||
public ScoreboardTeamBase aY() {
|
||||
if (!this.world.paperConfig.nonPlayerEntitiesOnScoreboards && !(this instanceof EntityHuman)) { return null; } // Paper
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index ba1cc267e..2b8162917 100644
|
||||
index ba1cc267e6..2b81629170 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Optional TNT doesn't move in water
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index 067cb233e..06acdaaf0 100644
|
||||
index 067cb233e4..06acdaaf04 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -0,0 +0,0 @@ package com.destroystokyo.paper;
|
||||
@ -32,7 +32,7 @@ index 067cb233e..06acdaaf0 100644
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 9b01c23e0..0a62ebf4a 100644
|
||||
index 0456cda937..2fbe17ce9d 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 ICommandListener, KeyedObject { // Paper
|
||||
@ -60,7 +60,7 @@ index 9b01c23e0..0a62ebf4a 100644
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
|
||||
index bb0904f86..50811852a 100644
|
||||
index bb0904f865..50811852a3 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
|
||||
@@ -0,0 +0,0 @@ public class EntityTNTPrimed extends Entity {
|
||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Prevent tile entity and entity crashes
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java
|
||||
index 15f18ba1d..33e245e4c 100644
|
||||
index 081e56f481..f191225c62 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntity.java
|
||||
@@ -0,0 +0,0 @@ public abstract class TileEntity implements KeyedObject {
|
||||
@ -23,7 +23,7 @@ index 15f18ba1d..33e245e4c 100644
|
||||
public String a() throws Exception {
|
||||
int i = Block.getId(TileEntity.this.world.getType(TileEntity.this.position).getBlock());
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 31b765dea..fd5f8102a 100644
|
||||
index 31b765deaf..fd5f8102af 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 IBlockAccess {
|
||||
|
@ -22,7 +22,7 @@ requirement, but plugins (such as my own) use this method to
|
||||
trigger a "reload" of the entity on the client.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 2dbb88f2d..80ecdb282 100644
|
||||
index ea2502409d..71da8e1e7d 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 ICommandListener, KeyedObject { // Paper
|
||||
@ -35,7 +35,7 @@ index 2dbb88f2d..80ecdb282 100644
|
||||
this.world.methodProfiler.a("reposition");
|
||||
/* CraftBukkit start - Handled in calculateTarget
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index 49019d54d..bba2e164f 100644
|
||||
index 49019d54d5..bba2e164f2 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler {
|
||||
|
@ -6,7 +6,7 @@ Subject: [PATCH] Store counts for each Entity/Block Entity Type
|
||||
Opens door for future patches to optimize performance
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index ea167a17b..77fdb3c4a 100644
|
||||
index ea167a17bb..efcece7857 100644
|
||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||
@@ -0,0 +0,0 @@ public class Chunk {
|
||||
@ -21,11 +21,11 @@ index ea167a17b..77fdb3c4a 100644
|
||||
TileEntity replaced = super.put(key, value);
|
||||
if (replaced != null) {
|
||||
replaced.setCurrentChunk(null);
|
||||
+ tileEntityCounts.decrement(replaced.tileEntityKeyString);
|
||||
+ tileEntityCounts.decrement(replaced.getMinecraftKeyString());
|
||||
}
|
||||
if (value != null) {
|
||||
value.setCurrentChunk(Chunk.this);
|
||||
+ tileEntityCounts.increment(value.tileEntityKeyString);
|
||||
+ tileEntityCounts.increment(value.getMinecraftKeyString());
|
||||
}
|
||||
return replaced;
|
||||
}
|
||||
@ -33,7 +33,7 @@ index ea167a17b..77fdb3c4a 100644
|
||||
TileEntity removed = super.remove(key);
|
||||
if (removed != null) {
|
||||
removed.setCurrentChunk(null);
|
||||
+ tileEntityCounts.decrement(removed.tileEntityKeyString);
|
||||
+ tileEntityCounts.decrement(removed.getMinecraftKeyString());
|
||||
}
|
||||
return removed;
|
||||
}
|
||||
@ -41,7 +41,7 @@ index ea167a17b..77fdb3c4a 100644
|
||||
this.entitySlices[k].add(entity);
|
||||
// Paper start
|
||||
entity.setCurrentChunk(this);
|
||||
+ entityCounts.increment(entity.entityKeyString);
|
||||
+ entityCounts.increment(entity.getMinecraftKeyString());
|
||||
// Paper end
|
||||
// Spigot start - increment creature type count
|
||||
// Keep this synced up with World.a(Class)
|
||||
@ -49,7 +49,7 @@ index ea167a17b..77fdb3c4a 100644
|
||||
this.entitySlices[i].remove(entity);
|
||||
// Paper start
|
||||
entity.setCurrentChunk(null);
|
||||
+ entityCounts.decrement(entity.entityKeyString);
|
||||
+ entityCounts.decrement(entity.getMinecraftKeyString());
|
||||
// Paper end
|
||||
// Spigot start - decrement creature type count
|
||||
// Keep this synced up with World.a(Class)
|
||||
|
@ -8,7 +8,7 @@ This enables us a fast reference to the entities current chunk instead
|
||||
of having to look it up by hashmap lookups.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index 4bbebb25a..ea167a17b 100644
|
||||
index 4bbebb25af..ea167a17bb 100644
|
||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||
@@ -0,0 +0,0 @@ public class Chunk {
|
||||
@ -81,7 +81,7 @@ index 4bbebb25a..ea167a17b 100644
|
||||
// Keep this synced up with World.a(Class)
|
||||
if (entity instanceof EntityInsentient) {
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 3a8902bf1..4af566b36 100644
|
||||
index 06c72b95f3..c107bd767f 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 ICommandListener, KeyedObject { // Paper
|
||||
@ -120,11 +120,11 @@ index 3a8902bf1..4af566b36 100644
|
||||
+ public Chunk getChunkAtLocation() {
|
||||
+ return getCurrentChunkAt((int)Math.floor(locX) >> 4, (int)Math.floor(locZ) >> 4);
|
||||
+ }
|
||||
public final MinecraftKey entityKey = EntityTypes.getKey(this);
|
||||
public final String entityKeyString = entityKey != null ? entityKey.toString() : null;
|
||||
private String entityKeyString = null;
|
||||
private MinecraftKey entityKey = getMinecraftKey();
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java
|
||||
index 672ba3134..d7132c3c0 100644
|
||||
index 0176ca530c..29069b753e 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntity.java
|
||||
@@ -0,0 +0,0 @@ public abstract class TileEntity implements KeyedObject {
|
||||
@ -139,11 +139,11 @@ index 672ba3134..d7132c3c0 100644
|
||||
+ public void setCurrentChunk(Chunk chunk) {
|
||||
+ this.currentChunk = chunk != null ? new java.lang.ref.WeakReference<>(chunk) : null;
|
||||
+ }
|
||||
public final MinecraftKey tileEntityKey = getKey(this.getClass());
|
||||
public final String tileEntityKeyString = tileEntityKey != null ? tileEntityKey.toString() : null;
|
||||
private String tileEntityKeyString = null;
|
||||
private MinecraftKey tileEntityKey = getMinecraftKey();
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
index c5a194ffe..833e3111d 100644
|
||||
index c5a194ffea..833e3111de 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -0,0 +0,0 @@ import java.util.UUID;
|
||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Vehicle Event Cancellation Changes
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index fa9319aff..a3e9ee052 100644
|
||||
index 89e42c0a46..86b783e73b 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 ICommandListener, KeyedObject { // Paper
|
||||
|
@ -6,7 +6,7 @@ Subject: [PATCH] add more information to Entity.toString()
|
||||
UUID, ticks lived, valid, dead
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 80ecdb282..99dac412f 100644
|
||||
index 71da8e1e7d..28713f045d 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 ICommandListener, KeyedObject { // Paper
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren