mirror of
https://github.com/Samsuik/Sakura.git
synced 2025-12-23 00:39:20 +00:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@deaccd2 [ci skip] Add file reference url to help.yml (#12481) PaperMC/Paper@f86b435 Add vault change state event (#12069) PaperMC/Paper@3e3b42c Update player chat session sync (#12382) PaperMC/Paper@f8fa4f6 Add method to retrieve FishHook (#12310) PaperMC/Paper@b9d3147 Use correct placed block position for sound (#12410) PaperMC/Paper@952338b [ci skip] Add missing exception docs to Player#listPlayer (#12488) PaperMC/Paper@1db3785 [ci skip] improve javadoc for off-hand swaps through getHotbarButton (#12489) PaperMC/Paper@d1810f2 Allow Server#getDefaultGameMode before worlds are initialized (#12490) PaperMC/Paper@02d20ff Fix NPE in Server#getMap before worlds are loaded (#12492) PaperMC/Paper@9e873f5 Fix inconsistencies between offline/online spawn position getter (#11960) PaperMC/Paper@fc0c371 Fix handling of resultant crafting container from craftItemResult (#12307) PaperMC/Paper@a7a76c8 Add methods for Armadillo (#12031) PaperMC/Paper@a74400d Update adventure to 4.21.0 (#12499) PaperMC/Paper@1e93076 Fix ipv6 loopback addresses being able to get connection throttled (#12155) PaperMC/Paper@646b80c Fix unnecessary map data saves (#12296) PaperMC/Paper@e663f99 Add combat tracker API (#11853) PaperMC/Paper@cd4fe5b [ci skip] Drop non-applicable ATs (#12498) PaperMC/Paper@5acfdd6 Fix save/load NaN Entity Motion (#12269) PaperMC/Paper@2754d7c Add Throw EntityChangeBlockEvent for BrushableBlockEntity#brush (#12133) PaperMC/Paper@567f63a Parity for respawn events (#11792) PaperMC/Paper@bc3d946 Normalizes CraftEntity#toString/getHandle (#12170) PaperMC/Paper@0e9b94d Fix ItemStack amount issues with Chat Components (#12216) PaperMC/Paper@835b955 Add a method on InventoryView to get the MenuType (#12193) PaperMC/Paper@c9411bf Fix min ItemStack amount check for asHoverEvent (#12505) PaperMC/Paper@1acf3b3 Infer block entity data in brigadier blockstate argument (#12197) PaperMC/Paper@b9b3cd6 Use components instead of ChatColor in more places (#12507) PaperMC/Paper@ec42171 Add missing spaces back (#12508) PaperMC/Paper@51345a1 Correct nullable fall location type PaperMC/Paper@93246a0 Fix errors when loading raid files without a PDC PaperMC/Paper@cb3ffd0 Don't store empty PDCs on raids PaperMC/Paper@d637ae8 Fix NoSuchElementException in EntityTransformEvent for slimes (#12510) PaperMC/Paper@1074237 Pass correct draw strength for EntityShootBowEvent (#12308) PaperMC/Paper@825685f Add PlayerPickBlockEvent and PlayerPickEntityEvent (#12425) PaperMC/Paper@2bd84f6 Expand PotionMeta Api to allow getting effective potion colour and effects (#12390) PaperMC/Paper@6f1f5b6 Fix ArmorStand items for canceled EntityDeathEvent (#12288)
48 lines
2.2 KiB
Diff
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 dab008f7d5cd6c04eee96579d5ec30e549f100f5..9b2bf0c4a4dabe216370f0d8d5b8ab889ad78e58 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
@@ -2375,6 +2375,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) {
|
|
@@ -2404,6 +2408,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
|
|
@@ -3064,6 +3073,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() {
|