mirror of
https://github.com/TotalFreedomMC/TF-PlotSquared.git
synced 2024-12-23 00:15:06 +00:00
Update for TFM staff refactor
This commit is contained in:
parent
9866ee5d80
commit
ccbceac360
5 changed files with 23 additions and 22 deletions
|
@ -21,7 +21,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.plotsquared</groupId>
|
<groupId>com.plotsquared</groupId>
|
||||||
<artifactId>PlotSquared-Core</artifactId>
|
<artifactId>PlotSquared-Core</artifactId>
|
||||||
<version>5.13.1</version>
|
<version>5.13.2</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -152,6 +152,12 @@
|
||||||
<version>1.16.1-R0.1-SNAPSHOT</version>
|
<version>1.16.1-R0.1-SNAPSHOT</version>
|
||||||
<scope>runtime</scope>
|
<scope>runtime</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>me.totalfreedom</groupId>
|
||||||
|
<artifactId>TotalFreedomMod</artifactId>
|
||||||
|
<version>2020.9</version>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.kyori</groupId>
|
<groupId>net.kyori</groupId>
|
||||||
<artifactId>text-adapter-bukkit</artifactId>
|
<artifactId>text-adapter-bukkit</artifactId>
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
repositories {
|
repositories {
|
||||||
maven { url = "https://jitpack.io" }
|
maven { url = "https://jitpack.io" }
|
||||||
maven { url = "https://mvn.intellectualsites.com/content/repositories/snapshots" }
|
maven { url = "https://mvn.intellectualsites.com/content/repositories/snapshots" }
|
||||||
maven {
|
maven { url = "https://hub.spigotmc.org/nexus/content/repositories/snapshots/" }
|
||||||
name = "spigot"
|
maven { url = "https://rayzr.dev/repo/" }
|
||||||
url = "https://hub.spigotmc.org/nexus/content/repositories/snapshots/"
|
maven { url = "https://repo.dmulloy2.net/nexus/repository/public/" }
|
||||||
}
|
maven { url = "https://telesphoreo.me/repo/maven" }
|
||||||
maven { url 'https://rayzr.dev/repo/' }
|
|
||||||
maven { url "https://repo.dmulloy2.net/nexus/repository/public/" }
|
|
||||||
}
|
}
|
||||||
def textVersion = "3.0.2"
|
def textVersion = "3.0.2"
|
||||||
|
|
||||||
|
@ -25,7 +23,7 @@ dependencies {
|
||||||
implementation("org.jetbrains:annotations:19.0.0")
|
implementation("org.jetbrains:annotations:19.0.0")
|
||||||
implementation("org.khelekore:prtree:1.7.0-SNAPSHOT")
|
implementation("org.khelekore:prtree:1.7.0-SNAPSHOT")
|
||||||
implementation("org.spigotmc:spigot-api:1.16.1-R0.1-SNAPSHOT")
|
implementation("org.spigotmc:spigot-api:1.16.1-R0.1-SNAPSHOT")
|
||||||
implementation("com.github.TFPatches:TotalFreedomMod:server-SNAPSHOT")
|
implementation("me.totalfreedom:TotalFreedomMod:2020.9")
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceCompatibility = 1.8
|
sourceCompatibility = 1.8
|
||||||
|
|
|
@ -30,7 +30,6 @@ import com.plotsquared.core.player.PlotPlayer;
|
||||||
import com.plotsquared.core.plot.message.PlotMessage;
|
import com.plotsquared.core.plot.message.PlotMessage;
|
||||||
import com.plotsquared.core.util.MainUtil;
|
import com.plotsquared.core.util.MainUtil;
|
||||||
import com.plotsquared.core.util.MathMan;
|
import com.plotsquared.core.util.MathMan;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.StringComparison;
|
import com.plotsquared.core.util.StringComparison;
|
||||||
import com.plotsquared.core.util.StringMan;
|
import com.plotsquared.core.util.StringMan;
|
||||||
import com.plotsquared.core.util.task.RunnableVal2;
|
import com.plotsquared.core.util.task.RunnableVal2;
|
||||||
|
@ -162,7 +161,7 @@ public abstract class Command {
|
||||||
|
|
||||||
public boolean hasConfirmation(CommandCaller player) {
|
public boolean hasConfirmation(CommandCaller player) {
|
||||||
// Confirmation message bypass
|
// Confirmation message bypass
|
||||||
return this.confirmation && !plotSquaredHandler.isAdmin(player);
|
return this.confirmation && !plotSquaredHandler.isStaff(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getAliases() {
|
public List<String> getAliases() {
|
||||||
|
|
|
@ -17,21 +17,21 @@ public class PlotSquaredHandler
|
||||||
public static final Logger LOGGER = Bukkit.getPluginManager().getPlugin("PlotSquared").getLogger();
|
public static final Logger LOGGER = Bukkit.getPluginManager().getPlugin("PlotSquared").getLogger();
|
||||||
private static Function<Player, Boolean> adminProvider;
|
private static Function<Player, Boolean> adminProvider;
|
||||||
|
|
||||||
public boolean isAdmin(CommandCaller commandCaller)
|
public boolean isStaff(CommandCaller commandCaller)
|
||||||
{
|
{
|
||||||
final Player player = getPlayer(commandCaller.toString());
|
final Player player = getPlayer(commandCaller.toString());
|
||||||
if (player == null)
|
if (player == null)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return isAdmin(player);
|
return isStaff(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public boolean isAdmin(Player player)
|
public boolean isStaff(Player player)
|
||||||
{
|
{
|
||||||
TotalFreedomMod tfm = getTFM();
|
TotalFreedomMod tfm = getTFM();
|
||||||
return tfm.al.isAdmin(player);
|
return tfm.sl.isStaff(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Player getPlayer(CommandCaller commandCaller)
|
public static Player getPlayer(CommandCaller commandCaller)
|
||||||
|
@ -59,7 +59,7 @@ public class PlotSquaredHandler
|
||||||
"plots.worldedit.bypass", "plots.area", "plots.grant.add", "plots.debugallowunsafe", "plots.debugroadgen", "plots.debugpaste",
|
"plots.worldedit.bypass", "plots.area", "plots.grant.add", "plots.debugallowunsafe", "plots.debugroadgen", "plots.debugpaste",
|
||||||
"plots.createroadschematic", "plots.merge", "plots.unlink", "plots.area", "plots.setup", "plots.set.flag.other", "plots.reload",
|
"plots.createroadschematic", "plots.merge", "plots.unlink", "plots.area", "plots.setup", "plots.set.flag.other", "plots.reload",
|
||||||
"plots.backup", "plots.debug");
|
"plots.backup", "plots.debug");
|
||||||
if (!isAdmin(player))
|
if (!isStaff(player))
|
||||||
{
|
{
|
||||||
return !permission.startsWith("plots.admin") && !adminOnlyPermissions.contains(permission);
|
return !permission.startsWith("plots.admin") && !adminOnlyPermissions.contains(permission);
|
||||||
}
|
}
|
||||||
|
|
12
build.gradle
12
build.gradle
|
@ -5,12 +5,10 @@ buildscript {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" }
|
maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" }
|
||||||
jcenter()
|
jcenter()
|
||||||
maven {
|
maven { url = "https://hub.spigotmc.org/nexus/content/repositories/snapshots/" }
|
||||||
name = "spigot"
|
maven { url = "https://rayzr.dev/repo/" }
|
||||||
url = "https://hub.spigotmc.org/nexus/content/repositories/snapshots/"
|
maven { url = "https://repo.dmulloy2.net/nexus/repository/public/" }
|
||||||
}
|
maven { url = "https://telesphoreo.me/repo/maven" }
|
||||||
maven { url 'https://rayzr.dev/repo/' }
|
|
||||||
maven { url "https://repo.dmulloy2.net/nexus/repository/public/" }
|
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath("com.github.jengelman.gradle.plugins:shadow:5.0.0")
|
classpath("com.github.jengelman.gradle.plugins:shadow:5.0.0")
|
||||||
|
@ -107,7 +105,7 @@ subprojects {
|
||||||
testAnnotationProcessor("org.projectlombok:lombok:1.18.8")
|
testAnnotationProcessor("org.projectlombok:lombok:1.18.8")
|
||||||
testImplementation("junit:junit:4.13")
|
testImplementation("junit:junit:4.13")
|
||||||
implementation("org.spigotmc:spigot-api:1.16.1-R0.1-SNAPSHOT")
|
implementation("org.spigotmc:spigot-api:1.16.1-R0.1-SNAPSHOT")
|
||||||
implementation("com.github.TFPatches:TotalFreedomMod:server-SNAPSHOT")
|
implementation("me.totalfreedom:TotalFreedomMod:2020.9")
|
||||||
}
|
}
|
||||||
|
|
||||||
configurations.all {
|
configurations.all {
|
||||||
|
|
Loading…
Reference in a new issue