Changed gutter to be stone

This commit is contained in:
Calclavia 2014-03-08 19:23:03 -08:00
parent 207610916d
commit 9b6d67a02b
4 changed files with 110 additions and 116 deletions

View file

@ -147,7 +147,7 @@ public class Archaic
GameRegistry.addRecipe(new ShapedOreRecipe(blockTurntable, "SSS", "PGP", "WWW", 'S', Block.stone, 'G', UniversalRecipe.MOTOR.get(), 'P', Block.pistonBase, 'W', "logWood")); GameRegistry.addRecipe(new ShapedOreRecipe(blockTurntable, "SSS", "PGP", "WWW", 'S', Block.stone, 'G', UniversalRecipe.MOTOR.get(), 'P', Block.pistonBase, 'W', "logWood"));
GameRegistry.addRecipe(new ShapedOreRecipe(blockCast, "I I", "IBI", "III", 'S', Item.ingotIron, 'B', Block.fenceIron)); GameRegistry.addRecipe(new ShapedOreRecipe(blockCast, "I I", "IBI", "III", 'S', Item.ingotIron, 'B', Block.fenceIron));
GameRegistry.addRecipe(new ShapedOreRecipe(blockGutter, "S S", "I I", "III", 'S', Item.stick, 'I', "plankWood")); GameRegistry.addRecipe(new ShapedOreRecipe(blockGutter, "S S", "I I", "III", 'S', Item.stick, 'I', Block.cobblestone));
GameRegistry.addRecipe(new ShapedOreRecipe(blockGrate, "WBW", "B B", "WBW", 'B', Block.fenceIron, 'W', "plankWood")); GameRegistry.addRecipe(new ShapedOreRecipe(blockGrate, "WBW", "B B", "WBW", 'B', Block.fenceIron, 'W', "plankWood"));
GameRegistry.addRecipe(new ShapedOreRecipe(blockHotPlate, "SSS", "III", 'I', Item.ingotIron, 'S', Block.stone)); GameRegistry.addRecipe(new ShapedOreRecipe(blockHotPlate, "SSS", "III", 'I', Item.ingotIron, 'S', Block.stone));
GameRegistry.addRecipe(new ShapedOreRecipe(blockMillstone, "SPS", "SAS", "SSS", 'P', Block.pistonBase, 'A', Item.pickaxeStone, 'S', Block.stone)); GameRegistry.addRecipe(new ShapedOreRecipe(blockMillstone, "SPS", "SAS", "SSS", 'P', Block.pistonBase, 'A', Item.pickaxeStone, 'S', Block.stone));

View file

@ -1,115 +0,0 @@
package resonantinduction.archaic.fluid.gutter;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTank;
import org.lwjgl.opengl.GL11;
import resonantinduction.archaic.fluid.tank.TileTank;
import resonantinduction.core.Reference;
import universalelectricity.api.vector.Vector3;
import calclavia.lib.render.FluidRenderUtility;
import calclavia.lib.render.RenderUtility;
import calclavia.lib.render.item.ISimpleItemRenderer;
import calclavia.lib.utility.FluidUtility;
import calclavia.lib.utility.WorldUtility;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderGutter extends TileEntitySpecialRenderer implements ISimpleItemRenderer
{
public static final RenderGutter INSTANCE = new RenderGutter();
public static final IModelCustom MODEL = AdvancedModelLoader.loadModel(Reference.MODEL_DIRECTORY + "gutter.tcn");
public static ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PATH + "gutter.png");
public static void render(int meta, byte sides)
{
RenderUtility.bind(TEXTURE);
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
{
if (dir != ForgeDirection.UP && dir != ForgeDirection.DOWN)
{
if (!WorldUtility.isEnabledSide(sides, dir))
{
GL11.glPushMatrix();
RenderUtility.rotateBlockBasedOnDirection(dir);
MODEL.renderOnly("left", "backCornerL", "frontCornerL");
GL11.glPopMatrix();
}
}
}
if (!WorldUtility.isEnabledSide(sides, ForgeDirection.DOWN))
{
MODEL.renderOnly("base");
}
else
{
GL11.glPushMatrix();
GL11.glRotatef(-90, 0, 0, 1);
MODEL.renderOnly("backCornerL", "frontCornerL");
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glRotatef(90, 0, 1, 0);
GL11.glRotatef(-90, 0, 0, 1);
MODEL.renderOnly("backCornerL", "frontCornerL");
GL11.glPopMatrix();
}
}
@Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f)
{
TileGutter tile = ((TileGutter) tileEntity);
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);
FluidStack liquid = tile.getInternalTank().getFluid();
int capacity = tile.getInternalTank().getCapacity();
byte renderSides = (tile instanceof TileGutter ? tile.renderSides : (byte) 0);
render(0, renderSides);
if (tileEntity.worldObj != null)
{
FluidTank tank = ((TileGutter) tileEntity).getInternalTank();
double percentageFilled = (double) tank.getFluidAmount() / (double) tank.getCapacity();
if (percentageFilled > 0.1)
{
GL11.glPushMatrix();
GL11.glScaled(0.95, 0.95, 0.95);
double ySouthEast = FluidUtility.getAveragePercentageFilledForSides(TileGutter.class, percentageFilled, tileEntity.worldObj, new Vector3(tileEntity), ForgeDirection.SOUTH, ForgeDirection.EAST);
double yNorthEast = FluidUtility.getAveragePercentageFilledForSides(TileGutter.class, percentageFilled, tileEntity.worldObj, new Vector3(tileEntity), ForgeDirection.NORTH, ForgeDirection.EAST);
double ySouthWest = FluidUtility.getAveragePercentageFilledForSides(TileGutter.class, percentageFilled, tileEntity.worldObj, new Vector3(tileEntity), ForgeDirection.SOUTH, ForgeDirection.WEST);
double yNorthWest = FluidUtility.getAveragePercentageFilledForSides(TileGutter.class, percentageFilled, tileEntity.worldObj, new Vector3(tileEntity), ForgeDirection.NORTH, ForgeDirection.WEST);
FluidRenderUtility.renderFluidTesselation(tank, ySouthEast, yNorthEast, ySouthWest, yNorthWest);
GL11.glPopMatrix();
}
}
GL11.glPopMatrix();
}
@Override
public void renderInventoryItem(ItemStack itemStack)
{
GL11.glPushMatrix();
GL11.glTranslated(0.5, 0.5, 0.5);
render(itemStack.getItemDamage(), Byte.parseByte("001100", 2));
GL11.glPopMatrix();
}
}

