diff options
| author | anhgelus <anhgelus.morhtuuzh@proton.me> | 2024-08-21 19:35:37 +0000 |
|---|---|---|
| committer | anhgelus <anhgelus.morhtuuzh@proton.me> | 2024-08-21 19:35:37 +0000 |
| commit | 0c936086d74adc98c017747684a072022e502e88 (patch) | |
| tree | 2f53501d5739688db15e6da17be7aa3f994d2ce7 | |
| parent | ec6b3c2d8db90a4100ea493d4a2ef7722d7c064c (diff) | |
feat(player): remove player's custom skin and use a default one
| -rw-r--r-- | src/client/java/world/anhgelus/molehunt/client/MolehuntClient.java | 10 | ||||
| -rw-r--r-- | src/client/java/world/anhgelus/molehunt/client/mixin/NoSkin.java | 24 | ||||
| -rw-r--r-- | src/client/resources/assets/molehunt/textures/skin.png | bin | 0 -> 1347 bytes | |||
| -rw-r--r-- | src/client/resources/molehunt.client.mixins.json | 3 | ||||
| -rw-r--r-- | src/main/java/world/anhgelus/molehunt/Molehunt.java | 6 | ||||
| -rw-r--r-- | src/main/resources/fabric.mod.json | 3 | ||||
| -rw-r--r-- | src/main/resources/molehunt.mixins.json | 4 |
7 files changed, 48 insertions, 2 deletions
diff --git a/src/client/java/world/anhgelus/molehunt/client/MolehuntClient.java b/src/client/java/world/anhgelus/molehunt/client/MolehuntClient.java index 034b80c..e6de219 100644 --- a/src/client/java/world/anhgelus/molehunt/client/MolehuntClient.java +++ b/src/client/java/world/anhgelus/molehunt/client/MolehuntClient.java @@ -1,9 +1,19 @@ package world.anhgelus.molehunt.client; +import com.mojang.authlib.GameProfile; import net.fabricmc.api.ClientModInitializer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.UUID; public class MolehuntClient implements ClientModInitializer { + public static final String MOD_ID = "molehunt"; + public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID); + + public final static GameProfile ANONYMOUS_PROFILE = new GameProfile(UUID.fromString("015f3266-4e0a-412e-9b80-1ca76af79453"), "Molehunt"); + @Override public void onInitializeClient() { } diff --git a/src/client/java/world/anhgelus/molehunt/client/mixin/NoSkin.java b/src/client/java/world/anhgelus/molehunt/client/mixin/NoSkin.java new file mode 100644 index 0000000..edbfd15 --- /dev/null +++ b/src/client/java/world/anhgelus/molehunt/client/mixin/NoSkin.java @@ -0,0 +1,24 @@ +package world.anhgelus.molehunt.client.mixin;
+
+import net.minecraft.client.network.AbstractClientPlayerEntity;
+import net.minecraft.client.util.SkinTextures;
+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;
+import world.anhgelus.molehunt.client.MolehuntClient;
+
+@Mixin(AbstractClientPlayerEntity.class)
+public class NoSkin {
+ @Inject(at = @At("HEAD"), method = "getSkinTextures", cancellable = true)
+ public void getSkin(CallbackInfoReturnable<SkinTextures> cir) {
+ cir.setReturnValue(new SkinTextures(
+ Identifier.of(MolehuntClient.MOD_ID, "textures/skin.png"),
+ null,
+ null,
+ null,
+ SkinTextures.Model.WIDE, true)
+ );
+ }
+}
diff --git a/src/client/resources/assets/molehunt/textures/skin.png b/src/client/resources/assets/molehunt/textures/skin.png Binary files differnew file mode 100644 index 0000000..c1f728e --- /dev/null +++ b/src/client/resources/assets/molehunt/textures/skin.png diff --git a/src/client/resources/molehunt.client.mixins.json b/src/client/resources/molehunt.client.mixins.json index e6a9f8e..c5eb170 100644 --- a/src/client/resources/molehunt.client.mixins.json +++ b/src/client/resources/molehunt.client.mixins.json @@ -4,7 +4,8 @@ "package": "world.anhgelus.molehunt.client.mixin", "compatibilityLevel": "JAVA_21", "client": [ - "NoNametags" + "NoNametags", + "NoSkin" ], "injectors": { "defaultRequire": 1 diff --git a/src/main/java/world/anhgelus/molehunt/Molehunt.java b/src/main/java/world/anhgelus/molehunt/Molehunt.java index 5886734..a1333a4 100644 --- a/src/main/java/world/anhgelus/molehunt/Molehunt.java +++ b/src/main/java/world/anhgelus/molehunt/Molehunt.java @@ -1,10 +1,16 @@ package world.anhgelus.molehunt; import net.fabricmc.api.ModInitializer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class Molehunt implements ModInitializer { + public static final String MOD_ID = "molehunt"; + public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID); + @Override public void onInitialize() { + LOGGER.info("Initializing Molehunt"); } } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index e48aaf8..81d7829 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -15,6 +15,9 @@ "client": [ "world.anhgelus.molehunt.client.MolehuntClient" ], + "server": [ + + ], "main": [ "world.anhgelus.molehunt.Molehunt" ] diff --git a/src/main/resources/molehunt.mixins.json b/src/main/resources/molehunt.mixins.json index 8acee9a..a691723 100644 --- a/src/main/resources/molehunt.mixins.json +++ b/src/main/resources/molehunt.mixins.json @@ -3,7 +3,9 @@ "minVersion": "0.8", "package": "world.anhgelus.molehunt.mixin", "compatibilityLevel": "JAVA_21", - "mixins": [], + "mixins": [ + "NoPlayerList" + ], "injectors": { "defaultRequire": 1 } |
