提供: Minecraft Modding Wiki
この編集を取り消せます。
下記の差分を確認して、本当に取り消していいか検証してください。よろしければ変更を保存して取り消しを完了してください。
最新版 | 編集中の文章 | ||
269行目: | 269行目: | ||
* タンクに投入可能な液体の量をシュミレートして値を返す。 | * タンクに投入可能な液体の量をシュミレートして値を返す。 | ||
*/ | */ | ||
− | + | int put = tile.productTank.fill(fluid2, false); | |
//全量投入可能なときのみ | //全量投入可能なときのみ | ||
275行目: | 275行目: | ||
{ | { | ||
//今度は液体を液体タンクに入れるので、第二引数はtrueにする。 | //今度は液体を液体タンクに入れるので、第二引数はtrueにする。 | ||
− | tile.fill( | + | tile.productTank.fill(fluid2, true); |
//液体容器を空にして、空容器を得るメソッド。 | //液体容器を空にして、空容器を得るメソッド。 | ||
326行目: | 326行目: | ||
* fillの場合と同様に、シュミレートで投入可能量を確かめでから行っても良いと思う。 | * fillの場合と同様に、シュミレートで投入可能量を確かめでから行っても良いと思う。 | ||
*/ | */ | ||
− | tile.drain( | + | tile.productTank.drain(1000, true); |
//プレイヤーに、先に取得した「液体で満たされた容器アイテム」を与える処理 | //プレイヤーに、先に取得した「液体で満たされた容器アイテム」を与える処理 | ||
370行目: | 370行目: | ||
} | } | ||
− | + | /*=== レンダー関係 ===*/ | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
@Override | @Override | ||
534行目: | 516行目: | ||
FluidStack current = this.productTank.getFluid(); | FluidStack current = this.productTank.getFluid(); | ||
FluidStack resourceCopy = resource.copy(); | FluidStack resourceCopy = resource.copy(); | ||
− | if (current != null && current.amount > 0 && | + | if (current != null && current.amount > 0 && current.isFluidEqual(resourceCopy)){ |
return 0; | return 0; | ||
} | } | ||
597行目: | 579行目: | ||
//判定処理の短縮用のemptyフラグ | //判定処理の短縮用のemptyフラグ | ||
public boolean isEmpty() { | public boolean isEmpty() { | ||
− | return (getFluid() == null) | + | return (getFluid() == null) || (getFluid().amount <= 0); |
} | } | ||
826行目: | 808行目: | ||
if (par0Tile.getFluidIcon() != null) | if (par0Tile.getFluidIcon() != null) | ||
{ | { | ||
− | + | GL11.glPushMatrix(); | |
− | |||
GL11.glEnable(GL12.GL_RESCALE_NORMAL); | GL11.glEnable(GL12.GL_RESCALE_NORMAL); | ||
− | + | GL11.glColor4f(2.0F, 2.0F, 2.0F, 1.0F); | |
− | |||
− | GL11.glColor4f(2.0F, 2.0F, 2.0F, | ||
GL11.glTranslatef((float)par1, (float)par2 + 0.5F, (float)par3); | GL11.glTranslatef((float)par1, (float)par2 + 0.5F, (float)par3); | ||
GL11.glScalef(1.0F, -1.0F, -1.0F); | GL11.glScalef(1.0F, -1.0F, -1.0F); | ||
854行目: | 833行目: | ||
GL11.glDisable(GL12.GL_RESCALE_NORMAL); | GL11.glDisable(GL12.GL_RESCALE_NORMAL); | ||
− | |||
GL11.glPopMatrix(); | GL11.glPopMatrix(); | ||
} | } |