A Machine slot is a slot that either accepts Items or liquids.
You need them when creating a machine using the IMachineRegistry later on.

Импорт пакета

Link to импорт-пакета

If you want to shorten method calls or encounter any issues you might need to import the package.
You can do so using

ZenScript
Copy
import extrautilities2.Tweaker.IMachineSlot;

Creating a new IMachineSlot

Link to creating-a-new-imachineslot

The IMachineSlot package offers methods to create new IMachineSlot objects:

ZenScript
Copy
extrautilities2.Tweaker.IMachineSlot.newItemStackSlot(name);
extrautilities2.Tweaker.IMachineSlot.newItemStackSlot(name, isOptional);
extrautilities2.Tweaker.IMachineSlot.newItemStackSlot(name, stackCapacity);
extrautilities2.Tweaker.IMachineSlot.newItemStackSlot(name, isOptional, stackCapacity);
extrautilities2.Tweaker.IMachineSlot.newItemStackSlot(name, color, isOptional, backgroundTexture, stackCapacity);


newFluidSlot(name);
newFluidSlot(name, stackCapacity);
newFluidSlot(name, stackCapacity, filterLiquidStack);
newFluidSlot(name, stackCapacity, isOptional, filterLiquidStack);
newFluidSlot(name, stackCapacity, color, isOptional, filterLiquidStack);

All these methods will return the new Slot as IMachineSlot object.

Параметры таковы:

НазваниеТип
Название
name
Тип
string
Название
isOptional
Тип
bool
Название
stackCapacity
Тип
int
Название
color
Тип
int
Название
backgroundTexture
Тип
string
Название
filterLiquidStack
Тип
ILiquidStack

What the parameters do:

  • name: The slot's name. Used for recipes later. Make sure that a machine has no 2 slots with the same name.
  • isOptional: Dictates whether or not this slot must be filled for recipe checks to commence.
  • stackCapacity: How many items/millibuckets can fit in this slot?
  • color: What color will the slot have?
  • backgroundTexture: A custom texture path for the background of this slot can be added here.
  • filterLiquidStack: If you provide this ILiquidStack object, then only this fluid will be allowed to enter the slot.

You can get basic information from an IMachineSlot as well.
Don't expect these getters to magically return something different from what you set the slot when creating it, though.

НазваниеТип
Название
name
Тип
string
Название
optional
Тип
bool
Название
stackCapacity
Тип
int