Skip to content

Commit

Permalink
patches
Browse files Browse the repository at this point in the history
  • Loading branch information
jpenilla committed Dec 5, 2023
1 parent fad3fa9 commit dfac4f9
Show file tree
Hide file tree
Showing 40 changed files with 156 additions and 157 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Add server-name parameter


diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index be73d6940983672bcccc2b05a9a87b01e0a995b0..d8ca6256ad2bedc7afb92162a0e1a5487011bfbc 100644
index 176ffe9f5007bf4bb83bfc0d1186116c98481f45..3eca99ab31f257423ca4d1d2cdcfc19a16758e6d 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -167,6 +167,14 @@ public class Main {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Co-authored-by: Evan McCarthy <evanmccarthy@outlook.com>
Co-authored-by: lexikiq <noellekiq@gmail.com>

diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
index a5d6f358aced725315f4bbb33953ef5f2cafdfde..4406d9622c6a5f817b7fbd1b448b8c3095c617b2 100644
index aea9366215973555de88e67310b7fbe033f45cd5..773e76d940bf0ec67681d2896bcf7a8428aa94bd 100644
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
@@ -680,7 +680,7 @@ public class EnderDragon extends Mob implements Enemy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ Subject: [PATCH] Don't lookup game profiles that have no UUID and no name


diff --git a/src/main/java/net/minecraft/server/players/GameProfileCache.java b/src/main/java/net/minecraft/server/players/GameProfileCache.java
index 322e07adc556ee8131d40d89856574b185ee4c94..7056a0309c76fe8980d60afb4e6059deceb210d9 100644
index ee43e87fca2a8ac3f63bc2f8ffcf15be373195e9..1a97dd1f9b9fcc5809aa3f103bc6efd5a548670f 100644
--- a/src/main/java/net/minecraft/server/players/GameProfileCache.java
+++ b/src/main/java/net/minecraft/server/players/GameProfileCache.java
@@ -86,6 +86,7 @@ public class GameProfileCache {
}
};
@@ -90,6 +90,7 @@ public class GameProfileCache {
}
};

+ if (!org.apache.commons.lang3.StringUtils.isBlank(name)) // Paper - Don't lookup a profile with a blank name)
repository.findProfilesByNames(new String[]{name}, profilelookupcallback);
GameProfile gameprofile = (GameProfile) atomicreference.get();
repository.findProfilesByNames(new String[]{name}, profilelookupcallback);
GameProfile gameprofile = (GameProfile) atomicreference.get();

Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ Subject: [PATCH] Add setting for proxy online mode status
TODO: Add isProxyOnlineMode check to Metrics

diff --git a/src/main/java/net/minecraft/server/players/GameProfileCache.java b/src/main/java/net/minecraft/server/players/GameProfileCache.java
index 7056a0309c76fe8980d60afb4e6059deceb210d9..82f6404e5c4c5b2c9aea1b1c27ebee1d3c7ee9dc 100644
index 1a97dd1f9b9fcc5809aa3f103bc6efd5a548670f..68f95f4782c1effdee13543b702fdcc78ce14353 100644
--- a/src/main/java/net/minecraft/server/players/GameProfileCache.java
+++ b/src/main/java/net/minecraft/server/players/GameProfileCache.java
@@ -86,7 +86,8 @@ public class GameProfileCache {
}
};
@@ -90,7 +90,8 @@ public class GameProfileCache {
}
};

- if (!org.apache.commons.lang3.StringUtils.isBlank(name)) // Paper - Don't lookup a profile with a blank name)
+ if (!org.apache.commons.lang3.StringUtils.isBlank(name) // Paper - Don't lookup a profile with a blank name
+ && io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()) // Paper - only run in online mode - 100 COL
repository.findProfilesByNames(new String[]{name}, profilelookupcallback);
GameProfile gameprofile = (GameProfile) atomicreference.get();
repository.findProfilesByNames(new String[]{name}, profilelookupcallback);
GameProfile gameprofile = (GameProfile) atomicreference.get();

