mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-24 19:45:43 +01:00
Equalize world class naming
This commit is contained in:
parent
e2f4a8fe84
commit
9ae44d6cd5
@ -52,7 +52,7 @@ import io.github.dre2n.dungeonsxl.task.SecureModeTask;
|
||||
import io.github.dre2n.dungeonsxl.task.UpdateTask;
|
||||
import io.github.dre2n.dungeonsxl.task.WorldUnloadTask;
|
||||
import io.github.dre2n.dungeonsxl.trigger.TriggerTypes;
|
||||
import io.github.dre2n.dungeonsxl.world.Worlds;
|
||||
import io.github.dre2n.dungeonsxl.world.DWorlds;
|
||||
import io.github.dre2n.itemsxl.ItemsXL;
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
@ -98,7 +98,7 @@ public class DungeonsXL extends BRPlugin {
|
||||
private DClasses dClasses;
|
||||
private DMobTypes dMobTypes;
|
||||
private SignScripts signScripts;
|
||||
private Worlds worlds;
|
||||
private DWorlds dWorlds;
|
||||
|
||||
private BukkitTask announcerTask;
|
||||
private BukkitTask worldUnloadTask;
|
||||
@ -200,8 +200,8 @@ public class DungeonsXL extends BRPlugin {
|
||||
dLootInventories.clear();
|
||||
dGroups.clear();
|
||||
|
||||
// Delete Worlds
|
||||
worlds.deleteAllInstances();
|
||||
// Delete DWorlds
|
||||
dWorlds.deleteAllInstances();
|
||||
|
||||
// Disable listeners
|
||||
HandlerList.unregisterAll(this);
|
||||
@ -266,18 +266,16 @@ public class DungeonsXL extends BRPlugin {
|
||||
public void saveData() {
|
||||
protections.saveAll();
|
||||
DSavePlayer.save();
|
||||
worlds.saveAll();
|
||||
dWorlds.saveAll();
|
||||
}
|
||||
|
||||
public void loadAll() {
|
||||
protections.loadAll();
|
||||
dPlayers.loadAll();
|
||||
DSavePlayer.load();
|
||||
worlds.check();
|
||||
dWorlds.check();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Getters and loaders */
|
||||
/**
|
||||
* @return the plugin instance
|
||||
@ -575,17 +573,17 @@ public class DungeonsXL extends BRPlugin {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the loaded instance of Worlds
|
||||
* @return the loaded instance of DWorlds
|
||||
*/
|
||||
public Worlds getWorlds() {
|
||||
return worlds;
|
||||
public DWorlds getDWorlds() {
|
||||
return dWorlds;
|
||||
}
|
||||
|
||||
/**
|
||||
* load / reload a new instance of Worlds
|
||||
* load / reload a new instance of DWorlds
|
||||
*/
|
||||
public void loadWorlds(File folder) {
|
||||
worlds = new Worlds(MAPS);
|
||||
dWorlds = new DWorlds(MAPS);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -23,8 +23,8 @@ import io.github.dre2n.dungeonsxl.config.DMessages;
|
||||
import io.github.dre2n.dungeonsxl.player.DEditPlayer;
|
||||
import io.github.dre2n.dungeonsxl.player.DGamePlayer;
|
||||
import io.github.dre2n.dungeonsxl.player.DPermissions;
|
||||
import io.github.dre2n.dungeonsxl.world.EditWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.ResourceWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DEditWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DResourceWorld;
|
||||
import java.io.File;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.ConsoleCommandSender;
|
||||
@ -67,8 +67,8 @@ public class CreateCommand extends BRCommand {
|
||||
MessageUtil.log(plugin, DMessages.LOG_GENERATE_NEW_WORLD.getMessage());
|
||||
|
||||
// Create World
|
||||
ResourceWorld resource = new ResourceWorld(name);
|
||||
EditWorld editWorld = resource.generate();
|
||||
DResourceWorld resource = new DResourceWorld(name);
|
||||
DEditWorld editWorld = resource.generate();
|
||||
editWorld.save();
|
||||
editWorld.delete();
|
||||
|
||||
@ -88,8 +88,8 @@ public class CreateCommand extends BRCommand {
|
||||
MessageUtil.log(plugin, DMessages.LOG_GENERATE_NEW_WORLD.getMessage());
|
||||
|
||||
// Create World
|
||||
ResourceWorld resource = new ResourceWorld(name);
|
||||
EditWorld editWorld = resource.generate();
|
||||
DResourceWorld resource = new DResourceWorld(name);
|
||||
DEditWorld editWorld = resource.generate();
|
||||
|
||||
// MSG Done
|
||||
MessageUtil.log(plugin, DMessages.LOG_WORLD_GENERATION_FINISHED.getMessage());
|
||||
|
@ -25,9 +25,9 @@ import io.github.dre2n.dungeonsxl.player.DGlobalPlayer;
|
||||
import io.github.dre2n.dungeonsxl.player.DGroup;
|
||||
import io.github.dre2n.dungeonsxl.player.DInstancePlayer;
|
||||
import io.github.dre2n.dungeonsxl.player.DPermissions;
|
||||
import io.github.dre2n.dungeonsxl.world.EditWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.ResourceWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.Worlds;
|
||||
import io.github.dre2n.dungeonsxl.world.DEditWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DResourceWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DWorlds;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@ -37,7 +37,7 @@ import org.bukkit.entity.Player;
|
||||
public class EditCommand extends BRCommand {
|
||||
|
||||
DungeonsXL plugin = DungeonsXL.getInstance();
|
||||
Worlds worlds = plugin.getWorlds();
|
||||
DWorlds worlds = plugin.getDWorlds();
|
||||
|
||||
public EditCommand() {
|
||||
setCommand("edit");
|
||||
@ -57,8 +57,8 @@ public class EditCommand extends BRCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
ResourceWorld resource = worlds.getResourceByName(mapName);
|
||||
EditWorld editWorld = resource.instantiateAsEditWorld();
|
||||
DResourceWorld resource = worlds.getResourceByName(mapName);
|
||||
DEditWorld editWorld = resource.instantiateAsEditWorld();
|
||||
DGroup dGroup = DGroup.getByPlayer(player);
|
||||
DGlobalPlayer dPlayer = plugin.getDPlayers().getByPlayer(player);
|
||||
|
||||
|
@ -23,7 +23,7 @@ import io.github.dre2n.dungeonsxl.player.DEditPlayer;
|
||||
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.world.EditWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DEditWorld;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@ -52,7 +52,7 @@ public class EscapeCommand extends BRCommand {
|
||||
} else if (dPlayer != null) {
|
||||
dPlayer.escape();
|
||||
|
||||
EditWorld editWorld = EditWorld.getByWorld(dPlayer.getWorld());
|
||||
DEditWorld editWorld = DEditWorld.getByWorld(dPlayer.getWorld());
|
||||
if (editWorld == null) {
|
||||
return;
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ import io.github.dre2n.dungeonsxl.config.DMessages;
|
||||
import io.github.dre2n.dungeonsxl.game.Game;
|
||||
import io.github.dre2n.dungeonsxl.player.DGroup;
|
||||
import io.github.dre2n.dungeonsxl.player.DPermissions;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@ -52,7 +52,7 @@ public class GameCommand extends BRCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
GameWorld gameWorld = dGroup.getGameWorld();
|
||||
DGameWorld gameWorld = dGroup.getGameWorld();
|
||||
if (gameWorld == null) {
|
||||
MessageUtil.sendMessage(sender, DMessages.ERROR_NO_GAME.getMessage());
|
||||
return;
|
||||
|
@ -21,7 +21,7 @@ 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.player.DPermissions;
|
||||
import io.github.dre2n.dungeonsxl.world.ResourceWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DResourceWorld;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -45,7 +45,7 @@ public class InviteCommand extends BRCommand {
|
||||
|
||||
@Override
|
||||
public void onExecute(String[] args, CommandSender sender) {
|
||||
ResourceWorld resource = plugin.getWorlds().getResourceByName(args[2]);
|
||||
DResourceWorld resource = plugin.getDWorlds().getResourceByName(args[2]);
|
||||
OfflinePlayer player = Bukkit.getOfflinePlayer(args[2]);
|
||||
|
||||
if (resource != null) {
|
||||
|
@ -27,7 +27,7 @@ import io.github.dre2n.dungeonsxl.player.DGlobalPlayer;
|
||||
import io.github.dre2n.dungeonsxl.player.DGroup;
|
||||
import io.github.dre2n.dungeonsxl.player.DInstancePlayer;
|
||||
import io.github.dre2n.dungeonsxl.player.DPermissions;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@ -53,8 +53,8 @@ public class LeaveCommand extends BRCommand {
|
||||
|
||||
DGlobalPlayer dPlayer = plugin.getDPlayers().getByPlayer(player);
|
||||
|
||||
if (GameWorld.getByWorld(player.getWorld()) != null) {
|
||||
if (GameWorld.getByWorld(player.getWorld()).isTutorial()) {
|
||||
if (DGameWorld.getByWorld(player.getWorld()) != null) {
|
||||
if (DGameWorld.getByWorld(player.getWorld()).isTutorial()) {
|
||||
MessageUtil.sendMessage(player, DMessages.ERROR_NO_LEAVE_IN_TUTORIAL.getMessage());
|
||||
return;
|
||||
}
|
||||
|
@ -24,9 +24,9 @@ import io.github.dre2n.dungeonsxl.config.DMessages;
|
||||
import io.github.dre2n.dungeonsxl.config.DungeonConfig;
|
||||
import io.github.dre2n.dungeonsxl.dungeon.Dungeon;
|
||||
import io.github.dre2n.dungeonsxl.player.DPermissions;
|
||||
import io.github.dre2n.dungeonsxl.world.EditWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.Worlds;
|
||||
import io.github.dre2n.dungeonsxl.world.DEditWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DWorlds;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -38,7 +38,7 @@ import org.bukkit.entity.Player;
|
||||
public class ListCommand extends BRCommand {
|
||||
|
||||
DungeonsXL plugin = DungeonsXL.getInstance();
|
||||
Worlds worlds = plugin.getWorlds();
|
||||
DWorlds worlds = plugin.getDWorlds();
|
||||
|
||||
public ListCommand() {
|
||||
setCommand("list");
|
||||
@ -63,10 +63,10 @@ public class ListCommand extends BRCommand {
|
||||
mapList.add(file.getName());
|
||||
}
|
||||
ArrayList<String> loadedList = new ArrayList<>();
|
||||
for (EditWorld editWorld : worlds.getEditWorlds()) {
|
||||
for (DEditWorld editWorld : worlds.getEditWorlds()) {
|
||||
loadedList.add(editWorld.getWorld().getWorldFolder().getName());
|
||||
}
|
||||
for (GameWorld gameWorld : worlds.getGameWorlds()) {
|
||||
for (DGameWorld gameWorld : worlds.getGameWorlds()) {
|
||||
loadedList.add(gameWorld.getWorld().getWorldFolder().getName());
|
||||
}
|
||||
ArrayList<String> toSend = new ArrayList<>();
|
||||
|
@ -50,7 +50,7 @@ public class MainCommand extends BRCommand {
|
||||
|
||||
int maps = new File(plugin.getDataFolder() + "/maps").listFiles().length;
|
||||
int dungeons = new File(plugin.getDataFolder() + "/dungeons").listFiles().length;
|
||||
int loaded = plugin.getWorlds().getEditWorlds().size() + plugin.getWorlds().getGameWorlds().size();
|
||||
int loaded = plugin.getDWorlds().getEditWorlds().size() + plugin.getDWorlds().getGameWorlds().size();
|
||||
int players = plugin.getDPlayers().getDGamePlayers().size();
|
||||
Internals internals = CompatibilityHandler.getInstance().getInternals();
|
||||
String vault = "";
|
||||
|
@ -23,7 +23,7 @@ import io.github.dre2n.dungeonsxl.DungeonsXL;
|
||||
import io.github.dre2n.dungeonsxl.config.DMessages;
|
||||
import io.github.dre2n.dungeonsxl.config.WorldConfig;
|
||||
import io.github.dre2n.dungeonsxl.player.DPermissions;
|
||||
import io.github.dre2n.dungeonsxl.world.EditWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DEditWorld;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -47,7 +47,7 @@ public class MsgCommand extends BRCommand {
|
||||
@Override
|
||||
public void onExecute(String[] args, CommandSender sender) {
|
||||
Player player = (Player) sender;
|
||||
EditWorld editWorld = EditWorld.getByWorld(player.getWorld());
|
||||
DEditWorld editWorld = DEditWorld.getByWorld(player.getWorld());
|
||||
|
||||
if (editWorld == null) {
|
||||
MessageUtil.sendMessage(player, DMessages.ERROR_NOT_IN_DUNGEON.getMessage());
|
||||
|
@ -83,7 +83,7 @@ public class PlayCommand extends BRCommand {
|
||||
}
|
||||
}
|
||||
|
||||
if (!multiFloor && !plugin.getWorlds().exists(identifier)) {
|
||||
if (!multiFloor && !plugin.getDWorlds().exists(identifier)) {
|
||||
MessageUtil.sendMessage(player, DMessages.ERROR_DUNGEON_NOT_EXIST.getMessage(identifier));
|
||||
return;
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ public class ReloadCommand extends BRCommand {
|
||||
|
||||
int maps = new File(plugin.getDataFolder() + "/maps").listFiles().length;
|
||||
int dungeons = new File(plugin.getDataFolder() + "/dungeons").listFiles().length;
|
||||
int loaded = plugin.getWorlds().getEditWorlds().size() + plugin.getWorlds().getGameWorlds().size();
|
||||
int loaded = plugin.getDWorlds().getEditWorlds().size() + plugin.getDWorlds().getGameWorlds().size();
|
||||
int players = plugin.getDPlayers().getDGamePlayers().size();
|
||||
Internals internals = CompatibilityHandler.getInstance().getInternals();
|
||||
String vault = "";
|
||||
|
@ -21,7 +21,7 @@ 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.player.DPermissions;
|
||||
import io.github.dre2n.dungeonsxl.world.EditWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DEditWorld;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@ -44,7 +44,7 @@ public class SaveCommand extends BRCommand {
|
||||
@Override
|
||||
public void onExecute(String[] args, CommandSender sender) {
|
||||
Player player = (Player) sender;
|
||||
EditWorld editWorld = EditWorld.getByWorld(player.getWorld());
|
||||
DEditWorld editWorld = DEditWorld.getByWorld(player.getWorld());
|
||||
if (editWorld != null) {
|
||||
editWorld.save();
|
||||
MessageUtil.sendMessage(player, DMessages.CMD_SAVE_SUCCESS.getMessage());
|
||||
|
@ -25,7 +25,7 @@ import io.github.dre2n.dungeonsxl.game.GameTypeDefault;
|
||||
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.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@ -60,7 +60,7 @@ public class TestCommand extends BRCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
GameWorld gameWorld = dGroup.getGameWorld();
|
||||
DGameWorld gameWorld = dGroup.getGameWorld();
|
||||
if (gameWorld == null) {
|
||||
MessageUtil.sendMessage(sender, DMessages.ERROR_NOT_IN_DUNGEON.getMessage());
|
||||
return;
|
||||
|
@ -21,7 +21,7 @@ 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.player.DPermissions;
|
||||
import io.github.dre2n.dungeonsxl.world.ResourceWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DResourceWorld;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -45,7 +45,7 @@ public class UninviteCommand extends BRCommand {
|
||||
|
||||
@Override
|
||||
public void onExecute(String[] args, CommandSender sender) {
|
||||
ResourceWorld resource = plugin.getWorlds().getResourceByName(args[2]);
|
||||
DResourceWorld resource = plugin.getDWorlds().getResourceByName(args[2]);
|
||||
if (resource == null) {
|
||||
MessageUtil.sendMessage(sender, DMessages.ERROR_DUNGEON_NOT_EXIST.getMessage(args[2]));
|
||||
}
|
||||
|
@ -18,8 +18,8 @@ package io.github.dre2n.dungeonsxl.config;
|
||||
|
||||
import io.github.dre2n.commons.config.BRConfig;
|
||||
import io.github.dre2n.dungeonsxl.DungeonsXL;
|
||||
import io.github.dre2n.dungeonsxl.world.ResourceWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.Worlds;
|
||||
import io.github.dre2n.dungeonsxl.world.DResourceWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DWorlds;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -29,13 +29,13 @@ import java.util.List;
|
||||
*/
|
||||
public class DungeonConfig extends BRConfig {
|
||||
|
||||
Worlds worlds = DungeonsXL.getInstance().getWorlds();
|
||||
DWorlds worlds = DungeonsXL.getInstance().getDWorlds();
|
||||
|
||||
public static final int CONFIG_VERSION = 1;
|
||||
|
||||
private ResourceWorld startFloor;
|
||||
private ResourceWorld endFloor;
|
||||
private List<ResourceWorld> floors = new ArrayList<>();
|
||||
private DResourceWorld startFloor;
|
||||
private DResourceWorld endFloor;
|
||||
private List<DResourceWorld> floors = new ArrayList<>();
|
||||
private int floorCount;
|
||||
private boolean removeWhenPlayed;
|
||||
private WorldConfig overrideValues;
|
||||
@ -53,7 +53,7 @@ public class DungeonConfig extends BRConfig {
|
||||
/**
|
||||
* @return the startFloor
|
||||
*/
|
||||
public ResourceWorld getStartFloor() {
|
||||
public DResourceWorld getStartFloor() {
|
||||
return startFloor;
|
||||
}
|
||||
|
||||
@ -61,14 +61,14 @@ public class DungeonConfig extends BRConfig {
|
||||
* @param startFloor
|
||||
* the startFloor to set
|
||||
*/
|
||||
public void setStartFloor(ResourceWorld startFloor) {
|
||||
public void setStartFloor(DResourceWorld startFloor) {
|
||||
this.startFloor = startFloor;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the endFloor
|
||||
*/
|
||||
public ResourceWorld getEndFloor() {
|
||||
public DResourceWorld getEndFloor() {
|
||||
return endFloor;
|
||||
}
|
||||
|
||||
@ -76,14 +76,14 @@ public class DungeonConfig extends BRConfig {
|
||||
* @param endFloor
|
||||
* the endFloor to set
|
||||
*/
|
||||
public void setEndFloor(ResourceWorld endFloor) {
|
||||
public void setEndFloor(DResourceWorld endFloor) {
|
||||
this.endFloor = endFloor;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the floors
|
||||
*/
|
||||
public List<ResourceWorld> getFloors() {
|
||||
public List<DResourceWorld> getFloors() {
|
||||
return floors;
|
||||
}
|
||||
|
||||
@ -91,7 +91,7 @@ public class DungeonConfig extends BRConfig {
|
||||
* @param resource
|
||||
* the resource to add
|
||||
*/
|
||||
public void addFloor(ResourceWorld resource) {
|
||||
public void addFloor(DResourceWorld resource) {
|
||||
floors.add(resource);
|
||||
}
|
||||
|
||||
@ -99,7 +99,7 @@ public class DungeonConfig extends BRConfig {
|
||||
* @param resource
|
||||
* the resource to remove
|
||||
*/
|
||||
public void removeFloor(ResourceWorld resource) {
|
||||
public void removeFloor(DResourceWorld resource) {
|
||||
floors.remove(resource);
|
||||
}
|
||||
|
||||
@ -172,10 +172,10 @@ public class DungeonConfig extends BRConfig {
|
||||
|
||||
/**
|
||||
* @param resource
|
||||
* the ResourceWorld to check
|
||||
* the DResourceWorld to check
|
||||
* @return true if the floor is either in the list or the start / end floor.
|
||||
*/
|
||||
public boolean containsFloor(ResourceWorld resource) {
|
||||
public boolean containsFloor(DResourceWorld resource) {
|
||||
return floors.contains(resource) || startFloor.equals(resource) || endFloor.equals(resource);
|
||||
}
|
||||
|
||||
@ -225,7 +225,7 @@ public class DungeonConfig extends BRConfig {
|
||||
public void load() {
|
||||
if (config.contains("floors")) {
|
||||
for (String floor : config.getStringList("floors")) {
|
||||
ResourceWorld resource = worlds.getResourceByName(floor);
|
||||
DResourceWorld resource = worlds.getResourceByName(floor);
|
||||
if (resource != null) {
|
||||
floors.add(resource);
|
||||
}
|
||||
|
@ -17,8 +17,8 @@
|
||||
package io.github.dre2n.dungeonsxl.config;
|
||||
|
||||
import io.github.dre2n.dungeonsxl.sign.DSign;
|
||||
import io.github.dre2n.dungeonsxl.world.EditWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DEditWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
@ -50,14 +50,14 @@ public class SignData {
|
||||
|
||||
/* Actions */
|
||||
/**
|
||||
* Applies all signs from the file to the EditWorld.
|
||||
* Also sets the lobby location of the EditWorld to the location of the lobby sign if one exists.
|
||||
* Applies all signs from the file to the DEditWorld.
|
||||
* Also sets the lobby location of the DEditWorld to the location of the lobby sign if one exists.
|
||||
*
|
||||
* @param editWorld
|
||||
* the EditWorld where the signs are
|
||||
* the DEditWorld where the signs are
|
||||
* @throws IOException
|
||||
*/
|
||||
public void deserializeSigns(EditWorld editWorld) throws IOException {
|
||||
public void deserializeSigns(DEditWorld editWorld) throws IOException {
|
||||
ObjectInputStream os = new ObjectInputStream(new FileInputStream(file));
|
||||
int length = os.readInt();
|
||||
|
||||
@ -81,14 +81,14 @@ public class SignData {
|
||||
}
|
||||
|
||||
/**
|
||||
* Applies all signs from the file to the GameWorld.
|
||||
* Applies all signs from the file to the DGameWorld.
|
||||
*
|
||||
* @param gameWorld
|
||||
* the GameWorld where the signs are
|
||||
* the DGameWorld where the signs are
|
||||
* @return a Set of all DSign blocks
|
||||
* @throws IOException
|
||||
*/
|
||||
public void deserializeSigns(GameWorld gameWorld) throws IOException {
|
||||
public void deserializeSigns(DGameWorld gameWorld) throws IOException {
|
||||
ObjectInputStream os = new ObjectInputStream(new FileInputStream(file));
|
||||
|
||||
int length = os.readInt();
|
||||
@ -108,13 +108,13 @@ public class SignData {
|
||||
}
|
||||
|
||||
/**
|
||||
* Applies all signs from the EditWorld to the file.
|
||||
* Applies all signs from the DEditWorld to the file.
|
||||
*
|
||||
* @param editWorld
|
||||
* the EditWorld that contains the signs to serialize
|
||||
* the DEditWorld that contains the signs to serialize
|
||||
* @throws IOException
|
||||
*/
|
||||
public void serializeSigns(EditWorld editWorld) throws IOException {
|
||||
public void serializeSigns(DEditWorld editWorld) throws IOException {
|
||||
serializeSigns(editWorld.getSigns());
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
package io.github.dre2n.dungeonsxl.event.dgroup;
|
||||
|
||||
import io.github.dre2n.dungeonsxl.player.DGroup;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
@ -29,10 +29,10 @@ public class DGroupFinishFloorEvent extends DGroupEvent implements Cancellable {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private boolean cancelled;
|
||||
|
||||
private GameWorld finished;
|
||||
private DGameWorld finished;
|
||||
private String next;
|
||||
|
||||
public DGroupFinishFloorEvent(DGroup dGroup, GameWorld finished, String next) {
|
||||
public DGroupFinishFloorEvent(DGroup dGroup, DGameWorld finished, String next) {
|
||||
super(dGroup);
|
||||
this.finished = finished;
|
||||
this.next = next;
|
||||
@ -41,15 +41,15 @@ public class DGroupFinishFloorEvent extends DGroupEvent implements Cancellable {
|
||||
/**
|
||||
* @return the finished
|
||||
*/
|
||||
public GameWorld getFinished() {
|
||||
public DGameWorld getFinished() {
|
||||
return finished;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param finished
|
||||
* the name of the GameWorld to set
|
||||
* the name of the DGameWorld to set
|
||||
*/
|
||||
public void setFinished(GameWorld finished) {
|
||||
public void setFinished(DGameWorld finished) {
|
||||
this.finished = finished;
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@ public class DGroupFinishFloorEvent extends DGroupEvent implements Cancellable {
|
||||
|
||||
/**
|
||||
* @param next
|
||||
* the name of the GameWorld to set
|
||||
* the name of the DGameWorld to set
|
||||
*/
|
||||
public void setNext(String next) {
|
||||
this.next = next;
|
||||
|
@ -17,7 +17,7 @@
|
||||
package io.github.dre2n.dungeonsxl.event.dgroup;
|
||||
|
||||
import io.github.dre2n.dungeonsxl.player.DGroup;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
@ -29,9 +29,9 @@ public class DGroupStartFloorEvent extends DGroupEvent implements Cancellable {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private boolean cancelled;
|
||||
|
||||
private GameWorld gameWorld;
|
||||
private DGameWorld gameWorld;
|
||||
|
||||
public DGroupStartFloorEvent(DGroup dGroup, GameWorld gameWorld) {
|
||||
public DGroupStartFloorEvent(DGroup dGroup, DGameWorld gameWorld) {
|
||||
super(dGroup);
|
||||
this.gameWorld = gameWorld;
|
||||
}
|
||||
@ -39,7 +39,7 @@ public class DGroupStartFloorEvent extends DGroupEvent implements Cancellable {
|
||||
/**
|
||||
* @return the gameWorld
|
||||
*/
|
||||
public GameWorld getGameWorld() {
|
||||
public DGameWorld getGameWorld() {
|
||||
return gameWorld;
|
||||
}
|
||||
|
||||
@ -47,7 +47,7 @@ public class DGroupStartFloorEvent extends DGroupEvent implements Cancellable {
|
||||
* @param gameWorld
|
||||
* the gameWorld to set
|
||||
*/
|
||||
public void setGameWorld(GameWorld gameWorld) {
|
||||
public void setGameWorld(DGameWorld gameWorld) {
|
||||
this.gameWorld = gameWorld;
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
package io.github.dre2n.dungeonsxl.event.dsign;
|
||||
|
||||
import io.github.dre2n.dungeonsxl.sign.DSign;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.block.Sign;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
@ -31,9 +31,9 @@ public class DSignRegistrationEvent extends DSignEvent implements Cancellable {
|
||||
private boolean cancelled;
|
||||
|
||||
private Sign sign;
|
||||
private GameWorld gameWorld;
|
||||
private DGameWorld gameWorld;
|
||||
|
||||
public DSignRegistrationEvent(Sign sign, GameWorld gameWorld, DSign dSign) {
|
||||
public DSignRegistrationEvent(Sign sign, DGameWorld gameWorld, DSign dSign) {
|
||||
super(dSign);
|
||||
this.sign = sign;
|
||||
this.gameWorld = gameWorld;
|
||||
@ -57,7 +57,7 @@ public class DSignRegistrationEvent extends DSignEvent implements Cancellable {
|
||||
/**
|
||||
* @return the gameWorld
|
||||
*/
|
||||
public GameWorld getGameWorld() {
|
||||
public DGameWorld getGameWorld() {
|
||||
return gameWorld;
|
||||
}
|
||||
|
||||
@ -65,7 +65,7 @@ public class DSignRegistrationEvent extends DSignEvent implements Cancellable {
|
||||
* @param gameWorld
|
||||
* the gameWorld to set
|
||||
*/
|
||||
public void setGameWorld(GameWorld gameWorld) {
|
||||
public void setGameWorld(DGameWorld gameWorld) {
|
||||
this.gameWorld = gameWorld;
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
package io.github.dre2n.dungeonsxl.event.editworld;
|
||||
|
||||
import io.github.dre2n.dungeonsxl.world.EditWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DEditWorld;
|
||||
import org.bukkit.event.Event;
|
||||
|
||||
/**
|
||||
@ -24,16 +24,16 @@ import org.bukkit.event.Event;
|
||||
*/
|
||||
public abstract class EditWorldEvent extends Event {
|
||||
|
||||
protected EditWorld editWorld;
|
||||
protected DEditWorld editWorld;
|
||||
|
||||
public EditWorldEvent(EditWorld editWorld) {
|
||||
public EditWorldEvent(DEditWorld editWorld) {
|
||||
this.editWorld = editWorld;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the editWorld
|
||||
*/
|
||||
public EditWorld getEditWorld() {
|
||||
public DEditWorld getEditWorld() {
|
||||
return editWorld;
|
||||
}
|
||||
|
||||
@ -41,7 +41,7 @@ public abstract class EditWorldEvent extends Event {
|
||||
* @param editWorld
|
||||
* the editWorld to set
|
||||
*/
|
||||
public void setEditWorld(EditWorld editWorld) {
|
||||
public void setEditWorld(DEditWorld editWorld) {
|
||||
this.editWorld = editWorld;
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
package io.github.dre2n.dungeonsxl.event.editworld;
|
||||
|
||||
import io.github.dre2n.dungeonsxl.world.EditWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DEditWorld;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
@ -28,7 +28,7 @@ public class EditWorldGenerateEvent extends EditWorldEvent implements Cancellabl
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private boolean cancelled;
|
||||
|
||||
public EditWorldGenerateEvent(EditWorld editWorld) {
|
||||
public EditWorldGenerateEvent(DEditWorld editWorld) {
|
||||
super(editWorld);
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
package io.github.dre2n.dungeonsxl.event.editworld;
|
||||
|
||||
import io.github.dre2n.dungeonsxl.world.EditWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DEditWorld;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
@ -28,7 +28,7 @@ public class EditWorldSaveEvent extends EditWorldEvent implements Cancellable {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private boolean cancelled;
|
||||
|
||||
public EditWorldSaveEvent(EditWorld editWorld) {
|
||||
public EditWorldSaveEvent(DEditWorld editWorld) {
|
||||
super(editWorld);
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
package io.github.dre2n.dungeonsxl.event.editworld;
|
||||
|
||||
import io.github.dre2n.dungeonsxl.world.EditWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DEditWorld;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
@ -30,7 +30,7 @@ public class EditWorldUnloadEvent extends EditWorldEvent implements Cancellable
|
||||
|
||||
private boolean save;
|
||||
|
||||
public EditWorldUnloadEvent(EditWorld editWorld, boolean save) {
|
||||
public EditWorldUnloadEvent(DEditWorld editWorld, boolean save) {
|
||||
super(editWorld);
|
||||
this.save = save;
|
||||
}
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
package io.github.dre2n.dungeonsxl.event.gameworld;
|
||||
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.event.Event;
|
||||
|
||||
/**
|
||||
@ -24,16 +24,16 @@ import org.bukkit.event.Event;
|
||||
*/
|
||||
public abstract class GameWorldEvent extends Event {
|
||||
|
||||
protected GameWorld gameWorld;
|
||||
protected DGameWorld gameWorld;
|
||||
|
||||
public GameWorldEvent(GameWorld gameWorld) {
|
||||
public GameWorldEvent(DGameWorld gameWorld) {
|
||||
this.gameWorld = gameWorld;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the gameWorld
|
||||
*/
|
||||
public GameWorld getGameWorld() {
|
||||
public DGameWorld getGameWorld() {
|
||||
return gameWorld;
|
||||
}
|
||||
|
||||
@ -41,7 +41,7 @@ public abstract class GameWorldEvent extends Event {
|
||||
* @param gameWorld
|
||||
* the gameWorld to set
|
||||
*/
|
||||
public void setGameWorld(GameWorld gameWorld) {
|
||||
public void setGameWorld(DGameWorld gameWorld) {
|
||||
this.gameWorld = gameWorld;
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
package io.github.dre2n.dungeonsxl.event.gameworld;
|
||||
|
||||
import io.github.dre2n.dungeonsxl.game.Game;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
@ -31,7 +31,7 @@ public class GameWorldStartGameEvent extends GameWorldEvent implements Cancellab
|
||||
|
||||
private Game game;
|
||||
|
||||
public GameWorldStartGameEvent(GameWorld gameWorld, Game game) {
|
||||
public GameWorldStartGameEvent(DGameWorld gameWorld, Game game) {
|
||||
super(gameWorld);
|
||||
this.game = game;
|
||||
}
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
package io.github.dre2n.dungeonsxl.event.gameworld;
|
||||
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
@ -29,7 +29,7 @@ public class GameWorldUnloadEvent extends GameWorldEvent implements Cancellable
|
||||
|
||||
private boolean cancelled;
|
||||
|
||||
public GameWorldUnloadEvent(GameWorld gameWorld) {
|
||||
public GameWorldUnloadEvent(DGameWorld gameWorld) {
|
||||
super(gameWorld);
|
||||
}
|
||||
|
||||
|
@ -27,8 +27,8 @@ import io.github.dre2n.dungeonsxl.player.DGroup;
|
||||
import io.github.dre2n.dungeonsxl.sign.DSign;
|
||||
import io.github.dre2n.dungeonsxl.sign.MobSign;
|
||||
import io.github.dre2n.dungeonsxl.trigger.ProgressTrigger;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.ResourceWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DResourceWorld;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
@ -50,7 +50,7 @@ public class Game {
|
||||
private List<DGroup> dGroups = new ArrayList<>();
|
||||
private boolean started;
|
||||
private GameType type = GameTypeDefault.DEFAULT;
|
||||
private GameWorld world;
|
||||
private DGameWorld world;
|
||||
private GameRules rules;
|
||||
private int waveCount;
|
||||
private Map<String, Integer> gameKills = new HashMap<>();
|
||||
@ -64,7 +64,7 @@ public class Game {
|
||||
plugin.getGames().add(this);
|
||||
}
|
||||
|
||||
public Game(DGroup dGroup, GameWorld world) {
|
||||
public Game(DGroup dGroup, DGameWorld world) {
|
||||
dGroups.add(dGroup);
|
||||
started = false;
|
||||
this.world = world;
|
||||
@ -78,18 +78,18 @@ public class Game {
|
||||
|
||||
dGroups.add(dGroup);
|
||||
started = false;
|
||||
// TO DO world = new GameWorld();
|
||||
ResourceWorld resource = plugin.getWorlds().getResourceByName(worldName);
|
||||
// TO DO world = new DGameWorld();
|
||||
DResourceWorld resource = plugin.getDWorlds().getResourceByName(worldName);
|
||||
dGroup.setGameWorld(world);
|
||||
resource.instantiateAsGameWorld();
|
||||
fetchRules();
|
||||
}
|
||||
|
||||
public Game(DGroup dGroup, GameType type, GameWorld world) {
|
||||
public Game(DGroup dGroup, GameType type, DGameWorld world) {
|
||||
this(new ArrayList<>(Arrays.asList(dGroup)), type, world);
|
||||
}
|
||||
|
||||
public Game(List<DGroup> dGroups, GameType type, GameWorld world) {
|
||||
public Game(List<DGroup> dGroups, GameType type, DGameWorld world) {
|
||||
this.dGroups = dGroups;
|
||||
this.type = type;
|
||||
this.world = world;
|
||||
@ -157,17 +157,17 @@ public class Game {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the GameWorld connected to the Game
|
||||
* @return the DGameWorld connected to the Game
|
||||
*/
|
||||
public GameWorld getWorld() {
|
||||
public DGameWorld getWorld() {
|
||||
return world;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param world
|
||||
* the GameWorld to connect to the Game
|
||||
* the DGameWorld to connect to the Game
|
||||
*/
|
||||
public void setWorld(GameWorld world) {
|
||||
public void setWorld(DGameWorld world) {
|
||||
this.world = world;
|
||||
}
|
||||
|
||||
@ -236,8 +236,8 @@ public class Game {
|
||||
*
|
||||
* @return the unplayed floors
|
||||
*/
|
||||
public List<ResourceWorld> getUnplayedFloors() {
|
||||
List<ResourceWorld> unplayedFloors = new ArrayList<>();
|
||||
public List<DResourceWorld> getUnplayedFloors() {
|
||||
List<DResourceWorld> unplayedFloors = new ArrayList<>();
|
||||
for (DGroup dGroup : dGroups) {
|
||||
if (dGroup.getUnplayedFloors().size() < unplayedFloors.size()) {
|
||||
unplayedFloors = dGroup.getUnplayedFloors();
|
||||
@ -427,7 +427,7 @@ public class Game {
|
||||
return getByDGroup(DGroup.getByPlayer(player));
|
||||
}
|
||||
|
||||
public static Game getByGameWorld(GameWorld gameWorld) {
|
||||
public static Game getByGameWorld(DGameWorld gameWorld) {
|
||||
for (Game game : plugin.getGames()) {
|
||||
if (game.getWorld().equals(gameWorld)) {
|
||||
return game;
|
||||
@ -438,7 +438,7 @@ public class Game {
|
||||
}
|
||||
|
||||
public static Game getByWorld(World world) {
|
||||
GameWorld gameWorld = GameWorld.getByWorld(world);
|
||||
DGameWorld gameWorld = DGameWorld.getByWorld(world);
|
||||
if (gameWorld != null) {
|
||||
return getByGameWorld(gameWorld);
|
||||
} else {
|
||||
|
@ -17,7 +17,7 @@
|
||||
package io.github.dre2n.dungeonsxl.game;
|
||||
|
||||
import io.github.dre2n.commons.util.NumberUtil;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import org.bukkit.Material;
|
||||
@ -254,7 +254,7 @@ public class GamePlaceableBlock {
|
||||
}
|
||||
|
||||
// Can build
|
||||
public static boolean canBuildHere(Block block, BlockFace blockFace, Material mat, GameWorld gameWorld) {
|
||||
public static boolean canBuildHere(Block block, BlockFace blockFace, Material mat, DGameWorld gameWorld) {
|
||||
for (GamePlaceableBlock gamePlacableBlock : gameWorld.getPlaceableBlocks()) {
|
||||
if (gamePlacableBlock.block.getFace(block) != BlockFace.SELF) {
|
||||
continue;
|
||||
|
@ -22,7 +22,7 @@ import io.github.dre2n.dungeonsxl.config.DMessages;
|
||||
import io.github.dre2n.dungeonsxl.game.Game;
|
||||
import io.github.dre2n.dungeonsxl.player.DGamePlayer;
|
||||
import io.github.dre2n.dungeonsxl.player.DGroup;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import org.bukkit.Location;
|
||||
@ -167,7 +167,7 @@ public class DPortal extends GlobalProtection {
|
||||
return;
|
||||
}
|
||||
|
||||
GameWorld target = dGroup.getGameWorld();
|
||||
DGameWorld target = dGroup.getGameWorld();
|
||||
Game game = Game.getByDGroup(dGroup);
|
||||
|
||||
if (target == null && game != null) {
|
||||
@ -186,7 +186,7 @@ public class DPortal extends GlobalProtection {
|
||||
}
|
||||
|
||||
if (target == null && dGroup.getMapName() != null) {
|
||||
target = plugin.getWorlds().getResourceByName(dGroup.getMapName()).instantiateAsGameWorld();//TO DO
|
||||
target = plugin.getDWorlds().getResourceByName(dGroup.getMapName()).instantiateAsGameWorld();//TO DO
|
||||
dGroup.setGameWorld(target);
|
||||
}
|
||||
|
||||
|
@ -469,7 +469,7 @@ public class GameSign extends GlobalProtection {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (plugin.getWorlds().getGameWorlds().size() >= plugin.getMainConfig().getMaxInstances()) {
|
||||
if (plugin.getDWorlds().getGameWorlds().size() >= plugin.getMainConfig().getMaxInstances()) {
|
||||
MessageUtil.sendMessage(player, DMessages.ERROR_TOO_MANY_INSTANCES.getMessage());
|
||||
return true;
|
||||
}
|
||||
|
@ -34,8 +34,8 @@ import io.github.dre2n.dungeonsxl.player.DPermissions;
|
||||
import io.github.dre2n.dungeonsxl.player.DPlayers;
|
||||
import io.github.dre2n.dungeonsxl.sign.DSign;
|
||||
import io.github.dre2n.dungeonsxl.task.RedstoneEventTask;
|
||||
import io.github.dre2n.dungeonsxl.world.EditWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DEditWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
@ -91,15 +91,15 @@ public class BlockListener implements Listener {
|
||||
return;
|
||||
}
|
||||
|
||||
// EditWorld Signs
|
||||
EditWorld editWorld = EditWorld.getByWorld(block.getWorld());
|
||||
// DEditWorld Signs
|
||||
DEditWorld editWorld = DEditWorld.getByWorld(block.getWorld());
|
||||
if (editWorld != null) {
|
||||
editWorld.getSigns().remove(event.getBlock());
|
||||
return;
|
||||
}
|
||||
|
||||
// Deny GameWorld block breaking
|
||||
GameWorld gameWorld = GameWorld.getByWorld(block.getWorld());
|
||||
// Deny DGameWorld block breaking
|
||||
DGameWorld gameWorld = DGameWorld.getByWorld(block.getWorld());
|
||||
if (gameWorld != null) {
|
||||
for (DSign dSign : gameWorld.getDSigns()) {
|
||||
if (dSign.getSign().equals(block)) {
|
||||
@ -128,8 +128,8 @@ public class BlockListener implements Listener {
|
||||
public void onPlace(BlockPlaceEvent event) {
|
||||
Block block = event.getBlock();
|
||||
|
||||
// Deny GameWorld Blocks
|
||||
GameWorld gameWorld = GameWorld.getByWorld(block.getWorld());
|
||||
// Deny DGameWorld Blocks
|
||||
DGameWorld gameWorld = DGameWorld.getByWorld(block.getWorld());
|
||||
if (gameWorld == null) {
|
||||
return;
|
||||
}
|
||||
@ -162,7 +162,7 @@ public class BlockListener implements Listener {
|
||||
Player player = event.getPlayer();
|
||||
Block block = event.getBlock();
|
||||
String[] lines = event.getLines();
|
||||
EditWorld editWorld = EditWorld.getByWorld(player.getWorld());
|
||||
DEditWorld editWorld = DEditWorld.getByWorld(player.getWorld());
|
||||
|
||||
// Group Signs
|
||||
if (editWorld == null) {
|
||||
@ -251,13 +251,13 @@ public class BlockListener implements Listener {
|
||||
}
|
||||
|
||||
// Check GameWorlds
|
||||
GameWorld gameWorld = GameWorld.getByWorld(event.getBlock().getWorld());
|
||||
DGameWorld gameWorld = DGameWorld.getByWorld(event.getBlock().getWorld());
|
||||
if (gameWorld != null) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
// Check EditWorlds
|
||||
EditWorld editWorld = EditWorld.getByWorld(event.getBlock().getWorld());
|
||||
DEditWorld editWorld = DEditWorld.getByWorld(event.getBlock().getWorld());
|
||||
if (editWorld != null) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
@ -21,8 +21,8 @@ import io.github.dre2n.dungeonsxl.game.Game;
|
||||
import io.github.dre2n.dungeonsxl.mob.DMob;
|
||||
import io.github.dre2n.dungeonsxl.player.DGamePlayer;
|
||||
import io.github.dre2n.dungeonsxl.player.DGroup;
|
||||
import io.github.dre2n.dungeonsxl.world.EditWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DEditWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import java.util.List;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
@ -52,7 +52,7 @@ public class EntityListener implements Listener {
|
||||
// Remove drops from breaking Signs
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onItemSpawn(ItemSpawnEvent event) {
|
||||
if (GameWorld.getByWorld(event.getLocation().getWorld()) != null) {
|
||||
if (DGameWorld.getByWorld(event.getLocation().getWorld()) != null) {
|
||||
if (event.getEntity().getItemStack().getType() == Material.SIGN) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
@ -63,8 +63,8 @@ public class EntityListener implements Listener {
|
||||
public void onCreatureSpawn(CreatureSpawnEvent event) {
|
||||
World world = event.getLocation().getWorld();
|
||||
|
||||
EditWorld editWorld = EditWorld.getByWorld(world);
|
||||
GameWorld gameWorld = GameWorld.getByWorld(world);
|
||||
DEditWorld editWorld = DEditWorld.getByWorld(world);
|
||||
DGameWorld gameWorld = DGameWorld.getByWorld(world);
|
||||
|
||||
if (editWorld != null || gameWorld != null) {
|
||||
switch (event.getSpawnReason()) {
|
||||
@ -83,7 +83,7 @@ public class EntityListener implements Listener {
|
||||
|
||||
if (event.getEntity() instanceof LivingEntity) {
|
||||
LivingEntity entity = event.getEntity();
|
||||
GameWorld gameWorld = GameWorld.getByWorld(world);
|
||||
DGameWorld gameWorld = DGameWorld.getByWorld(world);
|
||||
if (gameWorld != null) {
|
||||
if (gameWorld.isPlaying()) {
|
||||
DMob dMob = DMob.getByEntity(entity);
|
||||
@ -98,7 +98,7 @@ public class EntityListener implements Listener {
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onDamage(EntityDamageEvent event) {
|
||||
World world = event.getEntity().getWorld();
|
||||
GameWorld gameWorld = GameWorld.getByWorld(world);
|
||||
DGameWorld gameWorld = DGameWorld.getByWorld(world);
|
||||
|
||||
if (gameWorld == null) {
|
||||
return;
|
||||
@ -138,7 +138,7 @@ public class EntityListener implements Listener {
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onDamageByEntity(EntityDamageByEntityEvent event) {
|
||||
World world = event.getEntity().getWorld();
|
||||
GameWorld gameWorld = GameWorld.getByWorld(world);
|
||||
DGameWorld gameWorld = DGameWorld.getByWorld(world);
|
||||
|
||||
if (gameWorld == null) {
|
||||
return;
|
||||
@ -223,7 +223,7 @@ public class EntityListener implements Listener {
|
||||
public void onFoodLevelChange(FoodLevelChangeEvent event) {
|
||||
World world = event.getEntity().getWorld();
|
||||
|
||||
GameWorld gameWorld = GameWorld.getByWorld(world);
|
||||
DGameWorld gameWorld = DGameWorld.getByWorld(world);
|
||||
if (gameWorld != null) {
|
||||
if (!gameWorld.isPlaying()) {
|
||||
event.setCancelled(true);
|
||||
@ -234,7 +234,7 @@ public class EntityListener implements Listener {
|
||||
// Zombie/skeleton combustion from the sun.
|
||||
@EventHandler(priority = EventPriority.NORMAL)
|
||||
public void onCombust(EntityCombustEvent event) {
|
||||
GameWorld gameWorld = GameWorld.getByWorld(event.getEntity().getWorld());
|
||||
DGameWorld gameWorld = DGameWorld.getByWorld(event.getEntity().getWorld());
|
||||
if (gameWorld != null) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
@ -243,7 +243,7 @@ public class EntityListener implements Listener {
|
||||
// Allow Other combustion
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onCombustByEntity(EntityCombustByEntityEvent event) {
|
||||
GameWorld gameWorld = GameWorld.getByWorld(event.getEntity().getWorld());
|
||||
DGameWorld gameWorld = DGameWorld.getByWorld(event.getEntity().getWorld());
|
||||
if (gameWorld != null) {
|
||||
if (event.isCancelled()) {
|
||||
event.setCancelled(false);
|
||||
@ -254,7 +254,7 @@ public class EntityListener implements Listener {
|
||||
// Explosions
|
||||
@EventHandler
|
||||
public void onExplode(EntityExplodeEvent event) {
|
||||
GameWorld gameWorld = GameWorld.getByWorld(event.getEntity().getWorld());
|
||||
DGameWorld gameWorld = DGameWorld.getByWorld(event.getEntity().getWorld());
|
||||
|
||||
if (gameWorld != null) {
|
||||
if (event.getEntity() instanceof LivingEntity) {
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
package io.github.dre2n.dungeonsxl.listener;
|
||||
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.hanging.HangingBreakByEntityEvent;
|
||||
@ -28,7 +28,7 @@ public class HangingListener implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onHangingBreakByEntity(HangingBreakByEntityEvent event) {
|
||||
GameWorld gameWorld = GameWorld.getByWorld(event.getEntity().getWorld());
|
||||
DGameWorld gameWorld = DGameWorld.getByWorld(event.getEntity().getWorld());
|
||||
if (gameWorld != null) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
@ -42,8 +42,8 @@ import io.github.dre2n.dungeonsxl.sign.OpenDoorSign;
|
||||
import io.github.dre2n.dungeonsxl.task.RespawnTask;
|
||||
import io.github.dre2n.dungeonsxl.trigger.InteractTrigger;
|
||||
import io.github.dre2n.dungeonsxl.trigger.UseItemTrigger;
|
||||
import io.github.dre2n.dungeonsxl.world.EditWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DEditWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import java.util.ArrayList;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
@ -87,7 +87,7 @@ public class PlayerListener implements Listener {
|
||||
public void onDeath(PlayerDeathEvent event) {
|
||||
Player player = event.getEntity();
|
||||
|
||||
GameWorld gameWorld = GameWorld.getByWorld(player.getLocation().getWorld());
|
||||
DGameWorld gameWorld = DGameWorld.getByWorld(player.getLocation().getWorld());
|
||||
if (gameWorld == null) {
|
||||
return;
|
||||
}
|
||||
@ -149,7 +149,7 @@ public class PlayerListener implements Listener {
|
||||
|
||||
if (clickedBlock != null) {
|
||||
// Block Enderchests
|
||||
if (GameWorld.getByWorld(player.getWorld()) != null || EditWorld.getByWorld(player.getWorld()) != null) {
|
||||
if (DGameWorld.getByWorld(player.getWorld()) != null || DEditWorld.getByWorld(player.getWorld()) != null) {
|
||||
if (event.getAction() != Action.LEFT_CLICK_BLOCK) {
|
||||
if (clickedBlock.getType() == Material.ENDER_CHEST) {
|
||||
if (!DPermissions.hasPermission(player, DPermissions.BYPASS)) {
|
||||
@ -167,7 +167,7 @@ public class PlayerListener implements Listener {
|
||||
}
|
||||
|
||||
// Block Dispensers
|
||||
if (GameWorld.getByWorld(player.getWorld()) != null) {
|
||||
if (DGameWorld.getByWorld(player.getWorld()) != null) {
|
||||
if (event.getAction() != Action.LEFT_CLICK_BLOCK) {
|
||||
if (clickedBlock.getType() == Material.DISPENSER) {
|
||||
if (!DPermissions.hasPermission(player, DPermissions.BYPASS)) {
|
||||
@ -209,7 +209,7 @@ public class PlayerListener implements Listener {
|
||||
}
|
||||
|
||||
// Copy/Paste a Sign and Block-info
|
||||
if (EditWorld.getByWorld(player.getWorld()) != null) {
|
||||
if (DEditWorld.getByWorld(player.getWorld()) != null) {
|
||||
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
|
||||
if (item.getType() == Material.STICK) {
|
||||
DEditPlayer dPlayer = DEditPlayer.getByPlayer(player);
|
||||
@ -222,7 +222,7 @@ public class PlayerListener implements Listener {
|
||||
}
|
||||
|
||||
// Trigger UseItem Signs
|
||||
GameWorld gameWorld = GameWorld.getByWorld(player.getWorld());
|
||||
DGameWorld gameWorld = DGameWorld.getByWorld(player.getWorld());
|
||||
if (gameWorld != null) {
|
||||
if (event.getAction() == Action.RIGHT_CLICK_BLOCK || event.getAction() == Action.RIGHT_CLICK_AIR) {
|
||||
String name = null;
|
||||
@ -272,8 +272,8 @@ public class PlayerListener implements Listener {
|
||||
DGamePlayer dPlayer = DGamePlayer.getByPlayer(player);
|
||||
if (dPlayer != null) {
|
||||
|
||||
// Check GameWorld Signs
|
||||
GameWorld gameWorld = GameWorld.getByWorld(player.getWorld());
|
||||
// Check DGameWorld Signs
|
||||
DGameWorld gameWorld = DGameWorld.getByWorld(player.getWorld());
|
||||
if (gameWorld != null) {
|
||||
|
||||
// Trigger InteractTrigger
|
||||
@ -360,7 +360,7 @@ public class PlayerListener implements Listener {
|
||||
}
|
||||
|
||||
if (dPlayer instanceof DEditPlayer) {
|
||||
EditWorld editWorld = EditWorld.getByWorld(((DEditPlayer) dPlayer).getWorld());
|
||||
DEditWorld editWorld = DEditWorld.getByWorld(((DEditPlayer) dPlayer).getWorld());
|
||||
if (editWorld == null) {
|
||||
return;
|
||||
}
|
||||
@ -375,7 +375,7 @@ public class PlayerListener implements Listener {
|
||||
} else if (dPlayer instanceof DGamePlayer) {
|
||||
DGamePlayer gamePlayer = (DGamePlayer) dPlayer;
|
||||
|
||||
GameWorld gameWorld = GameWorld.getByWorld(gamePlayer.getWorld());
|
||||
DGameWorld gameWorld = DGameWorld.getByWorld(gamePlayer.getWorld());
|
||||
|
||||
if (gameWorld == null) {
|
||||
return;
|
||||
@ -497,7 +497,7 @@ public class PlayerListener implements Listener {
|
||||
target = dSavePlayer.getOldLocation();
|
||||
}
|
||||
|
||||
if (EditWorld.getByWorld(player.getWorld()) != null || GameWorld.getByWorld(player.getWorld()) != null) {
|
||||
if (DEditWorld.getByWorld(player.getWorld()) != null || DGameWorld.getByWorld(player.getWorld()) != null) {
|
||||
player.teleport(target);
|
||||
}
|
||||
}
|
||||
@ -538,7 +538,7 @@ public class PlayerListener implements Listener {
|
||||
}
|
||||
|
||||
if (dGroup.getGameWorld() == null) {
|
||||
dGroup.setGameWorld(plugin.getWorlds().getResourceByName(DGroup.getByPlayer(player).getMapName()).instantiateAsGameWorld());// TO DO
|
||||
dGroup.setGameWorld(plugin.getDWorlds().getResourceByName(DGroup.getByPlayer(player).getMapName()).instantiateAsGameWorld());// TO DO
|
||||
dGroup.getGameWorld().setTutorial(true);
|
||||
}
|
||||
|
||||
@ -578,7 +578,7 @@ public class PlayerListener implements Listener {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (plugin.getWorlds().getGameWorlds().size() >= config.getMaxInstances()) {
|
||||
if (plugin.getDWorlds().getGameWorlds().size() >= config.getMaxInstances()) {
|
||||
event.setResult(PlayerLoginEvent.Result.KICK_FULL);
|
||||
event.setKickMessage(DMessages.ERROR_TOO_MANY_TUTORIALS.getMessage());
|
||||
}
|
||||
@ -646,7 +646,7 @@ public class PlayerListener implements Listener {
|
||||
|
||||
if (!plugin.getMainConfig().getOpenInventories() && !DPermissions.hasPermission(event.getPlayer(), DPermissions.INSECURE)) {
|
||||
World world = event.getPlayer().getWorld();
|
||||
if (event.getInventory().getType() != InventoryType.CREATIVE && EditWorld.getByWorld(world) != null) {
|
||||
if (event.getInventory().getType() != InventoryType.CREATIVE && DEditWorld.getByWorld(world) != null) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
@ -16,8 +16,8 @@
|
||||
*/
|
||||
package io.github.dre2n.dungeonsxl.listener;
|
||||
|
||||
import io.github.dre2n.dungeonsxl.world.EditWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DEditWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
@ -31,7 +31,7 @@ public class WorldListener implements Listener {
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onChunkUnload(ChunkUnloadEvent event) {
|
||||
GameWorld gameWorld = GameWorld.getByWorld(event.getWorld());
|
||||
DGameWorld gameWorld = DGameWorld.getByWorld(event.getWorld());
|
||||
if (gameWorld != null) {
|
||||
if (gameWorld.getLoadedChunks().contains(event.getChunk())) {
|
||||
event.setCancelled(true);
|
||||
@ -41,7 +41,7 @@ public class WorldListener implements Listener {
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onWeatherChange(WeatherChangeEvent event) {
|
||||
if (EditWorld.getByWorld(event.getWorld()) != null) {
|
||||
if (DEditWorld.getByWorld(event.getWorld()) != null) {
|
||||
if (event.toWeatherState()) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
package io.github.dre2n.dungeonsxl.mob;
|
||||
|
||||
import io.github.dre2n.commons.util.NumberUtil;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import net.citizensnpcs.api.CitizensAPI;
|
||||
@ -84,7 +84,7 @@ public class CitizensMobProvider implements ExternalMobProvider {
|
||||
npc.spawn(location);
|
||||
spawnedNPCs.add(npc);
|
||||
|
||||
GameWorld gameWorld = GameWorld.getByWorld(location.getWorld());
|
||||
DGameWorld gameWorld = DGameWorld.getByWorld(location.getWorld());
|
||||
new DMob((LivingEntity) npc.getEntity(), gameWorld, null, mob);
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ import io.github.dre2n.dungeonsxl.event.dmob.DMobSpawnEvent;
|
||||
import io.github.dre2n.dungeonsxl.game.Game;
|
||||
import io.github.dre2n.dungeonsxl.trigger.MobTrigger;
|
||||
import io.github.dre2n.dungeonsxl.trigger.WaveTrigger;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
import org.bukkit.Bukkit;
|
||||
@ -41,7 +41,7 @@ public class DMob {
|
||||
|
||||
private String trigger;
|
||||
|
||||
public DMob(LivingEntity entity, GameWorld gameWorld, DMobType type) {
|
||||
public DMob(LivingEntity entity, DGameWorld gameWorld, DMobType type) {
|
||||
gameWorld.addDMob(this);
|
||||
|
||||
this.entity = entity;
|
||||
@ -64,7 +64,7 @@ public class DMob {
|
||||
}
|
||||
}
|
||||
|
||||
public DMob(LivingEntity entity, GameWorld gameWorld, DMobType type, String trigger) {
|
||||
public DMob(LivingEntity entity, DGameWorld gameWorld, DMobType type, String trigger) {
|
||||
this(entity, gameWorld, type);
|
||||
this.trigger = trigger;
|
||||
}
|
||||
@ -101,7 +101,7 @@ public class DMob {
|
||||
/* Actions */
|
||||
public void onDeath(EntityDeathEvent event) {
|
||||
LivingEntity victim = event.getEntity();
|
||||
GameWorld gameWorld = GameWorld.getByWorld(victim.getWorld());
|
||||
DGameWorld gameWorld = DGameWorld.getByWorld(victim.getWorld());
|
||||
String name = null;
|
||||
|
||||
if (gameWorld == null) {
|
||||
@ -153,7 +153,7 @@ public class DMob {
|
||||
|
||||
/* Statics */
|
||||
public static DMob getByEntity(Entity entity) {
|
||||
GameWorld gameWorld = GameWorld.getByWorld(entity.getWorld());
|
||||
DGameWorld gameWorld = DGameWorld.getByWorld(entity.getWorld());
|
||||
|
||||
for (DMob dMob : gameWorld.getDMobs()) {
|
||||
if (dMob.entity == entity) {
|
||||
|
@ -20,7 +20,7 @@ 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.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
@ -358,7 +358,7 @@ public class DMobType {
|
||||
}
|
||||
|
||||
/* Actions */
|
||||
public void spawn(GameWorld gameWorld, Location loc) {
|
||||
public void spawn(DGameWorld gameWorld, Location loc) {
|
||||
if (type == null) {
|
||||
return;
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ import io.github.dre2n.commons.util.messageutil.MessageUtil;
|
||||
import io.github.dre2n.commons.util.playerutil.PlayerUtil;
|
||||
import io.github.dre2n.dungeonsxl.config.DMessages;
|
||||
import io.github.dre2n.dungeonsxl.event.dplayer.DPlayerUpdateEvent;
|
||||
import io.github.dre2n.dungeonsxl.world.EditWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DEditWorld;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.GameMode;
|
||||
@ -32,7 +32,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.block.SignChangeEvent;
|
||||
|
||||
/**
|
||||
* Represents a player in an EditWorld.
|
||||
* Represents a player in an DEditWorld.
|
||||
*
|
||||
* @author Daniel Saukel
|
||||
*/
|
||||
@ -40,7 +40,7 @@ public class DEditPlayer extends DInstancePlayer {
|
||||
|
||||
private String[] linesCopy;
|
||||
|
||||
public DEditPlayer(DGlobalPlayer player, EditWorld world) {
|
||||
public DEditPlayer(DGlobalPlayer player, DEditWorld world) {
|
||||
this(player.getPlayer(), world.getWorld());
|
||||
}
|
||||
|
||||
@ -50,7 +50,7 @@ public class DEditPlayer extends DInstancePlayer {
|
||||
player.setGameMode(GameMode.CREATIVE);
|
||||
clearPlayerData();
|
||||
|
||||
Location teleport = EditWorld.getByWorld(world).getLobbyLocation();
|
||||
Location teleport = DEditWorld.getByWorld(world).getLobbyLocation();
|
||||
if (teleport == null) {
|
||||
PlayerUtil.secureTeleport(player, world.getSpawnLocation());
|
||||
} else {
|
||||
@ -95,7 +95,7 @@ public class DEditPlayer extends DInstancePlayer {
|
||||
}
|
||||
|
||||
/**
|
||||
* Escape the EditWorld without saving.
|
||||
* Escape the DEditWorld without saving.
|
||||
*/
|
||||
public void escape() {
|
||||
delete();
|
||||
@ -137,7 +137,7 @@ public class DEditPlayer extends DInstancePlayer {
|
||||
|
||||
getSavePlayer().reset(false);
|
||||
|
||||
EditWorld editWorld = EditWorld.getByWorld(getWorld());
|
||||
DEditWorld editWorld = DEditWorld.getByWorld(getWorld());
|
||||
if (editWorld != null) {
|
||||
editWorld.save();
|
||||
}
|
||||
@ -145,7 +145,7 @@ public class DEditPlayer extends DInstancePlayer {
|
||||
|
||||
@Override
|
||||
public void sendMessage(String message) {
|
||||
EditWorld editWorld = EditWorld.getByWorld(getWorld());
|
||||
DEditWorld editWorld = DEditWorld.getByWorld(getWorld());
|
||||
editWorld.sendMessage(message);
|
||||
|
||||
for (DGlobalPlayer player : plugin.getDPlayers().getDGlobalPlayers()) {
|
||||
@ -162,7 +162,7 @@ public class DEditPlayer extends DInstancePlayer {
|
||||
boolean locationValid = true;
|
||||
Location teleportLocation = player.getLocation();
|
||||
|
||||
EditWorld editWorld = EditWorld.getByWorld(getWorld());
|
||||
DEditWorld editWorld = DEditWorld.getByWorld(getWorld());
|
||||
|
||||
if (!getPlayer().getWorld().equals(getWorld())) {
|
||||
locationValid = false;
|
||||
|
@ -38,8 +38,8 @@ import io.github.dre2n.dungeonsxl.requirement.Requirement;
|
||||
import io.github.dre2n.dungeonsxl.reward.DLootInventory;
|
||||
import io.github.dre2n.dungeonsxl.reward.Reward;
|
||||
import io.github.dre2n.dungeonsxl.trigger.DistanceTrigger;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.ResourceWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DResourceWorld;
|
||||
import java.io.File;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import org.bukkit.ChatColor;
|
||||
@ -56,7 +56,7 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
|
||||
/**
|
||||
* Represents a player in a GameWorld.
|
||||
* Represents a player in a DGameWorld.
|
||||
*
|
||||
* @author Frank Baumann, Tobias Schmitz, Milan Albrecht, Daniel Saukel
|
||||
*/
|
||||
@ -77,7 +77,7 @@ public class DGamePlayer extends DInstancePlayer {
|
||||
private int initialLives = -1;
|
||||
private int lives;
|
||||
|
||||
public DGamePlayer(Player player, GameWorld gameWorld) {
|
||||
public DGamePlayer(Player player, DGameWorld gameWorld) {
|
||||
this(player, gameWorld.getWorld());
|
||||
}
|
||||
|
||||
@ -103,7 +103,7 @@ public class DGamePlayer extends DInstancePlayer {
|
||||
initialLives = rules.getInitialLives();
|
||||
lives = initialLives;
|
||||
|
||||
Location teleport = GameWorld.getByWorld(world).getLobbyLocation();
|
||||
Location teleport = DGameWorld.getByWorld(world).getLobbyLocation();
|
||||
if (teleport == null) {
|
||||
PlayerUtil.secureTeleport(player, world.getSpawnLocation());
|
||||
} else {
|
||||
@ -129,7 +129,7 @@ public class DGamePlayer extends DInstancePlayer {
|
||||
return false;
|
||||
}
|
||||
|
||||
GameWorld gameWorld = dGroup.getGameWorld();
|
||||
DGameWorld gameWorld = dGroup.getGameWorld();
|
||||
if (gameWorld == null) {
|
||||
return false;
|
||||
}
|
||||
@ -392,7 +392,7 @@ public class DGamePlayer extends DInstancePlayer {
|
||||
dGroup.removePlayer(getPlayer(), message);
|
||||
}
|
||||
|
||||
GameWorld gameWorld = GameWorld.getByWorld(getWorld());
|
||||
DGameWorld gameWorld = DGameWorld.getByWorld(getWorld());
|
||||
Game game = Game.getByGameWorld(gameWorld);
|
||||
if (game != null) {
|
||||
if (finished) {
|
||||
@ -639,7 +639,7 @@ public class DGamePlayer extends DInstancePlayer {
|
||||
* @param specifiedFloor
|
||||
* the name of the next floor
|
||||
*/
|
||||
public void finishFloor(ResourceWorld specifiedFloor) {
|
||||
public void finishFloor(DResourceWorld specifiedFloor) {
|
||||
MessageUtil.sendMessage(getPlayer(), DMessages.PLAYER_FINISHED_DUNGEON.getMessage());
|
||||
finished = true;
|
||||
|
||||
@ -681,7 +681,7 @@ public class DGamePlayer extends DInstancePlayer {
|
||||
|
||||
DungeonConfig dConfig = dGroup.getDungeon().getConfig();
|
||||
int random = NumberUtil.generateRandomInt(0, dConfig.getFloors().size());
|
||||
ResourceWorld newFloor = dGroup.getUnplayedFloors().get(random);
|
||||
DResourceWorld newFloor = dGroup.getUnplayedFloors().get(random);
|
||||
if (dConfig.getFloorCount() == dGroup.getFloorCount() - 1) {
|
||||
newFloor = dConfig.getEndFloor();
|
||||
|
||||
@ -700,7 +700,7 @@ public class DGamePlayer extends DInstancePlayer {
|
||||
dGroup.removeUnplayedFloor(dGroup.getGameWorld().getResource(), false);
|
||||
dGroup.setMapName(newFloor.getName());
|
||||
|
||||
GameWorld gameWorld = null;
|
||||
DGameWorld gameWorld = null;
|
||||
if (newFloor != null) {
|
||||
gameWorld = newFloor.instantiateAsGameWorld();
|
||||
}
|
||||
@ -794,7 +794,7 @@ public class DGamePlayer extends DInstancePlayer {
|
||||
|
||||
@Override
|
||||
public void sendMessage(String message) {
|
||||
GameWorld gameWorld = GameWorld.getByWorld(getWorld());
|
||||
DGameWorld gameWorld = DGameWorld.getByWorld(getWorld());
|
||||
gameWorld.sendMessage(message);
|
||||
|
||||
for (DGlobalPlayer player : plugin.getDPlayers().getDGlobalPlayers()) {
|
||||
@ -820,7 +820,7 @@ public class DGamePlayer extends DInstancePlayer {
|
||||
boolean kick = false;
|
||||
boolean triggerAllInDistance = false;
|
||||
|
||||
GameWorld gameWorld = GameWorld.getByWorld(getWorld());
|
||||
DGameWorld gameWorld = DGameWorld.getByWorld(getWorld());
|
||||
|
||||
if (!updateSecond) {
|
||||
if (!getPlayer().getWorld().equals(getWorld())) {
|
||||
|
@ -33,8 +33,8 @@ import io.github.dre2n.dungeonsxl.global.GroupSign;
|
||||
import io.github.dre2n.dungeonsxl.requirement.Requirement;
|
||||
import io.github.dre2n.dungeonsxl.reward.Reward;
|
||||
import io.github.dre2n.dungeonsxl.task.TimeIsRunningTask;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.ResourceWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DResourceWorld;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
@ -59,13 +59,13 @@ public class DGroup {
|
||||
private Dungeon dungeon;
|
||||
private String dungeonName;
|
||||
private String mapName;
|
||||
private List<ResourceWorld> unplayedFloors = new ArrayList<>();
|
||||
private GameWorld gameWorld;
|
||||
private List<DResourceWorld> unplayedFloors = new ArrayList<>();
|
||||
private DGameWorld gameWorld;
|
||||
private boolean playing;
|
||||
private int floorCount;
|
||||
private List<Reward> rewards = new ArrayList<>();
|
||||
private BukkitTask timeIsRunningTask;
|
||||
private ResourceWorld nextFloor;
|
||||
private DResourceWorld nextFloor;
|
||||
|
||||
public DGroup(Player player) {
|
||||
this("Group_" + plugin.getDGroups().size(), player);
|
||||
@ -343,7 +343,7 @@ public class DGroup {
|
||||
/**
|
||||
* @return the gameWorld
|
||||
*/
|
||||
public GameWorld getGameWorld() {
|
||||
public DGameWorld getGameWorld() {
|
||||
return gameWorld;
|
||||
}
|
||||
|
||||
@ -351,7 +351,7 @@ public class DGroup {
|
||||
* @param gameWorld
|
||||
* the gameWorld to set
|
||||
*/
|
||||
public void setGameWorld(GameWorld gameWorld) {
|
||||
public void setGameWorld(DGameWorld gameWorld) {
|
||||
this.gameWorld = gameWorld;
|
||||
}
|
||||
|
||||
@ -422,7 +422,7 @@ public class DGroup {
|
||||
* the name to set
|
||||
*/
|
||||
public void setMapName(String name) {
|
||||
if (plugin.getWorlds().exists(name)) {
|
||||
if (plugin.getDWorlds().exists(name)) {
|
||||
mapName = name;
|
||||
}
|
||||
}
|
||||
@ -430,7 +430,7 @@ public class DGroup {
|
||||
/**
|
||||
* @return the unplayed floors
|
||||
*/
|
||||
public List<ResourceWorld> getUnplayedFloors() {
|
||||
public List<DResourceWorld> getUnplayedFloors() {
|
||||
return unplayedFloors;
|
||||
}
|
||||
|
||||
@ -438,7 +438,7 @@ public class DGroup {
|
||||
* @param unplayedFloor
|
||||
* the unplayed floor to add
|
||||
*/
|
||||
public void addUnplayedFloor(ResourceWorld unplayedFloor) {
|
||||
public void addUnplayedFloor(DResourceWorld unplayedFloor) {
|
||||
unplayedFloors.add(unplayedFloor);
|
||||
}
|
||||
|
||||
@ -448,7 +448,7 @@ public class DGroup {
|
||||
* @param force
|
||||
* remove the floor even if removeWhenPlayed is disabled
|
||||
*/
|
||||
public void removeUnplayedFloor(ResourceWorld unplayedFloor, boolean force) {
|
||||
public void removeUnplayedFloor(DResourceWorld unplayedFloor, boolean force) {
|
||||
if (getDungeon().getConfig().getRemoveWhenPlayed() || force) {
|
||||
unplayedFloors.remove(unplayedFloor);
|
||||
}
|
||||
@ -546,7 +546,7 @@ public class DGroup {
|
||||
/**
|
||||
* @return the next floor the group will enter
|
||||
*/
|
||||
public ResourceWorld getNextFloor() {
|
||||
public DResourceWorld getNextFloor() {
|
||||
return nextFloor;
|
||||
}
|
||||
|
||||
@ -554,7 +554,7 @@ public class DGroup {
|
||||
* @param floor
|
||||
* the next floor to set
|
||||
*/
|
||||
public void setNextFloor(ResourceWorld floor) {
|
||||
public void setNextFloor(DResourceWorld floor) {
|
||||
nextFloor = floor;
|
||||
}
|
||||
|
||||
@ -781,10 +781,10 @@ public class DGroup {
|
||||
|
||||
/**
|
||||
* @param gameWorld
|
||||
* the GameWorld to check
|
||||
* @return a List of DGroups in this GameWorld
|
||||
* the DGameWorld to check
|
||||
* @return a List of DGroups in this DGameWorld
|
||||
*/
|
||||
public static List<DGroup> getByGameWorld(GameWorld gameWorld) {
|
||||
public static List<DGroup> getByGameWorld(DGameWorld gameWorld) {
|
||||
List<DGroup> dGroups = new ArrayList<>();
|
||||
for (DGroup dGroup : plugin.getDGroups()) {
|
||||
if (dGroup.getGameWorld().equals(gameWorld)) {
|
||||
|
@ -21,7 +21,7 @@ import io.github.dre2n.dungeonsxl.DungeonsXL;
|
||||
import io.github.dre2n.dungeonsxl.config.DMessages;
|
||||
import io.github.dre2n.dungeonsxl.player.DGamePlayer;
|
||||
import io.github.dre2n.dungeonsxl.player.DGroup;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import net.milkbowl.vault.item.ItemInfo;
|
||||
import net.milkbowl.vault.item.Items;
|
||||
import org.bukkit.Bukkit;
|
||||
@ -43,11 +43,11 @@ public class RewardChest {
|
||||
// Variables
|
||||
private boolean used = false;
|
||||
private Chest chest;
|
||||
private GameWorld gameWorld;
|
||||
private DGameWorld gameWorld;
|
||||
private double moneyReward;
|
||||
private int levelReward;
|
||||
|
||||
public RewardChest(Block chest, GameWorld gameWorld, double moneyReward, int levelReward) {
|
||||
public RewardChest(Block chest, DGameWorld gameWorld, double moneyReward, int levelReward) {
|
||||
if (!(chest.getState() instanceof Chest)) {
|
||||
return;
|
||||
}
|
||||
@ -93,7 +93,7 @@ public class RewardChest {
|
||||
/**
|
||||
* @return the gameWorld
|
||||
*/
|
||||
public GameWorld getGameWorld() {
|
||||
public DGameWorld getGameWorld() {
|
||||
return gameWorld;
|
||||
}
|
||||
|
||||
@ -101,7 +101,7 @@ public class RewardChest {
|
||||
* @param gameWorld
|
||||
* the gameWorld to set
|
||||
*/
|
||||
public void setGameWorld(GameWorld gameWorld) {
|
||||
public void setGameWorld(DGameWorld gameWorld) {
|
||||
this.gameWorld = gameWorld;
|
||||
}
|
||||
|
||||
@ -227,7 +227,7 @@ public class RewardChest {
|
||||
public static void onOpenInventory(InventoryOpenEvent event) {
|
||||
InventoryView inventory = event.getView();
|
||||
|
||||
GameWorld gameWorld = GameWorld.getByWorld(event.getPlayer().getWorld());
|
||||
DGameWorld gameWorld = DGameWorld.getByWorld(event.getPlayer().getWorld());
|
||||
|
||||
if (gameWorld == null) {
|
||||
return;
|
||||
|
@ -17,7 +17,7 @@
|
||||
package io.github.dre2n.dungeonsxl.sign;
|
||||
|
||||
import io.github.dre2n.commons.util.NumberUtil;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Sign;
|
||||
|
||||
@ -36,7 +36,7 @@ public class BlockSign extends DSign {
|
||||
private byte offBlockData = 0x0;
|
||||
private byte onBlockData = 0x0;
|
||||
|
||||
public BlockSign(Sign sign, String[] lines, GameWorld gameWorld) {
|
||||
public BlockSign(Sign sign, String[] lines, DGameWorld gameWorld) {
|
||||
super(sign, lines, gameWorld);
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ 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.dungeonsxl.player.DGamePlayer;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Sign;
|
||||
@ -36,7 +36,7 @@ public class CheckpointSign extends DSign {
|
||||
private boolean initialized;
|
||||
private CopyOnWriteArrayList<DGamePlayer> done = new CopyOnWriteArrayList<>();
|
||||
|
||||
public CheckpointSign(Sign sign, String[] lines, GameWorld gameWorld) {
|
||||
public CheckpointSign(Sign sign, String[] lines, DGameWorld gameWorld) {
|
||||
super(sign, lines, gameWorld);
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@ package io.github.dre2n.dungeonsxl.sign;
|
||||
|
||||
import io.github.dre2n.commons.util.NumberUtil;
|
||||
import io.github.dre2n.dungeonsxl.reward.RewardChest;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Sign;
|
||||
|
||||
@ -33,7 +33,7 @@ public class ChestSign extends DSign {
|
||||
private double moneyReward;
|
||||
private int levelReward;
|
||||
|
||||
public ChestSign(Sign sign, String[] lines, GameWorld gameWorld) {
|
||||
public ChestSign(Sign sign, String[] lines, DGameWorld gameWorld) {
|
||||
super(sign, lines, gameWorld);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
package io.github.dre2n.dungeonsxl.sign;
|
||||
|
||||
import io.github.dre2n.commons.util.NumberUtil;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Sign;
|
||||
@ -29,7 +29,7 @@ public class ChunkUpdaterSign extends DSign {
|
||||
|
||||
private DSignType type = DSignTypeDefault.CHUNK_UPDATER;
|
||||
|
||||
public ChunkUpdaterSign(Sign sign, String[] lines, GameWorld gameWorld) {
|
||||
public ChunkUpdaterSign(Sign sign, String[] lines, DGameWorld gameWorld) {
|
||||
super(sign, lines, gameWorld);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
package io.github.dre2n.dungeonsxl.sign;
|
||||
|
||||
import io.github.dre2n.dungeonsxl.player.DClass;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.block.Sign;
|
||||
|
||||
@ -30,7 +30,7 @@ public class ClassesSign extends DSign {
|
||||
|
||||
private DClass dClass;
|
||||
|
||||
public ClassesSign(Sign sign, String[] lines, GameWorld gameWorld) {
|
||||
public ClassesSign(Sign sign, String[] lines, DGameWorld gameWorld) {
|
||||
super(sign, lines, gameWorld);
|
||||
dClass = plugin.getDClasses().getByName(sign.getLine(1));
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ 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.dungeonsxl.trigger.InteractTrigger;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
@ -44,7 +44,7 @@ public class CommandSign extends DSign {
|
||||
private String executor;
|
||||
private boolean initialized;
|
||||
|
||||
public CommandSign(Sign sign, String[] lines, GameWorld gameWorld) {
|
||||
public CommandSign(Sign sign, String[] lines, DGameWorld gameWorld) {
|
||||
super(sign, lines, gameWorld);
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@ package io.github.dre2n.dungeonsxl.sign;
|
||||
|
||||
import io.github.dre2n.commons.util.NumberUtil;
|
||||
import io.github.dre2n.dungeonsxl.task.MobSpawnTask;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Sign;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
@ -40,7 +40,7 @@ public class DMobSign extends DSign implements MobSign {
|
||||
private boolean active;
|
||||
private BukkitTask task;
|
||||
|
||||
public DMobSign(Sign sign, String[] lines, GameWorld gameWorld) {
|
||||
public DMobSign(Sign sign, String[] lines, DGameWorld gameWorld) {
|
||||
super(sign, lines, gameWorld);
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@ import io.github.dre2n.dungeonsxl.DungeonsXL;
|
||||
import io.github.dre2n.dungeonsxl.event.dsign.DSignRegistrationEvent;
|
||||
import io.github.dre2n.dungeonsxl.game.Game;
|
||||
import io.github.dre2n.dungeonsxl.trigger.Trigger;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.HashSet;
|
||||
@ -38,12 +38,12 @@ public abstract class DSign {
|
||||
|
||||
private Sign sign;
|
||||
protected String[] lines;
|
||||
private GameWorld gameWorld;
|
||||
private DGameWorld gameWorld;
|
||||
|
||||
// List of Triggers
|
||||
private Set<Trigger> triggers = new HashSet<>();
|
||||
|
||||
public DSign(Sign sign, String[] lines, GameWorld gameWorld) {
|
||||
public DSign(Sign sign, String[] lines, DGameWorld gameWorld) {
|
||||
this.sign = sign;
|
||||
this.lines = lines;
|
||||
this.gameWorld = gameWorld;
|
||||
@ -108,7 +108,7 @@ public abstract class DSign {
|
||||
/**
|
||||
* @return the gameWorld
|
||||
*/
|
||||
public GameWorld getGameWorld() {
|
||||
public DGameWorld getGameWorld() {
|
||||
return gameWorld;
|
||||
}
|
||||
|
||||
@ -185,11 +185,11 @@ public abstract class DSign {
|
||||
return !triggers.isEmpty();
|
||||
}
|
||||
|
||||
public static DSign create(Sign sign, GameWorld gameWorld) {
|
||||
public static DSign create(Sign sign, DGameWorld gameWorld) {
|
||||
return create(sign, sign.getLines(), gameWorld);
|
||||
}
|
||||
|
||||
public static DSign create(Sign sign, String[] lines, GameWorld gameWorld) {
|
||||
public static DSign create(Sign sign, String[] lines, DGameWorld gameWorld) {
|
||||
DSign dSign = null;
|
||||
|
||||
for (DSignType type : plugin.getDSigns().getDSigns()) {
|
||||
@ -198,7 +198,7 @@ public abstract class DSign {
|
||||
}
|
||||
|
||||
try {
|
||||
Constructor<? extends DSign> constructor = type.getHandler().getConstructor(Sign.class, String[].class, GameWorld.class);
|
||||
Constructor<? extends DSign> constructor = type.getHandler().getConstructor(Sign.class, String[].class, DGameWorld.class);
|
||||
dSign = constructor.newInstance(sign, lines, gameWorld);
|
||||
|
||||
} catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException exception) {
|
||||
|
@ -19,7 +19,7 @@ package io.github.dre2n.dungeonsxl.sign;
|
||||
import io.github.dre2n.caliburn.item.UniversalItem;
|
||||
import io.github.dre2n.commons.util.NumberUtil;
|
||||
import io.github.dre2n.dungeonsxl.task.DropItemTask;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Sign;
|
||||
@ -35,7 +35,7 @@ public class DropSign extends DSign {
|
||||
private ItemStack item;
|
||||
private double interval = -1;
|
||||
|
||||
public DropSign(Sign sign, String[] lines, GameWorld gameWorld) {
|
||||
public DropSign(Sign sign, String[] lines, DGameWorld gameWorld) {
|
||||
super(sign, lines, gameWorld);
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@ package io.github.dre2n.dungeonsxl.sign;
|
||||
|
||||
import io.github.dre2n.dungeonsxl.player.DGamePlayer;
|
||||
import io.github.dre2n.dungeonsxl.trigger.InteractTrigger;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Sign;
|
||||
@ -31,7 +31,7 @@ public class EndSign extends DSign {
|
||||
|
||||
private DSignType type = DSignTypeDefault.END;
|
||||
|
||||
public EndSign(Sign sign, String[] lines, GameWorld gameWorld) {
|
||||
public EndSign(Sign sign, String[] lines, DGameWorld gameWorld) {
|
||||
super(sign, lines, gameWorld);
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ import io.github.dre2n.commons.util.NumberUtil;
|
||||
import io.github.dre2n.dungeonsxl.mob.ExternalMobPlugin;
|
||||
import io.github.dre2n.dungeonsxl.mob.ExternalMobProvider;
|
||||
import io.github.dre2n.dungeonsxl.task.ExternalMobSpawnTask;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.bukkit.Location;
|
||||
@ -52,7 +52,7 @@ public class ExternalMobSign extends DSign implements MobSign {
|
||||
private LivingEntity externalMob;
|
||||
private List<Entity> externalMobs = new ArrayList<>();
|
||||
|
||||
public ExternalMobSign(Sign sign, String[] lines, GameWorld gameWorld) {
|
||||
public ExternalMobSign(Sign sign, String[] lines, DGameWorld gameWorld) {
|
||||
super(sign, lines, gameWorld);
|
||||
}
|
||||
|
||||
|
@ -18,8 +18,8 @@ package io.github.dre2n.dungeonsxl.sign;
|
||||
|
||||
import io.github.dre2n.dungeonsxl.player.DGamePlayer;
|
||||
import io.github.dre2n.dungeonsxl.trigger.InteractTrigger;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.ResourceWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DResourceWorld;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Sign;
|
||||
@ -32,16 +32,16 @@ public class FloorSign extends DSign {
|
||||
|
||||
private DSignType type = DSignTypeDefault.FLOOR;
|
||||
|
||||
private ResourceWorld floor;
|
||||
private DResourceWorld floor;
|
||||
|
||||
public FloorSign(Sign sign, String[] lines, GameWorld gameWorld) {
|
||||
public FloorSign(Sign sign, String[] lines, DGameWorld gameWorld) {
|
||||
super(sign, lines, gameWorld);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the next floor
|
||||
*/
|
||||
public ResourceWorld getFloor() {
|
||||
public DResourceWorld getFloor() {
|
||||
return floor;
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ public class FloorSign extends DSign {
|
||||
* @param floor
|
||||
* the floor to set
|
||||
*/
|
||||
public void setFloor(ResourceWorld floor) {
|
||||
public void setFloor(DResourceWorld floor) {
|
||||
this.floor = floor;
|
||||
}
|
||||
|
||||
@ -61,7 +61,7 @@ public class FloorSign extends DSign {
|
||||
@Override
|
||||
public void onInit() {
|
||||
if (!lines[1].isEmpty()) {
|
||||
floor = plugin.getWorlds().getResourceByName(lines[1]);
|
||||
floor = plugin.getDWorlds().getResourceByName(lines[1]);
|
||||
}
|
||||
|
||||
if (!getTriggers().isEmpty()) {
|
||||
|
@ -23,7 +23,7 @@ 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.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
@ -39,7 +39,7 @@ public class HologramSign extends DSign {
|
||||
|
||||
private Hologram hologram;
|
||||
|
||||
public HologramSign(Sign sign, String[] lines, GameWorld gameWorld) {
|
||||
public HologramSign(Sign sign, String[] lines, DGameWorld gameWorld) {
|
||||
super(sign, lines, gameWorld);
|
||||
}
|
||||
|
||||
|
@ -19,8 +19,8 @@ package io.github.dre2n.dungeonsxl.sign;
|
||||
import io.github.dre2n.commons.util.NumberUtil;
|
||||
import io.github.dre2n.dungeonsxl.task.SignUpdateTask;
|
||||
import io.github.dre2n.dungeonsxl.trigger.InteractTrigger;
|
||||
import io.github.dre2n.dungeonsxl.world.EditWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DEditWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import org.bukkit.ChatColor;
|
||||
@ -35,14 +35,14 @@ public class InteractSign extends DSign {
|
||||
|
||||
private DSignType type = DSignTypeDefault.INTERACT;
|
||||
|
||||
public InteractSign(Sign sign, String[] lines, GameWorld gameWorld) {
|
||||
public InteractSign(Sign sign, String[] lines, DGameWorld gameWorld) {
|
||||
super(sign, lines, gameWorld);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean check() {
|
||||
Set<Integer> used = new HashSet<>();
|
||||
for (Block block : EditWorld.getByWorld(getSign().getLocation().getWorld()).getSigns()) {
|
||||
for (Block block : DEditWorld.getByWorld(getSign().getLocation().getWorld()).getSigns()) {
|
||||
if (block == null) {
|
||||
continue;
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ package io.github.dre2n.dungeonsxl.sign;
|
||||
import io.github.dre2n.dungeonsxl.event.dplayer.DPlayerEscapeEvent;
|
||||
import io.github.dre2n.dungeonsxl.player.DGamePlayer;
|
||||
import io.github.dre2n.dungeonsxl.trigger.InteractTrigger;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Sign;
|
||||
@ -32,7 +32,7 @@ public class LeaveSign extends DSign {
|
||||
|
||||
private DSignType type = DSignTypeDefault.LEAVE;
|
||||
|
||||
public LeaveSign(Sign sign, String[] lines, GameWorld gameWorld) {
|
||||
public LeaveSign(Sign sign, String[] lines, DGameWorld gameWorld) {
|
||||
super(sign, lines, gameWorld);
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ import io.github.dre2n.dungeonsxl.config.DMessages;
|
||||
import io.github.dre2n.dungeonsxl.game.Game;
|
||||
import io.github.dre2n.dungeonsxl.player.DGamePlayer;
|
||||
import io.github.dre2n.dungeonsxl.player.DGroup;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Sign;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -44,7 +44,7 @@ public class LivesModifierSign extends DSign {
|
||||
private int lives;
|
||||
private Target target;
|
||||
|
||||
public LivesModifierSign(Sign sign, String[] lines, GameWorld gameWorld) {
|
||||
public LivesModifierSign(Sign sign, String[] lines, DGameWorld gameWorld) {
|
||||
super(sign, lines, gameWorld);
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
package io.github.dre2n.dungeonsxl.sign;
|
||||
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Sign;
|
||||
|
||||
@ -27,7 +27,7 @@ public class LobbySign extends DSign {
|
||||
|
||||
private DSignType type = DSignTypeDefault.LOBBY;
|
||||
|
||||
public LobbySign(Sign sign, String[] lines, GameWorld gameWorld) {
|
||||
public LobbySign(Sign sign, String[] lines, DGameWorld gameWorld) {
|
||||
super(sign, lines, gameWorld);
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@ package io.github.dre2n.dungeonsxl.sign;
|
||||
|
||||
import io.github.dre2n.commons.util.NumberUtil;
|
||||
import io.github.dre2n.commons.util.messageutil.MessageUtil;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Sign;
|
||||
@ -36,7 +36,7 @@ public class MessageSign extends DSign {
|
||||
private boolean initialized;
|
||||
private CopyOnWriteArrayList<Player> done = new CopyOnWriteArrayList<>();
|
||||
|
||||
public MessageSign(Sign sign, String[] lines, GameWorld gameWorld) {
|
||||
public MessageSign(Sign sign, String[] lines, DGameWorld gameWorld) {
|
||||
super(sign, lines, gameWorld);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
package io.github.dre2n.dungeonsxl.sign;
|
||||
|
||||
import io.github.dre2n.commons.util.BlockUtil;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
@ -33,7 +33,7 @@ public class OpenDoorSign extends DSign {
|
||||
|
||||
private Block block;
|
||||
|
||||
public OpenDoorSign(Sign sign, String[] lines, GameWorld gameWorld) {
|
||||
public OpenDoorSign(Sign sign, String[] lines, DGameWorld gameWorld) {
|
||||
super(sign, lines, gameWorld);
|
||||
}
|
||||
|
||||
@ -95,7 +95,7 @@ public class OpenDoorSign extends DSign {
|
||||
* true if the block is openable only with a sign
|
||||
*/
|
||||
public static boolean isProtected(Block block) {
|
||||
GameWorld gameWorld = GameWorld.getByWorld(block.getWorld());
|
||||
DGameWorld gameWorld = DGameWorld.getByWorld(block.getWorld());
|
||||
if (gameWorld != null) {
|
||||
for (DSign dSign : gameWorld.getDSigns(DSignTypeDefault.OPEN_DOOR)) {
|
||||
Block signBlock1 = ((OpenDoorSign) dSign).getBlock();
|
||||
|
@ -17,7 +17,7 @@
|
||||
package io.github.dre2n.dungeonsxl.sign;
|
||||
|
||||
import io.github.dre2n.dungeonsxl.game.GamePlaceableBlock;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Sign;
|
||||
|
||||
@ -28,7 +28,7 @@ public class PlaceSign extends DSign {
|
||||
|
||||
private DSignType type = DSignTypeDefault.PLACE;
|
||||
|
||||
public PlaceSign(Sign sign, String[] lines, GameWorld gameWorld) {
|
||||
public PlaceSign(Sign sign, String[] lines, DGameWorld gameWorld) {
|
||||
super(sign, lines, gameWorld);
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ import io.github.dre2n.dungeonsxl.player.DGamePlayer;
|
||||
import io.github.dre2n.dungeonsxl.player.DGroup;
|
||||
import io.github.dre2n.dungeonsxl.trigger.InteractTrigger;
|
||||
import io.github.dre2n.dungeonsxl.util.ProgressBar;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Sign;
|
||||
@ -43,7 +43,7 @@ public class ReadySign extends DSign {
|
||||
private double autoStart = -1;
|
||||
private boolean triggered = false;
|
||||
|
||||
public ReadySign(Sign sign, String[] lines, GameWorld gameWorld) {
|
||||
public ReadySign(Sign sign, String[] lines, DGameWorld gameWorld) {
|
||||
super(sign, lines, gameWorld);
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@ package io.github.dre2n.dungeonsxl.sign;
|
||||
|
||||
import io.github.dre2n.commons.util.NumberUtil;
|
||||
import io.github.dre2n.dungeonsxl.task.DelayedPowerTask;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.Sign;
|
||||
@ -42,7 +42,7 @@ public class RedstoneSign extends DSign {
|
||||
private int repeat = 1;
|
||||
private int repeatsToDo = 1;
|
||||
|
||||
public RedstoneSign(Sign sign, String[] lines, GameWorld gameWorld) {
|
||||
public RedstoneSign(Sign sign, String[] lines, DGameWorld gameWorld) {
|
||||
super(sign, lines, gameWorld);
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
package io.github.dre2n.dungeonsxl.sign;
|
||||
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Sign;
|
||||
|
||||
@ -29,7 +29,7 @@ public class ScriptSign extends DSign {
|
||||
|
||||
private String name;
|
||||
|
||||
public ScriptSign(Sign sign, String[] lines, GameWorld gameWorld) {
|
||||
public ScriptSign(Sign sign, String[] lines, DGameWorld gameWorld) {
|
||||
super(sign, lines, gameWorld);
|
||||
name = lines[1];
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
package io.github.dre2n.dungeonsxl.sign;
|
||||
|
||||
import io.github.dre2n.commons.util.NumberUtil;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Sign;
|
||||
@ -35,7 +35,7 @@ public class SoundMessageSign extends DSign {
|
||||
private String msg;
|
||||
private CopyOnWriteArrayList<Player> done = new CopyOnWriteArrayList<>();
|
||||
|
||||
public SoundMessageSign(Sign sign, String[] lines, GameWorld gameWorld) {
|
||||
public SoundMessageSign(Sign sign, String[] lines, DGameWorld gameWorld) {
|
||||
super(sign, lines, gameWorld);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
package io.github.dre2n.dungeonsxl.sign;
|
||||
|
||||
import io.github.dre2n.commons.util.NumberUtil;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Sign;
|
||||
|
||||
@ -30,7 +30,7 @@ public class StartSign extends DSign {
|
||||
|
||||
private int id;
|
||||
|
||||
public StartSign(Sign sign, String[] lines, GameWorld gameWorld) {
|
||||
public StartSign(Sign sign, String[] lines, DGameWorld gameWorld) {
|
||||
super(sign, lines, gameWorld);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
package io.github.dre2n.dungeonsxl.sign;
|
||||
|
||||
import io.github.dre2n.commons.util.NumberUtil;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Sign;
|
||||
@ -32,7 +32,7 @@ public class TeleportSign extends DSign {
|
||||
|
||||
private Location location;
|
||||
|
||||
public TeleportSign(Sign sign, String[] lines, GameWorld gameWorld) {
|
||||
public TeleportSign(Sign sign, String[] lines, DGameWorld gameWorld) {
|
||||
super(sign, lines, gameWorld);
|
||||
}
|
||||
|
||||
|
@ -19,8 +19,8 @@ package io.github.dre2n.dungeonsxl.sign;
|
||||
import io.github.dre2n.commons.util.NumberUtil;
|
||||
import io.github.dre2n.dungeonsxl.task.SignUpdateTask;
|
||||
import io.github.dre2n.dungeonsxl.trigger.SignTrigger;
|
||||
import io.github.dre2n.dungeonsxl.world.EditWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DEditWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import org.bukkit.Material;
|
||||
@ -38,14 +38,14 @@ public class TriggerSign extends DSign {
|
||||
private int triggerId;
|
||||
private boolean initialized;
|
||||
|
||||
public TriggerSign(Sign sign, String[] lines, GameWorld gameWorld) {
|
||||
public TriggerSign(Sign sign, String[] lines, DGameWorld gameWorld) {
|
||||
super(sign, lines, gameWorld);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean check() {
|
||||
Set<Integer> used = new HashSet<>();
|
||||
for (Block block : EditWorld.getByWorld(getSign().getLocation().getWorld()).getSigns()) {
|
||||
for (Block block : DEditWorld.getByWorld(getSign().getLocation().getWorld()).getSigns()) {
|
||||
if (block == null) {
|
||||
continue;
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ package io.github.dre2n.dungeonsxl.sign;
|
||||
|
||||
import io.github.dre2n.commons.util.NumberUtil;
|
||||
import io.github.dre2n.dungeonsxl.trigger.InteractTrigger;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Sign;
|
||||
@ -34,7 +34,7 @@ public class WaveSign extends DSign {
|
||||
private double mobCountIncreaseRate;
|
||||
private boolean teleport;
|
||||
|
||||
public WaveSign(Sign sign, String[] lines, GameWorld gameWorld) {
|
||||
public WaveSign(Sign sign, String[] lines, DGameWorld gameWorld) {
|
||||
super(sign, lines, gameWorld);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
package io.github.dre2n.dungeonsxl.task;
|
||||
|
||||
import io.github.dre2n.dungeonsxl.sign.RedstoneSign;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
/**
|
||||
@ -35,7 +35,7 @@ public class DelayedPowerTask extends BukkitRunnable {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (GameWorld.getByWorld(sign.getBlock().getWorld()) == null) {
|
||||
if (DGameWorld.getByWorld(sign.getBlock().getWorld()) == null) {
|
||||
sign.getEnableTask().cancel();
|
||||
sign.getDisableTask().cancel();
|
||||
return;
|
||||
|
@ -19,7 +19,7 @@ package io.github.dre2n.dungeonsxl.task;
|
||||
import io.github.dre2n.dungeonsxl.mob.DMob;
|
||||
import io.github.dre2n.dungeonsxl.mob.ExternalMobProvider;
|
||||
import io.github.dre2n.dungeonsxl.sign.ExternalMobSign;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
@ -40,7 +40,7 @@ public class ExternalMobSpawnTask extends BukkitRunnable {
|
||||
public void run() {
|
||||
if (sign.getInterval() <= 0) {
|
||||
World world = sign.getSign().getWorld();
|
||||
GameWorld gameWorld = GameWorld.getByWorld(world);
|
||||
DGameWorld gameWorld = DGameWorld.getByWorld(world);
|
||||
|
||||
if (gameWorld != null) {
|
||||
sign.setSpawnLocation(sign.getSign().getLocation().add(0.5, 0, 0.5));
|
||||
|
@ -18,7 +18,7 @@ package io.github.dre2n.dungeonsxl.task;
|
||||
|
||||
import io.github.dre2n.dungeonsxl.DungeonsXL;
|
||||
import io.github.dre2n.dungeonsxl.player.DGamePlayer;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
/**
|
||||
@ -30,7 +30,7 @@ public class LazyUpdateTask extends BukkitRunnable {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
for (GameWorld gameWorld : plugin.getWorlds().getGameWorlds()) {
|
||||
for (DGameWorld gameWorld : plugin.getDWorlds().getGameWorlds()) {
|
||||
gameWorld.update();
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ import io.github.dre2n.dungeonsxl.DungeonsXL;
|
||||
import io.github.dre2n.dungeonsxl.mob.DMob;
|
||||
import io.github.dre2n.dungeonsxl.mob.DMobType;
|
||||
import io.github.dre2n.dungeonsxl.sign.DMobSign;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
@ -46,7 +46,7 @@ public class MobSpawnTask extends BukkitRunnable {
|
||||
public void run() {
|
||||
if (sign.getInterval() <= 0) {
|
||||
World world = sign.getSign().getWorld();
|
||||
GameWorld gameWorld = GameWorld.getByWorld(world);
|
||||
DGameWorld gameWorld = DGameWorld.getByWorld(world);
|
||||
|
||||
if (gameWorld != null) {
|
||||
Location spawnLoc = sign.getSign().getLocation().add(0.5, 0, 0.5);
|
||||
|
@ -18,7 +18,7 @@ package io.github.dre2n.dungeonsxl.task;
|
||||
|
||||
import io.github.dre2n.dungeonsxl.DungeonsXL;
|
||||
import io.github.dre2n.dungeonsxl.trigger.RedstoneTrigger;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
@ -35,7 +35,7 @@ public class RedstoneEventTask extends BukkitRunnable {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
for (GameWorld gameWorld : DungeonsXL.getInstance().getWorlds().getGameWorlds()) {
|
||||
for (DGameWorld gameWorld : DungeonsXL.getInstance().getDWorlds().getGameWorlds()) {
|
||||
if (block.getWorld() == gameWorld.getWorld()) {
|
||||
RedstoneTrigger.updateAll(gameWorld);
|
||||
}
|
||||
|
@ -18,8 +18,8 @@ package io.github.dre2n.dungeonsxl.task;
|
||||
|
||||
import io.github.dre2n.dungeonsxl.DungeonsXL;
|
||||
import io.github.dre2n.dungeonsxl.player.DGamePlayer;
|
||||
import io.github.dre2n.dungeonsxl.world.EditWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DEditWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
/**
|
||||
@ -31,7 +31,7 @@ public class WorldUnloadTask extends BukkitRunnable {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
for (GameWorld gameWorld : plugin.getWorlds().getGameWorlds()) {
|
||||
for (DGameWorld gameWorld : plugin.getDWorlds().getGameWorlds()) {
|
||||
if (gameWorld.getWorld().getPlayers().isEmpty()) {
|
||||
if (DGamePlayer.getByWorld(gameWorld.getWorld()).isEmpty()) {
|
||||
gameWorld.delete();
|
||||
@ -39,7 +39,7 @@ public class WorldUnloadTask extends BukkitRunnable {
|
||||
}
|
||||
}
|
||||
|
||||
for (EditWorld editWorld : plugin.getWorlds().getEditWorlds()) {
|
||||
for (DEditWorld editWorld : plugin.getDWorlds().getEditWorlds()) {
|
||||
if (editWorld.getWorld().getPlayers().isEmpty()) {
|
||||
editWorld.delete(true);
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
package io.github.dre2n.dungeonsxl.trigger;
|
||||
|
||||
import io.github.dre2n.dungeonsxl.event.trigger.TriggerActionEvent;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@ -61,7 +61,7 @@ public class DistanceTrigger extends Trigger {
|
||||
}
|
||||
|
||||
/* Statics */
|
||||
public static void triggerAllInDistance(Player player, GameWorld gameWorld) {
|
||||
public static void triggerAllInDistance(Player player, DGameWorld gameWorld) {
|
||||
if (!player.getLocation().getWorld().equals(gameWorld.getWorld())) {
|
||||
return;
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
package io.github.dre2n.dungeonsxl.trigger;
|
||||
|
||||
import io.github.dre2n.dungeonsxl.event.trigger.TriggerActionEvent;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@ -55,7 +55,7 @@ public class InteractTrigger extends Trigger {
|
||||
}
|
||||
|
||||
/* Statics */
|
||||
public static InteractTrigger getOrCreate(int id, GameWorld gameWorld) {
|
||||
public static InteractTrigger getOrCreate(int id, DGameWorld gameWorld) {
|
||||
if (id == 0) {
|
||||
return null;
|
||||
}
|
||||
@ -66,7 +66,7 @@ public class InteractTrigger extends Trigger {
|
||||
return new InteractTrigger(id, null);
|
||||
}
|
||||
|
||||
public static InteractTrigger getOrCreate(int id, Block block, GameWorld gameWorld) {
|
||||
public static InteractTrigger getOrCreate(int id, Block block, DGameWorld gameWorld) {
|
||||
InteractTrigger trigger = getById(id, gameWorld);
|
||||
if (trigger != null) {
|
||||
trigger.interactBlock = block;
|
||||
@ -75,7 +75,7 @@ public class InteractTrigger extends Trigger {
|
||||
return new InteractTrigger(id, block);
|
||||
}
|
||||
|
||||
public static InteractTrigger getByBlock(Block block, GameWorld gameWorld) {
|
||||
public static InteractTrigger getByBlock(Block block, DGameWorld gameWorld) {
|
||||
for (Trigger uncasted : gameWorld.getTriggers(TriggerTypeDefault.INTERACT)) {
|
||||
InteractTrigger trigger = (InteractTrigger) uncasted;
|
||||
if (trigger.interactBlock != null) {
|
||||
@ -87,7 +87,7 @@ public class InteractTrigger extends Trigger {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static InteractTrigger getById(int id, GameWorld gameWorld) {
|
||||
public static InteractTrigger getById(int id, DGameWorld gameWorld) {
|
||||
if (id != 0) {
|
||||
for (Trigger uncasted : gameWorld.getTriggers(TriggerTypeDefault.INTERACT)) {
|
||||
InteractTrigger trigger = (InteractTrigger) uncasted;
|
||||
|
@ -17,7 +17,7 @@
|
||||
package io.github.dre2n.dungeonsxl.trigger;
|
||||
|
||||
import io.github.dre2n.dungeonsxl.event.trigger.TriggerActionEvent;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
|
||||
/**
|
||||
* @author Frank Baumann, Daniel Saukel
|
||||
@ -50,7 +50,7 @@ public class MobTrigger extends Trigger {
|
||||
}
|
||||
|
||||
/* Statics */
|
||||
public static MobTrigger getOrCreate(String name, GameWorld gameWorld) {
|
||||
public static MobTrigger getOrCreate(String name, DGameWorld gameWorld) {
|
||||
MobTrigger trigger = getByName(name, gameWorld);
|
||||
if (trigger != null) {
|
||||
return trigger;
|
||||
@ -58,7 +58,7 @@ public class MobTrigger extends Trigger {
|
||||
return new MobTrigger(name);
|
||||
}
|
||||
|
||||
public static MobTrigger getByName(String name, GameWorld gameWorld) {
|
||||
public static MobTrigger getByName(String name, DGameWorld gameWorld) {
|
||||
for (Trigger uncasted : gameWorld.getTriggers(TriggerTypeDefault.MOB)) {
|
||||
MobTrigger trigger = (MobTrigger) uncasted;
|
||||
if (trigger.name.equalsIgnoreCase(name)) {
|
||||
|
@ -17,8 +17,8 @@
|
||||
package io.github.dre2n.dungeonsxl.trigger;
|
||||
|
||||
import io.github.dre2n.dungeonsxl.event.trigger.TriggerActionEvent;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.ResourceWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DResourceWorld;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
@ -29,7 +29,7 @@ public class ProgressTrigger extends Trigger {
|
||||
|
||||
private TriggerType type = TriggerTypeDefault.PROGRESS;
|
||||
|
||||
private ResourceWorld floor;
|
||||
private DResourceWorld floor;
|
||||
private int floorCount;
|
||||
private int waveCount;
|
||||
|
||||
@ -38,7 +38,7 @@ public class ProgressTrigger extends Trigger {
|
||||
this.waveCount = waveCount;
|
||||
}
|
||||
|
||||
public ProgressTrigger(ResourceWorld floor) {
|
||||
public ProgressTrigger(DResourceWorld floor) {
|
||||
this.floor = floor;
|
||||
}
|
||||
|
||||
@ -46,7 +46,7 @@ public class ProgressTrigger extends Trigger {
|
||||
/**
|
||||
* @return the specific floor that must be finished
|
||||
*/
|
||||
public ResourceWorld getFloor() {
|
||||
public DResourceWorld getFloor() {
|
||||
return floor;
|
||||
}
|
||||
|
||||
@ -54,7 +54,7 @@ public class ProgressTrigger extends Trigger {
|
||||
* @param floor
|
||||
* the specific floor to set
|
||||
*/
|
||||
public void setFloor(ResourceWorld floor) {
|
||||
public void setFloor(DResourceWorld floor) {
|
||||
this.floor = floor;
|
||||
}
|
||||
|
||||
@ -107,15 +107,15 @@ public class ProgressTrigger extends Trigger {
|
||||
}
|
||||
|
||||
/* Statics */
|
||||
public static ProgressTrigger getOrCreate(int floorCount, int waveCount, GameWorld gameWorld) {
|
||||
public static ProgressTrigger getOrCreate(int floorCount, int waveCount, DGameWorld gameWorld) {
|
||||
if (floorCount == 0 & waveCount == 0 || floorCount < 0 || waveCount < 0) {
|
||||
return null;
|
||||
}
|
||||
return new ProgressTrigger(floorCount, waveCount);
|
||||
}
|
||||
|
||||
public static ProgressTrigger getOrCreate(String floor, GameWorld gameWorld) {
|
||||
ResourceWorld resource = plugin.getWorlds().getResourceByName(floor);
|
||||
public static ProgressTrigger getOrCreate(String floor, DGameWorld gameWorld) {
|
||||
DResourceWorld resource = plugin.getDWorlds().getResourceByName(floor);
|
||||
|
||||
if (resource != null) {
|
||||
return new ProgressTrigger(resource);
|
||||
@ -125,7 +125,7 @@ public class ProgressTrigger extends Trigger {
|
||||
}
|
||||
}
|
||||
|
||||
public static Set<ProgressTrigger> getByGameWorld(GameWorld gameWorld) {
|
||||
public static Set<ProgressTrigger> getByGameWorld(DGameWorld gameWorld) {
|
||||
Set<ProgressTrigger> toReturn = new HashSet<>();
|
||||
for (Trigger trigger : gameWorld.getTriggers(TriggerTypeDefault.PROGRESS)) {
|
||||
toReturn.add((ProgressTrigger) trigger);
|
||||
|
@ -17,7 +17,7 @@
|
||||
package io.github.dre2n.dungeonsxl.trigger;
|
||||
|
||||
import io.github.dre2n.dungeonsxl.event.trigger.TriggerActionEvent;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
@ -62,7 +62,7 @@ public class RedstoneTrigger extends Trigger {
|
||||
}
|
||||
|
||||
/* Statics */
|
||||
public static RedstoneTrigger getOrCreate(Sign sign, GameWorld gameWorld) {
|
||||
public static RedstoneTrigger getOrCreate(Sign sign, DGameWorld gameWorld) {
|
||||
Block rtBlock = null;
|
||||
if (sign.getBlock().getType() == Material.WALL_SIGN) {
|
||||
switch (sign.getData().getData()) {
|
||||
@ -96,7 +96,7 @@ public class RedstoneTrigger extends Trigger {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void updateAll(GameWorld gameWorld) {
|
||||
public static void updateAll(DGameWorld gameWorld) {
|
||||
for (Trigger trigger : gameWorld.getTriggers(TriggerTypeDefault.REDSTONE)) {
|
||||
((RedstoneTrigger) trigger).onTrigger();
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
package io.github.dre2n.dungeonsxl.trigger;
|
||||
|
||||
import io.github.dre2n.dungeonsxl.event.trigger.TriggerActionEvent;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
|
||||
/**
|
||||
* @author Frank Baumann, Daniel Saukel
|
||||
@ -52,7 +52,7 @@ public class SignTrigger extends Trigger {
|
||||
}
|
||||
|
||||
/* Statics */
|
||||
public static SignTrigger getOrCreate(int id, GameWorld gameWorld) {
|
||||
public static SignTrigger getOrCreate(int id, DGameWorld gameWorld) {
|
||||
SignTrigger trigger = getById(id, gameWorld);
|
||||
if (trigger != null) {
|
||||
return trigger;
|
||||
@ -60,7 +60,7 @@ public class SignTrigger extends Trigger {
|
||||
return new SignTrigger(id);
|
||||
}
|
||||
|
||||
public static SignTrigger getById(int id, GameWorld gameWorld) {
|
||||
public static SignTrigger getById(int id, DGameWorld gameWorld) {
|
||||
for (Trigger uncasted : gameWorld.getTriggers(TriggerTypeDefault.SIGN)) {
|
||||
SignTrigger trigger = (SignTrigger) uncasted;
|
||||
if (trigger.stId == id) {
|
||||
|
@ -21,7 +21,7 @@ import io.github.dre2n.commons.util.messageutil.MessageUtil;
|
||||
import io.github.dre2n.dungeonsxl.DungeonsXL;
|
||||
import io.github.dre2n.dungeonsxl.event.trigger.TriggerRegistrationEvent;
|
||||
import io.github.dre2n.dungeonsxl.sign.DSign;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.HashSet;
|
||||
@ -113,11 +113,11 @@ public abstract class Trigger {
|
||||
}
|
||||
}
|
||||
|
||||
public void register(GameWorld gameWorld) {
|
||||
public void register(DGameWorld gameWorld) {
|
||||
gameWorld.addTrigger(this);
|
||||
}
|
||||
|
||||
public void unregister(GameWorld gameWorld) {
|
||||
public void unregister(DGameWorld gameWorld) {
|
||||
gameWorld.removeTrigger(this);
|
||||
}
|
||||
|
||||
@ -185,7 +185,7 @@ public abstract class Trigger {
|
||||
|
||||
Method method;
|
||||
try {
|
||||
method = type.getHandler().getDeclaredMethod("getOrCreate", String.class, GameWorld.class);
|
||||
method = type.getHandler().getDeclaredMethod("getOrCreate", String.class, DGameWorld.class);
|
||||
trigger = (Trigger) method.invoke(value, dSign.getGameWorld());
|
||||
|
||||
} catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException exception) {
|
||||
|
@ -17,7 +17,7 @@
|
||||
package io.github.dre2n.dungeonsxl.trigger;
|
||||
|
||||
import io.github.dre2n.dungeonsxl.event.trigger.TriggerActionEvent;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@ -58,7 +58,7 @@ public class UseItemTrigger extends Trigger {
|
||||
}
|
||||
|
||||
/* Statics */
|
||||
public static UseItemTrigger getOrCreate(String name, GameWorld gameWorld) {
|
||||
public static UseItemTrigger getOrCreate(String name, DGameWorld gameWorld) {
|
||||
UseItemTrigger trigger = getByName(name, gameWorld);
|
||||
if (trigger != null) {
|
||||
return trigger;
|
||||
@ -66,7 +66,7 @@ public class UseItemTrigger extends Trigger {
|
||||
return new UseItemTrigger(name);
|
||||
}
|
||||
|
||||
public static UseItemTrigger getByName(String name, GameWorld gameWorld) {
|
||||
public static UseItemTrigger getByName(String name, DGameWorld gameWorld) {
|
||||
for (Trigger uncasted : gameWorld.getTriggers(TriggerTypeDefault.USE_ITEM)) {
|
||||
UseItemTrigger trigger = (UseItemTrigger) uncasted;
|
||||
if (trigger.name.equalsIgnoreCase(name)) {
|
||||
|
@ -17,7 +17,7 @@
|
||||
package io.github.dre2n.dungeonsxl.trigger;
|
||||
|
||||
import io.github.dre2n.dungeonsxl.event.trigger.TriggerActionEvent;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
@ -68,14 +68,14 @@ public class WaveTrigger extends Trigger {
|
||||
}
|
||||
|
||||
/* Statics */
|
||||
public static WaveTrigger getOrCreate(double mustKillRate, GameWorld gameWorld) {
|
||||
public static WaveTrigger getOrCreate(double mustKillRate, DGameWorld gameWorld) {
|
||||
return new WaveTrigger(mustKillRate);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the WaveTriggers in the GameWorld
|
||||
* @return the WaveTriggers in the DGameWorld
|
||||
*/
|
||||
public static Set<WaveTrigger> getByGameWorld(GameWorld gameWorld) {
|
||||
public static Set<WaveTrigger> getByGameWorld(DGameWorld gameWorld) {
|
||||
Set<WaveTrigger> toReturn = new HashSet<>();
|
||||
for (Trigger trigger : gameWorld.getTriggers()) {
|
||||
toReturn.add((WaveTrigger) trigger);
|
||||
|
@ -32,13 +32,13 @@ import org.bukkit.entity.Player;
|
||||
/**
|
||||
* @author Frank Baumann, Daniel Saukel
|
||||
*/
|
||||
public class EditWorld extends InstanceWorld {
|
||||
public class DEditWorld extends DInstanceWorld {
|
||||
|
||||
static Worlds worlds = plugin.getWorlds();
|
||||
static DWorlds worlds = plugin.getDWorlds();
|
||||
|
||||
private CopyOnWriteArrayList<Block> signs = new CopyOnWriteArrayList<>();
|
||||
|
||||
EditWorld(ResourceWorld resourceWorld, File folder, World world, int id) {
|
||||
DEditWorld(DResourceWorld resourceWorld, File folder, World world, int id) {
|
||||
super(resourceWorld, folder, world, id);
|
||||
}
|
||||
|
||||
@ -144,9 +144,9 @@ public class EditWorld extends InstanceWorld {
|
||||
* @param world
|
||||
* the instance
|
||||
* @return
|
||||
* the EditWorld that represents the world
|
||||
* the DEditWorld that represents the world
|
||||
*/
|
||||
public static EditWorld getByWorld(World world) {
|
||||
public static DEditWorld getByWorld(World world) {
|
||||
return getByName(world.getName());
|
||||
}
|
||||
|
||||
@ -154,13 +154,13 @@ public class EditWorld extends InstanceWorld {
|
||||
* @param world
|
||||
* the instance name
|
||||
* @return
|
||||
* the EditWorld that represents the world
|
||||
* the DEditWorld that represents the world
|
||||
*/
|
||||
public static EditWorld getByName(String name) {
|
||||
InstanceWorld instance = worlds.getInstanceByName(name);
|
||||
public static DEditWorld getByName(String name) {
|
||||
DInstanceWorld instance = worlds.getInstanceByName(name);
|
||||
|
||||
if (instance instanceof EditWorld) {
|
||||
return (EditWorld) instance;
|
||||
if (instance instanceof DEditWorld) {
|
||||
return (DEditWorld) instance;
|
||||
|
||||
} else {
|
||||
return null;
|
@ -52,7 +52,7 @@ import org.bukkit.inventory.ItemStack;
|
||||
/**
|
||||
* @author Frank Baumann, Milan Albrecht, Daniel Saukel
|
||||
*/
|
||||
public class GameWorld extends InstanceWorld {
|
||||
public class DGameWorld extends DInstanceWorld {
|
||||
|
||||
// Variables
|
||||
private boolean tutorial;
|
||||
@ -68,13 +68,13 @@ public class GameWorld extends InstanceWorld {
|
||||
private CopyOnWriteArrayList<DSign> dSigns = new CopyOnWriteArrayList<>();
|
||||
private CopyOnWriteArrayList<Trigger> triggers = new CopyOnWriteArrayList<>();
|
||||
|
||||
GameWorld(ResourceWorld resourceWorld, File folder, World world, int id) {
|
||||
DGameWorld(DResourceWorld resourceWorld, File folder, World world, int id) {
|
||||
super(resourceWorld, folder, world, id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* the Game connected to the GameWorld
|
||||
* the Game connected to the DGameWorld
|
||||
*/
|
||||
public Game getGame() {
|
||||
for (Game game : plugin.getGames()) {
|
||||
@ -95,7 +95,7 @@ public class GameWorld extends InstanceWorld {
|
||||
|
||||
/**
|
||||
* @param tutorial
|
||||
* if the GameWorld is the tutorial
|
||||
* if the DGameWorld is the tutorial
|
||||
*/
|
||||
public void setTutorial(boolean tutorial) {
|
||||
this.tutorial = tutorial;
|
||||
@ -335,7 +335,7 @@ public class GameWorld extends InstanceWorld {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the Dungeon that contains the GameWorld
|
||||
* @return the Dungeon that contains the DGameWorld
|
||||
*/
|
||||
public Dungeon getDungeon() {
|
||||
for (Dungeon dungeon : plugin.getDungeons().getDungeons()) {
|
||||
@ -393,7 +393,7 @@ public class GameWorld extends InstanceWorld {
|
||||
return;
|
||||
}
|
||||
|
||||
plugin.getWorlds().getInstances().remove(this);
|
||||
plugin.getDWorlds().getInstances().remove(this);
|
||||
plugin.getServer().unloadWorld(getWorld(), true);
|
||||
FileUtil.removeDirectory(getFolder());
|
||||
|
||||
@ -434,11 +434,11 @@ public class GameWorld extends InstanceWorld {
|
||||
* @return
|
||||
* the EditWorld that represents the world
|
||||
*/
|
||||
public static GameWorld getByWorld(World world) {
|
||||
InstanceWorld instance = plugin.getWorlds().getInstanceByName(world.getName());
|
||||
public static DGameWorld getByWorld(World world) {
|
||||
DInstanceWorld instance = plugin.getDWorlds().getInstanceByName(world.getName());
|
||||
|
||||
if (instance instanceof GameWorld) {
|
||||
return (GameWorld) instance;
|
||||
if (instance instanceof DGameWorld) {
|
||||
return (DGameWorld) instance;
|
||||
|
||||
} else {
|
||||
return null;
|
@ -28,21 +28,21 @@ import org.bukkit.World;
|
||||
/**
|
||||
* @author Daniel Saukel
|
||||
*/
|
||||
public abstract class InstanceWorld {
|
||||
public abstract class DInstanceWorld {
|
||||
|
||||
protected static DungeonsXL plugin = DungeonsXL.getInstance();
|
||||
protected static Worlds worlds = plugin.getWorlds();
|
||||
protected static DWorlds worlds = plugin.getDWorlds();
|
||||
|
||||
public static String ID_FILE_PREFIX = ".id_";
|
||||
|
||||
private ResourceWorld resourceWorld;
|
||||
private DResourceWorld resourceWorld;
|
||||
private File folder;
|
||||
private World world;
|
||||
private File idFile;
|
||||
private int id;
|
||||
private Location lobby;
|
||||
|
||||
InstanceWorld(ResourceWorld resourceWorld, File folder, World world, int id) {
|
||||
DInstanceWorld(DResourceWorld resourceWorld, File folder, World world, int id) {
|
||||
this.resourceWorld = resourceWorld;
|
||||
this.folder = folder;
|
||||
this.world = world;
|
||||
@ -53,7 +53,7 @@ public abstract class InstanceWorld {
|
||||
|
||||
/* Getters and setters */
|
||||
/**
|
||||
* @return the name of the ResourceWorld
|
||||
* @return the name of the DResourceWorld
|
||||
*/
|
||||
public String getName() {
|
||||
return resourceWorld.getName();
|
||||
@ -67,9 +67,9 @@ public abstract class InstanceWorld {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the ResourceWorld of that this world is an instance
|
||||
* @return the DResourceWorld of that this world is an instance
|
||||
*/
|
||||
public ResourceWorld getResource() {
|
||||
public DResourceWorld getResource() {
|
||||
return resourceWorld;
|
||||
}
|
||||
|
@ -34,16 +34,16 @@ import org.bukkit.WorldType;
|
||||
*
|
||||
* @author Daniel Saukel
|
||||
*/
|
||||
public class ResourceWorld {
|
||||
public class DResourceWorld {
|
||||
|
||||
DungeonsXL plugin = DungeonsXL.getInstance();
|
||||
Worlds worlds = plugin.getWorlds();
|
||||
DWorlds worlds = plugin.getDWorlds();
|
||||
|
||||
private File folder;
|
||||
private WorldConfig config;
|
||||
private SignData signData;
|
||||
|
||||
public ResourceWorld(String name) {
|
||||
public DResourceWorld(String name) {
|
||||
folder = new File(DungeonsXL.MAPS, name);
|
||||
if (!folder.exists()) {
|
||||
folder.mkdir();
|
||||
@ -64,7 +64,7 @@ public class ResourceWorld {
|
||||
worlds.addResource(this);
|
||||
}
|
||||
|
||||
public ResourceWorld(File folder) {
|
||||
public DResourceWorld(File folder) {
|
||||
this.folder = folder;
|
||||
|
||||
File configFile = new File(folder, "config.yml");
|
||||
@ -144,7 +144,7 @@ public class ResourceWorld {
|
||||
|
||||
DEditPlayer editPlayer = DEditPlayer.getByName(player.getName());
|
||||
if (editPlayer != null) {
|
||||
if (EditWorld.getByWorld(editPlayer.getWorld()).getResource() == this) {
|
||||
if (DEditWorld.getByWorld(editPlayer.getWorld()).getResource() == this) {
|
||||
editPlayer.leave();
|
||||
}
|
||||
}
|
||||
@ -167,10 +167,10 @@ public class ResourceWorld {
|
||||
/* Actions */
|
||||
/**
|
||||
* @param game
|
||||
* whether the instance is a GameWorld
|
||||
* whether the instance is a DGameWorld
|
||||
* @return an instance of this world
|
||||
*/
|
||||
public InstanceWorld instantiate(boolean game) {
|
||||
public DInstanceWorld instantiate(boolean game) {
|
||||
int id = worlds.generateId();
|
||||
String name = worlds.generateName(game);
|
||||
File instanceFolder = new File(Bukkit.getWorldContainer(), name);
|
||||
@ -182,15 +182,15 @@ public class ResourceWorld {
|
||||
|
||||
World world = plugin.getServer().createWorld(WorldCreator.name(name));
|
||||
|
||||
InstanceWorld instance = null;
|
||||
DInstanceWorld instance = null;
|
||||
try {
|
||||
if (game) {
|
||||
new GameWorld(this, instanceFolder, world, id);
|
||||
signData.deserializeSigns((GameWorld) instance);
|
||||
new DGameWorld(this, instanceFolder, world, id);
|
||||
signData.deserializeSigns((DGameWorld) instance);
|
||||
|
||||
} else {
|
||||
new EditWorld(this, instanceFolder, world, id);
|
||||
signData.deserializeSigns((EditWorld) instance);
|
||||
new DEditWorld(this, instanceFolder, world, id);
|
||||
signData.deserializeSigns((DEditWorld) instance);
|
||||
}
|
||||
|
||||
} catch (IOException exception) {
|
||||
@ -203,23 +203,23 @@ public class ResourceWorld {
|
||||
/**
|
||||
* @return an instance of this world
|
||||
*/
|
||||
public EditWorld instantiateAsEditWorld() {
|
||||
return (EditWorld) instantiate(false);
|
||||
public DEditWorld instantiateAsEditWorld() {
|
||||
return (DEditWorld) instantiate(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return an instance of this world
|
||||
*/
|
||||
public GameWorld instantiateAsGameWorld() {
|
||||
return (GameWorld) instantiate(true);
|
||||
public DGameWorld instantiateAsGameWorld() {
|
||||
return (DGameWorld) instantiate(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a new ResourceWorld.
|
||||
* Generate a new DResourceWorld.
|
||||
*
|
||||
* @return the automatically created EditWorld instance
|
||||
* @return the automatically created DEditWorld instance
|
||||
*/
|
||||
public EditWorld generate() {
|
||||
public DEditWorld generate() {
|
||||
String name = worlds.generateName(false);
|
||||
WorldCreator creator = WorldCreator.name(name);
|
||||
creator.type(WorldType.FLAT);
|
||||
@ -236,7 +236,7 @@ public class ResourceWorld {
|
||||
File folder = new File(Bukkit.getWorldContainer(), name);
|
||||
World world = plugin.getServer().createWorld(creator);
|
||||
|
||||
EditWorld editWorld = new EditWorld(this, folder, world, id);
|
||||
DEditWorld editWorld = new DEditWorld(this, folder, world, id);
|
||||
editWorld.generateIdFile();
|
||||
|
||||
return editWorld;
|
@ -27,25 +27,25 @@ import org.bukkit.Bukkit;
|
||||
/**
|
||||
* @author Daniel Saukel
|
||||
*/
|
||||
public class Worlds {
|
||||
public class DWorlds {
|
||||
|
||||
private Set<ResourceWorld> resources;
|
||||
private Set<InstanceWorld> instances;
|
||||
private Set<DResourceWorld> resources;
|
||||
private Set<DInstanceWorld> instances;
|
||||
|
||||
public Worlds(File folder) {
|
||||
public DWorlds(File folder) {
|
||||
for (File file : folder.listFiles()) {
|
||||
if (file.isDirectory()) {
|
||||
new ResourceWorld(file);
|
||||
new DResourceWorld(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Getters and setters */
|
||||
/**
|
||||
* @return the ResourceWorld that has this name
|
||||
* @return the DResourceWorld that has this name
|
||||
*/
|
||||
public ResourceWorld getResourceByName(String name) {
|
||||
for (ResourceWorld world : resources) {
|
||||
public DResourceWorld getResourceByName(String name) {
|
||||
for (DResourceWorld world : resources) {
|
||||
if (world.getName().equals(name)) {
|
||||
return world;
|
||||
}
|
||||
@ -55,9 +55,9 @@ public class Worlds {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the InstanceWorld that has this name
|
||||
* @return the DInstanceWorld that has this name
|
||||
*/
|
||||
public InstanceWorld getInstanceByName(String name) {
|
||||
public DInstanceWorld getInstanceByName(String name) {
|
||||
String[] splitted = name.split("_");
|
||||
if (splitted.length != 3) {
|
||||
return null;
|
||||
@ -67,10 +67,10 @@ public class Worlds {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the InstanceWorld that has this ID
|
||||
* @return the DInstanceWorld that has this ID
|
||||
*/
|
||||
public InstanceWorld getInstanceById(int id) {
|
||||
for (InstanceWorld world : instances) {
|
||||
public DInstanceWorld getInstanceById(int id) {
|
||||
for (DInstanceWorld world : instances) {
|
||||
if (world.getId() == id) {
|
||||
return world;
|
||||
}
|
||||
@ -82,57 +82,57 @@ public class Worlds {
|
||||
/**
|
||||
* @return the ResourceWorlds in the maps folder
|
||||
*/
|
||||
public Set<ResourceWorld> getResources() {
|
||||
public Set<DResourceWorld> getResources() {
|
||||
return resources;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param resource
|
||||
* the ResourceWorld to add
|
||||
* the DResourceWorld to add
|
||||
*/
|
||||
public void addResource(ResourceWorld resource) {
|
||||
public void addResource(DResourceWorld resource) {
|
||||
resources.add(resource);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param resource
|
||||
* the ResourceWorld to remove
|
||||
* the DResourceWorld to remove
|
||||
*/
|
||||
public void removeResource(ResourceWorld resource) {
|
||||
public void removeResource(DResourceWorld resource) {
|
||||
resources.remove(resource);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the loaded InstanceWorlds in the world container
|
||||
*/
|
||||
public Set<InstanceWorld> getInstances() {
|
||||
public Set<DInstanceWorld> getInstances() {
|
||||
return instances;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param instance
|
||||
* the InstanceWorld to add
|
||||
* the DInstanceWorld to add
|
||||
*/
|
||||
public void addInstance(InstanceWorld instance) {
|
||||
public void addInstance(DInstanceWorld instance) {
|
||||
instances.add(instance);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param instance
|
||||
* the InstanceWorld to remove
|
||||
* the DInstanceWorld to remove
|
||||
*/
|
||||
public void removeInstance(InstanceWorld instance) {
|
||||
public void removeInstance(DInstanceWorld instance) {
|
||||
instances.remove(instance);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the loaded GameWorlds
|
||||
*/
|
||||
public Set<GameWorld> getGameWorlds() {
|
||||
Set<GameWorld> gameWorlds = new HashSet<>();
|
||||
for (InstanceWorld instance : instances) {
|
||||
if (instance instanceof GameWorld) {
|
||||
gameWorlds.add((GameWorld) instance);
|
||||
public Set<DGameWorld> getGameWorlds() {
|
||||
Set<DGameWorld> gameWorlds = new HashSet<>();
|
||||
for (DInstanceWorld instance : instances) {
|
||||
if (instance instanceof DGameWorld) {
|
||||
gameWorlds.add((DGameWorld) instance);
|
||||
}
|
||||
}
|
||||
return gameWorlds;
|
||||
@ -141,11 +141,11 @@ public class Worlds {
|
||||
/**
|
||||
* @return the loaded EditWorlds
|
||||
*/
|
||||
public Set<EditWorld> getEditWorlds() {
|
||||
Set<EditWorld> editWorlds = new HashSet<>();
|
||||
for (InstanceWorld instance : instances) {
|
||||
if (instance instanceof GameWorld) {
|
||||
editWorlds.add((EditWorld) instance);
|
||||
public Set<DEditWorld> getEditWorlds() {
|
||||
Set<DEditWorld> editWorlds = new HashSet<>();
|
||||
for (DInstanceWorld instance : instances) {
|
||||
if (instance instanceof DGameWorld) {
|
||||
editWorlds.add((DEditWorld) instance);
|
||||
}
|
||||
}
|
||||
return editWorlds;
|
||||
@ -158,13 +158,13 @@ public class Worlds {
|
||||
* if a map with this name exists
|
||||
*/
|
||||
public boolean exists(String name) {
|
||||
for (ResourceWorld resource : resources) {
|
||||
for (DResourceWorld resource : resources) {
|
||||
if (resource.getName().equalsIgnoreCase(name)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
for (InstanceWorld instance : instances) {
|
||||
for (DInstanceWorld instance : instances) {
|
||||
if (instance.getFolder().getName().equalsIgnoreCase(name)) {
|
||||
return true;
|
||||
}
|
||||
@ -200,7 +200,7 @@ public class Worlds {
|
||||
* Clean up all instances.
|
||||
*/
|
||||
public void deleteAllInstances() {
|
||||
for (InstanceWorld instance : instances) {
|
||||
for (DInstanceWorld instance : instances) {
|
||||
instance.delete();
|
||||
}
|
||||
}
|
||||
@ -209,7 +209,7 @@ public class Worlds {
|
||||
* Saves all EditWorlds.
|
||||
*/
|
||||
public void saveAll() {
|
||||
for (EditWorld editWorld : getEditWorlds()) {
|
||||
for (DEditWorld editWorld : getEditWorlds()) {
|
||||
editWorld.save();
|
||||
}
|
||||
}
|
||||
@ -219,7 +219,7 @@ public class Worlds {
|
||||
*/
|
||||
public int generateId() {
|
||||
int id = 0;
|
||||
for (InstanceWorld instance : instances) {
|
||||
for (DInstanceWorld instance : instances) {
|
||||
if (instance.getId() >= id) {
|
||||
id = instance.getId() + 1;
|
||||
}
|
||||
@ -231,7 +231,7 @@ public class Worlds {
|
||||
* @return a name for the instance
|
||||
*
|
||||
* @param game
|
||||
* whether the instance is a GameWorld
|
||||
* whether the instance is a DGameWorld
|
||||
*/
|
||||
public String generateName(boolean game) {
|
||||
return "DXL_" + (game ? "Game" : "Edit") + "_" + generateId();
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
package io.github.dre2n.dungeonsxl.sign;
|
||||
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import org.bukkit.block.Sign;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@ -27,7 +27,7 @@ public class CustomSign extends DSign {
|
||||
|
||||
private DSignType type = DSignTypeCustom.CUSTOM;
|
||||
|
||||
public CustomSign(Sign sign, String[] lines, GameWorld gameWorld) {
|
||||
public CustomSign(Sign sign, String[] lines, DGameWorld gameWorld) {
|
||||
super(sign, lines, gameWorld);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
package io.github.dre2n.dungeonsxl.trigger;
|
||||
|
||||
import io.github.dre2n.dungeonsxl.event.trigger.TriggerActionEvent;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@ -28,7 +28,7 @@ import org.bukkit.entity.Player;
|
||||
*/
|
||||
public class CustomTrigger extends Trigger {
|
||||
|
||||
private static Map<GameWorld, ArrayList<CustomTrigger>> triggers = new HashMap<>();
|
||||
private static Map<DGameWorld, ArrayList<CustomTrigger>> triggers = new HashMap<>();
|
||||
|
||||
private TriggerType type = TriggerTypeCustom.CUSTOM;
|
||||
|
||||
@ -55,7 +55,7 @@ public class CustomTrigger extends Trigger {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register(GameWorld gameWorld) {
|
||||
public void register(DGameWorld gameWorld) {
|
||||
if (!hasTriggers(gameWorld)) {
|
||||
ArrayList<CustomTrigger> list = new ArrayList<>();
|
||||
list.add(this);
|
||||
@ -67,7 +67,7 @@ public class CustomTrigger extends Trigger {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregister(GameWorld gameWorld) {
|
||||
public void unregister(DGameWorld gameWorld) {
|
||||
if (hasTriggers(gameWorld)) {
|
||||
triggers.get(gameWorld).remove(this);
|
||||
}
|
||||
@ -78,7 +78,7 @@ public class CustomTrigger extends Trigger {
|
||||
return type;
|
||||
}
|
||||
|
||||
public static CustomTrigger getOrCreate(String value, GameWorld gameWorld) {
|
||||
public static CustomTrigger getOrCreate(String value, DGameWorld gameWorld) {
|
||||
if (triggers.containsKey(gameWorld)) {
|
||||
for (CustomTrigger trigger : triggers.get(gameWorld)) {
|
||||
if (trigger.value.equals(value)) {
|
||||
@ -90,7 +90,7 @@ public class CustomTrigger extends Trigger {
|
||||
return new CustomTrigger(value);
|
||||
}
|
||||
|
||||
public static boolean hasTriggers(GameWorld gameWorld) {
|
||||
public static boolean hasTriggers(DGameWorld gameWorld) {
|
||||
return !triggers.isEmpty() && triggers.containsKey(gameWorld);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user