diff --git a/BauSystem_Linkage/build.gradle b/BauSystem_Linkage/build.gradle
new file mode 100644
index 00000000..486cb7c7
--- /dev/null
+++ b/BauSystem_Linkage/build.gradle
@@ -0,0 +1,69 @@
+/*
+ * This file is a part of the SteamWar software.
+ *
+ * Copyright (C) 2020 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 .
+ */
+
+plugins {
+ id 'base'
+ id 'java'
+}
+
+group 'steamwar'
+version '1.0'
+
+compileJava.options.encoding = 'UTF-8'
+
+sourceCompatibility = 1.8
+targetCompatibility = 1.8
+
+sourceSets {
+ main {
+ java {
+ srcDirs = ['src/']
+ }
+ resources {
+ srcDirs = ['src/']
+ exclude '**/*.java', '**/*.kt'
+ }
+ }
+}
+
+dependencies {
+ compileOnly 'org.projectlombok:lombok:1.18.22'
+ testCompileOnly 'org.projectlombok:lombok:1.18.22'
+ annotationProcessor 'org.projectlombok:lombok:1.18.22'
+ testAnnotationProcessor 'org.projectlombok:lombok:1.18.22'
+
+ implementation 'org.atteo.classindex:classindex:3.11'
+ testImplementation 'org.atteo.classindex:classindex:3.11'
+ annotationProcessor 'org.atteo.classindex:classindex:3.11'
+ testAnnotationProcessor 'org.atteo.classindex:classindex:3.11'
+}
+
+task buildResources {
+ doLast {
+ File from = new File("${buildDir}/classes/java/main/META-INF/annotations/de.steamwar.bausystem.linkage.ProcessorImplementation")
+ File to = new File("${buildDir}/classes/java/main/META-INF/services/javax.annotation.processing.Processor")
+ to.delete()
+ to.parentFile.mkdirs()
+ to.createNewFile()
+ for (String s : from.readLines()) {
+ to.append(s + "\n")
+ }
+ }
+}
+classes.finalizedBy(buildResources)
\ No newline at end of file
diff --git a/BauSystem_Linkage/src/de/steamwar/bausystem/linkage/LinkageProcessor.java b/BauSystem_Linkage/src/de/steamwar/bausystem/linkage/LinkageProcessor.java
new file mode 100644
index 00000000..f615dd1f
--- /dev/null
+++ b/BauSystem_Linkage/src/de/steamwar/bausystem/linkage/LinkageProcessor.java
@@ -0,0 +1,139 @@
+/*
+ * 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.linkage;
+
+import lombok.SneakyThrows;
+
+import javax.annotation.processing.*;
+import javax.lang.model.SourceVersion;
+import javax.lang.model.element.*;
+import javax.lang.model.type.DeclaredType;
+import javax.tools.Diagnostic;
+import javax.tools.JavaFileObject;
+import java.io.Writer;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@ProcessorImplementation
+@SupportedAnnotationTypes("de.steamwar.bausystem.linkage.Linked")
+public class LinkageProcessor extends AbstractProcessor {
+
+ private Messager messager;
+ private Writer writer;
+ private boolean processed = false;
+
+ @Override
+ public SourceVersion getSupportedSourceVersion() {
+ return SourceVersion.latestSupported();
+ }
+
+ @SneakyThrows
+ @Override
+ public synchronized void init(ProcessingEnvironment processingEnv) {
+ super.init(processingEnv);
+ writer = processingEnv.getFiler().createSourceFile("de.steamwar.bausystem.linkage.LinkageUtils").openWriter();
+ messager = processingEnv.getMessager();
+ }
+
+ @SneakyThrows
+ @Override
+ public boolean process(Set extends TypeElement> annotations, RoundEnvironment roundEnv) {
+ if (processed) return false;
+ processed = true;
+ List fields = new ArrayList<>();
+ List linkLines = new ArrayList<>();
+ List unlinkLines = new ArrayList<>();
+
+ Set extends Element> elements = roundEnv.getElementsAnnotatedWith(Linked.class);
+ elements.addAll((Set)roundEnv.getElementsAnnotatedWith(Linked.Linkages.class));
+ for (Element element : elements) {
+ if (element.getKind() != ElementKind.CLASS) {
+ continue;
+ }
+ TypeElement typeElement = (TypeElement) element;
+ Linked[] linkeds = element.getAnnotationsByType(Linked.class);
+ if (linkeds.length == 0) {
+ continue;
+ }
+
+ System.out.println("Found element: " + typeElement.getQualifiedName().toString());
+
+ fields.add(typeElement.getQualifiedName().toString() + " " + typeElement.getSimpleName().toString() + " = new " + typeElement.getQualifiedName().toString() + "()");
+ Arrays.stream(linkeds).map(Linked::value).forEach(linkageType -> {
+ if (linkageType.toRun == null) return;
+ if (linkageType.className != null) {
+ if (!typeElement.getSuperclass().toString().equals(linkageType.className)) {
+ return;
+ }
+ }
+ if (linkageType.interfaceName != null) {
+ if (typeElement.getInterfaces().stream().noneMatch(i -> i.toString().equals(linkageType.interfaceName))) {
+ return;
+ }
+ }
+ (linkageType.unlink ? unlinkLines : linkLines).add(linkageType.toRun.replace("$", typeElement.getSimpleName().toString()));
+ });
+
+ List variableElements = typeElement.getEnclosedElements().stream().filter(e -> e.getKind() == ElementKind.FIELD).map(e -> (VariableElement) e).filter(e -> {
+ return e.getAnnotation(LinkedInstance.class) != null;
+ }).collect(Collectors.toList());
+ if (variableElements.isEmpty()) {
+ continue;
+ }
+ for (VariableElement variableElement : variableElements) {
+ if (!variableElement.getModifiers().contains(Modifier.PUBLIC)) {
+ messager.printMessage(Diagnostic.Kind.ERROR, "Field " + variableElement.getSimpleName() + " must be public", variableElement);
+ continue;
+ }
+ if (variableElement.getModifiers().contains(Modifier.STATIC)) {
+ messager.printMessage(Diagnostic.Kind.ERROR, "Field " + variableElement.getSimpleName() + " must be non static", variableElement);
+ continue;
+ }
+ if (variableElement.getModifiers().contains(Modifier.FINAL)) {
+ messager.printMessage(Diagnostic.Kind.ERROR, "Field " + variableElement.getSimpleName() + " must be non final", variableElement);
+ continue;
+ }
+ linkLines.add(typeElement.getSimpleName().toString() + "." + variableElement.getSimpleName().toString() + " = " + ((DeclaredType) variableElement.asType()).asElement().getSimpleName().toString());
+ }
+ }
+
+ writer.write("package de.steamwar.bausystem.linkage;\n\n");
+ writer.write("public class LinkageUtils {\n");
+ for (String s : fields) {
+ writer.write(" public static " + s + ";\n");
+ }
+ writer.write("\n");
+ writer.write(" public static void link() {\n");
+ for (String s : linkLines) {
+ writer.write(" " + s + ";\n");
+ }
+ writer.write(" }\n");
+ writer.write("\n");
+ writer.write(" public static void unlink() {\n");
+ for (String s : unlinkLines) {
+ writer.write(" " + s + ";\n");
+ }
+ writer.write(" }\n");
+ writer.write("}\n");
+ writer.flush();
+ writer.close();
+ return true;
+ }
+}
diff --git a/BauSystem_Linkage/src/de/steamwar/bausystem/linkage/LinkageType.java b/BauSystem_Linkage/src/de/steamwar/bausystem/linkage/LinkageType.java
new file mode 100644
index 00000000..81e506e7
--- /dev/null
+++ b/BauSystem_Linkage/src/de/steamwar/bausystem/linkage/LinkageType.java
@@ -0,0 +1,55 @@
+/*
+ * 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.linkage;
+
+import lombok.AllArgsConstructor;
+import lombok.RequiredArgsConstructor;
+
+@RequiredArgsConstructor
+@AllArgsConstructor
+public enum LinkageType {
+
+ // NORMAL
+ COMMAND(false, "$.setMessage(de.steamwar.bausystem.BauSystem.MESSAGE)", "de.steamwar.command.SWCommand"),
+ ENABLE_LINK(false, "$.enable()", null, "de.steamwar.bausystem.linkage.Enable"),
+ DISABLE_LINK(true, "$.disable()", null, "de.steamwar.bausystem.linkage.Disable"),
+ PLAIN(false),
+ LISTENER(false, "org.bukkit.Bukkit.getPluginManager().registerEvents($, de.steamwar.bausystem.BauSystem.getInstance())", null, "org.bukkit.event.Listener"),
+ UNLINK_LISTENER(true, "org.bukkit.event.HandlerList.unregisterAll($)", null, "org.bukkit.event.Listener"),
+
+ // SPECIFIC
+ BAU_GUI_ITEM(false, "de.steamwar.bausystem.features.gui.BauGUI.addItem($)", "de.steamwar.bausystem.linkage.specific.BauGuiItem"),
+ SCRIPT_COMMAND(false, "de.steamwar.bausystem.features.script.ScriptExecutor.SPECIAL_COMMANDS.add($)", null, "de.steamwar.bausystem.features.script.SpecialCommand"),
+ CONFIG_CONVERTER(false, "de.steamwar.bausystem.configplayer.Config.addConfigConverter($)", null, "de.steamwar.bausystem.configplayer.ConfigConverter"),
+ SCOREBOARD(false, null, null, "de.steamwar.bausystem.linkage.specific.ScoreboardItem"),
+ PANZERN(false, "de.steamwar.bausystem.features.slaves.panzern.PanzernAlgorithmLazyInit.add($)", null, "de.steamwar.bausystem.features.slaves.panzern.PanzernAlgorithm"),
+ SMART_PLACE(false, "de.steamwar.bausystem.features.smartplace.SmartPlaceListener.add($)", null, "de.steamwar.bausystem.features.smartplace.SmartPlaceBehaviour");
+
+ final boolean unlink;
+ String toRun = null;
+ String className = null;
+ String interfaceName = null;
+
+ LinkageType(boolean unlink, String toRun, String className) {
+ this.unlink = unlink;
+ this.toRun = toRun;
+ this.className = className;
+ }
+}
\ No newline at end of file
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/linkage/Linked.java b/BauSystem_Linkage/src/de/steamwar/bausystem/linkage/Linked.java
similarity index 100%
rename from BauSystem_Main/src/de/steamwar/bausystem/linkage/Linked.java
rename to BauSystem_Linkage/src/de/steamwar/bausystem/linkage/Linked.java
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/linkage/LinkedInstance.java b/BauSystem_Linkage/src/de/steamwar/bausystem/linkage/LinkedInstance.java
similarity index 100%
rename from BauSystem_Main/src/de/steamwar/bausystem/linkage/LinkedInstance.java
rename to BauSystem_Linkage/src/de/steamwar/bausystem/linkage/LinkedInstance.java
diff --git a/BauSystem_Linkage/src/de/steamwar/bausystem/linkage/ProcessorImplementation.java b/BauSystem_Linkage/src/de/steamwar/bausystem/linkage/ProcessorImplementation.java
new file mode 100644
index 00000000..96cae2d3
--- /dev/null
+++ b/BauSystem_Linkage/src/de/steamwar/bausystem/linkage/ProcessorImplementation.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2019,2020,2021 yoyosource
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package de.steamwar.bausystem.linkage;
+
+import org.atteo.classindex.IndexAnnotated;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@IndexAnnotated
+@Retention(RetentionPolicy.CLASS)
+@Target({ElementType.TYPE})
+public @interface ProcessorImplementation {
+}
diff --git a/BauSystem_Main/build.gradle b/BauSystem_Main/build.gradle
index 8a23e1a3..34c40b56 100644
--- a/BauSystem_Main/build.gradle
+++ b/BauSystem_Main/build.gradle
@@ -56,6 +56,9 @@ dependencies {
annotationProcessor 'org.atteo.classindex:classindex:3.11'
testAnnotationProcessor 'org.atteo.classindex:classindex:3.11'
+ implementation project(":BauSystem_Linkage")
+ annotationProcessor project(":BauSystem_Linkage")
+
compileOnly 'org.spigotmc:spigot-api:1.19-R0.1-SNAPSHOT'
compileOnly 'com.mojang:authlib:1.5.25'
compileOnly 'io.netty:netty-all:4.1.68.Final'
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/bau/BauCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/bau/BauCommand.java
index 8680f7bf..3e039a90 100644
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/bau/BauCommand.java
+++ b/BauSystem_Main/src/de/steamwar/bausystem/features/bau/BauCommand.java
@@ -29,7 +29,7 @@ import org.bukkit.entity.Player;
public class BauCommand extends SWCommand {
@LinkedInstance
- private InfoCommand infoCommand;
+ public InfoCommand infoCommand;
public BauCommand() {
super("bau", "b", "gs");
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/bau/InfoCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/bau/InfoCommand.java
index 327e4903..58b3dc20 100644
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/bau/InfoCommand.java
+++ b/BauSystem_Main/src/de/steamwar/bausystem/features/bau/InfoCommand.java
@@ -22,7 +22,7 @@ import static de.steamwar.bausystem.features.tpslimit.TPSWarpUtils.getTps;
public class InfoCommand extends SWCommand {
@LinkedInstance
- private BauServer bauServer;
+ public BauServer bauServer;
public InfoCommand() {
super("bauinfo");
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/DetonatorCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/DetonatorCommand.java
index 219b1b6f..a016fbd0 100644
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/DetonatorCommand.java
+++ b/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/DetonatorCommand.java
@@ -54,7 +54,7 @@ public class DetonatorCommand extends SWCommand {
return wand;
}
- protected DetonatorCommand() {
+ public DetonatorCommand() {
super("detonator", "dt");
}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/gui/BauGUICommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/gui/BauGUICommand.java
index 344937cd..30ae286b 100644
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/gui/BauGUICommand.java
+++ b/BauSystem_Main/src/de/steamwar/bausystem/features/gui/BauGUICommand.java
@@ -29,7 +29,7 @@ import org.bukkit.entity.Player;
@Linked(LinkageType.COMMAND)
public class BauGUICommand extends SWCommand {
- protected BauGUICommand() {
+ public BauGUICommand() {
super("gui", "baugui", "g");
}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/hotbar/HotbarCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/hotbar/HotbarCommand.java
index b319fecb..26b4024b 100644
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/hotbar/HotbarCommand.java
+++ b/BauSystem_Main/src/de/steamwar/bausystem/features/hotbar/HotbarCommand.java
@@ -30,7 +30,7 @@ import org.bukkit.inventory.ItemStack;
@Linked(LinkageType.COMMAND)
public class HotbarCommand extends SWCommand {
- protected HotbarCommand() {
+ public HotbarCommand() {
super("hotbar", "hb");
addDefaultHelpMessage("HOTBAR_HELP_GENERIC");
}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/loader/LoaderCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/loader/LoaderCommand.java
index 11a77a5f..afafed99 100644
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/loader/LoaderCommand.java
+++ b/BauSystem_Main/src/de/steamwar/bausystem/features/loader/LoaderCommand.java
@@ -29,7 +29,7 @@ import org.bukkit.entity.Player;
@Linked(LinkageType.COMMAND)
public class LoaderCommand extends SWCommand {
- protected LoaderCommand() {
+ public LoaderCommand() {
super("loader", "autoloader", "al");
addDefaultHelpMessage("LOADER_HELP_OTHER");
}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/loadtimer/LoadtimerCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/loadtimer/LoadtimerCommand.java
index df52a419..29bf67f2 100644
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/loadtimer/LoadtimerCommand.java
+++ b/BauSystem_Main/src/de/steamwar/bausystem/features/loadtimer/LoadtimerCommand.java
@@ -27,7 +27,7 @@ import org.bukkit.entity.Player;
@Linked(LinkageType.COMMAND)
public class LoadtimerCommand extends SWCommand {
- protected LoadtimerCommand() {
+ public LoadtimerCommand() {
super("loadtimer", "lt", "stopuhr");
addDefaultHelpMessage("LOADTIMER_HELP_OVERVIEW");
}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/ColorCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/ColorCommand.java
index beb5fc4e..7d990231 100644
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/ColorCommand.java
+++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/ColorCommand.java
@@ -40,7 +40,7 @@ import java.io.IOException;
public class ColorCommand extends SWCommand {
@LinkedInstance
- private BauServer bauServer;
+ public BauServer bauServer;
public ColorCommand() {
super("color");
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/RegionCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/RegionCommand.java
index dc0fa2ac..819db4e0 100644
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/RegionCommand.java
+++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/RegionCommand.java
@@ -50,10 +50,10 @@ import java.util.stream.Collectors;
public class RegionCommand extends SWCommand {
@LinkedInstance
- private SelectCommand selectCommand;
+ public SelectCommand selectCommand;
@LinkedInstance
- private ColorCommand colorCommand;
+ public ColorCommand colorCommand;
public RegionCommand() {
super("region", "rg");
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/TNTListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/TNTListener.java
index b52dff50..ff1b0b9c 100644
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/TNTListener.java
+++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/TNTListener.java
@@ -42,7 +42,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
public class TNTListener implements Listener {
@LinkedInstance
- private CustomScriptManager customScriptManager;
+ public CustomScriptManager customScriptManager;
@EventHandler
public void onExplode(EntityExplodeEvent event) {
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ResetBauGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ResetBauGuiItem.java
index 336843fb..67d7c20d 100644
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ResetBauGuiItem.java
+++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ResetBauGuiItem.java
@@ -37,7 +37,7 @@ import org.bukkit.inventory.ItemStack;
public class ResetBauGuiItem extends BauGuiItem {
@LinkedInstance
- private ResetCommand resetCommand;
+ public ResetCommand resetCommand;
public ResetBauGuiItem() {
super(6);
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/TestblockBauGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/TestblockBauGuiItem.java
index f789ea78..ed9be915 100644
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/TestblockBauGuiItem.java
+++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/TestblockBauGuiItem.java
@@ -37,7 +37,7 @@ import org.bukkit.inventory.ItemStack;
public class TestblockBauGuiItem extends BauGuiItem {
@LinkedInstance
- private TestblockCommand testblockCommand;
+ public TestblockCommand testblockCommand;
public TestblockBauGuiItem() {
super(5);
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptCommand.java
index 89725037..e6fa0f49 100644
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptCommand.java
+++ b/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptCommand.java
@@ -25,7 +25,7 @@ public class ScriptCommand extends SWCommand {
}
@LinkedInstance
- private CustomScriptManager customScriptManager = null;
+ public CustomScriptManager customScriptManager = null;
private List loreBuilder(Player p, String... strings) {
List result = new ArrayList<>();
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptEventListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptEventListener.java
index e17e0b99..32c8d40c 100644
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptEventListener.java
+++ b/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptEventListener.java
@@ -47,7 +47,7 @@ import java.util.Set;
public class ScriptEventListener implements Listener {
@LinkedInstance
- private CustomScriptManager customScriptManager;
+ public CustomScriptManager customScriptManager;
private static final Map LAST_FS = new HashMap<>();
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/techhider/TechHiderCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/techhider/TechHiderCommand.java
index 972cb23e..798c9d02 100644
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/techhider/TechHiderCommand.java
+++ b/BauSystem_Main/src/de/steamwar/bausystem/features/techhider/TechHiderCommand.java
@@ -53,7 +53,7 @@ public class TechHiderCommand extends SWCommand implements Listener {
private Map> hidden = new HashMap<>();
@LinkedInstance
- private XrayCommand xrayCommand;
+ public XrayCommand xrayCommand;
@Register(description = "TECHHIDER_HELP")
public void toggleHider(Player player) {
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/NoClipCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/NoClipCommand.java
index 33f7ac88..9b1589d9 100644
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/NoClipCommand.java
+++ b/BauSystem_Main/src/de/steamwar/bausystem/features/util/NoClipCommand.java
@@ -72,7 +72,7 @@ public class NoClipCommand extends SWCommand implements Listener {
private static final List NOCLIPS = new ArrayList<>();
private static final Map LAST_TICKS = new HashMap<>();
- protected NoClipCommand() {
+ public NoClipCommand() {
super("noclip", "nc");
BiFunction first = (player, o) -> {
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/SlotCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/SlotCommand.java
index c6a3af49..c0dafe18 100644
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/SlotCommand.java
+++ b/BauSystem_Main/src/de/steamwar/bausystem/features/util/SlotCommand.java
@@ -36,7 +36,7 @@ import java.util.Arrays;
@Linked(LinkageType.COMMAND)
public class SlotCommand extends SWCommand {
- protected SlotCommand() {
+ public SlotCommand() {
super("slot", "s");
addDefaultHelpMessage("OTHER_NOCLIP_SLOT_INFO");
}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/DeclutterBauGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/DeclutterBauGuiItem.java
index 70e7296d..9ed5a67f 100644
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/DeclutterBauGuiItem.java
+++ b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/DeclutterBauGuiItem.java
@@ -36,7 +36,7 @@ import org.bukkit.inventory.ItemStack;
public class DeclutterBauGuiItem extends BauGuiItem {
@LinkedInstance
- private DeclutterCommand declutterCommand;
+ public DeclutterCommand declutterCommand;
public DeclutterBauGuiItem() {
super(30);
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/KillAllBauGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/KillAllBauGuiItem.java
index e31ea268..0e66a163 100644
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/KillAllBauGuiItem.java
+++ b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/KillAllBauGuiItem.java
@@ -39,7 +39,7 @@ import java.util.Arrays;
public class KillAllBauGuiItem extends BauGuiItem {
@LinkedInstance
- private KillAllCommand killAllCommand;
+ public KillAllCommand killAllCommand;
public KillAllBauGuiItem() {
super(32);
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/warp/WarpCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/warp/WarpCommand.java
index da0d816d..c2ae7528 100644
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/warp/WarpCommand.java
+++ b/BauSystem_Main/src/de/steamwar/bausystem/features/warp/WarpCommand.java
@@ -47,7 +47,7 @@ public class WarpCommand extends SWCommand implements Disable, Enable {
"add", "create", "delete", "list", "info", "gui"
};
- protected WarpCommand() {
+ public WarpCommand() {
super("warp");
}
@@ -132,7 +132,7 @@ public class WarpCommand extends SWCommand implements Disable, Enable {
@Linked(LinkageType.COMMAND)
public static class WarpsLink extends SWCommand {
- protected WarpsLink() {
+ public WarpsLink() {
super("warps");
}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/xray/XrayCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/xray/XrayCommand.java
index abd97ee1..88f2cae5 100644
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/xray/XrayCommand.java
+++ b/BauSystem_Main/src/de/steamwar/bausystem/features/xray/XrayCommand.java
@@ -60,7 +60,7 @@ public class XrayCommand extends SWCommand implements Listener {
private Map> hidden = new HashMap<>();
@LinkedInstance
- private TechHiderCommand techHiderCommand;
+ public TechHiderCommand techHiderCommand;
@Register(description = "XRAY_HELP")
public void toggleHider(Player player) {
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/linkage/LinkageType.java b/BauSystem_Main/src/de/steamwar/bausystem/linkage/LinkageType.java
deleted file mode 100644
index 5d2ebef0..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/linkage/LinkageType.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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 .
- */
-
-package de.steamwar.bausystem.linkage;
-
-import de.steamwar.bausystem.BauSystem;
-import de.steamwar.bausystem.configplayer.Config;
-import de.steamwar.bausystem.configplayer.ConfigConverter;
-import de.steamwar.bausystem.features.gui.BauGUI;
-import de.steamwar.bausystem.features.script.ScriptExecutor;
-import de.steamwar.bausystem.features.script.SpecialCommand;
-import de.steamwar.bausystem.features.slaves.panzern.PanzernAlgorithm;
-import de.steamwar.bausystem.features.slaves.panzern.PanzernAlgorithmLazyInit;
-import de.steamwar.bausystem.features.smartplace.SmartPlaceBehaviour;
-import de.steamwar.bausystem.features.smartplace.SmartPlaceListener;
-import de.steamwar.bausystem.linkage.specific.BauGuiItem;
-import de.steamwar.bausystem.linkage.specific.ScoreboardItem;
-import de.steamwar.command.SWCommand;
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import lombok.RequiredArgsConstructor;
-import org.bukkit.Bukkit;
-import org.bukkit.event.HandlerList;
-import org.bukkit.event.Listener;
-
-import java.util.function.Consumer;
-import java.util.function.Predicate;
-
-@RequiredArgsConstructor
-public enum LinkageType {
-
- // NORMAL
- COMMAND(false, SWCommand.class::isAssignableFrom, o -> ((SWCommand) o).setMessage(BauSystem.MESSAGE)),
- ENABLE_LINK(false, Enable.class::isAssignableFrom, o -> ((Enable) o).enable()),
- DISABLE_LINK(true, Disable.class::isAssignableFrom, o -> ((Disable) o).disable()),
- PLAIN(false, clazz -> true, o -> {}),
- LISTENER(false, Listener.class::isAssignableFrom, o -> Bukkit.getPluginManager().registerEvents((Listener) o, BauSystem.getInstance())),
- UNLINK_LISTENER(true, Listener.class::isAssignableFrom, o -> HandlerList.unregisterAll((Listener) o)),
-
- // SPECIFIC
- BAU_GUI_ITEM(false, BauGuiItem.class::isAssignableFrom, o -> BauGUI.addItem((BauGuiItem) o)),
- SCRIPT_COMMAND(false, SpecialCommand.class::isAssignableFrom, o -> ScriptExecutor.SPECIAL_COMMANDS.add((SpecialCommand) o)),
- CONFIG_CONVERTER(false, ConfigConverter.class::isAssignableFrom, o -> Config.addConfigConverter((ConfigConverter) o)),
- SCOREBOARD(false, ScoreboardItem.class::isAssignableFrom, o -> {}),
- PANZERN(false, PanzernAlgorithm.class::isAssignableFrom, o -> PanzernAlgorithmLazyInit.add((PanzernAlgorithm) o)),
- SMART_PLACE(false, SmartPlaceBehaviour.class::isAssignableFrom, o -> SmartPlaceListener.add((SmartPlaceBehaviour) o));
-
- final boolean unlink;
-
- final Predicate> linkagePredicate;
-
- final Consumer