1.21.9: Fix crash
This commit is contained in:
+1
-1
@@ -337,7 +337,7 @@ public class CloakFeatureRenderer extends FeatureRenderer<PlayerEntityRenderStat
|
|||||||
@Override
|
@Override
|
||||||
public void render(MatrixStack matrices, OrderedRenderCommandQueue queue, int light, PlayerEntityRenderState state,
|
public void render(MatrixStack matrices, OrderedRenderCommandQueue queue, int light, PlayerEntityRenderState state,
|
||||||
float limbAngle, float limbDistance) {
|
float limbAngle, float limbDistance) {
|
||||||
if (state.invisible || !state.capeVisible
|
if (state.displayName == null || state.invisible || !state.capeVisible
|
||||||
|| state.skinTextures.cape() != null) {
|
|| state.skinTextures.cape() != null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,9 @@ public class HatFeatureRenderer extends FeatureRenderer<PlayerEntityRenderState,
|
|||||||
// @Override
|
// @Override
|
||||||
public void render(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light,
|
public void render(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light,
|
||||||
PlayerEntityRenderState state, float limbAngle, float limbDistance) {
|
PlayerEntityRenderState state, float limbAngle, float limbDistance) {
|
||||||
|
if (state.displayName == null)
|
||||||
|
return;
|
||||||
|
|
||||||
SaturnPlayer player = SaturnPlayer.get(state.displayName.getString());
|
SaturnPlayer player = SaturnPlayer.get(state.displayName.getString());
|
||||||
|
|
||||||
if (state.invisible || player == null || player.hat.isEmpty()) {
|
if (state.invisible || player == null || player.hat.isEmpty()) {
|
||||||
|
|||||||
@@ -35,6 +35,9 @@ public abstract class NameTagMixin<S extends EntityRenderState> {
|
|||||||
@Inject(method = "renderLabelIfPresent", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "renderLabelIfPresent", at = @At("HEAD"), cancellable = true)
|
||||||
protected void renderLabelIfPresent(S state, MatrixStack matrices, OrderedRenderCommandQueue queue,
|
protected void renderLabelIfPresent(S state, MatrixStack matrices, OrderedRenderCommandQueue queue,
|
||||||
CameraRenderState cameraRenderState, CallbackInfo ci) {
|
CameraRenderState cameraRenderState, CallbackInfo ci) {
|
||||||
|
if (state.displayName == null)
|
||||||
|
return;
|
||||||
|
|
||||||
UUID uuid = isSaturn(state);
|
UUID uuid = isSaturn(state);
|
||||||
|
|
||||||
if (uuid != null) {
|
if (uuid != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user