diff --git a/LICENSE.md b/LICENSE.md index 1f55bf3..c2fcc90 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -80,7 +80,6 @@ whether by contract or otherwise, or **(b)** ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. - ### 2. License Grants and Conditions #### 2.1. Grants @@ -148,7 +147,6 @@ equivalents. Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1. - ### 3. Responsibilities #### 3.1. Distribution of Source Form @@ -210,7 +208,6 @@ indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction. - ### 4. Inability to Comply Due to Statute or Regulation If it is impossible for You to comply with any of the terms of this @@ -223,7 +220,6 @@ Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. - ### 5. Termination **5.1.** The rights granted under this License will terminate automatically @@ -252,7 +248,6 @@ end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination. - ### 6. Disclaimer of Warranty > Covered Software is provided under this License on an “as is” @@ -285,7 +280,6 @@ prior to termination shall survive termination. > incidental or consequential damages, so this exclusion and > limitation may not apply to You. - ### 8. Litigation Any litigation relating to this License may be brought only in the @@ -295,7 +289,6 @@ jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party's ability to bring cross-claims or counter-claims. - ### 9. Miscellaneous This License represents the complete agreement concerning the subject @@ -305,7 +298,6 @@ necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor. - ### 10. Versions of the License #### 10.1. New Versions diff --git a/README.md b/README.md index 48d3050..5951de1 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,23 @@ # PixelChat + [![Discord](https://badgen.net/badge/icon/discord?icon=discord&label)](https://discord.gg/NuGxJKtDKS) A simple mod to share images in-game. ## Features + - Image Sharing: Drag and drop image files into the chat and share them in chat. ## Fabric Setup + 1. Install Fabric: Ensure that you have Fabric installed. 2. Download PixelChat: Get the latest version from the [releases](https://git.1e99.eu/1e99/pixelchat/releases) tab. 3. Add to mods folder: Place the downloaded JAR file into your mods folder. ### Configuration + A configuration file can be found at + ```json { // Set where images will be uplaoded to @@ -25,9 +30,11 @@ A configuration file can be found at ``` ## Server Setup + Setting up a PixelChat server can be done with docker compose or from source. ### Docker Compose + ```yml services: "pixelchat": @@ -37,4 +44,5 @@ services: ``` ### From Source + WIP diff --git a/mod-fabric/build.gradle b/mod-fabric/build.gradle index 8557b42..2960d0d 100644 --- a/mod-fabric/build.gradle +++ b/mod-fabric/build.gradle @@ -45,6 +45,6 @@ java { jar { from("LICENSE") { - rename { "${it}_${project.base.archivesName.get()}"} + rename { "${it}_${project.base.archivesName.get()}" } } } diff --git a/mod-fabric/gradle.properties b/mod-fabric/gradle.properties index 839fbe1..ecba2ee 100644 --- a/mod-fabric/gradle.properties +++ b/mod-fabric/gradle.properties @@ -1,6 +1,5 @@ org.gradle.jvmargs=-Xmx1G org.gradle.parallel=true - # https://fabricmc.net/develop minecraft_version=1.21.4 yarn_mappings=1.21.4+build.2 diff --git a/mod-fabric/resources/fabric.mod.json b/mod-fabric/resources/fabric.mod.json index 27fc5a3..9c6e155 100644 --- a/mod-fabric/resources/fabric.mod.json +++ b/mod-fabric/resources/fabric.mod.json @@ -1,32 +1,32 @@ { - "schemaVersion": 1, - "id": "pixelchat", - "version": "${version}", - "name": "PixelChat", - "description": "This mod makes the minecraft chat great again", - "authors": [ - "1e99" - ], - "contact": { - "sources": "https://git.1e99.eu/1e99/pixelshare" - }, - "license": "MPL-2.0", - "icon": "assets/pixelchat/icon.png", - "environment": "client", - "entrypoints": { - "client": [ - "eu.e99.pixelchat.fabric.PixelChat" - ] - }, - "mixins": [ - "pixelchat.mixins.json" - ], - "depends": { - "fabricloader": ">=0.16.9", - "minecraft": "~1.21.4", - "java": ">=21", - "fabric-api": "*" - }, - "suggests": { - } + "schemaVersion": 1, + "id": "pixelchat", + "version": "${version}", + "name": "PixelChat", + "description": "This mod makes the minecraft chat great again", + "authors": [ + "1e99" + ], + "contact": { + "sources": "https://git.1e99.eu/1e99/pixelshare" + }, + "license": "MPL-2.0", + "icon": "assets/pixelchat/icon.png", + "environment": "client", + "entrypoints": { + "client": [ + "eu.e99.pixelchat.fabric.PixelChat" + ] + }, + "mixins": [ + "pixelchat.mixins.json" + ], + "depends": { + "fabricloader": ">=0.16.9", + "minecraft": "~1.21.4", + "java": ">=21", + "fabric-api": "*" + }, + "suggests": { + } } \ No newline at end of file diff --git a/mod-fabric/resources/pixelchat.mixins.json b/mod-fabric/resources/pixelchat.mixins.json index bae1f33..25c8427 100644 --- a/mod-fabric/resources/pixelchat.mixins.json +++ b/mod-fabric/resources/pixelchat.mixins.json @@ -1,13 +1,14 @@ { - "required": true, - "package": "eu.e99.pixelchat.fabric.mixin", - "compatibilityLevel": "JAVA_21", - "injectors": { - "defaultRequire": 1 - }, - "client": [ - "BossBarHudMixin", - "ChatScreenMixin", - "ChatHudMixin" - ] + "required": true, + "package": "eu.e99.pixelchat.fabric.mixin", + "compatibilityLevel": "JAVA_21", + "injectors": { + "defaultRequire": 1 + }, + "client": [ + "BossBarHudMixin", + "ChatHudMixin", + "ChatScreenMixin", + "ScreenshotRecorderMixin" + ] } \ No newline at end of file diff --git a/mod-fabric/src/eu/e99/pixelchat/fabric/image/ImageUploads.java b/mod-fabric/src/eu/e99/pixelchat/fabric/image/ImageUploads.java index c5c41ec..b95b465 100644 --- a/mod-fabric/src/eu/e99/pixelchat/fabric/image/ImageUploads.java +++ b/mod-fabric/src/eu/e99/pixelchat/fabric/image/ImageUploads.java @@ -12,7 +12,6 @@ import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.nio.file.Path; -import java.util.List; import java.util.UUID; public class ImageUploads { diff --git a/mod-fabric/src/eu/e99/pixelchat/fabric/mixin/BossBarHudMixin.java b/mod-fabric/src/eu/e99/pixelchat/fabric/mixin/BossBarHudMixin.java index f9d5d3c..0b9ccad 100644 --- a/mod-fabric/src/eu/e99/pixelchat/fabric/mixin/BossBarHudMixin.java +++ b/mod-fabric/src/eu/e99/pixelchat/fabric/mixin/BossBarHudMixin.java @@ -13,7 +13,8 @@ import java.util.UUID; @Mixin(BossBarHud.class) public class BossBarHudMixin implements BossBars { - @Shadow @Final + @Shadow + @Final Map bossBars; @Override diff --git a/server/src/eu/e99/pixelchat/server/ImageHandler.java b/server/src/eu/e99/pixelchat/server/ImageHandler.java index cd4ddbf..be7c659 100644 --- a/server/src/eu/e99/pixelchat/server/ImageHandler.java +++ b/server/src/eu/e99/pixelchat/server/ImageHandler.java @@ -42,7 +42,7 @@ public class ImageHandler { result(id); } - public void downloadImage(Context ctx) throws IOException { + public void downloadImage(Context ctx) throws IOException { String id = ctx.pathParam("id"); byte[] png = storage.get(id); if (png == null) { diff --git a/server/src/eu/e99/pixelchat/server/storage/MemoryStorage.java b/server/src/eu/e99/pixelchat/server/storage/MemoryStorage.java index e895ee7..289a63d 100644 --- a/server/src/eu/e99/pixelchat/server/storage/MemoryStorage.java +++ b/server/src/eu/e99/pixelchat/server/storage/MemoryStorage.java @@ -51,5 +51,6 @@ public class MemoryStorage implements Storage { private record Entry( byte[] value, Instant expiresAt - ) {} + ) { + } }