From 549baedf4d5e7f0ed2303591d7e29099d80187ce Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sun, 28 Aug 2022 16:36:17 +0200 Subject: [PATCH] Add PistonCalculatorCommand Signed-off-by: yoyosource --- BauSystem_Main/src/BauSystem.properties | 3 ++ BauSystem_Main/src/BauSystem_de.properties | 3 ++ .../util/PistonCalculatorCommand.java | 41 +++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 BauSystem_Main/src/de/steamwar/bausystem/features/util/PistonCalculatorCommand.java diff --git a/BauSystem_Main/src/BauSystem.properties b/BauSystem_Main/src/BauSystem.properties index f4fb2121..19501886 100644 --- a/BauSystem_Main/src/BauSystem.properties +++ b/BauSystem_Main/src/BauSystem.properties @@ -1244,6 +1244,9 @@ SELECT_ITEM_TESTBLOCK=§eDummy CHESTFILLER_FILLED = §eChest filled CHESTFILLER_COUNT = §7{0}§8: §e§l{1} +PISTON_HELP_1 = §7Right click on piston with a slime ball to calculate the moved blocks. +PISTON_HELP_2 = §7Count is red, if one unmoveable block is present. +PISTON_HELP_3 = §7Count is yellow, if too many blocks are present. PISTON_INFO = §7Moved Blocks {0}{1}§8/§712 # Warp diff --git a/BauSystem_Main/src/BauSystem_de.properties b/BauSystem_Main/src/BauSystem_de.properties index 1d10d0c6..65b2a5f7 100644 --- a/BauSystem_Main/src/BauSystem_de.properties +++ b/BauSystem_Main/src/BauSystem_de.properties @@ -1223,6 +1223,9 @@ SELECT_ITEM_TESTBLOCK=§eTestblock CHESTFILLER_FILLED = §eKiste gefüllt +PISTON_HELP_1 = §7Rechts Klick auf Piston mit einem Slime Ball berechnet dir die bewegten Blöcke. +PISTON_HELP_2 = §7Die Anzahl ist Rot, wenn ein unmovable Block vorhanden ist. +PISTON_HELP_3 = §7Die Anzahl ist Gelb, wenn zu viele Blöcke vorhanden sind. PISTON_INFO = §7Bewegte Blöcke {0}{1}§8/§712 # Warp diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/PistonCalculatorCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/PistonCalculatorCommand.java new file mode 100644 index 00000000..1ededcee --- /dev/null +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/util/PistonCalculatorCommand.java @@ -0,0 +1,41 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2022 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 . + */ + +package de.steamwar.bausystem.features.util; + +import de.steamwar.bausystem.BauSystem; +import de.steamwar.bausystem.linkage.LinkageType; +import de.steamwar.bausystem.linkage.Linked; +import de.steamwar.command.SWCommand; +import org.bukkit.entity.Player; + +@Linked(LinkageType.COMMAND) +public class PistonCalculatorCommand extends SWCommand { + + public PistonCalculatorCommand() { + super("piston", "pistoncalculator", "pistoncalc"); + } + + @Register + public void help(Player player) { + BauSystem.MESSAGE.send("PISTON_HELP_1", player); + BauSystem.MESSAGE.send("PISTON_HELP_2", player); + BauSystem.MESSAGE.send("PISTON_HELP_3", player); + } +}