Skip to content

Commit

Permalink
Merge branch 'master' of github.com:mDiyo/TinkersConstruct
Browse files Browse the repository at this point in the history
  • Loading branch information
progwml6 committed Oct 8, 2013
2 parents 10101a6 + ec74ded commit f2535c7
Show file tree
Hide file tree
Showing 40 changed files with 2,309 additions and 344 deletions.
5 changes: 5 additions & 0 deletions resources/assets/tinker/lang/de_DE.xml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,11 @@
<entry key="item.tconstruct.Materials.AlumiteNugget.name">Alumitklumpen</entry>
<entry key="item.tconstruct.Materials.SteelNugget.name">Stahlklumpen</entry>

<entry key="item.tconstruct.ArmorPattern.helmet.name">Helmgussform</entry>
<entry key="item.tconstruct.ArmorPattern.chestplate.name">Brustpanzergussform</entry>
<entry key="item.tconstruct.ArmorPattern.leggings.name">Beinschutzgussform</entry>
<entry key="item.tconstruct.ArmorPattern.boots.name">Stiefelgussform</entry>

<entry key="item.tconstruct.jerky.beef.name">Rindfleisch-Charqui</entry>
<entry key="item.tconstruct.jerky.pig.name">Schweinefleisch-Charqui</entry>
<entry key="item.tconstruct.jerky.chicken.name">Hühnchen-Charqui</entry>
Expand Down
5 changes: 5 additions & 0 deletions resources/assets/tinker/lang/en_US.xml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,11 @@
<entry key="item.tconstruct.Materials.AlumiteNugget.name">Alumite Nugget</entry>
<entry key="item.tconstruct.Materials.SteelNugget.name">Steel Nugget</entry>

<entry key="item.tconstruct.ArmorPattern.helmet.name">Helmet Cast</entry>
<entry key="item.tconstruct.ArmorPattern.chestplate.name">Chestplate Cast</entry>
<entry key="item.tconstruct.ArmorPattern.leggings.name">Leggings Cast</entry>
<entry key="item.tconstruct.ArmorPattern.boots.name">Boots Cast</entry>

<entry key="item.tconstruct.jerky.beef.name">Beef Jerky</entry>
<entry key="item.tconstruct.jerky.pig.name">Bacon Jerky</entry>
<entry key="item.tconstruct.jerky.chicken.name">Chicken Jerky</entry>
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 15 additions & 33 deletions src/tconstruct/TConstruct.java
Original file line number Diff line number Diff line change
@@ -1,54 +1,35 @@
package tconstruct;

import cpw.mods.fml.common.*;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.event.*;
import cpw.mods.fml.common.network.*;
import cpw.mods.fml.common.registry.*;
import cpw.mods.fml.relauncher.Side;
import net.minecraft.crash.CallableMinecraftVersion;
import net.minecraft.world.gen.structure.MapGenStructureIO;
import net.minecraftforge.common.MinecraftForge;
import tconstruct.client.event.EventCloakRender;
import tconstruct.common.TContent;
import tconstruct.common.TProxyCommon;
import tconstruct.common.*;
import tconstruct.library.TConstructRegistry;
import tconstruct.library.crafting.Detailing;
import tconstruct.library.crafting.LiquidCasting;
import tconstruct.library.crafting.*;
import tconstruct.library.util.TabTools;
import tconstruct.util.TCraftingHandler;
import tconstruct.util.TEventHandler;
import tconstruct.util.config.BOPConfig;
import tconstruct.util.config.DimensionBlacklist;
import tconstruct.util.config.PHConstruct;
import tconstruct.util.config.TwilightForestConfig;
import tconstruct.util.*;
import tconstruct.util.config.*;
import tconstruct.util.landmine.behavior.Behavior;
import tconstruct.util.landmine.behavior.stackCombo.SpecialStackHandler;
import tconstruct.util.player.TPlayerHandler;
import tconstruct.worldgen.SlimeIslandGen;
import tconstruct.worldgen.TBaseWorldGenerator;
import tconstruct.worldgen.TerrainGenEventHandler;
import tconstruct.worldgen.village.ComponentSmeltery;
import tconstruct.worldgen.village.ComponentToolWorkshop;
import tconstruct.worldgen.village.TVillageTrades;
import tconstruct.worldgen.village.VillageSmelteryHandler;
import tconstruct.worldgen.village.VillageToolStationHandler;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.VillagerRegistry;
import cpw.mods.fml.common.versioning.ComparableVersion;
import cpw.mods.fml.relauncher.Side;
import tconstruct.worldgen.*;
import tconstruct.worldgen.village.*;

