Search in sources :

Example 1 with Validator

use of binnie.core.machines.inventory.Validator in project Binnie by ForestryMC.

the class ErrorState method getTooltip.

public String getTooltip(ContainerCraftGUI container) {
    Collection<CustomSlot> slots = getCustomSlots(container);
    Set<Validator<?>> validators = new HashSet<>();
    for (CustomSlot slot : slots) {
        InventorySlot inventorySlot = slot.getInventorySlot();
        if (inventorySlot != null) {
            SlotValidator validator = inventorySlot.getValidator();
            if (validator != null) {
                validators.add(validator);
            }
        }
    }
    return definition.getDescription(validators);
}
Also used : CustomSlot(binnie.core.gui.minecraft.CustomSlot) InventorySlot(binnie.core.machines.inventory.InventorySlot) SlotValidator(binnie.core.machines.inventory.SlotValidator) Validator(binnie.core.machines.inventory.Validator) SlotValidator(binnie.core.machines.inventory.SlotValidator) HashSet(java.util.HashSet)

Aggregations

CustomSlot (binnie.core.gui.minecraft.CustomSlot)1 InventorySlot (binnie.core.machines.inventory.InventorySlot)1 SlotValidator (binnie.core.machines.inventory.SlotValidator)1 Validator (binnie.core.machines.inventory.Validator)1 HashSet (java.util.HashSet)1