SHARE
TWEET

CommonProxy.java

GorgeousFreeman Dec 12th, 2018 19 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.vicmatskiv.mw;
  2.  
  3. import com.vicmatskiv.mw.ModernWarfareMod;
  4. import com.vicmatskiv.mw.attachments.ItemBipod;
  5. import com.vicmatskiv.mw.items.ItemLaserPointer;
  6. import com.vicmatskiv.mw.items.guns.AK12Factory;
  7. import com.vicmatskiv.mw.items.guns.AN94Factory;
  8. import com.vicmatskiv.mw.items.guns.KSG12Factory;
  9. import com.vicmatskiv.mw.items.guns.M1014Factory;
  10. import com.vicmatskiv.mw.items.guns.Remington900Factory;
  11. import com.vicmatskiv.mw.items.guns.SPAS12Factory;
  12. import com.vicmatskiv.mw.models.ACOG;
  13. import com.vicmatskiv.mw.models.AK12Mag;
  14. import com.vicmatskiv.mw.models.AK47iron;
  15. import com.vicmatskiv.mw.models.AKMiron1;
  16. import com.vicmatskiv.mw.models.AKMiron2;
  17. import com.vicmatskiv.mw.models.AS50Mag;
  18. import com.vicmatskiv.mw.models.Acog2;
  19. import com.vicmatskiv.mw.models.AngledGrip;
  20. import com.vicmatskiv.mw.models.Bipod;
  21. import com.vicmatskiv.mw.models.Bullet44;
  22. import com.vicmatskiv.mw.models.BulletBig;
  23. import com.vicmatskiv.mw.models.DeagleMag;
  24. import com.vicmatskiv.mw.models.DeagleTop;
  25. import com.vicmatskiv.mw.models.DragunovMag;
  26. import com.vicmatskiv.mw.models.FALIron;
  27. import com.vicmatskiv.mw.models.FNFALMag;
  28. import com.vicmatskiv.mw.models.G36CIron1;
  29. import com.vicmatskiv.mw.models.G36CIron2;
  30. import com.vicmatskiv.mw.models.GlockMagazine;
  31. import com.vicmatskiv.mw.models.GlockTop;
  32. import com.vicmatskiv.mw.models.Grip2;
  33. import com.vicmatskiv.mw.models.HP;
  34. import com.vicmatskiv.mw.models.Holo2;
  35. import com.vicmatskiv.mw.models.Holographic;
  36. import com.vicmatskiv.mw.models.KSG12Pump;
  37. import com.vicmatskiv.mw.models.Kobra;
  38. import com.vicmatskiv.mw.models.L115Bolt1;
  39. import com.vicmatskiv.mw.models.L115Bolt2;
  40. import com.vicmatskiv.mw.models.L115Mag;
  41. import com.vicmatskiv.mw.models.LP;
  42. import com.vicmatskiv.mw.models.Laser;
  43. import com.vicmatskiv.mw.models.Laser2;
  44. import com.vicmatskiv.mw.models.M107Mag;
  45. import com.vicmatskiv.mw.models.M110Mag;
  46. import com.vicmatskiv.mw.models.M14Iron;
  47. import com.vicmatskiv.mw.models.M14Mag;
  48. import com.vicmatskiv.mw.models.M1911Top;
  49. import com.vicmatskiv.mw.models.M240Mag;
  50. import com.vicmatskiv.mw.models.M4Iron1;
  51. import com.vicmatskiv.mw.models.M4Iron2;
  52. import com.vicmatskiv.mw.models.M9Mag;
  53. import com.vicmatskiv.mw.models.M9Top;
  54. import com.vicmatskiv.mw.models.MP40Mag;
  55. import com.vicmatskiv.mw.models.MP5Iron;
  56. import com.vicmatskiv.mw.models.MP5Mag;
  57. import com.vicmatskiv.mw.models.MP7Mag;
  58. import com.vicmatskiv.mw.models.Magazine762x39;
  59. import com.vicmatskiv.mw.models.MagnumCase;
  60. import com.vicmatskiv.mw.models.NATODrum100;
  61. import com.vicmatskiv.mw.models.NATOFamasMag;
  62. import com.vicmatskiv.mw.models.NATOG36Mag;
  63. import com.vicmatskiv.mw.models.NATOMag1;
  64. import com.vicmatskiv.mw.models.NATOMag2;
  65. import com.vicmatskiv.mw.models.P2000Top;
  66. import com.vicmatskiv.mw.models.P90Mag;
  67. import com.vicmatskiv.mw.models.P90iron;
  68. import com.vicmatskiv.mw.models.R870Pump;
  69. import com.vicmatskiv.mw.models.RPK74MMag;
  70. import com.vicmatskiv.mw.models.Reflex;
  71. import com.vicmatskiv.mw.models.Reflex2;
  72. import com.vicmatskiv.mw.models.ScarIron1;
  73. import com.vicmatskiv.mw.models.ScarIron2;
  74. import com.vicmatskiv.mw.models.ShotgunShell;
  75. import com.vicmatskiv.mw.models.Suppressor;
  76. import com.vicmatskiv.mw.models.VGrip;
  77. import com.vicmatskiv.mw.parts.ItemBarrel;
  78. import com.vicmatskiv.mw.parts.ItemCapacitor;
  79. import com.vicmatskiv.mw.parts.ItemCopperWiring;
  80. import com.vicmatskiv.mw.parts.ItemDeagleReceiver;
  81. import com.vicmatskiv.mw.parts.ItemDiode;
  82. import com.vicmatskiv.mw.parts.ItemInductor;
  83. import com.vicmatskiv.mw.parts.ItemLMGReceiver;
  84. import com.vicmatskiv.mw.parts.ItemP90Receiver;
  85. import com.vicmatskiv.mw.parts.ItemPistolUnderReceiver;
  86. import com.vicmatskiv.mw.parts.ItemResistor;
  87. import com.vicmatskiv.mw.parts.ItemRetractableStock;
  88. import com.vicmatskiv.mw.parts.ItemRevolverAction;
  89. import com.vicmatskiv.mw.parts.ItemRevolverGrip;
  90. import com.vicmatskiv.mw.parts.ItemRevolverReceiver;
  91. import com.vicmatskiv.mw.parts.ItemRifleReceiver;
  92. import com.vicmatskiv.mw.parts.ItemSMGReceiver;
  93. import com.vicmatskiv.mw.parts.ItemScarReceiver;
  94. import com.vicmatskiv.mw.parts.ItemSecondaryStock;
  95. import com.vicmatskiv.mw.parts.ItemShotgunGrip;
  96. import com.vicmatskiv.mw.parts.ItemShotgunReceiver;
  97. import com.vicmatskiv.mw.parts.ItemTransistor;
  98. import com.vicmatskiv.mw.parts.ItemUnderReceiver;
  99. import com.vicmatskiv.mw.parts.ItemWeaponReceiver;
  100. import com.vicmatskiv.mw.parts.ItemWeaponStock;
  101. import com.vicmatskiv.mw.parts.ItemWoodRifleStock;
  102. import com.vicmatskiv.mw.parts.ItemWoodWeaponStock;
  103. import com.vicmatskiv.mw.resources.ItemAluminumIngot;
  104. import com.vicmatskiv.mw.resources.ItemAluminumPlate;
  105. import com.vicmatskiv.mw.resources.ItemBullets;
  106. import com.vicmatskiv.mw.resources.ItemCGrip;
  107. import com.vicmatskiv.mw.resources.ItemCloth;
  108. import com.vicmatskiv.mw.resources.ItemCopperIngot;
  109. import com.vicmatskiv.mw.resources.ItemElectronics;
  110. import com.vicmatskiv.mw.resources.ItemGreenCloth;
  111. import com.vicmatskiv.mw.resources.ItemLeadIngot;
  112. import com.vicmatskiv.mw.resources.ItemMiniSteelPlate;
  113. import com.vicmatskiv.mw.resources.ItemOpticGlass;
  114. import com.vicmatskiv.mw.resources.ItemPiston;
  115. import com.vicmatskiv.mw.resources.ItemPlastic;
  116. import com.vicmatskiv.mw.resources.ItemRuby;
  117. import com.vicmatskiv.mw.resources.ItemSilicon;
  118. import com.vicmatskiv.mw.resources.ItemSteelDust;
  119. import com.vicmatskiv.mw.resources.ItemSteelIngot;
  120. import com.vicmatskiv.mw.resources.ItemSteelPlate;
  121. import com.vicmatskiv.mw.resources.ItemSulfurDust;
  122. import com.vicmatskiv.mw.resources.ItemTanCloth;
  123. import com.vicmatskiv.mw.resources.ItemTantalumIngot;
  124. import com.vicmatskiv.mw.resources.ItemTinIngot;
  125. import com.vicmatskiv.mw.resources.ItemTitaniumIngot;
  126. import com.vicmatskiv.weaponlib.AttachmentBuilder;
  127. import com.vicmatskiv.weaponlib.AttachmentCategory;
  128. import com.vicmatskiv.weaponlib.CustomArmor;
  129. import com.vicmatskiv.weaponlib.CustomRenderer;
  130. import com.vicmatskiv.weaponlib.ItemAttachment;
  131. import com.vicmatskiv.weaponlib.ItemBullet;
  132. import com.vicmatskiv.weaponlib.ItemMagazine;
  133. import com.vicmatskiv.weaponlib.LaserBeamRenderer;
  134. import com.vicmatskiv.weaponlib.ModContext;
  135. import com.vicmatskiv.weaponlib.Weapon;
  136. import java.util.function.BiConsumer;
  137. import java.util.function.Consumer;
  138. import net.minecraft.block.Block;
  139. import net.minecraft.client.model.ModelBase;
  140. import net.minecraft.client.model.ModelBiped;
  141. import net.minecraft.creativetab.CreativeTabs;
  142. import net.minecraft.entity.player.EntityPlayer;
  143. import net.minecraft.item.Item;
  144. import net.minecraft.item.ItemArmor;
  145. import net.minecraft.item.ItemBlock;
  146. import net.minecraft.item.ItemStack;
  147. import net.minecraft.util.ResourceLocation;
  148. import net.minecraft.util.SoundEvent;
  149. import net.minecraftforge.common.util.EnumHelper;
  150. import net.minecraftforge.fml.common.IWorldGenerator;
  151. import net.minecraftforge.fml.common.event.FMLInitializationEvent;
  152. import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper;
  153. import net.minecraftforge.fml.common.registry.GameRegistry;
  154. import net.minecraftforge.fml.common.registry.IForgeRegistryEntry;
  155. import net.minecraftforge.oredict.OreDictionary;
  156. import org.lwjgl.opengl.GL11;
  157.  
  158. public class CommonProxy {
  159.     public static ItemAttachment<Weapon> Reflex;
  160.     public static ItemAttachment<Weapon> Holo2;
  161.     public static ItemAttachment<Weapon> Kobra;
  162.     public static ItemAttachment<Weapon> ACOG;
  163.     public static ItemAttachment<Weapon> Scope;
  164.     public static ItemAttachment<Weapon> HP;
  165.     public static ItemAttachment<Weapon> Silencer;
  166.     public static ItemAttachment<Weapon> Laser;
  167.     public static ItemAttachment<Weapon> Laser2;
  168.     public static ItemAttachment<Weapon> Grip2;
  169.     public static ItemAttachment<Weapon> Grip;
  170.     public static ItemAttachment<Weapon> VGrip;
  171.     public static ItemAttachment<Weapon> Bipod;
  172.     public static ItemAttachment<Weapon> AKMIron;
  173.     public static ItemAttachment<Weapon> AR15Iron;
  174.     public static ItemAttachment<Weapon> Extra;
  175.     public static ItemAttachment<Weapon> GlockTop;
  176.     public static ItemAttachment<Weapon> G18Top;
  177.     public static ItemAttachment<Weapon> M9Top;
  178.     public static ItemAttachment<Weapon> P2000Top;
  179.     public static ItemAttachment<Weapon> DeagleTop;
  180.     public static ItemAttachment<Weapon> KSGPump;
  181.     public static ItemAttachment<Weapon> L115Bolt1;
  182.     public static ItemAttachment<Weapon> L115Bolt2;
  183.     public static ItemAttachment<Weapon> RevolverCase;
  184.     public static ItemAttachment<Weapon> R870Pump;
  185.     public static ItemAttachment<Weapon> M1911Top;
  186.     public static ItemBullet ShotgunShell;
  187.     public static ItemBullet Bullet556x39;
  188.     public static Item AK12;
  189.     public static ItemMagazine AK12Mag;
  190.  
  191.     public void init(Object mod, FMLInitializationEvent event) {
  192.         ModernWarfareMod.MOD_CONTEXT.init(mod, "mw", ModernWarfareMod.CHANNEL);
  193.         ShotgunShell = new ItemBullet.Builder().withModId("mw").withCreativeTab(ModernWarfareMod.gunsTab).withName("ShotgunShell").withModel(new ShotgunShell(), "ShotgunShell.png").withFirstPersonPositioning((player, itemStack) -> {
  194.             GL11.glTranslatef((float)0.1f, (float)-1.2f, (float)0.4f);
  195.             GL11.glRotatef((float)30.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  196.             GL11.glScaled((double)0.800000011920929, (double)0.800000011920929, (double)0.800000011920929);
  197.         }
  198.         ).withThirdPersonPositioning((player, itemStack) -> {
  199.             GL11.glTranslatef((float)-0.9f, (float)-0.29f, (float)0.8f);
  200.             GL11.glRotatef((float)-50.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  201.             GL11.glRotatef((float)80.0f, (float)1.0f, (float)0.0f, (float)0.0f);
  202.             GL11.glScaled((double)0.699999988079071, (double)0.699999988079071, (double)0.699999988079071);
  203.         }
  204.         ).withInventoryPositioning(itemStack -> {
  205.             GL11.glTranslatef((float)-0.8f, (float)-0.45f, (float)0.4f);
  206.             GL11.glRotatef((float)10.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  207.             GL11.glRotatef((float)2.0f, (float)1.0f, (float)0.0f, (float)0.0f);
  208.             GL11.glRotatef((float)0.0f, (float)0.0f, (float)0.0f, (float)1.0f);
  209.             GL11.glScaled((double)1.600000023841858, (double)1.600000023841858, (double)1.600000023841858);
  210.         }
  211.         ).withTextureName("Dummy.png").build(ModernWarfareMod.MOD_CONTEXT, ItemBullet.class);
  212.         Bullet556x39 = new ItemBullet.Builder().withModId("mw").withCreativeTab(ModernWarfareMod.gunsTab).withName("Bullet556x39").withModel(new BulletBig(), "Bullet.png").withFirstPersonPositioning((player, itemStack) -> {
  213.             GL11.glTranslatef((float)0.1f, (float)-1.0f, (float)0.4f);
  214.             GL11.glRotatef((float)30.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  215.             GL11.glScaled((double)0.4000000059604645, (double)0.30000001192092896, (double)0.4000000059604645);
  216.         }
  217.         ).withThirdPersonPositioning((player, itemStack) -> {
  218.             GL11.glTranslatef((float)-0.7f, (float)-0.29f, (float)0.7f);
  219.             GL11.glRotatef((float)-50.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  220.             GL11.glRotatef((float)80.0f, (float)1.0f, (float)0.0f, (float)0.0f);
  221.             GL11.glScaled((double)0.5, (double)0.44999998807907104, (double)0.5);
  222.         }
  223.         ).withInventoryPositioning(itemStack -> {
  224.             GL11.glTranslatef((float)-0.8f, (float)-0.45f, (float)0.4f);
  225.             GL11.glRotatef((float)10.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  226.             GL11.glRotatef((float)2.0f, (float)1.0f, (float)0.0f, (float)0.0f);
  227.             GL11.glRotatef((float)0.0f, (float)0.0f, (float)0.0f, (float)1.0f);
  228.             GL11.glScaled((double)1.399999976158142, (double)1.2999999523162842, (double)1.399999976158142);
  229.         }
  230.         ).withTextureName("Dummy.png").build(ModernWarfareMod.MOD_CONTEXT, ItemBullet.class);
  231.         AK12Mag = new ItemMagazine.Builder().withAmmo(31).withCompatibleBullet(Bullet556x39).withName("AK12Mag").withModId("mw").withCreativeTab(ModernWarfareMod.gunsTab).withModel(new AK12Mag(), "GunmetalTexture.png").withFirstPersonPositioning((player, itemStack) -> {
  232.             GL11.glTranslatef((float)0.1f, (float)-0.7f, (float)0.4f);
  233.             GL11.glRotatef((float)30.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  234.             GL11.glScaled((double)0.699999988079071, (double)0.699999988079071, (double)0.699999988079071);
  235.         }
  236.         ).withThirdPersonPositioning((player, itemStack) -> {
  237.             GL11.glTranslatef((float)-1.0f, (float)-0.5f, (float)0.8f);
  238.             GL11.glRotatef((float)-50.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  239.             GL11.glRotatef((float)80.0f, (float)1.0f, (float)0.0f, (float)0.0f);
  240.             GL11.glScaled((double)0.699999988079071, (double)0.699999988079071, (double)0.699999988079071);
  241.         }
  242.         ).withInventoryPositioning(itemStack -> {
  243.             GL11.glTranslatef((float)-0.6f, (float)-0.15f, (float)0.4f);
  244.             GL11.glRotatef((float)-120.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  245.             GL11.glRotatef((float)-10.0f, (float)1.0f, (float)0.0f, (float)0.0f);
  246.             GL11.glRotatef((float)-30.0f, (float)0.0f, (float)0.0f, (float)1.0f);
  247.             GL11.glScaled((double)0.8999999761581421, (double)0.8999999761581421, (double)0.8999999761581421);
  248.         }
  249.         ).withTextureName("Dummy.png").build(ModernWarfareMod.MOD_CONTEXT, ItemMagazine.class);
  250.         Bipod = new ItemBipod();
  251.         Extra = new AttachmentBuilder().withCategory(AttachmentCategory.EXTRA).withModel(new AKMiron1(), "GunmetalTexture.png").withModel(new AKMiron2(), "GunmetalTexture.png").withModel(new AK47iron(), "GunmetalTexture.png").withModel(new M4Iron1(), "GunmetalTexture.png").withModel(new M4Iron2(), "GunmetalTexture.png").withModel(new P90iron(), "GunmetalTexture.png").withModel(new G36CIron1(), "GunmetalTexture.png").withModel(new G36CIron2(), "GunmetalTexture.png").withModel(new ScarIron1(), "GunmetalTexture.png").withModel(new ScarIron2(), "GunmetalTexture.png").withModel(new FALIron(), "GunmetalTexture.png").withModel(new M14Iron(), "GunmetalTexture.png").withModel(new MP5Iron(), "AK12.png").withName("Extra").withModId("mw").withTextureName("Dummy.png").build(ModernWarfareMod.MOD_CONTEXT);
  252.         GlockTop = new AttachmentBuilder().withCategory(AttachmentCategory.EXTRA).withModel(new GlockTop(), "GlockTop.png").withName("GlockTop").withRenderablePart().withModId("mw").withTextureName("Dummy.png").build(ModernWarfareMod.MOD_CONTEXT);
  253.         G18Top = new AttachmentBuilder().withCategory(AttachmentCategory.EXTRA).withModel(new GlockTop(), "G18Top.png").withName("G18Top").withRenderablePart().withModId("mw").withTextureName("Dummy.png").build(ModernWarfareMod.MOD_CONTEXT);
  254.         M9Top = new AttachmentBuilder().withCategory(AttachmentCategory.EXTRA).withModel(new M9Top(), "M9Top.png").withName("M9Top").withRenderablePart().withModId("mw").withTextureName("Dummy.png").build(ModernWarfareMod.MOD_CONTEXT);
  255.         P2000Top = new AttachmentBuilder().withCategory(AttachmentCategory.EXTRA).withModel(new P2000Top(), "P2000Top.png").withName("P2000Top").withRenderablePart().withModId("mw").withTextureName("Dummy.png").build(ModernWarfareMod.MOD_CONTEXT);
  256.         DeagleTop = new AttachmentBuilder().withCategory(AttachmentCategory.EXTRA).withModel(new DeagleTop(), "Deagle.png").withName("DeagleTop").withRenderablePart().withModId("mw").withTextureName("Dummy.png").build(ModernWarfareMod.MOD_CONTEXT);
  257.         KSGPump = new AttachmentBuilder().withCategory(AttachmentCategory.EXTRA).withModel(new KSG12Pump(), "GunmetalTexture.png").withName("KSGPump").withRenderablePart().withModId("mw").withTextureName("Dummy.png").build(ModernWarfareMod.MOD_CONTEXT);
  258.         L115Bolt1 = new AttachmentBuilder().withCategory(AttachmentCategory.EXTRA2).withModel(new L115Bolt1(), "AK12.png").withName("LP115Bolt").withRenderablePart().withModId("mw").withTextureName("Dummy.png").build(ModernWarfareMod.MOD_CONTEXT);
  259.         L115Bolt2 = new AttachmentBuilder().withCategory(AttachmentCategory.EXTRA3).withModel(new L115Bolt2(), "AK12.png").withName("LP115Bolt2").withRenderablePart().withModId("mw").withTextureName("Dummy.png").build(ModernWarfareMod.MOD_CONTEXT);
  260.         RevolverCase = new AttachmentBuilder().withCategory(AttachmentCategory.EXTRA3).withModel(new MagnumCase(), "MagnumCase.png").withName("RevolverCase").withRenderablePart().withModId("mw").withTextureName("Dummy.png").build(ModernWarfareMod.MOD_CONTEXT);
  261.         R870Pump = new AttachmentBuilder().withCategory(AttachmentCategory.EXTRA).withModel(new R870Pump(), "Remington.png").withName("R870Pump").withRenderablePart().withModId("mw").withTextureName("Dummy.png").build(ModernWarfareMod.MOD_CONTEXT);
  262.         M1911Top = new AttachmentBuilder().withCategory(AttachmentCategory.EXTRA).withModel(new M1911Top(), "M1911.png").withName("M1911Top").withRenderablePart().withModId("mw").withTextureName("Dummy.png").build(ModernWarfareMod.MOD_CONTEXT);
  263.         Reflex = new AttachmentBuilder().withCategory(AttachmentCategory.SCOPE).withCreativeTab(ModernWarfareMod.gunsTab).withModel(new Reflex(), "Reflex.png").withModel(new Reflex2(), "Reflex2.png").withFirstPersonModelPositioning((model, itemStack) -> {
  264.             if (model instanceof Reflex) {
  265.                 GL11.glTranslatef((float)0.1f, (float)-0.8f, (float)0.2f);
  266.                 GL11.glRotatef((float)30.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  267.                 GL11.glScaled((double)0.5, (double)0.5, (double)0.5);
  268.             } else if (model instanceof Reflex2) {
  269.                 GL11.glScaled((double)0.0, (double)0.0, (double)0.0);
  270.             }
  271.         }
  272.         ).withThirdPersonModelPositioning((model, itemStack) -> {
  273.             if (model instanceof Reflex) {
  274.                 GL11.glTranslatef((float)-0.8f, (float)-0.5f, (float)0.8f);
  275.                 GL11.glRotatef((float)-50.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  276.                 GL11.glRotatef((float)80.0f, (float)1.0f, (float)0.0f, (float)0.0f);
  277.                 GL11.glScaled((double)0.30000001192092896, (double)0.30000001192092896, (double)0.30000001192092896);
  278.             } else if (model instanceof Reflex2) {
  279.                 GL11.glScaled((double)0.0, (double)0.0, (double)0.0);
  280.             }
  281.         }
  282.         ).withInventoryModelPositioning((model, itemStack) -> {
  283.             if (model instanceof Reflex) {
  284.                 GL11.glTranslatef((float)-0.6f, (float)-0.1f, (float)1.15f);
  285.                 GL11.glRotatef((float)10.0f, (float)1.0f, (float)0.0f, (float)0.0f);
  286.                 GL11.glRotatef((float)-180.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  287.                 GL11.glRotatef((float)0.0f, (float)0.0f, (float)0.0f, (float)1.0f);
  288.                 GL11.glScaled((double)1.0, (double)1.0, (double)1.0);
  289.             } else if (model instanceof Reflex2) {
  290.                 GL11.glScaled((double)0.0, (double)0.0, (double)0.0);
  291.             }
  292.         }
  293.         ).withEntityModelPositioning((model, itemStack) -> {
  294.             if (model instanceof Reflex) {
  295.                 GL11.glTranslatef((float)0.1f, (float)0.2f, (float)0.4f);
  296.                 GL11.glRotatef((float)90.0f, (float)0.0f, (float)0.0f, (float)1.0f);
  297.                 GL11.glScaled((double)0.4000000059604645, (double)0.4000000059604645, (double)0.4000000059604645);
  298.             } else if (model instanceof Reflex2) {
  299.                 GL11.glScaled((double)0.0, (double)0.0, (double)0.0);
  300.             }
  301.         }
  302.         ).withName("Reflex").withModId("mw").withTextureName("Dummy.png").build(ModernWarfareMod.MOD_CONTEXT);
  303.         ACOG = new AttachmentBuilder().withCategory(AttachmentCategory.SCOPE).withCreativeTab(ModernWarfareMod.gunsTab).withModel(new ACOG(), "Acog.png").withModel(new Acog2(), "Acog2.png").withApply((a, weapon, player) -> {
  304.             ((Weapon) weapon).changeZoom(player, 0.8f);
  305.         }
  306.         ).withRemove((attachment, weapon, player) -> {
  307.             ((Weapon) weapon).changeZoom(player, 1.0f);
  308.         }
  309.         ).withFirstPersonModelPositioning((model, itemStack) -> {
  310.             if (model instanceof ACOG) {
  311.                 GL11.glTranslatef((float)0.1f, (float)-0.8f, (float)0.4f);
  312.                 GL11.glRotatef((float)30.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  313.                 GL11.glScaled((double)0.699999988079071, (double)0.699999988079071, (double)0.699999988079071);
  314.             } else if (model instanceof Acog2) {
  315.                 GL11.glScaled((double)0.0, (double)0.0, (double)0.0);
  316.             }
  317.         }
  318.         ).withThirdPersonModelPositioning((model, itemStack) -> {
  319.             if (model instanceof ACOG) {
  320.                 GL11.glTranslatef((float)-0.8f, (float)-0.5f, (float)0.8f);
  321.                 GL11.glRotatef((float)-50.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  322.                 GL11.glRotatef((float)80.0f, (float)1.0f, (float)0.0f, (float)0.0f);
  323.                 GL11.glScaled((double)0.5, (double)0.5, (double)0.5);
  324.             } else if (model instanceof Acog2) {
  325.                 GL11.glScaled((double)0.0, (double)0.0, (double)0.0);
  326.             }
  327.         }
  328.         ).withInventoryModelPositioning((model, itemStack) -> {
  329.             if (model instanceof ACOG) {
  330.                 GL11.glTranslatef((float)-0.6f, (float)-0.7f, (float)0.65f);
  331.                 GL11.glRotatef((float)10.0f, (float)1.0f, (float)0.0f, (float)0.0f);
  332.                 GL11.glRotatef((float)-190.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  333.                 GL11.glRotatef((float)0.0f, (float)0.0f, (float)0.0f, (float)1.0f);
  334.                 GL11.glScaled((double)1.2000000476837158, (double)1.2000000476837158, (double)1.2000000476837158);
  335.             } else if (model instanceof Acog2) {
  336.                 GL11.glScaled((double)0.0, (double)0.0, (double)0.0);
  337.             }
  338.         }
  339.         ).withEntityModelPositioning((model, itemStack) -> {
  340.             if (model instanceof ACOG) {
  341.                 GL11.glTranslatef((float)0.1f, (float)0.2f, (float)0.4f);
  342.                 GL11.glRotatef((float)90.0f, (float)0.0f, (float)0.0f, (float)1.0f);
  343.                 GL11.glScaled((double)0.4000000059604645, (double)0.4000000059604645, (double)0.4000000059604645);
  344.             } else if (model instanceof Acog2) {
  345.                 GL11.glScaled((double)0.0, (double)0.0, (double)0.0);
  346.             }
  347.         }
  348.         ).withName("Acog").withModId("mw").withTextureName("Dummy.png").build(ModernWarfareMod.MOD_CONTEXT);
  349.         Holo2 = new AttachmentBuilder().withCategory(AttachmentCategory.SCOPE).withCreativeTab(ModernWarfareMod.gunsTab).withModel(new Holographic(), "Holographic.png").withModel(new Holo2(), "Holo3.png").withFirstPersonModelPositioning((model, itemStack) -> {
  350.             if (model instanceof Holographic) {
  351.                 GL11.glTranslatef((float)0.1f, (float)-0.8f, (float)0.2f);
  352.                 GL11.glRotatef((float)30.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  353.                 GL11.glScaled((double)0.6000000238418579, (double)0.6000000238418579, (double)0.6000000238418579);
  354.             } else if (model instanceof Holo2) {
  355.                 GL11.glScaled((double)0.0, (double)0.0, (double)0.0);
  356.             }
  357.         }
  358.         ).withThirdPersonModelPositioning((model, itemStack) -> {
  359.             if (model instanceof Holographic) {
  360.                 GL11.glTranslatef((float)-0.8f, (float)-0.5f, (float)0.8f);
  361.                 GL11.glRotatef((float)-50.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  362.                 GL11.glRotatef((float)80.0f, (float)1.0f, (float)0.0f, (float)0.0f);
  363.                 GL11.glScaled((double)0.5, (double)0.5, (double)0.5);
  364.             } else if (model instanceof Holo2) {
  365.                 GL11.glScaled((double)0.0, (double)0.0, (double)0.0);
  366.             }
  367.         }
  368.         ).withInventoryModelPositioning((model, itemStack) -> {
  369.             if (model instanceof Holographic) {
  370.                 GL11.glTranslatef((float)-0.6f, (float)-0.1f, (float)0.3f);
  371.                 GL11.glRotatef((float)-180.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  372.                 GL11.glRotatef((float)0.0f, (float)0.0f, (float)0.0f, (float)1.0f);
  373.                 GL11.glScaled((double)1.0, (double)1.0, (double)1.0);
  374.             } else if (model instanceof Holo2) {
  375.                 GL11.glScaled((double)0.0, (double)0.0, (double)0.0);
  376.             }
  377.         }
  378.         ).withEntityModelPositioning((model, itemStack) -> {
  379.             if (model instanceof Holographic) {
  380.                 GL11.glTranslatef((float)0.1f, (float)0.2f, (float)0.4f);
  381.                 GL11.glRotatef((float)90.0f, (float)0.0f, (float)0.0f, (float)1.0f);
  382.                 GL11.glScaled((double)0.4000000059604645, (double)0.4000000059604645, (double)0.4000000059604645);
  383.             } else if (model instanceof Holo2) {
  384.                 GL11.glScaled((double)0.0, (double)0.0, (double)0.0);
  385.             }
  386.         }
  387.         ).withName("Holographic").withModId("mw").withTextureName("Dummy.png").build(ModernWarfareMod.MOD_CONTEXT);
  388.         Kobra = new AttachmentBuilder().withCategory(AttachmentCategory.SCOPE).withCreativeTab(ModernWarfareMod.gunsTab).withModel(new Kobra(), "Kobra.png").withModel(new Reflex2(), "Reflex2.png").withFirstPersonModelPositioning((model, itemStack) -> {
  389.             if (model instanceof Kobra) {
  390.                 GL11.glTranslatef((float)0.4f, (float)-0.8f, (float)0.5f);
  391.                 GL11.glRotatef((float)30.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  392.                 GL11.glScaled((double)0.699999988079071, (double)0.699999988079071, (double)0.699999988079071);
  393.             } else if (model instanceof Reflex2) {
  394.                 GL11.glScaled((double)0.0, (double)0.0, (double)0.0);
  395.             }
  396.         }
  397.         ).withThirdPersonModelPositioning((model, itemStack) -> {
  398.             if (model instanceof Kobra) {
  399.                 GL11.glTranslatef((float)-0.8f, (float)-0.5f, (float)0.8f);
  400.                 GL11.glRotatef((float)-50.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  401.                 GL11.glRotatef((float)80.0f, (float)1.0f, (float)0.0f, (float)0.0f);
  402.                 GL11.glScaled((double)0.5, (double)0.5, (double)0.5);
  403.             } else if (model instanceof Reflex2) {
  404.                 GL11.glScaled((double)0.0, (double)0.0, (double)0.0);
  405.             }
  406.         }
  407.         ).withInventoryModelPositioning((model, itemStack) -> {
  408.             if (model instanceof Kobra) {
  409.                 GL11.glTranslatef((float)-0.6f, (float)-0.1f, (float)0.3f);
  410.                 GL11.glRotatef((float)-180.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  411.                 GL11.glRotatef((float)0.0f, (float)0.0f, (float)0.0f, (float)1.0f);
  412.                 GL11.glScaled((double)1.0, (double)1.0, (double)1.0);
  413.             } else if (model instanceof Reflex2) {
  414.                 GL11.glScaled((double)0.0, (double)0.0, (double)0.0);
  415.             }
  416.         }
  417.         ).withEntityModelPositioning((model, itemStack) -> {
  418.             if (model instanceof Kobra) {
  419.                 GL11.glTranslatef((float)0.1f, (float)0.2f, (float)0.4f);
  420.                 GL11.glRotatef((float)90.0f, (float)0.0f, (float)0.0f, (float)1.0f);
  421.                 GL11.glScaled((double)0.4000000059604645, (double)0.4000000059604645, (double)0.4000000059604645);
  422.             } else if (model instanceof Reflex2) {
  423.                 GL11.glScaled((double)0.0, (double)0.0, (double)0.0);
  424.             }
  425.         }
  426.         ).withName("Kobra").withModId("mw").withTextureName("Dummy.png").build(ModernWarfareMod.MOD_CONTEXT);
  427.         Scope = new AttachmentBuilder().withCategory(AttachmentCategory.SCOPE).withCreativeTab(ModernWarfareMod.gunsTab).withCrosshair("LP").withModel(new LP(), "AK12.png").withApply((a, weapon, player) -> {
  428.             ((Weapon) weapon).changeZoom(player, 0.2f);
  429.         }
  430.         ).withRemove((attachment, weapon, player) -> {
  431.             ((Weapon) weapon).changeZoom(player, 1.0f);
  432.         }
  433.         ).withFirstPersonModelPositioning((model, itemStack) -> {
  434.             if (model instanceof LP) {
  435.                 GL11.glTranslatef((float)0.1f, (float)-0.8f, (float)0.4f);
  436.                 GL11.glRotatef((float)30.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  437.                 GL11.glScaled((double)0.699999988079071, (double)0.699999988079071, (double)0.699999988079071);
  438.             }
  439.         }
  440.         ).withThirdPersonModelPositioning((model, itemStack) -> {
  441.             if (model instanceof LP) {
  442.                 GL11.glTranslatef((float)-0.8f, (float)-0.5f, (float)0.8f);
  443.                 GL11.glRotatef((float)-50.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  444.                 GL11.glRotatef((float)80.0f, (float)1.0f, (float)0.0f, (float)0.0f);
  445.                 GL11.glScaled((double)0.5, (double)0.5, (double)0.5);
  446.             }
  447.         }
  448.         ).withInventoryModelPositioning((model, itemStack) -> {
  449.             if (model instanceof LP) {
  450.                 GL11.glTranslatef((float)-0.6f, (float)-0.6f, (float)0.5f);
  451.                 GL11.glRotatef((float)10.0f, (float)1.0f, (float)0.0f, (float)0.0f);
  452.                 GL11.glRotatef((float)-190.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  453.                 GL11.glRotatef((float)0.0f, (float)0.0f, (float)0.0f, (float)1.0f);
  454.                 GL11.glScaled((double)0.800000011920929, (double)0.800000011920929, (double)0.800000011920929);
  455.             }
  456.         }
  457.         ).withEntityModelPositioning((model, itemStack) -> {
  458.             if (model instanceof LP) {
  459.                 GL11.glTranslatef((float)0.1f, (float)0.2f, (float)0.4f);
  460.                 GL11.glRotatef((float)90.0f, (float)0.0f, (float)0.0f, (float)1.0f);
  461.                 GL11.glScaled((double)0.4000000059604645, (double)0.4000000059604645, (double)0.4000000059604645);
  462.             }
  463.         }
  464.         ).withName("LPScope").withModId("mw").withTextureName("Dummy.png").build(ModernWarfareMod.MOD_CONTEXT);
  465.         HP = new AttachmentBuilder().withCategory(AttachmentCategory.SCOPE).withCreativeTab(ModernWarfareMod.gunsTab).withCrosshair("HP").withModel(new HP(), "AK12.png").withApply((a, weapon, player) -> {
  466.             ((Weapon) weapon).changeZoom(player, 0.01f);
  467.         }
  468.         ).withRemove((attachment, weapon, player) -> {
  469.             ((Weapon) weapon).changeZoom(player, 1.0f);
  470.         }
  471.         ).withFirstPersonModelPositioning((model, itemStack) -> {
  472.             if (model instanceof HP) {
  473.                 GL11.glTranslatef((float)0.1f, (float)-0.8f, (float)0.4f);
  474.                 GL11.glRotatef((float)30.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  475.                 GL11.glScaled((double)0.699999988079071, (double)0.699999988079071, (double)0.699999988079071);
  476.             }
  477.         }
  478.         ).withThirdPersonModelPositioning((model, itemStack) -> {
  479.             if (model instanceof HP) {
  480.                 GL11.glTranslatef((float)-0.8f, (float)-0.5f, (float)0.8f);
  481.                 GL11.glRotatef((float)-50.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  482.                 GL11.glRotatef((float)80.0f, (float)1.0f, (float)0.0f, (float)0.0f);
  483.                 GL11.glScaled((double)0.5, (double)0.5, (double)0.5);
  484.             }
  485.         }
  486.         ).withInventoryModelPositioning((model, itemStack) -> {
  487.             if (model instanceof HP) {
  488.                 GL11.glTranslatef((float)-0.6f, (float)-0.6f, (float)0.6f);
  489.                 GL11.glRotatef((float)10.0f, (float)1.0f, (float)0.0f, (float)0.0f);
  490.                 GL11.glRotatef((float)-190.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  491.                 GL11.glRotatef((float)0.0f, (float)0.0f, (float)0.0f, (float)1.0f);
  492.                 GL11.glScaled((double)0.6499999761581421, (double)0.6499999761581421, (double)0.6499999761581421);
  493.             }
  494.         }
  495.         ).withEntityModelPositioning((model, itemStack) -> {
  496.             if (model instanceof HP) {
  497.                 GL11.glTranslatef((float)0.1f, (float)0.2f, (float)0.4f);
  498.                 GL11.glRotatef((float)90.0f, (float)0.0f, (float)0.0f, (float)1.0f);
  499.                 GL11.glScaled((double)0.4000000059604645, (double)0.4000000059604645, (double)0.4000000059604645);
  500.             }
  501.         }
  502.         ).withName("HPScope").withModId("mw").withTextureName("Dummy.png").build(ModernWarfareMod.MOD_CONTEXT);
  503.         Silencer = new AttachmentBuilder().withCategory(AttachmentCategory.SILENCER).withCreativeTab(ModernWarfareMod.gunsTab).withModel(new Suppressor(), "Silencer.png").withFirstPersonModelPositioning((model, itemStack) -> {
  504.             if (model instanceof Suppressor) {
  505.                 GL11.glTranslatef((float)0.5f, (float)-1.3f, (float)-0.1f);
  506.                 GL11.glRotatef((float)30.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  507.                 GL11.glScaled((double)0.6000000238418579, (double)0.6000000238418579, (double)0.6000000238418579);
  508.             }
  509.         }
  510.         ).withThirdPersonModelPositioning((model, itemStack) -> {
  511.             if (model instanceof Suppressor) {
  512.                 GL11.glTranslatef((float)-0.7f, (float)-0.5f, (float)0.6f);
  513.                 GL11.glRotatef((float)-50.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  514.                 GL11.glRotatef((float)80.0f, (float)1.0f, (float)0.0f, (float)0.0f);
  515.                 GL11.glScaled((double)0.5, (double)0.5, (double)0.5);
  516.             }
  517.         }
  518.         ).withInventoryModelPositioning((model, itemStack) -> {
  519.             if (model instanceof Suppressor) {
  520.                 GL11.glTranslatef((float)0.6f, (float)0.1f, (float)0.3f);
  521.                 GL11.glRotatef((float)-180.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  522.                 GL11.glRotatef((float)0.0f, (float)0.0f, (float)0.0f, (float)1.0f);
  523.                 GL11.glScaled((double)1.0, (double)1.0, (double)1.0);
  524.             }
  525.         }
  526.         ).withEntityModelPositioning((model, itemStack) -> {
  527.             if (model instanceof Suppressor) {
  528.                 GL11.glTranslatef((float)0.1f, (float)0.2f, (float)0.4f);
  529.                 GL11.glRotatef((float)90.0f, (float)0.0f, (float)0.0f, (float)1.0f);
  530.                 GL11.glScaled((double)0.4000000059604645, (double)0.4000000059604645, (double)0.4000000059604645);
  531.             }
  532.         }
  533.         ).withName("Silencer").withModId("mw").withTextureName("Dummy.png").build(ModernWarfareMod.MOD_CONTEXT);
  534.         Laser = new AttachmentBuilder().withCategory(AttachmentCategory.GRIP).withCreativeTab(ModernWarfareMod.gunsTab).withModel(new Laser(), "AK12.png").withPostRender(new LaserBeamRenderer()).withFirstPersonModelPositioning((model, itemStack) -> {
  535.             if (model instanceof Laser) {
  536.                 GL11.glTranslatef((float)0.5f, (float)-1.3f, (float)-0.1f);
  537.                 GL11.glRotatef((float)30.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  538.                 GL11.glScaled((double)0.6000000238418579, (double)0.6000000238418579, (double)0.6000000238418579);
  539.             }
  540.         }
  541.         ).withThirdPersonModelPositioning((model, itemStack) -> {
  542.             if (model instanceof Laser) {
  543.                 GL11.glTranslatef((float)-0.7f, (float)-0.5f, (float)0.6f);
  544.                 GL11.glRotatef((float)-50.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  545.                 GL11.glRotatef((float)80.0f, (float)1.0f, (float)0.0f, (float)0.0f);
  546.                 GL11.glScaled((double)0.5, (double)0.5, (double)0.5);
  547.             }
  548.         }
  549.         ).withInventoryModelPositioning((model, itemStack) -> {
  550.             if (model instanceof Laser) {
  551.                 GL11.glTranslatef((float)0.6f, (float)-0.3f, (float)0.65f);
  552.                 GL11.glRotatef((float)-180.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  553.                 GL11.glRotatef((float)0.0f, (float)0.0f, (float)0.0f, (float)1.0f);
  554.                 GL11.glScaled((double)1.7999999523162842, (double)1.7999999523162842, (double)1.7999999523162842);
  555.             }
  556.         }
  557.         ).withEntityModelPositioning((model, itemStack) -> {
  558.             if (model instanceof Laser) {
  559.                 GL11.glTranslatef((float)0.1f, (float)0.2f, (float)0.4f);
  560.                 GL11.glRotatef((float)90.0f, (float)0.0f, (float)0.0f, (float)1.0f);
  561.                 GL11.glScaled((double)0.4000000059604645, (double)0.4000000059604645, (double)0.4000000059604645);
  562.             }
  563.         }
  564.         ).withName("Laser").withModId("mw").withTextureName("Dummy.png").build(ModernWarfareMod.MOD_CONTEXT);
  565.         Laser2 = new AttachmentBuilder().withCategory(AttachmentCategory.GRIP).withCreativeTab(ModernWarfareMod.gunsTab).withModel(new Laser2(), "AK12.png").withPostRender(new LaserBeamRenderer()).withFirstPersonModelPositioning((model, itemStack) -> {
  566.             if (model instanceof Laser2) {
  567.                 GL11.glTranslatef((float)0.5f, (float)-1.3f, (float)-0.1f);
  568.                 GL11.glRotatef((float)30.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  569.                 GL11.glScaled((double)0.6000000238418579, (double)0.6000000238418579, (double)0.6000000238418579);
  570.             }
  571.         }
  572.         ).withThirdPersonModelPositioning((model, itemStack) -> {
  573.             if (model instanceof Laser2) {
  574.                 GL11.glTranslatef((float)-0.7f, (float)-0.5f, (float)0.6f);
  575.                 GL11.glRotatef((float)-50.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  576.                 GL11.glRotatef((float)80.0f, (float)1.0f, (float)0.0f, (float)0.0f);
  577.                 GL11.glScaled((double)0.5, (double)0.5, (double)0.5);
  578.             }
  579.         }
  580.         ).withInventoryModelPositioning((model, itemStack) -> {
  581.             if (model instanceof Laser2) {
  582.                 GL11.glTranslatef((float)0.6f, (float)-0.3f, (float)0.65f);
  583.                 GL11.glRotatef((float)-180.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  584.                 GL11.glRotatef((float)0.0f, (float)0.0f, (float)0.0f, (float)1.0f);
  585.                 GL11.glScaled((double)1.7999999523162842, (double)1.7999999523162842, (double)1.7999999523162842);
  586.             }
  587.         }
  588.         ).withEntityModelPositioning((model, itemStack) -> {
  589.             if (model instanceof Laser2) {
  590.                 GL11.glTranslatef((float)0.1f, (float)0.2f, (float)0.4f);
  591.                 GL11.glRotatef((float)90.0f, (float)0.0f, (float)0.0f, (float)1.0f);
  592.                 GL11.glScaled((double)0.4000000059604645, (double)0.4000000059604645, (double)0.4000000059604645);
  593.             }
  594.         }
  595.         ).withName("Laser2").withModId("mw").withTextureName("Dummy.png").build(ModernWarfareMod.MOD_CONTEXT);
  596.         Grip2 = new AttachmentBuilder().withCategory(AttachmentCategory.GRIP).withCreativeTab(ModernWarfareMod.gunsTab).withModel(new Grip2(), "AK12.png").withApply((a, weapon, player) -> {
  597.             ((Weapon) weapon).changeRecoil(player, 0.7f);
  598.         }
  599.         ).withRemove((attachment, weapon, player) -> {
  600.             ((Weapon) weapon).changeRecoil(player, 1.0f);
  601.         }
  602.         ).withFirstPersonModelPositioning((model, itemStack) -> {
  603.             if (model instanceof Grip2) {
  604.                 GL11.glTranslatef((float)0.7f, (float)-1.2f, (float)0.5f);
  605.                 GL11.glRotatef((float)30.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  606.                 GL11.glScaled((double)0.6000000238418579, (double)0.6000000238418579, (double)0.6000000238418579);
  607.             }
  608.         }
  609.         ).withThirdPersonModelPositioning((model, itemStack) -> {
  610.             if (model instanceof Grip2) {
  611.                 GL11.glTranslatef((float)-0.7f, (float)-0.5f, (float)0.6f);
  612.                 GL11.glRotatef((float)-50.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  613.                 GL11.glRotatef((float)80.0f, (float)1.0f, (float)0.0f, (float)0.0f);
  614.                 GL11.glScaled((double)0.5, (double)0.5, (double)0.5);
  615.             }
  616.         }
  617.         ).withInventoryModelPositioning((model, itemStack) -> {
  618.             if (model instanceof Grip2) {
  619.                 GL11.glTranslatef((float)0.6f, (float)0.3f, (float)-0.5f);
  620.                 GL11.glRotatef((float)-180.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  621.                 GL11.glRotatef((float)0.0f, (float)0.0f, (float)0.0f, (float)1.0f);
  622.                 GL11.glScaled((double)1.2999999523162842, (double)1.2999999523162842, (double)1.2999999523162842);
  623.             }
  624.         }
  625.         ).withEntityModelPositioning((model, itemStack) -> {
  626.             if (model instanceof Grip2) {
  627.                 GL11.glTranslatef((float)0.1f, (float)0.2f, (float)0.4f);
  628.                 GL11.glRotatef((float)90.0f, (float)0.0f, (float)0.0f, (float)1.0f);
  629.                 GL11.glScaled((double)0.6000000238418579, (double)0.6000000238418579, (double)0.6000000238418579);
  630.             }
  631.         }
  632.         ).withName("Grip2").withModId("mw").withTextureName("Dummy.png").build(ModernWarfareMod.MOD_CONTEXT);
  633.         Grip = new AttachmentBuilder().withCategory(AttachmentCategory.GRIP).withCreativeTab(ModernWarfareMod.gunsTab).withModel(new AngledGrip(), "AK12.png").withApply((a, weapon, player) -> {
  634.             ((Weapon) weapon).changeRecoil(player, 0.5f);
  635.         }
  636.         ).withRemove((attachment, weapon, player) -> {
  637.             ((Weapon) weapon).changeRecoil(player, 1.0f);
  638.         }
  639.         ).withFirstPersonModelPositioning((model, itemStack) -> {
  640.             if (model instanceof AngledGrip) {
  641.                 GL11.glTranslatef((float)0.7f, (float)-1.1f, (float)0.5f);
  642.                 GL11.glRotatef((float)30.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  643.                 GL11.glScaled((double)0.5, (double)0.5, (double)0.5);
  644.             }
  645.         }
  646.         ).withThirdPersonModelPositioning((model, itemStack) -> {
  647.             if (model instanceof AngledGrip) {
  648.                 GL11.glTranslatef((float)-0.7f, (float)-0.5f, (float)0.6f);
  649.                 GL11.glRotatef((float)-50.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  650.                 GL11.glRotatef((float)80.0f, (float)1.0f, (float)0.0f, (float)0.0f);
  651.                 GL11.glScaled((double)0.5, (double)0.5, (double)0.5);
  652.             }
  653.         }
  654.         ).withInventoryModelPositioning((model, itemStack) -> {
  655.             if (model instanceof AngledGrip) {
  656.                 GL11.glTranslatef((float)0.6f, (float)0.8f, (float)-0.45f);
  657.                 GL11.glRotatef((float)-180.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  658.                 GL11.glRotatef((float)0.0f, (float)0.0f, (float)0.0f, (float)1.0f);
  659.                 GL11.glScaled((double)1.2000000476837158, (double)1.2000000476837158, (double)1.2000000476837158);
  660.             }
  661.         }
  662.         ).withEntityModelPositioning((model, itemStack) -> {
  663.             if (model instanceof AngledGrip) {
  664.                 GL11.glTranslatef((float)0.1f, (float)0.2f, (float)0.4f);
  665.                 GL11.glRotatef((float)90.0f, (float)0.0f, (float)0.0f, (float)1.0f);
  666.                 GL11.glScaled((double)0.6000000238418579, (double)0.6000000238418579, (double)0.6000000238418579);
  667.             }
  668.         }
  669.         ).withName("AngledGrip").withModId("mw").withTextureName("Dummy.png").build(ModernWarfareMod.MOD_CONTEXT);
  670.         VGrip = new AttachmentBuilder().withCategory(AttachmentCategory.GRIP).withCreativeTab(ModernWarfareMod.gunsTab).withModel(new VGrip(), "AK12.png").withApply((a, weapon, player) -> {
  671.             ((Weapon) weapon).changeRecoil(player, 0.7f);
  672.         }
  673.         ).withRemove((attachment, weapon, player) -> {
  674.             ((Weapon) weapon).changeRecoil(player, 1.0f);
  675.         }
  676.         ).withFirstPersonModelPositioning((model, itemStack) -> {
  677.             if (model instanceof VGrip) {
  678.                 GL11.glTranslatef((float)0.7f, (float)-1.1f, (float)0.5f);
  679.                 GL11.glRotatef((float)30.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  680.                 GL11.glScaled((double)0.5, (double)0.5, (double)0.5);
  681.             }
  682.         }
  683.         ).withThirdPersonModelPositioning((model, itemStack) -> {
  684.             if (model instanceof VGrip) {
  685.                 GL11.glTranslatef((float)-0.7f, (float)-0.5f, (float)0.6f);
  686.                 GL11.glRotatef((float)-50.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  687.                 GL11.glRotatef((float)80.0f, (float)1.0f, (float)0.0f, (float)0.0f);
  688.                 GL11.glScaled((double)0.5, (double)0.5, (double)0.5);
  689.             }
  690.         }
  691.         ).withInventoryModelPositioning((model, itemStack) -> {
  692.             if (model instanceof VGrip) {
  693.                 GL11.glTranslatef((float)0.6f, (float)0.3f, (float)-0.5f);
  694.                 GL11.glRotatef((float)-180.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  695.                 GL11.glRotatef((float)0.0f, (float)0.0f, (float)0.0f, (float)1.0f);
  696.                 GL11.glScaled((double)1.2999999523162842, (double)1.2999999523162842, (double)1.2999999523162842);
  697.             }
  698.         }
  699.         ).withEntityModelPositioning((model, itemStack) -> {
  700.             if (model instanceof VGrip) {
  701.                 GL11.glTranslatef((float)0.1f, (float)0.2f, (float)0.4f);
  702.                 GL11.glRotatef((float)90.0f, (float)0.0f, (float)0.0f, (float)1.0f);
  703.                 GL11.glScaled((double)0.6000000238418579, (double)0.6000000238418579, (double)0.6000000238418579);
  704.             }
  705.         }
  706.         ).withName("VGrip").withModId("mw").withTextureName("Dummy.png").build(ModernWarfareMod.MOD_CONTEXT);
  707.         Bipod = new AttachmentBuilder().withCategory(AttachmentCategory.GRIP).withCreativeTab(ModernWarfareMod.gunsTab).withModel(new Bipod(), "AK12.png").withApply((a, weapon, player) -> {
  708.             ((Weapon) weapon).changeRecoil(player, 0.4f);
  709.         }
  710.         ).withRemove((attachment, weapon, player) -> {
  711.             ((Weapon) weapon).changeRecoil(player, 1.0f);
  712.         }
  713.         ).withFirstPersonModelPositioning((model, itemStack) -> {
  714.             if (model instanceof Bipod) {
  715.                 GL11.glTranslatef((float)0.7f, (float)-1.1f, (float)0.5f);
  716.                 GL11.glRotatef((float)30.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  717.                 GL11.glScaled((double)0.5, (double)0.5, (double)0.5);
  718.             }
  719.         }
  720.         ).withThirdPersonModelPositioning((model, itemStack) -> {
  721.             if (model instanceof Bipod) {
  722.                 GL11.glTranslatef((float)-0.7f, (float)-0.5f, (float)0.6f);
  723.                 GL11.glRotatef((float)-50.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  724.                 GL11.glRotatef((float)80.0f, (float)1.0f, (float)0.0f, (float)0.0f);
  725.                 GL11.glScaled((double)0.5, (double)0.5, (double)0.5);
  726.             }
  727.         }
  728.         ).withInventoryModelPositioning((model, itemStack) -> {
  729.             if (model instanceof Bipod) {
  730.                 GL11.glTranslatef((float)0.6f, (float)-0.05f, (float)-0.5f);
  731.                 GL11.glRotatef((float)-180.0f, (float)0.0f, (float)1.0f, (float)0.0f);
  732.                 GL11.glRotatef((float)0.0f, (float)0.0f, (float)0.0f, (float)1.0f);
  733.                 GL11.glScaled((double)0.8999999761581421, (double)0.8999999761581421, (double)0.8999999761581421);
  734.             }
  735.         }
  736.         ).withEntityModelPositioning((model, itemStack) -> {
  737.             if (model instanceof Bipod) {
  738.                 GL11.glTranslatef((float)0.1f, (float)0.2f, (float)0.4f);
  739.                 GL11.glRotatef((float)90.0f, (float)0.0f, (float)0.0f, (float)1.0f);
  740.                 GL11.glScaled((double)0.6000000238418579, (double)0.6000000238418579, (double)0.6000000238418579);
  741.             }
  742.         }
  743.         ).withName("Bipod").withModId("mw").withTextureName("Dummy.png").build(ModernWarfareMod.MOD_CONTEXT);
  744.         AK12 = new AK12Factory().createGun(this);
  745.  
  746.     }
  747.  
  748.     private static void registerBlockWithItem(Block block) {
  749.         if (block.getRegistryName() == null) {
  750.             if (block.getUnlocalizedName().length() < "mw".length() + 2 + 5) {
  751.                 throw new IllegalArgumentException("Unlocalize block name too short " + block.getUnlocalizedName());
  752.             }
  753.             String unlocalizedName = block.getUnlocalizedName();
  754.             String registryName = unlocalizedName.substring(5 + "mw".length() + 1);
  755.             block.setRegistryName("mw", registryName);
  756.         }
  757.         GameRegistry.register((IForgeRegistryEntry)block);
  758.         ItemBlock itemBlock = new ItemBlock(block);
  759.         GameRegistry.register((IForgeRegistryEntry)itemBlock.setRegistryName(block.getRegistryName()));
  760.     }
  761.  
  762.     private static void registerItem(Item item) {
  763.         if (item.getRegistryName() == null) {
  764.             String registryName = item.getUnlocalizedName();
  765.             int indexOfPrefix = registryName.indexOf(".mw");
  766.             if (indexOfPrefix > 0) {
  767.                 registryName = registryName.substring(indexOfPrefix + "mw".length() + 2);
  768.             }
  769.             item.setRegistryName("mw", registryName);
  770.         }
  771.         GameRegistry.register((IForgeRegistryEntry)item);
  772.     }
  773. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top