Skip to content

Commit 4b371b8

Browse files
authored
Merge pull request #265 from UnicacityAddon/hotfix/2-0-1
hotfix/2-0-1
2 parents 12c9a35 + b418799 commit 4b371b8

25 files changed

Lines changed: 141 additions & 374 deletions

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ loader_version=0.17.3
1313
loom_version=1.14.1
1414

1515
# Mod Properties
16-
mod_version=2.0.0
16+
mod_version=2.0.1
1717
maven_group=de.rettichlp
1818
archives_base_name=ucutils
1919

src/main/java/de/rettichlp/ucutils/UCUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public void onInitialize() {
6464
client.execute(() -> {
6565
this.registry.registerListeners();
6666
renderService.initializeWidgets();
67-
syncService.sync(true);
67+
syncService.checkForUpdates();
6868
});
6969
});
7070

src/main/java/de/rettichlp/ucutils/command/MiCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public LiteralArgumentBuilder<FabricClientCommandSource> execute(@NotNull Litera
2929
.map(Faction::getDisplayName), builder))
3030
.executes(context -> {
3131
String input = getString(context, "faction");
32-
fromDisplayName(input).ifPresentOrElse(faction -> commandService.sendCommand("memberinfo " + faction.getMemberInfoCommandName()),
32+
fromDisplayName(input).ifPresentOrElse(faction -> commandService.sendCommand("memberinfo " + faction.getDisplayName()),
3333
() -> messageService.sendModMessage("Die Fraktion " + input + " konnte nicht gefunden werden.", false));
3434

3535
return 1;
@@ -38,7 +38,7 @@ public LiteralArgumentBuilder<FabricClientCommandSource> execute(@NotNull Litera
3838
.executes(context -> {
3939
String playerName = player.getGameProfile().name();
4040
Faction faction = storage.getFaction(playerName);
41-
commandService.sendCommand("memberinfo " + faction.getMemberInfoCommandName());
41+
commandService.sendCommand("memberinfo " + faction.getDisplayName());
4242
return 1;
4343
});
4444
}

src/main/java/de/rettichlp/ucutils/command/MiaCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public LiteralArgumentBuilder<FabricClientCommandSource> execute(@NotNull Litera
2929
.map(Faction::getDisplayName), builder))
3030
.executes(context -> {
3131
String input = getString(context, "faction");
32-
fromDisplayName(input).ifPresentOrElse(faction -> commandService.sendCommand("memberinfoall " + faction.getMemberInfoCommandName()),
32+
fromDisplayName(input).ifPresentOrElse(faction -> commandService.sendCommand("memberinfoall " + faction.getDisplayName()),
3333
() -> messageService.sendModMessage("Die Fraktion " + input + " konnte nicht gefunden werden.", false));
3434

3535
return 1;
@@ -38,7 +38,7 @@ public LiteralArgumentBuilder<FabricClientCommandSource> execute(@NotNull Litera
3838
.executes(context -> {
3939
String playerName = player.getGameProfile().name();
4040
Faction faction = storage.getFaction(playerName);
41-
commandService.sendCommand("memberinfoall " + faction.getMemberInfoCommandName());
41+
commandService.sendCommand("memberinfoall " + faction.getDisplayName());
4242
return 1;
4343
});
4444
}

src/main/java/de/rettichlp/ucutils/command/ModCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ public LiteralArgumentBuilder<FabricClientCommandSource> execute(@NotNull Litera
8080
.then(literal("sync")
8181
.then(literal("faction")
8282
.executes(context -> {
83-
syncService.syncFactionMembersWithCommandResponse();
83+
syncService.syncFactionMembersWithCommand(() -> {});
8484
return 1;
8585
}))
8686
.executes(context -> {
87-
syncService.sync(true);
87+
syncService.checkForUpdates();
8888
syncService.syncFactionSpecificData();
8989
return 1;
9090
}))

src/main/java/de/rettichlp/ucutils/command/money/DepositCommand.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import static de.rettichlp.ucutils.UCUtils.commandService;
1616
import static de.rettichlp.ucutils.UCUtils.messageService;
1717
import static de.rettichlp.ucutils.UCUtils.utilService;
18+
import static de.rettichlp.ucutils.common.services.CommandService.COMMAND_COOLDOWN_MILLIS;
1819
import static java.lang.Integer.parseInt;
1920
import static java.util.regex.Pattern.compile;
2021

@@ -38,7 +39,7 @@ public LiteralArgumentBuilder<FabricClientCommandSource> execute(@NotNull Litera
3839
} else {
3940
commandService.sendCommand("bank einzahlen " + amount);
4041
}
41-
}, 1000);
42+
}, COMMAND_COOLDOWN_MILLIS);
4243

4344
return 1;
4445
});

