File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ func (t ticker) tick(tx *Tx) {
4040 w := tx .World ()
4141
4242 w .set .Lock ()
43- if s := w .set .Spawn ; s [1 ] > tx .Range ()[1 ] {
43+ if s := w .set .Spawn ; s [1 ] > tx .Range ()[1 ] && w . Dimension () == Overworld {
4444 // Vanilla will set the spawn position's Y value to max to indicate that
4545 // the player should spawn at the highest position in the world.
4646 w .set .Spawn [1 ] = w .highestObstructingBlock (s [0 ], s [2 ]) + 1
Original file line number Diff line number Diff line change @@ -779,6 +779,13 @@ func (w *World) Spawn() cube.Pos {
779779 if w == nil {
780780 return cube.Pos {}
781781 }
782+
783+ if w .Dimension () == End {
784+ return cube.Pos {100 , 50 }
785+ } else if w .Dimension () == Nether {
786+ return cube.Pos {}
787+ }
788+
782789 w .set .Lock ()
783790 defer w .set .Unlock ()
784791 return w .set .Spawn
@@ -790,6 +797,12 @@ func (w *World) SetSpawn(pos cube.Pos) {
790797 if w == nil {
791798 return
792799 }
800+
801+ // nether has no spawn point and end spawn point is always 100 50 0.
802+ if w .Dimension () == Nether || w .Dimension () == End {
803+ return
804+ }
805+
793806 w .set .Lock ()
794807 w .set .Spawn = pos
795808 w .set .Unlock ()
You can’t perform that action at this time.
0 commit comments