You can no longer start a crafting task if it has missing items or fluids.
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
- Fixed oredict autocrafting sometimes reporting that a craftable item is missing (raoulvdberge)
|
||||
- Fixed fluid autocrafting without item inputs locking when there's not enough space for the fluids (raoulvdberge)
|
||||
- Removed handling of reusable items in autocrafting, to avoid problems (raoulvdberge)
|
||||
- You can no longer start a crafting task if it has missing items or fluids (raoulvdberge)
|
||||
|
||||
### 1.6.5
|
||||
- Fixed Refined Storage silicon's oredict entry being registered too late (raoulvdberge)
|
||||
|
@@ -103,6 +103,18 @@ public interface ICraftingTask {
|
||||
*/
|
||||
IStackList<ItemStack> getMissing();
|
||||
|
||||
/**
|
||||
* @return the missing fluids
|
||||
*/
|
||||
IStackList<FluidStack> getMissingFluids();
|
||||
|
||||
/**
|
||||
* @return true if any items or fluids are missing, false otherwise
|
||||
*/
|
||||
default boolean hasMissing() {
|
||||
return !getMissing().isEmpty() || !getMissingFluids().isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the id of this task
|
||||
*/
|
||||
|
@@ -246,7 +246,7 @@ public class CraftingManager implements ICraftingManager {
|
||||
if (task != null) {
|
||||
ICraftingTaskError error = task.calculate();
|
||||
|
||||
if (error == null && task.getMissing().isEmpty()) {
|
||||
if (error == null && !task.hasMissing()) {
|
||||
this.add(task);
|
||||
|
||||
return task;
|
||||
@@ -282,7 +282,7 @@ public class CraftingManager implements ICraftingManager {
|
||||
if (task != null) {
|
||||
ICraftingTaskError error = task.calculate();
|
||||
|
||||
if (error == null && task.getMissing().isEmpty()) {
|
||||
if (error == null && !task.hasMissing()) {
|
||||
this.add(task);
|
||||
|
||||
return task;
|
||||
|
@@ -788,6 +788,10 @@ public class CraftingTask implements ICraftingTask {
|
||||
|
||||
@Override
|
||||
public boolean update() {
|
||||
if (!missing.isEmpty() || !missingFluids.isEmpty()) {
|
||||
throw new IllegalStateException("Crafting task with missing items or fluids cannot execute");
|
||||
}
|
||||
|
||||
if (executionStarted == -1) {
|
||||
executionStarted = System.currentTimeMillis();
|
||||
}
|
||||
@@ -1191,6 +1195,11 @@ public class CraftingTask implements ICraftingTask {
|
||||
return missing;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IStackList<FluidStack> getMissingFluids() {
|
||||
return missingFluids;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UUID getId() {
|
||||
return id;
|
||||
|
@@ -153,7 +153,7 @@ public class FluidGridHandler implements IFluidGridHandler {
|
||||
|
||||
if (error != null) {
|
||||
RS.INSTANCE.network.sendTo(new MessageGridCraftingPreviewResponse(Collections.singletonList(new CraftingPreviewElementError(error.getType(), error.getRecursedPattern() == null ? ItemStack.EMPTY : error.getRecursedPattern().getStack())), hash, quantity, true), player);
|
||||
} else if (noPreview && task.getMissing().isEmpty()) {
|
||||
} else if (noPreview && !task.hasMissing()) {
|
||||
network.getCraftingManager().add(task);
|
||||
|
||||
RS.INSTANCE.network.sendTo(new MessageGridCraftingStartResponse(), player);
|
||||
@@ -195,7 +195,7 @@ public class FluidGridHandler implements IFluidGridHandler {
|
||||
}
|
||||
|
||||
ICraftingTaskError error = task.calculate();
|
||||
if (error == null) {
|
||||
if (error == null && !task.hasMissing()) {
|
||||
network.getCraftingManager().add(task);
|
||||
}
|
||||
}
|
||||
|
@@ -197,7 +197,7 @@ public class ItemGridHandler implements IItemGridHandler {
|
||||
|
||||
if (error != null) {
|
||||
RS.INSTANCE.network.sendTo(new MessageGridCraftingPreviewResponse(Collections.singletonList(new CraftingPreviewElementError(error.getType(), error.getRecursedPattern() == null ? ItemStack.EMPTY : error.getRecursedPattern().getStack())), hash, quantity, false), player);
|
||||
} else if (noPreview && task.getMissing().isEmpty()) {
|
||||
} else if (noPreview && !task.hasMissing()) {
|
||||
network.getCraftingManager().add(task);
|
||||
|
||||
RS.INSTANCE.network.sendTo(new MessageGridCraftingStartResponse(), player);
|
||||
@@ -239,7 +239,7 @@ public class ItemGridHandler implements IItemGridHandler {
|
||||
}
|
||||
|
||||
ICraftingTaskError error = task.calculate();
|
||||
if (error == null) {
|
||||
if (error == null && !task.hasMissing()) {
|
||||
network.getCraftingManager().add(task);
|
||||
}
|
||||
}
|
||||
|
@@ -95,10 +95,6 @@ public class GuiCraftingPreview extends GuiBase {
|
||||
scrollbar.setEnabled(getRows() > VISIBLE_ROWS);
|
||||
scrollbar.setMaxOffset(getRows() - VISIBLE_ROWS);
|
||||
}
|
||||
|
||||
if (startButton != null && !startButton.enabled && isCtrlKeyDown() && isShiftKeyDown() && getErrorType() == null) {
|
||||
startButton.enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -210,10 +206,6 @@ public class GuiCraftingPreview extends GuiBase {
|
||||
|
||||
slot++;
|
||||
}
|
||||
|
||||
if (!startButton.enabled && inBounds(startButton.x - guiLeft, startButton.y - guiTop, startButton.width, startButton.height, mouseX, mouseY)) {
|
||||
drawTooltip(mouseX, mouseY, t("gui.refinedstorage:crafting_preview.force_start"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -59,7 +59,6 @@ gui.refinedstorage:crafting_preview.error.recursive.3=dass sie nicht zur Herstel
|
||||
gui.refinedstorage:crafting_preview.error.recursive.4=Fehlerhafte Vorlage:
|
||||
gui.refinedstorage:crafting_preview.error.too_complex.0=Die Berechnung der Fertigung war zu komplex
|
||||
gui.refinedstorage:crafting_preview.error.too_complex.1=und wurde angehalten um Serverleistung zu sparen.
|
||||
gui.refinedstorage:crafting_preview.force_start=Erzwinge mit STRG + SHIFT
|
||||
gui.refinedstorage:reader=Lesegerät
|
||||
gui.refinedstorage:writer=Schreibgerät
|
||||
gui.refinedstorage:security_manager=Sicherheitsmanager
|
||||
|
@@ -64,7 +64,6 @@ gui.refinedstorage:crafting_preview.error.recursive.3=the pattern is not used du
|
||||
gui.refinedstorage:crafting_preview.error.recursive.4=Offending pattern:
|
||||
gui.refinedstorage:crafting_preview.error.too_complex.0=The crafting task calculation was too complex
|
||||
gui.refinedstorage:crafting_preview.error.too_complex.1=and was stopped to avoid server strain.
|
||||
gui.refinedstorage:crafting_preview.force_start=Press CTRL + SHIFT to ignore
|
||||
gui.refinedstorage:reader=Reader
|
||||
gui.refinedstorage:writer=Writer
|
||||
gui.refinedstorage:security_manager=Security Manager
|
||||
|
@@ -50,7 +50,6 @@ gui.refinedstorage:crafting_preview.error.recursive.1=sí mismo.
|
||||
gui.refinedstorage:crafting_preview.error.recursive.2=Necesita remover el patrón o revisarlo
|
||||
gui.refinedstorage:crafting_preview.error.recursive.3=el patrón no se usa para la fabricación.
|
||||
gui.refinedstorage:crafting_preview.error.recursive.4=Patrón ofensivo:
|
||||
gui.refinedstorage:crafting_preview.force_start=Presiona CTRL + SHIFT para forzar el inicio
|
||||
gui.refinedstorage:reader=Lector
|
||||
gui.refinedstorage:writer=Escritor
|
||||
gui.refinedstorage:security_manager=Centro de Seguridad
|
||||
|
@@ -45,7 +45,6 @@ gui.refinedstorage:crafting_preview.available=Disponible: %d
|
||||
gui.refinedstorage:crafting_preview.missing=Manquant: %d
|
||||
gui.refinedstorage:crafting_preview.circular=Dépendance circulaire!
|
||||
gui.refinedstorage:crafting_preview.loop=Boucle de traitement...
|
||||
gui.refinedstorage:crafting_preview.force_start=Appuyer sur CTRL + SHIFT pour commencer quand même
|
||||
gui.refinedstorage:reader=Scanneur
|
||||
gui.refinedstorage:writer=Imprimeur
|
||||
gui.refinedstorage:security_manager=Poste de sécurité
|
||||
|
@@ -44,7 +44,6 @@ gui.refinedstorage:crafting_preview.available=사용 가능: %d
|
||||
gui.refinedstorage:crafting_preview.missing=부족: %d
|
||||
gui.refinedstorage:crafting_preview.circular=제작할 아이템이 서로를 필요로 합니다!
|
||||
gui.refinedstorage:crafting_preview.loop=처리 중..
|
||||
gui.refinedstorage:crafting_preview.force_start=CTRL + SHIFT를 눌러 강제로 시작할 수 있습니다.
|
||||
gui.refinedstorage:reader=수신기
|
||||
gui.refinedstorage:writer=송신기
|
||||
gui.refinedstorage:security_manager=보안 관리자
|
||||
|
@@ -45,7 +45,6 @@ gui.refinedstorage:crafting_preview.available=Disponível: %d
|
||||
gui.refinedstorage:crafting_preview.missing=Ausência de: %d
|
||||
gui.refinedstorage:crafting_preview.circular=Dependência circular!
|
||||
gui.refinedstorage:crafting_preview.loop=Loop em processamento...
|
||||
gui.refinedstorage:crafting_preview.force_start=Pressione CTRL + SHIFT para começar de qualquer maneira
|
||||
gui.refinedstorage:reader=Leitor
|
||||
gui.refinedstorage:writer=Escritor
|
||||
gui.refinedstorage:security_manager=Gerente de Segurança
|
||||
|
@@ -54,7 +54,6 @@ gui.refinedstorage:crafting_preview.error.recursive.3=шаблон не испо
|
||||
gui.refinedstorage:crafting_preview.error.recursive.4=Нарушение шаблона:
|
||||
gui.refinedstorage:crafting_preview.error.too_complex.0=Расчет крафтовой задачи был слишком сложным
|
||||
gui.refinedstorage:crafting_preview.error.too_complex.1=и был остановлен, чтобы избежать нагрузки на сервер.
|
||||
gui.refinedstorage:crafting_preview.force_start=Нажмите CTRL + SHIFT для игнорирования
|
||||
gui.refinedstorage:reader=Устройство чтения
|
||||
gui.refinedstorage:writer=Устройство записи
|
||||
gui.refinedstorage:security_manager=Менеджер безопасности
|
||||
|
@@ -46,7 +46,6 @@ gui.refinedstorage:crafting_preview.available=可用:%d
|
||||
gui.refinedstorage:crafting_preview.missing=缺失:%d
|
||||
gui.refinedstorage:crafting_preview.circular=循环依赖!
|
||||
gui.refinedstorage:crafting_preview.loop=循环处理中……
|
||||
gui.refinedstorage:crafting_preview.force_start=按下Ctrl+Shift强制开始
|
||||
gui.refinedstorage:reader=读取器
|
||||
gui.refinedstorage:writer=写入器
|
||||
gui.refinedstorage:security_manager=权限管理器
|
||||
|
Reference in New Issue
Block a user