Skip to content

Commit

Permalink
Fix compatibility with non-Create CT mods
Browse files Browse the repository at this point in the history
  • Loading branch information
hlysine committed Jan 19, 2025
1 parent 1dd496c commit d3d78f5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,10 @@ default void playerWillDestroy(Level level, BlockPos pos, BlockState state, Play

static BlockState getAppearance(ICopycatBlock block, BlockState state, BlockAndTintGetter level, BlockPos pos, Direction side,
BlockState queryState, BlockPos queryPos) {
// queryState is inconsistent between different CT mods
// our assumption is that queryState refers to the true block state (copycat), not the material
queryState = level.getBlockState(queryPos);

if (block.isIgnoredConnectivitySide(level, state, side, pos, queryPos, queryState))
return state;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,10 @@ default void fillEmptyParts(Level level, BlockPos pos, BlockState state, BlockSt

static BlockState getAppearance(IMultiStateCopycatBlock block, BlockState state, BlockAndTintGetter level, BlockPos pos, Direction side,
BlockState queryState, BlockPos queryPos) {
// queryState is inconsistent between different CT mods
// our assumption is that queryState refers to the true block state (copycat), not the material
queryState = level.getBlockState(queryPos);

BlockAndTintGetter reader = Mods.ATHENA.runIfInstalled(() -> () -> AthenaCompat.unwrapAthenaGetter(level)).orElse(level);

if (reader instanceof ScaledBlockAndTintGetter scaledLevel && state.getBlock() instanceof IMultiStateCopycatBlock) {
Expand Down

0 comments on commit d3d78f5

Please sign in to comment.