use of com.minecolonies.coremod.tileentities.TileEntityInfoPoster in project minecolonies by Minecolonies.
the class RenderUtils method renderSigns.
/**
* Render informal signs at the citizen.
*
* @param clientWorld the client world.
* @param partialTicks the partial ticks.
* @param citizenDataView the citizen data.
* @param player the player.
* @param citizen the citizen position
*/
public static void renderSigns(final WorldClient clientWorld, final float partialTicks, final CitizenDataView citizenDataView, final EntityPlayer player, final BlockPos citizen) {
final Block block = ModBlocks.blockInfoPoster;
final BlockPos vector = citizen.subtract(player.getPosition());
final EnumFacing facing = EnumFacing.getFacingFromVector(vector.getX(), 0, vector.getZ()).getOpposite();
final BlockPos pos = citizen.up(2).offset(facing);
final IBlockState iblockstate = block.getDefaultState().withProperty(BlockInfoPoster.FACING, facing);
final IBlockState iBlockExtendedState = block.getExtendedState(iblockstate, clientWorld, pos);
final IBakedModel ibakedmodel = Minecraft.getMinecraft().getBlockRendererDispatcher().getModelForState(iblockstate);
final TileEntityInfoPoster sign = new TileEntityInfoPoster();
sign.setPos(pos);
for (int i = 0; i < sign.signText.length; i++) {
if (i < citizenDataView.getLatestStatus().length) {
sign.signText[i] = citizenDataView.getLatestStatus()[i];
}
}
final ModelHolder models = new ModelHolder(pos, iblockstate, iBlockExtendedState, sign, ibakedmodel);
Structure.getQuads(models, models.quads);
new Structure(Minecraft.getMinecraft().world).renderGhost(clientWorld, models, player, partialTicks, false);
}
Aggregations