Since we're syncing anyway, make the client do a deferred refresh to allow syncing to occur, rather than trying to keep track of prev stacks itself
This commit is contained in:
@@ -78,6 +78,8 @@ public class ContainerArcaneWorkbench extends Container implements ISpellSortabl
|
||||
private boolean sortDescending = false;
|
||||
private String searchText = "";
|
||||
|
||||
public boolean needsRefresh;
|
||||
|
||||
public ContainerArcaneWorkbench(IInventory inventory, TileEntityArcaneWorkbench tileentity){
|
||||
|
||||
this.tileentity = tileentity;
|
||||
@@ -351,6 +353,10 @@ public class ContainerArcaneWorkbench extends Container implements ISpellSortabl
|
||||
*/
|
||||
private boolean mergeStackIntoBookshelves(ItemStack stack){
|
||||
|
||||
// As far as the client is concerned, which stacks were *previously* in which slots never affects whether a
|
||||
// given book can fit or not, so as long as it refreshes it doesn't matter where the book actually gets put
|
||||
if(tileentity.getWorld().isRemote) this.needsRefresh = true; // It's a bit clunky but it works!
|
||||
|
||||
// LinkedHashSet preserves iteration order whilst ignoring duplicates - neat!
|
||||
Set<VirtualSlot> slots = new LinkedHashSet<>(bookshelfSlots.size());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user