Merge pull request #1269 from alexpic57/1.12

update Implosion Compressor to GuiBase + fix duplication
This commit is contained in:
Modmuss50 2017-09-08 21:10:20 +01:00 committed by GitHub
commit 5985acc431
42 changed files with 187 additions and 111 deletions

View file

@ -32,6 +32,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
import org.apache.commons.lang3.Range;
import org.apache.commons.lang3.tuple.MutableTriple;
import org.apache.commons.lang3.tuple.Pair;
import reborncore.common.tile.TileLegacyMachineBase;
import reborncore.common.util.ItemUtils;
import techreborn.client.container.IRightClickHandler;
@ -55,9 +56,11 @@ public class BuiltContainer extends Container {
private List<Consumer<InventoryCrafting>> craftEvents;
private Integer[] integerParts;
private final TileLegacyMachineBase tile;
public BuiltContainer(final String name, final Predicate<EntityPlayer> canInteract,
final List<Range<Integer>> playerSlotRange,
final List<Range<Integer>> tileSlotRange) {
final List<Range<Integer>> playerSlotRange,
final List<Range<Integer>> tileSlotRange, TileLegacyMachineBase tile) {
this.name = name;
this.canInteract = canInteract;
@ -67,6 +70,8 @@ public class BuiltContainer extends Container {
this.shortValues = new ArrayList<>();
this.integerValues = new ArrayList<>();
this.tile = tile;
}
public void addShortSync(final List<Pair<IntSupplier, IntConsumer>> syncables) {
@ -94,7 +99,11 @@ public class BuiltContainer extends Container {
@Override
public boolean canInteractWith(final EntityPlayer playerIn) {
return this.canInteract.test(playerIn);
if(this.tile != null) {
return tile.isUsableByPlayer(playerIn);
} else {
return this.canInteract.test(playerIn); // <
}
}
@Override

View file

@ -31,6 +31,7 @@ import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.inventory.Slot;
import org.apache.commons.lang3.Range;
import org.apache.commons.lang3.tuple.Pair;
import reborncore.common.tile.TileLegacyMachineBase;
import java.util.ArrayList;
import java.util.List;
@ -88,10 +89,32 @@ public class ContainerBuilder {
this.tileInventoryRanges.add(range);
}
@Deprecated
/**
* The container have to know if the tile is still available (the block was not destroyed)
* and if the player is not to far from him to close the GUI if necessary
*/
public BuiltContainer create() {
final BuiltContainer built = new BuiltContainer(this.name, this.canInteract,
this.playerInventoryRanges,
this.tileInventoryRanges);
this.tileInventoryRanges, null);
if (!this.shortValues.isEmpty())
built.addShortSync(this.shortValues);
if (!this.integerValues.isEmpty())
built.addIntegerSync(this.integerValues);
if (!this.craftEvents.isEmpty())
built.addCraftEvents(this.craftEvents);
this.slots.forEach(built::addSlot);
this.slots.clear();
return built;
}
public BuiltContainer create(final TileLegacyMachineBase tile) {
final BuiltContainer built = new BuiltContainer(this.name, this.canInteract,
this.playerInventoryRanges,
this.tileInventoryRanges, tile);
if (!this.shortValues.isEmpty())
built.addShortSync(this.shortValues);
if (!this.integerValues.isEmpty())

View file

@ -24,69 +24,119 @@
package techreborn.client.gui;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraft.client.resources.I18n;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.translation.I18n;
import reborncore.client.multiblock.Multiblock;
import reborncore.client.multiblock.MultiblockRenderEvent;
import reborncore.client.multiblock.MultiblockSet;
import reborncore.common.misc.Location;
import techreborn.Core;
import techreborn.client.gui.widget.GuiButtonHologram;
import techreborn.init.ModBlocks;
import techreborn.proxies.ClientProxy;
import techreborn.tiles.multiblock.TileImplosionCompressor;
public class GuiImplosionCompressor extends GuiContainer {
import java.io.IOException;
public static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/implosion_compressor.png");
public class GuiImplosionCompressor extends GuiBase {
TileImplosionCompressor compressor;
TileImplosionCompressor tile;
public GuiImplosionCompressor(final EntityPlayer player, final TileImplosionCompressor compressor) {
super(compressor.createContainer(player));
this.xSize = 176;
this.ySize = 167;
this.compressor = compressor;
public GuiImplosionCompressor(final EntityPlayer player, final TileImplosionCompressor tile) {
super(player, tile, tile.createContainer(player));
this.tile = tile;
}
@Override
public void initGui() {
super.initGui();
ClientProxy.multiblockRenderEvent.setMultiblock(null);
}
@Override
protected void drawGuiContainerBackgroundLayer(final float p_146976_1_, final int p_146976_2_, final int p_146976_3_) {
this.drawDefaultBackground();
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(GuiImplosionCompressor.texture);
final int k = (this.width - this.xSize) / 2;
final int l = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
final GuiBase.Layer layer = Layer.BACKGROUND;
if (!this.compressor.getMutliBlock()) {
// GuiDraw.drawTooltipBox(k + 30, l + 50 + 12 - 0, 114, 10);
this.fontRenderer.drawString(I18n.format("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12, -1);
drawSlot(50, 27, layer);
drawSlot(50, 47, layer);
drawSlot(92, 36, layer);
drawSlot(110, 36, layer);
if (tile.getMutliBlock()) {
builder.drawHologramButton(this, 6, 4, mouseX, mouseY, layer);
}
this.mc.getTextureManager().bindTexture(GuiImplosionCompressor.texture);
int j = this.compressor.getProgressScaled(24);
if (j > 0) {
this.drawTexturedModalRect(k + 61, l + 37, 176, 14, j + 1, 16);
}
j = this.compressor.getEnergyScaled(12);
if (j > 0) {
this.drawTexturedModalRect(k + 14, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
}
this.builder.drawJEIButton(this, 150, 4, layer);
}
@Override
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = I18n.format("tile.techreborn:implosion_compressor.name");
this.fontRenderer.drawString(name, this.xSize / 2 - this.fontRenderer.getStringWidth(name) / 2, 6, 4210752);
this.fontRenderer.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
final GuiBase.Layer layer = Layer.FOREGROUND;
this.builder.drawProgressBar(this, this.tile.getProgressScaled(100), 100, 71, 40, mouseX, mouseY, TRBuilder.ProgressDirection.RIGHT, layer);
this.builder.drawMultiEnergyBar(this, 9, 19, (int) this.tile.getEnergy(), (int) this.tile.getMaxPower(), mouseX, mouseY, 0, layer);
if (tile.getMutliBlock()) {
addHologramButton(6, 4, 212, layer);
} else {
builder.drawMultiblockMissingBar(this, layer);
addHologramButton(76, 56, 212, layer);
builder.drawHologramButton(this, 76, 56, mouseX, mouseY, layer);
}
}
public void addHologramButton(int x, int y, int id, Layer layer) {
if (id == 0)
buttonList.clear();
int factorX = 0;
int factorY = 0;
if (layer == Layer.BACKGROUND) {
factorX = guiLeft;
factorY = guiTop;
}
buttonList.add(new GuiButtonHologram(id, x + factorX, y + factorY, this, layer));
}
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
super.drawScreen(mouseX, mouseY, partialTicks);
this.renderHoveredToolTip(mouseX, mouseY);
public void actionPerformed(final GuiButton button) throws IOException {
super.actionPerformed(button);
if (button.id == 212) {
if (ClientProxy.multiblockRenderEvent.currentMultiblock == null) {
{
// This code here makes a basic multiblock and then sets to the selected one.
final Multiblock multiblock = new Multiblock();
for (int x = -1; x <= 1; x++) {
for (int y = -4; y <= -2; y++) {
for (int z = -1; z <= 1; z++) {
if (!((x == 0) && (y == -3) && (z == 0))) {
this.addComponent(x, y, z, ModBlocks.MACHINE_CASINGS.getStateFromMeta(1), multiblock);
}
}
}
}
final MultiblockSet set = new MultiblockSet(multiblock);
ClientProxy.multiblockRenderEvent.setMultiblock(set);
ClientProxy.multiblockRenderEvent.parent = new Location(this.tile.getPos().getX(), this.tile.getPos().getY(), this.tile.getPos().getZ(), this.tile.getWorld());
MultiblockRenderEvent.anchor = new BlockPos(this.tile.getPos().getX(), this.tile.getPos().getY(), this.tile.getPos().getZ());
}
} else {
ClientProxy.multiblockRenderEvent.setMultiblock(null);
}
}
}
public void addComponent(final int x, final int y, final int z, final IBlockState blockState, final Multiblock multiblock) {
multiblock.addComponent(new BlockPos(x, y, z), blockState);
}
}

View file

@ -253,7 +253,7 @@ public class TechRebornJeiPlugin extends BlankModPlugin {
registry.addRecipeClickArea(GuiAlloySmelter.class, 80, 35, 26, 20, RecipeCategoryUids.ALLOY_SMELTER);
registry.addRecipeClickArea(GuiAssemblingMachine.class, 85, 34, 24, 20, RecipeCategoryUids.ASSEMBLING_MACHINE);
registry.addRecipeClickArea(GuiFusionReactor.class, 111, 34, 27, 19, RecipeCategoryUids.FUSION_REACTOR);
registry.addRecipeClickArea(GuiImplosionCompressor.class, 60, 37, 24, 15,
registry.addRecipeClickArea(GuiImplosionCompressor.class, 150, 4, 20, 12,
RecipeCategoryUids.IMPLOSION_COMPRESSOR);
registry.addRecipeClickArea(GuiIndustrialElectrolyzer.class, 72, 37, 33, 14,
RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER);

View file

@ -29,6 +29,8 @@ import mezz.jei.api.gui.*;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.BlankRecipeCategory;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.gui.GuiImplosionCompressor;
import techreborn.compat.jei.RecipeCategoryUids;
@ -38,18 +40,15 @@ import techreborn.lib.ModInfo;
import javax.annotation.Nonnull;
public class ImplosionCompressorRecipeCategory extends BlankRecipeCategory<ImplosionCompressorRecipeWrapper> {
private static final int[] INPUT_SLOTS = { 0, 1 };
private static final int[] OUTPUT_SLOTS = { 2, 3 };
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/jei.png");
private static final int[] INPUT_SLOTS = {0, 1};
private static final int[] OUTPUT_SLOTS = {2, 3};
private final IDrawable background;
private final IDrawable electricity;
private final String title;
public ImplosionCompressorRecipeCategory(IGuiHelper guiHelper) {
background = guiHelper.createDrawable(GuiImplosionCompressor.texture, 16, 25, 116, 36);
IDrawableStatic electricityDrawable = guiHelper.createDrawable(GuiImplosionCompressor.texture, 176, 0, 14, 14);
electricity = guiHelper.createAnimatedDrawable(electricityDrawable, 300, IDrawableAnimated.StartDirection.TOP,
true);
background = guiHelper.createDrawable(texture, 0, 95, 120, 42);
title = I18n.translateToLocal("tile.techreborn:implosion_compressor.name");
}
@ -76,26 +75,20 @@ public class ImplosionCompressorRecipeCategory extends BlankRecipeCategory<Implo
return background;
}
@Override
public void drawExtras(Minecraft minecraft) {
super.drawExtras(minecraft);
electricity.draw(minecraft, 0, 12);
}
@Override
public void setRecipe(
@Nonnull
IRecipeLayout recipeLayout,
@Nonnull
ImplosionCompressorRecipeWrapper recipeWrapper,
@Nonnull
IIngredients ingredients) {
@Nonnull
IRecipeLayout recipeLayout,
@Nonnull
ImplosionCompressorRecipeWrapper recipeWrapper,
@Nonnull
IIngredients ingredients) {
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
guiItemStacks.init(INPUT_SLOTS[0], true, 20, 0);
guiItemStacks.init(INPUT_SLOTS[1], true, 20, 18);
guiItemStacks.init(INPUT_SLOTS[0], true, 21, 2);
guiItemStacks.init(INPUT_SLOTS[1], true, 21, 22);
guiItemStacks.init(OUTPUT_SLOTS[0], false, 76, 9);
guiItemStacks.init(OUTPUT_SLOTS[1], false, 94, 9);
guiItemStacks.init(OUTPUT_SLOTS[0], false, 63, 11);
guiItemStacks.init(OUTPUT_SLOTS[1], false, 81, 11);
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
}

View file

@ -31,6 +31,7 @@ import mezz.jei.api.gui.IDrawableStatic;
import net.minecraft.client.Minecraft;
import techreborn.api.recipe.machines.ImplosionCompressorRecipe;
import techreborn.client.gui.GuiImplosionCompressor;
import techreborn.client.gui.TRBuilder;
import techreborn.compat.jei.BaseRecipeWrapper;
import javax.annotation.Nonnull;
@ -39,24 +40,24 @@ public class ImplosionCompressorRecipeWrapper extends BaseRecipeWrapper<Implosio
private final IDrawableAnimated progress;
public ImplosionCompressorRecipeWrapper(
@Nonnull
IJeiHelpers jeiHelpers,
@Nonnull
ImplosionCompressorRecipe baseRecipe) {
@Nonnull
IJeiHelpers jeiHelpers,
@Nonnull
ImplosionCompressorRecipe baseRecipe) {
super(baseRecipe);
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
IDrawableStatic progressStatic = guiHelper.createDrawable(GuiImplosionCompressor.texture, 176, 14, 21, 11);
IDrawableStatic progressStatic = guiHelper.createDrawable(TRBuilder.GUI_SHEET, 100, 151, 16, 10);
this.progress = guiHelper.createAnimatedDrawable(progressStatic, baseRecipe.tickTime(),
IDrawableAnimated.StartDirection.LEFT, false);
IDrawableAnimated.StartDirection.LEFT, false);
}
@Override
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY);
progress.draw(minecraft, 44, 13);
progress.draw(minecraft, 43, 16);
int x = -45;
int y = 4;
int x = -35;
int y = 13;
int lineHeight = minecraft.fontRenderer.FONT_HEIGHT;
minecraft.fontRenderer.drawString("Time: " + baseRecipe.tickTime / 20 + " s", x, y, 0x444444);

View file

@ -156,6 +156,6 @@ public class TileAssemblingMachine extends TilePowerAcceptor
return new ContainerBuilder("assemblingmachine").player(player.inventory).inventory(8, 84).hotbar(8, 142)
.addInventory().tile(this).slot(0, 47, 17).slot(1, 65, 17).outputSlot(2, 116, 35).energySlot(3, 56, 53)
.upgradeSlot(4, 152, 8).upgradeSlot(5, 152, 26).upgradeSlot(6, 152, 44).upgradeSlot(7, 152, 62)
.syncEnergyValue().syncCrafterValue().addInventory().create();
.syncEnergyValue().syncCrafterValue().addInventory().create(this);
}
}

View file

@ -296,7 +296,7 @@ public class TileAutoCraftingTable extends TilePowerAcceptor implements IContain
.outputSlot(9, 145, 42).syncEnergyValue()
.syncIntegerValue(this::getProgress, this::setProgress)
.syncIntegerValue(this::getMaxProgress, this::setMaxProgress)
.addInventory().create();
.addInventory().create(this);
}
@Override

View file

@ -144,7 +144,7 @@ public class TileChargeOMat extends TilePowerAcceptor
public BuiltContainer createContainer(final EntityPlayer player) {
return new ContainerBuilder("chargebench").player(player.inventory).inventory().hotbar().addInventory()
.tile(this).energySlot(0, 62, 25).energySlot(1, 98, 25).energySlot(2, 62, 45).energySlot(3, 98, 45)
.energySlot(4, 62, 65).energySlot(5, 98, 65).syncEnergyValue().addInventory().create();
.energySlot(4, 62, 65).energySlot(5, 98, 65).syncEnergyValue().addInventory().create(this);
}
@Override

View file

@ -170,6 +170,6 @@ public class TileChemicalReactor extends TilePowerAcceptor
public BuiltContainer createContainer(final EntityPlayer player) {
return new ContainerBuilder("chemicalreactor").player(player.inventory).inventory().hotbar()
.addInventory().tile(this).slot(0, 34, 47).slot(1, 126, 47).outputSlot(2, 80, 47).energySlot(3, 8, 72)
.syncEnergyValue().syncCrafterValue().addInventory().create();
.syncEnergyValue().syncCrafterValue().addInventory().create(this);
}
}

View file

@ -100,6 +100,6 @@ public class TileChunkLoader extends TilePowerAcceptor implements IToolDrop, IIn
@Override
public BuiltContainer createContainer(final EntityPlayer player) {
return new ContainerBuilder("chunkloader").player(player.inventory).inventory(8,84).hotbar(8,142).addInventory()
.create();
.create(this);
}
}

View file

@ -45,7 +45,7 @@ public class TileDigitalChest extends TileTechStorageBase implements IContainerP
@Override
public BuiltContainer createContainer(final EntityPlayer player) {
return new ContainerBuilder("digitalchest").player(player.inventory).inventory().hotbar().addInventory()
.tile(this).slot(0, 80, 24).outputSlot(1, 80, 64).addInventory().create();
.tile(this).slot(0, 80, 24).outputSlot(1, 80, 64).addInventory().create(this);
}
@Override

View file

@ -188,7 +188,7 @@ public class TileIndustrialCentrifuge extends TilePowerAcceptor
return new ContainerBuilder("centrifuge").player(player.inventory).inventory().hotbar()
.addInventory().tile(this).slot(0, 40, 34).slot(1, 40, 54).outputSlot(2, 82, 44).outputSlot(3, 101, 25)
.outputSlot(4, 120, 44).outputSlot(5, 101, 63).energySlot(6, 8, 72).syncEnergyValue()
.syncCrafterValue().addInventory().create();
.syncCrafterValue().addInventory().create(this);
}
}

View file

@ -183,6 +183,6 @@ public class TileIndustrialElectrolyzer extends TilePowerAcceptor
.filterSlot(1, 50, 51, stack -> ItemUtils.isItemEqual(stack, DynamicCell.getEmptyCell(1), true, true))
.filterSlot(0, 80, 51, stack -> !ItemUtils.isItemEqual(stack, DynamicCell.getEmptyCell(1), true, true))
.outputSlot(2, 50, 19).outputSlot(3, 70, 19).outputSlot(4, 90, 19).outputSlot(5, 110, 19)
.energySlot(6, 18, 51).syncEnergyValue().syncCrafterValue().addInventory().create();
.energySlot(6, 18, 51).syncEnergyValue().syncCrafterValue().addInventory().create(this);
}
}

