Java Code Examples for net.minecraft.item.ItemBlock#setRegistryName()

The following examples show how to use net.minecraft.item.ItemBlock#setRegistryName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BlockBlueprintArchive.java    From Cyberware with MIT License 6 votes vote down vote up
public BlockBlueprintArchive()
{
	super(Material.IRON);
	setHardness(5.0F);
	setResistance(10.0F);
	setSoundType(SoundType.METAL);
	
	String name = "blueprintArchive";
	
	this.setRegistryName(name);
	GameRegistry.register(this);

	ItemBlock ib = new ItemBlockCyberware(this, "cyberware.tooltip.blueprintArchive");
	ib.setRegistryName(name);
	GameRegistry.register(ib);
	
	this.setUnlocalizedName(Cyberware.MODID + "." + name);

	this.setCreativeTab(Cyberware.creativeTab);
	GameRegistry.registerTileEntity(TileEntityBlueprintArchive.class, Cyberware.MODID + ":" + name);
	
	CyberwareContent.blocks.add(this);
	
	this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
}
 
Example 2
Source File: BlockBeaconLarge.java    From Cyberware with MIT License 6 votes vote down vote up
public BlockBeaconLarge()
{
	super(Material.IRON);
	setHardness(5.0F);
	setResistance(10.0F);
	setSoundType(SoundType.METAL);
	
	String name = "beaconLarge";
	
	this.setRegistryName(name);
	GameRegistry.register(this);

	ItemBlock ib = new ItemBlockCyberware(this, "cyberware.tooltip.beaconLarge");
	ib.setRegistryName(name);
	GameRegistry.register(ib);
	
	this.setUnlocalizedName(Cyberware.MODID + "." + name);

	this.setCreativeTab(Cyberware.creativeTab);
	GameRegistry.registerTileEntity(TileEntityBeaconLarge.class, Cyberware.MODID + ":" + name);
	
	CyberwareContent.blocks.add(this);
}
 
Example 3
Source File: BlockScanner.java    From Cyberware with MIT License 6 votes vote down vote up
public BlockScanner()
{
	super(Material.IRON);
	setHardness(5.0F);
	setResistance(10.0F);
	setSoundType(SoundType.METAL);
	
	String name = "scanner";
	
	this.setRegistryName(name);
	GameRegistry.register(this);

	ItemBlock ib = new ItemBlockCyberware(this);
	ib.setRegistryName(name);
	GameRegistry.register(ib);
	
	this.setUnlocalizedName(Cyberware.MODID + "." + name);

	this.setCreativeTab(Cyberware.creativeTab);
	GameRegistry.registerTileEntity(TileEntityScanner.class, Cyberware.MODID + ":" + name);
	
	CyberwareContent.blocks.add(this);
}
 
Example 4
Source File: BlockBeacon.java    From Cyberware with MIT License 6 votes vote down vote up
public BlockBeacon()
{
	super(Material.IRON);
	setHardness(5.0F);
	setResistance(10.0F);
	setSoundType(SoundType.METAL);
	
	String name = "beacon";
	
	this.setRegistryName(name);
	GameRegistry.register(this);

	ItemBlock ib = new ItemBlockCyberware(this, "cyberware.tooltip.beacon");
	ib.setRegistryName(name);
	GameRegistry.register(ib);
	
	this.setUnlocalizedName(Cyberware.MODID + "." + name);

	this.setCreativeTab(Cyberware.creativeTab);
	GameRegistry.registerTileEntity(TileEntityBeacon.class, Cyberware.MODID + ":" + name);
	
	CyberwareContent.blocks.add(this);
}
 
Example 5
Source File: BlockSurgery.java    From Cyberware with MIT License 6 votes vote down vote up
public BlockSurgery()
{
	super(Material.IRON);
	setHardness(5.0F);
	setResistance(10.0F);
	setSoundType(SoundType.METAL);
	
	String name = "surgery";
	
	this.setRegistryName(name);
	GameRegistry.register(this);

	ItemBlock ib = new ItemBlockCyberware(this);
	ib.setRegistryName(name);
	GameRegistry.register(ib);
	
	this.setUnlocalizedName(Cyberware.MODID + "." + name);

	this.setCreativeTab(Cyberware.creativeTab);
	GameRegistry.registerTileEntity(TileEntitySurgery.class, Cyberware.MODID + ":" + name);
	
	CyberwareContent.blocks.add(this);
}
 
Example 6
Source File: BlockCharger.java    From Cyberware with MIT License 6 votes vote down vote up
public BlockCharger()
{
	super(Material.IRON);
	setHardness(5.0F);
	setResistance(10.0F);
	setSoundType(SoundType.METAL);
	
	String name = "charger";
	
	this.setRegistryName(name);
	GameRegistry.register(this);

	ItemBlock ib = new ItemBlockCyberware(this);
	ib.setRegistryName(name);
	GameRegistry.register(ib);
	
	this.setUnlocalizedName(Cyberware.MODID + "." + name);

	this.setCreativeTab(Cyberware.creativeTab);
	GameRegistry.registerTileEntity(TileEntityCharger.class, Cyberware.MODID + ":" + name);
	
	CyberwareContent.blocks.add(this);
}
 
