Skip to content

Commit

Permalink
Fix pots not caching their hopping status.
Browse files Browse the repository at this point in the history
  • Loading branch information
Darkhax committed Oct 10, 2023
1 parent 07811a9 commit ca81c07
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,21 @@ public class BlockEntityBotanyPot extends WorldlyInventoryBlockEntity<BotanyPotC

final Random rng = new Random();
private long rngSeed;
private boolean isHopper = false;

public BlockEntityBotanyPot(BlockEntityType potType, BlockPos pos, BlockState state) {

super(potType, pos, state);
this.refreshRandom();

if (state.getBlock() instanceof BlockBotanyPot pot) {
this.isHopper = pot.hasInventory();
}
}

public boolean isHopper() {

if (this.getLevel() != null && this.getLevel().getBlockState(this.getBlockPos()).getBlock() instanceof BlockBotanyPot potBlock) {

return potBlock.hasInventory();
}

return false;
return this.isHopper;
}

public void refreshRandom() {
Expand Down

0 comments on commit ca81c07

Please sign in to comment.