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


Java FoodStats.getPrevFoodLevel方法代码示例

本文整理汇总了Java中net.minecraft.util.FoodStats.getPrevFoodLevel方法的典型用法代码示例。如果您正苦于以下问题:Java FoodStats.getPrevFoodLevel方法的具体用法?Java FoodStats.getPrevFoodLevel怎么用?Java FoodStats.getPrevFoodLevel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.util.FoodStats的用法示例。


在下文中一共展示了FoodStats.getPrevFoodLevel方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: renderFood

import net.minecraft.util.FoodStats; //导入方法依赖的package包/类
public void renderFood(int width, int height)
{
    if (pre(FOOD)) return;
    mc.mcProfiler.startSection("food");

    GL11.glEnable(GL11.GL_BLEND);
    int left = width / 2 + 91;
    int top = height - right_height;
    right_height += 10;
    boolean unused = false;// Unused flag in vanilla, seems to be part of a 'fade out' mechanic

    FoodStats stats = mc.thePlayer.getFoodStats();
    int level = stats.getFoodLevel();
    int levelLast = stats.getPrevFoodLevel();

    for (int i = 0; i < 10; ++i)
    {
        int idx = i * 2 + 1;
        int x = left - i * 8 - 9;
        int y = top;
        int icon = 16;
        byte backgound = 0;

        if (mc.thePlayer.isPotionActive(Potion.hunger))
        {
            icon += 36;
            backgound = 13;
        }
        if (unused) backgound = 1; //Probably should be a += 1 but vanilla never uses this

        if (mc.thePlayer.getFoodStats().getSaturationLevel() <= 0.0F && updateCounter % (level * 3 + 1) == 0)
        {
            y = top + (rand.nextInt(3) - 1);
        }

        drawTexturedModalRect(x, y, 16 + backgound * 9, 27, 9, 9);

        if (unused)
        {
            if (idx < levelLast)
                drawTexturedModalRect(x, y, icon + 54, 27, 9, 9);
            else if (idx == levelLast)
                drawTexturedModalRect(x, y, icon + 63, 27, 9, 9);
        }

        if (idx < level)
            drawTexturedModalRect(x, y, icon + 36, 27, 9, 9);
        else if (idx == level)
            drawTexturedModalRect(x, y, icon + 45, 27, 9, 9);
    }
    GL11.glDisable(GL11.GL_BLEND);
    mc.mcProfiler.endSection();
    post(FOOD);
}
 
开发者ID:alexandrage,项目名称:CauldronGit,代码行数:55,代码来源:GuiIngameForge.java

示例2: renderFood

import net.minecraft.util.FoodStats; //导入方法依赖的package包/类
public void renderFood(int width, int height)
{
    if (pre(FOOD)) return;
    mc.mcProfiler.startSection("food");

    int left = width / 2 + 91;
    int top = height - right_height;
    right_height += 10;
    boolean unused = false;// Unused flag in vanilla, seems to be part of a 'fade out' mechanic

    FoodStats stats = mc.thePlayer.getFoodStats();
    int level = stats.getFoodLevel();
    int levelLast = stats.getPrevFoodLevel();

    for (int i = 0; i < 10; ++i)
    {
        int idx = i * 2 + 1;
        int x = left - i * 8 - 9;
        int y = top;
        int icon = 16;
        byte backgound = 0;

        if (mc.thePlayer.isPotionActive(Potion.hunger))
        {
            icon += 36;
            backgound = 13;
        }
        if (unused) backgound = 1; //Probably should be a += 1 but vanilla never uses this

        if (mc.thePlayer.getFoodStats().getSaturationLevel() <= 0.0F && updateCounter % (level * 3 + 1) == 0)
        {
            y = top + (rand.nextInt(3) - 1);
        }

        drawTexturedModalRect(x, y, 16 + backgound * 9, 27, 9, 9);

        if (unused)
        {
            if (idx < levelLast)
                drawTexturedModalRect(x, y, icon + 54, 27, 9, 9);
            else if (idx == levelLast)
                drawTexturedModalRect(x, y, icon + 63, 27, 9, 9);
        }

        if (idx < level)
            drawTexturedModalRect(x, y, icon + 36, 27, 9, 9);
        else if (idx == level)
            drawTexturedModalRect(x, y, icon + 45, 27, 9, 9);
    }
    mc.mcProfiler.endSection();
    post(FOOD);
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:53,代码来源:GuiIngameForge.java

示例3: renderFood

import net.minecraft.util.FoodStats; //导入方法依赖的package包/类
@Override
public void renderFood(int width, int height) {
    if (pre(FOOD)) return;
    mc.mcProfiler.startSection("food");

    int left = width / 2 + 91;
    int top = height - right_height;
    right_height += 10;
    boolean unused = false;// Unused flag in vanilla, seems to be part of a 'fade out' mechanic

    FoodStats stats = mc.thePlayer.getFoodStats();
    int level = stats.getFoodLevel();
    int levelLast = stats.getPrevFoodLevel();

    for (int i = 0; i < 10; ++i)  {
        int idx = i * 2 + 1;
        int x = left - i * 8 - 9;
        int y = top;
        int icon = 16;
        byte backgound = 0;

        if (mc.thePlayer.isPotionActive(Potion.hunger)) {
            icon += 36;
            backgound = 13;
        }
        if (unused) backgound = 1; //Probably should be a += 1 but vanilla never uses this

        if (mc.thePlayer.getFoodStats().getSaturationLevel() <= 0.0F && updateCounter % (level * 3 + 1) == 0) {
            y = top + (rand.nextInt(3) - 1);
        }

        drawTexturedModalRect(x, y, 16 + backgound * 9, 27, 9, 9);

        if (unused) {
            if (idx < levelLast)
                drawTexturedModalRect(x, y, icon + 54, 27, 9, 9);
            else if (idx == levelLast)
                drawTexturedModalRect(x, y, icon + 63, 27, 9, 9);
        }

        if (idx < level)
            drawTexturedModalRect(x, y, icon + 36, 27, 9, 9);
        else if (idx == level)
            drawTexturedModalRect(x, y, icon + 45, 27, 9, 9);
    }
    mc.mcProfiler.endSection();
    post(FOOD);
}
 
开发者ID:Aurilux,项目名称:HotbarPlus,代码行数:49,代码来源:HBPGui.java

示例4: renderFood

import net.minecraft.util.FoodStats; //导入方法依赖的package包/类
@Override
public void renderFood(int width, int height) {
	mc.mcProfiler.startSection("food");

	int left = width / 2 + 91;
	int top = height - right_height + offsetY;
	right_height += 10;
	boolean unused = false;

	FoodStats stats = mc.thePlayer.getFoodStats();
	int level = stats.getFoodLevel();
	int levelLast = stats.getPrevFoodLevel();

	for(int i = 0; i < 10; ++i) {
		int idx = i * 2 + 1;
		int x = left - i * 8 - 9;
		int y = top;
		int icon = 16;
		byte backgound = 0;

		if(mc.thePlayer.isPotionActive(Potion.hunger)) {
			icon += 36;
			backgound = 13;
		}
		if(unused) {
			backgound = 1;
		}
		if(mc.thePlayer.getFoodStats().getSaturationLevel() <= 0.0F && updateCounter % (level * 3 + 1) == 0) {
			y = top + (rand.nextInt(3) - 1);
		}

		drawTexturedModalRect(x, y, 16 + backgound * 9, 27, 9, 9);

		if(unused) {
			if(idx < levelLast) {
				drawTexturedModalRect(x, y, icon + 54, 27, 9, 9);
			} else if(idx == levelLast) {
				drawTexturedModalRect(x, y, icon + 63, 27, 9, 9);
			}
		}

		if(idx < level) {
			drawTexturedModalRect(x, y, icon + 36, 27, 9, 9);
		} else if(idx == level) {
			drawTexturedModalRect(x, y, icon + 45, 27, 9, 9);
		}
	}
	mc.mcProfiler.endSection();
}
 
开发者ID:AgeCraft,项目名称:AgeCraft-Old,代码行数:50,代码来源:GuiInGame.java


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