Advertisement
Guest User

Untitled

a guest
Aug 15th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. public void renderStructure(@NotNull final BlockPos startingPos, @NotNull final World clientWorld, @NotNull final EntityPlayer player, final float partialTicks)
  2. {
  3. final Template.BlockInfo[] blockList = this.getBlockInfoWithSettings(this.settings);
  4. final Entity[] entityList = this.getEntityInfoWithSettings(clientWorld, startingPos, this.settings);
  5.  
  6. for (final Template.BlockInfo aBlockList : blockList)
  7. {
  8. Block block = aBlockList.blockState.getBlock();
  9. IBlockState iblockstate = aBlockList.blockState;
  10.  
  11. if (block == ModBlocks.blockSubstitution)
  12. {
  13. continue;
  14. }
  15.  
  16. if (block == ModBlocks.blockSolidSubstitution)
  17. {
  18. iblockstate = BlockUtils.getSubstitutionBlockAtWorld(clientWorld, startingPos);
  19. block = iblockstate.getBlock();
  20. }
  21.  
  22. final BlockPos blockpos = aBlockList.pos.add(startingPos);
  23. final IBlockState iBlockExtendedState = block.getExtendedState(iblockstate, clientWorld, blockpos);
  24. final IBakedModel ibakedmodel = Minecraft.getMinecraft().getBlockRendererDispatcher().getModelForState(iblockstate);
  25. TileEntity tileentity = null;
  26. if (block.hasTileEntity(iblockstate) && aBlockList.tileentityData != null)
  27. {
  28. tileentity = block.createTileEntity(clientWorld, iblockstate);
  29. tileentity.readFromNBT(aBlockList.tileentityData);
  30. }
  31. final ModelHolder models = new ModelHolder(blockpos, iblockstate, iBlockExtendedState, tileentity, ibakedmodel);
  32. getQuads(models, models.quads);
  33. this.renderGhost(clientWorld, models, player, partialTicks);
  34. }
  35.  
  36. for (final Entity anEntityList : entityList)
  37. {
  38. if (anEntityList != null)
  39. {
  40. Minecraft.getMinecraft().getRenderManager().renderEntityStatic(anEntityList, 0.0F, true);
  41. }
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement