Renames to match yarn changes

This commit is contained in:
modmuss50 2020-03-12 20:56:44 +00:00
parent 5b1e68d093
commit 99b2755887
94 changed files with 415 additions and 418 deletions

View file

@ -37,10 +37,10 @@ import net.minecraft.util.registry.Registry;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.Validate;
import org.apache.commons.lang3.text.WordUtils;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBlockEntityInventoryBuilder;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.BlockEntityScreenHandlerBuilder;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.crafting.RebornRecipeType;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.util.RebornInventory;
@ -93,8 +93,8 @@ public class DataDrivenBEProvider extends BlockEntityType<DataDrivenBEProvider.D
return new DataDrivenBlockEntity(this);
}
public BuiltContainer createContainer(DataDrivenBlockEntity blockEntity, int syncID, PlayerEntity player) {
ContainerBlockEntityInventoryBuilder builder = new ContainerBuilder(identifier.getPath()).player(player.inventory)
public BuiltScreenHandler createScreenHandler(DataDrivenBlockEntity blockEntity, int syncID, PlayerEntity player) {
BlockEntityScreenHandlerBuilder builder = new ScreenHandlerBuilder(identifier.getPath()).player(player.inventory)
.inventory().hotbar().addInventory().blockEntity(blockEntity);
slots.forEach(dataDrivenSlot -> dataDrivenSlot.add(builder));
@ -110,7 +110,7 @@ public class DataDrivenBEProvider extends BlockEntityType<DataDrivenBEProvider.D
return instantiate();
}
public static class DataDrivenBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
public static class DataDrivenBlockEntity extends GenericMachineBlockEntity implements BuiltScreenHandlerProvider {
private final DataDrivenBEProvider provider;
@ -126,8 +126,8 @@ public class DataDrivenBEProvider extends BlockEntityType<DataDrivenBEProvider.D
}
@Override
public BuiltContainer createContainer(int syncID, PlayerEntity player) {
return provider.createContainer(this,syncID, player);
public BuiltScreenHandler createScreenHandler(int syncID, PlayerEntity player) {
return provider.createScreenHandler(this,syncID, player);
}
public DataDrivenBEProvider getProvider() {

View file

@ -25,17 +25,17 @@
package techreborn.blockentity.data;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
public class DataDrivenGui extends GuiBase<BuiltContainer> {
public class DataDrivenGui extends GuiBase<BuiltScreenHandler> {
private final DataDrivenBEProvider provider;
private final DataDrivenBEProvider.DataDrivenBlockEntity blockEntity;
public DataDrivenGui(int syncID, final PlayerEntity player, final DataDrivenBEProvider.DataDrivenBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createContainer(syncID, player));
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
this.blockEntity = blockEntity;
this.provider = blockEntity.getProvider();
}

View file

@ -30,7 +30,7 @@ import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.util.JsonHelper;
import org.apache.commons.lang3.Validate;
import reborncore.client.containerBuilder.builder.ContainerBlockEntityInventoryBuilder;
import reborncore.client.screen.builder.BlockEntityScreenHandlerBuilder;
import reborncore.client.gui.builder.GuiBase;
import reborncore.common.util.serialization.SerializationUtil;
@ -77,7 +77,7 @@ public class DataDrivenSlot {
return type;
}
public void add(ContainerBlockEntityInventoryBuilder inventoryBuilder){
public void add(BlockEntityScreenHandlerBuilder inventoryBuilder){
type.getSlotBiConsumer().accept(inventoryBuilder, this);
}

View file

@ -24,7 +24,7 @@
package techreborn.blockentity.data;
import reborncore.client.containerBuilder.builder.ContainerBlockEntityInventoryBuilder;
import reborncore.client.screen.builder.BlockEntityScreenHandlerBuilder;
import java.util.Arrays;
import java.util.function.BiConsumer;
@ -48,13 +48,13 @@ public enum SlotType {
.orElse(null);
}
private BiConsumer<ContainerBlockEntityInventoryBuilder, DataDrivenSlot> slotBiConsumer;
private BiConsumer<BlockEntityScreenHandlerBuilder, DataDrivenSlot> slotBiConsumer;
SlotType(BiConsumer<ContainerBlockEntityInventoryBuilder, DataDrivenSlot> slotBiConsumer) {
SlotType(BiConsumer<BlockEntityScreenHandlerBuilder, DataDrivenSlot> slotBiConsumer) {
this.slotBiConsumer = slotBiConsumer;
}
public BiConsumer<ContainerBlockEntityInventoryBuilder, DataDrivenSlot> getSlotBiConsumer() {
public BiConsumer<BlockEntityScreenHandlerBuilder, DataDrivenSlot> getSlotBiConsumer() {
return slotBiConsumer;
}
}

View file

@ -26,16 +26,16 @@ package techreborn.blockentity.generator;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.fluid.FluidValue;
import techreborn.api.generator.EFluidGenerator;
import techreborn.config.TechRebornConfig;
import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
public class PlasmaGeneratorBlockEntity extends BaseFluidGeneratorBlockEntity implements IContainerProvider {
public class PlasmaGeneratorBlockEntity extends BaseFluidGeneratorBlockEntity implements BuiltScreenHandlerProvider {
public PlasmaGeneratorBlockEntity() {
super(TRBlockEntities.PLASMA_GENERATOR, EFluidGenerator.PLASMA, "PlasmaGeneratorBlockEntity", FluidValue.BUCKET.multiply(10), TechRebornConfig.plasmaGeneratorEnergyPerTick);
@ -57,8 +57,8 @@ public class PlasmaGeneratorBlockEntity extends BaseFluidGeneratorBlockEntity im
}
@Override
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("plasmagenerator").player(player.inventory).inventory().hotbar().addInventory()
public BuiltScreenHandler createScreenHandler(int syncID, final PlayerEntity player) {
return new ScreenHandlerBuilder("plasmagenerator").player(player.inventory).inventory().hotbar().addInventory()
.blockEntity(this).slot(0, 25, 35).outputSlot(1, 25, 55).syncEnergyValue()
.sync(this::getTicksSinceLastChange, this::setTicksSinceLastChange)
.sync(this::getTankAmount, this::setTankAmount)

View file

@ -33,9 +33,9 @@ import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import net.minecraft.util.math.Direction;
import reborncore.api.IToolDrop;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
import reborncore.common.powerSystem.PowerSystem;
@ -48,7 +48,7 @@ import techreborn.init.TRContent.SolarPanels;
import java.util.List;
public class SolarPanelBlockEntity extends PowerAcceptorBlockEntity implements IToolDrop, IContainerProvider {
public class SolarPanelBlockEntity extends PowerAcceptorBlockEntity implements IToolDrop, BuiltScreenHandlerProvider {
// State ZEROGEN: No exposure to sun
@ -251,8 +251,8 @@ public class SolarPanelBlockEntity extends PowerAcceptorBlockEntity implements I
}
@Override
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("solar_panel").player(player.inventory).inventory().hotbar().addInventory()
public BuiltScreenHandler createScreenHandler(int syncID, final PlayerEntity player) {
return new ScreenHandlerBuilder("solar_panel").player(player.inventory).inventory().hotbar().addInventory()
.blockEntity(this).syncEnergyValue()
.sync(this::getSunState, this::setSunState)
.addInventory().create(this, syncID);

View file

@ -26,9 +26,9 @@ package techreborn.blockentity.generator.advanced;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.fluid.FluidValue;
import techreborn.api.generator.EFluidGenerator;
import techreborn.blockentity.generator.BaseFluidGeneratorBlockEntity;
@ -36,7 +36,7 @@ import techreborn.config.TechRebornConfig;
import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
public class DieselGeneratorBlockEntity extends BaseFluidGeneratorBlockEntity implements IContainerProvider {
public class DieselGeneratorBlockEntity extends BaseFluidGeneratorBlockEntity implements BuiltScreenHandlerProvider {
public DieselGeneratorBlockEntity() {
super(TRBlockEntities.DIESEL_GENERATOR, EFluidGenerator.DIESEL, "DieselGeneratorBlockEntity", FluidValue.BUCKET.multiply(10), TechRebornConfig.dieselGeneratorEnergyPerTick);
@ -58,8 +58,8 @@ public class DieselGeneratorBlockEntity extends BaseFluidGeneratorBlockEntity im
}
@Override
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("dieselgenerator").player(player.inventory).inventory().hotbar()
public BuiltScreenHandler createScreenHandler(int syncID, final PlayerEntity player) {
return new ScreenHandlerBuilder("dieselgenerator").player(player.inventory).inventory().hotbar()
.addInventory().blockEntity(this).slot(0, 25, 35).outputSlot(1, 25, 55).syncEnergyValue()
.sync(this::getTicksSinceLastChange, this::setTicksSinceLastChange)
.sync(this::getTankAmount, this::setTankAmount)

View file

@ -26,9 +26,9 @@ package techreborn.blockentity.generator.advanced;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.fluid.FluidValue;
import techreborn.api.generator.EFluidGenerator;
import techreborn.blockentity.generator.BaseFluidGeneratorBlockEntity;
@ -36,7 +36,7 @@ import techreborn.config.TechRebornConfig;
import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
public class GasTurbineBlockEntity extends BaseFluidGeneratorBlockEntity implements IContainerProvider {
public class GasTurbineBlockEntity extends BaseFluidGeneratorBlockEntity implements BuiltScreenHandlerProvider {
public GasTurbineBlockEntity() {
super(TRBlockEntities.GAS_TURBINE, EFluidGenerator.GAS, "GasTurbineBlockEntity", FluidValue.BUCKET.multiply(10), TechRebornConfig.gasTurbineEnergyPerTick);
@ -58,8 +58,8 @@ public class GasTurbineBlockEntity extends BaseFluidGeneratorBlockEntity impleme
}
@Override
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("gasturbine").player(player.inventory).inventory().hotbar()
public BuiltScreenHandler createScreenHandler(int syncID, final PlayerEntity player) {
return new ScreenHandlerBuilder("gasturbine").player(player.inventory).inventory().hotbar()
.addInventory().blockEntity(this).slot(0, 25, 35).outputSlot(1, 25, 55).syncEnergyValue()
.sync(this::getTicksSinceLastChange, this::setTicksSinceLastChange)
.sync(this::getTankAmount, this::setTankAmount)

View file

@ -26,9 +26,9 @@ package techreborn.blockentity.generator.advanced;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.fluid.FluidValue;
import techreborn.api.generator.EFluidGenerator;
import techreborn.blockentity.generator.BaseFluidGeneratorBlockEntity;
@ -36,7 +36,7 @@ import techreborn.config.TechRebornConfig;
import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
public class SemiFluidGeneratorBlockEntity extends BaseFluidGeneratorBlockEntity implements IContainerProvider {
public class SemiFluidGeneratorBlockEntity extends BaseFluidGeneratorBlockEntity implements BuiltScreenHandlerProvider {
public SemiFluidGeneratorBlockEntity() {
super(TRBlockEntities.SEMI_FLUID_GENERATOR, EFluidGenerator.SEMIFLUID, "SemiFluidGeneratorBlockEntity", FluidValue.BUCKET.multiply(10), TechRebornConfig.semiFluidGeneratorEnergyPerTick);
@ -58,8 +58,8 @@ public class SemiFluidGeneratorBlockEntity extends BaseFluidGeneratorBlockEntity
}
@Override
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("semifluidgenerator").player(player.inventory).inventory().hotbar()
public BuiltScreenHandler createScreenHandler(int syncID, final PlayerEntity player) {
return new ScreenHandlerBuilder("semifluidgenerator").player(player.inventory).inventory().hotbar()
.addInventory().blockEntity(this).slot(0, 25, 35).outputSlot(1, 25, 55).syncEnergyValue()
.sync(this::getTicksSinceLastChange, this::setTicksSinceLastChange)
.sync(this::getTankAmount, this::setTankAmount)

View file

@ -26,9 +26,9 @@ package techreborn.blockentity.generator.advanced;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.fluid.FluidValue;
import techreborn.api.generator.EFluidGenerator;
import techreborn.blockentity.generator.BaseFluidGeneratorBlockEntity;
@ -36,7 +36,7 @@ import techreborn.config.TechRebornConfig;
import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
public class ThermalGeneratorBlockEntity extends BaseFluidGeneratorBlockEntity implements IContainerProvider {
public class ThermalGeneratorBlockEntity extends BaseFluidGeneratorBlockEntity implements BuiltScreenHandlerProvider {
public ThermalGeneratorBlockEntity() {
super(TRBlockEntities.THERMAL_GEN, EFluidGenerator.THERMAL, "ThermalGeneratorBlockEntity", FluidValue.BUCKET.multiply(10), TechRebornConfig.thermalGeneratorEnergyPerTick);
@ -58,8 +58,8 @@ public class ThermalGeneratorBlockEntity extends BaseFluidGeneratorBlockEntity i
}
@Override
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("thermalgenerator").player(player.inventory).inventory().hotbar()
public BuiltScreenHandler createScreenHandler(int syncID, final PlayerEntity player) {
return new ScreenHandlerBuilder("thermalgenerator").player(player.inventory).inventory().hotbar()
.addInventory().blockEntity(this).slot(0, 25, 35).outputSlot(1, 25, 55).syncEnergyValue()
.sync(this::getTicksSinceLastChange, this::setTicksSinceLastChange)
.sync(this::getTankAmount, this::setTankAmount)

View file

@ -34,9 +34,9 @@ import net.minecraft.item.Items;
import net.minecraft.util.math.Direction;
import reborncore.api.IToolDrop;
import reborncore.api.blockentity.InventoryProvider;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
import reborncore.common.util.RebornInventory;
@ -47,7 +47,7 @@ import techreborn.init.TRContent;
import javax.annotation.Nonnull;
import java.util.Map;
public class SolidFuelGeneratorBlockEntity extends PowerAcceptorBlockEntity implements IToolDrop, InventoryProvider, IContainerProvider {
public class SolidFuelGeneratorBlockEntity extends PowerAcceptorBlockEntity implements IToolDrop, InventoryProvider, BuiltScreenHandlerProvider {
public RebornInventory<SolidFuelGeneratorBlockEntity> inventory = new RebornInventory<>(2, "SolidFuelGeneratorBlockEntity", 64, this);
public int fuelSlot = 0;
@ -181,8 +181,8 @@ public class SolidFuelGeneratorBlockEntity extends PowerAcceptorBlockEntity impl
}
@Override
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("generator").player(player.inventory).inventory().hotbar().addInventory()
public BuiltScreenHandler createScreenHandler(int syncID, final PlayerEntity player) {
return new ScreenHandlerBuilder("generator").player(player.inventory).inventory().hotbar().addInventory()
.blockEntity(this).fuelSlot(0, 80, 54).energySlot(1, 8, 72).syncEnergyValue()
.sync(this::getBurnTime, this::setBurnTime)
.sync(this::getTotalBurnTime, this::setTotalBurnTime).addInventory().create(this, syncID);

View file

@ -26,9 +26,9 @@ package techreborn.blockentity.machine.iron;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.crafting.RebornRecipe;
import reborncore.common.crafting.ingredient.RebornIngredient;
import reborncore.common.util.RebornInventory;
@ -36,7 +36,7 @@ import techreborn.init.ModRecipes;
import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
public class IronAlloyFurnaceBlockEntity extends AbstractIronMachineBlockEntity implements IContainerProvider {
public class IronAlloyFurnaceBlockEntity extends AbstractIronMachineBlockEntity implements BuiltScreenHandlerProvider {
int input1 = 0;
int input2 = 1;
@ -125,8 +125,8 @@ public class IronAlloyFurnaceBlockEntity extends AbstractIronMachineBlockEntity
}
@Override
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("alloyfurnace").player(player.inventory).inventory().hotbar()
public BuiltScreenHandler createScreenHandler(int syncID, final PlayerEntity player) {
return new ScreenHandlerBuilder("alloyfurnace").player(player.inventory).inventory().hotbar()
.addInventory().blockEntity(this)
.slot(0, 47, 17)
.slot(1, 65, 17)

View file

@ -31,9 +31,9 @@ import net.minecraft.nbt.CompoundTag;
import net.minecraft.recipe.RecipeType;
import net.minecraft.recipe.SmeltingRecipe;
import net.minecraft.server.network.ServerPlayerEntity;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.util.RebornInventory;
import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
@ -41,7 +41,7 @@ import techreborn.utils.RecipeUtils;
import java.util.Optional;
public class IronFurnaceBlockEntity extends AbstractIronMachineBlockEntity implements IContainerProvider {
public class IronFurnaceBlockEntity extends AbstractIronMachineBlockEntity implements BuiltScreenHandlerProvider {
int inputSlot = 0;
int outputSlot = 1;
@ -152,8 +152,8 @@ public class IronFurnaceBlockEntity extends AbstractIronMachineBlockEntity imple
}
@Override
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("ironfurnace").player(player.inventory).inventory().hotbar()
public BuiltScreenHandler createScreenHandler(int syncID, final PlayerEntity player) {
return new ScreenHandlerBuilder("ironfurnace").player(player.inventory).inventory().hotbar()
.addInventory().blockEntity(this)
.fuelSlot(2, 56, 53).slot(0, 56, 17).outputSlot(1, 116, 35)
.sync(this::getBurnTime, this::setBurnTime)

View file

@ -29,9 +29,9 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.math.Direction;
import reborncore.api.IToolDrop;
import reborncore.api.blockentity.InventoryProvider;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
import reborncore.common.util.RebornInventory;
import team.reborn.energy.Energy;
@ -40,7 +40,7 @@ import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
public class ChargeOMatBlockEntity extends PowerAcceptorBlockEntity
implements IToolDrop, InventoryProvider, IContainerProvider {
implements IToolDrop, InventoryProvider, BuiltScreenHandlerProvider {
public RebornInventory<ChargeOMatBlockEntity> inventory = new RebornInventory<>(6, "ChargeOMatBlockEntity", 64, this);
@ -115,8 +115,8 @@ public class ChargeOMatBlockEntity extends PowerAcceptorBlockEntity
// IContainerProvider
@Override
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("chargebench").player(player.inventory).inventory().hotbar().addInventory()
public BuiltScreenHandler createScreenHandler(int syncID, final PlayerEntity player) {
return new ScreenHandlerBuilder("chargebench").player(player.inventory).inventory().hotbar().addInventory()
.blockEntity(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(this, syncID);
}

View file

@ -5,12 +5,12 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.Inventory;
import reborncore.api.IListInfoProvider;
import reborncore.api.blockentity.InventoryProvider;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.common.blockentity.MachineBaseBlockEntity;
import techreborn.init.TRBlockEntities;
public class DrainBlockEntity extends MachineBaseBlockEntity implements InventoryProvider, IListInfoProvider, IContainerProvider {
public class DrainBlockEntity extends MachineBaseBlockEntity implements InventoryProvider, IListInfoProvider, BuiltScreenHandlerProvider {
public DrainBlockEntity(){
this(TRBlockEntities.DRAIN);
@ -26,7 +26,7 @@ public class DrainBlockEntity extends MachineBaseBlockEntity implements Inventor
}
@Override
public BuiltContainer createContainer(int syncID, PlayerEntity player) {
public BuiltScreenHandler createScreenHandler(int syncID, PlayerEntity player) {
return null;
}
}

View file

@ -27,9 +27,9 @@ package techreborn.blockentity.machine.multiblock;
import net.minecraft.block.Material;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.BlockPos;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.crafting.RebornRecipe;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.util.RebornInventory;
@ -39,7 +39,7 @@ import techreborn.init.ModRecipes;
import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
public class DistillationTowerBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
public class DistillationTowerBlockEntity extends GenericMachineBlockEntity implements BuiltScreenHandlerProvider {
public MultiblockChecker multiblockChecker;
@ -79,8 +79,8 @@ public class DistillationTowerBlockEntity extends GenericMachineBlockEntity impl
// IContainerProvider
@Override
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("Distillationtower").player(player.inventory).inventory().hotbar().addInventory()
public BuiltScreenHandler createScreenHandler(int syncID, final PlayerEntity player) {
return new ScreenHandlerBuilder("Distillationtower").player(player.inventory).inventory().hotbar().addInventory()
.blockEntity(this).slot(0, 35, 27).slot(1, 35, 47).outputSlot(2, 79, 37).outputSlot(3, 99, 37)
.outputSlot(4, 119, 37).outputSlot(5, 139, 37).energySlot(6, 8, 72).syncEnergyValue().syncCrafterValue()
.addInventory().create(this, syncID);

View file

@ -27,9 +27,9 @@ package techreborn.blockentity.machine.multiblock;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.util.math.BlockPos;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.fluid.FluidValue;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.util.IInventoryAccess;
@ -48,7 +48,7 @@ import javax.annotation.Nullable;
* @author drcrazy
*
*/
public class FluidReplicatorBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
public class FluidReplicatorBlockEntity extends GenericMachineBlockEntity implements BuiltScreenHandlerProvider {
public MultiblockChecker multiblockChecker;
public static final FluidValue TANK_CAPACITY = FluidValue.BUCKET.multiply(16);
@ -129,8 +129,8 @@ public class FluidReplicatorBlockEntity extends GenericMachineBlockEntity implem
// IContainerProvider
@Override
public BuiltContainer createContainer(int syncID, PlayerEntity player) {
return new ContainerBuilder("fluidreplicator").player(player.inventory).inventory().hotbar().addInventory()
public BuiltScreenHandler createScreenHandler(int syncID, PlayerEntity player) {
return new ScreenHandlerBuilder("fluidreplicator").player(player.inventory).inventory().hotbar().addInventory()
.blockEntity(this).fluidSlot(1, 124, 35).filterSlot(0, 55, 45, stack -> stack.isItemEqualIgnoreDamage(TRContent.Parts.UU_MATTER.getStack()))
.outputSlot(2, 124, 55).energySlot(3, 8, 72).sync(tank).syncEnergyValue().syncCrafterValue().addInventory()
.create(this, syncID);

View file

@ -32,9 +32,9 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import reborncore.api.IToolDrop;
import reborncore.api.blockentity.InventoryProvider;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.crafting.RebornRecipe;
import reborncore.common.crafting.ingredient.RebornIngredient;
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
@ -50,7 +50,7 @@ import techreborn.init.TRContent;
import java.util.List;
public class FusionControlComputerBlockEntity extends PowerAcceptorBlockEntity
implements IToolDrop, InventoryProvider, IContainerProvider {
implements IToolDrop, InventoryProvider, BuiltScreenHandlerProvider {
public RebornInventory<FusionControlComputerBlockEntity> inventory;
@ -397,8 +397,8 @@ public class FusionControlComputerBlockEntity extends PowerAcceptorBlockEntity
// IContainerProvider
@Override
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("fusionreactor").player(player.inventory).inventory().hotbar()
public BuiltScreenHandler createScreenHandler(int syncID, final PlayerEntity player) {
return new ScreenHandlerBuilder("fusionreactor").player(player.inventory).inventory().hotbar()
.addInventory().blockEntity(this).slot(0, 34, 47).slot(1, 126, 47).outputSlot(2, 80, 47).syncEnergyValue()
.sync(this::getCoilStatus, this::setCoilStatus)
.sync(this::getCrafingTickTime, this::setCrafingTickTime)

View file

@ -26,9 +26,9 @@ package techreborn.blockentity.machine.multiblock;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.BlockPos;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.crafting.RebornRecipe;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.util.RebornInventory;
@ -38,7 +38,7 @@ import techreborn.init.ModRecipes;
import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
public class ImplosionCompressorBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
public class ImplosionCompressorBlockEntity extends GenericMachineBlockEntity implements BuiltScreenHandlerProvider {
public MultiblockChecker multiblockChecker;
@ -72,8 +72,8 @@ public class ImplosionCompressorBlockEntity extends GenericMachineBlockEntity im
// IContainerProvider
@Override
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("implosioncompressor").player(player.inventory).inventory().hotbar().addInventory()
public BuiltScreenHandler createScreenHandler(int syncID, final PlayerEntity player) {
return new ScreenHandlerBuilder("implosioncompressor").player(player.inventory).inventory().hotbar().addInventory()
.blockEntity(this).slot(0, 50, 27).slot(1, 50, 47).outputSlot(2, 92, 36).outputSlot(3, 110, 36)
.energySlot(4, 8, 72).syncEnergyValue().syncCrafterValue().addInventory().create(this, syncID);
}

View file

@ -29,9 +29,9 @@ import net.minecraft.block.entity.BlockEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.multiblock.IMultiblockPart;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.util.RebornInventory;
@ -44,7 +44,7 @@ import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
import techreborn.multiblocks.MultiBlockCasing;
public class IndustrialBlastFurnaceBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
public class IndustrialBlastFurnaceBlockEntity extends GenericMachineBlockEntity implements BuiltScreenHandlerProvider {
public MultiblockChecker multiblockChecker;
private int cachedHeat;
@ -129,8 +129,8 @@ public class IndustrialBlastFurnaceBlockEntity extends GenericMachineBlockEntity
// IContainerProvider
@Override
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("blastfurnace").player(player.inventory).inventory().hotbar().addInventory()
public BuiltScreenHandler createScreenHandler(int syncID, final PlayerEntity player) {
return new ScreenHandlerBuilder("blastfurnace").player(player.inventory).inventory().hotbar().addInventory()
.blockEntity(this).slot(0, 50, 27).slot(1, 50, 47).outputSlot(2, 93, 37).outputSlot(3, 113, 37)
.energySlot(4, 8, 72).syncEnergyValue().syncCrafterValue()
.sync(this::getHeat, this::setHeat).addInventory().create(this, syncID);

View file

@ -31,9 +31,9 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.fluid.FluidValue;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.util.RebornInventory;
@ -47,7 +47,7 @@ import techreborn.utils.FluidUtils;
import javax.annotation.Nullable;
public class IndustrialGrinderBlockEntity extends GenericMachineBlockEntity implements IContainerProvider{
public class IndustrialGrinderBlockEntity extends GenericMachineBlockEntity implements BuiltScreenHandlerProvider {
public static final FluidValue TANK_CAPACITY = FluidValue.BUCKET.multiply(16);
public Tank tank;
@ -121,9 +121,9 @@ public class IndustrialGrinderBlockEntity extends GenericMachineBlockEntity impl
// IContainerProvider
@Override
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
public BuiltScreenHandler createScreenHandler(int syncID, final PlayerEntity player) {
// fluidSlot first to support automation and shift-click
return new ContainerBuilder("industrialgrinder").player(player.inventory).inventory().hotbar().addInventory()
return new ScreenHandlerBuilder("industrialgrinder").player(player.inventory).inventory().hotbar().addInventory()
.blockEntity(this).fluidSlot(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).energySlot(7, 8, 72)
.sync(tank).syncEnergyValue().syncCrafterValue().addInventory().create(this, syncID);

View file

@ -31,9 +31,9 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.fluid.FluidValue;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.util.RebornInventory;
@ -47,7 +47,7 @@ import techreborn.utils.FluidUtils;
import javax.annotation.Nullable;
public class IndustrialSawmillBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
public class IndustrialSawmillBlockEntity extends GenericMachineBlockEntity implements BuiltScreenHandlerProvider {
public static final FluidValue TANK_CAPACITY = FluidValue.BUCKET.multiply(16);
public Tank tank;
@ -123,8 +123,8 @@ public class IndustrialSawmillBlockEntity extends GenericMachineBlockEntity impl
// IContainerProvider
@Override
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("industrialsawmill").player(player.inventory).inventory().hotbar().addInventory()
public BuiltScreenHandler createScreenHandler(int syncID, final PlayerEntity player) {
return new ScreenHandlerBuilder("industrialsawmill").player(player.inventory).inventory().hotbar().addInventory()
.blockEntity(this).fluidSlot(1, 34, 35).slot(0, 84, 43).outputSlot(2, 126, 25).outputSlot(3, 126, 43)
.outputSlot(4, 126, 61).outputSlot(5, 34, 55).energySlot(6, 8, 72).sync(tank).syncEnergyValue().syncCrafterValue()
.addInventory().create(this, syncID);

View file

@ -27,9 +27,9 @@ package techreborn.blockentity.machine.multiblock;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.util.RebornInventory;
import techreborn.blockentity.machine.GenericMachineBlockEntity;
@ -38,7 +38,7 @@ import techreborn.init.ModRecipes;
import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
public class VacuumFreezerBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
public class VacuumFreezerBlockEntity extends GenericMachineBlockEntity implements BuiltScreenHandlerProvider {
public MultiblockChecker multiblockChecker;
@ -69,8 +69,8 @@ public class VacuumFreezerBlockEntity extends GenericMachineBlockEntity implemen
// IContainerProvider
@Override
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("vacuumfreezer").player(player.inventory).inventory().hotbar().addInventory()
public BuiltScreenHandler createScreenHandler(int syncID, final PlayerEntity player) {
return new ScreenHandlerBuilder("vacuumfreezer").player(player.inventory).inventory().hotbar().addInventory()
.blockEntity(this).slot(0, 55, 45).outputSlot(1, 101, 45).energySlot(2, 8, 72).syncEnergyValue()
.syncCrafterValue().addInventory().create(this, syncID);
}

View file

@ -25,9 +25,9 @@
package techreborn.blockentity.machine.tier1;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.util.RebornInventory;
import techreborn.blockentity.machine.GenericMachineBlockEntity;
@ -36,7 +36,7 @@ import techreborn.init.ModRecipes;
import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
public class AlloySmelterBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
public class AlloySmelterBlockEntity extends GenericMachineBlockEntity implements BuiltScreenHandlerProvider {
public AlloySmelterBlockEntity() {
super(TRBlockEntities.ALLOY_SMELTER, "AlloySmelter", TechRebornConfig.alloySmelterMaxInput, TechRebornConfig.alloySmelterMaxEnergy, TRContent.Machine.ALLOY_SMELTER.block, 3);
@ -48,8 +48,8 @@ public class AlloySmelterBlockEntity extends GenericMachineBlockEntity implement
// IContainerProvider
@Override
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("alloysmelter").player(player.inventory).inventory().hotbar()
public BuiltScreenHandler createScreenHandler(int syncID, final PlayerEntity player) {
return new ScreenHandlerBuilder("alloysmelter").player(player.inventory).inventory().hotbar()
.addInventory().blockEntity(this)
.slot(0, 34, 47)
.slot(1, 126, 47)

View file

@ -25,9 +25,9 @@
package techreborn.blockentity.machine.tier1;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.util.RebornInventory;
import techreborn.blockentity.machine.GenericMachineBlockEntity;
@ -36,7 +36,7 @@ import techreborn.init.ModRecipes;
import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
public class AssemblingMachineBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
public class AssemblingMachineBlockEntity extends GenericMachineBlockEntity implements BuiltScreenHandlerProvider {
public AssemblingMachineBlockEntity() {
super(TRBlockEntities.ASSEMBLY_MACHINE, "AssemblingMachine", TechRebornConfig.assemblingMachineMaxInput, TechRebornConfig.assemblingMachineMaxEnergy, TRContent.Machine.ASSEMBLY_MACHINE.block, 3);
@ -48,8 +48,8 @@ public class AssemblingMachineBlockEntity extends GenericMachineBlockEntity impl
// IContainerProvider
@Override
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("assemblingmachine").player(player.inventory).inventory().hotbar()
public BuiltScreenHandler createScreenHandler(int syncID, final PlayerEntity player) {
return new ScreenHandlerBuilder("assemblingmachine").player(player.inventory).inventory().hotbar()
.addInventory().blockEntity(this).slot(0, 55, 35).slot(1, 55, 55).outputSlot(2, 101, 45).energySlot(3, 8, 72)
.syncEnergyValue().syncCrafterValue().addInventory().create(this, syncID);
}

View file

@ -30,7 +30,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.recipe.CraftingRecipe;
import net.minecraft.recipe.Ingredient;
import net.minecraft.recipe.Recipe;
import net.minecraft.recipe.RecipeType;
import net.minecraft.screen.ScreenHandler;
import net.minecraft.sound.SoundCategory;
@ -39,12 +38,11 @@ import net.minecraft.util.math.Direction;
import org.apache.commons.lang3.tuple.Pair;
import reborncore.api.IToolDrop;
import reborncore.api.blockentity.InventoryProvider;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
import reborncore.common.recipes.ExtendedRecipeRemainder;
import reborncore.common.util.IInventoryAccess;
import reborncore.common.util.ItemUtils;
import reborncore.common.util.RebornInventory;
import techreborn.config.TechRebornConfig;
@ -63,7 +61,7 @@ import java.util.stream.Collectors;
* Created by modmuss50 on 20/06/2017.
*/
public class AutoCraftingTableBlockEntity extends PowerAcceptorBlockEntity
implements IToolDrop, InventoryProvider, IContainerProvider {
implements IToolDrop, InventoryProvider, BuiltScreenHandlerProvider {
public RebornInventory<AutoCraftingTableBlockEntity> inventory = new RebornInventory<>(11, "AutoCraftingTableBlockEntity", 64, this);
public int progress;
@ -466,8 +464,8 @@ public class AutoCraftingTableBlockEntity extends PowerAcceptorBlockEntity
// IContainerProvider
@Override
public BuiltContainer createContainer(int syncID, PlayerEntity player) {
return new ContainerBuilder("autocraftingtable").player(player.inventory).inventory().hotbar().addInventory()
public BuiltScreenHandler createScreenHandler(int syncID, PlayerEntity player) {
return new ScreenHandlerBuilder("autocraftingtable").player(player.inventory).inventory().hotbar().addInventory()
.blockEntity(this).slot(0, 28, 25).slot(1, 46, 25).slot(2, 64, 25).slot(3, 28, 43).slot(4, 46, 43)
.slot(5, 64, 43).slot(6, 28, 61).slot(7, 46, 61).slot(8, 64, 61).outputSlot(9, 145, 42)
.outputSlot(10, 145, 70).syncEnergyValue().sync(this::getProgress, this::setProgress)

View file

@ -25,9 +25,9 @@
package techreborn.blockentity.machine.tier1;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.util.RebornInventory;
import techreborn.config.TechRebornConfig;
@ -36,7 +36,7 @@ import techreborn.init.TRContent;
import techreborn.init.TRBlockEntities;
import techreborn.blockentity.machine.GenericMachineBlockEntity;
public class ChemicalReactorBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
public class ChemicalReactorBlockEntity extends GenericMachineBlockEntity implements BuiltScreenHandlerProvider {
public ChemicalReactorBlockEntity() {
super(TRBlockEntities.CHEMICAL_REACTOR, "ChemicalReactor", TechRebornConfig.chemicalReactorMaxInput, TechRebornConfig.chemicalReactorMaxEnergy, TRContent.Machine.CHEMICAL_REACTOR.block, 3);
@ -48,8 +48,8 @@ public class ChemicalReactorBlockEntity extends GenericMachineBlockEntity implem
// IContainerProvider
@Override
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("chemicalreactor").player(player.inventory).inventory().hotbar()
public BuiltScreenHandler createScreenHandler(int syncID, final PlayerEntity player) {
return new ScreenHandlerBuilder("chemicalreactor").player(player.inventory).inventory().hotbar()
.addInventory().blockEntity(this).slot(0, 34, 47).slot(1, 126, 47).outputSlot(2, 80, 47).energySlot(3, 8, 72)
.syncEnergyValue().syncCrafterValue().addInventory().create(this, syncID);
}

View file

@ -25,9 +25,9 @@
package techreborn.blockentity.machine.tier1;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.util.RebornInventory;
import techreborn.blockentity.machine.GenericMachineBlockEntity;
@ -36,7 +36,7 @@ import techreborn.init.ModRecipes;
import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
public class CompressorBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
public class CompressorBlockEntity extends GenericMachineBlockEntity implements BuiltScreenHandlerProvider {
public CompressorBlockEntity() {
super(TRBlockEntities.COMPRESSOR, "Compressor", TechRebornConfig.compressorMaxInput, TechRebornConfig.compressorMaxEnergy, TRContent.Machine.COMPRESSOR.block, 2);
@ -48,8 +48,8 @@ public class CompressorBlockEntity extends GenericMachineBlockEntity implements
// IContainerProvider
@Override
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("compressor").player(player.inventory).inventory().hotbar().addInventory()
public BuiltScreenHandler createScreenHandler(int syncID, final PlayerEntity player) {
return new ScreenHandlerBuilder("compressor").player(player.inventory).inventory().hotbar().addInventory()
.blockEntity(this).slot(0, 55, 45).outputSlot(1, 101, 45).energySlot(2, 8, 72).syncEnergyValue()
.syncCrafterValue().addInventory().create(this, syncID);
}

View file

@ -32,9 +32,9 @@ import net.minecraft.recipe.SmeltingRecipe;
import net.minecraft.util.math.Direction;
import reborncore.api.IToolDrop;
import reborncore.api.blockentity.InventoryProvider;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
import reborncore.common.recipes.RecipeCrafter;
@ -47,7 +47,7 @@ import techreborn.init.TRContent;
import java.util.Optional;
public class ElectricFurnaceBlockEntity extends PowerAcceptorBlockEntity
implements IToolDrop, InventoryProvider, IContainerProvider {
implements IToolDrop, InventoryProvider, BuiltScreenHandlerProvider {
public RebornInventory<ElectricFurnaceBlockEntity> inventory = new RebornInventory<>(3, "ElectricFurnaceBlockEntity", 64, this);
int inputSlot = 0;
@ -269,8 +269,8 @@ public class ElectricFurnaceBlockEntity extends PowerAcceptorBlockEntity
// IContainerProvider
@Override
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("electricfurnace").player(player.inventory).inventory().hotbar().addInventory()
public BuiltScreenHandler createScreenHandler(int syncID, final PlayerEntity player) {
return new ScreenHandlerBuilder("electricfurnace").player(player.inventory).inventory().hotbar().addInventory()
.blockEntity(this).slot(0, 55, 45).outputSlot(1, 101, 45).energySlot(2, 8, 72).syncEnergyValue()
.sync(this::getCookTime, this::setCookTime).sync(this::getCookTimeTotal, this::setCookTimeTotal).addInventory().create(this, syncID);
}

View file

@ -25,9 +25,9 @@
package techreborn.blockentity.machine.tier1;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.util.RebornInventory;
import techreborn.blockentity.machine.GenericMachineBlockEntity;
@ -36,7 +36,7 @@ import techreborn.init.ModRecipes;
import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
public class ExtractorBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
public class ExtractorBlockEntity extends GenericMachineBlockEntity implements BuiltScreenHandlerProvider {
public ExtractorBlockEntity() {
super(TRBlockEntities.EXTRACTOR, "Extractor", TechRebornConfig.extractorMaxInput, TechRebornConfig.extractorMaxEnergy, TRContent.Machine.EXTRACTOR.block, 2);
@ -48,8 +48,8 @@ public class ExtractorBlockEntity extends GenericMachineBlockEntity implements I
// IContainerProvider
@Override
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("extractor").player(player.inventory).inventory().hotbar().addInventory().blockEntity(this)
public BuiltScreenHandler createScreenHandler(int syncID, final PlayerEntity player) {
return new ScreenHandlerBuilder("extractor").player(player.inventory).inventory().hotbar().addInventory().blockEntity(this)
.slot(0, 55, 45).outputSlot(1, 101, 45).energySlot(2, 8, 72).syncEnergyValue().syncCrafterValue()
.addInventory().create(this, syncID);
}

View file

@ -33,9 +33,9 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import reborncore.api.IToolDrop;
import reborncore.api.blockentity.InventoryProvider;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
import reborncore.common.util.ItemUtils;
import reborncore.common.util.RebornInventory;
@ -49,7 +49,7 @@ import java.util.Collections;
import java.util.List;
public class GreenhouseControllerBlockEntity extends PowerAcceptorBlockEntity
implements IToolDrop, InventoryProvider, IContainerProvider {
implements IToolDrop, InventoryProvider, BuiltScreenHandlerProvider {
private final RebornInventory<GreenhouseControllerBlockEntity> inventory = new RebornInventory<>(7, "GreenhouseControllerBlockEntity", 64, this);
private BlockPos multiblockCenter;
@ -252,8 +252,8 @@ public class GreenhouseControllerBlockEntity extends PowerAcceptorBlockEntity
}
@Override
public BuiltContainer createContainer(int syncID, PlayerEntity player) {
return new ContainerBuilder("greenhousecontroller").player(player.inventory).inventory().hotbar().addInventory()
public BuiltScreenHandler createScreenHandler(int syncID, PlayerEntity player) {
return new ScreenHandlerBuilder("greenhousecontroller").player(player.inventory).inventory().hotbar().addInventory()
.blockEntity(this)
.outputSlot(0, 30, 22).outputSlot(1, 48, 22)
.outputSlot(2, 30, 40).outputSlot(3, 48, 40)

View file

@ -25,9 +25,9 @@
package techreborn.blockentity.machine.tier1;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.util.RebornInventory;
import reborncore.common.util.ItemUtils;
@ -38,7 +38,7 @@ import techreborn.init.TRBlockEntities;
import techreborn.items.DynamicCellItem;
import techreborn.blockentity.machine.GenericMachineBlockEntity;
public class IndustrialElectrolyzerBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
public class IndustrialElectrolyzerBlockEntity extends GenericMachineBlockEntity implements BuiltScreenHandlerProvider {
public IndustrialElectrolyzerBlockEntity() {
super(TRBlockEntities.INDUSTRIAL_ELECTROLYZER, "IndustrialElectrolyzer", TechRebornConfig.industrialElectrolyzerMaxInput, TechRebornConfig.industrialElectrolyzerMaxEnergy, TRContent.Machine.INDUSTRIAL_ELECTROLYZER.block, 6);
@ -50,8 +50,8 @@ public class IndustrialElectrolyzerBlockEntity extends GenericMachineBlockEntity
// IContainerProvider
@Override
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("industrialelectrolyzer").player(player.inventory).inventory().hotbar()
public BuiltScreenHandler createScreenHandler(int syncID, final PlayerEntity player) {
return new ScreenHandlerBuilder("industrialelectrolyzer").player(player.inventory).inventory().hotbar()
.addInventory().blockEntity(this)
.filterSlot(1, 47, 72, stack -> ItemUtils.isItemEqual(stack, DynamicCellItem.getEmptyCell(1), true, true))
.filterSlot(0, 81, 72, stack -> !ItemUtils.isItemEqual(stack, DynamicCellItem.getEmptyCell(1), true, true))

View file

@ -33,9 +33,9 @@ import net.minecraft.util.registry.Registry;
import reborncore.api.IToolDrop;
import reborncore.api.blockentity.IUpgrade;
import reborncore.api.blockentity.InventoryProvider;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.blockentity.SlotConfiguration;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
@ -45,7 +45,7 @@ import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
public class RecyclerBlockEntity extends PowerAcceptorBlockEntity
implements IToolDrop, InventoryProvider, IContainerProvider, SlotConfiguration.SlotFilter {
implements IToolDrop, InventoryProvider, BuiltScreenHandlerProvider, SlotConfiguration.SlotFilter {
private final RebornInventory<RecyclerBlockEntity> inventory = new RebornInventory<>(3, "RecyclerBlockEntity", 64, this);
private final int cost = 2;
@ -216,8 +216,8 @@ public class RecyclerBlockEntity extends PowerAcceptorBlockEntity
// IContainerProvider
@Override
public BuiltContainer createContainer(int syncID, PlayerEntity player) {
return new ContainerBuilder("recycler").player(player.inventory).inventory().hotbar().addInventory()
public BuiltScreenHandler createScreenHandler(int syncID, PlayerEntity player) {
return new ScreenHandlerBuilder("recycler").player(player.inventory).inventory().hotbar().addInventory()
.blockEntity(this).slot(0, 55, 45, RecyclerBlockEntity::canRecycle)
.outputSlot(1, 101, 45).energySlot(2, 8, 72).syncEnergyValue()
.sync(this::getProgress, this::setProgress).addInventory().create(this, syncID);

View file

@ -35,9 +35,9 @@ import net.minecraft.world.World;
import org.apache.commons.lang3.tuple.Pair;
import reborncore.api.IToolDrop;
import reborncore.api.blockentity.InventoryProvider;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
import reborncore.common.util.ItemUtils;
@ -58,7 +58,7 @@ import java.util.stream.Collectors;
//TODO add tick and power bars.
public class RollingMachineBlockEntity extends PowerAcceptorBlockEntity
implements IToolDrop, InventoryProvider, IContainerProvider {
implements IToolDrop, InventoryProvider, BuiltScreenHandlerProvider {
public int[] craftingSlots = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8 };
private CraftingInventory craftCache;
@ -385,8 +385,8 @@ public class RollingMachineBlockEntity extends PowerAcceptorBlockEntity
}
@Override
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("rollingmachine").player(player.inventory)
public BuiltScreenHandler createScreenHandler(int syncID, final PlayerEntity player) {
return new ScreenHandlerBuilder("rollingmachine").player(player.inventory)
.inventory().hotbar()
.addInventory().blockEntity(this)
.slot(0, 30, 22).slot(1, 48, 22).slot(2, 66, 22)

View file

@ -25,9 +25,9 @@
package techreborn.blockentity.machine.tier1;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.util.RebornInventory;
import techreborn.api.recipe.ScrapboxRecipeCrafter;
import techreborn.config.TechRebornConfig;
@ -35,7 +35,7 @@ import techreborn.init.TRContent;
import techreborn.init.TRBlockEntities;
import techreborn.blockentity.machine.GenericMachineBlockEntity;
public class ScrapboxinatorBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
public class ScrapboxinatorBlockEntity extends GenericMachineBlockEntity implements BuiltScreenHandlerProvider {
public ScrapboxinatorBlockEntity() {
super(TRBlockEntities.SCRAPBOXINATOR, "Scrapboxinator", TechRebornConfig.scrapboxinatorMaxInput, TechRebornConfig.scrapboxinatorMaxEnergy, TRContent.Machine.SCRAPBOXINATOR.block, 2);
@ -53,8 +53,8 @@ public class ScrapboxinatorBlockEntity extends GenericMachineBlockEntity impleme
// IContainerProvider
@Override
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("scrapboxinator").player(player.inventory).inventory().hotbar().addInventory()
public BuiltScreenHandler createScreenHandler(int syncID, final PlayerEntity player) {
return new ScreenHandlerBuilder("scrapboxinator").player(player.inventory).inventory().hotbar().addInventory()
.blockEntity(this).filterSlot(0, 55, 45, stack -> stack.getItem() == TRContent.SCRAP_BOX).outputSlot(1, 101, 45)
.energySlot(2, 8, 72).syncEnergyValue().syncCrafterValue().addInventory().create(this, syncID);
}

View file

@ -25,9 +25,9 @@
package techreborn.blockentity.machine.tier1;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.util.RebornInventory;
import techreborn.blockentity.machine.GenericMachineBlockEntity;
@ -36,7 +36,7 @@ import techreborn.init.ModRecipes;
import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
public class SoildCanningMachineBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
public class SoildCanningMachineBlockEntity extends GenericMachineBlockEntity implements BuiltScreenHandlerProvider {
public SoildCanningMachineBlockEntity() {
super(TRBlockEntities.SOLID_CANNING_MACHINE, "SolidCanningMachine", TechRebornConfig.solidCanningMachineMaxInput, TechRebornConfig.solidFuelGeneratorMaxEnergy, TRContent.Machine.SOLID_CANNING_MACHINE.block, 3);
@ -48,8 +48,8 @@ public class SoildCanningMachineBlockEntity extends GenericMachineBlockEntity im
// IContainerProvider
@Override
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("solidcanningmachine").player(player.inventory).inventory().hotbar()
public BuiltScreenHandler createScreenHandler(int syncID, final PlayerEntity player) {
return new ScreenHandlerBuilder("solidcanningmachine").player(player.inventory).inventory().hotbar()
.addInventory().blockEntity(this)
.slot(0, 34, 47)
.slot(1, 126, 47)

View file

@ -25,9 +25,9 @@
package techreborn.blockentity.machine.tier1;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.util.RebornInventory;
import techreborn.blockentity.machine.GenericMachineBlockEntity;
@ -35,7 +35,7 @@ import techreborn.init.ModRecipes;
import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
public class WireMillBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
public class WireMillBlockEntity extends GenericMachineBlockEntity implements BuiltScreenHandlerProvider {
public WireMillBlockEntity() {
super(TRBlockEntities.WIRE_MILL, "WireMill", 32, 1000, TRContent.Machine.WIRE_MILL.block, 2);
@ -47,8 +47,8 @@ public class WireMillBlockEntity extends GenericMachineBlockEntity implements IC
// IContainerProvider
@Override
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("wiremill").player(player.inventory).inventory().hotbar()
public BuiltScreenHandler createScreenHandler(int syncID, final PlayerEntity player) {
return new ScreenHandlerBuilder("wiremill").player(player.inventory).inventory().hotbar()
.addInventory().blockEntity(this)
.slot(0, 55, 45)
.outputSlot(1, 101, 45)

View file

@ -36,9 +36,9 @@ import net.minecraft.world.World;
import org.apache.commons.lang3.StringUtils;
import reborncore.api.IToolDrop;
import reborncore.api.blockentity.InventoryProvider;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.blockentity.MachineBaseBlockEntity;
import reborncore.common.chunkloading.ChunkLoaderManager;
import reborncore.common.util.RebornInventory;
@ -48,7 +48,7 @@ import techreborn.init.TRContent;
import javax.annotation.Nullable;
public class ChunkLoaderBlockEntity extends MachineBaseBlockEntity implements IToolDrop, InventoryProvider, IContainerProvider {
public class ChunkLoaderBlockEntity extends MachineBaseBlockEntity implements IToolDrop, InventoryProvider, BuiltScreenHandlerProvider {
public RebornInventory<ChunkLoaderBlockEntity> inventory = new RebornInventory<>(0, "ChunkLoaderBlockEntity", 64, this);
private int radius;
@ -164,8 +164,8 @@ public class ChunkLoaderBlockEntity extends MachineBaseBlockEntity implements IT
}
@Override
public BuiltContainer createContainer(int syncID, PlayerEntity player) {
return new ContainerBuilder("chunkloader").player(player.inventory).inventory().hotbar().addInventory()
public BuiltScreenHandler createScreenHandler(int syncID, PlayerEntity player) {
return new ScreenHandlerBuilder("chunkloader").player(player.inventory).inventory().hotbar().addInventory()
.blockEntity(this).sync(this::getRadius, this::setRadius).addInventory().create(this, syncID);
}

View file

@ -29,9 +29,9 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.text.LiteralText;
import net.minecraft.text.Text;
import reborncore.api.IListInfoProvider;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.util.RebornInventory;
import reborncore.common.util.ItemUtils;
@ -44,7 +44,7 @@ import techreborn.items.DynamicCellItem;
import java.util.List;
public class IndustrialCentrifugeBlockEntity extends GenericMachineBlockEntity implements IContainerProvider, IListInfoProvider {
public class IndustrialCentrifugeBlockEntity extends GenericMachineBlockEntity implements BuiltScreenHandlerProvider, IListInfoProvider {
public IndustrialCentrifugeBlockEntity() {
super(TRBlockEntities.INDUSTRIAL_CENTRIFUGE, "IndustrialCentrifuge", TechRebornConfig.industrialCentrifugeMaxInput, TechRebornConfig.industrialCentrifugeMaxEnergy, TRContent.Machine.INDUSTRIAL_CENTRIFUGE.block, 6);
@ -56,8 +56,8 @@ public class IndustrialCentrifugeBlockEntity extends GenericMachineBlockEntity i
// IContainerProvider
@Override
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("centrifuge").player(player.inventory).inventory().hotbar()
public BuiltScreenHandler createScreenHandler(int syncID, final PlayerEntity player) {
return new ScreenHandlerBuilder("centrifuge").player(player.inventory).inventory().hotbar()
.addInventory().blockEntity(this)
.filterSlot(1, 40, 54, stack -> ItemUtils.isItemEqual(stack, DynamicCellItem.getEmptyCell(1), true, true))
.filterSlot(0, 40, 34, stack -> !ItemUtils.isItemEqual(stack, DynamicCellItem.getEmptyCell(1), true, true))

View file

@ -29,9 +29,9 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.math.Direction;
import reborncore.api.IToolDrop;
import reborncore.api.blockentity.InventoryProvider;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
import reborncore.common.util.ItemUtils;
import reborncore.common.util.RebornInventory;
@ -40,7 +40,7 @@ import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
public class MatterFabricatorBlockEntity extends PowerAcceptorBlockEntity
implements IToolDrop, InventoryProvider, IContainerProvider {
implements IToolDrop, InventoryProvider, BuiltScreenHandlerProvider {
public RebornInventory<MatterFabricatorBlockEntity> inventory = new RebornInventory<>(12, "MatterFabricatorBlockEntity", 64, this);
private int amplifier = 0;
@ -196,8 +196,8 @@ public class MatterFabricatorBlockEntity extends PowerAcceptorBlockEntity
// IContainerProvider
@Override
public BuiltContainer createContainer(int syncID, PlayerEntity player) {
return new ContainerBuilder("matterfabricator").player(player.inventory).inventory().hotbar().addInventory()
public BuiltScreenHandler createScreenHandler(int syncID, PlayerEntity player) {
return new ScreenHandlerBuilder("matterfabricator").player(player.inventory).inventory().hotbar().addInventory()
.blockEntity(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).energySlot(11, 8, 72).syncEnergyValue()

View file

@ -28,9 +28,9 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundTag;
import reborncore.api.blockentity.IUpgrade;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.util.RebornInventory;
import team.reborn.energy.EnergySide;
import team.reborn.energy.EnergyTier;
@ -38,7 +38,7 @@ import techreborn.config.TechRebornConfig;
import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
public class AdjustableSUBlockEntity extends EnergyStorageBlockEntity implements IContainerProvider {
public class AdjustableSUBlockEntity extends EnergyStorageBlockEntity implements BuiltScreenHandlerProvider {
public RebornInventory<AdjustableSUBlockEntity> inventory = new RebornInventory<>(4, "AdjustableSUBlockEntity", 64, this);
private int OUTPUT = 64; // The current output
@ -156,8 +156,8 @@ public class AdjustableSUBlockEntity extends EnergyStorageBlockEntity implements
// IContainerProvider
@Override
public BuiltContainer createContainer(int syncID, PlayerEntity player) {
return new ContainerBuilder("aesu").player(player.inventory).inventory().hotbar().armor()
public BuiltScreenHandler createScreenHandler(int syncID, PlayerEntity player) {
return new ScreenHandlerBuilder("aesu").player(player.inventory).inventory().hotbar().armor()
.complete(8, 18).addArmor().addInventory().blockEntity(this).energySlot(0, 62, 45).energySlot(1, 98, 45)
.syncEnergyValue().sync(this::getCurrentOutput, this::setCurentOutput).addInventory().create(this, syncID);
}

View file

@ -25,9 +25,9 @@
package techreborn.blockentity.storage.energy;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import team.reborn.energy.EnergyTier;
import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
@ -36,7 +36,7 @@ import techreborn.init.TRContent;
* Created by modmuss50 on 14/03/2016.
*
*/
public class HighVoltageSUBlockEntity extends EnergyStorageBlockEntity implements IContainerProvider {
public class HighVoltageSUBlockEntity extends EnergyStorageBlockEntity implements BuiltScreenHandlerProvider {
/**
* MFSU should store 4M Energy with 512 E/t I/O
@ -46,8 +46,8 @@ public class HighVoltageSUBlockEntity extends EnergyStorageBlockEntity implement
}
@Override
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("mfsu").player(player.inventory).inventory().hotbar().armor()
public BuiltScreenHandler createScreenHandler(int syncID, final PlayerEntity player) {
return new ScreenHandlerBuilder("mfsu").player(player.inventory).inventory().hotbar().armor()
.complete(8, 18).addArmor().addInventory().blockEntity(this).energySlot(0, 62, 45).energySlot(1, 98, 45)
.syncEnergyValue().addInventory().create(this, syncID);
}

View file

@ -25,9 +25,9 @@
package techreborn.blockentity.storage.energy;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import team.reborn.energy.EnergyTier;
import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
@ -35,15 +35,15 @@ import techreborn.init.TRContent;
/**
* Created by modmuss50 on 14/03/2016.
*/
public class LowVoltageSUBlockEntity extends EnergyStorageBlockEntity implements IContainerProvider {
public class LowVoltageSUBlockEntity extends EnergyStorageBlockEntity implements BuiltScreenHandlerProvider {
public LowVoltageSUBlockEntity() {
super(TRBlockEntities.LOW_VOLTAGE_SU, "BatBox", 2, TRContent.Machine.LOW_VOLTAGE_SU.block, EnergyTier.LOW, 40_000);
}
@Override
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("batbox").player(player.inventory).inventory().hotbar().addInventory()
public BuiltScreenHandler createScreenHandler(int syncID, final PlayerEntity player) {
return new ScreenHandlerBuilder("batbox").player(player.inventory).inventory().hotbar().addInventory()
.blockEntity(this).energySlot(0, 62, 45).energySlot(1, 98, 45).syncEnergyValue().addInventory().create(this, syncID);
}
}

View file

@ -25,9 +25,9 @@
package techreborn.blockentity.storage.energy;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import team.reborn.energy.EnergyTier;
import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
@ -36,7 +36,7 @@ import techreborn.init.TRContent;
* Created by modmuss50 on 14/03/2016.
*
*/
public class MediumVoltageSUBlockEntity extends EnergyStorageBlockEntity implements IContainerProvider {
public class MediumVoltageSUBlockEntity extends EnergyStorageBlockEntity implements BuiltScreenHandlerProvider {
/**
* MFE should store 300k energy with 128 E/t I/O
@ -46,8 +46,8 @@ public class MediumVoltageSUBlockEntity extends EnergyStorageBlockEntity impleme
}
@Override
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("mfe").player(player.inventory).inventory().hotbar().armor()
public BuiltScreenHandler createScreenHandler(int syncID, final PlayerEntity player) {
return new ScreenHandlerBuilder("mfe").player(player.inventory).inventory().hotbar().armor()
.complete(8, 18).addArmor().addInventory().blockEntity(this).energySlot(0, 62, 45).energySlot(1, 98, 45)
.syncEnergyValue().addInventory().create(this, syncID);
}

View file

@ -27,9 +27,9 @@ package techreborn.blockentity.storage.energy.idsu;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.nbt.CompoundTag;
import org.apache.commons.lang3.StringUtils;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import team.reborn.energy.EnergySide;
import team.reborn.energy.EnergyTier;
import techreborn.blockentity.storage.energy.EnergyStorageBlockEntity;
@ -37,7 +37,7 @@ import techreborn.config.TechRebornConfig;
import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
public class InterdimensionalSUBlockEntity extends EnergyStorageBlockEntity implements IContainerProvider {
public class InterdimensionalSUBlockEntity extends EnergyStorageBlockEntity implements BuiltScreenHandlerProvider {
public String ownerUdid;
@ -117,8 +117,8 @@ public class InterdimensionalSUBlockEntity extends EnergyStorageBlockEntity impl
}
@Override
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("idsu").player(player.inventory).inventory().hotbar().armor()
public BuiltScreenHandler createScreenHandler(int syncID, final PlayerEntity player) {
return new ScreenHandlerBuilder("idsu").player(player.inventory).inventory().hotbar().armor()
.complete(8, 18).addArmor().addInventory().blockEntity(this).energySlot(0, 62, 45).energySlot(1, 98, 45)
.syncEnergyValue().addInventory().create(this, syncID);
}

View file

@ -27,11 +27,10 @@ package techreborn.blockentity.storage.energy.lesu;
import net.minecraft.block.Block;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import team.reborn.energy.EnergyTier;
import techreborn.blockentity.storage.energy.EnergyStorageBlockEntity;
import techreborn.blocks.storage.energy.LapotronicSUBlock;
@ -41,7 +40,7 @@ import techreborn.init.TRContent;
import java.util.ArrayList;
public class LapotronicSUBlockEntity extends EnergyStorageBlockEntity implements IContainerProvider{
public class LapotronicSUBlockEntity extends EnergyStorageBlockEntity implements BuiltScreenHandlerProvider {
private int connectedBlocks = 0;
private ArrayList<LesuNetwork> countedNetworks = new ArrayList<>();
@ -127,8 +126,8 @@ public class LapotronicSUBlockEntity extends EnergyStorageBlockEntity implements
// IContainerProvider
@Override
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("lesu").player(player.inventory).inventory().hotbar().armor().complete(8, 18)
public BuiltScreenHandler createScreenHandler(int syncID, final PlayerEntity player) {
return new ScreenHandlerBuilder("lesu").player(player.inventory).inventory().hotbar().armor().complete(8, 18)
.addArmor().addInventory().blockEntity(this).energySlot(0, 62, 45).energySlot(1, 98, 45).syncEnergyValue()
.sync(this::getConnectedBlocksNum, this::setConnectedBlocksNum).addInventory().create(this, syncID);
}

View file

@ -36,9 +36,9 @@ import org.apache.commons.lang3.text.WordUtils;
import reborncore.api.IListInfoProvider;
import reborncore.api.IToolDrop;
import reborncore.api.blockentity.InventoryProvider;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.blockentity.MachineBaseBlockEntity;
import reborncore.common.fluid.FluidUtil;
import reborncore.common.fluid.FluidValue;
@ -52,7 +52,7 @@ import techreborn.utils.FluidUtils;
import javax.annotation.Nonnull;
import java.util.List;
public class TankUnitBaseBlockEntity extends MachineBaseBlockEntity implements InventoryProvider, IToolDrop, IListInfoProvider, IContainerProvider {
public class TankUnitBaseBlockEntity extends MachineBaseBlockEntity implements InventoryProvider, IToolDrop, IListInfoProvider, BuiltScreenHandlerProvider {
protected Tank tank;
protected RebornInventory<TankUnitBaseBlockEntity> inventory = new RebornInventory<>(2, "TankInventory", 64, this);
@ -164,8 +164,8 @@ public class TankUnitBaseBlockEntity extends MachineBaseBlockEntity implements I
// IContainerProvider
@Override
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("tank").player(player.inventory).inventory().hotbar()
public BuiltScreenHandler createScreenHandler(int syncID, final PlayerEntity player) {
return new ScreenHandlerBuilder("tank").player(player.inventory).inventory().hotbar()
.addInventory().blockEntity(this).fluidSlot(0, 100, 53).outputSlot(1, 140, 53)
.sync(tank).addInventory().create(this, syncID);
}

View file

@ -38,9 +38,9 @@ import net.minecraft.world.World;
import reborncore.api.IListInfoProvider;
import reborncore.api.IToolDrop;
import reborncore.api.blockentity.InventoryProvider;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.client.screen.BuiltScreenHandlerProvider;
import reborncore.client.screen.builder.BuiltScreenHandler;
import reborncore.client.screen.builder.ScreenHandlerBuilder;
import reborncore.common.blockentity.MachineBaseBlockEntity;
import reborncore.common.util.ItemUtils;
import reborncore.common.util.RebornInventory;
@ -52,7 +52,7 @@ import techreborn.init.TRContent;
import java.util.List;
public class StorageUnitBaseBlockEntity extends MachineBaseBlockEntity
implements InventoryProvider, IToolDrop, IListInfoProvider, IContainerProvider {
implements InventoryProvider, IToolDrop, IListInfoProvider, BuiltScreenHandlerProvider {
// Inventory constants
@ -377,8 +377,8 @@ public class StorageUnitBaseBlockEntity extends MachineBaseBlockEntity
// Inventory gets dropped automatically
}
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("chest").player(player.inventory).inventory().hotbar().addInventory()
public BuiltScreenHandler createScreenHandler(int syncID, final PlayerEntity player) {
return new ScreenHandlerBuilder("chest").player(player.inventory).inventory().hotbar().addInventory()
.blockEntity(this).slot(0, 100, 53).outputSlot(1, 140, 53).addInventory().create(this, syncID);
}