Skip to content

Commit

Permalink
more more more more work
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahvdAa committed Sep 21, 2023
1 parent 9167175 commit 7ebfdd5
Show file tree
Hide file tree
Showing 58 changed files with 244 additions and 241 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 e45fabbf0a7fe125c1b4f82894a177d061950833..6f2135690892f23e80648d4f9237cea34ec19740 100644
index c4a7da71046a4669eb98d7260d3e00b4f5411a7a..e9dbf4504232ba667ee8f6de18ab5356acd19da6 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -166,6 +166,14 @@ public class Main {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Co-authored-by: Evan McCarthy <[email protected]>
Co-authored-by: lexikiq <[email protected]>

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 29798faa9cc9aead40e3329307dc63cb7bf838b6..27f99f9ce39aac0bae5e9a7b34fd63833aa4ad26 100644
index 3bf174b1e259aebef9007c66cf2ee8b87eae7681..1a787bd4bdbbf7c78f4bf6bd7e2f36540fec7d50 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
@@ -689,7 +689,7 @@ public class EnderDragon extends Mob implements Enemy {
@@ -680,7 +680,7 @@ public class EnderDragon extends Mob implements Enemy {
// CraftBukkit start - Use relative location for far away sounds
// this.level().globalLevelEvent(1028, this.blockPosition(), 0);
int viewDistance = ((ServerLevel) this.level()).getCraftServer().getViewDistance() * 16;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Subject: [PATCH] Avoid blocking on Network Manager creation
Per Paper issue 294

diff --git a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java
index 6c4e41d1d9e16492b1e47b5047810b8ffca992e5..776528e50a5abc0e02d9de99231fb47352aa4f43 100644
index dbbca784fe45b7099f683745b36f5c195ca4c2af..d870fbec236a3660f12e0f45cf9431067b18468b 100644
--- a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java
+++ b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java
@@ -60,6 +60,15 @@ public class ServerConnectionListener {
@@ -61,6 +61,15 @@ public class ServerConnectionListener {
public volatile boolean running;
private final List<ChannelFuture> channels = Collections.synchronizedList(Lists.newArrayList());
final List<Connection> connections = Collections.synchronizedList(Lists.newArrayList());
Expand All @@ -25,17 +25,17 @@ index 6c4e41d1d9e16492b1e47b5047810b8ffca992e5..776528e50a5abc0e02d9de99231fb473

public ServerConnectionListener(MinecraftServer server) {
this.server = server;
@@ -97,7 +106,8 @@ public class ServerConnectionListener {
@@ -100,7 +109,8 @@ public class ServerConnectionListener {
int j = ServerConnectionListener.this.server.getRateLimitPacketsPerSecond();
Connection object = j > 0 ? new RateKickingConnection(j) : new Connection(PacketFlow.SERVERBOUND); // CraftBukkit - decompile error

- ServerConnectionListener.this.connections.add(object);
+ //ServerConnectionListener.this.connections.add(object);
+ //ServerConnectionListener.this.connections.add(object); // Paper
+ pending.add(object); // Paper
channelpipeline.addLast("packet_handler", (ChannelHandler) object);
((Connection) object).setListener(new ServerHandshakePacketListenerImpl(ServerConnectionListener.this.server, (Connection) object));
((Connection) object).configurePacketHandler(channelpipeline);
((Connection) object).setListenerForServerboundHandshake(new ServerHandshakePacketListenerImpl(ServerConnectionListener.this.server, (Connection) object));
}
@@ -158,6 +168,7 @@ public class ServerConnectionListener {
@@ -163,6 +173,7 @@ public class ServerConnectionListener {

synchronized (this.connections) {
// Spigot Start
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 225e15d686675e21969c4210fa38fef58d920355..5288aec173549a982e42aeeccf7f5f394080955d 100644
index 322e07adc556ee8131d40d89856574b185ee4c94..7056a0309c76fe8980d60afb4e6059deceb210d9 100644
--- a/src/main/java/net/minecraft/server/players/GameProfileCache.java
+++ b/src/main/java/net/minecraft/server/players/GameProfileCache.java
@@ -98,6 +98,7 @@ public class GameProfileCache {
@@ -86,6 +86,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}, Agent.MINECRAFT, profilelookupcallback);
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 5288aec173549a982e42aeeccf7f5f394080955d..58e923f4ef1980bc7fff1e3b3fcdaad8c4eded53 100644
index 7056a0309c76fe8980d60afb4e6059deceb210d9..82f6404e5c4c5b2c9aea1b1c27ebee1d3c7ee9dc 100644
--- a/src/main/java/net/minecraft/server/players/GameProfileCache.java
+++ b/src/main/java/net/minecraft/server/players/GameProfileCache.java
@@ -98,7 +98,8 @@ public class GameProfileCache {
@@ -86,7 +86,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}, Agent.MINECRAFT, profilelookupcallback);
repository.findProfilesByNames(new String[]{name}, profilelookupcallback);
GameProfile gameprofile = (GameProfile) atomicreference.get();

@@ -116,7 +117,7 @@ public class GameProfileCache {
@@ -104,7 +105,7 @@ public class GameProfileCache {
}

private static boolean usesAuthentication() {
Expand All @@ -29,24 +29,24 @@ index 5288aec173549a982e42aeeccf7f5f394080955d..58e923f4ef1980bc7fff1e3b3fcdaad8

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 da98f074ccd5a40c635824112c97fd174c393cb1..6599f874d9f97e9ef4862039ecad7277bbc5fd91 100644
index 0214830d9bc98b8d435ff11f40df65596980cf77..5db27d7bcaaa2eeaeeb08401513d8d23f6cb63c7 100644
--- a/src/main/java/net/minecraft/server/players/OldUsersConverter.java
+++ b/src/main/java/net/minecraft/server/players/OldUsersConverter.java
@@ -66,7 +66,8 @@ public class OldUsersConverter {
@@ -65,7 +65,8 @@ public class OldUsersConverter {
return new String[i];
});

- if (server.usesAuthentication() || org.spigotmc.SpigotConfig.bungee) { // Spigot: bungee = online mode, for now.
+ if (server.usesAuthentication()
+ || (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode())) { // Spigot: bungee = online mode, for now. // Paper - Handle via setting
server.getProfileRepository().findProfilesByNames(astring, Agent.MINECRAFT, callback);
+ if (server.usesAuthentication() ||
+ (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode())) { // Spigot: bungee = online mode, for now. // Paper - Handle via setting
server.getProfileRepository().findProfilesByNames(astring, callback);
} 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 1f294e7841de880ebe99e02265ba28ce8c932d07..e5ec086722ea6049186d48926c66701b118332cf 100644
index 6797239634ba90768e55fcfb37cb2c14141b7d28..e9c908750f40429108ce21cd2e01630d1416435b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1724,7 +1724,7 @@ public final class CraftServer implements Server {
@@ -1727,7 +1727,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 @@ -9,7 +9,7 @@ object identity checks safely.
Use a simpler optimized hashcode

diff --git a/src/main/java/net/minecraft/world/level/block/state/properties/BooleanProperty.java b/src/main/java/net/minecraft/world/level/block/state/properties/BooleanProperty.java
index 6cdb0716f2a4b29f7a5ecd109bf3c4700ebd22ad..ff1a0d125edd2ea10c870cbb62ae9aa23644b6dc 100644
index 3084343b724098de9791bb74ffb037a499c0c430..bf7ed22094ac92a152e522bafccffb9589f84343 100644
--- a/src/main/java/net/minecraft/world/level/block/state/properties/BooleanProperty.java
+++ b/src/main/java/net/minecraft/world/level/block/state/properties/BooleanProperty.java
@@ -30,8 +30,7 @@ public class BooleanProperty extends Property<Boolean> {
Expand All @@ -21,9 +21,9 @@ index 6cdb0716f2a4b29f7a5ecd109bf3c4700ebd22ad..ff1a0d125edd2ea10c870cbb62ae9aa2
+ public boolean equals_unused(Object object) { // Paper
if (this == object) {
return true;
} else if (object instanceof BooleanProperty && super.equals(object)) {
} else {
diff --git a/src/main/java/net/minecraft/world/level/block/state/properties/EnumProperty.java b/src/main/java/net/minecraft/world/level/block/state/properties/EnumProperty.java
index 4d6e7b5889ecb81195c7152225ae8e3343d3408c..0bca0f971dac994bd8b6ecd87e8b33e26c0f18f9 100644
index 647e295c7761b95db6da28f6fd043ec963f27872..2d69d1c17f734ee38667d51e6fd0a268211ec595 100644
--- a/src/main/java/net/minecraft/world/level/block/state/properties/EnumProperty.java
+++ b/src/main/java/net/minecraft/world/level/block/state/properties/EnumProperty.java
@@ -45,8 +45,7 @@ public class EnumProperty<T extends Enum<T> & StringRepresentable> extends Prope
Expand All @@ -35,9 +35,9 @@ index 4d6e7b5889ecb81195c7152225ae8e3343d3408c..0bca0f971dac994bd8b6ecd87e8b33e2
+ public boolean equals_unused(Object object) { // Paper
if (this == object) {
return true;
} else if (object instanceof EnumProperty && super.equals(object)) {
} else {
diff --git a/src/main/java/net/minecraft/world/level/block/state/properties/IntegerProperty.java b/src/main/java/net/minecraft/world/level/block/state/properties/IntegerProperty.java
index 59b5b22a567e4e2be499a2a35aedb10218a7432a..bdbe0362e49e73c05237f9f3143230e0b03e494e 100644
index d6c1b1817ba79a652c4094f003a7d899d4939971..33268d953b30d384564eee6dfab2a37fa722e465 100644
--- a/src/main/java/net/minecraft/world/level/block/state/properties/IntegerProperty.java
+++ b/src/main/java/net/minecraft/world/level/block/state/properties/IntegerProperty.java
@@ -35,8 +35,7 @@ public class IntegerProperty extends Property<Integer> {
Expand All @@ -49,7 +49,7 @@ index 59b5b22a567e4e2be499a2a35aedb10218a7432a..bdbe0362e49e73c05237f9f3143230e0
+ public boolean equals_unused(Object object) { // Paper
if (this == object) {
return true;
} else if (object instanceof IntegerProperty && super.equals(object)) {
} else {
diff --git a/src/main/java/net/minecraft/world/level/block/state/properties/Property.java b/src/main/java/net/minecraft/world/level/block/state/properties/Property.java
index d1f2e29623b15fdb99ba082fd757a54fd4713761..66b8e23d799adaf872233ea44c54330d75135544 100644
--- a/src/main/java/net/minecraft/world/level/block/state/properties/Property.java
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 6b87ed8b453b149bdd74eb3b164aa3bbcc8c2b13..518bf023127f40190aa29e9a132f19e98051e381 100644
index e58a87d933b916dd246f392577432d8022f117f7..0ce757dd60d167886d56eb651140cec93b1af41e 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1600,13 +1600,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -1498,13 +1498,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 518bf023127f40190aa29e9a132f19e98051e381..54433d42a13b8967e38eeeb3052b8ff94c62c730 100644
index 0ce757dd60d167886d56eb651140cec93b1af41e..4c9454589b5fe98d8b6be84fe07970efa5f07732 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -357,7 +357,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -336,7 +336,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 518bf023127f40190aa29e9a132f19e98051e381..54433d42a13b8967e38eeeb3052b8ff9
return;
}
} else {
@@ -376,7 +376,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -355,7 +355,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,10 +5,10 @@ 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 f9704b20e71564ac721a24655b2792c689edf6ba..e04f3f1159c5d5fa2e3956a36e95f8afb5a1d4aa 100644
index 2f97e4f0078cecbcf044d0b27f375638a6ea047b..b70ee1dff0442de32a9e20ad54b246d5eae45e58 100644
--- a/src/main/java/net/minecraft/world/entity/npc/Villager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java
@@ -850,10 +850,17 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
@@ -851,10 +851,17 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
@Override
public void thunderHit(ServerLevel world, LightningBolt lightning) {
if (world.getDifficulty() != Difficulty.PEACEFUL) {
Expand All @@ -28,10 +28,10 @@ index f9704b20e71564ac721a24655b2792c689edf6ba..e04f3f1159c5d5fa2e3956a36e95f8af
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 db30af9b6b9e737066c8a011e4dfe377f800f523..3849e30f8fad46feefaa901283ad776a93561e23 100644
index 8e1bb9d86ec12240b00ee118a88ebe4dec4e6329..e974520bb5c069229b214962a5e377b92c07e339 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1238,6 +1238,14 @@ public class CraftEventFactory {
@@ -1240,6 +1240,14 @@ public class CraftEventFactory {
return !event.isCancelled();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ 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 93c162fd126824ab0af39568efe0dec21d846810..5b37b5c45bad8d8d262f46a117e3fc858cb40485 100644
index 90f52ed06b4493610f65c8a82d6a3a3b32fef1a7..b8c8b10656e4151c8c19b8cecc3bc7502dd57d3d 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 {
Expand Down
Loading

0 comments on commit 7ebfdd5

Please sign in to comment.