MCPcopy Create free account
hub / github.com/Garten/sourcecraft / bringInOrder

Method bringInOrder

src/minecraft/Position.java:148–175  ·  view source on GitHub ↗
(Position start, Position end)

Source from the content-addressed store, hash-verified

146
147 // return if order changed
148 public static boolean bringInOrder(Position start, Position end) {
149 if (start == null || end == null) {
150 return false;
151 }
152 boolean change = false;
153 int firstValue = start.getX();
154 int secondValue = end.getX();
155 if (firstValue > secondValue) {
156 start.setX(secondValue);
157 end.setX(firstValue);
158 change = true;
159 }
160 firstValue = start.getY();
161 secondValue = end.getY();
162 if (firstValue > secondValue) {
163 start.setY(secondValue);
164 end.setY(firstValue);
165 change = true;
166 }
167 firstValue = start.getZ();
168 secondValue = end.getZ();
169 if (firstValue > secondValue) {
170 start.setZ(secondValue);
171 end.setZ(firstValue);
172 change = true;
173 }
174 return change;
175 }
176
177 public static void addTo(Position writeTarget, Position diff) {
178 writeTarget.x += diff.x;

Callers 2

correctCoordinatesMethod · 0.95
convertPositionsMethod · 0.95

Calls 6

setXMethod · 0.80
getYMethod · 0.80
setYMethod · 0.80
setZMethod · 0.80
getXMethod · 0.45
getZMethod · 0.45

Tested by

no test coverage detected