Sort the crafter manager containers.
This commit is contained in:
@@ -115,7 +115,7 @@ public interface ICraftingManager {
|
||||
* @param tag the tag to write to
|
||||
* @return the written tag
|
||||
*/
|
||||
NBTTagCompound writeToNBT(NBTTagCompound tag);
|
||||
NBTTagCompound writeToNbt(NBTTagCompound tag);
|
||||
|
||||
/**
|
||||
* @param listener the listener
|
||||
|
||||
@@ -164,7 +164,7 @@ public class CraftingManager implements ICraftingManager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound tag) {
|
||||
public NBTTagCompound writeToNbt(NBTTagCompound tag) {
|
||||
NBTTagList list = new NBTTagList();
|
||||
|
||||
for (ICraftingTask task : tasks.values()) {
|
||||
@@ -255,10 +255,17 @@ public class CraftingManager implements ICraftingManager {
|
||||
this.patterns.clear();
|
||||
this.containerInventories.clear();
|
||||
|
||||
List<ICraftingPatternContainer> containers = new ArrayList<>();
|
||||
|
||||
for (INetworkNode node : network.getNodeGraph().all()) {
|
||||
if (node instanceof ICraftingPatternContainer && node.canUpdate()) {
|
||||
ICraftingPatternContainer container = (ICraftingPatternContainer) node;
|
||||
containers.add((ICraftingPatternContainer) node);
|
||||
}
|
||||
}
|
||||
|
||||
containers.sort((a, b) -> b.getPosition().compareTo(a.getPosition()));
|
||||
|
||||
for (ICraftingPatternContainer container : containers) {
|
||||
this.patterns.addAll(container.getPatterns());
|
||||
|
||||
IItemHandlerModifiable handler = container.getPatternInventory();
|
||||
@@ -267,7 +274,6 @@ public class CraftingManager implements ICraftingManager {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
|
||||
@@ -533,7 +533,7 @@ public class TileController extends TileBase implements ITickable, INetwork, IRe
|
||||
|
||||
redstoneMode.write(tag);
|
||||
|
||||
craftingManager.writeToNBT(tag);
|
||||
craftingManager.writeToNbt(tag);
|
||||
|
||||
readerWriterManager.writeToNbt(tag);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user