mirror of
https://github.com/Astatin3/MC-server-icon.git
synced 2026-06-09 00:28:05 -06:00
Fix brightness problem, change modid
This commit is contained in:
+2
-2
@@ -10,9 +10,9 @@ loader_version=0.16.14
|
|||||||
loom_version=1.11-SNAPSHOT
|
loom_version=1.11-SNAPSHOT
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version=1.0.0
|
mod_version=1.0.1
|
||||||
maven_group=dev.astatin3.favicon
|
maven_group=dev.astatin3.favicon
|
||||||
archives_base_name=modid
|
archives_base_name=favicon
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
fabric_version=0.129.0+1.21.8
|
fabric_version=0.129.0+1.21.8
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
package com.example;
|
|
||||||
|
|
||||||
import net.fabricmc.api.ClientModInitializer;
|
|
||||||
|
|
||||||
public class ExampleModClient implements ClientModInitializer {
|
|
||||||
@Override
|
|
||||||
public void onInitializeClient() {
|
|
||||||
// This entrypoint is suitable for setting up client-specific logic, such as rendering.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
package com.example.mixin.client;
|
|
||||||
|
|
||||||
import net.minecraft.client.MinecraftClient;
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|
||||||
|
|
||||||
@Mixin(MinecraftClient.class)
|
|
||||||
public class ExampleClientMixin {
|
|
||||||
@Inject(at = @At("HEAD"), method = "run")
|
|
||||||
private void init(CallbackInfo info) {
|
|
||||||
// This code is injected into the start of MinecraftClient.run()V
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"required": true,
|
|
||||||
"package": "com.example.mixin.client",
|
|
||||||
"compatibilityLevel": "JAVA_21",
|
|
||||||
"client": [
|
|
||||||
"ExampleClientMixin"
|
|
||||||
],
|
|
||||||
"injectors": {
|
|
||||||
"defaultRequire": 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -84,14 +84,14 @@ public class ExampleMod implements ModInitializer {
|
|||||||
context.getSource().sendFeedback(() -> Text.literal("Encoding icon data..."), false);
|
context.getSource().sendFeedback(() -> Text.literal("Encoding icon data..."), false);
|
||||||
|
|
||||||
|
|
||||||
// for (int y = 0; y < 64; y++) {
|
for (int y = 0; y < 64; y++) {
|
||||||
// String text = "";
|
String text = "";
|
||||||
// for (int x = 0; x < 64; x++) {
|
for (int x = 0; x < 64; x++) {
|
||||||
// text += mapState.colors[y * 128 + x] + ", ";
|
text += mapState.colors[y * 128 + x] + ", ";
|
||||||
// }
|
}
|
||||||
// String finalText = text;
|
String finalText = text;
|
||||||
// context.getSource().sendFeedback(() -> Text.literal(finalText), false);
|
context.getSource().sendFeedback(() -> Text.literal(finalText), false);
|
||||||
// }
|
}
|
||||||
|
|
||||||
BufferedImage bufImg = convertImage(mapState.colors);
|
BufferedImage bufImg = convertImage(mapState.colors);
|
||||||
byte[] favicon = toBytes(bufImg);
|
byte[] favicon = toBytes(bufImg);
|
||||||
@@ -280,8 +280,8 @@ public class ExampleMod implements ModInitializer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Decode base color and brightness level
|
// Decode base color and brightness level
|
||||||
int baseColorIndex = (unsignedByte - 1) / 4;
|
int brightnessLevel = unsignedByte % 4;
|
||||||
int brightnessLevel = (unsignedByte - 1) % 4;
|
int baseColorIndex = (unsignedByte - brightnessLevel) / 4;
|
||||||
|
|
||||||
// Validate base color index
|
// Validate base color index
|
||||||
if (baseColorIndex < 0 || baseColorIndex >= BASE_COLORS.length) {
|
if (baseColorIndex < 0 || baseColorIndex >= BASE_COLORS.length) {
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 453 B After Width: | Height: | Size: 453 B |
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"schemaVersion": 1,
|
"schemaVersion": 1,
|
||||||
"id": "modid",
|
"id": "favicon",
|
||||||
"version": "${version}",
|
"version": "${version}",
|
||||||
"name": "Example mod",
|
"name": "Favicon",
|
||||||
"description": "This is an example description! Tell everyone what your mod is about!",
|
"description": "In-game server icon editing using a map.",
|
||||||
"authors": [
|
"authors": [
|
||||||
"Astatin3"
|
"Astatin3"
|
||||||
],
|
],
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
"sources": "https://github.com/FabricMC/fabric-example-mod"
|
"sources": "https://github.com/FabricMC/fabric-example-mod"
|
||||||
},
|
},
|
||||||
"license": "CC0-1.0",
|
"license": "CC0-1.0",
|
||||||
"icon": "assets/modid/icon.png",
|
"icon": "assets/favicon/icon.png",
|
||||||
"environment": "*",
|
"environment": "*",
|
||||||
"entrypoints": {
|
"entrypoints": {
|
||||||
"main": [
|
"main": [
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"mixins": [
|
"mixins": [
|
||||||
"modid.mixins.json"
|
"favicon.mixins.json"
|
||||||
],
|
],
|
||||||
"depends": {
|
"depends": {
|
||||||
"fabricloader": ">=0.16.14",
|
"fabricloader": ">=0.16.14",
|
||||||
|
|||||||
Reference in New Issue
Block a user