Added creative tab and Lang Files

This commit is contained in:
modmuss50 2015-04-10 10:55:00 +01:00
parent 25272228e2
commit ce031af8e7
4 changed files with 34 additions and 1 deletions

View file

@ -7,6 +7,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import techreborn.blocks.BlockThermalGenerator; import techreborn.blocks.BlockThermalGenerator;
import techreborn.client.GuiHandler; import techreborn.client.GuiHandler;
import techreborn.client.TechRebornCreativeTab;
import techreborn.tiles.TileThermalGenerator; import techreborn.tiles.TileThermalGenerator;
@Mod(modid = "techreborn", name = "TechReborn", version = "@MODVERSION@") @Mod(modid = "techreborn", name = "TechReborn", version = "@MODVERSION@")
@ -19,7 +20,7 @@ public class Core {
@Mod.EventHandler @Mod.EventHandler
public void init(FMLPreInitializationEvent event){ public void init(FMLPreInitializationEvent event){
thermalGenerator = new BlockThermalGenerator().setBlockName("techreborn.thermalGenerator").setBlockTextureName("techreborn:ThermalGenerator_other"); thermalGenerator = new BlockThermalGenerator().setBlockName("techreborn.thermalGenerator").setBlockTextureName("techreborn:ThermalGenerator_other").setCreativeTab(TechRebornCreativeTab.instance);
GameRegistry.registerBlock(thermalGenerator, "techreborn.thermalGenerator"); GameRegistry.registerBlock(thermalGenerator, "techreborn.thermalGenerator");
GameRegistry.registerTileEntity(TileThermalGenerator.class, "TileThermalGenerator"); GameRegistry.registerTileEntity(TileThermalGenerator.class, "TileThermalGenerator");

View file

@ -6,6 +6,8 @@ import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -13,6 +15,8 @@ import techreborn.Core;
import techreborn.client.GuiHandler; import techreborn.client.GuiHandler;
import techreborn.tiles.TileThermalGenerator; import techreborn.tiles.TileThermalGenerator;
import java.util.Random;
public class BlockThermalGenerator extends BlockContainer { public class BlockThermalGenerator extends BlockContainer {
@ -53,4 +57,10 @@ public class BlockThermalGenerator extends BlockContainer {
player.openGui(Core.INSTANCE, GuiHandler.thermalGeneratorID, world, x, y, z); player.openGui(Core.INSTANCE, GuiHandler.thermalGeneratorID, world, x, y, z);
return true; return true;
} }
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
//TODO change when added crafting
return Item.getItemFromBlock(Blocks.furnace);
}
} }

View file

@ -0,0 +1,19 @@
package techreborn.client;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import techreborn.Core;
public class TechRebornCreativeTab extends CreativeTabs {
public static TechRebornCreativeTab instance = new TechRebornCreativeTab();
public TechRebornCreativeTab() {
super("techreborn");
}
@Override
public Item getTabIconItem() {
return Item.getItemFromBlock(Core.thermalGenerator);
}
}

View file

@ -0,0 +1,3 @@
itemGroup.techreborn=Tech Reborn
tile.techreborn.thermalGenerator.name=Thermal Generator