mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-31 21:48:31 +01:00
Small patch to allow multiple firework effects to be defined in kits.
This commit is contained in:
parent
51a55318d0
commit
378eaaaf1f
@ -10,6 +10,7 @@ import org.bukkit.FireworkEffect;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.enchantments.Enchantment;
|
import org.bukkit.enchantments.Enchantment;
|
||||||
|
import org.bukkit.entity.Firework;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.*;
|
import org.bukkit.inventory.meta.*;
|
||||||
|
|
||||||
@ -179,7 +180,6 @@ public class MetaItemStack
|
|||||||
{
|
{
|
||||||
if (stack.getType() == Material.FIREWORK)
|
if (stack.getType() == Material.FIREWORK)
|
||||||
{
|
{
|
||||||
FireworkMeta fmeta = (FireworkMeta)stack.getItemMeta();
|
|
||||||
final String[] split = splitPattern.split(string, 2);
|
final String[] split = splitPattern.split(string, 2);
|
||||||
|
|
||||||
if (split.length < 2)
|
if (split.length < 2)
|
||||||
@ -189,6 +189,15 @@ public class MetaItemStack
|
|||||||
|
|
||||||
if (split[0].equalsIgnoreCase("color") || split[0].equalsIgnoreCase("colour") || (allowShortName && split[0].equalsIgnoreCase("c")))
|
if (split[0].equalsIgnoreCase("color") || split[0].equalsIgnoreCase("colour") || (allowShortName && split[0].equalsIgnoreCase("c")))
|
||||||
{
|
{
|
||||||
|
if (validFirework)
|
||||||
|
{
|
||||||
|
FireworkEffect effect = builder.build();
|
||||||
|
FireworkMeta fmeta = (FireworkMeta)stack.getItemMeta();
|
||||||
|
fmeta.addEffect(effect);
|
||||||
|
stack.setItemMeta(fmeta);
|
||||||
|
builder = FireworkEffect.builder();
|
||||||
|
}
|
||||||
|
|
||||||
List<Color> primaryColors = new ArrayList<Color>();
|
List<Color> primaryColors = new ArrayList<Color>();
|
||||||
String[] colors = split[1].split(",");
|
String[] colors = split[1].split(",");
|
||||||
for (String color : colors)
|
for (String color : colors)
|
||||||
|
@ -237,6 +237,7 @@ kits:
|
|||||||
items:
|
items:
|
||||||
- 401 1 name:Angry_Creeper color:red fade:green type:creeper power:1
|
- 401 1 name:Angry_Creeper color:red fade:green type:creeper power:1
|
||||||
- 401 1 name:StarryNight color:yellow,orange fade:blue type:star effect:trail,twinkle power:1
|
- 401 1 name:StarryNight color:yellow,orange fade:blue type:star effect:trail,twinkle power:1
|
||||||
|
- 401 2 name:SolarWind color:yellow,orange fade:red shape:large effect:twinkle color:yellow,orange fade:red shape:ball effect:trail color:red,purple fade:pink shape:star effect:trail power:1
|
||||||
|
|
||||||
# Essentials Sign Control
|
# Essentials Sign Control
|
||||||
# See http://wiki.ess3.net/wiki/Sign_Tutorial for instructions on how to use these.
|
# See http://wiki.ess3.net/wiki/Sign_Tutorial for instructions on how to use these.
|
||||||
|
Loading…
Reference in New Issue
Block a user