Merge remote-tracking branch 'origin/development' into development

This commit is contained in:
Esophose 2019-08-17 11:24:08 -06:00
commit c07aacf676
5 changed files with 93 additions and 21 deletions

View File

@ -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());
}

View File

@ -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'

View File

@ -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

22
gradlew vendored
View File

@ -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"`

18
gradlew.bat vendored
View File

@ -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