/** TConstruct, the tool mod.
* Craft your tools with style, then modify until the original is gone!
* @author: mDiyo
* @dependencies: IC2 API, MFR API
*/

@Mod(modid = "TConstruct", name = "TConstruct", version = "1.6.X_1.4.7", dependencies = "required-after:Forge@[8.9,)")
@Mod(modid = "TConstruct", name = "TConstruct", version = "1.6.X_1.5.0d", dependencies = "required-after:Forge@[8.9,)")
@NetworkMod(serverSideRequired = false, clientSideRequired = true, channels = { "TConstruct" }, packetHandler = tconstruct.util.network.TPacketHandler.class)
public class TConstruct
{
Expand Down Expand Up @@ -163,6 +144,7 @@ public void init (FMLInitializationEvent event)
@EventHandler
public void postInit (FMLPostInitializationEvent evt)
{
proxy.postInit();
Behavior.registerBuiltInBehaviors();
SpecialStackHandler.registerBuiltInStackHandlers();
content.modIntegration();
Expand Down
10 changes: 5 additions & 5 deletions src/tconstruct/blocks/SmelteryBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ public SmelteryBlock(int id)

/* Rendering */

@Override
/*@Override
public int getRenderType ()
{
return SmelteryRender.smelteryModel;
}
}*/

@Override
public String[] getTextureNames ()
Expand Down Expand Up @@ -216,7 +216,7 @@ public TileEntity createTileEntity (World world, int metadata)
switch (metadata)
{
case 0:
return new SmelteryLogic();
return new AdaptiveSmelteryLogic();
case 1:
return new SmelteryDrainLogic();
case 3:
Expand All @@ -225,7 +225,7 @@ public TileEntity createTileEntity (World world, int metadata)
return new MultiServantLogic();
}

@Override
/*@Override
public void onBlockPlacedBy (World world, int x, int y, int z, EntityLivingBase entityliving, ItemStack stack)
{
super.onBlockPlacedBy(world, x, y, z, entityliving, stack);
Expand All @@ -243,7 +243,7 @@ public void onBlockPlacedElsewhere (World world, int x, int y, int z, EntityLivi
public void breakBlock (World world, int x, int y, int z, int par5, int par6) //Don't drop inventory
{
world.removeBlockTileEntity(x, y, z);
}
}*/

@Override
public void getSubBlocks (int id, CreativeTabs tab, List list)
Expand Down
35 changes: 35 additions & 0 deletions src/tconstruct/blocks/TankAirBlock.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
package tconstruct.blocks;

import cpw.mods.fml.relauncher.*;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import tconstruct.blocks.logic.TankAirLogic;
import tconstruct.client.block.TankAirRender;

public class TankAirBlock extends BlockContainer
{
Expand All @@ -19,4 +24,34 @@ public TileEntity createNewTileEntity (World world)
{
return new TankAirLogic();
}

@Override
public int getRenderType ()
{
return TankAirRender.model;
}

@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister par1IconRegister)
{

}

@Override
public boolean isOpaqueCube ()
{
return false;
}

@Override
public boolean renderAsNormalBlock ()
{
return false;
}

@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
{
return null;
}
}
47 changes: 40 additions & 7 deletions src/tconstruct/blocks/component/SmelteryComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
import java.util.ArrayList;

import net.minecraft.block.Block;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;
import tconstruct.blocks.logic.AdaptiveSmelteryLogic;
import tconstruct.library.component.LogicComponent;
import tconstruct.library.component.MultiFluidTank;
import tconstruct.library.crafting.Smeltery;
import tconstruct.library.util.CoordTuple;

public class SmelteryComponent extends LogicComponent
{
final IInventory master;
final AdaptiveSmelteryLogic master;
final SmelteryScan structure;
final MultiFluidTank multitank;
int maxTemp;
Expand All @@ -33,7 +33,7 @@ public class SmelteryComponent extends LogicComponent

CoordTuple activeLavaTank;

public SmelteryComponent(IInventory inventory, SmelteryScan structure, MultiFluidTank multitank, int maxTemp)
public SmelteryComponent(AdaptiveSmelteryLogic inventory, SmelteryScan structure, MultiFluidTank multitank, int maxTemp)
{
master = inventory;
this.structure = structure;
Expand Down Expand Up @@ -74,6 +74,16 @@ public void adjustSize (int size, boolean forceAdjust)
}
}

public void updateTemperatures ()
{
inUse = true;
for (int i = 0; i < meltingTemps.length; i++)
{
meltingTemps[i] = Smeltery.instance.getLiquifyTemperature(master.getStackInSlot(i));
System.out.println("New temp: " + meltingTemps[i]);
}
}

public void heatItems ()
{
if (fuelTicks > 0)
Expand All @@ -84,7 +94,7 @@ public void heatItems ()
fuelTicks--;
if (fuelTicks <= 0)
break;

ItemStack slot = master.getStackInSlot(i);
if (meltingTemps[i] > 20 && slot != null)
{
Expand All @@ -109,10 +119,10 @@ else if (activeTemps[i] >= meltingTemps[i] && !world.isRemote)
multitank.addFluidToTank(liquid, true);
}
master.onInventoryChanged();
master.setUpdateFluids();
}
}
}

}

