9
0
mirror of https://github.com/Xiao-MoMi/Custom-Nameplates.git synced 2025-12-19 15:09:23 +00:00
This commit is contained in:
XiaoMoMi
2024-03-13 19:19:18 +08:00
parent be8cf27f37
commit abcece373f
6 changed files with 15 additions and 8 deletions

View File

@@ -7,7 +7,7 @@ plugins {
allprojects {
version = "2.3.3.4"
version = "2.3.3.6"
apply<JavaPlugin>()
apply(plugin = "java")

View File

@@ -38,7 +38,7 @@ dependencies {
compileOnly("commons-io:commons-io:2.15.1")
compileOnly("org.geysermc.geyser:api:2.2.0-SNAPSHOT")
compileOnly("LibsDisguises:LibsDisguises:10.0.42")
compileOnly("com.github.Xiao-MoMi:BiomeAPI:0.2")
compileOnly("com.github.Xiao-MoMi:BiomeAPI:0.3")
// chat channels
compileOnly(files("libs/VentureChat-3.7.1.jar"))

View File

@@ -85,7 +85,8 @@ public class CustomNameplatesPluginImpl extends CustomNameplatesPlugin implement
Dependency.SQLITE_DRIVER,
Dependency.BSTATS_BASE,
Dependency.HIKARI,
Dependency.BSTATS_BUKKIT
Dependency.BSTATS_BUKKIT,
Dependency.BIOME_API
)
));
ReflectionUtils.load();

View File

@@ -312,7 +312,7 @@ public class NameplateManagerImpl implements NameplateManager, Listener {
plugin.getScheduler().runTaskAsyncLater(() -> {
if (player.isOnline())
this.createNameTag(player);
}, 100, TimeUnit.MILLISECONDS);
}, 50, TimeUnit.MILLISECONDS);
}
}

View File

@@ -22,12 +22,15 @@ import com.francobm.magicosmetics.api.CosmeticType;
import com.francobm.magicosmetics.cache.PlayerData;
import com.francobm.magicosmetics.cache.cosmetics.Hat;
import com.francobm.magicosmetics.events.*;
import net.momirealms.customnameplates.api.CustomNameplatesPlugin;
import net.momirealms.customnameplates.paper.mechanic.nameplate.tag.unlimited.UnlimitedPlayer;
import net.momirealms.customnameplates.paper.mechanic.nameplate.tag.unlimited.UnlimitedTagManagerImpl;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import java.util.concurrent.TimeUnit;
public class MagicCosmeticsListener implements Listener {
private final UnlimitedTagManagerImpl unlimitedTagManager;
@@ -94,10 +97,12 @@ public class MagicCosmeticsListener implements Listener {
public void onDataLoaded(PlayerDataLoadEvent event) {
for (Cosmetic cosmetic : event.getEquippedCosmetics()) {
if (cosmetic instanceof Hat hat) {
if (unlimitedTagManager.getUnlimitedObject(event.getPlayerData().getUniqueId()) instanceof UnlimitedPlayer unlimitedPlayer) {
unlimitedPlayer.setHatOffset(hat.isHideCosmetic() ? 0 : hat.getOffSetY());
unlimitedPlayer.teleport();
}
CustomNameplatesPlugin.get().getScheduler().runTaskAsyncLater(() -> {
if (unlimitedTagManager.getUnlimitedObject(event.getPlayerData().getUniqueId()) instanceof UnlimitedPlayer unlimitedPlayer) {
unlimitedPlayer.setHatOffset(hat.isHideCosmetic() ? 0 : hat.getOffSetY());
unlimitedPlayer.teleport();
}
}, 100, TimeUnit.MILLISECONDS);
}
}
}

View File

@@ -32,6 +32,7 @@ import net.momirealms.customnameplates.paper.util.ClassUtils;
import net.momirealms.customnameplates.paper.util.ConfigUtils;
import net.momirealms.customnameplates.paper.util.DisguiseUtils;
import net.momirealms.customnameplates.paper.util.GeyserUtils;
import org.bson.types.Binary;
import org.bukkit.World;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;