Compare commits

...

9 Commits

Author SHA1 Message Date
fscan 6f30658d41 Backport dupe fix (#3196) 2017-11-05 05:37:21 +01:00
fscan 07bcd528ea we dont use scala ... (#3097) 2017-09-18 11:45:47 +02:00
fscan 5cbdc1d769 Fix fluid P2p voiding excess liquids (#3090)
Backported from 1.12
2017-09-16 17:38:01 +02:00
fscan 05b29d0de0 Cache the STORAGE_MONITORABLE_ACCESSOR Capability to reduce the amount of MENetworkCellArrayUpdates (#3077) 2017-09-09 13:30:16 +02:00
fscan 4a6162907c Merge pull request #3062 from fscan/inventory-save-changes-2
Save changes in AppEngInternalAEInventory too.
2017-08-31 14:24:43 +02:00
Florian Scandella dfb23fd9e7 Save changes in AppEngInternalAEInventory too. 2017-08-31 14:00:40 +02:00
fscan d8ca9fc2f9 Merge pull request #3061 from fscan/inventory-save-changes
Always save changes when inventory changes.
2017-08-30 00:26:02 +02:00
Florian Scandella e9a8a8cdff always save changes when inventory changes.
should fix #3059
2017-08-29 23:21:08 +02:00
fscan 8163b30479 Fixes pattern terminal extracting real items and voiding them on JEI recipe transfer (#3054) 2017-08-21 10:59:22 +02:00
8 changed files with 23 additions and 10 deletions
@@ -205,7 +205,15 @@ public class PacketJEIRecipe extends AppEngPacket
if( filter == null || filter.isListed( request ) )
{
request.setStackSize( 1 );
final IAEItemStack out = Platform.poweredExtraction( energy, storage, request, cct.getActionSource() );
IAEItemStack out;
if ( realForFake == Actionable.SIMULATE )
{
out = storage.extractItems( request, Actionable.SIMULATE, cct.getActionSource() );
}
else
{
out = Platform.poweredExtraction( energy, storage, request, cct.getActionSource() );
}
if( out != null )
{
whichItem = out.getItemStack();
@@ -21,8 +21,6 @@ package appeng.helpers;
import java.util.Iterator;
import scala.NotImplementedError;
public class NonNullArrayIterator<E> implements Iterator<E>
{
@@ -58,6 +56,6 @@ public class NonNullArrayIterator<E> implements Iterator<E>
@Override
public void remove()
{
throw new NotImplementedError();
throw new UnsupportedOperationException();
}
}
@@ -20,6 +20,7 @@ package appeng.integration.modules.jei;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
@@ -28,7 +29,6 @@ import net.minecraft.item.ItemStack;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.BlankRecipeWrapper;
import mezz.jei.api.recipe.wrapper.IShapedCraftingRecipeWrapper;
import scala.actors.threadpool.Arrays;
import appeng.api.exceptions.MissingIngredientError;
import appeng.api.exceptions.RegistrationError;
@@ -136,10 +136,12 @@ class ItemHandlerAdapter implements IMEInventory<IAEItemStack>, IBaseMonitor<IAE
extracted.stackSize = remainingCurrentSlot;
}
// We're just gonna use the first stack we get our hands on as the template for the rest
// We're just gonna use the first stack we get our hands on as the template for the rest.
// In case some stupid itemhandler (aka forge) returns an internal state we have to do a second
// expensive copy again.
if( gathered == null )
{
gathered = extracted;
gathered = extracted.copy();
}
else
{
@@ -199,7 +199,7 @@ public class PartP2PFluids extends PartP2PTunnel<PartP2PFluids> implements IFlui
i = list.iterator();
int used = 0;
while( i.hasNext() )
while( i.hasNext() && available > 0 )
{
final PartP2PFluids l = i.next();
@@ -221,7 +221,7 @@ public class PartP2PFluids extends PartP2PTunnel<PartP2PFluids> implements IFlui
}
available -= insert.amount;
used += insert.amount;
used += l.tmpUsed;
}
if( stack.pop() != this )
@@ -169,6 +169,7 @@ public class AppEngInternalAEInventory implements IInventory, Iterable<ItemStack
if( this.te != null && Platform.isServer() )
{
this.te.onChangeInventory( this, slot, InvOperation.decreaseStackSize, ns, null );
this.te.saveChanges();
}
return ns;
@@ -215,6 +216,7 @@ public class AppEngInternalAEInventory implements IInventory, Iterable<ItemStack
}
this.te.onChangeInventory( this, slot, InvOperation.setInventorySlotContents, removed, added );
this.te.saveChanges();
}
}
@@ -242,6 +244,7 @@ public class AppEngInternalAEInventory implements IInventory, Iterable<ItemStack
if( this.te != null && Platform.isServer() )
{
this.te.onChangeInventory( this, -1, InvOperation.markDirty, null, null );
this.te.saveChanges();
}
}
@@ -174,6 +174,7 @@ public class AppEngInternalInventory implements IInventory, Iterable<ItemStack>
if( this.getTileEntity() != null && this.eventsEnabled() )
{
this.getTileEntity().onChangeInventory( this, -1, InvOperation.markDirty, null, null );
this.getTileEntity().saveChanges();
}
}
@@ -200,6 +201,7 @@ public class AppEngInternalInventory implements IInventory, Iterable<ItemStack>
if( this.getTileEntity() != null && this.eventsEnabled() )
{
this.getTileEntity().onChangeInventory( this, slotIndex, InvOperation.markDirty, null, null );
this.getTileEntity().saveChanges();
}
}
+1 -1
View File
@@ -1423,7 +1423,7 @@ public class Platform
if( target.hasCapability( Capabilities.STORAGE_MONITORABLE_ACCESSOR, null ) )
{
return 0;
return target.getCapability( Capabilities.STORAGE_MONITORABLE_ACCESSOR, null ).hashCode();
}
else if( target instanceof TileEntityChest )
{