Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
a220523
Update loom_version to v1.17.11
renovate[bot] Jun 11, 2026
b98c236
Merge pull request #451 from UnicacityAddon/renovate/loom_version
rettichlp Jun 15, 2026
6e3b335
Update dependencies to Minecraft 26.1.2, Fabric Loader 0.19.3, and Fa…
rettichlp Jun 15, 2026
ce8dc16
Migrate build scripts to Kotlin DSL
rettichlp Jun 17, 2026
f71ffc2
Align with Minecraft 26.1.2 API changes
rettichlp Jun 17, 2026
c367dc1
Align option screens with Minecraft 26.1.2 API changes
rettichlp Jun 17, 2026
b9c0482
Align widgets with Minecraft 26.1.2 API changes
rettichlp Jun 17, 2026
5c66b51
Remove unused `HandledScreenMixin` and align remaining mixins with Mi…
rettichlp Jun 17, 2026
5cbffe9
Add Mod Menu integration and update build scripts for Mod Menu depend…
rettichlp Jun 17, 2026
eb8aee1
Align codebase to Minecraft 26.1.2 API changes and update affected co…
rettichlp Jun 17, 2026
54fdbca
Reformat code
rettichlp Jun 17, 2026
0b9371e
Rename mixins for consistency and update mixin configuration
rettichlp Jun 18, 2026
fd7d4ac
Update Gradle build script to include ClassIndex dependency and refac…
rettichlp Jun 18, 2026
278e60f
Update actions/checkout action to v7
renovate[bot] Jun 18, 2026
a84c2a8
Scale AFK nametags and adjust position for better readability
rettichlp Jun 18, 2026
416e681
Refactor component usage to remove unnecessary `.copy()` calls and ad…
rettichlp Jun 18, 2026
29ca974
Replace `StringWidget` with `MultiLineTextWidget` to fix text handlin…
rettichlp Jun 18, 2026
d993a26
Fix alignment of header in `UCUtilsScreen`
rettichlp Jun 18, 2026
d75f191
Remove `EntityMixin`, refactor minecart highlighting logic, and clean…
rettichlp Jun 18, 2026
588fc4f
Remove `RenderListener` and `IHudRenderListener`, integrate notificat…
rettichlp Jun 19, 2026
55ca30a
Merge pull request #452 from UnicacityAddon/feature/update-minecraft-…
rettichlp Jun 19, 2026
91f855f
Merge pull request #453 from UnicacityAddon/renovate/actions-checkout…
rettichlp Jun 19, 2026
e5bdd41
Update Gradle to v9.6.0
renovate[bot] Jun 19, 2026
4630e57
Merge pull request #454 from UnicacityAddon/renovate/gradle-9.x
rettichlp Jun 19, 2026
a5b50e2
Scale medical information nametags and adjust positions for consisten…
rettichlp Jun 19, 2026
072cb19
Merge pull request #455 from UnicacityAddon/bugfix/nametags-overlapping
rettichlp Jun 19, 2026
92292ab
Add `EntityMixin` to improve minecart highlighting logic and automate…
rettichlp Jun 19, 2026
7928cc7
Expand car lock/unlock patterns to support new automated locking and …
rettichlp Jun 19, 2026
065e190
Remove debug println from `EntityMixin` during minecart ride logic cl…
rettichlp Jun 19, 2026
a9c76e9
Merge pull request #456 from UnicacityAddon/bugfix/car-automation-not…
rettichlp Jun 19, 2026
7d25a53
Add `ResyncableTimer` to synchronize periodic tasks and integrate wit…
rettichlp Jun 20, 2026
c6c680c
Refactor periodic task handling by replacing `startRepeatingSync` and…
rettichlp Jun 20, 2026
85039fe
Adjust `synchronisedMinuteTimer` initialization and start timer durin…
rettichlp Jun 21, 2026
3e114de
Merge pull request #457 from UnicacityAddon/feature/synchronized-timer
rettichlp Jun 21, 2026
1b0ae0c
Fix `sendModMessage` to use `.copy()` for `modMessagePrefix` to ensur…
rettichlp Jun 21, 2026
24f69f9
Merge pull request #458 from UnicacityAddon/bugfix/mod-message-prefix…
rettichlp Jun 21, 2026
eedec7a
Move villager data handling to `ClientPacketListenerMixin` and remove…
rettichlp Jun 21, 2026
c2ba0e4
Merge pull request #459 from UnicacityAddon/bugfix/blackmarket-and-de…
rettichlp Jun 21, 2026
1b9c9ef
Replace deprecated `CyclingButtonWidget` with `CycleButton` in `Rende…
rettichlp Jun 21, 2026
8a8ec59
Merge pull request #460 from UnicacityAddon/bugfix/cyclebuttons-not-w…
rettichlp Jun 21, 2026
7603527
Add `BATTLEPASS_REWARD_PATTERN` to handle battle pass reward messages…
rettichlp Jun 23, 2026
44a2602
Refactor `PlayerMixin` to `LivingEntityMixin`, update shop location l…
rettichlp Jun 23, 2026
558eae3
Merge pull request #461 from UnicacityAddon/bugfix/battlepass-reward-…
rettichlp Jun 23, 2026
1fdbc85
Merge pull request #462 from UnicacityAddon/bugfix/shop-location-and-…
rettichlp Jun 23, 2026
5741548
Refactor player info handling in `ClientPacketListenerMixin` to optim…
rettichlp Jun 21, 2026
a028a55
Pathfinding: Add `@NonNull` annotation to `extractBackground` method …
rettichlp Jun 21, 2026
bf64e46
Refactor `ClientPlayNetworkHandlerMixin` to streamline player informa…
rettichlp Jun 25, 2026
16a3218
Merge pull request #463 from UnicacityAddon/feature/update-join-leave…
rettichlp Jun 25, 2026
571a0e9
Enable `devauth` property for the run client task in Loom configuration
rettichlp Jun 25, 2026
2e9e164
Merge pull request #464 from UnicacityAddon/feature/add-dev-auth-mod-…
rettichlp Jun 25, 2026
542a366
Refactor `AbstractContainerScreenMixin` to replace deprecated texture…
rettichlp Jun 26, 2026
4b768ee
Merge pull request #465 from UnicacityAddon/bugfix/medic-storage-butt…
rettichlp Jun 26, 2026
7bd0116
Add `EntityHitboxDebugRendererMixin` to customize player hitbox rende…
rettichlp Jun 26, 2026
420afcc
Enable `mixin.debug.export` property for the run client task in Loom …
rettichlp Jun 26, 2026
2cb45b7
Merge pull request #466 from UnicacityAddon/feature/faction-colored-h…
rettichlp Jun 26, 2026
c0eada3
Add player join delay check in `ClientPlayNetworkHandlerMixin` to ski…
rettichlp Jun 26, 2026
a2dbfb2
Adjust hydration bar sync logic to start from the first minute instea…
rettichlp Jun 26, 2026
bf2d169
Merge pull request #467 from UnicacityAddon/bugfix/unknown-network-pr…
rettichlp Jun 26, 2026
0c43f0c
Merge pull request #468 from UnicacityAddon/bugfix/health-sync-waitin…
rettichlp Jun 26, 2026
af8659f
Add version validation in `SyncService` to skip notifications for tes…
rettichlp Jun 26, 2026
2ab3dc6
Refine version regex in `SyncService` to ensure strict semantic versi…
rettichlp Jun 26, 2026
9949979
Merge pull request #469 from UnicacityAddon/bugfix/ignore-pre-version…
rettichlp Jun 26, 2026
e98dc6b
Add support for identifying and notifying the presence of summer trea…
rettichlp Jun 26, 2026
b57ab9f
Merge pull request #470 from UnicacityAddon/feature/summer-treasure-p…
rettichlp Jun 26, 2026
119bc35
Add support for identifying and notifying the presence of blood dealer
rettichlp Jun 26, 2026
2069b57
Merge pull request #471 from UnicacityAddon/feature/blood-dealer-pres…
rettichlp Jun 26, 2026
ba160bf
Add `Company` enum and `StockMarketEntry` record to model company-rel…
rettichlp Jun 26, 2026
34e6b58
Refactor `AbstractContainerScreenMixin` to extract medic storage butt…
rettichlp Jun 26, 2026
44fb445
Add stock market legend and highlight functionality to `AbstractConta…
rettichlp Jun 26, 2026
bf9bc93
Merge pull request #472 from UnicacityAddon/feature/stock-market-high…
rettichlp Jun 26, 2026
273e647
Align ShutdownScreen components horizontally to center for improved U…
rettichlp Jun 26, 2026
a0d7633
Merge pull request #473 from UnicacityAddon/bugfix/shutdown-screen-no…
rettichlp Jun 26, 2026
1568e88
Update Gradle to v9.6.1
renovate[bot] Jun 26, 2026
c12816f
Remove redundant ownership check in `StockMarketEntry` validation logic
rettichlp Jun 26, 2026
3569ad4
Add error handling for ingredient parsing in `MedicListener` to preve…
rettichlp Jun 26, 2026
ccd8b6e
Merge pull request #474 from UnicacityAddon/renovate/gradle-9.x
rettichlp Jun 26, 2026
b2ba492
Merge pull request #475 from UnicacityAddon/bugfix/fix-stock-market-n…
rettichlp Jun 26, 2026
339da07
Merge pull request #476 from UnicacityAddon/bugfix/numberformatexcept…
rettichlp Jun 26, 2026
be9f5a6
Update `release.yml` to use dynamic branch reference for release crea…
rettichlp Jun 26, 2026
155dc74
Merge pull request #477 from UnicacityAddon/bugfix/release-workflow-t…
rettichlp Jun 26, 2026
5a74312
Add delay before sending hydration command to ensure accurate afk sta…
rettichlp Jun 28, 2026
03af765
Merge pull request #478 from UnicacityAddon/bugfix/sometimes-health-c…
rettichlp Jun 28, 2026
a652080
Add less annoying notification for maximum experience reached and sup…
rettichlp Jun 30, 2026
047fbe2
Merge pull request #479 from UnicacityAddon/feature/less-annoying-lev…
rettichlp Jul 7, 2026
8c7a8ee
Add integration for The Rettington Companion with support for notific…
rettichlp Jul 7, 2026
62825bb
Remove UCUtils widget system and migrate relevant widgets to The Rett…
rettichlp Jul 7, 2026
515c8be
Migrate widget rendering and options system to The Rettington Compani…
rettichlp Jul 9, 2026
88af10b
Migrate countdown logic to The Rettington Companion notification syst…
rettichlp Jul 9, 2026
0fa1cdb
Broaden regex for Battle Pass reward pattern to support additional pa…
rettichlp Jul 10, 2026
4057aa5
Update LivingEntityMixin to adjust injection timing and fix item cond…
rettichlp Jul 10, 2026
493d6d0
Refactor LivingEntityMixin to LocalPlayerMixin and update drop method…
rettichlp Jul 10, 2026
eff3828
Merge pull request #482 from UnicacityAddon/bugfix/battlepass-money-e…
rettichlp Jul 10, 2026
3c2665f
Merge pull request #483 from UnicacityAddon/bugfix/auto-sell-pfand-no…
rettichlp Jul 10, 2026
88188a0
Refactor countdown logic to directly create notifications for The Ret…
rettichlp Jul 10, 2026
091e1e9
Add Modrinth repository and update The Rettington Companion dependenc…
rettichlp Jul 10, 2026
b8cbd8d
Merge pull request #481 from UnicacityAddon/feature/notifications
rettichlp Jul 10, 2026
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
with:
fetch-depth: 0

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
with:
fetch-depth: 0

Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
tag: ${{ inputs.version }}
run: |
gh release create "$tag" \
--target main \
--target "${{ github.ref_name }}" \
--repo="$GITHUB_REPOSITORY" \
--title="$tag" \
--generate-notes \
Expand Down
72 changes: 48 additions & 24 deletions build.gradle → build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,52 +1,67 @@
import org.gradle.api.JavaVersion.VERSION_25

