See own nametag
This commit is contained in:
@@ -0,0 +1,21 @@
|
|||||||
|
package de.fullrisk.citrusDev.mixin;
|
||||||
|
|
||||||
|
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.entity.LivingEntityRenderer;
|
||||||
|
import net.minecraft.world.entity.LivingEntity;
|
||||||
|
import net.minecraft.world.entity.player.Player;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
|
||||||
|
@Mixin(LivingEntityRenderer.class)
|
||||||
|
public abstract class OwnNametagMixin {
|
||||||
|
|
||||||
|
@ModifyReturnValue(method = "shouldShowName", at = @At("RETURN"))
|
||||||
|
private boolean citrusDev$showOwnNametag(boolean original, LivingEntity entity, double distance) {
|
||||||
|
if (!original && entity instanceof Player && entity == Minecraft.getInstance().player) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return original;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,7 +9,8 @@
|
|||||||
"SliderComponentMixin",
|
"SliderComponentMixin",
|
||||||
"MouseHandlerMixin",
|
"MouseHandlerMixin",
|
||||||
"LightmapRenderStateExtractorMixin",
|
"LightmapRenderStateExtractorMixin",
|
||||||
"PlayerNametagMixin"
|
"PlayerNametagMixin",
|
||||||
|
"OwnNametagMixin"
|
||||||
],
|
],
|
||||||
"injectors": {
|
"injectors": {
|
||||||
"defaultRequire": 1
|
"defaultRequire": 1
|
||||||
|
|||||||
Reference in New Issue
Block a user