more manual movement work

This commit is contained in:
Progwml6 committed 2013-12-14 21:27:37 -05:00
1 parent be333cace0
commit 7dade36215
5 files changed
+8 -56

No files matched your search

@@ -98,11 +98,6 @@ public class TProxyClient extends TProxyCommon
if (ID == furnaceID)
return new FurnaceGui(player.inventory, (FurnaceLogic) world.getBlockTileEntity(x, y, z));
if (ID == manualGuiID)
{
ItemStack stack = player.getCurrentEquippedItem();
return new GuiManual(stack, TProxyClient.getManualFromStack(stack));
}
if (ID == inventoryGui)
{
GuiInventory inventory = new GuiInventory(player);
@@ -34,7 +34,7 @@ public class TProxyCommon implements IGuiHandler
public static int armorGuiID = 101;
public static int knapsackGuiID = 102;
public static int manualGuiID = -1;
// public static int manualGuiID = -1;// moved to Mantle
@Override
public Object getServerGuiElement (int ID, EntityPlayer player, World world, int x, int y, int z)
@@ -19,63 +19,20 @@ import net.minecraft.util.MathHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class CraftingItem extends Item
public class CraftingItem extends mantle.items.abstracts.CraftingItem
{
public String[] textureNames;
public String[] unlocalizedNames;
public String folder;
public Icon[] icons;
public CraftingItem(int id, String[] names, String[] tex, String folder)
{
super(id);
this.setCreativeTab(TConstructRegistry.materialTab);
this.setMaxDamage(0);
this.setHasSubtypes(true);
this.textureNames = tex;
this.unlocalizedNames = names;
this.folder = folder;
}
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage (int meta)
{
int arr = MathHelper.clamp_int(meta, 0, unlocalizedNames.length);
return icons[arr];
super(id, names, tex, folder, "tinker", TConstructRegistry.materialTab);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons (IconRegister iconRegister)
public void onCreated (ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
this.icons = new Icon[textureNames.length];
for (int i = 0; i < this.icons.length; ++i)
if (par1ItemStack.itemID == TRepo.blankPattern.itemID)
{
if (!(textureNames[i].equals("")))
this.icons[i] = iconRegister.registerIcon("tinker:" + folder + textureNames[i]);
par3EntityPlayer.addStat(TAchievements.achievements.get("tconstruct.pattern"), 1);
}
}
public String getUnlocalizedName (ItemStack stack)
{
int arr = MathHelper.clamp_int(stack.getItemDamage(), 0, unlocalizedNames.length);
return getUnlocalizedName() + "." + unlocalizedNames[arr];
}
public void getSubItems (int id, CreativeTabs tab, List list)
{
for (int i = 0; i < unlocalizedNames.length; i++)
if (!(textureNames[i].equals("")))
list.add(new ItemStack(id, 1, i));
}
@Override
public void onCreated(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
if(par1ItemStack.itemID == TRepo.blankPattern.itemID){
par3EntityPlayer.addStat(TAchievements.achievements.get("tconstruct.pattern"), 1);
}
}
}
+1 -1
View File
@@ -28,7 +28,7 @@ public class Manual extends CraftingItem
public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer player)
{
player.addStat(TAchievements.achievements.get("tconstruct.beginner"), 1);
player.openGui(TConstruct.instance, TConstruct.proxy.manualGuiID, world, 0, 0, 0);
player.openGui(TConstruct.instance, mantle.client.MProxyClient.manualGuiID, world, 0, 0, 0);
/*Side side = FMLCommonHandler.instance().getEffectiveSide();
if (side.isClient())
FMLClientHandler.instance().displayGuiScreen(player, new GuiManual(player.getCurrentEquippedItem(), getManualFromStack(stack)));*/