View file

@ -352,6 +352,6 @@ public class TileIronAlloyFurnace extends TileLegacyMachineBase
&& ItemUtils.isInputEqual(recipe.getInputs().get(1), stack, true, true, true)))
.outputSlot(2, 116, 35).fuelSlot(3, 56, 53).syncIntegerValue(this::getBurnTime, this::setBurnTime)
.syncIntegerValue(this::getCookTime, this::setCookTime)
.syncIntegerValue(this::getCurrentItemBurnTime, this::setCurrentItemBurnTime).addInventory().create();
.syncIntegerValue(this::getCurrentItemBurnTime, this::setCurrentItemBurnTime).addInventory().create(this);
}
}

View file

@ -207,6 +207,6 @@ public class TileIronFurnace extends TileLegacyMachineBase
return new ContainerBuilder("ironfurnace").player(player.inventory).inventory(8, 84).hotbar(8, 142)
.addInventory().tile(this).slot(0, 56, 17).outputSlot(1, 116, 35).fuelSlot(2, 56, 53)
.syncIntegerValue(this::getBurnTime, this::setBurnTime)
.syncIntegerValue(this::getTotalBurnTime, this::setTotalBurnTime).addInventory().create();
.syncIntegerValue(this::getTotalBurnTime, this::setTotalBurnTime).addInventory().create(this);
}
}

