Anvil/Chest Manipulation/ja

From Minecraft Parkour Wiki
Revision as of 10:24, 7 May 2022 by KK kaku (talk | contribs) (Created page with "金床の当たり判定は一定ではなく、代わりに全ての状態(東西南北向き)に共通の当たり判定が1種類あり、金床に視点を合わせる(それ以外の行為は後述)と更新される。通常の金床、少し壊れた金床、かなり壊れた金床の当たり判定は全て共通。")
Other languages:

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

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


By standing next to an anvil/chest, and by looking at another variant, the player can update the collision box in such a way that there are now considered "inside the block". The same trick can be used to artificially extend the length of the anvil/chest, and manage to stand one or two pixels further than intended.


You must be careful not to look back at the original block, as that will reset the collision box to normal.



Top-view comparison of collision boxes


Anvils are a simple 1×0.75 bounding box (16×12 pixels), that can be oriented along the X or Z axis.

Single chests are a simple 0.875×0.875 bounding box (14×14 pixels). The "double chest" variant extends one side by 1 pixel.


In the graphic, darker colors indicate collision areas that are common to all variants : you should stand there in order not to fall during manipulation.

Lighter colors indicate collision areas that are specific to one variant: you should stand there in order to clip inside the block during manipulation.



解説

The BlockAnvil and BlockChest classes define the setBlockBoundsBasedOnState method like so:
/* Simplified code */
</div>

<div lang="en" dir="ltr" class="mw-content-ltr">
/* In BlockAnvil.java */
public void setBlockBoundsBasedOnState(BlockPos pos)
{
    EnumFacing enumfacing = getBlockState(pos).getValue(FACING);
</div>

    <div lang="en" dir="ltr" class="mw-content-ltr">
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);
    }
}
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
/* In 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 //single chest
    {
        this.setBlockBounds(0.0625, 0.0, 0.0625, 0.9375, 0.875, 0.9375);
    }
}


This method is called from these other places (same for 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).


制約

On Singleplayer, the player can usually walk through an anvil or chest once they clip into one.

On Multiplayer, the anticheat will typically prevent the player from walking through an anvil or chest completely.


In 1.9, this mechanic was patched (each variant now has its own collision box).