mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-25 02:04:44 +02:00
PermissionWrapper WIP
This commit is contained in:
@ -0,0 +1,32 @@
|
||||
package com.gmail.nossr50.datatypes.permissions;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class PermissionWrapper {
|
||||
private String permissionAddress;
|
||||
|
||||
public PermissionWrapper(String permissionAddress) {
|
||||
this.permissionAddress = permissionAddress;
|
||||
}
|
||||
|
||||
public String getPermissionAddress() {
|
||||
return permissionAddress;
|
||||
}
|
||||
|
||||
public void setPermissionAddress(String permissionAddress) {
|
||||
this.permissionAddress = permissionAddress;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (!(o instanceof PermissionWrapper)) return false;
|
||||
PermissionWrapper that = (PermissionWrapper) o;
|
||||
return getPermissionAddress().equals(that.getPermissionAddress());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(getPermissionAddress());
|
||||
}
|
||||
}
|
@ -69,15 +69,15 @@ public class RepairManager extends SkillManager {
|
||||
}
|
||||
|
||||
// Permissions checks on material and item types
|
||||
if (!Permissions.repairMaterialType(player, repairable.getRepairItemMaterialCategory())) {
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.NO_PERMISSION, "mcMMO.NoPermission");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Permissions.repairItemType(player, repairable.getRepairItemType())) {
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.NO_PERMISSION, "mcMMO.NoPermission");
|
||||
return;
|
||||
}
|
||||
// if (!Permissions.repairMaterialType(player, repairable.getRepairItemMaterialCategory())) {
|
||||
// mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.NO_PERMISSION, "mcMMO.NoPermission");
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// if (!Permissions.repairItemType(player, repairable.getRepairItemType())) {
|
||||
// mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.NO_PERMISSION, "mcMMO.NoPermission");
|
||||
// return;
|
||||
// }
|
||||
|
||||
int skillLevel = getSkillLevel();
|
||||
int minimumRepairableLevel = repairable.getMinimumLevel();
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.gmail.nossr50.skills.repair.repairables;
|
||||
|
||||
import com.gmail.nossr50.datatypes.permissions.PermissionWrapper;
|
||||
import com.gmail.nossr50.skills.repair.RepairTransaction;
|
||||
import com.gmail.nossr50.util.nbt.RawNBT;
|
||||
import org.bukkit.Material;
|
||||
@ -13,6 +14,7 @@ public class Repairable {
|
||||
private int baseXP;
|
||||
private RawNBT rawNBT;
|
||||
private int repairCount;
|
||||
private PermissionWrapper permissionWrapper;
|
||||
|
||||
public Repairable(Material itemMaterial, RepairTransaction repairTransaction, int minimumLevel, int repairCount, int baseXP, RawNBT rawNBT) {
|
||||
this(itemMaterial.getKey().getKey(), repairTransaction, minimumLevel, repairCount, baseXP, false, rawNBT);
|
||||
@ -34,6 +36,14 @@ public class Repairable {
|
||||
this.rawNBT = rawNBT;
|
||||
}
|
||||
|
||||
public PermissionWrapper getPermissionWrapper() {
|
||||
return permissionWrapper;
|
||||
}
|
||||
|
||||
public void setPermissionWrapper(PermissionWrapper permissionWrapper) {
|
||||
this.permissionWrapper = permissionWrapper;
|
||||
}
|
||||
|
||||
public RawNBT getRawNBT() {
|
||||
return rawNBT;
|
||||
}
|
||||
|
Reference in New Issue
Block a user