當前位置: 首頁>>代碼示例>>Java>>正文


Java ItemBlock.setRegistryName方法代碼示例

本文整理匯總了Java中net.minecraft.item.ItemBlock.setRegistryName方法的典型用法代碼示例。如果您正苦於以下問題:Java ItemBlock.setRegistryName方法的具體用法?Java ItemBlock.setRegistryName怎麽用?Java ItemBlock.setRegistryName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.item.ItemBlock的用法示例。


在下文中一共展示了ItemBlock.setRegistryName方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: BaseLiquid

import net.minecraft.item.ItemBlock; //導入方法依賴的package包/類
public BaseLiquid(String fluidName, Consumer<Fluid> f, int col) {
	super(fluidName, new ResourceLocation(FirmaMod.MODID + ":blocks/water_still"), new ResourceLocation(FirmaMod.MODID + ":blocks/water_flow"));
	this.setUnlocalizedName(FirmaMod.MODID + ":fluid." + fluidName);
	FluidRegistry.registerFluid(this);
	f.accept(this);
	block = new BaseBlockLiquid(this, Material.WATER);
	block.setRegistryName(FirmaMod.MODID + ":fluid." + fluidName);
	block.setUnlocalizedName(FirmaMod.MODID + ":fluid." + fluidName);
	block.setCreativeTab(FirmaMod.blockTab);
	block.setLightOpacity(3);
	block.setLightLevel(0);
	
	GameRegistry.register(block);
	i = new ItemBlock(block);
	i.setRegistryName(FirmaMod.MODID+":fluid."+fluidName);
	i.setUnlocalizedName(FirmaMod.MODID+":fluid."+fluidName);
	GameRegistry.register(i);
	FirmaMod.allFluids.add(this);
	this.col = col;
}
 
開發者ID:trigg,項目名稱:Firma,代碼行數:21,代碼來源:BaseLiquid.java

示例2: register

import net.minecraft.item.ItemBlock; //導入方法依賴的package包/類
public static void register() {
	for(Block block : HarshenConfigs.BLOCKS.allComponants)
		if(HarshenConfigs.BLOCKS.isEnabled(block))
		{
			ForgeRegistries.BLOCKS.register(block);
			if(blocksWithItems.contains(block))
			{
				ItemBlock item = block instanceof IMetaItemBlock ? add(block) : new ItemBlock(block);
				item.setRegistryName(block.getRegistryName());
				item.setMaxStackSize(blockStackSize.get(block));
				ForgeRegistries.ITEMS.register(item);
			}
				
		}
			
}
 
開發者ID:kenijey,項目名稱:harshencastle,代碼行數:17,代碼來源:HarshenBlocks.java

示例3: BlockWopper

import net.minecraft.item.ItemBlock; //導入方法依賴的package包/類
public BlockWopper(String name){
    super(Material.WOOD);

    this.setRegistryName(name);
    GameRegistry.register(this);

    ItemBlock item = new ItemBlock(this);
    item.setRegistryName(name);
    GameRegistry.register(item);

    this.setUnlocalizedName(Wopper.MOD_ID+"."+name);
    this.setHardness(5F);
    this.setHarvestLevel("axe", 0);
    this.setCreativeTab(CreativeTabs.REDSTONE);
    this.setSoundType(SoundType.WOOD);
}
 
開發者ID:Ellpeck,項目名稱:Wopper,代碼行數:17,代碼來源:BlockWopper.java

示例4: registerItemBlock

import net.minecraft.item.ItemBlock; //導入方法依賴的package包/類
public void registerItemBlock(BlockBase block) {
	this.registerBlock(block);

	ItemBlock item = new ItemBlock(block);
	item.setRegistryName(block.getRegistryName());
	GameRegistry.register(item);

	block.itemBlock = item;
}
 
開發者ID:astronautlabs,項目名稱:rezolve,代碼行數:10,代碼來源:RezolveMod.java

示例5: registerItems

