Merge remote-tracking branch 'remotes/origin/1.15' into 1.16
# Conflicts: # build.gradle # src/main/java/techreborn/client/GuiHandler.java
This commit is contained in:
commit
0bf6159801
30 changed files with 374 additions and 231 deletions
src/main/java/techreborn/blockentity
cable
machine
|
@ -24,10 +24,6 @@
|
|||
|
||||
package techreborn.blockentity.cable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
|
@ -57,6 +53,10 @@ import techreborn.blocks.cable.CableBlock;
|
|||
import techreborn.init.TRBlockEntities;
|
||||
import techreborn.init.TRContent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 19/05/2017.
|
||||
*/
|
||||
|
@ -66,7 +66,7 @@ public class CableBlockEntity extends BlockEntity
|
|||
|
||||
private double energy = 0;
|
||||
private TRContent.Cables cableType = null;
|
||||
private ArrayList<EnergySide> sendingFace = new ArrayList<>();
|
||||
private ArrayList<Direction> sendingFace = new ArrayList<>();
|
||||
private BlockState cover = null;
|
||||
|
||||
public CableBlockEntity() {
|
||||
|
@ -143,17 +143,16 @@ public class CableBlockEntity extends BlockEntity
|
|||
|
||||
ArrayList<Pair<BlockEntity, Direction>> acceptors = new ArrayList<>();
|
||||
for (Direction face : Direction.values()) {
|
||||
EnergySide side = EnergySide.fromMinecraft(face);
|
||||
BlockEntity blockEntity = world.getBlockEntity(pos.offset(face));
|
||||
|
||||
if (blockEntity != null && Energy.valid(blockEntity)) {
|
||||
if (blockEntity instanceof CableBlockEntity && energy <= Energy.of(blockEntity).side(EnergySide.fromMinecraft(face)).getEnergy()) {
|
||||
if (blockEntity instanceof CableBlockEntity && energy <= Energy.of(blockEntity).side(face).getEnergy()) {
|
||||
continue;
|
||||
}
|
||||
if(Energy.of(blockEntity).side(EnergySide.fromMinecraft(face.getOpposite())).getMaxInput() > 0){
|
||||
if(Energy.of(blockEntity).side(face.getOpposite()).getMaxInput() > 0){
|
||||
acceptors.add(Pair.of(blockEntity, face));
|
||||
if (!sendingFace.contains(side)) {
|
||||
sendingFace.add(side);
|
||||
if (!sendingFace.contains(face)) {
|
||||
sendingFace.add(face);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -166,7 +165,7 @@ public class CableBlockEntity extends BlockEntity
|
|||
|
||||
acceptors.forEach(pair -> {
|
||||
Energy.of(this)
|
||||
.into(Energy.of(pair.getLeft()).side(EnergySide.fromMinecraft(pair.getRight().getOpposite())))
|
||||
.into(Energy.of(pair.getLeft()).side(pair.getRight().getOpposite()))
|
||||
.move();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -335,7 +335,7 @@ public class FusionControlComputerBlockEntity extends PowerAcceptorBlockEntity
|
|||
if (!hasStartedCrafting) {
|
||||
return 0;
|
||||
}
|
||||
return Integer.MAX_VALUE;
|
||||
return TechRebornConfig.fusionControlComputerMaxOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -39,7 +39,7 @@ import techreborn.init.TRContent;
|
|||
public class SoildCanningMachineBlockEntity extends GenericMachineBlockEntity implements BuiltScreenHandlerProvider {
|
||||
|
||||
public SoildCanningMachineBlockEntity() {
|
||||
super(TRBlockEntities.SOLID_CANNING_MACHINE, "SolidCanningMachine", TechRebornConfig.solidCanningMachineMaxInput, TechRebornConfig.solidFuelGeneratorMaxEnergy, TRContent.Machine.SOLID_CANNING_MACHINE.block, 3);
|
||||
super(TRBlockEntities.SOLID_CANNING_MACHINE, "SolidCanningMachine", TechRebornConfig.solidCanningMachineMaxInput, TechRebornConfig.solidCanningMachineMaxEnergy, TRContent.Machine.SOLID_CANNING_MACHINE.block, 3);
|
||||
final int[] inputs = new int[] { 0, 1 };
|
||||
final int[] outputs = new int[] { 2 };
|
||||
this.inventory = new RebornInventory<>(4, "SolidCanningMachineBlockEntity", 64, this);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue