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