mirror of
https://github.com/md5sha256/AreaShop.git
synced 2026-11-06 17:32:43 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
088471aa3c | ||
|
|
5a95c95670 | ||
|
|
5a5d627d51 | ||
|
|
9b5434a4b2 | ||
|
|
e13717950b | ||
|
|
03ed2803bd | ||
|
|
b3f1225934 |
No files matched your search
+20
-37
@@ -1,13 +1,11 @@
|
||||
|
||||
# Created by https://www.toptal.com/developers/gitignore/api/macos,windows,intellij,maven,gradle
|
||||
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,windows,intellij,maven,gradle
|
||||
# Created by https://www.toptal.com/developers/gitignore/api/macos,windows,intellij+all,gradle,maven
|
||||
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,windows,intellij+all,gradle,maven
|
||||
|
||||
### Intellij ###
|
||||
### Intellij+all ###
|
||||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
|
||||
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
||||
|
||||
.idea/**
|
||||
|
||||
# User-specific stuff
|
||||
.idea/**/workspace.xml
|
||||
.idea/**/tasks.xml
|
||||
@@ -68,6 +66,9 @@ atlassian-ide-plugin.xml
|
||||
# Cursive Clojure plugin
|
||||
.idea/replstate.xml
|
||||
|
||||
# SonarLint plugin
|
||||
.idea/sonarlint/
|
||||
|
||||
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||
com_crashlytics_export_strings.xml
|
||||
crashlytics.properties
|
||||
@@ -80,35 +81,21 @@ fabric.properties
|
||||
# Android studio 3.1+ serialized cache file
|
||||
.idea/caches/build_file_checksums.ser
|
||||
|
||||
### Intellij Patch ###
|
||||
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
|
||||
### Intellij+all Patch ###
|
||||
# Ignores the whole .idea folder and all .iml files
|
||||
# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360
|
||||
|
||||
# *.iml
|
||||
# modules.xml
|
||||
# .idea/misc.xml
|
||||
# *.ipr
|
||||
.idea/*
|
||||
|
||||
# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023
|
||||
|
||||
*.iml
|
||||
modules.xml
|
||||
.idea/misc.xml
|
||||
*.ipr
|
||||
|
||||
# Sonarlint plugin
|
||||
# https://plugins.jetbrains.com/plugin/7973-sonarlint
|
||||
.idea/**/sonarlint/
|
||||
|
||||
# SonarQube Plugin
|
||||
# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
|
||||
.idea/**/sonarIssues.xml
|
||||
|
||||
# Markdown Navigator plugin
|
||||
# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
|
||||
.idea/**/markdown-navigator.xml
|
||||
.idea/**/markdown-navigator-enh.xml
|
||||
.idea/**/markdown-navigator/
|
||||
|
||||
# Cache file creation bug
|
||||
# See https://youtrack.jetbrains.com/issue/JBR-2257
|
||||
.idea/$CACHE_FILE$
|
||||
|
||||
# CodeStream plugin
|
||||
# https://plugins.jetbrains.com/plugin/12206-codestream
|
||||
.idea/codestream.xml
|
||||
.idea/sonarlint
|
||||
|
||||
### macOS ###
|
||||
# General
|
||||
@@ -152,7 +139,6 @@ buildNumber.properties
|
||||
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
|
||||
.mvn/wrapper/maven-wrapper.jar
|
||||
|
||||
### Maven Patch ###
|
||||
# Eclipse m2e generated files
|
||||
# Eclipse Core
|
||||
.project
|
||||
@@ -188,6 +174,7 @@ $RECYCLE.BIN/
|
||||
### Gradle ###
|
||||
.gradle
|
||||
build/
|
||||
build-cache/
|
||||
|
||||
# Ignore Gradle GUI config
|
||||
gradle-app.setting
|
||||
@@ -204,8 +191,4 @@ gradle-app.setting
|
||||
### Gradle Patch ###
|
||||
**/build/
|
||||
|
||||
# Eclipse Gradle plugin generated files
|
||||
# Eclipse Core
|
||||
# JDT-specific (Eclipse Java Development Tools)
|
||||
|
||||
# End of https://www.toptal.com/developers/gitignore/api/macos,windows,intellij,maven,gradle
|
||||
# End of https://www.toptal.com/developers/gitignore/api/macos,windows,intellij+all,gradle,maven
|
||||
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="minecraft" name="Minecraft">
|
||||
<configuration>
|
||||
<autoDetectTypes>
|
||||
<platformType>BUKKIT</platformType>
|
||||
</autoDetectTypes>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
</module>
|
||||
@@ -1,108 +0,0 @@
|
||||
import org.apache.tools.ant.filters.ReplaceTokens
|
||||
|
||||
plugins {
|
||||
id 'com.github.johnrengelman.shadow' version '7.1.0'
|
||||
id 'maven-publish'
|
||||
id 'java-library'
|
||||
}
|
||||
|
||||
version = "2.7.2"
|
||||
|
||||
dependencies {
|
||||
implementation 'com.github.NLthijs48:InteractiveMessenger:e7749258ca'
|
||||
implementation 'com.github.NLthijs48:BukkitDo:819d51ec2b'
|
||||
implementation 'io.papermc:paperlib:1.0.6'
|
||||
implementation 'io.github.baked-libs:dough-data:1.0.3'
|
||||
implementation ('com.google.inject:guice:5.0.1') {
|
||||
exclude group: 'com.google.guava'
|
||||
}
|
||||
implementation ('com.google.inject.extensions:guice-assistedinject:5.0.1') {
|
||||
exclude group: 'com.google.guava'
|
||||
}
|
||||
implementation project(':areashop-interface')
|
||||
implementation project(':areashop-bukkit-1_13')
|
||||
implementation project(':areashop-nms')
|
||||
runtimeOnly project(path: ':areashop-nms-1-17', configuration: 'reobf')
|
||||
runtimeOnly project(path: ':areashop-nms-1-18', configuration: 'reobf')
|
||||
implementation project(':areashop-worldedit-7')
|
||||
implementation project(':areashop-worldguard-7')
|
||||
implementation project(':areashop-fastasyncworldedit')
|
||||
compileOnly 'org.spigotmc:spigot-api:1.18.1-R0.1-SNAPSHOT'
|
||||
compileOnly ('com.sk89q.worldedit:worldedit-bukkit:7.2.8') {
|
||||
exclude group: 'com.google.guava'
|
||||
}
|
||||
compileOnly ('com.sk89q.worldguard:worldguard-bukkit:7.0.6') {
|
||||
exclude group: 'com.google.guava'
|
||||
}
|
||||
compileOnly ('com.github.MilkBowl:VaultAPI:1.7')
|
||||
}
|
||||
|
||||
processResources {
|
||||
|
||||
from (sourceSets.main.resources) {
|
||||
filter ReplaceTokens, tokens: [version: project.version]
|
||||
duplicatesStrategy(DuplicatesStrategy.INCLUDE)
|
||||
}
|
||||
}
|
||||
|
||||
assemble {
|
||||
dependsOn(shadowJar)
|
||||
dependsOn(publishToMavenLocal)
|
||||
}
|
||||
|
||||
jar {
|
||||
archiveClassifier.set('original')
|
||||
}
|
||||
|
||||
java {
|
||||
withSourcesJar()
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
archiveClassifier.set('')
|
||||
setArchivesBaseName('AreaShop')
|
||||
String base = "me.wiefferink.areashop.libraries"
|
||||
relocate('me.wiefferink.interactivemessenger', "${base}.interactivemessenger")
|
||||
relocate('me.wiefferink.bukkitdo', "${base}.bukkitdo")
|
||||
relocate('io.papermc.lib', "${base}.paperlib")
|
||||
relocate('io.github.bakedlibs.dough', "${base}.dough")
|
||||
relocate("com.google.inject", "${base}.inject")
|
||||
relocate("org.aopalliance", "${base}.aopalliance")
|
||||
relocate("javax.inject", "${base}.javax.inject")
|
||||
include {
|
||||
include("com.google.inject")
|
||||
minimize()
|
||||
}
|
||||
}
|
||||
|
||||
sourcesJar {
|
||||
classifier('sources')
|
||||
from sourceSets.main.allSource
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
// ... artifact publications
|
||||
areaShop(MavenPublication) {
|
||||
from components.java
|
||||
pom {
|
||||
group = "me.wiefferink"
|
||||
artifactId = "$project.name"
|
||||
version = "$project.version"
|
||||
scm {
|
||||
connection = 'scm:git:git://github.com/md5sha256/AreaShop.git'
|
||||
developerConnection = 'scm:git:ssh://github.com/md5sha256/AreaShop.git'
|
||||
url = "https://github.com/md5sha256/AreaShop/tree/dev/bleeding"
|
||||
}
|
||||
licenses {
|
||||
license {
|
||||
name = 'GNU General Public License v3.0'
|
||||
url = "https://github.com/md5sha256/AreaShop/blob/dev/bleeding/LICENSE"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
description = 'AreaShop'
|
||||
@@ -0,0 +1,90 @@
|
||||
plugins {
|
||||
id("com.github.johnrengelman.shadow") version "7.1.2"
|
||||
}
|
||||
|
||||
description = "AreaShop"
|
||||
|
||||
dependencies {
|
||||
// Platform
|
||||
compileOnlyApi(libs.spigot)
|
||||
compileOnlyApi(libs.worldeditCore) {
|
||||
exclude("com.google.guava", "guava")
|
||||
}
|
||||
compileOnlyApi(libs.worldeditBukkit) {
|
||||
exclude("com.google.guava", "guava")
|
||||
}
|
||||
compileOnlyApi(libs.worldguardCore) {
|
||||
exclude("com.google.guava", "guava")
|
||||
}
|
||||
compileOnlyApi(libs.worldguardBukkit) {
|
||||
exclude("com.google.guava", "guava")
|
||||
}
|
||||
compileOnlyApi("com.github.MilkBowl:VaultAPI:1.7") {
|
||||
exclude("com.google.guava", "guava")
|
||||
}
|
||||
|
||||
// 3rd party libraries
|
||||
implementation(libs.findbugs)
|
||||
implementation("io.papermc:paperlib:1.0.7")
|
||||
implementation("com.github.NLthijs48:InteractiveMessenger:e7749258ca")
|
||||
implementation("com.github.NLthijs48:BukkitDo:819d51ec2b")
|
||||
implementation("io.github.baked-libs:dough-data:1.0.3")
|
||||
implementation("com.google.inject:guice:5.0.1") {
|
||||
exclude("com.google.guava", "guava")
|
||||
}
|
||||
implementation("com.google.inject.extensions:guice-assistedinject:5.0.1") {
|
||||
exclude("com.google.guava", "guava")
|
||||
}
|
||||
|
||||
// Project submodules
|
||||
implementation(projects.areashopInterface)
|
||||
implementation(projects.areashopBukkit113)
|
||||
implementation(projects.areashopNms)
|
||||
// Adapters
|
||||
runtimeOnly(projects.adapters.plugins.worldedit)
|
||||
runtimeOnly(projects.adapters.plugins.worldguard)
|
||||
runtimeOnly(projects.adapters.plugins.fastasyncworldedit)
|
||||
runtimeOnly(project(":adapters:platform:bukkit-1-17", "reobf"))
|
||||
runtimeOnly(project(":adapters:platform:bukkit-1-18", "reobf"))
|
||||
}
|
||||
|
||||
tasks {
|
||||
processResources {
|
||||
filesMatching("plugin.yml") {
|
||||
expand("version" to project.version)
|
||||
}
|
||||
}
|
||||
|
||||
assemble {
|
||||
dependsOn(shadowJar)
|
||||
}
|
||||
|
||||
jar {
|
||||
archiveClassifier.set("original")
|
||||
}
|
||||
|
||||
java {
|
||||
withSourcesJar()
|
||||
}
|
||||
|
||||
val javaComponent = project.components["java"] as AdhocComponentWithVariants
|
||||
javaComponent.withVariantsFromConfiguration(configurations["shadowRuntimeElements"]) {
|
||||
skip()
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
archiveClassifier.set("")
|
||||
base {
|
||||
archiveBaseName.set("AreaShop")
|
||||
}
|
||||
val base = "me.wiefferink.areashop.libraries"
|
||||
relocate("me.wiefferink.interactivemessenger", "${base}.interactivemessenger")
|
||||
relocate("me.wiefferink.bukkitdo", "${base}.bukkitdo")
|
||||
relocate("io.papermc.lib", "${base}.paperlib")
|
||||
relocate("io.github.bakedlibs.dough", "${base}.dough")
|
||||
relocate("com.google.inject", "${base}.inject")
|
||||
relocate("org.aopalliance", "${base}.aopalliance")
|
||||
relocate("javax.annotation", "${base}.javax.annotation")
|
||||
relocate("javax.inject", "${base}.javax.inject")
|
||||
}
|
||||
}
|
||||
@@ -175,169 +175,82 @@ public final class AreaShop extends JavaPlugin implements AreaShopApi {
|
||||
String[] split = rawServerVersion.split("\\.");
|
||||
String serverVersion = split[3];
|
||||
try {
|
||||
Class<?> nmsImpl = Class.forName("me.wiefferink.areashop.nms." + serverVersion + ".NMSImpl");
|
||||
Class<?> nmsImpl = Class.forName("me.wiefferink.areashop.adapters.platform." + serverVersion + ".NMSImpl");
|
||||
this.nms = nmsImpl.asSubclass(NMS.class).getConstructor().newInstance();
|
||||
} catch (ReflectiveOperationException ex) {
|
||||
ex.printStackTrace();
|
||||
getLogger().severe("Failed to initialize NMS implementation!");
|
||||
getServer().getPluginManager().disablePlugin(this);
|
||||
error("Failed to initialize NMS implementation!");
|
||||
shutdownOnError();
|
||||
return;
|
||||
}
|
||||
|
||||
// Find WorldEdit integration version to load
|
||||
String weVersion = null;
|
||||
String rawWeVersion = null;
|
||||
String weBeta = null;
|
||||
String weHandlerVersion;
|
||||
Plugin plugin = getServer().getPluginManager().getPlugin("WorldEdit");
|
||||
if(!(plugin instanceof WorldEditPlugin) || !plugin.isEnabled()) {
|
||||
error("WorldEdit plugin is not present or has not loaded correctly");
|
||||
error = true;
|
||||
return;
|
||||
} else {
|
||||
worldEdit = (WorldEditPlugin)plugin;
|
||||
rawWeVersion = worldEdit.getDescription().getVersion();
|
||||
|
||||
// Find beta version
|
||||
Pattern pattern = Pattern.compile("beta-?\\d+");
|
||||
Matcher matcher = pattern.matcher(rawWeVersion);
|
||||
if (matcher.find()) {
|
||||
weBeta = matcher.group();
|
||||
}
|
||||
|
||||
// Get correct WorldEditInterface (handles things that changed version to version)
|
||||
if(worldEdit.getDescription().getVersion().startsWith("7.")) {
|
||||
weVersion = "7";
|
||||
this.worldEdit = (WorldEditPlugin) plugin;
|
||||
Plugin fawePlugin = getServer().getPluginManager().getPlugin("FastAsyncWorldEdit");
|
||||
if (fawePlugin != null && fawePlugin.isEnabled()) {
|
||||
weHandlerVersion = "FastAsyncWorldEditHandler";
|
||||
info("Detected FastAsyncWorldEdit, using the fawe handler");
|
||||
} else {
|
||||
throw new IllegalStateException("Unknown WE Version: " + worldEdit.getDescription().getVersion());
|
||||
weHandlerVersion = "WorldEditHandler";
|
||||
}
|
||||
weVersion = "WorldEditHandler" + weVersion;
|
||||
}
|
||||
|
||||
// Find WorldGuard integration version to load
|
||||
String wgVersion = null;
|
||||
String rawWgVersion = null;
|
||||
int major = 0;
|
||||
int minor = 0;
|
||||
int fixes = 0;
|
||||
Integer build = null;
|
||||
plugin = getServer().getPluginManager().getPlugin("WorldGuard");
|
||||
if(!(plugin instanceof WorldGuardPlugin) || !plugin.isEnabled()) {
|
||||
error("WorldGuard plugin is not present or has not loaded correctly");
|
||||
error = true;
|
||||
shutdownOnError();
|
||||
return;
|
||||
} else {
|
||||
worldGuard = (WorldGuardPlugin)plugin;
|
||||
// Get correct WorldGuardInterface (handles things that changed version to version)
|
||||
try {
|
||||
rawWgVersion = worldGuard.getDescription().getVersion();
|
||||
if(rawWgVersion.contains("-SNAPSHOT;")) {
|
||||
String buildNumber = rawWgVersion.substring(rawWgVersion.indexOf("-SNAPSHOT;") + 10);
|
||||
if(buildNumber.contains("-")) {
|
||||
buildNumber = buildNumber.substring(0, buildNumber.indexOf('-'));
|
||||
if (Utils.isNumeric(buildNumber)) {
|
||||
build = Integer.parseInt(buildNumber);
|
||||
} else {
|
||||
warn("Could not correctly parse the build of WorldGuard, raw version: " + rawWgVersion + ", buildNumber: " + buildNumber);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Clear stuff from the version string that is not a number
|
||||
String[] versionParts = rawWgVersion.split("\\.");
|
||||
for(int i = 0; i < versionParts.length; i++) {
|
||||
Pattern pattern = Pattern.compile("^\\d+");
|
||||
Matcher matcher = pattern.matcher(versionParts[i]);
|
||||
if(matcher.find()) {
|
||||
versionParts[i] = matcher.group();
|
||||
}
|
||||
}
|
||||
// Find major, minor and fix numbers
|
||||
try {
|
||||
if(versionParts.length > 0) {
|
||||
major = Integer.parseInt(versionParts[0]);
|
||||
}
|
||||
if(versionParts.length > 1) {
|
||||
minor = Integer.parseInt(versionParts[1]);
|
||||
}
|
||||
if(versionParts.length > 2) {
|
||||
fixes = Integer.parseInt(versionParts[2]);
|
||||
}
|
||||
} catch(NumberFormatException e) {
|
||||
warn("Something went wrong while parsing WorldGuard version number: " + rawWgVersion);
|
||||
}
|
||||
|
||||
// Determine correct implementation to use
|
||||
if(rawWgVersion.startsWith("7.")) {
|
||||
wgVersion = "7";
|
||||
}
|
||||
} catch(Exception e) { // If version detection fails, at least try to load the latest version
|
||||
warn("Parsing the WorldGuard version failed, assuming version 7:", rawWgVersion);
|
||||
wgVersion = "7";
|
||||
}
|
||||
|
||||
wgVersion = "WorldGuardHandler" + wgVersion;
|
||||
this.worldGuard = (WorldGuardPlugin) plugin;
|
||||
}
|
||||
|
||||
DependencyModule dependencyModule = new DependencyModule(worldEdit, worldGuard, getEconomy(), getPermissionProvider());
|
||||
|
||||
// Check if FastAsyncWorldEdit is installed
|
||||
boolean fawe;
|
||||
try {
|
||||
Class.forName("com.fastasyncworldedit.core.FaweAPI" );
|
||||
fawe = true;
|
||||
} catch (ClassNotFoundException ignore) {
|
||||
fawe = false;
|
||||
}
|
||||
|
||||
if (fawe) {
|
||||
weVersion = "FastAsyncWorldEditHandler";
|
||||
}
|
||||
DependencyModule dependencyModule = new DependencyModule(this.worldEdit, this.worldGuard, getEconomy(), getPermissionProvider());
|
||||
|
||||
// Load WorldEdit
|
||||
try {
|
||||
Class<?> clazz = Class.forName("me.wiefferink.areashop.handlers." + weVersion);
|
||||
// Check if we have a NMSHandler class at that location.
|
||||
Class<?> clazz = Class.forName("me.wiefferink.areashop.adapters.plugins." + weHandlerVersion);
|
||||
if(WorldEditInterface.class.isAssignableFrom(clazz)) { // Make sure it actually implements WorldEditInterface
|
||||
worldEditInterface = (WorldEditInterface)clazz.getConstructor(AreaShopInterface.class).newInstance(this); // Set our handler
|
||||
}
|
||||
} catch(Exception e) {
|
||||
error("Could not load the handler for WorldEdit (tried to load " + weVersion + "), report this problem to the author: " + ExceptionUtils.getStackTrace(e));
|
||||
error = true;
|
||||
weVersion = null;
|
||||
error("Could not load the handler for WorldEdit (tried to load " + weHandlerVersion + "), report this problem to the author: " + ExceptionUtils.getStackTrace(e));
|
||||
shutdownOnError();
|
||||
return;
|
||||
}
|
||||
|
||||
// Load WorldGuard
|
||||
try {
|
||||
Class<?> clazz = Class.forName("me.wiefferink.areashop.handlers." + wgVersion);
|
||||
Class<?> clazz = Class.forName("me.wiefferink.areashop.adapters.plugins.WorldGuardHandler");
|
||||
// Check if we have a NMSHandler class at that location.
|
||||
if(WorldGuardInterface.class.isAssignableFrom(clazz)) { // Make sure it actually implements WorldGuardInterface
|
||||
worldGuardInterface = (WorldGuardInterface)clazz.getConstructor(AreaShopInterface.class).newInstance(this); // Set our handler
|
||||
}
|
||||
} catch(Exception e) {
|
||||
error("Could not load the handler for WorldGuard (tried to load " + wgVersion + "), report this problem to the author:" + ExceptionUtils.getStackTrace(e));
|
||||
error = true;
|
||||
wgVersion = null;
|
||||
}
|
||||
|
||||
// Load Bukkit implementation
|
||||
String bukkitHandler;
|
||||
try {
|
||||
Class.forName("org.bukkit.block.data.type.WallSign");
|
||||
bukkitHandler = "1_13";
|
||||
} catch (ClassNotFoundException e) {
|
||||
bukkitHandler = "1_12";
|
||||
error("Could not load the handler for WorldGuard, report this problem to the author:" + ExceptionUtils.getStackTrace(e));
|
||||
shutdownOnError();
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
Class<?> clazz = Class.forName("me.wiefferink.areashop.handlers.BukkitHandler" + bukkitHandler);
|
||||
Class<?> clazz = Class.forName("me.wiefferink.areashop.handlers.BukkitHandler1_13");
|
||||
bukkitInterface = (BukkitInterface)clazz.getConstructor(AreaShopInterface.class).newInstance(this);
|
||||
} catch (Exception e) {
|
||||
error("Could not load the Bukkit handler (used for sign updates), tried to load:", bukkitHandler + ", report this problem to the author:", ExceptionUtils.getStackTrace(e));
|
||||
error = true;
|
||||
bukkitHandler = null;
|
||||
error("Could not load the Bukkit handler (used for sign updates), report this problem to the author:", ExceptionUtils.getStackTrace(e));
|
||||
shutdownOnError();
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if Vault is present
|
||||
if(getServer().getPluginManager().getPlugin("Vault") == null) {
|
||||
error("Vault plugin is not present or has not loaded correctly");
|
||||
error = true;
|
||||
shutdownOnError();
|
||||
return;
|
||||
}
|
||||
|
||||
AreaShopModule asModule = new AreaShopModule(this, messageBridge, nms, bukkitInterface, worldEditInterface, worldGuardInterface, signErrorLogger, dependencyModule);
|
||||
@@ -349,23 +262,8 @@ public final class AreaShop extends JavaPlugin implements AreaShopApi {
|
||||
boolean loadFilesResult = fileManager.loadFiles(false);
|
||||
error = error || !loadFilesResult;
|
||||
|
||||
// Print loaded version of WG and WE in debug
|
||||
if(wgVersion != null) {
|
||||
AreaShop.debug("Loaded ", wgVersion, "(raw version:" + rawWgVersion + ", major:" + major + ", minor:" + minor + ", fixes:" + fixes + ", build:" + build + ", fawe:" + fawe + ")");
|
||||
}
|
||||
if(weVersion != null) {
|
||||
AreaShop.debug("Loaded ", weVersion, "(raw version:" + rawWeVersion + ", beta:" + weBeta + ")");
|
||||
}
|
||||
if(bukkitHandler != null) {
|
||||
AreaShop.debug("Loaded BukkitHandler", bukkitHandler);
|
||||
}
|
||||
|
||||
setupLanguageManager();
|
||||
|
||||
if(error) {
|
||||
error("The plugin has not started, fix the errors listed above");
|
||||
return;
|
||||
}
|
||||
featureManager = injector.getInstance(FeatureManager.class);
|
||||
featureManager.initializeFeatures(injector);
|
||||
managers.add(featureManager);
|
||||
@@ -392,7 +290,7 @@ public final class AreaShop extends JavaPlugin implements AreaShopApi {
|
||||
if(getConfig().getBoolean("checkForUpdates")) {
|
||||
githubUpdateCheck = new GithubUpdateCheck(
|
||||
this,
|
||||
"NLThijs48",
|
||||
"md5sha256",
|
||||
"AreaShop"
|
||||
).withVersionComparator((latestVersion, currentVersion) ->
|
||||
!cleanVersion(latestVersion).equals(cleanVersion(currentVersion))
|
||||
@@ -420,6 +318,11 @@ public final class AreaShop extends JavaPlugin implements AreaShopApi {
|
||||
}
|
||||
}
|
||||
|
||||
private void shutdownOnError() {
|
||||
error("The plugin has not started, fix the errors listed above");
|
||||
getServer().getPluginManager().disablePlugin(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleanup a version number.
|
||||
* @param version Version to clean
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
name: AreaShop
|
||||
main: me.wiefferink.areashop.AreaShop
|
||||
version: "@version@"
|
||||
version: "${version}"
|
||||
description: "Selling and renting WorldGuard regions to your players, highly configurable."
|
||||
depend: [Vault, WorldGuard, WorldEdit]
|
||||
softdepend: [Multiverse-Core, FastAsyncWorldEdit]
|
||||
author: NLThijs48
|
||||
website: https://github.com/NLthijs48/AreaShop
|
||||
website: https://github.com/md5s256/AreaShop
|
||||
commands:
|
||||
AreaShop:
|
||||
description: 'For all commands use /as help.'
|
||||
@@ -13,7 +13,7 @@ commands:
|
||||
aliases: [as]
|
||||
awareness:
|
||||
- !@UTF8
|
||||
api-version: 1.13
|
||||
api-version: 1.17
|
||||
permissions:
|
||||
areashop.*:
|
||||
description: Give access to all commands of AreaShop
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
plugins.apply("io.papermc.paperweight.userdev")
|
||||
|
||||
dependencies {
|
||||
paperDevBundle("1.17.1-R0.1-SNAPSHOT")
|
||||
compileOnly(projects.areashopInterface)
|
||||
compileOnly(projects.areashopNms)
|
||||
}
|
||||
|
||||
|
||||
description = "AreaShop NMS Helper 1-17"
|
||||
|
||||
tasks {
|
||||
|
||||
assemble {
|
||||
dependsOn("reobfJar")
|
||||
}
|
||||
|
||||
named("reobfJar", io.papermc.paperweight.tasks.RemapJar::class) {
|
||||
outputJar.set(file("build/libs/${project.name}-${project.version}.jar"))
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package me.wiefferink.areashop.nms.v1_17_R1;
|
||||
package me.wiefferink.areashop.adapters.platform.v1_17_R1;
|
||||
|
||||
import me.wiefferink.areashop.nms.BlockBehaviourHelper;
|
||||
import net.minecraft.core.BlockPos;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package me.wiefferink.areashop.nms.v1_17_R1;
|
||||
package me.wiefferink.areashop.adapters.platform.v1_17_R1;
|
||||
|
||||
import me.wiefferink.areashop.nms.BlockBehaviourHelper;
|
||||
import me.wiefferink.areashop.nms.NMS;
|
||||
@@ -0,0 +1,21 @@
|
||||
plugins.apply("io.papermc.paperweight.userdev")
|
||||
|
||||
dependencies {
|
||||
paperDevBundle("1.18.1-R0.1-SNAPSHOT")
|
||||
compileOnly(projects.areashopInterface)
|
||||
compileOnly(projects.areashopNms)
|
||||
}
|
||||
|
||||
description = "AreaShop NMS Helper 1-18"
|
||||
|
||||
tasks {
|
||||
|
||||
assemble {
|
||||
dependsOn("reobfJar")
|
||||
}
|
||||
|
||||
named("reobfJar", io.papermc.paperweight.tasks.RemapJar::class) {
|
||||
outputJar.set(file("build/libs/${project.name}-${project.version}.jar"))
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package me.wiefferink.areashop.nms.v1_18_R1;
|
||||
package me.wiefferink.areashop.adapters.platform.v1_18_R1;
|
||||
|
||||
import me.wiefferink.areashop.nms.BlockBehaviourHelper;
|
||||
import net.minecraft.core.BlockPos;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package me.wiefferink.areashop.nms.v1_18_R1;
|
||||
package me.wiefferink.areashop.adapters.platform.v1_18_R1;
|
||||
|
||||
import me.wiefferink.areashop.nms.BlockBehaviourHelper;
|
||||
import me.wiefferink.areashop.nms.NMS;
|
||||
@@ -0,0 +1,9 @@
|
||||
dependencies {
|
||||
compileOnly(libs.spigot)
|
||||
compileOnly(projects.areashopInterface)
|
||||
compileOnly(libs.fastasyncworldeditCore)
|
||||
compileOnly(libs.fastasyncworldeditBukkit)
|
||||
compileOnly(libs.worldguardCore)
|
||||
}
|
||||
|
||||
description = "AreaShop FastAsyncWorldEdit"
|
||||
+1
-2
@@ -1,4 +1,4 @@
|
||||
package me.wiefferink.areashop.handlers;
|
||||
package me.wiefferink.areashop.adapters.plugins;
|
||||
|
||||
import com.fastasyncworldedit.core.FaweAPI;
|
||||
import com.fastasyncworldedit.core.extent.clipboard.MemoryOptimizedClipboard;
|
||||
@@ -32,7 +32,6 @@ import me.wiefferink.areashop.interfaces.AreaShopInterface;
|
||||
import me.wiefferink.areashop.interfaces.GeneralRegionInterface;
|
||||
import me.wiefferink.areashop.interfaces.WorldEditInterface;
|
||||
import me.wiefferink.areashop.interfaces.WorldEditSelection;
|
||||
import net.kyori.adventure.nbt.TagStringIO;
|
||||
import org.apache.commons.lang.exception.ExceptionUtils;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.BoundingBox;
|
||||
@@ -0,0 +1,9 @@
|
||||
dependencies {
|
||||
compileOnly(libs.spigot)
|
||||
compileOnly(projects.areashopInterface)
|
||||
compileOnly(libs.worldeditCore)
|
||||
compileOnly(libs.worldeditBukkit)
|
||||
compileOnly(libs.worldguardCore)
|
||||
}
|
||||
|
||||
description = "AreaShop WorldEdit 7"
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
package me.wiefferink.areashop.handlers;
|
||||
package me.wiefferink.areashop.adapters.plugins;
|
||||
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.IncompleteRegionException;
|
||||
@@ -37,9 +37,9 @@ import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class WorldEditHandler7 extends WorldEditInterface {
|
||||
public class WorldEditHandler extends WorldEditInterface {
|
||||
|
||||
public WorldEditHandler7(AreaShopInterface pluginInterface) {
|
||||
public WorldEditHandler(AreaShopInterface pluginInterface) {
|
||||
super(pluginInterface);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
dependencies {
|
||||
compileOnly(libs.spigot)
|
||||
compileOnly(projects.areashopInterface)
|
||||
compileOnly(libs.worldeditCore)
|
||||
compileOnly(libs.worldeditBukkit)
|
||||
compileOnly(libs.worldguardCore)
|
||||
}
|
||||
|
||||
description = "AreaShop WorldGuard 7"
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
package me.wiefferink.areashop.handlers;
|
||||
package me.wiefferink.areashop.adapters.plugins;
|
||||
|
||||
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
@@ -27,9 +27,9 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
public class WorldGuardHandler7 extends WorldGuardInterface {
|
||||
public class WorldGuardHandler extends WorldGuardInterface {
|
||||
|
||||
public WorldGuardHandler7(AreaShopInterface pluginInterface) {
|
||||
public WorldGuardHandler(AreaShopInterface pluginInterface) {
|
||||
super(pluginInterface);
|
||||
}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="minecraft" name="Minecraft">
|
||||
<configuration>
|
||||
<autoDetectTypes>
|
||||
<platformType>BUKKIT</platformType>
|
||||
</autoDetectTypes>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
</module>
|
||||
@@ -1,31 +0,0 @@
|
||||
dependencies {
|
||||
compileOnly 'org.spigotmc:spigot-api:1.17.1-R0.1-SNAPSHOT'
|
||||
compileOnly project(':areashop-interface')
|
||||
}
|
||||
|
||||
description = 'AreaShop Bukkit 1.13 and higher'
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
// ... artifact publications
|
||||
areaShop(MavenPublication) {
|
||||
from components.java
|
||||
pom {
|
||||
group = "me.wiefferink"
|
||||
artifactId = "$project.name"
|
||||
version = "$project.version"
|
||||
scm {
|
||||
connection = 'scm:git:git://github.com/md5sha256/AreaShop.git'
|
||||
developerConnection = 'scm:git:ssh://github.com/md5sha256/AreaShop.git'
|
||||
url = "https://github.com/md5sha256/AreaShop/tree/dev/bleeding"
|
||||
}
|
||||
licenses {
|
||||
license {
|
||||
name = 'GNU General Public License v3.0'
|
||||
url = "https://github.com/md5sha256/AreaShop/blob/dev/bleeding/LICENSE"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
dependencies {
|
||||
compileOnly(libs.spigot)
|
||||
compileOnly(projects.areashopInterface)
|
||||
}
|
||||
|
||||
description = "AreaShop Bukkit 1.13 and higher"
|
||||
+5
@@ -9,6 +9,11 @@ import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.type.Sign;
|
||||
import org.bukkit.block.data.type.WallSign;
|
||||
|
||||
/**
|
||||
* Sign handler for 1.13+
|
||||
* @deprecated Obsolete as we don't support pre-1.13 versions anyway
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public class BukkitHandler1_13 extends BukkitInterface {
|
||||
|
||||
public BukkitHandler1_13(AreaShopInterface pluginInterface) {
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="minecraft" name="Minecraft">
|
||||
<configuration>
|
||||
<autoDetectTypes>
|
||||
<platformType>BUKKIT</platformType>
|
||||
</autoDetectTypes>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
</module>
|
||||
@@ -1,32 +0,0 @@
|
||||
dependencies {
|
||||
compileOnly 'org.spigotmc:spigot-api:1.18.1-R0.1-SNAPSHOT'
|
||||
compileOnly 'com.sk89q.worldedit:worldedit-bukkit:7.2.8'
|
||||
compileOnly 'com.sk89q.worldguard:worldguard-bukkit:7.0.6'
|
||||
}
|
||||
|
||||
description = 'AreaShop Interface'
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
// ... artifact publications
|
||||
areaShop(MavenPublication) {
|
||||
from components.java
|
||||
pom {
|
||||
group = "me.wiefferink"
|
||||
artifactId = "$project.name"
|
||||
version = "$project.version"
|
||||
scm {
|
||||
connection = 'scm:git:git://github.com/md5sha256/AreaShop.git'
|
||||
developerConnection = 'scm:git:ssh://github.com/md5sha256/AreaShop.git'
|
||||
url = "https://github.com/md5sha256/AreaShop/tree/dev/bleeding"
|
||||
}
|
||||
licenses {
|
||||
license {
|
||||
name = 'GNU General Public License v3.0'
|
||||
url = "https://github.com/md5sha256/AreaShop/blob/dev/bleeding/LICENSE"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
dependencies {
|
||||
compileOnly(libs.spigot)
|
||||
compileOnly(libs.worldeditCore)
|
||||
compileOnly(libs.worldeditBukkit)
|
||||
compileOnly(libs.worldguardCore)
|
||||
compileOnly(libs.worldguardBukkit)
|
||||
}
|
||||
|
||||
description = "AreaShop Interface"
|
||||
@@ -0,0 +1,5 @@
|
||||
dependencies {
|
||||
compileOnly(libs.spigot)
|
||||
}
|
||||
|
||||
description = "AreaShop NMS Interface"
|
||||
File renamed without changes.
File renamed without changes.
@@ -1,55 +0,0 @@
|
||||
plugins {
|
||||
id 'java-library'
|
||||
id 'maven-publish'
|
||||
id 'io.papermc.paperweight.userdev' version '1.3.3' apply false
|
||||
}
|
||||
|
||||
group = 'me.wiefferink'
|
||||
version = '2.7.2'
|
||||
|
||||
subprojects {
|
||||
|
||||
plugins.apply('java-library')
|
||||
plugins.apply('maven-publish')
|
||||
|
||||
version = '2.7.1'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
name = 'oss-sonatype'
|
||||
url = uri("https://oss.sonatype.org/content/groups/public/")
|
||||
}
|
||||
maven {
|
||||
name = 'paper-repo'
|
||||
url = uri('https://papermc.io/repo/repository/maven-public/')
|
||||
}
|
||||
maven {
|
||||
name = 'spigot-repo'
|
||||
url = uri('https://hub.spigotmc.org/nexus/content/repositories/snapshots/')
|
||||
}
|
||||
maven {
|
||||
name = 'jitpack'
|
||||
url = uri('https://jitpack.io')
|
||||
content {
|
||||
includeGroupByRegex("com\\.github.*")
|
||||
}
|
||||
}
|
||||
maven {
|
||||
name = 'aikar-repo'
|
||||
url = uri('https://repo.aikar.co/content/groups/aikar/')
|
||||
}
|
||||
maven {
|
||||
name = 'enginehub-repo'
|
||||
url = uri('https://maven.enginehub.org/repo/')
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
java.toolchain.languageVersion.set(JavaLanguageVersion.of(17))
|
||||
options.release.set(17)
|
||||
options.encoding = 'UTF-8'
|
||||
options.fork = true
|
||||
options.deprecation = true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
plugins {
|
||||
java
|
||||
`java-library`
|
||||
`maven-publish`
|
||||
id("io.papermc.paperweight.userdev") version "1.3.3" apply false
|
||||
idea
|
||||
eclipse
|
||||
}
|
||||
|
||||
group = "me.wiefferink"
|
||||
version = "2.7.4"
|
||||
|
||||
subprojects {
|
||||
|
||||
group = rootProject.group
|
||||
version = rootProject.version
|
||||
|
||||
apply {
|
||||
plugin<JavaPlugin>()
|
||||
plugin<JavaLibraryPlugin>()
|
||||
if (project.path.contains("platform").not()) {
|
||||
plugin<MavenPublishPlugin>()
|
||||
}
|
||||
plugin<IdeaPlugin>()
|
||||
plugin<EclipsePlugin>()
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven("https://oss.sonatype.org/content/groups/public/")
|
||||
maven("https://papermc.io/repo/repository/maven-public/")
|
||||
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
|
||||
maven {
|
||||
name = "jitpack"
|
||||
url = uri("https://jitpack.io")
|
||||
content {
|
||||
includeGroupByRegex("com\\.github.*")
|
||||
}
|
||||
}
|
||||
maven("https://repo.aikar.co/content/groups/aikar/")
|
||||
maven("https://maven.enginehub.org/repo/")
|
||||
}
|
||||
|
||||
tasks {
|
||||
withType(JavaCompile::class) {
|
||||
java.toolchain.languageVersion.set(JavaLanguageVersion.of(17))
|
||||
options.release.set(17)
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
options.isFork = true
|
||||
options.isDeprecation = true
|
||||
}
|
||||
|
||||
withType(Javadoc::class) {
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
}
|
||||
|
||||
withType(ProcessResources::class) {
|
||||
filteringCharset = Charsets.UTF_8.name()
|
||||
}
|
||||
}
|
||||
|
||||
if (project.path.contains("platform").not()) {
|
||||
publishing {
|
||||
publications {
|
||||
create<MavenPublication>(project.name) {
|
||||
from(components["java"])
|
||||
pom {
|
||||
scm {
|
||||
connection.set("scm:git:git://github.com/md5sha256/AreaShop.git")
|
||||
developerConnection.set("scm:git:ssh://github.com/md5sha256/AreaShop.git")
|
||||
url.set("https://github.com/md5sha256/AreaShop/tree/dev/bleeding")
|
||||
}
|
||||
licenses {
|
||||
license {
|
||||
name.set("GNU General Public License v3.0")
|
||||
url.set("https://github.com/md5sha256/AreaShop/blob/dev/bleeding/LICENSE")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
-1
@@ -1 +1,3 @@
|
||||
org.gradle.parallel=true
|
||||
org.gradle.parallel=true
|
||||
org.gradle.caching=true
|
||||
org.gradle.java.installations.auto-download=false
|
||||
@@ -0,0 +1,29 @@
|
||||
[versions]
|
||||
# Platforms
|
||||
minecraft = "1.17.1-R0.1-SNAPSHOT"
|
||||
findbugs = "3.0.2"
|
||||
|
||||
# Minecraft Plugins
|
||||
worldedit = "7.2.8"
|
||||
worldguard = "7.0.6"
|
||||
fawe = "2.0.0"
|
||||
|
||||
# Gradle plugins
|
||||
paperweight = "1.3.3"
|
||||
|
||||
[libraries]
|
||||
# Platform
|
||||
spigot = { group = "org.spigotmc", name = "spigot-api", version.ref = "minecraft" }
|
||||
findbugs = { group = "com.google.code.findbugs", name = "jsr305", version.ref = "findbugs" }
|
||||
|
||||
# Minecraft Plugins
|
||||
worldeditBukkit = { group = "com.sk89q.worldedit", name = "worldedit-bukkit", version.ref = "worldedit" }
|
||||
worldeditCore = { group = "com.sk89q.worldedit", name = "worldedit-core", version.ref = "worldedit" }
|
||||
worldguardBukkit = { group = "com.sk89q.worldguard", name = "worldguard-bukkit", version.ref = "worldguard" }
|
||||
worldguardCore = { group = "com.sk89q.worldguard", name = "worldguard-core", version.ref = "worldguard" }
|
||||
fastasyncworldeditBukkit = { group = "com.fastasyncworldedit", name = "FastAsyncWorldEdit-Bukkit", version.ref = "fawe" }
|
||||
fastasyncworldeditCore = { group = "com.fastasyncworldedit", name = "FastAsyncWorldEdit-Core", version.ref = "fawe" }
|
||||
|
||||
[plugins]
|
||||
# Gradle plugins
|
||||
paperweightUserdev = { id = "io.papermc.paperweight.userdev", version.ref = "paperweight" }
|
||||
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="minecraft" name="Minecraft">
|
||||
<configuration>
|
||||
<autoDetectTypes>
|
||||
<platformType>BUKKIT</platformType>
|
||||
</autoDetectTypes>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
</module>
|
||||
@@ -1,43 +0,0 @@
|
||||
repositories {
|
||||
maven {
|
||||
name = "S01 Sonatype Snapshots"
|
||||
url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly 'org.spigotmc:spigot-api:1.18.1-R0.1-SNAPSHOT'
|
||||
compileOnly("com.fastasyncworldedit:FastAsyncWorldEdit-Core:2.0.0-SNAPSHOT")
|
||||
compileOnly("com.fastasyncworldedit:FastAsyncWorldEdit-Bukkit:2.0.0-SNAPSHOT") {
|
||||
|
||||
}
|
||||
compileOnly 'com.sk89q.worldguard:worldguard-bukkit:7.0.6'
|
||||
compileOnly project(':areashop-interface')
|
||||
}
|
||||
|
||||
description = 'AreaShop FastAsyncWorldEdit'
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
// ... artifact publications
|
||||
areaShop(MavenPublication) {
|
||||
from components.java
|
||||
pom {
|
||||
group = "me.wiefferink"
|
||||
artifactId = "$project.name"
|
||||
version = "$project.version"
|
||||
scm {
|
||||
connection = 'scm:git:git://github.com/md5sha256/AreaShop.git'
|
||||
developerConnection = 'scm:git:ssh://github.com/md5sha256/AreaShop.git'
|
||||
url = "https://github.com/md5sha256/AreaShop/tree/dev/bleeding"
|
||||
}
|
||||
licenses {
|
||||
license {
|
||||
name = 'GNU General Public License v3.0'
|
||||
url = "https://github.com/md5sha256/AreaShop/blob/dev/bleeding/LICENSE"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
-160
@@ -1,160 +0,0 @@
|
||||
package me.wiefferink.areashop.handlers;
|
||||
|
||||
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldguard.WorldGuard;
|
||||
import com.sk89q.worldguard.domains.DefaultDomain;
|
||||
import com.sk89q.worldguard.protection.flags.Flag;
|
||||
import com.sk89q.worldguard.protection.flags.FlagContext;
|
||||
import com.sk89q.worldguard.protection.flags.Flags;
|
||||
import com.sk89q.worldguard.protection.flags.InvalidFlagFormat;
|
||||
import com.sk89q.worldguard.protection.flags.RegionGroup;
|
||||
import com.sk89q.worldguard.protection.flags.RegionGroupFlag;
|
||||
import com.sk89q.worldguard.protection.managers.RegionManager;
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedCuboidRegion;
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||
import me.wiefferink.areashop.interfaces.AreaShopInterface;
|
||||
import me.wiefferink.areashop.interfaces.RegionAccessSet;
|
||||
import me.wiefferink.areashop.interfaces.WorldGuardInterface;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
public class FastAsyncWorldEditWorldGuardHandler extends WorldGuardInterface {
|
||||
|
||||
public FastAsyncWorldEditWorldGuardHandler(AreaShopInterface pluginInterface) {
|
||||
super(pluginInterface);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RegionManager getRegionManager(World world) {
|
||||
return WorldGuard.getInstance().getPlatform().getRegionContainer().get(BukkitAdapter.adapt(world));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<ProtectedRegion> getApplicableRegionsSet(Location location) {
|
||||
Set<ProtectedRegion> result = new HashSet<>();
|
||||
BlockVector3 vector = BlockVector3.at(location.getX(), location.getY(), location.getZ());
|
||||
for(ProtectedRegion region : getRegionManager(location.getWorld()).getRegions().values()) {
|
||||
if(region.contains(vector)) {
|
||||
result.add(region);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a DefaultDomain from a RegionAccessSet.
|
||||
* @param regionAccessSet RegionAccessSet to read
|
||||
* @return DefaultDomain containing the entities from the RegionAccessSet
|
||||
*/
|
||||
private DefaultDomain buildDomain(RegionAccessSet regionAccessSet) {
|
||||
DefaultDomain owners = new DefaultDomain();
|
||||
|
||||
for(String playerName : regionAccessSet.getPlayerNames()) {
|
||||
owners.addPlayer(playerName);
|
||||
}
|
||||
|
||||
for(UUID uuid : regionAccessSet.getPlayerUniqueIds()) {
|
||||
owners.addPlayer(uuid);
|
||||
}
|
||||
|
||||
for(String group : regionAccessSet.getGroupNames()) {
|
||||
owners.addGroup(group);
|
||||
}
|
||||
|
||||
return owners;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOwners(ProtectedRegion region, RegionAccessSet regionAccessSet) {
|
||||
DefaultDomain defaultDomain = buildDomain(regionAccessSet);
|
||||
if(!region.getOwners().toUserFriendlyString().equals(defaultDomain.toUserFriendlyString())) {
|
||||
region.setOwners(defaultDomain);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMembers(ProtectedRegion region, RegionAccessSet regionAccessSet) {
|
||||
DefaultDomain defaultDomain = buildDomain(regionAccessSet);
|
||||
if(!region.getMembers().toUserFriendlyString().equals(defaultDomain.toUserFriendlyString())) {
|
||||
region.setMembers(defaultDomain);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean containsMember(ProtectedRegion region, UUID player) {
|
||||
return region.getMembers().contains(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean containsOwner(ProtectedRegion region, UUID player) {
|
||||
return region.getOwners().contains(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RegionAccessSet getMembers(ProtectedRegion region) {
|
||||
RegionAccessSet result = new RegionAccessSet();
|
||||
result.getGroupNames().addAll(region.getMembers().getGroups());
|
||||
result.getPlayerNames().addAll(region.getMembers().getPlayers());
|
||||
result.getPlayerUniqueIds().addAll(region.getMembers().getUniqueIds());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RegionAccessSet getOwners(ProtectedRegion region) {
|
||||
RegionAccessSet result = new RegionAccessSet();
|
||||
result.getGroupNames().addAll(region.getOwners().getGroups());
|
||||
result.getPlayerNames().addAll(region.getOwners().getPlayers());
|
||||
result.getPlayerUniqueIds().addAll(region.getOwners().getUniqueIds());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Flag<?> fuzzyMatchFlag(String flagName) {
|
||||
return Flags.fuzzyMatchFlag(WorldGuard.getInstance().getFlagRegistry(), flagName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <V> V parseFlagInput(Flag<V> flag, String input) throws InvalidFlagFormat {
|
||||
return flag.parseInput(FlagContext.create().setInput(input).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public RegionGroup parseFlagGroupInput(RegionGroupFlag flag, String input) throws InvalidFlagFormat {
|
||||
return flag.parseInput(FlagContext.create().setInput(input).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vector getMinimumPoint(ProtectedRegion region) {
|
||||
BlockVector3 min = region.getMinimumPoint();
|
||||
return new Vector(min.getX(), min.getY(), min.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vector getMaximumPoint(ProtectedRegion region) {
|
||||
BlockVector3 min = region.getMaximumPoint();
|
||||
return new Vector(min.getX(), min.getY(), min.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Vector> getRegionPoints(ProtectedRegion region) {
|
||||
List<Vector> result = new ArrayList<>();
|
||||
for (BlockVector2 point : region.getPoints()) {
|
||||
result.add(new Vector(point.getX(), 0,point.getZ()));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProtectedCuboidRegion createCuboidRegion(String name, Vector corner1, Vector corner2) {
|
||||
return new ProtectedCuboidRegion(name, BlockVector3.at(corner1.getBlockX(), corner1.getBlockY(), corner1.getBlockZ()), BlockVector3.at(corner2.getBlockX(), corner2.getBlockY(), corner2.getBlockZ()));
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
plugins.apply("io.papermc.paperweight.userdev")
|
||||
|
||||
dependencies {
|
||||
paperweightDevelopmentBundle("io.papermc.paper:dev-bundle:1.17.1-R0.1-SNAPSHOT")
|
||||
compileOnly project(':areashop-interface')
|
||||
compileOnly project(':areashop-nms')
|
||||
}
|
||||
|
||||
reobfJar {
|
||||
outputJar.set(file("build/libs/${project.name}-${project.version}.jar"))
|
||||
}
|
||||
|
||||
assemble {
|
||||
dependsOn(reobfJar)
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
// ... artifact publications
|
||||
nmsProvider(MavenPublication) {
|
||||
pom {
|
||||
group = "me.wiefferink"
|
||||
artifactId = "$project.name"
|
||||
version = "$project.version"
|
||||
scm {
|
||||
connection = 'scm:git:git://github.com/md5sha256/AreaShop.git'
|
||||
developerConnection = 'scm:git:ssh://github.com/md5sha256/AreaShop.git'
|
||||
url = "https://github.com/md5sha256/AreaShop/tree/dev/bleeding"
|
||||
}
|
||||
licenses {
|
||||
license {
|
||||
name = 'GNU General Public License v3.0'
|
||||
url = "https://github.com/md5sha256/AreaShop/blob/dev/bleeding/LICENSE"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
description = 'AreaShop NMS Helper'
|
||||
@@ -1,41 +0,0 @@
|
||||
plugins.apply("io.papermc.paperweight.userdev")
|
||||
|
||||
dependencies {
|
||||
paperweightDevelopmentBundle("io.papermc.paper:dev-bundle:1.18.1-R0.1-SNAPSHOT")
|
||||
compileOnly project(':areashop-interface')
|
||||
compileOnly project(':areashop-nms')
|
||||
}
|
||||
|
||||
reobfJar {
|
||||
outputJar.set(file("build/libs/${project.name}-${project.version}.jar"))
|
||||
}
|
||||
|
||||
assemble {
|
||||
dependsOn(reobfJar)
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
// ... artifact publications
|
||||
nmsProvider(MavenPublication) {
|
||||
pom {
|
||||
group = "me.wiefferink"
|
||||
artifactId = "$project.name"
|
||||
version = "$project.version"
|
||||
scm {
|
||||
connection = 'scm:git:git://github.com/md5sha256/AreaShop.git'
|
||||
developerConnection = 'scm:git:ssh://github.com/md5sha256/AreaShop.git'
|
||||
url = "https://github.com/md5sha256/AreaShop/tree/dev/bleeding"
|
||||
}
|
||||
licenses {
|
||||
license {
|
||||
name = 'GNU General Public License v3.0'
|
||||
url = "https://github.com/md5sha256/AreaShop/blob/dev/bleeding/LICENSE"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
description = 'AreaShop NMS Helper'
|
||||
@@ -1,29 +0,0 @@
|
||||
dependencies {
|
||||
compileOnly 'org.spigotmc:spigot-api:1.17.1-R0.1-SNAPSHOT'
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
// ... artifact publications
|
||||
nmsProvider(MavenPublication) {
|
||||
pom {
|
||||
group = "me.wiefferink"
|
||||
artifactId = "$project.name"
|
||||
version = "$project.version"
|
||||
scm {
|
||||
connection = 'scm:git:git://github.com/md5sha256/AreaShop.git'
|
||||
developerConnection = 'scm:git:ssh://github.com/md5sha256/AreaShop.git'
|
||||
url = "https://github.com/md5sha256/AreaShop/tree/dev/bleeding"
|
||||
}
|
||||
licenses {
|
||||
license {
|
||||
name = 'GNU General Public License v3.0'
|
||||
url = "https://github.com/md5sha256/AreaShop/blob/dev/bleeding/LICENSE"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
description = 'AreaShop NMS Interface'
|
||||
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="minecraft" name="Minecraft">
|
||||
<configuration>
|
||||
<autoDetectTypes>
|
||||
<platformType>BUKKIT</platformType>
|
||||
</autoDetectTypes>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
</module>
|
||||
@@ -1,33 +0,0 @@
|
||||
dependencies {
|
||||
compileOnly 'org.spigotmc:spigot-api:1.18.1-R0.1-SNAPSHOT'
|
||||
compileOnly 'com.sk89q.worldedit:worldedit-bukkit:7.2.8'
|
||||
compileOnly 'com.sk89q.worldguard:worldguard-bukkit:7.0.6'
|
||||
compileOnly project(':areashop-interface')
|
||||
}
|
||||
|
||||
description = 'AreaShop WorldEdit 7'
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
// ... artifact publications
|
||||
areaShop(MavenPublication) {
|
||||
from components.java
|
||||
pom {
|
||||
group = "me.wiefferink"
|
||||
artifactId = "$project.name"
|
||||
version = "$project.version"
|
||||
scm {
|
||||
connection = 'scm:git:git://github.com/md5sha256/AreaShop.git'
|
||||
developerConnection = 'scm:git:ssh://github.com/md5sha256/AreaShop.git'
|
||||
url = "https://github.com/md5sha256/AreaShop/tree/dev/bleeding"
|
||||
}
|
||||
licenses {
|
||||
license {
|
||||
name = 'GNU General Public License v3.0'
|
||||
url = "https://github.com/md5sha256/AreaShop/blob/dev/bleeding/LICENSE"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="minecraft" name="Minecraft">
|
||||
<configuration>
|
||||
<autoDetectTypes>
|
||||
<platformType>BUKKIT</platformType>
|
||||
</autoDetectTypes>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
</module>
|
||||
@@ -1,33 +0,0 @@
|
||||
dependencies {
|
||||
compileOnly 'org.spigotmc:spigot-api:1.18.1-R0.1-SNAPSHOT'
|
||||
compileOnly 'com.sk89q.worldedit:worldedit-bukkit:7.2.8'
|
||||
compileOnly 'com.sk89q.worldguard:worldguard-bukkit:7.0.6'
|
||||
compileOnly project(':areashop-interface')
|
||||
}
|
||||
|
||||
description = 'AreaShop WorldGuard 7'
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
// ... artifact publications
|
||||
areaShop(MavenPublication) {
|
||||
from components.java
|
||||
pom {
|
||||
group = "me.wiefferink"
|
||||
artifactId = "$project.name"
|
||||
version = "$project.version"
|
||||
scm {
|
||||
connection = 'scm:git:git://github.com/md5sha256/AreaShop.git'
|
||||
developerConnection = 'scm:git:ssh://github.com/md5sha256/AreaShop.git'
|
||||
url = "https://github.com/md5sha256/AreaShop/tree/dev/bleeding"
|
||||
}
|
||||
licenses {
|
||||
license {
|
||||
name = 'GNU General Public License v3.0'
|
||||
url = "https://github.com/md5sha256/AreaShop/blob/dev/bleeding/LICENSE"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
gradlePluginPortal()
|
||||
maven {
|
||||
name = 'paper-repo'
|
||||
url = uri('https://papermc.io/repo/repository/maven-public/')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.name = 'areashop-parent'
|
||||
include(':areashop-bukkit-1_13')
|
||||
include(':areashop-worldguard-7')
|
||||
include(':areashop-interface')
|
||||
include(':areashop-nms')
|
||||
include(':areashop-nms-1-17')
|
||||
include(':areashop-nms-1-18')
|
||||
include(':areashop-worldedit-7')
|
||||
include(':areashop-fastasyncworldedit')
|
||||
include(':areashop')
|
||||
project(':areashop').projectDir = file('AreaShop')
|
||||
project(':areashop-nms').projectDir = file('hooks/areashop-nms')
|
||||
project(':areashop-nms-1-17').projectDir = file('hooks/areashop-nms-1-17')
|
||||
project(':areashop-nms-1-18').projectDir = file('hooks/areashop-nms-1-18')
|
||||
project(':areashop-worldedit-7').projectDir = file('hooks/areashop-worldedit-7')
|
||||
project(':areashop-worldguard-7').projectDir = file('hooks/areashop-worldguard-7')
|
||||
project(':areashop-fastasyncworldedit').projectDir = file('hooks/areashop-fastasyncworldedit')
|
||||
@@ -0,0 +1,38 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
gradlePluginPortal()
|
||||
maven {
|
||||
name = "paper-repo"
|
||||
url = uri("https://papermc.io/repo/repository/maven-public/")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildCache {
|
||||
local {
|
||||
directory = File(rootDir, "build-cache")
|
||||
removeUnusedEntriesAfterDays = 7
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.name = "areashop-parent"
|
||||
|
||||
// Interfaces
|
||||
include(":areashop-bukkit-1_13")
|
||||
include(":areashop-interface")
|
||||
include(":areashop-nms")
|
||||
|
||||
// Adapters
|
||||
include(":adapters:platform:bukkit-1-17")
|
||||
include(":adapters:platform:bukkit-1-18")
|
||||
include(":adapters:plugins:worldedit")
|
||||
include(":adapters:plugins:worldguard")
|
||||
include(":adapters:plugins:fastasyncworldedit")
|
||||
|
||||
// Main project
|
||||
include(":areashop")
|
||||
|
||||
project(":areashop").projectDir = file("AreaShop")
|
||||
|
||||
enableFeaturePreview("VERSION_CATALOGS")
|
||||
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
|
||||
Reference in new issue
Block a user