Knapsacks and new modifiers
@ -12,6 +12,7 @@
|
||||
<entry key="inventory.PatternChest">Pattern Chest</entry>
|
||||
<entry key="crafters.Smeltery">Smeltery</entry>
|
||||
<entry key="crafters.Frypan">Frying Pan</entry>
|
||||
<entry key="inventory.knapsack">Knapsack</entry>
|
||||
|
||||
<entry key="ToolStation.Crafter.name">Tool Station</entry>
|
||||
<entry key="ToolStation.Parts.name">Part Builder</entry>
|
||||
|
@ -244,6 +244,24 @@ Class: Lethal Joke Weapon</text>
|
||||
</item>
|
||||
</page>
|
||||
|
||||
<page type="toolpage">
|
||||
<title>Chisel</title>
|
||||
<text>The Battlesign is an advance in weapon technology worthy of Zombie Pigmen everywhere.</text>
|
||||
<text>Right-click: Block
|
||||
- Blocking cuts a wide variety of damage types in half.
|
||||
|
||||
Class: Utility Tool</text>
|
||||
<icon>chiselicon</icon>
|
||||
<item>
|
||||
<text>Chisel Head</text>
|
||||
<icon>chiselhead</icon>
|
||||
</item>
|
||||
<item>
|
||||
<text>Tool Rod</text>
|
||||
<icon>toolrod</icon>
|
||||
</item>
|
||||
</page>
|
||||
|
||||
<page type="sectionpage">
|
||||
<title>Material Traits</title>
|
||||
<text>Some materials have traits that augment their natural uses.
|
||||
@ -255,9 +273,6 @@ Class: Lethal Joke Weapon</text>
|
||||
- Awareness: Unknown</text>
|
||||
</page>
|
||||
|
||||
<page type="blank">
|
||||
</page>
|
||||
|
||||
<page type="materialstats">
|
||||
<title>Wood</title>
|
||||
<icon>woodaxe</icon>
|
||||
@ -531,6 +546,22 @@ Stackable: No</text>
|
||||
<recipe>lavacrystalmod</recipe>
|
||||
</page>
|
||||
|
||||
<page type="crafting">
|
||||
<text>Ball of Moss</text>
|
||||
<recipe>
|
||||
<name>mossball</name>
|
||||
<size>three</size>
|
||||
</recipe>
|
||||
</page>
|
||||
|
||||
<page type="crafting">
|
||||
<text>Lava Crystal</text>
|
||||
<recipe>
|
||||
<name>lavacrystal</name>
|
||||
<size>three</size>
|
||||
</recipe>
|
||||
</page>
|
||||
|
||||
<page type="sectionpage">
|
||||
<title>Luck</title>
|
||||
<text>Encrusting lapis on tools is a gift to the gods of luck. They will bless your tool with great fortune and loot.
|
||||
@ -634,6 +665,102 @@ Stackable: No</text>
|
||||
</recipe>
|
||||
</page>
|
||||
|
||||
<page type="sectionpage">
|
||||
<title>Reinforced</title>
|
||||
<text>Adding an obsidian plate to the tool seems to help with its durability.
|
||||
|
||||
Effects:
|
||||
- Adds the material trait Reinforced to the tool
|
||||
- Stacks with previous levels of Reinforced
|
||||
|
||||
Type: Single-use
|
||||
Stackable: Yes</text>
|
||||
</page>
|
||||
|
||||
<page type="modifier">
|
||||
<tooltype>tool</tooltype>
|
||||
<recipe>reinforcedmod</recipe>
|
||||
</page>
|
||||
|
||||
<page type="sectionpage">
|
||||
<title>Knockback</title>
|
||||
<text>Attaching a piston to the tool and activating it at the right time seems to throw mobs further away.
|
||||
|
||||
Effects:
|
||||
- Adds extra knockback to the tool.
|
||||
|
||||
Type: Multi-use
|
||||
Stackable: Yes</text>
|
||||
</page>
|
||||
|
||||
<page type="modifier">
|
||||
<tooltype>weapon</tooltype>
|
||||
<recipe>pistonmod</recipe>
|
||||
</page>
|
||||
|
||||
<page type="sectionpage">
|
||||
<title>Beheading</title>
|
||||
<text>Working an ender pearl and some obsidian on a weapon has the curious effect of separating the target's head from its body.
|
||||
|
||||
Effects:
|
||||
- Beheads mobs. Enemies drop their heads as a result.
|
||||
|
||||
Type: Single-use
|
||||
Stackable: Yes</text>
|
||||
</page>
|
||||
|
||||
<page type="modifier">
|
||||
<tooltype>weapon</tooltype>
|
||||
<recipe>beheadingmod</recipe>
|
||||
</page>
|
||||
|
||||
<page type="sectionpage">
|
||||
<title>Bane of Arthropods</title>
|
||||
<text>Striking a spider with its own eyeball causes it to recoil in fear.
|
||||
|
||||
Effects:
|
||||
- Does extra damage to spiders.
|
||||
- 1-2 hearts per level.
|
||||
|
||||
Type: Multi-use
|
||||
Stackable: Yes</text>
|
||||
</page>
|
||||
|
||||
<page type="modifier">
|
||||
<tooltype>weapon</tooltype>
|
||||
<recipe>spidermod</recipe>
|
||||
</page>
|
||||
|
||||
<page type="sectionpage">
|
||||
<title>Smite</title>
|
||||
<text>The raw power of consecrated soil empowers your weapon, smiting enemies from on high.
|
||||
|
||||
Effects:
|
||||
- Does extra damage to undead.
|
||||
- 1-2 hearts per level.
|
||||
|
||||
Type: Multi-use
|
||||
Stackable: Yes</text>
|
||||
</page>
|
||||
|
||||
<page type="modifier">
|
||||
<tooltype>weapon</tooltype>
|
||||
<recipe>smitemod</recipe>
|
||||
</page>
|
||||
|
||||
<page type="crafting">
|
||||
<text>Graveyard Soil</text>
|
||||
<recipe>
|
||||
<name>graveyardsoil</name>
|
||||
<size>two</size>
|
||||
</recipe>
|
||||
</page>
|
||||
|
||||
<page type="smelting">
|
||||
<text>Consecrated Soil</text>
|
||||
<recipe>consecratedsoil</recipe>
|
||||
</page>
|
||||
|
||||
<page type="sectionpage">
|
||||
<title>Electric</title>
|
||||
<text>Adding a battery and a circuit to a tool gives it an electric field. The tool still functions properly when the battery has no charge.
|
||||
@ -684,20 +811,4 @@ Stackable: No</text>
|
||||
<recipe>tier2free</recipe>
|
||||
</page>
|
||||
|
||||
<page type="crafting">
|
||||
<text>Ball of Moss</text>
|
||||
<recipe>
|
||||
<name>mossball</name>
|
||||
<size>three</size>
|
||||
</recipe>
|
||||
</page>
|
||||
|
||||
<page type="crafting">
|
||||
<text>Lava Crystal</text>
|
||||
<recipe>
|
||||
<name>lavacrystal</name>
|
||||
<size>three</size>
|
||||
</recipe>
|
||||
</page>
|
||||
|
||||
</book>
|
@ -38,7 +38,7 @@ import cpw.mods.fml.common.registry.VillagerRegistry;
|
||||
* @dependencies: IC2 API, MFR API
|
||||
*/
|
||||
|
||||
@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.3.dev.58", dependencies = "required-after:Forge@[7.7.1.675,)")
|
||||
@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.3.dev.61", dependencies = "required-after:Forge@[7.7.1.675,)")
|
||||
@NetworkMod(serverSideRequired = false, clientSideRequired = true, channels = { "TConstruct" }, packetHandler = mods.tinker.tconstruct.util.network.TPacketHandler.class)
|
||||
public class TConstruct
|
||||
{
|
||||
|
@ -505,28 +505,48 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
int southID = worldObj.getBlockId(x, y, z - 1);
|
||||
int eastID = worldObj.getBlockId(x + 1, y, z);
|
||||
int westID = worldObj.getBlockId(x - 1, y, z);
|
||||
|
||||
Block northBlock = Block.blocksList[northID];
|
||||
Block southBlock = Block.blocksList[southID];
|
||||
Block eastBlock = Block.blocksList[eastID];
|
||||
Block westBlock = Block.blocksList[westID];
|
||||
|
||||
if (northID == 0 && southID == 0 && eastID == 0 && westID == 0) //Center
|
||||
if ( (northBlock == null || northBlock.isAirBlock(worldObj, x, y, z + 1)) &&
|
||||
(southBlock == null || southBlock.isAirBlock(worldObj, x, y, z - 1)) &&
|
||||
(eastBlock == null || eastBlock.isAirBlock(worldObj, x + 1, y, z)) &&
|
||||
(westBlock == null || westBlock.isAirBlock(worldObj, x - 1, y, z)) )
|
||||
{
|
||||
checkValidStructure(x, y, z);
|
||||
}
|
||||
|
||||
else if (northID != 0 && southID == 0 && eastID == 0 && westID == 0)
|
||||
else if ( (northBlock != null && !northBlock.isAirBlock(worldObj, x, y, z + 1)) &&
|
||||
(southBlock == null || southBlock.isAirBlock(worldObj, x, y, z - 1)) &&
|
||||
(eastBlock == null || eastBlock.isAirBlock(worldObj, x + 1, y, z)) &&
|
||||
(westBlock == null || westBlock.isAirBlock(worldObj, x - 1, y, z)) )
|
||||
{
|
||||
checkValidStructure(x, y, z - 1);
|
||||
}
|
||||
|
||||
else if (northID == 0 && southID != 0 && eastID == 0 && westID == 0)
|
||||
else if ( (northBlock == null || northBlock.isAirBlock(worldObj, x, y, z + 1)) &&
|
||||
(southBlock != null && !southBlock.isAirBlock(worldObj, x, y, z - 1)) &&
|
||||
(eastBlock == null || eastBlock.isAirBlock(worldObj, x + 1, y, z)) &&
|
||||
(westBlock == null || westBlock.isAirBlock(worldObj, x - 1, y, z)) )
|
||||
{
|
||||
checkValidStructure(x, y, z + 1);
|
||||
}
|
||||
|
||||
else if (northID == 0 && southID == 0 && eastID != 0 && westID == 0)
|
||||
else if ( (northBlock == null || northBlock.isAirBlock(worldObj, x, y, z + 1)) &&
|
||||
(southBlock == null || southBlock.isAirBlock(worldObj, x, y, z - 1)) &&
|
||||
(eastBlock != null && !eastBlock.isAirBlock(worldObj, x + 1, y, z)) &&
|
||||
(westBlock == null || westBlock.isAirBlock(worldObj, x - 1, y, z)) )
|
||||
{
|
||||
checkValidStructure(x - 1, y, z);
|
||||
}
|
||||
|
||||
else if (northID == 0 && southID == 0 && eastID == 0 && westID != 0)
|
||||
else if ( (northBlock == null || northBlock.isAirBlock(worldObj, x, y, z + 1)) &&
|
||||
(southBlock == null || southBlock.isAirBlock(worldObj, x, y, z - 1)) &&
|
||||
(eastBlock == null || eastBlock.isAirBlock(worldObj, x + 1, y, z)) &&
|
||||
(westBlock != null && !westBlock.isAirBlock(worldObj, x - 1, y, z)) )
|
||||
{
|
||||
checkValidStructure(x + 1, y, z);
|
||||
}
|
||||
@ -570,13 +590,15 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
numBricks = 0;
|
||||
lavaTanks.clear();
|
||||
boolean hasLavaTank = false;
|
||||
Block block;
|
||||
|
||||
//Check inside
|
||||
for (int xPos = x - 1; xPos <= x + 1; xPos++)
|
||||
{
|
||||
for (int zPos = z - 1; zPos <= z + 1; zPos++)
|
||||
{
|
||||
if (worldObj.getBlockId(xPos, y, zPos) != 0)
|
||||
block = Block.blocksList[worldObj.getBlockId(xPos, y, zPos)];
|
||||
if (block != null && !block.isAirBlock(worldObj, xPos, y, zPos))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ import mods.tinker.tconstruct.TConstruct;
|
||||
import mods.tinker.tconstruct.skill.Skill;
|
||||
import mods.tinker.tconstruct.util.player.TPlayerStats;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.gui.inventory.GuiInventory;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@ -35,6 +36,8 @@ public class TControls extends TKeyHandler
|
||||
boolean climbing = false;
|
||||
boolean onGround = false;
|
||||
boolean onStilts = false;
|
||||
|
||||
int currentTab = 1;
|
||||
|
||||
//boolean onStilts = false;
|
||||
|
||||
@ -70,7 +73,7 @@ public class TControls extends TKeyHandler
|
||||
}
|
||||
if (kb == invKey && mc.currentScreen != null && mc.currentScreen.getClass() == GuiInventory.class)// && !mc.playerController.isInCreativeMode())
|
||||
{
|
||||
TProxyClient.addTabsToInventory();
|
||||
TProxyClient.addTabsToInventory((GuiContainer) mc.currentScreen);
|
||||
}
|
||||
/*if (kb == skillOne)
|
||||
{
|
||||
@ -195,15 +198,32 @@ public class TControls extends TKeyHandler
|
||||
|
||||
updateServer(bos);
|
||||
}
|
||||
|
||||
public static void openInventoryGui ()
|
||||
{
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream(8);
|
||||
DataOutputStream outputStream = new DataOutputStream(bos);
|
||||
try
|
||||
{
|
||||
outputStream.writeByte(3);
|
||||
outputStream.writeByte(0);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
public static void openArmorGui ()//String username)
|
||||
updateServer(bos);
|
||||
}
|
||||
|
||||
public static void openArmorGui ()
|
||||
{
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream(8);
|
||||
DataOutputStream outputStream = new DataOutputStream(bos);
|
||||
try
|
||||
{
|
||||
outputStream.writeByte(3);
|
||||
//outputStream.writeUTF(username);
|
||||
outputStream.writeByte(1);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@ -212,6 +232,23 @@ public class TControls extends TKeyHandler
|
||||
|
||||
updateServer(bos);
|
||||
}
|
||||
|
||||
public static void openKnapsackGui ()
|
||||
{
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream(8);
|
||||
DataOutputStream outputStream = new DataOutputStream(bos);
|
||||
try
|
||||
{
|
||||
outputStream.writeByte(3);
|
||||
outputStream.writeByte(2);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
updateServer(bos);
|
||||
}
|
||||
|
||||
/*public void activateSkill (EntityPlayer player, int slot)
|
||||
{
|
||||
|
@ -16,8 +16,8 @@ import mods.tinker.tconstruct.blocks.logic.FrypanLogic;
|
||||
import mods.tinker.tconstruct.blocks.logic.GolemCoreLogic;
|
||||
import mods.tinker.tconstruct.blocks.logic.PartCrafterLogic;
|
||||
import mods.tinker.tconstruct.blocks.logic.PatternChestLogic;
|
||||
import mods.tinker.tconstruct.blocks.logic.StencilTableLogic;
|
||||
import mods.tinker.tconstruct.blocks.logic.SmelteryLogic;
|
||||
import mods.tinker.tconstruct.blocks.logic.StencilTableLogic;
|
||||
import mods.tinker.tconstruct.blocks.logic.ToolForgeLogic;
|
||||
import mods.tinker.tconstruct.blocks.logic.ToolStationLogic;
|
||||
import mods.tinker.tconstruct.client.block.BarricadeRender;
|
||||
@ -46,10 +46,12 @@ import mods.tinker.tconstruct.client.entity.projectile.LaunchedItemRender;
|
||||
import mods.tinker.tconstruct.client.gui.ArmorExtendedGui;
|
||||
import mods.tinker.tconstruct.client.gui.FrypanGui;
|
||||
import mods.tinker.tconstruct.client.gui.GuiManual;
|
||||
import mods.tinker.tconstruct.client.gui.InventoryTab;
|
||||
import mods.tinker.tconstruct.client.gui.KnapsackGui;
|
||||
import mods.tinker.tconstruct.client.gui.PartCrafterGui;
|
||||
import mods.tinker.tconstruct.client.gui.PatternChestGui;
|
||||
import mods.tinker.tconstruct.client.gui.StencilTableGui;
|
||||
import mods.tinker.tconstruct.client.gui.SmelteryGui;
|
||||
import mods.tinker.tconstruct.client.gui.StencilTableGui;
|
||||
import mods.tinker.tconstruct.client.gui.ToolForgeGui;
|
||||
import mods.tinker.tconstruct.client.gui.ToolStationGui;
|
||||
import mods.tinker.tconstruct.common.TContent;
|
||||
@ -64,16 +66,18 @@ import mods.tinker.tconstruct.entity.Skyla;
|
||||
import mods.tinker.tconstruct.entity.SlimeClone;
|
||||
import mods.tinker.tconstruct.entity.projectile.DaggerEntity;
|
||||
import mods.tinker.tconstruct.entity.projectile.LaunchedPotion;
|
||||
import mods.tinker.tconstruct.items.tools.Dagger;
|
||||
import mods.tinker.tconstruct.library.TConstructRegistry;
|
||||
import mods.tinker.tconstruct.library.client.TConstructClientRegistry;
|
||||
import mods.tinker.tconstruct.library.client.ToolGuiElement;
|
||||
import mods.tinker.tconstruct.library.crafting.ToolBuilder;
|
||||
import mods.tinker.tconstruct.library.tools.ToolCore;
|
||||
import mods.tinker.tconstruct.util.player.ArmorExtended;
|
||||
import mods.tinker.tconstruct.util.player.KnapsackInventory;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.gui.inventory.GuiInventory;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.model.ModelSlime;
|
||||
import net.minecraft.client.particle.EntityAuraFX;
|
||||
@ -130,8 +134,9 @@ public class TProxyClient extends TProxyCommon
|
||||
public static Icon metalBall;
|
||||
public static Minecraft mc;
|
||||
public static RenderItem itemRenderer = new RenderItem();
|
||||
|
||||
|
||||
public static ArmorExtended armorExtended = new ArmorExtended();
|
||||
public static KnapsackInventory knapsack = new KnapsackInventory();
|
||||
|
||||
@Override
|
||||
public Object getClientGuiElement (int ID, EntityPlayer player, World world, int x, int y, int z)
|
||||
@ -155,71 +160,102 @@ public class TProxyClient extends TProxyCommon
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
return new GuiManual(stack, TProxyClient.getManualFromStack(stack));
|
||||
}
|
||||
if (ID == inventoryGui)
|
||||
{
|
||||
GuiInventory inventory = new GuiInventory(player);
|
||||
addTabsToInventory(inventory);
|
||||
return inventory;
|
||||
}
|
||||
if (ID == armorGuiID)
|
||||
{
|
||||
//TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.username);
|
||||
TProxyClient.armorExtended.init(Minecraft.getMinecraft().thePlayer);
|
||||
return new ArmorExtendedGui(player.inventory, TProxyClient.armorExtended);
|
||||
}
|
||||
if (ID == knapsackGuiID)
|
||||
{
|
||||
TProxyClient.knapsack.init(Minecraft.getMinecraft().thePlayer);
|
||||
return new KnapsackGui(player.inventory, TProxyClient.knapsack);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void renderStandardInvBlock(RenderBlocks renderblocks, Block block, int meta)
|
||||
{
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, -1F, 0.0F);
|
||||
renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, meta));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 1.0F, 0.0F);
|
||||
renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, meta));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 0.0F, -1F);
|
||||
renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, meta));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 0.0F, 1.0F);
|
||||
renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(3, meta));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(-1F, 0.0F, 0.0F);
|
||||
renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(4, meta));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(1.0F, 0.0F, 0.0F);
|
||||
renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, meta));
|
||||
tessellator.draw();
|
||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||
}
|
||||
|
||||
public static void renderStandardInvBlock (RenderBlocks renderblocks, Block block, int meta)
|
||||
{
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, -1F, 0.0F);
|
||||
renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, meta));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 1.0F, 0.0F);
|
||||
renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, meta));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 0.0F, -1F);
|
||||
renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, meta));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 0.0F, 1.0F);
|
||||
renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(3, meta));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(-1F, 0.0F, 0.0F);
|
||||
renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(4, meta));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(1.0F, 0.0F, 0.0F);
|
||||
renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, meta));
|
||||
tessellator.draw();
|
||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||
}
|
||||
|
||||
public static void openInventoryGui ()
|
||||
{
|
||||
/*if (mc == null)
|
||||
//controlInstance.openInventoryGui();
|
||||
if (mc == null)
|
||||
mc = Minecraft.getMinecraft();
|
||||
mc.displayGuiScreen(new GuiInventory(mc.thePlayer));
|
||||
addTabsToInventory();*/
|
||||
GuiInventory inventory = new GuiInventory(mc.thePlayer);
|
||||
mc.displayGuiScreen(inventory);
|
||||
addTabsToInventory(inventory);
|
||||
}
|
||||
|
||||
public static void addTabsToInventory ()
|
||||
public static void addTabsToInventory (GuiContainer gui)
|
||||
{
|
||||
/*if (mc == null)
|
||||
mc = Minecraft.getMinecraft();
|
||||
if (mc.currentScreen.getClass() == GuiInventory.class)
|
||||
mc = Minecraft.getMinecraft();*/
|
||||
if (gui.getClass() == GuiInventory.class || classMatches(gui, "micdoodle8.mods.galacticraft.core.client.gui.GCCoreGuiInventory"))
|
||||
{
|
||||
GuiInventory gui = (GuiInventory) mc.currentScreen;
|
||||
int cornerX = (gui.width - gui.xSize) / 2;
|
||||
int cornerX = gui.guiLeft;
|
||||
int cornerY = (gui.height - gui.ySize) / 2;
|
||||
gui.buttonList.clear();
|
||||
|
||||
InventoryTab repairButton = new InventoryTab(2, cornerX, cornerY - 28, new ItemStack(Block.workbench), 0);
|
||||
repairButton.enabled = false;
|
||||
gui.buttonList.add(repairButton);
|
||||
repairButton = new InventoryTab(3, cornerX + 28, cornerY - 28, new ItemStack(Item.plateDiamond), 1);
|
||||
gui.buttonList.add(repairButton);
|
||||
}*/
|
||||
InventoryTab tab = new InventoryTab(2, cornerX, cornerY - 28, new ItemStack(Block.workbench), 0);
|
||||
tab.enabled = false;
|
||||
gui.buttonList.add(tab);
|
||||
tab = new InventoryTab(3, cornerX + 28, cornerY - 28, new ItemStack(Item.plateDiamond), 1);
|
||||
gui.buttonList.add(tab);
|
||||
if (armorExtended.inventory[2] != null && armorExtended.inventory[2].getItem() == TContent.knapsack)
|
||||
{
|
||||
if (gui.buttonList.size() < 3)
|
||||
{
|
||||
tab = new InventoryTab(4, cornerX + 56, cornerY - 28, new ItemStack(TContent.knapsack), 1);
|
||||
gui.buttonList.add(tab);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean classMatches (Object paramObject, String paramString)
|
||||
{
|
||||
try
|
||||
{
|
||||
return paramObject.getClass().getName().equals(paramString);
|
||||
}
|
||||
catch (Exception localException)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void registerTickHandler ()
|
||||
@ -415,6 +451,9 @@ public class TProxyClient extends TProxyCommon
|
||||
|
||||
ItemStack silkyCloth = new ItemStack(TContent.materials, 1, 25);
|
||||
|
||||
ItemStack graveyardsoil = new ItemStack(TContent.craftedSoil, 1, 3);
|
||||
ItemStack consecratedsoil = new ItemStack(TContent.craftedSoil, 1, 4);
|
||||
|
||||
//TConstruct recipes
|
||||
TConstructClientRegistry.registerManualSmallRecipe("blankpattern", pattern, plank, stick, stick, plank);
|
||||
TConstructClientRegistry.registerManualSmallRecipe("toolstation", new ItemStack(TContent.toolStationWood, 1, 0), null, pattern, null, workbench);
|
||||
@ -433,6 +472,9 @@ public class TProxyClient extends TProxyCommon
|
||||
TConstructClientRegistry.registerManualLargeRecipe("silkyjewel", new ItemStack(TContent.materials, 1, 26), null, silkyCloth, null, silkyCloth, new ItemStack(Item.emerald), silkyCloth, null,
|
||||
silkyCloth, null);
|
||||
|
||||
TConstructClientRegistry.registerManualSmallRecipe("graveyardsoil", graveyardsoil, new ItemStack(Block.dirt), new ItemStack(Item.rottenFlesh), new ItemStack(Item.dyePowder, 1, 15), null);
|
||||
TConstructClientRegistry.registerManualFurnaceRecipe("consecratedsoil", consecratedsoil, graveyardsoil);
|
||||
|
||||
TConstructClientRegistry.registerManualSmallRecipe("grout", grout, sand, gravel, null, clay);
|
||||
TConstructClientRegistry.registerManualFurnaceRecipe("searedbrick", searedbrick, grout);
|
||||
TConstructClientRegistry.registerManualSmallRecipe("searedbricks", new ItemStack(TContent.smeltery, 1, 2), searedbrick, searedbrick, searedbrick, searedbrick);
|
||||
@ -470,6 +512,13 @@ public class TProxyClient extends TProxyCommon
|
||||
TConstructClientRegistry.registerManualModifier("blazemod", ironlongsword.copy(), new ItemStack(Item.blazePowder));
|
||||
TConstructClientRegistry.registerManualModifier("necroticmod", ironlongsword.copy(), new ItemStack(TContent.materials, 1, 8));
|
||||
TConstructClientRegistry.registerManualModifier("silkymod", ironpick.copy(), new ItemStack(TContent.materials, 1, 26));
|
||||
TConstructClientRegistry.registerManualModifier("reinforcedmod", ironpick.copy(), new ItemStack(TContent.heavyPlate, 1, 6));
|
||||
|
||||
TConstructClientRegistry.registerManualModifier("pistonmod", ironlongsword.copy(), new ItemStack(Block.pistonBase));
|
||||
TConstructClientRegistry.registerManualModifier("beheadingmod", ironlongsword.copy(), new ItemStack(Item.enderPearl), new ItemStack(Block.obsidian));
|
||||
TConstructClientRegistry.registerManualModifier("spidermod", ironlongsword.copy(), new ItemStack(Item.fermentedSpiderEye));
|
||||
TConstructClientRegistry.registerManualModifier("smitemod", ironlongsword.copy(), new ItemStack(TContent.craftedSoil, 1, 4));
|
||||
|
||||
TConstructClientRegistry.registerManualModifier("electricmod", ironpick.copy(), new ItemStack(Block.dirt), new ItemStack(Block.dirt));
|
||||
TConstructClientRegistry.registerManualModifier("tier1free", ironpick.copy(), new ItemStack(Item.diamond), new ItemStack(Block.blockGold));
|
||||
TConstructClientRegistry.registerManualModifier("tier2free", ironpick.copy(), new ItemStack(Item.netherStar));
|
||||
@ -559,25 +608,31 @@ public class TProxyClient extends TProxyCommon
|
||||
addToolButton(itemIcons[i][0], itemIcons[i][1], itemIcons[i][2], iconCoords[i * 2], iconCoords[i * 2 + 1], toolNames[i], toolDescriptions[i]);
|
||||
}
|
||||
|
||||
addTierTwoButton(6, 13, 0, new int[] { 11, 8, 9, 9 }, new int[] { 2, 3, 2, 2 }, "Hammer",
|
||||
"The Hammer is a broad mining tool. It harvests blocks in a wide range and is effective against undead.\n\nNatural Abilities:\nArea of Effect\n- (3x3x3)\n- Smite\n\nDurability: High");
|
||||
addTierTwoButton(5, 11, 0, new int[] { 6, 8, 9, 9 }, new int[] { 2, 3, 2, 3 }, "Lumber Axe",
|
||||
"The Lumber Axe is a broad chopping tool. It can fell entire trees or gather wood in a wide range.\n\nNatural Abilities:\n- Fell Trees\nArea of Effect\n- (3x3x3)\n\nDurability: Average");
|
||||
addTierTwoButton(4, 12, 0, new int[] { 10, 8, 9, 8 }, new int[] { 2, 3, 3, 3 }, "Excavator",
|
||||
"The Excavator is a broad digging tool. It harvests soil and snow in a wide range.\n\nNatural Ability:\n- Area of Effect\n- (3x3)\n\nDurability: Average");
|
||||
addTierTwoButton(4, 10, 0, new int[] { 8, 8, 9, 8 }, new int[] { 2, 3, 3, 3 }, "Scythe",
|
||||
"The Scythe is a broad reaping tool. It is effective on plants and attacks enemies in a wide range.\n\nNatural Ability:\nArea of Effect\n- (3x3x3)\n\nDurability: Average\nDamage: Low, AoE");
|
||||
addTierTwoButton(5, 7, 1, new int[] { 6, 8, 9, 8 }, new int[] { 3, 3, 2, 3 }, "Cleaver",
|
||||
"The Cleaver is a heavy defensive weapon. It has powerful strikes, but is difficult to wield.\n\nSpecial Ability: Block\nNatural Ability:\n- Beheading\n\nDamage: Very High\nDurability: Average");
|
||||
addTierTwoButton(5, 8, 1, new int[] { 6, 8, 6, 9 }, new int[] { 2, 3, 2, 3 }, "Battleaxe",
|
||||
"The Battleaxe is a heavy offensive weapon. It is capable of bringing down small trees and can send foes flying.\n\nSpecial Ability: Block\nNatural Abilities:\n- Knockback\n- Area of Effect\n- (1x9)\n\nDamage: Average\nDurability: Average");
|
||||
addTierTwoButton(6, 13, 0, new int[] { 11, 8, 9, 9 }, new int[] { 2, 3, 2, 2 }, "Hammer",
|
||||
"The Hammer is a broad mining tool. It harvests blocks in a wide range and is effective against undead.\n\nNatural Abilities:\nArea of Effect\n- (3x3x3)\n- Smite\n\nDurability: High");
|
||||
addTierTwoButton(5, 11, 0, new int[] { 6, 8, 9, 9 }, new int[] { 2, 3, 2, 3 }, "Lumber Axe",
|
||||
"The Lumber Axe is a broad chopping tool. It can fell entire trees or gather wood in a wide range.\n\nNatural Abilities:\n- Fell Trees\nArea of Effect\n- (3x3x3)\n\nDurability: Average");
|
||||
addTierTwoButton(4, 12, 0, new int[] { 10, 8, 9, 8 }, new int[] { 2, 3, 3, 3 }, "Excavator",
|
||||
"The Excavator is a broad digging tool. It harvests soil and snow in a wide range.\n\nNatural Ability:\n- Area of Effect\n- (3x3)\n\nDurability: Average");
|
||||
addTierTwoButton(4, 10, 0, new int[] { 8, 8, 9, 8 }, new int[] { 2, 3, 3, 3 }, "Scythe",
|
||||
"The Scythe is a broad reaping tool. It is effective on plants and attacks enemies in a wide range.\n\nNatural Ability:\nArea of Effect\n- (3x3x3)\n\nDurability: Average\nDamage: Low, AoE");
|
||||
addTierTwoButton(5, 7, 1, new int[] { 6, 8, 9, 8 }, new int[] { 3, 3, 2, 3 }, "Cleaver",
|
||||
"The Cleaver is a heavy defensive weapon. It has powerful strikes, but is difficult to wield.\n\nSpecial Ability: Block\nNatural Ability:\n- Beheading\n\nDamage: Very High\nDurability: Average");
|
||||
addTierTwoButton(
|
||||
5,
|
||||
8,
|
||||
1,
|
||||
new int[] { 6, 8, 6, 9 },
|
||||
new int[] { 2, 3, 2, 3 },
|
||||
"Battleaxe",
|
||||
"The Battleaxe is a heavy offensive weapon. It is capable of bringing down small trees and can send foes flying.\n\nSpecial Ability: Block\nNatural Abilities:\n- Knockback\n- Area of Effect\n- (1x9)\n\nDamage: Average\nDurability: Average");
|
||||
}
|
||||
|
||||
void addToolButton (int slotType, int xButton, int yButton, int[] xIcons, int[] yIcons, String title, String body)
|
||||
{
|
||||
TConstructClientRegistry.addToolButton(new ToolGuiElement(slotType, xButton, yButton, xIcons, yIcons, title, body, "/mods/tinker/textures/gui/icons.png"));
|
||||
}
|
||||
|
||||
|
||||
void addTierTwoButton (int slotType, int xButton, int yButton, int[] xIcons, int[] yIcons, String title, String body)
|
||||
{
|
||||
TConstructClientRegistry.addTierTwoButton(new ToolGuiElement(slotType, xButton, yButton, xIcons, yIcons, title, body, "/mods/tinker/textures/gui/icons.png"));
|
||||
@ -587,11 +642,12 @@ public class TProxyClient extends TProxyCommon
|
||||
{
|
||||
String[] partTypes = { "wood", "stone", "iron", "flint", "cactus", "bone", "obsidian", "netherrack", "slime", "paper", "cobalt", "ardite", "manyullyn", "copper", "bronze", "alumite", "steel",
|
||||
"blueslime" };
|
||||
String[] effectTypes = { "diamond", "emerald", "redstone", "piston", "moss", "ice", "lava", "blaze", "necrotic", "electric", "lapis", "quartz", "silk", "beheading", "smite", "spider", "reinforced" };
|
||||
String[] effectTypes = { "diamond", "emerald", "redstone", "piston", "moss", "ice", "lava", "blaze", "necrotic", "electric", "lapis", "quartz", "silk", "beheading", "smite", "spider",
|
||||
"reinforced" };
|
||||
int[] universalEffects = { 0, 1, 4, 9, 16 };
|
||||
int[] weaponEffects = { 3, 5, 7, 8, 12, 13, 14, 15 };
|
||||
int[] weaponEffects = { 3, 5, 7, 8, 11, 13, 14, 15 };
|
||||
int[] harvestEffects = { 2 };
|
||||
int[] nonUtility = { 6, 10, 11 };
|
||||
int[] nonUtility = { 6, 10, 12 };
|
||||
|
||||
for (int partIter = 0; partIter < partTypes.length; partIter++)
|
||||
{
|
||||
@ -603,30 +659,30 @@ public class TProxyClient extends TProxyCommon
|
||||
List list = Arrays.asList(tool.toolCategories());
|
||||
for (int i = 0; i < universalEffects.length; i++)
|
||||
{
|
||||
TConstructClientRegistry.addEffectRenderMapping(universalEffects[i], "tinker", effectTypes[universalEffects[i]], true);
|
||||
TConstructClientRegistry.addEffectRenderMapping(tool, universalEffects[i], "tinker", effectTypes[universalEffects[i]], true);
|
||||
}
|
||||
|
||||
|
||||
if (list.contains("harvest"))
|
||||
{
|
||||
{
|
||||
for (int i = 0; i < harvestEffects.length; i++)
|
||||
{
|
||||
TConstructClientRegistry.addEffectRenderMapping(harvestEffects[i], "tinker", effectTypes[harvestEffects[i]], true);
|
||||
TConstructClientRegistry.addEffectRenderMapping(tool, harvestEffects[i], "tinker", effectTypes[harvestEffects[i]], true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (list.contains("weapon"))
|
||||
{
|
||||
for (int i = 0; i < weaponEffects.length; i++)
|
||||
{
|
||||
TConstructClientRegistry.addEffectRenderMapping(weaponEffects[i], "tinker", effectTypes[weaponEffects[i]], true);
|
||||
TConstructClientRegistry.addEffectRenderMapping(tool, weaponEffects[i], "tinker", effectTypes[weaponEffects[i]], true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (list.contains("weapon") || list.contains("harvest"))
|
||||
{
|
||||
for (int i = 0; i < nonUtility.length; i++)
|
||||
{
|
||||
TConstructClientRegistry.addEffectRenderMapping(nonUtility[i], "tinker", effectTypes[nonUtility[i]], true);
|
||||
TConstructClientRegistry.addEffectRenderMapping(tool, nonUtility[i], "tinker", effectTypes[nonUtility[i]], true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package mods.tinker.tconstruct.client.gui;
|
||||
|
||||
import mods.tinker.tconstruct.client.TControls;
|
||||
import mods.tinker.tconstruct.common.TContent;
|
||||
import mods.tinker.tconstruct.inventory.ArmorExtendedContainer;
|
||||
import mods.tinker.tconstruct.util.player.ArmorExtended;
|
||||
import mods.tinker.tconstruct.util.player.TPlayerStats;
|
||||
@ -22,80 +23,96 @@ public class ArmorExtendedGui extends InventoryEffectRenderer
|
||||
{
|
||||
public InventoryPlayer inv;
|
||||
public ArmorExtended stats;
|
||||
|
||||
|
||||
private float xSize_lo;
|
||||
private float ySize_lo;
|
||||
|
||||
|
||||
public ArmorExtendedGui(InventoryPlayer inventoryplayer, ArmorExtended holder)
|
||||
{
|
||||
super(new ArmorExtendedContainer(inventoryplayer, holder));
|
||||
inv = inventoryplayer;
|
||||
stats = holder;
|
||||
}
|
||||
|
||||
public void initGui()
|
||||
|
||||
public void initGui ()
|
||||
{
|
||||
super.initGui();
|
||||
|
||||
int cornerX = (this.width - this.xSize) / 2;
|
||||
|
||||
int cornerX = guiLeft;
|
||||
int cornerY = (this.height - this.ySize) / 2;
|
||||
this.buttonList.clear();
|
||||
|
||||
InventoryTab repairButton = new InventoryTab(2, cornerX, cornerY - 28, new ItemStack(Block.workbench), 0);
|
||||
this.buttonList.add(repairButton);
|
||||
repairButton = new InventoryTab(3, cornerX+28, cornerY - 28, new ItemStack(Item.plateDiamond), 1);
|
||||
repairButton.enabled = false;
|
||||
this.buttonList.add(repairButton);
|
||||
InventoryTab tab = new InventoryTab(2, cornerX, cornerY - 28, new ItemStack(Block.workbench), 0);
|
||||
this.buttonList.add(tab);
|
||||
tab = new InventoryTab(3, cornerX + 28, cornerY - 28, new ItemStack(Item.plateDiamond), 1);
|
||||
tab.enabled = false;
|
||||
this.buttonList.add(tab);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2)
|
||||
protected void drawGuiContainerForegroundLayer (int par1, int par2)
|
||||
{
|
||||
//fontRenderer.drawString(StatCollector.translateToLocal("inventory.armorextended"), 60, 6, 0x404040);
|
||||
//fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 17, (ySize - 96) + 2, 0x404040);
|
||||
}
|
||||
|
||||
public void drawScreen(int par1, int par2, float par3)
|
||||
|
||||
public void drawScreen (int par1, int par2, float par3)
|
||||
{
|
||||
super.drawScreen(par1, par2, par3);
|
||||
this.xSize_lo = (float)par1;
|
||||
this.ySize_lo = (float)par2;
|
||||
this.xSize_lo = (float) par1;
|
||||
this.ySize_lo = (float) par2;
|
||||
if (stats.inventory[2] != null && stats.inventory[2].getItem() == TContent.knapsack)
|
||||
{
|
||||
if (this.buttonList.size() < 3)
|
||||
{
|
||||
int cornerX = guiLeft;
|
||||
int cornerY = (this.height - this.ySize) / 2;
|
||||
InventoryTab tab = new InventoryTab(4, cornerX + 56, cornerY - 28, new ItemStack(TContent.knapsack), 1);
|
||||
this.buttonList.add(tab);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.buttonList.size() >= 3)
|
||||
{
|
||||
buttonList.remove(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawGuiContainerBackgroundLayer(float f, int i, int j)
|
||||
protected void drawGuiContainerBackgroundLayer (float f, int i, int j)
|
||||
{
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
mc.renderEngine.bindTexture("/mods/tinker/textures/gui/armorextended.png");
|
||||
int cornerX = (width - xSize) / 2;
|
||||
int cornerX = guiLeft;
|
||||
int cornerY = (height - ySize) / 2;
|
||||
drawTexturedModalRect(cornerX, cornerY, 0, 0, xSize, ySize);
|
||||
|
||||
|
||||
if (!stats.isStackInSlot(0))
|
||||
drawTexturedModalRect(cornerX+79, cornerY+16, 176, 9, 18, 18);
|
||||
drawTexturedModalRect(cornerX + 79, cornerY + 16, 176, 9, 18, 18);
|
||||
if (!stats.isStackInSlot(1))
|
||||
drawTexturedModalRect(cornerX+79, cornerY+34, 176, 27, 18, 18);
|
||||
drawTexturedModalRect(cornerX + 79, cornerY + 34, 176, 27, 18, 18);
|
||||
if (!stats.isStackInSlot(2))
|
||||
drawTexturedModalRect(cornerX+115, cornerY+16, 212, 9, 18, 18);
|
||||
drawTexturedModalRect(cornerX + 115, cornerY + 16, 212, 9, 18, 18);
|
||||
if (!stats.isStackInSlot(3))
|
||||
drawTexturedModalRect(cornerX+115, cornerY+34, 212, 27, 18, 18);
|
||||
drawTexturedModalRect(cornerX + 115, cornerY + 34, 212, 27, 18, 18);
|
||||
if (!stats.isStackInSlot(4))
|
||||
drawTexturedModalRect(cornerX+151, cornerY+16, 230, 0, 18, 18);
|
||||
drawTexturedModalRect(cornerX + 151, cornerY + 16, 230, 0, 18, 18);
|
||||
if (!stats.isStackInSlot(5))
|
||||
drawTexturedModalRect(cornerX+151, cornerY+34, 230, 18, 18, 18);
|
||||
drawTexturedModalRect(cornerX + 151, cornerY + 34, 230, 18, 18, 18);
|
||||
if (!stats.isStackInSlot(6))
|
||||
drawTexturedModalRect(cornerX+151, cornerY+52, 230, 36, 18, 18);
|
||||
drawTexturedModalRect(cornerX + 151, cornerY + 52, 230, 36, 18, 18);
|
||||
|
||||
cornerX = this.guiLeft;
|
||||
cornerY = this.guiTop;
|
||||
drawPlayerOnGui(this.mc, cornerX + 33, cornerY + 75, 30, (float)(cornerX + 51) - this.xSize_lo, (float)(cornerY + 75 - 50) - this.ySize_lo);
|
||||
drawPlayerOnGui(this.mc, cornerX + 33, cornerY + 75, 30, (float) (cornerX + 51) - this.xSize_lo, (float) (cornerY + 75 - 50) - this.ySize_lo);
|
||||
}
|
||||
|
||||
public static void drawPlayerOnGui(Minecraft par0Minecraft, int par1, int par2, int par3, float par4, float par5)
|
||||
|
||||
public static void drawPlayerOnGui (Minecraft par0Minecraft, int par1, int par2, int par3, float par4, float par5)
|
||||
{
|
||||
GL11.glEnable(GL11.GL_COLOR_MATERIAL);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)par1, (float)par2, 50.0F);
|
||||
GL11.glScalef((float)(-par3), (float)par3, (float)par3);
|
||||
GL11.glTranslatef((float) par1, (float) par2, 50.0F);
|
||||
GL11.glScalef((float) (-par3), (float) par3, (float) par3);
|
||||
GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
|
||||
float f2 = par0Minecraft.thePlayer.renderYawOffset;
|
||||
float f3 = par0Minecraft.thePlayer.rotationYaw;
|
||||
@ -104,10 +121,10 @@ public class ArmorExtendedGui extends InventoryEffectRenderer
|
||||
GL11.glRotatef(135.0F, 0.0F, 1.0F, 0.0F);
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(-((float)Math.atan((double)(par5 / 40.0F))) * 20.0F, 1.0F, 0.0F, 0.0F);
|
||||
par0Minecraft.thePlayer.renderYawOffset = (float)Math.atan((double)(par4 / 40.0F)) * 20.0F;
|
||||
par0Minecraft.thePlayer.rotationYaw = (float)Math.atan((double)(par4 / 40.0F)) * 40.0F;
|
||||
par0Minecraft.thePlayer.rotationPitch = -((float)Math.atan((double)(par5 / 40.0F))) * 20.0F;
|
||||
GL11.glRotatef(-((float) Math.atan((double) (par5 / 40.0F))) * 20.0F, 1.0F, 0.0F, 0.0F);
|
||||
par0Minecraft.thePlayer.renderYawOffset = (float) Math.atan((double) (par4 / 40.0F)) * 20.0F;
|
||||
par0Minecraft.thePlayer.rotationYaw = (float) Math.atan((double) (par4 / 40.0F)) * 40.0F;
|
||||
par0Minecraft.thePlayer.rotationPitch = -((float) Math.atan((double) (par5 / 40.0F))) * 20.0F;
|
||||
par0Minecraft.thePlayer.rotationYawHead = par0Minecraft.thePlayer.rotationYaw;
|
||||
GL11.glTranslatef(0.0F, par0Minecraft.thePlayer.yOffset, 0.0F);
|
||||
RenderManager.instance.playerViewY = 180.0F;
|
||||
@ -122,7 +139,7 @@ public class ArmorExtendedGui extends InventoryEffectRenderer
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit);
|
||||
}
|
||||
|
||||
|
||||
/*protected void keyTyped(char par1, int par2)
|
||||
{
|
||||
if (par2 == TControls.armorKey.keyCode)
|
||||
|
@ -4,7 +4,6 @@ import mods.tinker.tconstruct.client.TControls;
|
||||
import mods.tinker.tconstruct.client.TProxyClient;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiInventory;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@ -65,7 +64,9 @@ public class InventoryTab extends GuiButton
|
||||
if (this.id == 2)
|
||||
TProxyClient.openInventoryGui();
|
||||
if (this.id == 3)
|
||||
TControls.openArmorGui();//mc.thePlayer.username);
|
||||
TControls.openArmorGui();
|
||||
if (this.id == 4)
|
||||
TControls.openKnapsackGui();
|
||||
}
|
||||
return inWindow;
|
||||
}
|
||||
|
73
mods/tinker/tconstruct/client/gui/KnapsackGui.java
Normal file
@ -0,0 +1,73 @@
|
||||
package mods.tinker.tconstruct.client.gui;
|
||||
|
||||
import mods.tinker.tconstruct.common.TContent;
|
||||
import mods.tinker.tconstruct.inventory.KnapsackContainer;
|
||||
import mods.tinker.tconstruct.util.player.KnapsackInventory;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
public class KnapsackGui extends GuiContainer
|
||||
{
|
||||
public InventoryPlayer inv;
|
||||
public KnapsackInventory stats;
|
||||
|
||||
public KnapsackGui(InventoryPlayer inventoryplayer, KnapsackInventory holder)
|
||||
{
|
||||
super(new KnapsackContainer(inventoryplayer, holder));
|
||||
inv = inventoryplayer;
|
||||
stats = holder;
|
||||
}
|
||||
|
||||
public void initGui()
|
||||
{
|
||||
super.initGui();
|
||||
|
||||
int cornerX = guiLeft;
|
||||
int cornerY = (this.height - this.ySize) / 2;
|
||||
this.buttonList.clear();
|
||||
|
||||
InventoryTab tab = new InventoryTab(2, cornerX, cornerY - 28, new ItemStack(Block.workbench), 0);
|
||||
this.buttonList.add(tab);
|
||||
tab = new InventoryTab(3, cornerX+28, cornerY - 28, new ItemStack(Item.plateDiamond), 1);
|
||||
this.buttonList.add(tab);
|
||||
tab = new InventoryTab(4, cornerX+56, cornerY - 28, new ItemStack(TContent.knapsack), 1);
|
||||
tab.enabled = false;
|
||||
this.buttonList.add(tab);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2)
|
||||
{
|
||||
fontRenderer.drawString(StatCollector.translateToLocal("inventory.knapsack"), 8, 6, 0x404040);
|
||||
fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, (ySize - 96) + 4, 0x404040);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerBackgroundLayer(float f, int i, int j)
|
||||
{
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
mc.renderEngine.bindTexture("/mods/tinker/textures/gui/knapsack.png");
|
||||
int cornerX = guiLeft;
|
||||
int cornerY = (height - ySize) / 2;
|
||||
drawTexturedModalRect(cornerX, cornerY, 0, 0, xSize, ySize);
|
||||
}
|
||||
|
||||
/*protected void keyTyped(char par1, int par2)
|
||||
{
|
||||
if (par2 == TControls.armorKey.keyCode)
|
||||
{
|
||||
this.mc.thePlayer.closeScreen();
|
||||
}
|
||||
|
||||
super.keyTyped(par1, par2);
|
||||
}*/
|
||||
}
|
@ -176,6 +176,7 @@ public class TContent implements IFuelHandler
|
||||
public static Item heavyPants;
|
||||
public static Item heavyBoots;
|
||||
public static Item glove;
|
||||
public static Item knapsack;
|
||||
|
||||
public static Item heartCanister;
|
||||
|
||||
@ -446,6 +447,7 @@ public class TContent implements IFuelHandler
|
||||
heartCanister = new HeartCanister(PHConstruct.heartCanister).setUnlocalizedName("tconstruct.canister");
|
||||
heavyBoots = new TArmorBase(PHConstruct.heavyBoots, 3).setUnlocalizedName("tconstruct.HeavyBoots");
|
||||
glove = new Glove(PHConstruct.glove).setUnlocalizedName("tconstruct.Glove");
|
||||
knapsack = new Knapsack(PHConstruct.knapsack).setUnlocalizedName("tconstruct.storage");
|
||||
/*public static Item heavyHelmet;
|
||||
public static Item heavyChestplate;
|
||||
public static Item heavyPants;
|
||||
@ -636,7 +638,7 @@ public class TContent implements IFuelHandler
|
||||
tb.registerToolMod(new ModAntiSpider("Anti-Spider", new ItemStack[] { spidereyeball, spidereyeball }, 15, 2));
|
||||
|
||||
ItemStack obsidianPlate = new ItemStack(heavyPlate, 1, 6);
|
||||
tb.registerToolMod(new ModReinforced( new ItemStack[] { obsidianPlate }, 16, 1));
|
||||
tb.registerToolMod(new ModReinforced( new ItemStack[] { obsidianPlate }, 16, 1));
|
||||
|
||||
TConstructRegistry.registerActiveToolMod(new TActiveOmniMod());
|
||||
|
||||
@ -932,10 +934,13 @@ public class TContent implements IFuelHandler
|
||||
GameRegistry.addRecipe(new ItemStack(Block.pressurePlateGold), "ii", 'i', aluBrass);
|
||||
|
||||
ItemStack necroticBone = new ItemStack(materials, 1, 8);
|
||||
|
||||
//Accessories
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(heartCanister, 1, 0), "##", "##", '#', "ingotNaturalAluminum"));
|
||||
GameRegistry.addRecipe(new ItemStack(diamondApple), " d ", "d#d", " d ", 'd', new ItemStack(Item.diamond), '#', new ItemStack(Item.appleRed));
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(heartCanister, 1, 2), new ItemStack(diamondApple), necroticBone, new ItemStack(heartCanister, 1, 0), new ItemStack(heartCanister, 1, 1));
|
||||
GameRegistry.addRecipe(new ItemStack(knapsack, 1, 0), "###", "rmr", "###", '#', new ItemStack(Item.leather), 'r', new ItemStack(toughRod, 1, 2), 'm', new ItemStack(Item.ingotGold));
|
||||
GameRegistry.addRecipe(new ItemStack(knapsack, 1, 0), "###", "rmr", "###", '#', new ItemStack(Item.leather), 'r', new ItemStack(toughRod, 1, 2), 'm', new ItemStack(materials, 1, 14));
|
||||
}
|
||||
|
||||
void setupToolTabs ()
|
||||
|
@ -4,12 +4,13 @@ import java.io.File;
|
||||
|
||||
import mods.tinker.tconstruct.TConstruct;
|
||||
import mods.tinker.tconstruct.inventory.ArmorExtendedContainer;
|
||||
import mods.tinker.tconstruct.inventory.KnapsackContainer;
|
||||
import mods.tinker.tconstruct.library.blocks.InventoryLogic;
|
||||
import mods.tinker.tconstruct.util.player.TPlayerStats;
|
||||
import net.minecraft.client.gui.inventory.GuiInventory;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
import cpw.mods.fml.common.registry.LanguageRegistry;
|
||||
|
||||
@ -25,9 +26,12 @@ public class TProxyCommon implements IGuiHandler
|
||||
public static int pshaperGuiID = 3;
|
||||
public static int frypanGuiID = 4;
|
||||
public static int toolForge = 5;
|
||||
|
||||
public static int smelteryGuiID = 7;
|
||||
|
||||
public static int inventoryGui = 100;
|
||||
public static int armorGuiID = 101;
|
||||
public static int knapsackGuiID = 102;
|
||||
|
||||
public static int manualGuiID = -1;
|
||||
|
||||
@Override
|
||||
@ -36,7 +40,7 @@ public class TProxyCommon implements IGuiHandler
|
||||
if (ID < 0)
|
||||
return null;
|
||||
|
||||
else if (ID <= 100)
|
||||
else if (ID < 100)
|
||||
{
|
||||
TileEntity tile = world.getBlockTileEntity(x, y, z);
|
||||
if (tile != null && tile instanceof InventoryLogic)
|
||||
@ -46,11 +50,21 @@ public class TProxyCommon implements IGuiHandler
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ID == inventoryGui)
|
||||
{
|
||||
//GuiInventory inv = new GuiInventory(player);
|
||||
return player.inventoryContainer;
|
||||
}
|
||||
if (ID == armorGuiID)
|
||||
{
|
||||
TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.username);
|
||||
return new ArmorExtendedContainer(player.inventory, stats.armor);
|
||||
}
|
||||
if (ID == knapsackGuiID)
|
||||
{
|
||||
TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.username);
|
||||
return new KnapsackContainer(player.inventory, stats.knapsack);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
95
mods/tinker/tconstruct/inventory/KnapsackContainer.java
Normal file
@ -0,0 +1,95 @@
|
||||
package mods.tinker.tconstruct.inventory;
|
||||
|
||||
import mods.tinker.tconstruct.library.util.IPattern;
|
||||
import mods.tinker.tconstruct.util.player.KnapsackInventory;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class KnapsackContainer extends Container
|
||||
{
|
||||
public KnapsackInventory backpack;
|
||||
public int progress = 0;
|
||||
public int fuel = 0;
|
||||
public int fuelGague = 0;
|
||||
|
||||
public KnapsackContainer(InventoryPlayer inventoryplayer, KnapsackInventory knapsack)
|
||||
{
|
||||
backpack = knapsack;
|
||||
for (int column = 0; column < 3; column++)
|
||||
{
|
||||
for (int row = 0; row < 9; row++)
|
||||
{
|
||||
this.addSlotToContainer(new Slot(knapsack, row + column * 9, 8 + row * 18, 18 + column * 18));
|
||||
}
|
||||
}
|
||||
|
||||
/* Player inventory */
|
||||
for (int column = 0; column < 3; column++)
|
||||
{
|
||||
for (int row = 0; row < 9; row++)
|
||||
{
|
||||
this.addSlotToContainer(new Slot(inventoryplayer, row + column * 9 + 9, 8 + row * 18, 84 + column * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (int column = 0; column < 9; column++)
|
||||
{
|
||||
this.addSlotToContainer(new Slot(inventoryplayer, column, 8 + column * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer entityplayer)
|
||||
{
|
||||
return backpack.isUseableByPlayer(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer player, int slotID)
|
||||
{
|
||||
ItemStack stack = null;
|
||||
Slot slot = (Slot)this.inventorySlots.get(slotID);
|
||||
|
||||
if (slot != null && slot.getHasStack())
|
||||
{
|
||||
ItemStack slotStack = slot.getStack();
|
||||
stack = slotStack.copy();
|
||||
|
||||
if (slotID < backpack.getSizeInventory())
|
||||
{
|
||||
if (!this.mergeItemStack(slotStack, backpack.getSizeInventory(), this.inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (!this.mergeItemStack(slotStack, 0, backpack.getSizeInventory(), false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (slotStack.stackSize == 0)
|
||||
{
|
||||
slot.putStack((ItemStack)null);
|
||||
}
|
||||
else
|
||||
{
|
||||
slot.onSlotChanged();
|
||||
}
|
||||
}
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean mergeItemStack(ItemStack stack, int inventorySize, int slotSize, boolean par4)
|
||||
{
|
||||
if (!(stack.getItem() instanceof IPattern))
|
||||
return false;
|
||||
|
||||
return super.mergeItemStack(stack, inventorySize, slotSize, par4);
|
||||
}
|
||||
}
|
@ -1,8 +1,9 @@
|
||||
package mods.tinker.tconstruct.items;
|
||||
package mods.tinker.tconstruct.items.armor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mods.tinker.tconstruct.TConstruct;
|
||||
import mods.tinker.tconstruct.items.CraftingItem;
|
||||
import mods.tinker.tconstruct.util.player.ArmorExtended;
|
||||
import mods.tinker.tconstruct.util.player.TPlayerStats;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
62
mods/tinker/tconstruct/items/armor/Knapsack.java
Normal file
@ -0,0 +1,62 @@
|
||||
package mods.tinker.tconstruct.items.armor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mods.tinker.tconstruct.TConstruct;
|
||||
import mods.tinker.tconstruct.items.CraftingItem;
|
||||
import mods.tinker.tconstruct.util.player.ArmorExtended;
|
||||
import mods.tinker.tconstruct.util.player.TPlayerStats;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class Knapsack extends CraftingItem
|
||||
{
|
||||
|
||||
public Knapsack(int id)
|
||||
{
|
||||
super(id, new String[] { "knapsack" }, new String[] { "knapsack" }, "armor/");
|
||||
this.setMaxStackSize(10);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer player)
|
||||
{
|
||||
/*if (!world.isRemote && stack.getItemDamage() == 2)
|
||||
{
|
||||
TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.username);
|
||||
if (stats != null)
|
||||
{
|
||||
ArmorExtended armor = stats.armor;
|
||||
ItemStack slotStack = armor.getStackInSlot(6);
|
||||
if (slotStack == null)// || slotStack.getItem() == this)
|
||||
{
|
||||
armor.setInventorySlotContents(6, new ItemStack(this, 1, 2));
|
||||
stack.stackSize--;
|
||||
}
|
||||
else if (slotStack.getItem() == this && slotStack.stackSize < this.maxStackSize)
|
||||
{
|
||||
slotStack.stackSize++;
|
||||
stack.stackSize--;
|
||||
}
|
||||
armor.recalculateHealth(player, stats);
|
||||
}
|
||||
}*/
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
|
||||
{
|
||||
switch (stack.getItemDamage())
|
||||
{
|
||||
case 0:
|
||||
list.add("A Knapsack to hold your things.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -2,9 +2,6 @@ package mods.tinker.tconstruct.items.tools;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import mods.tinker.tconstruct.common.TContent;
|
||||
import mods.tinker.tconstruct.library.ActiveToolMod;
|
||||
import mods.tinker.tconstruct.library.TConstructRegistry;
|
||||
@ -13,6 +10,7 @@ import mods.tinker.tconstruct.library.tools.HarvestTool;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@ -23,6 +21,8 @@ import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class Hammer extends HarvestTool
|
||||
{
|
||||
@ -213,6 +213,105 @@ public class Hammer extends HarvestTool
|
||||
|
||||
ArrayList<int[]> coords = new ArrayList<int[]>();
|
||||
|
||||
/*@Override
|
||||
public boolean onBlockDestroyed (ItemStack stack, World world, int blockID, int x, int y, int z, EntityLiving entity)
|
||||
{
|
||||
System.out.println("Rawr!");
|
||||
//return AbilityHelper.onBlockChanged(stack, world, blockID, x, y, z, player, random);
|
||||
int localID = blockID;
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
Block block = Block.blocksList[blockID];
|
||||
if (!stack.hasTagCompound())
|
||||
return false;
|
||||
|
||||
boolean validStart = false;
|
||||
for (int iter = 0; iter < materials.length; iter++)
|
||||
{
|
||||
if (materials[iter] == block.blockMaterial)
|
||||
{
|
||||
validStart = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
MovingObjectPosition mop = AbilityHelper.raytraceFromEntity(world, entity, true, 6);
|
||||
if (mop == null || !validStart)
|
||||
return AbilityHelper.onBlockChanged(stack, world, blockID, x, y, z, entity, random);
|
||||
|
||||
int xRange = 1;
|
||||
int yRange = 1;
|
||||
int zRange = 1;
|
||||
switch (mop.sideHit)
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
yRange = 0;
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
zRange = 0;
|
||||
break;
|
||||
case 4:
|
||||
case 5:
|
||||
xRange = 0;
|
||||
break;
|
||||
}
|
||||
NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool");
|
||||
for (int xPos = x - xRange; xPos <= x + xRange; xPos++)
|
||||
{
|
||||
for (int yPos = y - yRange; yPos <= y + yRange; yPos++)
|
||||
{
|
||||
for (int zPos = z - zRange; zPos <= z + zRange; zPos++)
|
||||
{
|
||||
if (!(tags.getBoolean("Broken")))
|
||||
{
|
||||
int localblockID = world.getBlockId(xPos, yPos, zPos);
|
||||
block = Block.blocksList[localblockID];
|
||||
meta = world.getBlockMetadata(xPos, yPos, zPos);
|
||||
int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType());
|
||||
|
||||
if (hlvl <= tags.getInteger("HarvestLevel"))
|
||||
{
|
||||
boolean cancelHarvest = false;
|
||||
for (ActiveToolMod mod : TConstructRegistry.activeModifiers)
|
||||
{
|
||||
if (mod.beforeBlockBreak(this, stack, xPos, yPos, zPos, entity))
|
||||
cancelHarvest = true;
|
||||
}
|
||||
|
||||
if (!cancelHarvest)
|
||||
{
|
||||
if (block != null && !(block.blockHardness < 0))
|
||||
{
|
||||
for (int iter = 0; iter < materials.length; iter++)
|
||||
{
|
||||
if (materials[iter] == block.blockMaterial)
|
||||
{
|
||||
world.setBlockToAir(xPos, yPos, zPos);
|
||||
if (entity instanceof EntityPlayer)
|
||||
{
|
||||
if (!((EntityPlayer) entity).capabilities.isCreativeMode)
|
||||
{
|
||||
block.harvestBlock(world, (EntityPlayer) entity, xPos, yPos, zPos, meta);
|
||||
AbilityHelper.onBlockChanged(stack, world, blockID, x, y, z, entity, random);
|
||||
}
|
||||
}
|
||||
localID = localblockID;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
AbilityHelper.onBlockChanged(stack, world, blockID, x, y, z, entity, random);
|
||||
if (!world.isRemote)
|
||||
world.playAuxSFX(2001, x, y, z, localID + (meta << 12));
|
||||
return true;
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPlayer player)
|
||||
{
|
||||
@ -306,7 +405,7 @@ public class Hammer extends HarvestTool
|
||||
world.playAuxSFX(2001, x, y, z, blockID + (meta << 12));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onUpdate (ItemStack stack, World world, Entity entity, int par4, boolean par5)
|
||||
{
|
||||
|
@ -17,7 +17,7 @@ public class ActiveToolMod
|
||||
}
|
||||
|
||||
/* Harvesting */
|
||||
public boolean beforeBlockBreak (ToolCore tool, ItemStack stack, int x, int y, int z, EntityPlayer player)
|
||||
public boolean beforeBlockBreak (ToolCore tool, ItemStack stack, int x, int y, int z, EntityLiving entity)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -34,6 +34,14 @@ public class TConstructClientRegistry
|
||||
tool.registerPartPaths(materialID, toolIcons);
|
||||
}
|
||||
}
|
||||
public static void addEffectRenderMapping (ToolCore tool, int materialID, String domain, String renderName, boolean useDefaultFolder)
|
||||
{
|
||||
String icon = domain + ":";
|
||||
if (useDefaultFolder)
|
||||
icon += tool.getDefaultFolder() + "/";
|
||||
icon += renderName + tool.getEffectSuffix();
|
||||
tool.registerEffectPath(materialID, icon);
|
||||
}
|
||||
|
||||
public static void addEffectRenderMapping (int materialID, String domain, String renderName, boolean useDefaultFolder)
|
||||
{
|
||||
|
@ -237,7 +237,7 @@ public class ToolBuilder
|
||||
modifier /= handles;
|
||||
}
|
||||
|
||||
durability = (int) (durability * modifier * (0.5 + heads * 0.5) / heads * item.getDurabilityModifier());
|
||||
durability = (int) (durability / heads * (0.5 + heads * 0.5) * modifier * item.getDurabilityModifier());
|
||||
attack = attack / heads + item.getDamageVsEntity(null);
|
||||
if (attack % heads != 0)
|
||||
attack++;
|
||||
|
@ -680,28 +680,29 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean used = false;
|
||||
int hotbarSlot = player.inventory.currentItem;
|
||||
if (hotbarSlot == 0)
|
||||
{
|
||||
ItemStack next = player.inventory.getStackInSlot(8);
|
||||
if (next != null && next.getItem() instanceof ItemBlock)
|
||||
ItemStack nearbyStack = player.inventory.getStackInSlot(8);
|
||||
if (nearbyStack != null && nearbyStack.getItem() instanceof ItemBlock)
|
||||
{
|
||||
next.getItem().onItemUse(next, player, world, x, y, z, side, clickX, clickY, clickZ);
|
||||
if (next.stackSize < 1)
|
||||
used = nearbyStack.getItem().onItemUse(nearbyStack, player, world, x, y, z, side, clickX, clickY, clickZ);
|
||||
if (nearbyStack.stackSize < 1)
|
||||
player.inventory.setInventorySlotContents(8, null);
|
||||
}
|
||||
}
|
||||
else if (hotbarSlot < 8)
|
||||
{
|
||||
ItemStack next = player.inventory.getStackInSlot(hotbarSlot + 1);
|
||||
if (next != null && next.getItem() instanceof ItemBlock)
|
||||
ItemStack nearbyStack = player.inventory.getStackInSlot(hotbarSlot + 1);
|
||||
if (nearbyStack != null && nearbyStack.getItem() instanceof ItemBlock)
|
||||
{
|
||||
next.getItem().onItemUse(next, player, world, x, y, z, side, clickX, clickY, clickZ);
|
||||
if (next.stackSize < 1)
|
||||
used = nearbyStack.getItem().onItemUse(nearbyStack, player, world, x, y, z, side, clickX, clickY, clickZ);
|
||||
if (nearbyStack.stackSize < 1)
|
||||
player.inventory.setInventorySlotContents(hotbarSlot + 1, null);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return used;
|
||||
}
|
||||
|
||||
/* IC2 Support
|
||||
|
@ -19,7 +19,7 @@ public class ModPiston extends ToolMod
|
||||
super(items, effect, "Piston");
|
||||
tooltipName = "\u00a77Knockback";
|
||||
increase = inc;
|
||||
max = 25;
|
||||
max = 10;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -82,7 +82,7 @@ public class ModPiston extends ToolMod
|
||||
|
||||
float knockback = tags.getFloat("Knockback");
|
||||
|
||||
knockback += 0.015 * increase;
|
||||
knockback += 0.1 * increase;
|
||||
tags.setFloat("Knockback", knockback);
|
||||
}
|
||||
|
||||
|
@ -48,17 +48,17 @@ public class TActiveOmniMod extends ActiveToolMod
|
||||
|
||||
/* Harvesting */
|
||||
@Override
|
||||
public boolean beforeBlockBreak (ToolCore tool, ItemStack stack, int x, int y, int z, EntityPlayer player)
|
||||
public boolean beforeBlockBreak (ToolCore tool, ItemStack stack, int x, int y, int z, EntityLiving entity)
|
||||
{
|
||||
if (player.capabilities.isCreativeMode)
|
||||
if (entity instanceof EntityPlayer && ((EntityPlayer)entity).capabilities.isCreativeMode)
|
||||
return false;
|
||||
|
||||
if (tool instanceof HarvestTool)
|
||||
TContent.modL.midStreamModify(stack);
|
||||
|
||||
NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool");
|
||||
World world = player.worldObj;
|
||||
int bID = player.worldObj.getBlockId(x, y, z);
|
||||
World world = entity.worldObj;
|
||||
int bID = entity.worldObj.getBlockId(x, y, z);
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
Block block = Block.blocksList[bID];
|
||||
if (block == null || bID < 1 || bID > 4095)
|
||||
@ -73,8 +73,8 @@ public class TActiveOmniMod extends ActiveToolMod
|
||||
if (result != null)
|
||||
{
|
||||
world.setBlockToAir(x, y, z);
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
tool.onBlockDestroyed(stack, world, bID, x, y, z, player);
|
||||
if (entity instanceof EntityPlayer && !((EntityPlayer)entity).capabilities.isCreativeMode)
|
||||
tool.onBlockDestroyed(stack, world, bID, x, y, z, entity);
|
||||
if (!world.isRemote)
|
||||
{
|
||||
ItemStack spawnme = result.copy();
|
||||
@ -116,7 +116,7 @@ public class TActiveOmniMod extends ActiveToolMod
|
||||
{
|
||||
j = EntityXPOrb.getXPSplit(i);
|
||||
i -= j;
|
||||
player.worldObj.spawnEntityInWorld(new EntityXPOrb(world, x, y + 0.5, z, j));
|
||||
entity.worldObj.spawnEntityInWorld(new EntityXPOrb(world, x, y + 0.5, z, j));
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < 6; i++)
|
||||
@ -176,7 +176,6 @@ public class TActiveOmniMod extends ActiveToolMod
|
||||
int base = array[0] / 2;
|
||||
bonus += 1 + base + random.nextInt(base+1);
|
||||
}
|
||||
System.out.println("Bonus damage: "+bonus);
|
||||
return bonus;
|
||||
}
|
||||
|
||||
|
@ -162,6 +162,7 @@ public class PHConstruct
|
||||
heavyPants = config.getItem("Equipables", "Heavy Pants", 14109).getInt(14109);
|
||||
heavyBoots = config.getItem("Equipables", "Heavy Boots", 14110).getInt(14110);
|
||||
glove = config.getItem("Equipables", "Gloves", 14111).getInt(14111);
|
||||
knapsack = config.getItem("Equipables", "Knapsack", 14112).getInt(14112);
|
||||
|
||||
boolean ic2 = true;
|
||||
boolean xycraft = true;
|
||||
@ -363,6 +364,7 @@ public class PHConstruct
|
||||
public static int heavyPants;
|
||||
public static int heavyBoots;
|
||||
public static int glove;
|
||||
public static int knapsack;
|
||||
|
||||
public static int heartCanister;
|
||||
|
||||
|
@ -29,131 +29,142 @@ import cpw.mods.fml.relauncher.Side;
|
||||
public class TPacketHandler implements IPacketHandler
|
||||
{
|
||||
|
||||
@Override
|
||||
public void onPacketData (INetworkManager manager, Packet250CustomPayload packet, Player player)
|
||||
{
|
||||
Side side = FMLCommonHandler.instance().getEffectiveSide();
|
||||
@Override
|
||||
public void onPacketData (INetworkManager manager, Packet250CustomPayload packet, Player player)
|
||||
{
|
||||
Side side = FMLCommonHandler.instance().getEffectiveSide();
|
||||
|
||||
if (packet.channel.equals("TConstruct"))
|
||||
{
|
||||
if (side == Side.SERVER)
|
||||
handleServerPacket(packet, (EntityPlayerMP) player);
|
||||
else
|
||||
handleClientPacket(packet, (EntityPlayer) player);
|
||||
}
|
||||
}
|
||||
if (packet.channel.equals("TConstruct"))
|
||||
{
|
||||
if (side == Side.SERVER)
|
||||
handleServerPacket(packet, (EntityPlayerMP) player);
|
||||
else
|
||||
handleClientPacket(packet, (EntityPlayer) player);
|
||||
}
|
||||
}
|
||||
|
||||
void handleClientPacket (Packet250CustomPayload packet, EntityPlayer player)
|
||||
{
|
||||
DataInputStream inputStream = new DataInputStream(new ByteArrayInputStream(packet.data));
|
||||
void handleClientPacket (Packet250CustomPayload packet, EntityPlayer player)
|
||||
{
|
||||
DataInputStream inputStream = new DataInputStream(new ByteArrayInputStream(packet.data));
|
||||
|
||||
byte packetID;
|
||||
byte packetID;
|
||||
|
||||
try
|
||||
{
|
||||
packetID = inputStream.readByte();
|
||||
if (packetID == 1)
|
||||
{
|
||||
TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.username);
|
||||
stats.skillList = new ArrayList<Skill>();
|
||||
int size = inputStream.readInt();
|
||||
for (int i = 0; i < size; i++)
|
||||
{
|
||||
Skill skill = SkillRegistry.skillMapping.get(inputStream.readInt()).copy();
|
||||
skill.setActive(inputStream.readBoolean());
|
||||
stats.skillList.add(skill);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.out.println("Failed at reading client packet for TConstruct.");
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
}
|
||||
try
|
||||
{
|
||||
packetID = inputStream.readByte();
|
||||
if (packetID == 1)
|
||||
{
|
||||
TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.username);
|
||||
stats.skillList = new ArrayList<Skill>();
|
||||
int size = inputStream.readInt();
|
||||
for (int i = 0; i < size; i++)
|
||||
{
|
||||
Skill skill = SkillRegistry.skillMapping.get(inputStream.readInt()).copy();
|
||||
skill.setActive(inputStream.readBoolean());
|
||||
stats.skillList.add(skill);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.out.println("Failed at reading client packet for TConstruct.");
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void handleServerPacket (Packet250CustomPayload packet, EntityPlayerMP player)
|
||||
{
|
||||
DataInputStream inputStream = new DataInputStream(new ByteArrayInputStream(packet.data));
|
||||
void handleServerPacket (Packet250CustomPayload packet, EntityPlayerMP player)
|
||||
{
|
||||
DataInputStream inputStream = new DataInputStream(new ByteArrayInputStream(packet.data));
|
||||
|
||||
byte packetID;
|
||||
byte packetID;
|
||||
|
||||
try
|
||||
{
|
||||
packetID = inputStream.readByte();
|
||||
try
|
||||
{
|
||||
packetID = inputStream.readByte();
|
||||
|
||||
if (packetID == 1) //Tool Station
|
||||
{
|
||||
int dimension = inputStream.readInt();
|
||||
World world = DimensionManager.getWorld(dimension);
|
||||
int x = inputStream.readInt();
|
||||
int y = inputStream.readInt();
|
||||
int z = inputStream.readInt();
|
||||
TileEntity te = world.getBlockTileEntity(x, y, z);
|
||||
|
||||
String toolName = inputStream.readUTF();
|
||||
if (te instanceof ToolStationLogic)
|
||||
{
|
||||
((ToolStationLogic) te).setToolname(toolName);
|
||||
}
|
||||
if (te instanceof ToolForgeLogic)
|
||||
if (packetID == 1) //Tool Station
|
||||
{
|
||||
int dimension = inputStream.readInt();
|
||||
World world = DimensionManager.getWorld(dimension);
|
||||
int x = inputStream.readInt();
|
||||
int y = inputStream.readInt();
|
||||
int z = inputStream.readInt();
|
||||
TileEntity te = world.getBlockTileEntity(x, y, z);
|
||||
|
||||
String toolName = inputStream.readUTF();
|
||||
if (te instanceof ToolStationLogic)
|
||||
{
|
||||
((ToolStationLogic) te).setToolname(toolName);
|
||||
}
|
||||
if (te instanceof ToolForgeLogic)
|
||||
{
|
||||
((ToolForgeLogic) te).setToolname(toolName);
|
||||
}
|
||||
}
|
||||
else if (packetID == 2) //Stencil Table
|
||||
{
|
||||
int dimension = inputStream.readInt();
|
||||
World world = DimensionManager.getWorld(dimension);
|
||||
int x = inputStream.readInt();
|
||||
int y = inputStream.readInt();
|
||||
int z = inputStream.readInt();
|
||||
TileEntity te = world.getBlockTileEntity(x, y, z);
|
||||
|
||||
Short itemID = inputStream.readShort();
|
||||
Short itemDamage = inputStream.readShort();
|
||||
if (te instanceof InventoryLogic)
|
||||
{
|
||||
((InventoryLogic) te).setInventorySlotContents(1, new ItemStack(itemID, 1, itemDamage));
|
||||
}
|
||||
}
|
||||
|
||||
else if (packetID == 3) //Armor
|
||||
}
|
||||
else if (packetID == 2) //Stencil Table
|
||||
{
|
||||
int dimension = inputStream.readInt();
|
||||
World world = DimensionManager.getWorld(dimension);
|
||||
int x = inputStream.readInt();
|
||||
int y = inputStream.readInt();
|
||||
int z = inputStream.readInt();
|
||||
TileEntity te = world.getBlockTileEntity(x, y, z);
|
||||
|
||||
Short itemID = inputStream.readShort();
|
||||
Short itemDamage = inputStream.readShort();
|
||||
if (te instanceof InventoryLogic)
|
||||
{
|
||||
((InventoryLogic) te).setInventorySlotContents(1, new ItemStack(itemID, 1, itemDamage));
|
||||
}
|
||||
}
|
||||
|
||||
else if (packetID == 3) //Armor
|
||||
{
|
||||
//String user = inputStream.readUTF();
|
||||
//EntityPlayer player = TConstruct.playerTracker.getEntityPlayer(user);
|
||||
player.openGui(TConstruct.instance, TConstruct.proxy.armorGuiID, player.worldObj, (int)player.posX, (int)player.posY, (int)player.posZ);
|
||||
switch (inputStream.readByte())
|
||||
{
|
||||
case 0:
|
||||
player.openGui(TConstruct.instance, TConstruct.proxy.inventoryGui, player.worldObj, (int) player.posX, (int) player.posY, (int) player.posZ);
|
||||
break;
|
||||
case 1:
|
||||
player.openGui(TConstruct.instance, TConstruct.proxy.armorGuiID, player.worldObj, (int) player.posX, (int) player.posY, (int) player.posZ);
|
||||
break;
|
||||
case 2:
|
||||
player.openGui(TConstruct.instance, TConstruct.proxy.knapsackGuiID, player.worldObj, (int) player.posX, (int) player.posY, (int) player.posZ);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
else if (packetID == 4) //Active Skills
|
||||
{
|
||||
Byte id = inputStream.readByte();
|
||||
TConstruct.playerTracker.activateSkill(player, id);
|
||||
}
|
||||
|
||||
else if (packetID == 10) //Double jump
|
||||
{
|
||||
//String user = inputStream.readUTF();
|
||||
//EntityPlayer player = TConstruct.playerTracker.getEntityPlayer(user);
|
||||
player.fallDistance = 0;
|
||||
}
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
System.out.println("Failed at reading server packet for TConstruct.");
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Entity getEntity (World world, int id)
|
||||
{
|
||||
for (Object o : world.loadedEntityList)
|
||||
{
|
||||
if (((Entity)o).entityId == id)
|
||||
return (Entity) o;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
else if (packetID == 4) //Active Skills
|
||||
{
|
||||
Byte id = inputStream.readByte();
|
||||
TConstruct.playerTracker.activateSkill(player, id);
|
||||
}
|
||||
|
||||
else if (packetID == 10) //Double jump
|
||||
{
|
||||
//String user = inputStream.readUTF();
|
||||
//EntityPlayer player = TConstruct.playerTracker.getEntityPlayer(user);
|
||||
player.fallDistance = 0;
|
||||
}
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
System.out.println("Failed at reading server packet for TConstruct.");
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Entity getEntity (World world, int id)
|
||||
{
|
||||
for (Object o : world.loadedEntityList)
|
||||
{
|
||||
if (((Entity) o).entityId == id)
|
||||
return (Entity) o;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -113,6 +113,11 @@ public class ArmorExtended implements IInventory
|
||||
TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.username);
|
||||
//recalculateSkills(player, stats);
|
||||
recalculateHealth(player, stats);
|
||||
|
||||
if (inventory[2] != null && inventory[2].getItem() == TContent.knapsack)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/*public void recalculateSkills(EntityPlayer player, TPlayerStats stats)
|
||||
|
155
mods/tinker/tconstruct/util/player/KnapsackInventory.java
Normal file
@ -0,0 +1,155 @@
|
||||
package mods.tinker.tconstruct.util.player;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
|
||||
public class KnapsackInventory implements IInventory
|
||||
{
|
||||
public ItemStack[] inventory = new ItemStack[27];
|
||||
public WeakReference<EntityPlayer> parent;
|
||||
|
||||
public void init(EntityPlayer player)
|
||||
{
|
||||
parent = new WeakReference<EntityPlayer>(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int slot)
|
||||
{
|
||||
return inventory[slot];
|
||||
}
|
||||
|
||||
public boolean isStackInSlot(int slot)
|
||||
{
|
||||
return inventory[slot] != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory()
|
||||
{
|
||||
return inventory.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit ()
|
||||
{
|
||||
return 64;
|
||||
}
|
||||
|
||||
public boolean canDropInventorySlot(int slot)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int slot, ItemStack itemstack)
|
||||
{
|
||||
inventory[slot] = itemstack;
|
||||
if (itemstack != null && itemstack.stackSize > getInventoryStackLimit())
|
||||
{
|
||||
itemstack.stackSize = getInventoryStackLimit();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int slot, int quantity)
|
||||
{
|
||||
if (inventory[slot] != null)
|
||||
{
|
||||
if (inventory[slot].stackSize <= quantity)
|
||||
{
|
||||
ItemStack stack = inventory[slot];
|
||||
inventory[slot] = null;
|
||||
return stack;
|
||||
}
|
||||
ItemStack split = inventory[slot].splitStack(quantity);
|
||||
if (inventory[slot].stackSize == 0)
|
||||
{
|
||||
inventory[slot] = null;
|
||||
}
|
||||
return split;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInvName ()
|
||||
{
|
||||
return "tconstruct.knapsack";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInvNameLocalized ()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInventoryChanged ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
public ItemStack getStackInSlotOnClosing (int slot) { return null; }
|
||||
public void openChest () {}
|
||||
public void closeChest () {}
|
||||
|
||||
@Override
|
||||
public boolean isStackValidForSlot (int i, ItemStack itemstack)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer (EntityPlayer entityplayer)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Save/Load */
|
||||
public void saveToNBT (EntityPlayer entityplayer)
|
||||
{
|
||||
NBTTagCompound tags = entityplayer.getEntityData();
|
||||
NBTTagList tagList = new NBTTagList();
|
||||
NBTTagCompound invSlot;
|
||||
|
||||
for (int i = 0; i < this.inventory.length; ++i)
|
||||
{
|
||||
if (this.inventory[i] != null)
|
||||
{
|
||||
invSlot = new NBTTagCompound();
|
||||
invSlot.setByte("Slot", (byte) i);
|
||||
this.inventory[i].writeToNBT(invSlot);
|
||||
tagList.appendTag(invSlot);
|
||||
}
|
||||
}
|
||||
|
||||
tags.setTag("TConstruct.Knapsack", tagList);
|
||||
}
|
||||
|
||||
public void readFromNBT (EntityPlayer entityplayer)
|
||||
{
|
||||
NBTTagCompound tags = entityplayer.getEntityData();
|
||||
NBTTagList tagList = tags.getTagList("TConstruct.Knapsack");
|
||||
for (int i = 0; i < tagList.tagCount(); ++i)
|
||||
{
|
||||
NBTTagCompound nbttagcompound = (NBTTagCompound) tagList.tagAt(i);
|
||||
int j = nbttagcompound.getByte("Slot") & 255;
|
||||
ItemStack itemstack = ItemStack.loadItemStackFromNBT(nbttagcompound);
|
||||
|
||||
if (itemstack != null)
|
||||
{
|
||||
this.inventory[j] = itemstack;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -51,6 +51,10 @@ public class TPlayerHandler implements IPlayerTracker
|
||||
stats.armor = new ArmorExtended();
|
||||
stats.armor.init(entityplayer);
|
||||
stats.armor.readFromNBT(entityplayer);
|
||||
|
||||
stats.knapsack = new KnapsackInventory();
|
||||
stats.knapsack.init(entityplayer);
|
||||
stats.knapsack.readFromNBT(entityplayer);
|
||||
|
||||
stats.level = entityplayer.experienceLevel;
|
||||
stats.hunger = entityplayer.getFoodStats().getFoodLevel();
|
||||
|
@ -17,5 +17,6 @@ public class TPlayerStats
|
||||
public boolean materialManual;
|
||||
public boolean smelteryManual;
|
||||
public ArmorExtended armor;
|
||||
public KnapsackInventory knapsack;
|
||||
public List<Skill> skillList;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.6 KiB |
BIN
mods/tinker/textures/gui/knapsack.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
mods/tinker/textures/items/armor/knapsack.png
Normal file
After Width: | Height: | Size: 592 B |
BIN
mods/tinker/textures/items/axe/reinforced_axe_effect.png
Normal file
After Width: | Height: | Size: 212 B |
BIN
mods/tinker/textures/items/chisel/reinforced_chisel_effect.png
Normal file
After Width: | Height: | Size: 171 B |
BIN
mods/tinker/textures/items/cutlass/Diamond.png
Normal file
After Width: | Height: | Size: 207 B |
BIN
mods/tinker/textures/items/cutlass/alumite_cutlass_blade.png
Normal file
After Width: | Height: | Size: 273 B |
After Width: | Height: | Size: 294 B |
BIN
mods/tinker/textures/items/cutlass/alumite_cutlass_guard.png
Normal file
After Width: | Height: | Size: 170 B |
BIN
mods/tinker/textures/items/cutlass/alumite_cutlass_handle.png
Normal file
After Width: | Height: | Size: 182 B |
BIN
mods/tinker/textures/items/cutlass/ardite_cutlass_blade.png
Normal file
After Width: | Height: | Size: 269 B |
After Width: | Height: | Size: 290 B |
BIN
mods/tinker/textures/items/cutlass/ardite_cutlass_guard.png
Normal file
After Width: | Height: | Size: 170 B |
BIN
mods/tinker/textures/items/cutlass/ardite_cutlass_handle.png
Normal file
After Width: | Height: | Size: 178 B |
BIN
mods/tinker/textures/items/cutlass/blaze_cutlass_effect.png
Normal file
After Width: | Height: | Size: 248 B |
BIN
mods/tinker/textures/items/cutlass/blueslime_cutlass_blade.png
Normal file
After Width: | Height: | Size: 272 B |
After Width: | Height: | Size: 294 B |
BIN
mods/tinker/textures/items/cutlass/blueslime_cutlass_guard.png
Normal file
After Width: | Height: | Size: 170 B |
BIN
mods/tinker/textures/items/cutlass/blueslime_cutlass_handle.png
Normal file
After Width: | Height: | Size: 181 B |
BIN
mods/tinker/textures/items/cutlass/bone_cutlass_blade.png
Normal file
After Width: | Height: | Size: 274 B |
BIN
mods/tinker/textures/items/cutlass/bone_cutlass_blade_broken.png
Normal file
After Width: | Height: | Size: 296 B |
BIN
mods/tinker/textures/items/cutlass/bone_cutlass_guard.png
Normal file
After Width: | Height: | Size: 170 B |
BIN
mods/tinker/textures/items/cutlass/bone_cutlass_handle.png
Normal file
After Width: | Height: | Size: 181 B |
BIN
mods/tinker/textures/items/cutlass/bronze_cutlass_blade.png
Normal file
After Width: | Height: | Size: 274 B |
After Width: | Height: | Size: 298 B |
BIN
mods/tinker/textures/items/cutlass/bronze_cutlass_guard.png
Normal file
After Width: | Height: | Size: 170 B |
BIN
mods/tinker/textures/items/cutlass/bronze_cutlass_handle.png
Normal file
After Width: | Height: | Size: 174 B |
BIN
mods/tinker/textures/items/cutlass/cobalt_cutlass_blade.png
Normal file
After Width: | Height: | Size: 276 B |
After Width: | Height: | Size: 300 B |
BIN
mods/tinker/textures/items/cutlass/cobalt_cutlass_guard.png
Normal file
After Width: | Height: | Size: 170 B |
BIN
mods/tinker/textures/items/cutlass/cobalt_cutlass_handle.png
Normal file
After Width: | Height: | Size: 181 B |
BIN
mods/tinker/textures/items/cutlass/copper_cutlass_blade.png
Normal file
After Width: | Height: | Size: 270 B |
After Width: | Height: | Size: 291 B |
BIN
mods/tinker/textures/items/cutlass/copper_cutlass_guard.png
Normal file
After Width: | Height: | Size: 170 B |
BIN
mods/tinker/textures/items/cutlass/copper_cutlass_handle.png
Normal file
After Width: | Height: | Size: 180 B |
BIN
mods/tinker/textures/items/cutlass/electric_cutlass_effect.png
Normal file
After Width: | Height: | Size: 196 B |
BIN
mods/tinker/textures/items/cutlass/emerald_cutlass_effect.png
Normal file
After Width: | Height: | Size: 179 B |
BIN
mods/tinker/textures/items/cutlass/flint_cutlass_blade.png
Normal file
After Width: | Height: | Size: 271 B |
After Width: | Height: | Size: 294 B |
BIN
mods/tinker/textures/items/cutlass/flint_cutlass_guard.png
Normal file
After Width: | Height: | Size: 170 B |
BIN
mods/tinker/textures/items/cutlass/flint_cutlass_handle.png
Normal file
After Width: | Height: | Size: 181 B |
BIN
mods/tinker/textures/items/cutlass/ice_cutlass_effect.png
Normal file
After Width: | Height: | Size: 211 B |
BIN
mods/tinker/textures/items/cutlass/iron_cutlass_blade.png
Normal file
After Width: | Height: | Size: 270 B |
BIN
mods/tinker/textures/items/cutlass/iron_cutlass_blade_broken.png
Normal file
After Width: | Height: | Size: 290 B |
BIN
mods/tinker/textures/items/cutlass/iron_cutlass_guard.png
Normal file
After Width: | Height: | Size: 170 B |
BIN
mods/tinker/textures/items/cutlass/iron_cutlass_handle.png
Normal file
After Width: | Height: | Size: 174 B |
BIN
mods/tinker/textures/items/cutlass/lapis_cutlass_effect.png
Normal file
After Width: | Height: | Size: 176 B |
BIN
mods/tinker/textures/items/cutlass/lava_cutlass_effect.png
Normal file
After Width: | Height: | Size: 202 B |
BIN
mods/tinker/textures/items/cutlass/manyullyn_cutlass_blade.png
Normal file
After Width: | Height: | Size: 273 B |
After Width: | Height: | Size: 294 B |
BIN
mods/tinker/textures/items/cutlass/manyullyn_cutlass_guard.png
Normal file
After Width: | Height: | Size: 170 B |
BIN
mods/tinker/textures/items/cutlass/manyullyn_cutlass_handle.png
Normal file
After Width: | Height: | Size: 181 B |
BIN
mods/tinker/textures/items/cutlass/necrotic_cutlass_effect.png
Normal file
After Width: | Height: | Size: 186 B |
BIN
mods/tinker/textures/items/cutlass/netherrack_cutlass_blade.png
Normal file
After Width: | Height: | Size: 335 B |
After Width: | Height: | Size: 281 B |
BIN
mods/tinker/textures/items/cutlass/netherrack_cutlass_guard.png
Normal file
After Width: | Height: | Size: 173 B |
BIN
mods/tinker/textures/items/cutlass/netherrack_cutlass_handle.png
Normal file
After Width: | Height: | Size: 175 B |
BIN
mods/tinker/textures/items/cutlass/obsidian_cutlass_blade.png
Normal file
After Width: | Height: | Size: 273 B |
After Width: | Height: | Size: 295 B |
BIN
mods/tinker/textures/items/cutlass/obsidian_cutlass_guard.png
Normal file
After Width: | Height: | Size: 170 B |
BIN
mods/tinker/textures/items/cutlass/obsidian_cutlass_handle.png
Normal file
After Width: | Height: | Size: 181 B |
BIN
mods/tinker/textures/items/cutlass/quartz_cutlass_effect.png
Normal file
After Width: | Height: | Size: 213 B |
BIN
mods/tinker/textures/items/cutlass/silk_cutlass_effect.png
Normal file
After Width: | Height: | Size: 190 B |
BIN
mods/tinker/textures/items/cutlass/slime_cutlass_blade.png
Normal file
After Width: | Height: | Size: 274 B |
After Width: | Height: | Size: 298 B |
BIN
mods/tinker/textures/items/cutlass/slime_cutlass_guard.png
Normal file
After Width: | Height: | Size: 170 B |
BIN
mods/tinker/textures/items/cutlass/slime_cutlass_handle.png
Normal file
After Width: | Height: | Size: 181 B |
BIN
mods/tinker/textures/items/cutlass/steel_cutlass_blade.png
Normal file
After Width: | Height: | Size: 267 B |
After Width: | Height: | Size: 288 B |
BIN
mods/tinker/textures/items/cutlass/steel_cutlass_guard.png
Normal file
After Width: | Height: | Size: 170 B |
BIN
mods/tinker/textures/items/cutlass/steel_cutlass_handle.png
Normal file
After Width: | Height: | Size: 181 B |
BIN
mods/tinker/textures/items/cutlass/stone_cutlass_blade.png
Normal file
After Width: | Height: | Size: 274 B |