Add Countingwand... multilingual
Dieser Commit ist enthalten in:
Ursprung
74e937d7b5
Commit
e127e15304
@ -106,7 +106,7 @@ BAU_NO-PLAYER = §cDer Spieler ist kein Mitglied deiner Welt!
|
|||||||
BAU_NO-WORLD = §cDies ist nicht deine Welt!
|
BAU_NO-WORLD = §cDies ist nicht deine Welt!
|
||||||
|
|
||||||
BAU_INFO_ITEM_NAME = §eBau management
|
BAU_INFO_ITEM_NAME = §eBau management
|
||||||
# This is used in BauInfoBauGuiItem.java
|
## This is used in BauInfoBauGuiItem.java
|
||||||
BAU-INFO_ITEM_LORE-TNT = §7TNT §8: §e{0}
|
BAU-INFO_ITEM_LORE-TNT = §7TNT §8: §e{0}
|
||||||
BAU-INFO_ITEM_LORE-FREEZE = §7Freeze §8: §e{0}
|
BAU-INFO_ITEM_LORE-FREEZE = §7Freeze §8: §e{0}
|
||||||
BAU-INFO_ITEM_LORE-FIRE = §7Feuer §8: §e{0}
|
BAU-INFO_ITEM_LORE-FIRE = §7Feuer §8: §e{0}
|
||||||
@ -118,6 +118,14 @@ BAU-INFO_COMMAND_OWNER = §7Besitzer: §e{0}
|
|||||||
BAU-INFO_COMMAND_MEMBER = §7Mitglieder: §e{0}
|
BAU-INFO_COMMAND_MEMBER = §7Mitglieder: §e{0}
|
||||||
BAU-INFO_COMMAND_FLAG = §e{0} §8: §7{1}
|
BAU-INFO_COMMAND_FLAG = §e{0} §8: §7{1}
|
||||||
|
|
||||||
|
# Countingwand
|
||||||
|
COUNTINGWAND_ITEM_NAME = §eZollstock
|
||||||
|
COUNTINGWAND_ITEM_LORE1 = §eLinksklick §8- §7Setzt die 1. Position
|
||||||
|
COUNTINGWAND_ITEM_LORE2 = §eRechtsklick §8- §7Setzt die 2. Position
|
||||||
|
COUNTINGWAND_MESSAGE_R-CLICK = §7Erste Position bei: §8[§7{0}§8, §7{1}§8, §7{2}§8] ({3})
|
||||||
|
COUNTINGWAND_MESSAGE_L-CLICK = §7Zweite Position bei: §8[§7{0}§8, §7{1}§8, §7{2}§8] ({3})
|
||||||
|
COUNTINGWAND_MESSAGE_DIMENSION = §e{0}§8, §e{1}§8, §e{2}
|
||||||
|
|
||||||
# GUI
|
# GUI
|
||||||
GUI_EDITOR_ITEM-NAME=§eGui Editor
|
GUI_EDITOR_ITEM-NAME=§eGui Editor
|
||||||
GUI_EXPORT_CODE=§eDein Gui-Code:
|
GUI_EXPORT_CODE=§eDein Gui-Code:
|
||||||
|
@ -19,19 +19,15 @@
|
|||||||
|
|
||||||
package de.steamwar.bausystem.features.autostart;
|
package de.steamwar.bausystem.features.autostart;
|
||||||
|
|
||||||
import de.steamwar.bausystem.BauSystem;
|
|
||||||
import de.steamwar.bausystem.Permission;
|
import de.steamwar.bausystem.Permission;
|
||||||
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.bausystem.linkage.specific.BauGuiItem;
|
import de.steamwar.bausystem.linkage.specific.BauGuiItem;
|
||||||
import de.steamwar.inventory.SWItem;
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.inventory.ClickType;
|
import org.bukkit.event.inventory.ClickType;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
@Linked(LinkageType.BAU_GUI_ITEM)
|
@Linked(LinkageType.BAU_GUI_ITEM)
|
||||||
public class AutoStartGuiItem extends BauGuiItem {
|
public class AutoStartGuiItem extends BauGuiItem {
|
||||||
|
|
||||||
@ -41,7 +37,9 @@ public class AutoStartGuiItem extends BauGuiItem {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getItem(Player player) {
|
public ItemStack getItem(Player player) {
|
||||||
return new SWItem(Material.FIREWORK_STAR, BauSystem.MESSAGE.parse("AUTOSTART_ITEM_NAME", player), Arrays.asList(BauSystem.MESSAGE.parse("AUTOSTART_ITEM_LORE", player)), false, null).getItemStack();
|
ItemStack itemStack = AutostartListener.getWandItem(player);
|
||||||
|
itemStack.setType(Material.FIREWORK_STAR);
|
||||||
|
return itemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -25,6 +25,8 @@ import de.steamwar.bausystem.region.Point;
|
|||||||
import de.steamwar.bausystem.shared.Pair;
|
import de.steamwar.bausystem.shared.Pair;
|
||||||
import de.steamwar.inventory.SWItem;
|
import de.steamwar.inventory.SWItem;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
import de.steamwar.message.Message;
|
||||||
import lombok.experimental.UtilityClass;
|
import lombok.experimental.UtilityClass;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -34,17 +36,14 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
@UtilityClass
|
@UtilityClass
|
||||||
public class Countingwand {
|
public class Countingwand {
|
||||||
|
|
||||||
public final ItemStack WAND_ITEM = new SWItem(Material.STICK,
|
public static ItemStack getWandItem(Player player) {
|
||||||
ColorConfig.HIGHLIGHT + "Zollstock",
|
return new SWItem(Material.STICK, BauSystem.MESSAGE.parse("COUNTINGWAND_ITEM_NAME", player), Arrays.asList(BauSystem.MESSAGE.parse("COUNTINGWAND_ITEM_LORE1", player), BauSystem.MESSAGE.parse("COUNTINGWAND_ITEM_LORE2", player)), false, null).getItemStack();
|
||||||
Arrays.asList(ColorConfig.HIGHLIGHT + "Linksklick" + ColorConfig.OTHER + " - " + ColorConfig.BASE + "Setzt die 1. Position",
|
}
|
||||||
ColorConfig.HIGHLIGHT + "Rechtsklick" + ColorConfig.OTHER + " - " + ColorConfig.BASE + "Setzt die 2. Position"),
|
|
||||||
false, clickType -> {
|
|
||||||
}).getItemStack();
|
|
||||||
|
|
||||||
private final Map<String, Pair<Point, Point>> selections = new HashMap<>();
|
private final Map<String, Pair<Point, Point>> selections = new HashMap<>();
|
||||||
|
|
||||||
public boolean isCountingwand(final ItemStack item) {
|
public boolean isCountingwand(Player player, ItemStack itemStack) {
|
||||||
return WAND_ITEM.isSimilar(item);
|
return getWandItem(player).isSimilar(itemStack);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void checkSelection(final Point point, final boolean pos1, final Player p) {
|
public void checkSelection(final Point point, final boolean pos1, final Player p) {
|
||||||
@ -67,38 +66,24 @@ public class Countingwand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (newPos) {
|
if (newPos) {
|
||||||
p.sendMessage(BauSystem.PREFIX
|
String dimension = getDimensions(p, selection.getKey(), selection.getValue());
|
||||||
+ (pos1 ? "Erste Position bei: " : "Zweite Position bei: ")
|
if (pos1) {
|
||||||
+ ColorConfig.OTHER
|
BauSystem.MESSAGE.send("COUNTINGWAND_MESSAGE_R-CLICK", p, point.getX(), point.getY(), point.getZ(), dimension);
|
||||||
+ "["
|
} else {
|
||||||
+ ColorConfig.BASE
|
BauSystem.MESSAGE.send("COUNTINGWAND_MESSAGE_L-CLICK", p, point.getX(), point.getY(), point.getZ(), dimension);
|
||||||
+ point.getX()
|
}
|
||||||
+ ColorConfig.OTHER
|
|
||||||
+ ", "
|
|
||||||
+ ColorConfig.BASE
|
|
||||||
+ point.getY()
|
|
||||||
+ ColorConfig.OTHER
|
|
||||||
+ ", "
|
|
||||||
+ ColorConfig.BASE
|
|
||||||
+ point.getZ()
|
|
||||||
+ ColorConfig.OTHER
|
|
||||||
+ "] ("
|
|
||||||
+ Countingwand.getDimensions(selection.getKey(), selection.getValue())
|
|
||||||
+ ColorConfig.OTHER
|
|
||||||
+ ")");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removePlayer(Player p) {
|
public void removePlayer(Player p) {
|
||||||
selections.remove(p);
|
selections.remove(p.getUniqueId().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDimensions(final Point point1, final Point point2) {
|
public String getDimensions(Player player, final Point point1, final Point point2) {
|
||||||
if (point1 == null || point2 == null) {
|
if (point1 == null || point2 == null) {
|
||||||
return ColorConfig.HIGHLIGHT + "0" + ColorConfig.OTHER + "," + ColorConfig.HIGHLIGHT + "0" + ColorConfig.OTHER + "," + ColorConfig.HIGHLIGHT + "0";
|
return BauSystem.MESSAGE.parse("COUNTINGWAND_MESSAGE_DIMENSION", player, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
return BauSystem.MESSAGE.parse("COUNTINGWAND_MESSAGE_DIMENSION", player, Math.abs(point1.getX() - point2.getX()) + 1, Math.abs(point1.getY() - point2.getY()) + 1, Math.abs(point1.getZ() - point2.getZ()) + 1);
|
||||||
return ColorConfig.HIGHLIGHT + "" + (Math.abs(point1.getX() - point2.getX()) + 1) + ColorConfig.OTHER + ", " + ColorConfig.HIGHLIGHT + "" + (Math.abs(point1.getY() - point2.getY()) + 1) + ColorConfig.OTHER + ", " +ColorConfig.HIGHLIGHT + "" + (Math.abs(point1.getZ() - point2.getZ()) + 1) + ColorConfig.OTHER;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getAmount(final Point point1, final Point point2) {
|
public int getAmount(final Point point1, final Point point2) {
|
||||||
|
@ -20,18 +20,13 @@
|
|||||||
package de.steamwar.bausystem.features.countingwand;
|
package de.steamwar.bausystem.features.countingwand;
|
||||||
|
|
||||||
import de.steamwar.bausystem.Permission;
|
import de.steamwar.bausystem.Permission;
|
||||||
import de.steamwar.bausystem.config.ColorConfig;
|
|
||||||
import de.steamwar.bausystem.linkage.specific.BauGuiItem;
|
|
||||||
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.inventory.SWItem;
|
import de.steamwar.bausystem.linkage.specific.BauGuiItem;
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.inventory.ClickType;
|
import org.bukkit.event.inventory.ClickType;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
|
|
||||||
@Linked(LinkageType.BAU_GUI_ITEM)
|
@Linked(LinkageType.BAU_GUI_ITEM)
|
||||||
public class CountingwandGuiItem extends BauGuiItem {
|
public class CountingwandGuiItem extends BauGuiItem {
|
||||||
@ -42,12 +37,7 @@ public class CountingwandGuiItem extends BauGuiItem {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getItem(Player player) {
|
public ItemStack getItem(Player player) {
|
||||||
return new SWItem(Material.STICK,
|
return Countingwand.getWandItem(player);
|
||||||
ColorConfig.HIGHLIGHT + "Zollstock",
|
|
||||||
Arrays.asList(ColorConfig.HIGHLIGHT + "Linksklick" + ColorConfig.OTHER + " - " + ColorConfig.BASE + "Setzt die 1. Position",
|
|
||||||
ColorConfig.HIGHLIGHT + "Rechtsklick" + ColorConfig.OTHER + " - " + ColorConfig.BASE + "Setzt die 2. Position"),
|
|
||||||
false, clickType -> {
|
|
||||||
}).getItemStack();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -36,7 +36,7 @@ public class CountingwandListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onBlockBreak(final BlockBreakEvent event) {
|
public void onBlockBreak(final BlockBreakEvent event) {
|
||||||
if (!Countingwand.isCountingwand(event.getPlayer().getInventory().getItemInMainHand())) {
|
if (!Countingwand.isCountingwand(event.getPlayer(), event.getPlayer().getInventory().getItemInMainHand())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ public class CountingwandListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerInteract(final PlayerInteractEvent event) {
|
public void onPlayerInteract(final PlayerInteractEvent event) {
|
||||||
if (!Countingwand.isCountingwand(event.getItem())) {
|
if (!Countingwand.isCountingwand(event.getPlayer(), event.getItem())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren