Skip to content

Commit

Permalink
- Re-added Auto Crate
Browse files Browse the repository at this point in the history
- Re-added transaction logging
- Updated vote filter
  • Loading branch information
hashalite committed Jun 9, 2023
1 parent 466f2ae commit 2006be1
Show file tree
Hide file tree
Showing 34 changed files with 522 additions and 138 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ I am always looking for ways to improve the mod. If you have any feature request
| Auto Reply | Automatically replies to private messages. | **Auto Response** - The response to send to private messages.<br>**Reply Delay** - The delay between responses if multiple people message you at once. (Seconds) |
| Auto Raffle | Automatically buys raffle tickets when you log in and when the raffle ends. | **Skyblock Raffle Tickets** - The amount of raffle tickets to purchase on /skyblock. (Max. 2)<br>**Economy Raffle Tickets** - The amount of raffle tickets to purchase on /economy. (Max. 5)<br>**Grass Check Delay** - If you don't have enough grass in your inventory, how often it should check for more. (Seconds) |
| Auto Private | Automatically writes private signs. | **Auto Private Names** - Up to two names to put on private signs. Yours is included automatically. |
| Auto Crate | Opens crate keys automatically.<br><br>To use:<br>1. Ensure your inventory contains the appropriate crate key<br>2. Enable Auto Crate when within range of the crate | **Crate Mode** - The type of crate to target (**Voter** or **Common**)<br>**Crate Delay** - After the current crate finishes, how long to wait before opening the next.<br>**Crate Distance** - The maximum distance from the crate. |
| Auto Silk | Automatically enchants books and tools with Silk Touch.<br><br>To use:<br>1. Ensure your inventory contains the configured tool, books, and at least 3 lapis<br>2. Enable Auto Silk<br>3. Open an enchanting table | **Target Tool** - The tool that Auto Silk will target.<br>**Auto Silk Delay** - The delay between each enchanting action. |
| Staff Detector | Detects when staff join/leave. | **Detect Staff Join** - Whether you should receive notifications when staff members join.<br>**Detect Staff Leave** - Whether you should receive notifications when staff members leave.<br>**Play Staff Sound** - Whether to play sounds when staff members join/leave.<br>**Staff Sound** - The sound played when staff join/leave. |
| Convert Command | Converts a quantity into double chests, stacks, and remainder. Supports units like 's' for stacks, 'sc' for single chests, and 'dc' for double chests. Also supports almost all mathematical operations. | **N/A** |
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ mc_version=1.19.4
yarn_mappings=1.19.4+build.2
loader_version=0.14.19
# Mod Properties
mod_version=1.1.5
mod_version=1.1.6
maven_group=net.xolt
archives_base_name=sbutils
# Dependencies
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/net/xolt/sbutils/SbUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public void onInitializeClient() {
ChatFilters.registerCommand(dispatcher);
ChatLogger.registerCommand(dispatcher);
JoinCommands.registerCommand(dispatcher);
AutoCrate.registerCommand(dispatcher);
AutoSilk.registerCommand(dispatcher);
Mentions.registerCommand(dispatcher);
ToolSaver.registerCommand(dispatcher);
Expand All @@ -60,8 +61,6 @@ public void onInitializeClient() {
Centered.registerCommand(dispatcher);
DeathCoords.registerCommand(dispatcher);
EventNotifier.registerCommand(dispatcher);


});