View file

@ -3,23 +3,36 @@ package resonantinduction.archaic.fluid.gutter;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom;
import net.minecraftforge.common.ForgeDirection; import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTank;
import net.minecraftforge.fluids.IFluidHandler; import net.minecraftforge.fluids.IFluidHandler;
import resonantinduction.archaic.fluid.grate.TileGrate; import resonantinduction.archaic.fluid.grate.TileGrate;
import resonantinduction.core.Reference;
import resonantinduction.core.ResonantInduction; import resonantinduction.core.ResonantInduction;
import resonantinduction.core.fluid.TilePressureNode; import resonantinduction.core.fluid.TilePressureNode;
import resonantinduction.core.grid.fluid.IPressureNodeProvider; import resonantinduction.core.grid.fluid.IPressureNodeProvider;
import resonantinduction.core.grid.fluid.PressureNode; import resonantinduction.core.grid.fluid.PressureNode;
import universalelectricity.api.vector.Vector3; import universalelectricity.api.vector.Vector3;
import calclavia.lib.content.module.TileRender;
import calclavia.lib.prefab.vector.Cuboid; import calclavia.lib.prefab.vector.Cuboid;
import calclavia.lib.render.FluidRenderUtility;
import calclavia.lib.render.RenderUtility;
import calclavia.lib.utility.FluidUtility; import calclavia.lib.utility.FluidUtility;
import calclavia.lib.utility.WorldUtility; import calclavia.lib.utility.WorldUtility;
@ -240,4 +253,100 @@ public class TileGutter extends TilePressureNode
return from != ForgeDirection.UP && !fluid.isGaseous(); return from != ForgeDirection.UP && !fluid.isGaseous();
} }
@SideOnly(Side.CLIENT)
@Override
protected TileRender newRenderer()
{
return new TileRender()
{
public final IModelCustom MODEL = AdvancedModelLoader.loadModel(Reference.MODEL_DIRECTORY + "gutter.tcn");
public final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PATH + "gutter.png");
@Override
public boolean renderStatic(Vector3 position)
{
return true;
}
@Override
public boolean renderDynamic(Vector3 position, boolean isItem, float frame)
{
GL11.glPushMatrix();
GL11.glTranslated(position.x + 0.5, position.y + 0.5, position.z + 0.5);
FluidStack liquid = getInternalTank().getFluid();
int capacity = getInternalTank().getCapacity();
render(0, renderSides);
if (world() != null)
{
FluidTank tank = getInternalTank();
double percentageFilled = (double) tank.getFluidAmount() / (double) tank.getCapacity();
if (percentageFilled > 0.1)
{
GL11.glPushMatrix();
GL11.glScaled(0.990, 0.99, 0.990);
double ySouthEast = FluidUtility.getAveragePercentageFilledForSides(TileGutter.class, percentageFilled, world(), position(), ForgeDirection.SOUTH, ForgeDirection.EAST);
double yNorthEast = FluidUtility.getAveragePercentageFilledForSides(TileGutter.class, percentageFilled, world(), position(), ForgeDirection.NORTH, ForgeDirection.EAST);
double ySouthWest = FluidUtility.getAveragePercentageFilledForSides(TileGutter.class, percentageFilled, world(), position(), ForgeDirection.SOUTH, ForgeDirection.WEST);
double yNorthWest = FluidUtility.getAveragePercentageFilledForSides(TileGutter.class, percentageFilled, world(), position(), ForgeDirection.NORTH, ForgeDirection.WEST);
FluidRenderUtility.renderFluidTesselation(tank, ySouthEast, yNorthEast, ySouthWest, yNorthWest);
GL11.glPopMatrix();
}
}
GL11.glPopMatrix();
return true;
}
@Override
public boolean renderItem(ItemStack itemStack)
{
GL11.glTranslated(0.5, 0.5, 0.5);
render(itemStack.getItemDamage(), Byte.parseByte("001100", 2));
return true;
}
public void render(int meta, byte sides)
{
RenderUtility.bind(TEXTURE);
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
{
if (dir != ForgeDirection.UP && dir != ForgeDirection.DOWN)
{
if (!WorldUtility.isEnabledSide(sides, dir))
{
GL11.glPushMatrix();
RenderUtility.rotateBlockBasedOnDirection(dir);
MODEL.renderOnly("left", "backCornerL", "frontCornerL");
GL11.glPopMatrix();
}
}
}
if (!WorldUtility.isEnabledSide(sides, ForgeDirection.DOWN))
{
MODEL.renderOnly("base");
}
else
{
GL11.glPushMatrix();
GL11.glRotatef(-90, 0, 0, 1);
MODEL.renderOnly("backCornerL", "frontCornerL");
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glRotatef(90, 0, 1, 0);
GL11.glRotatef(-90, 0, 0, 1);
MODEL.renderOnly("backCornerL", "frontCornerL");
GL11.glPopMatrix();
}
}
};
}
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB