First pass trying to optimise LivingUpdateEvent handlers, see issue #484

This commit is contained in:
Electroblob77
2020-08-03 22:47:08 +01:00
parent 9d8b0b3a90
commit 7401a8e3b4
6 changed files with 17 additions and 16 deletions
@@ -336,6 +336,10 @@ public class WizardData implements INBTSerializable<NBTTagCompound> {
*/
private void updateImbuedItems(){
// FIXME: Iterating through the entire inventory each tick is an AWFUL way of doing this, and is super-slow!
// Change the imbuement durations map to be ItemStack -> Integer and just decrement them, adding entries
// whenever an item with an imbuement enters the inventory and removing them when the time expires.
Set<Imbuement> activeImbuements = new HashSet<Imbuement>();
// For each item in the player's inventory