From 74ac2d122149a73da1dba68bc2d6679c8cb6d741 Mon Sep 17 00:00:00 2001 From: Daniel Saukel Date: Fri, 1 Mar 2019 20:09:05 +0100 Subject: [PATCH] Add note sign; resolves #511 --- .../dungeonsxl/sign/DSignTypeDefault.java | 1 + .../de/erethon/dungeonsxl/sign/NoteSign.java | 48 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 src/main/java/de/erethon/dungeonsxl/sign/NoteSign.java diff --git a/src/main/java/de/erethon/dungeonsxl/sign/DSignTypeDefault.java b/src/main/java/de/erethon/dungeonsxl/sign/DSignTypeDefault.java index 7c5a4de4..70396bc6 100644 --- a/src/main/java/de/erethon/dungeonsxl/sign/DSignTypeDefault.java +++ b/src/main/java/de/erethon/dungeonsxl/sign/DSignTypeDefault.java @@ -59,6 +59,7 @@ public enum DSignTypeDefault implements DSignType { LOBBY("Lobby", "lobby", true, false, LobbySign.class), MOB("Mob", "mob", false, false, MobSign.class), MESSAGE("MSG", "msg", false, false, MessageSign.class), + NOTE("Note", "note", false, false, NoteSign.class), OPEN_DOOR("Door", "door", false, false, OpenDoorSign.class), PLACE("Place", "place", false, false, PlaceSign.class), PROTECTION("Protection", "protection", false, false, ProtectionSign.class), diff --git a/src/main/java/de/erethon/dungeonsxl/sign/NoteSign.java b/src/main/java/de/erethon/dungeonsxl/sign/NoteSign.java new file mode 100644 index 00000000..2f075231 --- /dev/null +++ b/src/main/java/de/erethon/dungeonsxl/sign/NoteSign.java @@ -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 . + */ +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; + } + +}