Repository navigation
Allow /is restart only in the skyworld - #245
Merged
Merged
Conversation
A restart started outside the skyworld cleared nothing up front: the inventory clear waited until the new island was generated. In that gap a player could get into the skyworld (/is spawn, or a delayed teleport started before confirming) and log out, and keep their old inventory, armour and ender chest on the fresh island next to the new starter items. Restart now refuses outside the skyworld, like challenge hand-in does, so the existing immediate clear always runs. The skyworld nether is refused too, because the immediate clear only runs in the skyworld.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A restart started outside the skyworld clears nothing up front.
restartPlayerIslandonly clears the inventory right away when the player is in the skyworld; otherwise the clear waits untilGenerateTaskhas built the new island. In that gap a player can get into the skyworld (/is spawnhas no "island is generating" guard, and a delayed/is home//is warpteleport started before confirming fires without re-checking) and log out. They keep their old inventory, armour and ender chest on the fresh island, next to the new starter items.Fix
/is restartnow refuses outside the skyworld with "You can only restart your island in the skyblock world!", the same pattern as challenge hand-in. The existing immediate clear therefore always runs. The skyworld nether is refused too, because the immediate clear only runs in the skyworld itself.The island menu is unchanged: outside the skyworld the restart menu still opens, and clicking a scheme gets the new message from the command.
German text added by hand in
de.po; the other languages show the English text until they are translated.Not in this PR: the
/is acceptordering between the async challenge-permission grant and the deferred clear when accepting from another world. Impact is low (default and Asylum rewards are onlyusb.biome.*) and the fix touchesPlayerInfo.onTeleport/clearPermssemantics, so it is left for the 4.0 rework.How tested
RestartCommandTest.refusesRestartOutsideTheSkyWorld: outside the skyworld, one error message, no confirm, no cooldown reset, noRestartIslandEvent. The existing test now stubs the player as in the skyworld.keys.player_facing.potupdated by hand (sorted position); CI's template drift check confirms it../gradlew buildpasses locally (JDK 21), includingRestartCommandTest(2/2).