2016-03-01 08:30:03 +11:00
|
|
|
package org.bukkit;
|
|
|
|
|
2018-07-15 10:00:00 +10:00
|
|
|
import com.google.common.base.Preconditions;
|
|
|
|
import org.bukkit.block.data.BlockData;
|
2016-03-01 08:30:03 +11:00
|
|
|
import org.bukkit.inventory.ItemStack;
|
|
|
|
import org.bukkit.material.MaterialData;
|
2019-03-13 17:42:57 +11:00
|
|
|
import org.jetbrains.annotations.NotNull;
|
2016-03-01 08:30:03 +11:00
|
|
|
|
|
|
|
public enum Particle {
|
|
|
|
EXPLOSION_NORMAL,
|
|
|
|
EXPLOSION_LARGE,
|
|
|
|
EXPLOSION_HUGE,
|
|
|
|
FIREWORKS_SPARK,
|
|
|
|
WATER_BUBBLE,
|
|
|
|
WATER_SPLASH,
|
|
|
|
WATER_WAKE,
|
|
|
|
SUSPENDED,
|
|
|
|
SUSPENDED_DEPTH,
|
|
|
|
CRIT,
|
|
|
|
CRIT_MAGIC,
|
|
|
|
SMOKE_NORMAL,
|
|
|
|
SMOKE_LARGE,
|
|
|
|
SPELL,
|
|
|
|
SPELL_INSTANT,
|
|
|
|
SPELL_MOB,
|
|
|
|
SPELL_MOB_AMBIENT,
|
|
|
|
SPELL_WITCH,
|
|
|
|
DRIP_WATER,
|
|
|
|
DRIP_LAVA,
|
|
|
|
VILLAGER_ANGRY,
|
|
|
|
VILLAGER_HAPPY,
|
|
|
|
TOWN_AURA,
|
|
|
|
NOTE,
|
|
|
|
PORTAL,
|
|
|
|
ENCHANTMENT_TABLE,
|
|
|
|
FLAME,
|
|
|
|
LAVA,
|
|
|
|
CLOUD,
|
2018-07-15 10:00:00 +10:00
|
|
|
REDSTONE(DustOptions.class),
|
2016-03-01 08:30:03 +11:00
|
|
|
SNOWBALL,
|
|
|
|
SNOW_SHOVEL,
|
|
|
|
SLIME,
|
|
|
|
HEART,
|
|
|
|
BARRIER,
|
|
|
|
ITEM_CRACK(ItemStack.class),
|
2018-07-15 10:00:00 +10:00
|
|
|
BLOCK_CRACK(BlockData.class),
|
|
|
|
BLOCK_DUST(BlockData.class),
|
2016-03-01 08:30:03 +11:00
|
|
|
WATER_DROP,
|
|
|
|
MOB_APPEARANCE,
|
|
|
|
DRAGON_BREATH,
|
|
|
|
END_ROD,
|
|
|
|
DAMAGE_INDICATOR,
|
2016-06-09 11:43:40 +10:00
|
|
|
SWEEP_ATTACK,
|
2018-07-15 10:00:00 +10:00
|
|
|
FALLING_DUST(BlockData.class),
|
2016-11-17 12:40:59 +11:00
|
|
|
TOTEM,
|
2018-07-15 10:00:00 +10:00
|
|
|
SPIT,
|
|
|
|
SQUID_INK,
|
|
|
|
BUBBLE_POP,
|
|
|
|
CURRENT_DOWN,
|
|
|
|
BUBBLE_COLUMN_UP,
|
|
|
|
NAUTILUS,
|
|
|
|
DOLPHIN,
|
|
|
|
// ----- Legacy Separator -----
|
|
|
|
LEGACY_BLOCK_CRACK(MaterialData.class),
|
|
|
|
LEGACY_BLOCK_DUST(MaterialData.class),
|
|
|
|
LEGACY_FALLING_DUST(MaterialData.class);
|
2016-03-01 08:30:03 +11:00
|
|
|
|
|
|
|
private final Class<?> dataType;
|
|
|
|
|
|
|
|
Particle() {
|
|
|
|
dataType = Void.class;
|
|
|
|
}
|
|
|
|
|
2019-03-13 17:42:57 +11:00
|
|
|
Particle(@NotNull Class<?> data) {
|
2016-03-01 08:30:03 +11:00
|
|
|
dataType = data;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the required data type for the particle
|
|
|
|
* @return the required data type
|
|
|
|
*/
|
2019-03-13 17:42:57 +11:00
|
|
|
@NotNull
|
2016-03-01 08:30:03 +11:00
|
|
|
public Class<?> getDataType() {
|
|
|
|
return dataType;
|
|
|
|
}
|
2018-07-15 10:00:00 +10:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Options which can be applied to redstone dust particles - a particle
|
|
|
|
* color and size.
|
|
|
|
*/
|
|
|
|
public static class DustOptions {
|
|
|
|
|
|
|
|
private final Color color;
|
|
|
|
private final float size;
|
|
|
|
|
2019-03-13 17:42:57 +11:00
|
|
|
public DustOptions(@NotNull Color color, float size) {
|
2018-07-15 10:00:00 +10:00
|
|
|
Preconditions.checkArgument(color != null, "color");
|
|
|
|
this.color = color;
|
|
|
|
this.size = size;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The color of the particles to be displayed.
|
|
|
|
*
|
|
|
|
* @return particle color
|
|
|
|
*/
|
2019-03-13 17:42:57 +11:00
|
|
|
@NotNull
|
2018-07-15 10:00:00 +10:00
|
|
|
public Color getColor() {
|
|
|
|
return color;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Relative size of the particle.
|
|
|
|
*
|
|
|
|
* @return relative particle size
|
|
|
|
*/
|
|
|
|
public float getSize() {
|
|
|
|
return size;
|
|
|
|
}
|
|
|
|
}
|
2016-03-01 08:30:03 +11:00
|
|
|
}
|