Add RedstoneTesterGuiItem
Dieser Commit ist enthalten in:
Ursprung
1c166d10d7
Commit
3f7d0cf4cf
@ -0,0 +1,57 @@
|
|||||||
|
/*
|
||||||
|
* This file is a part of the SteamWar software.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2021 SteamWar.de-Serverteam
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero 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 Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package de.steamwar.bausystem.features.redstonetester;
|
||||||
|
|
||||||
|
import de.steamwar.bausystem.Permission;
|
||||||
|
import de.steamwar.bausystem.config.ColorConfig;
|
||||||
|
import de.steamwar.bausystem.linkage.GuiItem;
|
||||||
|
import de.steamwar.bausystem.linkage.LinkageType;
|
||||||
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
|
import de.steamwar.inventory.SWItem;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
@Linked(LinkageType.GUI_ITEM)
|
||||||
|
public class RedstoneTesterGuiItem extends GuiItem {
|
||||||
|
|
||||||
|
public RedstoneTesterGuiItem() {
|
||||||
|
super(23);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack getItem(Player player) {
|
||||||
|
return new SWItem(Material.BLAZE_ROD, ColorConfig.HIGHLIGHT + "Redstonetester", Arrays.asList(ColorConfig.HIGHLIGHT + "Linksklick Block " + ColorConfig.OTHER + "-" + ColorConfig.BASE + " Setzt die 1. Position", ColorConfig.HIGHLIGHT + "Rechtsklick Block " + ColorConfig.OTHER + "-" + ColorConfig.BASE + " Setzt die 2. Position", ColorConfig.HIGHLIGHT + "Shift-Rechtsklick Luft " + ColorConfig.OTHER + "-" + ColorConfig.BASE + " Zurücksetzten"), false, null).getItemStack();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean click(ClickType click, Player p) {
|
||||||
|
p.performCommand("redstonetester");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Permission permission() {
|
||||||
|
return Permission.MEMBER;
|
||||||
|
}
|
||||||
|
}
|
@ -25,7 +25,6 @@ import de.steamwar.bausystem.config.ColorConfig;
|
|||||||
import de.steamwar.bausystem.linkage.LinkageType;
|
import de.steamwar.bausystem.linkage.LinkageType;
|
||||||
import de.steamwar.bausystem.linkage.Linked;
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
import de.steamwar.command.SWCommand;
|
import de.steamwar.command.SWCommand;
|
||||||
import de.steamwar.core.VersionedRunnable;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
@Linked(LinkageType.COMMAND)
|
@Linked(LinkageType.COMMAND)
|
||||||
@ -42,9 +41,7 @@ public class RedstonetesterCommand extends SWCommand {
|
|||||||
|
|
||||||
@Register
|
@Register
|
||||||
public void genericCommand(Player p) {
|
public void genericCommand(Player p) {
|
||||||
VersionedRunnable.call(new VersionedRunnable(() -> p.sendMessage(BauSystem.PREFIX + "Der RedstoneTester ist nicht in der 1.12 verfügbar"), 8), new VersionedRunnable(() -> {
|
p.sendMessage(BauSystem.PREFIX + "Messe die Zeit zwischen der Aktivierung zweier Redstone Komponenten");
|
||||||
p.sendMessage(BauSystem.PREFIX + "Messe die Zeit zwischen der Aktivierung zweier Redstone Komponenten");
|
SWUtils.giveItemToPlayer(p, RedstonetesterUtils.WAND);
|
||||||
SWUtils.giveItemToPlayer(p, RedstonetesterUtils.WAND);
|
|
||||||
}, 15));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
In neuem Issue referenzieren
Einen Benutzer sperren