Skip to content

Commit

Permalink
Updated Upstream (Paper/Gale/Purpur/Leaves)
Browse files Browse the repository at this point in the history
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@df3b654 ConcurrentUtil: Fix concurrent long map resize chain pull function
PaperMC/Paper@5a5c3a4 Remove chunk unload trace debug
PaperMC/Paper@7e44684 Fix wrong assumption about locale being null in the login phase (#11204)

Gale Changes:
Dreeam-qwq/Gale@ac42d6b Remove Optimize entity coordinate key
Dreeam-qwq/Gale@6ce6bd0 Add back Optimize random calls in chunk ticking
Dreeam-qwq/Gale@a8aff53 Fix fluidStateCount increment

Purpur Changes:
PurpurMC/Purpur@9e444c5 Add Entities can use portals patch back (#1571)
PurpurMC/Purpur@930003b Updated Upstream (Paper)

Leaves Changes:
LeavesMC/Leaves@bb803a9 [release-skip] Move protocol config
LeavesMC/Leaves@c279af4 Fix fortress mob spawn (#227)
LeavesMC/Leaves@e6ca163 Update Paper
LeavesMC/Leaves@a1fb5ff [ci skip] reduce cloud upload connect timeout
LeavesMC/Leaves@a8897bd fix CraftScheduler internal plugin logging issue (#284)
LeavesMC/Leaves@91ab4ed Try fix (#286)
LeavesMC/Leaves@ec274f5 Remove Attack Self
LeavesMC/Leaves@ffdcaa8 Update Paper
LeavesMC/Leaves@a7b7a1a Fix Fakeplayer Action
LeavesMC/Leaves@cd53d4c Try to fix #291, #292 (#293)
LeavesMC/Leaves@e2db81a Fix #294
LeavesMC/Leaves@248cb93 Update Paper
  • Loading branch information
Dreeam-qwq committed Aug 6, 2024
1 parent cdd9de2 commit 711b992
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 48 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ group = cn.dreeam.leaf
mcVersion = 1.21
version = 1.21-R0.1-SNAPSHOT

galeCommit = 00bcf2aa629587082823da93ca8c446a6112aa30
galeCommit = a8aff53ed53fbbb183c120bc60aa085c80f00b83

org.gradle.caching = true
org.gradle.parallel = true
Expand Down
2 changes: 1 addition & 1 deletion patches/api/0004-Purpur-API-Changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Subject: [PATCH] Purpur API Changes
Original license: MIT
Original project: https://github.com/PurpurMC/Purpur

Commit: b3623faa771db37a2a5f8b58b28d1782c3a22ee0
Commit: 930003b1d1826c083f3cee4db79621e6a7d726f1

Patches below are removed in this patch:
Pufferfish-API-Changes.patch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Subject: [PATCH] Purpur generated-api Changes
Original license: MIT
Original project: https://github.com/PurpurMC/Purpur

Commit: b3623faa771db37a2a5f8b58b28d1782c3a22ee0
Commit: 930003b1d1826c083f3cee4db79621e6a7d726f1

diff --git a/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/com/destroystokyo/paper/entity/ai/VanillaGoal.java
index 3add91218dd3f07052aa932f0503d1f10ac3799b..3e41a4141095bce989c75e989293deb3f47e8e6d 100644
Expand Down
32 changes: 22 additions & 10 deletions patches/server/0011-Purpur-Server-Changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ TODO - Dreeam: Check Fix-pufferfish-issues.patch
Original license: MIT
Original project: https://github.com/PurpurMC/Purpur

Commit: b3623faa771db37a2a5f8b58b28d1782c3a22ee0
Commit: 930003b1d1826c083f3cee4db79621e6a7d726f1

Patches below are removed in this patch:
Brand changes in Rebrand.patch
Expand Down Expand Up @@ -970,7 +970,7 @@ index c80be65d190c85e7f0ea8233ebbbdbc1ea67f276..97e793c971614299504605aeb4f99cad
public ServerEntity(ServerLevel worldserver, Entity entity, int i, boolean flag, Consumer<Packet<?>> consumer, Set<ServerPlayerConnection> trackedPlayers) {
this.trackedPlayers = trackedPlayers;
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index d0b8099b8ce299c44bbde9b8dd34ccd9312579e8..3a816a31b9f3ecb02291b8be897db828502eab84 100644
index 21a910e69bf7b10d11a93793a6854198cc77c4c9..3a0315edfafd18b995b6b614b3b20f17777c4575 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -220,6 +220,8 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
Expand Down Expand Up @@ -1155,7 +1155,7 @@ index d0b8099b8ce299c44bbde9b8dd34ccd9312579e8..3a816a31b9f3ecb02291b8be897db828
}
// Paper end - Fix merchant inventory not closing on entity removal
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 0d92a3918e35217bba6aea00dce05ce386415f65..1d0044693dafce42921af0a44175b164d7321114 100644
index 0d92a3918e35217bba6aea00dce05ce386415f65..690c3347ff228f7d8e5134221f9a96d7f11cb418 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -303,6 +303,10 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
Expand Down Expand Up @@ -1234,7 +1234,7 @@ index 0d92a3918e35217bba6aea00dce05ce386415f65..1d0044693dafce42921af0a44175b164
worldserver1.removePlayerImmediately(this, Entity.RemovalReason.CHANGED_DIMENSION);
this.unsetRemoved();
// CraftBukkit end
+ this.portalPos = io.papermc.paper.util.MCUtil.toBlockPosition(exit); // Purpur
+ this.portalPos = io.papermc.paper.util.MCUtil.toBlockPosition(exit); // Purpur - Fix stuck in portals
this.setServerLevel(worldserver);
this.connection.teleport(exit); // CraftBukkit - use internal teleport without event
this.connection.resetPosition();
Expand Down Expand Up @@ -2100,7 +2100,7 @@ index f43bf280999ff3860cc702def50cc62b131eb1bd..66d9e99a351f5fc6cf58be3bee4397d9
}

diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 815db5b0a24f1628d646893ebad466dcee2ab0bd..c0995861d1987f62f1bf2d37939f57c55f314c24 100644
index 7c56c3b84809e751e94a2ac4ca27ab81168058c4..2429d9b16cb307d3c9aeb3ec8af677490d3fd3c2 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -169,6 +169,7 @@ import org.bukkit.plugin.PluginManager;
Expand Down Expand Up @@ -2273,13 +2273,14 @@ index 815db5b0a24f1628d646893ebad466dcee2ab0bd..c0995861d1987f62f1bf2d37939f57c5
+ public BlockPos portalPos = BlockPos.ZERO; // Purpur
public void setAsInsidePortal(Portal portal, BlockPos pos) {
if (this.isOnPortalCooldown()) {
+ if (!(level().purpurConfig.playerFixStuckPortal && this instanceof Player && !pos.equals(portalPos))) // Purpur
+ if (!(level().purpurConfig.playerFixStuckPortal && this instanceof Player && !pos.equals(this.portalPos))) // Purpur - Fix stuck in portals
this.setPortalCooldown();
} else {
- } else {
+ } else if (this.level.purpurConfig.entitiesCanUsePortals || this instanceof ServerPlayer) { // Purpur - Entities can use portals
if (this.portalProcess != null && this.portalProcess.isSamePortal(portal)) {
this.portalProcess.updateEntryPosition(pos.immutable());
this.portalProcess.setAsInsidePortalThisTick(true);
+ portalPos = BlockPos.ZERO; // Purpur
+ this.portalPos = BlockPos.ZERO; // Purpur - Fix stuck in portals
} else {
this.portalProcess = new PortalProcessor(portal, pos.immutable());
}
Expand All @@ -2292,6 +2293,15 @@ index 815db5b0a24f1628d646893ebad466dcee2ab0bd..c0995861d1987f62f1bf2d37939f57c5
}

public int getAirSupply() {
@@ -3893,7 +3948,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
// CraftBukkit end

public boolean canUsePortal(boolean allowVehicles) {
- return (allowVehicles || !this.isPassenger()) && this.isAlive();
+ return (allowVehicles || !this.isPassenger()) && this.isAlive() && (this.level.purpurConfig.entitiesCanUsePortals || this instanceof ServerPlayer); // Purpur - Entities can use portals
}

public boolean canChangeDimensions(Level from, Level to) {
@@ -4215,6 +4270,20 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
return SlotAccess.NULL;
}
Expand Down Expand Up @@ -18418,10 +18428,10 @@ index 0000000000000000000000000000000000000000..83fabd290d3c64f2766b3244f5cd695e
+}
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..b08583d1d5e923dc86378dbd97612aee5c7c43c7
index 0000000000000000000000000000000000000000..57814f424a91ac5eb5e7c7fa5fe8c23625895c8c
--- /dev/null
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -0,0 +1,3445 @@
@@ -0,0 +1,3447 @@
+package org.purpurmc.purpur;
+
+import net.minecraft.core.registries.BuiltInRegistries;
Expand Down Expand Up @@ -18543,6 +18553,7 @@ index 0000000000000000000000000000000000000000..b08583d1d5e923dc86378dbd97612aee
+ public boolean boatEjectPlayersOnLand = false;
+ public boolean boatsDoFallDamage = false;
+ public boolean disableDropsOnCrammingDeath = false;
+ public boolean entitiesCanUsePortals = true;
+ public boolean entitiesPickUpLootBypassMobGriefing = false;
+ public boolean fireballsBypassMobGriefing = false;
+ public boolean imposeTeleportRestrictionsOnGateways = false;
Expand Down Expand Up @@ -18573,6 +18584,7 @@ index 0000000000000000000000000000000000000000..b08583d1d5e923dc86378dbd97612aee
+ boatEjectPlayersOnLand = getBoolean("gameplay-mechanics.boat.eject-players-on-land", boatEjectPlayersOnLand);
+ boatsDoFallDamage = getBoolean("gameplay-mechanics.boat.do-fall-damage", boatsDoFallDamage);
+ disableDropsOnCrammingDeath = getBoolean("gameplay-mechanics.disable-drops-on-cramming-death", disableDropsOnCrammingDeath);
+ entitiesCanUsePortals = getBoolean("gameplay-mechanics.entities-can-use-portals", entitiesCanUsePortals);
+ entitiesPickUpLootBypassMobGriefing = getBoolean("gameplay-mechanics.entities-pick-up-loot-bypass-mob-griefing", entitiesPickUpLootBypassMobGriefing);
+ fireballsBypassMobGriefing = getBoolean("gameplay-mechanics.fireballs-bypass-mob-griefing", fireballsBypassMobGriefing);
+ imposeTeleportRestrictionsOnGateways = getBoolean("gameplay-mechanics.impose-teleport-restrictions-on-gateways", imposeTeleportRestrictionsOnGateways);
Expand Down
12 changes: 6 additions & 6 deletions patches/server/0015-Remove-Timings.patch
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,7 @@ index 8fded112c6c30070ee6514ef25f1bad1d3fba4c1..42f2961ce975920bb20c73bd3e5b4b78
}

diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 1b759f7ce1d1244982d8eac8b9bce95668e1bb8f..3ca207ead7a034469ab37e5621c6b5cb92979979 100644
index 2535bc92d0ecebf5f859f13a1c4ffd51709f801f..0dd3f39a8be13a98575c05751a254699f4cdf69d 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1,7 +1,6 @@
Expand Down Expand Up @@ -1596,34 +1596,34 @@ index cd0e43f4c53a746dd6183a8406269f9b11ad3571..54657ac895fb2fa9c58910d5421f0082
private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry();
public CraftPersistentDataContainer persistentDataContainer;
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
index 36540053590c30a902b9986dcf2e74375157822d..fb0ffd302ec87516cd7f28b8b4c6a8e9b1577157 100644
index f23ed06a943646f45e1291f35ab3025e1dfa6b49..070e7b5db06bd670f97ac7f25767be1d33c5d02e 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -655,7 +655,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
@@ -669,7 +669,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel)this.level).moonrise$getChunkTaskScheduler().chunkHolderManager.getChunkHolder(this.locX, this.locZ).getEntityChunk().callEntitiesLoadEvent(); // Paper - rewrite chunk system

if (this.needsDecoration) {
- try (co.aikar.timings.Timing ignored = this.level.timings.chunkLoadPopulate.startTiming()) { // Paper
this.needsDecoration = false;
java.util.Random random = new java.util.Random();
random.setSeed(this.level.getSeed());
@@ -675,7 +674,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
@@ -689,7 +688,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
}
}
server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkPopulateEvent(bukkitChunk));
- } // Paper
}
}
}
@@ -1012,7 +1010,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
@@ -1026,7 +1024,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p

