mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-19 03:49:29 +00:00
Change how leaf fletchlings are handled to be more general. Basically ALL leaves can be used for leaf fletchlings now.
This commit is contained in:
1 parent
1dd13c5a5f
commit
175352108e
5 files changed
+47
-38
No files matched your search
@@ -25,12 +25,7 @@ import tconstruct.TConstruct;
|
||||
import tconstruct.armor.player.TPlayerStats;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.event.*;
|
||||
import tconstruct.library.tools.AbilityHelper;
|
||||
import tconstruct.library.tools.ArrowMaterial;
|
||||
import tconstruct.library.tools.BowMaterial;
|
||||
import tconstruct.library.tools.BowstringMaterial;
|
||||
import tconstruct.library.tools.FletchingMaterial;
|
||||
import tconstruct.library.tools.ToolCore;
|
||||
import tconstruct.library.tools.*;
|
||||
import tconstruct.util.ItemHelper;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
import cpw.mods.fml.common.eventhandler.Event.Result;
|
||||
@@ -222,33 +217,15 @@ public class TinkerToolEvents
|
||||
|
||||
public static ItemStack craftFletching (ItemStack stack)
|
||||
{
|
||||
if (matchesLeaves(stack))
|
||||
{
|
||||
FletchingMaterial leaves = (FletchingMaterial) TConstructRegistry.getCustomMaterial(new ItemStack(Blocks.leaves), FletchingMaterial.class);
|
||||
return leaves.craftingItem.copy();
|
||||
}
|
||||
|
||||
FletchingMaterial mat = (FletchingMaterial) TConstructRegistry.getCustomMaterial(stack, FletchingMaterial.class);
|
||||
// maybe it's a leaf fletchling
|
||||
if(mat == null)
|
||||
mat = (FletchingMaterial) TConstructRegistry.getCustomMaterial(stack, FletchlingLeafMaterial.class);
|
||||
if (mat != null)
|
||||
return mat.craftingItem.copy();
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean matchesLeaves (ItemStack stack)
|
||||
{
|
||||
if (stack != null)
|
||||
{
|
||||
Block block = BlockUtils.getBlockFromItemStack(stack);
|
||||
if (block != null)
|
||||
{
|
||||
if (block.isLeaves(null, 0, 0, 0))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void onAttack (LivingAttackEvent event)
|
||||
|
||||
@@ -44,6 +44,7 @@ import tconstruct.items.tools.Shovel;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.client.TConstructClientRegistry;
|
||||
import tconstruct.library.crafting.*;
|
||||
import tconstruct.library.tools.FletchlingLeafMaterial;
|
||||
import tconstruct.library.tools.ToolCore;
|
||||
import tconstruct.library.util.IPattern;
|
||||
import tconstruct.modifiers.tools.ModAntiSpider;
|
||||
@@ -877,8 +878,7 @@ public class TinkerTools
|
||||
|
||||
TConstructRegistry.addBowstringMaterial(0, 2, new ItemStack(Items.string), new ItemStack(TinkerTools.bowstring, 1, 0), 1F, 1F, 1f); // String
|
||||
TConstructRegistry.addFletchingMaterial(0, 2, new ItemStack(Items.feather), new ItemStack(TinkerTools.fletching, 1, 0), 100F, 0F, 0.05F); // Feather
|
||||
for (int i = 0; i < 4; i++)
|
||||
TConstructRegistry.addFletchingMaterial(1, 2, new ItemStack(Blocks.leaves, 1, i), new ItemStack(TinkerTools.fletching, 1, 1), 75F, 0F, 0.2F); // All four vanialla Leaves
|
||||
TConstructRegistry.addCustomMaterial(new FletchlingLeafMaterial(1, 2, "treeLeaves", new ItemStack(TinkerTools.fletching, 1, 1), 75F, 0F, 0.2F)); // all vanilla and oredicted leaves. and all leaves in general.
|
||||
TConstructRegistry.addFletchingMaterial(2, 2, new ItemStack(TinkerTools.materials, 1, 1), new ItemStack(TinkerTools.fletching, 1, 2), 100F, 0F, 0.12F); // Slime
|
||||
TConstructRegistry.addFletchingMaterial(3, 2, new ItemStack(TinkerTools.materials, 1, 17), new ItemStack(TinkerTools.fletching, 1, 3), 100F, 0F, 0.12F); // BlueSlime
|
||||
|
||||
|
||||
Reference in new issue
Block a user