mirror of
https://github.com/Samsuik/Sakura.git
synced 2025-12-22 16:29:16 +00:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@cafef9c [ci skip] Move EntityUtil to correct directory (#12092) PaperMC/Paper@fa5824e Add skipTripwireHookPlacementValidation (#12091) PaperMC/Paper@3bd69f2 [ci skip] Enhance javadoc for World#setAutoSave method (#12088) PaperMC/Paper@13c80a5 [ci skip] Fix PlayerShearBlockEvent javadoc typos (#12101) PaperMC/Paper@db2aa18 [ci skip] Fix incomplete example in javadocs for PreFlattenTagRegistrar (#12102) PaperMC/Paper@cf7c6c7 [ci skip] Fix incomplete example in javadocs for PostFlattenTagRegistrar (#12103) PaperMC/Paper@072a831 Add proper attached blocks API to AbstractArrow (#12099) PaperMC/Paper@1be2e5f Fix vanilla map decorations sending when not dirty (#12098) PaperMC/Paper@a06179a Update entity effect (#12104) PaperMC/Paper@e616498 Add Vault block API (#12068) PaperMC/Paper@0a04c3f Fix some NPEs (#12105) PaperMC/Paper@0680485 Expand TrialSpawner API (#12025) PaperMC/Paper@46f4fda Add support for rotation argument handling (#12090)
51 lines
2.2 KiB
Diff
51 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 900ea27111dccce70f2c2af891d0064c487dce2e..93fead843e419817e8a0ae46d77896c8c674096a 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
@@ -2405,6 +2405,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|
handle.keepLevel = data.getBoolean("keepLevel");
|
|
}
|
|
}
|
|
+
|
|
+ // Sakura start - client visibility settings; load from nbt
|
|
+ if (nbttagcompound.contains("sakura", 10)) {
|
|
+ CompoundTag sakuraTag = nbttagcompound.getCompound("sakura");
|
|
+ this.getHandle().visibilitySettings.loadData(sakuraTag);
|
|
+ }
|
|
+ // Sakura end - client visibility settings; load from nbt
|
|
}
|
|
|
|
public void setExtraData(CompoundTag nbttagcompound) {
|
|
@@ -2434,6 +2441,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 = nbttagcompound.getCompound("sakura");
|
|
+ this.getHandle().visibilitySettings.saveData(sakuraTag);
|
|
+ nbttagcompound.put("sakura", sakuraTag);
|
|
+ // Sakura end - client visibility settings; save to nbt
|
|
}
|
|
|
|
@Override
|
|
@@ -3095,6 +3107,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() {
|