本文整理汇总了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);
}