Merge branch 'master' into RedstoneTester
Dieser Commit ist enthalten in:
Commit
e3c471d13d
@ -33,7 +33,8 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
|
|
||||||
class AutoLoader_12 {
|
class AutoLoader_12 {
|
||||||
private AutoLoader_12(){}
|
private AutoLoader_12() {
|
||||||
|
}
|
||||||
|
|
||||||
static boolean tntPlaceActionPerform(Location location) {
|
static boolean tntPlaceActionPerform(Location location) {
|
||||||
Material m = location.getBlock().getType();
|
Material m = location.getBlock().getType();
|
||||||
|
@ -28,7 +28,8 @@ import org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
class RegionListener_12 {
|
class RegionListener_12 {
|
||||||
private RegionListener_12(){}
|
private RegionListener_12() {
|
||||||
|
}
|
||||||
|
|
||||||
static boolean isWorldEditCommand(String command) {
|
static boolean isWorldEditCommand(String command) {
|
||||||
if (command.startsWith("/")) {
|
if (command.startsWith("/")) {
|
||||||
|
@ -37,7 +37,8 @@ import java.io.IOException;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
class Region_12 {
|
class Region_12 {
|
||||||
private Region_12(){}
|
private Region_12() {
|
||||||
|
}
|
||||||
|
|
||||||
static void paste(File file, int x, int y, int z, boolean rotate) {
|
static void paste(File file, int x, int y, int z, boolean rotate) {
|
||||||
World w = new BukkitWorld(Bukkit.getWorlds().get(0));
|
World w = new BukkitWorld(Bukkit.getWorlds().get(0));
|
||||||
|
@ -23,7 +23,8 @@ import org.bukkit.Material;
|
|||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
class ScriptListener_12 {
|
class ScriptListener_12 {
|
||||||
private ScriptListener_12(){}
|
private ScriptListener_12() {
|
||||||
|
}
|
||||||
|
|
||||||
static boolean isNoBook(ItemStack item) {
|
static boolean isNoBook(ItemStack item) {
|
||||||
return item.getType() != Material.BOOK_AND_QUILL && item.getType() != Material.WRITTEN_BOOK;
|
return item.getType() != Material.BOOK_AND_QUILL && item.getType() != Material.WRITTEN_BOOK;
|
||||||
|
@ -25,7 +25,8 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
class CommandDebugStick_15 {
|
class CommandDebugStick_15 {
|
||||||
private CommandDebugStick_15(){}
|
private CommandDebugStick_15() {
|
||||||
|
}
|
||||||
|
|
||||||
static void giveStick(Player player){
|
static void giveStick(Player player){
|
||||||
SWUtils.giveItemToPlayer(player, new ItemStack(Material.DEBUG_STICK));
|
SWUtils.giveItemToPlayer(player, new ItemStack(Material.DEBUG_STICK));
|
||||||
|
@ -32,7 +32,8 @@ import java.lang.reflect.InvocationTargetException;
|
|||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
class RegionListener_15 {
|
class RegionListener_15 {
|
||||||
private RegionListener_15(){}
|
private RegionListener_15() {
|
||||||
|
}
|
||||||
|
|
||||||
static boolean isWorldEditCommand(String command) {
|
static boolean isWorldEditCommand(String command) {
|
||||||
if (command.startsWith("/")) {
|
if (command.startsWith("/")) {
|
||||||
|
@ -44,7 +44,8 @@ import java.io.IOException;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
class Region_15 {
|
class Region_15 {
|
||||||
private Region_15(){}
|
private Region_15() {
|
||||||
|
}
|
||||||
|
|
||||||
static void paste(File file, int x, int y, int z, boolean rotate) {
|
static void paste(File file, int x, int y, int z, boolean rotate) {
|
||||||
Clipboard clipboard;
|
Clipboard clipboard;
|
||||||
|
@ -23,7 +23,8 @@ import org.bukkit.Material;
|
|||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
class ScriptListener_15 {
|
class ScriptListener_15 {
|
||||||
private ScriptListener_15(){}
|
private ScriptListener_15() {
|
||||||
|
}
|
||||||
|
|
||||||
static boolean isNoBook(ItemStack item) {
|
static boolean isNoBook(ItemStack item) {
|
||||||
return item.getType() != Material.WRITABLE_BOOK && item.getType() != Material.WRITTEN_BOOK;
|
return item.getType() != Material.WRITABLE_BOOK && item.getType() != Material.WRITTEN_BOOK;
|
||||||
|
@ -26,7 +26,7 @@ import org.bukkit.entity.Player;
|
|||||||
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
|
|
||||||
abstract class IAutoLoader {
|
abstract class AbstractAutoLoader {
|
||||||
|
|
||||||
abstract Player getPlayer();
|
abstract Player getPlayer();
|
||||||
abstract boolean setRedstone(Location location, boolean active);
|
abstract boolean setRedstone(Location location, boolean active);
|
||||||
@ -44,9 +44,9 @@ abstract class IAutoLoader {
|
|||||||
abstract static class LoaderAction {
|
abstract static class LoaderAction {
|
||||||
|
|
||||||
final Location location;
|
final Location location;
|
||||||
final IAutoLoader loader;
|
final AbstractAutoLoader loader;
|
||||||
|
|
||||||
LoaderAction(IAutoLoader loader, Location location){
|
LoaderAction(AbstractAutoLoader loader, Location location){
|
||||||
this.location = location;
|
this.location = location;
|
||||||
this.loader = loader;
|
this.loader = loader;
|
||||||
loader.getActions().add(this);
|
loader.getActions().add(this);
|
||||||
@ -63,7 +63,7 @@ abstract class IAutoLoader {
|
|||||||
final int length;
|
final int length;
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
RedstoneActivation(IAutoLoader loader, Location location, int ticks, boolean active){
|
RedstoneActivation(AbstractAutoLoader loader, Location location, int ticks, boolean active){
|
||||||
super(loader, location);
|
super(loader, location);
|
||||||
this.length = ticks;
|
this.length = ticks;
|
||||||
this.active = active;
|
this.active = active;
|
||||||
@ -93,7 +93,7 @@ abstract class IAutoLoader {
|
|||||||
final int length;
|
final int length;
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
TemporaryActivation(IAutoLoader loader, Location location, int ticks){
|
TemporaryActivation(AbstractAutoLoader loader, Location location, int ticks){
|
||||||
super(loader, location);
|
super(loader, location);
|
||||||
this.length = ticks;
|
this.length = ticks;
|
||||||
status = 0;
|
status = 0;
|
@ -36,6 +36,7 @@ public class CommandClear extends BukkitCommand {
|
|||||||
description = "Leere dein Inventar oder das eines anderen Spielers.";
|
description = "Leere dein Inventar oder das eines anderen Spielers.";
|
||||||
usageMessage = "/clear [Spieler]";
|
usageMessage = "/clear [Spieler]";
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean execute(CommandSender sender, String currentAlias, String[] args) {
|
public boolean execute(CommandSender sender, String currentAlias, String[] args) {
|
||||||
if (!(sender instanceof Player))
|
if (!(sender instanceof Player))
|
||||||
return false;
|
return false;
|
||||||
@ -61,6 +62,7 @@ public class CommandClear extends BukkitCommand {
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void clear(Player player) {
|
private void clear(Player player) {
|
||||||
player.getInventory().clear();
|
player.getInventory().clear();
|
||||||
player.getInventory().setHelmet(new ItemStack(Material.AIR));
|
player.getInventory().setHelmet(new ItemStack(Material.AIR));
|
||||||
|
@ -30,10 +30,12 @@ public class CommandFire extends RegionToggleCommand {
|
|||||||
String getNoPermMessage() {
|
String getNoPermMessage() {
|
||||||
return "§cDu darfst hier nicht Feuerschaden (de-)aktivieren";
|
return "§cDu darfst hier nicht Feuerschaden (de-)aktivieren";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
String getEnableMessage() {
|
String getEnableMessage() {
|
||||||
return "§cFeuerschaden deaktiviert";
|
return "§cFeuerschaden deaktiviert";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
String getDisableMessage() {
|
String getDisableMessage() {
|
||||||
return "§aFeuerschaden aktiviert";
|
return "§aFeuerschaden aktiviert";
|
||||||
|
@ -27,7 +27,8 @@ import java.lang.reflect.Field;
|
|||||||
|
|
||||||
public class CommandInjector {
|
public class CommandInjector {
|
||||||
|
|
||||||
private CommandInjector(){}
|
private CommandInjector() {
|
||||||
|
}
|
||||||
|
|
||||||
private static final String PACKAGE_NAME = Bukkit.getServer().getClass().getPackage().getName();
|
private static final String PACKAGE_NAME = Bukkit.getServer().getClass().getPackage().getName();
|
||||||
private static final String VERSION = PACKAGE_NAME.substring(PACKAGE_NAME.lastIndexOf('.') + 1);
|
private static final String VERSION = PACKAGE_NAME.substring(PACKAGE_NAME.lastIndexOf('.') + 1);
|
||||||
|
@ -35,7 +35,8 @@ public class CommandTPSLimiterTabComplete implements TabCompleter {
|
|||||||
private List<String> arguments = new ArrayList<>(Arrays.asList("default", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"));
|
private List<String> arguments = new ArrayList<>(Arrays.asList("default", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"));
|
||||||
|
|
||||||
public CommandTPSLimiterTabComplete() {
|
public CommandTPSLimiterTabComplete() {
|
||||||
if (TPSUtils.isWarpAllowed()) arguments.addAll(Arrays.asList("21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40"));
|
if (TPSUtils.isWarpAllowed())
|
||||||
|
arguments.addAll(Arrays.asList("21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -69,7 +69,9 @@ public abstract class RegionToggleCommand implements CommandExecutor, Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
abstract String getNoPermMessage();
|
abstract String getNoPermMessage();
|
||||||
|
|
||||||
abstract String getEnableMessage();
|
abstract String getEnableMessage();
|
||||||
|
|
||||||
abstract String getDisableMessage();
|
abstract String getDisableMessage();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -56,16 +56,19 @@ public class GuiTraceShow {
|
|||||||
swInventory.addCloseCallback(clickType -> ShowModeParameterMap.remove(player));
|
swInventory.addCloseCallback(clickType -> ShowModeParameterMap.remove(player));
|
||||||
setActiveShow(player, swInventory);
|
setActiveShow(player, swInventory);
|
||||||
|
|
||||||
SWItem water = new SWItem(Material.TNT, "§eWasser §7Positionen", Arrays.asList("§7Zeigt alles TNT, welches", "§7im Wasser explodiert ist."), false, clickType -> {});
|
SWItem water = new SWItem(Material.TNT, "§eWasser §7Positionen", Arrays.asList("§7Zeigt alles TNT, welches", "§7im Wasser explodiert ist."), false, clickType -> {
|
||||||
|
});
|
||||||
swInventory.setItem(5, water);
|
swInventory.setItem(5, water);
|
||||||
swInventory.setCallback(5, clickType -> toggleHideTNTinWaterExploded(player, swInventory, water));
|
swInventory.setCallback(5, clickType -> toggleHideTNTinWaterExploded(player, swInventory, water));
|
||||||
|
|
||||||
SWItem interpolateY = new SWItem(Material.QUARTZ_STAIRS, "§eInterpolation §7Y-Achse", Arrays.asList("§7Zeigt die Interpolation", "§7auf der Y-Achse."), false, clickType -> {});
|
SWItem interpolateY = new SWItem(Material.QUARTZ_STAIRS, "§eInterpolation §7Y-Achse", Arrays.asList("§7Zeigt die Interpolation", "§7auf der Y-Achse."), false, clickType -> {
|
||||||
|
});
|
||||||
swInventory.setItem(6, interpolateY);
|
swInventory.setItem(6, interpolateY);
|
||||||
swInventory.setCallback(6, clickType -> toggleInterpolateYPosition(player, swInventory, interpolateY));
|
swInventory.setCallback(6, clickType -> toggleInterpolateYPosition(player, swInventory, interpolateY));
|
||||||
|
|
||||||
Material xzMaterial = VersionedCallable.call(new VersionedCallable<>(TNTTracer_12::getTraceXZMaterial, 8), new VersionedCallable<>(TNTTracer_15::getTraceXZMaterial, 14));
|
Material xzMaterial = VersionedCallable.call(new VersionedCallable<>(TNTTracer_12::getTraceXZMaterial, 8), new VersionedCallable<>(TNTTracer_15::getTraceXZMaterial, 14));
|
||||||
SWItem interpolateXZ = new SWItem(xzMaterial, (byte) 7, "§eInterpolation §7XZ-Achse", Arrays.asList("§7Zeigt die Interpolation", "§7auf der XZ-Achse."), false, clickType -> {});
|
SWItem interpolateXZ = new SWItem(xzMaterial, (byte) 7, "§eInterpolation §7XZ-Achse", Arrays.asList("§7Zeigt die Interpolation", "§7auf der XZ-Achse."), false, clickType -> {
|
||||||
|
});
|
||||||
swInventory.setItem(7, interpolateXZ);
|
swInventory.setItem(7, interpolateXZ);
|
||||||
swInventory.setCallback(7, clickType -> toggleInterpolateXZPosition(player, swInventory, interpolateXZ));
|
swInventory.setCallback(7, clickType -> toggleInterpolateXZPosition(player, swInventory, interpolateXZ));
|
||||||
// Water Bucket (-water)
|
// Water Bucket (-water)
|
||||||
|
@ -23,5 +23,6 @@ import de.steamwar.bausystem.tracer.TNTPosition;
|
|||||||
|
|
||||||
public interface ShowMode {
|
public interface ShowMode {
|
||||||
void show(TNTPosition position);
|
void show(TNTPosition position);
|
||||||
|
|
||||||
void hide();
|
void hide();
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@ package de.steamwar.bausystem.tracer.show;
|
|||||||
|
|
||||||
import de.steamwar.bausystem.BauSystem;
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.bausystem.tracer.TNTPosition;
|
import de.steamwar.bausystem.tracer.TNTPosition;
|
||||||
import de.steamwar.bausystem.tracer.show.mode.*;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@ -13,7 +12,8 @@ import java.util.HashMap;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class TraceShowManager implements Listener {
|
public class TraceShowManager implements Listener {
|
||||||
private TraceShowManager() {}
|
private TraceShowManager() {
|
||||||
|
}
|
||||||
|
|
||||||
private static final Map<Player, ShowMode> showModes = new HashMap<>();
|
private static final Map<Player, ShowMode> showModes = new HashMap<>();
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ import java.util.LinkedList;
|
|||||||
import java.util.ListIterator;
|
import java.util.ListIterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class AutoLoader extends IAutoLoader implements Listener {
|
public class AutoLoader extends AbstractAutoLoader implements Listener {
|
||||||
|
|
||||||
private static final Map<Player, AutoLoader> players = new HashMap<>();
|
private static final Map<Player, AutoLoader> players = new HashMap<>();
|
||||||
|
|
||||||
@ -184,11 +184,11 @@ public class AutoLoader extends IAutoLoader implements Listener {
|
|||||||
if (lastLocation != null && lastLocation.distance(event.getClickedBlock().getLocation()) <= 1) return;
|
if (lastLocation != null && lastLocation.distance(event.getClickedBlock().getLocation()) <= 1) return;
|
||||||
|
|
||||||
if (detoloader.useActive) {
|
if (detoloader.useActive) {
|
||||||
new IAutoLoader.RedstoneActivation(this, event.getClickedBlock().getLocation()
|
new AbstractAutoLoader.RedstoneActivation(this, event.getClickedBlock().getLocation()
|
||||||
, detoloader.getActivation() == 0 ? getLastActivation() : detoloader.getActivation()
|
, detoloader.getActivation() == 0 ? getLastActivation() : detoloader.getActivation()
|
||||||
, detoloader.isActive());
|
, detoloader.isActive());
|
||||||
} else {
|
} else {
|
||||||
new IAutoLoader.TemporaryActivation(this, event.getClickedBlock().getLocation()
|
new AbstractAutoLoader.TemporaryActivation(this, event.getClickedBlock().getLocation()
|
||||||
, detoloader.getActivation());
|
, detoloader.getActivation());
|
||||||
}
|
}
|
||||||
print(detoloader.addBack ? "§e" + detoloader.getBlock() + " betätigt" :
|
print(detoloader.addBack ? "§e" + detoloader.getBlock() + " betätigt" :
|
||||||
@ -251,9 +251,9 @@ public class AutoLoader extends IAutoLoader implements Listener {
|
|||||||
return lastActivation;
|
return lastActivation;
|
||||||
}
|
}
|
||||||
|
|
||||||
class TNTPlaceAction extends IAutoLoader.LoaderAction {
|
class TNTPlaceAction extends AbstractAutoLoader.LoaderAction {
|
||||||
|
|
||||||
TNTPlaceAction(IAutoLoader loader, Location location){
|
TNTPlaceAction(AbstractAutoLoader loader, Location location){
|
||||||
super(loader, location);
|
super(loader, location);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,7 +68,8 @@ public class TPSUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static double getTps(TPSWatcher.TPSType tpsType) {
|
public static double getTps(TPSWatcher.TPSType tpsType) {
|
||||||
if (TPSUtils.isWarping()) return TPSWatcher.getTPS(tpsType, Math.max(CommandTPSLimiter.getCurrentTPSLimit(), 20));
|
if (TPSUtils.isWarping())
|
||||||
|
return TPSWatcher.getTPS(tpsType, Math.max(CommandTPSLimiter.getCurrentTPSLimit(), 20));
|
||||||
return TPSWatcher.getTPS(tpsType);
|
return TPSWatcher.getTPS(tpsType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,7 +28,8 @@ import org.bukkit.entity.Player;
|
|||||||
|
|
||||||
public class Welt {
|
public class Welt {
|
||||||
|
|
||||||
private Welt(){}
|
private Welt() {
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean noPermission(Player member, Permission perm) {
|
public static boolean noPermission(Player member, Permission perm) {
|
||||||
if (member.getUniqueId().equals(BauSystem.getOwner()))
|
if (member.getUniqueId().equals(BauSystem.getOwner()))
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren