mirror of
https://github.com/EarthMC/QuickShop-Reremake.git
synced 2026-11-25 01:49:49 -05:00
1 parent
f352518f12
commit
cd41bb4af3
3 files changed
+24
-8
No files matched your search
+3
@@ -28,9 +28,12 @@ import java.util.List;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.maxgamer.quickshop.PluginsIntegration.IntegrateStage;
|
||||
import org.maxgamer.quickshop.PluginsIntegration.IntegratedPlugin;
|
||||
import org.maxgamer.quickshop.PluginsIntegration.IntegrationStage;
|
||||
import org.maxgamer.quickshop.QuickShop;
|
||||
|
||||
@IntegrationStage(loadStage = IntegrateStage.onEnableAfter)
|
||||
public class FactionsUUIDIntegration implements IntegratedPlugin {
|
||||
private List<String> createFlags;
|
||||
private List<String> tradeFlags;
|
||||
|
||||
+3
@@ -27,10 +27,13 @@ import java.util.List;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.maxgamer.quickshop.PluginsIntegration.IntegrateStage;
|
||||
import org.maxgamer.quickshop.PluginsIntegration.IntegratedPlugin;
|
||||
import org.maxgamer.quickshop.PluginsIntegration.IntegrationStage;
|
||||
import org.maxgamer.quickshop.QuickShop;
|
||||
|
||||
@SuppressWarnings("DuplicatedCode")
|
||||
@IntegrationStage(loadStage = IntegrateStage.onEnableAfter)
|
||||
public class ResidenceIntegration implements IntegratedPlugin {
|
||||
List<String> createLimits;
|
||||
List<String> tradeLimits;
|
||||
|
||||
@@ -35,7 +35,7 @@ public class IntegrationHelper {
|
||||
|
||||
public void register(@NotNull IntegratedPlugin clazz) {
|
||||
if (!isIntegrationClass(clazz)) {
|
||||
throw new InvaildIntegratedPluginClass();
|
||||
throw new InvaildIntegratedPluginClass("Invaild Integration module: " + clazz.getName());
|
||||
}
|
||||
Util.debugLogHeavy("Registering " + clazz.getName());
|
||||
integrations.add(clazz);
|
||||
@@ -62,9 +62,9 @@ public class IntegrationHelper {
|
||||
+ integratedPlugin.getName()
|
||||
+ " stage is "
|
||||
+ integratedPlugin
|
||||
.getClass()
|
||||
.getDeclaredAnnotation(IntegrationStage.class)
|
||||
.loadStage());
|
||||
.getClass()
|
||||
.getDeclaredAnnotation(IntegrationStage.class)
|
||||
.loadStage());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -82,9 +82,9 @@ public class IntegrationHelper {
|
||||
+ integratedPlugin.getName()
|
||||
+ " stage is "
|
||||
+ integratedPlugin
|
||||
.getClass()
|
||||
.getDeclaredAnnotation(IntegrationStage.class)
|
||||
.loadStage());
|
||||
.getClass()
|
||||
.getDeclaredAnnotation(IntegrationStage.class)
|
||||
.loadStage());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -112,6 +112,16 @@ public class IntegrationHelper {
|
||||
private boolean isIntegrationClass(@NotNull IntegratedPlugin clazz) {
|
||||
return clazz.getClass().getDeclaredAnnotation(IntegrationStage.class) != null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class InvaildIntegratedPluginClass extends IllegalArgumentException {}
|
||||
class InvaildIntegratedPluginClass extends IllegalArgumentException {
|
||||
public InvaildIntegratedPluginClass() {
|
||||
super();
|
||||
}
|
||||
|
||||
public InvaildIntegratedPluginClass(String s) {
|
||||
super(s);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user