Add note sign; resolves #511

This commit is contained in:
Daniel Saukel 2019-03-01 20:09:05 +01:00
parent 5892181a5d
commit 74ac2d1221
2 changed files with 49 additions and 0 deletions

View File

@ -59,6 +59,7 @@ public enum DSignTypeDefault implements DSignType {
LOBBY("Lobby", "lobby", true, false, LobbySign.class), LOBBY("Lobby", "lobby", true, false, LobbySign.class),
MOB("Mob", "mob", false, false, MobSign.class), MOB("Mob", "mob", false, false, MobSign.class),
MESSAGE("MSG", "msg", false, false, MessageSign.class), MESSAGE("MSG", "msg", false, false, MessageSign.class),
NOTE("Note", "note", false, false, NoteSign.class),
OPEN_DOOR("Door", "door", false, false, OpenDoorSign.class), OPEN_DOOR("Door", "door", false, false, OpenDoorSign.class),
PLACE("Place", "place", false, false, PlaceSign.class), PLACE("Place", "place", false, false, PlaceSign.class),
PROTECTION("Protection", "protection", false, false, ProtectionSign.class), PROTECTION("Protection", "protection", false, false, ProtectionSign.class),

View File

@ -0,0 +1,48 @@
/*
* Copyright (C) 2012-2019 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 <http://www.gnu.org/licenses/>.
*/
package de.erethon.dungeonsxl.sign;
import de.erethon.caliburn.item.VanillaItem;
import de.erethon.dungeonsxl.DungeonsXL;
import de.erethon.dungeonsxl.world.DGameWorld;
import org.bukkit.block.Sign;
/**
* @author Daniel Saukel
*/
public class NoteSign extends DSign {
public NoteSign(DungeonsXL plugin, Sign sign, String[] lines, DGameWorld gameWorld) {
super(plugin, sign, lines, gameWorld);
}
@Override
public boolean check() {
return true;
}
@Override
public void onInit() {
getSign().getBlock().setType(VanillaItem.AIR.getMaterial());
}
@Override
public DSignType getType() {
return DSignTypeDefault.NOTE;
}
}