diff --git a/mechanical/src/main/java/resonantinduction/mechanical/Mechanical.java b/mechanical/src/main/java/resonantinduction/mechanical/Mechanical.java index 4abb1381..332329b2 100644 --- a/mechanical/src/main/java/resonantinduction/mechanical/Mechanical.java +++ b/mechanical/src/main/java/resonantinduction/mechanical/Mechanical.java @@ -162,7 +162,9 @@ public class Mechanical GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemGear, 1, 0), "SWS", "W W", "SWS", 'W', "plankWood", 'S', Item.stick)); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemGear, 1, 1), " W ", "WGW", " W ", 'G', new ItemStack(itemGear, 1, 0), 'W', Block.cobblestone)); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemGear, 1, 2), " W ", "WGW", " W ", 'G', new ItemStack(itemGear, 1, 1), 'W', Item.ingotIron)); - GameRegistry.addRecipe(new ShapedOreRecipe(itemGearShaft, "S", "S", "S", 'S', Item.stick)); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemGearShaft, 1, 0), "S", "S", "S", 'S', Item.stick)); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemGearShaft, 1, 1), "S", "G", "S", 'G', new ItemStack(itemGearShaft, 1, 0), 'S', Block.cobblestone)); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemGearShaft, 1, 2), "S", "G", "S", 'G', new ItemStack(itemGearShaft, 1, 1), 'S', Item.ingotIron)); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockConveyorBelt, 4), "III", "GGG", 'I', Item.ingotIron, 'G', itemGear)); GameRegistry.addRecipe(new ShapedOreRecipe(blockManipulator, "SSS", "SRS", "SCS", 'S', Item.ingotIron, 'C', blockConveyorBelt, 'R', Block.blockRedstone)); GameRegistry.addRecipe(new ShapedOreRecipe(blockDetector, "SWS", "SRS", "SWS", 'S', Item.ingotIron, 'W', UniversalRecipe.WIRE.get())); diff --git a/mechanical/src/main/java/resonantinduction/mechanical/gear/ItemGearShaft.java b/mechanical/src/main/java/resonantinduction/mechanical/gear/ItemGearShaft.java index 3ca9236c..d4c18b33 100644 --- a/mechanical/src/main/java/resonantinduction/mechanical/gear/ItemGearShaft.java +++ b/mechanical/src/main/java/resonantinduction/mechanical/gear/ItemGearShaft.java @@ -1,5 +1,8 @@ package resonantinduction.mechanical.gear; +import java.util.List; + +import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; @@ -29,4 +32,13 @@ public class ItemGearShaft extends JItemMultiPart implements IHighlight return part; } + + @Override + public void getSubItems(int itemID, CreativeTabs tab, List listToAddTo) + { + for (int i = 0; i < 3; i++) + { + listToAddTo.add(new ItemStack(itemID, 1, i)); + } + } } diff --git a/mechanical/src/main/java/resonantinduction/mechanical/gear/PartGearShaft.java b/mechanical/src/main/java/resonantinduction/mechanical/gear/PartGearShaft.java index 8027ed35..ae44d4ff 100644 --- a/mechanical/src/main/java/resonantinduction/mechanical/gear/PartGearShaft.java +++ b/mechanical/src/main/java/resonantinduction/mechanical/gear/PartGearShaft.java @@ -45,6 +45,7 @@ public class PartGearShaft extends PartMechanical ForgeDirection dir = ForgeDirection.getOrientation((byte) (side ^ 1)); // Unwind rotation. We can only have "3" axis. this.placementSide = ForgeDirection.getOrientation(!(dir.ordinal() % 2 == 0) ? dir.ordinal() - 1 : dir.ordinal()); + tier = itemDamage; } @Override @@ -54,9 +55,22 @@ public class PartGearShaft extends PartMechanical if (!this.world().isRemote) { - // Decelerate the gear. - torque *= 0.99f; - angularVelocity *= 0.99f; + // Decelerate the shaft. + switch (tier) + { + default: + torque *= 0.997f; + angularVelocity *= 0.998f; + break; + case 1: + torque *= 0.998f; + angularVelocity *= 0.997f; + break; + case 2: + torque *= 0.99f; + angularVelocity *= 0.999f; + break; + } } } diff --git a/mechanical/src/main/java/resonantinduction/mechanical/gear/RenderGearShaft.java b/mechanical/src/main/java/resonantinduction/mechanical/gear/RenderGearShaft.java index 7d3a418f..f123a752 100644 --- a/mechanical/src/main/java/resonantinduction/mechanical/gear/RenderGearShaft.java +++ b/mechanical/src/main/java/resonantinduction/mechanical/gear/RenderGearShaft.java @@ -24,7 +24,20 @@ public class RenderGearShaft implements ISimpleItemRenderer public void renderInventoryItem(ItemStack itemStack) { GL11.glRotatef(90, 1, 0, 0); - RenderUtility.bind(Reference.BLOCK_TEXTURE_DIRECTORY + "planks_oak.png"); + + switch (itemStack.getItemDamage()) + { + default: + 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; + } + MODEL.renderOnly("Shaft"); } @@ -51,7 +64,19 @@ public class RenderGearShaft implements ISimpleItemRenderer GL11.glRotatef((float) Math.toDegrees(part.angle), 0, 1, 0); - RenderUtility.bind(Reference.BLOCK_TEXTURE_DIRECTORY + "planks_oak.png"); + switch (part.tier) + { + default: + 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; + } + MODEL.renderOnly("Shaft"); GL11.glPopMatrix();