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
17 changes: 15 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.10-SNAPSHOT'
id 'fabric-loom'
id 'maven-publish'
}

Expand Down Expand Up @@ -54,10 +54,23 @@ dependencies {
}

processResources {
// Keep fabric.mod.json versions in sync with gradle.properties
inputs.property "version", project.version
inputs.property "loader_version", project.loader_version
inputs.property "minecraft_version", project.minecraft_version
inputs.property "fabric_version", project.fabric_version
inputs.property "cloth_config_version", project.cloth_config_version
inputs.property "modmenu_version", project.modmenu_version

filesMatching("fabric.mod.json") {
expand "version": inputs.properties.version
expand(
"version": inputs.properties.version,
"loader_version": inputs.properties.loader_version,
"minecraft_version": inputs.properties.minecraft_version,
"fabric_version": inputs.properties.fabric_version,
"cloth_config_version": inputs.properties.cloth_config_version,
"modmenu_version": inputs.properties.modmenu_version
)
}
}

Expand Down
13 changes: 7 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ org.gradle.parallel=true

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.21.8
yarn_mappings=1.21.8+build.1
loader_version=0.16.14
minecraft_version=1.21.11
yarn_mappings=1.21.11+build.3
loader_version=0.18.2
loom_version=1.14-SNAPSHOT

# Mod Properties
mod_version=0.1.4
maven_group=fr.sukikui.playercoordsapi
archives_base_name=playercoordsapi

# Dependencies
fabric_version=0.129.0+1.21.8
modmenu_version=9.0.0
cloth_config_version=13.0.121
fabric_version=0.139.5+1.21.11
modmenu_version=15.0.0
cloth_config_version=21.11.151
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-8.12.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
10 changes: 9 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
pluginManagement {
def loomVersion = providers.gradleProperty("loom_version").orElse(null)
if (loomVersion == null) {
throw new GradleException("Missing 'loom_version' in gradle.properties")
}

repositories {
maven {
name = 'Fabric'
Expand All @@ -7,4 +12,7 @@ pluginManagement {
mavenCentral()
gradlePluginPortal()
}
}
plugins {
id "fabric-loom" version loomVersion
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.registry.entry.RegistryEntry;
import net.minecraft.world.biome.Biome;
Expand Down Expand Up @@ -98,16 +99,17 @@ private void handleCoordsRequest(HttpExchange exchange) throws IOException {
// Get player coordinates
MinecraftClient client = MinecraftClient.getInstance();
PlayerEntity player = client.player;
ClientWorld worldObj = client.world;

String responseText;
if (player != null) {
if (player != null && worldObj != null) {
double x = player.getX();
double y = player.getY();
double z = player.getZ();
String world = player.getWorld().getRegistryKey().getValue().toString();
String world = worldObj.getRegistryKey().getValue().toString();

// Get biome information
RegistryEntry<Biome> biomeEntry = player.getWorld().getBiome(player.getBlockPos());
RegistryEntry<Biome> biomeEntry = worldObj.getBiome(player.getBlockPos());
String biome = biomeEntry.getKey().orElseThrow().getValue().toString();

// Get player UUID and username
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/assets/playercoordsapi/lang/de_de.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"text.autoconfig.playercoordsapi.title": "PlayerCoordsAPI",
"text.autoconfig.playercoordsapi.option.enabled": "Mod aktivieren",
"text.autoconfig.playercoordsapi.option.enabled.@Tooltip": "PlayerCoordsAPI aktivieren oder deaktivieren"
}
5 changes: 5 additions & 0 deletions src/main/resources/assets/playercoordsapi/lang/es_es.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"text.autoconfig.playercoordsapi.title": "PlayerCoordsAPI",
"text.autoconfig.playercoordsapi.option.enabled": "Activar el mod",
"text.autoconfig.playercoordsapi.option.enabled.@Tooltip": "Activar o desactivar PlayerCoordsAPI"
}
5 changes: 5 additions & 0 deletions src/main/resources/assets/playercoordsapi/lang/it_it.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"text.autoconfig.playercoordsapi.title": "PlayerCoordsAPI",
"text.autoconfig.playercoordsapi.option.enabled": "Abilita mod",
"text.autoconfig.playercoordsapi.option.enabled.@Tooltip": "Abilita o disabilita PlayerCoordsAPI"
}
5 changes: 5 additions & 0 deletions src/main/resources/assets/playercoordsapi/lang/ja_jp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"text.autoconfig.playercoordsapi.title": "PlayerCoordsAPI",
"text.autoconfig.playercoordsapi.option.enabled": "Modを有効にする",
"text.autoconfig.playercoordsapi.option.enabled.@Tooltip": "PlayerCoordsAPIを有効または無効にします"
}
5 changes: 5 additions & 0 deletions src/main/resources/assets/playercoordsapi/lang/pt_br.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"text.autoconfig.playercoordsapi.title": "PlayerCoordsAPI",
"text.autoconfig.playercoordsapi.option.enabled": "Ativar o mod",
"text.autoconfig.playercoordsapi.option.enabled.@Tooltip": "Ativar ou desativar o PlayerCoordsAPI"
}
5 changes: 5 additions & 0 deletions src/main/resources/assets/playercoordsapi/lang/ru_ru.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"text.autoconfig.playercoordsapi.title": "PlayerCoordsAPI",
"text.autoconfig.playercoordsapi.option.enabled": "Включить мод",
"text.autoconfig.playercoordsapi.option.enabled.@Tooltip": "Включить или отключить PlayerCoordsAPI"
}
5 changes: 5 additions & 0 deletions src/main/resources/assets/playercoordsapi/lang/zh_cn.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"text.autoconfig.playercoordsapi.title": "PlayerCoordsAPI",
"text.autoconfig.playercoordsapi.option.enabled": "启用模组",
"text.autoconfig.playercoordsapi.option.enabled.@Tooltip": "启用或禁用 PlayerCoordsAPI"
}
12 changes: 6 additions & 6 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@
}
],
"depends": {
"fabricloader": ">=0.16.14",
"minecraft": "~1.21.8",
"fabricloader": ">=${loader_version}",
"minecraft": "~${minecraft_version}",
"java": ">=21",
"fabric-api": "*",
"cloth-config": ">=13.0.0"
"fabric-api": ">=${fabric_version}",
"cloth-config": ">=${cloth_config_version}"
},
"recommends": {
"modmenu": ">=9.0.0"
"modmenu": ">=${modmenu_version}"
},
"suggests": {
"another-mod": "*"
}
}
}
Loading