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: variables:
name: "UltimateKits" name: "UltimateKits"
path: "/builds/$CI_PROJECT_PATH" path: "/builds/$CI_PROJECT_PATH"
version: "2.3.20" version: "2.3.21"
build: build:
stage: build stage: build

View File

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

View File

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

View File

@ -97,7 +97,7 @@ public class CrateAnimateTask extends BukkitRunnable {
inventory.setItem(22, new ItemStack(Material.TRIPWIRE_HOOK)); inventory.setItem(22, new ItemStack(Material.TRIPWIRE_HOOK));
if (!done) { 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.addFirst(this.items.getLast());
this.items.removeLast(); 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") plugin.getLocale().getMessage("event.create.won")
.processPlaceholder("item", WordUtils.capitalize(give.getType().name().toLowerCase().replace("_", " "))) .processPlaceholder("item", WordUtils.capitalize(give.getType().name().toLowerCase().replace("_", " ")))
.sendPrefixedMessage(player); .sendPrefixedMessage(player);