View file

@ -233,7 +233,7 @@ public class TileMatterFabricator extends TilePowerAcceptor
.addInventory().tile(this).slot(0, 30, 20).slot(1, 50, 20).slot(2, 70, 20).slot(3, 90, 20)
.slot(4, 110, 20).slot(5, 130, 20).outputSlot(6, 40, 66).outputSlot(7, 60, 66).outputSlot(8, 80, 66)
.outputSlot(9, 100, 66).outputSlot(10, 120, 66).syncEnergyValue()
.syncIntegerValue(this::getProgress, this::setProgress).addInventory().create();
.syncIntegerValue(this::getProgress, this::setProgress).addInventory().create(this);
}
@Override

View file

@ -45,7 +45,7 @@ public class TileQuantumChest extends TileTechStorageBase implements IContainerP
@Override
public BuiltContainer createContainer(final EntityPlayer player) {
return new ContainerBuilder("quantumchest").player(player.inventory).inventory().hotbar().addInventory()
.tile(this).slot(0, 80, 24).outputSlot(1, 80, 64).addInventory().create();
.tile(this).slot(0, 80, 24).outputSlot(1, 80, 64).addInventory().create(this);
}
@Override

View file

@ -158,6 +158,6 @@ public class TileQuantumTank extends TileLegacyMachineBase
public BuiltContainer createContainer(final EntityPlayer player) {
return new ContainerBuilder("quantumtank").player(player.inventory).inventory(8, 84).hotbar(8, 142)
.addInventory().tile(this).fluidSlot(0, 80, 17).outputSlot(1, 80, 53).fakeSlot(2, 59, 42).addInventory()
.create();
.create(this);
}
}

