當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。