minecraft-src/net/minecraft/gametest/framework/GameTestAssertPosException.java
2025-07-04 01:41:11 +03:00

48 lines
1.1 KiB
Java

package net.minecraft.gametest.framework;
import net.minecraft.core.BlockPos;
import org.jetbrains.annotations.Nullable;
public class GameTestAssertPosException extends GameTestAssertException {
private final BlockPos absolutePos;
private final BlockPos relativePos;
private final long tick;
public GameTestAssertPosException(String exceptionMessage, BlockPos absolutePos, BlockPos relativePos, long tick) {
super(exceptionMessage);
this.absolutePos = absolutePos;
this.relativePos = relativePos;
this.tick = tick;
}
public String getMessage() {
String string = this.absolutePos.getX()
+ ","
+ this.absolutePos.getY()
+ ","
+ this.absolutePos.getZ()
+ " (relative: "
+ this.relativePos.getX()
+ ","
+ this.relativePos.getY()
+ ","
+ this.relativePos.getZ()
+ ")";
return super.getMessage() + " at " + string + " (t=" + this.tick + ")";
}
@Nullable
public String getMessageToShowAtBlock() {
return super.getMessage();
}
@Nullable
public BlockPos getRelativePos() {
return this.relativePos;
}
@Nullable
public BlockPos getAbsolutePos() {
return this.absolutePos;
}
}