From 2399e68c67bd223261d30bb8807c86af3fabf838 Mon Sep 17 00:00:00 2001 From: Brianna Date: Sat, 6 Jun 2020 19:30:13 -0500 Subject: [PATCH 1/6] Removed some universally incompatible mobs. --- src/main/resources/challenges.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/main/resources/challenges.yml b/src/main/resources/challenges.yml index 658227eb..0a23f691 100644 --- a/src/main/resources/challenges.yml +++ b/src/main/resources/challenges.yml @@ -1681,7 +1681,6 @@ challenges: require: - 'NEAR:CHICKEN 1' - 'NEAR:COW 1' - - 'NEAR:POLAR_BEAR 1' - 'NEAR:RABBIT 1' - 'NEAR:WOLF 1' - 'NEAR:DONKEY 1' @@ -1690,7 +1689,6 @@ challenges: - 'NEAR:OCELOT 1' - 'NEAR:MUSHROOM_COW 1' - 'NEAR:SHEEP 1' - - 'NEAR:PARROT 1' - 'NEAR:VILLAGER 1' - 'NEAR:SKELETON_HORSE 1' reward: @@ -1709,7 +1707,6 @@ challenges: - '&e- within a radius of 30 blocks:' - '&e - 1 Chicken' - '&e - 1 Cow' - - '&e - 1 Polar Bear' - '&e - 1 Rabbit' - '&e - 1 Wolf' - '&e - 1 Donkey' @@ -1718,7 +1715,6 @@ challenges: - '&e - 1 Ocelot' - '&e - 1 Mooshroom cow' - '&e - 1 Sheep' - - '&e - 1 Parrot' - '&e - 1 Villager' - '&e - 1 Skeleton Horse' - '&c&lRewards:' From df87a4aa7f794d11f2148c12e904360ec2b514a1 Mon Sep 17 00:00:00 2001 From: Brianna Date: Sat, 6 Jun 2020 19:32:31 -0500 Subject: [PATCH 2/6] Null check. --- src/main/java/com/songoda/skyblock/island/IslandManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/songoda/skyblock/island/IslandManager.java b/src/main/java/com/songoda/skyblock/island/IslandManager.java index b0c4bd3a..ae438242 100644 --- a/src/main/java/com/songoda/skyblock/island/IslandManager.java +++ b/src/main/java/com/songoda/skyblock/island/IslandManager.java @@ -215,7 +215,8 @@ public class IslandManager { return false; } - data.setIslandCreationCount(amt + 1); + if (data != null) + data.setIslandCreationCount(amt + 1); Island island = new Island(player); island.setStructure(structure.getName()); From f28ce8be5f9fdd23ec78bd001e17603042a33766 Mon Sep 17 00:00:00 2001 From: Brianna Date: Sun, 7 Jun 2020 09:30:47 -0500 Subject: [PATCH 3/6] Added the ability to set a skyblock worlds difficulty. --- .../java/com/songoda/skyblock/world/WorldManager.java | 9 +++++++++ src/main/resources/config.yml | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/src/main/java/com/songoda/skyblock/world/WorldManager.java b/src/main/java/com/songoda/skyblock/world/WorldManager.java index 315a30f8..ec140252 100644 --- a/src/main/java/com/songoda/skyblock/world/WorldManager.java +++ b/src/main/java/com/songoda/skyblock/world/WorldManager.java @@ -63,6 +63,15 @@ public class WorldManager { Bukkit.getServer().getScheduler().runTask(skyblock, () -> registerMultiverse(endWorldName, endWorldEnvironment)); } + + if (normalWorld != null) + normalWorld.setDifficulty(Difficulty.valueOf(configLoad.getString("Island.World.Normal.Difficulty"))); + + if (netherWorld != null) + netherWorld.setDifficulty(Difficulty.valueOf(configLoad.getString("Island.World.Nether.Difficulty"))); + + if (endWorld != null) + endWorld.setDifficulty(Difficulty.valueOf(configLoad.getString("Island.World.End.Difficulty"))); } public void registerMultiverse(String worldName, World.Environment environment) { diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index afc234c9..730e3cff 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -41,10 +41,12 @@ Island: # If lava disabled, the world will be a water world. # -1 to disable Nether and End unlock prices. # Valid Environments: NORMAL, NETHER, THE_END + # Valid Difficulties: PEACEFUL, EASY, NORMAL, HARD Normal: Name: "island_normal_world" IslandSpawnHeight: 72 Environment: NORMAL + Difficulty: NORMAL Liquid: Enable: false Lava: false @@ -55,6 +57,7 @@ Island: Environment: NETHER UnlockPrice: 10000 Enable: true + Difficulty: NORMAL Liquid: Enable: false Lava: true @@ -65,6 +68,7 @@ Island: Environment: THE_END UnlockPrice: 50000 Enable: true + Difficulty: NORMAL Liquid: Enable: false Lava: false From b54b063c9cb4a61679a0c7f8548f3f8e04de9845 Mon Sep 17 00:00:00 2001 From: Brianna Date: Sun, 7 Jun 2020 09:11:16 -0500 Subject: [PATCH 4/6] Not sure who designed this like this but whatever. --- src/main/java/com/songoda/skyblock/island/IslandManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/songoda/skyblock/island/IslandManager.java b/src/main/java/com/songoda/skyblock/island/IslandManager.java index ae438242..1577302e 100644 --- a/src/main/java/com/songoda/skyblock/island/IslandManager.java +++ b/src/main/java/com/songoda/skyblock/island/IslandManager.java @@ -812,7 +812,7 @@ public class IslandManager { scoreboard.run(); } - } catch (IllegalPluginAccessException e) { + } catch (Exception e) { } } From b0cd0c538826a90ec9c802d9ca884492e50423b9 Mon Sep 17 00:00:00 2001 From: Brianna Date: Sun, 7 Jun 2020 09:53:04 -0500 Subject: [PATCH 5/6] Added keys. I'm not sure why I did this to begin with. --- .../skyblock/permission/PermissionManager.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/songoda/skyblock/permission/PermissionManager.java b/src/main/java/com/songoda/skyblock/permission/PermissionManager.java index adc4617a..558a71df 100644 --- a/src/main/java/com/songoda/skyblock/permission/PermissionManager.java +++ b/src/main/java/com/songoda/skyblock/permission/PermissionManager.java @@ -20,7 +20,7 @@ public class PermissionManager { private final SkyBlock plugin; - private final List registeredPermissions = new ArrayList<>(); + private final Map registeredPermissions = new HashMap<>(); private List registeredHandlers = new LinkedList<>(); public PermissionManager(SkyBlock plugin) { @@ -109,7 +109,7 @@ public class PermissionManager { } public boolean registerPermission(BasicPermission permission) { - registeredPermissions.add(permission); + registeredPermissions.put(permission.getName().toUpperCase(), permission); Set methods; try { Method[] publicMethods = permission.getClass().getMethods(); @@ -198,17 +198,15 @@ public class PermissionManager { } public BasicPermission getPermission(String permissionName) { - return registeredPermissions.stream() - .filter(p -> p.getName().equalsIgnoreCase(permissionName)) - .findFirst().orElse(null); + return registeredPermissions.get(permissionName.toUpperCase()); } public List getPermissions() { - return new ArrayList<>(registeredPermissions); + return new ArrayList<>(registeredPermissions.values()); } public List getListeningPermissions() { - return registeredPermissions.stream() + return registeredPermissions.values().stream() .filter(p -> p instanceof ListeningPermission) .map(p -> (ListeningPermission) p) .collect(Collectors.toList()); From f33ea6f47353c1d74a5aa11469f011db8c465b46 Mon Sep 17 00:00:00 2001 From: Brianna Date: Sun, 7 Jun 2020 09:14:44 -0500 Subject: [PATCH 6/6] version 2.2.15 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3deb6d95..33df1295 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 com.songoda skyblock - 2.2.14 + 2.2.15 jar clean install