registerKeybindings();
Expand Down
90 changes: 70 additions & 20 deletions src/main/java/net/xolt/sbutils/config/ConfigGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public static Screen getModConfigScreen(Screen parent) {
.category(buildAutoRaffleCategory(defaults, config))
.category(buildAutoPrivateCategory(defaults, config))
.category(buildAutoSilkCategory(defaults, config))
.category(buildAutoCrateCategory(defaults, config))
.category(buildStaffDetectorCategory(defaults, config))
.save(ModConfig.INSTANCE::save))
.generateScreen(parent);
Expand Down Expand Up @@ -549,26 +550,26 @@ private static ConfigCategory buildChatLoggerCategory(ModConfig defaults, ModCon
.name(Text.translatable("text.sbutils.config.category.chatlogger"))
.group(OptionGroup.createBuilder()
.name(Text.translatable("text.sbutils.config.group.chatLogger"))
// .option(Option.createBuilder(boolean.class)
// .name(Text.translatable("text.sbutils.config.option.shopLoggerIncoming"))
// .tooltip(Text.translatable("text.sbutils.config.option.shopLoggerIncoming.tooltip"))
// .binding(
// defaults.shopLoggerIncoming,
// () -> config.shopLoggerIncoming,
// (value) -> config.shopLoggerIncoming = value
// )
// .controller(TickBoxController::new)
// .build())
// .option(Option.createBuilder(boolean.class)
// .name(Text.translatable("text.sbutils.config.option.shopLoggerOutgoing"))
// .tooltip(Text.translatable("text.sbutils.config.option.shopLoggerOutgoing.tooltip"))
// .binding(
// defaults.shopLoggerOutgoing,
// () -> config.shopLoggerOutgoing,
// (value) -> config.shopLoggerOutgoing = value
// )
// .controller(TickBoxController::new)
// .build())
.option(Option.createBuilder(boolean.class)
.name(Text.translatable("text.sbutils.config.option.shopLoggerIncoming"))
.tooltip(Text.translatable("text.sbutils.config.option.shopLoggerIncoming.tooltip"))
.binding(
defaults.shopLoggerIncoming,
() -> config.shopLoggerIncoming,
(value) -> config.shopLoggerIncoming = value
)
.controller(TickBoxController::new)
.build())
.option(Option.createBuilder(boolean.class)
.name(Text.translatable("text.sbutils.config.option.shopLoggerOutgoing"))
.tooltip(Text.translatable("text.sbutils.config.option.shopLoggerOutgoing.tooltip"))
.binding(
defaults.shopLoggerOutgoing,
() -> config.shopLoggerOutgoing,
(value) -> config.shopLoggerOutgoing = value
)
.controller(TickBoxController::new)
.build())
.option(Option.createBuilder(boolean.class)
.name(Text.translatable("text.sbutils.config.option.msgLoggerIncoming"))
.tooltip(Text.translatable("text.sbutils.config.option.msgLoggerIncoming.tooltip"))
Expand Down Expand Up @@ -1044,6 +1045,55 @@ private static ConfigCategory buildAutoSilkCategory(ModConfig defaults, ModConfi
.build();
}

private static ConfigCategory buildAutoCrateCategory(ModConfig defaults, ModConfig config) {
return ConfigCategory.createBuilder()
.name(Text.translatable("text.sbutils.config.category.autocrate"))
.group(OptionGroup.createBuilder()
.name(Text.translatable("text.sbutils.config.group.autoCrate"))
.option(Option.createBuilder(boolean.class)
.name(Text.translatable("text.sbutils.config.option.autoCrate"))
.tooltip(Text.translatable("text.sbutils.config.option.autoCrate.tooltip"))
.binding(
defaults.autoCrate,
() -> config.autoCrate,
(value) -> config.autoCrate = value
)
.controller(TickBoxController::new)
.build())
.option(Option.createBuilder(ModConfig.CrateMode.class)
.name(Text.translatable("text.sbutils.config.option.crateMode"))
.tooltip(Text.translatable("text.sbutils.config.option.crateMode.tooltip"))
.binding(
defaults.crateMode,
() -> config.crateMode,
(value) -> config.crateMode = value
)
.controller(EnumController::new)
.build())
.option(Option.createBuilder(double.class)
.name(Text.translatable("text.sbutils.config.option.crateDelay"))
.tooltip(Text.translatable("text.sbutils.config.option.crateDelay.tooltip"))
.binding(
defaults.crateDelay,
() -> config.crateDelay,
(value) -> config.crateDelay = value
)
.controller(DoubleFieldController::new)
.build())
.option(Option.createBuilder(double.class)
.name(Text.translatable("text.sbutils.config.option.crateDistance"))
.tooltip(Text.translatable("text.sbutils.config.option.crateDistance.tooltip"))
.binding(
defaults.crateDistance,
() -> config.crateDistance,
(value) -> config.crateDistance = value
)
.controller(DoubleFieldController::new)
.build())
.build())
.build();
}

private static ConfigCategory buildStaffDetectorCategory(ModConfig defaults, ModConfig config) {
return ConfigCategory.createBuilder()
.name(Text.translatable("text.sbutils.config.category.staffdetector"))
Expand Down
Loading

0 comments on commit 2006be1

Please sign in to comment.