settings;
17 | }
18 |
--------------------------------------------------------------------------------
/src/main/java/keystrokesmod/utility/i18n/settings/I18nButtonSetting.java:
--------------------------------------------------------------------------------
1 | package keystrokesmod.utility.i18n.settings;
2 |
3 | import lombok.Getter;
4 |
5 | @Getter
6 | public class I18nButtonSetting extends I18nSetting {
7 | private final String name;
8 |
9 | public I18nButtonSetting(String toolTip, String name) {
10 | super(toolTip);
11 | this.name = name;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/main/java/keystrokesmod/utility/i18n/settings/I18nDescriptionSetting.java:
--------------------------------------------------------------------------------
1 | package keystrokesmod.utility.i18n.settings;
2 |
3 | import lombok.Getter;
4 |
5 | @Getter
6 | public class I18nDescriptionSetting extends I18nSetting {
7 | private final String desc;
8 |
9 | public I18nDescriptionSetting(String toolTip, String desc) {
10 | super(toolTip);
11 | this.desc = desc;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/main/java/keystrokesmod/utility/i18n/settings/I18nModeSetting.java:
--------------------------------------------------------------------------------
1 | package keystrokesmod.utility.i18n.settings;
2 |
3 | import lombok.Getter;
4 |
5 | /**
6 | * Some modules (like RecordClick) will change the options dynamic,
7 | * so this I18n implement doesn't work for every modeSetting.
8 | *
9 | * TODO This is an unresolved problem.
10 | */
11 | @Getter
12 | public class I18nModeSetting extends I18nSetting {
13 | private final String settingName;
14 | private final String[] options;
15 |
16 | public I18nModeSetting(String toolTip, String settingName, String[] options) {
17 | super(toolTip);
18 | this.settingName = settingName;
19 | this.options = options;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/main/java/keystrokesmod/utility/i18n/settings/I18nSetting.java:
--------------------------------------------------------------------------------
1 | package keystrokesmod.utility.i18n.settings;
2 |
3 | import lombok.Getter;
4 |
5 | @Getter
6 | public class I18nSetting {
7 | private final String toolTip;
8 |
9 | public I18nSetting(String toolTip) {
10 | this.toolTip = toolTip;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/java/keystrokesmod/utility/i18n/settings/I18nSliderSetting.java:
--------------------------------------------------------------------------------
1 | package keystrokesmod.utility.i18n.settings;
2 |
3 | import lombok.Getter;
4 |
5 | @Getter
6 | public class I18nSliderSetting extends I18nSetting {
7 | private final String settingName;
8 | private final String settingInfo;
9 |
10 | public I18nSliderSetting(String toolTip, String settingName, String settingInfo) {
11 | super(toolTip);
12 | this.settingName = settingName;
13 | this.settingInfo = settingInfo;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/main/java/keystrokesmod/utility/interact/moveable/Moveable.java:
--------------------------------------------------------------------------------
1 | package keystrokesmod.utility.interact.moveable;
2 |
3 | public interface Moveable {
4 |
5 | void render();
6 |
7 | boolean isDisabled();
8 |
9 | int getMinX();
10 |
11 | int getMaxX();
12 |
13 | int getMinY();
14 |
15 | int getMaxY();
16 |
17 | void moveX(int amount);
18 |
19 | void moveY(int amount);
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/src/main/java/keystrokesmod/utility/movement/Direction.java:
--------------------------------------------------------------------------------
1 | package keystrokesmod.utility.movement;
2 |
3 | import net.minecraft.util.BlockPos;
4 | import org.jetbrains.annotations.Contract;
5 | import org.jetbrains.annotations.NotNull;
6 |
7 | public enum Direction {
8 | POSITIVE_X,
9 | NEGATIVE_X,
10 | POSITIVE_Z,
11 | NEGATIVE_Z;
12 |
13 | @Contract("_ -> new")
14 | public @NotNull BlockPos offsetWith(@NotNull BlockPos blockPos) {
15 | switch (this) {
16 | case POSITIVE_X:
17 | return new BlockPos(blockPos.getX() + 1, blockPos.getY(), blockPos.getZ());
18 | case NEGATIVE_X:
19 | return new BlockPos(blockPos.getX() - 1, blockPos.getY(), blockPos.getZ());
20 | case POSITIVE_Z:
21 | return new BlockPos(blockPos.getX(), blockPos.getY(), blockPos.getZ() + 1);
22 | case NEGATIVE_Z:
23 | return new BlockPos(blockPos.getX(), blockPos.getY(), blockPos.getZ() - 1);
24 | default:
25 | throw new RuntimeException("Invalid direction.");
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/java/keystrokesmod/utility/notebot/decoder/SongDecoder.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client).
3 | * Copyright (c) Meteor Development.
4 | */
5 |
6 | package keystrokesmod.utility.notebot.decoder;
7 |
8 | import keystrokesmod.module.impl.fun.NoteBot;
9 | import keystrokesmod.utility.notebot.song.Song;
10 |
11 | import java.io.File;
12 |
13 | public abstract class SongDecoder {
14 | protected NoteBot notebot = (NoteBot) NoteBot.getInstance();
15 |
16 | /**
17 | * Parse file to a {@link Song} object
18 | *
19 | * @param file Song file
20 | * @return A {@link Song} object
21 | */
22 | public abstract Song parse(File file) throws Exception;
23 | }
24 |
--------------------------------------------------------------------------------
/src/main/java/keystrokesmod/utility/notebot/instrumentdetect/InstrumentDetectFunction.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client).
3 | * Copyright (c) Meteor Development.
4 | */
5 |
6 | package keystrokesmod.utility.notebot.instrumentdetect;
7 |
8 | import net.minecraft.block.state.IBlockState;
9 | import net.minecraft.util.BlockPos;
10 |
11 | public interface InstrumentDetectFunction {
12 | /**
13 | * Detects an instrument for noteblock
14 | *
15 | * @param noteBlock Noteblock state
16 | * @param blockPos Noteblock position
17 | * @return Detected instrument
18 | */
19 | String detectInstrument(IBlockState noteBlock, BlockPos blockPos);
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/keystrokesmod/utility/notebot/song/Note.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client).
3 | * Copyright (c) Meteor Development.
4 | */
5 |
6 | package keystrokesmod.utility.notebot.song;
7 |
8 | import lombok.Getter;
9 | import lombok.Setter;
10 |
11 | import java.util.Objects;
12 |
13 | @Setter
14 | @Getter
15 | public class Note {
16 |
17 | private String instrument;
18 | private int noteLevel;
19 |
20 | public Note(String instrument, int noteLevel) {
21 | this.instrument = instrument;
22 | this.noteLevel = noteLevel;
23 | }
24 |
25 | @Override
26 | public boolean equals(Object o) {
27 | if (this == o) return true;
28 | if (o == null || getClass() != o.getClass()) return false;
29 | Note note = (Note) o;
30 | return Objects.equals(instrument, note.instrument) && noteLevel == note.noteLevel;
31 | }
32 |
33 | @Override
34 | public int hashCode() {
35 | return Objects.hash(instrument, noteLevel);
36 | }
37 |
38 | @Override
39 | public String toString() {
40 | return "Note{" +
41 | "instrument=" + getInstrument() +
42 | ", noteLevel=" + getNoteLevel() +
43 | '}';
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/main/java/keystrokesmod/utility/profile/Profile.java:
--------------------------------------------------------------------------------
1 | package keystrokesmod.utility.profile;
2 |
3 | import keystrokesmod.module.Module;
4 |
5 | public class Profile {
6 | private final Module module;
7 | private final int bind;
8 | private final String profileName;
9 |
10 | public Profile(String profileName, int bind) {
11 | this.profileName = profileName;
12 | this.bind = bind;
13 | this.module = new ProfileModule(this, profileName, bind);
14 | this.module.ignoreOnSave = true;
15 | }
16 |
17 | public Module getModule() {
18 | return module;
19 | }
20 |
21 | public int getBind() {
22 | return bind;
23 | }
24 |
25 | public String getName() {
26 | return profileName;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/java/keystrokesmod/utility/render/progress/ProgressManager.java:
--------------------------------------------------------------------------------
1 | package keystrokesmod.utility.render.progress;
2 |
3 | import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
4 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
5 | import net.minecraftforge.fml.common.gameevent.TickEvent;
6 | import org.jetbrains.annotations.NotNull;
7 |
8 | import java.util.Collections;
9 | import java.util.Set;
10 |
11 | public class ProgressManager {
12 | private static final Set