View file

@ -239,7 +239,7 @@ public class TileRollingMachine extends TilePowerAcceptor
.onCraft(inv -> this.inventory.setInventorySlotContents(1,
RollingMachineRecipe.instance.findMatchingRecipe(inv, this.world)))
.addInventory().tile(this).outputSlot(0, 124, 35).energySlot(2, 8, 51).syncEnergyValue()
.syncIntegerValue(this::getBurnTime, this::setBurnTime).addInventory().create();
.syncIntegerValue(this::getBurnTime, this::setBurnTime).addInventory().create(this);
}
private static class RollingTileContainer extends Container {

View file

@ -217,6 +217,6 @@ public class TileScrapboxinator extends TilePowerAcceptor
.addInventory().tile(this).filterSlot(0, 56, 34, stack -> stack.getItem() == ModItems.SCRAP_BOX)
.outputSlot(1, 116, 35).upgradeSlot(2, 152, 8).upgradeSlot(3, 152, 26).upgradeSlot(4, 152, 44)
.upgradeSlot(5, 152, 62).syncEnergyValue().syncIntegerValue(this::getProgress, this::setProgress)
.addInventory().create();
.addInventory().create(this);
}
}

View file

@ -365,6 +365,6 @@ public class TileFusionControlComputer extends TilePowerAcceptor implements IInv
.syncIntegerValue(this::getCoilStatus, this::setCoilStatus)
.syncIntegerValue(this::getCrafingTickTime, this::setCrafingTickTime)
.syncIntegerValue(this::getFinalTickTime, this::setFinalTickTime)
.syncIntegerValue(this::getNeededPower, this::setNeededPower).addInventory().create();
.syncIntegerValue(this::getNeededPower, this::setNeededPower).addInventory().create(this);
}
}

View file

@ -70,6 +70,6 @@ public class TileDieselGenerator extends TileBaseFluidGenerator implements ICont
public BuiltContainer createContainer(final EntityPlayer player) {
return new ContainerBuilder("dieselgenerator").player(player.inventory).inventory().hotbar()
.addInventory().tile(this).slot(0, 25, 35).outputSlot(1, 25, 55).syncEnergyValue()
.addInventory().create();
.addInventory().create(this);
}
}

View file

@ -70,6 +70,6 @@ public class TileGasTurbine extends TileBaseFluidGenerator implements IContainer
public BuiltContainer createContainer(final EntityPlayer player) {
return new ContainerBuilder("gasturbine").player(player.inventory).inventory().hotbar()
.addInventory().tile(this).slot(0, 25, 35).outputSlot(1, 25, 55).syncEnergyValue()
.addInventory().create();
.addInventory().create(this);
}
}

View file

@ -70,6 +70,6 @@ public class TileSemiFluidGenerator extends TileBaseFluidGenerator implements IC
public BuiltContainer createContainer(final EntityPlayer player) {
return new ContainerBuilder("semifluidgenerator").player(player.inventory).inventory().hotbar()
.addInventory().tile(this).slot(0, 25, 35).outputSlot(1, 25, 55).syncEnergyValue()
.addInventory().create();
.addInventory().create(this);
}
}

