Fixed wrong custom spawn point

This commit is contained in:
paulevsGitch 2021-08-10 13:41:06 +03:00
parent bfbaebe7b2
commit 57191936dc
4 changed files with 28 additions and 17 deletions

View file

@ -74,6 +74,11 @@ public abstract class ServerPlayerMixin extends Player implements TeleportingEnt
getXRot()
));
}
else if (GeneratorOptions.changeSpawn() && destination.dimension() == Level.END) {
BlockPos spawn = GeneratorOptions.getSpawn();
Vec3 pos = new Vec3(spawn.getX() + 0.5, spawn.getY(), spawn.getZ() + 0.5);
info.setReturnValue(new PortalInfo(pos, Vec3.ZERO, 90.0F, 0.0F));
}
}
@Inject(method = "changeDimension", at = @At("HEAD"), cancellable = true)