提供: Minecraft Modding Wiki
この編集を取り消せます。
下記の差分を確認して、本当に取り消していいか検証してください。よろしければ変更を保存して取り消しを完了してください。
最新版 | 編集中の文章 | ||
121行目: | 121行目: | ||
public class SampleContainer extends Container { | public class SampleContainer extends Container { | ||
//座標でGUIを開くか判定するためのもの。 | //座標でGUIを開くか判定するためのもの。 | ||
− | int xCoord, yCoord, | + | int xCoord, yCoord, zCorrd; |
public SampleContainer(int x, int y, int z) { | public SampleContainer(int x, int y, int z) { | ||
this.xCoord = x; | this.xCoord = x; | ||
this.yCoord = y; | this.yCoord = y; | ||
− | this. | + | this.zCorrd = z; |
} | } | ||
131行目: | 131行目: | ||
public boolean canInteractWith(EntityPlayer player) { | public boolean canInteractWith(EntityPlayer player) { | ||
//もし、ブロックとの位置関係でGUI制御したいなら、こちらを使う | //もし、ブロックとの位置関係でGUI制御したいなら、こちらを使う | ||
− | // return player.getDistanceSq(this.xCoord + 0.5D, this.yCoord + 0.5D, this. | + | // return player.getDistanceSq(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCorrd + 0.5D) <= 64D; |
return true; | return true; | ||
} | } |