Added renderer for mixer

This commit is contained in:
Calclavia 2014-02-19 10:51:22 +08:00
parent b421273726
commit 99e8cd7992
12 changed files with 236 additions and 12 deletions

View file

@ -30,10 +30,10 @@ import resonantinduction.mechanical.logistic.belt.TileManipulator;
import resonantinduction.mechanical.logistic.belt.TileRejector;
import resonantinduction.mechanical.network.PacketNetwork;
import resonantinduction.mechanical.process.BlockFilter;
import resonantinduction.mechanical.process.BlockGrindingWheel;
import resonantinduction.mechanical.process.TileGrinderWheel;
import resonantinduction.mechanical.process.TileMixer;
import resonantinduction.mechanical.purifier.BlockMixer;
import resonantinduction.mechanical.process.grinder.BlockGrindingWheel;
import resonantinduction.mechanical.process.grinder.TileGrinderWheel;
import resonantinduction.mechanical.process.purifier.BlockMixer;
import resonantinduction.mechanical.process.purifier.TileMixer;
import resonantinduction.mechanical.turbine.BlockWaterTurbine;
import resonantinduction.mechanical.turbine.BlockWindTurbine;
import resonantinduction.mechanical.turbine.TileWaterTurbine;

View file

@ -1,4 +1,4 @@
package resonantinduction.mechanical.process;
package resonantinduction.mechanical.process.grinder;
import net.minecraft.block.ITileEntityProvider;
import net.minecraft.block.material.Material;

View file

@ -1,4 +1,4 @@
package resonantinduction.mechanical.process;
package resonantinduction.mechanical.process.grinder;
import static org.lwjgl.opengl.GL11.glPopMatrix;
import static org.lwjgl.opengl.GL11.glPushMatrix;

View file

@ -1,4 +1,4 @@
package resonantinduction.mechanical.process;
package resonantinduction.mechanical.process.grinder;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemBlock;
@ -14,6 +14,7 @@ import resonantinduction.api.recipe.RecipeResource;
import resonantinduction.core.Reference;
import resonantinduction.core.ResonantInduction;
import resonantinduction.mechanical.network.TileMechanical;
import resonantinduction.mechanical.process.Timer;
import universalelectricity.api.vector.Vector3;
import calclavia.lib.prefab.tile.IRotatable;

View file

@ -1,12 +1,14 @@
package resonantinduction.mechanical.purifier;
package resonantinduction.mechanical.process.purifier;
import net.minecraft.block.ITileEntityProvider;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import resonantinduction.core.Reference;
import resonantinduction.mechanical.process.TileMixer;
import resonantinduction.core.render.RIBlockRenderingHandler;
import universalelectricity.api.UniversalElectricity;
import calclavia.lib.prefab.block.BlockRotatable;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
/**
* A block used to build machines.
@ -22,6 +24,13 @@ public class BlockMixer extends BlockRotatable implements ITileEntityProvider
setTextureName(Reference.PREFIX + "material_metal_top");
}
@SideOnly(Side.CLIENT)
@Override
public int getRenderType()
{
return RIBlockRenderingHandler.ID;
}
@Override
public boolean isOpaqueCube()
{

View file

@ -0,0 +1,60 @@
package resonantinduction.mechanical.process.purifier;
import static org.lwjgl.opengl.GL11.glPopMatrix;
import static org.lwjgl.opengl.GL11.glPushMatrix;
import static org.lwjgl.opengl.GL11.glRotatef;
import static org.lwjgl.opengl.GL11.glTranslatef;
import org.lwjgl.opengl.GL11;
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 resonantinduction.core.Reference;
import calclavia.lib.render.RenderUtility;
import calclavia.lib.render.item.ISimpleItemRenderer;
import calclavia.lib.render.model.TechneAdvancedModel;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
/**
* @author Calclavia
*
*/
@SideOnly(Side.CLIENT)
public class RenderMixer extends TileEntitySpecialRenderer implements ISimpleItemRenderer
{
public static final TechneAdvancedModel MODEL = (TechneAdvancedModel) AdvancedModelLoader.loadModel(Reference.MODEL_DIRECTORY + "mixer.tcn");
public static ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PATH + "mixer.png");
@Override
public void renderTileEntityAt(TileEntity t, double x, double y, double z, float f)
{
if (t instanceof TileMixer)
{
TileMixer tile = (TileMixer) t;
glPushMatrix();
glTranslatef((float) x + 0.5F, (float) y + 0.5f, (float) z + 0.5F);
RenderUtility.bind(TEXTURE);
MODEL.renderOnly("centerTop", "centerBase", "centerPoll");
glPushMatrix();
glRotatef((float) Math.toDegrees(tile.angle), 0, 1, 0);
MODEL.renderAllExcept("centerTop", "centerBase", "centerPoll");
glPopMatrix();
glPopMatrix();
}
}
@Override
public void renderInventoryItem(ItemStack itemStack)
{
glPushMatrix();
GL11.glScalef(0.5f, 0.5f, 0.5f);
glTranslatef((float) 0.5F, (float) 0.5f, (float) 1.5F);
RenderUtility.bind(TEXTURE);
MODEL.renderAll();
glPopMatrix();
}
}

