Skip to content

[Bug]: Seems Squaremap is still not picking up the framed blocks ?! (with awnser from framed block devs) #514

@PassyFox

Description

@PassyFox

Conflict with xfacthd.framedblocks.api.block.IFramedBlock, if this is reproducible with the latest version of squaremap you can open a new issue.

Originally posted by @jpenilla in #513

This is caused by a mistake (I don't really want to call it a bug because their comment on the linked code is technically correct) in SquareMap, they are passing null into a method they should not be passing it into:

@SuppressWarnings("ConstantConditions") // params for getMapColor are never used, check on mc update
public int getMapColor(final BlockState state) {
final int special = this.blockColors.color(state);
if (special != -1) {
return special;
}
return Colors.rgb(state.getMapColor(null, null));
}
, particularly when running on NeoForge as it allows mods to make use of the data they are omitting:

FramedBlocks/src/main/java/io/github/xfacthd/framedblocks/api/block/IFramedBlock.java

Lines 563 to 575 in 005d539

@OverRide
default MapColor getMapColor(BlockState state, BlockGetter level, BlockPos pos, MapColor defaultColor)
{
if (level.getBlockEntity(pos) instanceof FramedBlockEntity be)
{
MapColor color = be.getMapColor();
if (color != null)
{
return color;
}
}
return defaultColor;
}
. You'll have to report this to them with these two links.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions