diff --git a/src/main/java/com/seosean/showspawntime/mixins/MixinNetHandlerPlayClient.java b/src/main/java/com/seosean/showspawntime/mixins/MixinNetHandlerPlayClient.java index 9b42cb5..ff53c0a 100644 --- a/src/main/java/com/seosean/showspawntime/mixins/MixinNetHandlerPlayClient.java +++ b/src/main/java/com/seosean/showspawntime/mixins/MixinNetHandlerPlayClient.java @@ -25,24 +25,26 @@ public void handleEntityMetadata(S1CPacketEntityMetadata packetIn, CallbackInfo if (packetIn == null) { return; } - List list = packetIn.func_149376_c(); if (list == null) { return; } - if (list.isEmpty()) { return; } - - Entity entity = Minecraft.getMinecraft().theWorld.getEntityByID(packetIn.getEntityId()); - if (entity instanceof EntityArmorStand) { - for (DataWatcher.WatchableObject watchableObject : new ArrayList<>(packetIn.func_149376_c())) { - if (watchableObject != null) { - if (watchableObject.getObjectType() == 4 && watchableObject.getDataValueId() == 2) { - if (watchableObject.getObject() instanceof String) { - String armorstandName = StringUtils.trim((String) watchableObject.getObject()); - ShowSpawnTime.getPowerupDetect().detectArmorstand(armorstandName, packetIn.getEntityId()); + + if (Minecraft.getMinecraft() != null) { + if (Minecraft.getMinecraft().theWorld != null) { + Entity entity = Minecraft.getMinecraft().theWorld.getEntityByID(packetIn.getEntityId()); + if (entity instanceof EntityArmorStand) { + for (DataWatcher.WatchableObject watchableObject : new ArrayList<>(packetIn.func_149376_c())) { + if (watchableObject != null) { + if (watchableObject.getObjectType() == 4 && watchableObject.getDataValueId() == 2) { + if (watchableObject.getObject() instanceof String) { + String armorstandName = StringUtils.trim((String) watchableObject.getObject()); + ShowSpawnTime.getPowerupDetect().detectArmorstand(armorstandName, packetIn.getEntityId()); + } + } } } } diff --git a/src/main/java/com/seosean/showspawntime/mixins/MixinRendererLivingEntity.java b/src/main/java/com/seosean/showspawntime/mixins/MixinRendererLivingEntity.java index 12d033e..ebf9bd3 100644 --- a/src/main/java/com/seosean/showspawntime/mixins/MixinRendererLivingEntity.java +++ b/src/main/java/com/seosean/showspawntime/mixins/MixinRendererLivingEntity.java @@ -83,13 +83,13 @@ private void onRedirecting(RendererLivingEntity instance, Entity entityIn, do GlStateManager.enableTexture2D(); fontrenderer.drawString(nameTagStr, (float) (-fontrenderer.getStringWidth(str) / 2.0), (float) i, MainConfiguration.powerupNameTagRenderColor, MainConfiguration.PowerupNameTagShadow); - fontrenderer.drawString(countdownStr.replace("§f", ""), (float) (-fontrenderer.getStringWidth(str) / 2.0 + fontrenderer.getStringWidth(nameTagStr)), (float) i, MainConfiguration.powerupCountDownRenderColor, true); + fontrenderer.drawString(countdownStr.replace("§f", ""), (float) (-fontrenderer.getStringWidth(str) / 2.0 + fontrenderer.getStringWidth("A" + nameTagStr)), (float) i, MainConfiguration.powerupCountDownRenderColor, true); GlStateManager.enableDepth(); GlStateManager.depthMask(true); fontrenderer.drawString(nameTagStr, (float) (-fontrenderer.getStringWidth(str) / 2.0), (float) i, -1, MainConfiguration.PowerupNameTagShadow); - fontrenderer.drawString(countdownStr.replace("§f", ""), (float) (-fontrenderer.getStringWidth(str) / 2.0 + fontrenderer.getStringWidth(nameTagStr)), (float) i, 0x99CCFF, true); + fontrenderer.drawString(countdownStr.replace("§f", ""), (float) (-fontrenderer.getStringWidth(str) / 2.0 + fontrenderer.getStringWidth("A" + nameTagStr)), (float) i, 0x99CCFF, true); GlStateManager.enableLighting(); GlStateManager.disableBlend();