Back on Patch, Part III

- Better visibility for low/half amounts of fluids in basins
- Fixed Mechanical Press head getting stuck in extended position when off-screened or when its basin changes
- Added processingTime support to mixing recipes (defaults to 100)
- Fixed Basin recipes with fluid output not starting when targeted output inventory supports items only
- Fixed item extraction from create creating stacks of unstackable items when source inventory allows stacking them (Storage Drawers)
- Fixed Deployers not having a valid item capability when asked before their first tick
- Fixed Mechanical Crafting recipes able to be automated via packing
This commit is contained in:
simibubi 2021-11-23 18:55:39 +01:00
parent ebf1a895c9
commit 52eca118ad
11 changed files with 2426 additions and 32 deletions

View file

@ -444,6 +444,7 @@ b7181bcd8182b2f17088e5aa881f374c9c65470c assets/create/blockstates/zinc_ore.json
5ae77ed97ee05a7ed98999178677e576c1140007 assets/create/lang/en_ud.json
5a7c0c3ea8d5fe01289b4eb2ea4f175bad825672 assets/create/lang/en_us.json
c7c1900b9a88af98d3af131dae5f1e2263c86635 assets/create/lang/unfinished/de_de.json
bb65514ab38063b4686efe9e7f1d8de78823111f assets/create/lang/unfinished/es_cl.json
800b427fc2e4f3b71df9c6295e500d77e8c1d486 assets/create/lang/unfinished/es_es.json
5ad47cb60df592b461672e224dfb89167f8861e1 assets/create/lang/unfinished/fr_fr.json
216065d27084497ffed7cacddfe86cab542643d9 assets/create/lang/unfinished/it_it.json
@ -1747,7 +1748,7 @@ d080b1b25e5bc8baf5aee68691b08c7f12ece3b0 assets/create/models/item/windmill_bear
a80fb25a0b655e76be986b5b49fcb0f03461a1ab assets/create/models/item/zinc_nugget.json
b1689617190c05ef34bd18456b0c7ae09bb3210f assets/create/models/item/zinc_ore.json
58880e397902f8ca5b3b59ed4423e626109ddc4c assets/create/sounds.json
5d0cc4c0255dc241e61c173b31ddca70c88d08e4 data/create/advancements/aesthetics.json
0f1b4b980afba9bf2caf583b88e261bba8b10313 data/create/advancements/aesthetics.json
187921fa131b06721bfaf63f2623a28c141aae9a data/create/advancements/andesite_alloy.json
0ea2db7173b5be28b289ea7c9a6a0cf5805c60c7 data/create/advancements/andesite_casing.json
83c046bd200623933545c9e4326f782fb02c87fa data/create/advancements/arm_blaze_burner.json

File diff suppressed because it is too large Load diff

View file

@ -28,8 +28,8 @@
"trigger": "create:bracket_apply",
"conditions": {
"accepted_entries": [
"create:large_cogwheel",
"create:cogwheel"
"create:cogwheel",
"create:large_cogwheel"
]
}
},

View file

