Armor Start

This commit is contained in:
mDiyo committed 2013-04-22 19:16:25 -07:00
1 parent 851302735b
commit fbf4a80846
191 files changed
+381 -173

No files matched your search

+23 -23
View File
@@ -178,13 +178,6 @@ public class PHConstruct
aluminumuMinY = config.get("Worldgen", "Aluminum Underground Min Y", 0).getInt(0);
aluminumuMaxY = config.get("Worldgen", "Aluminum Underground Max Y", 64).getInt(64);
copperbMinY = config.get("Worldgen", "Copper Bush Min Y", 20).getInt(20);
copperbMaxY = config.get("Worldgen", "Copper Bush Max Y", 60).getInt(60);
tinbMinY = config.get("Worldgen", "Tin Bush Min Y", 0).getInt(0);
tinbMaxY = config.get("Worldgen", "Tin Bush Max Y", 40).getInt(40);
aluminumbMinY = config.get("Worldgen", "Aluminum Bush Min Y", 0).getInt(0);
aluminumbMaxY = config.get("Worldgen", "Aluminum Bush Max Y", 64).getInt(64);
ironsRarity = config.get("Worldgen", "Iron Surface Rarity", 50).getInt(50);
goldsRarity = config.get("Worldgen", "Gold Surface Rarity", 150).getInt(150);
coppersRarity = config.get("Worldgen", "Copper Surface Rarity", 32).getInt(32);
@@ -192,12 +185,19 @@ public class PHConstruct
aluminumsRarity = config.get("Worldgen", "Aluminum Surface Rarity", 32).getInt(32);
cobaltsRarity = config.get("Worldgen", "Cobalt Surface Rarity", 400).getInt(400);
ironbDensity = config.get("Worldgen", "Iron Bush Density", 1).getInt(1);
goldbDensity = config.get("Worldgen", "Gold Bush Density", 1).getInt(1);
copperbDensity = config.get("Worldgen", "Copper Bush Density", 2).getInt(2);
tinbDensity = config.get("Worldgen", "Tin Bush Density", 2).getInt(2);
ironBushDensity = config.get("Worldgen", "Iron Bush Density", 1).getInt(1);
goldBushDensity = config.get("Worldgen", "Gold Bush Density", 1).getInt(1);
copperBushDensity = config.get("Worldgen", "Copper Bush Density", 2).getInt(2);
tinBushDensity = config.get("Worldgen", "Tin Bush Density", 2).getInt(2);
aluminumbDensity = config.get("Worldgen", "Aluminum Bush Density", 2).getInt(2);
silverbDensity = config.get("Worldgen", "Silver Bush Density", 1).getInt(1);
silverBushDensity = config.get("Worldgen", "Silver Bush Density", 1).getInt(1);
copperBushMinY = config.get("Worldgen", "Copper Bush Min Y", 20).getInt(20);
copperBushMaxY = config.get("Worldgen", "Copper Bush Max Y", 60).getInt(60);
tinBushMinY = config.get("Worldgen", "Tin Bush Min Y", 0).getInt(0);
tinBushMaxY = config.get("Worldgen", "Tin Bush Max Y", 40).getInt(40);
aluminumBushMinY = config.get("Worldgen", "Aluminum Bush Min Y", 0).getInt(0);
aluminumBushMaxY = config.get("Worldgen", "Aluminum Bush Max Y", 64).getInt(64);
seaLevel = config.get("general", "Sea level", 64).getInt(64);
@@ -323,12 +323,12 @@ public class PHConstruct
public static int aluminumsRarity;
public static int cobaltsRarity;
public static int ironbDensity;
public static int goldbDensity;
public static int copperbDensity;
public static int tinbDensity;
public static int ironBushDensity;
public static int goldBushDensity;
public static int copperBushDensity;
public static int tinBushDensity;
public static int aluminumbDensity;
public static int silverbDensity;
public static int silverBushDensity;
public static int copperuMinY;
public static int copperuMaxY;
@@ -337,12 +337,12 @@ public class PHConstruct
public static int aluminumuMinY;
public static int aluminumuMaxY;
public static int copperbMinY;
public static int copperbMaxY;
public static int tinbMinY;
public static int tinbMaxY;
public static int aluminumbMinY;
public static int aluminumbMaxY;
public static int copperBushMinY;
public static int copperBushMaxY;
public static int tinBushMinY;
public static int tinBushMaxY;
public static int aluminumBushMinY;
public static int aluminumBushMaxY;
public static int seaLevel;
+5 -5
View File
@@ -3,10 +3,10 @@ package mods.tinker.tconstruct;
import mods.tinker.tconstruct.library.TConstructRegistry;
import mods.tinker.tconstruct.library.TabTools;
import mods.tinker.tconstruct.player.TPlayerHandler;
import mods.tinker.tconstruct.village.TVillageTrades;
import mods.tinker.tconstruct.village.VillageSmelteryHandler;
import mods.tinker.tconstruct.village.VillageToolStationHandler;
import mods.tinker.tconstruct.worldgen.TBaseWorldGenerator;
import mods.tinker.tconstruct.worldgen.village.TVillageTrades;
import mods.tinker.tconstruct.worldgen.village.VillageSmelteryHandler;
import mods.tinker.tconstruct.worldgen.village.VillageToolStationHandler;
import net.minecraftforge.common.MinecraftForge;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Instance;
@@ -26,7 +26,7 @@ import cpw.mods.fml.common.registry.VillagerRegistry;
* @dependencies: IC2 API, EBXL API
*/
@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.3dev.16", dependencies = "required-after:Forge@[7.7.1.659,)")
@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.3dev.19", dependencies = "required-after:Forge@[7.7.1.659,)")
@NetworkMod(serverSideRequired = false, clientSideRequired = true, channels = { "TConstruct" }, packetHandler = mods.tinker.tconstruct.TPacketHandler.class)
public class TConstruct
{
@@ -59,7 +59,7 @@ public class TConstruct
proxy.registerTickHandler();
proxy.addNames();
proxy.readManuals();
//proxy.registerKeys();
proxy.registerKeys();
GameRegistry.registerWorldGenerator(new TBaseWorldGenerator());
GameRegistry.registerFuelHandler(content);
+3 -3
View File
@@ -718,9 +718,9 @@ public class TContent implements IFuelHandler
GameRegistry.addRecipe(new ItemStack(materials, 9, 16), "m", 'm', new ItemStack(metalBlock, 1, 9)); //Steel
GameRegistry.addRecipe(new ItemStack(Item.ingotIron), "mmm", "mmm", "mmm", 'm', new ItemStack(materials, 1, 19)); //Iron
GameRegistry.addRecipe(new ItemStack(materials, 9, 9), "mmm", "mmm", "mmm", 'm', new ItemStack(materials, 1, 20)); //Copper
GameRegistry.addRecipe(new ItemStack(materials, 9, 10), "mmm", "mmm", "mmm", 'm', new ItemStack(materials, 1, 21)); //Tin
GameRegistry.addRecipe(new ItemStack(materials, 9, 12), "mmm", "mmm", "mmm", 'm', new ItemStack(materials, 1, 22)); //Aluminum
GameRegistry.addRecipe(new ItemStack(materials, 1, 9), "mmm", "mmm", "mmm", 'm', new ItemStack(materials, 1, 20)); //Copper
GameRegistry.addRecipe(new ItemStack(materials, 1, 10), "mmm", "mmm", "mmm", 'm', new ItemStack(materials, 1, 21)); //Tin
GameRegistry.addRecipe(new ItemStack(materials, 1, 12), "mmm", "mmm", "mmm", 'm', new ItemStack(materials, 1, 22)); //Aluminum
LiquidBlockCasting lbc = LiquidBlockCasting.instance;
lbc.addBlockCastingRecipe(new ItemStack(Block.blockIron), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 0), null, true, 100); //Iron
+24 -3
View File
@@ -3,7 +3,9 @@ package mods.tinker.tconstruct;
import mods.tinker.common.InventoryLogic;
import mods.tinker.tconstruct.client.*;
import mods.tinker.tconstruct.client.gui.*;
import mods.tinker.tconstruct.container.*;
import mods.tinker.tconstruct.logic.*;
import mods.tinker.tconstruct.player.TPlayerStats;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
@@ -19,6 +21,7 @@ public class TGuiHandler implements IGuiHandler
public static int frypanID = 4;
public static int smeltery = 7;
public static int armor = 101;
public static int manualGui = -1;
@Override
@@ -27,10 +30,22 @@ public class TGuiHandler implements IGuiHandler
if (ID < 0)
return null;
TileEntity tile = world.getBlockTileEntity(x, y, z);
if (tile != null && tile instanceof InventoryLogic)
else if (ID <= 100)
{
return ((InventoryLogic) tile).getGuiContainer(player.inventory, world, x, y, z);
TileEntity tile = world.getBlockTileEntity(x, y, z);
if (tile != null && tile instanceof InventoryLogic)
{
return ((InventoryLogic) tile).getGuiContainer(player.inventory, world, x, y, z);
}
}
else
{
if (ID == armor)
{
System.out.println("Server Armor Gui: "+player.username);
TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.username);
return new ArmorExtendedContainer(player.inventory, stats);
}
}
return null;
}
@@ -55,6 +70,12 @@ public class TGuiHandler implements IGuiHandler
ItemStack stack = player.getCurrentEquippedItem();
return new GuiManual(stack, TProxyClient.getManualFromStack(stack));
}
if (ID == armor)
{
System.out.println("Client Armor Gui: "+player.username);
TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.username);
return new ArmorExtendedGui(player.inventory, stats);
}
return null;
}
+9 -2
View File
@@ -101,18 +101,25 @@ public class TPacketHandler implements IPacketHandler
}
}
else if (packetID == 3) //Armor
{
String user = inputStream.readUTF();
EntityPlayer player = TConstruct.playerTracker.getEntityPlayer(user);
player.openGui(TConstruct.instance, TGuiHandler.armor, player.worldObj, (int)player.posX, (int)player.posY, (int)player.posZ);
}
else if (packetID == 10) //Double jump
{
String user = inputStream.readUTF();
EntityPlayer player = TConstruct.playerTracker.getEntityPlayer(user);
player.fallDistance = 0;
}
else if (packetID == 11)
/*else if (packetID == 11)
{
String user = inputStream.readUTF();
float size = inputStream.readFloat();
TConstruct.playerTracker.updateSize(user, size);
}
}*/
}
catch (IOException e)
{
@@ -61,8 +61,8 @@ public class OreberryBush extends BlockLeavesBase implements IPlantable
for (int i = 0; i < this.fastIcons.length; i++)
{
this.fastIcons[i] = iconRegister.registerIcon("tinker:berries/" + textureNames[i] + "_fast");
this.fancyIcons[i] = iconRegister.registerIcon("tinker:berries/" + textureNames[i] + "_fancy");
this.fastIcons[i] = iconRegister.registerIcon("tinker:crops/" + textureNames[i] + "_fast");
this.fancyIcons[i] = iconRegister.registerIcon("tinker:crops/" + textureNames[i] + "_fancy");
}
}
+30 -4
View File
@@ -5,6 +5,7 @@ import java.io.DataOutputStream;
import java.util.EnumSet;
import mods.tinker.tconstruct.TConstruct;
import mods.tinker.tconstruct.TGuiHandler;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.client.settings.KeyBinding;
@@ -15,8 +16,9 @@ import cpw.mods.fml.common.network.PacketDispatcher;
public class TControls extends TKeyHandler
{
static KeyBinding grabKey = new KeyBinding("key.grab", 29);
//static KeyBinding grabKey = new KeyBinding("key.grab", 29);
//static KeyBinding stiltsKey = new KeyBinding("key.stilts", 46);
static KeyBinding armorKey = new KeyBinding("key.armor", 23);
static KeyBinding jumpKey;
static Minecraft mc;
boolean jumping;
@@ -24,11 +26,13 @@ public class TControls extends TKeyHandler
boolean climbing = false;
boolean onGround = false;
boolean onStilts = false;
boolean armorGuiOpen = false;
//boolean onStilts = false;
public TControls()
{
super(new KeyBinding[] { grabKey }, new boolean[] { false }, getVanillaKeyBindings(), new boolean[] { false });
super(new KeyBinding[] { armorKey }, new boolean[] { false }, getVanillaKeyBindings(), new boolean[] { false });
//System.out.println("Controls registered");
}
@@ -50,7 +54,12 @@ public class TControls extends TKeyHandler
{
if (tickEnd && mc.theWorld != null)
{
if (kb == jumpKey) //Double jump
if (kb == armorKey && !armorGuiOpen) //Extended Armor
{
//mc.thePlayer.openGui(TConstruct.instance, TGuiHandler.armor, mc.theWorld, (int)mc.thePlayer.posX, (int)mc.thePlayer.posY, (int)mc.thePlayer.posZ);
openArmorGui(mc.thePlayer.username);
}
/*if (kb == jumpKey) //Double jump
{
if (jumping && !doubleJump)
{
@@ -71,7 +80,7 @@ public class TControls extends TKeyHandler
if (!jumping)
jumping = mc.thePlayer.isAirBorne;
}
}*/
}
/*else if (kb == stiltsKey) //Stilts
{
@@ -154,6 +163,23 @@ public class TControls extends TKeyHandler
updateServer(bos);
}
void openArmorGui(String username)
{
ByteArrayOutputStream bos = new ByteArrayOutputStream(8);
DataOutputStream outputStream = new DataOutputStream(bos);
try
{
outputStream.writeByte(3);
outputStream.writeUTF(username);
}
catch (Exception ex)
{
ex.printStackTrace();
}
updateServer(bos);
}
void updateServer(ByteArrayOutputStream bos)
{
Packet250CustomPayload packet = new Packet250CustomPayload();
@@ -0,0 +1,105 @@
package mods.tinker.tconstruct.client.gui;
import mods.tinker.tconstruct.container.ArmorExtendedContainer;
import mods.tinker.tconstruct.player.TPlayerStats;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.InventoryEffectRenderer;
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 org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
public class ArmorExtendedGui extends InventoryEffectRenderer
{
public InventoryPlayer inv;
public TPlayerStats stats;
private float xSize_lo;
private float ySize_lo;
public ArmorExtendedGui(InventoryPlayer inventoryplayer, TPlayerStats holder)
{
super(new ArmorExtendedContainer(inventoryplayer, holder));
inv = inventoryplayer;
stats = holder;
}
protected void drawGuiContainerForegroundLayer(int par1, int par2)
{
//fontRenderer.drawString("This Gui is broken :D", 8, -10, 0x404040);
//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)
{
super.drawScreen(par1, par2, par3);
this.xSize_lo = (float)par1;
this.ySize_lo = (float)par2;
}
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 cornerY = (height - ySize) / 2;
drawTexturedModalRect(cornerX, cornerY, 0, 0, xSize, ySize);
if (!stats.isStackInSlot(0))
drawTexturedModalRect(cornerX+79, cornerY+16, 176, 9, 18, 18);
if (!stats.isStackInSlot(1))
drawTexturedModalRect(cornerX+79, cornerY+34, 176, 27, 18, 18);
if (!stats.isStackInSlot(2))
drawTexturedModalRect(cornerX+115, cornerY+16, 212, 9, 18, 18);
if (!stats.isStackInSlot(3))
drawTexturedModalRect(cornerX+115, cornerY+34, 212, 27, 18, 18);
if (!stats.isStackInSlot(4))
drawTexturedModalRect(cornerX+151, cornerY+16, 230, 0, 18, 18);
if (!stats.isStackInSlot(5))
drawTexturedModalRect(cornerX+151, cornerY+34, 230, 18, 18, 18);
if (!stats.isStackInSlot(6))
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);
}
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.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
float f2 = par0Minecraft.thePlayer.renderYawOffset;
float f3 = par0Minecraft.thePlayer.rotationYaw;
float f4 = par0Minecraft.thePlayer.rotationPitch;
par4 -= 19;
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;
par0Minecraft.thePlayer.rotationYawHead = par0Minecraft.thePlayer.rotationYaw;
GL11.glTranslatef(0.0F, par0Minecraft.thePlayer.yOffset, 0.0F);
RenderManager.instance.playerViewY = 180.0F;
RenderManager.instance.renderEntityWithPosYaw(par0Minecraft.thePlayer, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F);
par0Minecraft.thePlayer.renderYawOffset = f2;
par0Minecraft.thePlayer.rotationYaw = f3;
par0Minecraft.thePlayer.rotationPitch = f4;
GL11.glPopMatrix();
RenderHelper.disableStandardItemLighting();
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit);
GL11.glDisable(GL11.GL_TEXTURE_2D);
OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit);
}
}
@@ -1,4 +1,4 @@
package mods.tinker.tconstruct.projectilerender;
package mods.tinker.tconstruct.client.projectilerender;
import java.util.Random;
import mods.tinker.tconstruct.entity.projectile.DaggerEntity;
@@ -1,4 +1,4 @@
package mods.tinker.tconstruct.projectilerender;
package mods.tinker.tconstruct.client.projectilerender;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.entity.Entity;
@@ -1,90 +0,0 @@
package mods.tinker.tconstruct.container;
import mods.tinker.common.IPattern;
import mods.tinker.tconstruct.player.TPlayerStats;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class ArmorExtended extends ActiveContainer
{
public InventoryPlayer invPlayer;
public TPlayerStats armor;
public ArmorExtended(InventoryPlayer inventoryplayer, TPlayerStats partLogic)
{
invPlayer = inventoryplayer;
armor = partLogic;
/*inventory = new Slot[] { new SlotPattern(partLogic, 0, 40, 27), new SlotPattern(partLogic, 1, 40, 45), new Slot(partLogic, 2, 58, 27), new Slot(partLogic, 3, 58, 45),
new SlotOnlyTake(partLogic, 4, 102, 27), new SlotOnlyTake(partLogic, 5, 120, 27), new SlotOnlyTake(partLogic, 6, 102, 45), new SlotOnlyTake(partLogic, 7, 120, 45) };
for (int iter = 0; iter < inventory.length; iter ++)
this.addSlotToContainer(inventory[iter]);*/
/* Player inventory */
/*for (int armor = 0; armor < 4; ++armor)
{
this.addSlotToContainer(new SlotArmor(this, par1InventoryPlayer, par1InventoryPlayer.getSizeInventory() - 1 - armor, 8, 8 + armor * 18, armor));
}*/
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 var1)
{
return true;
}
@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 < armor.getSizeInventory())
{
if (!this.mergeItemStack(slotStack, armor.getSizeInventory(), this.inventorySlots.size(), true))
{
return null;
}
}
else
{
if (slotStack.getItem() instanceof IPattern)
{
if (!this.mergeItemStack(slotStack, 0, 2, false))
return null;
}
else if (!this.mergeItemStack(slotStack, 2, 4, false))
return null;
}
/*if (slotStack.stackSize == 0)
{
slot.putStack((ItemStack)null);
armor.tryBuildPart(slotID);
}*/
slot.onSlotChanged();
}
return stack;
}
}
@@ -0,0 +1,60 @@
package mods.tinker.tconstruct.container;
import mods.tinker.common.IPattern;
import mods.tinker.tconstruct.player.TPlayerStats;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class ArmorExtendedContainer extends ActiveContainer
{
public InventoryPlayer invPlayer;
public TPlayerStats armor;
public ArmorExtendedContainer(InventoryPlayer inventoryplayer, TPlayerStats stats)
{
invPlayer = inventoryplayer;
armor = stats;
this.addSlotToContainer(new Slot(stats, 0, 80, 17));
this.addSlotToContainer(new Slot(stats, 1, 80, 35));
this.addSlotToContainer(new Slot(stats, 2, 116, 17));
this.addSlotToContainer(new Slot(stats, 3, 116, 35));
this.addSlotToContainer(new Slot(stats, 4, 152, 17));
this.addSlotToContainer(new Slot(stats, 5, 152, 35));
this.addSlotToContainer(new Slot(stats, 6, 152, 53));
/* Player inventory */
for (int armor = 0; armor < 4; ++armor)
{
this.addSlotToContainer(new SlotArmorCopy(this, inventoryplayer, inventoryplayer.getSizeInventory() - 1 - armor, 98, 8 + armor * 18, armor));
}
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 var1)
{
return true;
}
@Override
public ItemStack transferStackInSlot(EntityPlayer player, int slotID)
{
return null;
}
}
@@ -0,0 +1,59 @@
package mods.tinker.tconstruct.container;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class SlotArmorCopy extends Slot
{
/**
* The armor type that can be placed on that slot, it uses the same values of armorType field on ItemArmor.
*/
final int armorType;
/**
* The parent class of this clot, ContainerPlayer, SlotArmor is a Anon inner class.
*/
final Container parent;
public SlotArmorCopy(Container container, IInventory par2IInventory, int par3, int par4, int par5, int par6)
{
super(par2IInventory, par3, par4, par5);
this.parent = container;
this.armorType = par6;
}
/**
* Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case
* of armor slots)
*/
public int getSlotStackLimit()
{
return 1;
}
/**
* Check if the stack is a valid item for this slot. Always true beside for the armor slots.
*/
public boolean isItemValid(ItemStack par1ItemStack)
{
Item item = (par1ItemStack == null ? null : par1ItemStack.getItem());
return item != null && item.isValidArmor(par1ItemStack, armorType);
}
@SideOnly(Side.CLIENT)
/**
* Returns the icon index on items.png that is used as background image of the slot.
*/
public Icon getBackgroundIconIndex()
{
return ItemArmor.func_94602_b(this.armorType);
}
}
@@ -164,7 +164,7 @@ public class TPlayerHandler implements IPlayerTracker
}
/* Find the right player */
TPlayerStats getPlayerStats (String username)
public TPlayerStats getPlayerStats (String username)
{
TPlayerStats stats = playerStats.get(username);
if (stats == null)
+38 -19
View File
@@ -16,24 +16,48 @@ public class TPlayerStats implements IInventory
public boolean materialManual;
public boolean smelteryManual;
public ItemStack[] armor = new ItemStack[7];
public ItemStack[] inventory = new ItemStack[7];
@Override
public int getSizeInventory ()
{
return armor.length;
return inventory.length;
}
public boolean isStackInSlot (int slot)
{
return inventory[slot] != null;
}
@Override
public ItemStack getStackInSlot (int slot)
{
return null;
return inventory[slot];
}
@Override
public ItemStack decrStackSize (int slot, int quantity)
{
return null;
if (inventory[slot] != null)
{
System.out.println("Took something from slot "+slot);
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
@@ -45,13 +69,18 @@ public class TPlayerStats implements IInventory
@Override
public void setInventorySlotContents (int slot, ItemStack itemstack)
{
inventory[slot] = itemstack;
//System.out.println("Changed slot "+slot);
if (itemstack != null && itemstack.stackSize > getInventoryStackLimit())
{
itemstack.stackSize = getInventoryStackLimit();
}
}
@Override
public String getInvName ()
{
return null;
return "";
}
@Override
@@ -63,13 +92,12 @@ public class TPlayerStats implements IInventory
@Override
public int getInventoryStackLimit ()
{
return 0;
return 64;
}
@Override
public void onInventoryChanged ()
{
}
@Override
@@ -78,17 +106,8 @@ public class TPlayerStats implements IInventory
return true;
}
@Override
public void openChest ()
{
}
@Override
public void closeChest ()
{
}
public void openChest () {}
public void closeChest () {}
@Override
public boolean isStackValidForSlot (int slot, ItemStack itemstack)
+1 -1
View File
@@ -48,7 +48,7 @@ public class Axe extends HarvestTool
return AbilityHelper.onBlockChanged(itemstack, world, bID, x, y, z, player, random);
}
static Material[] materials = { Material.wood, Material.leaves, Material.circuits, Material.cactus, Material.pumpkin };
static Material[] materials = { Material.wood, Material.leaves, Material.circuits, Material.cactus, Material.pumpkin };
@Override
protected Item getHeadItem ()
@@ -149,7 +149,7 @@ public class TBaseWorldGenerator implements IWorldGenerator
int xPos, yPos, zPos;
if (PHConstruct.generateIronBush)
{
for (int i = 0; i < PHConstruct.ironbDensity; i++)
for (int i = 0; i < PHConstruct.ironBushDensity; i++)
{
xPos = xChunk + random.nextInt(16);
yPos = PHConstruct.seaLevel - 32;
@@ -165,7 +165,7 @@ public class TBaseWorldGenerator implements IWorldGenerator
}
if (PHConstruct.generateGoldBush)
{
for (int i = 0; i < PHConstruct.goldbDensity; i++)
for (int i = 0; i < PHConstruct.goldBushDensity; i++)
{
xPos = xChunk + random.nextInt(16);
yPos = 16;
@@ -181,12 +181,12 @@ public class TBaseWorldGenerator implements IWorldGenerator
}
if (PHConstruct.generateCopperBush)// && random.nextInt(PHConstruct.copperbRarity) == 0)
{
for (int i = 0; i < PHConstruct.copperbDensity; i++)
for (int i = 0; i < PHConstruct.copperBushDensity; i++)
{
xPos = xChunk + random.nextInt(16);
yPos = (PHConstruct.copperbMaxY + PHConstruct.copperbMinY) / 2;
yPos = (PHConstruct.copperBushMaxY + PHConstruct.copperBushMinY) / 2;
zPos = zChunk + random.nextInt(16);
yPos = findAdequateLocation(world, xPos, yPos, zPos, PHConstruct.copperbMaxY, PHConstruct.copperbMinY);
yPos = findAdequateLocation(world, xPos, yPos, zPos, PHConstruct.copperBushMaxY, PHConstruct.copperBushMinY);
if (yPos != -1)
{
/*CoordTuple coord = new CoordTuple(xPos, yPos, zPos);
@@ -197,12 +197,12 @@ public class TBaseWorldGenerator implements IWorldGenerator
}
if (PHConstruct.generateTinBush)// && random.nextInt(PHConstruct.tinbRarity) == 0)
{
for (int i = 0; i < PHConstruct.tinbDensity; i++)
for (int i = 0; i < PHConstruct.tinBushDensity; i++)
{
xPos = xChunk + random.nextInt(16);
yPos = (PHConstruct.tinuMaxY + PHConstruct.tinbMinY) / 2;
yPos = (PHConstruct.tinBushMaxY + PHConstruct.tinBushMinY) / 2;
zPos = zChunk + random.nextInt(16);
yPos = findAdequateLocation(world, xPos, yPos, zPos, PHConstruct.tinbMaxY, PHConstruct.tinbMinY);
yPos = findAdequateLocation(world, xPos, yPos, zPos, PHConstruct.tinBushMaxY, PHConstruct.tinBushMinY);
if (yPos != -1)
{
/*CoordTuple coord = new CoordTuple(xPos, yPos, zPos);
@@ -216,9 +216,9 @@ public class TBaseWorldGenerator implements IWorldGenerator
for (int i = 0; i < PHConstruct.aluminumbDensity; i++)
{
xPos = xChunk + random.nextInt(16);
yPos = (PHConstruct.aluminumuMaxY + PHConstruct.aluminumbMinY) / 2;
yPos = (PHConstruct.aluminumBushMaxY + PHConstruct.aluminumBushMinY) / 2;
zPos = zChunk + random.nextInt(16);
yPos = findAdequateLocation(world, xPos, yPos, zPos, PHConstruct.aluminumbMaxY, PHConstruct.aluminumbMinY);
yPos = findAdequateLocation(world, xPos, yPos, zPos, PHConstruct.aluminumBushMaxY, PHConstruct.aluminumBushMinY);
if (yPos != -1)
{
/*CoordTuple coord = new CoordTuple(xPos, yPos, zPos);
@@ -227,9 +227,9 @@ public class TBaseWorldGenerator implements IWorldGenerator
}
}
}
if (PHConstruct.generateSilverBush && random.nextInt(PHConstruct.silverbDensity) == 0)
if (PHConstruct.generateSilverBush && random.nextInt(PHConstruct.silverBushDensity) == 0)
{
for (int i = 0; i < PHConstruct.silverbDensity; i++)
for (int i = 0; i < PHConstruct.silverBushDensity; i++)
{
xPos = xChunk + random.nextInt(16);
yPos = PHConstruct.seaLevel - 16;
@@ -1,4 +1,4 @@
package mods.tinker.tconstruct.village;
package mods.tinker.tconstruct.worldgen.village;
import java.util.List;
import java.util.Random;
@@ -1,4 +1,4 @@
package mods.tinker.tconstruct.village;
package mods.tinker.tconstruct.worldgen.village;
import java.util.List;
import java.util.Random;
@@ -130,6 +130,7 @@ public class ComponentToolWorkshop extends ComponentVillage
this.fillCurrentPositionBlocksDownwards(world, Block.cobblestone.blockID, 0, i1, -1, l, sbb);
}
}
this.spawnVillagers(world, sbb, 3, 1, 3, 1);
return true;
}
@@ -1,4 +1,4 @@
package mods.tinker.tconstruct.village;
package mods.tinker.tconstruct.worldgen.village;
import java.util.List;
import java.util.Random;
@@ -1,4 +1,4 @@
package mods.tinker.tconstruct.village;
package mods.tinker.tconstruct.worldgen.village;
import java.util.List;
import java.util.Random;
@@ -13,7 +13,7 @@ public class VillageSmelteryHandler implements IVillageCreationHandler
@Override
public StructureVillagePieceWeight getVillagePieceWeight (Random random, int i)
{
return new StructureVillagePieceWeight(ComponentSmeltery.class, 20, i+2);
return new StructureVillagePieceWeight(ComponentSmeltery.class, 18, i);
}
@Override
@@ -1,4 +1,4 @@
package mods.tinker.tconstruct.village;
package mods.tinker.tconstruct.worldgen.village;
import java.util.List;
import java.util.Random;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 739 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 477 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 772 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 395 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 511 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 894 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 441 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 182 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 312 B

After

Width:  |  Height:  |  Size: 312 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 397 B

After

Width:  |  Height:  |  Size: 397 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 347 B

After

Width:  |  Height:  |  Size: 347 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 395 B

After

Width:  |  Height:  |  Size: 395 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 313 B

After

Width:  |  Height:  |  Size: 313 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 394 B

After

Width:  |  Height:  |  Size: 394 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 356 B

After

Width:  |  Height:  |  Size: 356 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 397 B

After

Width:  |  Height:  |  Size: 397 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 315 B

After

Width:  |  Height:  |  Size: 315 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 399 B

After

Width:  |  Height:  |  Size: 399 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 723 B

After

Width:  |  Height:  |  Size: 723 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 775 B

After

Width:  |  Height:  |  Size: 775 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 314 B

After

Width:  |  Height:  |  Size: 314 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 397 B

After

Width:  |  Height:  |  Size: 397 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 356 B

After

Width:  |  Height:  |  Size: 356 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 397 B

After

Width:  |  Height:  |  Size: 397 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 308 B

After

Width:  |  Height:  |  Size: 308 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 390 B

After

Width:  |  Height:  |  Size: 390 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 308 B

After

Width:  |  Height:  |  Size: 308 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 390 B

After

Width:  |  Height:  |  Size: 390 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 613 B

After

Width:  |  Height:  |  Size: 613 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 850 B

After

Width:  |  Height:  |  Size: 850 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 670 B

After

Width:  |  Height:  |  Size: 670 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 772 B

After

Width:  |  Height:  |  Size: 772 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 311 B

After

Width:  |  Height:  |  Size: 311 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 393 B

After

Width:  |  Height:  |  Size: 393 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 353 B

After

Width:  |  Height:  |  Size: 353 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 392 B

After

Width:  |  Height:  |  Size: 392 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 293 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 473 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 563 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 926 B

Loaded 100 of 191 files, more files were not shown because too many files have changed in this diff. Show more