From 56757bd828869ec86a4900d002c5afd03b084089 Mon Sep 17 00:00:00 2001 From: thatsIch Date: Sun, 28 Sep 2014 22:45:57 +0200 Subject: [PATCH] Fixed crafting watchers not having the right type --- src/main/java/appeng/crafting/CraftingWatcher.java | 6 +++--- src/main/java/appeng/me/cache/CraftingGridCache.java | 4 ++-- .../me/cluster/implementations/CraftingCPUCluster.java | 8 +++----- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/main/java/appeng/crafting/CraftingWatcher.java b/src/main/java/appeng/crafting/CraftingWatcher.java index 34537d43..546a3981 100644 --- a/src/main/java/appeng/crafting/CraftingWatcher.java +++ b/src/main/java/appeng/crafting/CraftingWatcher.java @@ -49,17 +49,17 @@ public class CraftingWatcher implements ICraftingWatcher } CraftingGridCache gsc; - ICraftingWatcherHost myObject; + ICraftingWatcherHost host; HashSet myInterests = new HashSet(); public CraftingWatcher(CraftingGridCache cache, ICraftingWatcherHost host) { gsc = cache; - myObject = host; + this.host = host; } public ICraftingWatcherHost getHost() { - return myObject; + return host; } @Override diff --git a/src/main/java/appeng/me/cache/CraftingGridCache.java b/src/main/java/appeng/me/cache/CraftingGridCache.java index 6b4d8ca2..f1c93027 100644 --- a/src/main/java/appeng/me/cache/CraftingGridCache.java +++ b/src/main/java/appeng/me/cache/CraftingGridCache.java @@ -83,8 +83,8 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper HashMap links = new HashMap(); boolean updateList = false; - final private SetMultimap> interests = HashMultimap.create(); - final public GenericInterestManager> interestManager = new GenericInterestManager>( interests ); + final private SetMultimap interests = HashMultimap.create(); + final public GenericInterestManager interestManager = new GenericInterestManager( interests ); class ActiveCpuIterator implements Iterator { diff --git a/src/main/java/appeng/me/cluster/implementations/CraftingCPUCluster.java b/src/main/java/appeng/me/cluster/implementations/CraftingCPUCluster.java index 5e1da10e..7affca59 100644 --- a/src/main/java/appeng/me/cluster/implementations/CraftingCPUCluster.java +++ b/src/main/java/appeng/me/cluster/implementations/CraftingCPUCluster.java @@ -1,11 +1,7 @@ package appeng.me.cluster.implementations; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.Map; +import java.util.*; import java.util.Map.Entry; -import java.util.Set; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; @@ -290,9 +286,11 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU if ( sg.interestManager.containsKey( diff ) ) { Set list = sg.interestManager.get( diff ); + if ( !list.isEmpty() ) { for (CraftingWatcher iw : list) + iw.getHost().onRequestChange( sg, diff ); } }