本文整理汇总了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;
}
示例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);
}
}
}
示例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);
}
示例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;
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例10: getItem
import net.minecraft.item.ItemBlock; //导入方法依赖的package包/类
protected ItemBlock getItem(){
ItemBlock item = new ItemBlock(this);
item.setRegistryName(this.getRegistryName());
return item;
}
示例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;
}
示例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);
}
示例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());
}
示例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);
}