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 Feb 27, 2024
1 parent 42580f3 commit 5a586cb
Show file tree
Hide file tree
Showing 45 changed files with 215 additions and 214 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ version=1.20.4-R0.1-SNAPSHOT
mcVersion=1.20.4
packageVersion=1_20_R3
org.gradle.jvmargs=-Xmx2G
paperRef=4939f8711884901ddf1c56337f606de71cdae78d
paperRef=681bbff110d9a56152ae898c4dfe1c0356b40e69
preVersion=false
updatingMinecraft=false
6 changes: 3 additions & 3 deletions patches/server/0001-Build-changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Build changes


diff --git a/build.gradle.kts b/build.gradle.kts
index ce3747d8d2a8f4327766cf23d5aaa72cfcb380bc..25408f536cef272f2457e29fe4bff98fa285f363 100644
index 241808d8619e17c0681f79acbbc98af5bf52dd89..3848a4803f8df5bbf4933edfb0eaca38c567b751 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -13,8 +13,12 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
Expand All @@ -23,7 +23,7 @@ index ce3747d8d2a8f4327766cf23d5aaa72cfcb380bc..25408f536cef272f2457e29fe4bff98f
// Paper start
implementation("org.jline:jline-terminal-jansi:3.21.0")
implementation("net.minecrell:terminalconsoleappender:1.3.0")
@@ -58,19 +62,29 @@ dependencies {
@@ -59,19 +63,29 @@ dependencies {
}

val craftbukkitPackageVersion = "1_20_R3" // Paper
Expand Down Expand Up @@ -55,7 +55,7 @@ index ce3747d8d2a8f4327766cf23d5aaa72cfcb380bc..25408f536cef272f2457e29fe4bff98f
"Implementation-Vendor" to date, // Paper
"Specification-Title" to "Bukkit",
"Specification-Version" to project.version,
@@ -154,7 +168,7 @@ fun TaskContainer.registerRunTask(
@@ -155,7 +169,7 @@ fun TaskContainer.registerRunTask(
name: String,
block: JavaExec.() -> Unit
): TaskProvider<JavaExec> = register<JavaExec>(name) {
Expand Down
18 changes: 9 additions & 9 deletions patches/server/0002-Delete-Timings.patch
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,7 @@ index 1363d76e5546d1bb57f06fceb57196da459f962e..d0cf730f175c707b50577b7080bd81cf
// 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 5a7278b093e37b95fb005ad5cc3cac90ac36f8fb..78f02c2e068a63648f6d650a48a1cf21c5da1545 100644
index 12109446fc76a39faee6cda042ca48b3fd3809f4..295edf4e84699fc555048b7e59aebee83e854096 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 @@ -1377,7 +1377,7 @@ index 366c0c9b45a819f7f94ebe3e49b8ab7f9edf9ce7..2a19a45e9c7ac4646ce89c566b5fec21
gameprofilerfiller.pop();
}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 6934e9dac0d69c043b73b7c46d59f2d39b37c67f..8e43a6817e9101b6dcc956e3b6f4bcff63a4c2fc 100644
index 6907d1be36fbdf0856c0e11983218d2fd1f9cb46..9970a1e9d314a4169db0297a81b6f263802028dc 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 @@ -1575,7 +1575,7 @@ index 6934e9dac0d69c043b73b7c46d59f2d39b37c67f..8e43a6817e9101b6dcc956e3b6f4bcff

} 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 ab5b259d8f72022c875cae73be25fe2da346c6b3..e1fb72685134611a545bc2921f2bf3e0cc5415f5 100644
index 87e5ee042ab2c052d25ab4c2521a68cf2e2d67b6..beb1946f5e21ba8f15c908ff0da592d48089263d 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2394,7 +2394,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
Expand Down Expand Up @@ -1609,7 +1609,7 @@ index ab5b259d8f72022c875cae73be25fe2da346c6b3..e1fb72685134611a545bc2921f2bf3e0
}
// 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 91feb12732564c90656da487664dbc12e55397fc..6104f952b9138b0030aebd23c23fdeccc88e567d 100644
index 1e5f709115007ff19901c0a6c3cf884d9e4d3a6c..aa7eb1f037875293b03588f5bc5d2df70237b45e 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 @@ -1619,15 +1619,15 @@ index 91feb12732564c90656da487664dbc12e55397fc..6104f952b9138b0030aebd23c23fdecc
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
@@ -1235,7 +1234,6 @@ public abstract class PlayerList {
@@ -1236,7 +1235,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) {
@@ -1246,7 +1244,6 @@ public abstract class PlayerList {
@@ -1247,7 +1245,6 @@ public abstract class PlayerList {
}
// Paper end - Incremental chunk and player saving
}
Expand Down Expand Up @@ -1664,10 +1664,10 @@ index 09e8445a3f8c6b3ebc852a75a9a25b41a51ba659..22d19f1ca47a79be2c41775c5564535b
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 aceee33eebd4d5f89e62a42910ec51843f33843b..371cd5423f0e8f84b5ddef8f1d98e4889b1b4361 100644
index 23570a0b1227a840b9c1e6ae326827ea655bb5f7..ac3d31b0ed54fd07f07a0768017cc34f7ae9709f 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;
@@ -143,7 +143,6 @@ import org.bukkit.event.entity.EntityTeleportEvent;
import org.bukkit.event.player.PlayerItemConsumeEvent;
// CraftBukkit end

Expand Down Expand Up @@ -1751,7 +1751,7 @@ index fcdb9bde8e1605e30dde3e580491522d4b62cdc0..b68c69a7ab71926ecf478d8daa5ec5ac

}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 19f23a6c8fb5c02843c27fb8a242ec9d0d1b538b..7d6244820295186d5887da9eba36859406c6e3c6 100644
index f476ba6c97944bdffae5aacae2e285d17541f46e..b0621d5d9b14d007d974026106c89e798b8eaa65 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -12,7 +12,6 @@ import java.util.function.Supplier;
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 906eded9a2ab61737a30cfe89292a71237ce4eb7..75d5e255bb166d2ec7325b16e8e5a30b43855276 100644
index 45439b0cc4ea69e409fd41d4684403c0e0feab12..e44178458aee648ce088c0a10f05b9f9eed91820 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -423,6 +423,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -424,6 +424,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
private UUID originWorld;
public boolean freezeLocked = false; // Paper - Freeze Tick Lock API
public boolean fixedPose = false; // Paper - Expand Pose API
+ private CompoundTag leavesData = new CompoundTag(); // Leaves - Leaves ex data

