mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-21 04:32:26 +00:00
Give Harvest Tools the proper toolclass callback
This commit is contained in:
1 parent
c58bec5c78
commit
990a55aca5
1 file changed
+14
@@ -19,6 +19,9 @@ import net.minecraftforge.common.ForgeHooks;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/* Base class for tools that should be harvesting blocks */
|
||||
|
||||
public abstract class HarvestTool extends ToolCore
|
||||
@@ -118,6 +121,17 @@ public abstract class HarvestTool extends ToolCore
|
||||
|
||||
protected abstract String getHarvestType ();
|
||||
|
||||
@Override
|
||||
public Set<String> getToolClasses(ItemStack stack) {
|
||||
Set<String> set = new HashSet<String>();
|
||||
|
||||
if(stack != null && stack.getItem() instanceof HarvestTool) {
|
||||
set.add(((HarvestTool) stack.getItem()).getHarvestType());
|
||||
}
|
||||
|
||||
return set;
|
||||
}
|
||||
|
||||
public boolean isEffective (Block block, int meta)
|
||||
{
|
||||
if(this.getHarvestType().equals(block.getHarvestTool(meta)))
|
||||
|
||||
Reference in new issue
Block a user