Skip to content

Commit

Permalink
Update Paper
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yh-china committed Nov 7, 2023
1 parent 4e178db commit d7e4fbc
Show file tree
Hide file tree
Showing 27 changed files with 126 additions and 137 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repositories {
}

dependencies {
remapper("net.fabricmc:tiny-remapper:0.8.6:fat")
remapper("net.fabricmc:tiny-remapper:0.8.10 :fat")
decompiler("net.minecraftforge:forgeflower:2.0.627.2")
paperclip("top.leavesmc:leavesclip:1.0.2")
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ version=1.20.2-R0.1-SNAPSHOT
mcVersion=1.20.2
packageVersion=1_20_R2
org.gradle.jvmargs=-Xmx2G
paperRef=5bb30ce95b14293f5bfebf10be2fdf929eabcc01
paperRef=4675152f4908431e0f944a7bf9fa3b2181a2dfd6
preVersion=false
4 changes: 2 additions & 2 deletions patches/api/0009-Force-peaceful-mode-switch.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Force peaceful mode switch


diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 91eb95b04094394e8dc1e3a3343efc63690c87e4..1240a16b45e037f137e14200e2edab780705576d 100644
index 17d404d6d1a5b46b58d612fca38f17e71adee92e..cf83520291722436734914f348e32ae176d4ec51 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -4080,6 +4080,12 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -4168,6 +4168,12 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@NotNull
public Set<FeatureFlag> getFeatureFlags();

Expand Down
22 changes: 11 additions & 11 deletions patches/server/0002-Delete-Timings.patch
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,7 @@ index d10abd28c522612934aada8124e5bb67a9b4e9da..4a87d5d7f0bfa777ba311ac021d88784
i = this.context.runTopCommand(customfunction1, source);
} finally {
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index aeab76b091221d3ed5df221faada70739a7d25a4..10d92f7a5bc8582df7322744bb42adcf1ecdc371 100644
index 749087baa24d6c07d09ef0f93fa6bde694d72a93..8dbe0d3e867b3fa2478f2ad1e74e4763ff41d105 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -58,7 +58,6 @@ import org.apache.logging.log4j.Level;
Expand All @@ -1136,7 +1136,7 @@ index aeab76b091221d3ed5df221faada70739a7d25a4..10d92f7a5bc8582df7322744bb42adcf
}

