forked from SteamWar/SteamWar
Every entry gets a Touch setting next to its design, offering the 16 touches the rewards carried, each unlocked by its reward. The reward designs that the builder can now make are removed; only the underwater rain cloud and the medium, hard and advanced egg hunt designs stay. Reward requirements move to Unlocks, shared by touches, wing images and cosy smoke. The trail duration moves to the particle row to make room in the design row.
63 lines
2.1 KiB
Java
63 lines
2.1 KiB
Java
/*
|
|
* 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 <https://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
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<ParameterValues> defaults;
|
|
private final Supplier<ParticleElement> shape;
|
|
|
|
public FixedDesign(String id, Material icon, String nameKey, ParticleRequirement requirement, int points, Consumer<ParameterValues> defaults, Supplier<ParticleElement> 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);
|
|
}
|
|
}
|