Offer nearly every vanilla particle in the slot builder

Add the remaining particles, including colour, colour transition, block
and item particles, which take their colours or a new block setting from
the entry. Only particles that cover the screen, show only under water or
need a target stay out.
This commit is contained in:
2026-10-26 09:48:36 +01:00
parent 54d30f4a42
commit 6b5441bb04
7 changed files with 296 additions and 45 deletions
@@ -109,8 +109,11 @@ class EntryEditor {
clickType -> Pickers.design(player, design, picked -> changeDesign(context, picked), context::reopen)));
if (design.usesEntryParticle()) {
inventory.setItem(ROW_DESIGN * 9 + 2, parameterItem(context, PARTICLE));
if (entry.getValues().get(PARTICLE).isDust()) {
ParticleType type = entry.getValues().get(PARTICLE);
if (type.usesColors()) {
inventory.setItem(ROW_DESIGN * 9 + 3, parameterItem(context, COLORS));
} else if (type.usesBlock()) {
inventory.setItem(ROW_DESIGN * 9 + 3, parameterItem(context, BLOCK));
}
row(inventory, context, ROW_PARTICLE, List.of(COUNT, SPEED, SPREAD_X, SPREAD_Y, SPREAD_Z));
} else {
@@ -159,6 +162,7 @@ class EntryEditor {
if (parameter instanceof BooleanParameter) icon = (Boolean) value ? Material.LIME_DYE : Material.GRAY_DYE;
if (parameter == PARTICLE) icon = ((ParticleType) value).getIcon();
if (parameter == COLORS) icon = Material.RED_DYE;
if (parameter == BLOCK) icon = (Material) value;
return new SWItem(icon, name(parameter.getNameKey(), player), lore, false, clickType -> {
if (parameter instanceof BooleanParameter toggle) {
@@ -191,6 +195,7 @@ class EntryEditor {
private Material choiceIcon(Object value) {
if (value instanceof ParticleType type) return type.getIcon();
if (value instanceof WingDesign) return Material.PHANTOM_MEMBRANE;
if (value instanceof Material material) return material;
return Material.LEVER;
}