当前位置: 首页>>代码示例>>Java>>正文


Java Fluid.getStill方法代码示例

本文整理汇总了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;
}
 
开发者ID:LasmGratel,项目名称:FoodCraft-Reloaded,代码行数:13,代码来源:FluidStackRenderer.java

示例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();
}
 
开发者ID:Um-Mitternacht,项目名称:Bewitchment,代码行数:55,代码来源:TileRenderCauldron.java

示例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());
}
 
开发者ID:cubex2,项目名称:customstuff4,代码行数:6,代码来源:RenderHelper.java


注:本文中的net.minecraftforge.fluids.Fluid.getStill方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。