mirror of
https://github.com/NLthijs48/AreaShop.git
synced 2024-11-22 10:15:54 +01:00
/as add: fix setting player as landlord when he is an owner of the region
- Fixes #427 - Adds a debug message to check the behavior easily in the future
This commit is contained in:
parent
c7299fa56c
commit
44b1cb0fc8
@ -130,7 +130,7 @@ public class AddCommand extends CommandAreaShop {
|
|||||||
ProtectedRegion region = regionEntry.getValue();
|
ProtectedRegion region = regionEntry.getValue();
|
||||||
// Determine if the player is an owner or member of the region
|
// Determine if the player is an owner or member of the region
|
||||||
boolean isMember = finalPlayer != null && plugin.getWorldGuardHandler().containsMember(region, finalPlayer.getUniqueId());
|
boolean isMember = finalPlayer != null && plugin.getWorldGuardHandler().containsMember(region, finalPlayer.getUniqueId());
|
||||||
boolean isOwner = finalPlayer != null && plugin.getWorldGuardHandler().containsMember(region, finalPlayer.getUniqueId());
|
boolean isOwner = finalPlayer != null && plugin.getWorldGuardHandler().containsOwner(region, finalPlayer.getUniqueId());
|
||||||
String type;
|
String type;
|
||||||
if(isRent) {
|
if(isRent) {
|
||||||
type = "rent";
|
type = "rent";
|
||||||
@ -154,6 +154,16 @@ public class AddCommand extends CommandAreaShop {
|
|||||||
List<UUID> existing = new ArrayList<>();
|
List<UUID> existing = new ArrayList<>();
|
||||||
existing.addAll(plugin.getWorldGuardHandler().getOwners(region).asUniqueIdList());
|
existing.addAll(plugin.getWorldGuardHandler().getOwners(region).asUniqueIdList());
|
||||||
existing.addAll(plugin.getWorldGuardHandler().getMembers(region).asUniqueIdList());
|
existing.addAll(plugin.getWorldGuardHandler().getMembers(region).asUniqueIdList());
|
||||||
|
|
||||||
|
AreaShop.debug("regionAddLandlordStatus:", regionName,
|
||||||
|
"landlord:", landlord,
|
||||||
|
"existing:", existing,
|
||||||
|
"isMember:", isMember,
|
||||||
|
"isOwner:", isOwner,
|
||||||
|
"createPermission:", sender.hasPermission("areashop.create" + type),
|
||||||
|
"ownerPermission:", sender.hasPermission("areashop.create" + type + ".owner"),
|
||||||
|
"memberPermission:", sender.hasPermission("areashop.create" + type + ".member"));
|
||||||
|
|
||||||
if(isRent) {
|
if(isRent) {
|
||||||
RentRegion rent = new RentRegion(regionName, world);
|
RentRegion rent = new RentRegion(regionName, world);
|
||||||
// Set landlord
|
// Set landlord
|
||||||
|
Loading…
Reference in New Issue
Block a user