Skip to content

Commit

Permalink
done
Browse files Browse the repository at this point in the history
  • Loading branch information
Wyvest committed May 15, 2022
1 parent 9f4be1a commit d757beb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ org.gradle.jvmargs=-Xmx2G

mod_name = Hytils Reborn
mod_id = hytils-reborn
mod_version = 1.5.0-beta3
mod_version = 1.5.0

loom.platform = forge
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
public class HytilsMixinPlugin implements IMixinConfigPlugin {

private boolean isOptiFine = false;
private boolean hasApplied = false;

@Override
public void onLoad(String mixinPackage) {
Expand Down Expand Up @@ -78,7 +79,7 @@ public void preApply(String targetClassName, ClassNode targetClass, String mixin

@Override
public void postApply(String targetClassName, ClassNode classNode, String mixinClassName, IMixinInfo mixinInfo) {
if (classNode != null && Objects.equals(targetClassName, "net.minecraft.client.gui.GuiPlayerTabOverlay")) {
if (!hasApplied && classNode != null && Objects.equals(targetClassName, "net.minecraft.client.gui.GuiPlayerTabOverlay")) {
for (MethodNode method : classNode.methods) {
final String methodName = FMLDeobfuscatingRemapper.INSTANCE.mapMethodName(classNode.name, method.name, method.desc);
final ListIterator<AbstractInsnNode> iterator = method.instructions.iterator();
Expand All @@ -94,6 +95,7 @@ public void postApply(String targetClassName, ClassNode classNode, String mixinC
// trim the player name to remove player ranks and guild tags
if (methodInsnName.equals("formatPlayerName") || methodInsnName.equals("func_96667_a")) {
method.instructions.insert(next, modifyName());
hasApplied = true;
break;
}
}
Expand Down

0 comments on commit d757beb

Please sign in to comment.