diff --git a/README.md b/README.md index 1ff2bd4..4582a2e 100644 --- a/README.md +++ b/README.md @@ -8,13 +8,41 @@ This library is only needed on the logical server side. Users only need to insta it in a single player environment. For anything specific, check out the mods which make use of this library and follow their instructions. -## How to use +## Installation & Dependencies -First prepare the sheet so that it is publicly viewable. +For installation simply add the library like any other mod to your minecraft instance. -![public sheet](promo/01.png) +If you want to add this library as a dependency to your mod, add the following code to your `build.gradle` file. + +``` +repositories { + // ... + + // Google Sheets Reader API + maven { url = "https://repo.repsy.io/mvn/fabricated-atelier/fabric-sheets-reader/" } +} +``` + +``` +dependencies { + // ... + + // google-sheets-reader-api + implementation "net.shirojr.sheetsreader:sheetsreader:${project.google_sheets_reader_version}" +} +``` + +Then in your `gradle.properties` file add the version number using the `google_sheets_reader_version` variable. +You can find available versions at our +[Maven repository](https://repsy.io/fabricated-atelier/maven/fabric-sheets-reader/artifacts) or in the +[Releases](https://github.com/JR1811/google-sheets-reader/releases). -For the credentials of the Google Sheets API, you need three values: +Also don't forget to add the `sheetsreader` modid to the `depends` section in your `fabric.mod.json` file. + +## How to use + +To access the Google Sheets API, credentials are needed to verify the usage. +For the credentials of this Google Sheets Reader Library, you need three values: - API key - Sheet ID @@ -24,7 +52,7 @@ First set up a project, if you don't have one already, in the [Google Console](h Enable the Google Sheets API and get a new API key from there. Take a closer look at the settings since there are many options to handle the API key in a safer way. -After that you can retrieve the Sheets ID from your spreadsheet's URL: +After that you can retrieve the Sheet ID from your spreadsheet's URL: https://docs.google.com/spreadsheets/d/**SpreadSheetID**/edit#gid=0 @@ -33,6 +61,10 @@ selection. ![Sheet Range](promo/02.png) +Also prepare the sheet so that it is publicly viewable. + +![public sheet](promo/01.png) + Check out the [API README](src/main/java/net/shirojr/sheetsreader/api/README.md) file to see where and how the credentials need to be stored. diff --git a/gradle.properties b/gradle.properties index c3dabcb..c69ffe4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ yarn_mappings=1.18.2+build.4 loader_version=0.15.11 # Mod Properties -mod_version=1.18.2-0.0.2 +mod_version=1.18.2-0.0.1 maven_group=net.shirojr.sheetsreader archives_base_name=sheetsreader diff --git a/src/main/java/net/shirojr/sheetsreader/api/README.md b/src/main/java/net/shirojr/sheetsreader/api/README.md index 886fc95..a74d77c 100644 --- a/src/main/java/net/shirojr/sheetsreader/api/README.md +++ b/src/main/java/net/shirojr/sheetsreader/api/README.md @@ -34,7 +34,7 @@ in place for that to keep the size of this lib to a minimum. To update a config file at runtime, use the `loadFromFile` method of the `SheetsConfigHandler` class. You can also overwrite the config file with the `saveToFile` method. -The api call might block the current thread so if the API call takes a long time the game could potentially freeze. +The API call might block the current thread so if the API call takes a long time the game could potentially freeze. As a rule of thumb, don't reload the config at run-time if the incoming sheet data is huge. ### API Credentials From A Datapack @@ -52,7 +52,7 @@ For an example check out the [example.json](../../../../../resources/data/sheets file and where it's located at. The api call is done async, so if you reload datapacks the current thread won't be blocked. Your console will notify -you about a successfully finished api call's data retrieval. +you about a successfully finished API call's data retrieval. ## Accessing `SheetsData` diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 1e273ef..29a8764 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -3,7 +3,7 @@ "id": "sheetsreader", "version": "${version}", "name": "google-sheets-reader", - "description": "A Fabric mod to read Google Sheets data using the Google Sheets API", + "description": "A Fabric library mod to read Google Sheets data using the Google Sheets API", "authors": [ "ShiroJR1811 - Dev" ], @@ -27,8 +27,5 @@ "minecraft": "~1.18.2", "java": ">=17", "fabric-api": "*" - }, - "suggests": { - "another-mod": "*" } } \ No newline at end of file