mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-24 19:45:43 +01:00
Fix permission requirement and API
This commit is contained in:
parent
42cd5a1bf2
commit
2dbceef81a
@ -229,11 +229,8 @@ public class GameRule<V> {
|
||||
try {
|
||||
Constructor constructor = clss.getConstructor(DungeonsAPI.class);
|
||||
if (constructor == null) {
|
||||
constructor = clss.getConstructor();
|
||||
if (constructor == null) {
|
||||
MessageUtil.log(api, "&4Requirement \"" + key + "\" is not implemented properly with a (DungeonsAPI) constructor.");
|
||||
continue;
|
||||
}
|
||||
MessageUtil.log(api, "&4Requirement \"" + key + "\" is not implemented properly with a (DungeonsAPI) constructor.");
|
||||
continue;
|
||||
}
|
||||
Requirement requirement = (Requirement) constructor.newInstance(api);
|
||||
requirement.setup(section);
|
||||
@ -271,11 +268,8 @@ public class GameRule<V> {
|
||||
try {
|
||||
Constructor constructor = clss.getConstructor(DungeonsAPI.class);
|
||||
if (constructor == null) {
|
||||
constructor = clss.getConstructor();
|
||||
if (constructor == null) {
|
||||
MessageUtil.log(api, "&4Reward \"" + key + "\" is not implemented properly with a (DungeonsAPI) constructor.");
|
||||
continue;
|
||||
}
|
||||
MessageUtil.log(api, "&4Reward \"" + key + "\" is not implemented properly with a (DungeonsAPI) constructor.");
|
||||
continue;
|
||||
}
|
||||
Reward reward = (Reward) constructor.newInstance(api);
|
||||
// reward.setup();
|
||||
|
@ -16,6 +16,7 @@
|
||||
*/
|
||||
package de.erethon.dungeonsxl.requirement;
|
||||
|
||||
import de.erethon.dungeonsxl.api.DungeonsAPI;
|
||||
import de.erethon.dungeonsxl.api.Requirement;
|
||||
import de.erethon.dungeonsxl.config.DMessage;
|
||||
import de.erethon.dungeonsxl.player.DPermission;
|
||||
@ -34,6 +35,9 @@ public class PermissionRequirement implements Requirement {
|
||||
|
||||
private List<String> permissions = new ArrayList<>();
|
||||
|
||||
public PermissionRequirement(DungeonsAPI api) {
|
||||
}
|
||||
|
||||
/* Getters and setters */
|
||||
/**
|
||||
* @return the permission the player must have to play the dungeon
|
||||
@ -52,7 +56,7 @@ public class PermissionRequirement implements Requirement {
|
||||
/* Actions */
|
||||
@Override
|
||||
public void setup(ConfigurationSection config) {
|
||||
permissions = config.getStringList("permissions");
|
||||
permissions = config.getStringList("permission");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user