Added a way to check if an APartType has an event

Activate APartType without event when activated in the gui
This commit is contained in:
2022-01-13 23:16:57 +01:00
parent 0140e5f293
commit cc60244fd0
2 changed files with 17 additions and 8 deletions
@@ -2,6 +2,7 @@ package com.alttd.gui.actions;
import com.alttd.database.Queries;
import com.alttd.gui.GUIAction;
import com.alttd.objects.APartType;
import com.alttd.objects.ParticleSet;
import com.alttd.storage.PlayerSettings;
import org.bukkit.enchantments.Enchantment;
@@ -38,6 +39,8 @@ public class ActivateParticleSet implements GUIAction {
playerSettings.addParticle(particleSet.getAPartType(), particleSet);
else
playerSettings.removeParticle(particleSet.getAPartType());
if (enable && !particleSet.getAPartType().hasEvent())
particleSet.run(player, playerSettings);
}
private boolean updateItem(@NotNull ItemStack itemStack, Player player) {