Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.

Commit

Permalink
Fixed #316
Browse files Browse the repository at this point in the history
- Moved camouflage logic in `getBlockFaceShape` method from `StargateAbstractMemberBlock` to `StargateClassicMemberBlock`
- `BlockFaceShape.SOLID` will be returned if member block isn't merged
  • Loading branch information
slava110 committed Jun 8, 2021
1 parent 4b796bc commit 1aec430
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,6 @@ public boolean isFullBlock(IBlockState state) {

@Override
public BlockFaceShape getBlockFaceShape(IBlockAccess world, IBlockState state, BlockPos pos, EnumFacing facing) {
if (state.getValue(AunisProps.RENDER_BLOCK)) {
// Rendering some block
StargateClassicMemberTile memberTile = (StargateClassicMemberTile) world.getTileEntity(pos);
if (memberTile != null && memberTile.getCamoState() != null) {
return memberTile.getCamoState().getBlockFaceShape(world, pos, facing);
}
}

return BlockFaceShape.UNDEFINED;
return state.getValue(AunisProps.RENDER_BLOCK) ? BlockFaceShape.SOLID : BlockFaceShape.UNDEFINED;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import net.minecraft.block.BlockSlab;
import net.minecraft.block.SoundType;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.BlockFaceShape;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.model.IBakedModel;
Expand Down Expand Up @@ -379,4 +380,16 @@ public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess access, Bloc
public AxisAlignedBB getCollisionBoundingBox(IBlockState state, IBlockAccess access, BlockPos pos) {
return CamoPropertiesHelper.getStargateBlockBoundingBox(state, access, pos, true);
}

@Override
public BlockFaceShape getBlockFaceShape(IBlockAccess world, IBlockState state, BlockPos pos, EnumFacing facing) {
if (state.getValue(AunisProps.RENDER_BLOCK)) {
// Rendering camouflage block
StargateClassicMemberTile memberTile = (StargateClassicMemberTile) world.getTileEntity(pos);
if (memberTile != null && memberTile.getCamoState() != null) {
return memberTile.getCamoState().getBlockFaceShape(world, pos, facing);
}
}
return super.getBlockFaceShape(world, state, pos, facing);
}
}

0 comments on commit 1aec430

Please sign in to comment.