
kennybenny
-
Posts
28 -
Joined
-
Last visited
Posts posted by kennybenny
-
-
I am making a custom furnace called a refueler, and it refuels specific items if you put a bucket of oil in the fuel section of it. I want to make two recipes that will only work if you use the refueler, not the normal vanilla furnace, how could I do that?
-
Whenever I use setBlockTexture() it works, except with the texture on all sides of course, but when I use it like this
public void registerBlockIcons(IIconRegister IconRegistry){
this.blockIcon = IconRegistry.registerIcon(MoreMetalsMod.modid + ":blockRefueler_Side");
this.iconFront = IconRegistry.registerIcon(MoreMetalsMod.modid + (this.isActive ? ":blockRefueler_Front_Active" : ":blockRefueler_Front_Idol"));
this.iconLeft = IconRegistry.registerIcon(MoreMetalsMod.modid + ":blockRefueler_Left");
}
public IIcon getIcon(int side, int meta) {
return side == 1 ? this.blockIcon : (side == 0 ? this.blockIcon : (side != meta ? this.blockIcon : this.iconFront));
}
it just has the "blockIcon" on all of the sides and it doesn't have iconFront anywhere. How can I fix this?
-
I'm pretty sure that you need to replace registerIcons with registerBlockIcons, it used to be what you did, but in 1.7.2, it's registerBlockIcons. Hope this helps!
-
I can't find the code for lava, I searched for it and all that. I think that I need to make a custom material for my fluid too, how would I do that (preferably without editing minecraft code)?
-
I am making a fluid (oil) and I want it to do damage to most of the non-hostile mobs in minecraft, how could I do this?
Here's my code:
package k3.moremetals.mod.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import k3.moremetals.mod.MoreMetalsMod;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fluids.BlockFluidClassic;
import net.minecraftforge.fluids.Fluid;
public class BlockOil extends BlockFluidClassic {
public IIcon stillIcon;
public IIcon flowingIcon;
public BlockOil(Fluid fluid, Material material) {
super(fluid, material);
setCreativeTab(MoreMetalsMod.moreMetalsTab);
setDensity(1500);
}
@Override
public IIcon getIcon(int side, int meta) {
return (side == 0 || side == 1)? stillIcon : flowingIcon;
}
public void registerBlockIcons(IIconRegister register) {
stillIcon = register.registerIcon(MoreMetalsMod.modid + ":oil_still");
flowingIcon = register.registerIcon(MoreMetalsMod.modid + ":oil_flow");
}
@Override
public boolean canDisplace(IBlockAccess world, int x, int y, int z) {
if (world.getBlock(x, y, z).getMaterial().isLiquid()) return false;
return super.canDisplace(world, x, y, z);
}
@Override
public boolean displaceIfPossible(World world, int x, int y, int z) {
if (world.getBlock(x, y, z).getMaterial().isLiquid()) return false;
return super.displaceIfPossible(world, x, y, z);
}
}
-
Oh, sorry. I am a beginner at java, but I do know some Very simple things, but not much. Should I delete this topic or something?
-
Here's the stuff about the bucket in my main class:
bucketOil = new ItemBucketOil(oilBlock);
bucketOil.setUnlocalizedName("bucketOil").setContainerItem(Items.bucket);
GameRegistry.registerItem(bucketOil, "bucketOil");
FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("oil", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketOil), new ItemStack(Items.bucket));\
It keeps giving me the error "the constructor ItemBucketOil() is unidentified"
Oh, also, that's in the preinit.
here's all of the main class:
package k3.moremetals.mod;
import k3.moremetals.mod.block.BlockOil;
import k3.moremetals.mod.block.BlockPlatOre;
import k3.moremetals.mod.generation.PlatinumOreGeneration;
import k3.moremetals.mod.item.HatchetPlatinum;
import k3.moremetals.mod.item.HoePlatinum;
import k3.moremetals.mod.item.ItemBlackenedIronIngot;
import k3.moremetals.mod.item.ItemBlackenedIronRod;
import k3.moremetals.mod.item.ItemBucketOil;
import k3.moremetals.mod.item.ItemIronRod;
import k3.moremetals.mod.item.ItemPlatChunk;
import k3.moremetals.mod.item.PickaxePlatinum;
import k3.moremetals.mod.item.ShovelPlatinum;
import k3.moremetals.mod.item.SwordPlatinum;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidRegistry;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;
@Mod(modid = MoreMetalsMod.modid, version = MoreMetalsMod.version)
public class MoreMetalsMod {
//Mod Info Stuffs
public static final String modid = "moremetals";
public static final String version = "1.0";
public static CreativeTabs moreMetalsTab = new CreativeTabs("moreMetalsStuff"){
@Override
public Item getTabIconItem() {
return Items.emerald;
}
};
//Materials
public static ToolMaterial materialPlatinum = EnumHelper.addToolMaterial("materialPlatinum", 4, 2300, 5.5F, 6.0F, 10);
//Ore Generation
public static PlatinumOreGeneration PlatinumOreWorldGen = new PlatinumOreGeneration();
//Blocks
public static Block orePlatinum;
public static Block oilBlock;
//Fluids
public Fluid fluidOil = new Fluid("fluidOil");
//Items
public static Item chunkPlatinum;
public static Item rodIron;
public static Item rodIronBlackened;
public static Item ingotIronBlackened;
public static Item swordPlatinum;
public static Item hatchetPlatinum;
public static Item shovelPlatinum;
public static Item hoePlatinum;
public static Item pickaxePlatinum;
public static Item bucketOil;
@EventHandler
public void preInit(FMLPreInitializationEvent preevent){
//Register The Items
chunkPlatinum = new ItemPlatChunk().setUnlocalizedName("chunkPlatinum").setCreativeTab(MoreMetalsMod.moreMetalsTab);
GameRegistry.registerItem(chunkPlatinum, "chunkPlatinum");
rodIron = new ItemIronRod().setUnlocalizedName("rodIron").setCreativeTab(MoreMetalsMod.moreMetalsTab);
GameRegistry.registerItem(rodIron, "rodIron");
ingotIronBlackened = new ItemBlackenedIronIngot().setUnlocalizedName("ingotIronBlackened").setCreativeTab(MoreMetalsMod.moreMetalsTab);
GameRegistry.registerItem(ingotIronBlackened, "ingotIronBlackened");
rodIronBlackened = new ItemBlackenedIronRod().setUnlocalizedName("rodIronBlackened").setCreativeTab(MoreMetalsMod.moreMetalsTab);
GameRegistry.registerItem(rodIronBlackened, "rodIronBlackened");
bucketOil = new ItemBucketOil(oilBlock);
bucketOil.setUnlocalizedName("bucketOil").setContainerItem(Items.bucket);
GameRegistry.registerItem(bucketOil, "bucketOil");
FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("oil", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketOil), new ItemStack(Items.bucket));
//Register The Tools
swordPlatinum = new SwordPlatinum(materialPlatinum).setUnlocalizedName("swordPlatinum").setCreativeTab(MoreMetalsMod.moreMetalsTab);
GameRegistry.registerItem(swordPlatinum, "swordPlatinum");
hatchetPlatinum = new HatchetPlatinum(materialPlatinum).setUnlocalizedName("hatchetPlatinum").setCreativeTab(MoreMetalsMod.moreMetalsTab);
GameRegistry.registerItem(hatchetPlatinum, "hatchetPlatinum");
hoePlatinum = new HoePlatinum(materialPlatinum).setUnlocalizedName("hoePlatinum").setCreativeTab(MoreMetalsMod.moreMetalsTab);
GameRegistry.registerItem(hoePlatinum, "hoePlatinum");
pickaxePlatinum = new PickaxePlatinum(materialPlatinum).setUnlocalizedName("pickaxePlatinum").setCreativeTab(MoreMetalsMod.moreMetalsTab);
GameRegistry.registerItem(pickaxePlatinum, "pickaxePlatinum");
shovelPlatinum = new ShovelPlatinum(materialPlatinum).setUnlocalizedName("shovelPlatinum").setCreativeTab(MoreMetalsMod.moreMetalsTab);
GameRegistry.registerItem(shovelPlatinum, "shovelPlatinum");
//Register World Generation
GameRegistry.registerWorldGenerator(PlatinumOreWorldGen, 1);
//Register The Fluids
fluidOil = new Fluid("fluidOil");
FluidRegistry.registerFluid(fluidOil);
oilBlock = new BlockOil(fluidOil, Material.water).setBlockName("fluidOil");
GameRegistry.registerBlock(oilBlock, modid + "_" + oilBlock.getUnlocalizedName().substring(5));
fluidOil.setUnlocalizedName(oilBlock.getUnlocalizedName());
//Register The Blocks
orePlatinum = new BlockPlatOre().setBlockName("orePlatinum").setCreativeTab(MoreMetalsMod.moreMetalsTab);
GameRegistry.registerBlock(orePlatinum, "orePlatinum");
//Crafting Recipes
GameRegistry.addRecipe(new ItemStack(hatchetPlatinum, 1), new Object[]{"PP","PR"," R",'P', chunkPlatinum, 'R', rodIronBlackened});
GameRegistry.addRecipe(new ItemStack(swordPlatinum, 1), new Object[]{" P"," P"," R",'P', chunkPlatinum, 'R', rodIronBlackened});
GameRegistry.addRecipe(new ItemStack(hoePlatinum, 1), new Object[]{"PP"," R"," R",'P', chunkPlatinum, 'R', rodIronBlackened});
GameRegistry.addRecipe(new ItemStack(shovelPlatinum, 1), new Object[]{" P"," R"," R",'P', chunkPlatinum, 'R', rodIronBlackened});
GameRegistry.addRecipe(new ItemStack(pickaxePlatinum, 1), new Object[]{"PPP"," R "," R ", 'P', chunkPlatinum, 'R', rodIronBlackened});
GameRegistry.addRecipe(new ItemStack(rodIronBlackened, 4), new Object[]{"I", "I", 'I', ingotIronBlackened});
GameRegistry.addRecipe(new ItemStack(rodIron, 4), new Object[]{"I", "I", 'I', Items.iron_ingot});
GameRegistry.addShapelessRecipe(new ItemStack(ingotIronBlackened, 1), new Object[] {new ItemStack(Items.iron_ingot, 1), new ItemStack(Items.coal, 1)});
}
}
Here's the ItemBucketOil class:
package k3.moremetals.mod.item;
import net.minecraft.item.ItemBucket;
import k3.moremetals.mod.MoreMetalsMod;
public class ItemBucketOil extends ItemBucket{
public ItemBucketOil(){
//Sets The Texture Of The Item
setTextureName(MoreMetalsMod.modid + ":bucketOil");
setMaxStackSize(1);
}
}
In that it's giving me the error "Implicit super constructor ItemBucket() is undefined. Must explicitly invoke another constructor"
Here's the BlockOil class:
package k3.moremetals.mod.block;
import k3.moremetals.mod.MoreMetalsMod;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fluids.BlockFluidClassic;
import net.minecraftforge.fluids.Fluid;
public class BlockOil extends BlockFluidClassic {
public void registerIcons(IIconRegister register) {
oil_still = register.registerIcon(MoreMetalsMod.modid + ":fluidStill");
oil_flowing = register.registerIcon(MoreMetalsMod.modid + ":fluidFlowing");
}
public IIcon oil_still;
public IIcon oil_flowing;
public BlockOil(Fluid fluid, Material material) {
super(fluid, material);
setCreativeTab(MoreMetalsMod.moreMetalsTab);
}
@Override
public IIcon getIcon(int side, int meta) {
return (side == 0 || side == 1)? oil_still : oil_flowing;
}
@Override
public boolean canDisplace(IBlockAccess world, int x, int y, int z) {
if (world.getBlock(x, y, z).getMaterial().isLiquid()) return false;
return super.canDisplace(world, x, y, z);
}
@Override
public boolean displaceIfPossible(World world, int x, int y, int z) {
if (world.getBlock(x, y, z).getMaterial().isLiquid()) return false;
return super.displaceIfPossible(world, x, y, z);
}
}
It's not giving me any errors in that but I thought that I'd put that there anyways.
I also have a couple other things I want to know but I don't know if I should put them in here or in a different topic.
-
Okay now it's working. Also, I just noticed that in the src/main/resources it's giving me a warning "the resource is a duplicate of src/main/java/.DS_Store and was not copied to the output folder"
-
All of my other recipes are working but not my pickaxe recipe.
Code:
package k3.moremetals.mod;
import k3.moremetals.mod.block.BlockPlatOre;
import k3.moremetals.mod.generation.PlatinumOreGeneration;
import k3.moremetals.mod.item.HatchetPlatinum;
import k3.moremetals.mod.item.HoePlatinum;
import k3.moremetals.mod.item.ItemBlackenedIronIngot;
import k3.moremetals.mod.item.ItemBlackenedIronRod;
import k3.moremetals.mod.item.ItemIronRod;
import k3.moremetals.mod.item.ItemPlatChunk;
import k3.moremetals.mod.item.PickaxePlatinum;
import k3.moremetals.mod.item.ShovelPlatinum;
import k3.moremetals.mod.item.SwordPlatinum;
import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.EnumHelper;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;
@Mod(modid = MoreMetalsMod.modid, version = MoreMetalsMod.version)
public class MoreMetalsMod {
//Mod Info Stuffs
public static final String modid = "moremetals";
public static final String version = "1.0";
public static CreativeTabs moreMetalsTab = new CreativeTabs("moreMetalsStuff"){
@Override
public Item getTabIconItem() {
return Items.emerald;
}
};
//Materials
public static ToolMaterial materialPlatinum = EnumHelper.addToolMaterial("materialPlatinum", 4, 2300, 5.5F, 6.0F, 10);
//Ore Generation
public static PlatinumOreGeneration PlatinumOreWorldGen = new PlatinumOreGeneration();
//Blocks
public static Block orePlatinum;
//Items
public static Item chunkPlatinum;
public static Item rodIron;
public static Item rodIronBlackened;
public static Item ingotIronBlackened;
public static Item swordPlatinum;
public static Item hatchetPlatinum;
public static Item shovelPlatinum;
public static Item hoePlatinum;
public static Item pickaxePlatinum;
@EventHandler
public void preInit(FMLPreInitializationEvent preevent){
//Register The Items
chunkPlatinum = new ItemPlatChunk().setUnlocalizedName("chunkPlatinum").setCreativeTab(MoreMetalsMod.moreMetalsTab);
GameRegistry.registerItem(chunkPlatinum, "chunkPlatinum");
rodIron = new ItemIronRod().setUnlocalizedName("rodIron").setCreativeTab(MoreMetalsMod.moreMetalsTab);
GameRegistry.registerItem(rodIron, "rodIron");
ingotIronBlackened = new ItemBlackenedIronIngot().setUnlocalizedName("ingotIronBlackened").setCreativeTab(MoreMetalsMod.moreMetalsTab);
GameRegistry.registerItem(ingotIronBlackened, "ingotIronBlackened");
rodIronBlackened = new ItemBlackenedIronRod().setUnlocalizedName("rodIronBlackened").setCreativeTab(MoreMetalsMod.moreMetalsTab);
GameRegistry.registerItem(rodIronBlackened, "rodIronBlackened");
//Register The Tools
swordPlatinum = new SwordPlatinum(materialPlatinum).setUnlocalizedName("swordPlatinum").setCreativeTab(MoreMetalsMod.moreMetalsTab);
GameRegistry.registerItem(swordPlatinum, "swordPlatinum");
hatchetPlatinum = new HatchetPlatinum(materialPlatinum).setUnlocalizedName("hatchetPlatinum").setCreativeTab(MoreMetalsMod.moreMetalsTab);
GameRegistry.registerItem(hatchetPlatinum, "hatchetPlatinum");
hoePlatinum = new HoePlatinum(materialPlatinum).setUnlocalizedName("hoePlatinum").setCreativeTab(MoreMetalsMod.moreMetalsTab);
GameRegistry.registerItem(hoePlatinum, "hoePlatinum");
pickaxePlatinum = new PickaxePlatinum(materialPlatinum).setUnlocalizedName("pickaxePlatinum").setCreativeTab(MoreMetalsMod.moreMetalsTab);
GameRegistry.registerItem(pickaxePlatinum, "pickaxePlatinum");
shovelPlatinum = new ShovelPlatinum(materialPlatinum).setUnlocalizedName("shovelPlatinum").setCreativeTab(MoreMetalsMod.moreMetalsTab);
GameRegistry.registerItem(shovelPlatinum, "shovelPlatinum");
//Register World Generation
GameRegistry.registerWorldGenerator(PlatinumOreWorldGen, 1);
//Register The Blocks
orePlatinum = new BlockPlatOre().setBlockName("orePlatinum").setCreativeTab(MoreMetalsMod.moreMetalsTab);
GameRegistry.registerBlock(orePlatinum, "orePlatinum");
//Crafting Recipes
GameRegistry.addRecipe(new ItemStack(hatchetPlatinum, 1), new Object[]{"PP","PR"," R",'P', chunkPlatinum, 'R', rodIronBlackened});
GameRegistry.addRecipe(new ItemStack(swordPlatinum, 1), new Object[]{" P"," P"," R",'P', chunkPlatinum, 'R', rodIronBlackened});
GameRegistry.addRecipe(new ItemStack(hoePlatinum, 1), new Object[]{"PP"," R"," R",'P', chunkPlatinum, 'R', rodIronBlackened});
GameRegistry.addRecipe(new ItemStack(shovelPlatinum, 1), new Object[]{" P"," R"," R",'P', chunkPlatinum, 'R', rodIronBlackened});
GameRegistry.addRecipe(new ItemStack(pickaxePlatinum, 1), new Object[]{"PPP"," R"," R", 'P', chunkPlatinum, 'R', rodIronBlackened});
}
}
-
src/main/java/my/awesome/package/name/MyMod.java
Can you be more specific?
Seriously? You want Diesieben07 to name your package for you? Ughh
No, I just don't know what he means by "my/awesome/package/name", but I think I figured it out.
-
src/main/java/my/awesome/package/name/MyMod.java
Can you be more specific?
-
YES!!!! It worked! Thank you! Now I guess I have to make a class that extends item for my chunk platinum and do sort of the same thing. Thanks again. Oh and where do I put my main mod file (moreMetalsMod.java)?
-
Oooohhhhh... I can't believe I didn't realize that you were talking about the "moreMetals" and not the "modid"
But now it's not letting me refactor the k3.moreMetals.mod.block and the assets and stuff to moremetals, it's just telling me that it caught an exception and that a resource exists with a different case.
-
Nope, still not working, could it be that my main thing is in the same package (k3.moremetals.mod.block) as the BlockPlatOre? If it is the problem where should I put it? Here's another screenshot:
-
did you try my method?
Yeah,it gave me errors because there wasn't a "this." and because it was .setTextureName inestead of .setBlocTextureName
-
If you mean like this
-
Nothing at all... .mod says that this is the mod, .block says that this is the package of blocks...
Do you put all the classes in there or just the blocks, and if you only put the blocks there, where do you put the main file?
-
Hmmmmm... When you said net.techmodcraft.mod.block, what did the "mod" and "block" mean?
-
This is my code (I'll only paste the important ones):
MainClass
public class MainClass { public static final String MODID = "techmodcraft"; public static final String VERSION = "1.0"; public static CreativeTabs testTab = new CreativeTabs("techmodcraft") { @Override public Item getTabIconItem() { return Items.diamond; } }; public static Block blockTest; @EventHandler public void preInit(FMLPreInitializationEvent event){ blockTest = new BlockTech().setBlockName("blockTest").setCreativeTab(testTab); GameRegistry.registerBlock(blockTest, "blockTest"); }
BlockTech
public class BlockTech extends Block{ public BlockTech() { super(Material.rock); this.setBlockTextureName(MainClass.MODID + ":" + "blockTest"); } }
In the Package Explorer I have:
- Forge > src/TechModCraft:
> assets.techmodcraft.textures.blocks > (this has the images of blocks)
> net.techmodcraft.mod.block > (this has the .java classes)
If you don't find any error by comparing with my setup, try to re-create the project... That might help!
I'll continue to see this...
It's still not working, do you have any tutorials that are any different from what I was already doing?
-
Well, thanks, hope you can look tomorrow.
-
-
I think I have the same setup,
-
Did you set the texture name in your block class as it is in my spoiler tag?
(if you don't know, just click the 'hidden' button and you'll see the code that works)
Yeah, I copy-pasted it all. I'll take some screenshots and if somebody can tell me how to use the insert image thing on the forum (I'm a big noob on the forum) then I can post them.
-
The second one is right, but the first one is supposed to be like this:
(...) orePlatinum = new BlockPlatOre().setBlockName("orePlatinum"); GameRegistry.registerBlock(orePlatinum, "orePlatinum"); (...)
(no set block texture name)
I hope it works this way
Nope, still not working, just a checkered purple and black block, the images are 16x16, just saying, it might help.
[1.7.2] GUI on custom furnace isn't opening
in Modder Support
Posted
Hi, I can't find out why my custom furnace isn't working, this is probably a noob question with a simple answer, but I just can't figure it out!
Here's my container class:
package k3.moremetals.mod.container;
import k3.moremetals.mod.tileentity.TileEntityRefueler;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
import net.minecraft.inventory.SlotFurnace;
public class ContainerRefueler extends Container{
private TileEntityRefueler tileentityrefueler;
public int lastBurnTime;
public int lastCurrentItemBurnTime;
public int lastCookTime;
public ContainerRefueler(InventoryPlayer inventory, TileEntityRefueler tileentity){
this.tileentityrefueler = tileentity;
this.addSlotToContainer(new Slot(tileentity, 0, 56, 17));
this.addSlotToContainer(new Slot(tileentity, 1, 56, 53));
this.addSlotToContainer(new SlotFurnace(inventory.player, tileentity, 2, 116, 35));
for(int i = 0; i < 3; i++){
for(int j = 0; j < 9; j++){
this.addSlotToContainer(new Slot(inventory, j + i*9 + 9, 8 + j*18, 94 + i*18));
}
}
for(int i = 0; i < 9; i++){
this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142));
}
}
public void addCraftingToCrafters (ICrafting icrafting){
super.addCraftingToCrafters(icrafting);
icrafting.sendProgressBarUpdate(this, 0, this.tileentityrefueler.cookTime);
icrafting.sendProgressBarUpdate(this, 1, this.tileentityrefueler.burnTime);
icrafting.sendProgressBarUpdate(this, 2, this.tileentityrefueler.currentItemBurnTime);
}
public void detectAndSendChanges() {
super.detectAndSendChanges();
for(int i = 0; i < this.crafters.size(); i++){
ICrafting icrafting = (ICrafting) this.crafters.get(i);
if(this.lastCookTime != this.tileentityrefueler.cookTime){
icrafting.sendProgressBarUpdate(this, 0, this.tileentityrefueler.cookTime);
}
if(this.lastBurnTime != this.tileentityrefueler.burnTime){
icrafting.sendProgressBarUpdate(this, 1, this.tileentityrefueler.burnTime);
}
if(this.lastCurrentItemBurnTime != this.tileentityrefueler.currentItemBurnTime){
icrafting.sendProgressBarUpdate(this, 2, this.tileentityrefueler.currentItemBurnTime);
}
}
this.lastCookTime = this.tileentityrefueler.cookTime;
this.lastBurnTime = this.tileentityrefueler.burnTime;
this.lastCurrentItemBurnTime = this.tileentityrefueler.currentItemBurnTime;
}
public void updateProgressBar(int slot, int newValue){
}
@Override
public boolean canInteractWith(EntityPlayer var1) {
// TODO Auto-generated method stub
return false;
}
}
Here's my block class:
package k3.moremetals.mod.block;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import k3.moremetals.mod.MoreMetalsMod;
import k3.moremetals.mod.tileentity.TileEntityRefueler;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class BlockRefueler extends BlockContainer{
private IIcon iconFront;
private IIcon iconLeft;
private boolean isActive;
private static boolean keepInventory;
public BlockRefueler(boolean isActive) {
super(Material.iron);
this.isActive = isActive;
}
@Override
public void registerBlockIcons(IIconRegister iconRegister){
this.blockIcon = iconRegister.registerIcon(MoreMetalsMod.modid + ":blockRefueler_Side");
this.iconFront = iconRegister.registerIcon(MoreMetalsMod.modid + (this.isActive ? ":blockRefueler_Front_Active" : ":blockRefueler_Front_Idle"));
this.iconLeft = iconRegister.registerIcon(MoreMetalsMod.modid + ":blockRefueler_Left");
}
public IIcon getIcon(int side, int metadata){
return side == 1 ? this.blockIcon : (side == 0 ? this.blockIcon : (side == 6 ? this.iconLeft : (side != metadata ? this.blockIcon : this.iconFront)));
}
public Item getItemDropped(World world, int x, int y, int z){
return Item.getItemFromBlock(MoreMetalsMod.blockRefueler_Idle);
}
public void onBlockAdded(World world, int x, int y, int z){
super.onBlockAdded(world, x, y, z);
this.setDefaultDirection(world, x, y, z);
}
private void setDefaultDirection(World world, int x, int y, int z) {
if(!world.isRemote){
Block b1 = world.getBlock(x, y, z -1);
Block b2 = world.getBlock(x, y, z +1);
Block b3 = world.getBlock(x -1, y, z);
Block b4 = world.getBlock(x +1, y, z);
byte b0 = 3;
if(b1.func_149730_j() && !b2.func_149730_j()){
b0 = 3;
}
if(b2.func_149730_j() && !b1.func_149730_j()){
b0 = 2;
}
if(b3.func_149730_j() && !b4.func_149730_j()){
b0 = 5;
}
if(b4.func_149730_j() && !b3.func_149730_j()){
b0 = 4;
}
world.setBlockMetadataWithNotify(x, y, x, b0, 2);
}
}
public boolean onBlockAcitvated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ){
if(!world.isRemote){
FMLNetworkHandler.openGui(player, MoreMetalsMod.instance, MoreMetalsMod.guiIDRefueler, world, x, y, z);
}
return true;
}
@Override
public TileEntity createNewTileEntity(World world, int i) {
return new TileEntityRefueler();
}
//TODO randomDisplayTick
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityplayer, ItemStack itemstack){
int l = MathHelper.floor_double((double)(entityplayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
if(l == 0){
world.setBlockMetadataWithNotify(x, y, z, 2, 2);
}
if(l == 1){
world.setBlockMetadataWithNotify(x, y, z, 5, 2);
}
if(l == 2){
world.setBlockMetadataWithNotify(x, y, z, 3, 2);
}
if(l == 3){
world.setBlockMetadataWithNotify(x, y, z, 4, 2);
}
if(itemstack.hasDisplayName()){
((TileEntityRefueler)world.getTileEntity(x, y, z)).setGuiDisplayName(itemstack.getDisplayName());
}
}
public static void updateBlockRefuelerBlockState(boolean active, World worldObj, int xCoord, int yCoord, int zCoord) {
int i = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
TileEntity tileentity = worldObj.getTileEntity(xCoord, yCoord, zCoord);
keepInventory = true;
if(active){
worldObj.setBlock(xCoord, yCoord, zCoord, MoreMetalsMod.blockRefueler_Active);
}
else {
worldObj.setBlock(xCoord, yCoord, zCoord, MoreMetalsMod.blockRefueler_Idle);
}
keepInventory = false;
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, i, 2);
if(tileentity != null){
tileentity.validate();
worldObj.setTileEntity(xCoord, yCoord, zCoord, tileentity);
}
}
}
The GUI
package k3.moremetals.mod.gui;
import k3.moremetals.mod.MoreMetalsMod;
import k3.moremetals.mod.container.ContainerRefueler;
import k3.moremetals.mod.tileentity.TileEntityRefueler;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
public class GuiRefueler extends GuiContainer{
public static final ResourceLocation texture = new ResourceLocation(MoreMetalsMod.modid + ":textures/gui/refueler.png");
public TileEntityRefueler refueler;
public GuiRefueler(InventoryPlayer inventoryPlayer, TileEntityRefueler entity) {
super(new ContainerRefueler(inventoryPlayer, entity));
this.refueler = entity;
this.xSize = 176;
this.ySize = 166;
}
public void drawGuiContainerForegroundLayer(int par1, int par2){
String name = this.refueler.hasCustomInventoryName() ? this.refueler.getInventoryName() : I18n.format(this.refueler.getInventoryName(), new Object[0]);
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 128, this.ySize - 96 + 2, 4210752);
}
@Override
protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) {
// TODO Auto-generated method stub
}
}
GUI Handler
package k3.moremetals.mod.handler;
import k3.moremetals.mod.MoreMetalsMod;
import k3.moremetals.mod.container.ContainerRefueler;
import k3.moremetals.mod.gui.GuiRefueler;
import k3.moremetals.mod.tileentity.TileEntityRefueler;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import cpw.mods.fml.common.network.IGuiHandler;
public class GuiHandler implements IGuiHandler{
@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
TileEntity entity = world.getTileEntity(x, y, z);
if(entity != null){
switch(ID){
case MoreMetalsMod.guiIDRefueler:
if(entity instanceof TileEntityRefueler){
return new ContainerRefueler(player.inventory, (TileEntityRefueler) entity);
}
return null;
}
}
return null;
}
@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
TileEntity entity = world.getTileEntity(x, y, z);
if(entity != null){
switch(ID){
case MoreMetalsMod.guiIDRefueler:
if(entity instanceof TileEntityRefueler){
return new GuiRefueler(player.inventory, (TileEntityRefueler) entity);
}
return null;
}
}
return null;
}
}
TileEntity
package k3.moremetals.mod.tileentity;
import k3.moremetals.mod.MoreMetalsMod;
import k3.moremetals.mod.block.BlockRefueler;
import k3.moremetals.mod.handler.RefuelerRecipeHandler;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
public class TileEntityRefueler extends TileEntity implements ISidedInventory{
private String localizedName;
private static final int[] slots_top = new int[]{0};
private static final int[] slots_bottom = new int[]{2, 1};
private static final int[] slots_side = new int[]{1};
private ItemStack[] slots = new ItemStack[3];
public int furnaceSpeed = 300;
public int burnTime;
public int currentItemBurnTime;
public int cookTime;
public void setGuiDisplayName(String displayName) {
this.localizedName = displayName;
}
public String getInventoryName(){
return this.hasCustomInventoryName() ? this.localizedName : "container.refueler";
}
public boolean hasCustomInventoryName() {
return this.localizedName != null && this.localizedName.length() > 0;
}
public int getSizeInvetory(){
return this.slots.length;
}
@Override
public int getSizeInventory() {
// TODO Auto-generated method stub
return 0;
}
@Override
public ItemStack getStackInSlot(int var1) {
return this.slots[var1];
}
@Override
public ItemStack decrStackSize(int var1, int var2) {
if(this.slots[var1] != null){
ItemStack itemstack;
if(this.slots[var1].stackSize <= var2){
itemstack = this.slots[var1];
this.slots[var1] = null;
return itemstack;
}
else{
itemstack = this.slots[var1].splitStack(var2);
if(this.slots[var1].stackSize == 0){
this.slots[var1] = null;
return itemstack;
}
}
}
return null;
}
@Override
public ItemStack getStackInSlotOnClosing(int i) {
if(this.slots != null){
ItemStack itemstack = this.slots;
this.slots = null;
return itemstack;
}
return null;
}
@Override
public void setInventorySlotContents(int i, ItemStack itemstack) {
this.slots = itemstack;
if(itemstack != null && itemstack.stackSize > this.getInventoryStackLimit()){
itemstack.stackSize = this.getInventoryStackLimit();
}
}
@Override
public int getInventoryStackLimit() {
return 64;
}
@Override
public boolean isUseableByPlayer(EntityPlayer entityplayer) {
return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : entityplayer.getDistance((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D;
}
public void openInventory() {
}
public void closeInventory() {
}
private static int getItemBurnTime(ItemStack itemstack){
if(itemstack == null){
return 0;
}
else{
Item item = itemstack.getItem();
if(item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.air){
Block block = Block.getBlockFromItem(item);
if (item == MoreMetalsMod.bucketOil) return 200;
}
}
return 0;
}
public boolean isBurning(){
return this.burnTime > 0;
}
public void updateEntity(){
boolean flag = this.burnTime > 0;
boolean flag1 = false;
if(this.isBurning()){
this.burnTime--;
}
if(!this.worldObj.isRemote){
if(this.burnTime == 0 && this.canSmelt()){
this.currentItemBurnTime = this.burnTime = getItemBurnTime(this.slots[1]);
if(this.isBurning()){
flag1 = true;
if(this.slots[1] != null){
this.slots[1].stackSize--;
if(this.slots[1].stackSize == 0){
this.slots[1] = this.slots[1].getItem().getContainerItem(this.slots[1]);
}
}
}
}
}
if(this.isBurning() && this.canSmelt()){
this.cookTime++;
if(this.cookTime == this.furnaceSpeed){
this.cookTime = 0;
this.refuelItem();
flag1 = true;
}
else{
this.cookTime = 0;
}
if(flag != this.isBurning()){
flag1 = true;
BlockRefueler.updateBlockRefuelerBlockState(this.burnTime > 0, this.worldObj, this.xCoord, this.yCoord, this.zCoord);
}
}
if(flag1){
this.markDirty();
}
}
public void refuelItem() {
if(this.canSmelt()){
ItemStack itemstack = RefuelerRecipeHandler.smelting().getSmeltingResult(this.slots[0]);
if(this.slots[2] == null){
this.slots[2] = itemstack.copy();
}
else if(this.slots[2].isItemEqual(itemstack)){
this.slots[2].stackSize += itemstack.stackSize;
}
this.slots[0].stackSize--;
if(this.slots[0].stackSize <= 0){
this.slots[0] = null;
}
}
}
public boolean canSmelt(){
if(this.slots[0] == null){
return false;
}
else{
ItemStack itemstack = RefuelerRecipeHandler.smelting().getSmeltingResult(this.slots[0]);
if(itemstack == null) return false;
if(this.slots[2] == null) return true;
if(!this.slots[2].isItemEqual(itemstack)) return false;
int result = this.slots[2].stackSize + itemstack.stackSize;
return(result <= getInventoryStackLimit() && result <= itemstack.getMaxStackSize());
}
}
@Override
public boolean isItemValidForSlot(int i, ItemStack itemstack) {
return i == 2 ? false : (i == 1 ? isItemOil(itemstack) : true);
}
private boolean isItemOil(ItemStack itemstack) {
return getItemBurnTime(itemstack) > 0;
}
@Override
public int[] getAccessibleSlotsFromSide(int var1) {
return var1 == 0 ? slots_bottom : (var1 == 1 ? slots_top : slots_side);
}
@Override
public boolean canInsertItem(int i, ItemStack itemstack, int j) {
return this.isItemValidForSlot(i, itemstack);
}
@Override
public boolean canExtractItem(int i, ItemStack itemstack, int j) {
return j != 0 || i != 1 || itemstack.getItem() == Items.bucket;
}
}
And finally, the main class:
package k3.moremetals.mod;
import k3.moremetals.mod.armor.CopperArmor;
import k3.moremetals.mod.block.BlockCoppOre;
import k3.moremetals.mod.block.BlockCopper;
import k3.moremetals.mod.block.BlockOil;
import k3.moremetals.mod.block.BlockPlatOre;
import k3.moremetals.mod.block.BlockRefueler;
import k3.moremetals.mod.block.BlockVimbOre;
import k3.moremetals.mod.generation.MMOreGeneration;
import k3.moremetals.mod.handler.GuiHandler;
import k3.moremetals.mod.item.HatchetCopper;
import k3.moremetals.mod.item.HatchetIronBlackened;
import k3.moremetals.mod.item.HatchetPlatinum;
import k3.moremetals.mod.item.HoeCopper;
import k3.moremetals.mod.item.HoeIronBlackened;
import k3.moremetals.mod.item.HoePlatinum;
import k3.moremetals.mod.item.ItemBlackenedIronIngot;
import k3.moremetals.mod.item.ItemBlackenedIronRod;
import k3.moremetals.mod.item.ItemBucketOil;
import k3.moremetals.mod.item.ItemCopperIngot;
import k3.moremetals.mod.item.ItemIronRod;
import k3.moremetals.mod.item.ItemPlatChunk;
import k3.moremetals.mod.item.ItemVimbeeShard;
import k3.moremetals.mod.item.PickaxeCopper;
import k3.moremetals.mod.item.PickaxeIronBlackened;
import k3.moremetals.mod.item.PickaxePlatinum;
import k3.moremetals.mod.item.ShovelCopper;
import k3.moremetals.mod.item.ShovelIronBlackened;
import k3.moremetals.mod.item.ShovelPlatinum;
import k3.moremetals.mod.item.SwordCopper;
import k3.moremetals.mod.item.SwordIronBlackened;
import k3.moremetals.mod.item.SwordPlatinum;
import k3.moremetals.mod.tileentity.TileEntityRefueler;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidRegistry;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
@Mod(modid = MoreMetalsMod.modid, name = MoreMetalsMod.name, version = MoreMetalsMod.version)
public class MoreMetalsMod {
//Mod Info Stuffs
public static final String modid = "moremetals";
public static final String version = "1.0";
public static final String name = "More Metals!";
@Instance(modid)
public static MoreMetalsMod instance;
public static CreativeTabs moreMetalsTab = new CreativeTabs("moreMetalsStuff"){
public Item getTabIconItem() {
return Item.getItemFromBlock(orePlatinum);
}
};
public static CreativeTabs moreMetalsTools = new CreativeTabs("moreMetalsTools"){
public Item getTabIconItem() {
return swordPlatinum;
}
};
public static CreativeTabs moreMetalsArmor = new CreativeTabs("moreMetalsArmor"){
public Item getTabIconItem() {
return copperHelmet;
}
};
//Unique Armor IDs
public static int copperBootsID;
public static int copperLeggingsID;
public static int copperChestplateID;
public static int copperHelmetID;
public static int darkenedIronBootsID;
public static int darkenedIronLeggingsID;
public static int darkenedIronChestplateID;
public static int darkenedIronHelmetID;
public static int platinumBootsID;
public static int platinumLeggingsID;
public static int platinumChestplateID;
public static int platinumHelmetIDID;
//Materials
public static ToolMaterial materialPlatinum = EnumHelper.addToolMaterial("materialPlatinum", 5, 2300, 9.0F, 6.0F, 23);
public static ToolMaterial materialCopper = EnumHelper.addToolMaterial("materialCopper", 2, 211, 5.0F, 1.0F, 7);
public static ToolMaterial materialIronBlackened = EnumHelper.addToolMaterial("materialIronBlackened", 3, 800, 7.0F, 3.0F, 19);
public static ArmorMaterial armorMaterialCopper = EnumHelper.addArmorMaterial("armorMaterialCopper", 12, new int[] {2, 5, 4, 2}, 10);
//Machines
public static Block blockRefueler_Active;
public static Block blockRefueler_Idle;
//Ore Generation
public static MMOreGeneration PlatinumOreWorldGen = new MMOreGeneration();
//Blocks
public static Block orePlatinum;
public static Block oreCopper;
public static Block oreVimbee;
public static Block blockCopper;
public static Block blockOil;
//Gui Stuffs
public static final int guiIDRefueler = 0;
//Fluids
public static Fluid fluidOil = new Fluid("fluidOil");
//Items
public static Item chunkPlatinum;
public static Item rodIron;
public static Item rodIronBlackened;
public static Item ingotIronBlackened;
public static Item swordPlatinum;
public static Item hatchetPlatinum;
public static Item shovelPlatinum;
public static Item hoePlatinum;
public static Item pickaxePlatinum;
public static Item swordCopper;
public static Item hatchetCopper;
public static Item shovelCopper;
public static Item hoeCopper;
public static Item pickaxeCopper;
public static Item ingotCopper;
public static Item swordIronBlackened;
public static Item hatchetIronBlackened;
public static Item shovelIronBlackened;
public static Item hoeIronBlackened;
public static Item pickaxeIronBlackened;
public static Item jackhammer;
public static Item chainsaw;
public static Item shardVimbee;
//Armor
public static Item copperBoots;
public static Item copperLeggings;
public static Item copperChestplate;
public static Item copperHelmet;
//Bucket
public static Item bucketOil = new ItemBucketOil(blockOil);
@EventHandler
public void preInit(FMLPreInitializationEvent preevent){
//Register The Items
chunkPlatinum = new ItemPlatChunk().setUnlocalizedName("chunkPlatinum").setCreativeTab(MoreMetalsMod.moreMetalsTab);
GameRegistry.registerItem(chunkPlatinum, "chunkPlatinum");
rodIron = new ItemIronRod().setUnlocalizedName("rodIron").setCreativeTab(MoreMetalsMod.moreMetalsTab);
GameRegistry.registerItem(rodIron, "rodIron");
ingotIronBlackened = new ItemBlackenedIronIngot().setUnlocalizedName("ingotIronBlackened").setCreativeTab(MoreMetalsMod.moreMetalsTab);
GameRegistry.registerItem(ingotIronBlackened, "ingotIronBlackened");
rodIronBlackened = new ItemBlackenedIronRod().setUnlocalizedName("rodIronBlackened").setCreativeTab(MoreMetalsMod.moreMetalsTab);
GameRegistry.registerItem(rodIronBlackened, "rodIronBlackened");
ingotCopper = new ItemCopperIngot().setUnlocalizedName("ingotCopper").setCreativeTab(moreMetalsTab);
GameRegistry.registerItem(ingotCopper, "ingotCopper");
shardVimbee = new ItemVimbeeShard(2, 1.5F, true).setUnlocalizedName("shardVimbee").setCreativeTab(moreMetalsTab);
GameRegistry.registerItem(shardVimbee, "shardVimbee");
//Register The Armor
copperBoots = new CopperArmor(armorMaterialCopper, copperBootsID, 3).setUnlocalizedName("copperBoots").setCreativeTab(moreMetalsArmor);
GameRegistry.registerItem(copperBoots, "copperBoots");
copperLeggings = new CopperArmor(armorMaterialCopper, copperLeggingsID, 2).setUnlocalizedName("copperLeggings").setCreativeTab(moreMetalsArmor);
GameRegistry.registerItem(copperLeggings, "copperLeggings");
copperChestplate = new CopperArmor(armorMaterialCopper, copperChestplateID, 1).setUnlocalizedName("copperChestplate").setCreativeTab(moreMetalsArmor);
GameRegistry.registerItem(copperChestplate, "copperChestplate");
copperHelmet = new CopperArmor(armorMaterialCopper, copperHelmetID, 0).setUnlocalizedName("copperHelmet").setCreativeTab(moreMetalsArmor);
GameRegistry.registerItem(copperHelmet, "copperHelmet");
//Register The Tools
shovelPlatinum = new ShovelPlatinum(materialPlatinum).setUnlocalizedName("shovelPlatinum").setCreativeTab(MoreMetalsMod.moreMetalsTools);
GameRegistry.registerItem(shovelPlatinum, "shovelPlatinum");
swordPlatinum = new SwordPlatinum(materialPlatinum).setUnlocalizedName("swordPlatinum").setCreativeTab(MoreMetalsMod.moreMetalsTools);
GameRegistry.registerItem(swordPlatinum, "swordPlatinum");
hatchetPlatinum = new HatchetPlatinum(materialPlatinum).setUnlocalizedName("hatchetPlatinum").setCreativeTab(MoreMetalsMod.moreMetalsTools);
GameRegistry.registerItem(hatchetPlatinum, "hatchetPlatinum");
hoePlatinum = new HoePlatinum(materialPlatinum).setUnlocalizedName("hoePlatinum").setCreativeTab(MoreMetalsMod.moreMetalsTools);
GameRegistry.registerItem(hoePlatinum, "hoePlatinum");
pickaxePlatinum = new PickaxePlatinum(materialPlatinum).setUnlocalizedName("pickaxePlatinum").setCreativeTab(MoreMetalsMod.moreMetalsTools);
GameRegistry.registerItem(pickaxePlatinum, "pickaxePlatinum");
shovelCopper = new ShovelCopper(materialCopper).setUnlocalizedName("shovelCopper").setCreativeTab(MoreMetalsMod.moreMetalsTools);
GameRegistry.registerItem(shovelCopper, "shovelCopper");
swordCopper = new SwordCopper(materialCopper).setUnlocalizedName("swordCopper").setCreativeTab(MoreMetalsMod.moreMetalsTools);
GameRegistry.registerItem(swordCopper, "swordCopper");
hatchetCopper = new HatchetCopper(materialCopper).setUnlocalizedName("hatchetCopper").setCreativeTab(MoreMetalsMod.moreMetalsTools);
GameRegistry.registerItem(hatchetCopper, "hatchetCopper");
hoeCopper = new HoeCopper(materialCopper).setUnlocalizedName("hoeCopper").setCreativeTab(MoreMetalsMod.moreMetalsTools);
GameRegistry.registerItem(hoeCopper, "hoeCopper");
pickaxeCopper = new PickaxeCopper(materialCopper).setUnlocalizedName("pickaxeCopper").setCreativeTab(MoreMetalsMod.moreMetalsTools);
GameRegistry.registerItem(pickaxeCopper, "pickaxeCopper");
shovelIronBlackened = new ShovelIronBlackened(materialIronBlackened).setUnlocalizedName("shovelIronBlackened").setCreativeTab(MoreMetalsMod.moreMetalsTools);
GameRegistry.registerItem(shovelIronBlackened, "shovelIronBlackened");
swordIronBlackened = new SwordIronBlackened(materialIronBlackened).setUnlocalizedName("swordIronBlackened").setCreativeTab(MoreMetalsMod.moreMetalsTools);
GameRegistry.registerItem(swordIronBlackened, "swordIronBlackened");
hatchetIronBlackened = new HatchetIronBlackened(materialIronBlackened).setUnlocalizedName("hatchetIronBlackened").setCreativeTab(MoreMetalsMod.moreMetalsTools);
GameRegistry.registerItem(hatchetIronBlackened, "hatchetIronBlackened");
hoeIronBlackened = new HoeIronBlackened(materialIronBlackened).setUnlocalizedName("hoeIronBlackened").setCreativeTab(MoreMetalsMod.moreMetalsTools);
GameRegistry.registerItem(hoeIronBlackened, "hoeIronBlackened");
pickaxeIronBlackened = new PickaxeIronBlackened(materialIronBlackened).setUnlocalizedName("pickaxeIronBlackened").setCreativeTab(MoreMetalsMod.moreMetalsTools);
GameRegistry.registerItem(pickaxeIronBlackened, "pickaxeIronBlackened");
//Register World Generation
GameRegistry.registerWorldGenerator(PlatinumOreWorldGen, 1);
//Register The Fluids
FluidRegistry.registerFluid(fluidOil);
blockOil = new BlockOil(fluidOil, Material.water).setBlockName("fluidOil");
GameRegistry.registerBlock(blockOil, modid + "_" + blockOil.getUnlocalizedName().substring(5));
fluidOil.setUnlocalizedName(blockOil.getUnlocalizedName());
bucketOil.setUnlocalizedName("bucketOil").setContainerItem(Items.bucket);
GameRegistry.registerItem(bucketOil, "bucketOil");
FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("fluidoil", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketOil), new ItemStack(Items.bucket));
//Register The Blocks
orePlatinum = new BlockPlatOre().setBlockName("orePlatinum").setCreativeTab(MoreMetalsMod.moreMetalsTab);
GameRegistry.registerBlock(orePlatinum, "orePlatinum");
oreCopper = new BlockCoppOre().setBlockName("oreCopper").setCreativeTab(MoreMetalsMod.moreMetalsTab);
GameRegistry.registerBlock(oreCopper, "oreCopper");
oreVimbee = new BlockVimbOre().setBlockName("oreVimbee").setCreativeTab(MoreMetalsMod.moreMetalsTab);
GameRegistry.registerBlock(oreVimbee, "oreVimbee");
blockCopper = new BlockCopper().setBlockName("blockCopper").setCreativeTab(MoreMetalsMod.moreMetalsTab);
GameRegistry.registerBlock(blockCopper, "blockCopper");
//Register The Machines
blockRefueler_Idle = new BlockRefueler(false).setBlockName("blockRefueler_Idle").setCreativeTab(moreMetalsTab);
blockRefueler_Active = new BlockRefueler(true).setBlockName("blockRefueler_Active").setCreativeTab(moreMetalsTab);
GameRegistry.registerBlock(blockRefueler_Idle, "blockRefueler_Idle");
GameRegistry.registerBlock(blockRefueler_Active, "blockRefueler_Active");
//Register TileEntities
GameRegistry.registerTileEntity(TileEntityRefueler.class, "TileEntityRefueler");
//More Gui Stuffs
NetworkRegistry.INSTANCE.registerGuiHandler(this, new GuiHandler());
//Crafting Recipes
GameRegistry.addRecipe(new ItemStack(blockCopper, 1), new Object[]{"CCC","CCC","CCC",'C', ingotCopper});
GameRegistry.addRecipe(new ItemStack(hatchetPlatinum, 1), new Object[]{"PP","PR"," R",'P', chunkPlatinum, 'R', rodIronBlackened});
GameRegistry.addRecipe(new ItemStack(swordPlatinum, 1), new Object[]{"P","P","R",'P', chunkPlatinum, 'R', rodIronBlackened});
GameRegistry.addRecipe(new ItemStack(hoePlatinum, 1), new Object[]{"PP"," R"," R",'P', chunkPlatinum, 'R', rodIronBlackened});
GameRegistry.addRecipe(new ItemStack(shovelPlatinum, 1), new Object[]{"P","R","R",'P', chunkPlatinum, 'R', rodIronBlackened});
GameRegistry.addRecipe(new ItemStack(pickaxePlatinum, 1), new Object[]{"PPP"," R "," R ", 'P', chunkPlatinum, 'R', rodIronBlackened});
GameRegistry.addRecipe(new ItemStack(hatchetIronBlackened, 1), new Object[]{"II","IR"," R",'I', ingotIronBlackened, 'R', rodIron});
GameRegistry.addRecipe(new ItemStack(swordIronBlackened, 1), new Object[]{"I","I","R",'I', ingotIronBlackened, 'R', rodIron});
GameRegistry.addRecipe(new ItemStack(hoeIronBlackened, 1), new Object[]{"II"," R"," R",'I', ingotIronBlackened, 'R', rodIron});
GameRegistry.addRecipe(new ItemStack(shovelIronBlackened, 1), new Object[]{"I","R","R",'I', ingotIronBlackened, 'R', rodIron});
GameRegistry.addRecipe(new ItemStack(pickaxeIronBlackened, 1), new Object[]{"III"," R "," R ", 'I', ingotIronBlackened, 'R', rodIron});
GameRegistry.addRecipe(new ItemStack(hatchetCopper, 1), new Object[]{"CC","CS"," S",'C', ingotCopper, 'S', Items.stick});
GameRegistry.addRecipe(new ItemStack(swordCopper, 1), new Object[]{"C","C","S",'C', ingotCopper, 'S', Items.stick});
GameRegistry.addRecipe(new ItemStack(hoeCopper, 1), new Object[]{"CC"," S"," S",'C', ingotCopper, 'S', Items.stick});
GameRegistry.addRecipe(new ItemStack(shovelCopper, 1), new Object[]{" C"," S"," S",'C', ingotCopper, 'S', Items.stick});
GameRegistry.addRecipe(new ItemStack(pickaxeCopper, 1), new Object[]{"CCC"," S "," S ", 'C', ingotCopper, 'S', Items.stick});
GameRegistry.addRecipe(new ItemStack(rodIronBlackened, 4), new Object[]{"I", "I", 'I', ingotIronBlackened});
GameRegistry.addRecipe(new ItemStack(rodIron, 4), new Object[]{"I", "I", 'I', Items.iron_ingot});
GameRegistry.addRecipe(new ItemStack(copperBoots, 1), new Object[]{"C C", "C C", 'C', ingotCopper});
GameRegistry.addRecipe(new ItemStack(copperLeggings, 1), new Object[]{"CCC", "C C", "C C", 'C', ingotCopper});
GameRegistry.addRecipe(new ItemStack(copperChestplate, 1), new Object[]{"C C", "CCC", "CCC", 'C', ingotCopper});
GameRegistry.addRecipe(new ItemStack(copperHelmet, 1), new Object[]{"CCC", "C C", 'C', ingotCopper});
GameRegistry.addShapelessRecipe(new ItemStack(ingotIronBlackened, 1), new Object[] {new ItemStack(Items.iron_ingot, 1), new ItemStack(Items.coal, 1)});
//Smelting Recipes
GameRegistry.addSmelting(oreCopper, new ItemStack(ingotCopper), 2.50F);
}
}
I know that I'm not completely done, as I am following a tutorial and have not finished yet, but it should at least open without the texture, according to the tutorial.
Sorry about all the posts, I'm new to modding.
EDIT: Wow, I didn't set canInteractWith to true, I just did, but it still won't work