Skip to content

Commit 2def072

Browse files
committed
fixed anchors
1 parent 5c079cd commit 2def072

File tree

4 files changed

+4
-13
lines changed

4 files changed

+4
-13
lines changed

TODO.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Bugfixes
3434
[❌] Recreate tutorial world in 1.20.1
3535
[🟡] Fixed camera centering on the tutorial world
3636
[🟡] Mounted piglins don't heal from nether terrain
37-
[] Anchors not saving properly?
37+
[🟡] Anchors not saving properly?
3838

3939
Quality of Life
4040
---------------

src/main/java/com/solegendary/reignofnether/unit/UnitSave.java

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.solegendary.reignofnether.unit;
22

3-
import com.solegendary.reignofnether.resources.Resources;
43
import net.minecraft.core.BlockPos;
54

65
public class UnitSave {

src/main/java/com/solegendary/reignofnether/unit/UnitSaveData.java

+3-10
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,12 @@ public CompoundTag save(CompoundTag tag) {
6464
ListTag list = new ListTag();
6565
this.units.forEach(u -> {
6666
CompoundTag cTag = new CompoundTag();
67-
6867
cTag.putString("name", u.name);
6968
cTag.putString("ownerName", u.ownerName);
7069
cTag.putString("uuid", u.uuid);
71-
if (u instanceof Unit unit && Unit.hasAnchor(unit)) {
72-
cTag.putInt("anchorPosX", u.anchorPos.getX());
73-
cTag.putInt("anchorPosY", u.anchorPos.getY());
74-
cTag.putInt("anchorPosZ", u.anchorPos.getZ());
75-
} else {
76-
cTag.putInt("anchorPosX", 0);
77-
cTag.putInt("anchorPosY", 0);
78-
cTag.putInt("anchorPosZ", 0);
79-
}
70+
cTag.putInt("anchorPosX", u.anchorPos.getX());
71+
cTag.putInt("anchorPosY", u.anchorPos.getY());
72+
cTag.putInt("anchorPosZ", u.anchorPos.getZ());
8073
list.add(cTag);
8174

8275
ReignOfNether.LOGGER.info("UnitSaveData.save: " + u.ownerName + "|" + u.name + "|" + u.uuid);

src/main/java/com/solegendary/reignofnether/unit/interfaces/Unit.java

-1
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ private static void checkAndRetreatToAnchor(Unit unit) {
228228
!le.getOnPos().equals(unit.getAnchor())) {
229229
fullResetBehaviours(unit);
230230
unit.getMoveGoal().setMoveTarget(unit.getAnchor());
231-
System.out.println("retreating!");
232231
}
233232
}
234233

0 commit comments

Comments
 (0)