本文整理汇总了Java中exnihilo.registries.CompostRegistry类的典型用法代码示例。如果您正苦于以下问题:Java CompostRegistry类的具体用法?Java CompostRegistry怎么用?Java CompostRegistry使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CompostRegistry类属于exnihilo.registries包,在下文中一共展示了CompostRegistry类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: registerGeneralCompost
import exnihilo.registries.CompostRegistry; //导入依赖的package包/类
public static void registerGeneralCompost()
{
ArrayList<ItemStack> treeSapling = OreDictionary.getOres("treeSapling");
ArrayList<ItemStack> treeLeaves = OreDictionary.getOres("treeLeaves");
for (ItemStack sapling : treeSapling)
{
if (sapling.itemID != 6)
{
CompostRegistry.register(sapling.itemID, sapling.getItemDamage(), 0.125F, ColorRegistry.color("oak"));
}
}
for (ItemStack leaves : treeLeaves)
{
if (leaves.itemID != 18)
{
CompostRegistry.register(leaves.itemID, leaves.getItemDamage(), 0.125F, ColorRegistry.color("oak"));
}
}
}
示例2: newInstance
import exnihilo.registries.CompostRegistry; //导入依赖的package包/类
@Override
public TemplateRecipeHandler newInstance() {
if (barrels == null) {
barrels = new ArrayList<PositionedStack>(ModId.Barrels.length+3);
for (ModId barrel : ModId.Barrels) {
Item item = barrel.getItem();
if (item != null) {
if (barrel == ModId.WoodBarrel) {
for (int i = 0 ; i < 4; i++) {
barrels.add(new PositionedStack(new ItemStack(item, 1, i), 43, 34, false));
}
} else {
barrels.add(new PositionedStack(new ItemStack(item, 1), 43, 34, false));
}
}
}
}
if (compostables == null) {
compostables = new ArrayList<Compostable>(CompostRegistry.entries.size());
for (Compostable compostable : CompostRegistry.entries.values()) {
if (compostable.id != 0) {
compostables.add(compostable);
}
}
}
return super.newInstance();
}