9
0
mirror of https://github.com/HibiscusMC/HMCCosmetics.git synced 2026-01-04 15:41:45 +00:00

Fixed reload issue with tokens

This commit is contained in:
Fisher2911
2022-03-07 00:01:47 -05:00
parent 6294a26b1d
commit 8cda481a55
5 changed files with 10 additions and 4 deletions

View File

@@ -64,4 +64,8 @@ public class CosmeticManager {
public boolean isToken(final ItemStack itemStack) {
return Keys.hasKey(itemStack, Keys.TOKEN_KEY, PersistentDataType.STRING);
}
public void clearTokens() {
this.tokenMap.clear();
}
}

View File

@@ -120,6 +120,7 @@ public class CosmeticsMenu {
public void load() {
this.guiMap.clear();
this.cosmeticManager.clearTokens();
final File file = Path.of(this.plugin.getDataFolder().getPath(),
"menus").toFile();

View File

@@ -46,7 +46,7 @@ public class ModelEngineHook implements Hook {
if (entity == null) return;
for (final Player player : entity.getPlayerInRange()) {
entity.removePlayer(player);
entity.removePlayerAsync(player);
}
entity.getEntity().remove();

View File

@@ -67,7 +67,7 @@ public class MessageHandler {
final String message = this.getPapiPlaceholders(
sender,
Placeholder.applyPlaceholders(this.getMessage(key), placeholders)
);
).replaceAll("[&§]", "");
if (message.isBlank()) return;