if (LevelChunk.this.isTicking(blockposition)) {
try {
- this.blockEntity.tickTimer.startTiming(); // Spigot
BlockState iblockdata = LevelChunk.this.getBlockState(blockposition);

if (this.blockEntity.getType().isValid(iblockdata)) {
@@ -1035,14 +1032,9 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
@@ -1049,14 +1046,9 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
net.minecraft.world.level.chunk.LevelChunk.this.level.getCraftServer().getPluginManager().callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerInternalException(msg, throwable))); // Paper - ServerExceptionEvent
LevelChunk.this.removeBlockEntity(this.getPos());
// Paper end - Prevent block entity and entity crashes
Expand Down
2 changes: 1 addition & 1 deletion patches/server/0030-Leaves-Server-Utils.patch
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ and change store way to sql maybe?
Original license: GPLv3
Original project: https://github.com/LeavesMC/Leaves

Commit: 86d85530bc3cc448aea134690ae415fabec8e891
Commit: 248cb933f1a67a50a94352da2c100722e4635575

diff --git a/src/main/java/org/leavesmc/leaves/LeavesLogger.java b/src/main/java/org/leavesmc/leaves/LeavesLogger.java
new file mode 100644
Expand Down
11 changes: 7 additions & 4 deletions patches/server/0031-Leaves-Protocol-Core.patch
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ From: violetc <58360096+s-yh-china@users.noreply.github.com>
Date: Tue, 26 Sep 2023 19:00:41 +0800
Subject: [PATCH] Leaves: Protocol Core

TODO - Dreeam: Configurable leaves protocol listening

Original license: GPLv3
Original project: https://github.com/LeavesMC/Leaves

Expand Down Expand Up @@ -715,13 +713,14 @@ index 0000000000000000000000000000000000000000..9d71f8e6af24301bedf60f5c87e0bb3c
+}
diff --git a/src/main/java/org/leavesmc/leaves/protocol/core/ProtocolUtils.java b/src/main/java/org/leavesmc/leaves/protocol/core/ProtocolUtils.java
new file mode 100644
index 0000000000000000000000000000000000000000..f54381eec7ec0ffde39e87b39b16e02d3ed1b419
index 0000000000000000000000000000000000000000..72fb1e6517e266146cb1828875e7b7e6ae9b140d
--- /dev/null
+++ b/src/main/java/org/leavesmc/leaves/protocol/core/ProtocolUtils.java
@@ -0,0 +1,47 @@
@@ -0,0 +1,52 @@
+package org.leavesmc.leaves.protocol.core;
+
+import io.netty.buffer.ByteBuf;
+import io.papermc.paper.ServerBuildInfo;
+import net.minecraft.network.FriendlyByteBuf;
+import net.minecraft.network.RegistryFriendlyByteBuf;
+import net.minecraft.network.protocol.common.ClientboundCustomPayloadPacket;
Expand All @@ -738,6 +737,10 @@ index 0000000000000000000000000000000000000000..f54381eec7ec0ffde39e87b39b16e02d
+
+ private static final Function<ByteBuf, RegistryFriendlyByteBuf> bufDecorator = RegistryFriendlyByteBuf.decorator(MinecraftServer.getServer().registryAccess());
+
+ public static String buildProtocolVersion(String protocol) {
+ return protocol + "-leaves-" + ServerBuildInfo.buildInfo().asString(ServerBuildInfo.StringRepresentation.VERSION_SIMPLE);
+ }
+
+ public static void sendEmptyPayloadPacket(ServerPlayer player, ResourceLocation id) {
+ player.connection.send(new ClientboundCustomPayloadPacket(new LeavesProtocolManager.EmptyPayload(id)));
+ }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ index a74732902c0494c67e6acf2fc04581ff9c46b832..8b60c922750e71f526976782a1f156e9
LivingEntity entityliving1 = deadEntity.getLastHurtByMob();

diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
index fb0ffd302ec87516cd7f28b8b4c6a8e9b1577157..a9fd817f42f2ec2e7393e2bd2009ac1fdf60f317 100644
index 070e7b5db06bd670f97ac7f25767be1d33c5d02e..4e3da128942262a6b0230c0ffaad191112e9ec25 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -81,7 +81,18 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
Expand All @@ -61,7 +61,7 @@ index fb0ffd302ec87516cd7f28b8b4c6a8e9b1577157..a9fd817f42f2ec2e7393e2bd2009ac1f
private final LevelChunkTicks<Block> blockTicks;
private final LevelChunkTicks<Fluid> fluidTicks;

@@ -93,7 +104,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
@@ -105,7 +116,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
super(pos, upgradeData, world, net.minecraft.server.MinecraftServer.getServer().registryAccess().registryOrThrow(Registries.BIOME), inhabitedTime, sectionArrayInitializer, blendingData); // Paper - Anti-Xray - The world isn't ready yet, use server singleton for registry
this.tickersInLevel = Maps.newHashMap();
this.level = (ServerLevel) world; // CraftBukkit - type
Expand All @@ -70,7 +70,7 @@ index fb0ffd302ec87516cd7f28b8b4c6a8e9b1577157..a9fd817f42f2ec2e7393e2bd2009ac1f
Heightmap.Types[] aheightmap_type = Heightmap.Types.values();
int j = aheightmap_type.length;

@@ -230,9 +241,23 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
@@ -244,9 +255,23 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
Level world = this.level;

if (world instanceof ServerLevel worldserver) {
Expand All @@ -97,7 +97,7 @@ index fb0ffd302ec87516cd7f28b8b4c6a8e9b1577157..a9fd817f42f2ec2e7393e2bd2009ac1f
} else {
return super.getListenerRegistry(ySectionCoord);
}
@@ -616,7 +641,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
@@ -630,7 +655,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
}

private void removeGameEventListenerRegistry(int ySectionCoord) {
Expand Down
Loading

0 comments on commit 711b992

Please sign in to comment.