public void setOrigin(@javax.annotation.Nonnull Location location) {
this.origin = location.toVector();
@@ -2480,6 +2481,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -2496,6 +2497,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
nbttagcompound.putBoolean("Paper.FreezeLock", true);
}
// Paper end
+ nbttagcompound.put("Leaves.Data", leavesData); // Leaves - leaves ex data
return nbttagcompound;
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT");
@@ -2627,6 +2629,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -2643,6 +2645,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
freezeLocked = nbt.getBoolean("Paper.FreezeLock");
}
// Paper end
Expand All @@ -62,7 +62,7 @@ index 906eded9a2ab61737a30cfe89292a71237ce4eb7..75d5e255bb166d2ec7325b16e8e5a30b

} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.forThrowable(throwable, "Loading entity NBT");
@@ -4912,4 +4919,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -4936,4 +4943,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
return ((net.minecraft.server.level.ServerChunkCache) level.getChunkSource()).isPositionTicking(this);
}
// Paper end - Expose entity id counter
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0005-Leaves-Server-Config-And-Command.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Leaves Server Config And Command


diff --git a/build.gradle.kts b/build.gradle.kts
index 25408f536cef272f2457e29fe4bff98fa285f363..a9269245ad80d4071e9c09190fc20ce97809e4a1 100644
index 3848a4803f8df5bbf4933edfb0eaca38c567b751..411c1929e78e5706eae040c209d9727e17e553b8 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -228,3 +228,12 @@ tasks.registerRunTask("runDev") {
@@ -229,3 +229,12 @@ tasks.registerRunTask("runDev") {
classpath(runtimeClasspathForRunDev)
jvmArgs("-DPaper.isRunDev=true")
}
Expand Down
6 changes: 3 additions & 3 deletions patches/server/0006-Leaves-Protocol-Core.patch
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ index 0306771b8f90dcdd77f151c19c6c2d75c41f8feb..8aa1337b420e1c9fbf51f951f14a63d8
} 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 6104f952b9138b0030aebd23c23fdeccc88e567d..6d4f175e2820b48d04bd11fc694fcdfc73580da9 100644
index aa7eb1f037875293b03588f5bc5d2df70237b45e..62d89e49dfcbb00651df7f89be482b9cbc173b0a 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -346,6 +346,8 @@ public abstract class PlayerList {
@@ -347,6 +347,8 @@ public abstract class PlayerList {
return;
}

Expand All @@ -68,7 +68,7 @@ index 6104f952b9138b0030aebd23c23fdeccc88e567d..6d4f175e2820b48d04bd11fc694fcdfc
final net.kyori.adventure.text.Component jm = playerJoinEvent.joinMessage();

if (jm != null && !jm.equals(net.kyori.adventure.text.Component.empty())) { // Paper - Adventure
@@ -596,6 +598,7 @@ public abstract class PlayerList {
@@ -597,6 +599,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 Down
16 changes: 8 additions & 8 deletions patches/server/0007-Fix-gravity-block-duper.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@ 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 75d5e255bb166d2ec7325b16e8e5a30b43855276..1bd585630940b2678bd1d9c3c344c17deb461c03 100644
index e44178458aee648ce088c0a10f05b9f9eed91820..87b0eead81c06afa276b74bf1c7fce573027702f 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -440,6 +440,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -441,6 +441,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
return this.originWorld;
}
// Paper end - Entity origin API
+ /* Leaves - fix gravity block duper
// Paper start - make end portalling safe
public BlockPos portalBlock;
public ServerLevel portalWorld;
@@ -470,6 +471,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -471,6 +472,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
this.teleportTo(worldserver, null);
}
// Paper end - make end portalling safe
+ */
// Paper start - optimise entity tracking
final org.spigotmc.TrackingRange.TrackingRangeType trackingRangeType = org.spigotmc.TrackingRange.getTrackingRangeType(this);

@@ -3183,7 +3185,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -3199,7 +3201,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
}

this.processPortalCooldown();
Expand All @@ -34,10 +34,10 @@ index 75d5e255bb166d2ec7325b16e8e5a30b43855276..1bd585630940b2678bd1d9c3c344c17d
}

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 05b77bf1af82397c542fde19b54ee545448ce12e..c753bc1a3369827d8ef4705e313f744f07759e40 100644
index 0aef6a8d51cb1351daaea16022f5cbb27ceaff0d..265c2b3abaa47548c4318c86a1de83d673d09fff 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 {
@@ -133,11 +133,7 @@ public class FallingBlockEntity extends Entity {

@Override
public void tick() {
Expand All @@ -48,9 +48,9 @@ index 05b77bf1af82397c542fde19b54ee545448ce12e..c753bc1a3369827d8ef4705e313f744f
- // Paper end - fix sand duping
+ // Leaves - fix gravity block duper
if (this.blockState.isAir()) {
this.discard();
this.discard(EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
} else {
@@ -148,12 +144,14 @@ public class FallingBlockEntity extends Entity {
@@ -149,12 +145,14 @@ public class FallingBlockEntity extends Entity {
}

this.move(MoverType.SELF, this.getDeltaMovement());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Make snowball and egg can knockback player


diff --git a/src/main/java/net/minecraft/world/entity/projectile/Snowball.java b/src/main/java/net/minecraft/world/entity/projectile/Snowball.java
index 718e120c9768cf716b32d3d652f53f1dda925168..ab0e9a3ef72bf8380114c77c3cea9d4d2c4228ba 100644
index 5e82549ea2e80b3968b793b7b4b685c4891e9a91..14c14d12b7ae34a6631828e8dcc531b62b9aa1ed 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/Snowball.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/Snowball.java
@@ -3,6 +3,7 @@ package net.minecraft.world.entity.projectile;
Expand All @@ -16,10 +16,11 @@ index 718e120c9768cf716b32d3d652f53f1dda925168..ab0e9a3ef72bf8380114c77c3cea9d4d
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity;
@@ -55,6 +56,12 @@ public class Snowball extends ThrowableItemProjectile {
Entity entity = entityHitResult.getEntity();
@@ -61,6 +62,13 @@ public class Snowball extends ThrowableItemProjectile {
int i = entity instanceof Blaze ? 3 : 0;
entity.hurt(this.damageSources().thrown(this, this.getOwner()), (float)i);

entity.hurt(this.damageSources().thrown(this, this.getOwner()), (float) i);
+
+ // Leaves start - make snowball can knockback player
+ if (top.leavesmc.leaves.LeavesConfig.snowballAndEggCanKnockback && entity instanceof ServerPlayer) {
+ entity.hurt(this.damageSources().thrown(this, this.getOwner()), 0.0000001F);
Expand All @@ -30,10 +31,10 @@ index 718e120c9768cf716b32d3d652f53f1dda925168..ab0e9a3ef72bf8380114c77c3cea9d4d

@Override
diff --git a/src/main/java/net/minecraft/world/entity/projectile/ThrownEgg.java b/src/main/java/net/minecraft/world/entity/projectile/ThrownEgg.java
index 785196e6f4677074890ca965e9add85ccfd0e6e3..773937c931cfb458e8d7148abff6bc72e0f3a152 100644
index 82bb8004635865f5202578d5a6f520048e7269d5..f6524889953ad540f5e6a66ff748f4d8582e1c1b 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/ThrownEgg.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/ThrownEgg.java
@@ -45,7 +45,14 @@ public class ThrownEgg extends ThrowableItemProjectile {
@@ -46,7 +46,14 @@ public class ThrownEgg extends ThrowableItemProjectile {
@Override
protected void onHitEntity(EntityHitResult entityHitResult) {
super.onHitEntity(entityHitResult);
Expand Down
Loading

0 comments on commit 5a586cb

Please sign in to comment.