Closed FireML closed 3 months ago
Also, an example of how a third party plugin would register one:
public class WarpRewardType implements RewardType {
@Override
public void doReward(@NotNull Player player, @NotNull String key, @NotNull String value, Location hookLocation) {
Warp warp = Data.getInstance().getWarp(value);
if (warp != null) {
warp.tryVisit(player, true);
}
}
@Override
public @NotNull String getIdentifier() {
return "WARP";
}
@Override
public @NotNull String getAuthor() {
return "FireML";
}
@Override
public @NotNull JavaPlugin getPlugin() {
return Plugin.getInstance();
}
}
new WarpRewardType().register();
Alright, I'll give that a go
I've moved RewardManager, RewardType, Reward, and EMFRewardEvent to the API module.
I've added the following:
Rewards still work correctly:
[10:44:29 INFO]: FireML issued server command: /emf admin competition start 5
[10:44:34 INFO]: Giving 5 of Diamond () to FireML
- "EXP:100"
All reward types work just like they used to as we can see in the console log below: