9
0
mirror of https://github.com/Samsuik/Sakura.git synced 2025-12-22 00:09:20 +00:00
Files
SakuraMC/sakura-server/paper-patches/features/0001-Client-Visibility-Settings.patch
Samsuik 83fcc2fce0 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@d683970 Add FishHookStateChangeEvent (#12165)
PaperMC/Paper@369ad17 Cached tag parser for itemstack reading (#12547)
PaperMC/Paper@841d634 Fix ItemStack#addUnsafeEnchantment ignored for missing enchantment component (#12549)
PaperMC/Paper@c000b35 fix(bukkit-brig-forwarding-map): Invert isEmpty method (#12555)
PaperMC/Paper@28d7df7 Backport HeroesOfTheVillage datafixer fix
PaperMC/Paper@f1dbed0 Implement BlocksAttack DamageReduction and ItemDamage (#12538)
PaperMC/Paper@cc38032 Deprecate TeleportCause CHORUS_FRUIT for CONSUMABLE_EFFECT (#12546)
PaperMC/Paper@3587867 [ci skip] Fix format and mentions for ItemDamageFunction (#12560)
PaperMC/Paper@7171d29 [ci skip] Mention CAN_PLACE/CAN_BREAK component in ItemMeta (#12559)
PaperMC/Paper@6f73e62 Add getPickItemStack (#12552)
PaperMC/Paper@ce0fa4c Replace old version command with brigadier equivalent (#12502)
PaperMC/Paper@fa360aa Add some missing annotations and an incorrect one (#12204)
PaperMC/Paper@113b18e Update paperweight and Gradle wrapper (#12573)
PaperMC/Paper@f303a07 fix: Don't hardcode checks for translation registries (#12571)
PaperMC/Paper@87349c3 Fix CombatTracker stale on death (#12562)
PaperMC/Paper@b70bca6 Revert "fix: Don't hardcode checks for translation registries (#12571)"
PaperMC/Paper@3efaf47 Add API for client-side signs (#11903)
PaperMC/Paper@a3909f5 [ci skip] Fix bad format for jd @link (#12581)
PaperMC/Paper@7774243 Add plugin details to zip file errors (#12580)
PaperMC/Paper@220b57a Fixs and Improvements for EndermanEscapeEvent (#12570)
PaperMC/Paper@b8fe22c Do not call EntityRemoveEvent during worldgen (#12588)
PaperMC/Paper@ee3b405 Replace spigot check with generation check
PaperMC/Paper@84ee424 Add Map filled event (#12574)
PaperMC/Paper@b9d6ba2 Expose more data for MusicInstrument (#12415)
PaperMC/Paper@a033e3b Fix ancient player custom name converter
PaperMC/Paper@4765010 Improve error messages when PluginRemapper fails to initialize (#12598)
PaperMC/Paper@6f31535 Add MCUtil#toLocation from Folia
PaperMC/Paper@2ba1675 Replace deprecated Thread#getId usage with Thread#threadId
2025-05-29 21:31:01 +01:00

48 lines
2.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samsuik <kfian294ma4@gmail.com>
Date: Tue, 21 Sep 2021 23:54:25 +0100
Subject: [PATCH] Client Visibility Settings
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 8419ab4504de0a11149d01ca2bc5185af8821b18..9c15d1509252eb288c5265fc7989405544e1e157 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2376,6 +2376,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
handle.expToDrop = data.getIntOr("expToDrop", 0);
handle.keepLevel = data.getBooleanOr("keepLevel", false);
});
+ // Sakura start - client visibility settings; load from nbt
+ CompoundTag sakuraTag = tag.getCompoundOrEmpty("sakura");
+ this.getHandle().visibilitySettings.loadData(sakuraTag);
+ // Sakura end - client visibility settings; load from nbt
}
public void setExtraData(CompoundTag tag) {
@@ -2405,6 +2409,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
paper.putLong("LastLogin", handle.loginTime);
paper.putLong("LastSeen", System.currentTimeMillis());
// Paper end
+ // Sakura start - client visibility settings; save to nbt
+ CompoundTag sakuraTag = tag.getCompoundOrEmpty("sakura");
+ this.getHandle().visibilitySettings.saveData(sakuraTag);
+ tag.put("sakura", sakuraTag);
+ // Sakura end - client visibility settings; save to nbt
}
@Override
@@ -3071,6 +3080,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return this.getHandle().allowsListing();
}
+ // Sakura start - client visibility settings; api
+ @Override
+ public final me.samsuik.sakura.player.visibility.VisibilitySettings getVisibility() {
+ return this.getHandle().visibilitySettings;
+ }
+ // Sakura end - client visibility settings; api
+
// Paper start
@Override
public net.kyori.adventure.text.Component displayName() {