Anvil/Chest Manipulation/ja

From Minecraft Parkour Wiki
This page is a translated version of the page Anvil/Chest Manipulation and the translation is 88% complete.
Other languages:

金床の当たり判定は一定ではなく、代わりに全ての状態(東西南北向き)に共通の当たり判定が1種類あり、金床に視点を合わせる(それ以外の行為は後述)と更新される。通常の金床、少し壊れた金床、かなり壊れた金床の当たり判定は全て共通。

チェストにも同様の特性があるが、当たり判定が変化するのはラージチェストのみ。チェストとトラップチェストの当たり判定はそれぞれ独立している。


金床/チェストの真横に立ち、それと別状態の金床/チェストを見ることで、当たり判定を更新してブロック内に「めり込む」ことができる。同じ手法で、金床/チェストの長さを人為的に延長し、想定されているよりも1/2ドット先に立つことができる。


元のブロックを見てしまうと当たり判定が通常に戻ってしまうので注意が必要。



上から見た当たり判定の比較


金床のバウンディングボックスはシンプルな1×0.75(16×12ドット)で、X/Z方向に回転できる。

単体のチェストのバウンディングボックスはシンプルな0.875×0.875(14×14ドット)。「ラージチェスト」では片側が1ドット長い。


図の暗い部分は全ての状態に共通の当たり判定を指す: you should stand there in order not to fall during manipulation.

明るい部分は特定の状態に固有の当たり判定を指す: you should stand there in order to clip inside the block during manipulation.



解説

BlockAnvilクラスとBlockChestクラスはsetBlockBoundsBasedOnStateメソッドを次のように定義している:

/* 簡略化されたソースコード */

/* BlockAnvil.java内 */
public void setBlockBoundsBasedOnState(BlockPos pos)
{
    EnumFacing enumfacing = getBlockState(pos).getValue(FACING);

    if (enumfacing.getAxis() == EnumFacing.Axis.X)
    {
        this.setBlockBounds(0.0, 0.0, 0.125, 1.0, 1.0, 0.875);
    }
    else
    {
        this.setBlockBounds(0.125, 0.0, 0.0, 0.875, 1.0, 1.0);
    }
}


/* BlockChest.java内 */
public void setBlockBoundsBasedOnState(BlockPos pos)
{
    if (getBlockState(pos.north()).getBlock() == this)
    {
        this.setBlockBounds(0.0625, 0.0, 0.0, 0.9375, 0.875, 0.9375);
    }
    else if (getBlockState(pos.south()).getBlock() == this)
    {
        this.setBlockBounds(0.0625, 0.0, 0.0625, 0.9375, 0.875, 1.0);
    }
    else if (getBlockState(pos.west()).getBlock() == this)
    {
        this.setBlockBounds(0.0, 0.0, 0.0625, 0.9375, 0.875, 0.9375);
    }
    else if (getBlockState(pos.east()).getBlock() == this)
    {
        this.setBlockBounds(0.0625, 0.0, 0.0625, 1.0, 0.875, 0.9375);
    }
    else //単体チェスト
    {
        this.setBlockBounds(0.0625, 0.0, 0.0625, 0.9375, 0.875, 0.9375);
    }
}


このメソッドはこれらの別の場所から呼び出される(BlockChestも同じ):


Notably, the following actions can be used for manipulation:

  • Simply looking at the block (without necessarily drawing its selection box)
  • Shooting an arrow at the block (has a persistent effect).
  • Causing the block to re-render, which can be done by updating the surroundings.
  • Using rain to update the block (randomly).


制約

シングルプレイヤーでは、チェスト/金床にめり込んでしまえば通常は通り抜けられる。

マルチプレイヤーでは、通常はアンチチートの影響で完全に通り抜けることはできない。


1.9でこの仕組みは修正された(それぞれの状態が独自の当たり判定を持つようになった)。