Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ public class CarOptions {
private boolean highlight = true;
private boolean automatedLock = true;
private boolean automatedStart = true;
private boolean automatedCheckKfz = true;
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public class CarOptionsScreen extends OptionsScreen {
private static final Text CAR_AUTOMATION_LOCK_TOOLTIP = translatable("ucutils.options.car.automation.lock.tooltip");
private static final Text CAR_AUTOMATION_START_NAME = translatable("ucutils.options.car.automation.start.name");
private static final Text CAR_AUTOMATION_START_TOOLTIP = translatable("ucutils.options.car.automation.start.tooltip");
private static final Text CAR_AUTOMATION_CHECK_KFZ_NAME = translatable("ucutils.options.car.automation.check_kfz.name");
private static final Text CAR_AUTOMATION_CHECK_KFZ_TOOLTIP = translatable("ucutils.options.car.automation.check_kfz.tooltip");

public CarOptionsScreen(Screen parent) {
super(parent, TEXT_CAR);
Expand All @@ -42,13 +44,17 @@ public void initBody() {
renderService.addToggleButton(directionalLayoutWidget1, CAR_GENERAL_FAST_FIND_NAME, CAR_GENERAL_FAST_FIND_TOOLTIP, (options, value) -> options.car().fastFind(value), options -> options.car().fastFind(), 150);
renderService.addToggleButton(directionalLayoutWidget1, CAR_GENERAL_FAST_LOCK_NAME, CAR_GENERAL_FAST_LOCK_TOOLTIP, (options, value) -> options.car().fastLock(value), options -> options.car().fastLock(), 150);

renderService.addToggleButton(directionalLayoutWidget, CAR_GENERAL_HIGHLIGHT_NAME, CAR_GENERAL_HIGHLIGHT_TOOLTIP, (options, value) -> options.car().highlight(value), options -> options.car().highlight(), 308);
DirectionalLayoutWidget directionalLayoutWidget2 = directionalLayoutWidget.add(horizontal().spacing(8));
renderService.addToggleButton(directionalLayoutWidget2, CAR_GENERAL_HIGHLIGHT_NAME, CAR_GENERAL_HIGHLIGHT_TOOLTIP, (options, value) -> options.car().highlight(value), options -> options.car().highlight(), 150);

directionalLayoutWidget.add(new TextWidget(TEXT_AUTOMATION, this.textRenderer), positioner -> positioner.alignHorizontalCenter().marginTop(16));

DirectionalLayoutWidget directionalLayoutWidget2 = directionalLayoutWidget.add(horizontal().spacing(8));
renderService.addToggleButton(directionalLayoutWidget2, CAR_AUTOMATION_LOCK_NAME, CAR_AUTOMATION_LOCK_TOOLTIP, (options, value) -> options.car().automatedLock(value), options -> options.car().automatedLock(), 150);
renderService.addToggleButton(directionalLayoutWidget2, CAR_AUTOMATION_START_NAME, CAR_AUTOMATION_START_TOOLTIP, (options, value) -> options.car().automatedStart(value), options -> options.car().automatedStart(), 150);
DirectionalLayoutWidget directionalLayoutWidget3 = directionalLayoutWidget.add(horizontal().spacing(8));
renderService.addToggleButton(directionalLayoutWidget3, CAR_AUTOMATION_LOCK_NAME, CAR_AUTOMATION_LOCK_TOOLTIP, (options, value) -> options.car().automatedLock(value), options -> options.car().automatedLock(), 150);
renderService.addToggleButton(directionalLayoutWidget3, CAR_AUTOMATION_START_NAME, CAR_AUTOMATION_START_TOOLTIP, (options, value) -> options.car().automatedStart(value), options -> options.car().automatedStart(), 150);

DirectionalLayoutWidget directionalLayoutWidget4 = directionalLayoutWidget.add(horizontal().spacing(8));
renderService.addToggleButton(directionalLayoutWidget4, CAR_AUTOMATION_CHECK_KFZ_NAME, CAR_AUTOMATION_CHECK_KFZ_TOOLTIP, (options, value) -> options.car().automatedCheckKfz(value), options -> options.car().automatedCheckKfz(), 150);

directionalLayoutWidget.forEachChild(this::addDrawableChild);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

import static de.rettichlp.ucutils.UCUtils.commandService;
import static de.rettichlp.ucutils.UCUtils.configuration;
import static de.rettichlp.ucutils.UCUtils.storage;
import static java.lang.System.currentTimeMillis;

Expand All @@ -28,7 +29,7 @@ public abstract class MinecartEntityMixin {
}

Entity entity = (Entity) (Object) this;
if (entity instanceof MinecartEntity && player.isSneaking() && currentTimeMillis() - this.lastClick > 1000) {
if (configuration.getOptions().car().automatedCheckKfz() && entity instanceof MinecartEntity && player.isSneaking() && currentTimeMillis() - this.lastClick > 1000) {
commandService.sendCommand("checkkfz");
this.lastClick = currentTimeMillis();
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/ucutils/lang/de_de.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
"ucutils.options.car.automation.lock.tooltip": "Schließt das Auto automatisch ab, wenn du den Motor startest",
"ucutils.options.car.automation.start.name": "Automatisches Starten",
"ucutils.options.car.automation.start.tooltip": "Startet das Auto automatisch, wenn du einsteigst",
"ucutils.options.car.automation.check_kfz.name": "Automatisches /checkkfz",
"ucutils.options.car.automation.check_kfz.tooltip": "Führt /checkkfz aus wenn du ein Auto rechtsklickst während du schleichst",
"ucutils.options.nametag.a_duty.name": "Admin-Dienst",
"ucutils.options.nametag.a_duty.tooltip": "Zeigt eine Information an über dem Namen von Spielern, die im Admin-Dienst sind",
"ucutils.options.nametag.afk.name": "AFK",
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/ucutils/lang/en_gb.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
"ucutils.options.car.automation.lock.tooltip": "Locks the car automatically when you start the engine",
"ucutils.options.car.automation.start.name": "Automated starting",
"ucutils.options.car.automation.start.tooltip": "Starts the car automatically when you enter it",
"ucutils.options.car.automation.check_kfz.name": "Automated /checkkfz",
"ucutils.options.car.automation.check_kfz.tooltip": "Automatically executes /checkkfz when you right click your car while sneaking",
"ucutils.options.nametag.a_duty.name": "Admin duty",
"ucutils.options.nametag.a_duty.tooltip": "Shows an information above the players name of players in admin duty",
"ucutils.options.nametag.afk.name": "AFK",
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/ucutils/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
"ucutils.options.car.automation.lock.tooltip": "Locks the car automatically when you start the engine",
"ucutils.options.car.automation.start.name": "Automated starting",
"ucutils.options.car.automation.start.tooltip": "Starts the car automatically when you enter it",
"ucutils.options.car.automation.check_kfz.name": "Automated /checkkfz",
"ucutils.options.car.automation.check_kfz.tooltip": "Automatically executes /checkkfz when you right click your car while sneaking",
"ucutils.options.nametag.a_duty.name": "Admin duty",
"ucutils.options.nametag.a_duty.tooltip": "Shows an information above the players name of players in admin duty",
"ucutils.options.nametag.afk.name": "AFK",
Expand Down