@Override
@@ -772,21 +769,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -775,21 +772,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
}
// Paper start
command.set(event.getCommand());
Expand All @@ -1159,7 +1159,7 @@ index aeab76b091221d3ed5df221faada70739a7d25a4..10d92f7a5bc8582df7322744bb42adcf
// Paper start
if (waitableArray[0] != null) {
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 6a49a36f64521f0bddcf21585ee507040119fd6d..ae168e17b01fd814793dda2e4ac9b38a3505adad 100644
index caa73632aee15583c6b6ed12a668c8f49b794708..f0d4e84f7ba4e2b669ec0f748a7ab50eac90fdfe 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1,13 +1,10 @@
Expand Down Expand Up @@ -1249,7 +1249,7 @@ index 6a49a36f64521f0bddcf21585ee507040119fd6d..ae168e17b01fd814793dda2e4ac9b38a
// CraftBukkit end

public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider {
@@ -468,15 +453,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -548,15 +533,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
protected void tick(BooleanSupplier shouldKeepTicking) {
ProfilerFiller gameprofilerfiller = this.level.getProfiler();

Expand All @@ -1265,15 +1265,15 @@ index 6a49a36f64521f0bddcf21585ee507040119fd6d..ae168e17b01fd814793dda2e4ac9b38a
}

gameprofilerfiller.pop();
@@ -1090,7 +1071,6 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -1188,7 +1169,6 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
List<ServerPlayer> list = Lists.newArrayList();
List<ServerPlayer> list1 = this.level.players();
ObjectIterator objectiterator = this.entityMap.values().iterator();
- level.timings.tracker1.startTiming(); // Paper

ChunkMap.TrackedEntity playerchunkmap_entitytracker;

@@ -1115,17 +1095,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -1213,17 +1193,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
playerchunkmap_entitytracker.serverEntity.sendChanges();
}
}
Expand Down Expand Up @@ -1618,7 +1618,7 @@ index 584a768f2ce1c98a1de7749060c47f21721f9055..2f6f2a5504d51cc9277233ce5d1ca0e2

} else if (close) { chunkproviderserver.close(false); } // Paper - rewrite chunk system
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 8bca5ba75977c0a61197eb47c94f0456d66b29a4..b6529d2898b4aceee90ebd768f1b07f699798de7 100644
index 33be0db006cca66f38f2105924466b0210139848..64adb7da5c745b7800c1060b276e28f27602c535 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2388,7 +2388,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
Expand Down Expand Up @@ -1652,7 +1652,7 @@ index 8bca5ba75977c0a61197eb47c94f0456d66b29a4..b6529d2898b4aceee90ebd768f1b07f6
}
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 03d2dc7f68d6918065f852057321fbaaf22fb413..798f24bd82a899a0d78b06064e182139fd29687c 100644
index 33abcf12b4426572b74ca4c813e4392c823494bc..733170a3666e74bd87f6a50fda2d00529a08c55f 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1,6 +1,5 @@
Expand All @@ -1662,15 +1662,15 @@ index 03d2dc7f68d6918065f852057321fbaaf22fb413..798f24bd82a899a0d78b06064e182139
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
@@ -1211,7 +1210,6 @@ public abstract class PlayerList {
@@ -1232,7 +1231,6 @@ public abstract class PlayerList {

public void saveAll(int interval) {
io.papermc.paper.util.MCUtil.ensureMain("Save Players" , () -> { // Paper - Ensure main
- MinecraftTimings.savePlayers.startTiming(); // Paper
int numSaved = 0;
long now = MinecraftServer.currentTick;
for (int i = 0; i < this.players.size(); ++i) {
@@ -1222,7 +1220,6 @@ public abstract class PlayerList {
@@ -1243,7 +1241,6 @@ public abstract class PlayerList {
}
// Paper end
}
Expand Down Expand Up @@ -1707,7 +1707,7 @@ index 73871f456a85bda1e51f54986d0e61fb629822e8..7dbb55953ce9fb489c8a6706bc8a64fd
return this != EntityType.PLAYER && this != EntityType.LLAMA_SPIT && this != EntityType.WITHER && this != EntityType.BAT && this != EntityType.ITEM_FRAME && this != EntityType.GLOW_ITEM_FRAME && this != EntityType.LEASH_KNOT && this != EntityType.PAINTING && this != EntityType.END_CRYSTAL && this != EntityType.EVOKER_FANGS;
}
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 675d695989cef5d8fc2e85673efbb57ec1bb38bd..afdea957ec8d893cea15a92fe40b19f0410da76a 100644
index a76eb3d051db0229ed088b71c92ff3f131449007..6553e5a0e554b97667c0b66a63d88292007b7d6d 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -142,7 +142,6 @@ import org.bukkit.event.entity.EntityTeleportEvent;
Expand Down
10 changes: 5 additions & 5 deletions patches/server/0003-Leaves-Server-Utils.patch
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,26 @@ index 46954db7ecd35ac4018fdf476df7c8020d7ce6c8..044c51ebb058fc36074fd178929e3279
public PlayerAreaMap() {
super();
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index f20ae9153b7098980ce6c0e75fcbbb4da652661b..3011a7dee3ac2d5bcce7369fd846a11b69d99ef1 100644
index 1e05fca2a2ba6e2c0b641b6e27585520889cd8a6..e54666bde53dcd0fdcd1a0dfd3e047886011508f 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -416,6 +416,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -417,6 +417,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
private UUID originWorld;
public boolean freezeLocked = false; // Paper - Freeze Tick Lock API
public boolean collidingWithWorldBorder; // Paper
+ private CompoundTag leavesData = new CompoundTag(); // Leaves - Leaves ex data
public boolean fixedPose = false; // Paper

public void setOrigin(@javax.annotation.Nonnull Location location) {
@@ -2422,6 +2423,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -2455,6 +2456,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
nbt.putBoolean("Paper.FreezeLock", true);
}
// Paper end
+ nbt.put("Leaves.Data", leavesData); // Leaves - leaves ex data
return nbt;
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT");
@@ -2590,6 +2592,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -2602,6 +2604,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
freezeLocked = nbt.getBoolean("Paper.FreezeLock");
}
// Paper end
Expand All @@ -62,7 +62,7 @@ index f20ae9153b7098980ce6c0e75fcbbb4da652661b..3011a7dee3ac2d5bcce7369fd846a11b

} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.forThrowable(throwable, "Loading entity NBT");
@@ -4836,4 +4843,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -4848,4 +4855,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
return ((net.minecraft.server.level.ServerChunkCache) level.getChunkSource()).isPositionTicking(this);
}
// Paper end
Expand Down
14 changes: 7 additions & 7 deletions patches/server/0006-Leaves-Protocol-Core.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Leaves Protocol Core


diff --git a/src/main/java/net/minecraft/network/protocol/common/ServerboundCustomPayloadPacket.java b/src/main/java/net/minecraft/network/protocol/common/ServerboundCustomPayloadPacket.java
index 975da2529d18391ed4ecc7359a2d7319129bd872..ae5590b015a2b018188bd7a45b44ec4d4af048a5 100644
index af86f752c33a2990405fea058b7c41c437ba9d46..bada9fae1e7178162429e1f5a1608b9c4a680a6c 100644
--- a/src/main/java/net/minecraft/network/protocol/common/ServerboundCustomPayloadPacket.java
+++ b/src/main/java/net/minecraft/network/protocol/common/ServerboundCustomPayloadPacket.java
@@ -20,7 +20,12 @@ public record ServerboundCustomPayloadPacket(CustomPacketPayload payload) implem
Expand All @@ -23,7 +23,7 @@ index 975da2529d18391ed4ecc7359a2d7319129bd872..ae5590b015a2b018188bd7a45b44ec4d
}

diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index c798fbe078e14b0473b2d8bcdccc11238d28025e..68a242f6aaa4aeebff5c2c566ac2aab538eccc87 100644
index d6f913b7bc79d2ffaa994b60d4a8252a296d852c..19a49358826c9fe39aeaf89348dc07b228d737c2 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1562,6 +1562,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
Expand All @@ -36,7 +36,7 @@ index c798fbe078e14b0473b2d8bcdccc11238d28025e..68a242f6aaa4aeebff5c2c566ac2aab5
((Runnable) this.tickables.get(i)).run();
}
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index 20122bf191ebc74c223310aea1f004fdbb163e57..6f758e7bf7c93dae1c7f459e0bc4a32e91a09ca0 100644
index 598f807f0d0caac98b81e0e2991f1bd497c4534e..0374cfb97e08496451d2f1d570c5fbc005f0215d 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -115,6 +115,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
Expand All @@ -56,10 +56,10 @@ index 20122bf191ebc74c223310aea1f004fdbb163e57..6f758e7bf7c93dae1c7f459e0bc4a32e
} catch (Exception ex) {
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t register custom payload", ex);
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 699ad5ac3c0428c9f41626e43c16c211aec5d409..b58dea1fd418fa3199b403df079f87990ffdd6a8 100644
index 733170a3666e74bd87f6a50fda2d00529a08c55f..afbe41b671073232614a1de246bea30ea2a26929 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -327,6 +327,8 @@ public abstract class PlayerList {
@@ -348,6 +348,8 @@ public abstract class PlayerList {
return;
}

Expand All @@ -68,7 +68,7 @@ index 699ad5ac3c0428c9f41626e43c16c211aec5d409..b58dea1fd418fa3199b403df079f8799
final net.kyori.adventure.text.Component jm = playerJoinEvent.joinMessage();

if (jm != null && !jm.equals(net.kyori.adventure.text.Component.empty())) { // Paper - Adventure
@@ -578,6 +580,7 @@ public abstract class PlayerList {
@@ -599,6 +601,7 @@ public abstract class PlayerList {
return this.remove(entityplayer, net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? entityplayer.getBukkitEntity().displayName() : io.papermc.paper.adventure.PaperAdventure.asAdventure(entityplayer.getDisplayName())));
}
public net.kyori.adventure.text.Component remove(ServerPlayer entityplayer, net.kyori.adventure.text.Component leaveMessage) {
Expand All @@ -77,7 +77,7 @@ index 699ad5ac3c0428c9f41626e43c16c211aec5d409..b58dea1fd418fa3199b403df079f8799
ServerLevel worldserver = entityplayer.serverLevel();

diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 3b5d0a2cdeb014be13bb92c7674cc9f84d86f335..57696b8fe6eec4c0431ef873c980d37f31ff805b 100644
index d3b6260b25ea16e43f506bfe89f289bf7ac7cbad..74fecfb582cbc42dafa1ee9590e98478cd61a01f 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -470,6 +470,7 @@ public final class CraftServer implements Server {
Expand Down
16 changes: 9 additions & 7 deletions patches/server/0007-Fix-gravity-block-duper.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ Subject: [PATCH] Fix gravity block duper


diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 3011a7dee3ac2d5bcce7369fd846a11b69d99ef1..3f439b316960a734d0585dccdd331b251dfbfe14 100644
index e54666bde53dcd0fdcd1a0dfd3e047886011508f..f2572810c52b948d7c83b88afe5f2c6b898888da 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -499,36 +499,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -500,38 +500,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {

public boolean updatingSectionStatus = false;
// Paper end
+ // Leaves - fix gravity block duper
// Paper start - optimise entity tracking
final org.spigotmc.TrackingRange.TrackingRangeType trackingRangeType = org.spigotmc.TrackingRange.getTrackingRangeType(this);
- // Paper start - make end portalling safe
- public BlockPos portalBlock;
- public ServerLevel portalWorld;
Expand Down Expand Up @@ -42,11 +45,10 @@ index 3011a7dee3ac2d5bcce7369fd846a11b69d99ef1..3f439b316960a734d0585dccdd331b25
- this.teleportTo(worldserver, null);
- }
- // Paper end - make end portalling safe
+ // Leaves - fix gravity block duper

public Entity(EntityType<?> type, Level world) {
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
@@ -3116,7 +3087,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
public boolean isLegacyTrackingEntity = false;

@@ -3128,7 +3099,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
}

this.processPortalCooldown();
Expand All @@ -56,7 +58,7 @@ index 3011a7dee3ac2d5bcce7369fd846a11b69d99ef1..3f439b316960a734d0585dccdd331b25
}

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 9105418b29c89f092378da11b14e3d324332a2ba..739eeee273632ac86c245d88e2f6eafe4f31208c 100644
index e6f75a9cac46c8e3ddba664a9d5b27b665a94cb4..d790c8de8c7b0bbe44c7e0eba3468b1f820fc0c0 100644
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
@@ -132,11 +132,7 @@ public class FallingBlockEntity extends Entity {
Expand Down
Loading

0 comments on commit d7e4fbc

Please sign in to comment.