diff --git a/gradle.properties b/gradle.properties index d94438d4b..e05171c06 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ aebuild=7 aegroup=appeng aebasename=appliedenergistics2 extended=extended_life -extendedversion=v51e +extendedversion=v51f ######################################################### # Versions # ######################################################### diff --git a/src/main/java/appeng/core/AppEng.java b/src/main/java/appeng/core/AppEng.java index ab656df47..8983f5228 100644 --- a/src/main/java/appeng/core/AppEng.java +++ b/src/main/java/appeng/core/AppEng.java @@ -25,6 +25,7 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Nonnull; +import appeng.helpers.NonBlockingItems; import com.google.common.base.Stopwatch; import com.google.common.collect.Lists; @@ -238,6 +239,8 @@ public final class AppEng AppEng.proxy.postInit(); AEConfig.instance().save(); + NonBlockingItems.INSTANCE.init(); + NetworkRegistry.INSTANCE.registerGuiHandler( this, GuiBridge.GUI_Handler ); NetworkHandler.init( "AE2" ); diff --git a/src/main/java/appeng/helpers/DualityInterface.java b/src/main/java/appeng/helpers/DualityInterface.java index ffa4574a5..7bda6f884 100644 --- a/src/main/java/appeng/helpers/DualityInterface.java +++ b/src/main/java/appeng/helpers/DualityInterface.java @@ -1154,38 +1154,37 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn } } - if( this.isBlocking() ) + InventoryAdaptor ad = InventoryAdaptor.getAdaptor( te, s.getOpposite() ); + if( ad != null ) { - IPhantomTile phantomTE; - if( Loader.isModLoaded( "actuallyadditions" ) && te instanceof IPhantomTile ) + if( this.isBlocking() ) { - phantomTE = ( (IPhantomTile) te ); - if( phantomTE.hasBoundPosition() ) + IPhantomTile phantomTE; + if( Loader.isModLoaded( "actuallyadditions" ) && te instanceof IPhantomTile ) { - TileEntity phantom = w.getTileEntity( phantomTE.getBoundPosition() ); - if( NonBlockingItems.INSTANCE.getMap().containsKey( phantom.getBlockType().getRegistryName().getResourceDomain() ) ) + phantomTE = ( (IPhantomTile) te ); + if( phantomTE.hasBoundPosition() ) { - if( isCustomInvBlocking( phantom, s ) ) + TileEntity phantom = w.getTileEntity( phantomTE.getBoundPosition() ); + if( NonBlockingItems.INSTANCE.getMap().containsKey( w.getBlockState( phantomTE.getBoundPosition() ).getBlock().getRegistryName().getResourceDomain() ) ) { - visitedFaces.remove( s ); - continue; + if( isCustomInvBlocking( phantom, s ) ) + { + visitedFaces.remove( s ); + continue; + } } } } - } - else if( NonBlockingItems.INSTANCE.getMap().containsKey( te.getBlockType().getRegistryName().getResourceDomain() ) ) - { - if( isCustomInvBlocking( te, s ) ) + else if( NonBlockingItems.INSTANCE.getMap().containsKey( w.getBlockState( tile.getPos().offset( s ) ).getBlock().getRegistryName().getResourceDomain() ) ) { - visitedFaces.remove( s ); - continue; + if( isCustomInvBlocking( te, s ) ) + { + visitedFaces.remove( s ); + continue; + } } - } - - final InventoryAdaptor ad = InventoryAdaptor.getAdaptor( te, s.getOpposite() ); - if( ad != null ) - { - if( invIsBlocked( ad ) ) + else if( invIsBlocked( ad ) ) { visitedFaces.remove( s ); continue; @@ -1235,34 +1234,34 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn final TileEntity te = w.getTileEntity( tile.getPos().offset( s ) ); IPhantomTile phantomTE; - if( Loader.isModLoaded( "actuallyadditions" ) && Loader.isModLoaded( "gregtech" ) && te instanceof IPhantomTile ) + final InventoryAdaptor ad = InventoryAdaptor.getAdaptor( te, s.getOpposite() ); + if( ad != null ) { - phantomTE = ( (IPhantomTile) te ); - if( phantomTE.hasBoundPosition() ) + if( Loader.isModLoaded( "actuallyadditions" ) && Loader.isModLoaded( "gregtech" ) && te instanceof IPhantomTile ) { - TileEntity phantom = w.getTileEntity( phantomTE.getBoundPosition() ); - if( NonBlockingItems.INSTANCE.getMap().containsKey( phantom.getBlockType().getRegistryName().getResourceDomain() ) ) + phantomTE = ( (IPhantomTile) te ); + if( phantomTE.hasBoundPosition() ) { - if( !isCustomInvBlocking( phantom, s ) ) + TileEntity phantom = w.getTileEntity( phantomTE.getBoundPosition() ); + if( NonBlockingItems.INSTANCE.getMap().containsKey( w.getBlockState( phantomTE.getBoundPosition() ).getBlock().getRegistryName().getResourceDomain() ) ) { - allAreBusy = false; - break; + if( !isCustomInvBlocking( phantom, s ) ) + { + allAreBusy = false; + break; + } } } } - } - else if( NonBlockingItems.INSTANCE.getMap().containsKey( te.getBlockType().getRegistryName().getResourceDomain() ) ) - { - if( !isCustomInvBlocking( te, s ) ) + else if( NonBlockingItems.INSTANCE.getMap().containsKey( w.getBlockState( tile.getPos().offset( s ) ).getBlock().getRegistryName().getResourceDomain() ) ) { - allAreBusy = false; - break; + if( !isCustomInvBlocking( te, s ) ) + { + allAreBusy = false; + break; + } } - } - else - { - final InventoryAdaptor ad = InventoryAdaptor.getAdaptor( te, s.getOpposite() ); - if( ad != null ) + else { if( !invIsBlocked( ad ) ) { diff --git a/src/main/java/appeng/helpers/NonBlockingItems.java b/src/main/java/appeng/helpers/NonBlockingItems.java index ac06b912a..7d4ba7a95 100644 --- a/src/main/java/appeng/helpers/NonBlockingItems.java +++ b/src/main/java/appeng/helpers/NonBlockingItems.java @@ -61,7 +61,8 @@ public class NonBlockingItems found = true; ItemStack itemStack = metaItem2.getStackForm(); NON_BLOCKING_MAP.get( modid ).putIfAbsent( itemStack.getItem(), new IntOpenHashSet() ); - NON_BLOCKING_MAP.get( modid ).computeIfPresent( itemStack.getItem(), ( item, intSet ) -> { + NON_BLOCKING_MAP.get( modid ).computeIfPresent( itemStack.getItem(), ( item, intSet ) -> + { intSet.add( itemStack.getItemDamage() ); return intSet; } ); @@ -72,7 +73,8 @@ public class NonBlockingItems if( !itemStack.isEmpty() ) { NON_BLOCKING_MAP.get( modid ).putIfAbsent( itemStack.getItem(), new IntOpenHashSet() ); - NON_BLOCKING_MAP.get( modid ).computeIfPresent( itemStack.getItem(), ( item, intSet ) -> { + NON_BLOCKING_MAP.get( modid ).computeIfPresent( itemStack.getItem(), ( item, intSet ) -> + { intSet.add( itemStack.getItemDamage() ); return intSet; } ); @@ -86,13 +88,15 @@ public class NonBlockingItems } else if( ModItemMeta[0].equals( "ore" ) ) { - OreDictionary.getOres( ModItemMeta[1] ).forEach( itemStack -> { - NON_BLOCKING_MAP.get( modid ).putIfAbsent( itemStack.getItem(), new IntOpenHashSet() ); - NON_BLOCKING_MAP.get( modid ).computeIfPresent( itemStack.getItem(), ( item, intSet ) -> { - intSet.add( itemStack.getItemDamage() ); - return intSet; - } ); - } ); + OreDictionary.getOres( ModItemMeta[1] ).forEach( itemStack -> + { + NON_BLOCKING_MAP.get( modid ).putIfAbsent( itemStack.getItem(), new IntOpenHashSet() ); + NON_BLOCKING_MAP.get( modid ).computeIfPresent( itemStack.getItem(), ( item, intSet ) -> + { + intSet.add( itemStack.getItemDamage() ); + return intSet; + } ); + } ); } else { @@ -100,7 +104,8 @@ public class NonBlockingItems if( !itemStack.isEmpty() ) { NON_BLOCKING_MAP.get( modid ).putIfAbsent( itemStack.getItem(), new IntOpenHashSet() ); - NON_BLOCKING_MAP.get( modid ).computeIfPresent( itemStack.getItem(), ( item, intSet ) -> { + NON_BLOCKING_MAP.get( modid ).computeIfPresent( itemStack.getItem(), ( item, intSet ) -> + { intSet.add( itemStack.getItemDamage() ); return intSet; } ); @@ -120,4 +125,8 @@ public class NonBlockingItems { return NON_BLOCKING_MAP; } + + public void init() + { + } }