View file

@ -179,7 +179,7 @@ public class TileSolidFuelGenerator extends TilePowerAcceptor implements IToolDr
return new ContainerBuilder("generator").player(player.inventory).inventory().hotbar().addInventory()
.tile(this).fuelSlot(0, 80, 54).energySlot(1, 8, 72).syncEnergyValue()
.syncIntegerValue(this::getBurnTime, this::setBurnTime)
.syncIntegerValue(this::getTotalBurnTime, this::setTotalBurnTime).addInventory().create();
.syncIntegerValue(this::getTotalBurnTime, this::setTotalBurnTime).addInventory().create(this);
}
@Override

View file

@ -75,6 +75,6 @@ public class TileThermalGenerator extends TileBaseFluidGenerator implements ICon
public BuiltContainer createContainer(final EntityPlayer player) {
return new ContainerBuilder("thermalgenerator").player(player.inventory).inventory().hotbar()
.addInventory().tile(this).slot(0, 25, 35).outputSlot(1, 25, 55).syncEnergyValue()
.addInventory().create();
.addInventory().create(this);
}
}

View file

@ -87,7 +87,7 @@ public class TileInterdimensionalSU extends TileEnergyStorage implements IContai
public BuiltContainer createContainer(final EntityPlayer player) {
return new ContainerBuilder("mfsu").player(player.inventory).inventory().hotbar().armor()
.complete(8, 18).addArmor().addInventory().tile(this).energySlot(0, 62, 45).energySlot(1, 98, 45)
.syncEnergyValue().addInventory().create();
.syncEnergyValue().addInventory().create(this);
}
@Override

