本文整理汇总了Java中thaumcraft.api.internal.WeightedRandomLoot类的典型用法代码示例。如果您正苦于以下问题:Java WeightedRandomLoot类的具体用法?Java WeightedRandomLoot怎么用?Java WeightedRandomLoot使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WeightedRandomLoot类属于thaumcraft.api.internal包,在下文中一共展示了WeightedRandomLoot类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addLootBagItem
import thaumcraft.api.internal.WeightedRandomLoot; //导入依赖的package包/类
/**
* Used to add possible loot to treasure bags. As a reference, the weight of gold coins are 2000
* and a diamond is 50. The weights are the same for all loot bag types - the only difference is
* how many items the bag contains.
*
* @param item
* @param weight
* @param bagTypes
* array of which type of bag to add this loot to. Multiple types can be specified 0 =
* common, 1 = uncommon, 2 = rare
*/
public static void addLootBagItem(ItemStack item, int weight, int... bagTypes) {
if ( (bagTypes == null) || (bagTypes.length == 0)) {
WeightedRandomLoot.lootBagCommon.add(new WeightedRandomLoot(item, weight));
}
else {
for (int rarity : bagTypes) {
switch (rarity) {
case 0:
WeightedRandomLoot.lootBagCommon.add(new WeightedRandomLoot(item, weight));
break;
case 1:
WeightedRandomLoot.lootBagUncommon.add(new WeightedRandomLoot(item, weight));
break;
case 2:
WeightedRandomLoot.lootBagRare.add(new WeightedRandomLoot(item, weight));
break;
}
}
}
}
示例2: addLootBagItem
import thaumcraft.api.internal.WeightedRandomLoot; //导入依赖的package包/类
/**
* Used to add possible loot to treasure bags. As a reference, the weight of gold coins are 2000
* and a diamond is 50.
* The weights are the same for all loot bag types - the only difference is how many items the bag
* contains.
*
* @param item
* @param weight
* @param bagTypes array of which type of bag to add this loot to. Multiple types can be specified
* 0 = common, 1 = uncommon, 2 = rare
*/
public static void addLootBagItem(ItemStack item, int weight, int... bagTypes)
{
if(bagTypes == null || bagTypes.length == 0)
WeightedRandomLoot.lootBagCommon.add(new WeightedRandomLoot(item, weight));
else
{
for(int rarity : bagTypes)
{
switch(rarity)
{
case 0:
WeightedRandomLoot.lootBagCommon.add(new WeightedRandomLoot(item, weight));
break;
case 1:
WeightedRandomLoot.lootBagUncommon.add(new WeightedRandomLoot(item, weight));
break;
case 2:
WeightedRandomLoot.lootBagRare.add(new WeightedRandomLoot(item, weight));
break;
}
}
}
}
示例3: addLootBagItem
import thaumcraft.api.internal.WeightedRandomLoot; //导入依赖的package包/类
/**
* Used to add possible loot to treasure bags. As a reference, the weight of gold coins are 2000
* and a diamond is 50.
* The weights are the same for all loot bag types - the only difference is how many items the bag
* contains.
* @param item
* @param weight
* @param bagTypes array of which type of bag to add this loot to. Multiple types can be specified
* 0 = common, 1 = uncommon, 2 = rare
*/
public static void addLootBagItem(ItemStack item, int weight, int... bagTypes) {
if (bagTypes == null || bagTypes.length == 0) {
WeightedRandomLoot.lootBagCommon.add(new WeightedRandomLoot(item, weight));
} else {
for (int rarity : bagTypes) {
switch (rarity) {
case 0:
WeightedRandomLoot.lootBagCommon.add(new WeightedRandomLoot(item, weight));
break;
case 1:
WeightedRandomLoot.lootBagUncommon.add(new WeightedRandomLoot(item, weight));
break;
case 2:
WeightedRandomLoot.lootBagRare.add(new WeightedRandomLoot(item, weight));
break;
}
}
}
}
示例4: addLootBagItem
import thaumcraft.api.internal.WeightedRandomLoot; //导入依赖的package包/类
/**
* Used to add possible loot to treasure bags. As a reference, the weight of gold coins are 2000
* and a diamond is 50.
* The weights are the same for all loot bag types - the only difference is how many items the bag
* contains.
* @param item
* @param weight
* @param bagTypes array of which type of bag to add this loot to. Multiple types can be specified
* 0 = common, 1 = uncommon, 2 = rare
*/
public static void addLootBagItem(ItemStack item, int weight, int... bagTypes) {
if (bagTypes==null || bagTypes.length==0)
WeightedRandomLoot.lootBagCommon.add(new WeightedRandomLoot(item,weight));
else {
for (int rarity:bagTypes) {
switch(rarity) {
case 0: WeightedRandomLoot.lootBagCommon.add(new WeightedRandomLoot(item,weight)); break;
case 1: WeightedRandomLoot.lootBagUncommon.add(new WeightedRandomLoot(item,weight)); break;
case 2: WeightedRandomLoot.lootBagRare.add(new WeightedRandomLoot(item,weight)); break;
}
}
}
}