Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change how leaf fletchlings are handled to be more general. Basically…
… ALL leaves can be used for leaf fletchlings now.
- Loading branch information
Showing
5 changed files
with
47 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 31 additions & 1 deletion
32
src/main/java/tconstruct/library/tools/FletchlingLeafMaterial.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters