Java Code Examples for org.bukkit.Statistic#USE_ITEM

The following examples show how to use org.bukkit.Statistic#USE_ITEM . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CraftStatistic.java    From Kettle with GNU General Public License v3.0 6 votes vote down vote up
public static StatBase getMaterialStatistic(Statistic stat, Material material) {
    try {
        if (stat == Statistic.MINE_BLOCK) {
            return StatList.getBlockStats(CraftMagicNumbers.getBlock(material)); // PAIL: getMineBlockStatistic
        }
        if (stat == Statistic.CRAFT_ITEM) {
            return StatList.getCraftStats(CraftMagicNumbers.getItem(material)); // PAIL: getCraftItemStatistic
        }
        if (stat == Statistic.USE_ITEM) {
            return StatList.getObjectUseStats(CraftMagicNumbers.getItem(material)); // PAIL: getUseItemStatistic
        }
        if (stat == Statistic.BREAK_ITEM) {
            return StatList.getObjectBreakStats(CraftMagicNumbers.getItem(material)); // PAIL: getBreakItemStatistic
        }
        if (stat == Statistic.PICKUP) {
            return StatList.getObjectsPickedUpStats(CraftMagicNumbers.getItem(material)); // PAIL: getPickupStatistic
        }
        if (stat == Statistic.DROP) {
            return StatList.getDroppedObjectStats(CraftMagicNumbers.getItem(material)); // PAIL: getDropItemStatistic
        }
    } catch (ArrayIndexOutOfBoundsException e) {
        return null;
    }
    return null;
}
 
Example 2
Source File: CraftStatistic.java    From Thermos with GNU General Public License v3.0 6 votes vote down vote up
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;
}