Guest User

Untitled

a guest
Nov 4th, 2018
716
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.03 KB | None | 0 0
  1. package com.TheRPGAdventurer.ROTD.client.render.dragon.layer;
  2.  
  3. import java.util.UUID;
  4.  
  5. import javax.annotation.Nullable;
  6.  
  7. import org.apache.commons.lang3.StringUtils;
  8.  
  9. import com.TheRPGAdventurer.ROTD.client.model.dragon.DragonModel;
  10. import com.TheRPGAdventurer.ROTD.client.render.dragon.DragonRenderer;
  11. import com.TheRPGAdventurer.ROTD.client.render.dragon.breeds.DefaultDragonBreedRenderer;
  12. import com.TheRPGAdventurer.ROTD.server.entity.EntityTameableDragon;
  13. import com.TheRPGAdventurer.ROTD.util.math.MathX;
  14. import com.mojang.authlib.GameProfile;
  15.  
  16. import net.minecraft.block.BlockBanner;
  17. import net.minecraft.block.BlockPumpkin;
  18. import net.minecraft.block.state.IBlockState;
  19. import net.minecraft.client.Minecraft;
  20. import net.minecraft.client.model.ModelBanner;
  21. import net.minecraft.client.renderer.BannerTextures;
  22. import net.minecraft.client.renderer.GlStateManager;
  23. import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
  24. import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType;
  25. import net.minecraft.client.renderer.entity.layers.LayerCustomHead;
  26. import net.minecraft.client.renderer.tileentity.TileEntityBannerRenderer;
  27. import net.minecraft.client.renderer.tileentity.TileEntitySkullRenderer;
  28. import net.minecraft.entity.monster.EntityZombieVillager;
  29. import net.minecraft.entity.passive.EntityVillager;
  30. import net.minecraft.init.Blocks;
  31. import net.minecraft.init.Items;
  32. import net.minecraft.inventory.EntityEquipmentSlot;
  33. import net.minecraft.item.Item;
  34. import net.minecraft.item.ItemArmor;
  35. import net.minecraft.item.ItemBanner;
  36. import net.minecraft.item.ItemStack;
  37. import net.minecraft.nbt.NBTTagCompound;
  38. import net.minecraft.nbt.NBTUtil;
  39. import net.minecraft.tileentity.TileEntityBanner;
  40. import net.minecraft.tileentity.TileEntitySkull;
  41. import net.minecraft.util.EnumFacing;
  42. import net.minecraft.util.ResourceLocation;
  43. import net.minecraft.util.math.MathHelper;
  44.  
  45. public class LayerRendererDragonBanner extends LayerRendererDragon {
  46.  
  47. private final ModelBanner bannerModel = new ModelBanner();
  48.  
  49. public LayerRendererDragonBanner(DragonRenderer renderer, DefaultDragonBreedRenderer breedRenderer,
  50. DragonModel model) {
  51. super(renderer, breedRenderer, model);
  52.  
  53. }
  54.  
  55. @Override
  56. public void doRenderLayer(EntityTameableDragon dragon, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
  57. Minecraft mc = Minecraft.getMinecraft();
  58. ItemStack itemstack = dragon.dragonInv.getStackInSlot(31);
  59. ItemStack itemstack2 = dragon.dragonInv.getStackInSlot(32);
  60.  
  61. GlStateManager.pushMatrix();
  62.  
  63. if(!itemstack.isEmpty()) {
  64. float f = 0.625F;
  65. model.body.postRender(0.0625F);
  66. GlStateManager.translate(1.0F, 0.4, -0.8F);
  67. GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F);
  68. GlStateManager.scale(0.625F, -0.625F, -0.625F);
  69. mc.getItemRenderer().renderItem(dragon, itemstack, ItemCameraTransforms.TransformType.HEAD);
  70.  
  71. }
  72.  
  73. GlStateManager.popMatrix();
  74.  
  75. GlStateManager.pushMatrix();;
  76.  
  77. if (!itemstack2.isEmpty()) {
  78. float f = 0.625F;
  79. model.body.postRender(0.0625F);
  80. GlStateManager.translate(-1.0F, 0.4, -0.8F);
  81. GlStateManager.rotate(-90.0F, 0.0F, 1.0F, 0.0F);
  82. // GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
  83. GlStateManager.scale(0.625F, -0.625F, -0.625F);
  84. mc.getItemRenderer().renderItem(dragon, itemstack2, ItemCameraTransforms.TransformType.HEAD);
  85. }
  86.  
  87. GlStateManager.popMatrix();
  88. }
  89.  
  90. @Nullable
  91. private ResourceLocation getBannerResourceLocation(TileEntityBanner bannerObj) {
  92. return BannerTextures.BANNER_DESIGNS.getResourceLocation(bannerObj.getPatternResourceLocation(), bannerObj.getPatternList(), bannerObj.getColorList());
  93. }
  94.  
  95. @Override
  96. public boolean shouldCombineTextures() {
  97. return true;
  98. }
  99.  
  100. }
Advertisement
Add Comment
Please, Sign In to add comment