feat: duels player colors + elytra sub-modes (M-level)
- Add ParkourGenerator.selectBlockData() hook (forced course material); BlockSelector checks it first; SingleDuelsGenerator overrides to use the player's color (16 concrete colors) and forces only DEFAULT block type - Elytra sub-modes: SpeedDemonGenerator (max-speed score), MinSpeedGenerator (min-speed check, reset on 6 slow ticks), TimeTrialGenerator (score cap), CloseGenerator (FLAT rings); + SpeedDemon/MinSpeed/TimeTrial/Close modes, registration, locales play.elytra.*, config mode-settings.* - Config.getDouble(path, default) + ConfigAccessor overload - checkstyle 0/0, PMD 0, build green
This commit is contained in:
parent
acb884b70b
commit
5707cf2d24
21 changed files with 496 additions and 27 deletions
|
|
@ -33,6 +33,23 @@ public class SingleDuelsGenerator extends ParkourGenerator {
|
|||
|
||||
public SingleDuelsGenerator(@NotNull Session session) {
|
||||
super(session);
|
||||
forceDefaultBlocks();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset(boolean regenerate) {
|
||||
super.reset(regenerate);
|
||||
forceDefaultBlocks();
|
||||
}
|
||||
|
||||
/**
|
||||
* Duels courses use only plain (non-special, non-schematic) blocks so the
|
||||
* player's color is the only material on the course.
|
||||
*/
|
||||
private void forceDefaultBlocks() {
|
||||
state.defaultChances.clear();
|
||||
state.defaultChances.put(BlockGenerationType.DEFAULT, 1.0);
|
||||
state.specialChances.clear();
|
||||
}
|
||||
|
||||
public void setOwnedPlayer(@NotNull ParkourPlayer pp) {
|
||||
|
|
@ -43,6 +60,11 @@ public class SingleDuelsGenerator extends ParkourGenerator {
|
|||
this.blockData = COLORS.get(index % COLORS.size()).createBlockData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull BlockData selectBlockData() {
|
||||
return blockData == null ? Material.STONE.createBlockData() : blockData;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public List<ParkourPlayer> getPlayers() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue