Skip to content

Commit

Permalink
Fix tank comparator output.
Browse files Browse the repository at this point in the history
  • Loading branch information
covers1624 committed Sep 22, 2024
1 parent b9f1015 commit b0fc03c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,6 @@ public VoxelShape getShape(BlockState state, BlockGetter worldIn, BlockPos pos,
return shape;
}

@Override
public boolean hasAnalogOutputSignal(BlockState state) {
return true;
}

@Nullable
@Override
public BlockEntity newBlockEntity(BlockPos pos, BlockState state) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,12 @@ public boolean canConnectRedstone(BlockState state, BlockGetter world, BlockPos
@Override
public int getAnalogOutputSignal(BlockState state, Level world, BlockPos pos) {
BlockEntity tile = world.getBlockEntity(pos);
return tile instanceof TileFrequencyOwner ? ((TileFrequencyOwner) tile).comparatorInput() : 0;
return tile instanceof TileFrequencyOwner ? ((TileFrequencyOwner) tile).comparatorOutput() : 0;
}

@Override
public boolean hasAnalogOutputSignal(BlockState state) {
return true;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public boolean rotate() {
}

@Override
public int comparatorInput() {
public int comparatorOutput() {
return ItemHandlerHelper.calcRedstoneFromInventory(getItemHandler());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public boolean rotate() {
}

@Override
public int comparatorInput() {
public int comparatorOutput() {
IFluidTank tank = getStorage();
FluidStack fluid = tank.getFluid();
return fluid.getAmount() * 14 / tank.getCapacity() + (fluid.getAmount() > 0 ? 1 : 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
import codechicken.lib.vec.Cuboid6;
import net.minecraft.core.BlockPos;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.Connection;
import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
Expand Down Expand Up @@ -123,7 +121,7 @@ public boolean redstoneInteraction() {
return false;
}

public int comparatorInput() {
public int comparatorOutput() {
return 0;
}

Expand Down

0 comments on commit b0fc03c

Please sign in to comment.