mirror of
https://github.com/bloodmc/GriefDefender.git
synced 2025-01-19 21:21:24 +01:00
sponge: Fix permission lookups for 'any'.
* Fix '/cf' command when using modid:any. * Improve sponge playerdata migration.
This commit is contained in:
parent
69cb3c6728
commit
501c303775
@ -242,9 +242,7 @@ public static PermissionResult addFlagPermission(CommandSource src, GDPermission
|
||||
}
|
||||
|
||||
String[] parts = target.split(":");
|
||||
if (parts.length > 1 && parts[1].equalsIgnoreCase("any")) {
|
||||
target = baseFlag + "." + parts[0];
|
||||
} else {
|
||||
if (parts.length <= 1 || !parts[1].equalsIgnoreCase("any")) {
|
||||
// check for meta
|
||||
parts = target.split("\\.");
|
||||
String targetFlag = parts[0];
|
||||
|
@ -37,6 +37,7 @@
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.HashSet;
|
||||
@ -63,9 +64,15 @@ public class GPSpongeMigrator {
|
||||
|
||||
public void migrateData() {
|
||||
try {
|
||||
FileUtils.copyDirectory(GP_GLOBAL_PLAYER_DATA_PATH.toFile(), GD_DATA_ROOT_PATH.resolve("GlobalPlayerData").toFile(), true);
|
||||
if (Files.exists(GP_GLOBAL_PLAYER_DATA_PATH)) {
|
||||
if (Files.isDirectory(GP_GLOBAL_PLAYER_DATA_PATH)) {
|
||||
FileUtils.copyDirectory(GP_GLOBAL_PLAYER_DATA_PATH.toFile(), GD_DATA_ROOT_PATH.resolve("GlobalPlayerData").toFile(), true);
|
||||
} else {
|
||||
// Support symlinks
|
||||
FileUtils.copyFile(GP_GLOBAL_PLAYER_DATA_PATH.toFile(), GD_DATA_ROOT_PATH.resolve("GlobalPlayerData").toFile(), true);
|
||||
}
|
||||
}
|
||||
FileUtils.copyDirectory(GP_CLAIM_DATA_PATH.toFile(), GD_DATA_ROOT_PATH.resolve("worlds").toFile(), true);
|
||||
//FileUtils.copyFile(GP_GLOBAL_CONFIG.toFile(), GD_DATA_ROOT_PATH.resolve("global.conf").toFile());
|
||||
} catch (IOException e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
|
@ -983,12 +983,16 @@ private Set<Context> populateEventSourceTargetContext(Set<Context> contexts, Str
|
||||
if (!id.contains(":")) {
|
||||
id = "minecraft:" + id;
|
||||
}
|
||||
final String[] parts = id.split(":");
|
||||
final String modId = parts[0];
|
||||
if (isSource) {
|
||||
this.eventSourceId = id.toLowerCase();
|
||||
contexts.add(new Context("source", this.eventSourceId));
|
||||
contexts.add(new Context("source", modId + ":any"));
|
||||
} else {
|
||||
this.eventTargetId = id.toLowerCase();
|
||||
contexts.add(new Context("target", this.eventTargetId));
|
||||
contexts.add(new Context("target", modId + ":any"));
|
||||
}
|
||||
return contexts;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user