/* * This file is a part of the SteamWar software. * * Copyright (C) 2026 SteamWar.de-Serverteam * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ package de.steamwar.lobby.particle.design; import de.steamwar.lobby.particle.ParticleElement; import de.steamwar.lobby.particle.ParticleRequirement; import org.bukkit.Material; import java.util.function.Consumer; import java.util.function.Supplier; // A design whose look, including its particles, is fixed; only the entry's conditions, timing and offset apply public class FixedDesign extends ParticleDesign { private final int points; private final Consumer defaults; private final Supplier shape; public FixedDesign(String id, Material icon, String nameKey, ParticleRequirement requirement, int points, Consumer defaults, Supplier shape) { super(id, icon, nameKey, DesignVisibility.REWARD, requirement); this.points = points; this.defaults = defaults; this.shape = shape; } @Override public ParticleElement build(ParameterValues values, ParticleElement particle) { return shape.get(); } @Override public int points(ParameterValues values) { return points; } @Override public boolean usesEntryParticle() { return false; } @Override public void applyDefaults(ParameterValues values) { defaults.accept(values); } }