@@ -104,7 +105,7 @@ public class GameProfileCache {
@@ -107,7 +108,7 @@ public class GameProfileCache {
}

private static boolean usesAuthentication() {
Expand All @@ -29,10 +29,10 @@ index 7056a0309c76fe8980d60afb4e6059deceb210d9..82f6404e5c4c5b2c9aea1b1c27ebee1d

public void add(GameProfile profile) {
diff --git a/src/main/java/net/minecraft/server/players/OldUsersConverter.java b/src/main/java/net/minecraft/server/players/OldUsersConverter.java
index 0214830d9bc98b8d435ff11f40df65596980cf77..5db27d7bcaaa2eeaeeb08401513d8d23f6cb63c7 100644
index 78b11d6fd74fb0714a8013fdc78d096643c4f83c..6a64c58fff9bbed542bf29a029531996f2a50d00 100644
--- a/src/main/java/net/minecraft/server/players/OldUsersConverter.java
+++ b/src/main/java/net/minecraft/server/players/OldUsersConverter.java
@@ -65,7 +65,8 @@ public class OldUsersConverter {
@@ -66,7 +66,8 @@ public class OldUsersConverter {
return new String[i];
});

Expand All @@ -43,10 +43,10 @@ index 0214830d9bc98b8d435ff11f40df65596980cf77..5db27d7bcaaa2eeaeeb08401513d8d23
} else {
String[] astring1 = astring;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index f6e6b929c3ce5091a44bba4ab354b8dae73e7cc8..09c34d05c124e55a327e529bf1b247bc5c70ca6c 100644
index e85017f62eb90efda8d4f3910fe543c9a4a2243a..9c971f28483661fbdbee07b8091669071f0088a8 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1789,7 +1789,7 @@ public final class CraftServer implements Server {
@@ -1821,7 +1821,7 @@ public final class CraftServer implements Server {
// Spigot Start
GameProfile profile = null;
// Only fetch an online UUID in online mode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Configurable packet in spam threshold


diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 3fbe132d278928a55115dce116f14ac1ce1ebc69..fabb6ab9a3dc7dcf724b1505ec1172f16158f502 100644
index d03d5629e3605626bba6ea806990443bfb151c61..3ec76a3073bb5ce95e56302eb16940b9efd23e47 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1506,13 +1506,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1533,13 +1533,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// Spigot start - limit place/interactions
private int limitedPackets;
private long lastLimitedPacket = -1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Configurable flying kick messages


diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index fabb6ab9a3dc7dcf724b1505ec1172f16158f502..8b81073813a7e31273816d1486a59ed6325589df 100644
index 3ec76a3073bb5ce95e56302eb16940b9efd23e47..d5aff46a9f4683fa6e175ecfd1702f7da8af21a8 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -336,7 +336,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -339,7 +339,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
if (this.clientIsFloating && !this.player.isSleeping() && !this.player.isPassenger() && !this.player.isDeadOrDying()) {
if (++this.aboveGroundTickCount > 80) {
ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating too long!", this.player.getName().getString());
Expand All @@ -17,7 +17,7 @@ index fabb6ab9a3dc7dcf724b1505ec1172f16158f502..8b81073813a7e31273816d1486a59ed6
return;
}
} else {
@@ -355,7 +355,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -358,7 +358,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
if (this.clientVehicleIsFloating && this.player.getRootVehicle().getControllingPassenger() == this.player) {
if (++this.aboveGroundVehicleTickCount > 80) {
ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating a vehicle too long!", this.player.getName().getString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Add EntityZapEvent


diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java
index 2f97e4f0078cecbcf044d0b27f375638a6ea047b..b70ee1dff0442de32a9e20ad54b246d5eae45e58 100644
index 22f7318711041bfc2847d519933c46b9fd523d01..505e0031f2783192f1146b1b00249e7891c4f1ef 100644
--- a/src/main/java/net/minecraft/world/entity/npc/Villager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java
@@ -851,10 +851,17 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
Expand All @@ -28,7 +28,7 @@ index 2f97e4f0078cecbcf044d0b27f375638a6ea047b..b70ee1dff0442de32a9e20ad54b246d5
entitywitch.finalizeSpawn(world, world.getCurrentDifficultyAt(entitywitch.blockPosition()), MobSpawnType.CONVERSION, (SpawnGroupData) null, (CompoundTag) null);
entitywitch.setNoAi(this.isNoAi());
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index bbf30a36c44cd6403a2f45622f5dd186adc18772..3521d784db2754b4af99b891f69a15fe2bf7a4b8 100644
index c6f5d282b35a40756f920906e39a4f71d277ada3..be2722c95fad0b78b27a97e64692dfe686a1f03f 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1268,6 +1268,14 @@ public class CraftEventFactory {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ Subject: [PATCH] Filter bad tile entity nbt data from falling blocks


diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
index 0e349bc8dd0c31559437dc67481d5f0f81100e3b..c431ba283c31cf9bb7bfdb05dc8c181c9e1e0eb3 100644
index 6c4224e4752b655710c5b992d9acf9563b183483..9be45ff8139c9d385c1deb1200e3718ed3add801 100644
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
@@ -334,7 +334,7 @@ public class FallingBlockEntity extends Entity {
this.dropItem = nbt.getBoolean("DropItem");
}

- if (nbt.contains("TileEntityData", 10)) {
+ if (nbt.contains("TileEntityData", 10) && !(this.level().paperConfig().entities.spawning.filterBadTileEntityNbtFromFallingBlocks && this.blockState.getBlock() instanceof net.minecraft.world.level.block.GameMasterBlock)) {
this.blockData = nbt.getCompound("TileEntityData");
+ if (nbt.contains("TileEntityData", 10) && !(this.level().paperConfig().entities.spawning.filterBadTileEntityNbtFromFallingBlocks && this.blockState.getBlock() instanceof net.minecraft.world.level.block.GameMasterBlock)) { // Paper
this.blockData = nbt.getCompound("TileEntityData").copy();
}

Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,18 @@ Subject: [PATCH] Cache user authenticator threads


diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 0d1102e1b98235b8e7124321a65483a5e923d4a5..7a9094e69684c2d963411525a09872024c6f62e3 100644
index 315f51b6c76695e204ddfae3419103c797ad2dfd..db07502d4d7b73c0e74814334be6603121f60673 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -139,8 +139,8 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@@ -49,6 +49,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,

private static final AtomicInteger UNIQUE_THREAD_ID = new AtomicInteger(0);
static final Logger LOGGER = LogUtils.getLogger();
+ private static final java.util.concurrent.ExecutorService authenticatorPool = java.util.concurrent.Executors.newCachedThreadPool(new com.google.common.util.concurrent.ThreadFactoryBuilder().setNameFormat("User Authenticator #%d").setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(LOGGER)).build()); // Paper - Cache authenticator threads
private static final int MAX_TICKS_BEFORE_LOGIN = 600;
private static final Component DISCONNECT_UNEXPECTED_QUERY = Component.translatable("multiplayer.disconnect.unexpected_query_response");
private final byte[] challenge;
@@ -140,8 +141,8 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
this.connection.send(new ClientboundHelloPacket("", this.server.getKeyPair().getPublic().getEncoded(), this.challenge));
} else {
// Spigot start
Expand All @@ -19,7 +27,7 @@ index 0d1102e1b98235b8e7124321a65483a5e923d4a5..7a9094e69684c2d963411525a0987202
@Override
public void run() {
try {
@@ -150,7 +150,8 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@@ -151,7 +152,8 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
ServerLoginPacketListenerImpl.this.server.server.getLogger().log(java.util.logging.Level.WARNING, "Exception verifying " + ServerLoginPacketListenerImpl.this.requestedUsername, ex);
}
}
Expand All @@ -29,7 +37,7 @@ index 0d1102e1b98235b8e7124321a65483a5e923d4a5..7a9094e69684c2d963411525a0987202
// Spigot end
}

@@ -223,7 +224,8 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@@ -218,7 +220,8 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
throw new IllegalStateException("Protocol error", cryptographyexception);
}

Expand All @@ -39,7 +47,7 @@ index 0d1102e1b98235b8e7124321a65483a5e923d4a5..7a9094e69684c2d963411525a0987202
public void run() {
String s1 = (String) Objects.requireNonNull(ServerLoginPacketListenerImpl.this.requestedUsername, "Player name not initialized");

@@ -269,10 +271,8 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@@ -264,10 +267,8 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,

return ServerLoginPacketListenerImpl.this.server.getPreventProxyConnections() && socketaddress instanceof InetSocketAddress ? ((InetSocketAddress) socketaddress).getAddress() : null;
}
Expand All @@ -52,12 +60,3 @@ index 0d1102e1b98235b8e7124321a65483a5e923d4a5..7a9094e69684c2d963411525a0987202
}

// Spigot start
@@ -333,6 +333,8 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
this.state = ServerLoginPacketListenerImpl.State.ACCEPTED;
}

+ private static final java.util.concurrent.ExecutorService authenticatorPool = java.util.concurrent.Executors.newCachedThreadPool(new com.google.common.util.concurrent.ThreadFactoryBuilder().setNameFormat("User Authenticator #%d").setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(LOGGER)).build()); // Paper - Cache authenticator threads
+
// Spigot start
protected GameProfile createOfflineProfile(String name) {
UUID uuid;
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Command Aliases
Reload the aliases stored in commands.yml

diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 09c34d05c124e55a327e529bf1b247bc5c70ca6c..23b99cc6999c6db244793f6b744e6546bd04ae72 100644
index 9c971f28483661fbdbee07b8091669071f0088a8..cfa9f0336494de42a34ea14d9453e083574f5945 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2710,5 +2710,24 @@ public final class CraftServer implements Server {
@@ -2742,5 +2742,24 @@ public final class CraftServer implements Server {
DefaultPermissions.registerCorePermissions();
CraftDefaultPermissions.registerCorePermissions();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Add source to PlayerExpChangeEvent


diff --git a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
index 8946d486dab3e639b00716ce7459c817270dad80..f25466e132cb6b0012dc336877fdf17b88a12ddc 100644
index 79943167c7e16111a81ff608fd9ed6c06bcb9468..59bad6c92cc421dd05c7315e2ab694a669433ab4 100644
--- a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
+++ b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
@@ -254,7 +254,7 @@ public class ExperienceOrb extends Entity {
Expand All @@ -18,7 +18,7 @@ index 8946d486dab3e639b00716ce7459c817270dad80..f25466e132cb6b0012dc336877fdf17b

--this.count;
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 3521d784db2754b4af99b891f69a15fe2bf7a4b8..30831f9ef0887fde0f8180aa5d65f7d218bf0d6a 100644
index be2722c95fad0b78b27a97e64692dfe686a1f03f..1008cd5a10d6587f7df66e6235bee5fe5c3f2eca 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1221,6 +1221,17 @@ public class CraftEventFactory {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Subject: [PATCH] Add ProjectileCollideEvent
Deprecated now and replaced with ProjectileHitEvent

diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 30831f9ef0887fde0f8180aa5d65f7d218bf0d6a..a85c6e0fe88d285908578f05562ede92a0ae336b 100644
index 1008cd5a10d6587f7df66e6235bee5fe5c3f2eca..3b267a9a22a735af6f12427136816578c4a1e681 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1365,6 +1365,17 @@ public class CraftEventFactory {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Subject: [PATCH] Optimize World.isLoaded(BlockPosition)Z
Reduce method invocations for World.isLoaded(BlockPosition)Z

diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 555e7efacd6cc37c6cf959e2931069be5c85fe8f..17a15f7f1ad0ce7deed8d72c8a4175634992efc9 100644
index 48d3da58820c1d9259bc023ddd74e9632b3f62d1..e774f7930090e10889f13e8193d15e44a3b7637f 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -427,6 +427,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -430,6 +430,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return chunk == null ? null : chunk.getFluidState(blockposition);
}

Expand Down
Loading

0 comments on commit dfac4f9

Please sign in to comment.