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


Java Item.getRegistryName方法代码示例

本文整理汇总了Java中net.minecraft.item.Item.getRegistryName方法的典型用法代码示例。如果您正苦于以下问题:Java Item.getRegistryName方法的具体用法?Java Item.getRegistryName怎么用?Java Item.getRegistryName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.item.Item的用法示例。


在下文中一共展示了Item.getRegistryName方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: registerModel

import net.minecraft.item.Item; //导入方法依赖的package包/类
public static <T extends Enum<T> & IStringSerializable> void registerModel(Item item, Class<T> clazz) {
	for (T t : clazz.getEnumConstants()) {
		ResourceLocation location = new ResourceLocation(item.getRegistryName() + "_" + t.getName());
		ModelResourceLocation modelResourceLocation = new ModelResourceLocation(location, "inventory");
		ModelLoader.setCustomModelResourceLocation(item, t.ordinal(), modelResourceLocation);
	}
}
 
开发者ID:Um-Mitternacht,项目名称:Bewitchment,代码行数:8,代码来源:ModelHandler.java

示例2: testIfLegit

import net.minecraft.item.Item; //导入方法依赖的package包/类
@Override
protected boolean testIfLegit(Item componant) {
	boolean legit = componant.getRegistryName() != null;
	if(!legit)
		new NullPointerException("Tried to config a Item with no registry name. Item: " + componant.getClass());
	return super.testIfLegit(componant);
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:8,代码来源:ItemsEnabled.java

示例3: registerModel

import net.minecraft.item.Item; //导入方法依赖的package包/类
public static <T extends Enum<T> & IStringSerializable> void registerModel(Item item, Class<T> clazz) {
	for(T t : clazz.getEnumConstants()) {
		ResourceLocation location = new ResourceLocation(item.getRegistryName() + "_" + t.getName());
		ModelResourceLocation modelResourceLocation = new ModelResourceLocation(location, "inventory");
		ModelLoader.setCustomModelResourceLocation(item, t.ordinal(), modelResourceLocation);
	}
}
 
开发者ID:ArekkuusuJerii,项目名称:Solar,代码行数:8,代码来源:ModelHandler.java

示例4: registerItem

import net.minecraft.item.Item; //导入方法依赖的package包/类
/**
 * Use {@link #register(IForgeRegistryEntry)} instead
 */
@Deprecated
public static void registerItem(Item item, String name)
{
    if (item.getRegistryName() == null && Strings.isNullOrEmpty(name))
        throw new IllegalArgumentException("Attempted to register a item with no name: " + item);
    if (item.getRegistryName() != null && !item.getRegistryName().toString().equals(name))
        throw new IllegalArgumentException("Attempted to register a item with conflicting names. Old: " + item.getRegistryName() + " New: " + name);
    register(item.getRegistryName() == null ? item.setRegistryName(name) : item);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:13,代码来源:GameRegistry.java

示例5: registerItemColorHandler

import net.minecraft.item.Item; //导入方法依赖的package包/类
public void registerItemColorHandler(IItemColor itemColor, Item... itemsIn)
{
    for (Item item : itemsIn)
    {
        if (item == null) throw new IllegalArgumentException("Item registered to item color handler cannot be null!");
        if (item.getRegistryName() == null) throw new IllegalArgumentException("Item must be registered before assigning color handler.");
        this.itemColorMap.put(item.delegate, itemColor);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:10,代码来源:ItemColors.java

示例6: registerForgeModel

import net.minecraft.item.Item; //导入方法依赖的package包/类
public static void registerForgeModel(Block block, int meta, String variant) {
	Item item = Item.getItemFromBlock(block);
	if (item == Items.AIR) throw new UnsupportedOperationException("This block has no Item!");
	ModelResourceLocation modelResourceLocation = new ModelResourceLocation(item.getRegistryName(), variant);
	ModelLoader.setCustomModelResourceLocation(item, meta, modelResourceLocation);
}
 
开发者ID:Um-Mitternacht,项目名称:Bewitchment,代码行数:7,代码来源:ModelHandler.java

示例7: register

import net.minecraft.item.Item; //导入方法依赖的package包/类
public static void register(Item item, BiFunction<VertexFormat, Function<ResourceLocation, TextureAtlasSprite>, IBakedModel> function) {
	ResourceLocation location = item.getRegistryName();
	BAKERS.putIfAbsent(location, function);
}
 
开发者ID:ArekkuusuJerii,项目名称:Solar,代码行数:5,代码来源:DummyBakedRegistry.java

示例8: registerItemModel

import net.minecraft.item.Item; //导入方法依赖的package包/类
static void registerItemModel(Item i, int meta) {
	ResourceLocation loc = i.getRegistryName();
	ModelLoader.setCustomModelResourceLocation(i, meta, new ModelResourceLocation(loc, "inventory"));
}
 
开发者ID:TechReborn,项目名称:TechReborn3,代码行数:5,代码来源:TechRebornClient.java

示例9: registerRender

import net.minecraft.item.Item; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
private static void registerRender(Item item){
	ModelResourceLocation model=new ModelResourceLocation(item.getRegistryName(),"inventory");
	ModelLoader.setCustomModelResourceLocation(item, 0, model);
}
 
开发者ID:YoungGT,项目名称:EasyCraft,代码行数:6,代码来源:ItemLoader.java


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