Skip to content

Commit

Permalink
Merge pull request #7 from GTNewHorizons/new_features
Browse files Browse the repository at this point in the history
Experimental - Don't load items every inventory load.
  • Loading branch information
Dream-Master authored Jan 10, 2020
2 parents e84ce8b + bc1aa9e commit 88d6937
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ mc_version=1.7.10
forge_version=10.13.4.1614-1.7.10
ccl_version=1.1.3.138
ccc_version=1.0.7.+
mod_version=2.0.0-pre-12-GTNH
mod_version=2.0.0-pre-13-GTNH
2 changes: 2 additions & 0 deletions src/codechicken/nei/ItemList.java
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ private void damageSearch(Item item, List<ItemStack> permutations) {

@Override
public void execute() {
// System.out.println("Executing NEI Item Loading");
ThreadOperationTimer timer = getTimer(500);

LinkedList<ItemStack> items = new LinkedList<>();
Expand Down Expand Up @@ -243,6 +244,7 @@ public static ForkJoinPool getPool(int poolSize) {
{
@Override
public void execute() {
// System.out.println("Executing NEI Item Filtering");
ArrayList<ItemStack> filtered = new ArrayList<>();
ItemFilter filter = getItemListFilter();

Expand Down
6 changes: 5 additions & 1 deletion src/codechicken/nei/LayoutManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
public static HashMap<Integer, LayoutStyle> layoutStyles = new HashMap<>();

public static boolean ftbUtilsLoaded = false;
public static boolean itemsLoaded = false;

public static void load() {
ftbUtilsLoaded = Loader.isModLoaded("FTBU");
Expand Down Expand Up @@ -559,7 +560,10 @@ public void load(GuiContainer gui) {
if (isEnabled()) {
setInputFocused(null);

ItemList.loadItems.restart();
if(!itemsLoaded) {
ItemList.loadItems.restart();
itemsLoaded = true;
}
overlayRenderer = null;

getLayoutStyle().init();
Expand Down
3 changes: 3 additions & 0 deletions src/codechicken/nei/SubsetWidget.java
Original file line number Diff line number Diff line change
Expand Up @@ -518,12 +518,15 @@ public void clearTasks() {
}

public synchronized void reallocate() {
// System.out.println("NEI Subset - Reallocate");
// Thread.dumpStack();
reallocate = true;
restart();
}

@Override
public void execute() {
// System.out.println("Executing NEI Subset Item Allocation");
HashMap<String, SubsetState> state = new HashMap<>();
List<SubsetTag> tags = new LinkedList<>();
synchronized (root) {
Expand Down

0 comments on commit 88d6937

Please sign in to comment.