Tile -> BlockEntity + some more refactors
This commit is contained in:
parent
7f8674f1ca
commit
dbc89adaf7
193 changed files with 3194 additions and 3214 deletions
src/main/java/techreborn
TechReborn.java
api
fluidreplicator
recipe
blockentity
AlarmBlockEntity.javaChargeOMatBlockEntity.javaDigitalChestBlockEntity.javaGenericMachineBlockEntity.javaIndustrialCentrifugeBlockEntity.javaMachineCasingBlockEntity.javaTechStorageBaseBlockEntity.java
cable
fusionReactor
generator
BaseFluidGeneratorBlockEntity.javaLightningRodBlockEntity.javaPlasmaGeneratorBlockEntity.javaSolarPanelBlockEntity.java
advanced
DieselGeneratorBlockEntity.javaDragonEggSyphonBlockEntity.javaGasTurbineBlockEntity.javaSemiFluidGeneratorBlockEntity.javaThermalGeneratorBlockEntity.java
basic
lighting
machine
iron
multiblock
DistillationTowerBlockEntity.javaFluidReplicatorBlockEntity.javaImplosionCompressorBlockEntity.javaIndustrialBlastFurnaceBlockEntity.javaIndustrialGrinderBlockEntity.javaIndustrialSawmillBlockEntity.javaMultiblockChecker.javaVacuumFreezerBlockEntity.java
tier1
AlloySmelterBlockEntity.javaAssemblingMachineBlockEntity.javaAutoCraftingTableBlockEntity.javaChemicalReactorBlockEntity.javaCompressorBlockEntity.javaElectricFurnaceBlockEntity.javaExtractorBlockEntity.javaGrinderBlockEntity.javaIndustrialElectrolyzerBlockEntity.javaPlayerDectectorBlockEntity.javaRecyclerBlockEntity.javaRollingMachineBlockEntity.javaScrapboxinatorBlockEntity.java
tier3
storage
AdjustableSUBlockEntity.javaEnergyStorageBlockEntity.javaHighVoltageSUBlockEntity.javaLowVoltageSUBlockEntity.javaMediumVoltageSUBlockEntity.java
idsu
lesu
transformers
blocks
BlockAlarm.javaBlockMachineCasing.javaBlockSupercondensator.java
cable
generator
BlockDieselGenerator.javaBlockDragonEggSyphon.javaBlockFusionControlComputer.javaBlockGasTurbine.javaBlockLightningRod.javaBlockMagicEnergyAbsorber.javaBlockMagicEnergyConverter.javaBlockPlasmaGenerator.javaBlockSemiFluidGenerator.javaBlockSolarPanel.javaBlockSolidFuelGenerator.javaBlockThermalGenerator.javaBlockWaterMill.javaBlockWindMill.java
lighting
misc
storage
|
@ -42,7 +42,7 @@ import techreborn.init.*;
|
|||
import techreborn.packets.ClientboundPackets;
|
||||
import techreborn.packets.ServerboundPackets;
|
||||
import techreborn.proxies.CommonProxy;
|
||||
import techreborn.tiles.fusionReactor.TileFusionControlComputer;
|
||||
import techreborn.blockentity.fusionReactor.FusionControlComputerBlockEntity;
|
||||
import techreborn.utils.BehaviorDispenseScrapbox;
|
||||
import techreborn.utils.StackWIPHandler;
|
||||
import techreborn.world.WorldGenerator;
|
||||
|
@ -116,7 +116,7 @@ public class TechReborn implements ModInitializer {
|
|||
DispenserBlock.registerBehavior(TRContent.SCRAP_BOX, new BehaviorDispenseScrapbox());
|
||||
}
|
||||
|
||||
Torus.genSizeMap(TileFusionControlComputer.maxCoilSize);
|
||||
Torus.genSizeMap(FusionControlComputerBlockEntity.maxCoilSize);
|
||||
|
||||
proxy.postInit();
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ package techreborn.api.fluidreplicator;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import reborncore.fluid.Fluid;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.tiles.machine.multiblock.TileFluidReplicator;
|
||||
import techreborn.blockentity.machine.multiblock.FluidReplicatorBlockEntity;
|
||||
import techreborn.utils.FluidUtils;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
@ -105,19 +105,19 @@ public class FluidReplicatorRecipe implements Cloneable {
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean canCraft(TileFluidReplicator tile) {
|
||||
if (!tile.getMultiBlock()) {
|
||||
public boolean canCraft(FluidReplicatorBlockEntity blockEntity) {
|
||||
if (!blockEntity.getMultiBlock()) {
|
||||
return false;
|
||||
}
|
||||
final BlockPos hole = tile.getPos().offset(tile.getFacing().getOpposite(), 2);
|
||||
final Fluid fluid = techreborn.utils.FluidUtils.fluidFromBlock(tile.getWorld().getBlockState(hole).getBlock());
|
||||
final BlockPos hole = blockEntity.getPos().offset(blockEntity.getFacing().getOpposite(), 2);
|
||||
final Fluid fluid = techreborn.utils.FluidUtils.fluidFromBlock(blockEntity.getWorld().getBlockState(hole).getBlock());
|
||||
if (fluid == null) {
|
||||
return false;
|
||||
}
|
||||
if (!FluidUtils.fluidEquals(fluid, output)) {
|
||||
return false;
|
||||
}
|
||||
final Fluid tankFluid = tile.tank.getFluidType();
|
||||
final Fluid tankFluid = blockEntity.tank.getFluidType();
|
||||
if (tankFluid != null && !FluidUtils.fluidEquals(tankFluid, fluid)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ public class FluidReplicatorRecipe implements Cloneable {
|
|||
return true;
|
||||
}
|
||||
|
||||
public boolean onCraft(TileFluidReplicator tile) {
|
||||
public boolean onCraft(FluidReplicatorBlockEntity blockEntity) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ import reborncore.fluid.Fluid;
|
|||
import reborncore.fluid.FluidStack;
|
||||
import techreborn.init.ModRecipes;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.tiles.machine.multiblock.TileFluidReplicator;
|
||||
import techreborn.blockentity.machine.multiblock.FluidReplicatorBlockEntity;
|
||||
|
||||
/**
|
||||
* @author drcrazy
|
||||
|
@ -47,13 +47,13 @@ public class FluidReplicatorRecipeCrafter extends RecipeCrafter {
|
|||
/**
|
||||
* RecipeCrafter for Fluid Replicator
|
||||
*
|
||||
* @param parentTile TileEntity Reference to the tile having this crafter
|
||||
* @param parent BlockEntity Reference to the blockEntity having this crafter
|
||||
* @param inventory Inventory reference to inventory used for crafting
|
||||
* @param inputSlots This is the list of the slots that the crafting logic should look for the input UU-Matter.
|
||||
* @param outputSlots This is the list of slots that the crafting logic should look for output fluid
|
||||
*/
|
||||
public FluidReplicatorRecipeCrafter(BlockEntity parentTile, RebornInventory<?> inventory, int[] inputSlots, int[] outputSlots) {
|
||||
super(ModRecipes.FLUID_REPLICATOR, parentTile, 1, 1, inventory, inputSlots, outputSlots);
|
||||
public FluidReplicatorRecipeCrafter(BlockEntity parent, RebornInventory<?> inventory, int[] inputSlots, int[] outputSlots) {
|
||||
super(ModRecipes.FLUID_REPLICATOR, parent, 1, 1, inventory, inputSlots, outputSlots);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -92,7 +92,7 @@ public class FluidReplicatorRecipeCrafter extends RecipeCrafter {
|
|||
// RecipeCrafter
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if (tile.getWorld().isClient) {
|
||||
if (blockEntity.getWorld().isClient) {
|
||||
return;
|
||||
}
|
||||
ticksSinceLastChange++;
|
||||
|
@ -114,18 +114,18 @@ public class FluidReplicatorRecipeCrafter extends RecipeCrafter {
|
|||
}
|
||||
// If it has reached the recipe tick time
|
||||
if (currentRecipe != null && currentTickTime >= currentNeededTicks && hasAllInputs()) {
|
||||
TileFluidReplicator tileFluidReplicator = (TileFluidReplicator) tile;
|
||||
FluidReplicatorBlockEntity blockEntityFluidReplicator = (FluidReplicatorBlockEntity) blockEntity;
|
||||
// Checks to see if it can fit the output
|
||||
// And fill tank with replicated fluid
|
||||
if (canFit(currentRecipe.getFluid(), tileFluidReplicator.tank) && currentRecipe.onCraft(tileFluidReplicator)) {
|
||||
tileFluidReplicator.tank.fill(new FluidStack(currentRecipe.getFluid(), 1000), true);
|
||||
if (canFit(currentRecipe.getFluid(), blockEntityFluidReplicator.tank) && currentRecipe.onCraft(blockEntityFluidReplicator)) {
|
||||
blockEntityFluidReplicator.tank.fill(new FluidStack(currentRecipe.getFluid(), 1000), true);
|
||||
// This uses all the inputs
|
||||
useAllInputs();
|
||||
// Reset
|
||||
currentRecipe = null;
|
||||
currentTickTime = 0;
|
||||
updateCurrentRecipe();
|
||||
//Update active state if the tile isnt going to start crafting again
|
||||
//Update active state if the blockEntity isnt going to start crafting again
|
||||
if(currentRecipe == null){
|
||||
setIsActive();
|
||||
}
|
||||
|
@ -137,7 +137,7 @@ public class FluidReplicatorRecipeCrafter extends RecipeCrafter {
|
|||
// Increase the ticktime
|
||||
currentTickTime ++;
|
||||
if(currentTickTime == 1 || currentTickTime % 20 == 0 && soundHanlder != null){
|
||||
soundHanlder.playSound(false, tile);
|
||||
soundHanlder.playSound(false, blockEntity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -147,10 +147,10 @@ public class FluidReplicatorRecipeCrafter extends RecipeCrafter {
|
|||
|
||||
@Override
|
||||
public void updateCurrentRecipe() {
|
||||
TileFluidReplicator tileFluidReplicator = (TileFluidReplicator) tile;
|
||||
FluidReplicatorBlockEntity blockEntityFluidReplicator = (FluidReplicatorBlockEntity) blockEntity;
|
||||
for (FluidReplicatorRecipe recipe : FluidReplicatorRecipeList.recipes) {
|
||||
if (recipe.canCraft(tileFluidReplicator) && hasAllInputs(recipe)) {
|
||||
if (!canFit(recipe.getFluid(), tileFluidReplicator.tank)) {
|
||||
if (recipe.canCraft(blockEntityFluidReplicator) && hasAllInputs(recipe)) {
|
||||
if (!canFit(recipe.getFluid(), blockEntityFluidReplicator.tank)) {
|
||||
this.currentRecipe = null;
|
||||
currentTickTime = 0;
|
||||
setIsActive();
|
||||
|
@ -187,10 +187,10 @@ public class FluidReplicatorRecipeCrafter extends RecipeCrafter {
|
|||
|
||||
@Override
|
||||
public boolean canCraftAgain() {
|
||||
TileFluidReplicator tileFluidReplicator = (TileFluidReplicator) tile;
|
||||
FluidReplicatorBlockEntity blockEntityFluidReplicator = (FluidReplicatorBlockEntity) blockEntity;
|
||||
for (FluidReplicatorRecipe recipe : FluidReplicatorRecipeList.recipes) {
|
||||
if (recipe.canCraft(tileFluidReplicator) && hasAllInputs(recipe)) {
|
||||
if (!canFit(recipe.getFluid(), tileFluidReplicator.tank)) {
|
||||
if (recipe.canCraft(blockEntityFluidReplicator) && hasAllInputs(recipe)) {
|
||||
if (!canFit(recipe.getFluid(), blockEntityFluidReplicator.tank)) {
|
||||
return false;
|
||||
}
|
||||
if (energy.getEnergy() < recipe.getEuTick()) {
|
||||
|
|
|
@ -39,19 +39,19 @@ import java.util.List;
|
|||
public class ScrapboxRecipeCrafter extends RecipeCrafter {
|
||||
|
||||
/**
|
||||
* @param parentTile Tile having this crafter
|
||||
* @param inventory Inventory from parent tile
|
||||
* @param parent Tile having this crafter
|
||||
* @param inventory Inventory from parent blockEntity
|
||||
* @param inputSlots Slot IDs for input
|
||||
* @param outputSlots Slot IDs for output
|
||||
*/
|
||||
public ScrapboxRecipeCrafter(BlockEntity parentTile, RebornInventory<?> inventory, int[] inputSlots, int[] outputSlots) {
|
||||
super(ModRecipes.SCRAPBOX, parentTile, 1, 1, inventory, inputSlots, outputSlots);
|
||||
public ScrapboxRecipeCrafter(BlockEntity parent, RebornInventory<?> inventory, int[] inputSlots, int[] outputSlots) {
|
||||
super(ModRecipes.SCRAPBOX, parent, 1, 1, inventory, inputSlots, outputSlots);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateCurrentRecipe(){
|
||||
List<RebornRecipe> scrapboxRecipeList = ModRecipes.SCRAPBOX.getRecipes(tile.getWorld());
|
||||
int random = tile.getWorld().random.nextInt(scrapboxRecipeList.size());
|
||||
List<RebornRecipe> scrapboxRecipeList = ModRecipes.SCRAPBOX.getRecipes(blockEntity.getWorld());
|
||||
int random = blockEntity.getWorld().random.nextInt(scrapboxRecipeList.size());
|
||||
// Sets the current recipe then syncs
|
||||
setCurrentRecipe(scrapboxRecipeList.get(random));
|
||||
this.currentNeededTicks = Math.max((int) (currentRecipe.getTime() * (1.0 - getSpeedMultiplier())), 1);
|
||||
|
|
|
@ -30,7 +30,7 @@ import net.minecraft.util.Identifier;
|
|||
import net.minecraft.util.JsonHelper;
|
||||
import reborncore.common.crafting.RebornRecipe;
|
||||
import reborncore.common.crafting.RebornRecipeType;
|
||||
import techreborn.tiles.machine.multiblock.TileIndustrialBlastFurnace;
|
||||
import techreborn.blockentity.machine.multiblock.IndustrialBlastFurnaceBlockEntity;
|
||||
|
||||
public class BlastFurnaceRecipe extends RebornRecipe {
|
||||
|
||||
|
@ -53,16 +53,16 @@ public class BlastFurnaceRecipe extends RebornRecipe {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canCraft(final BlockEntity tile) {
|
||||
if (tile instanceof TileIndustrialBlastFurnace) {
|
||||
final TileIndustrialBlastFurnace blastFurnace = (TileIndustrialBlastFurnace) tile;
|
||||
public boolean canCraft(final BlockEntity blockEntity) {
|
||||
if (blockEntity instanceof IndustrialBlastFurnaceBlockEntity) {
|
||||
final IndustrialBlastFurnaceBlockEntity blastFurnace = (IndustrialBlastFurnaceBlockEntity) blockEntity;
|
||||
return blastFurnace.getHeat() >= heat;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCraft(final BlockEntity tile) {
|
||||
public boolean onCraft(final BlockEntity blockEntity) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ import net.minecraft.util.Identifier;
|
|||
import reborncore.common.crafting.RebornRecipe;
|
||||
import reborncore.common.crafting.RebornRecipeType;
|
||||
import reborncore.fluid.FluidStack;
|
||||
import techreborn.tiles.machine.multiblock.TileIndustrialGrinder;
|
||||
import techreborn.blockentity.machine.multiblock.IndustrialGrinderBlockEntity;
|
||||
|
||||
public class IndustrialGrinderRecipe extends RebornRecipe {
|
||||
|
||||
|
@ -41,13 +41,13 @@ public class IndustrialGrinderRecipe extends RebornRecipe {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canCraft(final BlockEntity tileEntity) {
|
||||
TileIndustrialGrinder tile = (TileIndustrialGrinder) tileEntity;
|
||||
if (!tile.getMultiBlock()) {
|
||||
public boolean canCraft(final BlockEntity be) {
|
||||
IndustrialGrinderBlockEntity blockEntity = (IndustrialGrinderBlockEntity) be;
|
||||
if (!blockEntity.getMultiBlock()) {
|
||||
return false;
|
||||
}
|
||||
final FluidStack recipeFluid = fluidStack;
|
||||
final FluidStack tankFluid = tile.tank.getFluid();
|
||||
final FluidStack tankFluid = blockEntity.tank.getFluid();
|
||||
if (fluidStack == null) {
|
||||
return true;
|
||||
}
|
||||
|
@ -63,10 +63,10 @@ public class IndustrialGrinderRecipe extends RebornRecipe {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onCraft(final BlockEntity tileEntity) {
|
||||
TileIndustrialGrinder tile = (TileIndustrialGrinder) tileEntity;
|
||||
public boolean onCraft(final BlockEntity be) {
|
||||
IndustrialGrinderBlockEntity blockEntity = (IndustrialGrinderBlockEntity) be;
|
||||
final FluidStack recipeFluid = fluidStack;
|
||||
final FluidStack tankFluid = tile.tank.getFluid();
|
||||
final FluidStack tankFluid = blockEntity.tank.getFluid();
|
||||
if (fluidStack == null) {
|
||||
return true;
|
||||
}
|
||||
|
@ -76,12 +76,12 @@ public class IndustrialGrinderRecipe extends RebornRecipe {
|
|||
if (tankFluid.isFluidEqual(recipeFluid)) {
|
||||
if (tankFluid.amount >= recipeFluid.amount) {
|
||||
if (tankFluid.amount == recipeFluid.amount) {
|
||||
tile.tank.setFluid(null);
|
||||
blockEntity.tank.setFluid(null);
|
||||
}
|
||||
else {
|
||||
tankFluid.amount -= recipeFluid.amount;
|
||||
}
|
||||
tile.syncWithAll();
|
||||
blockEntity.syncWithAll();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ import net.minecraft.util.Identifier;
|
|||
import reborncore.common.crafting.RebornRecipe;
|
||||
import reborncore.common.crafting.RebornRecipeType;
|
||||
import reborncore.fluid.FluidStack;
|
||||
import techreborn.tiles.machine.multiblock.TileIndustrialSawmill;
|
||||
import techreborn.blockentity.machine.multiblock.IndustrialSawmillBlockEntity;
|
||||
|
||||
public class IndustrialSawmillRecipe extends RebornRecipe {
|
||||
|
||||
|
@ -41,13 +41,13 @@ public class IndustrialSawmillRecipe extends RebornRecipe {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canCraft(BlockEntity tileEntity) {
|
||||
TileIndustrialSawmill tile = (TileIndustrialSawmill) tileEntity;
|
||||
if (!tile.getMutliBlock()) {
|
||||
public boolean canCraft(BlockEntity be) {
|
||||
IndustrialSawmillBlockEntity blockEntity = (IndustrialSawmillBlockEntity) be;
|
||||
if (!blockEntity.getMutliBlock()) {
|
||||
return false;
|
||||
}
|
||||
final FluidStack recipeFluid = fluidStack;
|
||||
final FluidStack tankFluid = tile.tank.getFluid();
|
||||
final FluidStack tankFluid = blockEntity.tank.getFluid();
|
||||
if (fluidStack == null) {
|
||||
return true;
|
||||
}
|
||||
|
@ -63,10 +63,10 @@ public class IndustrialSawmillRecipe extends RebornRecipe {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onCraft(BlockEntity tileEntity) {
|
||||
TileIndustrialSawmill tile = (TileIndustrialSawmill) tileEntity;
|
||||
public boolean onCraft(BlockEntity be) {
|
||||
IndustrialSawmillBlockEntity blockEntity = (IndustrialSawmillBlockEntity) be;
|
||||
final FluidStack recipeFluid = fluidStack;
|
||||
final FluidStack tankFluid = tile.tank.getFluid();
|
||||
final FluidStack tankFluid = blockEntity.tank.getFluid();
|
||||
if (fluidStack == null) {
|
||||
return true;
|
||||
}
|
||||
|
@ -76,11 +76,11 @@ public class IndustrialSawmillRecipe extends RebornRecipe {
|
|||
if (tankFluid.isFluidEqual(recipeFluid)) {
|
||||
if (tankFluid.amount >= recipeFluid.amount) {
|
||||
if (tankFluid.amount == recipeFluid.amount) {
|
||||
tile.tank.setFluid(null);
|
||||
blockEntity.tank.setFluid(null);
|
||||
} else {
|
||||
tankFluid.amount -= recipeFluid.amount;
|
||||
}
|
||||
tile.syncWithAll();
|
||||
blockEntity.syncWithAll();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles;
|
||||
package techreborn.blockentity;
|
||||
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
|
@ -38,15 +38,15 @@ import reborncore.common.util.StringUtils;
|
|||
import techreborn.blocks.BlockAlarm;
|
||||
import techreborn.init.ModSounds;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
import techreborn.utils.MessageIDs;
|
||||
|
||||
public class TileAlarm extends BlockEntity
|
||||
public class AlarmBlockEntity extends BlockEntity
|
||||
implements Tickable, IToolDrop {
|
||||
private int selectedSound = 1;
|
||||
|
||||
public TileAlarm() {
|
||||
super(TRTileEntities.ALARM);
|
||||
public AlarmBlockEntity() {
|
||||
super(TRBlockEntities.ALARM);
|
||||
}
|
||||
|
||||
public void rightClick() {
|
||||
|
@ -61,7 +61,7 @@ public class TileAlarm extends BlockEntity
|
|||
}
|
||||
}
|
||||
|
||||
// TileEntity
|
||||
// BlockEntity
|
||||
@Override
|
||||
public CompoundTag toTag(CompoundTag compound) {
|
||||
if (compound == null) {
|
|
@ -22,27 +22,27 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles;
|
||||
package techreborn.blockentity;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import reborncore.api.IToolDrop;
|
||||
import reborncore.api.tile.InventoryProvider;
|
||||
import reborncore.api.blockentity.InventoryProvider;
|
||||
import reborncore.client.containerBuilder.IContainerProvider;
|
||||
import reborncore.client.containerBuilder.builder.BuiltContainer;
|
||||
import reborncore.client.containerBuilder.builder.ContainerBuilder;
|
||||
import reborncore.common.powerSystem.ExternalPowerSystems;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
|
||||
import reborncore.common.registration.RebornRegister;
|
||||
import reborncore.common.registration.config.ConfigRegistry;
|
||||
import reborncore.common.util.RebornInventory;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileChargeOMat extends TilePowerAcceptor
|
||||
public class ChargeOMatBlockEntity extends PowerAcceptorBlockEntity
|
||||
implements IToolDrop, InventoryProvider, IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "machines", category = "charge_bench", key = "ChargeBenchMaxOutput", comment = "Charge Bench Max Output (Value in EU)")
|
||||
|
@ -52,10 +52,10 @@ public class TileChargeOMat extends TilePowerAcceptor
|
|||
@ConfigRegistry(config = "machines", category = "charge_bench", key = "ChargeBenchMaxEnergy", comment = "Charge Bench Max Energy (Value in EU)")
|
||||
public static int maxEnergy = 100_000_000;
|
||||
|
||||
public RebornInventory<TileChargeOMat> inventory = new RebornInventory<>(6, "TileChargeOMat", 64, this).withConfiguredAccess();
|
||||
public RebornInventory<ChargeOMatBlockEntity> inventory = new RebornInventory<>(6, "ChargeOMatBlockEntity", 64, this).withConfiguredAccess();
|
||||
|
||||
public TileChargeOMat() {
|
||||
super(TRTileEntities.CHARGE_O_MAT);
|
||||
public ChargeOMatBlockEntity() {
|
||||
super(TRBlockEntities.CHARGE_O_MAT);
|
||||
}
|
||||
|
||||
// TilePowerAcceptor
|
||||
|
@ -114,7 +114,7 @@ public class TileChargeOMat extends TilePowerAcceptor
|
|||
|
||||
// ItemHandlerProvider
|
||||
@Override
|
||||
public RebornInventory<TileChargeOMat> getInventory() {
|
||||
public RebornInventory<ChargeOMatBlockEntity> getInventory() {
|
||||
return inventory;
|
||||
}
|
||||
|
||||
|
@ -122,7 +122,7 @@ public class TileChargeOMat extends TilePowerAcceptor
|
|||
@Override
|
||||
public BuiltContainer createContainer(int syncID, final PlayerEntity 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)
|
||||
.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);
|
||||
}
|
||||
}
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles;
|
||||
package techreborn.blockentity;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.containerBuilder.IContainerProvider;
|
||||
|
@ -31,21 +31,21 @@ import reborncore.client.containerBuilder.builder.ContainerBuilder;
|
|||
import reborncore.common.registration.RebornRegister;
|
||||
import reborncore.common.registration.config.ConfigRegistry;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileDigitalChest extends TileTechStorageBase implements IContainerProvider {
|
||||
public class DigitalChestBlockEntity extends TechStorageBaseBlockEntity implements IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "machines", category = "digital_chest", key = "DigitalChestMaxStorage", comment = "Maximum amount of items a Digital Chest can store")
|
||||
public static int maxStorage = 32768;
|
||||
|
||||
public TileDigitalChest() {
|
||||
super(TRTileEntities.DIGITAL_CHEST,"TileDigitalChest", maxStorage);
|
||||
public DigitalChestBlockEntity() {
|
||||
super(TRBlockEntities.DIGITAL_CHEST, "DigitalChestBlockEntity", maxStorage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
|
||||
return new ContainerBuilder("digitalchest").player(player.inventory).inventory().hotbar().addInventory()
|
||||
.tile(this).slot(0, 80, 24).outputSlot(1, 80, 64).addInventory().create(this, syncID);
|
||||
.blockEntity(this).slot(0, 80, 24).outputSlot(1, 80, 64).addInventory().create(this, syncID);
|
||||
}
|
||||
}
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles;
|
||||
package techreborn.blockentity;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.entity.BlockEntityType;
|
||||
|
@ -31,8 +31,8 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.util.math.Direction;
|
||||
import reborncore.api.IToolDrop;
|
||||
import reborncore.api.recipe.IRecipeCrafterProvider;
|
||||
import reborncore.api.tile.InventoryProvider;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.api.blockentity.InventoryProvider;
|
||||
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
|
||||
import reborncore.common.recipes.RecipeCrafter;
|
||||
import reborncore.common.util.RebornInventory;
|
||||
|
||||
|
@ -40,7 +40,7 @@ import reborncore.common.util.RebornInventory;
|
|||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
public abstract class TileGenericMachine extends TilePowerAcceptor
|
||||
public abstract class GenericMachineBlockEntity extends PowerAcceptorBlockEntity
|
||||
implements IToolDrop, InventoryProvider, IRecipeCrafterProvider{
|
||||
|
||||
public String name;
|
||||
|
@ -52,15 +52,15 @@ public abstract class TileGenericMachine extends TilePowerAcceptor
|
|||
public RecipeCrafter crafter;
|
||||
|
||||
/**
|
||||
* @param name String Name for a tile. Do we need it at all?
|
||||
* @param name String Name for a blockEntity. Do we need it at all?
|
||||
* @param maxInput int Maximum energy input, value in EU
|
||||
* @param maxEnergy int Maximum energy buffer, value in EU
|
||||
* @param toolDrop Block Block to drop with wrench
|
||||
* @param energySlot int Energy slot to use to charge machine from battery
|
||||
*/
|
||||
public TileGenericMachine(BlockEntityType<?> tileEntityType, String name, int maxInput, int maxEnergy, Block toolDrop, int energySlot) {
|
||||
super(tileEntityType);
|
||||
this.name = "Tile" + name;
|
||||
public GenericMachineBlockEntity(BlockEntityType<?> blockEntityType, String name, int maxInput, int maxEnergy, Block toolDrop, int energySlot) {
|
||||
super(blockEntityType);
|
||||
this.name = "BlockEntity" + name;
|
||||
this.maxInput = maxInput;
|
||||
this.maxEnergy = maxEnergy;
|
||||
this.toolDrop = toolDrop;
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles;
|
||||
package techreborn.blockentity;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.LiteralText;
|
||||
|
@ -39,24 +39,24 @@ import reborncore.common.util.ItemUtils;
|
|||
import techreborn.TechReborn;
|
||||
import techreborn.init.ModRecipes;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
import techreborn.items.DynamicCell;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileIndustrialCentrifuge extends TileGenericMachine implements IContainerProvider, IListInfoProvider {
|
||||
public class IndustrialCentrifugeBlockEntity extends GenericMachineBlockEntity implements IContainerProvider, IListInfoProvider {
|
||||
|
||||
@ConfigRegistry(config = "machines", category = "centrifuge", key = "CentrifugeMaxInput", comment = "Centrifuge Max Input (Value in EU)")
|
||||
public static int maxInput = 32;
|
||||
@ConfigRegistry(config = "machines", category = "centrifuge", key = "CentrifugeMaxEnergy", comment = "Centrifuge Max Energy (Value in EU)")
|
||||
public static int maxEnergy = 10_000;
|
||||
|
||||
public TileIndustrialCentrifuge() {
|
||||
super(TRTileEntities.INDUSTRIAL_CENTRIFUGE, "IndustrialCentrifuge", maxInput, maxEnergy, TRContent.Machine.INDUSTRIAL_CENTRIFUGE.block, 6);
|
||||
public IndustrialCentrifugeBlockEntity() {
|
||||
super(TRBlockEntities.INDUSTRIAL_CENTRIFUGE, "IndustrialCentrifuge", maxInput, maxEnergy, TRContent.Machine.INDUSTRIAL_CENTRIFUGE.block, 6);
|
||||
final int[] inputs = new int[] { 0, 1 };
|
||||
final int[] outputs = new int[] { 2, 3, 4, 5 };
|
||||
this.inventory = new RebornInventory<>(7, "TileIndustrialCentrifuge", 64, this).withConfiguredAccess();
|
||||
this.inventory = new RebornInventory<>(7, "IndustrialCentrifugeBlockEntity", 64, this).withConfiguredAccess();
|
||||
this.crafter = new RecipeCrafter(ModRecipes.CENTRIFUGE, this, 2, 4, this.inventory, inputs, outputs);
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@ public class TileIndustrialCentrifuge extends TileGenericMachine implements ICon
|
|||
@Override
|
||||
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
|
||||
return new ContainerBuilder("centrifuge").player(player.inventory).inventory().hotbar()
|
||||
.addInventory().tile(this)
|
||||
.addInventory().blockEntity(this)
|
||||
.filterSlot(1, 40, 54, stack -> ItemUtils.isItemEqual(stack, DynamicCell.getEmptyCell(1), true, true))
|
||||
.filterSlot(0, 40, 34, stack -> !ItemUtils.isItemEqual(stack, DynamicCell.getEmptyCell(1), true, true))
|
||||
.outputSlot(2, 82, 44).outputSlot(3, 101, 25)
|
||||
|
@ -74,8 +74,8 @@ public class TileIndustrialCentrifuge extends TileGenericMachine implements ICon
|
|||
|
||||
// IListInfoProvider
|
||||
@Override
|
||||
public void addInfo(final List<Text> info, final boolean isRealTile, boolean hasData) {
|
||||
super.addInfo(info, isRealTile, hasData);
|
||||
public void addInfo(final List<Text> info, final boolean isReal, boolean hasData) {
|
||||
super.addInfo(info, isReal, hasData);
|
||||
info.add(new LiteralText("Round and round it goes"));
|
||||
}
|
||||
}
|
|
@ -22,17 +22,17 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles;
|
||||
package techreborn.blockentity;
|
||||
|
||||
import reborncore.common.multiblock.MultiblockControllerBase;
|
||||
import reborncore.common.multiblock.rectangular.RectangularMultiblockTileEntityBase;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import reborncore.common.multiblock.rectangular.RectangularMultiblockBlockEntityBase;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
import techreborn.multiblocks.MultiBlockCasing;
|
||||
|
||||
public class TileMachineCasing extends RectangularMultiblockTileEntityBase {
|
||||
public class MachineCasingBlockEntity extends RectangularMultiblockBlockEntityBase {
|
||||
|
||||
public TileMachineCasing() {
|
||||
super(TRTileEntities.MACHINE_CASINGS);
|
||||
public MachineCasingBlockEntity() {
|
||||
super(TRBlockEntities.MACHINE_CASINGS);
|
||||
}
|
||||
|
||||
@Override
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles;
|
||||
package techreborn.blockentity;
|
||||
|
||||
import net.minecraft.block.entity.BlockEntityType;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
|
@ -32,23 +32,23 @@ import net.minecraft.text.LiteralText;
|
|||
import net.minecraft.text.Text;
|
||||
import reborncore.api.IListInfoProvider;
|
||||
import reborncore.api.IToolDrop;
|
||||
import reborncore.api.tile.InventoryProvider;
|
||||
import reborncore.common.tile.TileMachineBase;
|
||||
import reborncore.api.blockentity.InventoryProvider;
|
||||
import reborncore.common.blockentity.MachineBaseBlockEntity;
|
||||
import reborncore.common.util.RebornInventory;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class TileTechStorageBase extends TileMachineBase
|
||||
public class TechStorageBaseBlockEntity extends MachineBaseBlockEntity
|
||||
implements InventoryProvider, IToolDrop, IListInfoProvider {
|
||||
|
||||
public final int maxCapacity;
|
||||
public final RebornInventory<TileTechStorageBase> inventory;
|
||||
public final RebornInventory<TechStorageBaseBlockEntity> inventory;
|
||||
public ItemStack storedItem;
|
||||
|
||||
public TileTechStorageBase(BlockEntityType<?> tileEntityTypeIn, String name, int maxCapacity) {
|
||||
super(tileEntityTypeIn);
|
||||
public TechStorageBaseBlockEntity(BlockEntityType<?> blockEntityTypeIn, String name, int maxCapacity) {
|
||||
super(blockEntityTypeIn);
|
||||
this.maxCapacity = maxCapacity;
|
||||
storedItem = ItemStack.EMPTY;
|
||||
inventory = new RebornInventory<>(3, name, maxCapacity, this).withConfiguredAccess();
|
||||
|
@ -85,11 +85,11 @@ public class TileTechStorageBase extends TileMachineBase
|
|||
}
|
||||
|
||||
public ItemStack getDropWithNBT() {
|
||||
CompoundTag tileEntity = new CompoundTag();
|
||||
CompoundTag blockEntity = new CompoundTag();
|
||||
ItemStack dropStack = new ItemStack(getBlockType(), 1);
|
||||
writeWithoutCoords(tileEntity);
|
||||
writeWithoutCoords(blockEntity);
|
||||
dropStack.setTag(new CompoundTag());
|
||||
dropStack.getTag().put("tileEntity", tileEntity);
|
||||
dropStack.getTag().put("blockEntity", blockEntity);
|
||||
storedItem.setCount(0);
|
||||
inventory.setInvStack(1, ItemStack.EMPTY);
|
||||
syncWithAll();
|
||||
|
@ -207,7 +207,7 @@ public class TileTechStorageBase extends TileMachineBase
|
|||
|
||||
// ItemHandlerProvider
|
||||
@Override
|
||||
public RebornInventory<TileTechStorageBase> getInventory() {
|
||||
public RebornInventory<TechStorageBaseBlockEntity> getInventory() {
|
||||
return inventory;
|
||||
}
|
||||
|
||||
|
@ -219,8 +219,8 @@ public class TileTechStorageBase extends TileMachineBase
|
|||
|
||||
// IListInfoProvider
|
||||
@Override
|
||||
public void addInfo(List<Text> info, boolean isRealTile, boolean hasData) {
|
||||
if (isRealTile || hasData) {
|
||||
public void addInfo(List<Text> info, boolean isReal, boolean hasData) {
|
||||
if (isReal || hasData) {
|
||||
int size = 0;
|
||||
String name = "of nothing";
|
||||
if (!storedItem.isEmpty()) {
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.cable;
|
||||
package techreborn.blockentity.cable;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
|
@ -42,7 +42,7 @@ import reborncore.common.powerSystem.PowerSystem;
|
|||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.blocks.cable.BlockCable;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -51,7 +51,7 @@ import java.util.List;
|
|||
* Created by modmuss50 on 19/05/2017.
|
||||
*/
|
||||
|
||||
public class TileCable extends BlockEntity
|
||||
public class CableBlockEntity extends BlockEntity
|
||||
implements Tickable, IListInfoProvider, IToolDrop {
|
||||
|
||||
public int power = 0;
|
||||
|
@ -60,8 +60,8 @@ public class TileCable extends BlockEntity
|
|||
private ArrayList<Direction> sendingFace = new ArrayList<Direction>();
|
||||
int ticksSinceLastChange = 0;
|
||||
|
||||
public TileCable() {
|
||||
super(TRTileEntities.CABLE);
|
||||
public CableBlockEntity() {
|
||||
super(TRBlockEntities.CABLE);
|
||||
}
|
||||
|
||||
private TRContent.Cables getCableType() {
|
||||
|
@ -89,8 +89,8 @@ public class TileCable extends BlockEntity
|
|||
@Override
|
||||
public void fromTag(CompoundTag compound) {
|
||||
super.fromTag(compound);
|
||||
if (compound.containsKey("TileCable")) {
|
||||
power = compound.getCompound("TileCable").getInt("power");
|
||||
if (compound.containsKey("CableBlockEntity")) {
|
||||
power = compound.getCompound("CableBlockEntity").getInt("power");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -99,7 +99,7 @@ public class TileCable extends BlockEntity
|
|||
super.toTag(compound);
|
||||
if (power > 0) {
|
||||
CompoundTag data = new CompoundTag();
|
||||
compound.put("TileCable", data);
|
||||
compound.put("CableBlockEntity", data);
|
||||
}
|
||||
return compound;
|
||||
}
|
||||
|
@ -126,20 +126,20 @@ public class TileCable extends BlockEntity
|
|||
|
||||
// ArrayList<IEnergyStorage> acceptors = new ArrayList<IEnergyStorage>();
|
||||
// for (Direction face : Direction.values()) {
|
||||
// BlockEntity tile = world.getBlockEntity(pos.offset(face));
|
||||
// BlockEntity blockEntity = world.getBlockEntity(pos.offset(face));
|
||||
//
|
||||
// if (tile == null) {
|
||||
// if (blockEntity == null) {
|
||||
// continue;
|
||||
// } else if (tile instanceof TileCable) {
|
||||
// TileCable cable = (TileCable) tile;
|
||||
// } else if (blockEntity instanceof TileCable) {
|
||||
// TileCable cable = (TileCable) blockEntity;
|
||||
// if (power > cable.power && cable.canReceiveFromFace(face.getOpposite())) {
|
||||
// acceptors.add((IEnergyStorage) tile);
|
||||
// acceptors.add((IEnergyStorage) blockEntity);
|
||||
// if (!sendingFace.contains(face)) {
|
||||
// sendingFace.add(face);
|
||||
// }
|
||||
// }
|
||||
// } else if (tile.getCapability(CapabilityEnergy.ENERGY, face.getOpposite()).isPresent()) {
|
||||
// IEnergyStorage energyTile = tile.getCapability(CapabilityEnergy.ENERGY, face.getOpposite()).orElse(null);
|
||||
// } else if (blockEntity.getCapability(CapabilityEnergy.ENERGY, face.getOpposite()).isPresent()) {
|
||||
// IEnergyStorage energyTile = blockEntity.getCapability(CapabilityEnergy.ENERGY, face.getOpposite()).orElse(null);
|
||||
// if (energyTile != null && energyTile.canReceive()) {
|
||||
// acceptors.add(energyTile);
|
||||
// }
|
||||
|
@ -147,10 +147,10 @@ public class TileCable extends BlockEntity
|
|||
// }
|
||||
//
|
||||
// if (acceptors.size() > 0 ) {
|
||||
// for (IEnergyStorage tile : acceptors) {
|
||||
// for (IEnergyStorage blockEntity : acceptors) {
|
||||
// int drain = Math.min(power, transferRate);
|
||||
// if (drain > 0 && tile.receiveEnergy(drain, true) > 0) {
|
||||
// int move = tile.receiveEnergy(drain, false);
|
||||
// if (drain > 0 && blockEntity.receiveEnergy(drain, true) > 0) {
|
||||
// int move = blockEntity.receiveEnergy(drain, false);
|
||||
// extractEnergy(move, false);
|
||||
// }
|
||||
// }
|
||||
|
@ -159,8 +159,8 @@ public class TileCable extends BlockEntity
|
|||
|
||||
// IListInfoProvider
|
||||
@Override
|
||||
public void addInfo(List<Text> info, boolean isRealTile, boolean hasData) {
|
||||
if (isRealTile) {
|
||||
public void addInfo(List<Text> info, boolean isReal, boolean hasData) {
|
||||
if (isReal) {
|
||||
info.add(new LiteralText(Formatting.GRAY + StringUtils.t("techreborn.tooltip.transferRate") + ": "
|
||||
+ Formatting.GOLD
|
||||
+ PowerSystem.getLocaliszedPowerFormatted(transferRate / RebornCoreConfig.euPerFU) + "/t"));
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.fusionReactor;
|
||||
package techreborn.blockentity.fusionReactor;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -30,12 +30,12 @@ import net.minecraft.nbt.CompoundTag;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import reborncore.api.IToolDrop;
|
||||
import reborncore.api.tile.InventoryProvider;
|
||||
import reborncore.api.blockentity.InventoryProvider;
|
||||
import reborncore.client.containerBuilder.IContainerProvider;
|
||||
import reborncore.client.containerBuilder.builder.BuiltContainer;
|
||||
import reborncore.client.containerBuilder.builder.ContainerBuilder;
|
||||
import reborncore.common.RebornCoreConfig;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
|
||||
import reborncore.common.registration.RebornRegister;
|
||||
import reborncore.common.registration.config.ConfigRegistry;
|
||||
import reborncore.common.util.RebornInventory;
|
||||
|
@ -45,12 +45,12 @@ import techreborn.TechReborn;
|
|||
import techreborn.api.reactor.FusionReactorRecipe;
|
||||
import techreborn.api.reactor.FusionReactorRecipeHelper;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileFusionControlComputer extends TilePowerAcceptor
|
||||
public class FusionControlComputerBlockEntity extends PowerAcceptorBlockEntity
|
||||
implements IToolDrop, InventoryProvider, IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "machines", category = "fusion_reactor", key = "FusionReactorMaxInput", comment = "Fusion Reactor Max Input (Value in EU)")
|
||||
|
@ -62,7 +62,7 @@ public class TileFusionControlComputer extends TilePowerAcceptor
|
|||
@ConfigRegistry(config = "machines", category = "fusion_reactor", key = "FusionReactorMaxCoilSize", comment = "Fusion Reactor Max Coil size (Radius)")
|
||||
public static int maxCoilSize = 50;
|
||||
|
||||
public RebornInventory<TileFusionControlComputer> inventory;
|
||||
public RebornInventory<FusionControlComputerBlockEntity> inventory;
|
||||
|
||||
public int coilCount = 0;
|
||||
public int crafingTickTime = 0;
|
||||
|
@ -77,10 +77,10 @@ public class TileFusionControlComputer extends TilePowerAcceptor
|
|||
boolean hasStartedCrafting = false;
|
||||
long lastTick = -1;
|
||||
|
||||
public TileFusionControlComputer() {
|
||||
super(TRTileEntities.FUSION_CONTROL_COMPUTER);
|
||||
public FusionControlComputerBlockEntity() {
|
||||
super(TRBlockEntities.FUSION_CONTROL_COMPUTER);
|
||||
checkOverfill = false;
|
||||
this.inventory = new RebornInventory<>(3, "TileFusionControlComputer", 64, this).withConfiguredAccess();
|
||||
this.inventory = new RebornInventory<>(3, "FusionControlComputerBlockEntity", 64, this).withConfiguredAccess();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -373,7 +373,7 @@ public class TileFusionControlComputer extends TilePowerAcceptor
|
|||
|
||||
// ItemHandlerProvider
|
||||
@Override
|
||||
public RebornInventory<TileFusionControlComputer> getInventory() {
|
||||
public RebornInventory<FusionControlComputerBlockEntity> getInventory() {
|
||||
return inventory;
|
||||
}
|
||||
|
||||
|
@ -381,7 +381,7 @@ public class TileFusionControlComputer extends TilePowerAcceptor
|
|||
@Override
|
||||
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
|
||||
return new ContainerBuilder("fusionreactor").player(player.inventory).inventory().hotbar()
|
||||
.addInventory().tile(this).slot(0, 34, 47).slot(1, 126, 47).outputSlot(2, 80, 47).syncEnergyValue()
|
||||
.addInventory().blockEntity(this).slot(0, 34, 47).slot(1, 126, 47).outputSlot(2, 80, 47).syncEnergyValue()
|
||||
.syncIntegerValue(this::getCoilStatus, this::setCoilStatus)
|
||||
.syncIntegerValue(this::getCrafingTickTime, this::setCrafingTickTime)
|
||||
.syncIntegerValue(this::getFinalTickTime, this::setFinalTickTime)
|
|
@ -22,15 +22,15 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.generator;
|
||||
package techreborn.blockentity.generator;
|
||||
|
||||
import net.minecraft.block.entity.BlockEntityType;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import reborncore.api.IToolDrop;
|
||||
import reborncore.api.tile.InventoryProvider;
|
||||
import reborncore.api.blockentity.InventoryProvider;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
|
||||
import reborncore.common.util.RebornInventory;
|
||||
import reborncore.common.util.Tank;
|
||||
import reborncore.fluid.FluidStack;
|
||||
|
@ -42,7 +42,7 @@ import techreborn.utils.FluidUtils;
|
|||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public abstract class TileBaseFluidGenerator extends TilePowerAcceptor implements IToolDrop, InventoryProvider {
|
||||
public abstract class BaseFluidGeneratorBlockEntity extends PowerAcceptorBlockEntity implements IToolDrop, InventoryProvider {
|
||||
|
||||
private final FluidGeneratorRecipeList recipes;
|
||||
private final int euTick;
|
||||
|
@ -59,11 +59,11 @@ public abstract class TileBaseFluidGenerator extends TilePowerAcceptor implement
|
|||
*/
|
||||
double pendingWithdraw = 0.0;
|
||||
|
||||
public TileBaseFluidGenerator(BlockEntityType<?> tileEntityType, EFluidGenerator type, String tileName, int tankCapacity, int euTick) {
|
||||
super(tileEntityType);
|
||||
public BaseFluidGeneratorBlockEntity(BlockEntityType<?> blockEntityType, EFluidGenerator type, String blockEntityName, int tankCapacity, int euTick) {
|
||||
super(blockEntityType);
|
||||
recipes = GeneratorRecipeHelper.getFluidRecipesForGenerator(type);
|
||||
tank = new Tank(tileName, tankCapacity, this);
|
||||
inventory = new RebornInventory<>(3, tileName, 64, this).withConfiguredAccess();
|
||||
tank = new Tank(blockEntityName, tankCapacity, this);
|
||||
inventory = new RebornInventory<>(3, blockEntityName, 64, this).withConfiguredAccess();
|
||||
this.euTick = euTick;
|
||||
this.ticksSinceLastChange = 0;
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ public abstract class TileBaseFluidGenerator extends TilePowerAcceptor implement
|
|||
FluidUtils.drainContainers(tank, inventory, 0, 1);
|
||||
FluidUtils.fillContainers(tank, inventory, 0, 1, tank.getFluidType());
|
||||
}
|
||||
tank.setTileEntity(this);
|
||||
tank.setBlockEntity(this);
|
||||
tank.compareAndUpdate();
|
||||
|
||||
ticksSinceLastChange = 0;
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.generator;
|
||||
package techreborn.blockentity.generator;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.LightningEntity;
|
||||
|
@ -33,15 +33,15 @@ import net.minecraft.util.math.Direction;
|
|||
import net.minecraft.world.Heightmap;
|
||||
import reborncore.api.IToolDrop;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
|
||||
import reborncore.common.registration.RebornRegister;
|
||||
import reborncore.common.registration.config.ConfigRegistry;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileLightningRod extends TilePowerAcceptor implements IToolDrop {
|
||||
public class LightningRodBlockEntity extends PowerAcceptorBlockEntity implements IToolDrop {
|
||||
|
||||
@ConfigRegistry(config = "generators", category = "lightning_rod", key = "LightningRodMaxOutput", comment = "Lightning Rod Max Output (Value in EU)")
|
||||
public static int maxOutput = 2048;
|
||||
|
@ -54,8 +54,8 @@ public class TileLightningRod extends TilePowerAcceptor implements IToolDrop {
|
|||
|
||||
private int onStatusHoldTicks = -1;
|
||||
|
||||
public TileLightningRod() {
|
||||
super(TRTileEntities.LIGHTNING_ROD);
|
||||
public LightningRodBlockEntity() {
|
||||
super(TRBlockEntities.LIGHTNING_ROD);
|
||||
}
|
||||
|
||||
@Override
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.generator;
|
||||
package techreborn.blockentity.generator;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -34,10 +34,10 @@ import reborncore.common.registration.config.ConfigRegistry;
|
|||
import techreborn.TechReborn;
|
||||
import techreborn.api.generator.EFluidGenerator;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TilePlasmaGenerator extends TileBaseFluidGenerator implements IContainerProvider {
|
||||
public class PlasmaGeneratorBlockEntity extends BaseFluidGeneratorBlockEntity implements IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "generators", category = "plasma_generator", key = "PlasmaGeneratorMaxOutput", comment = "Plasma Generator Max Output (Value in EU)")
|
||||
public static int maxOutput = 2048;
|
||||
|
@ -48,8 +48,8 @@ public class TilePlasmaGenerator extends TileBaseFluidGenerator implements ICont
|
|||
@ConfigRegistry(config = "generators", category = "plasma_generator", key = "PlasmaGeneratorEnergyPerTick", comment = "Plasma Generator Energy Per Tick (Value in EU)")
|
||||
public static int energyPerTick = 400;
|
||||
|
||||
public TilePlasmaGenerator() {
|
||||
super(TRTileEntities.PLASMA_GENERATOR, EFluidGenerator.PLASMA, "TilePlasmaGenerator", tankCapacity, energyPerTick);
|
||||
public PlasmaGeneratorBlockEntity() {
|
||||
super(TRBlockEntities.PLASMA_GENERATOR, EFluidGenerator.PLASMA, "PlasmaGeneratorBlockEntity", tankCapacity, energyPerTick);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -70,7 +70,7 @@ public class TilePlasmaGenerator extends TileBaseFluidGenerator implements ICont
|
|||
@Override
|
||||
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
|
||||
return new ContainerBuilder("plasmagenerator").player(player.inventory).inventory().hotbar().addInventory()
|
||||
.tile(this).slot(0, 25, 35).outputSlot(1, 25, 55).syncEnergyValue()
|
||||
.blockEntity(this).slot(0, 25, 35).outputSlot(1, 25, 55).syncEnergyValue()
|
||||
.syncIntegerValue(this::getTicksSinceLastChange, this::setTicksSinceLastChange)
|
||||
.syncIntegerValue(this::getTankAmount, this::setTankAmount)
|
||||
.addInventory().create(this, syncID);
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.generator;
|
||||
package techreborn.blockentity.generator;
|
||||
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.util.Formatting;
|
||||
|
@ -35,23 +35,23 @@ import net.minecraft.util.math.Direction;
|
|||
import reborncore.api.IToolDrop;
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.blocks.generator.BlockSolarPanel;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRContent.SolarPanels;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class TileSolarPanel extends TilePowerAcceptor implements IToolDrop {
|
||||
public class SolarPanelBlockEntity extends PowerAcceptorBlockEntity implements IToolDrop {
|
||||
|
||||
boolean canSeeSky = false;
|
||||
boolean lastState = false;
|
||||
SolarPanels panel;
|
||||
|
||||
public TileSolarPanel() {
|
||||
super(TRTileEntities.SOLAR_PANEL);
|
||||
public SolarPanelBlockEntity() {
|
||||
super(TRBlockEntities.SOLAR_PANEL);
|
||||
}
|
||||
|
||||
public boolean isSunOut() {
|
||||
|
@ -126,7 +126,7 @@ public class TileSolarPanel extends TilePowerAcceptor implements IToolDrop {
|
|||
|
||||
// TODO: Translate
|
||||
@Override
|
||||
public void addInfo(List<Text> info, boolean isRealTile, boolean hasData) {
|
||||
public void addInfo(List<Text> info, boolean isReal, boolean hasData) {
|
||||
info.add(new LiteralText(Formatting.GRAY + "Internal Energy Storage: " + Formatting.GOLD
|
||||
+ PowerSystem.getLocaliszedPowerFormatted((int) getMaxPower())));
|
||||
|
||||
|
@ -143,7 +143,7 @@ public class TileSolarPanel extends TilePowerAcceptor implements IToolDrop {
|
|||
@Override
|
||||
public void fromTag(CompoundTag tag) {
|
||||
if (world == null) {
|
||||
// We are in TileEntity.create method during chunk load.
|
||||
// We are in BlockEntity.create method during chunk load.
|
||||
this.checkOverfill = false;
|
||||
}
|
||||
super.fromTag(tag);
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.generator.advanced;
|
||||
package techreborn.blockentity.generator.advanced;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -34,11 +34,11 @@ import reborncore.common.registration.config.ConfigRegistry;
|
|||
import techreborn.TechReborn;
|
||||
import techreborn.api.generator.EFluidGenerator;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.tiles.generator.TileBaseFluidGenerator;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
import techreborn.blockentity.generator.BaseFluidGeneratorBlockEntity;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileDieselGenerator extends TileBaseFluidGenerator implements IContainerProvider {
|
||||
public class DieselGeneratorBlockEntity extends BaseFluidGeneratorBlockEntity implements IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "generators", category = "diesel_generator", key = "DieselGeneratorMaxOutput", comment = "Diesel Generator Max Output (Value in EU)")
|
||||
public static int maxOutput = 128;
|
||||
|
@ -49,8 +49,8 @@ public class TileDieselGenerator extends TileBaseFluidGenerator implements ICont
|
|||
@ConfigRegistry(config = "generators", category = "diesel_generator", key = "DieselGeneratorEnergyPerTick", comment = "Diesel Generator Energy Per Tick (Value in EU)")
|
||||
public static int energyPerTick = 20;
|
||||
|
||||
public TileDieselGenerator() {
|
||||
super(TRTileEntities.DIESEL_GENERATOR, EFluidGenerator.DIESEL, "TileDieselGenerator", tankCapacity, energyPerTick);
|
||||
public DieselGeneratorBlockEntity() {
|
||||
super(TRBlockEntities.DIESEL_GENERATOR, EFluidGenerator.DIESEL, "DieselGeneratorBlockEntity", tankCapacity, energyPerTick);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -71,7 +71,7 @@ public class TileDieselGenerator extends TileBaseFluidGenerator implements ICont
|
|||
@Override
|
||||
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
|
||||
return new ContainerBuilder("dieselgenerator").player(player.inventory).inventory().hotbar()
|
||||
.addInventory().tile(this).slot(0, 25, 35).outputSlot(1, 25, 55).syncEnergyValue()
|
||||
.addInventory().blockEntity(this).slot(0, 25, 35).outputSlot(1, 25, 55).syncEnergyValue()
|
||||
.syncIntegerValue(this::getTicksSinceLastChange, this::setTicksSinceLastChange)
|
||||
.syncIntegerValue(this::getTankAmount, this::setTankAmount)
|
||||
.addInventory().create(this, syncID);
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.generator.advanced;
|
||||
package techreborn.blockentity.generator.advanced;
|
||||
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
|
@ -30,18 +30,18 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import reborncore.api.IToolDrop;
|
||||
import reborncore.api.tile.InventoryProvider;
|
||||
import reborncore.api.blockentity.InventoryProvider;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
|
||||
import reborncore.common.registration.RebornRegister;
|
||||
import reborncore.common.registration.config.ConfigRegistry;
|
||||
import reborncore.common.util.RebornInventory;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileDragonEggSyphon extends TilePowerAcceptor
|
||||
public class DragonEggSyphonBlockEntity extends PowerAcceptorBlockEntity
|
||||
implements IToolDrop, InventoryProvider {
|
||||
|
||||
@ConfigRegistry(config = "generators", category = "dragon_egg_siphoner", key = "DragonEggSiphonerMaxOutput", comment = "Dragon Egg Siphoner Max Output (Value in EU)")
|
||||
|
@ -51,11 +51,11 @@ public class TileDragonEggSyphon extends TilePowerAcceptor
|
|||
@ConfigRegistry(config = "generators", category = "dragon_egg_siphoner", key = "DragonEggSiphonerEnergyPerTick", comment = "Dragon Egg Siphoner Energy Per Tick (Value in EU)")
|
||||
public static int energyPerTick = 4;
|
||||
|
||||
public RebornInventory<TileDragonEggSyphon> inventory = new RebornInventory<>(3, "TileDragonEggSyphon", 64, this).withConfiguredAccess();
|
||||
public RebornInventory<DragonEggSyphonBlockEntity> inventory = new RebornInventory<>(3, "DragonEggSyphonBlockEntity", 64, this).withConfiguredAccess();
|
||||
private long lastOutput = 0;
|
||||
|
||||
public TileDragonEggSyphon() {
|
||||
super(TRTileEntities.DRAGON_EGG_SYPHON);
|
||||
public DragonEggSyphonBlockEntity() {
|
||||
super(TRBlockEntities.DRAGON_EGG_SYPHON);
|
||||
}
|
||||
|
||||
private boolean tryAddingEnergy(int amount) {
|
||||
|
@ -122,7 +122,7 @@ public class TileDragonEggSyphon extends TilePowerAcceptor
|
|||
|
||||
// ItemHandlerProvider
|
||||
@Override
|
||||
public RebornInventory<TileDragonEggSyphon> getInventory() {
|
||||
public RebornInventory<DragonEggSyphonBlockEntity> getInventory() {
|
||||
return inventory;
|
||||
}
|
||||
}
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.generator.advanced;
|
||||
package techreborn.blockentity.generator.advanced;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -34,11 +34,11 @@ import reborncore.common.registration.config.ConfigRegistry;
|
|||
import techreborn.TechReborn;
|
||||
import techreborn.api.generator.EFluidGenerator;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.tiles.generator.TileBaseFluidGenerator;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
import techreborn.blockentity.generator.BaseFluidGeneratorBlockEntity;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileGasTurbine extends TileBaseFluidGenerator implements IContainerProvider {
|
||||
public class GasTurbineBlockEntity extends BaseFluidGeneratorBlockEntity implements IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "generators", category = "gas_generator", key = "GasGeneratorMaxOutput", comment = "Gas Generator Max Output (Value in EU)")
|
||||
public static int maxOutput = 128;
|
||||
|
@ -49,8 +49,8 @@ public class TileGasTurbine extends TileBaseFluidGenerator implements IContainer
|
|||
@ConfigRegistry(config = "generators", category = "gas_generator", key = "GasGeneratorEnergyPerTick", comment = "Gas Generator Energy Per Tick (Value in EU)")
|
||||
public static int energyPerTick = 16;
|
||||
|
||||
public TileGasTurbine() {
|
||||
super(TRTileEntities.GAS_TURBINE, EFluidGenerator.GAS, "TileGasTurbine", tankCapacity, energyPerTick);
|
||||
public GasTurbineBlockEntity() {
|
||||
super(TRBlockEntities.GAS_TURBINE, EFluidGenerator.GAS, "GasTurbineBlockEntity", tankCapacity, energyPerTick);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -71,7 +71,7 @@ public class TileGasTurbine extends TileBaseFluidGenerator implements IContainer
|
|||
@Override
|
||||
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
|
||||
return new ContainerBuilder("gasturbine").player(player.inventory).inventory().hotbar()
|
||||
.addInventory().tile(this).slot(0, 25, 35).outputSlot(1, 25, 55).syncEnergyValue()
|
||||
.addInventory().blockEntity(this).slot(0, 25, 35).outputSlot(1, 25, 55).syncEnergyValue()
|
||||
.syncIntegerValue(this::getTicksSinceLastChange, this::setTicksSinceLastChange)
|
||||
.syncIntegerValue(this::getTankAmount, this::setTankAmount)
|
||||
.addInventory().create(this, syncID);
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.generator.advanced;
|
||||
package techreborn.blockentity.generator.advanced;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -34,11 +34,11 @@ import reborncore.common.registration.config.ConfigRegistry;
|
|||
import techreborn.TechReborn;
|
||||
import techreborn.api.generator.EFluidGenerator;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.tiles.generator.TileBaseFluidGenerator;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
import techreborn.blockentity.generator.BaseFluidGeneratorBlockEntity;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileSemiFluidGenerator extends TileBaseFluidGenerator implements IContainerProvider {
|
||||
public class SemiFluidGeneratorBlockEntity extends BaseFluidGeneratorBlockEntity implements IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "generators", category = "semifluid_generator", key = "SemifluidGeneratorMaxOutput", comment = "Semifluid Generator Max Output (Value in EU)")
|
||||
public static int maxOutput = 128;
|
||||
|
@ -49,8 +49,8 @@ public class TileSemiFluidGenerator extends TileBaseFluidGenerator implements IC
|
|||
@ConfigRegistry(config = "generators", category = "semifluid_generator", key = "SemifluidGeneratorEnergyPerTick", comment = "Semifluid Generator Energy Per Tick (Value in EU)")
|
||||
public static int energyPerTick = 8;
|
||||
|
||||
public TileSemiFluidGenerator() {
|
||||
super(TRTileEntities.SEMI_FLUID_GENERATOR, EFluidGenerator.SEMIFLUID, "TileSemiFluidGenerator", tankCapacity, energyPerTick);
|
||||
public SemiFluidGeneratorBlockEntity() {
|
||||
super(TRBlockEntities.SEMI_FLUID_GENERATOR, EFluidGenerator.SEMIFLUID, "SemiFluidGeneratorBlockEntity", tankCapacity, energyPerTick);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -71,7 +71,7 @@ public class TileSemiFluidGenerator extends TileBaseFluidGenerator implements IC
|
|||
@Override
|
||||
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
|
||||
return new ContainerBuilder("semifluidgenerator").player(player.inventory).inventory().hotbar()
|
||||
.addInventory().tile(this).slot(0, 25, 35).outputSlot(1, 25, 55).syncEnergyValue()
|
||||
.addInventory().blockEntity(this).slot(0, 25, 35).outputSlot(1, 25, 55).syncEnergyValue()
|
||||
.syncIntegerValue(this::getTicksSinceLastChange, this::setTicksSinceLastChange)
|
||||
.syncIntegerValue(this::getTankAmount, this::setTankAmount)
|
||||
.addInventory().create(this, syncID);
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.generator.advanced;
|
||||
package techreborn.blockentity.generator.advanced;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -34,11 +34,11 @@ import reborncore.common.registration.config.ConfigRegistry;
|
|||
import techreborn.TechReborn;
|
||||
import techreborn.api.generator.EFluidGenerator;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.tiles.generator.TileBaseFluidGenerator;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
import techreborn.blockentity.generator.BaseFluidGeneratorBlockEntity;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileThermalGenerator extends TileBaseFluidGenerator implements IContainerProvider {
|
||||
public class ThermalGeneratorBlockEntity extends BaseFluidGeneratorBlockEntity implements IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "generators", category = "thermal_generator", key = "ThermalGeneratorMaxOutput", comment = "Thermal Generator Max Output (Value in EU)")
|
||||
public static int maxOutput = 128;
|
||||
|
@ -49,8 +49,8 @@ public class TileThermalGenerator extends TileBaseFluidGenerator implements ICon
|
|||
@ConfigRegistry(config = "generators", category = "thermal_generator", key = "ThermalGeneratorEnergyPerTick", comment = "Thermal Generator Energy Per Tick (Value in EU)")
|
||||
public static int energyPerTick = 16;
|
||||
|
||||
public TileThermalGenerator() {
|
||||
super(TRTileEntities.THERMAL_GEN, EFluidGenerator.THERMAL, "TileThermalGenerator", tankCapacity, energyPerTick);
|
||||
public ThermalGeneratorBlockEntity() {
|
||||
super(TRBlockEntities.THERMAL_GEN, EFluidGenerator.THERMAL, "ThermalGeneratorBlockEntity", tankCapacity, energyPerTick);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -71,7 +71,7 @@ public class TileThermalGenerator extends TileBaseFluidGenerator implements ICon
|
|||
@Override
|
||||
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
|
||||
return new ContainerBuilder("thermalgenerator").player(player.inventory).inventory().hotbar()
|
||||
.addInventory().tile(this).slot(0, 25, 35).outputSlot(1, 25, 55).syncEnergyValue()
|
||||
.addInventory().blockEntity(this).slot(0, 25, 35).outputSlot(1, 25, 55).syncEnergyValue()
|
||||
.syncIntegerValue(this::getTicksSinceLastChange, this::setTicksSinceLastChange)
|
||||
.syncIntegerValue(this::getTankAmount, this::setTankAmount)
|
||||
.addInventory().create(this, syncID);
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.generator.basic;
|
||||
package techreborn.blockentity.generator.basic;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.entity.FurnaceBlockEntity;
|
||||
|
@ -32,21 +32,21 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.item.Items;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import reborncore.api.IToolDrop;
|
||||
import reborncore.api.tile.InventoryProvider;
|
||||
import reborncore.api.blockentity.InventoryProvider;
|
||||
import reborncore.client.containerBuilder.IContainerProvider;
|
||||
import reborncore.client.containerBuilder.builder.BuiltContainer;
|
||||
import reborncore.client.containerBuilder.builder.ContainerBuilder;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
|
||||
import reborncore.common.registration.RebornRegister;
|
||||
import reborncore.common.registration.config.ConfigRegistry;
|
||||
import reborncore.common.util.RebornInventory;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileSolidFuelGenerator extends TilePowerAcceptor implements IToolDrop, InventoryProvider, IContainerProvider {
|
||||
public class SolidFuelGeneratorBlockEntity extends PowerAcceptorBlockEntity implements IToolDrop, InventoryProvider, IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "generators", category = "generator", key = "GeneratorMaxOutput", comment = "Solid Fuel Generator Max Output (Value in EU)")
|
||||
public static int maxOutput = 32;
|
||||
|
@ -55,7 +55,7 @@ public class TileSolidFuelGenerator extends TilePowerAcceptor implements IToolDr
|
|||
@ConfigRegistry(config = "generators", category = "generator", key = "GeneratorEnergyOutput", comment = "Solid Fuel Generator Energy Output Amount (Value in EU)")
|
||||
public static int outputAmount = 10;
|
||||
|
||||
public RebornInventory<TileSolidFuelGenerator> inventory = new RebornInventory<>(2, "TileSolidFuelGenerator", 64, this).withConfiguredAccess();
|
||||
public RebornInventory<SolidFuelGeneratorBlockEntity> inventory = new RebornInventory<>(2, "SolidFuelGeneratorBlockEntity", 64, this).withConfiguredAccess();
|
||||
public int fuelSlot = 0;
|
||||
public int burnTime;
|
||||
public int totalBurnTime = 0;
|
||||
|
@ -65,8 +65,8 @@ public class TileSolidFuelGenerator extends TilePowerAcceptor implements IToolDr
|
|||
public boolean lastTickBurning;
|
||||
ItemStack burnItem;
|
||||
|
||||
public TileSolidFuelGenerator() {
|
||||
super(TRTileEntities.SOLID_FUEL_GENEREATOR);
|
||||
public SolidFuelGeneratorBlockEntity() {
|
||||
super(TRBlockEntities.SOLID_FUEL_GENEREATOR);
|
||||
}
|
||||
|
||||
public static int getItemBurnTime(ItemStack stack) {
|
||||
|
@ -82,7 +82,7 @@ public class TileSolidFuelGenerator extends TilePowerAcceptor implements IToolDr
|
|||
if (getEnergy() < getMaxPower()) {
|
||||
if (burnTime > 0) {
|
||||
burnTime--;
|
||||
addEnergy(TileSolidFuelGenerator.outputAmount);
|
||||
addEnergy(SolidFuelGeneratorBlockEntity.outputAmount);
|
||||
isBurning = true;
|
||||
}
|
||||
} else {
|
||||
|
@ -91,7 +91,7 @@ public class TileSolidFuelGenerator extends TilePowerAcceptor implements IToolDr
|
|||
|
||||
if (burnTime == 0) {
|
||||
updateState();
|
||||
burnTime = totalBurnTime = TileSolidFuelGenerator.getItemBurnTime(inventory.getInvStack(fuelSlot));
|
||||
burnTime = totalBurnTime = SolidFuelGeneratorBlockEntity.getItemBurnTime(inventory.getInvStack(fuelSlot));
|
||||
if (burnTime > 0) {
|
||||
updateState();
|
||||
burnItem = inventory.getInvStack(fuelSlot);
|
||||
|
@ -152,7 +152,7 @@ public class TileSolidFuelGenerator extends TilePowerAcceptor implements IToolDr
|
|||
}
|
||||
|
||||
@Override
|
||||
public RebornInventory<TileSolidFuelGenerator> getInventory() {
|
||||
public RebornInventory<SolidFuelGeneratorBlockEntity> getInventory() {
|
||||
return inventory;
|
||||
}
|
||||
|
||||
|
@ -179,7 +179,7 @@ public class TileSolidFuelGenerator extends TilePowerAcceptor implements IToolDr
|
|||
@Override
|
||||
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
|
||||
return new ContainerBuilder("generator").player(player.inventory).inventory().hotbar().addInventory()
|
||||
.tile(this).fuelSlot(0, 80, 54).energySlot(1, 8, 72).syncEnergyValue()
|
||||
.blockEntity(this).fuelSlot(0, 80, 54).energySlot(1, 8, 72).syncEnergyValue()
|
||||
.syncIntegerValue(this::getBurnTime, this::setBurnTime)
|
||||
.syncIntegerValue(this::getTotalBurnTime, this::setTotalBurnTime).addInventory().create(this, syncID);
|
||||
}
|
|
@ -22,27 +22,27 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.generator.basic;
|
||||
package techreborn.blockentity.generator.basic;
|
||||
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import reborncore.api.IToolDrop;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
|
||||
import reborncore.common.registration.RebornRegister;
|
||||
import reborncore.common.registration.config.ConfigRegistry;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.blocks.generator.BlockWindMill;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 25/02/2016.
|
||||
*/
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileWaterMill extends TilePowerAcceptor implements IToolDrop {
|
||||
public class WaterMillBlockEntity extends PowerAcceptorBlockEntity implements IToolDrop {
|
||||
|
||||
@ConfigRegistry(config = "generators", category = "water_mill", key = "WaterMillMaxOutput", comment = "Water Mill Max Output (Value in EU)")
|
||||
public static int maxOutput = 32;
|
||||
|
@ -53,8 +53,8 @@ public class TileWaterMill extends TilePowerAcceptor implements IToolDrop {
|
|||
|
||||
int waterblocks = 0;
|
||||
|
||||
public TileWaterMill() {
|
||||
super(TRTileEntities.WATER_MILL);
|
||||
public WaterMillBlockEntity() {
|
||||
super(TRBlockEntities.WATER_MILL);
|
||||
}
|
||||
|
||||
@Override
|
|
@ -22,25 +22,25 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.generator.basic;
|
||||
package techreborn.blockentity.generator.basic;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import reborncore.api.IToolDrop;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
|
||||
import reborncore.common.registration.RebornRegister;
|
||||
import reborncore.common.registration.config.ConfigRegistry;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 25/02/2016.
|
||||
*/
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileWindMill extends TilePowerAcceptor implements IToolDrop {
|
||||
public class WindMillBlockEntity extends PowerAcceptorBlockEntity implements IToolDrop {
|
||||
|
||||
@ConfigRegistry(config = "generators", category = "wind_mill", key = "WindMillMaxOutput", comment = "Wind Mill Max Output (Value in EU)")
|
||||
public static int maxOutput = 128;
|
||||
|
@ -51,8 +51,8 @@ public class TileWindMill extends TilePowerAcceptor implements IToolDrop {
|
|||
@ConfigRegistry(config = "generators", category = "wind_mill", key = "WindMillThunderMultiplier", comment = "Wind Mill Thunder Multiplier")
|
||||
public static double thunderMultiplier = 1.25;
|
||||
|
||||
public TileWindMill() {
|
||||
super(TRTileEntities.WIND_MILL);
|
||||
public WindMillBlockEntity() {
|
||||
super(TRBlockEntities.WIND_MILL);
|
||||
}
|
||||
|
||||
@Override
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.lighting;
|
||||
package techreborn.blockentity.lighting;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
|
@ -30,17 +30,17 @@ import net.minecraft.entity.player.PlayerEntity;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import reborncore.api.IToolDrop;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
|
||||
import techreborn.blocks.lighting.BlockLamp;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
|
||||
public class TileLamp extends TilePowerAcceptor
|
||||
public class LampBlockEntity extends PowerAcceptorBlockEntity
|
||||
implements IToolDrop {
|
||||
|
||||
private static int capacity = 33;
|
||||
|
||||
public TileLamp() {
|
||||
super(TRTileEntities.LAMP);
|
||||
public LampBlockEntity() {
|
||||
super(TRBlockEntities.LAMP);
|
||||
}
|
||||
|
||||
// TilePowerAcceptor
|
|
@ -22,33 +22,33 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.machine.iron;
|
||||
package techreborn.blockentity.machine.iron;
|
||||
|
||||
import net.minecraft.block.entity.FurnaceBlockEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import reborncore.api.IToolDrop;
|
||||
import reborncore.api.tile.InventoryProvider;
|
||||
import reborncore.api.blockentity.InventoryProvider;
|
||||
import reborncore.client.containerBuilder.IContainerProvider;
|
||||
import reborncore.client.containerBuilder.builder.BuiltContainer;
|
||||
import reborncore.client.containerBuilder.builder.ContainerBuilder;
|
||||
import reborncore.common.crafting.RebornIngredient;
|
||||
import reborncore.common.crafting.RebornRecipe;
|
||||
import reborncore.common.registration.RebornRegister;
|
||||
import reborncore.common.tile.TileMachineBase;
|
||||
import reborncore.common.blockentity.MachineBaseBlockEntity;
|
||||
import reborncore.common.util.RebornInventory;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.init.ModRecipes;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileIronAlloyFurnace extends TileMachineBase
|
||||
public class IronAlloyFurnaceBlockEntity extends MachineBaseBlockEntity
|
||||
implements IToolDrop, InventoryProvider, IContainerProvider {
|
||||
|
||||
public int tickTime;
|
||||
public RebornInventory<TileIronAlloyFurnace> inventory = new RebornInventory<>(4, "TileIronAlloyFurnace", 64, this).withConfiguredAccess();
|
||||
public RebornInventory<IronAlloyFurnaceBlockEntity> inventory = new RebornInventory<>(4, "IronAlloyFurnaceBlockEntity", 64, this).withConfiguredAccess();
|
||||
public int burnTime;
|
||||
public int currentItemBurnTime;
|
||||
public int cookTime;
|
||||
|
@ -57,8 +57,8 @@ public class TileIronAlloyFurnace extends TileMachineBase
|
|||
int output = 2;
|
||||
int fuel = 3;
|
||||
|
||||
public TileIronAlloyFurnace() {
|
||||
super(TRTileEntities.IRON_ALLOY_FURNACE);
|
||||
public IronAlloyFurnaceBlockEntity() {
|
||||
super(TRBlockEntities.IRON_ALLOY_FURNACE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -86,7 +86,7 @@ public class TileIronAlloyFurnace extends TileMachineBase
|
|||
if (!this.world.isClient) {
|
||||
if (this.burnTime != 0 || !inventory.getInvStack(this.input1).isEmpty()&& !inventory.getInvStack(this.fuel).isEmpty()) {
|
||||
if (this.burnTime == 0 && this.canSmelt()) {
|
||||
this.currentItemBurnTime = this.burnTime = TileIronAlloyFurnace.getItemBurnTime(inventory.getInvStack(this.fuel));
|
||||
this.currentItemBurnTime = this.burnTime = IronAlloyFurnaceBlockEntity.getItemBurnTime(inventory.getInvStack(this.fuel));
|
||||
if (this.burnTime > 0) {
|
||||
flag1 = true;
|
||||
if (!inventory.getInvStack(this.fuel).isEmpty()) {
|
||||
|
@ -242,7 +242,7 @@ public class TileIronAlloyFurnace extends TileMachineBase
|
|||
}
|
||||
|
||||
@Override
|
||||
public RebornInventory<TileIronAlloyFurnace> getInventory() {
|
||||
public RebornInventory<IronAlloyFurnaceBlockEntity> getInventory() {
|
||||
return this.inventory;
|
||||
}
|
||||
|
||||
|
@ -274,7 +274,7 @@ public class TileIronAlloyFurnace extends TileMachineBase
|
|||
@Override
|
||||
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
|
||||
return new ContainerBuilder("alloyfurnace").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
||||
.addInventory().tile(this)
|
||||
.addInventory().blockEntity(this)
|
||||
.filterSlot(0, 47, 17,
|
||||
stack -> ModRecipes.ALLOY_SMELTER.getRecipes(player.world).stream().anyMatch(recipe -> recipe.getRebornIngredients().get(0).test(stack)))
|
||||
.filterSlot(1, 65, 17,
|
|
@ -22,30 +22,30 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.machine.iron;
|
||||
package techreborn.blockentity.machine.iron;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.entity.FurnaceBlockEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.recipe.RecipeType;
|
||||
import reborncore.api.tile.InventoryProvider;
|
||||
import reborncore.api.blockentity.InventoryProvider;
|
||||
import reborncore.client.containerBuilder.IContainerProvider;
|
||||
import reborncore.client.containerBuilder.builder.BuiltContainer;
|
||||
import reborncore.client.containerBuilder.builder.ContainerBuilder;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.tile.TileMachineBase;
|
||||
import reborncore.common.blockentity.MachineBaseBlockEntity;
|
||||
import reborncore.common.util.IInventoryAccess;
|
||||
import reborncore.common.util.RebornInventory;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.events.TRRecipeHandler;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
|
||||
public class TileIronFurnace extends TileMachineBase
|
||||
public class IronFurnaceBlockEntity extends MachineBaseBlockEntity
|
||||
implements InventoryProvider, IContainerProvider {
|
||||
|
||||
public int tickTime;
|
||||
public RebornInventory<TileIronFurnace> inventory = new RebornInventory<>(3, "TileIronFurnace", 64, this, getInvetoryAccess());
|
||||
public RebornInventory<IronFurnaceBlockEntity> inventory = new RebornInventory<>(3, "IronFurnaceBlockEntity", 64, this, getInvetoryAccess());
|
||||
public int fuel;
|
||||
public int fuelGague;
|
||||
public int progress;
|
||||
|
@ -55,8 +55,8 @@ public class TileIronFurnace extends TileMachineBase
|
|||
int fuelslot = 2;
|
||||
boolean active = false;
|
||||
|
||||
public TileIronFurnace() {
|
||||
super(TRTileEntities.IRON_FURNACE);
|
||||
public IronFurnaceBlockEntity() {
|
||||
super(TRBlockEntities.IRON_FURNACE);
|
||||
}
|
||||
|
||||
public int gaugeProgressScaled(final int scale) {
|
||||
|
@ -171,21 +171,21 @@ public class TileIronFurnace extends TileMachineBase
|
|||
}
|
||||
|
||||
@Override
|
||||
public RebornInventory<TileIronFurnace> getInventory() {
|
||||
public RebornInventory<IronFurnaceBlockEntity> getInventory() {
|
||||
return this.inventory;
|
||||
}
|
||||
|
||||
public static IInventoryAccess<TileIronFurnace> getInvetoryAccess(){
|
||||
return (slotID, stack, face, direction, tile) -> {
|
||||
public static IInventoryAccess<IronFurnaceBlockEntity> getInvetoryAccess(){
|
||||
return (slotID, stack, face, direction, blockEntity) -> {
|
||||
if(direction == IInventoryAccess.AccessDirection.INSERT){
|
||||
boolean isFuel = FurnaceBlockEntity.canUseAsFuel(stack);
|
||||
if(isFuel){
|
||||
ItemStack fuelSlotStack = tile.inventory.getInvStack(tile.fuelslot);
|
||||
ItemStack fuelSlotStack = blockEntity.inventory.getInvStack(blockEntity.fuelslot);
|
||||
if(fuelSlotStack.isEmpty() || ItemUtils.isItemEqual(stack, fuelSlotStack, true, true) && fuelSlotStack.getMaxCount() != fuelSlotStack.getCount()){
|
||||
return slotID == tile.fuelslot;
|
||||
return slotID == blockEntity.fuelslot;
|
||||
}
|
||||
}
|
||||
return slotID != tile.output;
|
||||
return slotID != blockEntity.output;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
@ -223,7 +223,7 @@ public class TileIronFurnace extends TileMachineBase
|
|||
@Override
|
||||
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
|
||||
return new ContainerBuilder("ironfurnace").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
||||
.addInventory().tile(this).fuelSlot(2, 56, 53).slot(0, 56, 17).outputSlot(1, 116, 35)
|
||||
.addInventory().blockEntity(this).fuelSlot(2, 56, 53).slot(0, 56, 17).outputSlot(1, 116, 35)
|
||||
.syncIntegerValue(this::getBurnTime, this::setBurnTime)
|
||||
.syncIntegerValue(this::getProgress, this::setProgress)
|
||||
.syncIntegerValue(this::getTotalBurnTime, this::setTotalBurnTime).addInventory().create(this, syncID);
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.machine.multiblock;
|
||||
package techreborn.blockentity.machine.multiblock;
|
||||
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
|
@ -37,11 +37,11 @@ import reborncore.common.util.RebornInventory;
|
|||
import techreborn.TechReborn;
|
||||
import techreborn.init.ModRecipes;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.tiles.TileGenericMachine;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
import techreborn.blockentity.GenericMachineBlockEntity;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileDistillationTower extends TileGenericMachine implements IContainerProvider {
|
||||
public class DistillationTowerBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "machines", category = "Distillation_tower", key = "DistillationTowerMaxInput", comment = "Distillation Tower Max Input (Value in EU)")
|
||||
public static int maxInput = 128;
|
||||
|
@ -50,11 +50,11 @@ public class TileDistillationTower extends TileGenericMachine implements IContai
|
|||
|
||||
public MultiblockChecker multiblockChecker;
|
||||
|
||||
public TileDistillationTower() {
|
||||
super(TRTileEntities.DISTILLATION_TOWER,"DistillationTower", maxInput, maxEnergy, TRContent.Machine.DISTILLATION_TOWER.block, 6);
|
||||
public DistillationTowerBlockEntity() {
|
||||
super(TRBlockEntities.DISTILLATION_TOWER, "DistillationTower", maxInput, maxEnergy, TRContent.Machine.DISTILLATION_TOWER.block, 6);
|
||||
final int[] inputs = new int[] { 0, 1 };
|
||||
final int[] outputs = new int[] { 2, 3, 4, 5 };
|
||||
this.inventory = new RebornInventory<>(7, "TileDistillationTower", 64, this).withConfiguredAccess();
|
||||
this.inventory = new RebornInventory<>(7, "DistillationTowerBlockEntity", 64, this).withConfiguredAccess();
|
||||
this.crafter = new RecipeCrafter(ModRecipes.DISTILLATION_TOWER, this, 2, 4, this.inventory, inputs, outputs);
|
||||
}
|
||||
|
||||
|
@ -90,7 +90,7 @@ public class TileDistillationTower extends TileGenericMachine implements IContai
|
|||
@Override
|
||||
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
|
||||
return new ContainerBuilder("Distillationtower").player(player.inventory).inventory().hotbar().addInventory()
|
||||
.tile(this).slot(0, 35, 27).slot(1, 35, 47).outputSlot(2, 79, 37).outputSlot(3, 99, 37)
|
||||
.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);
|
||||
}
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.machine.multiblock;
|
||||
package techreborn.blockentity.machine.multiblock;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
|
@ -39,8 +39,8 @@ import reborncore.common.util.Tank;
|
|||
import techreborn.TechReborn;
|
||||
import techreborn.api.fluidreplicator.FluidReplicatorRecipeCrafter;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.tiles.TileGenericMachine;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
import techreborn.blockentity.GenericMachineBlockEntity;
|
||||
import techreborn.utils.FluidUtils;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
@ -51,7 +51,7 @@ import javax.annotation.Nullable;
|
|||
*/
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileFluidReplicator extends TileGenericMachine implements IContainerProvider {
|
||||
public class FluidReplicatorBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "machines", category = "fluidreplicator", key = "FluidReplicatorMaxInput", comment = "Fluid Replicator Max Input (Value in EU)")
|
||||
public static int maxInput = 256;
|
||||
|
@ -63,12 +63,12 @@ public class TileFluidReplicator extends TileGenericMachine implements IContaine
|
|||
public Tank tank;
|
||||
int ticksSinceLastChange;
|
||||
|
||||
public TileFluidReplicator() {
|
||||
super(TRTileEntities.FLUID_REPLICATOR, "FluidReplicator", maxInput, maxEnergy, TRContent.Machine.FLUID_REPLICATOR.block, 3);
|
||||
public FluidReplicatorBlockEntity() {
|
||||
super(TRBlockEntities.FLUID_REPLICATOR, "FluidReplicator", maxInput, maxEnergy, TRContent.Machine.FLUID_REPLICATOR.block, 3);
|
||||
final int[] inputs = new int[] { 0 };
|
||||
this.inventory = new RebornInventory<>(4, "TileFluidReplicator", 64, this, getInventoryAccess());
|
||||
this.inventory = new RebornInventory<>(4, "FluidReplicatorBlockEntity", 64, this, getInventoryAccess());
|
||||
this.crafter = new FluidReplicatorRecipeCrafter(this, this.inventory, inputs, null);
|
||||
this.tank = new Tank("TileFluidReplicator", TileFluidReplicator.TANK_CAPACITY, this);
|
||||
this.tank = new Tank("FluidReplicatorBlockEntity", FluidReplicatorBlockEntity.TANK_CAPACITY, this);
|
||||
}
|
||||
|
||||
public boolean getMultiBlock() {
|
||||
|
@ -123,8 +123,8 @@ public class TileFluidReplicator extends TileGenericMachine implements IContaine
|
|||
return tagCompound;
|
||||
}
|
||||
|
||||
private static IInventoryAccess<TileFluidReplicator> getInventoryAccess(){
|
||||
return (slotID, stack, face, direction, tile) -> {
|
||||
private static IInventoryAccess<FluidReplicatorBlockEntity> getInventoryAccess(){
|
||||
return (slotID, stack, face, direction, blockEntity) -> {
|
||||
if(slotID == 0){
|
||||
return stack.isItemEqualIgnoreDamage(TRContent.Parts.UU_MATTER.getStack());
|
||||
}
|
||||
|
@ -143,7 +143,7 @@ public class TileFluidReplicator extends TileGenericMachine implements IContaine
|
|||
@Override
|
||||
public BuiltContainer createContainer(int syncID, PlayerEntity player) {
|
||||
return new ContainerBuilder("fluidreplicator").player(player.inventory).inventory().hotbar().addInventory()
|
||||
.tile(this).fluidSlot(1, 124, 35).filterSlot(0, 55, 45, stack -> stack.isItemEqualIgnoreDamage(TRContent.Parts.UU_MATTER.getStack()))
|
||||
.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).syncEnergyValue().syncCrafterValue().addInventory()
|
||||
.create(this, syncID);
|
||||
}
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.machine.multiblock;
|
||||
package techreborn.blockentity.machine.multiblock;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
@ -36,11 +36,11 @@ import reborncore.common.util.RebornInventory;
|
|||
import techreborn.TechReborn;
|
||||
import techreborn.init.ModRecipes;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.tiles.TileGenericMachine;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
import techreborn.blockentity.GenericMachineBlockEntity;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileImplosionCompressor extends TileGenericMachine implements IContainerProvider {
|
||||
public class ImplosionCompressorBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "machines", category = "implosion_compressor", key = "ImplosionCompressorMaxInput", comment = "Implosion Compressor Max Input (Value in EU)")
|
||||
public static int maxInput = 64;
|
||||
|
@ -49,11 +49,11 @@ public class TileImplosionCompressor extends TileGenericMachine implements ICont
|
|||
|
||||
public MultiblockChecker multiblockChecker;
|
||||
|
||||
public TileImplosionCompressor() {
|
||||
super(TRTileEntities.IMPLOSION_COMPRESSOR, "ImplosionCompressor", maxInput, maxEnergy, TRContent.Machine.IMPLOSION_COMPRESSOR.block, 4);
|
||||
public ImplosionCompressorBlockEntity() {
|
||||
super(TRBlockEntities.IMPLOSION_COMPRESSOR, "ImplosionCompressor", maxInput, maxEnergy, TRContent.Machine.IMPLOSION_COMPRESSOR.block, 4);
|
||||
final int[] inputs = new int[] { 0, 1 };
|
||||
final int[] outputs = new int[] { 2, 3 };
|
||||
this.inventory = new RebornInventory<>(5, "TileImplosionCompressor", 64, this);
|
||||
this.inventory = new RebornInventory<>(5, "ImplosionCompressorBlockEntity", 64, this);
|
||||
this.crafter = new RecipeCrafter(ModRecipes.IMPLOSION_COMPRESSOR, this, 2, 2, this.inventory, inputs, outputs);
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,7 @@ public class TileImplosionCompressor extends TileGenericMachine implements ICont
|
|||
@Override
|
||||
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
|
||||
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)
|
||||
.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);
|
||||
}
|
||||
}
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.machine.multiblock;
|
||||
package techreborn.blockentity.machine.multiblock;
|
||||
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
|
@ -41,13 +41,13 @@ import techreborn.TechReborn;
|
|||
import techreborn.blocks.BlockMachineCasing;
|
||||
import techreborn.init.ModRecipes;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
import techreborn.multiblocks.MultiBlockCasing;
|
||||
import techreborn.tiles.TileGenericMachine;
|
||||
import techreborn.tiles.TileMachineCasing;
|
||||
import techreborn.blockentity.GenericMachineBlockEntity;
|
||||
import techreborn.blockentity.MachineCasingBlockEntity;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileIndustrialBlastFurnace extends TileGenericMachine implements IContainerProvider {
|
||||
public class IndustrialBlastFurnaceBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "machines", category = "industrial_furnace", key = "IndustrialFurnaceMaxInput", comment = "Industrial Blast Furnace Max Input (Value in EU)")
|
||||
public static int maxInput = 128;
|
||||
|
@ -57,11 +57,11 @@ public class TileIndustrialBlastFurnace extends TileGenericMachine implements IC
|
|||
public MultiblockChecker multiblockChecker;
|
||||
private int cachedHeat;
|
||||
|
||||
public TileIndustrialBlastFurnace() {
|
||||
super(TRTileEntities.INDUSTRIAL_BLAST_FURNACE, "IndustrialBlastFurnace", maxInput, maxEnergy, TRContent.Machine.INDUSTRIAL_BLAST_FURNACE.block, 4);
|
||||
public IndustrialBlastFurnaceBlockEntity() {
|
||||
super(TRBlockEntities.INDUSTRIAL_BLAST_FURNACE, "IndustrialBlastFurnace", maxInput, maxEnergy, TRContent.Machine.INDUSTRIAL_BLAST_FURNACE.block, 4);
|
||||
final int[] inputs = new int[] { 0, 1 };
|
||||
final int[] outputs = new int[] { 2, 3 };
|
||||
this.inventory = new RebornInventory<>(5, "TileIndustrialBlastFurnace", 64, this).withConfiguredAccess();
|
||||
this.inventory = new RebornInventory<>(5, "IndustrialBlastFurnaceBlockEntity", 64, this).withConfiguredAccess();
|
||||
this.crafter = new RecipeCrafter(ModRecipes.BLAST_FURNACE, this, 2, 2, this.inventory, inputs, outputs);
|
||||
}
|
||||
|
||||
|
@ -72,18 +72,18 @@ public class TileIndustrialBlastFurnace extends TileGenericMachine implements IC
|
|||
|
||||
// Bottom center of multiblock
|
||||
final BlockPos location = pos.offset(getFacing().getOpposite(), 2);
|
||||
final BlockEntity tileEntity = world.getBlockEntity(location);
|
||||
final BlockEntity blockEntity = world.getBlockEntity(location);
|
||||
|
||||
if (tileEntity instanceof TileMachineCasing) {
|
||||
if (((TileMachineCasing) tileEntity).isConnected()
|
||||
&& ((TileMachineCasing) tileEntity).getMultiblockController().isAssembled()) {
|
||||
final MultiBlockCasing casing = ((TileMachineCasing) tileEntity).getMultiblockController();
|
||||
if (blockEntity instanceof MachineCasingBlockEntity) {
|
||||
if (((MachineCasingBlockEntity) blockEntity).isConnected()
|
||||
&& ((MachineCasingBlockEntity) blockEntity).getMultiblockController().isAssembled()) {
|
||||
final MultiBlockCasing casing = ((MachineCasingBlockEntity) blockEntity).getMultiblockController();
|
||||
|
||||
int heat = 0;
|
||||
|
||||
// Bottom center shouldn't have any tile entities below it
|
||||
// Bottom center shouldn't have any blockEntity entities below it
|
||||
if (world.getBlockState(new BlockPos(location.getX(), location.getY() - 1, location.getZ()))
|
||||
.getBlock() == tileEntity.getWorld().getBlockState(tileEntity.getPos()).getBlock()) {
|
||||
.getBlock() == blockEntity.getWorld().getBlockState(blockEntity.getPos()).getBlock()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -91,8 +91,8 @@ public class TileIndustrialBlastFurnace extends TileGenericMachine implements IC
|
|||
heat += BlockMachineCasing.getHeatFromState(part.getCachedState());
|
||||
}
|
||||
|
||||
if (world.getBlockState(location.offset(Direction.UP, 1)).getBlock().getTranslationKey().equals("tile.lava")
|
||||
&& world.getBlockState(location.offset(Direction.UP, 2)).getBlock().getTranslationKey().equals("tile.lava")) {
|
||||
if (world.getBlockState(location.offset(Direction.UP, 1)).getBlock().getTranslationKey().equals("blockEntity.lava")
|
||||
&& world.getBlockState(location.offset(Direction.UP, 2)).getBlock().getTranslationKey().equals("blockEntity.lava")) {
|
||||
heat += 500;
|
||||
}
|
||||
return heat;
|
||||
|
@ -142,7 +142,7 @@ public class TileIndustrialBlastFurnace extends TileGenericMachine implements IC
|
|||
@Override
|
||||
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
|
||||
return new ContainerBuilder("blastfurnace").player(player.inventory).inventory().hotbar().addInventory()
|
||||
.tile(this).slot(0, 50, 27).slot(1, 50, 47).outputSlot(2, 93, 37).outputSlot(3, 113, 37)
|
||||
.blockEntity(this).slot(0, 50, 27).slot(1, 50, 47).outputSlot(2, 93, 37).outputSlot(3, 113, 37)
|
||||
.energySlot(4, 8, 72).syncEnergyValue().syncCrafterValue()
|
||||
.syncIntegerValue(this::getHeat, this::setHeat).addInventory().create(this, syncID);
|
||||
}
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.machine.multiblock;
|
||||
package techreborn.blockentity.machine.multiblock;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.FluidBlock;
|
||||
|
@ -42,14 +42,14 @@ import reborncore.common.util.Tank;
|
|||
import techreborn.TechReborn;
|
||||
import techreborn.init.ModRecipes;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.tiles.TileGenericMachine;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
import techreborn.blockentity.GenericMachineBlockEntity;
|
||||
import techreborn.utils.FluidUtils;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileIndustrialGrinder extends TileGenericMachine implements IContainerProvider{
|
||||
public class IndustrialGrinderBlockEntity extends GenericMachineBlockEntity implements IContainerProvider{
|
||||
|
||||
@ConfigRegistry(config = "machines", category = "industrial_grinder", key = "IndustrialGrinderMaxInput", comment = "Industrial Grinder Max Input (Value in EU)")
|
||||
public static int maxInput = 128;
|
||||
|
@ -61,13 +61,13 @@ public class TileIndustrialGrinder extends TileGenericMachine implements IContai
|
|||
public MultiblockChecker multiblockChecker;
|
||||
int ticksSinceLastChange;
|
||||
|
||||
public TileIndustrialGrinder() {
|
||||
super(TRTileEntities.INDUSTRIAL_GRINDER, "IndustrialGrinder", maxInput, maxEnergy, TRContent.Machine.INDUSTRIAL_GRINDER.block, 7);
|
||||
public IndustrialGrinderBlockEntity() {
|
||||
super(TRBlockEntities.INDUSTRIAL_GRINDER, "IndustrialGrinder", maxInput, maxEnergy, TRContent.Machine.INDUSTRIAL_GRINDER.block, 7);
|
||||
final int[] inputs = new int[] { 0, 1 };
|
||||
final int[] outputs = new int[] {2, 3, 4, 5};
|
||||
this.inventory = new RebornInventory<>(8, "TileIndustrialGrinder", 64, this, getInventoryAccess());
|
||||
this.inventory = new RebornInventory<>(8, "IndustrialGrinderBlockEntity", 64, this, getInventoryAccess());
|
||||
this.crafter = new RecipeCrafter(ModRecipes.INDUSTRIAL_GRINDER, this, 1, 4, this.inventory, inputs, outputs);
|
||||
this.tank = new Tank("TileIndustrialGrinder", TileIndustrialGrinder.TANK_CAPACITY, this);
|
||||
this.tank = new Tank("IndustrialGrinderBlockEntity", IndustrialGrinderBlockEntity.TANK_CAPACITY, this);
|
||||
this.ticksSinceLastChange = 0;
|
||||
}
|
||||
|
||||
|
@ -85,8 +85,8 @@ public class TileIndustrialGrinder extends TileGenericMachine implements IContai
|
|||
return down && center && blade && up;
|
||||
}
|
||||
|
||||
private static IInventoryAccess<TileIndustrialGrinder> getInventoryAccess(){
|
||||
return (slotID, stack, face, direction, tile) -> {
|
||||
private static IInventoryAccess<IndustrialGrinderBlockEntity> getInventoryAccess(){
|
||||
return (slotID, stack, face, direction, blockEntity) -> {
|
||||
if(slotID == 1){
|
||||
//TODO check if the item has fluid in it
|
||||
//return stack.getCapability(CapabilityFluidHandler.FLUID_HANDLER_ITEM_CAPABILITY, null).isPresent();
|
||||
|
@ -145,7 +145,7 @@ public class TileIndustrialGrinder extends TileGenericMachine implements IContai
|
|||
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
|
||||
// fluidSlot first to support automation and shift-click
|
||||
return new ContainerBuilder("industrialgrinder").player(player.inventory).inventory().hotbar().addInventory()
|
||||
.tile(this).fluidSlot(1, 34, 35).slot(0, 84, 43).outputSlot(2, 126, 18).outputSlot(3, 126, 36)
|
||||
.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)
|
||||
.syncEnergyValue().syncCrafterValue().addInventory().create(this, syncID);
|
||||
}
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.machine.multiblock;
|
||||
package techreborn.blockentity.machine.multiblock;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.FluidBlock;
|
||||
|
@ -42,14 +42,14 @@ import reborncore.common.util.Tank;
|
|||
import techreborn.TechReborn;
|
||||
import techreborn.init.ModRecipes;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.tiles.TileGenericMachine;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
import techreborn.blockentity.GenericMachineBlockEntity;
|
||||
import techreborn.utils.FluidUtils;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileIndustrialSawmill extends TileGenericMachine implements IContainerProvider {
|
||||
public class IndustrialSawmillBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "machines", category = "industrial_sawmill", key = "IndustrialSawmillMaxInput", comment = "Industrial Sawmill Max Input (Value in EU)")
|
||||
public static int maxInput = 128;
|
||||
|
@ -61,13 +61,13 @@ public class TileIndustrialSawmill extends TileGenericMachine implements IContai
|
|||
public MultiblockChecker multiblockChecker;
|
||||
int ticksSinceLastChange;
|
||||
|
||||
public TileIndustrialSawmill() {
|
||||
super(TRTileEntities.INDUSTRIAL_SAWMILL, "IndustrialSawmill", maxInput, maxEnergy, TRContent.Machine.INDUSTRIAL_SAWMILL.block, 6);
|
||||
public IndustrialSawmillBlockEntity() {
|
||||
super(TRBlockEntities.INDUSTRIAL_SAWMILL, "IndustrialSawmill", maxInput, maxEnergy, TRContent.Machine.INDUSTRIAL_SAWMILL.block, 6);
|
||||
final int[] inputs = new int[] { 0, 1 };
|
||||
final int[] outputs = new int[] { 2, 3, 4 };
|
||||
this.inventory = new RebornInventory<>(7, "TileSawmill", 64, this, getInventoryAccess());
|
||||
this.inventory = new RebornInventory<>(7, "SawmillBlockEntity", 64, this, getInventoryAccess());
|
||||
this.crafter = new RecipeCrafter(ModRecipes.INDUSTRIAL_SAWMILL, this, 1, 3, this.inventory, inputs, outputs);
|
||||
this.tank = new Tank("TileSawmill", TileIndustrialSawmill.TANK_CAPACITY, this);
|
||||
this.tank = new Tank("SawmillBlockEntity", IndustrialSawmillBlockEntity.TANK_CAPACITY, this);
|
||||
this.ticksSinceLastChange = 0;
|
||||
}
|
||||
|
||||
|
@ -131,8 +131,8 @@ public class TileIndustrialSawmill extends TileGenericMachine implements IContai
|
|||
return tank;
|
||||
}
|
||||
|
||||
private static IInventoryAccess<TileIndustrialSawmill> getInventoryAccess(){
|
||||
return (slotID, stack, face, direction, tile) -> {
|
||||
private static IInventoryAccess<IndustrialSawmillBlockEntity> getInventoryAccess(){
|
||||
return (slotID, stack, face, direction, blockEntity) -> {
|
||||
if(direction == IInventoryAccess.AccessDirection.INSERT){
|
||||
//TODO return if the stack can take fluids
|
||||
//return stack.getCapability(CapabilityFluidHandler.FLUID_HANDLER_ITEM_CAPABILITY, null).isPresent();
|
||||
|
@ -146,7 +146,7 @@ public class TileIndustrialSawmill extends TileGenericMachine implements IContai
|
|||
@Override
|
||||
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
|
||||
return new ContainerBuilder("industrialsawmill").player(player.inventory).inventory().hotbar().addInventory()
|
||||
.tile(this).fluidSlot(1, 34, 35).slot(0, 84, 43).outputSlot(2, 126, 25).outputSlot(3, 126, 43)
|
||||
.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).syncEnergyValue().syncCrafterValue()
|
||||
.addInventory().create(this, syncID);
|
||||
}
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.machine.multiblock;
|
||||
package techreborn.blockentity.machine.multiblock;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.machine.multiblock;
|
||||
package techreborn.blockentity.machine.multiblock;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
@ -36,11 +36,11 @@ import reborncore.common.util.RebornInventory;
|
|||
import techreborn.TechReborn;
|
||||
import techreborn.init.ModRecipes;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.tiles.TileGenericMachine;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
import techreborn.blockentity.GenericMachineBlockEntity;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileVacuumFreezer extends TileGenericMachine implements IContainerProvider {
|
||||
public class VacuumFreezerBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "machines", category = "vacuumfreezer", key = "VacuumFreezerInput", comment = "Vacuum Freezer Max Input (Value in EU)")
|
||||
public static int maxInput = 64;
|
||||
|
@ -49,11 +49,11 @@ public class TileVacuumFreezer extends TileGenericMachine implements IContainerP
|
|||
|
||||
public MultiblockChecker multiblockChecker;
|
||||
|
||||
public TileVacuumFreezer() {
|
||||
super(TRTileEntities.VACUUM_FREEZER, "VacuumFreezer", maxInput, maxEnergy, TRContent.Machine.VACUUM_FREEZER.block, 2);
|
||||
public VacuumFreezerBlockEntity() {
|
||||
super(TRBlockEntities.VACUUM_FREEZER, "VacuumFreezer", maxInput, maxEnergy, TRContent.Machine.VACUUM_FREEZER.block, 2);
|
||||
final int[] inputs = new int[] { 0 };
|
||||
final int[] outputs = new int[] { 1 };
|
||||
this.inventory = new RebornInventory<>(3, "TileVacuumFreezer", 64, this).withConfiguredAccess();
|
||||
this.inventory = new RebornInventory<>(3, "VacuumFreezerBlockEntity", 64, this).withConfiguredAccess();
|
||||
this.crafter = new RecipeCrafter(ModRecipes.VACUUM_FREEZER, this, 2, 1, this.inventory, inputs, outputs);
|
||||
}
|
||||
|
||||
|
@ -75,7 +75,7 @@ public class TileVacuumFreezer extends TileGenericMachine implements IContainerP
|
|||
}
|
||||
}
|
||||
|
||||
// TileEntity
|
||||
// BlockEntity
|
||||
@Override
|
||||
public void validate() {
|
||||
super.validate();
|
||||
|
@ -86,7 +86,7 @@ public class TileVacuumFreezer extends TileGenericMachine implements IContainerP
|
|||
@Override
|
||||
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
|
||||
return new ContainerBuilder("vacuumfreezer").player(player.inventory).inventory().hotbar().addInventory()
|
||||
.tile(this).slot(0, 55, 45).outputSlot(1, 101, 45).energySlot(2, 8, 72).syncEnergyValue()
|
||||
.blockEntity(this).slot(0, 55, 45).outputSlot(1, 101, 45).energySlot(2, 8, 72).syncEnergyValue()
|
||||
.syncCrafterValue().addInventory().create(this, syncID);
|
||||
}
|
||||
}
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.machine.tier1;
|
||||
package techreborn.blockentity.machine.tier1;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.containerBuilder.IContainerProvider;
|
||||
|
@ -35,22 +35,22 @@ import reborncore.common.util.RebornInventory;
|
|||
import techreborn.TechReborn;
|
||||
import techreborn.init.ModRecipes;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.tiles.TileGenericMachine;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
import techreborn.blockentity.GenericMachineBlockEntity;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileAlloySmelter extends TileGenericMachine implements IContainerProvider {
|
||||
public class AlloySmelterBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "machines", category = "alloy_smelter", key = "AlloySmelterMaxInput", comment = "Alloy Smelter Max Input (Value in EU)")
|
||||
public static int maxInput = 32;
|
||||
@ConfigRegistry(config = "machines", category = "alloy_smelter", key = "AlloySmelterMaxEnergy", comment = "Alloy Smelter Max Energy (Value in EU)")
|
||||
public static int maxEnergy = 1_000;
|
||||
|
||||
public TileAlloySmelter() {
|
||||
super(TRTileEntities.ALLOY_SMELTER, "AlloySmelter", maxInput, maxEnergy, TRContent.Machine.ALLOY_SMELTER.block, 3);
|
||||
public AlloySmelterBlockEntity() {
|
||||
super(TRBlockEntities.ALLOY_SMELTER, "AlloySmelter", maxInput, maxEnergy, TRContent.Machine.ALLOY_SMELTER.block, 3);
|
||||
final int[] inputs = new int[] { 0, 1 };
|
||||
final int[] outputs = new int[] { 2 };
|
||||
this.inventory = new RebornInventory<>(4, "TileAlloySmelter", 64, this).withConfiguredAccess();
|
||||
this.inventory = new RebornInventory<>(4, "AlloySmelterBlockEntity", 64, this).withConfiguredAccess();
|
||||
this.crafter = new RecipeCrafter(ModRecipes.ALLOY_SMELTER, this, 2, 1, this.inventory, inputs, outputs);
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ public class TileAlloySmelter extends TileGenericMachine implements IContainerPr
|
|||
@Override
|
||||
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
|
||||
return new ContainerBuilder("alloysmelter").player(player.inventory).inventory().hotbar()
|
||||
.addInventory().tile(this)
|
||||
.addInventory().blockEntity(this)
|
||||
.filterSlot(0, 34, 47,
|
||||
stack -> ModRecipes.ALLOY_SMELTER.getRecipes(player.world).stream().anyMatch(recipe -> recipe.getRebornIngredients().get(0).test(stack)))
|
||||
.filterSlot(1, 126, 47,
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.machine.tier1;
|
||||
package techreborn.blockentity.machine.tier1;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.containerBuilder.IContainerProvider;
|
||||
|
@ -35,22 +35,22 @@ import reborncore.common.util.RebornInventory;
|
|||
import techreborn.TechReborn;
|
||||
import techreborn.init.ModRecipes;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.tiles.TileGenericMachine;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
import techreborn.blockentity.GenericMachineBlockEntity;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileAssemblingMachine extends TileGenericMachine implements IContainerProvider {
|
||||
public class AssemblingMachineBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "machines", category = "assembling_machine", key = "AssemblingMachineMaxInput", comment = "Assembling Machine Max Input (Value in EU)")
|
||||
public static int maxInput = 128;
|
||||
@ConfigRegistry(config = "machines", category = "assembling_machine", key = "AssemblingMachineMaxEnergy", comment = "Assembling Machine Max Energy (Value in EU)")
|
||||
public static int maxEnergy = 10_000;
|
||||
|
||||
public TileAssemblingMachine() {
|
||||
super(TRTileEntities.ASSEMBLY_MACHINE, "AssemblingMachine", maxInput, maxEnergy, TRContent.Machine.ASSEMBLY_MACHINE.block, 3);
|
||||
public AssemblingMachineBlockEntity() {
|
||||
super(TRBlockEntities.ASSEMBLY_MACHINE, "AssemblingMachine", maxInput, maxEnergy, TRContent.Machine.ASSEMBLY_MACHINE.block, 3);
|
||||
final int[] inputs = new int[] { 0, 1 };
|
||||
final int[] outputs = new int[] { 2 };
|
||||
this.inventory = new RebornInventory<>(4, "TileAssemblingMachine", 64, this).withConfiguredAccess();
|
||||
this.inventory = new RebornInventory<>(4, "AssemblingMachineBlockEntity", 64, this).withConfiguredAccess();
|
||||
this.crafter = new RecipeCrafter(ModRecipes.ASSEMBLING_MACHINE, this, 2, 2, this.inventory, inputs, outputs);
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ public class TileAssemblingMachine extends TileGenericMachine implements IContai
|
|||
@Override
|
||||
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
|
||||
return new ContainerBuilder("assemblingmachine").player(player.inventory).inventory().hotbar()
|
||||
.addInventory().tile(this).slot(0, 55, 35).slot(1, 55, 55).outputSlot(2, 101, 45).energySlot(3, 8, 72)
|
||||
.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);
|
||||
}
|
||||
}
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.machine.tier1;
|
||||
package techreborn.blockentity.machine.tier1;
|
||||
|
||||
import net.minecraft.container.Container;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
|
@ -37,11 +37,11 @@ import net.minecraft.util.DefaultedList;
|
|||
import net.minecraft.util.math.Direction;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import reborncore.api.IToolDrop;
|
||||
import reborncore.api.tile.InventoryProvider;
|
||||
import reborncore.api.blockentity.InventoryProvider;
|
||||
import reborncore.client.containerBuilder.IContainerProvider;
|
||||
import reborncore.client.containerBuilder.builder.BuiltContainer;
|
||||
import reborncore.client.containerBuilder.builder.ContainerBuilder;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
|
||||
import reborncore.common.registration.RebornRegister;
|
||||
import reborncore.common.registration.config.ConfigRegistry;
|
||||
import reborncore.common.util.IInventoryAccess;
|
||||
|
@ -51,7 +51,7 @@ import techreborn.TechReborn;
|
|||
import techreborn.events.TRRecipeHandler;
|
||||
import techreborn.init.ModSounds;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
|
@ -61,7 +61,7 @@ import java.util.List;
|
|||
* Created by modmuss50 on 20/06/2017.
|
||||
*/
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileAutoCraftingTable extends TilePowerAcceptor
|
||||
public class AutoCraftingTableBlockEntity extends PowerAcceptorBlockEntity
|
||||
implements IToolDrop, InventoryProvider, IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "machines", category = "autocrafter", key = "AutoCrafterInput", comment = "AutoCrafting Table Max Input (Value in EU)")
|
||||
|
@ -69,7 +69,7 @@ public class TileAutoCraftingTable extends TilePowerAcceptor
|
|||
@ConfigRegistry(config = "machines", category = "autocrafter", key = "AutoCrafterMaxEnergy", comment = "AutoCrafting Table Max Energy (Value in EU)")
|
||||
public static int maxEnergy = 10_000;
|
||||
|
||||
public RebornInventory<TileAutoCraftingTable> inventory = new RebornInventory<>(11, "TileAutoCraftingTable", 64, this, getInventoryAccess());
|
||||
public RebornInventory<AutoCraftingTableBlockEntity> inventory = new RebornInventory<>(11, "AutoCraftingTableBlockEntity", 64, this, getInventoryAccess());
|
||||
public int progress;
|
||||
public int maxProgress = 120;
|
||||
public int euTick = 10;
|
||||
|
@ -80,8 +80,8 @@ public class TileAutoCraftingTable extends TilePowerAcceptor
|
|||
|
||||
public boolean locked = true;
|
||||
|
||||
public TileAutoCraftingTable() {
|
||||
super(TRTileEntities.AUTO_CRAFTING_TABLE);
|
||||
public AutoCraftingTableBlockEntity() {
|
||||
super(TRBlockEntities.AUTO_CRAFTING_TABLE);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
@ -402,14 +402,14 @@ public class TileAutoCraftingTable extends TilePowerAcceptor
|
|||
return false;
|
||||
}
|
||||
|
||||
private static IInventoryAccess<TileAutoCraftingTable> getInventoryAccess(){
|
||||
return (slotID, stack, facing, direction, tile) -> {
|
||||
private static IInventoryAccess<AutoCraftingTableBlockEntity> getInventoryAccess(){
|
||||
return (slotID, stack, facing, direction, blockEntity) -> {
|
||||
switch (direction){
|
||||
case INSERT:
|
||||
if (slotID > 8) {
|
||||
return false;
|
||||
}
|
||||
int bestSlot = tile.findBestSlotForStack(tile.getIRecipe(), stack);
|
||||
int bestSlot = blockEntity.findBestSlotForStack(blockEntity.getIRecipe(), stack);
|
||||
if (bestSlot != -1) {
|
||||
return slotID == bestSlot;
|
||||
}
|
||||
|
@ -443,7 +443,7 @@ public class TileAutoCraftingTable extends TilePowerAcceptor
|
|||
@Override
|
||||
public BuiltContainer createContainer(int syncID, PlayerEntity player) {
|
||||
return new ContainerBuilder("autocraftingtable").player(player.inventory).inventory().hotbar().addInventory()
|
||||
.tile(this).slot(0, 28, 25).slot(1, 46, 25).slot(2, 64, 25).slot(3, 28, 43).slot(4, 46, 43)
|
||||
.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().syncIntegerValue(this::getProgress, this::setProgress)
|
||||
.syncIntegerValue(this::getMaxProgress, this::setMaxProgress)
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.machine.tier1;
|
||||
package techreborn.blockentity.machine.tier1;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.containerBuilder.IContainerProvider;
|
||||
|
@ -35,22 +35,22 @@ import reborncore.common.util.RebornInventory;
|
|||
import techreborn.TechReborn;
|
||||
import techreborn.init.ModRecipes;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.tiles.TileGenericMachine;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
import techreborn.blockentity.GenericMachineBlockEntity;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileChemicalReactor extends TileGenericMachine implements IContainerProvider {
|
||||
public class ChemicalReactorBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "machines", category = "chemical_reactor", key = "ChemicalReactorMaxInput", comment = "Chemical Reactor Max Input (Value in EU)")
|
||||
public static int maxInput = 128;
|
||||
@ConfigRegistry(config = "machines", category = "chemical_reactor", key = "ChemicalReactorMaxEnergy", comment = "Chemical Reactor Max Energy (Value in EU)")
|
||||
public static int maxEnergy = 10_000;
|
||||
|
||||
public TileChemicalReactor() {
|
||||
super(TRTileEntities.CHEMICAL_REACTOR, "ChemicalReactor", maxInput, maxEnergy, TRContent.Machine.CHEMICAL_REACTOR.block, 3);
|
||||
public ChemicalReactorBlockEntity() {
|
||||
super(TRBlockEntities.CHEMICAL_REACTOR, "ChemicalReactor", maxInput, maxEnergy, TRContent.Machine.CHEMICAL_REACTOR.block, 3);
|
||||
final int[] inputs = new int[] { 0, 1 };
|
||||
final int[] outputs = new int[] { 2 };
|
||||
this.inventory = new RebornInventory<>(4, "TileChemicalReactor", 64, this).withConfiguredAccess();
|
||||
this.inventory = new RebornInventory<>(4, "ChemicalReactorBlockEntity", 64, this).withConfiguredAccess();
|
||||
this.crafter = new RecipeCrafter(ModRecipes.CHEMICAL_REACTOR, this, 2, 2, this.inventory, inputs, outputs);
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ public class TileChemicalReactor extends TileGenericMachine implements IContaine
|
|||
@Override
|
||||
public BuiltContainer createContainer(int syncID, final PlayerEntity 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)
|
||||
.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);
|
||||
}
|
||||
}
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.machine.tier1;
|
||||
package techreborn.blockentity.machine.tier1;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.containerBuilder.IContainerProvider;
|
||||
|
@ -35,22 +35,22 @@ import reborncore.common.util.RebornInventory;
|
|||
import techreborn.TechReborn;
|
||||
import techreborn.init.ModRecipes;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.tiles.TileGenericMachine;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
import techreborn.blockentity.GenericMachineBlockEntity;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileCompressor extends TileGenericMachine implements IContainerProvider {
|
||||
public class CompressorBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "machines", category = "compressor", key = "CompressorInput", comment = "Compressor Max Input (Value in EU)")
|
||||
public static int maxInput = 32;
|
||||
@ConfigRegistry(config = "machines", category = "compressor", key = "CompressorMaxEnergy", comment = "Compressor Max Energy (Value in EU)")
|
||||
public static int maxEnergy = 1000;
|
||||
|
||||
public TileCompressor() {
|
||||
super(TRTileEntities.COMPRESSOR, "Compressor", maxInput, maxEnergy, TRContent.Machine.COMPRESSOR.block, 2);
|
||||
public CompressorBlockEntity() {
|
||||
super(TRBlockEntities.COMPRESSOR, "Compressor", maxInput, maxEnergy, TRContent.Machine.COMPRESSOR.block, 2);
|
||||
final int[] inputs = new int[] { 0 };
|
||||
final int[] outputs = new int[] { 1 };
|
||||
this.inventory = new RebornInventory<>(3, "TileCompressor", 64, this).withConfiguredAccess();
|
||||
this.inventory = new RebornInventory<>(3, "CompressorBlockEntity", 64, this).withConfiguredAccess();
|
||||
this.crafter = new RecipeCrafter(ModRecipes.COMPRESSOR, this, 2, 1, this.inventory, inputs, outputs);
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ public class TileCompressor extends TileGenericMachine implements IContainerProv
|
|||
@Override
|
||||
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
|
||||
return new ContainerBuilder("compressor").player(player.inventory).inventory().hotbar().addInventory()
|
||||
.tile(this).slot(0, 55, 45).outputSlot(1, 101, 45).energySlot(2, 8, 72).syncEnergyValue()
|
||||
.blockEntity(this).slot(0, 55, 45).outputSlot(1, 101, 45).energySlot(2, 8, 72).syncEnergyValue()
|
||||
.syncCrafterValue().addInventory().create(this, syncID);
|
||||
}
|
||||
}
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.machine.tier1;
|
||||
package techreborn.blockentity.machine.tier1;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
|
@ -30,22 +30,22 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.recipe.RecipeType;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import reborncore.api.IToolDrop;
|
||||
import reborncore.api.tile.InventoryProvider;
|
||||
import reborncore.api.blockentity.InventoryProvider;
|
||||
import reborncore.client.containerBuilder.IContainerProvider;
|
||||
import reborncore.client.containerBuilder.builder.BuiltContainer;
|
||||
import reborncore.client.containerBuilder.builder.ContainerBuilder;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
|
||||
import reborncore.common.registration.RebornRegister;
|
||||
import reborncore.common.registration.config.ConfigRegistry;
|
||||
import reborncore.common.util.RebornInventory;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.events.TRRecipeHandler;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileElectricFurnace extends TilePowerAcceptor
|
||||
public class ElectricFurnaceBlockEntity extends PowerAcceptorBlockEntity
|
||||
implements IToolDrop, InventoryProvider, IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "machines", category = "electric_furnace", key = "ElectricFurnaceInput", comment = "Electric Furnace Max Input (Value in EU)")
|
||||
|
@ -53,7 +53,7 @@ public class TileElectricFurnace extends TilePowerAcceptor
|
|||
@ConfigRegistry(config = "machines", category = "electric_furnace", key = "ElectricFurnaceMaxEnergy", comment = "Electric Furnace Max Energy (Value in EU)")
|
||||
public static int maxEnergy = 1000;
|
||||
|
||||
public RebornInventory<TileElectricFurnace> inventory = new RebornInventory<>(3, "TileElectricFurnace", 64, this).withConfiguredAccess();
|
||||
public RebornInventory<ElectricFurnaceBlockEntity> inventory = new RebornInventory<>(3, "ElectricFurnaceBlockEntity", 64, this).withConfiguredAccess();
|
||||
public int progress;
|
||||
public int fuelScale = 100;
|
||||
public int cost = 6;
|
||||
|
@ -61,8 +61,8 @@ public class TileElectricFurnace extends TilePowerAcceptor
|
|||
int output = 1;
|
||||
boolean wasBurning = false;
|
||||
|
||||
public TileElectricFurnace() {
|
||||
super(TRTileEntities.ELECTRIC_FURNACE );
|
||||
public ElectricFurnaceBlockEntity() {
|
||||
super(TRBlockEntities.ELECTRIC_FURNACE );
|
||||
}
|
||||
|
||||
public int gaugeProgressScaled(int scale) {
|
||||
|
@ -210,7 +210,7 @@ public class TileElectricFurnace extends TilePowerAcceptor
|
|||
|
||||
// ItemHandlerProvider
|
||||
@Override
|
||||
public RebornInventory<TileElectricFurnace> getInventory() {
|
||||
public RebornInventory<ElectricFurnaceBlockEntity> getInventory() {
|
||||
return inventory;
|
||||
}
|
||||
|
||||
|
@ -218,7 +218,7 @@ public class TileElectricFurnace extends TilePowerAcceptor
|
|||
@Override
|
||||
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
|
||||
return new ContainerBuilder("electricfurnace").player(player.inventory).inventory().hotbar().addInventory()
|
||||
.tile(this).slot(0, 55, 45).outputSlot(1, 101, 45).energySlot(2, 8, 72).syncEnergyValue()
|
||||
.blockEntity(this).slot(0, 55, 45).outputSlot(1, 101, 45).energySlot(2, 8, 72).syncEnergyValue()
|
||||
.syncIntegerValue(this::getBurnTime, this::setBurnTime).addInventory().create(this, syncID);
|
||||
}
|
||||
}
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.machine.tier1;
|
||||
package techreborn.blockentity.machine.tier1;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.containerBuilder.IContainerProvider;
|
||||
|
@ -35,29 +35,29 @@ import reborncore.common.util.RebornInventory;
|
|||
import techreborn.TechReborn;
|
||||
import techreborn.init.ModRecipes;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.tiles.TileGenericMachine;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
import techreborn.blockentity.GenericMachineBlockEntity;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileExtractor extends TileGenericMachine implements IContainerProvider {
|
||||
public class ExtractorBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "machines", category = "extractor", key = "ExtractorInput", comment = "Extractor Max Input (Value in EU)")
|
||||
public static int maxInput = 32;
|
||||
@ConfigRegistry(config = "machines", category = "extractor", key = "ExtractorMaxEnergy", comment = "Extractor Max Energy (Value in EU)")
|
||||
public static int maxEnergy = 1_000;
|
||||
|
||||
public TileExtractor() {
|
||||
super(TRTileEntities.EXTRACTOR, "Extractor", maxInput, maxEnergy, TRContent.Machine.EXTRACTOR.block, 2);
|
||||
public ExtractorBlockEntity() {
|
||||
super(TRBlockEntities.EXTRACTOR, "Extractor", maxInput, maxEnergy, TRContent.Machine.EXTRACTOR.block, 2);
|
||||
final int[] inputs = new int[] { 0 };
|
||||
final int[] outputs = new int[] { 1 };
|
||||
this.inventory = new RebornInventory<>(3, "TileExtractor", 64, this).withConfiguredAccess();
|
||||
this.inventory = new RebornInventory<>(3, "ExtractorBlockEntity", 64, this).withConfiguredAccess();
|
||||
this.crafter = new RecipeCrafter(ModRecipes.EXTRACTOR, this, 2, 1, this.inventory, inputs, outputs);
|
||||
}
|
||||
|
||||
// IContainerProvider
|
||||
@Override
|
||||
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
|
||||
return new ContainerBuilder("extractor").player(player.inventory).inventory().hotbar().addInventory().tile(this)
|
||||
return new ContainerBuilder("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);
|
||||
}
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.machine.tier1;
|
||||
package techreborn.blockentity.machine.tier1;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.containerBuilder.IContainerProvider;
|
||||
|
@ -35,29 +35,29 @@ import reborncore.common.util.RebornInventory;
|
|||
import techreborn.TechReborn;
|
||||
import techreborn.init.ModRecipes;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.tiles.TileGenericMachine;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
import techreborn.blockentity.GenericMachineBlockEntity;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileGrinder extends TileGenericMachine implements IContainerProvider {
|
||||
public class GrinderBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "machines", category = "grinder", key = "GrinderInput", comment = "Grinder Max Input (Value in EU)")
|
||||
public static int maxInput = 32;
|
||||
@ConfigRegistry(config = "machines", category = "grinder", key = "GrinderMaxEnergy", comment = "Grinder Max Energy (Value in EU)")
|
||||
public static int maxEnergy = 1_000;
|
||||
|
||||
public TileGrinder() {
|
||||
super(TRTileEntities.GRINDER, "Grinder", maxInput, maxEnergy, TRContent.Machine.GRINDER.block, 2);
|
||||
public GrinderBlockEntity() {
|
||||
super(TRBlockEntities.GRINDER, "Grinder", maxInput, maxEnergy, TRContent.Machine.GRINDER.block, 2);
|
||||
final int[] inputs = new int[] { 0 };
|
||||
final int[] outputs = new int[] { 1 };
|
||||
this.inventory = new RebornInventory<>(3, "TileGrinder", 64, this).withConfiguredAccess();
|
||||
this.inventory = new RebornInventory<>(3, "GrinderBlockEntity", 64, this).withConfiguredAccess();
|
||||
this.crafter = new RecipeCrafter(ModRecipes.GRINDER, this, 2, 1, this.inventory, inputs, outputs);
|
||||
}
|
||||
|
||||
// IContainerProvider
|
||||
@Override
|
||||
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
|
||||
return new ContainerBuilder("grinder").player(player.inventory).inventory().hotbar().addInventory().tile(this)
|
||||
return new ContainerBuilder("grinder").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);
|
||||
}
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.machine.tier1;
|
||||
package techreborn.blockentity.machine.tier1;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.containerBuilder.IContainerProvider;
|
||||
|
@ -36,23 +36,23 @@ import reborncore.common.util.ItemUtils;
|
|||
import techreborn.TechReborn;
|
||||
import techreborn.init.ModRecipes;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
import techreborn.items.DynamicCell;
|
||||
import techreborn.tiles.TileGenericMachine;
|
||||
import techreborn.blockentity.GenericMachineBlockEntity;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileIndustrialElectrolyzer extends TileGenericMachine implements IContainerProvider {
|
||||
public class IndustrialElectrolyzerBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "machines", category = "industrial_electrolyzer", key = "IndustrialElectrolyzerMaxInput", comment = "Industrial Electrolyzer Max Input (Value in EU)")
|
||||
public static int maxInput = 128;
|
||||
@ConfigRegistry(config = "machines", category = "industrial_electrolyzer", key = "IndustrialElectrolyzerMaxEnergy", comment = "Industrial Electrolyzer Max Energy (Value in EU)")
|
||||
public static int maxEnergy = 10_000;
|
||||
|
||||
public TileIndustrialElectrolyzer() {
|
||||
super(TRTileEntities.INDUSTRIAL_ELECTROLYZER, "IndustrialElectrolyzer", maxInput, maxEnergy, TRContent.Machine.INDUSTRIAL_ELECTROLYZER.block, 6);
|
||||
public IndustrialElectrolyzerBlockEntity() {
|
||||
super(TRBlockEntities.INDUSTRIAL_ELECTROLYZER, "IndustrialElectrolyzer", maxInput, maxEnergy, TRContent.Machine.INDUSTRIAL_ELECTROLYZER.block, 6);
|
||||
final int[] inputs = new int[] { 0, 1 };
|
||||
final int[] outputs = new int[] { 2, 3, 4, 5 };
|
||||
this.inventory = new RebornInventory<>(7, "TileIndustrialElectrolyzer", 64, this).withConfiguredAccess();
|
||||
this.inventory = new RebornInventory<>(7, "IndustrialElectrolyzerBlockEntity", 64, this).withConfiguredAccess();
|
||||
this.crafter = new RecipeCrafter(ModRecipes.INDUSTRIAL_ELECTROLYZER, this, 2, 4, this.inventory, inputs, outputs);
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,7 @@ public class TileIndustrialElectrolyzer extends TileGenericMachine implements IC
|
|||
@Override
|
||||
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
|
||||
return new ContainerBuilder("industrialelectrolyzer").player(player.inventory).inventory().hotbar()
|
||||
.addInventory().tile(this)
|
||||
.addInventory().blockEntity(this)
|
||||
.filterSlot(1, 47, 72, stack -> ItemUtils.isItemEqual(stack, DynamicCell.getEmptyCell(1), true, true))
|
||||
.filterSlot(0, 81, 72, stack -> !ItemUtils.isItemEqual(stack, DynamicCell.getEmptyCell(1), true, true))
|
||||
.outputSlot(2, 51, 24).outputSlot(3, 71, 24).outputSlot(4, 91, 24).outputSlot(5, 111, 24)
|
|
@ -22,14 +22,14 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.machine.tier1;
|
||||
package techreborn.blockentity.machine.tier1;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import reborncore.api.IToolDrop;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
|
||||
import reborncore.common.registration.RebornRegister;
|
||||
import reborncore.common.registration.config.ConfigRegistry;
|
||||
import reborncore.common.util.WorldUtils;
|
||||
|
@ -37,10 +37,10 @@ import techreborn.TechReborn;
|
|||
import techreborn.blocks.tier1.BlockPlayerDetector;
|
||||
import techreborn.blocks.tier1.BlockPlayerDetector.PlayerDetectorType;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TilePlayerDectector extends TilePowerAcceptor implements IToolDrop {
|
||||
public class PlayerDectectorBlockEntity extends PowerAcceptorBlockEntity implements IToolDrop {
|
||||
|
||||
@ConfigRegistry(config = "machines", category = "player_detector", key = "PlayerDetectorMaxInput", comment = "Player Detector Max Input (Value in EU)")
|
||||
public static int maxInput = 32;
|
||||
|
@ -52,8 +52,8 @@ public class TilePlayerDectector extends TilePowerAcceptor implements IToolDrop
|
|||
public String owenerUdid = "";
|
||||
boolean redstone = false;
|
||||
|
||||
public TilePlayerDectector() {
|
||||
super(TRTileEntities.PLAYER_DETECTOR);
|
||||
public PlayerDectectorBlockEntity() {
|
||||
super(TRBlockEntities.PLAYER_DETECTOR);
|
||||
}
|
||||
|
||||
public boolean isProvidingPower() {
|
|
@ -22,29 +22,29 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.machine.tier1;
|
||||
package techreborn.blockentity.machine.tier1;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import reborncore.api.IToolDrop;
|
||||
import reborncore.api.tile.IUpgrade;
|
||||
import reborncore.api.tile.InventoryProvider;
|
||||
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.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
|
||||
import reborncore.common.registration.RebornRegister;
|
||||
import reborncore.common.registration.config.ConfigRegistry;
|
||||
import reborncore.common.util.RebornInventory;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileRecycler extends TilePowerAcceptor
|
||||
public class RecyclerBlockEntity extends PowerAcceptorBlockEntity
|
||||
implements IToolDrop, InventoryProvider, IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "machines", category = "recycler", key = "RecyclerInput", comment = "Recycler Max Input (Value in EU)")
|
||||
|
@ -54,15 +54,15 @@ public class TileRecycler extends TilePowerAcceptor
|
|||
@ConfigRegistry(config = "machines", category = "recycler", key = "produceIC2Scrap", comment = "When enabled and when ic2 is installed the recycler will make ic2 scrap")
|
||||
public static boolean produceIC2Scrap = false;
|
||||
|
||||
private final RebornInventory<TileRecycler> inventory = new RebornInventory<>(3, "TileRecycler", 64, this).withConfiguredAccess();
|
||||
private final RebornInventory<RecyclerBlockEntity> inventory = new RebornInventory<>(3, "RecyclerBlockEntity", 64, this).withConfiguredAccess();
|
||||
private final int cost = 2;
|
||||
private final int time = 15;
|
||||
private final int chance = 6;
|
||||
private boolean isBurning;
|
||||
private int progress;
|
||||
|
||||
public TileRecycler() {
|
||||
super(TRTileEntities.RECYCLER);
|
||||
public RecyclerBlockEntity() {
|
||||
super(TRBlockEntities.RECYCLER);
|
||||
}
|
||||
|
||||
public int gaugeProgressScaled(int scale) {
|
||||
|
@ -196,7 +196,7 @@ public class TileRecycler extends TilePowerAcceptor
|
|||
|
||||
// ItemHandlerProvider
|
||||
@Override
|
||||
public RebornInventory<TileRecycler> getInventory() {
|
||||
public RebornInventory<RecyclerBlockEntity> getInventory() {
|
||||
return this.inventory;
|
||||
}
|
||||
|
||||
|
@ -204,7 +204,7 @@ public class TileRecycler extends TilePowerAcceptor
|
|||
@Override
|
||||
public BuiltContainer createContainer(int syncID, PlayerEntity player) {
|
||||
return new ContainerBuilder("recycler").player(player.inventory).inventory().hotbar().addInventory()
|
||||
.tile(this).slot(0, 55, 45, itemStack -> itemStack.getItem() instanceof IUpgrade).outputSlot(1, 101, 45).energySlot(2, 8, 72).syncEnergyValue()
|
||||
.blockEntity(this).slot(0, 55, 45, itemStack -> itemStack.getItem() instanceof IUpgrade).outputSlot(1, 101, 45).energySlot(2, 8, 72).syncEnergyValue()
|
||||
.syncIntegerValue(this::getProgress, this::setProgress).addInventory().create(this, syncID);
|
||||
}
|
||||
}
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.machine.tier1;
|
||||
package techreborn.blockentity.machine.tier1;
|
||||
|
||||
import net.minecraft.container.Container;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
|
@ -34,12 +34,12 @@ import net.minecraft.recipe.Recipe;
|
|||
import net.minecraft.util.math.Direction;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import reborncore.api.IToolDrop;
|
||||
import reborncore.api.tile.InventoryProvider;
|
||||
import reborncore.api.blockentity.InventoryProvider;
|
||||
import reborncore.client.containerBuilder.IContainerProvider;
|
||||
import reborncore.client.containerBuilder.builder.BuiltContainer;
|
||||
import reborncore.client.containerBuilder.builder.ContainerBuilder;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
|
||||
import reborncore.common.registration.RebornRegister;
|
||||
import reborncore.common.registration.config.ConfigRegistry;
|
||||
import reborncore.common.util.RebornInventory;
|
||||
|
@ -47,7 +47,7 @@ import reborncore.common.util.ItemUtils;
|
|||
import techreborn.TechReborn;
|
||||
import techreborn.api.RollingMachineRecipe;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
|
@ -59,7 +59,7 @@ import java.util.stream.Collectors;
|
|||
//TODO add tick and power bars.
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileRollingMachine extends TilePowerAcceptor
|
||||
public class RollingMachineBlockEntity extends PowerAcceptorBlockEntity
|
||||
implements IToolDrop, InventoryProvider, IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "machines", category = "rolling_machine", key = "RollingMachineMaxInput", comment = "Rolling Machine Max Input (Value in EU)")
|
||||
|
@ -73,7 +73,7 @@ public class TileRollingMachine extends TilePowerAcceptor
|
|||
|
||||
public int[] craftingSlots = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8 };
|
||||
private CraftingInventory craftCache;
|
||||
public RebornInventory<TileRollingMachine> inventory = new RebornInventory<>(12, "TileRollingMachine", 64, this).withConfiguredAccess();
|
||||
public RebornInventory<RollingMachineBlockEntity> inventory = new RebornInventory<>(12, "RollingMachineBlockEntity", 64, this).withConfiguredAccess();
|
||||
public boolean isRunning;
|
||||
public int tickTime;
|
||||
@Nonnull
|
||||
|
@ -83,8 +83,8 @@ public class TileRollingMachine extends TilePowerAcceptor
|
|||
public boolean locked = false;
|
||||
public int balanceSlot = 0;
|
||||
|
||||
public TileRollingMachine() {
|
||||
super(TRTileEntities.ROLLING_MACHINE);
|
||||
public RollingMachineBlockEntity() {
|
||||
super(TRBlockEntities.ROLLING_MACHINE);
|
||||
outputSlot = 9;
|
||||
}
|
||||
|
||||
|
@ -301,7 +301,7 @@ public class TileRollingMachine extends TilePowerAcceptor
|
|||
|
||||
private CraftingInventory getCraftingMatrix() {
|
||||
if (craftCache == null) {
|
||||
craftCache = new CraftingInventory(new RollingTileContainer(), 3, 3);
|
||||
craftCache = new CraftingInventory(new RollingBEContainer(), 3, 3);
|
||||
}
|
||||
if (inventory.hasChanged()) {
|
||||
for (int i = 0; i < 9; i++) {
|
||||
|
@ -355,7 +355,7 @@ public class TileRollingMachine extends TilePowerAcceptor
|
|||
}
|
||||
|
||||
@Override
|
||||
public RebornInventory<TileRollingMachine> getInventory() {
|
||||
public RebornInventory<RollingMachineBlockEntity> getInventory() {
|
||||
return inventory;
|
||||
}
|
||||
|
||||
|
@ -378,7 +378,7 @@ public class TileRollingMachine extends TilePowerAcceptor
|
|||
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
|
||||
return new ContainerBuilder("rollingmachine").player(player.inventory)
|
||||
.inventory().hotbar()
|
||||
.addInventory().tile(this)
|
||||
.addInventory().blockEntity(this)
|
||||
.slot(0, 30, 22).slot(1, 48, 22).slot(2, 66, 22)
|
||||
.slot(3, 30, 40).slot(4, 48, 40).slot(5, 66, 40)
|
||||
.slot(6, 30, 58).slot(7, 48, 58).slot(8, 66, 58)
|
||||
|
@ -404,9 +404,9 @@ public class TileRollingMachine extends TilePowerAcceptor
|
|||
return 0;
|
||||
}
|
||||
|
||||
private static class RollingTileContainer extends Container {
|
||||
private static class RollingBEContainer extends Container {
|
||||
|
||||
protected RollingTileContainer() {
|
||||
protected RollingBEContainer() {
|
||||
super(null, 0);
|
||||
}
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.machine.tier1;
|
||||
package techreborn.blockentity.machine.tier1;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.containerBuilder.IContainerProvider;
|
||||
|
@ -34,22 +34,22 @@ import reborncore.common.util.RebornInventory;
|
|||
import techreborn.TechReborn;
|
||||
import techreborn.api.recipe.ScrapboxRecipeCrafter;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.tiles.TileGenericMachine;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
import techreborn.blockentity.GenericMachineBlockEntity;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileScrapboxinator extends TileGenericMachine implements IContainerProvider {
|
||||
public class ScrapboxinatorBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "machines", category = "scrapboxinator", key = "ScrapboxinatorMaxInput", comment = "Scrapboxinator Max Input (Value in EU)")
|
||||
public static int maxInput = 32;
|
||||
@ConfigRegistry(config = "machines", category = "scrapboxinator", key = "ScrapboxinatorMaxEnergy", comment = "Scrapboxinator Max Energy (Value in EU)")
|
||||
public static int maxEnergy = 1_000;
|
||||
|
||||
public TileScrapboxinator() {
|
||||
super(TRTileEntities.SCRAPBOXINATOR, "Scrapboxinator", maxInput, maxEnergy, TRContent.Machine.SCRAPBOXINATOR.block, 2);
|
||||
public ScrapboxinatorBlockEntity() {
|
||||
super(TRBlockEntities.SCRAPBOXINATOR, "Scrapboxinator", maxInput, maxEnergy, TRContent.Machine.SCRAPBOXINATOR.block, 2);
|
||||
final int[] inputs = new int[] { 0 };
|
||||
final int[] outputs = new int[] { 1 };
|
||||
this.inventory = new RebornInventory<>(3, "TileScrapboxinator", 64, this).withConfiguredAccess();
|
||||
this.inventory = new RebornInventory<>(3, "ScrapboxinatorBlockEntity", 64, this).withConfiguredAccess();
|
||||
this.crafter = new ScrapboxRecipeCrafter(this, this.inventory, inputs, outputs);
|
||||
}
|
||||
|
||||
|
@ -63,7 +63,7 @@ public class TileScrapboxinator extends TileGenericMachine implements IContainer
|
|||
@Override
|
||||
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
|
||||
return new ContainerBuilder("scrapboxinator").player(player.inventory).inventory().hotbar().addInventory()
|
||||
.tile(this).filterSlot(0, 55, 45, stack -> stack.getItem() == TRContent.SCRAP_BOX).outputSlot(1, 101, 45)
|
||||
.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);
|
||||
}
|
||||
}
|
|
@ -22,26 +22,26 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.machine.tier3;
|
||||
package techreborn.blockentity.machine.tier3;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import reborncore.api.IToolDrop;
|
||||
import reborncore.api.tile.InventoryProvider;
|
||||
import reborncore.api.blockentity.InventoryProvider;
|
||||
import reborncore.client.containerBuilder.IContainerProvider;
|
||||
import reborncore.client.containerBuilder.builder.BuiltContainer;
|
||||
import reborncore.client.containerBuilder.builder.ContainerBuilder;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
|
||||
import reborncore.common.registration.RebornRegister;
|
||||
import reborncore.common.registration.config.ConfigRegistry;
|
||||
import reborncore.common.util.RebornInventory;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileChunkLoader extends TilePowerAcceptor implements IToolDrop, InventoryProvider, IContainerProvider {
|
||||
public class ChunkLoaderBlockEntity extends PowerAcceptorBlockEntity implements IToolDrop, InventoryProvider, IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "machines", category = "chunk_loader", key = "ChunkLoaderMaxInput", comment = "Chunk Loader Max Input (Value in EU)")
|
||||
public static int maxInput = 32;
|
||||
|
@ -50,13 +50,13 @@ public class TileChunkLoader extends TilePowerAcceptor implements IToolDrop, Inv
|
|||
// @ConfigRegistry(config = "machines", category = "chunk_loader", key = "ChunkLoaderWrenchDropRate", comment = "Chunk Loader Wrench Drop Rate")
|
||||
public static float wrenchDropRate = 1.0F;
|
||||
|
||||
public RebornInventory<TileChunkLoader> inventory = new RebornInventory<>(1, "TileChunkLoader", 64, this).withConfiguredAccess();
|
||||
public RebornInventory<ChunkLoaderBlockEntity> inventory = new RebornInventory<>(1, "ChunkLoaderBlockEntity", 64, this).withConfiguredAccess();
|
||||
|
||||
public boolean isRunning;
|
||||
public int tickTime;
|
||||
|
||||
public TileChunkLoader() {
|
||||
super(TRTileEntities.CHUNK_LOADER );
|
||||
public ChunkLoaderBlockEntity() {
|
||||
super(TRBlockEntities.CHUNK_LOADER );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -94,7 +94,7 @@ public class TileChunkLoader extends TilePowerAcceptor implements IToolDrop, Inv
|
|||
}
|
||||
|
||||
@Override
|
||||
public RebornInventory<TileChunkLoader> getInventory() {
|
||||
public RebornInventory<ChunkLoaderBlockEntity> getInventory() {
|
||||
return this.inventory;
|
||||
}
|
||||
|
|
@ -22,15 +22,15 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.machine.tier3;
|
||||
package techreborn.blockentity.machine.tier3;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
|
||||
public class TileCreativeQuantumChest extends TileQuantumChest {
|
||||
public class CreativeQuantumChestBlockEntity extends QuantumChestBlockEntity {
|
||||
|
||||
public TileCreativeQuantumChest() {
|
||||
super(TRTileEntities.CREATIVE_QUANTUM_CHEST);
|
||||
public CreativeQuantumChestBlockEntity() {
|
||||
super(TRBlockEntities.CREATIVE_QUANTUM_CHEST);
|
||||
}
|
||||
|
||||
@Override
|
|
@ -22,14 +22,14 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.machine.tier3;
|
||||
package techreborn.blockentity.machine.tier3;
|
||||
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
|
||||
public class TileCreativeQuantumTank extends TileQuantumTank {
|
||||
public class CreativeQuantumTankBlockEntity extends QuantumTankBlockEntity {
|
||||
|
||||
public TileCreativeQuantumTank() {
|
||||
super(TRTileEntities.CREATIVE_QUANTUM_TANK);
|
||||
public CreativeQuantumTankBlockEntity() {
|
||||
super(TRBlockEntities.CREATIVE_QUANTUM_TANK);
|
||||
}
|
||||
|
||||
@Override
|
|
@ -22,27 +22,27 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.machine.tier3;
|
||||
package techreborn.blockentity.machine.tier3;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import reborncore.api.IToolDrop;
|
||||
import reborncore.api.tile.InventoryProvider;
|
||||
import reborncore.api.blockentity.InventoryProvider;
|
||||
import reborncore.client.containerBuilder.IContainerProvider;
|
||||
import reborncore.client.containerBuilder.builder.BuiltContainer;
|
||||
import reborncore.client.containerBuilder.builder.ContainerBuilder;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
|
||||
import reborncore.common.registration.RebornRegister;
|
||||
import reborncore.common.registration.config.ConfigRegistry;
|
||||
import reborncore.common.util.RebornInventory;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileMatterFabricator extends TilePowerAcceptor
|
||||
public class MatterFabricatorBlockEntity extends PowerAcceptorBlockEntity
|
||||
implements IToolDrop, InventoryProvider, IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "machines", category = "matter_fabricator", key = "MatterFabricatorMaxInput", comment = "Matter Fabricator Max Input (Value in EU)")
|
||||
|
@ -54,11 +54,11 @@ public class TileMatterFabricator extends TilePowerAcceptor
|
|||
@ConfigRegistry(config = "machines", category = "matter_fabricator", key = "MatterFabricatorEnergyPerAmp", comment = "Matter Fabricator EU per amplifier unit, multiply this with the rate for total EU")
|
||||
public static int energyPerAmp = 5;
|
||||
|
||||
public RebornInventory<TileMatterFabricator> inventory = new RebornInventory<>(12, "TileMatterFabricator", 64, this).withConfiguredAccess();
|
||||
public RebornInventory<MatterFabricatorBlockEntity> inventory = new RebornInventory<>(12, "MatterFabricatorBlockEntity", 64, this).withConfiguredAccess();
|
||||
private int amplifier = 0;
|
||||
|
||||
public TileMatterFabricator() {
|
||||
super(TRTileEntities.MATTER_FABRICATOR );
|
||||
public MatterFabricatorBlockEntity() {
|
||||
super(TRBlockEntities.MATTER_FABRICATOR );
|
||||
}
|
||||
|
||||
private boolean spaceForOutput() {
|
||||
|
@ -202,7 +202,7 @@ public class TileMatterFabricator extends TilePowerAcceptor
|
|||
|
||||
// ItemHandlerProvider
|
||||
@Override
|
||||
public RebornInventory<TileMatterFabricator> getInventory() {
|
||||
public RebornInventory<MatterFabricatorBlockEntity> getInventory() {
|
||||
return inventory;
|
||||
}
|
||||
|
||||
|
@ -210,7 +210,7 @@ public class TileMatterFabricator extends TilePowerAcceptor
|
|||
@Override
|
||||
public BuiltContainer createContainer(int syncID, PlayerEntity player) {
|
||||
return new ContainerBuilder("matterfabricator").player(player.inventory).inventory().hotbar().addInventory()
|
||||
.tile(this).slot(0, 30, 20).slot(1, 50, 20).slot(2, 70, 20).slot(3, 90, 20).slot(4, 110, 20)
|
||||
.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()
|
||||
.syncIntegerValue(this::getProgress, this::setProgress).addInventory().create(this, syncID);
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.machine.tier3;
|
||||
package techreborn.blockentity.machine.tier3;
|
||||
|
||||
import net.minecraft.block.entity.BlockEntityType;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
|
@ -32,27 +32,27 @@ import reborncore.client.containerBuilder.builder.ContainerBuilder;
|
|||
import reborncore.common.registration.RebornRegister;
|
||||
import reborncore.common.registration.config.ConfigRegistry;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.tiles.TileTechStorageBase;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
import techreborn.blockentity.TechStorageBaseBlockEntity;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileQuantumChest extends TileTechStorageBase implements IContainerProvider {
|
||||
public class QuantumChestBlockEntity extends TechStorageBaseBlockEntity implements IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "machines", category = "quantum_chest", key = "QuantumChestMaxStorage", comment = "Maximum amount of items a Quantum Chest can store")
|
||||
public static int maxStorage = Integer.MAX_VALUE;
|
||||
|
||||
public TileQuantumChest() {
|
||||
this(TRTileEntities.QUANTUM_CHEST);
|
||||
public QuantumChestBlockEntity() {
|
||||
this(TRBlockEntities.QUANTUM_CHEST);
|
||||
}
|
||||
|
||||
public TileQuantumChest(BlockEntityType<?> tileEntityType) {
|
||||
super(tileEntityType, "TileQuantumChest", maxStorage);
|
||||
public QuantumChestBlockEntity(BlockEntityType<?> blockEntityType) {
|
||||
super(blockEntityType, "QuantumChestBlockEntity", maxStorage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
|
||||
return new ContainerBuilder("quantumchest").player(player.inventory).inventory().hotbar().addInventory()
|
||||
.tile(this).slot(0, 80, 24).outputSlot(1, 80, 64).addInventory().create(this, syncID);
|
||||
.blockEntity(this).slot(0, 80, 24).outputSlot(1, 80, 64).addInventory().create(this, syncID);
|
||||
}
|
||||
|
||||
}
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.machine.tier3;
|
||||
package techreborn.blockentity.machine.tier3;
|
||||
|
||||
import net.minecraft.block.entity.BlockEntityType;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
|
@ -32,38 +32,38 @@ import net.minecraft.text.LiteralText;
|
|||
import net.minecraft.text.Text;
|
||||
import reborncore.api.IListInfoProvider;
|
||||
import reborncore.api.IToolDrop;
|
||||
import reborncore.api.tile.InventoryProvider;
|
||||
import reborncore.api.blockentity.InventoryProvider;
|
||||
import reborncore.client.containerBuilder.IContainerProvider;
|
||||
import reborncore.client.containerBuilder.builder.BuiltContainer;
|
||||
import reborncore.client.containerBuilder.builder.ContainerBuilder;
|
||||
import reborncore.common.registration.RebornRegister;
|
||||
import reborncore.common.registration.config.ConfigRegistry;
|
||||
import reborncore.common.tile.TileMachineBase;
|
||||
import reborncore.common.blockentity.MachineBaseBlockEntity;
|
||||
import reborncore.common.util.RebornInventory;
|
||||
import reborncore.common.util.Tank;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileQuantumTank extends TileMachineBase
|
||||
public class QuantumTankBlockEntity extends MachineBaseBlockEntity
|
||||
implements InventoryProvider, IToolDrop, IListInfoProvider, IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "machines", category = "quantum_tank", key = "QuantumTankMaxStorage", comment = "Maximum amount of millibuckets a Quantum Tank can store")
|
||||
public static int maxStorage = Integer.MAX_VALUE;
|
||||
|
||||
public Tank tank = new Tank("TileQuantumTank", maxStorage, this);
|
||||
public RebornInventory<TileQuantumTank> inventory = new RebornInventory<>(3, "TileQuantumTank", 64, this).withConfiguredAccess();
|
||||
public Tank tank = new Tank("QuantumTankBlockEntity", maxStorage, this);
|
||||
public RebornInventory<QuantumTankBlockEntity> inventory = new RebornInventory<>(3, "QuantumTankBlockEntity", 64, this).withConfiguredAccess();
|
||||
|
||||
public TileQuantumTank(){
|
||||
this(TRTileEntities.QUANTUM_TANK);
|
||||
public QuantumTankBlockEntity(){
|
||||
this(TRBlockEntities.QUANTUM_TANK);
|
||||
}
|
||||
|
||||
public TileQuantumTank(BlockEntityType<?> tileEntityTypeIn) {
|
||||
super(tileEntityTypeIn);
|
||||
public QuantumTankBlockEntity(BlockEntityType<?> blockEntityTypeIn) {
|
||||
super(blockEntityTypeIn);
|
||||
}
|
||||
|
||||
public void readWithoutCoords(final CompoundTag tagCompound) {
|
||||
|
@ -76,11 +76,11 @@ public class TileQuantumTank extends TileMachineBase
|
|||
}
|
||||
|
||||
public ItemStack getDropWithNBT() {
|
||||
final CompoundTag tileEntity = new CompoundTag();
|
||||
final CompoundTag blockEntity = new CompoundTag();
|
||||
final ItemStack dropStack = TRContent.Machine.QUANTUM_TANK.getStack();
|
||||
this.writeWithoutCoords(tileEntity);
|
||||
this.writeWithoutCoords(blockEntity);
|
||||
dropStack.setTag(new CompoundTag());
|
||||
dropStack.getTag().put("tileEntity", tileEntity);
|
||||
dropStack.getTag().put("blockEntity", blockEntity);
|
||||
return dropStack;
|
||||
}
|
||||
|
||||
|
@ -119,7 +119,7 @@ public class TileQuantumTank extends TileMachineBase
|
|||
|
||||
// ItemHandlerProvider
|
||||
@Override
|
||||
public RebornInventory<TileQuantumTank> getInventory() {
|
||||
public RebornInventory<QuantumTankBlockEntity> getInventory() {
|
||||
return this.inventory;
|
||||
}
|
||||
|
||||
|
@ -131,8 +131,8 @@ public class TileQuantumTank extends TileMachineBase
|
|||
|
||||
// IListInfoProvider
|
||||
@Override
|
||||
public void addInfo(final List<Text> info, final boolean isRealTile, boolean hasData) {
|
||||
if (isRealTile | hasData) {
|
||||
public void addInfo(final List<Text> info, final boolean isReal, boolean hasData) {
|
||||
if (isReal | hasData) {
|
||||
if (this.tank.getFluid() != null) {
|
||||
info.add(new LiteralText(this.tank.getFluidAmount() + " of " + this.tank.getFluidType().getName()));
|
||||
} else {
|
||||
|
@ -146,7 +146,7 @@ public class TileQuantumTank extends TileMachineBase
|
|||
@Override
|
||||
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
|
||||
return new ContainerBuilder("quantumtank").player(player.inventory).inventory().hotbar()
|
||||
.addInventory().tile(this).fluidSlot(0, 80, 17).outputSlot(1, 80, 53).addInventory()
|
||||
.addInventory().blockEntity(this).fluidSlot(0, 80, 17).outputSlot(1, 80, 53).addInventory()
|
||||
.create(this, syncID);
|
||||
}
|
||||
|
|
@ -22,13 +22,13 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.storage;
|
||||
package techreborn.blockentity.storage;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
import reborncore.api.tile.IUpgrade;
|
||||
import reborncore.api.blockentity.IUpgrade;
|
||||
import reborncore.client.containerBuilder.IContainerProvider;
|
||||
import reborncore.client.containerBuilder.builder.BuiltContainer;
|
||||
import reborncore.client.containerBuilder.builder.ContainerBuilder;
|
||||
|
@ -37,10 +37,10 @@ import reborncore.common.registration.config.ConfigRegistry;
|
|||
import reborncore.common.util.RebornInventory;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileAdjustableSU extends TileEnergyStorage implements IContainerProvider {
|
||||
public class AdjustableSUBlockEntity extends EnergyStorageBlockEntity implements IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "machines", category = "aesu", key = "AesuMaxInput", comment = "AESU Max Input (Value in EU)")
|
||||
public static int maxInput = 16192;
|
||||
|
@ -49,12 +49,12 @@ public class TileAdjustableSU extends TileEnergyStorage implements IContainerPro
|
|||
@ConfigRegistry(config = "machines", category = "aesu", key = "AesuMaxEnergy", comment = "AESU Max Energy (Value in EU)")
|
||||
public static int maxEnergy = 100_000_000;
|
||||
|
||||
public RebornInventory<TileAdjustableSU> inventory = new RebornInventory<>(4, "TileAdjustableSU", 64, this).withConfiguredAccess();
|
||||
public RebornInventory<AdjustableSUBlockEntity> inventory = new RebornInventory<>(4, "AdjustableSUBlockEntity", 64, this).withConfiguredAccess();
|
||||
private int OUTPUT = 64; // The current output
|
||||
public int superconductors = 0;
|
||||
|
||||
public TileAdjustableSU() {
|
||||
super(TRTileEntities.ADJUSTABLE_SU, "ADJUSTABLE_SU", 4, TRContent.Machine.ADJUSTABLE_SU.block, EnumPowerTier.INSANE, maxInput, maxOutput, maxEnergy);
|
||||
public AdjustableSUBlockEntity() {
|
||||
super(TRBlockEntities.ADJUSTABLE_SU, "ADJUSTABLE_SU", 4, TRContent.Machine.ADJUSTABLE_SU.block, EnumPowerTier.INSANE, maxInput, maxOutput, maxEnergy);
|
||||
}
|
||||
|
||||
|
||||
|
@ -108,11 +108,11 @@ public class TileAdjustableSU extends TileEnergyStorage implements IContainerPro
|
|||
}
|
||||
|
||||
public ItemStack getDropWithNBT() {
|
||||
CompoundTag tileEntity = new CompoundTag();
|
||||
CompoundTag blockEntity = new CompoundTag();
|
||||
ItemStack dropStack = TRContent.Machine.ADJUSTABLE_SU.getStack();
|
||||
toTag(tileEntity);
|
||||
toTag(blockEntity);
|
||||
dropStack.setTag(new CompoundTag());
|
||||
dropStack.getTag().put("tileEntity", tileEntity);
|
||||
dropStack.getTag().put("blockEntity", blockEntity);
|
||||
return dropStack;
|
||||
}
|
||||
|
||||
|
@ -169,7 +169,7 @@ public class TileAdjustableSU extends TileEnergyStorage implements IContainerPro
|
|||
@Override
|
||||
public BuiltContainer createContainer(int syncID, PlayerEntity player) {
|
||||
return new ContainerBuilder("aesu").player(player.inventory).inventory().hotbar().armor()
|
||||
.complete(8, 18).addArmor().addInventory().tile(this).energySlot(0, 62, 45).energySlot(1, 98, 45)
|
||||
.complete(8, 18).addArmor().addInventory().blockEntity(this).energySlot(0, 62, 45).energySlot(1, 98, 45)
|
||||
.syncEnergyValue().syncIntegerValue(this::getCurrentOutput, this::setCurentOutput).addInventory().create(this, syncID);
|
||||
}
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.storage;
|
||||
package techreborn.blockentity.storage;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.entity.BlockEntityType;
|
||||
|
@ -31,19 +31,19 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.util.math.Direction;
|
||||
import reborncore.api.IToolDrop;
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
import reborncore.api.tile.InventoryProvider;
|
||||
import reborncore.api.blockentity.InventoryProvider;
|
||||
import reborncore.common.powerSystem.ExternalPowerSystems;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
|
||||
import reborncore.common.util.RebornInventory;
|
||||
import techreborn.blocks.storage.BlockEnergyStorage;
|
||||
|
||||
/**
|
||||
* Created by Rushmead
|
||||
*/
|
||||
public class TileEnergyStorage extends TilePowerAcceptor
|
||||
public class EnergyStorageBlockEntity extends PowerAcceptorBlockEntity
|
||||
implements IToolDrop, InventoryProvider {
|
||||
|
||||
public RebornInventory<TileEnergyStorage> inventory;
|
||||
public RebornInventory<EnergyStorageBlockEntity> inventory;
|
||||
public String name;
|
||||
public Block wrenchDrop;
|
||||
public EnumPowerTier tier;
|
||||
|
@ -51,9 +51,9 @@ public class TileEnergyStorage extends TilePowerAcceptor
|
|||
public int maxOutput;
|
||||
public int maxStorage;
|
||||
|
||||
public TileEnergyStorage(BlockEntityType<?> tileEntityType, String name, int invSize, Block wrenchDrop, EnumPowerTier tier, int maxInput, int maxOuput, int maxStorage) {
|
||||
super(tileEntityType);
|
||||
inventory = new RebornInventory<>(invSize, "Tile" + name, 64, this).withConfiguredAccess();
|
||||
public EnergyStorageBlockEntity(BlockEntityType<?> blockEntityType, String name, int invSize, Block wrenchDrop, EnumPowerTier tier, int maxInput, int maxOuput, int maxStorage) {
|
||||
super(blockEntityType);
|
||||
inventory = new RebornInventory<>(invSize, name + "BlockEntity", 64, this).withConfiguredAccess();
|
||||
this.wrenchDrop = wrenchDrop;
|
||||
this.tier = tier;
|
||||
this.name = name;
|
||||
|
@ -131,7 +131,7 @@ public class TileEnergyStorage extends TilePowerAcceptor
|
|||
|
||||
// ItemHandlerProvider
|
||||
@Override
|
||||
public RebornInventory<TileEnergyStorage> getInventory() {
|
||||
public RebornInventory<EnergyStorageBlockEntity> getInventory() {
|
||||
return inventory;
|
||||
}
|
||||
}
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.storage;
|
||||
package techreborn.blockentity.storage;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
|
@ -30,25 +30,25 @@ import reborncore.client.containerBuilder.IContainerProvider;
|
|||
import reborncore.client.containerBuilder.builder.BuiltContainer;
|
||||
import reborncore.client.containerBuilder.builder.ContainerBuilder;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 14/03/2016.
|
||||
*
|
||||
*/
|
||||
public class TileHighVoltageSU extends TileEnergyStorage implements IContainerProvider {
|
||||
public class HighVoltageSUBlockEntity extends EnergyStorageBlockEntity implements IContainerProvider {
|
||||
|
||||
/**
|
||||
* MFSU should store 40M FE with 2048 FE/t I/O
|
||||
*/
|
||||
public TileHighVoltageSU() {
|
||||
super(TRTileEntities.HIGH_VOLTAGE_SU, "HIGH_VOLTAGE_SU", 2, TRContent.Machine.HIGH_VOLTAGE_SU.block, EnumPowerTier.HIGH, 512, 512, 10_000_000);
|
||||
public HighVoltageSUBlockEntity() {
|
||||
super(TRBlockEntities.HIGH_VOLTAGE_SU, "HIGH_VOLTAGE_SU", 2, TRContent.Machine.HIGH_VOLTAGE_SU.block, EnumPowerTier.HIGH, 512, 512, 10_000_000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BuiltContainer createContainer(int syncID, final PlayerEntity 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)
|
||||
.complete(8, 18).addArmor().addInventory().blockEntity(this).energySlot(0, 62, 45).energySlot(1, 98, 45)
|
||||
.syncEnergyValue().addInventory().create(this, syncID);
|
||||
}
|
||||
}
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.storage;
|
||||
package techreborn.blockentity.storage;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
|
@ -30,20 +30,20 @@ import reborncore.client.containerBuilder.IContainerProvider;
|
|||
import reborncore.client.containerBuilder.builder.BuiltContainer;
|
||||
import reborncore.client.containerBuilder.builder.ContainerBuilder;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 14/03/2016.
|
||||
*/
|
||||
public class TileLowVoltageSU extends TileEnergyStorage implements IContainerProvider {
|
||||
public class LowVoltageSUBlockEntity extends EnergyStorageBlockEntity implements IContainerProvider {
|
||||
|
||||
public TileLowVoltageSU() {
|
||||
super(TRTileEntities.LOW_VOLTAGE_SU, "BatBox", 2, TRContent.Machine.LOW_VOLTAGE_SU.block, EnumPowerTier.LOW, 32, 32, 40000);
|
||||
public LowVoltageSUBlockEntity() {
|
||||
super(TRBlockEntities.LOW_VOLTAGE_SU, "BatBox", 2, TRContent.Machine.LOW_VOLTAGE_SU.block, EnumPowerTier.LOW, 32, 32, 40000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
|
||||
return new ContainerBuilder("batbox").player(player.inventory).inventory().hotbar().addInventory()
|
||||
.tile(this).energySlot(0, 62, 45).energySlot(1, 98, 45).syncEnergyValue().addInventory().create(this, syncID);
|
||||
.blockEntity(this).energySlot(0, 62, 45).energySlot(1, 98, 45).syncEnergyValue().addInventory().create(this, syncID);
|
||||
}
|
||||
}
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.storage;
|
||||
package techreborn.blockentity.storage;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
|
@ -30,25 +30,25 @@ import reborncore.client.containerBuilder.IContainerProvider;
|
|||
import reborncore.client.containerBuilder.builder.BuiltContainer;
|
||||
import reborncore.client.containerBuilder.builder.ContainerBuilder;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 14/03/2016.
|
||||
*
|
||||
*/
|
||||
public class TileMediumVoltageSU extends TileEnergyStorage implements IContainerProvider {
|
||||
public class MediumVoltageSUBlockEntity extends EnergyStorageBlockEntity implements IContainerProvider {
|
||||
|
||||
/**
|
||||
* MFE should store 1.2M FE with 512 FE/t I/O
|
||||
*/
|
||||
public TileMediumVoltageSU() {
|
||||
super(TRTileEntities.MEDIUM_VOLTAGE_SU, "MEDIUM_VOLTAGE_SU", 2, TRContent.Machine.MEDIUM_VOLTAGE_SU.block, EnumPowerTier.MEDIUM, 128, 128, 300000);
|
||||
public MediumVoltageSUBlockEntity() {
|
||||
super(TRBlockEntities.MEDIUM_VOLTAGE_SU, "MEDIUM_VOLTAGE_SU", 2, TRContent.Machine.MEDIUM_VOLTAGE_SU.block, EnumPowerTier.MEDIUM, 128, 128, 300000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BuiltContainer createContainer(int syncID, final PlayerEntity 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)
|
||||
.complete(8, 18).addArmor().addInventory().blockEntity(this).energySlot(0, 62, 45).energySlot(1, 98, 45)
|
||||
.syncEnergyValue().addInventory().create(this, syncID);
|
||||
}
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.storage.idsu;
|
||||
package techreborn.blockentity.storage.idsu;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.storage.idsu;
|
||||
package techreborn.blockentity.storage.idsu;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.world.PersistentState;
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.storage.idsu;
|
||||
package techreborn.blockentity.storage.idsu;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 13/06/2017.
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.storage.idsu;
|
||||
package techreborn.blockentity.storage.idsu;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
|
@ -35,11 +35,11 @@ import reborncore.common.registration.RebornRegister;
|
|||
import reborncore.common.registration.config.ConfigRegistry;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.tiles.storage.TileEnergyStorage;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
import techreborn.blockentity.storage.EnergyStorageBlockEntity;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileInterdimensionalSU extends TileEnergyStorage implements IContainerProvider {
|
||||
public class InterdimensionalSUBlockEntity extends EnergyStorageBlockEntity implements IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "machines", category = "idsu", key = "IdsuMaxInput", comment = "IDSU Max Input (Value in EU)")
|
||||
public static int maxInput = 8192;
|
||||
|
@ -50,8 +50,8 @@ public class TileInterdimensionalSU extends TileEnergyStorage implements IContai
|
|||
|
||||
public String ownerUdid;
|
||||
|
||||
public TileInterdimensionalSU() {
|
||||
super(TRTileEntities.INTERDIMENSIONAL_SU, "IDSU", 2, TRContent.Machine.INTERDIMENSIONAL_SU.block, EnumPowerTier.EXTREME, maxInput, maxOutput, maxEnergy);
|
||||
public InterdimensionalSUBlockEntity() {
|
||||
super(TRBlockEntities.INTERDIMENSIONAL_SU, "IDSU", 2, TRContent.Machine.INTERDIMENSIONAL_SU.block, EnumPowerTier.EXTREME, maxInput, maxOutput, maxEnergy);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -112,7 +112,7 @@ public class TileInterdimensionalSU extends TileEnergyStorage implements IContai
|
|||
@Override
|
||||
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
|
||||
return new ContainerBuilder("idsu").player(player.inventory).inventory().hotbar().armor()
|
||||
.complete(8, 18).addArmor().addInventory().tile(this).energySlot(0, 62, 45).energySlot(1, 98, 45)
|
||||
.complete(8, 18).addArmor().addInventory().blockEntity(this).energySlot(0, 62, 45).energySlot(1, 98, 45)
|
||||
.syncEnergyValue().addInventory().create(this, syncID);
|
||||
}
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.storage.lesu;
|
||||
package techreborn.blockentity.storage.lesu;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -30,17 +30,17 @@ import net.minecraft.util.math.BlockPos;
|
|||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.world.World;
|
||||
import reborncore.api.IToolDrop;
|
||||
import reborncore.common.tile.TileMachineBase;
|
||||
import reborncore.common.blockentity.MachineBaseBlockEntity;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
|
||||
public class TileLSUStorage extends TileMachineBase
|
||||
public class LSUStorageBlockEntity extends MachineBaseBlockEntity
|
||||
implements IToolDrop {
|
||||
|
||||
public LesuNetwork network;
|
||||
|
||||
public TileLSUStorage() {
|
||||
super(TRTileEntities.LSU_STORAGE);
|
||||
public LSUStorageBlockEntity() {
|
||||
super(TRBlockEntities.LSU_STORAGE);
|
||||
}
|
||||
|
||||
public final void findAndJoinNetwork(World world, int x, int y, int z) {
|
||||
|
@ -48,9 +48,9 @@ public class TileLSUStorage extends TileMachineBase
|
|||
network.addElement(this);
|
||||
for (Direction direction : Direction.values()) {
|
||||
if (world.getBlockEntity(new BlockPos(x + direction.getOffsetX(), y + direction.getOffsetY(),
|
||||
z + direction.getOffsetZ())) instanceof TileLSUStorage) {
|
||||
TileLSUStorage lesu = (TileLSUStorage) world.getBlockEntity(new BlockPos(x + direction.getOffsetX(),
|
||||
y + direction.getOffsetY(), z + direction.getOffsetZ()));
|
||||
z + direction.getOffsetZ())) instanceof LSUStorageBlockEntity) {
|
||||
LSUStorageBlockEntity lesu = (LSUStorageBlockEntity) world.getBlockEntity(new BlockPos(x + direction.getOffsetX(),
|
||||
y + direction.getOffsetY(), z + direction.getOffsetZ()));
|
||||
if (lesu.network != null) {
|
||||
lesu.network.merge(network);
|
||||
}
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.storage.lesu;
|
||||
package techreborn.blockentity.storage.lesu;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
|
@ -39,13 +39,13 @@ import reborncore.common.registration.config.ConfigRegistry;
|
|||
import techreborn.TechReborn;
|
||||
import techreborn.blocks.storage.BlockLapotronicSU;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.tiles.storage.TileEnergyStorage;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
import techreborn.blockentity.storage.EnergyStorageBlockEntity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileLapotronicSU extends TileEnergyStorage implements IContainerProvider{
|
||||
public class LapotronicSUBlockEntity extends EnergyStorageBlockEntity implements IContainerProvider{
|
||||
|
||||
// @ConfigRegistry(config = "machines", category = "lesu", key = "LesuMaxInput", comment = "LESU Max Input (Value in EU)")
|
||||
// public static int maxInput = 8192;
|
||||
|
@ -59,8 +59,8 @@ public class TileLapotronicSU extends TileEnergyStorage implements IContainerPro
|
|||
public int connectedBlocks = 0;
|
||||
private ArrayList<LesuNetwork> countedNetworks = new ArrayList<>();
|
||||
|
||||
public TileLapotronicSU() {
|
||||
super(TRTileEntities.LAPOTRONIC_SU, "LESU", 2, TRContent.Machine.LAPOTRONIC_SU.block, EnumPowerTier.INSANE, 8192, baseOutput, 1_000_000);
|
||||
public LapotronicSUBlockEntity() {
|
||||
super(TRBlockEntities.LAPOTRONIC_SU, "LESU", 2, TRContent.Machine.LAPOTRONIC_SU.block, EnumPowerTier.INSANE, 8192, baseOutput, 1_000_000);
|
||||
checkOverfill = false;
|
||||
}
|
||||
|
||||
|
@ -75,14 +75,14 @@ public class TileLapotronicSU extends TileEnergyStorage implements IContainerPro
|
|||
for (Direction dir : Direction.values()) {
|
||||
BlockPos adjucentBlockPos = new BlockPos(pos.getX() + dir.getOffsetX(),
|
||||
pos.getY() + dir.getOffsetX(), pos.getZ() + dir.getOffsetX());
|
||||
BlockEntity adjucentTile = world.getBlockEntity(adjucentBlockPos);
|
||||
if (adjucentTile == null || !(adjucentTile instanceof TileLSUStorage)) {
|
||||
BlockEntity adjucent = world.getBlockEntity(adjucentBlockPos);
|
||||
if (adjucent == null || !(adjucent instanceof LSUStorageBlockEntity)) {
|
||||
continue;
|
||||
}
|
||||
if (((TileLSUStorage) adjucentTile).network == null) {
|
||||
if (((LSUStorageBlockEntity) adjucent).network == null) {
|
||||
continue;
|
||||
}
|
||||
LesuNetwork network = ((TileLSUStorage) adjucentTile).network;
|
||||
LesuNetwork network = ((LSUStorageBlockEntity) adjucent).network;
|
||||
if (!countedNetworks.contains(network)) {
|
||||
if (network.master == null || network.master == this) {
|
||||
connectedBlocks += network.storages.size();
|
||||
|
@ -135,7 +135,7 @@ public class TileLapotronicSU extends TileEnergyStorage implements IContainerPro
|
|||
@Override
|
||||
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
|
||||
return new ContainerBuilder("lesu").player(player.inventory).inventory().hotbar().armor().complete(8, 18)
|
||||
.addArmor().addInventory().tile(this).energySlot(0, 62, 45).energySlot(1, 98, 45).syncEnergyValue()
|
||||
.addArmor().addInventory().blockEntity(this).energySlot(0, 62, 45).energySlot(1, 98, 45).syncEnergyValue()
|
||||
.syncIntegerValue(this::getOutputRate, this::setOutputRate)
|
||||
.syncIntegerValue(this::getConnectedBlocksNum, this::setConnectedBlocksNum).addInventory().create(this, syncID);
|
||||
}
|
|
@ -22,30 +22,30 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.storage.lesu;
|
||||
package techreborn.blockentity.storage.lesu;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class LesuNetwork {
|
||||
|
||||
public ArrayList<TileLSUStorage> storages = new ArrayList<>();
|
||||
public ArrayList<LSUStorageBlockEntity> storages = new ArrayList<>();
|
||||
|
||||
public TileLapotronicSU master;
|
||||
public LapotronicSUBlockEntity master;
|
||||
|
||||
public void addElement(TileLSUStorage lesuStorage) {
|
||||
public void addElement(LSUStorageBlockEntity lesuStorage) {
|
||||
if (!storages.contains(lesuStorage) && storages.size() < 5000) {
|
||||
storages.add(lesuStorage);
|
||||
}
|
||||
}
|
||||
|
||||
public void removeElement(TileLSUStorage lesuStorage) {
|
||||
public void removeElement(LSUStorageBlockEntity lesuStorage) {
|
||||
storages.remove(lesuStorage);
|
||||
rebuild();
|
||||
}
|
||||
|
||||
private void rebuild() {
|
||||
master = null;
|
||||
for (TileLSUStorage lesuStorage : storages) {
|
||||
for (LSUStorageBlockEntity lesuStorage : storages) {
|
||||
lesuStorage.findAndJoinNetwork(lesuStorage.getWorld(), lesuStorage.getPos().getX(),
|
||||
lesuStorage.getPos().getY(), lesuStorage.getPos().getZ());
|
||||
}
|
||||
|
@ -53,10 +53,10 @@ public class LesuNetwork {
|
|||
|
||||
public void merge(LesuNetwork network) {
|
||||
if (network != this) {
|
||||
ArrayList<TileLSUStorage> tileLesuStorages = new ArrayList<>();
|
||||
tileLesuStorages.addAll(network.storages);
|
||||
ArrayList<LSUStorageBlockEntity> blockEntityLesuStorages = new ArrayList<>();
|
||||
blockEntityLesuStorages.addAll(network.storages);
|
||||
network.clear(false);
|
||||
for (TileLSUStorage lesuStorage : tileLesuStorages) {
|
||||
for (LSUStorageBlockEntity lesuStorage : blockEntityLesuStorages) {
|
||||
lesuStorage.setNetwork(this);
|
||||
}
|
||||
if (network.master != null && this.master == null) {
|
||||
|
@ -65,10 +65,10 @@ public class LesuNetwork {
|
|||
}
|
||||
}
|
||||
|
||||
private void clear(boolean clearTiles) {
|
||||
if (clearTiles) {
|
||||
for (TileLSUStorage tileLesuStorage : storages) {
|
||||
tileLesuStorage.resetNetwork();
|
||||
private void clear(boolean clearBlockEntities) {
|
||||
if (clearBlockEntities) {
|
||||
for (LSUStorageBlockEntity blockEntityLesuStorage : storages) {
|
||||
blockEntityLesuStorage.resetNetwork();
|
||||
}
|
||||
}
|
||||
storages.clear();
|
|
@ -22,18 +22,19 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.transformers;
|
||||
package techreborn.blockentity.transformers;
|
||||
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 16/03/2016.
|
||||
*/
|
||||
public class TileMVTransformer extends TileTransformer {
|
||||
public class HVTransformerBlockEntity extends TransformerBlockEntity {
|
||||
|
||||
public TileMVTransformer() {
|
||||
super(TRTileEntities.MV_TRANSFORMER, "MVTransformer", TRContent.Machine.MV_TRANSFORMER.block, EnumPowerTier.HIGH);
|
||||
public HVTransformerBlockEntity() {
|
||||
super(TRBlockEntities.HV_TRANSFORMER, "HVTransformer", TRContent.Machine.HV_TRANSFORMER.block, EnumPowerTier.EXTREME);
|
||||
}
|
||||
|
||||
}
|
|
@ -22,19 +22,19 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.transformers;
|
||||
package techreborn.blockentity.transformers;
|
||||
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 16/03/2016.
|
||||
*/
|
||||
public class TileHVTransformer extends TileTransformer {
|
||||
public class LVTransformerBlockEntity extends TransformerBlockEntity {
|
||||
|
||||
public TileHVTransformer() {
|
||||
super(TRTileEntities.HV_TRANSFORMER, "HVTransformer", TRContent.Machine.HV_TRANSFORMER.block, EnumPowerTier.EXTREME);
|
||||
public LVTransformerBlockEntity() {
|
||||
super(TRBlockEntities.LV_TRANSFORMER, "LVTransformer", TRContent.Machine.LV_TRANSFORMER.block, EnumPowerTier.MEDIUM);
|
||||
}
|
||||
|
||||
}
|
|
@ -22,19 +22,18 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.transformers;
|
||||
package techreborn.blockentity.transformers;
|
||||
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 16/03/2016.
|
||||
*/
|
||||
public class TileLVTransformer extends TileTransformer {
|
||||
public class MVTransformerBlockEntity extends TransformerBlockEntity {
|
||||
|
||||
public TileLVTransformer() {
|
||||
super(TRTileEntities.LV_TRANSFORMER, "LVTransformer", TRContent.Machine.LV_TRANSFORMER.block, EnumPowerTier.MEDIUM);
|
||||
public MVTransformerBlockEntity() {
|
||||
super(TRBlockEntities.MV_TRANSFORMER, "MVTransformer", TRContent.Machine.MV_TRANSFORMER.block, EnumPowerTier.HIGH);
|
||||
}
|
||||
|
||||
}
|
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.tiles.transformers;
|
||||
package techreborn.blockentity.transformers;
|
||||
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
|
@ -36,7 +36,7 @@ import reborncore.api.IListInfoProvider;
|
|||
import reborncore.api.IToolDrop;
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
|
||||
import reborncore.common.registration.RebornRegister;
|
||||
import reborncore.common.registration.config.ConfigRegistry;
|
||||
import reborncore.common.util.StringUtils;
|
||||
|
@ -49,7 +49,7 @@ import java.util.List;
|
|||
* Created by Rushmead
|
||||
*/
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileTransformer extends TilePowerAcceptor
|
||||
public class TransformerBlockEntity extends PowerAcceptorBlockEntity
|
||||
implements IToolDrop, IListInfoProvider {
|
||||
|
||||
@ConfigRegistry(config = "misc", category = "general", key = "IC2TransformersStyle", comment = "Input from dots side, output from other sides, like in IC2.")
|
||||
|
@ -63,8 +63,8 @@ public class TileTransformer extends TilePowerAcceptor
|
|||
public int maxOutput;
|
||||
public int maxStorage;
|
||||
|
||||
public TileTransformer(BlockEntityType<?> tileEntityType, String name, Block wrenchDrop, EnumPowerTier tier) {
|
||||
super(tileEntityType);
|
||||
public TransformerBlockEntity(BlockEntityType<?> blockEntityType, String name, Block wrenchDrop, EnumPowerTier tier) {
|
||||
super(blockEntityType);
|
||||
this.wrenchDrop = wrenchDrop;
|
||||
this.inputTier = tier;
|
||||
if (tier != EnumPowerTier.MICRO) {
|
||||
|
@ -142,7 +142,7 @@ public class TileTransformer extends TilePowerAcceptor
|
|||
|
||||
// IListInfoProvider
|
||||
@Override
|
||||
public void addInfo(List<Text> info, boolean isRealTile, boolean hasData) {
|
||||
public void addInfo(List<Text> info, boolean isReal, boolean hasData) {
|
||||
info.add(new LiteralText(Formatting.GRAY + "Input Rate: " + Formatting.GOLD + PowerSystem.getLocaliszedPowerFormatted((int) getMaxInput())));
|
||||
info.add(new LiteralText(Formatting.GRAY + "Input Tier: " + Formatting.GOLD + StringUtils.toFirstCapitalAllLowercase(inputTier.toString())));
|
||||
info.add(new LiteralText(Formatting.GRAY + "Output Rate: " + Formatting.GOLD + PowerSystem.getLocaliszedPowerFormatted((int) getMaxOutput())));
|
|
@ -48,15 +48,15 @@ import net.minecraft.util.shape.VoxelShape;
|
|||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
import reborncore.api.ToolManager;
|
||||
import reborncore.common.BaseTileBlock;
|
||||
import reborncore.common.BaseBlockEntityProvider;
|
||||
import reborncore.common.blocks.BlockWrenchEventHandler;
|
||||
import reborncore.common.util.WrenchUtils;
|
||||
import techreborn.tiles.TileAlarm;
|
||||
import techreborn.blockentity.AlarmBlockEntity;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockAlarm extends BaseTileBlock {
|
||||
public class BlockAlarm extends BaseBlockEntityProvider {
|
||||
public static DirectionProperty FACING = Properties.FACING;
|
||||
public static BooleanProperty ACTIVE;
|
||||
protected final VoxelShape[] shape;
|
||||
|
@ -103,7 +103,7 @@ public class BlockAlarm extends BaseTileBlock {
|
|||
@Nullable
|
||||
@Override
|
||||
public BlockEntity createBlockEntity(BlockView worldIn) {
|
||||
return new TileAlarm();
|
||||
return new AlarmBlockEntity();
|
||||
}
|
||||
|
||||
// Block
|
||||
|
@ -128,10 +128,10 @@ public class BlockAlarm extends BaseTileBlock {
|
|||
@Override
|
||||
public boolean activate(BlockState state, World worldIn, BlockPos pos, PlayerEntity playerIn, Hand hand, BlockHitResult hitResult) {
|
||||
ItemStack stack = playerIn.getStackInHand(Hand.MAIN_HAND);
|
||||
BlockEntity tileEntity = worldIn.getBlockEntity(pos);
|
||||
BlockEntity blockEntity = worldIn.getBlockEntity(pos);
|
||||
|
||||
// We extended BaseTileBlock. Thus we should always have tile entity. I hope.
|
||||
if (tileEntity == null) {
|
||||
// We extended BaseTileBlock. Thus we should always have blockEntity entity. I hope.
|
||||
if (blockEntity == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -142,7 +142,7 @@ public class BlockAlarm extends BaseTileBlock {
|
|||
}
|
||||
|
||||
if (!worldIn.isClient && playerIn.isSneaking()) {
|
||||
((TileAlarm) tileEntity).rightClick();
|
||||
((AlarmBlockEntity) blockEntity).rightClick();
|
||||
return true;
|
||||
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ import net.minecraft.block.entity.BlockEntity;
|
|||
import net.minecraft.sound.BlockSoundGroup;
|
||||
import net.minecraft.world.BlockView;
|
||||
import reborncore.common.multiblock.BlockMultiblockBase;
|
||||
import techreborn.tiles.TileMachineCasing;
|
||||
import techreborn.blockentity.MachineCasingBlockEntity;
|
||||
|
||||
public class BlockMachineCasing extends BlockMultiblockBase {
|
||||
|
||||
|
@ -54,7 +54,7 @@ public class BlockMachineCasing extends BlockMultiblockBase {
|
|||
|
||||
@Override
|
||||
public BlockEntity createBlockEntity(BlockView worldIn) {
|
||||
return new TileMachineCasing();
|
||||
return new MachineCasingBlockEntity();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.world.BlockView;
|
||||
import reborncore.api.tile.IMachineGuiHandler;
|
||||
import reborncore.api.blockentity.IMachineGuiHandler;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
|
|
@ -46,7 +46,7 @@ import net.minecraft.world.BlockView;
|
|||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.World;
|
||||
import reborncore.api.ToolManager;
|
||||
import reborncore.api.power.IEnergyInterfaceTile;
|
||||
import reborncore.api.power.EnergyBlockEntity;
|
||||
import reborncore.common.blocks.BlockWrenchEventHandler;
|
||||
import reborncore.common.registration.RebornRegister;
|
||||
import reborncore.common.registration.config.ConfigRegistry;
|
||||
|
@ -54,7 +54,7 @@ import reborncore.common.util.WrenchUtils;
|
|||
import techreborn.TechReborn;
|
||||
import techreborn.init.ModSounds;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.tiles.cable.TileCable;
|
||||
import techreborn.blockentity.cable.CableBlockEntity;
|
||||
import techreborn.utils.damageSources.ElectrialShockSource;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
@ -123,8 +123,8 @@ public class BlockCable extends BlockWithEntity {
|
|||
}
|
||||
|
||||
private Boolean canConnectTo(IWorld world, BlockPos pos, Direction facing) {
|
||||
BlockEntity tileEntity = world.getBlockEntity(pos);
|
||||
if (tileEntity != null && (tileEntity instanceof IEnergyInterfaceTile)) {
|
||||
BlockEntity blockEntity = world.getBlockEntity(pos);
|
||||
if (blockEntity != null && (blockEntity instanceof EnergyBlockEntity)) {
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
return Boolean.FALSE;
|
||||
|
@ -139,17 +139,17 @@ public class BlockCable extends BlockWithEntity {
|
|||
@Nullable
|
||||
@Override
|
||||
public BlockEntity createBlockEntity(BlockView worldIn) {
|
||||
return new TileCable();
|
||||
return new CableBlockEntity();
|
||||
}
|
||||
|
||||
// Block
|
||||
@Override
|
||||
public boolean activate(BlockState state, World worldIn, BlockPos pos, PlayerEntity playerIn, Hand hand, BlockHitResult hitResult) {
|
||||
ItemStack stack = playerIn.getStackInHand(Hand.MAIN_HAND);
|
||||
BlockEntity tileEntity = worldIn.getBlockEntity(pos);
|
||||
BlockEntity blockEntity = worldIn.getBlockEntity(pos);
|
||||
|
||||
// We should always have tile entity. I hope.
|
||||
if (tileEntity == null) {
|
||||
// We should always have blockEntity entity. I hope.
|
||||
if (blockEntity == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -203,16 +203,16 @@ public class BlockCable extends BlockWithEntity {
|
|||
return;
|
||||
}
|
||||
|
||||
BlockEntity tileEntity = worldIn.getBlockEntity(pos);
|
||||
if (tileEntity == null) {
|
||||
BlockEntity blockEntity = worldIn.getBlockEntity(pos);
|
||||
if (blockEntity == null) {
|
||||
return;
|
||||
}
|
||||
if (!(tileEntity instanceof TileCable)) {
|
||||
if (!(blockEntity instanceof CableBlockEntity)) {
|
||||
return;
|
||||
}
|
||||
|
||||
TileCable tileCable = (TileCable) tileEntity;
|
||||
if (tileCable.power <= 0) {
|
||||
CableBlockEntity blockEntityCable = (CableBlockEntity) blockEntity;
|
||||
if (blockEntityCable.power <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -26,10 +26,10 @@ package techreborn.blocks.generator;
|
|||
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.world.BlockView;
|
||||
import reborncore.api.tile.IMachineGuiHandler;
|
||||
import reborncore.api.blockentity.IMachineGuiHandler;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.tiles.generator.advanced.TileDieselGenerator;
|
||||
import techreborn.blockentity.generator.advanced.DieselGeneratorBlockEntity;
|
||||
|
||||
/**
|
||||
* Block for Diesel Generator
|
||||
|
@ -38,7 +38,7 @@ public class BlockDieselGenerator extends BlockMachineBase {
|
|||
|
||||
@Override
|
||||
public BlockEntity createBlockEntity(BlockView worldIn) {
|
||||
return new TileDieselGenerator();
|
||||
return new DieselGeneratorBlockEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -26,15 +26,15 @@ package techreborn.blocks.generator;
|
|||
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.world.BlockView;
|
||||
import reborncore.api.tile.IMachineGuiHandler;
|
||||
import reborncore.api.blockentity.IMachineGuiHandler;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import techreborn.tiles.generator.advanced.TileDragonEggSyphon;
|
||||
import techreborn.blockentity.generator.advanced.DragonEggSyphonBlockEntity;
|
||||
|
||||
public class BlockDragonEggSyphon extends BlockMachineBase {
|
||||
|
||||
@Override
|
||||
public BlockEntity createBlockEntity(BlockView worldIn) {
|
||||
return new TileDragonEggSyphon();
|
||||
return new DragonEggSyphonBlockEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -33,12 +33,12 @@ import net.minecraft.util.hit.BlockHitResult;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
import reborncore.api.tile.IMachineGuiHandler;
|
||||
import reborncore.api.blockentity.IMachineGuiHandler;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.util.Torus;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.tiles.fusionReactor.TileFusionControlComputer;
|
||||
import techreborn.blockentity.fusionReactor.FusionControlComputerBlockEntity;
|
||||
import techreborn.utils.damageSources.FusionDamageSource;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -48,15 +48,15 @@ public class BlockFusionControlComputer extends BlockMachineBase {
|
|||
@Override
|
||||
public boolean activate(BlockState state, World worldIn, BlockPos pos, PlayerEntity playerIn,
|
||||
Hand hand, BlockHitResult hitResult) {
|
||||
final TileFusionControlComputer tileFusionControlComputer = (TileFusionControlComputer) worldIn.getBlockEntity(pos);
|
||||
final FusionControlComputerBlockEntity blockEntityFusionControlComputer = (FusionControlComputerBlockEntity) worldIn.getBlockEntity(pos);
|
||||
if(!playerIn.getStackInHand(hand).isEmpty() && (playerIn.getStackInHand(hand).getItem() == TRContent.Machine.FUSION_COIL.asItem())){
|
||||
List<BlockPos> coils = Torus.generate(tileFusionControlComputer.getPos(), tileFusionControlComputer.size);
|
||||
List<BlockPos> coils = Torus.generate(blockEntityFusionControlComputer.getPos(), blockEntityFusionControlComputer.size);
|
||||
boolean placed = false;
|
||||
for(BlockPos coil : coils){
|
||||
if(playerIn.getStackInHand(hand).isEmpty()){
|
||||
return true;
|
||||
}
|
||||
if(worldIn.isAir(coil) && !tileFusionControlComputer.isCoil(coil)){
|
||||
if(worldIn.isAir(coil) && !blockEntityFusionControlComputer.isCoil(coil)){
|
||||
worldIn.setBlockState(coil, TRContent.Machine.FUSION_COIL.block.getDefaultState());
|
||||
if(!playerIn.isCreative()){
|
||||
playerIn.getStackInHand(hand).decrement(1);
|
||||
|
@ -69,7 +69,7 @@ public class BlockFusionControlComputer extends BlockMachineBase {
|
|||
}
|
||||
|
||||
}
|
||||
tileFusionControlComputer.checkCoils();
|
||||
blockEntityFusionControlComputer.checkCoils();
|
||||
return super.activate(state, worldIn, pos, playerIn, hand, hitResult);
|
||||
}
|
||||
|
||||
|
@ -81,9 +81,9 @@ public class BlockFusionControlComputer extends BlockMachineBase {
|
|||
@Override
|
||||
public void onSteppedOn(final World worldIn, final BlockPos pos, final Entity entityIn) {
|
||||
super.onSteppedOn(worldIn, pos, entityIn);
|
||||
if (worldIn.getBlockEntity(pos) instanceof TileFusionControlComputer) {
|
||||
if (((TileFusionControlComputer) worldIn.getBlockEntity(pos)).crafingTickTime != 0
|
||||
&& ((TileFusionControlComputer) worldIn.getBlockEntity(pos)).checkCoils()) {
|
||||
if (worldIn.getBlockEntity(pos) instanceof FusionControlComputerBlockEntity) {
|
||||
if (((FusionControlComputerBlockEntity) worldIn.getBlockEntity(pos)).crafingTickTime != 0
|
||||
&& ((FusionControlComputerBlockEntity) worldIn.getBlockEntity(pos)).checkCoils()) {
|
||||
entityIn.damage(new FusionDamageSource(), 200F);
|
||||
}
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ public class BlockFusionControlComputer extends BlockMachineBase {
|
|||
|
||||
@Override
|
||||
public BlockEntity createBlockEntity(BlockView worldIn) {
|
||||
return new TileFusionControlComputer();
|
||||
return new FusionControlComputerBlockEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -26,16 +26,16 @@ package techreborn.blocks.generator;
|
|||
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.world.BlockView;
|
||||
import reborncore.api.tile.IMachineGuiHandler;
|
||||
import reborncore.api.blockentity.IMachineGuiHandler;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.tiles.generator.advanced.TileGasTurbine;
|
||||
import techreborn.blockentity.generator.advanced.GasTurbineBlockEntity;
|
||||
|
||||
public class BlockGasTurbine extends BlockMachineBase {
|
||||
|
||||
@Override
|
||||
public BlockEntity createBlockEntity(BlockView worldIn) {
|
||||
return new TileGasTurbine();
|
||||
return new GasTurbineBlockEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -26,15 +26,15 @@ package techreborn.blocks.generator;
|
|||
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.world.BlockView;
|
||||
import reborncore.api.tile.IMachineGuiHandler;
|
||||
import reborncore.api.blockentity.IMachineGuiHandler;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import techreborn.tiles.generator.TileLightningRod;
|
||||
import techreborn.blockentity.generator.LightningRodBlockEntity;
|
||||
|
||||
public class BlockLightningRod extends BlockMachineBase {
|
||||
|
||||
@Override
|
||||
public BlockEntity createBlockEntity(BlockView worldIn) {
|
||||
return new TileLightningRod();
|
||||
return new LightningRodBlockEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -30,7 +30,7 @@ import net.minecraft.util.Formatting;
|
|||
import net.minecraft.client.item.TooltipContext;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.BlockView;
|
||||
import reborncore.api.tile.IMachineGuiHandler;
|
||||
import reborncore.api.blockentity.IMachineGuiHandler;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
|
|
@ -30,7 +30,7 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.world.BlockView;
|
||||
import reborncore.api.tile.IMachineGuiHandler;
|
||||
import reborncore.api.blockentity.IMachineGuiHandler;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
|
|
@ -26,10 +26,10 @@ package techreborn.blocks.generator;
|
|||
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.world.BlockView;
|
||||
import reborncore.api.tile.IMachineGuiHandler;
|
||||
import reborncore.api.blockentity.IMachineGuiHandler;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.tiles.generator.TilePlasmaGenerator;
|
||||
import techreborn.blockentity.generator.PlasmaGeneratorBlockEntity;
|
||||
|
||||
/**
|
||||
* Block for Plasma Generator
|
||||
|
@ -38,7 +38,7 @@ public class BlockPlasmaGenerator extends BlockMachineBase {
|
|||
|
||||
@Override
|
||||
public BlockEntity createBlockEntity(BlockView worldIn) {
|
||||
return new TilePlasmaGenerator();
|
||||
return new PlasmaGeneratorBlockEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -26,16 +26,16 @@ package techreborn.blocks.generator;
|
|||
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.world.BlockView;
|
||||
import reborncore.api.tile.IMachineGuiHandler;
|
||||
import reborncore.api.blockentity.IMachineGuiHandler;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.tiles.generator.advanced.TileSemiFluidGenerator;
|
||||
import techreborn.blockentity.generator.advanced.SemiFluidGeneratorBlockEntity;
|
||||
|
||||
public class BlockSemiFluidGenerator extends BlockMachineBase {
|
||||
|
||||
@Override
|
||||
public BlockEntity createBlockEntity(BlockView worldIn) {
|
||||
return new TileSemiFluidGenerator();
|
||||
return new SemiFluidGeneratorBlockEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -26,10 +26,10 @@ package techreborn.blocks.generator;
|
|||
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.world.BlockView;
|
||||
import reborncore.api.tile.IMachineGuiHandler;
|
||||
import reborncore.api.blockentity.IMachineGuiHandler;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import techreborn.init.TRContent.SolarPanels;
|
||||
import techreborn.tiles.generator.TileSolarPanel;
|
||||
import techreborn.blockentity.generator.SolarPanelBlockEntity;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 25/02/2016.
|
||||
|
@ -45,7 +45,7 @@ public class BlockSolarPanel extends BlockMachineBase {
|
|||
|
||||
@Override
|
||||
public BlockEntity createBlockEntity(BlockView worldIn) {
|
||||
return new TileSolarPanel();
|
||||
return new SolarPanelBlockEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -26,10 +26,10 @@ package techreborn.blocks.generator;
|
|||
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.world.BlockView;
|
||||
import reborncore.api.tile.IMachineGuiHandler;
|
||||
import reborncore.api.blockentity.IMachineGuiHandler;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.tiles.generator.basic.TileSolidFuelGenerator;
|
||||
import techreborn.blockentity.generator.basic.SolidFuelGeneratorBlockEntity;
|
||||
|
||||
public class BlockSolidFuelGenerator extends BlockMachineBase {
|
||||
|
||||
|
@ -39,7 +39,7 @@ public class BlockSolidFuelGenerator extends BlockMachineBase {
|
|||
|
||||
@Override
|
||||
public BlockEntity createBlockEntity(BlockView worldIn) {
|
||||
return new TileSolidFuelGenerator();
|
||||
return new SolidFuelGeneratorBlockEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -26,16 +26,16 @@ package techreborn.blocks.generator;
|
|||
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.world.BlockView;
|
||||
import reborncore.api.tile.IMachineGuiHandler;
|
||||
import reborncore.api.blockentity.IMachineGuiHandler;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.tiles.generator.advanced.TileThermalGenerator;
|
||||
import techreborn.blockentity.generator.advanced.ThermalGeneratorBlockEntity;
|
||||
|
||||
public class BlockThermalGenerator extends BlockMachineBase {
|
||||
|
||||
@Override
|
||||
public BlockEntity createBlockEntity(BlockView worldIn) {
|
||||
return new TileThermalGenerator();
|
||||
return new ThermalGeneratorBlockEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -26,9 +26,9 @@ package techreborn.blocks.generator;
|
|||
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.world.BlockView;
|
||||
import reborncore.api.tile.IMachineGuiHandler;
|
||||
import reborncore.api.blockentity.IMachineGuiHandler;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import techreborn.tiles.generator.basic.TileWaterMill;
|
||||
import techreborn.blockentity.generator.basic.WaterMillBlockEntity;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 25/02/2016.
|
||||
|
@ -37,7 +37,7 @@ public class BlockWaterMill extends BlockMachineBase {
|
|||
|
||||
@Override
|
||||
public BlockEntity createBlockEntity(BlockView worldIn) {
|
||||
return new TileWaterMill();
|
||||
return new WaterMillBlockEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -26,9 +26,9 @@ package techreborn.blocks.generator;
|
|||
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.world.BlockView;
|
||||
import reborncore.api.tile.IMachineGuiHandler;
|
||||
import reborncore.api.blockentity.IMachineGuiHandler;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import techreborn.tiles.generator.basic.TileWindMill;
|
||||
import techreborn.blockentity.generator.basic.WindMillBlockEntity;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 25/02/2016.
|
||||
|
@ -37,7 +37,7 @@ public class BlockWindMill extends BlockMachineBase {
|
|||
|
||||
@Override
|
||||
public BlockEntity createBlockEntity(BlockView worldIn) {
|
||||
return new TileWindMill();
|
||||
return new WindMillBlockEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -44,14 +44,14 @@ import net.minecraft.util.shape.VoxelShape;
|
|||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
import reborncore.api.ToolManager;
|
||||
import reborncore.common.BaseTileBlock;
|
||||
import reborncore.common.BaseBlockEntityProvider;
|
||||
import reborncore.common.blocks.BlockWrenchEventHandler;
|
||||
import reborncore.common.util.WrenchUtils;
|
||||
import techreborn.tiles.lighting.TileLamp;
|
||||
import techreborn.blockentity.lighting.LampBlockEntity;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class BlockLamp extends BaseTileBlock {
|
||||
public class BlockLamp extends BaseBlockEntityProvider {
|
||||
|
||||
public static DirectionProperty FACING = Properties.FACING;
|
||||
public static BooleanProperty ACTIVE;
|
||||
|
@ -107,7 +107,7 @@ public class BlockLamp extends BaseTileBlock {
|
|||
// BaseTileBlock
|
||||
@Override
|
||||
public BlockEntity createBlockEntity(BlockView worldIn) {
|
||||
return new TileLamp();
|
||||
return new LampBlockEntity();
|
||||
}
|
||||
|
||||
// Block
|
||||
|
@ -142,10 +142,10 @@ public class BlockLamp extends BaseTileBlock {
|
|||
@Override
|
||||
public boolean activate(BlockState state, World worldIn, BlockPos pos, PlayerEntity playerIn, Hand hand, BlockHitResult hitResult) {
|
||||
ItemStack stack = playerIn.getStackInHand(Hand.MAIN_HAND);
|
||||
BlockEntity tileEntity = worldIn.getBlockEntity(pos);
|
||||
BlockEntity blockEntity = worldIn.getBlockEntity(pos);
|
||||
|
||||
// We extended BaseTileBlock. Thus we should always have tile entity. I hope.
|
||||
if (tileEntity == null) {
|
||||
// We extended BaseTileBlock. Thus we should always have blockEntity entity. I hope.
|
||||
if (blockEntity == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ import net.minecraft.util.hit.BlockHitResult;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import reborncore.api.ToolManager;
|
||||
import reborncore.api.tile.IMachineGuiHandler;
|
||||
import reborncore.api.blockentity.IMachineGuiHandler;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import techreborn.init.ModSounds;
|
||||
import techreborn.init.TRContent;
|
||||
|
|
|
@ -34,7 +34,7 @@ import net.minecraft.world.World;
|
|||
import reborncore.common.RebornCoreConfig;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.tiles.storage.TileAdjustableSU;
|
||||
import techreborn.blockentity.storage.AdjustableSUBlockEntity;
|
||||
|
||||
public class BlockAdjustableSU extends BlockEnergyStorage {
|
||||
|
||||
|
@ -44,7 +44,7 @@ public class BlockAdjustableSU extends BlockEnergyStorage {
|
|||
|
||||
@Override
|
||||
public BlockEntity createBlockEntity(BlockView worldIn) {
|
||||
return new TileAdjustableSU();
|
||||
return new AdjustableSUBlockEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -41,15 +41,15 @@ import net.minecraft.util.math.BlockPos;
|
|||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.world.World;
|
||||
import reborncore.api.ToolManager;
|
||||
import reborncore.api.tile.IMachineGuiHandler;
|
||||
import reborncore.common.BaseTileBlock;
|
||||
import reborncore.api.blockentity.IMachineGuiHandler;
|
||||
import reborncore.common.BaseBlockEntityProvider;
|
||||
import reborncore.common.blocks.BlockWrenchEventHandler;
|
||||
import reborncore.common.util.WrenchUtils;
|
||||
|
||||
/**
|
||||
* Created by Rushmead
|
||||
*/
|
||||
public abstract class BlockEnergyStorage extends BaseTileBlock {
|
||||
public abstract class BlockEnergyStorage extends BaseBlockEntityProvider {
|
||||
public static DirectionProperty FACING = Properties.FACING;
|
||||
public String name;
|
||||
public IMachineGuiHandler gui;
|
||||
|
@ -101,10 +101,10 @@ public abstract class BlockEnergyStorage extends BaseTileBlock {
|
|||
@Override
|
||||
public boolean activate(BlockState state, World worldIn, BlockPos pos, PlayerEntity playerIn, Hand hand, BlockHitResult hitResult) {
|
||||
ItemStack stack = playerIn.getStackInHand(Hand.MAIN_HAND);
|
||||
BlockEntity tileEntity = worldIn.getBlockEntity(pos);
|
||||
BlockEntity blockEntity = worldIn.getBlockEntity(pos);
|
||||
|
||||
// We extended BlockTileBase. Thus we should always have tile entity. I hope.
|
||||
if (tileEntity == null) {
|
||||
// We extended BlockTileBase. Thus we should always have blockEntity entity. I hope.
|
||||
if (blockEntity == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ import net.minecraft.world.World;
|
|||
import reborncore.common.RebornCoreConfig;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.tiles.storage.TileHighVoltageSU;
|
||||
import techreborn.blockentity.storage.HighVoltageSUBlockEntity;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 14/03/2016.
|
||||
|
@ -47,7 +47,7 @@ public class BlockHighVoltageSU extends BlockEnergyStorage {
|
|||
|
||||
@Override
|
||||
public BlockEntity createBlockEntity(BlockView worldIn) {
|
||||
return new TileHighVoltageSU();
|
||||
return new HighVoltageSUBlockEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -36,7 +36,7 @@ import net.minecraft.world.World;
|
|||
import reborncore.common.RebornCoreConfig;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.tiles.storage.idsu.TileInterdimensionalSU;
|
||||
import techreborn.blockentity.storage.idsu.InterdimensionalSUBlockEntity;
|
||||
|
||||
public class BlockInterdimensionalSU extends BlockEnergyStorage {
|
||||
|
||||
|
@ -46,14 +46,14 @@ public class BlockInterdimensionalSU extends BlockEnergyStorage {
|
|||
|
||||
@Override
|
||||
public BlockEntity createBlockEntity(BlockView worldIn) {
|
||||
return new TileInterdimensionalSU();
|
||||
return new InterdimensionalSUBlockEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getPlacementState(ItemPlacementContext context) {
|
||||
final BlockEntity tile = context.getWorld().getBlockEntity(context.getBlockPos());
|
||||
if (tile instanceof TileInterdimensionalSU) {
|
||||
((TileInterdimensionalSU) tile).ownerUdid = context.getPlayer().getUuid().toString();
|
||||
final BlockEntity blockEntity = context.getWorld().getBlockEntity(context.getBlockPos());
|
||||
if (blockEntity instanceof InterdimensionalSUBlockEntity) {
|
||||
((InterdimensionalSUBlockEntity) blockEntity).ownerUdid = context.getPlayer().getUuid().toString();
|
||||
}
|
||||
return this.getDefaultState();
|
||||
}
|
||||
|
@ -61,9 +61,9 @@ public class BlockInterdimensionalSU extends BlockEnergyStorage {
|
|||
@Override
|
||||
public void onPlaced(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack stack) {
|
||||
super.onPlaced(world, pos, state, placer, stack);
|
||||
BlockEntity tile = world.getBlockEntity(pos);
|
||||
if (tile instanceof TileInterdimensionalSU) {
|
||||
((TileInterdimensionalSU) tile).ownerUdid = placer.getUuid().toString();
|
||||
BlockEntity blockEntity = world.getBlockEntity(pos);
|
||||
if (blockEntity instanceof InterdimensionalSUBlockEntity) {
|
||||
((InterdimensionalSUBlockEntity) blockEntity).ownerUdid = placer.getUuid().toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -38,17 +38,17 @@ import net.minecraft.util.math.BlockPos;
|
|||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
import reborncore.api.ToolManager;
|
||||
import reborncore.common.BaseTileBlock;
|
||||
import reborncore.common.BaseBlockEntityProvider;
|
||||
import reborncore.common.RebornCoreConfig;
|
||||
import reborncore.common.blocks.BlockWrenchEventHandler;
|
||||
import reborncore.common.util.WrenchUtils;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.tiles.storage.lesu.TileLSUStorage;
|
||||
import techreborn.blockentity.storage.lesu.LSUStorageBlockEntity;
|
||||
|
||||
/**
|
||||
* Energy storage block for LESU
|
||||
*/
|
||||
public class BlockLSUStorage extends BaseTileBlock {
|
||||
public class BlockLSUStorage extends BaseBlockEntityProvider {
|
||||
|
||||
public BlockLSUStorage() {
|
||||
super(FabricBlockSettings.of(Material.METAL).strength(2f, 2f).build());
|
||||
|
@ -61,10 +61,10 @@ public class BlockLSUStorage extends BaseTileBlock {
|
|||
if (state.getBlock() == newState.getBlock()) {
|
||||
return;
|
||||
}
|
||||
if (worldIn.getBlockEntity(pos) instanceof TileLSUStorage) {
|
||||
TileLSUStorage tile = (TileLSUStorage) worldIn.getBlockEntity(pos);
|
||||
if (tile != null) {
|
||||
tile.removeFromNetwork();
|
||||
if (worldIn.getBlockEntity(pos) instanceof LSUStorageBlockEntity) {
|
||||
LSUStorageBlockEntity blockEntity = (LSUStorageBlockEntity) worldIn.getBlockEntity(pos);
|
||||
if (blockEntity != null) {
|
||||
blockEntity.removeFromNetwork();
|
||||
}
|
||||
}
|
||||
super.onBlockRemoved(state, worldIn, pos, newState, isMoving);
|
||||
|
@ -72,16 +72,16 @@ public class BlockLSUStorage extends BaseTileBlock {
|
|||
|
||||
@Override
|
||||
public BlockEntity createBlockEntity(BlockView worldIn) {
|
||||
return new TileLSUStorage();
|
||||
return new LSUStorageBlockEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlaced(World world, BlockPos pos, BlockState state, LivingEntity player, ItemStack itemstack) {
|
||||
super.onPlaced(world, pos, state, player, itemstack);
|
||||
if (world.getBlockEntity(pos) instanceof TileLSUStorage) {
|
||||
TileLSUStorage tile = (TileLSUStorage) world.getBlockEntity(pos);
|
||||
if (tile != null) {
|
||||
tile.rebuildNetwork();
|
||||
if (world.getBlockEntity(pos) instanceof LSUStorageBlockEntity) {
|
||||
LSUStorageBlockEntity blockEntity = (LSUStorageBlockEntity) world.getBlockEntity(pos);
|
||||
if (blockEntity != null) {
|
||||
blockEntity.rebuildNetwork();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -90,10 +90,10 @@ public class BlockLSUStorage extends BaseTileBlock {
|
|||
@Override
|
||||
public boolean activate(BlockState state, World worldIn, BlockPos pos, PlayerEntity playerIn, Hand hand, BlockHitResult hitResult) {
|
||||
ItemStack stack = playerIn.getStackInHand(Hand.MAIN_HAND);
|
||||
BlockEntity tileEntity = worldIn.getBlockEntity(pos);
|
||||
BlockEntity blockEntity = worldIn.getBlockEntity(pos);
|
||||
|
||||
// We extended BaseTileBlock. Thus we should always have tile entity. I hope.
|
||||
if (tileEntity == null) {
|
||||
// We extended BaseTileBlock. Thus we should always have blockEntity entity. I hope.
|
||||
if (blockEntity == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ import net.minecraft.world.World;
|
|||
import reborncore.common.RebornCoreConfig;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.tiles.storage.lesu.TileLapotronicSU;
|
||||
import techreborn.blockentity.storage.lesu.LapotronicSUBlockEntity;
|
||||
|
||||
public class BlockLapotronicSU extends BlockEnergyStorage {
|
||||
|
||||
|
@ -44,7 +44,7 @@ public class BlockLapotronicSU extends BlockEnergyStorage {
|
|||
|
||||
@Override
|
||||
public BlockEntity createBlockEntity(BlockView worldIn) {
|
||||
return new TileLapotronicSU();
|
||||
return new LapotronicSUBlockEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue