Package com.enhancedechest.service
Class ChestTransferService
java.lang.Object
com.enhancedechest.service.ChestTransferService
Moves a player's ender chests onto another account (
/ee transfer) for the "I switched account"
case. Only NORMAL chests are transferred (TEMP overflow is transient; PERM chests are re-granted by the
destination's own permissions), and the transfer is a move: the destination ends up with exactly
the source's chests and the source's copies are removed, so no items are ever duplicated.
The actual row swap is a single transaction in EnderChestStorage.transferChests(java.util.UUID, java.util.UUID, java.lang.Integer, java.util.Set<java.lang.Integer>, long); this class
is the orchestration on top of it: it resolves the target, decides whether a conflict flag is required,
force-closes every open chest of both players (flushing live edits), and serialises the transaction
through ChestSessionManager.runExclusiveAcross(java.util.List<com.enhancedechest.service.ChestSessionManager.ChestRef>, java.util.function.Supplier<T>) so it is dupe-safe even if a chest was open.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhat to do when the destination already holds items in chests this transfer would replace. -
Constructor Summary
ConstructorsConstructorDescriptionChestTransferService(ChestSessionManager sessions, EnderChestStorage storage, ContainerCodec codec, StorageGateway storageGateway, LanguageManager lang, Scheduler scheduler, DbExecutor db, org.slf4j.Logger logger, Telemetry telemetry, long tempExpiryMillis) -
Method Summary
Modifier and TypeMethodDescriptionvoidsetTempExpiry(long tempExpiryMillis) Re-applies the runtime-tunable temp-chest lifetime after a/ee reload.voidtransfer(org.bukkit.command.CommandSender sender, String fromName, UUID from, String toName, UUID to, String target, ChestTransferService.ConflictPolicy policy) Runs a transfer and reports the outcome tosender.
-
Constructor Details
-
ChestTransferService
public ChestTransferService(ChestSessionManager sessions, EnderChestStorage storage, ContainerCodec codec, StorageGateway storageGateway, LanguageManager lang, Scheduler scheduler, DbExecutor db, org.slf4j.Logger logger, Telemetry telemetry, long tempExpiryMillis)
-
-
Method Details
-
setTempExpiry
public void setTempExpiry(long tempExpiryMillis) Re-applies the runtime-tunable temp-chest lifetime after a/ee reload. -
transfer
public void transfer(org.bukkit.command.CommandSender sender, String fromName, UUID from, String toName, UUID to, String target, ChestTransferService.ConflictPolicy policy) Runs a transfer and reports the outcome tosender.targetisall, a chest index (2or#2) or a custom chest name belonging tofrom.
-