mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-25 14:34:22 +00:00
Upload my Code Changes/Format/imports
This commit is contained in:
1 parent
5bcdb7ca46
commit
5d4e38c0cb
264 files changed
+4014
-3972
No files matched your search
@@ -21,7 +21,7 @@ public class ActiveToolMod
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean afterBlockBreak () //Unfinished, not called
|
||||
public boolean afterBlockBreak () // Unfinished, not called
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -33,7 +33,7 @@ public class ActiveToolMod
|
||||
return 0;
|
||||
}
|
||||
|
||||
//Calculated after sprinting and enchant bonuses
|
||||
// Calculated after sprinting and enchant bonuses
|
||||
public float knockback (float modKnockback, float currentKnockback, ToolCore tool, NBTTagCompound tags, NBTTagCompound toolTags, ItemStack stack, EntityLivingBase player, Entity entity)
|
||||
{
|
||||
return 0f;
|
||||
@@ -44,7 +44,7 @@ public class ActiveToolMod
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void lateAttackEntity () //Unfinished, not called
|
||||
public void lateAttackEntity () // Unfinished, not called
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -21,7 +21,8 @@ import tconstruct.library.tools.FletchingMaterial;
|
||||
import tconstruct.library.tools.TToolMaterial;
|
||||
import tconstruct.library.tools.ToolCore;
|
||||
|
||||
/** A registry to store any relevant API work
|
||||
/**
|
||||
* A registry to store any relevant API work
|
||||
*
|
||||
* @author mDiyo
|
||||
*/
|
||||
@@ -39,29 +40,30 @@ public class TConstructRegistry
|
||||
|
||||
/* Items */
|
||||
|
||||
/** A directory of crafting items and tools used by the mod.
|
||||
/**
|
||||
* A directory of crafting items and tools used by the mod.
|
||||
*
|
||||
* Tools:
|
||||
* pickaxe, shovel, hatchet, broadsword, longsword, rapier, dagger, cutlass
|
||||
* frypan, battlesign, mattock, chisel
|
||||
* lumberaxe, cleaver, scythe, excavator, hammer, battleaxe
|
||||
* Tools: pickaxe, shovel, hatchet, broadsword, longsword, rapier, dagger,
|
||||
* cutlass frypan, battlesign, mattock, chisel lumberaxe, cleaver, scythe,
|
||||
* excavator, hammer, battleaxe
|
||||
*
|
||||
* Patterns:
|
||||
* blankPattern, woodPattern, metalPattern
|
||||
* Patterns: blankPattern, woodPattern, metalPattern
|
||||
*
|
||||
* Tool crafting parts:
|
||||
* toolRod, toolShard, binding, toughBinding, toughRod, heavyPlate
|
||||
* pickaxeHead, shovelhead, hatchetHead, swordBlade, wideguard, handGuard, crossbar, knifeBlade,
|
||||
* fullGuard, frypanHead, signHead, chiselHead
|
||||
* scytheBlade, broadAxeHead, excavatorHead, largeSwordBlade, hammerHead
|
||||
* bowstring, fletching, arrowhead
|
||||
* Tool crafting parts: toolRod, toolShard, binding, toughBinding, toughRod,
|
||||
* heavyPlate pickaxeHead, shovelhead, hatchetHead, swordBlade, wideguard,
|
||||
* handGuard, crossbar, knifeBlade, fullGuard, frypanHead, signHead,
|
||||
* chiselHead scytheBlade, broadAxeHead, excavatorHead, largeSwordBlade,
|
||||
* hammerHead bowstring, fletching, arrowhead
|
||||
*/
|
||||
public static HashMap<String, Item> itemDirectory = new HashMap<String, Item>();
|
||||
|
||||
/** Adds an item to the directory
|
||||
/**
|
||||
* Adds an item to the directory
|
||||
*
|
||||
* @param name Associates the name with the stack
|
||||
* @param itemstack The stack to add to the directory
|
||||
* @param name
|
||||
* Associates the name with the stack
|
||||
* @param itemstack
|
||||
* The stack to add to the directory
|
||||
*/
|
||||
|
||||
public static void addItemToDirectory (String name, Item itemstack)
|
||||
@@ -73,9 +75,11 @@ public class TConstructRegistry
|
||||
itemDirectory.put(name, itemstack);
|
||||
}
|
||||
|
||||
/** Retrieves an itemstack from the directory
|
||||
/**
|
||||
* Retrieves an itemstack from the directory
|
||||
*
|
||||
* @param name The name of the item to get
|
||||
* @param name
|
||||
* The name of the item to get
|
||||
* @return Item associated with the name, or null if not present.
|
||||
*/
|
||||
|
||||
@@ -88,26 +92,33 @@ public class TConstructRegistry
|
||||
return ret;
|
||||
}
|
||||
|
||||
/** A directory of ItemStacks. Contains mostly crafting items
|
||||
/**
|
||||
* A directory of ItemStacks. Contains mostly crafting items
|
||||
*
|
||||
* Materials:
|
||||
* paperStack, greenSlimeCrystal, blueSlimeCrystal, searedBrick, mossBall, lavaCrystal, necroticBone, silkyCloth, silkyJewel
|
||||
* ingotCobalt, ingotArdite, ingotManyullyn, ingotCopper, ingotTin, ingotAluminum, rawAluminum,
|
||||
* ingotBronze, ingotAluminumBrass, ingotAlumite, ingotSteel, ingotObsidian
|
||||
* nuggetIron, nuggetCopper, nuggetTin, nuggetAluminum, nuggetSilver, nuggetAluminumBrass
|
||||
* oreberryIron, oreberryGold, oreberryCopper, oreberryTin, oreberryTin, oreberrySilver,
|
||||
* diamondApple, blueSlimeFood, canisterEmpty, miniRedHeart, canisterRedHeart
|
||||
* Materials: paperStack, greenSlimeCrystal, blueSlimeCrystal, searedBrick,
|
||||
* mossBall, lavaCrystal, necroticBone, silkyCloth, silkyJewel ingotCobalt,
|
||||
* ingotArdite, ingotManyullyn, ingotCopper, ingotTin, ingotAluminum,
|
||||
* rawAluminum, ingotBronze, ingotAluminumBrass, ingotAlumite, ingotSteel,
|
||||
* ingotObsidian nuggetIron, nuggetCopper, nuggetTin, nuggetAluminum,
|
||||
* nuggetSilver, nuggetAluminumBrass oreberryIron, oreberryGold,
|
||||
* oreberryCopper, oreberryTin, oreberryTin, oreberrySilver, diamondApple,
|
||||
* blueSlimeFood, canisterEmpty, miniRedHeart, canisterRedHeart
|
||||
*
|
||||
* Patterns - These have a suffix of Pattern or Cast. ex: hatchetHeadPattern
|
||||
* ingot, toolRod, pickaxeHead, shovelHead, hatchetHead, swordBlade, wideGuard, handGuard, crossbar, binding, frypanHead, signHead,
|
||||
* knifeBlade, chiselHead, toughRod, toughBinding, largePlate, broadAxeHead, scytheHead, excavatorHead, largeBlade, hammerHead, fullGuard, bowstring
|
||||
* ingot, toolRod, pickaxeHead, shovelHead, hatchetHead, swordBlade,
|
||||
* wideGuard, handGuard, crossbar, binding, frypanHead, signHead,
|
||||
* knifeBlade, chiselHead, toughRod, toughBinding, largePlate, broadAxeHead,
|
||||
* scytheHead, excavatorHead, largeBlade, hammerHead, fullGuard, bowstring
|
||||
*/
|
||||
static HashMap<String, ItemStack> itemstackDirectory = new HashMap<String, ItemStack>();
|
||||
|
||||
/** Adds an itemstack to the directory
|
||||
/**
|
||||
* Adds an itemstack to the directory
|
||||
*
|
||||
* @param name Associates the name with the stack
|
||||
* @param itemstack The stack to add to the directory
|
||||
* @param name
|
||||
* Associates the name with the stack
|
||||
* @param itemstack
|
||||
* The stack to add to the directory
|
||||
*/
|
||||
|
||||
public static void addItemStackToDirectory (String name, ItemStack itemstack)
|
||||
@@ -119,9 +130,11 @@ public class TConstructRegistry
|
||||
itemstackDirectory.put(name, itemstack);
|
||||
}
|
||||
|
||||
/** Retrieves an itemstack from the directory
|
||||
/**
|
||||
* Retrieves an itemstack from the directory
|
||||
*
|
||||
* @param name The name of the item to get
|
||||
* @param name
|
||||
* The name of the item to get
|
||||
* @return Item associated with the name, or null if not present.
|
||||
*/
|
||||
|
||||
@@ -136,19 +149,25 @@ public class TConstructRegistry
|
||||
|
||||
public static ArrayList<ToolCore> tools = new ArrayList<ToolCore>(20);
|
||||
|
||||
//Parts
|
||||
// Parts
|
||||
|
||||
/** List: Item ID, metadata, material ID
|
||||
* ItemStack: Output. Ex: Cactus Binding
|
||||
/**
|
||||
* List: Item ID, metadata, material ID ItemStack: Output. Ex: Cactus
|
||||
* Binding
|
||||
*/
|
||||
public static HashMap<List, ItemStack> patternPartMapping = new HashMap<List, ItemStack>();
|
||||
|
||||
/** Maps an item and a material ID to an output part
|
||||
/**
|
||||
* Maps an item and a material ID to an output part
|
||||
*
|
||||
* @param woodPattern ID to check against
|
||||
* @param patternMeta Metadata to check against
|
||||
* @param materialID Material that goes with the item
|
||||
* @param output The resulting part
|
||||
* @param woodPattern
|
||||
* ID to check against
|
||||
* @param patternMeta
|
||||
* Metadata to check against
|
||||
* @param materialID
|
||||
* Material that goes with the item
|
||||
* @param output
|
||||
* The resulting part
|
||||
*/
|
||||
public static void addPartMapping (Item woodPattern, int patternMeta, int materialID, ItemStack output)
|
||||
{
|
||||
@@ -163,9 +182,10 @@ public class TConstructRegistry
|
||||
return null;
|
||||
}
|
||||
|
||||
//Tools
|
||||
// Tools
|
||||
|
||||
/** Internal tool mapping, used for adding textures
|
||||
/**
|
||||
* Internal tool mapping, used for adding textures
|
||||
*
|
||||
* @param tool
|
||||
*/
|
||||
@@ -175,7 +195,8 @@ public class TConstructRegistry
|
||||
tools.add(tool);
|
||||
}
|
||||
|
||||
/** Internal tool mapping, used for adding textures
|
||||
/**
|
||||
* Internal tool mapping, used for adding textures
|
||||
*
|
||||
* @return List of tools
|
||||
*/
|
||||
@@ -185,13 +206,16 @@ public class TConstructRegistry
|
||||
return tools;
|
||||
}
|
||||
|
||||
/** Registers a tool to its crafting parts.
|
||||
* If an output is registered multiple times the parts are added to the recipe's input list
|
||||
* Valid part amounts are 2, 3, and 4.
|
||||
/**
|
||||
* Registers a tool to its crafting parts. If an output is registered
|
||||
* multiple times the parts are added to the recipe's input list Valid part
|
||||
* amounts are 2, 3, and 4.
|
||||
*
|
||||
* @see ToolBuidler
|
||||
* @param output The ToolCore to craft
|
||||
* @param parts Pieces to make the tool with
|
||||
* @param output
|
||||
* The ToolCore to craft
|
||||
* @param parts
|
||||
* Pieces to make the tool with
|
||||
*/
|
||||
public static void addToolRecipe (ToolCore output, Item... parts)
|
||||
{
|
||||
@@ -202,22 +226,36 @@ public class TConstructRegistry
|
||||
tb.addToolRecipe(output, parts);
|
||||
}
|
||||
|
||||
//Materials
|
||||
// Materials
|
||||
public static HashMap<Integer, TToolMaterial> toolMaterials = new HashMap<Integer, TToolMaterial>(40);
|
||||
public static HashMap<String, TToolMaterial> toolMaterialStrings = new HashMap<String, TToolMaterial>(40);
|
||||
|
||||
/** Adds a tool material to the registry
|
||||
/**
|
||||
* Adds a tool material to the registry
|
||||
*
|
||||
* @param materialID Unique ID, stored for each part
|
||||
* @exception materialID must be unique
|
||||
* @param materialName Unique name for data lookup purposes
|
||||
* @param harvestLevel The materials which the tool can harvest. Pickaxe levels - 0: Wood, 1: Stone, 2: Redstone/Diamond, 3: Obsidian, 4: Cobalt/Ardite, 5: Manyullyn
|
||||
* @param durability Base durability of the tool, affects tool heads.
|
||||
* @param miningspeed Base mining speed, divided by 100 in use
|
||||
* @param attack Base attack
|
||||
* @param handleModifier Durability multiplier on the tool
|
||||
* @param reinforced Reinforced level
|
||||
* @param stonebound Amount of Stonebound to put on the tool. Negative numbers are Spiny.
|
||||
* @param materialID
|
||||
* Unique ID, stored for each part
|
||||
* @exception materialID
|
||||
* must be unique
|
||||
* @param materialName
|
||||
* Unique name for data lookup purposes
|
||||
* @param harvestLevel
|
||||
* The materials which the tool can harvest. Pickaxe levels - 0:
|
||||
* Wood, 1: Stone, 2: Redstone/Diamond, 3: Obsidian, 4:
|
||||
* Cobalt/Ardite, 5: Manyullyn
|
||||
* @param durability
|
||||
* Base durability of the tool, affects tool heads.
|
||||
* @param miningspeed
|
||||
* Base mining speed, divided by 100 in use
|
||||
* @param attack
|
||||
* Base attack
|
||||
* @param handleModifier
|
||||
* Durability multiplier on the tool
|
||||
* @param reinforced
|
||||
* Reinforced level
|
||||
* @param stonebound
|
||||
* Amount of Stonebound to put on the tool. Negative numbers are
|
||||
* Spiny.
|
||||
*/
|
||||
|
||||
public static void addToolMaterial (int materialID, String materialName, int harvestLevel, int durability, int miningspeed, int attack, float handleModifier, int reinforced, float stonebound,
|
||||
@@ -234,19 +272,34 @@ public class TConstructRegistry
|
||||
throw new IllegalArgumentException("[TCon API] Material ID " + materialID + " is already occupied by " + mat.materialName);
|
||||
}
|
||||
|
||||
/** Adds a tool material to the registry
|
||||
/**
|
||||
* Adds a tool material to the registry
|
||||
*
|
||||
* @param materialID Unique ID, stored for each part
|
||||
* @exception materialID must be unique
|
||||
* @param materialName Unique name for data lookup purposes
|
||||
* @param displayName Prefix for creative mode tools
|
||||
* @param harvestLevel The materials which the tool can harvest. Pickaxe levels - 0: Wood, 1: Stone, 2: Redstone/Diamond, 3: Obsidian, 4: Cobalt/Ardite, 5: Manyullyn
|
||||
* @param durability Base durability of the tool, affects tool heads.
|
||||
* @param miningspeed Base mining speed, divided by 100 in use
|
||||
* @param attack Base attack
|
||||
* @param handleModifier Durability multiplier on the tool
|
||||
* @param reinforced Reinforced level
|
||||
* @param stonebound Amount of Stonebound to put on the tool. Negative numbers are Spiny.
|
||||
* @param materialID
|
||||
* Unique ID, stored for each part
|
||||
* @exception materialID
|
||||
* must be unique
|
||||
* @param materialName
|
||||
* Unique name for data lookup purposes
|
||||
* @param displayName
|
||||
* Prefix for creative mode tools
|
||||
* @param harvestLevel
|
||||
* The materials which the tool can harvest. Pickaxe levels - 0:
|
||||
* Wood, 1: Stone, 2: Redstone/Diamond, 3: Obsidian, 4:
|
||||
* Cobalt/Ardite, 5: Manyullyn
|
||||
* @param durability
|
||||
* Base durability of the tool, affects tool heads.
|
||||
* @param miningspeed
|
||||
* Base mining speed, divided by 100 in use
|
||||
* @param attack
|
||||
* Base attack
|
||||
* @param handleModifier
|
||||
* Durability multiplier on the tool
|
||||
* @param reinforced
|
||||
* Reinforced level
|
||||
* @param stonebound
|
||||
* Amount of Stonebound to put on the tool. Negative numbers are
|
||||
* Spiny.
|
||||
*/
|
||||
|
||||
public static void addToolMaterial (int materialID, String materialName, String displayName, int harvestLevel, int durability, int miningspeed, int attack, float handleModifier, int reinforced,
|
||||
@@ -263,11 +316,16 @@ public class TConstructRegistry
|
||||
throw new IllegalArgumentException("[TCon API] Material ID " + materialID + " is already occupied by " + mat.materialName);
|
||||
}
|
||||
|
||||
/** Adds a tool material to the registry
|
||||
/**
|
||||
* Adds a tool material to the registry
|
||||
*
|
||||
* @param materialID Unique ID, stored for each part
|
||||
* @exception materialID must be unique
|
||||
* @param material Complete tool material to add. Uses the name in the material for lookup purposes.
|
||||
* @param materialID
|
||||
* Unique ID, stored for each part
|
||||
* @exception materialID
|
||||
* must be unique
|
||||
* @param material
|
||||
* Complete tool material to add. Uses the name in the material
|
||||
* for lookup purposes.
|
||||
*/
|
||||
|
||||
public static void addtoolMaterial (int materialID, TToolMaterial material)
|
||||
@@ -282,9 +340,11 @@ public class TConstructRegistry
|
||||
throw new IllegalArgumentException("[TCon API] Material ID " + materialID + " is already occupied by " + mat.materialName);
|
||||
}
|
||||
|
||||
/** Looks up a tool material by ID
|
||||
/**
|
||||
* Looks up a tool material by ID
|
||||
*
|
||||
* @param key The ID to look up
|
||||
* @param key
|
||||
* The ID to look up
|
||||
* @return Tool Material
|
||||
*/
|
||||
|
||||
@@ -293,9 +353,11 @@ public class TConstructRegistry
|
||||
return (toolMaterials.get(key));
|
||||
}
|
||||
|
||||
/** Looks up a tool material by name
|
||||
/**
|
||||
* Looks up a tool material by name
|
||||
*
|
||||
* @param key the name to look up
|
||||
* @param key
|
||||
* the name to look up
|
||||
* @return Tool Material
|
||||
*/
|
||||
|
||||
@@ -304,7 +366,7 @@ public class TConstructRegistry
|
||||
return (toolMaterialStrings.get(key));
|
||||
}
|
||||
|
||||
//Bow materials
|
||||
// Bow materials
|
||||
public static HashMap<Integer, BowMaterial> bowMaterials = new HashMap<Integer, BowMaterial>(40);
|
||||
|
||||
public static void addBowMaterial (int materialID, int durability, int drawSpeed, float speedMax)
|
||||
@@ -353,7 +415,7 @@ public class TConstructRegistry
|
||||
return arrowMaterials.get(materialID);
|
||||
}
|
||||
|
||||
//Custom materials - bowstrings, fletching, etc
|
||||
// Custom materials - bowstrings, fletching, etc
|
||||
public static ArrayList<CustomMaterial> customMaterials = new ArrayList<CustomMaterial>();
|
||||
|
||||
public static void addCustomMaterial (CustomMaterial mat)
|
||||
@@ -394,41 +456,26 @@ public class TConstructRegistry
|
||||
return null;
|
||||
}
|
||||
|
||||
/*public static CustomMaterial getCustomMaterial(ItemStack input, ItemStack pattern)
|
||||
{
|
||||
for (CustomMaterial mat : customMaterials)
|
||||
{
|
||||
if (mat.matches(input, pattern))
|
||||
return mat;
|
||||
}
|
||||
return null;
|
||||
}*/
|
||||
/*
|
||||
* public static CustomMaterial getCustomMaterial(ItemStack input, ItemStack
|
||||
* pattern) { for (CustomMaterial mat : customMaterials) { if
|
||||
* (mat.matches(input, pattern)) return mat; } return null; }
|
||||
*/
|
||||
|
||||
/*public static ItemStack craftBowString(ItemStack stack)
|
||||
{
|
||||
if (stack.stackSize < 3)
|
||||
return null;
|
||||
|
||||
for (BowstringMaterial mat : bowstringMaterials)
|
||||
{
|
||||
if (stack.isItemEqual(mat.input))
|
||||
return mat.craftingItem.copy();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static BowstringMaterial getBowstringMaterial(ItemStack stack)
|
||||
{
|
||||
if (stack.stackSize < 3)
|
||||
return null;
|
||||
|
||||
for (BowstringMaterial mat : bowstringMaterials)
|
||||
{
|
||||
if (stack.isItemEqual(mat.input))
|
||||
return mat;
|
||||
}
|
||||
return null;
|
||||
}*/
|
||||
/*
|
||||
* public static ItemStack craftBowString(ItemStack stack) { if
|
||||
* (stack.stackSize < 3) return null;
|
||||
*
|
||||
* for (BowstringMaterial mat : bowstringMaterials) { if
|
||||
* (stack.isItemEqual(mat.input)) return mat.craftingItem.copy(); } return
|
||||
* null; }
|
||||
*
|
||||
* public static BowstringMaterial getBowstringMaterial(ItemStack stack) {
|
||||
* if (stack.stackSize < 3) return null;
|
||||
*
|
||||
* for (BowstringMaterial mat : bowstringMaterials) { if
|
||||
* (stack.isItemEqual(mat.input)) return mat; } return null; }
|
||||
*/
|
||||
|
||||
public static LiquidCasting getTableCasting ()
|
||||
{
|
||||
@@ -500,181 +547,173 @@ public class TConstructRegistry
|
||||
activeModifiers.add(mod);
|
||||
}
|
||||
|
||||
/* Used to determine how blocks are laid out in the drawbridge
|
||||
* 0: Metadata has to match
|
||||
* 1: Metadata has no meaning
|
||||
* 2: Should not be placed
|
||||
* 3: Has rotational metadata
|
||||
* 4: Rails
|
||||
* 5: Has rotational TileEntity data
|
||||
* 6: Custom placement logic
|
||||
/*
|
||||
* Used to determine how blocks are laid out in the drawbridge 0: Metadata
|
||||
* has to match 1: Metadata has no meaning 2: Should not be placed 3: Has
|
||||
* rotational metadata 4: Rails 5: Has rotational TileEntity data 6: Custom
|
||||
* placement logic
|
||||
*/
|
||||
|
||||
//moved to TMech
|
||||
//public static HashMap<ItemStack, Integer> drawbridgeState = new HashMap<ItemStack, Integer>();
|
||||
/* Blocks that are interchangable with each other. Ex: Still and flowing water */
|
||||
// static HashMap<Block, Block> interchangableBlockMapping = new HashMap<Block, Block> ();
|
||||
/*Blocks that place items, and vice versa */
|
||||
// public static HashBiMap<Block, Item> blockToItemMapping;
|
||||
// moved to TMech
|
||||
// public static HashMap<ItemStack, Integer> drawbridgeState = new
|
||||
// HashMap<ItemStack, Integer>();
|
||||
/*
|
||||
* Blocks that are interchangable with each other. Ex: Still and flowing
|
||||
* water
|
||||
*/
|
||||
// static HashMap<Block, Block> interchangableBlockMapping = new
|
||||
// HashMap<Block, Block> ();
|
||||
/* Blocks that place items, and vice versa */
|
||||
// public static HashBiMap<Block, Item> blockToItemMapping;
|
||||
|
||||
static void initializeDrawbridgeState ()
|
||||
{
|
||||
//TODO fix this mess and move to TMech
|
||||
/* drawbridgeState[Blocks.stone] = 1;
|
||||
drawbridgeState[Blocks.grass] = 1;
|
||||
drawbridgeState[Blocks.dirt] = 1;
|
||||
drawbridgeState[Blocks.cobblestone] = 1;
|
||||
drawbridgeState[Blocks.bedrock] = 2;
|
||||
drawbridgeState[Blocks.water] = 1;
|
||||
drawbridgeState[Blocks.lava] = 1;
|
||||
drawbridgeState[Blocks.sand] = 1;
|
||||
drawbridgeState[Blocks.gravel] = 1;
|
||||
drawbridgeState[Blocks.gold_ore] = 1;
|
||||
drawbridgeState[Blocks.iron_ore] = 1;
|
||||
drawbridgeState[Blocks.coal_ore] = 1;
|
||||
drawbridgeState[Blocks.sponge] = 1;
|
||||
drawbridgeState[Blocks.lapis_ore] = 1;
|
||||
drawbridgeState[Blocks.lapis_block] = 1;
|
||||
drawbridgeState[Blocks.dispenser] = 3;
|
||||
drawbridgeState[Blocks.music] = 1;
|
||||
drawbridgeState[Blocks.bed] = 2;
|
||||
drawbridgeState[Blocks.railPowered] = 4;
|
||||
drawbridgeState[Blocks.railDetector] = 4;
|
||||
drawbridgeState[Blocks.sticky_piston] = 3;
|
||||
drawbridgeState[Blocks.web] = 1;
|
||||
drawbridgeState[Blocks.piston] = 3;
|
||||
drawbridgeState[Blocks.piston_extension] = 2;
|
||||
drawbridgeState[Blocks.plantYellow] = 1;
|
||||
drawbridgeState[Blocks.plantRed] = 1;
|
||||
drawbridgeState[Blocks.mushroomBrown] = 1;
|
||||
drawbridgeState[Blocks.mushroomRed] = 1;
|
||||
drawbridgeState[Blocks.gold_block] = 1;
|
||||
drawbridgeState[Blocks.iron_block] = 1;
|
||||
drawbridgeState[Blocks.brick_block] = 1;
|
||||
drawbridgeState[Blocks.tnt] = 1;
|
||||
drawbridgeState[Blocks.bookshelf] = 1;
|
||||
drawbridgeState[Blocks.mossy_cobblestone] = 1;
|
||||
drawbridgeState[Blocks.obsidian] = 1;
|
||||
drawbridgeState[Blocks.torchWood] = 1;
|
||||
drawbridgeState[Blocks.fire] = 1;
|
||||
drawbridgeState[Blocks.mobSpawner] = 2;
|
||||
drawbridgeState[Blocks.stairsWoodOak] = 3;
|
||||
drawbridgeState[Blocks.chest] = 5;
|
||||
drawbridgeState[Blocks.redstoneWire] = 1;
|
||||
blockToItemMapping[Blocks.redstoneWire] = Items.redstone;
|
||||
blockToItemMapping[Items.redstone] = Blocks.redstoneWire;
|
||||
drawbridgeState[Blocks.diamond_ore] = 1;
|
||||
drawbridgeState[Blocks.diamond_block] = 1;
|
||||
drawbridgeState[Blocks.crafting_table] = 1;
|
||||
drawbridgeState[Blocks.crops] = 2;
|
||||
drawbridgeState[Blocks.tilledField] = 1;
|
||||
drawbridgeState[Blocks.furnaceIdle] = 3;
|
||||
drawbridgeState[Blocks.furnaceBurning] = 3;
|
||||
interchangableBlockMapping[Blocks.furnaceIdle] = Blocks.furnaceBurning;
|
||||
interchangableBlockMapping[Blocks.furnaceBurning] = Blocks.furnaceIdle;
|
||||
drawbridgeState[Blocks.tilledField] = 1;
|
||||
drawbridgeState[Blocks.signPost] = 3;
|
||||
drawbridgeState[Blocks.doorWood] = 2;
|
||||
drawbridgeState[Blocks.ladder] = 1;
|
||||
drawbridgeState[Blocks.rail] = 4;
|
||||
drawbridgeState[Blocks.stairsCobblestone] = 3;
|
||||
drawbridgeState[Blocks.signWall] = 3;
|
||||
drawbridgeState[Blocks.lever] = 3;
|
||||
drawbridgeState[Blocks.pressurePlateStone] = 1;
|
||||
drawbridgeState[Blocks.doorIron] = 2;
|
||||
drawbridgeState[Blocks.pressurePlatePlanks] = 1;
|
||||
drawbridgeState[Blocks.oreRedstone] = 1;
|
||||
drawbridgeState[Blocks.oreRedstoneGlowing] = 1;
|
||||
drawbridgeState[Blocks.torchRedstoneIdle] = 1;
|
||||
drawbridgeState[Blocks.torchRedstoneActive] = 1;
|
||||
drawbridgeState[Blocks.stoneButton] = 3;
|
||||
drawbridgeState[Blocks.snow] = 1;
|
||||
drawbridgeState[Blocks.ice] = 1;
|
||||
drawbridgeState[Blocks.blockSnow] = 1;
|
||||
drawbridgeState[Blocks.cactus] = 2;
|
||||
drawbridgeState[Blocks.blockClay] = 1;
|
||||
drawbridgeState[Blocks.reed] = 1;
|
||||
drawbridgeState[Blocks.jukebox] = 1;
|
||||
drawbridgeState[Blocks.fence] = 1;
|
||||
drawbridgeState[Blocks.pumpkin] = 1;
|
||||
drawbridgeState[Blocks.netherrack] = 1;
|
||||
drawbridgeState[Blocks.slowSand] = 1;
|
||||
drawbridgeState[Blocks.glowStone] = 1;
|
||||
drawbridgeState[Blocks.portal] = 2;
|
||||
drawbridgeState[Blocks.pumpkinLantern] = 1;
|
||||
drawbridgeState[Blocks.cake] = 2;
|
||||
drawbridgeState[Blocks.redstoneRepeaterIdle] = 3;
|
||||
drawbridgeState[Blocks.redstoneRepeaterActive] = 3;
|
||||
interchangableBlockMapping[Blocks.redstoneRepeaterIdle] = Blocks.redstoneRepeaterActive;
|
||||
interchangableBlockMapping[Blocks.redstoneRepeaterActive] = Blocks.redstoneRepeaterIdle;
|
||||
blockToItemMapping[Blocks.redstoneRepeaterIdle] = Items.redstoneRepeater.itemID;
|
||||
blockToItemMapping[Blocks.redstoneRepeaterActive] = Items.redstoneRepeater.itemID;
|
||||
blockToItemMapping[Items.redstoneRepeater] = Blocks.redstoneRepeaterIdle;
|
||||
drawbridgeState[Blocks.lockedChest] = 5;
|
||||
drawbridgeState[Blocks.trapdoor] = 3;
|
||||
drawbridgeState[Blocks.mushroomCapBrown] = 1;
|
||||
drawbridgeState[Blocks.mushroomCapRed] = 1;
|
||||
drawbridgeState[Blocks.fenceIron] = 1;
|
||||
drawbridgeState[Blocks.thinGlass] = 1;
|
||||
drawbridgeState[Blocks.melon] = 1;
|
||||
drawbridgeState[Blocks.pumpkinStem] = 2;
|
||||
drawbridgeState[Blocks.melonStem] = 2;
|
||||
drawbridgeState[Blocks.vine] = 3;
|
||||
drawbridgeState[Blocks.fenceGate] = 3;
|
||||
drawbridgeState[Blocks.stairsBrick] = 3;
|
||||
drawbridgeState[Blocks.stairsStoneBrick] = 3;
|
||||
drawbridgeState[Blocks.mycelium] = 1;
|
||||
drawbridgeState[Blocks.waterlily] = 1;
|
||||
drawbridgeState[Blocks.netherBrick] = 1;
|
||||
drawbridgeState[Blocks.netherFence] = 1;
|
||||
drawbridgeState[Blocks.netherFence] = 3;
|
||||
drawbridgeState[Blocks.netherStalk] = 2;
|
||||
drawbridgeState[Blocks.enchantmentTable] = 1;
|
||||
drawbridgeState[Blocks.brewingStand] = 1;
|
||||
drawbridgeState[Blocks.cauldron] = 1;
|
||||
drawbridgeState[Blocks.endPortal] = 2;
|
||||
drawbridgeState[Blocks.dragonEgg] = 1;
|
||||
drawbridgeState[Blocks.redstoneLampIdle] = 1;
|
||||
drawbridgeState[Blocks.redstoneLampActive] = 1;
|
||||
drawbridgeState[Blocks.cocoaPlant] = 2;
|
||||
drawbridgeState[Blocks.stairsSandStone] = 3;
|
||||
drawbridgeState[Blocks.oreEmerald] = 1;
|
||||
drawbridgeState[Blocks.enderChest] = 5;
|
||||
drawbridgeState[Blocks.tripWireSource] = 1;
|
||||
drawbridgeState[Blocks.tripWire] = 1;
|
||||
drawbridgeState[Blocks.blockEmerald] = 1;
|
||||
drawbridgeState[Blocks.stairsWoodSpruce] = 3;
|
||||
drawbridgeState[Blocks.stairsWoodBirch] = 3;
|
||||
drawbridgeState[Blocks.stairsWoodJungle] = 3;
|
||||
drawbridgeState[Blocks.commandBlock] = 1;
|
||||
drawbridgeState[Blocks.beacon] = 1;
|
||||
drawbridgeState[Blocks.cobblestoneWall] = 1;
|
||||
drawbridgeState[Blocks.flowerPot] = 1;
|
||||
drawbridgeState[Blocks.carrot] = 2;
|
||||
drawbridgeState[Blocks.potato] = 1;
|
||||
drawbridgeState[Blocks.woodenButton] = 3;
|
||||
drawbridgeState[Blocks.skull] = 2;
|
||||
drawbridgeState[Blocks.chestTrapped] = 5;
|
||||
drawbridgeState[Blocks.pressurePlateGold] = 1;
|
||||
drawbridgeState[Blocks.pressurePlateIron] = 1;
|
||||
drawbridgeState[Blocks.redstoneComparatorIdle] = 1;
|
||||
drawbridgeState[Blocks.redstoneComparatorActive] = 1;
|
||||
interchangableBlockMapping[Blocks.redstoneComparatorIdle] = Blocks.redstoneComparatorActive;
|
||||
interchangableBlockMapping[Blocks.redstoneComparatorActive] = Blocks.redstoneComparatorIdle;
|
||||
blockToItemMapping[Blocks.redstoneComparatorIdle] = Items.comparator.itemID;
|
||||
blockToItemMapping[Blocks.redstoneComparatorActive] = Items.comparator.itemID;
|
||||
blockToItemMapping[Items.comparator] = Blocks.redstoneComparatorIdle;
|
||||
drawbridgeState[Blocks.daylightSensor] = 1;
|
||||
drawbridgeState[Blocks.blockRedstone] = 1;
|
||||
drawbridgeState[Blocks.oreNetherQuartz] = 1;
|
||||
drawbridgeState[Blocks.hopperBlock] = 3;
|
||||
drawbridgeState[Blocks.blockNetherQuartz] = 1;
|
||||
drawbridgeState[Blocks.stairsNetherQuartz] = 3;
|
||||
drawbridgeState[Blocks.railActivator] = 4;
|
||||
drawbridgeState[Blocks.dropper] = 3;
|
||||
interchangableBlockMapping[Blocks.dirt] = Blocks.grass;
|
||||
interchangableBlockMapping[Blocks.grass] = Blocks.dirt;
|
||||
*/
|
||||
// TODO fix this mess and move to TMech
|
||||
/*
|
||||
* drawbridgeState[Blocks.stone] = 1; drawbridgeState[Blocks.grass] = 1;
|
||||
* drawbridgeState[Blocks.dirt] = 1; drawbridgeState[Blocks.cobblestone]
|
||||
* = 1; drawbridgeState[Blocks.bedrock] = 2;
|
||||
* drawbridgeState[Blocks.water] = 1; drawbridgeState[Blocks.lava] = 1;
|
||||
* drawbridgeState[Blocks.sand] = 1; drawbridgeState[Blocks.gravel] = 1;
|
||||
* drawbridgeState[Blocks.gold_ore] = 1;
|
||||
* drawbridgeState[Blocks.iron_ore] = 1;
|
||||
* drawbridgeState[Blocks.coal_ore] = 1; drawbridgeState[Blocks.sponge]
|
||||
* = 1; drawbridgeState[Blocks.lapis_ore] = 1;
|
||||
* drawbridgeState[Blocks.lapis_block] = 1;
|
||||
* drawbridgeState[Blocks.dispenser] = 3; drawbridgeState[Blocks.music]
|
||||
* = 1; drawbridgeState[Blocks.bed] = 2;
|
||||
* drawbridgeState[Blocks.railPowered] = 4;
|
||||
* drawbridgeState[Blocks.railDetector] = 4;
|
||||
* drawbridgeState[Blocks.sticky_piston] = 3;
|
||||
* drawbridgeState[Blocks.web] = 1; drawbridgeState[Blocks.piston] = 3;
|
||||
* drawbridgeState[Blocks.piston_extension] = 2;
|
||||
* drawbridgeState[Blocks.plantYellow] = 1;
|
||||
* drawbridgeState[Blocks.plantRed] = 1;
|
||||
* drawbridgeState[Blocks.mushroomBrown] = 1;
|
||||
* drawbridgeState[Blocks.mushroomRed] = 1;
|
||||
* drawbridgeState[Blocks.gold_block] = 1;
|
||||
* drawbridgeState[Blocks.iron_block] = 1;
|
||||
* drawbridgeState[Blocks.brick_block] = 1; drawbridgeState[Blocks.tnt]
|
||||
* = 1; drawbridgeState[Blocks.bookshelf] = 1;
|
||||
* drawbridgeState[Blocks.mossy_cobblestone] = 1;
|
||||
* drawbridgeState[Blocks.obsidian] = 1;
|
||||
* drawbridgeState[Blocks.torchWood] = 1; drawbridgeState[Blocks.fire] =
|
||||
* 1; drawbridgeState[Blocks.mobSpawner] = 2;
|
||||
* drawbridgeState[Blocks.stairsWoodOak] = 3;
|
||||
* drawbridgeState[Blocks.chest] = 5;
|
||||
* drawbridgeState[Blocks.redstoneWire] = 1;
|
||||
* blockToItemMapping[Blocks.redstoneWire] = Items.redstone;
|
||||
* blockToItemMapping[Items.redstone] = Blocks.redstoneWire;
|
||||
* drawbridgeState[Blocks.diamond_ore] = 1;
|
||||
* drawbridgeState[Blocks.diamond_block] = 1;
|
||||
* drawbridgeState[Blocks.crafting_table] = 1;
|
||||
* drawbridgeState[Blocks.crops] = 2;
|
||||
* drawbridgeState[Blocks.tilledField] = 1;
|
||||
* drawbridgeState[Blocks.furnaceIdle] = 3;
|
||||
* drawbridgeState[Blocks.furnaceBurning] = 3;
|
||||
* interchangableBlockMapping[Blocks.furnaceIdle] =
|
||||
* Blocks.furnaceBurning;
|
||||
* interchangableBlockMapping[Blocks.furnaceBurning] =
|
||||
* Blocks.furnaceIdle; drawbridgeState[Blocks.tilledField] = 1;
|
||||
* drawbridgeState[Blocks.signPost] = 3;
|
||||
* drawbridgeState[Blocks.doorWood] = 2; drawbridgeState[Blocks.ladder]
|
||||
* = 1; drawbridgeState[Blocks.rail] = 4;
|
||||
* drawbridgeState[Blocks.stairsCobblestone] = 3;
|
||||
* drawbridgeState[Blocks.signWall] = 3; drawbridgeState[Blocks.lever] =
|
||||
* 3; drawbridgeState[Blocks.pressurePlateStone] = 1;
|
||||
* drawbridgeState[Blocks.doorIron] = 2;
|
||||
* drawbridgeState[Blocks.pressurePlatePlanks] = 1;
|
||||
* drawbridgeState[Blocks.oreRedstone] = 1;
|
||||
* drawbridgeState[Blocks.oreRedstoneGlowing] = 1;
|
||||
* drawbridgeState[Blocks.torchRedstoneIdle] = 1;
|
||||
* drawbridgeState[Blocks.torchRedstoneActive] = 1;
|
||||
* drawbridgeState[Blocks.stoneButton] = 3; drawbridgeState[Blocks.snow]
|
||||
* = 1; drawbridgeState[Blocks.ice] = 1;
|
||||
* drawbridgeState[Blocks.blockSnow] = 1; drawbridgeState[Blocks.cactus]
|
||||
* = 2; drawbridgeState[Blocks.blockClay] = 1;
|
||||
* drawbridgeState[Blocks.reed] = 1; drawbridgeState[Blocks.jukebox] =
|
||||
* 1; drawbridgeState[Blocks.fence] = 1; drawbridgeState[Blocks.pumpkin]
|
||||
* = 1; drawbridgeState[Blocks.netherrack] = 1;
|
||||
* drawbridgeState[Blocks.slowSand] = 1;
|
||||
* drawbridgeState[Blocks.glowStone] = 1; drawbridgeState[Blocks.portal]
|
||||
* = 2; drawbridgeState[Blocks.pumpkinLantern] = 1;
|
||||
* drawbridgeState[Blocks.cake] = 2;
|
||||
* drawbridgeState[Blocks.redstoneRepeaterIdle] = 3;
|
||||
* drawbridgeState[Blocks.redstoneRepeaterActive] = 3;
|
||||
* interchangableBlockMapping[Blocks.redstoneRepeaterIdle] =
|
||||
* Blocks.redstoneRepeaterActive;
|
||||
* interchangableBlockMapping[Blocks.redstoneRepeaterActive] =
|
||||
* Blocks.redstoneRepeaterIdle;
|
||||
* blockToItemMapping[Blocks.redstoneRepeaterIdle] =
|
||||
* Items.redstoneRepeater.itemID;
|
||||
* blockToItemMapping[Blocks.redstoneRepeaterActive] =
|
||||
* Items.redstoneRepeater.itemID;
|
||||
* blockToItemMapping[Items.redstoneRepeater] =
|
||||
* Blocks.redstoneRepeaterIdle; drawbridgeState[Blocks.lockedChest] = 5;
|
||||
* drawbridgeState[Blocks.trapdoor] = 3;
|
||||
* drawbridgeState[Blocks.mushroomCapBrown] = 1;
|
||||
* drawbridgeState[Blocks.mushroomCapRed] = 1;
|
||||
* drawbridgeState[Blocks.fenceIron] = 1;
|
||||
* drawbridgeState[Blocks.thinGlass] = 1; drawbridgeState[Blocks.melon]
|
||||
* = 1; drawbridgeState[Blocks.pumpkinStem] = 2;
|
||||
* drawbridgeState[Blocks.melonStem] = 2; drawbridgeState[Blocks.vine] =
|
||||
* 3; drawbridgeState[Blocks.fenceGate] = 3;
|
||||
* drawbridgeState[Blocks.stairsBrick] = 3;
|
||||
* drawbridgeState[Blocks.stairsStoneBrick] = 3;
|
||||
* drawbridgeState[Blocks.mycelium] = 1;
|
||||
* drawbridgeState[Blocks.waterlily] = 1;
|
||||
* drawbridgeState[Blocks.netherBrick] = 1;
|
||||
* drawbridgeState[Blocks.netherFence] = 1;
|
||||
* drawbridgeState[Blocks.netherFence] = 3;
|
||||
* drawbridgeState[Blocks.netherStalk] = 2;
|
||||
* drawbridgeState[Blocks.enchantmentTable] = 1;
|
||||
* drawbridgeState[Blocks.brewingStand] = 1;
|
||||
* drawbridgeState[Blocks.cauldron] = 1;
|
||||
* drawbridgeState[Blocks.endPortal] = 2;
|
||||
* drawbridgeState[Blocks.dragonEgg] = 1;
|
||||
* drawbridgeState[Blocks.redstoneLampIdle] = 1;
|
||||
* drawbridgeState[Blocks.redstoneLampActive] = 1;
|
||||
* drawbridgeState[Blocks.cocoaPlant] = 2;
|
||||
* drawbridgeState[Blocks.stairsSandStone] = 3;
|
||||
* drawbridgeState[Blocks.oreEmerald] = 1;
|
||||
* drawbridgeState[Blocks.enderChest] = 5;
|
||||
* drawbridgeState[Blocks.tripWireSource] = 1;
|
||||
* drawbridgeState[Blocks.tripWire] = 1;
|
||||
* drawbridgeState[Blocks.blockEmerald] = 1;
|
||||
* drawbridgeState[Blocks.stairsWoodSpruce] = 3;
|
||||
* drawbridgeState[Blocks.stairsWoodBirch] = 3;
|
||||
* drawbridgeState[Blocks.stairsWoodJungle] = 3;
|
||||
* drawbridgeState[Blocks.commandBlock] = 1;
|
||||
* drawbridgeState[Blocks.beacon] = 1;
|
||||
* drawbridgeState[Blocks.cobblestoneWall] = 1;
|
||||
* drawbridgeState[Blocks.flowerPot] = 1; drawbridgeState[Blocks.carrot]
|
||||
* = 2; drawbridgeState[Blocks.potato] = 1;
|
||||
* drawbridgeState[Blocks.woodenButton] = 3;
|
||||
* drawbridgeState[Blocks.skull] = 2;
|
||||
* drawbridgeState[Blocks.chestTrapped] = 5;
|
||||
* drawbridgeState[Blocks.pressurePlateGold] = 1;
|
||||
* drawbridgeState[Blocks.pressurePlateIron] = 1;
|
||||
* drawbridgeState[Blocks.redstoneComparatorIdle] = 1;
|
||||
* drawbridgeState[Blocks.redstoneComparatorActive] = 1;
|
||||
* interchangableBlockMapping[Blocks.redstoneComparatorIdle] =
|
||||
* Blocks.redstoneComparatorActive;
|
||||
* interchangableBlockMapping[Blocks.redstoneComparatorActive] =
|
||||
* Blocks.redstoneComparatorIdle;
|
||||
* blockToItemMapping[Blocks.redstoneComparatorIdle] =
|
||||
* Items.comparator.itemID;
|
||||
* blockToItemMapping[Blocks.redstoneComparatorActive] =
|
||||
* Items.comparator.itemID; blockToItemMapping[Items.comparator] =
|
||||
* Blocks.redstoneComparatorIdle; drawbridgeState[Blocks.daylightSensor]
|
||||
* = 1; drawbridgeState[Blocks.blockRedstone] = 1;
|
||||
* drawbridgeState[Blocks.oreNetherQuartz] = 1;
|
||||
* drawbridgeState[Blocks.hopperBlock] = 3;
|
||||
* drawbridgeState[Blocks.blockNetherQuartz] = 1;
|
||||
* drawbridgeState[Blocks.stairsNetherQuartz] = 3;
|
||||
* drawbridgeState[Blocks.railActivator] = 4;
|
||||
* drawbridgeState[Blocks.dropper] = 3;
|
||||
* interchangableBlockMapping[Blocks.dirt] = Blocks.grass;
|
||||
* interchangableBlockMapping[Blocks.grass] = Blocks.dirt;
|
||||
*/
|
||||
}
|
||||
|
||||
static
|
||||
@@ -682,24 +721,10 @@ public class TConstructRegistry
|
||||
initializeDrawbridgeState();
|
||||
}
|
||||
|
||||
/** Default Material Index
|
||||
* 0: Wood
|
||||
* 1: Stone
|
||||
* 2: Iron
|
||||
* 3: Flint
|
||||
* 4: Cactus
|
||||
* 5: Bone
|
||||
* 6: Obsidian
|
||||
* 7: Netherrack
|
||||
* 8: Green Slime
|
||||
* 9: Paper
|
||||
* 10: Cobalt
|
||||
* 11: Ardite
|
||||
* 12: Manyullyn
|
||||
* 13: Copper
|
||||
* 14: Bronze
|
||||
* 15: Alumite
|
||||
* 16: Steel
|
||||
* 17: Blue Slime
|
||||
/**
|
||||
* Default Material Index 0: Wood 1: Stone 2: Iron 3: Flint 4: Cactus 5:
|
||||
* Bone 6: Obsidian 7: Netherrack 8: Green Slime 9: Paper 10: Cobalt 11:
|
||||
* Ardite 12: Manyullyn 13: Copper 14: Bronze 15: Alumite 16: Steel 17: Blue
|
||||
* Slime
|
||||
*/
|
||||
}
|
||||
@@ -15,8 +15,7 @@ import net.minecraftforge.common.ISpecialArmor;
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
|
||||
/**
|
||||
* NBTTags
|
||||
* Main tag - InfiArmor
|
||||
* NBTTags Main tag - InfiArmor
|
||||
*/
|
||||
public abstract class ArmorCore extends ItemArmor implements IEnergyContainerItem, ISpecialArmor
|
||||
{
|
||||
@@ -26,7 +25,7 @@ public abstract class ArmorCore extends ItemArmor implements IEnergyContainerIte
|
||||
private static final IBehaviorDispenseItem dispenserBehavior = new BehaviorDispenseArmorCopy();
|
||||
public final int baseProtection;
|
||||
|
||||
//TE power constants -- TODO grab these from the items added
|
||||
// TE power constants -- TODO grab these from the items added
|
||||
protected int capacity = 400000;
|
||||
protected int maxReceive = 75;
|
||||
protected int maxExtract = 75;
|
||||
@@ -54,14 +53,24 @@ public abstract class ArmorCore extends ItemArmor implements IEnergyContainerIte
|
||||
|
||||
if (itemstack1 == null)
|
||||
{
|
||||
par3EntityPlayer.setCurrentItemOrArmor(i + 1, par1ItemStack.copy()); //Forge: Vanilla bug fix associated with fixed setCurrentItemOrArmor indexs for players.
|
||||
par3EntityPlayer.setCurrentItemOrArmor(i + 1, par1ItemStack.copy()); // Forge:
|
||||
// Vanilla
|
||||
// bug
|
||||
// fix
|
||||
// associated
|
||||
// with
|
||||
// fixed
|
||||
// setCurrentItemOrArmor
|
||||
// indexs
|
||||
// for
|
||||
// players.
|
||||
par1ItemStack.stackSize = 0;
|
||||
}
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
//ISpecialArmor overrides
|
||||
// ISpecialArmor overrides
|
||||
@Override
|
||||
public ArmorProperties getProperties (EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot)
|
||||
{
|
||||
@@ -146,7 +155,7 @@ public abstract class ArmorCore extends ItemArmor implements IEnergyContainerIte
|
||||
}
|
||||
}
|
||||
|
||||
//TE support section -- from COFH core API reference section
|
||||
// TE support section -- from COFH core API reference section
|
||||
public void setMaxTransfer (int maxTransfer)
|
||||
{
|
||||
setMaxReceive(maxTransfer);
|
||||
@@ -222,7 +231,7 @@ public abstract class ArmorCore extends ItemArmor implements IEnergyContainerIte
|
||||
return capacity;
|
||||
}
|
||||
|
||||
//end of TE support section
|
||||
// end of TE support section
|
||||
|
||||
// Vanilla overrides
|
||||
public boolean isItemTool (ItemStack par1ItemStack)
|
||||
|
||||
@@ -46,7 +46,8 @@ public abstract class ArmorMod extends ToolMod
|
||||
tag.setString("AttributeName", attributeType);
|
||||
tag.setString("Name", modifierName);
|
||||
tag.setDouble("Amount", amount);
|
||||
tag.setInteger("Operation", flat ? 0 : 1);//0 = flat increase, 1 = % increase
|
||||
tag.setInteger("Operation", flat ? 0 : 1);// 0 = flat increase, 1 = %
|
||||
// increase
|
||||
tag.setLong("UUIDMost", uuid.getMostSignificantBits());
|
||||
tag.setLong("UUIDLeast", uuid.getLeastSignificantBits());
|
||||
return tag;
|
||||
|
||||
@@ -21,11 +21,14 @@ public abstract class ArmorModTypeFilter extends ArmorMod
|
||||
}
|
||||
}
|
||||
|
||||
/** Checks to see if the inputs match the stored items
|
||||
* Note: Filters types, doesn't care about amount
|
||||
/**
|
||||
* Checks to see if the inputs match the stored items Note: Filters types,
|
||||
* doesn't care about amount
|
||||
*
|
||||
* @param input The ItemStacks to compare against
|
||||
* @param tool Item to modify, used for restrictions
|
||||
* @param input
|
||||
* The ItemStacks to compare against
|
||||
* @param tool
|
||||
* Item to modify, used for restrictions
|
||||
* @return Whether the recipe matches the input
|
||||
*/
|
||||
@Override
|
||||
@@ -102,10 +105,13 @@ public abstract class ArmorModTypeFilter extends ArmorMod
|
||||
return amount;
|
||||
}
|
||||
|
||||
/** Adds a new itemstack to the list for increases
|
||||
/**
|
||||
* Adds a new itemstack to the list for increases
|
||||
*
|
||||
* @param stack ItemStack to compare against
|
||||
* @param amount Amount to increase
|
||||
* @param stack
|
||||
* ItemStack to compare against
|
||||
* @param amount
|
||||
* Amount to increase
|
||||
*/
|
||||
public void addStackToMatchList (ItemStack stack, int amount)
|
||||
{
|
||||
|
||||
@@ -16,7 +16,8 @@ import net.minecraft.util.EnumFacing;
|
||||
final class BehaviorDispenseArmorCopy extends BehaviorDefaultDispenseItem
|
||||
{
|
||||
/**
|
||||
* Dispense the specified stack, play the dispense sound and spawn particles.
|
||||
* Dispense the specified stack, play the dispense sound and spawn
|
||||
* particles.
|
||||
*/
|
||||
protected ItemStack dispenseStack (IBlockSource par1IBlockSource, ItemStack par2ItemStack)
|
||||
{
|
||||
@@ -34,7 +35,17 @@ final class BehaviorDispenseArmorCopy extends BehaviorDefaultDispenseItem
|
||||
int i1 = EntityLiving.getArmorPosition(par2ItemStack);
|
||||
ItemStack itemstack1 = par2ItemStack.copy();
|
||||
itemstack1.stackSize = 1;
|
||||
entitylivingbase.setCurrentItemOrArmor(i1, itemstack1); //BUGFIX Forge: Vanilla bug fix associated with fixed setCurrentItemOrArmor indexs for players.
|
||||
entitylivingbase.setCurrentItemOrArmor(i1, itemstack1); // BUGFIX
|
||||
// Forge:
|
||||
// Vanilla
|
||||
// bug fix
|
||||
// associated
|
||||
// with
|
||||
// fixed
|
||||
// setCurrentItemOrArmor
|
||||
// indexs
|
||||
// for
|
||||
// players.
|
||||
|
||||
if (entitylivingbase instanceof EntityLiving)
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@ package tconstruct.library.client;
|
||||
public class FluidRenderProperties
|
||||
{
|
||||
|
||||
//Constant defaults
|
||||
// Constant defaults
|
||||
public static final FluidRenderProperties DEFAULT_TABLE = new FluidRenderProperties(Applications.TABLE);
|
||||
public static final FluidRenderProperties DEFAULT_BASIN = new FluidRenderProperties(Applications.BASIN);
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ public class TConstructClientRegistry
|
||||
recipeIcons.put(name, recipe);
|
||||
}
|
||||
|
||||
//Gui
|
||||
// Gui
|
||||
public static void addToolButton (ToolGuiElement element)
|
||||
{
|
||||
toolButtons.add(element);
|
||||
|
||||
@@ -11,7 +11,6 @@ import mantle.blocks.iface.IServantLogic;
|
||||
import mantle.world.CoordTuple;
|
||||
import mantle.world.CoordTupleSort;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagIntArray;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
@@ -39,7 +38,14 @@ public class TankLayerScan extends LogicComponent
|
||||
protected CoordTuple returnStone;
|
||||
|
||||
private static boolean debug = System.getenv("DBG_MANTLE_TankLayerScan") != null;
|
||||
private static int MAX_LAYER_RECURSION_DEPTH = System.getProperty("os.arch").equals("amd64") ? 4000 : 2000; // Recursion causes overflows on 32-bit, so reduce if not 64-bit
|
||||
private static int MAX_LAYER_RECURSION_DEPTH = System.getProperty("os.arch").equals("amd64") ? 4000 : 2000; // Recursion
|
||||
// causes
|
||||
// overflows
|
||||
// on
|
||||
// 32-bit,
|
||||
// so reduce
|
||||
// if not
|
||||
// 64-bit
|
||||
|
||||
public TankLayerScan(TileEntity te, Block... ids)
|
||||
{
|
||||
@@ -66,7 +72,7 @@ public class TankLayerScan extends LogicComponent
|
||||
blockCoords.clear();
|
||||
airCoords.clear();
|
||||
boolean validAir = false;
|
||||
//Check for air space in front of and behind the structure
|
||||
// Check for air space in front of and behind the structure
|
||||
byte dir = getDirection();
|
||||
switch (getDirection())
|
||||
{
|
||||
@@ -82,7 +88,7 @@ public class TankLayerScan extends LogicComponent
|
||||
break;
|
||||
}
|
||||
|
||||
//Recurse the structure
|
||||
// Recurse the structure
|
||||
boolean validBlocks = false;
|
||||
|
||||
int xPos = 0, zPos = 0;
|
||||
@@ -120,7 +126,7 @@ public class TankLayerScan extends LogicComponent
|
||||
blockCoords.clear();
|
||||
bricks = 0;
|
||||
|
||||
//Does the actual adding of blocks in the ring
|
||||
// Does the actual adding of blocks in the ring
|
||||
boolean sealed = floodTest(master.xCoord + xPos, master.yCoord, master.zCoord + zPos);
|
||||
if (!world.isRemote && debug)
|
||||
{
|
||||
@@ -130,7 +136,7 @@ public class TankLayerScan extends LogicComponent
|
||||
|
||||
if (sealed)
|
||||
{
|
||||
blockCoords.add(new CoordTuple(master.xCoord, master.yCoord, master.zCoord)); //Don't forget me!
|
||||
blockCoords.add(new CoordTuple(master.xCoord, master.yCoord, master.zCoord)); // Don't forget me!
|
||||
layerAirCoords = new HashSet<CoordTuple>(airCoords);
|
||||
layerBlockCoords = new HashSet<CoordTuple>(blockCoords);
|
||||
|
||||
@@ -151,7 +157,7 @@ public class TankLayerScan extends LogicComponent
|
||||
}
|
||||
}
|
||||
|
||||
//@SuppressWarnings({ "unchecked" })
|
||||
// @SuppressWarnings({ "unchecked" })
|
||||
protected void finalizeStructure ()
|
||||
{
|
||||
Collections.sort(blockCoords, new CoordTupleSort());
|
||||
@@ -198,7 +204,8 @@ public class TankLayerScan extends LogicComponent
|
||||
protected boolean checkAir (int x, int y, int z)
|
||||
{
|
||||
Block block = world.getBlock(x, y, z);
|
||||
if (block == null || block == Blocks.air)// || block == TContent.tankAir)
|
||||
if (block == null || world.isAirBlock(x, y, z))// || block ==
|
||||
// TContent.tankAir)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -207,7 +214,7 @@ public class TankLayerScan extends LogicComponent
|
||||
protected boolean checkServant (int x, int y, int z)
|
||||
{
|
||||
Block block = world.getBlock(x, y, z);
|
||||
if (block == null || block == Blocks.air || !isValidBlock(x, y, z))
|
||||
if (block == null || world.isAirBlock(x, y, z) || !isValidBlock(x, y, z))
|
||||
return false;
|
||||
|
||||
if (!block.hasTileEntity(world.getBlockMetadata(x, y, z)))
|
||||
@@ -297,9 +304,9 @@ public class TankLayerScan extends LogicComponent
|
||||
if (checkAir(coord.x, y, coord.z))
|
||||
{
|
||||
boolean valid = true;
|
||||
addAirBlock(coord.x, y, coord.z); //Don't skip first one
|
||||
addAirBlock(coord.x, y, coord.z); // Don't skip first one
|
||||
|
||||
//Air blocks
|
||||
// Air blocks
|
||||
while (i.hasNext())
|
||||
{
|
||||
coord = (CoordTuple) i.next();
|
||||
@@ -314,7 +321,7 @@ public class TankLayerScan extends LogicComponent
|
||||
}
|
||||
}
|
||||
|
||||
//Bricks
|
||||
// Bricks
|
||||
i = layerBlockCoords.iterator();
|
||||
while (i.hasNext())
|
||||
{
|
||||
@@ -334,7 +341,7 @@ public class TankLayerScan extends LogicComponent
|
||||
}
|
||||
else if (checkServant(coord.x, y, coord.z))
|
||||
{
|
||||
//Bottom floor. All blocks, please vacate the elevator
|
||||
// Bottom floor. All blocks, please vacate the elevator
|
||||
boolean valid = true;
|
||||
while (i.hasNext())
|
||||
{
|
||||
@@ -367,7 +374,7 @@ public class TankLayerScan extends LogicComponent
|
||||
{
|
||||
boolean valid = true;
|
||||
|
||||
//Bricks
|
||||
// Bricks
|
||||
while (i.hasNext())
|
||||
{
|
||||
coord = (CoordTuple) i.next();
|
||||
@@ -381,7 +388,7 @@ public class TankLayerScan extends LogicComponent
|
||||
}
|
||||
}
|
||||
|
||||
//Air blocks
|
||||
// Air blocks
|
||||
if (valid)
|
||||
{
|
||||
i = layerAirCoords.iterator();
|
||||
@@ -446,7 +453,7 @@ public class TankLayerScan extends LogicComponent
|
||||
}
|
||||
else
|
||||
{
|
||||
if (structureTop == 0) //Workaround for missing data
|
||||
if (structureTop == 0) // Workaround for missing data
|
||||
{
|
||||
for (CoordTuple coord : blockCoords)
|
||||
structureTop = coord.y;
|
||||
@@ -481,7 +488,10 @@ public class TankLayerScan extends LogicComponent
|
||||
}
|
||||
}
|
||||
|
||||
/** Do any necessary cleanup here. Remove air blocks, invalidate servants, etc */
|
||||
/**
|
||||
* Do any necessary cleanup here. Remove air blocks, invalidate servants,
|
||||
* etc
|
||||
*/
|
||||
public void cleanup ()
|
||||
{
|
||||
Iterator i = blockCoords.iterator();
|
||||
@@ -575,4 +585,4 @@ public class TankLayerScan extends LogicComponent
|
||||
{
|
||||
tags.setBoolean("Complete", completeStructure);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,11 +17,10 @@ public class AlloyMix
|
||||
mixers = inputs;
|
||||
}
|
||||
|
||||
/*public boolean matches(List liquids)
|
||||
{
|
||||
ArrayList list = new ArrayList(mixers);
|
||||
return false;
|
||||
}*/
|
||||
/*
|
||||
* public boolean matches(List liquids) { ArrayList list = new
|
||||
* ArrayList(mixers); return false; }
|
||||
*/
|
||||
|
||||
public FluidStack mix (ArrayList<FluidStack> liquids)
|
||||
{
|
||||
@@ -35,23 +34,24 @@ public class AlloyMix
|
||||
while (iter.hasNext())
|
||||
{
|
||||
FluidStack mixer = (FluidStack) iter.next();
|
||||
//if (mixer.itemID == liquid.itemID && mixer.itemMeta == liquid.itemMeta)
|
||||
// if (mixer.itemID == liquid.itemID && mixer.itemMeta ==
|
||||
// liquid.itemMeta)
|
||||
if (mixer.isFluidEqual(liquid))
|
||||
{
|
||||
int eAmt = liquid.amount / mixer.amount;
|
||||
effectiveAmount.add(eAmt);
|
||||
copyMix.remove(mixer);
|
||||
//inputs.add(liquid);
|
||||
// inputs.add(liquid);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
//}
|
||||
// }
|
||||
|
||||
if (copyMix.size() > 0)
|
||||
return null;
|
||||
|
||||
//Remove old liquids
|
||||
// Remove old liquids
|
||||
int low = getLowestAmount(effectiveAmount);
|
||||
ArrayList<FluidStack> copyMix2 = new ArrayList(mixers);
|
||||
|
||||
@@ -62,7 +62,8 @@ public class AlloyMix
|
||||
while (iter.hasNext())
|
||||
{
|
||||
FluidStack mixer = (FluidStack) iter.next();
|
||||
//if (mixer.itemID == liquid.itemID && mixer.itemMeta == liquid.itemMeta)
|
||||
// if (mixer.itemID == liquid.itemID && mixer.itemMeta ==
|
||||
// liquid.itemMeta)
|
||||
if (mixer.isFluidEqual(liquid))
|
||||
{
|
||||
int eAmt = low * mixer.amount;
|
||||
@@ -85,7 +86,7 @@ public class AlloyMix
|
||||
|
||||
int getLowestAmount (ArrayList list)
|
||||
{
|
||||
int frist = (Integer) list.get(0); //FRIST!!!
|
||||
int frist = (Integer) list.get(0); // FRIST!!!
|
||||
for (int i = 1; i < list.size(); i++)
|
||||
{
|
||||
int compare = (Integer) list.get(i);
|
||||
|
||||
@@ -12,11 +12,11 @@ public enum FluidType
|
||||
Water(Blocks.snow, 0, 20, FluidRegistry.getFluid("water"), false),
|
||||
/** Iron Smelting **/
|
||||
Iron(Blocks.iron_block, 0, 600, TRepo.moltenIronFluid, true),
|
||||
/** Gold Smelting **/
|
||||
/** Gold Smelting **/
|
||||
Gold(Blocks.gold_block, 0, 400, TRepo.moltenGoldFluid, false),
|
||||
/** Tin Smelting **/
|
||||
/** Tin Smelting **/
|
||||
Tin(TRepo.metalBlock, 5, 400, TRepo.moltenTinFluid, false),
|
||||
/** Copper Smelting **/
|
||||
/** Copper Smelting **/
|
||||
Copper(TRepo.metalBlock, 3, 550, TRepo.moltenCopperFluid, true),
|
||||
/** Aluminum Smelting **/
|
||||
Aluminum(TRepo.metalBlock, 6, 350, TRepo.moltenAluminumFluid, false),
|
||||
|
||||
@@ -9,7 +9,7 @@ import tconstruct.library.client.FluidRenderProperties;
|
||||
/* Melting becomes hardened */
|
||||
public class LiquidCasting
|
||||
{
|
||||
//public static LiquidCasting instance = new LiquidCasting();
|
||||
// public static LiquidCasting instance = new LiquidCasting();
|
||||
private final ArrayList<CastingRecipe> casts = new ArrayList<CastingRecipe>();
|
||||
|
||||
private boolean contains (CastingRecipe recipe)
|
||||
@@ -22,14 +22,22 @@ public class LiquidCasting
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Adds a casting recipe
|
||||
/**
|
||||
* Adds a casting recipe
|
||||
*
|
||||
* @param output Result of the cast
|
||||
* @param metal Liquid to be used in casting. This also decides how much metal is consumed
|
||||
* @param cast The empty item to cast with. ex Ingot Cast
|
||||
* @param consume Whether the item should be consumed while casting
|
||||
* @param delay Time to cast in ticks
|
||||
* @param props The rendering properties for the casting fluid (may be null)
|
||||
* @param output
|
||||
* Result of the cast
|
||||
* @param metal
|
||||
* Liquid to be used in casting. This also decides how much metal
|
||||
* is consumed
|
||||
* @param cast
|
||||
* The empty item to cast with. ex Ingot Cast
|
||||
* @param consume
|
||||
* Whether the item should be consumed while casting
|
||||
* @param delay
|
||||
* Time to cast in ticks
|
||||
* @param props
|
||||
* The rendering properties for the casting fluid (may be null)
|
||||
*/
|
||||
public void addCastingRecipe (ItemStack output, FluidStack metal, ItemStack cast, boolean consume, int delay, FluidRenderProperties props)
|
||||
{
|
||||
@@ -38,61 +46,94 @@ public class LiquidCasting
|
||||
casts.add(cr);
|
||||
}
|
||||
|
||||
/** Adds a casting recipe
|
||||
/**
|
||||
* Adds a casting recipe
|
||||
*
|
||||
* @param output Result of the cast
|
||||
* @param metal Liquid to be used in casting. This also decides how much metal is consumed
|
||||
* @param cast The empty item to cast with. ex Ingot Cast
|
||||
* @param consume Whether the item should be consumed while casting
|
||||
* @param delay Time to cast in ticks
|
||||
* @param output
|
||||
* Result of the cast
|
||||
* @param metal
|
||||
* Liquid to be used in casting. This also decides how much metal
|
||||
* is consumed
|
||||
* @param cast
|
||||
* The empty item to cast with. ex Ingot Cast
|
||||
* @param consume
|
||||
* Whether the item should be consumed while casting
|
||||
* @param delay
|
||||
* Time to cast in ticks
|
||||
*/
|
||||
public void addCastingRecipe (ItemStack output, FluidStack metal, ItemStack cast, boolean consume, int delay)
|
||||
{
|
||||
addCastingRecipe(output, metal, cast, consume, delay, null);
|
||||
}
|
||||
|
||||
/** Adds a casting recipe. Does not consume the cast
|
||||
/**
|
||||
* Adds a casting recipe. Does not consume the cast
|
||||
*
|
||||
* @param output Result of the cast
|
||||
* @param metal Liquid to be used in casting. This also decides how much metal is consumed
|
||||
* @param cast The empty item to cast with. ex Ingot Cast
|
||||
* @param delay Time to cast in ticks
|
||||
* @param props The rendering properties for the casting fluid (may be null)
|
||||
* @param output
|
||||
* Result of the cast
|
||||
* @param metal
|
||||
* Liquid to be used in casting. This also decides how much metal
|
||||
* is consumed
|
||||
* @param cast
|
||||
* The empty item to cast with. ex Ingot Cast
|
||||
* @param delay
|
||||
* Time to cast in ticks
|
||||
* @param props
|
||||
* The rendering properties for the casting fluid (may be null)
|
||||
*/
|
||||
public void addCastingRecipe (ItemStack output, FluidStack metal, ItemStack cast, int delay, FluidRenderProperties props)
|
||||
{
|
||||
addCastingRecipe(output, metal, cast, false, delay, props);
|
||||
}
|
||||
|
||||
/** Adds a casting recipe. Does not consume the cast
|
||||
/**
|
||||
* Adds a casting recipe. Does not consume the cast
|
||||
*
|
||||
* @param output Result of the cast
|
||||
* @param metal Liquid to be used in casting. This also decides how much metal is consumed
|
||||
* @param cast The empty item to cast with. ex Ingot Cast
|
||||
* @param delay Time to cast in ticks
|
||||
* @param output
|
||||
* Result of the cast
|
||||
* @param metal
|
||||
* Liquid to be used in casting. This also decides how much metal
|
||||
* is consumed
|
||||
* @param cast
|
||||
* The empty item to cast with. ex Ingot Cast
|
||||
* @param delay
|
||||
* Time to cast in ticks
|
||||
*/
|
||||
public void addCastingRecipe (ItemStack output, FluidStack metal, ItemStack cast, int delay)
|
||||
{
|
||||
addCastingRecipe(output, metal, cast, false, delay, null);
|
||||
}
|
||||
|
||||
/** Adds a casting recipe. Does not consume the cast or have an item to cast against
|
||||
/**
|
||||
* Adds a casting recipe. Does not consume the cast or have an item to cast
|
||||
* against
|
||||
*
|
||||
* @param output Result of the cast
|
||||
* @param metal Liquid to be used in casting. This also decides how much metal is consumed
|
||||
* @param delay Time to cast in ticks
|
||||
* @param props The rendering properties for the casting fluid (may be null)
|
||||
* @param output
|
||||
* Result of the cast
|
||||
* @param metal
|
||||
* Liquid to be used in casting. This also decides how much metal
|
||||
* is consumed
|
||||
* @param delay
|
||||
* Time to cast in ticks
|
||||
* @param props
|
||||
* The rendering properties for the casting fluid (may be null)
|
||||
*/
|
||||
public void addCastingRecipe (ItemStack output, FluidStack metal, int delay, FluidRenderProperties props)
|
||||
{
|
||||
addCastingRecipe(output, metal, null, false, delay, props);
|
||||
}
|
||||
|
||||
/** Adds a casting recipe. Does not consume the cast or have an item to cast against
|
||||
/**
|
||||
* Adds a casting recipe. Does not consume the cast or have an item to cast
|
||||
* against
|
||||
*
|
||||
* @param output Result of the cast
|
||||
* @param metal Liquid to be used in casting. This also decides how much metal is consumed
|
||||
* @param delay Time to cast in ticks
|
||||
* @param output
|
||||
* Result of the cast
|
||||
* @param metal
|
||||
* Liquid to be used in casting. This also decides how much metal
|
||||
* is consumed
|
||||
* @param delay
|
||||
* Time to cast in ticks
|
||||
*/
|
||||
public void addCastingRecipe (ItemStack output, FluidStack metal, int delay)
|
||||
{
|
||||
@@ -130,7 +171,7 @@ public class LiquidCasting
|
||||
return null;
|
||||
}
|
||||
|
||||
//Getter for public viewing
|
||||
// Getter for public viewing
|
||||
public ArrayList<CastingRecipe> getCastingRecipes ()
|
||||
{
|
||||
return casts;
|
||||
|
||||
@@ -18,11 +18,11 @@ import cpw.mods.fml.common.eventhandler.Event.Result;
|
||||
public class PatternBuilder
|
||||
{
|
||||
public static PatternBuilder instance = new PatternBuilder();
|
||||
//Map items to their parts with a hashmap
|
||||
// Map items to their parts with a hashmap
|
||||
public List<ItemKey> materials = new ArrayList<ItemKey>();
|
||||
public HashMap materialSets = new HashMap<String, MaterialSet>();
|
||||
|
||||
//We could use IRecipe if it wasn't tied to InventoryCrafting
|
||||
// We could use IRecipe if it wasn't tied to InventoryCrafting
|
||||
public List<IPattern> toolPatterns = new ArrayList<IPattern>();
|
||||
|
||||
/* Register methods */
|
||||
@@ -80,36 +80,36 @@ public class PatternBuilder
|
||||
if (totalMaterial < patternValue) // Not enough material
|
||||
return null;
|
||||
|
||||
else if (patternValue == key.value) //Material only
|
||||
else if (patternValue == key.value) // Material only
|
||||
return new ItemStack[] { toolPart, null };
|
||||
|
||||
else
|
||||
{
|
||||
if (patternValue % 2 == 1)
|
||||
{
|
||||
return new ItemStack[] { toolPart, mat.shard.copy() }; //Material + shard
|
||||
return new ItemStack[] { toolPart, mat.shard.copy() }; // Material
|
||||
// +
|
||||
// shard
|
||||
}
|
||||
else
|
||||
return new ItemStack[] { toolPart, null };
|
||||
}
|
||||
/*if ( patternValue < totalMaterial )
|
||||
{
|
||||
if (otherPattern != null)
|
||||
{
|
||||
int otherValue = ((IPattern)otherPattern.getItem()).getPatternCost(otherPattern.getItemDamage());
|
||||
if (patternValue + otherValue <= key.value)
|
||||
{
|
||||
ItemStack otherPart = getMatchingPattern(otherPattern, mat);
|
||||
return new ItemStack[] { toolPart, otherPart }; //Material + Material
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else if ( patternValue == key.value )
|
||||
return new ItemStack[] { new ItemStack(toolPart, 1, mat.materialID), null }; //Material only
|
||||
|
||||
else
|
||||
return null; //Not a valid match*/
|
||||
/*
|
||||
* if ( patternValue < totalMaterial ) { if (otherPattern !=
|
||||
* null) { int otherValue =
|
||||
* ((IPattern)otherPattern.getItem()
|
||||
* ).getPatternCost(otherPattern.getItemDamage()); if
|
||||
* (patternValue + otherValue <= key.value) { ItemStack
|
||||
* otherPart = getMatchingPattern(otherPattern, mat); return
|
||||
* new ItemStack[] { toolPart, otherPart }; //Material +
|
||||
* Material } } }
|
||||
*
|
||||
* else if ( patternValue == key.value ) return new
|
||||
* ItemStack[] { new ItemStack(toolPart, 1, mat.materialID),
|
||||
* null }; //Material only
|
||||
*
|
||||
* else return null; //Not a valid match
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -186,7 +186,8 @@ public class PatternBuilder
|
||||
return null;
|
||||
}
|
||||
|
||||
//Small data classes. I would prefer the struct from C#, but we do what we can.
|
||||
// Small data classes. I would prefer the struct from C#, but we do what we
|
||||
// can.
|
||||
public class ItemKey
|
||||
{
|
||||
public final Item item;
|
||||
@@ -217,7 +218,7 @@ public class PatternBuilder
|
||||
}
|
||||
}
|
||||
|
||||
//Helper Methods
|
||||
// Helper Methods
|
||||
public void registerMaterial (Block material, int value, String key)
|
||||
{
|
||||
registerMaterial(new ItemStack(material, 1, Short.MAX_VALUE), value, key);
|
||||
@@ -238,13 +239,17 @@ public class PatternBuilder
|
||||
registerFullMaterial(new ItemStack(material, 1, Short.MAX_VALUE), value, key, shard, rod, materialID);
|
||||
}
|
||||
|
||||
/*public void registerFullMaterial (Block material, int value, String key, int materialID)
|
||||
{
|
||||
registerFullMaterial(new ItemStack(material, 1, Short.MAX_VALUE), value, key, new ItemStack(TContent.toolShard, 1, materialID), new ItemStack(TContent.toolRod, 1, materialID), materialID);
|
||||
}
|
||||
|
||||
public void registerFullMaterial (Item material, int value, String key, int materialID)
|
||||
{
|
||||
registerFullMaterial(new ItemStack(material, 1, Short.MAX_VALUE), value, key, new ItemStack(TContent.toolShard, 1, materialID), new ItemStack(TContent.toolRod, 1, materialID), materialID);
|
||||
}*/
|
||||
/*
|
||||
* public void registerFullMaterial (Block material, int value, String key,
|
||||
* int materialID) { registerFullMaterial(new ItemStack(material, 1,
|
||||
* Short.MAX_VALUE), value, key, new ItemStack(TContent.toolShard, 1,
|
||||
* materialID), new ItemStack(TContent.toolRod, 1, materialID), materialID);
|
||||
* }
|
||||
*
|
||||
* public void registerFullMaterial (Item material, int value, String key,
|
||||
* int materialID) { registerFullMaterial(new ItemStack(material, 1,
|
||||
* Short.MAX_VALUE), value, key, new ItemStack(TContent.toolShard, 1,
|
||||
* materialID), new ItemStack(TContent.toolRod, 1, materialID), materialID);
|
||||
* }
|
||||
*/
|
||||
}
|
||||
@@ -39,7 +39,7 @@ public class ShapelessToolRecipe extends ShapelessRecipes
|
||||
{
|
||||
ItemStack itemstack1 = (ItemStack) iterator.next();
|
||||
|
||||
//TConstruct.logger.info("Rawr! "+itemstack1.getItemDamage());
|
||||
// TConstruct.logger.info("Rawr! "+itemstack1.getItemDamage());
|
||||
if (itemstack == itemstack1 && (itemstack1.getItemDamage() == Short.MAX_VALUE || itemstack.getItemDamage() == itemstack1.getItemDamage()))
|
||||
{
|
||||
if (itemstack.getItem() instanceof ToolCore)
|
||||
|
||||
@@ -6,7 +6,6 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
@@ -16,72 +15,84 @@ public class Smeltery
|
||||
{
|
||||
public static Smeltery instance = new Smeltery();
|
||||
|
||||
private final HashMap<List<ItemStack>, FluidStack> smeltingList = new HashMap<List<ItemStack>, FluidStack>();
|
||||
private final HashMap<List<ItemStack>, Integer> temperatureList = new HashMap<List<ItemStack>, Integer>();
|
||||
private final HashMap<List<ItemStack>, ItemStack> renderIndex = new HashMap<List<ItemStack>, ItemStack>();
|
||||
private final HashMap<List<Integer>, FluidStack> smeltingList = new HashMap<List<Integer>, FluidStack>();
|
||||
private final HashMap<List<Integer>, Integer> temperatureList = new HashMap<List<Integer>, Integer>();
|
||||
private final HashMap<List<Integer>, ItemStack> renderIndex = new HashMap<List<Integer>, ItemStack>();
|
||||
private final ArrayList<AlloyMix> alloys = new ArrayList<AlloyMix>();
|
||||
|
||||
/** Adds mappings between an itemstack and an output liquid
|
||||
* Example: Smeltery.addMelting(Block.oreIron, 0, 600, new FluidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 0));
|
||||
/**
|
||||
* Adds mappings between an itemstack and an output liquid Example:
|
||||
* Smeltery.addMelting(Block.oreIron, 0, 600, new
|
||||
* FluidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 0));
|
||||
*
|
||||
* @param stack The itemstack to liquify
|
||||
* @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
|
||||
* @param stack
|
||||
* The itemstack to liquify
|
||||
* @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 addMelting (ItemStack stack, int temperature, FluidStack output)
|
||||
public static void addMelting0 (ItemStack stack, int temperature, FluidStack output)
|
||||
{
|
||||
addMelting(stack, stack.getItem(), stack.getItemDamage(), temperature, output);
|
||||
// addMelting(stack, stack, stack.getItemDamage(), temperature, output);
|
||||
}
|
||||
|
||||
/** Adds mappings between a block and its liquid
|
||||
* Example: Smeltery.addMelting(Block.oreIron, 0, 600, new FluidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 0));
|
||||
/**
|
||||
* Adds mappings between a block and its liquid Example:
|
||||
* Smeltery.addMelting(Block.oreIron, 0, 600, new
|
||||
* FluidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 0));
|
||||
*
|
||||
* @param blockID The ID of the block to liquify and render
|
||||
* @param metadata The metadata of the block to liquify and render
|
||||
* @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 addMelting (Item item, int metadata, int temperature, FluidStack output)
|
||||
{
|
||||
addMelting(new ItemStack(item, 1, metadata), item, metadata, temperature, output);
|
||||
}
|
||||
|
||||
/** Adds mappings between a block and its liquid
|
||||
* Example: Smeltery.addMelting(Block.oreIron, 0, 600, new FluidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 0));
|
||||
*
|
||||
* @param blockID The ID of the block to liquify and render
|
||||
* @param metadata The metadata of the block to liquify and render
|
||||
* @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
|
||||
* @param blockID
|
||||
* The ID of the block to liquify and render
|
||||
* @param metadata
|
||||
* The metadata of the block to liquify and render
|
||||
* @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 addMelting (Block block, int metadata, int temperature, FluidStack output)
|
||||
{
|
||||
addMelting(new ItemStack(block, 1, metadata), new ItemStack(block).getItem(), metadata, temperature, output);
|
||||
addMelting(new ItemStack(block, 1, metadata), block, metadata, temperature, output);
|
||||
}
|
||||
|
||||
/** Adds mappings between an input and its liquid.
|
||||
* Renders with the given input's block ID and metadata
|
||||
* Example: Smeltery.addMelting(Block.oreIron, 0, 600, new FluidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 0));
|
||||
/**
|
||||
* Adds mappings between an input and its liquid. Renders with the given
|
||||
* input's block ID and metadata Example: Smeltery.addMelting(Block.oreIron,
|
||||
* 0, 600, new FluidStack(liquidMetalStill.blockID,
|
||||
* TConstruct.ingotLiquidValue * 2, 0));
|
||||
*
|
||||
* @param input The item to liquify
|
||||
* @param block The block to render
|
||||
* @param metadata The metadata of the block to render
|
||||
* @param temperature How hot the block should be before liquifying
|
||||
* @param liquid The result of the process
|
||||
* @param input
|
||||
* The item to liquify
|
||||
* @param blockID
|
||||
* The ID of the block to render
|
||||
* @param metadata
|
||||
* The metadata of the block to render
|
||||
* @param temperature
|
||||
* How hot the block should be before liquifying
|
||||
* @param liquid
|
||||
* The result of the process
|
||||
*/
|
||||
public static void addMelting (ItemStack input, Item item, int metadata, int temperature, FluidStack liquid)
|
||||
public static void addMelting (ItemStack input, Block blockID, int metadata, int temperature, FluidStack liquid)
|
||||
{
|
||||
instance.smeltingList.put(Arrays.asList(new ItemStack(input.getItem(), input.getItemDamage())), liquid);
|
||||
instance.temperatureList.put(Arrays.asList(new ItemStack(input.getItem(), input.getItemDamage())), temperature);
|
||||
instance.renderIndex.put(Arrays.asList(new ItemStack(input.getItem(), input.getItemDamage())), new ItemStack(item, input.stackSize, metadata));
|
||||
instance.smeltingList.put(Arrays.asList(input.getItem().hashCode(), input.getItemDamage()), liquid);
|
||||
instance.temperatureList.put(Arrays.asList(input.getItem().hashCode(), input.getItemDamage()), temperature);
|
||||
instance.renderIndex.put(Arrays.asList(input.getItem().hashCode(), input.getItemDamage()), new ItemStack(blockID, input.stackSize, metadata));
|
||||
}
|
||||
|
||||
/** Adds an alloy mixing recipe.
|
||||
* Example: Smeltery.addAlloyMixing(new FluidStack(bronzeID, 2, 0), new FluidStack(copperID, 3, 0), new FluidStack(tinID, 1, 0));
|
||||
* The example mixes 3 copper with 1 tin to make 2 bronze
|
||||
/**
|
||||
* Adds an alloy mixing recipe. Example: Smeltery.addAlloyMixing(new
|
||||
* FluidStack(bronzeID, 2, 0), new FluidStack(copperID, 3, 0), new
|
||||
* FluidStack(tinID, 1, 0)); The example mixes 3 copper with 1 tin to make 2
|
||||
* bronze
|
||||
*
|
||||
* @param result The output of the combination of mixers. The quantity is used for amount of a successful mix
|
||||
* @param mixers the liquids to be mixed. Quantities are used as ratios
|
||||
* @param result
|
||||
* The output of the combination of mixers. The quantity is used
|
||||
* for amount of a successful mix
|
||||
* @param mixers
|
||||
* the liquids to be mixed. Quantities are used as ratios
|
||||
*/
|
||||
public static void addAlloyMixing (FluidStack result, FluidStack... mixers)
|
||||
{
|
||||
@@ -94,7 +105,9 @@ public class Smeltery
|
||||
|
||||
/**
|
||||
* Used to get the resulting temperature from a source ItemStack
|
||||
* @param item The Source ItemStack
|
||||
*
|
||||
* @param item
|
||||
* The Source ItemStack
|
||||
* @return The result temperature
|
||||
*/
|
||||
public static Integer getLiquifyTemperature (ItemStack item)
|
||||
@@ -102,7 +115,7 @@ public class Smeltery
|
||||
if (item == null)
|
||||
return 20;
|
||||
|
||||
Integer temp = instance.temperatureList.get(Arrays.asList(item.getItem(), item.getItemDamage()));
|
||||
Integer temp = instance.temperatureList.get(Arrays.asList(item.getItem().hashCode(), item.getItemDamage()));
|
||||
if (temp == null)
|
||||
return 20;
|
||||
else
|
||||
@@ -111,7 +124,9 @@ public class Smeltery
|
||||
|
||||
/**
|
||||
* Used to get the resulting temperature from a source Block
|
||||
* @param item The Source ItemStack
|
||||
*
|
||||
* @param item
|
||||
* The Source ItemStack
|
||||
* @return The result ItemStack
|
||||
*/
|
||||
public static Integer getLiquifyTemperature (int blockID, int metadata)
|
||||
@@ -121,7 +136,9 @@ public class Smeltery
|
||||
|
||||
/**
|
||||
* Used to get the resulting ItemStack from a source ItemStack
|
||||
* @param item The Source ItemStack
|
||||
*
|
||||
* @param item
|
||||
* The Source ItemStack
|
||||
* @return The result ItemStack
|
||||
*/
|
||||
public static FluidStack getSmelteryResult (ItemStack item)
|
||||
@@ -129,7 +146,7 @@ public class Smeltery
|
||||
if (item == null)
|
||||
return null;
|
||||
|
||||
FluidStack stack = instance.smeltingList.get(Arrays.asList(item.getItem(), item.getItemDamage()));
|
||||
FluidStack stack = instance.smeltingList.get(Arrays.asList(item.getItem().hashCode(), item.getItemDamage()));
|
||||
if (stack == null)
|
||||
return null;
|
||||
return stack.copy();
|
||||
@@ -137,7 +154,9 @@ public class Smeltery
|
||||
|
||||
/**
|
||||
* Used to get the resulting ItemStack from a source Block
|
||||
* @param item The Source ItemStack
|
||||
*
|
||||
* @param item
|
||||
* The Source ItemStack
|
||||
* @return The result ItemStack
|
||||
*/
|
||||
public static FluidStack getSmelteryResult (int blockID, int metadata)
|
||||
@@ -150,7 +169,7 @@ public class Smeltery
|
||||
|
||||
public static ItemStack getRenderIndex (ItemStack input)
|
||||
{
|
||||
return instance.renderIndex.get(Arrays.asList(input.getItem(), input.getItemDamage()));
|
||||
return instance.renderIndex.get(Arrays.asList(input.getItem().hashCode(), input.getItemDamage()));
|
||||
}
|
||||
|
||||
public static ArrayList mixMetals (ArrayList<FluidStack> moltenMetal)
|
||||
@@ -165,17 +184,17 @@ public class Smeltery
|
||||
return liquids;
|
||||
}
|
||||
|
||||
public static HashMap<List<ItemStack>, FluidStack> getSmeltingList ()
|
||||
public static HashMap<List<Integer>, FluidStack> getSmeltingList ()
|
||||
{
|
||||
return instance.smeltingList;
|
||||
}
|
||||
|
||||
public static HashMap<List<ItemStack>, Integer> getTemperatureList ()
|
||||
public static HashMap<List<Integer>, Integer> getTemperatureList ()
|
||||
{
|
||||
return instance.temperatureList;
|
||||
}
|
||||
|
||||
public static HashMap<List<ItemStack>, ItemStack> getRenderIndex ()
|
||||
public static HashMap<List<Integer>, ItemStack> getRenderIndex ()
|
||||
{
|
||||
return instance.renderIndex;
|
||||
}
|
||||
@@ -190,10 +209,14 @@ public class Smeltery
|
||||
*
|
||||
* @author samtrion
|
||||
*
|
||||
* @param type Type of Fluid
|
||||
* @param input The item to liquify
|
||||
* @param temperatureDifference Difference between FluidType BaseTemperature
|
||||
* @param fluidAmount Amount of Fluid
|
||||
* @param type
|
||||
* Type of Fluid
|
||||
* @param input
|
||||
* The item to liquify
|
||||
* @param temperatureDifference
|
||||
* Difference between FluidType BaseTemperature
|
||||
* @param fluidAmount
|
||||
* Amount of Fluid
|
||||
*/
|
||||
public static void addMelting (FluidType type, ItemStack input, int temperatureDifference, int fluidAmount)
|
||||
{
|
||||
@@ -201,7 +224,7 @@ public class Smeltery
|
||||
if (temp <= 20)
|
||||
temp = type.baseTemperature;
|
||||
|
||||
addMelting(input, new ItemStack(type.renderBlock).getItem(), type.renderMeta, type.baseTemperature + temperatureDifference, new FluidStack(type.fluid, fluidAmount));
|
||||
addMelting(input, type.renderBlock, type.renderMeta, type.baseTemperature + temperatureDifference, new FluidStack(type.fluid, fluidAmount));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -209,14 +232,18 @@ public class Smeltery
|
||||
*
|
||||
* @author samtrion
|
||||
*
|
||||
* @param oreName oreDictionary name e.g. oreIron
|
||||
* @param type Type of Fluid
|
||||
* @param temperatureDifference Difference between FluidType BaseTemperature
|
||||
* @param fluidAmount Amount of Fluid
|
||||
* @param oreName
|
||||
* oreDictionary name e.g. oreIron
|
||||
* @param type
|
||||
* Type of Fluid
|
||||
* @param temperatureDifference
|
||||
* Difference between FluidType BaseTemperature
|
||||
* @param fluidAmount
|
||||
* Amount of Fluid
|
||||
*/
|
||||
public static void addDictionaryMelting (String oreName, FluidType type, int temperatureDifference, int fluidAmount)
|
||||
{
|
||||
for (ItemStack is : OreDictionary.getOres(oreName))
|
||||
addMelting(type, is, temperatureDifference, fluidAmount);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -50,7 +50,7 @@ public class ToolBuilder
|
||||
|
||||
public static void addNormalToolRecipe (ToolCore output, Item head, Item handle, Item accessory)
|
||||
{
|
||||
//instance.combos.add(new ToolRecipe(head, accessory, output));
|
||||
// instance.combos.add(new ToolRecipe(head, accessory, output));
|
||||
ToolRecipe recipe = instance.recipeList.get(output.getToolName());
|
||||
if (recipe != null)
|
||||
{
|
||||
@@ -109,7 +109,7 @@ public class ToolBuilder
|
||||
return null;
|
||||
}
|
||||
|
||||
//Builds a tool from the parts given
|
||||
// Builds a tool from the parts given
|
||||
public ItemStack buildTool (ItemStack headStack, ItemStack handleStack, ItemStack accessoryStack, String name)
|
||||
{
|
||||
return buildTool(headStack, handleStack, accessoryStack, null, name);
|
||||
@@ -140,7 +140,10 @@ public class ToolBuilder
|
||||
return modifyArmor(headStack, new ItemStack[] { handleStack, accessoryStack, extraStack }, name);
|
||||
}
|
||||
|
||||
if (headStack == null || handleStack == null) //Nothing to build without these. All tools need at least two parts!
|
||||
if (headStack == null || handleStack == null) // Nothing to build
|
||||
// without these. All
|
||||
// tools need at least
|
||||
// two parts!
|
||||
return null;
|
||||
|
||||
ToolCore item;
|
||||
@@ -163,10 +166,12 @@ public class ToolBuilder
|
||||
}
|
||||
else
|
||||
{
|
||||
/*if (accessoryStack.getItem() instanceof IToolPart)
|
||||
accessory = ((IToolPart) accessoryStack.getItem()).getMaterialID(accessoryStack);
|
||||
else
|
||||
return null;*/
|
||||
/*
|
||||
* if (accessoryStack.getItem() instanceof IToolPart) accessory =
|
||||
* ((IToolPart)
|
||||
* accessoryStack.getItem()).getMaterialID(accessoryStack); else
|
||||
* return null;
|
||||
*/
|
||||
|
||||
accessory = getMaterialID(accessoryStack);
|
||||
if (accessory == -1)
|
||||
@@ -174,10 +179,11 @@ public class ToolBuilder
|
||||
|
||||
if (extraStack != null)
|
||||
{
|
||||
/*if (extraStack.getItem() instanceof IToolPart)
|
||||
extra = ((IToolPart) extraStack.getItem()).getMaterialID(extraStack);
|
||||
else
|
||||
return null;*/
|
||||
/*
|
||||
* if (extraStack.getItem() instanceof IToolPart) extra =
|
||||
* ((IToolPart) extraStack.getItem()).getMaterialID(extraStack);
|
||||
* else return null;
|
||||
*/
|
||||
|
||||
extra = getMaterialID(extraStack);
|
||||
if (extra == -1)
|
||||
@@ -191,7 +197,7 @@ public class ToolBuilder
|
||||
}
|
||||
}
|
||||
|
||||
//TConstruct.logger.info("Valid: "+item);
|
||||
// TConstruct.logger.info("Valid: "+item);
|
||||
|
||||
if (item == null)
|
||||
return null;
|
||||
@@ -286,11 +292,16 @@ public class ToolBuilder
|
||||
compound.getCompoundTag("InfiTool").setInteger("RenderExtra", extra);
|
||||
}
|
||||
|
||||
compound.getCompoundTag("InfiTool").setInteger("Damage", 0); //Damage is damage to the tool
|
||||
compound.getCompoundTag("InfiTool").setInteger("Damage", 0); // Damage
|
||||
// is
|
||||
// damage
|
||||
// to
|
||||
// the
|
||||
// tool
|
||||
compound.getCompoundTag("InfiTool").setInteger("TotalDurability", durability);
|
||||
compound.getCompoundTag("InfiTool").setInteger("BaseDurability", durability);
|
||||
compound.getCompoundTag("InfiTool").setInteger("BonusDurability", 0); //Modifier
|
||||
compound.getCompoundTag("InfiTool").setFloat("ModDurability", 0f); //Modifier
|
||||
compound.getCompoundTag("InfiTool").setInteger("BonusDurability", 0); // Modifier
|
||||
compound.getCompoundTag("InfiTool").setFloat("ModDurability", 0f); // Modifier
|
||||
compound.getCompoundTag("InfiTool").setBoolean("Broken", false);
|
||||
compound.getCompoundTag("InfiTool").setInteger("Attack", attack);
|
||||
|
||||
@@ -451,7 +462,7 @@ public class ToolBuilder
|
||||
return null;
|
||||
}
|
||||
|
||||
public void addArmorTag (ItemStack armor) //Not sure if temporary or not
|
||||
public void addArmorTag (ItemStack armor) // Not sure if temporary or not
|
||||
{
|
||||
NBTTagCompound baseTag = new NBTTagCompound();
|
||||
NBTTagList list = new NBTTagList();
|
||||
|
||||
@@ -20,10 +20,10 @@ public class ToolRecipe
|
||||
protected ToolCore result;
|
||||
protected Item toolRod = TConstructRegistry.getItem("toolRod");
|
||||
|
||||
/*public ToolRecipe(Item head, ToolCore tool)
|
||||
{
|
||||
this(head, TContent.toolRod, null, null, tool);
|
||||
}*/
|
||||
/*
|
||||
* public ToolRecipe(Item head, ToolCore tool) { this(head,
|
||||
* TContent.toolRod, null, null, tool); }
|
||||
*/
|
||||
|
||||
public ToolRecipe(Item head, Item handle, ToolCore tool)
|
||||
{
|
||||
|
||||
@@ -29,12 +29,11 @@ public class PartBuilderEvent extends Event
|
||||
super(material, pattern, otherPattern);
|
||||
}
|
||||
|
||||
/** Fires before other processing is done
|
||||
/**
|
||||
* Fires before other processing is done
|
||||
*
|
||||
* Result is significant:
|
||||
* DEFAULT: Allows part to be crafted normally
|
||||
* ALLOW: Uses resultStack instead
|
||||
* DENY: Stops part crafting altogether
|
||||
* Result is significant: DEFAULT: Allows part to be crafted normally
|
||||
* ALLOW: Uses resultStack instead DENY: Stops part crafting altogether
|
||||
*/
|
||||
|
||||
public void overrideResult (ItemStack[] result)
|
||||
|
||||
@@ -32,12 +32,11 @@ public class ToolCraftEvent extends Event
|
||||
super(tool, toolTag, materials);
|
||||
}
|
||||
|
||||
/** Fires just before the tool is put together
|
||||
/**
|
||||
* Fires just before the tool is put together
|
||||
*
|
||||
* Result is significant:
|
||||
* DEFAULT: Allows tool to be crafted normally
|
||||
* ALLOW: Uses resultStack instead
|
||||
* DENY: Stops tool crafting altogether
|
||||
* Result is significant: DEFAULT: Allows tool to be crafted normally
|
||||
* ALLOW: Uses resultStack instead DENY: Stops tool crafting altogether
|
||||
*/
|
||||
|
||||
public void overrideResult (ItemStack result)
|
||||
|
||||
@@ -200,7 +200,7 @@ public class AbilityHelper
|
||||
{
|
||||
damageTool(stack, 1, tags, player, false);
|
||||
}
|
||||
//damageTool(stack, 1, player, false);
|
||||
// damageTool(stack, 1, player, false);
|
||||
tool.onEntityDamaged(player.worldObj, player, entity);
|
||||
if (!necroticUHS || (entity instanceof IMob && entity instanceof EntityLivingBase && ((EntityLivingBase) entity).getHealth() <= 0))
|
||||
{
|
||||
@@ -240,7 +240,9 @@ public class AbilityHelper
|
||||
|
||||
if (entity instanceof EntityLivingBase)
|
||||
{
|
||||
DamageSource.causeThornsDamage(entity);//(((EntityLivingBase)player, (EntityLivingBase) entity);
|
||||
DamageSource.causeThornsDamage(entity);// (((EntityLivingBase)player,
|
||||
// (EntityLivingBase)
|
||||
// entity);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -469,7 +471,7 @@ public class AbilityHelper
|
||||
public static void knockbackEntity (EntityLivingBase living, double boost)
|
||||
{
|
||||
living.motionX *= boost;
|
||||
//living.motionY *= boost/2;
|
||||
// living.motionY *= boost/2;
|
||||
living.motionZ *= boost;
|
||||
}
|
||||
|
||||
@@ -527,19 +529,16 @@ public class AbilityHelper
|
||||
player.worldObj.spawnEntityInWorld(entityitem);
|
||||
if (!(player instanceof FakePlayer))
|
||||
entityitem.onCollideWithPlayer(player);
|
||||
/*if (!player.inventory.addItemStackToInventory(stack))
|
||||
{
|
||||
if (!player.worldObj.isRemote)
|
||||
{
|
||||
EntityItem entityitem = new EntityItem(player.worldObj, player.posX + 0.5D, player.posY + 0.5D, player.posZ + 0.5D, stack);
|
||||
player.worldObj.spawnEntityInWorld(entityitem);
|
||||
entityitem.onCollideWithPlayer(player);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
player.worldObj.playSoundAtEntity(player, "random.pop", 0.2F, ((random.nextFloat() - random.nextFloat()) * 0.7F + 1.0F) * 2.0F);
|
||||
}*/
|
||||
/*
|
||||
* if (!player.inventory.addItemStackToInventory(stack)) { if
|
||||
* (!player.worldObj.isRemote) { EntityItem entityitem = new
|
||||
* EntityItem(player.worldObj, player.posX + 0.5D, player.posY + 0.5D,
|
||||
* player.posZ + 0.5D, stack);
|
||||
* player.worldObj.spawnEntityInWorld(entityitem);
|
||||
* entityitem.onCollideWithPlayer(player); } } else {
|
||||
* player.worldObj.playSoundAtEntity(player, "random.pop", 0.2F,
|
||||
* ((random.nextFloat() - random.nextFloat()) * 0.7F + 1.0F) * 2.0F); }
|
||||
*/
|
||||
}
|
||||
|
||||
/* Ranged weapons */
|
||||
|
||||
@@ -17,10 +17,10 @@ public abstract class CustomMaterial
|
||||
this.craftingItem = craftingItem;
|
||||
}
|
||||
|
||||
/*public boolean matches(ItemStack input, ItemStack pattern)
|
||||
{
|
||||
if (ItemStack.areItemStacksEqual(this.input, input) && ItemStack.areItemStacksEqual(this.craftingPattern, pattern))
|
||||
return true;
|
||||
return false;
|
||||
}*/
|
||||
/*
|
||||
* public boolean matches(ItemStack input, ItemStack pattern) { if
|
||||
* (ItemStack.areItemStacksEqual(this.input, input) &&
|
||||
* ItemStack.areItemStacksEqual(this.craftingPattern, pattern)) return true;
|
||||
* return false; }
|
||||
*/
|
||||
}
|
||||
@@ -30,7 +30,7 @@ public abstract class HarvestTool extends ToolCore
|
||||
World world = player.worldObj;
|
||||
Block block = player.worldObj.getBlock(x, y, z);
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
//Block block = Block.blocksList[bID];
|
||||
// Block block = Block.blocksList[bID];
|
||||
if (block == null || block == Blocks.air)
|
||||
return false;
|
||||
int hlvl = -1;
|
||||
@@ -130,7 +130,9 @@ public abstract class HarvestTool extends ToolCore
|
||||
}
|
||||
if (block.getHarvestLevel(meta) > 0)
|
||||
{
|
||||
return calculateStrength(tags, block, meta); //No issue if the harvest level is too low
|
||||
return calculateStrength(tags, block, meta); // No issue if the
|
||||
// harvest level is
|
||||
// too low
|
||||
}
|
||||
return super.getDigSpeed(stack, block, meta);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,8 @@ package tconstruct.library.tools;
|
||||
*/
|
||||
public class TToolMaterial
|
||||
{
|
||||
//mining level, durability, mining speed, baseDamage, handle modifier, Reinforced level, shoddy/spiny level, color/style on name
|
||||
// mining level, durability, mining speed, baseDamage, handle modifier,
|
||||
// Reinforced level, shoddy/spiny level, color/style on name
|
||||
|
||||
public final String materialName;
|
||||
public final String displayName;
|
||||
|
||||
@@ -30,35 +30,33 @@ import cofh.api.energy.IEnergyContainerItem;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
/** NBTTags
|
||||
* Main tag - InfiTool
|
||||
/**
|
||||
* NBTTags Main tag - InfiTool
|
||||
*
|
||||
* @see ToolBuilder
|
||||
*
|
||||
* Required:
|
||||
* Head: Base and render tag, above the handle
|
||||
* Handle: Base and render tag, bottom layer
|
||||
* Required: Head: Base and render tag, above the handle Handle: Base and
|
||||
* render tag, bottom layer
|
||||
*
|
||||
* Damage: Replacement for metadata
|
||||
* MaxDamage: ItemStacks only read setMaxDamage()
|
||||
* Broken: Represents whether the tool is broken (boolean)
|
||||
* Attack: How much damage a mob will take
|
||||
* MiningSpeed: The speed at which a tool mines
|
||||
* Damage: Replacement for metadata MaxDamage: ItemStacks only read
|
||||
* setMaxDamage() Broken: Represents whether the tool is broken (boolean)
|
||||
* Attack: How much damage a mob will take MiningSpeed: The speed at which
|
||||
* a tool mines
|
||||
*
|
||||
* Others:
|
||||
* Accessory: Base and tag, above head. Sword guards, binding, etc
|
||||
* Effects: Render tag, top layer. Fancy effects like moss or diamond edge.
|
||||
* Render order: Handle > Head > Accessory > Effect1 > Effect2 > Effect3 > etc
|
||||
* Unbreaking: Reinforced in-game, 10% chance to not use durability per level
|
||||
* Stonebound: Mines faster as the tool takes damage, but has less attack
|
||||
* Spiny: Opposite of stonebound
|
||||
* Others: Accessory: Base and tag, above head. Sword guards, binding, etc
|
||||
* Effects: Render tag, top layer. Fancy effects like moss or diamond edge.
|
||||
* Render order: Handle > Head > Accessory > Effect1 > Effect2 > Effect3 >
|
||||
* etc Unbreaking: Reinforced in-game, 10% chance to not use durability per
|
||||
* level Stonebound: Mines faster as the tool takes damage, but has less
|
||||
* attack Spiny: Opposite of stonebound
|
||||
*
|
||||
* Modifiers have their own tags.
|
||||
* Modifiers have their own tags.
|
||||
* @see ToolMod
|
||||
*/
|
||||
|
||||
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 items added
|
||||
protected int capacity = 400000;
|
||||
protected int maxReceive = 75;
|
||||
protected int maxExtract = 75;
|
||||
@@ -81,10 +79,10 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
|
||||
canRepair = false;
|
||||
}
|
||||
|
||||
/** Determines crafting behavior with regards to durability
|
||||
* 0: None
|
||||
* 1: Adds handle modifier
|
||||
* 2: Averages part with the rest of the tool (head)
|
||||
/**
|
||||
* Determines crafting behavior with regards to durability 0: None 1: Adds
|
||||
* handle modifier 2: Averages part with the rest of the tool (head)
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
|
||||
@@ -122,7 +120,7 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
|
||||
public HashMap<Integer, IIcon> effectIcons = new HashMap<Integer, IIcon>();
|
||||
public HashMap<Integer, IIcon> extraIcons = new HashMap<Integer, IIcon>();
|
||||
|
||||
//Not liking this
|
||||
// Not liking this
|
||||
public HashMap<Integer, String> headStrings = new HashMap<Integer, String>();
|
||||
public HashMap<Integer, String> brokenPartStrings = new HashMap<Integer, String>();
|
||||
public HashMap<Integer, String> handleStrings = new HashMap<Integer, String>();
|
||||
@@ -150,7 +148,7 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
|
||||
return false;
|
||||
}
|
||||
|
||||
//Override me please!
|
||||
// Override me please!
|
||||
public int getPartAmount ()
|
||||
{
|
||||
return 3;
|
||||
@@ -513,7 +511,7 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
|
||||
return ret;
|
||||
}
|
||||
|
||||
//Used for sounds and the like
|
||||
// Used for sounds and the like
|
||||
public void onEntityDamaged (World world, EntityLivingBase player, Entity entity)
|
||||
{
|
||||
|
||||
@@ -546,7 +544,11 @@ 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.TRepo"); // TODO: Make
|
||||
// sure this
|
||||
// is still
|
||||
// working
|
||||
// in 1.7.
|
||||
fld = clazz.getField("supressMissingToolLogs");
|
||||
supress = fld.getBoolean(fld);
|
||||
}
|
||||
@@ -579,7 +581,7 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
|
||||
|
||||
public Item getHandleItem ()
|
||||
{
|
||||
return TConstructRegistry.getItem("toolRod");//TContent.toolRod;
|
||||
return TConstructRegistry.getItem("toolRod");// TContent.toolRod;
|
||||
}
|
||||
|
||||
/* Updating */
|
||||
@@ -595,10 +597,10 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
|
||||
|
||||
/* Tool uses */
|
||||
|
||||
//Types
|
||||
// Types
|
||||
public abstract String[] toolCategories ();
|
||||
|
||||
//Mining
|
||||
// Mining
|
||||
@Override
|
||||
public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPlayer player)
|
||||
{
|
||||
@@ -660,7 +662,7 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
|
||||
return this.damageVsEntity;
|
||||
}
|
||||
|
||||
//Changes how much durability the base tool has
|
||||
// Changes how much durability the base tool has
|
||||
public float getDurabilityModifier ()
|
||||
{
|
||||
return 1f;
|
||||
@@ -676,11 +678,12 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
//Right-click
|
||||
// Right-click
|
||||
public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float clickX, float clickY, float clickZ)
|
||||
{
|
||||
/*if (world.isRemote)
|
||||
return true;*/
|
||||
/*
|
||||
* if (world.isRemote) return true;
|
||||
*/
|
||||
|
||||
boolean used = false;
|
||||
int hotbarSlot = player.inventory.currentItem;
|
||||
@@ -745,11 +748,13 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
|
||||
}
|
||||
}
|
||||
|
||||
/*if (used) //Update client
|
||||
{
|
||||
Packet103SetSlot packet = new Packet103SetSlot(player.openContainer.windowId, itemSlot, nearbyStack);
|
||||
((EntityPlayerMP)player).playerNetServerHandler.sendPacketToPlayer(packet);
|
||||
}*/
|
||||
/*
|
||||
* if (used) //Update client { Packet103SetSlot packet = new
|
||||
* Packet103SetSlot(player.openContainer.windowId, itemSlot,
|
||||
* nearbyStack);
|
||||
* ((EntityPlayerMP)player).playerNetServerHandler.sendPacketToPlayer
|
||||
* (packet); }
|
||||
*/
|
||||
return used;
|
||||
}
|
||||
|
||||
@@ -895,7 +900,7 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
|
||||
{
|
||||
}
|
||||
|
||||
//TE support section -- from COFH core API reference section
|
||||
// TE support section -- from COFH core API reference section
|
||||
public void setMaxTransfer (int maxTransfer)
|
||||
{
|
||||
setMaxReceive(maxTransfer);
|
||||
@@ -970,5 +975,5 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
|
||||
return 0;
|
||||
return capacity;
|
||||
}
|
||||
//end of TE support section
|
||||
// end of TE support section
|
||||
}
|
||||
@@ -17,7 +17,7 @@ public abstract class ToolMod
|
||||
|
||||
public ToolMod(ItemStack[] items, int effect, String dataKey)
|
||||
{
|
||||
//recipeItems = items;
|
||||
// recipeItems = items;
|
||||
List<ItemStack> itemstacks = new ArrayList<ItemStack>();
|
||||
for (int iter = 0; iter < items.length; iter++)
|
||||
itemstacks.add(items[iter]);
|
||||
@@ -26,11 +26,14 @@ public abstract class ToolMod
|
||||
key = dataKey;
|
||||
}
|
||||
|
||||
/** Checks to see if the inputs match the stored items
|
||||
* Note: Works like ShapelessRecipes
|
||||
/**
|
||||
* Checks to see if the inputs match the stored items Note: Works like
|
||||
* ShapelessRecipes
|
||||
*
|
||||
* @param input The ItemStacks to compare against
|
||||
* @param tool Item to modify, used for restrictions
|
||||
* @param input
|
||||
* The ItemStacks to compare against
|
||||
* @param tool
|
||||
* Item to modify, used for restrictions
|
||||
* @return Whether the recipe matches the input
|
||||
*/
|
||||
public boolean matches (ItemStack[] input, ItemStack tool)
|
||||
@@ -78,7 +81,8 @@ public abstract class ToolMod
|
||||
|
||||
/**
|
||||
*
|
||||
* @param tool Tool to compare against
|
||||
* @param tool
|
||||
* Tool to compare against
|
||||
* @return Whether the tool can be modified
|
||||
*/
|
||||
|
||||
@@ -88,10 +92,14 @@ public abstract class ToolMod
|
||||
return tags.getInteger("Modifiers") > 0;
|
||||
}
|
||||
|
||||
/** Modifies the tool. Adds nbttags, changes existing ones, ticks down modification counter, etc
|
||||
/**
|
||||
* Modifies the tool. Adds nbttags, changes existing ones, ticks down
|
||||
* modification counter, etc
|
||||
*
|
||||
* @param input ItemStacks to pull info from
|
||||
* @param tool The tool to modify
|
||||
* @param input
|
||||
* ItemStacks to pull info from
|
||||
* @param tool
|
||||
* The tool to modify
|
||||
*/
|
||||
public abstract void modify (ItemStack[] input, ItemStack tool);
|
||||
|
||||
|
||||
@@ -46,7 +46,8 @@ public abstract class Weapon extends ToolCore
|
||||
}
|
||||
|
||||
/**
|
||||
* returns the action that specifies what animation to play when the items is being used
|
||||
* returns the action that specifies what animation to play when the items
|
||||
* is being used
|
||||
*/
|
||||
public EnumAction getItemUseAction (ItemStack par1ItemStack)
|
||||
{
|
||||
@@ -62,7 +63,8 @@ public abstract class Weapon extends ToolCore
|
||||
}
|
||||
|
||||
/**
|
||||
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
|
||||
* Called whenever this item is equipped and the right mouse button is
|
||||
* pressed. Args: itemStack, world, entityPlayer
|
||||
*/
|
||||
public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer player)
|
||||
{
|
||||
@@ -110,12 +112,11 @@ public abstract class Weapon extends ToolCore
|
||||
}
|
||||
}
|
||||
|
||||
/*@Override
|
||||
public boolean onLeftClickEntity (ItemStack stack, EntityPlayer player, Entity entity)
|
||||
{
|
||||
TContent.modL.midStreamModify(stack);
|
||||
return super.onLeftClickEntity(stack, player, entity);
|
||||
}*/
|
||||
/*
|
||||
* @Override public boolean onLeftClickEntity (ItemStack stack, EntityPlayer
|
||||
* player, Entity entity) { TContent.modL.midStreamModify(stack); return
|
||||
* super.onLeftClickEntity(stack, player, entity); }
|
||||
*/
|
||||
|
||||
@Override
|
||||
public String[] toolCategories ()
|
||||
|
||||
@@ -4,9 +4,11 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IToolPart
|
||||
{
|
||||
/** Parts to build tools from. ex: Pickaxe Head
|
||||
/**
|
||||
* Parts to build tools from. ex: Pickaxe Head
|
||||
*
|
||||
* @param stack This item
|
||||
* @param stack
|
||||
* This item
|
||||
* @return Proper material ID. -1 for invalid
|
||||
*/
|
||||
public int getMaterialID (ItemStack stack);
|
||||
|
||||
Reference in new issue
Block a user