Skip to content

Commit

Permalink
Fix omnihopper not remembering upgrades & direction on placement
Browse files Browse the repository at this point in the history
  • Loading branch information
desht committed Sep 10, 2023
1 parent f014ce6 commit 5d1bac4
Showing 1 changed file with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public abstract class AbstractHopperBlockEntity<T extends BlockEntity & IRedston
AABB outputAABB;
final List<Entity> cachedInputEntities = new ArrayList<>();
final List<Entity> cachedOutputEntities = new ArrayList<>();
private boolean firstTick = true;

AbstractHopperBlockEntity(BlockEntityType<?> type, BlockPos pos, BlockState state) {
super(type, pos, state, 4);
Expand All @@ -65,16 +66,6 @@ public Direction getInputDirection() {
return getBlockState().getValue(OmnidirectionalHopperBlock.INPUT_FACING);
}

@Override
public void onLoad() {
super.onLoad();

if (!nonNullLevel().isClientSide) {
isCreative = getUpgrades(ModUpgrades.CREATIVE.get()) > 0;
setupInputOutputRegions();
}
}

@Override
public void onBlockRotated() {
super.onBlockRotated();
Expand All @@ -87,6 +78,12 @@ public void onBlockRotated() {
public void tickServer() {
inputDir = getInputDirection();

if (firstTick) {
isCreative = getUpgrades(ModUpgrades.CREATIVE.get()) > 0;
setupInputOutputRegions();
firstTick = false;
}

super.tickServer();

if (getRedstoneController().shouldRun()) {
Expand Down

0 comments on commit 5d1bac4

Please sign in to comment.