Skip to content

Commit ed299c4

Browse files
committed
Fix Heaters not checking blocks when first placed
1 parent 3ba70ef commit ed299c4

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

src/main/java/falseresync/vivatech/common/block/HeaterBlock.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import net.minecraft.block.entity.BlockEntityTicker;
1313
import net.minecraft.block.entity.BlockEntityType;
1414
import net.minecraft.util.math.BlockPos;
15+
import net.minecraft.util.math.Direction;
1516
import net.minecraft.world.World;
1617
import org.jetbrains.annotations.Nullable;
1718

@@ -37,6 +38,18 @@ protected void neighborUpdate(BlockState state, World world, BlockPos pos, Block
3738
}
3839
}
3940

41+
@Override
42+
protected void onBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean notify) {
43+
super.onBlockAdded(state, world, pos, oldState, notify);
44+
if (!world.isClient) {
45+
if (world.getBlockEntity(pos) instanceof HeaterBlockEntity heater) {
46+
for (var direction : Direction.values()) {
47+
heater.scan(pos.offset(direction));
48+
}
49+
}
50+
}
51+
}
52+
4053
@Override
4154
public BlockEntity createBlockEntity(BlockPos pos, BlockState state) {
4255
return new HeaterBlockEntity(pos, state);

0 commit comments

Comments
 (0)