Library Restructure

This commit is contained in:
mDiyo committed 2013-03-24 16:52:53 -07:00
1 parent c9ef3093a3
commit 51a69ffbd4
41 files changed
+254 -310

No files matched your search

+10 -8
View File
@@ -1,6 +1,7 @@
package mods.tinker.common;
import mods.tinker.tconstruct.TConstruct;
import java.util.Random;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
@@ -16,6 +17,7 @@ import net.minecraft.world.World;
public abstract class InventoryBlock extends BlockContainer
{
protected Random rand = new Random();
protected InventoryBlock(int id, Material material)
{
super(id, material);
@@ -70,13 +72,13 @@ public abstract class InventoryBlock extends BlockContainer
if (stack != null && logic.canDropInventorySlot(iter))
{
float jumpX = TConstruct.tRand.nextFloat() * 0.8F + 0.1F;
float jumpY = TConstruct.tRand.nextFloat() * 0.8F + 0.1F;
float jumpZ = TConstruct.tRand.nextFloat() * 0.8F + 0.1F;
float jumpX = rand.nextFloat() * 0.8F + 0.1F;
float jumpY = rand.nextFloat() * 0.8F + 0.1F;
float jumpZ = rand.nextFloat() * 0.8F + 0.1F;
while (stack.stackSize > 0)
{
int itemSize = TConstruct.tRand.nextInt(21) + 10;
int itemSize = rand.nextInt(21) + 10;
if (itemSize > stack.stackSize)
{
@@ -93,9 +95,9 @@ public abstract class InventoryBlock extends BlockContainer
}
float offset = 0.05F;
entityitem.motionX = (double) ((float) TConstruct.tRand.nextGaussian() * offset);
entityitem.motionY = (double) ((float) TConstruct.tRand.nextGaussian() * offset + 0.2F);
entityitem.motionZ = (double) ((float) TConstruct.tRand.nextGaussian() * offset);
entityitem.motionX = (double) ((float) rand.nextGaussian() * offset);
entityitem.motionY = (double) ((float) rand.nextGaussian() * offset + 0.2F);
entityitem.motionZ = (double) ((float) rand.nextGaussian() * offset);
par1World.spawnEntityInWorld(entityitem);
}
}
@@ -1,4 +1,4 @@
package mods.tinker.tconstruct;
package mods.tinker.common;
import net.minecraft.entity.Entity;
import net.minecraft.util.EntityDamageSource;
@@ -1,6 +1,7 @@
package mods.tinker.tconstruct.library;
package mods.tinker.tconstruct;
import mods.tinker.tconstruct.TContent;
import mods.tinker.tconstruct.library.ToolCore;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.player.EntityPlayer;
+5 -6
View File
@@ -2,6 +2,8 @@ package mods.tinker.tconstruct;
import java.util.Random;
import mods.tinker.tconstruct.library.TConstructRegistry;
import mods.tinker.tconstruct.library.TabTools;
import mods.tinker.tconstruct.player.TPlayerHandler;
import mods.tinker.tconstruct.worldgen.TBaseWorldGenerator;
import net.minecraftforge.common.MinecraftForge;
@@ -48,9 +50,9 @@ public class TConstruct
public void preInit (FMLPreInitializationEvent evt)
{
PHConstruct.initProps();
materialTab = new TabTools("TConstructMaterials");
toolTab = new TabTools("TConstructTools");
blockTab = new TabTools("TConstructBlocks");
TConstructRegistry.materialTab = new TabTools("TConstructMaterials");
TConstructRegistry.toolTab = new TabTools("TConstructTools");
TConstructRegistry.blockTab = new TabTools("TConstructBlocks");
content = new TContent();
proxy.registerRenderer();
@@ -84,7 +86,4 @@ public class TConstruct
public static TContent content;
public static Random tRand = new Random();
public static TabTools toolTab;
public static TabTools materialTab;
public static TabTools blockTab;
}
+27 -25
View File
@@ -278,6 +278,7 @@ public class TContent implements IFuelHandler
materials = new CraftingItem(PHConstruct.materials, craftingMaterials, craftingTextures, "materials/").setUnlocalizedName("tconstruct.Materials");
toolRod = new ToolPart(PHConstruct.toolRod, "ToolRod", "_rod").setUnlocalizedName("tconstruct.ToolRod");
TConstructRegistry.toolRod = toolRod;
toolShard = new ToolShard(PHConstruct.toolShard, "ToolShard", "_chunk").setUnlocalizedName("tconstruct.ToolShard");
woodPattern = new Pattern(PHConstruct.woodPattern, "WoodPattern", "pattern_", "materials/").setUnlocalizedName("tconstruct.Pattern");
metalPattern = new MetalPattern(PHConstruct.metalPattern, "MetalPattern", "cast_", "materials/").setUnlocalizedName("tconstruct.MetalPattern");
@@ -325,22 +326,22 @@ public class TContent implements IFuelHandler
void registerMaterials ()
{
TConstructRegistry.addToolMaterial(0, "Wood", 1, 0, 59, 200, 0, 1.0F, 0, 0f);
TConstructRegistry.addToolMaterial(1, "Stone", 1, 1, 131, 400, 1, 0.5F, 0, 1f);
TConstructRegistry.addToolMaterial(2, "Iron", 1, 2, 250, 600, 2, 1.3F, 1, 0f);
TConstructRegistry.addToolMaterial(3, "Flint", 1, 1, 171, 525, 2, 0.7F, 0, 1f);
TConstructRegistry.addToolMaterial(4, "Cactus", 1, 1, 150, 500, 2, 1.0F, 0, -1f);
TConstructRegistry.addToolMaterial(5, "Bone", 1, 1, 200, 400, 1, 1.0F, 0, 0f);
TConstructRegistry.addToolMaterial(6, "Obsidian", 1, 3, 89, 700, 2, 0.8F, 3, 0f);
TConstructRegistry.addToolMaterial(7, "Netherrack", 1, 2, 131, 400, 1, 1.2F, 0, 1f);
TConstructRegistry.addToolMaterial(8, "Slime", 1, 3, 1500, 150, 0, 5.0F, 0, 0f);
TConstructRegistry.addToolMaterial(9, "Paper", 1, 0, 30, 200, 0, 0.3F, 0, 0f);
TConstructRegistry.addToolMaterial(10, "Cobalt", 2, 4, 800, 800, 3, 1.75F, 2, 0f);
TConstructRegistry.addToolMaterial(11, "Ardite", 2, 4, 600, 800, 3, 2.0F, 0, 0f);
TConstructRegistry.addToolMaterial(12, "Manyullyn", 2, 5, 1200, 1000, 4, 2.5F, 0, 0f);
TConstructRegistry.addToolMaterial(13, "Copper", 1, 1, 180, 500, 2, 1.15F, 0, 0f);
TConstructRegistry.addToolMaterial(14, "Bronze", 1, 2, 250, 600, 2, 1.3F, 1, 0f);
TConstructRegistry.addToolMaterial(15, "Alumite", 2, 4, 550, 800, 3, 1.3F, 2, 0f);
TConstructRegistry.addToolMaterial(0, "Wood", 1, 0, 59, 200, 0, 1.0F, 0, 0f, "\u00A7e", "");
TConstructRegistry.addToolMaterial(1, "Stone", 1, 1, 131, 400, 1, 0.5F, 0, 1f, "", "Shoddy");
TConstructRegistry.addToolMaterial(2, "Iron", 1, 2, 250, 600, 2, 1.3F, 1, 0f, "\u00A7f", "");
TConstructRegistry.addToolMaterial(3, "Flint", 1, 1, 171, 525, 2, 0.7F, 0, 1f, "\u00A78", "Shoddy");
TConstructRegistry.addToolMaterial(4, "Cactus", 1, 1, 150, 500, 2, 1.0F, 0, -1f, "\u00A72", "Spiny");
TConstructRegistry.addToolMaterial(5, "Bone", 1, 1, 200, 400, 1, 1.0F, 0, 0f, "\u00A7e", "");
TConstructRegistry.addToolMaterial(6, "Obsidian", 1, 3, 89, 700, 2, 0.8F, 3, 0f, "\u00A7d", "");
TConstructRegistry.addToolMaterial(7, "Netherrack", 1, 2, 131, 400, 1, 1.2F, 0, 1f, "\u00A74", "Shoddy");
TConstructRegistry.addToolMaterial(8, "Slime", 1, 3, 1500, 150, 0, 5.0F, 0, 0f, "\u00A7a", "");
TConstructRegistry.addToolMaterial(9, "Paper", 1, 0, 30, 200, 0, 0.3F, 0, 0f, "\u00A7f", "Writable");
TConstructRegistry.addToolMaterial(10, "Cobalt", 2, 4, 800, 800, 3, 1.75F, 2, 0f, "\u00A73", "");
TConstructRegistry.addToolMaterial(11, "Ardite", 2, 4, 600, 800, 3, 2.0F, 0, 0f, "\u00A74", "");
TConstructRegistry.addToolMaterial(12, "Manyullyn", 2, 5, 1200, 1000, 4, 2.5F, 0, 0f, "\u00A75", "Awareness");
TConstructRegistry.addToolMaterial(13, "Copper", 1, 1, 180, 500, 2, 1.15F, 0, 0f, "\u00A7c", "");
TConstructRegistry.addToolMaterial(14, "Bronze", 1, 2, 250, 600, 2, 1.3F, 1, 0f, "\u00A76", "");
TConstructRegistry.addToolMaterial(15, "Alumite", 2, 4, 550, 800, 3, 1.3F, 2, 0f, "\u00A7d", "");
TConstructRegistry.addToolMaterial(16, "Steel", 2, 3, 750, 800, 3, 1.3F, 2, 0f);
//Thaumcraft
@@ -375,23 +376,23 @@ public class TContent implements IFuelHandler
pb.registerMaterialSet("Wood", new ItemStack(Item.stick, 2), new ItemStack(Item.stick), 0);
if (PHConstruct.enableTStone)
{
pb.registerFullMaterial(Block.stone, 2, "Stone", 1);
pb.registerFullMaterial(Block.stone, 2, "Stone", new ItemStack(TContent.toolShard, 1, 1), new ItemStack(TContent.toolRod, 1, 1), 1);
pb.registerMaterial(Block.cobblestone, 2, "Stone");
}
//else
//pb.registerMaterialSet("Stone", new ItemStack(TContent.toolShard, 1, 1), new ItemStack(TContent.toolRod, 1, 1), 1);
pb.registerFullMaterial(Item.ingotIron, 2, "Iron", 2);
pb.registerFullMaterial(Item.flint, 2, "Flint", 3);
pb.registerFullMaterial(Item.ingotIron, 2, "Iron", new ItemStack(TContent.toolShard, 1, 2), new ItemStack(TContent.toolRod, 1, 2), 2);
pb.registerFullMaterial(Item.flint, 2, "Flint", new ItemStack(TContent.toolShard, 1, 3), new ItemStack(TContent.toolRod, 1, 3), 3);
if (PHConstruct.enableTCactus)
pb.registerFullMaterial(Block.cactus, 2, "Cactus", 4);
pb.registerFullMaterial(Block.cactus, 2, "Cactus", new ItemStack(TContent.toolShard, 1, 4), new ItemStack(TContent.toolRod, 1, 4), 4);
else
pb.registerMaterialSet("Cactus", new ItemStack(TContent.toolShard, 1, 4), new ItemStack(TContent.toolRod, 1, 4), 4);
if (PHConstruct.enableTBone)
pb.registerFullMaterial(Item.bone, 2, "Bone", new ItemStack(Item.dyePowder, 1, 15), new ItemStack(Item.bone), 5);
else
pb.registerMaterialSet("Bone", new ItemStack(Item.dyePowder, 1, 15), new ItemStack(Item.bone), 5);
pb.registerFullMaterial(Block.obsidian, 2, "Obsidian", 6);
pb.registerFullMaterial(Block.netherrack, 2, "Netherrack", 7);
pb.registerFullMaterial(Block.obsidian, 2, "Obsidian", new ItemStack(TContent.toolShard, 1, 6), new ItemStack(TContent.toolRod, 1, 6), 6);
pb.registerFullMaterial(Block.netherrack, 2, "Netherrack", new ItemStack(TContent.toolShard, 1, 7), new ItemStack(TContent.toolRod, 1, 7), 7);
pb.registerFullMaterial(new ItemStack(materials, 1, 1), 2, "Slime", new ItemStack(toolShard, 1, 8), new ItemStack(toolRod, 1, 8), 8);
pb.registerFullMaterial(new ItemStack(materials, 1, 0), 2, "Paper", new ItemStack(Item.paper, 2), new ItemStack(toolRod, 1, 9), 9);
pb.registerMaterialSet("Cobalt", new ItemStack(toolShard, 1, 10), new ItemStack(toolRod, 1, 10), 10);
@@ -618,8 +619,8 @@ public class TContent implements IFuelHandler
void setupToolTabs ()
{
TConstruct.materialTab.init(new ItemStack(titleIcon));
TConstruct.blockTab.init(new ItemStack(woodCrafter));
TConstructRegistry.materialTab.init(new ItemStack(titleIcon));
TConstructRegistry.blockTab.init(new ItemStack(woodCrafter));
ItemStack tool = new ItemStack(longsword, 1, 0);
NBTTagCompound compound = new NBTTagCompound();
@@ -629,7 +630,8 @@ public class TContent implements IFuelHandler
compound.getCompoundTag("InfiTool").setInteger("RenderAccessory", 10);
tool.setTagCompound(compound);
TConstruct.toolTab.init(tool);
//TConstruct.
TConstructRegistry.toolTab.init(tool);
}
public void oreRegistry ()
@@ -1,5 +1,6 @@
package mods.tinker.tconstruct;
import mods.tinker.tconstruct.library.AbilityHelper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
+2 -2
View File
@@ -4,7 +4,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Random;
import mods.tinker.tconstruct.TConstruct;
import mods.tinker.tconstruct.library.TConstructRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFence;
import net.minecraft.block.EnumMobType;
@@ -25,7 +25,7 @@ public class Landmine extends Block
{
super(par1, par4Material);
this.triggerMobType = EnumMobType.mobs;
this.setCreativeTab(TConstruct.blockTab);
this.setCreativeTab(TConstructRegistry.blockTab);
this.setTickRandomly(true);
float var5 = 0.0625F;
this.setBlockBounds(var5, 0.0F, var5, 1.0F - var5, 0.03125F, 1.0F - var5);
@@ -3,8 +3,8 @@ package mods.tinker.tconstruct.blocks;
import java.util.List;
import mods.tinker.common.IServantLogic;
import mods.tinker.tconstruct.TConstruct;
import mods.tinker.tconstruct.client.TankRender;
import mods.tinker.tconstruct.library.TConstructRegistry;
import mods.tinker.tconstruct.logic.LavaTankLogic;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
@@ -12,7 +12,6 @@ import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Icon;
@@ -31,7 +30,7 @@ public class LavaTankBlock extends BlockContainer
{
super(id, Material.rock);
setHardness(12);
setCreativeTab(TConstruct.blockTab);
setCreativeTab(TConstructRegistry.blockTab);
setUnlocalizedName("TConstruct.LavaTank");
setStepSound(Block.soundGlassFootstep);
}
@@ -5,6 +5,7 @@ import java.util.List;
import mods.tinker.common.InventoryBlock;
import mods.tinker.tconstruct.TConstruct;
import mods.tinker.tconstruct.client.SearedRender;
import mods.tinker.tconstruct.library.TConstructRegistry;
import mods.tinker.tconstruct.logic.CastingTableLogic;
import mods.tinker.tconstruct.logic.FaucetLogic;
import net.minecraft.block.material.Material;
@@ -24,8 +25,7 @@ public class SearedBlock extends InventoryBlock
public SearedBlock(int id)
{
super(id, Material.rock);
this.setCreativeTab(TConstruct.blockTab);
//blockIndexInTexture = 32;
this.setCreativeTab(TConstructRegistry.blockTab);
setHardness(12);
setStepSound(soundMetalFootstep);
}
@@ -10,6 +10,7 @@ import mods.tinker.common.InventoryBlock;
import mods.tinker.tconstruct.TConstruct;
import mods.tinker.tconstruct.TGuiHandler;
import mods.tinker.tconstruct.client.SmelteryRender;
import mods.tinker.tconstruct.library.TConstructRegistry;
import mods.tinker.tconstruct.logic.MultiServantLogic;
import mods.tinker.tconstruct.logic.SmelteryDrainLogic;
import mods.tinker.tconstruct.logic.SmelteryLogic;
@@ -30,11 +31,10 @@ public class SmelteryBlock extends InventoryBlock
public SmelteryBlock(int id)
{
super(id, Material.rock);
//blockIndexInTexture = 64;
setHardness(12F);
setStepSound(soundMetalFootstep);
rand = new Random();
this.setCreativeTab(TConstruct.blockTab);
this.setCreativeTab(TConstructRegistry.blockTab);
this.setUnlocalizedName("tconstruct.Smeltery");
}
@@ -2,7 +2,7 @@ package mods.tinker.tconstruct.blocks;
import java.util.List;
import mods.tinker.tconstruct.TConstruct;
import mods.tinker.tconstruct.library.TConstructRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
@@ -18,7 +18,7 @@ public class TConstructBlock extends Block
{
super(id, material);
setHardness(hardness);
this.setCreativeTab(TConstruct.blockTab);
this.setCreativeTab(TConstructRegistry.blockTab);
textureNames = tex;
}
@@ -5,6 +5,7 @@ import java.util.List;
import mods.tinker.common.InventoryBlock;
import mods.tinker.tconstruct.TConstruct;
import mods.tinker.tconstruct.client.TableRender;
import mods.tinker.tconstruct.library.TConstructRegistry;
import mods.tinker.tconstruct.logic.PartCrafterLogic;
import mods.tinker.tconstruct.logic.PatternChestLogic;
import mods.tinker.tconstruct.logic.PatternShaperLogic;
@@ -24,7 +25,7 @@ public class ToolStationBlock extends InventoryBlock
public ToolStationBlock(int id, Material material)
{
super(id, material);
this.setCreativeTab(TConstruct.blockTab);
this.setCreativeTab(TConstructRegistry.blockTab);
this.setHardness(2f);
}
@@ -16,14 +16,13 @@ import mods.tinker.tconstruct.client.entityrender.CartRender;
import mods.tinker.tconstruct.client.entityrender.CrystalRender;
import mods.tinker.tconstruct.client.entityrender.SkylaRender;
import mods.tinker.tconstruct.client.entityrender.SlimeRender;
import mods.tinker.tconstruct.client.gui.ToolGuiElement;
import mods.tinker.tconstruct.entity.BlueSlime;
import mods.tinker.tconstruct.entity.CartEntity;
import mods.tinker.tconstruct.entity.Crystal;
import mods.tinker.tconstruct.entity.BlueSlime;
import mods.tinker.tconstruct.entity.Skyla;
import mods.tinker.tconstruct.entity.UnstableCreeper;
import mods.tinker.tconstruct.library.TConstructClientRegistry;
import mods.tinker.tconstruct.library.TConstructRegistry;
import mods.tinker.tconstruct.library.client.TConstructClientRegistry;
import mods.tinker.tconstruct.library.client.ToolGuiElement;
import mods.tinker.tconstruct.logic.CastingTableLogic;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
@@ -74,7 +73,6 @@ import cpw.mods.fml.relauncher.Side;
public class TProxyClient extends TProxyCommon
{
public static SmallFontRenderer smallFontRenderer;
public static Icon blankSprite;
public static Icon metalBall;
public static Minecraft mc;
@@ -338,7 +336,7 @@ public class TProxyClient extends TProxyCommon
void addToolButton (int slotType, int xButton, int yButton, int[] xIcons, int[] yIcons, String title, String body)
{
TConstructRegistry.toolButtons.add(new ToolGuiElement(slotType, xButton, yButton, xIcons, yIcons, title, body));
TConstructClientRegistry.addToolButton(new ToolGuiElement(slotType, xButton, yButton, xIcons, yIcons, title, body));
}
void addRenderMappings ()
@@ -348,12 +346,10 @@ public class TProxyClient extends TProxyCommon
for (int partIter = 0; partIter < partTypes.length; partIter++)
{
TConstructClientRegistry.addMaterialRenderMapping(partIter, "tinker", partTypes[partIter], true);
//materialRenderMap(partIter, partTypes[partIter]);
}
for (int effectIter = 0; effectIter < effectTypes.length; effectIter++)
{
TConstructClientRegistry.addEffectRenderMapping(effectIter, "tinker", effectTypes[effectIter], true);
//effectRenderMap(effectIter, effectTypes[effectIter]);
}
}
@@ -1,7 +1,7 @@
package mods.tinker.tconstruct.client.gui;
import mods.tinker.tconstruct.client.TProxyClient;
import mods.tinker.tconstruct.library.TConstructClientRegistry;
import mods.tinker.tconstruct.library.client.TConstructClientRegistry;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiParticle;
@@ -1,9 +1,9 @@
package mods.tinker.tconstruct.client.gui;
import mods.tinker.tconstruct.ToolMaterial;
import mods.tinker.tconstruct.container.PartCrafterChestContainer;
import mods.tinker.tconstruct.crafting.PatternBuilder;
import mods.tinker.tconstruct.library.TConstructRegistry;
import mods.tinker.tconstruct.library.ToolMaterial;
import mods.tinker.tconstruct.logic.PartCrafterLogic;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
@@ -13,7 +13,6 @@ import net.minecraft.network.packet.Packet250CustomPayload;
import net.minecraft.util.Icon;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraftforge.client.ForgeHooksClient;
import net.minecraftforge.liquids.LiquidStack;
import org.lwjgl.input.Mouse;
@@ -3,10 +3,11 @@ package mods.tinker.tconstruct.client.gui;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import mods.tinker.tconstruct.library.client.ToolGuiElement;
import mods.tinker.tconstruct.container.ToolStationContainer;
import mods.tinker.tconstruct.library.TConstructRegistry;
import mods.tinker.tconstruct.library.ToolCore;
import mods.tinker.tconstruct.library.Weapon;
import mods.tinker.tconstruct.library.client.TConstructClientRegistry;
import mods.tinker.tconstruct.logic.ToolStationLogic;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiTextField;
@@ -71,14 +72,14 @@ public class ToolStationGui extends GuiContainer
int cornerY = (this.height - this.ySize) / 2;
this.buttonList.clear();
ToolGuiElement repair = TConstructRegistry.toolButtons.get(0);
ToolGuiElement repair = TConstructClientRegistry.toolButtons.get(0);
GuiButtonTool repairButton = new GuiButtonTool(0, cornerX - 110, cornerY, repair.buttonIconX, repair.buttonIconY, repair.texture); // Repair
repairButton.enabled = false;
this.buttonList.add(repairButton);
for (int iter = 1; iter < TConstructRegistry.toolButtons.size(); iter++)
for (int iter = 1; iter < TConstructClientRegistry.toolButtons.size(); iter++)
{
ToolGuiElement element = TConstructRegistry.toolButtons.get(iter);
ToolGuiElement element = TConstructClientRegistry.toolButtons.get(iter);
GuiButtonTool button = new GuiButtonTool(iter, cornerX - 110 + 22 * (iter % 5), cornerY + 22 * (iter / 5), element.buttonIconX, element.buttonIconY, element.texture); // Repair
this.buttonList.add(button);
}
@@ -90,7 +91,7 @@ public class ToolStationGui extends GuiContainer
guiType = button.id;
button.enabled = false;
ToolGuiElement element = TConstructRegistry.toolButtons.get(guiType);
ToolGuiElement element = TConstructClientRegistry.toolButtons.get(guiType);
setSlotType(element.slotType);
iconX = element.iconsX;
iconY = element.iconsY;
@@ -6,8 +6,6 @@ import java.util.HashMap;
import java.util.List;
import mods.tinker.common.IPattern;
import mods.tinker.tconstruct.TContent;
import mods.tinker.tconstruct.items.Pattern;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -60,7 +58,7 @@ public class PatternBuilder
if (toolPart != null)
{
int patternValue = ((Pattern) pattern.getItem()).getPatternCost(pattern.getItemDamage());
int patternValue = ((IPattern) pattern.getItem()).getPatternCost(pattern.getItemDamage());
int totalMaterial = key.value * material.stackSize;
if (totalMaterial < patternValue) // Not enough material
@@ -217,7 +215,7 @@ public class PatternBuilder
registerFullMaterial(new ItemStack(material, 1, -1), value, key, shard, rod, materialID);
}
public void registerFullMaterial (Block material, int value, String key, int materialID)
/*public void registerFullMaterial (Block material, int value, String key, int materialID)
{
registerFullMaterial(new ItemStack(material, 1, -1), value, key, new ItemStack(TContent.toolShard, 1, materialID), new ItemStack(TContent.toolRod, 1, materialID), materialID);
}
@@ -225,5 +223,5 @@ public class PatternBuilder
public void registerFullMaterial (Item material, int value, String key, int materialID)
{
registerFullMaterial(new ItemStack(material, 1, -1), value, key, new ItemStack(TContent.toolShard, 1, materialID), new ItemStack(TContent.toolRod, 1, materialID), materialID);
}
}*/
}
@@ -7,9 +7,9 @@ import java.util.List;
import mods.tinker.common.IToolPart;
import mods.tinker.common.ToolMod;
import mods.tinker.tconstruct.ToolMaterial;
import mods.tinker.tconstruct.library.TConstructRegistry;
import mods.tinker.tconstruct.library.ToolCore;
import mods.tinker.tconstruct.library.ToolMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -102,18 +102,11 @@ public class ToolBuilder
if (accessory != -1)
accessoryMat = TConstructRegistry.getMaterial(accessory);
//System.out.println("Head: "+headMat+" Handle: "+handleMat);
int durability = (int) (headMat.durability() * handleMat.handleDurability() * item.getDurabilityModifier());
if (accessoryStack != null && (item.getHeadType() == 2 || item.getHeadType() == 3) )
durability = (int) ((headMat.durability() + accessoryMat.durability())/2 * handleMat.handleDurability() * item.getDurabilityModifier());
{
/*Item accessoryItem = accessoryStack.getItem();
if (accessoryItem instanceof ToolPart && ((ToolPart)accessoryItem).isHead) //Two heads
durability = (int) ((EnumMaterial.durability(head) + EnumMaterial.durability(accessory))/2 * EnumMaterial.handleDurability(handle) * item.getDurabilityModifier());*/
}
ItemStack tool = new ItemStack(item);
//System.out.println("Stack name: "+tool);
NBTTagCompound compound = new NBTTagCompound();
compound.setCompoundTag("InfiTool", new NBTTagCompound());
compound.getCompoundTag("InfiTool").setInteger("Head", head);
@@ -166,25 +159,6 @@ public class ToolBuilder
return tool;
}
/*public ItemStack modifyTool (ItemStack input, ItemStack topSlot, ItemStack bottomSlot)
{
ItemStack tool = input.copy();
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
tags.removeTag("Built");
for (ToolMod mod : toolMods)
{
ItemStack[] slots = new ItemStack[] {topSlot, bottomSlot};
if (mod.matches(slots, tool))
{
mod.modify(slots, tool);
mod.addMatchingEffect(tool);
}
}
return tool;
}*/
public ItemStack modifyTool (ItemStack input, ItemStack topSlot, ItemStack bottomSlot)
{
@@ -1,6 +1,6 @@
package mods.tinker.tconstruct.crafting;
import mods.tinker.tconstruct.TContent;
import mods.tinker.tconstruct.library.TConstructRegistry;
import mods.tinker.tconstruct.library.ToolCore;
import net.minecraft.item.Item;
@@ -31,14 +31,14 @@ public class ToolRecipe
public boolean validHandle(Item handle)
{
return (handle == TContent.toolRod || handle == Item.stick || handle == Item.bone);
return (handle == TConstructRegistry.toolRod || handle == Item.stick || handle == Item.bone);
}
public boolean validAccessory(Item acc)
{
if (accessory == null && acc == null)
return true;
else if (accessory == TContent.toolRod)
else if (accessory == TConstructRegistry.toolRod)
return validHandle(acc);
else if (accessory == acc)
return true;
@@ -2,7 +2,7 @@ package mods.tinker.tconstruct.items;
import java.util.List;
import mods.tinker.tconstruct.TConstruct;
import mods.tinker.tconstruct.library.TConstructRegistry;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
@@ -21,7 +21,7 @@ public class CraftingItem extends Item
public CraftingItem(int id, String[] names, String[] tex, String f)
{
super(id);
this.setCreativeTab(TConstruct.materialTab);
this.setCreativeTab(TConstructRegistry.materialTab);
this.setMaxDamage(0);
this.setHasSubtypes(true);
textureNames = tex;
+2 -2
View File
@@ -1,9 +1,9 @@
package mods.tinker.tconstruct.items;
import mods.tinker.tconstruct.client.TProxyClient;
import mods.tinker.tconstruct.library.ToolCore;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.item.Item;
import net.minecraft.util.Icon;
public class TitleIcon extends Item
{
@@ -15,7 +15,7 @@ public class TitleIcon extends Item
@Override
public void updateIcons (IconRegister iconRegister)
{
TProxyClient.blankSprite = iconRegister.registerIcon("tinker:blanksprite");
ToolCore.blankSprite = iconRegister.registerIcon("tinker:blanksprite");
TProxyClient.metalBall = iconRegister.registerIcon("tinker:metalball");
iconIndex = iconRegister.registerIcon("tinker:tparts");
}
@@ -1,4 +1,4 @@
package mods.tinker.tconstruct;
package mods.tinker.tconstruct.library;
import ic2.api.ICustomElectricItem;
import ic2.api.IElectricItem;
@@ -7,7 +7,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Random;
import mods.tinker.tconstruct.library.ToolCore;
import mods.tinker.common.PiercingEntityDamage;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.enchantment.EnchantmentHelper;
@@ -248,7 +248,6 @@ public class AbilityHelper
{
int damage = tags.getCompoundTag("InfiTool").getInteger("Damage");
int damageTrue = damage + dam;
//System.out.println("Damaging tool, damageTrue "+damageTrue+", ignoring charge: "+ignoreCharge);
int maxDamage = tags.getCompoundTag("InfiTool").getInteger("TotalDurability");
if (damage + dam <= 0)
{
@@ -1,6 +1,5 @@
package mods.tinker.tconstruct.library;
import mods.tinker.tconstruct.tools.HarvestTool;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.item.EntityItem;
@@ -1,6 +1,5 @@
package mods.tinker.tconstruct.tools;
package mods.tinker.tconstruct.library;
import mods.tinker.tconstruct.library.ToolCore;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.item.EntityItem;
@@ -2,14 +2,8 @@ package mods.tinker.tconstruct.library;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import net.minecraft.item.ItemStack;
import mods.tinker.tconstruct.ToolMaterial;
import mods.tinker.tconstruct.client.gui.ToolGuiElement;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.item.Item;
/** A registry to store any relevant API work
*
@@ -20,9 +14,12 @@ public class TConstructRegistry
{
public static TConstructRegistry instance = new TConstructRegistry();
public static ArrayList<ToolCore> tools = new ArrayList<ToolCore>(20);
public static ArrayList<ToolGuiElement> toolButtons = new ArrayList<ToolGuiElement>(20);
public static HashMap<Integer, ToolMaterial> toolMaterials = new HashMap<Integer, ToolMaterial>(60);
public static Map<String, ItemStack> manualIcons = new HashMap<String, ItemStack>();
public static TabTools toolTab;
public static TabTools materialTab;
public static TabTools blockTab;
public static Item toolRod;
//Tools
public static void addToolMapping (ToolCore tool)
@@ -35,34 +32,18 @@ public class TConstructRegistry
return tools;
}
//Rendering
//itemMap.updateIcons
/*public static void addMaterialRenderMapping(int materialID, String textureLocation)
{
for (ToolCore tool : TConstructRegistry.getToolMapping())
{
tool.partTextures.put(materialID, textureLocation);
}
}
public static void addEffectRenderMapping(int materialID, String textureLocation)
{
for (ToolCore tool : TConstructRegistry.getToolMapping())
{
tool.effectTextures.put(materialID, textureLocation);
}
}*/
//Materials
public static void addToolMaterial (int materialID, String materialName, int craftingTier, int harvestLevel, int durability, int miningspeed, int attack, float handleModifier, int reinforced, float shoddy)
{
addToolMaterial(materialID, materialName, craftingTier, harvestLevel, durability, miningspeed, attack, handleModifier, reinforced, shoddy, "", "");
}
public static void addToolMaterial (int materialID, String materialName, int craftingTier, int harvestLevel, int durability, int miningspeed, int attack, float handleModifier, int reinforced, float shoddy, String style, String ability)
{
ToolMaterial mat = toolMaterials.get(materialID);
if (mat == null)
{
toolMaterials.put(materialID, new ToolMaterial(materialName, craftingTier, harvestLevel, durability, miningspeed, attack, handleModifier, reinforced, shoddy));
toolMaterials.put(materialID, new ToolMaterial(materialName, craftingTier, harvestLevel, durability, miningspeed, attack, handleModifier, reinforced, shoddy, style, ability));
}
else
throw new RuntimeException("TConstruct material ID " + materialID + " is already occupied by " + mat.materialName);
@@ -72,20 +53,4 @@ public class TConstructRegistry
{
return (toolMaterials.get(key));
}
//Gui
public static void addToolButton (ToolGuiElement element)
{
toolButtons.add(element);
}
public static void addToolButton (int slotType, int xButton, int yButton, int[] xIcons, int[] yIcons, String title, String body, String texture)
{
toolButtons.add(new ToolGuiElement(slotType, xButton, yButton, xIcons, yIcons, title, body, texture));
}
public static ArrayList<ToolGuiElement> getToolButtons ()
{
return toolButtons;
}
}
@@ -1,4 +1,4 @@
package mods.tinker.tconstruct;
package mods.tinker.tconstruct.library;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
+96 -103
View File
@@ -10,10 +10,6 @@ import java.util.Map;
import java.util.Random;
import mods.tinker.common.ToolMod;
import mods.tinker.tconstruct.AbilityHelper;
import mods.tinker.tconstruct.TConstruct;
import mods.tinker.tconstruct.TContent;
import mods.tinker.tconstruct.client.TProxyClient;
import mods.tinker.tconstruct.crafting.ToolBuilder;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IconRegister;
@@ -60,6 +56,7 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
{
protected Random random = new Random();
protected int damageVsEntity;
public static Icon blankSprite;
public ToolCore(int id, int baseDamage)
{
@@ -67,7 +64,7 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
this.maxStackSize = 1;
this.setMaxDamage(100);
this.setUnlocalizedName("InfiTool");
this.setCreativeTab(TConstruct.toolTab);
this.setCreativeTab(TConstructRegistry.toolTab);
damageVsEntity = baseDamage;
TConstructRegistry.addToolMapping(this);
}
@@ -236,7 +233,7 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
}
}
return TProxyClient.blankSprite;
return blankSprite;
}
/* Tags and information about the tool */
@@ -274,21 +271,24 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
list.add("\u00A7oBroken");
else
{
int head = tags.getCompoundTag("InfiTool").getInteger("Head") + 1;
int handle = tags.getCompoundTag("InfiTool").getInteger("Handle") + 1;
int binding = tags.getCompoundTag("InfiTool").getInteger("Accessory") + 1;
int head = tags.getCompoundTag("InfiTool").getInteger("Head");
int handle = tags.getCompoundTag("InfiTool").getInteger("Handle");
int binding = tags.getCompoundTag("InfiTool").getInteger("Accessory");
String headName = getAbilityNameForType(head);
if (!headName.equals(""))
list.add(getColorCodeForType(head) + headName);
list.add(getStyleForType(head) + headName);
String handleName = getAbilityNameForType(handle);
if (!handleName.equals("") && handle != head)
list.add(getColorCodeForType(handle) + handleName);
list.add(getStyleForType(handle) + handleName);
String bindingName = getAbilityNameForType(binding);
if (!bindingName.equals("") && binding != head && binding != handle)
list.add(getColorCodeForType(binding) + bindingName);
if (getPartAmount() >= 3)
{
String bindingName = getAbilityNameForType(binding);
if (!bindingName.equals("") && binding != head && binding != handle)
list.add(getStyleForType(binding) + bindingName);
}
String reinforced = getReinforcedName(head, handle, binding);
if (!reinforced.equals(""))
@@ -313,99 +313,94 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
}
}
public static String getColorCodeForType (int type) //TODO: unhardcode this
public static String getStyleForType (int type)
{
String colorCode = "\u00A7";
switch (type)
{
case 1:
return colorCode + "e"; //Wood
case 2:
return ""; //Stone
case 3:
return colorCode + "f"; //Iron
case 4:
return colorCode + "8"; //Flint
case 5:
return colorCode + "2"; //Cactus
case 6:
return colorCode + "e"; //Bone
case 7:
return colorCode + "d"; //Obsidian
case 8:
return colorCode + "4"; //Netherrack
case 9:
return colorCode + "a"; //Slime
case 10:
return colorCode + "f"; //Paper
case 11:
return colorCode + "3"; //Cobalt
case 12:
return colorCode + "4"; //Ardite
case 13:
return colorCode + "5"; //Manyullyn
case 14:
return colorCode + "c"; //Copper
case 15:
return colorCode + "6"; //Bronze
}
return colorCode;
return TConstructRegistry.getMaterial(type).style();
}
public String getAbilityNameForType (int type)//TODO: unhardcode this
public String getAbilityNameForType (int type)
{
switch (type)
{
case 1:
return ""; //Wood
case 2:
return "Shoddy"; //Stone
case 3:
return ""; //Iron
case 4:
return "Shoddy"; //Flint
case 5:
return "Spiny"; //Cactus
case 6:
return ""; //Bone
case 7:
return ""; //Obsidian
case 8:
return "Shoddy"; //Netherrack
case 9:
return ""; //Slime
case 10:
return "Writable"; //Paper
case 11:
return ""; //Cobalt
case 12:
return ""; //Ardite
case 13:
return "Awareness"; //Manyullyn
case 14:
return ""; //Copper
case 15:
return ""; //Bronze
default:
return "";
}
return TConstructRegistry.getMaterial(type).ability();
}
//This method is temporary
public static String getReinforcedName (int head, int handle, int accessory) //TODO: unhardcode this
public String getReinforcedName (int head, int handle, int accessory)
{
if (head == 7 || handle == 7 || accessory == 7)
return "\u00A7dReinforced III";
else if (head == 11 || handle == 11 || accessory == 11)
return "\u00A73Reinforced II";
else if (head == 3 || handle == 3 || accessory == 3)
return "\u00A7fReinforced I";
else if (head == 15 || handle == 15 || accessory == 15)
return "\u00A76Reinforced I";
ToolMaterial headMat = TConstructRegistry.getMaterial(head);
ToolMaterial handleMat = TConstructRegistry.getMaterial(handle);
ToolMaterial accessoryMat = TConstructRegistry.getMaterial(accessory);
int reinforced = 0;
String style = "";
int current = headMat.reinforced();
if (current > 0)
{
style = headMat.style();
reinforced = current;
}
current = handleMat.reinforced();
if (current > 0 && current > reinforced)
{
style = handleMat.style();
reinforced = current;
}
if (getPartAmount() >= 3)
{
current = accessoryMat.reinforced();
if (current > 0 && current > reinforced)
{
style = accessoryMat.style();
reinforced = current;
}
}
if (reinforced > 0)
{
return style + getReinforcedString(reinforced);
}
return "";
}
static String[] toolMaterialNames = { "Wooden ", "Stone ", "Iron ", "Flint ", "Cactus ", "Bone ", "Obsidian ", "Nethrrack ", "Slime ", "Paper ", "Cobalt ", "Ardite ", "Manyullyn ", "Copper ", "Bronze ", "Alumite ", "Steel " };
String getReinforcedString (int reinforced)
{
String ret = "Reinforced ";
switch (reinforced)
{
case 1:
ret += "I";
break;
case 2:
ret += "II";
break;
case 3:
ret += "III";
break;
case 4:
ret += "IV";
break;
case 5:
ret += "V";
break;
case 6:
ret += "VI";
break;
case 7:
ret += "VII";
break;
case 8:
ret += "VIII";
break;
case 9:
ret += "IX";
break;
default:
ret += "X";
break;
}
return ret;
}
static String[] toolMaterialNames = { "Wooden ", "Stone ", "Iron ", "Flint ", "Cactus ", "Bone ", "Obsidian ", "Nethrrack ", "Slime ", "Paper ", "Cobalt ", "Ardite ", "Manyullyn ", "Copper ",
"Bronze ", "Alumite ", "Steel " };
/* Creative mode tools */
public void getSubItems (int id, CreativeTabs tab, List list)
@@ -426,7 +421,7 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
protected Item getHandleItem ()
{
return TContent.toolRod;
return TConstructRegistry.toolRod;
}
public void onUpdate (ItemStack stack, World world, Entity entity, int par4, boolean par5)
@@ -487,8 +482,6 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
@Override
public boolean hitEntity (ItemStack stack, EntityLiving mob, EntityLiving player)
{
//AbilityHelper.hitEntity(stack, mob, player);
//AbilityHelper.damageTool(stack, 1, player, false);
return true;
}
@@ -531,7 +524,7 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
return 1f;
}
public int getDamageVsEntity (Entity par1Entity) //Redundant
public int getDamageVsEntity (Entity par1Entity)
{
return this.damageVsEntity;
}
@@ -603,7 +596,7 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
public int charge (ItemStack stack, int amount, int tier, boolean ignoreTransferLimit, boolean simulate)
{
NBTTagCompound tags = stack.getTagCompound();
if (!tags.hasKey("charge")) //|| !tags.getCompoundTag("InfiTool").getBoolean("Electric"))
if (!tags.hasKey("charge"))
return 0;
if (amount > 0)
@@ -639,7 +632,7 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
public int discharge (ItemStack stack, int amount, int tier, boolean ignoreTransferLimit, boolean simulate)
{
NBTTagCompound tags = stack.getTagCompound();
if (!tags.hasKey("charge"))// || !tags.getCompoundTag("InfiTool").getBoolean("Electric"))
if (!tags.hasKey("charge"))
return 0;
if (amount > 0)
@@ -1,28 +1,10 @@
package mods.tinker.tconstruct;
package mods.tinker.tconstruct.library;
/**
* This class is temporary. A full material registry is planned
*/
public class ToolMaterial
{
/*Wood (0, 59, 200, 0, 1.0F, 0, 0),
Stone (1, 131, 400, 1, 0.5F, 0, 1f),
Iron (2, 250, 600, 2, 1.3F, 1, 0),
Flint (1, 171, 525, 2, 0.7F, 0, 1f),
Cactus (1, 150, 500, 2, 1.0F, 0, -1f),
Bone (1, 200, 500, 2, 1.0F, 0, 0),
Obsidian (3, 89, 700, 2, 0.8F, 3, 0),
Netherrack (2, 131, 400, 1, 1.2F, 0, 1f),
Slime (3, 1500, 150, 0, 5.0F, 0, 0),
Paper (0, 131, 200, 0, 0.1F, 0, 0),
Cobalt (4, 800, 800, 3, 1.8F, 2, 0),
Ardite (4, 800, 800, 3, 1.8F, 0, 0),
Manyullyn (5, 1200, 1000, 4, 2.5F, 0, 0),
Copper (1, 180, 500, 2, 1.15F, 0, 0),
Bronze (2, 250, 600, 2, 1.3F, 1, 0),
Demonite (5, 1790, 900, 5, 1.66F, 0, 0),
Holyshell (5, 1000, 700, 1, 1.5F, 0, 0);*/
//mining level, durability, mining speed, baseDamage, handle modifier, Reinforced level, shoddy/spiny level
{
//mining level, durability, mining speed, baseDamage, handle modifier, Reinforced level, shoddy/spiny level, color/style on name
public final String materialName;
public final int craftingTier;
@@ -33,18 +15,27 @@ public class ToolMaterial
public final float handleModifier;
public final int reinforced;
public final float shoddy;
public final String tipStyle;
public final String ability;
public ToolMaterial(String name, int tier, int level, int durability, int speed, int damage, float handle, int reinforced, float shoddy)
{
this(name, reinforced, reinforced, reinforced, reinforced, reinforced, shoddy, reinforced, shoddy, "", "");
}
public ToolMaterial(String name, int tier, int level, int dur, int speed, int damage, float handle, int unb, float shd)
public ToolMaterial(String name, int tier, int level, int durability, int speed, int damage, float handle, int reinforced, float shoddy, String style, String ability)
{
this.materialName = name;
this.craftingTier = tier;
this.harvestLevel = level;
this.durability = dur;
this.durability = durability;
this.miningspeed = speed;
this.attack = damage;
this.handleModifier = handle;
this.reinforced = unb;
this.shoddy = shd;
this.reinforced = reinforced;
this.shoddy = shoddy;
this.tipStyle = style;
this.ability = ability;
}
public String name()
@@ -91,4 +82,15 @@ public class ToolMaterial
{
return this.shoddy;
}
public String style()
{
System.out.println("Style: "+this.tipStyle);
return this.tipStyle;
}
public String ability()
{
return this.ability;
}
}
@@ -1,13 +1,17 @@
package mods.tinker.tconstruct.library;
package mods.tinker.tconstruct.library.client;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import mods.tinker.tconstruct.library.TConstructRegistry;
import mods.tinker.tconstruct.library.ToolCore;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public class TConstructClientRegistry
{
public static ArrayList<ToolGuiElement> toolButtons = new ArrayList<ToolGuiElement>(20);
public static Map<String, ItemStack> manualIcons = new HashMap<String, ItemStack>();
public static ItemStack defaultStack = new ItemStack(Item.ingotIron);
@@ -52,4 +56,20 @@ public class TConstructClientRegistry
return stack;
return defaultStack;
}
//Gui
public static void addToolButton (ToolGuiElement element)
{
toolButtons.add(element);
}
public static void addToolButton (int slotType, int xButton, int yButton, int[] xIcons, int[] yIcons, String title, String body, String texture)
{
toolButtons.add(new ToolGuiElement(slotType, xButton, yButton, xIcons, yIcons, title, body, texture));
}
public static ArrayList<ToolGuiElement> getToolButtons ()
{
return toolButtons;
}
}
@@ -1,4 +1,4 @@
package mods.tinker.tconstruct.client.gui;
package mods.tinker.tconstruct.library.client;
public class ToolGuiElement
{
@@ -4,10 +4,10 @@ import java.lang.ref.WeakReference;
import java.util.HashMap;
import java.util.Random;
import mods.tinker.tconstruct.AbilityHelper;
import mods.tinker.tconstruct.PHConstruct;
import mods.tinker.tconstruct.TContent;
import mods.tinker.tconstruct.client.TProxyClient;
import mods.tinker.tconstruct.library.AbilityHelper;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity;
+2 -1
View File
@@ -1,7 +1,8 @@
package mods.tinker.tconstruct.tools;
import mods.tinker.tconstruct.AbilityHelper;
import mods.tinker.tconstruct.TContent;
import mods.tinker.tconstruct.library.AbilityHelper;
import mods.tinker.tconstruct.library.HarvestTool;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLiving;
+1 -1
View File
@@ -1,7 +1,7 @@
package mods.tinker.tconstruct.tools;
import mods.tinker.tconstruct.AbilityHelper;
import mods.tinker.tconstruct.TContent;
import mods.tinker.tconstruct.library.AbilityHelper;
import mods.tinker.tconstruct.library.Weapon;
import mods.tinker.tconstruct.logic.EquipLogic;
import net.minecraft.entity.EntityLiving;
+1 -6
View File
@@ -2,14 +2,9 @@ package mods.tinker.tconstruct.tools;
import java.util.ArrayList;
import mods.tinker.tconstruct.AbilityHelper;
import net.minecraft.block.Block;
import mods.tinker.tconstruct.library.HarvestTool;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class Hammer extends HarvestTool
{
+2 -1
View File
@@ -2,8 +2,9 @@ package mods.tinker.tconstruct.tools;
import java.util.List;
import mods.tinker.tconstruct.AbilityHelper;
import mods.tinker.tconstruct.TContent;
import mods.tinker.tconstruct.library.AbilityHelper;
import mods.tinker.tconstruct.library.HarvestTool;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
+1 -1
View File
@@ -1,7 +1,7 @@
package mods.tinker.tconstruct.tools;
import mods.tinker.tconstruct.AbilityHelper;
import mods.tinker.tconstruct.TContent;
import mods.tinker.tconstruct.library.AbilityHelper;
import mods.tinker.tconstruct.library.DualHarvestTool;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
@@ -1,6 +1,7 @@
package mods.tinker.tconstruct.tools;
import mods.tinker.tconstruct.TContent;
import mods.tinker.tconstruct.library.HarvestTool;
import net.minecraft.block.material.Material;
import net.minecraft.item.Item;
+1 -1
View File
@@ -1,7 +1,7 @@
package mods.tinker.tconstruct.tools;
import mods.tinker.tconstruct.AbilityHelper;
import mods.tinker.tconstruct.TContent;
import mods.tinker.tconstruct.library.AbilityHelper;
import mods.tinker.tconstruct.library.Weapon;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
+1 -4
View File
@@ -1,12 +1,9 @@
package mods.tinker.tconstruct.tools;
import mods.tinker.tconstruct.TContent;
import mods.tinker.tconstruct.client.TProxyClient;
import mods.tinker.tconstruct.library.HarvestTool;
import net.minecraft.block.material.Material;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.Icon;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+1 -2
View File
@@ -1,6 +1,5 @@
package test;
import mods.tinker.tconstruct.entity.BlueSlime;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
@@ -28,7 +27,7 @@ public class XinStick extends Item
//spawnItem(player.posX, player.posY, player.posZ, tool, world);
//CartEntity cart = new CartEntity(world, 1);
//cart.cartType = 1;
spawnEntity(player.posX, player.posY+1, player.posZ, new BlueSlime(world), world, player);
//spawnEntity(player.posX, player.posY+1, player.posZ, new BlueSlime(world), world, player);
return stack;
}