Skip to content

Commit

Permalink
Apply rest of Minecraft patches
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreeam-qwq committed Jan 18, 2025
1 parent 942c124 commit 997d6b1
Show file tree
Hide file tree
Showing 66 changed files with 1,636 additions and 2,011 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-1214.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
run: git config --global user.email "[email protected]" && git config --global user.name "Github Actions"

- name: Apply patches
run: ./gradlew -Dorg.gradle.jvmargs="-Dgraal.CompilerConfiguration=enterprise -Dgraal.UsePriorityInlining=true -Dgraal.Vectorization=true -Dgraal.OptDuplication=true --add-modules jdk.incubator.vector" applyPatches --stacktrace --no-daemon
run: ./gradlew -Dorg.gradle.jvmargs="-Dgraal.CompilerConfiguration=enterprise -Dgraal.UsePriorityInlining=true -Dgraal.Vectorization=true -Dgraal.OptDuplication=true --add-modules jdk.incubator.vector" applyAllPatches --stacktrace --no-daemon
- name: Create MojmapPaperclipJar
run: ./gradlew -Dorg.gradle.jvmargs="-Dgraal.CompilerConfiguration=enterprise -Dgraal.UsePriorityInlining=true -Dgraal.Vectorization=true -Dgraal.OptDuplication=true --add-modules jdk.incubator.vector" createMojmapPaperclipJar --stacktrace --no-daemon
- name: Create ReobfPaperclipJar
Expand Down
5 changes: 2 additions & 3 deletions Leaf-Server/build.gradle.kts.patch
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,10 @@
runtimeOnly(log4jPlugins.output)
alsoShade(log4jPlugins.output)

