SteamWar/BauSystem
Archiviert
13
0

RedstoneTester #202

Manuell gemergt
YoyoNow hat 29 Commits von RedstoneTester nach master 2021-04-01 18:21:40 +02:00 zusammengeführt
62 geänderte Dateien mit 426 neuen und 404 gelöschten Zeilen
Nur Änderungen aus Commit e3c471d13d werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -33,7 +33,8 @@ import java.util.stream.Collectors;
class AutoLoader_12 {
private AutoLoader_12(){}
private AutoLoader_12() {
}
static boolean tntPlaceActionPerform(Location location) {
Material m = location.getBlock().getType();

Datei anzeigen

@ -28,7 +28,8 @@ import org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
class RegionListener_12 {
private RegionListener_12(){}
private RegionListener_12() {
}
static boolean isWorldEditCommand(String command) {
if (command.startsWith("/")) {

Datei anzeigen

@ -37,7 +37,8 @@ import java.io.IOException;
import java.util.Objects;
class Region_12 {
private Region_12(){}
private Region_12() {
}
static void paste(File file, int x, int y, int z, boolean rotate) {
World w = new BukkitWorld(Bukkit.getWorlds().get(0));

Datei anzeigen

@ -23,7 +23,8 @@ import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
class ScriptListener_12 {
private ScriptListener_12(){}
private ScriptListener_12() {
}
static boolean isNoBook(ItemStack item) {
return item.getType() != Material.BOOK_AND_QUILL && item.getType() != Material.WRITTEN_BOOK;

Datei anzeigen

@ -25,7 +25,8 @@ import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
class CommandDebugStick_15 {
private CommandDebugStick_15(){}
private CommandDebugStick_15() {
}
static void giveStick(Player player){
SWUtils.giveItemToPlayer(player, new ItemStack(Material.DEBUG_STICK));

Datei anzeigen

@ -32,7 +32,8 @@ import java.lang.reflect.InvocationTargetException;
import java.util.logging.Level;
class RegionListener_15 {
private RegionListener_15(){}
private RegionListener_15() {
}
static boolean isWorldEditCommand(String command) {
if (command.startsWith("/")) {

Datei anzeigen

@ -44,7 +44,8 @@ import java.io.IOException;
import java.util.Objects;
class Region_15 {
private Region_15(){}
private Region_15() {
}
static void paste(File file, int x, int y, int z, boolean rotate) {
Clipboard clipboard;

Datei anzeigen

@ -23,7 +23,8 @@ import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
class ScriptListener_15 {
private ScriptListener_15(){}
private ScriptListener_15() {
}
static boolean isNoBook(ItemStack item) {
return item.getType() != Material.WRITABLE_BOOK && item.getType() != Material.WRITTEN_BOOK;

Datei anzeigen

@ -26,7 +26,7 @@ import org.bukkit.entity.Player;
import java.util.LinkedList;
abstract class IAutoLoader {
abstract class AbstractAutoLoader {
abstract Player getPlayer();
abstract boolean setRedstone(Location location, boolean active);
@ -44,9 +44,9 @@ abstract class IAutoLoader {
abstract static class LoaderAction {
final Location location;
final IAutoLoader loader;
final AbstractAutoLoader loader;
LoaderAction(IAutoLoader loader, Location location){
LoaderAction(AbstractAutoLoader loader, Location location){
this.location = location;
this.loader = loader;
loader.getActions().add(this);
@ -63,7 +63,7 @@ abstract class IAutoLoader {
final int length;
int status;
RedstoneActivation(IAutoLoader loader, Location location, int ticks, boolean active){
RedstoneActivation(AbstractAutoLoader loader, Location location, int ticks, boolean active){
super(loader, location);
this.length = ticks;
this.active = active;
@ -93,7 +93,7 @@ abstract class IAutoLoader {
final int length;
int status;
TemporaryActivation(IAutoLoader loader, Location location, int ticks){
TemporaryActivation(AbstractAutoLoader loader, Location location, int ticks){
super(loader, location);
this.length = ticks;
status = 0;

Datei anzeigen

@ -36,6 +36,7 @@ public class CommandClear extends BukkitCommand {
description = "Leere dein Inventar oder das eines anderen Spielers.";
usageMessage = "/clear [Spieler]";
}
public boolean execute(CommandSender sender, String currentAlias, String[] args) {
if (!(sender instanceof Player))
return false;
@ -61,6 +62,7 @@ public class CommandClear extends BukkitCommand {
return true;
}
private void clear(Player player) {
player.getInventory().clear();
player.getInventory().setHelmet(new ItemStack(Material.AIR));

Datei anzeigen

@ -30,10 +30,12 @@ public class CommandFire extends RegionToggleCommand {
String getNoPermMessage() {
return "§cDu darfst hier nicht Feuerschaden (de-)aktivieren";
}
@Override
String getEnableMessage() {
return "§cFeuerschaden deaktiviert";
}
@Override
String getDisableMessage() {
return "§aFeuerschaden aktiviert";

Datei anzeigen

@ -27,7 +27,8 @@ import java.lang.reflect.Field;
public class CommandInjector {
private CommandInjector(){}
private CommandInjector() {
}
private static final String PACKAGE_NAME = Bukkit.getServer().getClass().getPackage().getName();
private static final String VERSION = PACKAGE_NAME.substring(PACKAGE_NAME.lastIndexOf('.') + 1);

Datei anzeigen

@ -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"));
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

Datei anzeigen

@ -69,7 +69,9 @@ public abstract class RegionToggleCommand implements CommandExecutor, Listener {
}
abstract String getNoPermMessage();
abstract String getEnableMessage();
abstract String getDisableMessage();
/**

Datei anzeigen

@ -56,16 +56,19 @@ public class GuiTraceShow {
swInventory.addCloseCallback(clickType -> ShowModeParameterMap.remove(player));
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.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.setCallback(6, clickType -> toggleInterpolateYPosition(player, swInventory, interpolateY));
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.setCallback(7, clickType -> toggleInterpolateXZPosition(player, swInventory, interpolateXZ));
// Water Bucket (-water)

Datei anzeigen

@ -23,5 +23,6 @@ import de.steamwar.bausystem.tracer.TNTPosition;
public interface ShowMode {
void show(TNTPosition position);
void hide();
}

Datei anzeigen

@ -2,7 +2,6 @@ package de.steamwar.bausystem.tracer.show;
import de.steamwar.bausystem.BauSystem;
import de.steamwar.bausystem.tracer.TNTPosition;
import de.steamwar.bausystem.tracer.show.mode.*;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
@ -13,7 +12,8 @@ import java.util.HashMap;
import java.util.Map;
public class TraceShowManager implements Listener {
private TraceShowManager() {}
private TraceShowManager() {
}
private static final Map<Player, ShowMode> showModes = new HashMap<>();

Datei anzeigen

@ -39,7 +39,7 @@ import java.util.LinkedList;
import java.util.ListIterator;
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<>();
@ -184,11 +184,11 @@ public class AutoLoader extends IAutoLoader implements Listener {
if (lastLocation != null && lastLocation.distance(event.getClickedBlock().getLocation()) <= 1) return;
if (detoloader.useActive) {
new IAutoLoader.RedstoneActivation(this, event.getClickedBlock().getLocation()
new AbstractAutoLoader.RedstoneActivation(this, event.getClickedBlock().getLocation()
, detoloader.getActivation() == 0 ? getLastActivation() : detoloader.getActivation()
, detoloader.isActive());
} else {
new IAutoLoader.TemporaryActivation(this, event.getClickedBlock().getLocation()
new AbstractAutoLoader.TemporaryActivation(this, event.getClickedBlock().getLocation()
, detoloader.getActivation());
}
print(detoloader.addBack ? "§e" + detoloader.getBlock() + " betätigt" :
@ -251,9 +251,9 @@ public class AutoLoader extends IAutoLoader implements Listener {
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);
}

Datei anzeigen

@ -68,7 +68,8 @@ public class TPSUtils {
}
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);
}

Datei anzeigen

@ -28,7 +28,8 @@ import org.bukkit.entity.Player;
public class Welt {
private Welt(){}
private Welt() {
}
public static boolean noPermission(Player member, Permission perm) {
if (member.getUniqueId().equals(BauSystem.getOwner()))