當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。