From 8cacedb6cc256ccf6982a259d979c8e823d018fa Mon Sep 17 00:00:00 2001 From: Brady Date: Thu, 15 Aug 2019 17:45:30 +0000 Subject: [PATCH] Redesign for Island CP, Added Island Lock and Upgrades to CP --- .../skyblock/menus/ControlPanel.java | 57 ++++++++++++++----- .../Core/src/main/resources/language.yml | 14 +++++ gradle/wrapper/gradle-wrapper.properties | 3 +- gradlew | 22 ++++++- gradlew.bat | 18 +++++- 5 files changed, 93 insertions(+), 21 deletions(-) diff --git a/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/ControlPanel.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/ControlPanel.java index 6a2ca753..16c96043 100644 --- a/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/ControlPanel.java +++ b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/ControlPanel.java @@ -2,6 +2,7 @@ package me.goodandevil.skyblock.menus; import java.io.File; +import me.goodandevil.skyblock.island.Island; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Material; @@ -32,6 +33,7 @@ public class ControlPanel { public void open(Player player) { SkyBlock skyblock = SkyBlock.getInstance(); + Island island = skyblock.getIslandManager().getIsland(player); Config config = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")); FileConfiguration configLoad = config.getFileConfiguration(); @@ -43,6 +45,14 @@ public class ControlPanel { && (is.getItemMeta().getDisplayName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.ControlPanel.Item.Teleport.Displayname"))))) { Bukkit.getServer().getScheduler().runTaskLater(skyblock, () -> Bukkit.getServer().dispatchCommand(player, "island teleport"), 1L); + } else if ((is.getType() == Materials.IRON_DOOR.parseMaterial()) && (is.hasItemMeta()) + && (is.getItemMeta().getDisplayName().equals(ChatColor.translateAlternateColorCodes('&', + configLoad.getString("Menu.ControlPanel.Item.Lock.Displayname"))))) { + if (island.isOpen()) { + Bukkit.getServer().getScheduler().runTaskLater(skyblock, () -> Bukkit.getServer().dispatchCommand(player, "island close"), 1L); + } else { + Bukkit.getServer().getScheduler().runTaskLater(skyblock, () -> Bukkit.getServer().dispatchCommand(player, "island open"), 1L); + } } else if ((is.getType() == Materials.BLACK_STAINED_GLASS_PANE.parseMaterial()) && (is.hasItemMeta()) && (is.getItemMeta().getDisplayName().equals(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.ControlPanel.Item.Barrier.Displayname"))))) { @@ -76,41 +86,58 @@ public class ControlPanel { Bukkit.getServer().getScheduler().runTaskLater(skyblock, () -> Bukkit.getServer().dispatchCommand(player, "island bans"), 1L); } else if ((is.getType() == Materials.OAK_SIGN.parseMaterial()) && (is.hasItemMeta()) && (is.getItemMeta().getDisplayName().equals(ChatColor.translateAlternateColorCodes('&', - configLoad.getString("Menu.ControlPanel.Item.Visitors.Displayname"))))) { + configLoad.getString("Menu.ControlPanel.Item.Visitors.Displayname"))))) { Bukkit.getServer().getScheduler().runTaskLater(skyblock, () -> Bukkit.getServer().dispatchCommand(player, "island visitors"), 1L); + } else if ((is.getType() == Materials.ANVIL.parseMaterial()) && (is.hasItemMeta()) + && (is.getItemMeta().getDisplayName().equals(ChatColor.translateAlternateColorCodes('&', + configLoad.getString("Menu.ControlPanel.Item.Upgrades.Displayname"))))) { + Bukkit.getServer().getScheduler().runTaskLater(skyblock, () -> Bukkit.getServer().dispatchCommand(player, "island upgrades"), 1L); } }); + // Teleport to island and open/close island nInv.addItem(nInv.createItem(Materials.OAK_DOOR.parseItem(), configLoad.getString("Menu.ControlPanel.Item.Teleport.Displayname"), - configLoad.getStringList("Menu.ControlPanel.Item.Teleport.Lore"), null, null, null), 0); + configLoad.getStringList("Menu.ControlPanel.Item.Teleport.Lore"), null, null, null), 1); + nInv.addItem(nInv.createItem(Materials.IRON_DOOR.parseItem(), + configLoad.getString("Menu.ControlPanel.Item.Lock.Displayname"), + configLoad.getStringList("Menu.ControlPanel.Item.Lock.Lore"), null, null, null), 10); + + // Glass panes barriers nInv.addItem(nInv.createItem(Materials.BLACK_STAINED_GLASS_PANE.parseItem(), - configLoad.getString("Menu.ControlPanel.Item.Barrier.Displayname"), null, null, null, null), 1); + configLoad.getString("Menu.ControlPanel.Item.Barrier.Displayname"), null, null, null, null), 0, 2, 5, 8, 9, 11, 14, 17); + + // 4 Items at the left nInv.addItem(nInv.createItem(new ItemStack(Materials.EXPERIENCE_BOTTLE.parseMaterial()), configLoad.getString("Menu.ControlPanel.Item.Level.Displayname"), - configLoad.getStringList("Menu.ControlPanel.Item.Level.Lore"), null, null, null), 2); + configLoad.getStringList("Menu.ControlPanel.Item.Level.Lore"), null, null, null), 3); nInv.addItem(nInv.createItem(new ItemStack(Material.NAME_TAG), configLoad.getString("Menu.ControlPanel.Item.Settings.Displayname"), - configLoad.getStringList("Menu.ControlPanel.Item.Settings.Lore"), null, null, null), 3); - nInv.addItem(nInv.createItem(new ItemStack(Material.ITEM_FRAME), - configLoad.getString("Menu.ControlPanel.Item.Members.Displayname"), - configLoad.getStringList("Menu.ControlPanel.Item.Members.Lore"), null, null, null), 4); - nInv.addItem(nInv.createItem(Materials.OAK_SAPLING.parseItem(), - configLoad.getString("Menu.ControlPanel.Item.Biome.Displayname"), - configLoad.getStringList("Menu.ControlPanel.Item.Biome.Lore"), null, null, null), 5); + configLoad.getStringList("Menu.ControlPanel.Item.Settings.Lore"), null, null, null), 4); nInv.addItem(nInv.createItem(Materials.CLOCK.parseItem(), configLoad.getString("Menu.ControlPanel.Item.Weather.Displayname"), - configLoad.getStringList("Menu.ControlPanel.Item.Weather.Lore"), null, null, null), 6); + configLoad.getStringList("Menu.ControlPanel.Item.Weather.Lore"), null, null, null), 12); + nInv.addItem(nInv.createItem(Materials.OAK_SAPLING.parseItem(), + configLoad.getString("Menu.ControlPanel.Item.Biome.Displayname"), + configLoad.getStringList("Menu.ControlPanel.Item.Biome.Lore"), null, null, null), 13); + + // 4 Items at the right + nInv.addItem(nInv.createItem(new ItemStack(Material.ITEM_FRAME), + configLoad.getString("Menu.ControlPanel.Item.Members.Displayname"), + configLoad.getStringList("Menu.ControlPanel.Item.Members.Lore"), null, null, null), 16); nInv.addItem(nInv.createItem(new ItemStack(Material.IRON_AXE), configLoad.getString("Menu.ControlPanel.Item.Bans.Displayname"), configLoad.getStringList("Menu.ControlPanel.Item.Bans.Lore"), null, null, - new ItemFlag[] { ItemFlag.HIDE_ATTRIBUTES }), 7); + new ItemFlag[] { ItemFlag.HIDE_ATTRIBUTES }), 6); nInv.addItem(nInv.createItem(new ItemStack(Materials.OAK_SIGN.parseMaterial()), configLoad.getString("Menu.ControlPanel.Item.Visitors.Displayname"), - configLoad.getStringList("Menu.ControlPanel.Item.Visitors.Lore"), null, null, null), 8); + configLoad.getStringList("Menu.ControlPanel.Item.Visitors.Lore"), null, null, null), 7); + nInv.addItem(nInv.createItem(new ItemStack(Materials.ANVIL.parseMaterial()), + configLoad.getString("Menu.ControlPanel.Item.Upgrades.Displayname"), + configLoad.getStringList("Menu.ControlPanel.Item.Upgrades.Lore"), null, null, null), 15); nInv.setTitle(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Menu.ControlPanel.Title"))); - nInv.setRows(1); + nInv.setRows(2); Bukkit.getServer().getScheduler().runTask(skyblock, () -> nInv.open()); } diff --git a/FabledSkyBlock/Core/src/main/resources/language.yml b/FabledSkyBlock/Core/src/main/resources/language.yml index ff2e0f20..4254d550 100644 --- a/FabledSkyBlock/Core/src/main/resources/language.yml +++ b/FabledSkyBlock/Core/src/main/resources/language.yml @@ -2147,6 +2147,20 @@ Menu: - '' - '&eClick to view Island Visitors!' Displayname: '&aIsland Visitors' + Upgrades: + Displayname: '&aIsland Upgrades' + Lore: + - '&7[&f!&7] Upgrade your island' + - ' &7and unlock amazing perks' + - '' + - '&eClick to view Island Upgrades!' + Lock: + Displayname: '&aIsland Lock' + Lore: + - '&7[&f!&7] Open or close your' + - ' &7island for visitors' + - '' + - '&eClick to open/close your Island!' Barrier: Displayname: '&cIsland Control Panel' Title: '&8Island Control Panel' diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ed8973d9..ef9a9e05 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Wed Jun 05 03:45:54 MDT 2019 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip diff --git a/gradlew b/gradlew index af6708ff..83f2acfd 100644 --- a/gradlew +++ b/gradlew @@ -1,5 +1,21 @@ #!/usr/bin/env sh +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + ############################################################################## ## ## Gradle start up script for UN*X @@ -28,7 +44,7 @@ APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m"' +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" @@ -109,8 +125,8 @@ if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` JAVACMD=`cygpath --unix "$JAVACMD"` diff --git a/gradlew.bat b/gradlew.bat index 6d57edc7..9618d8d9 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,3 +1,19 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + @if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem @@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome