Skip to content

Commit

Permalink
Fix more stuff + Fabric builds now
Browse files Browse the repository at this point in the history
  • Loading branch information
Deftu committed Jan 24, 2025
1 parent 8ce29da commit 0b1396e
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@file:Suppress("UnstableApiUsage", "PropertyName")

import dev.deftu.gradle.utils.GameSide
import dev.deftu.gradle.utils.MinecraftVersion
import dev.deftu.gradle.utils.includeOrShade

plugins {
java
Expand All @@ -10,8 +10,8 @@ plugins {
id("dev.deftu.gradle.tools") // Applies several configurations to things such as the Java version, project name/version, etc.
id("dev.deftu.gradle.tools.resources") // Applies resource processing so that we can replace tokens, such as our mod name/version, in our resources.
id("dev.deftu.gradle.tools.bloom") // Applies the Bloom plugin, which allows us to replace tokens in our source files, such as being able to use `@MOD_VERSION` in our source files.
id("dev.deftu.gradle.tools.shadow") // Applies the Shadow plugin, which allows us to shade our dependencies into our mod JAR. This is NOT recommended for Fabric mods, but we have an *additional* configuration for those!
id("dev.deftu.gradle.tools.minecraft.loom") // Applies the Loom plugin, which automagically configures Essential's Architectury Loom plugin for you.
id("dev.deftu.gradle.tools.shadow") // Applies the Shadow plugin, which allows us to shade our dependencies into our mod JAR. This is NOT recommended for Fabric mods, but we have an *additional* configuration for those!
id("dev.deftu.gradle.tools.minecraft.releases") // Applies the Minecraft auto-releasing plugin, which allows you to automatically release your mod to CurseForge and Modrinth.
}

Expand Down Expand Up @@ -45,7 +45,7 @@ toolkitLoomHelper {
}

dependencies {
implementation(shade("dev.deftu:commons-suncalc:0.1.0")!!)
implementation(includeOrShade("dev.deftu:commons-suncalc:0.1.0")!!)

// Add Fabric Language Kotlin and (Legacy) Fabric API as dependencies (these are both optional but are particularly useful).
if (mcData.isFabric) {
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pluginManagement {

plugins {
kotlin("jvm") version("2.0.0")
id("dev.deftu.gradle.multiversion-root") version("2.18.1")
id("dev.deftu.gradle.multiversion-root") version("2.22.0")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
import org.polyfrost.polytime.client.PolyTimeConfig;
import org.spongepowered.asm.mixin.*;

//#if MODERN==0
//#if MC <= 1.12.2
import net.minecraft.world.storage.WorldInfo;
//#else
//$$ import net.minecraft.client.multiplayer.ClientLevel;
//#endif

//#if MODERN == 0
//#if MC <= 1.12.2
@Mixin(WorldInfo.class)
//#else
//$$ @Mixin(ClientLevel.ClientLevelData.class)
//#endif
public class WorldInfoMixin {

//#if MODERN == 0
//#if MC <= 1.12.2
@Shadow
private long worldTime;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
import org.polyfrost.polytime.client.realtime.RealTimeHandler;
import org.spongepowered.asm.mixin.*;

//#if MODERN == 0
//#if MC <= 1.12.2
import net.minecraft.world.WorldProvider;
//#else
//$$ import net.minecraft.world.level.dimension.DimensionType;
//#endif

//#if MODERN == 0
//#if MC <= 1.12.2
@Mixin(WorldProvider.class)
//#else
//$$ @Mixin(DimensionType.class)
Expand All @@ -23,7 +23,7 @@ public class WorldProviderMixin {
*/
@Overwrite
public int
//#if MODERN == 0
//#if MC <= 1.12.2
getMoonPhase
//#else
//$$ moonPhase
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/org/polyfrost/polytime/PolyTimeEntrypoint.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import org.polyfrost.polytime.client.PolyTimeClient

//#if FORGE-LIKE
//#if MC >= 1.16.5
//$$ @Mod(ExampleConstants.ID)
//$$ @Mod(PolyTimeConstants.ID)
//#else
@Mod(modid = PolyTimeConstants.ID, version = PolyTimeConstants.VERSION)
//#endif
Expand All @@ -53,7 +53,7 @@ class PolyTimeEntrypoint
//#endif

//#if FABRIC
//$$ @Override
//$$ override
//#elseif FORGE && MC <= 1.12.2
@EventHandler
//#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ object RealTimeHandler {

currentlyUpdating = true

val (latitude, longitude) = obtainLongitudeLatitude() ?: return
val (longitude, latitude) = obtainLongitudeLatitude() ?: return
val times = SunTimes.compute()
.at(latitude, longitude)
.today()
Expand Down Expand Up @@ -118,9 +118,9 @@ object RealTimeHandler {
}

try {
val latitude = json.get("lat").asDouble
val longitude = json.get("lon").asDouble
return Pair(latitude, longitude)
val latitude = json.get("lat").asDouble
return Pair(longitude, latitude)
} catch (e: Exception) {
logger.error("Failed to obtain latitude and longitude from ip-api.com JSON", e)
return null
Expand Down
10 changes: 5 additions & 5 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"schemaVersion": 1,
"id": "${id}",
"name": "${name}",
"version": "${version}",
"id": "${mod_id}",
"name": "${mod_name}",
"version": "${mod_version}",
"description": "",
"authors": [
"PolyFrost",
Expand All @@ -16,12 +16,12 @@
"entrypoints": {
"client": [
{
"value": "org.polyfrost.polytime.PolyTimeFabric"
"value": "org.polyfrost.polytime.PolyTimeEntrypoint"
}
]
},
"mixins": [
"mixins.${id}.json"
"mixins.${mod_id}.json"
],
"license": "GPL 3.0",
"environment": "client"
Expand Down

0 comments on commit 0b1396e

Please sign in to comment.