Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
CreatureChat
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
Public
CreatureChat
Commits
f056dd02
Commit
f056dd02
authored
Jan 04, 2025
by
Jonathan Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More code cleanup and removing log statements
parent
9405b2c2
Pipeline
#13260
passed with stages
in 2 minutes 5 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
15 deletions
+10
-15
gradle.properties
gradle.properties
+2
-1
MixinPlayerCustomTexture.java
.../com/owlmaddie/mixin/client/MixinPlayerCustomTexture.java
+0
-5
SkinUtils.java
src/client/java/com/owlmaddie/skin/SkinUtils.java
+7
-8
fabric.mod.json
src/main/resources/fabric.mod.json
+1
-1
No files found.
gradle.properties
View file @
f056dd02
...
...
@@ -11,7 +11,7 @@ archives_base_name=creaturechat
# check these on https://fabricmc.net/develop
minecraft_version
=
1.20.4
yarn_mappings
=
1.20.4+build.3
loader_version
=
0.15.1
0
loader_version
=
0.15.1
1
#Fabric api
fabric_version
=
0.97.0+1.20.4
\ No newline at end of file
src/client/java/com/owlmaddie/mixin/client/MixinPlayerCustomTexture.java
View file @
f056dd02
...
...
@@ -3,8 +3,6 @@ package com.owlmaddie.mixin.client;
import
com.owlmaddie.skin.PlayerCustomTexture
;
import
com.owlmaddie.skin.SkinUtils
;
import
net.minecraft.util.Identifier
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.spongepowered.asm.mixin.Mixin
;
import
org.spongepowered.asm.mixin.Overwrite
;
...
...
@@ -13,8 +11,6 @@ import org.spongepowered.asm.mixin.Overwrite;
*/
@Mixin
(
PlayerCustomTexture
.
class
)
public
abstract
class
MixinPlayerCustomTexture
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
"creaturechat"
);
/**
* Overwrites the default implementation of hasCustomIcon to provide custom skin support.
*
...
...
@@ -27,7 +23,6 @@ public abstract class MixinPlayerCustomTexture {
@Overwrite
public
static
boolean
hasCustomIcon
(
Identifier
skinId
)
{
// Delegate to SkinUtils to check for custom skin properties
LOGGER
.
info
(
"mixin hasCustomIcon called"
);
return
SkinUtils
.
checkCustomSkinKey
(
skinId
);
}
}
src/client/java/com/owlmaddie/skin/SkinUtils.java
View file @
f056dd02
...
...
@@ -4,20 +4,19 @@ import net.minecraft.client.MinecraftClient;
import
net.minecraft.client.texture.AbstractTexture
;
import
net.minecraft.client.texture.NativeImage
;
import
net.minecraft.util.Identifier
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
/**
* SkinUtils contains functions to check for certain black and white pixel values in a skin, to determine
* if the skin contains a custom hidden icon to show in the player chat message.
*/
public
class
SkinUtils
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
"creaturechat"
);
public
static
boolean
checkCustomSkinKey
(
Identifier
skinId
)
{
LOGGER
.
info
(
"mixin checkCustomSkinKey called"
);
// 1. Grab the AbstractTexture from the TextureManager
// Grab the AbstractTexture from the TextureManager
AbstractTexture
tex
=
MinecraftClient
.
getInstance
().
getTextureManager
().
getTexture
(
skinId
);
//
2.
Check if it implements our Mixin interface: IPlayerSkinTexture
// Check if it implements our Mixin interface: IPlayerSkinTexture
if
(
tex
instanceof
IPlayerSkinTexture
iSkin
)
{
//
3.
Get the NativeImage we stored in the Mixin
// Get the NativeImage we stored in the Mixin
NativeImage
image
=
iSkin
.
getLoadedImage
();
if
(
image
!=
null
)
{
int
width
=
image
.
getWidth
();
...
...
src/main/resources/fabric.mod.json
View file @
f056dd02
...
...
@@ -33,7 +33,7 @@
"accessWidener"
:
"creaturechat.accesswidener"
,
"depends"
:
{
"fabricloader"
:
">=0.14.22"
,
"minecraft"
:
"~1.20"
,
"minecraft"
:
"~1.20
.4
"
,
"java"
:
">=17"
,
"fabric-api"
:
"*"
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment