mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-19 03:49:29 +00:00
Push my latest fixes to creative.
This commit is contained in:
1 parent
2b8c5e7610
commit
f2871763ed
10 files changed
+68
-26
No files matched your search
@@ -649,7 +649,7 @@ public class TContent implements IFuelHandler
|
||||
GameRegistry.registerItem(TRepo.strangeFood, "strangeFood");
|
||||
GameRegistry.registerItem(TRepo.oreBerries, "oreBerries");
|
||||
|
||||
boolean foodOverhaul;
|
||||
boolean foodOverhaul = false;
|
||||
if (Loader.isModLoaded("HungerOverhaul") || Loader.isModLoaded("fc_food")) {
|
||||
foodOverhaul = true;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import mantle.items.abstracts.CraftingItem;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import tconstruct.library.ItemBlocklike;
|
||||
@@ -50,7 +51,7 @@ public class ArmorPattern extends CraftingItem implements ItemBlocklike
|
||||
|
||||
private static final String[] patternName = new String[] { "helmet", "chestplate", "leggings", "boots" };
|
||||
|
||||
public void getSubItems (Block block, CreativeTabs tab, List list)
|
||||
public void getSubItems (Item block, CreativeTabs tab, List list)
|
||||
{
|
||||
for (int i = 0; i < patternName.length; i++)
|
||||
{
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.util.List;
|
||||
import mantle.items.abstracts.CraftingItem;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
@@ -43,7 +44,7 @@ public class Bowstring extends CraftingItem implements IToolPart
|
||||
return stack.getItemDamage();
|
||||
}
|
||||
|
||||
public void getSubItems (Block b, CreativeTabs tab, List list)
|
||||
public void getSubItems (Item b, CreativeTabs tab, List list)
|
||||
{
|
||||
list.add(new ItemStack(b, 1, 0));
|
||||
if (TRepo.thaumcraftAvailable)
|
||||
|
||||
@@ -7,6 +7,7 @@ import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemFood;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
@@ -60,7 +61,7 @@ public class GoldenHead extends ItemFood
|
||||
/**
|
||||
* returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
|
||||
*/
|
||||
public void getSubItems (Block b, CreativeTabs par2CreativeTabs, List par3List)
|
||||
public void getSubItems (Item b, CreativeTabs par2CreativeTabs, List par3List)
|
||||
{
|
||||
par3List.add(new ItemStack(b, 1, 0));
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public class Pattern extends CraftingItem implements IPattern
|
||||
"knifeblade", "chisel", "largerod", "toughbinding", "largeplate", "broadaxe", "scythe", "excavator", "largeblade", "hammerhead", "fullguard", "bowstring", "fletching", "arrowhead" };
|
||||
|
||||
@Override
|
||||
public void getSubItems (Block b, CreativeTabs tab, List list)
|
||||
public void getSubItems (Item b, CreativeTabs tab, List list)
|
||||
{
|
||||
for (int i = 1; i < patternName.length; i++)
|
||||
{
|
||||
|
||||
@@ -6,6 +6,7 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemFood;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
@@ -66,7 +67,7 @@ public class SpecialFood extends ItemFood
|
||||
return getUnlocalizedName() + "." + unlocalizedNames[arr];
|
||||
}
|
||||
|
||||
public void getSubItems (Block b, CreativeTabs tab, List list)
|
||||
public void getSubItems (Item b, CreativeTabs tab, List list)
|
||||
{
|
||||
for (int i = 0; i < unlocalizedNames.length; i++)
|
||||
list.add(new ItemStack(b, 1, i));
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.util.List;
|
||||
import mantle.items.abstracts.CraftingItem;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import tconstruct.common.TRepo;
|
||||
@@ -67,7 +68,7 @@ public class ToolPart extends CraftingItem implements IToolPart
|
||||
"copper", "bronze", "alumite", "steel", "blueslime", "pigiron", "", "", "", "", "", "", "", "", "", "", "", "", "thaumium" };
|
||||
|
||||
@Override
|
||||
public void getSubItems (Block b, CreativeTabs tab, List list)
|
||||
public void getSubItems (Item b, CreativeTabs tab, List list)
|
||||
{
|
||||
for (int i = 0; i < 19; i++)
|
||||
list.add(new ItemStack(b, 1, i));
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.util.List;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import tconstruct.common.TRepo;
|
||||
@@ -54,7 +55,8 @@ public class ToolShard extends ToolPart
|
||||
}
|
||||
}
|
||||
|
||||
public void getSubItems (Block b, CreativeTabs tab, List list)
|
||||
@Override
|
||||
public void getSubItems (Item b, CreativeTabs tab, List list)
|
||||
{
|
||||
for (int i = 1; i < 5; i++)
|
||||
list.add(new ItemStack(b, 1, i));
|
||||
|
||||
@@ -8,6 +8,7 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
@@ -49,7 +50,7 @@ public class ExoArmor extends ArmorCore
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems (Block b, CreativeTabs par2CreativeTabs, List par3List)
|
||||
public void getSubItems (Item b, CreativeTabs par2CreativeTabs, List par3List)
|
||||
{
|
||||
ItemStack armor = new ItemStack(b, 1, 0);
|
||||
NBTTagCompound baseTag = new NBTTagCompound();
|
||||
|
||||
@@ -58,7 +58,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public abstract class ToolCore extends Item implements IEnergyContainerItem, IBattlegearWeapon
|
||||
{
|
||||
//TE power constants -- TODO grab these from the items added
|
||||
//TE power constants -- TODO grab these from the
|
||||
protected int capacity = 400000;
|
||||
protected int maxReceive = 75;
|
||||
protected int maxExtract = 75;
|
||||
@@ -337,6 +337,25 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
|
||||
return;
|
||||
|
||||
NBTTagCompound tags = stack.getTagCompound();
|
||||
if (tags.hasKey("charge"))
|
||||
{
|
||||
String color = "";
|
||||
//double joules = this.getJoules(stack);
|
||||
int power = tags.getInteger("charge");
|
||||
|
||||
if (power != 0)
|
||||
{
|
||||
if (power <= this.getMaxEnergyStored(stack) / 3)
|
||||
color = "\u00a74";
|
||||
else if (power > this.getMaxEnergyStored(stack) * 2 / 3)
|
||||
color = "\u00a72";
|
||||
else
|
||||
color = "\u00a76";
|
||||
}
|
||||
|
||||
String charge = new StringBuilder().append(color).append(tags.getInteger("charge")).append("/").append(getMaxEnergyStored(stack)).append(" EU").toString();
|
||||
list.add(charge);
|
||||
}
|
||||
if (tags.hasKey("Energy"))
|
||||
{
|
||||
String color = "";
|
||||
@@ -546,7 +565,7 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
|
||||
boolean supress = false;
|
||||
try
|
||||
{
|
||||
clazz = Class.forName("tconstruct.common.TRepo"); //TODO: Make sure this is still working in 1.7.
|
||||
clazz = Class.forName("tconstruct.common.TContent"); //TODO: Make sure this is still working in 1.7.
|
||||
fld = clazz.getField("supressMissingToolLogs");
|
||||
supress = fld.getBoolean(fld);
|
||||
}
|
||||
@@ -821,6 +840,7 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (tags.hasKey("Energy"))
|
||||
{
|
||||
int energy = tags.getInteger("Energy");
|
||||
@@ -837,6 +857,7 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (tags.hasKey("Energy"))
|
||||
{
|
||||
int energy = tags.getInteger("Energy");
|
||||
@@ -847,30 +868,44 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
|
||||
}
|
||||
|
||||
/* Battlegear support, IBattlegearWeapon */
|
||||
|
||||
@Override
|
||||
public boolean willAllowOffhandWeapon ()
|
||||
// 1.6.4 start
|
||||
public boolean allowOffhand(ItemStack mainhand, ItemStack offhand)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean willAllowShield ()
|
||||
public boolean isOffhandHandDual(ItemStack off)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOffhandHandDualWeapon ()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean sheatheOnBack ()
|
||||
public boolean sheatheOnBack(ItemStack item)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
//1.6.4 end
|
||||
|
||||
//1.6.2 start
|
||||
public boolean willAllowOffhandWeapon()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean willAllowShield()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean isOffhandHandDualWeapon()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean sheatheOnBack()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
//1.6.2 end
|
||||
|
||||
@Override
|
||||
public boolean offhandAttackEntity (OffhandAttackEvent event, ItemStack mainhandItem, ItemStack offhandItem)
|
||||
@@ -884,7 +919,7 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public boolean offhandClickBlock (PlayerInteractEvent event, ItemStack mainhandItem, ItemStack offhandItem)
|
||||
{
|
||||
return true;
|
||||
@@ -961,7 +996,6 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
|
||||
}
|
||||
return tags.getInteger("Energy");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyStored (ItemStack container)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user