plugins {
id 'net.fabricmc.fabric-loom-remap' version "${loom_version}"
id 'maven-publish'
id("net.fabricmc.fabric-loom")
`maven-publish`
}

version = project.mod_version
group = project.maven_group
version = providers.gradleProperty("mod_version").get()
group = providers.gradleProperty("maven_group").get()

repositories {
// Add repositories to retrieve artifacts from in here.
// You should only use this when depending on other mods because
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
// for more information about repositories.
mavenCentral()

maven {
name = "Terraformers"
url = uri("https://maven.terraformersmc.com/")
}

maven {
name = "Modrinth"
url = uri("https://api.modrinth.com/maven")
}
}

dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
minecraft("com.mojang:minecraft:${providers.gradleProperty("minecraft_version").get()}")

implementation("net.fabricmc:fabric-loader:${providers.gradleProperty("loader_version").get()}")

// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
implementation("net.fabricmc.fabric-api:fabric-api:${providers.gradleProperty("fabric_api_version").get()}")

// https://mvnrepository.com/artifact/org.projectlombok/lombok
compileOnly("org.projectlombok:lombok:1.18.46")
annotationProcessor("org.projectlombok:lombok:1.18.46")

testCompileOnly("org.projectlombok:lombok:1.18.46")
testAnnotationProcessor("org.projectlombok:lombok:1.18.46")
// https://github.com/TerraformersMC/ModMenu
compileOnly("com.terraformersmc:modmenu:${providers.gradleProperty("modmenu_version").get()}")

