Fix brightness problem, change modid

This commit is contained in:
Michael Mikovsky
2025-09-07 19:14:24 -06:00
parent dc2e19df26
commit f3da921fd8
8 changed files with 17 additions and 53 deletions
@@ -84,14 +84,14 @@ public class ExampleMod implements ModInitializer {
context.getSource().sendFeedback(() -> Text.literal("Encoding icon data..."), false);
// for (int y = 0; y < 64; y++) {
// String text = "";
// for (int x = 0; x < 64; x++) {
// text += mapState.colors[y * 128 + x] + ", ";
// }
// String finalText = text;
// context.getSource().sendFeedback(() -> Text.literal(finalText), false);
// }
for (int y = 0; y < 64; y++) {
String text = "";
for (int x = 0; x < 64; x++) {
text += mapState.colors[y * 128 + x] + ", ";
}
String finalText = text;
context.getSource().sendFeedback(() -> Text.literal(finalText), false);
}
BufferedImage bufImg = convertImage(mapState.colors);
byte[] favicon = toBytes(bufImg);
@@ -280,8 +280,8 @@ public class ExampleMod implements ModInitializer {
}
// Decode base color and brightness level
int baseColorIndex = (unsignedByte - 1) / 4;
int brightnessLevel = (unsignedByte - 1) % 4;
int brightnessLevel = unsignedByte % 4;
int baseColorIndex = (unsignedByte - brightnessLevel) / 4;
// Validate base color index
if (baseColorIndex < 0 || baseColorIndex >= BASE_COLORS.length) {

Before

Width:  |  Height:  |  Size: 453 B

After

Width:  |  Height:  |  Size: 453 B

+5 -5
View File
@@ -1,9 +1,9 @@
{
"schemaVersion": 1,
"id": "modid",
"id": "favicon",
"version": "${version}",
"name": "Example mod",
"description": "This is an example description! Tell everyone what your mod is about!",
"name": "Favicon",
"description": "In-game server icon editing using a map.",
"authors": [
"Astatin3"
],
@@ -12,7 +12,7 @@
"sources": "https://github.com/FabricMC/fabric-example-mod"
},
"license": "CC0-1.0",
"icon": "assets/modid/icon.png",
"icon": "assets/favicon/icon.png",
"environment": "*",
"entrypoints": {
"main": [
@@ -20,7 +20,7 @@
]
},
"mixins": [
"modid.mixins.json"
"favicon.mixins.json"
],
"depends": {
"fabricloader": ">=0.16.14",