Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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) };
}
}

flowing liquid block needs to be one ID lower than the still block (or vice versa, I forget, search for liquid on the forum)

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)) };
}

 

 

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.