9
0
mirror of https://github.com/HibiscusMC/HMCCosmetics.git synced 2025-12-28 03:19:15 +00:00
This commit is contained in:
LoJoSho
2023-02-08 15:28:04 -06:00
parent 0f6fa3db8a
commit d39110af6c
11 changed files with 135 additions and 10 deletions

View File

@@ -23,6 +23,8 @@ import com.hibiscusmc.hmccosmetics.util.MessagesUtil;
import com.hibiscusmc.hmccosmetics.util.TranslationUtil;
import com.jeff_media.updatechecker.UpdateCheckSource;
import com.jeff_media.updatechecker.UpdateChecker;
import com.ticxo.playeranimator.PlayerAnimatorImpl;
import com.ticxo.playeranimator.api.PlayerAnimator;
import org.bstats.bukkit.Metrics;
import org.bukkit.Bukkit;
import org.bukkit.Location;
@@ -91,6 +93,9 @@ public final class HMCCosmeticsPlugin extends JavaPlugin {
saveResource("menus/defaultmenu.yml", false);
}
// Player Animator
PlayerAnimatorImpl.initialize(this);
setup();
// Commands
@@ -223,6 +228,17 @@ public final class HMCCosmeticsPlugin extends JavaPlugin {
}
}
File emoteFolder = new File(getInstance().getDataFolder().getPath() + "/emotes/");
if (emoteFolder.exists()) {
PlayerAnimator.api.getAnimationManager().clearRegistry();
File[] emotesFiles = emoteFolder.listFiles();
for (File emoteFile : emotesFiles) {
if (!emoteFile.getName().contains("bbmodel")) continue;
String animationName = emoteFile.getName().replaceAll("bbmodel", "");
PlayerAnimator.api.getAnimationManager().importAnimations(animationName, emoteFile);
}
}
getInstance().getLogger().info("Successfully Enabled HMCCosmetics");
getInstance().getLogger().info(Cosmetics.values().size() + " Cosmetics Successfully Setup");
getInstance().getLogger().info(Menus.getMenuNames().size() + " Menus Successfully Setup");