use of com.minecolonies.structures.lib.ModelHolder in project minecolonies by Minecolonies.
the class RenderUtils method renderColonyBorder.
/**
* Render the colony border.
* @param position the position of the structure.
* @param clientWorld the world.
* @param partialTicks the partial ticks.
* @param thePlayer the player clicking.
* @param colonyBorder the border of the colony.
*/
public static void renderColonyBorder(final BlockPos position, final WorldClient clientWorld, final float partialTicks, final EntityPlayerSP thePlayer, final List<BlockPos> colonyBorder) {
if (colonyBorder.isEmpty()) {
calculateColonyBorder(clientWorld, thePlayer, colonyBorder);
}
for (final BlockPos pos : colonyBorder) {
final Block block = Blocks.DIAMOND_BLOCK;
final IBlockState iblockstate = block.getDefaultState();
final IBlockState iBlockExtendedState = block.getExtendedState(iblockstate, clientWorld, pos);
final IBakedModel ibakedmodel = Minecraft.getMinecraft().getBlockRendererDispatcher().getModelForState(iblockstate);
final TileEntity tileentity = null;
final ModelHolder models = new ModelHolder(pos, iblockstate, iBlockExtendedState, tileentity, ibakedmodel);
Structure.getQuads(models, models.quads);
Settings.instance.getActiveStructure().renderGhost(clientWorld, models, thePlayer, partialTicks);
}
}
use of com.minecolonies.structures.lib.ModelHolder in project minecolonies by Minecolonies.
the class Structure method renderStructure.
/**
* Renders the structure.
*
* @param startingPos the start pos to render.
* @param clientWorld the world of the client.
* @param player the player object.
* @param partialTicks the partial ticks.
*/
public void renderStructure(@NotNull final BlockPos startingPos, @NotNull final World clientWorld, @NotNull final EntityPlayer player, final float partialTicks) {
final Template.BlockInfo[] blockList = this.getBlockInfoWithSettings(this.settings);
final Entity[] entityList = this.getEntityInfoWithSettings(clientWorld, startingPos, this.settings);
for (final Template.BlockInfo aBlockList : blockList) {
Block block = aBlockList.blockState.getBlock();
IBlockState iblockstate = aBlockList.blockState;
if (block == ModBlocks.blockSubstitution) {
continue;
}
if (block == ModBlocks.blockSolidSubstitution) {
iblockstate = BlockUtils.getSubstitutionBlockAtWorld(clientWorld, startingPos);
block = iblockstate.getBlock();
}
final BlockPos blockpos = aBlockList.pos.add(startingPos);
final IBlockState iBlockExtendedState = block.getExtendedState(iblockstate, clientWorld, blockpos);
final IBakedModel ibakedmodel = Minecraft.getMinecraft().getBlockRendererDispatcher().getModelForState(iblockstate);
TileEntity tileentity = null;
if (block.hasTileEntity(iblockstate) && aBlockList.tileentityData != null) {
tileentity = block.createTileEntity(clientWorld, iblockstate);
tileentity.readFromNBT(aBlockList.tileentityData);
}
final ModelHolder models = new ModelHolder(blockpos, iblockstate, iBlockExtendedState, tileentity, ibakedmodel);
getQuads(models, models.quads);
this.renderGhost(clientWorld, models, player, partialTicks);
}
for (final Entity anEntityList : entityList) {
if (anEntityList != null) {
Minecraft.getMinecraft().getRenderManager().renderEntityStatic(anEntityList, 0.0F, true);
}
}
}
Aggregations