diff --git a/electrical/src/main/java/resonantinduction/electrical/armbot/RenderArmbot.java b/electrical/src/main/java/resonantinduction/electrical/armbot/RenderArmbot.java index e94253181..6f1695ef1 100644 --- a/electrical/src/main/java/resonantinduction/electrical/armbot/RenderArmbot.java +++ b/electrical/src/main/java/resonantinduction/electrical/armbot/RenderArmbot.java @@ -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); diff --git a/electrical/src/main/java/resonantinduction/electrical/generator/RenderGenerator.java b/electrical/src/main/java/resonantinduction/electrical/generator/RenderGenerator.java index d97376269..1d1a52b46 100644 --- a/electrical/src/main/java/resonantinduction/electrical/generator/RenderGenerator.java +++ b/electrical/src/main/java/resonantinduction/electrical/generator/RenderGenerator.java @@ -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); } } diff --git a/mechanical/src/main/java/resonantinduction/mechanical/Mechanical.java b/mechanical/src/main/java/resonantinduction/mechanical/Mechanical.java index b5f304940..0a7acf69d 100644 --- a/mechanical/src/main/java/resonantinduction/mechanical/Mechanical.java +++ b/mechanical/src/main/java/resonantinduction/mechanical/Mechanical.java @@ -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); diff --git a/mechanical/src/main/java/resonantinduction/mechanical/belt/RenderConveyorBelt.java b/mechanical/src/main/java/resonantinduction/mechanical/belt/RenderConveyorBelt.java index dd40b9e22..585ce39bf 100644 --- a/mechanical/src/main/java/resonantinduction/mechanical/belt/RenderConveyorBelt.java +++ b/mechanical/src/main/java/resonantinduction/mechanical/belt/RenderConveyorBelt.java @@ -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); diff --git a/mechanical/src/main/java/resonantinduction/mechanical/logistic/belt/TileSorter.java b/mechanical/src/main/java/resonantinduction/mechanical/logistic/belt/TileSorter.java new file mode 100644 index 000000000..de0e115fa --- /dev/null +++ b/mechanical/src/main/java/resonantinduction/mechanical/logistic/belt/TileSorter.java @@ -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(); + } + + }; + } +} diff --git a/mechanical/src/main/java/resonantinduction/mechanical/process/purifier/RenderMixer.java b/mechanical/src/main/java/resonantinduction/mechanical/process/purifier/RenderMixer.java index e9515118a..bee507737 100644 --- a/mechanical/src/main/java/resonantinduction/mechanical/process/purifier/RenderMixer.java +++ b/mechanical/src/main/java/resonantinduction/mechanical/process/purifier/RenderMixer.java @@ -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(); diff --git a/src/main/resources/assets/resonantinduction/languages/en_US.properties b/src/main/resources/assets/resonantinduction/languages/en_US.properties index 3b72d9cb8..b7ab4a75f 100644 --- a/src/main/resources/assets/resonantinduction/languages/en_US.properties +++ b/src/main/resources/assets/resonantinduction/languages/en_US.properties @@ -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 diff --git a/src/main/resources/assets/resonantinduction/models/sorter.png b/src/main/resources/assets/resonantinduction/models/sorter.png new file mode 100644 index 000000000..64aaa58e7 Binary files /dev/null and b/src/main/resources/assets/resonantinduction/models/sorter.png differ diff --git a/src/main/resources/assets/resonantinduction/models/sorter.tcn b/src/main/resources/assets/resonantinduction/models/sorter.tcn new file mode 100644 index 000000000..aeb290489 Binary files /dev/null and b/src/main/resources/assets/resonantinduction/models/sorter.tcn differ