View file

@ -153,9 +153,9 @@ public class TileImplosionCompressor extends TilePowerAcceptor
@Override
public BuiltContainer createContainer(final EntityPlayer player) {
return new ContainerBuilder("implosioncompressor").player(player.inventory).inventory(8, 84).hotbar(8, 142)
.addInventory().tile(this).slot(0, 37, 26).slot(1, 37, 44).outputSlot(2, 93, 35).outputSlot(3, 111, 35)
.syncEnergyValue().syncCrafterValue().addInventory().create();
return new ContainerBuilder("implosioncompressor").player(player.inventory).inventory().hotbar()
.addInventory().tile(this).slot(0, 50, 27).slot(1, 50, 47).outputSlot(2, 92, 36).outputSlot(3, 110, 36)
.syncEnergyValue().syncCrafterValue().addInventory().create(this);
}
}

View file

@ -234,6 +234,6 @@ public class TileIndustrialBlastFurnace extends TilePowerAcceptor implements ITo
return new ContainerBuilder("blastfurnace").player(player.inventory).inventory().hotbar()
.addInventory().tile(this).slot(0, 50, 27).slot(1, 50, 47).outputSlot(2, 92, 36).outputSlot(3, 110, 36)
.syncEnergyValue().syncCrafterValue().syncIntegerValue(this::getHeat, this::setHeat).addInventory()
.create();
.create(this);
}
}

View file

@ -278,7 +278,7 @@ public class TileIndustrialGrinder extends TilePowerAcceptor implements IToolDro
return new ContainerBuilder("industrialgrinder").player(player.inventory).inventory().hotbar()
.addInventory().tile(this).slot(1, 34, 35).slot(0, 84, 43).outputSlot(2, 126, 18).outputSlot(3, 126, 36)
.outputSlot(4, 126, 54).outputSlot(5, 126, 72).outputSlot(6, 34, 55).syncEnergyValue().syncCrafterValue().addInventory()
.create();
.create(this);
}
}

View file

@ -267,6 +267,6 @@ public class TileIndustrialSawmill extends TilePowerAcceptor
public BuiltContainer createContainer(final EntityPlayer player) {
return new ContainerBuilder("industrialsawmill").player(player.inventory).inventory(8, 84).hotbar(8, 142)
.addInventory().tile(this).slot(0, 32, 26).slot(1, 32, 44).outputSlot(2, 84, 35).outputSlot(3, 102, 35)
.outputSlot(4, 120, 35).syncEnergyValue().syncIntegerValue(this::getTickTime, this::setTickTime).addInventory().create();
.outputSlot(4, 120, 35).syncEnergyValue().syncIntegerValue(this::getTickTime, this::setTickTime).addInventory().create(this);
}
}

View file

@ -150,7 +150,7 @@ public class TileVacuumFreezer extends TilePowerAcceptor
public BuiltContainer createContainer(final EntityPlayer player) {
return new ContainerBuilder("vacuumfreezer").player(player.inventory).inventory().hotbar().addInventory()
.tile(this).slot(0, 55, 45).outputSlot(1, 101, 45).syncEnergyValue().syncCrafterValue().addInventory()
.create();
.create(this);
}
}

View file

@ -48,6 +48,6 @@ public class TileHighVoltageSU extends TileEnergyStorage implements IContainerPr
public BuiltContainer createContainer(final EntityPlayer player) {
return new ContainerBuilder("mfsu").player(player.inventory).inventory().hotbar().armor()
.complete(8, 18).addArmor().addInventory().tile(this).energySlot(0, 62, 45).energySlot(1, 98, 45)
.syncEnergyValue().addInventory().create();
.syncEnergyValue().addInventory().create(this);
}
}

