Multitask: Adds BowDisable option

This commit is contained in:
noil 2021-01-16 17:29:30 -05:00
parent a9aa8afa7e
commit 6b670b8c88
1 changed files with 12 additions and 0 deletions

View File

@ -4,6 +4,9 @@ import me.rigamortis.seppuku.api.event.player.EventHandActive;
import me.rigamortis.seppuku.api.event.player.EventHittingBlock;
import me.rigamortis.seppuku.api.event.player.EventResetBlockRemoving;
import me.rigamortis.seppuku.api.module.Module;
import me.rigamortis.seppuku.api.value.Value;
import net.minecraft.client.Minecraft;
import net.minecraft.init.Items;
import team.stiff.pomelo.impl.annotated.handler.annotation.Listener;
/**
@ -11,12 +14,21 @@ import team.stiff.pomelo.impl.annotated.handler.annotation.Listener;
*/
public final class MultitaskModule extends Module {
private final Value<Boolean> bowDisable = new Value<Boolean>("BowDisable", new String[]{"disableonbow", "bd"}, "Disables multi-tasking when holding a bow.", true);
public MultitaskModule() {
super("Multitask", new String[]{"multi", "task"}, "Allows the player to perform multiple actions at once. (eating, placing, attacking)", "NONE", -1, ModuleType.COMBAT);
}
@Listener
public void onActiveHand(EventHandActive event) {
if (this.bowDisable.getValue()) {
if (Minecraft.getMinecraft().player != null) {
if (Minecraft.getMinecraft().player.getHeldItemMainhand().getItem().equals(Items.BOW)) {
return;
}
}
}
event.setCanceled(true);
}