GameTestAssertPosException.java

net.minecraft.gametest.framework.GameTestAssertPosException

信息

  • 全限定名:net.minecraft.gametest.framework.GameTestAssertPosException
  • 类型:public class
  • 包:net.minecraft.gametest.framework
  • 源码路径:src/main/java/net/minecraft/gametest/framework/GameTestAssertPosException.java
  • 起始行号:L7
  • 继承:GameTestAssertException
  • 职责:

    TODO

字段/常量

  • absolutePos

    • 类型: BlockPos
    • 修饰符: private final
    • 源码定位: L8
    • 说明:

      TODO

  • relativePos

    • 类型: BlockPos
    • 修饰符: private final
    • 源码定位: L9
    • 说明:

      TODO

内部类/嵌套类型

构造器

public GameTestAssertPosException(Component baseMessage, BlockPos absolutePos, BlockPos relativePos, int tick) @ L11

  • 构造器名:GameTestAssertPosException
  • 源码定位:L11
  • 修饰符:public

参数:

  • baseMessage: Component
  • absolutePos: BlockPos
  • relativePos: BlockPos
  • tick: int

说明:

TODO

方法

下面的方法块按源码顺序生成。

public Component getDescription() @ L17

  • 方法名:getDescription
  • 源码定位:L17
  • 返回类型:Component
  • 修饰符:public

参数:

说明:

TODO

public Component getMessageToShowAtBlock() @ L32

  • 方法名:getMessageToShowAtBlock
  • 源码定位:L32
  • 返回类型:Component
  • 修饰符:public

参数:

说明:

TODO

public BlockPos getRelativePos() @ L36

  • 方法名:getRelativePos
  • 源码定位:L36
  • 返回类型:BlockPos
  • 修饰符:public

参数:

说明:

TODO

public BlockPos getAbsolutePos() @ L40

  • 方法名:getAbsolutePos
  • 源码定位:L40
  • 返回类型:BlockPos
  • 修饰符:public

参数:

说明:

TODO

代码

public class GameTestAssertPosException extends GameTestAssertException {
    private final BlockPos absolutePos;
    private final BlockPos relativePos;
 
    public GameTestAssertPosException(Component baseMessage, BlockPos absolutePos, BlockPos relativePos, int tick) {
        super(baseMessage, tick);
        this.absolutePos = absolutePos;
        this.relativePos = relativePos;
    }
 
    @Override
    public Component getDescription() {
        return Component.translatable(
            "test.error.position",
            this.message,
            this.absolutePos.getX(),
            this.absolutePos.getY(),
            this.absolutePos.getZ(),
            this.relativePos.getX(),
            this.relativePos.getY(),
            this.relativePos.getZ(),
            this.tick
        );
    }
 
    public Component getMessageToShowAtBlock() {
        return this.message;
    }
 
    public @Nullable BlockPos getRelativePos() {
        return this.relativePos;
    }
 
    public @Nullable BlockPos getAbsolutePos() {
        return this.absolutePos;
    }
}

引用的其他类