Klasse SoftRestore
java.lang.Object
de.delinkedde.mobarenareborn.protection.SoftRestore
- Alle implementierten Schnittstellen:
Listener
Soft-restore: instead of cancelling block changes inside an arena during a round, the original
block states are captured and rebuilt when the round ends. This lets arenas be destructible
(blow up walls, dig tunnels) while still resetting cleanly. Optionally, container inventories in
the arena region are snapshotted at round start and refilled at round end - so loot chests reset
every round. All opt-in via
protection.soft-restore and protection.reset-containers.-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungSoftRestore(@NotNull MobArenaPlugin plugin, @NotNull ConfigManager config, @NotNull ArenaManager arenas, @NotNull SessionManager sessions) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbooleanvoidonRoundEnd(@NotNull ArenaRoundEndEvent event) Restores captured blocks and container contents when the round ends.voidonRoundStart(@NotNull ArenaRoundStartEvent event) Snapshots container inventories at round start (whenreset-containersis on).booleantryCapture(@NotNull Block block) Tries to capture a block for later restore.
-
Konstruktordetails
-
SoftRestore
public SoftRestore(@NotNull @NotNull MobArenaPlugin plugin, @NotNull @NotNull ConfigManager config, @NotNull @NotNull ArenaManager arenas, @NotNull @NotNull SessionManager sessions) - Parameter:
plugin- the owning pluginconfig- the configuration managerarenas- the arena manager, to resolve the arena a block belongs tosessions- the session manager, to check for a running round
-
-
Methodendetails
-
isEnabled
public boolean isEnabled()- Gibt zurück:
- whether soft-restore is enabled at all
-
tryCapture
Tries to capture a block for later restore. Returnstruewhen the caller should allow the change (soft-restore is on and the block is in a running arena); otherwisefalse(the caller should protect as usual).- Parameter:
block- the block about to change- Gibt zurück:
- whether the change may proceed under soft-restore
-
onRoundStart
Snapshots container inventories at round start (whenreset-containersis on).- Parameter:
event- the round-start event
-
onRoundEnd
Restores captured blocks and container contents when the round ends.- Parameter:
event- the round-end event
-