Skip to content

Commit

Permalink
playerlistentry mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
diacritics-owo committed Jul 26, 2024
1 parent 2d78b62 commit c2440fb
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 57 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package diacritics.owo.mixin.client;

import net.minecraft.client.network.PlayerListEntry;
import net.minecraft.util.Identifier;
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.CallbackInfoReturnable;

@Mixin(value = PlayerListEntry.class, priority = Integer.MAX_VALUE)
public abstract class PlayerListEntryMixin {
@Inject(method = "getSkinTexture", at = @At("HEAD"), cancellable = true)
public void onGetSkinTexture(CallbackInfoReturnable<Identifier> cir) {
cir.setReturnValue(Identifier.of("minecraft", "textures/entity/zombie/drowned_outer_layer.png"));
}
}

2 changes: 1 addition & 1 deletion src/client/resources/dynamic-skins.client.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"required": true,
"package": "diacritics.owo.mixin.client",
"compatibilityLevel": "JAVA_17",
"client": ["ExampleClientMixin"],
"client": ["PlayerListEntryMixin"],
"injectors": {
"defaultRequire": 1
}
Expand Down
12 changes: 3 additions & 9 deletions src/main/java/diacritics/owo/DynamicSkins.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,11 @@
import org.slf4j.LoggerFactory;

public class DynamicSkins implements ModInitializer {
// This logger is used to write text to the console and the log file.
// It is considered best practice to use your mod id as the logger's name.
// That way, it's clear which mod wrote info, warnings, and errors.
public static final Logger LOGGER = LoggerFactory.getLogger("dynamic-skins");
public static final String MOD_ID = "dynamic-skins";
public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);

@Override
public void onInitialize() {
// This code runs as soon as Minecraft is in a mod-load-ready state.
// However, some things (like resources) may still be uninitialized.
// Proceed with mild caution.

LOGGER.info("Hello Fabric world!");
LOGGER.info("hello from dynamic skins!");
}
}
15 changes: 0 additions & 15 deletions src/main/java/diacritics/owo/mixin/ExampleMixin.java

This file was deleted.

9 changes: 0 additions & 9 deletions src/main/resources/dynamic-skins.mixins.json

This file was deleted.

12 changes: 4 additions & 8 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,20 @@
"id": "dynamic-skins",
"version": "${version}",
"name": "Dynamic Skins",
"description": "This is an example description! Tell everyone what your mod is about!",
"authors": ["Me!"],
"description": "Set your skin dynamically based on conditions (client-only for now)",
"authors": ["diacritics-owo"],
"contact": {
"homepage": "https://fabricmc.net/",
"sources": "https://github.com/FabricMC/fabric-example-mod"
},
"license": "CC0-1.0",
"license": "MIT",
"icon": "assets/dynamic-skins/icon.png",
"environment": "*",
"environment": "client",
"entrypoints": {
"main": ["diacritics.owo.DynamicSkins"],
"client": ["diacritics.owo.DynamicSkinsClient"]
},
"mixins": [
"dynamic-skins.mixins.json",
{
"config": "dynamic-skins.client.mixins.json",
"environment": "client"
Expand All @@ -28,8 +27,5 @@
"minecraft": "~1.20.1",
"java": ">=17",
"fabric-api": "*"
},
"suggests": {
"another-mod": "*"
}
}

0 comments on commit c2440fb

Please sign in to comment.