forked from MoriyaShiine/aylyth
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Significantly improve the experience of dying
Dying in Aylyth no longer brings up the teleportation screen. We now just directly respawn the player in Aylyth, rather than teleport them back from an Overworld respawn. This is how it should have always been
- Loading branch information
Showing
4 changed files
with
30 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
22 changes: 22 additions & 0 deletions
22
src/main/java/moriyashiine/aylyth/mixin/PlayerManagerMixin.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package moriyashiine.aylyth.mixin; | ||
|
||
import com.llamalad7.mixinextras.sugar.Local; | ||
import moriyashiine.aylyth.common.registry.key.ModDimensionKeys; | ||
import net.minecraft.server.PlayerManager; | ||
import net.minecraft.server.network.ServerPlayerEntity; | ||
import net.minecraft.server.world.ServerWorld; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.ModifyVariable; | ||
|
||
@Mixin(PlayerManager.class) | ||
public class PlayerManagerMixin { | ||
|
||
@ModifyVariable(method = "respawnPlayer", at = @At(value = "STORE"), ordinal = 1) | ||
private ServerWorld respawnPlayerInAylyth(ServerWorld serverWorld, @Local(argsOnly = true) ServerPlayerEntity original) { | ||
if (original.getWorld().getRegistryKey() == ModDimensionKeys.AYLYTH) { | ||
return original.getServerWorld(); | ||
} | ||
return serverWorld; | ||
} | ||
} |
This file contains 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