当前位置: 首页>>代码示例>>Java>>正文


Java CarvingUtils类代码示例

本文整理汇总了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;
}
 
开发者ID:Chisel-2,项目名称:Chisel-2,代码行数:19,代码来源:RecipeHandlerChisel.java

示例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);
}
 
开发者ID:Chisel-2,项目名称:Chisel-2,代码行数:23,代码来源:SubmapManagerRCTM.java

示例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);
}
 
开发者ID:Chisel-2,项目名称:Chisel-2,代码行数:18,代码来源:Carving.java

示例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");
}
 
开发者ID:MinecraftModArchive,项目名称:Dendrology,代码行数:8,代码来源:ChiselMod.java

示例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;
}
 
开发者ID:Chisel-2,项目名称:Chisel-2,代码行数:5,代码来源:General.java

示例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);
}
 
开发者ID:Chisel-2,项目名称:Chisel-2,代码行数:7,代码来源:SubmapManagerVoidstone.java


注:本文中的com.cricketcraft.chisel.api.carving.CarvingUtils类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。