forked from Upstream/CommandPanels
Legacy Fixes v3.11.1
This commit is contained in:
parent
401ea967ea
commit
b789328985
135
resource/exampleLegacy.yml
Normal file
135
resource/exampleLegacy.yml
Normal file
@ -0,0 +1,135 @@
|
|||||||
|
# |------------------------------------------------------------------------
|
||||||
|
# | CommandPanels Classic Example File
|
||||||
|
# | By RockyHawk v2.0
|
||||||
|
# | https://www.spigotmc.org/resources/command-panels-custom-guis.67788/
|
||||||
|
# |------------------------------------------------------------------------
|
||||||
|
panels:
|
||||||
|
example:
|
||||||
|
perm: default
|
||||||
|
rows: 4
|
||||||
|
title: '&6[&bExample Panel&6]&f Welcome!'
|
||||||
|
command: example
|
||||||
|
sound-on-open: NOTE_PLING
|
||||||
|
empty: STAINED_GLASS_PANE
|
||||||
|
emptyID: 15
|
||||||
|
disabled-worlds:
|
||||||
|
- 'world_nether'
|
||||||
|
open-with-item:
|
||||||
|
material: PAPER
|
||||||
|
name: '&6[&bExample Panel&6]'
|
||||||
|
lore:
|
||||||
|
- '&3Click me to open the panel!'
|
||||||
|
stationary: 4
|
||||||
|
item:
|
||||||
|
'0':
|
||||||
|
material: LEATHER_HELMET
|
||||||
|
name: '&d&lPURPLE'
|
||||||
|
leatherarmor: PURPLE
|
||||||
|
damage: 30
|
||||||
|
'9':
|
||||||
|
material: LEATHER_CHESTPLATE
|
||||||
|
name: '&9&lBLUE'
|
||||||
|
leatherarmor: BLUE
|
||||||
|
damage: 20
|
||||||
|
'18':
|
||||||
|
material: LEATHER_LEGGINGS
|
||||||
|
name: '&a&lLIME'
|
||||||
|
leatherarmor: LIME
|
||||||
|
damage: 40
|
||||||
|
'2':
|
||||||
|
material: cps= eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZGJiMjczN2VjYmY5MTBlZmUzYjI2N2RiN2Q0YjMyN2YzNjBhYmM3MzJjNzdiZDBlNGVmZjFkNTEwY2RlZiJ9fX0=
|
||||||
|
name: '&e&lE'
|
||||||
|
'3':
|
||||||
|
material: cps= eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNWE2Nzg3YmEzMjU2NGU3YzJmM2EwY2U2NDQ5OGVjYmIyM2I4OTg0NWU1YTY2YjVjZWM3NzM2ZjcyOWVkMzcifX19
|
||||||
|
name: '&e&lX'
|
||||||
|
'4':
|
||||||
|
material: cps= eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYTY3ZDgxM2FlN2ZmZTViZTk1MWE0ZjQxZjJhYTYxOWE1ZTM4OTRlODVlYTVkNDk4NmY4NDk0OWM2M2Q3NjcyZSJ9fX0=
|
||||||
|
name: '&e&lA'
|
||||||
|
'5':
|
||||||
|
material: cps= eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNDljNDVhMjRhYWFiZjQ5ZTIxN2MxNTQ4MzIwNDg0OGE3MzU4MmFiYTdmYWUxMGVlMmM1N2JkYjc2NDgyZiJ9fX0=
|
||||||
|
name: '&e&lM'
|
||||||
|
'6':
|
||||||
|
material: cps= eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYTBhNzk4OWI1ZDZlNjIxYTEyMWVlZGFlNmY0NzZkMzUxOTNjOTdjMWE3Y2I4ZWNkNDM2MjJhNDg1ZGMyZTkxMiJ9fX0=
|
||||||
|
name: '&e&lP'
|
||||||
|
'7':
|
||||||
|
material: cps= eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMzE5ZjUwYjQzMmQ4NjhhZTM1OGUxNmY2MmVjMjZmMzU0MzdhZWI5NDkyYmNlMTM1NmM5YWE2YmIxOWEzODYifX19
|
||||||
|
name: '&e&lL'
|
||||||
|
'8':
|
||||||
|
material: cps= eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZGJiMjczN2VjYmY5MTBlZmUzYjI2N2RiN2Q0YjMyN2YzNjBhYmM3MzJjNzdiZDBlNGVmZjFkNTEwY2RlZiJ9fX0=
|
||||||
|
name: '&e&lE'
|
||||||
|
'13':
|
||||||
|
material: cps= eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYTBhNzk4OWI1ZDZlNjIxYTEyMWVlZGFlNmY0NzZkMzUxOTNjOTdjMWE3Y2I4ZWNkNDM2MjJhNDg1ZGMyZTkxMiJ9fX0=
|
||||||
|
name: '&e&lP'
|
||||||
|
'14':
|
||||||
|
material: cps= eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYTY3ZDgxM2FlN2ZmZTViZTk1MWE0ZjQxZjJhYTYxOWE1ZTM4OTRlODVlYTVkNDk4NmY4NDk0OWM2M2Q3NjcyZSJ9fX0=
|
||||||
|
name: '&e&lA'
|
||||||
|
'15':
|
||||||
|
material: cps= eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMzViOGIzZDhjNzdkZmI4ZmJkMjQ5NWM4NDJlYWM5NGZmZmE2ZjU5M2JmMTVhMjU3NGQ4NTRkZmYzOTI4In19fQ==
|
||||||
|
name: '&e&lN'
|
||||||
|
'16':
|
||||||
|
material: cps= eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZGJiMjczN2VjYmY5MTBlZmUzYjI2N2RiN2Q0YjMyN2YzNjBhYmM3MzJjNzdiZDBlNGVmZjFkNTEwY2RlZiJ9fX0=
|
||||||
|
name: '&e&lE'
|
||||||
|
'17':
|
||||||
|
material: cps= eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMzE5ZjUwYjQzMmQ4NjhhZTM1OGUxNmY2MmVjMjZmMzU0MzdhZWI5NDkyYmNlMTM1NmM5YWE2YmIxOWEzODYifX19
|
||||||
|
name: '&e&lL'
|
||||||
|
'20':
|
||||||
|
material: WOOL
|
||||||
|
ID: 14
|
||||||
|
name: '&cYour nickname is not ''RockyHawk'''
|
||||||
|
commands:
|
||||||
|
- 'msg= &cNot RockyHawk'
|
||||||
|
hasvalue:
|
||||||
|
output: true
|
||||||
|
value: RockyHawk
|
||||||
|
compare: '%cp-player-name%'
|
||||||
|
material: WOOL
|
||||||
|
ID: 5
|
||||||
|
name: '&aYour username is ''RockyHawk'''
|
||||||
|
commands:
|
||||||
|
- 'msg= &aWelcome my master!'
|
||||||
|
'27':
|
||||||
|
material: LEATHER_BOOTS
|
||||||
|
name: '&e&lYELLOW'
|
||||||
|
leatherarmor: YELLOW
|
||||||
|
damage: 50
|
||||||
|
'32':
|
||||||
|
material: COMPASS
|
||||||
|
stack: 12
|
||||||
|
enchanted: true
|
||||||
|
name: '&cClick Me'
|
||||||
|
lore:
|
||||||
|
- '&fI will teleport you home!'
|
||||||
|
commands:
|
||||||
|
- home
|
||||||
|
- commandpanels:commandpanelclose
|
||||||
|
- console= title %cp-player-name% times 20 60 20
|
||||||
|
- console= title %cp-player-name% subtitle {"text":"%cp-player-displayname%","color":"green"}
|
||||||
|
- console= title %cp-player-name% title {"text":"Welcome Home"}
|
||||||
|
'30':
|
||||||
|
material: POTION
|
||||||
|
ID: 8225
|
||||||
|
name: '&5&lInstant Health II'
|
||||||
|
commands:
|
||||||
|
- heal
|
||||||
|
- commandpanels:commandpanelclose
|
||||||
|
'34':
|
||||||
|
material: REDSTONE_BLOCK
|
||||||
|
name: '&cNo Permission'
|
||||||
|
lore:
|
||||||
|
- '&4You cannot change to'
|
||||||
|
- '&4creative looking like that!'
|
||||||
|
hasperm:
|
||||||
|
perm: essentials.gamemode
|
||||||
|
output: true
|
||||||
|
material: EMERALD_BLOCK
|
||||||
|
name: '&aClick Me'
|
||||||
|
lore:
|
||||||
|
- '&2I will change you'
|
||||||
|
- '&2to creative mode!'
|
||||||
|
commands:
|
||||||
|
- gamemode creative
|
||||||
|
- commandpanels:commandpanelclose
|
||||||
|
- console= title %cp-player-name% times 20 60 20
|
||||||
|
- console= title %cp-player-name% subtitle {"text":"You are now in creative
|
||||||
|
mode!","color":"green"}
|
||||||
|
- console= title %cp-player-name% title {"text":"Awesome %cp-player-displayname%"}
|
@ -1,4 +1,4 @@
|
|||||||
version: 3.11.0
|
version: 3.11.1
|
||||||
main: me.rockyhawk.commandpanels.CommandPanels
|
main: me.rockyhawk.commandpanels.CommandPanels
|
||||||
name: CommandPanels
|
name: CommandPanels
|
||||||
author: RockyHawk
|
author: RockyHawk
|
||||||
|
@ -142,7 +142,12 @@ public class CommandPanels extends JavaPlugin {
|
|||||||
//save the example.yml file
|
//save the example.yml file
|
||||||
if (!this.panelsf.exists() || Objects.requireNonNull(this.panelsf.list()).length == 0) {
|
if (!this.panelsf.exists() || Objects.requireNonNull(this.panelsf.list()).length == 0) {
|
||||||
try {
|
try {
|
||||||
FileConfiguration exampleFileConfiguration = YamlConfiguration.loadConfiguration(getReaderFromStream(this.getResource("example.yml")));
|
FileConfiguration exampleFileConfiguration;
|
||||||
|
if(legacy.isLegacy()){
|
||||||
|
exampleFileConfiguration = YamlConfiguration.loadConfiguration(getReaderFromStream(this.getResource("exampleLegacy.yml")));
|
||||||
|
}else {
|
||||||
|
exampleFileConfiguration = YamlConfiguration.loadConfiguration(getReaderFromStream(this.getResource("example.yml")));
|
||||||
|
}
|
||||||
exampleFileConfiguration.save(new File(this.panelsf + File.separator + "example.yml"));
|
exampleFileConfiguration.save(new File(this.panelsf + File.separator + "example.yml"));
|
||||||
} catch (IOException var11) {
|
} catch (IOException var11) {
|
||||||
Bukkit.getConsoleSender().sendMessage("[CommandPanels]" + ChatColor.RED + " WARNING: Could not save the example file!");
|
Bukkit.getConsoleSender().sendMessage("[CommandPanels]" + ChatColor.RED + " WARNING: Could not save the example file!");
|
||||||
|
@ -243,13 +243,22 @@ public class ItemCreation {
|
|||||||
}
|
}
|
||||||
if (itemSection.contains("damage")) {
|
if (itemSection.contains("damage")) {
|
||||||
//change the damage amount (placeholders accepted)
|
//change the damage amount (placeholders accepted)
|
||||||
try {
|
if(plugin.legacy.isLegacy()){
|
||||||
Damageable itemDamage = (Damageable) s.getItemMeta();
|
try {
|
||||||
itemDamage.setDamage(Integer.parseInt(Objects.requireNonNull(plugin.papi(p, itemSection.getString("damage")))));
|
s.setDurability(Short.parseShort(Objects.requireNonNull(plugin.papi(p, itemSection.getString("damage")))));
|
||||||
s.setItemMeta((ItemMeta) itemDamage);
|
}catch(Exception e){
|
||||||
}catch(Exception e){
|
plugin.debug(e);
|
||||||
plugin.debug(e);
|
p.sendMessage(plugin.papi(tag + plugin.config.getString("config.format.error") + " damage: " + itemSection.getString("damage")));
|
||||||
p.sendMessage(plugin.papi(tag + plugin.config.getString("config.format.error") + " damage: " + itemSection.getString("damage")));
|
}
|
||||||
|
}else {
|
||||||
|
try {
|
||||||
|
Damageable itemDamage = (Damageable) s.getItemMeta();
|
||||||
|
itemDamage.setDamage(Integer.parseInt(Objects.requireNonNull(plugin.papi(p, itemSection.getString("damage")))));
|
||||||
|
s.setItemMeta((ItemMeta) itemDamage);
|
||||||
|
} catch (Exception e) {
|
||||||
|
plugin.debug(e);
|
||||||
|
p.sendMessage(plugin.papi(tag + plugin.config.getString("config.format.error") + " damage: " + itemSection.getString("damage")));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (itemSection.contains("stack")) {
|
if (itemSection.contains("stack")) {
|
||||||
|
Loading…
Reference in New Issue
Block a user