Skip to content

Commit

Permalink
stop processing nametags when world isnt loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
My-Name-Is-Jeff committed Nov 17, 2021
1 parent 9852c9d commit 8553396
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/kotlin/skytils/skytilsmod/Skytils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import net.minecraft.client.gui.GuiButton
import net.minecraft.client.gui.GuiIngameMenu
import net.minecraft.client.gui.GuiScreen
import net.minecraft.client.settings.KeyBinding
import net.minecraft.entity.Entity
import net.minecraft.launchwrapper.Launch
import net.minecraft.network.play.client.C01PacketChatMessage
import net.minecraft.network.play.server.S1CPacketEntityMetadata
Expand Down Expand Up @@ -396,7 +397,7 @@ class Skytils {
if (event.packet is S1CPacketEntityMetadata) {
val nameObj = event.packet.func_149376_c()?.find { it.dataValueId == 2 }
if (nameObj != null) {
val entity = mc.theWorld.getEntityByID(event.packet.entityId)
val entity = mc.theWorld?.getEntityByID(event.packet.entityId)

if (entity is ExtensionEntityLivingBase) {
entity.skytilsHook.onNewDisplayName(nameObj.`object` as String)
Expand Down

0 comments on commit 8553396

Please sign in to comment.