Skip to content

Commit

Permalink
Updated Upstream (Pufferfish)
Browse files Browse the repository at this point in the history
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by SapphireMC and as with ANY update, please do your own testing

Pufferfish Changes:
pufferfish-gg/Pufferfish@2bc9d45 Updated Upstream (Paper)
pufferfish-gg/Pufferfish@a3c0a4d Updated Upstream (Paper)
pufferfish-gg/Pufferfish@fb73c9b Updated Upstream (Paper)
pufferfish-gg/Pufferfish@f572e28 Disable suffocation optimization for withers
pufferfish-gg/Pufferfish@3d174ab Merge branch 'wefhy-ver/1.20' into ver/1.20 (#80)
pufferfish-gg/Pufferfish@e32a780 Updated Upstream (Paper)
pufferfish-gg/Pufferfish@0020a8b Port a patch from upstream
pufferfish-gg/Pufferfish@979d3a2 Update upstream (last 1.20.1)
  • Loading branch information
DenaryDev committed Oct 14, 2023
1 parent 7722bc0 commit 133d154
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 51 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=io.sapphiremc.sapphire
version=1.20.1-R0.1-SNAPSHOT

mcVersion=1.20.1
pufferfishRef=38b9f2ec6eec5efc49a4d546b1c442e737e548e2
pufferfishRef=979d3a2f4cf2b8bc555276b41ee6645218dc6e14

org.gradle.caching=true
org.gradle.parallel=true
Expand Down
4 changes: 2 additions & 2 deletions patches/api/0002-Sapphire-configuration.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Sapphire configuration


diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 68206cf0178c26c0f528a1e14a5fb4e9ad410369..0a978f412b920dfa6e0c6f41f98d2b842c9ab4f2 100644
index 8d8fe04e6b09d2a5b1cc05002073df5c58cdcb96..b5c9eddef4fc98a31089b0d7c1f7df463032fe73 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2081,6 +2081,14 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -2121,6 +2121,14 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
}
// Paper end

Expand Down
4 changes: 2 additions & 2 deletions patches/api/0003-Chromium-client-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Chromium client support


diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 14c92390aeaeee518f43778ccd5fc820fdc62689..d81da4058e750254e0db1c6439e724301c7d29c1 100644
index f59cbc92334c7b7b20e593a58232fb3c4434f12b..13e53886dd3f44a52a2eb5e5ed634ca4210e8e78 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -3241,4 +3241,13 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -3273,4 +3273,13 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@Override
Spigot spigot();
// Spigot end
Expand Down
16 changes: 8 additions & 8 deletions patches/server/0001-Rebrand.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Rebrand


