Skip to content

Commit

Permalink
Make appleskin protocol check channel
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yh-china committed Sep 17, 2023
1 parent a3ce3bc commit 2baf839
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions patches/server/0052-Appleskin-Protocol.patch
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ index 3417c4184f7a9516c3910d4ccf8f139ba96e3224..47b27712c6ed11fc5c2cd7de04482870
world.setSpawnSettings(world.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && config.spawnMonsters, config.spawnAnimals); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean))
diff --git a/src/main/java/top/leavesmc/leaves/protocol/AppleSkinProtocol.java b/src/main/java/top/leavesmc/leaves/protocol/AppleSkinProtocol.java
new file mode 100644
index 0000000000000000000000000000000000000000..6f0b2140df822dc86e360837780768f2f5203041
index 0000000000000000000000000000000000000000..7b8f543a6f5b1671d3a9c3feaa831c058ed5920f
--- /dev/null
+++ b/src/main/java/top/leavesmc/leaves/protocol/AppleSkinProtocol.java
@@ -0,0 +1,95 @@
@@ -0,0 +1,99 @@
+package top.leavesmc.leaves.protocol;
+
+import io.netty.buffer.Unpooled;
Expand Down Expand Up @@ -132,6 +132,10 @@ index 0000000000000000000000000000000000000000..6f0b2140df822dc86e360837780768f2
+ public static void tick() {
+ if (LeavesConfig.appleskinProtocol) {
+ for (ServerPlayer player : players) {
+ if (!player.getBukkitEntity().getListeningPluginChannels().contains(SATURATION_KEY.toString())) {
+ continue;
+ }
+
+ FoodData data = player.getFoodData();
+
+ float saturation = data.getSaturationLevel();
Expand Down

0 comments on commit 2baf839

Please sign in to comment.