Skip to content

Commit

Permalink
Fix quartz fixtures not being placeable on wall blocks.
Browse files Browse the repository at this point in the history
  • Loading branch information
shartte committed Sep 28, 2022
1 parent 0fb72b0 commit ac92184
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
6 changes: 2 additions & 4 deletions src/main/java/appeng/block/misc/LightDetectorBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,8 @@ public boolean isValidOrientation(LevelAccessor level, BlockPos pos, Direction f
return this.canPlaceAt(level, pos, up.getOpposite());
}

private boolean canPlaceAt(BlockGetter level, BlockPos pos, Direction dir) {
final BlockPos test = pos.relative(dir);
BlockState blockstate = level.getBlockState(test);
return blockstate.isFaceSturdy(level, test, dir.getOpposite());
private boolean canPlaceAt(LevelReader level, BlockPos pos, Direction dir) {
return canSupportCenter(level, pos.relative(dir), dir.getOpposite());
}

@Override
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/appeng/block/misc/QuartzFixtureBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,7 @@ public boolean isValidOrientation(LevelAccessor level, BlockPos pos, Direction f
}

private boolean canPlaceAt(LevelReader level, BlockPos pos, Direction dir) {
final BlockPos test = pos.relative(dir);
BlockState blockstate = level.getBlockState(test);
return blockstate.isFaceSturdy(level, test, dir.getOpposite());
return canSupportCenter(level, pos.relative(dir), dir.getOpposite());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ protected void addTags() {
AEBlocks.CHISELED_QUARTZ_WALL.block(),
AEBlocks.QUARTZ_PILLAR_WALL.block());

// Fixtures should cause walls to have posts
tag(BlockTags.WALL_POST_OVERRIDE).add(AEBlocks.QUARTZ_FIXTURE.block(), AEBlocks.LIGHT_DETECTOR.block());

addEffectiveTools();

addConventionTags();
Expand Down

0 comments on commit ac92184

Please sign in to comment.