src/main/java/de/rettichlp/ucutils/command/money/RichTaxesCommand.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import static de.rettichlp.ucutils.UCUtils.messageService;
1212
import static de.rettichlp.ucutils.UCUtils.storage;
1313
import static de.rettichlp.ucutils.UCUtils.utilService;
14+
import static de.rettichlp.ucutils.common.services.CommandService.COMMAND_COOLDOWN_MILLIS;
1415

1516
@UCUtilsCommand(label = "reichensteuer")
1617
public class RichTaxesCommand extends CommandBase {
@@ -25,7 +26,7 @@ public LiteralArgumentBuilder<FabricClientCommandSource> execute(@NotNull Litera
2526
commandService.sendCommand("bank info");
2627

2728
// execute command to check money in atm
28-
utilService.delayedAction(() -> commandService.sendCommand("atminfo"), 1000);
29+
utilService.delayedAction(() -> commandService.sendCommand("atminfo"), COMMAND_COOLDOWN_MILLIS);
2930

3031
// handle money withdraw
3132
utilService.delayedAction(() -> {
@@ -52,7 +53,7 @@ public LiteralArgumentBuilder<FabricClientCommandSource> execute(@NotNull Litera
5253
commandService.sendCommand("bank abbuchen " + moneyAtmAmount);
5354
messageService.sendModMessage("Du musst noch " + (moneyThatNeedsToBeWithdrawn - moneyAtmAmount) + "$ abbuchen.", false);
5455
}
55-
}, 2000);
56+
}, COMMAND_COOLDOWN_MILLIS * 2);
5657

5758
return 1;
5859
});

src/main/java/de/rettichlp/ucutils/common/Storage.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import de.rettichlp.ucutils.common.models.BlackMarket;
44
import de.rettichlp.ucutils.common.models.BlacklistEntry;
55
import de.rettichlp.ucutils.common.models.BlacklistReason;
6-
import de.rettichlp.ucutils.common.models.CommandResponseRetriever;
76
import de.rettichlp.ucutils.common.models.ContractEntry;
87
import de.rettichlp.ucutils.common.models.Countdown;
98
import de.rettichlp.ucutils.common.models.Faction;
@@ -48,9 +47,6 @@ public class Storage {
4847
@Getter
4948
private final List<BlackMarket> blackMarkets = new ArrayList<>();
5049

51-
@Getter
52-
private final List<CommandResponseRetriever> commandResponseRetrievers = new ArrayList<>();
53-
5450
@Getter
5551
private final List<ContractEntry> contractEntries = new ArrayList<>();
5652

@@ -130,8 +126,6 @@ public void print() {
130126
this.blacklistReasons.forEach((faction, blacklistReasons) -> LOGGER.info("blacklistReasons[{}:{}]: {}", faction, blacklistReasons.size(), blacklistReasons));
131127
// blackMarkets
132128
LOGGER.info("blackMarkets[{}]: {}", this.blackMarkets.size(), this.blackMarkets);
133-
// commandResponseRetrievers
134-
LOGGER.info("commandResponseRetrievers[{}]: {}", this.commandResponseRetrievers.size(), this.commandResponseRetrievers);
135129
// contractEntries
136130
LOGGER.info("contractEntries[{}]: {}", this.contractEntries.size(), this.contractEntries);
137131
// countdowns

src/main/java/de/rettichlp/ucutils/common/api/Api.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import java.util.function.Consumer;
2626

2727
import static de.rettichlp.ucutils.UCUtils.LOGGER;
28-
import static de.rettichlp.ucutils.UCUtils.syncService;
2928
import static de.rettichlp.ucutils.UCUtils.utilService;
3029
import static java.lang.String.valueOf;
3130
import static java.net.URI.create;
@@ -80,11 +79,6 @@ private <T> void get(@NotNull String uri, TypeToken<T> typeToken, Consumer<T> ca
8079
}
8180

8281
private <T> void sendRequest(HttpRequest httpRequest, TypeToken<T> typeToken, Consumer<T> callback) {
83-
if (!syncService.dataUsageConfirmed()) {
84-
LOGGER.warn("Data usage not confirmed, skipping API request: [{}] {}", httpRequest.method(), httpRequest.uri().toString());
85-
return;
86-
}
87-
8882
this.httpClient.sendAsync(httpRequest, ofString())
8983
.thenApply(this::catchDefaultApiError)
9084
.thenApply(response -> ofNullable(typeToken)

src/main/java/de/rettichlp/ucutils/common/configuration/Configuration.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ public class Configuration {
4040
private int predictedPayDayExp = 0;
4141
@Nullable
4242
private LocalDateTime firstAidLicenseExpireDateTime = null;
43-
private int dataUsageConfirmationUID = 0;
4443
private Set<EventListener.HalloweenDoor> halloweenClickedDoors = new HashSet<>();
4544

4645
public void addMinutesSinceLastPayDay(int minutes) {

0 commit comments

Comments
 (0)