diff --git a/README.md b/README.md
index 185535e5..d3fa8d7b 100644
--- a/README.md
+++ b/README.md
@@ -48,10 +48,10 @@ If you want to learn how to use DungeonsXL step by step, please have a look at t
## Compatibility
### Server
-DungeonsXL works with 1.7.8 and higher. However, support for 1.11.x / 1.10.x / 1.9.x has a higher priority than support for 1.8.x and lower. See [here](../../wiki/legacy-support) for detailed information. Some cosmetic features require the Spigot API and will therefore not work with CraftBukkit.
+DungeonsXL works with 1.7.8 and higher. However, support for 1.12 / 1.11.x / 1.10.x / 1.9.x has a higher priority than support for 1.8.x and lower. See [here](../../wiki/legacy-support) for detailed information. Some cosmetic features require the Spigot API and will therefore not work with CraftBukkit.
Older versions of DungeonsXL support versions since Minecraft 1.3.x, but of course, they are completely unsupported.
-* [1.7.8-1.11.2](../../tree/master)
+* [1.7.8-1.12](../../tree/master)
* [1.7.5](../../tree/50f772d14281bfe278dba2559d1758cc459c1a30)
* [1.7.2](../../tree/eccf82b7335dfb0723e3cd37a57df1a968ea7842)
* [1.6.4](../../tree/780145cf783ea76fe1bfee04cf89216bd4f92e1d)
@@ -67,14 +67,11 @@ Older versions of DungeonsXL support versions since Minecraft 1.3.x, but of cour
Building DungeonsXL from source requires [Apache Maven](https://maven.apache.org/).
Maven automatically fetches all dependencies and builds DungeonsXL; just run _build.bat_ or enter the command _mvn clean install_.
-#### BRCommons
-[BRCommons](https://github.com/DRE2N/BRCommons) is a util library for common tasks. DungeonsXL contains BRCommons 1.0.6.
+#### DRECommons
+[DRECommons](https://github.com/DRE2N/DRECommons) is a util library for common tasks. DungeonsXL contains BRCommons 3.1.1.
#### Caliburn API
-[Caliburn](https://github.com/DRE2N/CaliburnAPI) is an API to read custom items and mobs from config files. DungeonsXL contains Caliburn Beta 0.2.3.
-
-#### ResourcePackAPI
-inventivetalent's [ResourcePackAPI](https://www.spigotmc.org/resources/api-resourcepackapi-1-7-1-8-1-9-1-10.2397/) is an API to set the resourcepack of a player. DungeonsXL contains ResourcePackAPI 2.2.1.
+[Caliburn](https://github.com/DRE2N/CaliburnAPI) is an API to read custom items and mobs from config files. DungeonsXL contains Caliburn Beta 0.3.
### Java
Make sure that your server uses Java 7 or higher.
diff --git a/abstract/pom.xml b/abstract/pom.xml
deleted file mode 100644
index 7374fd7b..00000000
--- a/abstract/pom.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
- 4.0.0
- io.github.dre2n
- dungeonsxl-abstract
- ${parent.version}
- jar
- dungeonsxl-abstract
-
- io.github.dre2n
- dungeonsxl
- 0.15.7-SNAPSHOT
-
-
diff --git a/abstract/src/main/java/io/github/dre2n/dungeonsxl/util/worldloader/InternalsProvider.java b/abstract/src/main/java/io/github/dre2n/dungeonsxl/util/worldloader/InternalsProvider.java
deleted file mode 100644
index a192dd12..00000000
--- a/abstract/src/main/java/io/github/dre2n/dungeonsxl/util/worldloader/InternalsProvider.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (C) 2012-2017 Frank Baumann
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package io.github.dre2n.dungeonsxl.util.worldloader;
-
-import org.bukkit.World;
-import org.bukkit.WorldCreator;
-
-/**
- * @author Daniel Saukel
- */
-public abstract class InternalsProvider {
-
- abstract World createWorld(WorldCreator creator);
-
-}
diff --git a/core/pom.xml b/core/pom.xml
deleted file mode 100644
index 5812cc80..00000000
--- a/core/pom.xml
+++ /dev/null
@@ -1,72 +0,0 @@
-
- 4.0.0
- io.github.dre2n
- dungeonsxl-core
- ${parent.version}
- jar
- dungeonsxl-core
-
- io.github.dre2n
- dungeonsxl
- 0.15.7-SNAPSHOT
-
-
-
-
- .
- true
- src/main/resources/
-
- plugin.yml
-
-
-
-
-
- maven-compiler-plugin
- 2.5.1
-
- 1.7
- 1.7
-
-
-
-
-
-
- io.github.dre2n
- dungeonsxl-abstract
- ${parent.version}
- jar
- compile
-
-
- io.github.dre2n
- dungeonsxl-craftbukkit_1_11_R1
- ${parent.version}
- jar
- compile
-
-
- io.github.dre2n
- dungeonsxl-craftbukkit_1_10_R1
- ${parent.version}
- jar
- compile
-
-
- io.github.dre2n
- dungeonsxl-craftbukkit_1_9_R2
- ${parent.version}
- jar
- compile
-
-
- io.github.dre2n
- dungeonsxl-craftbukkit_1_9_R1
- ${parent.version}
- jar
- compile
-
-
-
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/util/worldloader/WorldLoader.java b/core/src/main/java/io/github/dre2n/dungeonsxl/util/worldloader/WorldLoader.java
deleted file mode 100644
index dc49d5f6..00000000
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/util/worldloader/WorldLoader.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2012-2017 Frank Baumann
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package io.github.dre2n.dungeonsxl.util.worldloader;
-
-import io.github.dre2n.commons.compatibility.CompatibilityHandler;
-import org.bukkit.World;
-import org.bukkit.WorldCreator;
-
-/**
- * A custom thread safe world loader.
- *
- * @author Daniel Saukel
- */
-public class WorldLoader {
-
- static InternalsProvider internals;
-
- static {
- switch (CompatibilityHandler.getInstance().getInternals()) {
- case v1_11_R1:
- internals = new v1_11_R1();
- break;
- case v1_10_R1:
- internals = new v1_10_R1();
- break;
- case v1_9_R2:
- internals = new v1_9_R2();
- break;
- case v1_9_R1:
- internals = new v1_9_R1();
- break;
- }
- }
-
- /**
- * @param creator
- * the WorldCreator which stores the information to create the new world
- * @return
- * the new World
- */
- public static World createWorld(WorldCreator creator) {
- return internals.createWorld(creator);
- }
-
-}
diff --git a/core/src/test/java/io/github/dre2n/dungeonsxl/DXLTest.java b/core/src/test/java/io/github/dre2n/dungeonsxl/DXLTest.java
deleted file mode 100644
index 642125bb..00000000
--- a/core/src/test/java/io/github/dre2n/dungeonsxl/DXLTest.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (C) 2016 Daniel Saukel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package io.github.dre2n.dungeonsxl;
-
-import io.github.dre2n.dungeonsxl.command.CustomCommand;
-import io.github.dre2n.dungeonsxl.game.CustomGameType;
-import io.github.dre2n.dungeonsxl.global.ChestProtection;
-import io.github.dre2n.dungeonsxl.listener.*;
-import io.github.dre2n.dungeonsxl.requirement.RequirementTypeCustom;
-import io.github.dre2n.dungeonsxl.reward.RewardTypeCustom;
-import io.github.dre2n.dungeonsxl.sign.DSignTypeCustom;
-import io.github.dre2n.dungeonsxl.trigger.TriggerTypeCustom;
-import org.bukkit.Bukkit;
-import org.bukkit.plugin.java.JavaPlugin;
-
-/**
- * @author Daniel Saukel
- */
-public class DXLTest extends JavaPlugin {
-
- @Override
- public void onEnable() {
- // This is how you register /dxl subcommands.
- DungeonsXL.getInstance().getCommands().addCommand(new CustomCommand());
-
- // Register the DungeonsXL events just like any Bukkit event.
- getServer().getPluginManager().registerEvents(new DGroupListener(), this);
- getServer().getPluginManager().registerEvents(new DMobListener(), this);
- getServer().getPluginManager().registerEvents(new DPlayerListener(), this);
- getServer().getPluginManager().registerEvents(new DSignListener(), this);
- getServer().getPluginManager().registerEvents(new EditWorldListener(), this);
- getServer().getPluginManager().registerEvents(new GameWorldListener(), this);
- getServer().getPluginManager().registerEvents(new RequirementListener(), this);
- getServer().getPluginManager().registerEvents(new RewardListener(), this);
- getServer().getPluginManager().registerEvents(new TriggerListener(), this);
-
- // Register the custom game type
- DungeonsXL.getInstance().getGameTypes().addGameType(CustomGameType.GHOST);
-
- // There is currently no persistence API for loading the custom global protection :(
- // New instances get added to the protections, anyways.
- new ChestProtection(Bukkit.getWorlds().get(0).getBlockAt(0, 0, 0));
-
- // Register the custom requirement type
- DungeonsXL.getInstance().getRequirementTypes().addRequirement(RequirementTypeCustom.AWESOMENESS);
-
- // Register the custom reward type
- DungeonsXL.getInstance().getRewardTypes().addReward(RewardTypeCustom.HIGHWAY_TO_HELL);
-
- // Register the custom edit Signs
- DungeonsXL.getInstance().getDSigns().addDSign(DSignTypeCustom.CUSTOM);
-
- // Register the custom trigger
- DungeonsXL.getInstance().getTriggers().addTrigger(TriggerTypeCustom.CUSTOM);
- }
-
-}
diff --git a/core/src/test/java/io/github/dre2n/dungeonsxl/command/CustomCommand.java b/core/src/test/java/io/github/dre2n/dungeonsxl/command/CustomCommand.java
deleted file mode 100644
index fa954c28..00000000
--- a/core/src/test/java/io/github/dre2n/dungeonsxl/command/CustomCommand.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2016 Daniel Saukel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package io.github.dre2n.dungeonsxl.command;
-
-import io.github.dre2n.commons.command.BRCommand;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
-import org.bukkit.command.CommandSender;
-
-/**
- * @author Daniel Saukel
- */
-public class CustomCommand extends BRCommand {
-
- public CustomCommand() {
- setCommand("custom");
- setMinArgs(0);
- setMaxArgs(0);
- setHelp("help pages message");
- setPermission("permission.node");
- setPlayerCommand(true);
- setConsoleCommand(true);
- }
-
- @Override
- public void onExecute(String[] args, CommandSender sender) {
- MessageUtil.sendMessage(sender, "This is a custom DXL command.");
- }
-
-}
diff --git a/core/src/test/java/io/github/dre2n/dungeonsxl/game/CustomGameType.java b/core/src/test/java/io/github/dre2n/dungeonsxl/game/CustomGameType.java
deleted file mode 100644
index cddd9218..00000000
--- a/core/src/test/java/io/github/dre2n/dungeonsxl/game/CustomGameType.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Copyright (C) 2016 Daniel Saukel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package io.github.dre2n.dungeonsxl.game;
-
-import org.bukkit.GameMode;
-
-/**
- * @author Daniel Saukel
- */
-public enum CustomGameType implements GameType {
-
- GHOST("My awesome game type", "Identifier", GameGoal.HIGHSCORE, false, false, false, false, false, false, false, GameMode.SPECTATOR, false);
-
- private String displayName;
- private String signName;
- private GameGoal gameGoal;
- private Boolean playerVersusPlayer;
- private Boolean friendlyFire;
- private Boolean rewards;
- private Boolean showTime;
- private Boolean breakBlocks;
- private Boolean breakPlacedBlocks;
- private Boolean placeBlocks;
- private GameMode gameMode;
- private Boolean lives;
-
- CustomGameType(String displayName, String signName, GameGoal gameGoal, Boolean playerVersusPlayer, Boolean friendlyFire, Boolean rewards,
- Boolean showTime, Boolean breakBlocks, Boolean breakPlacedBlocks, Boolean placeBlocks, GameMode gameMode, Boolean lives) {
- this.displayName = displayName;
- this.signName = signName;
- this.gameGoal = gameGoal;
- this.playerVersusPlayer = playerVersusPlayer;
- this.friendlyFire = friendlyFire;
- this.rewards = rewards;
- this.showTime = showTime;
- this.breakBlocks = breakBlocks;
- this.breakPlacedBlocks = breakPlacedBlocks;
- this.placeBlocks = placeBlocks;
- this.gameMode = gameMode;
- this.lives = lives;
- }
-
- @Override
- public GameGoal getGameGoal() {
- return gameGoal;
- }
-
- @Override
- public void setGameGoal(GameGoal gameGoal) {
- this.gameGoal = gameGoal;
- }
-
- @Override
- public String getDisplayName() {
- return displayName;
- }
-
- @Override
- public void setDisplayName(String displayName) {
- this.displayName = displayName;
- }
-
- @Override
- public String getSignName() {
- return signName;
- }
-
- @Override
- public void setSignName(String signName) {
- this.signName = signName;
- }
-
- @Override
- public Boolean isPlayerVersusPlayer() {
- return playerVersusPlayer;
- }
-
- @Override
- public void setPlayerVersusPlayer(Boolean playerVersusPlayer) {
- this.playerVersusPlayer = playerVersusPlayer;
- }
-
- @Override
- public Boolean isFriendlyFire() {
- return friendlyFire;
- }
-
- @Override
- public void setFriendlyFire(Boolean friendlyFire) {
- this.friendlyFire = friendlyFire;
- }
-
- @Override
- public Boolean hasRewards() {
- return rewards;
- }
-
- @Override
- public void setRewards(Boolean rewards) {
- this.rewards = rewards;
- }
-
- @Override
- public Boolean getShowTime() {
- return showTime;
- }
-
- @Override
- public void setShowTime(Boolean showTime) {
- this.showTime = showTime;
- }
-
- @Override
- public Boolean canBreakBlocks() {
- return breakBlocks;
- }
-
- @Override
- public void setBreakBlocks(Boolean breakBlocks) {
- this.breakBlocks = breakBlocks;
- }
-
- @Override
- public Boolean canBreakPlacedBlocks() {
- return breakPlacedBlocks;
- }
-
- @Override
- public void setBreakPlacedBlocks(Boolean breakPlacedBlocks) {
- this.breakPlacedBlocks = breakPlacedBlocks;
- }
-
- @Override
- public Boolean canPlaceBlocks() {
- return placeBlocks;
- }
-
- @Override
- public void setPlaceBlocks(Boolean placeBlocks) {
- this.placeBlocks = placeBlocks;
- }
-
- @Override
- public GameMode getGameMode() {
- return gameMode;
- }
-
- @Override
- public void setGameMode(GameMode gameMode) {
- this.gameMode = gameMode;
- }
-
- @Override
- public Boolean hasLives() {
- return lives;
- }
-
- @Override
- public void setLives(Boolean lives) {
- this.lives = lives;
- }
-
-}
diff --git a/core/src/test/java/io/github/dre2n/dungeonsxl/global/ChestProtection.java b/core/src/test/java/io/github/dre2n/dungeonsxl/global/ChestProtection.java
deleted file mode 100644
index edafd20a..00000000
--- a/core/src/test/java/io/github/dre2n/dungeonsxl/global/ChestProtection.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2016 Daniel Saukel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package io.github.dre2n.dungeonsxl.global;
-
-import io.github.dre2n.dungeonsxl.DungeonsXL;
-import java.util.Arrays;
-import java.util.Collection;
-import org.bukkit.block.Block;
-import org.bukkit.configuration.file.FileConfiguration;
-
-/**
- * @author Daniel Saukel
- */
-public class ChestProtection extends GlobalProtection {
-
- private Block chest;
-
- public ChestProtection(Block chest) {
- super(chest.getWorld(), DungeonsXL.getInstance().getGlobalProtections().generateId(ChestProtection.class, chest.getWorld()));
- this.chest = chest;
- }
-
- @Override
- public void save(FileConfiguration config) {
- String preString = "protections.chests." + getWorld().getName() + "." + getId();
-
- config.set(preString + ".x", chest.getX());
- config.set(preString + ".y", chest.getY());
- config.set(preString + ".z", chest.getZ());
- }
-
- @Override
- public Collection getBlocks() {
- return Arrays.asList(chest);
- }
-
-}
diff --git a/core/src/test/java/io/github/dre2n/dungeonsxl/listener/DGroupListener.java b/core/src/test/java/io/github/dre2n/dungeonsxl/listener/DGroupListener.java
deleted file mode 100644
index 3e3c1c90..00000000
--- a/core/src/test/java/io/github/dre2n/dungeonsxl/listener/DGroupListener.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (C) 2016 Daniel Saukel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package io.github.dre2n.dungeonsxl.listener;
-
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
-import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.event.dgroup.*;
-import io.github.dre2n.dungeonsxl.reward.HighwayToHellReward;
-import io.github.dre2n.dungeonsxl.reward.Reward;
-import io.github.dre2n.dungeonsxl.reward.RewardTypeCustom;
-import org.bukkit.entity.Player;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.Listener;
-
-/**
- * @author Daniel Saukel
- */
-public class DGroupListener implements Listener {
-
- DungeonsXL plugin = DungeonsXL.getInstance();
-
- @EventHandler
- public void onCreate(DGroupCreateEvent event) {
- MessageUtil.log(plugin, "&b== " + event.getEventName() + "==");
- MessageUtil.log(plugin, "Cause: " + event.getCause());
- MessageUtil.log(plugin, "Creator: " + event.getCreator().getName());
- }
-
- @EventHandler
- public void onDisband(DGroupDisbandEvent event) {
- MessageUtil.log(plugin, "&b== " + event.getEventName() + "==");
- MessageUtil.log(plugin, "Cause: " + event.getCause());
- MessageUtil.log(plugin, "Disbander: " + event.getDisbander().getName());
- }
-
- @EventHandler
- public void onFinishDungeon(DGroupFinishDungeonEvent event) {
- MessageUtil.log(plugin, "&b== " + event.getEventName() + "==");
-
- MessageUtil.log("Giving one " + RewardTypeCustom.HIGHWAY_TO_HELL + " to all group members!");
- Reward reward = new HighwayToHellReward();
- for (Player Player : event.getDGroup().getPlayers()) {
- reward.giveTo(Player);
- }
- }
-
- @EventHandler
- public void onStartFloor(DGroupStartFloorEvent event) {
- MessageUtil.log(plugin, "&b== " + event.getEventName() + "==");
- MessageUtil.log(plugin, "GameWorld: " + event.getGameWorld().getName());
- }
-
- @EventHandler
- public void onFinishFloor(DGroupFinishFloorEvent event) {
- MessageUtil.log(plugin, "&b== " + event.getEventName() + "==");
- MessageUtil.log(plugin, "Finished: " + event.getFinished().getName());
- MessageUtil.log(plugin, "Next: " + event.getNext());
- }
-
- @EventHandler
- public void onReward(DGroupRewardEvent event) {
- MessageUtil.log(plugin, "&b== " + event.getEventName() + "==");
- MessageUtil.log(plugin, "Rewards: " + event.getRewards());
- MessageUtil.log(plugin, "Excluded players: " + event.getExcludedPlayers());
- }
-
-}
diff --git a/core/src/test/java/io/github/dre2n/dungeonsxl/listener/DMobListener.java b/core/src/test/java/io/github/dre2n/dungeonsxl/listener/DMobListener.java
deleted file mode 100644
index ffcfd14c..00000000
--- a/core/src/test/java/io/github/dre2n/dungeonsxl/listener/DMobListener.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2016 Daniel Saukel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package io.github.dre2n.dungeonsxl.listener;
-
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
-import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.event.dmob.*;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.Listener;
-
-/**
- * @author Daniel Saukel
- */
-public class DMobListener implements Listener {
-
- DungeonsXL plugin = DungeonsXL.getInstance();
-
- @EventHandler
- public void onDeath(DMobDeathEvent event) {
- MessageUtil.log(plugin, "&b== " + event.getEventName() + "==");
- MessageUtil.log(plugin, "DMob: " + event.getDMob());
- }
-
- @EventHandler
- public void onSpawn(DMobSpawnEvent event) {
- MessageUtil.log(plugin, "&b== " + event.getEventName() + "==");
- MessageUtil.log(plugin, "DMob: " + event.getDMob());
- }
-
-}
diff --git a/core/src/test/java/io/github/dre2n/dungeonsxl/listener/DPlayerListener.java b/core/src/test/java/io/github/dre2n/dungeonsxl/listener/DPlayerListener.java
deleted file mode 100644
index 895731ea..00000000
--- a/core/src/test/java/io/github/dre2n/dungeonsxl/listener/DPlayerListener.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (C) 2016 Daniel Saukel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package io.github.dre2n.dungeonsxl.listener;
-
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
-import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.event.dplayer.*;
-import io.github.dre2n.dungeonsxl.event.dplayer.instance.edit.DEditPlayerEscapeEvent;
-import io.github.dre2n.dungeonsxl.event.dplayer.instance.game.DGamePlayerDeathEvent;
-import io.github.dre2n.dungeonsxl.event.dplayer.instance.game.DGamePlayerFinishEvent;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.Listener;
-
-/**
- * @author Daniel Saukel
- */
-public class DPlayerListener implements Listener {
-
- DungeonsXL plugin = DungeonsXL.getInstance();
-
- @EventHandler
- public void onDeath(DGamePlayerDeathEvent event) {
- MessageUtil.log(plugin, "&b== " + event.getEventName() + "==");
- MessageUtil.log(plugin, "DPlayer: " + event.getDPlayer().getPlayer().getName());
- MessageUtil.log(plugin, "Lost lives: " + event.getLostLives());
- }
-
- @EventHandler
- public void onEscape(DEditPlayerEscapeEvent event) {
- MessageUtil.log(plugin, "&b== " + event.getEventName() + "==");
- MessageUtil.log(plugin, "DPlayer: " + event.getDPlayer().getPlayer().getName());
- }
-
- @EventHandler
- public void onFinish(DGamePlayerFinishEvent event) {
- MessageUtil.log(plugin, "&b== " + event.getEventName() + "==");
- MessageUtil.log(plugin, "DPlayer: " + event.getDPlayer().getPlayer().getName());
- MessageUtil.log(plugin, "Player has to wait: " + event.getHasToWait());
- }
-
- @EventHandler
- public void onJoinDGroup(DPlayerJoinDGroupEvent event) {
- MessageUtil.log(plugin, "&b== " + event.getEventName() + "==");
- MessageUtil.log(plugin, "DPlayer: " + event.getDPlayer().getPlayer().getName());
- MessageUtil.log(plugin, "DGroup: " + event.getDGroup().getName());
- }
-
- @EventHandler
- public void onKick(DPlayerKickEvent event) {
- MessageUtil.log(plugin, "&b== " + event.getEventName() + "==");
- MessageUtil.log(plugin, "DPlayer: " + event.getDPlayer().getPlayer().getName());
- }
-
- @EventHandler
- public void onLeaveDGroup(DPlayerLeaveDGroupEvent event) {
- MessageUtil.log(plugin, "&b== " + event.getEventName() + "==");
- MessageUtil.log(plugin, "DPlayer: " + event.getDPlayer().getPlayer().getName());
- MessageUtil.log(plugin, "DGroup: " + (event.getDGroup() == null ? "" : event.getDGroup().getName()));
- }
-
- /*This would cause waaay too much console spam...
- @EventHandler
- public void onUpdate(DPlayerUpdateEvent event) {
- MessageUtil.log(plugin, "&b== " + event.getEventName() + "==");
- MessageUtil.log(plugin, "DGamePlayer: " + event.getDPlayer().getPlayer().getName());
- }*/
-}
diff --git a/core/src/test/java/io/github/dre2n/dungeonsxl/listener/DSignListener.java b/core/src/test/java/io/github/dre2n/dungeonsxl/listener/DSignListener.java
deleted file mode 100644
index 8023192f..00000000
--- a/core/src/test/java/io/github/dre2n/dungeonsxl/listener/DSignListener.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2016 Daniel Saukel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package io.github.dre2n.dungeonsxl.listener;
-
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
-import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.event.dsign.DSignRegistrationEvent;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.Listener;
-
-/**
- * @author Daniel Saukel
- */
-public class DSignListener implements Listener {
-
- DungeonsXL plugin = DungeonsXL.getInstance();
-
- @EventHandler
- public void onRegistration(DSignRegistrationEvent event) {
- MessageUtil.log(plugin, "&b== " + event.getEventName() + "==");
- MessageUtil.log(plugin, "GameWorld (ID): " + (event.getGameWorld() == null ? "" : event.getGameWorld().getId()));
- MessageUtil.log(plugin, "DSign: " + event.getDSign().getType());
- }
-
-}
diff --git a/core/src/test/java/io/github/dre2n/dungeonsxl/listener/EditWorldListener.java b/core/src/test/java/io/github/dre2n/dungeonsxl/listener/EditWorldListener.java
deleted file mode 100644
index b6f76188..00000000
--- a/core/src/test/java/io/github/dre2n/dungeonsxl/listener/EditWorldListener.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2016 Daniel Saukel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package io.github.dre2n.dungeonsxl.listener;
-
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
-import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.event.editworld.*;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.Listener;
-
-/**
- * @author Daniel Saukel
- */
-public class EditWorldListener implements Listener {
-
- DungeonsXL plugin = DungeonsXL.getInstance();
-
- @EventHandler
- public void onGenerate(EditWorldGenerateEvent event) {
- MessageUtil.log(plugin, "&b== " + event.getEventName() + "==");
- MessageUtil.log(plugin, "EditWorld (ID): " + event.getEditWorld().getId());
- }
-
- @EventHandler
- public void onLoad(EditWorldLoadEvent event) {
- MessageUtil.log(plugin, "&b== " + event.getEventName() + "==");
- MessageUtil.log(plugin, "EditWorld (name): " + event.getName());
- }
-
- @EventHandler
- public void onSave(EditWorldGenerateEvent event) {
- MessageUtil.log(plugin, "&b== " + event.getEventName() + "==");
- MessageUtil.log(plugin, "EditWorld (ID): " + event.getEditWorld().getId());
- }
-
- @EventHandler
- public void onUnload(EditWorldUnloadEvent event) {
- MessageUtil.log(plugin, "&b== " + event.getEventName() + "==");
- MessageUtil.log(plugin, "EditWorld (ID): " + event.getEditWorld().getId());
- MessageUtil.log(plugin, "Save?: " + event.getSave());
- }
-
-}
diff --git a/core/src/test/java/io/github/dre2n/dungeonsxl/listener/GameWorldListener.java b/core/src/test/java/io/github/dre2n/dungeonsxl/listener/GameWorldListener.java
deleted file mode 100644
index e947285e..00000000
--- a/core/src/test/java/io/github/dre2n/dungeonsxl/listener/GameWorldListener.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2016 Daniel Saukel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package io.github.dre2n.dungeonsxl.listener;
-
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
-import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.event.gameworld.*;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.Listener;
-
-/**
- * @author Daniel Saukel
- */
-public class GameWorldListener implements Listener {
-
- DungeonsXL plugin = DungeonsXL.getInstance();
-
- @EventHandler
- public void onLoad(GameWorldLoadEvent event) {
- MessageUtil.log(plugin, "&b== " + event.getEventName() + "==");
- MessageUtil.log(plugin, "GameWorld (name): " + event.getName());
- }
-
- @EventHandler
- public void onGenerate(GameWorldStartGameEvent event) {
- MessageUtil.log(plugin, "&b== " + event.getEventName() + "==");
- MessageUtil.log(plugin, "GameWorld (ID): " + event.getGameWorld().getId());
- MessageUtil.log(plugin, "Game: " + event.getGame());
- }
-
- @EventHandler
- public void onUnload(GameWorldUnloadEvent event) {
- MessageUtil.log(plugin, "&b== " + event.getEventName() + "==");
- MessageUtil.log(plugin, "GameWorld (ID): " + event.getGameWorld().getId());
- }
-
-}
diff --git a/core/src/test/java/io/github/dre2n/dungeonsxl/listener/RequirementListener.java b/core/src/test/java/io/github/dre2n/dungeonsxl/listener/RequirementListener.java
deleted file mode 100644
index aea6e82d..00000000
--- a/core/src/test/java/io/github/dre2n/dungeonsxl/listener/RequirementListener.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2016 Daniel Saukel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package io.github.dre2n.dungeonsxl.listener;
-
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
-import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.event.requirement.*;
-import io.github.dre2n.dungeonsxl.requirement.AwesomenessRequirement;
-import io.github.dre2n.dungeonsxl.requirement.RequirementTypeCustom;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.Listener;
-
-/**
- * @author Daniel Saukel
- */
-public class RequirementListener implements Listener {
-
- DungeonsXL plugin = DungeonsXL.getInstance();
-
- @EventHandler
- public void onCheck(RequirementCheckEvent event) {
- MessageUtil.log(plugin, "&b== " + event.getEventName() + "==");
- MessageUtil.log(plugin, "Requirement: " + event.getRequirement().getType());
- }
-
- @EventHandler
- public void onDemand(RequirementDemandEvent event) {
- MessageUtil.log(plugin, "&b== " + event.getEventName() + "==");
- MessageUtil.log(plugin, "Requirement: " + event.getRequirement().getType());
- }
-
- @EventHandler
- public void onRegistration(RequirementRegistrationEvent event) {
- MessageUtil.log(plugin, "&b== " + event.getEventName() + "==");
- MessageUtil.log(plugin, "Requirement: " + event.getRequirement().getType());
-
- if (event.getRequirement().getType() == RequirementTypeCustom.AWESOMENESS) {
- MessageUtil.log(plugin, "Registering an " + RequirementTypeCustom.AWESOMENESS + " requirement.");
- ((AwesomenessRequirement) event.getRequirement()).setAwesomenessLevel(5);
- }
- }
-
-}
diff --git a/core/src/test/java/io/github/dre2n/dungeonsxl/listener/RewardListener.java b/core/src/test/java/io/github/dre2n/dungeonsxl/listener/RewardListener.java
deleted file mode 100644
index 43942ab6..00000000
--- a/core/src/test/java/io/github/dre2n/dungeonsxl/listener/RewardListener.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2016 Daniel Saukel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package io.github.dre2n.dungeonsxl.listener;
-
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
-import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.event.reward.*;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.Listener;
-
-/**
- * @author Daniel Saukel
- */
-public class RewardListener implements Listener {
-
- DungeonsXL plugin = DungeonsXL.getInstance();
-
- @EventHandler
- public void onAddition(RewardAdditionEvent event) {
- MessageUtil.log(plugin, "&b== " + event.getEventName() + "==");
- MessageUtil.log(plugin, "Reward: " + event.getReward().getType());
- MessageUtil.log(plugin, "DGroup: " + event.getDGroup().getName());
- }
-
- @EventHandler
- public void onRegistration(RewardRegistrationEvent event) {
- MessageUtil.log(plugin, "&b== " + event.getEventName() + "==");
- MessageUtil.log(plugin, "Reward: " + event.getReward().getType());
- }
-
-}
diff --git a/core/src/test/java/io/github/dre2n/dungeonsxl/listener/TriggerListener.java b/core/src/test/java/io/github/dre2n/dungeonsxl/listener/TriggerListener.java
deleted file mode 100644
index 481094f7..00000000
--- a/core/src/test/java/io/github/dre2n/dungeonsxl/listener/TriggerListener.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2016 Daniel Saukel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package io.github.dre2n.dungeonsxl.listener;
-
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
-import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.event.trigger.TriggerActionEvent;
-import io.github.dre2n.dungeonsxl.event.trigger.TriggerRegistrationEvent;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.Listener;
-
-/**
- * @author Daniel Saukel
- */
-public class TriggerListener implements Listener {
-
- DungeonsXL plugin = DungeonsXL.getInstance();
-
- @EventHandler
- public void onAction(TriggerActionEvent event) {
- MessageUtil.log(plugin, "&b== " + event.getEventName() + "==");
- MessageUtil.log(plugin, "Trigger: " + event.getTrigger().getType());
- }
-
- @EventHandler
- public void onRegisration(TriggerRegistrationEvent event) {
- MessageUtil.log(plugin, "&b== " + event.getEventName() + "==");
- MessageUtil.log(plugin, "Trigger: " + event.getTrigger().getType());
- }
-
-}
diff --git a/core/src/test/java/io/github/dre2n/dungeonsxl/requirement/AwesomenessRequirement.java b/core/src/test/java/io/github/dre2n/dungeonsxl/requirement/AwesomenessRequirement.java
deleted file mode 100644
index 5053c3e2..00000000
--- a/core/src/test/java/io/github/dre2n/dungeonsxl/requirement/AwesomenessRequirement.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (C) 2016 Daniel Saukel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package io.github.dre2n.dungeonsxl.requirement;
-
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
-import org.bukkit.configuration.ConfigurationSection;
-import org.bukkit.entity.Player;
-
-/**
- * @author Daniel Saukel
- */
-public class AwesomenessRequirement extends Requirement {
-
- private RequirementType type = RequirementTypeCustom.AWESOMENESS;
-
- private int level;
-
- /* Getters and setters */
- /**
- * @return the awesomeness level
- */
- public int getAwesomenessLevel() {
- return level;
- }
-
- /**
- * @param level
- * the awesomeness level to set
- */
- public void setAwesomenessLevel(int level) {
- this.level = level;
- }
-
- @Override
- public RequirementType getType() {
- return type;
- }
-
- /* Actions */
- @Override
- public void setup(ConfigurationSection config) {
- this.level = config.getInt("awesomeness");
- }
-
- @Override
- public boolean check(Player player) {
- // Code that checks if the player has the requirement
- MessageUtil.sendTitleMessage(player, "&6Are you AWESOME?");
- return true;
- }
-
- @Override
- public void demand(Player player) {
- // Code that removes the requirement if it is a fee
- }
-
-}
diff --git a/core/src/test/java/io/github/dre2n/dungeonsxl/requirement/RequirementTypeCustom.java b/core/src/test/java/io/github/dre2n/dungeonsxl/requirement/RequirementTypeCustom.java
deleted file mode 100644
index a46ac744..00000000
--- a/core/src/test/java/io/github/dre2n/dungeonsxl/requirement/RequirementTypeCustom.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2016 Daniel Saukel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package io.github.dre2n.dungeonsxl.requirement;
-
-/**
- * @author Daniel Saukel
- */
-public enum RequirementTypeCustom implements RequirementType {
-
- AWESOMENESS("awesomeness", AwesomenessRequirement.class);
-
- private String identifier;
- private Class extends Requirement> handler;
-
- RequirementTypeCustom(String identifier, Class extends Requirement> handler) {
- this.identifier = identifier;
- this.handler = handler;
- }
-
- @Override
- public String getIdentifier() {
- return identifier;
- }
-
- @Override
- public Class extends Requirement> getHandler() {
- return handler;
- }
-
-}
diff --git a/core/src/test/java/io/github/dre2n/dungeonsxl/reward/HighwayToHellReward.java b/core/src/test/java/io/github/dre2n/dungeonsxl/reward/HighwayToHellReward.java
deleted file mode 100644
index 4ec076fc..00000000
--- a/core/src/test/java/io/github/dre2n/dungeonsxl/reward/HighwayToHellReward.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2016 Daniel Saukel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package io.github.dre2n.dungeonsxl.reward;
-
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
-import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
-import java.util.Arrays;
-import org.bukkit.ChatColor;
-import org.bukkit.Material;
-import org.bukkit.entity.Player;
-import org.bukkit.inventory.ItemStack;
-import org.bukkit.inventory.meta.ItemMeta;
-
-/**
- * @author Daniel Saukel
- */
-public class HighwayToHellReward extends Reward {
-
- private RewardType type = RewardTypeCustom.HIGHWAY_TO_HELL;
-
- public static final ItemStack RECORD;
-
- static {
- RECORD = new ItemStack(Material.GOLD_RECORD);
- ItemMeta meta = RECORD.getItemMeta();
- meta.setDisplayName(ChatColor.DARK_RED + "Highway To Hell");
- meta.setLore(Arrays.asList(
- ChatColor.GOLD + "1. Highway To Hell 3:28",
- ChatColor.GOLD + "2. Girls Got Rhythm 3:24",
- ChatColor.GOLD + "3. Walk All Over You 5:09",
- ChatColor.GOLD + "4. Touch Too Much 4:26",
- ChatColor.GOLD + "5. Beating Around The Bush 3:56",
- ChatColor.GOLD + "6. Shot Down In Flames 3:23",
- ChatColor.GOLD + "7. Get It Hot 2:34",
- ChatColor.GOLD + "8. If You Want Blood (You've Got It) 4:37",
- ChatColor.GOLD + "9. Love Hungry Man 4:17",
- ChatColor.GOLD + "10. Night Prowler 6:16",
- ChatColor.DARK_RED + "All titles A. Young - M. Young - B. Scott"
- ));
- RECORD.setItemMeta(meta);
- }
-
- @Override
- public void giveTo(Player player) {
- // This is called when all rewards are given to the players. Each group member gets one item.
- player.getInventory().addItem(RECORD);
- MessageUtil.sendMessage(player, DungeonsXL.getInstance().getMessageConfig().getMessage(DMessages.REWARD_GENERAL, "1 Highway To Hell album"));
- }
-
- @Override
- public RewardType getType() {
- return type;
- }
-
-}
diff --git a/core/src/test/java/io/github/dre2n/dungeonsxl/reward/RewardTypeCustom.java b/core/src/test/java/io/github/dre2n/dungeonsxl/reward/RewardTypeCustom.java
deleted file mode 100644
index c8a1053b..00000000
--- a/core/src/test/java/io/github/dre2n/dungeonsxl/reward/RewardTypeCustom.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2016 Daniel Saukel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package io.github.dre2n.dungeonsxl.reward;
-
-/**
- * @author Daniel Saukel
- */
-public enum RewardTypeCustom implements RewardType {
-
- HIGHWAY_TO_HELL("highwayToHell", HighwayToHellReward.class);
-
- private String identifier;
- private Class extends Reward> handler;
-
- RewardTypeCustom(String identifier, Class extends Reward> handler) {
- this.identifier = identifier;
- this.handler = handler;
- }
-
- @Override
- public String getIdentifier() {
- return identifier;
- }
-
- @Override
- public Class extends Reward> getHandler() {
- return handler;
- }
-}
diff --git a/core/src/test/java/io/github/dre2n/dungeonsxl/sign/CustomSign.java b/core/src/test/java/io/github/dre2n/dungeonsxl/sign/CustomSign.java
deleted file mode 100644
index 9e6ce200..00000000
--- a/core/src/test/java/io/github/dre2n/dungeonsxl/sign/CustomSign.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (C) 2016 Daniel Saukel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package io.github.dre2n.dungeonsxl.sign;
-
-import io.github.dre2n.dungeonsxl.world.DGameWorld;
-import org.bukkit.block.Sign;
-import org.bukkit.entity.Player;
-
-/**
- * @author Daniel Saukel
- */
-public class CustomSign extends DSign {
-
- private DSignType type = DSignTypeCustom.CUSTOM;
-
- public CustomSign(Sign sign, String[] lines, DGameWorld gameWorld) {
- super(sign, lines, gameWorld);
- }
-
- @Override
- public boolean check() {
- // Check if the sign has the correct format
- if (getSign().getLine(1).isEmpty()) {
- return false;
-
- } else {
- return true;
- }
- }
-
- @Override
- public void onInit() {
- // Stuff that happens when the sign is transformed
- }
-
- @Override
- public boolean onPlayerTrigger(Player player) {
- // Stuff that happens when one player triggers the sign
- return true;
- }
-
- @Override
- public void onTrigger() {
- // Stuff that happens when the sign is triggered
- remove();
- }
-
- @Override
- public DSignType getType() {
- return type;
- }
-
-}
diff --git a/core/src/test/java/io/github/dre2n/dungeonsxl/sign/DSignTypeCustom.java b/core/src/test/java/io/github/dre2n/dungeonsxl/sign/DSignTypeCustom.java
deleted file mode 100644
index 2f45104f..00000000
--- a/core/src/test/java/io/github/dre2n/dungeonsxl/sign/DSignTypeCustom.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (C) 2016 Daniel Saukel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package io.github.dre2n.dungeonsxl.sign;
-
-import io.github.dre2n.dungeonsxl.player.DPermissions;
-
-/**
- * @author Daniel Saukel
- */
-public enum DSignTypeCustom implements DSignType {
-
- CUSTOM("Custom", "custom", false, false, CustomSign.class);
-
- private String name;
- private String buildPermission;
- private boolean onDungeonInit;
- private boolean isProtected;
- private Class extends DSign> handler;
-
- DSignTypeCustom(String name, String buildPermission, boolean onDungeonInit, boolean isProtected, Class extends DSign> handler) {
- this.name = name;
- this.buildPermission = buildPermission;
- this.onDungeonInit = onDungeonInit;
- this.isProtected = isProtected;
- this.handler = handler;
- }
-
- @Override
- public String getName() {
- return name;
- }
-
- @Override
- public String getBuildPermission() {
- return DPermissions.SIGN.getNode() + "." + buildPermission;
- }
-
- @Override
- public boolean isOnDungeonInit() {
- return onDungeonInit;
- }
-
- @Override
- public boolean isProtected() {
- return isProtected;
- }
-
- @Override
- public Class extends DSign> getHandler() {
- return handler;
- }
-
-}
diff --git a/core/src/test/java/io/github/dre2n/dungeonsxl/trigger/CustomTrigger.java b/core/src/test/java/io/github/dre2n/dungeonsxl/trigger/CustomTrigger.java
deleted file mode 100644
index 57bb5bf8..00000000
--- a/core/src/test/java/io/github/dre2n/dungeonsxl/trigger/CustomTrigger.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) 2016 Daniel Saukel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package io.github.dre2n.dungeonsxl.trigger;
-
-import io.github.dre2n.dungeonsxl.event.trigger.TriggerActionEvent;
-import io.github.dre2n.dungeonsxl.world.DGameWorld;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-import org.bukkit.entity.Player;
-
-/**
- * @author Daniel Saukel
- */
-public class CustomTrigger extends Trigger {
-
- private static Map> triggers = new HashMap<>();
-
- private TriggerType type = TriggerTypeCustom.CUSTOM;
-
- private String value;
-
- public CustomTrigger(String value) {
- this.value = value;
- }
-
- public String getValue() {
- return value;
- }
-
- public void onTrigger(Player player) {
- TriggerActionEvent event = new TriggerActionEvent(this);
-
- if (event.isCancelled()) {
- return;
- }
-
- setTriggered(true);
- this.setPlayer(player);
- updateDSigns();
- }
-
- @Override
- public void register(DGameWorld gameWorld) {
- if (!hasTriggers(gameWorld)) {
- ArrayList list = new ArrayList<>();
- list.add(this);
- triggers.put(gameWorld, list);
-
- } else {
- triggers.get(gameWorld).add(this);
- }
- }
-
- @Override
- public void unregister(DGameWorld gameWorld) {
- if (hasTriggers(gameWorld)) {
- triggers.get(gameWorld).remove(this);
- }
- }
-
- @Override
- public TriggerType getType() {
- return type;
- }
-
- public static CustomTrigger getOrCreate(String value, DGameWorld gameWorld) {
- if (triggers.containsKey(gameWorld)) {
- for (CustomTrigger trigger : triggers.get(gameWorld)) {
- if (trigger.value.equals(value)) {
- return trigger;
- }
- }
- }
-
- return new CustomTrigger(value);
- }
-
- public static boolean hasTriggers(DGameWorld gameWorld) {
- return !triggers.isEmpty() && triggers.containsKey(gameWorld);
- }
-
-}
diff --git a/core/src/test/java/io/github/dre2n/dungeonsxl/trigger/TriggerTypeCustom.java b/core/src/test/java/io/github/dre2n/dungeonsxl/trigger/TriggerTypeCustom.java
deleted file mode 100644
index 42d696fd..00000000
--- a/core/src/test/java/io/github/dre2n/dungeonsxl/trigger/TriggerTypeCustom.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2016 Daniel Saukel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package io.github.dre2n.dungeonsxl.trigger;
-
-/**
- * @author Daniel Saukel
- */
-public enum TriggerTypeCustom implements TriggerType {
-
- CUSTOM("C", CustomTrigger.class);
-
- private String identifier;
- private Class extends Trigger> handler;
-
- TriggerTypeCustom(String identifier, Class extends Trigger> handler) {
- this.identifier = identifier;
- this.handler = handler;
- }
-
- @Override
- public String getIdentifier() {
- return identifier;
- }
-
- @Override
- public Class extends Trigger> getHandler() {
- return handler;
- }
-
-}
diff --git a/core/src/test/resources/plugin.yml b/core/src/test/resources/plugin.yml
deleted file mode 100644
index d890d5ec..00000000
--- a/core/src/test/resources/plugin.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-name: DXLTest
-main: io.github.dre2n.dungeonsxl.DXLTest
-version: TEST
-author: Daniel Saukel
-description: Test
-depend: [DungeonsXL]
diff --git a/craftbukkit_1_10_R1/pom.xml b/craftbukkit_1_10_R1/pom.xml
deleted file mode 100644
index 1ab063ed..00000000
--- a/craftbukkit_1_10_R1/pom.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-
- 4.0.0
- io.github.dre2n
- dungeonsxl-craftbukkit_1_10_R1
- ${parent.version}
- jar
- dungeonsxl-craftbukkit_1_10_R1
-
- io.github.dre2n
- dungeonsxl
- 0.15.7-SNAPSHOT
-
-
-
-
- maven-compiler-plugin
- 2.5.1
-
- 1.7
- 1.7
-
-
-
-
-
-
- org.bukkit
- craftbukkit
- 1.10.2-R0.1-SNAPSHOT
- provided
-
-
- io.github.dre2n
- dungeonsxl-abstract
- ${parent.version}
- jar
- compile
-
-
-
diff --git a/craftbukkit_1_10_R1/src/main/java/io/github/dre2n/dungeonsxl/util/worldloader/v1_10_R1.java b/craftbukkit_1_10_R1/src/main/java/io/github/dre2n/dungeonsxl/util/worldloader/v1_10_R1.java
deleted file mode 100644
index a26dd836..00000000
--- a/craftbukkit_1_10_R1/src/main/java/io/github/dre2n/dungeonsxl/util/worldloader/v1_10_R1.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Copyright (C) 2012-2017 Frank Baumann
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package io.github.dre2n.dungeonsxl.util.worldloader;
-
-import java.io.File;
-import java.lang.reflect.Field;
-import java.util.Map;
-import java.util.logging.Logger;
-import net.minecraft.server.v1_10_R1.BlockPosition;
-import net.minecraft.server.v1_10_R1.Convertable;
-import net.minecraft.server.v1_10_R1.EntityTracker;
-import net.minecraft.server.v1_10_R1.EnumDifficulty;
-import net.minecraft.server.v1_10_R1.EnumGamemode;
-import net.minecraft.server.v1_10_R1.IDataManager;
-import net.minecraft.server.v1_10_R1.IProgressUpdate;
-import net.minecraft.server.v1_10_R1.MinecraftServer;
-import net.minecraft.server.v1_10_R1.ServerNBTManager;
-import net.minecraft.server.v1_10_R1.WorldData;
-import net.minecraft.server.v1_10_R1.WorldLoaderServer;
-import net.minecraft.server.v1_10_R1.WorldManager;
-import net.minecraft.server.v1_10_R1.WorldServer;
-import net.minecraft.server.v1_10_R1.WorldSettings;
-import net.minecraft.server.v1_10_R1.WorldType;
-import org.bukkit.Bukkit;
-import org.bukkit.World;
-import org.bukkit.WorldCreator;
-import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
-import org.bukkit.craftbukkit.v1_10_R1.CraftWorld;
-import org.bukkit.event.world.WorldInitEvent;
-import org.bukkit.event.world.WorldLoadEvent;
-import org.bukkit.generator.ChunkGenerator;
-import org.bukkit.plugin.PluginManager;
-
-/**
- * @author Daniel Saukel
- */
-public class v1_10_R1 extends InternalsProvider {
-
- MinecraftServer console;
- CraftServer server = ((CraftServer) Bukkit.getServer());
- Map worlds;
- PluginManager pluginManager = Bukkit.getPluginManager();
- File worldContainer = Bukkit.getWorldContainer();
- Logger logger = Bukkit.getLogger();
-
- v1_10_R1() {
- try {
- Field fConsole = CraftServer.class.getDeclaredField("console");
- fConsole.setAccessible(true);
- console = (MinecraftServer) fConsole.get(server);
-
- Field fWorlds = CraftServer.class.getDeclaredField("worlds");
- fWorlds.setAccessible(true);
- worlds = (Map) fWorlds.get(server);
-
- } catch (NoSuchFieldException | IllegalArgumentException | IllegalAccessException exception) {
- exception.printStackTrace();
- }
- }
-
- @SuppressWarnings("deprecation")
- @Override
- World createWorld(WorldCreator creator) {
- String name = creator.name();
- ChunkGenerator generator = creator.generator();
- File folder = new File(worldContainer, name);
- World world = Bukkit.getWorld(name);
- WorldType type = WorldType.getType(creator.type().getName());
- boolean generateStructures = creator.generateStructures();
-
- if (world != null) {
- return world;
- }
-
- if ((folder.exists()) && (!folder.isDirectory())) {
- throw new IllegalArgumentException("File exists with the name '" + name + "' and isn't a folder");
- }
-
- if (generator == null) {
- generator = server.getGenerator(name);
- }
-
- Convertable converter = new WorldLoaderServer(worldContainer, server.getHandle().getServer().getDataConverterManager());
- if (converter.isConvertable(name)) {
- logger.info("Converting world '" + name + "'");
- converter.convert(name, new IProgressUpdate() {
- private long b = System.currentTimeMillis();
-
- @Override
- public void a(String s) {
- }
-
- @Override
- public void a(int i) {
- if (System.currentTimeMillis() - this.b >= 1000L) {
- this.b = System.currentTimeMillis();
- MinecraftServer.LOGGER.info("Converting... " + i + "%");
- }
-
- }
-
- @Override
- public void c(String s) {
- }
- });
- }
-
- int dimension = CraftWorld.CUSTOM_DIMENSION_OFFSET + console.worlds.size();
- boolean used = false;
- do {
- for (WorldServer server : console.worlds) {
- used = server.dimension == dimension;
- if (used) {
- dimension++;
- break;
- }
- }
- } while (used);
- boolean hardcore = false;
-
- IDataManager sdm = new ServerNBTManager(worldContainer, name, true, server.getHandle().getServer().getDataConverterManager());
- WorldData worlddata = sdm.getWorldData();
- WorldSettings worldSettings = null;
- if (worlddata == null) {
- worldSettings = new WorldSettings(creator.seed(), EnumGamemode.getById(server.getDefaultGameMode().getValue()), generateStructures, hardcore, type);
- worldSettings.setGeneratorSettings(creator.generatorSettings());
- worlddata = new WorldData(worldSettings, name);
- }
- worlddata.checkName(name); // CraftBukkit - Migration did not rewrite the level.dat; This forces 1.8 to take the last loaded world as respawn (in this case the end)
- WorldServer internal = (WorldServer) new WorldServer(console, sdm, worlddata, dimension, console.methodProfiler, creator.environment(), generator).b();
-
- if (!(worlds.containsKey(name.toLowerCase(java.util.Locale.ENGLISH)))) {
- return null;
- }
-
- if (worldSettings != null) {
- internal.a(worldSettings);
- }
- internal.scoreboard = server.getScoreboardManager().getMainScoreboard().getHandle();
-
- internal.tracker = new EntityTracker(internal);
- internal.addIWorldAccess(new WorldManager(console, internal));
- internal.worldData.setDifficulty(EnumDifficulty.EASY);
- internal.setSpawnFlags(true, true);
- console.worlds.add(internal);
-
- if (generator != null) {
- internal.getWorld().getPopulators().addAll(generator.getDefaultPopulators(internal.getWorld()));
- }
-
- pluginManager.callEvent(new WorldInitEvent(internal.getWorld()));
- logger.info("Preparing start region for level " + (console.worlds.size() - 1) + " (Seed: " + internal.getSeed() + ")");
-
- if (internal.getWorld().getKeepSpawnInMemory()) {
- short short1 = 196;
- long i = System.currentTimeMillis();
- for (int j = -short1; j <= short1; j += 16) {
- for (int k = -short1; k <= short1; k += 16) {
- long l = System.currentTimeMillis();
-
- if (l < i) {
- i = l;
- }
-
- if (l > i + 1000L) {
- int i1 = (short1 * 2 + 1) * (short1 * 2 + 1);
- int j1 = (j + short1) * (short1 * 2 + 1) + k + 1;
-
- logger.info("Preparing spawn area for " + name + ", " + (j1 * 100 / i1) + "%");
- i = l;
- }
-
- BlockPosition chunkcoordinates = internal.getSpawn();
- try {
- internal.getChunkProviderServer().getChunkAt(chunkcoordinates.getX() + j >> 4, chunkcoordinates.getZ() + k >> 4);
- } catch (Exception exception) {
- }
- }
- }
- }
- pluginManager.callEvent(new WorldLoadEvent(internal.getWorld()));
- return internal.getWorld();
- }
-
-}
diff --git a/craftbukkit_1_11_R1/pom.xml b/craftbukkit_1_11_R1/pom.xml
deleted file mode 100644
index 3ce80eae..00000000
--- a/craftbukkit_1_11_R1/pom.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-
- 4.0.0
- io.github.dre2n
- dungeonsxl-craftbukkit_1_11_R1
- ${parent.version}
- jar
- dungeonsxl-craftbukkit_1_11_R1
-
- io.github.dre2n
- dungeonsxl
- 0.15.7-SNAPSHOT
-
-
-
-
- maven-compiler-plugin
- 2.5.1
-
- 1.7
- 1.7
-
-
-
-
-
-
- org.bukkit
- craftbukkit
- 1.11.2-R0.1-SNAPSHOT
- provided
-
-
- io.github.dre2n
- dungeonsxl-abstract
- ${parent.version}
- jar
- compile
-
-
-
diff --git a/craftbukkit_1_11_R1/src/main/java/io/github/dre2n/dungeonsxl/util/worldloader/v1_11_R1.java b/craftbukkit_1_11_R1/src/main/java/io/github/dre2n/dungeonsxl/util/worldloader/v1_11_R1.java
deleted file mode 100644
index 255628eb..00000000
--- a/craftbukkit_1_11_R1/src/main/java/io/github/dre2n/dungeonsxl/util/worldloader/v1_11_R1.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Copyright (C) 2012-2017 Frank Baumann
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package io.github.dre2n.dungeonsxl.util.worldloader;
-
-import java.io.File;
-import java.lang.reflect.Field;
-import java.util.Map;
-import java.util.logging.Logger;
-import net.minecraft.server.v1_11_R1.BlockPosition;
-import net.minecraft.server.v1_11_R1.Convertable;
-import net.minecraft.server.v1_11_R1.EntityTracker;
-import net.minecraft.server.v1_11_R1.EnumDifficulty;
-import net.minecraft.server.v1_11_R1.EnumGamemode;
-import net.minecraft.server.v1_11_R1.IDataManager;
-import net.minecraft.server.v1_11_R1.IProgressUpdate;
-import net.minecraft.server.v1_11_R1.MinecraftServer;
-import net.minecraft.server.v1_11_R1.ServerNBTManager;
-import net.minecraft.server.v1_11_R1.WorldData;
-import net.minecraft.server.v1_11_R1.WorldLoaderServer;
-import net.minecraft.server.v1_11_R1.WorldManager;
-import net.minecraft.server.v1_11_R1.WorldServer;
-import net.minecraft.server.v1_11_R1.WorldSettings;
-import net.minecraft.server.v1_11_R1.WorldType;
-import org.bukkit.Bukkit;
-import org.bukkit.World;
-import org.bukkit.WorldCreator;
-import org.bukkit.craftbukkit.v1_11_R1.CraftServer;
-import org.bukkit.craftbukkit.v1_11_R1.CraftWorld;
-import org.bukkit.event.world.WorldInitEvent;
-import org.bukkit.event.world.WorldLoadEvent;
-import org.bukkit.generator.ChunkGenerator;
-import org.bukkit.plugin.PluginManager;
-
-/**
- * @author Daniel Saukel
- */
-public class v1_11_R1 extends InternalsProvider {
-
- MinecraftServer console;
- CraftServer server = ((CraftServer) Bukkit.getServer());
- Map worlds;
- PluginManager pluginManager = Bukkit.getPluginManager();
- File worldContainer = Bukkit.getWorldContainer();
- Logger logger = Bukkit.getLogger();
-
- v1_11_R1() {
- try {
- Field fConsole = CraftServer.class.getDeclaredField("console");
- fConsole.setAccessible(true);
- console = (MinecraftServer) fConsole.get(server);
-
- Field fWorlds = CraftServer.class.getDeclaredField("worlds");
- fWorlds.setAccessible(true);
- worlds = (Map) fWorlds.get(server);
-
- } catch (NoSuchFieldException | IllegalArgumentException | IllegalAccessException exception) {
- exception.printStackTrace();
- }
- }
-
- @SuppressWarnings("deprecation")
- @Override
- World createWorld(WorldCreator creator) {
- String name = creator.name();
- ChunkGenerator generator = creator.generator();
- File folder = new File(worldContainer, name);
- World world = Bukkit.getWorld(name);
- WorldType type = WorldType.getType(creator.type().getName());
- boolean generateStructures = creator.generateStructures();
-
- if (world != null) {
- return world;
- }
-
- if ((folder.exists()) && (!folder.isDirectory())) {
- throw new IllegalArgumentException("File exists with the name '" + name + "' and isn't a folder");
- }
-
- if (generator == null) {
- generator = server.getGenerator(name);
- }
-
- Convertable converter = new WorldLoaderServer(worldContainer, server.getHandle().getServer().getDataConverterManager());
- if (converter.isConvertable(name)) {
- logger.info("Converting world '" + name + "'");
- converter.convert(name, new IProgressUpdate() {
- private long b = System.currentTimeMillis();
-
- @Override
- public void a(String s) {
- }
-
- @Override
- public void a(int i) {
- if (System.currentTimeMillis() - this.b >= 1000L) {
- this.b = System.currentTimeMillis();
- MinecraftServer.LOGGER.info("Converting... " + i + "%");
- }
-
- }
-
- @Override
- public void c(String s) {
- }
- });
- }
-
- int dimension = CraftWorld.CUSTOM_DIMENSION_OFFSET + console.worlds.size();
- boolean used = false;
- do {
- for (WorldServer server : console.worlds) {
- used = server.dimension == dimension;
- if (used) {
- dimension++;
- break;
- }
- }
- } while (used);
- boolean hardcore = false;
-
- IDataManager sdm = new ServerNBTManager(worldContainer, name, true, server.getHandle().getServer().getDataConverterManager());
- WorldData worlddata = sdm.getWorldData();
- WorldSettings worldSettings = null;
- if (worlddata == null) {
- worldSettings = new WorldSettings(creator.seed(), EnumGamemode.getById(server.getDefaultGameMode().getValue()), generateStructures, hardcore, type);
- worldSettings.setGeneratorSettings(creator.generatorSettings());
- worlddata = new WorldData(worldSettings, name);
- }
- worlddata.checkName(name); // CraftBukkit - Migration did not rewrite the level.dat; This forces 1.8 to take the last loaded world as respawn (in this case the end)
- WorldServer internal = (WorldServer) new WorldServer(console, sdm, worlddata, dimension, console.methodProfiler, creator.environment(), generator).b();
-
- if (!(worlds.containsKey(name.toLowerCase(java.util.Locale.ENGLISH)))) {
- return null;
- }
-
- if (worldSettings != null) {
- internal.a(worldSettings);
- }
- internal.scoreboard = server.getScoreboardManager().getMainScoreboard().getHandle();
-
- internal.tracker = new EntityTracker(internal);
- internal.addIWorldAccess(new WorldManager(console, internal));
- internal.worldData.setDifficulty(EnumDifficulty.EASY);
- internal.setSpawnFlags(true, true);
- console.worlds.add(internal);
-
- if (generator != null) {
- internal.getWorld().getPopulators().addAll(generator.getDefaultPopulators(internal.getWorld()));
- }
-
- pluginManager.callEvent(new WorldInitEvent(internal.getWorld()));
- logger.info("Preparing start region for level " + (console.worlds.size() - 1) + " (Seed: " + internal.getSeed() + ")");
-
- if (internal.getWorld().getKeepSpawnInMemory()) {
- short short1 = 196;
- long i = System.currentTimeMillis();
- for (int j = -short1; j <= short1; j += 16) {
- for (int k = -short1; k <= short1; k += 16) {
- long l = System.currentTimeMillis();
-
- if (l < i) {
- i = l;
- }
-
- if (l > i + 1000L) {
- int i1 = (short1 * 2 + 1) * (short1 * 2 + 1);
- int j1 = (j + short1) * (short1 * 2 + 1) + k + 1;
-
- logger.info("Preparing spawn area for " + name + ", " + (j1 * 100 / i1) + "%");
- i = l;
- }
-
- BlockPosition chunkcoordinates = internal.getSpawn();
- try {
- internal.getChunkProviderServer().getChunkAt(chunkcoordinates.getX() + j >> 4, chunkcoordinates.getZ() + k >> 4);
- } catch (Exception exception) {
- }
- }
- }
- }
- pluginManager.callEvent(new WorldLoadEvent(internal.getWorld()));
- return internal.getWorld();
- }
-
-}
diff --git a/craftbukkit_1_9_R1/pom.xml b/craftbukkit_1_9_R1/pom.xml
deleted file mode 100644
index 63e0cfaa..00000000
--- a/craftbukkit_1_9_R1/pom.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-
- 4.0.0
- io.github.dre2n
- dungeonsxl-craftbukkit_1_9_R1
- ${parent.version}
- jar
- dungeonsxl-craftbukkit_1_9_R1
-
- io.github.dre2n
- dungeonsxl
- 0.15.7-SNAPSHOT
-
-
-
-
- maven-compiler-plugin
- 2.5.1
-
- 1.7
- 1.7
-
-
-
-
-
-
- org.bukkit
- craftbukkit
- 1.9.2-R0.1-SNAPSHOT
- provided
-
-
- io.github.dre2n
- dungeonsxl-abstract
- ${parent.version}
- jar
- compile
-
-
-
diff --git a/craftbukkit_1_9_R1/src/main/java/io/github/dre2n/dungeonsxl/util/worldloader/v1_9_R1.java b/craftbukkit_1_9_R1/src/main/java/io/github/dre2n/dungeonsxl/util/worldloader/v1_9_R1.java
deleted file mode 100644
index 160f52cc..00000000
--- a/craftbukkit_1_9_R1/src/main/java/io/github/dre2n/dungeonsxl/util/worldloader/v1_9_R1.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Copyright (C) 2012-2017 Frank Baumann
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package io.github.dre2n.dungeonsxl.util.worldloader;
-
-import java.io.File;
-import java.lang.reflect.Field;
-import java.util.Map;
-import java.util.logging.Logger;
-import net.minecraft.server.v1_9_R1.BlockPosition;
-import net.minecraft.server.v1_9_R1.Convertable;
-import net.minecraft.server.v1_9_R1.EntityTracker;
-import net.minecraft.server.v1_9_R1.EnumDifficulty;
-import net.minecraft.server.v1_9_R1.IDataManager;
-import net.minecraft.server.v1_9_R1.IProgressUpdate;
-import net.minecraft.server.v1_9_R1.MinecraftServer;
-import net.minecraft.server.v1_9_R1.ServerNBTManager;
-import net.minecraft.server.v1_9_R1.WorldData;
-import net.minecraft.server.v1_9_R1.WorldLoaderServer;
-import net.minecraft.server.v1_9_R1.WorldManager;
-import net.minecraft.server.v1_9_R1.WorldServer;
-import net.minecraft.server.v1_9_R1.WorldSettings;
-import net.minecraft.server.v1_9_R1.WorldSettings.EnumGamemode;
-import net.minecraft.server.v1_9_R1.WorldType;
-import org.bukkit.Bukkit;
-import org.bukkit.World;
-import org.bukkit.WorldCreator;
-import org.bukkit.craftbukkit.v1_9_R1.CraftServer;
-import org.bukkit.craftbukkit.v1_9_R1.CraftWorld;
-import org.bukkit.event.world.WorldInitEvent;
-import org.bukkit.event.world.WorldLoadEvent;
-import org.bukkit.generator.ChunkGenerator;
-import org.bukkit.plugin.PluginManager;
-
-/**
- * @author Daniel Saukel
- */
-public class v1_9_R1 extends InternalsProvider {
-
- MinecraftServer console;
- CraftServer server = ((CraftServer) Bukkit.getServer());
- Map worlds;
- PluginManager pluginManager = Bukkit.getPluginManager();
- File worldContainer = Bukkit.getWorldContainer();
- Logger logger = Bukkit.getLogger();
-
- v1_9_R1() {
- try {
- Field fConsole = CraftServer.class.getDeclaredField("console");
- fConsole.setAccessible(true);
- console = (MinecraftServer) fConsole.get(server);
-
- Field fWorlds = CraftServer.class.getDeclaredField("worlds");
- fWorlds.setAccessible(true);
- worlds = (Map) fWorlds.get(server);
-
- } catch (NoSuchFieldException | IllegalArgumentException | IllegalAccessException exception) {
- exception.printStackTrace();
- }
- }
-
- @SuppressWarnings("deprecation")
- @Override
- World createWorld(WorldCreator creator) {
- String name = creator.name();
- ChunkGenerator generator = creator.generator();
- File folder = new File(worldContainer, name);
- World world = Bukkit.getWorld(name);
- WorldType type = WorldType.getType(creator.type().getName());
- boolean generateStructures = creator.generateStructures();
-
- if (world != null) {
- return world;
- }
-
- if ((folder.exists()) && (!folder.isDirectory())) {
- throw new IllegalArgumentException("File exists with the name '" + name + "' and isn't a folder");
- }
-
- if (generator == null) {
- generator = server.getGenerator(name);
- }
-
- Convertable converter = new WorldLoaderServer(worldContainer, server.getHandle().getServer().getDataConverterManager());
- if (converter.isConvertable(name)) {
- logger.info("Converting world '" + name + "'");
- converter.convert(name, new IProgressUpdate() {
- private long b = System.currentTimeMillis();
-
- @Override
- public void a(String s) {
- }
-
- @Override
- public void a(int i) {
- if (System.currentTimeMillis() - this.b >= 1000L) {
- this.b = System.currentTimeMillis();
- MinecraftServer.LOGGER.info("Converting... " + i + "%");
- }
-
- }
-
- @Override
- public void c(String s) {
- }
- });
- }
-
- int dimension = CraftWorld.CUSTOM_DIMENSION_OFFSET + console.worlds.size();
- boolean used = false;
- do {
- for (WorldServer server : console.worlds) {
- used = server.dimension == dimension;
- if (used) {
- dimension++;
- break;
- }
- }
- } while (used);
- boolean hardcore = false;
-
- IDataManager sdm = new ServerNBTManager(worldContainer, name, true, server.getHandle().getServer().getDataConverterManager());
- WorldData worlddata = sdm.getWorldData();
- WorldSettings worldSettings = null;
- if (worlddata == null) {
- worldSettings = new WorldSettings(creator.seed(), EnumGamemode.getById(server.getDefaultGameMode().getValue()), generateStructures, hardcore, type);
- worldSettings.setGeneratorSettings(creator.generatorSettings());
- worlddata = new WorldData(worldSettings, name);
- }
- worlddata.checkName(name); // CraftBukkit - Migration did not rewrite the level.dat; This forces 1.8 to take the last loaded world as respawn (in this case the end)
- WorldServer internal = (WorldServer) new WorldServer(console, sdm, worlddata, dimension, console.methodProfiler, creator.environment(), generator).b();
-
- if (!(worlds.containsKey(name.toLowerCase(java.util.Locale.ENGLISH)))) {
- return null;
- }
-
- if (worldSettings != null) {
- internal.a(worldSettings);
- }
- internal.scoreboard = server.getScoreboardManager().getMainScoreboard().getHandle();
-
- internal.tracker = new EntityTracker(internal);
- internal.addIWorldAccess(new WorldManager(console, internal));
- internal.worldData.setDifficulty(EnumDifficulty.EASY);
- internal.setSpawnFlags(true, true);
- console.worlds.add(internal);
-
- if (generator != null) {
- internal.getWorld().getPopulators().addAll(generator.getDefaultPopulators(internal.getWorld()));
- }
-
- pluginManager.callEvent(new WorldInitEvent(internal.getWorld()));
- logger.info("Preparing start region for level " + (console.worlds.size() - 1) + " (Seed: " + internal.getSeed() + ")");
-
- if (internal.getWorld().getKeepSpawnInMemory()) {
- short short1 = 196;
- long i = System.currentTimeMillis();
- for (int j = -short1; j <= short1; j += 16) {
- for (int k = -short1; k <= short1; k += 16) {
- long l = System.currentTimeMillis();
-
- if (l < i) {
- i = l;
- }
-
- if (l > i + 1000L) {
- int i1 = (short1 * 2 + 1) * (short1 * 2 + 1);
- int j1 = (j + short1) * (short1 * 2 + 1) + k + 1;
-
- logger.info("Preparing spawn area for " + name + ", " + (j1 * 100 / i1) + "%");
- i = l;
- }
-
- BlockPosition chunkcoordinates = internal.getSpawn();
- try {
- internal.getChunkProviderServer().getChunkAt(chunkcoordinates.getX() + j >> 4, chunkcoordinates.getZ() + k >> 4);
- } catch (Exception exception) {
- }
- }
- }
- }
- pluginManager.callEvent(new WorldLoadEvent(internal.getWorld()));
- return internal.getWorld();
- }
-
-}
diff --git a/craftbukkit_1_9_R2/pom.xml b/craftbukkit_1_9_R2/pom.xml
deleted file mode 100644
index b740b2cc..00000000
--- a/craftbukkit_1_9_R2/pom.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-
- 4.0.0
- io.github.dre2n
- dungeonsxl-craftbukkit_1_9_R2
- ${parent.version}
- jar
- dungeonsxl-craftbukkit_1_9_R2
-
- io.github.dre2n
- dungeonsxl
- 0.15.7-SNAPSHOT
-
-
-
-
- maven-compiler-plugin
- 2.5.1
-
- 1.7
- 1.7
-
-
-
-
-
-
- org.bukkit
- craftbukkit
- 1.9.4-R0.1-SNAPSHOT
- provided
-
-
- io.github.dre2n
- dungeonsxl-abstract
- ${parent.version}
- jar
- compile
-
-
-
diff --git a/craftbukkit_1_9_R2/src/main/java/io/github/dre2n/dungeonsxl/util/worldloader/v1_9_R2.java b/craftbukkit_1_9_R2/src/main/java/io/github/dre2n/dungeonsxl/util/worldloader/v1_9_R2.java
deleted file mode 100644
index fe442e2d..00000000
--- a/craftbukkit_1_9_R2/src/main/java/io/github/dre2n/dungeonsxl/util/worldloader/v1_9_R2.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Copyright (C) 2012-2017 Frank Baumann
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package io.github.dre2n.dungeonsxl.util.worldloader;
-
-import java.io.File;
-import java.lang.reflect.Field;
-import java.util.Map;
-import java.util.logging.Logger;
-import net.minecraft.server.v1_9_R2.BlockPosition;
-import net.minecraft.server.v1_9_R2.Convertable;
-import net.minecraft.server.v1_9_R2.EntityTracker;
-import net.minecraft.server.v1_9_R2.EnumDifficulty;
-import net.minecraft.server.v1_9_R2.IDataManager;
-import net.minecraft.server.v1_9_R2.IProgressUpdate;
-import net.minecraft.server.v1_9_R2.MinecraftServer;
-import net.minecraft.server.v1_9_R2.ServerNBTManager;
-import net.minecraft.server.v1_9_R2.WorldData;
-import net.minecraft.server.v1_9_R2.WorldLoaderServer;
-import net.minecraft.server.v1_9_R2.WorldManager;
-import net.minecraft.server.v1_9_R2.WorldServer;
-import net.minecraft.server.v1_9_R2.WorldSettings;
-import net.minecraft.server.v1_9_R2.WorldSettings.EnumGamemode;
-import net.minecraft.server.v1_9_R2.WorldType;
-import org.bukkit.Bukkit;
-import org.bukkit.World;
-import org.bukkit.WorldCreator;
-import org.bukkit.craftbukkit.v1_9_R2.CraftServer;
-import org.bukkit.craftbukkit.v1_9_R2.CraftWorld;
-import org.bukkit.event.world.WorldInitEvent;
-import org.bukkit.event.world.WorldLoadEvent;
-import org.bukkit.generator.ChunkGenerator;
-import org.bukkit.plugin.PluginManager;
-
-/**
- * @author Daniel Saukel
- */
-public class v1_9_R2 extends InternalsProvider {
-
- MinecraftServer console;
- CraftServer server = ((CraftServer) Bukkit.getServer());
- Map worlds;
- PluginManager pluginManager = Bukkit.getPluginManager();
- File worldContainer = Bukkit.getWorldContainer();
- Logger logger = Bukkit.getLogger();
-
- v1_9_R2() {
- try {
- Field fConsole = CraftServer.class.getDeclaredField("console");
- fConsole.setAccessible(true);
- console = (MinecraftServer) fConsole.get(server);
-
- Field fWorlds = CraftServer.class.getDeclaredField("worlds");
- fWorlds.setAccessible(true);
- worlds = (Map) fWorlds.get(server);
-
- } catch (NoSuchFieldException | IllegalArgumentException | IllegalAccessException exception) {
- exception.printStackTrace();
- }
- }
-
- @SuppressWarnings("deprecation")
- @Override
- World createWorld(WorldCreator creator) {
- String name = creator.name();
- ChunkGenerator generator = creator.generator();
- File folder = new File(worldContainer, name);
- World world = Bukkit.getWorld(name);
- WorldType type = WorldType.getType(creator.type().getName());
- boolean generateStructures = creator.generateStructures();
-
- if (world != null) {
- return world;
- }
-
- if ((folder.exists()) && (!folder.isDirectory())) {
- throw new IllegalArgumentException("File exists with the name '" + name + "' and isn't a folder");
- }
-
- if (generator == null) {
- generator = server.getGenerator(name);
- }
-
- Convertable converter = new WorldLoaderServer(worldContainer, server.getHandle().getServer().getDataConverterManager());
- if (converter.isConvertable(name)) {
- logger.info("Converting world '" + name + "'");
- converter.convert(name, new IProgressUpdate() {
- private long b = System.currentTimeMillis();
-
- @Override
- public void a(String s) {
- }
-
- @Override
- public void a(int i) {
- if (System.currentTimeMillis() - this.b >= 1000L) {
- this.b = System.currentTimeMillis();
- MinecraftServer.LOGGER.info("Converting... " + i + "%");
- }
-
- }
-
- @Override
- public void c(String s) {
- }
- });
- }
-
- int dimension = CraftWorld.CUSTOM_DIMENSION_OFFSET + console.worlds.size();
- boolean used = false;
- do {
- for (WorldServer server : console.worlds) {
- used = server.dimension == dimension;
- if (used) {
- dimension++;
- break;
- }
- }
- } while (used);
- boolean hardcore = false;
-
- IDataManager sdm = new ServerNBTManager(worldContainer, name, true, server.getHandle().getServer().getDataConverterManager());
- WorldData worlddata = sdm.getWorldData();
- WorldSettings worldSettings = null;
- if (worlddata == null) {
- worldSettings = new WorldSettings(creator.seed(), EnumGamemode.getById(server.getDefaultGameMode().getValue()), generateStructures, hardcore, type);
- worldSettings.setGeneratorSettings(creator.generatorSettings());
- worlddata = new WorldData(worldSettings, name);
- }
- worlddata.checkName(name); // CraftBukkit - Migration did not rewrite the level.dat; This forces 1.8 to take the last loaded world as respawn (in this case the end)
- WorldServer internal = (WorldServer) new WorldServer(console, sdm, worlddata, dimension, console.methodProfiler, creator.environment(), generator).b();
-
- if (!(worlds.containsKey(name.toLowerCase(java.util.Locale.ENGLISH)))) {
- return null;
- }
-
- if (worldSettings != null) {
- internal.a(worldSettings);
- }
- internal.scoreboard = server.getScoreboardManager().getMainScoreboard().getHandle();
-
- internal.tracker = new EntityTracker(internal);
- internal.addIWorldAccess(new WorldManager(console, internal));
- internal.worldData.setDifficulty(EnumDifficulty.EASY);
- internal.setSpawnFlags(true, true);
- console.worlds.add(internal);
-
- if (generator != null) {
- internal.getWorld().getPopulators().addAll(generator.getDefaultPopulators(internal.getWorld()));
- }
-
- pluginManager.callEvent(new WorldInitEvent(internal.getWorld()));
- logger.info("Preparing start region for level " + (console.worlds.size() - 1) + " (Seed: " + internal.getSeed() + ")");
-
- if (internal.getWorld().getKeepSpawnInMemory()) {
- short short1 = 196;
- long i = System.currentTimeMillis();
- for (int j = -short1; j <= short1; j += 16) {
- for (int k = -short1; k <= short1; k += 16) {
- long l = System.currentTimeMillis();
-
- if (l < i) {
- i = l;
- }
-
- if (l > i + 1000L) {
- int i1 = (short1 * 2 + 1) * (short1 * 2 + 1);
- int j1 = (j + short1) * (short1 * 2 + 1) + k + 1;
-
- logger.info("Preparing spawn area for " + name + ", " + (j1 * 100 / i1) + "%");
- i = l;
- }
-
- BlockPosition chunkcoordinates = internal.getSpawn();
- try {
- internal.getChunkProviderServer().getChunkAt(chunkcoordinates.getX() + j >> 4, chunkcoordinates.getZ() + k >> 4);
- } catch (Exception exception) {
- }
- }
- }
- }
- pluginManager.callEvent(new WorldLoadEvent(internal.getWorld()));
- return internal.getWorld();
- }
-
-}
diff --git a/pom.xml b/pom.xml
index 1a796c45..43c08223 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2,47 +2,87 @@
4.0.0
io.github.dre2n
dungeonsxl
- 0.15.7-SNAPSHOT
- pom
+ 0.16-SNAPSHOT
+ jar
DungeonsXL
https://dre2n.github.io
Create custom dungeons and adventure maps with ease!
- true
-
- shade
- core
- abstract
- rpapi-patch_1_11_R1
- craftbukkit_1_11_R1
- craftbukkit_1_10_R1
- craftbukkit_1_9_R2
- craftbukkit_1_9_R1
-
+
+ dungeonsxl-${project.version}${buildNo}
+ src/main/java
+
+
+ .
+ true
+ src/main/resources/
+
+ plugin.yml
+
+
+
+
+
+ maven-compiler-plugin
+ 2.5.1
+
+ 1.7
+ 1.7
+
+
+
+ org.apache.maven.plugins
+ maven-shade-plugin
+ 2.4.3
+
+
+ package
+
+ shade
+
+
+
+
+ io.github.dre2n:caliburn
+ io.github.dre2n:commons
+
+
+
+
+ io.github.dre2n.commons
+ io.github.dre2n.dungeonsxl.util.commons
+
+
+
+
+
+
+
+
org.spigotmc
spigot-api
- 1.11.2-R0.1-SNAPSHOT
+ 1.12-R0.1-SNAPSHOT
provided
net.milkbowl.vault
VaultAPI
- 1.5
+ 1.6
provided
io.github.dre2n
commons
- 1.0.6
+ 3.1.1
io.github.dre2n
caliburn
- 0.2.4
+ 0.3
io.github.dre2n
@@ -60,37 +100,17 @@
holographicdisplaysapi
2.1.7
-
+
org.black_ixx
BossShop
2.6.9
provided
-
-
- org.inventivetalent.resourcepackapi
- v1_10_R1
- 2.2.1
-
-
- org.inventivetalent.resourcepackapi
- v1_9_R2
- 2.2.1
-
-
- org.inventivetalent.resourcepackapi
- v1_9_R1
- 2.2.1
-
diff --git a/rpapi-patch_1_11_R1/pom.xml b/rpapi-patch_1_11_R1/pom.xml
deleted file mode 100644
index 82beb783..00000000
--- a/rpapi-patch_1_11_R1/pom.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-
- 4.0.0
- io.github.dre2n
- dungeonsxl-rpapi-patch_1_11_R1
- ${parent.version}
- jar
- dungeonsxl-rpapi-patch_1_11_R1
-
- io.github.dre2n
- dungeonsxl
- 0.15.7-SNAPSHOT
-
-
-
-
- maven-compiler-plugin
- 2.5.1
-
- 1.7
- 1.7
-
-
-
-
-
-
- org.bukkit
- craftbukkit
- 1.11.2-R0.1-SNAPSHOT
- provided
-
-
- io.github.dre2n
- dungeonsxl-abstract
- ${parent.version}
- jar
- compile
-
-
-
diff --git a/rpapi-patch_1_11_R1/src/main/java/io/github/dre2n/dungeonsxl/util/reflectionhelper/minecraft/Minecraft.java b/rpapi-patch_1_11_R1/src/main/java/io/github/dre2n/dungeonsxl/util/reflectionhelper/minecraft/Minecraft.java
deleted file mode 100644
index 9784bf93..00000000
--- a/rpapi-patch_1_11_R1/src/main/java/io/github/dre2n/dungeonsxl/util/reflectionhelper/minecraft/Minecraft.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * Copyright 2016 inventivetalent. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those of the
- * authors and contributors and should not be interpreted as representing official policies,
- * either expressed or implied, of anybody else.
- */
-
-package io.github.dre2n.dungeonsxl.util.reflectionhelper.minecraft;
-
-import org.bukkit.Bukkit;
-import org.bukkit.entity.Entity;
-import org.inventivetalent.reflection.resolver.ConstructorResolver;
-import org.inventivetalent.reflection.resolver.FieldResolver;
-import org.inventivetalent.reflection.resolver.MethodResolver;
-import org.inventivetalent.reflection.resolver.minecraft.NMSClassResolver;
-import org.inventivetalent.reflection.resolver.minecraft.OBCClassResolver;
-import org.inventivetalent.reflection.util.AccessUtil;
-import sun.reflect.ConstructorAccessor;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Helper class to access minecraft/bukkit specific objects
- */
-public class Minecraft {
- static final Pattern NUMERIC_VERSION_PATTERN = Pattern.compile("v([0-9])_([0-9])*_R([0-9])");
-
- public static final Version VERSION;
-
- private static NMSClassResolver nmsClassResolver = new NMSClassResolver();
- private static OBCClassResolver obcClassResolver = new OBCClassResolver();
- private static Class> NmsEntity;
- private static Class> CraftEntity;
-
- static {
- VERSION = Version.getVersion();
- System.out.println("[ReflectionHelper] Version is " + VERSION);
-
- try {
- NmsEntity = nmsClassResolver.resolve("Entity");
- CraftEntity = obcClassResolver.resolve("entity.CraftEntity");
- } catch (ReflectiveOperationException e) {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * @return the current NMS/OBC version (format <version>.
- */
- public static String getVersion() {
- return VERSION.name() + ".";
- }
-
- public static Object getHandle(Object object) throws ReflectiveOperationException {
- Method method;
- try {
- method = AccessUtil.setAccessible(object.getClass().getDeclaredMethod("getHandle"));
- } catch (ReflectiveOperationException e) {
- method = AccessUtil.setAccessible(CraftEntity.getDeclaredMethod("getHandle"));
- }
- return method.invoke(object);
- }
-
- public static Entity getBukkitEntity(Object object) throws ReflectiveOperationException {
- Method method;
- try {
- method = AccessUtil.setAccessible(NmsEntity.getDeclaredMethod("getBukkitEntity"));
- } catch (ReflectiveOperationException e) {
- method = AccessUtil.setAccessible(CraftEntity.getDeclaredMethod("getHandle"));
- }
- return (Entity) method.invoke(object);
- }
-
- public static Object getHandleSilent(Object object) {
- try {
- return getHandle(object);
- } catch (Exception e) {
- }
- return null;
- }
-
- public enum Version {
- UNKNOWN(-1) {
- @Override
- public boolean matchesPackageName(String packageName) {
- return false;
- }
- },
-
- v1_7_R1(10701),
- v1_7_R2(10702),
- v1_7_R3(10703),
- v1_7_R4(10704),
-
- v1_8_R1(10801),
- v1_8_R2(10802),
- v1_8_R3(10803),
- //Does this even exists?
- v1_8_R4(10804),
-
- v1_9_R1(10901),
- v1_9_R2(10902),
-
- v1_10_R1(11001),
-
- v1_11_R1(11101);
-
- private int version;
-
- Version(int version) {
- this.version = version;
- }
-
- /**
- * @return the version-number
- */
- public int version() {
- return version;
- }
-
- /**
- * @param version the version to check
- * @return true
if this version is older than the specified version
- */
- public boolean olderThan(Version version) {
- return version() < version.version();
- }
-
- /**
- * @param version the version to check
- * @return true
if this version is newer than the specified version
- */
- public boolean newerThan(Version version) {
- return version() >= version.version();
- }
-
- /**
- * @param oldVersion The older version to check
- * @param newVersion The newer version to check
- * @return true
if this version is newer than the oldVersion and older that the newVersion
- */
- public boolean inRange(Version oldVersion, Version newVersion) {
- return newerThan(oldVersion) && olderThan(newVersion);
- }
-
- public boolean matchesPackageName(String packageName) {
- return packageName.toLowerCase().contains(name().toLowerCase());
- }
-
- public static Version getVersion() {
- String name = Bukkit.getServer().getClass().getPackage().getName();
- String versionPackage = name.substring(name.lastIndexOf('.') + 1) + ".";
- for (Version version : values()) {
- if (version.matchesPackageName(versionPackage)) { return version; }
- }
- System.err.println("[ReflectionHelper] Failed to find version enum for '" + name + "'/'" + versionPackage + "'");
-
- System.out.println("[ReflectionHelper] Generating dynamic constant...");
- Matcher matcher = NUMERIC_VERSION_PATTERN.matcher(versionPackage);
- while (matcher.find()) {
- if (matcher.groupCount() < 3) { continue; }
-
- String majorString = matcher.group(1);
- String minorString = matcher.group(2);
- if (minorString.length() == 1) { minorString = "0" + minorString; }
- String patchString = matcher.group(3);
- if (patchString.length() == 1) { patchString = "0" + patchString; }
-
- String numVersionString = majorString + minorString + patchString;
- int numVersion = Integer.parseInt(numVersionString);
- String packge = versionPackage.substring(0, versionPackage.length() - 1);
-
- try {
- // Add enum value
- Field valuesField = new FieldResolver(Version.class).resolve("$VALUES");
- Version[] oldValues = (Version[]) valuesField.get(null);
- Version[] newValues = new Version[oldValues.length + 1];
- System.arraycopy(oldValues, 0, newValues, 0, oldValues.length);
- Version dynamicVersion = (Version) newEnumInstance(Version.class, new Class[] {
- String.class,
- int.class,
- int.class }, new Object[] {
- packge,
- newValues.length - 1,
- numVersion });
- newValues[newValues.length - 1] = dynamicVersion;
- valuesField.set(null, newValues);
-
- System.out.println("[ReflectionHelper] Injected dynamic version " + packge + " (#" + numVersion + ").");
- System.out.println("[ReflectionHelper] Please inform inventivetalent about the outdated version, as this is not guaranteed to work.");
- return dynamicVersion;
- } catch (ReflectiveOperationException e) {
- e.printStackTrace();
- }
- }
-
- return UNKNOWN;
- }
-
- @Override
- public String toString() {
- return name() + " (" + version() + ")";
- }
- }
-
- public static Object newEnumInstance(Class clazz, Class[] types, Object[] values) throws ReflectiveOperationException {
- Constructor constructor = new ConstructorResolver(clazz).resolve(types);
- Field accessorField = new FieldResolver(Constructor.class).resolve("constructorAccessor");
- ConstructorAccessor constructorAccessor = (ConstructorAccessor) accessorField.get(constructor);
- if (constructorAccessor == null) {
- new MethodResolver(Constructor.class).resolve("acquireConstructorAccessor").invoke(constructor);
- constructorAccessor = (ConstructorAccessor) accessorField.get(constructor);
- }
- return constructorAccessor.newInstance(values);
-
- }
-
-}
diff --git a/rpapi-patch_1_11_R1/src/main/java/io/github/dre2n/dungeonsxl/util/resourcepackapi/packet/PacketPlayResourcePackStatus_v1_11_R1.java b/rpapi-patch_1_11_R1/src/main/java/io/github/dre2n/dungeonsxl/util/resourcepackapi/packet/PacketPlayResourcePackStatus_v1_11_R1.java
deleted file mode 100644
index fb13f3ef..00000000
--- a/rpapi-patch_1_11_R1/src/main/java/io/github/dre2n/dungeonsxl/util/resourcepackapi/packet/PacketPlayResourcePackStatus_v1_11_R1.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Copyright 2016 inventivetalent. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those of the
- * authors and contributors and should not be interpreted as representing official policies,
- * either expressed or implied, of anybody else.
- */
-
-package io.github.dre2n.dungeonsxl.util.resourcepackapi.packet;
-
-import io.netty.buffer.ByteBuf;
-import io.netty.channel.Channel;
-import io.netty.channel.ChannelHandlerContext;
-import io.netty.handler.codec.ByteToMessageDecoder;
-import java.lang.reflect.Field;
-import java.util.List;
-import net.minecraft.server.v1_11_R1.EntityPlayer;
-import net.minecraft.server.v1_11_R1.NetworkManager;
-import net.minecraft.server.v1_11_R1.Packet;
-import net.minecraft.server.v1_11_R1.PacketPlayInResourcePackStatus;
-import org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer;
-import org.bukkit.entity.Player;
-import org.inventivetalent.rpapi.IPacketPlayResourcePackStatus;
-import org.inventivetalent.rpapi.RPApiPlugin;
-import org.inventivetalent.rpapi.Status;
-
-public class PacketPlayResourcePackStatus_v1_11_R1 implements IPacketPlayResourcePackStatus
-{
- private Status status;
- private Player p;
- private static Field channelField;
-
- @Override
- public Status getStatus() {
- /*SL:55*/return this.status;
- }
-
- @Override
- public String getHash() {
- /*SL:60*/return null;
- }
-
- @Override
- public void onPacketReceive(final Object v2, final Player v3) {
- /*SL:65*/if (!(v2 instanceof Packet)) {
- return;
- }
- /*SL:66*/this.p = v3;
- try {
- final Field a1 = /*EL:69*/PacketPlayInResourcePackStatus.class.getDeclaredField("status");
- /*SL:70*/a1.setAccessible(true);
- /*SL:72*/this.status = Status.byID(((PacketPlayInResourcePackStatus.EnumResourcePackStatus)a1.get(v2)).ordinal());
- }
- catch (Exception a2) {
- /*SL:74*/a2.printStackTrace();
- }
- /*SL:77*/if (this.getStatus() != null && v3 != null) {
- /*SL:78*/RPApiPlugin.onResourcePackResult(this.getStatus(), v3, this.getHash());
- }
- }
-
- @Override
- public void inject() throws NoSuchFieldException, IllegalAccessException {
- }
-
- @Override
- public void addChannelForPlayer(final Player v0) {
- /*SL:90*/if (PacketPlayResourcePackStatus_v1_11_R1.channelField == null) {
- try {
- PacketPlayResourcePackStatus_v1_11_R1.channelField = /*EL:92*/NetworkManager.class.getDeclaredField("channel");
- }
- catch (NoSuchFieldException | SecurityException a1) {
- /*SL:94*/a1.printStackTrace();
- }
- PacketPlayResourcePackStatus_v1_11_R1.channelField.setAccessible(/*EL:96*/true);
- }
- try {
- final EntityPlayer v = /*EL:99*/((CraftPlayer)v0).getHandle();
- final Channel v2 = (Channel)PacketPlayResourcePackStatus_v1_11_R1.channelField.get(/*EL:100*/v.playerConnection.networkManager);
- /*SL:101*/new Thread(new Runnable() {
- @Override
- public void run() {
- try {
- /*SL:106*//*EL:109*/v2.pipeline().addBefore("packet_handler", "RPApi", (io.netty.channel.ChannelHandler)new ChannelHandler(v0));
- }
- catch (Exception ex) {}
- }
- }, "RPApi channel adder").start();
- }
- catch (Exception v3) {
- /*SL:112*/v3.printStackTrace();
- }
- }
-
- @Override
- public void removeChannelForPlayer(final Player v0) {
- /*SL:118*/if (PacketPlayResourcePackStatus_v1_11_R1.channelField == null) {
- try {
- PacketPlayResourcePackStatus_v1_11_R1.channelField = /*EL:120*/NetworkManager.class.getDeclaredField("channel");
- }
- catch (NoSuchFieldException | SecurityException a1) {
- /*SL:122*/a1.printStackTrace();
- }
- PacketPlayResourcePackStatus_v1_11_R1.channelField.setAccessible(/*EL:124*/true);
- }
- try {
- final EntityPlayer v = /*EL:127*/((CraftPlayer)v0).getHandle();
- final Channel v2 = (Channel)PacketPlayResourcePackStatus_v1_11_R1.channelField.get(/*EL:128*/v.playerConnection.networkManager);
- /*SL:129*/new Thread(new Runnable() {
- @Override
- public void run() {
- try {
- /*SL:134*//*EL:137*/v2.pipeline().remove("RPApi");
- }
- catch (Exception ex) {}
- }
- }, "RPApi channel remover").start();
- }
- catch (Exception v3) {
- /*SL:140*/v3.printStackTrace();
- }
- }
-
- public class ChannelHandler extends ByteToMessageDecoder
- {
- private Player p;
-
- public ChannelHandler(final Player a2) {
- this.p = a2;
- }
-
- public void channelRead(final ChannelHandlerContext a1, final Object a2) throws Exception {
- /*SL:154*/if (PacketPlayInResourcePackStatus.class.isAssignableFrom(a2.getClass())) {
- /*SL:155*/PacketPlayResourcePackStatus_v1_11_R1.this.onPacketReceive(a2, this.p);
- }
- /*SL:157*/super.channelRead(a1, a2);
- }
-
- protected void decode(final ChannelHandlerContext a1, final ByteBuf a2, final List a3) throws Exception {
- }
- }
-}
diff --git a/shade/pom.xml b/shade/pom.xml
deleted file mode 100644
index b0aec633..00000000
--- a/shade/pom.xml
+++ /dev/null
@@ -1,111 +0,0 @@
-
- 4.0.0
- io.github.dre2n
- dungeonsxl-shade
- ${parent.version}
- jar
- dungeonsxl-shade
-
- io.github.dre2n
- dungeonsxl
- 0.15.7-SNAPSHOT
-
-
- dungeonsxl-${project.version}${buildNo}
-
-
- org.apache.maven.plugins
- maven-shade-plugin
- 2.4.3
-
-
- package
-
- shade
-
-
-
-
- io.github.dre2n.commons
- io.github.dre2n.dungeonsxl.util.commons
-
-
- org.inventivetalent.rpapi
- io.github.dre2n.dungeonsxl.util.resourcepackapi
-
-
- org.inventivetalent.reflection
- io.github.dre2n.dungeonsxl.util.reflectionhelper
-
-
- de.inventivegames.rpapi
- io.github.dre2n.dungeonsxl.util.resourcepackapi
-
-
-
-
- io.github.dre2n:commons
- io.github.dre2n:caliburn
- io.github.dre2n:dungeonsxl-*
- org.inventivetalent:reflection
- org.inventivetalent.resourcepackapi:*
-
-
-
-
-
-
-
-
-
-
- io.github.dre2n
- dungeonsxl-abstract
- ${parent.version}
- jar
- compile
-
-
- io.github.dre2n
- dungeonsxl-core
- ${parent.version}
- jar
- compile
-
-
- io.github.dre2n
- dungeonsxl-rpapi-patch_1_11_R1
- ${parent.version}
- jar
- compile
-
-
- io.github.dre2n
- dungeonsxl-craftbukkit_1_11_R1
- ${parent.version}
- jar
- compile
-
-
- io.github.dre2n
- dungeonsxl-craftbukkit_1_10_R1
- ${parent.version}
- jar
- compile
-
-
- io.github.dre2n
- dungeonsxl-craftbukkit_1_9_R2
- ${parent.version}
- jar
- compile
-
-
- io.github.dre2n
- dungeonsxl-craftbukkit_1_9_R1
- ${parent.version}
- jar
- compile
-
-
-
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/DungeonsXL.java b/src/main/java/io/github/dre2n/dungeonsxl/DungeonsXL.java
similarity index 71%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/DungeonsXL.java
rename to src/main/java/io/github/dre2n/dungeonsxl/DungeonsXL.java
index f0536fb3..883d492f 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/DungeonsXL.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/DungeonsXL.java
@@ -19,33 +19,33 @@ package io.github.dre2n.dungeonsxl;
import io.github.dre2n.caliburn.CaliburnAPI;
import io.github.dre2n.commons.compatibility.Internals;
import io.github.dre2n.commons.config.MessageConfig;
-import io.github.dre2n.commons.javaplugin.BRPlugin;
-import io.github.dre2n.commons.javaplugin.BRPluginSettings;
-import io.github.dre2n.dungeonsxl.announcer.Announcers;
-import io.github.dre2n.dungeonsxl.command.DCommands;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.commons.javaplugin.DREPlugin;
+import io.github.dre2n.commons.javaplugin.DREPluginSettings;
+import io.github.dre2n.dungeonsxl.announcer.AnnouncerCache;
+import io.github.dre2n.dungeonsxl.command.DCommandCache;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.config.GlobalData;
import io.github.dre2n.dungeonsxl.config.MainConfig;
-import io.github.dre2n.dungeonsxl.dungeon.Dungeons;
+import io.github.dre2n.dungeonsxl.dungeon.DungeonCache;
import io.github.dre2n.dungeonsxl.game.Game;
-import io.github.dre2n.dungeonsxl.game.GameTypes;
-import io.github.dre2n.dungeonsxl.global.GlobalProtections;
-import io.github.dre2n.dungeonsxl.loottable.DLootTables;
-import io.github.dre2n.dungeonsxl.mob.DMobTypes;
-import io.github.dre2n.dungeonsxl.mob.ExternalMobProviders;
+import io.github.dre2n.dungeonsxl.game.GameTypeCache;
+import io.github.dre2n.dungeonsxl.global.GlobalProtectionCache;
+import io.github.dre2n.dungeonsxl.loottable.DLootTableCache;
+import io.github.dre2n.dungeonsxl.mob.DMobTypeCache;
+import io.github.dre2n.dungeonsxl.mob.ExternalMobProviderCache;
import io.github.dre2n.dungeonsxl.player.DClasses;
import io.github.dre2n.dungeonsxl.player.DGamePlayer;
import io.github.dre2n.dungeonsxl.player.DGroup;
import io.github.dre2n.dungeonsxl.player.DPermissions;
-import io.github.dre2n.dungeonsxl.player.DPlayers;
-import io.github.dre2n.dungeonsxl.requirement.RequirementTypes;
+import io.github.dre2n.dungeonsxl.player.DPlayerCache;
+import io.github.dre2n.dungeonsxl.requirement.RequirementTypeCache;
import io.github.dre2n.dungeonsxl.reward.DLootInventory;
-import io.github.dre2n.dungeonsxl.reward.RewardTypes;
-import io.github.dre2n.dungeonsxl.sign.DSignTypes;
+import io.github.dre2n.dungeonsxl.reward.RewardTypeCache;
+import io.github.dre2n.dungeonsxl.sign.DSignTypeCache;
import io.github.dre2n.dungeonsxl.sign.SignScripts;
-import io.github.dre2n.dungeonsxl.trigger.TriggerTypes;
+import io.github.dre2n.dungeonsxl.trigger.TriggerTypeCache;
import io.github.dre2n.dungeonsxl.util.NoReload;
-import io.github.dre2n.dungeonsxl.world.DWorlds;
+import io.github.dre2n.dungeonsxl.world.DWorldCache;
import java.io.File;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
@@ -57,7 +57,7 @@ import org.bukkit.event.HandlerList;
*
* @author Frank Baumann, Tobias Schmitz, Daniel Saukel
*/
-public class DungeonsXL extends BRPlugin {
+public class DungeonsXL extends DREPlugin {
private static DungeonsXL instance;
@@ -78,22 +78,22 @@ public class DungeonsXL extends BRPlugin {
private MainConfig mainConfig;
private MessageConfig messageConfig;
- private DCommands dCommands;
- private DSignTypes dSigns;
- private GameTypes gameTypes;
- private RequirementTypes requirementTypes;
- private RewardTypes rewardTypes;
- private TriggerTypes triggers;
- private Dungeons dungeons;
- private GlobalProtections protections;
- private ExternalMobProviders dMobProviders;
- private DPlayers dPlayers;
- private Announcers announcers;
+ private DCommandCache dCommands;
+ private DSignTypeCache dSigns;
+ private GameTypeCache gameTypes;
+ private RequirementTypeCache requirementTypes;
+ private RewardTypeCache rewardTypes;
+ private TriggerTypeCache triggers;
+ private DungeonCache dungeons;
+ private GlobalProtectionCache protections;
+ private ExternalMobProviderCache dMobProviders;
+ private DPlayerCache dPlayers;
+ private AnnouncerCache announcers;
private DClasses dClasses;
- private DLootTables dLootTables;
- private DMobTypes dMobTypes;
+ private DLootTableCache dLootTables;
+ private DMobTypeCache dMobTypes;
private SignScripts signScripts;
- private DWorlds dWorlds;
+ private DWorldCache dWorlds;
private CopyOnWriteArrayList dLootInventories = new CopyOnWriteArrayList<>();
private CopyOnWriteArrayList games = new CopyOnWriteArrayList<>();
@@ -114,7 +114,7 @@ public class DungeonsXL extends BRPlugin {
* ##########################
*/
- settings = new BRPluginSettings(true, true, true, true, true, 9488, Internals.andHigher(Internals.v1_7_R3));
+ settings = new DREPluginSettings(true, true, true, true, true, 9488, Internals.andHigher(Internals.v1_7_R3));
}
@Override
@@ -244,7 +244,7 @@ public class DungeonsXL extends BRPlugin {
loadDLootTables(LOOT_TABLES);
loadDMobTypes(MOBS);
loadSignScripts(SIGNS);
- loadDCommands();
+ loadDCommandCache();
}
// Save and load
@@ -279,8 +279,8 @@ public class DungeonsXL extends BRPlugin {
/**
* @return the loaded instance of GlobalData
*/
- public static GlobalData getGlobalData() {
- return instance.globalData;
+ public GlobalData getGlobalData() {
+ return globalData;
}
/**
@@ -293,8 +293,8 @@ public class DungeonsXL extends BRPlugin {
/**
* @return the loaded instance of MainConfig
*/
- public static MainConfig getMainConfig() {
- return instance.mainConfig;
+ public MainConfig getMainConfig() {
+ return mainConfig;
}
/**
@@ -307,178 +307,178 @@ public class DungeonsXL extends BRPlugin {
/**
* @return the loaded instance of MessageConfig
*/
- public static MessageConfig getMessageConfig() {
- return instance.messageConfig;
+ public MessageConfig getMessageConfig() {
+ return messageConfig;
}
/**
* load / reload a new instance of MessageConfig
*/
public void loadMessageConfig(File file) {
- messageConfig = new MessageConfig(DMessages.class, file);
+ messageConfig = new MessageConfig(DMessage.class, file);
}
/**
- * @return the loaded instance of DCommands
+ * @return the loaded instance of DCommandCache
*/
@Override
- public DCommands getCommands() {
+ public DCommandCache getCommandCache() {
return dCommands;
}
/**
- * load / reload a new instance of DCommands
+ * load / reload a new instance of DCommandCache
*/
- public void loadDCommands() {
- dCommands = new DCommands(this);
+ public void loadDCommandCache() {
+ dCommands = new DCommandCache(this);
dCommands.register(this);
}
/**
* @return the dSigns
*/
- public static DSignTypes getDSigns() {
- return instance.dSigns;
+ public DSignTypeCache getDSigns() {
+ return dSigns;
}
/**
* load / reload a new instance of DSignTypes
*/
public void loadDSigns() {
- dSigns = new DSignTypes();
+ dSigns = new DSignTypeCache();
}
/**
* @return the game types
*/
- public static GameTypes getGameTypes() {
- return instance.gameTypes;
+ public GameTypeCache getGameTypes() {
+ return gameTypes;
}
/**
* load / reload a new instance of GameTypes
*/
public void loadGameTypes() {
- gameTypes = new GameTypes();
+ gameTypes = new GameTypeCache();
}
/**
* @return the requirement types
*/
- public static RequirementTypes getRequirementTypes() {
- return instance.requirementTypes;
+ public RequirementTypeCache getRequirementTypes() {
+ return requirementTypes;
}
/**
* load / reload a new instance of RequirementTypes
*/
public void loadRequirementTypes() {
- requirementTypes = new RequirementTypes();
+ requirementTypes = new RequirementTypeCache();
}
/**
* @return the reward types
*/
- public static RewardTypes getRewardTypes() {
- return instance.rewardTypes;
+ public RewardTypeCache getRewardTypes() {
+ return rewardTypes;
}
/**
* load / reload a new instance of RewardTypes
*/
public void loadRewardTypes() {
- rewardTypes = new RewardTypes();
+ rewardTypes = new RewardTypeCache();
}
/**
* @return the triggers
*/
- public static TriggerTypes getTriggers() {
- return instance.triggers;
+ public TriggerTypeCache getTriggers() {
+ return triggers;
}
/**
* load / reload a new instance of TriggerTypes
*/
public void loadTriggers() {
- triggers = new TriggerTypes();
+ triggers = new TriggerTypeCache();
}
/**
* @return the loaded instance of Dungeons
*/
- public static Dungeons getDungeons() {
- return instance.dungeons;
+ public DungeonCache getDungeons() {
+ return dungeons;
}
/**
* load / reload a new instance of Dungeons
*/
public void loadDungeons(File file) {
- dungeons = new Dungeons(file);
+ dungeons = new DungeonCache(file);
}
/**
* @return the loaded instance of GlobalProtections
*/
- public static GlobalProtections getGlobalProtections() {
- return instance.protections;
+ public GlobalProtectionCache getGlobalProtections() {
+ return protections;
}
/**
* load / reload a new instance of GlobalProtections
*/
public void loadGlobalProtections() {
- protections = new GlobalProtections();
+ protections = new GlobalProtectionCache();
}
/**
* @return the loaded instance of ExternalMobProviders
*/
- public static ExternalMobProviders getExternalMobProviders() {
- return instance.dMobProviders;
+ public ExternalMobProviderCache getExternalMobProviders() {
+ return dMobProviders;
}
/**
* load / reload a new instance of ExternalMobProviders
*/
public void loadExternalMobProviders() {
- dMobProviders = new ExternalMobProviders();
+ dMobProviders = new ExternalMobProviderCache();
}
/**
* @return the loaded instance of DPlayers
*/
- public static DPlayers getDPlayers() {
- return instance.dPlayers;
+ public DPlayerCache getDPlayers() {
+ return dPlayers;
}
/**
* load / reload a new instance of DPlayers
*/
public void loadDPlayers() {
- dPlayers = new DPlayers();
+ dPlayers = new DPlayerCache();
}
/**
* @return the loaded instance of Announcers
*/
- public static Announcers getAnnouncers() {
- return instance.announcers;
+ public AnnouncerCache getAnnouncers() {
+ return announcers;
}
/**
* load / reload a new instance of Announcers
*/
public void loadAnnouncers(File file) {
- announcers = new Announcers(file);
+ announcers = new AnnouncerCache(file);
}
/**
* @return the loaded instance of DClasses
*/
- public static DClasses getDClasses() {
- return instance.dClasses;
+ public DClasses getDClasses() {
+ return dClasses;
}
/**
@@ -491,36 +491,36 @@ public class DungeonsXL extends BRPlugin {
/**
* @return the loaded instance of DLootTables
*/
- public static DLootTables getDLootTables() {
- return instance.dLootTables;
+ public DLootTableCache getDLootTables() {
+ return dLootTables;
}
/**
* load / reload a new instance of DLootTables
*/
public void loadDLootTables(File file) {
- dLootTables = new DLootTables(file);
+ dLootTables = new DLootTableCache(file);
}
/**
* @return the loaded instance of DMobTypes
*/
- public static DMobTypes getDMobTypes() {
- return instance.dMobTypes;
+ public DMobTypeCache getDMobTypes() {
+ return dMobTypes;
}
/**
* load / reload a new instance of DMobTypes
*/
public void loadDMobTypes(File file) {
- dMobTypes = new DMobTypes(file);
+ dMobTypes = new DMobTypeCache(file);
}
/**
* @return the loaded instance of SignScripts
*/
- public static SignScripts getSignScripts() {
- return instance.signScripts;
+ public SignScripts getSignScripts() {
+ return signScripts;
}
/**
@@ -533,36 +533,36 @@ public class DungeonsXL extends BRPlugin {
/**
* @return the loaded instance of DWorlds
*/
- public static DWorlds getDWorlds() {
- return instance.dWorlds;
+ public DWorldCache getDWorlds() {
+ return dWorlds;
}
/**
* load / reload a new instance of DWorlds
*/
public void loadDWorlds(File folder) {
- dWorlds = new DWorlds(MAPS);
+ dWorlds = new DWorldCache(MAPS);
}
/**
* @return the dLootInventories
*/
- public static List getDLootInventories() {
- return instance.dLootInventories;
+ public List getDLootInventories() {
+ return dLootInventories;
}
/**
* @return the games
*/
- public static List getGames() {
- return instance.games;
+ public List getGames() {
+ return games;
}
/**
* @return the dGroups
*/
- public static List getDGroups() {
- return instance.dGroups;
+ public List getDGroups() {
+ return dGroups;
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/announcer/Announcer.java b/src/main/java/io/github/dre2n/dungeonsxl/announcer/Announcer.java
similarity index 94%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/announcer/Announcer.java
rename to src/main/java/io/github/dre2n/dungeonsxl/announcer/Announcer.java
index 5595e94c..0c40f04c 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/announcer/Announcer.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/announcer/Announcer.java
@@ -16,15 +16,15 @@
*/
package io.github.dre2n.dungeonsxl.announcer;
+import io.github.dre2n.commons.chat.DefaultFontInfo;
+import io.github.dre2n.commons.chat.MessageUtil;
import io.github.dre2n.commons.compatibility.CompatibilityHandler;
-import io.github.dre2n.commons.util.guiutil.GUIUtil;
-import io.github.dre2n.commons.util.messageutil.DefaultFontInfo;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.dungeon.Dungeon;
import io.github.dre2n.dungeonsxl.event.dgroup.DGroupCreateEvent;
import io.github.dre2n.dungeonsxl.player.DGroup;
+import io.github.dre2n.dungeonsxl.util.GUIUtil;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
@@ -96,7 +96,7 @@ public class Announcer {
if (multiFloor) {
dungeonName = identifier;
- Dungeon dungeon = DungeonsXL.getDungeons().getByName(identifier);
+ Dungeon dungeon = DungeonsXL.getInstance().getDungeons().getByName(identifier);
if (dungeon != null) {
mapName = dungeon.getConfig().getStartFloor().getName();
}
@@ -137,7 +137,7 @@ public class Announcer {
if (multiFloor) {
dungeonName = identifier;
- Dungeon dungeon = DungeonsXL.getDungeons().getByName(identifier);
+ Dungeon dungeon = DungeonsXL.getInstance().getDungeons().getByName(identifier);
if (dungeon != null) {
mapName = dungeon.getConfig().getStartFloor().getName();
}
@@ -333,7 +333,7 @@ public class Announcer {
if (CompatibilityHandler.getInstance().isSpigot()) {
ClickEvent onClick = new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/dungeonsxl join " + name);
- BaseComponent[] message = TextComponent.fromLegacyText(ChatColor.translateAlternateColorCodes('&', DMessages.ANNOUNCER_CLICK.getMessage()));
+ BaseComponent[] message = TextComponent.fromLegacyText(ChatColor.translateAlternateColorCodes('&', DMessage.ANNOUNCER_CLICK.getMessage()));
for (BaseComponent slice : message) {
slice.setClickEvent(onClick);
}
@@ -345,7 +345,7 @@ public class Announcer {
player.spigot().sendMessage(toSend.toArray(new BaseComponent[]{}));
} else {
- MessageUtil.sendCenteredMessage(player, DMessages.ANNOUNCER_CMD.getMessage(getName().toUpperCase()));
+ MessageUtil.sendCenteredMessage(player, DMessage.ANNOUNCER_CMD.getMessage(getName().toUpperCase()));
}
}
@@ -423,7 +423,7 @@ public class Announcer {
List lore = new ArrayList<>();
DGroup dGroup = dGroups.get(groupCount);
- if (!DungeonsXL.getDGroups().contains(dGroup)) {
+ if (!DungeonsXL.getInstance().getDGroups().contains(dGroup)) {
dGroups.set(groupCount, null);
} else if (dGroup != null) {
@@ -436,7 +436,7 @@ public class Announcer {
boolean full = playerCount >= maxPlayersPerGroup;
- ItemStack button = new ItemStack(Material.WOOL, playerCount, DungeonsXL.getMainConfig().getGroupColorPriority().get(groupCount).getWoolData());
+ ItemStack button = new ItemStack(Material.WOOL, playerCount, DungeonsXL.getInstance().getMainConfig().getGroupColorPriority().get(groupCount).getWoolData());
ItemMeta meta = button.getItemMeta();
meta.setDisplayName(name + (full ? ChatColor.DARK_RED : ChatColor.GREEN) + " [" + playerCount + "/" + maxPlayersPerGroup + "]");
meta.setLore(lore);
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/announcer/Announcers.java b/src/main/java/io/github/dre2n/dungeonsxl/announcer/AnnouncerCache.java
similarity index 93%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/announcer/Announcers.java
rename to src/main/java/io/github/dre2n/dungeonsxl/announcer/AnnouncerCache.java
index b2c821c6..970bc86f 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/announcer/Announcers.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/announcer/AnnouncerCache.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.announcer;
-import io.github.dre2n.commons.util.FileUtil;
+import io.github.dre2n.commons.misc.FileUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import java.io.File;
import java.util.ArrayList;
@@ -30,7 +30,7 @@ import org.bukkit.scheduler.BukkitTask;
*
* @author Daniel Saukel
*/
-public class Announcers {
+public class AnnouncerCache {
DungeonsXL plugin = DungeonsXL.getInstance();
@@ -38,13 +38,13 @@ public class Announcers {
private List announcers = new ArrayList<>();
- public Announcers(File file) {
+ public AnnouncerCache(File file) {
if (file.isDirectory()) {
for (File script : FileUtil.getFilesForFolder(file)) {
announcers.add(new Announcer(script));
}
}
- startAnnouncerTask(DungeonsXL.getMainConfig().getAnnouncmentInterval());
+ startAnnouncerTask(DungeonsXL.getInstance().getMainConfig().getAnnouncmentInterval());
}
/**
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/announcer/AnnouncerListener.java b/src/main/java/io/github/dre2n/dungeonsxl/announcer/AnnouncerListener.java
similarity index 77%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/announcer/AnnouncerListener.java
rename to src/main/java/io/github/dre2n/dungeonsxl/announcer/AnnouncerListener.java
index 5d48f6a3..a0b795b6 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/announcer/AnnouncerListener.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/announcer/AnnouncerListener.java
@@ -16,11 +16,11 @@
*/
package io.github.dre2n.dungeonsxl.announcer;
-import io.github.dre2n.commons.util.guiutil.ButtonClickEvent;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
+import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
@@ -30,17 +30,15 @@ import org.bukkit.inventory.ItemStack;
public class AnnouncerListener implements Listener {
@EventHandler
- public void onButtonClick(ButtonClickEvent event) {
- Player player = event.getPlayer();
-
- Inventory gui = event.getGUI();
- if (!DungeonsXL.getInstance().getGUIs().contains(gui)) {
+ public void onButtonClick(InventoryClickEvent event) {
+ if (!(event.getWhoClicked() instanceof Player)) {
return;
}
+ Player player = (Player) event.getWhoClicked();
+ Inventory gui = event.getInventory();
ItemStack button = gui.getItem(event.getSlot());
- Announcer announcer = DungeonsXL.getAnnouncers().getByGUI(gui);
-
+ Announcer announcer = DungeonsXL.getInstance().getAnnouncers().getByGUI(gui);
if (announcer != null) {
announcer.clickGroupButton(player, button);
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/announcer/AnnouncerStartGameTask.java b/src/main/java/io/github/dre2n/dungeonsxl/announcer/AnnouncerStartGameTask.java
similarity index 95%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/announcer/AnnouncerStartGameTask.java
rename to src/main/java/io/github/dre2n/dungeonsxl/announcer/AnnouncerStartGameTask.java
index efcaca56..135d9c1e 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/announcer/AnnouncerStartGameTask.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/announcer/AnnouncerStartGameTask.java
@@ -71,7 +71,7 @@ public class AnnouncerStartGameTask extends BukkitRunnable {
}
if (game == null) {
- game = new Game(dGroup, DungeonsXL.getDWorlds().getResourceByName(announcer.getMapName()));
+ game = new Game(dGroup, DungeonsXL.getInstance().getDWorlds().getResourceByName(announcer.getMapName()));
} else {
game.getDGroups().add(dGroup);
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/announcer/AnnouncerTask.java b/src/main/java/io/github/dre2n/dungeonsxl/announcer/AnnouncerTask.java
similarity index 92%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/announcer/AnnouncerTask.java
rename to src/main/java/io/github/dre2n/dungeonsxl/announcer/AnnouncerTask.java
index 43615453..5ab159a0 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/announcer/AnnouncerTask.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/announcer/AnnouncerTask.java
@@ -32,7 +32,7 @@ public class AnnouncerTask extends BukkitRunnable {
private List announcers;
private int index;
- public AnnouncerTask(Announcers announcers) {
+ public AnnouncerTask(AnnouncerCache announcers) {
this.announcers = announcers.getAnnouncers();
index = 0;
}
@@ -42,7 +42,7 @@ public class AnnouncerTask extends BukkitRunnable {
Announcer announcer = announcers.get(index);
List worlds = announcer.getWorlds();
for (Player player : Bukkit.getOnlinePlayers()) {
- DGlobalPlayer dPlayer = DungeonsXL.getDPlayers().getByPlayer(player);
+ DGlobalPlayer dPlayer = DungeonsXL.getInstance().getDPlayers().getByPlayer(player);
if (!(dPlayer instanceof DInstancePlayer) && dPlayer.isAnnouncerEnabled()) {
if (worlds.isEmpty() || worlds.contains(player.getWorld().getName())) {
announcer.send(player);
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/command/BreakCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/BreakCommand.java
similarity index 73%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/command/BreakCommand.java
rename to src/main/java/io/github/dre2n/dungeonsxl/command/BreakCommand.java
index 1cb641ae..fab031bf 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/command/BreakCommand.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/command/BreakCommand.java
@@ -16,10 +16,10 @@
*/
package io.github.dre2n.dungeonsxl.command;
-import io.github.dre2n.commons.command.BRCommand;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.command.DRECommand;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.player.DGlobalPlayer;
import io.github.dre2n.dungeonsxl.player.DPermissions;
import org.bukkit.command.CommandSender;
@@ -28,13 +28,13 @@ import org.bukkit.entity.Player;
/**
* @author Daniel Saukel
*/
-public class BreakCommand extends BRCommand {
+public class BreakCommand extends DRECommand {
public BreakCommand() {
setCommand("break");
setMinArgs(0);
setMaxArgs(0);
- setHelp(DMessages.HELP_CMD_BREAK.getMessage());
+ setHelp(DMessage.HELP_CMD_BREAK.getMessage());
setPermission(DPermissions.BREAK.getNode());
setPlayerCommand(true);
}
@@ -42,15 +42,15 @@ public class BreakCommand extends BRCommand {
@Override
public void onExecute(String[] args, CommandSender sender) {
Player player = (Player) sender;
- DGlobalPlayer dGlobalPlayer = DungeonsXL.getDPlayers().getByPlayer(player);
+ DGlobalPlayer dGlobalPlayer = DungeonsXL.getInstance().getDPlayers().getByPlayer(player);
if (dGlobalPlayer.isInBreakMode()) {
dGlobalPlayer.setInBreakMode(false);
- MessageUtil.sendMessage(sender, DMessages.CMD_BREAK_PROTECTED_MODE.getMessage());
+ MessageUtil.sendMessage(sender, DMessage.CMD_BREAK_PROTECTED_MODE.getMessage());
} else {
dGlobalPlayer.setInBreakMode(true);
- MessageUtil.sendMessage(sender, DMessages.CMD_BREAK_BREAK_MODE.getMessage());
+ MessageUtil.sendMessage(sender, DMessage.CMD_BREAK_BREAK_MODE.getMessage());
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/command/ChatCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/ChatCommand.java
similarity index 75%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/command/ChatCommand.java
rename to src/main/java/io/github/dre2n/dungeonsxl/command/ChatCommand.java
index 2de25d41..0e936620 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/command/ChatCommand.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/command/ChatCommand.java
@@ -16,10 +16,10 @@
*/
package io.github.dre2n.dungeonsxl.command;
-import io.github.dre2n.commons.command.BRCommand;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.command.DRECommand;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.player.DGlobalPlayer;
import io.github.dre2n.dungeonsxl.player.DGroup;
import io.github.dre2n.dungeonsxl.player.DPermissions;
@@ -29,13 +29,13 @@ import org.bukkit.entity.Player;
/**
* @author Frank Baumann, Daniel Saukel
*/
-public class ChatCommand extends BRCommand {
+public class ChatCommand extends DRECommand {
public ChatCommand() {
setCommand("chat");
setMinArgs(0);
setMaxArgs(0);
- setHelp(DMessages.HELP_CMD_CHAT.getMessage());
+ setHelp(DMessage.HELP_CMD_CHAT.getMessage());
setPermission(DPermissions.CHAT.getNode());
setPlayerCommand(true);
}
@@ -43,15 +43,15 @@ public class ChatCommand extends BRCommand {
@Override
public void onExecute(String[] args, CommandSender sender) {
Player player = (Player) sender;
- DGlobalPlayer dPlayer = DungeonsXL.getDPlayers().getByPlayer(player);
+ DGlobalPlayer dPlayer = DungeonsXL.getInstance().getDPlayers().getByPlayer(player);
if (DGroup.getByPlayer(player) == null) {
- MessageUtil.sendMessage(player, DMessages.ERROR_JOIN_GROUP.getMessage());
+ MessageUtil.sendMessage(player, DMessage.ERROR_JOIN_GROUP.getMessage());
return;
}
dPlayer.setInGroupChat(!dPlayer.isInGroupChat());
- MessageUtil.sendMessage(player, (dPlayer.isInGroupChat() ? DMessages.CMD_CHAT_DUNGEON_CHAT : DMessages.CMD_CHAT_NORMAL_CHAT).getMessage());
+ MessageUtil.sendMessage(player, (dPlayer.isInGroupChat() ? DMessage.CMD_CHAT_DUNGEON_CHAT : DMessage.CMD_CHAT_NORMAL_CHAT).getMessage());
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/command/ChatSpyCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/ChatSpyCommand.java
similarity index 77%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/command/ChatSpyCommand.java
rename to src/main/java/io/github/dre2n/dungeonsxl/command/ChatSpyCommand.java
index 69f5f96e..4c45ce21 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/command/ChatSpyCommand.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/command/ChatSpyCommand.java
@@ -16,10 +16,10 @@
*/
package io.github.dre2n.dungeonsxl.command;
-import io.github.dre2n.commons.command.BRCommand;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.command.DRECommand;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.player.DGlobalPlayer;
import io.github.dre2n.dungeonsxl.player.DPermissions;
import org.bukkit.command.CommandSender;
@@ -28,13 +28,13 @@ import org.bukkit.entity.Player;
/**
* @author Frank Baumann, Daniel Saukel
*/
-public class ChatSpyCommand extends BRCommand {
+public class ChatSpyCommand extends DRECommand {
public ChatSpyCommand() {
setCommand("chatSpy");
setMinArgs(0);
setMaxArgs(0);
- setHelp(DMessages.HELP_CMD_CHATSPY.getMessage());
+ setHelp(DMessage.HELP_CMD_CHATSPY.getMessage());
setPermission(DPermissions.CHAT_SPY.getNode());
setPlayerCommand(true);
}
@@ -42,10 +42,10 @@ public class ChatSpyCommand extends BRCommand {
@Override
public void onExecute(String[] args, CommandSender sender) {
Player player = (Player) sender;
- DGlobalPlayer dPlayer = DungeonsXL.getDPlayers().getByPlayer(player);
+ DGlobalPlayer dPlayer = DungeonsXL.getInstance().getDPlayers().getByPlayer(player);
dPlayer.setInChatSpyMode(!dPlayer.isInChatSpyMode());
- MessageUtil.sendMessage(player, (dPlayer.isInChatSpyMode() ? DMessages.CMD_CHATSPY_START : DMessages.CMD_CHATSPY_STOPPED).getMessage());
+ MessageUtil.sendMessage(player, (dPlayer.isInChatSpyMode() ? DMessage.CMD_CHATSPY_START : DMessage.CMD_CHATSPY_STOPPED).getMessage());
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/command/CreateCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/CreateCommand.java
similarity index 67%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/command/CreateCommand.java
rename to src/main/java/io/github/dre2n/dungeonsxl/command/CreateCommand.java
index 79814d0a..2ece0656 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/command/CreateCommand.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/command/CreateCommand.java
@@ -16,10 +16,10 @@
*/
package io.github.dre2n.dungeonsxl.command;
-import io.github.dre2n.commons.command.BRCommand;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.command.DRECommand;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.player.DEditPlayer;
import io.github.dre2n.dungeonsxl.player.DGamePlayer;
import io.github.dre2n.dungeonsxl.player.DPermissions;
@@ -33,7 +33,7 @@ import org.bukkit.entity.Player;
/**
* @author Frank Baumann, Daniel Saukel
*/
-public class CreateCommand extends BRCommand {
+public class CreateCommand extends DRECommand {
DungeonsXL plugin = DungeonsXL.getInstance();
@@ -41,7 +41,7 @@ public class CreateCommand extends BRCommand {
setMinArgs(1);
setMaxArgs(1);
setCommand("create");
- setHelp(DMessages.HELP_CMD_CREATE.getMessage());
+ setHelp(DMessage.HELP_CMD_CREATE.getMessage());
setPermission(DPermissions.CREATE.getNode());
setPlayerCommand(true);
setConsoleCommand(true);
@@ -52,49 +52,49 @@ public class CreateCommand extends BRCommand {
String name = args[1];
if (new File(DungeonsXL.MAPS, name).exists()) {
- MessageUtil.sendMessage(sender, DMessages.ERROR_NAME_IN_USE.getMessage(name));
+ MessageUtil.sendMessage(sender, DMessage.ERROR_NAME_IN_USE.getMessage(name));
return;
}
if (name.length() > 15) {
- MessageUtil.sendMessage(sender, DMessages.ERROR_NAME_TO_LONG.getMessage());
+ MessageUtil.sendMessage(sender, DMessage.ERROR_NAME_TO_LONG.getMessage());
return;
}
if (sender instanceof ConsoleCommandSender) {
// Msg create
- MessageUtil.log(plugin, DMessages.LOG_NEW_MAP.getMessage());
- MessageUtil.log(plugin, DMessages.LOG_GENERATE_NEW_WORLD.getMessage());
+ MessageUtil.log(plugin, DMessage.LOG_NEW_MAP.getMessage());
+ MessageUtil.log(plugin, DMessage.LOG_GENERATE_NEW_WORLD.getMessage());
// Create World
- DResourceWorld resource = new DResourceWorld(DungeonsXL.getDWorlds(), name);
- DungeonsXL.getDWorlds().addResource(resource);
+ DResourceWorld resource = new DResourceWorld(DungeonsXL.getInstance().getDWorlds(), name);
+ DungeonsXL.getInstance().getDWorlds().addResource(resource);
DEditWorld editWorld = resource.generate();
editWorld.save();
editWorld.delete();
// MSG Done
- MessageUtil.log(plugin, DMessages.LOG_WORLD_GENERATION_FINISHED.getMessage());
+ MessageUtil.log(plugin, DMessage.LOG_WORLD_GENERATION_FINISHED.getMessage());
} else if (sender instanceof Player) {
Player player = (Player) sender;
if (DGamePlayer.getByPlayer(player) != null) {
- MessageUtil.sendMessage(player, DMessages.ERROR_LEAVE_DUNGEON.getMessage());
+ MessageUtil.sendMessage(player, DMessage.ERROR_LEAVE_DUNGEON.getMessage());
return;
}
// Msg create
- MessageUtil.log(plugin, DMessages.LOG_NEW_MAP.getMessage());
- MessageUtil.log(plugin, DMessages.LOG_GENERATE_NEW_WORLD.getMessage());
+ MessageUtil.log(plugin, DMessage.LOG_NEW_MAP.getMessage());
+ MessageUtil.log(plugin, DMessage.LOG_GENERATE_NEW_WORLD.getMessage());
// Create World
- DResourceWorld resource = new DResourceWorld(DungeonsXL.getDWorlds(), name);
- DungeonsXL.getDWorlds().addResource(resource);
+ DResourceWorld resource = new DResourceWorld(DungeonsXL.getInstance().getDWorlds(), name);
+ DungeonsXL.getInstance().getDWorlds().addResource(resource);
DEditWorld editWorld = resource.generate();
// MSG Done
- MessageUtil.log(plugin, DMessages.LOG_WORLD_GENERATION_FINISHED.getMessage());
+ MessageUtil.log(plugin, DMessage.LOG_WORLD_GENERATION_FINISHED.getMessage());
// Tp Player
DEditPlayer.create(player, editWorld);
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/command/DCommands.java b/src/main/java/io/github/dre2n/dungeonsxl/command/DCommandCache.java
similarity index 92%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/command/DCommands.java
rename to src/main/java/io/github/dre2n/dungeonsxl/command/DCommandCache.java
index 25b2a466..19fb7b1d 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/command/DCommands.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/command/DCommandCache.java
@@ -16,8 +16,8 @@
*/
package io.github.dre2n.dungeonsxl.command;
-import io.github.dre2n.commons.command.BRCommands;
-import io.github.dre2n.commons.javaplugin.BRPlugin;
+import io.github.dre2n.commons.command.DRECommandCache;
+import io.github.dre2n.commons.javaplugin.DREPlugin;
import io.github.dre2n.dungeonsxl.DungeonsXL;
/**
@@ -25,7 +25,7 @@ import io.github.dre2n.dungeonsxl.DungeonsXL;
*
* @author Daniel Saukel
*/
-public class DCommands extends BRCommands {
+public class DCommandCache extends DRECommandCache {
public static BreakCommand BREAK = new BreakCommand();
public static ChatCommand CHAT = new ChatCommand();
@@ -58,7 +58,7 @@ public class DCommands extends BRCommands {
public static TestCommand TEST = new TestCommand();
public static UninviteCommand UNINVITE = new UninviteCommand();
- public DCommands(BRPlugin plugin) {
+ public DCommandCache(DREPlugin plugin) {
super("dungeonsxl", plugin,
BREAK,
CREATE,
@@ -90,7 +90,7 @@ public class DCommands extends BRCommands {
UNINVITE,
new DeletePortalCommand()
);
- if (DungeonsXL.getMainConfig().isChatEnabled()) {
+ if (DungeonsXL.getInstance().getMainConfig().isChatEnabled()) {
addCommand(CHAT);
addCommand(CHAT_SPY);
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/command/DeleteCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/DeleteCommand.java
similarity index 76%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/command/DeleteCommand.java
rename to src/main/java/io/github/dre2n/dungeonsxl/command/DeleteCommand.java
index 4a45cac9..c06985c6 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/command/DeleteCommand.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/command/DeleteCommand.java
@@ -16,33 +16,32 @@
*/
package io.github.dre2n.dungeonsxl.command;
-import io.github.dre2n.commons.command.BRCommand;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.command.DRECommand;
import io.github.dre2n.commons.compatibility.CompatibilityHandler;
-import io.github.dre2n.commons.util.FileUtil;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.misc.FileUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.player.DPermissions;
import io.github.dre2n.dungeonsxl.world.DEditWorld;
import io.github.dre2n.dungeonsxl.world.DResourceWorld;
-import io.github.dre2n.dungeonsxl.world.DWorlds;
+import io.github.dre2n.dungeonsxl.world.DWorldCache;
import java.io.File;
import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.chat.TextComponent;
-import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
/**
* @author Daniel Saukel
*/
-public class DeleteCommand extends BRCommand {
+public class DeleteCommand extends DRECommand {
public DeleteCommand() {
setCommand("delete");
setMinArgs(1);
setMaxArgs(2);
- setHelp(DMessages.HELP_CMD_DELETE.getMessage());
+ setHelp(DMessage.HELP_CMD_DELETE.getMessage());
setPermission(DPermissions.DELETE.getNode());
setPlayerCommand(true);
setConsoleCommand(true);
@@ -50,24 +49,24 @@ public class DeleteCommand extends BRCommand {
@Override
public void onExecute(String[] args, CommandSender sender) {
- DWorlds dWorlds = DungeonsXL.getDWorlds();
+ DWorldCache dWorlds = DungeonsXL.getInstance().getDWorlds();
DResourceWorld resource = dWorlds.getResourceByName(args[1]);
if (resource == null) {
- MessageUtil.sendMessage(sender, DMessages.ERROR_NO_SUCH_MAP.getMessage(args[1]));
+ MessageUtil.sendMessage(sender, DMessage.ERROR_NO_SUCH_MAP.getMessage(args[1]));
return;
}
if (args.length == 2 && CompatibilityHandler.getInstance().isSpigot() && sender instanceof Player) {
ClickEvent onClickConfirm = new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/dungeonsxl delete " + args[1] + " true");
- TextComponent confirm = new TextComponent(DMessages.MISC_YES.getMessage());
+ TextComponent confirm = new TextComponent(DMessage.MISC_YES.getMessage());
confirm.setClickEvent(onClickConfirm);
ClickEvent onClickDeny = new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/dungeonsxl delete " + args[1] + " false");
- TextComponent deny = new TextComponent(DMessages.MISC_NO.getMessage());
+ TextComponent deny = new TextComponent(DMessage.MISC_NO.getMessage());
deny.setClickEvent(onClickDeny);
- MessageUtil.sendMessage(sender, DMessages.CMD_DELETE_BACKUPS.getMessage());
+ MessageUtil.sendMessage(sender, DMessage.CMD_DELETE_BACKUPS.getMessage());
((Player) sender).spigot().sendMessage(confirm, new TextComponent(" "), deny);
return;
@@ -89,7 +88,7 @@ public class DeleteCommand extends BRCommand {
}
}
- MessageUtil.sendMessage(sender, DMessages.CMD_DELETE_SUCCESS.getMessage(args[1]));
+ MessageUtil.sendMessage(sender, DMessage.CMD_DELETE_SUCCESS.getMessage(args[1]));
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/command/DeletePortalCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/DeletePortalCommand.java
similarity index 79%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/command/DeletePortalCommand.java
rename to src/main/java/io/github/dre2n/dungeonsxl/command/DeletePortalCommand.java
index 4c388e0e..87d907b8 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/command/DeletePortalCommand.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/command/DeletePortalCommand.java
@@ -16,9 +16,9 @@
*/
package io.github.dre2n.dungeonsxl.command;
-import io.github.dre2n.commons.command.BRCommand;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.command.DRECommand;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.global.DPortal;
import java.util.Set;
import org.bukkit.Material;
@@ -30,7 +30,7 @@ import org.bukkit.entity.Player;
* @deprecated Use BreakCommand instead.
*/
@Deprecated
-public class DeletePortalCommand extends BRCommand {
+public class DeletePortalCommand extends DRECommand {
public DeletePortalCommand() {
setCommand("deleteportal");
@@ -48,10 +48,10 @@ public class DeletePortalCommand extends BRCommand {
if (dPortal != null) {
dPortal.delete();
- MessageUtil.sendMessage(player, DMessages.PLAYER_PROTECTED_BLOCK_DELETED.getMessage());
+ MessageUtil.sendMessage(player, DMessage.PLAYER_PROTECTED_BLOCK_DELETED.getMessage());
} else {
- MessageUtil.sendMessage(player, DMessages.ERROR_NO_PROTECTED_BLOCK.getMessage());
+ MessageUtil.sendMessage(player, DMessage.ERROR_NO_PROTECTED_BLOCK.getMessage());
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/command/EditCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/EditCommand.java
similarity index 71%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/command/EditCommand.java
rename to src/main/java/io/github/dre2n/dungeonsxl/command/EditCommand.java
index 15fc3348..ceb1ddee 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/command/EditCommand.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/command/EditCommand.java
@@ -16,10 +16,10 @@
*/
package io.github.dre2n.dungeonsxl.command;
-import io.github.dre2n.commons.command.BRCommand;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.command.DRECommand;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.player.DEditPlayer;
import io.github.dre2n.dungeonsxl.player.DGlobalPlayer;
import io.github.dre2n.dungeonsxl.player.DGroup;
@@ -27,22 +27,22 @@ import io.github.dre2n.dungeonsxl.player.DInstancePlayer;
import io.github.dre2n.dungeonsxl.player.DPermissions;
import io.github.dre2n.dungeonsxl.world.DEditWorld;
import io.github.dre2n.dungeonsxl.world.DResourceWorld;
-import io.github.dre2n.dungeonsxl.world.DWorlds;
+import io.github.dre2n.dungeonsxl.world.DWorldCache;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
/**
* @author Frank Baumann, Milan Albrecht, Daniel Saukel
*/
-public class EditCommand extends BRCommand {
+public class EditCommand extends DRECommand {
- DWorlds worlds = DungeonsXL.getDWorlds();
+ DWorldCache worlds = DungeonsXL.getInstance().getDWorlds();
public EditCommand() {
setCommand("edit");
setMinArgs(1);
setMaxArgs(1);
- setHelp(DMessages.HELP_CMD_EDIT.getMessage());
+ setHelp(DMessage.HELP_CMD_EDIT.getMessage());
setPlayerCommand(true);
}
@@ -52,32 +52,32 @@ public class EditCommand extends BRCommand {
String mapName = args[1];
if (!worlds.exists(mapName)) {
- MessageUtil.sendMessage(player, DMessages.ERROR_DUNGEON_NOT_EXIST.getMessage(mapName));
+ MessageUtil.sendMessage(player, DMessage.ERROR_DUNGEON_NOT_EXIST.getMessage(mapName));
return;
}
DResourceWorld resource = worlds.getResourceByName(mapName);
if (resource == null) {
- MessageUtil.sendMessage(sender, DMessages.ERROR_NO_SUCH_MAP.getMessage(mapName));
+ MessageUtil.sendMessage(sender, DMessage.ERROR_NO_SUCH_MAP.getMessage(mapName));
return;
}
if (!resource.isInvitedPlayer(player) && !DPermissions.hasPermission(player, DPermissions.EDIT)) {
- MessageUtil.sendMessage(player, DMessages.ERROR_NO_PERMISSIONS.getMessage());
+ MessageUtil.sendMessage(player, DMessage.ERROR_NO_PERMISSIONS.getMessage());
return;
}
DEditWorld editWorld = resource.instantiateAsEditWorld();
DGroup dGroup = DGroup.getByPlayer(player);
- DGlobalPlayer dPlayer = DungeonsXL.getDPlayers().getByPlayer(player);
+ DGlobalPlayer dPlayer = DungeonsXL.getInstance().getDPlayers().getByPlayer(player);
if (dPlayer instanceof DInstancePlayer) {
- MessageUtil.sendMessage(player, DMessages.ERROR_LEAVE_DUNGEON.getMessage());
+ MessageUtil.sendMessage(player, DMessage.ERROR_LEAVE_DUNGEON.getMessage());
return;
}
if (dGroup != null) {
- MessageUtil.sendMessage(player, DMessages.ERROR_LEAVE_GROUP.getMessage());
+ MessageUtil.sendMessage(player, DMessage.ERROR_LEAVE_GROUP.getMessage());
return;
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/command/EnterCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/EnterCommand.java
similarity index 77%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/command/EnterCommand.java
rename to src/main/java/io/github/dre2n/dungeonsxl/command/EnterCommand.java
index e663e34c..66630fd7 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/command/EnterCommand.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/command/EnterCommand.java
@@ -16,9 +16,9 @@
*/
package io.github.dre2n.dungeonsxl.command;
-import io.github.dre2n.commons.command.BRCommand;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.command.DRECommand;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.game.Game;
import io.github.dre2n.dungeonsxl.player.DGamePlayer;
import io.github.dre2n.dungeonsxl.player.DGroup;
@@ -30,13 +30,13 @@ import org.bukkit.entity.Player;
/**
* @author Daniel Saukel
*/
-public class EnterCommand extends BRCommand {
+public class EnterCommand extends DRECommand {
public EnterCommand() {
setMinArgs(1);
setMaxArgs(2);
setCommand("enter");
- setHelp(DMessages.HELP_CMD_ENTER.getMessage());
+ setHelp(DMessage.HELP_CMD_ENTER.getMessage());
setPermission(DPermissions.ENTER.getNode());
setPlayerCommand(true);
}
@@ -57,18 +57,18 @@ public class EnterCommand extends BRCommand {
}
if (target == null) {
- MessageUtil.sendMessage(sender, DMessages.ERROR_NO_SUCH_GROUP.getMessage(targetName));
+ MessageUtil.sendMessage(sender, DMessage.ERROR_NO_SUCH_GROUP.getMessage(targetName));
return;
}
Game game = Game.getByDGroup(target);
if (game == null) {
- MessageUtil.sendMessage(sender, DMessages.ERROR_NOT_IN_GAME.getMessage(targetName));
+ MessageUtil.sendMessage(sender, DMessage.ERROR_NOT_IN_GAME.getMessage(targetName));
return;
}
if (Game.getByDGroup(joining) != null) {
- MessageUtil.sendMessage(sender, DMessages.ERROR_LEAVE_GAME.getMessage());
+ MessageUtil.sendMessage(sender, DMessage.ERROR_LEAVE_GAME.getMessage());
return;
}
@@ -77,13 +77,13 @@ public class EnterCommand extends BRCommand {
}
if (joining.getCaptain() != captain && !DPermissions.hasPermission(sender, DPermissions.BYPASS)) {
- MessageUtil.sendMessage(sender, DMessages.ERROR_NOT_CAPTAIN.getMessage());
+ MessageUtil.sendMessage(sender, DMessage.ERROR_NOT_CAPTAIN.getMessage());
return;
}
joining.setGameWorld(game.getWorld());
game.addDGroup(joining);
- joining.sendMessage(DMessages.CMD_ENTER_SUCCESS.getMessage(joining.getName(), target.getName()));
+ joining.sendMessage(DMessage.CMD_ENTER_SUCCESS.getMessage(joining.getName(), target.getName()));
for (Player player : joining.getPlayers()) {
DGamePlayer.create(player, game.getWorld(), game.getType());
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/command/EscapeCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/EscapeCommand.java
similarity index 79%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/command/EscapeCommand.java
rename to src/main/java/io/github/dre2n/dungeonsxl/command/EscapeCommand.java
index f1905865..8979f665 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/command/EscapeCommand.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/command/EscapeCommand.java
@@ -16,9 +16,9 @@
*/
package io.github.dre2n.dungeonsxl.command;
-import io.github.dre2n.commons.command.BRCommand;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.command.DRECommand;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.player.DEditPlayer;
import io.github.dre2n.dungeonsxl.player.DGamePlayer;
import io.github.dre2n.dungeonsxl.player.DGroup;
@@ -30,13 +30,13 @@ import org.bukkit.entity.Player;
/**
* @author Milan Albrecht, Daniel Saukel
*/
-public class EscapeCommand extends BRCommand {
+public class EscapeCommand extends DRECommand {
public EscapeCommand() {
setCommand("escape");
setMinArgs(0);
setMaxArgs(0);
- setHelp(DMessages.HELP_CMD_ESCAPE.getMessage());
+ setHelp(DMessage.HELP_CMD_ESCAPE.getMessage());
setPermission(DPermissions.ESCAPE.getNode());
setPlayerCommand(true);
}
@@ -47,7 +47,7 @@ public class EscapeCommand extends BRCommand {
DEditPlayer dPlayer = DEditPlayer.getByPlayer(player);
if (DGamePlayer.getByPlayer(player) != null) {
- MessageUtil.sendMessage(player, DMessages.ERROR_LEAVE_DUNGEON.getMessage());
+ MessageUtil.sendMessage(player, DMessage.ERROR_LEAVE_DUNGEON.getMessage());
} else if (dPlayer != null) {
dPlayer.escape();
@@ -65,10 +65,10 @@ public class EscapeCommand extends BRCommand {
DGroup dGroup = DGroup.getByPlayer(player);
if (dGroup != null) {
dGroup.removePlayer(player);
- MessageUtil.sendMessage(player, DMessages.CMD_LEAVE_SUCCESS.getMessage());
+ MessageUtil.sendMessage(player, DMessage.CMD_LEAVE_SUCCESS.getMessage());
return;
}
- MessageUtil.sendMessage(player, DMessages.ERROR_NOT_IN_DUNGEON.getMessage());
+ MessageUtil.sendMessage(player, DMessage.ERROR_NOT_IN_DUNGEON.getMessage());
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/command/GameCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/GameCommand.java
similarity index 83%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/command/GameCommand.java
rename to src/main/java/io/github/dre2n/dungeonsxl/command/GameCommand.java
index acc035ec..1ca2ef23 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/command/GameCommand.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/command/GameCommand.java
@@ -16,9 +16,9 @@
*/
package io.github.dre2n.dungeonsxl.command;
-import io.github.dre2n.commons.command.BRCommand;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.command.DRECommand;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.game.Game;
import io.github.dre2n.dungeonsxl.player.DGroup;
import io.github.dre2n.dungeonsxl.player.DPermissions;
@@ -29,13 +29,13 @@ import org.bukkit.entity.Player;
/**
* @author Daniel Saukel
*/
-public class GameCommand extends BRCommand {
+public class GameCommand extends DRECommand {
public GameCommand() {
setCommand("game");
setMinArgs(0);
setMaxArgs(0);
- setHelp(DMessages.HELP_CMD_GAME.getMessage());
+ setHelp(DMessage.HELP_CMD_GAME.getMessage());
setPermission(DPermissions.GAME.getNode());
setPlayerCommand(true);
}
@@ -45,19 +45,19 @@ public class GameCommand extends BRCommand {
Player player = (Player) sender;
DGroup dGroup = DGroup.getByPlayer(player);
if (dGroup == null) {
- MessageUtil.sendMessage(sender, DMessages.ERROR_JOIN_GROUP.getMessage());
+ MessageUtil.sendMessage(sender, DMessage.ERROR_JOIN_GROUP.getMessage());
return;
}
DGameWorld gameWorld = dGroup.getGameWorld();
if (gameWorld == null) {
- MessageUtil.sendMessage(sender, DMessages.ERROR_NO_GAME.getMessage());
+ MessageUtil.sendMessage(sender, DMessage.ERROR_NO_GAME.getMessage());
return;
}
Game game = gameWorld.getGame();
if (game == null) {
- MessageUtil.sendMessage(sender, DMessages.ERROR_NO_GAME.getMessage());
+ MessageUtil.sendMessage(sender, DMessage.ERROR_NO_GAME.getMessage());
return;
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/command/GroupCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/GroupCommand.java
similarity index 76%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/command/GroupCommand.java
rename to src/main/java/io/github/dre2n/dungeonsxl/command/GroupCommand.java
index 543667bc..a4c1a4b4 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/command/GroupCommand.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/command/GroupCommand.java
@@ -16,10 +16,10 @@
*/
package io.github.dre2n.dungeonsxl.command;
-import io.github.dre2n.commons.command.BRCommand;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.command.DRECommand;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.event.dgroup.DGroupCreateEvent;
import io.github.dre2n.dungeonsxl.event.dgroup.DGroupDisbandEvent;
import io.github.dre2n.dungeonsxl.event.dplayer.DPlayerKickEvent;
@@ -33,13 +33,13 @@ import org.bukkit.entity.Player;
/**
* @author Daniel Saukel
*/
-public class GroupCommand extends BRCommand {
+public class GroupCommand extends DRECommand {
public GroupCommand() {
setCommand("group");
setMinArgs(0);
setMaxArgs(2);
- setHelp(DMessages.HELP_CMD_GROUP.getMessage());
+ setHelp(DMessage.HELP_CMD_GROUP.getMessage());
setPermission(DPermissions.GROUP.getNode());
setPlayerCommand(true);
}
@@ -113,12 +113,12 @@ public class GroupCommand extends BRCommand {
public void createGroup() {
if (DGroup.getByPlayer(player) != null) {
- MessageUtil.sendMessage(sender, DMessages.ERROR_LEAVE_GROUP.getMessage());
+ MessageUtil.sendMessage(sender, DMessage.ERROR_LEAVE_GROUP.getMessage());
return;
}
if (DGroup.getByName(args[2]) != null) {
- MessageUtil.sendMessage(sender, DMessages.ERROR_NAME_IN_USE.getMessage(args[2]));
+ MessageUtil.sendMessage(sender, DMessage.ERROR_NAME_IN_USE.getMessage(args[2]));
return;
}
@@ -131,18 +131,18 @@ public class GroupCommand extends BRCommand {
dGroup = null;
} else {
- MessageUtil.sendMessage(sender, DMessages.GROUP_CREATED.getMessage(sender.getName(), args[2]));
+ MessageUtil.sendMessage(sender, DMessage.GROUP_CREATED.getMessage(sender.getName(), args[2]));
}
}
public void disbandGroup(DGroup dGroup) {
if (dGroup == null) {
- MessageUtil.sendMessage(sender, DMessages.ERROR_NO_SUCH_GROUP.getMessage());
+ MessageUtil.sendMessage(sender, DMessage.ERROR_NO_SUCH_GROUP.getMessage());
return;
}
if (dGroup.isPlaying()) {
- MessageUtil.sendMessage(sender, DMessages.ERROR_LEAVE_DUNGEON.getMessage());
+ MessageUtil.sendMessage(sender, DMessage.ERROR_LEAVE_DUNGEON.getMessage());
return;
}
@@ -151,14 +151,14 @@ public class GroupCommand extends BRCommand {
if (!event.isCancelled()) {
dGroup.delete();
- MessageUtil.sendMessage(sender, DMessages.GROUP_DISBANDED.getMessage(sender.getName(), dGroup.getName()));
+ MessageUtil.sendMessage(sender, DMessage.GROUP_DISBANDED.getMessage(sender.getName(), dGroup.getName()));
dGroup = null;
}
}
public void invitePlayer(DGroup dGroup) {
if (dGroup == null) {
- MessageUtil.sendMessage(sender, DMessages.ERROR_JOIN_GROUP.getMessage());
+ MessageUtil.sendMessage(sender, DMessage.ERROR_JOIN_GROUP.getMessage());
return;
}
@@ -168,13 +168,13 @@ public class GroupCommand extends BRCommand {
dGroup.addInvitedPlayer(toInvite, false);
} else {
- MessageUtil.sendMessage(sender, DMessages.ERROR_NO_SUCH_PLAYER.getMessage(args[2]));
+ MessageUtil.sendMessage(sender, DMessage.ERROR_NO_SUCH_PLAYER.getMessage(args[2]));
}
}
public void uninvitePlayer(DGroup dGroup) {
if (dGroup == null) {
- MessageUtil.sendMessage(sender, DMessages.ERROR_JOIN_GROUP.getMessage());
+ MessageUtil.sendMessage(sender, DMessage.ERROR_JOIN_GROUP.getMessage());
return;
}
@@ -187,27 +187,27 @@ public class GroupCommand extends BRCommand {
dGroup.removeInvitedPlayer(toUninvite, false);
} else {
- MessageUtil.sendMessage(sender, DMessages.ERROR_NOT_IN_GROUP.getMessage(args[2]));
+ MessageUtil.sendMessage(sender, DMessage.ERROR_NOT_IN_GROUP.getMessage(args[2]));
}
} else {
- MessageUtil.sendMessage(sender, DMessages.ERROR_NO_SUCH_PLAYER.getMessage(args[2]));
+ MessageUtil.sendMessage(sender, DMessage.ERROR_NO_SUCH_PLAYER.getMessage(args[2]));
}
}
public void joinGroup(DGroup dGroup) {
if (dGroup == null) {
- MessageUtil.sendMessage(sender, DMessages.ERROR_NO_SUCH_GROUP.getMessage(args[2]));
+ MessageUtil.sendMessage(sender, DMessage.ERROR_NO_SUCH_GROUP.getMessage(args[2]));
return;
}
if (DGroup.getByPlayer(player) != null) {
- MessageUtil.sendMessage(sender, DMessages.ERROR_LEAVE_GROUP.getMessage());
+ MessageUtil.sendMessage(sender, DMessage.ERROR_LEAVE_GROUP.getMessage());
return;
}
if (!dGroup.getInvitedPlayers().contains(player) && !DPermissions.hasPermission(player, DPermissions.BYPASS)) {
- MessageUtil.sendMessage(sender, DMessages.ERROR_NOT_INVITED.getMessage(args[2]));
+ MessageUtil.sendMessage(sender, DMessage.ERROR_NOT_INVITED.getMessage(args[2]));
return;
}
@@ -217,7 +217,7 @@ public class GroupCommand extends BRCommand {
public void kickPlayer(DGroup dGroup) {
if (dGroup == null) {
- MessageUtil.sendMessage(sender, DMessages.ERROR_JOIN_GROUP.getMessage());
+ MessageUtil.sendMessage(sender, DMessage.ERROR_JOIN_GROUP.getMessage());
}
Player toKick = Bukkit.getPlayer(args[2]);
@@ -228,25 +228,25 @@ public class GroupCommand extends BRCommand {
if (!event.isCancelled()) {
if (dGroup.getPlayers().contains(toKick)) {
dGroup.removePlayer(toKick);
- MessageUtil.sendMessage(sender, DMessages.GROUP_KICKED_PLAYER.getMessage(sender.getName(), args[2], dGroup.getName()));
+ MessageUtil.sendMessage(sender, DMessage.GROUP_KICKED_PLAYER.getMessage(sender.getName(), args[2], dGroup.getName()));
} else {
- MessageUtil.sendMessage(sender, DMessages.ERROR_NOT_IN_GROUP.getMessage(args[2], dGroup.getName()));
+ MessageUtil.sendMessage(sender, DMessage.ERROR_NOT_IN_GROUP.getMessage(args[2], dGroup.getName()));
}
}
} else {
- MessageUtil.sendMessage(sender, DMessages.ERROR_NO_SUCH_PLAYER.getMessage(args[2]));
+ MessageUtil.sendMessage(sender, DMessage.ERROR_NO_SUCH_PLAYER.getMessage(args[2]));
}
}
public void showGroup(DGroup dGroup) {
if (dGroup == null) {
if (args.length == 3) {
- MessageUtil.sendMessage(sender, DMessages.ERROR_NO_SUCH_GROUP.getMessage(args[2]));
+ MessageUtil.sendMessage(sender, DMessage.ERROR_NO_SUCH_GROUP.getMessage(args[2]));
} else if (args.length == 2) {
- MessageUtil.sendMessage(sender, DMessages.ERROR_JOIN_GROUP.getMessage());
+ MessageUtil.sendMessage(sender, DMessage.ERROR_JOIN_GROUP.getMessage());
}
return;
@@ -270,16 +270,16 @@ public class GroupCommand extends BRCommand {
switch (page) {
default:
MessageUtil.sendCenteredMessage(sender, "&4&l[ &61-5 &4/ &67 &4| &61 &4&l]");
- MessageUtil.sendMessage(sender, "&bcreate" + "&7 - " + DMessages.HELP_CMD_GROUP_CREATE.getMessage());
- MessageUtil.sendMessage(sender, "&bdisband" + "&7 - " + DMessages.HELP_CMD_GROUP_DISBAND.getMessage());
- MessageUtil.sendMessage(sender, "&binvite" + "&7 - " + DMessages.HELP_CMD_GROUP_INVITE.getMessage());
- MessageUtil.sendMessage(sender, "&buninvite" + "&7 - " + DMessages.HELP_CMD_GROUP_UNINVITE.getMessage());
- MessageUtil.sendMessage(sender, "&bjoin" + "&7 - " + DMessages.HELP_CMD_GROUP_JOIN.getMessage());
+ MessageUtil.sendMessage(sender, "&bcreate" + "&7 - " + DMessage.HELP_CMD_GROUP_CREATE.getMessage());
+ MessageUtil.sendMessage(sender, "&bdisband" + "&7 - " + DMessage.HELP_CMD_GROUP_DISBAND.getMessage());
+ MessageUtil.sendMessage(sender, "&binvite" + "&7 - " + DMessage.HELP_CMD_GROUP_INVITE.getMessage());
+ MessageUtil.sendMessage(sender, "&buninvite" + "&7 - " + DMessage.HELP_CMD_GROUP_UNINVITE.getMessage());
+ MessageUtil.sendMessage(sender, "&bjoin" + "&7 - " + DMessage.HELP_CMD_GROUP_JOIN.getMessage());
break;
case "2":
MessageUtil.sendCenteredMessage(sender, "&4&l[ &66-10 &4/ &67 &4| &62 &4&l]");
- MessageUtil.sendMessage(sender, "&bkick" + "&7 - " + DMessages.HELP_CMD_GROUP_KICK.getMessage());
- MessageUtil.sendMessage(sender, "&bshow" + "&7 - " + DMessages.HELP_CMD_GROUP_SHOW.getMessage());
+ MessageUtil.sendMessage(sender, "&bkick" + "&7 - " + DMessage.HELP_CMD_GROUP_KICK.getMessage());
+ MessageUtil.sendMessage(sender, "&bshow" + "&7 - " + DMessage.HELP_CMD_GROUP_SHOW.getMessage());
break;
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/command/HelpCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/HelpCommand.java
similarity index 79%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/command/HelpCommand.java
rename to src/main/java/io/github/dre2n/dungeonsxl/command/HelpCommand.java
index 7ab85b07..e3e75e55 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/command/HelpCommand.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/command/HelpCommand.java
@@ -16,11 +16,11 @@
*/
package io.github.dre2n.dungeonsxl.command;
-import io.github.dre2n.commons.command.BRCommand;
-import io.github.dre2n.commons.util.NumberUtil;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.command.DRECommand;
+import io.github.dre2n.commons.misc.NumberUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.player.DPermissions;
import java.util.ArrayList;
import java.util.Set;
@@ -29,7 +29,7 @@ import org.bukkit.command.CommandSender;
/**
* @author Frank Baumann, Daniel Saukel
*/
-public class HelpCommand extends BRCommand {
+public class HelpCommand extends DRECommand {
DungeonsXL plugin = DungeonsXL.getInstance();
@@ -37,7 +37,7 @@ public class HelpCommand extends BRCommand {
setCommand("help");
setMinArgs(0);
setMaxArgs(1);
- setHelp(DMessages.HELP_CMD_HELP.getMessage());
+ setHelp(DMessage.HELP_CMD_HELP.getMessage());
setPermission(DPermissions.HELP.getNode());
setPlayerCommand(true);
setConsoleCommand(true);
@@ -45,8 +45,8 @@ public class HelpCommand extends BRCommand {
@Override
public void onExecute(String[] args, CommandSender sender) {
- Set dCommandList = plugin.getCommands().getCommands();
- ArrayList toSend = new ArrayList<>();
+ Set dCommandList = plugin.getCommandCache().getCommands();
+ ArrayList toSend = new ArrayList<>();
int page = 1;
if (args.length == 2) {
@@ -55,7 +55,7 @@ public class HelpCommand extends BRCommand {
int send = 0;
int max = 0;
int min = 0;
- for (BRCommand dCommand : dCommandList) {
+ for (DRECommand dCommand : dCommandList) {
send++;
if (send >= page * 5 - 4 && send <= page * 5) {
min = page * 5 - 4;
@@ -67,7 +67,7 @@ public class HelpCommand extends BRCommand {
MessageUtil.sendPluginTag(sender, plugin);
MessageUtil.sendCenteredMessage(sender, "&4&l[ &6" + min + "-" + max + " &4/&6 " + send + " &4|&6 " + page + " &4&l]");
- for (BRCommand dCommand : toSend) {
+ for (DRECommand dCommand : toSend) {
MessageUtil.sendMessage(sender, "&b" + dCommand.getCommand() + "&7 - " + dCommand.getHelp());
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/command/ImportCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/ImportCommand.java
similarity index 70%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/command/ImportCommand.java
rename to src/main/java/io/github/dre2n/dungeonsxl/command/ImportCommand.java
index 26377c95..5d73096e 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/command/ImportCommand.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/command/ImportCommand.java
@@ -16,11 +16,11 @@
*/
package io.github.dre2n.dungeonsxl.command;
-import io.github.dre2n.commons.command.BRCommand;
-import io.github.dre2n.commons.util.FileUtil;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.command.DRECommand;
+import io.github.dre2n.commons.misc.FileUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.player.DPermissions;
import io.github.dre2n.dungeonsxl.world.DResourceWorld;
import java.io.File;
@@ -32,7 +32,7 @@ import org.bukkit.scheduler.BukkitRunnable;
/**
* @author Frank Baumann, Daniel Saukel
*/
-public class ImportCommand extends BRCommand {
+public class ImportCommand extends DRECommand {
DungeonsXL plugin = DungeonsXL.getInstance();
@@ -40,7 +40,7 @@ public class ImportCommand extends BRCommand {
setMinArgs(1);
setMaxArgs(1);
setCommand("import");
- setHelp(DMessages.HELP_CMD_IMPORT.getMessage());
+ setHelp(DMessage.HELP_CMD_IMPORT.getMessage());
setPermission(DPermissions.IMPORT.getNode());
setPlayerCommand(true);
setConsoleCommand(true);
@@ -52,12 +52,12 @@ public class ImportCommand extends BRCommand {
final File source = new File(Bukkit.getWorldContainer(), args[1]);
if (!source.exists()) {
- MessageUtil.sendMessage(sender, DMessages.ERROR_NO_SUCH_MAP.getMessage(args[1]));
+ MessageUtil.sendMessage(sender, DMessage.ERROR_NO_SUCH_MAP.getMessage(args[1]));
return;
}
if (target.exists()) {
- MessageUtil.sendMessage(sender, DMessages.ERROR_NAME_IN_USE.getMessage(args[1]));
+ MessageUtil.sendMessage(sender, DMessage.ERROR_NAME_IN_USE.getMessage(args[1]));
return;
}
@@ -66,10 +66,10 @@ public class ImportCommand extends BRCommand {
world.save();
}
- MessageUtil.log(plugin, DMessages.LOG_NEW_MAP.getMessage());
- MessageUtil.log(plugin, DMessages.LOG_IMPORT_WORLD.getMessage());
+ MessageUtil.log(plugin, DMessage.LOG_NEW_MAP.getMessage());
+ MessageUtil.log(plugin, DMessage.LOG_IMPORT_WORLD.getMessage());
- if (!DungeonsXL.getMainConfig().areTweaksEnabled()) {
+ if (!DungeonsXL.getInstance().getMainConfig().areTweaksEnabled()) {
FileUtil.copyDirectory(source, target, new String[]{"playerdata", "stats"});
} else {
@@ -81,8 +81,8 @@ public class ImportCommand extends BRCommand {
}.runTaskAsynchronously(plugin);
}
- DungeonsXL.getDWorlds().addResource(new DResourceWorld(DungeonsXL.getDWorlds(), args[1]));
- MessageUtil.sendMessage(sender, DMessages.CMD_IMPORT_SUCCESS.getMessage(args[1]));
+ DungeonsXL.getInstance().getDWorlds().addResource(new DResourceWorld(DungeonsXL.getInstance().getDWorlds(), args[1]));
+ MessageUtil.sendMessage(sender, DMessage.CMD_IMPORT_SUCCESS.getMessage(args[1]));
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/command/InviteCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/InviteCommand.java
similarity index 70%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/command/InviteCommand.java
rename to src/main/java/io/github/dre2n/dungeonsxl/command/InviteCommand.java
index d2c2c1a2..40e3a15b 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/command/InviteCommand.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/command/InviteCommand.java
@@ -16,10 +16,10 @@
*/
package io.github.dre2n.dungeonsxl.command;
-import io.github.dre2n.commons.command.BRCommand;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.command.DRECommand;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.player.DPermissions;
import io.github.dre2n.dungeonsxl.world.DResourceWorld;
import org.bukkit.Bukkit;
@@ -29,13 +29,13 @@ import org.bukkit.command.CommandSender;
/**
* @author Frank Baumann, Daniel Saukel
*/
-public class InviteCommand extends BRCommand {
+public class InviteCommand extends DRECommand {
public InviteCommand() {
setMinArgs(2);
setMaxArgs(2);
setCommand("invite");
- setHelp(DMessages.HELP_CMD_INVITE.getMessage());
+ setHelp(DMessage.HELP_CMD_INVITE.getMessage());
setPermission(DPermissions.INVITE.getNode());
setPlayerCommand(true);
setConsoleCommand(true);
@@ -43,20 +43,20 @@ public class InviteCommand extends BRCommand {
@Override
public void onExecute(String[] args, CommandSender sender) {
- DResourceWorld resource = DungeonsXL.getDWorlds().getResourceByName(args[2]);
+ DResourceWorld resource = DungeonsXL.getInstance().getDWorlds().getResourceByName(args[2]);
OfflinePlayer player = Bukkit.getOfflinePlayer(args[1]);
if (resource != null) {
if (player != null) {
resource.addInvitedPlayer(player);
- MessageUtil.sendMessage(sender, DMessages.CMD_INVITE_SUCCESS.getMessage(args[1], args[2]));
+ MessageUtil.sendMessage(sender, DMessage.CMD_INVITE_SUCCESS.getMessage(args[1], args[2]));
} else {
- MessageUtil.sendMessage(sender, DMessages.ERROR_NO_SUCH_PLAYER.getMessage(args[2]));
+ MessageUtil.sendMessage(sender, DMessage.ERROR_NO_SUCH_PLAYER.getMessage(args[2]));
}
} else {
- MessageUtil.sendMessage(sender, DMessages.ERROR_DUNGEON_NOT_EXIST.getMessage(args[2]));
+ MessageUtil.sendMessage(sender, DMessage.ERROR_DUNGEON_NOT_EXIST.getMessage(args[2]));
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/command/JoinCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/JoinCommand.java
similarity index 74%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/command/JoinCommand.java
rename to src/main/java/io/github/dre2n/dungeonsxl/command/JoinCommand.java
index a6086e49..f03b649d 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/command/JoinCommand.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/command/JoinCommand.java
@@ -16,11 +16,11 @@
*/
package io.github.dre2n.dungeonsxl.command;
-import io.github.dre2n.commons.command.BRCommand;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.command.DRECommand;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.announcer.Announcer;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.player.DGlobalPlayer;
import io.github.dre2n.dungeonsxl.player.DInstancePlayer;
import io.github.dre2n.dungeonsxl.player.DPermissions;
@@ -30,26 +30,26 @@ import org.bukkit.entity.Player;
/**
* @author Daniel Saukel
*/
-public class JoinCommand extends BRCommand {
+public class JoinCommand extends DRECommand {
public JoinCommand() {
setCommand("join");
setMinArgs(1);
setMaxArgs(1);
- setHelp(DMessages.HELP_CMD_JOIN.getMessage());
+ setHelp(DMessage.HELP_CMD_JOIN.getMessage());
setPermission(DPermissions.JOIN.getNode());
setPlayerCommand(true);
}
@Override
public void onExecute(String[] args, CommandSender sender) {
- DGlobalPlayer player = DungeonsXL.getDPlayers().getByPlayer((Player) sender);
+ DGlobalPlayer player = DungeonsXL.getInstance().getDPlayers().getByPlayer((Player) sender);
if (player instanceof DInstancePlayer) {
- MessageUtil.sendMessage(sender, DMessages.ERROR_LEAVE_GAME.getMessage());
+ MessageUtil.sendMessage(sender, DMessage.ERROR_LEAVE_GAME.getMessage());
return;
}
- Announcer announcer = DungeonsXL.getAnnouncers().getByName(args[1]);
+ Announcer announcer = DungeonsXL.getInstance().getAnnouncers().getByName(args[1]);
if (announcer != null) {
announcer.showGUI((Player) sender);
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/command/KickCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/KickCommand.java
similarity index 73%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/command/KickCommand.java
rename to src/main/java/io/github/dre2n/dungeonsxl/command/KickCommand.java
index 5cf0873d..0361b20b 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/command/KickCommand.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/command/KickCommand.java
@@ -16,10 +16,10 @@
*/
package io.github.dre2n.dungeonsxl.command;
-import io.github.dre2n.commons.command.BRCommand;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
-import static io.github.dre2n.dungeonsxl.command.DCommands.LEAVE;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.command.DRECommand;
+import static io.github.dre2n.dungeonsxl.command.DCommandCache.LEAVE;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.player.DPermissions;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
@@ -28,13 +28,13 @@ import org.bukkit.entity.Player;
/**
* @author Frank Baumann, Daniel Saukel
*/
-public class KickCommand extends BRCommand {
+public class KickCommand extends DRECommand {
public KickCommand() {
setCommand("kick");
setMinArgs(1);
setMaxArgs(1);
- setHelp(DMessages.HELP_CMD_KICK.getMessage());
+ setHelp(DMessage.HELP_CMD_KICK.getMessage());
setPermission(DPermissions.KICK.getNode());
setPlayerCommand(true);
setConsoleCommand(true);
@@ -46,10 +46,10 @@ public class KickCommand extends BRCommand {
if (player != null) {
LEAVE.onExecute(new String[]{LEAVE.getCommand()}, player);
- MessageUtil.sendMessage(sender, DMessages.CMD_KICK_SUCCESS.getMessage(player.getName()));
+ MessageUtil.sendMessage(sender, DMessage.CMD_KICK_SUCCESS.getMessage(player.getName()));
} else {
- MessageUtil.sendMessage(sender, DMessages.ERROR_NO_SUCH_PLAYER.getMessage(args[1]));
+ MessageUtil.sendMessage(sender, DMessage.ERROR_NO_SUCH_PLAYER.getMessage(args[1]));
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/command/LeaveCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/LeaveCommand.java
similarity index 82%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/command/LeaveCommand.java
rename to src/main/java/io/github/dre2n/dungeonsxl/command/LeaveCommand.java
index 13c899f9..35a3f0b2 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/command/LeaveCommand.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/command/LeaveCommand.java
@@ -16,10 +16,10 @@
*/
package io.github.dre2n.dungeonsxl.command;
-import io.github.dre2n.commons.command.BRCommand;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.command.DRECommand;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.event.dplayer.DPlayerLeaveDGroupEvent;
import io.github.dre2n.dungeonsxl.event.dplayer.instance.game.DGamePlayerEscapeEvent;
import io.github.dre2n.dungeonsxl.game.Game;
@@ -36,13 +36,13 @@ import org.bukkit.entity.Player;
/**
* @author Frank Baumann, Daniel Saukel
*/
-public class LeaveCommand extends BRCommand {
+public class LeaveCommand extends DRECommand {
public LeaveCommand() {
setCommand("leave");
setMinArgs(0);
setMaxArgs(0);
- setHelp(DMessages.HELP_CMD_LEAVE.getMessage());
+ setHelp(DMessage.HELP_CMD_LEAVE.getMessage());
setPermission(DPermissions.LEAVE.getNode());
setPlayerCommand(true);
}
@@ -50,18 +50,18 @@ public class LeaveCommand extends BRCommand {
@Override
public void onExecute(String[] args, CommandSender sender) {
Player player = (Player) sender;
- DGlobalPlayer dPlayer = DungeonsXL.getDPlayers().getByPlayer(player);
+ DGlobalPlayer dPlayer = DungeonsXL.getInstance().getDPlayers().getByPlayer(player);
Game game = Game.getByPlayer(player);
if (game != null && game.isTutorial()) {
- MessageUtil.sendMessage(player, DMessages.ERROR_NO_LEAVE_IN_TUTORIAL.getMessage());
+ MessageUtil.sendMessage(player, DMessage.ERROR_NO_LEAVE_IN_TUTORIAL.getMessage());
return;
}
DGroup dGroup = DGroup.getByPlayer(player);
if (dGroup == null && !(dPlayer instanceof DEditPlayer)) {
- MessageUtil.sendMessage(player, DMessages.ERROR_JOIN_GROUP.getMessage());
+ MessageUtil.sendMessage(player, DMessage.ERROR_JOIN_GROUP.getMessage());
return;
}
@@ -85,7 +85,7 @@ public class LeaveCommand extends BRCommand {
dGroup.removePlayer(player);
}
- MessageUtil.sendMessage(player, DMessages.CMD_LEAVE_SUCCESS.getMessage());
+ MessageUtil.sendMessage(player, DMessage.CMD_LEAVE_SUCCESS.getMessage());
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/command/ListCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/ListCommand.java
similarity index 90%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/command/ListCommand.java
rename to src/main/java/io/github/dre2n/dungeonsxl/command/ListCommand.java
index 27793965..ef8c6773 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/command/ListCommand.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/command/ListCommand.java
@@ -16,18 +16,18 @@
*/
package io.github.dre2n.dungeonsxl.command;
-import io.github.dre2n.commons.command.BRCommand;
-import io.github.dre2n.commons.util.NumberUtil;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.command.DRECommand;
+import io.github.dre2n.commons.misc.NumberUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.dungeon.Dungeon;
import io.github.dre2n.dungeonsxl.dungeon.DungeonConfig;
import io.github.dre2n.dungeonsxl.player.DPermissions;
import io.github.dre2n.dungeonsxl.world.DEditWorld;
import io.github.dre2n.dungeonsxl.world.DGameWorld;
import io.github.dre2n.dungeonsxl.world.DResourceWorld;
-import io.github.dre2n.dungeonsxl.world.DWorlds;
+import io.github.dre2n.dungeonsxl.world.DWorldCache;
import java.io.File;
import java.util.ArrayList;
import org.bukkit.command.CommandSender;
@@ -36,16 +36,16 @@ import org.bukkit.entity.Player;
/**
* @author Daniel Saukel
*/
-public class ListCommand extends BRCommand {
+public class ListCommand extends DRECommand {
DungeonsXL plugin = DungeonsXL.getInstance();
- DWorlds worlds = DungeonsXL.getDWorlds();
+ DWorldCache worlds = DungeonsXL.getInstance().getDWorlds();
public ListCommand() {
setCommand("list");
setMinArgs(0);
setMaxArgs(3);
- setHelp(DMessages.HELP_CMD_LIST.getMessage());
+ setHelp(DMessage.HELP_CMD_LIST.getMessage());
setPermission(DPermissions.LIST.getNode());
setPlayerCommand(true);
setConsoleCommand(true);
@@ -54,12 +54,12 @@ public class ListCommand extends BRCommand {
@Override
public void onExecute(String[] args, CommandSender sender) {
ArrayList dungeonList = new ArrayList<>();
- for (Dungeon dungeon : DungeonsXL.getDungeons().getDungeons()) {
+ for (Dungeon dungeon : DungeonsXL.getInstance().getDungeons().getDungeons()) {
dungeonList.add(dungeon.getName());
}
ArrayList mapList = new ArrayList<>();
for (File file : DungeonsXL.MAPS.listFiles()) {
- if (!file.equals(DWorlds.RAW)) {
+ if (!file.equals(DWorldCache.RAW)) {
mapList.add(file.getName());
}
}
@@ -78,7 +78,7 @@ public class ListCommand extends BRCommand {
if (args.length >= 2) {
if (args[1].equalsIgnoreCase("dungeons") || args[1].equalsIgnoreCase("d")) {
if (args.length >= 3) {
- Dungeon dungeon = DungeonsXL.getDungeons().getByName(args[2]);
+ Dungeon dungeon = DungeonsXL.getInstance().getDungeons().getByName(args[2]);
if (dungeon != null) {
MessageUtil.sendPluginTag(sender, plugin);
MessageUtil.sendCenteredMessage(sender, "&4&l[ &6" + dungeon.getName() + " &4&l]");
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/command/LivesCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/LivesCommand.java
similarity index 68%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/command/LivesCommand.java
rename to src/main/java/io/github/dre2n/dungeonsxl/command/LivesCommand.java
index 2f4a7388..2f232c9a 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/command/LivesCommand.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/command/LivesCommand.java
@@ -16,9 +16,9 @@
*/
package io.github.dre2n.dungeonsxl.command;
-import io.github.dre2n.commons.command.BRCommand;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.command.DRECommand;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.player.DGamePlayer;
import io.github.dre2n.dungeonsxl.player.DGroup;
import io.github.dre2n.dungeonsxl.player.DPermissions;
@@ -29,13 +29,13 @@ import org.bukkit.entity.Player;
/**
* @author Daniel Saukel
*/
-public class LivesCommand extends BRCommand {
+public class LivesCommand extends DRECommand {
public LivesCommand() {
setCommand("lives");
setMinArgs(0);
setMaxArgs(1);
- setHelp(DMessages.HELP_CMD_LIVES.getMessage());
+ setHelp(DMessage.HELP_CMD_LIVES.getMessage());
setPermission(DPermissions.LIVES.getNode());
setPlayerCommand(true);
setConsoleCommand(true);
@@ -54,24 +54,24 @@ public class LivesCommand extends BRCommand {
player = (Player) sender;
} else {
- MessageUtil.sendMessage(sender, DMessages.ERROR_NO_CONSOLE_COMMAND.getMessage(getCommand()));
+ MessageUtil.sendMessage(sender, DMessage.ERROR_NO_CONSOLE_COMMAND.getMessage(getCommand()));
return;
}
DGamePlayer dPlayer = DGamePlayer.getByPlayer(player);
if (dPlayer == null && args.length == 1) {
- MessageUtil.sendMessage(sender, DMessages.ERROR_NO_SUCH_PLAYER.getMessage(args[1]));
+ MessageUtil.sendMessage(sender, DMessage.ERROR_NO_SUCH_PLAYER.getMessage(args[1]));
return;
}
DGroup dGroup = dPlayer != null ? dPlayer.getDGroup() : DGroup.getByName(args[1]);
if (dPlayer != null) {
- MessageUtil.sendMessage(sender, DMessages.CMD_LIVES_PLAYER.getMessage(dPlayer.getName(), String.valueOf(dPlayer.getLives() == -1 ? "UNLIMITED" : dPlayer.getLives())));
+ MessageUtil.sendMessage(sender, DMessage.CMD_LIVES_PLAYER.getMessage(dPlayer.getName(), String.valueOf(dPlayer.getLives() == -1 ? "UNLIMITED" : dPlayer.getLives())));
} else if (dGroup != null) {
- MessageUtil.sendMessage(sender, DMessages.CMD_LIVES_GROUP.getMessage(dGroup.getName(), String.valueOf(dGroup.getLives() == -1 ? "UNLIMITED" : dPlayer.getLives())));
+ MessageUtil.sendMessage(sender, DMessage.CMD_LIVES_GROUP.getMessage(dGroup.getName(), String.valueOf(dGroup.getLives() == -1 ? "UNLIMITED" : dPlayer.getLives())));
} else {
- MessageUtil.sendMessage(sender, DMessages.ERROR_NO_SUCH_PLAYER.getMessage(args[1]));
+ MessageUtil.sendMessage(sender, DMessage.ERROR_NO_SUCH_PLAYER.getMessage(args[1]));
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/command/MainCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/MainCommand.java
similarity index 70%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/command/MainCommand.java
rename to src/main/java/io/github/dre2n/dungeonsxl/command/MainCommand.java
index 5d788ac8..5f42a59a 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/command/MainCommand.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/command/MainCommand.java
@@ -16,13 +16,13 @@
*/
package io.github.dre2n.dungeonsxl.command;
-import io.github.dre2n.commons.command.BRCommand;
+import static io.github.dre2n.commons.chat.FatLetter.*;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.command.DRECommand;
import io.github.dre2n.commons.compatibility.CompatibilityHandler;
import io.github.dre2n.commons.compatibility.Internals;
-import static io.github.dre2n.commons.util.messageutil.FatLetters.*;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.player.DPermissions;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
@@ -31,11 +31,11 @@ import org.bukkit.plugin.PluginManager;
/**
* @author Daniel Saukel
*/
-public class MainCommand extends BRCommand {
+public class MainCommand extends DRECommand {
public MainCommand() {
setCommand("main");
- setHelp(DMessages.HELP_CMD_MAIN.getMessage());
+ setHelp(DMessage.HELP_CMD_MAIN.getMessage());
setPermission(DPermissions.MAIN.getNode());
setPlayerCommand(true);
setConsoleCommand(true);
@@ -47,8 +47,8 @@ public class MainCommand extends BRCommand {
int maps = DungeonsXL.MAPS.listFiles().length;
int dungeons = DungeonsXL.DUNGEONS.listFiles().length;
- int loaded = DungeonsXL.getDWorlds().getEditWorlds().size() + DungeonsXL.getDWorlds().getGameWorlds().size();
- int players = DungeonsXL.getDPlayers().getDGamePlayers().size();
+ int loaded = DungeonsXL.getInstance().getDWorlds().getEditWorlds().size() + DungeonsXL.getInstance().getDWorlds().getGameWorlds().size();
+ int players = DungeonsXL.getInstance().getDPlayers().getDGamePlayers().size();
Internals internals = CompatibilityHandler.getInstance().getInternals();
String vault = "";
if (plugins.getPlugin("Vault") != null) {
@@ -64,10 +64,10 @@ public class MainCommand extends BRCommand {
MessageUtil.sendCenteredMessage(sender, "&4" + D[2] + "&f" + X[2] + L[2]);
MessageUtil.sendCenteredMessage(sender, "&4" + D[3] + "&f" + X[3] + L[3]);
MessageUtil.sendCenteredMessage(sender, "&4" + D[4] + "&f" + X[4] + L[4]);
- MessageUtil.sendCenteredMessage(sender, "&b&l###### " + DMessages.CMD_MAIN_WELCOME.getMessage() + "&7 v" + DungeonsXL.getInstance().getDescription().getVersion() + " &b&l######");
- MessageUtil.sendCenteredMessage(sender, DMessages.CMD_MAIN_LOADED.getMessage(String.valueOf(maps), String.valueOf(dungeons), String.valueOf(loaded), String.valueOf(players)));
- MessageUtil.sendCenteredMessage(sender, DMessages.CMD_MAIN_COMPATIBILITY.getMessage(String.valueOf(internals), vault, itemsxl));
- MessageUtil.sendCenteredMessage(sender, DMessages.CMD_MAIN_HELP.getMessage());
+ MessageUtil.sendCenteredMessage(sender, "&b&l###### " + DMessage.CMD_MAIN_WELCOME.getMessage() + "&7 v" + DungeonsXL.getInstance().getDescription().getVersion() + " &b&l######");
+ MessageUtil.sendCenteredMessage(sender, DMessage.CMD_MAIN_LOADED.getMessage(String.valueOf(maps), String.valueOf(dungeons), String.valueOf(loaded), String.valueOf(players)));
+ MessageUtil.sendCenteredMessage(sender, DMessage.CMD_MAIN_COMPATIBILITY.getMessage(String.valueOf(internals), vault, itemsxl));
+ MessageUtil.sendCenteredMessage(sender, DMessage.CMD_MAIN_HELP.getMessage());
MessageUtil.sendCenteredMessage(sender, "&7\u00a92012-2017 Frank Baumann & contributors; lcsd. under GPLv3.");
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/command/MsgCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/MsgCommand.java
similarity index 79%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/command/MsgCommand.java
rename to src/main/java/io/github/dre2n/dungeonsxl/command/MsgCommand.java
index 63e2b22c..d7b6ac02 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/command/MsgCommand.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/command/MsgCommand.java
@@ -16,9 +16,9 @@
*/
package io.github.dre2n.dungeonsxl.command;
-import io.github.dre2n.commons.command.BRCommand;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.command.DRECommand;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.player.DPermissions;
import io.github.dre2n.dungeonsxl.world.DEditWorld;
import io.github.dre2n.dungeonsxl.world.WorldConfig;
@@ -29,13 +29,13 @@ import org.bukkit.entity.Player;
/**
* @author Frank Baumann, Daniel Saukel
*/
-public class MsgCommand extends BRCommand {
+public class MsgCommand extends DRECommand {
public MsgCommand() {
setMinArgs(-1);
setMaxArgs(-1);
setCommand("msg");
- setHelp(DMessages.HELP_CMD_MSG.getMessage());
+ setHelp(DMessage.HELP_CMD_MSG.getMessage());
setPermission(DPermissions.MESSAGE.getNode());
setPlayerCommand(true);
}
@@ -46,7 +46,7 @@ public class MsgCommand extends BRCommand {
DEditWorld editWorld = DEditWorld.getByWorld(player.getWorld());
if (editWorld == null) {
- MessageUtil.sendMessage(player, DMessages.ERROR_NOT_IN_DUNGEON.getMessage());
+ MessageUtil.sendMessage(player, DMessage.ERROR_NOT_IN_DUNGEON.getMessage());
return;
}
@@ -67,7 +67,7 @@ public class MsgCommand extends BRCommand {
MessageUtil.sendMessage(player, ChatColor.WHITE + msg);
} else {
- MessageUtil.sendMessage(player, DMessages.ERROR_MSG_ID_NOT_EXIST.getMessage(String.valueOf(id)));
+ MessageUtil.sendMessage(player, DMessage.ERROR_MSG_ID_NOT_EXIST.getMessage(String.valueOf(id)));
}
} else {
@@ -86,22 +86,22 @@ public class MsgCommand extends BRCommand {
msg = splitMsg[1];
String old = config.getMessage(id);
if (old == null) {
- MessageUtil.sendMessage(player, DMessages.CMD_MSG_ADDED.getMessage(String.valueOf(id)));
+ MessageUtil.sendMessage(player, DMessage.CMD_MSG_ADDED.getMessage(String.valueOf(id)));
} else {
- MessageUtil.sendMessage(player, DMessages.CMD_MSG_UPDATED.getMessage(String.valueOf(id)));
+ MessageUtil.sendMessage(player, DMessage.CMD_MSG_UPDATED.getMessage(String.valueOf(id)));
}
config.setMessage(id, msg);
config.save();
} else {
- MessageUtil.sendMessage(player, DMessages.ERROR_MSG_FORMAT.getMessage());
+ MessageUtil.sendMessage(player, DMessage.ERROR_MSG_FORMAT.getMessage());
}
}
} catch (NumberFormatException e) {
- MessageUtil.sendMessage(player, DMessages.ERROR_MSG_NO_INT.getMessage());
+ MessageUtil.sendMessage(player, DMessage.ERROR_MSG_NO_INT.getMessage());
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/command/PlayCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/PlayCommand.java
similarity index 74%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/command/PlayCommand.java
rename to src/main/java/io/github/dre2n/dungeonsxl/command/PlayCommand.java
index a277178b..71b63218 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/command/PlayCommand.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/command/PlayCommand.java
@@ -16,10 +16,10 @@
*/
package io.github.dre2n.dungeonsxl.command;
-import io.github.dre2n.commons.command.BRCommand;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.command.DRECommand;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.dungeon.Dungeon;
import io.github.dre2n.dungeonsxl.event.dgroup.DGroupCreateEvent;
import io.github.dre2n.dungeonsxl.game.Game;
@@ -36,13 +36,13 @@ import org.bukkit.entity.Player;
/**
* @author Daniel Saukel
*/
-public class PlayCommand extends BRCommand {
+public class PlayCommand extends DRECommand {
public PlayCommand() {
setCommand("play");
setMinArgs(1);
setMaxArgs(1);
- setHelp(DMessages.HELP_CMD_PLAY.getMessage());
+ setHelp(DMessage.HELP_CMD_PLAY.getMessage());
setPermission(DPermissions.PLAY.getNode());
setPlayerCommand(true);
setConsoleCommand(false);
@@ -51,38 +51,38 @@ public class PlayCommand extends BRCommand {
@Override
public void onExecute(String[] args, CommandSender sender) {
Player player = (Player) sender;
- DGlobalPlayer dPlayer = DungeonsXL.getDPlayers().getByPlayer(player);
+ DGlobalPlayer dPlayer = DungeonsXL.getInstance().getDPlayers().getByPlayer(player);
if (dPlayer instanceof DInstancePlayer) {
- MessageUtil.sendMessage(player, DMessages.ERROR_LEAVE_DUNGEON.getMessage());
+ MessageUtil.sendMessage(player, DMessage.ERROR_LEAVE_DUNGEON.getMessage());
return;
}
- Dungeon dungeon = DungeonsXL.getDungeons().getByName(args[1]);
+ Dungeon dungeon = DungeonsXL.getInstance().getDungeons().getByName(args[1]);
if (dungeon == null) {
- DResourceWorld resource = DungeonsXL.getDWorlds().getResourceByName(args[1]);
+ DResourceWorld resource = DungeonsXL.getInstance().getDWorlds().getResourceByName(args[1]);
if (resource != null) {
dungeon = new Dungeon(resource);
} else {
- MessageUtil.sendMessage(player, DMessages.ERROR_DUNGEON_NOT_EXIST.getMessage(args[1]));
+ MessageUtil.sendMessage(player, DMessage.ERROR_DUNGEON_NOT_EXIST.getMessage(args[1]));
return;
}
}
DGroup dGroup = DGroup.getByPlayer(player);
if (dGroup != null && dGroup.isPlaying()) {
- MessageUtil.sendMessage(player, DMessages.ERROR_LEAVE_GROUP.getMessage());
+ MessageUtil.sendMessage(player, DMessage.ERROR_LEAVE_GROUP.getMessage());
return;
} else if (dGroup == null) {
dGroup = new DGroup(player, dungeon);
DGroupCreateEvent event = new DGroupCreateEvent(dGroup, player, DGroupCreateEvent.Cause.COMMAND);
Bukkit.getPluginManager().callEvent(event);
if (event.isCancelled()) {
- DungeonsXL.getDGroups().remove(dGroup);
+ DungeonsXL.getInstance().getDGroups().remove(dGroup);
dGroup = null;
}
}
if (!dGroup.getCaptain().equals(player) && !DPermissions.hasPermission(player, DPermissions.BYPASS)) {
- MessageUtil.sendMessage(player, DMessages.ERROR_NOT_CAPTAIN.getMessage());
+ MessageUtil.sendMessage(player, DMessage.ERROR_NOT_CAPTAIN.getMessage());
return;
}
dGroup.setDungeon(dungeon);
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/command/PortalCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/PortalCommand.java
similarity index 75%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/command/PortalCommand.java
rename to src/main/java/io/github/dre2n/dungeonsxl/command/PortalCommand.java
index cba79e0c..cc9b079f 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/command/PortalCommand.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/command/PortalCommand.java
@@ -16,10 +16,10 @@
*/
package io.github.dre2n.dungeonsxl.command;
-import io.github.dre2n.commons.command.BRCommand;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.command.DRECommand;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.global.DPortal;
import io.github.dre2n.dungeonsxl.player.DGamePlayer;
import io.github.dre2n.dungeonsxl.player.DGlobalPlayer;
@@ -32,13 +32,13 @@ import org.bukkit.inventory.ItemStack;
/**
* @author Frank Baumann, Daniel Saukel
*/
-public class PortalCommand extends BRCommand {
+public class PortalCommand extends DRECommand {
public PortalCommand() {
setCommand("portal");
setMinArgs(0);
setMaxArgs(1);
- setHelp(DMessages.HELP_CMD_PORTAL.getMessage());
+ setHelp(DMessage.HELP_CMD_PORTAL.getMessage());
setPermission(DPermissions.PORTAL.getNode());
setPlayerCommand(true);
}
@@ -46,10 +46,10 @@ public class PortalCommand extends BRCommand {
@Override
public void onExecute(String[] args, CommandSender sender) {
Player player = (Player) sender;
- DGlobalPlayer dGlobalPlayer = DungeonsXL.getDPlayers().getByPlayer(player);
+ DGlobalPlayer dGlobalPlayer = DungeonsXL.getInstance().getDPlayers().getByPlayer(player);
if (dGlobalPlayer instanceof DGamePlayer) {
- MessageUtil.sendMessage(player, DMessages.ERROR_LEAVE_DUNGEON.getMessage());
+ MessageUtil.sendMessage(player, DMessage.ERROR_LEAVE_DUNGEON.getMessage());
return;
}
@@ -66,19 +66,19 @@ public class PortalCommand extends BRCommand {
DPortal dPortal = dGlobalPlayer.getPortal();
if (dPortal == null) {
- dPortal = new DPortal(DungeonsXL.getGlobalProtections().generateId(DPortal.class, player.getWorld()), player.getWorld(), material, false);
+ dPortal = new DPortal(DungeonsXL.getInstance().getGlobalProtections().generateId(DPortal.class, player.getWorld()), player.getWorld(), material, false);
dGlobalPlayer.setCreatingPortal(dPortal);
dPortal.setWorld(player.getWorld());
dGlobalPlayer.setCachedItem(player.getItemInHand());
player.getInventory().setItemInHand(new ItemStack(Material.WOOD_SWORD));
- MessageUtil.sendMessage(player, DMessages.PLAYER_PORTAL_INTRODUCTION.getMessage());
+ MessageUtil.sendMessage(player, DMessage.PLAYER_PORTAL_INTRODUCTION.getMessage());
} else {
dPortal.delete();
dGlobalPlayer.setCreatingPortal(null);
player.setItemInHand(dGlobalPlayer.getCachedItem());
dGlobalPlayer.setCachedItem(null);
- MessageUtil.sendMessage(player, DMessages.PLAYER_PORTAL_ABORT.getMessage());
+ MessageUtil.sendMessage(player, DMessage.PLAYER_PORTAL_ABORT.getMessage());
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/command/ReloadCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/ReloadCommand.java
similarity index 72%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/command/ReloadCommand.java
rename to src/main/java/io/github/dre2n/dungeonsxl/command/ReloadCommand.java
index 5295be5e..7299a9f0 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/command/ReloadCommand.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/command/ReloadCommand.java
@@ -16,13 +16,13 @@
*/
package io.github.dre2n.dungeonsxl.command;
-import io.github.dre2n.commons.command.BRCommand;
+import io.github.dre2n.commons.chat.DefaultFontInfo;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.command.DRECommand;
import io.github.dre2n.commons.compatibility.CompatibilityHandler;
import io.github.dre2n.commons.compatibility.Internals;
-import io.github.dre2n.commons.util.messageutil.DefaultFontInfo;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.event.DataReloadEvent;
import io.github.dre2n.dungeonsxl.player.DInstancePlayer;
import io.github.dre2n.dungeonsxl.player.DPermissions;
@@ -37,7 +37,7 @@ import org.bukkit.plugin.PluginManager;
/**
* @author Frank Baumann, Daniel Saukel
*/
-public class ReloadCommand extends BRCommand {
+public class ReloadCommand extends DRECommand {
DungeonsXL plugin = DungeonsXL.getInstance();
@@ -45,7 +45,7 @@ public class ReloadCommand extends BRCommand {
setCommand("reload");
setMinArgs(0);
setMaxArgs(1);
- setHelp(DMessages.HELP_CMD_RELOAD.getMessage());
+ setHelp(DMessage.HELP_CMD_RELOAD.getMessage());
setPermission(DPermissions.RELOAD.getNode());
setPlayerCommand(true);
setConsoleCommand(true);
@@ -53,11 +53,11 @@ public class ReloadCommand extends BRCommand {
@Override
public void onExecute(String[] args, CommandSender sender) {
- List dPlayers = DungeonsXL.getDPlayers().getDInstancePlayers();
+ List dPlayers = DungeonsXL.getInstance().getDPlayers().getDInstancePlayers();
if (!dPlayers.isEmpty() && args.length == 1 && CompatibilityHandler.getInstance().isSpigot() && sender instanceof Player) {
- MessageUtil.sendMessage(sender, DMessages.CMD_RELOAD_PLAYERS.getMessage());
+ MessageUtil.sendMessage(sender, DMessage.CMD_RELOAD_PLAYERS.getMessage());
ClickEvent onClick = new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/dungeonsxl reload -force");
- String message = DefaultFontInfo.center(DMessages.MISC_OKAY.getMessage());
+ String message = DefaultFontInfo.center(DMessage.MISC_OKAY.getMessage());
TextComponent text = new TextComponent(message);
text.setClickEvent(onClick);
((Player) sender).spigot().sendMessage(text);
@@ -78,8 +78,8 @@ public class ReloadCommand extends BRCommand {
int maps = DungeonsXL.MAPS.listFiles().length;
int dungeons = DungeonsXL.DUNGEONS.listFiles().length;
- int loaded = DungeonsXL.getDWorlds().getEditWorlds().size() + DungeonsXL.getDWorlds().getGameWorlds().size();
- int players = DungeonsXL.getDPlayers().getDGamePlayers().size();
+ int loaded = DungeonsXL.getInstance().getDWorlds().getEditWorlds().size() + DungeonsXL.getInstance().getDWorlds().getGameWorlds().size();
+ int players = DungeonsXL.getInstance().getDPlayers().getDGamePlayers().size();
Internals internals = CompatibilityHandler.getInstance().getInternals();
String vault = "";
if (plugins.getPlugin("Vault") != null) {
@@ -95,9 +95,9 @@ public class ReloadCommand extends BRCommand {
plugin.loadData();
MessageUtil.sendPluginTag(sender, plugin);
- MessageUtil.sendCenteredMessage(sender, DMessages.CMD_RELOAD_DONE.getMessage());
- MessageUtil.sendCenteredMessage(sender, DMessages.CMD_MAIN_LOADED.getMessage(String.valueOf(maps), String.valueOf(dungeons), String.valueOf(loaded), String.valueOf(players)));
- MessageUtil.sendCenteredMessage(sender, DMessages.CMD_MAIN_COMPATIBILITY.getMessage(String.valueOf(internals), vault, mythicMobs));
+ MessageUtil.sendCenteredMessage(sender, DMessage.CMD_RELOAD_DONE.getMessage());
+ MessageUtil.sendCenteredMessage(sender, DMessage.CMD_MAIN_LOADED.getMessage(String.valueOf(maps), String.valueOf(dungeons), String.valueOf(loaded), String.valueOf(players)));
+ MessageUtil.sendCenteredMessage(sender, DMessage.CMD_MAIN_COMPATIBILITY.getMessage(String.valueOf(internals), vault, mythicMobs));
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/command/RenameCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/RenameCommand.java
similarity index 80%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/command/RenameCommand.java
rename to src/main/java/io/github/dre2n/dungeonsxl/command/RenameCommand.java
index 796f6960..43540d14 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/command/RenameCommand.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/command/RenameCommand.java
@@ -16,10 +16,10 @@
*/
package io.github.dre2n.dungeonsxl.command;
-import io.github.dre2n.commons.command.BRCommand;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.command.DRECommand;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.dungeon.Dungeon;
import io.github.dre2n.dungeonsxl.dungeon.DungeonConfig;
import io.github.dre2n.dungeonsxl.global.GameSign;
@@ -36,13 +36,13 @@ import org.bukkit.configuration.file.FileConfiguration;
/**
* @author Daniel Saukel
*/
-public class RenameCommand extends BRCommand {
+public class RenameCommand extends DRECommand {
public RenameCommand() {
setCommand("rename");
setMinArgs(2);
setMaxArgs(2);
- setHelp(DMessages.HELP_CMD_RENAME.getMessage());
+ setHelp(DMessage.HELP_CMD_RENAME.getMessage());
setPermission(DPermissions.RENAME.getNode());
setPlayerCommand(true);
setConsoleCommand(true);
@@ -50,9 +50,9 @@ public class RenameCommand extends BRCommand {
@Override
public void onExecute(String[] args, CommandSender sender) {
- DResourceWorld resource = DungeonsXL.getDWorlds().getResourceByName(args[1]);
+ DResourceWorld resource = DungeonsXL.getInstance().getDWorlds().getResourceByName(args[1]);
if (resource == null) {
- MessageUtil.sendMessage(sender, DMessages.ERROR_NO_SUCH_MAP.getMessage(args[1]));
+ MessageUtil.sendMessage(sender, DMessage.ERROR_NO_SUCH_MAP.getMessage(args[1]));
return;
}
@@ -60,7 +60,7 @@ public class RenameCommand extends BRCommand {
resource.getFolder().renameTo(new File(DungeonsXL.MAPS, args[2]));
resource.getSignData().updateFile(resource);
- for (Dungeon dungeon : DungeonsXL.getDungeons().getDungeons()) {
+ for (Dungeon dungeon : DungeonsXL.getInstance().getDungeons().getDungeons()) {
DungeonConfig dConfig = dungeon.getConfig();
FileConfiguration config = dConfig.getConfig();
File file = dConfig.getFile();
@@ -90,7 +90,7 @@ public class RenameCommand extends BRCommand {
}
boolean changed = false;
- for (GlobalProtection protection : DungeonsXL.getGlobalProtections().getProtections()) {
+ for (GlobalProtection protection : DungeonsXL.getInstance().getGlobalProtections().getProtections()) {
if (protection instanceof GroupSign) {
Dungeon dungeon = ((GroupSign) protection).getDungeon();
if (dungeon.getName().equals(args[1])) {
@@ -108,10 +108,10 @@ public class RenameCommand extends BRCommand {
}
if (changed) {
- DungeonsXL.getGlobalProtections().saveAll();
+ DungeonsXL.getInstance().getGlobalProtections().saveAll();
}
- MessageUtil.sendMessage(sender, DMessages.CMD_RENAME_SUCCESS.getMessage(args[1], args[2]));
+ MessageUtil.sendMessage(sender, DMessage.CMD_RENAME_SUCCESS.getMessage(args[1], args[2]));
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/command/ResourcePackCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/ResourcePackCommand.java
similarity index 69%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/command/ResourcePackCommand.java
rename to src/main/java/io/github/dre2n/dungeonsxl/command/ResourcePackCommand.java
index cda55424..63730bc0 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/command/ResourcePackCommand.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/command/ResourcePackCommand.java
@@ -16,25 +16,24 @@
*/
package io.github.dre2n.dungeonsxl.command;
-import io.github.dre2n.commons.command.BRCommand;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.command.DRECommand;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.player.DPermissions;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
-import org.inventivetalent.rpapi.ResourcePackAPI;
/**
* @author Daniel Saukel
*/
-public class ResourcePackCommand extends BRCommand {
+public class ResourcePackCommand extends DRECommand {
public ResourcePackCommand() {
setCommand("resourcepack");
setMinArgs(1);
setMaxArgs(1);
- setHelp(DMessages.HELP_CMD_RESOURCE_PACK.getMessage());
+ setHelp(DMessage.HELP_CMD_RESOURCE_PACK.getMessage());
setPermission(DPermissions.RESOURCE_PACK.getNode());
setPlayerCommand(true);
}
@@ -45,17 +44,17 @@ public class ResourcePackCommand extends BRCommand {
if (args[1].equalsIgnoreCase("reset")) {
// Placeholder to reset to default
- ResourcePackAPI.setResourcepack(player, "http://google.com");
+ player.setResourcePack("http://google.com");
return;
}
- String url = (String) DungeonsXL.getMainConfig().getResourcePacks().get(args[1]);
+ String url = (String) DungeonsXL.getInstance().getMainConfig().getResourcePacks().get(args[1]);
if (url == null) {
- MessageUtil.sendMessage(sender, DMessages.ERROR_NO_SUCH_RESOURCE_PACK.getMessage(args[1]));
+ MessageUtil.sendMessage(sender, DMessage.ERROR_NO_SUCH_RESOURCE_PACK.getMessage(args[1]));
return;
}
- ResourcePackAPI.setResourcepack(player, url);
+ player.setResourcePack(url);
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/command/RewardsCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/RewardsCommand.java
similarity index 81%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/command/RewardsCommand.java
rename to src/main/java/io/github/dre2n/dungeonsxl/command/RewardsCommand.java
index 75a0ea40..ea54a564 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/command/RewardsCommand.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/command/RewardsCommand.java
@@ -16,10 +16,10 @@
*/
package io.github.dre2n.dungeonsxl.command;
-import io.github.dre2n.commons.command.BRCommand;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.command.DRECommand;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.player.DGlobalPlayer;
import io.github.dre2n.dungeonsxl.player.DPermissions;
import io.github.dre2n.dungeonsxl.reward.DLootInventory;
@@ -31,13 +31,13 @@ import org.bukkit.inventory.ItemStack;
/**
* @author Daniel Saukel
*/
-public class RewardsCommand extends BRCommand {
+public class RewardsCommand extends DRECommand {
public RewardsCommand() {
setCommand("rewards");
setMinArgs(0);
setMaxArgs(0);
- setHelp(DMessages.HELP_CMD_REWARDS.getMessage());
+ setHelp(DMessage.HELP_CMD_REWARDS.getMessage());
setPermission(DPermissions.REWARDS.getNode());
setPlayerCommand(true);
}
@@ -45,10 +45,10 @@ public class RewardsCommand extends BRCommand {
@Override
public void onExecute(String[] args, CommandSender sender) {
Player player = (Player) sender;
- DGlobalPlayer dGlobalPlayer = DungeonsXL.getDPlayers().getByPlayer(player);
+ DGlobalPlayer dGlobalPlayer = DungeonsXL.getInstance().getDPlayers().getByPlayer(player);
if (!dGlobalPlayer.hasRewardItemsLeft()) {
- MessageUtil.sendMessage(player, DMessages.ERROR_NO_REWARDS_LEFT.getMessage());
+ MessageUtil.sendMessage(player, DMessage.ERROR_NO_REWARDS_LEFT.getMessage());
return;
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/command/SaveCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/SaveCommand.java
similarity index 79%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/command/SaveCommand.java
rename to src/main/java/io/github/dre2n/dungeonsxl/command/SaveCommand.java
index 29ef3dc6..aa51d585 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/command/SaveCommand.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/command/SaveCommand.java
@@ -16,10 +16,10 @@
*/
package io.github.dre2n.dungeonsxl.command;
-import io.github.dre2n.commons.command.BRCommand;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.command.DRECommand;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.config.MainConfig;
import io.github.dre2n.dungeonsxl.config.MainConfig.BackupMode;
import io.github.dre2n.dungeonsxl.player.DPermissions;
@@ -30,15 +30,15 @@ import org.bukkit.entity.Player;
/**
* @author Frank Baumann, Daniel Saukel
*/
-public class SaveCommand extends BRCommand {
+public class SaveCommand extends DRECommand {
- MainConfig mainConfig = DungeonsXL.getMainConfig();
+ MainConfig mainConfig = DungeonsXL.getInstance().getMainConfig();
public SaveCommand() {
setCommand("save");
setMinArgs(0);
setMaxArgs(0);
- setHelp(DMessages.HELP_CMD_SAVE.getMessage());
+ setHelp(DMessage.HELP_CMD_SAVE.getMessage());
setPermission(DPermissions.SAVE.getNode());
setPlayerCommand(true);
}
@@ -54,10 +54,10 @@ public class SaveCommand extends BRCommand {
}
editWorld.save();
- MessageUtil.sendMessage(player, DMessages.CMD_SAVE_SUCCESS.getMessage());
+ MessageUtil.sendMessage(player, DMessage.CMD_SAVE_SUCCESS.getMessage());
} else {
- MessageUtil.sendMessage(player, DMessages.ERROR_NOT_IN_DUNGEON.getMessage());
+ MessageUtil.sendMessage(player, DMessage.ERROR_NOT_IN_DUNGEON.getMessage());
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/command/StatusCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/StatusCommand.java
similarity index 94%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/command/StatusCommand.java
rename to src/main/java/io/github/dre2n/dungeonsxl/command/StatusCommand.java
index 22e81754..6df4b8a3 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/command/StatusCommand.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/command/StatusCommand.java
@@ -16,11 +16,11 @@
*/
package io.github.dre2n.dungeonsxl.command;
-import io.github.dre2n.commons.command.BRCommand;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.command.DRECommand;
import io.github.dre2n.commons.compatibility.CompatibilityHandler;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.player.DPermissions;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
@@ -31,7 +31,7 @@ import org.bukkit.plugin.PluginManager;
/**
* @author Daniel Saukel
*/
-public class StatusCommand extends BRCommand {
+public class StatusCommand extends DRECommand {
DungeonsXL plugin = DungeonsXL.getInstance();
CompatibilityHandler compat = CompatibilityHandler.getInstance();
@@ -44,7 +44,7 @@ public class StatusCommand extends BRCommand {
setCommand("status");
setMinArgs(0);
setMaxArgs(0);
- setHelp(DMessages.HELP_CMD_STATUS.getMessage());
+ setHelp(DMessage.HELP_CMD_STATUS.getMessage());
setPermission(DPermissions.STATUS.getNode());
setPlayerCommand(true);
setConsoleCommand(true);
@@ -117,7 +117,7 @@ public class StatusCommand extends BRCommand {
String vaultVersionCorrect = getSymbol(vaultVersion.startsWith("1.5"));
String permissionPluginCorrect = getSymbol(plugin.getPermissionProvider() != null && plugin.getPermissionProvider().hasGroupSupport());
- String economyPluginCorrect = getSymbol(!DungeonsXL.getMainConfig().isEconomyEnabled() || plugin.getEconomyProvider() != null);
+ String economyPluginCorrect = getSymbol(!DungeonsXL.getInstance().getMainConfig().isEconomyEnabled() || plugin.getEconomyProvider() != null);
String commandsxlVersionCorrect = getSymbol(commandsxlVersion.startsWith("2.1"));
String itemsxlVersionCorrect = getSymbol(itemsxlVersion.startsWith("0.2"));
String citizensVersionCorrect = getSymbol(citizensVersion.startsWith("2.0"));
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/command/TestCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/TestCommand.java
similarity index 81%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/command/TestCommand.java
rename to src/main/java/io/github/dre2n/dungeonsxl/command/TestCommand.java
index 3707adfe..b6da0241 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/command/TestCommand.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/command/TestCommand.java
@@ -16,10 +16,10 @@
*/
package io.github.dre2n.dungeonsxl.command;
-import io.github.dre2n.commons.command.BRCommand;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.command.DRECommand;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.dungeon.Dungeon;
import io.github.dre2n.dungeonsxl.game.Game;
import io.github.dre2n.dungeonsxl.game.GameTypeDefault;
@@ -36,13 +36,13 @@ import org.bukkit.entity.Player;
/**
* @author Daniel Saukel
*/
-public class TestCommand extends BRCommand {
+public class TestCommand extends DRECommand {
public TestCommand() {
setCommand("test");
setMinArgs(0);
setMaxArgs(0);
- setHelp(DMessages.HELP_CMD_TEST.getMessage());
+ setHelp(DMessage.HELP_CMD_TEST.getMessage());
setPermission(DPermissions.TEST.getNode());
setPlayerCommand(true);
setConsoleCommand(false);
@@ -51,29 +51,29 @@ public class TestCommand extends BRCommand {
@Override
public void onExecute(String[] args, CommandSender sender) {
Player player = (Player) sender;
- DGlobalPlayer dPlayer = DungeonsXL.getDPlayers().getByPlayer(player);
+ DGlobalPlayer dPlayer = DungeonsXL.getInstance().getDPlayers().getByPlayer(player);
if (!(dPlayer instanceof DEditPlayer)) {
DGroup dGroup = DGroup.getByPlayer(player);
if (dGroup == null) {
- MessageUtil.sendMessage(sender, DMessages.ERROR_JOIN_GROUP.getMessage());
+ MessageUtil.sendMessage(sender, DMessage.ERROR_JOIN_GROUP.getMessage());
return;
}
if (!dGroup.getCaptain().equals(player) && !DPermissions.hasPermission(player, DPermissions.BYPASS)) {
- MessageUtil.sendMessage(sender, DMessages.ERROR_NOT_CAPTAIN.getMessage());
+ MessageUtil.sendMessage(sender, DMessage.ERROR_NOT_CAPTAIN.getMessage());
return;
}
DGameWorld gameWorld = dGroup.getGameWorld();
if (gameWorld == null) {
- MessageUtil.sendMessage(sender, DMessages.ERROR_NOT_IN_DUNGEON.getMessage());
+ MessageUtil.sendMessage(sender, DMessage.ERROR_NOT_IN_DUNGEON.getMessage());
return;
}
Game game = gameWorld.getGame();
if (game != null && game.hasStarted()) {
- MessageUtil.sendMessage(sender, DMessages.ERROR_LEAVE_DUNGEON.getMessage());
+ MessageUtil.sendMessage(sender, DMessage.ERROR_LEAVE_DUNGEON.getMessage());
return;
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/command/UninviteCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/UninviteCommand.java
similarity index 73%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/command/UninviteCommand.java
rename to src/main/java/io/github/dre2n/dungeonsxl/command/UninviteCommand.java
index f4d73719..3d560949 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/command/UninviteCommand.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/command/UninviteCommand.java
@@ -16,10 +16,10 @@
*/
package io.github.dre2n.dungeonsxl.command;
-import io.github.dre2n.commons.command.BRCommand;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.command.DRECommand;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.player.DPermissions;
import io.github.dre2n.dungeonsxl.world.DResourceWorld;
import org.bukkit.Bukkit;
@@ -29,13 +29,13 @@ import org.bukkit.command.CommandSender;
/**
* @author Frank Baumann, Daniel Saukel
*/
-public class UninviteCommand extends BRCommand {
+public class UninviteCommand extends DRECommand {
public UninviteCommand() {
setCommand("uninvite");
setMinArgs(2);
setMaxArgs(2);
- setHelp(DMessages.HELP_CMD_UNINVITE.getMessage());
+ setHelp(DMessage.HELP_CMD_UNINVITE.getMessage());
setPermission(DPermissions.UNINVITE.getNode());
setPlayerCommand(true);
setConsoleCommand(true);
@@ -43,15 +43,15 @@ public class UninviteCommand extends BRCommand {
@Override
public void onExecute(String[] args, CommandSender sender) {
- DResourceWorld resource = DungeonsXL.getDWorlds().getResourceByName(args[2]);
+ DResourceWorld resource = DungeonsXL.getInstance().getDWorlds().getResourceByName(args[2]);
if (resource == null) {
- MessageUtil.sendMessage(sender, DMessages.ERROR_DUNGEON_NOT_EXIST.getMessage(args[2]));
+ MessageUtil.sendMessage(sender, DMessage.ERROR_DUNGEON_NOT_EXIST.getMessage(args[2]));
return;
}
OfflinePlayer player = Bukkit.getOfflinePlayer(args[1]);
if (resource.removeInvitedPlayer(player)) {
- MessageUtil.sendMessage(sender, DMessages.CMD_UNINVITE_SUCCESS.getMessage(args[1], args[2]));
+ MessageUtil.sendMessage(sender, DMessage.CMD_UNINVITE_SUCCESS.getMessage(args[1], args[2]));
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/config/DMessages.java b/src/main/java/io/github/dre2n/dungeonsxl/config/DMessage.java
similarity index 97%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/config/DMessages.java
rename to src/main/java/io/github/dre2n/dungeonsxl/config/DMessage.java
index e6845493..290c3d17 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/config/DMessages.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/config/DMessage.java
@@ -16,8 +16,8 @@
*/
package io.github.dre2n.dungeonsxl.config;
-import io.github.dre2n.commons.config.Messages;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.config.Message;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import org.bukkit.ChatColor;
import org.bukkit.configuration.file.FileConfiguration;
@@ -29,7 +29,7 @@ import org.bukkit.configuration.file.YamlConfiguration;
*
* @author Daniel Saukel
*/
-public enum DMessages implements Messages {
+public enum DMessage implements Message {
ANNOUNCER_CMD("Announcer_Cmd", "&4&l=> &6USE &4/DXL JOIN &v1 &6TO JOIN &4&l<="),
ANNOUNCER_CLICK("Announcer_Click", "&4&l=> &6CLICK HERE TO JOIN &4&l<="),
@@ -228,7 +228,7 @@ public enum DMessages implements Messages {
private String identifier;
private String message;
- DMessages(String identifier, String message) {
+ DMessage(String identifier, String message) {
this.identifier = identifier;
this.message = message;
}
@@ -246,7 +246,7 @@ public enum DMessages implements Messages {
@Override
public String getMessage(String... args) {
- return DungeonsXL.getMessageConfig().getMessage(this, args);
+ return DungeonsXL.getInstance().getMessageConfig().getMessage(this, args);
}
@Override
@@ -267,8 +267,8 @@ public enum DMessages implements Messages {
* @param identifer
* the identifer to set
*/
- public static Messages getByIdentifier(String identifier) {
- for (Messages message : values()) {
+ public static Message getByIdentifier(String identifier) {
+ for (Message message : values()) {
if (message.getIdentifier().equals(identifier)) {
return message;
}
@@ -282,7 +282,7 @@ public enum DMessages implements Messages {
*/
public static FileConfiguration toConfig() {
FileConfiguration config = new YamlConfiguration();
- for (DMessages message : values()) {
+ for (DMessage message : values()) {
config.set(message.getIdentifier(), message.message);
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/config/GlobalData.java b/src/main/java/io/github/dre2n/dungeonsxl/config/GlobalData.java
similarity index 92%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/config/GlobalData.java
rename to src/main/java/io/github/dre2n/dungeonsxl/config/GlobalData.java
index eda2e3a2..90ccf563 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/config/GlobalData.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/config/GlobalData.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.config;
-import io.github.dre2n.commons.config.BRConfig;
+import io.github.dre2n.commons.config.DREConfig;
import java.io.File;
/**
@@ -24,7 +24,7 @@ import java.io.File;
*
* @author Daniel Saukel
*/
-public class GlobalData extends BRConfig {
+public class GlobalData extends DREConfig {
public static final int CONFIG_VERSION = 2;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/config/MainConfig.java b/src/main/java/io/github/dre2n/dungeonsxl/config/MainConfig.java
similarity index 98%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/config/MainConfig.java
rename to src/main/java/io/github/dre2n/dungeonsxl/config/MainConfig.java
index 88494196..cfa7e9b0 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/config/MainConfig.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/config/MainConfig.java
@@ -16,11 +16,11 @@
*/
package io.github.dre2n.dungeonsxl.config;
+import io.github.dre2n.commons.chat.MessageUtil;
import io.github.dre2n.commons.compatibility.CompatibilityHandler;
import io.github.dre2n.commons.compatibility.Internals;
-import io.github.dre2n.commons.config.BRConfig;
-import io.github.dre2n.commons.util.EnumUtil;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.config.DREConfig;
+import io.github.dre2n.commons.misc.EnumUtil;
import io.github.dre2n.dungeonsxl.util.DColor;
import static io.github.dre2n.dungeonsxl.util.DColor.*;
import io.github.dre2n.dungeonsxl.world.WorldConfig;
@@ -38,7 +38,7 @@ import org.bukkit.configuration.ConfigurationSection;
*
* @author Frank Baumann, Milan Albrecht, Daniel Saukel
*/
-public class MainConfig extends BRConfig {
+public class MainConfig extends DREConfig {
public enum BackupMode {
ON_DISABLE,
@@ -660,7 +660,7 @@ public class MainConfig extends BRConfig {
tweaksEnabled = config.getBoolean("tweaksEnabled");
} else {
tweaksEnabled = false;
- MessageUtil.log(DMessages.LOG_DISABLED_TWEAKS.getMessage());
+ MessageUtil.log(DMessage.LOG_DISABLED_TWEAKS.getMessage());
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/dungeon/Dungeon.java b/src/main/java/io/github/dre2n/dungeonsxl/dungeon/Dungeon.java
similarity index 97%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/dungeon/Dungeon.java
rename to src/main/java/io/github/dre2n/dungeonsxl/dungeon/Dungeon.java
index 8fb34935..b728ce77 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/dungeon/Dungeon.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/dungeon/Dungeon.java
@@ -114,7 +114,7 @@ public class Dungeon {
* @return false if there are setup errors
*/
public boolean isSetupCorrect() {
- for (DResourceWorld resource : DungeonsXL.getDWorlds().getResources()) {
+ for (DResourceWorld resource : DungeonsXL.getInstance().getDWorlds().getResources()) {
if (resource.getName().equals(name)) {
return false;
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/dungeon/Dungeons.java b/src/main/java/io/github/dre2n/dungeonsxl/dungeon/DungeonCache.java
similarity index 89%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/dungeon/Dungeons.java
rename to src/main/java/io/github/dre2n/dungeonsxl/dungeon/DungeonCache.java
index f480b58b..b1c08b00 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/dungeon/Dungeons.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/dungeon/DungeonCache.java
@@ -16,8 +16,8 @@
*/
package io.github.dre2n.dungeonsxl.dungeon;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
@@ -27,11 +27,11 @@ import java.util.List;
*
* @author Daniel Saukel
*/
-public class Dungeons {
+public class DungeonCache {
private List dungeons = new ArrayList<>();
- public Dungeons(File folder) {
+ public DungeonCache(File folder) {
if (!folder.exists()) {
folder.mkdir();
}
@@ -43,7 +43,7 @@ public class Dungeons {
dungeons.add(dungeon);
} else {
- MessageUtil.log(DMessages.LOG_ERROR_DUNGEON_SETUP.getMessage(file.getName()));
+ MessageUtil.log(DMessage.LOG_ERROR_DUNGEON_SETUP.getMessage(file.getName()));
}
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/dungeon/DungeonConfig.java b/src/main/java/io/github/dre2n/dungeonsxl/dungeon/DungeonConfig.java
similarity index 96%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/dungeon/DungeonConfig.java
rename to src/main/java/io/github/dre2n/dungeonsxl/dungeon/DungeonConfig.java
index bf18e45e..6833654e 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/dungeon/DungeonConfig.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/dungeon/DungeonConfig.java
@@ -16,10 +16,10 @@
*/
package io.github.dre2n.dungeonsxl.dungeon;
-import io.github.dre2n.commons.config.BRConfig;
+import io.github.dre2n.commons.config.DREConfig;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.world.DResourceWorld;
-import io.github.dre2n.dungeonsxl.world.DWorlds;
+import io.github.dre2n.dungeonsxl.world.DWorldCache;
import io.github.dre2n.dungeonsxl.world.WorldConfig;
import java.io.File;
import java.util.ArrayList;
@@ -30,9 +30,9 @@ import java.util.List;
*
* @author Daniel Saukel
*/
-public class DungeonConfig extends BRConfig {
+public class DungeonConfig extends DREConfig {
- DWorlds worlds = DungeonsXL.getDWorlds();
+ DWorldCache worlds = DungeonsXL.getInstance().getDWorlds();
public static final int CONFIG_VERSION = 1;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/DataReloadEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/DataReloadEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/DataReloadEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/DataReloadEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupCreateEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupCreateEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupCreateEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupCreateEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupDisbandEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupDisbandEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupDisbandEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupDisbandEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupFinishDungeonEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupFinishDungeonEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupFinishDungeonEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupFinishDungeonEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupFinishFloorEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupFinishFloorEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupFinishFloorEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupFinishFloorEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupRewardEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupRewardEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupRewardEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupRewardEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupScoreEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupScoreEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupScoreEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupScoreEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupStartFloorEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupStartFloorEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupStartFloorEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupStartFloorEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/dmob/DMobDeathEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/dmob/DMobDeathEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/dmob/DMobDeathEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/dmob/DMobDeathEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/dmob/DMobEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/dmob/DMobEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/dmob/DMobEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/dmob/DMobEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/dmob/DMobSpawnEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/dmob/DMobSpawnEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/dmob/DMobSpawnEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/dmob/DMobSpawnEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/DPlayerEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/DPlayerEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/DPlayerEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/DPlayerEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/DPlayerJoinDGroupEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/DPlayerJoinDGroupEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/DPlayerJoinDGroupEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/DPlayerJoinDGroupEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/DPlayerKickEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/DPlayerKickEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/DPlayerKickEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/DPlayerKickEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/DPlayerLeaveDGroupEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/DPlayerLeaveDGroupEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/DPlayerLeaveDGroupEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/DPlayerLeaveDGroupEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/instance/DInstancePlayerEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/instance/DInstancePlayerEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/instance/DInstancePlayerEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/instance/DInstancePlayerEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/instance/DInstancePlayerUpdateEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/instance/DInstancePlayerUpdateEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/instance/DInstancePlayerUpdateEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/instance/DInstancePlayerUpdateEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/instance/edit/DEditPlayerEscapeEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/instance/edit/DEditPlayerEscapeEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/instance/edit/DEditPlayerEscapeEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/instance/edit/DEditPlayerEscapeEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/instance/edit/DEditPlayerEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/instance/edit/DEditPlayerEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/instance/edit/DEditPlayerEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/instance/edit/DEditPlayerEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/instance/game/DGamePlayerDeathEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/instance/game/DGamePlayerDeathEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/instance/game/DGamePlayerDeathEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/instance/game/DGamePlayerDeathEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/instance/game/DGamePlayerEscapeEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/instance/game/DGamePlayerEscapeEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/instance/game/DGamePlayerEscapeEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/instance/game/DGamePlayerEscapeEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/instance/game/DGamePlayerEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/instance/game/DGamePlayerEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/instance/game/DGamePlayerEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/instance/game/DGamePlayerEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/instance/game/DGamePlayerFinishEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/instance/game/DGamePlayerFinishEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/instance/game/DGamePlayerFinishEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/dplayer/instance/game/DGamePlayerFinishEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/dsign/DSignEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/dsign/DSignEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/dsign/DSignEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/dsign/DSignEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/dsign/DSignRegistrationEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/dsign/DSignRegistrationEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/dsign/DSignRegistrationEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/dsign/DSignRegistrationEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/editworld/EditWorldEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/editworld/EditWorldEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/editworld/EditWorldEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/editworld/EditWorldEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/editworld/EditWorldGenerateEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/editworld/EditWorldGenerateEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/editworld/EditWorldGenerateEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/editworld/EditWorldGenerateEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/editworld/EditWorldLoadEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/editworld/EditWorldLoadEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/editworld/EditWorldLoadEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/editworld/EditWorldLoadEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/editworld/EditWorldSaveEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/editworld/EditWorldSaveEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/editworld/EditWorldSaveEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/editworld/EditWorldSaveEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/editworld/EditWorldUnloadEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/editworld/EditWorldUnloadEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/editworld/EditWorldUnloadEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/editworld/EditWorldUnloadEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/gameworld/GameWorldEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/gameworld/GameWorldEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/gameworld/GameWorldEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/gameworld/GameWorldEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/gameworld/GameWorldLoadEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/gameworld/GameWorldLoadEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/gameworld/GameWorldLoadEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/gameworld/GameWorldLoadEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/gameworld/GameWorldStartGameEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/gameworld/GameWorldStartGameEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/gameworld/GameWorldStartGameEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/gameworld/GameWorldStartGameEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/gameworld/GameWorldUnloadEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/gameworld/GameWorldUnloadEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/gameworld/GameWorldUnloadEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/gameworld/GameWorldUnloadEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/requirement/RequirementCheckEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/requirement/RequirementCheckEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/requirement/RequirementCheckEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/requirement/RequirementCheckEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/requirement/RequirementDemandEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/requirement/RequirementDemandEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/requirement/RequirementDemandEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/requirement/RequirementDemandEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/requirement/RequirementEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/requirement/RequirementEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/requirement/RequirementEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/requirement/RequirementEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/requirement/RequirementRegistrationEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/requirement/RequirementRegistrationEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/requirement/RequirementRegistrationEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/requirement/RequirementRegistrationEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/reward/RewardAdditionEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/reward/RewardAdditionEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/reward/RewardAdditionEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/reward/RewardAdditionEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/reward/RewardEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/reward/RewardEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/reward/RewardEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/reward/RewardEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/reward/RewardRegistrationEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/reward/RewardRegistrationEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/reward/RewardRegistrationEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/reward/RewardRegistrationEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/trigger/TriggerActionEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/trigger/TriggerActionEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/trigger/TriggerActionEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/trigger/TriggerActionEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/trigger/TriggerEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/trigger/TriggerEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/trigger/TriggerEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/trigger/TriggerEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/event/trigger/TriggerRegistrationEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/trigger/TriggerRegistrationEvent.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/event/trigger/TriggerRegistrationEvent.java
rename to src/main/java/io/github/dre2n/dungeonsxl/event/trigger/TriggerRegistrationEvent.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/game/Game.java b/src/main/java/io/github/dre2n/dungeonsxl/game/Game.java
similarity index 92%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/game/Game.java
rename to src/main/java/io/github/dre2n/dungeonsxl/game/Game.java
index 5cffeb71..e7618dc4 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/game/Game.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/game/Game.java
@@ -16,9 +16,9 @@
*/
package io.github.dre2n.dungeonsxl.game;
-import io.github.dre2n.commons.util.playerutil.PlayerUtil;
+import io.github.dre2n.commons.player.PlayerUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.dungeon.Dungeon;
import io.github.dre2n.dungeonsxl.dungeon.DungeonConfig;
import io.github.dre2n.dungeonsxl.global.GameSign;
@@ -53,13 +53,13 @@ public class Game {
private boolean started;
private GameType type = GameTypeDefault.DEFAULT;
private DGameWorld world;
- private GameRules rules;
+ private GameRuleProvider rules;
private int waveCount;
private Map gameKills = new HashMap<>();
private Map waveKills = new HashMap<>();
public Game(DGroup dGroup) {
- DungeonsXL.getGames().add(this);
+ DungeonsXL.getInstance().getGames().add(this);
tutorial = false;
started = false;
@@ -73,7 +73,7 @@ public class Game {
}
public Game(DGroup dGroup, DGameWorld world) {
- DungeonsXL.getGames().add(this);
+ DungeonsXL.getInstance().getGames().add(this);
tutorial = false;
started = false;
@@ -88,7 +88,7 @@ public class Game {
}
public Game(DGroup dGroup, DResourceWorld resource) {
- DungeonsXL.getGames().add(this);
+ DungeonsXL.getInstance().getGames().add(this);
tutorial = false;
started = false;
@@ -108,7 +108,7 @@ public class Game {
}
public Game(List dGroups, GameType type, DGameWorld world) {
- DungeonsXL.getGames().add(this);
+ DungeonsXL.getInstance().getGames().add(this);
this.dGroups = dGroups;
this.type = type;
@@ -219,7 +219,7 @@ public class Game {
/**
* @return the GameRules
*/
- public GameRules getRules() {
+ public GameRuleProvider getRules() {
return rules;
}
@@ -227,7 +227,7 @@ public class Game {
* @param rules
* the GameRules to set
*/
- public void setRules(GameRules rules) {
+ public void setRules(GameRuleProvider rules) {
this.rules = rules;
}
@@ -251,7 +251,7 @@ public class Game {
floorConfig = world.getConfig();
}
- GameRules finalRules = new GameRules();
+ GameRuleProvider finalRules = new GameRuleProvider();
if (type != null) {
finalRules.apply(type);
@@ -269,9 +269,9 @@ public class Game {
finalRules.apply(dungeonConfig.getDefaultValues());
}
- finalRules.apply(DungeonsXL.getMainConfig().getDefaultWorldConfig());
+ finalRules.apply(DungeonsXL.getInstance().getMainConfig().getDefaultWorldConfig());
- finalRules.apply(GameRules.DEFAULT_VALUES);
+ finalRules.apply(GameRuleProvider.DEFAULT_VALUES);
rules = finalRules;
}
@@ -396,7 +396,7 @@ public class Game {
public void delete() {
GameSign gameSign = GameSign.getByGame(this);
- DungeonsXL.getGames().remove(this);
+ DungeonsXL.getInstance().getGames().remove(this);
if (gameSign != null) {
gameSign.update();
@@ -421,7 +421,7 @@ public class Game {
}
int delay = rules.getTimeToNextWave();
- sendMessage(DMessages.GROUP_WAVE_FINISHED.getMessage(String.valueOf(waveCount), String.valueOf(delay)));
+ sendMessage(DMessage.GROUP_WAVE_FINISHED.getMessage(String.valueOf(waveCount), String.valueOf(delay)));
new BukkitRunnable() {
@Override
@@ -459,7 +459,7 @@ public class Game {
/* Statics */
public static Game getByDGroup(DGroup dGroup) {
- for (Game game : DungeonsXL.getGames()) {
+ for (Game game : DungeonsXL.getInstance().getGames()) {
if (game.getDGroups().contains(dGroup)) {
return game;
}
@@ -473,7 +473,7 @@ public class Game {
}
public static Game getByGameWorld(DGameWorld gameWorld) {
- for (Game game : DungeonsXL.getGames()) {
+ for (Game game : DungeonsXL.getInstance().getGames()) {
if (gameWorld.equals(game.getWorld())) {
return game;
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/game/GameGoal.java b/src/main/java/io/github/dre2n/dungeonsxl/game/GameGoal.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/game/GameGoal.java
rename to src/main/java/io/github/dre2n/dungeonsxl/game/GameGoal.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/game/GameRules.java b/src/main/java/io/github/dre2n/dungeonsxl/game/GameRuleProvider.java
similarity index 99%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/game/GameRules.java
rename to src/main/java/io/github/dre2n/dungeonsxl/game/GameRuleProvider.java
index 6c7dbe09..5d83e754 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/game/GameRules.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/game/GameRuleProvider.java
@@ -34,9 +34,9 @@ import org.bukkit.inventory.ItemStack;
*
* @author Daniel Saukel
*/
-public class GameRules {
+public class GameRuleProvider {
- public static final GameRules DEFAULT_VALUES = new GameRules();
+ public static final GameRuleProvider DEFAULT_VALUES = new GameRuleProvider();
static {
/* keepInventory */
@@ -587,7 +587,7 @@ public class GameRules {
* @param defaultValues
* the GameRules that override the values that are null.
*/
- public void apply(GameRules defaultValues) {
+ public void apply(GameRuleProvider defaultValues) {
/* keepInventory */
if (keepInventoryOnEnter == null) {
keepInventoryOnEnter = defaultValues.keepInventoryOnEnter;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/game/GameType.java b/src/main/java/io/github/dre2n/dungeonsxl/game/GameType.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/game/GameType.java
rename to src/main/java/io/github/dre2n/dungeonsxl/game/GameType.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/game/GameTypes.java b/src/main/java/io/github/dre2n/dungeonsxl/game/GameTypeCache.java
similarity index 95%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/game/GameTypes.java
rename to src/main/java/io/github/dre2n/dungeonsxl/game/GameTypeCache.java
index b852eeb6..2d5c6e4e 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/game/GameTypes.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/game/GameTypeCache.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.game;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
import io.github.dre2n.dungeonsxl.sign.DSign;
import java.util.ArrayList;
import java.util.List;
@@ -26,11 +26,11 @@ import java.util.List;
*
* @author Daniel Saukel
*/
-public class GameTypes {
+public class GameTypeCache {
private List types = new ArrayList<>();
- public GameTypes() {
+ public GameTypeCache() {
for (GameType type : GameTypeDefault.values()) {
if (type == GameTypeDefault.PVP_FACTIONS_BATTLEFIELD) {
try {
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/game/GameTypeDefault.java b/src/main/java/io/github/dre2n/dungeonsxl/game/GameTypeDefault.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/game/GameTypeDefault.java
rename to src/main/java/io/github/dre2n/dungeonsxl/game/GameTypeDefault.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/global/DPortal.java b/src/main/java/io/github/dre2n/dungeonsxl/global/DPortal.java
similarity index 95%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/global/DPortal.java
rename to src/main/java/io/github/dre2n/dungeonsxl/global/DPortal.java
index 502f0759..e6f81309 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/global/DPortal.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/global/DPortal.java
@@ -16,10 +16,10 @@
*/
package io.github.dre2n.dungeonsxl.global;
-import io.github.dre2n.commons.util.BlockUtil;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.misc.BlockUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.game.Game;
import io.github.dre2n.dungeonsxl.player.DGamePlayer;
import io.github.dre2n.dungeonsxl.player.DGlobalPlayer;
@@ -182,7 +182,7 @@ public class DPortal extends GlobalProtection {
DGroup dGroup = DGroup.getByPlayer(player);
if (dGroup == null) {
- MessageUtil.sendMessage(player, DungeonsXL.getMessageConfig().getMessage(DMessages.ERROR_JOIN_GROUP));
+ MessageUtil.sendMessage(player, DungeonsXL.getInstance().getMessageConfig().getMessage(DMessage.ERROR_JOIN_GROUP));
return;
}
@@ -213,7 +213,7 @@ public class DPortal extends GlobalProtection {
}
if (target == null) {
- MessageUtil.sendMessage(player, DMessages.ERROR_DUNGEON_NOT_EXIST.getMessage());
+ MessageUtil.sendMessage(player, DMessage.ERROR_DUNGEON_NOT_EXIST.getMessage());
return;
}
@@ -326,7 +326,7 @@ public class DPortal extends GlobalProtection {
* a block covered by the returned portal
*/
public static DPortal getByBlock(Block block) {
- for (GlobalProtection protection : DungeonsXL.getGlobalProtections().getProtections(DPortal.class)) {
+ for (GlobalProtection protection : DungeonsXL.getInstance().getGlobalProtections().getProtections(DPortal.class)) {
DPortal portal = (DPortal) protection;
if (portal.getBlock1() == null || portal.getBlock2() == null) {
continue;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/global/GameSign.java b/src/main/java/io/github/dre2n/dungeonsxl/global/GameSign.java
similarity index 91%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/global/GameSign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/global/GameSign.java
index 554435bf..44ce5ff1 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/global/GameSign.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/global/GameSign.java
@@ -16,10 +16,10 @@
*/
package io.github.dre2n.dungeonsxl.global;
-import io.github.dre2n.commons.util.BlockUtil;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.misc.BlockUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.dungeon.Dungeon;
import io.github.dre2n.dungeonsxl.game.Game;
import io.github.dre2n.dungeonsxl.player.DGroup;
@@ -62,9 +62,9 @@ public class GameSign extends GlobalProtection {
this.startSign = startSign;
games = new Game[maxGames];
- dungeon = DungeonsXL.getDungeons().getByName(identifier);
+ dungeon = DungeonsXL.getInstance().getDungeons().getByName(identifier);
if (dungeon == null) {
- DResourceWorld resource = DungeonsXL.getDWorlds().getResourceByName(identifier);
+ DResourceWorld resource = DungeonsXL.getInstance().getDWorlds().getResourceByName(identifier);
if (resource != null) {
dungeon = new Dungeon(resource);
}
@@ -247,7 +247,7 @@ public class GameSign extends GlobalProtection {
}
int x = block.getX(), y = block.getY(), z = block.getZ();
- for (GlobalProtection protection : DungeonsXL.getGlobalProtections().getProtections(GameSign.class)) {
+ for (GlobalProtection protection : DungeonsXL.getInstance().getGlobalProtections().getProtections(GameSign.class)) {
GameSign gameSign = (GameSign) protection;
int sx1 = gameSign.startSign.getX(), sy1 = gameSign.startSign.getY(), sz1 = gameSign.startSign.getZ();
@@ -303,7 +303,7 @@ public class GameSign extends GlobalProtection {
* the game to check
*/
public static GameSign getByGame(Game game) {
- for (GlobalProtection protection : DungeonsXL.getGlobalProtections().getProtections(GameSign.class)) {
+ for (GlobalProtection protection : DungeonsXL.getInstance().getGlobalProtections().getProtections(GameSign.class)) {
GameSign gameSign = (GameSign) protection;
for (Game signGame : gameSign.games) {
@@ -414,7 +414,7 @@ public class GameSign extends GlobalProtection {
block.setTypeIdAndData(68, startSign.getData(), true);
}
- GameSign sign = new GameSign(DungeonsXL.getGlobalProtections().generateId(GameSign.class, world), startSign, mapName, maxGames, maxGroupsPerGame);
+ GameSign sign = new GameSign(DungeonsXL.getInstance().getGlobalProtections().generateId(GameSign.class, world), startSign, mapName, maxGames, maxGroupsPerGame);
return sign;
}
@@ -428,25 +428,25 @@ public class GameSign extends GlobalProtection {
return false;
}
- if (DungeonsXL.getDWorlds().getGameWorlds().size() >= DungeonsXL.getMainConfig().getMaxInstances()) {
- MessageUtil.sendMessage(player, DMessages.ERROR_TOO_MANY_INSTANCES.getMessage());
+ if (DungeonsXL.getInstance().getDWorlds().getGameWorlds().size() >= DungeonsXL.getInstance().getMainConfig().getMaxInstances()) {
+ MessageUtil.sendMessage(player, DMessage.ERROR_TOO_MANY_INSTANCES.getMessage());
return true;
}
DGroup dGroup = DGroup.getByPlayer(player);
if (dGroup == null) {
- MessageUtil.sendMessage(player, DungeonsXL.getMessageConfig().getMessage(DMessages.ERROR_JOIN_GROUP));
+ MessageUtil.sendMessage(player, DungeonsXL.getInstance().getMessageConfig().getMessage(DMessage.ERROR_JOIN_GROUP));
return true;
}
if (!dGroup.getCaptain().equals(player)) {
- MessageUtil.sendMessage(player, DungeonsXL.getMessageConfig().getMessage(DMessages.ERROR_NOT_CAPTAIN));
+ MessageUtil.sendMessage(player, DungeonsXL.getInstance().getMessageConfig().getMessage(DMessage.ERROR_NOT_CAPTAIN));
return true;
}
if (Game.getByDGroup(dGroup) != null) {
- MessageUtil.sendMessage(player, DungeonsXL.getMessageConfig().getMessage(DMessages.ERROR_LEAVE_GAME));
+ MessageUtil.sendMessage(player, DungeonsXL.getInstance().getMessageConfig().getMessage(DMessage.ERROR_LEAVE_GAME));
return true;
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/global/GlobalProtection.java b/src/main/java/io/github/dre2n/dungeonsxl/global/GlobalProtection.java
similarity index 85%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/global/GlobalProtection.java
rename to src/main/java/io/github/dre2n/dungeonsxl/global/GlobalProtection.java
index ea746653..1fa731b6 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/global/GlobalProtection.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/global/GlobalProtection.java
@@ -16,9 +16,9 @@
*/
package io.github.dre2n.dungeonsxl.global;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.player.DGlobalPlayer;
import java.io.File;
import java.util.Collection;
@@ -32,8 +32,8 @@ import org.bukkit.configuration.file.YamlConfiguration;
*/
public abstract class GlobalProtection {
- FileConfiguration config = DungeonsXL.getGlobalData().getConfig();
- GlobalProtections protections = DungeonsXL.getGlobalProtections();
+ FileConfiguration config = DungeonsXL.getInstance().getGlobalData().getConfig();
+ GlobalProtectionCache protections = DungeonsXL.getInstance().getGlobalProtections();
private World world;
private int id;
@@ -93,8 +93,8 @@ public abstract class GlobalProtection {
public boolean onBreak(DGlobalPlayer dPlayer) {
if (dPlayer.isInBreakMode()) {
delete();
- MessageUtil.sendMessage(dPlayer.getPlayer(), DungeonsXL.getMessageConfig().getMessage(DMessages.PLAYER_PROTECTED_BLOCK_DELETED));
- MessageUtil.sendMessage(dPlayer.getPlayer(), DungeonsXL.getMessageConfig().getMessage(DMessages.CMD_BREAK_PROTECTED_MODE));
+ MessageUtil.sendMessage(dPlayer.getPlayer(), DungeonsXL.getInstance().getMessageConfig().getMessage(DMessage.PLAYER_PROTECTED_BLOCK_DELETED));
+ MessageUtil.sendMessage(dPlayer.getPlayer(), DungeonsXL.getInstance().getMessageConfig().getMessage(DMessage.CMD_BREAK_PROTECTED_MODE));
dPlayer.setInBreakMode(false);
return false;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/global/GlobalProtections.java b/src/main/java/io/github/dre2n/dungeonsxl/global/GlobalProtectionCache.java
similarity index 96%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/global/GlobalProtections.java
rename to src/main/java/io/github/dre2n/dungeonsxl/global/GlobalProtectionCache.java
index 014181f8..bae80c86 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/global/GlobalProtections.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/global/GlobalProtectionCache.java
@@ -32,11 +32,11 @@ import org.bukkit.configuration.file.YamlConfiguration;
/**
* @author Daniel Saukel
*/
-public class GlobalProtections {
+public class GlobalProtectionCache {
private Set protections = new HashSet<>();
- public GlobalProtections() {
+ public GlobalProtectionCache() {
Bukkit.getPluginManager().registerEvents(new GlobalProtectionListener(), DungeonsXL.getInstance());
}
@@ -101,7 +101,7 @@ public class GlobalProtections {
* Save all protections to the default file
*/
public void saveAll() {
- saveAll(DungeonsXL.getGlobalData().getConfig());
+ saveAll(DungeonsXL.getInstance().getGlobalData().getConfig());
}
/**
@@ -122,7 +122,7 @@ public class GlobalProtections {
protection.save(config);
}
- DungeonsXL.getGlobalData().save();
+ DungeonsXL.getInstance().getGlobalData().save();
}
/**
@@ -159,7 +159,7 @@ public class GlobalProtections {
/* SUBJECT TO CHANGE */
@Deprecated
public void loadAll() {
- FileConfiguration data = DungeonsXL.getGlobalData().getConfig();
+ FileConfiguration data = DungeonsXL.getInstance().getGlobalData().getConfig();
for (World world : Bukkit.getWorlds()) {
// GameSigns
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/global/GlobalProtectionListener.java b/src/main/java/io/github/dre2n/dungeonsxl/global/GlobalProtectionListener.java
similarity index 89%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/global/GlobalProtectionListener.java
rename to src/main/java/io/github/dre2n/dungeonsxl/global/GlobalProtectionListener.java
index e32defb8..7c967eb8 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/global/GlobalProtectionListener.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/global/GlobalProtectionListener.java
@@ -16,9 +16,9 @@
*/
package io.github.dre2n.dungeonsxl.global;
-import io.github.dre2n.commons.util.NumberUtil;
+import io.github.dre2n.commons.misc.NumberUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.player.DGlobalPlayer;
import io.github.dre2n.dungeonsxl.player.DPermissions;
import io.github.dre2n.dungeonsxl.world.DEditWorld;
@@ -73,9 +73,9 @@ public class GlobalProtectionListener implements Listener {
public void onBlockBreak(BlockBreakEvent event) {
Block block = event.getBlock();
Player player = event.getPlayer();
- DGlobalPlayer dGlobalPlayer = DungeonsXL.getDPlayers().getByPlayer(player);
+ DGlobalPlayer dGlobalPlayer = DungeonsXL.getInstance().getDPlayers().getByPlayer(player);
- GlobalProtection protection = DungeonsXL.getGlobalProtections().getByBlock(block);
+ GlobalProtection protection = DungeonsXL.getInstance().getGlobalProtections().getByBlock(block);
if (protection != null) {
if (protection.onBreak(dGlobalPlayer)) {
event.setCancelled(true);
@@ -101,7 +101,7 @@ public class GlobalProtectionListener implements Listener {
public void onEntityExplode(EntityExplodeEvent event) {
List blocklist = event.blockList();
for (Block block : blocklist) {
- if (DungeonsXL.getGlobalProtections().isProtectedBlock(block)) {
+ if (DungeonsXL.getInstance().getGlobalProtections().isProtectedBlock(block)) {
event.setCancelled(true);
}
}
@@ -138,7 +138,7 @@ public class GlobalProtectionListener implements Listener {
@EventHandler
public void onPortalCreation(PlayerInteractEvent event) {
- DGlobalPlayer dPlayer = DungeonsXL.getDPlayers().getByPlayer(event.getPlayer());
+ DGlobalPlayer dPlayer = DungeonsXL.getInstance().getDPlayers().getByPlayer(event.getPlayer());
if (!dPlayer.isCreatingPortal()) {
return;
}
@@ -148,7 +148,7 @@ public class GlobalProtectionListener implements Listener {
return;
}
- for (GlobalProtection protection : DungeonsXL.getGlobalProtections().getProtections(DPortal.class)) {
+ for (GlobalProtection protection : DungeonsXL.getInstance().getGlobalProtections().getProtections(DPortal.class)) {
DPortal dPortal = (DPortal) protection;
if (dPortal.isActive() || dPortal != dPlayer.getPortal()) {
continue;
@@ -156,13 +156,13 @@ public class GlobalProtectionListener implements Listener {
if (dPortal.getBlock1() == null) {
dPortal.setBlock1(event.getClickedBlock());
- dPlayer.sendMessage(DMessages.PLAYER_PORTAL_PROGRESS.getMessage());
+ dPlayer.sendMessage(DMessage.PLAYER_PORTAL_PROGRESS.getMessage());
} else if (dPortal.getBlock2() == null) {
dPortal.setBlock2(event.getClickedBlock());
dPortal.setActive(true);
dPortal.create(dPlayer);
- dPlayer.sendMessage(DMessages.PLAYER_PORTAL_CREATED.getMessage());
+ dPlayer.sendMessage(DMessage.PLAYER_PORTAL_CREATED.getMessage());
dPlayer.getPlayer().getInventory().setItemInHand(dPlayer.getCachedItem());
dPlayer.setCachedItem(null);
}
@@ -175,7 +175,7 @@ public class GlobalProtectionListener implements Listener {
@EventHandler
public void onInteract(PlayerInteractEvent event) {
Player player = event.getPlayer();
- if (DungeonsXL.getDPlayers().getByPlayer(player).isInBreakMode()) {
+ if (DungeonsXL.getInstance().getDPlayers().getByPlayer(player).isInBreakMode()) {
return;
}
Block clickedBlock = event.getClickedBlock();
@@ -245,7 +245,7 @@ public class GlobalProtectionListener implements Listener {
if (block.getState() instanceof Sign) {
Sign sign = (Sign) block.getState();
- new LeaveSign(DungeonsXL.getGlobalProtections().generateId(LeaveSign.class, sign.getWorld()), sign);
+ new LeaveSign(DungeonsXL.getInstance().getGlobalProtections().generateId(LeaveSign.class, sign.getWorld()), sign);
}
event.setCancelled(true);
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/global/GroupSign.java b/src/main/java/io/github/dre2n/dungeonsxl/global/GroupSign.java
similarity index 94%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/global/GroupSign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/global/GroupSign.java
index aabcf30d..1398fe69 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/global/GroupSign.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/global/GroupSign.java
@@ -16,10 +16,10 @@
*/
package io.github.dre2n.dungeonsxl.global;
-import io.github.dre2n.commons.util.BlockUtil;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.misc.BlockUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.dungeon.Dungeon;
import io.github.dre2n.dungeonsxl.player.DGroup;
import io.github.dre2n.dungeonsxl.world.DResourceWorld;
@@ -61,9 +61,9 @@ public class GroupSign extends GlobalProtection {
this.startSign = startSign;
dGroups = new DGroup[maxGroups];
- dungeon = DungeonsXL.getDungeons().getByName(identifier);
+ dungeon = DungeonsXL.getInstance().getDungeons().getByName(identifier);
if (dungeon == null) {
- DResourceWorld resource = DungeonsXL.getDWorlds().getResourceByName(identifier);
+ DResourceWorld resource = DungeonsXL.getInstance().getDWorlds().getResourceByName(identifier);
if (resource != null) {
dungeon = new Dungeon(resource);
}
@@ -246,7 +246,7 @@ public class GroupSign extends GlobalProtection {
}
int x = block.getX(), y = block.getY(), z = block.getZ();
- for (GlobalProtection protection : DungeonsXL.getGlobalProtections().getProtections(GroupSign.class)) {
+ for (GlobalProtection protection : DungeonsXL.getInstance().getGlobalProtections().getProtections(GroupSign.class)) {
GroupSign groupSign = (GroupSign) protection;
int sx1 = groupSign.startSign.getX(), sy1 = groupSign.startSign.getY(), sz1 = groupSign.startSign.getZ();
@@ -395,7 +395,7 @@ public class GroupSign extends GlobalProtection {
block.setTypeIdAndData(68, startSign.getData(), true);
}
- GroupSign sign = new GroupSign(DungeonsXL.getGlobalProtections().generateId(GroupSign.class, world), startSign, mapName, maxGroups, maxPlayersPerGroup);
+ GroupSign sign = new GroupSign(DungeonsXL.getInstance().getGlobalProtections().generateId(GroupSign.class, world), startSign, mapName, maxGroups, maxPlayersPerGroup);
return sign;
}
@@ -410,7 +410,7 @@ public class GroupSign extends GlobalProtection {
}
if (DGroup.getByPlayer(player) != null) {
- MessageUtil.sendMessage(player, DungeonsXL.getMessageConfig().getMessage(DMessages.ERROR_LEAVE_GROUP));
+ MessageUtil.sendMessage(player, DungeonsXL.getInstance().getMessageConfig().getMessage(DMessage.ERROR_LEAVE_GROUP));
return true;
}
@@ -446,7 +446,7 @@ public class GroupSign extends GlobalProtection {
@Deprecated
public static void updatePerGroup(DGroup dGroupSearch) {
- for (GlobalProtection protection : DungeonsXL.getGlobalProtections().getProtections(GroupSign.class)) {
+ for (GlobalProtection protection : DungeonsXL.getInstance().getGlobalProtections().getProtections(GroupSign.class)) {
GroupSign groupSign = (GroupSign) protection;
int i = 0;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/global/LeaveSign.java b/src/main/java/io/github/dre2n/dungeonsxl/global/LeaveSign.java
similarity index 89%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/global/LeaveSign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/global/LeaveSign.java
index b0acc3a2..0dc2d3b4 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/global/LeaveSign.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/global/LeaveSign.java
@@ -16,10 +16,10 @@
*/
package io.github.dre2n.dungeonsxl.global;
-import io.github.dre2n.commons.util.BlockUtil;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.misc.BlockUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.player.DGamePlayer;
import io.github.dre2n.dungeonsxl.player.DGroup;
import java.util.HashSet;
@@ -79,7 +79,7 @@ public class LeaveSign extends GlobalProtection {
DGroup group = DGroup.getByPlayer(player);
if (group != null) {
group.removePlayer(player);
- MessageUtil.sendMessage(player, DMessages.PLAYER_LEAVE_GROUP.getMessage());
+ MessageUtil.sendMessage(player, DMessage.PLAYER_LEAVE_GROUP.getMessage());
}
}
}
@@ -98,7 +98,7 @@ public class LeaveSign extends GlobalProtection {
* a block which is protected by the returned LeaveSign
*/
public static LeaveSign getByBlock(Block block) {
- for (GlobalProtection protection : DungeonsXL.getGlobalProtections().getProtections(LeaveSign.class)) {
+ for (GlobalProtection protection : DungeonsXL.getInstance().getGlobalProtections().getProtections(LeaveSign.class)) {
LeaveSign leaveSign = (LeaveSign) protection;
if (leaveSign.getBlocks().contains(block)) {
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/loottable/DLootTable.java b/src/main/java/io/github/dre2n/dungeonsxl/loottable/DLootTable.java
similarity index 98%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/loottable/DLootTable.java
rename to src/main/java/io/github/dre2n/dungeonsxl/loottable/DLootTable.java
index 12c56517..4130ab43 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/loottable/DLootTable.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/loottable/DLootTable.java
@@ -17,7 +17,7 @@
package io.github.dre2n.dungeonsxl.loottable;
import io.github.dre2n.caliburn.item.UniversalItemStack;
-import io.github.dre2n.commons.util.NumberUtil;
+import io.github.dre2n.commons.misc.NumberUtil;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/loottable/DLootTables.java b/src/main/java/io/github/dre2n/dungeonsxl/loottable/DLootTableCache.java
similarity index 94%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/loottable/DLootTables.java
rename to src/main/java/io/github/dre2n/dungeonsxl/loottable/DLootTableCache.java
index 77701df5..cb31da9a 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/loottable/DLootTables.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/loottable/DLootTableCache.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.loottable;
-import io.github.dre2n.commons.util.FileUtil;
+import io.github.dre2n.commons.misc.FileUtil;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
@@ -26,11 +26,11 @@ import java.util.List;
*
* @author Daniel Saukel
*/
-public class DLootTables {
+public class DLootTableCache {
private List lootTables = new ArrayList<>();
- public DLootTables(File file) {
+ public DLootTableCache(File file) {
if (file.isDirectory()) {
for (File script : FileUtil.getFilesForFolder(file)) {
lootTables.add(new DLootTable(script));
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/mob/CitizensMobProvider.java b/src/main/java/io/github/dre2n/dungeonsxl/mob/CitizensMobProvider.java
similarity index 98%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/mob/CitizensMobProvider.java
rename to src/main/java/io/github/dre2n/dungeonsxl/mob/CitizensMobProvider.java
index 529f5e35..804dd608 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/mob/CitizensMobProvider.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/mob/CitizensMobProvider.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.mob;
-import io.github.dre2n.commons.util.NumberUtil;
+import io.github.dre2n.commons.misc.NumberUtil;
import io.github.dre2n.dungeonsxl.world.DGameWorld;
import java.util.HashSet;
import java.util.Set;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/mob/CustomExternalMobProvider.java b/src/main/java/io/github/dre2n/dungeonsxl/mob/CustomExternalMobProvider.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/mob/CustomExternalMobProvider.java
rename to src/main/java/io/github/dre2n/dungeonsxl/mob/CustomExternalMobProvider.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/mob/DMob.java b/src/main/java/io/github/dre2n/dungeonsxl/mob/DMob.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/mob/DMob.java
rename to src/main/java/io/github/dre2n/dungeonsxl/mob/DMob.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/mob/DMobListener.java b/src/main/java/io/github/dre2n/dungeonsxl/mob/DMobListener.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/mob/DMobListener.java
rename to src/main/java/io/github/dre2n/dungeonsxl/mob/DMobListener.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/mob/DMobType.java b/src/main/java/io/github/dre2n/dungeonsxl/mob/DMobType.java
similarity index 97%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/mob/DMobType.java
rename to src/main/java/io/github/dre2n/dungeonsxl/mob/DMobType.java
index a6cf7c3f..c72cabe0 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/mob/DMobType.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/mob/DMobType.java
@@ -16,10 +16,10 @@
*/
package io.github.dre2n.dungeonsxl.mob;
-import io.github.dre2n.commons.util.EnumUtil;
-import io.github.dre2n.commons.util.NumberUtil;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.misc.EnumUtil;
+import io.github.dre2n.commons.misc.NumberUtil;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.world.DGameWorld;
import java.io.File;
import java.util.Arrays;
@@ -152,7 +152,7 @@ public class DMobType {
itemMeta.addEnchant(Enchantment.getByName(splittedEnchantment[0].toUpperCase()), 1, true);
}
} else {
- MessageUtil.log(DMessages.LOG_ERROR_MOB_ENCHANTMENT.getMessage(splittedEnchantment[0]));
+ MessageUtil.log(DMessage.LOG_ERROR_MOB_ENCHANTMENT.getMessage(splittedEnchantment[0]));
}
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/mob/DMobTypes.java b/src/main/java/io/github/dre2n/dungeonsxl/mob/DMobTypeCache.java
similarity index 94%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/mob/DMobTypes.java
rename to src/main/java/io/github/dre2n/dungeonsxl/mob/DMobTypeCache.java
index d42957df..90ede49e 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/mob/DMobTypes.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/mob/DMobTypeCache.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.mob;
-import io.github.dre2n.commons.util.FileUtil;
+import io.github.dre2n.commons.misc.FileUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import java.io.File;
import java.util.ArrayList;
@@ -26,11 +26,11 @@ import org.bukkit.Bukkit;
/**
* @author Daniel Saukel
*/
-public class DMobTypes {
+public class DMobTypeCache {
private List dMobTypes = new ArrayList<>();
- public DMobTypes(File file) {
+ public DMobTypeCache(File file) {
if (file.isDirectory()) {
for (File script : FileUtil.getFilesForFolder(file)) {
dMobTypes.add(new DMobType(script));
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/mob/DNPCRegistry.java b/src/main/java/io/github/dre2n/dungeonsxl/mob/DNPCRegistry.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/mob/DNPCRegistry.java
rename to src/main/java/io/github/dre2n/dungeonsxl/mob/DNPCRegistry.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/mob/ExternalMobPlugin.java b/src/main/java/io/github/dre2n/dungeonsxl/mob/ExternalMobPlugin.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/mob/ExternalMobPlugin.java
rename to src/main/java/io/github/dre2n/dungeonsxl/mob/ExternalMobPlugin.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/mob/ExternalMobProvider.java b/src/main/java/io/github/dre2n/dungeonsxl/mob/ExternalMobProvider.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/mob/ExternalMobProvider.java
rename to src/main/java/io/github/dre2n/dungeonsxl/mob/ExternalMobProvider.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/mob/ExternalMobProviders.java b/src/main/java/io/github/dre2n/dungeonsxl/mob/ExternalMobProviderCache.java
similarity index 93%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/mob/ExternalMobProviders.java
rename to src/main/java/io/github/dre2n/dungeonsxl/mob/ExternalMobProviderCache.java
index e317bffa..1ebc91b1 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/mob/ExternalMobProviders.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/mob/ExternalMobProviderCache.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.mob;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import java.util.Arrays;
import java.util.HashSet;
@@ -29,13 +29,13 @@ import org.bukkit.Bukkit;
*
* @author Daniel Saukel
*/
-public class ExternalMobProviders {
+public class ExternalMobProviderCache {
DungeonsXL plugin = DungeonsXL.getInstance();
private Set providers = new HashSet<>();
- public ExternalMobProviders() {
+ public ExternalMobProviderCache() {
// Supported providers
providers.addAll(Arrays.asList(ExternalMobPlugin.values()));
if (Bukkit.getPluginManager().getPlugin("Citizens") != null) {
@@ -47,7 +47,7 @@ public class ExternalMobProviders {
}
// Custom providers
- for (Entry customExternalMobProvider : DungeonsXL.getMainConfig().getExternalMobProviders().entrySet()) {
+ for (Entry customExternalMobProvider : DungeonsXL.getInstance().getMainConfig().getExternalMobProviders().entrySet()) {
providers.add(new CustomExternalMobProvider(customExternalMobProvider));
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/player/CreateDInstancePlayerTask.java b/src/main/java/io/github/dre2n/dungeonsxl/player/CreateDInstancePlayerTask.java
similarity index 97%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/player/CreateDInstancePlayerTask.java
rename to src/main/java/io/github/dre2n/dungeonsxl/player/CreateDInstancePlayerTask.java
index 10335811..076821a3 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/player/CreateDInstancePlayerTask.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/player/CreateDInstancePlayerTask.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.player;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
import io.github.dre2n.dungeonsxl.game.GameType;
import io.github.dre2n.dungeonsxl.world.DEditWorld;
import io.github.dre2n.dungeonsxl.world.DGameWorld;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/player/DClass.java b/src/main/java/io/github/dre2n/dungeonsxl/player/DClass.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/player/DClass.java
rename to src/main/java/io/github/dre2n/dungeonsxl/player/DClass.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/player/DClasses.java b/src/main/java/io/github/dre2n/dungeonsxl/player/DClasses.java
similarity index 97%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/player/DClasses.java
rename to src/main/java/io/github/dre2n/dungeonsxl/player/DClasses.java
index a7659161..633d4eb5 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/player/DClasses.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/player/DClasses.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.player;
-import io.github.dre2n.commons.util.FileUtil;
+import io.github.dre2n.commons.misc.FileUtil;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/player/DEditPlayer.java b/src/main/java/io/github/dre2n/dungeonsxl/player/DEditPlayer.java
similarity index 88%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/player/DEditPlayer.java
rename to src/main/java/io/github/dre2n/dungeonsxl/player/DEditPlayer.java
index 67874588..d73cb330 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/player/DEditPlayer.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/player/DEditPlayer.java
@@ -16,10 +16,10 @@
*/
package io.github.dre2n.dungeonsxl.player;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
-import io.github.dre2n.commons.util.playerutil.PlayerUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.player.PlayerUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.event.dplayer.instance.DInstancePlayerUpdateEvent;
import io.github.dre2n.dungeonsxl.world.DEditWorld;
import java.util.concurrent.CopyOnWriteArrayList;
@@ -66,7 +66,7 @@ public class DEditPlayer extends DInstancePlayer {
// Permission bridge
if (plugin.getPermissionProvider() != null) {
- for (String permission : DungeonsXL.getMainConfig().getEditPermissions()) {
+ for (String permission : DungeonsXL.getInstance().getMainConfig().getEditPermissions()) {
plugin.getPermissionProvider().playerAddTransient(world.getName(), player, permission);
}
}
@@ -110,7 +110,7 @@ public class DEditPlayer extends DInstancePlayer {
public void delete() {
// Permission bridge
if (plugin.getPermissionProvider() != null) {
- for (String permission : DungeonsXL.getMainConfig().getEditPermissions()) {
+ for (String permission : DungeonsXL.getInstance().getMainConfig().getEditPermissions()) {
plugin.getPermissionProvider().playerRemoveTransient(getWorld().getName(), player, permission);
}
}
@@ -144,14 +144,14 @@ public class DEditPlayer extends DInstancePlayer {
}
} else {
linesCopy = lines;
- MessageUtil.sendMessage(getPlayer(), DMessages.PLAYER_SIGN_COPIED.getMessage());
+ MessageUtil.sendMessage(getPlayer(), DMessage.PLAYER_SIGN_COPIED.getMessage());
}
} else {
String info = "" + block.getType();
if (block.getData() != 0) {
info = info + "," + block.getData();
}
- MessageUtil.sendMessage(getPlayer(), DMessages.PLAYER_BLOCK_INFO.getMessage(info));
+ MessageUtil.sendMessage(getPlayer(), DMessage.PLAYER_BLOCK_INFO.getMessage(info));
}
}
@@ -200,7 +200,7 @@ public class DEditPlayer extends DInstancePlayer {
/* Statics */
public static DEditPlayer getByPlayer(Player player) {
- for (DEditPlayer dPlayer : DungeonsXL.getDPlayers().getDEditPlayers()) {
+ for (DEditPlayer dPlayer : DungeonsXL.getInstance().getDPlayers().getDEditPlayers()) {
if (dPlayer.getPlayer().equals(player)) {
return dPlayer;
}
@@ -209,7 +209,7 @@ public class DEditPlayer extends DInstancePlayer {
}
public static DEditPlayer getByName(String name) {
- for (DEditPlayer dPlayer : DungeonsXL.getDPlayers().getDEditPlayers()) {
+ for (DEditPlayer dPlayer : DungeonsXL.getInstance().getDPlayers().getDEditPlayers()) {
if (dPlayer.getName().equalsIgnoreCase(name)) {
return dPlayer;
}
@@ -220,7 +220,7 @@ public class DEditPlayer extends DInstancePlayer {
public static CopyOnWriteArrayList getByWorld(World world) {
CopyOnWriteArrayList dPlayers = new CopyOnWriteArrayList<>();
- for (DEditPlayer dPlayer : DungeonsXL.getDPlayers().getDEditPlayers()) {
+ for (DEditPlayer dPlayer : DungeonsXL.getInstance().getDPlayers().getDEditPlayers()) {
if (dPlayer.getWorld() == world) {
dPlayers.add(dPlayer);
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/player/DGamePlayer.java b/src/main/java/io/github/dre2n/dungeonsxl/player/DGamePlayer.java
similarity index 91%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/player/DGamePlayer.java
rename to src/main/java/io/github/dre2n/dungeonsxl/player/DGamePlayer.java
index 7c8ad116..2ae20189 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/player/DGamePlayer.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/player/DGamePlayer.java
@@ -16,10 +16,10 @@
*/
package io.github.dre2n.dungeonsxl.player;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
-import io.github.dre2n.commons.util.playerutil.PlayerUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.player.PlayerUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.event.dplayer.DPlayerKickEvent;
import io.github.dre2n.dungeonsxl.event.dplayer.instance.DInstancePlayerUpdateEvent;
import io.github.dre2n.dungeonsxl.event.dplayer.instance.game.DGamePlayerDeathEvent;
@@ -27,7 +27,7 @@ import io.github.dre2n.dungeonsxl.event.dplayer.instance.game.DGamePlayerFinishE
import io.github.dre2n.dungeonsxl.event.requirement.RequirementCheckEvent;
import io.github.dre2n.dungeonsxl.game.Game;
import io.github.dre2n.dungeonsxl.game.GameGoal;
-import io.github.dre2n.dungeonsxl.game.GameRules;
+import io.github.dre2n.dungeonsxl.game.GameRuleProvider;
import io.github.dre2n.dungeonsxl.game.GameType;
import io.github.dre2n.dungeonsxl.game.GameTypeDefault;
import io.github.dre2n.dungeonsxl.mob.DMob;
@@ -88,7 +88,7 @@ public class DGamePlayer extends DInstancePlayer {
game = new Game(DGroup.getByPlayer(player));
}
- GameRules rules = game.getRules();
+ GameRuleProvider rules = game.getRules();
player.setGameMode(GameMode.SURVIVAL);
if (!rules.getKeepInventoryOnEnter()) {
@@ -234,7 +234,7 @@ public class DGamePlayer extends DInstancePlayer {
return;
}
- DClass dClass = DungeonsXL.getDClasses().getByName(className);
+ DClass dClass = DungeonsXL.getInstance().getDClasses().getByName(className);
if (dClass != null) {
if (this.dClass != dClass) {
this.dClass = dClass;
@@ -439,9 +439,9 @@ public class DGamePlayer extends DInstancePlayer {
return;
}
- game.sendMessage(DMessages.GROUP_FLAG_CAPTURED.getMessage(getName(), stealing.getName()));
+ game.sendMessage(DMessage.GROUP_FLAG_CAPTURED.getMessage(getName(), stealing.getName()));
- GameRules rules = game.getRules();
+ GameRuleProvider rules = game.getRules();
getDGroup().setScore(getDGroup().getScore() + 1);
if (rules.getScoreGoal() == dGroup.getScore()) {
@@ -453,7 +453,7 @@ public class DGamePlayer extends DInstancePlayer {
for (DGamePlayer member : stealing.getDGamePlayers()) {
member.kill();
}
- game.sendMessage(DMessages.GROUP_DEFEATED.getMessage(stealing.getName()));
+ game.sendMessage(DMessage.GROUP_DEFEATED.getMessage(stealing.getName()));
}
stealing = null;
@@ -482,7 +482,7 @@ public class DGamePlayer extends DInstancePlayer {
if (gameWorld == null) {
return;
}
- GameRules rules = game.getRules();
+ GameRuleProvider rules = game.getRules();
delete();
if (finished) {
@@ -513,12 +513,12 @@ public class DGamePlayer extends DInstancePlayer {
// Tutorial Permissions
if (game.isTutorial() && plugin.getPermissionProvider().hasGroupSupport()) {
- String endGroup = DungeonsXL.getMainConfig().getTutorialEndGroup();
+ String endGroup = DungeonsXL.getInstance().getMainConfig().getTutorialEndGroup();
if (plugin.isGroupEnabled(endGroup)) {
plugin.getPermissionProvider().playerAddGroup(getPlayer(), endGroup);
}
- String startGroup = DungeonsXL.getMainConfig().getTutorialStartGroup();
+ String startGroup = DungeonsXL.getInstance().getMainConfig().getTutorialStartGroup();
if (plugin.isGroupEnabled(startGroup)) {
plugin.getPermissionProvider().playerRemoveGroup(getPlayer(), startGroup);
}
@@ -556,7 +556,7 @@ public class DGamePlayer extends DInstancePlayer {
Player newCaptain = dGroup.getPlayers().get(0);
dGroup.setCaptain(newCaptain);
if (message) {
- MessageUtil.sendMessage(newCaptain, DMessages.PLAYER_NEW_CAPTAIN.getMessage());
+ MessageUtil.sendMessage(newCaptain, DMessage.PLAYER_NEW_CAPTAIN.getMessage());
}
// ...*flies away*
}
@@ -570,12 +570,12 @@ public class DGamePlayer extends DInstancePlayer {
if (!dPlayerKickEvent.isCancelled()) {
DGameWorld gameWorld = getDGroup().getGameWorld();
if (lives != -1) {
- gameWorld.sendMessage(DMessages.PLAYER_DEATH_KICK.getMessage(getName()));
+ gameWorld.sendMessage(DMessage.PLAYER_DEATH_KICK.getMessage(getName()));
} else if (getDGroup().getLives() != -1) {
- gameWorld.sendMessage(DMessages.GROUP_DEATH_KICK.getMessage(getName(), dGroup.getName()));
+ gameWorld.sendMessage(DMessage.GROUP_DEATH_KICK.getMessage(getName(), dGroup.getName()));
}
- GameRules rules = Game.getByPlayer(player).getRules();
+ GameRuleProvider rules = Game.getByPlayer(player).getRules();
leave();
if (rules.getKeepInventoryOnEscape() && rules.getKeepInventoryOnDeath()) {
applyRespawnInventory();
@@ -588,10 +588,10 @@ public class DGamePlayer extends DInstancePlayer {
return true;
}
- GameRules rules = game.getRules();
+ GameRuleProvider rules = game.getRules();
if (!checkTime(game)) {
- MessageUtil.sendMessage(player, DMessages.ERROR_COOLDOWN.getMessage(String.valueOf(rules.getTimeToNextPlay())));
+ MessageUtil.sendMessage(player, DMessage.ERROR_COOLDOWN.getMessage(String.valueOf(rules.getTimeToNextPlay())));
return false;
}
@@ -666,7 +666,7 @@ public class DGamePlayer extends DInstancePlayer {
return true;
}
- GameRules rules = game.getRules();
+ GameRuleProvider rules = game.getRules();
if (rules.getTimeToNextPlay() != 0) {
// read PlayerConfig
@@ -699,7 +699,7 @@ public class DGamePlayer extends DInstancePlayer {
game.fetchRules();
if (!checkRequirements(game)) {
- MessageUtil.sendMessage(player, DMessages.ERROR_REQUIREMENTS.getMessage());
+ MessageUtil.sendMessage(player, DMessage.ERROR_REQUIREMENTS.getMessage());
return;
}
@@ -755,7 +755,7 @@ public class DGamePlayer extends DInstancePlayer {
return;
}
- MessageUtil.sendMessage(getPlayer(), DMessages.PLAYER_FINISHED_FLOOR.getMessage());
+ MessageUtil.sendMessage(getPlayer(), DMessage.PLAYER_FINISHED_FLOOR.getMessage());
finished = true;
boolean hasToWait = false;
@@ -769,7 +769,7 @@ public class DGamePlayer extends DInstancePlayer {
if (dGroup.isFinished()) {
dGroup.finishFloor(specifiedFloor);
} else {
- MessageUtil.sendMessage(player, DMessages.PLAYER_WAIT_FOR_OTHER_PLAYERS.getMessage());
+ MessageUtil.sendMessage(player, DMessage.PLAYER_WAIT_FOR_OTHER_PLAYERS.getMessage());
hasToWait = true;
}
@@ -793,7 +793,7 @@ public class DGamePlayer extends DInstancePlayer {
*/
public void finish(boolean message) {
if (message) {
- MessageUtil.sendMessage(getPlayer(), DMessages.PLAYER_FINISHED_DUNGEON.getMessage());
+ MessageUtil.sendMessage(getPlayer(), DMessage.PLAYER_FINISHED_DUNGEON.getMessage());
}
finished = true;
@@ -805,7 +805,7 @@ public class DGamePlayer extends DInstancePlayer {
dGroup.finish();
} else {
if (message) {
- MessageUtil.sendMessage(this.getPlayer(), DMessages.PLAYER_WAIT_FOR_OTHER_PLAYERS.getMessage());
+ MessageUtil.sendMessage(this.getPlayer(), DMessage.PLAYER_WAIT_FOR_OTHER_PLAYERS.getMessage());
}
hasToWait = true;
}
@@ -846,7 +846,7 @@ public class DGamePlayer extends DInstancePlayer {
if (getDGroup() != null && dGroup.getLives() != -1) {
dGroup.setLives(dGroup.getLives() - 1);
- MessageUtil.broadcastMessage(DMessages.GROUP_DEATH.getMessage(getName(), dGroup.getName(), String.valueOf(dGroup.getLives())));
+ MessageUtil.broadcastMessage(DMessage.GROUP_DEATH.getMessage(getName(), dGroup.getName(), String.valueOf(dGroup.getLives())));
} else {
if (lives != -1) {
@@ -854,11 +854,11 @@ public class DGamePlayer extends DInstancePlayer {
}
DGamePlayer killer = DGamePlayer.getByPlayer(player.getKiller());
- String newLives = lives == -1 ? DMessages.MISC_UNLIMITED.getMessage() : String.valueOf(this.lives);
+ String newLives = lives == -1 ? DMessage.MISC_UNLIMITED.getMessage() : String.valueOf(this.lives);
if (killer != null) {
- gameWorld.sendMessage(DMessages.PLAYER_KILLED.getMessage(getName(), killer.getName(), newLives));
+ gameWorld.sendMessage(DMessage.PLAYER_KILLED.getMessage(getName(), killer.getName(), newLives));
} else {
- gameWorld.sendMessage(DMessages.PLAYER_DEATH.getMessage(getName(), newLives));
+ gameWorld.sendMessage(DMessage.PLAYER_DEATH.getMessage(getName(), newLives));
}
}
@@ -866,7 +866,7 @@ public class DGamePlayer extends DInstancePlayer {
for (TeamFlag teamFlag : gameWorld.getTeamFlags()) {
if (teamFlag.getOwner().equals(stealing)) {
teamFlag.reset();
- gameWorld.sendMessage(DMessages.GROUP_FLAG_LOST.getMessage(player.getName(), stealing.getName()));
+ gameWorld.sendMessage(DMessage.GROUP_FLAG_LOST.getMessage(player.getName(), stealing.getName()));
stealing = null;
}
}
@@ -986,7 +986,7 @@ public class DGamePlayer extends DInstancePlayer {
/* Statics */
public static DGamePlayer getByPlayer(Player player) {
- for (DGamePlayer dPlayer : DungeonsXL.getDPlayers().getDGamePlayers()) {
+ for (DGamePlayer dPlayer : DungeonsXL.getInstance().getDPlayers().getDGamePlayers()) {
if (dPlayer.getPlayer().equals(player)) {
return dPlayer;
}
@@ -995,7 +995,7 @@ public class DGamePlayer extends DInstancePlayer {
}
public static DGamePlayer getByName(String name) {
- for (DGamePlayer dPlayer : DungeonsXL.getDPlayers().getDGamePlayers()) {
+ for (DGamePlayer dPlayer : DungeonsXL.getInstance().getDPlayers().getDGamePlayers()) {
if (dPlayer.getPlayer().getName().equalsIgnoreCase(name) || dPlayer.getName().equalsIgnoreCase(name)) {
return dPlayer;
}
@@ -1007,7 +1007,7 @@ public class DGamePlayer extends DInstancePlayer {
public static List getByWorld(World world) {
List dPlayers = new ArrayList<>();
- for (DGamePlayer dPlayer : DungeonsXL.getDPlayers().getDGamePlayers()) {
+ for (DGamePlayer dPlayer : DungeonsXL.getInstance().getDPlayers().getDGamePlayers()) {
if (dPlayer.getWorld() == world) {
dPlayers.add(dPlayer);
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/player/DGlobalPlayer.java b/src/main/java/io/github/dre2n/dungeonsxl/player/DGlobalPlayer.java
similarity index 90%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/player/DGlobalPlayer.java
rename to src/main/java/io/github/dre2n/dungeonsxl/player/DGlobalPlayer.java
index 3b6d5cce..8f714d82 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/player/DGlobalPlayer.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/player/DGlobalPlayer.java
@@ -16,12 +16,12 @@
*/
package io.github.dre2n.dungeonsxl.player;
+import io.github.dre2n.commons.chat.MessageUtil;
import io.github.dre2n.commons.compatibility.CompatibilityHandler;
import io.github.dre2n.commons.compatibility.Version;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
-import io.github.dre2n.commons.util.playerutil.PlayerUtil;
+import io.github.dre2n.commons.player.PlayerUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.event.dgroup.DGroupCreateEvent;
import io.github.dre2n.dungeonsxl.game.Game;
import io.github.dre2n.dungeonsxl.global.DPortal;
@@ -70,7 +70,7 @@ public class DGlobalPlayer {
reset(false);
}
- DungeonsXL.getDPlayers().addPlayer(this);
+ DungeonsXL.getInstance().getDPlayers().addPlayer(this);
}
public DGlobalPlayer(DGlobalPlayer dPlayer) {
@@ -82,7 +82,7 @@ public class DGlobalPlayer {
respawnInventory = dPlayer.getRespawnInventory();
respawnArmor = dPlayer.getRespawnArmor();
- DungeonsXL.getDPlayers().addPlayer(this);
+ DungeonsXL.getInstance().getDPlayers().addPlayer(this);
}
/* Getters and setters */
@@ -133,7 +133,7 @@ public class DGlobalPlayer {
* @return if the player is in group chat
*/
public boolean isInGroupChat() {
- if (!DungeonsXL.getMainConfig().isChatEnabled()) {
+ if (!DungeonsXL.getInstance().getMainConfig().isChatEnabled()) {
return false;
}
return groupChat;
@@ -151,7 +151,7 @@ public class DGlobalPlayer {
* @return if the player spies the DXL chat channels
*/
public boolean isInChatSpyMode() {
- if (!DungeonsXL.getMainConfig().isChatEnabled()) {
+ if (!DungeonsXL.getInstance().getMainConfig().isChatEnabled()) {
return false;
}
return chatSpyMode;
@@ -349,7 +349,7 @@ public class DGlobalPlayer {
} catch (NullPointerException exception) {
exception.printStackTrace();
player.setHealth(0);
- MessageUtil.log(plugin, DMessages.LOG_KILLED_CORRUPTED_PLAYER.getMessage(player.getName()));
+ MessageUtil.log(plugin, DMessage.LOG_KILLED_CORRUPTED_PLAYER.getMessage(player.getName()));
}
data.clearPlayerState();
@@ -363,8 +363,8 @@ public class DGlobalPlayer {
return;
}
- final String startGroup = DungeonsXL.getMainConfig().getTutorialStartGroup();
- if ((DungeonsXL.getMainConfig().getTutorialDungeon() == null || startGroup == null)) {
+ final String startGroup = DungeonsXL.getInstance().getMainConfig().getTutorialStartGroup();
+ if ((DungeonsXL.getInstance().getMainConfig().getTutorialDungeon() == null || startGroup == null)) {
return;
}
@@ -372,7 +372,7 @@ public class DGlobalPlayer {
plugin.getPermissionProvider().playerAddGroup(player, startGroup);
}
- DGroup dGroup = new DGroup(player, DungeonsXL.getMainConfig().getTutorialDungeon(), false);
+ DGroup dGroup = new DGroup(player, DungeonsXL.getInstance().getMainConfig().getTutorialDungeon(), false);
DGroupCreateEvent createEvent = new DGroupCreateEvent(dGroup, player, DGroupCreateEvent.Cause.GROUP_SIGN);
Bukkit.getPluginManager().callEvent(createEvent);
@@ -388,9 +388,9 @@ public class DGlobalPlayer {
DGameWorld gameWorld = null;
if (dGroup.getGameWorld() == null) {
- DResourceWorld resource = DungeonsXL.getDWorlds().getResourceByName(dGroup.getMapName());
+ DResourceWorld resource = DungeonsXL.getInstance().getDWorlds().getResourceByName(dGroup.getMapName());
if (resource == null) {
- MessageUtil.sendMessage(player, DMessages.ERROR_TUTORIAL_NOT_EXIST.getMessage());
+ MessageUtil.sendMessage(player, DMessage.ERROR_TUTORIAL_NOT_EXIST.getMessage());
return;
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/player/DGroup.java b/src/main/java/io/github/dre2n/dungeonsxl/player/DGroup.java
similarity index 88%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/player/DGroup.java
rename to src/main/java/io/github/dre2n/dungeonsxl/player/DGroup.java
index 9077b100..a69627e9 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/player/DGroup.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/player/DGroup.java
@@ -16,10 +16,10 @@
*/
package io.github.dre2n.dungeonsxl.player;
-import io.github.dre2n.commons.util.NumberUtil;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.misc.NumberUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.dungeon.Dungeon;
import io.github.dre2n.dungeonsxl.dungeon.DungeonConfig;
import io.github.dre2n.dungeonsxl.event.dgroup.DGroupDisbandEvent;
@@ -31,7 +31,7 @@ import io.github.dre2n.dungeonsxl.event.dplayer.DPlayerJoinDGroupEvent;
import io.github.dre2n.dungeonsxl.event.requirement.RequirementDemandEvent;
import io.github.dre2n.dungeonsxl.event.reward.RewardAdditionEvent;
import io.github.dre2n.dungeonsxl.game.Game;
-import io.github.dre2n.dungeonsxl.game.GameRules;
+import io.github.dre2n.dungeonsxl.game.GameRuleProvider;
import io.github.dre2n.dungeonsxl.global.GroupSign;
import io.github.dre2n.dungeonsxl.requirement.Requirement;
import io.github.dre2n.dungeonsxl.reward.Reward;
@@ -55,7 +55,7 @@ import org.bukkit.scheduler.BukkitTask;
public class DGroup {
DungeonsXL plugin = DungeonsXL.getInstance();
- DPlayers dPlayers = DungeonsXL.getDPlayers();
+ DPlayerCache dPlayers = DungeonsXL.getInstance().getDPlayers();
private String name;
private UUID captain;
@@ -75,11 +75,11 @@ public class DGroup {
private int lives = -1;
public DGroup(Player player) {
- this(DungeonsXL.getMainConfig().getGroupColorPriority().get(DungeonsXL.getDGroups().size()).toString(), player);
+ this(DungeonsXL.getInstance().getMainConfig().getGroupColorPriority().get(DungeonsXL.getInstance().getDGroups().size()).toString(), player);
}
public DGroup(String name, Player player) {
- DungeonsXL.getDGroups().add(this);
+ DungeonsXL.getInstance().getDGroups().add(this);
this.name = name;
setCaptain(player);
@@ -91,7 +91,7 @@ public class DGroup {
@Deprecated
public DGroup(Player player, String identifier, boolean multiFloor) {
- this(DungeonsXL.getMainConfig().getGroupColorPriority().get(DungeonsXL.getDGroups().size()).toString(), player, identifier, multiFloor);
+ this(DungeonsXL.getInstance().getMainConfig().getGroupColorPriority().get(DungeonsXL.getInstance().getDGroups().size()).toString(), player, identifier, multiFloor);
}
@Deprecated
@@ -101,10 +101,10 @@ public class DGroup {
@Deprecated
public DGroup(String name, Player captain, List players, String identifier, boolean multiFloor) {
- DungeonsXL.getDGroups().add(this);
+ DungeonsXL.getInstance().getDGroups().add(this);
this.name = name;
- DPlayerJoinDGroupEvent event = new DPlayerJoinDGroupEvent(DungeonsXL.getDPlayers().getByPlayer(captain), true, this);
+ DPlayerJoinDGroupEvent event = new DPlayerJoinDGroupEvent(DungeonsXL.getInstance().getDPlayers().getByPlayer(captain), true, this);
Bukkit.getPluginManager().callEvent(event);
if (!event.isCancelled()) {
@@ -118,14 +118,14 @@ public class DGroup {
}
}
- dungeon = DungeonsXL.getDungeons().getByName(identifier);
+ dungeon = DungeonsXL.getInstance().getDungeons().getByName(identifier);
if (multiFloor && dungeon != null) {
// Real dungeon
unplayedFloors = new ArrayList<>(dungeon.getConfig().getFloors());
} else {
// Artificial dungeon
- DResourceWorld resource = DungeonsXL.getDWorlds().getResourceByName(identifier);
+ DResourceWorld resource = DungeonsXL.getInstance().getDWorlds().getResourceByName(identifier);
dungeon = new Dungeon(resource);
}
@@ -134,7 +134,7 @@ public class DGroup {
}
public DGroup(Player player, Dungeon dungeon) {
- this(DungeonsXL.getMainConfig().getGroupColorPriority().get(DungeonsXL.getDGroups().size()).toString(), player, dungeon);
+ this(DungeonsXL.getInstance().getMainConfig().getGroupColorPriority().get(DungeonsXL.getInstance().getDGroups().size()).toString(), player, dungeon);
}
public DGroup(String name, Player player, Dungeon dungeon) {
@@ -142,10 +142,10 @@ public class DGroup {
}
public DGroup(String name, Player captain, List players, Dungeon dungeon) {
- DungeonsXL.getDGroups().add(this);
+ DungeonsXL.getInstance().getDGroups().add(this);
this.name = name;
- DPlayerJoinDGroupEvent event = new DPlayerJoinDGroupEvent(DungeonsXL.getDPlayers().getByPlayer(captain), true, this);
+ DPlayerJoinDGroupEvent event = new DPlayerJoinDGroupEvent(DungeonsXL.getInstance().getDPlayers().getByPlayer(captain), true, this);
Bukkit.getPluginManager().callEvent(event);
if (!event.isCancelled()) {
@@ -260,8 +260,8 @@ public class DGroup {
if (!event.isCancelled()) {
if (message) {
- sendMessage(DMessages.GROUP_PLAYER_JOINED.getMessage(player.getName()));
- MessageUtil.sendMessage(player, DMessages.PLAYER_JOIN_GROUP.getMessage());
+ sendMessage(DMessage.GROUP_PLAYER_JOINED.getMessage(player.getName()));
+ MessageUtil.sendMessage(player, DMessage.PLAYER_JOIN_GROUP.getMessage());
}
players.add(player.getUniqueId());
@@ -289,7 +289,7 @@ public class DGroup {
GroupSign.updatePerGroup(this);
if (message) {
- sendMessage(DungeonsXL.getMessageConfig().getMessage(DMessages.PLAYER_LEFT_GROUP, player.getName()));
+ sendMessage(DungeonsXL.getInstance().getMessageConfig().getMessage(DMessage.PLAYER_LEFT_GROUP, player.getName()));
}
if (isEmpty()) {
@@ -325,18 +325,18 @@ public class DGroup {
if (DGroup.getByPlayer(player) != null) {
if (!silent) {
- MessageUtil.sendMessage(getCaptain(), DungeonsXL.getMessageConfig().getMessage(DMessages.ERROR_IN_GROUP, player.getName()));
+ MessageUtil.sendMessage(getCaptain(), DungeonsXL.getInstance().getMessageConfig().getMessage(DMessage.ERROR_IN_GROUP, player.getName()));
}
return;
}
if (!silent) {
- MessageUtil.sendMessage(player, DungeonsXL.getMessageConfig().getMessage(DMessages.PLAYER_INVITED, getCaptain().getName(), name));
+ MessageUtil.sendMessage(player, DungeonsXL.getInstance().getMessageConfig().getMessage(DMessage.PLAYER_INVITED, getCaptain().getName(), name));
}
// Send message
if (!silent) {
- sendMessage(DungeonsXL.getMessageConfig().getMessage(DMessages.GROUP_INVITED_PLAYER, getCaptain().getName(), player.getName(), name));
+ sendMessage(DungeonsXL.getInstance().getMessageConfig().getMessage(DMessage.GROUP_INVITED_PLAYER, getCaptain().getName(), player.getName(), name));
}
// Add player
@@ -354,19 +354,19 @@ public class DGroup {
if (DGroup.getByPlayer(player) != this) {
if (!silent) {
- MessageUtil.sendMessage(getCaptain(), DungeonsXL.getMessageConfig().getMessage(DMessages.ERROR_NOT_IN_GROUP, player.getName(), name));
+ MessageUtil.sendMessage(getCaptain(), DungeonsXL.getInstance().getMessageConfig().getMessage(DMessage.ERROR_NOT_IN_GROUP, player.getName(), name));
}
return;
}
if (!silent) {
- MessageUtil.sendMessage(player, DungeonsXL.getMessageConfig().getMessage(DMessages.PLAYER_UNINVITED, player.getName(), name));
+ MessageUtil.sendMessage(player, DungeonsXL.getInstance().getMessageConfig().getMessage(DMessage.PLAYER_UNINVITED, player.getName(), name));
}
// Send message
if (!silent) {
for (Player groupPlayer : getPlayers()) {
- MessageUtil.sendMessage(groupPlayer, DungeonsXL.getMessageConfig().getMessage(DMessages.GROUP_UNINVITED_PLAYER, getCaptain().getName(), player.getName(), name));
+ MessageUtil.sendMessage(groupPlayer, DungeonsXL.getInstance().getMessageConfig().getMessage(DMessage.GROUP_UNINVITED_PLAYER, getCaptain().getName(), player.getName(), name));
}
}
@@ -430,13 +430,13 @@ public class DGroup {
* the name of the dungeon
*/
public boolean setDungeon(String name) {
- dungeon = DungeonsXL.getDungeons().getByName(name);
+ dungeon = DungeonsXL.getInstance().getDungeons().getByName(name);
if (dungeon != null) {
unplayedFloors = dungeon.getConfig().getFloors();
return true;
} else {
- DResourceWorld resource = DungeonsXL.getDWorlds().getResourceByName(name);
+ DResourceWorld resource = DungeonsXL.getInstance().getDWorlds().getResourceByName(name);
if (resource != null) {
dungeon = new Dungeon(resource);
return true;
@@ -745,7 +745,7 @@ public class DGroup {
public void delete() {
Game game = Game.getByDGroup(this);
- DungeonsXL.getDGroups().remove(this);
+ DungeonsXL.getInstance().getDGroups().remove(this);
if (game != null) {
game.removeDGroup(this);
@@ -763,9 +763,9 @@ public class DGroup {
return;
}
game.fetchRules();
- GameRules rules = game.getRules();
+ GameRuleProvider rules = game.getRules();
- color = DungeonsXL.getMainConfig().getGroupColorPriority().get(game.getDGroups().indexOf(this));
+ color = DungeonsXL.getInstance().getMainConfig().getGroupColorPriority().get(game.getDGroups().indexOf(this));
for (DGroup dGroup : game.getDGroups()) {
if (dGroup == null) {
@@ -816,7 +816,7 @@ public class DGroup {
dPlayer.respawn();
- if (DungeonsXL.getMainConfig().isSendFloorTitleEnabled()) {
+ if (DungeonsXL.getInstance().getMainConfig().isSendFloorTitleEnabled()) {
if (rules.getTitle() != null || rules.getSubTitle() != null) {
String title = rules.getTitle() == null ? "" : rules.getTitle();
String subtitle = rules.getSubTitle() == null ? "" : rules.getSubTitle();
@@ -870,8 +870,8 @@ public class DGroup {
}
public void winGame() {
- String title = DMessages.GROUP_CONGRATS.getMessage();
- String subtitle = DMessages.GROUP_CONGRATS_SUB.getMessage(getName());
+ String title = DMessage.GROUP_CONGRATS.getMessage();
+ String subtitle = DMessage.GROUP_CONGRATS_SUB.getMessage(getName());
for (DGamePlayer player : getDGamePlayers()) {
player.leave(false);
MessageUtil.sendTitleMessage(player.getPlayer(), title, subtitle, 20, 20, 100);
@@ -934,7 +934,7 @@ public class DGroup {
/* Statics */
public static DGroup getByName(String name) {
- for (DGroup dGroup : DungeonsXL.getDGroups()) {
+ for (DGroup dGroup : DungeonsXL.getInstance().getDGroups()) {
if (dGroup.getName().equalsIgnoreCase(name) || dGroup.getRawName().equalsIgnoreCase(name)) {
return dGroup;
}
@@ -944,7 +944,7 @@ public class DGroup {
}
public static DGroup getByPlayer(Player player) {
- for (DGroup dGroup : DungeonsXL.getDGroups()) {
+ for (DGroup dGroup : DungeonsXL.getInstance().getDGroups()) {
if (dGroup.getPlayers().contains(player)) {
return dGroup;
}
@@ -954,7 +954,7 @@ public class DGroup {
}
public static void leaveGroup(Player player) {
- for (DGroup dGroup : DungeonsXL.getDGroups()) {
+ for (DGroup dGroup : DungeonsXL.getInstance().getDGroups()) {
if (dGroup.getPlayers().contains(player)) {
dGroup.getPlayers().remove(player);
}
@@ -968,7 +968,7 @@ public class DGroup {
*/
public static List getByGameWorld(DGameWorld gameWorld) {
List dGroups = new ArrayList<>();
- for (DGroup dGroup : DungeonsXL.getDGroups()) {
+ for (DGroup dGroup : DungeonsXL.getInstance().getDGroups()) {
if (dGroup.getGameWorld().equals(gameWorld)) {
dGroups.add(dGroup);
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/player/DGroupTag.java b/src/main/java/io/github/dre2n/dungeonsxl/player/DGroupTag.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/player/DGroupTag.java
rename to src/main/java/io/github/dre2n/dungeonsxl/player/DGroupTag.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/player/DInstancePlayer.java b/src/main/java/io/github/dre2n/dungeonsxl/player/DInstancePlayer.java
similarity index 91%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/player/DInstancePlayer.java
rename to src/main/java/io/github/dre2n/dungeonsxl/player/DInstancePlayer.java
index 9a1f60be..cc8bb29f 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/player/DInstancePlayer.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/player/DInstancePlayer.java
@@ -31,7 +31,7 @@ import org.bukkit.potion.PotionEffect;
*/
public abstract class DInstancePlayer extends DGlobalPlayer {
- MainConfig config = DungeonsXL.getMainConfig();
+ MainConfig config = DungeonsXL.getInstance().getMainConfig();
private World world;
@@ -90,7 +90,7 @@ public abstract class DInstancePlayer extends DGlobalPlayer {
new DGlobalPlayer(this);
} else {
- DungeonsXL.getDPlayers().removePlayer(this);
+ DungeonsXL.getInstance().getDPlayers().removePlayer(this);
}
}
@@ -101,13 +101,13 @@ public abstract class DInstancePlayer extends DGlobalPlayer {
* the message to send
*/
public void chat(String message) {
- DInstanceWorld instance = DungeonsXL.getDWorlds().getInstanceByWorld(world);
+ DInstanceWorld instance = DungeonsXL.getInstance().getDWorlds().getInstanceByWorld(world);
if (instance == null) {
return;
}
instance.sendMessage(ParsingUtil.replaceChatPlaceholders(config.getChatFormatGame(), this) + message);
- for (DGlobalPlayer player : DungeonsXL.getDPlayers().getDGlobalPlayers()) {
+ for (DGlobalPlayer player : DungeonsXL.getInstance().getDPlayers().getDGlobalPlayers()) {
if (player.isInChatSpyMode()) {
if (!instance.getWorld().getPlayers().contains(player.getPlayer())) {
player.sendMessage(ParsingUtil.replaceChatPlaceholders(config.getChatFormatSpy(), this) + message);
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/player/DPermissions.java b/src/main/java/io/github/dre2n/dungeonsxl/player/DPermissions.java
similarity index 99%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/player/DPermissions.java
rename to src/main/java/io/github/dre2n/dungeonsxl/player/DPermissions.java
index d85d6b31..bde2d050 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/player/DPermissions.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/player/DPermissions.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.player;
-import io.github.dre2n.commons.util.EnumUtil;
+import io.github.dre2n.commons.misc.EnumUtil;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/player/DPlayers.java b/src/main/java/io/github/dre2n/dungeonsxl/player/DPlayerCache.java
similarity index 97%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/player/DPlayers.java
rename to src/main/java/io/github/dre2n/dungeonsxl/player/DPlayerCache.java
index 5b03657a..f3366989 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/player/DPlayers.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/player/DPlayerCache.java
@@ -30,10 +30,10 @@ import org.bukkit.scheduler.BukkitTask;
*
* @author Daniel Saukel
*/
-public class DPlayers {
+public class DPlayerCache {
DungeonsXL plugin = DungeonsXL.getInstance();
- MainConfig mainConfig = DungeonsXL.getMainConfig();
+ MainConfig mainConfig = DungeonsXL.getInstance().getMainConfig();
private BukkitTask secureModeTask;
private BukkitTask updateTask;
@@ -41,7 +41,7 @@ public class DPlayers {
private CopyOnWriteArrayList dGlobalPlayers = new CopyOnWriteArrayList<>();
- public DPlayers() {
+ public DPlayerCache() {
if (mainConfig.isSecureModeEnabled()) {
startSecureModeTask(mainConfig.getSecureModeCheckInterval());
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/player/DPlayerData.java b/src/main/java/io/github/dre2n/dungeonsxl/player/DPlayerData.java
similarity index 97%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/player/DPlayerData.java
rename to src/main/java/io/github/dre2n/dungeonsxl/player/DPlayerData.java
index 53340b9f..11c46b20 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/player/DPlayerData.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/player/DPlayerData.java
@@ -16,13 +16,13 @@
*/
package io.github.dre2n.dungeonsxl.player;
+import io.github.dre2n.commons.chat.MessageUtil;
import io.github.dre2n.commons.compatibility.CompatibilityHandler;
import io.github.dre2n.commons.compatibility.Internals;
-import io.github.dre2n.commons.config.BRConfig;
-import io.github.dre2n.commons.util.EnumUtil;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.config.DREConfig;
+import io.github.dre2n.commons.misc.EnumUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
@@ -43,7 +43,7 @@ import org.bukkit.potion.PotionEffect;
*
* @author Daniel Saukel
*/
-public class DPlayerData extends BRConfig {
+public class DPlayerData extends DREConfig {
boolean is1_9 = Internals.andHigher(Internals.v1_9_R1).contains(CompatibilityHandler.getInstance().getInternals());
@@ -317,7 +317,7 @@ public class DPlayerData extends BRConfig {
if (!file.exists()) {
try {
file.createNewFile();
- MessageUtil.log(DungeonsXL.getInstance(), DMessages.LOG_NEW_PLAYER_DATA.getMessage(file.getName()));
+ MessageUtil.log(DungeonsXL.getInstance(), DMessage.LOG_NEW_PLAYER_DATA.getMessage(file.getName()));
} catch (IOException exception) {
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/player/DPlayerListener.java b/src/main/java/io/github/dre2n/dungeonsxl/player/DPlayerListener.java
similarity index 95%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/player/DPlayerListener.java
rename to src/main/java/io/github/dre2n/dungeonsxl/player/DPlayerListener.java
index 9ec34d4a..948c83a7 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/player/DPlayerListener.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/player/DPlayerListener.java
@@ -16,9 +16,9 @@
*/
package io.github.dre2n.dungeonsxl.player;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.config.MainConfig;
import io.github.dre2n.dungeonsxl.game.Game;
import io.github.dre2n.dungeonsxl.mob.DMob;
@@ -63,12 +63,12 @@ import org.bukkit.inventory.meta.BookMeta;
public class DPlayerListener implements Listener {
DungeonsXL plugin;
- DPlayers dPlayers;
- MainConfig config = DungeonsXL.getMainConfig();
+ DPlayerCache dPlayers;
+ MainConfig config = DungeonsXL.getInstance().getMainConfig();
public static final String ALL = "@all ";
- public DPlayerListener(DPlayers dPlayers) {
+ public DPlayerListener(DPlayerCache dPlayers) {
this.plugin = DungeonsXL.getInstance();
this.dPlayers = dPlayers;
}
@@ -287,7 +287,7 @@ public class DPlayerListener implements Listener {
}
if (event.isCancelled()) {
- MessageUtil.sendMessage(player, DMessages.ERROR_CMD.getMessage());
+ MessageUtil.sendMessage(player, DMessage.ERROR_CMD.getMessage());
}
}
@@ -346,7 +346,7 @@ public class DPlayerListener implements Listener {
for (ItemStack item : game.getRules().getSecureObjects()) {
if (event.getItemDrop().getItemStack().isSimilar(item)) {
event.setCancelled(true);
- MessageUtil.sendMessage(player, DMessages.ERROR_DROP.getMessage());
+ MessageUtil.sendMessage(player, DMessage.ERROR_DROP.getMessage());
return;
}
}
@@ -378,7 +378,7 @@ public class DPlayerListener implements Listener {
@EventHandler(ignoreCancelled = true)
public void onPlayerLogin(PlayerLoginEvent event) {
Player player = event.getPlayer();
- MainConfig config = DungeonsXL.getMainConfig();
+ MainConfig config = DungeonsXL.getInstance().getMainConfig();
if (!config.isTutorialActivated()) {
return;
@@ -401,9 +401,9 @@ public class DPlayerListener implements Listener {
continue;
}
- if (DungeonsXL.getDWorlds().getGameWorlds().size() >= config.getMaxInstances()) {
+ if (DungeonsXL.getInstance().getDWorlds().getGameWorlds().size() >= config.getMaxInstances()) {
event.setResult(PlayerLoginEvent.Result.KICK_FULL);
- event.setKickMessage(DMessages.ERROR_TOO_MANY_TUTORIALS.getMessage());
+ event.setKickMessage(DMessage.ERROR_TOO_MANY_TUTORIALS.getMessage());
}
return;
}
@@ -452,11 +452,11 @@ public class DPlayerListener implements Listener {
((DGamePlayer) dPlayer).leave();
} else if (timeUntilKickOfflinePlayer > 0) {
- dGroup.sendMessage(DMessages.PLAYER_OFFLINE.getMessage(dPlayer.getName(), String.valueOf(timeUntilKickOfflinePlayer)), player);
+ dGroup.sendMessage(DMessage.PLAYER_OFFLINE.getMessage(dPlayer.getName(), String.valueOf(timeUntilKickOfflinePlayer)), player);
((DGamePlayer) dPlayer).setOfflineTime(System.currentTimeMillis() + timeUntilKickOfflinePlayer * 1000);
} else {
- dGroup.sendMessage(DMessages.PLAYER_OFFLINE_NEVER.getMessage(dPlayer.getName()), player);
+ dGroup.sendMessage(DMessage.PLAYER_OFFLINE_NEVER.getMessage(dPlayer.getName()), player);
}
} else if (dPlayer instanceof DEditPlayer) {
@@ -470,7 +470,7 @@ public class DPlayerListener implements Listener {
if (isCitizensNPC(player)) {
return;
}
- DungeonsXL.getDPlayers().getByPlayer(player).applyRespawnInventory();
+ DungeonsXL.getInstance().getDPlayers().getByPlayer(player).applyRespawnInventory();
DGlobalPlayer dPlayer = DGamePlayer.getByPlayer(player);
if (dPlayer == null) {
@@ -557,13 +557,13 @@ public class DPlayerListener implements Listener {
if (event.getAction() != Action.LEFT_CLICK_BLOCK) {
if (clickedBlock.getType() == Material.ENDER_CHEST) {
if (!DPermissions.hasPermission(player, DPermissions.BYPASS)) {
- MessageUtil.sendMessage(player, DMessages.ERROR_ENDERCHEST.getMessage());
+ MessageUtil.sendMessage(player, DMessage.ERROR_ENDERCHEST.getMessage());
event.setCancelled(true);
}
} else if (clickedBlock.getType() == Material.BED_BLOCK) {
if (!DPermissions.hasPermission(player, DPermissions.BYPASS)) {
- MessageUtil.sendMessage(player, DMessages.ERROR_BED.getMessage());
+ MessageUtil.sendMessage(player, DMessage.ERROR_BED.getMessage());
event.setCancelled(true);
}
}
@@ -575,7 +575,7 @@ public class DPlayerListener implements Listener {
if (event.getAction() != Action.LEFT_CLICK_BLOCK) {
if (clickedBlock.getType() == Material.DISPENSER) {
if (!DPermissions.hasPermission(player, DPermissions.BYPASS)) {
- MessageUtil.sendMessage(player, DMessages.ERROR_DISPENSER.getMessage());
+ MessageUtil.sendMessage(player, DMessage.ERROR_DISPENSER.getMessage());
event.setCancelled(true);
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/player/LazyUpdateTask.java b/src/main/java/io/github/dre2n/dungeonsxl/player/LazyUpdateTask.java
similarity index 91%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/player/LazyUpdateTask.java
rename to src/main/java/io/github/dre2n/dungeonsxl/player/LazyUpdateTask.java
index a57c9ebf..061c8aff 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/player/LazyUpdateTask.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/player/LazyUpdateTask.java
@@ -26,7 +26,7 @@ public class LazyUpdateTask extends BukkitRunnable {
@Override
public void run() {
- for (DGamePlayer dPlayer : DungeonsXL.getDPlayers().getDGamePlayers()) {
+ for (DGamePlayer dPlayer : DungeonsXL.getInstance().getDPlayers().getDGamePlayers()) {
dPlayer.update(true);
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/player/RespawnTask.java b/src/main/java/io/github/dre2n/dungeonsxl/player/RespawnTask.java
similarity index 91%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/player/RespawnTask.java
rename to src/main/java/io/github/dre2n/dungeonsxl/player/RespawnTask.java
index 34dd286d..68852886 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/player/RespawnTask.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/player/RespawnTask.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.player;
-import io.github.dre2n.commons.util.playerutil.PlayerUtil;
+import io.github.dre2n.commons.player.PlayerUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import org.bukkit.Location;
import org.bukkit.entity.Player;
@@ -41,7 +41,7 @@ public class RespawnTask extends BukkitRunnable {
PlayerUtil.secureTeleport(player, location);
}
- DGlobalPlayer dPlayer = DungeonsXL.getDPlayers().getByPlayer(player);
+ DGlobalPlayer dPlayer = DungeonsXL.getInstance().getDPlayers().getByPlayer(player);
if (dPlayer == null) {
return;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/player/SecureModeTask.java b/src/main/java/io/github/dre2n/dungeonsxl/player/SecureModeTask.java
similarity index 94%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/player/SecureModeTask.java
rename to src/main/java/io/github/dre2n/dungeonsxl/player/SecureModeTask.java
index 00a8ff27..7c38b976 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/player/SecureModeTask.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/player/SecureModeTask.java
@@ -29,7 +29,7 @@ public class SecureModeTask extends BukkitRunnable {
@Override
public void run() {
for (Player player : Bukkit.getOnlinePlayers()) {
- DGlobalPlayer dGlobalPlayer = DungeonsXL.getDPlayers().getByPlayer(player);
+ DGlobalPlayer dGlobalPlayer = DungeonsXL.getInstance().getDPlayers().getByPlayer(player);
if (dGlobalPlayer == null) {
dGlobalPlayer = new DGlobalPlayer(player);
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/player/TimeIsRunningTask.java b/src/main/java/io/github/dre2n/dungeonsxl/player/TimeIsRunningTask.java
similarity index 88%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/player/TimeIsRunningTask.java
rename to src/main/java/io/github/dre2n/dungeonsxl/player/TimeIsRunningTask.java
index c6108ead..4d61c790 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/player/TimeIsRunningTask.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/player/TimeIsRunningTask.java
@@ -16,10 +16,10 @@
*/
package io.github.dre2n.dungeonsxl.player;
+import io.github.dre2n.commons.chat.MessageUtil;
import io.github.dre2n.commons.config.MessageConfig;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.event.dplayer.DPlayerKickEvent;
import io.github.dre2n.dungeonsxl.game.Game;
import org.bukkit.Bukkit;
@@ -32,7 +32,7 @@ import org.bukkit.scheduler.BukkitRunnable;
*/
public class TimeIsRunningTask extends BukkitRunnable {
- MessageConfig messageConfig = DungeonsXL.getMessageConfig();
+ MessageConfig messageConfig = DungeonsXL.getInstance().getMessageConfig();
private DGroup dGroup;
private int time;
@@ -58,7 +58,7 @@ public class TimeIsRunningTask extends BukkitRunnable {
} finally {
for (Player player : dGroup.getPlayers()) {
- MessageUtil.sendActionBarMessage(player, DMessages.PLAYER_TIME_LEFT.getMessage(color, String.valueOf(timeLeft)));
+ MessageUtil.sendActionBarMessage(player, DMessage.PLAYER_TIME_LEFT.getMessage(color, String.valueOf(timeLeft)));
DGamePlayer dPlayer = DGamePlayer.getByPlayer(player);
if (timeLeft > 0) {
@@ -69,7 +69,7 @@ public class TimeIsRunningTask extends BukkitRunnable {
Bukkit.getServer().getPluginManager().callEvent(dPlayerKickEvent);
if (!dPlayerKickEvent.isCancelled()) {
- MessageUtil.broadcastMessage(DMessages.PLAYER_TIME_KICK.getMessage(player.getName()));
+ MessageUtil.broadcastMessage(DMessage.PLAYER_TIME_KICK.getMessage(player.getName()));
dPlayer.leave();
if (Game.getByDGroup(dGroup).getRules().getKeepInventoryOnEscape()) {
dPlayer.applyRespawnInventory();
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/player/UpdateTask.java b/src/main/java/io/github/dre2n/dungeonsxl/player/UpdateTask.java
similarity index 90%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/player/UpdateTask.java
rename to src/main/java/io/github/dre2n/dungeonsxl/player/UpdateTask.java
index 571b1d8b..8f8e291d 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/player/UpdateTask.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/player/UpdateTask.java
@@ -26,7 +26,7 @@ public class UpdateTask extends BukkitRunnable {
@Override
public void run() {
- for (DInstancePlayer dPlayer : DungeonsXL.getDPlayers().getDInstancePlayers()) {
+ for (DInstancePlayer dPlayer : DungeonsXL.getInstance().getDPlayers().getDInstancePlayers()) {
dPlayer.update(false);
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/requirement/FeeLevelRequirement.java b/src/main/java/io/github/dre2n/dungeonsxl/requirement/FeeLevelRequirement.java
similarity index 90%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/requirement/FeeLevelRequirement.java
rename to src/main/java/io/github/dre2n/dungeonsxl/requirement/FeeLevelRequirement.java
index 6413b9ab..c56854f1 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/requirement/FeeLevelRequirement.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/requirement/FeeLevelRequirement.java
@@ -16,8 +16,8 @@
*/
package io.github.dre2n.dungeonsxl.requirement;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.player.DGamePlayer;
import io.github.dre2n.dungeonsxl.player.DPlayerData;
import org.bukkit.configuration.ConfigurationSection;
@@ -74,7 +74,7 @@ public class FeeLevelRequirement extends Requirement {
DPlayerData data = dPlayer.getData();
data.setOldLevel(data.getOldLevel() - fee);
- MessageUtil.sendMessage(player, DMessages.REQUIREMENT_FEE.getMessage(fee + " levels"));
+ MessageUtil.sendMessage(player, DMessage.REQUIREMENT_FEE.getMessage(fee + " levels"));
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/requirement/FeeMoneyRequirement.java b/src/main/java/io/github/dre2n/dungeonsxl/requirement/FeeMoneyRequirement.java
similarity index 89%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/requirement/FeeMoneyRequirement.java
rename to src/main/java/io/github/dre2n/dungeonsxl/requirement/FeeMoneyRequirement.java
index 465ccad3..a16fb175 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/requirement/FeeMoneyRequirement.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/requirement/FeeMoneyRequirement.java
@@ -16,9 +16,9 @@
*/
package io.github.dre2n.dungeonsxl.requirement;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
@@ -76,7 +76,7 @@ public class FeeMoneyRequirement extends Requirement {
}
plugin.getEconomyProvider().withdrawPlayer(player, fee);
- MessageUtil.sendMessage(player, DMessages.REQUIREMENT_FEE.getMessage(plugin.getEconomyProvider().format(fee)));
+ MessageUtil.sendMessage(player, DMessage.REQUIREMENT_FEE.getMessage(plugin.getEconomyProvider().format(fee)));
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/requirement/GroupSizeRequirement.java b/src/main/java/io/github/dre2n/dungeonsxl/requirement/GroupSizeRequirement.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/requirement/GroupSizeRequirement.java
rename to src/main/java/io/github/dre2n/dungeonsxl/requirement/GroupSizeRequirement.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/requirement/PermissionRequirement.java b/src/main/java/io/github/dre2n/dungeonsxl/requirement/PermissionRequirement.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/requirement/PermissionRequirement.java
rename to src/main/java/io/github/dre2n/dungeonsxl/requirement/PermissionRequirement.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/requirement/Requirement.java b/src/main/java/io/github/dre2n/dungeonsxl/requirement/Requirement.java
similarity index 97%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/requirement/Requirement.java
rename to src/main/java/io/github/dre2n/dungeonsxl/requirement/Requirement.java
index 3bc71ad1..97837431 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/requirement/Requirement.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/requirement/Requirement.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.requirement;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
import io.github.dre2n.dungeonsxl.event.requirement.RequirementRegistrationEvent;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/requirement/RequirementType.java b/src/main/java/io/github/dre2n/dungeonsxl/requirement/RequirementType.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/requirement/RequirementType.java
rename to src/main/java/io/github/dre2n/dungeonsxl/requirement/RequirementType.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/requirement/RequirementTypes.java b/src/main/java/io/github/dre2n/dungeonsxl/requirement/RequirementTypeCache.java
similarity index 96%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/requirement/RequirementTypes.java
rename to src/main/java/io/github/dre2n/dungeonsxl/requirement/RequirementTypeCache.java
index 50eb49d4..d59672a8 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/requirement/RequirementTypes.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/requirement/RequirementTypeCache.java
@@ -25,11 +25,11 @@ import java.util.List;
*
* @author Daniel Saukel
*/
-public class RequirementTypes {
+public class RequirementTypeCache {
private List types = new ArrayList<>();
- public RequirementTypes() {
+ public RequirementTypeCache() {
types.addAll(Arrays.asList(RequirementTypeDefault.values()));
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/requirement/RequirementTypeDefault.java b/src/main/java/io/github/dre2n/dungeonsxl/requirement/RequirementTypeDefault.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/requirement/RequirementTypeDefault.java
rename to src/main/java/io/github/dre2n/dungeonsxl/requirement/RequirementTypeDefault.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/reward/DLootInventory.java b/src/main/java/io/github/dre2n/dungeonsxl/reward/DLootInventory.java
similarity index 89%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/reward/DLootInventory.java
rename to src/main/java/io/github/dre2n/dungeonsxl/reward/DLootInventory.java
index ac84b670..08a24320 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/reward/DLootInventory.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/reward/DLootInventory.java
@@ -17,7 +17,7 @@
package io.github.dre2n.dungeonsxl.reward;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
@@ -35,9 +35,9 @@ public class DLootInventory {
private Player player;
public DLootInventory(Player player, ItemStack[] itemStacks) {
- DungeonsXL.getDLootInventories().add(this);
+ DungeonsXL.getInstance().getDLootInventories().add(this);
- inventory = Bukkit.createInventory(player, 54, ChatColor.translateAlternateColorCodes('&', DungeonsXL.getMessageConfig().getMessage(DMessages.PLAYER_TREASURES)));
+ inventory = Bukkit.createInventory(player, 54, ChatColor.translateAlternateColorCodes('&', DungeonsXL.getInstance().getMessageConfig().getMessage(DMessage.PLAYER_TREASURES)));
for (ItemStack itemStack : itemStacks) {
if (itemStack != null) {
inventory.addItem(itemStack);
@@ -115,7 +115,7 @@ public class DLootInventory {
* the player whose DLootIntentory will be returned
*/
public static DLootInventory getByPlayer(Player player) {
- for (DLootInventory inventory : DungeonsXL.getDLootInventories()) {
+ for (DLootInventory inventory : DungeonsXL.getInstance().getDLootInventories()) {
if (inventory.player == player) {
return inventory;
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/reward/ItemReward.java b/src/main/java/io/github/dre2n/dungeonsxl/reward/ItemReward.java
similarity index 86%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/reward/ItemReward.java
rename to src/main/java/io/github/dre2n/dungeonsxl/reward/ItemReward.java
index a13ac37a..f0c4e35f 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/reward/ItemReward.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/reward/ItemReward.java
@@ -16,9 +16,9 @@
*/
package io.github.dre2n.dungeonsxl.reward;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -80,8 +80,8 @@ public class ItemReward extends Reward {
} else {
new DLootInventory(player, items.subList(0, 54).toArray(new ItemStack[54]));
- DungeonsXL.getDPlayers().getByPlayer(player).setRewardItems(new CopyOnWriteArrayList<>(items.subList(54, items.size())));
- MessageUtil.sendMessage(player, DMessages.ERROR_TOO_MANY_REWARDS.getMessage());
+ DungeonsXL.getInstance().getDPlayers().getByPlayer(player).setRewardItems(new CopyOnWriteArrayList<>(items.subList(54, items.size())));
+ MessageUtil.sendMessage(player, DMessage.ERROR_TOO_MANY_REWARDS.getMessage());
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/reward/LevelReward.java b/src/main/java/io/github/dre2n/dungeonsxl/reward/LevelReward.java
similarity index 88%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/reward/LevelReward.java
rename to src/main/java/io/github/dre2n/dungeonsxl/reward/LevelReward.java
index 398f7b58..d9731b88 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/reward/LevelReward.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/reward/LevelReward.java
@@ -16,8 +16,8 @@
*/
package io.github.dre2n.dungeonsxl.reward;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import org.bukkit.entity.Player;
/**
@@ -59,7 +59,7 @@ public class LevelReward extends Reward {
}
player.setLevel(player.getLevel() + levels);
- MessageUtil.sendMessage(player, DMessages.REWARD_GENERAL.getMessage(levels + " levels"));
+ MessageUtil.sendMessage(player, DMessage.REWARD_GENERAL.getMessage(levels + " levels"));
}
@Override
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/reward/MoneyReward.java b/src/main/java/io/github/dre2n/dungeonsxl/reward/MoneyReward.java
similarity index 87%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/reward/MoneyReward.java
rename to src/main/java/io/github/dre2n/dungeonsxl/reward/MoneyReward.java
index 7f2df2dc..5f59ecc6 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/reward/MoneyReward.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/reward/MoneyReward.java
@@ -16,8 +16,8 @@
*/
package io.github.dre2n.dungeonsxl.reward;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import org.bukkit.entity.Player;
/**
@@ -59,7 +59,7 @@ public class MoneyReward extends Reward {
}
plugin.getEconomyProvider().depositPlayer(player, money);
- MessageUtil.sendMessage(player, DMessages.REWARD_GENERAL.getMessage(plugin.getEconomyProvider().format(money)));
+ MessageUtil.sendMessage(player, DMessage.REWARD_GENERAL.getMessage(plugin.getEconomyProvider().format(money)));
}
@Override
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/reward/Reward.java b/src/main/java/io/github/dre2n/dungeonsxl/reward/Reward.java
similarity index 97%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/reward/Reward.java
rename to src/main/java/io/github/dre2n/dungeonsxl/reward/Reward.java
index a37797dc..b0f63716 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/reward/Reward.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/reward/Reward.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.reward;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.event.reward.RewardRegistrationEvent;
import java.lang.reflect.Constructor;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/reward/RewardListener.java b/src/main/java/io/github/dre2n/dungeonsxl/reward/RewardListener.java
similarity index 91%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/reward/RewardListener.java
rename to src/main/java/io/github/dre2n/dungeonsxl/reward/RewardListener.java
index 8deff8de..3775c995 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/reward/RewardListener.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/reward/RewardListener.java
@@ -46,7 +46,7 @@ public class RewardListener implements Listener {
}
Player player = (Player) event.getPlayer();
- for (DLootInventory inventory : DungeonsXL.getDLootInventories()) {
+ for (DLootInventory inventory : DungeonsXL.getInstance().getDLootInventories()) {
if (event.getView() != inventory.getInventoryView()) {
continue;
}
@@ -61,7 +61,7 @@ public class RewardListener implements Listener {
}
}
- DungeonsXL.getDLootInventories().remove(inventory);
+ DungeonsXL.getInstance().getDLootInventories().remove(inventory);
}
}
@@ -94,7 +94,7 @@ public class RewardListener implements Listener {
event.setCancelled(true);
}
- if (!DungeonsXL.getMainConfig().getOpenInventories() && !DPermissions.hasPermission(event.getPlayer(), DPermissions.INSECURE)) {
+ if (!DungeonsXL.getInstance().getMainConfig().getOpenInventories() && !DPermissions.hasPermission(event.getPlayer(), DPermissions.INSECURE)) {
World world = event.getPlayer().getWorld();
if (event.getInventory().getType() != InventoryType.CREATIVE && DEditWorld.getByWorld(world) != null) {
event.setCancelled(true);
@@ -105,7 +105,7 @@ public class RewardListener implements Listener {
@EventHandler
public void onPlayerMove(PlayerMoveEvent event) {
Player player = event.getPlayer();
- if (DungeonsXL.getDWorlds().getInstanceByWorld(player.getWorld()) != null) {
+ if (DungeonsXL.getInstance().getDWorlds().getInstanceByWorld(player.getWorld()) != null) {
return;
}
DLootInventory inventory = DLootInventory.getByPlayer(player);
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/reward/RewardType.java b/src/main/java/io/github/dre2n/dungeonsxl/reward/RewardType.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/reward/RewardType.java
rename to src/main/java/io/github/dre2n/dungeonsxl/reward/RewardType.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/reward/RewardTypes.java b/src/main/java/io/github/dre2n/dungeonsxl/reward/RewardTypeCache.java
similarity index 96%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/reward/RewardTypes.java
rename to src/main/java/io/github/dre2n/dungeonsxl/reward/RewardTypeCache.java
index 9a2fbf2f..cae1de95 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/reward/RewardTypes.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/reward/RewardTypeCache.java
@@ -27,11 +27,11 @@ import org.bukkit.Bukkit;
*
* @author Daniel Saukel
*/
-public class RewardTypes {
+public class RewardTypeCache {
private List types = new ArrayList<>();
- public RewardTypes() {
+ public RewardTypeCache() {
types.addAll(Arrays.asList(RewardTypeDefault.values()));
Bukkit.getPluginManager().registerEvents(new RewardListener(), DungeonsXL.getInstance());
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/reward/RewardTypeDefault.java b/src/main/java/io/github/dre2n/dungeonsxl/reward/RewardTypeDefault.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/reward/RewardTypeDefault.java
rename to src/main/java/io/github/dre2n/dungeonsxl/reward/RewardTypeDefault.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/BedSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/BedSign.java
similarity index 95%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/BedSign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/BedSign.java
index 65f37412..98c4417a 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/BedSign.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/BedSign.java
@@ -16,8 +16,8 @@
*/
package io.github.dre2n.dungeonsxl.sign;
-import io.github.dre2n.commons.util.BlockUtil;
-import io.github.dre2n.commons.util.NumberUtil;
+import io.github.dre2n.commons.misc.BlockUtil;
+import io.github.dre2n.commons.misc.NumberUtil;
import io.github.dre2n.dungeonsxl.world.DGameWorld;
import io.github.dre2n.dungeonsxl.world.block.TeamBed;
import org.bukkit.Material;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/BlockSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/BlockSign.java
similarity index 98%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/BlockSign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/BlockSign.java
index ed3a3964..9f9e27a4 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/BlockSign.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/BlockSign.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.sign;
-import io.github.dre2n.commons.util.NumberUtil;
+import io.github.dre2n.commons.misc.NumberUtil;
import io.github.dre2n.dungeonsxl.world.DGameWorld;
import org.bukkit.Material;
import org.bukkit.block.Sign;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/BossShopSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/BossShopSign.java
similarity index 93%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/BossShopSign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/BossShopSign.java
index 3e566bf0..72314a78 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/BossShopSign.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/BossShopSign.java
@@ -16,8 +16,8 @@
*/
package io.github.dre2n.dungeonsxl.sign;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.trigger.InteractTrigger;
import io.github.dre2n.dungeonsxl.world.DGameWorld;
import org.black_ixx.bossshop.BossShop;
@@ -108,7 +108,7 @@ public class BossShopSign extends DSign {
if (shop != null) {
bossShop.getAPI().openShop(player, shop);
} else {
- MessageUtil.sendMessage(player, DMessages.ERROR_NO_SUCH_SHOP.getMessage(shopName));
+ MessageUtil.sendMessage(player, DMessage.ERROR_NO_SUCH_SHOP.getMessage(shopName));
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/CheckpointSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/CheckpointSign.java
similarity index 90%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/CheckpointSign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/CheckpointSign.java
index 1b2c09b7..41cfec02 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/CheckpointSign.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/CheckpointSign.java
@@ -16,8 +16,8 @@
*/
package io.github.dre2n.dungeonsxl.sign;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.player.DGamePlayer;
import io.github.dre2n.dungeonsxl.world.DGameWorld;
import java.util.concurrent.CopyOnWriteArrayList;
@@ -60,7 +60,7 @@ public class CheckpointSign extends DSign {
for (DGamePlayer dplayer : DGamePlayer.getByWorld(getGameWorld().getWorld())) {
dplayer.setCheckpoint(getSign().getLocation());
- MessageUtil.sendMessage(dplayer.getPlayer(), DMessages.PLAYER_CHECKPOINT_REACHED.getMessage());
+ MessageUtil.sendMessage(dplayer.getPlayer(), DMessage.PLAYER_CHECKPOINT_REACHED.getMessage());
}
remove();
@@ -77,7 +77,7 @@ public class CheckpointSign extends DSign {
if (!done.contains(dplayer)) {
done.add(dplayer);
dplayer.setCheckpoint(getSign().getLocation());
- MessageUtil.sendMessage(player, DMessages.PLAYER_CHECKPOINT_REACHED.getMessage());
+ MessageUtil.sendMessage(player, DMessage.PLAYER_CHECKPOINT_REACHED.getMessage());
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/ChestSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/ChestSign.java
similarity index 97%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/ChestSign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/ChestSign.java
index ee9ab73c..107894a4 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/ChestSign.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/ChestSign.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.sign;
-import io.github.dre2n.commons.util.NumberUtil;
+import io.github.dre2n.commons.misc.NumberUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.loottable.DLootTable;
import io.github.dre2n.dungeonsxl.world.DGameWorld;
@@ -167,7 +167,7 @@ public class ChestSign extends DSign {
}
if (!lines[2].isEmpty()) {
- lootTable = DungeonsXL.getDLootTables().getByName(lines[2]);
+ lootTable = DungeonsXL.getInstance().getDLootTables().getByName(lines[2]);
}
if (chest == null) {
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/ChunkUpdaterSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/ChunkUpdaterSign.java
similarity index 97%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/ChunkUpdaterSign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/ChunkUpdaterSign.java
index 0547a3a9..2fe938b1 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/ChunkUpdaterSign.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/ChunkUpdaterSign.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.sign;
-import io.github.dre2n.commons.util.NumberUtil;
+import io.github.dre2n.commons.misc.NumberUtil;
import io.github.dre2n.dungeonsxl.world.DGameWorld;
import org.bukkit.Chunk;
import org.bukkit.Material;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/CommandSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/CommandSign.java
similarity index 98%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/CommandSign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/CommandSign.java
index c9d702f8..56fb47cb 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/CommandSign.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/CommandSign.java
@@ -19,7 +19,7 @@ package io.github.dre2n.dungeonsxl.sign;
import io.github.dre2n.commandsxl.CommandsXL;
import io.github.dre2n.commandsxl.command.CCommand;
import io.github.dre2n.commandsxl.command.CCommandExecutorTask;
-import io.github.dre2n.commons.util.NumberUtil;
+import io.github.dre2n.commons.misc.NumberUtil;
import io.github.dre2n.dungeonsxl.trigger.InteractTrigger;
import io.github.dre2n.dungeonsxl.world.DGameWorld;
import org.bukkit.Bukkit;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/DSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/DSign.java
similarity index 95%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/DSign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/DSign.java
index c45d9be3..892c7b14 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/DSign.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/DSign.java
@@ -16,9 +16,9 @@
*/
package io.github.dre2n.dungeonsxl.sign;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.event.dsign.DSignRegistrationEvent;
import io.github.dre2n.dungeonsxl.game.Game;
import io.github.dre2n.dungeonsxl.trigger.Trigger;
@@ -207,7 +207,7 @@ public abstract class DSign {
sign.setLine(3, ERROR_3);
sign.update();
- DMessages.LOG_ERROR_SIGN_SETUP.getMessage(sign.getX() + ", " + sign.getY() + ", " + sign.getZ());
+ DMessage.LOG_ERROR_SIGN_SETUP.getMessage(sign.getX() + ", " + sign.getY() + ", " + sign.getZ());
}
/* Statics */
@@ -218,7 +218,7 @@ public abstract class DSign {
public static DSign create(Sign sign, String[] lines, DGameWorld gameWorld) {
DSign dSign = null;
- for (DSignType type : DungeonsXL.getDSigns().getDSigns()) {
+ for (DSignType type : DungeonsXL.getInstance().getDSigns().getDSigns()) {
if (!lines[0].equalsIgnoreCase("[" + type.getName() + "]")) {
continue;
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/DSignListener.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/DSignListener.java
similarity index 90%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/DSignListener.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/DSignListener.java
index ea78366d..5dbaa9b7 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/DSignListener.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/DSignListener.java
@@ -16,8 +16,8 @@
*/
package io.github.dre2n.dungeonsxl.sign;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.player.DGamePlayer;
import io.github.dre2n.dungeonsxl.player.DPermissions;
import io.github.dre2n.dungeonsxl.trigger.InteractTrigger;
@@ -98,17 +98,17 @@ public class DSignListener implements Listener {
}
if (!DPermissions.hasPermission(player, dsign.getType().getBuildPermission())) {
- MessageUtil.sendMessage(player, DMessages.ERROR_NO_PERMISSIONS.getMessage());
+ MessageUtil.sendMessage(player, DMessage.ERROR_NO_PERMISSIONS.getMessage());
return;
}
if (dsign.check()) {
editWorld.registerSign(block);
editWorld.getSigns().add(block);
- MessageUtil.sendMessage(player, DMessages.PLAYER_SIGN_CREATED.getMessage());
+ MessageUtil.sendMessage(player, DMessage.PLAYER_SIGN_CREATED.getMessage());
} else {
- MessageUtil.sendMessage(player, DMessages.ERROR_SIGN_WRONG_FORMAT.getMessage());
+ MessageUtil.sendMessage(player, DMessage.ERROR_SIGN_WRONG_FORMAT.getMessage());
}
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/DSignType.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/DSignType.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/DSignType.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/DSignType.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/DSignTypes.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/DSignTypeCache.java
similarity index 96%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/DSignTypes.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/DSignTypeCache.java
index 351e9173..15939b69 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/DSignTypes.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/DSignTypeCache.java
@@ -27,11 +27,11 @@ import org.bukkit.Bukkit;
*
* @author Daniel Saukel
*/
-public class DSignTypes {
+public class DSignTypeCache {
private List types = new ArrayList<>();
- public DSignTypes() {
+ public DSignTypeCache() {
types.addAll(Arrays.asList(DSignTypeDefault.values()));
Bukkit.getPluginManager().registerEvents(new DSignListener(), DungeonsXL.getInstance());
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/DSignTypeDefault.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/DSignTypeDefault.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/DSignTypeDefault.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/DSignTypeDefault.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/DelayedPowerTask.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/DelayedPowerTask.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/DelayedPowerTask.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/DelayedPowerTask.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/DropSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/DropSign.java
similarity index 98%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/DropSign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/DropSign.java
index 480bfd01..979522b1 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/DropSign.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/DropSign.java
@@ -18,7 +18,7 @@ package io.github.dre2n.dungeonsxl.sign;
import io.github.dre2n.caliburn.CaliburnAPI;
import io.github.dre2n.caliburn.item.UniversalItem;
-import io.github.dre2n.commons.util.NumberUtil;
+import io.github.dre2n.commons.misc.NumberUtil;
import io.github.dre2n.dungeonsxl.world.DGameWorld;
import org.bukkit.Location;
import org.bukkit.Material;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/EndSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/EndSign.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/EndSign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/EndSign.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/FlagSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/FlagSign.java
similarity index 97%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/FlagSign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/FlagSign.java
index 7bc55b0c..e2dec1d2 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/FlagSign.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/FlagSign.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.sign;
-import io.github.dre2n.commons.util.NumberUtil;
+import io.github.dre2n.commons.misc.NumberUtil;
import io.github.dre2n.dungeonsxl.world.DGameWorld;
import io.github.dre2n.dungeonsxl.world.block.TeamFlag;
import org.bukkit.block.Sign;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/FloorSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/FloorSign.java
similarity index 94%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/FloorSign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/FloorSign.java
index 7147a56b..0bb5d548 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/FloorSign.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/FloorSign.java
@@ -62,7 +62,7 @@ public class FloorSign extends DSign {
@Override
public void onInit() {
if (!lines[1].isEmpty()) {
- floor = DungeonsXL.getDWorlds().getResourceByName(lines[1]);
+ floor = DungeonsXL.getInstance().getDWorlds().getResourceByName(lines[1]);
}
if (!getTriggers().isEmpty()) {
@@ -104,7 +104,7 @@ public class FloorSign extends DSign {
@Override
public void onTrigger() {
- for (DGamePlayer dPlayer : DungeonsXL.getDPlayers().getDGamePlayers()) {
+ for (DGamePlayer dPlayer : DungeonsXL.getInstance().getDPlayers().getDGamePlayers()) {
dPlayer.finishFloor(floor);
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/InteractSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/InteractSign.java
similarity index 98%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/InteractSign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/InteractSign.java
index 3a140d32..5565706d 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/InteractSign.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/InteractSign.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.sign;
-import io.github.dre2n.commons.util.NumberUtil;
+import io.github.dre2n.commons.misc.NumberUtil;
import io.github.dre2n.dungeonsxl.trigger.InteractTrigger;
import io.github.dre2n.dungeonsxl.world.DEditWorld;
import io.github.dre2n.dungeonsxl.world.DGameWorld;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/LeaveSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/LeaveSign.java
similarity index 96%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/LeaveSign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/LeaveSign.java
index 60fc884c..f67c9f32 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/LeaveSign.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/LeaveSign.java
@@ -81,7 +81,7 @@ public class LeaveSign extends DSign {
@Override
public void onTrigger() {
- for (DGamePlayer dPlayer : DungeonsXL.getDPlayers().getDGamePlayers()) {
+ for (DGamePlayer dPlayer : DungeonsXL.getInstance().getDPlayers().getDGamePlayers()) {
DGamePlayerEscapeEvent event = new DGamePlayerEscapeEvent(dPlayer);
Bukkit.getPluginManager().callEvent(event);
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/LivesModifierSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/LivesModifierSign.java
similarity index 86%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/LivesModifierSign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/LivesModifierSign.java
index 8f4a8f19..f641a5ea 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/LivesModifierSign.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/LivesModifierSign.java
@@ -16,10 +16,10 @@
*/
package io.github.dre2n.dungeonsxl.sign;
-import io.github.dre2n.commons.util.EnumUtil;
-import io.github.dre2n.commons.util.NumberUtil;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.misc.EnumUtil;
+import io.github.dre2n.commons.misc.NumberUtil;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.game.Game;
import io.github.dre2n.dungeonsxl.player.DGamePlayer;
import io.github.dre2n.dungeonsxl.player.DGroup;
@@ -106,10 +106,10 @@ public class LivesModifierSign extends DSign {
public void modifyLives(DGamePlayer dPlayer) {
dPlayer.setLives(dPlayer.getLives() + lives);
if (lives > 0) {
- MessageUtil.sendMessage(dPlayer.getPlayer(), DMessages.PLAYER_LIVES_ADDED.getMessage(String.valueOf(lives)));
+ MessageUtil.sendMessage(dPlayer.getPlayer(), DMessage.PLAYER_LIVES_ADDED.getMessage(String.valueOf(lives)));
} else {
- MessageUtil.sendMessage(dPlayer.getPlayer(), DMessages.PLAYER_LIVES_REMOVED.getMessage(String.valueOf(-1 * lives)));
+ MessageUtil.sendMessage(dPlayer.getPlayer(), DMessage.PLAYER_LIVES_REMOVED.getMessage(String.valueOf(-1 * lives)));
}
if (dPlayer.getLives() <= 0) {
@@ -120,10 +120,10 @@ public class LivesModifierSign extends DSign {
public void modifyLives(DGroup dGroup) {
dGroup.setLives(dGroup.getLives() + lives);
if (lives > 0) {
- dGroup.sendMessage(DMessages.GROUP_LIVES_ADDED.getMessage(String.valueOf(lives)));
+ dGroup.sendMessage(DMessage.GROUP_LIVES_ADDED.getMessage(String.valueOf(lives)));
} else {
- dGroup.sendMessage(DMessages.GROUP_LIVES_REMOVED.getMessage(String.valueOf(-1 * lives)));
+ dGroup.sendMessage(DMessage.GROUP_LIVES_REMOVED.getMessage(String.valueOf(-1 * lives)));
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/OpenDoorSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/OpenDoorSign.java
similarity index 98%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/OpenDoorSign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/OpenDoorSign.java
index d542cbd5..15cc83c8 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/OpenDoorSign.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/OpenDoorSign.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.sign;
-import io.github.dre2n.commons.util.BlockUtil;
+import io.github.dre2n.commons.misc.BlockUtil;
import io.github.dre2n.dungeonsxl.world.DGameWorld;
import io.github.dre2n.dungeonsxl.world.block.LockedDoor;
import org.bukkit.Material;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/PerPlayerSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/PerPlayerSign.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/PerPlayerSign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/PerPlayerSign.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/PlaceSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/PlaceSign.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/PlaceSign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/PlaceSign.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/ProtectionSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/ProtectionSign.java
similarity index 97%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/ProtectionSign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/ProtectionSign.java
index 29e65cda..e2c538fd 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/ProtectionSign.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/ProtectionSign.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.sign;
-import io.github.dre2n.commons.util.BlockUtil;
+import io.github.dre2n.commons.misc.BlockUtil;
import io.github.dre2n.dungeonsxl.world.DGameWorld;
import io.github.dre2n.dungeonsxl.world.block.ProtectedBlock;
import org.bukkit.Material;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/RedstoneSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/RedstoneSign.java
similarity index 99%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/RedstoneSign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/RedstoneSign.java
index 51671663..7286035f 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/RedstoneSign.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/RedstoneSign.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.sign;
-import io.github.dre2n.commons.util.NumberUtil;
+import io.github.dre2n.commons.misc.NumberUtil;
import io.github.dre2n.dungeonsxl.world.DGameWorld;
import org.bukkit.Material;
import org.bukkit.block.Block;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/ResourcePackSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/ResourcePackSign.java
similarity index 90%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/ResourcePackSign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/ResourcePackSign.java
index 80682bdc..838aca11 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/ResourcePackSign.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/ResourcePackSign.java
@@ -23,7 +23,6 @@ import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.block.Sign;
import org.bukkit.entity.Player;
-import org.inventivetalent.rpapi.ResourcePackAPI;
/**
* @author Daniel Saukel
@@ -62,7 +61,7 @@ public class ResourcePackSign extends DSign {
/* Actions */
@Override
public boolean check() {
- return DungeonsXL.getMainConfig().getResourcePacks().get(lines[1]) != null || lines[1].equalsIgnoreCase("reset");
+ return DungeonsXL.getInstance().getMainConfig().getResourcePacks().get(lines[1]) != null || lines[1].equalsIgnoreCase("reset");
}
@Override
@@ -72,7 +71,7 @@ public class ResourcePackSign extends DSign {
// Placeholder to reset to default
url = "http://google.com";
} else {
- url = DungeonsXL.getMainConfig().getResourcePacks().get(lines[1]);
+ url = DungeonsXL.getInstance().getMainConfig().getResourcePacks().get(lines[1]);
}
if (url instanceof String) {
@@ -104,7 +103,7 @@ public class ResourcePackSign extends DSign {
@Override
public boolean onPlayerTrigger(Player player) {
- ResourcePackAPI.setResourcepack(player, resourcePack);
+ player.setResourcePack(resourcePack);
return true;
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/ScriptSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/ScriptSign.java
similarity index 91%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/ScriptSign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/ScriptSign.java
index 8935d852..2ee96031 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/ScriptSign.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/ScriptSign.java
@@ -44,12 +44,12 @@ public class ScriptSign extends DSign {
@Override
public boolean check() {
- return DungeonsXL.getSignScripts().getByName(lines[1]) != null;
+ return DungeonsXL.getInstance().getSignScripts().getByName(lines[1]) != null;
}
@Override
public void onInit() {
- SignScript script = DungeonsXL.getSignScripts().getByName(name);
+ SignScript script = DungeonsXL.getInstance().getSignScripts().getByName(name);
for (String[] lines : script.getSigns()) {
DSign dSign = DSign.create(getSign(), lines, getGameWorld());
getGameWorld().getDSigns().add(dSign);
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/SignScript.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/SignScript.java
similarity index 98%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/SignScript.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/SignScript.java
index fb9dab02..3d7bfd02 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/SignScript.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/SignScript.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.sign;
-import io.github.dre2n.commons.util.NumberUtil;
+import io.github.dre2n.commons.misc.NumberUtil;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/SignScripts.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/SignScripts.java
similarity index 97%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/SignScripts.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/SignScripts.java
index c8323b35..0be98c3f 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/SignScripts.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/SignScripts.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.sign;
-import io.github.dre2n.commons.util.FileUtil;
+import io.github.dre2n.commons.misc.FileUtil;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/SignUpdateTask.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/SignUpdateTask.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/SignUpdateTask.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/SignUpdateTask.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/TeleportSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/TeleportSign.java
similarity index 98%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/TeleportSign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/TeleportSign.java
index 8bcfc8a5..9ca29229 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/TeleportSign.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/TeleportSign.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.sign;
-import io.github.dre2n.commons.util.NumberUtil;
+import io.github.dre2n.commons.misc.NumberUtil;
import io.github.dre2n.dungeonsxl.world.DGameWorld;
import org.bukkit.Location;
import org.bukkit.Material;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/TriggerSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/TriggerSign.java
similarity index 98%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/TriggerSign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/TriggerSign.java
index 9f6bd57e..08ba96a1 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/TriggerSign.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/TriggerSign.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.sign;
-import io.github.dre2n.commons.util.NumberUtil;
+import io.github.dre2n.commons.misc.NumberUtil;
import io.github.dre2n.dungeonsxl.trigger.SignTrigger;
import io.github.dre2n.dungeonsxl.world.DEditWorld;
import io.github.dre2n.dungeonsxl.world.DGameWorld;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/WaveSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/WaveSign.java
similarity index 98%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/WaveSign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/WaveSign.java
index a15ee98c..c178d33c 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/WaveSign.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/WaveSign.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.sign;
-import io.github.dre2n.commons.util.NumberUtil;
+import io.github.dre2n.commons.misc.NumberUtil;
import io.github.dre2n.dungeonsxl.trigger.InteractTrigger;
import io.github.dre2n.dungeonsxl.world.DGameWorld;
import org.bukkit.ChatColor;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/lobby/ClassesSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/lobby/ClassesSign.java
similarity index 93%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/lobby/ClassesSign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/lobby/ClassesSign.java
index 7b7b3585..7e856f92 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/lobby/ClassesSign.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/lobby/ClassesSign.java
@@ -36,7 +36,7 @@ public class ClassesSign extends DSign {
public ClassesSign(Sign sign, String[] lines, DGameWorld gameWorld) {
super(sign, lines, gameWorld);
- dClass = DungeonsXL.getDClasses().getByName(sign.getLine(1));
+ dClass = DungeonsXL.getInstance().getDClasses().getByName(sign.getLine(1));
}
/* Getters and setters */
@@ -58,7 +58,7 @@ public class ClassesSign extends DSign {
/* Actions */
@Override
public boolean check() {
- return DungeonsXL.getDClasses().getByName(lines[1]) != null;
+ return DungeonsXL.getInstance().getDClasses().getByName(lines[1]) != null;
}
@Override
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/lobby/LobbySign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/lobby/LobbySign.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/lobby/LobbySign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/lobby/LobbySign.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/lobby/ReadySign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/lobby/ReadySign.java
similarity index 92%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/lobby/ReadySign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/lobby/ReadySign.java
index d9044e0d..a14fbf30 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/lobby/ReadySign.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/lobby/ReadySign.java
@@ -16,10 +16,10 @@
*/
package io.github.dre2n.dungeonsxl.sign.lobby;
-import io.github.dre2n.commons.util.NumberUtil;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.misc.NumberUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.game.GameType;
import io.github.dre2n.dungeonsxl.game.GameTypeDefault;
import io.github.dre2n.dungeonsxl.player.DGamePlayer;
@@ -88,8 +88,8 @@ public class ReadySign extends DSign {
@Override
public void onInit() {
- if (DungeonsXL.getGameTypes().getBySign(this) != null) {
- gameType = DungeonsXL.getGameTypes().getBySign(this);
+ if (DungeonsXL.getInstance().getGameTypes().getBySign(this) != null) {
+ gameType = DungeonsXL.getInstance().getGameTypes().getBySign(this);
} else {
gameType = GameTypeDefault.CUSTOM;
@@ -168,7 +168,7 @@ public class ReadySign extends DSign {
}
if (dPlayer.isReady()) {
- MessageUtil.sendMessage(dPlayer.getPlayer(), DungeonsXL.getMessageConfig().getMessage(dPlayer.isReady() ? DMessages.PLAYER_READY : DMessages.ERROR_READY));
+ MessageUtil.sendMessage(dPlayer.getPlayer(), DungeonsXL.getInstance().getMessageConfig().getMessage(dPlayer.isReady() ? DMessage.PLAYER_READY : DMessage.ERROR_READY));
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/lobby/StartSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/lobby/StartSign.java
similarity index 97%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/lobby/StartSign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/lobby/StartSign.java
index 4d27765b..3d3bb038 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/lobby/StartSign.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/lobby/StartSign.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.sign.lobby;
-import io.github.dre2n.commons.util.NumberUtil;
+import io.github.dre2n.commons.misc.NumberUtil;
import io.github.dre2n.dungeonsxl.sign.DSign;
import io.github.dre2n.dungeonsxl.sign.DSignType;
import io.github.dre2n.dungeonsxl.sign.DSignTypeDefault;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/message/ActionBarSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/message/ActionBarSign.java
similarity index 97%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/message/ActionBarSign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/message/ActionBarSign.java
index 3bf79577..aad45444 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/message/ActionBarSign.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/message/ActionBarSign.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.sign.message;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
import io.github.dre2n.dungeonsxl.sign.DSignType;
import io.github.dre2n.dungeonsxl.sign.DSignTypeDefault;
import io.github.dre2n.dungeonsxl.sign.PerPlayerSign;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/message/HologramSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/message/HologramSign.java
similarity index 97%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/message/HologramSign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/message/HologramSign.java
index 1e057077..93e59f20 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/message/HologramSign.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/message/HologramSign.java
@@ -22,8 +22,8 @@ import io.github.dre2n.caliburn.CaliburnAPI;
import io.github.dre2n.caliburn.item.UniversalItem;
import io.github.dre2n.commons.compatibility.CompatibilityHandler;
import io.github.dre2n.commons.compatibility.Version;
-import io.github.dre2n.commons.util.EnumUtil;
-import io.github.dre2n.commons.util.NumberUtil;
+import io.github.dre2n.commons.misc.EnumUtil;
+import io.github.dre2n.commons.misc.NumberUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.sign.DSign;
import io.github.dre2n.dungeonsxl.sign.DSignType;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/message/MessageSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/message/MessageSign.java
similarity index 96%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/message/MessageSign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/message/MessageSign.java
index a43ba1be..40318a02 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/message/MessageSign.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/message/MessageSign.java
@@ -16,8 +16,8 @@
*/
package io.github.dre2n.dungeonsxl.sign.message;
-import io.github.dre2n.commons.util.NumberUtil;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.misc.NumberUtil;
import io.github.dre2n.dungeonsxl.sign.DSign;
import io.github.dre2n.dungeonsxl.sign.DSignType;
import io.github.dre2n.dungeonsxl.sign.DSignTypeDefault;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/message/SoundMessageSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/message/SoundMessageSign.java
similarity index 98%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/message/SoundMessageSign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/message/SoundMessageSign.java
index d9178c34..94fcaf57 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/message/SoundMessageSign.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/message/SoundMessageSign.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.sign.message;
-import io.github.dre2n.commons.util.NumberUtil;
+import io.github.dre2n.commons.misc.NumberUtil;
import io.github.dre2n.dungeonsxl.sign.DSign;
import io.github.dre2n.dungeonsxl.sign.DSignType;
import io.github.dre2n.dungeonsxl.sign.DSignTypeDefault;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/message/TitleSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/message/TitleSign.java
similarity index 97%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/message/TitleSign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/message/TitleSign.java
index 5bc8f4bf..f07dfe05 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/message/TitleSign.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/message/TitleSign.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.sign.message;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
import io.github.dre2n.dungeonsxl.sign.DSignType;
import io.github.dre2n.dungeonsxl.sign.DSignTypeDefault;
import io.github.dre2n.dungeonsxl.sign.PerPlayerSign;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/mob/DMobSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/mob/DMobSign.java
similarity index 99%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/mob/DMobSign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/mob/DMobSign.java
index 4c8f4b01..0290d78f 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/mob/DMobSign.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/mob/DMobSign.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.sign.mob;
-import io.github.dre2n.commons.util.NumberUtil;
+import io.github.dre2n.commons.misc.NumberUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.sign.DSign;
import io.github.dre2n.dungeonsxl.sign.DSignType;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/mob/ExternalMobSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/mob/ExternalMobSign.java
similarity index 97%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/mob/ExternalMobSign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/mob/ExternalMobSign.java
index c93e72a2..b01bcce2 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/mob/ExternalMobSign.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/mob/ExternalMobSign.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.sign.mob;
-import io.github.dre2n.commons.util.NumberUtil;
+import io.github.dre2n.commons.misc.NumberUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.mob.ExternalMobPlugin;
import io.github.dre2n.dungeonsxl.mob.ExternalMobProvider;
@@ -228,7 +228,7 @@ public class ExternalMobSign extends DSign implements MobSign {
initialAmount = amount;
if (attributes.length == 3) {
- provider = DungeonsXL.getExternalMobProviders().getByIdentifier(attributes[2]);
+ provider = DungeonsXL.getInstance().getExternalMobProviders().getByIdentifier(attributes[2]);
} else {
provider = ExternalMobPlugin.MYTHIC_MOBS;
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/mob/ExternalMobSpawnTask.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/mob/ExternalMobSpawnTask.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/mob/ExternalMobSpawnTask.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/mob/ExternalMobSpawnTask.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/mob/MobSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/mob/MobSign.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/mob/MobSign.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/mob/MobSign.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/mob/MobSpawnTask.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/mob/MobSpawnTask.java
similarity index 97%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/sign/mob/MobSpawnTask.java
rename to src/main/java/io/github/dre2n/dungeonsxl/sign/mob/MobSpawnTask.java
index af678899..0d6d2a23 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/mob/MobSpawnTask.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/mob/MobSpawnTask.java
@@ -71,7 +71,7 @@ public class MobSpawnTask extends BukkitRunnable {
}
// Check custom mobs
- DMobType mobType = DungeonsXL.getDMobTypes().getByName(sign.getMob());
+ DMobType mobType = DungeonsXL.getInstance().getDMobTypes().getByName(sign.getMob());
if (mobType != null) {
mobType.spawn(gameWorld, spawnLoc);
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/trigger/DistanceTrigger.java b/src/main/java/io/github/dre2n/dungeonsxl/trigger/DistanceTrigger.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/trigger/DistanceTrigger.java
rename to src/main/java/io/github/dre2n/dungeonsxl/trigger/DistanceTrigger.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/trigger/FortuneTrigger.java b/src/main/java/io/github/dre2n/dungeonsxl/trigger/FortuneTrigger.java
similarity index 97%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/trigger/FortuneTrigger.java
rename to src/main/java/io/github/dre2n/dungeonsxl/trigger/FortuneTrigger.java
index 35538b27..1dca91c7 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/trigger/FortuneTrigger.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/trigger/FortuneTrigger.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.trigger;
-import io.github.dre2n.commons.util.NumberUtil;
+import io.github.dre2n.commons.misc.NumberUtil;
import io.github.dre2n.dungeonsxl.event.trigger.TriggerActionEvent;
import io.github.dre2n.dungeonsxl.world.DGameWorld;
import org.bukkit.Bukkit;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/trigger/InteractTrigger.java b/src/main/java/io/github/dre2n/dungeonsxl/trigger/InteractTrigger.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/trigger/InteractTrigger.java
rename to src/main/java/io/github/dre2n/dungeonsxl/trigger/InteractTrigger.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/trigger/MobTrigger.java b/src/main/java/io/github/dre2n/dungeonsxl/trigger/MobTrigger.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/trigger/MobTrigger.java
rename to src/main/java/io/github/dre2n/dungeonsxl/trigger/MobTrigger.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/trigger/ProgressTrigger.java b/src/main/java/io/github/dre2n/dungeonsxl/trigger/ProgressTrigger.java
similarity index 97%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/trigger/ProgressTrigger.java
rename to src/main/java/io/github/dre2n/dungeonsxl/trigger/ProgressTrigger.java
index d1efc518..79f65439 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/trigger/ProgressTrigger.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/trigger/ProgressTrigger.java
@@ -117,7 +117,7 @@ public class ProgressTrigger extends Trigger {
}
public static ProgressTrigger getOrCreate(String floor, DGameWorld gameWorld) {
- DResourceWorld resource = DungeonsXL.getDWorlds().getResourceByName(floor);
+ DResourceWorld resource = DungeonsXL.getInstance().getDWorlds().getResourceByName(floor);
if (resource != null) {
return new ProgressTrigger(resource);
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/trigger/RedstoneTrigger.java b/src/main/java/io/github/dre2n/dungeonsxl/trigger/RedstoneTrigger.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/trigger/RedstoneTrigger.java
rename to src/main/java/io/github/dre2n/dungeonsxl/trigger/RedstoneTrigger.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/trigger/SignTrigger.java b/src/main/java/io/github/dre2n/dungeonsxl/trigger/SignTrigger.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/trigger/SignTrigger.java
rename to src/main/java/io/github/dre2n/dungeonsxl/trigger/SignTrigger.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/trigger/Trigger.java b/src/main/java/io/github/dre2n/dungeonsxl/trigger/Trigger.java
similarity index 97%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/trigger/Trigger.java
rename to src/main/java/io/github/dre2n/dungeonsxl/trigger/Trigger.java
index 55751b8b..8247103c 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/trigger/Trigger.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/trigger/Trigger.java
@@ -16,8 +16,8 @@
*/
package io.github.dre2n.dungeonsxl.trigger;
-import io.github.dre2n.commons.util.NumberUtil;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.commons.misc.NumberUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.event.trigger.TriggerRegistrationEvent;
import io.github.dre2n.dungeonsxl.sign.DSign;
@@ -123,7 +123,7 @@ public abstract class Trigger {
}
public static Trigger getOrCreate(String identifier, String value, DSign dSign) {
- TriggerType type = DungeonsXL.getTriggers().getByIdentifier(identifier);
+ TriggerType type = DungeonsXL.getInstance().getTriggers().getByIdentifier(identifier);
Trigger trigger = null;
if (type == TriggerTypeDefault.REDSTONE) {
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/trigger/TriggerListener.java b/src/main/java/io/github/dre2n/dungeonsxl/trigger/TriggerListener.java
similarity index 93%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/trigger/TriggerListener.java
rename to src/main/java/io/github/dre2n/dungeonsxl/trigger/TriggerListener.java
index 1f69cddc..f9f7bb7d 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/trigger/TriggerListener.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/trigger/TriggerListener.java
@@ -33,7 +33,7 @@ public class TriggerListener implements Listener {
new BukkitRunnable() {
@Override
public void run() {
- for (DGameWorld gameWorld : DungeonsXL.getDWorlds().getGameWorlds()) {
+ for (DGameWorld gameWorld : DungeonsXL.getInstance().getDWorlds().getGameWorlds()) {
if (event.getBlock().getWorld() == gameWorld.getWorld()) {
RedstoneTrigger.updateAll(gameWorld);
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/trigger/TriggerType.java b/src/main/java/io/github/dre2n/dungeonsxl/trigger/TriggerType.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/trigger/TriggerType.java
rename to src/main/java/io/github/dre2n/dungeonsxl/trigger/TriggerType.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/trigger/TriggerTypes.java b/src/main/java/io/github/dre2n/dungeonsxl/trigger/TriggerTypeCache.java
similarity index 96%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/trigger/TriggerTypes.java
rename to src/main/java/io/github/dre2n/dungeonsxl/trigger/TriggerTypeCache.java
index fdb41da7..0b9434d1 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/trigger/TriggerTypes.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/trigger/TriggerTypeCache.java
@@ -27,11 +27,11 @@ import org.bukkit.Bukkit;
*
* @author Daniel Saukel
*/
-public class TriggerTypes {
+public class TriggerTypeCache {
private List types = new ArrayList<>();
- public TriggerTypes() {
+ public TriggerTypeCache() {
types.addAll(Arrays.asList(TriggerTypeDefault.values()));
Bukkit.getPluginManager().registerEvents(new TriggerListener(), DungeonsXL.getInstance());
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/trigger/TriggerTypeDefault.java b/src/main/java/io/github/dre2n/dungeonsxl/trigger/TriggerTypeDefault.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/trigger/TriggerTypeDefault.java
rename to src/main/java/io/github/dre2n/dungeonsxl/trigger/TriggerTypeDefault.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/trigger/UseItemTrigger.java b/src/main/java/io/github/dre2n/dungeonsxl/trigger/UseItemTrigger.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/trigger/UseItemTrigger.java
rename to src/main/java/io/github/dre2n/dungeonsxl/trigger/UseItemTrigger.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/trigger/WaveTrigger.java b/src/main/java/io/github/dre2n/dungeonsxl/trigger/WaveTrigger.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/trigger/WaveTrigger.java
rename to src/main/java/io/github/dre2n/dungeonsxl/trigger/WaveTrigger.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/util/DColor.java b/src/main/java/io/github/dre2n/dungeonsxl/util/DColor.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/util/DColor.java
rename to src/main/java/io/github/dre2n/dungeonsxl/util/DColor.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/util/DeserializationUtil.java b/src/main/java/io/github/dre2n/dungeonsxl/util/DeserializationUtil.java
similarity index 98%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/util/DeserializationUtil.java
rename to src/main/java/io/github/dre2n/dungeonsxl/util/DeserializationUtil.java
index f950918a..9904d25f 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/util/DeserializationUtil.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/util/DeserializationUtil.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.util;
-import io.github.dre2n.commons.util.NumberUtil;
+import io.github.dre2n.commons.misc.NumberUtil;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.enchantments.Enchantment;
diff --git a/src/main/java/io/github/dre2n/dungeonsxl/util/GUIUtil.java b/src/main/java/io/github/dre2n/dungeonsxl/util/GUIUtil.java
new file mode 100644
index 00000000..1a5513da
--- /dev/null
+++ b/src/main/java/io/github/dre2n/dungeonsxl/util/GUIUtil.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright (C) 2012-2017 Frank Baumann
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package io.github.dre2n.dungeonsxl.util;
+
+import io.github.dre2n.commons.javaplugin.DREPlugin;
+import java.util.Arrays;
+import java.util.List;
+import org.bukkit.ChatColor;
+import org.bukkit.inventory.Inventory;
+import org.bukkit.inventory.ItemStack;
+
+@Deprecated
+public enum GUIUtil {
+
+ X1(4),
+ X2(3, 5),
+ X3(2, 4, 6),
+ X4(1, 3, 5, 7),
+ X5(0, 2, 4, 6, 8),
+ X6(1, 2, 3, 5, 6, 7),
+ X7(1, 2, 3, 4, 5, 6, 7),
+ X8(0, 1, 2, 3, 5, 6, 7, 8),
+ X9(0, 1, 2, 3, 4, 5, 6, 7, 8);
+
+ private int[] slot;
+
+ private GUIUtil(int... slot) {
+ this.slot = slot;
+ }
+
+ /**
+ * @param count
+ * the amount of buttons
+ */
+ public static GUIUtil getRowShapeByButtonCount(int count) {
+ if (count >= 1 && count <= 9) {
+ for (GUIUtil shape : values()) {
+ if (shape.slot.length == count) {
+ return shape;
+ }
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * @param buttons
+ * the buttons to use for the GUI
+ * @return
+ * an Inventory that can easily be shown to a Player
+ */
+ public static Inventory createGUI(DREPlugin plugin, String title, ItemStack... buttons) {
+ return createGUI(plugin, title, Arrays.asList(buttons));
+ }
+
+ /**
+ * @param plugin
+ * the plugin instance
+ * @param title
+ * the GUI title, may contain color codes
+ * @param buttons
+ * the buttons to use for the GUI
+ * @param close
+ * if the GUI may get closed by the viewer
+ * @return
+ * an Inventory that can easily be shown to a Player
+ */
+ public static Inventory createGUI(DREPlugin plugin, String title, List buttons) {
+ int rows = (int) Math.ceil(((double) buttons.size()) / 9);
+ Inventory gui = plugin.getServer().createInventory(null, rows * 9, ChatColor.translateAlternateColorCodes('&', title));
+
+ int slot = 0;
+ int row = 0;
+ int i = 0;
+ GUIUtil shape = null;
+
+ for (ItemStack button : buttons) {
+ if (row + 1 == rows) {
+ if (shape == null) {
+ shape = getRowShapeByButtonCount(buttons.size() - i);
+ }
+
+ gui.setItem(shape.slot[slot] + row * 9, button);
+ slot++;
+
+ } else {
+ gui.setItem(X9.slot[slot] + row * 9, button);
+
+ slot++;
+ if (slot == 9) {
+ slot = 0;
+ row++;
+ }
+ }
+ i++;
+ }
+
+ plugin.addGUI(gui);
+ return gui;
+ }
+
+}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/util/NoReload.java b/src/main/java/io/github/dre2n/dungeonsxl/util/NoReload.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/util/NoReload.java
rename to src/main/java/io/github/dre2n/dungeonsxl/util/NoReload.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/util/ParsingUtil.java b/src/main/java/io/github/dre2n/dungeonsxl/util/ParsingUtil.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/util/ParsingUtil.java
rename to src/main/java/io/github/dre2n/dungeonsxl/util/ParsingUtil.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/util/ProgressBar.java b/src/main/java/io/github/dre2n/dungeonsxl/util/ProgressBar.java
similarity index 98%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/util/ProgressBar.java
rename to src/main/java/io/github/dre2n/dungeonsxl/util/ProgressBar.java
index 5274951a..f9046ea4 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/util/ProgressBar.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/util/ProgressBar.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.util;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import java.util.HashSet;
import java.util.Set;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/world/BackupResourceTask.java b/src/main/java/io/github/dre2n/dungeonsxl/world/BackupResourceTask.java
similarity index 96%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/world/BackupResourceTask.java
rename to src/main/java/io/github/dre2n/dungeonsxl/world/BackupResourceTask.java
index 3b4085e5..1f32da3f 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/world/BackupResourceTask.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/world/BackupResourceTask.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.world;
-import io.github.dre2n.commons.util.FileUtil;
+import io.github.dre2n.commons.misc.FileUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import java.io.File;
import org.bukkit.scheduler.BukkitRunnable;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/world/DEditWorld.java b/src/main/java/io/github/dre2n/dungeonsxl/world/DEditWorld.java
similarity index 94%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/world/DEditWorld.java
rename to src/main/java/io/github/dre2n/dungeonsxl/world/DEditWorld.java
index 5a043c12..643dc113 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/world/DEditWorld.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/world/DEditWorld.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.world;
-import io.github.dre2n.commons.util.FileUtil;
+import io.github.dre2n.commons.misc.FileUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.event.editworld.EditWorldSaveEvent;
import io.github.dre2n.dungeonsxl.event.editworld.EditWorldUnloadEvent;
@@ -39,7 +39,7 @@ import org.bukkit.scheduler.BukkitRunnable;
*/
public class DEditWorld extends DInstanceWorld {
- DWorlds worlds = DungeonsXL.getDWorlds();
+ DWorldCache worlds = DungeonsXL.getInstance().getDWorlds();
public static String ID_FILE_PREFIX = ".id_";
@@ -121,7 +121,7 @@ public class DEditWorld extends DInstanceWorld {
getWorld().save();
- if (!DungeonsXL.getMainConfig().areTweaksEnabled()) {
+ if (!DungeonsXL.getInstance().getMainConfig().areTweaksEnabled()) {
FileUtil.copyDirectory(getFolder(), getResource().getFolder(), DungeonsXL.EXCLUDED_FILES);
FileUtil.deleteUnusedFiles(getResource().getFolder());
@@ -162,7 +162,7 @@ public class DEditWorld extends DInstanceWorld {
dPlayer.leave();
}
- if (!DungeonsXL.getMainConfig().areTweaksEnabled()) {
+ if (!DungeonsXL.getInstance().getMainConfig().areTweaksEnabled()) {
if (save) {
Bukkit.unloadWorld(getWorld(), true);
}
@@ -212,7 +212,7 @@ public class DEditWorld extends DInstanceWorld {
* the DEditWorld that represents the world
*/
public static DEditWorld getByName(String name) {
- DInstanceWorld instance = DungeonsXL.getDWorlds().getInstanceByName(name);
+ DInstanceWorld instance = DungeonsXL.getInstance().getDWorlds().getInstanceByName(name);
if (instance instanceof DEditWorld) {
return (DEditWorld) instance;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/world/DGameWorld.java b/src/main/java/io/github/dre2n/dungeonsxl/world/DGameWorld.java
similarity index 97%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/world/DGameWorld.java
rename to src/main/java/io/github/dre2n/dungeonsxl/world/DGameWorld.java
index 99e4fb5c..a76ea1e0 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/world/DGameWorld.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/world/DGameWorld.java
@@ -16,13 +16,13 @@
*/
package io.github.dre2n.dungeonsxl.world;
-import io.github.dre2n.commons.util.FileUtil;
+import io.github.dre2n.commons.misc.FileUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.dungeon.Dungeon;
import io.github.dre2n.dungeonsxl.event.gameworld.GameWorldStartGameEvent;
import io.github.dre2n.dungeonsxl.event.gameworld.GameWorldUnloadEvent;
import io.github.dre2n.dungeonsxl.game.Game;
-import io.github.dre2n.dungeonsxl.game.GameRules;
+import io.github.dre2n.dungeonsxl.game.GameRuleProvider;
import io.github.dre2n.dungeonsxl.mob.DMob;
import io.github.dre2n.dungeonsxl.player.DGroup;
import io.github.dre2n.dungeonsxl.sign.DSign;
@@ -119,7 +119,7 @@ public class DGameWorld extends DInstanceWorld {
*/
public Game getGame() {
if (game == null) {
- for (Game game : DungeonsXL.getGames()) {
+ for (Game game : DungeonsXL.getInstance().getGames()) {
if (game.getWorld() == this) {
this.game = game;
}
@@ -434,7 +434,7 @@ public class DGameWorld extends DInstanceWorld {
* @return the Dungeon that contains the DGameWorld
*/
public Dungeon getDungeon() {
- for (Dungeon dungeon : DungeonsXL.getDungeons().getDungeons()) {
+ for (Dungeon dungeon : DungeonsXL.getInstance().getDungeons().getDungeons()) {
if (dungeon.getConfig().containsFloor(getResource())) {
return dungeon;
}
@@ -493,7 +493,7 @@ public class DGameWorld extends DInstanceWorld {
return;
}
- if (!DungeonsXL.getMainConfig().areTweaksEnabled()) {
+ if (!DungeonsXL.getInstance().getMainConfig().areTweaksEnabled()) {
Bukkit.unloadWorld(getWorld(), false);
FileUtil.removeDirectory(getFolder());
worlds.removeInstance(this);
@@ -574,7 +574,7 @@ public class DGameWorld extends DInstanceWorld {
return true;
}
- GameRules rules = game.getRules();
+ GameRuleProvider rules = game.getRules();
if (!rules.canBreakBlocks() && !rules.canBreakPlacedBlocks()) {
return true;
}
@@ -617,7 +617,7 @@ public class DGameWorld extends DInstanceWorld {
return true;
}
- GameRules rules = game.getRules();
+ GameRuleProvider rules = game.getRules();
if (!rules.canPlaceBlocks() && !PlaceableBlock.canBuildHere(block, block.getFace(against), hand.getType(), this)) {
// Workaround for a bug that would allow 3-Block-high jumping
Location loc = player.getLocation();
@@ -652,7 +652,7 @@ public class DGameWorld extends DInstanceWorld {
* the EditWorld that represents the world
*/
public static DGameWorld getByWorld(World world) {
- DInstanceWorld instance = DungeonsXL.getDWorlds().getInstanceByName(world.getName());
+ DInstanceWorld instance = DungeonsXL.getInstance().getDWorlds().getInstanceByName(world.getName());
if (instance instanceof DGameWorld) {
return (DGameWorld) instance;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/world/DInstanceWorld.java b/src/main/java/io/github/dre2n/dungeonsxl/world/DInstanceWorld.java
similarity index 96%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/world/DInstanceWorld.java
rename to src/main/java/io/github/dre2n/dungeonsxl/world/DInstanceWorld.java
index d638945e..d2ab1f99 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/world/DInstanceWorld.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/world/DInstanceWorld.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.world;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.player.DGamePlayer;
import java.io.File;
@@ -31,7 +31,7 @@ import org.bukkit.World;
public abstract class DInstanceWorld {
DungeonsXL plugin = DungeonsXL.getInstance();
- DWorlds worlds = DungeonsXL.getDWorlds();
+ DWorldCache worlds = DungeonsXL.getInstance().getDWorlds();
private DResourceWorld resourceWorld;
private File folder;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/world/DResourceWorld.java b/src/main/java/io/github/dre2n/dungeonsxl/world/DResourceWorld.java
similarity index 94%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/world/DResourceWorld.java
rename to src/main/java/io/github/dre2n/dungeonsxl/world/DResourceWorld.java
index be669d53..1efc4b80 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/world/DResourceWorld.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/world/DResourceWorld.java
@@ -16,11 +16,11 @@
*/
package io.github.dre2n.dungeonsxl.world;
-import io.github.dre2n.commons.util.FileUtil;
+import io.github.dre2n.commons.misc.FileUtil;
+import io.github.dre2n.commons.worldloader.WorldLoader;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.event.editworld.EditWorldGenerateEvent;
import io.github.dre2n.dungeonsxl.player.DEditPlayer;
-import io.github.dre2n.dungeonsxl.util.worldloader.WorldLoader;
import java.io.File;
import java.io.IOException;
import org.bukkit.Bukkit;
@@ -37,13 +37,13 @@ import org.bukkit.scheduler.BukkitRunnable;
public class DResourceWorld {
DungeonsXL plugin = DungeonsXL.getInstance();
- DWorlds worlds;
+ DWorldCache worlds;
private File folder;
private WorldConfig config;
private SignData signData;
- public DResourceWorld(DWorlds worlds, String name) {
+ public DResourceWorld(DWorldCache worlds, String name) {
this.worlds = worlds;
folder = new File(DungeonsXL.MAPS, name);
@@ -60,7 +60,7 @@ public class DResourceWorld {
signData = new SignData(signDataFile);
}
- public DResourceWorld(DWorlds worlds, File folder) {
+ public DResourceWorld(DWorldCache worlds, File folder) {
this.worlds = worlds;
this.folder = folder;
@@ -213,7 +213,7 @@ public class DResourceWorld {
final DInstanceWorld instance = game ? new DGameWorld(this, instanceFolder, id) : new DEditWorld(this, instanceFolder, id);
- if (!DungeonsXL.getMainConfig().areTweaksEnabled()) {
+ if (!DungeonsXL.getInstance().getMainConfig().areTweaksEnabled()) {
FileUtil.copyDirectory(folder, instanceFolder, DungeonsXL.EXCLUDED_FILES);
instance.world = Bukkit.createWorld(WorldCreator.name(name));
@@ -288,14 +288,14 @@ public class DResourceWorld {
return null;
}
- if (!DungeonsXL.getMainConfig().areTweaksEnabled()) {
+ if (!DungeonsXL.getInstance().getMainConfig().areTweaksEnabled()) {
editWorld.world = creator.createWorld();
} else {
new BukkitRunnable() {
@Override
public void run() {
- FileUtil.copyDirectory(DWorlds.RAW, folder, DungeonsXL.EXCLUDED_FILES);
+ FileUtil.copyDirectory(DWorldCache.RAW, folder, DungeonsXL.EXCLUDED_FILES);
editWorld.generateIdFile();
editWorld.world = WorldLoader.createWorld(creator);
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/world/DWorlds.java b/src/main/java/io/github/dre2n/dungeonsxl/world/DWorldCache.java
similarity index 97%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/world/DWorlds.java
rename to src/main/java/io/github/dre2n/dungeonsxl/world/DWorldCache.java
index faee8c18..7f823ae8 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/world/DWorlds.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/world/DWorldCache.java
@@ -16,8 +16,8 @@
*/
package io.github.dre2n.dungeonsxl.world;
-import io.github.dre2n.commons.util.FileUtil;
-import io.github.dre2n.commons.util.NumberUtil;
+import io.github.dre2n.commons.misc.FileUtil;
+import io.github.dre2n.commons.misc.NumberUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.config.MainConfig;
import io.github.dre2n.dungeonsxl.config.MainConfig.BackupMode;
@@ -35,10 +35,10 @@ import org.bukkit.scheduler.BukkitTask;
*
* @author Daniel Saukel
*/
-public class DWorlds {
+public class DWorldCache {
DungeonsXL plugin = DungeonsXL.getInstance();
- MainConfig mainConfig = DungeonsXL.getMainConfig();
+ MainConfig mainConfig = DungeonsXL.getInstance().getMainConfig();
public static final File RAW = new File(DungeonsXL.MAPS, ".raw");
@@ -47,7 +47,7 @@ public class DWorlds {
private Set resources = new HashSet<>();
private Set instances = new HashSet<>();
- public DWorlds(File folder) {
+ public DWorldCache(File folder) {
for (File file : folder.listFiles()) {
if (file.isDirectory() && !file.getName().equals(".raw")) {
resources.add(new DResourceWorld(this, file));
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/world/DWorldListener.java b/src/main/java/io/github/dre2n/dungeonsxl/world/DWorldListener.java
similarity index 98%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/world/DWorldListener.java
rename to src/main/java/io/github/dre2n/dungeonsxl/world/DWorldListener.java
index 48144f3a..6b2ca65b 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/world/DWorldListener.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/world/DWorldListener.java
@@ -36,9 +36,9 @@ import org.bukkit.event.world.ChunkUnloadEvent;
*/
public class DWorldListener implements Listener {
- DWorlds dWorlds;
+ DWorldCache dWorlds;
- public DWorldListener(DWorlds dWorlds) {
+ public DWorldListener(DWorldCache dWorlds) {
this.dWorlds = dWorlds;
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/world/SignData.java b/src/main/java/io/github/dre2n/dungeonsxl/world/SignData.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/world/SignData.java
rename to src/main/java/io/github/dre2n/dungeonsxl/world/SignData.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/world/WorldConfig.java b/src/main/java/io/github/dre2n/dungeonsxl/world/WorldConfig.java
similarity index 97%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/world/WorldConfig.java
rename to src/main/java/io/github/dre2n/dungeonsxl/world/WorldConfig.java
index ff4839b9..bfe05b82 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/world/WorldConfig.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/world/WorldConfig.java
@@ -20,10 +20,10 @@ import io.github.dre2n.caliburn.CaliburnAPI;
import io.github.dre2n.caliburn.item.UniversalItemStack;
import io.github.dre2n.commons.compatibility.CompatibilityHandler;
import io.github.dre2n.commons.compatibility.Version;
-import io.github.dre2n.commons.util.EnumUtil;
-import io.github.dre2n.commons.util.NumberUtil;
+import io.github.dre2n.commons.misc.EnumUtil;
+import io.github.dre2n.commons.misc.NumberUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.game.GameRules;
+import io.github.dre2n.dungeonsxl.game.GameRuleProvider;
import io.github.dre2n.dungeonsxl.game.GameType;
import io.github.dre2n.dungeonsxl.requirement.Requirement;
import io.github.dre2n.dungeonsxl.util.DeserializationUtil;
@@ -50,7 +50,7 @@ import org.bukkit.inventory.ItemStack;
*
* @author Frank Baumann, Milan Albrecht, Daniel Saukel
*/
-public class WorldConfig extends GameRules {
+public class WorldConfig extends GameRuleProvider {
CompatibilityHandler compat = CompatibilityHandler.getInstance();
@@ -231,7 +231,7 @@ public class WorldConfig extends GameRules {
ConfigurationSection requirementSection = configFile.getConfigurationSection("requirements");
for (String identifier : configFile.getConfigurationSection("requirements").getKeys(false)) {
- Requirement requirement = Requirement.create(DungeonsXL.getRequirementTypes().getByIdentifier(identifier));
+ Requirement requirement = Requirement.create(DungeonsXL.getInstance().getRequirementTypes().getByIdentifier(identifier));
requirement.setup(requirementSection);
requirements.add(requirement);
}
@@ -262,7 +262,7 @@ public class WorldConfig extends GameRules {
}
if (configFile.contains("forcedGameType")) {
- forcedGameType = DungeonsXL.getGameTypes().getByName(configFile.getString("forcedGameType"));
+ forcedGameType = DungeonsXL.getInstance().getGameTypes().getByName(configFile.getString("forcedGameType"));
}
if (configFile.contains("title.title")) {
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/world/WorldUnloadTask.java b/src/main/java/io/github/dre2n/dungeonsxl/world/WorldUnloadTask.java
similarity index 89%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/world/WorldUnloadTask.java
rename to src/main/java/io/github/dre2n/dungeonsxl/world/WorldUnloadTask.java
index 690f5c73..7df20ce9 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/world/WorldUnloadTask.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/world/WorldUnloadTask.java
@@ -27,7 +27,7 @@ public class WorldUnloadTask extends BukkitRunnable {
@Override
public void run() {
- for (DGameWorld gameWorld : DungeonsXL.getDWorlds().getGameWorlds()) {
+ for (DGameWorld gameWorld : DungeonsXL.getInstance().getDWorlds().getGameWorlds()) {
if (gameWorld.exists()) {
if (gameWorld.getWorld().getPlayers().isEmpty()) {
if (DGamePlayer.getByWorld(gameWorld.getWorld()).isEmpty()) {
@@ -37,7 +37,7 @@ public class WorldUnloadTask extends BukkitRunnable {
}
}
- for (DEditWorld editWorld : DungeonsXL.getDWorlds().getEditWorlds()) {
+ for (DEditWorld editWorld : DungeonsXL.getInstance().getDWorlds().getEditWorlds()) {
if (editWorld.exists()) {
if (editWorld.getWorld().getPlayers().isEmpty()) {
editWorld.delete(true);
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/world/WorldUpdateTask.java b/src/main/java/io/github/dre2n/dungeonsxl/world/WorldUpdateTask.java
similarity index 91%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/world/WorldUpdateTask.java
rename to src/main/java/io/github/dre2n/dungeonsxl/world/WorldUpdateTask.java
index 042e1b58..8482c2bd 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/world/WorldUpdateTask.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/world/WorldUpdateTask.java
@@ -27,7 +27,7 @@ public class WorldUpdateTask extends BukkitRunnable {
@Override
public void run() {
- for (DGameWorld gameWorld : DungeonsXL.getDWorlds().getGameWorlds()) {
+ for (DGameWorld gameWorld : DungeonsXL.getInstance().getDWorlds().getGameWorlds()) {
gameWorld.update();
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/world/block/GameBlock.java b/src/main/java/io/github/dre2n/dungeonsxl/world/block/GameBlock.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/world/block/GameBlock.java
rename to src/main/java/io/github/dre2n/dungeonsxl/world/block/GameBlock.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/world/block/LockedDoor.java b/src/main/java/io/github/dre2n/dungeonsxl/world/block/LockedDoor.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/world/block/LockedDoor.java
rename to src/main/java/io/github/dre2n/dungeonsxl/world/block/LockedDoor.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/world/block/MultiBlock.java b/src/main/java/io/github/dre2n/dungeonsxl/world/block/MultiBlock.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/world/block/MultiBlock.java
rename to src/main/java/io/github/dre2n/dungeonsxl/world/block/MultiBlock.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/world/block/PlaceableBlock.java b/src/main/java/io/github/dre2n/dungeonsxl/world/block/PlaceableBlock.java
similarity index 99%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/world/block/PlaceableBlock.java
rename to src/main/java/io/github/dre2n/dungeonsxl/world/block/PlaceableBlock.java
index 05faa917..49282c9c 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/world/block/PlaceableBlock.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/world/block/PlaceableBlock.java
@@ -16,7 +16,7 @@
*/
package io.github.dre2n.dungeonsxl.world.block;
-import io.github.dre2n.commons.util.NumberUtil;
+import io.github.dre2n.commons.misc.NumberUtil;
import io.github.dre2n.dungeonsxl.world.DGameWorld;
import java.util.HashSet;
import java.util.Set;
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/world/block/ProtectedBlock.java b/src/main/java/io/github/dre2n/dungeonsxl/world/block/ProtectedBlock.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/world/block/ProtectedBlock.java
rename to src/main/java/io/github/dre2n/dungeonsxl/world/block/ProtectedBlock.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/world/block/RewardChest.java b/src/main/java/io/github/dre2n/dungeonsxl/world/block/RewardChest.java
similarity index 93%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/world/block/RewardChest.java
rename to src/main/java/io/github/dre2n/dungeonsxl/world/block/RewardChest.java
index d98cfdba..6a4d1679 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/world/block/RewardChest.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/world/block/RewardChest.java
@@ -16,9 +16,9 @@
*/
package io.github.dre2n.dungeonsxl.world.block;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
+import io.github.dre2n.commons.chat.MessageUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.game.Game;
import io.github.dre2n.dungeonsxl.game.GameTypeDefault;
import io.github.dre2n.dungeonsxl.player.DGamePlayer;
@@ -137,7 +137,7 @@ public class RewardChest extends GameBlock {
*/
public void onOpen(Player opener) {
if (used) {
- MessageUtil.sendMessage(Bukkit.getPlayer(opener.getUniqueId()), DMessages.ERROR_CHEST_IS_OPENED.getMessage());
+ MessageUtil.sendMessage(Bukkit.getPlayer(opener.getUniqueId()), DMessage.ERROR_CHEST_IS_OPENED.getMessage());
return;
}
@@ -235,15 +235,15 @@ public class RewardChest extends GameBlock {
msg = msg.substring(0, msg.length() - 1);
}
- MessageUtil.sendMessage(player, DMessages.PLAYER_LOOT_ADDED.getMessage(msg));
+ MessageUtil.sendMessage(player, DMessage.PLAYER_LOOT_ADDED.getMessage(msg));
}
if (moneyReward != 0 && plugin.getEconomyProvider() != null) {
- MessageUtil.sendMessage(player, DMessages.PLAYER_LOOT_ADDED.getMessage(plugin.getEconomyProvider().format(moneyReward)));
+ MessageUtil.sendMessage(player, DMessage.PLAYER_LOOT_ADDED.getMessage(plugin.getEconomyProvider().format(moneyReward)));
}
if (levelReward != 0) {
- MessageUtil.sendMessage(player, DMessages.PLAYER_LOOT_ADDED.getMessage(levelReward + " levels"));
+ MessageUtil.sendMessage(player, DMessage.PLAYER_LOOT_ADDED.getMessage(levelReward + " levels"));
}
}
}
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/world/block/TeamBed.java b/src/main/java/io/github/dre2n/dungeonsxl/world/block/TeamBed.java
similarity index 89%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/world/block/TeamBed.java
rename to src/main/java/io/github/dre2n/dungeonsxl/world/block/TeamBed.java
index b5bf70e7..fdba0a3a 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/world/block/TeamBed.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/world/block/TeamBed.java
@@ -16,8 +16,8 @@
*/
package io.github.dre2n.dungeonsxl.world.block;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.player.DGamePlayer;
import io.github.dre2n.dungeonsxl.player.DGroup;
import org.bukkit.Material;
@@ -73,7 +73,7 @@ public class TeamBed extends TeamBlock implements MultiBlock {
public boolean onBreak(BlockBreakEvent event) {
Player breaker = event.getPlayer();
if (owner.getPlayers().contains(breaker)) {
- MessageUtil.sendMessage(breaker, DMessages.ERROR_BLOCK_OWN_TEAM.getMessage());
+ MessageUtil.sendMessage(breaker, DMessage.ERROR_BLOCK_OWN_TEAM.getMessage());
return true;
}
@@ -82,7 +82,7 @@ public class TeamBed extends TeamBlock implements MultiBlock {
}
owner.setLives(0);
- owner.getGameWorld().sendMessage(DMessages.GROUP_BED_DESTROYED.getMessage(owner.getName(), DGamePlayer.getByPlayer(breaker).getName()));
+ owner.getGameWorld().sendMessage(DMessage.GROUP_BED_DESTROYED.getMessage(owner.getName(), DGamePlayer.getByPlayer(breaker).getName()));
Block block1 = event.getBlock();
if (((Bed) block1.getState().getData()).isHeadOfBed()) {
Block block2 = getAttachedBlock(block1);
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/world/block/TeamBlock.java b/src/main/java/io/github/dre2n/dungeonsxl/world/block/TeamBlock.java
similarity index 100%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/world/block/TeamBlock.java
rename to src/main/java/io/github/dre2n/dungeonsxl/world/block/TeamBlock.java
diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/world/block/TeamFlag.java b/src/main/java/io/github/dre2n/dungeonsxl/world/block/TeamFlag.java
similarity index 85%
rename from core/src/main/java/io/github/dre2n/dungeonsxl/world/block/TeamFlag.java
rename to src/main/java/io/github/dre2n/dungeonsxl/world/block/TeamFlag.java
index ed97e2a0..4116c278 100644
--- a/core/src/main/java/io/github/dre2n/dungeonsxl/world/block/TeamFlag.java
+++ b/src/main/java/io/github/dre2n/dungeonsxl/world/block/TeamFlag.java
@@ -16,8 +16,8 @@
*/
package io.github.dre2n.dungeonsxl.world.block;
-import io.github.dre2n.commons.util.messageutil.MessageUtil;
-import io.github.dre2n.dungeonsxl.config.DMessages;
+import io.github.dre2n.commons.chat.MessageUtil;
+import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.player.DGamePlayer;
import io.github.dre2n.dungeonsxl.player.DGroup;
import org.bukkit.Material;
@@ -54,11 +54,11 @@ public class TeamFlag extends TeamBlock {
}
if (owner.getPlayers().contains(breaker)) {
- MessageUtil.sendMessage(breaker, DMessages.ERROR_BLOCK_OWN_TEAM.getMessage());
+ MessageUtil.sendMessage(breaker, DMessage.ERROR_BLOCK_OWN_TEAM.getMessage());
return true;
}
- owner.getGameWorld().sendMessage(DMessages.GROUP_FLAG_STEALING.getMessage(gamePlayer.getName(), owner.getName()));
+ owner.getGameWorld().sendMessage(DMessage.GROUP_FLAG_STEALING.getMessage(gamePlayer.getName(), owner.getName()));
gamePlayer.setRobbedGroup(owner);
event.getBlock().setType(Material.AIR);
return true;
diff --git a/core/src/main/resources/plugin.yml b/src/main/resources/plugin.yml
similarity index 100%
rename from core/src/main/resources/plugin.yml
rename to src/main/resources/plugin.yml