本文整理匯總了Java中net.minecraftforge.fluids.Fluid.getColor方法的典型用法代碼示例。如果您正苦於以下問題:Java Fluid.getColor方法的具體用法?Java Fluid.getColor怎麽用?Java Fluid.getColor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraftforge.fluids.Fluid
的用法示例。
在下文中一共展示了Fluid.getColor方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: drawFluid
import net.minecraftforge.fluids.Fluid; //導入方法依賴的package包/類
private void drawFluid(Minecraft minecraft, final int xPosition, final int yPosition, @Nullable FluidStack fluidStack) {
if (fluidStack == null) {
return;
}
Fluid fluid = fluidStack.getFluid();
if (fluid == null) {
return;
}
TextureAtlasSprite fluidStillSprite = getStillFluidSprite(minecraft, fluid);
int fluidColor = fluid.getColor(fluidStack);
int scaledAmount = (fluidStack.amount * height) / capacityMb;
if (fluidStack.amount > 0 && scaledAmount < MIN_FLUID_HEIGHT) {
scaledAmount = MIN_FLUID_HEIGHT;
}
if (scaledAmount > height) {
scaledAmount = height;
}
drawTiledSprite(minecraft, xPosition, yPosition, width, height, fluidColor, scaledAmount, fluidStillSprite);
}
示例2: onLiquidChange
import net.minecraftforge.fluids.Fluid; //導入方法依賴的package包/類
@SuppressWarnings("ConstantConditions")
@Override
public void onLiquidChange() {
ingredients.clear();
mode = Mode.NORMAL;
ritual = null;
Fluid fluid = inv.getInnerFluid();
if (fluid != null) {
int color = (fluid == FluidRegistry.WATER || fluid.getColor() == 0xFFFFFFFF) ? 0x12193b : fluid.getColor();
setColorRGB(color);
}
if (!world.isRemote)
PacketHandler.updateToNearbyPlayers(world, pos);
}