Add the trail particle with duration and target

Trail particles fly from where they spawn to a target offset over the
chosen number of ticks, in the entry's colour. The target follows the
body like other offsets when the entry is placed relative to it.
This commit is contained in:
2026-10-26 10:10:17 +01:00
parent 8009098965
commit aef26b5e9f
8 changed files with 58 additions and 16 deletions
@@ -70,6 +70,10 @@ class EntryEditor {
Map.entry(INTERVAL, Material.CLOCK),
Map.entry(TICK_MODE, Material.REPEATER),
Map.entry(PLACEMENT, Material.PLAYER_HEAD),
Map.entry(TRAIL_DURATION, Material.CLOCK),
Map.entry(TRAIL_TARGET_X, Material.LEAD),
Map.entry(TRAIL_TARGET_Y, Material.LEAD),
Map.entry(TRAIL_TARGET_Z, Material.LEAD),
Map.entry(MOVEMENT, Material.LEATHER_BOOTS),
Map.entry(GLIDING, Material.ELYTRA),
Map.entry(GROUND, Material.GRASS_BLOCK),
@@ -119,6 +123,12 @@ class EntryEditor {
} else if (type.usesBlock()) {
inventory.setItem(ROW_DESIGN * 9 + FIRST_SETTING + 2, parameterItem(context, BLOCK));
}
if (type.isTrail()) {
List<Parameter<?>> trail = List.of(TRAIL_DURATION, TRAIL_TARGET_X, TRAIL_TARGET_Y, TRAIL_TARGET_Z);
for (int i = 0; i < trail.size(); i++) {
inventory.setItem(ROW_DESIGN * 9 + FIRST_SETTING + 3 + i, parameterItem(context, trail.get(i)));
}
}
row(inventory, context, ROW_PARTICLE, List.of(COUNT, SPEED, SPREAD_X, SPREAD_Y, SPREAD_Z));
} else {
inventory.setItem(ROW_PARTICLE * 9 + FIRST_SETTING, new SWItem(Material.STRUCTURE_VOID, msg("PARTICLE_FIXED_LOOK", player), clickType -> {