forked from SteamWar/SteamWar
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user