use of binnie.core.gui.minecraft.CustomSlot in project Binnie by ForestryMC.
the class ControlErrorState method onUpdateClient.
@Override
@SideOnly(Side.CLIENT)
public final void onUpdateClient() {
this.errorState = this.getError();
this.type = Window.get(this).getContainer().getErrorType();
ControlSlot.highlighting.get(EnumHighlighting.ERROR).clear();
ControlSlot.highlighting.get(EnumHighlighting.WARNING).clear();
ControlLiquidTank.tankError.clear();
ControlEnergyBar.isError = false;
if (!this.isMouseOver() || this.errorState == null) {
return;
}
ControlEnergyBar.isError = this.errorState.isPowerError();
if (this.errorState.isItemError()) {
Collection<CustomSlot> slots = this.errorState.getCustomSlots(Window.get(this).getContainer());
for (CustomSlot slot : slots) {
if (this.type == 0) {
ControlSlot.highlighting.get(EnumHighlighting.ERROR).add(slot.slotNumber);
} else {
ControlSlot.highlighting.get(EnumHighlighting.WARNING).add(slot.slotNumber);
}
}
}
if (this.errorState.isTankError()) {
for (final int slot : this.errorState.getData()) {
ControlLiquidTank.tankError.add(slot);
}
}
}
use of binnie.core.gui.minecraft.CustomSlot 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);
}
Aggregations