Added sorter, not working yet

This commit is contained in:
Calclavia 2014-03-03 20:52:34 +08:00
parent 4c1188daee
commit 56c75b56dd
9 changed files with 70 additions and 55 deletions

View file

@ -1,8 +1,6 @@
package resonantinduction.electrical.armbot;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.texture.TextureManager;
@ -13,20 +11,19 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.IBlockAccess;
import org.lwjgl.opengl.GL11;
import resonantinduction.core.Reference;
import universalelectricity.api.vector.Vector3;
import calclavia.lib.render.RenderUtility;
import calclavia.lib.render.block.ICustomBlockRenderer;
import calclavia.lib.render.item.ISimpleItemRenderer;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderArmbot extends TileEntitySpecialRenderer implements ICustomBlockRenderer
public class RenderArmbot extends TileEntitySpecialRenderer implements ISimpleItemRenderer
{
public static final ModelArmbot MODEL = new ModelArmbot();
public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PATH + "armbot.png");
@ -86,19 +83,7 @@ public class RenderArmbot extends TileEntitySpecialRenderer implements ICustomBl
}
@Override
public void renderInventory(Block block, int metadata, int modelID, RenderBlocks renderer)
{
}
@Override
public boolean renderStatic(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer)
{
return false;
}
@Override
public void renderDynamic(TileEntity tile, Block block, int metadata, int modelID, RenderBlocks renderer)
public void renderInventoryItem(ItemStack itemStack)
{
GL11.glPushMatrix();
FMLClientHandler.instance().getClient().renderEngine.bindTexture(RenderArmbot.TEXTURE);

View file

@ -3,6 +3,7 @@ package resonantinduction.electrical.generator;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.IBlockAccess;
@ -14,13 +15,13 @@ import org.lwjgl.opengl.GL11;
import resonantinduction.core.Reference;
import calclavia.lib.render.RenderUtility;
import calclavia.lib.render.block.ICustomBlockRenderer;
import calclavia.lib.render.item.ISimpleItemRenderer;
/**
* @author Calclavia
*
*/
public class RenderGenerator extends TileEntitySpecialRenderer implements ICustomBlockRenderer
public class RenderGenerator extends TileEntitySpecialRenderer implements ISimpleItemRenderer
{
public static final IModelCustom MODEL = AdvancedModelLoader.loadModel(Reference.MODEL_DIRECTORY + "generator.tcn");
public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PATH + "generator.png");
@ -28,10 +29,10 @@ public class RenderGenerator extends TileEntitySpecialRenderer implements ICusto
@Override
public void renderTileEntityAt(TileEntity t, double x, double y, double z, float f)
{
doRender(t, t.getBlockMetadata(), x, y, z, f);
doRender(t.getBlockMetadata(), x, y, z, f);
}
private void doRender(TileEntity t, int facingDirection, double x, double y, double z, float f)
private void doRender(int facingDirection, double x, double y, double z, float f)
{
GL11.glPushMatrix();
GL11.glTranslatef((float) x + 0.5f, (float) y + 0.5f, (float) z + 0.5f);
@ -43,19 +44,8 @@ public class RenderGenerator extends TileEntitySpecialRenderer implements ICusto
}
@Override
public void renderInventory(Block block, int metadata, int modelID, RenderBlocks renderer)
public void renderInventoryItem(ItemStack itemStack)
{
}
@Override
public boolean renderStatic(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer)
{
return false;
}
@Override
public void renderDynamic(TileEntity tile, Block block, int metadata, int modelID, RenderBlocks renderer)
{
doRender(tile, 2, 0, 0, 0, 0);
doRender(2, 0, 0, 0, 0);
}
}

View file

