Jump to content

Recommended Posts

Posted

Hello,

 

I have maked a liquid and i hava a problem. i can´t make a bucket for this. I try the vanila src and this wars a fail.

 

The Src code of the Liquid

 

package hoones;

import net.minecraft.block.Block;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;
import net.minecraft.block.material.MaterialLiquid;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.liquids.LiquidContainerData;
import net.minecraftforge.liquids.LiquidContainerRegistry;
import net.minecraftforge.liquids.LiquidDictionary;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Mod.PostInit;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;


@Mod(modid = "nether", name = "Nether Water", version = "1.0.0")
@NetworkMod(clientSideRequired = true, serverSideRequired = true)
public class main {

@Instance("")
public static main instance;
public static Fluid fluid;
public static Block f;
public static int fBlockID = 2000;
public static Material m;

@PreInit
public void preInit(FMLPreInitializationEvent event) {
	fluid = new hoones.fluid();
}

@Init
public void init(FMLInitializationEvent event) {
	m = new MaterialLiquid(MapColor.grassColor);
	f = new f(fBlockID).setCreativeTab(CreativeTabs.tabBlock).setUnlocalizedName("f");
	LanguageRegistry.addName(f, "Nether Water");


}

//@PostInit
//public static void postInit(FMLPostInitializationEvent event) {


//}
}

 

and the Liquid src

package hoones;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.fluids.BlockFluidClassic;

public class f extends BlockFluidClassic {
public f(int Id) {
super(Id, main.fluid, main.m);
main.fluid.setBlockID(main.fBlockID); // Set the fluids block ID to this block.
}

// Use Register Icon as usual to get the block's icon.
// If you want you can reuse the water texture and change the color of it by doing as I have below:
@Override
@SideOnly(Side.CLIENT)
public Icon getIcon(int side, int meta) {
return Block.waterMoving.getIcon(side, meta);
}

@Override
public int colorMultiplier(IBlockAccess iblockaccess, int x, int y, int z)
{
return 0x990066; // HEX color code as indicated by the 0x infront. This is a greenish color.
}
}

 

thanks for help

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.