本文整理匯總了Java中net.minecraft.stats.StatList.objectBreakStats方法的典型用法代碼示例。如果您正苦於以下問題:Java StatList.objectBreakStats方法的具體用法?Java StatList.objectBreakStats怎麽用?Java StatList.objectBreakStats使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.stats.StatList
的用法示例。
在下文中一共展示了StatList.objectBreakStats方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: 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;
}
};
}