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

Method capBelow

src/minecraft/Position.java:209–225  ·  view source on GitHub ↗
(Position position, Position cap)

Source from the content-addressed store, hash-verified

207 }
208
209 public static Position capBelow(Position position, Position cap) {
210 if (position == null || cap == null) {
211 Loggger.warn("Position null");
212 return null;
213 }
214 Position target = position.copy();
215 if (target.getX() >= cap.getX()) {
216 target.x = cap.x - 1;
217 }
218 if (target.getY() >= cap.getY()) {
219 target.y = cap.y - 1;
220 }
221 if (target.getZ() >= cap.getZ()) {
222 target.z = cap.z - 1;
223 }
224 return target;
225 }
226
227 public int compareTo(Position other) {
228 // TODO

Callers 1

WorldPieceMethod · 0.95

Calls 5

warnMethod · 0.95
getXMethod · 0.95
getYMethod · 0.95
getZMethod · 0.95
copyMethod · 0.45

Tested by

no test coverage detected