diff --git a/src/main/java/io/github/dre2n/dungeonsxl/sign/DSignTypeDefault.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/DSignTypeDefault.java index 34e75364..f5e3e011 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/sign/DSignTypeDefault.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/DSignTypeDefault.java @@ -29,7 +29,6 @@ public enum DSignTypeDefault implements DSignType { CHUNK_UPDATER("ChunkUpdater", "chunkupdater", true, ChunkUpdaterSign.class), CLASSES("Classes", "classes", true, ClassesSign.class), COMMAND("CMD", "cmd", false, CommandSign.class), - DESTINATION("Destination", "warp", false, DestinationSign.class), DROP("Drop", "drop", false, DropSign.class), END("End", "end", false, EndSign.class), EXTERNAL_MOB("ExternalMob", "mob", false, ExternalMobSign.class), @@ -50,8 +49,7 @@ public enum DSignTypeDefault implements DSignType { START("Start", "start", true, StartSign.class), TELEPORT("Teleport", "teleport", false, TeleportSign.class), TRIGGER("Trigger", "trigger", true, TriggerSign.class), - WAVE("Wave", "wave", false, WaveSign.class), - WARP("Warp", "warp", false, WarpSign.class); + WAVE("Wave", "wave", false, WaveSign.class); private String name; private String buildPermission; diff --git a/src/main/java/io/github/dre2n/dungeonsxl/sign/DestinationSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/DestinationSign.java deleted file mode 100644 index d4c2e85c..00000000 --- a/src/main/java/io/github/dre2n/dungeonsxl/sign/DestinationSign.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2012-2016 Frank Baumann - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package io.github.dre2n.dungeonsxl.sign; - -import io.github.dre2n.dungeonsxl.world.GameWorld; -import org.bukkit.Material; -import org.bukkit.block.Sign; - -/** - * @author Frank Baumann, Milan Albrecht, Daniel Saukel - */ -public class DestinationSign extends DSign { - - private DSignType type = DSignTypeDefault.DESTINATION; - - private String id; - - public DestinationSign(Sign sign, String[] lines, GameWorld gameWorld) { - super(sign, lines, gameWorld); - } - - /* Getters and setters */ - /** - * @return the ID - */ - public String getId() { - return id; - } - - /** - * @param id - * the ID of the destination sign - */ - public void setId(String id) { - this.id = id; - } - - /* Actions */ - @Override - public boolean check() { - return true; - } - - @Override - public void onInit() { - id = lines[1]; - getSign().getBlock().setType(Material.AIR); - } - - @Override - public DSignType getType() { - return type; - } - -} diff --git a/src/main/java/io/github/dre2n/dungeonsxl/sign/WarpSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/WarpSign.java deleted file mode 100644 index 41df166c..00000000 --- a/src/main/java/io/github/dre2n/dungeonsxl/sign/WarpSign.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (C) 2012-2016 Frank Baumann - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package io.github.dre2n.dungeonsxl.sign; - -import io.github.dre2n.dungeonsxl.trigger.InteractTrigger; -import io.github.dre2n.dungeonsxl.world.GameWorld; -import io.github.dre2n.itemsxl.util.commons.util.playerutil.PlayerUtil; -import org.bukkit.ChatColor; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.block.Sign; -import org.bukkit.entity.Player; - -/** - * @author Frank Baumann, Milan Albrecht, Daniel Saukel - */ -public class WarpSign extends DSign { - - private DSignType type = DSignTypeDefault.WARP; - - private String destination; - - public WarpSign(Sign sign, String[] lines, GameWorld gameWorld) { - super(sign, lines, gameWorld); - } - - /** - * @return the destination sign - */ - public DestinationSign getDestinationSign() { - for (DSign dSign : getGameWorld().getDSigns()) { - if (dSign.getType() == DSignTypeDefault.DESTINATION) { - if (((DestinationSign) dSign).getId().equals(destination)) { - return (DestinationSign) dSign; - } - } - } - - return null; - } - - /** - * @return the destination - */ - public Location getDestination() { - if (getDestinationSign() != null) { - return getDestinationSign().getSign().getLocation(); - - } else { - return null; - } - } - - /** - * @param id - * the ID of the destination sign - */ - public void setDestination(String id) { - destination = id; - } - - @Override - public boolean check() { - return true; - } - - @Override - public void onInit() { - destination = lines[1]; - - if (!getTriggers().isEmpty()) { - getSign().getBlock().setType(Material.AIR); - return; - } - - InteractTrigger trigger = InteractTrigger.getOrCreate(0, getSign().getBlock(), getGameWorld()); - if (trigger != null) { - trigger.addListener(this); - addTrigger(trigger); - } - - getSign().setLine(0, ChatColor.DARK_BLUE + "############"); - getSign().setLine(1, ChatColor.DARK_GREEN + "Warp"); - getSign().setLine(2, ""); - getSign().setLine(3, ChatColor.DARK_BLUE + "############"); - getSign().update(); - } - - @Override - public boolean onPlayerTrigger(Player player) { - PlayerUtil.secureTeleport(player, getDestination()); - return true; - } - - @Override - public DSignType getType() { - return type; - } - -}