fix items in level emitters with crafting cards not showing up
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@ aechannel=stable
|
|||||||
aebuild=7
|
aebuild=7
|
||||||
aegroup=appeng
|
aegroup=appeng
|
||||||
aebasename=appliedenergistics2
|
aebasename=appliedenergistics2
|
||||||
trousers=omni-fixes-v46e
|
trousers=omni-fixes-v46f
|
||||||
|
|
||||||
#########################################################
|
#########################################################
|
||||||
# Versions #
|
# Versions #
|
||||||
|
|||||||
+31
-3
@@ -35,7 +35,6 @@ import java.util.concurrent.Executors;
|
|||||||
import java.util.concurrent.Future;
|
import java.util.concurrent.Future;
|
||||||
import java.util.concurrent.ThreadFactory;
|
import java.util.concurrent.ThreadFactory;
|
||||||
|
|
||||||
import appeng.api.storage.data.IAEFluidStack;
|
|
||||||
import com.google.common.collect.HashMultimap;
|
import com.google.common.collect.HashMultimap;
|
||||||
import com.google.common.collect.ImmutableCollection;
|
import com.google.common.collect.ImmutableCollection;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
@@ -272,6 +271,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
final Object2ObjectMap<IAEItemStack, ImmutableList<ICraftingPatternDetails>> oldItems = new Object2ObjectOpenHashMap<>(this.craftableItems);
|
final Object2ObjectMap<IAEItemStack, ImmutableList<ICraftingPatternDetails>> oldItems = new Object2ObjectOpenHashMap<>(this.craftableItems);
|
||||||
|
final Set<IAEItemStack> oldEmitableItems = new HashSet<>(this.emitableItems);
|
||||||
|
|
||||||
// erase list.
|
// erase list.
|
||||||
this.craftingMethods.clear();
|
this.craftingMethods.clear();
|
||||||
@@ -317,14 +317,42 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper
|
|||||||
ObjectSet<Entry<IAEItemStack, ImmutableList<ICraftingPatternDetails>>> i = oldItems.entrySet();
|
ObjectSet<Entry<IAEItemStack, ImmutableList<ICraftingPatternDetails>>> i = oldItems.entrySet();
|
||||||
for ( Entry<IAEItemStack, ImmutableList<ICraftingPatternDetails>> ais : i) {
|
for ( Entry<IAEItemStack, ImmutableList<ICraftingPatternDetails>> ais : i) {
|
||||||
if (!this.craftableItems.containsKey( ais.getKey() )) {
|
if (!this.craftableItems.containsKey( ais.getKey() )) {
|
||||||
craftablesChanged.put( ais.getKey().setCraftable( false ), ais.getValue() );
|
IAEItemStack changedStack = ais.getKey().copy();
|
||||||
|
changedStack.reset();
|
||||||
|
changedStack.setCraftable( false );
|
||||||
|
craftablesChanged.put( changedStack, ais.getValue() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ObjectSet<Entry<IAEItemStack, ImmutableList<ICraftingPatternDetails>>> j = this.craftableItems.entrySet();
|
ObjectSet<Entry<IAEItemStack, ImmutableList<ICraftingPatternDetails>>> j = this.craftableItems.entrySet();
|
||||||
for ( Entry<IAEItemStack, ImmutableList<ICraftingPatternDetails>> ais : j) {
|
for ( Entry<IAEItemStack, ImmutableList<ICraftingPatternDetails>> ais : j) {
|
||||||
if (!oldItems.containsKey( ais )){
|
if (!oldItems.containsKey( ais )){
|
||||||
craftablesChanged.put( ais.getKey().setCraftable( true ), ais.getValue() );
|
IAEItemStack changedStack = ais.getKey().copy();
|
||||||
|
changedStack.reset();
|
||||||
|
changedStack.setCraftable( true );
|
||||||
|
craftablesChanged.put( changedStack, ais.getValue() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for( final IAEItemStack st : oldEmitableItems )
|
||||||
|
{
|
||||||
|
if( !emitableItems.contains( st ) )
|
||||||
|
{
|
||||||
|
IAEItemStack changedStack = st.copy();
|
||||||
|
changedStack.reset();
|
||||||
|
changedStack.setCraftable( false );
|
||||||
|
craftablesChanged.put( changedStack, null );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for( final IAEItemStack st : this.emitableItems )
|
||||||
|
{
|
||||||
|
if( !oldEmitableItems.contains( st ) )
|
||||||
|
{
|
||||||
|
IAEItemStack changedStack = st.copy();
|
||||||
|
changedStack.reset();
|
||||||
|
changedStack.setCraftable( true );
|
||||||
|
craftablesChanged.put( changedStack, null );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+4
-2
@@ -214,11 +214,13 @@ public class NetworkMonitor<T extends IAEStack<T>> implements IMEMonitor<T>
|
|||||||
for( final T changedItem : input )
|
for( final T changedItem : input )
|
||||||
{
|
{
|
||||||
if (changedItem.isCraftable()) {
|
if (changedItem.isCraftable()) {
|
||||||
this.cachedList.add( changedItem.copy().setCraftable( true ) );
|
this.cachedList.add( changedItem );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.cachedList.findPrecise( changedItem ).setCraftable( false );
|
T i = this.cachedList.findPrecise( changedItem );
|
||||||
|
if (i != null)
|
||||||
|
i.setCraftable( false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -507,6 +507,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
|||||||
public void upgradesChanged()
|
public void upgradesChanged()
|
||||||
{
|
{
|
||||||
this.configureWatchers();
|
this.configureWatchers();
|
||||||
|
this.updateState();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user