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

Method capBy

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

Source from the content-addressed store, hash-verified

189 }
190
191 public static Position capBy(Position position, Position cap) {
192 if (position == null || cap == null) {
193 Loggger.warn("Position null");
194 return null;
195 }
196 Position target = position.copy();
197 if (target.getX() > cap.getX()) {
198 target.x = cap.x;
199 }
200 if (target.getY() > cap.getY()) {
201 target.y = cap.y;
202 }
203 if (target.getZ() > cap.getZ()) {
204 target.z = cap.z;
205 }
206 return target;
207 }
208
209 public static Position capBelow(Position position, Position cap) {
210 if (position == null || cap == null) {

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected