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
@@ -1,4 +1,34 @@
|
||||
package tconstruct.library.tools;
|
||||
|
||||
public class FletchlingLeafMaterial {
|
||||
import mantle.blocks.BlockUtils;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import tconstruct.tools.TinkerToolEvents;
|
||||
|
||||
public class FletchlingLeafMaterial extends FletchingMaterial {
|
||||
public FletchlingLeafMaterial(int materialID, int value, String oredict, ItemStack craftingItem, float accuracy, float breakChance, float mass) {
|
||||
super(materialID, value, oredict, craftingItem, accuracy, breakChance, mass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(ItemStack stack) {
|
||||
if(matchesLeaves(stack))
|
||||
return true;
|
||||
|
||||
return super.matches(stack);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user