update directly instead of relying on forge events

This commit is contained in:
PrototypeTrousers
2021-10-29 15:12:11 -03:00
parent 0c9544b5fb
commit b018985a54
4 changed files with 9 additions and 5 deletions
@@ -25,7 +25,9 @@ import java.util.Objects;
import javax.annotation.Nonnull;
import appeng.api.networking.storage.IStorageGrid;
import appeng.fluids.helper.IConfigurableFluidInventory;
import appeng.me.cache.GridStorageCache;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -374,7 +376,7 @@ public class PartFluidStorageBus extends PartSharedStorageBus implements IMEMoni
try
{
// force grid to update handlers...
this.getProxy().getGrid().postEvent( new MENetworkCellArrayUpdate() );
(( GridStorageCache ) this.getProxy().getGrid().getCache( IStorageGrid.class )).cellUpdate( null );
}
catch( final GridAccessException ignore )
{
+2 -2
View File
@@ -94,7 +94,7 @@ public class GridStorageCache implements IStorageGrid
this.removeCellProvider( cc, tracker );
this.inactiveCellProviders.remove( cc );
this.getGrid().postEvent( new MENetworkCellArrayUpdate() );
cellUpdate( null );
tracker.applyChanges();
}
@@ -119,7 +119,7 @@ public class GridStorageCache implements IStorageGrid
final ICellContainer cc = (ICellContainer) machine;
this.inactiveCellProviders.add( cc );
this.getGrid().postEvent( new MENetworkCellArrayUpdate() );
cellUpdate( null );
if( node.isActive() )
{
@@ -23,6 +23,8 @@ import java.util.Collections;
import java.util.List;
import java.util.Objects;
import appeng.api.networking.storage.IStorageGrid;
import appeng.me.cache.GridStorageCache;
import appeng.tile.misc.TileInterface;
import appeng.tile.networking.TileCableBus;
import com.jaquadro.minecraft.storagedrawers.api.capabilities.IItemRepository;
@@ -557,7 +559,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
try
{
// force grid to update handlers...
this.getProxy().getGrid().postEvent( new MENetworkCellArrayUpdate() );
(( GridStorageCache ) this.getProxy().getGrid().getCache( IStorageGrid.class )).cellUpdate( null );
}
catch( final GridAccessException e )
{