本文整理汇总了Java中net.minecraftforge.fluids.Fluid.getStill方法的典型用法代码示例。如果您正苦于以下问题:Java Fluid.getStill方法的具体用法?Java Fluid.getStill怎么用?Java Fluid.getStill使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.fluids.Fluid
的用法示例。
在下文中一共展示了Fluid.getStill方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getStillFluidSprite
import net.minecraftforge.fluids.Fluid; //导入方法依赖的package包/类
private static TextureAtlasSprite getStillFluidSprite(Minecraft minecraft, Fluid fluid) {
TextureMap textureMapBlocks = minecraft.getTextureMapBlocks();
ResourceLocation fluidStill = fluid.getStill();
TextureAtlasSprite fluidStillSprite = null;
if (fluidStill != null) {
fluidStillSprite = textureMapBlocks.getTextureExtry(fluidStill.toString());
}
if (fluidStillSprite == null) {
fluidStillSprite = textureMapBlocks.getMissingSprite();
}
return fluidStillSprite;
}
示例2: render
import net.minecraftforge.fluids.Fluid; //导入方法依赖的package包/类
@SuppressWarnings("ConstantConditions")
@Override
public void render(TileCauldron te, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
Optional<FluidStack> optional = te.getFluid();
if (optional.isPresent() && optional.get().amount > 0) {
FluidStack fluidStack = optional.get();
Fluid fluid = fluidStack.getFluid();
ResourceLocation location = fluid.getStill();
double level = (double) fluidStack.amount / (Fluid.BUCKET_VOLUME * 2D);
GlStateManager.pushMatrix();
GlStateManager.disableLighting();
GlStateManager.translate(x, y + 0.1 + level, z);
if (fluid == FluidRegistry.WATER || te.hasIngredients()) {
float r = (te.getColorRGB() >>> 16 & 0xFF) / 256.0F;
float g = (te.getColorRGB() >>> 8 & 0xFF) / 256.0F;
float b = (te.getColorRGB() & 0xFF) / 256.0F;
GlStateManager.color(r, g, b);
if (fluid == FluidRegistry.WATER)
location = ResourceLocations.GRAY_WATER;
}
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GlStateManager.disableAlpha();
final float w = 0.125F;
GlStateManager.translate(w, 0, w);
GlStateManager.rotate(90F, 1F, 0F, 0F);
final float s = 0.0460425F;
GlStateManager.scale(s, s, s);
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240F, 240F);
renderWater(location);
GlStateManager.enableAlpha();
GlStateManager.disableBlend();
GlStateManager.enableLighting();
GlStateManager.popMatrix();
}
GlStateManager.pushMatrix();
GlStateManager.translate(x + 0.5, y + 0.2D, z + 0.35);
GlStateManager.rotate(90F, 1F, 0, 0);
ItemStack stack = te.getContainer();
if (!stack.isEmpty()) {
Minecraft mc = Minecraft.getMinecraft();
mc.getRenderItem().renderItem(stack, ItemCameraTransforms.TransformType.GROUND);
}
GlStateManager.popMatrix();
}
示例3: getStillTexture
import net.minecraftforge.fluids.Fluid; //导入方法依赖的package包/类
public static TextureAtlasSprite getStillTexture(Fluid fluid)
{
ResourceLocation tex = fluid.getStill();
return tex == null ? null : Minecraft.getMinecraft().getTextureMapBlocks().getTextureExtry(tex.toString());
}