Dieser Commit ist enthalten in:
Spottedleaf 2019-05-06 12:30:27 -07:00
Ursprung 27c7749f42
Commit e9439e7655
38 geänderte Dateien mit 293 neuen und 409 gelöschten Zeilen

Datei anzeigen

@ -1,4 +1,4 @@
From 9e4cbf4b8c647145b7f6718dd8564c35c1df4ddd Mon Sep 17 00:00:00 2001
From ba575a4b6fb2e265f1ddc6aa212a88dc124d0a7e Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Mon, 29 Feb 2016 21:02:09 -0600
Subject: [PATCH] Paper config files
@ -6,7 +6,7 @@ Subject: [PATCH] Paper config files
diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java
new file mode 100644
index 0000000000..2e79b0b5ff
index 0000000000..841edd010f
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java
@@ -0,0 +1,241 @@
@ -185,7 +185,7 @@ index 0000000000..2e79b0b5ff
+ }
+ WorldServer world = ((CraftWorld) Bukkit.getWorld(worldName)).getHandle();
+
+ List<Entity> entities = world.entityList;
+ List<Entity> entities = world.globalEntityList;
+ entities.forEach(e -> {
+ MinecraftKey key = new MinecraftKey(""); // TODO: update in next patch
+

Datei anzeigen

@ -1,4 +1,4 @@
From 3c1c8843086f86670aaa95e3b59bc09b5c3cd7d9 Mon Sep 17 00:00:00 2001
From 00efbd649e6a52763bb40eecd699134b2bd8f8b9 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 28 Mar 2016 20:55:47 -0400
Subject: [PATCH] MC Utils
@ -798,6 +798,22 @@ index b3799ab564..5fae5a1233 100644
}
public static long getTimeMillis() {
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 83fdea893c..cbe87a3389 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -371,8 +371,9 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
public void a(BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1) {}
- @Override
- public boolean a(BlockPosition blockposition, boolean flag) {
+ public boolean setAir(BlockPosition blockposition) { return this.a(blockposition, false); } // Paper - OBFHELPER
+ public boolean setAir(BlockPosition blockposition, boolean moved) { return this.a(blockposition, moved); } // Paper - OBFHELPER
+ @Override public boolean a(BlockPosition blockposition, boolean flag) { // Paper - OBFHELPER
Fluid fluid = this.getFluid(blockposition);
return this.setTypeAndData(blockposition, fluid.getBlockData(), 3 | (flag ? 64 : 0));
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
index 42f7bb0f7d..5d71addb0c 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java

Datei anzeigen

@ -1,4 +1,4 @@
From 97044255b2aeb519750c02b7c656dadfc681b17b Mon Sep 17 00:00:00 2001
From 5ff4ed009bdf9fa16a49ad57060a1aba090ed1ae Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 4 Jul 2018 01:40:13 -0400
Subject: [PATCH] Add MinecraftKey Information to Objects
@ -6,12 +6,12 @@ Subject: [PATCH] Add MinecraftKey Information to Objects
Stores the reference to the objects respective MinecraftKey
diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java
index 2e79b0b5ff..f38179e983 100644
index 841edd010f..3354fdd60d 100644
--- a/src/main/java/com/destroystokyo/paper/PaperCommand.java
+++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java
@@ -175,7 +175,7 @@ public class PaperCommand extends Command {
List<Entity> entities = world.entityList;
List<Entity> entities = world.globalEntityList;
entities.forEach(e -> {
- MinecraftKey key = new MinecraftKey(""); // TODO: update in next patch
+ MinecraftKey key = e.getMinecraftKey();

Datei anzeigen

@ -1,4 +1,4 @@
From 4577cfa21d449248ee5fa72bd36cc048232636f9 Mon Sep 17 00:00:00 2001
From fffc5a98890008800dbabb96745e8aa27aee49c9 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 3 Mar 2016 04:00:11 -0600
Subject: [PATCH] Timings v2
@ -6,7 +6,7 @@ Subject: [PATCH] Timings v2
diff --git a/src/main/java/co/aikar/timings/MinecraftTimings.java b/src/main/java/co/aikar/timings/MinecraftTimings.java
new file mode 100644
index 000000000..3f9fb6f90
index 0000000000..3f9fb6f906
--- /dev/null
+++ b/src/main/java/co/aikar/timings/MinecraftTimings.java
@@ -0,0 +1,133 @@
@ -145,7 +145,7 @@ index 000000000..3f9fb6f90
+}
diff --git a/src/main/java/co/aikar/timings/WorldTimingsHandler.java b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
new file mode 100644
index 000000000..d5d3b2a20
index 0000000000..d5d3b2a20c
--- /dev/null
+++ b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
@@ -0,0 +1,105 @@
@ -255,7 +255,7 @@ index 000000000..d5d3b2a20
+ }
+}
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index 5518ec1e5..0c65afccf 100644
index 5518ec1e54..0c65afccfd 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -14,11 +14,14 @@ import java.util.concurrent.TimeUnit;
@ -302,7 +302,7 @@ index 5518ec1e5..0c65afccf 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java
index 8b91e27c6..fd23d4534 100644
index 8b91e27c66..fd23d45346 100644
--- a/src/main/java/net/minecraft/server/Block.java
+++ b/src/main/java/net/minecraft/server/Block.java
@@ -24,6 +24,15 @@ public class Block implements IMaterial {
@ -322,7 +322,7 @@ index 8b91e27c6..fd23d4534 100644
private final float frictionFactor;
protected final BlockStateList<Block, IBlockData> blockStateList;
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 9cce929c3..1a2cc0258 100644
index 9cce929c3e..1a2cc0258a 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -89,6 +89,29 @@ public class Chunk implements IChunkAccess {
@ -372,7 +372,7 @@ index 9cce929c3..1a2cc0258 100644
}
}
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index 845ad7427..4f0fbe4a0 100644
index 845ad7427b..4f0fbe4a0d 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -186,7 +186,9 @@ public class ChunkProviderServer extends IChunkProvider {
@ -409,7 +409,7 @@ index 845ad7427..4f0fbe4a0 100644
@Override
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
index d084d24a0..0fed039f3 100644
index d084d24a01..0fed039f34 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@@ -1,5 +1,6 @@
@ -456,7 +456,7 @@ index d084d24a0..0fed039f3 100644
}
diff --git a/src/main/java/net/minecraft/server/CustomFunction.java b/src/main/java/net/minecraft/server/CustomFunction.java
index 46e7737ca..a3ef94306 100644
index 46e7737ca3..a3ef943066 100644
--- a/src/main/java/net/minecraft/server/CustomFunction.java
+++ b/src/main/java/net/minecraft/server/CustomFunction.java
@@ -13,12 +13,22 @@ public class CustomFunction {
@ -483,7 +483,7 @@ index 46e7737ca..a3ef94306 100644
return this.b;
}
diff --git a/src/main/java/net/minecraft/server/CustomFunctionData.java b/src/main/java/net/minecraft/server/CustomFunctionData.java
index 42e01136d..b7c1d7671 100644
index 42e01136d9..b7c1d7671e 100644
--- a/src/main/java/net/minecraft/server/CustomFunctionData.java
+++ b/src/main/java/net/minecraft/server/CustomFunctionData.java
@@ -100,7 +100,7 @@ public class CustomFunctionData implements IResourcePackListener {
@ -496,7 +496,7 @@ index 42e01136d..b7c1d7671 100644
int j = 0;
CustomFunction.c[] acustomfunction_c = customfunction.b();
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
index b60956218..19e2df309 100644
index b60956218d..19e2df3098 100644
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
@@ -31,7 +31,7 @@ import org.apache.logging.log4j.Level;
@ -549,7 +549,7 @@ index b60956218..19e2df309 100644
return waitable.get();
} catch (java.util.concurrent.ExecutionException e) {
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 14c3f0417..6127f9ba9 100644
index 14c3f04170..6127f9ba96 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -29,7 +29,8 @@ import org.bukkit.command.CommandSender;
@ -588,7 +588,7 @@ index 14c3f0417..6127f9ba9 100644
protected Vec3D a(Vec3D vec3d, EnumMoveType enummovetype) {
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index f86e6a4c5..85567a707 100644
index f86e6a4c51..85567a7072 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -35,7 +35,7 @@ import org.bukkit.event.entity.EntityTeleportEvent;
@ -664,7 +664,7 @@ index f86e6a4c5..85567a707 100644
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 4de927416..4c1c91413 100644
index 4de927416b..4c1c914132 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1,5 +1,7 @@
@ -792,7 +792,7 @@ index 4de927416..4c1c91413 100644
this.methodProfiler.exit();
}
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 755c0406e..ee65b01f4 100644
index 755c0406e1..ee65b01f43 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -1,6 +1,8 @@
@ -883,7 +883,7 @@ index 755c0406e..ee65b01f4 100644
playerchunkmap_entitytracker = (PlayerChunkMap.EntityTracker) objectiterator.next();
playerchunkmap_entitytracker.track(list);
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 78a090ac7..e07f4a968 100644
index 78a090ac75..e07f4a9680 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -58,6 +58,7 @@ import org.bukkit.inventory.CraftingInventory;
@ -938,7 +938,7 @@ index 78a090ac7..e07f4a968 100644
// this.minecraftServer.getCommandDispatcher().a(this.player.getCommandListener(), s);
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/PlayerConnectionUtils.java b/src/main/java/net/minecraft/server/PlayerConnectionUtils.java
index cb6d50ea7..9ba03f8ed 100644
index cb6d50ea70..9ba03f8ed0 100644
--- a/src/main/java/net/minecraft/server/PlayerConnectionUtils.java
+++ b/src/main/java/net/minecraft/server/PlayerConnectionUtils.java
@@ -1,5 +1,8 @@
@ -964,7 +964,7 @@ index cb6d50ea7..9ba03f8ed 100644
throw CancelledPacketHandleException.INSTANCE;
}
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 56e36c866..7a837ec0f 100644
index 56e36c8668..7a837ec0fc 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -1,5 +1,6 @@
@ -988,7 +988,7 @@ index 56e36c866..7a837ec0f 100644
public WhiteList getWhitelist() {
diff --git a/src/main/java/net/minecraft/server/TickListServer.java b/src/main/java/net/minecraft/server/TickListServer.java
index 537e61079..b48e5b51a 100644
index 537e610797..b48e5b51a0 100644
--- a/src/main/java/net/minecraft/server/TickListServer.java
+++ b/src/main/java/net/minecraft/server/TickListServer.java
@@ -25,13 +25,19 @@ public class TickListServer<T> implements TickList<T> {
@ -1041,7 +1041,7 @@ index 537e61079..b48e5b51a 100644
}
diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java
index 4c811325c..da30d2cf8 100644
index 4c811325c3..da30d2cf86 100644
--- a/src/main/java/net/minecraft/server/TileEntity.java
+++ b/src/main/java/net/minecraft/server/TileEntity.java
@@ -8,11 +8,12 @@ import org.bukkit.craftbukkit.persistence.CraftPersistentDataContainer;
@ -1060,7 +1060,7 @@ index 4c811325c..da30d2cf8 100644
private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry();
public final CraftPersistentDataContainer persistentDataContainer = new CraftPersistentDataContainer(DATA_TYPE_REGISTRY);
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 83fdea893..738d9da8c 100644
index cbe87a3389..db50066096 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1,5 +1,7 @@
@ -1097,7 +1097,7 @@ index 83fdea893..738d9da8c 100644
this.entityLimiter = new org.spigotmc.TickLimiter(spigotConfig.entityMaxTickTime);
this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime);
}
@@ -733,14 +734,14 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -734,14 +735,14 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
}
timings.tileEntityPending.stopTiming(); // Spigot
@ -1114,7 +1114,7 @@ index 83fdea893..738d9da8c 100644
entity.tickTimer.startTiming();
// Spigot end
consumer.accept(entity);
@@ -754,7 +755,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -755,7 +756,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
// Spigot start
finally {
entity.tickTimer.stopTiming();
@ -1124,7 +1124,7 @@ index 83fdea893..738d9da8c 100644
// Spigot end
}
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index d08c5fc93..a8527784a 100644
index d08c5fc93b..a8527784ae 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1,5 +1,7 @@
@ -1216,7 +1216,7 @@ index d08c5fc93..a8527784a 100644
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 5dc2bb124..8e877055c 100644
index 5dc2bb1246..8e877055c3 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1926,12 +1926,31 @@ public final class CraftServer implements Server {
@ -1253,7 +1253,7 @@ index 5dc2bb124..8e877055c 100644
org.spigotmc.RestartCommand.restart();
diff --git a/src/main/java/org/bukkit/craftbukkit/SpigotTimings.java b/src/main/java/org/bukkit/craftbukkit/SpigotTimings.java
deleted file mode 100644
index 38f211526..000000000
index 38f211526b..0000000000
--- a/src/main/java/org/bukkit/craftbukkit/SpigotTimings.java
+++ /dev/null
@@ -1,166 +0,0 @@
@ -1424,7 +1424,7 @@ index 38f211526..000000000
- }
-}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 6806ada49..e45fd0028 100644
index 6806ada495..e45fd0028b 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1728,6 +1728,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -1443,7 +1443,7 @@ index 6806ada49..e45fd0028 100644
public Player.Spigot spigot()
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
index b90979c7b..8823f94f7 100644
index b90979c7ba..8823f94f7b 100644
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
@@ -1,5 +1,6 @@
@ -1509,7 +1509,7 @@ index b90979c7b..8823f94f7 100644
private boolean isReady(final int currentTick) {
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java
index 3f55381c1..0d9a46680 100644
index 3f55381c15..0d9a466809 100644
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java
@@ -1,9 +1,11 @@
@ -1594,7 +1594,7 @@ index 3f55381c1..0d9a46680 100644
- // Spigot end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftIconCache.java b/src/main/java/org/bukkit/craftbukkit/util/CraftIconCache.java
index e52ef47b7..3d90b3426 100644
index e52ef47b78..3d90b34268 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftIconCache.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftIconCache.java
@@ -5,6 +5,7 @@ import org.bukkit.util.CachedServerIcon;
@ -1606,7 +1606,7 @@ index e52ef47b7..3d90b3426 100644
this.value = value;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 06728e53d..783676b74 100644
index 06728e53d5..783676b747 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -271,6 +271,13 @@ public final class CraftMagicNumbers implements UnsafeValues {
@ -1624,7 +1624,7 @@ index 06728e53d..783676b74 100644
* This helper class represents the different NBT Tags.
* <p>
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
index 76b060a12..bf3595086 100644
index 76b060a126..bf35950867 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java
@@ -30,7 +30,7 @@ import net.minecraft.server.EntityWither;

Datei anzeigen

@ -1,4 +1,4 @@
From d3030029a797dd7be902e3c097c3821d170c7560 Mon Sep 17 00:00:00 2001
From 61c65a8ab53663274d629a25df7e9adf64a61e4b Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 1 Mar 2016 23:52:34 -0600
Subject: [PATCH] Prevent tile entity and entity crashes
@ -23,10 +23,10 @@ index da30d2cf86..acd9edd670 100644
}
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 0d8e622294..051d7531d1 100644
index 119e011e2c..0afc34ac0e 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -674,11 +674,13 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -675,11 +675,13 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
((ITickable) tileentity).tick();
gameprofilerfiller.exit();
} catch (Throwable throwable) {
@ -45,7 +45,7 @@ index 0d8e622294..051d7531d1 100644
}
// Spigot start
finally {
@@ -747,11 +749,12 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -748,11 +750,12 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
// Spigot end
consumer.accept(entity);
} catch (Throwable throwable) {

Datei anzeigen

@ -1,14 +1,14 @@
From ca2b0215ad7c6097f7b59f8884a6c7ae71f25438 Mon Sep 17 00:00:00 2001
From 97ea789a78f69ed7201f63a91ab59587719f3dc5 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Wed, 2 Mar 2016 23:45:17 -0600
Subject: [PATCH] Disable spigot tick limiters
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index ee953c880e..48360c2b47 100644
index 62098b2fc7..47defb2f0a 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -650,9 +650,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -651,9 +651,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
// Spigot start
// Iterator iterator = this.tileEntityListTick.iterator();
int tilesThisCycle = 0;

Datei anzeigen

@ -1,4 +1,4 @@
From b7e3ec23edd18418b43f7932d0a9ea4310e0ee8d Mon Sep 17 00:00:00 2001
From ab1921692e96b83434f730b535edeac94438578a Mon Sep 17 00:00:00 2001
From: Joseph Hirschfeld <joe@ibj.io>
Date: Thu, 3 Mar 2016 03:15:41 -0600
Subject: [PATCH] Add exception reporting event
@ -216,7 +216,7 @@ index d004494aea..d3ed749e1c 100644
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 25e5216e25..01f5105884 100644
index a0817da433..24ea0dbe03 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -2,6 +2,9 @@ package net.minecraft.server;
@ -229,7 +229,7 @@ index 25e5216e25..01f5105884 100644
import com.google.common.collect.Lists;
import java.io.IOException;
import java.util.Collection;
@@ -675,8 +678,11 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -676,8 +679,11 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
gameprofilerfiller.exit();
} catch (Throwable throwable) {
// Paper start - Prevent tile entity and entity crashes
@ -242,7 +242,7 @@ index 25e5216e25..01f5105884 100644
tilesThisCycle--;
this.tileEntityListTick.remove(tileTickPosition--);
continue;
@@ -750,8 +756,10 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -751,8 +757,10 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
consumer.accept(entity);
} catch (Throwable throwable) {
// Paper start - Prevent tile entity and entity crashes

Datei anzeigen

@ -1,4 +1,4 @@
From 3d9dc4c654ac0bd1d7a1c8a7e5c81e3c61b2b403 Mon Sep 17 00:00:00 2001
From a2a073f07ef2a292cdbe25ea0d687e133581b488 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 28 Mar 2016 19:55:45 -0400
Subject: [PATCH] Only process BlockPhysicsEvent if a plugin has a listener
@ -44,7 +44,7 @@ index 1a9a981ade..f35289e4ff 100644
if (true || worldserver.worldProvider.getDimensionManager() == DimensionManager.OVERWORLD || this.getAllowNether()) { // CraftBukkit
this.methodProfiler.a(() -> {
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 3d47fc899e..d8723c82d8 100644
index 31c38e1051..c31585f92f 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -436,7 +436,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@ -56,7 +56,7 @@ index 3d47fc899e..d8723c82d8 100644
BlockPhysicsEvent event = new BlockPhysicsEvent(world.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), CraftBlockData.fromData(iblockdata));
this.getServer().getPluginManager().callEvent(event);
@@ -547,7 +547,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -548,7 +548,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
try {
// CraftBukkit start
CraftWorld world = ((WorldServer) this).getWorld();
@ -66,7 +66,7 @@ index 3d47fc899e..d8723c82d8 100644
this.getServer().getPluginManager().callEvent(event);
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 6857e8a052..5fe2041b9d 100644
index 9d31d57cdf..93c229fcd1 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -76,6 +76,7 @@ public class WorldServer extends World {

Datei anzeigen

@ -1,4 +1,4 @@
From 0f751be9903f731ee1db45468076fd0a656c7e70 Mon Sep 17 00:00:00 2001
From 87bce7598f50c3155e874eea128e934660a451bd Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 31 Mar 2016 19:17:58 -0400
Subject: [PATCH] Do not load chunks for light checks
@ -7,10 +7,10 @@ Should only happen for blocks on the edge that uses neighbors light level
(certain blocks). In that case, there will be 3-4 other neighbors to get a light level from.
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index d8723c82d8..8bd86a5403 100644
index c31585f92f..801923c758 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -587,6 +587,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -588,6 +588,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
if (blockposition.getY() >= 256) {
blockposition = new BlockPosition(blockposition.getX(), 255, blockposition.getZ());
}

Datei anzeigen

@ -1,14 +1,14 @@
From 6aa1cd8efd3368b9ea4aae8ad13d02caa51c682b Mon Sep 17 00:00:00 2001
From 622849f3160bcae3ad5763d2ba408cf679364397 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 3 Apr 2016 17:48:50 -0400
Subject: [PATCH] Fix Cancelling BlockPlaceEvent triggering physics
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 8bd86a5403..284c29e307 100644
index 801923c758..d13cf1014d 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -505,6 +505,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -506,6 +506,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
public void m(BlockPosition blockposition) {}
public void applyPhysics(BlockPosition blockposition, Block block) {

Datei anzeigen

@ -1,4 +1,4 @@
From fcfdd9e7596364da78bf1d8a943eb2d5a39f2586 Mon Sep 17 00:00:00 2001
From fb635d79739c98a409a62defd82b5b282b83f48c Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 13 Apr 2016 00:25:28 -0400
Subject: [PATCH] Remove unused World Tile Entity List
@ -6,7 +6,7 @@ Subject: [PATCH] Remove unused World Tile Entity List
Massive hit to performance and it is completely unnecessary.
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 284c29e307..539dfa26a2 100644
index d13cf1014d..de09ed97ec 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -40,7 +40,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@ -18,7 +18,7 @@ index 284c29e307..539dfa26a2 100644
public final List<TileEntity> tileEntityListTick = Lists.newArrayList();
protected final List<TileEntity> tileEntityListPending = Lists.newArrayList();
protected final java.util.Set<TileEntity> tileEntityListUnload = com.google.common.collect.Sets.newHashSet(); // Paper
@@ -687,9 +687,9 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -688,9 +688,9 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
}, tileentity::getPosition});
}
@ -30,7 +30,7 @@ index 284c29e307..539dfa26a2 100644
this.tileEntityListTick.add(tileentity);
}
@@ -725,7 +725,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -726,7 +726,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
timings.tileEntityTick.startTiming(); // Spigot
if (!this.tileEntityListUnload.isEmpty()) {
this.tileEntityListTick.removeAll(this.tileEntityListUnload);
@ -39,7 +39,7 @@ index 284c29e307..539dfa26a2 100644
this.tileEntityListUnload.clear();
}
@@ -781,7 +781,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -782,7 +782,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
tilesThisCycle--;
this.tileEntityListTick.remove(tileTickPosition--);
// Spigot end
@ -48,7 +48,7 @@ index 284c29e307..539dfa26a2 100644
if (this.isLoaded(tileentity.getPosition())) {
this.getChunkAtWorldCoords(tileentity.getPosition()).removeTileEntity(tileentity.getPosition());
}
@@ -811,7 +811,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -812,7 +812,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
this.notify(tileentity1.getPosition(), iblockdata, iblockdata, 3);
// CraftBukkit start
// From above, don't screw this up - SPIGOT-1746
@ -57,7 +57,7 @@ index 284c29e307..539dfa26a2 100644
this.a(tileentity1);
}
// CraftBukkit end
@@ -1082,7 +1082,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -1083,7 +1083,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
} else {
if (tileentity != null) {
this.tileEntityListPending.remove(tileentity);

Datei anzeigen

@ -1,11 +1,11 @@
From 47491d3a02dd13f9889039781aabe50b7c0c85b9 Mon Sep 17 00:00:00 2001
From f1f27585e26230ace9096694bacd455ea0928cf2 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 13 Apr 2016 00:30:10 -0400
Subject: [PATCH] Don't tick Skulls - unused code
diff --git a/src/main/java/net/minecraft/server/TileEntitySkull.java b/src/main/java/net/minecraft/server/TileEntitySkull.java
index 369fdfe67..e827d7605 100644
index 369fdfe677..f6a80a00f4 100644
--- a/src/main/java/net/minecraft/server/TileEntitySkull.java
+++ b/src/main/java/net/minecraft/server/TileEntitySkull.java
@@ -24,7 +24,7 @@ import com.mojang.authlib.ProfileLookupCallback;
@ -17,6 +17,15 @@ index 369fdfe67..e827d7605 100644
public GameProfile gameProfile;
private int b;
@@ -124,7 +124,7 @@ public class TileEntitySkull extends TileEntity implements ITickable {
}
- @Override
+ // Paper - remove override
public void tick() {
Block block = this.getBlock().getBlock();
--
2.21.0

Datei anzeigen

@ -1,14 +1,14 @@
From a01a2428df3949d2ed0cff75bcbbd0c81ac11b34 Mon Sep 17 00:00:00 2001
From 9bd0b46ac1dc7a48289ebe7365b4035cb30cf301 Mon Sep 17 00:00:00 2001
From: mezz <tehgeek@gmail.com>
Date: Wed, 9 Aug 2017 17:51:22 -0500
Subject: [PATCH] Fix MC-117075: TE Unload Lag Spike
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 4b10048303..41908fa2a9 100644
index 9b9e969f52..ea8a6e557a 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -728,7 +728,11 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -729,7 +729,11 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
gameprofilerfiller.enter("blockEntities");
timings.tileEntityTick.startTiming(); // Spigot
if (!this.tileEntityListUnload.isEmpty()) {

Datei anzeigen

@ -1,4 +1,4 @@
From 336ef354f1d049b9a6b8730d1d42bc7fe2e6bac4 Mon Sep 17 00:00:00 2001
From 8cb1dec3a6a38ebdd4e4ae464789085dbc20e616 Mon Sep 17 00:00:00 2001
From: Brokkonaut <hannos17@gmx.de>
Date: Tue, 31 Oct 2017 03:26:18 +0100
Subject: [PATCH] Send attack SoundEffects only to players who can see the
@ -72,10 +72,10 @@ index 0f8100a05e..a30d88af81 100644
entity.extinguish();
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 41908fa2a9..0389ecadff 100644
index ea8a6e557a..b3a4b2ea97 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -665,6 +665,10 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -666,6 +666,10 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
this.a(entityhuman, (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, soundeffect, soundcategory, f, f1);
}

Datei anzeigen

@ -1,4 +1,4 @@
From d3abd49c79cb7b3e679243895bf468a0cff438ce Mon Sep 17 00:00:00 2001
From ff03c56abf16576c896a802b68df985d5145ba59 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 4 Jul 2018 03:39:51 -0400
Subject: [PATCH] Avoid Chunk Lookups for Entity/TileEntity Current Chunk
@ -10,10 +10,10 @@ to the object directly on the Entity/TileEntity object we can directly grab.
Use that local value instead to reduce lookups in many hot places.
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index dd74f38038..2f79f9e947 100644
index edd8e7810f..5349a3a8bc 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -760,7 +760,8 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -761,7 +761,8 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
if (!tileentity.isRemoved() && tileentity.hasWorld()) {
BlockPosition blockposition = tileentity.getPosition();
@ -23,7 +23,7 @@ index dd74f38038..2f79f9e947 100644
try {
gameprofilerfiller.a(() -> {
return String.valueOf(TileEntityTypes.a(tileentity.q()));
@@ -794,7 +795,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -795,7 +796,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
this.tileEntityListTick.remove(tileTickPosition--);
// Spigot end
//this.tileEntityList.remove(tileentity); // Paper - remove unused list
@ -32,7 +32,7 @@ index dd74f38038..2f79f9e947 100644
this.getChunkAtWorldCoords(tileentity.getPosition()).removeTileEntity(tileentity.getPosition());
}
}
@@ -815,8 +816,9 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -816,8 +817,9 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
}
// CraftBukkit end */
@ -45,7 +45,7 @@ index dd74f38038..2f79f9e947 100644
chunk.setTileEntity(tileentity1.getPosition(), tileentity1);
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index bd38c65478..c5da81f770 100644
index 38d673d8fe..bb2059fda7 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1068,7 +1068,7 @@ public class WorldServer extends World {

Datei anzeigen

@ -1,4 +1,4 @@
From 4bc6d671027b704df778a365ae88a309305d922f Mon Sep 17 00:00:00 2001
From 335b90c1a502709c87dbbb48859344d896977485 Mon Sep 17 00:00:00 2001
From: Hugo Manrique <hugmanrique@gmail.com>
Date: Mon, 23 Jul 2018 12:57:39 +0200
Subject: [PATCH] Option to prevent armor stands from doing entity lookups
@ -21,10 +21,10 @@ index 83e54cb904..f06bb3ae19 100644
private void maxEntityCollision() {
maxCollisionsPerEntity = getInt( "max-entity-collisions", this.spigotConfig.getInt("max-entity-collisions", 8) );
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index f8c382cb69..3f9ad25cbb 100644
index a7e24ed725..5544c4dbf3 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -867,6 +867,14 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -868,6 +868,14 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
// Spigot end
}

Datei anzeigen

@ -1,4 +1,4 @@
From ef845ceaf628cfe396b863d966190b3ae1094110 Mon Sep 17 00:00:00 2001
From 4bc4dee4a3bcbef50d0e436a59e01df8e92944d6 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 28 Jul 2018 12:18:27 -0400
Subject: [PATCH] Ignore Dead Entities in entityList iteration
@ -11,11 +11,11 @@ This will ensure that dead entities are skipped from iteration since
they shouldn't of been in the list in the first place.
diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java
index f38179e983..8e1bda4de9 100644
index 3354fdd60d..ab09104542 100644
--- a/src/main/java/com/destroystokyo/paper/PaperCommand.java
+++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java
@@ -176,6 +176,7 @@ public class PaperCommand extends Command {
List<Entity> entities = world.entityList;
List<Entity> entities = world.globalEntityList;
entities.forEach(e -> {
MinecraftKey key = e.getMinecraftKey();
+ if (e.shouldBeRemoved) return; // Paper
@ -63,7 +63,7 @@ index cbd7793c53..a217cb0fe7 100644
private float av;
private float aw;
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 5a6fe15908..305336d8d6 100644
index cc8d80e95d..2843a61315 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -843,6 +843,7 @@ public class WorldServer extends World {

Datei anzeigen

@ -1,4 +1,4 @@
From 995b2e22adbabdca35486f446fde38c87b21b975 Mon Sep 17 00:00:00 2001
From f29dcfd87c3bff303269693956d68e7e3cb8197d Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 10 Sep 2018 23:56:36 -0400
Subject: [PATCH] Prevent Mob AI Rules from Loading Chunks
@ -74,10 +74,10 @@ index 8340d6d25b..78eb1b39cf 100644
}
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 3f9ad25cbb..bebf5a6e19 100644
index 5544c4dbf3..39d5a8f5e5 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -645,6 +645,16 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -646,6 +646,16 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
return chunk.getType(blockposition);
}
}

Datei anzeigen

@ -1,4 +1,4 @@
From 764aae7b864fd017c5ffc6d01738695660b2a21d Mon Sep 17 00:00:00 2001
From 424d5ef016abd8b3cc39723424efda13f1255740 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Sun, 7 Oct 2018 00:54:21 -0500
Subject: [PATCH] Add sun related API
@ -17,10 +17,10 @@ index f1621a9e9d..a8318c88af 100644
if (this.world.J() && !this.world.isClientSide) {
float f = this.aE();
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index bebf5a6e19..136727c280 100644
index 39d5a8f5e5..2278c7c4ab 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -667,6 +667,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -668,6 +668,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
}
}

Datei anzeigen

@ -1,4 +1,4 @@
From 9d86c1508b1b4798ae083a405ee2e7101949b161 Mon Sep 17 00:00:00 2001
From f4ea90abc5bbe39acf0de2aa6de4801139e329ac Mon Sep 17 00:00:00 2001
From: theosib <millerti@172.16.221.1>
Date: Thu, 27 Sep 2018 01:43:35 -0600
Subject: [PATCH] Optimize redstone algorithm
@ -19,7 +19,7 @@ Aside from making the obvious class/function renames and obfhelpers I didn't nee
Just added Bukkit's event system and took a few liberties with dead code and comment misspellings.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index ad793ffa3..ef882b897 100644
index ad793ffa38..ef882b897f 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -439,4 +439,14 @@ public class PaperWorldConfig {
@ -39,10 +39,10 @@ index ad793ffa3..ef882b897 100644
}
diff --git a/src/main/java/com/destroystokyo/paper/util/RedstoneWireTurbo.java b/src/main/java/com/destroystokyo/paper/util/RedstoneWireTurbo.java
new file mode 100644
index 000000000..21d9d6d7e
index 0000000000..cf5661f1c5
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/util/RedstoneWireTurbo.java
@@ -0,0 +1,910 @@
@@ -0,0 +1,912 @@
+package com.destroystokyo.paper.util;
+
+import java.util.List;
@ -58,6 +58,8 @@ index 000000000..21d9d6d7e
+import net.minecraft.server.BlockPosition;
+import net.minecraft.server.BlockRedstoneWire;
+import net.minecraft.server.IBlockData;
+import net.minecraft.server.Items;
+import net.minecraft.server.ItemStack;
+import net.minecraft.server.World;
+
+/**
@ -365,7 +367,7 @@ index 000000000..21d9d6d7e
+ // be replicated here.
+ if (!wire.canPlace(null, worldIn, pos)) {
+ // Pop off the redstone dust
+ oldState.dropNaturally(worldIn, pos, 0);
+ Block.a(worldIn, pos, new ItemStack(Items.REDSTONE)); // TODO
+ worldIn.setAir(pos);
+
+ // Mark this position as not being redstone wire
@ -888,7 +890,7 @@ index 000000000..21d9d6d7e
+ // position directly above the node being calculated is always
+ // at index 1.
+ UpdateNode center_up = upd.neighbor_nodes[1];
+ boolean center_up_is_cube = center_up.currentState.isOccluding();
+ boolean center_up_is_cube = center_up.currentState.isOccluding(worldIn, center_up.self); // TODO
+
+ for (int m = 0; m < 4; m++) {
+ // Get the neighbor array index of each of the four cardinal
@ -902,7 +904,7 @@ index 000000000..21d9d6d7e
+
+ // Also check the positions above and below the cardinal
+ // neighbors
+ boolean neighbor_is_cube = neighbor.currentState.isOccluding();
+ boolean neighbor_is_cube = neighbor.currentState.isOccluding(worldIn, neighbor.self); // TODO
+ if (!neighbor_is_cube) {
+ UpdateNode neighbor_down = upd.neighbor_nodes[rs_neighbors_dn[m]];
+ l = getMaxCurrentStrength(neighbor_down, l);
@ -954,7 +956,7 @@ index 000000000..21d9d6d7e
+ }
+}
diff --git a/src/main/java/net/minecraft/server/BlockRedstoneWire.java b/src/main/java/net/minecraft/server/BlockRedstoneWire.java
index da903f74b..aa35e0d06 100644
index da903f74b6..aa35e0d061 100644
--- a/src/main/java/net/minecraft/server/BlockRedstoneWire.java
+++ b/src/main/java/net/minecraft/server/BlockRedstoneWire.java
@@ -1,5 +1,7 @@
@ -1122,10 +1124,10 @@ index da903f74b..aa35e0d06 100644
c(iblockdata, world, blockposition);
world.a(blockposition, false);
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 136727c28..326165468 100644
index 2278c7c4ab..4531adc268 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -546,6 +546,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -547,6 +547,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
}
@ -1133,7 +1135,7 @@ index 136727c28..326165468 100644
public void a(BlockPosition blockposition, Block block, BlockPosition blockposition1) {
if (!this.isClientSide) {
IBlockData iblockdata = this.getType(blockposition);
@@ -1307,6 +1308,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -1308,6 +1309,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
return this.getBlockFacePower(blockposition.down(), EnumDirection.DOWN) > 0 ? true : (this.getBlockFacePower(blockposition.up(), EnumDirection.UP) > 0 ? true : (this.getBlockFacePower(blockposition.north(), EnumDirection.NORTH) > 0 ? true : (this.getBlockFacePower(blockposition.south(), EnumDirection.SOUTH) > 0 ? true : (this.getBlockFacePower(blockposition.west(), EnumDirection.WEST) > 0 ? true : this.getBlockFacePower(blockposition.east(), EnumDirection.EAST) > 0))));
}

Datei anzeigen

@ -1,9 +1,22 @@
From e5d7ff2ae47f20f992283f0f5c0a19efeee46944 Mon Sep 17 00:00:00 2001
From 18daafb7221a2c0102a2c150b39057d9982393d4 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Sun, 7 Oct 2018 04:29:59 -0500
Subject: [PATCH] Add more Zombie API
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
index a8318c88af..a0c089477a 100644
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
@@ -1250,6 +1250,8 @@ public abstract class EntityInsentient extends EntityLiving {
this.datawatcher.set(EntityInsentient.b, flag ? (byte) (b0 | 2) : (byte) (b0 & -3));
}
+ public boolean isArmsRaised() { return (this.datawatcher.get(EntityInsentient.b) & 4) != 0; } // Paper - OBFHELPER // TODO verify + obfhelper the datawatcher field
+ public void setArmsRaised(boolean flag) { this.q(flag); } // Paper - OBFHELPER // TODO verify
public void q(boolean flag) {
byte b0 = (Byte) this.datawatcher.get(EntityInsentient.b);
diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java
index 2f0fab469b..dea1d2d4d2 100644
--- a/src/main/java/net/minecraft/server/EntityZombie.java
@ -79,31 +92,46 @@ index 2f0fab469b..dea1d2d4d2 100644
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java
index 0429cf020e..23041bd07b 100644
index 0429cf020e..060a6aa027 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java
@@ -80,4 +80,26 @@ public class CraftZombie extends CraftMonster implements Zombie {
@@ -80,4 +80,41 @@ public class CraftZombie extends CraftMonster implements Zombie {
getHandle().startDrownedConversion(time);
}
}
+
+ // Paper start
+ @Override
+ public boolean isDrowning() {
+ return getHandle().isDrowning();
+ }
+
+ @Override
+ public void startDrowning(int drownedConversionTime) {
+ getHandle().startDrownedConversion(drownedConversionTime);
+ }
+
+ @Override
+ public void stopDrowning() {
+ getHandle().stopDrowning();
+ }
+
+ @Override
+ public boolean shouldBurnInDay() {
+ return getHandle().shouldBurnInDay();
+ }
+
+ @Override
+ public boolean isArmsRaised() {
+ return getHandle().isArmsRaised();
+ }
+
+ @Override
+ public void setArmsRaised(final boolean raised) {
+ getHandle().q(raised); // TODO add obfhelper and verify
+ }
+
+ @Override
+ public void setShouldBurnInDay(boolean shouldBurnInDay) {
+ getHandle().setShouldBurnInDay(shouldBurnInDay);
+ }

Datei anzeigen

@ -1,4 +1,4 @@
From 65e72588f13ac58a34eb65b1ea5d2041a9831f89 Mon Sep 17 00:00:00 2001
From cd6a0cd2c5e568884667729120406fc27837e454 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 6 Feb 2019 00:20:33 -0500
Subject: [PATCH] BlockDestroyEvent
@ -11,10 +11,10 @@ floating in the air.
This can replace many uses of BlockPhysicsEvent
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 326165468c..9c26b8d676 100644
index 4531adc268..a7333de99a 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -476,8 +476,20 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -477,8 +477,20 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
return false;
} else {
Fluid fluid = this.getFluid(blockposition);

Datei anzeigen

@ -0,0 +1,55 @@
From 10204d4fa6ec2479dc404e08a4c401671717eb5b Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Sat, 6 Oct 2018 20:54:23 -0500
Subject: [PATCH] Implement getters and setters for EntityItem owner and
thrower
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
index 3f552b5905..cb756b1ba0 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
@@ -8,6 +8,11 @@ import org.bukkit.entity.EntityType;
import org.bukkit.entity.Item;
import org.bukkit.inventory.ItemStack;
+// Paper start
+import javax.annotation.Nullable;
+import java.util.UUID;
+// Paper end
+
public class CraftItem extends CraftEntity implements Item {
private final EntityItem item;
@@ -56,6 +61,28 @@ public class CraftItem extends CraftEntity implements Item {
public void setCanMobPickup(boolean canMobPickup) {
item.canMobPickup = canMobPickup;
}
+
+ @Nullable
+ @Override
+ public UUID getOwner() {
+ return item.getOwner();
+ }
+
+ @Override
+ public void setOwner(@Nullable UUID owner) {
+ item.setOwner(owner);
+ }
+
+ @Nullable
+ @Override
+ public UUID getThrower() {
+ return item.getThrower();
+ }
+
+ @Override
+ public void setThrower(@Nullable UUID thrower) {
+ item.setThrower(thrower);
+ }
// Paper End
@Override
--
2.21.0

Datei anzeigen

@ -1,4 +1,4 @@
From 58ea54af0576c549f575367b2b18c5a796ca684a Mon Sep 17 00:00:00 2001
From 43ae5db982747cd6244b117f0fe8014f73d355ee Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 27 Mar 2019 22:48:45 -0400
Subject: [PATCH] Server Tick Events
@ -6,7 +6,7 @@ Subject: [PATCH] Server Tick Events
Fires event at start and end of a server tick
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index e61287949..3fc232431 100644
index e612879495..3fc232431a 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1051,6 +1051,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas

Datei anzeigen

@ -1,4 +1,4 @@
From ed2138f8c4715b48c8e2de76445876c037433ab6 Mon Sep 17 00:00:00 2001
From d094a10b31c30a382ae88366d22ad40a047bd1ea Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 27 Mar 2019 23:01:33 -0400
Subject: [PATCH] PlayerDeathEvent#getItemsToKeep
@ -8,7 +8,7 @@ Exposes a mutable array on items a player should keep on death
Example Usage: https://gist.github.com/aikar/5bb202de6057a051a950ce1f29feb0b4
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index a18afbcdd..f17e79930 100644
index a18afbcdde..f17e799309 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -508,6 +508,46 @@ public class EntityPlayer extends EntityHuman implements ICrafting {

Datei anzeigen

@ -1,4 +1,4 @@
From 43a664a624136553e52ee00ca4b6c59b7ae3f6a8 Mon Sep 17 00:00:00 2001
From 3eccc08f2ede9106b83b801535b818571f6f8e1a Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 29 Mar 2019 01:25:11 -0400
Subject: [PATCH] Optimize Persistent Data Loading
@ -14,7 +14,7 @@ These files take a long time to convert on large worlds and crashes the server.
Additionally, cache the result of a file being missing so we don't keep spam checking it.
diff --git a/src/main/java/net/minecraft/server/WorldPersistentData.java b/src/main/java/net/minecraft/server/WorldPersistentData.java
index 47a4ea998..62081349f 100644
index 47a4ea9985..62081349f1 100644
--- a/src/main/java/net/minecraft/server/WorldPersistentData.java
+++ b/src/main/java/net/minecraft/server/WorldPersistentData.java
@@ -26,6 +26,7 @@ public class WorldPersistentData {

Datei anzeigen

@ -1,4 +1,4 @@
From 742bd11b5bddb1ee5ed829051c28834955bffd73 Mon Sep 17 00:00:00 2001
From 7cbd6e6ebd1574689b53977d73c6952e87cfca1a Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Sun, 31 Mar 2019 22:02:24 -0700
Subject: [PATCH] Allow login events to fire only after the server plugins are
@ -7,7 +7,7 @@ Subject: [PATCH] Allow login events to fire only after the server plugins are
Event threads will simply block until they're ready to accept.
diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java
index 9e4bc2405..028c23dbe 100644
index 9e4bc24058..028c23dbe6 100644
--- a/src/main/java/net/minecraft/server/LoginListener.java
+++ b/src/main/java/net/minecraft/server/LoginListener.java
@@ -285,6 +285,36 @@ public class LoginListener implements PacketLoginInListener {
@ -56,7 +56,7 @@ index 9e4bc2405..028c23dbe 100644
java.net.InetAddress address = ((java.net.InetSocketAddress) networkManager.getSocketAddress()).getAddress();
java.util.UUID uniqueId = i.getId();
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 3fc232431..93c014c39 100644
index 3fc232431a..93c014c399 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -463,6 +463,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas

Datei anzeigen

@ -1,4 +1,4 @@
From 0181c40d113cf2a21c12e5d1016fad735f0dfd82 Mon Sep 17 00:00:00 2001
From ff681dbbc6c8b45b2a2589ce3df2bca78f2a2950 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Mon, 1 Apr 2019 18:57:32 -0700
Subject: [PATCH] Make region files more reliable to write to
@ -37,7 +37,7 @@ affect save performance if the startup flag is used (especially on
HDDs).
diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java
index 995a89377..66d87d64b 100644
index 995a893774..66d87d64b5 100644
--- a/src/main/java/net/minecraft/server/RegionFile.java
+++ b/src/main/java/net/minecraft/server/RegionFile.java
@@ -29,7 +29,7 @@ public class RegionFile implements AutoCloseable {

Datei anzeigen

@ -1,4 +1,4 @@
From 546c830c63daa9ae7f81e577def2390e40ea33a1 Mon Sep 17 00:00:00 2001
From fc04d1491133783f7c34c7dd55e2bf109f747df8 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Thu, 4 Apr 2019 17:55:05 -0700
Subject: [PATCH] Optimize GameRules to use LinkedHashMap
@ -6,7 +6,7 @@ Subject: [PATCH] Optimize GameRules to use LinkedHashMap
Previously TreeMap was used which has poor get(K) performance.
diff --git a/src/main/java/net/minecraft/server/GameRules.java b/src/main/java/net/minecraft/server/GameRules.java
index 3de9d264d..c6a800474 100644
index 3de9d264db..c6a8004745 100644
--- a/src/main/java/net/minecraft/server/GameRules.java
+++ b/src/main/java/net/minecraft/server/GameRules.java
@@ -17,7 +17,17 @@ import javax.annotation.Nullable;
@ -49,7 +49,7 @@ index 3de9d264d..c6a800474 100644
}
diff --git a/src/test/java/org/bukkit/GameRuleTest.java b/src/test/java/org/bukkit/GameRuleTest.java
index 1ed0f4cf2..40edb8d66 100644
index 1ed0f4cf2b..40edb8d668 100644
--- a/src/test/java/org/bukkit/GameRuleTest.java
+++ b/src/test/java/org/bukkit/GameRuleTest.java
@@ -21,7 +21,7 @@ public class GameRuleTest {

Datei anzeigen

@ -1,4 +1,4 @@
From 0cde60fff93b54664d47d320334fc5520a32c816 Mon Sep 17 00:00:00 2001
From 56b3f4aeb4601cb80aaf0e66c2d97482e23e5ac8 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 6 Apr 2019 10:16:48 -0400
Subject: [PATCH] Optimize Captured TileEntity Lookup
@ -10,10 +10,10 @@ Optimize to check if the captured list even has values in it, and also to
just do a get call since the value can never be null.
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 9c26b8d67..1bec5beab 100644
index a7333de99a..235440c651 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1049,12 +1049,13 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -1050,12 +1050,13 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
return null;
} else {
// CraftBukkit start

Datei anzeigen

@ -1,14 +1,14 @@
From 0a9ff885463979090cd6655121057ac03a92d7b4 Mon Sep 17 00:00:00 2001
From 38a4833f0693fd44bd6be0fd00b32ad98af60dd0 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Tue, 1 Jan 2019 02:22:01 -0800
Subject: [PATCH] Add Heightmap API
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 1bec5beab..9f4cf3f1b 100644
index 235440c651..cae59ed377 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -615,8 +615,8 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -616,8 +616,8 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
}
}
@ -20,7 +20,7 @@ index 1bec5beab..9f4cf3f1b 100644
if (i >= -30000000 && j >= -30000000 && i < 30000000 && j < 30000000) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index ed646bc9d..d2c3ea0dc 100644
index ed646bc9db..d2c3ea0dc3 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -317,6 +317,29 @@ public class CraftWorld implements World {

Datei anzeigen

@ -1,4 +1,4 @@
From 92be63d442480866c329fddc6fcee816f6d8541d Mon Sep 17 00:00:00 2001
From 71807748b0b5a66e584ee33e6fbf7156bab458ff Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Mon, 15 Apr 2019 02:24:52 +0100
Subject: [PATCH] Handle bad chunks more gracefully
@ -15,7 +15,7 @@ Should Mojang choose to alter this behavior in the future, this change
will simply defer to whatever that new behavior is.
diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java
index 6893f3cd3..717b0b1f0 100644
index 6893f3cd34..717b0b1f08 100644
--- a/src/main/java/net/minecraft/server/RegionFileCache.java
+++ b/src/main/java/net/minecraft/server/RegionFileCache.java
@@ -171,8 +171,21 @@ public abstract class RegionFileCache implements AutoCloseable {

Datei anzeigen

@ -1,11 +1,11 @@
From 4f10353936c77034a5064e78f7a68ddb359e4769 Mon Sep 17 00:00:00 2001
From b4ef112f5b372442d85cf0fd34b2b6b813f25e8e Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Fri, 19 Apr 2019 12:41:13 -0500
Subject: [PATCH] Mob Spawner API Enhancements
diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
index 96080b6c7..c0f5a5512 100644
index 96080b6c73..c0f5a55120 100644
--- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
+++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
@@ -46,6 +46,7 @@ public abstract class MobSpawnerAbstract {
@ -82,7 +82,7 @@ index 96080b6c7..c0f5a5512 100644
nbttagcompound.setShort("MaxNearbyEntities", (short) this.maxNearbyEntities);
nbttagcompound.setShort("RequiredPlayerRange", (short) this.requiredPlayerRange);
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java b/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java
index 5c4c3c70c..e78e3804b 100644
index 5c4c3c70c7..e78e3804ba 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java
@@ -121,4 +121,16 @@ public class CraftCreatureSpawner extends CraftBlockEntityState<TileEntityMobSpa

Datei anzeigen

@ -1,4 +1,4 @@
From 09ff776905a9378d5c0b45fbb0f58e5772bb7533 Mon Sep 17 00:00:00 2001
From bd56fb5c4a5eee6d61c68e569a6f758cb48bad78 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Mon, 22 Apr 2019 19:51:14 +0100
Subject: [PATCH] don't NPE on dimensionmanager toString
@ -14,7 +14,7 @@ this is not super elegant, but is the only route that promises not to
break stuff.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 982dce480..d18a530a4 100644
index 982dce4800..d18a530a4d 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -997,7 +997,14 @@ public final class CraftServer implements Server {

Datei anzeigen

@ -1,4 +1,4 @@
From 6bc4d42b25c814caec38cd22015bc4e318f20049 Mon Sep 17 00:00:00 2001
From 2d49b74a31dac7c5671cc0a5b1d9c2407db03806 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach@zachbr.io>
Date: Mon, 6 May 2019 01:29:25 -0400
Subject: [PATCH] Per-Player View Distance API placeholders
@ -7,7 +7,7 @@ I hope to look at this more in-depth soon. It appears doable.
However this should not block the update.
diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java
index 3abf89b74..c558661d2 100644
index 3abf89b741..c558661d20 100644
--- a/src/main/java/net/minecraft/server/EntityEnderDragon.java
+++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java
@@ -565,9 +565,9 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster {
@ -23,7 +23,7 @@ index 3abf89b74..c558661d2 100644
double deltaX = this.locX - player.locX;
double deltaZ = this.locZ - player.locZ;
diff --git a/src/main/java/net/minecraft/server/EntityWither.java b/src/main/java/net/minecraft/server/EntityWither.java
index 48b22894a..dbd854206 100644
index 48b22894aa..dbd8542069 100644
--- a/src/main/java/net/minecraft/server/EntityWither.java
+++ b/src/main/java/net/minecraft/server/EntityWither.java
@@ -208,9 +208,9 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
@ -39,7 +39,7 @@ index 48b22894a..dbd854206 100644
double deltaX = this.locX - player.locX;
double deltaZ = this.locZ - player.locZ;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 3bc7a64fa..d94f4c03c 100644
index 3bc7a64fac..d94f4c03c2 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1963,6 +1963,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -0,0 +1,40 @@
From 75d57f76e6c5fd5c01f0696d01dbe7957267b017 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Mon, 6 May 2019 12:29:24 -0700
Subject: [PATCH] Async Chunk placeholder
Until we figure out Mojang's ticket system.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index d2c3ea0dc3..f4ce7c59c8 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -14,6 +14,7 @@ import java.util.Objects;
import java.util.Random;
import java.util.Set;
import java.util.UUID;
+import java.util.concurrent.CompletableFuture;
import java.util.function.Predicate;
import net.minecraft.server.AxisAlignedBB;
import net.minecraft.server.BiomeBase;
@@ -2135,6 +2136,17 @@ public class CraftWorld implements World {
return (nearest == null) ? null : new Location(this, nearest.getX(), nearest.getY(), nearest.getZ());
}
+ // Paper start
+
+ @Override
+ public CompletableFuture<Chunk> getChunkAtAsync(int x, int z, boolean gen) {
+ // TODO placeholder
+ CompletableFuture<Chunk> ret = new CompletableFuture<>();
+ ret.complete(getChunkAt(x, z));
+ return ret;
+ }
+ // Paper end
+
// Spigot start
private final Spigot spigot = new Spigot()
{
--
2.21.0

Datei anzeigen

@ -1,184 +0,0 @@
From b82067ae505316dca7048faaedeb7f7565406b6e Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Sat, 22 Sep 2018 00:33:08 -0500
Subject: [PATCH] Add LivingEntity#getTargetEntity
diff --git a/src/main/java/net/minecraft/server/AxisAlignedBB.java b/src/main/java/net/minecraft/server/AxisAlignedBB.java
index 1c0b783e8e..dad1ff7372 100644
--- a/src/main/java/net/minecraft/server/AxisAlignedBB.java
+++ b/src/main/java/net/minecraft/server/AxisAlignedBB.java
@@ -95,6 +95,7 @@ public class AxisAlignedBB {
return new AxisAlignedBB(d3, d4, d5, d6, d7, d8);
}
+ public AxisAlignedBB expand(double x, double y, double z) { return b(x, y, z); } // Paper - OBFHELPER
public AxisAlignedBB b(double d0, double d1, double d2) {
double d3 = this.minX;
double d4 = this.minY;
@@ -124,6 +125,12 @@ public class AxisAlignedBB {
return new AxisAlignedBB(d3, d4, d5, d6, d7, d8);
}
+ // Paper start
+ public AxisAlignedBB grow(double d0) {
+ return grow(d0, d0, d0);
+ }
+ // Paper end
+
public AxisAlignedBB grow(double d0, double d1, double d2) {
double d3 = this.minX - d0;
double d4 = this.minY - d1;
@@ -181,6 +188,7 @@ public class AxisAlignedBB {
return this.minX < d3 && this.maxX > d0 && this.minY < d4 && this.maxY > d1 && this.minZ < d5 && this.maxZ > d2;
}
+ public boolean contains(Vec3D vec3d) { return b(vec3d); } // Paper - OBFHELPER
public boolean b(Vec3D vec3d) {
return this.e(vec3d.x, vec3d.y, vec3d.z);
}
@@ -205,6 +213,7 @@ public class AxisAlignedBB {
return this.g(-d0);
}
+ public MovingObjectPosition calculateIntercept(Vec3D vec3d, Vec3D vec3d1) { return b(vec3d, vec3d1); } // Paper - OBFHELPER
@Nullable
public MovingObjectPosition b(Vec3D vec3d, Vec3D vec3d1) {
return this.a(vec3d, vec3d1, (BlockPosition) null);
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 3db1b6bb1b..de45e3c7a8 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -1536,6 +1536,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
return new Vec3D((double) (f5 * f6), (double) (-f7), (double) (f4 * f6));
}
+ public Vec3D getEyePosition(float partialTicks) { return i(partialTicks); } // Paper - OBFHELPER
public Vec3D i(float f) {
if (f == 1.0F) {
return new Vec3D(this.locX, this.locY + (double) this.getHeadHeight(), this.locZ);
@@ -2183,10 +2184,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
return this.bP().size() < 1;
}
+ public float getCollisionBorderSize() { return aM(); } // Paper - OBFHELPER
public float aM() {
return 0.0F;
}
+ public Vec3D getLookVec() { return aN(); } // Paper - OBFHELPER
public Vec3D aN() {
return this.d(this.pitch, this.yaw);
}
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 3d1cdd6271..14f1029687 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -3,6 +3,8 @@ package net.minecraft.server;
import com.destroystokyo.paper.event.player.PlayerArmorChangeEvent;
import com.google.common.base.Objects;
import com.google.common.collect.Maps;
+
+import java.util.Arrays;
import java.util.Collection;
import java.util.ConcurrentModificationException;
import java.util.Iterator;
@@ -16,6 +18,8 @@ import org.apache.logging.log4j.Logger;
// CraftBukkit start
import java.util.ArrayList;
+import java.util.stream.Collectors;
+
import com.google.common.base.Function;
import com.google.common.collect.Lists;
import org.bukkit.Location;
@@ -2863,6 +2867,36 @@ public abstract class EntityLiving extends Entity {
return world.rayTrace(start, end, fluidCollisionOption);
}
+ public MovingObjectPosition getTargetEntity(int maxDistance) {
+ if (maxDistance < 1 || maxDistance > 120) {
+ throw new IllegalArgumentException("maxDistance must be between 1-120");
+ }
+
+ Vec3D start = getEyePosition(1.0F);
+ Vec3D direction = getLookVec();
+ Vec3D end = start.add(direction.x * maxDistance, direction.y * maxDistance, direction.z * maxDistance);
+
+ List<Entity> entityList = world.getEntities(this, getBoundingBox().expand(direction.x * maxDistance, direction.y * maxDistance, direction.z * maxDistance).grow(1.0D, 1.0D, 1.0D), IEntitySelector.notSpectator().and(Entity::isInteractable));
+
+ double distance = 0.0D;
+ MovingObjectPosition rayTraceResult = null;
+
+ for (Entity entity : entityList) {
+ AxisAlignedBB aabb = entity.getBoundingBox().grow((double) entity.getCollisionBorderSize());
+ MovingObjectPosition rayTrace = aabb.calculateIntercept(start, end);
+
+ if (rayTrace != null) {
+ double distanceTo = start.distanceSquared(rayTrace.pos);
+ if (distanceTo < distance || distance == 0.0D) {
+ rayTraceResult = new MovingObjectPosition(entity, rayTrace.pos);
+ distance = distanceTo;
+ }
+ }
+ }
+
+ return rayTraceResult;
+ }
+
public int shieldBlockingDelay = world.paperConfig.shieldBlockingDelay;
public int getShieldBlockingDelay() {
diff --git a/src/main/java/net/minecraft/server/IEntitySelector.java b/src/main/java/net/minecraft/server/IEntitySelector.java
index f6916fd455..71f08d53c7 100644
--- a/src/main/java/net/minecraft/server/IEntitySelector.java
+++ b/src/main/java/net/minecraft/server/IEntitySelector.java
@@ -19,6 +19,7 @@ public final class IEntitySelector {
public static final Predicate<Entity> e = (entity) -> {
return !(entity instanceof EntityHuman) || !((EntityHuman) entity).isSpectator() && !((EntityHuman) entity).u();
};
+ public static Predicate<Entity> notSpectator() { return f; } // Paper - OBFHELPER
public static final Predicate<Entity> f = (entity) -> {
return !(entity instanceof EntityHuman) || !((EntityHuman) entity).isSpectator();
};
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index eeab59379a..d6a4bc64ae 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -186,6 +186,33 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
net.minecraft.server.MovingObjectPosition rayTrace = getHandle().getRayTrace(maxDistance, net.minecraft.server.MCUtil.getNMSFluidCollisionOption(fluidMode));
return rayTrace == null ? null : new com.destroystokyo.paper.block.TargetBlockInfo(org.bukkit.craftbukkit.block.CraftBlock.at(getHandle().world, rayTrace.getBlockPosition()), net.minecraft.server.MCUtil.toBukkitBlockFace(rayTrace.direction));
}
+
+ public Entity getTargetEntity(int maxDistance, boolean ignoreBlocks) {
+ net.minecraft.server.MovingObjectPosition rayTrace = rayTraceEntity(maxDistance, ignoreBlocks);
+ return rayTrace == null ? null : rayTrace.entity.getBukkitEntity();
+ }
+
+ public com.destroystokyo.paper.entity.TargetEntityInfo getTargetEntityInfo(int maxDistance, boolean ignoreBlocks) {
+ net.minecraft.server.MovingObjectPosition rayTrace = rayTraceEntity(maxDistance, ignoreBlocks);
+ return rayTrace == null ? null : new com.destroystokyo.paper.entity.TargetEntityInfo(rayTrace.entity.getBukkitEntity(), new org.bukkit.util.Vector(rayTrace.pos.x, rayTrace.pos.y, rayTrace.pos.z));
+ }
+
+ public net.minecraft.server.MovingObjectPosition rayTraceEntity(int maxDistance, boolean ignoreBlocks) {
+ net.minecraft.server.MovingObjectPosition rayTrace = getHandle().getTargetEntity(maxDistance);
+ if (rayTrace == null) {
+ return null;
+ }
+ if (!ignoreBlocks) {
+ net.minecraft.server.MovingObjectPosition rayTraceBlocks = getHandle().getRayTrace(maxDistance, net.minecraft.server.FluidCollisionOption.NEVER);
+ if (rayTraceBlocks != null) {
+ net.minecraft.server.Vec3D eye = getHandle().getEyePosition(1.0F);
+ if (eye.distanceSquared(rayTraceBlocks.pos) <= eye.distanceSquared(rayTrace.pos)) {
+ return null;
+ }
+ }
+ }
+ return rayTrace;
+ }
// Paper end
public List<Block> getLastTwoTargetBlocks(Set<Material> transparent, int maxDistance) {
--
2.21.0

Datei anzeigen

@ -1,82 +0,0 @@
From 537a387c3e1511657b618532f2866fbc92e1dd8b Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Sat, 6 Oct 2018 20:54:23 -0500
Subject: [PATCH] Implement getters and setters for EntityItem owner and
thrower
diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java
index c9473087ad..e723bd339e 100644
--- a/src/main/java/net/minecraft/server/EntityItem.java
+++ b/src/main/java/net/minecraft/server/EntityItem.java
@@ -410,20 +410,22 @@ public class EntityItem extends Entity {
this.getDataWatcher().markDirty(EntityItem.b); // CraftBukkit - SPIGOT-4591, must mark dirty
}
- @Nullable
- public UUID k() {
+ @Nullable public UUID getOwner() { return k(); } // Paper - OBFHELPER
+ @Nullable public UUID k() { // Paper
return this.g;
}
+ public void setOwner(@Nullable UUID owner) { b(owner); } // Paper - OBFHELPER
public void b(@Nullable UUID uuid) {
this.g = uuid;
}
- @Nullable
- public UUID l() {
+ @Nullable public UUID getThrower() { return l(); } // Paper - OBFHELPER
+ @Nullable public UUID l() { // Paper
return this.f;
}
+ public void setThrower(@Nullable UUID thrower) { c(thrower); } // Paper - OBFHELPER
public void c(@Nullable UUID uuid) {
this.f = uuid;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
index 6036592f76..4128ba4c06 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
@@ -9,6 +9,11 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.craftbukkit.inventory.CraftItemStack;
import org.bukkit.craftbukkit.CraftServer;
+// Paper start
+import javax.annotation.Nullable;
+import java.util.UUID;
+// Paper end
+
public class CraftItem extends CraftEntity implements Item {
private final EntityItem item;
@@ -53,6 +58,24 @@ public class CraftItem extends CraftEntity implements Item {
public void setCanMobPickup(boolean canMobPickup) {
item.canMobPickup = canMobPickup;
}
+
+ @Nullable
+ public UUID getOwner() {
+ return item.getOwner();
+ }
+
+ public void setOwner(@Nullable UUID owner) {
+ item.setOwner(owner);
+ }
+
+ @Nullable
+ public UUID getThrower() {
+ return item.getThrower();
+ }
+
+ public void setThrower(@Nullable UUID thrower) {
+ item.setThrower(thrower);
+ }
// Paper End
@Override
--
2.21.0