Example 7
Source File: NeatNetherBlocks.java    From CommunityMod with GNU Lesser General Public License v2.1 5 votes vote down vote up
public static ItemBlock registerItemBlock(Block block, IForgeRegistry<Item> r)
{
	ItemBlock ib = new ItemBlock(block);
	ib.setRegistryName(block.getRegistryName());

	r.register(ib);

	return ib;
}
 
Example 8
Source File: RoutiductBlocks.java    From CommunityMod with GNU Lesser General Public License v2.1 5 votes vote down vote up
public static void register(Block block, RegistryEvent.Register<Block> event, String... oreNames) {
    block.setCreativeTab(CommunityGlobals.TAB);
    event.getRegistry().register(block);
    ItemBlock itemBlock = new ItemBlock(block);
    ShootingStar.registerModel(new ModelCompound(RoutiductConstants.MOD_ID, itemBlock));
    itemBlock.setRegistryName(block.getRegistryName());
    ForgeRegistries.ITEMS.register(itemBlock);
    for (String oreName : oreNames) {
        OreDictionary.registerOre(oreName, block);
    }
}
 
Example 9
Source File: CommonProxy.java    From GregTech with GNU Lesser General Public License v3.0 5 votes vote down vote up
@SuppressWarnings("deprecation")
private static <T extends Block> ItemBlock createMultiTexItemBlock(T block, Function<IBlockState, String> nameProducer) {
    ItemBlock itemBlock = new ItemMultiTexture(block, block, stack -> {
        IBlockState blockState = block.getStateFromMeta(stack.getMetadata());
        return nameProducer.apply(blockState);
    });
    itemBlock.setRegistryName(block.getRegistryName());
    return itemBlock;
}
 
Example 10
Source File: BlockBeaconPost.java    From Cyberware with MIT License 5 votes vote down vote up
public BlockBeaconPost()
{
	super(Material.IRON);
	
	setHardness(5.0F);
	setResistance(10.0F);
	setSoundType(SoundType.METAL);
	
	String name = "radioPost";
	
	this.setRegistryName(name);
	GameRegistry.register(this);
	

	ItemBlock ib = new ItemBlockCyberware(this,
			"cyberware.tooltip.beaconPost.0",
			"cyberware.tooltip.beaconPost.1",
			"cyberware.tooltip.beaconPost.2");
	ib.setRegistryName(name);
	GameRegistry.register(ib);
	
	this.setUnlocalizedName(Cyberware.MODID + "." + name);

	this.setCreativeTab(Cyberware.creativeTab);
	
	CyberwareContent.blocks.add(this);
	
	GameRegistry.registerTileEntity(TileEntityBeaconPost.class, Cyberware.MODID + ":" + name);
	GameRegistry.registerTileEntity(TileEntityBeaconPostMaster.class, Cyberware.MODID + ":" + name + "_master");

	this.setDefaultState(this.blockState.getBaseState()
			.withProperty(TRANSFORMED, 0)
			.withProperty(NORTH, Boolean.valueOf(false))
			.withProperty(EAST, Boolean.valueOf(false))
			.withProperty(SOUTH, Boolean.valueOf(false))
			.withProperty(WEST, Boolean.valueOf(false)));
}
 
Example 11
Source File: Blocks.java    From BaseMetals with GNU Lesser General Public License v2.1 5 votes vote down vote up
private static Block addBlock(Block block, String name){
	block.setRegistryName(BaseMetals.MODID, name);
	block.setUnlocalizedName(BaseMetals.MODID+"."+name);
	GameRegistry.register(block);
	
	ItemBlock itemBlock = new ItemBlock(block);
	itemBlock.setRegistryName(BaseMetals.MODID, name);
	GameRegistry.register(itemBlock);
	
	allBlocks.put(name, block);
	return block;
}
 
Example 12
Source File: Blocks.java    From BaseMetals with GNU Lesser General Public License v2.1 5 votes vote down vote up
private static BlockDoor createDoor(MetalMaterial metal){
	String name = metal.getName()+"_door";
	BlockDoor block = new BlockMetalDoor(metal);
	block.setRegistryName(BaseMetals.MODID, name);
	block.setUnlocalizedName(BaseMetals.MODID+"."+name);
	GameRegistry.register(block);
	
	ItemBlock itemBlock = new ItemBlock(block);
	itemBlock.setRegistryName(BaseMetals.MODID, name);
	GameRegistry.register(itemBlock);
	
	allBlocks.put(metal.getName()+"_door", block);
	return block;
}
 
Example 13
Source File: CommonProxy.java    From GregTech with GNU Lesser General Public License v3.0 4 votes vote down vote up
private static <T extends Block> ItemBlock createItemBlock(T block, Function<T, ItemBlock> producer) {
    ItemBlock itemBlock = producer.apply(block);
    itemBlock.setRegistryName(block.getRegistryName());
    return itemBlock;
}