Updated CMI support, fixed sound issue

This commit is contained in:
Lilac 2019-08-07 19:07:39 +01:00
parent e3ac861143
commit e0f0bfa8e0
4 changed files with 14 additions and 7 deletions

View File

@ -4,7 +4,7 @@ stages:
variables:
name: "UltimateKits"
path: "/builds/$CI_PROJECT_PATH"
version: "2.3.20"
version: "2.3.21"
build:
stage: build

View File

@ -99,6 +99,9 @@ public class UltimateKits extends JavaPlugin {
this.settingsManager = new SettingsManager(this);
this.settingsManager.setupConfig();
new Locale(this, "en_US");
this.locale = Locale.getLocale(getConfig().getString("System.Language Mode"));
new Convert(this);
new ParticleHandler(this);
@ -106,9 +109,6 @@ public class UltimateKits extends JavaPlugin {
this.commandManager = new CommandManager(this);
new Locale(this, "en_US");
this.locale = Locale.getLocale(getConfig().getString("System.Language Mode"));
//Running Songoda Updater
Plugin plugin = new Plugin(this, 14);
plugin.addModule(new LocaleModule());

View File

@ -4,10 +4,13 @@ import com.Zrips.CMI.CMI;
import com.Zrips.CMI.Modules.Kits.Kit;
import com.songoda.ultimatekits.UltimateKits;
import com.songoda.ultimatekits.conversion.Hook;
import org.bukkit.Bukkit;
import com.songoda.ultimatekits.kit.type.KitContentCommand;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
@ -27,6 +30,10 @@ public class CMIHook implements Hook {
for (ItemStack item : kit.getItems()) {
if (item != null) stacks.add(item);
}
for (String command : kit.getCommands()) {
stacks.add(new KitContentCommand(command).getItemForDisplay());
}
} catch (Exception e) {
e.printStackTrace();
}

View File

@ -97,7 +97,7 @@ public class CrateAnimateTask extends BukkitRunnable {
inventory.setItem(22, new ItemStack(Material.TRIPWIRE_HOOK));
if (!done) {
player.playSound(player.getLocation(), plugin.getInstance().isServerVersionAtLeast(ServerVersion.V1_13) ? Sound.UI_BUTTON_CLICK : Sound.valueOf("CLICK"), 5f, 5f);
player.playSound(player.getLocation(), plugin.getInstance().isServerVersionAtLeast(ServerVersion.V1_9) ? Sound.UI_BUTTON_CLICK : Sound.valueOf("CLICK"), 5f, 5f);
this.items.addFirst(this.items.getLast());
this.items.removeLast();
}
@ -118,7 +118,7 @@ public class CrateAnimateTask extends BukkitRunnable {
}
}
player.playSound(player.getLocation(), UltimateKits.getInstance().isServerVersionAtLeast(ServerVersion.V1_13) ? Sound.ENTITY_PLAYER_LEVELUP : Sound.valueOf("LEVEL_UP"), 10f, 10f);
player.playSound(player.getLocation(), UltimateKits.getInstance().isServerVersionAtLeast(ServerVersion.V1_9) ? Sound.ENTITY_PLAYER_LEVELUP : Sound.valueOf("LEVEL_UP"), 10f, 10f);
plugin.getLocale().getMessage("event.create.won")
.processPlaceholder("item", WordUtils.capitalize(give.getType().name().toLowerCase().replace("_", " ")))
.sendPrefixedMessage(player);