Anvil/Chest Manipulation/ja: Difference between revisions

From Minecraft Parkour Wiki
Content added Content deleted
(Created page with "== 解説 ==")
No edit summary
 
(17 intermediate revisions by the same user not shown)
Line 1: Line 1:
<languages/>
<languages/>
金床の当たり判定は一定ではなく、代わりに全ての状態(東西南北向き)に共通の当たり判定が1種類あり、金床に視点を合わせる(それ以外の行為は後述)と更新される。通常の金床、少し壊れた金床、かなり壊れた金床の当たり判定は全て共通。
<div lang="en" dir="ltr" class="mw-content-ltr">
Anvils don't have a fixed collision box. Instead there is a single collision box for all variants (North, East, South, West), which is updated whenever the player looks at one (or by doing other actions which are listed later). Normal anvils, slightly damaged anvils, and very damaged anvils are not independent.
</div>


チェストにも同様の特性があるが、当たり判定が変化するのはラージチェストのみ。チェストとトラップチェストの当たり判定はそれぞれ独立している。
<div lang="en" dir="ltr" class="mw-content-ltr">
Chests behave in the same way, though only Double Chests have a different collision box. Chests and Trapped Chests are independent.
</div>




金床/チェストの真横に立ち、それと別状態の金床/チェストを見ることで、当たり判定を更新してブロック内に「めり込む」ことができる。同じ手法で、金床/チェストの長さを人為的に延長し、想定されているよりも1/2ドット先に立つことができる。
<div lang="en" dir="ltr" class="mw-content-ltr">
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.
</div>




元のブロックを見てしまうと当たり判定が通常に戻ってしまうので注意が必要。
<div lang="en" dir="ltr" class="mw-content-ltr">
You must be careful not to look back at the original block, as that will reset the collision box to normal.
</div>




Line 24: Line 16:




== 上から見た当たり判定の比較 ==
<div lang="en" dir="ltr" class="mw-content-ltr">
== Top-view comparison of collision boxes ==
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
[[File:Anvil-Chest collision box.png|frameless|756x756px]]
[[File:Anvil-Chest collision box.png|frameless|756x756px]]
</div>




金床のバウンディングボックスはシンプルな1×0.75(16×12ドット)で、X/Z方向に回転できる。
<div lang="en" dir="ltr" class="mw-content-ltr">
Anvils are a simple 1×0.75 bounding box (16×12 pixels), that can be oriented along the X or Z axis.
</div>


単体のチェストのバウンディングボックスはシンプルな0.875×0.875(14×14ドット)。「ラージチェスト」では片側が1ドット長い。
<div lang="en" dir="ltr" class="mw-content-ltr">
Single chests are a simple 0.875×0.875 bounding box (14×14 pixels). The "double chest" variant extends one side by 1 pixel.
</div>




図の暗い部分は全ての状態に共通の当たり判定を指す: you should stand there in order not to fall during manipulation.
<div lang="en" dir="ltr" class="mw-content-ltr">
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.
</div>


明るい部分は特定の状態に固有の当たり判定を指す: you should stand there in order to clip inside the block during manipulation.
<div lang="en" dir="ltr" class="mw-content-ltr">
Lighter colors indicate collision areas that are specific to one variant: you should stand there in order to clip inside the block during manipulation.
</div>




Line 55: Line 35:
== 解説 ==
== 解説 ==


BlockAnvilクラスとBlockChestクラスはsetBlockBoundsBasedOnStateメソッドを次のように定義している:<syntaxhighlight lang="java">
<div lang="en" dir="ltr" class="mw-content-ltr">
/* 簡略化されたソースコード */
The BlockAnvil and BlockChest classes define the setBlockBoundsBasedOnState method like so:<syntaxhighlight lang="java">
/* Simplified code */
</div>


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


if (enumfacing.getAxis() == EnumFacing.Axis.X)
<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);
this.setBlockBounds(0.0, 0.0, 0.125, 1.0, 1.0, 0.875);
Line 77: Line 52:
}
}
}
}
</div>




/* BlockChest.java */
<div lang="en" dir="ltr" class="mw-content-ltr">
/* In BlockChest.java */
public void setBlockBoundsBasedOnState(BlockPos pos)
public void setBlockBoundsBasedOnState(BlockPos pos)
{
{
Line 100: Line 73:
this.setBlockBounds(0.0625, 0.0, 0.0625, 1.0, 0.875, 0.9375);
this.setBlockBounds(0.0625, 0.0, 0.0625, 1.0, 0.875, 0.9375);
}
}
else //single chest
else //単体チェスト
{
{
this.setBlockBounds(0.0625, 0.0, 0.0625, 0.9375, 0.875, 0.9375);
this.setBlockBounds(0.0625, 0.0, 0.0625, 0.9375, 0.875, 0.9375);
Line 106: Line 79:
}
}
</syntaxhighlight>
</syntaxhighlight>
</div>






このメソッドはこれらの別の場所から呼び出される(BlockChestも同じ):
<div lang="en" dir="ltr" class="mw-content-ltr">
This method is called from these other places (same for BlockChest):
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
[[File:BlockAnvil setBlockBoundsBasedOnState.png|frameless|704x704px]]
[[File:BlockAnvil setBlockBoundsBasedOnState.png|frameless|704x704px]]
</div>




Line 133: Line 101:




== 制約 ==
<div lang="en" dir="ltr" class="mw-content-ltr">
== Limitations ==
</div>


シングルプレイヤーでは、チェスト/金床にめり込んでしまえば通常は通り抜けられる。
<div lang="en" dir="ltr" class="mw-content-ltr">
On Singleplayer, the player can usually walk through an anvil or chest once they clip into one.
</div>


マルチプレイヤーでは、通常はアンチチートの影響で完全に通り抜けることはできない。
<div lang="en" dir="ltr" class="mw-content-ltr">
On Multiplayer, the anticheat will typically prevent the player from walking through an anvil or chest completely.
</div>




1.9でこの仕組みは修正された(それぞれの状態が独自の当たり判定を持つようになった)。
<div lang="en" dir="ltr" class="mw-content-ltr">
In 1.9, this mechanic was patched (each variant now has its own collision box).
</div>

Latest revision as of 12:07, 3 June 2022

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でこの仕組みは修正された(それぞれの状態が独自の当たり判定を持つようになった)。