com.github.chainmailstudios.astromine.common.widget.blade.FluidFilterWidget.setSize()

Here are the examples of the java api com.github.chainmailstudios.astromine.common.widget.blade.FluidFilterWidget.setSize() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

9 Source : TankScreenHandler.java
with MIT License
from Mixinors

@Override
public void initialize(int width, int height) {
    super.initialize(width, height);
    fluidBar.setPosition(Position.of(width / 2F - fluidBar.getWidth() / 2F, fluidBar.getY()));
    SlotWidget input = new SlotWidget(0, blockEnreplacedy);
    input.setPosition(Position.of(mainTab, 12, 26));
    input.setSize(Size.of(18, 18));
    SlotWidget output = new SlotWidget(1, blockEnreplacedy);
    output.setPosition(Position.of(mainTab, 146, 26));
    output.setSize(Size.of(18, 18));
    HorizontalArrowWidget leftArrow = new HorizontalArrowWidget();
    leftArrow.setPosition(Position.of(input, 28, 0));
    leftArrow.setSize(Size.of(22, 16));
    leftArrow.setLimitSupplier(() -> 1);
    leftArrow.setProgressSupplier(() -> {
        ItemStack stack = blockEnreplacedy.getComponent(AstromineComponentTypes.ITEM_INVENTORY_COMPONENT).getStack(0);
        if (stack.gereplacedem() instanceof FluidVolumeItem) {
            FluidInventoryComponent fluidComponent = ComponentProvider.fromItemStack(stack).getComponent(AstromineComponentTypes.FLUID_INVENTORY_COMPONENT);
            return !fluidComponent.isEmpty() ? 1 : 0;
        } else {
            return 0;
        }
    });
    HorizontalArrowWidget rightArrow = new HorizontalArrowWidget();
    rightArrow.setPosition(Position.of(output, -34, 0));
    rightArrow.setSize(Size.of(22, 16));
    rightArrow.setLimitSupplier(() -> 1);
    rightArrow.setProgressSupplier(() -> {
        ItemStack stack = blockEnreplacedy.getComponent(AstromineComponentTypes.ITEM_INVENTORY_COMPONENT).getStack(0);
        FluidVolume blockEnreplacedyVolume = blockEnreplacedy.getComponent(AstromineComponentTypes.FLUID_INVENTORY_COMPONENT).getVolume(0);
        if (stack.gereplacedem() instanceof FluidVolumeItem) {
            FluidInventoryComponent fluidComponent = ComponentProvider.fromItemStack(stack).getComponent(AstromineComponentTypes.FLUID_INVENTORY_COMPONENT);
            return !fluidComponent.isEmpty() && !blockEnreplacedyVolume.isEmpty() ? 1 : 0;
        } else {
            return 0;
        }
    });
    FluidFilterWidget filter = new FluidFilterWidget();
    filter.setPosition(Position.of(input, 5, -9 - 5));
    filter.setSize(Size.of(8, 8));
    filter.setFluidConsumer(fluid -> {
        tank.setFilter(fluid);
    });
    filter.setFluidSupplier(() -> tank.getFilter());
    mainTab.addWidget(input);
    mainTab.addWidget(output);
    mainTab.addWidget(leftArrow);
    mainTab.addWidget(rightArrow);
    mainTab.addWidget(filter);
}