Added fluid renderer.

This commit is contained in:
RainWarrior committed 2015-06-18 14:26:53 +03:00
1 parent f59b0a2932
commit 07038f8342
13 files changed
+773 -387

No files matched your search

@@ -8,6 +8,7 @@ import com.google.common.collect.Maps;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.BlockPos;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeModContainer;
@@ -41,10 +42,18 @@ public class Fluid
/** The unlocalized name of this fluid. */
protected String unlocalizedName;
/** The Icons for this fluid. */
/**
* The Icons for this fluid.
* @deprecated use ResourceLocation-based ones instead.
*/
@Deprecated
protected TextureAtlasSprite stillIcon;
@Deprecated
protected TextureAtlasSprite flowingIcon;
protected final ResourceLocation still;
protected final ResourceLocation flowing;
/**
* The light level emitted by this fluid.
*
@@ -103,10 +112,21 @@ public class Fluid
*/
protected Block block = null;
/**
* @deprecated use the constructor with texture locations.
*/
@Deprecated
public Fluid(String fluidName)
{
this(fluidName, null, null);
}
public Fluid(String fluidName, ResourceLocation still, ResourceLocation flowing)
{
this.fluidName = fluidName.toLowerCase(Locale.ENGLISH);
this.unlocalizedName = fluidName;
this.still = still;
this.flowing = flowing;
}
public Fluid setUnlocalizedName(String unlocalizedName)
@@ -260,39 +280,55 @@ public class Fluid
public int getColor()
{
return 0xFFFFFF;
return 0xFFFFFFFF;
}
public ResourceLocation getStill()
{
return still;
}
public ResourceLocation getFlowing()
{
return flowing;
}
@Deprecated
public final Fluid setStillIcon(TextureAtlasSprite stillIcon)
{
this.stillIcon = stillIcon;
return this;
}
@Deprecated
public final Fluid setFlowingIcon(TextureAtlasSprite flowingIcon)
{
this.flowingIcon = flowingIcon;
return this;
}
@Deprecated
public final Fluid setIcons(TextureAtlasSprite stillIcon, TextureAtlasSprite flowingIcon)
{
return this.setStillIcon(stillIcon).setFlowingIcon(flowingIcon);
}
@Deprecated
public final Fluid setIcons(TextureAtlasSprite commonIcon)
{
return this.setStillIcon(commonIcon).setFlowingIcon(commonIcon);
}
@Deprecated
public TextureAtlasSprite getIcon(){ return getStillIcon(); }
@Deprecated
public TextureAtlasSprite getStillIcon()
{
return this.stillIcon;
}
@Deprecated
public TextureAtlasSprite getFlowingIcon()
{
return this.flowingIcon;
@@ -306,7 +342,11 @@ public class Fluid
public boolean isGaseous(FluidStack stack){ return isGaseous(); }
public EnumRarity getRarity(FluidStack stack){ return getRarity(); }
public int getColor(FluidStack stack){ return getColor(); }
@Deprecated
public TextureAtlasSprite getIcon(FluidStack stack){ return getIcon(); }
public ResourceLocation getStill(FluidStack stack) { return getStill(); }
public ResourceLocation getFlowing(FluidStack stack) { return getFlowing(); }
/* World-based Accessors */
public int getLuminosity(World world, BlockPos pos){ return getLuminosity(); }
public int getDensity(World world, BlockPos pos){ return getDensity(); }
@@ -315,6 +355,9 @@ public class Fluid
public boolean isGaseous(World world, BlockPos pos){ return isGaseous(); }
public EnumRarity getRarity(World world, BlockPos pos){ return getRarity(); }
public int getColor(World world, BlockPos pos){ return getColor(); }
@Deprecated
public TextureAtlasSprite getIcon(World world, BlockPos pos){ return getIcon(); }
public ResourceLocation getStill(World world, BlockPos pos) { return getStill(); }
public ResourceLocation getFlowing(World world, BlockPos pos) { return getFlowing(); }
}