Skip to content
This repository has been archived by the owner on Aug 10, 2018. It is now read-only.

Commit

Permalink
Add "use swords" setting to AutoToolMod
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander01998 committed Feb 2, 2017
1 parent 123baa5 commit 6fdbc12
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/tk/wurst_client/features/mods/AutoToolMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
package tk.wurst_client.features.mods;

import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraft.util.math.BlockPos;
import tk.wurst_client.events.listeners.UpdateListener;
import tk.wurst_client.features.Feature;
import tk.wurst_client.settings.CheckboxSetting;
import tk.wurst_client.utils.BlockUtils;
import tk.wurst_client.utils.InventoryUtils;

Expand All @@ -27,6 +29,15 @@ public class AutoToolMod extends Mod implements UpdateListener
private BlockPos pos;
private int timer;

public CheckboxSetting useSwords =
new CheckboxSetting("Use swords as tools", false);

@Override
public void initSettings()
{
settings.add(useSwords);
}

@Override
public Feature[] getSeeAlso()
{
Expand Down Expand Up @@ -110,6 +121,10 @@ public void setSlot(BlockPos pos)
if(InventoryUtils.isEmptySlot(stack))
continue;

// skip swords
if(!useSwords.isChecked() && stack.getItem() instanceof ItemSword)
continue;

// get speed
float speed = stack.getStrVsBlock(BlockUtils.getState(pos));

Expand Down

0 comments on commit 6fdbc12

Please sign in to comment.