Made battlesigns have editable text

This commit is contained in:
Arthur Uzulin committed 2014-09-12 23:59:13 +10:00
1 parent fc0d73dbf6
commit 3d028e7123
20 files changed
+545 -205

No files matched your search

@@ -1,11 +1,13 @@
package tconstruct.items.tools;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.*;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.*;
import net.minecraft.world.World;
import tconstruct.TConstruct;
import tconstruct.library.tools.Weapon;
import tconstruct.tools.TinkerTools;
import tconstruct.tools.*;
import tconstruct.tools.logic.EquipLogic;
public class BattleSign extends Weapon
@@ -16,50 +18,12 @@ public class BattleSign extends Weapon
this.setUnlocalizedName("InfiTool.Battlesign");
}
/*
* public ItemStack onItemRightClick(ItemStack stack, World world,
* EntityPlayer player) { if (!player.isSneaking())
* player.setItemInUse(stack, this.getMaxItemUseDuration(stack)); return
* stack; }
*/
@Override
public String getToolName ()
{
return "Battlesign";
}
/*
* public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer player,
* World par3World, int par4, int par5, int par6, int par7, float par8,
* float par9, float par10) { if (par7 == 0 || !player.isSneaking()) {
* return false; } else if (!par3World.getBlockMaterial(par4, par5,
* par6).isSolid()) { return false; } else { if (par7 == 1) { ++par5; }
*
* if (par7 == 2) { --par6; }
*
* if (par7 == 3) { ++par6; }
*
* if (par7 == 4) { --par4; }
*
* if (par7 == 5) { ++par4; }
*
* if (!player.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) {
* return false; } else if (!Block.signPost.canPlaceBlockAt(par3World, par4,
* par5, par6)) { return false; } else { if (par7 == 1) { int var11 =
* MathHelper.floor_double((double)((player.rotationYaw + 180.0F) * 16.0F /
* 360.0F) + 0.5D) & 15; par3World.setBlock(par4, par5, par6,
* Block.signPost.blockID, var11); } else { par3World.setBlock(par4, par5,
* par6, Block.signWall.blockID, par7); }
*
* //--par1ItemStack.stackSize; TileEntitySign var12 =
* (TileEntitySign)par3World.getBlockTileEntity(par4, par5, par6);
*
* if (var12 != null) { player.displayGUIEditSign(var12); }
*
* return true; } } }
*/
@Override
public Item getHeadItem ()
{
@@ -176,6 +140,11 @@ public class BattleSign extends Weapon
logic.setEquipmentItem(stack);
--stack.stackSize;
if (FMLCommonHandler.instance().getSide() == Side.CLIENT)
{
player.openGui(TConstruct.instance, ToolProxyClient.battlesignTextID, world, x, y, z);
}
return true;
}
}