Skip to content

Commit

Permalink
Fix various bugs, switch creative tabs to self-contained version
Browse files Browse the repository at this point in the history
  • Loading branch information
mDiyo committed Jul 6, 2014
1 parent 2629e24 commit db85c10
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 79 deletions.
15 changes: 7 additions & 8 deletions src/main/java/tconstruct/TConstruct.java
Expand Up @@ -2,10 +2,8 @@

import java.util.Random;

import mantle.lib.TabTools;
import mantle.pulsar.config.ForgeCFG;
import mantle.pulsar.control.PulseManager;
import mantle.pulsar.pulse.IPulse;
import net.minecraft.world.gen.structure.MapGenStructureIO;
import net.minecraftforge.common.MinecraftForge;

Expand All @@ -14,6 +12,7 @@

import tconstruct.armor.TinkerArmor;
import tconstruct.client.TControls;
import tconstruct.common.TConstructCreativeTab;
import tconstruct.common.TProxyCommon;
import tconstruct.library.TConstructRegistry;
import tconstruct.library.crafting.Detailing;
Expand Down Expand Up @@ -57,7 +56,7 @@
*/

@Mod(modid = "TConstruct", name = "TConstruct", version = "${version}",
dependencies = "required-after:Forge@[9.11,);required-after:Mantle;after:MineFactoryReloaded;after:NotEnoughItems;after:Waila;after:ThermalExpansion")
dependencies = "required-after:Forge@[10.13,);required-after:Mantle;after:MineFactoryReloaded;after:NotEnoughItems;after:Waila;after:ThermalExpansion")
public class TConstruct
{
/** The value of one ingot in millibuckets */
Expand Down Expand Up @@ -111,11 +110,11 @@ public void preInit (FMLPreInitializationEvent event)
/*pulsar.registerPulse(new TinkerPrayers());
pulsar.registerPulse(new TinkerCropify());*/

TConstructRegistry.materialTab = new TabTools("TConstructMaterials");
TConstructRegistry.toolTab = new TabTools("TConstructTools");
TConstructRegistry.partTab = new TabTools("TConstructParts");
TConstructRegistry.blockTab = new TabTools("TConstructBlocks");
TConstructRegistry.equipableTab = new TabTools("TConstructEquipables");
TConstructRegistry.materialTab = new TConstructCreativeTab("TConstructMaterials");
TConstructRegistry.toolTab = new TConstructCreativeTab("TConstructTools");
TConstructRegistry.partTab = new TConstructCreativeTab("TConstructParts");
TConstructRegistry.blockTab = new TConstructCreativeTab("TConstructBlocks");
TConstructRegistry.equipableTab = new TConstructCreativeTab("TConstructEquipables");

tableCasting = new LiquidCasting();
basinCasting = new LiquidCasting();
Expand Down
30 changes: 30 additions & 0 deletions src/main/java/tconstruct/common/TConstructCreativeTab.java
@@ -0,0 +1,30 @@
package tconstruct.common;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;

public class TConstructCreativeTab extends CreativeTabs
{
ItemStack display;

public TConstructCreativeTab(String label)
{
super(label);
}

public void init (ItemStack stack)
{
display = stack;
}

public ItemStack getIconItemStack ()
{
return display;
}

public Item getTabIconItem ()
{
return display.getItem();
}
}
12 changes: 6 additions & 6 deletions src/main/java/tconstruct/library/TConstructRegistry.java
Expand Up @@ -7,13 +7,13 @@
import java.util.LinkedList;
import java.util.List;

import mantle.lib.TabTools;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import tconstruct.common.TConstructCreativeTab;
import tconstruct.library.crafting.Detailing;
import tconstruct.library.crafting.LiquidCasting;
import tconstruct.library.crafting.ToolBuilder;
Expand All @@ -39,11 +39,11 @@ public class TConstructRegistry
public static Logger logger = LogManager.getLogger("TCon-API");

/* Creative tabs */
public static TabTools toolTab;
public static TabTools partTab;
public static TabTools materialTab;
public static TabTools blockTab;
public static TabTools equipableTab;
public static TConstructCreativeTab toolTab;
public static TConstructCreativeTab partTab;
public static TConstructCreativeTab materialTab;
public static TConstructCreativeTab blockTab;
public static TConstructCreativeTab equipableTab;

/* Items */

Expand Down
9 changes: 6 additions & 3 deletions src/main/java/tconstruct/library/crafting/Smeltery.java
Expand Up @@ -26,13 +26,16 @@ public class Smeltery
* Smeltery.addMelting(Block.oreIron, 0, 600, new
* FluidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 0));
*
* @param stack The itemstack to liquify
* @param stack The itemstack to liquify. Must hold a block.
* @param temperature How hot the block should be before liquifying. Max temp in the Smeltery is 800, other structures may vary
* @param output The result of the process in liquid form
*/
public static void addMelting0 (ItemStack stack, int temperature, FluidStack output)
public static void addMelting (ItemStack stack, int temperature, FluidStack output)
{
// addMelting(stack, stack, stack.getItemDamage(), temperature, output);
if (stack.getItem() instanceof ItemBlock)
addMelting(stack, ((ItemBlock) stack.getItem()).field_150939_a, stack.getItemDamage(), temperature, output);
else
throw new IllegalArgumentException("ItemStack must house a block.");
}

/**
Expand Down

0 comments on commit db85c10

Please sign in to comment.