truly fix personal groups saving issues. idk why i dont notice this right away
This commit is contained in:
parent
0c3f006611
commit
f06bf034a9
@ -100,7 +100,7 @@ public class PermissionRegistry {
|
||||
|
||||
public static ClaimPermission get(String id) {
|
||||
if (!permissions.containsKey(id))
|
||||
throw new NullPointerException("No such permission "+ id + " registered");
|
||||
throw new NullPointerException("No such permission " + id + " registered");
|
||||
return permissions.get(id);
|
||||
}
|
||||
|
||||
|
@ -250,7 +250,7 @@ public class EntityInteractEvents {
|
||||
for (int x = -1; x <= 1; x++)
|
||||
for (int z = -1; z <= 1; z++) {
|
||||
IPermissionContainer claim = storage.getForPermissionCheck(wither.getBlockPos().add(x, 0, z));
|
||||
if (!claim.canInteract(null, PermissionRegistry.WITHER, pos.set(pos.getX() + x, pos.getY() + 0, pos.getZ() + z), false))
|
||||
if (!claim.canInteract(null, PermissionRegistry.WITHER, pos.set(pos.getX() + x, pos.getY() + 3, pos.getZ() + z), false))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@ -261,9 +261,7 @@ public class EntityInteractEvents {
|
||||
return true;
|
||||
ClaimStorage storage = ClaimStorage.get((ServerWorld) enderman.world);
|
||||
IPermissionContainer claim = storage.getForPermissionCheck(pos);
|
||||
if (!claim.canInteract(null, PermissionRegistry.ENDERMAN, pos, false))
|
||||
return false;
|
||||
return true;
|
||||
return claim.canInteract(null, PermissionRegistry.ENDERMAN, pos, false);
|
||||
}
|
||||
|
||||
public static boolean canSnowGolemInteract(SnowGolemEntity snowgolem) {
|
||||
|
@ -53,7 +53,7 @@ public class PlayerClaimData {
|
||||
private boolean confirmDeleteAll, adminIgnoreClaim, claimBlockMessage;
|
||||
private boolean dirty;
|
||||
|
||||
private Map<String, Map<ClaimPermission, Boolean>> defaultGroups = new HashMap<>();
|
||||
private final Map<String, Map<ClaimPermission, Boolean>> defaultGroups = new HashMap<>();
|
||||
|
||||
public PlayerClaimData(ServerPlayerEntity player) {
|
||||
this.player = player;
|
||||
@ -291,8 +291,15 @@ public class PlayerClaimData {
|
||||
this.additionalClaimBlocks = obj.get("AdditionalBlocks").getAsInt();
|
||||
JsonObject defP = ConfigHandler.fromJson(obj, "DefaultGroups");
|
||||
defP.entrySet().forEach(e -> {
|
||||
Map<ClaimPermission, Boolean> perms = new HashMap<>();
|
||||
perms.forEach((p, b) -> this.editDefaultPerms(e.getKey(), p, b ? 1 : 0));
|
||||
if (e.getValue().isJsonObject()) {
|
||||
e.getValue().getAsJsonObject().entrySet().forEach(p -> {
|
||||
try {
|
||||
this.editDefaultPerms(e.getKey(), PermissionRegistry.get(p.getKey()), p.getValue().getAsBoolean() ? 1 : 0);
|
||||
} catch (NullPointerException ex) {
|
||||
Flan.logger.error("Error reading Permission {} for personal group {} for player {}. Permission doesnt exist", p.getKey(), e.getKey(), this.player.getName().asString());
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
reader.close();
|
||||
} catch (IOException e) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user