use of net.minecraftforge.items.SlotItemHandler in project Binnie by ForestryMC.
the class ContainerFrameHousing method setupContainer.
@Override
protected void setupContainer() {
offset = -21;
addPlayerInventory();
addSlotToContainer(new SlotItemHandler(inv, 0, 80, 37));
}
use of net.minecraftforge.items.SlotItemHandler in project Binnie by ForestryMC.
the class ContainerMutator method setupContainer.
@Override
protected void setupContainer() {
addPlayerInventory();
addSlotToContainer(new SlotItemHandler(inv, 0, 81, 29));
}
use of net.minecraftforge.items.SlotItemHandler in project Binnie by ForestryMC.
the class ContainerHatchery method setupContainer.
@Override
protected void setupContainer() {
offset = -21;
addPlayerInventory();
for (int i = 0; i < 5; i++) {
addSlotToContainer(new SlotItemHandler(inv, i, 44 + i * 18, 37));
}
}
use of net.minecraftforge.items.SlotItemHandler in project GregTech by GregTechCE.
the class RecipeMapCategory method setRecipe.
@Override
public void setRecipe(IRecipeLayout recipeLayout, GTRecipeWrapper recipeWrapper, IIngredients ingredients) {
IGuiItemStackGroup itemStackGroup = recipeLayout.getItemStacks();
IGuiFluidStackGroup fluidStackGroup = recipeLayout.getFluidStacks();
for (Widget uiWidget : modularUI.guiWidgets.values()) {
if (uiWidget instanceof SlotWidget) {
SlotWidget slotWidget = (SlotWidget) uiWidget;
if (!(slotWidget.getHandle() instanceof SlotItemHandler)) {
continue;
}
SlotItemHandler handle = (SlotItemHandler) slotWidget.getHandle();
if (handle.getItemHandler() == importItems) {
// this is input item stack slot widget, so add it to item group
itemStackGroup.init(handle.getSlotIndex(), true, slotWidget.getPosition().x, slotWidget.getPosition().y);
} else if (handle.getItemHandler() == exportItems) {
// this is output item stack slot widget, so add it to item group
itemStackGroup.init(importItems.getSlots() + handle.getSlotIndex(), false, slotWidget.getPosition().x, slotWidget.getPosition().y);
}
} else if (uiWidget instanceof TankWidget) {
TankWidget tankWidget = (TankWidget) uiWidget;
if (importFluids.getFluidTanks().contains(tankWidget.fluidTank)) {
int importIndex = importFluids.getFluidTanks().indexOf(tankWidget.fluidTank);
List<List<FluidStack>> inputsList = ingredients.getInputs(FluidStack.class);
int fluidAmount = 0;
if (inputsList.size() > importIndex && !inputsList.get(importIndex).isEmpty())
fluidAmount = inputsList.get(importIndex).get(0).amount;
// this is input tank widget, so add it to fluid group
fluidStackGroup.init(importIndex, true, tankWidget.getPosition().x + tankWidget.fluidRenderOffset, tankWidget.getPosition().y + tankWidget.fluidRenderOffset, tankWidget.getSize().width - (2 * tankWidget.fluidRenderOffset), tankWidget.getSize().height - (2 * tankWidget.fluidRenderOffset), fluidAmount, false, null);
} else if (exportFluids.getFluidTanks().contains(tankWidget.fluidTank)) {
int exportIndex = exportFluids.getFluidTanks().indexOf(tankWidget.fluidTank);
List<List<FluidStack>> inputsList = ingredients.getOutputs(FluidStack.class);
int fluidAmount = 0;
if (inputsList.size() > exportIndex && !inputsList.get(exportIndex).isEmpty())
fluidAmount = inputsList.get(exportIndex).get(0).amount;
// this is output tank widget, so add it to fluid group
fluidStackGroup.init(importFluids.getFluidTanks().size() + exportIndex, false, tankWidget.getPosition().x + tankWidget.fluidRenderOffset, tankWidget.getPosition().y + tankWidget.fluidRenderOffset, tankWidget.getSize().width - (2 * tankWidget.fluidRenderOffset), tankWidget.getSize().height - (2 * tankWidget.fluidRenderOffset), fluidAmount, false, null);
}
}
}
itemStackGroup.addTooltipCallback(recipeWrapper::addTooltip);
fluidStackGroup.addTooltipCallback(recipeWrapper::addTooltip);
itemStackGroup.set(ingredients);
fluidStackGroup.set(ingredients);
}
use of net.minecraftforge.items.SlotItemHandler in project Binnie by ForestryMC.
the class ContainerStimulator method setupContainer.
@Override
protected void setupContainer() {
offset = -21;
addPlayerInventory();
title = "Stimulator";
addSlotToContainer(new SlotItemHandler(inv, 0, 44, 37));
}
Aggregations