@ -31,6 +31,7 @@ import resonantinduction.mechanical.logistic.belt.BlockRejector;
import resonantinduction.mechanical.logistic.belt.TileDetector;
import resonantinduction.mechanical.logistic.belt.TileManipulator;
import resonantinduction.mechanical.logistic.belt.TileRejector;
import resonantinduction.mechanical.logistic.belt.TileSorter;
import resonantinduction.mechanical.process.crusher.BlockMechanicalPiston;
import resonantinduction.mechanical.process.crusher.TileMechanicalPiston;
import resonantinduction.mechanical.process.grinder.BlockGrindingWheel;
@ -90,6 +91,7 @@ public class Mechanical
public static Block blockManipulator;
public static Block blockDetector;
public static Block blockRejector;
public static Block blockSorter;
// Fluids
public static Block blockReleaseValve;
@ -120,7 +122,8 @@ public class Mechanical
blockConveyorBelt = contentRegistry.createTile(BlockConveyorBelt.class, TileConveyorBelt.class);
blockManipulator = contentRegistry.createTile(BlockManipulator.class, TileManipulator.class);
blockDetector = contentRegistry.createTile(BlockDetector.class, TileDetector.class);
blockRejector = contentRegistry.createTile(BlockRejector.class, TileRejector.class);
//blockRejector = contentRegistry.createTile(BlockRejector.class, TileRejector.class);
blockRejector = contentRegistry.newBlock(TileSorter.class);
blockPump = contentRegistry.createTile(BlockPump.class, TilePump.class);

View file

@ -1,23 +1,21 @@
package resonantinduction.mechanical.belt;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.IBlockAccess;
import org.lwjgl.opengl.GL11;
import resonantinduction.core.Reference;
import resonantinduction.mechanical.belt.TileConveyorBelt.SlantType;
import calclavia.lib.render.block.ICustomBlockRenderer;
import calclavia.lib.render.item.ISimpleItemRenderer;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderConveyorBelt extends TileEntitySpecialRenderer implements ICustomBlockRenderer
public class RenderConveyorBelt extends TileEntitySpecialRenderer implements ISimpleItemRenderer
{
public static final ModelConveyorBelt MODEL = new ModelConveyorBelt();
public static final ModelAngledBelt MODEL2 = new ModelAngledBelt();
@ -134,19 +132,7 @@ public class RenderConveyorBelt extends TileEntitySpecialRenderer implements ICu
}
@Override
public void renderInventory(Block block, int metadata, int modelID, RenderBlocks renderer)
{
}
@Override
public boolean renderStatic(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer)
{
return false;
}
@Override
public void renderDynamic(TileEntity tile, Block block, int metadata, int modelID, RenderBlocks renderer)
public void renderInventoryItem(ItemStack itemStack)
{
GL11.glPushMatrix();
GL11.glTranslatef(0.5f, 1.7F, 0.5f);

View file

@ -0,0 +1,50 @@
package resonantinduction.mechanical.logistic.belt;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom;
import org.lwjgl.opengl.GL11;
import resonantinduction.core.Reference;
import universalelectricity.api.UniversalElectricity;
import universalelectricity.api.vector.Vector3;
import calclavia.lib.content.module.TileBase;
import calclavia.lib.content.module.TileRender;
import calclavia.lib.render.RenderUtility;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class TileSorter extends TileBase
{
public TileSorter()
{
super(UniversalElectricity.machine);
textureName = "material_metal_side";
normalRender = false;
isOpaqueCube = false;
}
@SideOnly(Side.CLIENT)
protected TileRender renderer()
{System.out.println("TEST");
return new TileRender()
{
final IModelCustom MODEL = AdvancedModelLoader.loadModel(Reference.MODEL_DIRECTORY + "sorter.tcn");
final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PATH + "sorter.png");
@Override
public void renderDynamic(Vector3 position, float frame)
{
GL11.glPushMatrix();
RenderUtility.enableBlending();
GL11.glTranslated(position.x + 0.5, position.y + 0.5, position.z + 0.5);
RenderUtility.bind(TEXTURE);
MODEL.renderAll();
RenderUtility.disableBlending();
GL11.glPopMatrix();
}
};
}
}

View file

@ -52,7 +52,7 @@ public class RenderMixer extends TileEntitySpecialRenderer implements ISimpleIte
{
glPushMatrix();
GL11.glScalef(0.5f, 0.5f, 0.5f);
glTranslatef(0.5F, 0.5f, 1.5F);
glTranslatef(0.5F, 0.5f, 0.5f);
RenderUtility.bind(TEXTURE);
MODEL.renderAll();
glPopMatrix();

View file

@ -98,6 +98,7 @@ tile.resonantinduction\:detector.name=Detector
tile.resonantinduction\:detector.tooltip=Outputs a Redstone signal upon item detection. Configure to invert imprint filter.
tile.resonantinduction\:manipulator.name=Manipulator
tile.resonantinduction\:rejector.name=Rejector
tile.resonantinduction\:sorter.name=Sorter
# Fluid pipes
item.resonantinduction\:pipeGauge.name=Pipe Gauge

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB