question: public void onTick ( ) { int prevLight = lightLevel ; lightLevel = getLightFromItemStack ( player . getCurrentEquippedItem ( ) ) ; for ( ItemStack armor : player . inventory . armorInventory ) { lightLevel = Math . max ( lightLevel , getLightFromItemStack ( armor ) ) ; } if ( prevLight != 0 && lightLevel != prevLight ) { lightLevel = 0 ; } else { if ( player . isBurning ( ) ) { lightLevel = 15 ; } } if ( ! enabled && lightLevel > 0 ) { enableLight ( ) ; } else if ( enabled && lightLevel < 1 ) { disableLight ( ) ; } }
target:  Since they are IDynamicLightSource instances, they will already receive updates! Why do we need to do this? Because Player Entities can change equipment and we really don't want this method in an onUpdate tick, way too expensive. So we put it in a seperate Thread!