mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 22:56:45 +01:00
Put new permissions to good use
This commit is contained in:
parent
c25ddd0dbc
commit
45fe8c182b
@ -1,7 +1,30 @@
|
|||||||
package com.gmail.nossr50.skills.repair;
|
package com.gmail.nossr50.skills.repair;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.util.Permissions;
|
||||||
|
|
||||||
public enum RepairItemType {
|
public enum RepairItemType {
|
||||||
ARMOR,
|
ARMOR,
|
||||||
TOOL,
|
TOOL,
|
||||||
OTHER
|
OTHER;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the base permissions associated with this RepairItemType.
|
||||||
|
*
|
||||||
|
* @param player The player to check the permissions for
|
||||||
|
* @return true if the player has permissions, false otherwise
|
||||||
|
*/
|
||||||
|
public boolean getPermissions(Player player) {
|
||||||
|
switch (this) {
|
||||||
|
case ARMOR:
|
||||||
|
return Permissions.getInstance().armorRepair(player);
|
||||||
|
case TOOL:
|
||||||
|
return Permissions.getInstance().toolRepair(player);
|
||||||
|
case OTHER:
|
||||||
|
return Permissions.getInstance().otherRepair(player);
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
package com.gmail.nossr50.skills.repair;
|
package com.gmail.nossr50.skills.repair;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.util.Permissions;
|
||||||
|
|
||||||
public enum RepairMaterialType {
|
public enum RepairMaterialType {
|
||||||
STRING,
|
STRING,
|
||||||
LEATHER,
|
LEATHER,
|
||||||
@ -8,5 +12,34 @@ public enum RepairMaterialType {
|
|||||||
IRON,
|
IRON,
|
||||||
GOLD,
|
GOLD,
|
||||||
DIAMOND,
|
DIAMOND,
|
||||||
OTHER
|
OTHER;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the base permissions associated with this RepairMaterialType.
|
||||||
|
*
|
||||||
|
* @param player The player to check the permissions for
|
||||||
|
* @return true if the player has permissions, false otherwise
|
||||||
|
*/
|
||||||
|
public boolean getPermissions(Player player) {
|
||||||
|
switch (this) {
|
||||||
|
case STRING:
|
||||||
|
return Permissions.getInstance().stringRepair(player);
|
||||||
|
case LEATHER:
|
||||||
|
return Permissions.getInstance().leatherRepair(player);
|
||||||
|
case WOOD:
|
||||||
|
return Permissions.getInstance().woodRepair(player);
|
||||||
|
case STONE:
|
||||||
|
return Permissions.getInstance().stoneRepair(player);
|
||||||
|
case IRON:
|
||||||
|
return Permissions.getInstance().ironRepair(player);
|
||||||
|
case GOLD:
|
||||||
|
return Permissions.getInstance().goldRepair(player);
|
||||||
|
case DIAMOND:
|
||||||
|
return Permissions.getInstance().diamondRepair(player);
|
||||||
|
case OTHER:
|
||||||
|
return Permissions.getInstance().otherMaterialRepair(player);
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user