本文整理汇总了Java中net.minecraft.stats.StatList.objectUseStats方法的典型用法代码示例。如果您正苦于以下问题:Java StatList.objectUseStats方法的具体用法?Java StatList.objectUseStats怎么用?Java StatList.objectUseStats使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.stats.StatList
的用法示例。
在下文中一共展示了StatList.objectUseStats方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMaterialStatistic
import net.minecraft.stats.StatList; //导入方法依赖的package包/类
public static net.minecraft.stats.StatBase getMaterialStatistic(org.bukkit.Statistic stat, Material material) {
try {
if (stat == Statistic.MINE_BLOCK) {
return StatList.mineBlockStatArray[material.getId()];
}
if (stat == Statistic.CRAFT_ITEM) {
return StatList.objectCraftStats[material.getId()];
}
if (stat == Statistic.USE_ITEM) {
return StatList.objectUseStats[material.getId()];
}
if (stat == Statistic.BREAK_ITEM) {
return StatList.objectBreakStats[material.getId()];
}
} catch (ArrayIndexOutOfBoundsException e) {
return null;
}
return null;
}
示例2: StatsBlock
import net.minecraft.stats.StatList; //导入方法依赖的package包/类
public StatsBlock(Minecraft mcIn)
{
super(mcIn);
this.statsHolder = Lists.<StatCrafting>newArrayList();
for (StatCrafting statcrafting : StatList.objectMineStats)
{
boolean flag = false;
int i = Item.getIdFromItem(statcrafting.func_150959_a());
if (GuiStats.this.field_146546_t.readStat(statcrafting) > 0)
{
flag = true;
}
else if (StatList.objectUseStats[i] != null && GuiStats.this.field_146546_t.readStat(StatList.objectUseStats[i]) > 0)
{
flag = true;
}
else if (StatList.objectCraftStats[i] != null && GuiStats.this.field_146546_t.readStat(StatList.objectCraftStats[i]) > 0)
{
flag = true;
}
if (flag)
{
this.statsHolder.add(statcrafting);
}
}
this.statSorter = new Comparator<StatCrafting>()
{
public int compare(StatCrafting p_compare_1_, StatCrafting p_compare_2_)
{
int j = Item.getIdFromItem(p_compare_1_.func_150959_a());
int k = Item.getIdFromItem(p_compare_2_.func_150959_a());
StatBase statbase = null;
StatBase statbase1 = null;
if (StatsBlock.this.field_148217_o == 2)
{
statbase = StatList.mineBlockStatArray[j];
statbase1 = StatList.mineBlockStatArray[k];
}
else if (StatsBlock.this.field_148217_o == 0)
{
statbase = StatList.objectCraftStats[j];
statbase1 = StatList.objectCraftStats[k];
}
else if (StatsBlock.this.field_148217_o == 1)
{
statbase = StatList.objectUseStats[j];
statbase1 = StatList.objectUseStats[k];
}
if (statbase != null || statbase1 != null)
{
if (statbase == null)
{
return 1;
}
if (statbase1 == null)
{
return -1;
}
int l = GuiStats.this.field_146546_t.readStat(statbase);
int i1 = GuiStats.this.field_146546_t.readStat(statbase1);
if (l != i1)
{
return (l - i1) * StatsBlock.this.field_148215_p;
}
}
return j - k;
}
};
}
示例3: StatsItem
import net.minecraft.stats.StatList; //导入方法依赖的package包/类
public StatsItem(Minecraft mcIn)
{
super(mcIn);
this.statsHolder = Lists.<StatCrafting>newArrayList();
for (StatCrafting statcrafting : StatList.itemStats)
{
boolean flag = false;
int i = Item.getIdFromItem(statcrafting.func_150959_a());
if (GuiStats.this.field_146546_t.readStat(statcrafting) > 0)
{
flag = true;
}
else if (StatList.objectBreakStats[i] != null && GuiStats.this.field_146546_t.readStat(StatList.objectBreakStats[i]) > 0)
{
flag = true;
}
else if (StatList.objectCraftStats[i] != null && GuiStats.this.field_146546_t.readStat(StatList.objectCraftStats[i]) > 0)
{
flag = true;
}
if (flag)
{
this.statsHolder.add(statcrafting);
}
}
this.statSorter = new Comparator<StatCrafting>()
{
public int compare(StatCrafting p_compare_1_, StatCrafting p_compare_2_)
{
int j = Item.getIdFromItem(p_compare_1_.func_150959_a());
int k = Item.getIdFromItem(p_compare_2_.func_150959_a());
StatBase statbase = null;
StatBase statbase1 = null;
if (StatsItem.this.field_148217_o == 0)
{
statbase = StatList.objectBreakStats[j];
statbase1 = StatList.objectBreakStats[k];
}
else if (StatsItem.this.field_148217_o == 1)
{
statbase = StatList.objectCraftStats[j];
statbase1 = StatList.objectCraftStats[k];
}
else if (StatsItem.this.field_148217_o == 2)
{
statbase = StatList.objectUseStats[j];
statbase1 = StatList.objectUseStats[k];
}
if (statbase != null || statbase1 != null)
{
if (statbase == null)
{
return 1;
}
if (statbase1 == null)
{
return -1;
}
int l = GuiStats.this.field_146546_t.readStat(statbase);
int i1 = GuiStats.this.field_146546_t.readStat(statbase1);
if (l != i1)
{
return (l - i1) * StatsItem.this.field_148215_p;
}
}
return j - k;
}
};
}