View file

@ -43,6 +43,6 @@ public class TileLowVoltageSU extends TileEnergyStorage implements IContainerPro
@Override
public BuiltContainer createContainer(final EntityPlayer player) {
return new ContainerBuilder("batbox").player(player.inventory).inventory().hotbar().addInventory()
.tile(this).energySlot(0, 62, 45).energySlot(1, 98, 45).syncEnergyValue().addInventory().create();
.tile(this).energySlot(0, 62, 45).energySlot(1, 98, 45).syncEnergyValue().addInventory().create(this);
}
}

View file

@ -48,7 +48,7 @@ public class TileMediumVoltageSU extends TileEnergyStorage implements IContainer
public BuiltContainer createContainer(final EntityPlayer player) {
return new ContainerBuilder("mfe").player(player.inventory).inventory().hotbar().armor()
.complete(8, 18).addArmor().addInventory().tile(this).energySlot(0, 62, 45).energySlot(1, 98, 45)
.syncEnergyValue().addInventory().create();
.syncEnergyValue().addInventory().create(this);
}
}

View file

@ -187,6 +187,6 @@ public class TileAlloySmelter extends TilePowerAcceptor
&& ItemUtils.isInputEqual(recipe.getInputs().get(1), stack, true, true, true)))
.outputSlot(2, 116, 35).energySlot(3, 56, 53).upgradeSlot(4, 152, 8).upgradeSlot(5, 152, 26)
.upgradeSlot(6, 152, 44).upgradeSlot(7, 152, 62).syncEnergyValue().syncCrafterValue().addInventory()
.create();
.create(this);
}
}

View file

@ -139,6 +139,6 @@ public class TileCompressor extends TilePowerAcceptor implements IToolDrop, IInv
public BuiltContainer createContainer(final EntityPlayer player) {
return new ContainerBuilder("compressor").player(player.inventory).inventory().hotbar().addInventory()
.tile(this).slot(0, 55, 45).outputSlot(1, 101, 45).syncEnergyValue().syncCrafterValue().addInventory()
.create();
.create(this);
}
}

View file

@ -222,7 +222,7 @@ public class TileElectricFurnace extends TilePowerAcceptor
public BuiltContainer createContainer(final EntityPlayer player) {
return new ContainerBuilder("electricfurnace").player(player.inventory).inventory().hotbar().addInventory()
.tile(this).slot(0, 55, 45).outputSlot(1, 101, 45).syncEnergyValue()
.syncIntegerValue(this::getBurnTime, this::setBurnTime).addInventory().create();
.syncIntegerValue(this::getBurnTime, this::setBurnTime).addInventory().create(this);
}
@Override

View file

@ -154,7 +154,7 @@ public class TileExtractor extends TilePowerAcceptor
public BuiltContainer createContainer(final EntityPlayer player) {
return new ContainerBuilder("extractor").player(player.inventory).inventory().hotbar().addInventory()
.tile(this).slot(0, 55, 45).outputSlot(1, 101, 45).syncEnergyValue().syncCrafterValue().addInventory()
.create();
.create(this);
}
}

View file

@ -155,7 +155,7 @@ public class TileGrinder extends TilePowerAcceptor
public BuiltContainer createContainer(final EntityPlayer player) {
return new ContainerBuilder("grinder").player(player.inventory).inventory().hotbar().addInventory()
.tile(this).slot(0, 55, 45).outputSlot(1, 101, 45).syncEnergyValue().syncCrafterValue().addInventory()
.create();
.create(this);
}
@Override

View file

@ -200,7 +200,7 @@ public class TileRecycler extends TilePowerAcceptor implements IToolDrop, IInven
public BuiltContainer createContainer(final EntityPlayer player) {
return new ContainerBuilder("recycler").player(player.inventory).inventory().hotbar().addInventory()
.tile(this).slot(0, 55, 45).outputSlot(1, 101, 45).syncEnergyValue()
.syncIntegerValue(this::getProgress, this::setProgress).addInventory().create();
.syncIntegerValue(this::getProgress, this::setProgress).addInventory().create(this);
}
//TODO make this so