Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
192735d352
|
|||
|
216a498d72
|
|||
|
|
d7dbf65446 | ||
|
|
3e282612a3 |
@@ -1,6 +1,6 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id "architectury-plugin" version "3.4-SNAPSHOT"
|
id "architectury-plugin" version "3.4-SNAPSHOT"
|
||||||
id "dev.architectury.loom" version "1.7-SNAPSHOT" apply false
|
id "dev.architectury.loom" version "1.10-SNAPSHOT" apply false
|
||||||
}
|
}
|
||||||
|
|
||||||
architectury {
|
architectury {
|
||||||
|
|||||||
@@ -145,8 +145,8 @@ public class Client {
|
|||||||
default -> 0;
|
default -> 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
int yPos = getPos(graphics, width, Config.getYPosition(), false);
|
int yPos = getPosImp(graphics, width, Config.getYPosition(), false);
|
||||||
int xPos = getPos(graphics, width, Config.getXPosition(), true);
|
int xPos = getPosImp(graphics, width, Config.getXPosition(), true);
|
||||||
|
|
||||||
int lineHeight = Minecraft.getInstance().font.lineHeight;
|
int lineHeight = Minecraft.getInstance().font.lineHeight;
|
||||||
|
|
||||||
@@ -223,6 +223,22 @@ public class Client {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static int getPosImp(GuiGraphics event, int width, String input, boolean isXPosition){
|
||||||
|
input = input.trim();
|
||||||
|
input = input
|
||||||
|
.replaceAll("(W+)|(H+)", String.valueOf(isXPosition?event.guiWidth():event.guiHeight()))
|
||||||
|
.replaceAll("(w+)|(h+)", String.valueOf(isXPosition?event.guiWidth()/2:event.guiHeight()/2))
|
||||||
|
.replaceAll("(S+)|(s+)", String.valueOf(width));
|
||||||
|
if((Config.isDebug()) && Config.getCounter() < 2) {
|
||||||
|
//String speedDisplayType = SpeedTypes.getName(Config.getSpeedType()).getString();
|
||||||
|
//String splitRawSpeedPosition = Arrays.toString(passerPose.toArray());
|
||||||
|
//String rawSpeedPosition = isXPosition ? Config.getXPosition() : Config.getYPosition();
|
||||||
|
LOGGER.info("Selected speed type(DEBUG): {}\n{}\n\n\n", isXPosition, input);
|
||||||
|
Config.addCounter();
|
||||||
|
}
|
||||||
|
return getPos(event, width, input, isXPosition);
|
||||||
|
}
|
||||||
|
|
||||||
private static int getPos(GuiGraphics event, int width, String input, boolean isXPosition) {
|
private static int getPos(GuiGraphics event, int width, String input, boolean isXPosition) {
|
||||||
ArrayList<String> passerPose = new ArrayList<>();
|
ArrayList<String> passerPose = new ArrayList<>();
|
||||||
final char[] s = input.toCharArray();
|
final char[] s = input.toCharArray();
|
||||||
|
|||||||
@@ -3,27 +3,27 @@ org.gradle.jvmargs=-Xmx8G
|
|||||||
minecraft_version=1.21.4
|
minecraft_version=1.21.4
|
||||||
|
|
||||||
archives_base_name=speedometer
|
archives_base_name=speedometer
|
||||||
mod_version=6.2.2
|
mod_version=6.2.3
|
||||||
maven_group=me.zacharias
|
maven_group=me.zacharias
|
||||||
|
|
||||||
# https://modrinth.com/mod/architectury-api/versions
|
# https://modrinth.com/mod/architectury-api/versions
|
||||||
architectury_version=15.0.1
|
architectury_version=15.0.3
|
||||||
|
|
||||||
# https://modrinth.com/mod/cloth-config/versions
|
# https://modrinth.com/mod/cloth-config/versions
|
||||||
cloth_config_version = 17.0.144
|
cloth_config_version = 17.0.144
|
||||||
|
|
||||||
# NeoForged Only
|
# NeoForged Only
|
||||||
# https://neoforged.net/
|
# https://neoforged.net/
|
||||||
neoforge_version = 21.4.30-beta
|
neoforge_version = 21.4.123
|
||||||
|
|
||||||
# Fabric Only
|
# Fabric Only
|
||||||
# https://fabricmc.net/develop/
|
# https://fabricmc.net/develop/
|
||||||
fabric_loader_version=0.16.9
|
fabric_loader_version=0.16.10
|
||||||
fabric_api_version=0.112.1
|
fabric_api_version=0.119.2
|
||||||
|
|
||||||
# Fabric Only
|
# Fabric Only
|
||||||
# https://modrinth.com/mod/modmenu/versions
|
# https://modrinth.com/mod/modmenu/versions
|
||||||
modmenu_version = 13.0.0-beta.1
|
modmenu_version = 13.0.3
|
||||||
|
|
||||||
# Version of the org.json json library
|
# Version of the org.json json library
|
||||||
json_version = 20240303
|
json_version = 20240303
|
||||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
|||||||
#Fri Jun 21 10:45:53 CEST 2024
|
#Fri Jun 21 10:45:53 CEST 2024
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package me.zacharias.speedometer.forge;
|
|||||||
|
|
||||||
import com.mojang.datafixers.util.Unit;
|
import com.mojang.datafixers.util.Unit;
|
||||||
import me.zacharias.speedometer.Speedometer;
|
import me.zacharias.speedometer.Speedometer;
|
||||||
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.server.packs.resources.ResourceManager;
|
import net.minecraft.server.packs.resources.ResourceManager;
|
||||||
import net.minecraft.server.packs.resources.SimplePreparableReloadListener;
|
import net.minecraft.server.packs.resources.SimplePreparableReloadListener;
|
||||||
import net.minecraft.util.profiling.ProfilerFiller;
|
import net.minecraft.util.profiling.ProfilerFiller;
|
||||||
@@ -11,10 +12,12 @@ import net.neoforged.bus.api.SubscribeEvent;
|
|||||||
import net.neoforged.fml.common.EventBusSubscriber;
|
import net.neoforged.fml.common.EventBusSubscriber;
|
||||||
import net.neoforged.fml.common.Mod;
|
import net.neoforged.fml.common.Mod;
|
||||||
import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent;
|
import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent;
|
||||||
import net.neoforged.neoforge.client.event.RegisterClientReloadListenersEvent;
|
import net.neoforged.neoforge.client.event.AddClientReloadListenersEvent;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
@Mod(Speedometer.MOD_ID)
|
import static me.zacharias.speedometer.Speedometer.MOD_ID;
|
||||||
|
|
||||||
|
@Mod(MOD_ID)
|
||||||
public class SpeedometerNeoForge {
|
public class SpeedometerNeoForge {
|
||||||
public SpeedometerNeoForge(IEventBus eventBus) {
|
public SpeedometerNeoForge(IEventBus eventBus) {
|
||||||
// Submit our event bus to let architectury register our content on the right time
|
// Submit our event bus to let architectury register our content on the right time
|
||||||
@@ -24,7 +27,7 @@ public class SpeedometerNeoForge {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusSubscriber(modid = Speedometer.MOD_ID, bus = EventBusSubscriber.Bus.MOD, value = Dist.CLIENT)
|
@EventBusSubscriber(modid = MOD_ID, bus = EventBusSubscriber.Bus.MOD, value = Dist.CLIENT)
|
||||||
class EventHandler
|
class EventHandler
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -34,8 +37,8 @@ class EventHandler
|
|||||||
* @param event The event that is fired when the client reloads resources
|
* @param event The event that is fired when the client reloads resources
|
||||||
*/
|
*/
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
private static void onResourceReload(RegisterClientReloadListenersEvent event) {
|
private static void onResourceReload(AddClientReloadListenersEvent event) {
|
||||||
event.registerReloadListener(new SimplePreparableReloadListener<Unit>() {
|
event.addListener(ResourceLocation.fromNamespaceAndPath(MOD_ID, "reload_listener"), new SimplePreparableReloadListener<Unit>() {
|
||||||
@Override
|
@Override
|
||||||
protected @NotNull Unit prepare(@NotNull ResourceManager arg, @NotNull ProfilerFiller arg2) {
|
protected @NotNull Unit prepare(@NotNull ResourceManager arg, @NotNull ProfilerFiller arg2) {
|
||||||
return Unit.INSTANCE;
|
return Unit.INSTANCE;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ This feature is supported in
|
|||||||
The mcmeta file has no differences just make sure it's a valid pack_format for the version
|
The mcmeta file has no differences just make sure it's a valid pack_format for the version
|
||||||
- 1.21.x: `"pack_format": 34`
|
- 1.21.x: `"pack_format": 34`
|
||||||
- I recommend adding this, so that you don't need to update the format since the only real requirement is using version 6.2 or newer of this mod
|
- I recommend adding this, so that you don't need to update the format since the only real requirement is using version 6.2 or newer of this mod
|
||||||
```json
|
```jsonc
|
||||||
"supported_formats": {
|
"supported_formats": {
|
||||||
"min_inclusive": 34,
|
"min_inclusive": 34,
|
||||||
"max_inclusive": 57 // This needs to be the leatest pack_format
|
"max_inclusive": 57 // This needs to be the leatest pack_format
|
||||||
@@ -71,7 +71,7 @@ base
|
|||||||
This boolean is false if the pointer locks at the `end` angle when the speed exceeds `maxSpeed`.
|
This boolean is false if the pointer locks at the `end` angle when the speed exceeds `maxSpeed`.
|
||||||
- pointer
|
- pointer
|
||||||
This defines properties of the pointer.
|
This defines properties of the pointer.
|
||||||
- color *not required, but if not present then `ìmage` most be*
|
- color *not required, but if not present then `image` most be*
|
||||||
The color value should be a hexadecimal RGB code, e.g., #b00219, where # is followed by six characters representing red, green, and blue values (00-FF for each component).
|
The color value should be a hexadecimal RGB code, e.g., #b00219, where # is followed by six characters representing red, green, and blue values (00-FF for each component).
|
||||||
- length *not required if `image` is not defined*
|
- length *not required if `image` is not defined*
|
||||||
The length in picture based on the original size of the background.
|
The length in picture based on the original size of the background.
|
||||||
@@ -91,4 +91,4 @@ I have created a JSON schema for this that is available at [speedometer_config_s
|
|||||||
```json
|
```json
|
||||||
"$schema": "https://raw.githubusercontent.com/zaze06/Speedometer/refs/heads/master/schemas/speedometer_config_schema.json",
|
"$schema": "https://raw.githubusercontent.com/zaze06/Speedometer/refs/heads/master/schemas/speedometer_config_schema.json",
|
||||||
```
|
```
|
||||||
in the root object, and the schema should apply, else if your editor supports it you can add the schema to all `speedometer.json` files
|
in the root object, and the schema should apply, else if your editor supports it you can add the schema to all `speedometer.json` files
|
||||||
|
|||||||
Reference in New Issue
Block a user