Skip to content
This repository has been archived by the owner on Jul 2, 2023. It is now read-only.

Commit

Permalink
[create release] Fix invisible nametags through walls
Browse files Browse the repository at this point in the history
Also add remapping tools. May be useful for replay mod.
  • Loading branch information
TheKodeToad committed Oct 30, 2021
1 parent 9788033 commit 99980a5
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@ public void clearChat() {
chatLines.clear();
}

@Shadow @Final
@Shadow
@Final
private List<ChatLine> drawnChatLines;

@Shadow @Final
@Shadow
@Final
private List<ChatLine> chatLines;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package me.mcblueparrot.client.mixin.client;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Invoker;

import me.mcblueparrot.client.util.access.AccessRender;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.entity.Entity;

@Mixin(Render.class)
public abstract class MixinRender<T extends Entity> implements AccessRender<T> {

@Override
@Invoker("renderName")
public abstract void doRenderName(T entity, double x, double y, double z);

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import me.mcblueparrot.client.Client;
import me.mcblueparrot.client.Cullable;
import me.mcblueparrot.client.events.CameraRotateEvent;
import me.mcblueparrot.client.util.access.AccessRender;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.renderer.entity.Render;
Expand All @@ -23,10 +24,12 @@
@Mixin(RenderManager.class)
public abstract class MixinRenderManager {

@SuppressWarnings("unchecked")
@Inject(method = "doRenderEntity", at = @At("HEAD"), cancellable = true)
public void cullEntity(Entity entity, double x, double y, double z, float entityYaw, float partialTicks,
boolean hideDebugBox, CallbackInfoReturnable<Boolean> callback) {
if(((Cullable) entity).isCulled()) {
((AccessRender<Entity>) getEntityRenderObject(entity)).doRenderName(entity, x, y, z);
callback.setReturnValue(renderEngine == null);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package me.mcblueparrot.client.util.access;

import net.minecraft.entity.Entity;

public interface AccessRender<T extends Entity> {

void doRenderName(T entity, double x, double y, double z);

}
1 change: 1 addition & 0 deletions game/src/main/resources/mixins.solclient.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"client.MixinWorldClient",
"client.MixinGuiContainer",
"client.MixinScreenshotHelper",
"client.MixinRender",
"mod.MixinArabicNumeralsMod$MixinEnchantment",
"mod.MixinArabicNumeralsMod$MixinInventoryEffectRenderer",
"mod.MixinArabicNumeralsMod$MixinItemPotion",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Sol Client",
"version": "0.2.1",
"version": "0.2.2",
"description": "Launcher for Sol Client.",
"main": "main.js",
"scripts": {
Expand Down
2 changes: 2 additions & 0 deletions tools/remap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
wget --no-clobber https://repo1.maven.org/maven2/net/md-5/SpecialSource/1.10.0/SpecialSource-1.10.0-shaded.jar
java -jar SpecialSource-1.10.0-shaded.jar "$@"
1 change: 1 addition & 0 deletions tools/searge2mcp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
./remap.sh --in-jar $1 --out-jar $2 --srg-in ~/.gradle/caches/minecraft/de/oceanlabs/mcp/mcp_stable/22/srgs/srg-mcp.srg
1 change: 1 addition & 0 deletions tools/searge2notch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
./remap.sh --in-jar $1 --out-jar $2 --srg-in ~/.gradle/caches/minecraft/de/oceanlabs/mcp/mcp_stable/22/srgs/notch-srg.srg --reverse

0 comments on commit 99980a5

Please sign in to comment.