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
@ -228,13 +228,10 @@ public class GameRule<V> {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
Constructor constructor = clss.getConstructor(DungeonsAPI.class);
|
Constructor constructor = clss.getConstructor(DungeonsAPI.class);
|
||||||
if (constructor == null) {
|
|
||||||
constructor = clss.getConstructor();
|
|
||||||
if (constructor == null) {
|
if (constructor == null) {
|
||||||
MessageUtil.log(api, "&4Requirement \"" + key + "\" is not implemented properly with a (DungeonsAPI) constructor.");
|
MessageUtil.log(api, "&4Requirement \"" + key + "\" is not implemented properly with a (DungeonsAPI) constructor.");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
Requirement requirement = (Requirement) constructor.newInstance(api);
|
Requirement requirement = (Requirement) constructor.newInstance(api);
|
||||||
requirement.setup(section);
|
requirement.setup(section);
|
||||||
requirements.add(requirement);
|
requirements.add(requirement);
|
||||||
@ -270,13 +267,10 @@ public class GameRule<V> {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
Constructor constructor = clss.getConstructor(DungeonsAPI.class);
|
Constructor constructor = clss.getConstructor(DungeonsAPI.class);
|
||||||
if (constructor == null) {
|
|
||||||
constructor = clss.getConstructor();
|
|
||||||
if (constructor == null) {
|
if (constructor == null) {
|
||||||
MessageUtil.log(api, "&4Reward \"" + key + "\" is not implemented properly with a (DungeonsAPI) constructor.");
|
MessageUtil.log(api, "&4Reward \"" + key + "\" is not implemented properly with a (DungeonsAPI) constructor.");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
Reward reward = (Reward) constructor.newInstance(api);
|
Reward reward = (Reward) constructor.newInstance(api);
|
||||||
// reward.setup();
|
// reward.setup();
|
||||||
rewards.add(reward);
|
rewards.add(reward);
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
package de.erethon.dungeonsxl.requirement;
|
package de.erethon.dungeonsxl.requirement;
|
||||||
|
|
||||||
|
import de.erethon.dungeonsxl.api.DungeonsAPI;
|
||||||
import de.erethon.dungeonsxl.api.Requirement;
|
import de.erethon.dungeonsxl.api.Requirement;
|
||||||
import de.erethon.dungeonsxl.config.DMessage;
|
import de.erethon.dungeonsxl.config.DMessage;
|
||||||
import de.erethon.dungeonsxl.player.DPermission;
|
import de.erethon.dungeonsxl.player.DPermission;
|
||||||
@ -34,6 +35,9 @@ public class PermissionRequirement implements Requirement {
|
|||||||
|
|
||||||
private List<String> permissions = new ArrayList<>();
|
private List<String> permissions = new ArrayList<>();
|
||||||
|
|
||||||
|
public PermissionRequirement(DungeonsAPI api) {
|
||||||
|
}
|
||||||
|
|
||||||
/* Getters and setters */
|
/* Getters and setters */
|
||||||
/**
|
/**
|
||||||
* @return the permission the player must have to play the dungeon
|
* @return the permission the player must have to play the dungeon
|
||||||
@ -52,7 +56,7 @@ public class PermissionRequirement implements Requirement {
|
|||||||
/* Actions */
|
/* Actions */
|
||||||
@Override
|
@Override
|
||||||
public void setup(ConfigurationSection config) {
|
public void setup(ConfigurationSection config) {
|
||||||
permissions = config.getStringList("permissions");
|
permissions = config.getStringList("permission");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user