View file

@ -1,4 +1,4 @@
package resonantinduction.mechanical.process;
package resonantinduction.mechanical.process.purifier;
import java.util.LinkedHashSet;
import java.util.List;
@ -16,6 +16,7 @@ import resonantinduction.core.Reference;
import resonantinduction.core.ResonantInduction;
import resonantinduction.core.resource.fluid.BlockFluidMixture;
import resonantinduction.mechanical.network.TileMechanical;
import resonantinduction.mechanical.process.Timer;
import universalelectricity.api.vector.Vector3;
/**

View file

@ -105,7 +105,7 @@ public class ResonantInduction
/**
* Melting dusts
*/
blockDust = contentRegistry.createTile(BlockDust.class, TileMaterial.class);
blockDust = contentRegistry.createTile(BlockDust.class, TileMaterial.class).setCreativeTab(null);
// Items
itemRubble = new ItemOreResource(Settings.getNextItemID("oreRubble"), "oreRubble");

View file

@ -28,7 +28,6 @@ public class BlockDust extends BlockTile
public BlockDust(int id)
{
super(id, Material.sand);
setCreativeTab(null);
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F);
setBlockBoundsForDepth(0);
setHardness(0.5f);

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View file

@ -0,0 +1,154 @@
<Techne Version="2.2">
<Author>ZeuX</Author>
<DateCreated></DateCreated>
<Description></Description>
<Models>
<Model texture="Newtexture.png" textureSize="128,64">
<BaseClass>ModelBase</BaseClass>
<Geometry>
<Shape type="d9e621f7-957f-4b77-b1ae-20dcd0da7751" name="centerTop">
<Animation>
<AnimationAngles>0,0,0</AnimationAngles>
<AnimationDuration>0,0,0</AnimationDuration>
<AnimationType>0,0,0</AnimationType>
</Animation>
<IsDecorative>False</IsDecorative>
<IsFixed>False</IsFixed>
<IsMirrored>False</IsMirrored>
<Offset>0,0,0</Offset>
<Position>-5,8,-5</Position>
<Rotation>0,0,0</Rotation>
<Size>10,2,10</Size>
<TextureOffset>0,0</TextureOffset>
</Shape>
<Shape type="d9e621f7-957f-4b77-b1ae-20dcd0da7751" name="centerBase">
<Animation>
<AnimationAngles>0,0,0</AnimationAngles>
<AnimationDuration>0,0,0</AnimationDuration>
<AnimationType>0,0,0</AnimationType>
</Animation>
<IsDecorative>False</IsDecorative>
<IsFixed>False</IsFixed>
<IsMirrored>False</IsMirrored>
<Offset>0,0,0</Offset>
<Position>-5,22,-5</Position>
<Rotation>0,0,0</Rotation>
<Size>10,2,10</Size>
<TextureOffset>0,12</TextureOffset>
</Shape>
<Shape type="d9e621f7-957f-4b77-b1ae-20dcd0da7751" name="centerPoll">
<Animation>
<AnimationAngles>0,0,0</AnimationAngles>
<AnimationDuration>0,0,0</AnimationDuration>
<AnimationType>0,0,0</AnimationType>
</Animation>
<IsDecorative>False</IsDecorative>
<IsFixed>False</IsFixed>
<IsMirrored>False</IsMirrored>
<Offset>0,0,0</Offset>
<Position>-2,9,-2</Position>
<Rotation>0,0,0</Rotation>
<Size>4,14,4</Size>
<TextureOffset>0,24</TextureOffset>
</Shape>
<Shape type="d9e621f7-957f-4b77-b1ae-20dcd0da7751" name="mixerArm1">
<Animation>
<AnimationAngles>0,0,0</AnimationAngles>
<AnimationDuration>0,0,0</AnimationDuration>
<AnimationType>0,0,0</AnimationType>
</Animation>
<IsDecorative>False</IsDecorative>
<IsFixed>False</IsFixed>
<IsMirrored>False</IsMirrored>
<Offset>-21,0,-1</Offset>
<Position>0,20,0</Position>
<Rotation>0,0,0</Rotation>
<Size>42,2,2</Size>
<TextureOffset>0,44</TextureOffset>
</Shape>
<Shape type="d9e621f7-957f-4b77-b1ae-20dcd0da7751" name="mixerArm1Blade1">
<Animation>
<AnimationAngles>0,0,0</AnimationAngles>
<AnimationDuration>0,0,0</AnimationDuration>
<AnimationType>0,0,0</AnimationType>
</Animation>
<IsDecorative>False</IsDecorative>
<IsFixed>False</IsFixed>
<IsMirrored>False</IsMirrored>
<Offset>-20.5,1,-0.5</Offset>
<Position>0,20.5,0</Position>
<Rotation>35,0,0</Rotation>
<Size>10,2,1</Size>
<TextureOffset>16,24</TextureOffset>
</Shape>
<Shape type="d9e621f7-957f-4b77-b1ae-20dcd0da7751" name="mixerArm1Blade2">
<Animation>
<AnimationAngles>0,0,0</AnimationAngles>
<AnimationDuration>0,0,0</AnimationDuration>
<AnimationType>0,0,0</AnimationType>
</Animation>
<IsDecorative>False</IsDecorative>
<IsFixed>False</IsFixed>
<IsMirrored>False</IsMirrored>
<Offset>10.5,1,-0.5</Offset>
<Position>0,20.5,0</Position>
<Rotation>-35,0,0</Rotation>
<Size>10,2,1</Size>
<TextureOffset>16,24</TextureOffset>
</Shape>
<Shape type="d9e621f7-957f-4b77-b1ae-20dcd0da7751" name="mixerArm2">
<Animation>
<AnimationAngles>0,0,0</AnimationAngles>
<AnimationDuration>0,0,0</AnimationDuration>
<AnimationType>0,0,0</AnimationType>
</Animation>
<IsDecorative>False</IsDecorative>
<IsFixed>False</IsFixed>
<IsMirrored>False</IsMirrored>
<Offset>-1,0,-21</Offset>
<Position>0,13,0</Position>
<Rotation>0,0,0</Rotation>
<Size>2,2,42</Size>
<TextureOffset>0,0</TextureOffset>
</Shape>
<Shape type="d9e621f7-957f-4b77-b1ae-20dcd0da7751" name="mixerArm2Blade2">
<Animation>
<AnimationAngles>0,0,0</AnimationAngles>
<AnimationDuration>0,0,0</AnimationDuration>
<AnimationType>0,0,0</AnimationType>
</Animation>
<IsDecorative>False</IsDecorative>
<IsFixed>False</IsFixed>
<IsMirrored>False</IsMirrored>
<Offset>-0.5,1,10.5</Offset>
<Position>0,13.5,0</Position>
<Rotation>0,0,-35</Rotation>
<Size>1,2,10</Size>
<TextureOffset>16,27</TextureOffset>
</Shape>
<Shape type="d9e621f7-957f-4b77-b1ae-20dcd0da7751" name="mixerArm2Blade1">
<Animation>
<AnimationAngles>0,0,0</AnimationAngles>
<AnimationDuration>0,0,0</AnimationDuration>
<AnimationType>0,0,0</AnimationType>
</Animation>
<IsDecorative>False</IsDecorative>
<IsFixed>False</IsFixed>
<IsMirrored>False</IsMirrored>
<Offset>-0.5,1,-20.5</Offset>
<Position>0,13.5,0</Position>
<Rotation>0,0,35</Rotation>
<Size>1,2,10</Size>
<TextureOffset>16,27</TextureOffset>
</Shape>
</Geometry>
<GlScale>1,1,1</GlScale>
<Name>New</Name>
<TextureSize>128,64</TextureSize>
</Model>
</Models>
<Name>New</Name>
<PreviewImage></PreviewImage>
<ProjectName>New</ProjectName>
<ProjectType>Minecraft</ProjectType>
</Techne>