Skip to content

Commit

Permalink
#811 Register protections using a player's name instead of their UUID…
Browse files Browse the repository at this point in the history
… -- the new converter will change the format so better keep better backwards compatibility (/cremoveall, and so on) for now
  • Loading branch information
Hidendra committed Apr 29, 2014
1 parent 2ed212e commit 880acaf
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -124,20 +124,20 @@ public void onBlockInteract(LWCBlockInteractEvent event) {
Protection protection = null;

if (protectionType.equals("public")) {
protection = physDb.registerProtection(block.getTypeId(), Protection.Type.PUBLIC, worldName, player.getUniqueId().toString(), "", blockX, blockY, blockZ);
protection = physDb.registerProtection(block.getTypeId(), Protection.Type.PUBLIC, worldName, player.getName(), "", blockX, blockY, blockZ);
lwc.sendLocale(player, "protection.interact.create.finalize");
} else if (protectionType.equals("password")) {
String password = lwc.encrypt(protectionData);

protection = physDb.registerProtection(block.getTypeId(), Protection.Type.PASSWORD, worldName, player.getUniqueId().toString(), password, blockX, blockY, blockZ);
protection = physDb.registerProtection(block.getTypeId(), Protection.Type.PASSWORD, worldName, player.getName(), password, blockX, blockY, blockZ);
player.addAccessibleProtection(protection);

lwc.sendLocale(player, "protection.interact.create.finalize");
lwc.sendLocale(player, "protection.interact.create.password");
} else if (protectionType.equals("private") || protectionType.equals("donation")) {
String[] rights = protectionData.split(" ");

protection = physDb.registerProtection(block.getTypeId(), Protection.Type.matchType(protectionType), worldName, player.getUniqueId().toString(), "", blockX, blockY, blockZ);
protection = physDb.registerProtection(block.getTypeId(), Protection.Type.matchType(protectionType), worldName, player.getName(), "", blockX, blockY, blockZ);

lwc.sendLocale(player, "protection.interact.create.finalize");
lwc.processRightsModifications(player, protection, rights);
Expand Down

0 comments on commit 880acaf

Please sign in to comment.