Skip to content

Commit 411ebd1

Browse files
committed
Fix making undesired changes to input object
1 parent 490027f commit 411ebd1

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/org/prank/MainFrame.java

+8-7
Original file line numberDiff line numberDiff line change
@@ -143,24 +143,25 @@ private void writeWayPoint(Coord coord, String name) {
143143
String fileName = "waypoints/" + wpName + "." + getCurrentDimID() + ".json";
144144

145145
// Translate chunk coords to block coords
146-
coord.x = coord.x * 16 + 8;
147-
coord.z = coord.z * 16 + 8;
146+
int x = coord.x * 16 + 8;
147+
int y = coord.y;
148+
int z = coord.z * 16 + 8;
148149

149150
// Stretch coords if nether dimension due to JourneyMap squeezing
150151
if (getCurrentDimID() == -1)
151152
{
152-
coord.x *= 8;
153-
coord.z *= 8;
153+
x *= 8;
154+
z *= 8;
154155
}
155156

156157
int hash = name.hashCode();
157158
StringBuilder sb = new StringBuilder("{")
158159
.append("\"id\": \"").append(wpName).append("\", ")
159160
.append("\"name\": \"").append(upName).append("\", ")
160161
.append("\"icon\": \"waypoint-normal.png\", ")
161-
.append("\"x\": ").append(coord.x).append(", ")
162-
.append("\"y\": ").append(coord.y).append(", ")
163-
.append("\"z\": ").append(coord.z).append(", ")
162+
.append("\"x\": ").append(x).append(", ")
163+
.append("\"y\": ").append(y).append(", ")
164+
.append("\"z\": ").append(z).append(", ")
164165
.append("\"r\": ").append((hash) & 0xff).append(", ")
165166
.append("\"g\": ").append((hash >> 8) & 0xff).append(", ")
166167
.append("\"b\": ").append((hash >> 16) & 0xff).append(", ")

0 commit comments

Comments
 (0)