mirror of
https://github.com/songoda/UltimateKits.git
synced 2024-09-30 06:37:32 +02:00
Updated CMI support, fixed sound issue
This commit is contained in:
parent
e3ac861143
commit
e0f0bfa8e0
@ -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
|
||||||
|
@ -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());
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user