mirror of
https://github.com/Xiao-MoMi/Custom-Nameplates.git
synced 2025-12-23 17:09:25 +00:00
3.0.10.1
This commit is contained in:
@@ -402,4 +402,11 @@ public interface CNPlayer {
|
|||||||
* @return team view
|
* @return team view
|
||||||
*/
|
*/
|
||||||
TeamView teamView();
|
TeamView teamView();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the player is initialized
|
||||||
|
*
|
||||||
|
* @return initialized or not
|
||||||
|
*/
|
||||||
|
boolean isInitialized();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,6 +52,11 @@ public class BukkitCNPlayer extends AbstractCNPlayer {
|
|||||||
this.player = new WeakReference<>(player);
|
this.player = new WeakReference<>(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isInitialized() {
|
||||||
|
return player != null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Player player() {
|
public Player player() {
|
||||||
return player.get();
|
return player.get();
|
||||||
|
|||||||
@@ -207,6 +207,7 @@ public class BukkitPlatform implements Platform {
|
|||||||
// for skin plugin compatibility
|
// for skin plugin compatibility
|
||||||
registerPacketConsumer((player, event, packet) -> {
|
registerPacketConsumer((player, event, packet) -> {
|
||||||
try {
|
try {
|
||||||
|
if (!player.isInitialized()) return;
|
||||||
UUID pUUID = player.uuid();
|
UUID pUUID = player.uuid();
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
List<UUID> uuids = (List<UUID>) Reflections.field$ClientboundPlayerInfoRemovePacket$profileIds.get(packet);
|
List<UUID> uuids = (List<UUID>) Reflections.field$ClientboundPlayerInfoRemovePacket$profileIds.get(packet);
|
||||||
@@ -228,7 +229,6 @@ public class BukkitPlatform implements Platform {
|
|||||||
try {
|
try {
|
||||||
EnumSet<?> enums = (EnumSet<?>) Reflections.field$ClientboundPlayerInfoUpdatePacket$actions.get(packet);
|
EnumSet<?> enums = (EnumSet<?>) Reflections.field$ClientboundPlayerInfoUpdatePacket$actions.get(packet);
|
||||||
if (enums == null) return;
|
if (enums == null) return;
|
||||||
UUID pUUID = player.uuid();
|
|
||||||
boolean add_player = enums.contains(Reflections.enum$ClientboundPlayerInfoUpdatePacket$Action$ADD_PLAYER);
|
boolean add_player = enums.contains(Reflections.enum$ClientboundPlayerInfoUpdatePacket$Action$ADD_PLAYER);
|
||||||
boolean update_gamemode = enums.contains(Reflections.enum$ClientboundPlayerInfoUpdatePacket$Action$UPDATE_GAME_MODE);
|
boolean update_gamemode = enums.contains(Reflections.enum$ClientboundPlayerInfoUpdatePacket$Action$UPDATE_GAME_MODE);
|
||||||
if (add_player || update_gamemode) {
|
if (add_player || update_gamemode) {
|
||||||
@@ -239,8 +239,9 @@ public class BukkitPlatform implements Platform {
|
|||||||
if (uuid == null) continue;
|
if (uuid == null) continue;
|
||||||
|
|
||||||
// for skin plugin compatibility
|
// for skin plugin compatibility
|
||||||
if (add_player && uuid.equals(pUUID)) {
|
if (add_player && player.isInitialized()) {
|
||||||
if (player.isTempPreviewing() || player.isToggleablePreviewing() || CustomNameplates.getInstance().getUnlimitedTagManager().isAlwaysShow()) {
|
UUID pUUID = player.uuid();
|
||||||
|
if (uuid.equals(pUUID) && (player.isTempPreviewing() || player.isToggleablePreviewing() || CustomNameplates.getInstance().getUnlimitedTagManager().isAlwaysShow())) {
|
||||||
Tracker tracker = player.addPlayerToTracker(player);
|
Tracker tracker = player.addPlayerToTracker(player);
|
||||||
tracker.setScale(player.scale());
|
tracker.setScale(player.scale());
|
||||||
tracker.setCrouching(player.isCrouching());
|
tracker.setCrouching(player.isCrouching());
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Project settings
|
# Project settings
|
||||||
# Rule: [major update].[feature update].[bug fix]
|
# Rule: [major update].[feature update].[bug fix]
|
||||||
project_version=3.0.10
|
project_version=3.0.10.1
|
||||||
config_version=32
|
config_version=32
|
||||||
project_group=net.momirealms
|
project_group=net.momirealms
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user