Added stone and metal water turbines

This commit is contained in:
Calclavia 2014-02-28 11:25:51 +08:00
parent 0ff156f4f3
commit d8350d3fae
3 changed files with 49 additions and 22 deletions

View file

@ -1,7 +1,11 @@
package resonantinduction.mechanical.energy.turbine; package resonantinduction.mechanical.energy.turbine;
import java.util.List;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
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.world.World; import net.minecraft.world.World;
import resonantinduction.core.Reference; import resonantinduction.core.Reference;
@ -18,6 +22,13 @@ public class BlockWaterTurbine extends BlockMechanicalTurbine
super(id); super(id);
} }
@Override
public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
{
for (int i = 0; i < 3; i++)
par3List.add(new ItemStack(par1, 1, i));
}
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
@Override @Override
public int getRenderType() public int getRenderType()

View file

@ -35,16 +35,25 @@ public class RenderWaterTurbine extends TileEntitySpecialRenderer implements ISi
GL11.glRotatef((float) Math.toDegrees(tile.rotation), 0, 1, 0); GL11.glRotatef((float) Math.toDegrees(tile.rotation), 0, 1, 0);
if (tile.getDirection().offsetY != 0) if (tile.getDirection().offsetY != 0)
renderWaterTurbine(tile.getMultiBlock().isConstructed()); renderWaterTurbine(tile.tier, tile.getMultiBlock().isConstructed());
else else
renderWaterWheel(tile.getMultiBlock().isConstructed()); renderWaterWheel(tile.tier, tile.getMultiBlock().isConstructed());
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
} }
public void renderWaterWheel(boolean isLarge) @Override
public void renderInventoryItem(ItemStack itemStack)
{
GL11.glPushMatrix();
GL11.glTranslatef((float) 0.5f, (float) 0.5f, (float) 0.5f);
renderWaterTurbine(itemStack.getItemDamage(), false);
GL11.glPopMatrix();
}
public void renderWaterWheel(int tier, boolean isLarge)
{ {
if (isLarge) if (isLarge)
{ {
@ -58,7 +67,7 @@ public class RenderWaterTurbine extends TileEntitySpecialRenderer implements ISi
GL11.glScalef(1, 1.4f, 1); GL11.glScalef(1, 1.4f, 1);
RenderUtility.bind(Reference.BLOCK_TEXTURE_DIRECTORY + "planks_spruce.png"); RenderUtility.bind(Reference.BLOCK_TEXTURE_DIRECTORY + "planks_spruce.png");
MODEL.renderOnly("bigwheel_supporters"); MODEL.renderOnly("bigwheel_supporters");
RenderUtility.bind(Reference.BLOCK_TEXTURE_DIRECTORY + "planks_oak.png"); bindTexture(tier);
MODEL.renderOnly("bigwheel_scoops", "bigwheel_supportercircle"); MODEL.renderOnly("bigwheel_scoops", "bigwheel_supportercircle");
GL11.glPopMatrix(); GL11.glPopMatrix();
@ -69,42 +78,45 @@ public class RenderWaterTurbine extends TileEntitySpecialRenderer implements ISi
GL11.glScalef(0.7f, 1, 0.7f); GL11.glScalef(0.7f, 1, 0.7f);
RenderUtility.bind(Reference.BLOCK_TEXTURE_DIRECTORY + "cobblestone.png"); RenderUtility.bind(Reference.BLOCK_TEXTURE_DIRECTORY + "cobblestone.png");
MODEL.renderOnly("small_waterwheel_endknot"); MODEL.renderOnly("small_waterwheel_endknot");
RenderUtility.bind(Reference.BLOCK_TEXTURE_DIRECTORY + "planks_oak.png"); bindTexture(tier);
MODEL.renderOnly("small_waterwheel", "small_waterwheel_supporters", "horizontal_centre_shaft"); MODEL.renderOnly("small_waterwheel", "small_waterwheel_supporters", "horizontal_centre_shaft");
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
} }
public void renderWaterTurbine(boolean isLarge) public void renderWaterTurbine(int tier, boolean isLarge)
{ {
if (isLarge) if (isLarge)
{ {
RenderUtility.bind(Reference.BLOCK_TEXTURE_DIRECTORY + "cobblestone.png"); bindTexture(tier);
MODEL.renderOnly("turbine_centre"); MODEL.renderOnly("turbine_centre");
RenderUtility.bind(Reference.BLOCK_TEXTURE_DIRECTORY + "iron_block.png");
MODEL.renderOnly("turbine_blades"); MODEL.renderOnly("turbine_blades");
} }
else else
{ {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glScalef(0.9f, 1f, 0.9f); GL11.glScalef(0.9f, 1f, 0.9f);
RenderUtility.bind(Reference.BLOCK_TEXTURE_DIRECTORY + "cobblestone.png"); RenderUtility.bind(Reference.BLOCK_TEXTURE_DIRECTORY + "log_oak.png");
MODEL.renderOnly("small_waterwheel_endknot"); MODEL.renderOnly("small_waterwheel_endknot");
RenderUtility.bind(Reference.BLOCK_TEXTURE_DIRECTORY + "iron_block.png"); bindTexture(tier);
MODEL.renderOnly("small_turbine_blades"); MODEL.renderOnly("small_turbine_blades");
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
} }
@Override public void bindTexture(int tier)
public void renderInventoryItem(ItemStack itemStack)
{ {
GL11.glPushMatrix(); switch (tier)
GL11.glTranslatef((float) 0.5f, (float) 0.5f, (float) 0.5f); {
renderWaterWheel(false); case 0:
GL11.glPopMatrix(); RenderUtility.bind(Reference.BLOCK_TEXTURE_DIRECTORY + "planks_oak.png");
break;
case 1:
RenderUtility.bind(Reference.BLOCK_TEXTURE_DIRECTORY + "cobblestone.png");
break;
case 2:
RenderUtility.bind(Reference.BLOCK_TEXTURE_DIRECTORY + "iron_block.png");
break;
}
} }
} }

View file

@ -78,9 +78,13 @@ tile.resonantinduction\:windTurbine.0.tooltip=The wooden wind turbine is light,
tile.resonantinduction\:windTurbine.1.name=Stone Wind Turbine tile.resonantinduction\:windTurbine.1.name=Stone Wind Turbine
tile.resonantinduction\:windTurbine.1.tooltip=The stone turbine is heavy, strong and durable. tile.resonantinduction\:windTurbine.1.tooltip=The stone turbine is heavy, strong and durable.
tile.resonantinduction\:windTurbine.2.name=Metal Wind Turbine tile.resonantinduction\:windTurbine.2.name=Metal Wind Turbine
tile.resonantinduction\:windTurbine.2,tooltip=The metal wind turbine is strong and lightweight. tile.resonantinduction\:windTurbine.2.tooltip=The metal wind turbine is strong and angile.
tile.resonantinduction\:waterTurbine.name=Water Turbine tile.resonantinduction\:waterTurbine.0.name=Wooden Water Turbine
tile.resonantinduction\:waterTurbine.tooltip=The water turbine generates power through water flow. tile.resonantinduction\:waterTurbine.0.tooltip=The wooden water turbine is light and moves fast.
tile.resonantinduction\:waterTurbine.1.name=Stone Water Turbine
tile.resonantinduction\:waterTurbine.1.tooltip=The stone water turbine is heavy, strong and durable.
tile.resonantinduction\:waterTurbine.2.name=Metal Water Turbine
tile.resonantinduction\:waterTurbine.2.tooltip=The metal water turbine is strong and angile.
## Transport ## Transport
tile.resonantinduction\:releaseValve.name=Release Valve tile.resonantinduction\:releaseValve.name=Release Valve