Fix twerk options (other single option) not appearing unless chance is greater than 0 (enabled) (#76)

This commit is contained in:
JustDoom authored and GitHub committed 2024-06-26 10:22:16 +02:00
1 parent 32038c9aca
commit 82cbc90a57
1 file changed
+8 -7
@@ -21,19 +21,20 @@ public class StopDropNRollModule implements PurpurExtrasModule, Listener {
private double chance;
private double amount;
protected StopDropNRollModule() {}
@Override
public void enable() {
PurpurExtras plugin = PurpurExtras.getInstance();
plugin.getServer().getPluginManager().registerEvents(this, plugin);
protected StopDropNRollModule() {
chance = PurpurExtras.getPurpurConfig().getDouble("settings.twerk-to-reduce-burn-time.chance", 0);
amount = PurpurExtras.getPurpurConfig().getDouble("settings.twerk-to-reduce-burn-time.amount", 0.5);
}
@Override
public void enable() {
PurpurExtras plugin = PurpurExtras.getInstance();
plugin.getServer().getPluginManager().registerEvents(this, plugin);
}
@Override
public boolean shouldEnable() {
return PurpurExtras.getPurpurConfig().getDouble("settings.twerk-to-reduce-burn-time.chance", 0) != 0;
return chance != 0;
}
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)