use of com.minecolonies.api.colony.IGraveData in project minecolonies by Minecolonies.
the class ColonyDeathpoints method tryCreatingWaypoint.
@Nullable
private static Waypoint tryCreatingWaypoint(@NotNull final Journeymap jmap, @NotNull final IColonyView colony, @NotNull final IChunk chunk, @NotNull final BlockPos pos) {
if (!jmap.getApi().playerAccepts(MOD_ID, DisplayType.Waypoint))
return null;
final TileEntity blockEntity = chunk.getBlockEntity(pos);
if (blockEntity instanceof AbstractTileEntityGrave) {
final IGraveData grave = ((AbstractTileEntityGrave) blockEntity).getGraveData();
if (grave != null) {
final String text = grave.getCitizenJobName() == null ? LanguageHandler.format(COM_MINECOLONIES_JMAP_PREFIX + "deathpoint_name", grave.getCitizenName()) : LanguageHandler.format(COM_MINECOLONIES_JMAP_PREFIX + "deathpoint_namejob", grave.getCitizenName(), grave.getCitizenJobName());
final Waypoint waypoint = new Waypoint(MOD_ID, text, colony.getDimension(), pos);
waypoint.setEditable(true).setPersistent(false).setIcon(deathIcon.get()).setColor(0x888888);
jmap.show(waypoint);
return waypoint;
}
}
return null;
}
use of com.minecolonies.api.colony.IGraveData in project minecolonies by ldtteam.
the class ColonyDeathpoints method tryCreatingWaypoint.
@Nullable
private static Waypoint tryCreatingWaypoint(@NotNull final Journeymap jmap, @NotNull final IColonyView colony, @NotNull final IChunk chunk, @NotNull final BlockPos pos) {
if (!jmap.getApi().playerAccepts(MOD_ID, DisplayType.Waypoint))
return null;
final TileEntity blockEntity = chunk.getBlockEntity(pos);
if (blockEntity instanceof AbstractTileEntityGrave) {
final IGraveData grave = ((AbstractTileEntityGrave) blockEntity).getGraveData();
if (grave != null) {
final String text = grave.getCitizenJobName() == null ? LanguageHandler.format(COM_MINECOLONIES_JMAP_PREFIX + "deathpoint_name", grave.getCitizenName()) : LanguageHandler.format(COM_MINECOLONIES_JMAP_PREFIX + "deathpoint_namejob", grave.getCitizenName(), grave.getCitizenJobName());
final Waypoint waypoint = new Waypoint(MOD_ID, text, colony.getDimension(), pos);
waypoint.setEditable(true).setPersistent(false).setIcon(deathIcon.get()).setColor(0x888888);
jmap.show(waypoint);
return waypoint;
}
}
return null;
}
Aggregations