mirror of
https://github.com/TotalFreedomMC/PlayerParticles.git
synced 2025-02-11 19:50:25 +00:00
Lots of changes, see description
Renamed default.lang to en_US.lang Added fr_FR.lang (French, still missing some messages) Renamed groups.yml to preset_groups.yml Added some new functionality to preset groups to make it easier for server owners Fix missing message when removing a group that didn't exist Update changelog.txt
This commit is contained in:
parent
077ca13b35
commit
2c97126a78
16 changed files with 771 additions and 328 deletions
|
@ -2,12 +2,15 @@
|
||||||
* Create a backup of your config.yml if you wish to import all your old settings!
|
* Create a backup of your config.yml if you wish to import all your old settings!
|
||||||
=== v6.3 ===
|
=== v6.3 ===
|
||||||
+ Added the ability to remove particles by id/effect/style using '/pp remove <id>|<effect>|<style>'
|
+ Added the ability to remove particles by id/effect/style using '/pp remove <id>|<effect>|<style>'
|
||||||
+ Added new styles 'pulse', 'whirl', and 'whirlwind'
|
+ Added new styles 'popper', 'pulse', 'twins', 'whirl', and 'whirlwind'
|
||||||
+ The "Save New Group" button in the GUI now actually saves a new group and prompts for a name in chat (15 second timeout)
|
+ The "Save New Group" button in the GUI now actually saves a new group and prompts for a name in chat (15 second timeout)
|
||||||
+ Added a click sound to the GUI for button clicks (Can be disabled in the config.yml)
|
+ Added a click sound to the GUI for button clicks (Can be disabled in the config.yml)
|
||||||
+ Added setting 'toggle-on-move-delay' to the config.yml
|
+ Added setting 'toggle-on-move-delay' to the config.yml
|
||||||
|
+ Added new lang file fr_FR.lang (French)
|
||||||
|
* Renamed default.lang to en_US.lang
|
||||||
* Reduced the number of particles that spawn for the styles 'blockbreak', 'blockplace', and 'swords'
|
* Reduced the number of particles that spawn for the styles 'blockbreak', 'blockplace', and 'swords'
|
||||||
* Fix GUI borders showing up as glass panes instead of stained glass panes on servers running 1.12.2 or earlier
|
* Fix GUI borders showing up as glass panes instead of stained glass panes on servers running 1.12.2 or earlier
|
||||||
|
* Fix a missing message when trying to remove a group that doesn't exist
|
||||||
* Fix a console error that occured when trying to remove a group that doesn't exist
|
* Fix a console error that occured when trying to remove a group that doesn't exist
|
||||||
* Fix a console error that occured when a player logs off with the 'celebration' style applied and they have at least 1 fixed effect created
|
* Fix a console error that occured when a player logs off with the 'celebration' style applied and they have at least 1 fixed effect created
|
||||||
* Fix a console error "[PlayerParticles] An error occurred retrieving an SQLite database connection: [SQLITE_BUSY] The database file is locked (database is locked)"
|
* Fix a console error "[PlayerParticles] An error occurred retrieving an SQLite database connection: [SQLITE_BUSY] The database file is locked (database is locked)"
|
||||||
|
|
|
@ -26,11 +26,11 @@ import com.esophose.playerparticles.database.SqliteDatabaseConnector;
|
||||||
import com.esophose.playerparticles.gui.GuiHandler;
|
import com.esophose.playerparticles.gui.GuiHandler;
|
||||||
import com.esophose.playerparticles.gui.hook.PlayerChatHook;
|
import com.esophose.playerparticles.gui.hook.PlayerChatHook;
|
||||||
import com.esophose.playerparticles.manager.LangManager;
|
import com.esophose.playerparticles.manager.LangManager;
|
||||||
|
import com.esophose.playerparticles.manager.ParticleGroupPresetManager;
|
||||||
import com.esophose.playerparticles.manager.ParticleManager;
|
import com.esophose.playerparticles.manager.ParticleManager;
|
||||||
import com.esophose.playerparticles.manager.SettingManager;
|
import com.esophose.playerparticles.manager.SettingManager;
|
||||||
import com.esophose.playerparticles.manager.SettingManager.PSetting;
|
import com.esophose.playerparticles.manager.SettingManager.PSetting;
|
||||||
import com.esophose.playerparticles.particles.PPlayerMovementListener;
|
import com.esophose.playerparticles.particles.PPlayerMovementListener;
|
||||||
import com.esophose.playerparticles.particles.ParticleGroup;
|
|
||||||
import com.esophose.playerparticles.styles.DefaultStyles;
|
import com.esophose.playerparticles.styles.DefaultStyles;
|
||||||
import com.esophose.playerparticles.updater.PluginUpdateListener;
|
import com.esophose.playerparticles.updater.PluginUpdateListener;
|
||||||
import com.esophose.playerparticles.updater.Updater;
|
import com.esophose.playerparticles.updater.Updater;
|
||||||
|
@ -159,7 +159,7 @@ public class PlayerParticles extends JavaPlugin {
|
||||||
|
|
||||||
SettingManager.reload();
|
SettingManager.reload();
|
||||||
LangManager.reload(updatePluginSettings);
|
LangManager.reload(updatePluginSettings);
|
||||||
ParticleGroup.reload();
|
ParticleGroupPresetManager.reload();
|
||||||
|
|
||||||
GuiHandler.setup();
|
GuiHandler.setup();
|
||||||
PlayerChatHook.setup();
|
PlayerChatHook.setup();
|
||||||
|
|
|
@ -9,10 +9,12 @@ import org.bukkit.util.StringUtil;
|
||||||
|
|
||||||
import com.esophose.playerparticles.manager.DataManager;
|
import com.esophose.playerparticles.manager.DataManager;
|
||||||
import com.esophose.playerparticles.manager.LangManager;
|
import com.esophose.playerparticles.manager.LangManager;
|
||||||
|
import com.esophose.playerparticles.manager.ParticleGroupPresetManager;
|
||||||
import com.esophose.playerparticles.manager.LangManager.Lang;
|
import com.esophose.playerparticles.manager.LangManager.Lang;
|
||||||
import com.esophose.playerparticles.manager.PermissionManager;
|
import com.esophose.playerparticles.manager.PermissionManager;
|
||||||
import com.esophose.playerparticles.particles.PPlayer;
|
import com.esophose.playerparticles.particles.PPlayer;
|
||||||
import com.esophose.playerparticles.particles.ParticleGroup;
|
import com.esophose.playerparticles.particles.ParticleGroup;
|
||||||
|
import com.esophose.playerparticles.particles.ParticleGroupPreset;
|
||||||
import com.esophose.playerparticles.particles.ParticlePair;
|
import com.esophose.playerparticles.particles.ParticlePair;
|
||||||
|
|
||||||
public class GroupCommandModule implements CommandModule {
|
public class GroupCommandModule implements CommandModule {
|
||||||
|
@ -128,17 +130,18 @@ public class GroupCommandModule implements CommandModule {
|
||||||
ParticleGroup group = pplayer.getParticleGroupByName(groupName);
|
ParticleGroup group = pplayer.getParticleGroupByName(groupName);
|
||||||
if (group == null) {
|
if (group == null) {
|
||||||
// Didn't find a saved group, look at the presets
|
// Didn't find a saved group, look at the presets
|
||||||
group = ParticleGroup.getPresetGroup(groupName);
|
ParticleGroupPreset presetGroup = ParticleGroupPresetManager.getPresetGroup(groupName);
|
||||||
if (group == null) {
|
if (presetGroup == null) {
|
||||||
LangManager.sendMessage(pplayer, Lang.GROUP_INVALID, groupName);
|
LangManager.sendMessage(pplayer, Lang.GROUP_INVALID, groupName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!group.canPlayerUse(pplayer.getPlayer())) {
|
if (!presetGroup.canPlayerUse(pplayer.getPlayer())) {
|
||||||
LangManager.sendMessage(pplayer, Lang.GROUP_PRESET_NO_PERMISSION, groupName);
|
LangManager.sendMessage(pplayer, Lang.GROUP_PRESET_NO_PERMISSION, groupName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
group = presetGroup.getGroup();
|
||||||
isPreset = true;
|
isPreset = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,8 +176,11 @@ public class GroupCommandModule implements CommandModule {
|
||||||
ParticleGroup group = pplayer.getParticleGroupByName(groupName);
|
ParticleGroup group = pplayer.getParticleGroupByName(groupName);
|
||||||
if (group == null) {
|
if (group == null) {
|
||||||
// Didn't find a saved group, look at the presets
|
// Didn't find a saved group, look at the presets
|
||||||
group = ParticleGroup.getPresetGroup(groupName);
|
ParticleGroupPreset presetGroup = ParticleGroupPresetManager.getPresetGroup(groupName);
|
||||||
if (group != null) {
|
|
||||||
|
if (presetGroup == null) {
|
||||||
|
LangManager.sendMessage(pplayer, Lang.GROUP_INVALID, groupName);
|
||||||
|
} else {
|
||||||
LangManager.sendMessage(pplayer, Lang.GROUP_REMOVE_PRESET);
|
LangManager.sendMessage(pplayer, Lang.GROUP_REMOVE_PRESET);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -201,16 +207,18 @@ public class GroupCommandModule implements CommandModule {
|
||||||
ParticleGroup group = pplayer.getParticleGroupByName(groupName);
|
ParticleGroup group = pplayer.getParticleGroupByName(groupName);
|
||||||
if (group == null) {
|
if (group == null) {
|
||||||
// Didn't find a saved group, look at the presets
|
// Didn't find a saved group, look at the presets
|
||||||
group = ParticleGroup.getPresetGroup(groupName);
|
ParticleGroupPreset presetGroup = ParticleGroupPresetManager.getPresetGroup(groupName);
|
||||||
if (group == null) {
|
if (presetGroup == null) {
|
||||||
LangManager.sendMessage(pplayer, Lang.GROUP_INVALID, groupName);
|
LangManager.sendMessage(pplayer, Lang.GROUP_INVALID, groupName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!group.canPlayerUse(pplayer.getPlayer())) {
|
if (!presetGroup.canPlayerUse(pplayer.getPlayer())) {
|
||||||
LangManager.sendMessage(pplayer, Lang.GROUP_PRESET_NO_PERMISSION, groupName);
|
LangManager.sendMessage(pplayer, Lang.GROUP_PRESET_NO_PERMISSION, groupName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
group = presetGroup.getGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
List<ParticlePair> particles = group.getParticles();
|
List<ParticlePair> particles = group.getParticles();
|
||||||
|
@ -239,8 +247,8 @@ public class GroupCommandModule implements CommandModule {
|
||||||
groupsList = groupsList.substring(0, groupsList.length() - 2);
|
groupsList = groupsList.substring(0, groupsList.length() - 2);
|
||||||
|
|
||||||
String presetsList = "";
|
String presetsList = "";
|
||||||
for (ParticleGroup group : ParticleGroup.getPresetGroupsForPlayer(pplayer.getPlayer()))
|
for (ParticleGroupPreset group : ParticleGroupPresetManager.getPresetGroupsForPlayer(pplayer.getPlayer()))
|
||||||
presetsList += group.getName() + ", ";
|
presetsList += group.getGroup().getName() + ", ";
|
||||||
|
|
||||||
if (presetsList.endsWith(", "))
|
if (presetsList.endsWith(", "))
|
||||||
presetsList = presetsList.substring(0, presetsList.length() - 2);
|
presetsList = presetsList.substring(0, presetsList.length() - 2);
|
||||||
|
@ -275,8 +283,8 @@ public class GroupCommandModule implements CommandModule {
|
||||||
if (!group.getName().equals(ParticleGroup.DEFAULT_NAME))
|
if (!group.getName().equals(ParticleGroup.DEFAULT_NAME))
|
||||||
groupNames.add(group.getName());
|
groupNames.add(group.getName());
|
||||||
if (!args[0].equals("remove"))
|
if (!args[0].equals("remove"))
|
||||||
for (ParticleGroup group : ParticleGroup.getPresetGroupsForPlayer(pplayer.getPlayer()))
|
for (ParticleGroupPreset group : ParticleGroupPresetManager.getPresetGroupsForPlayer(pplayer.getPlayer()))
|
||||||
groupNames.add(group.getName());
|
groupNames.add(group.getGroup().getName());
|
||||||
StringUtil.copyPartialMatches(args[1], groupNames, matches);
|
StringUtil.copyPartialMatches(args[1], groupNames, matches);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import org.bukkit.Sound;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
import org.bukkit.inventory.Inventory;
|
import org.bukkit.inventory.Inventory;
|
||||||
|
import org.bukkit.inventory.InventoryHolder;
|
||||||
import org.bukkit.inventory.ItemFlag;
|
import org.bukkit.inventory.ItemFlag;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.ItemMeta;
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
|
@ -16,7 +17,7 @@ import com.esophose.playerparticles.manager.SettingManager.PSetting;
|
||||||
import com.esophose.playerparticles.particles.PPlayer;
|
import com.esophose.playerparticles.particles.PPlayer;
|
||||||
import com.esophose.playerparticles.util.ParticleUtils;
|
import com.esophose.playerparticles.util.ParticleUtils;
|
||||||
|
|
||||||
public abstract class GuiInventory {
|
public abstract class GuiInventory implements InventoryHolder {
|
||||||
|
|
||||||
protected enum BorderColor {
|
protected enum BorderColor {
|
||||||
WHITE(0, "WHITE_STAINED_GLASS_PANE"),
|
WHITE(0, "WHITE_STAINED_GLASS_PANE"),
|
||||||
|
|
|
@ -12,6 +12,7 @@ import org.bukkit.inventory.meta.SkullMeta;
|
||||||
import com.esophose.playerparticles.manager.DataManager;
|
import com.esophose.playerparticles.manager.DataManager;
|
||||||
import com.esophose.playerparticles.manager.LangManager;
|
import com.esophose.playerparticles.manager.LangManager;
|
||||||
import com.esophose.playerparticles.manager.LangManager.Lang;
|
import com.esophose.playerparticles.manager.LangManager.Lang;
|
||||||
|
import com.esophose.playerparticles.manager.ParticleGroupPresetManager;
|
||||||
import com.esophose.playerparticles.manager.PermissionManager;
|
import com.esophose.playerparticles.manager.PermissionManager;
|
||||||
import com.esophose.playerparticles.manager.SettingManager.GuiIcon;
|
import com.esophose.playerparticles.manager.SettingManager.GuiIcon;
|
||||||
import com.esophose.playerparticles.particles.PPlayer;
|
import com.esophose.playerparticles.particles.PPlayer;
|
||||||
|
@ -54,7 +55,7 @@ public class GuiInventoryDefault extends GuiInventory {
|
||||||
|
|
||||||
// Define what slots to put the icons at based on what other slots are visible
|
// Define what slots to put the icons at based on what other slots are visible
|
||||||
boolean manageGroupsVisible = PermissionManager.canPlayerSaveGroups(pplayer);
|
boolean manageGroupsVisible = PermissionManager.canPlayerSaveGroups(pplayer);
|
||||||
boolean loadPresetGroupVisible = !ParticleGroup.getPresetGroupsForPlayer(pplayer.getPlayer()).isEmpty();
|
boolean loadPresetGroupVisible = !ParticleGroupPresetManager.getPresetGroupsForPlayer(pplayer.getPlayer()).isEmpty();
|
||||||
int manageParticlesSlot = -1, manageGroupsSlot = -1, loadPresetGroupSlot = -1;
|
int manageParticlesSlot = -1, manageGroupsSlot = -1, loadPresetGroupSlot = -1;
|
||||||
|
|
||||||
if (!manageGroupsVisible && !loadPresetGroupVisible) {
|
if (!manageGroupsVisible && !loadPresetGroupVisible) {
|
||||||
|
|
|
@ -2,17 +2,17 @@ package com.esophose.playerparticles.gui;
|
||||||
|
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map.Entry;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
|
||||||
|
|
||||||
import com.esophose.playerparticles.manager.DataManager;
|
import com.esophose.playerparticles.manager.DataManager;
|
||||||
import com.esophose.playerparticles.manager.LangManager;
|
import com.esophose.playerparticles.manager.LangManager;
|
||||||
import com.esophose.playerparticles.manager.LangManager.Lang;
|
import com.esophose.playerparticles.manager.LangManager.Lang;
|
||||||
|
import com.esophose.playerparticles.manager.ParticleGroupPresetManager;
|
||||||
import com.esophose.playerparticles.manager.SettingManager.GuiIcon;
|
import com.esophose.playerparticles.manager.SettingManager.GuiIcon;
|
||||||
import com.esophose.playerparticles.particles.PPlayer;
|
import com.esophose.playerparticles.particles.PPlayer;
|
||||||
import com.esophose.playerparticles.particles.ParticleGroup;
|
import com.esophose.playerparticles.particles.ParticleGroup;
|
||||||
|
import com.esophose.playerparticles.particles.ParticleGroupPreset;
|
||||||
import com.esophose.playerparticles.particles.ParticlePair;
|
import com.esophose.playerparticles.particles.ParticlePair;
|
||||||
import com.esophose.playerparticles.util.ParticleUtils;
|
import com.esophose.playerparticles.util.ParticleUtils;
|
||||||
|
|
||||||
|
@ -26,11 +26,9 @@ public class GuiInventoryLoadPresetGroups extends GuiInventory {
|
||||||
int index = 10;
|
int index = 10;
|
||||||
int nextWrap = 17;
|
int nextWrap = 17;
|
||||||
int maxIndex = 43;
|
int maxIndex = 43;
|
||||||
List<Entry<ParticleGroup, Material>> groups = ParticleGroup.getPresetGroupsForGUIForPlayer(pplayer.getPlayer());
|
List<ParticleGroupPreset> groups = ParticleGroupPresetManager.getPresetGroupsForPlayer(pplayer.getPlayer());
|
||||||
for (Entry<ParticleGroup, Material> groupEntry : groups) {
|
for (ParticleGroupPreset group : groups) {
|
||||||
ParticleGroup group = groupEntry.getKey();
|
List<ParticlePair> particles = group.getGroup().getParticles();
|
||||||
Material iconMaterial = groupEntry.getValue();
|
|
||||||
List<ParticlePair> particles = group.getParticles();
|
|
||||||
particles.sort(Comparator.comparingInt(ParticlePair::getId));
|
particles.sort(Comparator.comparingInt(ParticlePair::getId));
|
||||||
|
|
||||||
String[] lore = new String[particles.size() + 1];
|
String[] lore = new String[particles.size() + 1];
|
||||||
|
@ -42,7 +40,7 @@ public class GuiInventoryLoadPresetGroups extends GuiInventory {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load Group Buttons
|
// Load Group Buttons
|
||||||
GuiActionButton groupButton = new GuiActionButton(index, iconMaterial, LangManager.getText(Lang.GUI_COLOR_ICON_NAME) + group.getName(), lore, (button, isShiftClick) -> {
|
GuiActionButton groupButton = new GuiActionButton(index, group.getGuiIcon(), LangManager.getText(Lang.GUI_COLOR_ICON_NAME) + group.getDisplayName(), lore, (button, isShiftClick) -> {
|
||||||
ParticleGroup activeGroup = pplayer.getActiveParticleGroup();
|
ParticleGroup activeGroup = pplayer.getActiveParticleGroup();
|
||||||
activeGroup.getParticles().clear();
|
activeGroup.getParticles().clear();
|
||||||
for (ParticlePair particle : particles)
|
for (ParticlePair particle : particles)
|
||||||
|
|
|
@ -73,15 +73,21 @@ public class GuiInventoryManageGroups extends GuiInventory {
|
||||||
if (index > maxIndex) break; // Overflowed the available space
|
if (index > maxIndex) break; // Overflowed the available space
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean canSaveGroup = !PermissionManager.hasPlayerReachedMaxGroups(pplayer);
|
boolean hasReachedMax = PermissionManager.hasPlayerReachedMaxGroups(pplayer);
|
||||||
|
boolean hasParticles = !pplayer.getActiveParticles().isEmpty();
|
||||||
String[] lore;
|
String[] lore;
|
||||||
if (canSaveGroup) {
|
if (hasReachedMax) {
|
||||||
lore = new String[] { LangManager.getText(Lang.GUI_COLOR_INFO) + LangManager.getText(Lang.GUI_SAVE_GROUP_DESCRIPTION) };
|
|
||||||
} else {
|
|
||||||
lore = new String[] {
|
lore = new String[] {
|
||||||
LangManager.getText(Lang.GUI_COLOR_INFO) + LangManager.getText(Lang.GUI_SAVE_GROUP_DESCRIPTION),
|
LangManager.getText(Lang.GUI_COLOR_INFO) + LangManager.getText(Lang.GUI_SAVE_GROUP_DESCRIPTION),
|
||||||
LangManager.getText(Lang.GUI_COLOR_UNAVAILABLE) + LangManager.getText(Lang.GUI_SAVE_GROUP_FULL)
|
LangManager.getText(Lang.GUI_COLOR_UNAVAILABLE) + LangManager.getText(Lang.GUI_SAVE_GROUP_FULL)
|
||||||
};
|
};
|
||||||
|
} else if (!hasParticles) {
|
||||||
|
lore = new String[] {
|
||||||
|
LangManager.getText(Lang.GUI_COLOR_INFO) + LangManager.getText(Lang.GUI_SAVE_GROUP_DESCRIPTION),
|
||||||
|
LangManager.getText(Lang.GUI_COLOR_UNAVAILABLE) + LangManager.getText(Lang.GUI_SAVE_GROUP_NO_PARTICLES)
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
lore = new String[] { LangManager.getText(Lang.GUI_COLOR_INFO) + LangManager.getText(Lang.GUI_SAVE_GROUP_DESCRIPTION) };
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save Group Button
|
// Save Group Button
|
||||||
|
@ -90,7 +96,7 @@ public class GuiInventoryManageGroups extends GuiInventory {
|
||||||
LangManager.getText(Lang.GUI_COLOR_ICON_NAME) + LangManager.getText(Lang.GUI_SAVE_GROUP),
|
LangManager.getText(Lang.GUI_COLOR_ICON_NAME) + LangManager.getText(Lang.GUI_SAVE_GROUP),
|
||||||
lore,
|
lore,
|
||||||
(button, isShiftClick) -> {
|
(button, isShiftClick) -> {
|
||||||
if (!canSaveGroup) return;
|
if (hasReachedMax || !hasParticles) return;
|
||||||
|
|
||||||
PlayerChatHook.addHook(new PlayerChatHookData(pplayer.getUniqueId(), 15, (textEntered) -> {
|
PlayerChatHook.addHook(new PlayerChatHookData(pplayer.getUniqueId(), 15, (textEntered) -> {
|
||||||
if (textEntered == null || textEntered.equalsIgnoreCase("cancel")) {
|
if (textEntered == null || textEntered.equalsIgnoreCase("cancel")) {
|
||||||
|
|
|
@ -6,6 +6,8 @@ import java.io.InputStream;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.text.MessageFormat;
|
import java.text.MessageFormat;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
@ -254,6 +256,7 @@ public class LangManager {
|
||||||
GUI_SAVE_GROUP,
|
GUI_SAVE_GROUP,
|
||||||
GUI_SAVE_GROUP_DESCRIPTION,
|
GUI_SAVE_GROUP_DESCRIPTION,
|
||||||
GUI_SAVE_GROUP_FULL,
|
GUI_SAVE_GROUP_FULL,
|
||||||
|
GUI_SAVE_GROUP_NO_PARTICLES,
|
||||||
GUI_SAVE_GROUP_HOTBAR_MESSAGE,
|
GUI_SAVE_GROUP_HOTBAR_MESSAGE,
|
||||||
GUI_RESET_PARTICLES,
|
GUI_RESET_PARTICLES,
|
||||||
GUI_RESET_PARTICLES_DESCRIPTION,
|
GUI_RESET_PARTICLES_DESCRIPTION,
|
||||||
|
@ -350,7 +353,7 @@ public class LangManager {
|
||||||
* This should only get called once by the PlayerParticles class, however
|
* This should only get called once by the PlayerParticles class, however
|
||||||
* calling it multiple times wont affect anything negatively
|
* calling it multiple times wont affect anything negatively
|
||||||
*
|
*
|
||||||
* @param resetLangFile If the default.lang file should be updated to the latest version
|
* @param resetLangFile If the default lang files should be updated to the latest version
|
||||||
*/
|
*/
|
||||||
public static void reload(boolean resetLangFile) {
|
public static void reload(boolean resetLangFile) {
|
||||||
YamlConfiguration lang = configureLangFile(resetLangFile);
|
YamlConfiguration lang = configureLangFile(resetLangFile);
|
||||||
|
@ -360,43 +363,70 @@ public class LangManager {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads the target .lang file as defined in the config and grabs its YamlConfiguration
|
* Loads the target .lang file as defined in the config and grabs its YamlConfiguration
|
||||||
* If it doesn't exist, default to default.lang
|
* If it doesn't exist, default to en_US.lang
|
||||||
* If default.lang doesn't exist, copy the file from this .jar to the target directory
|
* If the default lang files don't exist, copy the files from this .jar to the target directory
|
||||||
*
|
*
|
||||||
* @param resetLangFile If the default.lang file should be updated to the latest version
|
* @param resetLangFiles If the default lang files should be updated to the latest version
|
||||||
* @return The YamlConfiguration of the target .lang file
|
* @return The YamlConfiguration of the target .lang file
|
||||||
*/
|
*/
|
||||||
private static YamlConfiguration configureLangFile(boolean resetLangFile) {
|
private static YamlConfiguration configureLangFile(boolean resetLangFiles) {
|
||||||
File pluginDataFolder = PlayerParticles.getPlugin().getDataFolder();
|
File pluginDataFolder = PlayerParticles.getPlugin().getDataFolder();
|
||||||
langFileName = PSetting.LANG_FILE.getString();
|
langFileName = PSetting.LANG_FILE.getString();
|
||||||
File targetLangFile = new File(pluginDataFolder.getAbsolutePath() + "/lang/" + langFileName);
|
File targetLangFile = new File(pluginDataFolder.getAbsolutePath() + "/lang/" + langFileName);
|
||||||
|
|
||||||
if (resetLangFile) {
|
Set<String> defaultLangFileNames = new HashSet<String>();
|
||||||
File defaultLangFile = new File(pluginDataFolder.getAbsolutePath() + "/lang/default.lang");
|
defaultLangFileNames.add("en_US.lang");
|
||||||
if (defaultLangFile.exists()) {
|
defaultLangFileNames.add("fr_FR.lang");
|
||||||
defaultLangFile.delete();
|
|
||||||
PlayerParticles.getPlugin().getLogger().warning("default.lang has been reset!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!targetLangFile.exists()) { // Target .lang file didn't exist, default to default.lang
|
|
||||||
if (!langFileName.equals("default.lang")) {
|
|
||||||
PlayerParticles.getPlugin().getLogger().warning("Couldn't find lang file '" + langFileName + "', defaulting to default.lang");
|
|
||||||
}
|
|
||||||
langFileName = "default.lang";
|
|
||||||
|
|
||||||
targetLangFile = new File(pluginDataFolder.getAbsolutePath() + "/lang/" + langFileName);
|
|
||||||
if (!targetLangFile.exists()) { // default.lang didn't exist, create it
|
|
||||||
try (InputStream stream = PlayerParticles.getPlugin().getResource("lang/default.lang")) {
|
|
||||||
targetLangFile.getParentFile().mkdir(); // Make sure the directory always exists
|
targetLangFile.getParentFile().mkdir(); // Make sure the directory always exists
|
||||||
Files.copy(stream, Paths.get(targetLangFile.getAbsolutePath()));
|
|
||||||
return YamlConfiguration.loadConfiguration(targetLangFile);
|
if (resetLangFiles) {
|
||||||
|
for (String fileName : defaultLangFileNames) {
|
||||||
|
File file = new File(pluginDataFolder.getAbsolutePath() + "/lang/" + fileName);
|
||||||
|
|
||||||
|
// Delete the file if it already exists
|
||||||
|
if (file.exists()) {
|
||||||
|
file.delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Generate the new file
|
||||||
|
try (InputStream stream = PlayerParticles.getPlugin().getResource("lang/" + fileName)) {
|
||||||
|
Files.copy(stream, Paths.get(file.getAbsolutePath()));
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
PlayerParticles.getPlugin().getLogger().severe("Unable to write default.lang to disk! You and your players will be seeing lots of error messages!");
|
PlayerParticles.getPlugin().getLogger().severe("Unable to write " + fileName + " to disk! This wasn't supposed to happen!");
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PlayerParticles.getPlugin().getLogger().warning("The default lang files have been reset!");
|
||||||
|
} else {
|
||||||
|
// Make sure the default lang files still exist, if not, create them
|
||||||
|
boolean foundMissingFile = false;
|
||||||
|
for (String fileName : defaultLangFileNames) {
|
||||||
|
File file = new File(pluginDataFolder.getAbsolutePath() + "/lang/" + fileName);
|
||||||
|
|
||||||
|
// Generate the new file if it doesn't exist
|
||||||
|
if (!file.exists()) {
|
||||||
|
foundMissingFile = true;
|
||||||
|
try (InputStream stream = PlayerParticles.getPlugin().getResource("lang/" + fileName)) {
|
||||||
|
Files.copy(stream, Paths.get(file.getAbsolutePath()));
|
||||||
|
} catch (IOException ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
PlayerParticles.getPlugin().getLogger().severe("Unable to write " + fileName + " to disk! This wasn't supposed to happen!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (foundMissingFile)
|
||||||
|
PlayerParticles.getPlugin().getLogger().warning("One or more default lang files were missing, recreated them!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!targetLangFile.exists()) { // Target .lang file didn't exist, default to en_US.lang
|
||||||
|
if (!langFileName.equals("en_US.lang")) {
|
||||||
|
PlayerParticles.getPlugin().getLogger().warning("Couldn't find lang file '" + langFileName + "', defaulting to en_US.lang");
|
||||||
|
}
|
||||||
|
langFileName = "en_US.lang";
|
||||||
|
targetLangFile = new File(pluginDataFolder.getAbsolutePath() + "/lang/" + langFileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
return YamlConfiguration.loadConfiguration(targetLangFile);
|
return YamlConfiguration.loadConfiguration(targetLangFile);
|
||||||
|
|
|
@ -0,0 +1,217 @@
|
||||||
|
package com.esophose.playerparticles.manager;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import com.esophose.playerparticles.PlayerParticles;
|
||||||
|
import com.esophose.playerparticles.particles.ParticleEffect;
|
||||||
|
import com.esophose.playerparticles.particles.ParticleGroup;
|
||||||
|
import com.esophose.playerparticles.particles.ParticleGroupPreset;
|
||||||
|
import com.esophose.playerparticles.particles.ParticlePair;
|
||||||
|
import com.esophose.playerparticles.particles.ParticleEffect.NoteColor;
|
||||||
|
import com.esophose.playerparticles.particles.ParticleEffect.OrdinaryColor;
|
||||||
|
import com.esophose.playerparticles.particles.ParticleEffect.ParticleProperty;
|
||||||
|
import com.esophose.playerparticles.styles.api.ParticleStyle;
|
||||||
|
import com.esophose.playerparticles.util.ParticleUtils;
|
||||||
|
|
||||||
|
public class ParticleGroupPresetManager {
|
||||||
|
|
||||||
|
private static final String FILE_NAME = "preset_groups.yml";
|
||||||
|
|
||||||
|
private static List<ParticleGroupPreset> presetGroups;
|
||||||
|
|
||||||
|
/** Not instantiable */
|
||||||
|
private ParticleGroupPresetManager() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loads the preset groups from the preset_groups.yml file
|
||||||
|
*/
|
||||||
|
public static void reload() {
|
||||||
|
presetGroups = new ArrayList<ParticleGroupPreset>();
|
||||||
|
|
||||||
|
File pluginDataFolder = PlayerParticles.getPlugin().getDataFolder();
|
||||||
|
File groupsFile = new File(pluginDataFolder.getAbsolutePath() + File.separator + FILE_NAME);
|
||||||
|
|
||||||
|
// Create the file if it doesn't exist
|
||||||
|
if (!groupsFile.exists()) {
|
||||||
|
try (InputStream inStream = PlayerParticles.getPlugin().getResource(FILE_NAME)) {
|
||||||
|
Files.copy(inStream, Paths.get(groupsFile.getAbsolutePath()));
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Parse groups.yml file
|
||||||
|
YamlConfiguration groupsYaml = YamlConfiguration.loadConfiguration(groupsFile);
|
||||||
|
Set<String> groupNames = groupsYaml.getKeys(false);
|
||||||
|
for (String groupName : groupNames) {
|
||||||
|
try {
|
||||||
|
List<ParticlePair> particles = new ArrayList<ParticlePair>();
|
||||||
|
String displayName = "";
|
||||||
|
Material guiIcon = Material.ENDER_CHEST;
|
||||||
|
String permission = "";
|
||||||
|
boolean allowPermissionOverride = false;
|
||||||
|
ConfigurationSection groupSection = groupsYaml.getConfigurationSection(groupName);
|
||||||
|
|
||||||
|
Set<String> particleKeys = groupSection.getKeys(false);
|
||||||
|
for (String stringId : particleKeys) {
|
||||||
|
if (stringId.equalsIgnoreCase("display-name")) {
|
||||||
|
displayName = groupSection.getString(stringId);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (stringId.equalsIgnoreCase("gui-icon")) {
|
||||||
|
guiIcon = Material.valueOf(groupSection.getString(stringId));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (stringId.equalsIgnoreCase("permission")) {
|
||||||
|
permission = groupSection.getString(stringId);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (stringId.equalsIgnoreCase("allow-permission-override")) {
|
||||||
|
allowPermissionOverride = groupSection.getBoolean(stringId);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
ConfigurationSection particleSection = groupSection.getConfigurationSection(stringId);
|
||||||
|
|
||||||
|
int id = Integer.parseInt(stringId);
|
||||||
|
ParticleEffect effect = ParticleEffect.fromName(particleSection.getString("effect"));
|
||||||
|
ParticleStyle style = ParticleStyle.fromName(particleSection.getString("style"));
|
||||||
|
|
||||||
|
if (effect == null) {
|
||||||
|
PlayerParticles.getPlugin().getLogger().severe("Invalid effect name: '" + particleSection.getString("effect") + "'!");
|
||||||
|
throw new Exception();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (style == null) {
|
||||||
|
PlayerParticles.getPlugin().getLogger().severe("Invalid style name: '" + particleSection.getString("style") + "'!");
|
||||||
|
throw new Exception();
|
||||||
|
}
|
||||||
|
|
||||||
|
Material itemData = null;
|
||||||
|
Material blockData = null;
|
||||||
|
OrdinaryColor colorData = null;
|
||||||
|
NoteColor noteColorData = null;
|
||||||
|
|
||||||
|
String dataString = particleSection.getString("data");
|
||||||
|
if (!dataString.isEmpty()) {
|
||||||
|
String[] args = dataString.split(" ");
|
||||||
|
|
||||||
|
if (effect.hasProperty(ParticleProperty.COLORABLE)) {
|
||||||
|
if (effect == ParticleEffect.NOTE) {
|
||||||
|
if (args[0].equalsIgnoreCase("rainbow")) {
|
||||||
|
noteColorData = new NoteColor(99);
|
||||||
|
} else {
|
||||||
|
int note = -1;
|
||||||
|
try {
|
||||||
|
note = Integer.parseInt(args[0]);
|
||||||
|
} catch (Exception e) {
|
||||||
|
PlayerParticles.getPlugin().getLogger().severe("Invalid note: '" + args[0] + "'!");
|
||||||
|
throw new Exception();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (note < 0 || note > 23) {
|
||||||
|
PlayerParticles.getPlugin().getLogger().severe("Invalid note: '" + args[0] + "'!");
|
||||||
|
throw new Exception();
|
||||||
|
}
|
||||||
|
|
||||||
|
noteColorData = new NoteColor(note);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (args[0].equalsIgnoreCase("rainbow")) {
|
||||||
|
colorData = new OrdinaryColor(999, 999, 999);
|
||||||
|
} else {
|
||||||
|
int r = -1;
|
||||||
|
int g = -1;
|
||||||
|
int b = -1;
|
||||||
|
|
||||||
|
try {
|
||||||
|
r = Integer.parseInt(args[0]);
|
||||||
|
g = Integer.parseInt(args[1]);
|
||||||
|
b = Integer.parseInt(args[2]);
|
||||||
|
} catch (Exception e) {
|
||||||
|
PlayerParticles.getPlugin().getLogger().severe("Invalid color: '" + args[0] + " " + args[1] + " " + args[2] + "'!");
|
||||||
|
throw new Exception();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (r < 0 || r > 255 || g < 0 || g > 255 || b < 0 || b > 255) {
|
||||||
|
PlayerParticles.getPlugin().getLogger().severe("Invalid color: '" + args[0] + " " + args[1] + " " + args[2] + "'!");
|
||||||
|
throw new Exception();
|
||||||
|
}
|
||||||
|
|
||||||
|
colorData = new OrdinaryColor(r, g, b);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (effect.hasProperty(ParticleProperty.REQUIRES_MATERIAL_DATA)) {
|
||||||
|
if (effect == ParticleEffect.BLOCK || effect == ParticleEffect.FALLING_DUST) {
|
||||||
|
try {
|
||||||
|
blockData = ParticleUtils.closestMatch(args[0]);
|
||||||
|
if (blockData == null || !blockData.isBlock()) throw new Exception();
|
||||||
|
} catch (Exception e) {
|
||||||
|
PlayerParticles.getPlugin().getLogger().severe("Invalid block: '" + args[0] + "'!");
|
||||||
|
throw new Exception();
|
||||||
|
}
|
||||||
|
} else if (effect == ParticleEffect.ITEM) {
|
||||||
|
try {
|
||||||
|
itemData = ParticleUtils.closestMatch(args[0]);
|
||||||
|
if (itemData == null || itemData.isBlock()) throw new Exception();
|
||||||
|
} catch (Exception e) {
|
||||||
|
PlayerParticles.getPlugin().getLogger().severe("Invalid item: '" + args[0] + "'!");
|
||||||
|
throw new Exception();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
particles.add(new ParticlePair(null, id, effect, style, blockData, blockData, colorData, noteColorData));
|
||||||
|
}
|
||||||
|
|
||||||
|
presetGroups.add(new ParticleGroupPreset(displayName, guiIcon, permission, allowPermissionOverride, new ParticleGroup(groupName, particles)));
|
||||||
|
} catch (Exception ex) {
|
||||||
|
PlayerParticles.getPlugin().getLogger().severe("An error occurred while parsing the groups.yml file!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets all the preset ParticleGroups that a player can use
|
||||||
|
*
|
||||||
|
* @param player The player
|
||||||
|
* @return a List of preset ParticleGroups the player can use
|
||||||
|
*/
|
||||||
|
public static List<ParticleGroupPreset> getPresetGroupsForPlayer(Player player) {
|
||||||
|
return presetGroups.stream().filter(x -> x.canPlayerUse(player)).sorted(Comparator.comparing(ParticleGroupPreset::getDisplayName)).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a preset ParticleGroup by its name
|
||||||
|
*
|
||||||
|
* @param groupName The ParticleGroup name
|
||||||
|
* @return The preset ParticleGroup if it exists, otherwise null
|
||||||
|
*/
|
||||||
|
public static ParticleGroupPreset getPresetGroup(String groupName) {
|
||||||
|
for (ParticleGroupPreset group : presetGroups)
|
||||||
|
if (group.getGroup().getName().equalsIgnoreCase(groupName))
|
||||||
|
return group;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,36 +1,11 @@
|
||||||
package com.esophose.playerparticles.particles;
|
package com.esophose.playerparticles.particles;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.nio.file.Files;
|
|
||||||
import java.nio.file.Paths;
|
|
||||||
import java.util.AbstractMap;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map.Entry;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
import com.esophose.playerparticles.PlayerParticles;
|
|
||||||
import com.esophose.playerparticles.manager.PermissionManager;
|
|
||||||
import com.esophose.playerparticles.particles.ParticleEffect.NoteColor;
|
|
||||||
import com.esophose.playerparticles.particles.ParticleEffect.OrdinaryColor;
|
|
||||||
import com.esophose.playerparticles.particles.ParticleEffect.ParticleProperty;
|
|
||||||
import com.esophose.playerparticles.styles.api.ParticleStyle;
|
|
||||||
import com.esophose.playerparticles.util.ParticleUtils;
|
|
||||||
|
|
||||||
public class ParticleGroup {
|
public class ParticleGroup {
|
||||||
|
|
||||||
public static final String DEFAULT_NAME = "active";
|
public static final String DEFAULT_NAME = "active";
|
||||||
private static HashMap<ParticleGroup, Material> presetGroups;
|
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
private List<ParticlePair> particles;
|
private List<ParticlePair> particles;
|
||||||
|
@ -59,21 +34,6 @@ public class ParticleGroup {
|
||||||
return this.particles;
|
return this.particles;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if a Player can use this ParticleGroup
|
|
||||||
*
|
|
||||||
* @param player The Player
|
|
||||||
* @return True if the Player can use this ParticleGroup
|
|
||||||
*/
|
|
||||||
public boolean canPlayerUse(Player player) {
|
|
||||||
if (PermissionManager.getMaxParticlesAllowed(player) < this.particles.size()) return false;
|
|
||||||
for (ParticlePair particle : this.particles) {
|
|
||||||
if (!PermissionManager.hasEffectPermission(player, particle.getEffect())) return false;
|
|
||||||
if (!PermissionManager.hasStylePermission(player, particle.getStyle())) return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets an empty ParticleGroup
|
* Gets an empty ParticleGroup
|
||||||
*
|
*
|
||||||
|
@ -83,185 +43,4 @@ public class ParticleGroup {
|
||||||
return new ParticleGroup(DEFAULT_NAME, new ArrayList<ParticlePair>());
|
return new ParticleGroup(DEFAULT_NAME, new ArrayList<ParticlePair>());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Loads the preset groups from the groups.yml file
|
|
||||||
*/
|
|
||||||
public static void reload() {
|
|
||||||
presetGroups = new HashMap<ParticleGroup, Material>();
|
|
||||||
|
|
||||||
File pluginDataFolder = PlayerParticles.getPlugin().getDataFolder();
|
|
||||||
File groupsFile = new File(pluginDataFolder.getAbsolutePath() + File.separator + "groups.yml");
|
|
||||||
|
|
||||||
// Create the file if it doesn't exist
|
|
||||||
if (!groupsFile.exists()) {
|
|
||||||
try (InputStream inStream = PlayerParticles.getPlugin().getResource("groups.yml")) {
|
|
||||||
Files.copy(inStream, Paths.get(groupsFile.getAbsolutePath()));
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Parse groups.yml file
|
|
||||||
YamlConfiguration groupsYaml = YamlConfiguration.loadConfiguration(groupsFile);
|
|
||||||
Set<String> groupNames = groupsYaml.getKeys(false);
|
|
||||||
for (String groupName : groupNames) {
|
|
||||||
try {
|
|
||||||
List<ParticlePair> particles = new ArrayList<ParticlePair>();
|
|
||||||
Material iconMaterial = null;
|
|
||||||
ConfigurationSection groupSection = groupsYaml.getConfigurationSection(groupName);
|
|
||||||
|
|
||||||
Set<String> particleKeys = groupSection.getKeys(false);
|
|
||||||
for (String stringId : particleKeys) {
|
|
||||||
if (stringId.equalsIgnoreCase("icon")) {
|
|
||||||
iconMaterial = Material.valueOf(groupSection.getString("icon"));
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
ConfigurationSection particleSection = groupSection.getConfigurationSection(stringId);
|
|
||||||
|
|
||||||
int id = Integer.parseInt(stringId);
|
|
||||||
ParticleEffect effect = ParticleEffect.fromName(particleSection.getString("effect"));
|
|
||||||
ParticleStyle style = ParticleStyle.fromName(particleSection.getString("style"));
|
|
||||||
|
|
||||||
if (effect == null) {
|
|
||||||
PlayerParticles.getPlugin().getLogger().severe("Invalid effect name: '" + particleSection.getString("effect") + "'!");
|
|
||||||
throw new Exception();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (style == null) {
|
|
||||||
PlayerParticles.getPlugin().getLogger().severe("Invalid style name: '" + particleSection.getString("style") + "'!");
|
|
||||||
throw new Exception();
|
|
||||||
}
|
|
||||||
|
|
||||||
Material itemData = null;
|
|
||||||
Material blockData = null;
|
|
||||||
OrdinaryColor colorData = null;
|
|
||||||
NoteColor noteColorData = null;
|
|
||||||
|
|
||||||
String dataString = particleSection.getString("data");
|
|
||||||
if (!dataString.isEmpty()) {
|
|
||||||
String[] args = dataString.split(" ");
|
|
||||||
|
|
||||||
if (effect.hasProperty(ParticleProperty.COLORABLE)) {
|
|
||||||
if (effect == ParticleEffect.NOTE) {
|
|
||||||
if (args[0].equalsIgnoreCase("rainbow")) {
|
|
||||||
noteColorData = new NoteColor(99);
|
|
||||||
} else {
|
|
||||||
int note = -1;
|
|
||||||
try {
|
|
||||||
note = Integer.parseInt(args[0]);
|
|
||||||
} catch (Exception e) {
|
|
||||||
PlayerParticles.getPlugin().getLogger().severe("Invalid note: '" + args[0] + "'!");
|
|
||||||
throw new Exception();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (note < 0 || note > 23) {
|
|
||||||
PlayerParticles.getPlugin().getLogger().severe("Invalid note: '" + args[0] + "'!");
|
|
||||||
throw new Exception();
|
|
||||||
}
|
|
||||||
|
|
||||||
noteColorData = new NoteColor(note);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (args[0].equalsIgnoreCase("rainbow")) {
|
|
||||||
colorData = new OrdinaryColor(999, 999, 999);
|
|
||||||
} else {
|
|
||||||
int r = -1;
|
|
||||||
int g = -1;
|
|
||||||
int b = -1;
|
|
||||||
|
|
||||||
try {
|
|
||||||
r = Integer.parseInt(args[0]);
|
|
||||||
g = Integer.parseInt(args[1]);
|
|
||||||
b = Integer.parseInt(args[2]);
|
|
||||||
} catch (Exception e) {
|
|
||||||
PlayerParticles.getPlugin().getLogger().severe("Invalid color: '" + args[0] + " " + args[1] + " " + args[2] + "'!");
|
|
||||||
throw new Exception();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (r < 0 || r > 255 || g < 0 || g > 255 || b < 0 || b > 255) {
|
|
||||||
PlayerParticles.getPlugin().getLogger().severe("Invalid color: '" + args[0] + " " + args[1] + " " + args[2] + "'!");
|
|
||||||
throw new Exception();
|
|
||||||
}
|
|
||||||
|
|
||||||
colorData = new OrdinaryColor(r, g, b);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (effect.hasProperty(ParticleProperty.REQUIRES_MATERIAL_DATA)) {
|
|
||||||
if (effect == ParticleEffect.BLOCK || effect == ParticleEffect.FALLING_DUST) {
|
|
||||||
try {
|
|
||||||
blockData = ParticleUtils.closestMatch(args[0]);
|
|
||||||
if (blockData == null || !blockData.isBlock()) throw new Exception();
|
|
||||||
} catch (Exception e) {
|
|
||||||
PlayerParticles.getPlugin().getLogger().severe("Invalid block: '" + args[0] + "'!");
|
|
||||||
throw new Exception();
|
|
||||||
}
|
|
||||||
} else if (effect == ParticleEffect.ITEM) {
|
|
||||||
try {
|
|
||||||
itemData = ParticleUtils.closestMatch(args[0]);
|
|
||||||
if (itemData == null || itemData.isBlock()) throw new Exception();
|
|
||||||
} catch (Exception e) {
|
|
||||||
PlayerParticles.getPlugin().getLogger().severe("Invalid item: '" + args[0] + "'!");
|
|
||||||
throw new Exception();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
particles.add(new ParticlePair(null, id, effect, style, blockData, blockData, colorData, noteColorData));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (iconMaterial == null) {
|
|
||||||
PlayerParticles.getPlugin().getLogger().severe("Missing icon for group '" + groupName + "'! Defaulting to ENDER_CHEST");
|
|
||||||
iconMaterial = Material.ENDER_CHEST;
|
|
||||||
}
|
|
||||||
|
|
||||||
presetGroups.put(new ParticleGroup(groupName, particles), iconMaterial);
|
|
||||||
} catch (Exception ex) {
|
|
||||||
PlayerParticles.getPlugin().getLogger().severe("An error occurred while parsing the groups.yml file!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets all the preset ParticleGroups ordered for display in the GUI
|
|
||||||
*
|
|
||||||
* @param player The player
|
|
||||||
* @return a List of preset ParticleGroups the player can use
|
|
||||||
*/
|
|
||||||
public static List<Entry<ParticleGroup, Material>> getPresetGroupsForGUIForPlayer(Player player) {
|
|
||||||
List<Entry<ParticleGroup, Material>> groups = new ArrayList<Entry<ParticleGroup, Material>>();
|
|
||||||
List<ParticleGroup> orderedGroups = new ArrayList<ParticleGroup>();
|
|
||||||
orderedGroups.addAll(presetGroups.keySet());
|
|
||||||
orderedGroups.sort(Comparator.comparing(ParticleGroup::getName));
|
|
||||||
|
|
||||||
for (ParticleGroup group : orderedGroups)
|
|
||||||
if (group.canPlayerUse(player))
|
|
||||||
groups.add(new AbstractMap.SimpleEntry<ParticleGroup, Material>(group, presetGroups.get(group)));
|
|
||||||
return groups;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets all the preset ParticleGroups that a player can use
|
|
||||||
*
|
|
||||||
* @param player The player
|
|
||||||
* @return a List of preset ParticleGroups the player can use
|
|
||||||
*/
|
|
||||||
public static List<ParticleGroup> getPresetGroupsForPlayer(Player player) {
|
|
||||||
return presetGroups.keySet().stream().filter(x -> x.canPlayerUse(player)).collect(Collectors.toList());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets a preset ParticleGroup by its name
|
|
||||||
*
|
|
||||||
* @param groupName The ParticleGroup name
|
|
||||||
* @return The preset ParticleGroup if it exists, otherwise null
|
|
||||||
*/
|
|
||||||
public static ParticleGroup getPresetGroup(String groupName) {
|
|
||||||
for (ParticleGroup group : presetGroups.keySet())
|
|
||||||
if (group.getName().equalsIgnoreCase(groupName))
|
|
||||||
return group;
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,83 @@
|
||||||
|
package com.esophose.playerparticles.particles;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import com.esophose.playerparticles.manager.PermissionManager;
|
||||||
|
|
||||||
|
public class ParticleGroupPreset {
|
||||||
|
|
||||||
|
private String displayName;
|
||||||
|
private Material guiIcon;
|
||||||
|
private String permission;
|
||||||
|
private boolean allowPermissionOverride;
|
||||||
|
private ParticleGroup group;
|
||||||
|
|
||||||
|
public ParticleGroupPreset(String displayName, Material guiIcon, String permission, boolean allowPermissionOverride, ParticleGroup group) {
|
||||||
|
this.displayName = displayName;
|
||||||
|
this.guiIcon = guiIcon;
|
||||||
|
this.permission = permission;
|
||||||
|
this.allowPermissionOverride = allowPermissionOverride;
|
||||||
|
this.group = group;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the display name for this preset group for the GUI
|
||||||
|
*
|
||||||
|
* @return The display name of the preset group
|
||||||
|
*/
|
||||||
|
public String getDisplayName() {
|
||||||
|
return this.displayName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the GUI icon for this particle group
|
||||||
|
*
|
||||||
|
* @return The GUI icon for this particle group
|
||||||
|
*/
|
||||||
|
public Material getGuiIcon() {
|
||||||
|
return this.guiIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if a player has permission to use this particle group
|
||||||
|
*
|
||||||
|
* @param player The player to check
|
||||||
|
* @return True if the player has permission
|
||||||
|
*/
|
||||||
|
public boolean canPlayerUse(Player player) {
|
||||||
|
// If this particle group has a permission, does the player have it?
|
||||||
|
if (!this.permission.isEmpty())
|
||||||
|
if (!player.hasPermission(this.permission))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// If allowPermissionOverride is true, always let the player apply this group
|
||||||
|
if (this.allowPermissionOverride)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
// Make sure the player has permission for the number of particles in this group
|
||||||
|
if (PermissionManager.getMaxParticlesAllowed(player) < this.group.getParticles().size())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Make sure the player has permission for all effects/styles in the group
|
||||||
|
for (ParticlePair particle : this.group.getParticles()) {
|
||||||
|
if (!PermissionManager.hasEffectPermission(player, particle.getEffect()))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!PermissionManager.hasStylePermission(player, particle.getStyle()))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the underlying ParticleGroup
|
||||||
|
*
|
||||||
|
* @return The underlying ParticleGroup
|
||||||
|
*/
|
||||||
|
public ParticleGroup getGroup() {
|
||||||
|
return this.group;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -20,8 +20,8 @@ version: 6.3
|
||||||
check-updates: true
|
check-updates: true
|
||||||
|
|
||||||
# The .lang file to use in the ./lang/ folder
|
# The .lang file to use in the ./lang/ folder
|
||||||
# Default: 'default.lang'
|
# Default: 'en_US.lang'
|
||||||
lang-file: 'default.lang'
|
lang-file: 'en_US.lang'
|
||||||
|
|
||||||
# If you're using other plugins to execute commands you may wish to turn off messages
|
# If you're using other plugins to execute commands you may wish to turn off messages
|
||||||
# Default: true
|
# Default: true
|
||||||
|
|
|
@ -1,47 +0,0 @@
|
||||||
# ==================================================== #
|
|
||||||
# PRESET GROUPS #
|
|
||||||
# Information: #
|
|
||||||
# * The groups listed within this file will be #
|
|
||||||
# available to all players who have access to the #
|
|
||||||
# effect and style! #
|
|
||||||
# * The GUI is capable of displaying up to 28 groups. #
|
|
||||||
# * Feel free to create your own, they will be #
|
|
||||||
# available for users to select within the GUI! #
|
|
||||||
# * This file is not automatically updated. If you #
|
|
||||||
# want to reset the file to its defaults, simply #
|
|
||||||
# delete it and run the command '/pp reload'. #
|
|
||||||
# ==================================================== #
|
|
||||||
|
|
||||||
# Icons MUST use the names found at the link below:
|
|
||||||
# https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html
|
|
||||||
|
|
||||||
raincloud:
|
|
||||||
icon: 'ENDER_CHEST'
|
|
||||||
1:
|
|
||||||
effect: 'cloud'
|
|
||||||
style: 'overhead'
|
|
||||||
data: ''
|
|
||||||
2:
|
|
||||||
effect: 'rain'
|
|
||||||
style: 'overhead'
|
|
||||||
data: ''
|
|
||||||
rainbows:
|
|
||||||
icon: 'ENDER_CHEST'
|
|
||||||
1:
|
|
||||||
effect: 'dust'
|
|
||||||
style: 'orbit'
|
|
||||||
data: 'rainbow'
|
|
||||||
2:
|
|
||||||
effect: 'entity_effect'
|
|
||||||
style: 'feet'
|
|
||||||
data: 'rainbow'
|
|
||||||
angel:
|
|
||||||
icon: 'ENDER_CHEST'
|
|
||||||
1:
|
|
||||||
effect: 'dust'
|
|
||||||
style: 'wings'
|
|
||||||
data: '255 255 255'
|
|
||||||
2:
|
|
||||||
effect: 'dust'
|
|
||||||
style: 'halo'
|
|
||||||
data: '255 255 0'
|
|
|
@ -1,5 +1,5 @@
|
||||||
# ================================================================ #
|
# ================================================================ #
|
||||||
# default.lang (English) MESSAGE CONFIGURATION #
|
# en_US.lang MESSAGE CONFIGURATION #
|
||||||
# Important Notes: #
|
# Important Notes: #
|
||||||
# * You can use the & symbol to color the messages #
|
# * You can use the & symbol to color the messages #
|
||||||
# * {#} Will be replaced with whatever that message requires #
|
# * {#} Will be replaced with whatever that message requires #
|
||||||
|
@ -241,6 +241,7 @@ gui-load-a-preset-group-description: 'Load a premade particle group'
|
||||||
gui-save-group: 'Save New Group'
|
gui-save-group: 'Save New Group'
|
||||||
gui-save-group-description: 'Click to save a new group. You will be prompted\nto enter the new group name in chat.'
|
gui-save-group-description: 'Click to save a new group. You will be prompted\nto enter the new group name in chat.'
|
||||||
gui-save-group-full: 'You have reached the max number of groups'
|
gui-save-group-full: 'You have reached the max number of groups'
|
||||||
|
gui-save-group-no-particles: 'You do not have any particles applied'
|
||||||
gui-save-group-hotbar-message: '&eType &b1 &eword in chat for the new group name. Type "&ccancel&e" to cancel. (&b{0}&es left)'
|
gui-save-group-hotbar-message: '&eType &b1 &eword in chat for the new group name. Type "&ccancel&e" to cancel. (&b{0}&es left)'
|
||||||
gui-reset-particles: 'Reset Your Particles'
|
gui-reset-particles: 'Reset Your Particles'
|
||||||
gui-reset-particles-description: 'Deletes all your active particles'
|
gui-reset-particles-description: 'Deletes all your active particles'
|
281
src/lang/fr_FR.lang
Normal file
281
src/lang/fr_FR.lang
Normal file
|
@ -0,0 +1,281 @@
|
||||||
|
# ================================================================ #
|
||||||
|
# fr_FR.lang MESSAGE CONFIGURATION #
|
||||||
|
# Important Notes: #
|
||||||
|
# * You can use the & symbol to color the messages #
|
||||||
|
# * {#} Will be replaced with whatever that message requires #
|
||||||
|
# * \n Will split the lore line in the #GUI section #
|
||||||
|
# * Do NOT use the apostrophe character in any message! ( ' ) #
|
||||||
|
# * PLEASE MAKE YOUR OWN .lang FILE IF YOU WANT CUSTOM MESSAGES! #
|
||||||
|
# * This file will be overridden almost every plugin update! #
|
||||||
|
# ================================================================ #
|
||||||
|
|
||||||
|
# Command Errors
|
||||||
|
command-error-no-effects: "&cVous n avez pas la permission d utiliser cette commande."
|
||||||
|
command-error-unknown: "&cCommande inconnue, utilisez &b/pp help &cpour afficher la liste des commandes disponibles pour ce plugin."
|
||||||
|
|
||||||
|
# Command Descriptions
|
||||||
|
command-descriptions: "&eLes commandes suivantes sont disponibles :"
|
||||||
|
command-descriptions-usage: "&e/pp {0} {1}"
|
||||||
|
command-descriptions-help-1: "&7> &b/pp {0} &e- {1}"
|
||||||
|
command-descriptions-help-2: "&7> &b/pp {0} {1} &e- {2}"
|
||||||
|
command-descriptions-help-other: "&7> &b/ppo <player> <command> &e- Exécute une commande /pp en tant qu un autre joueur."
|
||||||
|
command-description-add: "Ajoutez une nouvelle particule"
|
||||||
|
command-description-data: "Voir les paramètres utilisées par la particule"
|
||||||
|
command-description-default: "Commande principale. Par défaut elle ouvre l interface."
|
||||||
|
command-description-edit: "Modifiez une particule"
|
||||||
|
command-description-effects: "Affichez une liste des effets utilisés"
|
||||||
|
command-description-fixed: "Gérez vos effets fixes"
|
||||||
|
command-description-group: "Gérez vos groupes d effets"
|
||||||
|
command-description-gui: "Affichez l interface pour modifier facilement les effets"
|
||||||
|
command-description-help: "Affichez le menu d aide... Vous y êtes déjà !"
|
||||||
|
command-description-info: "Voir la description d une de vos particules actives"
|
||||||
|
command-description-list: "Listez les IDs de vos particules actives"
|
||||||
|
command-description-reload: "Rechargez le fichier config.yml et de langue"
|
||||||
|
command-description-remove: "Supprimez l une de vos particules actives"
|
||||||
|
command-description-reset: "Supprimez toutes vos particules actives"
|
||||||
|
command-description-styles: "Affichez une liste des styles de particules que vous utilisez"
|
||||||
|
command-description-toggle: "Activez ou déativez vos particules actives"
|
||||||
|
command-description-version: "Affichez la version du plugin et son créateur"
|
||||||
|
command-description-worlds: "Voir les mondes où ce plugin n est pas autorisé"
|
||||||
|
|
||||||
|
# Sub-Command Usage
|
||||||
|
command-description-fixed-create: "&e/pp fixed create <<x> <y> <z>|<looking>> <effect> <style> [data] - Créez une particule fixe"
|
||||||
|
command-description-fixed-edit: "&e/pp fixed edit <id> <effect|style|data> <args> - Modifiez une partie d une particule fixe par son ID"
|
||||||
|
command-description-fixed-remove: "&e/pp fixed remove <ID> - Supprimez une particule fixe par son ID"
|
||||||
|
command-description-fixed-list: "&e/pp fixed list - Affiche l ID de tous vos effets fixes"
|
||||||
|
command-description-fixed-info: "&e/pp fixed info <ID> - Voir des informations sur l une de vos particules fixe"
|
||||||
|
command-description-fixed-clear: "&e/pp fixed clear <radius> - Supprimez tous les effets fixe de tous les joueurs d un rayon"
|
||||||
|
command-description-group-save: "&e/pp group save <name> - Sauvegardez toutes les particules actives dans un nouveau groupe"
|
||||||
|
command-description-group-load: "&e/pp group load <name> - Chargez toutes les particules sauvegardées dans un groupe"
|
||||||
|
command-description-group-remove: "&e/pp group remove <name> - Supprimez un groupe que vous avez créé"
|
||||||
|
command-description-group-list: "&e/pp group list <name> - Voir toutes les particules sauvegardées d un groupe que vous avez créé"
|
||||||
|
command-description-group-info: "&e/pp group info <name> - Voir toutes les particules sauvegardées du groupe"
|
||||||
|
|
||||||
|
# Command ID Lookup
|
||||||
|
id-invalid: "&cL ID rentrée n est pas valide, il doit être un nombre entier positif"
|
||||||
|
id-unknown: "&cVous n avez pas de particules appliquées avec : &b{0} &c!"
|
||||||
|
|
||||||
|
# Other Command
|
||||||
|
other-no-permission: "&cVous n avez pas la permission pour exécuter une commande /pp en tant qu un autre joueur."
|
||||||
|
other-missing-args: "&cVous oubliez des arguments dans votre commande. &b/ppo <player> <command>"
|
||||||
|
other-unknown-player: "&cLe joueur &b{0} &cn a pas été trouvé. Il doit être en ligne."
|
||||||
|
other-unknown-command: "&cLa commande &b/pp {0} &cn existe pas."
|
||||||
|
other-success: "&Commande /pp exécutée. &b{0}&e. Retour de la commande :"
|
||||||
|
|
||||||
|
# Add Command
|
||||||
|
add-reached-max: "Impossible d appliquer la particule, vous avez atteint la limite de particules qui est de &b{0} &c!"
|
||||||
|
add-particle-applied: "&aUne nouvelle particule est appliquée avec l effet &b{0}&a, le style &b{1}&a, et les paramètres &b{2} &a!"
|
||||||
|
|
||||||
|
# Data Command
|
||||||
|
data-no-args: "&cVous oubliez des arguments dans l effet. Utilisation de la commande: &b/pp data <effect>"
|
||||||
|
|
||||||
|
# Edit Command
|
||||||
|
edit-invalid-property: "cLa propriété &b{0} &cest interdite. Propriétés valides : &beffect&c, &bstyle&c, &bdata"
|
||||||
|
edit-success-effect: "&aVotre particule avec l ID de &b{0} &aa son effet changé à &b{1} &a!"
|
||||||
|
edit-success-style: "&aVotre particule avec l ID de &b{0} &aa son style changé à &b{1} &a!"
|
||||||
|
edit-success-data: "&aVotre particule avec l ID de &b{0} &aa ses paramètres changés à &b{1} &a!"
|
||||||
|
|
||||||
|
# Group Command
|
||||||
|
group-invalid: "&cUn groupe ou un preset de groupe sauvegardé n existe pas avec le nom &b{0} &c!"
|
||||||
|
group-preset-no-permission: "&cVous oubliez une permission pour un style ou un effet afin d utiliser les persets du groupe &b{0} &c!"
|
||||||
|
group-reserved: "&cLe nom de groupe &bactive &cest réservé et ne peut pas être utiliser !"
|
||||||
|
group-no-name: "&cVous n avez pas rentré de nom de groupe ! &b/pp {0} <groupName>"
|
||||||
|
group-save-reached-max: "&cImpossible de sauvegarder le groupe, vous avez atteint le nombre maximun de groupes !"
|
||||||
|
group-save-no-particles: "&cImpossible de sauvegarder le groupe, vous n avez pas appliqué de particules !"
|
||||||
|
group-save-success: "&aVos particules actuelles on été sauvegardées sous le nom de groupe &b{0} &a!"
|
||||||
|
group-save-success-overwrite: "&aLe groupe &b{0} &aa été mis à jour avec vos particules actuelle !"
|
||||||
|
group-load-success: "&b{0} &aparticule(s) appliqués venant du groupe sauvegardé nommé &b{1} &a!"
|
||||||
|
group-load-preset-success: "&b{0} &aparticule(s) appliqués venant du preset sauvegardé nommé &b{1} &a!"
|
||||||
|
group-remove-preset: "&cVous ne pouvez pas supprimer un groupe de presets !"
|
||||||
|
group-remove-success: "&aGroupe de particules &b{0} &asupprimé !"
|
||||||
|
group-info-header: "&eLe groupe &b{0} &eposséde les particules suivantes :"
|
||||||
|
group-list-none: "&eVous n avez pas de groupes de particules sauvegardés !"
|
||||||
|
group-list-output: "&eVous avez ces groupes suivants sauvegardés : &b{0}"
|
||||||
|
group-list-presets: "&eCes presets de groupes suivants sont disponibles : &b{0}"
|
||||||
|
|
||||||
|
# Reload Command
|
||||||
|
reload-success: "&aLe plugin a été rechargé..."
|
||||||
|
reload-no-permission: "&cVous n avez pas la permission pour recharger la configuration de ce plugin !"
|
||||||
|
|
||||||
|
# Remove Command
|
||||||
|
remove-no-args: "&cVous n avez pas rentrer d ID à supprimer ! &b/pp remove <ID>"
|
||||||
|
remove-success: "&aVotre particule avec l ID &b{0} &aa été supprimée !"
|
||||||
|
|
||||||
|
# List Command
|
||||||
|
list-none: "&eVous n avez pas de particules actives."
|
||||||
|
list-you-have: "&eVous avez les particules suivantes appliquées :"
|
||||||
|
list-output: "&eID: &b{0} &eEffet: &b{1} &eStyle: &b{2} &eParamètre: &b{3}"
|
||||||
|
|
||||||
|
# Toggle Command
|
||||||
|
toggle-on: "&eLes particules sont maintenant en mode &aON &e!"
|
||||||
|
toggle-off: "&eLes particules sont maintenant en mode &cOFF &e!"
|
||||||
|
|
||||||
|
# Rainbow
|
||||||
|
rainbow: "&cr&6a&ei&an&bb&9o&dw"
|
||||||
|
|
||||||
|
# Random
|
||||||
|
random: "aléatoire"
|
||||||
|
|
||||||
|
# Effects
|
||||||
|
effect-no-permission: "&cVous n avez pas la permission pour utiliser la particule &b{0} &c!"
|
||||||
|
effect-invalid: "&cL effet &b{0} &cn existe pas ! Utilisez &b/pp effects &cpour afficher les effets disponibles."
|
||||||
|
effect-list: "&eVous pouvez utiliser les effets suivants : &b{0}"
|
||||||
|
effect-list-empty: "&cVous n avez pas la permission pour utiliser des effets !"
|
||||||
|
|
||||||
|
# Styles
|
||||||
|
style-no-permission: "&cVous n avez pas la permission pour utiliser le style &b{0} &c!"
|
||||||
|
style-event-spawning-info: "&eNote: Le style &b{0} &efait apparaitre des particules seulement lors d évènements spécifiques."
|
||||||
|
style-invalid: "&cLe style &b{0} &cn existe pas ! Utilisez &b/pp styles &cpour afficher les styles disponibles."
|
||||||
|
style-list: "&eVous pouvez utiliser les styles suivants : &b{0}"
|
||||||
|
|
||||||
|
# Data
|
||||||
|
data-usage-none: "&eL effet &b{0} &en est pas paramétrable."
|
||||||
|
data-usage-block: "&eL effet &b{0} &erequière l ID du bloc ! &bFormat: <blockName>"
|
||||||
|
data-usage-item: "&eL effet &b{0} &erequière l ID de l item ! &bFormat: <itemName>"
|
||||||
|
data-usage-color: "&eL effet &b{0} &erequière l ID de la couleur ! &bFormat: <<0-255> <0-255> <0-255>>|<rainbow>|<random>"
|
||||||
|
data-usage-note: "&eL effet&b{0} &erequière l ID de la note ! &bFormat: <0-24>|<rainbow>|<random>"
|
||||||
|
data-invalid-block: "&cL ID du bloc que vous avez rentré n est pas valide ! &bFormat: <blockName>"
|
||||||
|
data-invalid-item: "&cL ID de l item que vous avez rentré n est pas valide ! &bFormat: <itemName>"
|
||||||
|
data-invalid-color: "&cL ID de la couleur que vous avez rentré n est pas valide ! &bFormat: <<0-255> <0-255> <0-255>>|<rainbow>|<random>"
|
||||||
|
data-invalid-note: "&cL ID du bloc que vous avez rentré n est pas valide ! &bFormat: <0-24>|<rainbow>|<random>"
|
||||||
|
data-invalid-material-not-item: "&cL ID &b{0} &cne correspond pas à un item !"
|
||||||
|
data-invalid-material-not-block: "&cL ID &b{0} &cne correspond pas à un bloc !"
|
||||||
|
data-invalid-material-item: "&cL ID &b{0} n existe pas !"
|
||||||
|
data-invalid-material-block: "&cL ID&b{0} n existe pas !"
|
||||||
|
|
||||||
|
# Worlds
|
||||||
|
disabled-worlds: "&eLes particules sont désactivées dans ces mondes : &b{0}"
|
||||||
|
disabled-worlds-none: "&Les particules sont désactivées dans aucuns mondes."
|
||||||
|
|
||||||
|
# Reset
|
||||||
|
reset-success: "&b{0} &aparticule(s) actives supprimées !"
|
||||||
|
|
||||||
|
# Fixed Effects
|
||||||
|
fixed-create-missing-args: "&cImpossible de créer un effet fixe, vous oubliez des arguments : &b{0}"
|
||||||
|
fixed-create-invalid-coords: "&cImpossible de créer un effet fixe, coordonnées invalides !"
|
||||||
|
fixed-create-out-of-range: "&cImpossible de créer un effet fixe, Vous devez être à &b{0} &cblocs de la position rentrée !"
|
||||||
|
fixed-create-looking-too-far: "&cImpossible de créer un effet fixe, vous êtes trop loin du bloc que vous regardez !"
|
||||||
|
fixed-create-effect-invalid: "&cImpossible de créer un effet fixe, l effet &b{0} &cn existe pas !"
|
||||||
|
fixed-create-effect-no-permission: "&cImpossible de créer un effet fixe, vous n avez pas la permission pour utiliser le style &b{0} &c!"
|
||||||
|
fixed-create-style-invalid: "&cImpossible de créer un effet fixe, le style &b{0} &cn existe pas!"
|
||||||
|
fixed-create-style-no-permission: "&cImpossible de créer un effet fixe, vous n avez pas la permission pour utiliser le style &b{0} &c!"
|
||||||
|
fixed-create-style-non-fixable: "&cImpossible de créer un effet fixe, le style &b{0} &cne peut pas être utilisé en tant qu effet fixe !"
|
||||||
|
fixed-create-data-error: "&cImpossible de créer un effet fixe, l ID rentrée n est pas valide ! Utilisez &b/pp data <effect> &cpour afficher les IDs valides."
|
||||||
|
fixed-create-success: "&aL effet fixe à été créer."
|
||||||
|
|
||||||
|
fixed-edit-missing-args: "&cImpossible de modifier l effet fixe, vous oubliez des arguments !"
|
||||||
|
fixed-edit-invalid-id: "&cImpossible de modifier l effet fixe, ID incorrecte !"
|
||||||
|
fixed-edit-invalid-property: "&cImpossible de modifier l effet fixe, argument incorrecte ! Seuls localisation, effet, style, et paramètre sont valides."
|
||||||
|
fixed-edit-invalid-coords: "&cImpossible de modifier l effet fixe, coordonnée incorrecte !"
|
||||||
|
fixed-edit-out-of-range: "&cImpossible de modifier l effet fixe, vous devez être à &b{0} &cblocs de l emplacement désiré !"
|
||||||
|
fixed-edit-looking-too-far: "&cImpossible de modifier l effet fixe, vous êtes trop loin du bloc que vous regardez !"
|
||||||
|
fixed-edit-effect-invalid: "&cImpossible de modifier l effet fixe, l effet &b{0} &cn existe pas !"
|
||||||
|
fixed-edit-effect-no-permission: "&cImpossible de modifier l effet fixe, vous n avez pas la permission pour utiliser l effet &b{0} &c!"
|
||||||
|
fixed-edit-style-invalid: "&cImpossible de modifier l effet fixe, le style &b{0} &cn existe pas !"
|
||||||
|
fixed-edit-style-no-permission: "&cImpossible de modifier l effet fixe, vous n avez pas la permission pour utiliser le style &b{0} &c!"
|
||||||
|
fixed-edit-style-non-fixable: "&cImpossible de modifier l effet fixe, the style &b{0} &cne peut pas être utilisé dans des effets fixes !"
|
||||||
|
fixed-edit-data-error: "&cImpossible de modifier l effet fixe, paramètre incorrecte ! Utilisez &b/pp data <effect> pour afficher les paramètres valides."
|
||||||
|
fixed-edit-data-none: "&cImpossible de modifier l effet fixe, l effet ne requière pas de paramètres !"
|
||||||
|
fixed-edit-success: "&aMise à jour de &b{0} &ade l effet fixe avec l ID &b{1} &a!"
|
||||||
|
|
||||||
|
fixed-remove-invalid: "&cImpossible de supprimer l effet fixe, vous n avez pas d effets fixes avec l ID &b{0} &c!"
|
||||||
|
fixed-remove-no-args: "&cVous n avez pas rentrer d ID à supprimer !"
|
||||||
|
fixed-remove-args-invalid: "&cImpossible de supprimer, l ID doit être un nombre !"
|
||||||
|
fixed-remove-success: "&aTous vos effets fixes avec l ID &b{0} &aont été supprimés !"
|
||||||
|
|
||||||
|
fixed-list-none: "&eVous n avez pas d effets fixes !"
|
||||||
|
fixed-list-success: "&eVous avez des effets fixes avec ces IDs :&b{0}"
|
||||||
|
|
||||||
|
fixed-info-invalid: "&cImpossible de obtenir l information, vous n avez pas de particules fixes avec l ID &b{0}& c!"
|
||||||
|
fixed-info-no-args: "&cVous n avez pas rentrée d ID pour obtenir d infomations !"
|
||||||
|
fixed-info-invalid-args: "&cImpossible d obtenir l information, vous n avez pas de particules fixes avec l ID, l ID spécifiée doit être un nombre !"
|
||||||
|
fixed-info-success: "&eID: &b{0} &eWorld: &b{1} &eX: &b{2} &eY: &b{3} &eZ: &b{4} &eEffect: &b{5} &eStyle: &b{6} &eData: &b{7}"
|
||||||
|
|
||||||
|
fixed-clear-no-permission: "&cVous n avez la permission pour supprimer les effets proches !"
|
||||||
|
fixed-clear-no-args: "&cVous n avez pas rentré de rayon !"
|
||||||
|
fixed-clear-invalid-args: "&cLe rayon rentré n est pas valide, il doit être un nombre rond !"
|
||||||
|
fixed-clear-success: "&b{0} &aeffets on été supprimés dans un rayon &b{1} &cblocs !"
|
||||||
|
|
||||||
|
fixed-no-permission: "&cVous n avez pas la permission d ajouter des effets fixes !"
|
||||||
|
fixed-max-reached: "&cVous avez atteint le nombre maximum de particules fixes !"
|
||||||
|
fixed-invalid-command: "&cArguments invalides pour la commande &b/pp fixed&c!"
|
||||||
|
|
||||||
|
# Update Available
|
||||||
|
update-available: "&eLa version (&b{0}&e) est disponible ! vous utilisez la version &bv{1}&d. https://www.spigotmc.org/resources/playerparticles.40261/"
|
||||||
|
|
||||||
|
# GUI
|
||||||
|
gui-disabled: "&cL interface du plugin à été désactivée !"
|
||||||
|
gui-color-icon-name: "&a"
|
||||||
|
gui-color-info: "&e"
|
||||||
|
gui-color-subtext: "&b"
|
||||||
|
gui-color-unavailable: "&c"
|
||||||
|
gui-commands-info: "Affichez des informations avec &b/pp help"
|
||||||
|
gui-back-button: "Retour en arrière"
|
||||||
|
gui-click-to-load: "Cliquez pour charger : {0}"
|
||||||
|
gui-shift-click-to-delete: "Touche SHIFT + clic-gauche pour effacer un effet"
|
||||||
|
gui-particle-info: " - ID: &b{0} &eEffet: &b{1} &eStyle: &b{2} &eParamètre: &b{3}"
|
||||||
|
gui-playerparticles: "PlayerParticles"
|
||||||
|
gui-active-particles: "Particules actives: &b{0}"
|
||||||
|
gui-saved-groups: "Groupes sauvegardés: &b{0}"
|
||||||
|
gui-fixed-effects: "Effets fixes: &b{0}"
|
||||||
|
gui-edit-primary-effect: "Editez l effet primaire"
|
||||||
|
gui-edit-primary-effect-description: "Editez l effet d une de vos particules primaire"
|
||||||
|
gui-edit-primary-style: "Editez le style primaire"
|
||||||
|
gui-edit-primary-style-missing-effect: "Vous devez d abord sélectionner un effet !"
|
||||||
|
gui-edit-primary-style-description: "Editez le style d une particule primaire"
|
||||||
|
gui-edit-primary-data: "Editez les paramètres d une particules primaire"
|
||||||
|
gui-edit-primary-data-missing-effect: "Vous devez d abord sélectionner un effet"
|
||||||
|
gui-edit-primary-data-unavailable: "Votre effet primaire n est pas paramétrable"
|
||||||
|
gui-edit-primary-data-description: "Editer les paramères de votre effet primaire"
|
||||||
|
gui-manage-your-particles: "Gérez vos particules"
|
||||||
|
gui-manage-your-particles-description: "Créez, éditez, et supprimez vos particules"
|
||||||
|
gui-manage-your-groups: "Gérez vos groupes"
|
||||||
|
gui-manage-your-groups-description: "Créez, éditez, et supprimez vos groupes particules"
|
||||||
|
gui-load-a-preset-group: "Chargez un groupe de presets"
|
||||||
|
gui-load-a-preset-group-description: "Chargez un groupe de particules déjà fait"
|
||||||
|
gui-save-group: "Sauvegardez un nouveau groupe"
|
||||||
|
gui-save-group-description: "Sauvegarder un nouveau groupe avec:"
|
||||||
|
gui-save-group-description-2: "/pp group save <groupName>"
|
||||||
|
gui-reset-particles: "Réinitialisez vos particules"
|
||||||
|
gui-reset-particles-description: "Supprimez vos particules actives"
|
||||||
|
gui-particle-name: "Particule #{0}"
|
||||||
|
gui-click-to-edit-particle: "Cliquez pour éditer cette particule"
|
||||||
|
gui-editing-particle: "Edition particule #{0}"
|
||||||
|
gui-edit-effect: "Editez l effet"
|
||||||
|
gui-edit-effect-description: "Cliquez pour éditer l effet de cette particule"
|
||||||
|
gui-edit-style: "Editez le style"
|
||||||
|
gui-edit-style-description: "Cliquez pour éditer le style de cette particule"
|
||||||
|
gui-edit-data: "Editez les paramères"
|
||||||
|
gui-edit-data-description: "Cliquez pour éditer les paramètres de la particule"
|
||||||
|
gui-edit-data-unavailable: "Cliquez pour éditer les paramères de cette particule"
|
||||||
|
gui-data-none: "aucuns"
|
||||||
|
gui-create-particle: "Créez une nouvelle particule"
|
||||||
|
gui-create-particle-description: "Créez une nouvelle particule"
|
||||||
|
gui-create-particle-unavailable: "Vous avez atteint le nombre maximum de particules que vous pouvez créer"
|
||||||
|
gui-select-effect: "Sélectionnez les effets"
|
||||||
|
gui-select-effect-description: "Mettez les effets de la particules à &b{0}"
|
||||||
|
gui-select-style: "Sélectionnez le style"
|
||||||
|
gui-select-style-description: "Mets le style de la particule à &b{0}"
|
||||||
|
gui-select-data: "Sélectionnez les paramètres"
|
||||||
|
gui-select-data-description: "Mets les paramètres de la particule à &b{0}"
|
||||||
|
gui-select-data-note: "note #{0}"
|
||||||
|
gui-select-data-randomize-items: "Mélangez les items"
|
||||||
|
gui-select-data-randomize-items-description: "Mélangez les items affichés"
|
||||||
|
gui-select-data-randomize-blocks: "Mélangez les blocs"
|
||||||
|
gui-select-data-randomize-blocks-description: "Mélangez les blocs affichés"
|
||||||
|
gui-edit-data-color-red: "&crouge"
|
||||||
|
gui-edit-data-color-orange: "&6orange"
|
||||||
|
gui-edit-data-color-yellow: "&ejaune"
|
||||||
|
gui-edit-data-color-lime-green: "&avert citron"
|
||||||
|
gui-edit-data-color-green: "&2vert"
|
||||||
|
gui-edit-data-color-blue: "&1bleu"
|
||||||
|
gui-edit-data-color-cyan: "&3cyan"
|
||||||
|
gui-edit-data-color-light-blue: "&bbleu clair"
|
||||||
|
gui-edit-data-color-purple: "&5mauve"
|
||||||
|
gui-edit-data-color-magenta: "&dmagenta"
|
||||||
|
gui-edit-data-color-pink: "&drose"
|
||||||
|
gui-edit-data-color-brown: "&6brun"
|
||||||
|
gui-edit-data-color-black: "&8noir"
|
||||||
|
gui-edit-data-color-gray: "&8gris"
|
||||||
|
gui-edit-data-color-light-gray: "&7gris clair"
|
||||||
|
gui-edit-data-color-white: "&fblanc"
|
82
src/preset_groups.yml
Normal file
82
src/preset_groups.yml
Normal file
|
@ -0,0 +1,82 @@
|
||||||
|
# ==================================================== #
|
||||||
|
# PRESET GROUPS #
|
||||||
|
# Information: #
|
||||||
|
# * The groups listed within this file will be #
|
||||||
|
# available to all players who have access to the #
|
||||||
|
# effect and style! #
|
||||||
|
# * The GUI is capable of displaying up to 28 groups. #
|
||||||
|
# * Feel free to create your own, they will be #
|
||||||
|
# available for users to select within the GUI! #
|
||||||
|
# * This file is not automatically updated. If you #
|
||||||
|
# want to reset the file to its defaults, simply #
|
||||||
|
# delete it and run the command '/pp reload'. #
|
||||||
|
# ==================================================== #
|
||||||
|
#
|
||||||
|
# Use the following format for adding new groups:
|
||||||
|
# group-name:
|
||||||
|
# display-name: 'My Amazing Group'
|
||||||
|
# gui-icon: 'ENDER_CHEST'
|
||||||
|
# permission: 'playerparticles.group.group-name'
|
||||||
|
# allow-permission-override: true
|
||||||
|
# 1:
|
||||||
|
# effect: 'dust'
|
||||||
|
# style: 'wings'
|
||||||
|
# data: '255 255 255'
|
||||||
|
# 2:
|
||||||
|
# effect: 'cloud'
|
||||||
|
# style: 'overhead'
|
||||||
|
# data: ''
|
||||||
|
#
|
||||||
|
# What everything means:
|
||||||
|
# group-name: The name of the group, how it will be applied by using /pp group load <group-name>.
|
||||||
|
# display-name: The display name of the group, how it will show up in the GUI, this is required.
|
||||||
|
# gui-icon: The icon to use for the GUI, this is required.
|
||||||
|
# permission: The permission that the player must have to see this group, may be left blank as ''. The player must still have permission for all effects/styles within the group in order to use it.
|
||||||
|
# allow-permission-override: Allow the player to see and apply the group even if they don't have access to all the effects/styles within it. This does nothing if the permission is set to ''.
|
||||||
|
# 1 (or any positive whole number n): The particle ID. You may have as many of these as you want, they must contain an effect, style, and data property below them.
|
||||||
|
# effect: The effect that the particle will have.
|
||||||
|
# style: The style that the particle will have.
|
||||||
|
# data: The data that the particle will have.
|
||||||
|
#
|
||||||
|
# GUI Icons MUST use the names found at the link below:
|
||||||
|
# https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html
|
||||||
|
|
||||||
|
raincloud:
|
||||||
|
display-name: 'Raincloud'
|
||||||
|
gui-icon: 'ENDER_CHEST'
|
||||||
|
permission: ''
|
||||||
|
allow-permission-override: false
|
||||||
|
1:
|
||||||
|
effect: 'cloud'
|
||||||
|
style: 'overhead'
|
||||||
|
data: ''
|
||||||
|
2:
|
||||||
|
effect: 'rain'
|
||||||
|
style: 'overhead'
|
||||||
|
data: ''
|
||||||
|
rainbows:
|
||||||
|
display-name: 'Rainbows'
|
||||||
|
gui-icon: 'ENDER_CHEST'
|
||||||
|
permission: ''
|
||||||
|
allow-permission-override: false
|
||||||
|
1:
|
||||||
|
effect: 'dust'
|
||||||
|
style: 'orbit'
|
||||||
|
data: 'rainbow'
|
||||||
|
2:
|
||||||
|
effect: 'entity_effect'
|
||||||
|
style: 'feet'
|
||||||
|
data: 'rainbow'
|
||||||
|
angel:
|
||||||
|
display-name: 'Angel'
|
||||||
|
gui-icon: 'ENDER_CHEST'
|
||||||
|
permission: ''
|
||||||
|
allow-permission-override: false
|
||||||
|
1:
|
||||||
|
effect: 'dust'
|
||||||
|
style: 'wings'
|
||||||
|
data: '255 255 255'
|
||||||
|
2:
|
||||||
|
effect: 'dust'
|
||||||
|
style: 'halo'
|
||||||
|
data: '255 255 0'
|
Loading…
Reference in a new issue