Updated Upstream (Bukkit/CraftBukkit/Spigot) (#4728)

Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
30885166 Update to Minecraft 1.16.4

CraftBukkit Changes:
3af81c71 Update to Minecraft 1.16.4

Spigot Changes:
f011ca24 Update to Minecraft 1.16.4

Co-authored-by: Mariell Hoversholm <proximyst@proximyst.com>
This commit is contained in:
Daniel Ennis 2020-11-02 21:22:15 -05:00
parent 0e476e7c68
commit 6f4fbe1c89
71 changed files with 201 additions and 246 deletions

View file

@ -10,7 +10,7 @@
<groupId>com.destroystokyo.paper</groupId> <groupId>com.destroystokyo.paper</groupId>
<artifactId>paper-mojangapi</artifactId> <artifactId>paper-mojangapi</artifactId>
<version>1.16.3-R0.1-SNAPSHOT</version> <version>1.16.4-R0.1-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>Paper-MojangAPI</name> <name>Paper-MojangAPI</name>

View file

@ -36,7 +36,7 @@ How To (Plugin Developers)
<dependency> <dependency>
<groupId>com.destroystokyo.paper</groupId> <groupId>com.destroystokyo.paper</groupId>
<artifactId>paper-api</artifactId> <artifactId>paper-api</artifactId>
<version>1.16.3-R0.1-SNAPSHOT</version> <version>1.16.4-R0.1-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
``` ```

View file

@ -22,7 +22,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- <artifactId>spigot-api</artifactId> - <artifactId>spigot-api</artifactId>
+ <groupId>com.destroystokyo.paper</groupId> + <groupId>com.destroystokyo.paper</groupId>
+ <artifactId>paper-api</artifactId> + <artifactId>paper-api</artifactId>
<version>1.16.3-R0.1-SNAPSHOT</version> <version>1.16.4-R0.1-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
- <name>Spigot-API</name> - <name>Spigot-API</name>

View file

@ -26,14 +26,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
import org.bukkit.event.player.AsyncPlayerPreLoginEvent; import org.bukkit.event.player.AsyncPlayerPreLoginEvent;
import org.bukkit.event.player.PlayerPreLoginEvent; import org.bukkit.event.player.PlayerPreLoginEvent;
@@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener { @@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener {
java.util.UUID uniqueId = i.getId(); java.util.UUID uniqueId = i.getId();
final org.bukkit.craftbukkit.CraftServer server = LoginListener.this.server.server; final org.bukkit.craftbukkit.CraftServer server = LoginListener.this.server.server;
- AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, uniqueId); - AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, uniqueId);
+ // Paper start + // Paper start
+ PlayerProfile profile = Bukkit.createProfile(uniqueId, playerName); + PlayerProfile profile = Bukkit.createProfile(uniqueId, playerName);
+ AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, uniqueId, profile); + AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, uniqueId, profile);
server.getPluginManager().callEvent(asyncEvent); server.getPluginManager().callEvent(asyncEvent);
+ profile = asyncEvent.getPlayerProfile(); + profile = asyncEvent.getPlayerProfile();
+ profile.complete(); + profile.complete();
+ i = CraftPlayerProfile.asAuthlibCopy(profile); + i = CraftPlayerProfile.asAuthlibCopy(profile);
@ -41,5 +41,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ uniqueId = i.getId(); + uniqueId = i.getId();
+ // Paper end + // Paper end
if (PlayerPreLoginEvent.getHandlerList().getRegisteredListeners().length != 0) { if (PlayerPreLoginEvent.getHandlerList().getRegisteredListeners().length != 0) {
final PlayerPreLoginEvent event = new PlayerPreLoginEvent(playerName, address, uniqueId); final PlayerPreLoginEvent event = new PlayerPreLoginEvent(playerName, address, uniqueId);

View file

@ -61,8 +61,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return this.getPassengers().size() < 1; return this.getPassengers().size() < 1;
} }
+ public final float getCollisionBorderSize() { return bf(); } // Paper - OBFHELPER + public final float getCollisionBorderSize() { return bg(); } // Paper - OBFHELPER
public float bf() { public float bg() {
return 0.0F; return 0.0F;
} }
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java

View file