else
Expand Down Expand Up @@ -178,7 +188,7 @@ void updateFuelGague ()
if (newliquid != null && newliquid.getFluid().getBlockID() == Block.lavaStill.blockID && newliquid.amount > 0)
{
foundTank = true;
activeLavaTank = possibleTank;
setActiveLavaTank(possibleTank);
iter = structure.lavaTanks.size();

FluidTankInfo[] info = ((IFluidHandler) tankContainer).getTankInfo(ForgeDirection.DOWN);
Expand All @@ -204,6 +214,11 @@ void updateFuelGague ()
}
}

public void setActiveLavaTank (CoordTuple coord)
{
activeLavaTank = coord;
}

private int drainFuelAmount ()
{
int amount = activeTemps.length / 3;
Expand Down Expand Up @@ -231,4 +246,22 @@ public int getMeltingPointForSlot (int slot)
{
return meltingTemps[slot];
}

/* NBT */
public void readNetworkNBT (NBTTagCompound tags)
{
activeTemps = tags.getIntArray("Temperature");
meltingTemps = tags.getIntArray("Melting");
int[] tank = tags.getIntArray("LavaTank");
if (tank != null)
activeLavaTank = new CoordTuple(tank[0], tank[1], tank[2]);
}

public void writeNetworkNBT (NBTTagCompound tags)
{
tags.setIntArray("Temperature", activeTemps);
tags.setIntArray("Melting", meltingTemps);
if (activeLavaTank != null)
tags.setIntArray("LavaTank", new int[] { activeLavaTank.x, activeLavaTank.y, activeLavaTank.z });
}
}
39 changes: 27 additions & 12 deletions src/tconstruct/blocks/component/SmelteryScan.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package tconstruct.blocks.component;

import java.util.ArrayList;
import java.util.Iterator;

import net.minecraft.block.Block;
import net.minecraft.tileentity.TileEntity;
Expand All @@ -24,7 +25,7 @@ public void checkValidStructure ()
lavaTanks.clear();
super.checkValidStructure();
}

@Override
protected boolean checkServant (int x, int y, int z)
{
Expand All @@ -46,24 +47,38 @@ protected boolean checkServant (int x, int y, int z)

return false;
}

protected void finalizeStructure ()
{
super.finalizeStructure();
for (CoordTuple coord : airCoords)
if (lavaTanks.size() < 1)
completeStructure = false;
else
{
world.setBlock(coord.x, coord.y, coord.z, TContent.tankAir.blockID);
IServantLogic servant = (IServantLogic) world.getBlockTileEntity(coord.x, coord.y, coord.z);
servant.verifyMaster(imaster, world, master.xCoord, master.yCoord, master.zCoord);
for (CoordTuple coord : airCoords)
{
world.setBlock(coord.x, coord.y, coord.z, TContent.tankAir.blockID);
IServantLogic servant = (IServantLogic) world.getBlockTileEntity(coord.x, coord.y, coord.z);
servant.verifyMaster(imaster, world, master.xCoord, master.yCoord, master.zCoord);
}
}
}

/*protected void addAirBlock (int x, int y, int z)

@Override
public void cleanup ()
{
super.addAirBlock(x, y, z);
world.setBlock(x, y, z, Block.glass.blockID);
}*/

super.cleanup();
Iterator i = airCoords.iterator();
while (i.hasNext())
{
CoordTuple coord = (CoordTuple) i.next();
TileEntity te = world.getBlockTileEntity(coord.x, coord.y, coord.z);
if (te != null && te instanceof IServantLogic)
{
((IServantLogic) te).invalidateMaster(imaster, world, master.xCoord, master.yCoord, master.zCoord);
}
}
}
/*public void cleanup()
{
System.out.println("Structure cleanup activated. Air blocks: "+airCoords.size());
Expand Down

0 comments on commit f2535c7

Please sign in to comment.