@ -36,6 +36,7 @@ import com.simibubi.create.compat.jei.category.ProcessingViaFanCategory;
import com.simibubi.create.compat.jei.category.SawingCategory;
import com.simibubi.create.compat.jei.category.SequencedAssemblyCategory;
import com.simibubi.create.compat.jei.category.SpoutCategory;
import com.simibubi.create.content.contraptions.components.crafter.MechanicalCraftingRecipe;
import com.simibubi.create.content.contraptions.components.deployer.DeployerApplicationRecipe;
import com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity;
import com.simibubi.create.content.contraptions.components.saw.SawTileEntity;
@ -166,8 +167,10 @@ public class CreateJEI implements IModPlugin {
.build(),
autoSquare = register("automatic_packing", PackingCategory::autoSquare)
.recipes(r -> (r instanceof ICraftingRecipe) && MechanicalPressTileEntity.canCompress(r)
&& !AllRecipeTypes.isManualRecipe(r), BasinRecipe::convertShapeless)
.recipes(
r -> (r instanceof ICraftingRecipe) && !(r instanceof MechanicalCraftingRecipe)
&& MechanicalPressTileEntity.canCompress(r) && !AllRecipeTypes.isManualRecipe(r),
BasinRecipe::convertShapeless)
.catalyst(AllBlocks.MECHANICAL_PRESS::get)
.catalyst(AllBlocks.BASIN::get)
.enableWhen(c -> c.allowShapedSquareInPress)

View file

@ -105,6 +105,12 @@ public class DeployerTileEntity extends KineticTileEntity {
@Override
public void initialize() {
super.initialize();
initHandler();
}
private void initHandler() {
if (invHandler != null)
return;
if (!level.isClientSide) {
player = new DeployerFakePlayer((ServerWorld) level);
if (deferredInventoryList != null) {
@ -393,8 +399,11 @@ public class DeployerTileEntity extends KineticTileEntity {
@Override
public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side) {
if (isItemHandlerCap(cap) && invHandler != null)
if (isItemHandlerCap(cap)) {
if (invHandler == null)
initHandler();
return invHandler.cast();
}
return super.getCapability(cap, side);
}

View file

@ -10,6 +10,7 @@ import com.simibubi.create.content.contraptions.fluids.FluidFX;
import com.simibubi.create.content.contraptions.fluids.recipe.PotionMixingRecipeManager;
import com.simibubi.create.content.contraptions.processing.BasinOperatingTileEntity;
import com.simibubi.create.content.contraptions.processing.BasinTileEntity;
import com.simibubi.create.content.contraptions.processing.ProcessingRecipe;
import com.simibubi.create.foundation.advancement.AllTriggers;
import com.simibubi.create.foundation.advancement.ITriggerable;
import com.simibubi.create.foundation.config.AllConfigs;
@ -128,7 +129,15 @@ public class MechanicalMixerTileEntity extends BasinOperatingTileEntity {
if ((!level.isClientSide || isVirtual()) && runningTicks == 20) {
if (processingTicks < 0) {
processingTicks = MathHelper.clamp((MathHelper.log2((int) (512 / speed))) * 15 + 1, 1, 512);
float recipeSpeed = 1;
if (currentRecipe instanceof ProcessingRecipe) {
int t = ((ProcessingRecipe<?>) currentRecipe).getProcessingDuration();
if (t != 0)
recipeSpeed = t / 100f;
}
processingTicks = MathHelper.clamp((MathHelper.log2((int) (512 / speed))) * MathHelper.ceil(recipeSpeed * 15) + 1, 1, 512);
Optional<BasinTileEntity> basin = getBasin();
if (basin.isPresent()) {

View file

@ -9,6 +9,7 @@ import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllRecipeTypes;
import com.simibubi.create.AllSoundEvents;
import com.simibubi.create.Create;
import com.simibubi.create.content.contraptions.components.crafter.MechanicalCraftingRecipe;
import com.simibubi.create.content.contraptions.itemAssembly.SequencedAssemblyRecipe;
import com.simibubi.create.content.contraptions.processing.BasinOperatingTileEntity;
import com.simibubi.create.content.contraptions.processing.BasinTileEntity;
@ -362,7 +363,8 @@ public class MechanicalPressTileEntity extends BasinOperatingTileEntity {
@Override
protected <C extends IInventory> boolean matchStaticFilters(IRecipe<C> recipe) {
return (recipe instanceof ICraftingRecipe && canCompress(recipe) && !AllRecipeTypes.isManualRecipe(recipe))
return (recipe instanceof ICraftingRecipe && !(recipe instanceof MechanicalCraftingRecipe)
&& canCompress(recipe) && !AllRecipeTypes.isManualRecipe(recipe))
|| recipe.getType() == AllRecipeTypes.COMPACTING.getType();
}

View file

@ -35,9 +35,6 @@ public class PressInstance extends ShaftInstance implements IDynamicInstance {
@Override
public void beginFrame() {
if (!press.running)
return;
transformModels();
}

View file

@ -150,6 +150,8 @@ public class BasinRenderer extends SmartTileEntityRenderer<BasinTileEntity> {
float fluidLevel = MathHelper.clamp(totalUnits / 2000, 0, 1);
fluidLevel = 1 - ((1 - fluidLevel) * (1 - fluidLevel));
float xMin = 2 / 16f;
float xMax = 2 / 16f;
final float yMin = 2 / 16f;

View file

@ -479,10 +479,19 @@ public class BasinTileEntity extends SmartTileEntity implements IHaveGoggleInfor
IFluidHandler targetTank = te == null ? null
: te.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, direction.getOpposite())
.orElse(null);
boolean externalTankNotPresent = targetTank == null;
if (!outputItems.isEmpty() && targetInv == null)
return false;
if (!outputFluids.isEmpty() && targetTank == null)
if (!outputFluids.isEmpty() && externalTankNotPresent) {
// Special case - fluid outputs but output only accepts items
targetTank = outputTank.getCapability()
.orElse(null);
if (targetTank == null)
return false;
if (!acceptFluidOutputsIntoBasin(outputFluids, simulate, targetTank))
return false;
}
if (simulate)
return true;
@ -492,6 +501,7 @@ public class BasinTileEntity extends SmartTileEntity implements IHaveGoggleInfor
continue;
spoutputBuffer.add(itemStack.copy());
}
if (!externalTankNotPresent)
for (FluidStack fluidStack : outputFluids)
spoutputFluidBuffer.add(fluidStack.copy());
return true;
@ -503,7 +513,32 @@ public class BasinTileEntity extends SmartTileEntity implements IHaveGoggleInfor
if (targetInv == null && !outputItems.isEmpty())
return false;
if (!acceptItemOutputsIntoBasin(outputItems, simulate, targetInv))
return false;
if (outputFluids.isEmpty())
return true;
if (targetTank == null)
return false;
if (!acceptFluidOutputsIntoBasin(outputFluids, simulate, targetTank))
return false;
return true;
}
private boolean acceptFluidOutputsIntoBasin(List<FluidStack> outputFluids, boolean simulate,
IFluidHandler targetTank) {
for (FluidStack fluidStack : outputFluids) {
FluidAction action = simulate ? FluidAction.SIMULATE : FluidAction.EXECUTE;
int fill = targetTank instanceof SmartFluidTankBehaviour.InternalFluidHandler
? ((SmartFluidTankBehaviour.InternalFluidHandler) targetTank).forceFill(fluidStack.copy(), action)
: targetTank.fill(fluidStack.copy(), action);
if (fill != fluidStack.getAmount())
return false;
}
return true;
}
private boolean acceptItemOutputsIntoBasin(List<ItemStack> outputItems, boolean simulate, IItemHandler targetInv) {
for (ItemStack itemStack : outputItems) {
// Catalyst items are never consumed
if (itemStack.hasContainerItem() && itemStack.getContainerItem()
@ -513,21 +548,6 @@ public class BasinTileEntity extends SmartTileEntity implements IHaveGoggleInfor
.isEmpty())
return false;
}
if (outputFluids.isEmpty())
return true;
if (targetTank == null)
return false;
for (FluidStack fluidStack : outputFluids) {
FluidAction action = simulate ? FluidAction.SIMULATE : FluidAction.EXECUTE;
int fill = targetTank instanceof SmartFluidTankBehaviour.InternalFluidHandler
? ((SmartFluidTankBehaviour.InternalFluidHandler) targetTank).forceFill(fluidStack.copy(), action)
: targetTank.fill(fluidStack.copy(), action);
if (fill != fluidStack.getAmount())
return false;
}
return true;
}
@ -621,7 +641,7 @@ public class BasinTileEntity extends SmartTileEntity implements IHaveGoggleInfor
Vector3d outMotion = directionVec.scale(1 / 16f)
.add(0, -1 / 16f, 0);
for (int i = 0; i < 3; i++) {
for (int i = 0; i < 2; i++) {
visualizedOutputFluids.forEach(ia -> {
FluidStack fluidStack = ia.getValue();
IParticleData fluidParticle = FluidFX.getFluidParticle(fluidStack);

View file

@ -155,7 +155,10 @@ public class ItemHelper {
extracting = ItemStack.EMPTY;
for (int slot = 0; slot < inv.getSlots(); slot++) {
ItemStack stack = inv.extractItem(slot, maxExtractionCount - extracting.getCount(), true);
int amountToExtractFromThisSlot =
Math.min(maxExtractionCount - extracting.getCount(), inv.getStackInSlot(slot)
.getMaxStackSize());
ItemStack stack = inv.extractItem(slot, amountToExtractFromThisSlot, true);
if (stack.isEmpty())
continue;