import net.minecraft.item.ItemBlock; //導入方法依賴的package包/類
@SubscribeEvent
public static void registerItems(RegistryEvent.Register<Item> event) {
    final IForgeRegistry<Item> registry = event.getRegistry();
    for (final IFluidBlock fluidBlock : MOD_FLUID_BLOCKS) {
        final Block block = (Block) fluidBlock;
        final ItemBlock itemBlock = new ItemBlock(block);
        itemBlock.setRegistryName(block.getRegistryName());
        registry.register(itemBlock);
    }
}
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:11,代碼來源:Fluids.java

示例6: registerBlock

import net.minecraft.item.ItemBlock; //導入方法依賴的package包/類
private static void registerBlock(Block block) {
	
	GameRegistry.register(block);
	ItemBlock item = new ItemBlock(block);
	item.setRegistryName(block.getRegistryName());
	GameRegistry.register(item);
	
}
 
開發者ID:Bedrockbreaker,項目名稱:rtap,代碼行數:9,代碼來源:ModBlocks.java

示例7: registerBlock

import net.minecraft.item.ItemBlock; //導入方法依賴的package包/類
private static void registerBlock(Block block) {
	
	GameRegistry.register(block);
	ItemBlock item = new ItemBlock(block);
	item.setUnlocalizedName(block.getUnlocalizedName());
	item.setRegistryName(block.getRegistryName());
	GameRegistry.register(item);
	
}
 
開發者ID:RedPer,項目名稱:MC-More-Ore-Mod,代碼行數:10,代碼來源:ModBlocks.java

示例8: registerBlock

import net.minecraft.item.ItemBlock; //導入方法依賴的package包/類
public static void registerBlock(Block block, String name) {
	ForgeRegistries.BLOCKS.register(block.setRegistryName(name));
	ItemBlock item = new ItemBlock(block);
	item.setRegistryName(block.getRegistryName());
	ForgeRegistries.ITEMS.register(item);
	proxy.registerItemBlock(item);
}
 
開發者ID:rafradek,項目名稱:Mods,代碼行數:8,代碼來源:RIG.java

示例9: registerBlock

import net.minecraft.item.ItemBlock; //導入方法依賴的package包/類
private static void registerBlock(Block block){
    GameRegistry.register(block);
    ItemBlock item = new ItemBlock(block);
    item.setRegistryName(block.getRegistryName());
    GameRegistry.register(item);
}
 
開發者ID:DeflatedPickles-Old-Repositories,項目名稱:JustJunk,代碼行數:7,代碼來源:ModBlocks.java

示例10: getItem

import net.minecraft.item.ItemBlock; //導入方法依賴的package包/類
protected ItemBlock getItem(){
    ItemBlock item = new ItemBlock(this);
    item.setRegistryName(this.getRegistryName());
    return item;
}
 
開發者ID:canitzp,項目名稱:Metalworks,代碼行數:6,代碼來源:BlockBase.java

示例11: register

import net.minecraft.item.ItemBlock; //導入方法依賴的package包/類
public static <T extends Block> T register(T b, ItemBlock ib) {
	registry.register(b);
	ib.setRegistryName(b.getRegistryName());
	ItemHandler.itemBlocks.add(ib);
	return b;
}
 
開發者ID:Zundrel,項目名稱:Never-Enough-Currency,代碼行數:7,代碼來源:BlockHandler.java

示例12: register

import net.minecraft.item.ItemBlock; //導入方法依賴的package包/類
private static <T extends Block> T register(T block) {
	ItemBlock itemBlock = new ItemBlock(block);
	itemBlock.setRegistryName(block.getRegistryName());
	return register(block, itemBlock);
}
 
開發者ID:djeezuss,項目名稱:Valkyrien-Warfare-Drivers-for-OpenComputers,代碼行數:6,代碼來源:ModBlocks.java

示例13: onRegister

