v3.14.2.2

This commit is contained in:
rockyhawk64 2020-12-12 18:40:40 +11:00
parent 00152786e0
commit 0620207ea1
4 changed files with 12 additions and 11 deletions

View File

@ -1,4 +1,4 @@
version: 3.14.2.1 version: 3.14.2.2
main: me.rockyhawk.commandpanels.CommandPanels main: me.rockyhawk.commandpanels.CommandPanels
name: CommandPanels name: CommandPanels
author: RockyHawk author: RockyHawk

View File

@ -431,15 +431,12 @@ public class ItemCreation {
if(plugin.getHeads.ifSkullOrHead(cont.getType().toString())){ if(plugin.getHeads.ifSkullOrHead(cont.getType().toString())){
if(!Objects.requireNonNull(file.getString("panels." + panelName + ".item." + i + ".material")).contains("%") && !Objects.requireNonNull(file.getString("panels." + panelName + ".item." + i + ".material")).contains("=")) { if(!Objects.requireNonNull(file.getString("panels." + panelName + ".item." + i + ".material")).contains("%") && !Objects.requireNonNull(file.getString("panels." + panelName + ".item." + i + ".material")).contains("=")) {
SkullMeta meta = (SkullMeta) cont.getItemMeta(); SkullMeta meta = (SkullMeta) cont.getItemMeta();
//disable for legacy as is broken if (plugin.customHeads.getHeadBase64(cont) != null && !plugin.legacy.isLegacy()) {
if (!plugin.legacy.isLegacy()) { //inject base64 here, disable for legacy as is not working
if (plugin.customHeads.getHeadBase64(cont) != null) { file.set("panels." + panelName + ".item." + i + ".material", "cps= " + plugin.customHeads.getHeadBase64(cont));
//inject base64 here } else if (meta.hasOwner()) {
file.set("panels." + panelName + ".item." + i + ".material", "cps= " + plugin.customHeads.getHeadBase64(cont)); //check for skull owner
} else if (meta.hasOwner()) { file.set("panels." + panelName + ".item." + i + ".material", "cps= " + meta.getOwner());
//check for skull owner
file.set("panels." + panelName + ".item." + i + ".material", "cps= " + meta.getOwner());
}
} }
} }
} }

View File

@ -55,6 +55,9 @@ public class EditorUserInput implements Listener {
} }
} catch (Exception fail) { } catch (Exception fail) {
//could not fetch all panel names (probably no panels exist) //could not fetch all panel names (probably no panels exist)
plugin.debug(fail);
plugin.editorInputStrings.remove(temp);
return;
} }
if(e.getMessage().equalsIgnoreCase(plugin.config.getString("config.input-cancel"))){ if(e.getMessage().equalsIgnoreCase(plugin.config.getString("config.input-cancel"))){
plugin.editorInputStrings.remove(temp); plugin.editorInputStrings.remove(temp);
@ -62,6 +65,7 @@ public class EditorUserInput implements Listener {
e.getPlayer().sendMessage(plugin.papi( Objects.requireNonNull(plugin.config.getString("config.input-cancelled")))); e.getPlayer().sendMessage(plugin.papi( Objects.requireNonNull(plugin.config.getString("config.input-cancelled"))));
return; return;
} }
plugin.editorInputStrings.remove(temp);
if(section.startsWith("panel.")) { if(section.startsWith("panel.")) {
panelSectionCheck(p, section, panelName, panelTitle, cf, cfile, panelFile, e); panelSectionCheck(p, section, panelName, panelTitle, cf, cfile, panelFile, e);
}else if(section.startsWith("item:")){ }else if(section.startsWith("item:")){
@ -69,7 +73,6 @@ public class EditorUserInput implements Listener {
}else if(section.startsWith("section.")){ }else if(section.startsWith("section.")){
itemSectionSectionCheck(p, section, panelName, cf, cfile, panelFile, e); itemSectionSectionCheck(p, section, panelName, cf, cfile, panelFile, e);
} }
plugin.editorInputStrings.remove(temp);
plugin.reloadPanelFiles(); plugin.reloadPanelFiles();
if(section.startsWith("panel.")){ if(section.startsWith("panel.")){
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() { plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {

View File

@ -8,6 +8,7 @@ import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory; import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.SkullMeta;
import java.util.Iterator; import java.util.Iterator;
import java.util.Objects; import java.util.Objects;