Hi, I followed a tut on youtube and made a fluid but when I run minecraft it crashes. crash report = http://pastebin.com/A5SyXJri It only seems to crash when I add: blockFluidFroyo = new BlockFluidFroyo(idFluidFroyo).setUnlocalizedName("fluid_froyo");
NOTE: I changed the idFluidFroyo down to 1000 and it didn't crash but the fluid/block was not in minecraft and wasn't there.
This is from my main class:
public static Block blockFluidFroyo;
public static Fluid fluidFroyo;
public static Material materialFluidFroyo;
public static final int idFluidFroyo = 1678;@EventHandler public void preload(FMLPreInitializationEvent event){fluidFroyo = new Fluid("fluid").setBlockID(idFluidFroyo);
FluidRegistry.registerFluid(fluidFroyo);
materialFluidFroyo = new MaterialLiquid(MapColor.clothColor);
blockFluidFroyo = new BlockFluidFroyo(idFluidFroyo).setTextureName("petco:froyoplain");
GameRegistry.registerBlock(blockFluidFroyo, "Fluid Froyo");}
Are you trying to integrate with NEI? Maybe there's an ID already used, check this.
I am assuming that you are meaning the crash report. I have changed the block ID to 1000 and it does not crash, but it also does not show up anywhere. The ID 1000 is also not being used on any other mods that are installed in eclipse.
On last line you have registerBlock but I don't see it using GameRegistry.
I also noticed the block was not set in creative tabs using setCreativeTab. Also did you try ingame cheats /give playerName modItemId or whatever it is?
I changed the registerBlock to GameRegistry.registerBlock and it now appears! But now ingame it is called tile.fluid_froyo.name. Even though there is a registerBlock with a proper name, that line registers the block, but does not use that name. Removing the .setUnlocalizedName just changed the ingame name to tile.null.name so that doesn't fix it.
I have updated the src code above in first post, also I did register it to a creative tab, in it's seperate class file.
EDIT: the spoilers in the main post wont let me press enter so you shall have to imagine.
Instead, use the unlocalized name you set like this: GameRegistry.registerBlock(blockFluidFroyo, blockFluidFroyo.getUnlocalizedName().substring(5));
Now, you will want to go to your assets folder, and make a new folder called lang. Inside here, create a text document and call it en_US.lang (and then save it as a .lang and not a .txt) then go back to Eclipse and you should be able to open this.
In this file is where you do all your block and fluid names. So you say
tile.fluid_froyo.name=Froyo Fluid
(note if your unlocalizedName is different than this set it to tile.whateverYouCalledIt.name=Froyo Fluid)
By default this method does not work in 1.6.4 but can be achieved with some extra work otherwise just use "LanguageRegistry.whateverMethod(unlocalizedName, localizedName)"
Ok, I fixed the problem with the name, by making a lang file. But now I want to add these two and a few other fluids when I make them under one ID and maybe the buckets under another so that there is not like about 20 IDs and 10 for the buckets? If you guys know how to do this I would appreciate any help and thank you for the current help.
From Main Class:
public static Block blockFluidFroyo; public static Fluid fluidFroyo; public static Material materialFluidFroyo; public static final int idFluidFroyo = 1678;
public static Block blockFluidFroyoSB; public static Fluid fluidFroyoSB; public static Material materialFluidFroyoSB; public static final int idFluidFroyoSB = 1679;@EventHandler public void preload(FMLPreInitializationEvent event){
fluidFroyo = new Fluid("fluid").setBlockID(idFluidFroyo); FluidRegistry.registerFluid(fluidFroyo); materialFluidFroyo = new MaterialLiquid(MapColor.clothColor); blockFluidFroyo = new BlockFluidFroyo(idFluidFroyo).setUnlocalizedName("fluid_froyo").setTextureName("petco:froyoplain"); GameRegistry.registerBlock(blockFluidFroyo, "Fluid Froyo"); fluidFroyoSB = new Fluid("fluidSB").setBlockID(idFluidFroyoSB); FluidRegistry.registerFluid(fluidFroyoSB); materialFluidFroyoSB = new MaterialLiquid(MapColor.clothColor); blockFluidFroyoSB = new BlockFluidFroyoSB(idFluidFroyoSB).setUnlocalizedName("fluid_froyoSB").setTextureName("petco:froyoSB"); GameRegistry.registerBlock(blockFluidFroyoSB, "Fluid FroyoSB");}
public class BlockFluidFroyoSB extends BlockFluidClassic{
public BlockFluidFroyoSB(int id) { super(id, petco.fluidFroyoSB, petco.materialFluidFroyoSB); this.setCreativeTab(petco.TabPetCo); }
}
EDIT: Got the two fluids under one material but they still aren't under the same ID and is it different than making a standard metadata block as it registers the fluid and a block but then ends up as the same thing?
Hi, I followed a tut on youtube and made a fluid but when I run minecraft it crashes. crash report = http://pastebin.com/A5SyXJri It only seems to crash when I add: blockFluidFroyo = new BlockFluidFroyo(idFluidFroyo).setUnlocalizedName("fluid_froyo");
NOTE: I changed the idFluidFroyo down to 1000 and it didn't crash but the fluid/block was not in minecraft and wasn't there.
This is from my main class:
public static Fluid fluidFroyo;
public static Material materialFluidFroyo;
public static final int idFluidFroyo = 1678;@EventHandler public void preload(FMLPreInitializationEvent event){fluidFroyo = new Fluid("fluid").setBlockID(idFluidFroyo);
FluidRegistry.registerFluid(fluidFroyo);
materialFluidFroyo = new MaterialLiquid(MapColor.clothColor);
blockFluidFroyo = new BlockFluidFroyo(idFluidFroyo).setTextureName("petco:froyoplain");
GameRegistry.registerBlock(blockFluidFroyo, "Fluid Froyo");}
And from the blockfluidfroyo class:
import net.minecraft.block.material.Material;
import net.minecraftforge.fluids.BlockFluidClassic;
import net.minecraftforge.fluids.Fluid;
public class BlockFluidFroyo extends BlockFluidClassic{
public BlockFluidFroyo(int id) {
super(id, petco.fluidFroyo, petco.materialFluidFroyo);
// TODO Auto-generated constructor stub
this.setCreativeTab(petco.TabPetCo);
}
}
anyone?
You need to register the block first, then the fluid. Also, don't forget to lower your block id, if you haven't already.EDIT: Please disregard me.
I am assuming that you are meaning the crash report. I have changed the block ID to 1000 and it does not crash, but it also does not show up anywhere. The ID 1000 is also not being used on any other mods that are installed in eclipse.
I changed the registerBlock to GameRegistry.registerBlock and it now appears! But now ingame it is called tile.fluid_froyo.name. Even though there is a registerBlock with a proper name, that line registers the block, but does not use that name. Removing the .setUnlocalizedName just changed the ingame name to tile.null.name so that doesn't fix it.
I have updated the src code above in first post, also I did register it to a creative tab, in it's seperate class file.
EDIT: the spoilers in the main post wont let me press enter so you shall have to imagine.
By default this method does not work in 1.6.4 but can be achieved with some extra work otherwise just use "LanguageRegistry.whateverMethod(unlocalizedName, localizedName)"
The OP is using 1.6.4 as the tag says so the IDs are not automatic
Ok, I fixed the problem with the name, by making a lang file. But now I want to add these two and a few other fluids when I make them under one ID and maybe the buckets under another so that there is not like about 20 IDs and 10 for the buckets? If you guys know how to do this I would appreciate any help and thank you for the current help.
From Main Class:
public static Block blockFluidFroyo; public static Fluid fluidFroyo; public static Material materialFluidFroyo; public static final int idFluidFroyo = 1678;
public static Block blockFluidFroyoSB; public static Fluid fluidFroyoSB; public static Material materialFluidFroyoSB; public static final int idFluidFroyoSB = 1679;@EventHandler public void preload(FMLPreInitializationEvent event){
fluidFroyo = new Fluid("fluid").setBlockID(idFluidFroyo); FluidRegistry.registerFluid(fluidFroyo); materialFluidFroyo = new MaterialLiquid(MapColor.clothColor); blockFluidFroyo = new BlockFluidFroyo(idFluidFroyo).setUnlocalizedName("fluid_froyo").setTextureName("petco:froyoplain"); GameRegistry.registerBlock(blockFluidFroyo, "Fluid Froyo"); fluidFroyoSB = new Fluid("fluidSB").setBlockID(idFluidFroyoSB); FluidRegistry.registerFluid(fluidFroyoSB); materialFluidFroyoSB = new MaterialLiquid(MapColor.clothColor); blockFluidFroyoSB = new BlockFluidFroyoSB(idFluidFroyoSB).setUnlocalizedName("fluid_froyoSB").setTextureName("petco:froyoSB"); GameRegistry.registerBlock(blockFluidFroyoSB, "Fluid FroyoSB");}
The plain froyo class:
package petco.mod.fluid;
import petco.mod.core.petco; import net.minecraft.block.material.Material; import net.minecraftforge.fluids.BlockFluidClassic; import net.minecraftforge.fluids.Fluid;
public class BlockFluidFroyo extends BlockFluidClassic{
public BlockFluidFroyo(int id) { super(id, petco.fluidFroyo, petco.materialFluidFroyo); this.setCreativeTab(petco.TabPetCo); }
}
The other froyo class:
package petco.mod.fluid;
import petco.mod.core.petco; import net.minecraft.block.material.Material; import net.minecraftforge.fluids.BlockFluidClassic; import net.minecraftforge.fluids.Fluid;
public class BlockFluidFroyoSB extends BlockFluidClassic{
public BlockFluidFroyoSB(int id) { super(id, petco.fluidFroyoSB, petco.materialFluidFroyoSB); this.setCreativeTab(petco.TabPetCo); }
}
EDIT: Got the two fluids under one material but they still aren't under the same ID and is it different than making a standard metadata block as it registers the fluid and a block but then ends up as the same thing?