more more more work

This commit is contained in:
Noah van der Aa 2023-09-21 22:14:58 +02:00
parent 20253f478f
commit 91671751e7
No known key found for this signature in database
GPG Key ID: 547D90BC6FF753CF
50 changed files with 205 additions and 224 deletions

View File

@ -17,10 +17,10 @@ Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: SoSeDiK <mrsosedik@gmail.com>
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 2c922afde237ca0e56ee6dc067f2989434d4d08c..a4f0cb93a08136888a81f1a8e7ed1d56f92e2195 100644
index d755ce65ffd22a7f39bb19c547f655f8539b3dbf..0f264a3efe33935df463cc8048bc70ab14526386 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2063,7 +2063,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -1919,7 +1919,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
OutgoingChatMessage outgoing = OutgoingChatMessage.create(original);
@ -29,7 +29,7 @@ index 2c922afde237ca0e56ee6dc067f2989434d4d08c..a4f0cb93a08136888a81f1a8e7ed1d56
this.handleCommand(s);
} else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) {
// Do nothing, this is coming from a plugin
@@ -2147,7 +2147,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -2003,7 +2003,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
}
@ -40,10 +40,10 @@ index 2c922afde237ca0e56ee6dc067f2989434d4d08c..a4f0cb93a08136888a81f1a8e7ed1d56
if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot
this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + s);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 66433478fd82f730705fd383b90145d79189a915..fd9457a02f36b0230eb2d4fd549419f46d4b8da3 100644
index c2289c8ef49c73d662a67eab7a2b8c0cf9bb31a9..3e3c3db4a9a4474af79d2470da2ab133eef7cf4c 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -886,7 +886,7 @@ public final class CraftServer implements Server {
@@ -889,7 +889,7 @@ public final class CraftServer implements Server {
public boolean dispatchCommand(CommandSender sender, String commandLine) {
Preconditions.checkArgument(sender != null, "sender cannot be null");
Preconditions.checkArgument(commandLine != null, "commandLine cannot be null");
@ -53,10 +53,10 @@ index 66433478fd82f730705fd383b90145d79189a915..fd9457a02f36b0230eb2d4fd549419f4
if (this.commandMap.dispatch(sender, commandLine)) {
return true;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index f5b05eb97f059cfb4d6d22d0a180c5fd8a203f66..a3f85b1cf8b03da90f2461cbe42dd18a630f2255 100644
index a67a3f13c2b142205b76a6ff478a606fe7546925..2acb5e73db4d629729c05373babd0d2e37122448 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -492,7 +492,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -452,7 +452,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
if (this.getHandle().connection == null) return;

View File

@ -5,10 +5,10 @@ Subject: [PATCH] All chunks are slime spawn chunks toggle
diff --git a/src/main/java/net/minecraft/world/entity/monster/Slime.java b/src/main/java/net/minecraft/world/entity/monster/Slime.java
index 23cb972ca3fde409be0d6517ef8f1c58dab47ff4..476a9b2db5deac803f1cb3c2cbe88b69cc3da8e5 100644
index 2e343d108714bd136ab8e7b20acbf241166177de..382cdfd7d7dceeeffed1cdc34b9e475a69b5c76b 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Slime.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Slime.java
@@ -318,7 +318,7 @@ public class Slime extends Mob implements Enemy {
@@ -331,7 +331,7 @@ public class Slime extends Mob implements Enemy {
}
ChunkPos chunkcoordintpair = new ChunkPos(pos);
@ -18,10 +18,10 @@ index 23cb972ca3fde409be0d6517ef8f1c58dab47ff4..476a9b2db5deac803f1cb3c2cbe88b69
if (random.nextInt(10) == 0 && flag && pos.getY() < 40) {
return checkMobSpawnRules(type, world, spawnReason, pos, random);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
index 33677ec811ceab939c419bf7d31b99585e9a1ef1..8ae78690748b2cb5d5186d8859871c1630e10130 100644
index bf4b2f89d3a7133155c6272379c742318b2c1514..f07a6b1d782426581c84ffa19447c1375c4cbc07 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
@@ -169,7 +169,7 @@ public class CraftChunk implements Chunk {
@@ -213,7 +213,7 @@ public class CraftChunk implements Chunk {
@Override
public boolean isSlimeChunk() {
// 987234911L is deterimined in EntitySlime when seeing if a slime can spawn in a chunk

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Expose server CommandMap
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index fd9457a02f36b0230eb2d4fd549419f46d4b8da3..10ef586cbbeae40dbdf01232c416ba132229daa2 100644
index 3e3c3db4a9a4474af79d2470da2ab133eef7cf4c..5f87d8882cec191c6fe1cc194531ff4a24c85987 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2015,6 +2015,7 @@ public final class CraftServer implements Server {
@@ -2018,6 +2018,7 @@ public final class CraftServer implements Server {
return this.helpMap;
}

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Be a bit more informative in maxHealth exception
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 72ba8335d615fae73f7756003d0379117d2c73e7..b3fcbc3f5f0f8e9ca53fce85a4b86d4c292765df 100644
index 3f8914d800d6aceb02a1c2cbed9e5f9ecc471f86..6f1554cf7cb3707d757c40791695af679e919d28 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -102,7 +102,12 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {

View File

@ -5,12 +5,12 @@ Subject: [PATCH] Player Tab List and Title APIs
diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
index 9020bc6d9ff6bc0c9b3f00470813f3258554cf45..c2f56f4628e42c130e4c55030432cb43aa0d8458 100644
index 7720470396d3ade926c4c75c5fab5a3f435b0033..9c211b0db837b16d50aee63d0caf45e1a12bcc83 100644
--- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java
+++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
@@ -548,6 +548,11 @@ public class FriendlyByteBuf extends ByteBuf {
@@ -532,6 +532,11 @@ public class FriendlyByteBuf extends ByteBuf {
public FriendlyByteBuf writeComponent(final net.kyori.adventure.text.Component component) {
return this.writeUtf(PaperAdventure.asJsonString(component, this.adventure$locale), 262144);
return this.writeUtf(io.papermc.paper.adventure.PaperAdventure.asJsonString(component, this.adventure$locale), 262144);
}
+
+ @Deprecated
@ -63,7 +63,7 @@ index bd808eb312ade7122973a47f4b96505829511da5..bf0f9cab7c66c089f35b851e799ba4a4
// Paper end
buf.writeComponent(this.text);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index a3f85b1cf8b03da90f2461cbe42dd18a630f2255..7ecf67635dd004b030ee5dde10cd7a9a7f4676cf 100644
index 2acb5e73db4d629729c05373babd0d2e37122448..99410c3c7fc78ea64e3f12b95c79b51d9adf39f1 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1,5 +1,6 @@
@ -73,7 +73,7 @@ index a3f85b1cf8b03da90f2461cbe42dd18a630f2255..7ecf67635dd004b030ee5dde10cd7a9a
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableSet;
import com.google.common.io.BaseEncoding;
@@ -334,6 +335,100 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -294,6 +295,100 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
}

View File

@ -5,21 +5,21 @@ Subject: [PATCH] Add configurable portal search radius
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 30360e9e8787b893a360ba899d8fac657634de75..b1867fee71b925d6f5d76b0194d68dc2c6277ba0 100644
index 06e8a82d2001e2a8dd381f3be20ee7442e1d1178..3f627611fe372ab87701fb01e16486b434f77585 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3164,7 +3164,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -3148,7 +3148,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
double d0 = DimensionType.getTeleportationScale(this.level().dimensionType(), destination.dimensionType());
BlockPos blockposition = worldborder.clampToBounds(this.getX() * d0, this.getY(), this.getZ() * d0);
// CraftBukkit start
- CraftPortalEvent event = this.callPortalEvent(this, destination, new PositionImpl(blockposition.getX(), blockposition.getY(), blockposition.getZ()), PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, flag2 ? 16 : 128, 16);
- CraftPortalEvent event = this.callPortalEvent(this, destination, new Vec3(blockposition.getX(), blockposition.getY(), blockposition.getZ()), PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, flag2 ? 16 : 128, 16);
+ // Paper start
+ int portalSearchRadius = destination.paperConfig().environment.portalSearchRadius;
+ if (level.paperConfig().environment.portalSearchVanillaDimensionScaling && flag2) { // == THE_NETHER
+ portalSearchRadius = (int) (portalSearchRadius / destination.dimensionType().coordinateScale());
+ }
+ // Paper end
+ CraftPortalEvent event = this.callPortalEvent(this, destination, new PositionImpl(blockposition.getX(), blockposition.getY(), blockposition.getZ()), PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, portalSearchRadius, destination.paperConfig().environment.portalCreateRadius); // Paper start - configurable portal radius
+ CraftPortalEvent event = this.callPortalEvent(this, destination, new Vec3(blockposition.getX(), blockposition.getY(), blockposition.getZ()), PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, portalSearchRadius, destination.paperConfig().environment.portalCreateRadius); // Paper start - configurable portal radius
if (event == null) {
return null;
}

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add velocity warnings
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 10ef586cbbeae40dbdf01232c416ba132229daa2..c7849bda8cfaa9c6b581f180342687f30da0a639 100644
index 5f87d8882cec191c6fe1cc194531ff4a24c85987..4390e4ded8a88a0dcd57d161f74a276852de4800 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -299,6 +299,7 @@ public final class CraftServer implements Server {
@@ -302,6 +302,7 @@ public final class CraftServer implements Server {
public boolean ignoreVanillaPermissions = false;
private final List<CraftPlayer> playerView;
public int reloadCount;
@ -17,7 +17,7 @@ index 10ef586cbbeae40dbdf01232c416ba132229daa2..c7849bda8cfaa9c6b581f180342687f3
static {
ConfigurationSerialization.registerClass(CraftOfflinePlayer.class);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 1ccaf59479dce7b913037f232bb37bdbc75b98a8..5a307e3bf2fc48a74e8c42372f3422fd32224133 100644
index 9b4e28353892240debc2d2d48876c5640d479ae9..5767eefb09d9e0e3a3d5a006242220b844d28055 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -471,10 +471,40 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@ -62,10 +62,10 @@ index 1ccaf59479dce7b913037f232bb37bdbc75b98a8..5a307e3bf2fc48a74e8c42372f3422fd
public double getHeight() {
return this.getHandle().getBbHeight();
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
index 11d7ede26b46d0bf9cced65e8c3bcc41c8b66dbf..3ad14bf0697e682a2e777baa8faeb323d127fb13 100644
index d5863b0b06384b25eaa33572fa02649795463ed8..2693cc933d746e40d8a47d96c6cb6799f0a2472f 100644
--- a/src/main/java/org/spigotmc/WatchdogThread.java
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
@@ -80,7 +80,19 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
@@ -80,7 +80,19 @@ public class WatchdogThread extends Thread
log.log( Level.SEVERE, "During the run of the server, a physics stackoverflow was supressed" );
log.log( Level.SEVERE, "near " + net.minecraft.world.level.Level.lastPhysicsProblem );
}
@ -85,4 +85,4 @@ index 11d7ede26b46d0bf9cced65e8c3bcc41c8b66dbf..3ad14bf0697e682a2e777baa8faeb323
+ // Paper end
log.log( Level.SEVERE, "------------------------------" );
log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Paper!):" ); // Paper
io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.dumpAllChunkLoadInfo(isLongTimeout); // Paper // Paper - rewrite chunk system
WatchdogThread.dumpThread( ManagementFactory.getThreadMXBean().getThreadInfo( MinecraftServer.getServer().serverThread.getId(), Integer.MAX_VALUE ), log );

View File

@ -16,10 +16,10 @@ The wanted destination was on top of the emerald block however the player ended
This only is the case if the player is teleporting between worlds.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 7ecf67635dd004b030ee5dde10cd7a9a7f4676cf..5c91414ca72609a89599baa9fba9774c5923ad10 100644
index 99410c3c7fc78ea64e3f12b95c79b51d9adf39f1..6f4829dede7dca4b3d51818f8779b3438216d3b4 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1160,7 +1160,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1120,7 +1120,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
entity.connection.teleport(to);
} else {
// The respawn reason should never be used if the passed location is non null.

View File

@ -49,7 +49,7 @@ index 0000000000000000000000000000000000000000..f699ce18ca044f813e194ef2786b7ea8
+ }
+}
diff --git a/src/main/java/net/minecraft/server/players/OldUsersConverter.java b/src/main/java/net/minecraft/server/players/OldUsersConverter.java
index 439ff01be1521c283d60cacb110fcb4993933057..da98f074ccd5a40c635824112c97fd174c393cb1 100644
index 0650b1eee2ae8caa5268f4df82f740440ce16fdf..0214830d9bc98b8d435ff11f40df65596980cf77 100644
--- a/src/main/java/net/minecraft/server/players/OldUsersConverter.java
+++ b/src/main/java/net/minecraft/server/players/OldUsersConverter.java
@@ -1,5 +1,6 @@
@ -59,7 +59,7 @@ index 439ff01be1521c283d60cacb110fcb4993933057..da98f074ccd5a40c635824112c97fd17
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.io.Files;
@@ -363,6 +364,7 @@ public class OldUsersConverter {
@@ -358,6 +359,7 @@ public class OldUsersConverter {
root = NbtIo.readCompressed(new java.io.FileInputStream(file5));
} catch (Exception exception) {
exception.printStackTrace();
@ -67,7 +67,7 @@ index 439ff01be1521c283d60cacb110fcb4993933057..da98f074ccd5a40c635824112c97fd17
}
if (root != null) {
@@ -376,6 +378,7 @@ public class OldUsersConverter {
@@ -371,6 +373,7 @@ public class OldUsersConverter {
NbtIo.writeCompressed(root, new java.io.FileOutputStream(file2));
} catch (Exception exception) {
exception.printStackTrace();
@ -88,7 +88,7 @@ index c6fb4c33d7ea52b88d8fc0d90748cbab7387c565..fed09b886f4fa0006d160e5f2abb00df
}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 78041052d7ab2e6b60405ce7e02468458650db22..8149286827d9b609be47a4ded0413ca11f7858de 100644
index 42e81640354c2679570823347b28ee1155e7a00e..a7fb12648c2e655e191d8c805753ae0c05421d17 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1,5 +1,10 @@
@ -102,7 +102,7 @@ index 78041052d7ab2e6b60405ce7e02468458650db22..8149286827d9b609be47a4ded0413ca1
import com.google.common.collect.Lists;
import com.mojang.serialization.Codec;
import java.io.IOException;
@@ -730,6 +735,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -725,6 +730,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// Paper start - Prevent tile entity and entity crashes
final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level().getWorld().getName(), entity.getX(), entity.getY(), entity.getZ());
MinecraftServer.LOGGER.error(msg, throwable);
@ -111,7 +111,7 @@ index 78041052d7ab2e6b60405ce7e02468458650db22..8149286827d9b609be47a4ded0413ca1
// Paper end
}
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
index f1675e35be0ab7670c875c6b0d1e982a3ae09d1e..b2bb9bbd3af414c50ec3f8e3e171a679e95ef75e 100644
index 5d65baba605dd83e5f74d526aeda36d8ede8c014..92e76dd39dc3575e9466031dd799080a98ad8b8d 100644
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
@@ -291,6 +291,7 @@ public final class NaturalSpawner {
@ -131,7 +131,7 @@ index f1675e35be0ab7670c875c6b0d1e982a3ae09d1e..b2bb9bbd3af414c50ec3f8e3e171a679
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
index 1f635d06dcff8672e9bdaf29fba6fdf39618f893..36701f196756dc7c6820cac516ff880d00a43b17 100644
index 28ae0792c6b83580369937673f475f79b1c19576..0b246935d0ad3f8a78e86f0e60f53a05efda8355 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -1,6 +1,7 @@
@ -163,7 +163,7 @@ index 1f635d06dcff8672e9bdaf29fba6fdf39618f893..36701f196756dc7c6820cac516ff880d
// CraftBukkit end
}
}
@@ -1149,6 +1156,7 @@ public class LevelChunk extends ChunkAccess {
@@ -1060,6 +1067,7 @@ public class LevelChunk extends ChunkAccess {
// Paper start - Prevent tile entity and entity crashes
final String msg = String.format("BlockEntity threw exception at %s:%s,%s,%s", LevelChunk.this.getLevel().getWorld().getName(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ());
net.minecraft.server.MinecraftServer.LOGGER.error(msg, throwable);
@ -172,10 +172,10 @@ index 1f635d06dcff8672e9bdaf29fba6fdf39618f893..36701f196756dc7c6820cac516ff880d
// Paper end
// Spigot start
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
index e68205fe7169c7c5b7c6fdada2ee97d86107ca97..aa8972fd1a1fade05d60ab69efb8ff24f344508a 100644
index d9daf07132c46548964a75588b69d7a74680e917..67a2f3c02aa4983b3ec2df073821190ddb36543c 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
@@ -275,6 +275,7 @@ public class RegionFile implements AutoCloseable {
@@ -274,6 +274,7 @@ public class RegionFile implements AutoCloseable {
return true;
}
} catch (IOException ioexception) {
@ -183,7 +183,7 @@ index e68205fe7169c7c5b7c6fdada2ee97d86107ca97..aa8972fd1a1fade05d60ab69efb8ff24
return false;
}
}
@@ -356,6 +357,7 @@ public class RegionFile implements AutoCloseable {
@@ -355,6 +356,7 @@ public class RegionFile implements AutoCloseable {
((java.nio.Buffer) buf).position(5); // CraftBukkit - decompile error
filechannel.write(buf);
} catch (Throwable throwable) {

View File

@ -11,10 +11,10 @@ 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/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index b1867fee71b925d6f5d76b0194d68dc2c6277ba0..2d37f4da83282e3430353e01c756a0d952150360 100644
index 3f627611fe372ab87701fb01e16486b434f77585..9c17aef67d011f485129aee781aae3bd18eb6c1c 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2795,6 +2795,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -2779,6 +2779,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@Nullable
public Team getTeam() {
@ -23,7 +23,7 @@ index b1867fee71b925d6f5d76b0194d68dc2c6277ba0..2d37f4da83282e3430353e01c756a0d9
}
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 5dda05f7bf08dec8b48fe0b87aa227c3e0392c6f..ddf083a54015f943e3e00ae6d5f73f8e127f6dc2 100644
index c1eb34c19ce713d750f8628b69e9c4dc5cbf9a02..edaa25912a2de7122e2786f2a9c0cae796303de1 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -833,6 +833,7 @@ public abstract class LivingEntity extends Entity implements Attackable {

View File

@ -7,7 +7,7 @@ Upstream added methods for this, original methods are now
deprecated
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index b3fcbc3f5f0f8e9ca53fce85a4b86d4c292765df..bba6bce470a11c792bb2edc2171021437e2c9704 100644
index 6f1554cf7cb3707d757c40791695af679e919d28..184ba082edac85a7df16eeebc4473a1a193b6a26 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -267,9 +267,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Chunk Save Reattempt
We commonly have "Stream Closed" errors on chunk saving, so this code should re-try to save the chunk in the event of failure and hopefully prevent rollbacks.
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
index aa8972fd1a1fade05d60ab69efb8ff24f344508a..ddcc212ba83d9365adb842b3d3ced64e3d7dd155 100644
index 67a2f3c02aa4983b3ec2df073821190ddb36543c..9e65b56fd2d5af6be305efa08e7c569e6598343a 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
@@ -275,7 +275,7 @@ public class RegionFile implements AutoCloseable {
@@ -274,7 +274,7 @@ public class RegionFile implements AutoCloseable {
return true;
}
} catch (IOException ioexception) {
@ -19,18 +19,18 @@ index aa8972fd1a1fade05d60ab69efb8ff24f344508a..ddcc212ba83d9365adb842b3d3ced64e
}
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
index fe8bb0037bb7f317fc32ac34461f4eb3a1f397f2..a16047cab2709d197489215de66bf24901523a1c 100644
index 216f527334a5ee5007633ede6abfc0abe3e0e829..8fc4eb15732536c5f8c49c7914071d3c7667f340 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
@@ -208,6 +208,7 @@ public class RegionFileStorage implements AutoCloseable {
}
// Paper end - rewrite chunk system
try { // Paper
@@ -132,6 +132,7 @@ public final class RegionFileStorage implements AutoCloseable {
protected void write(ChunkPos pos, @Nullable CompoundTag nbt) throws IOException {
RegionFile regionfile = this.getRegionFile(pos, false); // CraftBukkit
+ int attempts = 0; Exception laste = null; while (attempts++ < 5) { try { // Paper
if (nbt == null) {
regionfile.clear(pos);
@@ -232,7 +233,18 @@ public class RegionFileStorage implements AutoCloseable {
@@ -156,7 +157,18 @@ public final class RegionFileStorage implements AutoCloseable {
dataoutputstream.close();
}
}
@ -46,6 +46,6 @@ index fe8bb0037bb7f317fc32ac34461f4eb3a1f397f2..a16047cab2709d197489215de66bf249
+ net.minecraft.server.MinecraftServer.LOGGER.error("Failed to save chunk " + pos, laste);
+ }
+ // Paper end
} finally { // Paper start
regionfile.fileLock.unlock();
} // Paper end
}
public void close() throws IOException {

View File

@ -4,29 +4,28 @@ Date: Sat, 4 Apr 2015 23:17:52 -0400
Subject: [PATCH] Complete resource pack API
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index a4f0cb93a08136888a81f1a8e7ed1d56f92e2195..1c84143d271e70f6ffea301f3e93cd8ed8fd9bd1 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1760,8 +1760,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
ServerGamePacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack rejection", this.player.getName());
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index b9062fe651de34d5b3f9d5f146ae0b4fe29cbfee..e8b12a8ae009023afa2818ecbf398a1440b9926e 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -156,7 +156,11 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
ServerCommonPacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack rejection", this.playerProfile().getName());
this.disconnect(Component.translatable("multiplayer.requiredTexturePrompt.disconnect"));
}
- this.cserver.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(this.getCraftPlayer(), PlayerResourcePackStatusEvent.Status.values()[packet.action.ordinal()])); // CraftBukkit
-
- this.cserver.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(this.getCraftPlayer(), PlayerResourcePackStatusEvent.Status.values()[packet.getAction().ordinal()])); // CraftBukkit
+ // Paper start
+ PlayerResourcePackStatusEvent.Status packStatus = PlayerResourcePackStatusEvent.Status.values()[packet.action.ordinal()];
+ PlayerResourcePackStatusEvent.Status packStatus = PlayerResourcePackStatusEvent.Status.values()[packet.getAction().ordinal()];
+ player.getBukkitEntity().setResourcePackStatus(packStatus);
+ this.cserver.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(this.getCraftPlayer(), packStatus)); // CraftBukkit
+ // Paper end
}
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 5c91414ca72609a89599baa9fba9774c5923ad10..038c34e62903afd19fb25b2125d5ed243e081139 100644
index 6f4829dede7dca4b3d51818f8779b3438216d3b4..a4b9dd757ddc31447fc4b284a63fc0b28a039fb0 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -189,6 +189,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -191,6 +191,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
private double healthScale = 20;
private CraftWorldBorder clientWorldBorder = null;
private BorderChangeListener clientWorldBorderListener = this.createWorldBorderListener();
@ -37,7 +36,7 @@ index 5c91414ca72609a89599baa9fba9774c5923ad10..038c34e62903afd19fb25b2125d5ed24
public CraftPlayer(CraftServer server, ServerPlayer entity) {
super(server, entity);
@@ -2352,6 +2356,45 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -2326,6 +2330,45 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public boolean getAffectsSpawning() {
return this.getHandle().affectsSpawning;
}

View File

@ -16,10 +16,10 @@ modify that. Under the previous logic, plugins were unable (cleanly) override pe
A config option has been added for those who depend on the previous behavior, but I don't expect that.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index c7849bda8cfaa9c6b581f180342687f30da0a639..6a435ae10003b854d387cfc393b9b526cfcbf0a7 100644
index 4390e4ded8a88a0dcd57d161f74a276852de4800..068cde0c7061b4969e095a4a93cd8a1662079211 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -462,6 +462,7 @@ public final class CraftServer implements Server {
@@ -465,6 +465,7 @@ public final class CraftServer implements Server {
if (type == PluginLoadOrder.STARTUP) {
this.helpMap.clear();
this.helpMap.initializeGeneralTopics();
@ -27,7 +27,7 @@ index c7849bda8cfaa9c6b581f180342687f30da0a639..6a435ae10003b854d387cfc393b9b526
}
Plugin[] plugins = this.pluginManager.getPlugins();
@@ -481,7 +482,7 @@ public final class CraftServer implements Server {
@@ -484,7 +485,7 @@ public final class CraftServer implements Server {
this.commandMap.registerServerAliases();
DefaultPermissions.registerCorePermissions();
CraftDefaultPermissions.registerCorePermissions();

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Custom Permissions
https://github.com/PaperMC/Paper/issues/49
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 6a435ae10003b854d387cfc393b9b526cfcbf0a7..de50d84008851b44fe8999affbb6c2ac8e376cf3 100644
index 068cde0c7061b4969e095a4a93cd8a1662079211..d0dea86da026827163e36b9fc970bd9ab630b0b8 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2619,5 +2619,23 @@ public final class CraftServer implements Server {
@@ -2622,5 +2622,23 @@ public final class CraftServer implements Server {
}
return this.adventure$audiences;
}

View File

@ -7,10 +7,10 @@ Metadata is not meant to persist reload as things break badly with non primitive
This will remove metadata on reload so it does not crash everything if a plugin uses it.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index de50d84008851b44fe8999affbb6c2ac8e376cf3..1f294e7841de880ebe99e02265ba28ce8c932d07 100644
index d0dea86da026827163e36b9fc970bd9ab630b0b8..6797239634ba90768e55fcfb37cb2c14141b7d28 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -953,8 +953,16 @@ public final class CraftServer implements Server {
@@ -956,8 +956,16 @@ public final class CraftServer implements Server {
world.spigotConfig.init(); // Spigot
}

View File

@ -18,10 +18,10 @@ For consistency, the old API methods now forward to use the
ItemMeta API equivalents, and should deprecate the old API's.
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index 3f18fb61a47dda559a6997af9c6c043423dd206a..c33660718c0ea281d7bcdb15df0568d4d46547e2 100644
index 1b2c0fda262ca6d5bd2ce22bc2e934803bd6f602..cae548dbb5a3027e2de0bfbe38918ec7c2803e8e 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -156,6 +156,23 @@ public final class ItemStack {
@@ -157,6 +157,23 @@ public final class ItemStack {
return this.getItem().getTooltipImage(this);
}
@ -45,7 +45,7 @@ index 3f18fb61a47dda559a6997af9c6c043423dd206a..c33660718c0ea281d7bcdb15df0568d4
public ItemStack(ItemLike item) {
this(item, 1);
}
@@ -204,6 +221,7 @@ public final class ItemStack {
@@ -205,6 +222,7 @@ public final class ItemStack {
// CraftBukkit start - make defensive copy as this data may be coming from the save thread
this.tag = nbttagcompound.getCompound("tag").copy();
// CraftBukkit end
@ -53,7 +53,7 @@ index 3f18fb61a47dda559a6997af9c6c043423dd206a..c33660718c0ea281d7bcdb15df0568d4
this.getItem().verifyTagAfterLoad(this.tag);
}
@@ -814,6 +832,7 @@ public final class ItemStack {
@@ -819,6 +837,7 @@ public final class ItemStack {
public void setTag(@Nullable CompoundTag nbt) {
this.tag = nbt;
@ -61,7 +61,7 @@ index 3f18fb61a47dda559a6997af9c6c043423dd206a..c33660718c0ea281d7bcdb15df0568d4
if (this.getItem().canBeDepleted()) {
this.setDamageValue(this.getDamageValue());
}
@@ -1111,6 +1130,7 @@ public final class ItemStack {
@@ -1116,6 +1135,7 @@ public final class ItemStack {
ListTag nbttaglist = this.tag.getList("Enchantments", 10);
nbttaglist.add(EnchantmentHelper.storeEnchantment(EnchantmentHelper.getEnchantmentId(enchantment), (byte) level));

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Configurable Non Player Arrow Despawn Rate
Can set a much shorter despawn rate for arrows that players can not pick up.
diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
index 37356efff435444b29d6d6682f365a329ebdd92e..7acd5d9fb7f7d3e067de779a9e3f0cedb587c68a 100644
index 5268821d343aa6834b81e6598158c50b600e66ce..61a23f67c71116881bab9febf8db219a6c0b98a1 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
@@ -312,7 +312,7 @@ public abstract class AbstractArrow extends Projectile {

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Add World Util Methods
Methods that can be used for other patches to help improve logic.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index e253531f5da93d2a5b328e1af6eef2a6d9a72bc1..d48ad601dc9f8b3ed3bc0e2dd068981eb7613c30 100644
index 511f27358cad1fa067497914c61855ee6ea3846a..c5974d23eb2c0f0a71a5c438f387762516f7a1d9 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -221,7 +221,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@ -19,7 +19,7 @@ index e253531f5da93d2a5b328e1af6eef2a6d9a72bc1..d48ad601dc9f8b3ed3bc0e2dd068981e
}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 8149286827d9b609be47a4ded0413ca11f7858de..809f7db469583ea90fbb165cf180dc87055c6105 100644
index a7fb12648c2e655e191d8c805753ae0c05421d17..5e4b102e747a053280871879c3c18fc3d3d2d18a 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -342,6 +342,22 @@ public abstract class Level implements LevelAccessor, AutoCloseable {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Custom replacement for eaten items
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index ddf083a54015f943e3e00ae6d5f73f8e127f6dc2..d8ecc90465dfc54319d7f2478979e9aaee42f5a2 100644
index edaa25912a2de7122e2786f2a9c0cae796303de1..21ad3b6c1105bc22a30137d57a6e8ba0e4233c2b 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3639,10 +3639,11 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -3699,10 +3699,11 @@ public abstract class LivingEntity extends Entity implements Attackable {
this.triggerItemUseEffects(this.useItem, 16);
// CraftBukkit start - fire PlayerItemConsumeEvent
ItemStack itemstack;
@ -21,7 +21,7 @@ index ddf083a54015f943e3e00ae6d5f73f8e127f6dc2..d8ecc90465dfc54319d7f2478979e9aa
this.level().getCraftServer().getPluginManager().callEvent(event);
if (event.isCancelled()) {
@@ -3656,6 +3657,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -3716,6 +3717,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
} else {
itemstack = this.useItem.finishUsingItem(this.level(), this);
}
@ -34,7 +34,7 @@ index ddf083a54015f943e3e00ae6d5f73f8e127f6dc2..d8ecc90465dfc54319d7f2478979e9aa
// CraftBukkit end
if (itemstack != this.useItem) {
@@ -3663,6 +3670,11 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -3723,6 +3730,11 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
this.stopUsingItem();

View File

@ -26,10 +26,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index d8ecc90465dfc54319d7f2478979e9aaee42f5a2..53e666df97e74bbb8e96207ebc50e3e9acc455de 100644
index 21ad3b6c1105bc22a30137d57a6e8ba0e4233c2b..c5d4f36dda7c977b3a7563f4d2d74ebcf7dc61ef 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3407,7 +3407,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -3467,7 +3467,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
Vec3 vec3d = new Vec3(this.getX(), this.getEyeY(), this.getZ());
Vec3 vec3d1 = new Vec3(entity.getX(), entity.getEyeY(), entity.getZ());
@ -63,7 +63,7 @@ index d6d8bbc98fc71997cb52521d59ebb59d727d3c22..3b31a1927aaed7fffc1b4f4bcefc1212
default BlockHitResult clip(ClipContext raytrace1, BlockPos blockposition) {
BlockState iblockdata = this.getBlockState(blockposition);
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 809f7db469583ea90fbb165cf180dc87055c6105..37d5abf5a18b90695d1cea9e365c764e93b918bf 100644
index 5e4b102e747a053280871879c3c18fc3d3d2d18a..a64b4eb9bc6437cc143ed6816060b223ce6542e6 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -283,6 +283,90 @@ public abstract class Level implements LevelAccessor, AutoCloseable {

View File

@ -5,25 +5,25 @@ Subject: [PATCH] handle NaN health/absorb values and repair bad data
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 53e666df97e74bbb8e96207ebc50e3e9acc455de..8435d0c62c716d4cce5d8b512d8a42658f774876 100644
index c5d4f36dda7c977b3a7563f4d2d74ebcf7dc61ef..fa03c3a9debe419dd4e60764de4d9544de1ae0f3 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -794,7 +794,13 @@ public abstract class LivingEntity extends Entity implements Attackable {
@Override
public void readAdditionalSaveData(CompoundTag nbt) {
- this.setAbsorptionAmount(nbt.getFloat("AbsorptionAmount"));
- this.internalSetAbsorptionAmount(nbt.getFloat("AbsorptionAmount"));
+ // Paper start - jvm keeps optimizing the setter
+ float absorptionAmount = nbt.getFloat("AbsorptionAmount");
+ if (Float.isNaN(absorptionAmount)) {
+ absorptionAmount = 0;
+ }
+ this.setAbsorptionAmount(absorptionAmount);
+ this.internalSetAbsorptionAmount(absorptionAmount);
+ // Paper end
if (nbt.contains("Attributes", 9) && this.level() != null && !this.level().isClientSide) {
this.getAttributes().load(nbt.getList("Attributes", 10));
}
@@ -1312,6 +1318,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -1344,6 +1350,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
public void setHealth(float health) {
@ -34,20 +34,20 @@ index 53e666df97e74bbb8e96207ebc50e3e9acc455de..8435d0c62c716d4cce5d8b512d8a4265
// CraftBukkit start - Handle scaled health
if (this instanceof ServerPlayer) {
org.bukkit.craftbukkit.entity.CraftPlayer player = ((ServerPlayer) this).getBukkitEntity();
@@ -3472,7 +3482,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -3532,7 +3542,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
public void setAbsorptionAmount(float amount) {
- if (amount < 0.0F) {
+ if (amount < 0.0F || Float.isNaN(amount)) { // Paper
amount = 0.0F;
public final void setAbsorptionAmount(float absorptionAmount) {
- this.internalSetAbsorptionAmount(Mth.clamp(absorptionAmount, 0.0F, this.getMaxAbsorption()));
+ this.internalSetAbsorptionAmount(!Float.isNaN(absorptionAmount) ? Mth.clamp(absorptionAmount, 0.0F, this.getMaxAbsorption()) : 0.0F); // Paper
}
protected void internalSetAbsorptionAmount(float absorptionAmount) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 038c34e62903afd19fb25b2125d5ed243e081139..4e85199be8a1a7472d13856a697ec500b9566341 100644
index a4b9dd757ddc31447fc4b284a63fc0b28a039fb0..6deb65557561268ae7126cbb9e177def16d89d97 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2149,6 +2149,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -2123,6 +2123,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
public void setRealHealth(double health) {

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Use a Shared Random for Entities
Reduces memory usage and provides ensures more randomness, Especially since a lot of garbage entity objects get created.
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 2d37f4da83282e3430353e01c756a0d952150360..2f15c9df59ebfbe7619e190b8d6ef1fe122809f8 100644
index 9c17aef67d011f485129aee781aae3bd18eb6c1c..6dc250da442ae15a69c40e10af7ea71d9aaf0055 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -162,6 +162,79 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@ -89,7 +89,7 @@ index 2d37f4da83282e3430353e01c756a0d952150360..2f15c9df59ebfbe7619e190b8d6ef1fe
private CraftEntity bukkitEntity;
public CraftEntity getBukkitEntity() {
@@ -406,7 +479,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -354,7 +427,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
this.bb = Entity.INITIAL_AABB;
this.stuckSpeedMultiplier = Vec3.ZERO;
this.nextStep = 1.0F;

View File

@ -5,11 +5,11 @@ Subject: [PATCH] Configurable spawn chances for skeleton horses
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index d48ad601dc9f8b3ed3bc0e2dd068981eb7613c30..5cde98b0225799bccdb84ce6b6cf06b904d5986c 100644
index c5974d23eb2c0f0a71a5c438f387762516f7a1d9..3310ad37178c6397e00291186a518bffce876570 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -837,7 +837,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
blockposition = this.findLightningTargetAround(this.getBlockRandomPos(j, 0, k, 15));
@@ -598,7 +598,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (this.isRainingAt(blockposition)) {
DifficultyInstance difficultydamagescaler = this.getCurrentDifficultyAt(blockposition);
- boolean flag1 = this.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.getEffectiveDifficulty() * 0.01D && !this.getBlockState(blockposition.below()).is(Blocks.LIGHTNING_ROD);

View File

@ -29,7 +29,7 @@ index 1b29c6872ebe54351f28c1f1f38b22561ba785ee..40950db0c242c65dfd4de247c8624935
this.x = x;
this.y = y;
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 37d5abf5a18b90695d1cea9e365c764e93b918bf..5502d037279ba876f5e4c6728cc678f128bce9d4 100644
index a64b4eb9bc6437cc143ed6816060b223ce6542e6..f96154f86a260ecd8dbd485a1c72703bc5949de2 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -368,7 +368,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@ -88,7 +88,7 @@ index 60e760b42dd6471a229dfd45490dcf8c51979d35..4a3ac7dedf5cb1e76f16ec4f18e82afc
@Override
public FluidState getFluidState(BlockPos pos) {
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
index 36701f196756dc7c6820cac516ff880d00a43b17..72637bb342f1260debf925f5b3fde8ec7dd3cfff 100644
index 0b246935d0ad3f8a78e86f0e60f53a05efda8355..d84b4051ee5177e9916199ec11445fc6c9a18936 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -295,12 +295,29 @@ public class LevelChunk extends ChunkAccess {

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Only process BlockPhysicsEvent if a plugin has a listener
Saves on some object allocation and processing when no plugin listens to this
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index ebfc20247ac5a548e6616a099b8885db9c7a8d25..4b9de3ca81b60eb4a916006cdfbc2a630a390a39 100644
index d57ac9e0b58ae30ade85c07a6d5d8af922ffea24..0f2fad44d1ab2188f79839bb13e3988a2847520f 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1364,6 +1364,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1357,6 +1357,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
while (iterator.hasNext()) {
ServerLevel worldserver = (ServerLevel) iterator.next();
@ -18,7 +18,7 @@ index ebfc20247ac5a548e6616a099b8885db9c7a8d25..4b9de3ca81b60eb4a916006cdfbc2a63
this.profiler.push(() -> {
return worldserver + " " + worldserver.dimension().location();
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 5cde98b0225799bccdb84ce6b6cf06b904d5986c..699fc5f11efa8240723854cd2e91877b278f9495 100644
index 3310ad37178c6397e00291186a518bffce876570..db86df427b604e4a0959181eb2ee161bdda6bfad 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -220,6 +220,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@ -30,10 +30,10 @@ index 5cde98b0225799bccdb84ce6b6cf06b904d5986c..699fc5f11efa8240723854cd2e91877b
@Override public LevelChunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI
return this.chunkSource.getChunk(x, z, false);
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 5502d037279ba876f5e4c6728cc678f128bce9d4..ba7760b0b478c6f24dcbaa64919a4766e107a720 100644
index f96154f86a260ecd8dbd485a1c72703bc5949de2..c771ec0e5ebd4a45130b3481fa9d3ba00b95f2ae 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -580,7 +580,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -575,7 +575,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// CraftBukkit start
iblockdata1.updateIndirectNeighbourShapes(this, blockposition, k, j - 1); // Don't call an event for the old block to limit event spam
CraftWorld world = ((ServerLevel) this).getWorld();

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Entity AddTo/RemoveFrom World Events
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 699fc5f11efa8240723854cd2e91877b278f9495..7da059a2e8560250021654f3d5586027c15c7dd3 100644
index db86df427b604e4a0959181eb2ee161bdda6bfad..71e448a44b1d85bba4481fd02612d687aa9df4a1 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2373,6 +2373,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -2117,6 +2117,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
entity.setOrigin(entity.getOriginVector().toLocation(getWorld()));
}
// Paper end
@ -16,7 +16,7 @@ index 699fc5f11efa8240723854cd2e91877b278f9495..7da059a2e8560250021654f3d5586027
}
public void onTrackingEnd(Entity entity) {
@@ -2448,6 +2449,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -2192,6 +2193,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
}
// CraftBukkit end

View File

@ -11,7 +11,7 @@ For people who want all chunks to be treated equally, you can chose a fixed valu
This allows to fine-tune vanilla gameplay.
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
index 72637bb342f1260debf925f5b3fde8ec7dd3cfff..704f0500649acdbff2caf94f702a6685ecf4c986 100644
index d84b4051ee5177e9916199ec11445fc6c9a18936..fdb8c2346cb2e444b75f863a8a8199da84f25193 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -280,6 +280,13 @@ public class LevelChunk extends ChunkAccess {

View File

@ -6,7 +6,7 @@ Subject: [PATCH] EntityPathfindEvent
Fires when an Entity decides to start moving to a location.
diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/FlyingPathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/FlyingPathNavigation.java
index a8f69e48937b3ebd2f57a4da747e6762c4a77934..acd0b946cab86eb173e713535194d3a9347c7d48 100644
index 3db41017c6690d4519564496edd8e7365b2f5a22..027eef4ace908147285c8d72b612d16e4f925672 100644
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/FlyingPathNavigation.java
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/FlyingPathNavigation.java
@@ -40,7 +40,7 @@ public class FlyingPathNavigation extends PathNavigation {
@ -19,18 +19,19 @@ index a8f69e48937b3ebd2f57a4da747e6762c4a77934..acd0b946cab86eb173e713535194d3a9
@Override
diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/GroundPathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/GroundPathNavigation.java
index 518f47f52105e299e037fe2e7d5870d7555be4bc..71934af2dc4d209a9fbccfd36b5f2815ec196892 100644
index 12564909abff7da4e5a4bb3d004a7ede2ffda12d..c0550a87dbc79090ccac8568186f22a49bb3837f 100644
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/GroundPathNavigation.java
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/GroundPathNavigation.java
@@ -39,14 +39,14 @@ public class GroundPathNavigation extends PathNavigation {
@@ -41,7 +41,7 @@ public class GroundPathNavigation extends PathNavigation {
}
@Override
- public Path createPath(BlockPos target, int distance) {
+ public Path createPath(BlockPos target, @javax.annotation.Nullable Entity entity, int distance) { // Paper
if (this.level.getBlockState(target).isAir()) {
BlockPos blockPos;
for(blockPos = target.below(); blockPos.getY() > this.level.getMinBuildHeight() && this.level.getBlockState(blockPos).isAir(); blockPos = blockPos.below()) {
LevelChunk levelChunk = this.level.getChunkSource().getChunkNow(SectionPos.blockToSectionCoord(target.getX()), SectionPos.blockToSectionCoord(target.getZ()));
if (levelChunk == null) {
return null;
@@ -52,7 +52,7 @@ public class GroundPathNavigation extends PathNavigation {
}
if (blockPos.getY() > this.level.getMinBuildHeight()) {
@ -38,22 +39,16 @@ index 518f47f52105e299e037fe2e7d5870d7555be4bc..71934af2dc4d209a9fbccfd36b5f2815
+ return super.createPath(blockPos.above(), entity, distance); // Paper
}
while(blockPos.getY() < this.level.getMaxBuildHeight() && this.level.getBlockState(blockPos).isAir()) {
@@ -57,19 +57,19 @@ public class GroundPathNavigation extends PathNavigation {
}
if (!this.level.getBlockState(target).isSolid()) {
- return super.createPath(target, distance);
+ return super.createPath(target, entity, distance); // Paper
} else {
BlockPos blockPos2;
for(blockPos2 = target.above(); blockPos2.getY() < this.level.getMaxBuildHeight() && this.level.getBlockState(blockPos2).isSolid(); blockPos2 = blockPos2.above()) {
while(blockPos.getY() < this.level.getMaxBuildHeight() && levelChunk.getBlockState(blockPos).isAir()) {
@@ -69,14 +69,14 @@ public class GroundPathNavigation extends PathNavigation {
for(blockPos2 = target.above(); blockPos2.getY() < this.level.getMaxBuildHeight() && levelChunk.getBlockState(blockPos2).isSolid(); blockPos2 = blockPos2.above()) {
}
- return super.createPath(blockPos2, distance);
+ return super.createPath(blockPos2, entity, distance); // Paper
}
}
}
@Override
public Path createPath(Entity entity, int distance) {
@ -63,7 +58,7 @@ index 518f47f52105e299e037fe2e7d5870d7555be4bc..71934af2dc4d209a9fbccfd36b5f2815
private int getSurfaceY() {
diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
index f16e9bcefedb582a4bfe7a0b7ec8a97799f5e5ad..1a69a46340eee4f0273c373cc1a40b4d069a89d4 100644
index fa19df17967f57b5ac99b8eee9d38864c0b7a1bb..d14b329e5bccf13139c32f71da274082efc7199c 100644
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
@@ -110,7 +110,13 @@ public abstract class PathNavigation {

View File

@ -11,13 +11,13 @@ The implementation uses a LinkedHashMap as an LRU cache (modified from HashMap).
The maximum size of the RegionFileCache is also made configurable.
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
index a16047cab2709d197489215de66bf24901523a1c..4c1b1ac36ef09a9cc8da6e8ee71f82d4a67478df 100644
index 8fc4eb15732536c5f8c49c7914071d3c7667f340..81710e2853a75a47edd0abf3f5b30f8558b5abcd 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
@@ -91,7 +91,7 @@ public class RegionFileStorage implements AutoCloseable {
return null;
}
// Paper end - cache regionfile does not exist state
@@ -37,7 +37,7 @@ public final class RegionFileStorage implements AutoCloseable {
if (regionfile != null) {
return regionfile;
} else {
- if (this.regionCache.size() >= 256) {
+ if (this.regionCache.size() >= io.papermc.paper.configuration.GlobalConfiguration.get().misc.regionFileCacheSize) { // Paper - configurable
((RegionFile) this.regionCache.removeLast()).close();

View File

@ -28,10 +28,10 @@ index 644a0fdea6576647539b96528717dbaeab498d93..221e64a66ff12a8de5c75992fc26a54a
+ // Paper end - PlayerUseUnknownEntityEvent
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 1c84143d271e70f6ffea301f3e93cd8ed8fd9bd1..6b87ed8b453b149bdd74eb3b164aa3bbcc8c2b13 100644
index 0f264a3efe33935df463cc8048bc70ab14526386..e58a87d933b916dd246f392577432d8022f117f7 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2522,8 +2522,38 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -2386,8 +2386,38 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
});
}
}

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Fix Cancelling BlockPlaceEvent triggering physics
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 7da059a2e8560250021654f3d5586027c15c7dd3..35b59c83a35bc3a4d05bc95b0caec1f1865589c0 100644
index 71e448a44b1d85bba4481fd02612d687aa9df4a1..f0820ab21ff17601c896099d664d18283c759384 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1598,6 +1598,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1366,6 +1366,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@Override
public void updateNeighborsAt(BlockPos pos, Block sourceBlock) {

View File

@ -18,10 +18,10 @@ index 1294b38262505b0d54089e428df9b363219de1f0..ee37ec0de1ca969144824427ae42b0c8
buf.writeComponent(this.playerPrefix);
buf.writeComponent(this.playerSuffix);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 4b9de3ca81b60eb4a916006cdfbc2a630a390a39..bb8546e5f7f223cb499ab404845aba524726ea16 100644
index 0f2fad44d1ab2188f79839bb13e3988a2847520f..9855ea8c2a13950782b07915bd2ffe68404d571e 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -586,6 +586,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -575,6 +575,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(worldserver.getWorld()));
}
@ -43,18 +43,18 @@ index 4b9de3ca81b60eb4a916006cdfbc2a630a390a39..bb8546e5f7f223cb499ab404845aba52
this.server.getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.STARTUP));
this.connection.acceptConnections();
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 9e835d63e1592fc064b73c51eecd8b84cbedfa33..7901a8e3659be05d901fd5140e025392ffa0c27c 100644
index fe200718aedcd71c6dc9b9cea10a844551a78324..5406ac93eaf9b9f9e810bfbbcf4a35e2f38f680c 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -99,6 +99,7 @@ import net.minecraft.world.level.storage.PlayerDataStorage;
import net.minecraft.world.phys.Vec3;
@@ -100,6 +100,7 @@ import net.minecraft.world.phys.Vec3;
import net.minecraft.world.scores.DisplaySlot;
import net.minecraft.world.scores.Objective;
import net.minecraft.world.scores.PlayerTeam;
+import net.minecraft.world.scores.Scoreboard; // Paper
import net.minecraft.world.scores.Team;
import org.slf4j.Logger;
@@ -164,6 +165,7 @@ public abstract class PlayerList {
@@ -157,6 +158,7 @@ public abstract class PlayerList {
// CraftBukkit start
private CraftServer cserver;
private final Map<String,ServerPlayer> playersByName = new java.util.HashMap<>();
@ -62,7 +62,7 @@ index 9e835d63e1592fc064b73c51eecd8b84cbedfa33..7901a8e3659be05d901fd5140e025392
public PlayerList(MinecraftServer server, LayeredRegistryAccess<RegistryLayer> registryManager, PlayerDataStorage saveHandler, int maxPlayers) {
this.cserver = server.server = new CraftServer((DedicatedServer) server, this);
@@ -416,6 +418,13 @@ public abstract class PlayerList {
@@ -399,6 +401,13 @@ public abstract class PlayerList {
player.initInventoryMenu();
// CraftBukkit - Moved from above, added world
@ -76,7 +76,7 @@ index 9e835d63e1592fc064b73c51eecd8b84cbedfa33..7901a8e3659be05d901fd5140e025392
PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", player.getName().getString(), s1, player.getId(), worldserver1.serverLevelData.getLevelName(), player.getX(), player.getY(), player.getZ());
}
@@ -535,6 +544,16 @@ public abstract class PlayerList {
@@ -522,6 +531,16 @@ public abstract class PlayerList {
entityplayer.doTick(); // SPIGOT-924
// CraftBukkit end
@ -93,7 +93,7 @@ index 9e835d63e1592fc064b73c51eecd8b84cbedfa33..7901a8e3659be05d901fd5140e025392
this.save(entityplayer);
if (entityplayer.isPassenger()) {
Entity entity = entityplayer.getRootVehicle();
@@ -1166,6 +1185,13 @@ public abstract class PlayerList {
@@ -1160,6 +1179,13 @@ public abstract class PlayerList {
}
// CraftBukkit end

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Add handshake event to allow plugins to handle client
diff --git a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
index 3d08ad662b02812a2b194f95fba55798b9976955..77d7f070cce1a47e41b5d4f5a1cc8c778352a126 100644
index a12d23b03d64aacaf1f231039333aec94245a89a..9a327d193d732baea1fadaab7ebc663d6fd5307c 100644
--- a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
@@ -89,9 +89,36 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
@ -38,12 +38,12 @@ index 3d08ad662b02812a2b194f95fba55798b9976955..77d7f070cce1a47e41b5d4f5a1cc8c77
+ }
+ }
// Spigot Start
String[] split = packet.hostName.split("\00");
String[] split = packet.hostName().split("\00");
- if (org.spigotmc.SpigotConfig.bungee) {
+ // Don't try and handle default logic if it's been handled by the event.
+ if (!handledByEvent && proxyLogicEnabled) {
+ // Paper end
+ // if (org.spigotmc.SpigotConfig.bungee) { // Paper - comment out, we check above!
if ( ( split.length == 3 || split.length == 4 ) && ( ServerHandshakePacketListenerImpl.HOST_PATTERN.matcher( split[1] ).matches() ) ) {
packet.hostName = split[0];
connection.hostname = split[0];
connection.address = new java.net.InetSocketAddress(split[1], ((java.net.InetSocketAddress) this.connection.getRemoteAddress()).getPort());

View File

@ -9,10 +9,10 @@ For servers with multiple IP's, ability to bind to a specific interface.
public net.minecraft.server.dedicated.Settings getStringRaw(Ljava/lang/String;)Ljava/lang/String;
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
index d2d5a6cd70299c169f50684e442ce90be5840f62..d144fc518442762e45f213550a9b0a21f77fcdd1 100644
index dc274aa4757f7426fb494528f6e62cc4ede7455c..97e9a3e567a53c21aff8c525259b9dd83f222ebf 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
@@ -108,6 +108,8 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
@@ -109,6 +109,8 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
private final DedicatedServerProperties.WorldDimensionData worldDimensionData;
public final WorldOptions worldOptions;
@ -21,7 +21,7 @@ index d2d5a6cd70299c169f50684e442ce90be5840f62..d144fc518442762e45f213550a9b0a21
// CraftBukkit start
public DedicatedServerProperties(Properties properties, OptionSet optionset) {
super(properties, optionset);
@@ -165,6 +167,10 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
@@ -167,6 +169,10 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
}, WorldPresets.NORMAL.location().toString()));
this.serverResourcePackInfo = DedicatedServerProperties.getServerPackInfo(this.get("resource-pack", ""), this.get("resource-pack-sha1", ""), this.getLegacyString("resource-pack-hash"), this.get("require-resource-pack", false), this.get("resource-pack-prompt", ""));
this.initialDataPackConfiguration = DedicatedServerProperties.getDatapackConfig(this.get("initial-enabled-packs", String.join(",", WorldDataConfiguration.DEFAULT.dataPacks().getEnabled())), this.get("initial-disabled-packs", String.join(",", WorldDataConfiguration.DEFAULT.dataPacks().getDisabled())));

View File

@ -6,10 +6,10 @@ Subject: [PATCH] EntityRegainHealthEvent isFastRegen API
Don't even get me started
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 8435d0c62c716d4cce5d8b512d8a42658f774876..d7c437dc575a06e1cdf7b393acaeee6007424687 100644
index fa03c3a9debe419dd4e60764de4d9544de1ae0f3..c61ddc868fa2eed1dce72ebcf98940756cca401e 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1291,10 +1291,16 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -1323,10 +1323,16 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
public void heal(float f, EntityRegainHealthEvent.RegainReason regainReason) {

View File

@ -6,18 +6,18 @@ Subject: [PATCH] remove null possibility for getServer singleton
to stop IDE complaining about potential NPE
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index bb8546e5f7f223cb499ab404845aba524726ea16..0ee486f807d7c44e2252c4c744e29b506d916d9c 100644
index 9855ea8c2a13950782b07915bd2ffe68404d571e..f5483f4d2c0339b505bd4a6512b23be2af79d9f7 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -193,6 +193,7 @@ import co.aikar.timings.MinecraftTimings; // Paper
@@ -189,6 +189,7 @@ import co.aikar.timings.MinecraftTimings; // Paper
public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements CommandSource, AutoCloseable {
public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements ServerInfo, CommandSource, AutoCloseable {
+ private static MinecraftServer SERVER; // Paper
public static final Logger LOGGER = LogUtils.getLogger();
public static final net.kyori.adventure.text.logger.slf4j.ComponentLogger COMPONENT_LOGGER = net.kyori.adventure.text.logger.slf4j.ComponentLogger.logger(LOGGER.getName()); // Paper
public static final String VANILLA_BRAND = "vanilla";
@@ -319,6 +320,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -314,6 +315,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public MinecraftServer(OptionSet options, WorldLoader.DataLoadContext worldLoader, Thread thread, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PackRepository resourcepackrepository, WorldStem worldstem, Proxy proxy, DataFixer datafixer, Services services, ChunkProgressListenerFactory worldloadlistenerfactory) {
super("Server");
@ -25,7 +25,7 @@ index bb8546e5f7f223cb499ab404845aba524726ea16..0ee486f807d7c44e2252c4c744e29b50
this.metricsRecorder = InactiveMetricsRecorder.INSTANCE;
this.profiler = this.metricsRecorder.getProfiler();
this.onMetricsRecordingStopped = (methodprofilerresults) -> {
@@ -2323,9 +2325,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2325,9 +2327,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
return false;
}

View File

@ -13,10 +13,10 @@ custom renderers are in use, defaulting to the much simpler Vanilla system.
Additionally, numerous issues to player position tracking on maps has been fixed.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 35b59c83a35bc3a4d05bc95b0caec1f1865589c0..17d9c5a6c357ac5e3eacd9e4d2cff9a05ec0f262 100644
index f0820ab21ff17601c896099d664d18283c759384..303ce1ef47ae9aad137ee29f23b9084d08717cbb 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2394,6 +2394,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -2138,6 +2138,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
{
if ( iter.next().player == entity )
{
@ -25,10 +25,10 @@ index 35b59c83a35bc3a4d05bc95b0caec1f1865589c0..17d9c5a6c357ac5e3eacd9e4d2cff9a0
}
}
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index c20753645585143421eb544a03884f0765eafb8b..11e7c30e448f192493c65330a65d89ed3e14139f 100644
index 06522d8d3b7e0d455a42b10ec5004cc82e0d888d..62a52216e27c0e4847b9c346c35c3d1b7b3b15aa 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -763,6 +763,14 @@ public abstract class Player extends LivingEntity {
@@ -769,6 +769,14 @@ public abstract class Player extends LivingEntity {
return null;
}
// CraftBukkit end
@ -44,10 +44,10 @@ index c20753645585143421eb544a03884f0765eafb8b..11e7c30e448f192493c65330a65d89ed
return entityitem;
}
diff --git a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
index 60596c4ac2ebb8caf19d65591624275ba63b0199..d6ed799716f13cb3f72e66f9d57c6ec90c1eb272 100644
index 8f144a357174bbe096ac9b38a5e67a61127d7b87..e1623ade449fe56ec51955ee9594a93f85660c51 100644
--- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
+++ b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
@@ -63,6 +63,7 @@ public class MapItemSavedData extends SavedData {
@@ -64,6 +64,7 @@ public class MapItemSavedData extends SavedData {
public final Map<String, MapDecoration> decorations = Maps.newLinkedHashMap();
private final Map<String, MapFrame> frameMarkers = Maps.newHashMap();
private int trackedDecorationCount;
@ -55,7 +55,7 @@ index 60596c4ac2ebb8caf19d65591624275ba63b0199..d6ed799716f13cb3f72e66f9d57c6ec9
// CraftBukkit start
public final CraftMapView mapView;
@@ -83,6 +84,7 @@ public class MapItemSavedData extends SavedData {
@@ -90,6 +91,7 @@ public class MapItemSavedData extends SavedData {
// CraftBukkit start
this.mapView = new CraftMapView(this);
this.server = (CraftServer) org.bukkit.Bukkit.getServer();
@ -63,7 +63,7 @@ index 60596c4ac2ebb8caf19d65591624275ba63b0199..d6ed799716f13cb3f72e66f9d57c6ec9
// CraftBukkit end
}
@@ -138,6 +140,7 @@ public class MapItemSavedData extends SavedData {
@@ -145,6 +147,7 @@ public class MapItemSavedData extends SavedData {
if (abyte.length == 16384) {
worldmap.colors = abyte;
}
@ -71,7 +71,7 @@ index 60596c4ac2ebb8caf19d65591624275ba63b0199..d6ed799716f13cb3f72e66f9d57c6ec9
ListTag nbttaglist = nbt.getList("banners", 10);
@@ -548,6 +551,21 @@ public class MapItemSavedData extends SavedData {
@@ -555,6 +558,21 @@ public class MapItemSavedData extends SavedData {
public class HoldingPlayer {
@ -93,7 +93,7 @@ index 60596c4ac2ebb8caf19d65591624275ba63b0199..d6ed799716f13cb3f72e66f9d57c6ec9
public final Player player;
private boolean dirtyData = true;
private int minDirtyX;
@@ -581,7 +599,9 @@ public class MapItemSavedData extends SavedData {
@@ -588,7 +606,9 @@ public class MapItemSavedData extends SavedData {
@Nullable
Packet<?> nextUpdatePacket(int mapId) {
MapItemSavedData.MapPatch worldmap_b;
@ -104,7 +104,7 @@ index 60596c4ac2ebb8caf19d65591624275ba63b0199..d6ed799716f13cb3f72e66f9d57c6ec9
if (this.dirtyData) {
this.dirtyData = false;
@@ -597,6 +617,8 @@ public class MapItemSavedData extends SavedData {
@@ -604,6 +624,8 @@ public class MapItemSavedData extends SavedData {
// CraftBukkit start
java.util.Collection<MapDecoration> icons = new java.util.ArrayList<MapDecoration>();

View File

@ -504,7 +504,7 @@ index 0000000000000000000000000000000000000000..9cfa5d36a6991067a3866e0d437749fa
+ }
+}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 2f15c9df59ebfbe7619e190b8d6ef1fe122809f8..069fe5df02806103c9bbef396c2e39ca3be90101 100644
index 6dc250da442ae15a69c40e10af7ea71d9aaf0055..468111bb80e7756371d22eb831596c187538f0c1 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -235,6 +235,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Don't save empty scoreboard teams to scoreboard.dat
diff --git a/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java b/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java
index b837b6616a2384b253cca8ed62c9488b639f6298..2be7a697f08045b974579e6942b38571e744efac 100644
index a6d23b23e5b5c02427ec538d1d7fd89f51e9e59c..4def212655cea0fd998b52e924f8b671d6aeb559 100644
--- a/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java
+++ b/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java
@@ -136,6 +136,7 @@ public class ScoreboardSaveData extends SavedData {
@@ -143,6 +143,7 @@ public class ScoreboardSaveData extends SavedData {
ListTag listTag = new ListTag();
for(PlayerTeam playerTeam : this.scoreboard.getPlayerTeams()) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] System property for disabling watchdoge
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
index 3ad14bf0697e682a2e777baa8faeb323d127fb13..a9897c494b3dc56d900356d74030359832febbaa 100644
index 2693cc933d746e40d8a47d96c6cb6799f0a2472f..6e1fa4f0616ccfd258acd1b4f5b08fc0ad4c9529 100644
--- a/src/main/java/org/spigotmc/WatchdogThread.java
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
@@ -61,7 +61,7 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
@@ -61,7 +61,7 @@ public class WatchdogThread extends Thread
while ( !this.stopping )
{
//

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Async GameProfileCache saving
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 0ee486f807d7c44e2252c4c744e29b506d916d9c..b5ededfb23980abca01ef25207cca95ad390a70d 100644
index f5483f4d2c0339b505bd4a6512b23be2af79d9f7..6ab95b11eafe69ed0fd584e87ac0f0bb176ce180 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -932,7 +932,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -933,7 +933,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} catch (java.lang.InterruptedException ignored) {} // Paper
if (org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) {
MinecraftServer.LOGGER.info("Saving usercache.json");
@ -16,9 +16,9 @@ index 0ee486f807d7c44e2252c4c744e29b506d916d9c..b5ededfb23980abca01ef25207cca95a
+ this.getProfileCache().save(false); // Paper
}
// Spigot end
io.papermc.paper.chunk.system.io.RegionFileIOThread.close(true); // Paper // Paper - rewrite chunk system
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 6f543665b5ed42eaec6a410fa11f5a38da707110..52c2333afdb3748ffdbcc58ae7629aa2c4b49b74 100644
index 8d4fadc9c65636259bdbdba28bb8a3f8f4e25768..6cc085cf212994cd00dbabd4dd363fc5b3c97281 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -242,7 +242,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@ -31,10 +31,10 @@ index 6f543665b5ed42eaec6a410fa11f5a38da707110..52c2333afdb3748ffdbcc58ae7629aa2
if (!OldUsersConverter.serverReadyAfterUserconversion(this)) {
diff --git a/src/main/java/net/minecraft/server/players/GameProfileCache.java b/src/main/java/net/minecraft/server/players/GameProfileCache.java
index d246563021c32127e570809f4d849b6a156f4dc6..225e15d686675e21969c4210fa38fef58d920355 100644
index 7170f8cfd733708089495b51647659237bd10385..322e07adc556ee8131d40d89856574b185ee4c94 100644
--- a/src/main/java/net/minecraft/server/players/GameProfileCache.java
+++ b/src/main/java/net/minecraft/server/players/GameProfileCache.java
@@ -127,7 +127,7 @@ public class GameProfileCache {
@@ -115,7 +115,7 @@ public class GameProfileCache {
GameProfileCache.GameProfileInfo usercache_usercacheentry = new GameProfileCache.GameProfileInfo(profile, date);
this.safeAdd(usercache_usercacheentry);
@ -43,7 +43,7 @@ index d246563021c32127e570809f4d849b6a156f4dc6..225e15d686675e21969c4210fa38fef5
}
private long getNextOperation() {
@@ -160,7 +160,7 @@ public class GameProfileCache {
@@ -148,7 +148,7 @@ public class GameProfileCache {
}
if (flag && !org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) { // Spigot - skip saving if disabled
@ -52,7 +52,7 @@ index d246563021c32127e570809f4d849b6a156f4dc6..225e15d686675e21969c4210fa38fef5
}
return optional;
@@ -274,7 +274,7 @@ public class GameProfileCache {
@@ -260,7 +260,7 @@ public class GameProfileCache {
return arraylist;
}
@ -61,7 +61,7 @@ index d246563021c32127e570809f4d849b6a156f4dc6..225e15d686675e21969c4210fa38fef5
JsonArray jsonarray = new JsonArray();
DateFormat dateformat = GameProfileCache.createDateFormat();
@@ -282,6 +282,7 @@ public class GameProfileCache {
@@ -268,6 +268,7 @@ public class GameProfileCache {
jsonarray.add(GameProfileCache.writeGameProfile(usercache_usercacheentry, dateformat));
});
String s = this.gson.toJson(jsonarray);
@ -69,7 +69,7 @@ index d246563021c32127e570809f4d849b6a156f4dc6..225e15d686675e21969c4210fa38fef5
try {
BufferedWriter bufferedwriter = Files.newWriter(this.file, StandardCharsets.UTF_8);
@@ -306,6 +307,14 @@ public class GameProfileCache {
@@ -292,6 +293,14 @@ public class GameProfileCache {
} catch (IOException ioexception) {
;
}

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Optional TNT doesn't move in water
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
index c6660cc77dfa3c3750b6b4dde5617f00c9de1e0a..ae3d1077b42fb288938a8a65471f00b3f52cb18f 100644
index ca7c68bd3dc8904bdb50b9056931a44f6071d9e3..bd04537cdc33fddd94fe2b2efcc78875bf96be8c 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -70,7 +70,7 @@ public class ServerEntity {
@@ -73,7 +73,7 @@ public class ServerEntity {
@Nullable
private List<SynchedEntityData.DataValue<?>> trackedDataValues;
// CraftBukkit start

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Faster redstone torch rapid clock removal
Only resize the the redstone torch list once, since resizing arrays / lists is costly
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index ba7760b0b478c6f24dcbaa64919a4766e107a720..0c6384c6332babf8e517503c2e9b21a9d6e2ed88 100644
index c771ec0e5ebd4a45130b3481fa9d3ba00b95f2ae..efb2c0f5f7b3acd127f9a570d00c5826c9e9bb6f 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -173,6 +173,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@ -18,10 +18,10 @@ index ba7760b0b478c6f24dcbaa64919a4766e107a720..0c6384c6332babf8e517503c2e9b21a9
public CraftWorld getWorld() {
return this.world;
diff --git a/src/main/java/net/minecraft/world/level/block/RedstoneTorchBlock.java b/src/main/java/net/minecraft/world/level/block/RedstoneTorchBlock.java
index 9b6f8508d16bcecd9dc148f75598655e3585f175..da07fce0cf7c9fbdb57d2c59e431b59bf583bf50 100644
index a6e61112f5a30a0001071cd931ea658384338eef..c91535f6c0bbc870fad7e04b9d341783cfcbbd63 100644
--- a/src/main/java/net/minecraft/world/level/block/RedstoneTorchBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/RedstoneTorchBlock.java
@@ -21,7 +21,7 @@ import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
@@ -22,7 +22,7 @@ import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
public class RedstoneTorchBlock extends TorchBlock {
public static final BooleanProperty LIT = BlockStateProperties.LIT;
@ -30,7 +30,7 @@ index 9b6f8508d16bcecd9dc148f75598655e3585f175..da07fce0cf7c9fbdb57d2c59e431b59b
public static final int RECENT_TOGGLE_TIMER = 60;
public static final int MAX_RECENT_TOGGLES = 8;
public static final int RESTART_DELAY = 160;
@@ -72,11 +72,15 @@ public class RedstoneTorchBlock extends TorchBlock {
@@ -73,11 +73,15 @@ public class RedstoneTorchBlock extends TorchBlock {
@Override
public void tick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
boolean flag = this.hasNeighborSignal(world, pos, state);
@ -50,7 +50,7 @@ index 9b6f8508d16bcecd9dc148f75598655e3585f175..da07fce0cf7c9fbdb57d2c59e431b59b
// CraftBukkit start
org.bukkit.plugin.PluginManager manager = world.getCraftServer().getPluginManager();
@@ -152,9 +156,12 @@ public class RedstoneTorchBlock extends TorchBlock {
@@ -153,9 +157,12 @@ public class RedstoneTorchBlock extends TorchBlock {
}
private static boolean isToggledTooFrequently(Level world, BlockPos pos, boolean addNew) {
@ -66,16 +66,3 @@ index 9b6f8508d16bcecd9dc148f75598655e3585f175..da07fce0cf7c9fbdb57d2c59e431b59b
if (addNew) {
list.add(new RedstoneTorchBlock.Toggle(pos.immutable(), world.getGameTime()));
@@ -162,9 +169,9 @@ public class RedstoneTorchBlock extends TorchBlock {
int i = 0;
- for (int j = 0; j < list.size(); ++j) {
- RedstoneTorchBlock.Toggle blockredstonetorch_redstoneupdateinfo = (RedstoneTorchBlock.Toggle) list.get(j);
-
+ for (java.util.Iterator<RedstoneTorchBlock.Toggle> iterator = list.iterator(); iterator.hasNext();) {
+ RedstoneTorchBlock.Toggle blockredstonetorch_redstoneupdateinfo = iterator.next();
+ // Paper end
if (blockredstonetorch_redstoneupdateinfo.pos.equals(pos)) {
++i;
if (i >= 8) {