Not conforming to the Bukkit Permission API spec
Closed this issue ยท 1 comments
Relates to modification of Permission#getChildren
at runtime.
Possibly the cause of issues such as #1330
Test code:
var permission = new Permission("aperm");
server.getPluginManager().removePermission(permission);
server.getPluginManager().addPermission(permission);
Commands.create()
.handler(function(c) {
var player = c.sender();
player.sendMessage("-----------------------------------------")
player.sendMessage("a0 - false, false")
player.sendMessage(player.hasPermission("aperm"));
player.sendMessage(player.hasPermission("aperm2"));
var attachment = player.addAttachment(plugin, "aperm", true);
player.sendMessage("a1 - true, false")
player.sendMessage(player.hasPermission("aperm"));
player.sendMessage(player.hasPermission("aperm2"));
permission.getChildren().put("aperm2", true);
player.sendMessage("a2 - true, false")
player.sendMessage(player.hasPermission("aperm"));
player.sendMessage(player.hasPermission("aperm2"));
permission.recalculatePermissibles();
player.sendMessage("a3 - true, true")
player.sendMessage(player.hasPermission("aperm"));
player.sendMessage(player.hasPermission("aperm2"));
permission.getChildren().clear();
player.sendMessage("a4 - true, true")
player.sendMessage(player.hasPermission("aperm"));
player.sendMessage(player.hasPermission("aperm2"));
permission.recalculatePermissibles();
player.sendMessage("a5 - true, false")
player.sendMessage(player.hasPermission("aperm"));
player.sendMessage(player.hasPermission("aperm2"));
player.removeAttachment(attachment);
player.sendMessage("a6 - false, false")
player.sendMessage(player.hasPermission("aperm"));
player.sendMessage(player.hasPermission("aperm2"));
})
.registerAndBind(registry, "permtest")
With LP:
[15:13:29] [main/INFO]: [CHAT] -----------------------------------------
[15:13:29] [main/INFO]: [CHAT] a0 - false, false
[15:13:29] [main/INFO]: [CHAT] false
[15:13:29] [main/INFO]: [CHAT] false
[15:13:29] [main/INFO]: [CHAT] a1 - true, false
[15:13:29] [main/INFO]: [CHAT] true
[15:13:29] [main/INFO]: [CHAT] false
[15:13:29] [main/INFO]: [CHAT] a2 - true, false
[15:13:29] [main/INFO]: [CHAT] true
[15:13:29] [main/INFO]: [CHAT] false
[15:13:29] [main/INFO]: [CHAT] a3 - true, true
[15:13:29] [main/INFO]: [CHAT] true
[15:13:29] [main/INFO]: [CHAT] false
[15:13:29] [main/INFO]: [CHAT] a4 - true, true
[15:13:29] [main/INFO]: [CHAT] true
[15:13:29] [main/INFO]: [CHAT] false
[15:13:29] [main/INFO]: [CHAT] a5 - true, false
[15:13:29] [main/INFO]: [CHAT] true
[15:13:29] [main/INFO]: [CHAT] false
[15:13:29] [main/INFO]: [CHAT] a6 - false, false
[15:13:29] [main/INFO]: [CHAT] false
[15:13:29] [main/INFO]: [CHAT] false
With Bukkit:
[15:14:24] [main/INFO]: [CHAT] -----------------------------------------
[15:14:24] [main/INFO]: [CHAT] a0 - false, false
[15:14:24] [main/INFO]: [CHAT] false
[15:14:24] [main/INFO]: [CHAT] false
[15:14:24] [main/INFO]: [CHAT] a1 - true, false
[15:14:24] [main/INFO]: [CHAT] true
[15:14:24] [main/INFO]: [CHAT] false
[15:14:24] [main/INFO]: [CHAT] a2 - true, false
[15:14:24] [main/INFO]: [CHAT] true
[15:14:24] [main/INFO]: [CHAT] false
[15:14:24] [main/INFO]: [CHAT] a3 - true, true
[15:14:24] [main/INFO]: [CHAT] true
[15:14:24] [main/INFO]: [CHAT] true
[15:14:24] [main/INFO]: [CHAT] a4 - true, true
[15:14:24] [main/INFO]: [CHAT] true
[15:14:24] [main/INFO]: [CHAT] true
[15:14:24] [main/INFO]: [CHAT] a5 - true, false
[15:14:24] [main/INFO]: [CHAT] true
[15:14:24] [main/INFO]: [CHAT] false
[15:14:24] [main/INFO]: [CHAT] a6 - false, false
[15:14:24] [main/INFO]: [CHAT] false
[15:14:24] [main/INFO]: [CHAT] false