diff --git a/build.gradle.kts b/build.gradle.kts
index 1c1dd088187f5700e3e4b7ec3b4b6c0acd5c119a..04c6bb0b9f3a74639fb7ea57a958d0faddc6c3ab 100644
index 0759c54fadad7abacc71b8199239551a94bb667c..0272491828a2064cdc30499bcf461e73ce84cf33 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -13,9 +13,9 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
Expand Down Expand Up @@ -137,10 +137,10 @@ index c5d5648f4ca603ef2b1df723b58f9caf4dd3c722..1abd60741ece7982bdb6a2d90f81df36
.completer(new ConsoleCommandCompleter(this.server))
.option(LineReader.Option.COMPLETE_IN_WORD, true);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 7ca6c81afc99d42d2f39b4b6d7f5e8a18b58fba3..abe59c657b56de2600a6b918a1bd9fbb297c2a86 100644
index 67cba5cf510e4a602121e10c015a491650127752..107a0e018a3cea1b829adabd284a2f932af8955d 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -923,7 +923,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -922,7 +922,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
shutdownThread = Thread.currentThread();
org.spigotmc.WatchdogThread.doStop(); // Paper
if (!isSameThread()) {
Expand All @@ -150,7 +150,7 @@ index 7ca6c81afc99d42d2f39b4b6d7f5e8a18b58fba3..abe59c657b56de2600a6b918a1bd9fbb
this.getRunningThread().stop();
try {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index a774e6af15993a97a231d45b676e26fb1128f05f..f71da3a69740b0d8023007c094f9fb0daf6fe9a3 100644
index 0f89716d1131178bd7ac927ef68337357139e2b7..64f639f83886ce6e5c7708fe2c81aeee7af72b8d 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -265,7 +265,7 @@ import javax.annotation.Nullable; // Paper
Expand All @@ -163,10 +163,10 @@ index a774e6af15993a97a231d45b676e26fb1128f05f..f71da3a69740b0d8023007c094f9fb0d
private final String bukkitVersion = Versioning.getBukkitVersion();
private final Logger logger = Logger.getLogger("Minecraft");
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index 776b7fc26fe96b69be260bbd36efae147d988640..0c071045be970b0ae5c34f1995e210ff02c346d9 100644
index 7c29d92362a82330440dff151bcf421f15c68f71..6283eaed4189fb72f222ff2de71f238b317e9acf 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -292,7 +292,7 @@ public class Main {
@@ -300,7 +300,7 @@ public class Main {
if (buildDate.before(deadline.getTime())) {
// Paper start - This is some stupid bullshit
System.err.println("*** Warning, you've not updated in a while! ***");
Expand All @@ -176,7 +176,7 @@ index 776b7fc26fe96b69be260bbd36efae147d988640..0c071045be970b0ae5c34f1995e210ff
//Thread.sleep(TimeUnit.SECONDS.toMillis(20));
// Paper End
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 1adf1ab6af94b561dc8cbbd3e5746e0bb2a11d41..65d88f39a6e047c72f595b9da783d42baeb59e1b 100644
index 2b4581f92543c11f31bcc1417e90d7f90b2aea20..8ca6a0c447754ff629c07f6ddf0d52aef68f2b5d 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -470,7 +470,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
Expand All @@ -202,7 +202,7 @@ index 80553face9c70c2a3d897681e7761df85b22d464..76278161386b648bcf12188df382cb83

if (stream != null) {
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
index 98fba0288be9ed2cb18ffba5cf81148157dd4fcf..9ef24b92e9efac83aa6eb5489b5fe1e7458ec351 100644
index 50c72e5db369a180f425eaaa0411cb8871bc3463..980cba15b0f7fc4afbd10efea3d703c8d00750ab 100644
--- a/src/main/java/org/spigotmc/WatchdogThread.java
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
@@ -155,14 +155,14 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
Expand Down
22 changes: 11 additions & 11 deletions patches/server/0002-Sapphire-config-files.patch
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,10 @@ index 0000000000000000000000000000000000000000..226a5e361f382585f4dcc5e901d2a1bd
+ }
+}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index abe59c657b56de2600a6b918a1bd9fbb297c2a86..4c4635473f84d13715a1bd23f99d765167198441 100644
index 107a0e018a3cea1b829adabd284a2f932af8955d..4a4bea4921dcc9c473ed8d0202e0067b3d2d640d 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1695,7 +1695,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1694,7 +1694,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa

@DontObfuscate
public String getServerModName() {
Expand All @@ -229,7 +229,7 @@ index abe59c657b56de2600a6b918a1bd9fbb297c2a86..4c4635473f84d13715a1bd23f99d7651

public SystemReport fillSystemReport(SystemReport details) {
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 28af96ce4f9f1a83316b6fd9e1625c71b5874c3f..fe119ad091e53618906e2e6bc5e2270812f44324 100644
index 10501842887c1ffdb6bb667480682b7174fd89c6..b40f73a5ec56f3456ec04a53f7fe529bad3058c8 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -218,6 +218,14 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
Expand All @@ -248,19 +248,19 @@ index 28af96ce4f9f1a83316b6fd9e1625c71b5874c3f..fe119ad091e53618906e2e6bc5e22708
io.papermc.paper.brigadier.PaperBrigadierProviderImpl.INSTANCE.getClass(); // init PaperBrigadierProvider
// Paper end
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index e9a31314424d9db911cd9806741222397c3072d7..64b93ff0b24685db8d40f9855a58c8f214063510 100644
index d265a32bd273beed0e65e224e1c5f9c0bca7b3fb..9bc77b56e65de7b136726de76bc088c776524d8a 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -413,6 +413,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
boolean flag = this instanceof net.minecraft.world.entity.player.Player;

if (!this.level().isClientSide) {
+ if (!io.sapphiremc.sapphire.SapphireConfig.disableEntityStuckChecks) // Sapphire
if ((!gg.pufferfish.pufferfish.PufferfishConfig.enableSuffocationOptimization || (tickCount % 10 == 0 && couldPossiblyBeHurt(1.0F))) && this.isInWall()) { // Pufferfish - optimize suffocation
if (shouldCheckForSuffocation() && this.isInWall()) { // Pufferfish - optimize suffocation
this.hurt(this.damageSources().inWall(), 1.0F);
} else if (flag && !this.level().getWorldBorder().isWithinBounds(this.getBoundingBox())) {
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index d8d4a1ca2eb062af8b2de4ab44503983587cdd77..07e2864de3f9d397b1390f1aa7db85c112b66d67 100644
index 21c11ff8d5ae9bf97dfcf3118cabe678deb4c064..af8ab3929eadeef34ebf87dd1fa1c0e496a32ec4 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -176,6 +176,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
Expand All @@ -280,26 +280,26 @@ index d8d4a1ca2eb062af8b2de4ab44503983587cdd77..07e2864de3f9d397b1390f1aa7db85c1
this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env);

diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index f71da3a69740b0d8023007c094f9fb0daf6fe9a3..59e9e2a0860b16baafec47bb4fb1694b14c2cd34 100644
index 64f639f83886ce6e5c7708fe2c81aeee7af72b8d..83c6719fa4751ec31bca1e80782d9241e45ae636 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1057,6 +1057,7 @@ public final class CraftServer implements Server {
@@ -1037,6 +1037,7 @@ public final class CraftServer implements Server {

org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot
this.console.paperConfigurations.reloadConfigs(this.console);
+ io.sapphiremc.sapphire.SapphireConfig.init((File) console.options.valueOf("sapphire-settings")); // Sapphire
for (ServerLevel world : this.console.getAllLevels()) {
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
world.setSpawnSettings(world.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && config.spawnMonsters, config.spawnAnimals); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean))
@@ -1072,6 +1073,7 @@ public final class CraftServer implements Server {
@@ -1052,6 +1053,7 @@ public final class CraftServer implements Server {
}
}
world.spigotConfig.init(); // Spigot
+ world.sapphireConfig.init(); // Sapphire
}

Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper
@@ -2907,6 +2909,13 @@ public final class CraftServer implements Server {
@@ -2917,6 +2919,13 @@ public final class CraftServer implements Server {
return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console);
}

Expand All @@ -314,7 +314,7 @@ index f71da3a69740b0d8023007c094f9fb0daf6fe9a3..59e9e2a0860b16baafec47bb4fb1694b
public void restart() {
org.spigotmc.RestartCommand.restart();
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index 0c071045be970b0ae5c34f1995e210ff02c346d9..e08d62a6c40431ea94574d6972ccd9ca47310a09 100644
index 6283eaed4189fb72f222ff2de71f238b317e9acf..da6bcc5216ccb961fde23f63ba60a736e5f6a20e 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -173,6 +173,14 @@ public class Main {
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0003-Per-entity-type-collision-settings.patch
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@ index 81dbf4ae89d1959996c453c4e15abf046edc0bd9..38deac094eccb6eb6c2305a01f3760e9
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 64b93ff0b24685db8d40f9855a58c8f214063510..f0363fb325331b44b487f8b3f4956519a1871d6b 100644
index 9bc77b56e65de7b136726de76bc088c776524d8a..c129a29575dae59bdd0414ec2b85806e34282f3c 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3537,7 +3537,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -3541,7 +3541,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
return;
}
// Paper end - don't run getEntities if we're not going to use its result
Expand Down
14 changes: 7 additions & 7 deletions patches/server/0008-Chromium-client-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ index c337948c82263af20e55570a2c65288aa0123334..e59f4a767d04046404c266bafba4ccc4

return aliases;
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index dc5fda83a66afbfeb7897fc20b4742899d8aca08..6d97a3eda59cba0c6ccaf380589d48b9ea844e21 100644
index b382da838acc04a1c5d89064b4fa43bcdd38ae71..efae2a44b10c410e26650feeb64455795685ebc1 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -277,6 +277,7 @@ public class ServerPlayer extends Player {
@@ -278,6 +278,7 @@ public class ServerPlayer extends Player {
public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> cachedSingleHashSet; // Paper
public PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper
public org.bukkit.event.player.PlayerQuitEvent.QuitReason quitReason = null; // Paper - there are a lot of changes to do if we change all methods leading to the event
Expand All @@ -82,18 +82,18 @@ index dc5fda83a66afbfeb7897fc20b4742899d8aca08..6d97a3eda59cba0c6ccaf380589d48b9
private final java.util.concurrent.atomic.AtomicReference<io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.ViewDistances> viewDistances = new java.util.concurrent.atomic.AtomicReference<>(new io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.ViewDistances(-1, -1, -1));
public io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.PlayerChunkLoaderData chunkLoader;
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index f2e71c26c889bdee2cd2b86dcde9d4c35a3574bd..dc2677ac74541d6e74bd9125232ffd740ec90c37 100644
index 6cafc20ce006872bedd28a34db11204c3c1fef58..ca25aa429b91088b3c775a7aec234ce5851cb903 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3582,6 +3582,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -3574,6 +3574,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
private static final ResourceLocation CUSTOM_UNREGISTER = new ResourceLocation("unregister");

private static final ResourceLocation MINECRAFT_BRAND = new ResourceLocation("brand"); // Paper - Brand support
+ private static final ResourceLocation CHROMIUM_CLIENT = new ResourceLocation("chromium", "client"); // Sapphire

@Override
public void handleCustomPayload(ServerboundCustomPayloadPacket packet) {
@@ -3606,6 +3607,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -3598,6 +3599,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t unregister custom payload", ex);
this.disconnect("Invalid payload UNREGISTER!", org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PAYLOAD); // Paper - kick event cause
}
Expand All @@ -108,10 +108,10 @@ index f2e71c26c889bdee2cd2b86dcde9d4c35a3574bd..dc2677ac74541d6e74bd9125232ffd74
try {
byte[] data = new byte[packet.data.readableBytes()];
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 5bbded65095dccfadaf7576fc41b5f62974878b4..8a04e974bb1bef9cfddd4bf621d04cd8bc5d7584 100644
index 3d5876cbadb5c8c02de751c3e15fc7f251ea7d35..ced695c043150f2fc2c4c2d4cea52877757f1ecb 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -3212,4 +3212,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -3267,4 +3267,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return this.spigot;
}
// Spigot end
Expand Down
Loading

0 comments on commit 133d154

Please sign in to comment.