QOL Vat Changes
- Vat JEI now displays vat types properly. - Vat JEI now combines multiple of the same ingredients into one slot. - Vat JEI now properly shows the chance slot icon if the output has a chance. - Added new cast iron overlay sprite to the Vat JEI icon set - Fireproof Vat Item model now uses the single block model instead of the windowed model. - Vats now properly output all fluid outputs instead of one. - Fixed issue from previous commit where the vat would check the wrong values from the machine attachment map.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// 1.20.1 2025-07-08T20:26:28.2936491 Registrate Provider for tfmg [Recipes, Advancements, Loot Tables, Tags (blocks), Tags (items), Tags (fluids), Tags (entity_types), Blockstates, Item models, Lang (en_us/en_ud)]
|
||||
// 1.20.1 2025-07-09T13:44:40.7657277 Registrate Provider for tfmg [Recipes, Advancements, Loot Tables, Tags (blocks), Tags (items), Tags (fluids), Tags (entity_types), Blockstates, Item models, Lang (en_us/en_ud)]
|
||||
ff5a5721633b83465ab501cbdfdc579a0f20e938 assets/tfmg/blockstates/accumulator.json
|
||||
e982a263b6af75821042107fdeff7bd809436d08 assets/tfmg/blockstates/air_intake.json
|
||||
e7f63aadfc892e337d9f87b5e50af8b1c7e4103f assets/tfmg/blockstates/aluminum_bars.json
|
||||
@@ -1234,7 +1234,7 @@ e7d137a2136040f6e504d0b26cede820d2a1be0d assets/tfmg/models/item/firebox.json
|
||||
6adcbf69c17e06e98cc848dc136b8907c9cff7be assets/tfmg/models/item/fireproof_brick.json
|
||||
080629b77cc20daacb129c7fe3c3a97d5df677f2 assets/tfmg/models/item/fireproof_bricks.json
|
||||
96171ac619fe06339e4888ebf16f744745d5d667 assets/tfmg/models/item/fireproof_brick_reinforcement.json
|
||||
492765a0dcafe3346e25697e1e81df64088348af assets/tfmg/models/item/fireproof_chemical_vat.json
|
||||
75526784c8d6f3da82d6991ac29decb74e8ffcad assets/tfmg/models/item/fireproof_chemical_vat.json
|
||||
e82498c07d178acd47a4eb43b92c86fd99ba3239 assets/tfmg/models/item/flamethrower.json
|
||||
6760e6cfe559d9d21c16a1ac8e444423fa8f6c48 assets/tfmg/models/item/flarestack.json
|
||||
7e4a58a6d05b19dc8c5fff73434c2d7cefa75343 assets/tfmg/models/item/fossilstone.json
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"parent": "tfmg:block/fireproof_chemical_vat/block_single_window"
|
||||
"parent": "tfmg:block/fireproof_chemical_vat/block_single"
|
||||
}
|
||||
@@ -225,11 +225,11 @@ public class VatBlockEntity extends SmartBlockEntity implements IHaveGoggleInfor
|
||||
continue;
|
||||
boolean doesntMatch = false;
|
||||
|
||||
if (!Objects.equals(testedRecipe.machines, machineMap.keySet().stream().toList())) {
|
||||
if (!Objects.equals(testedRecipe.machines, machineMap.values().stream().toList())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!getControllerBE().areMachinesValid) {
|
||||
if (!areMachinesValid) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -404,7 +404,7 @@ public class VatBlockEntity extends SmartBlockEntity implements IHaveGoggleInfor
|
||||
}
|
||||
}
|
||||
|
||||
areMachinesValid = operationalMachinesMap.entrySet().stream().allMatch((op) -> op.getValue() == true);
|
||||
areMachinesValid = operationalMachinesMap.values().stream().allMatch((op) -> op == true);
|
||||
|
||||
if (syncCooldown > 0) {
|
||||
syncCooldown--;
|
||||
@@ -515,23 +515,49 @@ public class VatBlockEntity extends SmartBlockEntity implements IHaveGoggleInfor
|
||||
//fluid output
|
||||
List<Integer> handledFluidResults = new ArrayList<>();
|
||||
|
||||
for (FluidStack fluidStack : recipe.getFluidResults()) {
|
||||
for (int i = 0; i < outputFluidHandler.getTanks(); i++) {
|
||||
FluidStack fluidInTank = outputFluidHandler.getFluidInTank(i);
|
||||
if (fluidInTank.getFluid().isSame(fluidStack.getFluid())) {
|
||||
outputFluidHandler.fill(new FluidStack(fluidStack.copy(), fluidStack.getAmount()), IFluidHandler.FluidAction.EXECUTE);
|
||||
handledFluidResults.add(i);
|
||||
break;
|
||||
List<FluidStack> handledFluidStacks = new ArrayList<>();
|
||||
List<SmartFluidTankBehaviour.TankSegment> tankSegments = List.of(outputTank.getTanks());
|
||||
if (recipe != null)
|
||||
for (FluidStack fluidStack : recipe.getFluidResults()) {
|
||||
for (SmartFluidTankBehaviour.TankSegment tankSegment : tankSegments) {
|
||||
SmartFluidTank tank = ((TankSegmentAccessor) tankSegment).tfmg$tank();
|
||||
FluidStack fluidInTank = tank.getFluid();
|
||||
if (handledFluidStacks.contains(fluidStack)) break;
|
||||
|
||||
if (fluidInTank.getFluid().isSame(fluidStack.getFluid())) {
|
||||
tank.fill(new FluidStack(fluidStack.copy(), fluidStack.getAmount()), IFluidHandler.FluidAction.EXECUTE);
|
||||
handledFluidStacks.add(fluidStack);
|
||||
break;
|
||||
}
|
||||
if (!handledFluidStacks.contains(fluidStack) && fluidInTank.isEmpty()) {
|
||||
tank.fill(new FluidStack(fluidStack.copy(), fluidStack.getAmount()), IFluidHandler.FluidAction.EXECUTE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
//for (int i = 0; i < tankSegments.size(); i++) {
|
||||
// FluidStack fluidInTank = outputFluidHandler.getFluidInTank(i);
|
||||
//
|
||||
// if (handledFluidStacks.contains(fluidStack)) break;
|
||||
//
|
||||
// if (fluidInTank.isEmpty()) {
|
||||
// outputFluidHandler.fill(new FluidStack(fluidStack.copy(), fluidStack.getAmount()), IFluidHandler.FluidAction.EXECUTE);
|
||||
// handledFluidStacks.add(fluidStack);
|
||||
// handledFluidResults.add(i);
|
||||
// }
|
||||
// else if (fluidInTank.getFluid().isSame(fluidStack.getFluid()) && fluidInTank.getAmount() + fluidStack.getAmount() <= outputFluidHandler.getCapacity()) {
|
||||
// outputFluidHandler.fill(new FluidStack(fluidStack.copy(), fluidStack.getAmount()), IFluidHandler.FluidAction.EXECUTE);
|
||||
// handledFluidStacks.add(fluidStack);
|
||||
// handledFluidResults.add(i);
|
||||
// }
|
||||
//}
|
||||
//for (int i = 0; i < outputFluidHandler.getTanks(); i++) {
|
||||
// FluidStack fluidInTank = outputFluidHandler.getFluidInTank(i);
|
||||
// if (!handledFluidResults.contains(i) && fluidInTank.isEmpty()) {
|
||||
// outputFluidHandler.fill(new FluidStack(fluidStack.copy(), fluidStack.getAmount()), IFluidHandler.FluidAction.EXECUTE);
|
||||
// break;
|
||||
// }
|
||||
//}
|
||||
}
|
||||
for (int i = 0; i < outputFluidHandler.getTanks(); i++) {
|
||||
FluidStack fluidInTank = outputFluidHandler.getFluidInTank(i);
|
||||
if (!handledFluidResults.contains(i) && fluidInTank.isEmpty()) {
|
||||
outputFluidHandler.fill(new FluidStack(fluidStack.copy(), fluidStack.getAmount()), IFluidHandler.FluidAction.EXECUTE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
recipe = null;
|
||||
timer = 0;
|
||||
} else {
|
||||
|
||||
@@ -1,21 +1,20 @@
|
||||
package com.drmangotea.tfmg.recipes.jei;
|
||||
|
||||
import com.drmangotea.tfmg.recipes.PolarizingRecipe;
|
||||
import com.drmangotea.tfmg.recipes.VatMachineRecipe;
|
||||
import com.drmangotea.tfmg.recipes.jei.machines.Polarizer;
|
||||
import com.drmangotea.tfmg.registry.TFMGGuiTextures;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.simibubi.create.compat.jei.category.CreateRecipeCategory;
|
||||
import com.simibubi.create.compat.jei.category.sequencedAssembly.SequencedAssemblySubCategory;
|
||||
import com.simibubi.create.content.processing.recipe.HeatCondition;
|
||||
import com.simibubi.create.content.processing.sequenced.SequencedRecipe;
|
||||
import com.simibubi.create.foundation.gui.AllGuiTextures;
|
||||
import com.simibubi.create.content.processing.recipe.ProcessingOutput;
|
||||
import com.simibubi.create.foundation.item.ItemHelper;
|
||||
import mezz.jei.api.gui.builder.IRecipeLayoutBuilder;
|
||||
import mezz.jei.api.gui.ingredient.IRecipeSlotsView;
|
||||
import mezz.jei.api.recipe.IFocusGroup;
|
||||
import mezz.jei.api.recipe.RecipeIngredientRole;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.createmod.catnip.data.Pair;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.crafting.Ingredient;
|
||||
import org.apache.commons.lang3.mutable.MutableInt;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -42,15 +41,22 @@ public class ChemicalVatCategory extends CreateRecipeCategory<VatMachineRecipe>
|
||||
|
||||
pos += 21;
|
||||
}
|
||||
int itemCount = recipe.getIngredients().size();
|
||||
List<Pair<Ingredient, MutableInt>> condensedIngredients = ItemHelper.condenseIngredients(recipe.getIngredients());
|
||||
|
||||
int itemCount = condensedIngredients.size();
|
||||
int itemPos = 55;
|
||||
int itemWidth = ((itemCount) * 20) / 2;
|
||||
int itemMovement = itemCount != 4 ? 1 : 0;
|
||||
if (itemCount == 1)
|
||||
itemMovement = 2;
|
||||
for (int i = 0; i < itemCount; i++) {
|
||||
|
||||
builder.addSlot(RecipeIngredientRole.INPUT, itemPos - itemWidth + itemMovement, recipe.getFluidIngredients().isEmpty() ? 72 : 64).setBackground(getRenderedSlot(), -1, -1).addIngredients(recipe.getIngredients().get(i));
|
||||
for (Pair<Ingredient, MutableInt> pair : condensedIngredients) {
|
||||
List<ItemStack> stacks = new ArrayList<>();
|
||||
for (ItemStack itemStack : pair.getFirst().getItems()) {
|
||||
ItemStack copy = itemStack.copy();
|
||||
copy.setCount(pair.getSecond().getValue());
|
||||
stacks.add(copy);
|
||||
}
|
||||
builder.addSlot(RecipeIngredientRole.INPUT, itemPos - itemWidth + itemMovement, recipe.getFluidIngredients().isEmpty() ? 72 : 64).setBackground(getRenderedSlot(), -1, -1).addItemStacks(stacks);
|
||||
|
||||
itemPos += 21;
|
||||
}
|
||||
@@ -68,12 +74,12 @@ public class ChemicalVatCategory extends CreateRecipeCategory<VatMachineRecipe>
|
||||
int itemResultPos = 90;
|
||||
|
||||
for (int i = 0; i < recipe.getRollableResults().size(); i++) {
|
||||
|
||||
ProcessingOutput output = recipe.getRollableResults().get(i);
|
||||
builder
|
||||
.addSlot(RecipeIngredientRole.OUTPUT, 128, itemResultPos)
|
||||
.setBackground(getRenderedSlot(), -1, -1)
|
||||
.addItemStack(recipe.getRollableResults().get(i).getStack())
|
||||
.addRichTooltipCallback(addStochasticTooltip(recipe.getRollableResults().get(i)))
|
||||
.setBackground(getRenderedSlot(output), -1, -1)
|
||||
.addItemStack(output.getStack())
|
||||
.addRichTooltipCallback(addStochasticTooltip(output))
|
||||
;
|
||||
|
||||
itemResultPos -= 21;
|
||||
@@ -101,8 +107,9 @@ public class ChemicalVatCategory extends CreateRecipeCategory<VatMachineRecipe>
|
||||
pos += 21;
|
||||
}
|
||||
int posItem = 55;
|
||||
int widthItem = ((recipe.getIngredients().size()) * 21) / 2;
|
||||
for (int i = 0; i < recipe.getIngredients().size(); i++) {
|
||||
List<Pair<Ingredient, MutableInt>> condensedIngredients = ItemHelper.condenseIngredients(recipe.getIngredients());
|
||||
int widthItem = ((condensedIngredients.size()) * 21) / 2;
|
||||
for (int i = 0; i < condensedIngredients.size(); i++) {
|
||||
|
||||
TFMGGuiTextures.SLOT.render(graphics, posItem - widthItem, recipe.getFluidIngredients().isEmpty() ? 70 : 62);
|
||||
|
||||
@@ -126,9 +133,12 @@ public class ChemicalVatCategory extends CreateRecipeCategory<VatMachineRecipe>
|
||||
//Can be overridden with mixins for easily adding different stuff - Krystal
|
||||
//Might consider a better way of doing this but idk.
|
||||
private void drawVatTypes(List<String> allowedVatTypes, GuiGraphics graphics) {
|
||||
if (allowedVatTypes.contains("firebrick_lined_vat") && allowedVatTypes.size() == 1) {
|
||||
if (allowedVatTypes.contains("tfmg:firebrick_lined_vat") && allowedVatTypes.size() == 1) {
|
||||
TFMGGuiTextures.FIREPROOF_BRICK_OVERLAY.render(graphics, 55 - 48, 32);
|
||||
}
|
||||
if (allowedVatTypes.contains("tfmg:cast_iron_vat") && allowedVatTypes.size() == 1) {
|
||||
TFMGGuiTextures.CAST_IRON_VAT_OVERLAY.render(graphics, 0, 24);
|
||||
}
|
||||
}
|
||||
|
||||
//Can be overridden with mixins for easily adding different stuff - Krystal
|
||||
|
||||
@@ -488,7 +488,7 @@ public class TFMGBlocks {
|
||||
.onRegister(CreateRegistrate.blockModel(() -> SteelFluidTankModel::fireproofVat))
|
||||
.addLayer(() -> RenderType::cutoutMipped)
|
||||
.item(SteelTankItem::new)
|
||||
.model(AssetLookup.customBlockItemModel("_", "block_single_window"))
|
||||
.model(AssetLookup.customBlockItemModel("_", "block_single"))
|
||||
.build()
|
||||
.register();
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ public enum TFMGGuiTextures implements ScreenElement {
|
||||
ELECTRODE("chemical_vat", 189, 0, 8, 29),
|
||||
GRAPHITE_ELECTRODE("chemical_vat", 176, 0, 8, 29),
|
||||
FIREPROOF_BRICK_OVERLAY("chemical_vat", 0, 84, 96, 72),
|
||||
CAST_IRON_VAT_OVERLAY("chemical_vat", 0, 156, 110, 84),
|
||||
VAT_HEATER("chemical_vat", 112, 44, 20, 14),
|
||||
VAT_SUPERHEATER("chemical_vat", 112, 58, 20, 14)
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 5.6 KiB |
Reference in New Issue
Block a user