Jump to content

Making a new Material.


EliteCreature

Recommended Posts

This could be anything. (currently I am trying to make a new MaterialLiquid (i'd be fine with Material.water, save for the splash sound and flying blue particles, which seem to be controlled by the material....)

 

anyway, is this even possible? or is there a different way of doing this?

Link to comment
Share on other sites

Look at the sources in net.minecraftforge.fluids package. It has all the stuff you need for custom fluids and gases.

Link to comment
Share on other sites

With all due respect, The classes in the net.minecraftforge.fluid package do not contain any info on materials other than the basic registering of a material in the BlockFluid. (I just  looked through every single fluid class {as you requested} and failed to find anything that would help me.

 

(I currently have a forge fluid with Material.water. I would like to change this and make a new material)

 

@Sequituri: Though your answer was not what I was looking for, thank you for responding promptly  :)

Link to comment
Share on other sites

While I haven't done anything specifically with fluids, you should be able to just make a new Material.

 

Here's an example from one of my own blocks:

 

public class BlockPeg extends Block {
// two static material fields to hold my custom Materials
// these are both in my Block class, and I use them when I call the constructor from pre-init
public static final MaterialPeg pegWoodMaterial = new MaterialPeg(MapColor.woodColor);
public static final MaterialPeg pegRustyMaterial = new MaterialPeg(MapColor.ironColor);

// rest of the peg class

}

// nested class in my BlockPeg class, but it doesn't have to be:
class MaterialPeg extends Material {
public MaterialPeg(MapColor color) {
	super(color);
	setRequiresTool();
	setImmovableMobility();
	setAdventureModeExempt();
}
}

 

 

I imagine it would be just about exactly the same to make a new fluid Material.

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.

Announcements



×
×
  • Create New...

Important Information

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