Jump to content

[Liquid] Crash + Not flowing?


Lordmau5

Recommended Posts

I have made a custom liquid, but:

 

- When I place the flowing one down, the game crashes

- When I place the still one down, it doesn't flow, but when i change the block underneath it, the game crashes

 

Error log:

http://pastebin.com/g3aFB9KW

 

BlockStill:

package TreviModdingCrew.LiquidEnergy.block;

import TreviModdingCrew.LiquidEnergy.Main;
import net.minecraft.block.BlockStationary;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.util.Icon;
import net.minecraftforge.liquids.ILiquid;

public class BlockEnergyLiquid_Still extends BlockStationary implements ILiquid
{
private String name;

public BlockEnergyLiquid_Still(int par1, String name)
{
	super(par1, Material.water);
    this.setHardness(100F);
    this.setLightOpacity(3);
    this.setCreativeTab(Main.liqEne_Tab);
    this.name = name;
    this.setUnlocalizedName(name);
    this.setTickRandomly(true);
}

@Override
public int getRenderType()
{
	return 4;
}

@Override
public int stillLiquidId()
{
	return this.blockID;
}

@Override
public boolean isMetaSensitive()
{
	return false;
}

@Override
public int stillLiquidMeta()
{
	return 0;
}

@Override
public void registerIcons(IconRegister iconReg)
{
	System.out.println(Main.modid + ":" + this.getUnlocalizedName());
    this.theIcon = new Icon[] { iconReg.registerIcon(Main.modid + ":" + this.name.substring(0, 12)), iconReg.registerIcon(Main.modid + ":" + this.name.substring(0, 12)) };
}
}

 

BlockFlowing:

package TreviModdingCrew.LiquidEnergy.block;

import net.minecraft.block.BlockFlowing;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.util.Icon;
import net.minecraftforge.liquids.ILiquid;
import TreviModdingCrew.LiquidEnergy.Main;

public class BlockEnergyLiquid_Flowing extends BlockFlowing implements ILiquid
{
private String name;

public BlockEnergyLiquid_Flowing(int par1, String name)
{
	super(par1, Material.water);
    this.setHardness(100F);
    this.setLightOpacity(3);
    this.setCreativeTab(Main.liqEne_Tab);
    this.name = name;
    this.setUnlocalizedName(name);
    this.setTickRandomly(true);
}

@Override
public int getRenderType()
{
	return 4;
}

@Override
public int stillLiquidId()
{
	return Main.energyLiquid_Still.blockID;
}

@Override
public boolean isMetaSensitive()
{
	return false;
}

@Override
public int stillLiquidMeta()
{
	return 0;
}

@Override
public void registerIcons(IconRegister iconReg)
{
	System.out.println(Main.modid + ":" + this.getUnlocalizedName());
    this.theIcon = new Icon[] { iconReg.registerIcon(Main.modid + ":" + this.name.substring(0, 12)), iconReg.registerIcon(Main.modid + ":" + this.name) };
}
}

Link to comment
Share on other sites

the flowing block id has to be one lower than the still id, also when you do

 public void registerIcons(IconRegister iconReg)
{
  System.out.println(Main.modid + ":" + this.getUnlocalizedName());
     this.theIcon = new Icon[] { iconReg.registerIcon(Main.modid + ":" + this.name.substring(0, 12)), iconReg.registerIcon(Main.modid + ":" + this.name.substring(0, 12)) };
}

change it to

 public void registerIcons(IconRegister iconReg)
{
  System.out.println(Main.modid + ":" + this.getUnlocalizedName());
     this.theIcon = new Icon[] { iconReg.registerIcon(Main.modid + ":" + this.name.substring(5)), iconReg.registerIcon(Main.modid + ":" + this.name.substring(5)) };
}

 

 

Link to comment
Share on other sites

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.



×
×
  • Create New...

Important Information

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