Skip to content

Commit

Permalink
Updated Upstream (Folia)
Browse files Browse the repository at this point in the history
Latest 1.20.4 Paper/Folia
  • Loading branch information
Dreeam-qwq committed May 9, 2024
1 parent 1e5e540 commit b027e4c
Show file tree
Hide file tree
Showing 26 changed files with 152 additions and 159 deletions.
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
java
`maven-publish`
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
id("io.papermc.paperweight.patcher") version "1.5.12"
id("io.papermc.paperweight.patcher") version "1.5.15"
}

val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
Expand All @@ -16,7 +16,7 @@ repositories {

dependencies {
remapper("net.fabricmc:tiny-remapper:0.10.1:fat")
decompiler("net.minecraftforge:forgeflower:2.0.627.2")
decompiler("org.vineflower:vineflower:1.10.1")
paperclip("io.papermc:paperclip:3.0.3")
}

Expand Down Expand Up @@ -75,7 +75,7 @@ paperweight {
decompileRepo.set("https://maven.quiltmc.org/")

useStandardUpstream("folia") {
url.set(github("PaperMC", "Folia"))
url.set(github("Dreeam-qwq", "Folia"))
ref.set(providers.gradleProperty("foliaCommit"))

withStandardPatcher {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
group = me.earthme.luminol
version = 1.20.4-R0.1-SNAPSHOT

foliaCommit = 25ee657a8290530812f5f93f62d48df541a02ccf
foliaCommit = 6dba62e72c05cd71da3a99da09f3d8879a508ac3

org.gradle.caching = true
org.gradle.parallel = true
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
29 changes: 17 additions & 12 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -133,26 +131,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -197,11 +198,15 @@ if "$cygwin" || "$msys" ; then
done
fi

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
20 changes: 10 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
4 changes: 2 additions & 2 deletions patches/api/0003-KioCG-Chunk-API.patch
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ index d547ae2b20c58bc703de4532b3b591dd34ddb1c6..8721954514f813d0a1200935e27a3ac0
+ long getChunkHotAvg(); // KioCG
}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index c6cb4f17469a8f2e60dd3e28d41402851ce5fb21..9800a173bfe0ab4a43e1f851c334ea121c5b9967 100644
index d048ae07cc33fd77d128cc1ebf88b0804969fa3c..7e633b448327ee01533a00bc278367c47951d3e2 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -3711,4 +3711,6 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -3752,4 +3752,6 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@Override
Spigot spigot();
// Spigot end
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0008-Add-config-for-chat-sign.patch
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ index 0000000000000000000000000000000000000000..1e03e51e51f56c38abaad100274e25c9
+ }
+}
diff --git a/src/main/java/net/minecraft/commands/arguments/ArgumentSignatures.java b/src/main/java/net/minecraft/commands/arguments/ArgumentSignatures.java
index 72a8aa676836fcb3b4578689d16af65e18f55bbe..9408747cb254a99d5cb3fc26fde16ddb80168894 100644
index 4abd7babc3aa7268975386e7c2319f7961b0c3aa..d209466866c30b3f15b8c40934ea6470292b8a77 100644
--- a/src/main/java/net/minecraft/commands/arguments/ArgumentSignatures.java
+++ b/src/main/java/net/minecraft/commands/arguments/ArgumentSignatures.java
@@ -14,9 +14,17 @@ public record ArgumentSignatures(List<ArgumentSignatures.Entry> entries) {
Expand All @@ -52,7 +52,7 @@ index 72a8aa676836fcb3b4578689d16af65e18f55bbe..9408747cb254a99d5cb3fc26fde16ddb
+
@Nullable
public MessageSignature get(String argumentName) {
for(ArgumentSignatures.Entry entry : this.entries) {
for (ArgumentSignatures.Entry entry : this.entries) {
diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
index b863249ff7e13cf4939c8961601f0564c62fd661..6ab73b0568c3f9df8090be992736a14d49e0286c 100644
--- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java
Expand Down
6 changes: 3 additions & 3 deletions patches/server/0009-Add-a-simple-tpsbar.patch
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,10 @@ index 9d7837f90340a96edbd544826ae2241c61ae72c4..c8701a2a0a3cbd60e263fe5c069b5993
public io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.ViewDistances getViewDistances() {
return this.viewDistances.get();
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index b0a70287ff1fc9b3d5eba322d949aaf510b165d2..74e7fefe0819829f9280cf1602cca841f796e7a3 100644
index 0ece776a1e281a328e28dc07fb4dc882b19d029c..b57980d4fa445f2aa71e4477459da833eade50e8 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2285,6 +2285,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -2287,6 +2287,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
handle.expToDrop = data.getInt("expToDrop");
handle.keepLevel = data.getBoolean("keepLevel");
}
Expand All @@ -384,7 +384,7 @@ index b0a70287ff1fc9b3d5eba322d949aaf510b165d2..74e7fefe0819829f9280cf1602cca841
}
}

@@ -2306,6 +2309,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -2308,6 +2311,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
data.putLong("lastPlayed", System.currentTimeMillis());
data.putString("lastKnownName", handle.getScoreboardName());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ index 0000000000000000000000000000000000000000..83176a8a7e993b51a0663b0f76161884
+ }
+}
diff --git a/src/main/java/net/minecraft/network/chat/SignedMessageChain.java b/src/main/java/net/minecraft/network/chat/SignedMessageChain.java
index ba12919c3f9aec34a9e64993b143ae92be5eb172..ba983d557ae16b3fbb7d0ea6ff67666a809d2e99 100644
index 0af9ed92824ccf30814eceb6a2c2e5c12661c991..7c42f0ca1f3abe38dcd97b0985c72332b45761f7 100644
--- a/src/main/java/net/minecraft/network/chat/SignedMessageChain.java
+++ b/src/main/java/net/minecraft/network/chat/SignedMessageChain.java
@@ -38,7 +38,7 @@ public class SignedMessageChain {
@@ -37,7 +37,7 @@ public class SignedMessageChain {
throw new SignedMessageChain.DecodeException(Component.translatable("chat.disabled.chain_broken"), false); // Paper - diff on change (if disconnects, need a new kick event cause)
} else if (playerPublicKey.data().hasExpired()) {
throw new SignedMessageChain.DecodeException(Component.translatable("chat.disabled.expiredProfileKey"), false, org.bukkit.event.player.PlayerKickEvent.Cause.EXPIRED_PROFILE_PUBLIC_KEY); // Paper - kick event causes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Kaiiju Don't pathfind outside region


diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/MoveToTargetSink.java b/src/main/java/net/minecraft/world/entity/ai/behavior/MoveToTargetSink.java
index 1ab77f3518d1df30f66ae44d7d4fa69e5b32d93a..98bf17441da3169d49de55fe89d79ebe250a2b7e 100644
index 2a7a26ca447cc78f24e61a2bf557411c31eb16b2..28602455d659dfac4653ab5b7bf4139f65c190ad 100644
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/MoveToTargetSink.java
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/MoveToTargetSink.java
@@ -107,7 +107,9 @@ public class MoveToTargetSink extends Behavior<Mob> {
@@ -120,7 +120,9 @@ public class MoveToTargetSink extends Behavior<Mob> {

private boolean tryComputePath(Mob entity, WalkTarget walkTarget, long time) {
BlockPos blockPos = walkTarget.getTarget().currentBlockPosition();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ Subject: [PATCH] Pufferfish Early return optimization for target finding


diff --git a/src/main/java/net/minecraft/world/entity/ai/targeting/TargetingConditions.java b/src/main/java/net/minecraft/world/entity/ai/targeting/TargetingConditions.java
index c8a80c1b2fedff22e8a877d466062375ffb2f0d7..3c4f4af85a3f2d4f9f52827164e63727b916c33a 100644
index d2f0c3b26d4beedb49d86e0242d843590d469d02..c55fe31f3fc1c9ccb949c6bfb64e1bd6f37b8356 100644
--- a/src/main/java/net/minecraft/world/entity/ai/targeting/TargetingConditions.java
+++ b/src/main/java/net/minecraft/world/entity/ai/targeting/TargetingConditions.java
@@ -75,9 +75,18 @@ public class TargetingConditions {
@@ -76,9 +76,18 @@ public class TargetingConditions {
}

if (this.range > 0.0D) {
- double d = this.testInvisible ? targetEntity.getVisibilityPercent(baseEntity) : 1.0D;
- double e = Math.max((this.useFollowRange ? this.getFollowRange(baseEntity) : this.range) * d, 2.0D); // Paper - Fix MC-145656
if (this.range > 0.0) {
- double d = this.testInvisible ? targetEntity.getVisibilityPercent(baseEntity) : 1.0;
- double e = Math.max((this.useFollowRange ? this.getFollowRange(baseEntity) : this.range) * d, 2.0); // Paper - Fix MC-145656
+ // Pufferfish start - check range before getting visibility
+ // d = invisibility percent, e = follow range adjusted for invisibility, f = distance
double f = baseEntity.distanceToSqr(targetEntity.getX(), targetEntity.getY(), targetEntity.getZ());
Expand All @@ -23,8 +23,8 @@ index c8a80c1b2fedff22e8a877d466062375ffb2f0d7..3c4f4af85a3f2d4f9f52827164e63727
+ return false;
+ }
+
+ double d = this.testInvisible ? targetEntity.getVisibilityPercent(baseEntity) : 1.0D;
+ double e = Math.max((followRangeRaw) * d, 2.0D); // Paper
+ double d = this.testInvisible ? targetEntity.getVisibilityPercent(baseEntity) : 1.0;
+ double e = Math.max((followRangeRaw) * d, 2.0D); // Paper - Fix MC-145656
+ // Pufferfish end
if (f > e * e) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ Subject: [PATCH] Pufferfish Fix Paper#6045, block goal shouldn't load chunks


diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java
index 07519c817cc6de04a98198c43a0c2b02ba3141eb..ee66be6e5aa45ec8448b6d30785a6e71200b09e3 100644
index aee0147649d458b87d92496eda0c1723ebe570d2..89e9ea999d2fbd81a1d74382ef3fcd675fc8b94e 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java
@@ -120,6 +120,7 @@ public abstract class MoveToBlockGoal extends Goal {
for(int m = 0; m <= l; m = m > 0 ? -m : 1 - m) {
for(int n = m < l && m > -l ? l : 0; n <= l; n = n > 0 ? -n : 1 - n) {
@@ -121,6 +121,7 @@ public abstract class MoveToBlockGoal extends Goal {
for (int m = 0; m <= l; m = m > 0 ? -m : 1 - m) {
for (int n = m < l && m > -l ? l : 0; n <= l; n = n > 0 ? -n : 1 - n) {
mutableBlockPos.setWithOffset(blockPos, m, k - 1, n);
+ if (!this.mob.level().hasChunkAt(mutableBlockPos)) continue; // Pufferfish - if this block isn't loaded, continue
if (this.mob.isWithinRestriction(mutableBlockPos) && this.isValidTarget(this.mob.level(), mutableBlockPos)) {
Expand Down
20 changes: 10 additions & 10 deletions patches/server/0031-Pufferfish-Dynamic-Activation-of-Brain.patch
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ index 43b8f64d7c14e6dd0975b24a3205806c4433f26f..3f394934e64df09e65b86d61a1dcabd3
if (false && this.shouldDiscardEntity(entity)) { // CraftBukkit - We prevent spawning in general, so this butchering is not needed
entity.discard();
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 835a6e73a340375e30e4822df45a1c99d36ac009..c7c0f6e399e472792ecad75fc402a64785fae818 100644
index 5c36b3c6bf38acfa3f38dcca4b666aca9665e7d4..5b76c645214852f172c2a498751438090cc970ec 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -481,6 +481,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
Expand Down Expand Up @@ -111,7 +111,7 @@ index 8deae3e95a26f4b42b2c2134e22f9649bd7a5391..c09357c1ef84a29d972119cb496b0ae9
private String descriptionId;
@Nullable
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index 7369d608c26e46e9d3a881ac14efe1d0f075b1cb..7f6b810f175e21dbbc85d17fefbba2a7c638144d 100644
index 7433a29577ecb36e847bd610059c0c83702d01f6..397c8ef1c83f0bf3c03d31ee19dbf1533dba9e48 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -234,10 +234,10 @@ public abstract class Mob extends LivingEntity implements Targeting {
Expand Down Expand Up @@ -149,10 +149,10 @@ index 7369d608c26e46e9d3a881ac14efe1d0f075b1cb..7f6b810f175e21dbbc85d17fefbba2a7
this.level().getProfiler().pop();
}
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
index 676f5485a4ca9252e911213dcda8d51776b637b6..0f53c206b4c0607e2cda5cfa4edeae5209e897bf 100644
index 38af5c7280366fd6ec077f3d914ea5f3ee77451a..f97b41422949bc6521b289daa6ca2861f25885a0 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
@@ -53,9 +53,12 @@ public class GoalSelector {
@@ -52,9 +52,12 @@ public class GoalSelector {
}

// Paper start
Expand Down Expand Up @@ -200,11 +200,11 @@ index b21e180641d17438997a80e5bcb0ec7998d24a2e..33c160994f70f71446d665e748791343
this.level().getProfiler().pop();
this.level().getProfiler().push("axolotlActivityUpdate");
diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
index 295769d039f2a1e4f48912a60f9dbe267d8992c1..e88b058c0734e436ef24bab6364b206c13e5a9c2 100644
index a03fb7aa9f4528f4885db88eaf480202d5f54750..1767fd2df8cb37e9c36fa3008b5131ff4bdad12c 100644
--- a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
+++ b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
@@ -159,9 +159,11 @@ public class Frog extends Animal implements VariantHolder<FrogVariant> {

@@ -183,9 +183,11 @@ public class Frog extends Animal implements VariantHolder<FrogVariant> {
}
}

+ private int behaviorTick = 0; // Pufferfish
Expand Down Expand Up @@ -248,11 +248,11 @@ index 5d247ac38fe8a61603b3d934f3000bcda773142b..2e4177cfb02616ef6fa689f6d378976e
this.level().getProfiler().pop();
this.level().getProfiler().push("goatActivityUpdate");
diff --git a/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java b/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java
index 01a2016ac82807d28ffe407b7dbb74bdbcde503e..9921b160fb21f72fbd28fe81ea66fbc3dc05f83f 100644
index 050ffa4a23feba29fdf4c6a175cdff4e5009027d..1299f93d4f983e6715e447add65df91ef9e9090a 100644
--- a/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java
+++ b/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java
@@ -128,9 +128,11 @@ public class Hoglin extends Animal implements Enemy, HoglinBase {
return (Brain<Hoglin>) super.getBrain(); // Paper - decompile fix
@@ -155,9 +155,11 @@ public class Hoglin extends Animal implements Enemy, HoglinBase {
return (Brain<Hoglin>)super.getBrain();
}

+ private int behaviorTick; // Pufferfish
Expand Down
Loading

0 comments on commit b027e4c

Please sign in to comment.