本文整理汇总了Java中com.cricketcraft.chisel.api.carving.CarvingUtils类的典型用法代码示例。如果您正苦于以下问题:Java CarvingUtils类的具体用法?Java CarvingUtils怎么用?Java CarvingUtils使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CarvingUtils类属于com.cricketcraft.chisel.api.carving包,在下文中一共展示了CarvingUtils类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getVariationStacks
import com.cricketcraft.chisel.api.carving.CarvingUtils; //导入依赖的package包/类
private static List<ItemStack> getVariationStacks(ICarvingGroup g) {
List<ItemStack> stacks = new ArrayList<ItemStack>();
for (ICarvingVariation v : g.getVariations()) {
stacks.add(CarvingUtils.getStack(v));
}
String oreName = g.getOreName();
if (oreName != null) {
check: for (ItemStack ore : OreDictionary.getOres(oreName)) {
for (ItemStack stack : stacks) {
if (NEIServerUtils.areStacksSameTypeCrafting(stack, ore)) {
continue check;
}
}
stacks.add(ore.copy());
}
}
return stacks;
}
示例2: registerIcons
import com.cricketcraft.chisel.api.carving.CarvingUtils; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
@SuppressWarnings("unchecked")
@Override
public void registerIcons(String modName, Block block, IIconRegister register) {
IIcon base = register.registerIcon(modName + ":" + texturePath);
int wh = (int) Math.sqrt(size);
TextureSubmap[][] submaps = new TextureSubmap[wh][wh];
TextureSubmap[][] submapsSmall = new TextureSubmap[wh][wh];
for (int i = 0; i < size; i++) {
AbstractSubmapManager manager = (AbstractSubmapManager) TextureType.CTMX.createManagerFor(CarvingUtils.getDefaultVariationFor(block, meta, 0), texturePath + "-" + i);
manager.registerIcons(modName, block, register);
Object cached = manager.getCachedObject();
Triple<IIcon, TextureSubmap, TextureSubmap> triple = (Triple<IIcon, TextureSubmap, TextureSubmap>) cached;
submaps[i % wh][i / wh] = triple.getMiddle();
submapsSmall[i % wh][i / wh] = triple.getRight();
if (i == 0) {
defaultIcon = triple.getRight().getSubIcon(0, 0);
}
}
submap = new Submap(base, wh, submaps);
smallSubmap = new Submap(base, wh, submapsSmall);
}
示例3: addVariation
import com.cricketcraft.chisel.api.carving.CarvingUtils; //导入依赖的package包/类
@Override
public void addVariation(String groupName, ICarvingVariation variation) {
if (groupName == null) {
throw new NullPointerException("Cannot add variation to null group name.");
} else if (variation == null) {
throw new NullPointerException("Cannot add variation in group " + groupName + " for null variation.");
}
ICarvingGroup group = groups.getGroupByName(groupName);
if (group == null) {
group = CarvingUtils.getDefaultGroupFor(groupName);
addGroup(group);
}
groups.addVariation(groupName, variation);
}
示例4: finalizeVariationGroup
import com.cricketcraft.chisel.api.carving.CarvingUtils; //导入依赖的package包/类
@Method(modid = MOD_ID)
private static void finalizeVariationGroup(WoodBlock woodBlock, int subBlockIndex, String variationGroupName)
{
final ICarvingRegistry chisel = CarvingUtils.getChiselRegistry();
chisel.addVariation(variationGroupName, woodBlock, subBlockIndex, 0);
chisel.setVariationSound(variationGroupName, MOD_ID + ":chisel.wood");
}
示例5: getVariation
import com.cricketcraft.chisel.api.carving.CarvingUtils; //导入依赖的package包/类
public static ICarvingVariation getVariation(ItemStack stack) {
ICarvingVariation v = Carving.chisel.getVariation(Block.getBlockFromItem(stack.getItem()), stack.getItemDamage());
return v == null ? CarvingUtils.getDefaultVariationFor(Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 99) : v;
}
示例6: registerIcons
import com.cricketcraft.chisel.api.carving.CarvingUtils; //导入依赖的package包/类
@Override
public void registerIcons(String modName, Block block, IIconRegister register) {
overlay = TextureType.getTypeFor(null, modName, texture).createManagerFor(CarvingUtils.getDefaultVariationFor(block, meta, 0), texture);
overlay.registerIcons(modName, block, register);
base = new TextureSubmap(register.registerIcon(modName + ":" + "animations/hadesX32"), 2, 2);
}