Skip to content

Commit d8b4064

Browse files
some renames. clean up.
1 parent 7921b2d commit d8b4064

File tree

4 files changed

+11
-17
lines changed

4 files changed

+11
-17
lines changed

src/main/java/appeng/client/gui/me/crafting/CraftConfirmScreen.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ protected void updateBeforeRender() {
9595
} else {
9696
cpuDetails = GuiText.ConfirmCraftNoCpu.text();
9797
}
98-
if (menu.selectedMatches()) {
98+
if (menu.craftingMatchesSelectedCPU()) {
9999
this.start.setMessage(GuiText.Merge.text());
100100
} else {
101101
this.start.setMessage(GuiText.Start.text());

src/main/java/appeng/crafting/CraftingLink.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ void setCanceled(boolean canceled) {
175175
this.canceled = canceled;
176176
}
177177

178-
public ICraftingRequester getRequester() {
178+
ICraftingRequester getRequester() {
179179
return this.req;
180180
}
181181

src/main/java/appeng/me/service/CraftingService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ public ICraftingSubmitResult submitJob(ICraftingPlan job, ICraftingRequester req
353353
cpuCluster = (CraftingCPUCluster) target;
354354
} else {
355355
var unsuitableCpusResult = new MutableObject<UnsuitableCpus>();
356-
cpuCluster = findSuitableCraftingCPU(job, prioritizePower, src, unsuitableCpusResult, requestingMachine);
356+
cpuCluster = findSuitableCraftingCPU(job, prioritizePower, src, requestingMachine, unsuitableCpusResult);
357357
if (cpuCluster == null) {
358358
var unsuitableCpus = unsuitableCpusResult.getValue();
359359
// If no CPUs were unsuitable, but we couldn't find one, that means there aren't any
@@ -370,7 +370,7 @@ public ICraftingSubmitResult submitJob(ICraftingPlan job, ICraftingRequester req
370370

371371
@Nullable
372372
private CraftingCPUCluster findSuitableCraftingCPU(ICraftingPlan job, boolean prioritizePower, IActionSource src,
373-
MutableObject<UnsuitableCpus> unsuitableCpus, ICraftingRequester requestingMachine) {
373+
ICraftingRequester requestingMachine, MutableObject<UnsuitableCpus> unsuitableCpus) {
374374
var validCpusClusters = new ArrayList<CraftingCPUCluster>(this.craftingCPUClusters.size());
375375
int offline = 0;
376376
int busy = 0;

src/main/java/appeng/menu/me/crafting/CraftConfirmMenu.java

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public class CraftConfirmMenu extends AEBaseMenu implements ISubMenu {
103103
@GuiSync(8)
104104
public SyncableSubmitResult submitError = NO_ERROR;
105105
@GuiSync(9)
106-
public GenericStack stackToCraft;
106+
public GenericStack currentlyCraftingStack;
107107

108108
private CraftingPlanSummary plan;
109109

@@ -255,7 +255,7 @@ private boolean cpuMatches(ICraftingCPU c) {
255255
return true;
256256
}
257257
if (c.isBusy()) {
258-
if (craftMatches(c)) {
258+
if (this.plan.crafting().matches(c.getJobStatus().crafting())) {
259259
if (c instanceof CraftingCPUCluster cpuCluster) {
260260
if (cpuCluster.craftingLogic.isSameRequester(null)) {
261261
return c.getAvailableStorage() >= this.plan.usedBytes() + cpuCluster.craftingLogic.getCurrentJobSize();
@@ -266,16 +266,10 @@ private boolean cpuMatches(ICraftingCPU c) {
266266
}
267267
return c.getAvailableStorage() >= this.plan.usedBytes();
268268
}
269-
public boolean craftMatches (ICraftingCPU c) {
270-
if (plan != null) {
271-
return this.plan.crafting().matches(c.getJobStatus().crafting());
272-
}
273-
return false;
274-
}
275269

276-
public boolean selectedMatches () {
270+
public boolean craftingMatchesSelectedCPU() {
277271
if (plan != null) {
278-
return this.plan.crafting().matches(this.stackToCraft);
272+
return this.plan.crafting().matches(this.currentlyCraftingStack);
279273
}
280274
return false;
281275
}
@@ -332,17 +326,17 @@ private void onCPUSelectionChanged(CraftingCPURecord cpuRecord, boolean cpusAvai
332326
cpuCoProcessors = 0;
333327
cpuName = null;
334328
selectedCpu = null;
335-
stackToCraft = null;
329+
currentlyCraftingStack = null;
336330
} else {
337331
cpuBytesAvail = cpuRecord.getSize();
338332
cpuCoProcessors = cpuRecord.getProcessors();
339333
cpuName = cpuRecord.getName();
340334
selectedCpu = cpuRecord.getCpu();
341335
CraftingJobStatus jobStatus = selectedCpu.getJobStatus();
342336
if (jobStatus == null) {
343-
stackToCraft = null;
337+
currentlyCraftingStack = null;
344338
} else {
345-
stackToCraft = jobStatus.crafting();
339+
currentlyCraftingStack = jobStatus.crafting();
346340
}
347341
}
348342
}

0 commit comments

Comments
 (0)