@ -151,7 +151,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.g = LoginListener.EnumProtocolState.HELLO; this.g = LoginListener.EnumProtocolState.HELLO;
@@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener { @@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener {
this.g = LoginListener.EnumProtocolState.KEY; this.g = LoginListener.EnumProtocolState.KEY;
this.networkManager.sendPacket(new PacketLoginOutEncryptionBegin("", this.server.getKeyPair().getPublic(), this.e)); this.networkManager.sendPacket(new PacketLoginOutEncryptionBegin("", this.server.getKeyPair().getPublic().getEncoded(), this.e));
} else { } else {
+ // Paper start - Velocity support + // Paper start - Velocity support
+ if (com.destroystokyo.paper.PaperConfig.velocitySupport) { + if (com.destroystokyo.paper.PaperConfig.velocitySupport) {
@ -168,15 +168,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public class LoginHandler { public class LoginHandler {
public void fireEvents() throws Exception { public void fireEvents() throws Exception {
+ // Paper start - Velocity support + // Paper start - Velocity support
+ if (LoginListener.this.velocityLoginMessageId == -1 && com.destroystokyo.paper.PaperConfig.velocitySupport) { + if (LoginListener.this.velocityLoginMessageId == -1 && com.destroystokyo.paper.PaperConfig.velocitySupport) {
+ disconnect("This server requires you to connect with Velocity."); + disconnect("This server requires you to connect with Velocity.");
+ return; + return;
+ } + }
+ // Paper end + // Paper end
String playerName = i.getName(); String playerName = i.getName();
java.net.InetAddress address = ((java.net.InetSocketAddress) networkManager.getSocketAddress()).getAddress(); java.net.InetAddress address = ((java.net.InetSocketAddress) networkManager.getSocketAddress()).getAddress();
java.util.UUID uniqueId = i.getId(); java.util.UUID uniqueId = i.getId();
@@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener { @@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener {
// Spigot end // Spigot end

View file

@ -27,16 +27,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return this.isInWater() || this.isInRain() || this.k(); return this.isInWater() || this.isInRain() || this.k();
} }
+ public final boolean isInWaterOrBubbleColumn() { return aG(); } // Paper - OBFHELPER + public final boolean isInWaterOrBubbleColumn() { return aH(); } // Paper - OBFHELPER
public boolean aG() { public boolean aH() {
return this.isInWater() || this.k(); return this.isInWater() || this.k();
} }
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
return this.O == tag; return this.O == tag;
} }
+ public final boolean isInLava() { return aP(); } // Paper - OBFHELPER + public final boolean isInLava() { return aQ(); } // Paper - OBFHELPER
public boolean aP() { public boolean aQ() {
return !this.justCreated && this.M.getDouble(TagsFluid.LAVA) > 0.0D; return !this.justCreated && this.M.getDouble(TagsFluid.LAVA) > 0.0D;
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java

View file

@ -15,7 +15,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public boolean isInDaylight() { return this.eG(); } // Paper - OBFHELPER + public boolean isInDaylight() { return this.eG(); } // Paper - OBFHELPER
protected boolean eG() { protected boolean eG() {
if (this.world.isDay() && !this.world.isClientSide) { if (this.world.isDay() && !this.world.isClientSide) {
float f = this.aQ(); float f = this.aR();
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java

View file

@ -116,8 +116,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.methodProfiler.exit(); this.methodProfiler.exit();
org.spigotmc.WatchdogThread.tick(); // Spigot org.spigotmc.WatchdogThread.tick(); // Spigot
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
public IRegistryCustom getCustomRegistry() { public ITextFilter a(EntityPlayer entityplayer) {
return this.customRegistry; return null;
} }
+ +
+ // Paper start + // Paper start

View file

@ -38,8 +38,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return this.isInWater() || this.isInRain(); return this.isInWater() || this.isInRain();
} }
+ public final boolean isInWaterOrRainOrBubble() { return aF(); } // Paper - OBFHELPER + public final boolean isInWaterOrRainOrBubble() { return aG(); } // Paper - OBFHELPER
public boolean aF() { public boolean aG() {
return this.isInWater() || this.isInRain() || this.k(); return this.isInWater() || this.isInRain() || this.k();
} }
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
@ -89,7 +89,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public final boolean validConditions() { return this.a(); } // Paper - OBFHELPER + public final boolean validConditions() { return this.a(); } // Paper - OBFHELPER
@Override @Override
public boolean a() { public boolean a() {
return this.a.isInWater() && this.a.b((Tag) TagsFluid.WATER) > this.a.cw() || this.a.aP(); return this.a.isInWater() && this.a.b((Tag) TagsFluid.WATER) > this.a.cx() || this.a.aQ();
} }
+ public void update() { this.e(); } // Paper - OBFHELPER + public void update() { this.e(); } // Paper - OBFHELPER

View file

@ -31,13 +31,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/LoginListener.java --- a/src/main/java/net/minecraft/server/LoginListener.java
+++ b/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java
@@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener { @@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener {
LoginListener.this.i = LoginListener.this.a(gameprofile); LoginListener.this.i = LoginListener.this.a(gameprofile);
LoginListener.this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT; LoginListener.this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT;
} else { } else {
+ // Paper start + // Paper start
+ if (com.destroystokyo.paper.PaperConfig.authenticationServersDownKickMessage != null) { + if (com.destroystokyo.paper.PaperConfig.authenticationServersDownKickMessage != null) {
+ LoginListener.this.disconnect(new ChatComponentText(com.destroystokyo.paper.PaperConfig.authenticationServersDownKickMessage)); + LoginListener.this.disconnect(new ChatComponentText(com.destroystokyo.paper.PaperConfig.authenticationServersDownKickMessage));
+ } else // Paper end + } else // Paper end
LoginListener.this.disconnect(new ChatMessage("multiplayer.disconnect.authservers_down")); LoginListener.this.disconnect(new ChatMessage("multiplayer.disconnect.authservers_down"));
LoginListener.LOGGER.error("Couldn't verify username because servers are unavailable"); LoginListener.LOGGER.error("Couldn't verify username because servers are unavailable");
} }

View file

@ -325,8 +325,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ +
+public class PaperAuthenticationService extends YggdrasilAuthenticationService { +public class PaperAuthenticationService extends YggdrasilAuthenticationService {
+ private final Environment environment; + private final Environment environment;
+ public PaperAuthenticationService(Proxy proxy, String clientToken) { + public PaperAuthenticationService(Proxy proxy) {
+ super(proxy, clientToken); + super(proxy);
+ this.environment = (Environment)EnvironmentParser.getEnvironmentFromProperties().orElse(YggdrasilEnvironment.PROD);; + this.environment = (Environment)EnvironmentParser.getEnvironmentFromProperties().orElse(YggdrasilEnvironment.PROD);;
+ } + }
+ +
@ -416,10 +416,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import com.mojang.authlib.Agent; +import com.mojang.authlib.Agent;
+import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; +import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService;
+import com.mojang.authlib.yggdrasil.YggdrasilUserAuthentication; +import com.mojang.authlib.yggdrasil.YggdrasilUserAuthentication;
+import java.util.UUID;
+ +
+public class PaperUserAuthentication extends YggdrasilUserAuthentication { +public class PaperUserAuthentication extends YggdrasilUserAuthentication {
+ public PaperUserAuthentication(YggdrasilAuthenticationService authenticationService, Agent agent) { + public PaperUserAuthentication(YggdrasilAuthenticationService authenticationService, Agent agent) {
+ super(authenticationService, agent); + super(authenticationService, UUID.randomUUID().toString(), agent);
+ } + }
+} +}
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
@ -458,8 +459,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
File file = (File) optionset.valueOf("universe"); // CraftBukkit File file = (File) optionset.valueOf("universe"); // CraftBukkit
- YggdrasilAuthenticationService yggdrasilauthenticationservice = new YggdrasilAuthenticationService(Proxy.NO_PROXY, UUID.randomUUID().toString()); - YggdrasilAuthenticationService yggdrasilauthenticationservice = new YggdrasilAuthenticationService(Proxy.NO_PROXY);
+ YggdrasilAuthenticationService yggdrasilauthenticationservice = new com.destroystokyo.paper.profile.PaperAuthenticationService(Proxy.NO_PROXY, UUID.randomUUID().toString()); // Paper + YggdrasilAuthenticationService yggdrasilauthenticationservice = new com.destroystokyo.paper.profile.PaperAuthenticationService(Proxy.NO_PROXY); // Paper
MinecraftSessionService minecraftsessionservice = yggdrasilauthenticationservice.createMinecraftSessionService(); MinecraftSessionService minecraftsessionservice = yggdrasilauthenticationservice.createMinecraftSessionService();
GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository(); GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository();
UserCache usercache = new UserCache(gameprofilerepository, new File(file, MinecraftServer.b.getName())); UserCache usercache = new UserCache(gameprofilerepository, new File(file, MinecraftServer.b.getName()));

View file

@ -25,8 +25,8 @@ diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java --- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -0,0 +0,0 @@ import java.util.Optional; @@ -0,0 +0,0 @@ import java.util.function.Consumer;
import java.util.Set; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+import org.apache.commons.lang3.StringEscapeUtils; +import org.apache.commons.lang3.StringEscapeUtils;
@ -38,7 +38,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@Override @Override
public void a(PacketPlayInBEdit packetplayinbedit) { public void a(PacketPlayInBEdit packetplayinbedit) {
+ // Paper start + // Paper start
+ ItemStack testStack = packetplayinbedit.b(); + ItemStack testStack = packetplayinbedit.b(); // TODO(Proximyst): Add obfhelper here
+ if (!server.isPrimaryThread() && !testStack.isEmpty() && testStack.getTag() != null) { + if (!server.isPrimaryThread() && !testStack.isEmpty() && testStack.getTag() != null) {
+ NBTTagList pageList = testStack.getTag().getList("pages", 8); + NBTTagList pageList = testStack.getTag().getList("pages", 8);
+ long byteTotal = 0; + long byteTotal = 0;
@ -73,6 +73,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ } + }
+ } + }
+ // Paper end + // Paper end
PlayerConnectionUtils.ensureMainThread(packetplayinbedit, this, this.player.getWorldServer());
// CraftBukkit start // CraftBukkit start
if (this.lastBookTick + 20 > MinecraftServer.currentTick) { if (this.lastBookTick + 20 > MinecraftServer.currentTick) {
this.disconnect("Book edited too quickly!");

View file

@ -12,7 +12,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/WorldServer.java --- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed { @@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
if (entity.ck()) { if (entity.cl()) {
this.getMethodProfiler().enter("chunkCheck"); this.getMethodProfiler().enter("chunkCheck");
int i = MathHelper.floor(entity.locX() / 16.0D); int i = MathHelper.floor(entity.locX() / 16.0D);
- int j = MathHelper.floor(entity.locY() / 16.0D); - int j = MathHelper.floor(entity.locY() / 16.0D);

View file

@ -19,7 +19,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public DedicatedServerProperties(Properties properties, IRegistryCustom iregistrycustom, OptionSet optionset) { public DedicatedServerProperties(Properties properties, IRegistryCustom iregistrycustom, OptionSet optionset) {
super(properties, optionset); super(properties, optionset);
@@ -0,0 +0,0 @@ public class DedicatedServerProperties extends PropertyManager<DedicatedServerPr @@ -0,0 +0,0 @@ public class DedicatedServerProperties extends PropertyManager<DedicatedServerPr
}, 100); this.textFilteringConfig = this.getString("text-filtering-config", "");
this.playerIdleTimeout = this.b("player-idle-timeout", 0); this.playerIdleTimeout = this.b("player-idle-timeout", 0);
this.whiteList = this.b("white-list", false); this.whiteList = this.b("white-list", false);
+ // Paper start - Configurable rcon ip + // Paper start - Configurable rcon ip

View file

@ -28,8 +28,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
synchronized (throttleTracker) { synchronized (throttleTracker) {
if (throttleTracker.containsKey(address) && !"127.0.0.1".equals(address.getHostAddress()) && currentTime - throttleTracker.get(address) < connectionThrottle) { if (throttleTracker.containsKey(address) && !"127.0.0.1".equals(address.getHostAddress()) && currentTime - throttleTracker.get(address) < connectionThrottle) {
throttleTracker.put(address, currentTime); throttleTracker.put(address, currentTime);
- chatmessage = new ChatMessage("Connection throttled! Please wait before reconnecting."); - ChatMessage chatmessage = new ChatMessage("Connection throttled! Please wait before reconnecting.");
+ chatmessage = new ChatMessage(com.destroystokyo.paper.PaperConfig.connectionThrottleKickMessage); // Paper - Configurable connection throttle kick message + ChatMessage chatmessage = new ChatMessage(com.destroystokyo.paper.PaperConfig.connectionThrottleKickMessage); // Paper - Configurable connection throttle kick message
this.c.sendPacket(new PacketLoginOutDisconnect(chatmessage)); this.c.sendPacket(new PacketLoginOutDisconnect(chatmessage));
this.c.close(chatmessage); this.c.close(chatmessage);
return; return;

View file

@ -41,7 +41,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Extracted to own function + // Extracted to own function
+ /* + /*
if (this.locY() < -64.0D) { if (this.locY() < -64.0D) {
this.am(); this.an();
} }
+ */ + */
+ this.performVoidDamage(); + this.performVoidDamage();
@ -62,8 +62,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ } + }
+ } + }
+ // Paper end + // Paper end
+ protected final void doVoidDamage() { this.am(); } // Paper - OBFHELPER +
protected void am() { + protected final void doVoidDamage() { this.an(); } // Paper - OBFHELPER
protected void an() {
this.die(); this.die();
} }
diff --git a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java diff --git a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java
@ -78,7 +79,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Extracted to own function + // Extracted to own function
+ /* + /*
if (this.locY() < -64.0D) { if (this.locY() < -64.0D) {
this.am(); this.an();
} }
+ */ + */
+ this.performVoidDamage(); + this.performVoidDamage();

View file

@ -43,7 +43,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
+ if (knockbackCancelled) this.world.broadcastEntityEffect(this, (byte) 2); // Paper - Disable explosion knockback + if (knockbackCancelled) this.world.broadcastEntityEffect(this, (byte) 2); // Paper - Disable explosion knockback
if (this.dk()) { if (this.dl()) {
if (!this.f(damagesource)) { if (!this.f(damagesource)) {
SoundEffect soundeffect = this.getSoundDeath(); SoundEffect soundeffect = this.getSoundDeath();
diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java

View file

@ -26,8 +26,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
gameprofilerfiller.enter("thunder"); gameprofilerfiller.enter("thunder");
BlockPosition blockposition; BlockPosition blockposition;
- if (flag && this.V() && this.random.nextInt(100000) == 0) { - if (flag && this.W() && this.random.nextInt(100000) == 0) {
+ if (!this.paperConfig.disableThunder && flag && this.V() && this.random.nextInt(100000) == 0) { // Paper - Disable thunder + if (!this.paperConfig.disableThunder && flag && this.W() && this.random.nextInt(100000) == 0) { // Paper - Disable thunder
blockposition = this.a(this.a(j, 0, k, 15)); blockposition = this.a(this.a(j, 0, k, 15));
if (this.isRainingAt(blockposition)) { if (this.isRainingAt(blockposition)) {
DifficultyDamageScaler difficultydamagescaler = this.getDamageScaler(blockposition); DifficultyDamageScaler difficultydamagescaler = this.getDamageScaler(blockposition);

View file

@ -27,15 +27,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
super.a(d0, flag, iblockdata, blockposition); super.a(d0, flag, iblockdata, blockposition);
} }
+ public boolean canBreatheUnderwater() { return this.cL(); } // Paper - OBFHELPER + public boolean canBreatheUnderwater() { return this.cM(); } // Paper - OBFHELPER
public boolean cL() { public boolean cM() {
return this.getMonsterType() == EnumMonsterType.UNDEAD; return this.getMonsterType() == EnumMonsterType.UNDEAD;
} }
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity { @@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
if (this.isAlive()) { if (this.isAlive()) {
if (this.a((Tag) TagsFluid.WATER) && !this.world.getType(new BlockPosition(this.locX(), this.getHeadY(), this.locZ())).a(Blocks.BUBBLE_COLUMN)) { if (this.a((Tag) TagsFluid.WATER) && !this.world.getType(new BlockPosition(this.locX(), this.getHeadY(), this.locZ())).a(Blocks.BUBBLE_COLUMN)) {
- if (!this.cL() && !MobEffectUtil.c(this) && !flag1) { - if (!this.cM() && !MobEffectUtil.c(this) && !flag1) {
+ if (!this.canBreatheUnderwater() && !MobEffectUtil.c(this) && !flag1) { // Paper - use OBFHELPER so it can be overridden + if (!this.canBreatheUnderwater() && !MobEffectUtil.c(this) && !flag1) { // Paper - use OBFHELPER so it can be overridden
this.setAirTicks(this.l(this.getAirTicks())); this.setAirTicks(this.l(this.getAirTicks()));
if (this.getAirTicks() == -20) { if (this.getAirTicks() == -20) {

View file

@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class EntityFishingHook extends IProjectile { @@ -0,0 +0,0 @@ public class EntityFishingHook extends IProjectile {
this.setMot(this.getMot().a(0.92D)); this.setMot(this.getMot().a(0.92D));
this.ae(); this.af();
+ // Paper start - These shouldn't be going through portals + // Paper start - These shouldn't be going through portals
+ if (this.inPortal) { + if (this.inPortal) {
+ this.die(); + this.die();

View file

@ -19,9 +19,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.G = 1.0F; this.G = 1.0F;
- this.c(worldserver); - this.c(worldserver);
+ //this.c(worldserver); // Paper - don't move to spawn on login, only first join + //this.c(worldserver); // Paper - don't move to spawn on login, only first join
this.co = minecraftserver.a(this);
this.cachedSingleHashSet = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper this.cachedSingleHashSet = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
} }
// CraftBukkit end // CraftBukkit end

View file

@ -34,7 +34,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (!super.setGoalTarget(entityliving, reason, fireEvent)) { if (!super.setGoalTarget(entityliving, reason, fireEvent)) {
@@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { @@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable {
if (this.world.isDay() && this.ticksLived >= this.bs + 600) { if (this.world.isDay() && this.ticksLived >= this.bs + 600) {
float f = this.aQ(); float f = this.aR();
- if (f > 0.5F && this.world.e(this.getChunkCoordinates()) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) { - if (f > 0.5F && this.world.e(this.getChunkCoordinates()) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) {
+ if (f > 0.5F && this.world.e(this.getChunkCoordinates()) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.tryEscape(EndermanEscapeEvent.Reason.RUNAWAY)) { // Paper + if (f > 0.5F && this.world.e(this.getChunkCoordinates()) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.tryEscape(EndermanEscapeEvent.Reason.RUNAWAY)) { // Paper

View file

@ -68,8 +68,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return this.ae; return this.ae;
} }
+ public final boolean isPushedByWater() { return this.bU(); } // Paper - OBFHELPER - the below is not an obfhelper, don't use it! + public final boolean isPushedByWater() { return this.bV(); } // Paper - OBFHELPER - the below is not an obfhelper, don't use it!
public boolean bU() { public boolean bV() {
// Paper start // Paper start
return this.pushedByWater(); return this.pushedByWater();
diff --git a/src/main/java/net/minecraft/server/EntityCreature.java b/src/main/java/net/minecraft/server/EntityCreature.java diff --git a/src/main/java/net/minecraft/server/EntityCreature.java b/src/main/java/net/minecraft/server/EntityCreature.java

View file

@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntityLiving.java --- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity { @@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
} else if (this.aP() && (!this.onGround || d7 > d8)) { } else if (this.aQ() && (!this.onGround || d7 > d8)) {
this.c((Tag) TagsFluid.LAVA); this.c((Tag) TagsFluid.LAVA);
} else if ((this.onGround || flag && d7 <= d8) && this.jumpTicks == 0) { } else if ((this.onGround || flag && d7 <= d8) && this.jumpTicks == 0) {
+ if (new com.destroystokyo.paper.event.entity.EntityJumpEvent(getBukkitLivingEntity()).callEvent()) { // Paper + if (new com.destroystokyo.paper.event.entity.EntityJumpEvent(getBukkitLivingEntity()).callEvent()) { // Paper

View file

@ -12,8 +12,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.datawatcher.set(EntityHuman.bl, nbttagcompound); this.datawatcher.set(EntityHuman.bl, nbttagcompound);
} }
+ public float getCooldownPeriod() { return this.eQ(); } // Paper - OBFHELPER + public float getCooldownPeriod() { return this.eR(); } // Paper - OBFHELPER
public float eQ() { public float eR() {
return (float) (1.0D / this.b(GenericAttributes.ATTACK_SPEED) * 20.0D); return (float) (1.0D / this.b(GenericAttributes.ATTACK_SPEED) * 20.0D);
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java

View file

@ -16,4 +16,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ minecraftserver.scheduleOnMain(networkmanager::handleDisconnection); // Paper + minecraftserver.scheduleOnMain(networkmanager::handleDisconnection); // Paper
} }
@Override private <T> void a(T t0, Consumer<T> consumer, BiFunction<ITextFilter, T, CompletableFuture<Optional<T>>> bifunction) {

View file

@ -11,9 +11,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
} }
public Stream<Entity> co() { public Stream<Entity> cp() {
- return Stream.concat(Stream.of(this), this.passengers.stream().flatMap(Entity::co)); - return Stream.concat(Stream.of(this), this.passengers.stream().flatMap(Entity::cp));
+ return Stream.concat(Stream.of(this), com.google.common.collect.ImmutableList.copyOf(this.passengers).stream().flatMap(Entity::co)); // Paper + return Stream.concat(Stream.of(this), com.google.common.collect.ImmutableList.copyOf(this.passengers).stream().flatMap(Entity::cp)); // Paper
} }
public boolean hasSinglePlayerPassenger() { public boolean hasSinglePlayerPassenger() {

View file

@ -43,21 +43,21 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
this.H = keypair; }
} }
- public void a(EnumDifficulty enumdifficulty, boolean flag) { - public void a(EnumDifficulty enumdifficulty, boolean flag) {
- if (flag || !this.saveData.isDifficultyLocked()) { - if (flag || !this.saveData.isDifficultyLocked()) {
- this.saveData.setDifficulty(this.saveData.isHardcore() ? EnumDifficulty.HARD : enumdifficulty); - this.saveData.setDifficulty(this.saveData.isHardcore() ? EnumDifficulty.HARD : enumdifficulty);
- this.bb(); - this.bc();
- this.getPlayerList().getPlayers().forEach(this::a); - this.getPlayerList().getPlayers().forEach(this::b);
+ // Paper start - fix per world difficulty + // Paper start - fix per world difficulty
+ public void a(WorldServer world, EnumDifficulty enumdifficulty, boolean flag) { + public void a(WorldServer world, EnumDifficulty enumdifficulty, boolean flag) {
+ WorldDataServer worldData = world.worldDataServer; + WorldDataServer worldData = world.worldDataServer;
+ if (flag || !worldData.isDifficultyLocked()) { + if (flag || !worldData.isDifficultyLocked()) {
+ worldData.setDifficulty(worldData.isHardcore() ? EnumDifficulty.HARD : enumdifficulty); + worldData.setDifficulty(worldData.isHardcore() ? EnumDifficulty.HARD : enumdifficulty);
+ world.setSpawnFlags(worldData.getDifficulty() != EnumDifficulty.PEACEFUL && ((DedicatedServer)this).propertyManager.getProperties().spawnMonsters, this.getSpawnAnimals()); + world.setSpawnFlags(worldData.getDifficulty() != EnumDifficulty.PEACEFUL && ((DedicatedServer)this).propertyManager.getProperties().spawnMonsters, this.getSpawnAnimals());
+ //world.players.forEach(this::a); + //world.players.forEach(this::b);
+ // Paper end + // Paper end
} }
} }

View file

@ -1,30 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Michael Himing <mhiming@gmail.com>
Date: Sun, 16 Dec 2018 13:07:33 +1100
Subject: [PATCH] Fix PlayerEditBookEvent
- Updating book writing (not signing) mutated the original item, making
it impossible to properly cancel the event or modify the book meta
- When the event was cancelled, the client's book would keep the
cancelled writing
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn {
itemstack2.a("pages", (NBTBase) nbttaglist);
this.player.a(packetplayinbedit.d(), CraftEventFactory.handleEditBookEvent(player, enumitemslot, itemstack1, itemstack2)); // CraftBukkit
} else {
- ItemStack old = itemstack1.cloneItemStack(); // CraftBukkit
- itemstack1.a("pages", (NBTBase) itemstack.getTag().getList("pages", 8));
- CraftEventFactory.handleEditBookEvent(player, enumitemslot, old, itemstack1); // CraftBukkit
+ // Paper start - dont mutate players current item, set it from the event
+ ItemStack newBook = itemstack1.cloneItemStack();
+ newBook.getOrCreateTagAndSet("pages", (NBTBase)itemstack.getTag().getList("pages", 8));
+ this.player.setSlot(enumitemslot, CraftEventFactory.handleEditBookEvent(player, enumitemslot, itemstack1, newBook));
+ // Paper end
}
}

View file

@ -23,7 +23,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ file = new File(bukkitConfiguration.getString("settings.world-container", ".")); + file = new File(bukkitConfiguration.getString("settings.world-container", "."));
+ } + }
+ // Paper end - fix SPIGOT-5824 + // Paper end - fix SPIGOT-5824
YggdrasilAuthenticationService yggdrasilauthenticationservice = new com.destroystokyo.paper.profile.PaperAuthenticationService(Proxy.NO_PROXY, UUID.randomUUID().toString()); // Paper YggdrasilAuthenticationService yggdrasilauthenticationservice = new com.destroystokyo.paper.profile.PaperAuthenticationService(Proxy.NO_PROXY); // Paper
MinecraftSessionService minecraftsessionservice = yggdrasilauthenticationservice.createMinecraftSessionService(); MinecraftSessionService minecraftsessionservice = yggdrasilauthenticationservice.createMinecraftSessionService();
GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository(); GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository();
- UserCache usercache = new UserCache(gameprofilerepository, new File(file, MinecraftServer.b.getName())); - UserCache usercache = new UserCache(gameprofilerepository, new File(file, MinecraftServer.b.getName()));

View file

@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
if (this.aM()) { if (this.aN()) {
PlayerList playerlist = commandlistenerwrapper.getServer().getPlayerList(); PlayerList playerlist = commandlistenerwrapper.getServer().getPlayerList();
WhiteList whitelist = playerlist.getWhitelist(); WhiteList whitelist = playerlist.getWhitelist();
+ if (!((DedicatedServer)getServer()).getDedicatedServerProperties().whiteList.get()) return; // Paper - white list not enabled + if (!((DedicatedServer)getServer()).getDedicatedServerProperties().whiteList.get()) return; // Paper - white list not enabled

View file

@ -11,9 +11,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn { @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn {
String[] lines = new String[4]; String[] lines = new String[4];
for (int i = 0; i < astring.length; ++i) { for (int i = 0; i < list.size(); ++i) {
- lines[i] = EnumChatFormat.a(new ChatComponentText(EnumChatFormat.a(astring[i])).getString()); - lines[i] = EnumChatFormat.a(new ChatComponentText(EnumChatFormat.a((String) list.get(i))).getString());
+ lines[i] = SharedConstants.a(astring[i]); //Paper - Replaced with anvil color stripping method to stop exploits that allow colored signs to be created. + // Paper TODO(Proximyst): Add obfhelper when 1.16.4 runs
+ lines[i] = SharedConstants.a(list.get(i)); // Paper - Replaced with anvil color stripping method to stop exploits that allow colored signs to be created.
} }
SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.block.CraftBlock) player.getWorld().getBlockAt(x, y, z), this.server.getPlayer(this.player), lines); SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.block.CraftBlock) player.getWorld().getBlockAt(x, y, z), this.server.getPlayer(this.player), lines);
this.server.getPluginManager().callEvent(event); this.server.getPluginManager().callEvent(event);

View file

@ -8,44 +8,37 @@ diff --git a/src/main/java/net/minecraft/server/HandshakeListener.java b/src/mai
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/HandshakeListener.java --- a/src/main/java/net/minecraft/server/HandshakeListener.java
+++ b/src/main/java/net/minecraft/server/HandshakeListener.java +++ b/src/main/java/net/minecraft/server/HandshakeListener.java
@@ -0,0 +0,0 @@ public class HandshakeListener implements PacketHandshakingInListener {
switch (packethandshakinginsetprotocol.b()) {
case LOGIN:
this.c.setProtocol(EnumProtocol.LOGIN);
- ChatMessage chatmessage;
+ IChatBaseComponent chatmessage; // Paper - Fix hex colors not working in some kick messages
// CraftBukkit start - Connection throttle
try {
@@ -0,0 +0,0 @@ public class HandshakeListener implements PacketHandshakingInListener { @@ -0,0 +0,0 @@ public class HandshakeListener implements PacketHandshakingInListener {
synchronized (throttleTracker) { synchronized (throttleTracker) {
if (throttleTracker.containsKey(address) && !"127.0.0.1".equals(address.getHostAddress()) && currentTime - throttleTracker.get(address) < connectionThrottle) { if (throttleTracker.containsKey(address) && !"127.0.0.1".equals(address.getHostAddress()) && currentTime - throttleTracker.get(address) < connectionThrottle) {
throttleTracker.put(address, currentTime); throttleTracker.put(address, currentTime);
- chatmessage = new ChatMessage(com.destroystokyo.paper.PaperConfig.connectionThrottleKickMessage); // Paper - Configurable connection throttle kick message - ChatMessage chatmessage = new ChatMessage(com.destroystokyo.paper.PaperConfig.connectionThrottleKickMessage); // Paper - Configurable connection throttle kick message
+ chatmessage = org.bukkit.craftbukkit.util.CraftChatMessage.fromString(com.destroystokyo.paper.PaperConfig.connectionThrottleKickMessage, true)[0]; // Paper - Configurable connection throttle kick message // Paper - Fix hex colors not working in some kick messages + IChatBaseComponent chatmessage = org.bukkit.craftbukkit.util.CraftChatMessage.fromString(com.destroystokyo.paper.PaperConfig.connectionThrottleKickMessage, true)[0]; // Paper - Configurable connection throttle kick message // Paper - Fix hex colors not working in some kick messages
this.c.sendPacket(new PacketLoginOutDisconnect(chatmessage)); this.c.sendPacket(new PacketLoginOutDisconnect(chatmessage));
this.c.close(chatmessage); this.c.close(chatmessage);
return; return;
@@ -0,0 +0,0 @@ public class HandshakeListener implements PacketHandshakingInListener { @@ -0,0 +0,0 @@ public class HandshakeListener implements PacketHandshakingInListener {
}
// CraftBukkit end // CraftBukkit end
if (packethandshakinginsetprotocol.c() != SharedConstants.getGameVersion().getProtocolVersion()) {
- ChatMessage chatmessage;
+ IChatBaseComponent chatmessage; // Paper - Fix hex colors not working in some kick messages
if (packethandshakinginsetprotocol.c() < 754) {
- chatmessage = new ChatMessage( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedClientMessage.replaceAll("'", "''"), SharedConstants.getGameVersion().getName() ) ); // Spigot
+ chatmessage = org.bukkit.craftbukkit.util.CraftChatMessage.fromString( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedClientMessage.replaceAll("'", "''"), SharedConstants.getGameVersion().getName() ) , true )[0]; // Spigot // Paper - Fix hex colors not working in some kick messages
} else {
- chatmessage = new ChatMessage( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedServerMessage.replaceAll("'", "''"), SharedConstants.getGameVersion().getName() ) ); // Spigot
+ chatmessage = org.bukkit.craftbukkit.util.CraftChatMessage.fromString( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedServerMessage.replaceAll("'", "''"), SharedConstants.getGameVersion().getName() ) , true )[0]; // Spigot // Paper - Fix hex colors not working in some kick messages
}
if (packethandshakinginsetprotocol.c() > SharedConstants.getGameVersion().getProtocolVersion()) {
- chatmessage = new ChatMessage( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedServerMessage.replaceAll("'", "''"), SharedConstants.getGameVersion().getName() ) ); // Spigot
+ chatmessage = org.bukkit.craftbukkit.util.CraftChatMessage.fromString( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedServerMessage.replaceAll("'", "''"), SharedConstants.getGameVersion().getName() ) , true)[0]; // Spigot // Paper - Fix hex colors not working in some kick messages
this.c.sendPacket(new PacketLoginOutDisconnect(chatmessage)); this.c.sendPacket(new PacketLoginOutDisconnect(chatmessage));
this.c.close(chatmessage);
} else if (packethandshakinginsetprotocol.c() < SharedConstants.getGameVersion().getProtocolVersion()) {
- chatmessage = new ChatMessage( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedClientMessage.replaceAll("'", "''"), SharedConstants.getGameVersion().getName() ) ); // Spigot
+ chatmessage = org.bukkit.craftbukkit.util.CraftChatMessage.fromString( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedClientMessage.replaceAll("'", "''"), SharedConstants.getGameVersion().getName() ) , true)[0]; // Spigot // Paper - Fix hex colors not working in some kick messages
this.c.sendPacket(new PacketLoginOutDisconnect(chatmessage));
this.c.close(chatmessage);
} else {
@@ -0,0 +0,0 @@ public class HandshakeListener implements PacketHandshakingInListener { @@ -0,0 +0,0 @@ public class HandshakeListener implements PacketHandshakingInListener {
if (event.callEvent()) { if (event.callEvent()) {
// If we've failed somehow, let the client know so and go no further. // If we've failed somehow, let the client know so and go no further.
if (event.isFailed()) { if (event.isFailed()) {
- chatmessage = new ChatMessage(event.getFailMessage()); - chatmessage = new ChatMessage(event.getFailMessage());
+ chatmessage = org.bukkit.craftbukkit.util.CraftChatMessage.fromString(event.getFailMessage(), true)[0]; // Paper - Fix hex colors not working in some kick messages + IChatBaseComponent chatmessage = org.bukkit.craftbukkit.util.CraftChatMessage.fromString(event.getFailMessage(), true)[0]; // Paper - Fix hex colors not working in some kick messages
this.getNetworkManager().sendPacket(new PacketLoginOutDisconnect(chatmessage)); this.getNetworkManager().sendPacket(new PacketLoginOutDisconnect(chatmessage));
this.getNetworkManager().close(chatmessage); this.getNetworkManager().close(chatmessage);
return; return;

View file

@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/WorldServer.java --- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed { @@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
if (entity.co().anyMatch(this::isUUIDTaken)) { if (entity.cp().anyMatch(this::isUUIDTaken)) {
return false; return false;
} else { } else {
- return this.addAllEntities(entity, reason); // CraftBukkit - return this.addAllEntities(entity, reason); // CraftBukkit

View file

@ -37,8 +37,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.getChunkAt(entity.chunkX, entity.chunkZ).a(entity, entity.chunkY); this.getChunkAt(entity.chunkX, entity.chunkZ).a(entity, entity.chunkY);
} }
- if (!entity.cj() && !this.isChunkLoaded(i, k)) { - if (!entity.ck() && !this.isChunkLoaded(i, k)) {
+ if (!entity.valid && !entity.cj() && !this.isChunkLoaded(i, k)) { // Paper - always load chunks to register valid entities location + if (!entity.valid && !entity.ck() && !this.isChunkLoaded(i, k)) { // Paper - always load chunks to register valid entities location
if (entity.inChunk) { if (entity.inChunk) {
WorldServer.LOGGER.warn("Entity {} left loaded chunk area", entity); WorldServer.LOGGER.warn("Entity {} left loaded chunk area", entity);
} }

View file

@ -14,7 +14,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -0,0 +0,0 @@ public class Main { @@ -0,0 +0,0 @@ public class Main {
Calendar deadline = Calendar.getInstance(); Calendar deadline = Calendar.getInstance();
deadline.add(Calendar.DAY_OF_YEAR, -21); deadline.add(Calendar.DAY_OF_YEAR, -7);
if (buildDate.before(deadline.getTime())) { if (buildDate.before(deadline.getTime())) {
- System.err.println("*** Error, this build is outdated ***"); - System.err.println("*** Error, this build is outdated ***");
+ // Paper start - This is some stupid bullshit + // Paper start - This is some stupid bullshit

View file

@ -52,7 +52,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if ( Boolean.getBoolean( "debug.rewriteForIde" ) ) + if ( Boolean.getBoolean( "debug.rewriteForIde" ) )
+ { + {
+ // unversion incoming calls for pre-relocate debug work + // unversion incoming calls for pre-relocate debug work
+ final String NMS_REVISION_PACKAGE = "v1_16_R2/"; + final String NMS_REVISION_PACKAGE = "v1_16_R3/";
+ +
+ getAndRemove.put( "net/minecraft/".concat( "server/" + NMS_REVISION_PACKAGE ), NMS_REVISION_PACKAGE ); + getAndRemove.put( "net/minecraft/".concat( "server/" + NMS_REVISION_PACKAGE ), NMS_REVISION_PACKAGE );
+ getAndRemove.put( "org/bukkit/".concat( "craftbukkit/" + NMS_REVISION_PACKAGE ), NMS_REVISION_PACKAGE ); + getAndRemove.put( "org/bukkit/".concat( "craftbukkit/" + NMS_REVISION_PACKAGE ), NMS_REVISION_PACKAGE );

View file

@ -141,17 +141,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public float getBukkitYaw() { public float getBukkitYaw() {
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity { @@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
if (knockbackCancelled) this.world.broadcastEntityEffect(this, (byte) 2); // Paper - Disable explosion knockback if (knockbackCancelled) this.world.broadcastEntityEffect(this, (byte) 2); // Paper - Disable explosion knockback
if (this.dk()) { if (this.dl()) {
if (!this.f(damagesource)) { if (!this.f(damagesource)) {
- SoundEffect soundeffect = this.getSoundDeath(); - SoundEffect soundeffect = this.getSoundDeath();
+ // Paper start - moved into CraftEventFactory event caller for cancellable death event + // Paper start - moved into CraftEventFactory event caller for cancellable death event
+ //SoundEffect soundeffect = this.getSoundDeath(); + //SoundEffect soundeffect = this.getSoundDeath();
- if (flag1 && soundeffect != null) { - if (flag1 && soundeffect != null) {
- this.playSound(soundeffect, this.getSoundVolume(), this.dG()); - this.playSound(soundeffect, this.getSoundVolume(), this.dH());
- } - }
+// if (flag1 && soundeffect != null) { +// if (flag1 && soundeffect != null) {
+// this.playSound(soundeffect, this.getSoundVolume(), this.dG()); +// this.playSound(soundeffect, this.getSoundVolume(), this.dH());
+// } +// }
+ this.silentDeath = !flag1; // mark entity as dying silently + this.silentDeath = !flag1; // mark entity as dying silently
+ // Paper end + // Paper end
@ -269,8 +269,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return 1.0F; return 1.0F;
} }
+ public float getSoundPitch() { return dG();} // Paper - OBFHELPER + public float getSoundPitch() { return dH();} // Paper - OBFHELPER
protected float dG() { protected float dH() {
return this.isBaby() ? (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.5F : (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F; return this.isBaby() ? (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.5F : (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F;
} }
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java

View file

@ -105,7 +105,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
r0.run(); r0.run();
} catch (Exception exception) { } catch (Exception exception) {
+ if (exception.getCause() instanceof ThreadDeath) throw exception; // Paper + if (exception.getCause() instanceof ThreadDeath) throw exception; // Paper
IAsyncTaskHandler.LOGGER.fatal("Error executing task on {}", this.bi(), exception); IAsyncTaskHandler.LOGGER.fatal("Error executing task on {}", this.bj(), exception);
} }
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java

View file

@ -37,6 +37,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
worldloadlistener.b(); worldloadlistener.b();
- chunkproviderserver.getLightEngine().a(5); - chunkproviderserver.getLightEngine().a(5);
+ chunkproviderserver.getLightEngine().a(worldserver.paperConfig.lightQueueSize); // Paper - increase light queue size + chunkproviderserver.getLightEngine().a(worldserver.paperConfig.lightQueueSize); // Paper - increase light queue size
this.bb(); this.bc();
// CraftBukkit start // CraftBukkit start

View file

@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntityHuman.java --- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving { @@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving {
this.es(); this.et();
super.tick(); super.tick();
if (!this.world.isClientSide && this.activeContainer != null && !this.activeContainer.canUse(this)) { if (!this.world.isClientSide && this.activeContainer != null && !this.activeContainer.canUse(this)) {
- this.closeInventory(); - this.closeInventory();

View file

@ -36,16 +36,20 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn { @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn {
String[] lines = new String[4]; String[] lines = new String[4];
for (int i = 0; i < astring.length; ++i) { for (int i = 0; i < list.size(); ++i) {
+ // Paper start - cap line length - modified clients can send longer data than normal + // Paper start - cap line length - modified clients can send longer data than normal
+ if (MAX_SIGN_LINE_LENGTH > 0 && astring[i].length() > MAX_SIGN_LINE_LENGTH) { + String currentLine = list.get(i);
+ if (MAX_SIGN_LINE_LENGTH > 0 && currentLine.length() > MAX_SIGN_LINE_LENGTH) {
+ // This handles multibyte characters as 1 + // This handles multibyte characters as 1
+ int offset = astring[i].codePoints().limit(MAX_SIGN_LINE_LENGTH).map(Character::charCount).sum(); + int offset = currentLine.codePoints().limit(MAX_SIGN_LINE_LENGTH).map(Character::charCount).sum();
+ if (offset < astring[i].length()) { + if (offset < currentLine.length()) {
+ astring[i] = astring[i].substring(0, offset); + list.set(i, currentLine = currentLine.substring(0, offset));
+ } + }
+ } + }
+ // Paper end + // Paper end
lines[i] = SharedConstants.a(astring[i]); //Paper - Replaced with anvil color stripping method to stop exploits that allow colored signs to be created. // Paper TODO(Proximyst): Add obfhelper when 1.16.4 runs
- lines[i] = SharedConstants.a(list.get(i)); // Paper - Replaced with anvil color stripping method to stop exploits that allow colored signs to be created.
+ lines[i] = SharedConstants.a(currentLine); // Paper - Replaced with anvil color stripping method to stop exploits that allow colored signs to be created.
} }
SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.block.CraftBlock) player.getWorld().getBlockAt(x, y, z), this.server.getPlayer(this.player), lines); SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.block.CraftBlock) player.getWorld().getBlockAt(x, y, z), this.server.getPlayer(this.player), lines);
this.server.getPluginManager().callEvent(event);

View file

@ -22,14 +22,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return this.activeItem; return this.activeItem;
} }
+ public int getItemUseRemainingTime() { return this.dY(); } // Paper - OBFHELPER + public int getItemUseRemainingTime() { return this.dZ(); } // Paper - OBFHELPER
public int dY() { public int dZ() {
return this.bd; return this.bd;
} }
+ public int getHandRaisedTime() { return this.dZ(); } // Paper - OBFHELPER + public int getHandRaisedTime() { return this.ea(); } // Paper - OBFHELPER
public int dZ() { public int ea() {
return this.isHandRaised() ? this.activeItem.k() - this.dY() : 0; return this.isHandRaised() ? this.activeItem.k() - this.dZ() : 0;
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644

View file

@ -607,6 +607,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ this.lootableData.loadNbt(nbttagcompound); // Paper + this.lootableData.loadNbt(nbttagcompound); // Paper
if (nbttagcompound.hasKeyOfType("LootTable", 8)) { if (nbttagcompound.hasKeyOfType("LootTable", 8)) {
this.lootTable = new MinecraftKey(nbttagcompound.getString("LootTable")); this.lootTable = new MinecraftKey(nbttagcompound.getString("LootTable"));
+ try { org.bukkit.craftbukkit.util.CraftNamespacedKey.fromMinecraft(this.lootTable); } catch (IllegalArgumentException ex) { this.lootTable = null; } // Paper - validate
this.lootTableSeed = nbttagcompound.getLong("LootTableSeed"); this.lootTableSeed = nbttagcompound.getLong("LootTableSeed");
- return true; - return true;
+ return false; // Paper - always load the items, table may still remain + return false; // Paper - always load the items, table may still remain

View file

@ -847,3 +847,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
NBTTagCompound nbttagcompound = this.a(s, SharedConstants.getGameVersion().getWorldVersion()); NBTTagCompound nbttagcompound = this.a(s, SharedConstants.getGameVersion().getWorldVersion());
t0.a(nbttagcompound.getCompound("data")); t0.a(nbttagcompound.getCompound("data"));
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
}
// CraftBukkit - decompile error
- return (String) object2intopenhashmap.object2IntEntrySet().stream().sorted(Comparator.comparing(it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<MinecraftKey>::getIntValue).reversed()).limit(5L).map((it_unimi_dsi_fastutil_objects_object2intmap_entry) -> {
+ return (String) object2intopenhashmap.object2IntEntrySet().stream().sorted(Comparator.comparing(Object2IntMap.Entry<MinecraftKey>::getIntValue).reversed()).limit(5L).map((it_unimi_dsi_fastutil_objects_object2intmap_entry) -> { // Paper - decompile fix
return it_unimi_dsi_fastutil_objects_object2intmap_entry.getKey() + ":" + it_unimi_dsi_fastutil_objects_object2intmap_entry.getIntValue();
}).collect(Collectors.joining(","));
} catch (Exception exception) {

View file

@ -3146,8 +3146,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
super(worldserver, worldserver.getSpawn(), worldserver.v(), gameprofile); super(worldserver, worldserver.getSpawn(), worldserver.v(), gameprofile);
this.spawnDimension = World.OVERWORLD; this.spawnDimension = World.OVERWORLD;
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.G = 1.0F;
this.c(worldserver); this.c(worldserver);
this.co = minecraftserver.a(this);
+ this.cachedSingleHashSet = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper + this.cachedSingleHashSet = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper
+ +
@ -4499,10 +4499,10 @@ diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java --- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -0,0 +0,0 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectMap; @@ -0,0 +0,0 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectMap.Entry;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap.Entry;
import it.unimi.dsi.fastutil.longs.LongSet; import it.unimi.dsi.fastutil.longs.LongSet;
import it.unimi.dsi.fastutil.longs.LongSets; import it.unimi.dsi.fastutil.longs.LongSets;
import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
+import it.unimi.dsi.fastutil.objects.Object2IntMap; +import it.unimi.dsi.fastutil.objects.Object2IntMap;
import it.unimi.dsi.fastutil.objects.ObjectIterator; import it.unimi.dsi.fastutil.objects.ObjectIterator;
import it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet; import it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet;

View file

@ -239,7 +239,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.persistentRaid.a(); this.persistentRaid.a();
@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed { @@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
timings.doSounds.startTiming(); // Spigot timings.doSounds.startTiming(); // Spigot
this.aj(); this.ak();
timings.doSounds.stopTiming(); // Spigot timings.doSounds.stopTiming(); // Spigot
+ this.getMinecraftServer().midTickLoadChunks(); // Paper + this.getMinecraftServer().midTickLoadChunks(); // Paper
this.ticking = false; this.ticking = false;

View file

@ -291,7 +291,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- BlockPosition blockposition; - BlockPosition blockposition;
+ final BlockPosition.MutableBlockPosition blockposition = this.chunkTickMutablePosition; // Paper - use mutable to reduce allocation rate, final to force compile fail on change + final BlockPosition.MutableBlockPosition blockposition = this.chunkTickMutablePosition; // Paper - use mutable to reduce allocation rate, final to force compile fail on change
if (!this.paperConfig.disableThunder && flag && this.V() && this.random.nextInt(100000) == 0) { // Paper - Disable thunder if (!this.paperConfig.disableThunder && flag && this.W() && this.random.nextInt(100000) == 0) { // Paper - Disable thunder
- blockposition = this.a(this.a(j, 0, k, 15)); - blockposition = this.a(this.a(j, 0, k, 15));
+ blockposition.setValues(this.a(this.a(j, 0, k, 15))); // Paper + blockposition.setValues(this.a(this.a(j, 0, k, 15))); // Paper
if (this.isRainingAt(blockposition)) { if (this.isRainingAt(blockposition)) {

View file

@ -22,7 +22,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public void initUUID() public void initUUID()
{ {
@@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener { @@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener {
this.networkManager.sendPacket(new PacketLoginOutEncryptionBegin("", this.server.getKeyPair().getPublic(), this.e)); this.networkManager.sendPacket(new PacketLoginOutEncryptionBegin("", this.server.getKeyPair().getPublic().getEncoded(), this.e));
} else { } else {
// Spigot start // Spigot start
- new Thread("User Authenticator #" + LoginListener.b.incrementAndGet()) { - new Thread("User Authenticator #" + LoginListener.b.incrementAndGet()) {
@ -43,25 +43,25 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
@@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener { @@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener {
this.loginKey = packetlogininencryptionbegin.a(privatekey); throw new IllegalStateException("Protocol error", cryptographyexception);
this.g = LoginListener.EnumProtocolState.AUTHENTICATING; }
this.networkManager.a(this.loginKey);
- Thread thread = new Thread("User Authenticator #" + LoginListener.b.incrementAndGet()) { - Thread thread = new Thread("User Authenticator #" + LoginListener.b.incrementAndGet()) {
+ // Paper start - Cache authenticator threads + // Paper start - Cache authenticator threads
+ authenticatorPool.execute(new Runnable() { + authenticatorPool.execute(new Runnable() {
public void run() { public void run() {
GameProfile gameprofile = LoginListener.this.i; GameProfile gameprofile = LoginListener.this.i;
@@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener { @@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener {
return LoginListener.this.server.V() && socketaddress instanceof InetSocketAddress ? ((InetSocketAddress) socketaddress).getAddress() : null; return LoginListener.this.server.W() && socketaddress instanceof InetSocketAddress ? ((InetSocketAddress) socketaddress).getAddress() : null;
} }
- }; - };
- -
- thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(LoginListener.LOGGER)); - thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(LoginListener.LOGGER));
- thread.start(); - thread.start();
+ }); + });
+ // Paper end + // Paper end
}
} }
// Spigot start

View file

@ -38,7 +38,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
} }
public boolean bU() { public boolean bV() {
+ // Paper start + // Paper start
+ return this.pushedByWater(); + return this.pushedByWater();
+ } + }

View file

@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- <artifactId>spigot</artifactId> - <artifactId>spigot</artifactId>
+ <artifactId>paper</artifactId> + <artifactId>paper</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<version>1.16.3-R0.1-SNAPSHOT</version> <version>1.16.4-R0.1-SNAPSHOT</version>
- <name>Spigot</name> - <name>Spigot</name>
- <url>https://www.spigotmc.org/</url> - <url>https://www.spigotmc.org/</url>
+ <name>Paper</name> + <name>Paper</name>
@ -27,7 +27,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ <!-- <skipTests>true</skipTests> Paper - This [was] not going to end well --> + <!-- <skipTests>true</skipTests> Paper - This [was] not going to end well -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<api.version>unknown</api.version> <api.version>unknown</api.version>
<minecraft.version>1.16.3</minecraft.version> <minecraft.version>1.16.4</minecraft.version>
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@
</properties> </properties>
@ -202,12 +202,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class Main { @@ -0,0 +0,0 @@ public class Main {
} }
if (false && Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) { if (Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) {
- Date buildDate = new Date(Integer.parseInt(Main.class.getPackage().getImplementationVendor()) * 1000L); - Date buildDate = new Date(Integer.parseInt(Main.class.getPackage().getImplementationVendor()) * 1000L);
+ Date buildDate = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").parse(Main.class.getPackage().getImplementationVendor()); // Paper + Date buildDate = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").parse(Main.class.getPackage().getImplementationVendor()); // Paper
Calendar deadline = Calendar.getInstance(); Calendar deadline = Calendar.getInstance();
deadline.add(Calendar.DAY_OF_YEAR, -21); deadline.add(Calendar.DAY_OF_YEAR, -7);
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java --- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java

View file

@ -32,13 +32,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private SecretKey loginKey; private SecretKey loginKey;
private EntityPlayer l; private EntityPlayer l;
@@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener { @@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener {
final org.bukkit.craftbukkit.CraftServer server = LoginListener.this.server.server; final org.bukkit.craftbukkit.CraftServer server = LoginListener.this.server.server;
// Paper start // Paper start
- PlayerProfile profile = Bukkit.createProfile(uniqueId, playerName); - PlayerProfile profile = Bukkit.createProfile(uniqueId, playerName);
+ PlayerProfile profile = CraftPlayerProfile.asBukkitMirror(getGameProfile()); + PlayerProfile profile = CraftPlayerProfile.asBukkitMirror(getGameProfile());
AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, uniqueId, profile); AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, uniqueId, profile);
server.getPluginManager().callEvent(asyncEvent); server.getPluginManager().callEvent(asyncEvent);
profile = asyncEvent.getPlayerProfile(); profile = asyncEvent.getPlayerProfile();
- profile.complete(); - profile.complete();
- i = CraftPlayerProfile.asAuthlibCopy(profile); - i = CraftPlayerProfile.asAuthlibCopy(profile);

View file

@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntityPlayer.java --- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.eV(); this.eW();
} }
// SPIGOT-5478 must be called manually now // SPIGOT-5478 must be called manually now
- this.dropExperience(); - this.dropExperience();

View file

@ -12,8 +12,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
+ public final int getMaxAirTicks() { return bG(); } // Paper - OBFHELPER + public final int getMaxAirTicks() { return bH(); } // Paper - OBFHELPER
public int bG() { public int bH() {
return 300; return 300;
} }
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java

View file

@ -24,7 +24,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_PLAYER_ATTACK_SWEEP, this.getSoundCategory(), 1.0F, 1.0F); - this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_PLAYER_ATTACK_SWEEP, this.getSoundCategory(), 1.0F, 1.0F);
+ sendSoundEffect(this, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_PLAYER_ATTACK_SWEEP, this.getSoundCategory(), 1.0F, 1.0F); // Paper - send while respecting visibility + sendSoundEffect(this, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_PLAYER_ATTACK_SWEEP, this.getSoundCategory(), 1.0F, 1.0F); // Paper - send while respecting visibility
this.ew(); this.ex();
} }
@@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving { @@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving {

View file

@ -49,7 +49,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/craftbukkit/Main.java --- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -0,0 +0,0 @@ public class Main { @@ -0,0 +0,0 @@ public class Main {
deadline.add(Calendar.DAY_OF_YEAR, -21); deadline.add(Calendar.DAY_OF_YEAR, -7);
if (buildDate.before(deadline.getTime())) { if (buildDate.before(deadline.getTime())) {
System.err.println("*** Error, this build is outdated ***"); System.err.println("*** Error, this build is outdated ***");
- System.err.println("*** Please download a new build as per instructions from https://www.spigotmc.org/go/outdated-spigot ***"); - System.err.println("*** Please download a new build as per instructions from https://www.spigotmc.org/go/outdated-spigot ***");

View file

@ -56,8 +56,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@Override @Override
public boolean a() { public boolean a() {
- return (this.a.isInWater() || this.a.aP()) && this.a.getControllerMove() instanceof EntitySlime.ControllerMoveSlime; - return (this.a.isInWater() || this.a.aQ()) && this.a.getControllerMove() instanceof EntitySlime.ControllerMoveSlime;
+ return (this.a.isInWater() || this.a.aP()) && this.a.getControllerMove() instanceof EntitySlime.ControllerMoveSlime && this.a.canWander && new SlimeSwimEvent((Slime) this.a.getBukkitEntity()).callEvent(); // Paper + return (this.a.isInWater() || this.a.aQ()) && this.a.getControllerMove() instanceof EntitySlime.ControllerMoveSlime && this.a.canWander && new SlimeSwimEvent((Slime) this.a.getBukkitEntity()).callEvent(); // Paper
} }
@Override @Override
@ -65,8 +65,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@Override @Override
public boolean a() { public boolean a() {
- return this.a.getGoalTarget() == null && (this.a.onGround || this.a.isInWater() || this.a.aP() || this.a.hasEffect(MobEffects.LEVITATION)) && this.a.getControllerMove() instanceof EntitySlime.ControllerMoveSlime; - return this.a.getGoalTarget() == null && (this.a.onGround || this.a.isInWater() || this.a.aQ() || this.a.hasEffect(MobEffects.LEVITATION)) && this.a.getControllerMove() instanceof EntitySlime.ControllerMoveSlime;
+ return this.a.getGoalTarget() == null && (this.a.onGround || this.a.isInWater() || this.a.aP() || this.a.hasEffect(MobEffects.LEVITATION)) && this.a.getControllerMove() instanceof EntitySlime.ControllerMoveSlime && this.a.canWander; // Paper - add canWander + return this.a.getGoalTarget() == null && (this.a.onGround || this.a.isInWater() || this.a.aQ() || this.a.hasEffect(MobEffects.LEVITATION)) && this.a.getControllerMove() instanceof EntitySlime.ControllerMoveSlime && this.a.canWander; // Paper - add canWander
} }
@Override @Override

View file

@ -1038,7 +1038,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- org.bukkit.craftbukkit.SpigotTimings.entityMoveTimer.stopTiming(); // Spigot - org.bukkit.craftbukkit.SpigotTimings.entityMoveTimer.stopTiming(); // Spigot
} }
protected BlockPosition ao() { protected BlockPosition ap() {
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java --- a/src/main/java/net/minecraft/server/EntityLiving.java
@ -1115,7 +1115,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.collideNearby(); this.collideNearby();
- SpigotTimings.timerEntityAICollision.stopTiming(); // Spigot - SpigotTimings.timerEntityAICollision.stopTiming(); // Spigot
this.world.getMethodProfiler().exit(); this.world.getMethodProfiler().exit();
if (!this.world.isClientSide && this.dN() && this.aF()) { if (!this.world.isClientSide && this.dO() && this.aG()) {
this.damageEntity(DamageSource.DROWN, 1.0F); this.damageEntity(DamageSource.DROWN, 1.0F);
diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
@ -1714,7 +1714,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.L = new ObjectLinkedOpenHashSet(); this.L = new ObjectLinkedOpenHashSet();
this.Q = flag1; this.Q = flag1;
@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed { @@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
this.P(); this.Q();
this.b(); this.b();
gameprofilerfiller.exitEnter("chunkSource"); gameprofilerfiller.exitEnter("chunkSource");
+ this.timings.chunkProviderTick.startTiming(); // Paper - timings + this.timings.chunkProviderTick.startTiming(); // Paper - timings
@ -1736,7 +1736,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ this.timings.raids.stopTiming(); // Paper - timings + this.timings.raids.stopTiming(); // Paper - timings
gameprofilerfiller.exitEnter("blockEvents"); gameprofilerfiller.exitEnter("blockEvents");
timings.doSounds.startTiming(); // Spigot timings.doSounds.startTiming(); // Spigot
this.aj(); this.ak();
@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed { @@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
} }

View file

@ -325,7 +325,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ System.setProperty(TerminalConsoleAppender.JLINE_OVERRIDE_PROPERTY, "false"); // Paper + System.setProperty(TerminalConsoleAppender.JLINE_OVERRIDE_PROPERTY, "false"); // Paper
} }
if (false && Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) { if (Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) {
@@ -0,0 +0,0 @@ public class Main { @@ -0,0 +0,0 @@ public class Main {
System.out.println("Unable to read system info"); System.out.println("Unable to read system info");
} }

View file

@ -1,34 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MiniDigger | Martin <admin@minidigger.dev>
Date: Wed, 2 Sep 2020 13:56:18 +0200
Subject: [PATCH] Use wrapped StructureManager to prevent worldgen deadlock
diff --git a/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java b/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java
+++ b/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java
@@ -0,0 +0,0 @@ public class RegionLimitedWorldAccess implements GeneratorAccessSeed {
private final BiomeManager m;
private final ChunkCoordIntPair n;
private final ChunkCoordIntPair o;
+ private final StructureManager structureManager; // Paper - cache wrapped structure manager
public RegionLimitedWorldAccess(WorldServer worldserver, List<IChunkAccess> list) {
int i = MathHelper.floor(Math.sqrt((double) list.size()));
@@ -0,0 +0,0 @@ public class RegionLimitedWorldAccess implements GeneratorAccessSeed {
this.m = new BiomeManager(this, BiomeManager.a(this.g), worldserver.getDimensionManager().getGenLayerZoomer());
this.n = ((IChunkAccess) list.get(0)).getPos();
this.o = ((IChunkAccess) list.get(list.size() - 1)).getPos();
+ this.structureManager = this.f.getStructureManager().a(this); // Paper - cache wrapped structure manager
}
}
@@ -0,0 +0,0 @@ public class RegionLimitedWorldAccess implements GeneratorAccessSeed {
@Override
public Stream<? extends StructureStart<?>> a(SectionPosition sectionposition, StructureGenerator<?> structuregenerator) {
- return this.f.a(sectionposition, structuregenerator);
+ return structureManager.a(sectionposition, structuregenerator); // Paper - wrapped structure manager to prevent deadlock, see #4272 and MC-199487
}
}

View file

@ -27,9 +27,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
- public void be() { - public void bf() {
+ // Paper start + // Paper start
+ public void be() { stopRiding(false); } + public void bf() { stopRiding(false); }
+ public void stopRiding(boolean suppressCancellation) { + public void stopRiding(boolean suppressCancellation) {
+ // Paper end + // Paper end
if (this.vehicle != null) { if (this.vehicle != null) {
@ -80,10 +80,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
- @Override - @Override
- public void be() { - public void bf() {
- super.be(); - super.bf();
+ // Paper start + // Paper start
+ @Override public void be() { stopRiding(false); } + @Override public void bf() { stopRiding(false); }
+ @Override public void stopRiding(boolean suppressCancellation) { + @Override public void stopRiding(boolean suppressCancellation) {
+ // Paper end + // Paper end
+ super.stopRiding(suppressCancellation); // Paper - suppress + super.stopRiding(suppressCancellation); // Paper - suppress

View file

@ -317,7 +317,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// CraftBukkit end // CraftBukkit end
} }
+ private void saveData() { this.ai(); } // Paper - OBFHELPER + private void saveData() { this.aj(); } // Paper - OBFHELPER
private void ai() { private void aj() {
if (this.dragonBattle != null) { if (this.dragonBattle != null) {
this.worldDataServer.a(this.dragonBattle.a()); // CraftBukkit this.worldDataServer.a(this.dragonBattle.a()); // CraftBukkit

View file

@ -22,7 +22,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public MinecraftServer(OptionSet options, DataPackConfiguration datapackconfiguration, Thread thread, IRegistryCustom.Dimension iregistrycustom_dimension, Convertable.ConversionSession convertable_conversionsession, SaveData savedata, ResourcePackRepository resourcepackrepository, Proxy proxy, DataFixer datafixer, DataPackResources datapackresources, MinecraftSessionService minecraftsessionservice, GameProfileRepository gameprofilerepository, UserCache usercache, WorldLoadListenerFactory worldloadlistenerfactory) { public MinecraftServer(OptionSet options, DataPackConfiguration datapackconfiguration, Thread thread, IRegistryCustom.Dimension iregistrycustom_dimension, Convertable.ConversionSession convertable_conversionsession, SaveData savedata, ResourcePackRepository resourcepackrepository, Proxy proxy, DataFixer datafixer, DataPackResources datapackresources, MinecraftSessionService minecraftsessionservice, GameProfileRepository gameprofilerepository, UserCache usercache, WorldLoadListenerFactory worldloadlistenerfactory) {
super("Server"); super("Server");
+ SERVER = this; // Paper - better singleton + SERVER = this; // Paper - better singleton
this.m = new GameProfilerSwitcher(SystemUtils.a, this::ah); this.m = new GameProfilerSwitcher(SystemUtils.a, this::ai);
this.methodProfiler = GameProfilerDisabled.a; this.methodProfiler = GameProfilerDisabled.a;
this.serverPing = new ServerPing(); this.serverPing = new ServerPing();
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas

View file

@ -7,3 +7,8 @@
* lighting is bork (load chunk, fly away, come back, everything or parts are black) * lighting is bork (load chunk, fly away, come back, everything or parts are black)
* chunk generation seems slow with a lot of it happening * chunk generation seems slow with a lot of it happening
* Fix IDE Debug JVM Flag for new versions of minecraft * Fix IDE Debug JVM Flag for new versions of minecraft
* Check if `PlayerEditBookEvent`: https://github.com/PaperMC/Paper/pull/1751
The PlayerEditBookEvent is straight up not called anymore.
The method to call it must now be `PlayerConnection#a(List<String>, int)` (CB bug).
The item is presumably edited with the new page contents before it ever reaches this method?

@ -1 +1 @@
Subproject commit b2025bdddde79aea004399ec5f3652a1bce56b7a Subproject commit 501ea060743c7bba4436878207e4f1232298efce

@ -1 +1 @@
Subproject commit 4abf9e96df578e4c842c865e50d0933ce0616938 Subproject commit 308851669a4b264468e83cfb75215bff3638b2c0

@ -1 +1 @@
Subproject commit dea4138900788a64db46db74903cf7ed50681738 Subproject commit 3af81c717980b5e114cb27029e7ee8f1defac841

@ -1 +1 @@
Subproject commit 57bbdd8eb797a51960cf9a47f764b68f97d4f18c Subproject commit f011ca24f2b53e0fb0e7a1cfa7afd5336a85beec