Skip to content
This repository has been archived by the owner on May 7, 2023. It is now read-only.

Commit

Permalink
Updated Upstream ()
Browse files Browse the repository at this point in the history
Upstream has released updates that appear to apply and compile correctly
  • Loading branch information
NCT-skyouo committed Oct 1, 2022
1 parent 4690bff commit d17a3f9
Show file tree
Hide file tree
Showing 6 changed files with 124 additions and 8 deletions.
5 changes: 3 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
org.gradle.caching=true
org.gradle.parallel=true
org.gradle.vfs.watch=false
org.gradle.parallel.threads=8
org.gradle.daemon=true

group=engineer.skyouo.core
version=1.19.2-R0.1-SNAPSHOT
mcVersion=1.19.2
pufferfishRef=4b26a0baf6c780a22d93f93022617cc43294ac04
pufferfishRef=58865aa0d59aa6f459d4256f78917e97428a6124
Empty file modified gradlew
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions patches/server/0002-Brilliant-Config-And-Command.patch
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,10 @@ index 0000000000000000000000000000000000000000..a52a625f0e0e9a3f6b799f43c926adbb
+ }
+}
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index 0a843e0afbcb1af8e2641515eb244b791b819b8c..f8fb9ae95b163ad4e1f093e5b6723bc06a040456 100644
index 5962f7a2b185d7d54a0f9e341a4fdf6e6f1c1ec5..8d341c6675fb0823e155c305ae548a78465bdd3d 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -156,6 +156,8 @@ public class Main {
@@ -173,6 +173,8 @@ public class Main {
LevelStorageSource.LevelStorageAccess convertable_conversionsession = convertable.createAccess(s, LevelStem.OVERWORLD);
LevelSummary worldinfo = convertable_conversionsession.getSummary();

Expand Down
8 changes: 4 additions & 4 deletions patches/server/0003-Unlocking-TPS-Limits.patch
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ index 325b294b51942a90715ab683b8b5d35529755697..26aad515cfde30322a2e9a4ca3c8f72f
this.status.setPlayers(new ServerStatus.Players(this.getMaxPlayers(), this.getPlayerCount()));
if (!this.hidesOnlinePlayers()) {
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 9aab29dd7a09c306d6c0e1e8143daf005d611d65..a4dad949ddf5fd7ad0469e32a8d2ecc23ffa91a6 100644
index cc55cb14f2d0f656213be25a1e428132871ac5dd..96e03b099f5a37b270967e18698db6e54b9b5d14 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -373,7 +373,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -367,7 +367,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
++this.tickCount;
this.knownMovePacketCount = this.receivedMovePacketCount;
if (this.clientIsFloating && !this.player.isSleeping() && !this.player.isPassenger()) {
Expand All @@ -131,7 +131,7 @@ index 9aab29dd7a09c306d6c0e1e8143daf005d611d65..a4dad949ddf5fd7ad0469e32a8d2ecc2
ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating too long!", this.player.getName().getString());
this.disconnect(io.papermc.paper.configuration.GlobalConfiguration.get().messages.kick.flyingPlayer, org.bukkit.event.player.PlayerKickEvent.Cause.FLYING_PLAYER); // Paper - use configurable kick message & kick event cause
return;
@@ -392,7 +392,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -386,7 +386,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
this.vehicleLastGoodY = this.lastVehicle.getY();
this.vehicleLastGoodZ = this.lastVehicle.getZ();
if (this.clientVehicleIsFloating && this.player.getRootVehicle().getControllingPassenger() == this.player) {
Expand All @@ -141,7 +141,7 @@ index 9aab29dd7a09c306d6c0e1e8143daf005d611d65..a4dad949ddf5fd7ad0469e32a8d2ecc2
this.disconnect(io.papermc.paper.configuration.GlobalConfiguration.get().messages.kick.flyingVehicle, org.bukkit.event.player.PlayerKickEvent.Cause.FLYING_VEHICLE); // Paper - use configurable kick message & kick event cause
return;
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 88a849a21d6e39fd70f6e7b554528da1a5a7dd57..88a7d77aaa6587817d4c3c20f961f7319a1140aa 100644
index 855eac5e6f3a99a2fc31ad0e02c496d4b5c60622..e8413a86d4f290b040727b56d458538a99080dc6 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -101,7 +101,7 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se
Expand Down
75 changes: 75 additions & 0 deletions scripts/apatch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#!/usr/bin/env bash

gitcmd="git -c commit.gpgsign=false"

noapply=1
isreject=0
if [[ $1 == "--noapplied" ]]; then
noapply=1
shift
fi

if [ ! -z "$1" ]; then
file="$1"
elif [ -z "$1" ] && [ -f .git/rebase-apply/patch ]; then
file=".git/rebase-apply/patch"
noapply=1
isreject=1
else
echo "Please specify a file"
exit 1
fi
applied=$(echo $file | sed 's/.patch$/-applied\.patch/g')
if [ "$1" == "--reset" ]; then
$gitcmd am --abort
$gitcmd reset --hard
$gitcmd clean -f
exit 0
fi


(test "$isreject" != "1" && $gitcmd am -3 $file) || (
echo "Failures - Wiggling"
$gitcmd reset --hard
$gitcmd clean -f
errors=$($gitcmd apply --rej $file 2>&1)
echo "$errors" >> ~/patch.log
export missingfiles=""
export summaryfail=""
export summarygood=""
for i in $(find . -name \*.rej); do
base=$(echo "$i" | sed 's/.rej//g')
if [ -f "$i" ]; then
sed -e 's/^diff a\/\(.*\) b\/\(.*\)[[:space:]].*rejected.*$/--- \1\n+++ \2/' -i $i && wiggle -v -l --replace "$base" "$i"
rm "$base.porig" "$i"
else
echo "No such file: $base"
missingfiles="$missingfiles\n$base"
fi
done
for i in $($gitcmd status --porcelain | awk '{print $2}'); do
filedata=$(cat "$i")
if [ -f "$file" ] && [[ "$filedata" == *"<<<<<"* ]]; then
export summaryfail="$summaryfail\nFAILED TO APPLY: $i"
else
$gitcmd add --force "$i"
export summarygood="$summarygood\nAPPLIED CLEAN: $i"
fi
done
echo -e "$summarygood"
echo -e "$summaryfail"
if [[ "$errors" == *"No such file"* ]]; then
echo "===========================";
echo " "
echo " MISSING FILES"
echo "$errors" | grep "No such file"
echo -e "$missingfiles"
echo " "
echo "===========================";
fi
$gitcmd status
$gitcmd diff
)
if [[ "$noapply" != "1" ]] && [[ "$file" != *-applied.patch ]]; then
mv "$file" "$applied"
fi
40 changes: 40 additions & 0 deletions scripts/upstreamCommit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env bash

# requires curl & jq

# upstreamCommit --paper HASH --pufferfish HASH
# flag: --paper HASH - the commit hash to use for comparing commits between paper (PaperMC/Paper/compare/HASH...HEAD)
# flag: --pufferfish HASH - the commit hash to use for comparing commits between pufferfish (pufferfish-gg/Pufferfish/compare/HASH...HEAD)

function getCommits() {
curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/"$1"/compare/"$2"...HEAD | jq -r '.commits[] | "'"$1"'@\(.sha[:7]) \(.commit.message | split("\r\n")[0] | split("\n")[0])"'
}

(
set -e
PS1="$"

pufferfishHash="$2"

pufferfish=""
updated=""
logsuffix=""

# Pufferfish updates
if [ -n "$pufferfishHash" ]; then
pufferfish=$(getCommits "pufferfish-gg/Pufferfish" "$pufferfishHash")

# Updates found
if [ -n "$pufferfish" ]; then
updated="Pufferfish"
logsuffix="$logsuffix\n\nPufferfish Changes:\n$pufferfish"
fi
fi


disclaimer="Upstream has released updates that appear to apply and compile correctly"
log="Updated Upstream ($updated)\n\n${disclaimer}${logsuffix}"

echo -e "$log" | git commit -F -

) || exit 1

0 comments on commit d17a3f9

Please sign in to comment.