import net.minecraft.item.ItemBlock; //導入方法依賴的package包/類
@SubscribeEvent
public static void onRegister(RegistryEvent.Register<Item> event) {
	//Thermionics.LOG.info("Registering items");
	
	IForgeRegistry<Item> r = event.getRegistry();
	
	//Blocks first
	for(Block b : Thermionics.instance().needItemRegistration) {
		if (b instanceof BlockBase) {
			item(r, new ItemBlockEquivalentState(b));
		} else if (b instanceof BlockBattery) {
			item(r, new ItemBlockBattery(b));
		} else {
			ItemBlock i = new ItemBlock(b);
			i.setRegistryName(b.getRegistryName());
			item(r, i);
		}
	}
	
	//Unified Hammer
	ThermionicsItems.HAMMER             = item(r, new ItemHammer(ToolMaterial.IRON,    "iron"));
	
	//Legacy Hammers - switchover to neo-hammer isn't done yet, so always register
	//if (CONFIG_ENFORCE_COMPATIBILITY) {
		ThermionicsItems.HAMMER_GOLD    = item(r, new ItemHammer(ToolMaterial.GOLD,    "gold"));
		ThermionicsItems.HAMMER_DIAMOND = item(r, new ItemHammer(ToolMaterial.DIAMOND, "diamond"));
		//Since we can't *safely*, *cleanly* rendezvous with other mods about Item.ToolMaterial properties, make our own
		//For hammers, these values are multiplied by 9 (so iron, which gives a pick 250 uses, gives a hammer 2250 to
		//compensate for the extra material used
           /*                                                        name      repairOre     level  uses eff dmg ench */
           /*                                                        iron      ingotIron      2     250  6f  2f  14   */
		ThermionicsItems.HAMMER_COPPER  = item(r, new ItemHammer("copper", "ingotCopper", 2,     200, 7f, 1f, 20));
		ThermionicsItems.HAMMER_LEAD    = item(r, new ItemHammer("lead",   "ingotLead",   2,    1550, 4f, 2f,  8));
		ThermionicsItems.HAMMER_INVAR   = item(r, new ItemHammer("invar",  "ingotInvar",  2,     300, 6f, 2f, 14));
	//}
	
	//Ingredients
	ThermionicsItems.INGREDIENT         = item(r, new ItemSubtyped<EnumIngredient>      ("ingredient",       EnumIngredient.values(),       false));
	ThermionicsItems.FABRIC_SQUARE      = item(r, new ItemFabricSquare());
	ThermionicsItems.ALLOMANTIC_POWDER  = item(r, new ItemSubtyped<EnumAllomanticPowder>("allomanticpowder", EnumAllomanticPowder.values(), true));
	OreDictionary.registerOre("gearBrass", new ItemStack(ThermionicsItems.INGREDIENT,1, EnumIngredient.GEAR_BRASS.ordinal()));
	
	//Booze
	ThermionicsItems.EMPTY_SPIRIT_BOTTLE= item(r, new ItemSpiritBottle("empty"));
	ThermionicsItems.SPIRIT_BOTTLE      = item(r, new ItemSpiritBottle(null));
	
	//Cloaks
	ThermionicsItems.MISTCLOAK          = item(r, new ItemMistcloak());
	ThermionicsItems.SCARF              = item(r, new ItemScarf());
	
	//Creative
	ThermionicsItems.CHUNK_UNLOADER     = item(r, new ItemChunkUnloader());
}
 
開發者ID:elytra,項目名稱:Thermionics,代碼行數:54,代碼來源:ThermionicsItems.java

示例14: register

import net.minecraft.item.ItemBlock; //導入方法依賴的package包/類
private static <T extends Block> T register(T block) {
    ItemBlock itemBlock = new ItemBlock(block);
    itemBlock.setRegistryName(block.getRegistryName());
    return register(block, itemBlock);
}
 
開發者ID:OCDiary,項目名稱:TheOink,代碼行數:6,代碼來源:OinkBlocks.java


注:本文中的net.minecraft.item.ItemBlock.setRegistryName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。