mirror of
https://gitlab.com/SamB440/rpgregions-2.git
synced 2025-12-29 11:49:08 +00:00
Merge branch 'master' of https://gitlab.com/SamB440/rpgregions-2
Conflicts: gradle/wrapper/gradle-wrapper.jar gradle/wrapper/gradle-wrapper.properties
This commit is contained in:
@@ -18,6 +18,6 @@ RPGRegions 2 is the successor to RPGRegions 1. The entire plugin has been recode
|
||||
RPGRegions uses gradle and builds on JDK 8. Clone the repository and run `./gradlew build` in the directory.
|
||||
|
||||
## Compilation errors
|
||||
You may get an error where UltraRegions cannot be resolved. To fix this, go to `gradle.properties` and set `ultraRegionsSupport` to `false`.
|
||||
You may get an error where UltraRegions cannot be resolved. To fix this, go to `gradle.properties` and `modern/build.gradle` and set `ultraRegionsSupport` to `false`.
|
||||
Note that this will disable support for UltraRegions.
|
||||
|
||||
|
||||
@@ -27,11 +27,17 @@ repositories {
|
||||
maven { url = "https://repo.aikar.co/content/groups/aikar/" }
|
||||
|
||||
maven { url = "https://jitpack.io" }
|
||||
|
||||
// PAPI
|
||||
maven {
|
||||
url = 'http://repo.extendedclip.com/content/repositories/placeholderapi/'
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testCompile group: 'junit', name: 'junit', version: '4.12'
|
||||
compileOnly 'org.spigotmc:spigot-api:1.12.2-R0.1-SNAPSHOT' // spigot
|
||||
compileOnly 'com.github.MilkBowl:VaultAPI:1.7' // vault
|
||||
compileOnly 'me.clip:placeholderapi:2.10.4' // PAPI
|
||||
implementation 'io.papermc:paperlib:1.0.4' // paperlib - async teleport on Paper
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package net.islandearth.rpgregions.requirements;
|
||||
|
||||
import me.clip.placeholderapi.PlaceholderAPI;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class PlaceholderRequirement extends RegionRequirement {
|
||||
|
||||
private String placeholder;
|
||||
private String equal;
|
||||
|
||||
public PlaceholderRequirement(String placeholder, String equal) {
|
||||
this.placeholder = placeholder;
|
||||
this.equal = equal;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean meetsRequirements(Player player) {
|
||||
try {
|
||||
int number = Integer.parseInt(equal);
|
||||
int parsedNumber = Integer.parseInt(PlaceholderAPI.setPlaceholders(player, placeholder));
|
||||
if (number >= parsedNumber) {
|
||||
return true;
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
return PlaceholderAPI.setPlaceholders(player, placeholder).equals(equal);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Placeholder";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(Player player) {
|
||||
return "placeholder " + placeholder;
|
||||
}
|
||||
|
||||
public String getPlaceholder() {
|
||||
return placeholder;
|
||||
}
|
||||
|
||||
public String getEqual() {
|
||||
return equal;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
pluginGroup=net.islandearth
|
||||
pluginVersion=1.3.0
|
||||
# Set to false if you don't have access to the UltraRegions API jar to make the plugin compilable. The purchased plugin has support for it.
|
||||
ultraRegionsSupport = true
|
||||
ultraRegionsSupport=false
|
||||
|
||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
@@ -7,6 +7,9 @@ version = pluginVersion
|
||||
|
||||
sourceCompatibility = 1.8
|
||||
|
||||
// Set to false if you don't have access to the UltraRegions API jar to make the plugin compilable. The purchased plugin has support for it.
|
||||
ultraRegions = ultraRegionsSupport
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
@@ -36,6 +39,10 @@ repositories {
|
||||
}
|
||||
}
|
||||
|
||||
compileJava {
|
||||
if (!ultraRegions) sourceSets.main.java.exclude "**/net/islandearth/rpgregions/api/integrations/ultraregions/UltraRegionsIntegration.java"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testCompile group: 'junit', name: 'junit', version: '4.12'
|
||||
implementation 'net.islandearth:languagy-api:2.0.2-SNAPSHOT' // languagy
|
||||
@@ -46,7 +53,7 @@ dependencies {
|
||||
compileOnly 'org.spigotmc:spigot-api:1.13.2-R0.1-SNAPSHOT' // spigot
|
||||
compileOnly 'net.zrips:residence:4.9.0.6' // residence
|
||||
compileOnly 'me.ryanhamshire:griefprevention:16.13.0' // griefprevention
|
||||
if (ultraRegionsSupport) compileOnly 'me.techscode:ultraregions:1.2.2' // ultraregions
|
||||
if (ultraRegions) compileOnly 'me.techscode:ultraregions:1.2.2' // ultraregions
|
||||
compileOnly project(':api')
|
||||
compileOnly project(':rpgregions')
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public class UltraRegionsIntegration implements IntegrationManager {
|
||||
|
||||
@Override
|
||||
public boolean isInRegion(Location location) {
|
||||
return false;
|
||||
return this.getProtectedRegions(location).size() > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user