Fix corner calculation for GreenhouseController
This commit is contained in:
parent
85d69faec7
commit
d5f995e7e9
1 changed files with 6 additions and 12 deletions
|
@ -62,7 +62,7 @@ public class GreenhouseControllerBlockEntity extends PowerAcceptorBlockEntity
|
||||||
private boolean growthBoost = false;
|
private boolean growthBoost = false;
|
||||||
private int workingIndex = 0;
|
private int workingIndex = 0;
|
||||||
// number of blocks from center
|
// number of blocks from center
|
||||||
private int range = 4;
|
private final int range = 4;
|
||||||
|
|
||||||
|
|
||||||
public GreenhouseControllerBlockEntity(BlockPos pos, BlockState state) {
|
public GreenhouseControllerBlockEntity(BlockPos pos, BlockState state) {
|
||||||
|
@ -85,10 +85,8 @@ public class GreenhouseControllerBlockEntity extends PowerAcceptorBlockEntity
|
||||||
Block block = blockState.getBlock();
|
Block block = blockState.getBlock();
|
||||||
|
|
||||||
if (growthBoost) {
|
if (growthBoost) {
|
||||||
if (block instanceof Fertilizable
|
if (block instanceof Fertilizable || block instanceof PlantBlock
|
||||||
|| block instanceof PlantBlock
|
|| block instanceof SugarCaneBlock || block instanceof CactusBlock
|
||||||
|| block instanceof SugarCaneBlock
|
|
||||||
|| block instanceof CactusBlock
|
|
||||||
) {
|
) {
|
||||||
if (getStored(EnergySide.UNKNOWN) > TechRebornConfig.greenhouseControllerEnergyPerBonemeal) {
|
if (getStored(EnergySide.UNKNOWN) > TechRebornConfig.greenhouseControllerEnergyPerBonemeal) {
|
||||||
useEnergy(TechRebornConfig.greenhouseControllerEnergyPerBonemeal);
|
useEnergy(TechRebornConfig.greenhouseControllerEnergyPerBonemeal);
|
||||||
|
@ -196,19 +194,15 @@ public class GreenhouseControllerBlockEntity extends PowerAcceptorBlockEntity
|
||||||
// PowerAcceptorBlockEntity
|
// PowerAcceptorBlockEntity
|
||||||
@Override
|
@Override
|
||||||
public void tick(World world, BlockPos pos, BlockState state, MachineBaseBlockEntity blockEntity) {
|
public void tick(World world, BlockPos pos, BlockState state, MachineBaseBlockEntity blockEntity) {
|
||||||
if (world == null){
|
super.tick(world, pos, state, blockEntity);
|
||||||
|
if (world == null || world.isClient){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (multiblockCenter == null) {
|
if (multiblockCenter == null) {
|
||||||
multiblockCenter = pos.offset(getFacing().getOpposite(), range + 1);
|
multiblockCenter = pos.offset(getFacing().getOpposite(), range);
|
||||||
}
|
}
|
||||||
|
|
||||||
charge(6);
|
charge(6);
|
||||||
super.tick(world, pos, state, blockEntity);
|
|
||||||
|
|
||||||
if (world.isClient) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getStored(EnergySide.UNKNOWN) < getEuPerTick(TechRebornConfig.greenhouseControllerEnergyPerTick)) {
|
if (getStored(EnergySide.UNKNOWN) < getEuPerTick(TechRebornConfig.greenhouseControllerEnergyPerTick)) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue