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:
parent
0140e5f293
commit
cc60244fd0
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -4,18 +4,19 @@ import org.bukkit.Material;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public enum APartType { //TODO add description?
|
||||
HEAD("HEAD", "Head", Material.PLAYER_HEAD, null),
|
||||
TRAIL("TRAIL", "Trail", Material.GOLD_INGOT, null),
|
||||
BREAK_PLACE_BLOCK("BREAK_PLACE_BLOCK", "Break/place block", Material.GRASS_BLOCK, null),
|
||||
DEATH("DEATH", "Death", Material.SKELETON_SKULL, null),
|
||||
ATTACK_CLOSE("ATTACK_CQC", "Attack CQC", Material.DIAMOND_SWORD, null),
|
||||
ATTACK_RANGE("ATTACK_RANGED", "Attack ranged", Material.BOW, null),
|
||||
TELEPORT_ARRIVE("TELEPORT", "Teleport", Material.DRAGON_EGG, null);
|
||||
HEAD("HEAD", "Head", Material.PLAYER_HEAD, null, false),
|
||||
TRAIL("TRAIL", "Trail", Material.GOLD_INGOT, null, false),
|
||||
BREAK_PLACE_BLOCK("BREAK_PLACE_BLOCK", "Break/place block", Material.GRASS_BLOCK, null, true),
|
||||
DEATH("DEATH", "Death", Material.SKELETON_SKULL, null, true),
|
||||
ATTACK("KILL", "Kill", Material.DIAMOND_SWORD, null, true),
|
||||
CLICK_BLOCK("CLICK_BLOCK", "Right click block", Material.DIAMOND_BLOCK, null, true),
|
||||
TELEPORT_ARRIVE("TELEPORT", "Teleport", Material.DRAGON_EGG, null, true);
|
||||
|
||||
private final String name;
|
||||
private final String displayName;
|
||||
private final Material material;
|
||||
private ItemStack itemStack;
|
||||
private final boolean event;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
|
|
@ -37,11 +38,16 @@ public enum APartType { //TODO add description?
|
|||
this.itemStack = itemStack;
|
||||
}
|
||||
|
||||
APartType(String name, String displayName, Material material, ItemStack itemStack) {
|
||||
public boolean hasEvent() {
|
||||
return event;
|
||||
}
|
||||
|
||||
APartType(String name, String displayName, Material material, ItemStack itemStack, boolean event) {
|
||||
this.name = name;
|
||||
this.displayName = displayName;
|
||||
this.material = material;
|
||||
this.itemStack = itemStack;
|
||||
this.event = event;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user