- implementation("com.velocitypowered:velocity-native:3.3.0-SNAPSHOT") {
+ implementation("com.velocitypowered:velocity-native:3.4.0-SNAPSHOT") {
implementation("com.velocitypowered:velocity-native:3.4.0-SNAPSHOT") {
isTransitive = false
}
- implementation("io.netty:netty-codec-haproxy:4.1.97.Final") // Add support for proxy protocol
- implementation("io.netty:netty-codec-haproxy:4.1.115.Final") // Add support for proxy protocol
- implementation("org.apache.logging.log4j:log4j-iostreams:2.24.1")
+ implementation("io.netty:netty-codec-haproxy:4.1.116.Final") // Add support for proxy protocol
+ implementation("org.apache.logging.log4j:log4j-iostreams:2.24.3")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,104 @@ index 6f96551ba91da214054b89a255254ca597977cc0..3f1a80db81c0f0cd7bb1d5df4a2c2cb1
// Purpur end - Option for Villager Clerics to farm Nether Wart
ResourceKey<Level> resourceKey = level.dimension();
BlockPos blockPos = entity.blockPosition();
diff --git a/net/minecraft/world/entity/animal/allay/Allay.java b/net/minecraft/world/entity/animal/allay/Allay.java
index 10d2a1138d814b83ce4233205a7f0ab2ed1f399d..e9f683ef9ce55e67748f1a16a45efe26bb4ff331 100644
--- a/net/minecraft/world/entity/animal/allay/Allay.java
+++ b/net/minecraft/world/entity/animal/allay/Allay.java
@@ -287,8 +287,7 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
private int behaviorTick = 0; // Pufferfish
@Override
protected void customServerAiStep(ServerLevel level) {
- //if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider
- if (this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider
this.getBrain().tick(level, this);
AllayAi.updateActivity(this);
super.customServerAiStep(level);
diff --git a/net/minecraft/world/entity/animal/axolotl/Axolotl.java b/net/minecraft/world/entity/animal/axolotl/Axolotl.java
index 1323cedcacd3072cdf5f1eac644688cd098b53db..ed15200319d0e50b495f2d0d912093d670fdb309 100644
--- a/net/minecraft/world/entity/animal/axolotl/Axolotl.java
+++ b/net/minecraft/world/entity/animal/axolotl/Axolotl.java
@@ -347,8 +347,7 @@ public class Axolotl extends Animal implements VariantHolder<Axolotl.Variant>, B
private int behaviorTick = 0; // Pufferfish
@Override
protected void customServerAiStep(ServerLevel level) {
- //if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider
- if (this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider
this.getBrain().tick(level, this);
AxolotlAi.updateActivity(this);
if (!this.isNoAi()) {
diff --git a/net/minecraft/world/entity/animal/frog/Frog.java b/net/minecraft/world/entity/animal/frog/Frog.java
index 4ecc6b6247a6ab14a5d46f9a05d5df8412ae2a5f..a962b06ac3fc15604b7fbf5e2109f1cc8d238ac7 100644
--- a/net/minecraft/world/entity/animal/frog/Frog.java
+++ b/net/minecraft/world/entity/animal/frog/Frog.java
@@ -241,8 +241,7 @@ public class Frog extends Animal implements VariantHolder<Holder<FrogVariant>> {
private int behaviorTick = 0; // Pufferfish
@Override
protected void customServerAiStep(ServerLevel level) {
- //if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider
- if (this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider
this.getBrain().tick(level, this);
FrogAi.updateActivity(this);
super.customServerAiStep(level);
diff --git a/net/minecraft/world/entity/animal/frog/Tadpole.java b/net/minecraft/world/entity/animal/frog/Tadpole.java
index 0ca35514a920dddf230d749bc1a5fe15f1c7940a..8468f7095e1db7a54042ce9a97d991d3105bd535 100644
--- a/net/minecraft/world/entity/animal/frog/Tadpole.java
+++ b/net/minecraft/world/entity/animal/frog/Tadpole.java
@@ -133,8 +133,7 @@ public class Tadpole extends AbstractFish {
private int behaviorTick = 0; // Pufferfish
@Override
protected void customServerAiStep(ServerLevel level) {
- //if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider
- if (this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider
this.getBrain().tick(level, this);
TadpoleAi.updateActivity(this);
super.customServerAiStep(level);
diff --git a/net/minecraft/world/entity/animal/goat/Goat.java b/net/minecraft/world/entity/animal/goat/Goat.java
index 7107cc2462e7d33bca413a1b051822cc1bd61bfa..2e3ca6b17862494218042e6d84970a60272c2b40 100644
--- a/net/minecraft/world/entity/animal/goat/Goat.java
+++ b/net/minecraft/world/entity/animal/goat/Goat.java
@@ -223,8 +223,7 @@ public class Goat extends Animal {
private int behaviorTick = 0; // Pufferfish
@Override
protected void customServerAiStep(ServerLevel level) {
- //if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider
- if (this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider
this.getBrain().tick(level, this);
GoatAi.updateActivity(this);
super.customServerAiStep(level);
diff --git a/net/minecraft/world/entity/monster/hoglin/Hoglin.java b/net/minecraft/world/entity/monster/hoglin/Hoglin.java
index 24725009d7619b0e9043d7d0039f805c611aedf6..a9d381568625ca871dcaf40b363d46692f45591d 100644
--- a/net/minecraft/world/entity/monster/hoglin/Hoglin.java
+++ b/net/minecraft/world/entity/monster/hoglin/Hoglin.java
@@ -203,8 +203,7 @@ public class Hoglin extends Animal implements Enemy, HoglinBase {
private int behaviorTick; // Pufferfish
@Override
protected void customServerAiStep(ServerLevel level) {
- //if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider
- if (this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider
this.getBrain().tick(level, this);
HoglinAi.updateActivity(this);
if (this.isConverting()) {
diff --git a/net/minecraft/world/entity/monster/piglin/Piglin.java b/net/minecraft/world/entity/monster/piglin/Piglin.java
index 242b2545b6082f567d0bb7900ef06ded3c0fdcdd..85306d8f0fba3b5dcb244df54c949b45e07ee4e7 100644
--- a/net/minecraft/world/entity/monster/piglin/Piglin.java
+++ b/net/minecraft/world/entity/monster/piglin/Piglin.java
@@ -382,8 +382,7 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento
private int behaviorTick; // Pufferfish
@Override
protected void customServerAiStep(ServerLevel level) {
- //if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider
- if (this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider
this.getBrain().tick(level, this);
PiglinAi.updateActivity(this);
super.customServerAiStep(level);
diff --git a/net/minecraft/world/entity/npc/Villager.java b/net/minecraft/world/entity/npc/Villager.java
index 347affae3cc18e01474734d2da2699c9b7b17e26..5dbf28c15f828505d42dc31c1a2185e01a7542c1 100644
--- a/net/minecraft/world/entity/npc/Villager.java
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ index b7829a91a7ef79706ec6d90b8b2673fd369b9931..c798869665397de5b435e992873b566f
// Paper start - rewrite chunk system
private ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader.PlayerChunkLoaderData chunkLoader;
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
index b4f2b794ca0c6e04da0355e02c19493c892ebccf..9c323dbaff302ca37850af70ee42c2588f85b20d 100644
index b4f2b794ca0c6e04da0355e02c19493c892ebccf..c334ce5c688ad362ffc96bd90d32c676acd50d4d 100644
--- a/net/minecraft/server/players/PlayerList.java
+++ b/net/minecraft/server/players/PlayerList.java
@@ -798,11 +798,11 @@ public abstract class PlayerList {
Expand All @@ -42,7 +42,7 @@ index b4f2b794ca0c6e04da0355e02c19493c892ebccf..9c323dbaff302ca37850af70ee42c258
return serverPlayer;
}

+ private boolean isSameLogicalHeight(ServerLevel fromLevel, ServerLevel toLevel) { return fromLevel.getLogicalHeight() == toLevel.getLogicalHeight(); } // Leaf - Slice - Check world height before smooth teleport
+ public static boolean isSameLogicalHeight(ServerLevel fromLevel, ServerLevel toLevel) { return fromLevel.getLogicalHeight() == toLevel.getLogicalHeight(); } // Leaf - Slice - Check world height before smooth teleport
+
public void sendActivePlayerEffects(ServerPlayer player) {
this.sendActiveEffects(player, player.connection);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ index a24ed1747fb8836927ac41b822dc666862701516..d840577023d42dc986e2b811382dfc43

public Armadillo(EntityType<? extends Animal> entityType, Level level) {
diff --git a/net/minecraft/world/entity/animal/frog/Tadpole.java b/net/minecraft/world/entity/animal/frog/Tadpole.java
index 0ca35514a920dddf230d749bc1a5fe15f1c7940a..669f7d6e5f481fb209e800c8e4acc52cf0c6dfce 100644
index 8468f7095e1db7a54042ce9a97d991d3105bd535..fd1aa79d1d1ec05853762df0c99099af3b790c63 100644
--- a/net/minecraft/world/entity/animal/frog/Tadpole.java
+++ b/net/minecraft/world/entity/animal/frog/Tadpole.java
@@ -286,7 +286,7 @@ public class Tadpole extends AbstractFish {
@@ -285,7 +285,7 @@ public class Tadpole extends AbstractFish {
}
}

Expand All @@ -35,7 +35,7 @@ index 0ca35514a920dddf230d749bc1a5fe15f1c7940a..669f7d6e5f481fb209e800c8e4acc52c
}

diff --git a/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerData.java b/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerData.java
index 3e3c72a4a52e72c15e0d3288f805d7887dcac351..38cd62d1a3c17913fdadf02e3c3871dac7619f82 100644
index 4977262e78fe320d72158479c267842837344b67..4190940922af3a00845e6c656873ef8bca409f2c 100644
--- a/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerData.java
+++ b/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerData.java
@@ -67,7 +67,7 @@ public class TrialSpawnerData {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -580,10 +580,10 @@ index 57c50ce5724b073b1aedf4df3129285143097303..91635b344ac02b66e51aa5620acf9ca4
}
}
diff --git a/net/minecraft/world/entity/animal/frog/Frog.java b/net/minecraft/world/entity/animal/frog/Frog.java
index 4ecc6b6247a6ab14a5d46f9a05d5df8412ae2a5f..2c28e97e76155fe4de309422f4913c1269972ff4 100644
index a962b06ac3fc15604b7fbf5e2109f1cc8d238ac7..035e7eac88ded12f9ca8f7e2a4d99c4156eb311f 100644
--- a/net/minecraft/world/entity/animal/frog/Frog.java
+++ b/net/minecraft/world/entity/animal/frog/Frog.java
@@ -479,9 +479,25 @@ public class Frog extends Animal implements VariantHolder<Holder<FrogVariant>> {
@@ -478,9 +478,25 @@ public class Frog extends Animal implements VariantHolder<Holder<FrogVariant>> {
return pathType != PathType.WATER_BORDER && super.canCutCorner(pathType);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ index 231d1905092532acf7e632197ba0e727adc4b1d7..dac802a8c70ff8ab96c000a48e1c5e10
try (DataInputStream out = new DataInputStream(new java.io.BufferedInputStream(new java.util.zip.InflaterInputStream(Files.newInputStream(file))))) {
return net.minecraft.nbt.NbtIo.read((java.io.DataInput) out);
diff --git a/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
index 7fff86a4956f59b2f4a9f7e283256879c034c1b8..58d9840d2557fbb9b357bf4e3d5ad19ef40d73c9 100644
index 7fff86a4956f59b2f4a9f7e283256879c034c1b8..329ac5cc12ba3e247ea4f513a347c9daad91a6e0 100644
--- a/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
+++ b/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
@@ -18,7 +18,7 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise
Expand Down Expand Up @@ -242,7 +242,7 @@ index 7fff86a4956f59b2f4a9f7e283256879c034c1b8..58d9840d2557fbb9b357bf4e3d5ad19e

this.regionCache.putAndMoveToFirst(key, ret);

@@ -144,7 +148,7 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise
@@ -144,11 +148,11 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise
}

final ChunkPos pos = new ChunkPos(chunkX, chunkZ);
Expand All @@ -251,6 +251,11 @@ index 7fff86a4956f59b2f4a9f7e283256879c034c1b8..58d9840d2557fbb9b357bf4e3d5ad19e

// note: not required to keep regionfile loaded after this call, as the write param takes a regionfile as input
// (and, the regionfile parameter is unused for writing until the write call)
- final ca.spottedleaf.moonrise.patches.chunk_system.io.MoonriseRegionFileIO.RegionDataController.WriteData writeData = ((ca.spottedleaf.moonrise.patches.chunk_system.storage.ChunkSystemRegionFile)regionFile).moonrise$startWrite(compound, pos);
+ final ca.spottedleaf.moonrise.patches.chunk_system.io.MoonriseRegionFileIO.RegionDataController.WriteData writeData = regionFile.moonrise$startWrite(compound, pos); // LinearPaper

try { // Paper - implement RegionFileSizeException
try {
@@ -178,7 +182,7 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise
) throws IOException {
final ChunkPos pos = new ChunkPos(chunkX, chunkZ);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,43 +89,6 @@ index 30bd254542d631676494f349ff3f44f52d54ab2f..63e6411d8bac1629e143cc620fe35dba
);

public record Favicon(byte[] iconBytes) {
diff --git a/net/minecraft/network/protocol/status/ServerStatus.java.rej b/net/minecraft/network/protocol/status/ServerStatus.java.rej
new file mode 100644
index 0000000000000000000000000000000000000000..04a6f2fe6563665d8432789e3cbb3278a9408669
--- /dev/null
+++ b/net/minecraft/network/protocol/status/ServerStatus.java.rej
@@ -0,0 +1,31 @@
+diff a/net/minecraft/network/protocol/status/ServerStatus.java b/net/minecraft/network/protocol/status/ServerStatus.java (rejected hunks)
+@@ -22,8 +22,11 @@ public record ServerStatus(
+ Optional<ServerStatus.Favicon> favicon,
+ boolean enforcesSecureChat
+ ) {
++ // Leaf start - Mirai - Configurable chat message signatures
+ public static final Codec<ServerStatus> CODEC = RecordCodecBuilder.create(
+- instance -> instance.group(
++ instance ->
++ org.dreeam.leaf.config.modules.network.ChatMessageSignature.enabled
++ ? instance.group(
+ ComponentSerialization.CODEC.lenientOptionalFieldOf("description", CommonComponents.EMPTY).forGetter(ServerStatus::description),
+ ServerStatus.Players.CODEC.lenientOptionalFieldOf("players").forGetter(ServerStatus::players),
+ ServerStatus.Version.CODEC.lenientOptionalFieldOf("version").forGetter(ServerStatus::version),
+@@ -31,7 +34,16 @@ public record ServerStatus(
+ Codec.BOOL.lenientOptionalFieldOf("enforcesSecureChat", Boolean.valueOf(false)).forGetter(ServerStatus::enforcesSecureChat)
+ )
+ .apply(instance, ServerStatus::new)
++ : instance.group(
++ ComponentSerialization.CODEC.lenientOptionalFieldOf("description", CommonComponents.EMPTY).forGetter(ServerStatus::description),
++ ServerStatus.Players.CODEC.lenientOptionalFieldOf("players").forGetter(ServerStatus::players),
++ ServerStatus.Version.CODEC.lenientOptionalFieldOf("version").forGetter(ServerStatus::version),
++ ServerStatus.Favicon.CODEC.lenientOptionalFieldOf("favicon").forGetter(ServerStatus::favicon),
++ Codec.BOOL.lenientOptionalFieldOf("enforcesSecureChat", Boolean.FALSE).forGetter(x -> true)
++ )
++ .apply(instance, ServerStatus::new)
+ );
++ // Leaf end- Mirai - Configurable chat message signatures
+
+ public static record Favicon(byte[] iconBytes) {
+ private static final String PREFIX = "data:image/png;base64,";
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
index 22b0f33dc3ef9f51ba2ca3cb665b07a16bd1c9d9..7b1e5addd6a1b815498233ba9032f224494af12a 100644
--- a/net/minecraft/server/dedicated/DedicatedServer.java
Expand Down Expand Up @@ -173,7 +136,7 @@ index ee8cdd532b73180cb484fcc37c36f09c40faacda..eb388c1c94bc6feda6c8757b1800d158
if (packet == null || this.processedDisconnect) { // Spigot
return;
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
index e4c3819de8af08f36cd30fafb6ce859005c5cb43..b98e854fb9fad65b176b4915214a0a4c5e424d6c 100644
index 7d7343d4e2c206daf77a61050f2f4c229dd042cd..6855076ef73bbfd23e75ba4ae8eaa0ea598c9d4e 100644
--- a/net/minecraft/server/players/PlayerList.java
+++ b/net/minecraft/server/players/PlayerList.java
@@ -1509,7 +1509,7 @@ public abstract class PlayerList {
Expand Down
Loading

0 comments on commit 997d6b1

Please sign in to comment.