Give each particle set a unique id for the db
This commit is contained in:
parent
d424e7d768
commit
2fe8b0d367
|
|
@ -13,17 +13,19 @@ public class ParticleSet {
|
|||
|
||||
private final List<Frame> frames;
|
||||
private final int delay, repeat;
|
||||
private final APartType particlesType;
|
||||
private final APartType aPartType;
|
||||
private final String uniqueId;
|
||||
private int ticksUntilNextFrame;
|
||||
private final boolean shouldRepeat;
|
||||
private final String permission;
|
||||
private final ItemStack itemStack;
|
||||
private int ticksUntilNextFrame;
|
||||
|
||||
public ParticleSet(List<Frame> frames, int delay, int repeat, APartType particlesType, String permission, ItemStack itemStack) {
|
||||
public ParticleSet(List<Frame> frames, int delay, int repeat, APartType aPartType, String uniqueId, String permission, ItemStack itemStack) {
|
||||
this.frames = frames;
|
||||
this.delay = delay;
|
||||
this.repeat = repeat;
|
||||
this.particlesType = particlesType;
|
||||
this.aPartType = aPartType;
|
||||
this.uniqueId = uniqueId;
|
||||
this.shouldRepeat = repeat < 0;
|
||||
this.permission = permission;
|
||||
this.itemStack = itemStack;
|
||||
|
|
@ -40,6 +42,10 @@ public class ParticleSet {
|
|||
frameSpawnerPlayer.runTaskTimerAsynchronously(AltitudeParticles.getInstance(), 0, delay);
|
||||
}
|
||||
|
||||
public APartType getAPartType() {
|
||||
return aPartType;
|
||||
}
|
||||
|
||||
public String getPermission() {
|
||||
return permission;
|
||||
}
|
||||
|
|
|
|||
7
src/main/java/com/alttd/particles/InitParticles.java
Normal file
7
src/main/java/com/alttd/particles/InitParticles.java
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
package com.alttd.particles;
|
||||
|
||||
public class InitParticles {
|
||||
public static void init() {
|
||||
new Test();
|
||||
}
|
||||
}
|
||||
|
|
@ -5,23 +5,36 @@ import com.alttd.objects.Frame;
|
|||
import com.alttd.objects.ParticleSet;
|
||||
import com.alttd.storage.ParticleStorage;
|
||||
import com.destroystokyo.paper.ParticleBuilder;
|
||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Test {
|
||||
|
||||
private static final ItemStack itemStack;
|
||||
|
||||
static {
|
||||
MiniMessage miniMessage = MiniMessage.miniMessage();
|
||||
itemStack = new ItemStack(Material.CHEST);
|
||||
ItemMeta itemMeta = itemStack.getItemMeta();
|
||||
itemMeta.displayName(miniMessage.deserialize("<gold>TestParticles</gold>"));
|
||||
itemMeta.lore(List.of(miniMessage.deserialize("<dark_aqua>A particle to test\nthe functionality of this plugin</dark_aqua>")));
|
||||
itemStack.setItemMeta(itemMeta);
|
||||
}
|
||||
|
||||
public Test() {
|
||||
APartType test = APartType.DEATH;
|
||||
APartType test = APartType.BREAK_PLACE_BLOCK;
|
||||
List<Frame> frameList = new ArrayList<>();
|
||||
//
|
||||
frameList.add(new Frame(frameOne()));
|
||||
//....
|
||||
ParticleSet particleSet = new ParticleSet(frameList, 5, 5, test, "apart.particle.test", new ItemStack(Material.CHEST));
|
||||
ParticleSet particleSet = new ParticleSet(frameList, 5, 5, test, "UNIQUE_NAME_TEST", "apart.particle.test", itemStack);
|
||||
ParticleStorage.addParticleSet(test, particleSet);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user