Conditionally teleport

This commit is contained in:
SD 2021-01-11 20:00:03 +05:30
parent 5cb73c9774
commit 056910ab1a
No known key found for this signature in database
GPG key ID: E36B57EE08544BC5

View file

@ -22,6 +22,8 @@ public abstract class ServerPlayerEntityMixin extends PlayerEntityMixin {
@Inject(method = "onDeath", at = @At("HEAD"), cancellable = true)
public void checkDeath(DamageSource source, CallbackInfo ci) {
this.doOnDeathStuff(source, ci);
TeleportUtil.teleportRandom(this, ModDimensions.LIMBO_DIMENSION, 384);
if (ci.isCancelled()) {
TeleportUtil.teleportRandom(this, ModDimensions.LIMBO_DIMENSION, 384);
}
}
}