Added GUI's
Added player settings Added commands
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
package com.alttd.objects;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public enum APartType { //TODO add description?
|
||||
HEAD("Head", Material.PLAYER_HEAD, null),
|
||||
TRAIL("Trail", Material.GOLD_INGOT, null),
|
||||
BREAK_PLACE_BLOCK("Break/place block", Material.GRASS_BLOCK, null),
|
||||
DEATH("Death", Material.SKELETON_SKULL, null),
|
||||
ATTACK_CLOSE("Attack CQC", Material.DIAMOND_SWORD, null),
|
||||
ATTACK_RANGE("Attack ranged", Material.BOW, null),
|
||||
TELEPORT_ARRIVE("Teleport", Material.DRAGON_EGG, null);
|
||||
|
||||
private final String name;
|
||||
private final Material material;
|
||||
private ItemStack itemStack;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public Material getMaterial() {
|
||||
return material;
|
||||
}
|
||||
|
||||
public ItemStack getItemStack() {
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
public void setItemStack(ItemStack itemStack) {
|
||||
this.itemStack = itemStack;
|
||||
}
|
||||
|
||||
APartType(String name, Material material, ItemStack itemStack) {
|
||||
this.name = name;
|
||||
this.material = material;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.alttd.objects;
|
||||
|
||||
import com.destroystokyo.paper.ParticleBuilder;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Frame {
|
||||
List<ParticleBuilder> particles;
|
||||
|
||||
public Frame(List<ParticleBuilder> particles) {
|
||||
this.particles = particles;
|
||||
}
|
||||
|
||||
/**
|
||||
* Spawns all particles in a frame (CALL ASYNC)
|
||||
*
|
||||
* @param location Location to spawn particles at
|
||||
*/
|
||||
public void spawn(Location location) {
|
||||
particles.forEach(particleBuilder -> particleBuilder.location(location).spawn());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.alttd.objects;
|
||||
|
||||
import com.alttd.AltitudeParticles;
|
||||
import com.alttd.frameSpawners.FrameSpawnerLocation;
|
||||
import com.alttd.frameSpawners.FrameSpawnerPlayer;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ParticleSet {
|
||||
|
||||
List<Frame> frames;
|
||||
int delay, repeat;
|
||||
APartType particlesType;
|
||||
boolean shouldRepeat;
|
||||
int ticksUntilNextFrame;
|
||||
|
||||
public ParticleSet(List<Frame> frames, int delay, int repeat, APartType particlesType) {
|
||||
this.frames = frames;
|
||||
this.delay = delay;
|
||||
this.repeat = repeat;
|
||||
this.particlesType = particlesType;
|
||||
this.shouldRepeat = repeat < 0;
|
||||
ticksUntilNextFrame = delay;
|
||||
}
|
||||
|
||||
public void run(Location location) {
|
||||
FrameSpawnerLocation frameSpawnerLocation = new FrameSpawnerLocation(repeat, frames, location);
|
||||
frameSpawnerLocation.runTaskTimerAsynchronously(AltitudeParticles.getInstance(), 0, delay);
|
||||
}
|
||||
|
||||
public void run(Player player) {
|
||||
FrameSpawnerPlayer frameSpawnerPlayer = new FrameSpawnerPlayer(repeat, frames, player);
|
||||
frameSpawnerPlayer.runTaskTimerAsynchronously(AltitudeParticles.getInstance(), 0, delay);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user