commit 25ef1988ea935baf0688c5711ee687181af225d0 Author: Zacharias Date: Tue Jun 13 20:02:17 2023 +0200 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3c37caf --- /dev/null +++ b/.gitignore @@ -0,0 +1,118 @@ +# User-specific stuff +.idea/ + +*.iml +*.ipr +*.iws + +# IntelliJ +out/ +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +.gradle +build/ + +# Ignore Gradle GUI config +gradle-app.setting + +# Cache of project +.gradletasknamecache + +**/build/ + +# Common working directory +run/ + +# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) +!gradle-wrapper.jar diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..c509c71 --- /dev/null +++ b/LICENSE @@ -0,0 +1,2 @@ +Copyright (c) 2023 Zacharias +All rights reserved. diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..ede757b --- /dev/null +++ b/build.gradle @@ -0,0 +1,51 @@ +plugins { + id "architectury-plugin" version "3.4-SNAPSHOT" + id "dev.architectury.loom" version "1.1-SNAPSHOT" apply false +} + +architectury { + minecraft = rootProject.minecraft_version +} + +subprojects { + apply plugin: "dev.architectury.loom" + + loom { + silentMojangMappingsLicense() + } + + dependencies { + minecraft "com.mojang:minecraft:${rootProject.minecraft_version}" + // The following line declares the mojmap mappings, you may use other mappings as well + mappings loom.officialMojangMappings() + // The following line declares the yarn mappings you may select this one as well. + // mappings "net.fabricmc:yarn:@YARN_MAPPINGS@:v2" + } +} + +allprojects { + apply plugin: "java" + apply plugin: "architectury-plugin" + apply plugin: "maven-publish" + + archivesBaseName = rootProject.archives_base_name + version = rootProject.mod_version + group = rootProject.maven_group + + 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. + } + + tasks.withType(JavaCompile) { + options.encoding = "UTF-8" + options.release = 17 + } + + java { + withSourcesJar() + } +} diff --git a/common/build.gradle b/common/build.gradle new file mode 100644 index 0000000..753a087 --- /dev/null +++ b/common/build.gradle @@ -0,0 +1,30 @@ +dependencies { + // We depend on fabric loader here to use the fabric @Environment annotations and get the mixin dependencies + // Do NOT use other classes from fabric loader + modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}" + // Remove the next line if you don't want to depend on the API + modApi "dev.architectury:architectury:${rootProject.architectury_version}" + + modApi "me.shedaniel.cloth:cloth-config-fabric:11.0.99" + + implementation 'org.json:json:20230227' + include 'org.json:json:20230227' +} + +architectury { + common() +} + +publishing { + publications { + mavenCommon(MavenPublication) { + artifactId = rootProject.archives_base_name + from components.java + } + } + + // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. + repositories { + // Add repositories to publish to here. + } +} \ No newline at end of file diff --git a/common/src/main/java/me/zacharias/speedometer/Config.java b/common/src/main/java/me/zacharias/speedometer/Config.java new file mode 100644 index 0000000..8e6a42c --- /dev/null +++ b/common/src/main/java/me/zacharias/speedometer/Config.java @@ -0,0 +1,126 @@ +package me.zacharias.speedometer; + +import dev.architectury.platform.Platform; +import net.minecraft.world.phys.Vec3; +import org.joml.Vector3i; +import org.json.JSONObject; + +import javax.swing.plaf.ColorUIResource; +import java.io.*; + +import me.shedaniel.math.Color; + +import static me.zacharias.speedometer.Speedometer.MOD_ID; + +public class Config { + private static JSONObject Config; + + public static void initialize(){ + if(Config != null) throw new RuntimeException("Already Initialized"); + File config = new File(Platform.getConfigFolder().toString()+"/"+MOD_ID+"/config.json"); + if(!config.exists()){ + try { + config.getParentFile().mkdir(); + config.createNewFile(); + } catch (IOException e) { + throw new RuntimeException(e); + } + Config = new JSONObject(); + + + Config.put("speed", SpeedTypes.BlockPS); + Config.put("useKnot", false); + Config.put("color", new JSONObject() + .put("r", 16) + .put("g", 146) + .put("b", 158) + ); + Config.put("debug", false); + }else { + try { + BufferedReader in = new BufferedReader(new FileReader(config)); + String tmp = ""; + StringBuilder builder = new StringBuilder(); + while((tmp = in.readLine()) != null){ + builder.append(tmp); + } + Config = new JSONObject(builder.toString()); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + } + + public static void save(){ + File config = new File(Platform.getConfigFolder().toString()+"/"+MOD_ID+"/config.json"); + if(!config.exists()){ + try { + config.getParentFile().mkdir(); + config.createNewFile(); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + try { + BufferedWriter out = new BufferedWriter(new FileWriter(config)); + out.write(Config.toString(4)); + out.flush(); + out.close(); + }catch (Exception e){ + throw new RuntimeException(e); + } + } + + public static SpeedTypes getSpeedType(){ + if(Config.has("speed")){ + return Config.getEnum(SpeedTypes.class, "speed"); + }else{ + return SpeedTypes.BlockPS; + } + } + + public static boolean getUseKnot() { + if(Config.has("useKnot")){ + return Config.getBoolean("useKnot"); + }else{ + return false; + } + } + + public static Color getColor(){ + if(Config.has("color")){ + JSONObject color = Config.getJSONObject("color"); + return Color.ofRGB( + color.getInt("r"), + color.getInt("g"), + color.getInt("b") + ); + }else{ + return Color.ofRGB(16, 146, 158); + } + } + + public static boolean getIsDebug() { + if(Config.has("debug")){ + return Config.getBoolean("debug"); + }else{ + return false; + } + } + + public static void setColor(Color color){ + Config.put("color", new JSONObject() + .put("r", color.getRed()) + .put("g", color.getGreen()) + .put("b", color.getBlue()) + ); + } + + public static void setUseKnot(boolean useKnot){ + Config.put("useKnot", useKnot); + } + + public static void setSpeedType(SpeedTypes speedType) { + Config.put("speed", speedType); + } +} diff --git a/common/src/main/java/me/zacharias/speedometer/SpeedTypes.java b/common/src/main/java/me/zacharias/speedometer/SpeedTypes.java new file mode 100644 index 0000000..5128e84 --- /dev/null +++ b/common/src/main/java/me/zacharias/speedometer/SpeedTypes.java @@ -0,0 +1,26 @@ +package me.zacharias.speedometer; + +import net.minecraft.network.chat.Component; + +public enum SpeedTypes { + MPH, + KMPH, + MPS, + BlockPS, + KNOT; + + public static Component getName(Enum anEnum) { + if(anEnum instanceof SpeedTypes speedType) { + return Component.translatable("speedometer.speed." + switch (speedType) { + case MPH -> "mph"; + case MPS -> "mps"; + case KMPH -> "kmph"; + case BlockPS -> "bps"; + case KNOT -> "knot"; + default -> "error"; + }); + }else { + return Component.translatable("speedometer.speed.error"); + } + } +} \ No newline at end of file diff --git a/common/src/main/java/me/zacharias/speedometer/Speedometer.java b/common/src/main/java/me/zacharias/speedometer/Speedometer.java new file mode 100644 index 0000000..78dc46a --- /dev/null +++ b/common/src/main/java/me/zacharias/speedometer/Speedometer.java @@ -0,0 +1,274 @@ +package me.zacharias.speedometer; + +import com.google.common.base.Supplier; +import com.google.common.base.Suppliers; +import com.mojang.authlib.minecraft.client.MinecraftClient; +import com.mojang.blaze3d.platform.InputConstants; +import dev.architectury.event.events.client.ClientGuiEvent; +import dev.architectury.event.events.client.ClientTickEvent; +import dev.architectury.injectables.targets.ArchitecturyTarget; +import dev.architectury.platform.Platform; +import dev.architectury.registry.client.keymappings.KeyMappingRegistry; +import dev.architectury.registry.registries.RegistrarManager; +import dev.architectury.event.EventHandler; +import dev.architectury.utils.Env; +import dev.architectury.utils.EnvExecutor; +import me.shedaniel.clothconfig2.api.ConfigBuilder; +import me.shedaniel.clothconfig2.api.ConfigCategory; +import me.shedaniel.clothconfig2.api.ConfigEntryBuilder; +import net.minecraft.client.KeyMapping; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Font; +import net.minecraft.client.gui.GuiGraphics; +import net.minecraft.client.gui.font.FontSet; +import net.minecraft.client.gui.screens.Screen; +import net.minecraft.core.registries.Registries; +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.entity.vehicle.Boat; +import net.minecraft.world.level.Level; +import net.minecraft.world.phys.Vec3; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import javax.swing.plaf.ColorUIResource; +import java.awt.*; +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.UUID; +import java.util.function.Function; + +public class Speedometer +{ + public static final String MOD_ID = "speedometer"; + public static final Supplier MANAGER = Suppliers.memoize(() -> RegistrarManager.get(MOD_ID)); + public static final Logger LOGGER = LogManager.getLogger(MOD_ID); + + public static final KeyMapping CONFIG_KEY = new KeyMapping( + "speedometer.key.configkey", + InputConstants.Type.KEYSYM, + InputConstants.KEY_O, + "speedometer.key.catagory" + ); + + public static void init() { + if(Platform.isForge()){ + LOGGER.info("Hello, Forge! from Architectury"); + }else if(Platform.isFabric()){ + LOGGER.info("Hello, Fabric! from Architectury"); + }else{ + LOGGER.info("Hello! from Architectury"); + } + + if(Platform.getEnvironment() != Env.CLIENT) return; + + KeyMappingRegistry.register(CONFIG_KEY); + ClientTickEvent.CLIENT_POST.register(minecraft -> { + if(CONFIG_KEY.consumeClick()){ + Minecraft.getInstance().setScreen(getConfig(Minecraft.getInstance().screen).build()); + } + }); + + Config.initialize(); + Config.save(); + + // TODO add cloth config for abstract config system + + ArrayList speeds = new ArrayList<>(); + + ClientGuiEvent.RENDER_HUD.register((graphics, tick) -> { + if(Minecraft.getInstance().player == null) return; + Entity entity = Minecraft.getInstance().player.getRootVehicle(); + + Level world = entity.level(); + double x = entity.position().x; + double y = entity.position().y; + double z = entity.position().z; + + Vec3 vec = entity.getDeltaMovement(); + + double yOffset = 0.0784000015258789D; + double xOffset = 0D; + double zOffset = 0D; + double vOffset = 0D; + + if (entity instanceof Player e) { + if (!e.onGround() && e.isCreative()) { + yOffset = 0; + } else if (e.isInWater()) { + yOffset = 0; + } + } else if (entity instanceof Boat) { + yOffset = 0; + } + + double speed = (Math.sqrt(Math.pow(vec.x + xOffset, 2) + Math.pow(vec.y + yOffset, 2) + Math.pow(vec.z + zOffset, 2)) * 20)+vOffset; + + if (speeds.size() >= 30) { + speeds.remove(0); + } + speeds.add(speed); + speed = 0; + for (Double aDouble : speeds) { + speed += aDouble; + } + speed = speed / speeds.size(); + + SpeedTypes speedType = Config.getSpeedType(); + if (speedType == SpeedTypes.KNOT || (entity instanceof Boat && Config.getUseKnot())) { + speed = speed * 1.94384449; + }else if (speedType == SpeedTypes.KMPH) { + speed = speed * 3.6; + } else if (speedType == SpeedTypes.MPH) { + speed = speed * 2.23693629; + } + + String format = String.format("%.2f", speed); + + + // i -> x + // j -> y + // k -> color RGB int + graphics.drawString( + Minecraft.getInstance().font, + format+" "+SpeedTypes.getName(speedType).getString(), + getPos(graphics, "W-70", 0, false), + getPos(graphics, "H-17", 1, true), + Config.getColor().getColor()); + }); + + } + + static boolean flag = true; + + private static int getPos(GuiGraphics event, String input, int type, boolean changeFlag) { + ArrayList paserdPos = new ArrayList(); + final char[] s = input.toCharArray(); + try{ + for(int i = 0; i getModConfigScreenFactory() { + return parent -> { + ConfigBuilder builder = Speedometer.getConfig(parent); + + return builder.build(); + }; + } + } \ No newline at end of file diff --git a/fabric/src/main/java/me/zacharias/speedometer/fabric/SpeedometerFabric.java b/fabric/src/main/java/me/zacharias/speedometer/fabric/SpeedometerFabric.java new file mode 100644 index 0000000..7ee7bbb --- /dev/null +++ b/fabric/src/main/java/me/zacharias/speedometer/fabric/SpeedometerFabric.java @@ -0,0 +1,17 @@ +package me.zacharias.speedometer.fabric; + +import com.terraformersmc.modmenu.api.ConfigScreenFactory; +import com.terraformersmc.modmenu.api.ModMenuApi; +import me.shedaniel.clothconfig2.api.ConfigBuilder; +import me.zacharias.speedometer.Speedometer; +import net.fabricmc.api.ModInitializer; +import net.minecraft.client.Minecraft; +import net.minecraft.network.chat.Component; + +public class SpeedometerFabric implements ModInitializer { + @Override + public void onInitialize() { + Speedometer.init(); + + } +} \ No newline at end of file diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..ffd7c99 --- /dev/null +++ b/fabric/src/main/resources/fabric.mod.json @@ -0,0 +1,23 @@ +{ + "schemaVersion": 1, + "id": "speedometer", + "version": "${version}", + + "name": "speedometer", + "description": "just displaying your speed", + "authors": [], + "contact": {}, + + "license": "All Rights Reserved", + "icon": "icon.png", + + "environment": "*", + "entrypoints": { + "main": ["me.zacharias.speedometer.fabric.SpeedometerFabric"], + "modmenu": ["me.zacharias.speedometer.fabric.Config"] + }, + "depends": { + "fabricloader": ">=0.14.21", + "minecraft": ">=1.20" + } +} diff --git a/fabric/src/main/resources/icon.png b/fabric/src/main/resources/icon.png new file mode 100644 index 0000000..047b91f Binary files /dev/null and b/fabric/src/main/resources/icon.png differ diff --git a/forge/build.gradle b/forge/build.gradle new file mode 100644 index 0000000..37ecc52 --- /dev/null +++ b/forge/build.gradle @@ -0,0 +1,86 @@ +plugins { + id "com.github.johnrengelman.shadow" version "7.1.2" +} +architectury { + platformSetupLoomIde() + forge() +} + +repositories{ + maven { url "https://maven.shedaniel.me/" } +} + +configurations { + common + shadowCommon // Don't use shadow from the shadow plugin because we don't want IDEA to index this. + compileClasspath.extendsFrom common + runtimeClasspath.extendsFrom common + developmentForge.extendsFrom common +} + +dependencies { + forge "net.minecraftforge:forge:${rootProject.forge_version}" + // Remove the next line if you don't want to depend on the API + modApi "dev.architectury:architectury-forge:${rootProject.architectury_version}" + + modApi "me.shedaniel.cloth:cloth-config-forge:11.0.99" + + common(project(path: ":common", configuration: "namedElements")) { transitive false } + shadowCommon(project(path: ":common", configuration: "transformProductionForge")) { transitive = false } + + implementation 'org.json:json:20230227' + include 'org.json:json:20230227' + forgeRuntimeLibrary 'org.json:json:20230227' +} + +processResources { + inputs.property "version", project.version + + filesMatching("META-INF/mods.toml") { + expand "version": project.version + } +} + +shadowJar { + exclude "fabric.mod.json" + + + configurations = [project.configurations.shadowCommon] + archiveClassifier.set("dev-shadow") +} + +remapJar { + inputFile.set shadowJar.archiveFile + dependsOn shadowJar + archiveClassifier.set(null) +} + +jar { + archiveClassifier.set("dev") +} + +sourcesJar { + def commonSources = project(":common").sourcesJar + dependsOn commonSources + from commonSources.archiveFile.map { zipTree(it) } +} + +components.java { + withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) { + skip() + } +} + +publishing { + publications { + mavenForge(MavenPublication) { + artifactId = rootProject.archives_base_name + "-" + project.name + from components.java + } + } + + // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. + repositories { + // Add repositories to publish to here. + } +} \ No newline at end of file diff --git a/forge/gradle.properties b/forge/gradle.properties new file mode 100644 index 0000000..32f842a --- /dev/null +++ b/forge/gradle.properties @@ -0,0 +1 @@ +loom.platform=forge \ No newline at end of file diff --git a/forge/src/main/java/me/zacharias/speedometer/forge/SpeedometerForge.java b/forge/src/main/java/me/zacharias/speedometer/forge/SpeedometerForge.java new file mode 100644 index 0000000..3223636 --- /dev/null +++ b/forge/src/main/java/me/zacharias/speedometer/forge/SpeedometerForge.java @@ -0,0 +1,15 @@ +package me.zacharias.speedometer.forge; + +import dev.architectury.platform.forge.EventBuses; +import me.zacharias.speedometer.Speedometer; +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; + +@Mod(Speedometer.MOD_ID) +public class SpeedometerForge { + public SpeedometerForge() { + // Submit our event bus to let architectury register our content on the right time + EventBuses.registerModEventBus(Speedometer.MOD_ID, FMLJavaModLoadingContext.get().getModEventBus()); + Speedometer.init(); + } +} \ No newline at end of file diff --git a/forge/src/main/resources/META-INF/mods.toml b/forge/src/main/resources/META-INF/mods.toml new file mode 100644 index 0000000..eb25e29 --- /dev/null +++ b/forge/src/main/resources/META-INF/mods.toml @@ -0,0 +1,66 @@ +# This is an example mods.toml file. It contains the data relating to the loading mods. +# There are several mandatory fields (#mandatory), and many more that are optional (#optional). +# The overall format is standard TOML format, v0.5.0. +# Note that there are a couple of TOML lists in this file. +# Find more information on toml format here: https://github.com/toml-lang/toml +# The name of the mod loader type to load - for regular FML @Mod mods it should be javafml +modLoader="javafml" #mandatory +# A version range to match for said mod loader - for regular FML @Mod it will be the forge version +loaderVersion="[46,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions. +# The license for you mod. This is mandatory metadata and allows for easier comprehension of your redistributive properties. +# Review your options at https://choosealicense.com/. All rights reserved is the default copyright stance, and is thus the default here. +license="All Rights Reserved" +# A URL to refer people to when problems occur with this mod +issueTrackerURL="https://github.com/zaze06/speedometer/issues" +# A list of mods - how many allowed here is determined by the individual mod loader +[[mods]] #mandatory +# The modid of the mod +modId="speedometer" #mandatory +# The version number of the mod - there's a few well known ${} variables useable here or just hardcode it +# ${version} will substitute the value of the Implementation-Version as read from the mod's JAR file metadata +# see the associated build.gradle script for how to populate this completely automatically during a build +version="${version}" #mandatory +# A display name for the mod +displayName="speedometer" #mandatory +# A URL to query for updates for this mod. See the JSON update specification +#updateJSONURL="http://myurl.me/" #optional +# A URL for the "homepage" for this mod, displayed in the mod UI +#displayURL="http://example.com/" #optional +# A file name (in the root of the mod JAR) containing a logo for display +logoFile="icon.png" #optional +# A text field displayed in the mod UI +#credits="Thanks for this example mod goes to Java" #optional +# A text field displayed in the mod UI +authors="Zacharias" #optional +# Display Test controls the display for your mod in the server connection screen +# MATCH_VERSION means that your mod will cause a red X if the versions on client and server differ. This is the default behaviour and should be what you choose if you have server and client elements to your mod. +# IGNORE_SERVER_VERSION means that your mod will not cause a red X if it's present on the server but not on the client. This is what you should use if you're a server only mod. +# IGNORE_ALL_VERSION means that your mod will not cause a red X if it's present on the client or the server. This is a special case and should only be used if your mod has no server component. +# NONE means that no display test is set on your mod. You need to do this yourself, see IExtensionPoint.DisplayTest for more information. You can define any scheme you wish with this value. +# IMPORTANT NOTE: this is NOT an instruction as to which environments (CLIENT or DEDICATED SERVER) your mod loads on. Your mod should load (and maybe do nothing!) whereever it finds itself. +#displayTest="MATCH_VERSION" # MATCH_VERSION is the default if nothing is specified (#optional) + +# The description text for the mod (multi line!) (#mandatory) +description=''' +just displaying your speed +''' +# A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional. +[[dependencies.speedometer]] #optional + # the modid of the dependency + modId="forge" #mandatory + # Does this dependency have to exist - if not, ordering below must be specified + mandatory=true #mandatory + # The version range of the dependency + versionRange="[46,)" #mandatory + # An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory + ordering="NONE" + # Side this dependency is applied on - BOTH, CLIENT or SERVER + side="BOTH" +# Here's another dependency +[[dependencies.speedometer]] + modId="minecraft" + mandatory=true + # This version range declares a minimum of the current minecraft version up to but not including the next major version + versionRange="[1.20,1.21)" + ordering="NONE" + side="BOTH" diff --git a/forge/src/main/resources/icon.png b/forge/src/main/resources/icon.png new file mode 100644 index 0000000..047b91f Binary files /dev/null and b/forge/src/main/resources/icon.png differ diff --git a/forge/src/main/resources/pack.mcmeta b/forge/src/main/resources/pack.mcmeta new file mode 100644 index 0000000..ac21974 --- /dev/null +++ b/forge/src/main/resources/pack.mcmeta @@ -0,0 +1,7 @@ +{ + "pack": { + "description": "speedometer resources", + "pack_format": 13, + "forge:server_data_pack_format": 12 + } +} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..3089067 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,14 @@ +org.gradle.jvmargs=-Xmx1G + +minecraft_version=1.20 + +archives_base_name=speedometer +mod_version=1.0 +maven_group=me.zacharias + +architectury_version=9.0.8 + +fabric_loader_version=0.14.21 +fabric_api_version=0.83.0+1.20 + +forge_version=1.20-46.0.14 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..5083229 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip +networkTimeout=10000 +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..48e5bbc --- /dev/null +++ b/readme.md @@ -0,0 +1,8 @@ +# Speedometer +This is a simple mod for forge and fabric that displays your current speed + +This mod is a newer version of [speedometer-forge](https://github.com/zaze06/speedometer-forge) + +## Changes from old forge version? +This was just a project I choose for trying the Architectury API for abstraction. +So changes are that now Architectury APi is required for this mod to work \ No newline at end of file diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..06a89e4 --- /dev/null +++ b/settings.gradle @@ -0,0 +1,12 @@ +pluginManagement { + repositories { + maven { url "https://maven.fabricmc.net/" } + maven { url "https://maven.architectury.dev/" } + maven { url "https://maven.minecraftforge.net/" } + gradlePluginPortal() + } +} + +include("common") +include("fabric") +include("forge") \ No newline at end of file