// https://github.com/atteo/classindex
include("org.atteo.classindex:classindex:3.13")
implementation("org.atteo.classindex:classindex:3.13")
annotationProcessor('org.atteo.classindex:classindex:3.13')
annotationProcessor("org.atteo.classindex:classindex:3.13")

compileOnly("maven.modrinth:the-rettington-companion:2.0.0")
}

processResources {
def version = project.version
inputs.property "version", version
tasks.processResources {
val version = version
inputs.property("version", version)

filesMatching("fabric.mod.json") {
expand "version": version
expand("version" to version)
}
}

tasks.withType(JavaCompile).configureEach {
it.options.release = 21
tasks.withType<JavaCompile>().configureEach {
options.release = 25
}

java {
Expand All @@ -55,13 +70,13 @@ java {
// If you remove this line, sources will not be generated.
withSourcesJar()

sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
sourceCompatibility = VERSION_25
targetCompatibility = VERSION_25
}

jar {
def projectName = project.name
inputs.property "projectName", projectName
tasks.jar {
val projectName = project.name
inputs.property("projectName", projectName)

from("LICENSE") {
rename { "${it}_$projectName" }
Expand All @@ -71,8 +86,8 @@ jar {
// configure the maven publication
publishing {
publications {
create("mavenJava", MavenPublication) {
from components.java
register<MavenPublication>("mavenJava") {
from(components["java"])
}
}

Expand All @@ -84,3 +99,12 @@ publishing {
// retrieving dependencies.
}
}

loom {
runs {
named("client") {
property("devauth.enabled", "1")
property("mixin.debug.export", "true")
}
}
}
12 changes: 7 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ org.gradle.configuration-cache=false

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.21.10
yarn_mappings=1.21.10+build.3
loader_version=0.19.2
loom_version=1.17.3
minecraft_version=26.1.2
loader_version=0.19.3
loom_version=1.17.11

# Mod Properties
mod_version=0.0.0
maven_group=de.rettichlp

# Dependencies
fabric_api_version=0.138.4+1.21.10
fabric_api_version=0.151.0+26.1.2

# External mods
modmenu_version=18.0.0-beta.1
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.1-bin.zip
networkTimeout=10000
retries=0
retryBackOffMs=500
Expand Down
4 changes: 2 additions & 2 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 0 additions & 13 deletions settings.gradle

This file was deleted.

17 changes: 17 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
pluginManagement {
repositories {
maven {
name = "Fabric"
url = uri("https://maven.fabricmc.net/")
}
mavenCentral()
gradlePluginPortal()
}

plugins {
id("net.fabricmc.fabric-loom") version providers.gradleProperty("loom_version")
}
}

// Should match your modid
rootProject.name = "ucutils"
49 changes: 41 additions & 8 deletions src/main/java/de/rettichlp/ucutils/UCUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,22 @@
import de.rettichlp.ucutils.common.services.NameTagService;
import de.rettichlp.ucutils.common.services.NotificationService;
import de.rettichlp.ucutils.common.services.RenderService;
import de.rettichlp.ucutils.common.services.ResyncableTimer;
import de.rettichlp.ucutils.common.services.SyncService;
import de.rettichlp.ucutils.common.services.UtilService;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientLifecycleEvents;
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayConnectionEvents;
import net.minecraft.client.network.ClientPlayNetworkHandler;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.client.multiplayer.ClientPacketListener;
import net.minecraft.client.player.LocalPlayer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static java.lang.Boolean.getBoolean;
import static java.lang.System.currentTimeMillis;
import static java.util.Objects.isNull;
import static java.util.concurrent.TimeUnit.MINUTES;

public class UCUtils implements ModInitializer {

Expand All @@ -44,9 +46,10 @@ public class UCUtils implements ModInitializer {
public static final Api api = new Api();
public static final Storage storage = new Storage();
public static final Configuration configuration = new Configuration().loadFromFile();
public static final ResyncableTimer synchronisedMinuteTimer = new ResyncableTimer(1, 1, MINUTES);

public static ClientPlayerEntity player;
public static ClientPlayNetworkHandler networkHandler;
public static LocalPlayer player;
public static ClientPacketListener networkHandler;

private static final String NEOPROTECT_ENTRYPOINT = "c970141b-0cca-4ad2-894b-21ac9c171cbe.shield.neoprotect.ovh";

Expand All @@ -55,13 +58,44 @@ public class UCUtils implements ModInitializer {
@Override
public void onInitialize() {
// This entrypoint is suitable for setting up client-specific logic, such as rendering.
synchronisedMinuteTimer.start();

syncService.syncFactionMembers();
syncService.syncTeamMembers();

this.registry.registerSounds();

syncService.startRepeatingSync();
// add payday minute
synchronisedMinuteTimer.add(_ -> {
if (storage.isUnicaCity() && !nameTagService.isAfk(player.getPlainTextName())) {
configuration.setMinutesSinceLastPayDay(configuration.getMinutesSinceLastPayDay() + 1);
}
});

// show health for hydration bar sync
synchronisedMinuteTimer.add(currentTick -> {
// every 3 minutes starting from first (not third) minute
if ((currentTick + 2) % 3 != 0) {
return;
}

// delayed to wait for afk message if in same minute
utilService.delayedAction(() -> {
if (storage.isUnicaCity() && !nameTagService.isAfk(player.getPlainTextName()) && configuration.getOptions().showHydration()) {
commandService.sendCommandWithHiddenOutput("health");
}
}, 50);
});

// asynchronously save every 10 minutes
synchronisedMinuteTimer.add(currentTick -> {
// every 10 minutes
if (currentTick % 10 != 0) {
return;
}

new Thread(configuration::saveToFile).start();
});

ClientPlayConnectionEvents.JOIN.register((handler, sender, client) -> {
player = client.player;
Expand All @@ -73,7 +107,6 @@ public void onInitialize() {
if (isUnicaCity) {
client.execute(() -> {
this.registry.registerListeners();
renderService.initializeWidgets();
utilService.delayedAction(syncService::syncFactionSpecificData, 10000);
utilService.delayedAction(syncService::checkForUpdates, 15000);
});
Expand All @@ -85,7 +118,7 @@ public void onInitialize() {
ClientLifecycleEvents.CLIENT_STOPPING.register(client -> configuration.saveToFile());
}

private boolean isUnicaCity(ClientPlayNetworkHandler networkHandler) {
private boolean isUnicaCity(ClientPacketListener networkHandler) {
if (getBoolean("fabric.development") || !configuration.getOptions().checkUnicacityServer()) {
return true;
}
Expand All @@ -95,7 +128,7 @@ private boolean isUnicaCity(ClientPlayNetworkHandler networkHandler) {
return false;
}

String addressString = networkHandler.getConnection().getAddress().toString();
String addressString = networkHandler.getConnection().getRemoteAddress().toString();
// for LabyMod players, there is no dot at the end of the domain
if (!addressString.matches(NEOPROTECT_ENTRYPOINT + "\\.?/\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}:\\d+")) {
LOGGER.warn("Not connected to UnicaCity: {}", addressString);
Expand Down
Loading