use of com.laytonsmith.abstraction.enums.MCFireworkType in project CommandHelper by EngineHub.
the class ObjectGenerator method fireworkEffect.
public CArray fireworkEffect(MCFireworkEffect mcfe, Target t) {
CArray fe = CArray.GetAssociativeArray(t);
fe.set("flicker", CBoolean.get(mcfe.hasFlicker()), t);
fe.set("trail", CBoolean.get(mcfe.hasTrail()), t);
MCFireworkType type = mcfe.getType();
if (type != null) {
fe.set("type", new CString(mcfe.getType().name(), t), t);
} else {
fe.set("type", CNull.NULL, t);
}
CArray colors = new CArray(t);
for (MCColor c : mcfe.getColors()) {
colors.push(ObjectGenerator.GetGenerator().color(c, t), t);
}
fe.set("colors", colors, t);
CArray fadeColors = new CArray(t);
for (MCColor c : mcfe.getFadeColors()) {
fadeColors.push(ObjectGenerator.GetGenerator().color(c, t), t);
}
fe.set("fade", fadeColors, t);
return fe;
}
Aggregations