Advertisement
Gamebuster

Forge Setup Error

Jun 13th, 2017
2,436
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 MB | None | 0 0
  1. #################################################
  2. ForgeGradle 2.2-SNAPSHOT-eb2e450
  3. https://github.com/MinecraftForge/ForgeGradle
  4. #################################################
  5. Powered by MCP unknown
  6. http://modcoderpack.com
  7. by: Searge, ProfMobius, Fesh0r,
  8. R4wk, ZeuX, IngisKahn, bspkrs
  9. #################################################
  10. :deobfCompileDummyTask
  11. :deobfProvidedDummyTask
  12. :getVersionJson
  13. :extractUserdev UP-TO-DATE
  14. :extractDependencyATs SKIPPED
  15. :extractMcpData SKIPPED
  16. :extractMcpMappings
  17. :genSrgs SKIPPED
  18. :downloadClient SKIPPED
  19. :downloadServer SKIPPED
  20. :splitServerJar SKIPPED
  21. :mergeJars SKIPPED
  22. :deobfMcSRG SKIPPED
  23. :decompileMc SKIPPED
  24. :fixMcSourcesPatching failed: minecraft\net\minecraft\client\renderer\entity\layers\LayerVillagerArmor.java
  25. Hunk 1 failed! Cannot find hunk target
  26. }
  27.  
  28. protected void func_177177_a() {
  29. - this.field_177189_c = (T)(new ModelZombieVillager(0.5F, 0.0F, true));
  30. - this.field_177186_d = (T)(new ModelZombieVillager(1.0F, 0.0F, true));
  31. + this.field_177189_c = new ModelZombieVillager(0.5F, 0.0F, true);
  32. + this.field_177186_d = new ModelZombieVillager(1.0F, 0.0F, true);
  33. }
  34. }
  35. File state
  36. package net.minecraft.client.renderer.entity.layers;
  37.  
  38. import net.minecraft.client.model.ModelZombieVillager;
  39. import net.minecraft.client.renderer.entity.RenderLivingBase;
  40. import net.minecraft.client.renderer.entity.layers.LayerBipedArmor;
  41. import net.minecraftforge.fml.relauncher.Side;
  42. import net.minecraftforge.fml.relauncher.SideOnly;
  43.  
  44. @SideOnly(Side.CLIENT)
  45. public class LayerVillagerArmor extends LayerBipedArmor {
  46. public LayerVillagerArmor(RenderLivingBase<?> p_i46108_1_) {
  47. super(p_i46108_1_);
  48. }
  49.  
  50. protected void func_177177_a() {
  51. this.field_177189_c = new ModelZombieVillager(0.5F, 0.0F, true);
  52. this.field_177186_d = new ModelZombieVillager(1.0F, 0.0F, true);
  53. }
  54. }
  55.  
  56. Patching failed: minecraft\net\minecraft\client\renderer\texture\TextureMap.java
  57. Hunk 1 failed! Cannot find hunk target
  58. this.field_94249_f.func_110969_c(16);
  59. int[][] aint1 = new int[this.field_147636_j + 1][];
  60. aint1[0] = aint;
  61. - this.field_94249_f.func_110968_a(Lists.newArrayList(aint1));
  62. + this.field_94249_f.func_110968_a(Lists.<int[][]>newArrayList(aint1));
  63. }
  64.  
  65. public void func_110551_a(IResourceManager p_110551_1_) throws IOException {
  66. File state
  67. package net.minecraft.client.renderer.texture;
  68.  
  69. import com.google.common.collect.Lists;
  70. import com.google.common.collect.Maps;
  71. import java.io.Closeable;
  72. import java.io.IOException;
  73. import java.util.List;
  74. import java.util.Map;
  75. import java.util.Map.Entry;
  76. import javax.annotation.Nullable;
  77. import net.minecraft.client.Minecraft;
  78. import net.minecraft.client.renderer.StitcherException;
  79. import net.minecraft.client.renderer.texture.AbstractTexture;
  80. import net.minecraft.client.renderer.texture.ITextureMapPopulator;
  81. import net.minecraft.client.renderer.texture.ITickableTextureObject;
  82. import net.minecraft.client.renderer.texture.PngSizeInfo;
  83. import net.minecraft.client.renderer.texture.Stitcher;
  84. import net.minecraft.client.renderer.texture.TextureAtlasSprite;
  85. import net.minecraft.client.renderer.texture.TextureUtil;
  86. import net.minecraft.client.resources.IResource;
  87. import net.minecraft.client.resources.IResourceManager;
  88. import net.minecraft.crash.CrashReport;
  89. import net.minecraft.crash.CrashReportCategory;
  90. import net.minecraft.crash.ICrashReportDetail;
  91. import net.minecraft.util.ReportedException;
  92. import net.minecraft.util.ResourceLocation;
  93. import net.minecraft.util.math.MathHelper;
  94. import net.minecraftforge.fml.relauncher.Side;
  95. import net.minecraftforge.fml.relauncher.SideOnly;
  96. import org.apache.commons.io.IOUtils;
  97. import org.apache.logging.log4j.LogManager;
  98. import org.apache.logging.log4j.Logger;
  99.  
  100. @SideOnly(Side.CLIENT)
  101. public class TextureMap extends AbstractTexture implements ITickableTextureObject {
  102. private static final Logger field_147635_d = LogManager.getLogger();
  103. public static final ResourceLocation field_174945_f = new ResourceLocation("missingno");
  104. public static final ResourceLocation field_110575_b = new ResourceLocation("textures/atlas/blocks.png");
  105. private final List<TextureAtlasSprite> field_94258_i;
  106. private final Map<String, TextureAtlasSprite> field_110574_e;
  107. private final Map<String, TextureAtlasSprite> field_94252_e;
  108. private final String field_94254_c;
  109. private final ITextureMapPopulator field_174946_m;
  110. private int field_147636_j;
  111. private final TextureAtlasSprite field_94249_f;
  112.  
  113. public TextureMap(String p_i46099_1_) {
  114. this(p_i46099_1_, (ITextureMapPopulator)null);
  115. }
  116.  
  117. public TextureMap(String p_i46100_1_, @Nullable ITextureMapPopulator p_i46100_2_) {
  118. this.field_94258_i = Lists.<TextureAtlasSprite>newArrayList();
  119. this.field_110574_e = Maps.<String, TextureAtlasSprite>newHashMap();
  120. this.field_94252_e = Maps.<String, TextureAtlasSprite>newHashMap();
  121. this.field_94249_f = new TextureAtlasSprite("missingno");
  122. this.field_94254_c = p_i46100_1_;
  123. this.field_174946_m = p_i46100_2_;
  124. }
  125.  
  126. private void func_110569_e() {
  127. int[] aint = TextureUtil.field_110999_b;
  128. this.field_94249_f.func_110966_b(16);
  129. this.field_94249_f.func_110969_c(16);
  130. int[][] aint1 = new int[this.field_147636_j + 1][];
  131. aint1[0] = aint;
  132. this.field_94249_f.func_110968_a(Lists.newArrayList(new int[][][]{aint1}));
  133. }
  134.  
  135. public void func_110551_a(IResourceManager p_110551_1_) throws IOException {
  136. if(this.field_174946_m != null) {
  137. this.func_174943_a(p_110551_1_, this.field_174946_m);
  138. }
  139.  
  140. }
  141.  
  142. public void func_174943_a(IResourceManager p_174943_1_, ITextureMapPopulator p_174943_2_) {
  143. this.field_110574_e.clear();
  144. p_174943_2_.func_177059_a(this);
  145. this.func_110569_e();
  146. this.func_147631_c();
  147. this.func_110571_b(p_174943_1_);
  148. }
  149.  
  150. public void func_110571_b(IResourceManager p_110571_1_) {
  151. int i = Minecraft.func_71369_N();
  152. Stitcher stitcher = new Stitcher(i, i, 0, this.field_147636_j);
  153. this.field_94252_e.clear();
  154. this.field_94258_i.clear();
  155. int j = Integer.MAX_VALUE;
  156. int k = 1 << this.field_147636_j;
  157.  
  158. for(Entry<String, TextureAtlasSprite> entry : this.field_110574_e.entrySet()) {
  159. TextureAtlasSprite textureatlassprite = (TextureAtlasSprite)entry.getValue();
  160. ResourceLocation resourcelocation = this.func_184396_a(textureatlassprite);
  161. IResource iresource = null;
  162.  
  163. try {
  164. PngSizeInfo pngsizeinfo = PngSizeInfo.func_188532_a(p_110571_1_.func_110536_a(resourcelocation));
  165. iresource = p_110571_1_.func_110536_a(resourcelocation);
  166. boolean flag = iresource.func_110526_a("animation") != null;
  167. textureatlassprite.func_188538_a(pngsizeinfo, flag);
  168. } catch (RuntimeException runtimeexception) {
  169. field_147635_d.error((String)"Unable to parse metadata from {}", (Object)resourcelocation, (Object)runtimeexception);
  170. continue;
  171. } catch (IOException ioexception) {
  172. field_147635_d.error((String)"Using missing texture, unable to load {}", (Object)resourcelocation, (Object)ioexception);
  173. continue;
  174. } finally {
  175. IOUtils.closeQuietly((Closeable)iresource);
  176. }
  177.  
  178. j = Math.min(j, Math.min(textureatlassprite.func_94211_a(), textureatlassprite.func_94216_b()));
  179. int lvt_11_2_ = Math.min(Integer.lowestOneBit(textureatlassprite.func_94211_a()), Integer.lowestOneBit(textureatlassprite.func_94216_b()));
  180. if(lvt_11_4_ < k) {
  181. field_147635_d.warn((String)"Texture {} with size {}x{} limits mip level from {} to {}", (Object)resourcelocation, Integer.valueOf(textureatlassprite.func_94211_a()), Integer.valueOf(textureatlassprite.func_94216_b()), Integer.valueOf(MathHelper.func_151239_c(k)), Integer.valueOf(MathHelper.func_151239_c(lvt_11_2_)));
  182. k = lvt_11_2_;
  183. }
  184.  
  185. stitcher.func_110934_a(textureatlassprite);
  186. }
  187.  
  188. int l = Math.min(j, k);
  189. int i1 = MathHelper.func_151239_c(l);
  190. if(i1 < this.field_147636_j) {
  191. field_147635_d.warn((String)"{}: dropping miplevel from {} to {}, because of minimum power of two: {}", (Object)this.field_94254_c, Integer.valueOf(this.field_147636_j), Integer.valueOf(i1), Integer.valueOf(l));
  192. this.field_147636_j = i1;
  193. }
  194.  
  195. this.field_94249_f.func_147963_d(this.field_147636_j);
  196. stitcher.func_110934_a(this.field_94249_f);
  197.  
  198. try {
  199. stitcher.func_94305_f();
  200. } catch (StitcherException stitcherexception) {
  201. throw stitcherexception;
  202. }
  203.  
  204. field_147635_d.info((String)"Created: {}x{} {}-atlas", (Object)Integer.valueOf(stitcher.func_110935_a()), Integer.valueOf(stitcher.func_110936_b()), this.field_94254_c);
  205. TextureUtil.func_180600_a(this.func_110552_b(), this.field_147636_j, stitcher.func_110935_a(), stitcher.func_110936_b());
  206. Map<String, TextureAtlasSprite> map = Maps.<String, TextureAtlasSprite>newHashMap(this.field_110574_e);
  207.  
  208. for(TextureAtlasSprite textureatlassprite1 : stitcher.func_94309_g()) {
  209. if(textureatlassprite1 == this.field_94249_f || this.func_184397_a(p_110571_1_, textureatlassprite1)) {
  210. String s = textureatlassprite1.func_94215_i();
  211. map.remove(s);
  212. this.field_94252_e.put(s, textureatlassprite1);
  213.  
  214. try {
  215. TextureUtil.func_147955_a(textureatlassprite1.func_147965_a(0), textureatlassprite1.func_94211_a(), textureatlassprite1.func_94216_b(), textureatlassprite1.func_130010_a(), textureatlassprite1.func_110967_i(), false, false);
  216. } catch (Throwable throwable) {
  217. CrashReport crashreport = CrashReport.func_85055_a(throwable, "Stitching texture atlas");
  218. CrashReportCategory crashreportcategory = crashreport.func_85058_a("Texture being stitched together");
  219. crashreportcategory.func_71507_a("Atlas path", this.field_94254_c);
  220. crashreportcategory.func_71507_a("Sprite", textureatlassprite1);
  221. throw new ReportedException(crashreport);
  222. }
  223.  
  224. if(textureatlassprite1.func_130098_m()) {
  225. this.field_94258_i.add(textureatlassprite1);
  226. }
  227. }
  228. }
  229.  
  230. for(TextureAtlasSprite textureatlassprite2 : map.values()) {
  231. textureatlassprite2.func_94217_a(this.field_94249_f);
  232. }
  233.  
  234. }
  235.  
  236. private boolean func_184397_a(IResourceManager p_184397_1_, final TextureAtlasSprite p_184397_2_) {
  237. ResourceLocation resourcelocation = this.func_184396_a(p_184397_2_);
  238. IResource iresource = null;
  239.  
  240. label9: {
  241. boolean flag;
  242. try {
  243. iresource = p_184397_1_.func_110536_a(resourcelocation);
  244. p_184397_2_.func_188539_a(iresource, this.field_147636_j + 1);
  245. break label9;
  246. } catch (RuntimeException runtimeexception) {
  247. field_147635_d.error((String)"Unable to parse metadata from {}", (Object)resourcelocation, (Object)runtimeexception);
  248. flag = false;
  249. } catch (IOException ioexception) {
  250. field_147635_d.error((String)"Using missing texture, unable to load {}", (Object)resourcelocation, (Object)ioexception);
  251. flag = false;
  252. return flag;
  253. } finally {
  254. IOUtils.closeQuietly((Closeable)iresource);
  255. }
  256.  
  257. return flag;
  258. }
  259.  
  260. try {
  261. p_184397_2_.func_147963_d(this.field_147636_j);
  262. return true;
  263. } catch (Throwable throwable) {
  264. CrashReport crashreport = CrashReport.func_85055_a(throwable, "Applying mipmap");
  265. CrashReportCategory crashreportcategory = crashreport.func_85058_a("Sprite being mipmapped");
  266. crashreportcategory.func_189529_a("Sprite name", new ICrashReportDetail<String>() {
  267. public String call() throws Exception {
  268. return p_184397_2_.func_94215_i();
  269. }
  270. });
  271. crashreportcategory.func_189529_a("Sprite size", new ICrashReportDetail<String>() {
  272. public String call() throws Exception {
  273. return p_184397_2_.func_94211_a() + " x " + p_184397_2_.func_94216_b();
  274. }
  275. });
  276. crashreportcategory.func_189529_a("Sprite frames", new ICrashReportDetail<String>() {
  277. public String call() throws Exception {
  278. return p_184397_2_.func_110970_k() + " frames";
  279. }
  280. });
  281. crashreportcategory.func_71507_a("Mipmap levels", Integer.valueOf(this.field_147636_j));
  282. throw new ReportedException(crashreport);
  283. }
  284. }
  285.  
  286. private ResourceLocation func_184396_a(TextureAtlasSprite p_184396_1_) {
  287. ResourceLocation resourcelocation = new ResourceLocation(p_184396_1_.func_94215_i());
  288. return new ResourceLocation(resourcelocation.func_110624_b(), String.format("%s/%s%s", new Object[]{this.field_94254_c, resourcelocation.func_110623_a(), ".png"}));
  289. }
  290.  
  291. public TextureAtlasSprite func_110572_b(String p_110572_1_) {
  292. TextureAtlasSprite textureatlassprite = (TextureAtlasSprite)this.field_94252_e.get(p_110572_1_);
  293. if(textureatlassprite == null) {
  294. textureatlassprite = this.field_94249_f;
  295. }
  296.  
  297. return textureatlassprite;
  298. }
  299.  
  300. public void func_94248_c() {
  301. TextureUtil.func_94277_a(this.func_110552_b());
  302.  
  303. for(TextureAtlasSprite textureatlassprite : this.field_94258_i) {
  304. textureatlassprite.func_94219_l();
  305. }
  306.  
  307. }
  308.  
  309. public TextureAtlasSprite func_174942_a(ResourceLocation p_174942_1_) {
  310. if(p_174942_1_ == null) {
  311. throw new IllegalArgumentException("Location cannot be null!");
  312. } else {
  313. TextureAtlasSprite textureatlassprite = (TextureAtlasSprite)this.field_110574_e.get(p_174942_1_);
  314. if(textureatlassprite == null) {
  315. textureatlassprite = TextureAtlasSprite.func_176604_a(p_174942_1_);
  316. this.field_110574_e.put(p_174942_1_.toString(), textureatlassprite);
  317. }
  318.  
  319. return textureatlassprite;
  320. }
  321. }
  322.  
  323. public void func_110550_d() {
  324. this.func_94248_c();
  325. }
  326.  
  327. public void func_147633_a(int p_147633_1_) {
  328. this.field_147636_j = p_147633_1_;
  329. }
  330.  
  331. public TextureAtlasSprite func_174944_f() {
  332. return this.field_94249_f;
  333. }
  334. }
  335.  
  336. Hunk 2 failed! Cannot find hunk target
  337.  
  338. j = Math.min(j, Math.min(textureatlassprite.func_94211_a(), textureatlassprite.func_94216_b()));
  339. int j1 = Math.min(Integer.lowestOneBit(textureatlassprite.func_94211_a()), Integer.lowestOneBit(textureatlassprite.func_94216_b()));
  340. - if (lvt_11_4_ < k) {
  341. + if (j1 < k) {
  342. field_147635_d.warn("Texture {} with size {}x{} limits mip level from {} to {}", resourcelocation, Integer.valueOf(textureatlassprite.func_94211_a()), Integer.valueOf(textureatlassprite.func_94216_b()), Integer.valueOf(MathHelper.func_151239_c(k)), Integer.valueOf(MathHelper.func_151239_c(j1)));
  343. k = j1;
  344. }
  345. File state
  346. package net.minecraft.client.renderer.texture;
  347.  
  348. import com.google.common.collect.Lists;
  349. import com.google.common.collect.Maps;
  350. import java.io.Closeable;
  351. import java.io.IOException;
  352. import java.util.List;
  353. import java.util.Map;
  354. import java.util.Map.Entry;
  355. import javax.annotation.Nullable;
  356. import net.minecraft.client.Minecraft;
  357. import net.minecraft.client.renderer.StitcherException;
  358. import net.minecraft.client.renderer.texture.AbstractTexture;
  359. import net.minecraft.client.renderer.texture.ITextureMapPopulator;
  360. import net.minecraft.client.renderer.texture.ITickableTextureObject;
  361. import net.minecraft.client.renderer.texture.PngSizeInfo;
  362. import net.minecraft.client.renderer.texture.Stitcher;
  363. import net.minecraft.client.renderer.texture.TextureAtlasSprite;
  364. import net.minecraft.client.renderer.texture.TextureUtil;
  365. import net.minecraft.client.resources.IResource;
  366. import net.minecraft.client.resources.IResourceManager;
  367. import net.minecraft.crash.CrashReport;
  368. import net.minecraft.crash.CrashReportCategory;
  369. import net.minecraft.crash.ICrashReportDetail;
  370. import net.minecraft.util.ReportedException;
  371. import net.minecraft.util.ResourceLocation;
  372. import net.minecraft.util.math.MathHelper;
  373. import net.minecraftforge.fml.relauncher.Side;
  374. import net.minecraftforge.fml.relauncher.SideOnly;
  375. import org.apache.commons.io.IOUtils;
  376. import org.apache.logging.log4j.LogManager;
  377. import org.apache.logging.log4j.Logger;
  378.  
  379. @SideOnly(Side.CLIENT)
  380. public class TextureMap extends AbstractTexture implements ITickableTextureObject {
  381. private static final Logger field_147635_d = LogManager.getLogger();
  382. public static final ResourceLocation field_174945_f = new ResourceLocation("missingno");
  383. public static final ResourceLocation field_110575_b = new ResourceLocation("textures/atlas/blocks.png");
  384. private final List<TextureAtlasSprite> field_94258_i;
  385. private final Map<String, TextureAtlasSprite> field_110574_e;
  386. private final Map<String, TextureAtlasSprite> field_94252_e;
  387. private final String field_94254_c;
  388. private final ITextureMapPopulator field_174946_m;
  389. private int field_147636_j;
  390. private final TextureAtlasSprite field_94249_f;
  391.  
  392. public TextureMap(String p_i46099_1_) {
  393. this(p_i46099_1_, (ITextureMapPopulator)null);
  394. }
  395.  
  396. public TextureMap(String p_i46100_1_, @Nullable ITextureMapPopulator p_i46100_2_) {
  397. this.field_94258_i = Lists.<TextureAtlasSprite>newArrayList();
  398. this.field_110574_e = Maps.<String, TextureAtlasSprite>newHashMap();
  399. this.field_94252_e = Maps.<String, TextureAtlasSprite>newHashMap();
  400. this.field_94249_f = new TextureAtlasSprite("missingno");
  401. this.field_94254_c = p_i46100_1_;
  402. this.field_174946_m = p_i46100_2_;
  403. }
  404.  
  405. private void func_110569_e() {
  406. int[] aint = TextureUtil.field_110999_b;
  407. this.field_94249_f.func_110966_b(16);
  408. this.field_94249_f.func_110969_c(16);
  409. int[][] aint1 = new int[this.field_147636_j + 1][];
  410. aint1[0] = aint;
  411. this.field_94249_f.func_110968_a(Lists.newArrayList(new int[][][]{aint1}));
  412. }
  413.  
  414. public void func_110551_a(IResourceManager p_110551_1_) throws IOException {
  415. if(this.field_174946_m != null) {
  416. this.func_174943_a(p_110551_1_, this.field_174946_m);
  417. }
  418.  
  419. }
  420.  
  421. public void func_174943_a(IResourceManager p_174943_1_, ITextureMapPopulator p_174943_2_) {
  422. this.field_110574_e.clear();
  423. p_174943_2_.func_177059_a(this);
  424. this.func_110569_e();
  425. this.func_147631_c();
  426. this.func_110571_b(p_174943_1_);
  427. }
  428.  
  429. public void func_110571_b(IResourceManager p_110571_1_) {
  430. int i = Minecraft.func_71369_N();
  431. Stitcher stitcher = new Stitcher(i, i, 0, this.field_147636_j);
  432. this.field_94252_e.clear();
  433. this.field_94258_i.clear();
  434. int j = Integer.MAX_VALUE;
  435. int k = 1 << this.field_147636_j;
  436.  
  437. for(Entry<String, TextureAtlasSprite> entry : this.field_110574_e.entrySet()) {
  438. TextureAtlasSprite textureatlassprite = (TextureAtlasSprite)entry.getValue();
  439. ResourceLocation resourcelocation = this.func_184396_a(textureatlassprite);
  440. IResource iresource = null;
  441.  
  442. try {
  443. PngSizeInfo pngsizeinfo = PngSizeInfo.func_188532_a(p_110571_1_.func_110536_a(resourcelocation));
  444. iresource = p_110571_1_.func_110536_a(resourcelocation);
  445. boolean flag = iresource.func_110526_a("animation") != null;
  446. textureatlassprite.func_188538_a(pngsizeinfo, flag);
  447. } catch (RuntimeException runtimeexception) {
  448. field_147635_d.error((String)"Unable to parse metadata from {}", (Object)resourcelocation, (Object)runtimeexception);
  449. continue;
  450. } catch (IOException ioexception) {
  451. field_147635_d.error((String)"Using missing texture, unable to load {}", (Object)resourcelocation, (Object)ioexception);
  452. continue;
  453. } finally {
  454. IOUtils.closeQuietly((Closeable)iresource);
  455. }
  456.  
  457. j = Math.min(j, Math.min(textureatlassprite.func_94211_a(), textureatlassprite.func_94216_b()));
  458. int lvt_11_2_ = Math.min(Integer.lowestOneBit(textureatlassprite.func_94211_a()), Integer.lowestOneBit(textureatlassprite.func_94216_b()));
  459. if(lvt_11_4_ < k) {
  460. field_147635_d.warn((String)"Texture {} with size {}x{} limits mip level from {} to {}", (Object)resourcelocation, Integer.valueOf(textureatlassprite.func_94211_a()), Integer.valueOf(textureatlassprite.func_94216_b()), Integer.valueOf(MathHelper.func_151239_c(k)), Integer.valueOf(MathHelper.func_151239_c(lvt_11_2_)));
  461. k = lvt_11_2_;
  462. }
  463.  
  464. stitcher.func_110934_a(textureatlassprite);
  465. }
  466.  
  467. int l = Math.min(j, k);
  468. int i1 = MathHelper.func_151239_c(l);
  469. if(i1 < this.field_147636_j) {
  470. field_147635_d.warn((String)"{}: dropping miplevel from {} to {}, because of minimum power of two: {}", (Object)this.field_94254_c, Integer.valueOf(this.field_147636_j), Integer.valueOf(i1), Integer.valueOf(l));
  471. this.field_147636_j = i1;
  472. }
  473.  
  474. this.field_94249_f.func_147963_d(this.field_147636_j);
  475. stitcher.func_110934_a(this.field_94249_f);
  476.  
  477. try {
  478. stitcher.func_94305_f();
  479. } catch (StitcherException stitcherexception) {
  480. throw stitcherexception;
  481. }
  482.  
  483. field_147635_d.info((String)"Created: {}x{} {}-atlas", (Object)Integer.valueOf(stitcher.func_110935_a()), Integer.valueOf(stitcher.func_110936_b()), this.field_94254_c);
  484. TextureUtil.func_180600_a(this.func_110552_b(), this.field_147636_j, stitcher.func_110935_a(), stitcher.func_110936_b());
  485. Map<String, TextureAtlasSprite> map = Maps.<String, TextureAtlasSprite>newHashMap(this.field_110574_e);
  486.  
  487. for(TextureAtlasSprite textureatlassprite1 : stitcher.func_94309_g()) {
  488. if(textureatlassprite1 == this.field_94249_f || this.func_184397_a(p_110571_1_, textureatlassprite1)) {
  489. String s = textureatlassprite1.func_94215_i();
  490. map.remove(s);
  491. this.field_94252_e.put(s, textureatlassprite1);
  492.  
  493. try {
  494. TextureUtil.func_147955_a(textureatlassprite1.func_147965_a(0), textureatlassprite1.func_94211_a(), textureatlassprite1.func_94216_b(), textureatlassprite1.func_130010_a(), textureatlassprite1.func_110967_i(), false, false);
  495. } catch (Throwable throwable) {
  496. CrashReport crashreport = CrashReport.func_85055_a(throwable, "Stitching texture atlas");
  497. CrashReportCategory crashreportcategory = crashreport.func_85058_a("Texture being stitched together");
  498. crashreportcategory.func_71507_a("Atlas path", this.field_94254_c);
  499. crashreportcategory.func_71507_a("Sprite", textureatlassprite1);
  500. throw new ReportedException(crashreport);
  501. }
  502.  
  503. if(textureatlassprite1.func_130098_m()) {
  504. this.field_94258_i.add(textureatlassprite1);
  505. }
  506. }
  507. }
  508.  
  509. for(TextureAtlasSprite textureatlassprite2 : map.values()) {
  510. textureatlassprite2.func_94217_a(this.field_94249_f);
  511. }
  512.  
  513. }
  514.  
  515. private boolean func_184397_a(IResourceManager p_184397_1_, final TextureAtlasSprite p_184397_2_) {
  516. ResourceLocation resourcelocation = this.func_184396_a(p_184397_2_);
  517. IResource iresource = null;
  518.  
  519. label9: {
  520. boolean flag;
  521. try {
  522. iresource = p_184397_1_.func_110536_a(resourcelocation);
  523. p_184397_2_.func_188539_a(iresource, this.field_147636_j + 1);
  524. break label9;
  525. } catch (RuntimeException runtimeexception) {
  526. field_147635_d.error((String)"Unable to parse metadata from {}", (Object)resourcelocation, (Object)runtimeexception);
  527. flag = false;
  528. } catch (IOException ioexception) {
  529. field_147635_d.error((String)"Using missing texture, unable to load {}", (Object)resourcelocation, (Object)ioexception);
  530. flag = false;
  531. return flag;
  532. } finally {
  533. IOUtils.closeQuietly((Closeable)iresource);
  534. }
  535.  
  536. return flag;
  537. }
  538.  
  539. try {
  540. p_184397_2_.func_147963_d(this.field_147636_j);
  541. return true;
  542. } catch (Throwable throwable) {
  543. CrashReport crashreport = CrashReport.func_85055_a(throwable, "Applying mipmap");
  544. CrashReportCategory crashreportcategory = crashreport.func_85058_a("Sprite being mipmapped");
  545. crashreportcategory.func_189529_a("Sprite name", new ICrashReportDetail<String>() {
  546. public String call() throws Exception {
  547. return p_184397_2_.func_94215_i();
  548. }
  549. });
  550. crashreportcategory.func_189529_a("Sprite size", new ICrashReportDetail<String>() {
  551. public String call() throws Exception {
  552. return p_184397_2_.func_94211_a() + " x " + p_184397_2_.func_94216_b();
  553. }
  554. });
  555. crashreportcategory.func_189529_a("Sprite frames", new ICrashReportDetail<String>() {
  556. public String call() throws Exception {
  557. return p_184397_2_.func_110970_k() + " frames";
  558. }
  559. });
  560. crashreportcategory.func_71507_a("Mipmap levels", Integer.valueOf(this.field_147636_j));
  561. throw new ReportedException(crashreport);
  562. }
  563. }
  564.  
  565. private ResourceLocation func_184396_a(TextureAtlasSprite p_184396_1_) {
  566. ResourceLocation resourcelocation = new ResourceLocation(p_184396_1_.func_94215_i());
  567. return new ResourceLocation(resourcelocation.func_110624_b(), String.format("%s/%s%s", new Object[]{this.field_94254_c, resourcelocation.func_110623_a(), ".png"}));
  568. }
  569.  
  570. public TextureAtlasSprite func_110572_b(String p_110572_1_) {
  571. TextureAtlasSprite textureatlassprite = (TextureAtlasSprite)this.field_94252_e.get(p_110572_1_);
  572. if(textureatlassprite == null) {
  573. textureatlassprite = this.field_94249_f;
  574. }
  575.  
  576. return textureatlassprite;
  577. }
  578.  
  579. public void func_94248_c() {
  580. TextureUtil.func_94277_a(this.func_110552_b());
  581.  
  582. for(TextureAtlasSprite textureatlassprite : this.field_94258_i) {
  583. textureatlassprite.func_94219_l();
  584. }
  585.  
  586. }
  587.  
  588. public TextureAtlasSprite func_174942_a(ResourceLocation p_174942_1_) {
  589. if(p_174942_1_ == null) {
  590. throw new IllegalArgumentException("Location cannot be null!");
  591. } else {
  592. TextureAtlasSprite textureatlassprite = (TextureAtlasSprite)this.field_110574_e.get(p_174942_1_);
  593. if(textureatlassprite == null) {
  594. textureatlassprite = TextureAtlasSprite.func_176604_a(p_174942_1_);
  595. this.field_110574_e.put(p_174942_1_.toString(), textureatlassprite);
  596. }
  597.  
  598. return textureatlassprite;
  599. }
  600. }
  601.  
  602. public void func_110550_d() {
  603. this.func_94248_c();
  604. }
  605.  
  606. public void func_147633_a(int p_147633_1_) {
  607. this.field_147636_j = p_147633_1_;
  608. }
  609.  
  610. public TextureAtlasSprite func_174944_f() {
  611. return this.field_94249_f;
  612. }
  613. }
  614.  
  615. Patching failed: minecraft\net\minecraft\client\renderer\texture\TextureManager.java
  616. Hunk 2 failed! Cannot find hunk target
  617. this.field_110585_a.put(p_110579_1_, p_110579_2_);
  618. flag = false;
  619. } catch (Throwable throwable) {
  620. + final ITextureObject p_110579_2_f = p_110579_2_;
  621. CrashReport crashreport = CrashReport.func_85055_a(throwable, "Registering texture");
  622. CrashReportCategory crashreportcategory = crashreport.func_85058_a("Resource location being registered");
  623. crashreportcategory.func_71507_a("Resource location", p_110579_1_);
  624. crashreportcategory.func_189529_a("Texture object class", new ICrashReportDetail<String>() {
  625. public String call() throws Exception {
  626. - return p_110579_2_.getClass().getName();
  627. + return p_110579_2_f.getClass().getName();
  628. }
  629. });
  630. throw new ReportedException(crashreport);
  631. File state
  632. package net.minecraft.client.renderer.texture;
  633.  
  634. import com.google.common.collect.Lists;
  635. import com.google.common.collect.Maps;
  636. import java.io.IOException;
  637. import java.util.Iterator;
  638. import java.util.List;
  639. import java.util.Map;
  640. import java.util.Map.Entry;
  641. import net.minecraft.client.renderer.texture.DynamicTexture;
  642. import net.minecraft.client.renderer.texture.ITextureObject;
  643. import net.minecraft.client.renderer.texture.ITickable;
  644. import net.minecraft.client.renderer.texture.ITickableTextureObject;
  645. import net.minecraft.client.renderer.texture.SimpleTexture;
  646. import net.minecraft.client.renderer.texture.TextureUtil;
  647. import net.minecraft.client.resources.IResourceManager;
  648. import net.minecraft.client.resources.IResourceManagerReloadListener;
  649. import net.minecraft.crash.CrashReport;
  650. import net.minecraft.crash.CrashReportCategory;
  651. import net.minecraft.crash.ICrashReportDetail;
  652. import net.minecraft.util.ReportedException;
  653. import net.minecraft.util.ResourceLocation;
  654. import net.minecraftforge.fml.relauncher.Side;
  655. import net.minecraftforge.fml.relauncher.SideOnly;
  656. import org.apache.logging.log4j.LogManager;
  657. import org.apache.logging.log4j.Logger;
  658.  
  659. @SideOnly(Side.CLIENT)
  660. public class TextureManager implements ITickable, IResourceManagerReloadListener {
  661. private static final Logger field_147646_a = LogManager.getLogger();
  662. public static final ResourceLocation field_194008_a = new ResourceLocation("");
  663. private final Map<ResourceLocation, ITextureObject> field_110585_a = Maps.<ResourceLocation, ITextureObject>newHashMap();
  664. private final List<ITickable> field_110583_b = Lists.<ITickable>newArrayList();
  665. private final Map<String, Integer> field_110584_c = Maps.<String, Integer>newHashMap();
  666. private final IResourceManager field_110582_d;
  667.  
  668. public TextureManager(IResourceManager p_i1284_1_) {
  669. this.field_110582_d = p_i1284_1_;
  670. }
  671.  
  672. public void func_110577_a(ResourceLocation p_110577_1_) {
  673. ITextureObject itextureobject = (ITextureObject)this.field_110585_a.get(p_110577_1_);
  674. if(itextureobject == null) {
  675. itextureobject = new SimpleTexture(p_110577_1_);
  676. this.func_110579_a(p_110577_1_, itextureobject);
  677. }
  678.  
  679. TextureUtil.func_94277_a(itextureobject.func_110552_b());
  680. }
  681.  
  682. public boolean func_110580_a(ResourceLocation p_110580_1_, ITickableTextureObject p_110580_2_) {
  683. if(this.func_110579_a(p_110580_1_, p_110580_2_)) {
  684. this.field_110583_b.add(p_110580_2_);
  685. return true;
  686. } else {
  687. return false;
  688. }
  689. }
  690.  
  691. public boolean func_110579_a(ResourceLocation p_110579_1_, final ITextureObject p_110579_2_) {
  692. boolean flag = true;
  693.  
  694. try {
  695. ((ITextureObject)p_110579_2_).func_110551_a(this.field_110582_d);
  696. } catch (IOException ioexception) {
  697. if(p_110579_1_ != field_194008_a) {
  698. field_147646_a.warn((String)"Failed to load texture: {}", (Object)p_110579_1_, (Object)ioexception);
  699. }
  700.  
  701. p_110579_2_ = TextureUtil.field_111001_a;
  702. this.field_110585_a.put(p_110579_1_, (ITextureObject)p_110579_2_);
  703. flag = false;
  704. } catch (Throwable throwable) {
  705. CrashReport crashreport = CrashReport.func_85055_a(throwable, "Registering texture");
  706. CrashReportCategory crashreportcategory = crashreport.func_85058_a("Resource location being registered");
  707. crashreportcategory.func_71507_a("Resource location", p_110579_1_);
  708. crashreportcategory.func_189529_a("Texture object class", new ICrashReportDetail<String>() {
  709. public String call() throws Exception {
  710. return p_110579_2_.getClass().getName();
  711. }
  712. });
  713. throw new ReportedException(crashreport);
  714. }
  715.  
  716. this.field_110585_a.put(p_110579_1_, (ITextureObject)p_110579_2_);
  717. return flag;
  718. }
  719.  
  720. public ITextureObject func_110581_b(ResourceLocation p_110581_1_) {
  721. return (ITextureObject)this.field_110585_a.get(p_110581_1_);
  722. }
  723.  
  724. public ResourceLocation func_110578_a(String p_110578_1_, DynamicTexture p_110578_2_) {
  725. Integer integer = (Integer)this.field_110584_c.get(p_110578_1_);
  726. if(integer == null) {
  727. integer = Integer.valueOf(1);
  728. } else {
  729. integer = Integer.valueOf(integer.intValue() + 1);
  730. }
  731.  
  732. this.field_110584_c.put(p_110578_1_, integer);
  733. ResourceLocation resourcelocation = new ResourceLocation(String.format("dynamic/%s_%d", new Object[]{p_110578_1_, integer}));
  734. this.func_110579_a(resourcelocation, p_110578_2_);
  735. return resourcelocation;
  736. }
  737.  
  738. public void func_110550_d() {
  739. for(ITickable itickable : this.field_110583_b) {
  740. itickable.func_110550_d();
  741. }
  742.  
  743. }
  744.  
  745. public void func_147645_c(ResourceLocation p_147645_1_) {
  746. ITextureObject itextureobject = this.func_110581_b(p_147645_1_);
  747. if(itextureobject != null) {
  748. TextureUtil.func_147942_a(itextureobject.func_110552_b());
  749. }
  750.  
  751. }
  752.  
  753. public void func_110549_a(IResourceManager p_110549_1_) {
  754. Iterator<Entry<ResourceLocation, ITextureObject>> iterator = this.field_110585_a.entrySet().iterator();
  755.  
  756. while(iterator.hasNext()) {
  757. Entry<ResourceLocation, ITextureObject> entry = (Entry)iterator.next();
  758. ITextureObject itextureobject = (ITextureObject)entry.getValue();
  759. if(itextureobject == TextureUtil.field_111001_a) {
  760. iterator.remove();
  761. } else {
  762. this.func_110579_a((ResourceLocation)entry.getKey(), itextureobject);
  763. }
  764. }
  765.  
  766. }
  767. }
  768.  
  769. Patching failed: minecraft\net\minecraft\client\renderer\texture\TextureAtlasSprite.java
  770. Hunk 1 failed! Cannot find hunk target
  771. private void func_130099_d(int p_130099_1_) {
  772. if (this.field_110976_a.size() <= p_130099_1_) {
  773. for(int i = this.field_110976_a.size(); i <= p_130099_1_; ++i) {
  774. - this.field_110976_a.add((Object)null);
  775. + this.field_110976_a.add(null);
  776. }
  777.  
  778. }
  779. File state
  780. package net.minecraft.client.renderer.texture;
  781.  
  782. import com.google.common.collect.Lists;
  783. import java.awt.image.BufferedImage;
  784. import java.io.IOException;
  785. import java.util.Iterator;
  786. import java.util.List;
  787. import net.minecraft.client.renderer.texture.PngSizeInfo;
  788. import net.minecraft.client.renderer.texture.TextureUtil;
  789. import net.minecraft.client.resources.IResource;
  790. import net.minecraft.client.resources.data.AnimationFrame;
  791. import net.minecraft.client.resources.data.AnimationMetadataSection;
  792. import net.minecraft.crash.CrashReport;
  793. import net.minecraft.crash.CrashReportCategory;
  794. import net.minecraft.crash.ICrashReportDetail;
  795. import net.minecraft.util.ReportedException;
  796. import net.minecraft.util.ResourceLocation;
  797. import net.minecraftforge.fml.relauncher.Side;
  798. import net.minecraftforge.fml.relauncher.SideOnly;
  799.  
  800. @SideOnly(Side.CLIENT)
  801. public class TextureAtlasSprite {
  802. private final String field_110984_i;
  803. protected List<int[][]> field_110976_a = Lists.<int[][]>newArrayList();
  804. protected int[][] field_176605_b;
  805. private AnimationMetadataSection field_110982_k;
  806. protected boolean field_130222_e;
  807. protected int field_110975_c;
  808. protected int field_110974_d;
  809. protected int field_130223_c;
  810. protected int field_130224_d;
  811. private float field_110979_l;
  812. private float field_110980_m;
  813. private float field_110977_n;
  814. private float field_110978_o;
  815. protected int field_110973_g;
  816. protected int field_110983_h;
  817.  
  818. protected TextureAtlasSprite(String p_i1282_1_) {
  819. this.field_110984_i = p_i1282_1_;
  820. }
  821.  
  822. protected static TextureAtlasSprite func_176604_a(ResourceLocation p_176604_0_) {
  823. return new TextureAtlasSprite(p_176604_0_.toString());
  824. }
  825.  
  826. public void func_110971_a(int p_110971_1_, int p_110971_2_, int p_110971_3_, int p_110971_4_, boolean p_110971_5_) {
  827. this.field_110975_c = p_110971_3_;
  828. this.field_110974_d = p_110971_4_;
  829. this.field_130222_e = p_110971_5_;
  830. float f = (float)(0.009999999776482582D / (double)p_110971_1_);
  831. float f1 = (float)(0.009999999776482582D / (double)p_110971_2_);
  832. this.field_110979_l = (float)p_110971_3_ / (float)((double)p_110971_1_) + f;
  833. this.field_110980_m = (float)(p_110971_3_ + this.field_130223_c) / (float)((double)p_110971_1_) - f;
  834. this.field_110977_n = (float)p_110971_4_ / (float)p_110971_2_ + f1;
  835. this.field_110978_o = (float)(p_110971_4_ + this.field_130224_d) / (float)p_110971_2_ - f1;
  836. }
  837.  
  838. public void func_94217_a(TextureAtlasSprite p_94217_1_) {
  839. this.field_110975_c = p_94217_1_.field_110975_c;
  840. this.field_110974_d = p_94217_1_.field_110974_d;
  841. this.field_130223_c = p_94217_1_.field_130223_c;
  842. this.field_130224_d = p_94217_1_.field_130224_d;
  843. this.field_130222_e = p_94217_1_.field_130222_e;
  844. this.field_110979_l = p_94217_1_.field_110979_l;
  845. this.field_110980_m = p_94217_1_.field_110980_m;
  846. this.field_110977_n = p_94217_1_.field_110977_n;
  847. this.field_110978_o = p_94217_1_.field_110978_o;
  848. }
  849.  
  850. public int func_130010_a() {
  851. return this.field_110975_c;
  852. }
  853.  
  854. public int func_110967_i() {
  855. return this.field_110974_d;
  856. }
  857.  
  858. public int func_94211_a() {
  859. return this.field_130223_c;
  860. }
  861.  
  862. public int func_94216_b() {
  863. return this.field_130224_d;
  864. }
  865.  
  866. public float func_94209_e() {
  867. return this.field_110979_l;
  868. }
  869.  
  870. public float func_94212_f() {
  871. return this.field_110980_m;
  872. }
  873.  
  874. public float func_94214_a(double p_94214_1_) {
  875. float f = this.field_110980_m - this.field_110979_l;
  876. return this.field_110979_l + f * (float)p_94214_1_ / 16.0F;
  877. }
  878.  
  879. public float func_188537_a(float p_188537_1_) {
  880. float f = this.field_110980_m - this.field_110979_l;
  881. return (p_188537_1_ - this.field_110979_l) / f * 16.0F;
  882. }
  883.  
  884. public float func_94206_g() {
  885. return this.field_110977_n;
  886. }
  887.  
  888. public float func_94210_h() {
  889. return this.field_110978_o;
  890. }
  891.  
  892. public float func_94207_b(double p_94207_1_) {
  893. float f = this.field_110978_o - this.field_110977_n;
  894. return this.field_110977_n + f * (float)p_94207_1_ / 16.0F;
  895. }
  896.  
  897. public float func_188536_b(float p_188536_1_) {
  898. float f = this.field_110978_o - this.field_110977_n;
  899. return (p_188536_1_ - this.field_110977_n) / f * 16.0F;
  900. }
  901.  
  902. public String func_94215_i() {
  903. return this.field_110984_i;
  904. }
  905.  
  906. public void func_94219_l() {
  907. ++this.field_110983_h;
  908. if(this.field_110983_h >= this.field_110982_k.func_110472_a(this.field_110973_g)) {
  909. int i = this.field_110982_k.func_110468_c(this.field_110973_g);
  910. int j = this.field_110982_k.func_110473_c() == 0?this.field_110976_a.size():this.field_110982_k.func_110473_c();
  911. this.field_110973_g = (this.field_110973_g + 1) % j;
  912. this.field_110983_h = 0;
  913. int k = this.field_110982_k.func_110468_c(this.field_110973_g);
  914. if(i != k && k >= 0 && k < this.field_110976_a.size()) {
  915. TextureUtil.func_147955_a((int[][])this.field_110976_a.get(k), this.field_130223_c, this.field_130224_d, this.field_110975_c, this.field_110974_d, false, false);
  916. }
  917. } else if(this.field_110982_k.func_177219_e()) {
  918. this.func_180599_n();
  919. }
  920.  
  921. }
  922.  
  923. private void func_180599_n() {
  924. double d0 = 1.0D - (double)this.field_110983_h / (double)this.field_110982_k.func_110472_a(this.field_110973_g);
  925. int i = this.field_110982_k.func_110468_c(this.field_110973_g);
  926. int j = this.field_110982_k.func_110473_c() == 0?this.field_110976_a.size():this.field_110982_k.func_110473_c();
  927. int k = this.field_110982_k.func_110468_c((this.field_110973_g + 1) % j);
  928. if(i != k && k >= 0 && k < this.field_110976_a.size()) {
  929. int[][] aint = (int[][])this.field_110976_a.get(i);
  930. int[][] aint1 = (int[][])this.field_110976_a.get(k);
  931. if(this.field_176605_b == null || this.field_176605_b.length != aint.length) {
  932. this.field_176605_b = new int[aint.length][];
  933. }
  934.  
  935. for(int l = 0; l < aint.length; ++l) {
  936. if(this.field_176605_b[l] == null) {
  937. this.field_176605_b[l] = new int[aint[l].length];
  938. }
  939.  
  940. if(l < aint1.length && aint1[l].length == aint[l].length) {
  941. for(int i1 = 0; i1 < aint[l].length; ++i1) {
  942. int j1 = aint[l][i1];
  943. int k1 = aint1[l][i1];
  944. int l1 = this.func_188535_a(d0, j1 >> 16 & 255, k1 >> 16 & 255);
  945. int i2 = this.func_188535_a(d0, j1 >> 8 & 255, k1 >> 8 & 255);
  946. int j2 = this.func_188535_a(d0, j1 & 255, k1 & 255);
  947. this.field_176605_b[l][i1] = j1 & -16777216 | l1 << 16 | i2 << 8 | j2;
  948. }
  949. }
  950. }
  951.  
  952. TextureUtil.func_147955_a(this.field_176605_b, this.field_130223_c, this.field_130224_d, this.field_110975_c, this.field_110974_d, false, false);
  953. }
  954.  
  955. }
  956.  
  957. private int func_188535_a(double p_188535_1_, int p_188535_3_, int p_188535_4_) {
  958. return (int)(p_188535_1_ * (double)p_188535_3_ + (1.0D - p_188535_1_) * (double)p_188535_4_);
  959. }
  960.  
  961. public int[][] func_147965_a(int p_147965_1_) {
  962. return (int[][])this.field_110976_a.get(p_147965_1_);
  963. }
  964.  
  965. public int func_110970_k() {
  966. return this.field_110976_a.size();
  967. }
  968.  
  969. public void func_110966_b(int p_110966_1_) {
  970. this.field_130223_c = p_110966_1_;
  971. }
  972.  
  973. public void func_110969_c(int p_110969_1_) {
  974. this.field_130224_d = p_110969_1_;
  975. }
  976.  
  977. public void func_188538_a(PngSizeInfo p_188538_1_, boolean p_188538_2_) throws IOException {
  978. this.func_130102_n();
  979. this.field_130223_c = p_188538_1_.field_188533_a;
  980. this.field_130224_d = p_188538_1_.field_188534_b;
  981. if(p_188538_2_) {
  982. this.field_130224_d = this.field_130223_c;
  983. } else if(p_188538_1_.field_188534_b != p_188538_1_.field_188533_a) {
  984. throw new RuntimeException("broken aspect ratio and not an animation");
  985. }
  986.  
  987. }
  988.  
  989. public void func_188539_a(IResource p_188539_1_, int p_188539_2_) throws IOException {
  990. BufferedImage bufferedimage = TextureUtil.func_177053_a(p_188539_1_.func_110527_b());
  991. AnimationMetadataSection animationmetadatasection = (AnimationMetadataSection)p_188539_1_.func_110526_a("animation");
  992. int[][] aint = new int[p_188539_2_][];
  993. aint[0] = new int[bufferedimage.getWidth() * bufferedimage.getHeight()];
  994. bufferedimage.getRGB(0, 0, bufferedimage.getWidth(), bufferedimage.getHeight(), aint[0], 0, bufferedimage.getWidth());
  995. if(animationmetadatasection == null) {
  996. this.field_110976_a.add(aint);
  997. } else {
  998. int i = bufferedimage.getHeight() / this.field_130223_c;
  999. if(animationmetadatasection.func_110473_c() > 0) {
  1000. Iterator lvt_7_1_ = animationmetadatasection.func_130073_e().iterator();
  1001.  
  1002. while(lvt_7_1_.hasNext()) {
  1003. int j = ((Integer)lvt_7_1_.next()).intValue();
  1004. if(j >= i) {
  1005. throw new RuntimeException("invalid frameindex " + j);
  1006. }
  1007.  
  1008. this.func_130099_d(j);
  1009. this.field_110976_a.set(j, func_147962_a(aint, this.field_130223_c, this.field_130223_c, j));
  1010. }
  1011.  
  1012. this.field_110982_k = animationmetadatasection;
  1013. } else {
  1014. List<AnimationFrame> list = Lists.<AnimationFrame>newArrayList();
  1015.  
  1016. for(int k = 0; k < i; ++k) {
  1017. this.field_110976_a.add(func_147962_a(aint, this.field_130223_c, this.field_130223_c, k));
  1018. list.add(new AnimationFrame(k, -1));
  1019. }
  1020.  
  1021. this.field_110982_k = new AnimationMetadataSection(list, this.field_130223_c, this.field_130224_d, animationmetadatasection.func_110469_d(), animationmetadatasection.func_177219_e());
  1022. }
  1023. }
  1024.  
  1025. }
  1026.  
  1027. public void func_147963_d(int p_147963_1_) {
  1028. List<int[][]> list = Lists.<int[][]>newArrayList();
  1029.  
  1030. for(int i = 0; i < this.field_110976_a.size(); ++i) {
  1031. final int[][] aint = (int[][])this.field_110976_a.get(i);
  1032. if(aint != null) {
  1033. try {
  1034. list.add(TextureUtil.func_147949_a(p_147963_1_, this.field_130223_c, aint));
  1035. } catch (Throwable throwable) {
  1036. CrashReport crashreport = CrashReport.func_85055_a(throwable, "Generating mipmaps for frame");
  1037. CrashReportCategory crashreportcategory = crashreport.func_85058_a("Frame being iterated");
  1038. crashreportcategory.func_71507_a("Frame index", Integer.valueOf(i));
  1039. crashreportcategory.func_189529_a("Frame sizes", new ICrashReportDetail<String>() {
  1040. public String call() throws Exception {
  1041. StringBuilder stringbuilder = new StringBuilder();
  1042.  
  1043. for(int[] aint1 : aint) {
  1044. if(stringbuilder.length() > 0) {
  1045. stringbuilder.append(", ");
  1046. }
  1047.  
  1048. stringbuilder.append(aint1 == null?"null":Integer.valueOf(aint1.length));
  1049. }
  1050.  
  1051. return stringbuilder.toString();
  1052. }
  1053. });
  1054. throw new ReportedException(crashreport);
  1055. }
  1056. }
  1057. }
  1058.  
  1059. this.func_110968_a(list);
  1060. }
  1061.  
  1062. private void func_130099_d(int p_130099_1_) {
  1063. if(this.field_110976_a.size() <= p_130099_1_) {
  1064. for(int i = this.field_110976_a.size(); i <= p_130099_1_; ++i) {
  1065. this.field_110976_a.add((int[][])null);
  1066. }
  1067.  
  1068. }
  1069. }
  1070.  
  1071. private static int[][] func_147962_a(int[][] p_147962_0_, int p_147962_1_, int p_147962_2_, int p_147962_3_) {
  1072. int[][] aint = new int[p_147962_0_.length][];
  1073.  
  1074. for(int i = 0; i < p_147962_0_.length; ++i) {
  1075. int[] aint1 = p_147962_0_[i];
  1076. if(aint1 != null) {
  1077. aint[i] = new int[(p_147962_1_ >> i) * (p_147962_2_ >> i)];
  1078. System.arraycopy(aint1, p_147962_3_ * aint[i].length, aint[i], 0, aint[i].length);
  1079. }
  1080. }
  1081.  
  1082. return aint;
  1083. }
  1084.  
  1085. public void func_130103_l() {
  1086. this.field_110976_a.clear();
  1087. }
  1088.  
  1089. public boolean func_130098_m() {
  1090. return this.field_110982_k != null;
  1091. }
  1092.  
  1093. public void func_110968_a(List<int[][]> p_110968_1_) {
  1094. this.field_110976_a = p_110968_1_;
  1095. }
  1096.  
  1097. private void func_130102_n() {
  1098. this.field_110982_k = null;
  1099. this.func_110968_a(Lists.<int[][]>newArrayList());
  1100. this.field_110973_g = 0;
  1101. this.field_110983_h = 0;
  1102. }
  1103.  
  1104. public String toString() {
  1105. return "TextureAtlasSprite{name=\'" + this.field_110984_i + '\'' + ", frameCount=" + this.field_110976_a.size() + ", rotated=" + this.field_130222_e + ", x=" + this.field_110975_c + ", y=" + this.field_110974_d + ", height=" + this.field_130224_d + ", width=" + this.field_130223_c + ", u0=" + this.field_110979_l + ", u1=" + this.field_110980_m + ", v0=" + this.field_110977_n + ", v1=" + this.field_110978_o + '}';
  1106. }
  1107. }
  1108.  
  1109. Patching failed: minecraft\net\minecraft\client\renderer\vertex\VertexFormat.java
  1110. Hunk 1 failed! Cannot find hunk target
  1111. this.field_177353_d = 0;
  1112. }
  1113.  
  1114. + @SuppressWarnings("incomplete-switch")
  1115. public VertexFormat func_181721_a(VertexFormatElement p_181721_1_) {
  1116. if (p_181721_1_.func_177374_g() && this.func_177341_i()) {
  1117. field_177357_a.warn("VertexFormat error: Trying to add a position VertexFormatElement when one already exists, ignoring.");
  1118. File state
  1119. package net.minecraft.client.renderer.vertex;
  1120.  
  1121. import com.google.common.collect.Lists;
  1122. import java.util.List;
  1123. import net.minecraft.client.renderer.vertex.VertexFormatElement;
  1124. import net.minecraftforge.fml.relauncher.Side;
  1125. import net.minecraftforge.fml.relauncher.SideOnly;
  1126. import org.apache.logging.log4j.LogManager;
  1127. import org.apache.logging.log4j.Logger;
  1128.  
  1129. @SideOnly(Side.CLIENT)
  1130. public class VertexFormat {
  1131. private static final Logger field_177357_a = LogManager.getLogger();
  1132. private final List<VertexFormatElement> field_177355_b;
  1133. private final List<Integer> field_177356_c;
  1134. private int field_177353_d;
  1135. private int field_177354_e;
  1136. private final List<Integer> field_177351_f;
  1137. private int field_177352_g;
  1138.  
  1139. public VertexFormat(VertexFormat p_i46097_1_) {
  1140. this();
  1141.  
  1142. for(int i = 0; i < p_i46097_1_.func_177345_h(); ++i) {
  1143. this.func_181721_a(p_i46097_1_.func_177348_c(i));
  1144. }
  1145.  
  1146. this.field_177353_d = p_i46097_1_.func_177338_f();
  1147. }
  1148.  
  1149. public VertexFormat() {
  1150. this.field_177355_b = Lists.<VertexFormatElement>newArrayList();
  1151. this.field_177356_c = Lists.<Integer>newArrayList();
  1152. this.field_177354_e = -1;
  1153. this.field_177351_f = Lists.<Integer>newArrayList();
  1154. this.field_177352_g = -1;
  1155. }
  1156.  
  1157. public void func_177339_a() {
  1158. this.field_177355_b.clear();
  1159. this.field_177356_c.clear();
  1160. this.field_177354_e = -1;
  1161. this.field_177351_f.clear();
  1162. this.field_177352_g = -1;
  1163. this.field_177353_d = 0;
  1164. }
  1165.  
  1166. public VertexFormat func_181721_a(VertexFormatElement p_181721_1_) {
  1167. if(p_181721_1_.func_177374_g() && this.func_177341_i()) {
  1168. field_177357_a.warn("VertexFormat error: Trying to add a position VertexFormatElement when one already exists, ignoring.");
  1169. return this;
  1170. } else {
  1171. this.field_177355_b.add(p_181721_1_);
  1172. this.field_177356_c.add(Integer.valueOf(this.field_177353_d));
  1173. switch(p_181721_1_.func_177375_c()) {
  1174. case NORMAL:
  1175. this.field_177352_g = this.field_177353_d;
  1176. break;
  1177. case COLOR:
  1178. this.field_177354_e = this.field_177353_d;
  1179. break;
  1180. case UV:
  1181. this.field_177351_f.add(p_181721_1_.func_177369_e(), Integer.valueOf(this.field_177353_d));
  1182. }
  1183.  
  1184. this.field_177353_d += p_181721_1_.func_177368_f();
  1185. return this;
  1186. }
  1187. }
  1188.  
  1189. public boolean func_177350_b() {
  1190. return this.field_177352_g >= 0;
  1191. }
  1192.  
  1193. public int func_177342_c() {
  1194. return this.field_177352_g;
  1195. }
  1196.  
  1197. public boolean func_177346_d() {
  1198. return this.field_177354_e >= 0;
  1199. }
  1200.  
  1201. public int func_177340_e() {
  1202. return this.field_177354_e;
  1203. }
  1204.  
  1205. public boolean func_177347_a(int p_177347_1_) {
  1206. return this.field_177351_f.size() - 1 >= p_177347_1_;
  1207. }
  1208.  
  1209. public int func_177344_b(int p_177344_1_) {
  1210. return ((Integer)this.field_177351_f.get(p_177344_1_)).intValue();
  1211. }
  1212.  
  1213. public String toString() {
  1214. String s = "format: " + this.field_177355_b.size() + " elements: ";
  1215.  
  1216. for(int i = 0; i < this.field_177355_b.size(); ++i) {
  1217. s = s + ((VertexFormatElement)this.field_177355_b.get(i)).toString();
  1218. if(i != this.field_177355_b.size() - 1) {
  1219. s = s + " ";
  1220. }
  1221. }
  1222.  
  1223. return s;
  1224. }
  1225.  
  1226. private boolean func_177341_i() {
  1227. int i = 0;
  1228.  
  1229. for(int j = this.field_177355_b.size(); i < j; ++i) {
  1230. VertexFormatElement vertexformatelement = (VertexFormatElement)this.field_177355_b.get(i);
  1231. if(vertexformatelement.func_177374_g()) {
  1232. return true;
  1233. }
  1234. }
  1235.  
  1236. return false;
  1237. }
  1238.  
  1239. public int func_181719_f() {
  1240. return this.func_177338_f() / 4;
  1241. }
  1242.  
  1243. public int func_177338_f() {
  1244. return this.field_177353_d;
  1245. }
  1246.  
  1247. public List<VertexFormatElement> func_177343_g() {
  1248. return this.field_177355_b;
  1249. }
  1250.  
  1251. public int func_177345_h() {
  1252. return this.field_177355_b.size();
  1253. }
  1254.  
  1255. public VertexFormatElement func_177348_c(int p_177348_1_) {
  1256. return (VertexFormatElement)this.field_177355_b.get(p_177348_1_);
  1257. }
  1258.  
  1259. public int func_181720_d(int p_181720_1_) {
  1260. return ((Integer)this.field_177356_c.get(p_181720_1_)).intValue();
  1261. }
  1262.  
  1263. public boolean equals(Object p_equals_1_) {
  1264. if(this == p_equals_1_) {
  1265. return true;
  1266. } else if(p_equals_1_ != null && this.getClass() == p_equals_1_.getClass()) {
  1267. VertexFormat vertexformat = (VertexFormat)p_equals_1_;
  1268. return this.field_177353_d != vertexformat.field_177353_d?false:(!this.field_177355_b.equals(vertexformat.field_177355_b)?false:this.field_177356_c.equals(vertexformat.field_177356_c));
  1269. } else {
  1270. return false;
  1271. }
  1272. }
  1273.  
  1274. public int hashCode() {
  1275. int i = this.field_177355_b.hashCode();
  1276. i = 31 * i + this.field_177356_c.hashCode();
  1277. i = 31 * i + this.field_177353_d;
  1278. return i;
  1279. }
  1280. }
  1281.  
  1282. Patching failed: minecraft\net\minecraft\client\resources\SimpleResource.java
  1283. Hunk 1 failed! Cannot find hunk target
  1284. }
  1285. }
  1286.  
  1287. - T t = this.field_110535_a.get(p_110526_1_);
  1288. + T t = (T)this.field_110535_a.get(p_110526_1_);
  1289. if (t == null) {
  1290. t = this.field_110532_e.func_110503_a(p_110526_1_, this.field_110530_g);
  1291. }
  1292. File state
  1293. package net.minecraft.client.resources;
  1294.  
  1295. import com.google.common.collect.Maps;
  1296. import com.google.gson.JsonObject;
  1297. import com.google.gson.JsonParser;
  1298. import java.io.BufferedReader;
  1299. import java.io.IOException;
  1300. import java.io.InputStream;
  1301. import java.io.InputStreamReader;
  1302. import java.io.Reader;
  1303. import java.nio.charset.StandardCharsets;
  1304. import java.util.Map;
  1305. import javax.annotation.Nullable;
  1306. import net.minecraft.client.resources.IResource;
  1307. import net.minecraft.client.resources.data.IMetadataSection;
  1308. import net.minecraft.client.resources.data.MetadataSerializer;
  1309. import net.minecraft.util.ResourceLocation;
  1310. import net.minecraftforge.fml.relauncher.Side;
  1311. import net.minecraftforge.fml.relauncher.SideOnly;
  1312. import org.apache.commons.io.IOUtils;
  1313.  
  1314. @SideOnly(Side.CLIENT)
  1315. public class SimpleResource implements IResource {
  1316. private final Map<String, IMetadataSection> field_110535_a = Maps.<String, IMetadataSection>newHashMap();
  1317. private final String field_177242_b;
  1318. private final ResourceLocation field_110533_b;
  1319. private final InputStream field_110534_c;
  1320. private final InputStream field_110531_d;
  1321. private final MetadataSerializer field_110532_e;
  1322. private boolean field_110529_f;
  1323. private JsonObject field_110530_g;
  1324.  
  1325. public SimpleResource(String p_i46090_1_, ResourceLocation p_i46090_2_, InputStream p_i46090_3_, InputStream p_i46090_4_, MetadataSerializer p_i46090_5_) {
  1326. this.field_177242_b = p_i46090_1_;
  1327. this.field_110533_b = p_i46090_2_;
  1328. this.field_110534_c = p_i46090_3_;
  1329. this.field_110531_d = p_i46090_4_;
  1330. this.field_110532_e = p_i46090_5_;
  1331. }
  1332.  
  1333. public ResourceLocation func_177241_a() {
  1334. return this.field_110533_b;
  1335. }
  1336.  
  1337. public InputStream func_110527_b() {
  1338. return this.field_110534_c;
  1339. }
  1340.  
  1341. public boolean func_110528_c() {
  1342. return this.field_110531_d != null;
  1343. }
  1344.  
  1345. @Nullable
  1346. public <T extends IMetadataSection> T func_110526_a(String p_110526_1_) {
  1347. if(!this.func_110528_c()) {
  1348. return (T)null;
  1349. } else {
  1350. if(this.field_110530_g == null && !this.field_110529_f) {
  1351. this.field_110529_f = true;
  1352. BufferedReader bufferedreader = null;
  1353.  
  1354. try {
  1355. bufferedreader = new BufferedReader(new InputStreamReader(this.field_110531_d, StandardCharsets.UTF_8));
  1356. this.field_110530_g = (new JsonParser()).parse((Reader)bufferedreader).getAsJsonObject();
  1357. } finally {
  1358. IOUtils.closeQuietly((Reader)bufferedreader);
  1359. }
  1360. }
  1361.  
  1362. T t = (IMetadataSection)this.field_110535_a.get(p_110526_1_);
  1363. if(t == null) {
  1364. t = this.field_110532_e.func_110503_a(p_110526_1_, this.field_110530_g);
  1365. }
  1366.  
  1367. return t;
  1368. }
  1369. }
  1370.  
  1371. public String func_177240_d() {
  1372. return this.field_177242_b;
  1373. }
  1374.  
  1375. public boolean equals(Object p_equals_1_) {
  1376. if(this == p_equals_1_) {
  1377. return true;
  1378. } else if(!(p_equals_1_ instanceof SimpleResource)) {
  1379. return false;
  1380. } else {
  1381. SimpleResource simpleresource = (SimpleResource)p_equals_1_;
  1382. if(this.field_110533_b != null) {
  1383. if(!this.field_110533_b.equals(simpleresource.field_110533_b)) {
  1384. return false;
  1385. }
  1386. } else if(simpleresource.field_110533_b != null) {
  1387. return false;
  1388. }
  1389.  
  1390. if(this.field_177242_b != null) {
  1391. if(!this.field_177242_b.equals(simpleresource.field_177242_b)) {
  1392. return false;
  1393. }
  1394. } else if(simpleresource.field_177242_b != null) {
  1395. return false;
  1396. }
  1397.  
  1398. return true;
  1399. }
  1400. }
  1401.  
  1402. public int hashCode() {
  1403. int i = this.field_177242_b != null?this.field_177242_b.hashCode():0;
  1404. i = 31 * i + (this.field_110533_b != null?this.field_110533_b.hashCode():0);
  1405. return i;
  1406. }
  1407.  
  1408. public void close() throws IOException {
  1409. this.field_110534_c.close();
  1410. if(this.field_110531_d != null) {
  1411. this.field_110531_d.close();
  1412. }
  1413.  
  1414. }
  1415. }
  1416.  
  1417. Patching failed: minecraft\net\minecraft\advancements\AdvancementList.java
  1418. Hunk 1 failed! Cannot find hunk target
  1419. }
  1420.  
  1421. public void func_192083_a(Map<ResourceLocation, Advancement.Builder> p_192083_1_) {
  1422. - Function<ResourceLocation, Advancement> function = Functions.<ResourceLocation, Advancement>forMap(this.field_192092_b, (Object)null);
  1423. + Function<ResourceLocation, Advancement> function = Functions.<ResourceLocation, Advancement>forMap(this.field_192092_b, null);
  1424.  
  1425. label42:
  1426. while(!p_192083_1_.isEmpty()) {
  1427. File state
  1428. package net.minecraft.advancements;
  1429.  
  1430. import com.google.common.base.Functions;
  1431. import com.google.common.collect.Maps;
  1432. import com.google.common.collect.Sets;
  1433. import java.util.Iterator;
  1434. import java.util.Map;
  1435. import java.util.Set;
  1436. import java.util.Map.Entry;
  1437. import java.util.function.Function;
  1438. import javax.annotation.Nullable;
  1439. import net.minecraft.advancements.Advancement;
  1440. import net.minecraft.util.ResourceLocation;
  1441. import net.minecraftforge.fml.relauncher.Side;
  1442. import net.minecraftforge.fml.relauncher.SideOnly;
  1443. import org.apache.logging.log4j.LogManager;
  1444. import org.apache.logging.log4j.Logger;
  1445.  
  1446. public class AdvancementList {
  1447. private static final Logger field_192091_a = LogManager.getLogger();
  1448. private final Map<ResourceLocation, Advancement> field_192092_b = Maps.<ResourceLocation, Advancement>newHashMap();
  1449. private final Set<Advancement> field_192093_c = Sets.<Advancement>newLinkedHashSet();
  1450. private final Set<Advancement> field_192094_d = Sets.<Advancement>newLinkedHashSet();
  1451. private AdvancementList.Listener field_192095_e;
  1452.  
  1453. @SideOnly(Side.CLIENT)
  1454. private void func_192090_a(Advancement p_192090_1_) {
  1455. for(Advancement advancement : p_192090_1_.func_192069_e()) {
  1456. this.func_192090_a(advancement);
  1457. }
  1458.  
  1459. field_192091_a.info("Forgot about advancement " + p_192090_1_.func_192067_g());
  1460. this.field_192092_b.remove(p_192090_1_.func_192067_g());
  1461. if(p_192090_1_.func_192070_b() == null) {
  1462. this.field_192093_c.remove(p_192090_1_);
  1463. if(this.field_192095_e != null) {
  1464. this.field_192095_e.func_191928_b(p_192090_1_);
  1465. }
  1466. } else {
  1467. this.field_192094_d.remove(p_192090_1_);
  1468. if(this.field_192095_e != null) {
  1469. this.field_192095_e.func_191929_d(p_192090_1_);
  1470. }
  1471. }
  1472.  
  1473. }
  1474.  
  1475. @SideOnly(Side.CLIENT)
  1476. public void func_192085_a(Set<ResourceLocation> p_192085_1_) {
  1477. for(ResourceLocation resourcelocation : p_192085_1_) {
  1478. Advancement advancement = (Advancement)this.field_192092_b.get(resourcelocation);
  1479. if(advancement == null) {
  1480. field_192091_a.warn("Told to remove advancement " + resourcelocation + " but I don\'t know what that is");
  1481. } else {
  1482. this.func_192090_a(advancement);
  1483. }
  1484. }
  1485.  
  1486. }
  1487.  
  1488. public void func_192083_a(Map<ResourceLocation, Advancement.Builder> p_192083_1_) {
  1489. Function<ResourceLocation, Advancement> function = Functions.<ResourceLocation, Advancement>forMap(this.field_192092_b, (Advancement)null);
  1490.  
  1491. label18:
  1492. while(!p_192083_1_.isEmpty()) {
  1493. boolean flag = false;
  1494. Iterator<Entry<ResourceLocation, Advancement.Builder>> iterator = p_192083_1_.entrySet().iterator();
  1495.  
  1496. while(iterator.hasNext()) {
  1497. Entry<ResourceLocation, Advancement.Builder> entry = (Entry)iterator.next();
  1498. ResourceLocation resourcelocation = (ResourceLocation)entry.getKey();
  1499. Advancement.Builder advancement$builder = (Advancement.Builder)entry.getValue();
  1500. if(advancement$builder.func_192058_a(function)) {
  1501. Advancement advancement = advancement$builder.func_192056_a(resourcelocation);
  1502. this.field_192092_b.put(resourcelocation, advancement);
  1503. flag = true;
  1504. iterator.remove();
  1505. if(advancement.func_192070_b() == null) {
  1506. this.field_192093_c.add(advancement);
  1507. if(this.field_192095_e != null) {
  1508. this.field_192095_e.func_191931_a(advancement);
  1509. }
  1510. } else {
  1511. this.field_192094_d.add(advancement);
  1512. if(this.field_192095_e != null) {
  1513. this.field_192095_e.func_191932_c(advancement);
  1514. }
  1515. }
  1516. }
  1517. }
  1518.  
  1519. if(!flag) {
  1520. iterator = p_192083_1_.entrySet().iterator();
  1521.  
  1522. while(true) {
  1523. if(!iterator.hasNext()) {
  1524. break label18;
  1525. }
  1526.  
  1527. Entry<ResourceLocation, Advancement.Builder> entry1 = (Entry)iterator.next();
  1528. field_192091_a.error("Couldn\'t load advancement " + entry1.getKey() + ": " + entry1.getValue());
  1529. }
  1530. }
  1531. }
  1532.  
  1533. field_192091_a.info("Loaded " + this.field_192092_b.size() + " advancements");
  1534. }
  1535.  
  1536. public void func_192087_a() {
  1537. this.field_192092_b.clear();
  1538. this.field_192093_c.clear();
  1539. this.field_192094_d.clear();
  1540. if(this.field_192095_e != null) {
  1541. this.field_192095_e.func_191930_a();
  1542. }
  1543.  
  1544. }
  1545.  
  1546. public Iterable<Advancement> func_192088_b() {
  1547. return this.field_192093_c;
  1548. }
  1549.  
  1550. public Iterable<Advancement> func_192089_c() {
  1551. return this.field_192092_b.values();
  1552. }
  1553.  
  1554. @Nullable
  1555. public Advancement func_192084_a(ResourceLocation p_192084_1_) {
  1556. return (Advancement)this.field_192092_b.get(p_192084_1_);
  1557. }
  1558.  
  1559. @SideOnly(Side.CLIENT)
  1560. public void func_192086_a(@Nullable AdvancementList.Listener p_192086_1_) {
  1561. this.field_192095_e = p_192086_1_;
  1562. if(p_192086_1_ != null) {
  1563. for(Advancement advancement : this.field_192093_c) {
  1564. p_192086_1_.func_191931_a(advancement);
  1565. }
  1566.  
  1567. for(Advancement advancement1 : this.field_192094_d) {
  1568. p_192086_1_.func_191932_c(advancement1);
  1569. }
  1570. }
  1571.  
  1572. }
  1573.  
  1574. public interface Listener {
  1575. void func_191931_a(Advancement p_191931_1_);
  1576.  
  1577. @SideOnly(Side.CLIENT)
  1578. void func_191928_b(Advancement p_191928_1_);
  1579.  
  1580. void func_191932_c(Advancement p_191932_1_);
  1581.  
  1582. @SideOnly(Side.CLIENT)
  1583. void func_191929_d(Advancement p_191929_1_);
  1584.  
  1585. void func_191930_a();
  1586. }
  1587. }
  1588.  
  1589. Patching failed: minecraft\net\minecraft\client\util\SearchTree.java
  1590. Hunk 1 failed! Cannot find hunk target
  1591.  
  1592. private void func_194042_b(T p_194042_1_) {
  1593. (this.field_194047_d.apply(p_194042_1_)).forEach((p_194039_2_) -> {
  1594. - this.field_194045_b.func_194057_a(p_194039_1_, p_194039_2_.toString().toLowerCase(Locale.ROOT));
  1595. + this.field_194045_b.func_194057_a(p_194042_1_, p_194039_2_.toString().toLowerCase(Locale.ROOT));
  1596. });
  1597. (this.field_194046_c.apply(p_194042_1_)).forEach((p_194041_2_) -> {
  1598. - this.field_194044_a.func_194057_a(p_194041_1_, p_194041_2_.toLowerCase(Locale.ROOT));
  1599. + this.field_194044_a.func_194057_a(p_194042_1_, p_194041_2_.toLowerCase(Locale.ROOT));
  1600. });
  1601. }
  1602.  
  1603. File state
  1604. package net.minecraft.client.util;
  1605.  
  1606. import com.google.common.collect.AbstractIterator;
  1607. import com.google.common.collect.Lists;
  1608. import it.unimi.dsi.fastutil.objects.Object2IntMap;
  1609. import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
  1610. import java.util.Iterator;
  1611. import java.util.List;
  1612. import java.util.Locale;
  1613. import java.util.function.Consumer;
  1614. import java.util.function.Function;
  1615. import net.minecraft.client.util.ISearchTree;
  1616. import net.minecraft.client.util.SuffixArray;
  1617. import net.minecraft.util.ResourceLocation;
  1618. import net.minecraftforge.fml.relauncher.Side;
  1619. import net.minecraftforge.fml.relauncher.SideOnly;
  1620.  
  1621. @SideOnly(Side.CLIENT)
  1622. public class SearchTree<T> implements ISearchTree<T> {
  1623. protected SuffixArray<T> field_194044_a = new SuffixArray();
  1624. protected SuffixArray<T> field_194045_b = new SuffixArray();
  1625. private final Function<T, Iterable<String>> field_194046_c;
  1626. private final Function<T, Iterable<ResourceLocation>> field_194047_d;
  1627. private final List<T> field_194048_e = Lists.<T>newArrayList();
  1628. private Object2IntMap<T> field_194049_f = new Object2IntOpenHashMap();
  1629.  
  1630. public SearchTree(Function<T, Iterable<String>> p_i47612_1_, Function<T, Iterable<ResourceLocation>> p_i47612_2_) {
  1631. this.field_194046_c = p_i47612_1_;
  1632. this.field_194047_d = p_i47612_2_;
  1633. }
  1634.  
  1635. public void func_194040_a() {
  1636. this.field_194044_a = new SuffixArray();
  1637. this.field_194045_b = new SuffixArray();
  1638.  
  1639. for(T t : this.field_194048_e) {
  1640. this.func_194042_b(t);
  1641. }
  1642.  
  1643. this.field_194044_a.func_194058_a();
  1644. this.field_194045_b.func_194058_a();
  1645. }
  1646.  
  1647. public void func_194043_a(T p_194043_1_) {
  1648. this.field_194049_f.put(p_194043_1_, this.field_194048_e.size());
  1649. this.field_194048_e.add(p_194043_1_);
  1650. this.func_194042_b(p_194043_1_);
  1651. }
  1652.  
  1653. private void func_194042_b(T p_194042_1_) {
  1654. ((Iterable)this.field_194047_d.apply(p_194042_1_)).forEach((p_194039_2_) -> {
  1655. this.field_194045_b.func_194057_a(p_194042_1_, p_194039_2_.toString().toLowerCase(Locale.ROOT));
  1656. });
  1657. ((Iterable)this.field_194046_c.apply(p_194042_1_)).forEach((p_194041_2_) -> {
  1658. this.field_194044_a.func_194057_a(p_194042_1_, p_194041_2_.toLowerCase(Locale.ROOT));
  1659. });
  1660. }
  1661.  
  1662. public List<T> func_194038_a(String p_194038_1_) {
  1663. List<T> list = this.field_194044_a.func_194055_a(p_194038_1_);
  1664. if(p_194038_1_.indexOf(58) < 0) {
  1665. return list;
  1666. } else {
  1667. List<T> list1 = this.field_194045_b.func_194055_a(p_194038_1_);
  1668. return (List<T>)(list1.isEmpty()?list:Lists.newArrayList(new SearchTree.MergingIterator(list.iterator(), list1.iterator(), this.field_194049_f)));
  1669. }
  1670. }
  1671.  
  1672. @SideOnly(Side.CLIENT)
  1673. static class MergingIterator<T> extends AbstractIterator<T> {
  1674. private final Iterator<T> field_194033_a;
  1675. private final Iterator<T> field_194034_b;
  1676. private final Object2IntMap<T> field_194035_c;
  1677. private T field_194036_d;
  1678. private T field_194037_e;
  1679.  
  1680. public MergingIterator(Iterator<T> p_i47606_1_, Iterator<T> p_i47606_2_, Object2IntMap<T> p_i47606_3_) {
  1681. this.field_194033_a = p_i47606_1_;
  1682. this.field_194034_b = p_i47606_2_;
  1683. this.field_194035_c = p_i47606_3_;
  1684. this.field_194036_d = p_i47606_1_.hasNext()?p_i47606_1_.next():null;
  1685. this.field_194037_e = p_i47606_2_.hasNext()?p_i47606_2_.next():null;
  1686. }
  1687.  
  1688. protected T computeNext() {
  1689. if(this.field_194036_d == null && this.field_194037_e == null) {
  1690. return (T)this.endOfData();
  1691. } else {
  1692. int i;
  1693. if(this.field_194036_d == this.field_194037_e) {
  1694. i = 0;
  1695. } else if(this.field_194036_d == null) {
  1696. i = 1;
  1697. } else if(this.field_194037_e == null) {
  1698. i = -1;
  1699. } else {
  1700. i = Integer.compare(this.field_194035_c.getInt(this.field_194036_d), this.field_194035_c.getInt(this.field_194037_e));
  1701. }
  1702.  
  1703. T t = i <= 0?this.field_194036_d:this.field_194037_e;
  1704. if(i <= 0) {
  1705. this.field_194036_d = this.field_194033_a.hasNext()?this.field_194033_a.next():null;
  1706. }
  1707.  
  1708. if(i >= 0) {
  1709. this.field_194037_e = this.field_194034_b.hasNext()?this.field_194034_b.next():null;
  1710. }
  1711.  
  1712. return t;
  1713. }
  1714. }
  1715. }
  1716. }
  1717.  
  1718. Patching failed: minecraft\net\minecraft\client\util\SuffixArray.java
  1719. Hunk 1 failed! Cannot find hunk target
  1720. };
  1721. Swapper swapper = (p_194054_3_, p_194054_4_) -> {
  1722. if (p_194054_3_ != p_194054_4_) {
  1723. - int i2 = p_194054_0_[p_194054_3_];
  1724. - p_194054_0_[p_194054_3_] = p_194054_0_[p_194054_4_];
  1725. - p_194054_0_[p_194054_4_] = i2;
  1726. - i2 = p_194054_1_[p_194054_3_];
  1727. - p_194054_1_[p_194054_3_] = p_194054_1_[p_194054_4_];
  1728. - p_194054_1_[p_194054_4_] = i2;
  1729. - i2 = p_194054_2_[p_194054_3_];
  1730. - p_194054_2_[p_194054_3_] = p_194054_2_[p_194054_4_];
  1731. - p_194054_2_[p_194054_4_] = i2;
  1732. + int i2 = aint1[p_194054_3_];
  1733. + aint1[p_194054_3_] = aint1[p_194054_4_];
  1734. + aint1[p_194054_4_] = i2;
  1735. + i2 = aint2[p_194054_3_];
  1736. + aint2[p_194054_3_] = aint2[p_194054_4_];
  1737. + aint2[p_194054_4_] = i2;
  1738. + i2 = aint3[p_194054_3_];
  1739. + aint3[p_194054_3_] = aint3[p_194054_4_];
  1740. + aint3[p_194054_4_] = i2;
  1741. }
  1742.  
  1743. };
  1744. File state
  1745. package net.minecraft.client.util;
  1746.  
  1747. import com.google.common.collect.Lists;
  1748. import com.google.common.collect.Sets;
  1749. import it.unimi.dsi.fastutil.Arrays;
  1750. import it.unimi.dsi.fastutil.Swapper;
  1751. import it.unimi.dsi.fastutil.ints.IntArrayList;
  1752. import it.unimi.dsi.fastutil.ints.IntComparator;
  1753. import it.unimi.dsi.fastutil.ints.IntList;
  1754. import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
  1755. import it.unimi.dsi.fastutil.ints.IntSet;
  1756. import java.util.Collections;
  1757. import java.util.List;
  1758. import java.util.Set;
  1759. import net.minecraftforge.fml.relauncher.Side;
  1760. import net.minecraftforge.fml.relauncher.SideOnly;
  1761. import org.apache.logging.log4j.LogManager;
  1762. import org.apache.logging.log4j.Logger;
  1763.  
  1764. @SideOnly(Side.CLIENT)
  1765. public class SuffixArray<T> {
  1766. private static final boolean field_194062_b = Boolean.parseBoolean(System.getProperty("SuffixArray.printComparisons", "false"));
  1767. private static final boolean field_194063_c = Boolean.parseBoolean(System.getProperty("SuffixArray.printArray", "false"));
  1768. private static final Logger field_194064_d = LogManager.getLogger();
  1769. protected final List<T> field_194061_a = Lists.<T>newArrayList();
  1770. private final IntList field_194065_e = new IntArrayList();
  1771. private final IntList field_194066_f = new IntArrayList();
  1772. private IntList field_194067_g = new IntArrayList();
  1773. private IntList field_194068_h = new IntArrayList();
  1774. private int field_194069_i;
  1775.  
  1776. public void func_194057_a(T p_194057_1_, String p_194057_2_) {
  1777. this.field_194069_i = Math.max(this.field_194069_i, p_194057_2_.length());
  1778. int i = this.field_194061_a.size();
  1779. this.field_194061_a.add(p_194057_1_);
  1780. this.field_194066_f.add(this.field_194065_e.size());
  1781.  
  1782. for(int j = 0; j < p_194057_2_.length(); ++j) {
  1783. this.field_194067_g.add(i);
  1784. this.field_194068_h.add(j);
  1785. this.field_194065_e.add(p_194057_2_.charAt(j));
  1786. }
  1787.  
  1788. this.field_194067_g.add(i);
  1789. this.field_194068_h.add(p_194057_2_.length());
  1790. this.field_194065_e.add(-1);
  1791. }
  1792.  
  1793. public void func_194058_a() {
  1794. int i = this.field_194065_e.size();
  1795. int[] aint = new int[i];
  1796. final int[] aint1 = new int[i];
  1797. final int[] aint2 = new int[i];
  1798. int[] aint3 = new int[i];
  1799. IntComparator intcomparator = new IntComparator() {
  1800. public int compare(int p_compare_1_, int p_compare_2_) {
  1801. return aint1[p_compare_1_] == aint1[p_compare_2_]?Integer.compare(aint2[p_compare_1_], aint2[p_compare_2_]):Integer.compare(aint1[p_compare_1_], aint1[p_compare_2_]);
  1802. }
  1803.  
  1804. public int compare(Integer p_compare_1_, Integer p_compare_2_) {
  1805. return this.compare(p_compare_1_.intValue(), p_compare_2_.intValue());
  1806. }
  1807. };
  1808. Swapper swapper = (p_194054_3_, p_194054_4_) -> {
  1809. if(p_194054_3_ != p_194054_4_) {
  1810. int int = lvt_3_1_[p_194054_3_];
  1811. lvt_3_1_[p_194054_3_] = lvt_3_1_[p_194054_4_];
  1812. lvt_3_1_[p_194054_4_] = int;
  1813. int = lvt_4_1_[p_194054_3_];
  1814. lvt_4_1_[p_194054_3_] = lvt_4_1_[p_194054_4_];
  1815. lvt_4_1_[p_194054_4_] = int;
  1816. int = lvt_5_1_[p_194054_3_];
  1817. lvt_5_1_[p_194054_3_] = lvt_5_1_[p_194054_4_];
  1818. lvt_5_1_[p_194054_4_] = int;
  1819. }
  1820.  
  1821. };
  1822.  
  1823. for(int j = 0; j < i; ++j) {
  1824. aint[j] = this.field_194065_e.getInt(j);
  1825. }
  1826.  
  1827. int k1 = 1;
  1828.  
  1829. for(int k = Math.min(i, this.field_194069_i); k1 * 2 < k; k1 *= 2) {
  1830. for(int l = 0; l < i; aint3[l] = l++) {
  1831. aint1[l] = aint[l];
  1832. aint2[l] = l + k1 < i?aint[l + k1]:-2;
  1833. }
  1834.  
  1835. Arrays.quickSort(0, i, intcomparator, swapper);
  1836.  
  1837. for(int l1 = 0; l1 < i; ++l1) {
  1838. if(l1 > 0 && aint1[l1] == aint1[l1 - 1] && aint2[l1] == aint2[l1 - 1]) {
  1839. aint[aint3[l1]] = aint[aint3[l1 - 1]];
  1840. } else {
  1841. aint[aint3[l1]] = l1;
  1842. }
  1843. }
  1844. }
  1845.  
  1846. IntList intlist1 = this.field_194067_g;
  1847. IntList intlist = this.field_194068_h;
  1848. this.field_194067_g = new IntArrayList(intlist1.size());
  1849. this.field_194068_h = new IntArrayList(intlist.size());
  1850.  
  1851. for(int i1 = 0; i1 < i; ++i1) {
  1852. int j1 = aint3[i1];
  1853. this.field_194067_g.add(intlist1.getInt(j1));
  1854. this.field_194068_h.add(intlist.getInt(j1));
  1855. }
  1856.  
  1857. if(field_194063_c) {
  1858. this.func_194060_b();
  1859. }
  1860.  
  1861. }
  1862.  
  1863. private void func_194060_b() {
  1864. for(int int = 0; int < this.field_194067_g.size(); ++int) {
  1865. field_194064_d.debug((String)"{} {}", (Object)Integer.valueOf(int), (Object)this.func_194059_a(int));
  1866. }
  1867.  
  1868. field_194064_d.debug("");
  1869. }
  1870.  
  1871. private String func_194059_a(int p_194059_1_) {
  1872. int int = this.field_194068_h.getInt(p_194059_1_);
  1873. int int = this.field_194066_f.getInt(this.field_194067_g.getInt(p_194059_1_));
  1874. StringBuilder stringbuilder = new StringBuilder();
  1875.  
  1876. for(int int = 0; int + int < this.field_194065_e.size(); ++int) {
  1877. if(int == int) {
  1878. stringbuilder.append('^');
  1879. }
  1880.  
  1881. int int = ((Integer)this.field_194065_e.get(int + int)).intValue();
  1882. if(int == -1) {
  1883. break;
  1884. }
  1885.  
  1886. stringbuilder.append((char)int);
  1887. }
  1888.  
  1889. return stringbuilder.toString();
  1890. }
  1891.  
  1892. private int func_194056_a(String p_194056_1_, int p_194056_2_) {
  1893. int int = this.field_194066_f.getInt(this.field_194067_g.getInt(p_194056_2_));
  1894. int int = this.field_194068_h.getInt(p_194056_2_);
  1895.  
  1896. for(int int = 0; int < p_194056_1_.length(); ++int) {
  1897. int int = this.field_194065_e.getInt(int + int + int);
  1898. if(int == -1) {
  1899. return 1;
  1900. }
  1901.  
  1902. char char = p_194056_1_.charAt(int);
  1903. char char = (char)int;
  1904. if(char < char) {
  1905. return -1;
  1906. }
  1907.  
  1908. if(char > char) {
  1909. return 1;
  1910. }
  1911. }
  1912.  
  1913. return 0;
  1914. }
  1915.  
  1916. public List<T> func_194055_a(String p_194055_1_) {
  1917. int int = this.field_194067_g.size();
  1918. int int = 0;
  1919. int int = int;
  1920.  
  1921. while(int < int) {
  1922. int int = int + (int - int) / 2;
  1923. int int = this.func_194056_a(p_194055_1_, int);
  1924. if(field_194062_b) {
  1925. field_194064_d.debug((String)"comparing lower \"{}\" with {} \"{}\": {}", (Object)p_194055_1_, Integer.valueOf(int), this.func_194059_a(int), Integer.valueOf(int));
  1926. }
  1927.  
  1928. if(int > 0) {
  1929. int = int + 1;
  1930. } else {
  1931. int = int;
  1932. }
  1933. }
  1934.  
  1935. if(int >= 0 && int < int) {
  1936. int int = int;
  1937. int = int;
  1938.  
  1939. while(int < int) {
  1940. int int = int + (int - int) / 2;
  1941. int int = this.func_194056_a(p_194055_1_, int);
  1942. if(field_194062_b) {
  1943. field_194064_d.debug((String)"comparing upper \"{}\" with {} \"{}\": {}", (Object)p_194055_1_, Integer.valueOf(int), this.func_194059_a(int), Integer.valueOf(int));
  1944. }
  1945.  
  1946. if(int >= 0) {
  1947. int = int + 1;
  1948. } else {
  1949. int = int;
  1950. }
  1951. }
  1952.  
  1953. int int = int;
  1954. IntSet intset = new IntOpenHashSet();
  1955.  
  1956. for(int int = int; int < int; ++int) {
  1957. intset.add(this.field_194067_g.getInt(int));
  1958. }
  1959.  
  1960. int[] aint = intset.toIntArray();
  1961. java.util.Arrays.sort(aint);
  1962. Set<T> set = Sets.<T>newLinkedHashSet();
  1963.  
  1964. for(int int : aint) {
  1965. set.add(this.field_194061_a.get(int));
  1966. }
  1967.  
  1968. return Lists.newArrayList(set);
  1969. } else {
  1970. return Collections.<T>emptyList();
  1971. }
  1972. }
  1973. }
  1974.  
  1975. Patching failed: minecraft\net\minecraft\command\EntitySelector.java
  1976. Hunk 1 failed! Cannot find hunk target
  1977. }
  1978. }
  1979.  
  1980. - return Lists.newArrayList(entity);
  1981. + return Lists.newArrayList((T)entity);
  1982. }
  1983.  
  1984. return Collections.<T>emptyList();
  1985. File state
  1986. package net.minecraft.command;
  1987.  
  1988. import com.google.common.base.Predicate;
  1989. import com.google.common.base.Predicates;
  1990. import com.google.common.base.Splitter;
  1991. import com.google.common.collect.ComparisonChain;
  1992. import com.google.common.collect.Lists;
  1993. import com.google.common.collect.Maps;
  1994. import com.google.common.collect.Sets;
  1995. import java.util.Collections;
  1996. import java.util.Comparator;
  1997. import java.util.Iterator;
  1998. import java.util.List;
  1999. import java.util.Map;
  2000. import java.util.Set;
  2001. import java.util.Map.Entry;
  2002. import java.util.regex.Matcher;
  2003. import java.util.regex.Pattern;
  2004. import javax.annotation.Nullable;
  2005. import net.minecraft.command.CommandBase;
  2006. import net.minecraft.command.CommandException;
  2007. import net.minecraft.command.ICommandSender;
  2008. import net.minecraft.entity.Entity;
  2009. import net.minecraft.entity.EntityList;
  2010. import net.minecraft.entity.EntityLivingBase;
  2011. import net.minecraft.entity.player.EntityPlayer;
  2012. import net.minecraft.entity.player.EntityPlayerMP;
  2013. import net.minecraft.scoreboard.Score;
  2014. import net.minecraft.scoreboard.ScoreObjective;
  2015. import net.minecraft.scoreboard.Scoreboard;
  2016. import net.minecraft.scoreboard.Team;
  2017. import net.minecraft.util.EntitySelectors;
  2018. import net.minecraft.util.ResourceLocation;
  2019. import net.minecraft.util.math.AxisAlignedBB;
  2020. import net.minecraft.util.math.BlockPos;
  2021. import net.minecraft.util.math.MathHelper;
  2022. import net.minecraft.util.math.Vec3d;
  2023. import net.minecraft.util.text.ITextComponent;
  2024. import net.minecraft.util.text.TextComponentTranslation;
  2025. import net.minecraft.util.text.TextFormatting;
  2026. import net.minecraft.world.GameType;
  2027. import net.minecraft.world.World;
  2028.  
  2029. public class EntitySelector {
  2030. private static final Pattern field_82389_a = Pattern.compile("^@([pares])(?:\\[([^ ]*)\\])?$");
  2031. private static final Splitter field_190828_b = Splitter.on(',').omitEmptyStrings();
  2032. private static final Splitter field_190829_c = Splitter.on('=').limit(2);
  2033. private static final Set<String> field_190830_d = Sets.<String>newHashSet();
  2034. private static final String field_190831_e = func_190826_c("r");
  2035. private static final String field_190832_f = func_190826_c("rm");
  2036. private static final String field_190833_g = func_190826_c("l");
  2037. private static final String field_190834_h = func_190826_c("lm");
  2038. private static final String field_190835_i = func_190826_c("x");
  2039. private static final String field_190836_j = func_190826_c("y");
  2040. private static final String field_190837_k = func_190826_c("z");
  2041. private static final String field_190838_l = func_190826_c("dx");
  2042. private static final String field_190839_m = func_190826_c("dy");
  2043. private static final String field_190840_n = func_190826_c("dz");
  2044. private static final String field_190841_o = func_190826_c("rx");
  2045. private static final String field_190842_p = func_190826_c("rxm");
  2046. private static final String field_190843_q = func_190826_c("ry");
  2047. private static final String field_190844_r = func_190826_c("rym");
  2048. private static final String field_190845_s = func_190826_c("c");
  2049. private static final String field_190846_t = func_190826_c("m");
  2050. private static final String field_190847_u = func_190826_c("team");
  2051. private static final String field_190848_v = func_190826_c("name");
  2052. private static final String field_190849_w = func_190826_c("type");
  2053. private static final String field_190850_x = func_190826_c("tag");
  2054. private static final Predicate<String> field_190851_y = new Predicate<String>() {
  2055. public boolean apply(@Nullable String p_apply_1_) {
  2056. return p_apply_1_ != null && (EntitySelector.field_190830_d.contains(p_apply_1_) || p_apply_1_.length() > "score_".length() && p_apply_1_.startsWith("score_"));
  2057. }
  2058. };
  2059. private static final Set<String> field_179666_d = Sets.newHashSet(new String[]{field_190835_i, field_190836_j, field_190837_k, field_190838_l, field_190839_m, field_190840_n, field_190832_f, field_190831_e});
  2060.  
  2061. public static String func_190826_c(String p_190826_0_) {
  2062. field_190830_d.add(p_190826_0_);
  2063. return p_190826_0_;
  2064. }
  2065.  
  2066. @Nullable
  2067. public static EntityPlayerMP func_82386_a(ICommandSender p_82386_0_, String p_82386_1_) throws CommandException {
  2068. return (EntityPlayerMP)func_179652_a(p_82386_0_, p_82386_1_, EntityPlayerMP.class);
  2069. }
  2070.  
  2071. public static List<EntityPlayerMP> func_193531_b(ICommandSender p_193531_0_, String p_193531_1_) throws CommandException {
  2072. return func_179656_b(p_193531_0_, p_193531_1_, EntityPlayerMP.class);
  2073. }
  2074.  
  2075. @Nullable
  2076. public static <T extends Entity> T func_179652_a(ICommandSender p_179652_0_, String p_179652_1_, Class<? extends T> p_179652_2_) throws CommandException {
  2077. List<T> list = func_179656_b(p_179652_0_, p_179652_1_, p_179652_2_);
  2078. return (T)(list.size() == 1?(Entity)list.get(0):null);
  2079. }
  2080.  
  2081. @Nullable
  2082. public static ITextComponent func_150869_b(ICommandSender p_150869_0_, String p_150869_1_) throws CommandException {
  2083. List<Entity> list = func_179656_b(p_150869_0_, p_150869_1_, Entity.class);
  2084. if(list.isEmpty()) {
  2085. return null;
  2086. } else {
  2087. List<ITextComponent> list1 = Lists.<ITextComponent>newArrayList();
  2088.  
  2089. for(Entity entity : list) {
  2090. list1.add(entity.func_145748_c_());
  2091. }
  2092.  
  2093. return CommandBase.func_180530_a(list1);
  2094. }
  2095. }
  2096.  
  2097. public static <T extends Entity> List<T> func_179656_b(ICommandSender p_179656_0_, String p_179656_1_, Class<? extends T> p_179656_2_) throws CommandException {
  2098. Matcher matcher = field_82389_a.matcher(p_179656_1_);
  2099. if(matcher.matches() && p_179656_0_.func_70003_b(1, "@")) {
  2100. Map<String, String> map = func_82381_h(matcher.group(2));
  2101. if(!func_179655_b(p_179656_0_, map)) {
  2102. return Collections.<T>emptyList();
  2103. } else {
  2104. String s = matcher.group(1);
  2105. BlockPos blockpos = func_179664_b(map, p_179656_0_.func_180425_c());
  2106. Vec3d vec3d = func_189210_b(map, p_179656_0_.func_174791_d());
  2107. List<World> list = func_179654_a(p_179656_0_, map);
  2108. List<T> list1 = Lists.<T>newArrayList();
  2109.  
  2110. for(World world : list) {
  2111. if(world != null) {
  2112. List<Predicate<Entity>> list2 = Lists.<Predicate<Entity>>newArrayList();
  2113. list2.addAll(func_179663_a(map, s));
  2114. list2.addAll(func_179648_b(map));
  2115. list2.addAll(func_179649_c(map));
  2116. list2.addAll(func_179659_d(map));
  2117. list2.addAll(func_184952_c(p_179656_0_, map));
  2118. list2.addAll(func_179647_f(map));
  2119. list2.addAll(func_184951_f(map));
  2120. list2.addAll(func_180698_a(map, vec3d));
  2121. list2.addAll(func_179662_g(map));
  2122. if("s".equalsIgnoreCase(s)) {
  2123. Entity entity = p_179656_0_.func_174793_f();
  2124. if(entity != null && p_179656_2_.isAssignableFrom(entity.getClass())) {
  2125. if(map.containsKey(field_190838_l) || map.containsKey(field_190839_m) || map.containsKey(field_190840_n)) {
  2126. int i = func_179653_a(map, field_190838_l, 0);
  2127. int j = func_179653_a(map, field_190839_m, 0);
  2128. int k = func_179653_a(map, field_190840_n, 0);
  2129. AxisAlignedBB axisalignedbb = func_179661_a(blockpos, i, j, k);
  2130. if(!axisalignedbb.func_72326_a(entity.func_174813_aQ())) {
  2131. return Collections.<T>emptyList();
  2132. }
  2133. }
  2134.  
  2135. for(Predicate<Entity> predicate : list2) {
  2136. if(!predicate.apply(entity)) {
  2137. return Collections.<T>emptyList();
  2138. }
  2139. }
  2140.  
  2141. return Lists.newArrayList(new Entity[]{entity});
  2142. }
  2143.  
  2144. return Collections.<T>emptyList();
  2145. }
  2146.  
  2147. list1.addAll(func_179660_a(map, p_179656_2_, list2, s, world, blockpos));
  2148. }
  2149. }
  2150.  
  2151. return func_179658_a(list1, map, p_179656_0_, p_179656_2_, s, vec3d);
  2152. }
  2153. } else {
  2154. return Collections.<T>emptyList();
  2155. }
  2156. }
  2157.  
  2158. private static List<World> func_179654_a(ICommandSender p_179654_0_, Map<String, String> p_179654_1_) {
  2159. List<World> list = Lists.<World>newArrayList();
  2160. if(func_179665_h(p_179654_1_)) {
  2161. list.add(p_179654_0_.func_130014_f_());
  2162. } else {
  2163. Collections.addAll(list, p_179654_0_.func_184102_h().field_71305_c);
  2164. }
  2165.  
  2166. return list;
  2167. }
  2168.  
  2169. private static <T extends Entity> boolean func_179655_b(ICommandSender p_179655_0_, Map<String, String> p_179655_1_) {
  2170. String s = func_179651_b(p_179655_1_, field_190849_w);
  2171. if(s == null) {
  2172. return true;
  2173. } else {
  2174. ResourceLocation resourcelocation = new ResourceLocation(s.startsWith("!")?s.substring(1):s);
  2175. if(EntityList.func_180125_b(resourcelocation)) {
  2176. return true;
  2177. } else {
  2178. TextComponentTranslation textcomponenttranslation = new TextComponentTranslation("commands.generic.entity.invalidType", new Object[]{resourcelocation});
  2179. textcomponenttranslation.func_150256_b().func_150238_a(TextFormatting.RED);
  2180. p_179655_0_.func_145747_a(textcomponenttranslation);
  2181. return false;
  2182. }
  2183. }
  2184. }
  2185.  
  2186. private static List<Predicate<Entity>> func_179663_a(Map<String, String> p_179663_0_, String p_179663_1_) {
  2187. String s = func_179651_b(p_179663_0_, field_190849_w);
  2188. if(s == null || !p_179663_1_.equals("e") && !p_179663_1_.equals("r") && !p_179663_1_.equals("s")) {
  2189. return !p_179663_1_.equals("e") && !p_179663_1_.equals("s")?Collections.singletonList(new Predicate<Entity>() {
  2190. public boolean apply(@Nullable Entity p_apply_1_) {
  2191. return p_apply_1_ instanceof EntityPlayer;
  2192. }
  2193. }):Collections.emptyList();
  2194. } else {
  2195. final boolean flag = s.startsWith("!");
  2196. final ResourceLocation resourcelocation = new ResourceLocation(flag?s.substring(1):s);
  2197. return Collections.singletonList(new Predicate<Entity>() {
  2198. public boolean apply(@Nullable Entity p_apply_1_) {
  2199. return EntityList.func_180123_a(p_apply_1_, resourcelocation) != flag;
  2200. }
  2201. });
  2202. }
  2203. }
  2204.  
  2205. private static List<Predicate<Entity>> func_179648_b(Map<String, String> p_179648_0_) {
  2206. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  2207. final int i = func_179653_a(p_179648_0_, field_190834_h, -1);
  2208. final int j = func_179653_a(p_179648_0_, field_190833_g, -1);
  2209. if(i > -1 || j > -1) {
  2210. list.add(new Predicate<Entity>() {
  2211. public boolean apply(@Nullable Entity p_apply_1_) {
  2212. if(!(p_apply_1_ instanceof EntityPlayerMP)) {
  2213. return false;
  2214. } else {
  2215. EntityPlayerMP entityplayermp = (EntityPlayerMP)p_apply_1_;
  2216. return (i <= -1 || entityplayermp.field_71068_ca >= i) && (j <= -1 || entityplayermp.field_71068_ca <= j);
  2217. }
  2218. }
  2219. });
  2220. }
  2221.  
  2222. return list;
  2223. }
  2224.  
  2225. private static List<Predicate<Entity>> func_179649_c(Map<String, String> p_179649_0_) {
  2226. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  2227. String s = func_179651_b(p_179649_0_, field_190846_t);
  2228. if(s == null) {
  2229. return list;
  2230. } else {
  2231. final boolean flag = s.startsWith("!");
  2232. if(flag) {
  2233. s = s.substring(1);
  2234. }
  2235.  
  2236. final GameType gametype;
  2237. try {
  2238. int i = Integer.parseInt(s);
  2239. gametype = GameType.func_185329_a(i, GameType.NOT_SET);
  2240. } catch (Throwable var6) {
  2241. gametype = GameType.func_185328_a(s, GameType.NOT_SET);
  2242. }
  2243.  
  2244. list.add(new Predicate<Entity>() {
  2245. public boolean apply(@Nullable Entity p_apply_1_) {
  2246. if(!(p_apply_1_ instanceof EntityPlayerMP)) {
  2247. return false;
  2248. } else {
  2249. EntityPlayerMP entityplayermp = (EntityPlayerMP)p_apply_1_;
  2250. GameType gametype1 = entityplayermp.field_71134_c.func_73081_b();
  2251. return flag?gametype1 != gametype:gametype1 == gametype;
  2252. }
  2253. }
  2254. });
  2255. return list;
  2256. }
  2257. }
  2258.  
  2259. private static List<Predicate<Entity>> func_179659_d(Map<String, String> p_179659_0_) {
  2260. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  2261. final String s = func_179651_b(p_179659_0_, field_190847_u);
  2262. final boolean flag = s != null && s.startsWith("!");
  2263. if(flag) {
  2264. s = s.substring(1);
  2265. }
  2266.  
  2267. if(s != null) {
  2268. list.add(new Predicate<Entity>() {
  2269. public boolean apply(@Nullable Entity p_apply_1_) {
  2270. if(!(p_apply_1_ instanceof EntityLivingBase)) {
  2271. return false;
  2272. } else {
  2273. EntityLivingBase entitylivingbase = (EntityLivingBase)p_apply_1_;
  2274. Team team = entitylivingbase.func_96124_cp();
  2275. String s1 = team == null?"":team.func_96661_b();
  2276. return s1.equals(s) != flag;
  2277. }
  2278. }
  2279. });
  2280. }
  2281.  
  2282. return list;
  2283. }
  2284.  
  2285. private static List<Predicate<Entity>> func_184952_c(final ICommandSender p_184952_0_, Map<String, String> p_184952_1_) {
  2286. final Map<String, Integer> map = func_96560_a(p_184952_1_);
  2287. return (List<Predicate<Entity>>)(map.isEmpty()?Collections.emptyList():Lists.newArrayList(new Predicate[]{new Predicate<Entity>() {
  2288. public boolean apply(@Nullable Entity p_apply_1_) {
  2289. if(p_apply_1_ == null) {
  2290. return false;
  2291. } else {
  2292. Scoreboard scoreboard = p_184952_0_.func_184102_h().func_71218_a(0).func_96441_U();
  2293.  
  2294. for(Entry<String, Integer> entry : map.entrySet()) {
  2295. String s = (String)entry.getKey();
  2296. boolean flag = false;
  2297. if(s.endsWith("_min") && s.length() > 4) {
  2298. flag = true;
  2299. s = s.substring(0, s.length() - 4);
  2300. }
  2301.  
  2302. ScoreObjective scoreobjective = scoreboard.func_96518_b(s);
  2303. if(scoreobjective == null) {
  2304. return false;
  2305. }
  2306.  
  2307. String s1 = p_apply_1_ instanceof EntityPlayerMP?p_apply_1_.func_70005_c_():p_apply_1_.func_189512_bd();
  2308. if(!scoreboard.func_178819_b(s1, scoreobjective)) {
  2309. return false;
  2310. }
  2311.  
  2312. Score score = scoreboard.func_96529_a(s1, scoreobjective);
  2313. int i = score.func_96652_c();
  2314. if(i < ((Integer)entry.getValue()).intValue() && flag) {
  2315. return false;
  2316. }
  2317.  
  2318. if(i > ((Integer)entry.getValue()).intValue() && !flag) {
  2319. return false;
  2320. }
  2321. }
  2322.  
  2323. return true;
  2324. }
  2325. }
  2326. }}));
  2327. }
  2328.  
  2329. private static List<Predicate<Entity>> func_179647_f(Map<String, String> p_179647_0_) {
  2330. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  2331. final String s = func_179651_b(p_179647_0_, field_190848_v);
  2332. final boolean flag = s != null && s.startsWith("!");
  2333. if(flag) {
  2334. s = s.substring(1);
  2335. }
  2336.  
  2337. if(s != null) {
  2338. list.add(new Predicate<Entity>() {
  2339. public boolean apply(@Nullable Entity p_apply_1_) {
  2340. return p_apply_1_ != null && p_apply_1_.func_70005_c_().equals(s) != flag;
  2341. }
  2342. });
  2343. }
  2344.  
  2345. return list;
  2346. }
  2347.  
  2348. private static List<Predicate<Entity>> func_184951_f(Map<String, String> p_184951_0_) {
  2349. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  2350. final String s = func_179651_b(p_184951_0_, field_190850_x);
  2351. final boolean flag = s != null && s.startsWith("!");
  2352. if(flag) {
  2353. s = s.substring(1);
  2354. }
  2355.  
  2356. if(s != null) {
  2357. list.add(new Predicate<Entity>() {
  2358. public boolean apply(@Nullable Entity p_apply_1_) {
  2359. return p_apply_1_ == null?false:("".equals(s)?p_apply_1_.func_184216_O().isEmpty() != flag:p_apply_1_.func_184216_O().contains(s) != flag);
  2360. }
  2361. });
  2362. }
  2363.  
  2364. return list;
  2365. }
  2366.  
  2367. private static List<Predicate<Entity>> func_180698_a(Map<String, String> p_180698_0_, final Vec3d p_180698_1_) {
  2368. double d0 = (double)func_179653_a(p_180698_0_, field_190832_f, -1);
  2369. double d1 = (double)func_179653_a(p_180698_0_, field_190831_e, -1);
  2370. final boolean flag = d0 < -0.5D;
  2371. final boolean flag1 = d1 < -0.5D;
  2372. if(flag && flag1) {
  2373. return Collections.<Predicate<Entity>>emptyList();
  2374. } else {
  2375. double d2 = Math.max(d0, 1.0E-4D);
  2376. final double d3 = d2 * d2;
  2377. double d4 = Math.max(d1, 1.0E-4D);
  2378. final double d5 = d4 * d4;
  2379. return Lists.newArrayList(new Predicate[]{new Predicate<Entity>() {
  2380. public boolean apply(@Nullable Entity p_apply_1_) {
  2381. if(p_apply_1_ == null) {
  2382. return false;
  2383. } else {
  2384. double d6 = p_180698_1_.func_186679_c(p_apply_1_.field_70165_t, p_apply_1_.field_70163_u, p_apply_1_.field_70161_v);
  2385. return (flag || d6 >= d3) && (flag1 || d6 <= d5);
  2386. }
  2387. }
  2388. }});
  2389. }
  2390. }
  2391.  
  2392. private static List<Predicate<Entity>> func_179662_g(Map<String, String> p_179662_0_) {
  2393. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  2394. if(p_179662_0_.containsKey(field_190844_r) || p_179662_0_.containsKey(field_190843_q)) {
  2395. final int i = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190844_r, 0));
  2396. final int j = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190843_q, 359));
  2397. list.add(new Predicate<Entity>() {
  2398. public boolean apply(@Nullable Entity p_apply_1_) {
  2399. if(p_apply_1_ == null) {
  2400. return false;
  2401. } else {
  2402. int i1 = MathHelper.func_188209_b(MathHelper.func_76141_d(p_apply_1_.field_70177_z));
  2403. return i > j?i1 >= i || i1 <= j:i1 >= i && i1 <= j;
  2404. }
  2405. }
  2406. });
  2407. }
  2408.  
  2409. if(p_179662_0_.containsKey(field_190842_p) || p_179662_0_.containsKey(field_190841_o)) {
  2410. final int k = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190842_p, 0));
  2411. final int l = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190841_o, 359));
  2412. list.add(new Predicate<Entity>() {
  2413. public boolean apply(@Nullable Entity p_apply_1_) {
  2414. if(p_apply_1_ == null) {
  2415. return false;
  2416. } else {
  2417. int i1 = MathHelper.func_188209_b(MathHelper.func_76141_d(p_apply_1_.field_70125_A));
  2418. return k > l?i1 >= k || i1 <= l:i1 >= k && i1 <= l;
  2419. }
  2420. }
  2421. });
  2422. }
  2423.  
  2424. return list;
  2425. }
  2426.  
  2427. private static <T extends Entity> List<T> func_179660_a(Map<String, String> p_179660_0_, Class<? extends T> p_179660_1_, List<Predicate<Entity>> p_179660_2_, String p_179660_3_, World p_179660_4_, BlockPos p_179660_5_) {
  2428. List<T> list = Lists.<T>newArrayList();
  2429. String s = func_179651_b(p_179660_0_, field_190849_w);
  2430. s = s != null && s.startsWith("!")?s.substring(1):s;
  2431. boolean flag = !p_179660_3_.equals("e");
  2432. boolean flag1 = p_179660_3_.equals("r") && s != null;
  2433. int i = func_179653_a(p_179660_0_, field_190838_l, 0);
  2434. int j = func_179653_a(p_179660_0_, field_190839_m, 0);
  2435. int k = func_179653_a(p_179660_0_, field_190840_n, 0);
  2436. int l = func_179653_a(p_179660_0_, field_190831_e, -1);
  2437. Predicate<Entity> predicate = Predicates.and(p_179660_2_);
  2438. Predicate<Entity> predicate1 = Predicates.<Entity>and(EntitySelectors.field_94557_a, predicate);
  2439. if(!p_179660_0_.containsKey(field_190838_l) && !p_179660_0_.containsKey(field_190839_m) && !p_179660_0_.containsKey(field_190840_n)) {
  2440. if(l >= 0) {
  2441. AxisAlignedBB axisalignedbb1 = new AxisAlignedBB((double)(p_179660_5_.func_177958_n() - l), (double)(p_179660_5_.func_177956_o() - l), (double)(p_179660_5_.func_177952_p() - l), (double)(p_179660_5_.func_177958_n() + l + 1), (double)(p_179660_5_.func_177956_o() + l + 1), (double)(p_179660_5_.func_177952_p() + l + 1));
  2442. if(flag && !flag1) {
  2443. list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate1));
  2444. } else {
  2445. list.addAll(p_179660_4_.<T>func_175647_a(p_179660_1_, axisalignedbb1, predicate1));
  2446. }
  2447. } else if(p_179660_3_.equals("a")) {
  2448. list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate));
  2449. } else if(!p_179660_3_.equals("p") && (!p_179660_3_.equals("r") || flag1)) {
  2450. list.addAll(p_179660_4_.<T>func_175644_a(p_179660_1_, predicate1));
  2451. } else {
  2452. list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate1));
  2453. }
  2454. } else {
  2455. final AxisAlignedBB axisalignedbb = func_179661_a(p_179660_5_, i, j, k);
  2456. if(flag && !flag1) {
  2457. Predicate<Entity> predicate2 = new Predicate<Entity>() {
  2458. public boolean apply(@Nullable Entity p_apply_1_) {
  2459. return p_apply_1_ != null && axisalignedbb.func_72326_a(p_apply_1_.func_174813_aQ());
  2460. }
  2461. };
  2462. list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, Predicates.<T>and(predicate1, predicate2)));
  2463. } else {
  2464. list.addAll(p_179660_4_.<T>func_175647_a(p_179660_1_, axisalignedbb, predicate1));
  2465. }
  2466. }
  2467.  
  2468. return list;
  2469. }
  2470.  
  2471. private static <T extends Entity> List<T> func_179658_a(List<T> p_179658_0_, Map<String, String> p_179658_1_, ICommandSender p_179658_2_, Class<? extends T> p_179658_3_, String p_179658_4_, final Vec3d p_179658_5_) {
  2472. int i = func_179653_a(p_179658_1_, field_190845_s, !p_179658_4_.equals("a") && !p_179658_4_.equals("e")?1:0);
  2473. if(!p_179658_4_.equals("p") && !p_179658_4_.equals("a") && !p_179658_4_.equals("e")) {
  2474. if(p_179658_4_.equals("r")) {
  2475. Collections.shuffle((List<?>)p_179658_0_);
  2476. }
  2477. } else {
  2478. Collections.sort((List<T>)p_179658_0_, new Comparator<Entity>() {
  2479. public int compare(Entity p_compare_1_, Entity p_compare_2_) {
  2480. return ComparisonChain.start().compare(p_compare_1_.func_70092_e(p_179658_5_.field_72450_a, p_179658_5_.field_72448_b, p_179658_5_.field_72449_c), p_compare_2_.func_70092_e(p_179658_5_.field_72450_a, p_179658_5_.field_72448_b, p_179658_5_.field_72449_c)).result();
  2481. }
  2482. });
  2483. }
  2484.  
  2485. Entity entity = p_179658_2_.func_174793_f();
  2486. if(entity != null && p_179658_3_.isAssignableFrom(entity.getClass()) && i == 1 && ((List)p_179658_0_).contains(entity) && !"r".equals(p_179658_4_)) {
  2487. p_179658_0_ = Lists.newArrayList(new Entity[]{entity});
  2488. }
  2489.  
  2490. if(i != 0) {
  2491. if(i < 0) {
  2492. Collections.reverse((List<?>)p_179658_0_);
  2493. }
  2494.  
  2495. p_179658_0_ = ((List)p_179658_0_).subList(0, Math.min(Math.abs(i), ((List)p_179658_0_).size()));
  2496. }
  2497.  
  2498. return (List)p_179658_0_;
  2499. }
  2500.  
  2501. private static AxisAlignedBB func_179661_a(BlockPos p_179661_0_, int p_179661_1_, int p_179661_2_, int p_179661_3_) {
  2502. boolean flag = p_179661_1_ < 0;
  2503. boolean flag1 = p_179661_2_ < 0;
  2504. boolean flag2 = p_179661_3_ < 0;
  2505. int i = p_179661_0_.func_177958_n() + (flag?p_179661_1_:0);
  2506. int j = p_179661_0_.func_177956_o() + (flag1?p_179661_2_:0);
  2507. int k = p_179661_0_.func_177952_p() + (flag2?p_179661_3_:0);
  2508. int l = p_179661_0_.func_177958_n() + (flag?0:p_179661_1_) + 1;
  2509. int i1 = p_179661_0_.func_177956_o() + (flag1?0:p_179661_2_) + 1;
  2510. int j1 = p_179661_0_.func_177952_p() + (flag2?0:p_179661_3_) + 1;
  2511. return new AxisAlignedBB((double)i, (double)j, (double)k, (double)l, (double)i1, (double)j1);
  2512. }
  2513.  
  2514. private static BlockPos func_179664_b(Map<String, String> p_179664_0_, BlockPos p_179664_1_) {
  2515. return new BlockPos(func_179653_a(p_179664_0_, field_190835_i, p_179664_1_.func_177958_n()), func_179653_a(p_179664_0_, field_190836_j, p_179664_1_.func_177956_o()), func_179653_a(p_179664_0_, field_190837_k, p_179664_1_.func_177952_p()));
  2516. }
  2517.  
  2518. private static Vec3d func_189210_b(Map<String, String> p_189210_0_, Vec3d p_189210_1_) {
  2519. return new Vec3d(func_189211_a(p_189210_0_, field_190835_i, p_189210_1_.field_72450_a, true), func_189211_a(p_189210_0_, field_190836_j, p_189210_1_.field_72448_b, false), func_189211_a(p_189210_0_, field_190837_k, p_189210_1_.field_72449_c, true));
  2520. }
  2521.  
  2522. private static double func_189211_a(Map<String, String> p_189211_0_, String p_189211_1_, double p_189211_2_, boolean p_189211_4_) {
  2523. return p_189211_0_.containsKey(p_189211_1_)?(double)MathHelper.func_82715_a((String)p_189211_0_.get(p_189211_1_), MathHelper.func_76128_c(p_189211_2_)) + (p_189211_4_?0.5D:0.0D):p_189211_2_;
  2524. }
  2525.  
  2526. private static boolean func_179665_h(Map<String, String> p_179665_0_) {
  2527. for(String s : field_179666_d) {
  2528. if(p_179665_0_.containsKey(s)) {
  2529. return true;
  2530. }
  2531. }
  2532.  
  2533. return false;
  2534. }
  2535.  
  2536. private static int func_179653_a(Map<String, String> p_179653_0_, String p_179653_1_, int p_179653_2_) {
  2537. return p_179653_0_.containsKey(p_179653_1_)?MathHelper.func_82715_a((String)p_179653_0_.get(p_179653_1_), p_179653_2_):p_179653_2_;
  2538. }
  2539.  
  2540. @Nullable
  2541. private static String func_179651_b(Map<String, String> p_179651_0_, String p_179651_1_) {
  2542. return (String)p_179651_0_.get(p_179651_1_);
  2543. }
  2544.  
  2545. public static Map<String, Integer> func_96560_a(Map<String, String> p_96560_0_) {
  2546. Map<String, Integer> map = Maps.<String, Integer>newHashMap();
  2547.  
  2548. for(String s : p_96560_0_.keySet()) {
  2549. if(s.startsWith("score_") && s.length() > "score_".length()) {
  2550. map.put(s.substring("score_".length()), Integer.valueOf(MathHelper.func_82715_a((String)p_96560_0_.get(s), 1)));
  2551. }
  2552. }
  2553.  
  2554. return map;
  2555. }
  2556.  
  2557. public static boolean func_82377_a(String p_82377_0_) throws CommandException {
  2558. Matcher matcher = field_82389_a.matcher(p_82377_0_);
  2559. if(!matcher.matches()) {
  2560. return false;
  2561. } else {
  2562. Map<String, String> map = func_82381_h(matcher.group(2));
  2563. String s = matcher.group(1);
  2564. int i = !"a".equals(s) && !"e".equals(s)?1:0;
  2565. return func_179653_a(map, field_190845_s, i) != 1;
  2566. }
  2567. }
  2568.  
  2569. public static boolean func_82378_b(String p_82378_0_) {
  2570. return field_82389_a.matcher(p_82378_0_).matches();
  2571. }
  2572.  
  2573. private static Map<String, String> func_82381_h(@Nullable String p_82381_0_) throws CommandException {
  2574. Map<String, String> map = Maps.<String, String>newHashMap();
  2575. if(p_82381_0_ == null) {
  2576. return map;
  2577. } else {
  2578. for(String s : field_190828_b.split(p_82381_0_)) {
  2579. Iterator<String> iterator = field_190829_c.split(s).iterator();
  2580. String s1 = (String)iterator.next();
  2581. if(!field_190851_y.apply(s1)) {
  2582. throw new CommandException("commands.generic.selector_argument", new Object[]{s});
  2583. }
  2584.  
  2585. map.put(s1, iterator.hasNext()?(String)iterator.next():"");
  2586. }
  2587.  
  2588. return map;
  2589. }
  2590. }
  2591. }
  2592.  
  2593. Hunk 3 failed! Cannot find hunk target
  2594. gametype = GameType.func_185328_a(s, GameType.NOT_SET);
  2595. }
  2596.  
  2597. + final GameType type = gametype;
  2598. list.add(new Predicate<Entity>() {
  2599. public boolean apply(@Nullable Entity p_apply_1_) {
  2600. if (!(p_apply_1_ instanceof EntityPlayerMP)) {
  2601. File state
  2602. package net.minecraft.command;
  2603.  
  2604. import com.google.common.base.Predicate;
  2605. import com.google.common.base.Predicates;
  2606. import com.google.common.base.Splitter;
  2607. import com.google.common.collect.ComparisonChain;
  2608. import com.google.common.collect.Lists;
  2609. import com.google.common.collect.Maps;
  2610. import com.google.common.collect.Sets;
  2611. import java.util.Collections;
  2612. import java.util.Comparator;
  2613. import java.util.Iterator;
  2614. import java.util.List;
  2615. import java.util.Map;
  2616. import java.util.Set;
  2617. import java.util.Map.Entry;
  2618. import java.util.regex.Matcher;
  2619. import java.util.regex.Pattern;
  2620. import javax.annotation.Nullable;
  2621. import net.minecraft.command.CommandBase;
  2622. import net.minecraft.command.CommandException;
  2623. import net.minecraft.command.ICommandSender;
  2624. import net.minecraft.entity.Entity;
  2625. import net.minecraft.entity.EntityList;
  2626. import net.minecraft.entity.EntityLivingBase;
  2627. import net.minecraft.entity.player.EntityPlayer;
  2628. import net.minecraft.entity.player.EntityPlayerMP;
  2629. import net.minecraft.scoreboard.Score;
  2630. import net.minecraft.scoreboard.ScoreObjective;
  2631. import net.minecraft.scoreboard.Scoreboard;
  2632. import net.minecraft.scoreboard.Team;
  2633. import net.minecraft.util.EntitySelectors;
  2634. import net.minecraft.util.ResourceLocation;
  2635. import net.minecraft.util.math.AxisAlignedBB;
  2636. import net.minecraft.util.math.BlockPos;
  2637. import net.minecraft.util.math.MathHelper;
  2638. import net.minecraft.util.math.Vec3d;
  2639. import net.minecraft.util.text.ITextComponent;
  2640. import net.minecraft.util.text.TextComponentTranslation;
  2641. import net.minecraft.util.text.TextFormatting;
  2642. import net.minecraft.world.GameType;
  2643. import net.minecraft.world.World;
  2644.  
  2645. public class EntitySelector {
  2646. private static final Pattern field_82389_a = Pattern.compile("^@([pares])(?:\\[([^ ]*)\\])?$");
  2647. private static final Splitter field_190828_b = Splitter.on(',').omitEmptyStrings();
  2648. private static final Splitter field_190829_c = Splitter.on('=').limit(2);
  2649. private static final Set<String> field_190830_d = Sets.<String>newHashSet();
  2650. private static final String field_190831_e = func_190826_c("r");
  2651. private static final String field_190832_f = func_190826_c("rm");
  2652. private static final String field_190833_g = func_190826_c("l");
  2653. private static final String field_190834_h = func_190826_c("lm");
  2654. private static final String field_190835_i = func_190826_c("x");
  2655. private static final String field_190836_j = func_190826_c("y");
  2656. private static final String field_190837_k = func_190826_c("z");
  2657. private static final String field_190838_l = func_190826_c("dx");
  2658. private static final String field_190839_m = func_190826_c("dy");
  2659. private static final String field_190840_n = func_190826_c("dz");
  2660. private static final String field_190841_o = func_190826_c("rx");
  2661. private static final String field_190842_p = func_190826_c("rxm");
  2662. private static final String field_190843_q = func_190826_c("ry");
  2663. private static final String field_190844_r = func_190826_c("rym");
  2664. private static final String field_190845_s = func_190826_c("c");
  2665. private static final String field_190846_t = func_190826_c("m");
  2666. private static final String field_190847_u = func_190826_c("team");
  2667. private static final String field_190848_v = func_190826_c("name");
  2668. private static final String field_190849_w = func_190826_c("type");
  2669. private static final String field_190850_x = func_190826_c("tag");
  2670. private static final Predicate<String> field_190851_y = new Predicate<String>() {
  2671. public boolean apply(@Nullable String p_apply_1_) {
  2672. return p_apply_1_ != null && (EntitySelector.field_190830_d.contains(p_apply_1_) || p_apply_1_.length() > "score_".length() && p_apply_1_.startsWith("score_"));
  2673. }
  2674. };
  2675. private static final Set<String> field_179666_d = Sets.newHashSet(new String[]{field_190835_i, field_190836_j, field_190837_k, field_190838_l, field_190839_m, field_190840_n, field_190832_f, field_190831_e});
  2676.  
  2677. public static String func_190826_c(String p_190826_0_) {
  2678. field_190830_d.add(p_190826_0_);
  2679. return p_190826_0_;
  2680. }
  2681.  
  2682. @Nullable
  2683. public static EntityPlayerMP func_82386_a(ICommandSender p_82386_0_, String p_82386_1_) throws CommandException {
  2684. return (EntityPlayerMP)func_179652_a(p_82386_0_, p_82386_1_, EntityPlayerMP.class);
  2685. }
  2686.  
  2687. public static List<EntityPlayerMP> func_193531_b(ICommandSender p_193531_0_, String p_193531_1_) throws CommandException {
  2688. return func_179656_b(p_193531_0_, p_193531_1_, EntityPlayerMP.class);
  2689. }
  2690.  
  2691. @Nullable
  2692. public static <T extends Entity> T func_179652_a(ICommandSender p_179652_0_, String p_179652_1_, Class<? extends T> p_179652_2_) throws CommandException {
  2693. List<T> list = func_179656_b(p_179652_0_, p_179652_1_, p_179652_2_);
  2694. return (T)(list.size() == 1?(Entity)list.get(0):null);
  2695. }
  2696.  
  2697. @Nullable
  2698. public static ITextComponent func_150869_b(ICommandSender p_150869_0_, String p_150869_1_) throws CommandException {
  2699. List<Entity> list = func_179656_b(p_150869_0_, p_150869_1_, Entity.class);
  2700. if(list.isEmpty()) {
  2701. return null;
  2702. } else {
  2703. List<ITextComponent> list1 = Lists.<ITextComponent>newArrayList();
  2704.  
  2705. for(Entity entity : list) {
  2706. list1.add(entity.func_145748_c_());
  2707. }
  2708.  
  2709. return CommandBase.func_180530_a(list1);
  2710. }
  2711. }
  2712.  
  2713. public static <T extends Entity> List<T> func_179656_b(ICommandSender p_179656_0_, String p_179656_1_, Class<? extends T> p_179656_2_) throws CommandException {
  2714. Matcher matcher = field_82389_a.matcher(p_179656_1_);
  2715. if(matcher.matches() && p_179656_0_.func_70003_b(1, "@")) {
  2716. Map<String, String> map = func_82381_h(matcher.group(2));
  2717. if(!func_179655_b(p_179656_0_, map)) {
  2718. return Collections.<T>emptyList();
  2719. } else {
  2720. String s = matcher.group(1);
  2721. BlockPos blockpos = func_179664_b(map, p_179656_0_.func_180425_c());
  2722. Vec3d vec3d = func_189210_b(map, p_179656_0_.func_174791_d());
  2723. List<World> list = func_179654_a(p_179656_0_, map);
  2724. List<T> list1 = Lists.<T>newArrayList();
  2725.  
  2726. for(World world : list) {
  2727. if(world != null) {
  2728. List<Predicate<Entity>> list2 = Lists.<Predicate<Entity>>newArrayList();
  2729. list2.addAll(func_179663_a(map, s));
  2730. list2.addAll(func_179648_b(map));
  2731. list2.addAll(func_179649_c(map));
  2732. list2.addAll(func_179659_d(map));
  2733. list2.addAll(func_184952_c(p_179656_0_, map));
  2734. list2.addAll(func_179647_f(map));
  2735. list2.addAll(func_184951_f(map));
  2736. list2.addAll(func_180698_a(map, vec3d));
  2737. list2.addAll(func_179662_g(map));
  2738. if("s".equalsIgnoreCase(s)) {
  2739. Entity entity = p_179656_0_.func_174793_f();
  2740. if(entity != null && p_179656_2_.isAssignableFrom(entity.getClass())) {
  2741. if(map.containsKey(field_190838_l) || map.containsKey(field_190839_m) || map.containsKey(field_190840_n)) {
  2742. int i = func_179653_a(map, field_190838_l, 0);
  2743. int j = func_179653_a(map, field_190839_m, 0);
  2744. int k = func_179653_a(map, field_190840_n, 0);
  2745. AxisAlignedBB axisalignedbb = func_179661_a(blockpos, i, j, k);
  2746. if(!axisalignedbb.func_72326_a(entity.func_174813_aQ())) {
  2747. return Collections.<T>emptyList();
  2748. }
  2749. }
  2750.  
  2751. for(Predicate<Entity> predicate : list2) {
  2752. if(!predicate.apply(entity)) {
  2753. return Collections.<T>emptyList();
  2754. }
  2755. }
  2756.  
  2757. return Lists.newArrayList(new Entity[]{entity});
  2758. }
  2759.  
  2760. return Collections.<T>emptyList();
  2761. }
  2762.  
  2763. list1.addAll(func_179660_a(map, p_179656_2_, list2, s, world, blockpos));
  2764. }
  2765. }
  2766.  
  2767. return func_179658_a(list1, map, p_179656_0_, p_179656_2_, s, vec3d);
  2768. }
  2769. } else {
  2770. return Collections.<T>emptyList();
  2771. }
  2772. }
  2773.  
  2774. private static List<World> func_179654_a(ICommandSender p_179654_0_, Map<String, String> p_179654_1_) {
  2775. List<World> list = Lists.<World>newArrayList();
  2776. if(func_179665_h(p_179654_1_)) {
  2777. list.add(p_179654_0_.func_130014_f_());
  2778. } else {
  2779. Collections.addAll(list, p_179654_0_.func_184102_h().field_71305_c);
  2780. }
  2781.  
  2782. return list;
  2783. }
  2784.  
  2785. private static <T extends Entity> boolean func_179655_b(ICommandSender p_179655_0_, Map<String, String> p_179655_1_) {
  2786. String s = func_179651_b(p_179655_1_, field_190849_w);
  2787. if(s == null) {
  2788. return true;
  2789. } else {
  2790. ResourceLocation resourcelocation = new ResourceLocation(s.startsWith("!")?s.substring(1):s);
  2791. if(EntityList.func_180125_b(resourcelocation)) {
  2792. return true;
  2793. } else {
  2794. TextComponentTranslation textcomponenttranslation = new TextComponentTranslation("commands.generic.entity.invalidType", new Object[]{resourcelocation});
  2795. textcomponenttranslation.func_150256_b().func_150238_a(TextFormatting.RED);
  2796. p_179655_0_.func_145747_a(textcomponenttranslation);
  2797. return false;
  2798. }
  2799. }
  2800. }
  2801.  
  2802. private static List<Predicate<Entity>> func_179663_a(Map<String, String> p_179663_0_, String p_179663_1_) {
  2803. String s = func_179651_b(p_179663_0_, field_190849_w);
  2804. if(s == null || !p_179663_1_.equals("e") && !p_179663_1_.equals("r") && !p_179663_1_.equals("s")) {
  2805. return !p_179663_1_.equals("e") && !p_179663_1_.equals("s")?Collections.singletonList(new Predicate<Entity>() {
  2806. public boolean apply(@Nullable Entity p_apply_1_) {
  2807. return p_apply_1_ instanceof EntityPlayer;
  2808. }
  2809. }):Collections.emptyList();
  2810. } else {
  2811. final boolean flag = s.startsWith("!");
  2812. final ResourceLocation resourcelocation = new ResourceLocation(flag?s.substring(1):s);
  2813. return Collections.singletonList(new Predicate<Entity>() {
  2814. public boolean apply(@Nullable Entity p_apply_1_) {
  2815. return EntityList.func_180123_a(p_apply_1_, resourcelocation) != flag;
  2816. }
  2817. });
  2818. }
  2819. }
  2820.  
  2821. private static List<Predicate<Entity>> func_179648_b(Map<String, String> p_179648_0_) {
  2822. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  2823. final int i = func_179653_a(p_179648_0_, field_190834_h, -1);
  2824. final int j = func_179653_a(p_179648_0_, field_190833_g, -1);
  2825. if(i > -1 || j > -1) {
  2826. list.add(new Predicate<Entity>() {
  2827. public boolean apply(@Nullable Entity p_apply_1_) {
  2828. if(!(p_apply_1_ instanceof EntityPlayerMP)) {
  2829. return false;
  2830. } else {
  2831. EntityPlayerMP entityplayermp = (EntityPlayerMP)p_apply_1_;
  2832. return (i <= -1 || entityplayermp.field_71068_ca >= i) && (j <= -1 || entityplayermp.field_71068_ca <= j);
  2833. }
  2834. }
  2835. });
  2836. }
  2837.  
  2838. return list;
  2839. }
  2840.  
  2841. private static List<Predicate<Entity>> func_179649_c(Map<String, String> p_179649_0_) {
  2842. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  2843. String s = func_179651_b(p_179649_0_, field_190846_t);
  2844. if(s == null) {
  2845. return list;
  2846. } else {
  2847. final boolean flag = s.startsWith("!");
  2848. if(flag) {
  2849. s = s.substring(1);
  2850. }
  2851.  
  2852. final GameType gametype;
  2853. try {
  2854. int i = Integer.parseInt(s);
  2855. gametype = GameType.func_185329_a(i, GameType.NOT_SET);
  2856. } catch (Throwable var6) {
  2857. gametype = GameType.func_185328_a(s, GameType.NOT_SET);
  2858. }
  2859.  
  2860. list.add(new Predicate<Entity>() {
  2861. public boolean apply(@Nullable Entity p_apply_1_) {
  2862. if(!(p_apply_1_ instanceof EntityPlayerMP)) {
  2863. return false;
  2864. } else {
  2865. EntityPlayerMP entityplayermp = (EntityPlayerMP)p_apply_1_;
  2866. GameType gametype1 = entityplayermp.field_71134_c.func_73081_b();
  2867. return flag?gametype1 != gametype:gametype1 == gametype;
  2868. }
  2869. }
  2870. });
  2871. return list;
  2872. }
  2873. }
  2874.  
  2875. private static List<Predicate<Entity>> func_179659_d(Map<String, String> p_179659_0_) {
  2876. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  2877. final String s = func_179651_b(p_179659_0_, field_190847_u);
  2878. final boolean flag = s != null && s.startsWith("!");
  2879. if(flag) {
  2880. s = s.substring(1);
  2881. }
  2882.  
  2883. if(s != null) {
  2884. list.add(new Predicate<Entity>() {
  2885. public boolean apply(@Nullable Entity p_apply_1_) {
  2886. if(!(p_apply_1_ instanceof EntityLivingBase)) {
  2887. return false;
  2888. } else {
  2889. EntityLivingBase entitylivingbase = (EntityLivingBase)p_apply_1_;
  2890. Team team = entitylivingbase.func_96124_cp();
  2891. String s1 = team == null?"":team.func_96661_b();
  2892. return s1.equals(s) != flag;
  2893. }
  2894. }
  2895. });
  2896. }
  2897.  
  2898. return list;
  2899. }
  2900.  
  2901. private static List<Predicate<Entity>> func_184952_c(final ICommandSender p_184952_0_, Map<String, String> p_184952_1_) {
  2902. final Map<String, Integer> map = func_96560_a(p_184952_1_);
  2903. return (List<Predicate<Entity>>)(map.isEmpty()?Collections.emptyList():Lists.newArrayList(new Predicate[]{new Predicate<Entity>() {
  2904. public boolean apply(@Nullable Entity p_apply_1_) {
  2905. if(p_apply_1_ == null) {
  2906. return false;
  2907. } else {
  2908. Scoreboard scoreboard = p_184952_0_.func_184102_h().func_71218_a(0).func_96441_U();
  2909.  
  2910. for(Entry<String, Integer> entry : map.entrySet()) {
  2911. String s = (String)entry.getKey();
  2912. boolean flag = false;
  2913. if(s.endsWith("_min") && s.length() > 4) {
  2914. flag = true;
  2915. s = s.substring(0, s.length() - 4);
  2916. }
  2917.  
  2918. ScoreObjective scoreobjective = scoreboard.func_96518_b(s);
  2919. if(scoreobjective == null) {
  2920. return false;
  2921. }
  2922.  
  2923. String s1 = p_apply_1_ instanceof EntityPlayerMP?p_apply_1_.func_70005_c_():p_apply_1_.func_189512_bd();
  2924. if(!scoreboard.func_178819_b(s1, scoreobjective)) {
  2925. return false;
  2926. }
  2927.  
  2928. Score score = scoreboard.func_96529_a(s1, scoreobjective);
  2929. int i = score.func_96652_c();
  2930. if(i < ((Integer)entry.getValue()).intValue() && flag) {
  2931. return false;
  2932. }
  2933.  
  2934. if(i > ((Integer)entry.getValue()).intValue() && !flag) {
  2935. return false;
  2936. }
  2937. }
  2938.  
  2939. return true;
  2940. }
  2941. }
  2942. }}));
  2943. }
  2944.  
  2945. private static List<Predicate<Entity>> func_179647_f(Map<String, String> p_179647_0_) {
  2946. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  2947. final String s = func_179651_b(p_179647_0_, field_190848_v);
  2948. final boolean flag = s != null && s.startsWith("!");
  2949. if(flag) {
  2950. s = s.substring(1);
  2951. }
  2952.  
  2953. if(s != null) {
  2954. list.add(new Predicate<Entity>() {
  2955. public boolean apply(@Nullable Entity p_apply_1_) {
  2956. return p_apply_1_ != null && p_apply_1_.func_70005_c_().equals(s) != flag;
  2957. }
  2958. });
  2959. }
  2960.  
  2961. return list;
  2962. }
  2963.  
  2964. private static List<Predicate<Entity>> func_184951_f(Map<String, String> p_184951_0_) {
  2965. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  2966. final String s = func_179651_b(p_184951_0_, field_190850_x);
  2967. final boolean flag = s != null && s.startsWith("!");
  2968. if(flag) {
  2969. s = s.substring(1);
  2970. }
  2971.  
  2972. if(s != null) {
  2973. list.add(new Predicate<Entity>() {
  2974. public boolean apply(@Nullable Entity p_apply_1_) {
  2975. return p_apply_1_ == null?false:("".equals(s)?p_apply_1_.func_184216_O().isEmpty() != flag:p_apply_1_.func_184216_O().contains(s) != flag);
  2976. }
  2977. });
  2978. }
  2979.  
  2980. return list;
  2981. }
  2982.  
  2983. private static List<Predicate<Entity>> func_180698_a(Map<String, String> p_180698_0_, final Vec3d p_180698_1_) {
  2984. double d0 = (double)func_179653_a(p_180698_0_, field_190832_f, -1);
  2985. double d1 = (double)func_179653_a(p_180698_0_, field_190831_e, -1);
  2986. final boolean flag = d0 < -0.5D;
  2987. final boolean flag1 = d1 < -0.5D;
  2988. if(flag && flag1) {
  2989. return Collections.<Predicate<Entity>>emptyList();
  2990. } else {
  2991. double d2 = Math.max(d0, 1.0E-4D);
  2992. final double d3 = d2 * d2;
  2993. double d4 = Math.max(d1, 1.0E-4D);
  2994. final double d5 = d4 * d4;
  2995. return Lists.newArrayList(new Predicate[]{new Predicate<Entity>() {
  2996. public boolean apply(@Nullable Entity p_apply_1_) {
  2997. if(p_apply_1_ == null) {
  2998. return false;
  2999. } else {
  3000. double d6 = p_180698_1_.func_186679_c(p_apply_1_.field_70165_t, p_apply_1_.field_70163_u, p_apply_1_.field_70161_v);
  3001. return (flag || d6 >= d3) && (flag1 || d6 <= d5);
  3002. }
  3003. }
  3004. }});
  3005. }
  3006. }
  3007.  
  3008. private static List<Predicate<Entity>> func_179662_g(Map<String, String> p_179662_0_) {
  3009. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  3010. if(p_179662_0_.containsKey(field_190844_r) || p_179662_0_.containsKey(field_190843_q)) {
  3011. final int i = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190844_r, 0));
  3012. final int j = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190843_q, 359));
  3013. list.add(new Predicate<Entity>() {
  3014. public boolean apply(@Nullable Entity p_apply_1_) {
  3015. if(p_apply_1_ == null) {
  3016. return false;
  3017. } else {
  3018. int i1 = MathHelper.func_188209_b(MathHelper.func_76141_d(p_apply_1_.field_70177_z));
  3019. return i > j?i1 >= i || i1 <= j:i1 >= i && i1 <= j;
  3020. }
  3021. }
  3022. });
  3023. }
  3024.  
  3025. if(p_179662_0_.containsKey(field_190842_p) || p_179662_0_.containsKey(field_190841_o)) {
  3026. final int k = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190842_p, 0));
  3027. final int l = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190841_o, 359));
  3028. list.add(new Predicate<Entity>() {
  3029. public boolean apply(@Nullable Entity p_apply_1_) {
  3030. if(p_apply_1_ == null) {
  3031. return false;
  3032. } else {
  3033. int i1 = MathHelper.func_188209_b(MathHelper.func_76141_d(p_apply_1_.field_70125_A));
  3034. return k > l?i1 >= k || i1 <= l:i1 >= k && i1 <= l;
  3035. }
  3036. }
  3037. });
  3038. }
  3039.  
  3040. return list;
  3041. }
  3042.  
  3043. private static <T extends Entity> List<T> func_179660_a(Map<String, String> p_179660_0_, Class<? extends T> p_179660_1_, List<Predicate<Entity>> p_179660_2_, String p_179660_3_, World p_179660_4_, BlockPos p_179660_5_) {
  3044. List<T> list = Lists.<T>newArrayList();
  3045. String s = func_179651_b(p_179660_0_, field_190849_w);
  3046. s = s != null && s.startsWith("!")?s.substring(1):s;
  3047. boolean flag = !p_179660_3_.equals("e");
  3048. boolean flag1 = p_179660_3_.equals("r") && s != null;
  3049. int i = func_179653_a(p_179660_0_, field_190838_l, 0);
  3050. int j = func_179653_a(p_179660_0_, field_190839_m, 0);
  3051. int k = func_179653_a(p_179660_0_, field_190840_n, 0);
  3052. int l = func_179653_a(p_179660_0_, field_190831_e, -1);
  3053. Predicate<Entity> predicate = Predicates.and(p_179660_2_);
  3054. Predicate<Entity> predicate1 = Predicates.<Entity>and(EntitySelectors.field_94557_a, predicate);
  3055. if(!p_179660_0_.containsKey(field_190838_l) && !p_179660_0_.containsKey(field_190839_m) && !p_179660_0_.containsKey(field_190840_n)) {
  3056. if(l >= 0) {
  3057. AxisAlignedBB axisalignedbb1 = new AxisAlignedBB((double)(p_179660_5_.func_177958_n() - l), (double)(p_179660_5_.func_177956_o() - l), (double)(p_179660_5_.func_177952_p() - l), (double)(p_179660_5_.func_177958_n() + l + 1), (double)(p_179660_5_.func_177956_o() + l + 1), (double)(p_179660_5_.func_177952_p() + l + 1));
  3058. if(flag && !flag1) {
  3059. list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate1));
  3060. } else {
  3061. list.addAll(p_179660_4_.<T>func_175647_a(p_179660_1_, axisalignedbb1, predicate1));
  3062. }
  3063. } else if(p_179660_3_.equals("a")) {
  3064. list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate));
  3065. } else if(!p_179660_3_.equals("p") && (!p_179660_3_.equals("r") || flag1)) {
  3066. list.addAll(p_179660_4_.<T>func_175644_a(p_179660_1_, predicate1));
  3067. } else {
  3068. list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate1));
  3069. }
  3070. } else {
  3071. final AxisAlignedBB axisalignedbb = func_179661_a(p_179660_5_, i, j, k);
  3072. if(flag && !flag1) {
  3073. Predicate<Entity> predicate2 = new Predicate<Entity>() {
  3074. public boolean apply(@Nullable Entity p_apply_1_) {
  3075. return p_apply_1_ != null && axisalignedbb.func_72326_a(p_apply_1_.func_174813_aQ());
  3076. }
  3077. };
  3078. list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, Predicates.<T>and(predicate1, predicate2)));
  3079. } else {
  3080. list.addAll(p_179660_4_.<T>func_175647_a(p_179660_1_, axisalignedbb, predicate1));
  3081. }
  3082. }
  3083.  
  3084. return list;
  3085. }
  3086.  
  3087. private static <T extends Entity> List<T> func_179658_a(List<T> p_179658_0_, Map<String, String> p_179658_1_, ICommandSender p_179658_2_, Class<? extends T> p_179658_3_, String p_179658_4_, final Vec3d p_179658_5_) {
  3088. int i = func_179653_a(p_179658_1_, field_190845_s, !p_179658_4_.equals("a") && !p_179658_4_.equals("e")?1:0);
  3089. if(!p_179658_4_.equals("p") && !p_179658_4_.equals("a") && !p_179658_4_.equals("e")) {
  3090. if(p_179658_4_.equals("r")) {
  3091. Collections.shuffle((List<?>)p_179658_0_);
  3092. }
  3093. } else {
  3094. Collections.sort((List<T>)p_179658_0_, new Comparator<Entity>() {
  3095. public int compare(Entity p_compare_1_, Entity p_compare_2_) {
  3096. return ComparisonChain.start().compare(p_compare_1_.func_70092_e(p_179658_5_.field_72450_a, p_179658_5_.field_72448_b, p_179658_5_.field_72449_c), p_compare_2_.func_70092_e(p_179658_5_.field_72450_a, p_179658_5_.field_72448_b, p_179658_5_.field_72449_c)).result();
  3097. }
  3098. });
  3099. }
  3100.  
  3101. Entity entity = p_179658_2_.func_174793_f();
  3102. if(entity != null && p_179658_3_.isAssignableFrom(entity.getClass()) && i == 1 && ((List)p_179658_0_).contains(entity) && !"r".equals(p_179658_4_)) {
  3103. p_179658_0_ = Lists.newArrayList(new Entity[]{entity});
  3104. }
  3105.  
  3106. if(i != 0) {
  3107. if(i < 0) {
  3108. Collections.reverse((List<?>)p_179658_0_);
  3109. }
  3110.  
  3111. p_179658_0_ = ((List)p_179658_0_).subList(0, Math.min(Math.abs(i), ((List)p_179658_0_).size()));
  3112. }
  3113.  
  3114. return (List)p_179658_0_;
  3115. }
  3116.  
  3117. private static AxisAlignedBB func_179661_a(BlockPos p_179661_0_, int p_179661_1_, int p_179661_2_, int p_179661_3_) {
  3118. boolean flag = p_179661_1_ < 0;
  3119. boolean flag1 = p_179661_2_ < 0;
  3120. boolean flag2 = p_179661_3_ < 0;
  3121. int i = p_179661_0_.func_177958_n() + (flag?p_179661_1_:0);
  3122. int j = p_179661_0_.func_177956_o() + (flag1?p_179661_2_:0);
  3123. int k = p_179661_0_.func_177952_p() + (flag2?p_179661_3_:0);
  3124. int l = p_179661_0_.func_177958_n() + (flag?0:p_179661_1_) + 1;
  3125. int i1 = p_179661_0_.func_177956_o() + (flag1?0:p_179661_2_) + 1;
  3126. int j1 = p_179661_0_.func_177952_p() + (flag2?0:p_179661_3_) + 1;
  3127. return new AxisAlignedBB((double)i, (double)j, (double)k, (double)l, (double)i1, (double)j1);
  3128. }
  3129.  
  3130. private static BlockPos func_179664_b(Map<String, String> p_179664_0_, BlockPos p_179664_1_) {
  3131. return new BlockPos(func_179653_a(p_179664_0_, field_190835_i, p_179664_1_.func_177958_n()), func_179653_a(p_179664_0_, field_190836_j, p_179664_1_.func_177956_o()), func_179653_a(p_179664_0_, field_190837_k, p_179664_1_.func_177952_p()));
  3132. }
  3133.  
  3134. private static Vec3d func_189210_b(Map<String, String> p_189210_0_, Vec3d p_189210_1_) {
  3135. return new Vec3d(func_189211_a(p_189210_0_, field_190835_i, p_189210_1_.field_72450_a, true), func_189211_a(p_189210_0_, field_190836_j, p_189210_1_.field_72448_b, false), func_189211_a(p_189210_0_, field_190837_k, p_189210_1_.field_72449_c, true));
  3136. }
  3137.  
  3138. private static double func_189211_a(Map<String, String> p_189211_0_, String p_189211_1_, double p_189211_2_, boolean p_189211_4_) {
  3139. return p_189211_0_.containsKey(p_189211_1_)?(double)MathHelper.func_82715_a((String)p_189211_0_.get(p_189211_1_), MathHelper.func_76128_c(p_189211_2_)) + (p_189211_4_?0.5D:0.0D):p_189211_2_;
  3140. }
  3141.  
  3142. private static boolean func_179665_h(Map<String, String> p_179665_0_) {
  3143. for(String s : field_179666_d) {
  3144. if(p_179665_0_.containsKey(s)) {
  3145. return true;
  3146. }
  3147. }
  3148.  
  3149. return false;
  3150. }
  3151.  
  3152. private static int func_179653_a(Map<String, String> p_179653_0_, String p_179653_1_, int p_179653_2_) {
  3153. return p_179653_0_.containsKey(p_179653_1_)?MathHelper.func_82715_a((String)p_179653_0_.get(p_179653_1_), p_179653_2_):p_179653_2_;
  3154. }
  3155.  
  3156. @Nullable
  3157. private static String func_179651_b(Map<String, String> p_179651_0_, String p_179651_1_) {
  3158. return (String)p_179651_0_.get(p_179651_1_);
  3159. }
  3160.  
  3161. public static Map<String, Integer> func_96560_a(Map<String, String> p_96560_0_) {
  3162. Map<String, Integer> map = Maps.<String, Integer>newHashMap();
  3163.  
  3164. for(String s : p_96560_0_.keySet()) {
  3165. if(s.startsWith("score_") && s.length() > "score_".length()) {
  3166. map.put(s.substring("score_".length()), Integer.valueOf(MathHelper.func_82715_a((String)p_96560_0_.get(s), 1)));
  3167. }
  3168. }
  3169.  
  3170. return map;
  3171. }
  3172.  
  3173. public static boolean func_82377_a(String p_82377_0_) throws CommandException {
  3174. Matcher matcher = field_82389_a.matcher(p_82377_0_);
  3175. if(!matcher.matches()) {
  3176. return false;
  3177. } else {
  3178. Map<String, String> map = func_82381_h(matcher.group(2));
  3179. String s = matcher.group(1);
  3180. int i = !"a".equals(s) && !"e".equals(s)?1:0;
  3181. return func_179653_a(map, field_190845_s, i) != 1;
  3182. }
  3183. }
  3184.  
  3185. public static boolean func_82378_b(String p_82378_0_) {
  3186. return field_82389_a.matcher(p_82378_0_).matches();
  3187. }
  3188.  
  3189. private static Map<String, String> func_82381_h(@Nullable String p_82381_0_) throws CommandException {
  3190. Map<String, String> map = Maps.<String, String>newHashMap();
  3191. if(p_82381_0_ == null) {
  3192. return map;
  3193. } else {
  3194. for(String s : field_190828_b.split(p_82381_0_)) {
  3195. Iterator<String> iterator = field_190829_c.split(s).iterator();
  3196. String s1 = (String)iterator.next();
  3197. if(!field_190851_y.apply(s1)) {
  3198. throw new CommandException("commands.generic.selector_argument", new Object[]{s});
  3199. }
  3200.  
  3201. map.put(s1, iterator.hasNext()?(String)iterator.next():"");
  3202. }
  3203.  
  3204. return map;
  3205. }
  3206. }
  3207. }
  3208.  
  3209. Hunk 4 failed! Cannot find hunk target
  3210. } else {
  3211. EntityPlayerMP entityplayermp = (EntityPlayerMP)p_apply_1_;
  3212. GameType gametype1 = entityplayermp.field_71134_c.func_73081_b();
  3213. - return flag ? gametype1 != gametype : gametype1 == gametype;
  3214. + return flag ? gametype1 != type : gametype1 == type;
  3215. }
  3216. }
  3217. });
  3218. File state
  3219. package net.minecraft.command;
  3220.  
  3221. import com.google.common.base.Predicate;
  3222. import com.google.common.base.Predicates;
  3223. import com.google.common.base.Splitter;
  3224. import com.google.common.collect.ComparisonChain;
  3225. import com.google.common.collect.Lists;
  3226. import com.google.common.collect.Maps;
  3227. import com.google.common.collect.Sets;
  3228. import java.util.Collections;
  3229. import java.util.Comparator;
  3230. import java.util.Iterator;
  3231. import java.util.List;
  3232. import java.util.Map;
  3233. import java.util.Set;
  3234. import java.util.Map.Entry;
  3235. import java.util.regex.Matcher;
  3236. import java.util.regex.Pattern;
  3237. import javax.annotation.Nullable;
  3238. import net.minecraft.command.CommandBase;
  3239. import net.minecraft.command.CommandException;
  3240. import net.minecraft.command.ICommandSender;
  3241. import net.minecraft.entity.Entity;
  3242. import net.minecraft.entity.EntityList;
  3243. import net.minecraft.entity.EntityLivingBase;
  3244. import net.minecraft.entity.player.EntityPlayer;
  3245. import net.minecraft.entity.player.EntityPlayerMP;
  3246. import net.minecraft.scoreboard.Score;
  3247. import net.minecraft.scoreboard.ScoreObjective;
  3248. import net.minecraft.scoreboard.Scoreboard;
  3249. import net.minecraft.scoreboard.Team;
  3250. import net.minecraft.util.EntitySelectors;
  3251. import net.minecraft.util.ResourceLocation;
  3252. import net.minecraft.util.math.AxisAlignedBB;
  3253. import net.minecraft.util.math.BlockPos;
  3254. import net.minecraft.util.math.MathHelper;
  3255. import net.minecraft.util.math.Vec3d;
  3256. import net.minecraft.util.text.ITextComponent;
  3257. import net.minecraft.util.text.TextComponentTranslation;
  3258. import net.minecraft.util.text.TextFormatting;
  3259. import net.minecraft.world.GameType;
  3260. import net.minecraft.world.World;
  3261.  
  3262. public class EntitySelector {
  3263. private static final Pattern field_82389_a = Pattern.compile("^@([pares])(?:\\[([^ ]*)\\])?$");
  3264. private static final Splitter field_190828_b = Splitter.on(',').omitEmptyStrings();
  3265. private static final Splitter field_190829_c = Splitter.on('=').limit(2);
  3266. private static final Set<String> field_190830_d = Sets.<String>newHashSet();
  3267. private static final String field_190831_e = func_190826_c("r");
  3268. private static final String field_190832_f = func_190826_c("rm");
  3269. private static final String field_190833_g = func_190826_c("l");
  3270. private static final String field_190834_h = func_190826_c("lm");
  3271. private static final String field_190835_i = func_190826_c("x");
  3272. private static final String field_190836_j = func_190826_c("y");
  3273. private static final String field_190837_k = func_190826_c("z");
  3274. private static final String field_190838_l = func_190826_c("dx");
  3275. private static final String field_190839_m = func_190826_c("dy");
  3276. private static final String field_190840_n = func_190826_c("dz");
  3277. private static final String field_190841_o = func_190826_c("rx");
  3278. private static final String field_190842_p = func_190826_c("rxm");
  3279. private static final String field_190843_q = func_190826_c("ry");
  3280. private static final String field_190844_r = func_190826_c("rym");
  3281. private static final String field_190845_s = func_190826_c("c");
  3282. private static final String field_190846_t = func_190826_c("m");
  3283. private static final String field_190847_u = func_190826_c("team");
  3284. private static final String field_190848_v = func_190826_c("name");
  3285. private static final String field_190849_w = func_190826_c("type");
  3286. private static final String field_190850_x = func_190826_c("tag");
  3287. private static final Predicate<String> field_190851_y = new Predicate<String>() {
  3288. public boolean apply(@Nullable String p_apply_1_) {
  3289. return p_apply_1_ != null && (EntitySelector.field_190830_d.contains(p_apply_1_) || p_apply_1_.length() > "score_".length() && p_apply_1_.startsWith("score_"));
  3290. }
  3291. };
  3292. private static final Set<String> field_179666_d = Sets.newHashSet(new String[]{field_190835_i, field_190836_j, field_190837_k, field_190838_l, field_190839_m, field_190840_n, field_190832_f, field_190831_e});
  3293.  
  3294. public static String func_190826_c(String p_190826_0_) {
  3295. field_190830_d.add(p_190826_0_);
  3296. return p_190826_0_;
  3297. }
  3298.  
  3299. @Nullable
  3300. public static EntityPlayerMP func_82386_a(ICommandSender p_82386_0_, String p_82386_1_) throws CommandException {
  3301. return (EntityPlayerMP)func_179652_a(p_82386_0_, p_82386_1_, EntityPlayerMP.class);
  3302. }
  3303.  
  3304. public static List<EntityPlayerMP> func_193531_b(ICommandSender p_193531_0_, String p_193531_1_) throws CommandException {
  3305. return func_179656_b(p_193531_0_, p_193531_1_, EntityPlayerMP.class);
  3306. }
  3307.  
  3308. @Nullable
  3309. public static <T extends Entity> T func_179652_a(ICommandSender p_179652_0_, String p_179652_1_, Class<? extends T> p_179652_2_) throws CommandException {
  3310. List<T> list = func_179656_b(p_179652_0_, p_179652_1_, p_179652_2_);
  3311. return (T)(list.size() == 1?(Entity)list.get(0):null);
  3312. }
  3313.  
  3314. @Nullable
  3315. public static ITextComponent func_150869_b(ICommandSender p_150869_0_, String p_150869_1_) throws CommandException {
  3316. List<Entity> list = func_179656_b(p_150869_0_, p_150869_1_, Entity.class);
  3317. if(list.isEmpty()) {
  3318. return null;
  3319. } else {
  3320. List<ITextComponent> list1 = Lists.<ITextComponent>newArrayList();
  3321.  
  3322. for(Entity entity : list) {
  3323. list1.add(entity.func_145748_c_());
  3324. }
  3325.  
  3326. return CommandBase.func_180530_a(list1);
  3327. }
  3328. }
  3329.  
  3330. public static <T extends Entity> List<T> func_179656_b(ICommandSender p_179656_0_, String p_179656_1_, Class<? extends T> p_179656_2_) throws CommandException {
  3331. Matcher matcher = field_82389_a.matcher(p_179656_1_);
  3332. if(matcher.matches() && p_179656_0_.func_70003_b(1, "@")) {
  3333. Map<String, String> map = func_82381_h(matcher.group(2));
  3334. if(!func_179655_b(p_179656_0_, map)) {
  3335. return Collections.<T>emptyList();
  3336. } else {
  3337. String s = matcher.group(1);
  3338. BlockPos blockpos = func_179664_b(map, p_179656_0_.func_180425_c());
  3339. Vec3d vec3d = func_189210_b(map, p_179656_0_.func_174791_d());
  3340. List<World> list = func_179654_a(p_179656_0_, map);
  3341. List<T> list1 = Lists.<T>newArrayList();
  3342.  
  3343. for(World world : list) {
  3344. if(world != null) {
  3345. List<Predicate<Entity>> list2 = Lists.<Predicate<Entity>>newArrayList();
  3346. list2.addAll(func_179663_a(map, s));
  3347. list2.addAll(func_179648_b(map));
  3348. list2.addAll(func_179649_c(map));
  3349. list2.addAll(func_179659_d(map));
  3350. list2.addAll(func_184952_c(p_179656_0_, map));
  3351. list2.addAll(func_179647_f(map));
  3352. list2.addAll(func_184951_f(map));
  3353. list2.addAll(func_180698_a(map, vec3d));
  3354. list2.addAll(func_179662_g(map));
  3355. if("s".equalsIgnoreCase(s)) {
  3356. Entity entity = p_179656_0_.func_174793_f();
  3357. if(entity != null && p_179656_2_.isAssignableFrom(entity.getClass())) {
  3358. if(map.containsKey(field_190838_l) || map.containsKey(field_190839_m) || map.containsKey(field_190840_n)) {
  3359. int i = func_179653_a(map, field_190838_l, 0);
  3360. int j = func_179653_a(map, field_190839_m, 0);
  3361. int k = func_179653_a(map, field_190840_n, 0);
  3362. AxisAlignedBB axisalignedbb = func_179661_a(blockpos, i, j, k);
  3363. if(!axisalignedbb.func_72326_a(entity.func_174813_aQ())) {
  3364. return Collections.<T>emptyList();
  3365. }
  3366. }
  3367.  
  3368. for(Predicate<Entity> predicate : list2) {
  3369. if(!predicate.apply(entity)) {
  3370. return Collections.<T>emptyList();
  3371. }
  3372. }
  3373.  
  3374. return Lists.newArrayList(new Entity[]{entity});
  3375. }
  3376.  
  3377. return Collections.<T>emptyList();
  3378. }
  3379.  
  3380. list1.addAll(func_179660_a(map, p_179656_2_, list2, s, world, blockpos));
  3381. }
  3382. }
  3383.  
  3384. return func_179658_a(list1, map, p_179656_0_, p_179656_2_, s, vec3d);
  3385. }
  3386. } else {
  3387. return Collections.<T>emptyList();
  3388. }
  3389. }
  3390.  
  3391. private static List<World> func_179654_a(ICommandSender p_179654_0_, Map<String, String> p_179654_1_) {
  3392. List<World> list = Lists.<World>newArrayList();
  3393. if(func_179665_h(p_179654_1_)) {
  3394. list.add(p_179654_0_.func_130014_f_());
  3395. } else {
  3396. Collections.addAll(list, p_179654_0_.func_184102_h().field_71305_c);
  3397. }
  3398.  
  3399. return list;
  3400. }
  3401.  
  3402. private static <T extends Entity> boolean func_179655_b(ICommandSender p_179655_0_, Map<String, String> p_179655_1_) {
  3403. String s = func_179651_b(p_179655_1_, field_190849_w);
  3404. if(s == null) {
  3405. return true;
  3406. } else {
  3407. ResourceLocation resourcelocation = new ResourceLocation(s.startsWith("!")?s.substring(1):s);
  3408. if(EntityList.func_180125_b(resourcelocation)) {
  3409. return true;
  3410. } else {
  3411. TextComponentTranslation textcomponenttranslation = new TextComponentTranslation("commands.generic.entity.invalidType", new Object[]{resourcelocation});
  3412. textcomponenttranslation.func_150256_b().func_150238_a(TextFormatting.RED);
  3413. p_179655_0_.func_145747_a(textcomponenttranslation);
  3414. return false;
  3415. }
  3416. }
  3417. }
  3418.  
  3419. private static List<Predicate<Entity>> func_179663_a(Map<String, String> p_179663_0_, String p_179663_1_) {
  3420. String s = func_179651_b(p_179663_0_, field_190849_w);
  3421. if(s == null || !p_179663_1_.equals("e") && !p_179663_1_.equals("r") && !p_179663_1_.equals("s")) {
  3422. return !p_179663_1_.equals("e") && !p_179663_1_.equals("s")?Collections.singletonList(new Predicate<Entity>() {
  3423. public boolean apply(@Nullable Entity p_apply_1_) {
  3424. return p_apply_1_ instanceof EntityPlayer;
  3425. }
  3426. }):Collections.emptyList();
  3427. } else {
  3428. final boolean flag = s.startsWith("!");
  3429. final ResourceLocation resourcelocation = new ResourceLocation(flag?s.substring(1):s);
  3430. return Collections.singletonList(new Predicate<Entity>() {
  3431. public boolean apply(@Nullable Entity p_apply_1_) {
  3432. return EntityList.func_180123_a(p_apply_1_, resourcelocation) != flag;
  3433. }
  3434. });
  3435. }
  3436. }
  3437.  
  3438. private static List<Predicate<Entity>> func_179648_b(Map<String, String> p_179648_0_) {
  3439. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  3440. final int i = func_179653_a(p_179648_0_, field_190834_h, -1);
  3441. final int j = func_179653_a(p_179648_0_, field_190833_g, -1);
  3442. if(i > -1 || j > -1) {
  3443. list.add(new Predicate<Entity>() {
  3444. public boolean apply(@Nullable Entity p_apply_1_) {
  3445. if(!(p_apply_1_ instanceof EntityPlayerMP)) {
  3446. return false;
  3447. } else {
  3448. EntityPlayerMP entityplayermp = (EntityPlayerMP)p_apply_1_;
  3449. return (i <= -1 || entityplayermp.field_71068_ca >= i) && (j <= -1 || entityplayermp.field_71068_ca <= j);
  3450. }
  3451. }
  3452. });
  3453. }
  3454.  
  3455. return list;
  3456. }
  3457.  
  3458. private static List<Predicate<Entity>> func_179649_c(Map<String, String> p_179649_0_) {
  3459. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  3460. String s = func_179651_b(p_179649_0_, field_190846_t);
  3461. if(s == null) {
  3462. return list;
  3463. } else {
  3464. final boolean flag = s.startsWith("!");
  3465. if(flag) {
  3466. s = s.substring(1);
  3467. }
  3468.  
  3469. final GameType gametype;
  3470. try {
  3471. int i = Integer.parseInt(s);
  3472. gametype = GameType.func_185329_a(i, GameType.NOT_SET);
  3473. } catch (Throwable var6) {
  3474. gametype = GameType.func_185328_a(s, GameType.NOT_SET);
  3475. }
  3476.  
  3477. list.add(new Predicate<Entity>() {
  3478. public boolean apply(@Nullable Entity p_apply_1_) {
  3479. if(!(p_apply_1_ instanceof EntityPlayerMP)) {
  3480. return false;
  3481. } else {
  3482. EntityPlayerMP entityplayermp = (EntityPlayerMP)p_apply_1_;
  3483. GameType gametype1 = entityplayermp.field_71134_c.func_73081_b();
  3484. return flag?gametype1 != gametype:gametype1 == gametype;
  3485. }
  3486. }
  3487. });
  3488. return list;
  3489. }
  3490. }
  3491.  
  3492. private static List<Predicate<Entity>> func_179659_d(Map<String, String> p_179659_0_) {
  3493. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  3494. final String s = func_179651_b(p_179659_0_, field_190847_u);
  3495. final boolean flag = s != null && s.startsWith("!");
  3496. if(flag) {
  3497. s = s.substring(1);
  3498. }
  3499.  
  3500. if(s != null) {
  3501. list.add(new Predicate<Entity>() {
  3502. public boolean apply(@Nullable Entity p_apply_1_) {
  3503. if(!(p_apply_1_ instanceof EntityLivingBase)) {
  3504. return false;
  3505. } else {
  3506. EntityLivingBase entitylivingbase = (EntityLivingBase)p_apply_1_;
  3507. Team team = entitylivingbase.func_96124_cp();
  3508. String s1 = team == null?"":team.func_96661_b();
  3509. return s1.equals(s) != flag;
  3510. }
  3511. }
  3512. });
  3513. }
  3514.  
  3515. return list;
  3516. }
  3517.  
  3518. private static List<Predicate<Entity>> func_184952_c(final ICommandSender p_184952_0_, Map<String, String> p_184952_1_) {
  3519. final Map<String, Integer> map = func_96560_a(p_184952_1_);
  3520. return (List<Predicate<Entity>>)(map.isEmpty()?Collections.emptyList():Lists.newArrayList(new Predicate[]{new Predicate<Entity>() {
  3521. public boolean apply(@Nullable Entity p_apply_1_) {
  3522. if(p_apply_1_ == null) {
  3523. return false;
  3524. } else {
  3525. Scoreboard scoreboard = p_184952_0_.func_184102_h().func_71218_a(0).func_96441_U();
  3526.  
  3527. for(Entry<String, Integer> entry : map.entrySet()) {
  3528. String s = (String)entry.getKey();
  3529. boolean flag = false;
  3530. if(s.endsWith("_min") && s.length() > 4) {
  3531. flag = true;
  3532. s = s.substring(0, s.length() - 4);
  3533. }
  3534.  
  3535. ScoreObjective scoreobjective = scoreboard.func_96518_b(s);
  3536. if(scoreobjective == null) {
  3537. return false;
  3538. }
  3539.  
  3540. String s1 = p_apply_1_ instanceof EntityPlayerMP?p_apply_1_.func_70005_c_():p_apply_1_.func_189512_bd();
  3541. if(!scoreboard.func_178819_b(s1, scoreobjective)) {
  3542. return false;
  3543. }
  3544.  
  3545. Score score = scoreboard.func_96529_a(s1, scoreobjective);
  3546. int i = score.func_96652_c();
  3547. if(i < ((Integer)entry.getValue()).intValue() && flag) {
  3548. return false;
  3549. }
  3550.  
  3551. if(i > ((Integer)entry.getValue()).intValue() && !flag) {
  3552. return false;
  3553. }
  3554. }
  3555.  
  3556. return true;
  3557. }
  3558. }
  3559. }}));
  3560. }
  3561.  
  3562. private static List<Predicate<Entity>> func_179647_f(Map<String, String> p_179647_0_) {
  3563. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  3564. final String s = func_179651_b(p_179647_0_, field_190848_v);
  3565. final boolean flag = s != null && s.startsWith("!");
  3566. if(flag) {
  3567. s = s.substring(1);
  3568. }
  3569.  
  3570. if(s != null) {
  3571. list.add(new Predicate<Entity>() {
  3572. public boolean apply(@Nullable Entity p_apply_1_) {
  3573. return p_apply_1_ != null && p_apply_1_.func_70005_c_().equals(s) != flag;
  3574. }
  3575. });
  3576. }
  3577.  
  3578. return list;
  3579. }
  3580.  
  3581. private static List<Predicate<Entity>> func_184951_f(Map<String, String> p_184951_0_) {
  3582. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  3583. final String s = func_179651_b(p_184951_0_, field_190850_x);
  3584. final boolean flag = s != null && s.startsWith("!");
  3585. if(flag) {
  3586. s = s.substring(1);
  3587. }
  3588.  
  3589. if(s != null) {
  3590. list.add(new Predicate<Entity>() {
  3591. public boolean apply(@Nullable Entity p_apply_1_) {
  3592. return p_apply_1_ == null?false:("".equals(s)?p_apply_1_.func_184216_O().isEmpty() != flag:p_apply_1_.func_184216_O().contains(s) != flag);
  3593. }
  3594. });
  3595. }
  3596.  
  3597. return list;
  3598. }
  3599.  
  3600. private static List<Predicate<Entity>> func_180698_a(Map<String, String> p_180698_0_, final Vec3d p_180698_1_) {
  3601. double d0 = (double)func_179653_a(p_180698_0_, field_190832_f, -1);
  3602. double d1 = (double)func_179653_a(p_180698_0_, field_190831_e, -1);
  3603. final boolean flag = d0 < -0.5D;
  3604. final boolean flag1 = d1 < -0.5D;
  3605. if(flag && flag1) {
  3606. return Collections.<Predicate<Entity>>emptyList();
  3607. } else {
  3608. double d2 = Math.max(d0, 1.0E-4D);
  3609. final double d3 = d2 * d2;
  3610. double d4 = Math.max(d1, 1.0E-4D);
  3611. final double d5 = d4 * d4;
  3612. return Lists.newArrayList(new Predicate[]{new Predicate<Entity>() {
  3613. public boolean apply(@Nullable Entity p_apply_1_) {
  3614. if(p_apply_1_ == null) {
  3615. return false;
  3616. } else {
  3617. double d6 = p_180698_1_.func_186679_c(p_apply_1_.field_70165_t, p_apply_1_.field_70163_u, p_apply_1_.field_70161_v);
  3618. return (flag || d6 >= d3) && (flag1 || d6 <= d5);
  3619. }
  3620. }
  3621. }});
  3622. }
  3623. }
  3624.  
  3625. private static List<Predicate<Entity>> func_179662_g(Map<String, String> p_179662_0_) {
  3626. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  3627. if(p_179662_0_.containsKey(field_190844_r) || p_179662_0_.containsKey(field_190843_q)) {
  3628. final int i = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190844_r, 0));
  3629. final int j = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190843_q, 359));
  3630. list.add(new Predicate<Entity>() {
  3631. public boolean apply(@Nullable Entity p_apply_1_) {
  3632. if(p_apply_1_ == null) {
  3633. return false;
  3634. } else {
  3635. int i1 = MathHelper.func_188209_b(MathHelper.func_76141_d(p_apply_1_.field_70177_z));
  3636. return i > j?i1 >= i || i1 <= j:i1 >= i && i1 <= j;
  3637. }
  3638. }
  3639. });
  3640. }
  3641.  
  3642. if(p_179662_0_.containsKey(field_190842_p) || p_179662_0_.containsKey(field_190841_o)) {
  3643. final int k = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190842_p, 0));
  3644. final int l = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190841_o, 359));
  3645. list.add(new Predicate<Entity>() {
  3646. public boolean apply(@Nullable Entity p_apply_1_) {
  3647. if(p_apply_1_ == null) {
  3648. return false;
  3649. } else {
  3650. int i1 = MathHelper.func_188209_b(MathHelper.func_76141_d(p_apply_1_.field_70125_A));
  3651. return k > l?i1 >= k || i1 <= l:i1 >= k && i1 <= l;
  3652. }
  3653. }
  3654. });
  3655. }
  3656.  
  3657. return list;
  3658. }
  3659.  
  3660. private static <T extends Entity> List<T> func_179660_a(Map<String, String> p_179660_0_, Class<? extends T> p_179660_1_, List<Predicate<Entity>> p_179660_2_, String p_179660_3_, World p_179660_4_, BlockPos p_179660_5_) {
  3661. List<T> list = Lists.<T>newArrayList();
  3662. String s = func_179651_b(p_179660_0_, field_190849_w);
  3663. s = s != null && s.startsWith("!")?s.substring(1):s;
  3664. boolean flag = !p_179660_3_.equals("e");
  3665. boolean flag1 = p_179660_3_.equals("r") && s != null;
  3666. int i = func_179653_a(p_179660_0_, field_190838_l, 0);
  3667. int j = func_179653_a(p_179660_0_, field_190839_m, 0);
  3668. int k = func_179653_a(p_179660_0_, field_190840_n, 0);
  3669. int l = func_179653_a(p_179660_0_, field_190831_e, -1);
  3670. Predicate<Entity> predicate = Predicates.and(p_179660_2_);
  3671. Predicate<Entity> predicate1 = Predicates.<Entity>and(EntitySelectors.field_94557_a, predicate);
  3672. if(!p_179660_0_.containsKey(field_190838_l) && !p_179660_0_.containsKey(field_190839_m) && !p_179660_0_.containsKey(field_190840_n)) {
  3673. if(l >= 0) {
  3674. AxisAlignedBB axisalignedbb1 = new AxisAlignedBB((double)(p_179660_5_.func_177958_n() - l), (double)(p_179660_5_.func_177956_o() - l), (double)(p_179660_5_.func_177952_p() - l), (double)(p_179660_5_.func_177958_n() + l + 1), (double)(p_179660_5_.func_177956_o() + l + 1), (double)(p_179660_5_.func_177952_p() + l + 1));
  3675. if(flag && !flag1) {
  3676. list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate1));
  3677. } else {
  3678. list.addAll(p_179660_4_.<T>func_175647_a(p_179660_1_, axisalignedbb1, predicate1));
  3679. }
  3680. } else if(p_179660_3_.equals("a")) {
  3681. list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate));
  3682. } else if(!p_179660_3_.equals("p") && (!p_179660_3_.equals("r") || flag1)) {
  3683. list.addAll(p_179660_4_.<T>func_175644_a(p_179660_1_, predicate1));
  3684. } else {
  3685. list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate1));
  3686. }
  3687. } else {
  3688. final AxisAlignedBB axisalignedbb = func_179661_a(p_179660_5_, i, j, k);
  3689. if(flag && !flag1) {
  3690. Predicate<Entity> predicate2 = new Predicate<Entity>() {
  3691. public boolean apply(@Nullable Entity p_apply_1_) {
  3692. return p_apply_1_ != null && axisalignedbb.func_72326_a(p_apply_1_.func_174813_aQ());
  3693. }
  3694. };
  3695. list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, Predicates.<T>and(predicate1, predicate2)));
  3696. } else {
  3697. list.addAll(p_179660_4_.<T>func_175647_a(p_179660_1_, axisalignedbb, predicate1));
  3698. }
  3699. }
  3700.  
  3701. return list;
  3702. }
  3703.  
  3704. private static <T extends Entity> List<T> func_179658_a(List<T> p_179658_0_, Map<String, String> p_179658_1_, ICommandSender p_179658_2_, Class<? extends T> p_179658_3_, String p_179658_4_, final Vec3d p_179658_5_) {
  3705. int i = func_179653_a(p_179658_1_, field_190845_s, !p_179658_4_.equals("a") && !p_179658_4_.equals("e")?1:0);
  3706. if(!p_179658_4_.equals("p") && !p_179658_4_.equals("a") && !p_179658_4_.equals("e")) {
  3707. if(p_179658_4_.equals("r")) {
  3708. Collections.shuffle((List<?>)p_179658_0_);
  3709. }
  3710. } else {
  3711. Collections.sort((List<T>)p_179658_0_, new Comparator<Entity>() {
  3712. public int compare(Entity p_compare_1_, Entity p_compare_2_) {
  3713. return ComparisonChain.start().compare(p_compare_1_.func_70092_e(p_179658_5_.field_72450_a, p_179658_5_.field_72448_b, p_179658_5_.field_72449_c), p_compare_2_.func_70092_e(p_179658_5_.field_72450_a, p_179658_5_.field_72448_b, p_179658_5_.field_72449_c)).result();
  3714. }
  3715. });
  3716. }
  3717.  
  3718. Entity entity = p_179658_2_.func_174793_f();
  3719. if(entity != null && p_179658_3_.isAssignableFrom(entity.getClass()) && i == 1 && ((List)p_179658_0_).contains(entity) && !"r".equals(p_179658_4_)) {
  3720. p_179658_0_ = Lists.newArrayList(new Entity[]{entity});
  3721. }
  3722.  
  3723. if(i != 0) {
  3724. if(i < 0) {
  3725. Collections.reverse((List<?>)p_179658_0_);
  3726. }
  3727.  
  3728. p_179658_0_ = ((List)p_179658_0_).subList(0, Math.min(Math.abs(i), ((List)p_179658_0_).size()));
  3729. }
  3730.  
  3731. return (List)p_179658_0_;
  3732. }
  3733.  
  3734. private static AxisAlignedBB func_179661_a(BlockPos p_179661_0_, int p_179661_1_, int p_179661_2_, int p_179661_3_) {
  3735. boolean flag = p_179661_1_ < 0;
  3736. boolean flag1 = p_179661_2_ < 0;
  3737. boolean flag2 = p_179661_3_ < 0;
  3738. int i = p_179661_0_.func_177958_n() + (flag?p_179661_1_:0);
  3739. int j = p_179661_0_.func_177956_o() + (flag1?p_179661_2_:0);
  3740. int k = p_179661_0_.func_177952_p() + (flag2?p_179661_3_:0);
  3741. int l = p_179661_0_.func_177958_n() + (flag?0:p_179661_1_) + 1;
  3742. int i1 = p_179661_0_.func_177956_o() + (flag1?0:p_179661_2_) + 1;
  3743. int j1 = p_179661_0_.func_177952_p() + (flag2?0:p_179661_3_) + 1;
  3744. return new AxisAlignedBB((double)i, (double)j, (double)k, (double)l, (double)i1, (double)j1);
  3745. }
  3746.  
  3747. private static BlockPos func_179664_b(Map<String, String> p_179664_0_, BlockPos p_179664_1_) {
  3748. return new BlockPos(func_179653_a(p_179664_0_, field_190835_i, p_179664_1_.func_177958_n()), func_179653_a(p_179664_0_, field_190836_j, p_179664_1_.func_177956_o()), func_179653_a(p_179664_0_, field_190837_k, p_179664_1_.func_177952_p()));
  3749. }
  3750.  
  3751. private static Vec3d func_189210_b(Map<String, String> p_189210_0_, Vec3d p_189210_1_) {
  3752. return new Vec3d(func_189211_a(p_189210_0_, field_190835_i, p_189210_1_.field_72450_a, true), func_189211_a(p_189210_0_, field_190836_j, p_189210_1_.field_72448_b, false), func_189211_a(p_189210_0_, field_190837_k, p_189210_1_.field_72449_c, true));
  3753. }
  3754.  
  3755. private static double func_189211_a(Map<String, String> p_189211_0_, String p_189211_1_, double p_189211_2_, boolean p_189211_4_) {
  3756. return p_189211_0_.containsKey(p_189211_1_)?(double)MathHelper.func_82715_a((String)p_189211_0_.get(p_189211_1_), MathHelper.func_76128_c(p_189211_2_)) + (p_189211_4_?0.5D:0.0D):p_189211_2_;
  3757. }
  3758.  
  3759. private static boolean func_179665_h(Map<String, String> p_179665_0_) {
  3760. for(String s : field_179666_d) {
  3761. if(p_179665_0_.containsKey(s)) {
  3762. return true;
  3763. }
  3764. }
  3765.  
  3766. return false;
  3767. }
  3768.  
  3769. private static int func_179653_a(Map<String, String> p_179653_0_, String p_179653_1_, int p_179653_2_) {
  3770. return p_179653_0_.containsKey(p_179653_1_)?MathHelper.func_82715_a((String)p_179653_0_.get(p_179653_1_), p_179653_2_):p_179653_2_;
  3771. }
  3772.  
  3773. @Nullable
  3774. private static String func_179651_b(Map<String, String> p_179651_0_, String p_179651_1_) {
  3775. return (String)p_179651_0_.get(p_179651_1_);
  3776. }
  3777.  
  3778. public static Map<String, Integer> func_96560_a(Map<String, String> p_96560_0_) {
  3779. Map<String, Integer> map = Maps.<String, Integer>newHashMap();
  3780.  
  3781. for(String s : p_96560_0_.keySet()) {
  3782. if(s.startsWith("score_") && s.length() > "score_".length()) {
  3783. map.put(s.substring("score_".length()), Integer.valueOf(MathHelper.func_82715_a((String)p_96560_0_.get(s), 1)));
  3784. }
  3785. }
  3786.  
  3787. return map;
  3788. }
  3789.  
  3790. public static boolean func_82377_a(String p_82377_0_) throws CommandException {
  3791. Matcher matcher = field_82389_a.matcher(p_82377_0_);
  3792. if(!matcher.matches()) {
  3793. return false;
  3794. } else {
  3795. Map<String, String> map = func_82381_h(matcher.group(2));
  3796. String s = matcher.group(1);
  3797. int i = !"a".equals(s) && !"e".equals(s)?1:0;
  3798. return func_179653_a(map, field_190845_s, i) != 1;
  3799. }
  3800. }
  3801.  
  3802. public static boolean func_82378_b(String p_82378_0_) {
  3803. return field_82389_a.matcher(p_82378_0_).matches();
  3804. }
  3805.  
  3806. private static Map<String, String> func_82381_h(@Nullable String p_82381_0_) throws CommandException {
  3807. Map<String, String> map = Maps.<String, String>newHashMap();
  3808. if(p_82381_0_ == null) {
  3809. return map;
  3810. } else {
  3811. for(String s : field_190828_b.split(p_82381_0_)) {
  3812. Iterator<String> iterator = field_190829_c.split(s).iterator();
  3813. String s1 = (String)iterator.next();
  3814. if(!field_190851_y.apply(s1)) {
  3815. throw new CommandException("commands.generic.selector_argument", new Object[]{s});
  3816. }
  3817.  
  3818. map.put(s1, iterator.hasNext()?(String)iterator.next():"");
  3819. }
  3820.  
  3821. return map;
  3822. }
  3823. }
  3824. }
  3825.  
  3826. Hunk 5 failed! Cannot find hunk target
  3827.  
  3828. private static List<Predicate<Entity>> func_179659_d(Map<String, String> p_179659_0_) {
  3829. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  3830. - final String s = func_179651_b(p_179659_0_, field_190847_u);
  3831. + String s = func_179651_b(p_179659_0_, field_190847_u);
  3832. final boolean flag = s != null && s.startsWith("!");
  3833. if (flag) {
  3834. s = s.substring(1);
  3835. }
  3836.  
  3837. if (s != null) {
  3838. + final String s_f_ = s;
  3839. list.add(new Predicate<Entity>() {
  3840. public boolean apply(@Nullable Entity p_apply_1_) {
  3841. if (!(p_apply_1_ instanceof EntityLivingBase)) {
  3842. File state
  3843. package net.minecraft.command;
  3844.  
  3845. import com.google.common.base.Predicate;
  3846. import com.google.common.base.Predicates;
  3847. import com.google.common.base.Splitter;
  3848. import com.google.common.collect.ComparisonChain;
  3849. import com.google.common.collect.Lists;
  3850. import com.google.common.collect.Maps;
  3851. import com.google.common.collect.Sets;
  3852. import java.util.Collections;
  3853. import java.util.Comparator;
  3854. import java.util.Iterator;
  3855. import java.util.List;
  3856. import java.util.Map;
  3857. import java.util.Set;
  3858. import java.util.Map.Entry;
  3859. import java.util.regex.Matcher;
  3860. import java.util.regex.Pattern;
  3861. import javax.annotation.Nullable;
  3862. import net.minecraft.command.CommandBase;
  3863. import net.minecraft.command.CommandException;
  3864. import net.minecraft.command.ICommandSender;
  3865. import net.minecraft.entity.Entity;
  3866. import net.minecraft.entity.EntityList;
  3867. import net.minecraft.entity.EntityLivingBase;
  3868. import net.minecraft.entity.player.EntityPlayer;
  3869. import net.minecraft.entity.player.EntityPlayerMP;
  3870. import net.minecraft.scoreboard.Score;
  3871. import net.minecraft.scoreboard.ScoreObjective;
  3872. import net.minecraft.scoreboard.Scoreboard;
  3873. import net.minecraft.scoreboard.Team;
  3874. import net.minecraft.util.EntitySelectors;
  3875. import net.minecraft.util.ResourceLocation;
  3876. import net.minecraft.util.math.AxisAlignedBB;
  3877. import net.minecraft.util.math.BlockPos;
  3878. import net.minecraft.util.math.MathHelper;
  3879. import net.minecraft.util.math.Vec3d;
  3880. import net.minecraft.util.text.ITextComponent;
  3881. import net.minecraft.util.text.TextComponentTranslation;
  3882. import net.minecraft.util.text.TextFormatting;
  3883. import net.minecraft.world.GameType;
  3884. import net.minecraft.world.World;
  3885.  
  3886. public class EntitySelector {
  3887. private static final Pattern field_82389_a = Pattern.compile("^@([pares])(?:\\[([^ ]*)\\])?$");
  3888. private static final Splitter field_190828_b = Splitter.on(',').omitEmptyStrings();
  3889. private static final Splitter field_190829_c = Splitter.on('=').limit(2);
  3890. private static final Set<String> field_190830_d = Sets.<String>newHashSet();
  3891. private static final String field_190831_e = func_190826_c("r");
  3892. private static final String field_190832_f = func_190826_c("rm");
  3893. private static final String field_190833_g = func_190826_c("l");
  3894. private static final String field_190834_h = func_190826_c("lm");
  3895. private static final String field_190835_i = func_190826_c("x");
  3896. private static final String field_190836_j = func_190826_c("y");
  3897. private static final String field_190837_k = func_190826_c("z");
  3898. private static final String field_190838_l = func_190826_c("dx");
  3899. private static final String field_190839_m = func_190826_c("dy");
  3900. private static final String field_190840_n = func_190826_c("dz");
  3901. private static final String field_190841_o = func_190826_c("rx");
  3902. private static final String field_190842_p = func_190826_c("rxm");
  3903. private static final String field_190843_q = func_190826_c("ry");
  3904. private static final String field_190844_r = func_190826_c("rym");
  3905. private static final String field_190845_s = func_190826_c("c");
  3906. private static final String field_190846_t = func_190826_c("m");
  3907. private static final String field_190847_u = func_190826_c("team");
  3908. private static final String field_190848_v = func_190826_c("name");
  3909. private static final String field_190849_w = func_190826_c("type");
  3910. private static final String field_190850_x = func_190826_c("tag");
  3911. private static final Predicate<String> field_190851_y = new Predicate<String>() {
  3912. public boolean apply(@Nullable String p_apply_1_) {
  3913. return p_apply_1_ != null && (EntitySelector.field_190830_d.contains(p_apply_1_) || p_apply_1_.length() > "score_".length() && p_apply_1_.startsWith("score_"));
  3914. }
  3915. };
  3916. private static final Set<String> field_179666_d = Sets.newHashSet(new String[]{field_190835_i, field_190836_j, field_190837_k, field_190838_l, field_190839_m, field_190840_n, field_190832_f, field_190831_e});
  3917.  
  3918. public static String func_190826_c(String p_190826_0_) {
  3919. field_190830_d.add(p_190826_0_);
  3920. return p_190826_0_;
  3921. }
  3922.  
  3923. @Nullable
  3924. public static EntityPlayerMP func_82386_a(ICommandSender p_82386_0_, String p_82386_1_) throws CommandException {
  3925. return (EntityPlayerMP)func_179652_a(p_82386_0_, p_82386_1_, EntityPlayerMP.class);
  3926. }
  3927.  
  3928. public static List<EntityPlayerMP> func_193531_b(ICommandSender p_193531_0_, String p_193531_1_) throws CommandException {
  3929. return func_179656_b(p_193531_0_, p_193531_1_, EntityPlayerMP.class);
  3930. }
  3931.  
  3932. @Nullable
  3933. public static <T extends Entity> T func_179652_a(ICommandSender p_179652_0_, String p_179652_1_, Class<? extends T> p_179652_2_) throws CommandException {
  3934. List<T> list = func_179656_b(p_179652_0_, p_179652_1_, p_179652_2_);
  3935. return (T)(list.size() == 1?(Entity)list.get(0):null);
  3936. }
  3937.  
  3938. @Nullable
  3939. public static ITextComponent func_150869_b(ICommandSender p_150869_0_, String p_150869_1_) throws CommandException {
  3940. List<Entity> list = func_179656_b(p_150869_0_, p_150869_1_, Entity.class);
  3941. if(list.isEmpty()) {
  3942. return null;
  3943. } else {
  3944. List<ITextComponent> list1 = Lists.<ITextComponent>newArrayList();
  3945.  
  3946. for(Entity entity : list) {
  3947. list1.add(entity.func_145748_c_());
  3948. }
  3949.  
  3950. return CommandBase.func_180530_a(list1);
  3951. }
  3952. }
  3953.  
  3954. public static <T extends Entity> List<T> func_179656_b(ICommandSender p_179656_0_, String p_179656_1_, Class<? extends T> p_179656_2_) throws CommandException {
  3955. Matcher matcher = field_82389_a.matcher(p_179656_1_);
  3956. if(matcher.matches() && p_179656_0_.func_70003_b(1, "@")) {
  3957. Map<String, String> map = func_82381_h(matcher.group(2));
  3958. if(!func_179655_b(p_179656_0_, map)) {
  3959. return Collections.<T>emptyList();
  3960. } else {
  3961. String s = matcher.group(1);
  3962. BlockPos blockpos = func_179664_b(map, p_179656_0_.func_180425_c());
  3963. Vec3d vec3d = func_189210_b(map, p_179656_0_.func_174791_d());
  3964. List<World> list = func_179654_a(p_179656_0_, map);
  3965. List<T> list1 = Lists.<T>newArrayList();
  3966.  
  3967. for(World world : list) {
  3968. if(world != null) {
  3969. List<Predicate<Entity>> list2 = Lists.<Predicate<Entity>>newArrayList();
  3970. list2.addAll(func_179663_a(map, s));
  3971. list2.addAll(func_179648_b(map));
  3972. list2.addAll(func_179649_c(map));
  3973. list2.addAll(func_179659_d(map));
  3974. list2.addAll(func_184952_c(p_179656_0_, map));
  3975. list2.addAll(func_179647_f(map));
  3976. list2.addAll(func_184951_f(map));
  3977. list2.addAll(func_180698_a(map, vec3d));
  3978. list2.addAll(func_179662_g(map));
  3979. if("s".equalsIgnoreCase(s)) {
  3980. Entity entity = p_179656_0_.func_174793_f();
  3981. if(entity != null && p_179656_2_.isAssignableFrom(entity.getClass())) {
  3982. if(map.containsKey(field_190838_l) || map.containsKey(field_190839_m) || map.containsKey(field_190840_n)) {
  3983. int i = func_179653_a(map, field_190838_l, 0);
  3984. int j = func_179653_a(map, field_190839_m, 0);
  3985. int k = func_179653_a(map, field_190840_n, 0);
  3986. AxisAlignedBB axisalignedbb = func_179661_a(blockpos, i, j, k);
  3987. if(!axisalignedbb.func_72326_a(entity.func_174813_aQ())) {
  3988. return Collections.<T>emptyList();
  3989. }
  3990. }
  3991.  
  3992. for(Predicate<Entity> predicate : list2) {
  3993. if(!predicate.apply(entity)) {
  3994. return Collections.<T>emptyList();
  3995. }
  3996. }
  3997.  
  3998. return Lists.newArrayList(new Entity[]{entity});
  3999. }
  4000.  
  4001. return Collections.<T>emptyList();
  4002. }
  4003.  
  4004. list1.addAll(func_179660_a(map, p_179656_2_, list2, s, world, blockpos));
  4005. }
  4006. }
  4007.  
  4008. return func_179658_a(list1, map, p_179656_0_, p_179656_2_, s, vec3d);
  4009. }
  4010. } else {
  4011. return Collections.<T>emptyList();
  4012. }
  4013. }
  4014.  
  4015. private static List<World> func_179654_a(ICommandSender p_179654_0_, Map<String, String> p_179654_1_) {
  4016. List<World> list = Lists.<World>newArrayList();
  4017. if(func_179665_h(p_179654_1_)) {
  4018. list.add(p_179654_0_.func_130014_f_());
  4019. } else {
  4020. Collections.addAll(list, p_179654_0_.func_184102_h().field_71305_c);
  4021. }
  4022.  
  4023. return list;
  4024. }
  4025.  
  4026. private static <T extends Entity> boolean func_179655_b(ICommandSender p_179655_0_, Map<String, String> p_179655_1_) {
  4027. String s = func_179651_b(p_179655_1_, field_190849_w);
  4028. if(s == null) {
  4029. return true;
  4030. } else {
  4031. ResourceLocation resourcelocation = new ResourceLocation(s.startsWith("!")?s.substring(1):s);
  4032. if(EntityList.func_180125_b(resourcelocation)) {
  4033. return true;
  4034. } else {
  4035. TextComponentTranslation textcomponenttranslation = new TextComponentTranslation("commands.generic.entity.invalidType", new Object[]{resourcelocation});
  4036. textcomponenttranslation.func_150256_b().func_150238_a(TextFormatting.RED);
  4037. p_179655_0_.func_145747_a(textcomponenttranslation);
  4038. return false;
  4039. }
  4040. }
  4041. }
  4042.  
  4043. private static List<Predicate<Entity>> func_179663_a(Map<String, String> p_179663_0_, String p_179663_1_) {
  4044. String s = func_179651_b(p_179663_0_, field_190849_w);
  4045. if(s == null || !p_179663_1_.equals("e") && !p_179663_1_.equals("r") && !p_179663_1_.equals("s")) {
  4046. return !p_179663_1_.equals("e") && !p_179663_1_.equals("s")?Collections.singletonList(new Predicate<Entity>() {
  4047. public boolean apply(@Nullable Entity p_apply_1_) {
  4048. return p_apply_1_ instanceof EntityPlayer;
  4049. }
  4050. }):Collections.emptyList();
  4051. } else {
  4052. final boolean flag = s.startsWith("!");
  4053. final ResourceLocation resourcelocation = new ResourceLocation(flag?s.substring(1):s);
  4054. return Collections.singletonList(new Predicate<Entity>() {
  4055. public boolean apply(@Nullable Entity p_apply_1_) {
  4056. return EntityList.func_180123_a(p_apply_1_, resourcelocation) != flag;
  4057. }
  4058. });
  4059. }
  4060. }
  4061.  
  4062. private static List<Predicate<Entity>> func_179648_b(Map<String, String> p_179648_0_) {
  4063. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  4064. final int i = func_179653_a(p_179648_0_, field_190834_h, -1);
  4065. final int j = func_179653_a(p_179648_0_, field_190833_g, -1);
  4066. if(i > -1 || j > -1) {
  4067. list.add(new Predicate<Entity>() {
  4068. public boolean apply(@Nullable Entity p_apply_1_) {
  4069. if(!(p_apply_1_ instanceof EntityPlayerMP)) {
  4070. return false;
  4071. } else {
  4072. EntityPlayerMP entityplayermp = (EntityPlayerMP)p_apply_1_;
  4073. return (i <= -1 || entityplayermp.field_71068_ca >= i) && (j <= -1 || entityplayermp.field_71068_ca <= j);
  4074. }
  4075. }
  4076. });
  4077. }
  4078.  
  4079. return list;
  4080. }
  4081.  
  4082. private static List<Predicate<Entity>> func_179649_c(Map<String, String> p_179649_0_) {
  4083. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  4084. String s = func_179651_b(p_179649_0_, field_190846_t);
  4085. if(s == null) {
  4086. return list;
  4087. } else {
  4088. final boolean flag = s.startsWith("!");
  4089. if(flag) {
  4090. s = s.substring(1);
  4091. }
  4092.  
  4093. final GameType gametype;
  4094. try {
  4095. int i = Integer.parseInt(s);
  4096. gametype = GameType.func_185329_a(i, GameType.NOT_SET);
  4097. } catch (Throwable var6) {
  4098. gametype = GameType.func_185328_a(s, GameType.NOT_SET);
  4099. }
  4100.  
  4101. list.add(new Predicate<Entity>() {
  4102. public boolean apply(@Nullable Entity p_apply_1_) {
  4103. if(!(p_apply_1_ instanceof EntityPlayerMP)) {
  4104. return false;
  4105. } else {
  4106. EntityPlayerMP entityplayermp = (EntityPlayerMP)p_apply_1_;
  4107. GameType gametype1 = entityplayermp.field_71134_c.func_73081_b();
  4108. return flag?gametype1 != gametype:gametype1 == gametype;
  4109. }
  4110. }
  4111. });
  4112. return list;
  4113. }
  4114. }
  4115.  
  4116. private static List<Predicate<Entity>> func_179659_d(Map<String, String> p_179659_0_) {
  4117. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  4118. final String s = func_179651_b(p_179659_0_, field_190847_u);
  4119. final boolean flag = s != null && s.startsWith("!");
  4120. if(flag) {
  4121. s = s.substring(1);
  4122. }
  4123.  
  4124. if(s != null) {
  4125. list.add(new Predicate<Entity>() {
  4126. public boolean apply(@Nullable Entity p_apply_1_) {
  4127. if(!(p_apply_1_ instanceof EntityLivingBase)) {
  4128. return false;
  4129. } else {
  4130. EntityLivingBase entitylivingbase = (EntityLivingBase)p_apply_1_;
  4131. Team team = entitylivingbase.func_96124_cp();
  4132. String s1 = team == null?"":team.func_96661_b();
  4133. return s1.equals(s) != flag;
  4134. }
  4135. }
  4136. });
  4137. }
  4138.  
  4139. return list;
  4140. }
  4141.  
  4142. private static List<Predicate<Entity>> func_184952_c(final ICommandSender p_184952_0_, Map<String, String> p_184952_1_) {
  4143. final Map<String, Integer> map = func_96560_a(p_184952_1_);
  4144. return (List<Predicate<Entity>>)(map.isEmpty()?Collections.emptyList():Lists.newArrayList(new Predicate[]{new Predicate<Entity>() {
  4145. public boolean apply(@Nullable Entity p_apply_1_) {
  4146. if(p_apply_1_ == null) {
  4147. return false;
  4148. } else {
  4149. Scoreboard scoreboard = p_184952_0_.func_184102_h().func_71218_a(0).func_96441_U();
  4150.  
  4151. for(Entry<String, Integer> entry : map.entrySet()) {
  4152. String s = (String)entry.getKey();
  4153. boolean flag = false;
  4154. if(s.endsWith("_min") && s.length() > 4) {
  4155. flag = true;
  4156. s = s.substring(0, s.length() - 4);
  4157. }
  4158.  
  4159. ScoreObjective scoreobjective = scoreboard.func_96518_b(s);
  4160. if(scoreobjective == null) {
  4161. return false;
  4162. }
  4163.  
  4164. String s1 = p_apply_1_ instanceof EntityPlayerMP?p_apply_1_.func_70005_c_():p_apply_1_.func_189512_bd();
  4165. if(!scoreboard.func_178819_b(s1, scoreobjective)) {
  4166. return false;
  4167. }
  4168.  
  4169. Score score = scoreboard.func_96529_a(s1, scoreobjective);
  4170. int i = score.func_96652_c();
  4171. if(i < ((Integer)entry.getValue()).intValue() && flag) {
  4172. return false;
  4173. }
  4174.  
  4175. if(i > ((Integer)entry.getValue()).intValue() && !flag) {
  4176. return false;
  4177. }
  4178. }
  4179.  
  4180. return true;
  4181. }
  4182. }
  4183. }}));
  4184. }
  4185.  
  4186. private static List<Predicate<Entity>> func_179647_f(Map<String, String> p_179647_0_) {
  4187. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  4188. final String s = func_179651_b(p_179647_0_, field_190848_v);
  4189. final boolean flag = s != null && s.startsWith("!");
  4190. if(flag) {
  4191. s = s.substring(1);
  4192. }
  4193.  
  4194. if(s != null) {
  4195. list.add(new Predicate<Entity>() {
  4196. public boolean apply(@Nullable Entity p_apply_1_) {
  4197. return p_apply_1_ != null && p_apply_1_.func_70005_c_().equals(s) != flag;
  4198. }
  4199. });
  4200. }
  4201.  
  4202. return list;
  4203. }
  4204.  
  4205. private static List<Predicate<Entity>> func_184951_f(Map<String, String> p_184951_0_) {
  4206. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  4207. final String s = func_179651_b(p_184951_0_, field_190850_x);
  4208. final boolean flag = s != null && s.startsWith("!");
  4209. if(flag) {
  4210. s = s.substring(1);
  4211. }
  4212.  
  4213. if(s != null) {
  4214. list.add(new Predicate<Entity>() {
  4215. public boolean apply(@Nullable Entity p_apply_1_) {
  4216. return p_apply_1_ == null?false:("".equals(s)?p_apply_1_.func_184216_O().isEmpty() != flag:p_apply_1_.func_184216_O().contains(s) != flag);
  4217. }
  4218. });
  4219. }
  4220.  
  4221. return list;
  4222. }
  4223.  
  4224. private static List<Predicate<Entity>> func_180698_a(Map<String, String> p_180698_0_, final Vec3d p_180698_1_) {
  4225. double d0 = (double)func_179653_a(p_180698_0_, field_190832_f, -1);
  4226. double d1 = (double)func_179653_a(p_180698_0_, field_190831_e, -1);
  4227. final boolean flag = d0 < -0.5D;
  4228. final boolean flag1 = d1 < -0.5D;
  4229. if(flag && flag1) {
  4230. return Collections.<Predicate<Entity>>emptyList();
  4231. } else {
  4232. double d2 = Math.max(d0, 1.0E-4D);
  4233. final double d3 = d2 * d2;
  4234. double d4 = Math.max(d1, 1.0E-4D);
  4235. final double d5 = d4 * d4;
  4236. return Lists.newArrayList(new Predicate[]{new Predicate<Entity>() {
  4237. public boolean apply(@Nullable Entity p_apply_1_) {
  4238. if(p_apply_1_ == null) {
  4239. return false;
  4240. } else {
  4241. double d6 = p_180698_1_.func_186679_c(p_apply_1_.field_70165_t, p_apply_1_.field_70163_u, p_apply_1_.field_70161_v);
  4242. return (flag || d6 >= d3) && (flag1 || d6 <= d5);
  4243. }
  4244. }
  4245. }});
  4246. }
  4247. }
  4248.  
  4249. private static List<Predicate<Entity>> func_179662_g(Map<String, String> p_179662_0_) {
  4250. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  4251. if(p_179662_0_.containsKey(field_190844_r) || p_179662_0_.containsKey(field_190843_q)) {
  4252. final int i = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190844_r, 0));
  4253. final int j = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190843_q, 359));
  4254. list.add(new Predicate<Entity>() {
  4255. public boolean apply(@Nullable Entity p_apply_1_) {
  4256. if(p_apply_1_ == null) {
  4257. return false;
  4258. } else {
  4259. int i1 = MathHelper.func_188209_b(MathHelper.func_76141_d(p_apply_1_.field_70177_z));
  4260. return i > j?i1 >= i || i1 <= j:i1 >= i && i1 <= j;
  4261. }
  4262. }
  4263. });
  4264. }
  4265.  
  4266. if(p_179662_0_.containsKey(field_190842_p) || p_179662_0_.containsKey(field_190841_o)) {
  4267. final int k = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190842_p, 0));
  4268. final int l = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190841_o, 359));
  4269. list.add(new Predicate<Entity>() {
  4270. public boolean apply(@Nullable Entity p_apply_1_) {
  4271. if(p_apply_1_ == null) {
  4272. return false;
  4273. } else {
  4274. int i1 = MathHelper.func_188209_b(MathHelper.func_76141_d(p_apply_1_.field_70125_A));
  4275. return k > l?i1 >= k || i1 <= l:i1 >= k && i1 <= l;
  4276. }
  4277. }
  4278. });
  4279. }
  4280.  
  4281. return list;
  4282. }
  4283.  
  4284. private static <T extends Entity> List<T> func_179660_a(Map<String, String> p_179660_0_, Class<? extends T> p_179660_1_, List<Predicate<Entity>> p_179660_2_, String p_179660_3_, World p_179660_4_, BlockPos p_179660_5_) {
  4285. List<T> list = Lists.<T>newArrayList();
  4286. String s = func_179651_b(p_179660_0_, field_190849_w);
  4287. s = s != null && s.startsWith("!")?s.substring(1):s;
  4288. boolean flag = !p_179660_3_.equals("e");
  4289. boolean flag1 = p_179660_3_.equals("r") && s != null;
  4290. int i = func_179653_a(p_179660_0_, field_190838_l, 0);
  4291. int j = func_179653_a(p_179660_0_, field_190839_m, 0);
  4292. int k = func_179653_a(p_179660_0_, field_190840_n, 0);
  4293. int l = func_179653_a(p_179660_0_, field_190831_e, -1);
  4294. Predicate<Entity> predicate = Predicates.and(p_179660_2_);
  4295. Predicate<Entity> predicate1 = Predicates.<Entity>and(EntitySelectors.field_94557_a, predicate);
  4296. if(!p_179660_0_.containsKey(field_190838_l) && !p_179660_0_.containsKey(field_190839_m) && !p_179660_0_.containsKey(field_190840_n)) {
  4297. if(l >= 0) {
  4298. AxisAlignedBB axisalignedbb1 = new AxisAlignedBB((double)(p_179660_5_.func_177958_n() - l), (double)(p_179660_5_.func_177956_o() - l), (double)(p_179660_5_.func_177952_p() - l), (double)(p_179660_5_.func_177958_n() + l + 1), (double)(p_179660_5_.func_177956_o() + l + 1), (double)(p_179660_5_.func_177952_p() + l + 1));
  4299. if(flag && !flag1) {
  4300. list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate1));
  4301. } else {
  4302. list.addAll(p_179660_4_.<T>func_175647_a(p_179660_1_, axisalignedbb1, predicate1));
  4303. }
  4304. } else if(p_179660_3_.equals("a")) {
  4305. list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate));
  4306. } else if(!p_179660_3_.equals("p") && (!p_179660_3_.equals("r") || flag1)) {
  4307. list.addAll(p_179660_4_.<T>func_175644_a(p_179660_1_, predicate1));
  4308. } else {
  4309. list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate1));
  4310. }
  4311. } else {
  4312. final AxisAlignedBB axisalignedbb = func_179661_a(p_179660_5_, i, j, k);
  4313. if(flag && !flag1) {
  4314. Predicate<Entity> predicate2 = new Predicate<Entity>() {
  4315. public boolean apply(@Nullable Entity p_apply_1_) {
  4316. return p_apply_1_ != null && axisalignedbb.func_72326_a(p_apply_1_.func_174813_aQ());
  4317. }
  4318. };
  4319. list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, Predicates.<T>and(predicate1, predicate2)));
  4320. } else {
  4321. list.addAll(p_179660_4_.<T>func_175647_a(p_179660_1_, axisalignedbb, predicate1));
  4322. }
  4323. }
  4324.  
  4325. return list;
  4326. }
  4327.  
  4328. private static <T extends Entity> List<T> func_179658_a(List<T> p_179658_0_, Map<String, String> p_179658_1_, ICommandSender p_179658_2_, Class<? extends T> p_179658_3_, String p_179658_4_, final Vec3d p_179658_5_) {
  4329. int i = func_179653_a(p_179658_1_, field_190845_s, !p_179658_4_.equals("a") && !p_179658_4_.equals("e")?1:0);
  4330. if(!p_179658_4_.equals("p") && !p_179658_4_.equals("a") && !p_179658_4_.equals("e")) {
  4331. if(p_179658_4_.equals("r")) {
  4332. Collections.shuffle((List<?>)p_179658_0_);
  4333. }
  4334. } else {
  4335. Collections.sort((List<T>)p_179658_0_, new Comparator<Entity>() {
  4336. public int compare(Entity p_compare_1_, Entity p_compare_2_) {
  4337. return ComparisonChain.start().compare(p_compare_1_.func_70092_e(p_179658_5_.field_72450_a, p_179658_5_.field_72448_b, p_179658_5_.field_72449_c), p_compare_2_.func_70092_e(p_179658_5_.field_72450_a, p_179658_5_.field_72448_b, p_179658_5_.field_72449_c)).result();
  4338. }
  4339. });
  4340. }
  4341.  
  4342. Entity entity = p_179658_2_.func_174793_f();
  4343. if(entity != null && p_179658_3_.isAssignableFrom(entity.getClass()) && i == 1 && ((List)p_179658_0_).contains(entity) && !"r".equals(p_179658_4_)) {
  4344. p_179658_0_ = Lists.newArrayList(new Entity[]{entity});
  4345. }
  4346.  
  4347. if(i != 0) {
  4348. if(i < 0) {
  4349. Collections.reverse((List<?>)p_179658_0_);
  4350. }
  4351.  
  4352. p_179658_0_ = ((List)p_179658_0_).subList(0, Math.min(Math.abs(i), ((List)p_179658_0_).size()));
  4353. }
  4354.  
  4355. return (List)p_179658_0_;
  4356. }
  4357.  
  4358. private static AxisAlignedBB func_179661_a(BlockPos p_179661_0_, int p_179661_1_, int p_179661_2_, int p_179661_3_) {
  4359. boolean flag = p_179661_1_ < 0;
  4360. boolean flag1 = p_179661_2_ < 0;
  4361. boolean flag2 = p_179661_3_ < 0;
  4362. int i = p_179661_0_.func_177958_n() + (flag?p_179661_1_:0);
  4363. int j = p_179661_0_.func_177956_o() + (flag1?p_179661_2_:0);
  4364. int k = p_179661_0_.func_177952_p() + (flag2?p_179661_3_:0);
  4365. int l = p_179661_0_.func_177958_n() + (flag?0:p_179661_1_) + 1;
  4366. int i1 = p_179661_0_.func_177956_o() + (flag1?0:p_179661_2_) + 1;
  4367. int j1 = p_179661_0_.func_177952_p() + (flag2?0:p_179661_3_) + 1;
  4368. return new AxisAlignedBB((double)i, (double)j, (double)k, (double)l, (double)i1, (double)j1);
  4369. }
  4370.  
  4371. private static BlockPos func_179664_b(Map<String, String> p_179664_0_, BlockPos p_179664_1_) {
  4372. return new BlockPos(func_179653_a(p_179664_0_, field_190835_i, p_179664_1_.func_177958_n()), func_179653_a(p_179664_0_, field_190836_j, p_179664_1_.func_177956_o()), func_179653_a(p_179664_0_, field_190837_k, p_179664_1_.func_177952_p()));
  4373. }
  4374.  
  4375. private static Vec3d func_189210_b(Map<String, String> p_189210_0_, Vec3d p_189210_1_) {
  4376. return new Vec3d(func_189211_a(p_189210_0_, field_190835_i, p_189210_1_.field_72450_a, true), func_189211_a(p_189210_0_, field_190836_j, p_189210_1_.field_72448_b, false), func_189211_a(p_189210_0_, field_190837_k, p_189210_1_.field_72449_c, true));
  4377. }
  4378.  
  4379. private static double func_189211_a(Map<String, String> p_189211_0_, String p_189211_1_, double p_189211_2_, boolean p_189211_4_) {
  4380. return p_189211_0_.containsKey(p_189211_1_)?(double)MathHelper.func_82715_a((String)p_189211_0_.get(p_189211_1_), MathHelper.func_76128_c(p_189211_2_)) + (p_189211_4_?0.5D:0.0D):p_189211_2_;
  4381. }
  4382.  
  4383. private static boolean func_179665_h(Map<String, String> p_179665_0_) {
  4384. for(String s : field_179666_d) {
  4385. if(p_179665_0_.containsKey(s)) {
  4386. return true;
  4387. }
  4388. }
  4389.  
  4390. return false;
  4391. }
  4392.  
  4393. private static int func_179653_a(Map<String, String> p_179653_0_, String p_179653_1_, int p_179653_2_) {
  4394. return p_179653_0_.containsKey(p_179653_1_)?MathHelper.func_82715_a((String)p_179653_0_.get(p_179653_1_), p_179653_2_):p_179653_2_;
  4395. }
  4396.  
  4397. @Nullable
  4398. private static String func_179651_b(Map<String, String> p_179651_0_, String p_179651_1_) {
  4399. return (String)p_179651_0_.get(p_179651_1_);
  4400. }
  4401.  
  4402. public static Map<String, Integer> func_96560_a(Map<String, String> p_96560_0_) {
  4403. Map<String, Integer> map = Maps.<String, Integer>newHashMap();
  4404.  
  4405. for(String s : p_96560_0_.keySet()) {
  4406. if(s.startsWith("score_") && s.length() > "score_".length()) {
  4407. map.put(s.substring("score_".length()), Integer.valueOf(MathHelper.func_82715_a((String)p_96560_0_.get(s), 1)));
  4408. }
  4409. }
  4410.  
  4411. return map;
  4412. }
  4413.  
  4414. public static boolean func_82377_a(String p_82377_0_) throws CommandException {
  4415. Matcher matcher = field_82389_a.matcher(p_82377_0_);
  4416. if(!matcher.matches()) {
  4417. return false;
  4418. } else {
  4419. Map<String, String> map = func_82381_h(matcher.group(2));
  4420. String s = matcher.group(1);
  4421. int i = !"a".equals(s) && !"e".equals(s)?1:0;
  4422. return func_179653_a(map, field_190845_s, i) != 1;
  4423. }
  4424. }
  4425.  
  4426. public static boolean func_82378_b(String p_82378_0_) {
  4427. return field_82389_a.matcher(p_82378_0_).matches();
  4428. }
  4429.  
  4430. private static Map<String, String> func_82381_h(@Nullable String p_82381_0_) throws CommandException {
  4431. Map<String, String> map = Maps.<String, String>newHashMap();
  4432. if(p_82381_0_ == null) {
  4433. return map;
  4434. } else {
  4435. for(String s : field_190828_b.split(p_82381_0_)) {
  4436. Iterator<String> iterator = field_190829_c.split(s).iterator();
  4437. String s1 = (String)iterator.next();
  4438. if(!field_190851_y.apply(s1)) {
  4439. throw new CommandException("commands.generic.selector_argument", new Object[]{s});
  4440. }
  4441.  
  4442. map.put(s1, iterator.hasNext()?(String)iterator.next():"");
  4443. }
  4444.  
  4445. return map;
  4446. }
  4447. }
  4448. }
  4449.  
  4450. Hunk 6 failed! Cannot find hunk target
  4451. EntityLivingBase entitylivingbase = (EntityLivingBase)p_apply_1_;
  4452. Team team = entitylivingbase.func_96124_cp();
  4453. String s1 = team == null ? "" : team.func_96661_b();
  4454. - return s1.equals(s) != flag;
  4455. + return s1.equals(s_f_) != flag;
  4456. }
  4457. }
  4458. });
  4459. File state
  4460. package net.minecraft.command;
  4461.  
  4462. import com.google.common.base.Predicate;
  4463. import com.google.common.base.Predicates;
  4464. import com.google.common.base.Splitter;
  4465. import com.google.common.collect.ComparisonChain;
  4466. import com.google.common.collect.Lists;
  4467. import com.google.common.collect.Maps;
  4468. import com.google.common.collect.Sets;
  4469. import java.util.Collections;
  4470. import java.util.Comparator;
  4471. import java.util.Iterator;
  4472. import java.util.List;
  4473. import java.util.Map;
  4474. import java.util.Set;
  4475. import java.util.Map.Entry;
  4476. import java.util.regex.Matcher;
  4477. import java.util.regex.Pattern;
  4478. import javax.annotation.Nullable;
  4479. import net.minecraft.command.CommandBase;
  4480. import net.minecraft.command.CommandException;
  4481. import net.minecraft.command.ICommandSender;
  4482. import net.minecraft.entity.Entity;
  4483. import net.minecraft.entity.EntityList;
  4484. import net.minecraft.entity.EntityLivingBase;
  4485. import net.minecraft.entity.player.EntityPlayer;
  4486. import net.minecraft.entity.player.EntityPlayerMP;
  4487. import net.minecraft.scoreboard.Score;
  4488. import net.minecraft.scoreboard.ScoreObjective;
  4489. import net.minecraft.scoreboard.Scoreboard;
  4490. import net.minecraft.scoreboard.Team;
  4491. import net.minecraft.util.EntitySelectors;
  4492. import net.minecraft.util.ResourceLocation;
  4493. import net.minecraft.util.math.AxisAlignedBB;
  4494. import net.minecraft.util.math.BlockPos;
  4495. import net.minecraft.util.math.MathHelper;
  4496. import net.minecraft.util.math.Vec3d;
  4497. import net.minecraft.util.text.ITextComponent;
  4498. import net.minecraft.util.text.TextComponentTranslation;
  4499. import net.minecraft.util.text.TextFormatting;
  4500. import net.minecraft.world.GameType;
  4501. import net.minecraft.world.World;
  4502.  
  4503. public class EntitySelector {
  4504. private static final Pattern field_82389_a = Pattern.compile("^@([pares])(?:\\[([^ ]*)\\])?$");
  4505. private static final Splitter field_190828_b = Splitter.on(',').omitEmptyStrings();
  4506. private static final Splitter field_190829_c = Splitter.on('=').limit(2);
  4507. private static final Set<String> field_190830_d = Sets.<String>newHashSet();
  4508. private static final String field_190831_e = func_190826_c("r");
  4509. private static final String field_190832_f = func_190826_c("rm");
  4510. private static final String field_190833_g = func_190826_c("l");
  4511. private static final String field_190834_h = func_190826_c("lm");
  4512. private static final String field_190835_i = func_190826_c("x");
  4513. private static final String field_190836_j = func_190826_c("y");
  4514. private static final String field_190837_k = func_190826_c("z");
  4515. private static final String field_190838_l = func_190826_c("dx");
  4516. private static final String field_190839_m = func_190826_c("dy");
  4517. private static final String field_190840_n = func_190826_c("dz");
  4518. private static final String field_190841_o = func_190826_c("rx");
  4519. private static final String field_190842_p = func_190826_c("rxm");
  4520. private static final String field_190843_q = func_190826_c("ry");
  4521. private static final String field_190844_r = func_190826_c("rym");
  4522. private static final String field_190845_s = func_190826_c("c");
  4523. private static final String field_190846_t = func_190826_c("m");
  4524. private static final String field_190847_u = func_190826_c("team");
  4525. private static final String field_190848_v = func_190826_c("name");
  4526. private static final String field_190849_w = func_190826_c("type");
  4527. private static final String field_190850_x = func_190826_c("tag");
  4528. private static final Predicate<String> field_190851_y = new Predicate<String>() {
  4529. public boolean apply(@Nullable String p_apply_1_) {
  4530. return p_apply_1_ != null && (EntitySelector.field_190830_d.contains(p_apply_1_) || p_apply_1_.length() > "score_".length() && p_apply_1_.startsWith("score_"));
  4531. }
  4532. };
  4533. private static final Set<String> field_179666_d = Sets.newHashSet(new String[]{field_190835_i, field_190836_j, field_190837_k, field_190838_l, field_190839_m, field_190840_n, field_190832_f, field_190831_e});
  4534.  
  4535. public static String func_190826_c(String p_190826_0_) {
  4536. field_190830_d.add(p_190826_0_);
  4537. return p_190826_0_;
  4538. }
  4539.  
  4540. @Nullable
  4541. public static EntityPlayerMP func_82386_a(ICommandSender p_82386_0_, String p_82386_1_) throws CommandException {
  4542. return (EntityPlayerMP)func_179652_a(p_82386_0_, p_82386_1_, EntityPlayerMP.class);
  4543. }
  4544.  
  4545. public static List<EntityPlayerMP> func_193531_b(ICommandSender p_193531_0_, String p_193531_1_) throws CommandException {
  4546. return func_179656_b(p_193531_0_, p_193531_1_, EntityPlayerMP.class);
  4547. }
  4548.  
  4549. @Nullable
  4550. public static <T extends Entity> T func_179652_a(ICommandSender p_179652_0_, String p_179652_1_, Class<? extends T> p_179652_2_) throws CommandException {
  4551. List<T> list = func_179656_b(p_179652_0_, p_179652_1_, p_179652_2_);
  4552. return (T)(list.size() == 1?(Entity)list.get(0):null);
  4553. }
  4554.  
  4555. @Nullable
  4556. public static ITextComponent func_150869_b(ICommandSender p_150869_0_, String p_150869_1_) throws CommandException {
  4557. List<Entity> list = func_179656_b(p_150869_0_, p_150869_1_, Entity.class);
  4558. if(list.isEmpty()) {
  4559. return null;
  4560. } else {
  4561. List<ITextComponent> list1 = Lists.<ITextComponent>newArrayList();
  4562.  
  4563. for(Entity entity : list) {
  4564. list1.add(entity.func_145748_c_());
  4565. }
  4566.  
  4567. return CommandBase.func_180530_a(list1);
  4568. }
  4569. }
  4570.  
  4571. public static <T extends Entity> List<T> func_179656_b(ICommandSender p_179656_0_, String p_179656_1_, Class<? extends T> p_179656_2_) throws CommandException {
  4572. Matcher matcher = field_82389_a.matcher(p_179656_1_);
  4573. if(matcher.matches() && p_179656_0_.func_70003_b(1, "@")) {
  4574. Map<String, String> map = func_82381_h(matcher.group(2));
  4575. if(!func_179655_b(p_179656_0_, map)) {
  4576. return Collections.<T>emptyList();
  4577. } else {
  4578. String s = matcher.group(1);
  4579. BlockPos blockpos = func_179664_b(map, p_179656_0_.func_180425_c());
  4580. Vec3d vec3d = func_189210_b(map, p_179656_0_.func_174791_d());
  4581. List<World> list = func_179654_a(p_179656_0_, map);
  4582. List<T> list1 = Lists.<T>newArrayList();
  4583.  
  4584. for(World world : list) {
  4585. if(world != null) {
  4586. List<Predicate<Entity>> list2 = Lists.<Predicate<Entity>>newArrayList();
  4587. list2.addAll(func_179663_a(map, s));
  4588. list2.addAll(func_179648_b(map));
  4589. list2.addAll(func_179649_c(map));
  4590. list2.addAll(func_179659_d(map));
  4591. list2.addAll(func_184952_c(p_179656_0_, map));
  4592. list2.addAll(func_179647_f(map));
  4593. list2.addAll(func_184951_f(map));
  4594. list2.addAll(func_180698_a(map, vec3d));
  4595. list2.addAll(func_179662_g(map));
  4596. if("s".equalsIgnoreCase(s)) {
  4597. Entity entity = p_179656_0_.func_174793_f();
  4598. if(entity != null && p_179656_2_.isAssignableFrom(entity.getClass())) {
  4599. if(map.containsKey(field_190838_l) || map.containsKey(field_190839_m) || map.containsKey(field_190840_n)) {
  4600. int i = func_179653_a(map, field_190838_l, 0);
  4601. int j = func_179653_a(map, field_190839_m, 0);
  4602. int k = func_179653_a(map, field_190840_n, 0);
  4603. AxisAlignedBB axisalignedbb = func_179661_a(blockpos, i, j, k);
  4604. if(!axisalignedbb.func_72326_a(entity.func_174813_aQ())) {
  4605. return Collections.<T>emptyList();
  4606. }
  4607. }
  4608.  
  4609. for(Predicate<Entity> predicate : list2) {
  4610. if(!predicate.apply(entity)) {
  4611. return Collections.<T>emptyList();
  4612. }
  4613. }
  4614.  
  4615. return Lists.newArrayList(new Entity[]{entity});
  4616. }
  4617.  
  4618. return Collections.<T>emptyList();
  4619. }
  4620.  
  4621. list1.addAll(func_179660_a(map, p_179656_2_, list2, s, world, blockpos));
  4622. }
  4623. }
  4624.  
  4625. return func_179658_a(list1, map, p_179656_0_, p_179656_2_, s, vec3d);
  4626. }
  4627. } else {
  4628. return Collections.<T>emptyList();
  4629. }
  4630. }
  4631.  
  4632. private static List<World> func_179654_a(ICommandSender p_179654_0_, Map<String, String> p_179654_1_) {
  4633. List<World> list = Lists.<World>newArrayList();
  4634. if(func_179665_h(p_179654_1_)) {
  4635. list.add(p_179654_0_.func_130014_f_());
  4636. } else {
  4637. Collections.addAll(list, p_179654_0_.func_184102_h().field_71305_c);
  4638. }
  4639.  
  4640. return list;
  4641. }
  4642.  
  4643. private static <T extends Entity> boolean func_179655_b(ICommandSender p_179655_0_, Map<String, String> p_179655_1_) {
  4644. String s = func_179651_b(p_179655_1_, field_190849_w);
  4645. if(s == null) {
  4646. return true;
  4647. } else {
  4648. ResourceLocation resourcelocation = new ResourceLocation(s.startsWith("!")?s.substring(1):s);
  4649. if(EntityList.func_180125_b(resourcelocation)) {
  4650. return true;
  4651. } else {
  4652. TextComponentTranslation textcomponenttranslation = new TextComponentTranslation("commands.generic.entity.invalidType", new Object[]{resourcelocation});
  4653. textcomponenttranslation.func_150256_b().func_150238_a(TextFormatting.RED);
  4654. p_179655_0_.func_145747_a(textcomponenttranslation);
  4655. return false;
  4656. }
  4657. }
  4658. }
  4659.  
  4660. private static List<Predicate<Entity>> func_179663_a(Map<String, String> p_179663_0_, String p_179663_1_) {
  4661. String s = func_179651_b(p_179663_0_, field_190849_w);
  4662. if(s == null || !p_179663_1_.equals("e") && !p_179663_1_.equals("r") && !p_179663_1_.equals("s")) {
  4663. return !p_179663_1_.equals("e") && !p_179663_1_.equals("s")?Collections.singletonList(new Predicate<Entity>() {
  4664. public boolean apply(@Nullable Entity p_apply_1_) {
  4665. return p_apply_1_ instanceof EntityPlayer;
  4666. }
  4667. }):Collections.emptyList();
  4668. } else {
  4669. final boolean flag = s.startsWith("!");
  4670. final ResourceLocation resourcelocation = new ResourceLocation(flag?s.substring(1):s);
  4671. return Collections.singletonList(new Predicate<Entity>() {
  4672. public boolean apply(@Nullable Entity p_apply_1_) {
  4673. return EntityList.func_180123_a(p_apply_1_, resourcelocation) != flag;
  4674. }
  4675. });
  4676. }
  4677. }
  4678.  
  4679. private static List<Predicate<Entity>> func_179648_b(Map<String, String> p_179648_0_) {
  4680. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  4681. final int i = func_179653_a(p_179648_0_, field_190834_h, -1);
  4682. final int j = func_179653_a(p_179648_0_, field_190833_g, -1);
  4683. if(i > -1 || j > -1) {
  4684. list.add(new Predicate<Entity>() {
  4685. public boolean apply(@Nullable Entity p_apply_1_) {
  4686. if(!(p_apply_1_ instanceof EntityPlayerMP)) {
  4687. return false;
  4688. } else {
  4689. EntityPlayerMP entityplayermp = (EntityPlayerMP)p_apply_1_;
  4690. return (i <= -1 || entityplayermp.field_71068_ca >= i) && (j <= -1 || entityplayermp.field_71068_ca <= j);
  4691. }
  4692. }
  4693. });
  4694. }
  4695.  
  4696. return list;
  4697. }
  4698.  
  4699. private static List<Predicate<Entity>> func_179649_c(Map<String, String> p_179649_0_) {
  4700. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  4701. String s = func_179651_b(p_179649_0_, field_190846_t);
  4702. if(s == null) {
  4703. return list;
  4704. } else {
  4705. final boolean flag = s.startsWith("!");
  4706. if(flag) {
  4707. s = s.substring(1);
  4708. }
  4709.  
  4710. final GameType gametype;
  4711. try {
  4712. int i = Integer.parseInt(s);
  4713. gametype = GameType.func_185329_a(i, GameType.NOT_SET);
  4714. } catch (Throwable var6) {
  4715. gametype = GameType.func_185328_a(s, GameType.NOT_SET);
  4716. }
  4717.  
  4718. list.add(new Predicate<Entity>() {
  4719. public boolean apply(@Nullable Entity p_apply_1_) {
  4720. if(!(p_apply_1_ instanceof EntityPlayerMP)) {
  4721. return false;
  4722. } else {
  4723. EntityPlayerMP entityplayermp = (EntityPlayerMP)p_apply_1_;
  4724. GameType gametype1 = entityplayermp.field_71134_c.func_73081_b();
  4725. return flag?gametype1 != gametype:gametype1 == gametype;
  4726. }
  4727. }
  4728. });
  4729. return list;
  4730. }
  4731. }
  4732.  
  4733. private static List<Predicate<Entity>> func_179659_d(Map<String, String> p_179659_0_) {
  4734. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  4735. final String s = func_179651_b(p_179659_0_, field_190847_u);
  4736. final boolean flag = s != null && s.startsWith("!");
  4737. if(flag) {
  4738. s = s.substring(1);
  4739. }
  4740.  
  4741. if(s != null) {
  4742. list.add(new Predicate<Entity>() {
  4743. public boolean apply(@Nullable Entity p_apply_1_) {
  4744. if(!(p_apply_1_ instanceof EntityLivingBase)) {
  4745. return false;
  4746. } else {
  4747. EntityLivingBase entitylivingbase = (EntityLivingBase)p_apply_1_;
  4748. Team team = entitylivingbase.func_96124_cp();
  4749. String s1 = team == null?"":team.func_96661_b();
  4750. return s1.equals(s) != flag;
  4751. }
  4752. }
  4753. });
  4754. }
  4755.  
  4756. return list;
  4757. }
  4758.  
  4759. private static List<Predicate<Entity>> func_184952_c(final ICommandSender p_184952_0_, Map<String, String> p_184952_1_) {
  4760. final Map<String, Integer> map = func_96560_a(p_184952_1_);
  4761. return (List<Predicate<Entity>>)(map.isEmpty()?Collections.emptyList():Lists.newArrayList(new Predicate[]{new Predicate<Entity>() {
  4762. public boolean apply(@Nullable Entity p_apply_1_) {
  4763. if(p_apply_1_ == null) {
  4764. return false;
  4765. } else {
  4766. Scoreboard scoreboard = p_184952_0_.func_184102_h().func_71218_a(0).func_96441_U();
  4767.  
  4768. for(Entry<String, Integer> entry : map.entrySet()) {
  4769. String s = (String)entry.getKey();
  4770. boolean flag = false;
  4771. if(s.endsWith("_min") && s.length() > 4) {
  4772. flag = true;
  4773. s = s.substring(0, s.length() - 4);
  4774. }
  4775.  
  4776. ScoreObjective scoreobjective = scoreboard.func_96518_b(s);
  4777. if(scoreobjective == null) {
  4778. return false;
  4779. }
  4780.  
  4781. String s1 = p_apply_1_ instanceof EntityPlayerMP?p_apply_1_.func_70005_c_():p_apply_1_.func_189512_bd();
  4782. if(!scoreboard.func_178819_b(s1, scoreobjective)) {
  4783. return false;
  4784. }
  4785.  
  4786. Score score = scoreboard.func_96529_a(s1, scoreobjective);
  4787. int i = score.func_96652_c();
  4788. if(i < ((Integer)entry.getValue()).intValue() && flag) {
  4789. return false;
  4790. }
  4791.  
  4792. if(i > ((Integer)entry.getValue()).intValue() && !flag) {
  4793. return false;
  4794. }
  4795. }
  4796.  
  4797. return true;
  4798. }
  4799. }
  4800. }}));
  4801. }
  4802.  
  4803. private static List<Predicate<Entity>> func_179647_f(Map<String, String> p_179647_0_) {
  4804. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  4805. final String s = func_179651_b(p_179647_0_, field_190848_v);
  4806. final boolean flag = s != null && s.startsWith("!");
  4807. if(flag) {
  4808. s = s.substring(1);
  4809. }
  4810.  
  4811. if(s != null) {
  4812. list.add(new Predicate<Entity>() {
  4813. public boolean apply(@Nullable Entity p_apply_1_) {
  4814. return p_apply_1_ != null && p_apply_1_.func_70005_c_().equals(s) != flag;
  4815. }
  4816. });
  4817. }
  4818.  
  4819. return list;
  4820. }
  4821.  
  4822. private static List<Predicate<Entity>> func_184951_f(Map<String, String> p_184951_0_) {
  4823. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  4824. final String s = func_179651_b(p_184951_0_, field_190850_x);
  4825. final boolean flag = s != null && s.startsWith("!");
  4826. if(flag) {
  4827. s = s.substring(1);
  4828. }
  4829.  
  4830. if(s != null) {
  4831. list.add(new Predicate<Entity>() {
  4832. public boolean apply(@Nullable Entity p_apply_1_) {
  4833. return p_apply_1_ == null?false:("".equals(s)?p_apply_1_.func_184216_O().isEmpty() != flag:p_apply_1_.func_184216_O().contains(s) != flag);
  4834. }
  4835. });
  4836. }
  4837.  
  4838. return list;
  4839. }
  4840.  
  4841. private static List<Predicate<Entity>> func_180698_a(Map<String, String> p_180698_0_, final Vec3d p_180698_1_) {
  4842. double d0 = (double)func_179653_a(p_180698_0_, field_190832_f, -1);
  4843. double d1 = (double)func_179653_a(p_180698_0_, field_190831_e, -1);
  4844. final boolean flag = d0 < -0.5D;
  4845. final boolean flag1 = d1 < -0.5D;
  4846. if(flag && flag1) {
  4847. return Collections.<Predicate<Entity>>emptyList();
  4848. } else {
  4849. double d2 = Math.max(d0, 1.0E-4D);
  4850. final double d3 = d2 * d2;
  4851. double d4 = Math.max(d1, 1.0E-4D);
  4852. final double d5 = d4 * d4;
  4853. return Lists.newArrayList(new Predicate[]{new Predicate<Entity>() {
  4854. public boolean apply(@Nullable Entity p_apply_1_) {
  4855. if(p_apply_1_ == null) {
  4856. return false;
  4857. } else {
  4858. double d6 = p_180698_1_.func_186679_c(p_apply_1_.field_70165_t, p_apply_1_.field_70163_u, p_apply_1_.field_70161_v);
  4859. return (flag || d6 >= d3) && (flag1 || d6 <= d5);
  4860. }
  4861. }
  4862. }});
  4863. }
  4864. }
  4865.  
  4866. private static List<Predicate<Entity>> func_179662_g(Map<String, String> p_179662_0_) {
  4867. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  4868. if(p_179662_0_.containsKey(field_190844_r) || p_179662_0_.containsKey(field_190843_q)) {
  4869. final int i = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190844_r, 0));
  4870. final int j = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190843_q, 359));
  4871. list.add(new Predicate<Entity>() {
  4872. public boolean apply(@Nullable Entity p_apply_1_) {
  4873. if(p_apply_1_ == null) {
  4874. return false;
  4875. } else {
  4876. int i1 = MathHelper.func_188209_b(MathHelper.func_76141_d(p_apply_1_.field_70177_z));
  4877. return i > j?i1 >= i || i1 <= j:i1 >= i && i1 <= j;
  4878. }
  4879. }
  4880. });
  4881. }
  4882.  
  4883. if(p_179662_0_.containsKey(field_190842_p) || p_179662_0_.containsKey(field_190841_o)) {
  4884. final int k = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190842_p, 0));
  4885. final int l = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190841_o, 359));
  4886. list.add(new Predicate<Entity>() {
  4887. public boolean apply(@Nullable Entity p_apply_1_) {
  4888. if(p_apply_1_ == null) {
  4889. return false;
  4890. } else {
  4891. int i1 = MathHelper.func_188209_b(MathHelper.func_76141_d(p_apply_1_.field_70125_A));
  4892. return k > l?i1 >= k || i1 <= l:i1 >= k && i1 <= l;
  4893. }
  4894. }
  4895. });
  4896. }
  4897.  
  4898. return list;
  4899. }
  4900.  
  4901. private static <T extends Entity> List<T> func_179660_a(Map<String, String> p_179660_0_, Class<? extends T> p_179660_1_, List<Predicate<Entity>> p_179660_2_, String p_179660_3_, World p_179660_4_, BlockPos p_179660_5_) {
  4902. List<T> list = Lists.<T>newArrayList();
  4903. String s = func_179651_b(p_179660_0_, field_190849_w);
  4904. s = s != null && s.startsWith("!")?s.substring(1):s;
  4905. boolean flag = !p_179660_3_.equals("e");
  4906. boolean flag1 = p_179660_3_.equals("r") && s != null;
  4907. int i = func_179653_a(p_179660_0_, field_190838_l, 0);
  4908. int j = func_179653_a(p_179660_0_, field_190839_m, 0);
  4909. int k = func_179653_a(p_179660_0_, field_190840_n, 0);
  4910. int l = func_179653_a(p_179660_0_, field_190831_e, -1);
  4911. Predicate<Entity> predicate = Predicates.and(p_179660_2_);
  4912. Predicate<Entity> predicate1 = Predicates.<Entity>and(EntitySelectors.field_94557_a, predicate);
  4913. if(!p_179660_0_.containsKey(field_190838_l) && !p_179660_0_.containsKey(field_190839_m) && !p_179660_0_.containsKey(field_190840_n)) {
  4914. if(l >= 0) {
  4915. AxisAlignedBB axisalignedbb1 = new AxisAlignedBB((double)(p_179660_5_.func_177958_n() - l), (double)(p_179660_5_.func_177956_o() - l), (double)(p_179660_5_.func_177952_p() - l), (double)(p_179660_5_.func_177958_n() + l + 1), (double)(p_179660_5_.func_177956_o() + l + 1), (double)(p_179660_5_.func_177952_p() + l + 1));
  4916. if(flag && !flag1) {
  4917. list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate1));
  4918. } else {
  4919. list.addAll(p_179660_4_.<T>func_175647_a(p_179660_1_, axisalignedbb1, predicate1));
  4920. }
  4921. } else if(p_179660_3_.equals("a")) {
  4922. list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate));
  4923. } else if(!p_179660_3_.equals("p") && (!p_179660_3_.equals("r") || flag1)) {
  4924. list.addAll(p_179660_4_.<T>func_175644_a(p_179660_1_, predicate1));
  4925. } else {
  4926. list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate1));
  4927. }
  4928. } else {
  4929. final AxisAlignedBB axisalignedbb = func_179661_a(p_179660_5_, i, j, k);
  4930. if(flag && !flag1) {
  4931. Predicate<Entity> predicate2 = new Predicate<Entity>() {
  4932. public boolean apply(@Nullable Entity p_apply_1_) {
  4933. return p_apply_1_ != null && axisalignedbb.func_72326_a(p_apply_1_.func_174813_aQ());
  4934. }
  4935. };
  4936. list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, Predicates.<T>and(predicate1, predicate2)));
  4937. } else {
  4938. list.addAll(p_179660_4_.<T>func_175647_a(p_179660_1_, axisalignedbb, predicate1));
  4939. }
  4940. }
  4941.  
  4942. return list;
  4943. }
  4944.  
  4945. private static <T extends Entity> List<T> func_179658_a(List<T> p_179658_0_, Map<String, String> p_179658_1_, ICommandSender p_179658_2_, Class<? extends T> p_179658_3_, String p_179658_4_, final Vec3d p_179658_5_) {
  4946. int i = func_179653_a(p_179658_1_, field_190845_s, !p_179658_4_.equals("a") && !p_179658_4_.equals("e")?1:0);
  4947. if(!p_179658_4_.equals("p") && !p_179658_4_.equals("a") && !p_179658_4_.equals("e")) {
  4948. if(p_179658_4_.equals("r")) {
  4949. Collections.shuffle((List<?>)p_179658_0_);
  4950. }
  4951. } else {
  4952. Collections.sort((List<T>)p_179658_0_, new Comparator<Entity>() {
  4953. public int compare(Entity p_compare_1_, Entity p_compare_2_) {
  4954. return ComparisonChain.start().compare(p_compare_1_.func_70092_e(p_179658_5_.field_72450_a, p_179658_5_.field_72448_b, p_179658_5_.field_72449_c), p_compare_2_.func_70092_e(p_179658_5_.field_72450_a, p_179658_5_.field_72448_b, p_179658_5_.field_72449_c)).result();
  4955. }
  4956. });
  4957. }
  4958.  
  4959. Entity entity = p_179658_2_.func_174793_f();
  4960. if(entity != null && p_179658_3_.isAssignableFrom(entity.getClass()) && i == 1 && ((List)p_179658_0_).contains(entity) && !"r".equals(p_179658_4_)) {
  4961. p_179658_0_ = Lists.newArrayList(new Entity[]{entity});
  4962. }
  4963.  
  4964. if(i != 0) {
  4965. if(i < 0) {
  4966. Collections.reverse((List<?>)p_179658_0_);
  4967. }
  4968.  
  4969. p_179658_0_ = ((List)p_179658_0_).subList(0, Math.min(Math.abs(i), ((List)p_179658_0_).size()));
  4970. }
  4971.  
  4972. return (List)p_179658_0_;
  4973. }
  4974.  
  4975. private static AxisAlignedBB func_179661_a(BlockPos p_179661_0_, int p_179661_1_, int p_179661_2_, int p_179661_3_) {
  4976. boolean flag = p_179661_1_ < 0;
  4977. boolean flag1 = p_179661_2_ < 0;
  4978. boolean flag2 = p_179661_3_ < 0;
  4979. int i = p_179661_0_.func_177958_n() + (flag?p_179661_1_:0);
  4980. int j = p_179661_0_.func_177956_o() + (flag1?p_179661_2_:0);
  4981. int k = p_179661_0_.func_177952_p() + (flag2?p_179661_3_:0);
  4982. int l = p_179661_0_.func_177958_n() + (flag?0:p_179661_1_) + 1;
  4983. int i1 = p_179661_0_.func_177956_o() + (flag1?0:p_179661_2_) + 1;
  4984. int j1 = p_179661_0_.func_177952_p() + (flag2?0:p_179661_3_) + 1;
  4985. return new AxisAlignedBB((double)i, (double)j, (double)k, (double)l, (double)i1, (double)j1);
  4986. }
  4987.  
  4988. private static BlockPos func_179664_b(Map<String, String> p_179664_0_, BlockPos p_179664_1_) {
  4989. return new BlockPos(func_179653_a(p_179664_0_, field_190835_i, p_179664_1_.func_177958_n()), func_179653_a(p_179664_0_, field_190836_j, p_179664_1_.func_177956_o()), func_179653_a(p_179664_0_, field_190837_k, p_179664_1_.func_177952_p()));
  4990. }
  4991.  
  4992. private static Vec3d func_189210_b(Map<String, String> p_189210_0_, Vec3d p_189210_1_) {
  4993. return new Vec3d(func_189211_a(p_189210_0_, field_190835_i, p_189210_1_.field_72450_a, true), func_189211_a(p_189210_0_, field_190836_j, p_189210_1_.field_72448_b, false), func_189211_a(p_189210_0_, field_190837_k, p_189210_1_.field_72449_c, true));
  4994. }
  4995.  
  4996. private static double func_189211_a(Map<String, String> p_189211_0_, String p_189211_1_, double p_189211_2_, boolean p_189211_4_) {
  4997. return p_189211_0_.containsKey(p_189211_1_)?(double)MathHelper.func_82715_a((String)p_189211_0_.get(p_189211_1_), MathHelper.func_76128_c(p_189211_2_)) + (p_189211_4_?0.5D:0.0D):p_189211_2_;
  4998. }
  4999.  
  5000. private static boolean func_179665_h(Map<String, String> p_179665_0_) {
  5001. for(String s : field_179666_d) {
  5002. if(p_179665_0_.containsKey(s)) {
  5003. return true;
  5004. }
  5005. }
  5006.  
  5007. return false;
  5008. }
  5009.  
  5010. private static int func_179653_a(Map<String, String> p_179653_0_, String p_179653_1_, int p_179653_2_) {
  5011. return p_179653_0_.containsKey(p_179653_1_)?MathHelper.func_82715_a((String)p_179653_0_.get(p_179653_1_), p_179653_2_):p_179653_2_;
  5012. }
  5013.  
  5014. @Nullable
  5015. private static String func_179651_b(Map<String, String> p_179651_0_, String p_179651_1_) {
  5016. return (String)p_179651_0_.get(p_179651_1_);
  5017. }
  5018.  
  5019. public static Map<String, Integer> func_96560_a(Map<String, String> p_96560_0_) {
  5020. Map<String, Integer> map = Maps.<String, Integer>newHashMap();
  5021.  
  5022. for(String s : p_96560_0_.keySet()) {
  5023. if(s.startsWith("score_") && s.length() > "score_".length()) {
  5024. map.put(s.substring("score_".length()), Integer.valueOf(MathHelper.func_82715_a((String)p_96560_0_.get(s), 1)));
  5025. }
  5026. }
  5027.  
  5028. return map;
  5029. }
  5030.  
  5031. public static boolean func_82377_a(String p_82377_0_) throws CommandException {
  5032. Matcher matcher = field_82389_a.matcher(p_82377_0_);
  5033. if(!matcher.matches()) {
  5034. return false;
  5035. } else {
  5036. Map<String, String> map = func_82381_h(matcher.group(2));
  5037. String s = matcher.group(1);
  5038. int i = !"a".equals(s) && !"e".equals(s)?1:0;
  5039. return func_179653_a(map, field_190845_s, i) != 1;
  5040. }
  5041. }
  5042.  
  5043. public static boolean func_82378_b(String p_82378_0_) {
  5044. return field_82389_a.matcher(p_82378_0_).matches();
  5045. }
  5046.  
  5047. private static Map<String, String> func_82381_h(@Nullable String p_82381_0_) throws CommandException {
  5048. Map<String, String> map = Maps.<String, String>newHashMap();
  5049. if(p_82381_0_ == null) {
  5050. return map;
  5051. } else {
  5052. for(String s : field_190828_b.split(p_82381_0_)) {
  5053. Iterator<String> iterator = field_190829_c.split(s).iterator();
  5054. String s1 = (String)iterator.next();
  5055. if(!field_190851_y.apply(s1)) {
  5056. throw new CommandException("commands.generic.selector_argument", new Object[]{s});
  5057. }
  5058.  
  5059. map.put(s1, iterator.hasNext()?(String)iterator.next():"");
  5060. }
  5061.  
  5062. return map;
  5063. }
  5064. }
  5065. }
  5066.  
  5067. Hunk 7 failed! Cannot find hunk target
  5068.  
  5069. private static List<Predicate<Entity>> func_179647_f(Map<String, String> p_179647_0_) {
  5070. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  5071. - final String s = func_179651_b(p_179647_0_, field_190848_v);
  5072. + String s = func_179651_b(p_179647_0_, field_190848_v);
  5073. final boolean flag = s != null && s.startsWith("!");
  5074. if (flag) {
  5075. s = s.substring(1);
  5076. }
  5077.  
  5078. if (s != null) {
  5079. + final String s_f_ = s;
  5080. list.add(new Predicate<Entity>() {
  5081. public boolean apply(@Nullable Entity p_apply_1_) {
  5082. - return p_apply_1_ != null && p_apply_1_.func_70005_c_().equals(s) != flag;
  5083. + return p_apply_1_ != null && p_apply_1_.func_70005_c_().equals(s_f_) != flag;
  5084. }
  5085. });
  5086. }
  5087. File state
  5088. package net.minecraft.command;
  5089.  
  5090. import com.google.common.base.Predicate;
  5091. import com.google.common.base.Predicates;
  5092. import com.google.common.base.Splitter;
  5093. import com.google.common.collect.ComparisonChain;
  5094. import com.google.common.collect.Lists;
  5095. import com.google.common.collect.Maps;
  5096. import com.google.common.collect.Sets;
  5097. import java.util.Collections;
  5098. import java.util.Comparator;
  5099. import java.util.Iterator;
  5100. import java.util.List;
  5101. import java.util.Map;
  5102. import java.util.Set;
  5103. import java.util.Map.Entry;
  5104. import java.util.regex.Matcher;
  5105. import java.util.regex.Pattern;
  5106. import javax.annotation.Nullable;
  5107. import net.minecraft.command.CommandBase;
  5108. import net.minecraft.command.CommandException;
  5109. import net.minecraft.command.ICommandSender;
  5110. import net.minecraft.entity.Entity;
  5111. import net.minecraft.entity.EntityList;
  5112. import net.minecraft.entity.EntityLivingBase;
  5113. import net.minecraft.entity.player.EntityPlayer;
  5114. import net.minecraft.entity.player.EntityPlayerMP;
  5115. import net.minecraft.scoreboard.Score;
  5116. import net.minecraft.scoreboard.ScoreObjective;
  5117. import net.minecraft.scoreboard.Scoreboard;
  5118. import net.minecraft.scoreboard.Team;
  5119. import net.minecraft.util.EntitySelectors;
  5120. import net.minecraft.util.ResourceLocation;
  5121. import net.minecraft.util.math.AxisAlignedBB;
  5122. import net.minecraft.util.math.BlockPos;
  5123. import net.minecraft.util.math.MathHelper;
  5124. import net.minecraft.util.math.Vec3d;
  5125. import net.minecraft.util.text.ITextComponent;
  5126. import net.minecraft.util.text.TextComponentTranslation;
  5127. import net.minecraft.util.text.TextFormatting;
  5128. import net.minecraft.world.GameType;
  5129. import net.minecraft.world.World;
  5130.  
  5131. public class EntitySelector {
  5132. private static final Pattern field_82389_a = Pattern.compile("^@([pares])(?:\\[([^ ]*)\\])?$");
  5133. private static final Splitter field_190828_b = Splitter.on(',').omitEmptyStrings();
  5134. private static final Splitter field_190829_c = Splitter.on('=').limit(2);
  5135. private static final Set<String> field_190830_d = Sets.<String>newHashSet();
  5136. private static final String field_190831_e = func_190826_c("r");
  5137. private static final String field_190832_f = func_190826_c("rm");
  5138. private static final String field_190833_g = func_190826_c("l");
  5139. private static final String field_190834_h = func_190826_c("lm");
  5140. private static final String field_190835_i = func_190826_c("x");
  5141. private static final String field_190836_j = func_190826_c("y");
  5142. private static final String field_190837_k = func_190826_c("z");
  5143. private static final String field_190838_l = func_190826_c("dx");
  5144. private static final String field_190839_m = func_190826_c("dy");
  5145. private static final String field_190840_n = func_190826_c("dz");
  5146. private static final String field_190841_o = func_190826_c("rx");
  5147. private static final String field_190842_p = func_190826_c("rxm");
  5148. private static final String field_190843_q = func_190826_c("ry");
  5149. private static final String field_190844_r = func_190826_c("rym");
  5150. private static final String field_190845_s = func_190826_c("c");
  5151. private static final String field_190846_t = func_190826_c("m");
  5152. private static final String field_190847_u = func_190826_c("team");
  5153. private static final String field_190848_v = func_190826_c("name");
  5154. private static final String field_190849_w = func_190826_c("type");
  5155. private static final String field_190850_x = func_190826_c("tag");
  5156. private static final Predicate<String> field_190851_y = new Predicate<String>() {
  5157. public boolean apply(@Nullable String p_apply_1_) {
  5158. return p_apply_1_ != null && (EntitySelector.field_190830_d.contains(p_apply_1_) || p_apply_1_.length() > "score_".length() && p_apply_1_.startsWith("score_"));
  5159. }
  5160. };
  5161. private static final Set<String> field_179666_d = Sets.newHashSet(new String[]{field_190835_i, field_190836_j, field_190837_k, field_190838_l, field_190839_m, field_190840_n, field_190832_f, field_190831_e});
  5162.  
  5163. public static String func_190826_c(String p_190826_0_) {
  5164. field_190830_d.add(p_190826_0_);
  5165. return p_190826_0_;
  5166. }
  5167.  
  5168. @Nullable
  5169. public static EntityPlayerMP func_82386_a(ICommandSender p_82386_0_, String p_82386_1_) throws CommandException {
  5170. return (EntityPlayerMP)func_179652_a(p_82386_0_, p_82386_1_, EntityPlayerMP.class);
  5171. }
  5172.  
  5173. public static List<EntityPlayerMP> func_193531_b(ICommandSender p_193531_0_, String p_193531_1_) throws CommandException {
  5174. return func_179656_b(p_193531_0_, p_193531_1_, EntityPlayerMP.class);
  5175. }
  5176.  
  5177. @Nullable
  5178. public static <T extends Entity> T func_179652_a(ICommandSender p_179652_0_, String p_179652_1_, Class<? extends T> p_179652_2_) throws CommandException {
  5179. List<T> list = func_179656_b(p_179652_0_, p_179652_1_, p_179652_2_);
  5180. return (T)(list.size() == 1?(Entity)list.get(0):null);
  5181. }
  5182.  
  5183. @Nullable
  5184. public static ITextComponent func_150869_b(ICommandSender p_150869_0_, String p_150869_1_) throws CommandException {
  5185. List<Entity> list = func_179656_b(p_150869_0_, p_150869_1_, Entity.class);
  5186. if(list.isEmpty()) {
  5187. return null;
  5188. } else {
  5189. List<ITextComponent> list1 = Lists.<ITextComponent>newArrayList();
  5190.  
  5191. for(Entity entity : list) {
  5192. list1.add(entity.func_145748_c_());
  5193. }
  5194.  
  5195. return CommandBase.func_180530_a(list1);
  5196. }
  5197. }
  5198.  
  5199. public static <T extends Entity> List<T> func_179656_b(ICommandSender p_179656_0_, String p_179656_1_, Class<? extends T> p_179656_2_) throws CommandException {
  5200. Matcher matcher = field_82389_a.matcher(p_179656_1_);
  5201. if(matcher.matches() && p_179656_0_.func_70003_b(1, "@")) {
  5202. Map<String, String> map = func_82381_h(matcher.group(2));
  5203. if(!func_179655_b(p_179656_0_, map)) {
  5204. return Collections.<T>emptyList();
  5205. } else {
  5206. String s = matcher.group(1);
  5207. BlockPos blockpos = func_179664_b(map, p_179656_0_.func_180425_c());
  5208. Vec3d vec3d = func_189210_b(map, p_179656_0_.func_174791_d());
  5209. List<World> list = func_179654_a(p_179656_0_, map);
  5210. List<T> list1 = Lists.<T>newArrayList();
  5211.  
  5212. for(World world : list) {
  5213. if(world != null) {
  5214. List<Predicate<Entity>> list2 = Lists.<Predicate<Entity>>newArrayList();
  5215. list2.addAll(func_179663_a(map, s));
  5216. list2.addAll(func_179648_b(map));
  5217. list2.addAll(func_179649_c(map));
  5218. list2.addAll(func_179659_d(map));
  5219. list2.addAll(func_184952_c(p_179656_0_, map));
  5220. list2.addAll(func_179647_f(map));
  5221. list2.addAll(func_184951_f(map));
  5222. list2.addAll(func_180698_a(map, vec3d));
  5223. list2.addAll(func_179662_g(map));
  5224. if("s".equalsIgnoreCase(s)) {
  5225. Entity entity = p_179656_0_.func_174793_f();
  5226. if(entity != null && p_179656_2_.isAssignableFrom(entity.getClass())) {
  5227. if(map.containsKey(field_190838_l) || map.containsKey(field_190839_m) || map.containsKey(field_190840_n)) {
  5228. int i = func_179653_a(map, field_190838_l, 0);
  5229. int j = func_179653_a(map, field_190839_m, 0);
  5230. int k = func_179653_a(map, field_190840_n, 0);
  5231. AxisAlignedBB axisalignedbb = func_179661_a(blockpos, i, j, k);
  5232. if(!axisalignedbb.func_72326_a(entity.func_174813_aQ())) {
  5233. return Collections.<T>emptyList();
  5234. }
  5235. }
  5236.  
  5237. for(Predicate<Entity> predicate : list2) {
  5238. if(!predicate.apply(entity)) {
  5239. return Collections.<T>emptyList();
  5240. }
  5241. }
  5242.  
  5243. return Lists.newArrayList(new Entity[]{entity});
  5244. }
  5245.  
  5246. return Collections.<T>emptyList();
  5247. }
  5248.  
  5249. list1.addAll(func_179660_a(map, p_179656_2_, list2, s, world, blockpos));
  5250. }
  5251. }
  5252.  
  5253. return func_179658_a(list1, map, p_179656_0_, p_179656_2_, s, vec3d);
  5254. }
  5255. } else {
  5256. return Collections.<T>emptyList();
  5257. }
  5258. }
  5259.  
  5260. private static List<World> func_179654_a(ICommandSender p_179654_0_, Map<String, String> p_179654_1_) {
  5261. List<World> list = Lists.<World>newArrayList();
  5262. if(func_179665_h(p_179654_1_)) {
  5263. list.add(p_179654_0_.func_130014_f_());
  5264. } else {
  5265. Collections.addAll(list, p_179654_0_.func_184102_h().field_71305_c);
  5266. }
  5267.  
  5268. return list;
  5269. }
  5270.  
  5271. private static <T extends Entity> boolean func_179655_b(ICommandSender p_179655_0_, Map<String, String> p_179655_1_) {
  5272. String s = func_179651_b(p_179655_1_, field_190849_w);
  5273. if(s == null) {
  5274. return true;
  5275. } else {
  5276. ResourceLocation resourcelocation = new ResourceLocation(s.startsWith("!")?s.substring(1):s);
  5277. if(EntityList.func_180125_b(resourcelocation)) {
  5278. return true;
  5279. } else {
  5280. TextComponentTranslation textcomponenttranslation = new TextComponentTranslation("commands.generic.entity.invalidType", new Object[]{resourcelocation});
  5281. textcomponenttranslation.func_150256_b().func_150238_a(TextFormatting.RED);
  5282. p_179655_0_.func_145747_a(textcomponenttranslation);
  5283. return false;
  5284. }
  5285. }
  5286. }
  5287.  
  5288. private static List<Predicate<Entity>> func_179663_a(Map<String, String> p_179663_0_, String p_179663_1_) {
  5289. String s = func_179651_b(p_179663_0_, field_190849_w);
  5290. if(s == null || !p_179663_1_.equals("e") && !p_179663_1_.equals("r") && !p_179663_1_.equals("s")) {
  5291. return !p_179663_1_.equals("e") && !p_179663_1_.equals("s")?Collections.singletonList(new Predicate<Entity>() {
  5292. public boolean apply(@Nullable Entity p_apply_1_) {
  5293. return p_apply_1_ instanceof EntityPlayer;
  5294. }
  5295. }):Collections.emptyList();
  5296. } else {
  5297. final boolean flag = s.startsWith("!");
  5298. final ResourceLocation resourcelocation = new ResourceLocation(flag?s.substring(1):s);
  5299. return Collections.singletonList(new Predicate<Entity>() {
  5300. public boolean apply(@Nullable Entity p_apply_1_) {
  5301. return EntityList.func_180123_a(p_apply_1_, resourcelocation) != flag;
  5302. }
  5303. });
  5304. }
  5305. }
  5306.  
  5307. private static List<Predicate<Entity>> func_179648_b(Map<String, String> p_179648_0_) {
  5308. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  5309. final int i = func_179653_a(p_179648_0_, field_190834_h, -1);
  5310. final int j = func_179653_a(p_179648_0_, field_190833_g, -1);
  5311. if(i > -1 || j > -1) {
  5312. list.add(new Predicate<Entity>() {
  5313. public boolean apply(@Nullable Entity p_apply_1_) {
  5314. if(!(p_apply_1_ instanceof EntityPlayerMP)) {
  5315. return false;
  5316. } else {
  5317. EntityPlayerMP entityplayermp = (EntityPlayerMP)p_apply_1_;
  5318. return (i <= -1 || entityplayermp.field_71068_ca >= i) && (j <= -1 || entityplayermp.field_71068_ca <= j);
  5319. }
  5320. }
  5321. });
  5322. }
  5323.  
  5324. return list;
  5325. }
  5326.  
  5327. private static List<Predicate<Entity>> func_179649_c(Map<String, String> p_179649_0_) {
  5328. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  5329. String s = func_179651_b(p_179649_0_, field_190846_t);
  5330. if(s == null) {
  5331. return list;
  5332. } else {
  5333. final boolean flag = s.startsWith("!");
  5334. if(flag) {
  5335. s = s.substring(1);
  5336. }
  5337.  
  5338. final GameType gametype;
  5339. try {
  5340. int i = Integer.parseInt(s);
  5341. gametype = GameType.func_185329_a(i, GameType.NOT_SET);
  5342. } catch (Throwable var6) {
  5343. gametype = GameType.func_185328_a(s, GameType.NOT_SET);
  5344. }
  5345.  
  5346. list.add(new Predicate<Entity>() {
  5347. public boolean apply(@Nullable Entity p_apply_1_) {
  5348. if(!(p_apply_1_ instanceof EntityPlayerMP)) {
  5349. return false;
  5350. } else {
  5351. EntityPlayerMP entityplayermp = (EntityPlayerMP)p_apply_1_;
  5352. GameType gametype1 = entityplayermp.field_71134_c.func_73081_b();
  5353. return flag?gametype1 != gametype:gametype1 == gametype;
  5354. }
  5355. }
  5356. });
  5357. return list;
  5358. }
  5359. }
  5360.  
  5361. private static List<Predicate<Entity>> func_179659_d(Map<String, String> p_179659_0_) {
  5362. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  5363. final String s = func_179651_b(p_179659_0_, field_190847_u);
  5364. final boolean flag = s != null && s.startsWith("!");
  5365. if(flag) {
  5366. s = s.substring(1);
  5367. }
  5368.  
  5369. if(s != null) {
  5370. list.add(new Predicate<Entity>() {
  5371. public boolean apply(@Nullable Entity p_apply_1_) {
  5372. if(!(p_apply_1_ instanceof EntityLivingBase)) {
  5373. return false;
  5374. } else {
  5375. EntityLivingBase entitylivingbase = (EntityLivingBase)p_apply_1_;
  5376. Team team = entitylivingbase.func_96124_cp();
  5377. String s1 = team == null?"":team.func_96661_b();
  5378. return s1.equals(s) != flag;
  5379. }
  5380. }
  5381. });
  5382. }
  5383.  
  5384. return list;
  5385. }
  5386.  
  5387. private static List<Predicate<Entity>> func_184952_c(final ICommandSender p_184952_0_, Map<String, String> p_184952_1_) {
  5388. final Map<String, Integer> map = func_96560_a(p_184952_1_);
  5389. return (List<Predicate<Entity>>)(map.isEmpty()?Collections.emptyList():Lists.newArrayList(new Predicate[]{new Predicate<Entity>() {
  5390. public boolean apply(@Nullable Entity p_apply_1_) {
  5391. if(p_apply_1_ == null) {
  5392. return false;
  5393. } else {
  5394. Scoreboard scoreboard = p_184952_0_.func_184102_h().func_71218_a(0).func_96441_U();
  5395.  
  5396. for(Entry<String, Integer> entry : map.entrySet()) {
  5397. String s = (String)entry.getKey();
  5398. boolean flag = false;
  5399. if(s.endsWith("_min") && s.length() > 4) {
  5400. flag = true;
  5401. s = s.substring(0, s.length() - 4);
  5402. }
  5403.  
  5404. ScoreObjective scoreobjective = scoreboard.func_96518_b(s);
  5405. if(scoreobjective == null) {
  5406. return false;
  5407. }
  5408.  
  5409. String s1 = p_apply_1_ instanceof EntityPlayerMP?p_apply_1_.func_70005_c_():p_apply_1_.func_189512_bd();
  5410. if(!scoreboard.func_178819_b(s1, scoreobjective)) {
  5411. return false;
  5412. }
  5413.  
  5414. Score score = scoreboard.func_96529_a(s1, scoreobjective);
  5415. int i = score.func_96652_c();
  5416. if(i < ((Integer)entry.getValue()).intValue() && flag) {
  5417. return false;
  5418. }
  5419.  
  5420. if(i > ((Integer)entry.getValue()).intValue() && !flag) {
  5421. return false;
  5422. }
  5423. }
  5424.  
  5425. return true;
  5426. }
  5427. }
  5428. }}));
  5429. }
  5430.  
  5431. private static List<Predicate<Entity>> func_179647_f(Map<String, String> p_179647_0_) {
  5432. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  5433. final String s = func_179651_b(p_179647_0_, field_190848_v);
  5434. final boolean flag = s != null && s.startsWith("!");
  5435. if(flag) {
  5436. s = s.substring(1);
  5437. }
  5438.  
  5439. if(s != null) {
  5440. list.add(new Predicate<Entity>() {
  5441. public boolean apply(@Nullable Entity p_apply_1_) {
  5442. return p_apply_1_ != null && p_apply_1_.func_70005_c_().equals(s) != flag;
  5443. }
  5444. });
  5445. }
  5446.  
  5447. return list;
  5448. }
  5449.  
  5450. private static List<Predicate<Entity>> func_184951_f(Map<String, String> p_184951_0_) {
  5451. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  5452. final String s = func_179651_b(p_184951_0_, field_190850_x);
  5453. final boolean flag = s != null && s.startsWith("!");
  5454. if(flag) {
  5455. s = s.substring(1);
  5456. }
  5457.  
  5458. if(s != null) {
  5459. list.add(new Predicate<Entity>() {
  5460. public boolean apply(@Nullable Entity p_apply_1_) {
  5461. return p_apply_1_ == null?false:("".equals(s)?p_apply_1_.func_184216_O().isEmpty() != flag:p_apply_1_.func_184216_O().contains(s) != flag);
  5462. }
  5463. });
  5464. }
  5465.  
  5466. return list;
  5467. }
  5468.  
  5469. private static List<Predicate<Entity>> func_180698_a(Map<String, String> p_180698_0_, final Vec3d p_180698_1_) {
  5470. double d0 = (double)func_179653_a(p_180698_0_, field_190832_f, -1);
  5471. double d1 = (double)func_179653_a(p_180698_0_, field_190831_e, -1);
  5472. final boolean flag = d0 < -0.5D;
  5473. final boolean flag1 = d1 < -0.5D;
  5474. if(flag && flag1) {
  5475. return Collections.<Predicate<Entity>>emptyList();
  5476. } else {
  5477. double d2 = Math.max(d0, 1.0E-4D);
  5478. final double d3 = d2 * d2;
  5479. double d4 = Math.max(d1, 1.0E-4D);
  5480. final double d5 = d4 * d4;
  5481. return Lists.newArrayList(new Predicate[]{new Predicate<Entity>() {
  5482. public boolean apply(@Nullable Entity p_apply_1_) {
  5483. if(p_apply_1_ == null) {
  5484. return false;
  5485. } else {
  5486. double d6 = p_180698_1_.func_186679_c(p_apply_1_.field_70165_t, p_apply_1_.field_70163_u, p_apply_1_.field_70161_v);
  5487. return (flag || d6 >= d3) && (flag1 || d6 <= d5);
  5488. }
  5489. }
  5490. }});
  5491. }
  5492. }
  5493.  
  5494. private static List<Predicate<Entity>> func_179662_g(Map<String, String> p_179662_0_) {
  5495. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  5496. if(p_179662_0_.containsKey(field_190844_r) || p_179662_0_.containsKey(field_190843_q)) {
  5497. final int i = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190844_r, 0));
  5498. final int j = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190843_q, 359));
  5499. list.add(new Predicate<Entity>() {
  5500. public boolean apply(@Nullable Entity p_apply_1_) {
  5501. if(p_apply_1_ == null) {
  5502. return false;
  5503. } else {
  5504. int i1 = MathHelper.func_188209_b(MathHelper.func_76141_d(p_apply_1_.field_70177_z));
  5505. return i > j?i1 >= i || i1 <= j:i1 >= i && i1 <= j;
  5506. }
  5507. }
  5508. });
  5509. }
  5510.  
  5511. if(p_179662_0_.containsKey(field_190842_p) || p_179662_0_.containsKey(field_190841_o)) {
  5512. final int k = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190842_p, 0));
  5513. final int l = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190841_o, 359));
  5514. list.add(new Predicate<Entity>() {
  5515. public boolean apply(@Nullable Entity p_apply_1_) {
  5516. if(p_apply_1_ == null) {
  5517. return false;
  5518. } else {
  5519. int i1 = MathHelper.func_188209_b(MathHelper.func_76141_d(p_apply_1_.field_70125_A));
  5520. return k > l?i1 >= k || i1 <= l:i1 >= k && i1 <= l;
  5521. }
  5522. }
  5523. });
  5524. }
  5525.  
  5526. return list;
  5527. }
  5528.  
  5529. private static <T extends Entity> List<T> func_179660_a(Map<String, String> p_179660_0_, Class<? extends T> p_179660_1_, List<Predicate<Entity>> p_179660_2_, String p_179660_3_, World p_179660_4_, BlockPos p_179660_5_) {
  5530. List<T> list = Lists.<T>newArrayList();
  5531. String s = func_179651_b(p_179660_0_, field_190849_w);
  5532. s = s != null && s.startsWith("!")?s.substring(1):s;
  5533. boolean flag = !p_179660_3_.equals("e");
  5534. boolean flag1 = p_179660_3_.equals("r") && s != null;
  5535. int i = func_179653_a(p_179660_0_, field_190838_l, 0);
  5536. int j = func_179653_a(p_179660_0_, field_190839_m, 0);
  5537. int k = func_179653_a(p_179660_0_, field_190840_n, 0);
  5538. int l = func_179653_a(p_179660_0_, field_190831_e, -1);
  5539. Predicate<Entity> predicate = Predicates.and(p_179660_2_);
  5540. Predicate<Entity> predicate1 = Predicates.<Entity>and(EntitySelectors.field_94557_a, predicate);
  5541. if(!p_179660_0_.containsKey(field_190838_l) && !p_179660_0_.containsKey(field_190839_m) && !p_179660_0_.containsKey(field_190840_n)) {
  5542. if(l >= 0) {
  5543. AxisAlignedBB axisalignedbb1 = new AxisAlignedBB((double)(p_179660_5_.func_177958_n() - l), (double)(p_179660_5_.func_177956_o() - l), (double)(p_179660_5_.func_177952_p() - l), (double)(p_179660_5_.func_177958_n() + l + 1), (double)(p_179660_5_.func_177956_o() + l + 1), (double)(p_179660_5_.func_177952_p() + l + 1));
  5544. if(flag && !flag1) {
  5545. list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate1));
  5546. } else {
  5547. list.addAll(p_179660_4_.<T>func_175647_a(p_179660_1_, axisalignedbb1, predicate1));
  5548. }
  5549. } else if(p_179660_3_.equals("a")) {
  5550. list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate));
  5551. } else if(!p_179660_3_.equals("p") && (!p_179660_3_.equals("r") || flag1)) {
  5552. list.addAll(p_179660_4_.<T>func_175644_a(p_179660_1_, predicate1));
  5553. } else {
  5554. list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate1));
  5555. }
  5556. } else {
  5557. final AxisAlignedBB axisalignedbb = func_179661_a(p_179660_5_, i, j, k);
  5558. if(flag && !flag1) {
  5559. Predicate<Entity> predicate2 = new Predicate<Entity>() {
  5560. public boolean apply(@Nullable Entity p_apply_1_) {
  5561. return p_apply_1_ != null && axisalignedbb.func_72326_a(p_apply_1_.func_174813_aQ());
  5562. }
  5563. };
  5564. list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, Predicates.<T>and(predicate1, predicate2)));
  5565. } else {
  5566. list.addAll(p_179660_4_.<T>func_175647_a(p_179660_1_, axisalignedbb, predicate1));
  5567. }
  5568. }
  5569.  
  5570. return list;
  5571. }
  5572.  
  5573. private static <T extends Entity> List<T> func_179658_a(List<T> p_179658_0_, Map<String, String> p_179658_1_, ICommandSender p_179658_2_, Class<? extends T> p_179658_3_, String p_179658_4_, final Vec3d p_179658_5_) {
  5574. int i = func_179653_a(p_179658_1_, field_190845_s, !p_179658_4_.equals("a") && !p_179658_4_.equals("e")?1:0);
  5575. if(!p_179658_4_.equals("p") && !p_179658_4_.equals("a") && !p_179658_4_.equals("e")) {
  5576. if(p_179658_4_.equals("r")) {
  5577. Collections.shuffle((List<?>)p_179658_0_);
  5578. }
  5579. } else {
  5580. Collections.sort((List<T>)p_179658_0_, new Comparator<Entity>() {
  5581. public int compare(Entity p_compare_1_, Entity p_compare_2_) {
  5582. return ComparisonChain.start().compare(p_compare_1_.func_70092_e(p_179658_5_.field_72450_a, p_179658_5_.field_72448_b, p_179658_5_.field_72449_c), p_compare_2_.func_70092_e(p_179658_5_.field_72450_a, p_179658_5_.field_72448_b, p_179658_5_.field_72449_c)).result();
  5583. }
  5584. });
  5585. }
  5586.  
  5587. Entity entity = p_179658_2_.func_174793_f();
  5588. if(entity != null && p_179658_3_.isAssignableFrom(entity.getClass()) && i == 1 && ((List)p_179658_0_).contains(entity) && !"r".equals(p_179658_4_)) {
  5589. p_179658_0_ = Lists.newArrayList(new Entity[]{entity});
  5590. }
  5591.  
  5592. if(i != 0) {
  5593. if(i < 0) {
  5594. Collections.reverse((List<?>)p_179658_0_);
  5595. }
  5596.  
  5597. p_179658_0_ = ((List)p_179658_0_).subList(0, Math.min(Math.abs(i), ((List)p_179658_0_).size()));
  5598. }
  5599.  
  5600. return (List)p_179658_0_;
  5601. }
  5602.  
  5603. private static AxisAlignedBB func_179661_a(BlockPos p_179661_0_, int p_179661_1_, int p_179661_2_, int p_179661_3_) {
  5604. boolean flag = p_179661_1_ < 0;
  5605. boolean flag1 = p_179661_2_ < 0;
  5606. boolean flag2 = p_179661_3_ < 0;
  5607. int i = p_179661_0_.func_177958_n() + (flag?p_179661_1_:0);
  5608. int j = p_179661_0_.func_177956_o() + (flag1?p_179661_2_:0);
  5609. int k = p_179661_0_.func_177952_p() + (flag2?p_179661_3_:0);
  5610. int l = p_179661_0_.func_177958_n() + (flag?0:p_179661_1_) + 1;
  5611. int i1 = p_179661_0_.func_177956_o() + (flag1?0:p_179661_2_) + 1;
  5612. int j1 = p_179661_0_.func_177952_p() + (flag2?0:p_179661_3_) + 1;
  5613. return new AxisAlignedBB((double)i, (double)j, (double)k, (double)l, (double)i1, (double)j1);
  5614. }
  5615.  
  5616. private static BlockPos func_179664_b(Map<String, String> p_179664_0_, BlockPos p_179664_1_) {
  5617. return new BlockPos(func_179653_a(p_179664_0_, field_190835_i, p_179664_1_.func_177958_n()), func_179653_a(p_179664_0_, field_190836_j, p_179664_1_.func_177956_o()), func_179653_a(p_179664_0_, field_190837_k, p_179664_1_.func_177952_p()));
  5618. }
  5619.  
  5620. private static Vec3d func_189210_b(Map<String, String> p_189210_0_, Vec3d p_189210_1_) {
  5621. return new Vec3d(func_189211_a(p_189210_0_, field_190835_i, p_189210_1_.field_72450_a, true), func_189211_a(p_189210_0_, field_190836_j, p_189210_1_.field_72448_b, false), func_189211_a(p_189210_0_, field_190837_k, p_189210_1_.field_72449_c, true));
  5622. }
  5623.  
  5624. private static double func_189211_a(Map<String, String> p_189211_0_, String p_189211_1_, double p_189211_2_, boolean p_189211_4_) {
  5625. return p_189211_0_.containsKey(p_189211_1_)?(double)MathHelper.func_82715_a((String)p_189211_0_.get(p_189211_1_), MathHelper.func_76128_c(p_189211_2_)) + (p_189211_4_?0.5D:0.0D):p_189211_2_;
  5626. }
  5627.  
  5628. private static boolean func_179665_h(Map<String, String> p_179665_0_) {
  5629. for(String s : field_179666_d) {
  5630. if(p_179665_0_.containsKey(s)) {
  5631. return true;
  5632. }
  5633. }
  5634.  
  5635. return false;
  5636. }
  5637.  
  5638. private static int func_179653_a(Map<String, String> p_179653_0_, String p_179653_1_, int p_179653_2_) {
  5639. return p_179653_0_.containsKey(p_179653_1_)?MathHelper.func_82715_a((String)p_179653_0_.get(p_179653_1_), p_179653_2_):p_179653_2_;
  5640. }
  5641.  
  5642. @Nullable
  5643. private static String func_179651_b(Map<String, String> p_179651_0_, String p_179651_1_) {
  5644. return (String)p_179651_0_.get(p_179651_1_);
  5645. }
  5646.  
  5647. public static Map<String, Integer> func_96560_a(Map<String, String> p_96560_0_) {
  5648. Map<String, Integer> map = Maps.<String, Integer>newHashMap();
  5649.  
  5650. for(String s : p_96560_0_.keySet()) {
  5651. if(s.startsWith("score_") && s.length() > "score_".length()) {
  5652. map.put(s.substring("score_".length()), Integer.valueOf(MathHelper.func_82715_a((String)p_96560_0_.get(s), 1)));
  5653. }
  5654. }
  5655.  
  5656. return map;
  5657. }
  5658.  
  5659. public static boolean func_82377_a(String p_82377_0_) throws CommandException {
  5660. Matcher matcher = field_82389_a.matcher(p_82377_0_);
  5661. if(!matcher.matches()) {
  5662. return false;
  5663. } else {
  5664. Map<String, String> map = func_82381_h(matcher.group(2));
  5665. String s = matcher.group(1);
  5666. int i = !"a".equals(s) && !"e".equals(s)?1:0;
  5667. return func_179653_a(map, field_190845_s, i) != 1;
  5668. }
  5669. }
  5670.  
  5671. public static boolean func_82378_b(String p_82378_0_) {
  5672. return field_82389_a.matcher(p_82378_0_).matches();
  5673. }
  5674.  
  5675. private static Map<String, String> func_82381_h(@Nullable String p_82381_0_) throws CommandException {
  5676. Map<String, String> map = Maps.<String, String>newHashMap();
  5677. if(p_82381_0_ == null) {
  5678. return map;
  5679. } else {
  5680. for(String s : field_190828_b.split(p_82381_0_)) {
  5681. Iterator<String> iterator = field_190829_c.split(s).iterator();
  5682. String s1 = (String)iterator.next();
  5683. if(!field_190851_y.apply(s1)) {
  5684. throw new CommandException("commands.generic.selector_argument", new Object[]{s});
  5685. }
  5686.  
  5687. map.put(s1, iterator.hasNext()?(String)iterator.next():"");
  5688. }
  5689.  
  5690. return map;
  5691. }
  5692. }
  5693. }
  5694.  
  5695. Hunk 8 failed! Cannot find hunk target
  5696.  
  5697. private static List<Predicate<Entity>> func_184951_f(Map<String, String> p_184951_0_) {
  5698. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  5699. - final String s = func_179651_b(p_184951_0_, field_190850_x);
  5700. + String s = func_179651_b(p_184951_0_, field_190850_x);
  5701. final boolean flag = s != null && s.startsWith("!");
  5702. if (flag) {
  5703. s = s.substring(1);
  5704. }
  5705.  
  5706. if (s != null) {
  5707. + final String s_f_ = s;
  5708. list.add(new Predicate<Entity>() {
  5709. public boolean apply(@Nullable Entity p_apply_1_) {
  5710. if (p_apply_1_ == null) {
  5711. return false;
  5712. - } else if ("".equals(s)) {
  5713. + } else if ("".equals(s_f_)) {
  5714. return p_apply_1_.func_184216_O().isEmpty() != flag;
  5715. } else {
  5716. - return p_apply_1_.func_184216_O().contains(s) != flag;
  5717. + return p_apply_1_.func_184216_O().contains(s_f_) != flag;
  5718. }
  5719. }
  5720. });
  5721. File state
  5722. package net.minecraft.command;
  5723.  
  5724. import com.google.common.base.Predicate;
  5725. import com.google.common.base.Predicates;
  5726. import com.google.common.base.Splitter;
  5727. import com.google.common.collect.ComparisonChain;
  5728. import com.google.common.collect.Lists;
  5729. import com.google.common.collect.Maps;
  5730. import com.google.common.collect.Sets;
  5731. import java.util.Collections;
  5732. import java.util.Comparator;
  5733. import java.util.Iterator;
  5734. import java.util.List;
  5735. import java.util.Map;
  5736. import java.util.Set;
  5737. import java.util.Map.Entry;
  5738. import java.util.regex.Matcher;
  5739. import java.util.regex.Pattern;
  5740. import javax.annotation.Nullable;
  5741. import net.minecraft.command.CommandBase;
  5742. import net.minecraft.command.CommandException;
  5743. import net.minecraft.command.ICommandSender;
  5744. import net.minecraft.entity.Entity;
  5745. import net.minecraft.entity.EntityList;
  5746. import net.minecraft.entity.EntityLivingBase;
  5747. import net.minecraft.entity.player.EntityPlayer;
  5748. import net.minecraft.entity.player.EntityPlayerMP;
  5749. import net.minecraft.scoreboard.Score;
  5750. import net.minecraft.scoreboard.ScoreObjective;
  5751. import net.minecraft.scoreboard.Scoreboard;
  5752. import net.minecraft.scoreboard.Team;
  5753. import net.minecraft.util.EntitySelectors;
  5754. import net.minecraft.util.ResourceLocation;
  5755. import net.minecraft.util.math.AxisAlignedBB;
  5756. import net.minecraft.util.math.BlockPos;
  5757. import net.minecraft.util.math.MathHelper;
  5758. import net.minecraft.util.math.Vec3d;
  5759. import net.minecraft.util.text.ITextComponent;
  5760. import net.minecraft.util.text.TextComponentTranslation;
  5761. import net.minecraft.util.text.TextFormatting;
  5762. import net.minecraft.world.GameType;
  5763. import net.minecraft.world.World;
  5764.  
  5765. public class EntitySelector {
  5766. private static final Pattern field_82389_a = Pattern.compile("^@([pares])(?:\\[([^ ]*)\\])?$");
  5767. private static final Splitter field_190828_b = Splitter.on(',').omitEmptyStrings();
  5768. private static final Splitter field_190829_c = Splitter.on('=').limit(2);
  5769. private static final Set<String> field_190830_d = Sets.<String>newHashSet();
  5770. private static final String field_190831_e = func_190826_c("r");
  5771. private static final String field_190832_f = func_190826_c("rm");
  5772. private static final String field_190833_g = func_190826_c("l");
  5773. private static final String field_190834_h = func_190826_c("lm");
  5774. private static final String field_190835_i = func_190826_c("x");
  5775. private static final String field_190836_j = func_190826_c("y");
  5776. private static final String field_190837_k = func_190826_c("z");
  5777. private static final String field_190838_l = func_190826_c("dx");
  5778. private static final String field_190839_m = func_190826_c("dy");
  5779. private static final String field_190840_n = func_190826_c("dz");
  5780. private static final String field_190841_o = func_190826_c("rx");
  5781. private static final String field_190842_p = func_190826_c("rxm");
  5782. private static final String field_190843_q = func_190826_c("ry");
  5783. private static final String field_190844_r = func_190826_c("rym");
  5784. private static final String field_190845_s = func_190826_c("c");
  5785. private static final String field_190846_t = func_190826_c("m");
  5786. private static final String field_190847_u = func_190826_c("team");
  5787. private static final String field_190848_v = func_190826_c("name");
  5788. private static final String field_190849_w = func_190826_c("type");
  5789. private static final String field_190850_x = func_190826_c("tag");
  5790. private static final Predicate<String> field_190851_y = new Predicate<String>() {
  5791. public boolean apply(@Nullable String p_apply_1_) {
  5792. return p_apply_1_ != null && (EntitySelector.field_190830_d.contains(p_apply_1_) || p_apply_1_.length() > "score_".length() && p_apply_1_.startsWith("score_"));
  5793. }
  5794. };
  5795. private static final Set<String> field_179666_d = Sets.newHashSet(new String[]{field_190835_i, field_190836_j, field_190837_k, field_190838_l, field_190839_m, field_190840_n, field_190832_f, field_190831_e});
  5796.  
  5797. public static String func_190826_c(String p_190826_0_) {
  5798. field_190830_d.add(p_190826_0_);
  5799. return p_190826_0_;
  5800. }
  5801.  
  5802. @Nullable
  5803. public static EntityPlayerMP func_82386_a(ICommandSender p_82386_0_, String p_82386_1_) throws CommandException {
  5804. return (EntityPlayerMP)func_179652_a(p_82386_0_, p_82386_1_, EntityPlayerMP.class);
  5805. }
  5806.  
  5807. public static List<EntityPlayerMP> func_193531_b(ICommandSender p_193531_0_, String p_193531_1_) throws CommandException {
  5808. return func_179656_b(p_193531_0_, p_193531_1_, EntityPlayerMP.class);
  5809. }
  5810.  
  5811. @Nullable
  5812. public static <T extends Entity> T func_179652_a(ICommandSender p_179652_0_, String p_179652_1_, Class<? extends T> p_179652_2_) throws CommandException {
  5813. List<T> list = func_179656_b(p_179652_0_, p_179652_1_, p_179652_2_);
  5814. return (T)(list.size() == 1?(Entity)list.get(0):null);
  5815. }
  5816.  
  5817. @Nullable
  5818. public static ITextComponent func_150869_b(ICommandSender p_150869_0_, String p_150869_1_) throws CommandException {
  5819. List<Entity> list = func_179656_b(p_150869_0_, p_150869_1_, Entity.class);
  5820. if(list.isEmpty()) {
  5821. return null;
  5822. } else {
  5823. List<ITextComponent> list1 = Lists.<ITextComponent>newArrayList();
  5824.  
  5825. for(Entity entity : list) {
  5826. list1.add(entity.func_145748_c_());
  5827. }
  5828.  
  5829. return CommandBase.func_180530_a(list1);
  5830. }
  5831. }
  5832.  
  5833. public static <T extends Entity> List<T> func_179656_b(ICommandSender p_179656_0_, String p_179656_1_, Class<? extends T> p_179656_2_) throws CommandException {
  5834. Matcher matcher = field_82389_a.matcher(p_179656_1_);
  5835. if(matcher.matches() && p_179656_0_.func_70003_b(1, "@")) {
  5836. Map<String, String> map = func_82381_h(matcher.group(2));
  5837. if(!func_179655_b(p_179656_0_, map)) {
  5838. return Collections.<T>emptyList();
  5839. } else {
  5840. String s = matcher.group(1);
  5841. BlockPos blockpos = func_179664_b(map, p_179656_0_.func_180425_c());
  5842. Vec3d vec3d = func_189210_b(map, p_179656_0_.func_174791_d());
  5843. List<World> list = func_179654_a(p_179656_0_, map);
  5844. List<T> list1 = Lists.<T>newArrayList();
  5845.  
  5846. for(World world : list) {
  5847. if(world != null) {
  5848. List<Predicate<Entity>> list2 = Lists.<Predicate<Entity>>newArrayList();
  5849. list2.addAll(func_179663_a(map, s));
  5850. list2.addAll(func_179648_b(map));
  5851. list2.addAll(func_179649_c(map));
  5852. list2.addAll(func_179659_d(map));
  5853. list2.addAll(func_184952_c(p_179656_0_, map));
  5854. list2.addAll(func_179647_f(map));
  5855. list2.addAll(func_184951_f(map));
  5856. list2.addAll(func_180698_a(map, vec3d));
  5857. list2.addAll(func_179662_g(map));
  5858. if("s".equalsIgnoreCase(s)) {
  5859. Entity entity = p_179656_0_.func_174793_f();
  5860. if(entity != null && p_179656_2_.isAssignableFrom(entity.getClass())) {
  5861. if(map.containsKey(field_190838_l) || map.containsKey(field_190839_m) || map.containsKey(field_190840_n)) {
  5862. int i = func_179653_a(map, field_190838_l, 0);
  5863. int j = func_179653_a(map, field_190839_m, 0);
  5864. int k = func_179653_a(map, field_190840_n, 0);
  5865. AxisAlignedBB axisalignedbb = func_179661_a(blockpos, i, j, k);
  5866. if(!axisalignedbb.func_72326_a(entity.func_174813_aQ())) {
  5867. return Collections.<T>emptyList();
  5868. }
  5869. }
  5870.  
  5871. for(Predicate<Entity> predicate : list2) {
  5872. if(!predicate.apply(entity)) {
  5873. return Collections.<T>emptyList();
  5874. }
  5875. }
  5876.  
  5877. return Lists.newArrayList(new Entity[]{entity});
  5878. }
  5879.  
  5880. return Collections.<T>emptyList();
  5881. }
  5882.  
  5883. list1.addAll(func_179660_a(map, p_179656_2_, list2, s, world, blockpos));
  5884. }
  5885. }
  5886.  
  5887. return func_179658_a(list1, map, p_179656_0_, p_179656_2_, s, vec3d);
  5888. }
  5889. } else {
  5890. return Collections.<T>emptyList();
  5891. }
  5892. }
  5893.  
  5894. private static List<World> func_179654_a(ICommandSender p_179654_0_, Map<String, String> p_179654_1_) {
  5895. List<World> list = Lists.<World>newArrayList();
  5896. if(func_179665_h(p_179654_1_)) {
  5897. list.add(p_179654_0_.func_130014_f_());
  5898. } else {
  5899. Collections.addAll(list, p_179654_0_.func_184102_h().field_71305_c);
  5900. }
  5901.  
  5902. return list;
  5903. }
  5904.  
  5905. private static <T extends Entity> boolean func_179655_b(ICommandSender p_179655_0_, Map<String, String> p_179655_1_) {
  5906. String s = func_179651_b(p_179655_1_, field_190849_w);
  5907. if(s == null) {
  5908. return true;
  5909. } else {
  5910. ResourceLocation resourcelocation = new ResourceLocation(s.startsWith("!")?s.substring(1):s);
  5911. if(EntityList.func_180125_b(resourcelocation)) {
  5912. return true;
  5913. } else {
  5914. TextComponentTranslation textcomponenttranslation = new TextComponentTranslation("commands.generic.entity.invalidType", new Object[]{resourcelocation});
  5915. textcomponenttranslation.func_150256_b().func_150238_a(TextFormatting.RED);
  5916. p_179655_0_.func_145747_a(textcomponenttranslation);
  5917. return false;
  5918. }
  5919. }
  5920. }
  5921.  
  5922. private static List<Predicate<Entity>> func_179663_a(Map<String, String> p_179663_0_, String p_179663_1_) {
  5923. String s = func_179651_b(p_179663_0_, field_190849_w);
  5924. if(s == null || !p_179663_1_.equals("e") && !p_179663_1_.equals("r") && !p_179663_1_.equals("s")) {
  5925. return !p_179663_1_.equals("e") && !p_179663_1_.equals("s")?Collections.singletonList(new Predicate<Entity>() {
  5926. public boolean apply(@Nullable Entity p_apply_1_) {
  5927. return p_apply_1_ instanceof EntityPlayer;
  5928. }
  5929. }):Collections.emptyList();
  5930. } else {
  5931. final boolean flag = s.startsWith("!");
  5932. final ResourceLocation resourcelocation = new ResourceLocation(flag?s.substring(1):s);
  5933. return Collections.singletonList(new Predicate<Entity>() {
  5934. public boolean apply(@Nullable Entity p_apply_1_) {
  5935. return EntityList.func_180123_a(p_apply_1_, resourcelocation) != flag;
  5936. }
  5937. });
  5938. }
  5939. }
  5940.  
  5941. private static List<Predicate<Entity>> func_179648_b(Map<String, String> p_179648_0_) {
  5942. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  5943. final int i = func_179653_a(p_179648_0_, field_190834_h, -1);
  5944. final int j = func_179653_a(p_179648_0_, field_190833_g, -1);
  5945. if(i > -1 || j > -1) {
  5946. list.add(new Predicate<Entity>() {
  5947. public boolean apply(@Nullable Entity p_apply_1_) {
  5948. if(!(p_apply_1_ instanceof EntityPlayerMP)) {
  5949. return false;
  5950. } else {
  5951. EntityPlayerMP entityplayermp = (EntityPlayerMP)p_apply_1_;
  5952. return (i <= -1 || entityplayermp.field_71068_ca >= i) && (j <= -1 || entityplayermp.field_71068_ca <= j);
  5953. }
  5954. }
  5955. });
  5956. }
  5957.  
  5958. return list;
  5959. }
  5960.  
  5961. private static List<Predicate<Entity>> func_179649_c(Map<String, String> p_179649_0_) {
  5962. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  5963. String s = func_179651_b(p_179649_0_, field_190846_t);
  5964. if(s == null) {
  5965. return list;
  5966. } else {
  5967. final boolean flag = s.startsWith("!");
  5968. if(flag) {
  5969. s = s.substring(1);
  5970. }
  5971.  
  5972. final GameType gametype;
  5973. try {
  5974. int i = Integer.parseInt(s);
  5975. gametype = GameType.func_185329_a(i, GameType.NOT_SET);
  5976. } catch (Throwable var6) {
  5977. gametype = GameType.func_185328_a(s, GameType.NOT_SET);
  5978. }
  5979.  
  5980. list.add(new Predicate<Entity>() {
  5981. public boolean apply(@Nullable Entity p_apply_1_) {
  5982. if(!(p_apply_1_ instanceof EntityPlayerMP)) {
  5983. return false;
  5984. } else {
  5985. EntityPlayerMP entityplayermp = (EntityPlayerMP)p_apply_1_;
  5986. GameType gametype1 = entityplayermp.field_71134_c.func_73081_b();
  5987. return flag?gametype1 != gametype:gametype1 == gametype;
  5988. }
  5989. }
  5990. });
  5991. return list;
  5992. }
  5993. }
  5994.  
  5995. private static List<Predicate<Entity>> func_179659_d(Map<String, String> p_179659_0_) {
  5996. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  5997. final String s = func_179651_b(p_179659_0_, field_190847_u);
  5998. final boolean flag = s != null && s.startsWith("!");
  5999. if(flag) {
  6000. s = s.substring(1);
  6001. }
  6002.  
  6003. if(s != null) {
  6004. list.add(new Predicate<Entity>() {
  6005. public boolean apply(@Nullable Entity p_apply_1_) {
  6006. if(!(p_apply_1_ instanceof EntityLivingBase)) {
  6007. return false;
  6008. } else {
  6009. EntityLivingBase entitylivingbase = (EntityLivingBase)p_apply_1_;
  6010. Team team = entitylivingbase.func_96124_cp();
  6011. String s1 = team == null?"":team.func_96661_b();
  6012. return s1.equals(s) != flag;
  6013. }
  6014. }
  6015. });
  6016. }
  6017.  
  6018. return list;
  6019. }
  6020.  
  6021. private static List<Predicate<Entity>> func_184952_c(final ICommandSender p_184952_0_, Map<String, String> p_184952_1_) {
  6022. final Map<String, Integer> map = func_96560_a(p_184952_1_);
  6023. return (List<Predicate<Entity>>)(map.isEmpty()?Collections.emptyList():Lists.newArrayList(new Predicate[]{new Predicate<Entity>() {
  6024. public boolean apply(@Nullable Entity p_apply_1_) {
  6025. if(p_apply_1_ == null) {
  6026. return false;
  6027. } else {
  6028. Scoreboard scoreboard = p_184952_0_.func_184102_h().func_71218_a(0).func_96441_U();
  6029.  
  6030. for(Entry<String, Integer> entry : map.entrySet()) {
  6031. String s = (String)entry.getKey();
  6032. boolean flag = false;
  6033. if(s.endsWith("_min") && s.length() > 4) {
  6034. flag = true;
  6035. s = s.substring(0, s.length() - 4);
  6036. }
  6037.  
  6038. ScoreObjective scoreobjective = scoreboard.func_96518_b(s);
  6039. if(scoreobjective == null) {
  6040. return false;
  6041. }
  6042.  
  6043. String s1 = p_apply_1_ instanceof EntityPlayerMP?p_apply_1_.func_70005_c_():p_apply_1_.func_189512_bd();
  6044. if(!scoreboard.func_178819_b(s1, scoreobjective)) {
  6045. return false;
  6046. }
  6047.  
  6048. Score score = scoreboard.func_96529_a(s1, scoreobjective);
  6049. int i = score.func_96652_c();
  6050. if(i < ((Integer)entry.getValue()).intValue() && flag) {
  6051. return false;
  6052. }
  6053.  
  6054. if(i > ((Integer)entry.getValue()).intValue() && !flag) {
  6055. return false;
  6056. }
  6057. }
  6058.  
  6059. return true;
  6060. }
  6061. }
  6062. }}));
  6063. }
  6064.  
  6065. private static List<Predicate<Entity>> func_179647_f(Map<String, String> p_179647_0_) {
  6066. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  6067. final String s = func_179651_b(p_179647_0_, field_190848_v);
  6068. final boolean flag = s != null && s.startsWith("!");
  6069. if(flag) {
  6070. s = s.substring(1);
  6071. }
  6072.  
  6073. if(s != null) {
  6074. list.add(new Predicate<Entity>() {
  6075. public boolean apply(@Nullable Entity p_apply_1_) {
  6076. return p_apply_1_ != null && p_apply_1_.func_70005_c_().equals(s) != flag;
  6077. }
  6078. });
  6079. }
  6080.  
  6081. return list;
  6082. }
  6083.  
  6084. private static List<Predicate<Entity>> func_184951_f(Map<String, String> p_184951_0_) {
  6085. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  6086. final String s = func_179651_b(p_184951_0_, field_190850_x);
  6087. final boolean flag = s != null && s.startsWith("!");
  6088. if(flag) {
  6089. s = s.substring(1);
  6090. }
  6091.  
  6092. if(s != null) {
  6093. list.add(new Predicate<Entity>() {
  6094. public boolean apply(@Nullable Entity p_apply_1_) {
  6095. return p_apply_1_ == null?false:("".equals(s)?p_apply_1_.func_184216_O().isEmpty() != flag:p_apply_1_.func_184216_O().contains(s) != flag);
  6096. }
  6097. });
  6098. }
  6099.  
  6100. return list;
  6101. }
  6102.  
  6103. private static List<Predicate<Entity>> func_180698_a(Map<String, String> p_180698_0_, final Vec3d p_180698_1_) {
  6104. double d0 = (double)func_179653_a(p_180698_0_, field_190832_f, -1);
  6105. double d1 = (double)func_179653_a(p_180698_0_, field_190831_e, -1);
  6106. final boolean flag = d0 < -0.5D;
  6107. final boolean flag1 = d1 < -0.5D;
  6108. if(flag && flag1) {
  6109. return Collections.<Predicate<Entity>>emptyList();
  6110. } else {
  6111. double d2 = Math.max(d0, 1.0E-4D);
  6112. final double d3 = d2 * d2;
  6113. double d4 = Math.max(d1, 1.0E-4D);
  6114. final double d5 = d4 * d4;
  6115. return Lists.newArrayList(new Predicate[]{new Predicate<Entity>() {
  6116. public boolean apply(@Nullable Entity p_apply_1_) {
  6117. if(p_apply_1_ == null) {
  6118. return false;
  6119. } else {
  6120. double d6 = p_180698_1_.func_186679_c(p_apply_1_.field_70165_t, p_apply_1_.field_70163_u, p_apply_1_.field_70161_v);
  6121. return (flag || d6 >= d3) && (flag1 || d6 <= d5);
  6122. }
  6123. }
  6124. }});
  6125. }
  6126. }
  6127.  
  6128. private static List<Predicate<Entity>> func_179662_g(Map<String, String> p_179662_0_) {
  6129. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  6130. if(p_179662_0_.containsKey(field_190844_r) || p_179662_0_.containsKey(field_190843_q)) {
  6131. final int i = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190844_r, 0));
  6132. final int j = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190843_q, 359));
  6133. list.add(new Predicate<Entity>() {
  6134. public boolean apply(@Nullable Entity p_apply_1_) {
  6135. if(p_apply_1_ == null) {
  6136. return false;
  6137. } else {
  6138. int i1 = MathHelper.func_188209_b(MathHelper.func_76141_d(p_apply_1_.field_70177_z));
  6139. return i > j?i1 >= i || i1 <= j:i1 >= i && i1 <= j;
  6140. }
  6141. }
  6142. });
  6143. }
  6144.  
  6145. if(p_179662_0_.containsKey(field_190842_p) || p_179662_0_.containsKey(field_190841_o)) {
  6146. final int k = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190842_p, 0));
  6147. final int l = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190841_o, 359));
  6148. list.add(new Predicate<Entity>() {
  6149. public boolean apply(@Nullable Entity p_apply_1_) {
  6150. if(p_apply_1_ == null) {
  6151. return false;
  6152. } else {
  6153. int i1 = MathHelper.func_188209_b(MathHelper.func_76141_d(p_apply_1_.field_70125_A));
  6154. return k > l?i1 >= k || i1 <= l:i1 >= k && i1 <= l;
  6155. }
  6156. }
  6157. });
  6158. }
  6159.  
  6160. return list;
  6161. }
  6162.  
  6163. private static <T extends Entity> List<T> func_179660_a(Map<String, String> p_179660_0_, Class<? extends T> p_179660_1_, List<Predicate<Entity>> p_179660_2_, String p_179660_3_, World p_179660_4_, BlockPos p_179660_5_) {
  6164. List<T> list = Lists.<T>newArrayList();
  6165. String s = func_179651_b(p_179660_0_, field_190849_w);
  6166. s = s != null && s.startsWith("!")?s.substring(1):s;
  6167. boolean flag = !p_179660_3_.equals("e");
  6168. boolean flag1 = p_179660_3_.equals("r") && s != null;
  6169. int i = func_179653_a(p_179660_0_, field_190838_l, 0);
  6170. int j = func_179653_a(p_179660_0_, field_190839_m, 0);
  6171. int k = func_179653_a(p_179660_0_, field_190840_n, 0);
  6172. int l = func_179653_a(p_179660_0_, field_190831_e, -1);
  6173. Predicate<Entity> predicate = Predicates.and(p_179660_2_);
  6174. Predicate<Entity> predicate1 = Predicates.<Entity>and(EntitySelectors.field_94557_a, predicate);
  6175. if(!p_179660_0_.containsKey(field_190838_l) && !p_179660_0_.containsKey(field_190839_m) && !p_179660_0_.containsKey(field_190840_n)) {
  6176. if(l >= 0) {
  6177. AxisAlignedBB axisalignedbb1 = new AxisAlignedBB((double)(p_179660_5_.func_177958_n() - l), (double)(p_179660_5_.func_177956_o() - l), (double)(p_179660_5_.func_177952_p() - l), (double)(p_179660_5_.func_177958_n() + l + 1), (double)(p_179660_5_.func_177956_o() + l + 1), (double)(p_179660_5_.func_177952_p() + l + 1));
  6178. if(flag && !flag1) {
  6179. list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate1));
  6180. } else {
  6181. list.addAll(p_179660_4_.<T>func_175647_a(p_179660_1_, axisalignedbb1, predicate1));
  6182. }
  6183. } else if(p_179660_3_.equals("a")) {
  6184. list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate));
  6185. } else if(!p_179660_3_.equals("p") && (!p_179660_3_.equals("r") || flag1)) {
  6186. list.addAll(p_179660_4_.<T>func_175644_a(p_179660_1_, predicate1));
  6187. } else {
  6188. list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate1));
  6189. }
  6190. } else {
  6191. final AxisAlignedBB axisalignedbb = func_179661_a(p_179660_5_, i, j, k);
  6192. if(flag && !flag1) {
  6193. Predicate<Entity> predicate2 = new Predicate<Entity>() {
  6194. public boolean apply(@Nullable Entity p_apply_1_) {
  6195. return p_apply_1_ != null && axisalignedbb.func_72326_a(p_apply_1_.func_174813_aQ());
  6196. }
  6197. };
  6198. list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, Predicates.<T>and(predicate1, predicate2)));
  6199. } else {
  6200. list.addAll(p_179660_4_.<T>func_175647_a(p_179660_1_, axisalignedbb, predicate1));
  6201. }
  6202. }
  6203.  
  6204. return list;
  6205. }
  6206.  
  6207. private static <T extends Entity> List<T> func_179658_a(List<T> p_179658_0_, Map<String, String> p_179658_1_, ICommandSender p_179658_2_, Class<? extends T> p_179658_3_, String p_179658_4_, final Vec3d p_179658_5_) {
  6208. int i = func_179653_a(p_179658_1_, field_190845_s, !p_179658_4_.equals("a") && !p_179658_4_.equals("e")?1:0);
  6209. if(!p_179658_4_.equals("p") && !p_179658_4_.equals("a") && !p_179658_4_.equals("e")) {
  6210. if(p_179658_4_.equals("r")) {
  6211. Collections.shuffle((List<?>)p_179658_0_);
  6212. }
  6213. } else {
  6214. Collections.sort((List<T>)p_179658_0_, new Comparator<Entity>() {
  6215. public int compare(Entity p_compare_1_, Entity p_compare_2_) {
  6216. return ComparisonChain.start().compare(p_compare_1_.func_70092_e(p_179658_5_.field_72450_a, p_179658_5_.field_72448_b, p_179658_5_.field_72449_c), p_compare_2_.func_70092_e(p_179658_5_.field_72450_a, p_179658_5_.field_72448_b, p_179658_5_.field_72449_c)).result();
  6217. }
  6218. });
  6219. }
  6220.  
  6221. Entity entity = p_179658_2_.func_174793_f();
  6222. if(entity != null && p_179658_3_.isAssignableFrom(entity.getClass()) && i == 1 && ((List)p_179658_0_).contains(entity) && !"r".equals(p_179658_4_)) {
  6223. p_179658_0_ = Lists.newArrayList(new Entity[]{entity});
  6224. }
  6225.  
  6226. if(i != 0) {
  6227. if(i < 0) {
  6228. Collections.reverse((List<?>)p_179658_0_);
  6229. }
  6230.  
  6231. p_179658_0_ = ((List)p_179658_0_).subList(0, Math.min(Math.abs(i), ((List)p_179658_0_).size()));
  6232. }
  6233.  
  6234. return (List)p_179658_0_;
  6235. }
  6236.  
  6237. private static AxisAlignedBB func_179661_a(BlockPos p_179661_0_, int p_179661_1_, int p_179661_2_, int p_179661_3_) {
  6238. boolean flag = p_179661_1_ < 0;
  6239. boolean flag1 = p_179661_2_ < 0;
  6240. boolean flag2 = p_179661_3_ < 0;
  6241. int i = p_179661_0_.func_177958_n() + (flag?p_179661_1_:0);
  6242. int j = p_179661_0_.func_177956_o() + (flag1?p_179661_2_:0);
  6243. int k = p_179661_0_.func_177952_p() + (flag2?p_179661_3_:0);
  6244. int l = p_179661_0_.func_177958_n() + (flag?0:p_179661_1_) + 1;
  6245. int i1 = p_179661_0_.func_177956_o() + (flag1?0:p_179661_2_) + 1;
  6246. int j1 = p_179661_0_.func_177952_p() + (flag2?0:p_179661_3_) + 1;
  6247. return new AxisAlignedBB((double)i, (double)j, (double)k, (double)l, (double)i1, (double)j1);
  6248. }
  6249.  
  6250. private static BlockPos func_179664_b(Map<String, String> p_179664_0_, BlockPos p_179664_1_) {
  6251. return new BlockPos(func_179653_a(p_179664_0_, field_190835_i, p_179664_1_.func_177958_n()), func_179653_a(p_179664_0_, field_190836_j, p_179664_1_.func_177956_o()), func_179653_a(p_179664_0_, field_190837_k, p_179664_1_.func_177952_p()));
  6252. }
  6253.  
  6254. private static Vec3d func_189210_b(Map<String, String> p_189210_0_, Vec3d p_189210_1_) {
  6255. return new Vec3d(func_189211_a(p_189210_0_, field_190835_i, p_189210_1_.field_72450_a, true), func_189211_a(p_189210_0_, field_190836_j, p_189210_1_.field_72448_b, false), func_189211_a(p_189210_0_, field_190837_k, p_189210_1_.field_72449_c, true));
  6256. }
  6257.  
  6258. private static double func_189211_a(Map<String, String> p_189211_0_, String p_189211_1_, double p_189211_2_, boolean p_189211_4_) {
  6259. return p_189211_0_.containsKey(p_189211_1_)?(double)MathHelper.func_82715_a((String)p_189211_0_.get(p_189211_1_), MathHelper.func_76128_c(p_189211_2_)) + (p_189211_4_?0.5D:0.0D):p_189211_2_;
  6260. }
  6261.  
  6262. private static boolean func_179665_h(Map<String, String> p_179665_0_) {
  6263. for(String s : field_179666_d) {
  6264. if(p_179665_0_.containsKey(s)) {
  6265. return true;
  6266. }
  6267. }
  6268.  
  6269. return false;
  6270. }
  6271.  
  6272. private static int func_179653_a(Map<String, String> p_179653_0_, String p_179653_1_, int p_179653_2_) {
  6273. return p_179653_0_.containsKey(p_179653_1_)?MathHelper.func_82715_a((String)p_179653_0_.get(p_179653_1_), p_179653_2_):p_179653_2_;
  6274. }
  6275.  
  6276. @Nullable
  6277. private static String func_179651_b(Map<String, String> p_179651_0_, String p_179651_1_) {
  6278. return (String)p_179651_0_.get(p_179651_1_);
  6279. }
  6280.  
  6281. public static Map<String, Integer> func_96560_a(Map<String, String> p_96560_0_) {
  6282. Map<String, Integer> map = Maps.<String, Integer>newHashMap();
  6283.  
  6284. for(String s : p_96560_0_.keySet()) {
  6285. if(s.startsWith("score_") && s.length() > "score_".length()) {
  6286. map.put(s.substring("score_".length()), Integer.valueOf(MathHelper.func_82715_a((String)p_96560_0_.get(s), 1)));
  6287. }
  6288. }
  6289.  
  6290. return map;
  6291. }
  6292.  
  6293. public static boolean func_82377_a(String p_82377_0_) throws CommandException {
  6294. Matcher matcher = field_82389_a.matcher(p_82377_0_);
  6295. if(!matcher.matches()) {
  6296. return false;
  6297. } else {
  6298. Map<String, String> map = func_82381_h(matcher.group(2));
  6299. String s = matcher.group(1);
  6300. int i = !"a".equals(s) && !"e".equals(s)?1:0;
  6301. return func_179653_a(map, field_190845_s, i) != 1;
  6302. }
  6303. }
  6304.  
  6305. public static boolean func_82378_b(String p_82378_0_) {
  6306. return field_82389_a.matcher(p_82378_0_).matches();
  6307. }
  6308.  
  6309. private static Map<String, String> func_82381_h(@Nullable String p_82381_0_) throws CommandException {
  6310. Map<String, String> map = Maps.<String, String>newHashMap();
  6311. if(p_82381_0_ == null) {
  6312. return map;
  6313. } else {
  6314. for(String s : field_190828_b.split(p_82381_0_)) {
  6315. Iterator<String> iterator = field_190829_c.split(s).iterator();
  6316. String s1 = (String)iterator.next();
  6317. if(!field_190851_y.apply(s1)) {
  6318. throw new CommandException("commands.generic.selector_argument", new Object[]{s});
  6319. }
  6320.  
  6321. map.put(s1, iterator.hasNext()?(String)iterator.next():"");
  6322. }
  6323.  
  6324. return map;
  6325. }
  6326. }
  6327. }
  6328.  
  6329. Hunk 9 failed! Cannot find hunk target
  6330.  
  6331. Entity entity = p_179658_2_.func_174793_f();
  6332. if (entity != null && p_179658_3_.isAssignableFrom(entity.getClass()) && i == 1 && p_179658_0_.contains(entity) && !"r".equals(p_179658_4_)) {
  6333. - p_179658_0_ = Lists.newArrayList(entity);
  6334. + p_179658_0_ = Lists.newArrayList((T)entity);
  6335. }
  6336.  
  6337. if (i != 0) {
  6338. File state
  6339. package net.minecraft.command;
  6340.  
  6341. import com.google.common.base.Predicate;
  6342. import com.google.common.base.Predicates;
  6343. import com.google.common.base.Splitter;
  6344. import com.google.common.collect.ComparisonChain;
  6345. import com.google.common.collect.Lists;
  6346. import com.google.common.collect.Maps;
  6347. import com.google.common.collect.Sets;
  6348. import java.util.Collections;
  6349. import java.util.Comparator;
  6350. import java.util.Iterator;
  6351. import java.util.List;
  6352. import java.util.Map;
  6353. import java.util.Set;
  6354. import java.util.Map.Entry;
  6355. import java.util.regex.Matcher;
  6356. import java.util.regex.Pattern;
  6357. import javax.annotation.Nullable;
  6358. import net.minecraft.command.CommandBase;
  6359. import net.minecraft.command.CommandException;
  6360. import net.minecraft.command.ICommandSender;
  6361. import net.minecraft.entity.Entity;
  6362. import net.minecraft.entity.EntityList;
  6363. import net.minecraft.entity.EntityLivingBase;
  6364. import net.minecraft.entity.player.EntityPlayer;
  6365. import net.minecraft.entity.player.EntityPlayerMP;
  6366. import net.minecraft.scoreboard.Score;
  6367. import net.minecraft.scoreboard.ScoreObjective;
  6368. import net.minecraft.scoreboard.Scoreboard;
  6369. import net.minecraft.scoreboard.Team;
  6370. import net.minecraft.util.EntitySelectors;
  6371. import net.minecraft.util.ResourceLocation;
  6372. import net.minecraft.util.math.AxisAlignedBB;
  6373. import net.minecraft.util.math.BlockPos;
  6374. import net.minecraft.util.math.MathHelper;
  6375. import net.minecraft.util.math.Vec3d;
  6376. import net.minecraft.util.text.ITextComponent;
  6377. import net.minecraft.util.text.TextComponentTranslation;
  6378. import net.minecraft.util.text.TextFormatting;
  6379. import net.minecraft.world.GameType;
  6380. import net.minecraft.world.World;
  6381.  
  6382. public class EntitySelector {
  6383. private static final Pattern field_82389_a = Pattern.compile("^@([pares])(?:\\[([^ ]*)\\])?$");
  6384. private static final Splitter field_190828_b = Splitter.on(',').omitEmptyStrings();
  6385. private static final Splitter field_190829_c = Splitter.on('=').limit(2);
  6386. private static final Set<String> field_190830_d = Sets.<String>newHashSet();
  6387. private static final String field_190831_e = func_190826_c("r");
  6388. private static final String field_190832_f = func_190826_c("rm");
  6389. private static final String field_190833_g = func_190826_c("l");
  6390. private static final String field_190834_h = func_190826_c("lm");
  6391. private static final String field_190835_i = func_190826_c("x");
  6392. private static final String field_190836_j = func_190826_c("y");
  6393. private static final String field_190837_k = func_190826_c("z");
  6394. private static final String field_190838_l = func_190826_c("dx");
  6395. private static final String field_190839_m = func_190826_c("dy");
  6396. private static final String field_190840_n = func_190826_c("dz");
  6397. private static final String field_190841_o = func_190826_c("rx");
  6398. private static final String field_190842_p = func_190826_c("rxm");
  6399. private static final String field_190843_q = func_190826_c("ry");
  6400. private static final String field_190844_r = func_190826_c("rym");
  6401. private static final String field_190845_s = func_190826_c("c");
  6402. private static final String field_190846_t = func_190826_c("m");
  6403. private static final String field_190847_u = func_190826_c("team");
  6404. private static final String field_190848_v = func_190826_c("name");
  6405. private static final String field_190849_w = func_190826_c("type");
  6406. private static final String field_190850_x = func_190826_c("tag");
  6407. private static final Predicate<String> field_190851_y = new Predicate<String>() {
  6408. public boolean apply(@Nullable String p_apply_1_) {
  6409. return p_apply_1_ != null && (EntitySelector.field_190830_d.contains(p_apply_1_) || p_apply_1_.length() > "score_".length() && p_apply_1_.startsWith("score_"));
  6410. }
  6411. };
  6412. private static final Set<String> field_179666_d = Sets.newHashSet(new String[]{field_190835_i, field_190836_j, field_190837_k, field_190838_l, field_190839_m, field_190840_n, field_190832_f, field_190831_e});
  6413.  
  6414. public static String func_190826_c(String p_190826_0_) {
  6415. field_190830_d.add(p_190826_0_);
  6416. return p_190826_0_;
  6417. }
  6418.  
  6419. @Nullable
  6420. public static EntityPlayerMP func_82386_a(ICommandSender p_82386_0_, String p_82386_1_) throws CommandException {
  6421. return (EntityPlayerMP)func_179652_a(p_82386_0_, p_82386_1_, EntityPlayerMP.class);
  6422. }
  6423.  
  6424. public static List<EntityPlayerMP> func_193531_b(ICommandSender p_193531_0_, String p_193531_1_) throws CommandException {
  6425. return func_179656_b(p_193531_0_, p_193531_1_, EntityPlayerMP.class);
  6426. }
  6427.  
  6428. @Nullable
  6429. public static <T extends Entity> T func_179652_a(ICommandSender p_179652_0_, String p_179652_1_, Class<? extends T> p_179652_2_) throws CommandException {
  6430. List<T> list = func_179656_b(p_179652_0_, p_179652_1_, p_179652_2_);
  6431. return (T)(list.size() == 1?(Entity)list.get(0):null);
  6432. }
  6433.  
  6434. @Nullable
  6435. public static ITextComponent func_150869_b(ICommandSender p_150869_0_, String p_150869_1_) throws CommandException {
  6436. List<Entity> list = func_179656_b(p_150869_0_, p_150869_1_, Entity.class);
  6437. if(list.isEmpty()) {
  6438. return null;
  6439. } else {
  6440. List<ITextComponent> list1 = Lists.<ITextComponent>newArrayList();
  6441.  
  6442. for(Entity entity : list) {
  6443. list1.add(entity.func_145748_c_());
  6444. }
  6445.  
  6446. return CommandBase.func_180530_a(list1);
  6447. }
  6448. }
  6449.  
  6450. public static <T extends Entity> List<T> func_179656_b(ICommandSender p_179656_0_, String p_179656_1_, Class<? extends T> p_179656_2_) throws CommandException {
  6451. Matcher matcher = field_82389_a.matcher(p_179656_1_);
  6452. if(matcher.matches() && p_179656_0_.func_70003_b(1, "@")) {
  6453. Map<String, String> map = func_82381_h(matcher.group(2));
  6454. if(!func_179655_b(p_179656_0_, map)) {
  6455. return Collections.<T>emptyList();
  6456. } else {
  6457. String s = matcher.group(1);
  6458. BlockPos blockpos = func_179664_b(map, p_179656_0_.func_180425_c());
  6459. Vec3d vec3d = func_189210_b(map, p_179656_0_.func_174791_d());
  6460. List<World> list = func_179654_a(p_179656_0_, map);
  6461. List<T> list1 = Lists.<T>newArrayList();
  6462.  
  6463. for(World world : list) {
  6464. if(world != null) {
  6465. List<Predicate<Entity>> list2 = Lists.<Predicate<Entity>>newArrayList();
  6466. list2.addAll(func_179663_a(map, s));
  6467. list2.addAll(func_179648_b(map));
  6468. list2.addAll(func_179649_c(map));
  6469. list2.addAll(func_179659_d(map));
  6470. list2.addAll(func_184952_c(p_179656_0_, map));
  6471. list2.addAll(func_179647_f(map));
  6472. list2.addAll(func_184951_f(map));
  6473. list2.addAll(func_180698_a(map, vec3d));
  6474. list2.addAll(func_179662_g(map));
  6475. if("s".equalsIgnoreCase(s)) {
  6476. Entity entity = p_179656_0_.func_174793_f();
  6477. if(entity != null && p_179656_2_.isAssignableFrom(entity.getClass())) {
  6478. if(map.containsKey(field_190838_l) || map.containsKey(field_190839_m) || map.containsKey(field_190840_n)) {
  6479. int i = func_179653_a(map, field_190838_l, 0);
  6480. int j = func_179653_a(map, field_190839_m, 0);
  6481. int k = func_179653_a(map, field_190840_n, 0);
  6482. AxisAlignedBB axisalignedbb = func_179661_a(blockpos, i, j, k);
  6483. if(!axisalignedbb.func_72326_a(entity.func_174813_aQ())) {
  6484. return Collections.<T>emptyList();
  6485. }
  6486. }
  6487.  
  6488. for(Predicate<Entity> predicate : list2) {
  6489. if(!predicate.apply(entity)) {
  6490. return Collections.<T>emptyList();
  6491. }
  6492. }
  6493.  
  6494. return Lists.newArrayList(new Entity[]{entity});
  6495. }
  6496.  
  6497. return Collections.<T>emptyList();
  6498. }
  6499.  
  6500. list1.addAll(func_179660_a(map, p_179656_2_, list2, s, world, blockpos));
  6501. }
  6502. }
  6503.  
  6504. return func_179658_a(list1, map, p_179656_0_, p_179656_2_, s, vec3d);
  6505. }
  6506. } else {
  6507. return Collections.<T>emptyList();
  6508. }
  6509. }
  6510.  
  6511. private static List<World> func_179654_a(ICommandSender p_179654_0_, Map<String, String> p_179654_1_) {
  6512. List<World> list = Lists.<World>newArrayList();
  6513. if(func_179665_h(p_179654_1_)) {
  6514. list.add(p_179654_0_.func_130014_f_());
  6515. } else {
  6516. Collections.addAll(list, p_179654_0_.func_184102_h().field_71305_c);
  6517. }
  6518.  
  6519. return list;
  6520. }
  6521.  
  6522. private static <T extends Entity> boolean func_179655_b(ICommandSender p_179655_0_, Map<String, String> p_179655_1_) {
  6523. String s = func_179651_b(p_179655_1_, field_190849_w);
  6524. if(s == null) {
  6525. return true;
  6526. } else {
  6527. ResourceLocation resourcelocation = new ResourceLocation(s.startsWith("!")?s.substring(1):s);
  6528. if(EntityList.func_180125_b(resourcelocation)) {
  6529. return true;
  6530. } else {
  6531. TextComponentTranslation textcomponenttranslation = new TextComponentTranslation("commands.generic.entity.invalidType", new Object[]{resourcelocation});
  6532. textcomponenttranslation.func_150256_b().func_150238_a(TextFormatting.RED);
  6533. p_179655_0_.func_145747_a(textcomponenttranslation);
  6534. return false;
  6535. }
  6536. }
  6537. }
  6538.  
  6539. private static List<Predicate<Entity>> func_179663_a(Map<String, String> p_179663_0_, String p_179663_1_) {
  6540. String s = func_179651_b(p_179663_0_, field_190849_w);
  6541. if(s == null || !p_179663_1_.equals("e") && !p_179663_1_.equals("r") && !p_179663_1_.equals("s")) {
  6542. return !p_179663_1_.equals("e") && !p_179663_1_.equals("s")?Collections.singletonList(new Predicate<Entity>() {
  6543. public boolean apply(@Nullable Entity p_apply_1_) {
  6544. return p_apply_1_ instanceof EntityPlayer;
  6545. }
  6546. }):Collections.emptyList();
  6547. } else {
  6548. final boolean flag = s.startsWith("!");
  6549. final ResourceLocation resourcelocation = new ResourceLocation(flag?s.substring(1):s);
  6550. return Collections.singletonList(new Predicate<Entity>() {
  6551. public boolean apply(@Nullable Entity p_apply_1_) {
  6552. return EntityList.func_180123_a(p_apply_1_, resourcelocation) != flag;
  6553. }
  6554. });
  6555. }
  6556. }
  6557.  
  6558. private static List<Predicate<Entity>> func_179648_b(Map<String, String> p_179648_0_) {
  6559. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  6560. final int i = func_179653_a(p_179648_0_, field_190834_h, -1);
  6561. final int j = func_179653_a(p_179648_0_, field_190833_g, -1);
  6562. if(i > -1 || j > -1) {
  6563. list.add(new Predicate<Entity>() {
  6564. public boolean apply(@Nullable Entity p_apply_1_) {
  6565. if(!(p_apply_1_ instanceof EntityPlayerMP)) {
  6566. return false;
  6567. } else {
  6568. EntityPlayerMP entityplayermp = (EntityPlayerMP)p_apply_1_;
  6569. return (i <= -1 || entityplayermp.field_71068_ca >= i) && (j <= -1 || entityplayermp.field_71068_ca <= j);
  6570. }
  6571. }
  6572. });
  6573. }
  6574.  
  6575. return list;
  6576. }
  6577.  
  6578. private static List<Predicate<Entity>> func_179649_c(Map<String, String> p_179649_0_) {
  6579. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  6580. String s = func_179651_b(p_179649_0_, field_190846_t);
  6581. if(s == null) {
  6582. return list;
  6583. } else {
  6584. final boolean flag = s.startsWith("!");
  6585. if(flag) {
  6586. s = s.substring(1);
  6587. }
  6588.  
  6589. final GameType gametype;
  6590. try {
  6591. int i = Integer.parseInt(s);
  6592. gametype = GameType.func_185329_a(i, GameType.NOT_SET);
  6593. } catch (Throwable var6) {
  6594. gametype = GameType.func_185328_a(s, GameType.NOT_SET);
  6595. }
  6596.  
  6597. list.add(new Predicate<Entity>() {
  6598. public boolean apply(@Nullable Entity p_apply_1_) {
  6599. if(!(p_apply_1_ instanceof EntityPlayerMP)) {
  6600. return false;
  6601. } else {
  6602. EntityPlayerMP entityplayermp = (EntityPlayerMP)p_apply_1_;
  6603. GameType gametype1 = entityplayermp.field_71134_c.func_73081_b();
  6604. return flag?gametype1 != gametype:gametype1 == gametype;
  6605. }
  6606. }
  6607. });
  6608. return list;
  6609. }
  6610. }
  6611.  
  6612. private static List<Predicate<Entity>> func_179659_d(Map<String, String> p_179659_0_) {
  6613. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  6614. final String s = func_179651_b(p_179659_0_, field_190847_u);
  6615. final boolean flag = s != null && s.startsWith("!");
  6616. if(flag) {
  6617. s = s.substring(1);
  6618. }
  6619.  
  6620. if(s != null) {
  6621. list.add(new Predicate<Entity>() {
  6622. public boolean apply(@Nullable Entity p_apply_1_) {
  6623. if(!(p_apply_1_ instanceof EntityLivingBase)) {
  6624. return false;
  6625. } else {
  6626. EntityLivingBase entitylivingbase = (EntityLivingBase)p_apply_1_;
  6627. Team team = entitylivingbase.func_96124_cp();
  6628. String s1 = team == null?"":team.func_96661_b();
  6629. return s1.equals(s) != flag;
  6630. }
  6631. }
  6632. });
  6633. }
  6634.  
  6635. return list;
  6636. }
  6637.  
  6638. private static List<Predicate<Entity>> func_184952_c(final ICommandSender p_184952_0_, Map<String, String> p_184952_1_) {
  6639. final Map<String, Integer> map = func_96560_a(p_184952_1_);
  6640. return (List<Predicate<Entity>>)(map.isEmpty()?Collections.emptyList():Lists.newArrayList(new Predicate[]{new Predicate<Entity>() {
  6641. public boolean apply(@Nullable Entity p_apply_1_) {
  6642. if(p_apply_1_ == null) {
  6643. return false;
  6644. } else {
  6645. Scoreboard scoreboard = p_184952_0_.func_184102_h().func_71218_a(0).func_96441_U();
  6646.  
  6647. for(Entry<String, Integer> entry : map.entrySet()) {
  6648. String s = (String)entry.getKey();
  6649. boolean flag = false;
  6650. if(s.endsWith("_min") && s.length() > 4) {
  6651. flag = true;
  6652. s = s.substring(0, s.length() - 4);
  6653. }
  6654.  
  6655. ScoreObjective scoreobjective = scoreboard.func_96518_b(s);
  6656. if(scoreobjective == null) {
  6657. return false;
  6658. }
  6659.  
  6660. String s1 = p_apply_1_ instanceof EntityPlayerMP?p_apply_1_.func_70005_c_():p_apply_1_.func_189512_bd();
  6661. if(!scoreboard.func_178819_b(s1, scoreobjective)) {
  6662. return false;
  6663. }
  6664.  
  6665. Score score = scoreboard.func_96529_a(s1, scoreobjective);
  6666. int i = score.func_96652_c();
  6667. if(i < ((Integer)entry.getValue()).intValue() && flag) {
  6668. return false;
  6669. }
  6670.  
  6671. if(i > ((Integer)entry.getValue()).intValue() && !flag) {
  6672. return false;
  6673. }
  6674. }
  6675.  
  6676. return true;
  6677. }
  6678. }
  6679. }}));
  6680. }
  6681.  
  6682. private static List<Predicate<Entity>> func_179647_f(Map<String, String> p_179647_0_) {
  6683. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  6684. final String s = func_179651_b(p_179647_0_, field_190848_v);
  6685. final boolean flag = s != null && s.startsWith("!");
  6686. if(flag) {
  6687. s = s.substring(1);
  6688. }
  6689.  
  6690. if(s != null) {
  6691. list.add(new Predicate<Entity>() {
  6692. public boolean apply(@Nullable Entity p_apply_1_) {
  6693. return p_apply_1_ != null && p_apply_1_.func_70005_c_().equals(s) != flag;
  6694. }
  6695. });
  6696. }
  6697.  
  6698. return list;
  6699. }
  6700.  
  6701. private static List<Predicate<Entity>> func_184951_f(Map<String, String> p_184951_0_) {
  6702. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  6703. final String s = func_179651_b(p_184951_0_, field_190850_x);
  6704. final boolean flag = s != null && s.startsWith("!");
  6705. if(flag) {
  6706. s = s.substring(1);
  6707. }
  6708.  
  6709. if(s != null) {
  6710. list.add(new Predicate<Entity>() {
  6711. public boolean apply(@Nullable Entity p_apply_1_) {
  6712. return p_apply_1_ == null?false:("".equals(s)?p_apply_1_.func_184216_O().isEmpty() != flag:p_apply_1_.func_184216_O().contains(s) != flag);
  6713. }
  6714. });
  6715. }
  6716.  
  6717. return list;
  6718. }
  6719.  
  6720. private static List<Predicate<Entity>> func_180698_a(Map<String, String> p_180698_0_, final Vec3d p_180698_1_) {
  6721. double d0 = (double)func_179653_a(p_180698_0_, field_190832_f, -1);
  6722. double d1 = (double)func_179653_a(p_180698_0_, field_190831_e, -1);
  6723. final boolean flag = d0 < -0.5D;
  6724. final boolean flag1 = d1 < -0.5D;
  6725. if(flag && flag1) {
  6726. return Collections.<Predicate<Entity>>emptyList();
  6727. } else {
  6728. double d2 = Math.max(d0, 1.0E-4D);
  6729. final double d3 = d2 * d2;
  6730. double d4 = Math.max(d1, 1.0E-4D);
  6731. final double d5 = d4 * d4;
  6732. return Lists.newArrayList(new Predicate[]{new Predicate<Entity>() {
  6733. public boolean apply(@Nullable Entity p_apply_1_) {
  6734. if(p_apply_1_ == null) {
  6735. return false;
  6736. } else {
  6737. double d6 = p_180698_1_.func_186679_c(p_apply_1_.field_70165_t, p_apply_1_.field_70163_u, p_apply_1_.field_70161_v);
  6738. return (flag || d6 >= d3) && (flag1 || d6 <= d5);
  6739. }
  6740. }
  6741. }});
  6742. }
  6743. }
  6744.  
  6745. private static List<Predicate<Entity>> func_179662_g(Map<String, String> p_179662_0_) {
  6746. List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
  6747. if(p_179662_0_.containsKey(field_190844_r) || p_179662_0_.containsKey(field_190843_q)) {
  6748. final int i = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190844_r, 0));
  6749. final int j = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190843_q, 359));
  6750. list.add(new Predicate<Entity>() {
  6751. public boolean apply(@Nullable Entity p_apply_1_) {
  6752. if(p_apply_1_ == null) {
  6753. return false;
  6754. } else {
  6755. int i1 = MathHelper.func_188209_b(MathHelper.func_76141_d(p_apply_1_.field_70177_z));
  6756. return i > j?i1 >= i || i1 <= j:i1 >= i && i1 <= j;
  6757. }
  6758. }
  6759. });
  6760. }
  6761.  
  6762. if(p_179662_0_.containsKey(field_190842_p) || p_179662_0_.containsKey(field_190841_o)) {
  6763. final int k = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190842_p, 0));
  6764. final int l = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190841_o, 359));
  6765. list.add(new Predicate<Entity>() {
  6766. public boolean apply(@Nullable Entity p_apply_1_) {
  6767. if(p_apply_1_ == null) {
  6768. return false;
  6769. } else {
  6770. int i1 = MathHelper.func_188209_b(MathHelper.func_76141_d(p_apply_1_.field_70125_A));
  6771. return k > l?i1 >= k || i1 <= l:i1 >= k && i1 <= l;
  6772. }
  6773. }
  6774. });
  6775. }
  6776.  
  6777. return list;
  6778. }
  6779.  
  6780. private static <T extends Entity> List<T> func_179660_a(Map<String, String> p_179660_0_, Class<? extends T> p_179660_1_, List<Predicate<Entity>> p_179660_2_, String p_179660_3_, World p_179660_4_, BlockPos p_179660_5_) {
  6781. List<T> list = Lists.<T>newArrayList();
  6782. String s = func_179651_b(p_179660_0_, field_190849_w);
  6783. s = s != null && s.startsWith("!")?s.substring(1):s;
  6784. boolean flag = !p_179660_3_.equals("e");
  6785. boolean flag1 = p_179660_3_.equals("r") && s != null;
  6786. int i = func_179653_a(p_179660_0_, field_190838_l, 0);
  6787. int j = func_179653_a(p_179660_0_, field_190839_m, 0);
  6788. int k = func_179653_a(p_179660_0_, field_190840_n, 0);
  6789. int l = func_179653_a(p_179660_0_, field_190831_e, -1);
  6790. Predicate<Entity> predicate = Predicates.and(p_179660_2_);
  6791. Predicate<Entity> predicate1 = Predicates.<Entity>and(EntitySelectors.field_94557_a, predicate);
  6792. if(!p_179660_0_.containsKey(field_190838_l) && !p_179660_0_.containsKey(field_190839_m) && !p_179660_0_.containsKey(field_190840_n)) {
  6793. if(l >= 0) {
  6794. AxisAlignedBB axisalignedbb1 = new AxisAlignedBB((double)(p_179660_5_.func_177958_n() - l), (double)(p_179660_5_.func_177956_o() - l), (double)(p_179660_5_.func_177952_p() - l), (double)(p_179660_5_.func_177958_n() + l + 1), (double)(p_179660_5_.func_177956_o() + l + 1), (double)(p_179660_5_.func_177952_p() + l + 1));
  6795. if(flag && !flag1) {
  6796. list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate1));
  6797. } else {
  6798. list.addAll(p_179660_4_.<T>func_175647_a(p_179660_1_, axisalignedbb1, predicate1));
  6799. }
  6800. } else if(p_179660_3_.equals("a")) {
  6801. list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate));
  6802. } else if(!p_179660_3_.equals("p") && (!p_179660_3_.equals("r") || flag1)) {
  6803. list.addAll(p_179660_4_.<T>func_175644_a(p_179660_1_, predicate1));
  6804. } else {
  6805. list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate1));
  6806. }
  6807. } else {
  6808. final AxisAlignedBB axisalignedbb = func_179661_a(p_179660_5_, i, j, k);
  6809. if(flag && !flag1) {
  6810. Predicate<Entity> predicate2 = new Predicate<Entity>() {
  6811. public boolean apply(@Nullable Entity p_apply_1_) {
  6812. return p_apply_1_ != null && axisalignedbb.func_72326_a(p_apply_1_.func_174813_aQ());
  6813. }
  6814. };
  6815. list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, Predicates.<T>and(predicate1, predicate2)));
  6816. } else {
  6817. list.addAll(p_179660_4_.<T>func_175647_a(p_179660_1_, axisalignedbb, predicate1));
  6818. }
  6819. }
  6820.  
  6821. return list;
  6822. }
  6823.  
  6824. private static <T extends Entity> List<T> func_179658_a(List<T> p_179658_0_, Map<String, String> p_179658_1_, ICommandSender p_179658_2_, Class<? extends T> p_179658_3_, String p_179658_4_, final Vec3d p_179658_5_) {
  6825. int i = func_179653_a(p_179658_1_, field_190845_s, !p_179658_4_.equals("a") && !p_179658_4_.equals("e")?1:0);
  6826. if(!p_179658_4_.equals("p") && !p_179658_4_.equals("a") && !p_179658_4_.equals("e")) {
  6827. if(p_179658_4_.equals("r")) {
  6828. Collections.shuffle((List<?>)p_179658_0_);
  6829. }
  6830. } else {
  6831. Collections.sort((List<T>)p_179658_0_, new Comparator<Entity>() {
  6832. public int compare(Entity p_compare_1_, Entity p_compare_2_) {
  6833. return ComparisonChain.start().compare(p_compare_1_.func_70092_e(p_179658_5_.field_72450_a, p_179658_5_.field_72448_b, p_179658_5_.field_72449_c), p_compare_2_.func_70092_e(p_179658_5_.field_72450_a, p_179658_5_.field_72448_b, p_179658_5_.field_72449_c)).result();
  6834. }
  6835. });
  6836. }
  6837.  
  6838. Entity entity = p_179658_2_.func_174793_f();
  6839. if(entity != null && p_179658_3_.isAssignableFrom(entity.getClass()) && i == 1 && ((List)p_179658_0_).contains(entity) && !"r".equals(p_179658_4_)) {
  6840. p_179658_0_ = Lists.newArrayList(new Entity[]{entity});
  6841. }
  6842.  
  6843. if(i != 0) {
  6844. if(i < 0) {
  6845. Collections.reverse((List<?>)p_179658_0_);
  6846. }
  6847.  
  6848. p_179658_0_ = ((List)p_179658_0_).subList(0, Math.min(Math.abs(i), ((List)p_179658_0_).size()));
  6849. }
  6850.  
  6851. return (List)p_179658_0_;
  6852. }
  6853.  
  6854. private static AxisAlignedBB func_179661_a(BlockPos p_179661_0_, int p_179661_1_, int p_179661_2_, int p_179661_3_) {
  6855. boolean flag = p_179661_1_ < 0;
  6856. boolean flag1 = p_179661_2_ < 0;
  6857. boolean flag2 = p_179661_3_ < 0;
  6858. int i = p_179661_0_.func_177958_n() + (flag?p_179661_1_:0);
  6859. int j = p_179661_0_.func_177956_o() + (flag1?p_179661_2_:0);
  6860. int k = p_179661_0_.func_177952_p() + (flag2?p_179661_3_:0);
  6861. int l = p_179661_0_.func_177958_n() + (flag?0:p_179661_1_) + 1;
  6862. int i1 = p_179661_0_.func_177956_o() + (flag1?0:p_179661_2_) + 1;
  6863. int j1 = p_179661_0_.func_177952_p() + (flag2?0:p_179661_3_) + 1;
  6864. return new AxisAlignedBB((double)i, (double)j, (double)k, (double)l, (double)i1, (double)j1);
  6865. }
  6866.  
  6867. private static BlockPos func_179664_b(Map<String, String> p_179664_0_, BlockPos p_179664_1_) {
  6868. return new BlockPos(func_179653_a(p_179664_0_, field_190835_i, p_179664_1_.func_177958_n()), func_179653_a(p_179664_0_, field_190836_j, p_179664_1_.func_177956_o()), func_179653_a(p_179664_0_, field_190837_k, p_179664_1_.func_177952_p()));
  6869. }
  6870.  
  6871. private static Vec3d func_189210_b(Map<String, String> p_189210_0_, Vec3d p_189210_1_) {
  6872. return new Vec3d(func_189211_a(p_189210_0_, field_190835_i, p_189210_1_.field_72450_a, true), func_189211_a(p_189210_0_, field_190836_j, p_189210_1_.field_72448_b, false), func_189211_a(p_189210_0_, field_190837_k, p_189210_1_.field_72449_c, true));
  6873. }
  6874.  
  6875. private static double func_189211_a(Map<String, String> p_189211_0_, String p_189211_1_, double p_189211_2_, boolean p_189211_4_) {
  6876. return p_189211_0_.containsKey(p_189211_1_)?(double)MathHelper.func_82715_a((String)p_189211_0_.get(p_189211_1_), MathHelper.func_76128_c(p_189211_2_)) + (p_189211_4_?0.5D:0.0D):p_189211_2_;
  6877. }
  6878.  
  6879. private static boolean func_179665_h(Map<String, String> p_179665_0_) {
  6880. for(String s : field_179666_d) {
  6881. if(p_179665_0_.containsKey(s)) {
  6882. return true;
  6883. }
  6884. }
  6885.  
  6886. return false;
  6887. }
  6888.  
  6889. private static int func_179653_a(Map<String, String> p_179653_0_, String p_179653_1_, int p_179653_2_) {
  6890. return p_179653_0_.containsKey(p_179653_1_)?MathHelper.func_82715_a((String)p_179653_0_.get(p_179653_1_), p_179653_2_):p_179653_2_;
  6891. }
  6892.  
  6893. @Nullable
  6894. private static String func_179651_b(Map<String, String> p_179651_0_, String p_179651_1_) {
  6895. return (String)p_179651_0_.get(p_179651_1_);
  6896. }
  6897.  
  6898. public static Map<String, Integer> func_96560_a(Map<String, String> p_96560_0_) {
  6899. Map<String, Integer> map = Maps.<String, Integer>newHashMap();
  6900.  
  6901. for(String s : p_96560_0_.keySet()) {
  6902. if(s.startsWith("score_") && s.length() > "score_".length()) {
  6903. map.put(s.substring("score_".length()), Integer.valueOf(MathHelper.func_82715_a((String)p_96560_0_.get(s), 1)));
  6904. }
  6905. }
  6906.  
  6907. return map;
  6908. }
  6909.  
  6910. public static boolean func_82377_a(String p_82377_0_) throws CommandException {
  6911. Matcher matcher = field_82389_a.matcher(p_82377_0_);
  6912. if(!matcher.matches()) {
  6913. return false;
  6914. } else {
  6915. Map<String, String> map = func_82381_h(matcher.group(2));
  6916. String s = matcher.group(1);
  6917. int i = !"a".equals(s) && !"e".equals(s)?1:0;
  6918. return func_179653_a(map, field_190845_s, i) != 1;
  6919. }
  6920. }
  6921.  
  6922. public static boolean func_82378_b(String p_82378_0_) {
  6923. return field_82389_a.matcher(p_82378_0_).matches();
  6924. }
  6925.  
  6926. private static Map<String, String> func_82381_h(@Nullable String p_82381_0_) throws CommandException {
  6927. Map<String, String> map = Maps.<String, String>newHashMap();
  6928. if(p_82381_0_ == null) {
  6929. return map;
  6930. } else {
  6931. for(String s : field_190828_b.split(p_82381_0_)) {
  6932. Iterator<String> iterator = field_190829_c.split(s).iterator();
  6933. String s1 = (String)iterator.next();
  6934. if(!field_190851_y.apply(s1)) {
  6935. throw new CommandException("commands.generic.selector_argument", new Object[]{s});
  6936. }
  6937.  
  6938. map.put(s1, iterator.hasNext()?(String)iterator.next():"");
  6939. }
  6940.  
  6941. return map;
  6942. }
  6943. }
  6944. }
  6945.  
  6946. Patching failed: minecraft\net\minecraft\command\CommandSpreadPlayers.java
  6947. Hunk 1 failed! Cannot find hunk target
  6948. if (entity instanceof EntityPlayer) {
  6949. set.add(entity.func_96124_cp());
  6950. } else {
  6951. - set.add((Object)null);
  6952. + set.add(null);
  6953. }
  6954. }
  6955.  
  6956. File state
  6957. package net.minecraft.command;
  6958.  
  6959. import com.google.common.collect.Lists;
  6960. import com.google.common.collect.Maps;
  6961. import com.google.common.collect.Sets;
  6962. import java.util.Collections;
  6963. import java.util.List;
  6964. import java.util.Map;
  6965. import java.util.Random;
  6966. import java.util.Set;
  6967. import javax.annotation.Nullable;
  6968. import net.minecraft.block.material.Material;
  6969. import net.minecraft.command.CommandBase;
  6970. import net.minecraft.command.CommandException;
  6971. import net.minecraft.command.CommandResultStats;
  6972. import net.minecraft.command.EntityNotFoundException;
  6973. import net.minecraft.command.EntitySelector;
  6974. import net.minecraft.command.ICommandSender;
  6975. import net.minecraft.command.PlayerNotFoundException;
  6976. import net.minecraft.command.WrongUsageException;
  6977. import net.minecraft.entity.Entity;
  6978. import net.minecraft.entity.player.EntityPlayer;
  6979. import net.minecraft.scoreboard.Team;
  6980. import net.minecraft.server.MinecraftServer;
  6981. import net.minecraft.util.math.BlockPos;
  6982. import net.minecraft.util.math.MathHelper;
  6983. import net.minecraft.util.text.TextComponentTranslation;
  6984. import net.minecraft.world.World;
  6985.  
  6986. public class CommandSpreadPlayers extends CommandBase {
  6987. public String func_71517_b() {
  6988. return "spreadplayers";
  6989. }
  6990.  
  6991. public int func_82362_a() {
  6992. return 2;
  6993. }
  6994.  
  6995. public String func_71518_a(ICommandSender p_71518_1_) {
  6996. return "commands.spreadplayers.usage";
  6997. }
  6998.  
  6999. public void func_184881_a(MinecraftServer p_184881_1_, ICommandSender p_184881_2_, String[] p_184881_3_) throws CommandException {
  7000. if(p_184881_3_.length < 6) {
  7001. throw new WrongUsageException("commands.spreadplayers.usage", new Object[0]);
  7002. } else {
  7003. int i = 0;
  7004. BlockPos blockpos = p_184881_2_.func_180425_c();
  7005. double d0 = func_175761_b((double)blockpos.func_177958_n(), p_184881_3_[i++], true);
  7006. double d1 = func_175761_b((double)blockpos.func_177952_p(), p_184881_3_[i++], true);
  7007. double d2 = func_180526_a(p_184881_3_[i++], 0.0D);
  7008. double d3 = func_180526_a(p_184881_3_[i++], d2 + 1.0D);
  7009. boolean flag = func_180527_d(p_184881_3_[i++]);
  7010. List<Entity> list = Lists.<Entity>newArrayList();
  7011.  
  7012. while(i < p_184881_3_.length) {
  7013. String s = p_184881_3_[i++];
  7014. if(EntitySelector.func_82378_b(s)) {
  7015. List<Entity> list1 = EntitySelector.<Entity>func_179656_b(p_184881_2_, s, Entity.class);
  7016. if(list1.isEmpty()) {
  7017. throw new EntityNotFoundException("commands.generic.selector.notFound", new Object[]{s});
  7018. }
  7019.  
  7020. list.addAll(list1);
  7021. } else {
  7022. EntityPlayer entityplayer = p_184881_1_.func_184103_al().func_152612_a(s);
  7023. if(entityplayer == null) {
  7024. throw new PlayerNotFoundException("commands.generic.player.notFound", new Object[]{s});
  7025. }
  7026.  
  7027. list.add(entityplayer);
  7028. }
  7029. }
  7030.  
  7031. p_184881_2_.func_174794_a(CommandResultStats.Type.AFFECTED_ENTITIES, list.size());
  7032. if(list.isEmpty()) {
  7033. throw new EntityNotFoundException("commands.spreadplayers.noop");
  7034. } else {
  7035. p_184881_2_.func_145747_a(new TextComponentTranslation("commands.spreadplayers.spreading." + (flag?"teams":"players"), new Object[]{Integer.valueOf(list.size()), Double.valueOf(d3), Double.valueOf(d0), Double.valueOf(d1), Double.valueOf(d2)}));
  7036. this.func_110669_a(p_184881_2_, list, new CommandSpreadPlayers.Position(d0, d1), d2, d3, ((Entity)list.get(0)).field_70170_p, flag);
  7037. }
  7038. }
  7039. }
  7040.  
  7041. private void func_110669_a(ICommandSender p_110669_1_, List<Entity> p_110669_2_, CommandSpreadPlayers.Position p_110669_3_, double p_110669_4_, double p_110669_6_, World p_110669_8_, boolean p_110669_9_) throws CommandException {
  7042. Random random = new Random();
  7043. double d0 = p_110669_3_.field_111101_a - p_110669_6_;
  7044. double d1 = p_110669_3_.field_111100_b - p_110669_6_;
  7045. double d2 = p_110669_3_.field_111101_a + p_110669_6_;
  7046. double d3 = p_110669_3_.field_111100_b + p_110669_6_;
  7047. CommandSpreadPlayers.Position[] acommandspreadplayers$position = this.func_110670_a(random, p_110669_9_?this.func_110667_a(p_110669_2_):p_110669_2_.size(), d0, d1, d2, d3);
  7048. int i = this.func_110668_a(p_110669_3_, p_110669_4_, p_110669_8_, random, d0, d1, d2, d3, acommandspreadplayers$position, p_110669_9_);
  7049. double d4 = this.func_110671_a(p_110669_2_, p_110669_8_, acommandspreadplayers$position, p_110669_9_);
  7050. func_152373_a(p_110669_1_, this, "commands.spreadplayers.success." + (p_110669_9_?"teams":"players"), new Object[]{Integer.valueOf(acommandspreadplayers$position.length), Double.valueOf(p_110669_3_.field_111101_a), Double.valueOf(p_110669_3_.field_111100_b)});
  7051. if(acommandspreadplayers$position.length > 1) {
  7052. p_110669_1_.func_145747_a(new TextComponentTranslation("commands.spreadplayers.info." + (p_110669_9_?"teams":"players"), new Object[]{String.format("%.2f", new Object[]{Double.valueOf(d4)}), Integer.valueOf(i)}));
  7053. }
  7054.  
  7055. }
  7056.  
  7057. private int func_110667_a(List<Entity> p_110667_1_) {
  7058. Set<Team> set = Sets.<Team>newHashSet();
  7059.  
  7060. for(Entity entity : p_110667_1_) {
  7061. if(entity instanceof EntityPlayer) {
  7062. set.add(entity.func_96124_cp());
  7063. } else {
  7064. set.add((Team)null);
  7065. }
  7066. }
  7067.  
  7068. return set.size();
  7069. }
  7070.  
  7071. private int func_110668_a(CommandSpreadPlayers.Position p_110668_1_, double p_110668_2_, World p_110668_4_, Random p_110668_5_, double p_110668_6_, double p_110668_8_, double p_110668_10_, double p_110668_12_, CommandSpreadPlayers.Position[] p_110668_14_, boolean p_110668_15_) throws CommandException {
  7072. boolean flag = true;
  7073. double d0 = 3.4028234663852886E38D;
  7074.  
  7075. int i;
  7076. for(i = 0; i < 10000 && flag; ++i) {
  7077. flag = false;
  7078. d0 = 3.4028234663852886E38D;
  7079.  
  7080. for(int j = 0; j < p_110668_14_.length; ++j) {
  7081. CommandSpreadPlayers.Position commandspreadplayers$position = p_110668_14_[j];
  7082. int k = 0;
  7083. CommandSpreadPlayers.Position commandspreadplayers$position1 = new CommandSpreadPlayers.Position();
  7084.  
  7085. for(int l = 0; l < p_110668_14_.length; ++l) {
  7086. if(j != l) {
  7087. CommandSpreadPlayers.Position commandspreadplayers$position2 = p_110668_14_[l];
  7088. double d1 = commandspreadplayers$position.func_111099_a(commandspreadplayers$position2);
  7089. d0 = Math.min(d1, d0);
  7090. if(d1 < p_110668_2_) {
  7091. ++k;
  7092. commandspreadplayers$position1.field_111101_a += commandspreadplayers$position2.field_111101_a - commandspreadplayers$position.field_111101_a;
  7093. commandspreadplayers$position1.field_111100_b += commandspreadplayers$position2.field_111100_b - commandspreadplayers$position.field_111100_b;
  7094. }
  7095. }
  7096. }
  7097.  
  7098. if(k > 0) {
  7099. commandspreadplayers$position1.field_111101_a /= (double)k;
  7100. commandspreadplayers$position1.field_111100_b /= (double)k;
  7101. double d2 = (double)commandspreadplayers$position1.func_111096_b();
  7102. if(d2 > 0.0D) {
  7103. commandspreadplayers$position1.func_111095_a();
  7104. commandspreadplayers$position.func_111094_b(commandspreadplayers$position1);
  7105. } else {
  7106. commandspreadplayers$position.func_111097_a(p_110668_5_, p_110668_6_, p_110668_8_, p_110668_10_, p_110668_12_);
  7107. }
  7108.  
  7109. flag = true;
  7110. }
  7111.  
  7112. if(commandspreadplayers$position.func_111093_a(p_110668_6_, p_110668_8_, p_110668_10_, p_110668_12_)) {
  7113. flag = true;
  7114. }
  7115. }
  7116.  
  7117. if(!flag) {
  7118. for(CommandSpreadPlayers.Position commandspreadplayers$position3 : p_110668_14_) {
  7119. if(!commandspreadplayers$position3.func_111098_b(p_110668_4_)) {
  7120. commandspreadplayers$position3.func_111097_a(p_110668_5_, p_110668_6_, p_110668_8_, p_110668_10_, p_110668_12_);
  7121. flag = true;
  7122. }
  7123. }
  7124. }
  7125. }
  7126.  
  7127. if(i >= 10000) {
  7128. throw new CommandException("commands.spreadplayers.failure." + (p_110668_15_?"teams":"players"), new Object[]{Integer.valueOf(p_110668_14_.length), Double.valueOf(p_110668_1_.field_111101_a), Double.valueOf(p_110668_1_.field_111100_b), String.format("%.2f", new Object[]{Double.valueOf(d0)})});
  7129. } else {
  7130. return i;
  7131. }
  7132. }
  7133.  
  7134. private double func_110671_a(List<Entity> p_110671_1_, World p_110671_2_, CommandSpreadPlayers.Position[] p_110671_3_, boolean p_110671_4_) {
  7135. double d0 = 0.0D;
  7136. int i = 0;
  7137. Map<Team, CommandSpreadPlayers.Position> map = Maps.<Team, CommandSpreadPlayers.Position>newHashMap();
  7138.  
  7139. for(int j = 0; j < p_110671_1_.size(); ++j) {
  7140. Entity entity = (Entity)p_110671_1_.get(j);
  7141. CommandSpreadPlayers.Position commandspreadplayers$position;
  7142. if(p_110671_4_) {
  7143. Team team = entity instanceof EntityPlayer?entity.func_96124_cp():null;
  7144. if(!map.containsKey(team)) {
  7145. map.put(team, p_110671_3_[i++]);
  7146. }
  7147.  
  7148. commandspreadplayers$position = (CommandSpreadPlayers.Position)map.get(team);
  7149. } else {
  7150. commandspreadplayers$position = p_110671_3_[i++];
  7151. }
  7152.  
  7153. entity.func_70634_a((double)((float)MathHelper.func_76128_c(commandspreadplayers$position.field_111101_a) + 0.5F), (double)commandspreadplayers$position.func_111092_a(p_110671_2_), (double)MathHelper.func_76128_c(commandspreadplayers$position.field_111100_b) + 0.5D);
  7154. double d2 = Double.MAX_VALUE;
  7155.  
  7156. for(CommandSpreadPlayers.Position commandspreadplayers$position1 : p_110671_3_) {
  7157. if(commandspreadplayers$position != commandspreadplayers$position1) {
  7158. double d1 = commandspreadplayers$position.func_111099_a(commandspreadplayers$position1);
  7159. d2 = Math.min(d1, d2);
  7160. }
  7161. }
  7162.  
  7163. d0 += d2;
  7164. }
  7165.  
  7166. d0 = d0 / (double)p_110671_1_.size();
  7167. return d0;
  7168. }
  7169.  
  7170. private CommandSpreadPlayers.Position[] func_110670_a(Random p_110670_1_, int p_110670_2_, double p_110670_3_, double p_110670_5_, double p_110670_7_, double p_110670_9_) {
  7171. CommandSpreadPlayers.Position[] acommandspreadplayers$position = new CommandSpreadPlayers.Position[p_110670_2_];
  7172.  
  7173. for(int i = 0; i < acommandspreadplayers$position.length; ++i) {
  7174. CommandSpreadPlayers.Position commandspreadplayers$position = new CommandSpreadPlayers.Position();
  7175. commandspreadplayers$position.func_111097_a(p_110670_1_, p_110670_3_, p_110670_5_, p_110670_7_, p_110670_9_);
  7176. acommandspreadplayers$position[i] = commandspreadplayers$position;
  7177. }
  7178.  
  7179. return acommandspreadplayers$position;
  7180. }
  7181.  
  7182. public List<String> func_184883_a(MinecraftServer p_184883_1_, ICommandSender p_184883_2_, String[] p_184883_3_, @Nullable BlockPos p_184883_4_) {
  7183. return p_184883_3_.length >= 1 && p_184883_3_.length <= 2?func_181043_b(p_184883_3_, 0, p_184883_4_):Collections.emptyList();
  7184. }
  7185.  
  7186. static class Position {
  7187. double field_111101_a;
  7188. double field_111100_b;
  7189.  
  7190. Position() {
  7191. }
  7192.  
  7193. Position(double p_i1358_1_, double p_i1358_3_) {
  7194. this.field_111101_a = p_i1358_1_;
  7195. this.field_111100_b = p_i1358_3_;
  7196. }
  7197.  
  7198. double func_111099_a(CommandSpreadPlayers.Position p_111099_1_) {
  7199. double d0 = this.field_111101_a - p_111099_1_.field_111101_a;
  7200. double d1 = this.field_111100_b - p_111099_1_.field_111100_b;
  7201. return Math.sqrt(d0 * d0 + d1 * d1);
  7202. }
  7203.  
  7204. void func_111095_a() {
  7205. double d0 = (double)this.func_111096_b();
  7206. this.field_111101_a /= d0;
  7207. this.field_111100_b /= d0;
  7208. }
  7209.  
  7210. float func_111096_b() {
  7211. return MathHelper.func_76133_a(this.field_111101_a * this.field_111101_a + this.field_111100_b * this.field_111100_b);
  7212. }
  7213.  
  7214. public void func_111094_b(CommandSpreadPlayers.Position p_111094_1_) {
  7215. this.field_111101_a -= p_111094_1_.field_111101_a;
  7216. this.field_111100_b -= p_111094_1_.field_111100_b;
  7217. }
  7218.  
  7219. public boolean func_111093_a(double p_111093_1_, double p_111093_3_, double p_111093_5_, double p_111093_7_) {
  7220. boolean flag = false;
  7221. if(this.field_111101_a < p_111093_1_) {
  7222. this.field_111101_a = p_111093_1_;
  7223. flag = true;
  7224. } else if(this.field_111101_a > p_111093_5_) {
  7225. this.field_111101_a = p_111093_5_;
  7226. flag = true;
  7227. }
  7228.  
  7229. if(this.field_111100_b < p_111093_3_) {
  7230. this.field_111100_b = p_111093_3_;
  7231. flag = true;
  7232. } else if(this.field_111100_b > p_111093_7_) {
  7233. this.field_111100_b = p_111093_7_;
  7234. flag = true;
  7235. }
  7236.  
  7237. return flag;
  7238. }
  7239.  
  7240. public int func_111092_a(World p_111092_1_) {
  7241. BlockPos blockpos = new BlockPos(this.field_111101_a, 256.0D, this.field_111100_b);
  7242.  
  7243. while(blockpos.func_177956_o() > 0) {
  7244. blockpos = blockpos.func_177977_b();
  7245. if(p_111092_1_.func_180495_p(blockpos).func_185904_a() != Material.field_151579_a) {
  7246. return blockpos.func_177956_o() + 1;
  7247. }
  7248. }
  7249.  
  7250. return 257;
  7251. }
  7252.  
  7253. public boolean func_111098_b(World p_111098_1_) {
  7254. BlockPos blockpos = new BlockPos(this.field_111101_a, 256.0D, this.field_111100_b);
  7255.  
  7256. while(blockpos.func_177956_o() > 0) {
  7257. blockpos = blockpos.func_177977_b();
  7258. Material material = p_111098_1_.func_180495_p(blockpos).func_185904_a();
  7259. if(material != Material.field_151579_a) {
  7260. return !material.func_76224_d() && material != Material.field_151581_o;
  7261. }
  7262. }
  7263.  
  7264. return false;
  7265. }
  7266.  
  7267. public void func_111097_a(Random p_111097_1_, double p_111097_2_, double p_111097_4_, double p_111097_6_, double p_111097_8_) {
  7268. this.field_111101_a = MathHelper.func_82716_a(p_111097_1_, p_111097_2_, p_111097_6_);
  7269. this.field_111100_b = MathHelper.func_82716_a(p_111097_1_, p_111097_4_, p_111097_8_);
  7270. }
  7271. }
  7272. }
  7273.  
  7274. Patching failed: minecraft\net\minecraft\util\math\Cartesian.java
  7275. Hunk 1 failed! Cannot find hunk target
  7276.  
  7277. public class Cartesian {
  7278. public static <T> Iterable<T[]> func_179318_a(Class<T> p_179318_0_, Iterable<? extends Iterable<? extends T>> p_179318_1_) {
  7279. - return new Cartesian.Product<T[]>(p_179318_0_, (Iterable[])func_179322_b(Iterable.class, p_179318_1_));
  7280. + return new Cartesian.Product(p_179318_0_, (Iterable[])func_179322_b(Iterable.class, p_179318_1_));
  7281. }
  7282.  
  7283. public static <T> Iterable<List<T>> func_179321_a(Iterable<? extends Iterable<? extends T>> p_179321_0_) {
  7284. File state
  7285. package net.minecraft.util.math;
  7286.  
  7287. import com.google.common.base.Function;
  7288. import com.google.common.collect.Iterables;
  7289. import com.google.common.collect.Lists;
  7290. import com.google.common.collect.UnmodifiableIterator;
  7291. import java.lang.reflect.Array;
  7292. import java.util.Arrays;
  7293. import java.util.Collections;
  7294. import java.util.Iterator;
  7295. import java.util.List;
  7296. import java.util.NoSuchElementException;
  7297. import javax.annotation.Nullable;
  7298.  
  7299. public class Cartesian {
  7300. public static <T> Iterable<T[]> func_179318_a(Class<T> p_179318_0_, Iterable<? extends Iterable<? extends T>> p_179318_1_) {
  7301. return new Cartesian.Product(p_179318_0_, (Iterable[])func_179322_b(Iterable.class, p_179318_1_));
  7302. }
  7303.  
  7304. public static <T> Iterable<List<T>> func_179321_a(Iterable<? extends Iterable<? extends T>> p_179321_0_) {
  7305. return func_179323_b(func_179318_a(Object.class, p_179321_0_));
  7306. }
  7307.  
  7308. private static <T> Iterable<List<T>> func_179323_b(Iterable<Object[]> p_179323_0_) {
  7309. return Iterables.transform(p_179323_0_, new Cartesian.GetList());
  7310. }
  7311.  
  7312. private static <T> T[] func_179322_b(Class<? super T> p_179322_0_, Iterable<? extends T> p_179322_1_) {
  7313. List<T> list = Lists.<T>newArrayList();
  7314.  
  7315. for(T t : p_179322_1_) {
  7316. list.add(t);
  7317. }
  7318.  
  7319. return (T[])((Object[])list.toArray(func_179319_b(p_179322_0_, list.size())));
  7320. }
  7321.  
  7322. private static <T> T[] func_179319_b(Class<? super T> p_179319_0_, int p_179319_1_) {
  7323. return (T[])((Object[])((Object[])Array.newInstance(p_179319_0_, p_179319_1_)));
  7324. }
  7325.  
  7326. static class GetList<T> implements Function<Object[], List<T>> {
  7327. private GetList() {
  7328. }
  7329.  
  7330. public List<T> apply(@Nullable Object[] p_apply_1_) {
  7331. return Arrays.<T>asList((Object[])p_apply_1_);
  7332. }
  7333. }
  7334.  
  7335. static class Product<T> implements Iterable<T[]> {
  7336. private final Class<T> field_179429_a;
  7337. private final Iterable<? extends T>[] field_179428_b;
  7338.  
  7339. private Product(Class<T> p_i46020_1_, Iterable<? extends T>[] p_i46020_2_) {
  7340. this.field_179429_a = p_i46020_1_;
  7341. this.field_179428_b = p_i46020_2_;
  7342. }
  7343.  
  7344. public Iterator<T[]> iterator() {
  7345. return (Iterator<T[]>)(this.field_179428_b.length <= 0?Collections.singletonList((Object[])Cartesian.func_179319_b(this.field_179429_a, 0)).iterator():new Cartesian.Product.ProductIterator(this.field_179429_a, this.field_179428_b));
  7346. }
  7347.  
  7348. static class ProductIterator<T> extends UnmodifiableIterator<T[]> {
  7349. private int field_179426_a;
  7350. private final Iterable<? extends T>[] field_179424_b;
  7351. private final Iterator<? extends T>[] field_179425_c;
  7352. private final T[] field_179423_d;
  7353.  
  7354. private ProductIterator(Class<T> p_i46018_1_, Iterable<? extends T>[] p_i46018_2_) {
  7355. this.field_179426_a = -2;
  7356. this.field_179424_b = p_i46018_2_;
  7357. this.field_179425_c = (Iterator[])Cartesian.func_179319_b(Iterator.class, this.field_179424_b.length);
  7358.  
  7359. for(int i = 0; i < this.field_179424_b.length; ++i) {
  7360. this.field_179425_c[i] = p_i46018_2_[i].iterator();
  7361. }
  7362.  
  7363. this.field_179423_d = Cartesian.func_179319_b(p_i46018_1_, this.field_179425_c.length);
  7364. }
  7365.  
  7366. private void func_179422_b() {
  7367. this.field_179426_a = -1;
  7368. Arrays.fill(this.field_179425_c, (Object)null);
  7369. Arrays.fill(this.field_179423_d, (Object)null);
  7370. }
  7371.  
  7372. public boolean hasNext() {
  7373. if(this.field_179426_a == -2) {
  7374. this.field_179426_a = 0;
  7375.  
  7376. for(Iterator<? extends T> iterator1 : this.field_179425_c) {
  7377. if(!iterator1.hasNext()) {
  7378. this.func_179422_b();
  7379. break;
  7380. }
  7381. }
  7382.  
  7383. return true;
  7384. } else {
  7385. if(this.field_179426_a >= this.field_179425_c.length) {
  7386. for(this.field_179426_a = this.field_179425_c.length - 1; this.field_179426_a >= 0; --this.field_179426_a) {
  7387. Iterator<? extends T> iterator = this.field_179425_c[this.field_179426_a];
  7388. if(iterator.hasNext()) {
  7389. break;
  7390. }
  7391.  
  7392. if(this.field_179426_a == 0) {
  7393. this.func_179422_b();
  7394. break;
  7395. }
  7396.  
  7397. iterator = this.field_179424_b[this.field_179426_a].iterator();
  7398. this.field_179425_c[this.field_179426_a] = iterator;
  7399. if(!iterator.hasNext()) {
  7400. this.func_179422_b();
  7401. break;
  7402. }
  7403. }
  7404. }
  7405.  
  7406. return this.field_179426_a >= 0;
  7407. }
  7408. }
  7409.  
  7410. public T[] next() {
  7411. if(!this.hasNext()) {
  7412. throw new NoSuchElementException();
  7413. } else {
  7414. while(this.field_179426_a < this.field_179425_c.length) {
  7415. this.field_179423_d[this.field_179426_a] = this.field_179425_c[this.field_179426_a].next();
  7416. ++this.field_179426_a;
  7417. }
  7418.  
  7419. return (T[])((Object[])this.field_179423_d.clone());
  7420. }
  7421. }
  7422. }
  7423. }
  7424. }
  7425.  
  7426. Hunk 2 failed! Cannot find hunk target
  7427. }
  7428.  
  7429. public List<T> apply(@Nullable Object[] p_apply_1_) {
  7430. - return Arrays.<T>asList(p_apply_1_);
  7431. + return Arrays.<T>asList((T[])p_apply_1_);
  7432. }
  7433. }
  7434.  
  7435. File state
  7436. package net.minecraft.util.math;
  7437.  
  7438. import com.google.common.base.Function;
  7439. import com.google.common.collect.Iterables;
  7440. import com.google.common.collect.Lists;
  7441. import com.google.common.collect.UnmodifiableIterator;
  7442. import java.lang.reflect.Array;
  7443. import java.util.Arrays;
  7444. import java.util.Collections;
  7445. import java.util.Iterator;
  7446. import java.util.List;
  7447. import java.util.NoSuchElementException;
  7448. import javax.annotation.Nullable;
  7449.  
  7450. public class Cartesian {
  7451. public static <T> Iterable<T[]> func_179318_a(Class<T> p_179318_0_, Iterable<? extends Iterable<? extends T>> p_179318_1_) {
  7452. return new Cartesian.Product(p_179318_0_, (Iterable[])func_179322_b(Iterable.class, p_179318_1_));
  7453. }
  7454.  
  7455. public static <T> Iterable<List<T>> func_179321_a(Iterable<? extends Iterable<? extends T>> p_179321_0_) {
  7456. return func_179323_b(func_179318_a(Object.class, p_179321_0_));
  7457. }
  7458.  
  7459. private static <T> Iterable<List<T>> func_179323_b(Iterable<Object[]> p_179323_0_) {
  7460. return Iterables.transform(p_179323_0_, new Cartesian.GetList());
  7461. }
  7462.  
  7463. private static <T> T[] func_179322_b(Class<? super T> p_179322_0_, Iterable<? extends T> p_179322_1_) {
  7464. List<T> list = Lists.<T>newArrayList();
  7465.  
  7466. for(T t : p_179322_1_) {
  7467. list.add(t);
  7468. }
  7469.  
  7470. return (T[])((Object[])list.toArray(func_179319_b(p_179322_0_, list.size())));
  7471. }
  7472.  
  7473. private static <T> T[] func_179319_b(Class<? super T> p_179319_0_, int p_179319_1_) {
  7474. return (T[])((Object[])((Object[])Array.newInstance(p_179319_0_, p_179319_1_)));
  7475. }
  7476.  
  7477. static class GetList<T> implements Function<Object[], List<T>> {
  7478. private GetList() {
  7479. }
  7480.  
  7481. public List<T> apply(@Nullable Object[] p_apply_1_) {
  7482. return Arrays.<T>asList((Object[])p_apply_1_);
  7483. }
  7484. }
  7485.  
  7486. static class Product<T> implements Iterable<T[]> {
  7487. private final Class<T> field_179429_a;
  7488. private final Iterable<? extends T>[] field_179428_b;
  7489.  
  7490. private Product(Class<T> p_i46020_1_, Iterable<? extends T>[] p_i46020_2_) {
  7491. this.field_179429_a = p_i46020_1_;
  7492. this.field_179428_b = p_i46020_2_;
  7493. }
  7494.  
  7495. public Iterator<T[]> iterator() {
  7496. return (Iterator<T[]>)(this.field_179428_b.length <= 0?Collections.singletonList((Object[])Cartesian.func_179319_b(this.field_179429_a, 0)).iterator():new Cartesian.Product.ProductIterator(this.field_179429_a, this.field_179428_b));
  7497. }
  7498.  
  7499. static class ProductIterator<T> extends UnmodifiableIterator<T[]> {
  7500. private int field_179426_a;
  7501. private final Iterable<? extends T>[] field_179424_b;
  7502. private final Iterator<? extends T>[] field_179425_c;
  7503. private final T[] field_179423_d;
  7504.  
  7505. private ProductIterator(Class<T> p_i46018_1_, Iterable<? extends T>[] p_i46018_2_) {
  7506. this.field_179426_a = -2;
  7507. this.field_179424_b = p_i46018_2_;
  7508. this.field_179425_c = (Iterator[])Cartesian.func_179319_b(Iterator.class, this.field_179424_b.length);
  7509.  
  7510. for(int i = 0; i < this.field_179424_b.length; ++i) {
  7511. this.field_179425_c[i] = p_i46018_2_[i].iterator();
  7512. }
  7513.  
  7514. this.field_179423_d = Cartesian.func_179319_b(p_i46018_1_, this.field_179425_c.length);
  7515. }
  7516.  
  7517. private void func_179422_b() {
  7518. this.field_179426_a = -1;
  7519. Arrays.fill(this.field_179425_c, (Object)null);
  7520. Arrays.fill(this.field_179423_d, (Object)null);
  7521. }
  7522.  
  7523. public boolean hasNext() {
  7524. if(this.field_179426_a == -2) {
  7525. this.field_179426_a = 0;
  7526.  
  7527. for(Iterator<? extends T> iterator1 : this.field_179425_c) {
  7528. if(!iterator1.hasNext()) {
  7529. this.func_179422_b();
  7530. break;
  7531. }
  7532. }
  7533.  
  7534. return true;
  7535. } else {
  7536. if(this.field_179426_a >= this.field_179425_c.length) {
  7537. for(this.field_179426_a = this.field_179425_c.length - 1; this.field_179426_a >= 0; --this.field_179426_a) {
  7538. Iterator<? extends T> iterator = this.field_179425_c[this.field_179426_a];
  7539. if(iterator.hasNext()) {
  7540. break;
  7541. }
  7542.  
  7543. if(this.field_179426_a == 0) {
  7544. this.func_179422_b();
  7545. break;
  7546. }
  7547.  
  7548. iterator = this.field_179424_b[this.field_179426_a].iterator();
  7549. this.field_179425_c[this.field_179426_a] = iterator;
  7550. if(!iterator.hasNext()) {
  7551. this.func_179422_b();
  7552. break;
  7553. }
  7554. }
  7555. }
  7556.  
  7557. return this.field_179426_a >= 0;
  7558. }
  7559. }
  7560.  
  7561. public T[] next() {
  7562. if(!this.hasNext()) {
  7563. throw new NoSuchElementException();
  7564. } else {
  7565. while(this.field_179426_a < this.field_179425_c.length) {
  7566. this.field_179423_d[this.field_179426_a] = this.field_179425_c[this.field_179426_a].next();
  7567. ++this.field_179426_a;
  7568. }
  7569.  
  7570. return (T[])((Object[])this.field_179423_d.clone());
  7571. }
  7572. }
  7573. }
  7574. }
  7575. }
  7576.  
  7577. Patching failed: minecraft\net\minecraft\util\ObjectIntIdentityMap.java
  7578. Hunk 1 failed! Cannot find hunk target
  7579. this.field_148749_a.put(p_148746_1_, Integer.valueOf(p_148746_2_));
  7580.  
  7581. while(this.field_148748_b.size() <= p_148746_2_) {
  7582. - this.field_148748_b.add((Object)null);
  7583. + this.field_148748_b.add(null);
  7584. }
  7585.  
  7586. this.field_148748_b.set(p_148746_2_, p_148746_1_);
  7587. File state
  7588. package net.minecraft.util;
  7589.  
  7590. import com.google.common.base.Predicates;
  7591. import com.google.common.collect.Iterators;
  7592. import com.google.common.collect.Lists;
  7593. import java.util.IdentityHashMap;
  7594. import java.util.Iterator;
  7595. import java.util.List;
  7596. import javax.annotation.Nullable;
  7597. import net.minecraft.util.IObjectIntIterable;
  7598.  
  7599. public class ObjectIntIdentityMap<T> implements IObjectIntIterable<T> {
  7600. protected final IdentityHashMap<T, Integer> field_148749_a;
  7601. protected final List<T> field_148748_b;
  7602.  
  7603. public ObjectIntIdentityMap() {
  7604. this(512);
  7605. }
  7606.  
  7607. public ObjectIntIdentityMap(int p_i46984_1_) {
  7608. this.field_148748_b = Lists.<T>newArrayListWithExpectedSize(p_i46984_1_);
  7609. this.field_148749_a = new IdentityHashMap(p_i46984_1_);
  7610. }
  7611.  
  7612. public void func_148746_a(T p_148746_1_, int p_148746_2_) {
  7613. this.field_148749_a.put(p_148746_1_, Integer.valueOf(p_148746_2_));
  7614.  
  7615. while(this.field_148748_b.size() <= p_148746_2_) {
  7616. this.field_148748_b.add(null);
  7617. }
  7618.  
  7619. this.field_148748_b.set(p_148746_2_, p_148746_1_);
  7620. }
  7621.  
  7622. public int func_148747_b(T p_148747_1_) {
  7623. Integer integer = (Integer)this.field_148749_a.get(p_148747_1_);
  7624. return integer == null?-1:integer.intValue();
  7625. }
  7626.  
  7627. @Nullable
  7628. public final T func_148745_a(int p_148745_1_) {
  7629. return (T)(p_148745_1_ >= 0 && p_148745_1_ < this.field_148748_b.size()?this.field_148748_b.get(p_148745_1_):null);
  7630. }
  7631.  
  7632. public Iterator<T> iterator() {
  7633. return Iterators.filter(this.field_148748_b.iterator(), Predicates.notNull());
  7634. }
  7635.  
  7636. public int func_186804_a() {
  7637. return this.field_148749_a.size();
  7638. }
  7639. }
  7640.  
  7641. Patching failed: minecraft\net\minecraft\util\NonNullList.java
  7642. Hunk 1 failed! Cannot find hunk target
  7643. Validate.notNull(p_191197_1_);
  7644. Object[] aobject = new Object[p_191197_0_];
  7645. Arrays.fill(aobject, p_191197_1_);
  7646. - return new NonNullList<E>(Arrays.asList(aobject), p_191197_1_);
  7647. + return new NonNullList<E>(Arrays.asList((E[])aobject), p_191197_1_);
  7648. }
  7649.  
  7650. public static <E> NonNullList<E> func_193580_a(E p_193580_0_, E... p_193580_1_) {
  7651. File state
  7652. package net.minecraft.util;
  7653.  
  7654. import java.util.AbstractList;
  7655. import java.util.ArrayList;
  7656. import java.util.Arrays;
  7657. import java.util.List;
  7658. import javax.annotation.Nonnull;
  7659. import javax.annotation.Nullable;
  7660. import org.apache.commons.lang3.Validate;
  7661.  
  7662. public class NonNullList<E> extends AbstractList<E> {
  7663. private final List<E> field_191198_a;
  7664. private final E field_191199_b;
  7665.  
  7666. public static <E> NonNullList<E> func_191196_a() {
  7667. return new NonNullList();
  7668. }
  7669.  
  7670. public static <E> NonNullList<E> func_191197_a(int p_191197_0_, E p_191197_1_) {
  7671. Validate.notNull(p_191197_1_);
  7672. Object[] aobject = new Object[p_191197_0_];
  7673. Arrays.fill(aobject, p_191197_1_);
  7674. return new NonNullList(Arrays.asList(aobject), p_191197_1_);
  7675. }
  7676.  
  7677. public static <E> NonNullList<E> func_193580_a(E p_193580_0_, E... p_193580_1_) {
  7678. return new NonNullList(Arrays.asList(p_193580_1_), p_193580_0_);
  7679. }
  7680.  
  7681. protected NonNullList() {
  7682. this(new ArrayList(), null);
  7683. }
  7684.  
  7685. protected NonNullList(List<E> p_i47327_1_, @Nullable E p_i47327_2_) {
  7686. this.field_191198_a = p_i47327_1_;
  7687. this.field_191199_b = p_i47327_2_;
  7688. }
  7689.  
  7690. @Nonnull
  7691. public E get(int p_get_1_) {
  7692. return this.field_191198_a.get(p_get_1_);
  7693. }
  7694.  
  7695. public E set(int p_set_1_, E p_set_2_) {
  7696. Validate.notNull(p_set_2_);
  7697. return this.field_191198_a.set(p_set_1_, p_set_2_);
  7698. }
  7699.  
  7700. public void add(int p_add_1_, E p_add_2_) {
  7701. Validate.notNull(p_add_2_);
  7702. this.field_191198_a.add(p_add_1_, p_add_2_);
  7703. }
  7704.  
  7705. public E remove(int p_remove_1_) {
  7706. return this.field_191198_a.remove(p_remove_1_);
  7707. }
  7708.  
  7709. public int size() {
  7710. return this.field_191198_a.size();
  7711. }
  7712.  
  7713. public void clear() {
  7714. if(this.field_191199_b == null) {
  7715. super.clear();
  7716. } else {
  7717. for(int i = 0; i < this.size(); ++i) {
  7718. this.set(i, this.field_191199_b);
  7719. }
  7720. }
  7721.  
  7722. }
  7723. }
  7724.  
  7725. Hunk 2 failed! Cannot find hunk target
  7726. }
  7727.  
  7728. protected NonNullList() {
  7729. - this(new ArrayList(), (Object)null);
  7730. + this(new ArrayList(), null);
  7731. }
  7732.  
  7733. protected NonNullList(List<E> p_i47327_1_, @Nullable E p_i47327_2_) {
  7734. File state
  7735. package net.minecraft.util;
  7736.  
  7737. import java.util.AbstractList;
  7738. import java.util.ArrayList;
  7739. import java.util.Arrays;
  7740. import java.util.List;
  7741. import javax.annotation.Nonnull;
  7742. import javax.annotation.Nullable;
  7743. import org.apache.commons.lang3.Validate;
  7744.  
  7745. public class NonNullList<E> extends AbstractList<E> {
  7746. private final List<E> field_191198_a;
  7747. private final E field_191199_b;
  7748.  
  7749. public static <E> NonNullList<E> func_191196_a() {
  7750. return new NonNullList();
  7751. }
  7752.  
  7753. public static <E> NonNullList<E> func_191197_a(int p_191197_0_, E p_191197_1_) {
  7754. Validate.notNull(p_191197_1_);
  7755. Object[] aobject = new Object[p_191197_0_];
  7756. Arrays.fill(aobject, p_191197_1_);
  7757. return new NonNullList(Arrays.asList(aobject), p_191197_1_);
  7758. }
  7759.  
  7760. public static <E> NonNullList<E> func_193580_a(E p_193580_0_, E... p_193580_1_) {
  7761. return new NonNullList(Arrays.asList(p_193580_1_), p_193580_0_);
  7762. }
  7763.  
  7764. protected NonNullList() {
  7765. this(new ArrayList(), null);
  7766. }
  7767.  
  7768. protected NonNullList(List<E> p_i47327_1_, @Nullable E p_i47327_2_) {
  7769. this.field_191198_a = p_i47327_1_;
  7770. this.field_191199_b = p_i47327_2_;
  7771. }
  7772.  
  7773. @Nonnull
  7774. public E get(int p_get_1_) {
  7775. return this.field_191198_a.get(p_get_1_);
  7776. }
  7777.  
  7778. public E set(int p_set_1_, E p_set_2_) {
  7779. Validate.notNull(p_set_2_);
  7780. return this.field_191198_a.set(p_set_1_, p_set_2_);
  7781. }
  7782.  
  7783. public void add(int p_add_1_, E p_add_2_) {
  7784. Validate.notNull(p_add_2_);
  7785. this.field_191198_a.add(p_add_1_, p_add_2_);
  7786. }
  7787.  
  7788. public E remove(int p_remove_1_) {
  7789. return this.field_191198_a.remove(p_remove_1_);
  7790. }
  7791.  
  7792. public int size() {
  7793. return this.field_191198_a.size();
  7794. }
  7795.  
  7796. public void clear() {
  7797. if(this.field_191199_b == null) {
  7798. super.clear();
  7799. } else {
  7800. for(int i = 0; i < this.size(); ++i) {
  7801. this.set(i, this.field_191199_b);
  7802. }
  7803. }
  7804.  
  7805. }
  7806. }
  7807.  
  7808. Patching failed: minecraft\net\minecraft\nbt\NBTUtil.java
  7809. Hunk 1 failed! Cannot find hunk target
  7810. private static <T extends Comparable<T>> IBlockState func_193590_a(IBlockState p_193590_0_, IProperty<T> p_193590_1_, String p_193590_2_, NBTTagCompound p_193590_3_, NBTTagCompound p_193590_4_) {
  7811. Optional<T> optional = p_193590_1_.func_185929_b(p_193590_3_.func_74779_i(p_193590_2_));
  7812. if (optional.isPresent()) {
  7813. - return p_193590_0_.func_177226_a(p_193590_1_, (Comparable)optional.get());
  7814. + return p_193590_0_.func_177226_a(p_193590_1_, optional.get());
  7815. } else {
  7816. field_193591_a.warn("Unable to read property: {} with value: {} for blockstate: {}", p_193590_2_, p_193590_3_.func_74779_i(p_193590_2_), p_193590_4_.toString());
  7817. return p_193590_0_;
  7818. File state
  7819. package net.minecraft.nbt;
  7820.  
  7821. import com.google.common.annotations.VisibleForTesting;
  7822. import com.google.common.base.Optional;
  7823. import com.google.common.collect.UnmodifiableIterator;
  7824. import com.mojang.authlib.GameProfile;
  7825. import com.mojang.authlib.properties.Property;
  7826. import java.util.UUID;
  7827. import java.util.Map.Entry;
  7828. import javax.annotation.Nullable;
  7829. import net.minecraft.block.Block;
  7830. import net.minecraft.block.properties.IProperty;
  7831. import net.minecraft.block.state.BlockStateContainer;
  7832. import net.minecraft.block.state.IBlockState;
  7833. import net.minecraft.init.Blocks;
  7834. import net.minecraft.nbt.NBTBase;
  7835. import net.minecraft.nbt.NBTTagCompound;
  7836. import net.minecraft.nbt.NBTTagList;
  7837. import net.minecraft.util.ResourceLocation;
  7838. import net.minecraft.util.StringUtils;
  7839. import net.minecraft.util.math.BlockPos;
  7840. import org.apache.logging.log4j.LogManager;
  7841. import org.apache.logging.log4j.Logger;
  7842.  
  7843. public final class NBTUtil {
  7844. private static final Logger field_193591_a = LogManager.getLogger();
  7845.  
  7846. @Nullable
  7847. public static GameProfile func_152459_a(NBTTagCompound p_152459_0_) {
  7848. String s = null;
  7849. String s1 = null;
  7850. if(p_152459_0_.func_150297_b("Name", 8)) {
  7851. s = p_152459_0_.func_74779_i("Name");
  7852. }
  7853.  
  7854. if(p_152459_0_.func_150297_b("Id", 8)) {
  7855. s1 = p_152459_0_.func_74779_i("Id");
  7856. }
  7857.  
  7858. try {
  7859. UUID uuid;
  7860. try {
  7861. uuid = UUID.fromString(s1);
  7862. } catch (Throwable var12) {
  7863. uuid = null;
  7864. }
  7865.  
  7866. GameProfile gameprofile = new GameProfile(uuid, s);
  7867. if(p_152459_0_.func_150297_b("Properties", 10)) {
  7868. NBTTagCompound nbttagcompound = p_152459_0_.func_74775_l("Properties");
  7869.  
  7870. for(String s2 : nbttagcompound.func_150296_c()) {
  7871. NBTTagList nbttaglist = nbttagcompound.func_150295_c(s2, 10);
  7872.  
  7873. for(int i = 0; i < nbttaglist.func_74745_c(); ++i) {
  7874. NBTTagCompound nbttagcompound1 = nbttaglist.func_150305_b(i);
  7875. String s3 = nbttagcompound1.func_74779_i("Value");
  7876. if(nbttagcompound1.func_150297_b("Signature", 8)) {
  7877. gameprofile.getProperties().put(s2, new Property(s2, s3, nbttagcompound1.func_74779_i("Signature")));
  7878. } else {
  7879. gameprofile.getProperties().put(s2, new Property(s2, s3));
  7880. }
  7881. }
  7882. }
  7883. }
  7884.  
  7885. return gameprofile;
  7886. } catch (Throwable var13) {
  7887. return null;
  7888. }
  7889. }
  7890.  
  7891. public static NBTTagCompound func_180708_a(NBTTagCompound p_180708_0_, GameProfile p_180708_1_) {
  7892. if(!StringUtils.func_151246_b(p_180708_1_.getName())) {
  7893. p_180708_0_.func_74778_a("Name", p_180708_1_.getName());
  7894. }
  7895.  
  7896. if(p_180708_1_.getId() != null) {
  7897. p_180708_0_.func_74778_a("Id", p_180708_1_.getId().toString());
  7898. }
  7899.  
  7900. if(!p_180708_1_.getProperties().isEmpty()) {
  7901. NBTTagCompound nbttagcompound = new NBTTagCompound();
  7902.  
  7903. for(String s : p_180708_1_.getProperties().keySet()) {
  7904. NBTTagList nbttaglist = new NBTTagList();
  7905.  
  7906. for(Property property : p_180708_1_.getProperties().get(s)) {
  7907. NBTTagCompound nbttagcompound1 = new NBTTagCompound();
  7908. nbttagcompound1.func_74778_a("Value", property.getValue());
  7909. if(property.hasSignature()) {
  7910. nbttagcompound1.func_74778_a("Signature", property.getSignature());
  7911. }
  7912.  
  7913. nbttaglist.func_74742_a(nbttagcompound1);
  7914. }
  7915.  
  7916. nbttagcompound.func_74782_a(s, nbttaglist);
  7917. }
  7918.  
  7919. p_180708_0_.func_74782_a("Properties", nbttagcompound);
  7920. }
  7921.  
  7922. return p_180708_0_;
  7923. }
  7924.  
  7925. @VisibleForTesting
  7926. public static boolean func_181123_a(NBTBase p_181123_0_, NBTBase p_181123_1_, boolean p_181123_2_) {
  7927. if(p_181123_0_ == p_181123_1_) {
  7928. return true;
  7929. } else if(p_181123_0_ == null) {
  7930. return true;
  7931. } else if(p_181123_1_ == null) {
  7932. return false;
  7933. } else if(!p_181123_0_.getClass().equals(p_181123_1_.getClass())) {
  7934. return false;
  7935. } else if(p_181123_0_ instanceof NBTTagCompound) {
  7936. NBTTagCompound nbttagcompound = (NBTTagCompound)p_181123_0_;
  7937. NBTTagCompound nbttagcompound1 = (NBTTagCompound)p_181123_1_;
  7938.  
  7939. for(String s : nbttagcompound.func_150296_c()) {
  7940. NBTBase nbtbase1 = nbttagcompound.func_74781_a(s);
  7941. if(!func_181123_a(nbtbase1, nbttagcompound1.func_74781_a(s), p_181123_2_)) {
  7942. return false;
  7943. }
  7944. }
  7945.  
  7946. return true;
  7947. } else if(p_181123_0_ instanceof NBTTagList && p_181123_2_) {
  7948. NBTTagList nbttaglist = (NBTTagList)p_181123_0_;
  7949. NBTTagList nbttaglist1 = (NBTTagList)p_181123_1_;
  7950. if(nbttaglist.func_82582_d()) {
  7951. return nbttaglist1.func_82582_d();
  7952. } else {
  7953. for(int i = 0; i < nbttaglist.func_74745_c(); ++i) {
  7954. NBTBase nbtbase = nbttaglist.func_179238_g(i);
  7955. boolean flag = false;
  7956.  
  7957. for(int j = 0; j < nbttaglist1.func_74745_c(); ++j) {
  7958. if(func_181123_a(nbtbase, nbttaglist1.func_179238_g(j), p_181123_2_)) {
  7959. flag = true;
  7960. break;
  7961. }
  7962. }
  7963.  
  7964. if(!flag) {
  7965. return false;
  7966. }
  7967. }
  7968.  
  7969. return true;
  7970. }
  7971. } else {
  7972. return p_181123_0_.equals(p_181123_1_);
  7973. }
  7974. }
  7975.  
  7976. public static NBTTagCompound func_186862_a(UUID p_186862_0_) {
  7977. NBTTagCompound nbttagcompound = new NBTTagCompound();
  7978. nbttagcompound.func_74772_a("M", p_186862_0_.getMostSignificantBits());
  7979. nbttagcompound.func_74772_a("L", p_186862_0_.getLeastSignificantBits());
  7980. return nbttagcompound;
  7981. }
  7982.  
  7983. public static UUID func_186860_b(NBTTagCompound p_186860_0_) {
  7984. return new UUID(p_186860_0_.func_74763_f("M"), p_186860_0_.func_74763_f("L"));
  7985. }
  7986.  
  7987. public static BlockPos func_186861_c(NBTTagCompound p_186861_0_) {
  7988. return new BlockPos(p_186861_0_.func_74762_e("X"), p_186861_0_.func_74762_e("Y"), p_186861_0_.func_74762_e("Z"));
  7989. }
  7990.  
  7991. public static NBTTagCompound func_186859_a(BlockPos p_186859_0_) {
  7992. NBTTagCompound nbttagcompound = new NBTTagCompound();
  7993. nbttagcompound.func_74768_a("X", p_186859_0_.func_177958_n());
  7994. nbttagcompound.func_74768_a("Y", p_186859_0_.func_177956_o());
  7995. nbttagcompound.func_74768_a("Z", p_186859_0_.func_177952_p());
  7996. return nbttagcompound;
  7997. }
  7998.  
  7999. public static IBlockState func_190008_d(NBTTagCompound p_190008_0_) {
  8000. if(!p_190008_0_.func_150297_b("Name", 8)) {
  8001. return Blocks.field_150350_a.func_176223_P();
  8002. } else {
  8003. Block block = (Block)Block.field_149771_c.func_82594_a(new ResourceLocation(p_190008_0_.func_74779_i("Name")));
  8004. IBlockState iblockstate = block.func_176223_P();
  8005. if(p_190008_0_.func_150297_b("Properties", 10)) {
  8006. NBTTagCompound nbttagcompound = p_190008_0_.func_74775_l("Properties");
  8007. BlockStateContainer blockstatecontainer = block.func_176194_O();
  8008.  
  8009. for(String s : nbttagcompound.func_150296_c()) {
  8010. IProperty<?> iproperty = blockstatecontainer.func_185920_a(s);
  8011. if(iproperty != null) {
  8012. iblockstate = func_193590_a(iblockstate, iproperty, s, nbttagcompound, p_190008_0_);
  8013. }
  8014. }
  8015. }
  8016.  
  8017. return iblockstate;
  8018. }
  8019. }
  8020.  
  8021. private static <T extends Comparable<T>> IBlockState func_193590_a(IBlockState p_193590_0_, IProperty<T> p_193590_1_, String p_193590_2_, NBTTagCompound p_193590_3_, NBTTagCompound p_193590_4_) {
  8022. Optional<T> optional = p_193590_1_.func_185929_b(p_193590_3_.func_74779_i(p_193590_2_));
  8023. if(optional.isPresent()) {
  8024. return p_193590_0_.func_177226_a(p_193590_1_, (Comparable)optional.get());
  8025. } else {
  8026. field_193591_a.warn((String)"Unable to read property: {} with value: {} for blockstate: {}", (Object)p_193590_2_, p_193590_3_.func_74779_i(p_193590_2_), p_193590_4_.toString());
  8027. return p_193590_0_;
  8028. }
  8029. }
  8030.  
  8031. public static NBTTagCompound func_190009_a(NBTTagCompound p_190009_0_, IBlockState p_190009_1_) {
  8032. p_190009_0_.func_74778_a("Name", ((ResourceLocation)Block.field_149771_c.func_177774_c(p_190009_1_.func_177230_c())).toString());
  8033. if(!p_190009_1_.func_177228_b().isEmpty()) {
  8034. NBTTagCompound nbttagcompound = new NBTTagCompound();
  8035. UnmodifiableIterator unmodifiableiterator = p_190009_1_.func_177228_b().entrySet().iterator();
  8036.  
  8037. while(unmodifiableiterator.hasNext()) {
  8038. Entry<IProperty<?>, Comparable<?>> entry = (Entry)unmodifiableiterator.next();
  8039. IProperty<?> iproperty = (IProperty)entry.getKey();
  8040. nbttagcompound.func_74778_a(iproperty.func_177701_a(), func_190010_a(iproperty, (Comparable)entry.getValue()));
  8041. }
  8042.  
  8043. p_190009_0_.func_74782_a("Properties", nbttagcompound);
  8044. }
  8045.  
  8046. return p_190009_0_;
  8047. }
  8048.  
  8049. private static <T extends Comparable<T>> String func_190010_a(IProperty<T> p_190010_0_, Comparable<?> p_190010_1_) {
  8050. return p_190010_0_.func_177702_a(p_190010_1_);
  8051. }
  8052. }
  8053.  
  8054. Patching failed: minecraft\net\minecraft\nbt\JsonToNBT.java
  8055. Hunk 1 failed! Cannot find hunk target
  8056. }
  8057.  
  8058. if (p_193603_2_ == 1) {
  8059. - list.add(Byte.valueOf(((NBTPrimitive)nbtbase).func_150290_f()));
  8060. + list.add((T)Byte.valueOf(((NBTPrimitive)nbtbase).func_150290_f()));
  8061. } else if (p_193603_2_ == 4) {
  8062. - list.add(Long.valueOf(((NBTPrimitive)nbtbase).func_150291_c()));
  8063. + list.add((T)Long.valueOf(((NBTPrimitive)nbtbase).func_150291_c()));
  8064. } else {
  8065. - list.add(Integer.valueOf(((NBTPrimitive)nbtbase).func_150287_d()));
  8066. + list.add((T)Integer.valueOf(((NBTPrimitive)nbtbase).func_150287_d()));
  8067. }
  8068.  
  8069. if (this.func_193613_m()) {
  8070. File state
  8071. package net.minecraft.nbt;
  8072.  
  8073. import com.google.common.annotations.VisibleForTesting;
  8074. import com.google.common.collect.Lists;
  8075. import java.util.List;
  8076. import java.util.regex.Pattern;
  8077. import net.minecraft.nbt.NBTBase;
  8078. import net.minecraft.nbt.NBTException;
  8079. import net.minecraft.nbt.NBTPrimitive;
  8080. import net.minecraft.nbt.NBTTagByte;
  8081. import net.minecraft.nbt.NBTTagByteArray;
  8082. import net.minecraft.nbt.NBTTagCompound;
  8083. import net.minecraft.nbt.NBTTagDouble;
  8084. import net.minecraft.nbt.NBTTagFloat;
  8085. import net.minecraft.nbt.NBTTagInt;
  8086. import net.minecraft.nbt.NBTTagIntArray;
  8087. import net.minecraft.nbt.NBTTagList;
  8088. import net.minecraft.nbt.NBTTagLong;
  8089. import net.minecraft.nbt.NBTTagLongArray;
  8090. import net.minecraft.nbt.NBTTagShort;
  8091. import net.minecraft.nbt.NBTTagString;
  8092.  
  8093. public class JsonToNBT {
  8094. private static final Pattern field_193615_a = Pattern.compile("[-+]?(?:[0-9]+[.]|[0-9]*[.][0-9]+)(?:e[-+]?[0-9]+)?", 2);
  8095. private static final Pattern field_193616_b = Pattern.compile("[-+]?(?:[0-9]+[.]?|[0-9]*[.][0-9]+)(?:e[-+]?[0-9]+)?d", 2);
  8096. private static final Pattern field_193617_c = Pattern.compile("[-+]?(?:[0-9]+[.]?|[0-9]*[.][0-9]+)(?:e[-+]?[0-9]+)?f", 2);
  8097. private static final Pattern field_193618_d = Pattern.compile("[-+]?(?:0|[1-9][0-9]*)b", 2);
  8098. private static final Pattern field_193619_e = Pattern.compile("[-+]?(?:0|[1-9][0-9]*)l", 2);
  8099. private static final Pattern field_193620_f = Pattern.compile("[-+]?(?:0|[1-9][0-9]*)s", 2);
  8100. private static final Pattern field_193621_g = Pattern.compile("[-+]?(?:0|[1-9][0-9]*)");
  8101. private final String field_193622_h;
  8102. private int field_193623_i;
  8103.  
  8104. public static NBTTagCompound func_180713_a(String p_180713_0_) throws NBTException {
  8105. return (new JsonToNBT(p_180713_0_)).func_193609_a();
  8106. }
  8107.  
  8108. @VisibleForTesting
  8109. NBTTagCompound func_193609_a() throws NBTException {
  8110. NBTTagCompound nbttagcompound = this.func_193593_f();
  8111. this.func_193607_l();
  8112. if(this.func_193612_g()) {
  8113. ++this.field_193623_i;
  8114. throw this.func_193602_b("Trailing data found");
  8115. } else {
  8116. return nbttagcompound;
  8117. }
  8118. }
  8119.  
  8120. @VisibleForTesting
  8121. JsonToNBT(String p_i47522_1_) {
  8122. this.field_193622_h = p_i47522_1_;
  8123. }
  8124.  
  8125. protected String func_193601_b() throws NBTException {
  8126. this.func_193607_l();
  8127. if(!this.func_193612_g()) {
  8128. throw this.func_193602_b("Expected key");
  8129. } else {
  8130. return this.func_193598_n() == 34?this.func_193595_h():this.func_193614_i();
  8131. }
  8132. }
  8133.  
  8134. private NBTException func_193602_b(String p_193602_1_) {
  8135. return new NBTException(p_193602_1_, this.field_193622_h, this.field_193623_i);
  8136. }
  8137.  
  8138. protected NBTBase func_193611_c() throws NBTException {
  8139. this.func_193607_l();
  8140. if(this.func_193598_n() == 34) {
  8141. return new NBTTagString(this.func_193595_h());
  8142. } else {
  8143. String s = this.func_193614_i();
  8144. if(s.isEmpty()) {
  8145. throw this.func_193602_b("Expected value");
  8146. } else {
  8147. return this.func_193596_c(s);
  8148. }
  8149. }
  8150. }
  8151.  
  8152. private NBTBase func_193596_c(String p_193596_1_) {
  8153. try {
  8154. if(field_193617_c.matcher(p_193596_1_).matches()) {
  8155. return new NBTTagFloat(Float.parseFloat(p_193596_1_.substring(0, p_193596_1_.length() - 1)));
  8156. }
  8157.  
  8158. if(field_193618_d.matcher(p_193596_1_).matches()) {
  8159. return new NBTTagByte(Byte.parseByte(p_193596_1_.substring(0, p_193596_1_.length() - 1)));
  8160. }
  8161.  
  8162. if(field_193619_e.matcher(p_193596_1_).matches()) {
  8163. return new NBTTagLong(Long.parseLong(p_193596_1_.substring(0, p_193596_1_.length() - 1)));
  8164. }
  8165.  
  8166. if(field_193620_f.matcher(p_193596_1_).matches()) {
  8167. return new NBTTagShort(Short.parseShort(p_193596_1_.substring(0, p_193596_1_.length() - 1)));
  8168. }
  8169.  
  8170. if(field_193621_g.matcher(p_193596_1_).matches()) {
  8171. return new NBTTagInt(Integer.parseInt(p_193596_1_));
  8172. }
  8173.  
  8174. if(field_193616_b.matcher(p_193596_1_).matches()) {
  8175. return new NBTTagDouble(Double.parseDouble(p_193596_1_.substring(0, p_193596_1_.length() - 1)));
  8176. }
  8177.  
  8178. if(field_193615_a.matcher(p_193596_1_).matches()) {
  8179. return new NBTTagDouble(Double.parseDouble(p_193596_1_));
  8180. }
  8181.  
  8182. if("true".equalsIgnoreCase(p_193596_1_)) {
  8183. return new NBTTagByte((byte)1);
  8184. }
  8185.  
  8186. if("false".equalsIgnoreCase(p_193596_1_)) {
  8187. return new NBTTagByte((byte)0);
  8188. }
  8189. } catch (NumberFormatException var3) {
  8190. ;
  8191. }
  8192.  
  8193. return new NBTTagString(p_193596_1_);
  8194. }
  8195.  
  8196. private String func_193595_h() throws NBTException {
  8197. int i = ++this.field_193623_i;
  8198. StringBuilder stringbuilder = null;
  8199. boolean flag = false;
  8200.  
  8201. while(this.func_193612_g()) {
  8202. char c0 = this.func_193594_o();
  8203. if(flag) {
  8204. if(c0 != 92 && c0 != 34) {
  8205. throw this.func_193602_b("Invalid escape of \'" + c0 + "\'");
  8206. }
  8207.  
  8208. flag = false;
  8209. } else {
  8210. if(c0 == 92) {
  8211. flag = true;
  8212. if(stringbuilder == null) {
  8213. stringbuilder = new StringBuilder(this.field_193622_h.substring(i, this.field_193623_i - 1));
  8214. }
  8215. continue;
  8216. }
  8217.  
  8218. if(c0 == 34) {
  8219. return stringbuilder == null?this.field_193622_h.substring(i, this.field_193623_i - 1):stringbuilder.toString();
  8220. }
  8221. }
  8222.  
  8223. if(stringbuilder != null) {
  8224. stringbuilder.append(c0);
  8225. }
  8226. }
  8227.  
  8228. throw this.func_193602_b("Missing termination quote");
  8229. }
  8230.  
  8231. private String func_193614_i() {
  8232. int i;
  8233. for(i = this.field_193623_i; this.func_193612_g() && this.func_193599_a(this.func_193598_n()); ++this.field_193623_i) {
  8234. ;
  8235. }
  8236.  
  8237. return this.field_193622_h.substring(i, this.field_193623_i);
  8238. }
  8239.  
  8240. protected NBTBase func_193610_d() throws NBTException {
  8241. this.func_193607_l();
  8242. if(!this.func_193612_g()) {
  8243. throw this.func_193602_b("Expected value");
  8244. } else {
  8245. char c0 = this.func_193598_n();
  8246. return (NBTBase)(c0 == 123?this.func_193593_f():(c0 == 91?this.func_193605_e():this.func_193611_c()));
  8247. }
  8248. }
  8249.  
  8250. protected NBTBase func_193605_e() throws NBTException {
  8251. return this.func_193608_a(2) && this.func_193597_b(1) != 34 && this.func_193597_b(2) == 59?this.func_193606_k():this.func_193600_j();
  8252. }
  8253.  
  8254. protected NBTTagCompound func_193593_f() throws NBTException {
  8255. this.func_193604_b('{');
  8256. NBTTagCompound nbttagcompound = new NBTTagCompound();
  8257. this.func_193607_l();
  8258.  
  8259. while(this.func_193612_g() && this.func_193598_n() != 125) {
  8260. String s = this.func_193601_b();
  8261. if(s.isEmpty()) {
  8262. throw this.func_193602_b("Expected non-empty key");
  8263. }
  8264.  
  8265. this.func_193604_b(':');
  8266. nbttagcompound.func_74782_a(s, this.func_193610_d());
  8267. if(!this.func_193613_m()) {
  8268. break;
  8269. }
  8270.  
  8271. if(!this.func_193612_g()) {
  8272. throw this.func_193602_b("Expected key");
  8273. }
  8274. }
  8275.  
  8276. this.func_193604_b('}');
  8277. return nbttagcompound;
  8278. }
  8279.  
  8280. private NBTBase func_193600_j() throws NBTException {
  8281. this.func_193604_b('[');
  8282. this.func_193607_l();
  8283. if(!this.func_193612_g()) {
  8284. throw this.func_193602_b("Expected value");
  8285. } else {
  8286. NBTTagList nbttaglist = new NBTTagList();
  8287. int i = -1;
  8288.  
  8289. while(this.func_193598_n() != 93) {
  8290. NBTBase nbtbase = this.func_193610_d();
  8291. int j = nbtbase.func_74732_a();
  8292. if(i < 0) {
  8293. i = j;
  8294. } else if(j != i) {
  8295. throw this.func_193602_b("Unable to insert " + NBTBase.func_193581_j(j) + " into ListTag of type " + NBTBase.func_193581_j(i));
  8296. }
  8297.  
  8298. nbttaglist.func_74742_a(nbtbase);
  8299. if(!this.func_193613_m()) {
  8300. break;
  8301. }
  8302.  
  8303. if(!this.func_193612_g()) {
  8304. throw this.func_193602_b("Expected value");
  8305. }
  8306. }
  8307.  
  8308. this.func_193604_b(']');
  8309. return nbttaglist;
  8310. }
  8311. }
  8312.  
  8313. private NBTBase func_193606_k() throws NBTException {
  8314. this.func_193604_b('[');
  8315. char c0 = this.func_193594_o();
  8316. this.func_193594_o();
  8317. this.func_193607_l();
  8318. if(!this.func_193612_g()) {
  8319. throw this.func_193602_b("Expected value");
  8320. } else if(c0 == 66) {
  8321. return new NBTTagByteArray(this.func_193603_a((byte)7, (byte)1));
  8322. } else if(c0 == 76) {
  8323. return new NBTTagLongArray(this.func_193603_a((byte)12, (byte)4));
  8324. } else if(c0 == 73) {
  8325. return new NBTTagIntArray(this.func_193603_a((byte)11, (byte)3));
  8326. } else {
  8327. throw this.func_193602_b("Invalid array type \'" + c0 + "\' found");
  8328. }
  8329. }
  8330.  
  8331. private <T extends Number> List<T> func_193603_a(byte p_193603_1_, byte p_193603_2_) throws NBTException {
  8332. List<T> list = Lists.<T>newArrayList();
  8333.  
  8334. while(true) {
  8335. if(this.func_193598_n() != 93) {
  8336. NBTBase nbtbase = this.func_193610_d();
  8337. int i = nbtbase.func_74732_a();
  8338. if(i != p_193603_2_) {
  8339. throw this.func_193602_b("Unable to insert " + NBTBase.func_193581_j(i) + " into " + NBTBase.func_193581_j(p_193603_1_));
  8340. }
  8341.  
  8342. if(p_193603_2_ == 1) {
  8343. list.add(Byte.valueOf(((NBTPrimitive)nbtbase).func_150290_f()));
  8344. } else if(p_193603_2_ == 4) {
  8345. list.add(Long.valueOf(((NBTPrimitive)nbtbase).func_150291_c()));
  8346. } else {
  8347. list.add(Integer.valueOf(((NBTPrimitive)nbtbase).func_150287_d()));
  8348. }
  8349.  
  8350. if(this.func_193613_m()) {
  8351. if(!this.func_193612_g()) {
  8352. throw this.func_193602_b("Expected value");
  8353. }
  8354. continue;
  8355. }
  8356. }
  8357.  
  8358. this.func_193604_b(']');
  8359. return list;
  8360. }
  8361. }
  8362.  
  8363. private void func_193607_l() {
  8364. while(this.func_193612_g() && Character.isWhitespace(this.func_193598_n())) {
  8365. ++this.field_193623_i;
  8366. }
  8367.  
  8368. }
  8369.  
  8370. private boolean func_193613_m() {
  8371. this.func_193607_l();
  8372. if(this.func_193612_g() && this.func_193598_n() == 44) {
  8373. ++this.field_193623_i;
  8374. this.func_193607_l();
  8375. return true;
  8376. } else {
  8377. return false;
  8378. }
  8379. }
  8380.  
  8381. private void func_193604_b(char p_193604_1_) throws NBTException {
  8382. this.func_193607_l();
  8383. boolean flag = this.func_193612_g();
  8384. if(flag && this.func_193598_n() == p_193604_1_) {
  8385. ++this.field_193623_i;
  8386. } else {
  8387. throw new NBTException("Expected \'" + p_193604_1_ + "\' but got \'" + (flag?Character.valueOf(this.func_193598_n()):"<EOF>") + "\'", this.field_193622_h, this.field_193623_i + 1);
  8388. }
  8389. }
  8390.  
  8391. protected boolean func_193599_a(char p_193599_1_) {
  8392. return p_193599_1_ >= 48 && p_193599_1_ <= 57 || p_193599_1_ >= 65 && p_193599_1_ <= 90 || p_193599_1_ >= 97 && p_193599_1_ <= 122 || p_193599_1_ == 95 || p_193599_1_ == 45 || p_193599_1_ == 46 || p_193599_1_ == 43;
  8393. }
  8394.  
  8395. private boolean func_193608_a(int p_193608_1_) {
  8396. return this.field_193623_i + p_193608_1_ < this.field_193622_h.length();
  8397. }
  8398.  
  8399. boolean func_193612_g() {
  8400. return this.func_193608_a(0);
  8401. }
  8402.  
  8403. private char func_193597_b(int p_193597_1_) {
  8404. return this.field_193622_h.charAt(this.field_193623_i + p_193597_1_);
  8405. }
  8406.  
  8407. private char func_193598_n() {
  8408. return this.func_193597_b(0);
  8409. }
  8410.  
  8411. private char func_193594_o() {
  8412. return this.field_193622_h.charAt(this.field_193623_i++);
  8413. }
  8414. }
  8415.  
  8416. Patching failed: minecraft\net\minecraft\network\NetworkManager.java
  8417. Hunk 1 failed! Cannot find hunk target
  8418. protected void channelRead0(ChannelHandlerContext p_channelRead0_1_, Packet<?> p_channelRead0_2_) throws Exception {
  8419. if (this.field_150746_k.isOpen()) {
  8420. try {
  8421. - p_channelRead0_2_.func_148833_a(this.field_150744_m);
  8422. + ((Packet<INetHandler>)p_channelRead0_2_).func_148833_a(this.field_150744_m);
  8423. } catch (ThreadQuickExitException var4) {
  8424. ;
  8425. }
  8426. File state
  8427. package net.minecraft.network;
  8428.  
  8429. import com.google.common.collect.Queues;
  8430. import com.google.common.util.concurrent.ThreadFactoryBuilder;
  8431. import io.netty.bootstrap.Bootstrap;
  8432. import io.netty.channel.Channel;
  8433. import io.netty.channel.ChannelException;
  8434. import io.netty.channel.ChannelFuture;
  8435. import io.netty.channel.ChannelFutureListener;
  8436. import io.netty.channel.ChannelHandler;
  8437. import io.netty.channel.ChannelHandlerContext;
  8438. import io.netty.channel.ChannelInitializer;
  8439. import io.netty.channel.ChannelOption;
  8440. import io.netty.channel.EventLoopGroup;
  8441. import io.netty.channel.SimpleChannelInboundHandler;
  8442. import io.netty.channel.epoll.Epoll;
  8443. import io.netty.channel.epoll.EpollEventLoopGroup;
  8444. import io.netty.channel.epoll.EpollSocketChannel;
  8445. import io.netty.channel.local.LocalChannel;
  8446. import io.netty.channel.local.LocalEventLoopGroup;
  8447. import io.netty.channel.local.LocalServerChannel;
  8448. import io.netty.channel.nio.NioEventLoopGroup;
  8449. import io.netty.channel.socket.SocketChannel;
  8450. import io.netty.channel.socket.nio.NioSocketChannel;
  8451. import io.netty.handler.timeout.ReadTimeoutHandler;
  8452. import io.netty.handler.timeout.TimeoutException;
  8453. import io.netty.util.AttributeKey;
  8454. import io.netty.util.concurrent.Future;
  8455. import io.netty.util.concurrent.GenericFutureListener;
  8456. import java.net.InetAddress;
  8457. import java.net.SocketAddress;
  8458. import java.util.Queue;
  8459. import java.util.concurrent.locks.ReentrantReadWriteLock;
  8460. import javax.annotation.Nullable;
  8461. import javax.crypto.SecretKey;
  8462. import net.minecraft.network.EnumConnectionState;
  8463. import net.minecraft.network.EnumPacketDirection;
  8464. import net.minecraft.network.INetHandler;
  8465. import net.minecraft.network.NettyCompressionDecoder;
  8466. import net.minecraft.network.NettyCompressionEncoder;
  8467. import net.minecraft.network.NettyEncryptingDecoder;
  8468. import net.minecraft.network.NettyEncryptingEncoder;
  8469. import net.minecraft.network.NettyPacketDecoder;
  8470. import net.minecraft.network.NettyPacketEncoder;
  8471. import net.minecraft.network.NettyVarint21FrameDecoder;
  8472. import net.minecraft.network.NettyVarint21FrameEncoder;
  8473. import net.minecraft.network.Packet;
  8474. import net.minecraft.network.ThreadQuickExitException;
  8475. import net.minecraft.util.CryptManager;
  8476. import net.minecraft.util.ITickable;
  8477. import net.minecraft.util.LazyLoadBase;
  8478. import net.minecraft.util.text.ITextComponent;
  8479. import net.minecraft.util.text.TextComponentTranslation;
  8480. import net.minecraftforge.fml.relauncher.Side;
  8481. import net.minecraftforge.fml.relauncher.SideOnly;
  8482. import org.apache.commons.lang3.ArrayUtils;
  8483. import org.apache.commons.lang3.Validate;
  8484. import org.apache.logging.log4j.LogManager;
  8485. import org.apache.logging.log4j.Logger;
  8486. import org.apache.logging.log4j.Marker;
  8487. import org.apache.logging.log4j.MarkerManager;
  8488.  
  8489. public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
  8490. private static final Logger field_150735_g = LogManager.getLogger();
  8491. public static final Marker field_150740_a = MarkerManager.getMarker("NETWORK");
  8492. public static final Marker field_150738_b = MarkerManager.getMarker("NETWORK_PACKETS", field_150740_a);
  8493. public static final AttributeKey<EnumConnectionState> field_150739_c = AttributeKey.<EnumConnectionState>valueOf("protocol");
  8494. public static final LazyLoadBase<NioEventLoopGroup> field_179295_d = new LazyLoadBase<NioEventLoopGroup>() {
  8495. protected NioEventLoopGroup func_179280_b() {
  8496. return new NioEventLoopGroup(0, (new ThreadFactoryBuilder()).setNameFormat("Netty Client IO #%d").setDaemon(true).build());
  8497. }
  8498. };
  8499. public static final LazyLoadBase<EpollEventLoopGroup> field_181125_e = new LazyLoadBase<EpollEventLoopGroup>() {
  8500. protected EpollEventLoopGroup func_179280_b() {
  8501. return new EpollEventLoopGroup(0, (new ThreadFactoryBuilder()).setNameFormat("Netty Epoll Client IO #%d").setDaemon(true).build());
  8502. }
  8503. };
  8504. public static final LazyLoadBase<LocalEventLoopGroup> field_179296_e = new LazyLoadBase<LocalEventLoopGroup>() {
  8505. protected LocalEventLoopGroup func_179280_b() {
  8506. return new LocalEventLoopGroup(0, (new ThreadFactoryBuilder()).setNameFormat("Netty Local Client IO #%d").setDaemon(true).build());
  8507. }
  8508. };
  8509. private final EnumPacketDirection field_179294_g;
  8510. private final Queue<NetworkManager.InboundHandlerTuplePacketListener> field_150745_j = Queues.<NetworkManager.InboundHandlerTuplePacketListener>newConcurrentLinkedQueue();
  8511. private final ReentrantReadWriteLock field_181680_j = new ReentrantReadWriteLock();
  8512. private Channel field_150746_k;
  8513. private SocketAddress field_150743_l;
  8514. private INetHandler field_150744_m;
  8515. private ITextComponent field_150742_o;
  8516. private boolean field_152463_r;
  8517. private boolean field_179297_n;
  8518.  
  8519. public NetworkManager(EnumPacketDirection p_i46004_1_) {
  8520. this.field_179294_g = p_i46004_1_;
  8521. }
  8522.  
  8523. public void channelActive(ChannelHandlerContext p_channelActive_1_) throws Exception {
  8524. super.channelActive(p_channelActive_1_);
  8525. this.field_150746_k = p_channelActive_1_.channel();
  8526. this.field_150743_l = this.field_150746_k.remoteAddress();
  8527.  
  8528. try {
  8529. this.func_150723_a(EnumConnectionState.HANDSHAKING);
  8530. } catch (Throwable throwable) {
  8531. field_150735_g.fatal((Object)throwable);
  8532. }
  8533.  
  8534. }
  8535.  
  8536. public void func_150723_a(EnumConnectionState p_150723_1_) {
  8537. this.field_150746_k.attr(field_150739_c).set(p_150723_1_);
  8538. this.field_150746_k.config().setAutoRead(true);
  8539. field_150735_g.debug("Enabled auto read");
  8540. }
  8541.  
  8542. public void channelInactive(ChannelHandlerContext p_channelInactive_1_) throws Exception {
  8543. this.func_150718_a(new TextComponentTranslation("disconnect.endOfStream", new Object[0]));
  8544. }
  8545.  
  8546. public void exceptionCaught(ChannelHandlerContext p_exceptionCaught_1_, Throwable p_exceptionCaught_2_) throws Exception {
  8547. TextComponentTranslation textcomponenttranslation;
  8548. if(p_exceptionCaught_2_ instanceof TimeoutException) {
  8549. textcomponenttranslation = new TextComponentTranslation("disconnect.timeout", new Object[0]);
  8550. } else {
  8551. textcomponenttranslation = new TextComponentTranslation("disconnect.genericReason", new Object[]{"Internal Exception: " + p_exceptionCaught_2_});
  8552. }
  8553.  
  8554. field_150735_g.debug(textcomponenttranslation.func_150260_c(), p_exceptionCaught_2_);
  8555. this.func_150718_a(textcomponenttranslation);
  8556. }
  8557.  
  8558. protected void channelRead0(ChannelHandlerContext p_channelRead0_1_, Packet<?> p_channelRead0_2_) throws Exception {
  8559. if(this.field_150746_k.isOpen()) {
  8560. try {
  8561. p_channelRead0_2_.func_148833_a(this.field_150744_m);
  8562. } catch (ThreadQuickExitException var4) {
  8563. ;
  8564. }
  8565. }
  8566.  
  8567. }
  8568.  
  8569. public void func_150719_a(INetHandler p_150719_1_) {
  8570. Validate.notNull(p_150719_1_, "packetListener", new Object[0]);
  8571. field_150735_g.debug((String)"Set listener of {} to {}", (Object)this, (Object)p_150719_1_);
  8572. this.field_150744_m = p_150719_1_;
  8573. }
  8574.  
  8575. public void func_179290_a(Packet<?> p_179290_1_) {
  8576. if(this.func_150724_d()) {
  8577. this.func_150733_h();
  8578. this.func_150732_b(p_179290_1_, (GenericFutureListener<? extends Future<? super Void>>[])null);
  8579. } else {
  8580. this.field_181680_j.writeLock().lock();
  8581.  
  8582. try {
  8583. this.field_150745_j.add(new NetworkManager.InboundHandlerTuplePacketListener(p_179290_1_, new GenericFutureListener[0]));
  8584. } finally {
  8585. this.field_181680_j.writeLock().unlock();
  8586. }
  8587. }
  8588.  
  8589. }
  8590.  
  8591. public void func_179288_a(Packet<?> p_179288_1_, GenericFutureListener<? extends Future<? super Void>> p_179288_2_, GenericFutureListener<? extends Future<? super Void>>... p_179288_3_) {
  8592. if(this.func_150724_d()) {
  8593. this.func_150733_h();
  8594. this.func_150732_b(p_179288_1_, (GenericFutureListener[])ArrayUtils.add(p_179288_3_, 0, p_179288_2_));
  8595. } else {
  8596. this.field_181680_j.writeLock().lock();
  8597.  
  8598. try {
  8599. this.field_150745_j.add(new NetworkManager.InboundHandlerTuplePacketListener(p_179288_1_, (GenericFutureListener[])ArrayUtils.add(p_179288_3_, 0, p_179288_2_)));
  8600. } finally {
  8601. this.field_181680_j.writeLock().unlock();
  8602. }
  8603. }
  8604.  
  8605. }
  8606.  
  8607. private void func_150732_b(final Packet<?> p_150732_1_, @Nullable final GenericFutureListener<? extends Future<? super Void>>[] p_150732_2_) {
  8608. final EnumConnectionState enumconnectionstate = EnumConnectionState.func_150752_a(p_150732_1_);
  8609. final EnumConnectionState enumconnectionstate1 = (EnumConnectionState)this.field_150746_k.attr(field_150739_c).get();
  8610. if(enumconnectionstate1 != enumconnectionstate) {
  8611. field_150735_g.debug("Disabled auto read");
  8612. this.field_150746_k.config().setAutoRead(false);
  8613. }
  8614.  
  8615. if(this.field_150746_k.eventLoop().inEventLoop()) {
  8616. if(enumconnectionstate != enumconnectionstate1) {
  8617. this.func_150723_a(enumconnectionstate);
  8618. }
  8619.  
  8620. ChannelFuture channelfuture = this.field_150746_k.writeAndFlush(p_150732_1_);
  8621. if(p_150732_2_ != null) {
  8622. channelfuture.addListeners(p_150732_2_);
  8623. }
  8624.  
  8625. channelfuture.addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE);
  8626. } else {
  8627. this.field_150746_k.eventLoop().execute(new Runnable() {
  8628. public void run() {
  8629. if(enumconnectionstate != enumconnectionstate1) {
  8630. NetworkManager.this.func_150723_a(enumconnectionstate);
  8631. }
  8632.  
  8633. ChannelFuture channelfuture1 = NetworkManager.this.field_150746_k.writeAndFlush(p_150732_1_);
  8634. if(p_150732_2_ != null) {
  8635. channelfuture1.addListeners(p_150732_2_);
  8636. }
  8637.  
  8638. channelfuture1.addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE);
  8639. }
  8640. });
  8641. }
  8642.  
  8643. }
  8644.  
  8645. private void func_150733_h() {
  8646. if(this.field_150746_k != null && this.field_150746_k.isOpen()) {
  8647. this.field_181680_j.readLock().lock();
  8648.  
  8649. try {
  8650. while(!this.field_150745_j.isEmpty()) {
  8651. NetworkManager.InboundHandlerTuplePacketListener networkmanager$inboundhandlertuplepacketlistener = (NetworkManager.InboundHandlerTuplePacketListener)this.field_150745_j.poll();
  8652. this.func_150732_b(networkmanager$inboundhandlertuplepacketlistener.field_150774_a, networkmanager$inboundhandlertuplepacketlistener.field_150773_b);
  8653. }
  8654. } finally {
  8655. this.field_181680_j.readLock().unlock();
  8656. }
  8657.  
  8658. }
  8659. }
  8660.  
  8661. public void func_74428_b() {
  8662. this.func_150733_h();
  8663. if(this.field_150744_m instanceof ITickable) {
  8664. ((ITickable)this.field_150744_m).func_73660_a();
  8665. }
  8666.  
  8667. if(this.field_150746_k != null) {
  8668. this.field_150746_k.flush();
  8669. }
  8670.  
  8671. }
  8672.  
  8673. public SocketAddress func_74430_c() {
  8674. return this.field_150743_l;
  8675. }
  8676.  
  8677. public void func_150718_a(ITextComponent p_150718_1_) {
  8678. if(this.field_150746_k.isOpen()) {
  8679. this.field_150746_k.close().awaitUninterruptibly();
  8680. this.field_150742_o = p_150718_1_;
  8681. }
  8682.  
  8683. }
  8684.  
  8685. public boolean func_150731_c() {
  8686. return this.field_150746_k instanceof LocalChannel || this.field_150746_k instanceof LocalServerChannel;
  8687. }
  8688.  
  8689. @SideOnly(Side.CLIENT)
  8690. public static NetworkManager func_181124_a(InetAddress p_181124_0_, int p_181124_1_, boolean p_181124_2_) {
  8691. final NetworkManager networkmanager = new NetworkManager(EnumPacketDirection.CLIENTBOUND);
  8692. Class<? extends SocketChannel> oclass;
  8693. LazyLoadBase<? extends EventLoopGroup> lazyloadbase;
  8694. if(Epoll.isAvailable() && p_181124_2_) {
  8695. oclass = EpollSocketChannel.class;
  8696. lazyloadbase = field_181125_e;
  8697. } else {
  8698. oclass = NioSocketChannel.class;
  8699. lazyloadbase = field_179295_d;
  8700. }
  8701.  
  8702. ((Bootstrap)((Bootstrap)((Bootstrap)(new Bootstrap()).group((EventLoopGroup)lazyloadbase.func_179281_c())).handler(new ChannelInitializer<Channel>() {
  8703. protected void initChannel(Channel p_initChannel_1_) throws Exception {
  8704. try {
  8705. p_initChannel_1_.config().setOption(ChannelOption.TCP_NODELAY, Boolean.valueOf(true));
  8706. } catch (ChannelException var3) {
  8707. ;
  8708. }
  8709.  
  8710. p_initChannel_1_.pipeline().addLast((String)"timeout", (ChannelHandler)(new ReadTimeoutHandler(30))).addLast((String)"splitter", (ChannelHandler)(new NettyVarint21FrameDecoder())).addLast((String)"decoder", (ChannelHandler)(new NettyPacketDecoder(EnumPacketDirection.CLIENTBOUND))).addLast((String)"prepender", (ChannelHandler)(new NettyVarint21FrameEncoder())).addLast((String)"encoder", (ChannelHandler)(new NettyPacketEncoder(EnumPacketDirection.SERVERBOUND))).addLast((String)"packet_handler", (ChannelHandler)networkmanager);
  8711. }
  8712. })).channel(oclass)).connect(p_181124_0_, p_181124_1_).syncUninterruptibly();
  8713. return networkmanager;
  8714. }
  8715.  
  8716. @SideOnly(Side.CLIENT)
  8717. public static NetworkManager func_150722_a(SocketAddress p_150722_0_) {
  8718. final NetworkManager networkmanager = new NetworkManager(EnumPacketDirection.CLIENTBOUND);
  8719. ((Bootstrap)((Bootstrap)((Bootstrap)(new Bootstrap()).group((EventLoopGroup)field_179296_e.func_179281_c())).handler(new ChannelInitializer<Channel>() {
  8720. protected void initChannel(Channel p_initChannel_1_) throws Exception {
  8721. p_initChannel_1_.pipeline().addLast((String)"packet_handler", (ChannelHandler)networkmanager);
  8722. }
  8723. })).channel(LocalChannel.class)).connect(p_150722_0_).syncUninterruptibly();
  8724. return networkmanager;
  8725. }
  8726.  
  8727. public void func_150727_a(SecretKey p_150727_1_) {
  8728. this.field_152463_r = true;
  8729. this.field_150746_k.pipeline().addBefore("splitter", "decrypt", new NettyEncryptingDecoder(CryptManager.func_151229_a(2, p_150727_1_)));
  8730. this.field_150746_k.pipeline().addBefore("prepender", "encrypt", new NettyEncryptingEncoder(CryptManager.func_151229_a(1, p_150727_1_)));
  8731. }
  8732.  
  8733. @SideOnly(Side.CLIENT)
  8734. public boolean func_179292_f() {
  8735. return this.field_152463_r;
  8736. }
  8737.  
  8738. public boolean func_150724_d() {
  8739. return this.field_150746_k != null && this.field_150746_k.isOpen();
  8740. }
  8741.  
  8742. public boolean func_179291_h() {
  8743. return this.field_150746_k == null;
  8744. }
  8745.  
  8746. public INetHandler func_150729_e() {
  8747. return this.field_150744_m;
  8748. }
  8749.  
  8750. public ITextComponent func_150730_f() {
  8751. return this.field_150742_o;
  8752. }
  8753.  
  8754. public void func_150721_g() {
  8755. this.field_150746_k.config().setAutoRead(false);
  8756. }
  8757.  
  8758. public void func_179289_a(int p_179289_1_) {
  8759. if(p_179289_1_ >= 0) {
  8760. if(this.field_150746_k.pipeline().get("decompress") instanceof NettyCompressionDecoder) {
  8761. ((NettyCompressionDecoder)this.field_150746_k.pipeline().get("decompress")).func_179303_a(p_179289_1_);
  8762. } else {
  8763. this.field_150746_k.pipeline().addBefore("decoder", "decompress", new NettyCompressionDecoder(p_179289_1_));
  8764. }
  8765.  
  8766. if(this.field_150746_k.pipeline().get("compress") instanceof NettyCompressionEncoder) {
  8767. ((NettyCompressionEncoder)this.field_150746_k.pipeline().get("compress")).func_179299_a(p_179289_1_);
  8768. } else {
  8769. this.field_150746_k.pipeline().addBefore("encoder", "compress", new NettyCompressionEncoder(p_179289_1_));
  8770. }
  8771. } else {
  8772. if(this.field_150746_k.pipeline().get("decompress") instanceof NettyCompressionDecoder) {
  8773. this.field_150746_k.pipeline().remove("decompress");
  8774. }
  8775.  
  8776. if(this.field_150746_k.pipeline().get("compress") instanceof NettyCompressionEncoder) {
  8777. this.field_150746_k.pipeline().remove("compress");
  8778. }
  8779. }
  8780.  
  8781. }
  8782.  
  8783. public void func_179293_l() {
  8784. if(this.field_150746_k != null && !this.field_150746_k.isOpen()) {
  8785. if(this.field_179297_n) {
  8786. field_150735_g.warn("handleDisconnection() called twice");
  8787. } else {
  8788. this.field_179297_n = true;
  8789. if(this.func_150730_f() != null) {
  8790. this.func_150729_e().func_147231_a(this.func_150730_f());
  8791. } else if(this.func_150729_e() != null) {
  8792. this.func_150729_e().func_147231_a(new TextComponentTranslation("multiplayer.disconnect.generic", new Object[0]));
  8793. }
  8794. }
  8795.  
  8796. }
  8797. }
  8798.  
  8799. static class InboundHandlerTuplePacketListener {
  8800. private final Packet<?> field_150774_a;
  8801. private final GenericFutureListener<? extends Future<? super Void>>[] field_150773_b;
  8802.  
  8803. public InboundHandlerTuplePacketListener(Packet<?> p_i45146_1_, GenericFutureListener<? extends Future<? super Void>>... p_i45146_2_) {
  8804. this.field_150774_a = p_i45146_1_;
  8805. this.field_150773_b = p_i45146_2_;
  8806. }
  8807. }
  8808. }
  8809.  
  8810. Patching failed: minecraft\net\minecraft\network\EnumConnectionState.java
  8811. Hunk 1 failed! Cannot find hunk target
  8812. field_150764_e[i - -1] = enumconnectionstate;
  8813.  
  8814. for(EnumPacketDirection enumpacketdirection : enumconnectionstate.field_179247_h.keySet()) {
  8815. - for(Class<? extends Packet<?>> oclass : ((BiMap)enumconnectionstate.field_179247_h.get(enumpacketdirection)).values()) {
  8816. + for(Class<? extends Packet<?>> oclass : enumconnectionstate.field_179247_h.get(enumpacketdirection).values()) {
  8817. if (field_150761_f.containsKey(oclass) && field_150761_f.get(oclass) != enumconnectionstate) {
  8818. throw new Error("Packet " + oclass + " is already assigned to protocol " + field_150761_f.get(oclass) + " - can't reassign to " + enumconnectionstate);
  8819. }
  8820. File state
  8821. package net.minecraft.network;
  8822.  
  8823. import com.google.common.collect.BiMap;
  8824. import com.google.common.collect.HashBiMap;
  8825. import com.google.common.collect.Maps;
  8826. import java.util.Map;
  8827. import javax.annotation.Nullable;
  8828. import net.minecraft.network.EnumPacketDirection;
  8829. import net.minecraft.network.Packet;
  8830. import net.minecraft.network.handshake.client.C00Handshake;
  8831. import net.minecraft.network.login.client.CPacketEncryptionResponse;
  8832. import net.minecraft.network.login.client.CPacketLoginStart;
  8833. import net.minecraft.network.login.server.SPacketEnableCompression;
  8834. import net.minecraft.network.login.server.SPacketEncryptionRequest;
  8835. import net.minecraft.network.login.server.SPacketLoginSuccess;
  8836. import net.minecraft.network.play.client.CPacketAnimation;
  8837. import net.minecraft.network.play.client.CPacketChatMessage;
  8838. import net.minecraft.network.play.client.CPacketClickWindow;
  8839. import net.minecraft.network.play.client.CPacketClientSettings;
  8840. import net.minecraft.network.play.client.CPacketClientStatus;
  8841. import net.minecraft.network.play.client.CPacketCloseWindow;
  8842. import net.minecraft.network.play.client.CPacketConfirmTeleport;
  8843. import net.minecraft.network.play.client.CPacketConfirmTransaction;
  8844. import net.minecraft.network.play.client.CPacketCreativeInventoryAction;
  8845. import net.minecraft.network.play.client.CPacketCustomPayload;
  8846. import net.minecraft.network.play.client.CPacketEnchantItem;
  8847. import net.minecraft.network.play.client.CPacketEntityAction;
  8848. import net.minecraft.network.play.client.CPacketHeldItemChange;
  8849. import net.minecraft.network.play.client.CPacketInput;
  8850. import net.minecraft.network.play.client.CPacketKeepAlive;
  8851. import net.minecraft.network.play.client.CPacketPlayer;
  8852. import net.minecraft.network.play.client.CPacketPlayerAbilities;
  8853. import net.minecraft.network.play.client.CPacketPlayerDigging;
  8854. import net.minecraft.network.play.client.CPacketPlayerTryUseItem;
  8855. import net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock;
  8856. import net.minecraft.network.play.client.CPacketRecipeInfo;
  8857. import net.minecraft.network.play.client.CPacketRecipePlacement;
  8858. import net.minecraft.network.play.client.CPacketResourcePackStatus;
  8859. import net.minecraft.network.play.client.CPacketSeenAdvancements;
  8860. import net.minecraft.network.play.client.CPacketSpectate;
  8861. import net.minecraft.network.play.client.CPacketSteerBoat;
  8862. import net.minecraft.network.play.client.CPacketTabComplete;
  8863. import net.minecraft.network.play.client.CPacketUpdateSign;
  8864. import net.minecraft.network.play.client.CPacketUseEntity;
  8865. import net.minecraft.network.play.client.CPacketVehicleMove;
  8866. import net.minecraft.network.play.server.SPacketAdvancementInfo;
  8867. import net.minecraft.network.play.server.SPacketAnimation;
  8868. import net.minecraft.network.play.server.SPacketBlockAction;
  8869. import net.minecraft.network.play.server.SPacketBlockBreakAnim;
  8870. import net.minecraft.network.play.server.SPacketBlockChange;
  8871. import net.minecraft.network.play.server.SPacketCamera;
  8872. import net.minecraft.network.play.server.SPacketChangeGameState;
  8873. import net.minecraft.network.play.server.SPacketChat;
  8874. import net.minecraft.network.play.server.SPacketChunkData;
  8875. import net.minecraft.network.play.server.SPacketCloseWindow;
  8876. import net.minecraft.network.play.server.SPacketCollectItem;
  8877. import net.minecraft.network.play.server.SPacketCombatEvent;
  8878. import net.minecraft.network.play.server.SPacketConfirmTransaction;
  8879. import net.minecraft.network.play.server.SPacketCooldown;
  8880. import net.minecraft.network.play.server.SPacketCustomPayload;
  8881. import net.minecraft.network.play.server.SPacketCustomSound;
  8882. import net.minecraft.network.play.server.SPacketDestroyEntities;
  8883. import net.minecraft.network.play.server.SPacketDisconnect;
  8884. import net.minecraft.network.play.server.SPacketDisplayObjective;
  8885. import net.minecraft.network.play.server.SPacketEffect;
  8886. import net.minecraft.network.play.server.SPacketEntity;
  8887. import net.minecraft.network.play.server.SPacketEntityAttach;
  8888. import net.minecraft.network.play.server.SPacketEntityEffect;
  8889. import net.minecraft.network.play.server.SPacketEntityEquipment;
  8890. import net.minecraft.network.play.server.SPacketEntityHeadLook;
  8891. import net.minecraft.network.play.server.SPacketEntityMetadata;
  8892. import net.minecraft.network.play.server.SPacketEntityProperties;
  8893. import net.minecraft.network.play.server.SPacketEntityStatus;
  8894. import net.minecraft.network.play.server.SPacketEntityTeleport;
  8895. import net.minecraft.network.play.server.SPacketEntityVelocity;
  8896. import net.minecraft.network.play.server.SPacketExplosion;
  8897. import net.minecraft.network.play.server.SPacketHeldItemChange;
  8898. import net.minecraft.network.play.server.SPacketJoinGame;
  8899. import net.minecraft.network.play.server.SPacketKeepAlive;
  8900. import net.minecraft.network.play.server.SPacketMaps;
  8901. import net.minecraft.network.play.server.SPacketMoveVehicle;
  8902. import net.minecraft.network.play.server.SPacketMultiBlockChange;
  8903. import net.minecraft.network.play.server.SPacketOpenWindow;
  8904. import net.minecraft.network.play.server.SPacketParticles;
  8905. import net.minecraft.network.play.server.SPacketPlayerAbilities;
  8906. import net.minecraft.network.play.server.SPacketPlayerListHeaderFooter;
  8907. import net.minecraft.network.play.server.SPacketPlayerListItem;
  8908. import net.minecraft.network.play.server.SPacketPlayerPosLook;
  8909. import net.minecraft.network.play.server.SPacketRecipeBook;
  8910. import net.minecraft.network.play.server.SPacketRemoveEntityEffect;
  8911. import net.minecraft.network.play.server.SPacketResourcePackSend;
  8912. import net.minecraft.network.play.server.SPacketRespawn;
  8913. import net.minecraft.network.play.server.SPacketScoreboardObjective;
  8914. import net.minecraft.network.play.server.SPacketSelectAdvancementsTab;
  8915. import net.minecraft.network.play.server.SPacketServerDifficulty;
  8916. import net.minecraft.network.play.server.SPacketSetExperience;
  8917. import net.minecraft.network.play.server.SPacketSetPassengers;
  8918. import net.minecraft.network.play.server.SPacketSetSlot;
  8919. import net.minecraft.network.play.server.SPacketSignEditorOpen;
  8920. import net.minecraft.network.play.server.SPacketSoundEffect;
  8921. import net.minecraft.network.play.server.SPacketSpawnExperienceOrb;
  8922. import net.minecraft.network.play.server.SPacketSpawnGlobalEntity;
  8923. import net.minecraft.network.play.server.SPacketSpawnMob;
  8924. import net.minecraft.network.play.server.SPacketSpawnObject;
  8925. import net.minecraft.network.play.server.SPacketSpawnPainting;
  8926. import net.minecraft.network.play.server.SPacketSpawnPlayer;
  8927. import net.minecraft.network.play.server.SPacketSpawnPosition;
  8928. import net.minecraft.network.play.server.SPacketStatistics;
  8929. import net.minecraft.network.play.server.SPacketTabComplete;
  8930. import net.minecraft.network.play.server.SPacketTeams;
  8931. import net.minecraft.network.play.server.SPacketTimeUpdate;
  8932. import net.minecraft.network.play.server.SPacketTitle;
  8933. import net.minecraft.network.play.server.SPacketUnloadChunk;
  8934. import net.minecraft.network.play.server.SPacketUpdateBossInfo;
  8935. import net.minecraft.network.play.server.SPacketUpdateHealth;
  8936. import net.minecraft.network.play.server.SPacketUpdateScore;
  8937. import net.minecraft.network.play.server.SPacketUpdateTileEntity;
  8938. import net.minecraft.network.play.server.SPacketUseBed;
  8939. import net.minecraft.network.play.server.SPacketWindowItems;
  8940. import net.minecraft.network.play.server.SPacketWindowProperty;
  8941. import net.minecraft.network.play.server.SPacketWorldBorder;
  8942. import net.minecraft.network.status.client.CPacketPing;
  8943. import net.minecraft.network.status.client.CPacketServerQuery;
  8944. import net.minecraft.network.status.server.SPacketPong;
  8945. import net.minecraft.network.status.server.SPacketServerInfo;
  8946. import org.apache.logging.log4j.LogManager;
  8947.  
  8948. public enum EnumConnectionState {
  8949. HANDSHAKING(-1) {
  8950. {
  8951. this.func_179245_a(EnumPacketDirection.SERVERBOUND, C00Handshake.class);
  8952. }
  8953. },
  8954. PLAY(0) {
  8955. {
  8956. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketSpawnObject.class);
  8957. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketSpawnExperienceOrb.class);
  8958. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketSpawnGlobalEntity.class);
  8959. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketSpawnMob.class);
  8960. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketSpawnPainting.class);
  8961. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketSpawnPlayer.class);
  8962. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketAnimation.class);
  8963. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketStatistics.class);
  8964. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketBlockBreakAnim.class);
  8965. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketUpdateTileEntity.class);
  8966. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketBlockAction.class);
  8967. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketBlockChange.class);
  8968. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketUpdateBossInfo.class);
  8969. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketServerDifficulty.class);
  8970. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketTabComplete.class);
  8971. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketChat.class);
  8972. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketMultiBlockChange.class);
  8973. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketConfirmTransaction.class);
  8974. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketCloseWindow.class);
  8975. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketOpenWindow.class);
  8976. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketWindowItems.class);
  8977. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketWindowProperty.class);
  8978. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketSetSlot.class);
  8979. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketCooldown.class);
  8980. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketCustomPayload.class);
  8981. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketCustomSound.class);
  8982. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketDisconnect.class);
  8983. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketEntityStatus.class);
  8984. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketExplosion.class);
  8985. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketUnloadChunk.class);
  8986. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketChangeGameState.class);
  8987. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketKeepAlive.class);
  8988. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketChunkData.class);
  8989. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketEffect.class);
  8990. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketParticles.class);
  8991. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketJoinGame.class);
  8992. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketMaps.class);
  8993. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketEntity.class);
  8994. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketEntity.S15PacketEntityRelMove.class);
  8995. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketEntity.S17PacketEntityLookMove.class);
  8996. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketEntity.S16PacketEntityLook.class);
  8997. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketMoveVehicle.class);
  8998. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketSignEditorOpen.class);
  8999. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketPlayerAbilities.class);
  9000. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketCombatEvent.class);
  9001. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketPlayerListItem.class);
  9002. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketPlayerPosLook.class);
  9003. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketUseBed.class);
  9004. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketRecipeBook.class);
  9005. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketDestroyEntities.class);
  9006. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketRemoveEntityEffect.class);
  9007. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketResourcePackSend.class);
  9008. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketRespawn.class);
  9009. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketEntityHeadLook.class);
  9010. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketSelectAdvancementsTab.class);
  9011. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketWorldBorder.class);
  9012. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketCamera.class);
  9013. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketHeldItemChange.class);
  9014. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketDisplayObjective.class);
  9015. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketEntityMetadata.class);
  9016. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketEntityAttach.class);
  9017. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketEntityVelocity.class);
  9018. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketEntityEquipment.class);
  9019. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketSetExperience.class);
  9020. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketUpdateHealth.class);
  9021. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketScoreboardObjective.class);
  9022. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketSetPassengers.class);
  9023. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketTeams.class);
  9024. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketUpdateScore.class);
  9025. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketSpawnPosition.class);
  9026. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketTimeUpdate.class);
  9027. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketTitle.class);
  9028. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketSoundEffect.class);
  9029. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketPlayerListHeaderFooter.class);
  9030. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketCollectItem.class);
  9031. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketEntityTeleport.class);
  9032. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketAdvancementInfo.class);
  9033. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketEntityProperties.class);
  9034. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketEntityEffect.class);
  9035. this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketConfirmTeleport.class);
  9036. this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketRecipePlacement.class);
  9037. this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketTabComplete.class);
  9038. this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketChatMessage.class);
  9039. this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketClientStatus.class);
  9040. this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketClientSettings.class);
  9041. this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketConfirmTransaction.class);
  9042. this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketEnchantItem.class);
  9043. this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketClickWindow.class);
  9044. this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketCloseWindow.class);
  9045. this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketCustomPayload.class);
  9046. this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketUseEntity.class);
  9047. this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketKeepAlive.class);
  9048. this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketPlayer.class);
  9049. this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketPlayer.Position.class);
  9050. this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketPlayer.PositionRotation.class);
  9051. this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketPlayer.Rotation.class);
  9052. this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketVehicleMove.class);
  9053. this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketSteerBoat.class);
  9054. this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketPlayerAbilities.class);
  9055. this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketPlayerDigging.class);
  9056. this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketEntityAction.class);
  9057. this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketInput.class);
  9058. this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketRecipeInfo.class);
  9059. this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketResourcePackStatus.class);
  9060. this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketSeenAdvancements.class);
  9061. this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketHeldItemChange.class);
  9062. this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketCreativeInventoryAction.class);
  9063. this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketUpdateSign.class);
  9064. this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketAnimation.class);
  9065. this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketSpectate.class);
  9066. this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketPlayerTryUseItemOnBlock.class);
  9067. this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketPlayerTryUseItem.class);
  9068. }
  9069. },
  9070. STATUS(1) {
  9071. {
  9072. this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketServerQuery.class);
  9073. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketServerInfo.class);
  9074. this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketPing.class);
  9075. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketPong.class);
  9076. }
  9077. },
  9078. LOGIN(2) {
  9079. {
  9080. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, net.minecraft.network.login.server.SPacketDisconnect.class);
  9081. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketEncryptionRequest.class);
  9082. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketLoginSuccess.class);
  9083. this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketEnableCompression.class);
  9084. this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketLoginStart.class);
  9085. this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketEncryptionResponse.class);
  9086. }
  9087. };
  9088.  
  9089. private static final EnumConnectionState[] field_150764_e = new EnumConnectionState[4];
  9090. private static final Map<Class<? extends Packet<?>>, EnumConnectionState> field_150761_f = Maps.<Class<? extends Packet<?>>, EnumConnectionState>newHashMap();
  9091. private final int field_150762_g;
  9092. private final Map<EnumPacketDirection, BiMap<Integer, Class<? extends Packet<?>>>> field_179247_h;
  9093.  
  9094. private EnumConnectionState(int p_i45152_3_) {
  9095. this.field_179247_h = Maps.newEnumMap(EnumPacketDirection.class);
  9096. this.field_150762_g = p_i45152_3_;
  9097. }
  9098.  
  9099. protected EnumConnectionState func_179245_a(EnumPacketDirection p_179245_1_, Class<? extends Packet<?>> p_179245_2_) {
  9100. BiMap<Integer, Class<? extends Packet<?>>> bimap = (BiMap)this.field_179247_h.get(p_179245_1_);
  9101. if(bimap == null) {
  9102. bimap = HashBiMap.<Integer, Class<? extends Packet<?>>>create();
  9103. this.field_179247_h.put(p_179245_1_, bimap);
  9104. }
  9105.  
  9106. if(bimap.containsValue(p_179245_2_)) {
  9107. String s = p_179245_1_ + " packet " + p_179245_2_ + " is already known to ID " + bimap.inverse().get(p_179245_2_);
  9108. LogManager.getLogger().fatal(s);
  9109. throw new IllegalArgumentException(s);
  9110. } else {
  9111. bimap.put(Integer.valueOf(bimap.size()), p_179245_2_);
  9112. return this;
  9113. }
  9114. }
  9115.  
  9116. public Integer func_179246_a(EnumPacketDirection p_179246_1_, Packet<?> p_179246_2_) throws Exception {
  9117. return (Integer)((BiMap)this.field_179247_h.get(p_179246_1_)).inverse().get(p_179246_2_.getClass());
  9118. }
  9119.  
  9120. @Nullable
  9121. public Packet<?> func_179244_a(EnumPacketDirection p_179244_1_, int p_179244_2_) throws InstantiationException, IllegalAccessException {
  9122. Class<? extends Packet<?>> oclass = (Class)((BiMap)this.field_179247_h.get(p_179244_1_)).get(Integer.valueOf(p_179244_2_));
  9123. return oclass == null?null:(Packet)oclass.newInstance();
  9124. }
  9125.  
  9126. public int func_150759_c() {
  9127. return this.field_150762_g;
  9128. }
  9129.  
  9130. public static EnumConnectionState func_150760_a(int p_150760_0_) {
  9131. return p_150760_0_ >= -1 && p_150760_0_ <= 2?field_150764_e[p_150760_0_ - -1]:null;
  9132. }
  9133.  
  9134. public static EnumConnectionState func_150752_a(Packet<?> p_150752_0_) {
  9135. return (EnumConnectionState)field_150761_f.get(p_150752_0_.getClass());
  9136. }
  9137.  
  9138. static {
  9139. for(EnumConnectionState enumconnectionstate : values()) {
  9140. int i = enumconnectionstate.func_150759_c();
  9141. if(i < -1 || i > 2) {
  9142. throw new Error("Invalid protocol ID " + Integer.toString(i));
  9143. }
  9144.  
  9145. field_150764_e[i - -1] = enumconnectionstate;
  9146.  
  9147. for(EnumPacketDirection enumpacketdirection : enumconnectionstate.field_179247_h.keySet()) {
  9148. for(Class<? extends Packet<?>> oclass : ((BiMap)enumconnectionstate.field_179247_h.get(enumpacketdirection)).values()) {
  9149. if(field_150761_f.containsKey(oclass) && field_150761_f.get(oclass) != enumconnectionstate) {
  9150. throw new Error("Packet " + oclass + " is already assigned to protocol " + field_150761_f.get(oclass) + " - can\'t reassign to " + enumconnectionstate);
  9151. }
  9152.  
  9153. try {
  9154. oclass.newInstance();
  9155. } catch (Throwable var10) {
  9156. throw new Error("Packet " + oclass + " fails instantiation checks! " + oclass);
  9157. }
  9158.  
  9159. field_150761_f.put(oclass, enumconnectionstate);
  9160. }
  9161. }
  9162. }
  9163.  
  9164. }
  9165. }
  9166.  
  9167. Patching failed: minecraft\net\minecraft\util\text\TextComponentKeybind.java
  9168. Hunk 1 failed! Cannot find hunk target
  9169. public class TextComponentKeybind extends TextComponentBase {
  9170. public static Function<String, Supplier<String>> field_193637_b = (p_193635_0_) -> {
  9171. return () -> {
  9172. - return p_193634_0_;
  9173. + return p_193635_0_;
  9174. };
  9175. };
  9176. private final String field_193638_c;
  9177. File state
  9178. package net.minecraft.util.text;
  9179.  
  9180. import java.util.function.Function;
  9181. import java.util.function.Supplier;
  9182. import net.minecraft.util.text.ITextComponent;
  9183. import net.minecraft.util.text.TextComponentBase;
  9184.  
  9185. public class TextComponentKeybind extends TextComponentBase {
  9186. public static Function<String, Supplier<String>> field_193637_b = (p_193635_0_) -> {
  9187. return () -> {
  9188. return p_193635_0_;
  9189. };
  9190. };
  9191. private final String field_193638_c;
  9192. private Supplier<String> field_193639_d;
  9193.  
  9194. public TextComponentKeybind(String p_i47521_1_) {
  9195. this.field_193638_c = p_i47521_1_;
  9196. }
  9197.  
  9198. public String func_150261_e() {
  9199. if(this.field_193639_d == null) {
  9200. this.field_193639_d = (Supplier)field_193637_b.apply(this.field_193638_c);
  9201. }
  9202.  
  9203. return (String)this.field_193639_d.get();
  9204. }
  9205.  
  9206. public TextComponentKeybind func_150259_f() {
  9207. TextComponentKeybind textcomponentkeybind = new TextComponentKeybind(this.field_193638_c);
  9208. textcomponentkeybind.func_150255_a(this.func_150256_b().func_150232_l());
  9209.  
  9210. for(ITextComponent itextcomponent : this.func_150253_a()) {
  9211. textcomponentkeybind.func_150257_a(itextcomponent.func_150259_f());
  9212. }
  9213.  
  9214. return textcomponentkeybind;
  9215. }
  9216.  
  9217. public boolean equals(Object p_equals_1_) {
  9218. if(this == p_equals_1_) {
  9219. return true;
  9220. } else if(!(p_equals_1_ instanceof TextComponentKeybind)) {
  9221. return false;
  9222. } else {
  9223. TextComponentKeybind textcomponentkeybind = (TextComponentKeybind)p_equals_1_;
  9224. return this.field_193638_c.equals(textcomponentkeybind.field_193638_c) && super.equals(p_equals_1_);
  9225. }
  9226. }
  9227.  
  9228. public String toString() {
  9229. return "KeybindComponent{keybind=\'" + this.field_193638_c + '\'' + ", siblings=" + this.field_150264_a + ", style=" + this.func_150256_b() + '}';
  9230. }
  9231.  
  9232. public String func_193633_h() {
  9233. return this.field_193638_c;
  9234. }
  9235. }
  9236.  
  9237. Patching failed: minecraft\net\minecraft\advancements\PlayerAdvancements.java
  9238. Hunk 1 failed! Cannot find hunk target
  9239.  
  9240. Stream<Entry<ResourceLocation, AdvancementProgress>> stream = map.entrySet().stream().sorted(Comparator.comparing(Entry::getValue));
  9241.  
  9242. - for(Entry<ResourceLocation, AdvancementProgress> entry : (List)stream.collect(Collectors.toList())) {
  9243. + for(Entry<ResourceLocation, AdvancementProgress> entry : stream.collect(Collectors.toList())) {
  9244. Advancement advancement = this.field_192756_d.func_191949_aK().func_192778_a(entry.getKey());
  9245. if (advancement == null) {
  9246. field_192753_a.warn("Ignored advancement '" + entry.getKey() + "' in progress file " + this.field_192757_e + " - it doesn't exist anymore?");
  9247. File state
  9248. package net.minecraft.advancements;
  9249.  
  9250. import com.google.common.collect.Lists;
  9251. import com.google.common.collect.Maps;
  9252. import com.google.common.collect.Sets;
  9253. import com.google.common.io.Files;
  9254. import com.google.gson.Gson;
  9255. import com.google.gson.GsonBuilder;
  9256. import com.google.gson.JsonParseException;
  9257. import com.google.gson.reflect.TypeToken;
  9258. import java.io.File;
  9259. import java.io.IOException;
  9260. import java.nio.charset.StandardCharsets;
  9261. import java.util.Comparator;
  9262. import java.util.List;
  9263. import java.util.Map;
  9264. import java.util.Set;
  9265. import java.util.Map.Entry;
  9266. import java.util.function.Function;
  9267. import java.util.stream.Collectors;
  9268. import java.util.stream.Stream;
  9269. import javax.annotation.Nullable;
  9270. import net.minecraft.advancements.Advancement;
  9271. import net.minecraft.advancements.AdvancementProgress;
  9272. import net.minecraft.advancements.CriteriaTriggers;
  9273. import net.minecraft.advancements.Criterion;
  9274. import net.minecraft.advancements.CriterionProgress;
  9275. import net.minecraft.advancements.ICriterionInstance;
  9276. import net.minecraft.advancements.ICriterionTrigger;
  9277. import net.minecraft.entity.player.EntityPlayerMP;
  9278. import net.minecraft.network.play.server.SPacketAdvancementInfo;
  9279. import net.minecraft.network.play.server.SPacketSelectAdvancementsTab;
  9280. import net.minecraft.server.MinecraftServer;
  9281. import net.minecraft.util.JsonUtils;
  9282. import net.minecraft.util.ResourceLocation;
  9283. import net.minecraft.util.text.TextComponentTranslation;
  9284. import org.apache.logging.log4j.LogManager;
  9285. import org.apache.logging.log4j.Logger;
  9286.  
  9287. public class PlayerAdvancements {
  9288. private static final Logger field_192753_a = LogManager.getLogger();
  9289. private static final Gson field_192754_b = (new GsonBuilder()).registerTypeAdapter(AdvancementProgress.class, new AdvancementProgress.Serializer()).registerTypeAdapter(ResourceLocation.class, new ResourceLocation.Serializer()).setPrettyPrinting().create();
  9290. private static final TypeToken<Map<ResourceLocation, AdvancementProgress>> field_192755_c = new TypeToken<Map<ResourceLocation, AdvancementProgress>>() {
  9291. };
  9292. private final MinecraftServer field_192756_d;
  9293. private final File field_192757_e;
  9294. private final Map<Advancement, AdvancementProgress> field_192758_f = Maps.<Advancement, AdvancementProgress>newLinkedHashMap();
  9295. private final Set<Advancement> field_192759_g = Sets.<Advancement>newLinkedHashSet();
  9296. private final Set<Advancement> field_192760_h = Sets.<Advancement>newLinkedHashSet();
  9297. private final Set<Advancement> field_192761_i = Sets.<Advancement>newLinkedHashSet();
  9298. private EntityPlayerMP field_192762_j;
  9299. @Nullable
  9300. private Advancement field_194221_k;
  9301. private boolean field_192763_k = true;
  9302.  
  9303. public PlayerAdvancements(MinecraftServer p_i47422_1_, File p_i47422_2_, EntityPlayerMP p_i47422_3_) {
  9304. this.field_192756_d = p_i47422_1_;
  9305. this.field_192757_e = p_i47422_2_;
  9306. this.field_192762_j = p_i47422_3_;
  9307. this.func_192740_f();
  9308. }
  9309.  
  9310. public void func_192739_a(EntityPlayerMP p_192739_1_) {
  9311. this.field_192762_j = p_192739_1_;
  9312. }
  9313.  
  9314. public void func_192745_a() {
  9315. for(ICriterionTrigger<?> icriteriontrigger : CriteriaTriggers.func_192120_a()) {
  9316. icriteriontrigger.func_192167_a(this);
  9317. }
  9318.  
  9319. }
  9320.  
  9321. public void func_193766_b() {
  9322. this.func_192745_a();
  9323. this.field_192758_f.clear();
  9324. this.field_192759_g.clear();
  9325. this.field_192760_h.clear();
  9326. this.field_192761_i.clear();
  9327. this.field_192763_k = true;
  9328. this.field_194221_k = null;
  9329. this.func_192740_f();
  9330. }
  9331.  
  9332. private void func_192751_c() {
  9333. for(Advancement advancement : this.field_192756_d.func_191949_aK().func_192780_b()) {
  9334. this.func_193764_b(advancement);
  9335. }
  9336.  
  9337. }
  9338.  
  9339. private void func_192752_d() {
  9340. List<Advancement> list = Lists.<Advancement>newArrayList();
  9341.  
  9342. for(Entry<Advancement, AdvancementProgress> entry : this.field_192758_f.entrySet()) {
  9343. if(((AdvancementProgress)entry.getValue()).func_192105_a()) {
  9344. list.add(entry.getKey());
  9345. this.field_192761_i.add(entry.getKey());
  9346. }
  9347. }
  9348.  
  9349. for(Advancement advancement : list) {
  9350. this.func_192742_b(advancement);
  9351. }
  9352.  
  9353. }
  9354.  
  9355. private void func_192748_e() {
  9356. for(Advancement advancement : this.field_192756_d.func_191949_aK().func_192780_b()) {
  9357. if(advancement.func_192073_f().isEmpty()) {
  9358. this.func_192750_a(advancement, "");
  9359. advancement.func_192072_d().func_192113_a(this.field_192762_j);
  9360. }
  9361. }
  9362.  
  9363. }
  9364.  
  9365. private void func_192740_f() {
  9366. if(this.field_192757_e.isFile()) {
  9367. try {
  9368. String s = Files.toString(this.field_192757_e, StandardCharsets.UTF_8);
  9369. Map<ResourceLocation, AdvancementProgress> map = (Map)JsonUtils.func_193840_a(field_192754_b, s, field_192755_c.getType());
  9370. if(map == null) {
  9371. throw new JsonParseException("Found null for advancements");
  9372. }
  9373.  
  9374. Stream<Entry<ResourceLocation, AdvancementProgress>> stream = map.entrySet().stream().sorted(Comparator.comparing(Entry::getValue));
  9375.  
  9376. for(Entry<ResourceLocation, AdvancementProgress> entry : (List)stream.collect(Collectors.toList())) {
  9377. Advancement advancement = this.field_192756_d.func_191949_aK().func_192778_a((ResourceLocation)entry.getKey());
  9378. if(advancement == null) {
  9379. field_192753_a.warn("Ignored advancement \'" + entry.getKey() + "\' in progress file " + this.field_192757_e + " - it doesn\'t exist anymore?");
  9380. } else {
  9381. this.func_192743_a(advancement, (AdvancementProgress)entry.getValue());
  9382. }
  9383. }
  9384. } catch (JsonParseException jsonparseexception) {
  9385. field_192753_a.error((String)("Couldn\'t parse player advancements in " + this.field_192757_e), (Throwable)jsonparseexception);
  9386. } catch (IOException ioexception) {
  9387. field_192753_a.error((String)("Couldn\'t access player advancements in " + this.field_192757_e), (Throwable)ioexception);
  9388. }
  9389. }
  9390.  
  9391. this.func_192748_e();
  9392. this.func_192752_d();
  9393. this.func_192751_c();
  9394. }
  9395.  
  9396. public void func_192749_b() {
  9397. Map<ResourceLocation, AdvancementProgress> map = Maps.<ResourceLocation, AdvancementProgress>newHashMap();
  9398.  
  9399. for(Entry<Advancement, AdvancementProgress> entry : this.field_192758_f.entrySet()) {
  9400. AdvancementProgress advancementprogress = (AdvancementProgress)entry.getValue();
  9401. if(advancementprogress.func_192108_b()) {
  9402. map.put(((Advancement)entry.getKey()).func_192067_g(), advancementprogress);
  9403. }
  9404. }
  9405.  
  9406. if(this.field_192757_e.getParentFile() != null) {
  9407. this.field_192757_e.getParentFile().mkdirs();
  9408. }
  9409.  
  9410. try {
  9411. Files.write(field_192754_b.toJson((Object)map), this.field_192757_e, StandardCharsets.UTF_8);
  9412. } catch (IOException ioexception) {
  9413. field_192753_a.error((String)("Couldn\'t save player advancements to " + this.field_192757_e), (Throwable)ioexception);
  9414. }
  9415.  
  9416. }
  9417.  
  9418. public boolean func_192750_a(Advancement p_192750_1_, String p_192750_2_) {
  9419. boolean boolean = false;
  9420. AdvancementProgress advancementprogress = this.func_192747_a(p_192750_1_);
  9421. boolean boolean = advancementprogress.func_192105_a();
  9422. if(advancementprogress.func_192109_a(p_192750_2_)) {
  9423. this.func_193765_c(p_192750_1_);
  9424. this.field_192761_i.add(p_192750_1_);
  9425. boolean = true;
  9426. if(!boolean && advancementprogress.func_192105_a()) {
  9427. p_192750_1_.func_192072_d().func_192113_a(this.field_192762_j);
  9428. if(p_192750_1_.func_192068_c() != null && p_192750_1_.func_192068_c().func_193220_i() && this.field_192762_j.field_70170_p.func_82736_K().func_82766_b("announceAdvancements")) {
  9429. this.field_192756_d.func_184103_al().func_148539_a(new TextComponentTranslation("chat.type.advancement." + p_192750_1_.func_192068_c().func_192291_d().func_192307_a(), new Object[]{this.field_192762_j.func_145748_c_(), p_192750_1_.func_193123_j()}));
  9430. }
  9431. }
  9432. }
  9433.  
  9434. if(advancementprogress.func_192105_a()) {
  9435. this.func_192742_b(p_192750_1_);
  9436. }
  9437.  
  9438. return boolean;
  9439. }
  9440.  
  9441. public boolean func_192744_b(Advancement p_192744_1_, String p_192744_2_) {
  9442. boolean boolean = false;
  9443. AdvancementProgress advancementprogress = this.func_192747_a(p_192744_1_);
  9444. if(advancementprogress.func_192101_b(p_192744_2_)) {
  9445. this.func_193764_b(p_192744_1_);
  9446. this.field_192761_i.add(p_192744_1_);
  9447. boolean = true;
  9448. }
  9449.  
  9450. if(!advancementprogress.func_192108_b()) {
  9451. this.func_192742_b(p_192744_1_);
  9452. }
  9453.  
  9454. return boolean;
  9455. }
  9456.  
  9457. private void func_193764_b(Advancement p_193764_1_) {
  9458. AdvancementProgress advancementprogress = this.func_192747_a(p_193764_1_);
  9459. if(!advancementprogress.func_192105_a()) {
  9460. for(Entry<String, Criterion> entry : p_193764_1_.func_192073_f().entrySet()) {
  9461. CriterionProgress criterionprogress = advancementprogress.func_192106_c((String)entry.getKey());
  9462. if(criterionprogress != null && !criterionprogress.func_192151_a()) {
  9463. ICriterionInstance icriterioninstance = ((Criterion)entry.getValue()).func_192143_a();
  9464. if(icriterioninstance != null) {
  9465. ICriterionTrigger<ICriterionInstance> icriteriontrigger = CriteriaTriggers.<ICriterionInstance>func_192119_a(icriterioninstance.func_192244_a());
  9466. if(icriteriontrigger != null) {
  9467. icriteriontrigger.func_192165_a(this, new ICriterionTrigger.Listener(icriterioninstance, p_193764_1_, (String)entry.getKey()));
  9468. }
  9469. }
  9470. }
  9471. }
  9472.  
  9473. }
  9474. }
  9475.  
  9476. private void func_193765_c(Advancement p_193765_1_) {
  9477. AdvancementProgress advancementprogress = this.func_192747_a(p_193765_1_);
  9478.  
  9479. for(Entry<String, Criterion> entry : p_193765_1_.func_192073_f().entrySet()) {
  9480. CriterionProgress criterionprogress = advancementprogress.func_192106_c((String)entry.getKey());
  9481. if(criterionprogress != null && (criterionprogress.func_192151_a() || advancementprogress.func_192105_a())) {
  9482. ICriterionInstance icriterioninstance = ((Criterion)entry.getValue()).func_192143_a();
  9483. if(icriterioninstance != null) {
  9484. ICriterionTrigger<ICriterionInstance> icriteriontrigger = CriteriaTriggers.<ICriterionInstance>func_192119_a(icriterioninstance.func_192244_a());
  9485. if(icriteriontrigger != null) {
  9486. icriteriontrigger.func_192164_b(this, new ICriterionTrigger.Listener(icriterioninstance, p_193765_1_, (String)entry.getKey()));
  9487. }
  9488. }
  9489. }
  9490. }
  9491.  
  9492. }
  9493.  
  9494. public void func_192741_b(EntityPlayerMP p_192741_1_) {
  9495. if(!this.field_192760_h.isEmpty() || !this.field_192761_i.isEmpty()) {
  9496. Map<ResourceLocation, AdvancementProgress> map = Maps.<ResourceLocation, AdvancementProgress>newHashMap();
  9497. Set<Advancement> set = Sets.<Advancement>newLinkedHashSet();
  9498. Set<ResourceLocation> set1 = Sets.<ResourceLocation>newLinkedHashSet();
  9499.  
  9500. for(Advancement advancement : this.field_192761_i) {
  9501. if(this.field_192759_g.contains(advancement)) {
  9502. map.put(advancement.func_192067_g(), this.field_192758_f.get(advancement));
  9503. }
  9504. }
  9505.  
  9506. for(Advancement advancement1 : this.field_192760_h) {
  9507. if(this.field_192759_g.contains(advancement1)) {
  9508. set.add(advancement1);
  9509. } else {
  9510. set1.add(advancement1.func_192067_g());
  9511. }
  9512. }
  9513.  
  9514. if(!map.isEmpty() || !set.isEmpty() || !set1.isEmpty()) {
  9515. p_192741_1_.field_71135_a.func_147359_a(new SPacketAdvancementInfo(this.field_192763_k, set, set1, map));
  9516. this.field_192760_h.clear();
  9517. this.field_192761_i.clear();
  9518. }
  9519. }
  9520.  
  9521. this.field_192763_k = false;
  9522. }
  9523.  
  9524. public void func_194220_a(@Nullable Advancement p_194220_1_) {
  9525. Advancement advancement = this.field_194221_k;
  9526. if(p_194220_1_ != null && p_194220_1_.func_192070_b() == null && p_194220_1_.func_192068_c() != null) {
  9527. this.field_194221_k = p_194220_1_;
  9528. } else {
  9529. this.field_194221_k = null;
  9530. }
  9531.  
  9532. if(advancement != this.field_194221_k) {
  9533. this.field_192762_j.field_71135_a.func_147359_a(new SPacketSelectAdvancementsTab(this.field_194221_k == null?null:this.field_194221_k.func_192067_g()));
  9534. }
  9535.  
  9536. }
  9537.  
  9538. public AdvancementProgress func_192747_a(Advancement p_192747_1_) {
  9539. AdvancementProgress advancementprogress = (AdvancementProgress)this.field_192758_f.get(p_192747_1_);
  9540. if(advancementprogress == null) {
  9541. advancementprogress = new AdvancementProgress();
  9542. this.func_192743_a(p_192747_1_, advancementprogress);
  9543. }
  9544.  
  9545. return advancementprogress;
  9546. }
  9547.  
  9548. private void func_192743_a(Advancement p_192743_1_, AdvancementProgress p_192743_2_) {
  9549. p_192743_2_.func_192099_a(p_192743_1_.func_192073_f(), p_192743_1_.func_192074_h());
  9550. this.field_192758_f.put(p_192743_1_, p_192743_2_);
  9551. }
  9552.  
  9553. private void func_192742_b(Advancement p_192742_1_) {
  9554. boolean boolean = this.func_192738_c(p_192742_1_);
  9555. boolean boolean = this.field_192759_g.contains(p_192742_1_);
  9556. if(boolean && !boolean) {
  9557. this.field_192759_g.add(p_192742_1_);
  9558. this.field_192760_h.add(p_192742_1_);
  9559. if(this.field_192758_f.containsKey(p_192742_1_)) {
  9560. this.field_192761_i.add(p_192742_1_);
  9561. }
  9562. } else if(!boolean && boolean) {
  9563. this.field_192759_g.remove(p_192742_1_);
  9564. this.field_192760_h.add(p_192742_1_);
  9565. }
  9566.  
  9567. if(boolean != boolean && p_192742_1_.func_192070_b() != null) {
  9568. this.func_192742_b(p_192742_1_.func_192070_b());
  9569. }
  9570.  
  9571. for(Advancement advancement : p_192742_1_.func_192069_e()) {
  9572. this.func_192742_b(advancement);
  9573. }
  9574.  
  9575. }
  9576.  
  9577. private boolean func_192738_c(Advancement p_192738_1_) {
  9578. for(int int = 0; p_192738_1_ != null && int <= 2; ++int) {
  9579. if(int == 0 && this.func_192746_d(p_192738_1_)) {
  9580. return true;
  9581. }
  9582.  
  9583. if(p_192738_1_.func_192068_c() == null) {
  9584. return false;
  9585. }
  9586.  
  9587. AdvancementProgress advancementprogress = this.func_192747_a(p_192738_1_);
  9588. if(advancementprogress.func_192105_a()) {
  9589. return true;
  9590. }
  9591.  
  9592. if(p_192738_1_.func_192068_c().func_193224_j()) {
  9593. return false;
  9594. }
  9595.  
  9596. p_192738_1_ = p_192738_1_.func_192070_b();
  9597. }
  9598.  
  9599. return false;
  9600. }
  9601.  
  9602. private boolean func_192746_d(Advancement p_192746_1_) {
  9603. AdvancementProgress advancementprogress = this.func_192747_a(p_192746_1_);
  9604. if(advancementprogress.func_192105_a()) {
  9605. return true;
  9606. } else {
  9607. for(Advancement advancement : p_192746_1_.func_192069_e()) {
  9608. if(this.func_192746_d(advancement)) {
  9609. return true;
  9610. }
  9611. }
  9612.  
  9613. return false;
  9614. }
  9615. }
  9616. }
  9617.  
  9618. Patching failed: minecraft\net\minecraft\server\management\UserList.java
  9619. Hunk 1 failed! Cannot find hunk target
  9620. }
  9621.  
  9622. protected UserListEntry<K> func_152682_a(JsonObject p_152682_1_) {
  9623. - return new UserListEntry<K>((Object)null, p_152682_1_);
  9624. + return new UserListEntry<K>(null, p_152682_1_);
  9625. }
  9626.  
  9627. protected Map<String, V> func_152688_e() {
  9628. File state
  9629. package net.minecraft.server.management;
  9630.  
  9631. import com.google.common.collect.Lists;
  9632. import com.google.common.collect.Maps;
  9633. import com.google.common.io.Files;
  9634. import com.google.gson.Gson;
  9635. import com.google.gson.GsonBuilder;
  9636. import com.google.gson.JsonDeserializationContext;
  9637. import com.google.gson.JsonDeserializer;
  9638. import com.google.gson.JsonElement;
  9639. import com.google.gson.JsonObject;
  9640. import com.google.gson.JsonParseException;
  9641. import com.google.gson.JsonSerializationContext;
  9642. import com.google.gson.JsonSerializer;
  9643. import java.io.BufferedReader;
  9644. import java.io.BufferedWriter;
  9645. import java.io.File;
  9646. import java.io.FileNotFoundException;
  9647. import java.io.IOException;
  9648. import java.io.Reader;
  9649. import java.io.Writer;
  9650. import java.lang.reflect.ParameterizedType;
  9651. import java.lang.reflect.Type;
  9652. import java.nio.charset.StandardCharsets;
  9653. import java.util.Collection;
  9654. import java.util.List;
  9655. import java.util.Map;
  9656. import net.minecraft.server.management.UserListEntry;
  9657. import net.minecraft.util.JsonUtils;
  9658. import net.minecraftforge.fml.relauncher.Side;
  9659. import net.minecraftforge.fml.relauncher.SideOnly;
  9660. import org.apache.commons.io.IOUtils;
  9661. import org.apache.logging.log4j.LogManager;
  9662. import org.apache.logging.log4j.Logger;
  9663.  
  9664. public class UserList<K, V extends UserListEntry<K>> {
  9665. protected static final Logger field_152693_a = LogManager.getLogger();
  9666. protected final Gson field_152694_b;
  9667. private final File field_152695_c;
  9668. private final Map<String, V> field_152696_d = Maps.<String, V>newHashMap();
  9669. private boolean field_152697_e = true;
  9670. private static final ParameterizedType field_152698_f = new ParameterizedType() {
  9671. public Type[] getActualTypeArguments() {
  9672. return new Type[]{UserListEntry.class};
  9673. }
  9674.  
  9675. public Type getRawType() {
  9676. return List.class;
  9677. }
  9678.  
  9679. public Type getOwnerType() {
  9680. return null;
  9681. }
  9682. };
  9683.  
  9684. public UserList(File p_i1144_1_) {
  9685. this.field_152695_c = p_i1144_1_;
  9686. GsonBuilder gsonbuilder = (new GsonBuilder()).setPrettyPrinting();
  9687. gsonbuilder.registerTypeHierarchyAdapter(UserListEntry.class, new UserList.Serializer());
  9688. this.field_152694_b = gsonbuilder.create();
  9689. }
  9690.  
  9691. public boolean func_152689_b() {
  9692. return this.field_152697_e;
  9693. }
  9694.  
  9695. public void func_152686_a(boolean p_152686_1_) {
  9696. this.field_152697_e = p_152686_1_;
  9697. }
  9698.  
  9699. public void func_152687_a(V p_152687_1_) {
  9700. this.field_152696_d.put(this.func_152681_a(p_152687_1_.func_152640_f()), p_152687_1_);
  9701.  
  9702. try {
  9703. this.func_152678_f();
  9704. } catch (IOException ioexception) {
  9705. field_152693_a.warn((String)"Could not save the list after adding a user.", (Throwable)ioexception);
  9706. }
  9707.  
  9708. }
  9709.  
  9710. public V func_152683_b(K p_152683_1_) {
  9711. this.func_152680_h();
  9712. return (V)((UserListEntry)this.field_152696_d.get(this.func_152681_a(p_152683_1_)));
  9713. }
  9714.  
  9715. public void func_152684_c(K p_152684_1_) {
  9716. this.field_152696_d.remove(this.func_152681_a(p_152684_1_));
  9717.  
  9718. try {
  9719. this.func_152678_f();
  9720. } catch (IOException ioexception) {
  9721. field_152693_a.warn((String)"Could not save the list after removing a user.", (Throwable)ioexception);
  9722. }
  9723.  
  9724. }
  9725.  
  9726. @SideOnly(Side.SERVER)
  9727. public File func_152691_c() {
  9728. return this.field_152695_c;
  9729. }
  9730.  
  9731. public String[] func_152685_a() {
  9732. return (String[])this.field_152696_d.keySet().toArray(new String[this.field_152696_d.size()]);
  9733. }
  9734.  
  9735. protected String func_152681_a(K p_152681_1_) {
  9736. return p_152681_1_.toString();
  9737. }
  9738.  
  9739. protected boolean func_152692_d(K p_152692_1_) {
  9740. return this.field_152696_d.containsKey(this.func_152681_a(p_152692_1_));
  9741. }
  9742.  
  9743. private void func_152680_h() {
  9744. List<K> list = Lists.<K>newArrayList();
  9745.  
  9746. for(V v : this.field_152696_d.values()) {
  9747. if(v.func_73682_e()) {
  9748. list.add(v.func_152640_f());
  9749. }
  9750. }
  9751.  
  9752. for(K k : list) {
  9753. this.field_152696_d.remove(k);
  9754. }
  9755.  
  9756. }
  9757.  
  9758. protected UserListEntry<K> func_152682_a(JsonObject p_152682_1_) {
  9759. return new UserListEntry((Object)null, p_152682_1_);
  9760. }
  9761.  
  9762. protected Map<String, V> func_152688_e() {
  9763. return this.field_152696_d;
  9764. }
  9765.  
  9766. public void func_152678_f() throws IOException {
  9767. Collection<V> collection = this.field_152696_d.values();
  9768. String s = this.field_152694_b.toJson((Object)collection);
  9769. BufferedWriter bufferedwriter = null;
  9770.  
  9771. try {
  9772. bufferedwriter = Files.newWriter(this.field_152695_c, StandardCharsets.UTF_8);
  9773. bufferedwriter.write(s);
  9774. } finally {
  9775. IOUtils.closeQuietly((Writer)bufferedwriter);
  9776. }
  9777.  
  9778. }
  9779.  
  9780. @SideOnly(Side.SERVER)
  9781. public boolean func_152690_d() {
  9782. return this.field_152696_d.size() < 1;
  9783. }
  9784.  
  9785. @SideOnly(Side.SERVER)
  9786. public void func_152679_g() throws IOException, FileNotFoundException {
  9787. if(this.field_152695_c.exists()) {
  9788. Collection<UserListEntry<K>> collection = null;
  9789. BufferedReader bufferedreader = null;
  9790.  
  9791. try {
  9792. bufferedreader = Files.newReader(this.field_152695_c, StandardCharsets.UTF_8);
  9793. collection = (Collection)JsonUtils.func_193841_a(this.field_152694_b, bufferedreader, field_152698_f);
  9794. } finally {
  9795. IOUtils.closeQuietly((Reader)bufferedreader);
  9796. }
  9797.  
  9798. if(collection != null) {
  9799. this.field_152696_d.clear();
  9800.  
  9801. for(UserListEntry<K> userlistentry : collection) {
  9802. if(userlistentry.func_152640_f() != null) {
  9803. this.field_152696_d.put(this.func_152681_a(userlistentry.func_152640_f()), userlistentry);
  9804. }
  9805. }
  9806. }
  9807.  
  9808. }
  9809. }
  9810.  
  9811. class Serializer implements JsonDeserializer<UserListEntry<K>>, JsonSerializer<UserListEntry<K>> {
  9812. private Serializer() {
  9813. }
  9814.  
  9815. public JsonElement serialize(UserListEntry<K> p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) {
  9816. JsonObject jsonobject = new JsonObject();
  9817. p_serialize_1_.func_152641_a(jsonobject);
  9818. return jsonobject;
  9819. }
  9820.  
  9821. public UserListEntry<K> deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException {
  9822. if(p_deserialize_1_.isJsonObject()) {
  9823. JsonObject jsonobject = p_deserialize_1_.getAsJsonObject();
  9824. return UserList.this.func_152682_a(jsonobject);
  9825. } else {
  9826. return null;
  9827. }
  9828. }
  9829. }
  9830. }
  9831.  
  9832. Hunk 2 failed! Cannot find hunk target
  9833.  
  9834. for(UserListEntry<K> userlistentry : collection) {
  9835. if (userlistentry.func_152640_f() != null) {
  9836. - this.field_152696_d.put(this.func_152681_a(userlistentry.func_152640_f()), userlistentry);
  9837. + this.field_152696_d.put(this.func_152681_a(userlistentry.func_152640_f()), (V)userlistentry);
  9838. }
  9839. }
  9840. }
  9841. File state
  9842. package net.minecraft.server.management;
  9843.  
  9844. import com.google.common.collect.Lists;
  9845. import com.google.common.collect.Maps;
  9846. import com.google.common.io.Files;
  9847. import com.google.gson.Gson;
  9848. import com.google.gson.GsonBuilder;
  9849. import com.google.gson.JsonDeserializationContext;
  9850. import com.google.gson.JsonDeserializer;
  9851. import com.google.gson.JsonElement;
  9852. import com.google.gson.JsonObject;
  9853. import com.google.gson.JsonParseException;
  9854. import com.google.gson.JsonSerializationContext;
  9855. import com.google.gson.JsonSerializer;
  9856. import java.io.BufferedReader;
  9857. import java.io.BufferedWriter;
  9858. import java.io.File;
  9859. import java.io.FileNotFoundException;
  9860. import java.io.IOException;
  9861. import java.io.Reader;
  9862. import java.io.Writer;
  9863. import java.lang.reflect.ParameterizedType;
  9864. import java.lang.reflect.Type;
  9865. import java.nio.charset.StandardCharsets;
  9866. import java.util.Collection;
  9867. import java.util.List;
  9868. import java.util.Map;
  9869. import net.minecraft.server.management.UserListEntry;
  9870. import net.minecraft.util.JsonUtils;
  9871. import net.minecraftforge.fml.relauncher.Side;
  9872. import net.minecraftforge.fml.relauncher.SideOnly;
  9873. import org.apache.commons.io.IOUtils;
  9874. import org.apache.logging.log4j.LogManager;
  9875. import org.apache.logging.log4j.Logger;
  9876.  
  9877. public class UserList<K, V extends UserListEntry<K>> {
  9878. protected static final Logger field_152693_a = LogManager.getLogger();
  9879. protected final Gson field_152694_b;
  9880. private final File field_152695_c;
  9881. private final Map<String, V> field_152696_d = Maps.<String, V>newHashMap();
  9882. private boolean field_152697_e = true;
  9883. private static final ParameterizedType field_152698_f = new ParameterizedType() {
  9884. public Type[] getActualTypeArguments() {
  9885. return new Type[]{UserListEntry.class};
  9886. }
  9887.  
  9888. public Type getRawType() {
  9889. return List.class;
  9890. }
  9891.  
  9892. public Type getOwnerType() {
  9893. return null;
  9894. }
  9895. };
  9896.  
  9897. public UserList(File p_i1144_1_) {
  9898. this.field_152695_c = p_i1144_1_;
  9899. GsonBuilder gsonbuilder = (new GsonBuilder()).setPrettyPrinting();
  9900. gsonbuilder.registerTypeHierarchyAdapter(UserListEntry.class, new UserList.Serializer());
  9901. this.field_152694_b = gsonbuilder.create();
  9902. }
  9903.  
  9904. public boolean func_152689_b() {
  9905. return this.field_152697_e;
  9906. }
  9907.  
  9908. public void func_152686_a(boolean p_152686_1_) {
  9909. this.field_152697_e = p_152686_1_;
  9910. }
  9911.  
  9912. public void func_152687_a(V p_152687_1_) {
  9913. this.field_152696_d.put(this.func_152681_a(p_152687_1_.func_152640_f()), p_152687_1_);
  9914.  
  9915. try {
  9916. this.func_152678_f();
  9917. } catch (IOException ioexception) {
  9918. field_152693_a.warn((String)"Could not save the list after adding a user.", (Throwable)ioexception);
  9919. }
  9920.  
  9921. }
  9922.  
  9923. public V func_152683_b(K p_152683_1_) {
  9924. this.func_152680_h();
  9925. return (V)((UserListEntry)this.field_152696_d.get(this.func_152681_a(p_152683_1_)));
  9926. }
  9927.  
  9928. public void func_152684_c(K p_152684_1_) {
  9929. this.field_152696_d.remove(this.func_152681_a(p_152684_1_));
  9930.  
  9931. try {
  9932. this.func_152678_f();
  9933. } catch (IOException ioexception) {
  9934. field_152693_a.warn((String)"Could not save the list after removing a user.", (Throwable)ioexception);
  9935. }
  9936.  
  9937. }
  9938.  
  9939. @SideOnly(Side.SERVER)
  9940. public File func_152691_c() {
  9941. return this.field_152695_c;
  9942. }
  9943.  
  9944. public String[] func_152685_a() {
  9945. return (String[])this.field_152696_d.keySet().toArray(new String[this.field_152696_d.size()]);
  9946. }
  9947.  
  9948. protected String func_152681_a(K p_152681_1_) {
  9949. return p_152681_1_.toString();
  9950. }
  9951.  
  9952. protected boolean func_152692_d(K p_152692_1_) {
  9953. return this.field_152696_d.containsKey(this.func_152681_a(p_152692_1_));
  9954. }
  9955.  
  9956. private void func_152680_h() {
  9957. List<K> list = Lists.<K>newArrayList();
  9958.  
  9959. for(V v : this.field_152696_d.values()) {
  9960. if(v.func_73682_e()) {
  9961. list.add(v.func_152640_f());
  9962. }
  9963. }
  9964.  
  9965. for(K k : list) {
  9966. this.field_152696_d.remove(k);
  9967. }
  9968.  
  9969. }
  9970.  
  9971. protected UserListEntry<K> func_152682_a(JsonObject p_152682_1_) {
  9972. return new UserListEntry((Object)null, p_152682_1_);
  9973. }
  9974.  
  9975. protected Map<String, V> func_152688_e() {
  9976. return this.field_152696_d;
  9977. }
  9978.  
  9979. public void func_152678_f() throws IOException {
  9980. Collection<V> collection = this.field_152696_d.values();
  9981. String s = this.field_152694_b.toJson((Object)collection);
  9982. BufferedWriter bufferedwriter = null;
  9983.  
  9984. try {
  9985. bufferedwriter = Files.newWriter(this.field_152695_c, StandardCharsets.UTF_8);
  9986. bufferedwriter.write(s);
  9987. } finally {
  9988. IOUtils.closeQuietly((Writer)bufferedwriter);
  9989. }
  9990.  
  9991. }
  9992.  
  9993. @SideOnly(Side.SERVER)
  9994. public boolean func_152690_d() {
  9995. return this.field_152696_d.size() < 1;
  9996. }
  9997.  
  9998. @SideOnly(Side.SERVER)
  9999. public void func_152679_g() throws IOException, FileNotFoundException {
  10000. if(this.field_152695_c.exists()) {
  10001. Collection<UserListEntry<K>> collection = null;
  10002. BufferedReader bufferedreader = null;
  10003.  
  10004. try {
  10005. bufferedreader = Files.newReader(this.field_152695_c, StandardCharsets.UTF_8);
  10006. collection = (Collection)JsonUtils.func_193841_a(this.field_152694_b, bufferedreader, field_152698_f);
  10007. } finally {
  10008. IOUtils.closeQuietly((Reader)bufferedreader);
  10009. }
  10010.  
  10011. if(collection != null) {
  10012. this.field_152696_d.clear();
  10013.  
  10014. for(UserListEntry<K> userlistentry : collection) {
  10015. if(userlistentry.func_152640_f() != null) {
  10016. this.field_152696_d.put(this.func_152681_a(userlistentry.func_152640_f()), userlistentry);
  10017. }
  10018. }
  10019. }
  10020.  
  10021. }
  10022. }
  10023.  
  10024. class Serializer implements JsonDeserializer<UserListEntry<K>>, JsonSerializer<UserListEntry<K>> {
  10025. private Serializer() {
  10026. }
  10027.  
  10028. public JsonElement serialize(UserListEntry<K> p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) {
  10029. JsonObject jsonobject = new JsonObject();
  10030. p_serialize_1_.func_152641_a(jsonobject);
  10031. return jsonobject;
  10032. }
  10033.  
  10034. public UserListEntry<K> deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException {
  10035. if(p_deserialize_1_.isJsonObject()) {
  10036. JsonObject jsonobject = p_deserialize_1_.getAsJsonObject();
  10037. return UserList.this.func_152682_a(jsonobject);
  10038. } else {
  10039. return null;
  10040. }
  10041. }
  10042. }
  10043. }
  10044.  
  10045. Patching failed: minecraft\net\minecraft\util\EnumTypeAdapterFactory.java
  10046. Hunk 1 failed! Cannot find hunk target
  10047. public class EnumTypeAdapterFactory implements TypeAdapterFactory {
  10048. @Nullable
  10049. public <T> TypeAdapter<T> create(Gson p_create_1_, TypeToken<T> p_create_2_) {
  10050. - Class<T> oclass = p_create_2_.getRawType();
  10051. + Class<T> oclass = (Class<T>)p_create_2_.getRawType();
  10052. if (!oclass.isEnum()) {
  10053. return null;
  10054. } else {
  10055. File state
  10056. package net.minecraft.util;
  10057.  
  10058. import com.google.common.collect.Maps;
  10059. import com.google.gson.Gson;
  10060. import com.google.gson.TypeAdapter;
  10061. import com.google.gson.TypeAdapterFactory;
  10062. import com.google.gson.reflect.TypeToken;
  10063. import com.google.gson.stream.JsonReader;
  10064. import com.google.gson.stream.JsonToken;
  10065. import com.google.gson.stream.JsonWriter;
  10066. import java.io.IOException;
  10067. import java.util.Locale;
  10068. import java.util.Map;
  10069. import javax.annotation.Nullable;
  10070.  
  10071. public class EnumTypeAdapterFactory implements TypeAdapterFactory {
  10072. @Nullable
  10073. public <T> TypeAdapter<T> create(Gson p_create_1_, TypeToken<T> p_create_2_) {
  10074. Class<T> oclass = p_create_2_.getRawType();
  10075. if(!oclass.isEnum()) {
  10076. return null;
  10077. } else {
  10078. final Map<String, T> map = Maps.<String, T>newHashMap();
  10079.  
  10080. for(T t : oclass.getEnumConstants()) {
  10081. map.put(this.func_151232_a(t), t);
  10082. }
  10083.  
  10084. return new TypeAdapter<T>() {
  10085. public void write(JsonWriter p_write_1_, T p_write_2_) throws IOException {
  10086. if(p_write_2_ == null) {
  10087. p_write_1_.nullValue();
  10088. } else {
  10089. p_write_1_.value(EnumTypeAdapterFactory.this.func_151232_a(p_write_2_));
  10090. }
  10091.  
  10092. }
  10093.  
  10094. @Nullable
  10095. public T read(JsonReader p_read_1_) throws IOException {
  10096. if(p_read_1_.peek() == JsonToken.NULL) {
  10097. p_read_1_.nextNull();
  10098. return (T)null;
  10099. } else {
  10100. return (T)map.get(p_read_1_.nextString());
  10101. }
  10102. }
  10103. };
  10104. }
  10105. }
  10106.  
  10107. private String func_151232_a(Object p_151232_1_) {
  10108. return p_151232_1_ instanceof Enum?((Enum)p_151232_1_).name().toLowerCase(Locale.ROOT):p_151232_1_.toString().toLowerCase(Locale.ROOT);
  10109. }
  10110. }
  10111.  
  10112. Patching failed: minecraft\net\minecraft\util\datafix\walkers\Filtered.java
  10113. Hunk 1 failed! Cannot find hunk target
  10114.  
  10115. public Filtered(Class<?> p_i47309_1_) {
  10116. if (Entity.class.isAssignableFrom(p_i47309_1_)) {
  10117. - this.field_188272_a = EntityList.func_191306_a(p_i47309_1_);
  10118. + this.field_188272_a = EntityList.func_191306_a((Class<Entity>)p_i47309_1_);
  10119. } else if (TileEntity.class.isAssignableFrom(p_i47309_1_)) {
  10120. - this.field_188272_a = TileEntity.func_190559_a(p_i47309_1_);
  10121. + this.field_188272_a = TileEntity.func_190559_a((Class<TileEntity>)p_i47309_1_);
  10122. } else {
  10123. this.field_188272_a = null;
  10124. }
  10125. File state
  10126. package net.minecraft.util.datafix.walkers;
  10127.  
  10128. import net.minecraft.entity.Entity;
  10129. import net.minecraft.entity.EntityList;
  10130. import net.minecraft.nbt.NBTTagCompound;
  10131. import net.minecraft.tileentity.TileEntity;
  10132. import net.minecraft.util.ResourceLocation;
  10133. import net.minecraft.util.datafix.IDataFixer;
  10134. import net.minecraft.util.datafix.IDataWalker;
  10135.  
  10136. public abstract class Filtered implements IDataWalker {
  10137. private final ResourceLocation field_188272_a;
  10138.  
  10139. public Filtered(Class<?> p_i47309_1_) {
  10140. if(Entity.class.isAssignableFrom(p_i47309_1_)) {
  10141. this.field_188272_a = EntityList.func_191306_a(p_i47309_1_);
  10142. } else if(TileEntity.class.isAssignableFrom(p_i47309_1_)) {
  10143. this.field_188272_a = TileEntity.func_190559_a(p_i47309_1_);
  10144. } else {
  10145. this.field_188272_a = null;
  10146. }
  10147.  
  10148. }
  10149.  
  10150. public NBTTagCompound func_188266_a(IDataFixer p_188266_1_, NBTTagCompound p_188266_2_, int p_188266_3_) {
  10151. if((new ResourceLocation(p_188266_2_.func_74779_i("id"))).equals(this.field_188272_a)) {
  10152. p_188266_2_ = this.func_188271_b(p_188266_1_, p_188266_2_, p_188266_3_);
  10153. }
  10154.  
  10155. return p_188266_2_;
  10156. }
  10157.  
  10158. abstract NBTTagCompound func_188271_b(IDataFixer p_188271_1_, NBTTagCompound p_188271_2_, int p_188271_3_);
  10159. }
  10160.  
  10161. Patching failed: minecraft\net\minecraft\entity\EntityAreaEffectCloud.java
  10162. Hunk 1 failed! Cannot find hunk target
  10163. }
  10164. }
  10165.  
  10166. - iterator = Lists.<Entry<Entity, Integer>>newArrayList();
  10167. + List<PotionEffect> potions = Lists.<PotionEffect>newArrayList();
  10168.  
  10169. for(PotionEffect potioneffect1 : this.field_184502_e.func_185170_a()) {
  10170. - iterator.add(new PotionEffect(potioneffect1.func_188419_a(), potioneffect1.func_76459_b() / 4, potioneffect1.func_76458_c(), potioneffect1.func_82720_e(), potioneffect1.func_188418_e()));
  10171. - }
  10172. -
  10173. - iterator.addAll(this.field_184503_f);
  10174. - if (iterator.isEmpty()) {
  10175. + potions.add(new PotionEffect(potioneffect1.func_188419_a(), potioneffect1.func_76459_b() / 4, potioneffect1.func_76458_c(), potioneffect1.func_82720_e(), potioneffect1.func_188418_e()));
  10176. + }
  10177. +
  10178. + potions.addAll(this.field_184503_f);
  10179. + if (potions.isEmpty()) {
  10180. this.field_184504_g.clear();
  10181. } else {
  10182. List<EntityLivingBase> list = this.field_70170_p.<EntityLivingBase>func_72872_a(EntityLivingBase.class, this.func_174813_aQ());
  10183. File state
  10184. package net.minecraft.entity;
  10185.  
  10186. import com.google.common.collect.Lists;
  10187. import com.google.common.collect.Maps;
  10188. import java.util.Iterator;
  10189. import java.util.List;
  10190. import java.util.Map;
  10191. import java.util.UUID;
  10192. import java.util.Map.Entry;
  10193. import javax.annotation.Nullable;
  10194. import net.minecraft.block.material.EnumPushReaction;
  10195. import net.minecraft.entity.Entity;
  10196. import net.minecraft.entity.EntityLivingBase;
  10197. import net.minecraft.init.PotionTypes;
  10198. import net.minecraft.nbt.NBTTagCompound;
  10199. import net.minecraft.nbt.NBTTagList;
  10200. import net.minecraft.network.datasync.DataParameter;
  10201. import net.minecraft.network.datasync.DataSerializers;
  10202. import net.minecraft.network.datasync.EntityDataManager;
  10203. import net.minecraft.potion.PotionEffect;
  10204. import net.minecraft.potion.PotionType;
  10205. import net.minecraft.potion.PotionUtils;
  10206. import net.minecraft.util.EnumParticleTypes;
  10207. import net.minecraft.util.ResourceLocation;
  10208. import net.minecraft.util.math.MathHelper;
  10209. import net.minecraft.world.World;
  10210. import net.minecraft.world.WorldServer;
  10211.  
  10212. public class EntityAreaEffectCloud extends Entity {
  10213. private static final DataParameter<Float> field_184498_a = EntityDataManager.<Float>func_187226_a(EntityAreaEffectCloud.class, DataSerializers.field_187193_c);
  10214. private static final DataParameter<Integer> field_184499_b = EntityDataManager.<Integer>func_187226_a(EntityAreaEffectCloud.class, DataSerializers.field_187192_b);
  10215. private static final DataParameter<Boolean> field_184500_c = EntityDataManager.<Boolean>func_187226_a(EntityAreaEffectCloud.class, DataSerializers.field_187198_h);
  10216. private static final DataParameter<Integer> field_184501_d = EntityDataManager.<Integer>func_187226_a(EntityAreaEffectCloud.class, DataSerializers.field_187192_b);
  10217. private static final DataParameter<Integer> field_189736_e = EntityDataManager.<Integer>func_187226_a(EntityAreaEffectCloud.class, DataSerializers.field_187192_b);
  10218. private static final DataParameter<Integer> field_189737_f = EntityDataManager.<Integer>func_187226_a(EntityAreaEffectCloud.class, DataSerializers.field_187192_b);
  10219. private PotionType field_184502_e;
  10220. private final List<PotionEffect> field_184503_f;
  10221. private final Map<Entity, Integer> field_184504_g;
  10222. private int field_184505_h;
  10223. private int field_184506_as;
  10224. private int field_184507_at;
  10225. private boolean field_184508_au;
  10226. private int field_184509_av;
  10227. private float field_184510_aw;
  10228. private float field_184511_ax;
  10229. private EntityLivingBase field_184512_ay;
  10230. private UUID field_184513_az;
  10231.  
  10232. public EntityAreaEffectCloud(World p_i46809_1_) {
  10233. super(p_i46809_1_);
  10234. this.field_184502_e = PotionTypes.field_185229_a;
  10235. this.field_184503_f = Lists.<PotionEffect>newArrayList();
  10236. this.field_184504_g = Maps.<Entity, Integer>newHashMap();
  10237. this.field_184505_h = 600;
  10238. this.field_184506_as = 20;
  10239. this.field_184507_at = 20;
  10240. this.field_70145_X = true;
  10241. this.field_70178_ae = true;
  10242. this.func_184483_a(3.0F);
  10243. }
  10244.  
  10245. public EntityAreaEffectCloud(World p_i46810_1_, double p_i46810_2_, double p_i46810_4_, double p_i46810_6_) {
  10246. this(p_i46810_1_);
  10247. this.func_70107_b(p_i46810_2_, p_i46810_4_, p_i46810_6_);
  10248. }
  10249.  
  10250. protected void func_70088_a() {
  10251. this.func_184212_Q().func_187214_a(field_184499_b, Integer.valueOf(0));
  10252. this.func_184212_Q().func_187214_a(field_184498_a, Float.valueOf(0.5F));
  10253. this.func_184212_Q().func_187214_a(field_184500_c, Boolean.valueOf(false));
  10254. this.func_184212_Q().func_187214_a(field_184501_d, Integer.valueOf(EnumParticleTypes.SPELL_MOB.func_179348_c()));
  10255. this.func_184212_Q().func_187214_a(field_189736_e, Integer.valueOf(0));
  10256. this.func_184212_Q().func_187214_a(field_189737_f, Integer.valueOf(0));
  10257. }
  10258.  
  10259. public void func_184483_a(float p_184483_1_) {
  10260. double d0 = this.field_70165_t;
  10261. double d1 = this.field_70163_u;
  10262. double d2 = this.field_70161_v;
  10263. this.func_70105_a(p_184483_1_ * 2.0F, 0.5F);
  10264. this.func_70107_b(d0, d1, d2);
  10265. if(!this.field_70170_p.field_72995_K) {
  10266. this.func_184212_Q().func_187227_b(field_184498_a, Float.valueOf(p_184483_1_));
  10267. }
  10268.  
  10269. }
  10270.  
  10271. public float func_184490_j() {
  10272. return ((Float)this.func_184212_Q().func_187225_a(field_184498_a)).floatValue();
  10273. }
  10274.  
  10275. public void func_184484_a(PotionType p_184484_1_) {
  10276. this.field_184502_e = p_184484_1_;
  10277. if(!this.field_184508_au) {
  10278. this.func_190618_C();
  10279. }
  10280.  
  10281. }
  10282.  
  10283. private void func_190618_C() {
  10284. if(this.field_184502_e == PotionTypes.field_185229_a && this.field_184503_f.isEmpty()) {
  10285. this.func_184212_Q().func_187227_b(field_184499_b, Integer.valueOf(0));
  10286. } else {
  10287. this.func_184212_Q().func_187227_b(field_184499_b, Integer.valueOf(PotionUtils.func_185181_a(PotionUtils.func_185186_a(this.field_184502_e, this.field_184503_f))));
  10288. }
  10289.  
  10290. }
  10291.  
  10292. public void func_184496_a(PotionEffect p_184496_1_) {
  10293. this.field_184503_f.add(p_184496_1_);
  10294. if(!this.field_184508_au) {
  10295. this.func_190618_C();
  10296. }
  10297.  
  10298. }
  10299.  
  10300. public int func_184492_k() {
  10301. return ((Integer)this.func_184212_Q().func_187225_a(field_184499_b)).intValue();
  10302. }
  10303.  
  10304. public void func_184482_a(int p_184482_1_) {
  10305. this.field_184508_au = true;
  10306. this.func_184212_Q().func_187227_b(field_184499_b, Integer.valueOf(p_184482_1_));
  10307. }
  10308.  
  10309. public EnumParticleTypes func_184493_l() {
  10310. return EnumParticleTypes.func_179342_a(((Integer)this.func_184212_Q().func_187225_a(field_184501_d)).intValue());
  10311. }
  10312.  
  10313. public void func_184491_a(EnumParticleTypes p_184491_1_) {
  10314. this.func_184212_Q().func_187227_b(field_184501_d, Integer.valueOf(p_184491_1_.func_179348_c()));
  10315. }
  10316.  
  10317. public int func_189733_n() {
  10318. return ((Integer)this.func_184212_Q().func_187225_a(field_189736_e)).intValue();
  10319. }
  10320.  
  10321. public void func_189734_b(int p_189734_1_) {
  10322. this.func_184212_Q().func_187227_b(field_189736_e, Integer.valueOf(p_189734_1_));
  10323. }
  10324.  
  10325. public int func_189735_o() {
  10326. return ((Integer)this.func_184212_Q().func_187225_a(field_189737_f)).intValue();
  10327. }
  10328.  
  10329. public void func_189732_d(int p_189732_1_) {
  10330. this.func_184212_Q().func_187227_b(field_189737_f, Integer.valueOf(p_189732_1_));
  10331. }
  10332.  
  10333. protected void func_184488_a(boolean p_184488_1_) {
  10334. this.func_184212_Q().func_187227_b(field_184500_c, Boolean.valueOf(p_184488_1_));
  10335. }
  10336.  
  10337. public boolean func_184497_n() {
  10338. return ((Boolean)this.func_184212_Q().func_187225_a(field_184500_c)).booleanValue();
  10339. }
  10340.  
  10341. public int func_184489_o() {
  10342. return this.field_184505_h;
  10343. }
  10344.  
  10345. public void func_184486_b(int p_184486_1_) {
  10346. this.field_184505_h = p_184486_1_;
  10347. }
  10348.  
  10349. public void func_70071_h_() {
  10350. super.func_70071_h_();
  10351. boolean flag = this.func_184497_n();
  10352. float f = this.func_184490_j();
  10353. if(this.field_70170_p.field_72995_K) {
  10354. EnumParticleTypes enumparticletypes = this.func_184493_l();
  10355. int[] aint = new int[enumparticletypes.func_179345_d()];
  10356. if(aint.length > 0) {
  10357. aint[0] = this.func_189733_n();
  10358. }
  10359.  
  10360. if(aint.length > 1) {
  10361. aint[1] = this.func_189735_o();
  10362. }
  10363.  
  10364. if(flag) {
  10365. if(this.field_70146_Z.nextBoolean()) {
  10366. for(int i = 0; i < 2; ++i) {
  10367. float f1 = this.field_70146_Z.nextFloat() * 6.2831855F;
  10368. float f2 = MathHelper.func_76129_c(this.field_70146_Z.nextFloat()) * 0.2F;
  10369. float f3 = MathHelper.func_76134_b(f1) * f2;
  10370. float f4 = MathHelper.func_76126_a(f1) * f2;
  10371. if(enumparticletypes == EnumParticleTypes.SPELL_MOB) {
  10372. int j = this.field_70146_Z.nextBoolean()?16777215:this.func_184492_k();
  10373. int k = j >> 16 & 255;
  10374. int l = j >> 8 & 255;
  10375. int i1 = j & 255;
  10376. this.field_70170_p.func_190523_a(EnumParticleTypes.SPELL_MOB.func_179348_c(), this.field_70165_t + (double)f3, this.field_70163_u, this.field_70161_v + (double)f4, (double)((float)k / 255.0F), (double)((float)l / 255.0F), (double)((float)i1 / 255.0F), new int[0]);
  10377. } else {
  10378. this.field_70170_p.func_190523_a(enumparticletypes.func_179348_c(), this.field_70165_t + (double)f3, this.field_70163_u, this.field_70161_v + (double)f4, 0.0D, 0.0D, 0.0D, aint);
  10379. }
  10380. }
  10381. }
  10382. } else {
  10383. float f5 = 3.1415927F * f * f;
  10384.  
  10385. for(int k1 = 0; (float)k1 < f5; ++k1) {
  10386. float f6 = this.field_70146_Z.nextFloat() * 6.2831855F;
  10387. float f7 = MathHelper.func_76129_c(this.field_70146_Z.nextFloat()) * f;
  10388. float f8 = MathHelper.func_76134_b(f6) * f7;
  10389. float f9 = MathHelper.func_76126_a(f6) * f7;
  10390. if(enumparticletypes == EnumParticleTypes.SPELL_MOB) {
  10391. int l1 = this.func_184492_k();
  10392. int i2 = l1 >> 16 & 255;
  10393. int j2 = l1 >> 8 & 255;
  10394. int j1 = l1 & 255;
  10395. this.field_70170_p.func_190523_a(EnumParticleTypes.SPELL_MOB.func_179348_c(), this.field_70165_t + (double)f8, this.field_70163_u, this.field_70161_v + (double)f9, (double)((float)i2 / 255.0F), (double)((float)j2 / 255.0F), (double)((float)j1 / 255.0F), new int[0]);
  10396. } else {
  10397. this.field_70170_p.func_190523_a(enumparticletypes.func_179348_c(), this.field_70165_t + (double)f8, this.field_70163_u, this.field_70161_v + (double)f9, (0.5D - this.field_70146_Z.nextDouble()) * 0.15D, 0.009999999776482582D, (0.5D - this.field_70146_Z.nextDouble()) * 0.15D, aint);
  10398. }
  10399. }
  10400. }
  10401. } else {
  10402. if(this.field_70173_aa >= this.field_184506_as + this.field_184505_h) {
  10403. this.func_70106_y();
  10404. return;
  10405. }
  10406.  
  10407. boolean flag1 = this.field_70173_aa < this.field_184506_as;
  10408. if(flag != flag1) {
  10409. this.func_184488_a(flag1);
  10410. }
  10411.  
  10412. if(flag1) {
  10413. return;
  10414. }
  10415.  
  10416. if(this.field_184511_ax != 0.0F) {
  10417. f += this.field_184511_ax;
  10418. if(f < 0.5F) {
  10419. this.func_70106_y();
  10420. return;
  10421. }
  10422.  
  10423. this.func_184483_a(f);
  10424. }
  10425.  
  10426. if(this.field_70173_aa % 5 == 0) {
  10427. Iterator<Entry<Entity, Integer>> iterator = this.field_184504_g.entrySet().iterator();
  10428.  
  10429. while(iterator.hasNext()) {
  10430. Entry<Entity, Integer> entry = (Entry)iterator.next();
  10431. if(this.field_70173_aa >= ((Integer)entry.getValue()).intValue()) {
  10432. iterator.remove();
  10433. }
  10434. }
  10435.  
  10436. iterator = Lists.<Entry<Entity, Integer>>newArrayList();
  10437.  
  10438. for(PotionEffect potioneffect1 : this.field_184502_e.func_185170_a()) {
  10439. iterator.add(new PotionEffect(potioneffect1.func_188419_a(), potioneffect1.func_76459_b() / 4, potioneffect1.func_76458_c(), potioneffect1.func_82720_e(), potioneffect1.func_188418_e()));
  10440. }
  10441.  
  10442. iterator.addAll(this.field_184503_f);
  10443. if(iterator.isEmpty()) {
  10444. this.field_184504_g.clear();
  10445. } else {
  10446. List<EntityLivingBase> list = this.field_70170_p.<EntityLivingBase>func_72872_a(EntityLivingBase.class, this.func_174813_aQ());
  10447. if(!list.isEmpty()) {
  10448. for(EntityLivingBase entitylivingbase : list) {
  10449. if(!this.field_184504_g.containsKey(entitylivingbase) && entitylivingbase.func_184603_cC()) {
  10450. double d0 = entitylivingbase.field_70165_t - this.field_70165_t;
  10451. double d1 = entitylivingbase.field_70161_v - this.field_70161_v;
  10452. double d2 = d0 * d0 + d1 * d1;
  10453. if(d2 <= (double)(f * f)) {
  10454. this.field_184504_g.put(entitylivingbase, Integer.valueOf(this.field_70173_aa + this.field_184507_at));
  10455.  
  10456. for(PotionEffect potioneffect : iterator) {
  10457. if(potioneffect.func_188419_a().func_76403_b()) {
  10458. potioneffect.func_188419_a().func_180793_a(this, this.func_184494_w(), entitylivingbase, potioneffect.func_76458_c(), 0.5D);
  10459. } else {
  10460. entitylivingbase.func_70690_d(new PotionEffect(potioneffect));
  10461. }
  10462. }
  10463.  
  10464. if(this.field_184510_aw != 0.0F) {
  10465. f += this.field_184510_aw;
  10466. if(f < 0.5F) {
  10467. this.func_70106_y();
  10468. return;
  10469. }
  10470.  
  10471. this.func_184483_a(f);
  10472. }
  10473.  
  10474. if(this.field_184509_av != 0) {
  10475. this.field_184505_h += this.field_184509_av;
  10476. if(this.field_184505_h <= 0) {
  10477. this.func_70106_y();
  10478. return;
  10479. }
  10480. }
  10481. }
  10482. }
  10483. }
  10484. }
  10485. }
  10486. }
  10487. }
  10488.  
  10489. }
  10490.  
  10491. public void func_184495_b(float p_184495_1_) {
  10492. this.field_184510_aw = p_184495_1_;
  10493. }
  10494.  
  10495. public void func_184487_c(float p_184487_1_) {
  10496. this.field_184511_ax = p_184487_1_;
  10497. }
  10498.  
  10499. public void func_184485_d(int p_184485_1_) {
  10500. this.field_184506_as = p_184485_1_;
  10501. }
  10502.  
  10503. public void func_184481_a(@Nullable EntityLivingBase p_184481_1_) {
  10504. this.field_184512_ay = p_184481_1_;
  10505. this.field_184513_az = p_184481_1_ == null?null:p_184481_1_.func_110124_au();
  10506. }
  10507.  
  10508. @Nullable
  10509. public EntityLivingBase func_184494_w() {
  10510. if(this.field_184512_ay == null && this.field_184513_az != null && this.field_70170_p instanceof WorldServer) {
  10511. Entity entity = ((WorldServer)this.field_70170_p).func_175733_a(this.field_184513_az);
  10512. if(entity instanceof EntityLivingBase) {
  10513. this.field_184512_ay = (EntityLivingBase)entity;
  10514. }
  10515. }
  10516.  
  10517. return this.field_184512_ay;
  10518. }
  10519.  
  10520. protected void func_70037_a(NBTTagCompound p_70037_1_) {
  10521. this.field_70173_aa = p_70037_1_.func_74762_e("Age");
  10522. this.field_184505_h = p_70037_1_.func_74762_e("Duration");
  10523. this.field_184506_as = p_70037_1_.func_74762_e("WaitTime");
  10524. this.field_184507_at = p_70037_1_.func_74762_e("ReapplicationDelay");
  10525. this.field_184509_av = p_70037_1_.func_74762_e("DurationOnUse");
  10526. this.field_184510_aw = p_70037_1_.func_74760_g("RadiusOnUse");
  10527. this.field_184511_ax = p_70037_1_.func_74760_g("RadiusPerTick");
  10528. this.func_184483_a(p_70037_1_.func_74760_g("Radius"));
  10529. this.field_184513_az = p_70037_1_.func_186857_a("OwnerUUID");
  10530. if(p_70037_1_.func_150297_b("Particle", 8)) {
  10531. EnumParticleTypes enumparticletypes = EnumParticleTypes.func_186831_a(p_70037_1_.func_74779_i("Particle"));
  10532. if(enumparticletypes != null) {
  10533. this.func_184491_a(enumparticletypes);
  10534. this.func_189734_b(p_70037_1_.func_74762_e("ParticleParam1"));
  10535. this.func_189732_d(p_70037_1_.func_74762_e("ParticleParam2"));
  10536. }
  10537. }
  10538.  
  10539. if(p_70037_1_.func_150297_b("Color", 99)) {
  10540. this.func_184482_a(p_70037_1_.func_74762_e("Color"));
  10541. }
  10542.  
  10543. if(p_70037_1_.func_150297_b("Potion", 8)) {
  10544. this.func_184484_a(PotionUtils.func_185187_c(p_70037_1_));
  10545. }
  10546.  
  10547. if(p_70037_1_.func_150297_b("Effects", 9)) {
  10548. NBTTagList nbttaglist = p_70037_1_.func_150295_c("Effects", 10);
  10549. this.field_184503_f.clear();
  10550.  
  10551. for(int i = 0; i < nbttaglist.func_74745_c(); ++i) {
  10552. PotionEffect potioneffect = PotionEffect.func_82722_b(nbttaglist.func_150305_b(i));
  10553. if(potioneffect != null) {
  10554. this.func_184496_a(potioneffect);
  10555. }
  10556. }
  10557. }
  10558.  
  10559. }
  10560.  
  10561. protected void func_70014_b(NBTTagCompound p_70014_1_) {
  10562. p_70014_1_.func_74768_a("Age", this.field_70173_aa);
  10563. p_70014_1_.func_74768_a("Duration", this.field_184505_h);
  10564. p_70014_1_.func_74768_a("WaitTime", this.field_184506_as);
  10565. p_70014_1_.func_74768_a("ReapplicationDelay", this.field_184507_at);
  10566. p_70014_1_.func_74768_a("DurationOnUse", this.field_184509_av);
  10567. p_70014_1_.func_74776_a("RadiusOnUse", this.field_184510_aw);
  10568. p_70014_1_.func_74776_a("RadiusPerTick", this.field_184511_ax);
  10569. p_70014_1_.func_74776_a("Radius", this.func_184490_j());
  10570. p_70014_1_.func_74778_a("Particle", this.func_184493_l().func_179346_b());
  10571. p_70014_1_.func_74768_a("ParticleParam1", this.func_189733_n());
  10572. p_70014_1_.func_74768_a("ParticleParam2", this.func_189735_o());
  10573. if(this.field_184513_az != null) {
  10574. p_70014_1_.func_186854_a("OwnerUUID", this.field_184513_az);
  10575. }
  10576.  
  10577. if(this.field_184508_au) {
  10578. p_70014_1_.func_74768_a("Color", this.func_184492_k());
  10579. }
  10580.  
  10581. if(this.field_184502_e != PotionTypes.field_185229_a && this.field_184502_e != null) {
  10582. p_70014_1_.func_74778_a("Potion", ((ResourceLocation)PotionType.field_185176_a.func_177774_c(this.field_184502_e)).toString());
  10583. }
  10584.  
  10585. if(!this.field_184503_f.isEmpty()) {
  10586. NBTTagList nbttaglist = new NBTTagList();
  10587.  
  10588. for(PotionEffect potioneffect : this.field_184503_f) {
  10589. nbttaglist.func_74742_a(potioneffect.func_82719_a(new NBTTagCompound()));
  10590. }
  10591.  
  10592. p_70014_1_.func_74782_a("Effects", nbttaglist);
  10593. }
  10594.  
  10595. }
  10596.  
  10597. public void func_184206_a(DataParameter<?> p_184206_1_) {
  10598. if(field_184498_a.equals(p_184206_1_)) {
  10599. this.func_184483_a(this.func_184490_j());
  10600. }
  10601.  
  10602. super.func_184206_a(p_184206_1_);
  10603. }
  10604.  
  10605. public EnumPushReaction func_184192_z() {
  10606. return EnumPushReaction.IGNORE;
  10607. }
  10608. }
  10609.  
  10610. Hunk 2 failed! Cannot find hunk target
  10611. if (d2 <= (double)(f * f)) {
  10612. this.field_184504_g.put(entitylivingbase, Integer.valueOf(this.field_70173_aa + this.field_184507_at));
  10613.  
  10614. - for(PotionEffect potioneffect : iterator) {
  10615. + for(PotionEffect potioneffect : potions) {
  10616. if (potioneffect.func_188419_a().func_76403_b()) {
  10617. potioneffect.func_188419_a().func_180793_a(this, this.func_184494_w(), entitylivingbase, potioneffect.func_76458_c(), 0.5D);
  10618. } else {
  10619. File state
  10620. package net.minecraft.entity;
  10621.  
  10622. import com.google.common.collect.Lists;
  10623. import com.google.common.collect.Maps;
  10624. import java.util.Iterator;
  10625. import java.util.List;
  10626. import java.util.Map;
  10627. import java.util.UUID;
  10628. import java.util.Map.Entry;
  10629. import javax.annotation.Nullable;
  10630. import net.minecraft.block.material.EnumPushReaction;
  10631. import net.minecraft.entity.Entity;
  10632. import net.minecraft.entity.EntityLivingBase;
  10633. import net.minecraft.init.PotionTypes;
  10634. import net.minecraft.nbt.NBTTagCompound;
  10635. import net.minecraft.nbt.NBTTagList;
  10636. import net.minecraft.network.datasync.DataParameter;
  10637. import net.minecraft.network.datasync.DataSerializers;
  10638. import net.minecraft.network.datasync.EntityDataManager;
  10639. import net.minecraft.potion.PotionEffect;
  10640. import net.minecraft.potion.PotionType;
  10641. import net.minecraft.potion.PotionUtils;
  10642. import net.minecraft.util.EnumParticleTypes;
  10643. import net.minecraft.util.ResourceLocation;
  10644. import net.minecraft.util.math.MathHelper;
  10645. import net.minecraft.world.World;
  10646. import net.minecraft.world.WorldServer;
  10647.  
  10648. public class EntityAreaEffectCloud extends Entity {
  10649. private static final DataParameter<Float> field_184498_a = EntityDataManager.<Float>func_187226_a(EntityAreaEffectCloud.class, DataSerializers.field_187193_c);
  10650. private static final DataParameter<Integer> field_184499_b = EntityDataManager.<Integer>func_187226_a(EntityAreaEffectCloud.class, DataSerializers.field_187192_b);
  10651. private static final DataParameter<Boolean> field_184500_c = EntityDataManager.<Boolean>func_187226_a(EntityAreaEffectCloud.class, DataSerializers.field_187198_h);
  10652. private static final DataParameter<Integer> field_184501_d = EntityDataManager.<Integer>func_187226_a(EntityAreaEffectCloud.class, DataSerializers.field_187192_b);
  10653. private static final DataParameter<Integer> field_189736_e = EntityDataManager.<Integer>func_187226_a(EntityAreaEffectCloud.class, DataSerializers.field_187192_b);
  10654. private static final DataParameter<Integer> field_189737_f = EntityDataManager.<Integer>func_187226_a(EntityAreaEffectCloud.class, DataSerializers.field_187192_b);
  10655. private PotionType field_184502_e;
  10656. private final List<PotionEffect> field_184503_f;
  10657. private final Map<Entity, Integer> field_184504_g;
  10658. private int field_184505_h;
  10659. private int field_184506_as;
  10660. private int field_184507_at;
  10661. private boolean field_184508_au;
  10662. private int field_184509_av;
  10663. private float field_184510_aw;
  10664. private float field_184511_ax;
  10665. private EntityLivingBase field_184512_ay;
  10666. private UUID field_184513_az;
  10667.  
  10668. public EntityAreaEffectCloud(World p_i46809_1_) {
  10669. super(p_i46809_1_);
  10670. this.field_184502_e = PotionTypes.field_185229_a;
  10671. this.field_184503_f = Lists.<PotionEffect>newArrayList();
  10672. this.field_184504_g = Maps.<Entity, Integer>newHashMap();
  10673. this.field_184505_h = 600;
  10674. this.field_184506_as = 20;
  10675. this.field_184507_at = 20;
  10676. this.field_70145_X = true;
  10677. this.field_70178_ae = true;
  10678. this.func_184483_a(3.0F);
  10679. }
  10680.  
  10681. public EntityAreaEffectCloud(World p_i46810_1_, double p_i46810_2_, double p_i46810_4_, double p_i46810_6_) {
  10682. this(p_i46810_1_);
  10683. this.func_70107_b(p_i46810_2_, p_i46810_4_, p_i46810_6_);
  10684. }
  10685.  
  10686. protected void func_70088_a() {
  10687. this.func_184212_Q().func_187214_a(field_184499_b, Integer.valueOf(0));
  10688. this.func_184212_Q().func_187214_a(field_184498_a, Float.valueOf(0.5F));
  10689. this.func_184212_Q().func_187214_a(field_184500_c, Boolean.valueOf(false));
  10690. this.func_184212_Q().func_187214_a(field_184501_d, Integer.valueOf(EnumParticleTypes.SPELL_MOB.func_179348_c()));
  10691. this.func_184212_Q().func_187214_a(field_189736_e, Integer.valueOf(0));
  10692. this.func_184212_Q().func_187214_a(field_189737_f, Integer.valueOf(0));
  10693. }
  10694.  
  10695. public void func_184483_a(float p_184483_1_) {
  10696. double d0 = this.field_70165_t;
  10697. double d1 = this.field_70163_u;
  10698. double d2 = this.field_70161_v;
  10699. this.func_70105_a(p_184483_1_ * 2.0F, 0.5F);
  10700. this.func_70107_b(d0, d1, d2);
  10701. if(!this.field_70170_p.field_72995_K) {
  10702. this.func_184212_Q().func_187227_b(field_184498_a, Float.valueOf(p_184483_1_));
  10703. }
  10704.  
  10705. }
  10706.  
  10707. public float func_184490_j() {
  10708. return ((Float)this.func_184212_Q().func_187225_a(field_184498_a)).floatValue();
  10709. }
  10710.  
  10711. public void func_184484_a(PotionType p_184484_1_) {
  10712. this.field_184502_e = p_184484_1_;
  10713. if(!this.field_184508_au) {
  10714. this.func_190618_C();
  10715. }
  10716.  
  10717. }
  10718.  
  10719. private void func_190618_C() {
  10720. if(this.field_184502_e == PotionTypes.field_185229_a && this.field_184503_f.isEmpty()) {
  10721. this.func_184212_Q().func_187227_b(field_184499_b, Integer.valueOf(0));
  10722. } else {
  10723. this.func_184212_Q().func_187227_b(field_184499_b, Integer.valueOf(PotionUtils.func_185181_a(PotionUtils.func_185186_a(this.field_184502_e, this.field_184503_f))));
  10724. }
  10725.  
  10726. }
  10727.  
  10728. public void func_184496_a(PotionEffect p_184496_1_) {
  10729. this.field_184503_f.add(p_184496_1_);
  10730. if(!this.field_184508_au) {
  10731. this.func_190618_C();
  10732. }
  10733.  
  10734. }
  10735.  
  10736. public int func_184492_k() {
  10737. return ((Integer)this.func_184212_Q().func_187225_a(field_184499_b)).intValue();
  10738. }
  10739.  
  10740. public void func_184482_a(int p_184482_1_) {
  10741. this.field_184508_au = true;
  10742. this.func_184212_Q().func_187227_b(field_184499_b, Integer.valueOf(p_184482_1_));
  10743. }
  10744.  
  10745. public EnumParticleTypes func_184493_l() {
  10746. return EnumParticleTypes.func_179342_a(((Integer)this.func_184212_Q().func_187225_a(field_184501_d)).intValue());
  10747. }
  10748.  
  10749. public void func_184491_a(EnumParticleTypes p_184491_1_) {
  10750. this.func_184212_Q().func_187227_b(field_184501_d, Integer.valueOf(p_184491_1_.func_179348_c()));
  10751. }
  10752.  
  10753. public int func_189733_n() {
  10754. return ((Integer)this.func_184212_Q().func_187225_a(field_189736_e)).intValue();
  10755. }
  10756.  
  10757. public void func_189734_b(int p_189734_1_) {
  10758. this.func_184212_Q().func_187227_b(field_189736_e, Integer.valueOf(p_189734_1_));
  10759. }
  10760.  
  10761. public int func_189735_o() {
  10762. return ((Integer)this.func_184212_Q().func_187225_a(field_189737_f)).intValue();
  10763. }
  10764.  
  10765. public void func_189732_d(int p_189732_1_) {
  10766. this.func_184212_Q().func_187227_b(field_189737_f, Integer.valueOf(p_189732_1_));
  10767. }
  10768.  
  10769. protected void func_184488_a(boolean p_184488_1_) {
  10770. this.func_184212_Q().func_187227_b(field_184500_c, Boolean.valueOf(p_184488_1_));
  10771. }
  10772.  
  10773. public boolean func_184497_n() {
  10774. return ((Boolean)this.func_184212_Q().func_187225_a(field_184500_c)).booleanValue();
  10775. }
  10776.  
  10777. public int func_184489_o() {
  10778. return this.field_184505_h;
  10779. }
  10780.  
  10781. public void func_184486_b(int p_184486_1_) {
  10782. this.field_184505_h = p_184486_1_;
  10783. }
  10784.  
  10785. public void func_70071_h_() {
  10786. super.func_70071_h_();
  10787. boolean flag = this.func_184497_n();
  10788. float f = this.func_184490_j();
  10789. if(this.field_70170_p.field_72995_K) {
  10790. EnumParticleTypes enumparticletypes = this.func_184493_l();
  10791. int[] aint = new int[enumparticletypes.func_179345_d()];
  10792. if(aint.length > 0) {
  10793. aint[0] = this.func_189733_n();
  10794. }
  10795.  
  10796. if(aint.length > 1) {
  10797. aint[1] = this.func_189735_o();
  10798. }
  10799.  
  10800. if(flag) {
  10801. if(this.field_70146_Z.nextBoolean()) {
  10802. for(int i = 0; i < 2; ++i) {
  10803. float f1 = this.field_70146_Z.nextFloat() * 6.2831855F;
  10804. float f2 = MathHelper.func_76129_c(this.field_70146_Z.nextFloat()) * 0.2F;
  10805. float f3 = MathHelper.func_76134_b(f1) * f2;
  10806. float f4 = MathHelper.func_76126_a(f1) * f2;
  10807. if(enumparticletypes == EnumParticleTypes.SPELL_MOB) {
  10808. int j = this.field_70146_Z.nextBoolean()?16777215:this.func_184492_k();
  10809. int k = j >> 16 & 255;
  10810. int l = j >> 8 & 255;
  10811. int i1 = j & 255;
  10812. this.field_70170_p.func_190523_a(EnumParticleTypes.SPELL_MOB.func_179348_c(), this.field_70165_t + (double)f3, this.field_70163_u, this.field_70161_v + (double)f4, (double)((float)k / 255.0F), (double)((float)l / 255.0F), (double)((float)i1 / 255.0F), new int[0]);
  10813. } else {
  10814. this.field_70170_p.func_190523_a(enumparticletypes.func_179348_c(), this.field_70165_t + (double)f3, this.field_70163_u, this.field_70161_v + (double)f4, 0.0D, 0.0D, 0.0D, aint);
  10815. }
  10816. }
  10817. }
  10818. } else {
  10819. float f5 = 3.1415927F * f * f;
  10820.  
  10821. for(int k1 = 0; (float)k1 < f5; ++k1) {
  10822. float f6 = this.field_70146_Z.nextFloat() * 6.2831855F;
  10823. float f7 = MathHelper.func_76129_c(this.field_70146_Z.nextFloat()) * f;
  10824. float f8 = MathHelper.func_76134_b(f6) * f7;
  10825. float f9 = MathHelper.func_76126_a(f6) * f7;
  10826. if(enumparticletypes == EnumParticleTypes.SPELL_MOB) {
  10827. int l1 = this.func_184492_k();
  10828. int i2 = l1 >> 16 & 255;
  10829. int j2 = l1 >> 8 & 255;
  10830. int j1 = l1 & 255;
  10831. this.field_70170_p.func_190523_a(EnumParticleTypes.SPELL_MOB.func_179348_c(), this.field_70165_t + (double)f8, this.field_70163_u, this.field_70161_v + (double)f9, (double)((float)i2 / 255.0F), (double)((float)j2 / 255.0F), (double)((float)j1 / 255.0F), new int[0]);
  10832. } else {
  10833. this.field_70170_p.func_190523_a(enumparticletypes.func_179348_c(), this.field_70165_t + (double)f8, this.field_70163_u, this.field_70161_v + (double)f9, (0.5D - this.field_70146_Z.nextDouble()) * 0.15D, 0.009999999776482582D, (0.5D - this.field_70146_Z.nextDouble()) * 0.15D, aint);
  10834. }
  10835. }
  10836. }
  10837. } else {
  10838. if(this.field_70173_aa >= this.field_184506_as + this.field_184505_h) {
  10839. this.func_70106_y();
  10840. return;
  10841. }
  10842.  
  10843. boolean flag1 = this.field_70173_aa < this.field_184506_as;
  10844. if(flag != flag1) {
  10845. this.func_184488_a(flag1);
  10846. }
  10847.  
  10848. if(flag1) {
  10849. return;
  10850. }
  10851.  
  10852. if(this.field_184511_ax != 0.0F) {
  10853. f += this.field_184511_ax;
  10854. if(f < 0.5F) {
  10855. this.func_70106_y();
  10856. return;
  10857. }
  10858.  
  10859. this.func_184483_a(f);
  10860. }
  10861.  
  10862. if(this.field_70173_aa % 5 == 0) {
  10863. Iterator<Entry<Entity, Integer>> iterator = this.field_184504_g.entrySet().iterator();
  10864.  
  10865. while(iterator.hasNext()) {
  10866. Entry<Entity, Integer> entry = (Entry)iterator.next();
  10867. if(this.field_70173_aa >= ((Integer)entry.getValue()).intValue()) {
  10868. iterator.remove();
  10869. }
  10870. }
  10871.  
  10872. iterator = Lists.<Entry<Entity, Integer>>newArrayList();
  10873.  
  10874. for(PotionEffect potioneffect1 : this.field_184502_e.func_185170_a()) {
  10875. iterator.add(new PotionEffect(potioneffect1.func_188419_a(), potioneffect1.func_76459_b() / 4, potioneffect1.func_76458_c(), potioneffect1.func_82720_e(), potioneffect1.func_188418_e()));
  10876. }
  10877.  
  10878. iterator.addAll(this.field_184503_f);
  10879. if(iterator.isEmpty()) {
  10880. this.field_184504_g.clear();
  10881. } else {
  10882. List<EntityLivingBase> list = this.field_70170_p.<EntityLivingBase>func_72872_a(EntityLivingBase.class, this.func_174813_aQ());
  10883. if(!list.isEmpty()) {
  10884. for(EntityLivingBase entitylivingbase : list) {
  10885. if(!this.field_184504_g.containsKey(entitylivingbase) && entitylivingbase.func_184603_cC()) {
  10886. double d0 = entitylivingbase.field_70165_t - this.field_70165_t;
  10887. double d1 = entitylivingbase.field_70161_v - this.field_70161_v;
  10888. double d2 = d0 * d0 + d1 * d1;
  10889. if(d2 <= (double)(f * f)) {
  10890. this.field_184504_g.put(entitylivingbase, Integer.valueOf(this.field_70173_aa + this.field_184507_at));
  10891.  
  10892. for(PotionEffect potioneffect : iterator) {
  10893. if(potioneffect.func_188419_a().func_76403_b()) {
  10894. potioneffect.func_188419_a().func_180793_a(this, this.func_184494_w(), entitylivingbase, potioneffect.func_76458_c(), 0.5D);
  10895. } else {
  10896. entitylivingbase.func_70690_d(new PotionEffect(potioneffect));
  10897. }
  10898. }
  10899.  
  10900. if(this.field_184510_aw != 0.0F) {
  10901. f += this.field_184510_aw;
  10902. if(f < 0.5F) {
  10903. this.func_70106_y();
  10904. return;
  10905. }
  10906.  
  10907. this.func_184483_a(f);
  10908. }
  10909.  
  10910. if(this.field_184509_av != 0) {
  10911. this.field_184505_h += this.field_184509_av;
  10912. if(this.field_184505_h <= 0) {
  10913. this.func_70106_y();
  10914. return;
  10915. }
  10916. }
  10917. }
  10918. }
  10919. }
  10920. }
  10921. }
  10922. }
  10923. }
  10924.  
  10925. }
  10926.  
  10927. public void func_184495_b(float p_184495_1_) {
  10928. this.field_184510_aw = p_184495_1_;
  10929. }
  10930.  
  10931. public void func_184487_c(float p_184487_1_) {
  10932. this.field_184511_ax = p_184487_1_;
  10933. }
  10934.  
  10935. public void func_184485_d(int p_184485_1_) {
  10936. this.field_184506_as = p_184485_1_;
  10937. }
  10938.  
  10939. public void func_184481_a(@Nullable EntityLivingBase p_184481_1_) {
  10940. this.field_184512_ay = p_184481_1_;
  10941. this.field_184513_az = p_184481_1_ == null?null:p_184481_1_.func_110124_au();
  10942. }
  10943.  
  10944. @Nullable
  10945. public EntityLivingBase func_184494_w() {
  10946. if(this.field_184512_ay == null && this.field_184513_az != null && this.field_70170_p instanceof WorldServer) {
  10947. Entity entity = ((WorldServer)this.field_70170_p).func_175733_a(this.field_184513_az);
  10948. if(entity instanceof EntityLivingBase) {
  10949. this.field_184512_ay = (EntityLivingBase)entity;
  10950. }
  10951. }
  10952.  
  10953. return this.field_184512_ay;
  10954. }
  10955.  
  10956. protected void func_70037_a(NBTTagCompound p_70037_1_) {
  10957. this.field_70173_aa = p_70037_1_.func_74762_e("Age");
  10958. this.field_184505_h = p_70037_1_.func_74762_e("Duration");
  10959. this.field_184506_as = p_70037_1_.func_74762_e("WaitTime");
  10960. this.field_184507_at = p_70037_1_.func_74762_e("ReapplicationDelay");
  10961. this.field_184509_av = p_70037_1_.func_74762_e("DurationOnUse");
  10962. this.field_184510_aw = p_70037_1_.func_74760_g("RadiusOnUse");
  10963. this.field_184511_ax = p_70037_1_.func_74760_g("RadiusPerTick");
  10964. this.func_184483_a(p_70037_1_.func_74760_g("Radius"));
  10965. this.field_184513_az = p_70037_1_.func_186857_a("OwnerUUID");
  10966. if(p_70037_1_.func_150297_b("Particle", 8)) {
  10967. EnumParticleTypes enumparticletypes = EnumParticleTypes.func_186831_a(p_70037_1_.func_74779_i("Particle"));
  10968. if(enumparticletypes != null) {
  10969. this.func_184491_a(enumparticletypes);
  10970. this.func_189734_b(p_70037_1_.func_74762_e("ParticleParam1"));
  10971. this.func_189732_d(p_70037_1_.func_74762_e("ParticleParam2"));
  10972. }
  10973. }
  10974.  
  10975. if(p_70037_1_.func_150297_b("Color", 99)) {
  10976. this.func_184482_a(p_70037_1_.func_74762_e("Color"));
  10977. }
  10978.  
  10979. if(p_70037_1_.func_150297_b("Potion", 8)) {
  10980. this.func_184484_a(PotionUtils.func_185187_c(p_70037_1_));
  10981. }
  10982.  
  10983. if(p_70037_1_.func_150297_b("Effects", 9)) {
  10984. NBTTagList nbttaglist = p_70037_1_.func_150295_c("Effects", 10);
  10985. this.field_184503_f.clear();
  10986.  
  10987. for(int i = 0; i < nbttaglist.func_74745_c(); ++i) {
  10988. PotionEffect potioneffect = PotionEffect.func_82722_b(nbttaglist.func_150305_b(i));
  10989. if(potioneffect != null) {
  10990. this.func_184496_a(potioneffect);
  10991. }
  10992. }
  10993. }
  10994.  
  10995. }
  10996.  
  10997. protected void func_70014_b(NBTTagCompound p_70014_1_) {
  10998. p_70014_1_.func_74768_a("Age", this.field_70173_aa);
  10999. p_70014_1_.func_74768_a("Duration", this.field_184505_h);
  11000. p_70014_1_.func_74768_a("WaitTime", this.field_184506_as);
  11001. p_70014_1_.func_74768_a("ReapplicationDelay", this.field_184507_at);
  11002. p_70014_1_.func_74768_a("DurationOnUse", this.field_184509_av);
  11003. p_70014_1_.func_74776_a("RadiusOnUse", this.field_184510_aw);
  11004. p_70014_1_.func_74776_a("RadiusPerTick", this.field_184511_ax);
  11005. p_70014_1_.func_74776_a("Radius", this.func_184490_j());
  11006. p_70014_1_.func_74778_a("Particle", this.func_184493_l().func_179346_b());
  11007. p_70014_1_.func_74768_a("ParticleParam1", this.func_189733_n());
  11008. p_70014_1_.func_74768_a("ParticleParam2", this.func_189735_o());
  11009. if(this.field_184513_az != null) {
  11010. p_70014_1_.func_186854_a("OwnerUUID", this.field_184513_az);
  11011. }
  11012.  
  11013. if(this.field_184508_au) {
  11014. p_70014_1_.func_74768_a("Color", this.func_184492_k());
  11015. }
  11016.  
  11017. if(this.field_184502_e != PotionTypes.field_185229_a && this.field_184502_e != null) {
  11018. p_70014_1_.func_74778_a("Potion", ((ResourceLocation)PotionType.field_185176_a.func_177774_c(this.field_184502_e)).toString());
  11019. }
  11020.  
  11021. if(!this.field_184503_f.isEmpty()) {
  11022. NBTTagList nbttaglist = new NBTTagList();
  11023.  
  11024. for(PotionEffect potioneffect : this.field_184503_f) {
  11025. nbttaglist.func_74742_a(potioneffect.func_82719_a(new NBTTagCompound()));
  11026. }
  11027.  
  11028. p_70014_1_.func_74782_a("Effects", nbttaglist);
  11029. }
  11030.  
  11031. }
  11032.  
  11033. public void func_184206_a(DataParameter<?> p_184206_1_) {
  11034. if(field_184498_a.equals(p_184206_1_)) {
  11035. this.func_184483_a(this.func_184490_j());
  11036. }
  11037.  
  11038. super.func_184206_a(p_184206_1_);
  11039. }
  11040.  
  11041. public EnumPushReaction func_184192_z() {
  11042. return EnumPushReaction.IGNORE;
  11043. }
  11044. }
  11045.  
  11046. Patching failed: minecraft\net\minecraft\entity\Entity.java
  11047. Hunk 1 failed! Cannot find hunk target
  11048. }
  11049. }
  11050.  
  11051. - boolean flag = this.field_70122_E || p_70091_4_ != p_70091_4_ && p_70091_4_ < 0.0D;
  11052. + boolean flag = this.field_70122_E || d3 != p_70091_4_ && d3 < 0.0D;
  11053. if (this.field_70138_W > 0.0F && flag && (d2 != p_70091_2_ || d4 != p_70091_6_)) {
  11054. double d14 = p_70091_2_;
  11055. double d6 = p_70091_4_;
  11056. File state
  11057. package net.minecraft.entity;
  11058.  
  11059. import com.google.common.collect.Iterables;
  11060. import com.google.common.collect.Lists;
  11061. import com.google.common.collect.Sets;
  11062. import java.util.Arrays;
  11063. import java.util.Collection;
  11064. import java.util.Collections;
  11065. import java.util.List;
  11066. import java.util.Random;
  11067. import java.util.Set;
  11068. import java.util.UUID;
  11069. import javax.annotation.Nullable;
  11070. import net.minecraft.advancements.CriteriaTriggers;
  11071. import net.minecraft.block.Block;
  11072. import net.minecraft.block.BlockFence;
  11073. import net.minecraft.block.BlockFenceGate;
  11074. import net.minecraft.block.BlockLiquid;
  11075. import net.minecraft.block.BlockWall;
  11076. import net.minecraft.block.SoundType;
  11077. import net.minecraft.block.material.EnumPushReaction;
  11078. import net.minecraft.block.material.Material;
  11079. import net.minecraft.block.state.IBlockState;
  11080. import net.minecraft.block.state.pattern.BlockPattern;
  11081. import net.minecraft.command.CommandResultStats;
  11082. import net.minecraft.command.ICommandSender;
  11083. import net.minecraft.crash.CrashReport;
  11084. import net.minecraft.crash.CrashReportCategory;
  11085. import net.minecraft.crash.ICrashReportDetail;
  11086. import net.minecraft.enchantment.EnchantmentHelper;
  11087. import net.minecraft.enchantment.EnchantmentProtection;
  11088. import net.minecraft.entity.EntityList;
  11089. import net.minecraft.entity.EntityLivingBase;
  11090. import net.minecraft.entity.MoverType;
  11091. import net.minecraft.entity.effect.EntityLightningBolt;
  11092. import net.minecraft.entity.item.EntityBoat;
  11093. import net.minecraft.entity.item.EntityItem;
  11094. import net.minecraft.entity.player.EntityPlayer;
  11095. import net.minecraft.entity.player.EntityPlayerMP;
  11096. import net.minecraft.init.Blocks;
  11097. import net.minecraft.init.SoundEvents;
  11098. import net.minecraft.inventory.EntityEquipmentSlot;
  11099. import net.minecraft.item.Item;
  11100. import net.minecraft.item.ItemStack;
  11101. import net.minecraft.nbt.NBTTagCompound;
  11102. import net.minecraft.nbt.NBTTagDouble;
  11103. import net.minecraft.nbt.NBTTagFloat;
  11104. import net.minecraft.nbt.NBTTagList;
  11105. import net.minecraft.nbt.NBTTagString;
  11106. import net.minecraft.network.datasync.DataParameter;
  11107. import net.minecraft.network.datasync.DataSerializers;
  11108. import net.minecraft.network.datasync.EntityDataManager;
  11109. import net.minecraft.scoreboard.ScorePlayerTeam;
  11110. import net.minecraft.scoreboard.Team;
  11111. import net.minecraft.server.MinecraftServer;
  11112. import net.minecraft.util.DamageSource;
  11113. import net.minecraft.util.EnumActionResult;
  11114. import net.minecraft.util.EnumBlockRenderType;
  11115. import net.minecraft.util.EnumFacing;
  11116. import net.minecraft.util.EnumHand;
  11117. import net.minecraft.util.EnumParticleTypes;
  11118. import net.minecraft.util.Mirror;
  11119. import net.minecraft.util.ReportedException;
  11120. import net.minecraft.util.ResourceLocation;
  11121. import net.minecraft.util.Rotation;
  11122. import net.minecraft.util.SoundCategory;
  11123. import net.minecraft.util.SoundEvent;
  11124. import net.minecraft.util.datafix.DataFixer;
  11125. import net.minecraft.util.datafix.FixTypes;
  11126. import net.minecraft.util.datafix.IDataFixer;
  11127. import net.minecraft.util.datafix.IDataWalker;
  11128. import net.minecraft.util.math.AxisAlignedBB;
  11129. import net.minecraft.util.math.BlockPos;
  11130. import net.minecraft.util.math.MathHelper;
  11131. import net.minecraft.util.math.RayTraceResult;
  11132. import net.minecraft.util.math.Vec2f;
  11133. import net.minecraft.util.math.Vec3d;
  11134. import net.minecraft.util.text.ITextComponent;
  11135. import net.minecraft.util.text.TextComponentString;
  11136. import net.minecraft.util.text.event.HoverEvent;
  11137. import net.minecraft.util.text.translation.I18n;
  11138. import net.minecraft.world.Explosion;
  11139. import net.minecraft.world.Teleporter;
  11140. import net.minecraft.world.World;
  11141. import net.minecraft.world.WorldServer;
  11142. import net.minecraftforge.fml.relauncher.Side;
  11143. import net.minecraftforge.fml.relauncher.SideOnly;
  11144. import org.apache.logging.log4j.LogManager;
  11145. import org.apache.logging.log4j.Logger;
  11146.  
  11147. public abstract class Entity implements ICommandSender {
  11148. private static final Logger field_184243_a = LogManager.getLogger();
  11149. private static final List<ItemStack> field_190535_b = Collections.<ItemStack>emptyList();
  11150. private static final AxisAlignedBB field_174836_a = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
  11151. private static double field_70155_l = 1.0D;
  11152. private static int field_70152_a;
  11153. private int field_145783_c;
  11154. public boolean field_70156_m;
  11155. private final List<Entity> field_184244_h;
  11156. protected int field_184245_j;
  11157. private Entity field_184239_as;
  11158. public boolean field_98038_p;
  11159. public World field_70170_p;
  11160. public double field_70169_q;
  11161. public double field_70167_r;
  11162. public double field_70166_s;
  11163. public double field_70165_t;
  11164. public double field_70163_u;
  11165. public double field_70161_v;
  11166. public double field_70159_w;
  11167. public double field_70181_x;
  11168. public double field_70179_y;
  11169. public float field_70177_z;
  11170. public float field_70125_A;
  11171. public float field_70126_B;
  11172. public float field_70127_C;
  11173. private AxisAlignedBB field_70121_D;
  11174. public boolean field_70122_E;
  11175. public boolean field_70123_F;
  11176. public boolean field_70124_G;
  11177. public boolean field_70132_H;
  11178. public boolean field_70133_I;
  11179. protected boolean field_70134_J;
  11180. private boolean field_174835_g;
  11181. public boolean field_70128_L;
  11182. public float field_70130_N;
  11183. public float field_70131_O;
  11184. public float field_70141_P;
  11185. public float field_70140_Q;
  11186. public float field_82151_R;
  11187. public float field_70143_R;
  11188. private int field_70150_b;
  11189. private float field_191959_ay;
  11190. public double field_70142_S;
  11191. public double field_70137_T;
  11192. public double field_70136_U;
  11193. public float field_70138_W;
  11194. public boolean field_70145_X;
  11195. public float field_70144_Y;
  11196. protected Random field_70146_Z;
  11197. public int field_70173_aa;
  11198. private int field_190534_ay;
  11199. protected boolean field_70171_ac;
  11200. public int field_70172_ad;
  11201. protected boolean field_70148_d;
  11202. protected boolean field_70178_ae;
  11203. protected EntityDataManager field_70180_af;
  11204. protected static final DataParameter<Byte> field_184240_ax = EntityDataManager.<Byte>func_187226_a(Entity.class, DataSerializers.field_187191_a);
  11205. private static final DataParameter<Integer> field_184241_ay = EntityDataManager.<Integer>func_187226_a(Entity.class, DataSerializers.field_187192_b);
  11206. private static final DataParameter<String> field_184242_az = EntityDataManager.<String>func_187226_a(Entity.class, DataSerializers.field_187194_d);
  11207. private static final DataParameter<Boolean> field_184233_aA = EntityDataManager.<Boolean>func_187226_a(Entity.class, DataSerializers.field_187198_h);
  11208. private static final DataParameter<Boolean> field_184234_aB = EntityDataManager.<Boolean>func_187226_a(Entity.class, DataSerializers.field_187198_h);
  11209. private static final DataParameter<Boolean> field_189655_aD = EntityDataManager.<Boolean>func_187226_a(Entity.class, DataSerializers.field_187198_h);
  11210. public boolean field_70175_ag;
  11211. public int field_70176_ah;
  11212. public int field_70162_ai;
  11213. public int field_70164_aj;
  11214. @SideOnly(Side.CLIENT)
  11215. public long field_70118_ct;
  11216. @SideOnly(Side.CLIENT)
  11217. public long field_70117_cu;
  11218. @SideOnly(Side.CLIENT)
  11219. public long field_70116_cv;
  11220. public boolean field_70158_ak;
  11221. public boolean field_70160_al;
  11222. public int field_71088_bW;
  11223. protected boolean field_71087_bX;
  11224. protected int field_82153_h;
  11225. public int field_71093_bK;
  11226. protected BlockPos field_181016_an;
  11227. protected Vec3d field_181017_ao;
  11228. protected EnumFacing field_181018_ap;
  11229. private boolean field_83001_bt;
  11230. protected UUID field_96093_i;
  11231. protected String field_189513_ar;
  11232. private final CommandResultStats field_174837_as;
  11233. protected boolean field_184238_ar;
  11234. private final Set<String> field_184236_aF;
  11235. private boolean field_184237_aG;
  11236. private final double[] field_191505_aI;
  11237. private long field_191506_aJ;
  11238.  
  11239. public Entity(World p_i1582_1_) {
  11240. this.field_145783_c = field_70152_a++;
  11241. this.field_184244_h = Lists.<Entity>newArrayList();
  11242. this.field_70121_D = field_174836_a;
  11243. this.field_70130_N = 0.6F;
  11244. this.field_70131_O = 1.8F;
  11245. this.field_70150_b = 1;
  11246. this.field_191959_ay = 1.0F;
  11247. this.field_70146_Z = new Random();
  11248. this.field_190534_ay = -this.func_190531_bD();
  11249. this.field_70148_d = true;
  11250. this.field_96093_i = MathHelper.func_180182_a(this.field_70146_Z);
  11251. this.field_189513_ar = this.field_96093_i.toString();
  11252. this.field_174837_as = new CommandResultStats();
  11253. this.field_184236_aF = Sets.<String>newHashSet();
  11254. this.field_191505_aI = new double[]{0.0D, 0.0D, 0.0D};
  11255. this.field_70170_p = p_i1582_1_;
  11256. this.func_70107_b(0.0D, 0.0D, 0.0D);
  11257. if(p_i1582_1_ != null) {
  11258. this.field_71093_bK = p_i1582_1_.field_73011_w.func_186058_p().func_186068_a();
  11259. }
  11260.  
  11261. this.field_70180_af = new EntityDataManager(this);
  11262. this.field_70180_af.func_187214_a(field_184240_ax, Byte.valueOf((byte)0));
  11263. this.field_70180_af.func_187214_a(field_184241_ay, Integer.valueOf(300));
  11264. this.field_70180_af.func_187214_a(field_184233_aA, Boolean.valueOf(false));
  11265. this.field_70180_af.func_187214_a(field_184242_az, "");
  11266. this.field_70180_af.func_187214_a(field_184234_aB, Boolean.valueOf(false));
  11267. this.field_70180_af.func_187214_a(field_189655_aD, Boolean.valueOf(false));
  11268. this.func_70088_a();
  11269. }
  11270.  
  11271. public int func_145782_y() {
  11272. return this.field_145783_c;
  11273. }
  11274.  
  11275. public void func_145769_d(int p_145769_1_) {
  11276. this.field_145783_c = p_145769_1_;
  11277. }
  11278.  
  11279. public Set<String> func_184216_O() {
  11280. return this.field_184236_aF;
  11281. }
  11282.  
  11283. public boolean func_184211_a(String p_184211_1_) {
  11284. if(this.field_184236_aF.size() >= 1024) {
  11285. return false;
  11286. } else {
  11287. this.field_184236_aF.add(p_184211_1_);
  11288. return true;
  11289. }
  11290. }
  11291.  
  11292. public boolean func_184197_b(String p_184197_1_) {
  11293. return this.field_184236_aF.remove(p_184197_1_);
  11294. }
  11295.  
  11296. public void func_174812_G() {
  11297. this.func_70106_y();
  11298. }
  11299.  
  11300. protected abstract void func_70088_a();
  11301.  
  11302. public EntityDataManager func_184212_Q() {
  11303. return this.field_70180_af;
  11304. }
  11305.  
  11306. public boolean equals(Object p_equals_1_) {
  11307. return p_equals_1_ instanceof Entity?((Entity)p_equals_1_).field_145783_c == this.field_145783_c:false;
  11308. }
  11309.  
  11310. public int hashCode() {
  11311. return this.field_145783_c;
  11312. }
  11313.  
  11314. @SideOnly(Side.CLIENT)
  11315. protected void func_70065_x() {
  11316. if(this.field_70170_p != null) {
  11317. while(this.field_70163_u > 0.0D && this.field_70163_u < 256.0D) {
  11318. this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v);
  11319. if(this.field_70170_p.func_184144_a(this, this.func_174813_aQ()).isEmpty()) {
  11320. break;
  11321. }
  11322.  
  11323. ++this.field_70163_u;
  11324. }
  11325.  
  11326. this.field_70159_w = 0.0D;
  11327. this.field_70181_x = 0.0D;
  11328. this.field_70179_y = 0.0D;
  11329. this.field_70125_A = 0.0F;
  11330. }
  11331. }
  11332.  
  11333. public void func_70106_y() {
  11334. this.field_70128_L = true;
  11335. }
  11336.  
  11337. public void func_184174_b(boolean p_184174_1_) {
  11338. }
  11339.  
  11340. protected void func_70105_a(float p_70105_1_, float p_70105_2_) {
  11341. if(p_70105_1_ != this.field_70130_N || p_70105_2_ != this.field_70131_O) {
  11342. float f = this.field_70130_N;
  11343. this.field_70130_N = p_70105_1_;
  11344. this.field_70131_O = p_70105_2_;
  11345. if(this.field_70130_N < f) {
  11346. double d0 = (double)p_70105_1_ / 2.0D;
  11347. this.func_174826_a(new AxisAlignedBB(this.field_70165_t - d0, this.field_70163_u, this.field_70161_v - d0, this.field_70165_t + d0, this.field_70163_u + (double)this.field_70131_O, this.field_70161_v + d0));
  11348. return;
  11349. }
  11350.  
  11351. AxisAlignedBB axisalignedbb = this.func_174813_aQ();
  11352. this.func_174826_a(new AxisAlignedBB(axisalignedbb.field_72340_a, axisalignedbb.field_72338_b, axisalignedbb.field_72339_c, axisalignedbb.field_72340_a + (double)this.field_70130_N, axisalignedbb.field_72338_b + (double)this.field_70131_O, axisalignedbb.field_72339_c + (double)this.field_70130_N));
  11353. if(this.field_70130_N > f && !this.field_70148_d && !this.field_70170_p.field_72995_K) {
  11354. this.func_70091_d(MoverType.SELF, (double)(f - this.field_70130_N), 0.0D, (double)(f - this.field_70130_N));
  11355. }
  11356. }
  11357.  
  11358. }
  11359.  
  11360. protected void func_70101_b(float p_70101_1_, float p_70101_2_) {
  11361. this.field_70177_z = p_70101_1_ % 360.0F;
  11362. this.field_70125_A = p_70101_2_ % 360.0F;
  11363. }
  11364.  
  11365. public void func_70107_b(double p_70107_1_, double p_70107_3_, double p_70107_5_) {
  11366. this.field_70165_t = p_70107_1_;
  11367. this.field_70163_u = p_70107_3_;
  11368. this.field_70161_v = p_70107_5_;
  11369. float f = this.field_70130_N / 2.0F;
  11370. float f1 = this.field_70131_O;
  11371. this.func_174826_a(new AxisAlignedBB(p_70107_1_ - (double)f, p_70107_3_, p_70107_5_ - (double)f, p_70107_1_ + (double)f, p_70107_3_ + (double)f1, p_70107_5_ + (double)f));
  11372. }
  11373.  
  11374. @SideOnly(Side.CLIENT)
  11375. public void func_70082_c(float p_70082_1_, float p_70082_2_) {
  11376. float f = this.field_70125_A;
  11377. float f1 = this.field_70177_z;
  11378. this.field_70177_z = (float)((double)this.field_70177_z + (double)p_70082_1_ * 0.15D);
  11379. this.field_70125_A = (float)((double)this.field_70125_A - (double)p_70082_2_ * 0.15D);
  11380. this.field_70125_A = MathHelper.func_76131_a(this.field_70125_A, -90.0F, 90.0F);
  11381. this.field_70127_C += this.field_70125_A - f;
  11382. this.field_70126_B += this.field_70177_z - f1;
  11383. if(this.field_184239_as != null) {
  11384. this.field_184239_as.func_184190_l(this);
  11385. }
  11386.  
  11387. }
  11388.  
  11389. public void func_70071_h_() {
  11390. if(!this.field_70170_p.field_72995_K) {
  11391. this.func_70052_a(6, this.func_184202_aL());
  11392. }
  11393.  
  11394. this.func_70030_z();
  11395. }
  11396.  
  11397. public void func_70030_z() {
  11398. this.field_70170_p.field_72984_F.func_76320_a("entityBaseTick");
  11399. if(this.func_184218_aH() && this.func_184187_bx().field_70128_L) {
  11400. this.func_184210_p();
  11401. }
  11402.  
  11403. if(this.field_184245_j > 0) {
  11404. --this.field_184245_j;
  11405. }
  11406.  
  11407. this.field_70141_P = this.field_70140_Q;
  11408. this.field_70169_q = this.field_70165_t;
  11409. this.field_70167_r = this.field_70163_u;
  11410. this.field_70166_s = this.field_70161_v;
  11411. this.field_70127_C = this.field_70125_A;
  11412. this.field_70126_B = this.field_70177_z;
  11413. if(!this.field_70170_p.field_72995_K && this.field_70170_p instanceof WorldServer) {
  11414. this.field_70170_p.field_72984_F.func_76320_a("portal");
  11415. if(this.field_71087_bX) {
  11416. MinecraftServer minecraftserver = this.field_70170_p.func_73046_m();
  11417. if(minecraftserver.func_71255_r()) {
  11418. if(!this.func_184218_aH()) {
  11419. int i = this.func_82145_z();
  11420. if(this.field_82153_h++ >= i) {
  11421. this.field_82153_h = i;
  11422. this.field_71088_bW = this.func_82147_ab();
  11423. int j;
  11424. if(this.field_70170_p.field_73011_w.func_186058_p().func_186068_a() == -1) {
  11425. j = 0;
  11426. } else {
  11427. j = -1;
  11428. }
  11429.  
  11430. this.func_184204_a(j);
  11431. }
  11432. }
  11433.  
  11434. this.field_71087_bX = false;
  11435. }
  11436. } else {
  11437. if(this.field_82153_h > 0) {
  11438. this.field_82153_h -= 4;
  11439. }
  11440.  
  11441. if(this.field_82153_h < 0) {
  11442. this.field_82153_h = 0;
  11443. }
  11444. }
  11445.  
  11446. this.func_184173_H();
  11447. this.field_70170_p.field_72984_F.func_76319_b();
  11448. }
  11449.  
  11450. this.func_174830_Y();
  11451. this.func_70072_I();
  11452. if(this.field_70170_p.field_72995_K) {
  11453. this.func_70066_B();
  11454. } else if(this.field_190534_ay > 0) {
  11455. if(this.field_70178_ae) {
  11456. this.field_190534_ay -= 4;
  11457. if(this.field_190534_ay < 0) {
  11458. this.func_70066_B();
  11459. }
  11460. } else {
  11461. if(this.field_190534_ay % 20 == 0) {
  11462. this.func_70097_a(DamageSource.field_76370_b, 1.0F);
  11463. }
  11464.  
  11465. --this.field_190534_ay;
  11466. }
  11467. }
  11468.  
  11469. if(this.func_180799_ab()) {
  11470. this.func_70044_A();
  11471. this.field_70143_R *= 0.5F;
  11472. }
  11473.  
  11474. if(this.field_70163_u < -64.0D) {
  11475. this.func_70076_C();
  11476. }
  11477.  
  11478. if(!this.field_70170_p.field_72995_K) {
  11479. this.func_70052_a(0, this.field_190534_ay > 0);
  11480. }
  11481.  
  11482. this.field_70148_d = false;
  11483. this.field_70170_p.field_72984_F.func_76319_b();
  11484. }
  11485.  
  11486. protected void func_184173_H() {
  11487. if(this.field_71088_bW > 0) {
  11488. --this.field_71088_bW;
  11489. }
  11490.  
  11491. }
  11492.  
  11493. public int func_82145_z() {
  11494. return 1;
  11495. }
  11496.  
  11497. protected void func_70044_A() {
  11498. if(!this.field_70178_ae) {
  11499. this.func_70097_a(DamageSource.field_76371_c, 4.0F);
  11500. this.func_70015_d(15);
  11501. }
  11502. }
  11503.  
  11504. public void func_70015_d(int p_70015_1_) {
  11505. int i = p_70015_1_ * 20;
  11506. if(this instanceof EntityLivingBase) {
  11507. i = EnchantmentProtection.func_92093_a((EntityLivingBase)this, i);
  11508. }
  11509.  
  11510. if(this.field_190534_ay < i) {
  11511. this.field_190534_ay = i;
  11512. }
  11513.  
  11514. }
  11515.  
  11516. public void func_70066_B() {
  11517. this.field_190534_ay = 0;
  11518. }
  11519.  
  11520. protected void func_70076_C() {
  11521. this.func_70106_y();
  11522. }
  11523.  
  11524. public boolean func_70038_c(double p_70038_1_, double p_70038_3_, double p_70038_5_) {
  11525. AxisAlignedBB axisalignedbb = this.func_174813_aQ().func_72317_d(p_70038_1_, p_70038_3_, p_70038_5_);
  11526. return this.func_174809_b(axisalignedbb);
  11527. }
  11528.  
  11529. private boolean func_174809_b(AxisAlignedBB p_174809_1_) {
  11530. return this.field_70170_p.func_184144_a(this, p_174809_1_).isEmpty() && !this.field_70170_p.func_72953_d(p_174809_1_);
  11531. }
  11532.  
  11533. public void func_70091_d(MoverType p_70091_1_, double p_70091_2_, double p_70091_4_, double p_70091_6_) {
  11534. if(this.field_70145_X) {
  11535. this.func_174826_a(this.func_174813_aQ().func_72317_d(p_70091_2_, p_70091_4_, p_70091_6_));
  11536. this.func_174829_m();
  11537. } else {
  11538. if(p_70091_1_ == MoverType.PISTON) {
  11539. long i = this.field_70170_p.func_82737_E();
  11540. if(i != this.field_191506_aJ) {
  11541. Arrays.fill(this.field_191505_aI, 0.0D);
  11542. this.field_191506_aJ = i;
  11543. }
  11544.  
  11545. if(p_70091_2_ != 0.0D) {
  11546. int j = EnumFacing.Axis.X.ordinal();
  11547. double d0 = MathHelper.func_151237_a(p_70091_2_ + this.field_191505_aI[j], -0.51D, 0.51D);
  11548. p_70091_2_ = d0 - this.field_191505_aI[j];
  11549. this.field_191505_aI[j] = d0;
  11550. if(Math.abs(p_70091_2_) <= 9.999999747378752E-6D) {
  11551. return;
  11552. }
  11553. } else if(p_70091_4_ != 0.0D) {
  11554. int l4 = EnumFacing.Axis.Y.ordinal();
  11555. double d12 = MathHelper.func_151237_a(p_70091_4_ + this.field_191505_aI[l4], -0.51D, 0.51D);
  11556. p_70091_4_ = d12 - this.field_191505_aI[l4];
  11557. this.field_191505_aI[l4] = d12;
  11558. if(Math.abs(p_70091_4_) <= 9.999999747378752E-6D) {
  11559. return;
  11560. }
  11561. } else {
  11562. if(p_70091_6_ == 0.0D) {
  11563. return;
  11564. }
  11565.  
  11566. int i5 = EnumFacing.Axis.Z.ordinal();
  11567. double d13 = MathHelper.func_151237_a(p_70091_6_ + this.field_191505_aI[i5], -0.51D, 0.51D);
  11568. p_70091_6_ = d13 - this.field_191505_aI[i5];
  11569. this.field_191505_aI[i5] = d13;
  11570. if(Math.abs(p_70091_6_) <= 9.999999747378752E-6D) {
  11571. return;
  11572. }
  11573. }
  11574. }
  11575.  
  11576. this.field_70170_p.field_72984_F.func_76320_a("move");
  11577. double d10 = this.field_70165_t;
  11578. double d11 = this.field_70163_u;
  11579. double d1 = this.field_70161_v;
  11580. if(this.field_70134_J) {
  11581. this.field_70134_J = false;
  11582. p_70091_2_ *= 0.25D;
  11583. p_70091_4_ *= 0.05000000074505806D;
  11584. p_70091_6_ *= 0.25D;
  11585. this.field_70159_w = 0.0D;
  11586. this.field_70181_x = 0.0D;
  11587. this.field_70179_y = 0.0D;
  11588. }
  11589.  
  11590. double d2 = p_70091_2_;
  11591. double d3 = p_70091_4_;
  11592. double d4 = p_70091_6_;
  11593. if((p_70091_1_ == MoverType.SELF || p_70091_1_ == MoverType.PLAYER) && this.field_70122_E && this.func_70093_af() && this instanceof EntityPlayer) {
  11594. for(double d5 = 0.05D; p_70091_2_ != 0.0D && this.field_70170_p.func_184144_a(this, this.func_174813_aQ().func_72317_d(p_70091_2_, (double)(-this.field_70138_W), 0.0D)).isEmpty(); d2 = p_70091_2_) {
  11595. if(p_70091_2_ < 0.05D && p_70091_2_ >= -0.05D) {
  11596. p_70091_2_ = 0.0D;
  11597. } else if(p_70091_2_ > 0.0D) {
  11598. p_70091_2_ -= 0.05D;
  11599. } else {
  11600. p_70091_2_ += 0.05D;
  11601. }
  11602. }
  11603.  
  11604. for(; p_70091_6_ != 0.0D && this.field_70170_p.func_184144_a(this, this.func_174813_aQ().func_72317_d(0.0D, (double)(-this.field_70138_W), p_70091_6_)).isEmpty(); d4 = p_70091_6_) {
  11605. if(p_70091_6_ < 0.05D && p_70091_6_ >= -0.05D) {
  11606. p_70091_6_ = 0.0D;
  11607. } else if(p_70091_6_ > 0.0D) {
  11608. p_70091_6_ -= 0.05D;
  11609. } else {
  11610. p_70091_6_ += 0.05D;
  11611. }
  11612. }
  11613.  
  11614. for(; p_70091_2_ != 0.0D && p_70091_6_ != 0.0D && this.field_70170_p.func_184144_a(this, this.func_174813_aQ().func_72317_d(p_70091_2_, (double)(-this.field_70138_W), p_70091_6_)).isEmpty(); d4 = p_70091_6_) {
  11615. if(p_70091_2_ < 0.05D && p_70091_2_ >= -0.05D) {
  11616. p_70091_2_ = 0.0D;
  11617. } else if(p_70091_2_ > 0.0D) {
  11618. p_70091_2_ -= 0.05D;
  11619. } else {
  11620. p_70091_2_ += 0.05D;
  11621. }
  11622.  
  11623. d2 = p_70091_2_;
  11624. if(p_70091_6_ < 0.05D && p_70091_6_ >= -0.05D) {
  11625. p_70091_6_ = 0.0D;
  11626. } else if(p_70091_6_ > 0.0D) {
  11627. p_70091_6_ -= 0.05D;
  11628. } else {
  11629. p_70091_6_ += 0.05D;
  11630. }
  11631. }
  11632. }
  11633.  
  11634. List<AxisAlignedBB> list1 = this.field_70170_p.func_184144_a(this, this.func_174813_aQ().func_72321_a(p_70091_2_, p_70091_4_, p_70091_6_));
  11635. AxisAlignedBB axisalignedbb = this.func_174813_aQ();
  11636. if(p_70091_4_ != 0.0D) {
  11637. int k = 0;
  11638.  
  11639. for(int l = list1.size(); k < l; ++k) {
  11640. p_70091_4_ = ((AxisAlignedBB)list1.get(k)).func_72323_b(this.func_174813_aQ(), p_70091_4_);
  11641. }
  11642.  
  11643. this.func_174826_a(this.func_174813_aQ().func_72317_d(0.0D, p_70091_4_, 0.0D));
  11644. }
  11645.  
  11646. if(p_70091_2_ != 0.0D) {
  11647. int j5 = 0;
  11648.  
  11649. for(int l5 = list1.size(); j5 < l5; ++j5) {
  11650. p_70091_2_ = ((AxisAlignedBB)list1.get(j5)).func_72316_a(this.func_174813_aQ(), p_70091_2_);
  11651. }
  11652.  
  11653. if(p_70091_2_ != 0.0D) {
  11654. this.func_174826_a(this.func_174813_aQ().func_72317_d(p_70091_2_, 0.0D, 0.0D));
  11655. }
  11656. }
  11657.  
  11658. if(p_70091_6_ != 0.0D) {
  11659. int k5 = 0;
  11660.  
  11661. for(int i6 = list1.size(); k5 < i6; ++k5) {
  11662. p_70091_6_ = ((AxisAlignedBB)list1.get(k5)).func_72322_c(this.func_174813_aQ(), p_70091_6_);
  11663. }
  11664.  
  11665. if(p_70091_6_ != 0.0D) {
  11666. this.func_174826_a(this.func_174813_aQ().func_72317_d(0.0D, 0.0D, p_70091_6_));
  11667. }
  11668. }
  11669.  
  11670. boolean flag = this.field_70122_E || p_70091_4_ != p_70091_4_ && p_70091_4_ < 0.0D;
  11671. if(this.field_70138_W > 0.0F && flag && (d2 != p_70091_2_ || d4 != p_70091_6_)) {
  11672. double d14 = p_70091_2_;
  11673. double d6 = p_70091_4_;
  11674. double d7 = p_70091_6_;
  11675. AxisAlignedBB axisalignedbb1 = this.func_174813_aQ();
  11676. this.func_174826_a(axisalignedbb);
  11677. p_70091_4_ = (double)this.field_70138_W;
  11678. List<AxisAlignedBB> list = this.field_70170_p.func_184144_a(this, this.func_174813_aQ().func_72321_a(d2, p_70091_4_, d4));
  11679. AxisAlignedBB axisalignedbb2 = this.func_174813_aQ();
  11680. AxisAlignedBB axisalignedbb3 = axisalignedbb2.func_72321_a(d2, 0.0D, d4);
  11681. double d8 = p_70091_4_;
  11682. int j1 = 0;
  11683.  
  11684. for(int k1 = list.size(); j1 < k1; ++j1) {
  11685. d8 = ((AxisAlignedBB)list.get(j1)).func_72323_b(axisalignedbb3, d8);
  11686. }
  11687.  
  11688. axisalignedbb2 = axisalignedbb2.func_72317_d(0.0D, d8, 0.0D);
  11689. double d18 = d2;
  11690. int l1 = 0;
  11691.  
  11692. for(int i2 = list.size(); l1 < i2; ++l1) {
  11693. d18 = ((AxisAlignedBB)list.get(l1)).func_72316_a(axisalignedbb2, d18);
  11694. }
  11695.  
  11696. axisalignedbb2 = axisalignedbb2.func_72317_d(d18, 0.0D, 0.0D);
  11697. double d19 = d4;
  11698. int j2 = 0;
  11699.  
  11700. for(int k2 = list.size(); j2 < k2; ++j2) {
  11701. d19 = ((AxisAlignedBB)list.get(j2)).func_72322_c(axisalignedbb2, d19);
  11702. }
  11703.  
  11704. axisalignedbb2 = axisalignedbb2.func_72317_d(0.0D, 0.0D, d19);
  11705. AxisAlignedBB axisalignedbb4 = this.func_174813_aQ();
  11706. double d20 = p_70091_4_;
  11707. int l2 = 0;
  11708.  
  11709. for(int i3 = list.size(); l2 < i3; ++l2) {
  11710. d20 = ((AxisAlignedBB)list.get(l2)).func_72323_b(axisalignedbb4, d20);
  11711. }
  11712.  
  11713. axisalignedbb4 = axisalignedbb4.func_72317_d(0.0D, d20, 0.0D);
  11714. double d21 = d2;
  11715. int j3 = 0;
  11716.  
  11717. for(int k3 = list.size(); j3 < k3; ++j3) {
  11718. d21 = ((AxisAlignedBB)list.get(j3)).func_72316_a(axisalignedbb4, d21);
  11719. }
  11720.  
  11721. axisalignedbb4 = axisalignedbb4.func_72317_d(d21, 0.0D, 0.0D);
  11722. double d22 = d4;
  11723. int l3 = 0;
  11724.  
  11725. for(int i4 = list.size(); l3 < i4; ++l3) {
  11726. d22 = ((AxisAlignedBB)list.get(l3)).func_72322_c(axisalignedbb4, d22);
  11727. }
  11728.  
  11729. axisalignedbb4 = axisalignedbb4.func_72317_d(0.0D, 0.0D, d22);
  11730. double d23 = d18 * d18 + d19 * d19;
  11731. double d9 = d21 * d21 + d22 * d22;
  11732. if(d23 > d9) {
  11733. p_70091_2_ = d18;
  11734. p_70091_6_ = d19;
  11735. p_70091_4_ = -d8;
  11736. this.func_174826_a(axisalignedbb2);
  11737. } else {
  11738. p_70091_2_ = d21;
  11739. p_70091_6_ = d22;
  11740. p_70091_4_ = -d20;
  11741. this.func_174826_a(axisalignedbb4);
  11742. }
  11743.  
  11744. int j4 = 0;
  11745.  
  11746. for(int k4 = list.size(); j4 < k4; ++j4) {
  11747. p_70091_4_ = ((AxisAlignedBB)list.get(j4)).func_72323_b(this.func_174813_aQ(), p_70091_4_);
  11748. }
  11749.  
  11750. this.func_174826_a(this.func_174813_aQ().func_72317_d(0.0D, p_70091_4_, 0.0D));
  11751. if(d14 * d14 + d7 * d7 >= p_70091_2_ * p_70091_2_ + p_70091_6_ * p_70091_6_) {
  11752. p_70091_2_ = d14;
  11753. p_70091_4_ = d6;
  11754. p_70091_6_ = d7;
  11755. this.func_174826_a(axisalignedbb1);
  11756. }
  11757. }
  11758.  
  11759. this.field_70170_p.field_72984_F.func_76319_b();
  11760. this.field_70170_p.field_72984_F.func_76320_a("rest");
  11761. this.func_174829_m();
  11762. this.field_70123_F = d2 != p_70091_2_ || d4 != p_70091_6_;
  11763. this.field_70124_G = p_70091_4_ != p_70091_4_;
  11764. this.field_70122_E = this.field_70124_G && d3 < 0.0D;
  11765. this.field_70132_H = this.field_70123_F || this.field_70124_G;
  11766. int j6 = MathHelper.func_76128_c(this.field_70165_t);
  11767. int i1 = MathHelper.func_76128_c(this.field_70163_u - 0.20000000298023224D);
  11768. int k6 = MathHelper.func_76128_c(this.field_70161_v);
  11769. BlockPos blockpos = new BlockPos(j6, i1, k6);
  11770. IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos);
  11771. if(iblockstate.func_185904_a() == Material.field_151579_a) {
  11772. BlockPos blockpos1 = blockpos.func_177977_b();
  11773. IBlockState iblockstate1 = this.field_70170_p.func_180495_p(blockpos1);
  11774. Block block1 = iblockstate1.func_177230_c();
  11775. if(block1 instanceof BlockFence || block1 instanceof BlockWall || block1 instanceof BlockFenceGate) {
  11776. iblockstate = iblockstate1;
  11777. blockpos = blockpos1;
  11778. }
  11779. }
  11780.  
  11781. this.func_184231_a(p_70091_4_, this.field_70122_E, iblockstate, blockpos);
  11782. if(d2 != p_70091_2_) {
  11783. this.field_70159_w = 0.0D;
  11784. }
  11785.  
  11786. if(d4 != p_70091_6_) {
  11787. this.field_70179_y = 0.0D;
  11788. }
  11789.  
  11790. Block block = iblockstate.func_177230_c();
  11791. if(d3 != p_70091_4_) {
  11792. block.func_176216_a(this.field_70170_p, this);
  11793. }
  11794.  
  11795. if(this.func_70041_e_() && (!this.field_70122_E || !this.func_70093_af() || !(this instanceof EntityPlayer)) && !this.func_184218_aH()) {
  11796. double d15 = this.field_70165_t - d10;
  11797. double d16 = this.field_70163_u - d11;
  11798. double d17 = this.field_70161_v - d1;
  11799. if(block != Blocks.field_150468_ap) {
  11800. d16 = 0.0D;
  11801. }
  11802.  
  11803. if(block != null && this.field_70122_E) {
  11804. block.func_176199_a(this.field_70170_p, blockpos, this);
  11805. }
  11806.  
  11807. this.field_70140_Q = (float)((double)this.field_70140_Q + (double)MathHelper.func_76133_a(d15 * d15 + d17 * d17) * 0.6D);
  11808. this.field_82151_R = (float)((double)this.field_82151_R + (double)MathHelper.func_76133_a(d15 * d15 + d16 * d16 + d17 * d17) * 0.6D);
  11809. if(this.field_82151_R > (float)this.field_70150_b && iblockstate.func_185904_a() != Material.field_151579_a) {
  11810. this.field_70150_b = (int)this.field_82151_R + 1;
  11811. if(this.func_70090_H()) {
  11812. Entity entity = this.func_184207_aI() && this.func_184179_bs() != null?this.func_184179_bs():this;
  11813. float f = entity == this?0.35F:0.4F;
  11814. float f1 = MathHelper.func_76133_a(entity.field_70159_w * entity.field_70159_w * 0.20000000298023224D + entity.field_70181_x * entity.field_70181_x + entity.field_70179_y * entity.field_70179_y * 0.20000000298023224D) * f;
  11815. if(f1 > 1.0F) {
  11816. f1 = 1.0F;
  11817. }
  11818.  
  11819. this.func_184185_a(this.func_184184_Z(), f1, 1.0F + (this.field_70146_Z.nextFloat() - this.field_70146_Z.nextFloat()) * 0.4F);
  11820. } else {
  11821. this.func_180429_a(blockpos, block);
  11822. }
  11823. } else if(this.field_82151_R > this.field_191959_ay && this.func_191957_ae() && iblockstate.func_185904_a() == Material.field_151579_a) {
  11824. this.field_191959_ay = this.func_191954_d(this.field_82151_R);
  11825. }
  11826. }
  11827.  
  11828. try {
  11829. this.func_145775_I();
  11830. } catch (Throwable throwable) {
  11831. CrashReport crashreport = CrashReport.func_85055_a(throwable, "Checking entity block collision");
  11832. CrashReportCategory crashreportcategory = crashreport.func_85058_a("Entity being checked for collision");
  11833. this.func_85029_a(crashreportcategory);
  11834. throw new ReportedException(crashreport);
  11835. }
  11836.  
  11837. boolean flag1 = this.func_70026_G();
  11838. if(this.field_70170_p.func_147470_e(this.func_174813_aQ().func_186664_h(0.001D))) {
  11839. this.func_70081_e(1);
  11840. if(!flag1) {
  11841. ++this.field_190534_ay;
  11842. if(this.field_190534_ay == 0) {
  11843. this.func_70015_d(8);
  11844. }
  11845. }
  11846. } else if(this.field_190534_ay <= 0) {
  11847. this.field_190534_ay = -this.func_190531_bD();
  11848. }
  11849.  
  11850. if(flag1 && this.func_70027_ad()) {
  11851. this.func_184185_a(SoundEvents.field_187541_bC, 0.7F, 1.6F + (this.field_70146_Z.nextFloat() - this.field_70146_Z.nextFloat()) * 0.4F);
  11852. this.field_190534_ay = -this.func_190531_bD();
  11853. }
  11854.  
  11855. this.field_70170_p.field_72984_F.func_76319_b();
  11856. }
  11857. }
  11858.  
  11859. public void func_174829_m() {
  11860. AxisAlignedBB axisalignedbb = this.func_174813_aQ();
  11861. this.field_70165_t = (axisalignedbb.field_72340_a + axisalignedbb.field_72336_d) / 2.0D;
  11862. this.field_70163_u = axisalignedbb.field_72338_b;
  11863. this.field_70161_v = (axisalignedbb.field_72339_c + axisalignedbb.field_72334_f) / 2.0D;
  11864. }
  11865.  
  11866. protected SoundEvent func_184184_Z() {
  11867. return SoundEvents.field_187549_bG;
  11868. }
  11869.  
  11870. protected SoundEvent func_184181_aa() {
  11871. return SoundEvents.field_187547_bF;
  11872. }
  11873.  
  11874. protected void func_145775_I() {
  11875. AxisAlignedBB axisalignedbb = this.func_174813_aQ();
  11876. BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185345_c(axisalignedbb.field_72340_a + 0.001D, axisalignedbb.field_72338_b + 0.001D, axisalignedbb.field_72339_c + 0.001D);
  11877. BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos1 = BlockPos.PooledMutableBlockPos.func_185345_c(axisalignedbb.field_72336_d - 0.001D, axisalignedbb.field_72337_e - 0.001D, axisalignedbb.field_72334_f - 0.001D);
  11878. BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos2 = BlockPos.PooledMutableBlockPos.func_185346_s();
  11879. if(this.field_70170_p.func_175707_a(blockpos$pooledmutableblockpos, blockpos$pooledmutableblockpos1)) {
  11880. for(int i = blockpos$pooledmutableblockpos.func_177958_n(); i <= blockpos$pooledmutableblockpos1.func_177958_n(); ++i) {
  11881. for(int j = blockpos$pooledmutableblockpos.func_177956_o(); j <= blockpos$pooledmutableblockpos1.func_177956_o(); ++j) {
  11882. for(int k = blockpos$pooledmutableblockpos.func_177952_p(); k <= blockpos$pooledmutableblockpos1.func_177952_p(); ++k) {
  11883. blockpos$pooledmutableblockpos2.func_181079_c(i, j, k);
  11884. IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos$pooledmutableblockpos2);
  11885.  
  11886. try {
  11887. iblockstate.func_177230_c().func_180634_a(this.field_70170_p, blockpos$pooledmutableblockpos2, iblockstate, this);
  11888. this.func_191955_a(iblockstate);
  11889. } catch (Throwable throwable) {
  11890. CrashReport crashreport = CrashReport.func_85055_a(throwable, "Colliding entity with block");
  11891. CrashReportCategory crashreportcategory = crashreport.func_85058_a("Block being collided with");
  11892. CrashReportCategory.func_175750_a(crashreportcategory, blockpos$pooledmutableblockpos2, iblockstate);
  11893. throw new ReportedException(crashreport);
  11894. }
  11895. }
  11896. }
  11897. }
  11898. }
  11899.  
  11900. blockpos$pooledmutableblockpos.func_185344_t();
  11901. blockpos$pooledmutableblockpos1.func_185344_t();
  11902. blockpos$pooledmutableblockpos2.func_185344_t();
  11903. }
  11904.  
  11905. protected void func_191955_a(IBlockState p_191955_1_) {
  11906. }
  11907.  
  11908. protected void func_180429_a(BlockPos p_180429_1_, Block p_180429_2_) {
  11909. SoundType soundtype = p_180429_2_.func_185467_w();
  11910. if(this.field_70170_p.func_180495_p(p_180429_1_.func_177984_a()).func_177230_c() == Blocks.field_150431_aC) {
  11911. soundtype = Blocks.field_150431_aC.func_185467_w();
  11912. this.func_184185_a(soundtype.func_185844_d(), soundtype.func_185843_a() * 0.15F, soundtype.func_185847_b());
  11913. } else if(!p_180429_2_.func_176223_P().func_185904_a().func_76224_d()) {
  11914. this.func_184185_a(soundtype.func_185844_d(), soundtype.func_185843_a() * 0.15F, soundtype.func_185847_b());
  11915. }
  11916.  
  11917. }
  11918.  
  11919. protected float func_191954_d(float p_191954_1_) {
  11920. return 0.0F;
  11921. }
  11922.  
  11923. protected boolean func_191957_ae() {
  11924. return false;
  11925. }
  11926.  
  11927. public void func_184185_a(SoundEvent p_184185_1_, float p_184185_2_, float p_184185_3_) {
  11928. if(!this.func_174814_R()) {
  11929. this.field_70170_p.func_184148_a((EntityPlayer)null, this.field_70165_t, this.field_70163_u, this.field_70161_v, p_184185_1_, this.func_184176_by(), p_184185_2_, p_184185_3_);
  11930. }
  11931.  
  11932. }
  11933.  
  11934. public boolean func_174814_R() {
  11935. return ((Boolean)this.field_70180_af.func_187225_a(field_184234_aB)).booleanValue();
  11936. }
  11937.  
  11938. public void func_174810_b(boolean p_174810_1_) {
  11939. this.field_70180_af.func_187227_b(field_184234_aB, Boolean.valueOf(p_174810_1_));
  11940. }
  11941.  
  11942. public boolean func_189652_ae() {
  11943. return ((Boolean)this.field_70180_af.func_187225_a(field_189655_aD)).booleanValue();
  11944. }
  11945.  
  11946. public void func_189654_d(boolean p_189654_1_) {
  11947. this.field_70180_af.func_187227_b(field_189655_aD, Boolean.valueOf(p_189654_1_));
  11948. }
  11949.  
  11950. protected boolean func_70041_e_() {
  11951. return true;
  11952. }
  11953.  
  11954. protected void func_184231_a(double p_184231_1_, boolean p_184231_3_, IBlockState p_184231_4_, BlockPos p_184231_5_) {
  11955. if(p_184231_3_) {
  11956. if(this.field_70143_R > 0.0F) {
  11957. p_184231_4_.func_177230_c().func_180658_a(this.field_70170_p, p_184231_5_, this, this.field_70143_R);
  11958. }
  11959.  
  11960. this.field_70143_R = 0.0F;
  11961. } else if(p_184231_1_ < 0.0D) {
  11962. this.field_70143_R = (float)((double)this.field_70143_R - p_184231_1_);
  11963. }
  11964.  
  11965. }
  11966.  
  11967. @Nullable
  11968. public AxisAlignedBB func_70046_E() {
  11969. return null;
  11970. }
  11971.  
  11972. protected void func_70081_e(int p_70081_1_) {
  11973. if(!this.field_70178_ae) {
  11974. this.func_70097_a(DamageSource.field_76372_a, (float)p_70081_1_);
  11975. }
  11976.  
  11977. }
  11978.  
  11979. public final boolean func_70045_F() {
  11980. return this.field_70178_ae;
  11981. }
  11982.  
  11983. public void func_180430_e(float p_180430_1_, float p_180430_2_) {
  11984. if(this.func_184207_aI()) {
  11985. for(Entity entity : this.func_184188_bt()) {
  11986. entity.func_180430_e(p_180430_1_, p_180430_2_);
  11987. }
  11988. }
  11989.  
  11990. }
  11991.  
  11992. public boolean func_70026_G() {
  11993. if(this.field_70171_ac) {
  11994. return true;
  11995. } else {
  11996. BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185345_c(this.field_70165_t, this.field_70163_u, this.field_70161_v);
  11997. if(!this.field_70170_p.func_175727_C(blockpos$pooledmutableblockpos) && !this.field_70170_p.func_175727_C(blockpos$pooledmutableblockpos.func_189532_c(this.field_70165_t, this.field_70163_u + (double)this.field_70131_O, this.field_70161_v))) {
  11998. blockpos$pooledmutableblockpos.func_185344_t();
  11999. return false;
  12000. } else {
  12001. blockpos$pooledmutableblockpos.func_185344_t();
  12002. return true;
  12003. }
  12004. }
  12005. }
  12006.  
  12007. public boolean func_70090_H() {
  12008. return this.field_70171_ac;
  12009. }
  12010.  
  12011. public boolean func_191953_am() {
  12012. return this.field_70170_p.func_72918_a(this.func_174813_aQ().func_72314_b(0.0D, -20.0D, 0.0D).func_186664_h(0.001D), Material.field_151586_h, this);
  12013. }
  12014.  
  12015. public boolean func_70072_I() {
  12016. if(this.func_184187_bx() instanceof EntityBoat) {
  12017. this.field_70171_ac = false;
  12018. } else if(this.field_70170_p.func_72918_a(this.func_174813_aQ().func_72314_b(0.0D, -0.4000000059604645D, 0.0D).func_186664_h(0.001D), Material.field_151586_h, this)) {
  12019. if(!this.field_70171_ac && !this.field_70148_d) {
  12020. this.func_71061_d_();
  12021. }
  12022.  
  12023. this.field_70143_R = 0.0F;
  12024. this.field_70171_ac = true;
  12025. this.func_70066_B();
  12026. } else {
  12027. this.field_70171_ac = false;
  12028. }
  12029.  
  12030. return this.field_70171_ac;
  12031. }
  12032.  
  12033. protected void func_71061_d_() {
  12034. Entity entity = this.func_184207_aI() && this.func_184179_bs() != null?this.func_184179_bs():this;
  12035. float f = entity == this?0.2F:0.9F;
  12036. float f1 = MathHelper.func_76133_a(entity.field_70159_w * entity.field_70159_w * 0.20000000298023224D + entity.field_70181_x * entity.field_70181_x + entity.field_70179_y * entity.field_70179_y * 0.20000000298023224D) * f;
  12037. if(f1 > 1.0F) {
  12038. f1 = 1.0F;
  12039. }
  12040.  
  12041. this.func_184185_a(this.func_184181_aa(), f1, 1.0F + (this.field_70146_Z.nextFloat() - this.field_70146_Z.nextFloat()) * 0.4F);
  12042. float f2 = (float)MathHelper.func_76128_c(this.func_174813_aQ().field_72338_b);
  12043.  
  12044. for(int i = 0; (float)i < 1.0F + this.field_70130_N * 20.0F; ++i) {
  12045. float f3 = (this.field_70146_Z.nextFloat() * 2.0F - 1.0F) * this.field_70130_N;
  12046. float f4 = (this.field_70146_Z.nextFloat() * 2.0F - 1.0F) * this.field_70130_N;
  12047. this.field_70170_p.func_175688_a(EnumParticleTypes.WATER_BUBBLE, this.field_70165_t + (double)f3, (double)(f2 + 1.0F), this.field_70161_v + (double)f4, this.field_70159_w, this.field_70181_x - (double)(this.field_70146_Z.nextFloat() * 0.2F), this.field_70179_y, new int[0]);
  12048. }
  12049.  
  12050. for(int j = 0; (float)j < 1.0F + this.field_70130_N * 20.0F; ++j) {
  12051. float f5 = (this.field_70146_Z.nextFloat() * 2.0F - 1.0F) * this.field_70130_N;
  12052. float f6 = (this.field_70146_Z.nextFloat() * 2.0F - 1.0F) * this.field_70130_N;
  12053. this.field_70170_p.func_175688_a(EnumParticleTypes.WATER_SPLASH, this.field_70165_t + (double)f5, (double)(f2 + 1.0F), this.field_70161_v + (double)f6, this.field_70159_w, this.field_70181_x, this.field_70179_y, new int[0]);
  12054. }
  12055.  
  12056. }
  12057.  
  12058. public void func_174830_Y() {
  12059. if(this.func_70051_ag() && !this.func_70090_H()) {
  12060. this.func_174808_Z();
  12061. }
  12062.  
  12063. }
  12064.  
  12065. protected void func_174808_Z() {
  12066. int i = MathHelper.func_76128_c(this.field_70165_t);
  12067. int j = MathHelper.func_76128_c(this.field_70163_u - 0.20000000298023224D);
  12068. int k = MathHelper.func_76128_c(this.field_70161_v);
  12069. BlockPos blockpos = new BlockPos(i, j, k);
  12070. IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos);
  12071. if(iblockstate.func_185901_i() != EnumBlockRenderType.INVISIBLE) {
  12072. this.field_70170_p.func_175688_a(EnumParticleTypes.BLOCK_CRACK, this.field_70165_t + ((double)this.field_70146_Z.nextFloat() - 0.5D) * (double)this.field_70130_N, this.func_174813_aQ().field_72338_b + 0.1D, this.field_70161_v + ((double)this.field_70146_Z.nextFloat() - 0.5D) * (double)this.field_70130_N, -this.field_70159_w * 4.0D, 1.5D, -this.field_70179_y * 4.0D, new int[]{Block.func_176210_f(iblockstate)});
  12073. }
  12074.  
  12075. }
  12076.  
  12077. public boolean func_70055_a(Material p_70055_1_) {
  12078. if(this.func_184187_bx() instanceof EntityBoat) {
  12079. return false;
  12080. } else {
  12081. double d0 = this.field_70163_u + (double)this.func_70047_e();
  12082. BlockPos blockpos = new BlockPos(this.field_70165_t, d0, this.field_70161_v);
  12083. IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos);
  12084. if(iblockstate.func_185904_a() == p_70055_1_) {
  12085. float f = BlockLiquid.func_149801_b(iblockstate.func_177230_c().func_176201_c(iblockstate)) - 0.11111111F;
  12086. float f1 = (float)(blockpos.func_177956_o() + 1) - f;
  12087. boolean flag = d0 < (double)f1;
  12088. return !flag && this instanceof EntityPlayer?false:flag;
  12089. } else {
  12090. return false;
  12091. }
  12092. }
  12093. }
  12094.  
  12095. public boolean func_180799_ab() {
  12096. return this.field_70170_p.func_72875_a(this.func_174813_aQ().func_72314_b(-0.10000000149011612D, -0.4000000059604645D, -0.10000000149011612D), Material.field_151587_i);
  12097. }
  12098.  
  12099. public void func_191958_b(float p_191958_1_, float p_191958_2_, float p_191958_3_, float p_191958_4_) {
  12100. float f = p_191958_1_ * p_191958_1_ + p_191958_2_ * p_191958_2_ + p_191958_3_ * p_191958_3_;
  12101. if(f >= 1.0E-4F) {
  12102. f = MathHelper.func_76129_c(f);
  12103. if(f < 1.0F) {
  12104. f = 1.0F;
  12105. }
  12106.  
  12107. f = p_191958_4_ / f;
  12108. p_191958_1_ = p_191958_1_ * f;
  12109. p_191958_2_ = p_191958_2_ * f;
  12110. p_191958_3_ = p_191958_3_ * f;
  12111. float f1 = MathHelper.func_76126_a(this.field_70177_z * 0.017453292F);
  12112. float f2 = MathHelper.func_76134_b(this.field_70177_z * 0.017453292F);
  12113. this.field_70159_w += (double)(p_191958_1_ * f2 - p_191958_3_ * f1);
  12114. this.field_70181_x += (double)p_191958_2_;
  12115. this.field_70179_y += (double)(p_191958_3_ * f2 + p_191958_1_ * f1);
  12116. }
  12117. }
  12118.  
  12119. @SideOnly(Side.CLIENT)
  12120. public int func_70070_b() {
  12121. BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(MathHelper.func_76128_c(this.field_70165_t), 0, MathHelper.func_76128_c(this.field_70161_v));
  12122. if(this.field_70170_p.func_175667_e(blockpos$mutableblockpos)) {
  12123. blockpos$mutableblockpos.func_185336_p(MathHelper.func_76128_c(this.field_70163_u + (double)this.func_70047_e()));
  12124. return this.field_70170_p.func_175626_b(blockpos$mutableblockpos, 0);
  12125. } else {
  12126. return 0;
  12127. }
  12128. }
  12129.  
  12130. public float func_70013_c() {
  12131. BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(MathHelper.func_76128_c(this.field_70165_t), 0, MathHelper.func_76128_c(this.field_70161_v));
  12132. if(this.field_70170_p.func_175667_e(blockpos$mutableblockpos)) {
  12133. blockpos$mutableblockpos.func_185336_p(MathHelper.func_76128_c(this.field_70163_u + (double)this.func_70047_e()));
  12134. return this.field_70170_p.func_175724_o(blockpos$mutableblockpos);
  12135. } else {
  12136. return 0.0F;
  12137. }
  12138. }
  12139.  
  12140. public void func_70029_a(World p_70029_1_) {
  12141. this.field_70170_p = p_70029_1_;
  12142. }
  12143.  
  12144. public void func_70080_a(double p_70080_1_, double p_70080_3_, double p_70080_5_, float p_70080_7_, float p_70080_8_) {
  12145. this.field_70165_t = MathHelper.func_151237_a(p_70080_1_, -3.0E7D, 3.0E7D);
  12146. this.field_70163_u = p_70080_3_;
  12147. this.field_70161_v = MathHelper.func_151237_a(p_70080_5_, -3.0E7D, 3.0E7D);
  12148. this.field_70169_q = this.field_70165_t;
  12149. this.field_70167_r = this.field_70163_u;
  12150. this.field_70166_s = this.field_70161_v;
  12151. p_70080_8_ = MathHelper.func_76131_a(p_70080_8_, -90.0F, 90.0F);
  12152. this.field_70177_z = p_70080_7_;
  12153. this.field_70125_A = p_70080_8_;
  12154. this.field_70126_B = this.field_70177_z;
  12155. this.field_70127_C = this.field_70125_A;
  12156. double d0 = (double)(this.field_70126_B - p_70080_7_);
  12157. if(d0 < -180.0D) {
  12158. this.field_70126_B += 360.0F;
  12159. }
  12160.  
  12161. if(d0 >= 180.0D) {
  12162. this.field_70126_B -= 360.0F;
  12163. }
  12164.  
  12165. this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v);
  12166. this.func_70101_b(p_70080_7_, p_70080_8_);
  12167. }
  12168.  
  12169. public void func_174828_a(BlockPos p_174828_1_, float p_174828_2_, float p_174828_3_) {
  12170. this.func_70012_b((double)p_174828_1_.func_177958_n() + 0.5D, (double)p_174828_1_.func_177956_o(), (double)p_174828_1_.func_177952_p() + 0.5D, p_174828_2_, p_174828_3_);
  12171. }
  12172.  
  12173. public void func_70012_b(double p_70012_1_, double p_70012_3_, double p_70012_5_, float p_70012_7_, float p_70012_8_) {
  12174. this.field_70165_t = p_70012_1_;
  12175. this.field_70163_u = p_70012_3_;
  12176. this.field_70161_v = p_70012_5_;
  12177. this.field_70169_q = this.field_70165_t;
  12178. this.field_70167_r = this.field_70163_u;
  12179. this.field_70166_s = this.field_70161_v;
  12180. this.field_70142_S = this.field_70165_t;
  12181. this.field_70137_T = this.field_70163_u;
  12182. this.field_70136_U = this.field_70161_v;
  12183. this.field_70177_z = p_70012_7_;
  12184. this.field_70125_A = p_70012_8_;
  12185. this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v);
  12186. }
  12187.  
  12188. public float func_70032_d(Entity p_70032_1_) {
  12189. float f = (float)(this.field_70165_t - p_70032_1_.field_70165_t);
  12190. float f1 = (float)(this.field_70163_u - p_70032_1_.field_70163_u);
  12191. float f2 = (float)(this.field_70161_v - p_70032_1_.field_70161_v);
  12192. return MathHelper.func_76129_c(f * f + f1 * f1 + f2 * f2);
  12193. }
  12194.  
  12195. public double func_70092_e(double p_70092_1_, double p_70092_3_, double p_70092_5_) {
  12196. double d0 = this.field_70165_t - p_70092_1_;
  12197. double d1 = this.field_70163_u - p_70092_3_;
  12198. double d2 = this.field_70161_v - p_70092_5_;
  12199. return d0 * d0 + d1 * d1 + d2 * d2;
  12200. }
  12201.  
  12202. public double func_174818_b(BlockPos p_174818_1_) {
  12203. return p_174818_1_.func_177954_c(this.field_70165_t, this.field_70163_u, this.field_70161_v);
  12204. }
  12205.  
  12206. public double func_174831_c(BlockPos p_174831_1_) {
  12207. return p_174831_1_.func_177957_d(this.field_70165_t, this.field_70163_u, this.field_70161_v);
  12208. }
  12209.  
  12210. public double func_70011_f(double p_70011_1_, double p_70011_3_, double p_70011_5_) {
  12211. double d0 = this.field_70165_t - p_70011_1_;
  12212. double d1 = this.field_70163_u - p_70011_3_;
  12213. double d2 = this.field_70161_v - p_70011_5_;
  12214. return (double)MathHelper.func_76133_a(d0 * d0 + d1 * d1 + d2 * d2);
  12215. }
  12216.  
  12217. public double func_70068_e(Entity p_70068_1_) {
  12218. double d0 = this.field_70165_t - p_70068_1_.field_70165_t;
  12219. double d1 = this.field_70163_u - p_70068_1_.field_70163_u;
  12220. double d2 = this.field_70161_v - p_70068_1_.field_70161_v;
  12221. return d0 * d0 + d1 * d1 + d2 * d2;
  12222. }
  12223.  
  12224. public void func_70100_b_(EntityPlayer p_70100_1_) {
  12225. }
  12226.  
  12227. public void func_70108_f(Entity p_70108_1_) {
  12228. if(!this.func_184223_x(p_70108_1_)) {
  12229. if(!p_70108_1_.field_70145_X && !this.field_70145_X) {
  12230. double d0 = p_70108_1_.field_70165_t - this.field_70165_t;
  12231. double d1 = p_70108_1_.field_70161_v - this.field_70161_v;
  12232. double d2 = MathHelper.func_76132_a(d0, d1);
  12233. if(d2 >= 0.009999999776482582D) {
  12234. d2 = (double)MathHelper.func_76133_a(d2);
  12235. d0 = d0 / d2;
  12236. d1 = d1 / d2;
  12237. double d3 = 1.0D / d2;
  12238. if(d3 > 1.0D) {
  12239. d3 = 1.0D;
  12240. }
  12241.  
  12242. d0 = d0 * d3;
  12243. d1 = d1 * d3;
  12244. d0 = d0 * 0.05000000074505806D;
  12245. d1 = d1 * 0.05000000074505806D;
  12246. d0 = d0 * (double)(1.0F - this.field_70144_Y);
  12247. d1 = d1 * (double)(1.0F - this.field_70144_Y);
  12248. if(!this.func_184207_aI()) {
  12249. this.func_70024_g(-d0, 0.0D, -d1);
  12250. }
  12251.  
  12252. if(!p_70108_1_.func_184207_aI()) {
  12253. p_70108_1_.func_70024_g(d0, 0.0D, d1);
  12254. }
  12255. }
  12256.  
  12257. }
  12258. }
  12259. }
  12260.  
  12261. public void func_70024_g(double p_70024_1_, double p_70024_3_, double p_70024_5_) {
  12262. this.field_70159_w += p_70024_1_;
  12263. this.field_70181_x += p_70024_3_;
  12264. this.field_70179_y += p_70024_5_;
  12265. this.field_70160_al = true;
  12266. }
  12267.  
  12268. protected void func_70018_K() {
  12269. this.field_70133_I = true;
  12270. }
  12271.  
  12272. public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) {
  12273. if(this.func_180431_b(p_70097_1_)) {
  12274. return false;
  12275. } else {
  12276. this.func_70018_K();
  12277. return false;
  12278. }
  12279. }
  12280.  
  12281. public Vec3d func_70676_i(float p_70676_1_) {
  12282. if(p_70676_1_ == 1.0F) {
  12283. return this.func_174806_f(this.field_70125_A, this.field_70177_z);
  12284. } else {
  12285. float f = this.field_70127_C + (this.field_70125_A - this.field_70127_C) * p_70676_1_;
  12286. float f1 = this.field_70126_B + (this.field_70177_z - this.field_70126_B) * p_70676_1_;
  12287. return this.func_174806_f(f, f1);
  12288. }
  12289. }
  12290.  
  12291. protected final Vec3d func_174806_f(float p_174806_1_, float p_174806_2_) {
  12292. float f = MathHelper.func_76134_b(-p_174806_2_ * 0.017453292F - 3.1415927F);
  12293. float f1 = MathHelper.func_76126_a(-p_174806_2_ * 0.017453292F - 3.1415927F);
  12294. float f2 = -MathHelper.func_76134_b(-p_174806_1_ * 0.017453292F);
  12295. float f3 = MathHelper.func_76126_a(-p_174806_1_ * 0.017453292F);
  12296. return new Vec3d((double)(f1 * f2), (double)f3, (double)(f * f2));
  12297. }
  12298.  
  12299. public Vec3d func_174824_e(float p_174824_1_) {
  12300. if(p_174824_1_ == 1.0F) {
  12301. return new Vec3d(this.field_70165_t, this.field_70163_u + (double)this.func_70047_e(), this.field_70161_v);
  12302. } else {
  12303. double d0 = this.field_70169_q + (this.field_70165_t - this.field_70169_q) * (double)p_174824_1_;
  12304. double d1 = this.field_70167_r + (this.field_70163_u - this.field_70167_r) * (double)p_174824_1_ + (double)this.func_70047_e();
  12305. double d2 = this.field_70166_s + (this.field_70161_v - this.field_70166_s) * (double)p_174824_1_;
  12306. return new Vec3d(d0, d1, d2);
  12307. }
  12308. }
  12309.  
  12310. @Nullable
  12311. @SideOnly(Side.CLIENT)
  12312. public RayTraceResult func_174822_a(double p_174822_1_, float p_174822_3_) {
  12313. Vec3d vec3d = this.func_174824_e(p_174822_3_);
  12314. Vec3d vec3d1 = this.func_70676_i(p_174822_3_);
  12315. Vec3d vec3d2 = vec3d.func_72441_c(vec3d1.field_72450_a * p_174822_1_, vec3d1.field_72448_b * p_174822_1_, vec3d1.field_72449_c * p_174822_1_);
  12316. return this.field_70170_p.func_147447_a(vec3d, vec3d2, false, false, true);
  12317. }
  12318.  
  12319. public boolean func_70067_L() {
  12320. return false;
  12321. }
  12322.  
  12323. public boolean func_70104_M() {
  12324. return false;
  12325. }
  12326.  
  12327. public void func_191956_a(Entity p_191956_1_, int p_191956_2_, DamageSource p_191956_3_) {
  12328. if(p_191956_1_ instanceof EntityPlayerMP) {
  12329. CriteriaTriggers.field_192123_c.func_192211_a((EntityPlayerMP)p_191956_1_, this, p_191956_3_);
  12330. }
  12331.  
  12332. }
  12333.  
  12334. @SideOnly(Side.CLIENT)
  12335. public boolean func_145770_h(double p_145770_1_, double p_145770_3_, double p_145770_5_) {
  12336. double d0 = this.field_70165_t - p_145770_1_;
  12337. double d1 = this.field_70163_u - p_145770_3_;
  12338. double d2 = this.field_70161_v - p_145770_5_;
  12339. double d3 = d0 * d0 + d1 * d1 + d2 * d2;
  12340. return this.func_70112_a(d3);
  12341. }
  12342.  
  12343. @SideOnly(Side.CLIENT)
  12344. public boolean func_70112_a(double p_70112_1_) {
  12345. double d0 = this.func_174813_aQ().func_72320_b();
  12346. if(Double.isNaN(d0)) {
  12347. d0 = 1.0D;
  12348. }
  12349.  
  12350. d0 = d0 * 64.0D * field_70155_l;
  12351. return p_70112_1_ < d0 * d0;
  12352. }
  12353.  
  12354. public boolean func_184198_c(NBTTagCompound p_184198_1_) {
  12355. String s = this.func_70022_Q();
  12356. if(!this.field_70128_L && s != null) {
  12357. p_184198_1_.func_74778_a("id", s);
  12358. this.func_189511_e(p_184198_1_);
  12359. return true;
  12360. } else {
  12361. return false;
  12362. }
  12363. }
  12364.  
  12365. public boolean func_70039_c(NBTTagCompound p_70039_1_) {
  12366. String s = this.func_70022_Q();
  12367. if(!this.field_70128_L && s != null && !this.func_184218_aH()) {
  12368. p_70039_1_.func_74778_a("id", s);
  12369. this.func_189511_e(p_70039_1_);
  12370. return true;
  12371. } else {
  12372. return false;
  12373. }
  12374. }
  12375.  
  12376. public static void func_190533_a(DataFixer p_190533_0_) {
  12377. p_190533_0_.func_188258_a(FixTypes.ENTITY, new IDataWalker() {
  12378. public NBTTagCompound func_188266_a(IDataFixer p_188266_1_, NBTTagCompound p_188266_2_, int p_188266_3_) {
  12379. if(p_188266_2_.func_150297_b("Passengers", 9)) {
  12380. NBTTagList nbttaglist = p_188266_2_.func_150295_c("Passengers", 10);
  12381.  
  12382. for(int i = 0; i < nbttaglist.func_74745_c(); ++i) {
  12383. nbttaglist.func_150304_a(i, p_188266_1_.func_188251_a(FixTypes.ENTITY, nbttaglist.func_150305_b(i), p_188266_3_));
  12384. }
  12385. }
  12386.  
  12387. return p_188266_2_;
  12388. }
  12389. });
  12390. }
  12391.  
  12392. public NBTTagCompound func_189511_e(NBTTagCompound p_189511_1_) {
  12393. try {
  12394. p_189511_1_.func_74782_a("Pos", this.func_70087_a(new double[]{this.field_70165_t, this.field_70163_u, this.field_70161_v}));
  12395. p_189511_1_.func_74782_a("Motion", this.func_70087_a(new double[]{this.field_70159_w, this.field_70181_x, this.field_70179_y}));
  12396. p_189511_1_.func_74782_a("Rotation", this.func_70049_a(new float[]{this.field_70177_z, this.field_70125_A}));
  12397. p_189511_1_.func_74776_a("FallDistance", this.field_70143_R);
  12398. p_189511_1_.func_74777_a("Fire", (short)this.field_190534_ay);
  12399. p_189511_1_.func_74777_a("Air", (short)this.func_70086_ai());
  12400. p_189511_1_.func_74757_a("OnGround", this.field_70122_E);
  12401. p_189511_1_.func_74768_a("Dimension", this.field_71093_bK);
  12402. p_189511_1_.func_74757_a("Invulnerable", this.field_83001_bt);
  12403. p_189511_1_.func_74768_a("PortalCooldown", this.field_71088_bW);
  12404. p_189511_1_.func_186854_a("UUID", this.func_110124_au());
  12405. if(this.func_145818_k_()) {
  12406. p_189511_1_.func_74778_a("CustomName", this.func_95999_t());
  12407. }
  12408.  
  12409. if(this.func_174833_aM()) {
  12410. p_189511_1_.func_74757_a("CustomNameVisible", this.func_174833_aM());
  12411. }
  12412.  
  12413. this.field_174837_as.func_179670_b(p_189511_1_);
  12414. if(this.func_174814_R()) {
  12415. p_189511_1_.func_74757_a("Silent", this.func_174814_R());
  12416. }
  12417.  
  12418. if(this.func_189652_ae()) {
  12419. p_189511_1_.func_74757_a("NoGravity", this.func_189652_ae());
  12420. }
  12421.  
  12422. if(this.field_184238_ar) {
  12423. p_189511_1_.func_74757_a("Glowing", this.field_184238_ar);
  12424. }
  12425.  
  12426. if(!this.field_184236_aF.isEmpty()) {
  12427. NBTTagList nbttaglist = new NBTTagList();
  12428.  
  12429. for(String s : this.field_184236_aF) {
  12430. nbttaglist.func_74742_a(new NBTTagString(s));
  12431. }
  12432.  
  12433. p_189511_1_.func_74782_a("Tags", nbttaglist);
  12434. }
  12435.  
  12436. this.func_70014_b(p_189511_1_);
  12437. if(this.func_184207_aI()) {
  12438. NBTTagList nbttaglist1 = new NBTTagList();
  12439.  
  12440. for(Entity entity : this.func_184188_bt()) {
  12441. NBTTagCompound nbttagcompound = new NBTTagCompound();
  12442. if(entity.func_184198_c(nbttagcompound)) {
  12443. nbttaglist1.func_74742_a(nbttagcompound);
  12444. }
  12445. }
  12446.  
  12447. if(!nbttaglist1.func_82582_d()) {
  12448. p_189511_1_.func_74782_a("Passengers", nbttaglist1);
  12449. }
  12450. }
  12451.  
  12452. return p_189511_1_;
  12453. } catch (Throwable throwable) {
  12454. CrashReport crashreport = CrashReport.func_85055_a(throwable, "Saving entity NBT");
  12455. CrashReportCategory crashreportcategory = crashreport.func_85058_a("Entity being saved");
  12456. this.func_85029_a(crashreportcategory);
  12457. throw new ReportedException(crashreport);
  12458. }
  12459. }
  12460.  
  12461. public void func_70020_e(NBTTagCompound p_70020_1_) {
  12462. try {
  12463. NBTTagList nbttaglist = p_70020_1_.func_150295_c("Pos", 6);
  12464. NBTTagList nbttaglist2 = p_70020_1_.func_150295_c("Motion", 6);
  12465. NBTTagList nbttaglist3 = p_70020_1_.func_150295_c("Rotation", 5);
  12466. this.field_70159_w = nbttaglist2.func_150309_d(0);
  12467. this.field_70181_x = nbttaglist2.func_150309_d(1);
  12468. this.field_70179_y = nbttaglist2.func_150309_d(2);
  12469. if(Math.abs(this.field_70159_w) > 10.0D) {
  12470. this.field_70159_w = 0.0D;
  12471. }
  12472.  
  12473. if(Math.abs(this.field_70181_x) > 10.0D) {
  12474. this.field_70181_x = 0.0D;
  12475. }
  12476.  
  12477. if(Math.abs(this.field_70179_y) > 10.0D) {
  12478. this.field_70179_y = 0.0D;
  12479. }
  12480.  
  12481. this.field_70165_t = nbttaglist.func_150309_d(0);
  12482. this.field_70163_u = nbttaglist.func_150309_d(1);
  12483. this.field_70161_v = nbttaglist.func_150309_d(2);
  12484. this.field_70142_S = this.field_70165_t;
  12485. this.field_70137_T = this.field_70163_u;
  12486. this.field_70136_U = this.field_70161_v;
  12487. this.field_70169_q = this.field_70165_t;
  12488. this.field_70167_r = this.field_70163_u;
  12489. this.field_70166_s = this.field_70161_v;
  12490. this.field_70177_z = nbttaglist3.func_150308_e(0);
  12491. this.field_70125_A = nbttaglist3.func_150308_e(1);
  12492. this.field_70126_B = this.field_70177_z;
  12493. this.field_70127_C = this.field_70125_A;
  12494. this.func_70034_d(this.field_70177_z);
  12495. this.func_181013_g(this.field_70177_z);
  12496. this.field_70143_R = p_70020_1_.func_74760_g("FallDistance");
  12497. this.field_190534_ay = p_70020_1_.func_74765_d("Fire");
  12498. this.func_70050_g(p_70020_1_.func_74765_d("Air"));
  12499. this.field_70122_E = p_70020_1_.func_74767_n("OnGround");
  12500. if(p_70020_1_.func_74764_b("Dimension")) {
  12501. this.field_71093_bK = p_70020_1_.func_74762_e("Dimension");
  12502. }
  12503.  
  12504. this.field_83001_bt = p_70020_1_.func_74767_n("Invulnerable");
  12505. this.field_71088_bW = p_70020_1_.func_74762_e("PortalCooldown");
  12506. if(p_70020_1_.func_186855_b("UUID")) {
  12507. this.field_96093_i = p_70020_1_.func_186857_a("UUID");
  12508. this.field_189513_ar = this.field_96093_i.toString();
  12509. }
  12510.  
  12511. this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v);
  12512. this.func_70101_b(this.field_70177_z, this.field_70125_A);
  12513. if(p_70020_1_.func_150297_b("CustomName", 8)) {
  12514. this.func_96094_a(p_70020_1_.func_74779_i("CustomName"));
  12515. }
  12516.  
  12517. this.func_174805_g(p_70020_1_.func_74767_n("CustomNameVisible"));
  12518. this.field_174837_as.func_179668_a(p_70020_1_);
  12519. this.func_174810_b(p_70020_1_.func_74767_n("Silent"));
  12520. this.func_189654_d(p_70020_1_.func_74767_n("NoGravity"));
  12521. this.func_184195_f(p_70020_1_.func_74767_n("Glowing"));
  12522. if(p_70020_1_.func_150297_b("Tags", 9)) {
  12523. this.field_184236_aF.clear();
  12524. NBTTagList nbttaglist1 = p_70020_1_.func_150295_c("Tags", 8);
  12525. int i = Math.min(nbttaglist1.func_74745_c(), 1024);
  12526.  
  12527. for(int j = 0; j < i; ++j) {
  12528. this.field_184236_aF.add(nbttaglist1.func_150307_f(j));
  12529. }
  12530. }
  12531.  
  12532. this.func_70037_a(p_70020_1_);
  12533. if(this.func_142008_O()) {
  12534. this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v);
  12535. }
  12536.  
  12537. } catch (Throwable throwable) {
  12538. CrashReport crashreport = CrashReport.func_85055_a(throwable, "Loading entity NBT");
  12539. CrashReportCategory crashreportcategory = crashreport.func_85058_a("Entity being loaded");
  12540. this.func_85029_a(crashreportcategory);
  12541. throw new ReportedException(crashreport);
  12542. }
  12543. }
  12544.  
  12545. protected boolean func_142008_O() {
  12546. return true;
  12547. }
  12548.  
  12549. @Nullable
  12550. protected final String func_70022_Q() {
  12551. ResourceLocation resourcelocation = EntityList.func_191301_a(this);
  12552. return resourcelocation == null?null:resourcelocation.toString();
  12553. }
  12554.  
  12555. protected abstract void func_70037_a(NBTTagCompound p_70037_1_);
  12556.  
  12557. protected abstract void func_70014_b(NBTTagCompound p_70014_1_);
  12558.  
  12559. protected NBTTagList func_70087_a(double... p_70087_1_) {
  12560. NBTTagList nbttaglist = new NBTTagList();
  12561.  
  12562. for(double d0 : p_70087_1_) {
  12563. nbttaglist.func_74742_a(new NBTTagDouble(d0));
  12564. }
  12565.  
  12566. return nbttaglist;
  12567. }
  12568.  
  12569. protected NBTTagList func_70049_a(float... p_70049_1_) {
  12570. NBTTagList nbttaglist = new NBTTagList();
  12571.  
  12572. for(float f : p_70049_1_) {
  12573. nbttaglist.func_74742_a(new NBTTagFloat(f));
  12574. }
  12575.  
  12576. return nbttaglist;
  12577. }
  12578.  
  12579. @Nullable
  12580. public EntityItem func_145779_a(Item p_145779_1_, int p_145779_2_) {
  12581. return this.func_145778_a(p_145779_1_, p_145779_2_, 0.0F);
  12582. }
  12583.  
  12584. @Nullable
  12585. public EntityItem func_145778_a(Item p_145778_1_, int p_145778_2_, float p_145778_3_) {
  12586. return this.func_70099_a(new ItemStack(p_145778_1_, p_145778_2_, 0), p_145778_3_);
  12587. }
  12588.  
  12589. @Nullable
  12590. public EntityItem func_70099_a(ItemStack p_70099_1_, float p_70099_2_) {
  12591. if(p_70099_1_.func_190926_b()) {
  12592. return null;
  12593. } else {
  12594. EntityItem entityitem = new EntityItem(this.field_70170_p, this.field_70165_t, this.field_70163_u + (double)p_70099_2_, this.field_70161_v, p_70099_1_);
  12595. entityitem.func_174869_p();
  12596. this.field_70170_p.func_72838_d(entityitem);
  12597. return entityitem;
  12598. }
  12599. }
  12600.  
  12601. public boolean func_70089_S() {
  12602. return !this.field_70128_L;
  12603. }
  12604.  
  12605. public boolean func_70094_T() {
  12606. if(this.field_70145_X) {
  12607. return false;
  12608. } else {
  12609. BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
  12610.  
  12611. for(int i = 0; i < 8; ++i) {
  12612. int j = MathHelper.func_76128_c(this.field_70163_u + (double)(((float)((i >> 0) % 2) - 0.5F) * 0.1F) + (double)this.func_70047_e());
  12613. int k = MathHelper.func_76128_c(this.field_70165_t + (double)(((float)((i >> 1) % 2) - 0.5F) * this.field_70130_N * 0.8F));
  12614. int l = MathHelper.func_76128_c(this.field_70161_v + (double)(((float)((i >> 2) % 2) - 0.5F) * this.field_70130_N * 0.8F));
  12615. if(blockpos$pooledmutableblockpos.func_177958_n() != k || blockpos$pooledmutableblockpos.func_177956_o() != j || blockpos$pooledmutableblockpos.func_177952_p() != l) {
  12616. blockpos$pooledmutableblockpos.func_181079_c(k, j, l);
  12617. if(this.field_70170_p.func_180495_p(blockpos$pooledmutableblockpos).func_191058_s()) {
  12618. blockpos$pooledmutableblockpos.func_185344_t();
  12619. return true;
  12620. }
  12621. }
  12622. }
  12623.  
  12624. blockpos$pooledmutableblockpos.func_185344_t();
  12625. return false;
  12626. }
  12627. }
  12628.  
  12629. public boolean func_184230_a(EntityPlayer p_184230_1_, EnumHand p_184230_2_) {
  12630. return false;
  12631. }
  12632.  
  12633. @Nullable
  12634. public AxisAlignedBB func_70114_g(Entity p_70114_1_) {
  12635. return null;
  12636. }
  12637.  
  12638. public void func_70098_U() {
  12639. Entity entity = this.func_184187_bx();
  12640. if(this.func_184218_aH() && entity.field_70128_L) {
  12641. this.func_184210_p();
  12642. } else {
  12643. this.field_70159_w = 0.0D;
  12644. this.field_70181_x = 0.0D;
  12645. this.field_70179_y = 0.0D;
  12646. this.func_70071_h_();
  12647. if(this.func_184218_aH()) {
  12648. entity.func_184232_k(this);
  12649. }
  12650. }
  12651. }
  12652.  
  12653. public void func_184232_k(Entity p_184232_1_) {
  12654. if(this.func_184196_w(p_184232_1_)) {
  12655. p_184232_1_.func_70107_b(this.field_70165_t, this.field_70163_u + this.func_70042_X() + p_184232_1_.func_70033_W(), this.field_70161_v);
  12656. }
  12657. }
  12658.  
  12659. @SideOnly(Side.CLIENT)
  12660. public void func_184190_l(Entity p_184190_1_) {
  12661. }
  12662.  
  12663. public double func_70033_W() {
  12664. return 0.0D;
  12665. }
  12666.  
  12667. public double func_70042_X() {
  12668. return (double)this.field_70131_O * 0.75D;
  12669. }
  12670.  
  12671. public boolean func_184220_m(Entity p_184220_1_) {
  12672. return this.func_184205_a(p_184220_1_, false);
  12673. }
  12674.  
  12675. public boolean func_184205_a(Entity p_184205_1_, boolean p_184205_2_) {
  12676. for(Entity entity = p_184205_1_; entity.field_184239_as != null; entity = entity.field_184239_as) {
  12677. if(entity.field_184239_as == this) {
  12678. return false;
  12679. }
  12680. }
  12681.  
  12682. if(p_184205_2_ || this.func_184228_n(p_184205_1_) && p_184205_1_.func_184219_q(this)) {
  12683. if(this.func_184218_aH()) {
  12684. this.func_184210_p();
  12685. }
  12686.  
  12687. this.field_184239_as = p_184205_1_;
  12688. this.field_184239_as.func_184200_o(this);
  12689. return true;
  12690. } else {
  12691. return false;
  12692. }
  12693. }
  12694.  
  12695. protected boolean func_184228_n(Entity p_184228_1_) {
  12696. return this.field_184245_j <= 0;
  12697. }
  12698.  
  12699. public void func_184226_ay() {
  12700. for(int i = this.field_184244_h.size() - 1; i >= 0; --i) {
  12701. ((Entity)this.field_184244_h.get(i)).func_184210_p();
  12702. }
  12703.  
  12704. }
  12705.  
  12706. public void func_184210_p() {
  12707. if(this.field_184239_as != null) {
  12708. Entity entity = this.field_184239_as;
  12709. this.field_184239_as = null;
  12710. entity.func_184225_p(this);
  12711. }
  12712.  
  12713. }
  12714.  
  12715. protected void func_184200_o(Entity p_184200_1_) {
  12716. if(p_184200_1_.func_184187_bx() != this) {
  12717. throw new IllegalStateException("Use x.startRiding(y), not y.addPassenger(x)");
  12718. } else {
  12719. if(!this.field_70170_p.field_72995_K && p_184200_1_ instanceof EntityPlayer && !(this.func_184179_bs() instanceof EntityPlayer)) {
  12720. this.field_184244_h.add(0, p_184200_1_);
  12721. } else {
  12722. this.field_184244_h.add(p_184200_1_);
  12723. }
  12724.  
  12725. }
  12726. }
  12727.  
  12728. protected void func_184225_p(Entity p_184225_1_) {
  12729. if(p_184225_1_.func_184187_bx() == this) {
  12730. throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)");
  12731. } else {
  12732. this.field_184244_h.remove(p_184225_1_);
  12733. p_184225_1_.field_184245_j = 60;
  12734. }
  12735. }
  12736.  
  12737. protected boolean func_184219_q(Entity p_184219_1_) {
  12738. return this.func_184188_bt().size() < 1;
  12739. }
  12740.  
  12741. @SideOnly(Side.CLIENT)
  12742. public void func_180426_a(double p_180426_1_, double p_180426_3_, double p_180426_5_, float p_180426_7_, float p_180426_8_, int p_180426_9_, boolean p_180426_10_) {
  12743. this.func_70107_b(p_180426_1_, p_180426_3_, p_180426_5_);
  12744. this.func_70101_b(p_180426_7_, p_180426_8_);
  12745. }
  12746.  
  12747. public float func_70111_Y() {
  12748. return 0.0F;
  12749. }
  12750.  
  12751. public Vec3d func_70040_Z() {
  12752. return this.func_174806_f(this.field_70125_A, this.field_70177_z);
  12753. }
  12754.  
  12755. @SideOnly(Side.CLIENT)
  12756. public Vec2f func_189653_aC() {
  12757. return new Vec2f(this.field_70125_A, this.field_70177_z);
  12758. }
  12759.  
  12760. @SideOnly(Side.CLIENT)
  12761. public Vec3d func_189651_aD() {
  12762. return Vec3d.func_189984_a(this.func_189653_aC());
  12763. }
  12764.  
  12765. public void func_181015_d(BlockPos p_181015_1_) {
  12766. if(this.field_71088_bW > 0) {
  12767. this.field_71088_bW = this.func_82147_ab();
  12768. } else {
  12769. if(!this.field_70170_p.field_72995_K && !p_181015_1_.equals(this.field_181016_an)) {
  12770. this.field_181016_an = new BlockPos(p_181015_1_);
  12771. BlockPattern.PatternHelper blockpattern$patternhelper = Blocks.field_150427_aO.func_181089_f(this.field_70170_p, this.field_181016_an);
  12772. double d0 = blockpattern$patternhelper.func_177669_b().func_176740_k() == EnumFacing.Axis.X?(double)blockpattern$patternhelper.func_181117_a().func_177952_p():(double)blockpattern$patternhelper.func_181117_a().func_177958_n();
  12773. double d1 = blockpattern$patternhelper.func_177669_b().func_176740_k() == EnumFacing.Axis.X?this.field_70161_v:this.field_70165_t;
  12774. d1 = Math.abs(MathHelper.func_181160_c(d1 - (double)(blockpattern$patternhelper.func_177669_b().func_176746_e().func_176743_c() == EnumFacing.AxisDirection.NEGATIVE?1:0), d0, d0 - (double)blockpattern$patternhelper.func_181118_d()));
  12775. double d2 = MathHelper.func_181160_c(this.field_70163_u - 1.0D, (double)blockpattern$patternhelper.func_181117_a().func_177956_o(), (double)(blockpattern$patternhelper.func_181117_a().func_177956_o() - blockpattern$patternhelper.func_181119_e()));
  12776. this.field_181017_ao = new Vec3d(d1, d2, 0.0D);
  12777. this.field_181018_ap = blockpattern$patternhelper.func_177669_b();
  12778. }
  12779.  
  12780. this.field_71087_bX = true;
  12781. }
  12782. }
  12783.  
  12784. public int func_82147_ab() {
  12785. return 300;
  12786. }
  12787.  
  12788. @SideOnly(Side.CLIENT)
  12789. public void func_70016_h(double p_70016_1_, double p_70016_3_, double p_70016_5_) {
  12790. this.field_70159_w = p_70016_1_;
  12791. this.field_70181_x = p_70016_3_;
  12792. this.field_70179_y = p_70016_5_;
  12793. }
  12794.  
  12795. @SideOnly(Side.CLIENT)
  12796. public void func_70103_a(byte p_70103_1_) {
  12797. }
  12798.  
  12799. @SideOnly(Side.CLIENT)
  12800. public void func_70057_ab() {
  12801. }
  12802.  
  12803. public Iterable<ItemStack> func_184214_aD() {
  12804. return field_190535_b;
  12805. }
  12806.  
  12807. public Iterable<ItemStack> func_184193_aE() {
  12808. return field_190535_b;
  12809. }
  12810.  
  12811. public Iterable<ItemStack> func_184209_aF() {
  12812. return Iterables.<ItemStack>concat(this.func_184214_aD(), this.func_184193_aE());
  12813. }
  12814.  
  12815. public void func_184201_a(EntityEquipmentSlot p_184201_1_, ItemStack p_184201_2_) {
  12816. }
  12817.  
  12818. public boolean func_70027_ad() {
  12819. boolean flag = this.field_70170_p != null && this.field_70170_p.field_72995_K;
  12820. return !this.field_70178_ae && (this.field_190534_ay > 0 || flag && this.func_70083_f(0));
  12821. }
  12822.  
  12823. public boolean func_184218_aH() {
  12824. return this.func_184187_bx() != null;
  12825. }
  12826.  
  12827. public boolean func_184207_aI() {
  12828. return !this.func_184188_bt().isEmpty();
  12829. }
  12830.  
  12831. public boolean func_70093_af() {
  12832. return this.func_70083_f(1);
  12833. }
  12834.  
  12835. public void func_70095_a(boolean p_70095_1_) {
  12836. this.func_70052_a(1, p_70095_1_);
  12837. }
  12838.  
  12839. public boolean func_70051_ag() {
  12840. return this.func_70083_f(3);
  12841. }
  12842.  
  12843. public void func_70031_b(boolean p_70031_1_) {
  12844. this.func_70052_a(3, p_70031_1_);
  12845. }
  12846.  
  12847. public boolean func_184202_aL() {
  12848. return this.field_184238_ar || this.field_70170_p.field_72995_K && this.func_70083_f(6);
  12849. }
  12850.  
  12851. public void func_184195_f(boolean p_184195_1_) {
  12852. this.field_184238_ar = p_184195_1_;
  12853. if(!this.field_70170_p.field_72995_K) {
  12854. this.func_70052_a(6, this.field_184238_ar);
  12855. }
  12856.  
  12857. }
  12858.  
  12859. public boolean func_82150_aj() {
  12860. return this.func_70083_f(5);
  12861. }
  12862.  
  12863. @SideOnly(Side.CLIENT)
  12864. public boolean func_98034_c(EntityPlayer p_98034_1_) {
  12865. if(p_98034_1_.func_175149_v()) {
  12866. return false;
  12867. } else {
  12868. Team team = this.func_96124_cp();
  12869. return team != null && p_98034_1_ != null && p_98034_1_.func_96124_cp() == team && team.func_98297_h()?false:this.func_82150_aj();
  12870. }
  12871. }
  12872.  
  12873. @Nullable
  12874. public Team func_96124_cp() {
  12875. return this.field_70170_p.func_96441_U().func_96509_i(this.func_189512_bd());
  12876. }
  12877.  
  12878. public boolean func_184191_r(Entity p_184191_1_) {
  12879. return this.func_184194_a(p_184191_1_.func_96124_cp());
  12880. }
  12881.  
  12882. public boolean func_184194_a(Team p_184194_1_) {
  12883. return this.func_96124_cp() != null?this.func_96124_cp().func_142054_a(p_184194_1_):false;
  12884. }
  12885.  
  12886. public void func_82142_c(boolean p_82142_1_) {
  12887. this.func_70052_a(5, p_82142_1_);
  12888. }
  12889.  
  12890. protected boolean func_70083_f(int p_70083_1_) {
  12891. return (((Byte)this.field_70180_af.func_187225_a(field_184240_ax)).byteValue() & 1 << p_70083_1_) != 0;
  12892. }
  12893.  
  12894. protected void func_70052_a(int p_70052_1_, boolean p_70052_2_) {
  12895. byte b0 = ((Byte)this.field_70180_af.func_187225_a(field_184240_ax)).byteValue();
  12896. if(p_70052_2_) {
  12897. this.field_70180_af.func_187227_b(field_184240_ax, Byte.valueOf((byte)(b0 | 1 << p_70052_1_)));
  12898. } else {
  12899. this.field_70180_af.func_187227_b(field_184240_ax, Byte.valueOf((byte)(b0 & ~(1 << p_70052_1_))));
  12900. }
  12901.  
  12902. }
  12903.  
  12904. public int func_70086_ai() {
  12905. return ((Integer)this.field_70180_af.func_187225_a(field_184241_ay)).intValue();
  12906. }
  12907.  
  12908. public void func_70050_g(int p_70050_1_) {
  12909. this.field_70180_af.func_187227_b(field_184241_ay, Integer.valueOf(p_70050_1_));
  12910. }
  12911.  
  12912. public void func_70077_a(EntityLightningBolt p_70077_1_) {
  12913. this.func_70097_a(DamageSource.field_180137_b, 5.0F);
  12914. ++this.field_190534_ay;
  12915. if(this.field_190534_ay == 0) {
  12916. this.func_70015_d(8);
  12917. }
  12918.  
  12919. }
  12920.  
  12921. public void func_70074_a(EntityLivingBase p_70074_1_) {
  12922. }
  12923.  
  12924. protected boolean func_145771_j(double p_145771_1_, double p_145771_3_, double p_145771_5_) {
  12925. BlockPos blockpos = new BlockPos(p_145771_1_, p_145771_3_, p_145771_5_);
  12926. double d0 = p_145771_1_ - (double)blockpos.func_177958_n();
  12927. double d1 = p_145771_3_ - (double)blockpos.func_177956_o();
  12928. double d2 = p_145771_5_ - (double)blockpos.func_177952_p();
  12929. if(!this.field_70170_p.func_184143_b(this.func_174813_aQ())) {
  12930. return false;
  12931. } else {
  12932. EnumFacing enumfacing = EnumFacing.UP;
  12933. double d3 = Double.MAX_VALUE;
  12934. if(!this.field_70170_p.func_175665_u(blockpos.func_177976_e()) && d0 < d3) {
  12935. d3 = d0;
  12936. enumfacing = EnumFacing.WEST;
  12937. }
  12938.  
  12939. if(!this.field_70170_p.func_175665_u(blockpos.func_177974_f()) && 1.0D - d0 < d3) {
  12940. d3 = 1.0D - d0;
  12941. enumfacing = EnumFacing.EAST;
  12942. }
  12943.  
  12944. if(!this.field_70170_p.func_175665_u(blockpos.func_177978_c()) && d2 < d3) {
  12945. d3 = d2;
  12946. enumfacing = EnumFacing.NORTH;
  12947. }
  12948.  
  12949. if(!this.field_70170_p.func_175665_u(blockpos.func_177968_d()) && 1.0D - d2 < d3) {
  12950. d3 = 1.0D - d2;
  12951. enumfacing = EnumFacing.SOUTH;
  12952. }
  12953.  
  12954. if(!this.field_70170_p.func_175665_u(blockpos.func_177984_a()) && 1.0D - d1 < d3) {
  12955. d3 = 1.0D - d1;
  12956. enumfacing = EnumFacing.UP;
  12957. }
  12958.  
  12959. float f = this.field_70146_Z.nextFloat() * 0.2F + 0.1F;
  12960. float f1 = (float)enumfacing.func_176743_c().func_179524_a();
  12961. if(enumfacing.func_176740_k() == EnumFacing.Axis.X) {
  12962. this.field_70159_w = (double)(f1 * f);
  12963. this.field_70181_x *= 0.75D;
  12964. this.field_70179_y *= 0.75D;
  12965. } else if(enumfacing.func_176740_k() == EnumFacing.Axis.Y) {
  12966. this.field_70159_w *= 0.75D;
  12967. this.field_70181_x = (double)(f1 * f);
  12968. this.field_70179_y *= 0.75D;
  12969. } else if(enumfacing.func_176740_k() == EnumFacing.Axis.Z) {
  12970. this.field_70159_w *= 0.75D;
  12971. this.field_70181_x *= 0.75D;
  12972. this.field_70179_y = (double)(f1 * f);
  12973. }
  12974.  
  12975. return true;
  12976. }
  12977. }
  12978.  
  12979. public void func_70110_aj() {
  12980. this.field_70134_J = true;
  12981. this.field_70143_R = 0.0F;
  12982. }
  12983.  
  12984. public String func_70005_c_() {
  12985. if(this.func_145818_k_()) {
  12986. return this.func_95999_t();
  12987. } else {
  12988. String s = EntityList.func_75621_b(this);
  12989. if(s == null) {
  12990. s = "generic";
  12991. }
  12992.  
  12993. return I18n.func_74838_a("entity." + s + ".name");
  12994. }
  12995. }
  12996.  
  12997. @Nullable
  12998. public Entity[] func_70021_al() {
  12999. return null;
  13000. }
  13001.  
  13002. public boolean func_70028_i(Entity p_70028_1_) {
  13003. return this == p_70028_1_;
  13004. }
  13005.  
  13006. public float func_70079_am() {
  13007. return 0.0F;
  13008. }
  13009.  
  13010. public void func_70034_d(float p_70034_1_) {
  13011. }
  13012.  
  13013. public void func_181013_g(float p_181013_1_) {
  13014. }
  13015.  
  13016. public boolean func_70075_an() {
  13017. return true;
  13018. }
  13019.  
  13020. public boolean func_85031_j(Entity p_85031_1_) {
  13021. return false;
  13022. }
  13023.  
  13024. public String toString() {
  13025. return String.format("%s[\'%s\'/%d, l=\'%s\', x=%.2f, y=%.2f, z=%.2f]", new Object[]{this.getClass().getSimpleName(), this.func_70005_c_(), Integer.valueOf(this.field_145783_c), this.field_70170_p == null?"~NULL~":this.field_70170_p.func_72912_H().func_76065_j(), Double.valueOf(this.field_70165_t), Double.valueOf(this.field_70163_u), Double.valueOf(this.field_70161_v)});
  13026. }
  13027.  
  13028. public boolean func_180431_b(DamageSource p_180431_1_) {
  13029. return this.field_83001_bt && p_180431_1_ != DamageSource.field_76380_i && !p_180431_1_.func_180136_u();
  13030. }
  13031.  
  13032. public boolean func_190530_aW() {
  13033. return this.field_83001_bt;
  13034. }
  13035.  
  13036. public void func_184224_h(boolean p_184224_1_) {
  13037. this.field_83001_bt = p_184224_1_;
  13038. }
  13039.  
  13040. public void func_82149_j(Entity p_82149_1_) {
  13041. this.func_70012_b(p_82149_1_.field_70165_t, p_82149_1_.field_70163_u, p_82149_1_.field_70161_v, p_82149_1_.field_70177_z, p_82149_1_.field_70125_A);
  13042. }
  13043.  
  13044. private void func_180432_n(Entity p_180432_1_) {
  13045. NBTTagCompound nbttagcompound = p_180432_1_.func_189511_e(new NBTTagCompound());
  13046. nbttagcompound.func_82580_o("Dimension");
  13047. this.func_70020_e(nbttagcompound);
  13048. this.field_71088_bW = p_180432_1_.field_71088_bW;
  13049. this.field_181016_an = p_180432_1_.field_181016_an;
  13050. this.field_181017_ao = p_180432_1_.field_181017_ao;
  13051. this.field_181018_ap = p_180432_1_.field_181018_ap;
  13052. }
  13053.  
  13054. @Nullable
  13055. public Entity func_184204_a(int p_184204_1_) {
  13056. if(!this.field_70170_p.field_72995_K && !this.field_70128_L) {
  13057. this.field_70170_p.field_72984_F.func_76320_a("changeDimension");
  13058. MinecraftServer minecraftserver = this.func_184102_h();
  13059. int i = this.field_71093_bK;
  13060. WorldServer worldserver = minecraftserver.func_71218_a(i);
  13061. WorldServer worldserver1 = minecraftserver.func_71218_a(p_184204_1_);
  13062. this.field_71093_bK = p_184204_1_;
  13063. if(i == 1 && p_184204_1_ == 1) {
  13064. worldserver1 = minecraftserver.func_71218_a(0);
  13065. this.field_71093_bK = 0;
  13066. }
  13067.  
  13068. this.field_70170_p.func_72900_e(this);
  13069. this.field_70128_L = false;
  13070. this.field_70170_p.field_72984_F.func_76320_a("reposition");
  13071. BlockPos blockpos;
  13072. if(p_184204_1_ == 1) {
  13073. blockpos = worldserver1.func_180504_m();
  13074. } else {
  13075. double d0 = this.field_70165_t;
  13076. double d1 = this.field_70161_v;
  13077. double d2 = 8.0D;
  13078. if(p_184204_1_ == -1) {
  13079. d0 = MathHelper.func_151237_a(d0 / 8.0D, worldserver1.func_175723_af().func_177726_b() + 16.0D, worldserver1.func_175723_af().func_177728_d() - 16.0D);
  13080. d1 = MathHelper.func_151237_a(d1 / 8.0D, worldserver1.func_175723_af().func_177736_c() + 16.0D, worldserver1.func_175723_af().func_177733_e() - 16.0D);
  13081. } else if(p_184204_1_ == 0) {
  13082. d0 = MathHelper.func_151237_a(d0 * 8.0D, worldserver1.func_175723_af().func_177726_b() + 16.0D, worldserver1.func_175723_af().func_177728_d() - 16.0D);
  13083. d1 = MathHelper.func_151237_a(d1 * 8.0D, worldserver1.func_175723_af().func_177736_c() + 16.0D, worldserver1.func_175723_af().func_177733_e() - 16.0D);
  13084. }
  13085.  
  13086. d0 = (double)MathHelper.func_76125_a((int)d0, -29999872, 29999872);
  13087. d1 = (double)MathHelper.func_76125_a((int)d1, -29999872, 29999872);
  13088. float f = this.field_70177_z;
  13089. this.func_70012_b(d0, this.field_70163_u, d1, 90.0F, 0.0F);
  13090. Teleporter teleporter = worldserver1.func_85176_s();
  13091. teleporter.func_180620_b(this, f);
  13092. blockpos = new BlockPos(this);
  13093. }
  13094.  
  13095. worldserver.func_72866_a(this, false);
  13096. this.field_70170_p.field_72984_F.func_76318_c("reloading");
  13097. Entity entity = EntityList.func_191304_a(this.getClass(), worldserver1);
  13098. if(entity != null) {
  13099. entity.func_180432_n(this);
  13100. if(i == 1 && p_184204_1_ == 1) {
  13101. BlockPos blockpos1 = worldserver1.func_175672_r(worldserver1.func_175694_M());
  13102. entity.func_174828_a(blockpos1, entity.field_70177_z, entity.field_70125_A);
  13103. } else {
  13104. entity.func_174828_a(blockpos, entity.field_70177_z, entity.field_70125_A);
  13105. }
  13106.  
  13107. boolean flag = entity.field_98038_p;
  13108. entity.field_98038_p = true;
  13109. worldserver1.func_72838_d(entity);
  13110. entity.field_98038_p = flag;
  13111. worldserver1.func_72866_a(entity, false);
  13112. }
  13113.  
  13114. this.field_70128_L = true;
  13115. this.field_70170_p.field_72984_F.func_76319_b();
  13116. worldserver.func_82742_i();
  13117. worldserver1.func_82742_i();
  13118. this.field_70170_p.field_72984_F.func_76319_b();
  13119. return entity;
  13120. } else {
  13121. return null;
  13122. }
  13123. }
  13124.  
  13125. public boolean func_184222_aU() {
  13126. return true;
  13127. }
  13128.  
  13129. public float func_180428_a(Explosion p_180428_1_, World p_180428_2_, BlockPos p_180428_3_, IBlockState p_180428_4_) {
  13130. return p_180428_4_.func_177230_c().func_149638_a(this);
  13131. }
  13132.  
  13133. public boolean func_174816_a(Explosion p_174816_1_, World p_174816_2_, BlockPos p_174816_3_, IBlockState p_174816_4_, float p_174816_5_) {
  13134. return true;
  13135. }
  13136.  
  13137. public int func_82143_as() {
  13138. return 3;
  13139. }
  13140.  
  13141. public Vec3d func_181014_aG() {
  13142. return this.field_181017_ao;
  13143. }
  13144.  
  13145. public EnumFacing func_181012_aH() {
  13146. return this.field_181018_ap;
  13147. }
  13148.  
  13149. public boolean func_145773_az() {
  13150. return false;
  13151. }
  13152.  
  13153. public void func_85029_a(CrashReportCategory p_85029_1_) {
  13154. p_85029_1_.func_189529_a("Entity Type", new ICrashReportDetail<String>() {
  13155. public String call() throws Exception {
  13156. return EntityList.func_191301_a(Entity.this) + " (" + Entity.this.getClass().getCanonicalName() + ")";
  13157. }
  13158. });
  13159. p_85029_1_.func_71507_a("Entity ID", Integer.valueOf(this.field_145783_c));
  13160. p_85029_1_.func_189529_a("Entity Name", new ICrashReportDetail<String>() {
  13161. public String call() throws Exception {
  13162. return Entity.this.func_70005_c_();
  13163. }
  13164. });
  13165. p_85029_1_.func_71507_a("Entity\'s Exact location", String.format("%.2f, %.2f, %.2f", new Object[]{Double.valueOf(this.field_70165_t), Double.valueOf(this.field_70163_u), Double.valueOf(this.field_70161_v)}));
  13166. p_85029_1_.func_71507_a("Entity\'s Block location", CrashReportCategory.func_184876_a(MathHelper.func_76128_c(this.field_70165_t), MathHelper.func_76128_c(this.field_70163_u), MathHelper.func_76128_c(this.field_70161_v)));
  13167. p_85029_1_.func_71507_a("Entity\'s Momentum", String.format("%.2f, %.2f, %.2f", new Object[]{Double.valueOf(this.field_70159_w), Double.valueOf(this.field_70181_x), Double.valueOf(this.field_70179_y)}));
  13168. p_85029_1_.func_189529_a("Entity\'s Passengers", new ICrashReportDetail<String>() {
  13169. public String call() throws Exception {
  13170. return Entity.this.func_184188_bt().toString();
  13171. }
  13172. });
  13173. p_85029_1_.func_189529_a("Entity\'s Vehicle", new ICrashReportDetail<String>() {
  13174. public String call() throws Exception {
  13175. return Entity.this.func_184187_bx().toString();
  13176. }
  13177. });
  13178. }
  13179.  
  13180. public void func_184221_a(UUID p_184221_1_) {
  13181. this.field_96093_i = p_184221_1_;
  13182. this.field_189513_ar = this.field_96093_i.toString();
  13183. }
  13184.  
  13185. @SideOnly(Side.CLIENT)
  13186. public boolean func_90999_ad() {
  13187. return this.func_70027_ad();
  13188. }
  13189.  
  13190. public UUID func_110124_au() {
  13191. return this.field_96093_i;
  13192. }
  13193.  
  13194. public String func_189512_bd() {
  13195. return this.field_189513_ar;
  13196. }
  13197.  
  13198. public boolean func_96092_aw() {
  13199. return true;
  13200. }
  13201.  
  13202. @SideOnly(Side.CLIENT)
  13203. public static double func_184183_bd() {
  13204. return field_70155_l;
  13205. }
  13206.  
  13207. @SideOnly(Side.CLIENT)
  13208. public static void func_184227_b(double p_184227_0_) {
  13209. field_70155_l = p_184227_0_;
  13210. }
  13211.  
  13212. public ITextComponent func_145748_c_() {
  13213. TextComponentString textcomponentstring = new TextComponentString(ScorePlayerTeam.func_96667_a(this.func_96124_cp(), this.func_70005_c_()));
  13214. textcomponentstring.func_150256_b().func_150209_a(this.func_174823_aP());
  13215. textcomponentstring.func_150256_b().func_179989_a(this.func_189512_bd());
  13216. return textcomponentstring;
  13217. }
  13218.  
  13219. public void func_96094_a(String p_96094_1_) {
  13220. this.field_70180_af.func_187227_b(field_184242_az, p_96094_1_);
  13221. }
  13222.  
  13223. public String func_95999_t() {
  13224. return (String)this.field_70180_af.func_187225_a(field_184242_az);
  13225. }
  13226.  
  13227. public boolean func_145818_k_() {
  13228. return !((String)this.field_70180_af.func_187225_a(field_184242_az)).isEmpty();
  13229. }
  13230.  
  13231. public void func_174805_g(boolean p_174805_1_) {
  13232. this.field_70180_af.func_187227_b(field_184233_aA, Boolean.valueOf(p_174805_1_));
  13233. }
  13234.  
  13235. public boolean func_174833_aM() {
  13236. return ((Boolean)this.field_70180_af.func_187225_a(field_184233_aA)).booleanValue();
  13237. }
  13238.  
  13239. public void func_70634_a(double p_70634_1_, double p_70634_3_, double p_70634_5_) {
  13240. this.field_184237_aG = true;
  13241. this.func_70012_b(p_70634_1_, p_70634_3_, p_70634_5_, this.field_70177_z, this.field_70125_A);
  13242. this.field_70170_p.func_72866_a(this, false);
  13243. }
  13244.  
  13245. public void func_184206_a(DataParameter<?> p_184206_1_) {
  13246. }
  13247.  
  13248. @SideOnly(Side.CLIENT)
  13249. public boolean func_94059_bO() {
  13250. return this.func_174833_aM();
  13251. }
  13252.  
  13253. public EnumFacing func_174811_aO() {
  13254. return EnumFacing.func_176731_b(MathHelper.func_76128_c((double)(this.field_70177_z * 4.0F / 360.0F) + 0.5D) & 3);
  13255. }
  13256.  
  13257. public EnumFacing func_184172_bi() {
  13258. return this.func_174811_aO();
  13259. }
  13260.  
  13261. protected HoverEvent func_174823_aP() {
  13262. NBTTagCompound nbttagcompound = new NBTTagCompound();
  13263. ResourceLocation resourcelocation = EntityList.func_191301_a(this);
  13264. nbttagcompound.func_74778_a("id", this.func_189512_bd());
  13265. if(resourcelocation != null) {
  13266. nbttagcompound.func_74778_a("type", resourcelocation.toString());
  13267. }
  13268.  
  13269. nbttagcompound.func_74778_a("name", this.func_70005_c_());
  13270. return new HoverEvent(HoverEvent.Action.SHOW_ENTITY, new TextComponentString(nbttagcompound.toString()));
  13271. }
  13272.  
  13273. public boolean func_174827_a(EntityPlayerMP p_174827_1_) {
  13274. return true;
  13275. }
  13276.  
  13277. public AxisAlignedBB func_174813_aQ() {
  13278. return this.field_70121_D;
  13279. }
  13280.  
  13281. @SideOnly(Side.CLIENT)
  13282. public AxisAlignedBB func_184177_bl() {
  13283. return this.func_174813_aQ();
  13284. }
  13285.  
  13286. public void func_174826_a(AxisAlignedBB p_174826_1_) {
  13287. this.field_70121_D = p_174826_1_;
  13288. }
  13289.  
  13290. public float func_70047_e() {
  13291. return this.field_70131_O * 0.85F;
  13292. }
  13293.  
  13294. public boolean func_174832_aS() {
  13295. return this.field_174835_g;
  13296. }
  13297.  
  13298. public void func_174821_h(boolean p_174821_1_) {
  13299. this.field_174835_g = p_174821_1_;
  13300. }
  13301.  
  13302. public boolean func_174820_d(int p_174820_1_, ItemStack p_174820_2_) {
  13303. return false;
  13304. }
  13305.  
  13306. public void func_145747_a(ITextComponent p_145747_1_) {
  13307. }
  13308.  
  13309. public boolean func_70003_b(int p_70003_1_, String p_70003_2_) {
  13310. return true;
  13311. }
  13312.  
  13313. public BlockPos func_180425_c() {
  13314. return new BlockPos(this.field_70165_t, this.field_70163_u + 0.5D, this.field_70161_v);
  13315. }
  13316.  
  13317. public Vec3d func_174791_d() {
  13318. return new Vec3d(this.field_70165_t, this.field_70163_u, this.field_70161_v);
  13319. }
  13320.  
  13321. public World func_130014_f_() {
  13322. return this.field_70170_p;
  13323. }
  13324.  
  13325. public Entity func_174793_f() {
  13326. return this;
  13327. }
  13328.  
  13329. public boolean func_174792_t_() {
  13330. return false;
  13331. }
  13332.  
  13333. public void func_174794_a(CommandResultStats.Type p_174794_1_, int p_174794_2_) {
  13334. if(this.field_70170_p != null && !this.field_70170_p.field_72995_K) {
  13335. this.field_174837_as.func_184932_a(this.field_70170_p.func_73046_m(), this, p_174794_1_, p_174794_2_);
  13336. }
  13337.  
  13338. }
  13339.  
  13340. @Nullable
  13341. public MinecraftServer func_184102_h() {
  13342. return this.field_70170_p.func_73046_m();
  13343. }
  13344.  
  13345. public CommandResultStats func_174807_aT() {
  13346. return this.field_174837_as;
  13347. }
  13348.  
  13349. public void func_174817_o(Entity p_174817_1_) {
  13350. this.field_174837_as.func_179671_a(p_174817_1_.func_174807_aT());
  13351. }
  13352.  
  13353. public EnumActionResult func_184199_a(EntityPlayer p_184199_1_, Vec3d p_184199_2_, EnumHand p_184199_3_) {
  13354. return EnumActionResult.PASS;
  13355. }
  13356.  
  13357. public boolean func_180427_aV() {
  13358. return false;
  13359. }
  13360.  
  13361. protected void func_174815_a(EntityLivingBase p_174815_1_, Entity p_174815_2_) {
  13362. if(p_174815_2_ instanceof EntityLivingBase) {
  13363. EnchantmentHelper.func_151384_a((EntityLivingBase)p_174815_2_, p_174815_1_);
  13364. }
  13365.  
  13366. EnchantmentHelper.func_151385_b(p_174815_1_, p_174815_2_);
  13367. }
  13368.  
  13369. public void func_184178_b(EntityPlayerMP p_184178_1_) {
  13370. }
  13371.  
  13372. public void func_184203_c(EntityPlayerMP p_184203_1_) {
  13373. }
  13374.  
  13375. public float func_184229_a(Rotation p_184229_1_) {
  13376. float f = MathHelper.func_76142_g(this.field_70177_z);
  13377. switch(p_184229_1_) {
  13378. case CLOCKWISE_180:
  13379. return f + 180.0F;
  13380. case COUNTERCLOCKWISE_90:
  13381. return f + 270.0F;
  13382. case CLOCKWISE_90:
  13383. return f + 90.0F;
  13384. default:
  13385. return f;
  13386. }
  13387. }
  13388.  
  13389. public float func_184217_a(Mirror p_184217_1_) {
  13390. float f = MathHelper.func_76142_g(this.field_70177_z);
  13391. switch(p_184217_1_) {
  13392. case LEFT_RIGHT:
  13393. return -f;
  13394. case FRONT_BACK:
  13395. return 180.0F - f;
  13396. default:
  13397. return f;
  13398. }
  13399. }
  13400.  
  13401. public boolean func_184213_bq() {
  13402. return false;
  13403. }
  13404.  
  13405. public boolean func_184189_br() {
  13406. boolean flag = this.field_184237_aG;
  13407. this.field_184237_aG = false;
  13408. return flag;
  13409. }
  13410.  
  13411. @Nullable
  13412. public Entity func_184179_bs() {
  13413. return null;
  13414. }
  13415.  
  13416. public List<Entity> func_184188_bt() {
  13417. return (List<Entity>)(this.field_184244_h.isEmpty()?Collections.emptyList():Lists.newArrayList(this.field_184244_h));
  13418. }
  13419.  
  13420. public boolean func_184196_w(Entity p_184196_1_) {
  13421. for(Entity entity : this.func_184188_bt()) {
  13422. if(entity.equals(p_184196_1_)) {
  13423. return true;
  13424. }
  13425. }
  13426.  
  13427. return false;
  13428. }
  13429.  
  13430. public Collection<Entity> func_184182_bu() {
  13431. Set<Entity> set = Sets.<Entity>newHashSet();
  13432. this.func_184175_a(Entity.class, set);
  13433. return set;
  13434. }
  13435.  
  13436. public <T extends Entity> Collection<T> func_184180_b(Class<T> p_184180_1_) {
  13437. Set<T> set = Sets.<T>newHashSet();
  13438. this.func_184175_a(p_184180_1_, set);
  13439. return set;
  13440. }
  13441.  
  13442. private <T extends Entity> void func_184175_a(Class<T> p_184175_1_, Set<T> p_184175_2_) {
  13443. for(Entity entity : this.func_184188_bt()) {
  13444. if(p_184175_1_.isAssignableFrom(entity.getClass())) {
  13445. p_184175_2_.add(entity);
  13446. }
  13447.  
  13448. entity.func_184175_a(p_184175_1_, p_184175_2_);
  13449. }
  13450.  
  13451. }
  13452.  
  13453. public Entity func_184208_bv() {
  13454. Entity entity;
  13455. for(entity = this; entity.func_184218_aH(); entity = entity.func_184187_bx()) {
  13456. ;
  13457. }
  13458.  
  13459. return entity;
  13460. }
  13461.  
  13462. public boolean func_184223_x(Entity p_184223_1_) {
  13463. return this.func_184208_bv() == p_184223_1_.func_184208_bv();
  13464. }
  13465.  
  13466. public boolean func_184215_y(Entity p_184215_1_) {
  13467. for(Entity entity : this.func_184188_bt()) {
  13468. if(entity.equals(p_184215_1_)) {
  13469. return true;
  13470. }
  13471.  
  13472. if(entity.func_184215_y(p_184215_1_)) {
  13473. return true;
  13474. }
  13475. }
  13476.  
  13477. return false;
  13478. }
  13479.  
  13480. public boolean func_184186_bw() {
  13481. Entity entity = this.func_184179_bs();
  13482. return entity instanceof EntityPlayer?((EntityPlayer)entity).func_175144_cb():!this.field_70170_p.field_72995_K;
  13483. }
  13484.  
  13485. @Nullable
  13486. public Entity func_184187_bx() {
  13487. return this.field_184239_as;
  13488. }
  13489.  
  13490. public EnumPushReaction func_184192_z() {
  13491. return EnumPushReaction.NORMAL;
  13492. }
  13493.  
  13494. public SoundCategory func_184176_by() {
  13495. return SoundCategory.NEUTRAL;
  13496. }
  13497.  
  13498. protected int func_190531_bD() {
  13499. return 1;
  13500. }
  13501. }
  13502.  
  13503. Hunk 3 failed! Cannot find hunk target
  13504. private <T extends Entity> void func_184175_a(Class<T> p_184175_1_, Set<T> p_184175_2_) {
  13505. for(Entity entity : this.func_184188_bt()) {
  13506. if (p_184175_1_.isAssignableFrom(entity.getClass())) {
  13507. - p_184175_2_.add(entity);
  13508. + p_184175_2_.add((T)entity);
  13509. }
  13510.  
  13511. entity.func_184175_a(p_184175_1_, p_184175_2_);
  13512. File state
  13513. package net.minecraft.entity;
  13514.  
  13515. import com.google.common.collect.Iterables;
  13516. import com.google.common.collect.Lists;
  13517. import com.google.common.collect.Sets;
  13518. import java.util.Arrays;
  13519. import java.util.Collection;
  13520. import java.util.Collections;
  13521. import java.util.List;
  13522. import java.util.Random;
  13523. import java.util.Set;
  13524. import java.util.UUID;
  13525. import javax.annotation.Nullable;
  13526. import net.minecraft.advancements.CriteriaTriggers;
  13527. import net.minecraft.block.Block;
  13528. import net.minecraft.block.BlockFence;
  13529. import net.minecraft.block.BlockFenceGate;
  13530. import net.minecraft.block.BlockLiquid;
  13531. import net.minecraft.block.BlockWall;
  13532. import net.minecraft.block.SoundType;
  13533. import net.minecraft.block.material.EnumPushReaction;
  13534. import net.minecraft.block.material.Material;
  13535. import net.minecraft.block.state.IBlockState;
  13536. import net.minecraft.block.state.pattern.BlockPattern;
  13537. import net.minecraft.command.CommandResultStats;
  13538. import net.minecraft.command.ICommandSender;
  13539. import net.minecraft.crash.CrashReport;
  13540. import net.minecraft.crash.CrashReportCategory;
  13541. import net.minecraft.crash.ICrashReportDetail;
  13542. import net.minecraft.enchantment.EnchantmentHelper;
  13543. import net.minecraft.enchantment.EnchantmentProtection;
  13544. import net.minecraft.entity.EntityList;
  13545. import net.minecraft.entity.EntityLivingBase;
  13546. import net.minecraft.entity.MoverType;
  13547. import net.minecraft.entity.effect.EntityLightningBolt;
  13548. import net.minecraft.entity.item.EntityBoat;
  13549. import net.minecraft.entity.item.EntityItem;
  13550. import net.minecraft.entity.player.EntityPlayer;
  13551. import net.minecraft.entity.player.EntityPlayerMP;
  13552. import net.minecraft.init.Blocks;
  13553. import net.minecraft.init.SoundEvents;
  13554. import net.minecraft.inventory.EntityEquipmentSlot;
  13555. import net.minecraft.item.Item;
  13556. import net.minecraft.item.ItemStack;
  13557. import net.minecraft.nbt.NBTTagCompound;
  13558. import net.minecraft.nbt.NBTTagDouble;
  13559. import net.minecraft.nbt.NBTTagFloat;
  13560. import net.minecraft.nbt.NBTTagList;
  13561. import net.minecraft.nbt.NBTTagString;
  13562. import net.minecraft.network.datasync.DataParameter;
  13563. import net.minecraft.network.datasync.DataSerializers;
  13564. import net.minecraft.network.datasync.EntityDataManager;
  13565. import net.minecraft.scoreboard.ScorePlayerTeam;
  13566. import net.minecraft.scoreboard.Team;
  13567. import net.minecraft.server.MinecraftServer;
  13568. import net.minecraft.util.DamageSource;
  13569. import net.minecraft.util.EnumActionResult;
  13570. import net.minecraft.util.EnumBlockRenderType;
  13571. import net.minecraft.util.EnumFacing;
  13572. import net.minecraft.util.EnumHand;
  13573. import net.minecraft.util.EnumParticleTypes;
  13574. import net.minecraft.util.Mirror;
  13575. import net.minecraft.util.ReportedException;
  13576. import net.minecraft.util.ResourceLocation;
  13577. import net.minecraft.util.Rotation;
  13578. import net.minecraft.util.SoundCategory;
  13579. import net.minecraft.util.SoundEvent;
  13580. import net.minecraft.util.datafix.DataFixer;
  13581. import net.minecraft.util.datafix.FixTypes;
  13582. import net.minecraft.util.datafix.IDataFixer;
  13583. import net.minecraft.util.datafix.IDataWalker;
  13584. import net.minecraft.util.math.AxisAlignedBB;
  13585. import net.minecraft.util.math.BlockPos;
  13586. import net.minecraft.util.math.MathHelper;
  13587. import net.minecraft.util.math.RayTraceResult;
  13588. import net.minecraft.util.math.Vec2f;
  13589. import net.minecraft.util.math.Vec3d;
  13590. import net.minecraft.util.text.ITextComponent;
  13591. import net.minecraft.util.text.TextComponentString;
  13592. import net.minecraft.util.text.event.HoverEvent;
  13593. import net.minecraft.util.text.translation.I18n;
  13594. import net.minecraft.world.Explosion;
  13595. import net.minecraft.world.Teleporter;
  13596. import net.minecraft.world.World;
  13597. import net.minecraft.world.WorldServer;
  13598. import net.minecraftforge.fml.relauncher.Side;
  13599. import net.minecraftforge.fml.relauncher.SideOnly;
  13600. import org.apache.logging.log4j.LogManager;
  13601. import org.apache.logging.log4j.Logger;
  13602.  
  13603. public abstract class Entity implements ICommandSender {
  13604. private static final Logger field_184243_a = LogManager.getLogger();
  13605. private static final List<ItemStack> field_190535_b = Collections.<ItemStack>emptyList();
  13606. private static final AxisAlignedBB field_174836_a = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
  13607. private static double field_70155_l = 1.0D;
  13608. private static int field_70152_a;
  13609. private int field_145783_c;
  13610. public boolean field_70156_m;
  13611. private final List<Entity> field_184244_h;
  13612. protected int field_184245_j;
  13613. private Entity field_184239_as;
  13614. public boolean field_98038_p;
  13615. public World field_70170_p;
  13616. public double field_70169_q;
  13617. public double field_70167_r;
  13618. public double field_70166_s;
  13619. public double field_70165_t;
  13620. public double field_70163_u;
  13621. public double field_70161_v;
  13622. public double field_70159_w;
  13623. public double field_70181_x;
  13624. public double field_70179_y;
  13625. public float field_70177_z;
  13626. public float field_70125_A;
  13627. public float field_70126_B;
  13628. public float field_70127_C;
  13629. private AxisAlignedBB field_70121_D;
  13630. public boolean field_70122_E;
  13631. public boolean field_70123_F;
  13632. public boolean field_70124_G;
  13633. public boolean field_70132_H;
  13634. public boolean field_70133_I;
  13635. protected boolean field_70134_J;
  13636. private boolean field_174835_g;
  13637. public boolean field_70128_L;
  13638. public float field_70130_N;
  13639. public float field_70131_O;
  13640. public float field_70141_P;
  13641. public float field_70140_Q;
  13642. public float field_82151_R;
  13643. public float field_70143_R;
  13644. private int field_70150_b;
  13645. private float field_191959_ay;
  13646. public double field_70142_S;
  13647. public double field_70137_T;
  13648. public double field_70136_U;
  13649. public float field_70138_W;
  13650. public boolean field_70145_X;
  13651. public float field_70144_Y;
  13652. protected Random field_70146_Z;
  13653. public int field_70173_aa;
  13654. private int field_190534_ay;
  13655. protected boolean field_70171_ac;
  13656. public int field_70172_ad;
  13657. protected boolean field_70148_d;
  13658. protected boolean field_70178_ae;
  13659. protected EntityDataManager field_70180_af;
  13660. protected static final DataParameter<Byte> field_184240_ax = EntityDataManager.<Byte>func_187226_a(Entity.class, DataSerializers.field_187191_a);
  13661. private static final DataParameter<Integer> field_184241_ay = EntityDataManager.<Integer>func_187226_a(Entity.class, DataSerializers.field_187192_b);
  13662. private static final DataParameter<String> field_184242_az = EntityDataManager.<String>func_187226_a(Entity.class, DataSerializers.field_187194_d);
  13663. private static final DataParameter<Boolean> field_184233_aA = EntityDataManager.<Boolean>func_187226_a(Entity.class, DataSerializers.field_187198_h);
  13664. private static final DataParameter<Boolean> field_184234_aB = EntityDataManager.<Boolean>func_187226_a(Entity.class, DataSerializers.field_187198_h);
  13665. private static final DataParameter<Boolean> field_189655_aD = EntityDataManager.<Boolean>func_187226_a(Entity.class, DataSerializers.field_187198_h);
  13666. public boolean field_70175_ag;
  13667. public int field_70176_ah;
  13668. public int field_70162_ai;
  13669. public int field_70164_aj;
  13670. @SideOnly(Side.CLIENT)
  13671. public long field_70118_ct;
  13672. @SideOnly(Side.CLIENT)
  13673. public long field_70117_cu;
  13674. @SideOnly(Side.CLIENT)
  13675. public long field_70116_cv;
  13676. public boolean field_70158_ak;
  13677. public boolean field_70160_al;
  13678. public int field_71088_bW;
  13679. protected boolean field_71087_bX;
  13680. protected int field_82153_h;
  13681. public int field_71093_bK;
  13682. protected BlockPos field_181016_an;
  13683. protected Vec3d field_181017_ao;
  13684. protected EnumFacing field_181018_ap;
  13685. private boolean field_83001_bt;
  13686. protected UUID field_96093_i;
  13687. protected String field_189513_ar;
  13688. private final CommandResultStats field_174837_as;
  13689. protected boolean field_184238_ar;
  13690. private final Set<String> field_184236_aF;
  13691. private boolean field_184237_aG;
  13692. private final double[] field_191505_aI;
  13693. private long field_191506_aJ;
  13694.  
  13695. public Entity(World p_i1582_1_) {
  13696. this.field_145783_c = field_70152_a++;
  13697. this.field_184244_h = Lists.<Entity>newArrayList();
  13698. this.field_70121_D = field_174836_a;
  13699. this.field_70130_N = 0.6F;
  13700. this.field_70131_O = 1.8F;
  13701. this.field_70150_b = 1;
  13702. this.field_191959_ay = 1.0F;
  13703. this.field_70146_Z = new Random();
  13704. this.field_190534_ay = -this.func_190531_bD();
  13705. this.field_70148_d = true;
  13706. this.field_96093_i = MathHelper.func_180182_a(this.field_70146_Z);
  13707. this.field_189513_ar = this.field_96093_i.toString();
  13708. this.field_174837_as = new CommandResultStats();
  13709. this.field_184236_aF = Sets.<String>newHashSet();
  13710. this.field_191505_aI = new double[]{0.0D, 0.0D, 0.0D};
  13711. this.field_70170_p = p_i1582_1_;
  13712. this.func_70107_b(0.0D, 0.0D, 0.0D);
  13713. if(p_i1582_1_ != null) {
  13714. this.field_71093_bK = p_i1582_1_.field_73011_w.func_186058_p().func_186068_a();
  13715. }
  13716.  
  13717. this.field_70180_af = new EntityDataManager(this);
  13718. this.field_70180_af.func_187214_a(field_184240_ax, Byte.valueOf((byte)0));
  13719. this.field_70180_af.func_187214_a(field_184241_ay, Integer.valueOf(300));
  13720. this.field_70180_af.func_187214_a(field_184233_aA, Boolean.valueOf(false));
  13721. this.field_70180_af.func_187214_a(field_184242_az, "");
  13722. this.field_70180_af.func_187214_a(field_184234_aB, Boolean.valueOf(false));
  13723. this.field_70180_af.func_187214_a(field_189655_aD, Boolean.valueOf(false));
  13724. this.func_70088_a();
  13725. }
  13726.  
  13727. public int func_145782_y() {
  13728. return this.field_145783_c;
  13729. }
  13730.  
  13731. public void func_145769_d(int p_145769_1_) {
  13732. this.field_145783_c = p_145769_1_;
  13733. }
  13734.  
  13735. public Set<String> func_184216_O() {
  13736. return this.field_184236_aF;
  13737. }
  13738.  
  13739. public boolean func_184211_a(String p_184211_1_) {
  13740. if(this.field_184236_aF.size() >= 1024) {
  13741. return false;
  13742. } else {
  13743. this.field_184236_aF.add(p_184211_1_);
  13744. return true;
  13745. }
  13746. }
  13747.  
  13748. public boolean func_184197_b(String p_184197_1_) {
  13749. return this.field_184236_aF.remove(p_184197_1_);
  13750. }
  13751.  
  13752. public void func_174812_G() {
  13753. this.func_70106_y();
  13754. }
  13755.  
  13756. protected abstract void func_70088_a();
  13757.  
  13758. public EntityDataManager func_184212_Q() {
  13759. return this.field_70180_af;
  13760. }
  13761.  
  13762. public boolean equals(Object p_equals_1_) {
  13763. return p_equals_1_ instanceof Entity?((Entity)p_equals_1_).field_145783_c == this.field_145783_c:false;
  13764. }
  13765.  
  13766. public int hashCode() {
  13767. return this.field_145783_c;
  13768. }
  13769.  
  13770. @SideOnly(Side.CLIENT)
  13771. protected void func_70065_x() {
  13772. if(this.field_70170_p != null) {
  13773. while(this.field_70163_u > 0.0D && this.field_70163_u < 256.0D) {
  13774. this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v);
  13775. if(this.field_70170_p.func_184144_a(this, this.func_174813_aQ()).isEmpty()) {
  13776. break;
  13777. }
  13778.  
  13779. ++this.field_70163_u;
  13780. }
  13781.  
  13782. this.field_70159_w = 0.0D;
  13783. this.field_70181_x = 0.0D;
  13784. this.field_70179_y = 0.0D;
  13785. this.field_70125_A = 0.0F;
  13786. }
  13787. }
  13788.  
  13789. public void func_70106_y() {
  13790. this.field_70128_L = true;
  13791. }
  13792.  
  13793. public void func_184174_b(boolean p_184174_1_) {
  13794. }
  13795.  
  13796. protected void func_70105_a(float p_70105_1_, float p_70105_2_) {
  13797. if(p_70105_1_ != this.field_70130_N || p_70105_2_ != this.field_70131_O) {
  13798. float f = this.field_70130_N;
  13799. this.field_70130_N = p_70105_1_;
  13800. this.field_70131_O = p_70105_2_;
  13801. if(this.field_70130_N < f) {
  13802. double d0 = (double)p_70105_1_ / 2.0D;
  13803. this.func_174826_a(new AxisAlignedBB(this.field_70165_t - d0, this.field_70163_u, this.field_70161_v - d0, this.field_70165_t + d0, this.field_70163_u + (double)this.field_70131_O, this.field_70161_v + d0));
  13804. return;
  13805. }
  13806.  
  13807. AxisAlignedBB axisalignedbb = this.func_174813_aQ();
  13808. this.func_174826_a(new AxisAlignedBB(axisalignedbb.field_72340_a, axisalignedbb.field_72338_b, axisalignedbb.field_72339_c, axisalignedbb.field_72340_a + (double)this.field_70130_N, axisalignedbb.field_72338_b + (double)this.field_70131_O, axisalignedbb.field_72339_c + (double)this.field_70130_N));
  13809. if(this.field_70130_N > f && !this.field_70148_d && !this.field_70170_p.field_72995_K) {
  13810. this.func_70091_d(MoverType.SELF, (double)(f - this.field_70130_N), 0.0D, (double)(f - this.field_70130_N));
  13811. }
  13812. }
  13813.  
  13814. }
  13815.  
  13816. protected void func_70101_b(float p_70101_1_, float p_70101_2_) {
  13817. this.field_70177_z = p_70101_1_ % 360.0F;
  13818. this.field_70125_A = p_70101_2_ % 360.0F;
  13819. }
  13820.  
  13821. public void func_70107_b(double p_70107_1_, double p_70107_3_, double p_70107_5_) {
  13822. this.field_70165_t = p_70107_1_;
  13823. this.field_70163_u = p_70107_3_;
  13824. this.field_70161_v = p_70107_5_;
  13825. float f = this.field_70130_N / 2.0F;
  13826. float f1 = this.field_70131_O;
  13827. this.func_174826_a(new AxisAlignedBB(p_70107_1_ - (double)f, p_70107_3_, p_70107_5_ - (double)f, p_70107_1_ + (double)f, p_70107_3_ + (double)f1, p_70107_5_ + (double)f));
  13828. }
  13829.  
  13830. @SideOnly(Side.CLIENT)
  13831. public void func_70082_c(float p_70082_1_, float p_70082_2_) {
  13832. float f = this.field_70125_A;
  13833. float f1 = this.field_70177_z;
  13834. this.field_70177_z = (float)((double)this.field_70177_z + (double)p_70082_1_ * 0.15D);
  13835. this.field_70125_A = (float)((double)this.field_70125_A - (double)p_70082_2_ * 0.15D);
  13836. this.field_70125_A = MathHelper.func_76131_a(this.field_70125_A, -90.0F, 90.0F);
  13837. this.field_70127_C += this.field_70125_A - f;
  13838. this.field_70126_B += this.field_70177_z - f1;
  13839. if(this.field_184239_as != null) {
  13840. this.field_184239_as.func_184190_l(this);
  13841. }
  13842.  
  13843. }
  13844.  
  13845. public void func_70071_h_() {
  13846. if(!this.field_70170_p.field_72995_K) {
  13847. this.func_70052_a(6, this.func_184202_aL());
  13848. }
  13849.  
  13850. this.func_70030_z();
  13851. }
  13852.  
  13853. public void func_70030_z() {
  13854. this.field_70170_p.field_72984_F.func_76320_a("entityBaseTick");
  13855. if(this.func_184218_aH() && this.func_184187_bx().field_70128_L) {
  13856. this.func_184210_p();
  13857. }
  13858.  
  13859. if(this.field_184245_j > 0) {
  13860. --this.field_184245_j;
  13861. }
  13862.  
  13863. this.field_70141_P = this.field_70140_Q;
  13864. this.field_70169_q = this.field_70165_t;
  13865. this.field_70167_r = this.field_70163_u;
  13866. this.field_70166_s = this.field_70161_v;
  13867. this.field_70127_C = this.field_70125_A;
  13868. this.field_70126_B = this.field_70177_z;
  13869. if(!this.field_70170_p.field_72995_K && this.field_70170_p instanceof WorldServer) {
  13870. this.field_70170_p.field_72984_F.func_76320_a("portal");
  13871. if(this.field_71087_bX) {
  13872. MinecraftServer minecraftserver = this.field_70170_p.func_73046_m();
  13873. if(minecraftserver.func_71255_r()) {
  13874. if(!this.func_184218_aH()) {
  13875. int i = this.func_82145_z();
  13876. if(this.field_82153_h++ >= i) {
  13877. this.field_82153_h = i;
  13878. this.field_71088_bW = this.func_82147_ab();
  13879. int j;
  13880. if(this.field_70170_p.field_73011_w.func_186058_p().func_186068_a() == -1) {
  13881. j = 0;
  13882. } else {
  13883. j = -1;
  13884. }
  13885.  
  13886. this.func_184204_a(j);
  13887. }
  13888. }
  13889.  
  13890. this.field_71087_bX = false;
  13891. }
  13892. } else {
  13893. if(this.field_82153_h > 0) {
  13894. this.field_82153_h -= 4;
  13895. }
  13896.  
  13897. if(this.field_82153_h < 0) {
  13898. this.field_82153_h = 0;
  13899. }
  13900. }
  13901.  
  13902. this.func_184173_H();
  13903. this.field_70170_p.field_72984_F.func_76319_b();
  13904. }
  13905.  
  13906. this.func_174830_Y();
  13907. this.func_70072_I();
  13908. if(this.field_70170_p.field_72995_K) {
  13909. this.func_70066_B();
  13910. } else if(this.field_190534_ay > 0) {
  13911. if(this.field_70178_ae) {
  13912. this.field_190534_ay -= 4;
  13913. if(this.field_190534_ay < 0) {
  13914. this.func_70066_B();
  13915. }
  13916. } else {
  13917. if(this.field_190534_ay % 20 == 0) {
  13918. this.func_70097_a(DamageSource.field_76370_b, 1.0F);
  13919. }
  13920.  
  13921. --this.field_190534_ay;
  13922. }
  13923. }
  13924.  
  13925. if(this.func_180799_ab()) {
  13926. this.func_70044_A();
  13927. this.field_70143_R *= 0.5F;
  13928. }
  13929.  
  13930. if(this.field_70163_u < -64.0D) {
  13931. this.func_70076_C();
  13932. }
  13933.  
  13934. if(!this.field_70170_p.field_72995_K) {
  13935. this.func_70052_a(0, this.field_190534_ay > 0);
  13936. }
  13937.  
  13938. this.field_70148_d = false;
  13939. this.field_70170_p.field_72984_F.func_76319_b();
  13940. }
  13941.  
  13942. protected void func_184173_H() {
  13943. if(this.field_71088_bW > 0) {
  13944. --this.field_71088_bW;
  13945. }
  13946.  
  13947. }
  13948.  
  13949. public int func_82145_z() {
  13950. return 1;
  13951. }
  13952.  
  13953. protected void func_70044_A() {
  13954. if(!this.field_70178_ae) {
  13955. this.func_70097_a(DamageSource.field_76371_c, 4.0F);
  13956. this.func_70015_d(15);
  13957. }
  13958. }
  13959.  
  13960. public void func_70015_d(int p_70015_1_) {
  13961. int i = p_70015_1_ * 20;
  13962. if(this instanceof EntityLivingBase) {
  13963. i = EnchantmentProtection.func_92093_a((EntityLivingBase)this, i);
  13964. }
  13965.  
  13966. if(this.field_190534_ay < i) {
  13967. this.field_190534_ay = i;
  13968. }
  13969.  
  13970. }
  13971.  
  13972. public void func_70066_B() {
  13973. this.field_190534_ay = 0;
  13974. }
  13975.  
  13976. protected void func_70076_C() {
  13977. this.func_70106_y();
  13978. }
  13979.  
  13980. public boolean func_70038_c(double p_70038_1_, double p_70038_3_, double p_70038_5_) {
  13981. AxisAlignedBB axisalignedbb = this.func_174813_aQ().func_72317_d(p_70038_1_, p_70038_3_, p_70038_5_);
  13982. return this.func_174809_b(axisalignedbb);
  13983. }
  13984.  
  13985. private boolean func_174809_b(AxisAlignedBB p_174809_1_) {
  13986. return this.field_70170_p.func_184144_a(this, p_174809_1_).isEmpty() && !this.field_70170_p.func_72953_d(p_174809_1_);
  13987. }
  13988.  
  13989. public void func_70091_d(MoverType p_70091_1_, double p_70091_2_, double p_70091_4_, double p_70091_6_) {
  13990. if(this.field_70145_X) {
  13991. this.func_174826_a(this.func_174813_aQ().func_72317_d(p_70091_2_, p_70091_4_, p_70091_6_));
  13992. this.func_174829_m();
  13993. } else {
  13994. if(p_70091_1_ == MoverType.PISTON) {
  13995. long i = this.field_70170_p.func_82737_E();
  13996. if(i != this.field_191506_aJ) {
  13997. Arrays.fill(this.field_191505_aI, 0.0D);
  13998. this.field_191506_aJ = i;
  13999. }
  14000.  
  14001. if(p_70091_2_ != 0.0D) {
  14002. int j = EnumFacing.Axis.X.ordinal();
  14003. double d0 = MathHelper.func_151237_a(p_70091_2_ + this.field_191505_aI[j], -0.51D, 0.51D);
  14004. p_70091_2_ = d0 - this.field_191505_aI[j];
  14005. this.field_191505_aI[j] = d0;
  14006. if(Math.abs(p_70091_2_) <= 9.999999747378752E-6D) {
  14007. return;
  14008. }
  14009. } else if(p_70091_4_ != 0.0D) {
  14010. int l4 = EnumFacing.Axis.Y.ordinal();
  14011. double d12 = MathHelper.func_151237_a(p_70091_4_ + this.field_191505_aI[l4], -0.51D, 0.51D);
  14012. p_70091_4_ = d12 - this.field_191505_aI[l4];
  14013. this.field_191505_aI[l4] = d12;
  14014. if(Math.abs(p_70091_4_) <= 9.999999747378752E-6D) {
  14015. return;
  14016. }
  14017. } else {
  14018. if(p_70091_6_ == 0.0D) {
  14019. return;
  14020. }
  14021.  
  14022. int i5 = EnumFacing.Axis.Z.ordinal();
  14023. double d13 = MathHelper.func_151237_a(p_70091_6_ + this.field_191505_aI[i5], -0.51D, 0.51D);
  14024. p_70091_6_ = d13 - this.field_191505_aI[i5];
  14025. this.field_191505_aI[i5] = d13;
  14026. if(Math.abs(p_70091_6_) <= 9.999999747378752E-6D) {
  14027. return;
  14028. }
  14029. }
  14030. }
  14031.  
  14032. this.field_70170_p.field_72984_F.func_76320_a("move");
  14033. double d10 = this.field_70165_t;
  14034. double d11 = this.field_70163_u;
  14035. double d1 = this.field_70161_v;
  14036. if(this.field_70134_J) {
  14037. this.field_70134_J = false;
  14038. p_70091_2_ *= 0.25D;
  14039. p_70091_4_ *= 0.05000000074505806D;
  14040. p_70091_6_ *= 0.25D;
  14041. this.field_70159_w = 0.0D;
  14042. this.field_70181_x = 0.0D;
  14043. this.field_70179_y = 0.0D;
  14044. }
  14045.  
  14046. double d2 = p_70091_2_;
  14047. double d3 = p_70091_4_;
  14048. double d4 = p_70091_6_;
  14049. if((p_70091_1_ == MoverType.SELF || p_70091_1_ == MoverType.PLAYER) && this.field_70122_E && this.func_70093_af() && this instanceof EntityPlayer) {
  14050. for(double d5 = 0.05D; p_70091_2_ != 0.0D && this.field_70170_p.func_184144_a(this, this.func_174813_aQ().func_72317_d(p_70091_2_, (double)(-this.field_70138_W), 0.0D)).isEmpty(); d2 = p_70091_2_) {
  14051. if(p_70091_2_ < 0.05D && p_70091_2_ >= -0.05D) {
  14052. p_70091_2_ = 0.0D;
  14053. } else if(p_70091_2_ > 0.0D) {
  14054. p_70091_2_ -= 0.05D;
  14055. } else {
  14056. p_70091_2_ += 0.05D;
  14057. }
  14058. }
  14059.  
  14060. for(; p_70091_6_ != 0.0D && this.field_70170_p.func_184144_a(this, this.func_174813_aQ().func_72317_d(0.0D, (double)(-this.field_70138_W), p_70091_6_)).isEmpty(); d4 = p_70091_6_) {
  14061. if(p_70091_6_ < 0.05D && p_70091_6_ >= -0.05D) {
  14062. p_70091_6_ = 0.0D;
  14063. } else if(p_70091_6_ > 0.0D) {
  14064. p_70091_6_ -= 0.05D;
  14065. } else {
  14066. p_70091_6_ += 0.05D;
  14067. }
  14068. }
  14069.  
  14070. for(; p_70091_2_ != 0.0D && p_70091_6_ != 0.0D && this.field_70170_p.func_184144_a(this, this.func_174813_aQ().func_72317_d(p_70091_2_, (double)(-this.field_70138_W), p_70091_6_)).isEmpty(); d4 = p_70091_6_) {
  14071. if(p_70091_2_ < 0.05D && p_70091_2_ >= -0.05D) {
  14072. p_70091_2_ = 0.0D;
  14073. } else if(p_70091_2_ > 0.0D) {
  14074. p_70091_2_ -= 0.05D;
  14075. } else {
  14076. p_70091_2_ += 0.05D;
  14077. }
  14078.  
  14079. d2 = p_70091_2_;
  14080. if(p_70091_6_ < 0.05D && p_70091_6_ >= -0.05D) {
  14081. p_70091_6_ = 0.0D;
  14082. } else if(p_70091_6_ > 0.0D) {
  14083. p_70091_6_ -= 0.05D;
  14084. } else {
  14085. p_70091_6_ += 0.05D;
  14086. }
  14087. }
  14088. }
  14089.  
  14090. List<AxisAlignedBB> list1 = this.field_70170_p.func_184144_a(this, this.func_174813_aQ().func_72321_a(p_70091_2_, p_70091_4_, p_70091_6_));
  14091. AxisAlignedBB axisalignedbb = this.func_174813_aQ();
  14092. if(p_70091_4_ != 0.0D) {
  14093. int k = 0;
  14094.  
  14095. for(int l = list1.size(); k < l; ++k) {
  14096. p_70091_4_ = ((AxisAlignedBB)list1.get(k)).func_72323_b(this.func_174813_aQ(), p_70091_4_);
  14097. }
  14098.  
  14099. this.func_174826_a(this.func_174813_aQ().func_72317_d(0.0D, p_70091_4_, 0.0D));
  14100. }
  14101.  
  14102. if(p_70091_2_ != 0.0D) {
  14103. int j5 = 0;
  14104.  
  14105. for(int l5 = list1.size(); j5 < l5; ++j5) {
  14106. p_70091_2_ = ((AxisAlignedBB)list1.get(j5)).func_72316_a(this.func_174813_aQ(), p_70091_2_);
  14107. }
  14108.  
  14109. if(p_70091_2_ != 0.0D) {
  14110. this.func_174826_a(this.func_174813_aQ().func_72317_d(p_70091_2_, 0.0D, 0.0D));
  14111. }
  14112. }
  14113.  
  14114. if(p_70091_6_ != 0.0D) {
  14115. int k5 = 0;
  14116.  
  14117. for(int i6 = list1.size(); k5 < i6; ++k5) {
  14118. p_70091_6_ = ((AxisAlignedBB)list1.get(k5)).func_72322_c(this.func_174813_aQ(), p_70091_6_);
  14119. }
  14120.  
  14121. if(p_70091_6_ != 0.0D) {
  14122. this.func_174826_a(this.func_174813_aQ().func_72317_d(0.0D, 0.0D, p_70091_6_));
  14123. }
  14124. }
  14125.  
  14126. boolean flag = this.field_70122_E || p_70091_4_ != p_70091_4_ && p_70091_4_ < 0.0D;
  14127. if(this.field_70138_W > 0.0F && flag && (d2 != p_70091_2_ || d4 != p_70091_6_)) {
  14128. double d14 = p_70091_2_;
  14129. double d6 = p_70091_4_;
  14130. double d7 = p_70091_6_;
  14131. AxisAlignedBB axisalignedbb1 = this.func_174813_aQ();
  14132. this.func_174826_a(axisalignedbb);
  14133. p_70091_4_ = (double)this.field_70138_W;
  14134. List<AxisAlignedBB> list = this.field_70170_p.func_184144_a(this, this.func_174813_aQ().func_72321_a(d2, p_70091_4_, d4));
  14135. AxisAlignedBB axisalignedbb2 = this.func_174813_aQ();
  14136. AxisAlignedBB axisalignedbb3 = axisalignedbb2.func_72321_a(d2, 0.0D, d4);
  14137. double d8 = p_70091_4_;
  14138. int j1 = 0;
  14139.  
  14140. for(int k1 = list.size(); j1 < k1; ++j1) {
  14141. d8 = ((AxisAlignedBB)list.get(j1)).func_72323_b(axisalignedbb3, d8);
  14142. }
  14143.  
  14144. axisalignedbb2 = axisalignedbb2.func_72317_d(0.0D, d8, 0.0D);
  14145. double d18 = d2;
  14146. int l1 = 0;
  14147.  
  14148. for(int i2 = list.size(); l1 < i2; ++l1) {
  14149. d18 = ((AxisAlignedBB)list.get(l1)).func_72316_a(axisalignedbb2, d18);
  14150. }
  14151.  
  14152. axisalignedbb2 = axisalignedbb2.func_72317_d(d18, 0.0D, 0.0D);
  14153. double d19 = d4;
  14154. int j2 = 0;
  14155.  
  14156. for(int k2 = list.size(); j2 < k2; ++j2) {
  14157. d19 = ((AxisAlignedBB)list.get(j2)).func_72322_c(axisalignedbb2, d19);
  14158. }
  14159.  
  14160. axisalignedbb2 = axisalignedbb2.func_72317_d(0.0D, 0.0D, d19);
  14161. AxisAlignedBB axisalignedbb4 = this.func_174813_aQ();
  14162. double d20 = p_70091_4_;
  14163. int l2 = 0;
  14164.  
  14165. for(int i3 = list.size(); l2 < i3; ++l2) {
  14166. d20 = ((AxisAlignedBB)list.get(l2)).func_72323_b(axisalignedbb4, d20);
  14167. }
  14168.  
  14169. axisalignedbb4 = axisalignedbb4.func_72317_d(0.0D, d20, 0.0D);
  14170. double d21 = d2;
  14171. int j3 = 0;
  14172.  
  14173. for(int k3 = list.size(); j3 < k3; ++j3) {
  14174. d21 = ((AxisAlignedBB)list.get(j3)).func_72316_a(axisalignedbb4, d21);
  14175. }
  14176.  
  14177. axisalignedbb4 = axisalignedbb4.func_72317_d(d21, 0.0D, 0.0D);
  14178. double d22 = d4;
  14179. int l3 = 0;
  14180.  
  14181. for(int i4 = list.size(); l3 < i4; ++l3) {
  14182. d22 = ((AxisAlignedBB)list.get(l3)).func_72322_c(axisalignedbb4, d22);
  14183. }
  14184.  
  14185. axisalignedbb4 = axisalignedbb4.func_72317_d(0.0D, 0.0D, d22);
  14186. double d23 = d18 * d18 + d19 * d19;
  14187. double d9 = d21 * d21 + d22 * d22;
  14188. if(d23 > d9) {
  14189. p_70091_2_ = d18;
  14190. p_70091_6_ = d19;
  14191. p_70091_4_ = -d8;
  14192. this.func_174826_a(axisalignedbb2);
  14193. } else {
  14194. p_70091_2_ = d21;
  14195. p_70091_6_ = d22;
  14196. p_70091_4_ = -d20;
  14197. this.func_174826_a(axisalignedbb4);
  14198. }
  14199.  
  14200. int j4 = 0;
  14201.  
  14202. for(int k4 = list.size(); j4 < k4; ++j4) {
  14203. p_70091_4_ = ((AxisAlignedBB)list.get(j4)).func_72323_b(this.func_174813_aQ(), p_70091_4_);
  14204. }
  14205.  
  14206. this.func_174826_a(this.func_174813_aQ().func_72317_d(0.0D, p_70091_4_, 0.0D));
  14207. if(d14 * d14 + d7 * d7 >= p_70091_2_ * p_70091_2_ + p_70091_6_ * p_70091_6_) {
  14208. p_70091_2_ = d14;
  14209. p_70091_4_ = d6;
  14210. p_70091_6_ = d7;
  14211. this.func_174826_a(axisalignedbb1);
  14212. }
  14213. }
  14214.  
  14215. this.field_70170_p.field_72984_F.func_76319_b();
  14216. this.field_70170_p.field_72984_F.func_76320_a("rest");
  14217. this.func_174829_m();
  14218. this.field_70123_F = d2 != p_70091_2_ || d4 != p_70091_6_;
  14219. this.field_70124_G = p_70091_4_ != p_70091_4_;
  14220. this.field_70122_E = this.field_70124_G && d3 < 0.0D;
  14221. this.field_70132_H = this.field_70123_F || this.field_70124_G;
  14222. int j6 = MathHelper.func_76128_c(this.field_70165_t);
  14223. int i1 = MathHelper.func_76128_c(this.field_70163_u - 0.20000000298023224D);
  14224. int k6 = MathHelper.func_76128_c(this.field_70161_v);
  14225. BlockPos blockpos = new BlockPos(j6, i1, k6);
  14226. IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos);
  14227. if(iblockstate.func_185904_a() == Material.field_151579_a) {
  14228. BlockPos blockpos1 = blockpos.func_177977_b();
  14229. IBlockState iblockstate1 = this.field_70170_p.func_180495_p(blockpos1);
  14230. Block block1 = iblockstate1.func_177230_c();
  14231. if(block1 instanceof BlockFence || block1 instanceof BlockWall || block1 instanceof BlockFenceGate) {
  14232. iblockstate = iblockstate1;
  14233. blockpos = blockpos1;
  14234. }
  14235. }
  14236.  
  14237. this.func_184231_a(p_70091_4_, this.field_70122_E, iblockstate, blockpos);
  14238. if(d2 != p_70091_2_) {
  14239. this.field_70159_w = 0.0D;
  14240. }
  14241.  
  14242. if(d4 != p_70091_6_) {
  14243. this.field_70179_y = 0.0D;
  14244. }
  14245.  
  14246. Block block = iblockstate.func_177230_c();
  14247. if(d3 != p_70091_4_) {
  14248. block.func_176216_a(this.field_70170_p, this);
  14249. }
  14250.  
  14251. if(this.func_70041_e_() && (!this.field_70122_E || !this.func_70093_af() || !(this instanceof EntityPlayer)) && !this.func_184218_aH()) {
  14252. double d15 = this.field_70165_t - d10;
  14253. double d16 = this.field_70163_u - d11;
  14254. double d17 = this.field_70161_v - d1;
  14255. if(block != Blocks.field_150468_ap) {
  14256. d16 = 0.0D;
  14257. }
  14258.  
  14259. if(block != null && this.field_70122_E) {
  14260. block.func_176199_a(this.field_70170_p, blockpos, this);
  14261. }
  14262.  
  14263. this.field_70140_Q = (float)((double)this.field_70140_Q + (double)MathHelper.func_76133_a(d15 * d15 + d17 * d17) * 0.6D);
  14264. this.field_82151_R = (float)((double)this.field_82151_R + (double)MathHelper.func_76133_a(d15 * d15 + d16 * d16 + d17 * d17) * 0.6D);
  14265. if(this.field_82151_R > (float)this.field_70150_b && iblockstate.func_185904_a() != Material.field_151579_a) {
  14266. this.field_70150_b = (int)this.field_82151_R + 1;
  14267. if(this.func_70090_H()) {
  14268. Entity entity = this.func_184207_aI() && this.func_184179_bs() != null?this.func_184179_bs():this;
  14269. float f = entity == this?0.35F:0.4F;
  14270. float f1 = MathHelper.func_76133_a(entity.field_70159_w * entity.field_70159_w * 0.20000000298023224D + entity.field_70181_x * entity.field_70181_x + entity.field_70179_y * entity.field_70179_y * 0.20000000298023224D) * f;
  14271. if(f1 > 1.0F) {
  14272. f1 = 1.0F;
  14273. }
  14274.  
  14275. this.func_184185_a(this.func_184184_Z(), f1, 1.0F + (this.field_70146_Z.nextFloat() - this.field_70146_Z.nextFloat()) * 0.4F);
  14276. } else {
  14277. this.func_180429_a(blockpos, block);
  14278. }
  14279. } else if(this.field_82151_R > this.field_191959_ay && this.func_191957_ae() && iblockstate.func_185904_a() == Material.field_151579_a) {
  14280. this.field_191959_ay = this.func_191954_d(this.field_82151_R);
  14281. }
  14282. }
  14283.  
  14284. try {
  14285. this.func_145775_I();
  14286. } catch (Throwable throwable) {
  14287. CrashReport crashreport = CrashReport.func_85055_a(throwable, "Checking entity block collision");
  14288. CrashReportCategory crashreportcategory = crashreport.func_85058_a("Entity being checked for collision");
  14289. this.func_85029_a(crashreportcategory);
  14290. throw new ReportedException(crashreport);
  14291. }
  14292.  
  14293. boolean flag1 = this.func_70026_G();
  14294. if(this.field_70170_p.func_147470_e(this.func_174813_aQ().func_186664_h(0.001D))) {
  14295. this.func_70081_e(1);
  14296. if(!flag1) {
  14297. ++this.field_190534_ay;
  14298. if(this.field_190534_ay == 0) {
  14299. this.func_70015_d(8);
  14300. }
  14301. }
  14302. } else if(this.field_190534_ay <= 0) {
  14303. this.field_190534_ay = -this.func_190531_bD();
  14304. }
  14305.  
  14306. if(flag1 && this.func_70027_ad()) {
  14307. this.func_184185_a(SoundEvents.field_187541_bC, 0.7F, 1.6F + (this.field_70146_Z.nextFloat() - this.field_70146_Z.nextFloat()) * 0.4F);
  14308. this.field_190534_ay = -this.func_190531_bD();
  14309. }
  14310.  
  14311. this.field_70170_p.field_72984_F.func_76319_b();
  14312. }
  14313. }
  14314.  
  14315. public void func_174829_m() {
  14316. AxisAlignedBB axisalignedbb = this.func_174813_aQ();
  14317. this.field_70165_t = (axisalignedbb.field_72340_a + axisalignedbb.field_72336_d) / 2.0D;
  14318. this.field_70163_u = axisalignedbb.field_72338_b;
  14319. this.field_70161_v = (axisalignedbb.field_72339_c + axisalignedbb.field_72334_f) / 2.0D;
  14320. }
  14321.  
  14322. protected SoundEvent func_184184_Z() {
  14323. return SoundEvents.field_187549_bG;
  14324. }
  14325.  
  14326. protected SoundEvent func_184181_aa() {
  14327. return SoundEvents.field_187547_bF;
  14328. }
  14329.  
  14330. protected void func_145775_I() {
  14331. AxisAlignedBB axisalignedbb = this.func_174813_aQ();
  14332. BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185345_c(axisalignedbb.field_72340_a + 0.001D, axisalignedbb.field_72338_b + 0.001D, axisalignedbb.field_72339_c + 0.001D);
  14333. BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos1 = BlockPos.PooledMutableBlockPos.func_185345_c(axisalignedbb.field_72336_d - 0.001D, axisalignedbb.field_72337_e - 0.001D, axisalignedbb.field_72334_f - 0.001D);
  14334. BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos2 = BlockPos.PooledMutableBlockPos.func_185346_s();
  14335. if(this.field_70170_p.func_175707_a(blockpos$pooledmutableblockpos, blockpos$pooledmutableblockpos1)) {
  14336. for(int i = blockpos$pooledmutableblockpos.func_177958_n(); i <= blockpos$pooledmutableblockpos1.func_177958_n(); ++i) {
  14337. for(int j = blockpos$pooledmutableblockpos.func_177956_o(); j <= blockpos$pooledmutableblockpos1.func_177956_o(); ++j) {
  14338. for(int k = blockpos$pooledmutableblockpos.func_177952_p(); k <= blockpos$pooledmutableblockpos1.func_177952_p(); ++k) {
  14339. blockpos$pooledmutableblockpos2.func_181079_c(i, j, k);
  14340. IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos$pooledmutableblockpos2);
  14341.  
  14342. try {
  14343. iblockstate.func_177230_c().func_180634_a(this.field_70170_p, blockpos$pooledmutableblockpos2, iblockstate, this);
  14344. this.func_191955_a(iblockstate);
  14345. } catch (Throwable throwable) {
  14346. CrashReport crashreport = CrashReport.func_85055_a(throwable, "Colliding entity with block");
  14347. CrashReportCategory crashreportcategory = crashreport.func_85058_a("Block being collided with");
  14348. CrashReportCategory.func_175750_a(crashreportcategory, blockpos$pooledmutableblockpos2, iblockstate);
  14349. throw new ReportedException(crashreport);
  14350. }
  14351. }
  14352. }
  14353. }
  14354. }
  14355.  
  14356. blockpos$pooledmutableblockpos.func_185344_t();
  14357. blockpos$pooledmutableblockpos1.func_185344_t();
  14358. blockpos$pooledmutableblockpos2.func_185344_t();
  14359. }
  14360.  
  14361. protected void func_191955_a(IBlockState p_191955_1_) {
  14362. }
  14363.  
  14364. protected void func_180429_a(BlockPos p_180429_1_, Block p_180429_2_) {
  14365. SoundType soundtype = p_180429_2_.func_185467_w();
  14366. if(this.field_70170_p.func_180495_p(p_180429_1_.func_177984_a()).func_177230_c() == Blocks.field_150431_aC) {
  14367. soundtype = Blocks.field_150431_aC.func_185467_w();
  14368. this.func_184185_a(soundtype.func_185844_d(), soundtype.func_185843_a() * 0.15F, soundtype.func_185847_b());
  14369. } else if(!p_180429_2_.func_176223_P().func_185904_a().func_76224_d()) {
  14370. this.func_184185_a(soundtype.func_185844_d(), soundtype.func_185843_a() * 0.15F, soundtype.func_185847_b());
  14371. }
  14372.  
  14373. }
  14374.  
  14375. protected float func_191954_d(float p_191954_1_) {
  14376. return 0.0F;
  14377. }
  14378.  
  14379. protected boolean func_191957_ae() {
  14380. return false;
  14381. }
  14382.  
  14383. public void func_184185_a(SoundEvent p_184185_1_, float p_184185_2_, float p_184185_3_) {
  14384. if(!this.func_174814_R()) {
  14385. this.field_70170_p.func_184148_a((EntityPlayer)null, this.field_70165_t, this.field_70163_u, this.field_70161_v, p_184185_1_, this.func_184176_by(), p_184185_2_, p_184185_3_);
  14386. }
  14387.  
  14388. }
  14389.  
  14390. public boolean func_174814_R() {
  14391. return ((Boolean)this.field_70180_af.func_187225_a(field_184234_aB)).booleanValue();
  14392. }
  14393.  
  14394. public void func_174810_b(boolean p_174810_1_) {
  14395. this.field_70180_af.func_187227_b(field_184234_aB, Boolean.valueOf(p_174810_1_));
  14396. }
  14397.  
  14398. public boolean func_189652_ae() {
  14399. return ((Boolean)this.field_70180_af.func_187225_a(field_189655_aD)).booleanValue();
  14400. }
  14401.  
  14402. public void func_189654_d(boolean p_189654_1_) {
  14403. this.field_70180_af.func_187227_b(field_189655_aD, Boolean.valueOf(p_189654_1_));
  14404. }
  14405.  
  14406. protected boolean func_70041_e_() {
  14407. return true;
  14408. }
  14409.  
  14410. protected void func_184231_a(double p_184231_1_, boolean p_184231_3_, IBlockState p_184231_4_, BlockPos p_184231_5_) {
  14411. if(p_184231_3_) {
  14412. if(this.field_70143_R > 0.0F) {
  14413. p_184231_4_.func_177230_c().func_180658_a(this.field_70170_p, p_184231_5_, this, this.field_70143_R);
  14414. }
  14415.  
  14416. this.field_70143_R = 0.0F;
  14417. } else if(p_184231_1_ < 0.0D) {
  14418. this.field_70143_R = (float)((double)this.field_70143_R - p_184231_1_);
  14419. }
  14420.  
  14421. }
  14422.  
  14423. @Nullable
  14424. public AxisAlignedBB func_70046_E() {
  14425. return null;
  14426. }
  14427.  
  14428. protected void func_70081_e(int p_70081_1_) {
  14429. if(!this.field_70178_ae) {
  14430. this.func_70097_a(DamageSource.field_76372_a, (float)p_70081_1_);
  14431. }
  14432.  
  14433. }
  14434.  
  14435. public final boolean func_70045_F() {
  14436. return this.field_70178_ae;
  14437. }
  14438.  
  14439. public void func_180430_e(float p_180430_1_, float p_180430_2_) {
  14440. if(this.func_184207_aI()) {
  14441. for(Entity entity : this.func_184188_bt()) {
  14442. entity.func_180430_e(p_180430_1_, p_180430_2_);
  14443. }
  14444. }
  14445.  
  14446. }
  14447.  
  14448. public boolean func_70026_G() {
  14449. if(this.field_70171_ac) {
  14450. return true;
  14451. } else {
  14452. BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185345_c(this.field_70165_t, this.field_70163_u, this.field_70161_v);
  14453. if(!this.field_70170_p.func_175727_C(blockpos$pooledmutableblockpos) && !this.field_70170_p.func_175727_C(blockpos$pooledmutableblockpos.func_189532_c(this.field_70165_t, this.field_70163_u + (double)this.field_70131_O, this.field_70161_v))) {
  14454. blockpos$pooledmutableblockpos.func_185344_t();
  14455. return false;
  14456. } else {
  14457. blockpos$pooledmutableblockpos.func_185344_t();
  14458. return true;
  14459. }
  14460. }
  14461. }
  14462.  
  14463. public boolean func_70090_H() {
  14464. return this.field_70171_ac;
  14465. }
  14466.  
  14467. public boolean func_191953_am() {
  14468. return this.field_70170_p.func_72918_a(this.func_174813_aQ().func_72314_b(0.0D, -20.0D, 0.0D).func_186664_h(0.001D), Material.field_151586_h, this);
  14469. }
  14470.  
  14471. public boolean func_70072_I() {
  14472. if(this.func_184187_bx() instanceof EntityBoat) {
  14473. this.field_70171_ac = false;
  14474. } else if(this.field_70170_p.func_72918_a(this.func_174813_aQ().func_72314_b(0.0D, -0.4000000059604645D, 0.0D).func_186664_h(0.001D), Material.field_151586_h, this)) {
  14475. if(!this.field_70171_ac && !this.field_70148_d) {
  14476. this.func_71061_d_();
  14477. }
  14478.  
  14479. this.field_70143_R = 0.0F;
  14480. this.field_70171_ac = true;
  14481. this.func_70066_B();
  14482. } else {
  14483. this.field_70171_ac = false;
  14484. }
  14485.  
  14486. return this.field_70171_ac;
  14487. }
  14488.  
  14489. protected void func_71061_d_() {
  14490. Entity entity = this.func_184207_aI() && this.func_184179_bs() != null?this.func_184179_bs():this;
  14491. float f = entity == this?0.2F:0.9F;
  14492. float f1 = MathHelper.func_76133_a(entity.field_70159_w * entity.field_70159_w * 0.20000000298023224D + entity.field_70181_x * entity.field_70181_x + entity.field_70179_y * entity.field_70179_y * 0.20000000298023224D) * f;
  14493. if(f1 > 1.0F) {
  14494. f1 = 1.0F;
  14495. }
  14496.  
  14497. this.func_184185_a(this.func_184181_aa(), f1, 1.0F + (this.field_70146_Z.nextFloat() - this.field_70146_Z.nextFloat()) * 0.4F);
  14498. float f2 = (float)MathHelper.func_76128_c(this.func_174813_aQ().field_72338_b);
  14499.  
  14500. for(int i = 0; (float)i < 1.0F + this.field_70130_N * 20.0F; ++i) {
  14501. float f3 = (this.field_70146_Z.nextFloat() * 2.0F - 1.0F) * this.field_70130_N;
  14502. float f4 = (this.field_70146_Z.nextFloat() * 2.0F - 1.0F) * this.field_70130_N;
  14503. this.field_70170_p.func_175688_a(EnumParticleTypes.WATER_BUBBLE, this.field_70165_t + (double)f3, (double)(f2 + 1.0F), this.field_70161_v + (double)f4, this.field_70159_w, this.field_70181_x - (double)(this.field_70146_Z.nextFloat() * 0.2F), this.field_70179_y, new int[0]);
  14504. }
  14505.  
  14506. for(int j = 0; (float)j < 1.0F + this.field_70130_N * 20.0F; ++j) {
  14507. float f5 = (this.field_70146_Z.nextFloat() * 2.0F - 1.0F) * this.field_70130_N;
  14508. float f6 = (this.field_70146_Z.nextFloat() * 2.0F - 1.0F) * this.field_70130_N;
  14509. this.field_70170_p.func_175688_a(EnumParticleTypes.WATER_SPLASH, this.field_70165_t + (double)f5, (double)(f2 + 1.0F), this.field_70161_v + (double)f6, this.field_70159_w, this.field_70181_x, this.field_70179_y, new int[0]);
  14510. }
  14511.  
  14512. }
  14513.  
  14514. public void func_174830_Y() {
  14515. if(this.func_70051_ag() && !this.func_70090_H()) {
  14516. this.func_174808_Z();
  14517. }
  14518.  
  14519. }
  14520.  
  14521. protected void func_174808_Z() {
  14522. int i = MathHelper.func_76128_c(this.field_70165_t);
  14523. int j = MathHelper.func_76128_c(this.field_70163_u - 0.20000000298023224D);
  14524. int k = MathHelper.func_76128_c(this.field_70161_v);
  14525. BlockPos blockpos = new BlockPos(i, j, k);
  14526. IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos);
  14527. if(iblockstate.func_185901_i() != EnumBlockRenderType.INVISIBLE) {
  14528. this.field_70170_p.func_175688_a(EnumParticleTypes.BLOCK_CRACK, this.field_70165_t + ((double)this.field_70146_Z.nextFloat() - 0.5D) * (double)this.field_70130_N, this.func_174813_aQ().field_72338_b + 0.1D, this.field_70161_v + ((double)this.field_70146_Z.nextFloat() - 0.5D) * (double)this.field_70130_N, -this.field_70159_w * 4.0D, 1.5D, -this.field_70179_y * 4.0D, new int[]{Block.func_176210_f(iblockstate)});
  14529. }
  14530.  
  14531. }
  14532.  
  14533. public boolean func_70055_a(Material p_70055_1_) {
  14534. if(this.func_184187_bx() instanceof EntityBoat) {
  14535. return false;
  14536. } else {
  14537. double d0 = this.field_70163_u + (double)this.func_70047_e();
  14538. BlockPos blockpos = new BlockPos(this.field_70165_t, d0, this.field_70161_v);
  14539. IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos);
  14540. if(iblockstate.func_185904_a() == p_70055_1_) {
  14541. float f = BlockLiquid.func_149801_b(iblockstate.func_177230_c().func_176201_c(iblockstate)) - 0.11111111F;
  14542. float f1 = (float)(blockpos.func_177956_o() + 1) - f;
  14543. boolean flag = d0 < (double)f1;
  14544. return !flag && this instanceof EntityPlayer?false:flag;
  14545. } else {
  14546. return false;
  14547. }
  14548. }
  14549. }
  14550.  
  14551. public boolean func_180799_ab() {
  14552. return this.field_70170_p.func_72875_a(this.func_174813_aQ().func_72314_b(-0.10000000149011612D, -0.4000000059604645D, -0.10000000149011612D), Material.field_151587_i);
  14553. }
  14554.  
  14555. public void func_191958_b(float p_191958_1_, float p_191958_2_, float p_191958_3_, float p_191958_4_) {
  14556. float f = p_191958_1_ * p_191958_1_ + p_191958_2_ * p_191958_2_ + p_191958_3_ * p_191958_3_;
  14557. if(f >= 1.0E-4F) {
  14558. f = MathHelper.func_76129_c(f);
  14559. if(f < 1.0F) {
  14560. f = 1.0F;
  14561. }
  14562.  
  14563. f = p_191958_4_ / f;
  14564. p_191958_1_ = p_191958_1_ * f;
  14565. p_191958_2_ = p_191958_2_ * f;
  14566. p_191958_3_ = p_191958_3_ * f;
  14567. float f1 = MathHelper.func_76126_a(this.field_70177_z * 0.017453292F);
  14568. float f2 = MathHelper.func_76134_b(this.field_70177_z * 0.017453292F);
  14569. this.field_70159_w += (double)(p_191958_1_ * f2 - p_191958_3_ * f1);
  14570. this.field_70181_x += (double)p_191958_2_;
  14571. this.field_70179_y += (double)(p_191958_3_ * f2 + p_191958_1_ * f1);
  14572. }
  14573. }
  14574.  
  14575. @SideOnly(Side.CLIENT)
  14576. public int func_70070_b() {
  14577. BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(MathHelper.func_76128_c(this.field_70165_t), 0, MathHelper.func_76128_c(this.field_70161_v));
  14578. if(this.field_70170_p.func_175667_e(blockpos$mutableblockpos)) {
  14579. blockpos$mutableblockpos.func_185336_p(MathHelper.func_76128_c(this.field_70163_u + (double)this.func_70047_e()));
  14580. return this.field_70170_p.func_175626_b(blockpos$mutableblockpos, 0);
  14581. } else {
  14582. return 0;
  14583. }
  14584. }
  14585.  
  14586. public float func_70013_c() {
  14587. BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(MathHelper.func_76128_c(this.field_70165_t), 0, MathHelper.func_76128_c(this.field_70161_v));
  14588. if(this.field_70170_p.func_175667_e(blockpos$mutableblockpos)) {
  14589. blockpos$mutableblockpos.func_185336_p(MathHelper.func_76128_c(this.field_70163_u + (double)this.func_70047_e()));
  14590. return this.field_70170_p.func_175724_o(blockpos$mutableblockpos);
  14591. } else {
  14592. return 0.0F;
  14593. }
  14594. }
  14595.  
  14596. public void func_70029_a(World p_70029_1_) {
  14597. this.field_70170_p = p_70029_1_;
  14598. }
  14599.  
  14600. public void func_70080_a(double p_70080_1_, double p_70080_3_, double p_70080_5_, float p_70080_7_, float p_70080_8_) {
  14601. this.field_70165_t = MathHelper.func_151237_a(p_70080_1_, -3.0E7D, 3.0E7D);
  14602. this.field_70163_u = p_70080_3_;
  14603. this.field_70161_v = MathHelper.func_151237_a(p_70080_5_, -3.0E7D, 3.0E7D);
  14604. this.field_70169_q = this.field_70165_t;
  14605. this.field_70167_r = this.field_70163_u;
  14606. this.field_70166_s = this.field_70161_v;
  14607. p_70080_8_ = MathHelper.func_76131_a(p_70080_8_, -90.0F, 90.0F);
  14608. this.field_70177_z = p_70080_7_;
  14609. this.field_70125_A = p_70080_8_;
  14610. this.field_70126_B = this.field_70177_z;
  14611. this.field_70127_C = this.field_70125_A;
  14612. double d0 = (double)(this.field_70126_B - p_70080_7_);
  14613. if(d0 < -180.0D) {
  14614. this.field_70126_B += 360.0F;
  14615. }
  14616.  
  14617. if(d0 >= 180.0D) {
  14618. this.field_70126_B -= 360.0F;
  14619. }
  14620.  
  14621. this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v);
  14622. this.func_70101_b(p_70080_7_, p_70080_8_);
  14623. }
  14624.  
  14625. public void func_174828_a(BlockPos p_174828_1_, float p_174828_2_, float p_174828_3_) {
  14626. this.func_70012_b((double)p_174828_1_.func_177958_n() + 0.5D, (double)p_174828_1_.func_177956_o(), (double)p_174828_1_.func_177952_p() + 0.5D, p_174828_2_, p_174828_3_);
  14627. }
  14628.  
  14629. public void func_70012_b(double p_70012_1_, double p_70012_3_, double p_70012_5_, float p_70012_7_, float p_70012_8_) {
  14630. this.field_70165_t = p_70012_1_;
  14631. this.field_70163_u = p_70012_3_;
  14632. this.field_70161_v = p_70012_5_;
  14633. this.field_70169_q = this.field_70165_t;
  14634. this.field_70167_r = this.field_70163_u;
  14635. this.field_70166_s = this.field_70161_v;
  14636. this.field_70142_S = this.field_70165_t;
  14637. this.field_70137_T = this.field_70163_u;
  14638. this.field_70136_U = this.field_70161_v;
  14639. this.field_70177_z = p_70012_7_;
  14640. this.field_70125_A = p_70012_8_;
  14641. this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v);
  14642. }
  14643.  
  14644. public float func_70032_d(Entity p_70032_1_) {
  14645. float f = (float)(this.field_70165_t - p_70032_1_.field_70165_t);
  14646. float f1 = (float)(this.field_70163_u - p_70032_1_.field_70163_u);
  14647. float f2 = (float)(this.field_70161_v - p_70032_1_.field_70161_v);
  14648. return MathHelper.func_76129_c(f * f + f1 * f1 + f2 * f2);
  14649. }
  14650.  
  14651. public double func_70092_e(double p_70092_1_, double p_70092_3_, double p_70092_5_) {
  14652. double d0 = this.field_70165_t - p_70092_1_;
  14653. double d1 = this.field_70163_u - p_70092_3_;
  14654. double d2 = this.field_70161_v - p_70092_5_;
  14655. return d0 * d0 + d1 * d1 + d2 * d2;
  14656. }
  14657.  
  14658. public double func_174818_b(BlockPos p_174818_1_) {
  14659. return p_174818_1_.func_177954_c(this.field_70165_t, this.field_70163_u, this.field_70161_v);
  14660. }
  14661.  
  14662. public double func_174831_c(BlockPos p_174831_1_) {
  14663. return p_174831_1_.func_177957_d(this.field_70165_t, this.field_70163_u, this.field_70161_v);
  14664. }
  14665.  
  14666. public double func_70011_f(double p_70011_1_, double p_70011_3_, double p_70011_5_) {
  14667. double d0 = this.field_70165_t - p_70011_1_;
  14668. double d1 = this.field_70163_u - p_70011_3_;
  14669. double d2 = this.field_70161_v - p_70011_5_;
  14670. return (double)MathHelper.func_76133_a(d0 * d0 + d1 * d1 + d2 * d2);
  14671. }
  14672.  
  14673. public double func_70068_e(Entity p_70068_1_) {
  14674. double d0 = this.field_70165_t - p_70068_1_.field_70165_t;
  14675. double d1 = this.field_70163_u - p_70068_1_.field_70163_u;
  14676. double d2 = this.field_70161_v - p_70068_1_.field_70161_v;
  14677. return d0 * d0 + d1 * d1 + d2 * d2;
  14678. }
  14679.  
  14680. public void func_70100_b_(EntityPlayer p_70100_1_) {
  14681. }
  14682.  
  14683. public void func_70108_f(Entity p_70108_1_) {
  14684. if(!this.func_184223_x(p_70108_1_)) {
  14685. if(!p_70108_1_.field_70145_X && !this.field_70145_X) {
  14686. double d0 = p_70108_1_.field_70165_t - this.field_70165_t;
  14687. double d1 = p_70108_1_.field_70161_v - this.field_70161_v;
  14688. double d2 = MathHelper.func_76132_a(d0, d1);
  14689. if(d2 >= 0.009999999776482582D) {
  14690. d2 = (double)MathHelper.func_76133_a(d2);
  14691. d0 = d0 / d2;
  14692. d1 = d1 / d2;
  14693. double d3 = 1.0D / d2;
  14694. if(d3 > 1.0D) {
  14695. d3 = 1.0D;
  14696. }
  14697.  
  14698. d0 = d0 * d3;
  14699. d1 = d1 * d3;
  14700. d0 = d0 * 0.05000000074505806D;
  14701. d1 = d1 * 0.05000000074505806D;
  14702. d0 = d0 * (double)(1.0F - this.field_70144_Y);
  14703. d1 = d1 * (double)(1.0F - this.field_70144_Y);
  14704. if(!this.func_184207_aI()) {
  14705. this.func_70024_g(-d0, 0.0D, -d1);
  14706. }
  14707.  
  14708. if(!p_70108_1_.func_184207_aI()) {
  14709. p_70108_1_.func_70024_g(d0, 0.0D, d1);
  14710. }
  14711. }
  14712.  
  14713. }
  14714. }
  14715. }
  14716.  
  14717. public void func_70024_g(double p_70024_1_, double p_70024_3_, double p_70024_5_) {
  14718. this.field_70159_w += p_70024_1_;
  14719. this.field_70181_x += p_70024_3_;
  14720. this.field_70179_y += p_70024_5_;
  14721. this.field_70160_al = true;
  14722. }
  14723.  
  14724. protected void func_70018_K() {
  14725. this.field_70133_I = true;
  14726. }
  14727.  
  14728. public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) {
  14729. if(this.func_180431_b(p_70097_1_)) {
  14730. return false;
  14731. } else {
  14732. this.func_70018_K();
  14733. return false;
  14734. }
  14735. }
  14736.  
  14737. public Vec3d func_70676_i(float p_70676_1_) {
  14738. if(p_70676_1_ == 1.0F) {
  14739. return this.func_174806_f(this.field_70125_A, this.field_70177_z);
  14740. } else {
  14741. float f = this.field_70127_C + (this.field_70125_A - this.field_70127_C) * p_70676_1_;
  14742. float f1 = this.field_70126_B + (this.field_70177_z - this.field_70126_B) * p_70676_1_;
  14743. return this.func_174806_f(f, f1);
  14744. }
  14745. }
  14746.  
  14747. protected final Vec3d func_174806_f(float p_174806_1_, float p_174806_2_) {
  14748. float f = MathHelper.func_76134_b(-p_174806_2_ * 0.017453292F - 3.1415927F);
  14749. float f1 = MathHelper.func_76126_a(-p_174806_2_ * 0.017453292F - 3.1415927F);
  14750. float f2 = -MathHelper.func_76134_b(-p_174806_1_ * 0.017453292F);
  14751. float f3 = MathHelper.func_76126_a(-p_174806_1_ * 0.017453292F);
  14752. return new Vec3d((double)(f1 * f2), (double)f3, (double)(f * f2));
  14753. }
  14754.  
  14755. public Vec3d func_174824_e(float p_174824_1_) {
  14756. if(p_174824_1_ == 1.0F) {
  14757. return new Vec3d(this.field_70165_t, this.field_70163_u + (double)this.func_70047_e(), this.field_70161_v);
  14758. } else {
  14759. double d0 = this.field_70169_q + (this.field_70165_t - this.field_70169_q) * (double)p_174824_1_;
  14760. double d1 = this.field_70167_r + (this.field_70163_u - this.field_70167_r) * (double)p_174824_1_ + (double)this.func_70047_e();
  14761. double d2 = this.field_70166_s + (this.field_70161_v - this.field_70166_s) * (double)p_174824_1_;
  14762. return new Vec3d(d0, d1, d2);
  14763. }
  14764. }
  14765.  
  14766. @Nullable
  14767. @SideOnly(Side.CLIENT)
  14768. public RayTraceResult func_174822_a(double p_174822_1_, float p_174822_3_) {
  14769. Vec3d vec3d = this.func_174824_e(p_174822_3_);
  14770. Vec3d vec3d1 = this.func_70676_i(p_174822_3_);
  14771. Vec3d vec3d2 = vec3d.func_72441_c(vec3d1.field_72450_a * p_174822_1_, vec3d1.field_72448_b * p_174822_1_, vec3d1.field_72449_c * p_174822_1_);
  14772. return this.field_70170_p.func_147447_a(vec3d, vec3d2, false, false, true);
  14773. }
  14774.  
  14775. public boolean func_70067_L() {
  14776. return false;
  14777. }
  14778.  
  14779. public boolean func_70104_M() {
  14780. return false;
  14781. }
  14782.  
  14783. public void func_191956_a(Entity p_191956_1_, int p_191956_2_, DamageSource p_191956_3_) {
  14784. if(p_191956_1_ instanceof EntityPlayerMP) {
  14785. CriteriaTriggers.field_192123_c.func_192211_a((EntityPlayerMP)p_191956_1_, this, p_191956_3_);
  14786. }
  14787.  
  14788. }
  14789.  
  14790. @SideOnly(Side.CLIENT)
  14791. public boolean func_145770_h(double p_145770_1_, double p_145770_3_, double p_145770_5_) {
  14792. double d0 = this.field_70165_t - p_145770_1_;
  14793. double d1 = this.field_70163_u - p_145770_3_;
  14794. double d2 = this.field_70161_v - p_145770_5_;
  14795. double d3 = d0 * d0 + d1 * d1 + d2 * d2;
  14796. return this.func_70112_a(d3);
  14797. }
  14798.  
  14799. @SideOnly(Side.CLIENT)
  14800. public boolean func_70112_a(double p_70112_1_) {
  14801. double d0 = this.func_174813_aQ().func_72320_b();
  14802. if(Double.isNaN(d0)) {
  14803. d0 = 1.0D;
  14804. }
  14805.  
  14806. d0 = d0 * 64.0D * field_70155_l;
  14807. return p_70112_1_ < d0 * d0;
  14808. }
  14809.  
  14810. public boolean func_184198_c(NBTTagCompound p_184198_1_) {
  14811. String s = this.func_70022_Q();
  14812. if(!this.field_70128_L && s != null) {
  14813. p_184198_1_.func_74778_a("id", s);
  14814. this.func_189511_e(p_184198_1_);
  14815. return true;
  14816. } else {
  14817. return false;
  14818. }
  14819. }
  14820.  
  14821. public boolean func_70039_c(NBTTagCompound p_70039_1_) {
  14822. String s = this.func_70022_Q();
  14823. if(!this.field_70128_L && s != null && !this.func_184218_aH()) {
  14824. p_70039_1_.func_74778_a("id", s);
  14825. this.func_189511_e(p_70039_1_);
  14826. return true;
  14827. } else {
  14828. return false;
  14829. }
  14830. }
  14831.  
  14832. public static void func_190533_a(DataFixer p_190533_0_) {
  14833. p_190533_0_.func_188258_a(FixTypes.ENTITY, new IDataWalker() {
  14834. public NBTTagCompound func_188266_a(IDataFixer p_188266_1_, NBTTagCompound p_188266_2_, int p_188266_3_) {
  14835. if(p_188266_2_.func_150297_b("Passengers", 9)) {
  14836. NBTTagList nbttaglist = p_188266_2_.func_150295_c("Passengers", 10);
  14837.  
  14838. for(int i = 0; i < nbttaglist.func_74745_c(); ++i) {
  14839. nbttaglist.func_150304_a(i, p_188266_1_.func_188251_a(FixTypes.ENTITY, nbttaglist.func_150305_b(i), p_188266_3_));
  14840. }
  14841. }
  14842.  
  14843. return p_188266_2_;
  14844. }
  14845. });
  14846. }
  14847.  
  14848. public NBTTagCompound func_189511_e(NBTTagCompound p_189511_1_) {
  14849. try {
  14850. p_189511_1_.func_74782_a("Pos", this.func_70087_a(new double[]{this.field_70165_t, this.field_70163_u, this.field_70161_v}));
  14851. p_189511_1_.func_74782_a("Motion", this.func_70087_a(new double[]{this.field_70159_w, this.field_70181_x, this.field_70179_y}));
  14852. p_189511_1_.func_74782_a("Rotation", this.func_70049_a(new float[]{this.field_70177_z, this.field_70125_A}));
  14853. p_189511_1_.func_74776_a("FallDistance", this.field_70143_R);
  14854. p_189511_1_.func_74777_a("Fire", (short)this.field_190534_ay);
  14855. p_189511_1_.func_74777_a("Air", (short)this.func_70086_ai());
  14856. p_189511_1_.func_74757_a("OnGround", this.field_70122_E);
  14857. p_189511_1_.func_74768_a("Dimension", this.field_71093_bK);
  14858. p_189511_1_.func_74757_a("Invulnerable", this.field_83001_bt);
  14859. p_189511_1_.func_74768_a("PortalCooldown", this.field_71088_bW);
  14860. p_189511_1_.func_186854_a("UUID", this.func_110124_au());
  14861. if(this.func_145818_k_()) {
  14862. p_189511_1_.func_74778_a("CustomName", this.func_95999_t());
  14863. }
  14864.  
  14865. if(this.func_174833_aM()) {
  14866. p_189511_1_.func_74757_a("CustomNameVisible", this.func_174833_aM());
  14867. }
  14868.  
  14869. this.field_174837_as.func_179670_b(p_189511_1_);
  14870. if(this.func_174814_R()) {
  14871. p_189511_1_.func_74757_a("Silent", this.func_174814_R());
  14872. }
  14873.  
  14874. if(this.func_189652_ae()) {
  14875. p_189511_1_.func_74757_a("NoGravity", this.func_189652_ae());
  14876. }
  14877.  
  14878. if(this.field_184238_ar) {
  14879. p_189511_1_.func_74757_a("Glowing", this.field_184238_ar);
  14880. }
  14881.  
  14882. if(!this.field_184236_aF.isEmpty()) {
  14883. NBTTagList nbttaglist = new NBTTagList();
  14884.  
  14885. for(String s : this.field_184236_aF) {
  14886. nbttaglist.func_74742_a(new NBTTagString(s));
  14887. }
  14888.  
  14889. p_189511_1_.func_74782_a("Tags", nbttaglist);
  14890. }
  14891.  
  14892. this.func_70014_b(p_189511_1_);
  14893. if(this.func_184207_aI()) {
  14894. NBTTagList nbttaglist1 = new NBTTagList();
  14895.  
  14896. for(Entity entity : this.func_184188_bt()) {
  14897. NBTTagCompound nbttagcompound = new NBTTagCompound();
  14898. if(entity.func_184198_c(nbttagcompound)) {
  14899. nbttaglist1.func_74742_a(nbttagcompound);
  14900. }
  14901. }
  14902.  
  14903. if(!nbttaglist1.func_82582_d()) {
  14904. p_189511_1_.func_74782_a("Passengers", nbttaglist1);
  14905. }
  14906. }
  14907.  
  14908. return p_189511_1_;
  14909. } catch (Throwable throwable) {
  14910. CrashReport crashreport = CrashReport.func_85055_a(throwable, "Saving entity NBT");
  14911. CrashReportCategory crashreportcategory = crashreport.func_85058_a("Entity being saved");
  14912. this.func_85029_a(crashreportcategory);
  14913. throw new ReportedException(crashreport);
  14914. }
  14915. }
  14916.  
  14917. public void func_70020_e(NBTTagCompound p_70020_1_) {
  14918. try {
  14919. NBTTagList nbttaglist = p_70020_1_.func_150295_c("Pos", 6);
  14920. NBTTagList nbttaglist2 = p_70020_1_.func_150295_c("Motion", 6);
  14921. NBTTagList nbttaglist3 = p_70020_1_.func_150295_c("Rotation", 5);
  14922. this.field_70159_w = nbttaglist2.func_150309_d(0);
  14923. this.field_70181_x = nbttaglist2.func_150309_d(1);
  14924. this.field_70179_y = nbttaglist2.func_150309_d(2);
  14925. if(Math.abs(this.field_70159_w) > 10.0D) {
  14926. this.field_70159_w = 0.0D;
  14927. }
  14928.  
  14929. if(Math.abs(this.field_70181_x) > 10.0D) {
  14930. this.field_70181_x = 0.0D;
  14931. }
  14932.  
  14933. if(Math.abs(this.field_70179_y) > 10.0D) {
  14934. this.field_70179_y = 0.0D;
  14935. }
  14936.  
  14937. this.field_70165_t = nbttaglist.func_150309_d(0);
  14938. this.field_70163_u = nbttaglist.func_150309_d(1);
  14939. this.field_70161_v = nbttaglist.func_150309_d(2);
  14940. this.field_70142_S = this.field_70165_t;
  14941. this.field_70137_T = this.field_70163_u;
  14942. this.field_70136_U = this.field_70161_v;
  14943. this.field_70169_q = this.field_70165_t;
  14944. this.field_70167_r = this.field_70163_u;
  14945. this.field_70166_s = this.field_70161_v;
  14946. this.field_70177_z = nbttaglist3.func_150308_e(0);
  14947. this.field_70125_A = nbttaglist3.func_150308_e(1);
  14948. this.field_70126_B = this.field_70177_z;
  14949. this.field_70127_C = this.field_70125_A;
  14950. this.func_70034_d(this.field_70177_z);
  14951. this.func_181013_g(this.field_70177_z);
  14952. this.field_70143_R = p_70020_1_.func_74760_g("FallDistance");
  14953. this.field_190534_ay = p_70020_1_.func_74765_d("Fire");
  14954. this.func_70050_g(p_70020_1_.func_74765_d("Air"));
  14955. this.field_70122_E = p_70020_1_.func_74767_n("OnGround");
  14956. if(p_70020_1_.func_74764_b("Dimension")) {
  14957. this.field_71093_bK = p_70020_1_.func_74762_e("Dimension");
  14958. }
  14959.  
  14960. this.field_83001_bt = p_70020_1_.func_74767_n("Invulnerable");
  14961. this.field_71088_bW = p_70020_1_.func_74762_e("PortalCooldown");
  14962. if(p_70020_1_.func_186855_b("UUID")) {
  14963. this.field_96093_i = p_70020_1_.func_186857_a("UUID");
  14964. this.field_189513_ar = this.field_96093_i.toString();
  14965. }
  14966.  
  14967. this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v);
  14968. this.func_70101_b(this.field_70177_z, this.field_70125_A);
  14969. if(p_70020_1_.func_150297_b("CustomName", 8)) {
  14970. this.func_96094_a(p_70020_1_.func_74779_i("CustomName"));
  14971. }
  14972.  
  14973. this.func_174805_g(p_70020_1_.func_74767_n("CustomNameVisible"));
  14974. this.field_174837_as.func_179668_a(p_70020_1_);
  14975. this.func_174810_b(p_70020_1_.func_74767_n("Silent"));
  14976. this.func_189654_d(p_70020_1_.func_74767_n("NoGravity"));
  14977. this.func_184195_f(p_70020_1_.func_74767_n("Glowing"));
  14978. if(p_70020_1_.func_150297_b("Tags", 9)) {
  14979. this.field_184236_aF.clear();
  14980. NBTTagList nbttaglist1 = p_70020_1_.func_150295_c("Tags", 8);
  14981. int i = Math.min(nbttaglist1.func_74745_c(), 1024);
  14982.  
  14983. for(int j = 0; j < i; ++j) {
  14984. this.field_184236_aF.add(nbttaglist1.func_150307_f(j));
  14985. }
  14986. }
  14987.  
  14988. this.func_70037_a(p_70020_1_);
  14989. if(this.func_142008_O()) {
  14990. this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v);
  14991. }
  14992.  
  14993. } catch (Throwable throwable) {
  14994. CrashReport crashreport = CrashReport.func_85055_a(throwable, "Loading entity NBT");
  14995. CrashReportCategory crashreportcategory = crashreport.func_85058_a("Entity being loaded");
  14996. this.func_85029_a(crashreportcategory);
  14997. throw new ReportedException(crashreport);
  14998. }
  14999. }
  15000.  
  15001. protected boolean func_142008_O() {
  15002. return true;
  15003. }
  15004.  
  15005. @Nullable
  15006. protected final String func_70022_Q() {
  15007. ResourceLocation resourcelocation = EntityList.func_191301_a(this);
  15008. return resourcelocation == null?null:resourcelocation.toString();
  15009. }
  15010.  
  15011. protected abstract void func_70037_a(NBTTagCompound p_70037_1_);
  15012.  
  15013. protected abstract void func_70014_b(NBTTagCompound p_70014_1_);
  15014.  
  15015. protected NBTTagList func_70087_a(double... p_70087_1_) {
  15016. NBTTagList nbttaglist = new NBTTagList();
  15017.  
  15018. for(double d0 : p_70087_1_) {
  15019. nbttaglist.func_74742_a(new NBTTagDouble(d0));
  15020. }
  15021.  
  15022. return nbttaglist;
  15023. }
  15024.  
  15025. protected NBTTagList func_70049_a(float... p_70049_1_) {
  15026. NBTTagList nbttaglist = new NBTTagList();
  15027.  
  15028. for(float f : p_70049_1_) {
  15029. nbttaglist.func_74742_a(new NBTTagFloat(f));
  15030. }
  15031.  
  15032. return nbttaglist;
  15033. }
  15034.  
  15035. @Nullable
  15036. public EntityItem func_145779_a(Item p_145779_1_, int p_145779_2_) {
  15037. return this.func_145778_a(p_145779_1_, p_145779_2_, 0.0F);
  15038. }
  15039.  
  15040. @Nullable
  15041. public EntityItem func_145778_a(Item p_145778_1_, int p_145778_2_, float p_145778_3_) {
  15042. return this.func_70099_a(new ItemStack(p_145778_1_, p_145778_2_, 0), p_145778_3_);
  15043. }
  15044.  
  15045. @Nullable
  15046. public EntityItem func_70099_a(ItemStack p_70099_1_, float p_70099_2_) {
  15047. if(p_70099_1_.func_190926_b()) {
  15048. return null;
  15049. } else {
  15050. EntityItem entityitem = new EntityItem(this.field_70170_p, this.field_70165_t, this.field_70163_u + (double)p_70099_2_, this.field_70161_v, p_70099_1_);
  15051. entityitem.func_174869_p();
  15052. this.field_70170_p.func_72838_d(entityitem);
  15053. return entityitem;
  15054. }
  15055. }
  15056.  
  15057. public boolean func_70089_S() {
  15058. return !this.field_70128_L;
  15059. }
  15060.  
  15061. public boolean func_70094_T() {
  15062. if(this.field_70145_X) {
  15063. return false;
  15064. } else {
  15065. BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
  15066.  
  15067. for(int i = 0; i < 8; ++i) {
  15068. int j = MathHelper.func_76128_c(this.field_70163_u + (double)(((float)((i >> 0) % 2) - 0.5F) * 0.1F) + (double)this.func_70047_e());
  15069. int k = MathHelper.func_76128_c(this.field_70165_t + (double)(((float)((i >> 1) % 2) - 0.5F) * this.field_70130_N * 0.8F));
  15070. int l = MathHelper.func_76128_c(this.field_70161_v + (double)(((float)((i >> 2) % 2) - 0.5F) * this.field_70130_N * 0.8F));
  15071. if(blockpos$pooledmutableblockpos.func_177958_n() != k || blockpos$pooledmutableblockpos.func_177956_o() != j || blockpos$pooledmutableblockpos.func_177952_p() != l) {
  15072. blockpos$pooledmutableblockpos.func_181079_c(k, j, l);
  15073. if(this.field_70170_p.func_180495_p(blockpos$pooledmutableblockpos).func_191058_s()) {
  15074. blockpos$pooledmutableblockpos.func_185344_t();
  15075. return true;
  15076. }
  15077. }
  15078. }
  15079.  
  15080. blockpos$pooledmutableblockpos.func_185344_t();
  15081. return false;
  15082. }
  15083. }
  15084.  
  15085. public boolean func_184230_a(EntityPlayer p_184230_1_, EnumHand p_184230_2_) {
  15086. return false;
  15087. }
  15088.  
  15089. @Nullable
  15090. public AxisAlignedBB func_70114_g(Entity p_70114_1_) {
  15091. return null;
  15092. }
  15093.  
  15094. public void func_70098_U() {
  15095. Entity entity = this.func_184187_bx();
  15096. if(this.func_184218_aH() && entity.field_70128_L) {
  15097. this.func_184210_p();
  15098. } else {
  15099. this.field_70159_w = 0.0D;
  15100. this.field_70181_x = 0.0D;
  15101. this.field_70179_y = 0.0D;
  15102. this.func_70071_h_();
  15103. if(this.func_184218_aH()) {
  15104. entity.func_184232_k(this);
  15105. }
  15106. }
  15107. }
  15108.  
  15109. public void func_184232_k(Entity p_184232_1_) {
  15110. if(this.func_184196_w(p_184232_1_)) {
  15111. p_184232_1_.func_70107_b(this.field_70165_t, this.field_70163_u + this.func_70042_X() + p_184232_1_.func_70033_W(), this.field_70161_v);
  15112. }
  15113. }
  15114.  
  15115. @SideOnly(Side.CLIENT)
  15116. public void func_184190_l(Entity p_184190_1_) {
  15117. }
  15118.  
  15119. public double func_70033_W() {
  15120. return 0.0D;
  15121. }
  15122.  
  15123. public double func_70042_X() {
  15124. return (double)this.field_70131_O * 0.75D;
  15125. }
  15126.  
  15127. public boolean func_184220_m(Entity p_184220_1_) {
  15128. return this.func_184205_a(p_184220_1_, false);
  15129. }
  15130.  
  15131. public boolean func_184205_a(Entity p_184205_1_, boolean p_184205_2_) {
  15132. for(Entity entity = p_184205_1_; entity.field_184239_as != null; entity = entity.field_184239_as) {
  15133. if(entity.field_184239_as == this) {
  15134. return false;
  15135. }
  15136. }
  15137.  
  15138. if(p_184205_2_ || this.func_184228_n(p_184205_1_) && p_184205_1_.func_184219_q(this)) {
  15139. if(this.func_184218_aH()) {
  15140. this.func_184210_p();
  15141. }
  15142.  
  15143. this.field_184239_as = p_184205_1_;
  15144. this.field_184239_as.func_184200_o(this);
  15145. return true;
  15146. } else {
  15147. return false;
  15148. }
  15149. }
  15150.  
  15151. protected boolean func_184228_n(Entity p_184228_1_) {
  15152. return this.field_184245_j <= 0;
  15153. }
  15154.  
  15155. public void func_184226_ay() {
  15156. for(int i = this.field_184244_h.size() - 1; i >= 0; --i) {
  15157. ((Entity)this.field_184244_h.get(i)).func_184210_p();
  15158. }
  15159.  
  15160. }
  15161.  
  15162. public void func_184210_p() {
  15163. if(this.field_184239_as != null) {
  15164. Entity entity = this.field_184239_as;
  15165. this.field_184239_as = null;
  15166. entity.func_184225_p(this);
  15167. }
  15168.  
  15169. }
  15170.  
  15171. protected void func_184200_o(Entity p_184200_1_) {
  15172. if(p_184200_1_.func_184187_bx() != this) {
  15173. throw new IllegalStateException("Use x.startRiding(y), not y.addPassenger(x)");
  15174. } else {
  15175. if(!this.field_70170_p.field_72995_K && p_184200_1_ instanceof EntityPlayer && !(this.func_184179_bs() instanceof EntityPlayer)) {
  15176. this.field_184244_h.add(0, p_184200_1_);
  15177. } else {
  15178. this.field_184244_h.add(p_184200_1_);
  15179. }
  15180.  
  15181. }
  15182. }
  15183.  
  15184. protected void func_184225_p(Entity p_184225_1_) {
  15185. if(p_184225_1_.func_184187_bx() == this) {
  15186. throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)");
  15187. } else {
  15188. this.field_184244_h.remove(p_184225_1_);
  15189. p_184225_1_.field_184245_j = 60;
  15190. }
  15191. }
  15192.  
  15193. protected boolean func_184219_q(Entity p_184219_1_) {
  15194. return this.func_184188_bt().size() < 1;
  15195. }
  15196.  
  15197. @SideOnly(Side.CLIENT)
  15198. public void func_180426_a(double p_180426_1_, double p_180426_3_, double p_180426_5_, float p_180426_7_, float p_180426_8_, int p_180426_9_, boolean p_180426_10_) {
  15199. this.func_70107_b(p_180426_1_, p_180426_3_, p_180426_5_);
  15200. this.func_70101_b(p_180426_7_, p_180426_8_);
  15201. }
  15202.  
  15203. public float func_70111_Y() {
  15204. return 0.0F;
  15205. }
  15206.  
  15207. public Vec3d func_70040_Z() {
  15208. return this.func_174806_f(this.field_70125_A, this.field_70177_z);
  15209. }
  15210.  
  15211. @SideOnly(Side.CLIENT)
  15212. public Vec2f func_189653_aC() {
  15213. return new Vec2f(this.field_70125_A, this.field_70177_z);
  15214. }
  15215.  
  15216. @SideOnly(Side.CLIENT)
  15217. public Vec3d func_189651_aD() {
  15218. return Vec3d.func_189984_a(this.func_189653_aC());
  15219. }
  15220.  
  15221. public void func_181015_d(BlockPos p_181015_1_) {
  15222. if(this.field_71088_bW > 0) {
  15223. this.field_71088_bW = this.func_82147_ab();
  15224. } else {
  15225. if(!this.field_70170_p.field_72995_K && !p_181015_1_.equals(this.field_181016_an)) {
  15226. this.field_181016_an = new BlockPos(p_181015_1_);
  15227. BlockPattern.PatternHelper blockpattern$patternhelper = Blocks.field_150427_aO.func_181089_f(this.field_70170_p, this.field_181016_an);
  15228. double d0 = blockpattern$patternhelper.func_177669_b().func_176740_k() == EnumFacing.Axis.X?(double)blockpattern$patternhelper.func_181117_a().func_177952_p():(double)blockpattern$patternhelper.func_181117_a().func_177958_n();
  15229. double d1 = blockpattern$patternhelper.func_177669_b().func_176740_k() == EnumFacing.Axis.X?this.field_70161_v:this.field_70165_t;
  15230. d1 = Math.abs(MathHelper.func_181160_c(d1 - (double)(blockpattern$patternhelper.func_177669_b().func_176746_e().func_176743_c() == EnumFacing.AxisDirection.NEGATIVE?1:0), d0, d0 - (double)blockpattern$patternhelper.func_181118_d()));
  15231. double d2 = MathHelper.func_181160_c(this.field_70163_u - 1.0D, (double)blockpattern$patternhelper.func_181117_a().func_177956_o(), (double)(blockpattern$patternhelper.func_181117_a().func_177956_o() - blockpattern$patternhelper.func_181119_e()));
  15232. this.field_181017_ao = new Vec3d(d1, d2, 0.0D);
  15233. this.field_181018_ap = blockpattern$patternhelper.func_177669_b();
  15234. }
  15235.  
  15236. this.field_71087_bX = true;
  15237. }
  15238. }
  15239.  
  15240. public int func_82147_ab() {
  15241. return 300;
  15242. }
  15243.  
  15244. @SideOnly(Side.CLIENT)
  15245. public void func_70016_h(double p_70016_1_, double p_70016_3_, double p_70016_5_) {
  15246. this.field_70159_w = p_70016_1_;
  15247. this.field_70181_x = p_70016_3_;
  15248. this.field_70179_y = p_70016_5_;
  15249. }
  15250.  
  15251. @SideOnly(Side.CLIENT)
  15252. public void func_70103_a(byte p_70103_1_) {
  15253. }
  15254.  
  15255. @SideOnly(Side.CLIENT)
  15256. public void func_70057_ab() {
  15257. }
  15258.  
  15259. public Iterable<ItemStack> func_184214_aD() {
  15260. return field_190535_b;
  15261. }
  15262.  
  15263. public Iterable<ItemStack> func_184193_aE() {
  15264. return field_190535_b;
  15265. }
  15266.  
  15267. public Iterable<ItemStack> func_184209_aF() {
  15268. return Iterables.<ItemStack>concat(this.func_184214_aD(), this.func_184193_aE());
  15269. }
  15270.  
  15271. public void func_184201_a(EntityEquipmentSlot p_184201_1_, ItemStack p_184201_2_) {
  15272. }
  15273.  
  15274. public boolean func_70027_ad() {
  15275. boolean flag = this.field_70170_p != null && this.field_70170_p.field_72995_K;
  15276. return !this.field_70178_ae && (this.field_190534_ay > 0 || flag && this.func_70083_f(0));
  15277. }
  15278.  
  15279. public boolean func_184218_aH() {
  15280. return this.func_184187_bx() != null;
  15281. }
  15282.  
  15283. public boolean func_184207_aI() {
  15284. return !this.func_184188_bt().isEmpty();
  15285. }
  15286.  
  15287. public boolean func_70093_af() {
  15288. return this.func_70083_f(1);
  15289. }
  15290.  
  15291. public void func_70095_a(boolean p_70095_1_) {
  15292. this.func_70052_a(1, p_70095_1_);
  15293. }
  15294.  
  15295. public boolean func_70051_ag() {
  15296. return this.func_70083_f(3);
  15297. }
  15298.  
  15299. public void func_70031_b(boolean p_70031_1_) {
  15300. this.func_70052_a(3, p_70031_1_);
  15301. }
  15302.  
  15303. public boolean func_184202_aL() {
  15304. return this.field_184238_ar || this.field_70170_p.field_72995_K && this.func_70083_f(6);
  15305. }
  15306.  
  15307. public void func_184195_f(boolean p_184195_1_) {
  15308. this.field_184238_ar = p_184195_1_;
  15309. if(!this.field_70170_p.field_72995_K) {
  15310. this.func_70052_a(6, this.field_184238_ar);
  15311. }
  15312.  
  15313. }
  15314.  
  15315. public boolean func_82150_aj() {
  15316. return this.func_70083_f(5);
  15317. }
  15318.  
  15319. @SideOnly(Side.CLIENT)
  15320. public boolean func_98034_c(EntityPlayer p_98034_1_) {
  15321. if(p_98034_1_.func_175149_v()) {
  15322. return false;
  15323. } else {
  15324. Team team = this.func_96124_cp();
  15325. return team != null && p_98034_1_ != null && p_98034_1_.func_96124_cp() == team && team.func_98297_h()?false:this.func_82150_aj();
  15326. }
  15327. }
  15328.  
  15329. @Nullable
  15330. public Team func_96124_cp() {
  15331. return this.field_70170_p.func_96441_U().func_96509_i(this.func_189512_bd());
  15332. }
  15333.  
  15334. public boolean func_184191_r(Entity p_184191_1_) {
  15335. return this.func_184194_a(p_184191_1_.func_96124_cp());
  15336. }
  15337.  
  15338. public boolean func_184194_a(Team p_184194_1_) {
  15339. return this.func_96124_cp() != null?this.func_96124_cp().func_142054_a(p_184194_1_):false;
  15340. }
  15341.  
  15342. public void func_82142_c(boolean p_82142_1_) {
  15343. this.func_70052_a(5, p_82142_1_);
  15344. }
  15345.  
  15346. protected boolean func_70083_f(int p_70083_1_) {
  15347. return (((Byte)this.field_70180_af.func_187225_a(field_184240_ax)).byteValue() & 1 << p_70083_1_) != 0;
  15348. }
  15349.  
  15350. protected void func_70052_a(int p_70052_1_, boolean p_70052_2_) {
  15351. byte b0 = ((Byte)this.field_70180_af.func_187225_a(field_184240_ax)).byteValue();
  15352. if(p_70052_2_) {
  15353. this.field_70180_af.func_187227_b(field_184240_ax, Byte.valueOf((byte)(b0 | 1 << p_70052_1_)));
  15354. } else {
  15355. this.field_70180_af.func_187227_b(field_184240_ax, Byte.valueOf((byte)(b0 & ~(1 << p_70052_1_))));
  15356. }
  15357.  
  15358. }
  15359.  
  15360. public int func_70086_ai() {
  15361. return ((Integer)this.field_70180_af.func_187225_a(field_184241_ay)).intValue();
  15362. }
  15363.  
  15364. public void func_70050_g(int p_70050_1_) {
  15365. this.field_70180_af.func_187227_b(field_184241_ay, Integer.valueOf(p_70050_1_));
  15366. }
  15367.  
  15368. public void func_70077_a(EntityLightningBolt p_70077_1_) {
  15369. this.func_70097_a(DamageSource.field_180137_b, 5.0F);
  15370. ++this.field_190534_ay;
  15371. if(this.field_190534_ay == 0) {
  15372. this.func_70015_d(8);
  15373. }
  15374.  
  15375. }
  15376.  
  15377. public void func_70074_a(EntityLivingBase p_70074_1_) {
  15378. }
  15379.  
  15380. protected boolean func_145771_j(double p_145771_1_, double p_145771_3_, double p_145771_5_) {
  15381. BlockPos blockpos = new BlockPos(p_145771_1_, p_145771_3_, p_145771_5_);
  15382. double d0 = p_145771_1_ - (double)blockpos.func_177958_n();
  15383. double d1 = p_145771_3_ - (double)blockpos.func_177956_o();
  15384. double d2 = p_145771_5_ - (double)blockpos.func_177952_p();
  15385. if(!this.field_70170_p.func_184143_b(this.func_174813_aQ())) {
  15386. return false;
  15387. } else {
  15388. EnumFacing enumfacing = EnumFacing.UP;
  15389. double d3 = Double.MAX_VALUE;
  15390. if(!this.field_70170_p.func_175665_u(blockpos.func_177976_e()) && d0 < d3) {
  15391. d3 = d0;
  15392. enumfacing = EnumFacing.WEST;
  15393. }
  15394.  
  15395. if(!this.field_70170_p.func_175665_u(blockpos.func_177974_f()) && 1.0D - d0 < d3) {
  15396. d3 = 1.0D - d0;
  15397. enumfacing = EnumFacing.EAST;
  15398. }
  15399.  
  15400. if(!this.field_70170_p.func_175665_u(blockpos.func_177978_c()) && d2 < d3) {
  15401. d3 = d2;
  15402. enumfacing = EnumFacing.NORTH;
  15403. }
  15404.  
  15405. if(!this.field_70170_p.func_175665_u(blockpos.func_177968_d()) && 1.0D - d2 < d3) {
  15406. d3 = 1.0D - d2;
  15407. enumfacing = EnumFacing.SOUTH;
  15408. }
  15409.  
  15410. if(!this.field_70170_p.func_175665_u(blockpos.func_177984_a()) && 1.0D - d1 < d3) {
  15411. d3 = 1.0D - d1;
  15412. enumfacing = EnumFacing.UP;
  15413. }
  15414.  
  15415. float f = this.field_70146_Z.nextFloat() * 0.2F + 0.1F;
  15416. float f1 = (float)enumfacing.func_176743_c().func_179524_a();
  15417. if(enumfacing.func_176740_k() == EnumFacing.Axis.X) {
  15418. this.field_70159_w = (double)(f1 * f);
  15419. this.field_70181_x *= 0.75D;
  15420. this.field_70179_y *= 0.75D;
  15421. } else if(enumfacing.func_176740_k() == EnumFacing.Axis.Y) {
  15422. this.field_70159_w *= 0.75D;
  15423. this.field_70181_x = (double)(f1 * f);
  15424. this.field_70179_y *= 0.75D;
  15425. } else if(enumfacing.func_176740_k() == EnumFacing.Axis.Z) {
  15426. this.field_70159_w *= 0.75D;
  15427. this.field_70181_x *= 0.75D;
  15428. this.field_70179_y = (double)(f1 * f);
  15429. }
  15430.  
  15431. return true;
  15432. }
  15433. }
  15434.  
  15435. public void func_70110_aj() {
  15436. this.field_70134_J = true;
  15437. this.field_70143_R = 0.0F;
  15438. }
  15439.  
  15440. public String func_70005_c_() {
  15441. if(this.func_145818_k_()) {
  15442. return this.func_95999_t();
  15443. } else {
  15444. String s = EntityList.func_75621_b(this);
  15445. if(s == null) {
  15446. s = "generic";
  15447. }
  15448.  
  15449. return I18n.func_74838_a("entity." + s + ".name");
  15450. }
  15451. }
  15452.  
  15453. @Nullable
  15454. public Entity[] func_70021_al() {
  15455. return null;
  15456. }
  15457.  
  15458. public boolean func_70028_i(Entity p_70028_1_) {
  15459. return this == p_70028_1_;
  15460. }
  15461.  
  15462. public float func_70079_am() {
  15463. return 0.0F;
  15464. }
  15465.  
  15466. public void func_70034_d(float p_70034_1_) {
  15467. }
  15468.  
  15469. public void func_181013_g(float p_181013_1_) {
  15470. }
  15471.  
  15472. public boolean func_70075_an() {
  15473. return true;
  15474. }
  15475.  
  15476. public boolean func_85031_j(Entity p_85031_1_) {
  15477. return false;
  15478. }
  15479.  
  15480. public String toString() {
  15481. return String.format("%s[\'%s\'/%d, l=\'%s\', x=%.2f, y=%.2f, z=%.2f]", new Object[]{this.getClass().getSimpleName(), this.func_70005_c_(), Integer.valueOf(this.field_145783_c), this.field_70170_p == null?"~NULL~":this.field_70170_p.func_72912_H().func_76065_j(), Double.valueOf(this.field_70165_t), Double.valueOf(this.field_70163_u), Double.valueOf(this.field_70161_v)});
  15482. }
  15483.  
  15484. public boolean func_180431_b(DamageSource p_180431_1_) {
  15485. return this.field_83001_bt && p_180431_1_ != DamageSource.field_76380_i && !p_180431_1_.func_180136_u();
  15486. }
  15487.  
  15488. public boolean func_190530_aW() {
  15489. return this.field_83001_bt;
  15490. }
  15491.  
  15492. public void func_184224_h(boolean p_184224_1_) {
  15493. this.field_83001_bt = p_184224_1_;
  15494. }
  15495.  
  15496. public void func_82149_j(Entity p_82149_1_) {
  15497. this.func_70012_b(p_82149_1_.field_70165_t, p_82149_1_.field_70163_u, p_82149_1_.field_70161_v, p_82149_1_.field_70177_z, p_82149_1_.field_70125_A);
  15498. }
  15499.  
  15500. private void func_180432_n(Entity p_180432_1_) {
  15501. NBTTagCompound nbttagcompound = p_180432_1_.func_189511_e(new NBTTagCompound());
  15502. nbttagcompound.func_82580_o("Dimension");
  15503. this.func_70020_e(nbttagcompound);
  15504. this.field_71088_bW = p_180432_1_.field_71088_bW;
  15505. this.field_181016_an = p_180432_1_.field_181016_an;
  15506. this.field_181017_ao = p_180432_1_.field_181017_ao;
  15507. this.field_181018_ap = p_180432_1_.field_181018_ap;
  15508. }
  15509.  
  15510. @Nullable
  15511. public Entity func_184204_a(int p_184204_1_) {
  15512. if(!this.field_70170_p.field_72995_K && !this.field_70128_L) {
  15513. this.field_70170_p.field_72984_F.func_76320_a("changeDimension");
  15514. MinecraftServer minecraftserver = this.func_184102_h();
  15515. int i = this.field_71093_bK;
  15516. WorldServer worldserver = minecraftserver.func_71218_a(i);
  15517. WorldServer worldserver1 = minecraftserver.func_71218_a(p_184204_1_);
  15518. this.field_71093_bK = p_184204_1_;
  15519. if(i == 1 && p_184204_1_ == 1) {
  15520. worldserver1 = minecraftserver.func_71218_a(0);
  15521. this.field_71093_bK = 0;
  15522. }
  15523.  
  15524. this.field_70170_p.func_72900_e(this);
  15525. this.field_70128_L = false;
  15526. this.field_70170_p.field_72984_F.func_76320_a("reposition");
  15527. BlockPos blockpos;
  15528. if(p_184204_1_ == 1) {
  15529. blockpos = worldserver1.func_180504_m();
  15530. } else {
  15531. double d0 = this.field_70165_t;
  15532. double d1 = this.field_70161_v;
  15533. double d2 = 8.0D;
  15534. if(p_184204_1_ == -1) {
  15535. d0 = MathHelper.func_151237_a(d0 / 8.0D, worldserver1.func_175723_af().func_177726_b() + 16.0D, worldserver1.func_175723_af().func_177728_d() - 16.0D);
  15536. d1 = MathHelper.func_151237_a(d1 / 8.0D, worldserver1.func_175723_af().func_177736_c() + 16.0D, worldserver1.func_175723_af().func_177733_e() - 16.0D);
  15537. } else if(p_184204_1_ == 0) {
  15538. d0 = MathHelper.func_151237_a(d0 * 8.0D, worldserver1.func_175723_af().func_177726_b() + 16.0D, worldserver1.func_175723_af().func_177728_d() - 16.0D);
  15539. d1 = MathHelper.func_151237_a(d1 * 8.0D, worldserver1.func_175723_af().func_177736_c() + 16.0D, worldserver1.func_175723_af().func_177733_e() - 16.0D);
  15540. }
  15541.  
  15542. d0 = (double)MathHelper.func_76125_a((int)d0, -29999872, 29999872);
  15543. d1 = (double)MathHelper.func_76125_a((int)d1, -29999872, 29999872);
  15544. float f = this.field_70177_z;
  15545. this.func_70012_b(d0, this.field_70163_u, d1, 90.0F, 0.0F);
  15546. Teleporter teleporter = worldserver1.func_85176_s();
  15547. teleporter.func_180620_b(this, f);
  15548. blockpos = new BlockPos(this);
  15549. }
  15550.  
  15551. worldserver.func_72866_a(this, false);
  15552. this.field_70170_p.field_72984_F.func_76318_c("reloading");
  15553. Entity entity = EntityList.func_191304_a(this.getClass(), worldserver1);
  15554. if(entity != null) {
  15555. entity.func_180432_n(this);
  15556. if(i == 1 && p_184204_1_ == 1) {
  15557. BlockPos blockpos1 = worldserver1.func_175672_r(worldserver1.func_175694_M());
  15558. entity.func_174828_a(blockpos1, entity.field_70177_z, entity.field_70125_A);
  15559. } else {
  15560. entity.func_174828_a(blockpos, entity.field_70177_z, entity.field_70125_A);
  15561. }
  15562.  
  15563. boolean flag = entity.field_98038_p;
  15564. entity.field_98038_p = true;
  15565. worldserver1.func_72838_d(entity);
  15566. entity.field_98038_p = flag;
  15567. worldserver1.func_72866_a(entity, false);
  15568. }
  15569.  
  15570. this.field_70128_L = true;
  15571. this.field_70170_p.field_72984_F.func_76319_b();
  15572. worldserver.func_82742_i();
  15573. worldserver1.func_82742_i();
  15574. this.field_70170_p.field_72984_F.func_76319_b();
  15575. return entity;
  15576. } else {
  15577. return null;
  15578. }
  15579. }
  15580.  
  15581. public boolean func_184222_aU() {
  15582. return true;
  15583. }
  15584.  
  15585. public float func_180428_a(Explosion p_180428_1_, World p_180428_2_, BlockPos p_180428_3_, IBlockState p_180428_4_) {
  15586. return p_180428_4_.func_177230_c().func_149638_a(this);
  15587. }
  15588.  
  15589. public boolean func_174816_a(Explosion p_174816_1_, World p_174816_2_, BlockPos p_174816_3_, IBlockState p_174816_4_, float p_174816_5_) {
  15590. return true;
  15591. }
  15592.  
  15593. public int func_82143_as() {
  15594. return 3;
  15595. }
  15596.  
  15597. public Vec3d func_181014_aG() {
  15598. return this.field_181017_ao;
  15599. }
  15600.  
  15601. public EnumFacing func_181012_aH() {
  15602. return this.field_181018_ap;
  15603. }
  15604.  
  15605. public boolean func_145773_az() {
  15606. return false;
  15607. }
  15608.  
  15609. public void func_85029_a(CrashReportCategory p_85029_1_) {
  15610. p_85029_1_.func_189529_a("Entity Type", new ICrashReportDetail<String>() {
  15611. public String call() throws Exception {
  15612. return EntityList.func_191301_a(Entity.this) + " (" + Entity.this.getClass().getCanonicalName() + ")";
  15613. }
  15614. });
  15615. p_85029_1_.func_71507_a("Entity ID", Integer.valueOf(this.field_145783_c));
  15616. p_85029_1_.func_189529_a("Entity Name", new ICrashReportDetail<String>() {
  15617. public String call() throws Exception {
  15618. return Entity.this.func_70005_c_();
  15619. }
  15620. });
  15621. p_85029_1_.func_71507_a("Entity\'s Exact location", String.format("%.2f, %.2f, %.2f", new Object[]{Double.valueOf(this.field_70165_t), Double.valueOf(this.field_70163_u), Double.valueOf(this.field_70161_v)}));
  15622. p_85029_1_.func_71507_a("Entity\'s Block location", CrashReportCategory.func_184876_a(MathHelper.func_76128_c(this.field_70165_t), MathHelper.func_76128_c(this.field_70163_u), MathHelper.func_76128_c(this.field_70161_v)));
  15623. p_85029_1_.func_71507_a("Entity\'s Momentum", String.format("%.2f, %.2f, %.2f", new Object[]{Double.valueOf(this.field_70159_w), Double.valueOf(this.field_70181_x), Double.valueOf(this.field_70179_y)}));
  15624. p_85029_1_.func_189529_a("Entity\'s Passengers", new ICrashReportDetail<String>() {
  15625. public String call() throws Exception {
  15626. return Entity.this.func_184188_bt().toString();
  15627. }
  15628. });
  15629. p_85029_1_.func_189529_a("Entity\'s Vehicle", new ICrashReportDetail<String>() {
  15630. public String call() throws Exception {
  15631. return Entity.this.func_184187_bx().toString();
  15632. }
  15633. });
  15634. }
  15635.  
  15636. public void func_184221_a(UUID p_184221_1_) {
  15637. this.field_96093_i = p_184221_1_;
  15638. this.field_189513_ar = this.field_96093_i.toString();
  15639. }
  15640.  
  15641. @SideOnly(Side.CLIENT)
  15642. public boolean func_90999_ad() {
  15643. return this.func_70027_ad();
  15644. }
  15645.  
  15646. public UUID func_110124_au() {
  15647. return this.field_96093_i;
  15648. }
  15649.  
  15650. public String func_189512_bd() {
  15651. return this.field_189513_ar;
  15652. }
  15653.  
  15654. public boolean func_96092_aw() {
  15655. return true;
  15656. }
  15657.  
  15658. @SideOnly(Side.CLIENT)
  15659. public static double func_184183_bd() {
  15660. return field_70155_l;
  15661. }
  15662.  
  15663. @SideOnly(Side.CLIENT)
  15664. public static void func_184227_b(double p_184227_0_) {
  15665. field_70155_l = p_184227_0_;
  15666. }
  15667.  
  15668. public ITextComponent func_145748_c_() {
  15669. TextComponentString textcomponentstring = new TextComponentString(ScorePlayerTeam.func_96667_a(this.func_96124_cp(), this.func_70005_c_()));
  15670. textcomponentstring.func_150256_b().func_150209_a(this.func_174823_aP());
  15671. textcomponentstring.func_150256_b().func_179989_a(this.func_189512_bd());
  15672. return textcomponentstring;
  15673. }
  15674.  
  15675. public void func_96094_a(String p_96094_1_) {
  15676. this.field_70180_af.func_187227_b(field_184242_az, p_96094_1_);
  15677. }
  15678.  
  15679. public String func_95999_t() {
  15680. return (String)this.field_70180_af.func_187225_a(field_184242_az);
  15681. }
  15682.  
  15683. public boolean func_145818_k_() {
  15684. return !((String)this.field_70180_af.func_187225_a(field_184242_az)).isEmpty();
  15685. }
  15686.  
  15687. public void func_174805_g(boolean p_174805_1_) {
  15688. this.field_70180_af.func_187227_b(field_184233_aA, Boolean.valueOf(p_174805_1_));
  15689. }
  15690.  
  15691. public boolean func_174833_aM() {
  15692. return ((Boolean)this.field_70180_af.func_187225_a(field_184233_aA)).booleanValue();
  15693. }
  15694.  
  15695. public void func_70634_a(double p_70634_1_, double p_70634_3_, double p_70634_5_) {
  15696. this.field_184237_aG = true;
  15697. this.func_70012_b(p_70634_1_, p_70634_3_, p_70634_5_, this.field_70177_z, this.field_70125_A);
  15698. this.field_70170_p.func_72866_a(this, false);
  15699. }
  15700.  
  15701. public void func_184206_a(DataParameter<?> p_184206_1_) {
  15702. }
  15703.  
  15704. @SideOnly(Side.CLIENT)
  15705. public boolean func_94059_bO() {
  15706. return this.func_174833_aM();
  15707. }
  15708.  
  15709. public EnumFacing func_174811_aO() {
  15710. return EnumFacing.func_176731_b(MathHelper.func_76128_c((double)(this.field_70177_z * 4.0F / 360.0F) + 0.5D) & 3);
  15711. }
  15712.  
  15713. public EnumFacing func_184172_bi() {
  15714. return this.func_174811_aO();
  15715. }
  15716.  
  15717. protected HoverEvent func_174823_aP() {
  15718. NBTTagCompound nbttagcompound = new NBTTagCompound();
  15719. ResourceLocation resourcelocation = EntityList.func_191301_a(this);
  15720. nbttagcompound.func_74778_a("id", this.func_189512_bd());
  15721. if(resourcelocation != null) {
  15722. nbttagcompound.func_74778_a("type", resourcelocation.toString());
  15723. }
  15724.  
  15725. nbttagcompound.func_74778_a("name", this.func_70005_c_());
  15726. return new HoverEvent(HoverEvent.Action.SHOW_ENTITY, new TextComponentString(nbttagcompound.toString()));
  15727. }
  15728.  
  15729. public boolean func_174827_a(EntityPlayerMP p_174827_1_) {
  15730. return true;
  15731. }
  15732.  
  15733. public AxisAlignedBB func_174813_aQ() {
  15734. return this.field_70121_D;
  15735. }
  15736.  
  15737. @SideOnly(Side.CLIENT)
  15738. public AxisAlignedBB func_184177_bl() {
  15739. return this.func_174813_aQ();
  15740. }
  15741.  
  15742. public void func_174826_a(AxisAlignedBB p_174826_1_) {
  15743. this.field_70121_D = p_174826_1_;
  15744. }
  15745.  
  15746. public float func_70047_e() {
  15747. return this.field_70131_O * 0.85F;
  15748. }
  15749.  
  15750. public boolean func_174832_aS() {
  15751. return this.field_174835_g;
  15752. }
  15753.  
  15754. public void func_174821_h(boolean p_174821_1_) {
  15755. this.field_174835_g = p_174821_1_;
  15756. }
  15757.  
  15758. public boolean func_174820_d(int p_174820_1_, ItemStack p_174820_2_) {
  15759. return false;
  15760. }
  15761.  
  15762. public void func_145747_a(ITextComponent p_145747_1_) {
  15763. }
  15764.  
  15765. public boolean func_70003_b(int p_70003_1_, String p_70003_2_) {
  15766. return true;
  15767. }
  15768.  
  15769. public BlockPos func_180425_c() {
  15770. return new BlockPos(this.field_70165_t, this.field_70163_u + 0.5D, this.field_70161_v);
  15771. }
  15772.  
  15773. public Vec3d func_174791_d() {
  15774. return new Vec3d(this.field_70165_t, this.field_70163_u, this.field_70161_v);
  15775. }
  15776.  
  15777. public World func_130014_f_() {
  15778. return this.field_70170_p;
  15779. }
  15780.  
  15781. public Entity func_174793_f() {
  15782. return this;
  15783. }
  15784.  
  15785. public boolean func_174792_t_() {
  15786. return false;
  15787. }
  15788.  
  15789. public void func_174794_a(CommandResultStats.Type p_174794_1_, int p_174794_2_) {
  15790. if(this.field_70170_p != null && !this.field_70170_p.field_72995_K) {
  15791. this.field_174837_as.func_184932_a(this.field_70170_p.func_73046_m(), this, p_174794_1_, p_174794_2_);
  15792. }
  15793.  
  15794. }
  15795.  
  15796. @Nullable
  15797. public MinecraftServer func_184102_h() {
  15798. return this.field_70170_p.func_73046_m();
  15799. }
  15800.  
  15801. public CommandResultStats func_174807_aT() {
  15802. return this.field_174837_as;
  15803. }
  15804.  
  15805. public void func_174817_o(Entity p_174817_1_) {
  15806. this.field_174837_as.func_179671_a(p_174817_1_.func_174807_aT());
  15807. }
  15808.  
  15809. public EnumActionResult func_184199_a(EntityPlayer p_184199_1_, Vec3d p_184199_2_, EnumHand p_184199_3_) {
  15810. return EnumActionResult.PASS;
  15811. }
  15812.  
  15813. public boolean func_180427_aV() {
  15814. return false;
  15815. }
  15816.  
  15817. protected void func_174815_a(EntityLivingBase p_174815_1_, Entity p_174815_2_) {
  15818. if(p_174815_2_ instanceof EntityLivingBase) {
  15819. EnchantmentHelper.func_151384_a((EntityLivingBase)p_174815_2_, p_174815_1_);
  15820. }
  15821.  
  15822. EnchantmentHelper.func_151385_b(p_174815_1_, p_174815_2_);
  15823. }
  15824.  
  15825. public void func_184178_b(EntityPlayerMP p_184178_1_) {
  15826. }
  15827.  
  15828. public void func_184203_c(EntityPlayerMP p_184203_1_) {
  15829. }
  15830.  
  15831. public float func_184229_a(Rotation p_184229_1_) {
  15832. float f = MathHelper.func_76142_g(this.field_70177_z);
  15833. switch(p_184229_1_) {
  15834. case CLOCKWISE_180:
  15835. return f + 180.0F;
  15836. case COUNTERCLOCKWISE_90:
  15837. return f + 270.0F;
  15838. case CLOCKWISE_90:
  15839. return f + 90.0F;
  15840. default:
  15841. return f;
  15842. }
  15843. }
  15844.  
  15845. public float func_184217_a(Mirror p_184217_1_) {
  15846. float f = MathHelper.func_76142_g(this.field_70177_z);
  15847. switch(p_184217_1_) {
  15848. case LEFT_RIGHT:
  15849. return -f;
  15850. case FRONT_BACK:
  15851. return 180.0F - f;
  15852. default:
  15853. return f;
  15854. }
  15855. }
  15856.  
  15857. public boolean func_184213_bq() {
  15858. return false;
  15859. }
  15860.  
  15861. public boolean func_184189_br() {
  15862. boolean flag = this.field_184237_aG;
  15863. this.field_184237_aG = false;
  15864. return flag;
  15865. }
  15866.  
  15867. @Nullable
  15868. public Entity func_184179_bs() {
  15869. return null;
  15870. }
  15871.  
  15872. public List<Entity> func_184188_bt() {
  15873. return (List<Entity>)(this.field_184244_h.isEmpty()?Collections.emptyList():Lists.newArrayList(this.field_184244_h));
  15874. }
  15875.  
  15876. public boolean func_184196_w(Entity p_184196_1_) {
  15877. for(Entity entity : this.func_184188_bt()) {
  15878. if(entity.equals(p_184196_1_)) {
  15879. return true;
  15880. }
  15881. }
  15882.  
  15883. return false;
  15884. }
  15885.  
  15886. public Collection<Entity> func_184182_bu() {
  15887. Set<Entity> set = Sets.<Entity>newHashSet();
  15888. this.func_184175_a(Entity.class, set);
  15889. return set;
  15890. }
  15891.  
  15892. public <T extends Entity> Collection<T> func_184180_b(Class<T> p_184180_1_) {
  15893. Set<T> set = Sets.<T>newHashSet();
  15894. this.func_184175_a(p_184180_1_, set);
  15895. return set;
  15896. }
  15897.  
  15898. private <T extends Entity> void func_184175_a(Class<T> p_184175_1_, Set<T> p_184175_2_) {
  15899. for(Entity entity : this.func_184188_bt()) {
  15900. if(p_184175_1_.isAssignableFrom(entity.getClass())) {
  15901. p_184175_2_.add(entity);
  15902. }
  15903.  
  15904. entity.func_184175_a(p_184175_1_, p_184175_2_);
  15905. }
  15906.  
  15907. }
  15908.  
  15909. public Entity func_184208_bv() {
  15910. Entity entity;
  15911. for(entity = this; entity.func_184218_aH(); entity = entity.func_184187_bx()) {
  15912. ;
  15913. }
  15914.  
  15915. return entity;
  15916. }
  15917.  
  15918. public boolean func_184223_x(Entity p_184223_1_) {
  15919. return this.func_184208_bv() == p_184223_1_.func_184208_bv();
  15920. }
  15921.  
  15922. public boolean func_184215_y(Entity p_184215_1_) {
  15923. for(Entity entity : this.func_184188_bt()) {
  15924. if(entity.equals(p_184215_1_)) {
  15925. return true;
  15926. }
  15927.  
  15928. if(entity.func_184215_y(p_184215_1_)) {
  15929. return true;
  15930. }
  15931. }
  15932.  
  15933. return false;
  15934. }
  15935.  
  15936. public boolean func_184186_bw() {
  15937. Entity entity = this.func_184179_bs();
  15938. return entity instanceof EntityPlayer?((EntityPlayer)entity).func_175144_cb():!this.field_70170_p.field_72995_K;
  15939. }
  15940.  
  15941. @Nullable
  15942. public Entity func_184187_bx() {
  15943. return this.field_184239_as;
  15944. }
  15945.  
  15946. public EnumPushReaction func_184192_z() {
  15947. return EnumPushReaction.NORMAL;
  15948. }
  15949.  
  15950. public SoundCategory func_184176_by() {
  15951. return SoundCategory.NEUTRAL;
  15952. }
  15953.  
  15954. protected int func_190531_bD() {
  15955. return 1;
  15956. }
  15957. }
  15958.  
  15959. Patching failed: minecraft\net\minecraft\entity\EntityList.java
  15960. Hunk 1 failed! Cannot find hunk target
  15961. field_191309_d.add(resourcelocation);
  15962.  
  15963. while(field_191311_g.size() <= p_191303_0_) {
  15964. - field_191311_g.add((Object)null);
  15965. + field_191311_g.add(null);
  15966. }
  15967.  
  15968. field_191311_g.set(p_191303_0_, p_191303_3_);
  15969. File state
  15970. package net.minecraft.entity;
  15971.  
  15972. import com.google.common.collect.Lists;
  15973. import com.google.common.collect.Maps;
  15974. import com.google.common.collect.Sets;
  15975. import java.util.List;
  15976. import java.util.Map;
  15977. import java.util.Set;
  15978. import javax.annotation.Nullable;
  15979. import net.minecraft.entity.Entity;
  15980. import net.minecraft.entity.EntityAreaEffectCloud;
  15981. import net.minecraft.entity.EntityLeashKnot;
  15982. import net.minecraft.entity.boss.EntityDragon;
  15983. import net.minecraft.entity.boss.EntityWither;
  15984. import net.minecraft.entity.effect.EntityLightningBolt;
  15985. import net.minecraft.entity.item.EntityArmorStand;
  15986. import net.minecraft.entity.item.EntityBoat;
  15987. import net.minecraft.entity.item.EntityEnderCrystal;
  15988. import net.minecraft.entity.item.EntityEnderEye;
  15989. import net.minecraft.entity.item.EntityEnderPearl;
  15990. import net.minecraft.entity.item.EntityExpBottle;
  15991. import net.minecraft.entity.item.EntityFallingBlock;
  15992. import net.minecraft.entity.item.EntityFireworkRocket;
  15993. import net.minecraft.entity.item.EntityItem;
  15994. import net.minecraft.entity.item.EntityItemFrame;
  15995. import net.minecraft.entity.item.EntityMinecart;
  15996. import net.minecraft.entity.item.EntityMinecartChest;
  15997. import net.minecraft.entity.item.EntityMinecartCommandBlock;
  15998. import net.minecraft.entity.item.EntityMinecartEmpty;
  15999. import net.minecraft.entity.item.EntityMinecartFurnace;
  16000. import net.minecraft.entity.item.EntityMinecartHopper;
  16001. import net.minecraft.entity.item.EntityMinecartMobSpawner;
  16002. import net.minecraft.entity.item.EntityMinecartTNT;
  16003. import net.minecraft.entity.item.EntityPainting;
  16004. import net.minecraft.entity.item.EntityTNTPrimed;
  16005. import net.minecraft.entity.item.EntityXPOrb;
  16006. import net.minecraft.entity.monster.EntityBlaze;
  16007. import net.minecraft.entity.monster.EntityCaveSpider;
  16008. import net.minecraft.entity.monster.EntityCreeper;
  16009. import net.minecraft.entity.monster.EntityElderGuardian;
  16010. import net.minecraft.entity.monster.EntityEnderman;
  16011. import net.minecraft.entity.monster.EntityEndermite;
  16012. import net.minecraft.entity.monster.EntityEvoker;
  16013. import net.minecraft.entity.monster.EntityGhast;
  16014. import net.minecraft.entity.monster.EntityGiantZombie;
  16015. import net.minecraft.entity.monster.EntityGuardian;
  16016. import net.minecraft.entity.monster.EntityHusk;
  16017. import net.minecraft.entity.monster.EntityIllusionIllager;
  16018. import net.minecraft.entity.monster.EntityIronGolem;
  16019. import net.minecraft.entity.monster.EntityMagmaCube;
  16020. import net.minecraft.entity.monster.EntityPigZombie;
  16021. import net.minecraft.entity.monster.EntityPolarBear;
  16022. import net.minecraft.entity.monster.EntityShulker;
  16023. import net.minecraft.entity.monster.EntitySilverfish;
  16024. import net.minecraft.entity.monster.EntitySkeleton;
  16025. import net.minecraft.entity.monster.EntitySlime;
  16026. import net.minecraft.entity.monster.EntitySnowman;
  16027. import net.minecraft.entity.monster.EntitySpider;
  16028. import net.minecraft.entity.monster.EntityStray;
  16029. import net.minecraft.entity.monster.EntityVex;
  16030. import net.minecraft.entity.monster.EntityVindicator;
  16031. import net.minecraft.entity.monster.EntityWitch;
  16032. import net.minecraft.entity.monster.EntityWitherSkeleton;
  16033. import net.minecraft.entity.monster.EntityZombie;
  16034. import net.minecraft.entity.monster.EntityZombieVillager;
  16035. import net.minecraft.entity.passive.EntityBat;
  16036. import net.minecraft.entity.passive.EntityChicken;
  16037. import net.minecraft.entity.passive.EntityCow;
  16038. import net.minecraft.entity.passive.EntityDonkey;
  16039. import net.minecraft.entity.passive.EntityHorse;
  16040. import net.minecraft.entity.passive.EntityLlama;
  16041. import net.minecraft.entity.passive.EntityMooshroom;
  16042. import net.minecraft.entity.passive.EntityMule;
  16043. import net.minecraft.entity.passive.EntityOcelot;
  16044. import net.minecraft.entity.passive.EntityParrot;
  16045. import net.minecraft.entity.passive.EntityPig;
  16046. import net.minecraft.entity.passive.EntityRabbit;
  16047. import net.minecraft.entity.passive.EntitySheep;
  16048. import net.minecraft.entity.passive.EntitySkeletonHorse;
  16049. import net.minecraft.entity.passive.EntitySquid;
  16050. import net.minecraft.entity.passive.EntityVillager;
  16051. import net.minecraft.entity.passive.EntityWolf;
  16052. import net.minecraft.entity.passive.EntityZombieHorse;
  16053. import net.minecraft.entity.player.EntityPlayer;
  16054. import net.minecraft.entity.projectile.EntityDragonFireball;
  16055. import net.minecraft.entity.projectile.EntityEgg;
  16056. import net.minecraft.entity.projectile.EntityEvokerFangs;
  16057. import net.minecraft.entity.projectile.EntityLargeFireball;
  16058. import net.minecraft.entity.projectile.EntityLlamaSpit;
  16059. import net.minecraft.entity.projectile.EntityPotion;
  16060. import net.minecraft.entity.projectile.EntityShulkerBullet;
  16061. import net.minecraft.entity.projectile.EntitySmallFireball;
  16062. import net.minecraft.entity.projectile.EntitySnowball;
  16063. import net.minecraft.entity.projectile.EntitySpectralArrow;
  16064. import net.minecraft.entity.projectile.EntityTippedArrow;
  16065. import net.minecraft.entity.projectile.EntityWitherSkull;
  16066. import net.minecraft.nbt.NBTTagCompound;
  16067. import net.minecraft.stats.StatBase;
  16068. import net.minecraft.stats.StatList;
  16069. import net.minecraft.util.ResourceLocation;
  16070. import net.minecraft.util.registry.RegistryNamespaced;
  16071. import net.minecraft.world.World;
  16072. import net.minecraftforge.fml.relauncher.Side;
  16073. import net.minecraftforge.fml.relauncher.SideOnly;
  16074. import org.apache.logging.log4j.LogManager;
  16075. import org.apache.logging.log4j.Logger;
  16076.  
  16077. public class EntityList {
  16078. public static final ResourceLocation field_191307_a = new ResourceLocation("lightning_bolt");
  16079. private static final ResourceLocation field_191310_e = new ResourceLocation("player");
  16080. private static final Logger field_151516_b = LogManager.getLogger();
  16081. public static final RegistryNamespaced<ResourceLocation, Class<? extends Entity>> field_191308_b = new RegistryNamespaced();
  16082. public static final Map<ResourceLocation, EntityList.EntityEggInfo> field_75627_a = Maps.<ResourceLocation, EntityList.EntityEggInfo>newLinkedHashMap();
  16083. public static final Set<ResourceLocation> field_191309_d = Sets.<ResourceLocation>newHashSet();
  16084. private static final List<String> field_191311_g = Lists.<String>newArrayList();
  16085.  
  16086. @Nullable
  16087. public static ResourceLocation func_191301_a(Entity p_191301_0_) {
  16088. return func_191306_a(p_191301_0_.getClass());
  16089. }
  16090.  
  16091. @Nullable
  16092. public static ResourceLocation func_191306_a(Class<? extends Entity> p_191306_0_) {
  16093. return (ResourceLocation)field_191308_b.func_177774_c(p_191306_0_);
  16094. }
  16095.  
  16096. @Nullable
  16097. public static String func_75621_b(Entity p_75621_0_) {
  16098. int i = field_191308_b.func_148757_b(p_75621_0_.getClass());
  16099. return i == -1?null:(String)field_191311_g.get(i);
  16100. }
  16101.  
  16102. @Nullable
  16103. public static String func_191302_a(@Nullable ResourceLocation p_191302_0_) {
  16104. int i = field_191308_b.func_148757_b(field_191308_b.func_82594_a(p_191302_0_));
  16105. return i == -1?null:(String)field_191311_g.get(i);
  16106. }
  16107.  
  16108. @Nullable
  16109. @SideOnly(Side.CLIENT)
  16110. public static Class<? extends Entity> func_90035_a(int p_90035_0_) {
  16111. return (Class)field_191308_b.func_148754_a(p_90035_0_);
  16112. }
  16113.  
  16114. @Nullable
  16115. @SideOnly(Side.CLIENT)
  16116. public static Class<? extends Entity> func_192839_a(String p_192839_0_) {
  16117. return (Class)field_191308_b.func_82594_a(new ResourceLocation(p_192839_0_));
  16118. }
  16119.  
  16120. @Nullable
  16121. public static Entity func_191304_a(@Nullable Class<? extends Entity> p_191304_0_, World p_191304_1_) {
  16122. if(p_191304_0_ == null) {
  16123. return null;
  16124. } else {
  16125. try {
  16126. return (Entity)p_191304_0_.getConstructor(new Class[]{World.class}).newInstance(new Object[]{p_191304_1_});
  16127. } catch (Exception exception) {
  16128. exception.printStackTrace();
  16129. return null;
  16130. }
  16131. }
  16132. }
  16133.  
  16134. @Nullable
  16135. @SideOnly(Side.CLIENT)
  16136. public static Entity func_75616_a(int p_75616_0_, World p_75616_1_) {
  16137. return func_191304_a(func_90035_a(p_75616_0_), p_75616_1_);
  16138. }
  16139.  
  16140. @Nullable
  16141. public static Entity func_188429_b(ResourceLocation p_188429_0_, World p_188429_1_) {
  16142. return func_191304_a((Class)field_191308_b.func_82594_a(p_188429_0_), p_188429_1_);
  16143. }
  16144.  
  16145. @Nullable
  16146. public static Entity func_75615_a(NBTTagCompound p_75615_0_, World p_75615_1_) {
  16147. ResourceLocation resourcelocation = new ResourceLocation(p_75615_0_.func_74779_i("id"));
  16148. Entity entity = func_188429_b(resourcelocation, p_75615_1_);
  16149. if(entity == null) {
  16150. field_151516_b.warn((String)"Skipping Entity with id {}", (Object)resourcelocation);
  16151. } else {
  16152. entity.func_70020_e(p_75615_0_);
  16153. }
  16154.  
  16155. return entity;
  16156. }
  16157.  
  16158. public static Set<ResourceLocation> func_180124_b() {
  16159. return field_191309_d;
  16160. }
  16161.  
  16162. public static boolean func_180123_a(Entity p_180123_0_, ResourceLocation p_180123_1_) {
  16163. ResourceLocation resourcelocation = func_191306_a(p_180123_0_.getClass());
  16164. return resourcelocation != null?resourcelocation.equals(p_180123_1_):(p_180123_0_ instanceof EntityPlayer?field_191310_e.equals(p_180123_1_):(p_180123_0_ instanceof EntityLightningBolt?field_191307_a.equals(p_180123_1_):false));
  16165. }
  16166.  
  16167. public static boolean func_180125_b(ResourceLocation p_180125_0_) {
  16168. return field_191310_e.equals(p_180125_0_) || func_180124_b().contains(p_180125_0_);
  16169. }
  16170.  
  16171. public static String func_192840_b() {
  16172. StringBuilder stringbuilder = new StringBuilder();
  16173.  
  16174. for(ResourceLocation resourcelocation : func_180124_b()) {
  16175. stringbuilder.append((Object)resourcelocation).append(", ");
  16176. }
  16177.  
  16178. stringbuilder.append((Object)field_191310_e);
  16179. return stringbuilder.toString();
  16180. }
  16181.  
  16182. public static void func_151514_a() {
  16183. func_191303_a(1, "item", EntityItem.class, "Item");
  16184. func_191303_a(2, "xp_orb", EntityXPOrb.class, "XPOrb");
  16185. func_191303_a(3, "area_effect_cloud", EntityAreaEffectCloud.class, "AreaEffectCloud");
  16186. func_191303_a(4, "elder_guardian", EntityElderGuardian.class, "ElderGuardian");
  16187. func_191303_a(5, "wither_skeleton", EntityWitherSkeleton.class, "WitherSkeleton");
  16188. func_191303_a(6, "stray", EntityStray.class, "Stray");
  16189. func_191303_a(7, "egg", EntityEgg.class, "ThrownEgg");
  16190. func_191303_a(8, "leash_knot", EntityLeashKnot.class, "LeashKnot");
  16191. func_191303_a(9, "painting", EntityPainting.class, "Painting");
  16192. func_191303_a(10, "arrow", EntityTippedArrow.class, "Arrow");
  16193. func_191303_a(11, "snowball", EntitySnowball.class, "Snowball");
  16194. func_191303_a(12, "fireball", EntityLargeFireball.class, "Fireball");
  16195. func_191303_a(13, "small_fireball", EntitySmallFireball.class, "SmallFireball");
  16196. func_191303_a(14, "ender_pearl", EntityEnderPearl.class, "ThrownEnderpearl");
  16197. func_191303_a(15, "eye_of_ender_signal", EntityEnderEye.class, "EyeOfEnderSignal");
  16198. func_191303_a(16, "potion", EntityPotion.class, "ThrownPotion");
  16199. func_191303_a(17, "xp_bottle", EntityExpBottle.class, "ThrownExpBottle");
  16200. func_191303_a(18, "item_frame", EntityItemFrame.class, "ItemFrame");
  16201. func_191303_a(19, "wither_skull", EntityWitherSkull.class, "WitherSkull");
  16202. func_191303_a(20, "tnt", EntityTNTPrimed.class, "PrimedTnt");
  16203. func_191303_a(21, "falling_block", EntityFallingBlock.class, "FallingSand");
  16204. func_191303_a(22, "fireworks_rocket", EntityFireworkRocket.class, "FireworksRocketEntity");
  16205. func_191303_a(23, "husk", EntityHusk.class, "Husk");
  16206. func_191303_a(24, "spectral_arrow", EntitySpectralArrow.class, "SpectralArrow");
  16207. func_191303_a(25, "shulker_bullet", EntityShulkerBullet.class, "ShulkerBullet");
  16208. func_191303_a(26, "dragon_fireball", EntityDragonFireball.class, "DragonFireball");
  16209. func_191303_a(27, "zombie_villager", EntityZombieVillager.class, "ZombieVillager");
  16210. func_191303_a(28, "skeleton_horse", EntitySkeletonHorse.class, "SkeletonHorse");
  16211. func_191303_a(29, "zombie_horse", EntityZombieHorse.class, "ZombieHorse");
  16212. func_191303_a(30, "armor_stand", EntityArmorStand.class, "ArmorStand");
  16213. func_191303_a(31, "donkey", EntityDonkey.class, "Donkey");
  16214. func_191303_a(32, "mule", EntityMule.class, "Mule");
  16215. func_191303_a(33, "evocation_fangs", EntityEvokerFangs.class, "EvocationFangs");
  16216. func_191303_a(34, "evocation_illager", EntityEvoker.class, "EvocationIllager");
  16217. func_191303_a(35, "vex", EntityVex.class, "Vex");
  16218. func_191303_a(36, "vindication_illager", EntityVindicator.class, "VindicationIllager");
  16219. func_191303_a(37, "illusion_illager", EntityIllusionIllager.class, "IllusionIllager");
  16220. func_191303_a(40, "commandblock_minecart", EntityMinecartCommandBlock.class, EntityMinecart.Type.COMMAND_BLOCK.func_184954_b());
  16221. func_191303_a(41, "boat", EntityBoat.class, "Boat");
  16222. func_191303_a(42, "minecart", EntityMinecartEmpty.class, EntityMinecart.Type.RIDEABLE.func_184954_b());
  16223. func_191303_a(43, "chest_minecart", EntityMinecartChest.class, EntityMinecart.Type.CHEST.func_184954_b());
  16224. func_191303_a(44, "furnace_minecart", EntityMinecartFurnace.class, EntityMinecart.Type.FURNACE.func_184954_b());
  16225. func_191303_a(45, "tnt_minecart", EntityMinecartTNT.class, EntityMinecart.Type.TNT.func_184954_b());
  16226. func_191303_a(46, "hopper_minecart", EntityMinecartHopper.class, EntityMinecart.Type.HOPPER.func_184954_b());
  16227. func_191303_a(47, "spawner_minecart", EntityMinecartMobSpawner.class, EntityMinecart.Type.SPAWNER.func_184954_b());
  16228. func_191303_a(50, "creeper", EntityCreeper.class, "Creeper");
  16229. func_191303_a(51, "skeleton", EntitySkeleton.class, "Skeleton");
  16230. func_191303_a(52, "spider", EntitySpider.class, "Spider");
  16231. func_191303_a(53, "giant", EntityGiantZombie.class, "Giant");
  16232. func_191303_a(54, "zombie", EntityZombie.class, "Zombie");
  16233. func_191303_a(55, "slime", EntitySlime.class, "Slime");
  16234. func_191303_a(56, "ghast", EntityGhast.class, "Ghast");
  16235. func_191303_a(57, "zombie_pigman", EntityPigZombie.class, "PigZombie");
  16236. func_191303_a(58, "enderman", EntityEnderman.class, "Enderman");
  16237. func_191303_a(59, "cave_spider", EntityCaveSpider.class, "CaveSpider");
  16238. func_191303_a(60, "silverfish", EntitySilverfish.class, "Silverfish");
  16239. func_191303_a(61, "blaze", EntityBlaze.class, "Blaze");
  16240. func_191303_a(62, "magma_cube", EntityMagmaCube.class, "LavaSlime");
  16241. func_191303_a(63, "ender_dragon", EntityDragon.class, "EnderDragon");
  16242. func_191303_a(64, "wither", EntityWither.class, "WitherBoss");
  16243. func_191303_a(65, "bat", EntityBat.class, "Bat");
  16244. func_191303_a(66, "witch", EntityWitch.class, "Witch");
  16245. func_191303_a(67, "endermite", EntityEndermite.class, "Endermite");
  16246. func_191303_a(68, "guardian", EntityGuardian.class, "Guardian");
  16247. func_191303_a(69, "shulker", EntityShulker.class, "Shulker");
  16248. func_191303_a(90, "pig", EntityPig.class, "Pig");
  16249. func_191303_a(91, "sheep", EntitySheep.class, "Sheep");
  16250. func_191303_a(92, "cow", EntityCow.class, "Cow");
  16251. func_191303_a(93, "chicken", EntityChicken.class, "Chicken");
  16252. func_191303_a(94, "squid", EntitySquid.class, "Squid");
  16253. func_191303_a(95, "wolf", EntityWolf.class, "Wolf");
  16254. func_191303_a(96, "mooshroom", EntityMooshroom.class, "MushroomCow");
  16255. func_191303_a(97, "snowman", EntitySnowman.class, "SnowMan");
  16256. func_191303_a(98, "ocelot", EntityOcelot.class, "Ozelot");
  16257. func_191303_a(99, "villager_golem", EntityIronGolem.class, "VillagerGolem");
  16258. func_191303_a(100, "horse", EntityHorse.class, "Horse");
  16259. func_191303_a(101, "rabbit", EntityRabbit.class, "Rabbit");
  16260. func_191303_a(102, "polar_bear", EntityPolarBear.class, "PolarBear");
  16261. func_191303_a(103, "llama", EntityLlama.class, "Llama");
  16262. func_191303_a(104, "llama_spit", EntityLlamaSpit.class, "LlamaSpit");
  16263. func_191303_a(105, "parrot", EntityParrot.class, "Parrot");
  16264. func_191303_a(120, "villager", EntityVillager.class, "Villager");
  16265. func_191303_a(200, "ender_crystal", EntityEnderCrystal.class, "EnderCrystal");
  16266. func_191305_a("bat", 4996656, 986895);
  16267. func_191305_a("blaze", 16167425, 16775294);
  16268. func_191305_a("cave_spider", 803406, 11013646);
  16269. func_191305_a("chicken", 10592673, 16711680);
  16270. func_191305_a("cow", 4470310, 10592673);
  16271. func_191305_a("creeper", 894731, 0);
  16272. func_191305_a("donkey", 5457209, 8811878);
  16273. func_191305_a("elder_guardian", 13552826, 7632531);
  16274. func_191305_a("enderman", 1447446, 0);
  16275. func_191305_a("endermite", 1447446, 7237230);
  16276. func_191305_a("evocation_illager", 9804699, 1973274);
  16277. func_191305_a("ghast", 16382457, 12369084);
  16278. func_191305_a("guardian", 5931634, 15826224);
  16279. func_191305_a("horse", 12623485, 15656192);
  16280. func_191305_a("husk", 7958625, 15125652);
  16281. func_191305_a("llama", 12623485, 10051392);
  16282. func_191305_a("magma_cube", 3407872, 16579584);
  16283. func_191305_a("mooshroom", 10489616, 12040119);
  16284. func_191305_a("mule", 1769984, 5321501);
  16285. func_191305_a("ocelot", 15720061, 5653556);
  16286. func_191305_a("parrot", 894731, 16711680);
  16287. func_191305_a("pig", 15771042, 14377823);
  16288. func_191305_a("polar_bear", 15921906, 9803152);
  16289. func_191305_a("rabbit", 10051392, 7555121);
  16290. func_191305_a("sheep", 15198183, 16758197);
  16291. func_191305_a("shulker", 9725844, 5060690);
  16292. func_191305_a("silverfish", 7237230, 3158064);
  16293. func_191305_a("skeleton", 12698049, 4802889);
  16294. func_191305_a("skeleton_horse", 6842447, 15066584);
  16295. func_191305_a("slime", 5349438, 8306542);
  16296. func_191305_a("spider", 3419431, 11013646);
  16297. func_191305_a("squid", 2243405, 7375001);
  16298. func_191305_a("stray", 6387319, 14543594);
  16299. func_191305_a("vex", 8032420, 15265265);
  16300. func_191305_a("villager", 5651507, 12422002);
  16301. func_191305_a("vindication_illager", 9804699, 2580065);
  16302. func_191305_a("witch", 3407872, 5349438);
  16303. func_191305_a("wither_skeleton", 1315860, 4672845);
  16304. func_191305_a("wolf", 14144467, 13545366);
  16305. func_191305_a("zombie", '\uafaf', 7969893);
  16306. func_191305_a("zombie_horse", 3232308, 9945732);
  16307. func_191305_a("zombie_pigman", 15373203, 5009705);
  16308. func_191305_a("zombie_villager", 5651507, 7969893);
  16309. field_191309_d.add(field_191307_a);
  16310. }
  16311.  
  16312. private static void func_191303_a(int p_191303_0_, String p_191303_1_, Class<? extends Entity> p_191303_2_, String p_191303_3_) {
  16313. try {
  16314. p_191303_2_.getConstructor(new Class[]{World.class});
  16315. } catch (NoSuchMethodException var5) {
  16316. throw new RuntimeException("Invalid class " + p_191303_2_ + " no constructor taking " + World.class.getName());
  16317. }
  16318.  
  16319. if((p_191303_2_.getModifiers() & 1024) == 1024) {
  16320. throw new RuntimeException("Invalid abstract class " + p_191303_2_);
  16321. } else {
  16322. ResourceLocation resourcelocation = new ResourceLocation(p_191303_1_);
  16323. field_191308_b.func_177775_a(p_191303_0_, resourcelocation, p_191303_2_);
  16324. field_191309_d.add(resourcelocation);
  16325.  
  16326. while(field_191311_g.size() <= p_191303_0_) {
  16327. field_191311_g.add((String)null);
  16328. }
  16329.  
  16330. field_191311_g.set(p_191303_0_, p_191303_3_);
  16331. }
  16332. }
  16333.  
  16334. protected static EntityList.EntityEggInfo func_191305_a(String p_191305_0_, int p_191305_1_, int p_191305_2_) {
  16335. ResourceLocation resourcelocation = new ResourceLocation(p_191305_0_);
  16336. return (EntityList.EntityEggInfo)field_75627_a.put(resourcelocation, new EntityList.EntityEggInfo(resourcelocation, p_191305_1_, p_191305_2_));
  16337. }
  16338.  
  16339. public static class EntityEggInfo {
  16340. public final ResourceLocation field_75613_a;
  16341. public final int field_75611_b;
  16342. public final int field_75612_c;
  16343. public final StatBase field_151512_d;
  16344. public final StatBase field_151513_e;
  16345.  
  16346. public EntityEggInfo(ResourceLocation p_i47341_1_, int p_i47341_2_, int p_i47341_3_) {
  16347. this.field_75613_a = p_i47341_1_;
  16348. this.field_75611_b = p_i47341_2_;
  16349. this.field_75612_c = p_i47341_3_;
  16350. this.field_151512_d = StatList.func_151182_a(this);
  16351. this.field_151513_e = StatList.func_151176_b(this);
  16352. }
  16353. }
  16354. }
  16355.  
  16356. Patching failed: minecraft\net\minecraft\util\EntitySelectors.java
  16357. Hunk 1 failed! Cannot find hunk target
  16358. public static <T extends Entity> Predicate<T> func_188442_a(final Entity p_188442_0_) {
  16359. final Team team = p_188442_0_.func_96124_cp();
  16360. final Team.CollisionRule team$collisionrule = team == null ? Team.CollisionRule.ALWAYS : team.func_186681_k();
  16361. - return team$collisionrule == Team.CollisionRule.NEVER ? Predicates.alwaysFalse() : Predicates.and(field_180132_d, new Predicate<Entity>() {
  16362. + Predicate<?> ret = team$collisionrule == Team.CollisionRule.NEVER ? Predicates.alwaysFalse() : Predicates.and(field_180132_d, new Predicate<Entity>() {
  16363. public boolean apply(@Nullable Entity p_apply_1_) {
  16364. if (!p_apply_1_.func_70104_M()) {
  16365. return false;
  16366. File state
  16367. package net.minecraft.util;
  16368.  
  16369. import com.google.common.base.Predicate;
  16370. import com.google.common.base.Predicates;
  16371. import javax.annotation.Nullable;
  16372. import net.minecraft.entity.Entity;
  16373. import net.minecraft.entity.EntityLiving;
  16374. import net.minecraft.entity.EntityLivingBase;
  16375. import net.minecraft.entity.item.EntityArmorStand;
  16376. import net.minecraft.entity.player.EntityPlayer;
  16377. import net.minecraft.inventory.IInventory;
  16378. import net.minecraft.item.ItemStack;
  16379. import net.minecraft.scoreboard.Team;
  16380.  
  16381. public final class EntitySelectors {
  16382. public static final Predicate<Entity> field_94557_a = new Predicate<Entity>() {
  16383. public boolean apply(@Nullable Entity p_apply_1_) {
  16384. return p_apply_1_.func_70089_S();
  16385. }
  16386. };
  16387. public static final Predicate<Entity> field_152785_b = new Predicate<Entity>() {
  16388. public boolean apply(@Nullable Entity p_apply_1_) {
  16389. return p_apply_1_.func_70089_S() && !p_apply_1_.func_184207_aI() && !p_apply_1_.func_184218_aH();
  16390. }
  16391. };
  16392. public static final Predicate<Entity> field_96566_b = new Predicate<Entity>() {
  16393. public boolean apply(@Nullable Entity p_apply_1_) {
  16394. return p_apply_1_ instanceof IInventory && p_apply_1_.func_70089_S();
  16395. }
  16396. };
  16397. public static final Predicate<Entity> field_188444_d = new Predicate<Entity>() {
  16398. public boolean apply(@Nullable Entity p_apply_1_) {
  16399. return !(p_apply_1_ instanceof EntityPlayer) || !((EntityPlayer)p_apply_1_).func_175149_v() && !((EntityPlayer)p_apply_1_).func_184812_l_();
  16400. }
  16401. };
  16402. public static final Predicate<Entity> field_180132_d = new Predicate<Entity>() {
  16403. public boolean apply(@Nullable Entity p_apply_1_) {
  16404. return !(p_apply_1_ instanceof EntityPlayer) || !((EntityPlayer)p_apply_1_).func_175149_v();
  16405. }
  16406. };
  16407.  
  16408. public static <T extends Entity> Predicate<T> func_188443_a(final double p_188443_0_, final double p_188443_2_, final double p_188443_4_, double p_188443_6_) {
  16409. final double d0 = p_188443_6_ * p_188443_6_;
  16410. return new Predicate<T>() {
  16411. public boolean apply(@Nullable T p_apply_1_) {
  16412. return p_apply_1_ != null && p_apply_1_.func_70092_e(p_188443_0_, p_188443_2_, p_188443_4_) <= d0;
  16413. }
  16414. };
  16415. }
  16416.  
  16417. public static <T extends Entity> Predicate<T> func_188442_a(final Entity p_188442_0_) {
  16418. final Team team = p_188442_0_.func_96124_cp();
  16419. final Team.CollisionRule team$collisionrule = team == null?Team.CollisionRule.ALWAYS:team.func_186681_k();
  16420. return team$collisionrule == Team.CollisionRule.NEVER?Predicates.alwaysFalse():Predicates.and(field_180132_d, new Predicate<Entity>() {
  16421. public boolean apply(@Nullable Entity p_apply_1_) {
  16422. if(!p_apply_1_.func_70104_M()) {
  16423. return false;
  16424. } else if(!p_188442_0_.field_70170_p.field_72995_K || p_apply_1_ instanceof EntityPlayer && ((EntityPlayer)p_apply_1_).func_175144_cb()) {
  16425. Team team1 = p_apply_1_.func_96124_cp();
  16426. Team.CollisionRule team$collisionrule1 = team1 == null?Team.CollisionRule.ALWAYS:team1.func_186681_k();
  16427. if(team$collisionrule1 == Team.CollisionRule.NEVER) {
  16428. return false;
  16429. } else {
  16430. boolean flag = team != null && team.func_142054_a(team1);
  16431. return (team$collisionrule == Team.CollisionRule.HIDE_FOR_OWN_TEAM || team$collisionrule1 == Team.CollisionRule.HIDE_FOR_OWN_TEAM) && flag?false:team$collisionrule != Team.CollisionRule.HIDE_FOR_OTHER_TEAMS && team$collisionrule1 != Team.CollisionRule.HIDE_FOR_OTHER_TEAMS || flag;
  16432. }
  16433. } else {
  16434. return false;
  16435. }
  16436. }
  16437. });
  16438. }
  16439.  
  16440. public static Predicate<Entity> func_191324_b(final Entity p_191324_0_) {
  16441. return new Predicate<Entity>() {
  16442. public boolean apply(@Nullable Entity p_apply_1_) {
  16443. while(true) {
  16444. if(p_apply_1_.func_184218_aH()) {
  16445. p_apply_1_ = p_apply_1_.func_184187_bx();
  16446. if(p_apply_1_ != p_191324_0_) {
  16447. continue;
  16448. }
  16449.  
  16450. return false;
  16451. }
  16452.  
  16453. return true;
  16454. }
  16455. }
  16456. };
  16457. }
  16458.  
  16459. public static class ArmoredMob implements Predicate<Entity> {
  16460. private final ItemStack field_96567_c;
  16461.  
  16462. public ArmoredMob(ItemStack p_i1584_1_) {
  16463. this.field_96567_c = p_i1584_1_;
  16464. }
  16465.  
  16466. public boolean apply(@Nullable Entity p_apply_1_) {
  16467. if(!p_apply_1_.func_70089_S()) {
  16468. return false;
  16469. } else if(!(p_apply_1_ instanceof EntityLivingBase)) {
  16470. return false;
  16471. } else {
  16472. EntityLivingBase entitylivingbase = (EntityLivingBase)p_apply_1_;
  16473. return !entitylivingbase.func_184582_a(EntityLiving.func_184640_d(this.field_96567_c)).func_190926_b()?false:(entitylivingbase instanceof EntityLiving?((EntityLiving)entitylivingbase).func_98052_bS():(entitylivingbase instanceof EntityArmorStand?true:entitylivingbase instanceof EntityPlayer));
  16474. }
  16475. }
  16476. }
  16477. }
  16478.  
  16479. Patching failed: minecraft\net\minecraft\entity\ai\EntityAINearestAttackableTarget.java
  16480. Hunk 2 failed! Cannot find hunk target
  16481.  
  16482. return 1.0D;
  16483. }
  16484. - }, this.field_82643_g);
  16485. + }, (Predicate<EntityPlayer>)this.field_82643_g);
  16486. return this.field_75309_a != null;
  16487. }
  16488. }
  16489. File state
  16490. package net.minecraft.entity.ai;
  16491.  
  16492. import com.google.common.base.Function;
  16493. import com.google.common.base.Predicate;
  16494. import java.util.Collections;
  16495. import java.util.Comparator;
  16496. import java.util.List;
  16497. import javax.annotation.Nullable;
  16498. import net.minecraft.entity.Entity;
  16499. import net.minecraft.entity.EntityCreature;
  16500. import net.minecraft.entity.EntityLivingBase;
  16501. import net.minecraft.entity.ai.EntityAITarget;
  16502. import net.minecraft.entity.monster.EntityCreeper;
  16503. import net.minecraft.entity.monster.EntitySkeleton;
  16504. import net.minecraft.entity.monster.EntityZombie;
  16505. import net.minecraft.entity.player.EntityPlayer;
  16506. import net.minecraft.entity.player.EntityPlayerMP;
  16507. import net.minecraft.init.Items;
  16508. import net.minecraft.inventory.EntityEquipmentSlot;
  16509. import net.minecraft.item.ItemStack;
  16510. import net.minecraft.util.EntitySelectors;
  16511. import net.minecraft.util.math.AxisAlignedBB;
  16512.  
  16513. public class EntityAINearestAttackableTarget<T extends EntityLivingBase> extends EntityAITarget {
  16514. protected final Class<T> field_75307_b;
  16515. private final int field_75308_c;
  16516. protected final EntityAINearestAttackableTarget.Sorter field_75306_g;
  16517. protected final Predicate<? super T> field_82643_g;
  16518. protected T field_75309_a;
  16519.  
  16520. public EntityAINearestAttackableTarget(EntityCreature p_i45878_1_, Class<T> p_i45878_2_, boolean p_i45878_3_) {
  16521. this(p_i45878_1_, p_i45878_2_, p_i45878_3_, false);
  16522. }
  16523.  
  16524. public EntityAINearestAttackableTarget(EntityCreature p_i45879_1_, Class<T> p_i45879_2_, boolean p_i45879_3_, boolean p_i45879_4_) {
  16525. this(p_i45879_1_, p_i45879_2_, 10, p_i45879_3_, p_i45879_4_, (Predicate<? super T>)null);
  16526. }
  16527.  
  16528. public EntityAINearestAttackableTarget(EntityCreature p_i45880_1_, Class<T> p_i45880_2_, int p_i45880_3_, boolean p_i45880_4_, boolean p_i45880_5_, @Nullable final Predicate<? super T> p_i45880_6_) {
  16529. super(p_i45880_1_, p_i45880_4_, p_i45880_5_);
  16530. this.field_75307_b = p_i45880_2_;
  16531. this.field_75308_c = p_i45880_3_;
  16532. this.field_75306_g = new EntityAINearestAttackableTarget.Sorter(p_i45880_1_);
  16533. this.func_75248_a(1);
  16534. this.field_82643_g = new Predicate<T>() {
  16535. public boolean apply(@Nullable T p_apply_1_) {
  16536. return p_apply_1_ == null?false:(p_i45880_6_ != null && !p_i45880_6_.apply(p_apply_1_)?false:(!EntitySelectors.field_180132_d.apply(p_apply_1_)?false:EntityAINearestAttackableTarget.this.func_75296_a(p_apply_1_, false)));
  16537. }
  16538. };
  16539. }
  16540.  
  16541. public boolean func_75250_a() {
  16542. if(this.field_75308_c > 0 && this.field_75299_d.func_70681_au().nextInt(this.field_75308_c) != 0) {
  16543. return false;
  16544. } else if(this.field_75307_b != EntityPlayer.class && this.field_75307_b != EntityPlayerMP.class) {
  16545. List<T> list = this.field_75299_d.field_70170_p.<T>func_175647_a(this.field_75307_b, this.func_188511_a(this.func_111175_f()), this.field_82643_g);
  16546. if(list.isEmpty()) {
  16547. return false;
  16548. } else {
  16549. Collections.sort(list, this.field_75306_g);
  16550. this.field_75309_a = (EntityLivingBase)list.get(0);
  16551. return true;
  16552. }
  16553. } else {
  16554. this.field_75309_a = this.field_75299_d.field_70170_p.func_184150_a(this.field_75299_d.field_70165_t, this.field_75299_d.field_70163_u + (double)this.field_75299_d.func_70047_e(), this.field_75299_d.field_70161_v, this.func_111175_f(), this.func_111175_f(), new Function<EntityPlayer, Double>() {
  16555. @Nullable
  16556. public Double apply(@Nullable EntityPlayer p_apply_1_) {
  16557. ItemStack itemstack = p_apply_1_.func_184582_a(EntityEquipmentSlot.HEAD);
  16558. if(itemstack.func_77973_b() == Items.field_151144_bL) {
  16559. int i = itemstack.func_77952_i();
  16560. boolean flag = EntityAINearestAttackableTarget.this.field_75299_d instanceof EntitySkeleton && i == 0;
  16561. boolean flag1 = EntityAINearestAttackableTarget.this.field_75299_d instanceof EntityZombie && i == 2;
  16562. boolean flag2 = EntityAINearestAttackableTarget.this.field_75299_d instanceof EntityCreeper && i == 4;
  16563. if(flag || flag1 || flag2) {
  16564. return Double.valueOf(0.5D);
  16565. }
  16566. }
  16567.  
  16568. return Double.valueOf(1.0D);
  16569. }
  16570. }, this.field_82643_g);
  16571. return this.field_75309_a != null;
  16572. }
  16573. }
  16574.  
  16575. protected AxisAlignedBB func_188511_a(double p_188511_1_) {
  16576. return this.field_75299_d.func_174813_aQ().func_72314_b(p_188511_1_, 4.0D, p_188511_1_);
  16577. }
  16578.  
  16579. public void func_75249_e() {
  16580. this.field_75299_d.func_70624_b(this.field_75309_a);
  16581. super.func_75249_e();
  16582. }
  16583.  
  16584. public static class Sorter implements Comparator<Entity> {
  16585. private final Entity field_75459_b;
  16586.  
  16587. public Sorter(Entity p_i1662_1_) {
  16588. this.field_75459_b = p_i1662_1_;
  16589. }
  16590.  
  16591. public int compare(Entity p_compare_1_, Entity p_compare_2_) {
  16592. double d0 = this.field_75459_b.func_70068_e(p_compare_1_);
  16593. double d1 = this.field_75459_b.func_70068_e(p_compare_2_);
  16594. return d0 < d1?-1:(d0 > d1?1:0);
  16595. }
  16596. }
  16597. }
  16598.  
  16599. Patching failed: minecraft\net\minecraft\entity\EntityHanging.java
  16600. Hunk 1 failed! Cannot find hunk target
  16601. return this.field_174861_a;
  16602. }
  16603.  
  16604. + @SuppressWarnings("incomplete-switch")
  16605. public float func_184229_a(Rotation p_184229_1_) {
  16606. if (this.field_174860_b != null && this.field_174860_b.func_176740_k() != EnumFacing.Axis.Y) {
  16607. switch(p_184229_1_) {
  16608. File state
  16609. package net.minecraft.entity;
  16610.  
  16611. import com.google.common.base.Predicate;
  16612. import javax.annotation.Nullable;
  16613. import net.minecraft.block.BlockRedstoneDiode;
  16614. import net.minecraft.block.state.IBlockState;
  16615. import net.minecraft.entity.Entity;
  16616. import net.minecraft.entity.MoverType;
  16617. import net.minecraft.entity.effect.EntityLightningBolt;
  16618. import net.minecraft.entity.item.EntityItem;
  16619. import net.minecraft.entity.player.EntityPlayer;
  16620. import net.minecraft.item.ItemStack;
  16621. import net.minecraft.nbt.NBTTagCompound;
  16622. import net.minecraft.util.DamageSource;
  16623. import net.minecraft.util.EnumFacing;
  16624. import net.minecraft.util.Mirror;
  16625. import net.minecraft.util.Rotation;
  16626. import net.minecraft.util.math.AxisAlignedBB;
  16627. import net.minecraft.util.math.BlockPos;
  16628. import net.minecraft.util.math.MathHelper;
  16629. import net.minecraft.world.World;
  16630. import org.apache.commons.lang3.Validate;
  16631.  
  16632. public abstract class EntityHanging extends Entity {
  16633. private static final Predicate<Entity> field_184524_c = new Predicate<Entity>() {
  16634. public boolean apply(@Nullable Entity p_apply_1_) {
  16635. return p_apply_1_ instanceof EntityHanging;
  16636. }
  16637. };
  16638. private int field_70520_f;
  16639. protected BlockPos field_174861_a;
  16640. @Nullable
  16641. public EnumFacing field_174860_b;
  16642.  
  16643. public EntityHanging(World p_i1588_1_) {
  16644. super(p_i1588_1_);
  16645. this.func_70105_a(0.5F, 0.5F);
  16646. }
  16647.  
  16648. public EntityHanging(World p_i45853_1_, BlockPos p_i45853_2_) {
  16649. this(p_i45853_1_);
  16650. this.field_174861_a = p_i45853_2_;
  16651. }
  16652.  
  16653. protected void func_70088_a() {
  16654. }
  16655.  
  16656. protected void func_174859_a(EnumFacing p_174859_1_) {
  16657. Validate.notNull(p_174859_1_);
  16658. Validate.isTrue(p_174859_1_.func_176740_k().func_176722_c());
  16659. this.field_174860_b = p_174859_1_;
  16660. this.field_70177_z = (float)(this.field_174860_b.func_176736_b() * 90);
  16661. this.field_70126_B = this.field_70177_z;
  16662. this.func_174856_o();
  16663. }
  16664.  
  16665. protected void func_174856_o() {
  16666. if(this.field_174860_b != null) {
  16667. double d0 = (double)this.field_174861_a.func_177958_n() + 0.5D;
  16668. double d1 = (double)this.field_174861_a.func_177956_o() + 0.5D;
  16669. double d2 = (double)this.field_174861_a.func_177952_p() + 0.5D;
  16670. double d3 = 0.46875D;
  16671. double d4 = this.func_190202_a(this.func_82329_d());
  16672. double d5 = this.func_190202_a(this.func_82330_g());
  16673. d0 = d0 - (double)this.field_174860_b.func_82601_c() * 0.46875D;
  16674. d2 = d2 - (double)this.field_174860_b.func_82599_e() * 0.46875D;
  16675. d1 = d1 + d5;
  16676. EnumFacing enumfacing = this.field_174860_b.func_176735_f();
  16677. d0 = d0 + d4 * (double)enumfacing.func_82601_c();
  16678. d2 = d2 + d4 * (double)enumfacing.func_82599_e();
  16679. this.field_70165_t = d0;
  16680. this.field_70163_u = d1;
  16681. this.field_70161_v = d2;
  16682. double d6 = (double)this.func_82329_d();
  16683. double d7 = (double)this.func_82330_g();
  16684. double d8 = (double)this.func_82329_d();
  16685. if(this.field_174860_b.func_176740_k() == EnumFacing.Axis.Z) {
  16686. d8 = 1.0D;
  16687. } else {
  16688. d6 = 1.0D;
  16689. }
  16690.  
  16691. d6 = d6 / 32.0D;
  16692. d7 = d7 / 32.0D;
  16693. d8 = d8 / 32.0D;
  16694. this.func_174826_a(new AxisAlignedBB(d0 - d6, d1 - d7, d2 - d8, d0 + d6, d1 + d7, d2 + d8));
  16695. }
  16696. }
  16697.  
  16698. private double func_190202_a(int p_190202_1_) {
  16699. return p_190202_1_ % 32 == 0?0.5D:0.0D;
  16700. }
  16701.  
  16702. public void func_70071_h_() {
  16703. this.field_70169_q = this.field_70165_t;
  16704. this.field_70167_r = this.field_70163_u;
  16705. this.field_70166_s = this.field_70161_v;
  16706. if(this.field_70520_f++ == 100 && !this.field_70170_p.field_72995_K) {
  16707. this.field_70520_f = 0;
  16708. if(!this.field_70128_L && !this.func_70518_d()) {
  16709. this.func_70106_y();
  16710. this.func_110128_b((Entity)null);
  16711. }
  16712. }
  16713.  
  16714. }
  16715.  
  16716. public boolean func_70518_d() {
  16717. if(!this.field_70170_p.func_184144_a(this, this.func_174813_aQ()).isEmpty()) {
  16718. return false;
  16719. } else {
  16720. int i = Math.max(1, this.func_82329_d() / 16);
  16721. int j = Math.max(1, this.func_82330_g() / 16);
  16722. BlockPos blockpos = this.field_174861_a.func_177972_a(this.field_174860_b.func_176734_d());
  16723. EnumFacing enumfacing = this.field_174860_b.func_176735_f();
  16724. BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
  16725.  
  16726. for(int k = 0; k < i; ++k) {
  16727. for(int l = 0; l < j; ++l) {
  16728. int i1 = (i - 1) / -2;
  16729. int j1 = (j - 1) / -2;
  16730. blockpos$mutableblockpos.func_189533_g(blockpos).func_189534_c(enumfacing, k + i1).func_189534_c(EnumFacing.UP, l + j1);
  16731. IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos$mutableblockpos);
  16732. if(!iblockstate.func_185904_a().func_76220_a() && !BlockRedstoneDiode.func_185546_B(iblockstate)) {
  16733. return false;
  16734. }
  16735. }
  16736. }
  16737.  
  16738. return this.field_70170_p.func_175674_a(this, this.func_174813_aQ(), field_184524_c).isEmpty();
  16739. }
  16740. }
  16741.  
  16742. public boolean func_70067_L() {
  16743. return true;
  16744. }
  16745.  
  16746. public boolean func_85031_j(Entity p_85031_1_) {
  16747. return p_85031_1_ instanceof EntityPlayer?this.func_70097_a(DamageSource.func_76365_a((EntityPlayer)p_85031_1_), 0.0F):false;
  16748. }
  16749.  
  16750. public EnumFacing func_174811_aO() {
  16751. return this.field_174860_b;
  16752. }
  16753.  
  16754. public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) {
  16755. if(this.func_180431_b(p_70097_1_)) {
  16756. return false;
  16757. } else {
  16758. if(!this.field_70128_L && !this.field_70170_p.field_72995_K) {
  16759. this.func_70106_y();
  16760. this.func_70018_K();
  16761. this.func_110128_b(p_70097_1_.func_76346_g());
  16762. }
  16763.  
  16764. return true;
  16765. }
  16766. }
  16767.  
  16768. public void func_70091_d(MoverType p_70091_1_, double p_70091_2_, double p_70091_4_, double p_70091_6_) {
  16769. if(!this.field_70170_p.field_72995_K && !this.field_70128_L && p_70091_2_ * p_70091_2_ + p_70091_4_ * p_70091_4_ + p_70091_6_ * p_70091_6_ > 0.0D) {
  16770. this.func_70106_y();
  16771. this.func_110128_b((Entity)null);
  16772. }
  16773.  
  16774. }
  16775.  
  16776. public void func_70024_g(double p_70024_1_, double p_70024_3_, double p_70024_5_) {
  16777. if(!this.field_70170_p.field_72995_K && !this.field_70128_L && p_70024_1_ * p_70024_1_ + p_70024_3_ * p_70024_3_ + p_70024_5_ * p_70024_5_ > 0.0D) {
  16778. this.func_70106_y();
  16779. this.func_110128_b((Entity)null);
  16780. }
  16781.  
  16782. }
  16783.  
  16784. public void func_70014_b(NBTTagCompound p_70014_1_) {
  16785. p_70014_1_.func_74774_a("Facing", (byte)this.field_174860_b.func_176736_b());
  16786. BlockPos blockpos = this.func_174857_n();
  16787. p_70014_1_.func_74768_a("TileX", blockpos.func_177958_n());
  16788. p_70014_1_.func_74768_a("TileY", blockpos.func_177956_o());
  16789. p_70014_1_.func_74768_a("TileZ", blockpos.func_177952_p());
  16790. }
  16791.  
  16792. public void func_70037_a(NBTTagCompound p_70037_1_) {
  16793. this.field_174861_a = new BlockPos(p_70037_1_.func_74762_e("TileX"), p_70037_1_.func_74762_e("TileY"), p_70037_1_.func_74762_e("TileZ"));
  16794. this.func_174859_a(EnumFacing.func_176731_b(p_70037_1_.func_74771_c("Facing")));
  16795. }
  16796.  
  16797. public abstract int func_82329_d();
  16798.  
  16799. public abstract int func_82330_g();
  16800.  
  16801. public abstract void func_110128_b(@Nullable Entity p_110128_1_);
  16802.  
  16803. public abstract void func_184523_o();
  16804.  
  16805. public EntityItem func_70099_a(ItemStack p_70099_1_, float p_70099_2_) {
  16806. EntityItem entityitem = new EntityItem(this.field_70170_p, this.field_70165_t + (double)((float)this.field_174860_b.func_82601_c() * 0.15F), this.field_70163_u + (double)p_70099_2_, this.field_70161_v + (double)((float)this.field_174860_b.func_82599_e() * 0.15F), p_70099_1_);
  16807. entityitem.func_174869_p();
  16808. this.field_70170_p.func_72838_d(entityitem);
  16809. return entityitem;
  16810. }
  16811.  
  16812. protected boolean func_142008_O() {
  16813. return false;
  16814. }
  16815.  
  16816. public void func_70107_b(double p_70107_1_, double p_70107_3_, double p_70107_5_) {
  16817. this.field_174861_a = new BlockPos(p_70107_1_, p_70107_3_, p_70107_5_);
  16818. this.func_174856_o();
  16819. this.field_70160_al = true;
  16820. }
  16821.  
  16822. public BlockPos func_174857_n() {
  16823. return this.field_174861_a;
  16824. }
  16825.  
  16826. public float func_184229_a(Rotation p_184229_1_) {
  16827. if(this.field_174860_b != null && this.field_174860_b.func_176740_k() != EnumFacing.Axis.Y) {
  16828. switch(p_184229_1_) {
  16829. case CLOCKWISE_180:
  16830. this.field_174860_b = this.field_174860_b.func_176734_d();
  16831. break;
  16832. case COUNTERCLOCKWISE_90:
  16833. this.field_174860_b = this.field_174860_b.func_176735_f();
  16834. break;
  16835. case CLOCKWISE_90:
  16836. this.field_174860_b = this.field_174860_b.func_176746_e();
  16837. }
  16838. }
  16839.  
  16840. float f = MathHelper.func_76142_g(this.field_70177_z);
  16841. switch(p_184229_1_) {
  16842. case CLOCKWISE_180:
  16843. return f + 180.0F;
  16844. case COUNTERCLOCKWISE_90:
  16845. return f + 90.0F;
  16846. case CLOCKWISE_90:
  16847. return f + 270.0F;
  16848. default:
  16849. return f;
  16850. }
  16851. }
  16852.  
  16853. public float func_184217_a(Mirror p_184217_1_) {
  16854. return this.func_184229_a(p_184217_1_.func_185800_a(this.field_174860_b));
  16855. }
  16856.  
  16857. public void func_70077_a(EntityLightningBolt p_70077_1_) {
  16858. }
  16859. }
  16860.  
  16861. Patching failed: minecraft\net\minecraft\entity\monster\EntityEnderman.java
  16862. Hunk 1 failed! Cannot find hunk target
  16863. public void func_75246_d() {
  16864. if (this.field_179448_g != null) {
  16865. if (--this.field_179450_h <= 0) {
  16866. - this.field_75309_a = (T)this.field_179448_g;
  16867. + this.field_75309_a = this.field_179448_g;
  16868. this.field_179448_g = null;
  16869. super.func_75249_e();
  16870. }
  16871. File state
  16872. package net.minecraft.entity.monster;
  16873.  
  16874. import com.google.common.base.Function;
  16875. import com.google.common.base.Optional;
  16876. import com.google.common.base.Predicate;
  16877. import com.google.common.collect.Sets;
  16878. import java.util.Random;
  16879. import java.util.Set;
  16880. import java.util.UUID;
  16881. import javax.annotation.Nullable;
  16882. import net.minecraft.block.Block;
  16883. import net.minecraft.block.material.Material;
  16884. import net.minecraft.block.state.IBlockState;
  16885. import net.minecraft.entity.Entity;
  16886. import net.minecraft.entity.EntityLiving;
  16887. import net.minecraft.entity.EntityLivingBase;
  16888. import net.minecraft.entity.SharedMonsterAttributes;
  16889. import net.minecraft.entity.ai.EntityAIAttackMelee;
  16890. import net.minecraft.entity.ai.EntityAIBase;
  16891. import net.minecraft.entity.ai.EntityAIHurtByTarget;
  16892. import net.minecraft.entity.ai.EntityAILookIdle;
  16893. import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
  16894. import net.minecraft.entity.ai.EntityAISwimming;
  16895. import net.minecraft.entity.ai.EntityAIWanderAvoidWater;
  16896. import net.minecraft.entity.ai.EntityAIWatchClosest;
  16897. import net.minecraft.entity.ai.attributes.AttributeModifier;
  16898. import net.minecraft.entity.ai.attributes.IAttributeInstance;
  16899. import net.minecraft.entity.monster.EntityEndermite;
  16900. import net.minecraft.entity.monster.EntityMob;
  16901. import net.minecraft.entity.player.EntityPlayer;
  16902. import net.minecraft.init.Blocks;
  16903. import net.minecraft.init.SoundEvents;
  16904. import net.minecraft.item.Item;
  16905. import net.minecraft.item.ItemStack;
  16906. import net.minecraft.nbt.NBTTagCompound;
  16907. import net.minecraft.network.datasync.DataParameter;
  16908. import net.minecraft.network.datasync.DataSerializers;
  16909. import net.minecraft.network.datasync.EntityDataManager;
  16910. import net.minecraft.pathfinding.PathNodeType;
  16911. import net.minecraft.util.DamageSource;
  16912. import net.minecraft.util.EntityDamageSourceIndirect;
  16913. import net.minecraft.util.EnumParticleTypes;
  16914. import net.minecraft.util.ResourceLocation;
  16915. import net.minecraft.util.SoundEvent;
  16916. import net.minecraft.util.datafix.DataFixer;
  16917. import net.minecraft.util.math.BlockPos;
  16918. import net.minecraft.util.math.MathHelper;
  16919. import net.minecraft.util.math.RayTraceResult;
  16920. import net.minecraft.util.math.Vec3d;
  16921. import net.minecraft.world.World;
  16922. import net.minecraft.world.storage.loot.LootTableList;
  16923.  
  16924. public class EntityEnderman extends EntityMob {
  16925. private static final UUID field_110192_bp = UUID.fromString("020E0DFB-87AE-4653-9556-831010E291A0");
  16926. private static final AttributeModifier field_110193_bq = (new AttributeModifier(field_110192_bp, "Attacking speed boost", 0.15000000596046448D, 0)).func_111168_a(false);
  16927. private static final Set<Block> field_70827_d = Sets.<Block>newIdentityHashSet();
  16928. private static final DataParameter<Optional<IBlockState>> field_184718_bv = EntityDataManager.<Optional<IBlockState>>func_187226_a(EntityEnderman.class, DataSerializers.field_187197_g);
  16929. private static final DataParameter<Boolean> field_184719_bw = EntityDataManager.<Boolean>func_187226_a(EntityEnderman.class, DataSerializers.field_187198_h);
  16930. private int field_184720_bx;
  16931. private int field_184721_by;
  16932.  
  16933. public EntityEnderman(World p_i1734_1_) {
  16934. super(p_i1734_1_);
  16935. this.func_70105_a(0.6F, 2.9F);
  16936. this.field_70138_W = 1.0F;
  16937. this.func_184644_a(PathNodeType.WATER, -1.0F);
  16938. }
  16939.  
  16940. protected void func_184651_r() {
  16941. this.field_70714_bg.func_75776_a(0, new EntityAISwimming(this));
  16942. this.field_70714_bg.func_75776_a(2, new EntityAIAttackMelee(this, 1.0D, false));
  16943. this.field_70714_bg.func_75776_a(7, new EntityAIWanderAvoidWater(this, 1.0D, 0.0F));
  16944. this.field_70714_bg.func_75776_a(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
  16945. this.field_70714_bg.func_75776_a(8, new EntityAILookIdle(this));
  16946. this.field_70714_bg.func_75776_a(10, new EntityEnderman.AIPlaceBlock(this));
  16947. this.field_70714_bg.func_75776_a(11, new EntityEnderman.AITakeBlock(this));
  16948. this.field_70715_bh.func_75776_a(1, new EntityEnderman.AIFindPlayer(this));
  16949. this.field_70715_bh.func_75776_a(2, new EntityAIHurtByTarget(this, false, new Class[0]));
  16950. this.field_70715_bh.func_75776_a(3, new EntityAINearestAttackableTarget(this, EntityEndermite.class, 10, true, false, new Predicate<EntityEndermite>() {
  16951. public boolean apply(@Nullable EntityEndermite p_apply_1_) {
  16952. return p_apply_1_.func_175495_n();
  16953. }
  16954. }));
  16955. }
  16956.  
  16957. protected void func_110147_ax() {
  16958. super.func_110147_ax();
  16959. this.func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(40.0D);
  16960. this.func_110148_a(SharedMonsterAttributes.field_111263_d).func_111128_a(0.30000001192092896D);
  16961. this.func_110148_a(SharedMonsterAttributes.field_111264_e).func_111128_a(7.0D);
  16962. this.func_110148_a(SharedMonsterAttributes.field_111265_b).func_111128_a(64.0D);
  16963. }
  16964.  
  16965. public void func_70624_b(@Nullable EntityLivingBase p_70624_1_) {
  16966. super.func_70624_b(p_70624_1_);
  16967. IAttributeInstance iattributeinstance = this.func_110148_a(SharedMonsterAttributes.field_111263_d);
  16968. if(p_70624_1_ == null) {
  16969. this.field_184721_by = 0;
  16970. this.field_70180_af.func_187227_b(field_184719_bw, Boolean.valueOf(false));
  16971. iattributeinstance.func_111124_b(field_110193_bq);
  16972. } else {
  16973. this.field_184721_by = this.field_70173_aa;
  16974. this.field_70180_af.func_187227_b(field_184719_bw, Boolean.valueOf(true));
  16975. if(!iattributeinstance.func_180374_a(field_110193_bq)) {
  16976. iattributeinstance.func_111121_a(field_110193_bq);
  16977. }
  16978. }
  16979.  
  16980. }
  16981.  
  16982. protected void func_70088_a() {
  16983. super.func_70088_a();
  16984. this.field_70180_af.func_187214_a(field_184718_bv, Optional.<T>absent());
  16985. this.field_70180_af.func_187214_a(field_184719_bw, Boolean.valueOf(false));
  16986. }
  16987.  
  16988. public void func_184716_o() {
  16989. if(this.field_70173_aa >= this.field_184720_bx + 400) {
  16990. this.field_184720_bx = this.field_70173_aa;
  16991. if(!this.func_174814_R()) {
  16992. this.field_70170_p.func_184134_a(this.field_70165_t, this.field_70163_u + (double)this.func_70047_e(), this.field_70161_v, SoundEvents.field_187533_aW, this.func_184176_by(), 2.5F, 1.0F, false);
  16993. }
  16994. }
  16995.  
  16996. }
  16997.  
  16998. public void func_184206_a(DataParameter<?> p_184206_1_) {
  16999. if(field_184719_bw.equals(p_184206_1_) && this.func_70823_r() && this.field_70170_p.field_72995_K) {
  17000. this.func_184716_o();
  17001. }
  17002.  
  17003. super.func_184206_a(p_184206_1_);
  17004. }
  17005.  
  17006. public static void func_189763_b(DataFixer p_189763_0_) {
  17007. EntityLiving.func_189752_a(p_189763_0_, EntityEnderman.class);
  17008. }
  17009.  
  17010. public void func_70014_b(NBTTagCompound p_70014_1_) {
  17011. super.func_70014_b(p_70014_1_);
  17012. IBlockState iblockstate = this.func_175489_ck();
  17013. if(iblockstate != null) {
  17014. p_70014_1_.func_74777_a("carried", (short)Block.func_149682_b(iblockstate.func_177230_c()));
  17015. p_70014_1_.func_74777_a("carriedData", (short)iblockstate.func_177230_c().func_176201_c(iblockstate));
  17016. }
  17017.  
  17018. }
  17019.  
  17020. public void func_70037_a(NBTTagCompound p_70037_1_) {
  17021. super.func_70037_a(p_70037_1_);
  17022. IBlockState iblockstate;
  17023. if(p_70037_1_.func_150297_b("carried", 8)) {
  17024. iblockstate = Block.func_149684_b(p_70037_1_.func_74779_i("carried")).func_176203_a(p_70037_1_.func_74765_d("carriedData") & '\uffff');
  17025. } else {
  17026. iblockstate = Block.func_149729_e(p_70037_1_.func_74765_d("carried")).func_176203_a(p_70037_1_.func_74765_d("carriedData") & '\uffff');
  17027. }
  17028.  
  17029. if(iblockstate == null || iblockstate.func_177230_c() == null || iblockstate.func_185904_a() == Material.field_151579_a) {
  17030. iblockstate = null;
  17031. }
  17032.  
  17033. this.func_175490_a(iblockstate);
  17034. }
  17035.  
  17036. private boolean func_70821_d(EntityPlayer p_70821_1_) {
  17037. ItemStack itemstack = (ItemStack)p_70821_1_.field_71071_by.field_70460_b.get(3);
  17038. if(itemstack.func_77973_b() == Item.func_150898_a(Blocks.field_150423_aK)) {
  17039. return false;
  17040. } else {
  17041. Vec3d vec3d = p_70821_1_.func_70676_i(1.0F).func_72432_b();
  17042. Vec3d vec3d1 = new Vec3d(this.field_70165_t - p_70821_1_.field_70165_t, this.func_174813_aQ().field_72338_b + (double)this.func_70047_e() - (p_70821_1_.field_70163_u + (double)p_70821_1_.func_70047_e()), this.field_70161_v - p_70821_1_.field_70161_v);
  17043. double d0 = vec3d1.func_72433_c();
  17044. vec3d1 = vec3d1.func_72432_b();
  17045. double d1 = vec3d.func_72430_b(vec3d1);
  17046. return d1 > 1.0D - 0.025D / d0?p_70821_1_.func_70685_l(this):false;
  17047. }
  17048. }
  17049.  
  17050. public float func_70047_e() {
  17051. return 2.55F;
  17052. }
  17053.  
  17054. public void func_70636_d() {
  17055. if(this.field_70170_p.field_72995_K) {
  17056. for(int i = 0; i < 2; ++i) {
  17057. this.field_70170_p.func_175688_a(EnumParticleTypes.PORTAL, this.field_70165_t + (this.field_70146_Z.nextDouble() - 0.5D) * (double)this.field_70130_N, this.field_70163_u + this.field_70146_Z.nextDouble() * (double)this.field_70131_O - 0.25D, this.field_70161_v + (this.field_70146_Z.nextDouble() - 0.5D) * (double)this.field_70130_N, (this.field_70146_Z.nextDouble() - 0.5D) * 2.0D, -this.field_70146_Z.nextDouble(), (this.field_70146_Z.nextDouble() - 0.5D) * 2.0D, new int[0]);
  17058. }
  17059. }
  17060.  
  17061. this.field_70703_bu = false;
  17062. super.func_70636_d();
  17063. }
  17064.  
  17065. protected void func_70619_bc() {
  17066. if(this.func_70026_G()) {
  17067. this.func_70097_a(DamageSource.field_76369_e, 1.0F);
  17068. }
  17069.  
  17070. if(this.field_70170_p.func_72935_r() && this.field_70173_aa >= this.field_184721_by + 600) {
  17071. float f = this.func_70013_c();
  17072. if(f > 0.5F && this.field_70170_p.func_175678_i(new BlockPos(this)) && this.field_70146_Z.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) {
  17073. this.func_70624_b((EntityLivingBase)null);
  17074. this.func_70820_n();
  17075. }
  17076. }
  17077.  
  17078. super.func_70619_bc();
  17079. }
  17080.  
  17081. protected boolean func_70820_n() {
  17082. double d0 = this.field_70165_t + (this.field_70146_Z.nextDouble() - 0.5D) * 64.0D;
  17083. double d1 = this.field_70163_u + (double)(this.field_70146_Z.nextInt(64) - 32);
  17084. double d2 = this.field_70161_v + (this.field_70146_Z.nextDouble() - 0.5D) * 64.0D;
  17085. return this.func_70825_j(d0, d1, d2);
  17086. }
  17087.  
  17088. protected boolean func_70816_c(Entity p_70816_1_) {
  17089. Vec3d vec3d = new Vec3d(this.field_70165_t - p_70816_1_.field_70165_t, this.func_174813_aQ().field_72338_b + (double)(this.field_70131_O / 2.0F) - p_70816_1_.field_70163_u + (double)p_70816_1_.func_70047_e(), this.field_70161_v - p_70816_1_.field_70161_v);
  17090. vec3d = vec3d.func_72432_b();
  17091. double d0 = 16.0D;
  17092. double d1 = this.field_70165_t + (this.field_70146_Z.nextDouble() - 0.5D) * 8.0D - vec3d.field_72450_a * 16.0D;
  17093. double d2 = this.field_70163_u + (double)(this.field_70146_Z.nextInt(16) - 8) - vec3d.field_72448_b * 16.0D;
  17094. double d3 = this.field_70161_v + (this.field_70146_Z.nextDouble() - 0.5D) * 8.0D - vec3d.field_72449_c * 16.0D;
  17095. return this.func_70825_j(d1, d2, d3);
  17096. }
  17097.  
  17098. private boolean func_70825_j(double p_70825_1_, double p_70825_3_, double p_70825_5_) {
  17099. boolean flag = this.func_184595_k(p_70825_1_, p_70825_3_, p_70825_5_);
  17100. if(flag) {
  17101. this.field_70170_p.func_184148_a((EntityPlayer)null, this.field_70169_q, this.field_70167_r, this.field_70166_s, SoundEvents.field_187534_aX, this.func_184176_by(), 1.0F, 1.0F);
  17102. this.func_184185_a(SoundEvents.field_187534_aX, 1.0F, 1.0F);
  17103. }
  17104.  
  17105. return flag;
  17106. }
  17107.  
  17108. protected SoundEvent func_184639_G() {
  17109. return this.func_70823_r()?SoundEvents.field_187532_aV:SoundEvents.field_187529_aS;
  17110. }
  17111.  
  17112. protected SoundEvent func_184601_bQ(DamageSource p_184601_1_) {
  17113. return SoundEvents.field_187531_aU;
  17114. }
  17115.  
  17116. protected SoundEvent func_184615_bR() {
  17117. return SoundEvents.field_187530_aT;
  17118. }
  17119.  
  17120. protected void func_82160_b(boolean p_82160_1_, int p_82160_2_) {
  17121. super.func_82160_b(p_82160_1_, p_82160_2_);
  17122. IBlockState iblockstate = this.func_175489_ck();
  17123. if(iblockstate != null) {
  17124. Item item = Item.func_150898_a(iblockstate.func_177230_c());
  17125. int i = item.func_77614_k()?iblockstate.func_177230_c().func_176201_c(iblockstate):0;
  17126. this.func_70099_a(new ItemStack(item, 1, i), 0.0F);
  17127. }
  17128.  
  17129. }
  17130.  
  17131. @Nullable
  17132. protected ResourceLocation func_184647_J() {
  17133. return LootTableList.field_186439_u;
  17134. }
  17135.  
  17136. public void func_175490_a(@Nullable IBlockState p_175490_1_) {
  17137. this.field_70180_af.func_187227_b(field_184718_bv, Optional.<T>fromNullable(p_175490_1_));
  17138. }
  17139.  
  17140. @Nullable
  17141. public IBlockState func_175489_ck() {
  17142. return (IBlockState)((Optional)this.field_70180_af.func_187225_a(field_184718_bv)).orNull();
  17143. }
  17144.  
  17145. public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) {
  17146. if(this.func_180431_b(p_70097_1_)) {
  17147. return false;
  17148. } else if(p_70097_1_ instanceof EntityDamageSourceIndirect) {
  17149. for(int i = 0; i < 64; ++i) {
  17150. if(this.func_70820_n()) {
  17151. return true;
  17152. }
  17153. }
  17154.  
  17155. return false;
  17156. } else {
  17157. boolean flag = super.func_70097_a(p_70097_1_, p_70097_2_);
  17158. if(p_70097_1_.func_76363_c() && this.field_70146_Z.nextInt(10) != 0) {
  17159. this.func_70820_n();
  17160. }
  17161.  
  17162. return flag;
  17163. }
  17164. }
  17165.  
  17166. public boolean func_70823_r() {
  17167. return ((Boolean)this.field_70180_af.func_187225_a(field_184719_bw)).booleanValue();
  17168. }
  17169.  
  17170. static {
  17171. field_70827_d.add(Blocks.field_150349_c);
  17172. field_70827_d.add(Blocks.field_150346_d);
  17173. field_70827_d.add(Blocks.field_150354_m);
  17174. field_70827_d.add(Blocks.field_150351_n);
  17175. field_70827_d.add(Blocks.field_150327_N);
  17176. field_70827_d.add(Blocks.field_150328_O);
  17177. field_70827_d.add(Blocks.field_150338_P);
  17178. field_70827_d.add(Blocks.field_150337_Q);
  17179. field_70827_d.add(Blocks.field_150335_W);
  17180. field_70827_d.add(Blocks.field_150434_aF);
  17181. field_70827_d.add(Blocks.field_150435_aG);
  17182. field_70827_d.add(Blocks.field_150423_aK);
  17183. field_70827_d.add(Blocks.field_150440_ba);
  17184. field_70827_d.add(Blocks.field_150391_bh);
  17185. field_70827_d.add(Blocks.field_150424_aL);
  17186. }
  17187.  
  17188. static class AIFindPlayer extends EntityAINearestAttackableTarget<EntityPlayer> {
  17189. private final EntityEnderman field_179449_j;
  17190. private EntityPlayer field_179448_g;
  17191. private int field_179450_h;
  17192. private int field_179451_i;
  17193.  
  17194. public AIFindPlayer(EntityEnderman p_i45842_1_) {
  17195. super(p_i45842_1_, EntityPlayer.class, false);
  17196. this.field_179449_j = p_i45842_1_;
  17197. }
  17198.  
  17199. public boolean func_75250_a() {
  17200. double d0 = this.func_111175_f();
  17201. this.field_179448_g = this.field_179449_j.field_70170_p.func_184150_a(this.field_179449_j.field_70165_t, this.field_179449_j.field_70163_u, this.field_179449_j.field_70161_v, d0, d0, (Function<EntityPlayer, Double>)null, new Predicate<EntityPlayer>() {
  17202. public boolean apply(@Nullable EntityPlayer p_apply_1_) {
  17203. return p_apply_1_ != null && AIFindPlayer.this.field_179449_j.func_70821_d(p_apply_1_);
  17204. }
  17205. });
  17206. return this.field_179448_g != null;
  17207. }
  17208.  
  17209. public void func_75249_e() {
  17210. this.field_179450_h = 5;
  17211. this.field_179451_i = 0;
  17212. }
  17213.  
  17214. public void func_75251_c() {
  17215. this.field_179448_g = null;
  17216. super.func_75251_c();
  17217. }
  17218.  
  17219. public boolean func_75253_b() {
  17220. if(this.field_179448_g != null) {
  17221. if(!this.field_179449_j.func_70821_d(this.field_179448_g)) {
  17222. return false;
  17223. } else {
  17224. this.field_179449_j.func_70625_a(this.field_179448_g, 10.0F, 10.0F);
  17225. return true;
  17226. }
  17227. } else {
  17228. return this.field_75309_a != null && ((EntityPlayer)this.field_75309_a).func_70089_S()?true:super.func_75253_b();
  17229. }
  17230. }
  17231.  
  17232. public void func_75246_d() {
  17233. if(this.field_179448_g != null) {
  17234. if(--this.field_179450_h <= 0) {
  17235. this.field_75309_a = this.field_179448_g;
  17236. this.field_179448_g = null;
  17237. super.func_75249_e();
  17238. }
  17239. } else {
  17240. if(this.field_75309_a != null) {
  17241. if(this.field_179449_j.func_70821_d((EntityPlayer)this.field_75309_a)) {
  17242. if(((EntityPlayer)this.field_75309_a).func_70068_e(this.field_179449_j) < 16.0D) {
  17243. this.field_179449_j.func_70820_n();
  17244. }
  17245.  
  17246. this.field_179451_i = 0;
  17247. } else if(((EntityPlayer)this.field_75309_a).func_70068_e(this.field_179449_j) > 256.0D && this.field_179451_i++ >= 30 && this.field_179449_j.func_70816_c(this.field_75309_a)) {
  17248. this.field_179451_i = 0;
  17249. }
  17250. }
  17251.  
  17252. super.func_75246_d();
  17253. }
  17254.  
  17255. }
  17256. }
  17257.  
  17258. static class AIPlaceBlock extends EntityAIBase {
  17259. private final EntityEnderman field_179475_a;
  17260.  
  17261. public AIPlaceBlock(EntityEnderman p_i45843_1_) {
  17262. this.field_179475_a = p_i45843_1_;
  17263. }
  17264.  
  17265. public boolean func_75250_a() {
  17266. return this.field_179475_a.func_175489_ck() == null?false:(!this.field_179475_a.field_70170_p.func_82736_K().func_82766_b("mobGriefing")?false:this.field_179475_a.func_70681_au().nextInt(2000) == 0);
  17267. }
  17268.  
  17269. public void func_75246_d() {
  17270. Random random = this.field_179475_a.func_70681_au();
  17271. World world = this.field_179475_a.field_70170_p;
  17272. int i = MathHelper.func_76128_c(this.field_179475_a.field_70165_t - 1.0D + random.nextDouble() * 2.0D);
  17273. int j = MathHelper.func_76128_c(this.field_179475_a.field_70163_u + random.nextDouble() * 2.0D);
  17274. int k = MathHelper.func_76128_c(this.field_179475_a.field_70161_v - 1.0D + random.nextDouble() * 2.0D);
  17275. BlockPos blockpos = new BlockPos(i, j, k);
  17276. IBlockState iblockstate = world.func_180495_p(blockpos);
  17277. IBlockState iblockstate1 = world.func_180495_p(blockpos.func_177977_b());
  17278. IBlockState iblockstate2 = this.field_179475_a.func_175489_ck();
  17279. if(iblockstate2 != null && this.func_188518_a(world, blockpos, iblockstate2.func_177230_c(), iblockstate, iblockstate1)) {
  17280. world.func_180501_a(blockpos, iblockstate2, 3);
  17281. this.field_179475_a.func_175490_a((IBlockState)null);
  17282. }
  17283.  
  17284. }
  17285.  
  17286. private boolean func_188518_a(World p_188518_1_, BlockPos p_188518_2_, Block p_188518_3_, IBlockState p_188518_4_, IBlockState p_188518_5_) {
  17287. return !p_188518_3_.func_176196_c(p_188518_1_, p_188518_2_)?false:(p_188518_4_.func_185904_a() != Material.field_151579_a?false:(p_188518_5_.func_185904_a() == Material.field_151579_a?false:p_188518_5_.func_185917_h()));
  17288. }
  17289. }
  17290.  
  17291. static class AITakeBlock extends EntityAIBase {
  17292. private final EntityEnderman field_179473_a;
  17293.  
  17294. public AITakeBlock(EntityEnderman p_i45841_1_) {
  17295. this.field_179473_a = p_i45841_1_;
  17296. }
  17297.  
  17298. public boolean func_75250_a() {
  17299. return this.field_179473_a.func_175489_ck() != null?false:(!this.field_179473_a.field_70170_p.func_82736_K().func_82766_b("mobGriefing")?false:this.field_179473_a.func_70681_au().nextInt(20) == 0);
  17300. }
  17301.  
  17302. public void func_75246_d() {
  17303. Random random = this.field_179473_a.func_70681_au();
  17304. World world = this.field_179473_a.field_70170_p;
  17305. int i = MathHelper.func_76128_c(this.field_179473_a.field_70165_t - 2.0D + random.nextDouble() * 4.0D);
  17306. int j = MathHelper.func_76128_c(this.field_179473_a.field_70163_u + random.nextDouble() * 3.0D);
  17307. int k = MathHelper.func_76128_c(this.field_179473_a.field_70161_v - 2.0D + random.nextDouble() * 4.0D);
  17308. BlockPos blockpos = new BlockPos(i, j, k);
  17309. IBlockState iblockstate = world.func_180495_p(blockpos);
  17310. Block block = iblockstate.func_177230_c();
  17311. RayTraceResult raytraceresult = world.func_147447_a(new Vec3d((double)((float)MathHelper.func_76128_c(this.field_179473_a.field_70165_t) + 0.5F), (double)((float)j + 0.5F), (double)((float)MathHelper.func_76128_c(this.field_179473_a.field_70161_v) + 0.5F)), new Vec3d((double)((float)i + 0.5F), (double)((float)j + 0.5F), (double)((float)k + 0.5F)), false, true, false);
  17312. boolean flag = raytraceresult != null && raytraceresult.func_178782_a().equals(blockpos);
  17313. if(EntityEnderman.field_70827_d.contains(block) && flag) {
  17314. this.field_179473_a.func_175490_a(iblockstate);
  17315. world.func_175698_g(blockpos);
  17316. }
  17317.  
  17318. }
  17319. }
  17320. }
  17321.  
  17322. Patching failed: minecraft\net\minecraft\item\ItemHoe.java
  17323. Hunk 1 failed! Cannot find hunk target
  17324. this.field_185072_b = p_i45343_1_.func_78000_c() + 1.0F;
  17325. }
  17326.  
  17327. + @SuppressWarnings("incomplete-switch")
  17328. public EnumActionResult func_180614_a(EntityPlayer p_180614_1_, World p_180614_2_, BlockPos p_180614_3_, EnumHand p_180614_4_, EnumFacing p_180614_5_, float p_180614_6_, float p_180614_7_, float p_180614_8_) {
  17329. ItemStack itemstack = p_180614_1_.func_184586_b(p_180614_4_);
  17330. if (!p_180614_1_.func_175151_a(p_180614_3_.func_177972_a(p_180614_5_), p_180614_5_, itemstack)) {
  17331. File state
  17332. package net.minecraft.item;
  17333.  
  17334. import com.google.common.collect.Multimap;
  17335. import net.minecraft.block.Block;
  17336. import net.minecraft.block.BlockDirt;
  17337. import net.minecraft.block.material.Material;
  17338. import net.minecraft.block.state.IBlockState;
  17339. import net.minecraft.creativetab.CreativeTabs;
  17340. import net.minecraft.entity.EntityLivingBase;
  17341. import net.minecraft.entity.SharedMonsterAttributes;
  17342. import net.minecraft.entity.ai.attributes.AttributeModifier;
  17343. import net.minecraft.entity.player.EntityPlayer;
  17344. import net.minecraft.init.Blocks;
  17345. import net.minecraft.init.SoundEvents;
  17346. import net.minecraft.inventory.EntityEquipmentSlot;
  17347. import net.minecraft.item.Item;
  17348. import net.minecraft.item.ItemStack;
  17349. import net.minecraft.util.EnumActionResult;
  17350. import net.minecraft.util.EnumFacing;
  17351. import net.minecraft.util.EnumHand;
  17352. import net.minecraft.util.SoundCategory;
  17353. import net.minecraft.util.math.BlockPos;
  17354. import net.minecraft.world.World;
  17355. import net.minecraftforge.fml.relauncher.Side;
  17356. import net.minecraftforge.fml.relauncher.SideOnly;
  17357.  
  17358. public class ItemHoe extends Item {
  17359. private final float field_185072_b;
  17360. protected Item.ToolMaterial field_77843_a;
  17361.  
  17362. public ItemHoe(Item.ToolMaterial p_i45343_1_) {
  17363. this.field_77843_a = p_i45343_1_;
  17364. this.field_77777_bU = 1;
  17365. this.func_77656_e(p_i45343_1_.func_77997_a());
  17366. this.func_77637_a(CreativeTabs.field_78040_i);
  17367. this.field_185072_b = p_i45343_1_.func_78000_c() + 1.0F;
  17368. }
  17369.  
  17370. public EnumActionResult func_180614_a(EntityPlayer p_180614_1_, World p_180614_2_, BlockPos p_180614_3_, EnumHand p_180614_4_, EnumFacing p_180614_5_, float p_180614_6_, float p_180614_7_, float p_180614_8_) {
  17371. ItemStack itemstack = p_180614_1_.func_184586_b(p_180614_4_);
  17372. if(!p_180614_1_.func_175151_a(p_180614_3_.func_177972_a(p_180614_5_), p_180614_5_, itemstack)) {
  17373. return EnumActionResult.FAIL;
  17374. } else {
  17375. IBlockState iblockstate = p_180614_2_.func_180495_p(p_180614_3_);
  17376. Block block = iblockstate.func_177230_c();
  17377. if(p_180614_5_ != EnumFacing.DOWN && p_180614_2_.func_180495_p(p_180614_3_.func_177984_a()).func_185904_a() == Material.field_151579_a) {
  17378. if(block == Blocks.field_150349_c || block == Blocks.field_185774_da) {
  17379. this.func_185071_a(itemstack, p_180614_1_, p_180614_2_, p_180614_3_, Blocks.field_150458_ak.func_176223_P());
  17380. return EnumActionResult.SUCCESS;
  17381. }
  17382.  
  17383. if(block == Blocks.field_150346_d) {
  17384. switch((BlockDirt.DirtType)iblockstate.func_177229_b(BlockDirt.field_176386_a)) {
  17385. case DIRT:
  17386. this.func_185071_a(itemstack, p_180614_1_, p_180614_2_, p_180614_3_, Blocks.field_150458_ak.func_176223_P());
  17387. return EnumActionResult.SUCCESS;
  17388. case COARSE_DIRT:
  17389. this.func_185071_a(itemstack, p_180614_1_, p_180614_2_, p_180614_3_, Blocks.field_150346_d.func_176223_P().func_177226_a(BlockDirt.field_176386_a, BlockDirt.DirtType.DIRT));
  17390. return EnumActionResult.SUCCESS;
  17391. }
  17392. }
  17393. }
  17394.  
  17395. return EnumActionResult.PASS;
  17396. }
  17397. }
  17398.  
  17399. public boolean func_77644_a(ItemStack p_77644_1_, EntityLivingBase p_77644_2_, EntityLivingBase p_77644_3_) {
  17400. p_77644_1_.func_77972_a(1, p_77644_3_);
  17401. return true;
  17402. }
  17403.  
  17404. protected void func_185071_a(ItemStack p_185071_1_, EntityPlayer p_185071_2_, World p_185071_3_, BlockPos p_185071_4_, IBlockState p_185071_5_) {
  17405. p_185071_3_.func_184133_a(p_185071_2_, p_185071_4_, SoundEvents.field_187693_cj, SoundCategory.BLOCKS, 1.0F, 1.0F);
  17406. if(!p_185071_3_.field_72995_K) {
  17407. p_185071_3_.func_180501_a(p_185071_4_, p_185071_5_, 11);
  17408. p_185071_1_.func_77972_a(1, p_185071_2_);
  17409. }
  17410.  
  17411. }
  17412.  
  17413. @SideOnly(Side.CLIENT)
  17414. public boolean func_77662_d() {
  17415. return true;
  17416. }
  17417.  
  17418. public String func_77842_f() {
  17419. return this.field_77843_a.toString();
  17420. }
  17421.  
  17422. public Multimap<String, AttributeModifier> func_111205_h(EntityEquipmentSlot p_111205_1_) {
  17423. Multimap<String, AttributeModifier> multimap = super.func_111205_h(p_111205_1_);
  17424. if(p_111205_1_ == EntityEquipmentSlot.MAINHAND) {
  17425. multimap.put(SharedMonsterAttributes.field_111264_e.func_111108_a(), new AttributeModifier(field_111210_e, "Weapon modifier", 0.0D, 0));
  17426. multimap.put(SharedMonsterAttributes.field_188790_f.func_111108_a(), new AttributeModifier(field_185050_h, "Weapon modifier", (double)(this.field_185072_b - 4.0F), 0));
  17427. }
  17428.  
  17429. return multimap;
  17430. }
  17431. }
  17432.  
  17433. Patching failed: minecraft\net\minecraft\world\World.java
  17434. Hunk 1 failed! Cannot find hunk target
  17435. List<T> list = Lists.<T>newArrayList();
  17436.  
  17437. for(Entity entity : this.field_72996_f) {
  17438. - if (p_175644_1_.isAssignableFrom(entity.getClass()) && p_175644_2_.apply(entity)) {
  17439. - list.add(entity);
  17440. + if (p_175644_1_.isAssignableFrom(entity.getClass()) && p_175644_2_.apply((T)entity)) {
  17441. + list.add((T)entity);
  17442. }
  17443. }
  17444.  
  17445. File state
  17446. package net.minecraft.world;
  17447.  
  17448. import com.google.common.base.Function;
  17449. import com.google.common.base.MoreObjects;
  17450. import com.google.common.base.Predicate;
  17451. import com.google.common.collect.Lists;
  17452. import java.util.Calendar;
  17453. import java.util.Collection;
  17454. import java.util.Iterator;
  17455. import java.util.List;
  17456. import java.util.Random;
  17457. import java.util.UUID;
  17458. import javax.annotation.Nullable;
  17459. import net.minecraft.advancements.AdvancementManager;
  17460. import net.minecraft.advancements.FunctionManager;
  17461. import net.minecraft.block.Block;
  17462. import net.minecraft.block.BlockLiquid;
  17463. import net.minecraft.block.BlockObserver;
  17464. import net.minecraft.block.material.Material;
  17465. import net.minecraft.block.state.IBlockState;
  17466. import net.minecraft.crash.CrashReport;
  17467. import net.minecraft.crash.CrashReportCategory;
  17468. import net.minecraft.crash.ICrashReportDetail;
  17469. import net.minecraft.entity.Entity;
  17470. import net.minecraft.entity.EntityLiving;
  17471. import net.minecraft.entity.player.EntityPlayer;
  17472. import net.minecraft.entity.player.EntityPlayerMP;
  17473. import net.minecraft.init.Biomes;
  17474. import net.minecraft.init.Blocks;
  17475. import net.minecraft.nbt.NBTTagCompound;
  17476. import net.minecraft.network.Packet;
  17477. import net.minecraft.pathfinding.PathWorldListener;
  17478. import net.minecraft.profiler.Profiler;
  17479. import net.minecraft.scoreboard.Scoreboard;
  17480. import net.minecraft.server.MinecraftServer;
  17481. import net.minecraft.tileentity.TileEntity;
  17482. import net.minecraft.util.EntitySelectors;
  17483. import net.minecraft.util.EnumFacing;
  17484. import net.minecraft.util.EnumParticleTypes;
  17485. import net.minecraft.util.ITickable;
  17486. import net.minecraft.util.IntHashMap;
  17487. import net.minecraft.util.ReportedException;
  17488. import net.minecraft.util.SoundCategory;
  17489. import net.minecraft.util.SoundEvent;
  17490. import net.minecraft.util.math.AxisAlignedBB;
  17491. import net.minecraft.util.math.BlockPos;
  17492. import net.minecraft.util.math.MathHelper;
  17493. import net.minecraft.util.math.RayTraceResult;
  17494. import net.minecraft.util.math.Vec3d;
  17495. import net.minecraft.village.VillageCollection;
  17496. import net.minecraft.world.DifficultyInstance;
  17497. import net.minecraft.world.EnumDifficulty;
  17498. import net.minecraft.world.EnumSkyBlock;
  17499. import net.minecraft.world.Explosion;
  17500. import net.minecraft.world.GameRules;
  17501. import net.minecraft.world.IBlockAccess;
  17502. import net.minecraft.world.IWorldEventListener;
  17503. import net.minecraft.world.MinecraftException;
  17504. import net.minecraft.world.NextTickListEntry;
  17505. import net.minecraft.world.WorldProvider;
  17506. import net.minecraft.world.WorldSettings;
  17507. import net.minecraft.world.WorldType;
  17508. import net.minecraft.world.biome.Biome;
  17509. import net.minecraft.world.biome.BiomeProvider;
  17510. import net.minecraft.world.border.WorldBorder;
  17511. import net.minecraft.world.chunk.Chunk;
  17512. import net.minecraft.world.chunk.IChunkProvider;
  17513. import net.minecraft.world.gen.structure.StructureBoundingBox;
  17514. import net.minecraft.world.storage.ISaveHandler;
  17515. import net.minecraft.world.storage.MapStorage;
  17516. import net.minecraft.world.storage.WorldInfo;
  17517. import net.minecraft.world.storage.WorldSavedData;
  17518. import net.minecraft.world.storage.loot.LootTableManager;
  17519. import net.minecraftforge.fml.relauncher.Side;
  17520. import net.minecraftforge.fml.relauncher.SideOnly;
  17521.  
  17522. public abstract class World implements IBlockAccess {
  17523. private int field_181546_a = 63;
  17524. protected boolean field_72999_e;
  17525. public final List<Entity> field_72996_f = Lists.<Entity>newArrayList();
  17526. protected final List<Entity> field_72997_g = Lists.<Entity>newArrayList();
  17527. public final List<TileEntity> field_147482_g = Lists.<TileEntity>newArrayList();
  17528. public final List<TileEntity> field_175730_i = Lists.<TileEntity>newArrayList();
  17529. private final List<TileEntity> field_147484_a = Lists.<TileEntity>newArrayList();
  17530. private final List<TileEntity> field_147483_b = Lists.<TileEntity>newArrayList();
  17531. public final List<EntityPlayer> field_73010_i = Lists.<EntityPlayer>newArrayList();
  17532. public final List<Entity> field_73007_j = Lists.<Entity>newArrayList();
  17533. protected final IntHashMap<Entity> field_175729_l = new IntHashMap();
  17534. private final long field_73001_c = 16777215L;
  17535. private int field_73008_k;
  17536. protected int field_73005_l = (new Random()).nextInt();
  17537. protected final int field_73006_m = 1013904223;
  17538. public float field_73003_n;
  17539. public float field_73004_o;
  17540. public float field_73018_p;
  17541. public float field_73017_q;
  17542. private int field_73016_r;
  17543. public final Random field_73012_v = new Random();
  17544. public final WorldProvider field_73011_w;
  17545. protected PathWorldListener field_184152_t = new PathWorldListener();
  17546. protected List<IWorldEventListener> field_73021_x;
  17547. protected IChunkProvider field_73020_y;
  17548. protected final ISaveHandler field_73019_z;
  17549. protected WorldInfo field_72986_A;
  17550. protected boolean field_72987_B;
  17551. protected MapStorage field_72988_C;
  17552. public VillageCollection field_72982_D;
  17553. protected LootTableManager field_184151_B;
  17554. protected AdvancementManager field_191951_C;
  17555. protected FunctionManager field_193036_D;
  17556. public final Profiler field_72984_F;
  17557. private final Calendar field_83016_L;
  17558. protected Scoreboard field_96442_D;
  17559. public final boolean field_72995_K;
  17560. protected boolean field_72985_G;
  17561. protected boolean field_72992_H;
  17562. private boolean field_147481_N;
  17563. private final WorldBorder field_175728_M;
  17564. int[] field_72994_J;
  17565.  
  17566. protected World(ISaveHandler p_i45749_1_, WorldInfo p_i45749_2_, WorldProvider p_i45749_3_, Profiler p_i45749_4_, boolean p_i45749_5_) {
  17567. this.field_73021_x = Lists.newArrayList(new IWorldEventListener[]{this.field_184152_t});
  17568. this.field_83016_L = Calendar.getInstance();
  17569. this.field_96442_D = new Scoreboard();
  17570. this.field_72985_G = true;
  17571. this.field_72992_H = true;
  17572. this.field_72994_J = new int['\u8000'];
  17573. this.field_73019_z = p_i45749_1_;
  17574. this.field_72984_F = p_i45749_4_;
  17575. this.field_72986_A = p_i45749_2_;
  17576. this.field_73011_w = p_i45749_3_;
  17577. this.field_72995_K = p_i45749_5_;
  17578. this.field_175728_M = p_i45749_3_.func_177501_r();
  17579. }
  17580.  
  17581. public World func_175643_b() {
  17582. return this;
  17583. }
  17584.  
  17585. public Biome func_180494_b(final BlockPos p_180494_1_) {
  17586. if(this.func_175667_e(p_180494_1_)) {
  17587. Chunk chunk = this.func_175726_f(p_180494_1_);
  17588.  
  17589. try {
  17590. return chunk.func_177411_a(p_180494_1_, this.field_73011_w.func_177499_m());
  17591. } catch (Throwable throwable) {
  17592. CrashReport crashreport = CrashReport.func_85055_a(throwable, "Getting biome");
  17593. CrashReportCategory crashreportcategory = crashreport.func_85058_a("Coordinates of biome request");
  17594. crashreportcategory.func_189529_a("Location", new ICrashReportDetail<String>() {
  17595. public String call() throws Exception {
  17596. return CrashReportCategory.func_180522_a(p_180494_1_);
  17597. }
  17598. });
  17599. throw new ReportedException(crashreport);
  17600. }
  17601. } else {
  17602. return this.field_73011_w.func_177499_m().func_180300_a(p_180494_1_, Biomes.field_76772_c);
  17603. }
  17604. }
  17605.  
  17606. public BiomeProvider func_72959_q() {
  17607. return this.field_73011_w.func_177499_m();
  17608. }
  17609.  
  17610. protected abstract IChunkProvider func_72970_h();
  17611.  
  17612. public void func_72963_a(WorldSettings p_72963_1_) {
  17613. this.field_72986_A.func_76091_d(true);
  17614. }
  17615.  
  17616. @Nullable
  17617. public MinecraftServer func_73046_m() {
  17618. return null;
  17619. }
  17620.  
  17621. @SideOnly(Side.CLIENT)
  17622. public void func_72974_f() {
  17623. this.func_175652_B(new BlockPos(8, 64, 8));
  17624. }
  17625.  
  17626. public IBlockState func_184141_c(BlockPos p_184141_1_) {
  17627. BlockPos blockpos;
  17628. for(blockpos = new BlockPos(p_184141_1_.func_177958_n(), this.func_181545_F(), p_184141_1_.func_177952_p()); !this.func_175623_d(blockpos.func_177984_a()); blockpos = blockpos.func_177984_a()) {
  17629. ;
  17630. }
  17631.  
  17632. return this.func_180495_p(blockpos);
  17633. }
  17634.  
  17635. public boolean func_175701_a(BlockPos p_175701_1_) {
  17636. return !this.func_189509_E(p_175701_1_) && p_175701_1_.func_177958_n() >= -30000000 && p_175701_1_.func_177952_p() >= -30000000 && p_175701_1_.func_177958_n() < 30000000 && p_175701_1_.func_177952_p() < 30000000;
  17637. }
  17638.  
  17639. public boolean func_189509_E(BlockPos p_189509_1_) {
  17640. return p_189509_1_.func_177956_o() < 0 || p_189509_1_.func_177956_o() >= 256;
  17641. }
  17642.  
  17643. public boolean func_175623_d(BlockPos p_175623_1_) {
  17644. return this.func_180495_p(p_175623_1_).func_185904_a() == Material.field_151579_a;
  17645. }
  17646.  
  17647. public boolean func_175667_e(BlockPos p_175667_1_) {
  17648. return this.func_175668_a(p_175667_1_, true);
  17649. }
  17650.  
  17651. public boolean func_175668_a(BlockPos p_175668_1_, boolean p_175668_2_) {
  17652. return this.func_175680_a(p_175668_1_.func_177958_n() >> 4, p_175668_1_.func_177952_p() >> 4, p_175668_2_);
  17653. }
  17654.  
  17655. public boolean func_175697_a(BlockPos p_175697_1_, int p_175697_2_) {
  17656. return this.func_175648_a(p_175697_1_, p_175697_2_, true);
  17657. }
  17658.  
  17659. public boolean func_175648_a(BlockPos p_175648_1_, int p_175648_2_, boolean p_175648_3_) {
  17660. return this.func_175663_a(p_175648_1_.func_177958_n() - p_175648_2_, p_175648_1_.func_177956_o() - p_175648_2_, p_175648_1_.func_177952_p() - p_175648_2_, p_175648_1_.func_177958_n() + p_175648_2_, p_175648_1_.func_177956_o() + p_175648_2_, p_175648_1_.func_177952_p() + p_175648_2_, p_175648_3_);
  17661. }
  17662.  
  17663. public boolean func_175707_a(BlockPos p_175707_1_, BlockPos p_175707_2_) {
  17664. return this.func_175706_a(p_175707_1_, p_175707_2_, true);
  17665. }
  17666.  
  17667. public boolean func_175706_a(BlockPos p_175706_1_, BlockPos p_175706_2_, boolean p_175706_3_) {
  17668. return this.func_175663_a(p_175706_1_.func_177958_n(), p_175706_1_.func_177956_o(), p_175706_1_.func_177952_p(), p_175706_2_.func_177958_n(), p_175706_2_.func_177956_o(), p_175706_2_.func_177952_p(), p_175706_3_);
  17669. }
  17670.  
  17671. public boolean func_175711_a(StructureBoundingBox p_175711_1_) {
  17672. return this.func_175639_b(p_175711_1_, true);
  17673. }
  17674.  
  17675. public boolean func_175639_b(StructureBoundingBox p_175639_1_, boolean p_175639_2_) {
  17676. return this.func_175663_a(p_175639_1_.field_78897_a, p_175639_1_.field_78895_b, p_175639_1_.field_78896_c, p_175639_1_.field_78893_d, p_175639_1_.field_78894_e, p_175639_1_.field_78892_f, p_175639_2_);
  17677. }
  17678.  
  17679. private boolean func_175663_a(int p_175663_1_, int p_175663_2_, int p_175663_3_, int p_175663_4_, int p_175663_5_, int p_175663_6_, boolean p_175663_7_) {
  17680. if(p_175663_5_ >= 0 && p_175663_2_ < 256) {
  17681. p_175663_1_ = p_175663_1_ >> 4;
  17682. p_175663_3_ = p_175663_3_ >> 4;
  17683. p_175663_4_ = p_175663_4_ >> 4;
  17684. p_175663_6_ = p_175663_6_ >> 4;
  17685.  
  17686. for(int i = p_175663_1_; i <= p_175663_4_; ++i) {
  17687. for(int j = p_175663_3_; j <= p_175663_6_; ++j) {
  17688. if(!this.func_175680_a(i, j, p_175663_7_)) {
  17689. return false;
  17690. }
  17691. }
  17692. }
  17693.  
  17694. return true;
  17695. } else {
  17696. return false;
  17697. }
  17698. }
  17699.  
  17700. protected abstract boolean func_175680_a(int p_175680_1_, int p_175680_2_, boolean p_175680_3_);
  17701.  
  17702. public Chunk func_175726_f(BlockPos p_175726_1_) {
  17703. return this.func_72964_e(p_175726_1_.func_177958_n() >> 4, p_175726_1_.func_177952_p() >> 4);
  17704. }
  17705.  
  17706. public Chunk func_72964_e(int p_72964_1_, int p_72964_2_) {
  17707. return this.field_73020_y.func_186025_d(p_72964_1_, p_72964_2_);
  17708. }
  17709.  
  17710. public boolean func_190526_b(int p_190526_1_, int p_190526_2_) {
  17711. return this.func_175680_a(p_190526_1_, p_190526_2_, false)?true:this.field_73020_y.func_191062_e(p_190526_1_, p_190526_2_);
  17712. }
  17713.  
  17714. public boolean func_180501_a(BlockPos p_180501_1_, IBlockState p_180501_2_, int p_180501_3_) {
  17715. if(this.func_189509_E(p_180501_1_)) {
  17716. return false;
  17717. } else if(!this.field_72995_K && this.field_72986_A.func_76067_t() == WorldType.field_180272_g) {
  17718. return false;
  17719. } else {
  17720. Chunk chunk = this.func_175726_f(p_180501_1_);
  17721. Block block = p_180501_2_.func_177230_c();
  17722. IBlockState iblockstate = chunk.func_177436_a(p_180501_1_, p_180501_2_);
  17723. if(iblockstate == null) {
  17724. return false;
  17725. } else {
  17726. if(p_180501_2_.func_185891_c() != iblockstate.func_185891_c() || p_180501_2_.func_185906_d() != iblockstate.func_185906_d()) {
  17727. this.field_72984_F.func_76320_a("checkLight");
  17728. this.func_175664_x(p_180501_1_);
  17729. this.field_72984_F.func_76319_b();
  17730. }
  17731.  
  17732. if((p_180501_3_ & 2) != 0 && (!this.field_72995_K || (p_180501_3_ & 4) == 0) && chunk.func_150802_k()) {
  17733. this.func_184138_a(p_180501_1_, iblockstate, p_180501_2_, p_180501_3_);
  17734. }
  17735.  
  17736. if(!this.field_72995_K && (p_180501_3_ & 1) != 0) {
  17737. this.func_175722_b(p_180501_1_, iblockstate.func_177230_c(), true);
  17738. if(p_180501_2_.func_185912_n()) {
  17739. this.func_175666_e(p_180501_1_, block);
  17740. }
  17741. } else if(!this.field_72995_K && (p_180501_3_ & 16) == 0) {
  17742. this.func_190522_c(p_180501_1_, block);
  17743. }
  17744.  
  17745. return true;
  17746. }
  17747. }
  17748. }
  17749.  
  17750. public boolean func_175698_g(BlockPos p_175698_1_) {
  17751. return this.func_180501_a(p_175698_1_, Blocks.field_150350_a.func_176223_P(), 3);
  17752. }
  17753.  
  17754. public boolean func_175655_b(BlockPos p_175655_1_, boolean p_175655_2_) {
  17755. IBlockState iblockstate = this.func_180495_p(p_175655_1_);
  17756. Block block = iblockstate.func_177230_c();
  17757. if(iblockstate.func_185904_a() == Material.field_151579_a) {
  17758. return false;
  17759. } else {
  17760. this.func_175718_b(2001, p_175655_1_, Block.func_176210_f(iblockstate));
  17761. if(p_175655_2_) {
  17762. block.func_176226_b(this, p_175655_1_, iblockstate, 0);
  17763. }
  17764.  
  17765. return this.func_180501_a(p_175655_1_, Blocks.field_150350_a.func_176223_P(), 3);
  17766. }
  17767. }
  17768.  
  17769. public boolean func_175656_a(BlockPos p_175656_1_, IBlockState p_175656_2_) {
  17770. return this.func_180501_a(p_175656_1_, p_175656_2_, 3);
  17771. }
  17772.  
  17773. public void func_184138_a(BlockPos p_184138_1_, IBlockState p_184138_2_, IBlockState p_184138_3_, int p_184138_4_) {
  17774. for(int i = 0; i < this.field_73021_x.size(); ++i) {
  17775. ((IWorldEventListener)this.field_73021_x.get(i)).func_184376_a(this, p_184138_1_, p_184138_2_, p_184138_3_, p_184138_4_);
  17776. }
  17777.  
  17778. }
  17779.  
  17780. public void func_175722_b(BlockPos p_175722_1_, Block p_175722_2_, boolean p_175722_3_) {
  17781. if(this.field_72986_A.func_76067_t() != WorldType.field_180272_g) {
  17782. this.func_175685_c(p_175722_1_, p_175722_2_, p_175722_3_);
  17783. }
  17784.  
  17785. }
  17786.  
  17787. public void func_72975_g(int p_72975_1_, int p_72975_2_, int p_72975_3_, int p_72975_4_) {
  17788. if(p_72975_3_ > p_72975_4_) {
  17789. int i = p_72975_4_;
  17790. p_72975_4_ = p_72975_3_;
  17791. p_72975_3_ = i;
  17792. }
  17793.  
  17794. if(this.field_73011_w.func_191066_m()) {
  17795. for(int j = p_72975_3_; j <= p_72975_4_; ++j) {
  17796. this.func_180500_c(EnumSkyBlock.SKY, new BlockPos(p_72975_1_, j, p_72975_2_));
  17797. }
  17798. }
  17799.  
  17800. this.func_147458_c(p_72975_1_, p_72975_3_, p_72975_2_, p_72975_1_, p_72975_4_, p_72975_2_);
  17801. }
  17802.  
  17803. public void func_175704_b(BlockPos p_175704_1_, BlockPos p_175704_2_) {
  17804. this.func_147458_c(p_175704_1_.func_177958_n(), p_175704_1_.func_177956_o(), p_175704_1_.func_177952_p(), p_175704_2_.func_177958_n(), p_175704_2_.func_177956_o(), p_175704_2_.func_177952_p());
  17805. }
  17806.  
  17807. public void func_147458_c(int p_147458_1_, int p_147458_2_, int p_147458_3_, int p_147458_4_, int p_147458_5_, int p_147458_6_) {
  17808. for(int i = 0; i < this.field_73021_x.size(); ++i) {
  17809. ((IWorldEventListener)this.field_73021_x.get(i)).func_147585_a(p_147458_1_, p_147458_2_, p_147458_3_, p_147458_4_, p_147458_5_, p_147458_6_);
  17810. }
  17811.  
  17812. }
  17813.  
  17814. public void func_190522_c(BlockPos p_190522_1_, Block p_190522_2_) {
  17815. this.func_190529_b(p_190522_1_.func_177976_e(), p_190522_2_, p_190522_1_);
  17816. this.func_190529_b(p_190522_1_.func_177974_f(), p_190522_2_, p_190522_1_);
  17817. this.func_190529_b(p_190522_1_.func_177977_b(), p_190522_2_, p_190522_1_);
  17818. this.func_190529_b(p_190522_1_.func_177984_a(), p_190522_2_, p_190522_1_);
  17819. this.func_190529_b(p_190522_1_.func_177978_c(), p_190522_2_, p_190522_1_);
  17820. this.func_190529_b(p_190522_1_.func_177968_d(), p_190522_2_, p_190522_1_);
  17821. }
  17822.  
  17823. public void func_175685_c(BlockPos p_175685_1_, Block p_175685_2_, boolean p_175685_3_) {
  17824. this.func_190524_a(p_175685_1_.func_177976_e(), p_175685_2_, p_175685_1_);
  17825. this.func_190524_a(p_175685_1_.func_177974_f(), p_175685_2_, p_175685_1_);
  17826. this.func_190524_a(p_175685_1_.func_177977_b(), p_175685_2_, p_175685_1_);
  17827. this.func_190524_a(p_175685_1_.func_177984_a(), p_175685_2_, p_175685_1_);
  17828. this.func_190524_a(p_175685_1_.func_177978_c(), p_175685_2_, p_175685_1_);
  17829. this.func_190524_a(p_175685_1_.func_177968_d(), p_175685_2_, p_175685_1_);
  17830. if(p_175685_3_) {
  17831. this.func_190522_c(p_175685_1_, p_175685_2_);
  17832. }
  17833.  
  17834. }
  17835.  
  17836. public void func_175695_a(BlockPos p_175695_1_, Block p_175695_2_, EnumFacing p_175695_3_) {
  17837. if(p_175695_3_ != EnumFacing.WEST) {
  17838. this.func_190524_a(p_175695_1_.func_177976_e(), p_175695_2_, p_175695_1_);
  17839. }
  17840.  
  17841. if(p_175695_3_ != EnumFacing.EAST) {
  17842. this.func_190524_a(p_175695_1_.func_177974_f(), p_175695_2_, p_175695_1_);
  17843. }
  17844.  
  17845. if(p_175695_3_ != EnumFacing.DOWN) {
  17846. this.func_190524_a(p_175695_1_.func_177977_b(), p_175695_2_, p_175695_1_);
  17847. }
  17848.  
  17849. if(p_175695_3_ != EnumFacing.UP) {
  17850. this.func_190524_a(p_175695_1_.func_177984_a(), p_175695_2_, p_175695_1_);
  17851. }
  17852.  
  17853. if(p_175695_3_ != EnumFacing.NORTH) {
  17854. this.func_190524_a(p_175695_1_.func_177978_c(), p_175695_2_, p_175695_1_);
  17855. }
  17856.  
  17857. if(p_175695_3_ != EnumFacing.SOUTH) {
  17858. this.func_190524_a(p_175695_1_.func_177968_d(), p_175695_2_, p_175695_1_);
  17859. }
  17860.  
  17861. }
  17862.  
  17863. public void func_190524_a(BlockPos p_190524_1_, final Block p_190524_2_, BlockPos p_190524_3_) {
  17864. if(!this.field_72995_K) {
  17865. IBlockState iblockstate = this.func_180495_p(p_190524_1_);
  17866.  
  17867. try {
  17868. iblockstate.func_189546_a(this, p_190524_1_, p_190524_2_, p_190524_3_);
  17869. } catch (Throwable throwable) {
  17870. CrashReport crashreport = CrashReport.func_85055_a(throwable, "Exception while updating neighbours");
  17871. CrashReportCategory crashreportcategory = crashreport.func_85058_a("Block being updated");
  17872. crashreportcategory.func_189529_a("Source block type", new ICrashReportDetail<String>() {
  17873. public String call() throws Exception {
  17874. try {
  17875. return String.format("ID #%d (%s // %s)", new Object[]{Integer.valueOf(Block.func_149682_b(p_190524_2_)), p_190524_2_.func_149739_a(), p_190524_2_.getClass().getCanonicalName()});
  17876. } catch (Throwable var2) {
  17877. return "ID #" + Block.func_149682_b(p_190524_2_);
  17878. }
  17879. }
  17880. });
  17881. CrashReportCategory.func_175750_a(crashreportcategory, p_190524_1_, iblockstate);
  17882. throw new ReportedException(crashreport);
  17883. }
  17884. }
  17885. }
  17886.  
  17887. public void func_190529_b(BlockPos p_190529_1_, final Block p_190529_2_, BlockPos p_190529_3_) {
  17888. if(!this.field_72995_K) {
  17889. IBlockState iblockstate = this.func_180495_p(p_190529_1_);
  17890. if(iblockstate.func_177230_c() == Blocks.field_190976_dk) {
  17891. try {
  17892. ((BlockObserver)iblockstate.func_177230_c()).func_190962_b(iblockstate, this, p_190529_1_, p_190529_2_, p_190529_3_);
  17893. } catch (Throwable throwable) {
  17894. CrashReport crashreport = CrashReport.func_85055_a(throwable, "Exception while updating neighbours");
  17895. CrashReportCategory crashreportcategory = crashreport.func_85058_a("Block being updated");
  17896. crashreportcategory.func_189529_a("Source block type", new ICrashReportDetail<String>() {
  17897. public String call() throws Exception {
  17898. try {
  17899. return String.format("ID #%d (%s // %s)", new Object[]{Integer.valueOf(Block.func_149682_b(p_190529_2_)), p_190529_2_.func_149739_a(), p_190529_2_.getClass().getCanonicalName()});
  17900. } catch (Throwable var2) {
  17901. return "ID #" + Block.func_149682_b(p_190529_2_);
  17902. }
  17903. }
  17904. });
  17905. CrashReportCategory.func_175750_a(crashreportcategory, p_190529_1_, iblockstate);
  17906. throw new ReportedException(crashreport);
  17907. }
  17908. }
  17909. }
  17910. }
  17911.  
  17912. public boolean func_175691_a(BlockPos p_175691_1_, Block p_175691_2_) {
  17913. return false;
  17914. }
  17915.  
  17916. public boolean func_175678_i(BlockPos p_175678_1_) {
  17917. return this.func_175726_f(p_175678_1_).func_177444_d(p_175678_1_);
  17918. }
  17919.  
  17920. public boolean func_175710_j(BlockPos p_175710_1_) {
  17921. if(p_175710_1_.func_177956_o() >= this.func_181545_F()) {
  17922. return this.func_175678_i(p_175710_1_);
  17923. } else {
  17924. BlockPos blockpos = new BlockPos(p_175710_1_.func_177958_n(), this.func_181545_F(), p_175710_1_.func_177952_p());
  17925. if(!this.func_175678_i(blockpos)) {
  17926. return false;
  17927. } else {
  17928. for(blockpos = blockpos.func_177977_b(); blockpos.func_177956_o() > p_175710_1_.func_177956_o(); blockpos = blockpos.func_177977_b()) {
  17929. IBlockState iblockstate = this.func_180495_p(blockpos);
  17930. if(iblockstate.func_185891_c() > 0 && !iblockstate.func_185904_a().func_76224_d()) {
  17931. return false;
  17932. }
  17933. }
  17934.  
  17935. return true;
  17936. }
  17937. }
  17938. }
  17939.  
  17940. public int func_175699_k(BlockPos p_175699_1_) {
  17941. if(p_175699_1_.func_177956_o() < 0) {
  17942. return 0;
  17943. } else {
  17944. if(p_175699_1_.func_177956_o() >= 256) {
  17945. p_175699_1_ = new BlockPos(p_175699_1_.func_177958_n(), 255, p_175699_1_.func_177952_p());
  17946. }
  17947.  
  17948. return this.func_175726_f(p_175699_1_).func_177443_a(p_175699_1_, 0);
  17949. }
  17950. }
  17951.  
  17952. public int func_175671_l(BlockPos p_175671_1_) {
  17953. return this.func_175721_c(p_175671_1_, true);
  17954. }
  17955.  
  17956. public int func_175721_c(BlockPos p_175721_1_, boolean p_175721_2_) {
  17957. if(p_175721_1_.func_177958_n() >= -30000000 && p_175721_1_.func_177952_p() >= -30000000 && p_175721_1_.func_177958_n() < 30000000 && p_175721_1_.func_177952_p() < 30000000) {
  17958. if(p_175721_2_ && this.func_180495_p(p_175721_1_).func_185916_f()) {
  17959. int i1 = this.func_175721_c(p_175721_1_.func_177984_a(), false);
  17960. int i = this.func_175721_c(p_175721_1_.func_177974_f(), false);
  17961. int j = this.func_175721_c(p_175721_1_.func_177976_e(), false);
  17962. int k = this.func_175721_c(p_175721_1_.func_177968_d(), false);
  17963. int l = this.func_175721_c(p_175721_1_.func_177978_c(), false);
  17964. if(i > i1) {
  17965. i1 = i;
  17966. }
  17967.  
  17968. if(j > i1) {
  17969. i1 = j;
  17970. }
  17971.  
  17972. if(k > i1) {
  17973. i1 = k;
  17974. }
  17975.  
  17976. if(l > i1) {
  17977. i1 = l;
  17978. }
  17979.  
  17980. return i1;
  17981. } else if(p_175721_1_.func_177956_o() < 0) {
  17982. return 0;
  17983. } else {
  17984. if(p_175721_1_.func_177956_o() >= 256) {
  17985. p_175721_1_ = new BlockPos(p_175721_1_.func_177958_n(), 255, p_175721_1_.func_177952_p());
  17986. }
  17987.  
  17988. Chunk chunk = this.func_175726_f(p_175721_1_);
  17989. return chunk.func_177443_a(p_175721_1_, this.field_73008_k);
  17990. }
  17991. } else {
  17992. return 15;
  17993. }
  17994. }
  17995.  
  17996. public BlockPos func_175645_m(BlockPos p_175645_1_) {
  17997. return new BlockPos(p_175645_1_.func_177958_n(), this.func_189649_b(p_175645_1_.func_177958_n(), p_175645_1_.func_177952_p()), p_175645_1_.func_177952_p());
  17998. }
  17999.  
  18000. public int func_189649_b(int p_189649_1_, int p_189649_2_) {
  18001. int i;
  18002. if(p_189649_1_ >= -30000000 && p_189649_2_ >= -30000000 && p_189649_1_ < 30000000 && p_189649_2_ < 30000000) {
  18003. if(this.func_175680_a(p_189649_1_ >> 4, p_189649_2_ >> 4, true)) {
  18004. i = this.func_72964_e(p_189649_1_ >> 4, p_189649_2_ >> 4).func_76611_b(p_189649_1_ & 15, p_189649_2_ & 15);
  18005. } else {
  18006. i = 0;
  18007. }
  18008. } else {
  18009. i = this.func_181545_F() + 1;
  18010. }
  18011.  
  18012. return i;
  18013. }
  18014.  
  18015. @Deprecated
  18016. public int func_82734_g(int p_82734_1_, int p_82734_2_) {
  18017. if(p_82734_1_ >= -30000000 && p_82734_2_ >= -30000000 && p_82734_1_ < 30000000 && p_82734_2_ < 30000000) {
  18018. if(!this.func_175680_a(p_82734_1_ >> 4, p_82734_2_ >> 4, true)) {
  18019. return 0;
  18020. } else {
  18021. Chunk chunk = this.func_72964_e(p_82734_1_ >> 4, p_82734_2_ >> 4);
  18022. return chunk.func_177442_v();
  18023. }
  18024. } else {
  18025. return this.func_181545_F() + 1;
  18026. }
  18027. }
  18028.  
  18029. @SideOnly(Side.CLIENT)
  18030. public int func_175705_a(EnumSkyBlock p_175705_1_, BlockPos p_175705_2_) {
  18031. if(!this.field_73011_w.func_191066_m() && p_175705_1_ == EnumSkyBlock.SKY) {
  18032. return 0;
  18033. } else {
  18034. if(p_175705_2_.func_177956_o() < 0) {
  18035. p_175705_2_ = new BlockPos(p_175705_2_.func_177958_n(), 0, p_175705_2_.func_177952_p());
  18036. }
  18037.  
  18038. if(!this.func_175701_a(p_175705_2_)) {
  18039. return p_175705_1_.field_77198_c;
  18040. } else if(!this.func_175667_e(p_175705_2_)) {
  18041. return p_175705_1_.field_77198_c;
  18042. } else if(this.func_180495_p(p_175705_2_).func_185916_f()) {
  18043. int i1 = this.func_175642_b(p_175705_1_, p_175705_2_.func_177984_a());
  18044. int i = this.func_175642_b(p_175705_1_, p_175705_2_.func_177974_f());
  18045. int j = this.func_175642_b(p_175705_1_, p_175705_2_.func_177976_e());
  18046. int k = this.func_175642_b(p_175705_1_, p_175705_2_.func_177968_d());
  18047. int l = this.func_175642_b(p_175705_1_, p_175705_2_.func_177978_c());
  18048. if(i > i1) {
  18049. i1 = i;
  18050. }
  18051.  
  18052. if(j > i1) {
  18053. i1 = j;
  18054. }
  18055.  
  18056. if(k > i1) {
  18057. i1 = k;
  18058. }
  18059.  
  18060. if(l > i1) {
  18061. i1 = l;
  18062. }
  18063.  
  18064. return i1;
  18065. } else {
  18066. Chunk chunk = this.func_175726_f(p_175705_2_);
  18067. return chunk.func_177413_a(p_175705_1_, p_175705_2_);
  18068. }
  18069. }
  18070. }
  18071.  
  18072. public int func_175642_b(EnumSkyBlock p_175642_1_, BlockPos p_175642_2_) {
  18073. if(p_175642_2_.func_177956_o() < 0) {
  18074. p_175642_2_ = new BlockPos(p_175642_2_.func_177958_n(), 0, p_175642_2_.func_177952_p());
  18075. }
  18076.  
  18077. if(!this.func_175701_a(p_175642_2_)) {
  18078. return p_175642_1_.field_77198_c;
  18079. } else if(!this.func_175667_e(p_175642_2_)) {
  18080. return p_175642_1_.field_77198_c;
  18081. } else {
  18082. Chunk chunk = this.func_175726_f(p_175642_2_);
  18083. return chunk.func_177413_a(p_175642_1_, p_175642_2_);
  18084. }
  18085. }
  18086.  
  18087. public void func_175653_a(EnumSkyBlock p_175653_1_, BlockPos p_175653_2_, int p_175653_3_) {
  18088. if(this.func_175701_a(p_175653_2_)) {
  18089. if(this.func_175667_e(p_175653_2_)) {
  18090. Chunk chunk = this.func_175726_f(p_175653_2_);
  18091. chunk.func_177431_a(p_175653_1_, p_175653_2_, p_175653_3_);
  18092. this.func_175679_n(p_175653_2_);
  18093. }
  18094. }
  18095. }
  18096.  
  18097. public void func_175679_n(BlockPos p_175679_1_) {
  18098. for(int i = 0; i < this.field_73021_x.size(); ++i) {
  18099. ((IWorldEventListener)this.field_73021_x.get(i)).func_174959_b(p_175679_1_);
  18100. }
  18101.  
  18102. }
  18103.  
  18104. @SideOnly(Side.CLIENT)
  18105. public int func_175626_b(BlockPos p_175626_1_, int p_175626_2_) {
  18106. int i = this.func_175705_a(EnumSkyBlock.SKY, p_175626_1_);
  18107. int j = this.func_175705_a(EnumSkyBlock.BLOCK, p_175626_1_);
  18108. if(j < p_175626_2_) {
  18109. j = p_175626_2_;
  18110. }
  18111.  
  18112. return i << 20 | j << 4;
  18113. }
  18114.  
  18115. public float func_175724_o(BlockPos p_175724_1_) {
  18116. return this.field_73011_w.func_177497_p()[this.func_175671_l(p_175724_1_)];
  18117. }
  18118.  
  18119. public IBlockState func_180495_p(BlockPos p_180495_1_) {
  18120. if(this.func_189509_E(p_180495_1_)) {
  18121. return Blocks.field_150350_a.func_176223_P();
  18122. } else {
  18123. Chunk chunk = this.func_175726_f(p_180495_1_);
  18124. return chunk.func_177435_g(p_180495_1_);
  18125. }
  18126. }
  18127.  
  18128. public boolean func_72935_r() {
  18129. return this.field_73008_k < 4;
  18130. }
  18131.  
  18132. @Nullable
  18133. public RayTraceResult func_72933_a(Vec3d p_72933_1_, Vec3d p_72933_2_) {
  18134. return this.func_147447_a(p_72933_1_, p_72933_2_, false, false, false);
  18135. }
  18136.  
  18137. @Nullable
  18138. public RayTraceResult func_72901_a(Vec3d p_72901_1_, Vec3d p_72901_2_, boolean p_72901_3_) {
  18139. return this.func_147447_a(p_72901_1_, p_72901_2_, p_72901_3_, false, false);
  18140. }
  18141.  
  18142. @Nullable
  18143. public RayTraceResult func_147447_a(Vec3d p_147447_1_, Vec3d p_147447_2_, boolean p_147447_3_, boolean p_147447_4_, boolean p_147447_5_) {
  18144. if(!Double.isNaN(p_147447_1_.field_72450_a) && !Double.isNaN(p_147447_1_.field_72448_b) && !Double.isNaN(p_147447_1_.field_72449_c)) {
  18145. if(!Double.isNaN(p_147447_2_.field_72450_a) && !Double.isNaN(p_147447_2_.field_72448_b) && !Double.isNaN(p_147447_2_.field_72449_c)) {
  18146. int i = MathHelper.func_76128_c(p_147447_2_.field_72450_a);
  18147. int j = MathHelper.func_76128_c(p_147447_2_.field_72448_b);
  18148. int k = MathHelper.func_76128_c(p_147447_2_.field_72449_c);
  18149. int l = MathHelper.func_76128_c(p_147447_1_.field_72450_a);
  18150. int i1 = MathHelper.func_76128_c(p_147447_1_.field_72448_b);
  18151. int j1 = MathHelper.func_76128_c(p_147447_1_.field_72449_c);
  18152. BlockPos blockpos = new BlockPos(l, i1, j1);
  18153. IBlockState iblockstate = this.func_180495_p(blockpos);
  18154. Block block = iblockstate.func_177230_c();
  18155. if((!p_147447_4_ || iblockstate.func_185890_d(this, blockpos) != Block.field_185506_k) && block.func_176209_a(iblockstate, p_147447_3_)) {
  18156. RayTraceResult raytraceresult = iblockstate.func_185910_a(this, blockpos, p_147447_1_, p_147447_2_);
  18157. if(raytraceresult != null) {
  18158. return raytraceresult;
  18159. }
  18160. }
  18161.  
  18162. RayTraceResult raytraceresult2 = null;
  18163. int k1 = 200;
  18164.  
  18165. while(k1-- >= 0) {
  18166. if(Double.isNaN(p_147447_1_.field_72450_a) || Double.isNaN(p_147447_1_.field_72448_b) || Double.isNaN(p_147447_1_.field_72449_c)) {
  18167. return null;
  18168. }
  18169.  
  18170. if(l == i && i1 == j && j1 == k) {
  18171. return p_147447_5_?raytraceresult2:null;
  18172. }
  18173.  
  18174. boolean flag2 = true;
  18175. boolean flag = true;
  18176. boolean flag1 = true;
  18177. double d0 = 999.0D;
  18178. double d1 = 999.0D;
  18179. double d2 = 999.0D;
  18180. if(i > l) {
  18181. d0 = (double)l + 1.0D;
  18182. } else if(i < l) {
  18183. d0 = (double)l + 0.0D;
  18184. } else {
  18185. flag2 = false;
  18186. }
  18187.  
  18188. if(j > i1) {
  18189. d1 = (double)i1 + 1.0D;
  18190. } else if(j < i1) {
  18191. d1 = (double)i1 + 0.0D;
  18192. } else {
  18193. flag = false;
  18194. }
  18195.  
  18196. if(k > j1) {
  18197. d2 = (double)j1 + 1.0D;
  18198. } else if(k < j1) {
  18199. d2 = (double)j1 + 0.0D;
  18200. } else {
  18201. flag1 = false;
  18202. }
  18203.  
  18204. double d3 = 999.0D;
  18205. double d4 = 999.0D;
  18206. double d5 = 999.0D;
  18207. double d6 = p_147447_2_.field_72450_a - p_147447_1_.field_72450_a;
  18208. double d7 = p_147447_2_.field_72448_b - p_147447_1_.field_72448_b;
  18209. double d8 = p_147447_2_.field_72449_c - p_147447_1_.field_72449_c;
  18210. if(flag2) {
  18211. d3 = (d0 - p_147447_1_.field_72450_a) / d6;
  18212. }
  18213.  
  18214. if(flag) {
  18215. d4 = (d1 - p_147447_1_.field_72448_b) / d7;
  18216. }
  18217.  
  18218. if(flag1) {
  18219. d5 = (d2 - p_147447_1_.field_72449_c) / d8;
  18220. }
  18221.  
  18222. if(d3 == -0.0D) {
  18223. d3 = -1.0E-4D;
  18224. }
  18225.  
  18226. if(d4 == -0.0D) {
  18227. d4 = -1.0E-4D;
  18228. }
  18229.  
  18230. if(d5 == -0.0D) {
  18231. d5 = -1.0E-4D;
  18232. }
  18233.  
  18234. EnumFacing enumfacing;
  18235. if(d3 < d4 && d3 < d5) {
  18236. enumfacing = i > l?EnumFacing.WEST:EnumFacing.EAST;
  18237. p_147447_1_ = new Vec3d(d0, p_147447_1_.field_72448_b + d7 * d3, p_147447_1_.field_72449_c + d8 * d3);
  18238. } else if(d4 < d5) {
  18239. enumfacing = j > i1?EnumFacing.DOWN:EnumFacing.UP;
  18240. p_147447_1_ = new Vec3d(p_147447_1_.field_72450_a + d6 * d4, d1, p_147447_1_.field_72449_c + d8 * d4);
  18241. } else {
  18242. enumfacing = k > j1?EnumFacing.NORTH:EnumFacing.SOUTH;
  18243. p_147447_1_ = new Vec3d(p_147447_1_.field_72450_a + d6 * d5, p_147447_1_.field_72448_b + d7 * d5, d2);
  18244. }
  18245.  
  18246. l = MathHelper.func_76128_c(p_147447_1_.field_72450_a) - (enumfacing == EnumFacing.EAST?1:0);
  18247. i1 = MathHelper.func_76128_c(p_147447_1_.field_72448_b) - (enumfacing == EnumFacing.UP?1:0);
  18248. j1 = MathHelper.func_76128_c(p_147447_1_.field_72449_c) - (enumfacing == EnumFacing.SOUTH?1:0);
  18249. blockpos = new BlockPos(l, i1, j1);
  18250. IBlockState iblockstate1 = this.func_180495_p(blockpos);
  18251. Block block1 = iblockstate1.func_177230_c();
  18252. if(!p_147447_4_ || iblockstate1.func_185904_a() == Material.field_151567_E || iblockstate1.func_185890_d(this, blockpos) != Block.field_185506_k) {
  18253. if(block1.func_176209_a(iblockstate1, p_147447_3_)) {
  18254. RayTraceResult raytraceresult1 = iblockstate1.func_185910_a(this, blockpos, p_147447_1_, p_147447_2_);
  18255. if(raytraceresult1 != null) {
  18256. return raytraceresult1;
  18257. }
  18258. } else {
  18259. raytraceresult2 = new RayTraceResult(RayTraceResult.Type.MISS, p_147447_1_, enumfacing, blockpos);
  18260. }
  18261. }
  18262. }
  18263.  
  18264. return p_147447_5_?raytraceresult2:null;
  18265. } else {
  18266. return null;
  18267. }
  18268. } else {
  18269. return null;
  18270. }
  18271. }
  18272.  
  18273. public void func_184133_a(@Nullable EntityPlayer p_184133_1_, BlockPos p_184133_2_, SoundEvent p_184133_3_, SoundCategory p_184133_4_, float p_184133_5_, float p_184133_6_) {
  18274. this.func_184148_a(p_184133_1_, (double)p_184133_2_.func_177958_n() + 0.5D, (double)p_184133_2_.func_177956_o() + 0.5D, (double)p_184133_2_.func_177952_p() + 0.5D, p_184133_3_, p_184133_4_, p_184133_5_, p_184133_6_);
  18275. }
  18276.  
  18277. public void func_184148_a(@Nullable EntityPlayer p_184148_1_, double p_184148_2_, double p_184148_4_, double p_184148_6_, SoundEvent p_184148_8_, SoundCategory p_184148_9_, float p_184148_10_, float p_184148_11_) {
  18278. for(int i = 0; i < this.field_73021_x.size(); ++i) {
  18279. ((IWorldEventListener)this.field_73021_x.get(i)).func_184375_a(p_184148_1_, p_184148_8_, p_184148_9_, p_184148_2_, p_184148_4_, p_184148_6_, p_184148_10_, p_184148_11_);
  18280. }
  18281.  
  18282. }
  18283.  
  18284. public void func_184134_a(double p_184134_1_, double p_184134_3_, double p_184134_5_, SoundEvent p_184134_7_, SoundCategory p_184134_8_, float p_184134_9_, float p_184134_10_, boolean p_184134_11_) {
  18285. }
  18286.  
  18287. public void func_184149_a(BlockPos p_184149_1_, @Nullable SoundEvent p_184149_2_) {
  18288. for(int i = 0; i < this.field_73021_x.size(); ++i) {
  18289. ((IWorldEventListener)this.field_73021_x.get(i)).func_184377_a(p_184149_2_, p_184149_1_);
  18290. }
  18291.  
  18292. }
  18293.  
  18294. public void func_175688_a(EnumParticleTypes p_175688_1_, double p_175688_2_, double p_175688_4_, double p_175688_6_, double p_175688_8_, double p_175688_10_, double p_175688_12_, int... p_175688_14_) {
  18295. this.func_175720_a(p_175688_1_.func_179348_c(), p_175688_1_.func_179344_e(), p_175688_2_, p_175688_4_, p_175688_6_, p_175688_8_, p_175688_10_, p_175688_12_, p_175688_14_);
  18296. }
  18297.  
  18298. public void func_190523_a(int p_190523_1_, double p_190523_2_, double p_190523_4_, double p_190523_6_, double p_190523_8_, double p_190523_10_, double p_190523_12_, int... p_190523_14_) {
  18299. for(int i = 0; i < this.field_73021_x.size(); ++i) {
  18300. ((IWorldEventListener)this.field_73021_x.get(i)).func_190570_a(p_190523_1_, false, true, p_190523_2_, p_190523_4_, p_190523_6_, p_190523_8_, p_190523_10_, p_190523_12_, p_190523_14_);
  18301. }
  18302.  
  18303. }
  18304.  
  18305. @SideOnly(Side.CLIENT)
  18306. public void func_175682_a(EnumParticleTypes p_175682_1_, boolean p_175682_2_, double p_175682_3_, double p_175682_5_, double p_175682_7_, double p_175682_9_, double p_175682_11_, double p_175682_13_, int... p_175682_15_) {
  18307. this.func_175720_a(p_175682_1_.func_179348_c(), p_175682_1_.func_179344_e() || p_175682_2_, p_175682_3_, p_175682_5_, p_175682_7_, p_175682_9_, p_175682_11_, p_175682_13_, p_175682_15_);
  18308. }
  18309.  
  18310. private void func_175720_a(int p_175720_1_, boolean p_175720_2_, double p_175720_3_, double p_175720_5_, double p_175720_7_, double p_175720_9_, double p_175720_11_, double p_175720_13_, int... p_175720_15_) {
  18311. for(int i = 0; i < this.field_73021_x.size(); ++i) {
  18312. ((IWorldEventListener)this.field_73021_x.get(i)).func_180442_a(p_175720_1_, p_175720_2_, p_175720_3_, p_175720_5_, p_175720_7_, p_175720_9_, p_175720_11_, p_175720_13_, p_175720_15_);
  18313. }
  18314.  
  18315. }
  18316.  
  18317. public boolean func_72942_c(Entity p_72942_1_) {
  18318. this.field_73007_j.add(p_72942_1_);
  18319. return true;
  18320. }
  18321.  
  18322. public boolean func_72838_d(Entity p_72838_1_) {
  18323. int i = MathHelper.func_76128_c(p_72838_1_.field_70165_t / 16.0D);
  18324. int j = MathHelper.func_76128_c(p_72838_1_.field_70161_v / 16.0D);
  18325. boolean flag = p_72838_1_.field_98038_p;
  18326. if(p_72838_1_ instanceof EntityPlayer) {
  18327. flag = true;
  18328. }
  18329.  
  18330. if(!flag && !this.func_175680_a(i, j, false)) {
  18331. return false;
  18332. } else {
  18333. if(p_72838_1_ instanceof EntityPlayer) {
  18334. EntityPlayer entityplayer = (EntityPlayer)p_72838_1_;
  18335. this.field_73010_i.add(entityplayer);
  18336. this.func_72854_c();
  18337. }
  18338.  
  18339. this.func_72964_e(i, j).func_76612_a(p_72838_1_);
  18340. this.field_72996_f.add(p_72838_1_);
  18341. this.func_72923_a(p_72838_1_);
  18342. return true;
  18343. }
  18344. }
  18345.  
  18346. public void func_72923_a(Entity p_72923_1_) {
  18347. for(int i = 0; i < this.field_73021_x.size(); ++i) {
  18348. ((IWorldEventListener)this.field_73021_x.get(i)).func_72703_a(p_72923_1_);
  18349. }
  18350.  
  18351. }
  18352.  
  18353. public void func_72847_b(Entity p_72847_1_) {
  18354. for(int i = 0; i < this.field_73021_x.size(); ++i) {
  18355. ((IWorldEventListener)this.field_73021_x.get(i)).func_72709_b(p_72847_1_);
  18356. }
  18357.  
  18358. }
  18359.  
  18360. public void func_72900_e(Entity p_72900_1_) {
  18361. if(p_72900_1_.func_184207_aI()) {
  18362. p_72900_1_.func_184226_ay();
  18363. }
  18364.  
  18365. if(p_72900_1_.func_184218_aH()) {
  18366. p_72900_1_.func_184210_p();
  18367. }
  18368.  
  18369. p_72900_1_.func_70106_y();
  18370. if(p_72900_1_ instanceof EntityPlayer) {
  18371. this.field_73010_i.remove(p_72900_1_);
  18372. this.func_72854_c();
  18373. this.func_72847_b(p_72900_1_);
  18374. }
  18375.  
  18376. }
  18377.  
  18378. public void func_72973_f(Entity p_72973_1_) {
  18379. p_72973_1_.func_184174_b(false);
  18380. p_72973_1_.func_70106_y();
  18381. if(p_72973_1_ instanceof EntityPlayer) {
  18382. this.field_73010_i.remove(p_72973_1_);
  18383. this.func_72854_c();
  18384. }
  18385.  
  18386. int i = p_72973_1_.field_70176_ah;
  18387. int j = p_72973_1_.field_70164_aj;
  18388. if(p_72973_1_.field_70175_ag && this.func_175680_a(i, j, true)) {
  18389. this.func_72964_e(i, j).func_76622_b(p_72973_1_);
  18390. }
  18391.  
  18392. this.field_72996_f.remove(p_72973_1_);
  18393. this.func_72847_b(p_72973_1_);
  18394. }
  18395.  
  18396. public void func_72954_a(IWorldEventListener p_72954_1_) {
  18397. this.field_73021_x.add(p_72954_1_);
  18398. }
  18399.  
  18400. private boolean func_191504_a(@Nullable Entity p_191504_1_, AxisAlignedBB p_191504_2_, boolean p_191504_3_, @Nullable List<AxisAlignedBB> p_191504_4_) {
  18401. int i = MathHelper.func_76128_c(p_191504_2_.field_72340_a) - 1;
  18402. int j = MathHelper.func_76143_f(p_191504_2_.field_72336_d) + 1;
  18403. int k = MathHelper.func_76128_c(p_191504_2_.field_72338_b) - 1;
  18404. int l = MathHelper.func_76143_f(p_191504_2_.field_72337_e) + 1;
  18405. int i1 = MathHelper.func_76128_c(p_191504_2_.field_72339_c) - 1;
  18406. int j1 = MathHelper.func_76143_f(p_191504_2_.field_72334_f) + 1;
  18407. WorldBorder worldborder = this.func_175723_af();
  18408. boolean flag = p_191504_1_ != null && p_191504_1_.func_174832_aS();
  18409. boolean flag1 = p_191504_1_ != null && this.func_191503_g(p_191504_1_);
  18410. IBlockState iblockstate = Blocks.field_150348_b.func_176223_P();
  18411. BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
  18412.  
  18413. try {
  18414. for(int k1 = i; k1 < j; ++k1) {
  18415. for(int l1 = i1; l1 < j1; ++l1) {
  18416. boolean flag2 = k1 == i || k1 == j - 1;
  18417. boolean flag3 = l1 == i1 || l1 == j1 - 1;
  18418. if((!flag2 || !flag3) && this.func_175667_e(blockpos$pooledmutableblockpos.func_181079_c(k1, 64, l1))) {
  18419. for(int i2 = k; i2 < l; ++i2) {
  18420. if(!flag2 && !flag3 || i2 != l - 1) {
  18421. if(p_191504_3_) {
  18422. if(k1 < -30000000 || k1 >= 30000000 || l1 < -30000000 || l1 >= 30000000) {
  18423. boolean lvt_21_1_ = true;
  18424. return lvt_21_1_;
  18425. }
  18426. } else if(p_191504_1_ != null && flag == flag1) {
  18427. p_191504_1_.func_174821_h(!flag1);
  18428. }
  18429.  
  18430. blockpos$pooledmutableblockpos.func_181079_c(k1, i2, l1);
  18431. IBlockState iblockstate1;
  18432. if(!p_191504_3_ && !worldborder.func_177746_a(blockpos$pooledmutableblockpos) && flag1) {
  18433. iblockstate1 = iblockstate;
  18434. } else {
  18435. iblockstate1 = this.func_180495_p(blockpos$pooledmutableblockpos);
  18436. }
  18437.  
  18438. iblockstate1.func_185908_a(this, blockpos$pooledmutableblockpos, p_191504_2_, p_191504_4_, p_191504_1_, false);
  18439. if(p_191504_3_ && !p_191504_4_.isEmpty()) {
  18440. boolean flag5 = true;
  18441. return flag5;
  18442. }
  18443. }
  18444. }
  18445. }
  18446. }
  18447. }
  18448. } finally {
  18449. blockpos$pooledmutableblockpos.func_185344_t();
  18450. }
  18451.  
  18452. return !p_191504_4_.isEmpty();
  18453. }
  18454.  
  18455. public List<AxisAlignedBB> func_184144_a(@Nullable Entity p_184144_1_, AxisAlignedBB p_184144_2_) {
  18456. List<AxisAlignedBB> list = Lists.<AxisAlignedBB>newArrayList();
  18457. this.func_191504_a(p_184144_1_, p_184144_2_, false, list);
  18458. if(p_184144_1_ != null) {
  18459. List<Entity> list1 = this.func_72839_b(p_184144_1_, p_184144_2_.func_186662_g(0.25D));
  18460.  
  18461. for(int i = 0; i < list1.size(); ++i) {
  18462. Entity entity = (Entity)list1.get(i);
  18463. if(!p_184144_1_.func_184223_x(entity)) {
  18464. AxisAlignedBB axisalignedbb = entity.func_70046_E();
  18465. if(axisalignedbb != null && axisalignedbb.func_72326_a(p_184144_2_)) {
  18466. list.add(axisalignedbb);
  18467. }
  18468.  
  18469. axisalignedbb = p_184144_1_.func_70114_g(entity);
  18470. if(axisalignedbb != null && axisalignedbb.func_72326_a(p_184144_2_)) {
  18471. list.add(axisalignedbb);
  18472. }
  18473. }
  18474. }
  18475. }
  18476.  
  18477. return list;
  18478. }
  18479.  
  18480. @SideOnly(Side.CLIENT)
  18481. public void func_72848_b(IWorldEventListener p_72848_1_) {
  18482. this.field_73021_x.remove(p_72848_1_);
  18483. }
  18484.  
  18485. public boolean func_191503_g(Entity p_191503_1_) {
  18486. double d0 = this.field_175728_M.func_177726_b();
  18487. double d1 = this.field_175728_M.func_177736_c();
  18488. double d2 = this.field_175728_M.func_177728_d();
  18489. double d3 = this.field_175728_M.func_177733_e();
  18490. if(p_191503_1_.func_174832_aS()) {
  18491. ++d0;
  18492. ++d1;
  18493. --d2;
  18494. --d3;
  18495. } else {
  18496. --d0;
  18497. --d1;
  18498. ++d2;
  18499. ++d3;
  18500. }
  18501.  
  18502. return p_191503_1_.field_70165_t > d0 && p_191503_1_.field_70165_t < d2 && p_191503_1_.field_70161_v > d1 && p_191503_1_.field_70161_v < d3;
  18503. }
  18504.  
  18505. public boolean func_184143_b(AxisAlignedBB p_184143_1_) {
  18506. return this.func_191504_a((Entity)null, p_184143_1_, true, Lists.<AxisAlignedBB>newArrayList());
  18507. }
  18508.  
  18509. public int func_72967_a(float p_72967_1_) {
  18510. float f = this.func_72826_c(p_72967_1_);
  18511. float f1 = 1.0F - (MathHelper.func_76134_b(f * 6.2831855F) * 2.0F + 0.5F);
  18512. f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F);
  18513. f1 = 1.0F - f1;
  18514. f1 = (float)((double)f1 * (1.0D - (double)(this.func_72867_j(p_72967_1_) * 5.0F) / 16.0D));
  18515. f1 = (float)((double)f1 * (1.0D - (double)(this.func_72819_i(p_72967_1_) * 5.0F) / 16.0D));
  18516. f1 = 1.0F - f1;
  18517. return (int)(f1 * 11.0F);
  18518. }
  18519.  
  18520. @SideOnly(Side.CLIENT)
  18521. public float func_72971_b(float p_72971_1_) {
  18522. float f = this.func_72826_c(p_72971_1_);
  18523. float f1 = 1.0F - (MathHelper.func_76134_b(f * 6.2831855F) * 2.0F + 0.2F);
  18524. f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F);
  18525. f1 = 1.0F - f1;
  18526. f1 = (float)((double)f1 * (1.0D - (double)(this.func_72867_j(p_72971_1_) * 5.0F) / 16.0D));
  18527. f1 = (float)((double)f1 * (1.0D - (double)(this.func_72819_i(p_72971_1_) * 5.0F) / 16.0D));
  18528. return f1 * 0.8F + 0.2F;
  18529. }
  18530.  
  18531. @SideOnly(Side.CLIENT)
  18532. public Vec3d func_72833_a(Entity p_72833_1_, float p_72833_2_) {
  18533. float f = this.func_72826_c(p_72833_2_);
  18534. float f1 = MathHelper.func_76134_b(f * 6.2831855F) * 2.0F + 0.5F;
  18535. f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F);
  18536. int i = MathHelper.func_76128_c(p_72833_1_.field_70165_t);
  18537. int j = MathHelper.func_76128_c(p_72833_1_.field_70163_u);
  18538. int k = MathHelper.func_76128_c(p_72833_1_.field_70161_v);
  18539. BlockPos blockpos = new BlockPos(i, j, k);
  18540. Biome biome = this.func_180494_b(blockpos);
  18541. float f2 = biome.func_180626_a(blockpos);
  18542. int l = biome.func_76731_a(f2);
  18543. float f3 = (float)(l >> 16 & 255) / 255.0F;
  18544. float f4 = (float)(l >> 8 & 255) / 255.0F;
  18545. float f5 = (float)(l & 255) / 255.0F;
  18546. f3 = f3 * f1;
  18547. f4 = f4 * f1;
  18548. f5 = f5 * f1;
  18549. float f6 = this.func_72867_j(p_72833_2_);
  18550. if(f6 > 0.0F) {
  18551. float f7 = (f3 * 0.3F + f4 * 0.59F + f5 * 0.11F) * 0.6F;
  18552. float f8 = 1.0F - f6 * 0.75F;
  18553. f3 = f3 * f8 + f7 * (1.0F - f8);
  18554. f4 = f4 * f8 + f7 * (1.0F - f8);
  18555. f5 = f5 * f8 + f7 * (1.0F - f8);
  18556. }
  18557.  
  18558. float f10 = this.func_72819_i(p_72833_2_);
  18559. if(f10 > 0.0F) {
  18560. float f11 = (f3 * 0.3F + f4 * 0.59F + f5 * 0.11F) * 0.2F;
  18561. float f9 = 1.0F - f10 * 0.75F;
  18562. f3 = f3 * f9 + f11 * (1.0F - f9);
  18563. f4 = f4 * f9 + f11 * (1.0F - f9);
  18564. f5 = f5 * f9 + f11 * (1.0F - f9);
  18565. }
  18566.  
  18567. if(this.field_73016_r > 0) {
  18568. float f12 = (float)this.field_73016_r - p_72833_2_;
  18569. if(f12 > 1.0F) {
  18570. f12 = 1.0F;
  18571. }
  18572.  
  18573. f12 = f12 * 0.45F;
  18574. f3 = f3 * (1.0F - f12) + 0.8F * f12;
  18575. f4 = f4 * (1.0F - f12) + 0.8F * f12;
  18576. f5 = f5 * (1.0F - f12) + 1.0F * f12;
  18577. }
  18578.  
  18579. return new Vec3d((double)f3, (double)f4, (double)f5);
  18580. }
  18581.  
  18582. public float func_72826_c(float p_72826_1_) {
  18583. return this.field_73011_w.func_76563_a(this.field_72986_A.func_76073_f(), p_72826_1_);
  18584. }
  18585.  
  18586. @SideOnly(Side.CLIENT)
  18587. public int func_72853_d() {
  18588. return this.field_73011_w.func_76559_b(this.field_72986_A.func_76073_f());
  18589. }
  18590.  
  18591. public float func_130001_d() {
  18592. return WorldProvider.field_111203_a[this.field_73011_w.func_76559_b(this.field_72986_A.func_76073_f())];
  18593. }
  18594.  
  18595. public float func_72929_e(float p_72929_1_) {
  18596. float f = this.func_72826_c(p_72929_1_);
  18597. return f * 6.2831855F;
  18598. }
  18599.  
  18600. @SideOnly(Side.CLIENT)
  18601. public Vec3d func_72824_f(float p_72824_1_) {
  18602. float f = this.func_72826_c(p_72824_1_);
  18603. float f1 = MathHelper.func_76134_b(f * 6.2831855F) * 2.0F + 0.5F;
  18604. f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F);
  18605. float f2 = 1.0F;
  18606. float f3 = 1.0F;
  18607. float f4 = 1.0F;
  18608. float f5 = this.func_72867_j(p_72824_1_);
  18609. if(f5 > 0.0F) {
  18610. float f6 = (f2 * 0.3F + f3 * 0.59F + f4 * 0.11F) * 0.6F;
  18611. float f7 = 1.0F - f5 * 0.95F;
  18612. f2 = f2 * f7 + f6 * (1.0F - f7);
  18613. f3 = f3 * f7 + f6 * (1.0F - f7);
  18614. f4 = f4 * f7 + f6 * (1.0F - f7);
  18615. }
  18616.  
  18617. f2 = f2 * (f1 * 0.9F + 0.1F);
  18618. f3 = f3 * (f1 * 0.9F + 0.1F);
  18619. f4 = f4 * (f1 * 0.85F + 0.15F);
  18620. float f9 = this.func_72819_i(p_72824_1_);
  18621. if(f9 > 0.0F) {
  18622. float f10 = (f2 * 0.3F + f3 * 0.59F + f4 * 0.11F) * 0.2F;
  18623. float f8 = 1.0F - f9 * 0.95F;
  18624. f2 = f2 * f8 + f10 * (1.0F - f8);
  18625. f3 = f3 * f8 + f10 * (1.0F - f8);
  18626. f4 = f4 * f8 + f10 * (1.0F - f8);
  18627. }
  18628.  
  18629. return new Vec3d((double)f2, (double)f3, (double)f4);
  18630. }
  18631.  
  18632. @SideOnly(Side.CLIENT)
  18633. public Vec3d func_72948_g(float p_72948_1_) {
  18634. float f = this.func_72826_c(p_72948_1_);
  18635. return this.field_73011_w.func_76562_b(f, p_72948_1_);
  18636. }
  18637.  
  18638. public BlockPos func_175725_q(BlockPos p_175725_1_) {
  18639. return this.func_175726_f(p_175725_1_).func_177440_h(p_175725_1_);
  18640. }
  18641.  
  18642. public BlockPos func_175672_r(BlockPos p_175672_1_) {
  18643. Chunk chunk = this.func_175726_f(p_175672_1_);
  18644.  
  18645. BlockPos blockpos;
  18646. BlockPos blockpos1;
  18647. for(blockpos = new BlockPos(p_175672_1_.func_177958_n(), chunk.func_76625_h() + 16, p_175672_1_.func_177952_p()); blockpos.func_177956_o() >= 0; blockpos = blockpos1) {
  18648. blockpos1 = blockpos.func_177977_b();
  18649. Material material = chunk.func_177435_g(blockpos1).func_185904_a();
  18650. if(material.func_76230_c() && material != Material.field_151584_j) {
  18651. break;
  18652. }
  18653. }
  18654.  
  18655. return blockpos;
  18656. }
  18657.  
  18658. @SideOnly(Side.CLIENT)
  18659. public float func_72880_h(float p_72880_1_) {
  18660. float f = this.func_72826_c(p_72880_1_);
  18661. float f1 = 1.0F - (MathHelper.func_76134_b(f * 6.2831855F) * 2.0F + 0.25F);
  18662. f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F);
  18663. return f1 * f1 * 0.5F;
  18664. }
  18665.  
  18666. public boolean func_184145_b(BlockPos p_184145_1_, Block p_184145_2_) {
  18667. return true;
  18668. }
  18669.  
  18670. public void func_175684_a(BlockPos p_175684_1_, Block p_175684_2_, int p_175684_3_) {
  18671. }
  18672.  
  18673. public void func_175654_a(BlockPos p_175654_1_, Block p_175654_2_, int p_175654_3_, int p_175654_4_) {
  18674. }
  18675.  
  18676. public void func_180497_b(BlockPos p_180497_1_, Block p_180497_2_, int p_180497_3_, int p_180497_4_) {
  18677. }
  18678.  
  18679. public void func_72939_s() {
  18680. this.field_72984_F.func_76320_a("entities");
  18681. this.field_72984_F.func_76320_a("global");
  18682.  
  18683. for(int i = 0; i < this.field_73007_j.size(); ++i) {
  18684. Entity entity = (Entity)this.field_73007_j.get(i);
  18685.  
  18686. try {
  18687. ++entity.field_70173_aa;
  18688. entity.func_70071_h_();
  18689. } catch (Throwable throwable2) {
  18690. CrashReport crashreport = CrashReport.func_85055_a(throwable2, "Ticking entity");
  18691. CrashReportCategory crashreportcategory = crashreport.func_85058_a("Entity being ticked");
  18692. if(entity == null) {
  18693. crashreportcategory.func_71507_a("Entity", "~~NULL~~");
  18694. } else {
  18695. entity.func_85029_a(crashreportcategory);
  18696. }
  18697.  
  18698. throw new ReportedException(crashreport);
  18699. }
  18700.  
  18701. if(entity.field_70128_L) {
  18702. this.field_73007_j.remove(i--);
  18703. }
  18704. }
  18705.  
  18706. this.field_72984_F.func_76318_c("remove");
  18707. this.field_72996_f.removeAll(this.field_72997_g);
  18708.  
  18709. for(int k = 0; k < this.field_72997_g.size(); ++k) {
  18710. Entity entity1 = (Entity)this.field_72997_g.get(k);
  18711. int j = entity1.field_70176_ah;
  18712. int k1 = entity1.field_70164_aj;
  18713. if(entity1.field_70175_ag && this.func_175680_a(j, k1, true)) {
  18714. this.func_72964_e(j, k1).func_76622_b(entity1);
  18715. }
  18716. }
  18717.  
  18718. for(int l = 0; l < this.field_72997_g.size(); ++l) {
  18719. this.func_72847_b((Entity)this.field_72997_g.get(l));
  18720. }
  18721.  
  18722. this.field_72997_g.clear();
  18723. this.func_184147_l();
  18724. this.field_72984_F.func_76318_c("regular");
  18725.  
  18726. for(int i1 = 0; i1 < this.field_72996_f.size(); ++i1) {
  18727. Entity entity2 = (Entity)this.field_72996_f.get(i1);
  18728. Entity entity3 = entity2.func_184187_bx();
  18729. if(entity3 != null) {
  18730. if(!entity3.field_70128_L && entity3.func_184196_w(entity2)) {
  18731. continue;
  18732. }
  18733.  
  18734. entity2.func_184210_p();
  18735. }
  18736.  
  18737. this.field_72984_F.func_76320_a("tick");
  18738. if(!entity2.field_70128_L && !(entity2 instanceof EntityPlayerMP)) {
  18739. try {
  18740. this.func_72870_g(entity2);
  18741. } catch (Throwable throwable1) {
  18742. CrashReport crashreport1 = CrashReport.func_85055_a(throwable1, "Ticking entity");
  18743. CrashReportCategory crashreportcategory1 = crashreport1.func_85058_a("Entity being ticked");
  18744. entity2.func_85029_a(crashreportcategory1);
  18745. throw new ReportedException(crashreport1);
  18746. }
  18747. }
  18748.  
  18749. this.field_72984_F.func_76319_b();
  18750. this.field_72984_F.func_76320_a("remove");
  18751. if(entity2.field_70128_L) {
  18752. int l1 = entity2.field_70176_ah;
  18753. int i2 = entity2.field_70164_aj;
  18754. if(entity2.field_70175_ag && this.func_175680_a(l1, i2, true)) {
  18755. this.func_72964_e(l1, i2).func_76622_b(entity2);
  18756. }
  18757.  
  18758. this.field_72996_f.remove(i1--);
  18759. this.func_72847_b(entity2);
  18760. }
  18761.  
  18762. this.field_72984_F.func_76319_b();
  18763. }
  18764.  
  18765. this.field_72984_F.func_76318_c("blockEntities");
  18766. this.field_147481_N = true;
  18767. Iterator<TileEntity> iterator = this.field_175730_i.iterator();
  18768.  
  18769. while(iterator.hasNext()) {
  18770. TileEntity tileentity = (TileEntity)iterator.next();
  18771. if(!tileentity.func_145837_r() && tileentity.func_145830_o()) {
  18772. BlockPos blockpos = tileentity.func_174877_v();
  18773. if(this.func_175667_e(blockpos) && this.field_175728_M.func_177746_a(blockpos)) {
  18774. try {
  18775. this.field_72984_F.func_76320_a(tileentity.getClass().getSimpleName());
  18776. ((ITickable)tileentity).func_73660_a();
  18777. this.field_72984_F.func_76319_b();
  18778. } catch (Throwable throwable) {
  18779. CrashReport crashreport2 = CrashReport.func_85055_a(throwable, "Ticking block entity");
  18780. CrashReportCategory crashreportcategory2 = crashreport2.func_85058_a("Block entity being ticked");
  18781. tileentity.func_145828_a(crashreportcategory2);
  18782. throw new ReportedException(crashreport2);
  18783. }
  18784. }
  18785. }
  18786.  
  18787. if(tileentity.func_145837_r()) {
  18788. iterator.remove();
  18789. this.field_147482_g.remove(tileentity);
  18790. if(this.func_175667_e(tileentity.func_174877_v())) {
  18791. this.func_175726_f(tileentity.func_174877_v()).func_177425_e(tileentity.func_174877_v());
  18792. }
  18793. }
  18794. }
  18795.  
  18796. this.field_147481_N = false;
  18797. if(!this.field_147483_b.isEmpty()) {
  18798. this.field_175730_i.removeAll(this.field_147483_b);
  18799. this.field_147482_g.removeAll(this.field_147483_b);
  18800. this.field_147483_b.clear();
  18801. }
  18802.  
  18803. this.field_72984_F.func_76318_c("pendingBlockEntities");
  18804. if(!this.field_147484_a.isEmpty()) {
  18805. for(int j1 = 0; j1 < this.field_147484_a.size(); ++j1) {
  18806. TileEntity tileentity1 = (TileEntity)this.field_147484_a.get(j1);
  18807. if(!tileentity1.func_145837_r()) {
  18808. if(!this.field_147482_g.contains(tileentity1)) {
  18809. this.func_175700_a(tileentity1);
  18810. }
  18811.  
  18812. if(this.func_175667_e(tileentity1.func_174877_v())) {
  18813. Chunk chunk = this.func_175726_f(tileentity1.func_174877_v());
  18814. IBlockState iblockstate = chunk.func_177435_g(tileentity1.func_174877_v());
  18815. chunk.func_177426_a(tileentity1.func_174877_v(), tileentity1);
  18816. this.func_184138_a(tileentity1.func_174877_v(), iblockstate, iblockstate, 3);
  18817. }
  18818. }
  18819. }
  18820.  
  18821. this.field_147484_a.clear();
  18822. }
  18823.  
  18824. this.field_72984_F.func_76319_b();
  18825. this.field_72984_F.func_76319_b();
  18826. }
  18827.  
  18828. protected void func_184147_l() {
  18829. }
  18830.  
  18831. public boolean func_175700_a(TileEntity p_175700_1_) {
  18832. boolean flag = this.field_147482_g.add(p_175700_1_);
  18833. if(flag && p_175700_1_ instanceof ITickable) {
  18834. this.field_175730_i.add(p_175700_1_);
  18835. }
  18836.  
  18837. if(this.field_72995_K) {
  18838. BlockPos blockpos = p_175700_1_.func_174877_v();
  18839. IBlockState iblockstate = this.func_180495_p(blockpos);
  18840. this.func_184138_a(blockpos, iblockstate, iblockstate, 2);
  18841. }
  18842.  
  18843. return flag;
  18844. }
  18845.  
  18846. public void func_147448_a(Collection<TileEntity> p_147448_1_) {
  18847. if(this.field_147481_N) {
  18848. this.field_147484_a.addAll(p_147448_1_);
  18849. } else {
  18850. for(TileEntity tileentity : p_147448_1_) {
  18851. this.func_175700_a(tileentity);
  18852. }
  18853. }
  18854.  
  18855. }
  18856.  
  18857. public void func_72870_g(Entity p_72870_1_) {
  18858. this.func_72866_a(p_72870_1_, true);
  18859. }
  18860.  
  18861. public void func_72866_a(Entity p_72866_1_, boolean p_72866_2_) {
  18862. if(!(p_72866_1_ instanceof EntityPlayer)) {
  18863. int i = MathHelper.func_76128_c(p_72866_1_.field_70165_t);
  18864. int j = MathHelper.func_76128_c(p_72866_1_.field_70161_v);
  18865. int k = 32;
  18866. if(p_72866_2_ && !this.func_175663_a(i - 32, 0, j - 32, i + 32, 0, j + 32, true)) {
  18867. return;
  18868. }
  18869. }
  18870.  
  18871. p_72866_1_.field_70142_S = p_72866_1_.field_70165_t;
  18872. p_72866_1_.field_70137_T = p_72866_1_.field_70163_u;
  18873. p_72866_1_.field_70136_U = p_72866_1_.field_70161_v;
  18874. p_72866_1_.field_70126_B = p_72866_1_.field_70177_z;
  18875. p_72866_1_.field_70127_C = p_72866_1_.field_70125_A;
  18876. if(p_72866_2_ && p_72866_1_.field_70175_ag) {
  18877. ++p_72866_1_.field_70173_aa;
  18878. if(p_72866_1_.func_184218_aH()) {
  18879. p_72866_1_.func_70098_U();
  18880. } else {
  18881. p_72866_1_.func_70071_h_();
  18882. }
  18883. }
  18884.  
  18885. this.field_72984_F.func_76320_a("chunkCheck");
  18886. if(Double.isNaN(p_72866_1_.field_70165_t) || Double.isInfinite(p_72866_1_.field_70165_t)) {
  18887. p_72866_1_.field_70165_t = p_72866_1_.field_70142_S;
  18888. }
  18889.  
  18890. if(Double.isNaN(p_72866_1_.field_70163_u) || Double.isInfinite(p_72866_1_.field_70163_u)) {
  18891. p_72866_1_.field_70163_u = p_72866_1_.field_70137_T;
  18892. }
  18893.  
  18894. if(Double.isNaN(p_72866_1_.field_70161_v) || Double.isInfinite(p_72866_1_.field_70161_v)) {
  18895. p_72866_1_.field_70161_v = p_72866_1_.field_70136_U;
  18896. }
  18897.  
  18898. if(Double.isNaN((double)p_72866_1_.field_70125_A) || Double.isInfinite((double)p_72866_1_.field_70125_A)) {
  18899. p_72866_1_.field_70125_A = p_72866_1_.field_70127_C;
  18900. }
  18901.  
  18902. if(Double.isNaN((double)p_72866_1_.field_70177_z) || Double.isInfinite((double)p_72866_1_.field_70177_z)) {
  18903. p_72866_1_.field_70177_z = p_72866_1_.field_70126_B;
  18904. }
  18905.  
  18906. int l = MathHelper.func_76128_c(p_72866_1_.field_70165_t / 16.0D);
  18907. int i1 = MathHelper.func_76128_c(p_72866_1_.field_70163_u / 16.0D);
  18908. int j1 = MathHelper.func_76128_c(p_72866_1_.field_70161_v / 16.0D);
  18909. if(!p_72866_1_.field_70175_ag || p_72866_1_.field_70176_ah != l || p_72866_1_.field_70162_ai != i1 || p_72866_1_.field_70164_aj != j1) {
  18910. if(p_72866_1_.field_70175_ag && this.func_175680_a(p_72866_1_.field_70176_ah, p_72866_1_.field_70164_aj, true)) {
  18911. this.func_72964_e(p_72866_1_.field_70176_ah, p_72866_1_.field_70164_aj).func_76608_a(p_72866_1_, p_72866_1_.field_70162_ai);
  18912. }
  18913.  
  18914. if(!p_72866_1_.func_184189_br() && !this.func_175680_a(l, j1, true)) {
  18915. p_72866_1_.field_70175_ag = false;
  18916. } else {
  18917. this.func_72964_e(l, j1).func_76612_a(p_72866_1_);
  18918. }
  18919. }
  18920.  
  18921. this.field_72984_F.func_76319_b();
  18922. if(p_72866_2_ && p_72866_1_.field_70175_ag) {
  18923. for(Entity entity : p_72866_1_.func_184188_bt()) {
  18924. if(!entity.field_70128_L && entity.func_184187_bx() == p_72866_1_) {
  18925. this.func_72870_g(entity);
  18926. } else {
  18927. entity.func_184210_p();
  18928. }
  18929. }
  18930. }
  18931.  
  18932. }
  18933.  
  18934. public boolean func_72855_b(AxisAlignedBB p_72855_1_) {
  18935. return this.func_72917_a(p_72855_1_, (Entity)null);
  18936. }
  18937.  
  18938. public boolean func_72917_a(AxisAlignedBB p_72917_1_, @Nullable Entity p_72917_2_) {
  18939. List<Entity> list = this.func_72839_b((Entity)null, p_72917_1_);
  18940.  
  18941. for(int i = 0; i < list.size(); ++i) {
  18942. Entity entity = (Entity)list.get(i);
  18943. if(!entity.field_70128_L && entity.field_70156_m && entity != p_72917_2_ && (p_72917_2_ == null || entity.func_184223_x(p_72917_2_))) {
  18944. return false;
  18945. }
  18946. }
  18947.  
  18948. return true;
  18949. }
  18950.  
  18951. public boolean func_72829_c(AxisAlignedBB p_72829_1_) {
  18952. int i = MathHelper.func_76128_c(p_72829_1_.field_72340_a);
  18953. int j = MathHelper.func_76143_f(p_72829_1_.field_72336_d);
  18954. int k = MathHelper.func_76128_c(p_72829_1_.field_72338_b);
  18955. int l = MathHelper.func_76143_f(p_72829_1_.field_72337_e);
  18956. int i1 = MathHelper.func_76128_c(p_72829_1_.field_72339_c);
  18957. int j1 = MathHelper.func_76143_f(p_72829_1_.field_72334_f);
  18958. BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
  18959.  
  18960. for(int k1 = i; k1 < j; ++k1) {
  18961. for(int l1 = k; l1 < l; ++l1) {
  18962. for(int i2 = i1; i2 < j1; ++i2) {
  18963. IBlockState iblockstate = this.func_180495_p(blockpos$pooledmutableblockpos.func_181079_c(k1, l1, i2));
  18964. if(iblockstate.func_185904_a() != Material.field_151579_a) {
  18965. blockpos$pooledmutableblockpos.func_185344_t();
  18966. return true;
  18967. }
  18968. }
  18969. }
  18970. }
  18971.  
  18972. blockpos$pooledmutableblockpos.func_185344_t();
  18973. return false;
  18974. }
  18975.  
  18976. public boolean func_72953_d(AxisAlignedBB p_72953_1_) {
  18977. int i = MathHelper.func_76128_c(p_72953_1_.field_72340_a);
  18978. int j = MathHelper.func_76143_f(p_72953_1_.field_72336_d);
  18979. int k = MathHelper.func_76128_c(p_72953_1_.field_72338_b);
  18980. int l = MathHelper.func_76143_f(p_72953_1_.field_72337_e);
  18981. int i1 = MathHelper.func_76128_c(p_72953_1_.field_72339_c);
  18982. int j1 = MathHelper.func_76143_f(p_72953_1_.field_72334_f);
  18983. BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
  18984.  
  18985. for(int k1 = i; k1 < j; ++k1) {
  18986. for(int l1 = k; l1 < l; ++l1) {
  18987. for(int i2 = i1; i2 < j1; ++i2) {
  18988. IBlockState iblockstate = this.func_180495_p(blockpos$pooledmutableblockpos.func_181079_c(k1, l1, i2));
  18989. if(iblockstate.func_185904_a().func_76224_d()) {
  18990. blockpos$pooledmutableblockpos.func_185344_t();
  18991. return true;
  18992. }
  18993. }
  18994. }
  18995. }
  18996.  
  18997. blockpos$pooledmutableblockpos.func_185344_t();
  18998. return false;
  18999. }
  19000.  
  19001. public boolean func_147470_e(AxisAlignedBB p_147470_1_) {
  19002. int i = MathHelper.func_76128_c(p_147470_1_.field_72340_a);
  19003. int j = MathHelper.func_76143_f(p_147470_1_.field_72336_d);
  19004. int k = MathHelper.func_76128_c(p_147470_1_.field_72338_b);
  19005. int l = MathHelper.func_76143_f(p_147470_1_.field_72337_e);
  19006. int i1 = MathHelper.func_76128_c(p_147470_1_.field_72339_c);
  19007. int j1 = MathHelper.func_76143_f(p_147470_1_.field_72334_f);
  19008. if(this.func_175663_a(i, k, i1, j, l, j1, true)) {
  19009. BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
  19010.  
  19011. for(int k1 = i; k1 < j; ++k1) {
  19012. for(int l1 = k; l1 < l; ++l1) {
  19013. for(int i2 = i1; i2 < j1; ++i2) {
  19014. Block block = this.func_180495_p(blockpos$pooledmutableblockpos.func_181079_c(k1, l1, i2)).func_177230_c();
  19015. if(block == Blocks.field_150480_ab || block == Blocks.field_150356_k || block == Blocks.field_150353_l) {
  19016. blockpos$pooledmutableblockpos.func_185344_t();
  19017. return true;
  19018. }
  19019. }
  19020. }
  19021. }
  19022.  
  19023. blockpos$pooledmutableblockpos.func_185344_t();
  19024. }
  19025.  
  19026. return false;
  19027. }
  19028.  
  19029. public boolean func_72918_a(AxisAlignedBB p_72918_1_, Material p_72918_2_, Entity p_72918_3_) {
  19030. int i = MathHelper.func_76128_c(p_72918_1_.field_72340_a);
  19031. int j = MathHelper.func_76143_f(p_72918_1_.field_72336_d);
  19032. int k = MathHelper.func_76128_c(p_72918_1_.field_72338_b);
  19033. int l = MathHelper.func_76143_f(p_72918_1_.field_72337_e);
  19034. int i1 = MathHelper.func_76128_c(p_72918_1_.field_72339_c);
  19035. int j1 = MathHelper.func_76143_f(p_72918_1_.field_72334_f);
  19036. if(!this.func_175663_a(i, k, i1, j, l, j1, true)) {
  19037. return false;
  19038. } else {
  19039. boolean flag = false;
  19040. Vec3d vec3d = Vec3d.field_186680_a;
  19041. BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
  19042.  
  19043. for(int k1 = i; k1 < j; ++k1) {
  19044. for(int l1 = k; l1 < l; ++l1) {
  19045. for(int i2 = i1; i2 < j1; ++i2) {
  19046. blockpos$pooledmutableblockpos.func_181079_c(k1, l1, i2);
  19047. IBlockState iblockstate = this.func_180495_p(blockpos$pooledmutableblockpos);
  19048. Block block = iblockstate.func_177230_c();
  19049. if(iblockstate.func_185904_a() == p_72918_2_) {
  19050. double d0 = (double)((float)(l1 + 1) - BlockLiquid.func_149801_b(((Integer)iblockstate.func_177229_b(BlockLiquid.field_176367_b)).intValue()));
  19051. if((double)l >= d0) {
  19052. flag = true;
  19053. vec3d = block.func_176197_a(this, blockpos$pooledmutableblockpos, p_72918_3_, vec3d);
  19054. }
  19055. }
  19056. }
  19057. }
  19058. }
  19059.  
  19060. blockpos$pooledmutableblockpos.func_185344_t();
  19061. if(vec3d.func_72433_c() > 0.0D && p_72918_3_.func_96092_aw()) {
  19062. vec3d = vec3d.func_72432_b();
  19063. double d1 = 0.014D;
  19064. p_72918_3_.field_70159_w += vec3d.field_72450_a * 0.014D;
  19065. p_72918_3_.field_70181_x += vec3d.field_72448_b * 0.014D;
  19066. p_72918_3_.field_70179_y += vec3d.field_72449_c * 0.014D;
  19067. }
  19068.  
  19069. return flag;
  19070. }
  19071. }
  19072.  
  19073. public boolean func_72875_a(AxisAlignedBB p_72875_1_, Material p_72875_2_) {
  19074. int i = MathHelper.func_76128_c(p_72875_1_.field_72340_a);
  19075. int j = MathHelper.func_76143_f(p_72875_1_.field_72336_d);
  19076. int k = MathHelper.func_76128_c(p_72875_1_.field_72338_b);
  19077. int l = MathHelper.func_76143_f(p_72875_1_.field_72337_e);
  19078. int i1 = MathHelper.func_76128_c(p_72875_1_.field_72339_c);
  19079. int j1 = MathHelper.func_76143_f(p_72875_1_.field_72334_f);
  19080. BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
  19081.  
  19082. for(int k1 = i; k1 < j; ++k1) {
  19083. for(int l1 = k; l1 < l; ++l1) {
  19084. for(int i2 = i1; i2 < j1; ++i2) {
  19085. if(this.func_180495_p(blockpos$pooledmutableblockpos.func_181079_c(k1, l1, i2)).func_185904_a() == p_72875_2_) {
  19086. blockpos$pooledmutableblockpos.func_185344_t();
  19087. return true;
  19088. }
  19089. }
  19090. }
  19091. }
  19092.  
  19093. blockpos$pooledmutableblockpos.func_185344_t();
  19094. return false;
  19095. }
  19096.  
  19097. public Explosion func_72876_a(@Nullable Entity p_72876_1_, double p_72876_2_, double p_72876_4_, double p_72876_6_, float p_72876_8_, boolean p_72876_9_) {
  19098. return this.func_72885_a(p_72876_1_, p_72876_2_, p_72876_4_, p_72876_6_, p_72876_8_, false, p_72876_9_);
  19099. }
  19100.  
  19101. public Explosion func_72885_a(@Nullable Entity p_72885_1_, double p_72885_2_, double p_72885_4_, double p_72885_6_, float p_72885_8_, boolean p_72885_9_, boolean p_72885_10_) {
  19102. Explosion explosion = new Explosion(this, p_72885_1_, p_72885_2_, p_72885_4_, p_72885_6_, p_72885_8_, p_72885_9_, p_72885_10_);
  19103. explosion.func_77278_a();
  19104. explosion.func_77279_a(true);
  19105. return explosion;
  19106. }
  19107.  
  19108. public float func_72842_a(Vec3d p_72842_1_, AxisAlignedBB p_72842_2_) {
  19109. double d0 = 1.0D / ((p_72842_2_.field_72336_d - p_72842_2_.field_72340_a) * 2.0D + 1.0D);
  19110. double d1 = 1.0D / ((p_72842_2_.field_72337_e - p_72842_2_.field_72338_b) * 2.0D + 1.0D);
  19111. double d2 = 1.0D / ((p_72842_2_.field_72334_f - p_72842_2_.field_72339_c) * 2.0D + 1.0D);
  19112. double d3 = (1.0D - Math.floor(1.0D / d0) * d0) / 2.0D;
  19113. double d4 = (1.0D - Math.floor(1.0D / d2) * d2) / 2.0D;
  19114. if(d0 >= 0.0D && d1 >= 0.0D && d2 >= 0.0D) {
  19115. int i = 0;
  19116. int j = 0;
  19117.  
  19118. for(float f = 0.0F; f <= 1.0F; f = (float)((double)f + d0)) {
  19119. for(float f1 = 0.0F; f1 <= 1.0F; f1 = (float)((double)f1 + d1)) {
  19120. for(float f2 = 0.0F; f2 <= 1.0F; f2 = (float)((double)f2 + d2)) {
  19121. double d5 = p_72842_2_.field_72340_a + (p_72842_2_.field_72336_d - p_72842_2_.field_72340_a) * (double)f;
  19122. double d6 = p_72842_2_.field_72338_b + (p_72842_2_.field_72337_e - p_72842_2_.field_72338_b) * (double)f1;
  19123. double d7 = p_72842_2_.field_72339_c + (p_72842_2_.field_72334_f - p_72842_2_.field_72339_c) * (double)f2;
  19124. if(this.func_72933_a(new Vec3d(d5 + d3, d6, d7 + d4), p_72842_1_) == null) {
  19125. ++i;
  19126. }
  19127.  
  19128. ++j;
  19129. }
  19130. }
  19131. }
  19132.  
  19133. return (float)i / (float)j;
  19134. } else {
  19135. return 0.0F;
  19136. }
  19137. }
  19138.  
  19139. public boolean func_175719_a(@Nullable EntityPlayer p_175719_1_, BlockPos p_175719_2_, EnumFacing p_175719_3_) {
  19140. p_175719_2_ = p_175719_2_.func_177972_a(p_175719_3_);
  19141. if(this.func_180495_p(p_175719_2_).func_177230_c() == Blocks.field_150480_ab) {
  19142. this.func_180498_a(p_175719_1_, 1009, p_175719_2_, 0);
  19143. this.func_175698_g(p_175719_2_);
  19144. return true;
  19145. } else {
  19146. return false;
  19147. }
  19148. }
  19149.  
  19150. @SideOnly(Side.CLIENT)
  19151. public String func_72981_t() {
  19152. return "All: " + this.field_72996_f.size();
  19153. }
  19154.  
  19155. @SideOnly(Side.CLIENT)
  19156. public String func_72827_u() {
  19157. return this.field_73020_y.func_73148_d();
  19158. }
  19159.  
  19160. @Nullable
  19161. public TileEntity func_175625_s(BlockPos p_175625_1_) {
  19162. if(this.func_189509_E(p_175625_1_)) {
  19163. return null;
  19164. } else {
  19165. TileEntity tileentity = null;
  19166. if(this.field_147481_N) {
  19167. tileentity = this.func_189508_F(p_175625_1_);
  19168. }
  19169.  
  19170. if(tileentity == null) {
  19171. tileentity = this.func_175726_f(p_175625_1_).func_177424_a(p_175625_1_, Chunk.EnumCreateEntityType.IMMEDIATE);
  19172. }
  19173.  
  19174. if(tileentity == null) {
  19175. tileentity = this.func_189508_F(p_175625_1_);
  19176. }
  19177.  
  19178. return tileentity;
  19179. }
  19180. }
  19181.  
  19182. @Nullable
  19183. private TileEntity func_189508_F(BlockPos p_189508_1_) {
  19184. for(int i = 0; i < this.field_147484_a.size(); ++i) {
  19185. TileEntity tileentity = (TileEntity)this.field_147484_a.get(i);
  19186. if(!tileentity.func_145837_r() && tileentity.func_174877_v().equals(p_189508_1_)) {
  19187. return tileentity;
  19188. }
  19189. }
  19190.  
  19191. return null;
  19192. }
  19193.  
  19194. public void func_175690_a(BlockPos p_175690_1_, @Nullable TileEntity p_175690_2_) {
  19195. if(!this.func_189509_E(p_175690_1_)) {
  19196. if(p_175690_2_ != null && !p_175690_2_.func_145837_r()) {
  19197. if(this.field_147481_N) {
  19198. p_175690_2_.func_174878_a(p_175690_1_);
  19199. Iterator<TileEntity> iterator = this.field_147484_a.iterator();
  19200.  
  19201. while(iterator.hasNext()) {
  19202. TileEntity tileentity = (TileEntity)iterator.next();
  19203. if(tileentity.func_174877_v().equals(p_175690_1_)) {
  19204. tileentity.func_145843_s();
  19205. iterator.remove();
  19206. }
  19207. }
  19208.  
  19209. this.field_147484_a.add(p_175690_2_);
  19210. } else {
  19211. this.func_175726_f(p_175690_1_).func_177426_a(p_175690_1_, p_175690_2_);
  19212. this.func_175700_a(p_175690_2_);
  19213. }
  19214. }
  19215.  
  19216. }
  19217. }
  19218.  
  19219. public void func_175713_t(BlockPos p_175713_1_) {
  19220. TileEntity tileentity = this.func_175625_s(p_175713_1_);
  19221. if(tileentity != null && this.field_147481_N) {
  19222. tileentity.func_145843_s();
  19223. this.field_147484_a.remove(tileentity);
  19224. } else {
  19225. if(tileentity != null) {
  19226. this.field_147484_a.remove(tileentity);
  19227. this.field_147482_g.remove(tileentity);
  19228. this.field_175730_i.remove(tileentity);
  19229. }
  19230.  
  19231. this.func_175726_f(p_175713_1_).func_177425_e(p_175713_1_);
  19232. }
  19233.  
  19234. }
  19235.  
  19236. public void func_147457_a(TileEntity p_147457_1_) {
  19237. this.field_147483_b.add(p_147457_1_);
  19238. }
  19239.  
  19240. public boolean func_175665_u(BlockPos p_175665_1_) {
  19241. AxisAlignedBB axisalignedbb = this.func_180495_p(p_175665_1_).func_185890_d(this, p_175665_1_);
  19242. return axisalignedbb != Block.field_185506_k && axisalignedbb.func_72320_b() >= 1.0D;
  19243. }
  19244.  
  19245. public boolean func_175677_d(BlockPos p_175677_1_, boolean p_175677_2_) {
  19246. if(this.func_189509_E(p_175677_1_)) {
  19247. return false;
  19248. } else {
  19249. Chunk chunk = this.field_73020_y.func_186026_b(p_175677_1_.func_177958_n() >> 4, p_175677_1_.func_177952_p() >> 4);
  19250. if(chunk != null && !chunk.func_76621_g()) {
  19251. IBlockState iblockstate = this.func_180495_p(p_175677_1_);
  19252. return iblockstate.func_185904_a().func_76218_k() && iblockstate.func_185917_h();
  19253. } else {
  19254. return p_175677_2_;
  19255. }
  19256. }
  19257. }
  19258.  
  19259. public void func_72966_v() {
  19260. int i = this.func_72967_a(1.0F);
  19261. if(i != this.field_73008_k) {
  19262. this.field_73008_k = i;
  19263. }
  19264.  
  19265. }
  19266.  
  19267. public void func_72891_a(boolean p_72891_1_, boolean p_72891_2_) {
  19268. this.field_72985_G = p_72891_1_;
  19269. this.field_72992_H = p_72891_2_;
  19270. }
  19271.  
  19272. public void func_72835_b() {
  19273. this.func_72979_l();
  19274. }
  19275.  
  19276. protected void func_72947_a() {
  19277. if(this.field_72986_A.func_76059_o()) {
  19278. this.field_73004_o = 1.0F;
  19279. if(this.field_72986_A.func_76061_m()) {
  19280. this.field_73017_q = 1.0F;
  19281. }
  19282. }
  19283.  
  19284. }
  19285.  
  19286. protected void func_72979_l() {
  19287. if(this.field_73011_w.func_191066_m()) {
  19288. if(!this.field_72995_K) {
  19289. boolean flag = this.func_82736_K().func_82766_b("doWeatherCycle");
  19290. if(flag) {
  19291. int i = this.field_72986_A.func_176133_A();
  19292. if(i > 0) {
  19293. --i;
  19294. this.field_72986_A.func_176142_i(i);
  19295. this.field_72986_A.func_76090_f(this.field_72986_A.func_76061_m()?1:2);
  19296. this.field_72986_A.func_76080_g(this.field_72986_A.func_76059_o()?1:2);
  19297. }
  19298.  
  19299. int j = this.field_72986_A.func_76071_n();
  19300. if(j <= 0) {
  19301. if(this.field_72986_A.func_76061_m()) {
  19302. this.field_72986_A.func_76090_f(this.field_73012_v.nextInt(12000) + 3600);
  19303. } else {
  19304. this.field_72986_A.func_76090_f(this.field_73012_v.nextInt(168000) + 12000);
  19305. }
  19306. } else {
  19307. --j;
  19308. this.field_72986_A.func_76090_f(j);
  19309. if(j <= 0) {
  19310. this.field_72986_A.func_76069_a(!this.field_72986_A.func_76061_m());
  19311. }
  19312. }
  19313.  
  19314. int k = this.field_72986_A.func_76083_p();
  19315. if(k <= 0) {
  19316. if(this.field_72986_A.func_76059_o()) {
  19317. this.field_72986_A.func_76080_g(this.field_73012_v.nextInt(12000) + 12000);
  19318. } else {
  19319. this.field_72986_A.func_76080_g(this.field_73012_v.nextInt(168000) + 12000);
  19320. }
  19321. } else {
  19322. --k;
  19323. this.field_72986_A.func_76080_g(k);
  19324. if(k <= 0) {
  19325. this.field_72986_A.func_76084_b(!this.field_72986_A.func_76059_o());
  19326. }
  19327. }
  19328. }
  19329.  
  19330. this.field_73018_p = this.field_73017_q;
  19331. if(this.field_72986_A.func_76061_m()) {
  19332. this.field_73017_q = (float)((double)this.field_73017_q + 0.01D);
  19333. } else {
  19334. this.field_73017_q = (float)((double)this.field_73017_q - 0.01D);
  19335. }
  19336.  
  19337. this.field_73017_q = MathHelper.func_76131_a(this.field_73017_q, 0.0F, 1.0F);
  19338. this.field_73003_n = this.field_73004_o;
  19339. if(this.field_72986_A.func_76059_o()) {
  19340. this.field_73004_o = (float)((double)this.field_73004_o + 0.01D);
  19341. } else {
  19342. this.field_73004_o = (float)((double)this.field_73004_o - 0.01D);
  19343. }
  19344.  
  19345. this.field_73004_o = MathHelper.func_76131_a(this.field_73004_o, 0.0F, 1.0F);
  19346. }
  19347. }
  19348. }
  19349.  
  19350. @SideOnly(Side.CLIENT)
  19351. protected void func_147467_a(int p_147467_1_, int p_147467_2_, Chunk p_147467_3_) {
  19352. p_147467_3_.func_76594_o();
  19353. }
  19354.  
  19355. protected void func_147456_g() {
  19356. }
  19357.  
  19358. public void func_189507_a(BlockPos p_189507_1_, IBlockState p_189507_2_, Random p_189507_3_) {
  19359. this.field_72999_e = true;
  19360. p_189507_2_.func_177230_c().func_180650_b(this, p_189507_1_, p_189507_2_, p_189507_3_);
  19361. this.field_72999_e = false;
  19362. }
  19363.  
  19364. public boolean func_175675_v(BlockPos p_175675_1_) {
  19365. return this.func_175670_e(p_175675_1_, false);
  19366. }
  19367.  
  19368. public boolean func_175662_w(BlockPos p_175662_1_) {
  19369. return this.func_175670_e(p_175662_1_, true);
  19370. }
  19371.  
  19372. public boolean func_175670_e(BlockPos p_175670_1_, boolean p_175670_2_) {
  19373. Biome biome = this.func_180494_b(p_175670_1_);
  19374. float f = biome.func_180626_a(p_175670_1_);
  19375. if(f >= 0.15F) {
  19376. return false;
  19377. } else {
  19378. if(p_175670_1_.func_177956_o() >= 0 && p_175670_1_.func_177956_o() < 256 && this.func_175642_b(EnumSkyBlock.BLOCK, p_175670_1_) < 10) {
  19379. IBlockState iblockstate = this.func_180495_p(p_175670_1_);
  19380. Block block = iblockstate.func_177230_c();
  19381. if((block == Blocks.field_150355_j || block == Blocks.field_150358_i) && ((Integer)iblockstate.func_177229_b(BlockLiquid.field_176367_b)).intValue() == 0) {
  19382. if(!p_175670_2_) {
  19383. return true;
  19384. }
  19385.  
  19386. boolean flag = this.func_175696_F(p_175670_1_.func_177976_e()) && this.func_175696_F(p_175670_1_.func_177974_f()) && this.func_175696_F(p_175670_1_.func_177978_c()) && this.func_175696_F(p_175670_1_.func_177968_d());
  19387. if(!flag) {
  19388. return true;
  19389. }
  19390. }
  19391. }
  19392.  
  19393. return false;
  19394. }
  19395. }
  19396.  
  19397. private boolean func_175696_F(BlockPos p_175696_1_) {
  19398. return this.func_180495_p(p_175696_1_).func_185904_a() == Material.field_151586_h;
  19399. }
  19400.  
  19401. public boolean func_175708_f(BlockPos p_175708_1_, boolean p_175708_2_) {
  19402. Biome biome = this.func_180494_b(p_175708_1_);
  19403. float f = biome.func_180626_a(p_175708_1_);
  19404. if(f >= 0.15F) {
  19405. return false;
  19406. } else if(!p_175708_2_) {
  19407. return true;
  19408. } else {
  19409. if(p_175708_1_.func_177956_o() >= 0 && p_175708_1_.func_177956_o() < 256 && this.func_175642_b(EnumSkyBlock.BLOCK, p_175708_1_) < 10) {
  19410. IBlockState iblockstate = this.func_180495_p(p_175708_1_);
  19411. if(iblockstate.func_185904_a() == Material.field_151579_a && Blocks.field_150431_aC.func_176196_c(this, p_175708_1_)) {
  19412. return true;
  19413. }
  19414. }
  19415.  
  19416. return false;
  19417. }
  19418. }
  19419.  
  19420. public boolean func_175664_x(BlockPos p_175664_1_) {
  19421. boolean flag = false;
  19422. if(this.field_73011_w.func_191066_m()) {
  19423. flag |= this.func_180500_c(EnumSkyBlock.SKY, p_175664_1_);
  19424. }
  19425.  
  19426. flag = flag | this.func_180500_c(EnumSkyBlock.BLOCK, p_175664_1_);
  19427. return flag;
  19428. }
  19429.  
  19430. private int func_175638_a(BlockPos p_175638_1_, EnumSkyBlock p_175638_2_) {
  19431. if(p_175638_2_ == EnumSkyBlock.SKY && this.func_175678_i(p_175638_1_)) {
  19432. return 15;
  19433. } else {
  19434. IBlockState iblockstate = this.func_180495_p(p_175638_1_);
  19435. int i = p_175638_2_ == EnumSkyBlock.SKY?0:iblockstate.func_185906_d();
  19436. int j = iblockstate.func_185891_c();
  19437. if(j >= 15 && iblockstate.func_185906_d() > 0) {
  19438. j = 1;
  19439. }
  19440.  
  19441. if(j < 1) {
  19442. j = 1;
  19443. }
  19444.  
  19445. if(j >= 15) {
  19446. return 0;
  19447. } else if(i >= 14) {
  19448. return i;
  19449. } else {
  19450. BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
  19451.  
  19452. try {
  19453. for(EnumFacing enumfacing : EnumFacing.values()) {
  19454. blockpos$pooledmutableblockpos.func_189533_g(p_175638_1_).func_189536_c(enumfacing);
  19455. int k = this.func_175642_b(p_175638_2_, blockpos$pooledmutableblockpos) - j;
  19456. if(k > i) {
  19457. i = k;
  19458. }
  19459.  
  19460. if(i >= 14) {
  19461. int l = i;
  19462. return l;
  19463. }
  19464. }
  19465.  
  19466. return i;
  19467. } finally {
  19468. blockpos$pooledmutableblockpos.func_185344_t();
  19469. }
  19470. }
  19471. }
  19472. }
  19473.  
  19474. public boolean func_180500_c(EnumSkyBlock p_180500_1_, BlockPos p_180500_2_) {
  19475. if(!this.func_175648_a(p_180500_2_, 17, false)) {
  19476. return false;
  19477. } else {
  19478. int i = 0;
  19479. int j = 0;
  19480. this.field_72984_F.func_76320_a("getBrightness");
  19481. int k = this.func_175642_b(p_180500_1_, p_180500_2_);
  19482. int l = this.func_175638_a(p_180500_2_, p_180500_1_);
  19483. int i1 = p_180500_2_.func_177958_n();
  19484. int j1 = p_180500_2_.func_177956_o();
  19485. int k1 = p_180500_2_.func_177952_p();
  19486. if(l > k) {
  19487. this.field_72994_J[j++] = 133152;
  19488. } else if(l < k) {
  19489. this.field_72994_J[j++] = 133152 | k << 18;
  19490.  
  19491. while(i < j) {
  19492. int l1 = this.field_72994_J[i++];
  19493. int i2 = (l1 & 63) - 32 + i1;
  19494. int j2 = (l1 >> 6 & 63) - 32 + j1;
  19495. int k2 = (l1 >> 12 & 63) - 32 + k1;
  19496. int l2 = l1 >> 18 & 15;
  19497. BlockPos blockpos = new BlockPos(i2, j2, k2);
  19498. int i3 = this.func_175642_b(p_180500_1_, blockpos);
  19499. if(i3 == l2) {
  19500. this.func_175653_a(p_180500_1_, blockpos, 0);
  19501. if(l2 > 0) {
  19502. int j3 = MathHelper.func_76130_a(i2 - i1);
  19503. int k3 = MathHelper.func_76130_a(j2 - j1);
  19504. int l3 = MathHelper.func_76130_a(k2 - k1);
  19505. if(j3 + k3 + l3 < 17) {
  19506. BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
  19507.  
  19508. for(EnumFacing enumfacing : EnumFacing.values()) {
  19509. int i4 = i2 + enumfacing.func_82601_c();
  19510. int j4 = j2 + enumfacing.func_96559_d();
  19511. int k4 = k2 + enumfacing.func_82599_e();
  19512. blockpos$pooledmutableblockpos.func_181079_c(i4, j4, k4);
  19513. int l4 = Math.max(1, this.func_180495_p(blockpos$pooledmutableblockpos).func_185891_c());
  19514. i3 = this.func_175642_b(p_180500_1_, blockpos$pooledmutableblockpos);
  19515. if(i3 == l2 - l4 && j < this.field_72994_J.length) {
  19516. this.field_72994_J[j++] = i4 - i1 + 32 | j4 - j1 + 32 << 6 | k4 - k1 + 32 << 12 | l2 - l4 << 18;
  19517. }
  19518. }
  19519.  
  19520. blockpos$pooledmutableblockpos.func_185344_t();
  19521. }
  19522. }
  19523. }
  19524. }
  19525.  
  19526. i = 0;
  19527. }
  19528.  
  19529. this.field_72984_F.func_76319_b();
  19530. this.field_72984_F.func_76320_a("checkedPosition < toCheckCount");
  19531.  
  19532. while(i < j) {
  19533. int i5 = this.field_72994_J[i++];
  19534. int j5 = (i5 & 63) - 32 + i1;
  19535. int k5 = (i5 >> 6 & 63) - 32 + j1;
  19536. int l5 = (i5 >> 12 & 63) - 32 + k1;
  19537. BlockPos blockpos1 = new BlockPos(j5, k5, l5);
  19538. int i6 = this.func_175642_b(p_180500_1_, blockpos1);
  19539. int j6 = this.func_175638_a(blockpos1, p_180500_1_);
  19540. if(j6 != i6) {
  19541. this.func_175653_a(p_180500_1_, blockpos1, j6);
  19542. if(j6 > i6) {
  19543. int k6 = Math.abs(j5 - i1);
  19544. int l6 = Math.abs(k5 - j1);
  19545. int i7 = Math.abs(l5 - k1);
  19546. boolean flag = j < this.field_72994_J.length - 6;
  19547. if(k6 + l6 + i7 < 17 && flag) {
  19548. if(this.func_175642_b(p_180500_1_, blockpos1.func_177976_e()) < j6) {
  19549. this.field_72994_J[j++] = j5 - 1 - i1 + 32 + (k5 - j1 + 32 << 6) + (l5 - k1 + 32 << 12);
  19550. }
  19551.  
  19552. if(this.func_175642_b(p_180500_1_, blockpos1.func_177974_f()) < j6) {
  19553. this.field_72994_J[j++] = j5 + 1 - i1 + 32 + (k5 - j1 + 32 << 6) + (l5 - k1 + 32 << 12);
  19554. }
  19555.  
  19556. if(this.func_175642_b(p_180500_1_, blockpos1.func_177977_b()) < j6) {
  19557. this.field_72994_J[j++] = j5 - i1 + 32 + (k5 - 1 - j1 + 32 << 6) + (l5 - k1 + 32 << 12);
  19558. }
  19559.  
  19560. if(this.func_175642_b(p_180500_1_, blockpos1.func_177984_a()) < j6) {
  19561. this.field_72994_J[j++] = j5 - i1 + 32 + (k5 + 1 - j1 + 32 << 6) + (l5 - k1 + 32 << 12);
  19562. }
  19563.  
  19564. if(this.func_175642_b(p_180500_1_, blockpos1.func_177978_c()) < j6) {
  19565. this.field_72994_J[j++] = j5 - i1 + 32 + (k5 - j1 + 32 << 6) + (l5 - 1 - k1 + 32 << 12);
  19566. }
  19567.  
  19568. if(this.func_175642_b(p_180500_1_, blockpos1.func_177968_d()) < j6) {
  19569. this.field_72994_J[j++] = j5 - i1 + 32 + (k5 - j1 + 32 << 6) + (l5 + 1 - k1 + 32 << 12);
  19570. }
  19571. }
  19572. }
  19573. }
  19574. }
  19575.  
  19576. this.field_72984_F.func_76319_b();
  19577. return true;
  19578. }
  19579. }
  19580.  
  19581. public boolean func_72955_a(boolean p_72955_1_) {
  19582. return false;
  19583. }
  19584.  
  19585. @Nullable
  19586. public List<NextTickListEntry> func_72920_a(Chunk p_72920_1_, boolean p_72920_2_) {
  19587. return null;
  19588. }
  19589.  
  19590. @Nullable
  19591. public List<NextTickListEntry> func_175712_a(StructureBoundingBox p_175712_1_, boolean p_175712_2_) {
  19592. return null;
  19593. }
  19594.  
  19595. public List<Entity> func_72839_b(@Nullable Entity p_72839_1_, AxisAlignedBB p_72839_2_) {
  19596. return this.func_175674_a(p_72839_1_, p_72839_2_, EntitySelectors.field_180132_d);
  19597. }
  19598.  
  19599. public List<Entity> func_175674_a(@Nullable Entity p_175674_1_, AxisAlignedBB p_175674_2_, @Nullable Predicate<? super Entity> p_175674_3_) {
  19600. List<Entity> list = Lists.<Entity>newArrayList();
  19601. int i = MathHelper.func_76128_c((p_175674_2_.field_72340_a - 2.0D) / 16.0D);
  19602. int j = MathHelper.func_76128_c((p_175674_2_.field_72336_d + 2.0D) / 16.0D);
  19603. int k = MathHelper.func_76128_c((p_175674_2_.field_72339_c - 2.0D) / 16.0D);
  19604. int l = MathHelper.func_76128_c((p_175674_2_.field_72334_f + 2.0D) / 16.0D);
  19605.  
  19606. for(int i1 = i; i1 <= j; ++i1) {
  19607. for(int j1 = k; j1 <= l; ++j1) {
  19608. if(this.func_175680_a(i1, j1, true)) {
  19609. this.func_72964_e(i1, j1).func_177414_a(p_175674_1_, p_175674_2_, list, p_175674_3_);
  19610. }
  19611. }
  19612. }
  19613.  
  19614. return list;
  19615. }
  19616.  
  19617. public <T extends Entity> List<T> func_175644_a(Class<? extends T> p_175644_1_, Predicate<? super T> p_175644_2_) {
  19618. List<T> list = Lists.<T>newArrayList();
  19619.  
  19620. for(Entity entity : this.field_72996_f) {
  19621. if(p_175644_1_.isAssignableFrom(entity.getClass()) && p_175644_2_.apply(entity)) {
  19622. list.add(entity);
  19623. }
  19624. }
  19625.  
  19626. return list;
  19627. }
  19628.  
  19629. public <T extends Entity> List<T> func_175661_b(Class<? extends T> p_175661_1_, Predicate<? super T> p_175661_2_) {
  19630. List<T> list = Lists.<T>newArrayList();
  19631.  
  19632. for(Entity entity : this.field_73010_i) {
  19633. if(p_175661_1_.isAssignableFrom(entity.getClass()) && p_175661_2_.apply(entity)) {
  19634. list.add(entity);
  19635. }
  19636. }
  19637.  
  19638. return list;
  19639. }
  19640.  
  19641. public <T extends Entity> List<T> func_72872_a(Class<? extends T> p_72872_1_, AxisAlignedBB p_72872_2_) {
  19642. return this.<T>func_175647_a(p_72872_1_, p_72872_2_, EntitySelectors.field_180132_d);
  19643. }
  19644.  
  19645. public <T extends Entity> List<T> func_175647_a(Class<? extends T> p_175647_1_, AxisAlignedBB p_175647_2_, @Nullable Predicate<? super T> p_175647_3_) {
  19646. int i = MathHelper.func_76128_c((p_175647_2_.field_72340_a - 2.0D) / 16.0D);
  19647. int j = MathHelper.func_76143_f((p_175647_2_.field_72336_d + 2.0D) / 16.0D);
  19648. int k = MathHelper.func_76128_c((p_175647_2_.field_72339_c - 2.0D) / 16.0D);
  19649. int l = MathHelper.func_76143_f((p_175647_2_.field_72334_f + 2.0D) / 16.0D);
  19650. List<T> list = Lists.<T>newArrayList();
  19651.  
  19652. for(int i1 = i; i1 < j; ++i1) {
  19653. for(int j1 = k; j1 < l; ++j1) {
  19654. if(this.func_175680_a(i1, j1, true)) {
  19655. this.func_72964_e(i1, j1).func_177430_a(p_175647_1_, p_175647_2_, list, p_175647_3_);
  19656. }
  19657. }
  19658. }
  19659.  
  19660. return list;
  19661. }
  19662.  
  19663. @Nullable
  19664. public <T extends Entity> T func_72857_a(Class<? extends T> p_72857_1_, AxisAlignedBB p_72857_2_, T p_72857_3_) {
  19665. List<T> list = this.<T>func_72872_a(p_72857_1_, p_72857_2_);
  19666. T t = null;
  19667. double d0 = Double.MAX_VALUE;
  19668.  
  19669. for(int i = 0; i < list.size(); ++i) {
  19670. T t1 = (Entity)list.get(i);
  19671. if(t1 != p_72857_3_ && EntitySelectors.field_180132_d.apply(t1)) {
  19672. double d1 = p_72857_3_.func_70068_e(t1);
  19673. if(d1 <= d0) {
  19674. t = t1;
  19675. d0 = d1;
  19676. }
  19677. }
  19678. }
  19679.  
  19680. return t;
  19681. }
  19682.  
  19683. @Nullable
  19684. public Entity func_73045_a(int p_73045_1_) {
  19685. return (Entity)this.field_175729_l.func_76041_a(p_73045_1_);
  19686. }
  19687.  
  19688. @SideOnly(Side.CLIENT)
  19689. public List<Entity> func_72910_y() {
  19690. return this.field_72996_f;
  19691. }
  19692.  
  19693. public void func_175646_b(BlockPos p_175646_1_, TileEntity p_175646_2_) {
  19694. if(this.func_175667_e(p_175646_1_)) {
  19695. this.func_175726_f(p_175646_1_).func_76630_e();
  19696. }
  19697.  
  19698. }
  19699.  
  19700. public int func_72907_a(Class<?> p_72907_1_) {
  19701. int i = 0;
  19702.  
  19703. for(Entity entity : this.field_72996_f) {
  19704. if((!(entity instanceof EntityLiving) || !((EntityLiving)entity).func_104002_bU()) && p_72907_1_.isAssignableFrom(entity.getClass())) {
  19705. ++i;
  19706. }
  19707. }
  19708.  
  19709. return i;
  19710. }
  19711.  
  19712. public void func_175650_b(Collection<Entity> p_175650_1_) {
  19713. this.field_72996_f.addAll(p_175650_1_);
  19714.  
  19715. for(Entity entity : p_175650_1_) {
  19716. this.func_72923_a(entity);
  19717. }
  19718.  
  19719. }
  19720.  
  19721. public void func_175681_c(Collection<Entity> p_175681_1_) {
  19722. this.field_72997_g.addAll(p_175681_1_);
  19723. }
  19724.  
  19725. public boolean func_190527_a(Block p_190527_1_, BlockPos p_190527_2_, boolean p_190527_3_, EnumFacing p_190527_4_, @Nullable Entity p_190527_5_) {
  19726. IBlockState iblockstate = this.func_180495_p(p_190527_2_);
  19727. AxisAlignedBB axisalignedbb = p_190527_3_?null:p_190527_1_.func_176223_P().func_185890_d(this, p_190527_2_);
  19728. return axisalignedbb != Block.field_185506_k && !this.func_72917_a(axisalignedbb.func_186670_a(p_190527_2_), p_190527_5_)?false:(iblockstate.func_185904_a() == Material.field_151594_q && p_190527_1_ == Blocks.field_150467_bQ?true:iblockstate.func_185904_a().func_76222_j() && p_190527_1_.func_176198_a(this, p_190527_2_, p_190527_4_));
  19729. }
  19730.  
  19731. public int func_181545_F() {
  19732. return this.field_181546_a;
  19733. }
  19734.  
  19735. public void func_181544_b(int p_181544_1_) {
  19736. this.field_181546_a = p_181544_1_;
  19737. }
  19738.  
  19739. public int func_175627_a(BlockPos p_175627_1_, EnumFacing p_175627_2_) {
  19740. return this.func_180495_p(p_175627_1_).func_185893_b(this, p_175627_1_, p_175627_2_);
  19741. }
  19742.  
  19743. public WorldType func_175624_G() {
  19744. return this.field_72986_A.func_76067_t();
  19745. }
  19746.  
  19747. public int func_175676_y(BlockPos p_175676_1_) {
  19748. int i = 0;
  19749. i = Math.max(i, this.func_175627_a(p_175676_1_.func_177977_b(), EnumFacing.DOWN));
  19750. if(i >= 15) {
  19751. return i;
  19752. } else {
  19753. i = Math.max(i, this.func_175627_a(p_175676_1_.func_177984_a(), EnumFacing.UP));
  19754. if(i >= 15) {
  19755. return i;
  19756. } else {
  19757. i = Math.max(i, this.func_175627_a(p_175676_1_.func_177978_c(), EnumFacing.NORTH));
  19758. if(i >= 15) {
  19759. return i;
  19760. } else {
  19761. i = Math.max(i, this.func_175627_a(p_175676_1_.func_177968_d(), EnumFacing.SOUTH));
  19762. if(i >= 15) {
  19763. return i;
  19764. } else {
  19765. i = Math.max(i, this.func_175627_a(p_175676_1_.func_177976_e(), EnumFacing.WEST));
  19766. if(i >= 15) {
  19767. return i;
  19768. } else {
  19769. i = Math.max(i, this.func_175627_a(p_175676_1_.func_177974_f(), EnumFacing.EAST));
  19770. return i >= 15?i:i;
  19771. }
  19772. }
  19773. }
  19774. }
  19775. }
  19776. }
  19777.  
  19778. public boolean func_175709_b(BlockPos p_175709_1_, EnumFacing p_175709_2_) {
  19779. return this.func_175651_c(p_175709_1_, p_175709_2_) > 0;
  19780. }
  19781.  
  19782. public int func_175651_c(BlockPos p_175651_1_, EnumFacing p_175651_2_) {
  19783. IBlockState iblockstate = this.func_180495_p(p_175651_1_);
  19784. return iblockstate.func_185915_l()?this.func_175676_y(p_175651_1_):iblockstate.func_185911_a(this, p_175651_1_, p_175651_2_);
  19785. }
  19786.  
  19787. public boolean func_175640_z(BlockPos p_175640_1_) {
  19788. return this.func_175651_c(p_175640_1_.func_177977_b(), EnumFacing.DOWN) > 0?true:(this.func_175651_c(p_175640_1_.func_177984_a(), EnumFacing.UP) > 0?true:(this.func_175651_c(p_175640_1_.func_177978_c(), EnumFacing.NORTH) > 0?true:(this.func_175651_c(p_175640_1_.func_177968_d(), EnumFacing.SOUTH) > 0?true:(this.func_175651_c(p_175640_1_.func_177976_e(), EnumFacing.WEST) > 0?true:this.func_175651_c(p_175640_1_.func_177974_f(), EnumFacing.EAST) > 0))));
  19789. }
  19790.  
  19791. public int func_175687_A(BlockPos p_175687_1_) {
  19792. int i = 0;
  19793.  
  19794. for(EnumFacing enumfacing : EnumFacing.values()) {
  19795. int j = this.func_175651_c(p_175687_1_.func_177972_a(enumfacing), enumfacing);
  19796. if(j >= 15) {
  19797. return 15;
  19798. }
  19799.  
  19800. if(j > i) {
  19801. i = j;
  19802. }
  19803. }
  19804.  
  19805. return i;
  19806. }
  19807.  
  19808. @Nullable
  19809. public EntityPlayer func_72890_a(Entity p_72890_1_, double p_72890_2_) {
  19810. return this.func_184137_a(p_72890_1_.field_70165_t, p_72890_1_.field_70163_u, p_72890_1_.field_70161_v, p_72890_2_, false);
  19811. }
  19812.  
  19813. @Nullable
  19814. public EntityPlayer func_184136_b(Entity p_184136_1_, double p_184136_2_) {
  19815. return this.func_184137_a(p_184136_1_.field_70165_t, p_184136_1_.field_70163_u, p_184136_1_.field_70161_v, p_184136_2_, true);
  19816. }
  19817.  
  19818. @Nullable
  19819. public EntityPlayer func_184137_a(double p_184137_1_, double p_184137_3_, double p_184137_5_, double p_184137_7_, boolean p_184137_9_) {
  19820. Predicate<Entity> predicate = p_184137_9_?EntitySelectors.field_188444_d:EntitySelectors.field_180132_d;
  19821. return this.func_190525_a(p_184137_1_, p_184137_3_, p_184137_5_, p_184137_7_, predicate);
  19822. }
  19823.  
  19824. @Nullable
  19825. public EntityPlayer func_190525_a(double p_190525_1_, double p_190525_3_, double p_190525_5_, double p_190525_7_, Predicate<Entity> p_190525_9_) {
  19826. double d0 = -1.0D;
  19827. EntityPlayer entityplayer = null;
  19828.  
  19829. for(int i = 0; i < this.field_73010_i.size(); ++i) {
  19830. EntityPlayer entityplayer1 = (EntityPlayer)this.field_73010_i.get(i);
  19831. if(p_190525_9_.apply(entityplayer1)) {
  19832. double d1 = entityplayer1.func_70092_e(p_190525_1_, p_190525_3_, p_190525_5_);
  19833. if((p_190525_7_ < 0.0D || d1 < p_190525_7_ * p_190525_7_) && (d0 == -1.0D || d1 < d0)) {
  19834. d0 = d1;
  19835. entityplayer = entityplayer1;
  19836. }
  19837. }
  19838. }
  19839.  
  19840. return entityplayer;
  19841. }
  19842.  
  19843. public boolean func_175636_b(double p_175636_1_, double p_175636_3_, double p_175636_5_, double p_175636_7_) {
  19844. for(int i = 0; i < this.field_73010_i.size(); ++i) {
  19845. EntityPlayer entityplayer = (EntityPlayer)this.field_73010_i.get(i);
  19846. if(EntitySelectors.field_180132_d.apply(entityplayer)) {
  19847. double d0 = entityplayer.func_70092_e(p_175636_1_, p_175636_3_, p_175636_5_);
  19848. if(p_175636_7_ < 0.0D || d0 < p_175636_7_ * p_175636_7_) {
  19849. return true;
  19850. }
  19851. }
  19852. }
  19853.  
  19854. return false;
  19855. }
  19856.  
  19857. @Nullable
  19858. public EntityPlayer func_184142_a(Entity p_184142_1_, double p_184142_2_, double p_184142_4_) {
  19859. return this.func_184150_a(p_184142_1_.field_70165_t, p_184142_1_.field_70163_u, p_184142_1_.field_70161_v, p_184142_2_, p_184142_4_, (Function<EntityPlayer, Double>)null, (Predicate<EntityPlayer>)null);
  19860. }
  19861.  
  19862. @Nullable
  19863. public EntityPlayer func_184139_a(BlockPos p_184139_1_, double p_184139_2_, double p_184139_4_) {
  19864. return this.func_184150_a((double)((float)p_184139_1_.func_177958_n() + 0.5F), (double)((float)p_184139_1_.func_177956_o() + 0.5F), (double)((float)p_184139_1_.func_177952_p() + 0.5F), p_184139_2_, p_184139_4_, (Function<EntityPlayer, Double>)null, (Predicate<EntityPlayer>)null);
  19865. }
  19866.  
  19867. @Nullable
  19868. public EntityPlayer func_184150_a(double p_184150_1_, double p_184150_3_, double p_184150_5_, double p_184150_7_, double p_184150_9_, @Nullable Function<EntityPlayer, Double> p_184150_11_, @Nullable Predicate<EntityPlayer> p_184150_12_) {
  19869. double d0 = -1.0D;
  19870. EntityPlayer entityplayer = null;
  19871.  
  19872. for(int i = 0; i < this.field_73010_i.size(); ++i) {
  19873. EntityPlayer entityplayer1 = (EntityPlayer)this.field_73010_i.get(i);
  19874. if(!entityplayer1.field_71075_bZ.field_75102_a && entityplayer1.func_70089_S() && !entityplayer1.func_175149_v() && (p_184150_12_ == null || p_184150_12_.apply(entityplayer1))) {
  19875. double d1 = entityplayer1.func_70092_e(p_184150_1_, entityplayer1.field_70163_u, p_184150_5_);
  19876. double d2 = p_184150_7_;
  19877. if(entityplayer1.func_70093_af()) {
  19878. d2 = p_184150_7_ * 0.800000011920929D;
  19879. }
  19880.  
  19881. if(entityplayer1.func_82150_aj()) {
  19882. float f = entityplayer1.func_82243_bO();
  19883. if(f < 0.1F) {
  19884. f = 0.1F;
  19885. }
  19886.  
  19887. d2 *= (double)(0.7F * f);
  19888. }
  19889.  
  19890. if(p_184150_11_ != null) {
  19891. d2 *= ((Double)MoreObjects.firstNonNull(p_184150_11_.apply(entityplayer1), Double.valueOf(1.0D))).doubleValue();
  19892. }
  19893.  
  19894. if((p_184150_9_ < 0.0D || Math.abs(entityplayer1.field_70163_u - p_184150_3_) < p_184150_9_ * p_184150_9_) && (p_184150_7_ < 0.0D || d1 < d2 * d2) && (d0 == -1.0D || d1 < d0)) {
  19895. d0 = d1;
  19896. entityplayer = entityplayer1;
  19897. }
  19898. }
  19899. }
  19900.  
  19901. return entityplayer;
  19902. }
  19903.  
  19904. @Nullable
  19905. public EntityPlayer func_72924_a(String p_72924_1_) {
  19906. for(int i = 0; i < this.field_73010_i.size(); ++i) {
  19907. EntityPlayer entityplayer = (EntityPlayer)this.field_73010_i.get(i);
  19908. if(p_72924_1_.equals(entityplayer.func_70005_c_())) {
  19909. return entityplayer;
  19910. }
  19911. }
  19912.  
  19913. return null;
  19914. }
  19915.  
  19916. @Nullable
  19917. public EntityPlayer func_152378_a(UUID p_152378_1_) {
  19918. for(int i = 0; i < this.field_73010_i.size(); ++i) {
  19919. EntityPlayer entityplayer = (EntityPlayer)this.field_73010_i.get(i);
  19920. if(p_152378_1_.equals(entityplayer.func_110124_au())) {
  19921. return entityplayer;
  19922. }
  19923. }
  19924.  
  19925. return null;
  19926. }
  19927.  
  19928. @SideOnly(Side.CLIENT)
  19929. public void func_72882_A() {
  19930. }
  19931.  
  19932. public void func_72906_B() throws MinecraftException {
  19933. this.field_73019_z.func_75762_c();
  19934. }
  19935.  
  19936. @SideOnly(Side.CLIENT)
  19937. public void func_82738_a(long p_82738_1_) {
  19938. this.field_72986_A.func_82572_b(p_82738_1_);
  19939. }
  19940.  
  19941. public long func_72905_C() {
  19942. return this.field_72986_A.func_76063_b();
  19943. }
  19944.  
  19945. public long func_82737_E() {
  19946. return this.field_72986_A.func_82573_f();
  19947. }
  19948.  
  19949. public long func_72820_D() {
  19950. return this.field_72986_A.func_76073_f();
  19951. }
  19952.  
  19953. public void func_72877_b(long p_72877_1_) {
  19954. this.field_72986_A.func_76068_b(p_72877_1_);
  19955. }
  19956.  
  19957. public BlockPos func_175694_M() {
  19958. BlockPos blockpos = new BlockPos(this.field_72986_A.func_76079_c(), this.field_72986_A.func_76075_d(), this.field_72986_A.func_76074_e());
  19959. if(!this.func_175723_af().func_177746_a(blockpos)) {
  19960. blockpos = this.func_175645_m(new BlockPos(this.func_175723_af().func_177731_f(), 0.0D, this.func_175723_af().func_177721_g()));
  19961. }
  19962.  
  19963. return blockpos;
  19964. }
  19965.  
  19966. public void func_175652_B(BlockPos p_175652_1_) {
  19967. this.field_72986_A.func_176143_a(p_175652_1_);
  19968. }
  19969.  
  19970. @SideOnly(Side.CLIENT)
  19971. public void func_72897_h(Entity p_72897_1_) {
  19972. int i = MathHelper.func_76128_c(p_72897_1_.field_70165_t / 16.0D);
  19973. int j = MathHelper.func_76128_c(p_72897_1_.field_70161_v / 16.0D);
  19974. int k = 2;
  19975.  
  19976. for(int l = -2; l <= 2; ++l) {
  19977. for(int i1 = -2; i1 <= 2; ++i1) {
  19978. this.func_72964_e(i + l, j + i1);
  19979. }
  19980. }
  19981.  
  19982. if(!this.field_72996_f.contains(p_72897_1_)) {
  19983. this.field_72996_f.add(p_72897_1_);
  19984. }
  19985.  
  19986. }
  19987.  
  19988. public boolean func_175660_a(EntityPlayer p_175660_1_, BlockPos p_175660_2_) {
  19989. return true;
  19990. }
  19991.  
  19992. public void func_72960_a(Entity p_72960_1_, byte p_72960_2_) {
  19993. }
  19994.  
  19995. public IChunkProvider func_72863_F() {
  19996. return this.field_73020_y;
  19997. }
  19998.  
  19999. public void func_175641_c(BlockPos p_175641_1_, Block p_175641_2_, int p_175641_3_, int p_175641_4_) {
  20000. this.func_180495_p(p_175641_1_).func_189547_a(this, p_175641_1_, p_175641_3_, p_175641_4_);
  20001. }
  20002.  
  20003. public ISaveHandler func_72860_G() {
  20004. return this.field_73019_z;
  20005. }
  20006.  
  20007. public WorldInfo func_72912_H() {
  20008. return this.field_72986_A;
  20009. }
  20010.  
  20011. public GameRules func_82736_K() {
  20012. return this.field_72986_A.func_82574_x();
  20013. }
  20014.  
  20015. public void func_72854_c() {
  20016. }
  20017.  
  20018. public float func_72819_i(float p_72819_1_) {
  20019. return (this.field_73018_p + (this.field_73017_q - this.field_73018_p) * p_72819_1_) * this.func_72867_j(p_72819_1_);
  20020. }
  20021.  
  20022. @SideOnly(Side.CLIENT)
  20023. public void func_147442_i(float p_147442_1_) {
  20024. this.field_73018_p = p_147442_1_;
  20025. this.field_73017_q = p_147442_1_;
  20026. }
  20027.  
  20028. public float func_72867_j(float p_72867_1_) {
  20029. return this.field_73003_n + (this.field_73004_o - this.field_73003_n) * p_72867_1_;
  20030. }
  20031.  
  20032. @SideOnly(Side.CLIENT)
  20033. public void func_72894_k(float p_72894_1_) {
  20034. this.field_73003_n = p_72894_1_;
  20035. this.field_73004_o = p_72894_1_;
  20036. }
  20037.  
  20038. public boolean func_72911_I() {
  20039. return (double)this.func_72819_i(1.0F) > 0.9D;
  20040. }
  20041.  
  20042. public boolean func_72896_J() {
  20043. return (double)this.func_72867_j(1.0F) > 0.2D;
  20044. }
  20045.  
  20046. public boolean func_175727_C(BlockPos p_175727_1_) {
  20047. if(!this.func_72896_J()) {
  20048. return false;
  20049. } else if(!this.func_175678_i(p_175727_1_)) {
  20050. return false;
  20051. } else if(this.func_175725_q(p_175727_1_).func_177956_o() > p_175727_1_.func_177956_o()) {
  20052. return false;
  20053. } else {
  20054. Biome biome = this.func_180494_b(p_175727_1_);
  20055. return biome.func_76746_c()?false:(this.func_175708_f(p_175727_1_, false)?false:biome.func_76738_d());
  20056. }
  20057. }
  20058.  
  20059. public boolean func_180502_D(BlockPos p_180502_1_) {
  20060. Biome biome = this.func_180494_b(p_180502_1_);
  20061. return biome.func_76736_e();
  20062. }
  20063.  
  20064. @Nullable
  20065. public MapStorage func_175693_T() {
  20066. return this.field_72988_C;
  20067. }
  20068.  
  20069. public void func_72823_a(String p_72823_1_, WorldSavedData p_72823_2_) {
  20070. this.field_72988_C.func_75745_a(p_72823_1_, p_72823_2_);
  20071. }
  20072.  
  20073. @Nullable
  20074. public WorldSavedData func_72943_a(Class<? extends WorldSavedData> p_72943_1_, String p_72943_2_) {
  20075. return this.field_72988_C.func_75742_a(p_72943_1_, p_72943_2_);
  20076. }
  20077.  
  20078. public int func_72841_b(String p_72841_1_) {
  20079. return this.field_72988_C.func_75743_a(p_72841_1_);
  20080. }
  20081.  
  20082. public void func_175669_a(int p_175669_1_, BlockPos p_175669_2_, int p_175669_3_) {
  20083. for(int i = 0; i < this.field_73021_x.size(); ++i) {
  20084. ((IWorldEventListener)this.field_73021_x.get(i)).func_180440_a(p_175669_1_, p_175669_2_, p_175669_3_);
  20085. }
  20086.  
  20087. }
  20088.  
  20089. public void func_175718_b(int p_175718_1_, BlockPos p_175718_2_, int p_175718_3_) {
  20090. this.func_180498_a((EntityPlayer)null, p_175718_1_, p_175718_2_, p_175718_3_);
  20091. }
  20092.  
  20093. public void func_180498_a(@Nullable EntityPlayer p_180498_1_, int p_180498_2_, BlockPos p_180498_3_, int p_180498_4_) {
  20094. try {
  20095. for(int i = 0; i < this.field_73021_x.size(); ++i) {
  20096. ((IWorldEventListener)this.field_73021_x.get(i)).func_180439_a(p_180498_1_, p_180498_2_, p_180498_3_, p_180498_4_);
  20097. }
  20098.  
  20099. } catch (Throwable throwable) {
  20100. CrashReport crashreport = CrashReport.func_85055_a(throwable, "Playing level event");
  20101. CrashReportCategory crashreportcategory = crashreport.func_85058_a("Level event being played");
  20102. crashreportcategory.func_71507_a("Block coordinates", CrashReportCategory.func_180522_a(p_180498_3_));
  20103. crashreportcategory.func_71507_a("Event source", p_180498_1_);
  20104. crashreportcategory.func_71507_a("Event type", Integer.valueOf(p_180498_2_));
  20105. crashreportcategory.func_71507_a("Event data", Integer.valueOf(p_180498_4_));
  20106. throw new ReportedException(crashreport);
  20107. }
  20108. }
  20109.  
  20110. public int func_72800_K() {
  20111. return 256;
  20112. }
  20113.  
  20114. public int func_72940_L() {
  20115. return this.field_73011_w.func_177495_o()?128:256;
  20116. }
  20117.  
  20118. public Random func_72843_D(int p_72843_1_, int p_72843_2_, int p_72843_3_) {
  20119. long i = (long)p_72843_1_ * 341873128712L + (long)p_72843_2_ * 132897987541L + this.func_72912_H().func_76063_b() + (long)p_72843_3_;
  20120. this.field_73012_v.setSeed(i);
  20121. return this.field_73012_v;
  20122. }
  20123.  
  20124. public CrashReportCategory func_72914_a(CrashReport p_72914_1_) {
  20125. CrashReportCategory crashreportcategory = p_72914_1_.func_85057_a("Affected level", 1);
  20126. crashreportcategory.func_71507_a("Level name", this.field_72986_A == null?"????":this.field_72986_A.func_76065_j());
  20127. crashreportcategory.func_189529_a("All players", new ICrashReportDetail<String>() {
  20128. public String call() {
  20129. return World.this.field_73010_i.size() + " total; " + World.this.field_73010_i;
  20130. }
  20131. });
  20132. crashreportcategory.func_189529_a("Chunk stats", new ICrashReportDetail<String>() {
  20133. public String call() {
  20134. return World.this.field_73020_y.func_73148_d();
  20135. }
  20136. });
  20137.  
  20138. try {
  20139. this.field_72986_A.func_85118_a(crashreportcategory);
  20140. } catch (Throwable throwable) {
  20141. crashreportcategory.func_71499_a("Level Data Unobtainable", throwable);
  20142. }
  20143.  
  20144. return crashreportcategory;
  20145. }
  20146.  
  20147. @SideOnly(Side.CLIENT)
  20148. public double func_72919_O() {
  20149. return this.field_72986_A.func_76067_t() == WorldType.field_77138_c?0.0D:63.0D;
  20150. }
  20151.  
  20152. public void func_175715_c(int p_175715_1_, BlockPos p_175715_2_, int p_175715_3_) {
  20153. for(int i = 0; i < this.field_73021_x.size(); ++i) {
  20154. IWorldEventListener iworldeventlistener = (IWorldEventListener)this.field_73021_x.get(i);
  20155. iworldeventlistener.func_180441_b(p_175715_1_, p_175715_2_, p_175715_3_);
  20156. }
  20157.  
  20158. }
  20159.  
  20160. public Calendar func_83015_S() {
  20161. if(this.func_82737_E() % 600L == 0L) {
  20162. this.field_83016_L.setTimeInMillis(MinecraftServer.func_130071_aq());
  20163. }
  20164.  
  20165. return this.field_83016_L;
  20166. }
  20167.  
  20168. @SideOnly(Side.CLIENT)
  20169. public void func_92088_a(double p_92088_1_, double p_92088_3_, double p_92088_5_, double p_92088_7_, double p_92088_9_, double p_92088_11_, @Nullable NBTTagCompound p_92088_13_) {
  20170. }
  20171.  
  20172. public Scoreboard func_96441_U() {
  20173. return this.field_96442_D;
  20174. }
  20175.  
  20176. public void func_175666_e(BlockPos p_175666_1_, Block p_175666_2_) {
  20177. for(EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) {
  20178. BlockPos blockpos = p_175666_1_.func_177972_a(enumfacing);
  20179. if(this.func_175667_e(blockpos)) {
  20180. IBlockState iblockstate = this.func_180495_p(blockpos);
  20181. if(Blocks.field_150441_bU.func_185547_C(iblockstate)) {
  20182. iblockstate.func_189546_a(this, blockpos, p_175666_2_, p_175666_1_);
  20183. } else if(iblockstate.func_185915_l()) {
  20184. blockpos = blockpos.func_177972_a(enumfacing);
  20185. iblockstate = this.func_180495_p(blockpos);
  20186. if(Blocks.field_150441_bU.func_185547_C(iblockstate)) {
  20187. iblockstate.func_189546_a(this, blockpos, p_175666_2_, p_175666_1_);
  20188. }
  20189. }
  20190. }
  20191. }
  20192.  
  20193. }
  20194.  
  20195. public DifficultyInstance func_175649_E(BlockPos p_175649_1_) {
  20196. long i = 0L;
  20197. float f = 0.0F;
  20198. if(this.func_175667_e(p_175649_1_)) {
  20199. f = this.func_130001_d();
  20200. i = this.func_175726_f(p_175649_1_).func_177416_w();
  20201. }
  20202.  
  20203. return new DifficultyInstance(this.func_175659_aa(), this.func_72820_D(), i, f);
  20204. }
  20205.  
  20206. public EnumDifficulty func_175659_aa() {
  20207. return this.func_72912_H().func_176130_y();
  20208. }
  20209.  
  20210. public int func_175657_ab() {
  20211. return this.field_73008_k;
  20212. }
  20213.  
  20214. public void func_175692_b(int p_175692_1_) {
  20215. this.field_73008_k = p_175692_1_;
  20216. }
  20217.  
  20218. @SideOnly(Side.CLIENT)
  20219. public int func_175658_ac() {
  20220. return this.field_73016_r;
  20221. }
  20222.  
  20223. public void func_175702_c(int p_175702_1_) {
  20224. this.field_73016_r = p_175702_1_;
  20225. }
  20226.  
  20227. public VillageCollection func_175714_ae() {
  20228. return this.field_72982_D;
  20229. }
  20230.  
  20231. public WorldBorder func_175723_af() {
  20232. return this.field_175728_M;
  20233. }
  20234.  
  20235. public boolean func_72916_c(int p_72916_1_, int p_72916_2_) {
  20236. BlockPos blockpos = this.func_175694_M();
  20237. int i = p_72916_1_ * 16 + 8 - blockpos.func_177958_n();
  20238. int j = p_72916_2_ * 16 + 8 - blockpos.func_177952_p();
  20239. int k = 128;
  20240. return i >= -128 && i <= 128 && j >= -128 && j <= 128;
  20241. }
  20242.  
  20243. public void func_184135_a(Packet<?> p_184135_1_) {
  20244. throw new UnsupportedOperationException("Can\'t send packets to server unless you\'re on the client.");
  20245. }
  20246.  
  20247. public LootTableManager func_184146_ak() {
  20248. return this.field_184151_B;
  20249. }
  20250.  
  20251. @Nullable
  20252. public BlockPos func_190528_a(String p_190528_1_, BlockPos p_190528_2_, boolean p_190528_3_) {
  20253. return null;
  20254. }
  20255. }
  20256.  
  20257. Hunk 2 failed! Cannot find hunk target
  20258. List<T> list = Lists.<T>newArrayList();
  20259.  
  20260. for(Entity entity : this.field_73010_i) {
  20261. - if (p_175661_1_.isAssignableFrom(entity.getClass()) && p_175661_2_.apply(entity)) {
  20262. - list.add(entity);
  20263. + if (p_175661_1_.isAssignableFrom(entity.getClass()) && p_175661_2_.apply((T)entity)) {
  20264. + list.add((T)entity);
  20265. }
  20266. }
  20267.  
  20268. File state
  20269. package net.minecraft.world;
  20270.  
  20271. import com.google.common.base.Function;
  20272. import com.google.common.base.MoreObjects;
  20273. import com.google.common.base.Predicate;
  20274. import com.google.common.collect.Lists;
  20275. import java.util.Calendar;
  20276. import java.util.Collection;
  20277. import java.util.Iterator;
  20278. import java.util.List;
  20279. import java.util.Random;
  20280. import java.util.UUID;
  20281. import javax.annotation.Nullable;
  20282. import net.minecraft.advancements.AdvancementManager;
  20283. import net.minecraft.advancements.FunctionManager;
  20284. import net.minecraft.block.Block;
  20285. import net.minecraft.block.BlockLiquid;
  20286. import net.minecraft.block.BlockObserver;
  20287. import net.minecraft.block.material.Material;
  20288. import net.minecraft.block.state.IBlockState;
  20289. import net.minecraft.crash.CrashReport;
  20290. import net.minecraft.crash.CrashReportCategory;
  20291. import net.minecraft.crash.ICrashReportDetail;
  20292. import net.minecraft.entity.Entity;
  20293. import net.minecraft.entity.EntityLiving;
  20294. import net.minecraft.entity.player.EntityPlayer;
  20295. import net.minecraft.entity.player.EntityPlayerMP;
  20296. import net.minecraft.init.Biomes;
  20297. import net.minecraft.init.Blocks;
  20298. import net.minecraft.nbt.NBTTagCompound;
  20299. import net.minecraft.network.Packet;
  20300. import net.minecraft.pathfinding.PathWorldListener;
  20301. import net.minecraft.profiler.Profiler;
  20302. import net.minecraft.scoreboard.Scoreboard;
  20303. import net.minecraft.server.MinecraftServer;
  20304. import net.minecraft.tileentity.TileEntity;
  20305. import net.minecraft.util.EntitySelectors;
  20306. import net.minecraft.util.EnumFacing;
  20307. import net.minecraft.util.EnumParticleTypes;
  20308. import net.minecraft.util.ITickable;
  20309. import net.minecraft.util.IntHashMap;
  20310. import net.minecraft.util.ReportedException;
  20311. import net.minecraft.util.SoundCategory;
  20312. import net.minecraft.util.SoundEvent;
  20313. import net.minecraft.util.math.AxisAlignedBB;
  20314. import net.minecraft.util.math.BlockPos;
  20315. import net.minecraft.util.math.MathHelper;
  20316. import net.minecraft.util.math.RayTraceResult;
  20317. import net.minecraft.util.math.Vec3d;
  20318. import net.minecraft.village.VillageCollection;
  20319. import net.minecraft.world.DifficultyInstance;
  20320. import net.minecraft.world.EnumDifficulty;
  20321. import net.minecraft.world.EnumSkyBlock;
  20322. import net.minecraft.world.Explosion;
  20323. import net.minecraft.world.GameRules;
  20324. import net.minecraft.world.IBlockAccess;
  20325. import net.minecraft.world.IWorldEventListener;
  20326. import net.minecraft.world.MinecraftException;
  20327. import net.minecraft.world.NextTickListEntry;
  20328. import net.minecraft.world.WorldProvider;
  20329. import net.minecraft.world.WorldSettings;
  20330. import net.minecraft.world.WorldType;
  20331. import net.minecraft.world.biome.Biome;
  20332. import net.minecraft.world.biome.BiomeProvider;
  20333. import net.minecraft.world.border.WorldBorder;
  20334. import net.minecraft.world.chunk.Chunk;
  20335. import net.minecraft.world.chunk.IChunkProvider;
  20336. import net.minecraft.world.gen.structure.StructureBoundingBox;
  20337. import net.minecraft.world.storage.ISaveHandler;
  20338. import net.minecraft.world.storage.MapStorage;
  20339. import net.minecraft.world.storage.WorldInfo;
  20340. import net.minecraft.world.storage.WorldSavedData;
  20341. import net.minecraft.world.storage.loot.LootTableManager;
  20342. import net.minecraftforge.fml.relauncher.Side;
  20343. import net.minecraftforge.fml.relauncher.SideOnly;
  20344.  
  20345. public abstract class World implements IBlockAccess {
  20346. private int field_181546_a = 63;
  20347. protected boolean field_72999_e;
  20348. public final List<Entity> field_72996_f = Lists.<Entity>newArrayList();
  20349. protected final List<Entity> field_72997_g = Lists.<Entity>newArrayList();
  20350. public final List<TileEntity> field_147482_g = Lists.<TileEntity>newArrayList();
  20351. public final List<TileEntity> field_175730_i = Lists.<TileEntity>newArrayList();
  20352. private final List<TileEntity> field_147484_a = Lists.<TileEntity>newArrayList();
  20353. private final List<TileEntity> field_147483_b = Lists.<TileEntity>newArrayList();
  20354. public final List<EntityPlayer> field_73010_i = Lists.<EntityPlayer>newArrayList();
  20355. public final List<Entity> field_73007_j = Lists.<Entity>newArrayList();
  20356. protected final IntHashMap<Entity> field_175729_l = new IntHashMap();
  20357. private final long field_73001_c = 16777215L;
  20358. private int field_73008_k;
  20359. protected int field_73005_l = (new Random()).nextInt();
  20360. protected final int field_73006_m = 1013904223;
  20361. public float field_73003_n;
  20362. public float field_73004_o;
  20363. public float field_73018_p;
  20364. public float field_73017_q;
  20365. private int field_73016_r;
  20366. public final Random field_73012_v = new Random();
  20367. public final WorldProvider field_73011_w;
  20368. protected PathWorldListener field_184152_t = new PathWorldListener();
  20369. protected List<IWorldEventListener> field_73021_x;
  20370. protected IChunkProvider field_73020_y;
  20371. protected final ISaveHandler field_73019_z;
  20372. protected WorldInfo field_72986_A;
  20373. protected boolean field_72987_B;
  20374. protected MapStorage field_72988_C;
  20375. public VillageCollection field_72982_D;
  20376. protected LootTableManager field_184151_B;
  20377. protected AdvancementManager field_191951_C;
  20378. protected FunctionManager field_193036_D;
  20379. public final Profiler field_72984_F;
  20380. private final Calendar field_83016_L;
  20381. protected Scoreboard field_96442_D;
  20382. public final boolean field_72995_K;
  20383. protected boolean field_72985_G;
  20384. protected boolean field_72992_H;
  20385. private boolean field_147481_N;
  20386. private final WorldBorder field_175728_M;
  20387. int[] field_72994_J;
  20388.  
  20389. protected World(ISaveHandler p_i45749_1_, WorldInfo p_i45749_2_, WorldProvider p_i45749_3_, Profiler p_i45749_4_, boolean p_i45749_5_) {
  20390. this.field_73021_x = Lists.newArrayList(new IWorldEventListener[]{this.field_184152_t});
  20391. this.field_83016_L = Calendar.getInstance();
  20392. this.field_96442_D = new Scoreboard();
  20393. this.field_72985_G = true;
  20394. this.field_72992_H = true;
  20395. this.field_72994_J = new int['\u8000'];
  20396. this.field_73019_z = p_i45749_1_;
  20397. this.field_72984_F = p_i45749_4_;
  20398. this.field_72986_A = p_i45749_2_;
  20399. this.field_73011_w = p_i45749_3_;
  20400. this.field_72995_K = p_i45749_5_;
  20401. this.field_175728_M = p_i45749_3_.func_177501_r();
  20402. }
  20403.  
  20404. public World func_175643_b() {
  20405. return this;
  20406. }
  20407.  
  20408. public Biome func_180494_b(final BlockPos p_180494_1_) {
  20409. if(this.func_175667_e(p_180494_1_)) {
  20410. Chunk chunk = this.func_175726_f(p_180494_1_);
  20411.  
  20412. try {
  20413. return chunk.func_177411_a(p_180494_1_, this.field_73011_w.func_177499_m());
  20414. } catch (Throwable throwable) {
  20415. CrashReport crashreport = CrashReport.func_85055_a(throwable, "Getting biome");
  20416. CrashReportCategory crashreportcategory = crashreport.func_85058_a("Coordinates of biome request");
  20417. crashreportcategory.func_189529_a("Location", new ICrashReportDetail<String>() {
  20418. public String call() throws Exception {
  20419. return CrashReportCategory.func_180522_a(p_180494_1_);
  20420. }
  20421. });
  20422. throw new ReportedException(crashreport);
  20423. }
  20424. } else {
  20425. return this.field_73011_w.func_177499_m().func_180300_a(p_180494_1_, Biomes.field_76772_c);
  20426. }
  20427. }
  20428.  
  20429. public BiomeProvider func_72959_q() {
  20430. return this.field_73011_w.func_177499_m();
  20431. }
  20432.  
  20433. protected abstract IChunkProvider func_72970_h();
  20434.  
  20435. public void func_72963_a(WorldSettings p_72963_1_) {
  20436. this.field_72986_A.func_76091_d(true);
  20437. }
  20438.  
  20439. @Nullable
  20440. public MinecraftServer func_73046_m() {
  20441. return null;
  20442. }
  20443.  
  20444. @SideOnly(Side.CLIENT)
  20445. public void func_72974_f() {
  20446. this.func_175652_B(new BlockPos(8, 64, 8));
  20447. }
  20448.  
  20449. public IBlockState func_184141_c(BlockPos p_184141_1_) {
  20450. BlockPos blockpos;
  20451. for(blockpos = new BlockPos(p_184141_1_.func_177958_n(), this.func_181545_F(), p_184141_1_.func_177952_p()); !this.func_175623_d(blockpos.func_177984_a()); blockpos = blockpos.func_177984_a()) {
  20452. ;
  20453. }
  20454.  
  20455. return this.func_180495_p(blockpos);
  20456. }
  20457.  
  20458. public boolean func_175701_a(BlockPos p_175701_1_) {
  20459. return !this.func_189509_E(p_175701_1_) && p_175701_1_.func_177958_n() >= -30000000 && p_175701_1_.func_177952_p() >= -30000000 && p_175701_1_.func_177958_n() < 30000000 && p_175701_1_.func_177952_p() < 30000000;
  20460. }
  20461.  
  20462. public boolean func_189509_E(BlockPos p_189509_1_) {
  20463. return p_189509_1_.func_177956_o() < 0 || p_189509_1_.func_177956_o() >= 256;
  20464. }
  20465.  
  20466. public boolean func_175623_d(BlockPos p_175623_1_) {
  20467. return this.func_180495_p(p_175623_1_).func_185904_a() == Material.field_151579_a;
  20468. }
  20469.  
  20470. public boolean func_175667_e(BlockPos p_175667_1_) {
  20471. return this.func_175668_a(p_175667_1_, true);
  20472. }
  20473.  
  20474. public boolean func_175668_a(BlockPos p_175668_1_, boolean p_175668_2_) {
  20475. return this.func_175680_a(p_175668_1_.func_177958_n() >> 4, p_175668_1_.func_177952_p() >> 4, p_175668_2_);
  20476. }
  20477.  
  20478. public boolean func_175697_a(BlockPos p_175697_1_, int p_175697_2_) {
  20479. return this.func_175648_a(p_175697_1_, p_175697_2_, true);
  20480. }
  20481.  
  20482. public boolean func_175648_a(BlockPos p_175648_1_, int p_175648_2_, boolean p_175648_3_) {
  20483. return this.func_175663_a(p_175648_1_.func_177958_n() - p_175648_2_, p_175648_1_.func_177956_o() - p_175648_2_, p_175648_1_.func_177952_p() - p_175648_2_, p_175648_1_.func_177958_n() + p_175648_2_, p_175648_1_.func_177956_o() + p_175648_2_, p_175648_1_.func_177952_p() + p_175648_2_, p_175648_3_);
  20484. }
  20485.  
  20486. public boolean func_175707_a(BlockPos p_175707_1_, BlockPos p_175707_2_) {
  20487. return this.func_175706_a(p_175707_1_, p_175707_2_, true);
  20488. }
  20489.  
  20490. public boolean func_175706_a(BlockPos p_175706_1_, BlockPos p_175706_2_, boolean p_175706_3_) {
  20491. return this.func_175663_a(p_175706_1_.func_177958_n(), p_175706_1_.func_177956_o(), p_175706_1_.func_177952_p(), p_175706_2_.func_177958_n(), p_175706_2_.func_177956_o(), p_175706_2_.func_177952_p(), p_175706_3_);
  20492. }
  20493.  
  20494. public boolean func_175711_a(StructureBoundingBox p_175711_1_) {
  20495. return this.func_175639_b(p_175711_1_, true);
  20496. }
  20497.  
  20498. public boolean func_175639_b(StructureBoundingBox p_175639_1_, boolean p_175639_2_) {
  20499. return this.func_175663_a(p_175639_1_.field_78897_a, p_175639_1_.field_78895_b, p_175639_1_.field_78896_c, p_175639_1_.field_78893_d, p_175639_1_.field_78894_e, p_175639_1_.field_78892_f, p_175639_2_);
  20500. }
  20501.  
  20502. private boolean func_175663_a(int p_175663_1_, int p_175663_2_, int p_175663_3_, int p_175663_4_, int p_175663_5_, int p_175663_6_, boolean p_175663_7_) {
  20503. if(p_175663_5_ >= 0 && p_175663_2_ < 256) {
  20504. p_175663_1_ = p_175663_1_ >> 4;
  20505. p_175663_3_ = p_175663_3_ >> 4;
  20506. p_175663_4_ = p_175663_4_ >> 4;
  20507. p_175663_6_ = p_175663_6_ >> 4;
  20508.  
  20509. for(int i = p_175663_1_; i <= p_175663_4_; ++i) {
  20510. for(int j = p_175663_3_; j <= p_175663_6_; ++j) {
  20511. if(!this.func_175680_a(i, j, p_175663_7_)) {
  20512. return false;
  20513. }
  20514. }
  20515. }
  20516.  
  20517. return true;
  20518. } else {
  20519. return false;
  20520. }
  20521. }
  20522.  
  20523. protected abstract boolean func_175680_a(int p_175680_1_, int p_175680_2_, boolean p_175680_3_);
  20524.  
  20525. public Chunk func_175726_f(BlockPos p_175726_1_) {
  20526. return this.func_72964_e(p_175726_1_.func_177958_n() >> 4, p_175726_1_.func_177952_p() >> 4);
  20527. }
  20528.  
  20529. public Chunk func_72964_e(int p_72964_1_, int p_72964_2_) {
  20530. return this.field_73020_y.func_186025_d(p_72964_1_, p_72964_2_);
  20531. }
  20532.  
  20533. public boolean func_190526_b(int p_190526_1_, int p_190526_2_) {
  20534. return this.func_175680_a(p_190526_1_, p_190526_2_, false)?true:this.field_73020_y.func_191062_e(p_190526_1_, p_190526_2_);
  20535. }
  20536.  
  20537. public boolean func_180501_a(BlockPos p_180501_1_, IBlockState p_180501_2_, int p_180501_3_) {
  20538. if(this.func_189509_E(p_180501_1_)) {
  20539. return false;
  20540. } else if(!this.field_72995_K && this.field_72986_A.func_76067_t() == WorldType.field_180272_g) {
  20541. return false;
  20542. } else {
  20543. Chunk chunk = this.func_175726_f(p_180501_1_);
  20544. Block block = p_180501_2_.func_177230_c();
  20545. IBlockState iblockstate = chunk.func_177436_a(p_180501_1_, p_180501_2_);
  20546. if(iblockstate == null) {
  20547. return false;
  20548. } else {
  20549. if(p_180501_2_.func_185891_c() != iblockstate.func_185891_c() || p_180501_2_.func_185906_d() != iblockstate.func_185906_d()) {
  20550. this.field_72984_F.func_76320_a("checkLight");
  20551. this.func_175664_x(p_180501_1_);
  20552. this.field_72984_F.func_76319_b();
  20553. }
  20554.  
  20555. if((p_180501_3_ & 2) != 0 && (!this.field_72995_K || (p_180501_3_ & 4) == 0) && chunk.func_150802_k()) {
  20556. this.func_184138_a(p_180501_1_, iblockstate, p_180501_2_, p_180501_3_);
  20557. }
  20558.  
  20559. if(!this.field_72995_K && (p_180501_3_ & 1) != 0) {
  20560. this.func_175722_b(p_180501_1_, iblockstate.func_177230_c(), true);
  20561. if(p_180501_2_.func_185912_n()) {
  20562. this.func_175666_e(p_180501_1_, block);
  20563. }
  20564. } else if(!this.field_72995_K && (p_180501_3_ & 16) == 0) {
  20565. this.func_190522_c(p_180501_1_, block);
  20566. }
  20567.  
  20568. return true;
  20569. }
  20570. }
  20571. }
  20572.  
  20573. public boolean func_175698_g(BlockPos p_175698_1_) {
  20574. return this.func_180501_a(p_175698_1_, Blocks.field_150350_a.func_176223_P(), 3);
  20575. }
  20576.  
  20577. public boolean func_175655_b(BlockPos p_175655_1_, boolean p_175655_2_) {
  20578. IBlockState iblockstate = this.func_180495_p(p_175655_1_);
  20579. Block block = iblockstate.func_177230_c();
  20580. if(iblockstate.func_185904_a() == Material.field_151579_a) {
  20581. return false;
  20582. } else {
  20583. this.func_175718_b(2001, p_175655_1_, Block.func_176210_f(iblockstate));
  20584. if(p_175655_2_) {
  20585. block.func_176226_b(this, p_175655_1_, iblockstate, 0);
  20586. }
  20587.  
  20588. return this.func_180501_a(p_175655_1_, Blocks.field_150350_a.func_176223_P(), 3);
  20589. }
  20590. }
  20591.  
  20592. public boolean func_175656_a(BlockPos p_175656_1_, IBlockState p_175656_2_) {
  20593. return this.func_180501_a(p_175656_1_, p_175656_2_, 3);
  20594. }
  20595.  
  20596. public void func_184138_a(BlockPos p_184138_1_, IBlockState p_184138_2_, IBlockState p_184138_3_, int p_184138_4_) {
  20597. for(int i = 0; i < this.field_73021_x.size(); ++i) {
  20598. ((IWorldEventListener)this.field_73021_x.get(i)).func_184376_a(this, p_184138_1_, p_184138_2_, p_184138_3_, p_184138_4_);
  20599. }
  20600.  
  20601. }
  20602.  
  20603. public void func_175722_b(BlockPos p_175722_1_, Block p_175722_2_, boolean p_175722_3_) {
  20604. if(this.field_72986_A.func_76067_t() != WorldType.field_180272_g) {
  20605. this.func_175685_c(p_175722_1_, p_175722_2_, p_175722_3_);
  20606. }
  20607.  
  20608. }
  20609.  
  20610. public void func_72975_g(int p_72975_1_, int p_72975_2_, int p_72975_3_, int p_72975_4_) {
  20611. if(p_72975_3_ > p_72975_4_) {
  20612. int i = p_72975_4_;
  20613. p_72975_4_ = p_72975_3_;
  20614. p_72975_3_ = i;
  20615. }
  20616.  
  20617. if(this.field_73011_w.func_191066_m()) {
  20618. for(int j = p_72975_3_; j <= p_72975_4_; ++j) {
  20619. this.func_180500_c(EnumSkyBlock.SKY, new BlockPos(p_72975_1_, j, p_72975_2_));
  20620. }
  20621. }
  20622.  
  20623. this.func_147458_c(p_72975_1_, p_72975_3_, p_72975_2_, p_72975_1_, p_72975_4_, p_72975_2_);
  20624. }
  20625.  
  20626. public void func_175704_b(BlockPos p_175704_1_, BlockPos p_175704_2_) {
  20627. this.func_147458_c(p_175704_1_.func_177958_n(), p_175704_1_.func_177956_o(), p_175704_1_.func_177952_p(), p_175704_2_.func_177958_n(), p_175704_2_.func_177956_o(), p_175704_2_.func_177952_p());
  20628. }
  20629.  
  20630. public void func_147458_c(int p_147458_1_, int p_147458_2_, int p_147458_3_, int p_147458_4_, int p_147458_5_, int p_147458_6_) {
  20631. for(int i = 0; i < this.field_73021_x.size(); ++i) {
  20632. ((IWorldEventListener)this.field_73021_x.get(i)).func_147585_a(p_147458_1_, p_147458_2_, p_147458_3_, p_147458_4_, p_147458_5_, p_147458_6_);
  20633. }
  20634.  
  20635. }
  20636.  
  20637. public void func_190522_c(BlockPos p_190522_1_, Block p_190522_2_) {
  20638. this.func_190529_b(p_190522_1_.func_177976_e(), p_190522_2_, p_190522_1_);
  20639. this.func_190529_b(p_190522_1_.func_177974_f(), p_190522_2_, p_190522_1_);
  20640. this.func_190529_b(p_190522_1_.func_177977_b(), p_190522_2_, p_190522_1_);
  20641. this.func_190529_b(p_190522_1_.func_177984_a(), p_190522_2_, p_190522_1_);
  20642. this.func_190529_b(p_190522_1_.func_177978_c(), p_190522_2_, p_190522_1_);
  20643. this.func_190529_b(p_190522_1_.func_177968_d(), p_190522_2_, p_190522_1_);
  20644. }
  20645.  
  20646. public void func_175685_c(BlockPos p_175685_1_, Block p_175685_2_, boolean p_175685_3_) {
  20647. this.func_190524_a(p_175685_1_.func_177976_e(), p_175685_2_, p_175685_1_);
  20648. this.func_190524_a(p_175685_1_.func_177974_f(), p_175685_2_, p_175685_1_);
  20649. this.func_190524_a(p_175685_1_.func_177977_b(), p_175685_2_, p_175685_1_);
  20650. this.func_190524_a(p_175685_1_.func_177984_a(), p_175685_2_, p_175685_1_);
  20651. this.func_190524_a(p_175685_1_.func_177978_c(), p_175685_2_, p_175685_1_);
  20652. this.func_190524_a(p_175685_1_.func_177968_d(), p_175685_2_, p_175685_1_);
  20653. if(p_175685_3_) {
  20654. this.func_190522_c(p_175685_1_, p_175685_2_);
  20655. }
  20656.  
  20657. }
  20658.  
  20659. public void func_175695_a(BlockPos p_175695_1_, Block p_175695_2_, EnumFacing p_175695_3_) {
  20660. if(p_175695_3_ != EnumFacing.WEST) {
  20661. this.func_190524_a(p_175695_1_.func_177976_e(), p_175695_2_, p_175695_1_);
  20662. }
  20663.  
  20664. if(p_175695_3_ != EnumFacing.EAST) {
  20665. this.func_190524_a(p_175695_1_.func_177974_f(), p_175695_2_, p_175695_1_);
  20666. }
  20667.  
  20668. if(p_175695_3_ != EnumFacing.DOWN) {
  20669. this.func_190524_a(p_175695_1_.func_177977_b(), p_175695_2_, p_175695_1_);
  20670. }
  20671.  
  20672. if(p_175695_3_ != EnumFacing.UP) {
  20673. this.func_190524_a(p_175695_1_.func_177984_a(), p_175695_2_, p_175695_1_);
  20674. }
  20675.  
  20676. if(p_175695_3_ != EnumFacing.NORTH) {
  20677. this.func_190524_a(p_175695_1_.func_177978_c(), p_175695_2_, p_175695_1_);
  20678. }
  20679.  
  20680. if(p_175695_3_ != EnumFacing.SOUTH) {
  20681. this.func_190524_a(p_175695_1_.func_177968_d(), p_175695_2_, p_175695_1_);
  20682. }
  20683.  
  20684. }
  20685.  
  20686. public void func_190524_a(BlockPos p_190524_1_, final Block p_190524_2_, BlockPos p_190524_3_) {
  20687. if(!this.field_72995_K) {
  20688. IBlockState iblockstate = this.func_180495_p(p_190524_1_);
  20689.  
  20690. try {
  20691. iblockstate.func_189546_a(this, p_190524_1_, p_190524_2_, p_190524_3_);
  20692. } catch (Throwable throwable) {
  20693. CrashReport crashreport = CrashReport.func_85055_a(throwable, "Exception while updating neighbours");
  20694. CrashReportCategory crashreportcategory = crashreport.func_85058_a("Block being updated");
  20695. crashreportcategory.func_189529_a("Source block type", new ICrashReportDetail<String>() {
  20696. public String call() throws Exception {
  20697. try {
  20698. return String.format("ID #%d (%s // %s)", new Object[]{Integer.valueOf(Block.func_149682_b(p_190524_2_)), p_190524_2_.func_149739_a(), p_190524_2_.getClass().getCanonicalName()});
  20699. } catch (Throwable var2) {
  20700. return "ID #" + Block.func_149682_b(p_190524_2_);
  20701. }
  20702. }
  20703. });
  20704. CrashReportCategory.func_175750_a(crashreportcategory, p_190524_1_, iblockstate);
  20705. throw new ReportedException(crashreport);
  20706. }
  20707. }
  20708. }
  20709.  
  20710. public void func_190529_b(BlockPos p_190529_1_, final Block p_190529_2_, BlockPos p_190529_3_) {
  20711. if(!this.field_72995_K) {
  20712. IBlockState iblockstate = this.func_180495_p(p_190529_1_);
  20713. if(iblockstate.func_177230_c() == Blocks.field_190976_dk) {
  20714. try {
  20715. ((BlockObserver)iblockstate.func_177230_c()).func_190962_b(iblockstate, this, p_190529_1_, p_190529_2_, p_190529_3_);
  20716. } catch (Throwable throwable) {
  20717. CrashReport crashreport = CrashReport.func_85055_a(throwable, "Exception while updating neighbours");
  20718. CrashReportCategory crashreportcategory = crashreport.func_85058_a("Block being updated");
  20719. crashreportcategory.func_189529_a("Source block type", new ICrashReportDetail<String>() {
  20720. public String call() throws Exception {
  20721. try {
  20722. return String.format("ID #%d (%s // %s)", new Object[]{Integer.valueOf(Block.func_149682_b(p_190529_2_)), p_190529_2_.func_149739_a(), p_190529_2_.getClass().getCanonicalName()});
  20723. } catch (Throwable var2) {
  20724. return "ID #" + Block.func_149682_b(p_190529_2_);
  20725. }
  20726. }
  20727. });
  20728. CrashReportCategory.func_175750_a(crashreportcategory, p_190529_1_, iblockstate);
  20729. throw new ReportedException(crashreport);
  20730. }
  20731. }
  20732. }
  20733. }
  20734.  
  20735. public boolean func_175691_a(BlockPos p_175691_1_, Block p_175691_2_) {
  20736. return false;
  20737. }
  20738.  
  20739. public boolean func_175678_i(BlockPos p_175678_1_) {
  20740. return this.func_175726_f(p_175678_1_).func_177444_d(p_175678_1_);
  20741. }
  20742.  
  20743. public boolean func_175710_j(BlockPos p_175710_1_) {
  20744. if(p_175710_1_.func_177956_o() >= this.func_181545_F()) {
  20745. return this.func_175678_i(p_175710_1_);
  20746. } else {
  20747. BlockPos blockpos = new BlockPos(p_175710_1_.func_177958_n(), this.func_181545_F(), p_175710_1_.func_177952_p());
  20748. if(!this.func_175678_i(blockpos)) {
  20749. return false;
  20750. } else {
  20751. for(blockpos = blockpos.func_177977_b(); blockpos.func_177956_o() > p_175710_1_.func_177956_o(); blockpos = blockpos.func_177977_b()) {
  20752. IBlockState iblockstate = this.func_180495_p(blockpos);
  20753. if(iblockstate.func_185891_c() > 0 && !iblockstate.func_185904_a().func_76224_d()) {
  20754. return false;
  20755. }
  20756. }
  20757.  
  20758. return true;
  20759. }
  20760. }
  20761. }
  20762.  
  20763. public int func_175699_k(BlockPos p_175699_1_) {
  20764. if(p_175699_1_.func_177956_o() < 0) {
  20765. return 0;
  20766. } else {
  20767. if(p_175699_1_.func_177956_o() >= 256) {
  20768. p_175699_1_ = new BlockPos(p_175699_1_.func_177958_n(), 255, p_175699_1_.func_177952_p());
  20769. }
  20770.  
  20771. return this.func_175726_f(p_175699_1_).func_177443_a(p_175699_1_, 0);
  20772. }
  20773. }
  20774.  
  20775. public int func_175671_l(BlockPos p_175671_1_) {
  20776. return this.func_175721_c(p_175671_1_, true);
  20777. }
  20778.  
  20779. public int func_175721_c(BlockPos p_175721_1_, boolean p_175721_2_) {
  20780. if(p_175721_1_.func_177958_n() >= -30000000 && p_175721_1_.func_177952_p() >= -30000000 && p_175721_1_.func_177958_n() < 30000000 && p_175721_1_.func_177952_p() < 30000000) {
  20781. if(p_175721_2_ && this.func_180495_p(p_175721_1_).func_185916_f()) {
  20782. int i1 = this.func_175721_c(p_175721_1_.func_177984_a(), false);
  20783. int i = this.func_175721_c(p_175721_1_.func_177974_f(), false);
  20784. int j = this.func_175721_c(p_175721_1_.func_177976_e(), false);
  20785. int k = this.func_175721_c(p_175721_1_.func_177968_d(), false);
  20786. int l = this.func_175721_c(p_175721_1_.func_177978_c(), false);
  20787. if(i > i1) {
  20788. i1 = i;
  20789. }
  20790.  
  20791. if(j > i1) {
  20792. i1 = j;
  20793. }
  20794.  
  20795. if(k > i1) {
  20796. i1 = k;
  20797. }
  20798.  
  20799. if(l > i1) {
  20800. i1 = l;
  20801. }
  20802.  
  20803. return i1;
  20804. } else if(p_175721_1_.func_177956_o() < 0) {
  20805. return 0;
  20806. } else {
  20807. if(p_175721_1_.func_177956_o() >= 256) {
  20808. p_175721_1_ = new BlockPos(p_175721_1_.func_177958_n(), 255, p_175721_1_.func_177952_p());
  20809. }
  20810.  
  20811. Chunk chunk = this.func_175726_f(p_175721_1_);
  20812. return chunk.func_177443_a(p_175721_1_, this.field_73008_k);
  20813. }
  20814. } else {
  20815. return 15;
  20816. }
  20817. }
  20818.  
  20819. public BlockPos func_175645_m(BlockPos p_175645_1_) {
  20820. return new BlockPos(p_175645_1_.func_177958_n(), this.func_189649_b(p_175645_1_.func_177958_n(), p_175645_1_.func_177952_p()), p_175645_1_.func_177952_p());
  20821. }
  20822.  
  20823. public int func_189649_b(int p_189649_1_, int p_189649_2_) {
  20824. int i;
  20825. if(p_189649_1_ >= -30000000 && p_189649_2_ >= -30000000 && p_189649_1_ < 30000000 && p_189649_2_ < 30000000) {
  20826. if(this.func_175680_a(p_189649_1_ >> 4, p_189649_2_ >> 4, true)) {
  20827. i = this.func_72964_e(p_189649_1_ >> 4, p_189649_2_ >> 4).func_76611_b(p_189649_1_ & 15, p_189649_2_ & 15);
  20828. } else {
  20829. i = 0;
  20830. }
  20831. } else {
  20832. i = this.func_181545_F() + 1;
  20833. }
  20834.  
  20835. return i;
  20836. }
  20837.  
  20838. @Deprecated
  20839. public int func_82734_g(int p_82734_1_, int p_82734_2_) {
  20840. if(p_82734_1_ >= -30000000 && p_82734_2_ >= -30000000 && p_82734_1_ < 30000000 && p_82734_2_ < 30000000) {
  20841. if(!this.func_175680_a(p_82734_1_ >> 4, p_82734_2_ >> 4, true)) {
  20842. return 0;
  20843. } else {
  20844. Chunk chunk = this.func_72964_e(p_82734_1_ >> 4, p_82734_2_ >> 4);
  20845. return chunk.func_177442_v();
  20846. }
  20847. } else {
  20848. return this.func_181545_F() + 1;
  20849. }
  20850. }
  20851.  
  20852. @SideOnly(Side.CLIENT)
  20853. public int func_175705_a(EnumSkyBlock p_175705_1_, BlockPos p_175705_2_) {
  20854. if(!this.field_73011_w.func_191066_m() && p_175705_1_ == EnumSkyBlock.SKY) {
  20855. return 0;
  20856. } else {
  20857. if(p_175705_2_.func_177956_o() < 0) {
  20858. p_175705_2_ = new BlockPos(p_175705_2_.func_177958_n(), 0, p_175705_2_.func_177952_p());
  20859. }
  20860.  
  20861. if(!this.func_175701_a(p_175705_2_)) {
  20862. return p_175705_1_.field_77198_c;
  20863. } else if(!this.func_175667_e(p_175705_2_)) {
  20864. return p_175705_1_.field_77198_c;
  20865. } else if(this.func_180495_p(p_175705_2_).func_185916_f()) {
  20866. int i1 = this.func_175642_b(p_175705_1_, p_175705_2_.func_177984_a());
  20867. int i = this.func_175642_b(p_175705_1_, p_175705_2_.func_177974_f());
  20868. int j = this.func_175642_b(p_175705_1_, p_175705_2_.func_177976_e());
  20869. int k = this.func_175642_b(p_175705_1_, p_175705_2_.func_177968_d());
  20870. int l = this.func_175642_b(p_175705_1_, p_175705_2_.func_177978_c());
  20871. if(i > i1) {
  20872. i1 = i;
  20873. }
  20874.  
  20875. if(j > i1) {
  20876. i1 = j;
  20877. }
  20878.  
  20879. if(k > i1) {
  20880. i1 = k;
  20881. }
  20882.  
  20883. if(l > i1) {
  20884. i1 = l;
  20885. }
  20886.  
  20887. return i1;
  20888. } else {
  20889. Chunk chunk = this.func_175726_f(p_175705_2_);
  20890. return chunk.func_177413_a(p_175705_1_, p_175705_2_);
  20891. }
  20892. }
  20893. }
  20894.  
  20895. public int func_175642_b(EnumSkyBlock p_175642_1_, BlockPos p_175642_2_) {
  20896. if(p_175642_2_.func_177956_o() < 0) {
  20897. p_175642_2_ = new BlockPos(p_175642_2_.func_177958_n(), 0, p_175642_2_.func_177952_p());
  20898. }
  20899.  
  20900. if(!this.func_175701_a(p_175642_2_)) {
  20901. return p_175642_1_.field_77198_c;
  20902. } else if(!this.func_175667_e(p_175642_2_)) {
  20903. return p_175642_1_.field_77198_c;
  20904. } else {
  20905. Chunk chunk = this.func_175726_f(p_175642_2_);
  20906. return chunk.func_177413_a(p_175642_1_, p_175642_2_);
  20907. }
  20908. }
  20909.  
  20910. public void func_175653_a(EnumSkyBlock p_175653_1_, BlockPos p_175653_2_, int p_175653_3_) {
  20911. if(this.func_175701_a(p_175653_2_)) {
  20912. if(this.func_175667_e(p_175653_2_)) {
  20913. Chunk chunk = this.func_175726_f(p_175653_2_);
  20914. chunk.func_177431_a(p_175653_1_, p_175653_2_, p_175653_3_);
  20915. this.func_175679_n(p_175653_2_);
  20916. }
  20917. }
  20918. }
  20919.  
  20920. public void func_175679_n(BlockPos p_175679_1_) {
  20921. for(int i = 0; i < this.field_73021_x.size(); ++i) {
  20922. ((IWorldEventListener)this.field_73021_x.get(i)).func_174959_b(p_175679_1_);
  20923. }
  20924.  
  20925. }
  20926.  
  20927. @SideOnly(Side.CLIENT)
  20928. public int func_175626_b(BlockPos p_175626_1_, int p_175626_2_) {
  20929. int i = this.func_175705_a(EnumSkyBlock.SKY, p_175626_1_);
  20930. int j = this.func_175705_a(EnumSkyBlock.BLOCK, p_175626_1_);
  20931. if(j < p_175626_2_) {
  20932. j = p_175626_2_;
  20933. }
  20934.  
  20935. return i << 20 | j << 4;
  20936. }
  20937.  
  20938. public float func_175724_o(BlockPos p_175724_1_) {
  20939. return this.field_73011_w.func_177497_p()[this.func_175671_l(p_175724_1_)];
  20940. }
  20941.  
  20942. public IBlockState func_180495_p(BlockPos p_180495_1_) {
  20943. if(this.func_189509_E(p_180495_1_)) {
  20944. return Blocks.field_150350_a.func_176223_P();
  20945. } else {
  20946. Chunk chunk = this.func_175726_f(p_180495_1_);
  20947. return chunk.func_177435_g(p_180495_1_);
  20948. }
  20949. }
  20950.  
  20951. public boolean func_72935_r() {
  20952. return this.field_73008_k < 4;
  20953. }
  20954.  
  20955. @Nullable
  20956. public RayTraceResult func_72933_a(Vec3d p_72933_1_, Vec3d p_72933_2_) {
  20957. return this.func_147447_a(p_72933_1_, p_72933_2_, false, false, false);
  20958. }
  20959.  
  20960. @Nullable
  20961. public RayTraceResult func_72901_a(Vec3d p_72901_1_, Vec3d p_72901_2_, boolean p_72901_3_) {
  20962. return this.func_147447_a(p_72901_1_, p_72901_2_, p_72901_3_, false, false);
  20963. }
  20964.  
  20965. @Nullable
  20966. public RayTraceResult func_147447_a(Vec3d p_147447_1_, Vec3d p_147447_2_, boolean p_147447_3_, boolean p_147447_4_, boolean p_147447_5_) {
  20967. if(!Double.isNaN(p_147447_1_.field_72450_a) && !Double.isNaN(p_147447_1_.field_72448_b) && !Double.isNaN(p_147447_1_.field_72449_c)) {
  20968. if(!Double.isNaN(p_147447_2_.field_72450_a) && !Double.isNaN(p_147447_2_.field_72448_b) && !Double.isNaN(p_147447_2_.field_72449_c)) {
  20969. int i = MathHelper.func_76128_c(p_147447_2_.field_72450_a);
  20970. int j = MathHelper.func_76128_c(p_147447_2_.field_72448_b);
  20971. int k = MathHelper.func_76128_c(p_147447_2_.field_72449_c);
  20972. int l = MathHelper.func_76128_c(p_147447_1_.field_72450_a);
  20973. int i1 = MathHelper.func_76128_c(p_147447_1_.field_72448_b);
  20974. int j1 = MathHelper.func_76128_c(p_147447_1_.field_72449_c);
  20975. BlockPos blockpos = new BlockPos(l, i1, j1);
  20976. IBlockState iblockstate = this.func_180495_p(blockpos);
  20977. Block block = iblockstate.func_177230_c();
  20978. if((!p_147447_4_ || iblockstate.func_185890_d(this, blockpos) != Block.field_185506_k) && block.func_176209_a(iblockstate, p_147447_3_)) {
  20979. RayTraceResult raytraceresult = iblockstate.func_185910_a(this, blockpos, p_147447_1_, p_147447_2_);
  20980. if(raytraceresult != null) {
  20981. return raytraceresult;
  20982. }
  20983. }
  20984.  
  20985. RayTraceResult raytraceresult2 = null;
  20986. int k1 = 200;
  20987.  
  20988. while(k1-- >= 0) {
  20989. if(Double.isNaN(p_147447_1_.field_72450_a) || Double.isNaN(p_147447_1_.field_72448_b) || Double.isNaN(p_147447_1_.field_72449_c)) {
  20990. return null;
  20991. }
  20992.  
  20993. if(l == i && i1 == j && j1 == k) {
  20994. return p_147447_5_?raytraceresult2:null;
  20995. }
  20996.  
  20997. boolean flag2 = true;
  20998. boolean flag = true;
  20999. boolean flag1 = true;
  21000. double d0 = 999.0D;
  21001. double d1 = 999.0D;
  21002. double d2 = 999.0D;
  21003. if(i > l) {
  21004. d0 = (double)l + 1.0D;
  21005. } else if(i < l) {
  21006. d0 = (double)l + 0.0D;
  21007. } else {
  21008. flag2 = false;
  21009. }
  21010.  
  21011. if(j > i1) {
  21012. d1 = (double)i1 + 1.0D;
  21013. } else if(j < i1) {
  21014. d1 = (double)i1 + 0.0D;
  21015. } else {
  21016. flag = false;
  21017. }
  21018.  
  21019. if(k > j1) {
  21020. d2 = (double)j1 + 1.0D;
  21021. } else if(k < j1) {
  21022. d2 = (double)j1 + 0.0D;
  21023. } else {
  21024. flag1 = false;
  21025. }
  21026.  
  21027. double d3 = 999.0D;
  21028. double d4 = 999.0D;
  21029. double d5 = 999.0D;
  21030. double d6 = p_147447_2_.field_72450_a - p_147447_1_.field_72450_a;
  21031. double d7 = p_147447_2_.field_72448_b - p_147447_1_.field_72448_b;
  21032. double d8 = p_147447_2_.field_72449_c - p_147447_1_.field_72449_c;
  21033. if(flag2) {
  21034. d3 = (d0 - p_147447_1_.field_72450_a) / d6;
  21035. }
  21036.  
  21037. if(flag) {
  21038. d4 = (d1 - p_147447_1_.field_72448_b) / d7;
  21039. }
  21040.  
  21041. if(flag1) {
  21042. d5 = (d2 - p_147447_1_.field_72449_c) / d8;
  21043. }
  21044.  
  21045. if(d3 == -0.0D) {
  21046. d3 = -1.0E-4D;
  21047. }
  21048.  
  21049. if(d4 == -0.0D) {
  21050. d4 = -1.0E-4D;
  21051. }
  21052.  
  21053. if(d5 == -0.0D) {
  21054. d5 = -1.0E-4D;
  21055. }
  21056.  
  21057. EnumFacing enumfacing;
  21058. if(d3 < d4 && d3 < d5) {
  21059. enumfacing = i > l?EnumFacing.WEST:EnumFacing.EAST;
  21060. p_147447_1_ = new Vec3d(d0, p_147447_1_.field_72448_b + d7 * d3, p_147447_1_.field_72449_c + d8 * d3);
  21061. } else if(d4 < d5) {
  21062. enumfacing = j > i1?EnumFacing.DOWN:EnumFacing.UP;
  21063. p_147447_1_ = new Vec3d(p_147447_1_.field_72450_a + d6 * d4, d1, p_147447_1_.field_72449_c + d8 * d4);
  21064. } else {
  21065. enumfacing = k > j1?EnumFacing.NORTH:EnumFacing.SOUTH;
  21066. p_147447_1_ = new Vec3d(p_147447_1_.field_72450_a + d6 * d5, p_147447_1_.field_72448_b + d7 * d5, d2);
  21067. }
  21068.  
  21069. l = MathHelper.func_76128_c(p_147447_1_.field_72450_a) - (enumfacing == EnumFacing.EAST?1:0);
  21070. i1 = MathHelper.func_76128_c(p_147447_1_.field_72448_b) - (enumfacing == EnumFacing.UP?1:0);
  21071. j1 = MathHelper.func_76128_c(p_147447_1_.field_72449_c) - (enumfacing == EnumFacing.SOUTH?1:0);
  21072. blockpos = new BlockPos(l, i1, j1);
  21073. IBlockState iblockstate1 = this.func_180495_p(blockpos);
  21074. Block block1 = iblockstate1.func_177230_c();
  21075. if(!p_147447_4_ || iblockstate1.func_185904_a() == Material.field_151567_E || iblockstate1.func_185890_d(this, blockpos) != Block.field_185506_k) {
  21076. if(block1.func_176209_a(iblockstate1, p_147447_3_)) {
  21077. RayTraceResult raytraceresult1 = iblockstate1.func_185910_a(this, blockpos, p_147447_1_, p_147447_2_);
  21078. if(raytraceresult1 != null) {
  21079. return raytraceresult1;
  21080. }
  21081. } else {
  21082. raytraceresult2 = new RayTraceResult(RayTraceResult.Type.MISS, p_147447_1_, enumfacing, blockpos);
  21083. }
  21084. }
  21085. }
  21086.  
  21087. return p_147447_5_?raytraceresult2:null;
  21088. } else {
  21089. return null;
  21090. }
  21091. } else {
  21092. return null;
  21093. }
  21094. }
  21095.  
  21096. public void func_184133_a(@Nullable EntityPlayer p_184133_1_, BlockPos p_184133_2_, SoundEvent p_184133_3_, SoundCategory p_184133_4_, float p_184133_5_, float p_184133_6_) {
  21097. this.func_184148_a(p_184133_1_, (double)p_184133_2_.func_177958_n() + 0.5D, (double)p_184133_2_.func_177956_o() + 0.5D, (double)p_184133_2_.func_177952_p() + 0.5D, p_184133_3_, p_184133_4_, p_184133_5_, p_184133_6_);
  21098. }
  21099.  
  21100. public void func_184148_a(@Nullable EntityPlayer p_184148_1_, double p_184148_2_, double p_184148_4_, double p_184148_6_, SoundEvent p_184148_8_, SoundCategory p_184148_9_, float p_184148_10_, float p_184148_11_) {
  21101. for(int i = 0; i < this.field_73021_x.size(); ++i) {
  21102. ((IWorldEventListener)this.field_73021_x.get(i)).func_184375_a(p_184148_1_, p_184148_8_, p_184148_9_, p_184148_2_, p_184148_4_, p_184148_6_, p_184148_10_, p_184148_11_);
  21103. }
  21104.  
  21105. }
  21106.  
  21107. public void func_184134_a(double p_184134_1_, double p_184134_3_, double p_184134_5_, SoundEvent p_184134_7_, SoundCategory p_184134_8_, float p_184134_9_, float p_184134_10_, boolean p_184134_11_) {
  21108. }
  21109.  
  21110. public void func_184149_a(BlockPos p_184149_1_, @Nullable SoundEvent p_184149_2_) {
  21111. for(int i = 0; i < this.field_73021_x.size(); ++i) {
  21112. ((IWorldEventListener)this.field_73021_x.get(i)).func_184377_a(p_184149_2_, p_184149_1_);
  21113. }
  21114.  
  21115. }
  21116.  
  21117. public void func_175688_a(EnumParticleTypes p_175688_1_, double p_175688_2_, double p_175688_4_, double p_175688_6_, double p_175688_8_, double p_175688_10_, double p_175688_12_, int... p_175688_14_) {
  21118. this.func_175720_a(p_175688_1_.func_179348_c(), p_175688_1_.func_179344_e(), p_175688_2_, p_175688_4_, p_175688_6_, p_175688_8_, p_175688_10_, p_175688_12_, p_175688_14_);
  21119. }
  21120.  
  21121. public void func_190523_a(int p_190523_1_, double p_190523_2_, double p_190523_4_, double p_190523_6_, double p_190523_8_, double p_190523_10_, double p_190523_12_, int... p_190523_14_) {
  21122. for(int i = 0; i < this.field_73021_x.size(); ++i) {
  21123. ((IWorldEventListener)this.field_73021_x.get(i)).func_190570_a(p_190523_1_, false, true, p_190523_2_, p_190523_4_, p_190523_6_, p_190523_8_, p_190523_10_, p_190523_12_, p_190523_14_);
  21124. }
  21125.  
  21126. }
  21127.  
  21128. @SideOnly(Side.CLIENT)
  21129. public void func_175682_a(EnumParticleTypes p_175682_1_, boolean p_175682_2_, double p_175682_3_, double p_175682_5_, double p_175682_7_, double p_175682_9_, double p_175682_11_, double p_175682_13_, int... p_175682_15_) {
  21130. this.func_175720_a(p_175682_1_.func_179348_c(), p_175682_1_.func_179344_e() || p_175682_2_, p_175682_3_, p_175682_5_, p_175682_7_, p_175682_9_, p_175682_11_, p_175682_13_, p_175682_15_);
  21131. }
  21132.  
  21133. private void func_175720_a(int p_175720_1_, boolean p_175720_2_, double p_175720_3_, double p_175720_5_, double p_175720_7_, double p_175720_9_, double p_175720_11_, double p_175720_13_, int... p_175720_15_) {
  21134. for(int i = 0; i < this.field_73021_x.size(); ++i) {
  21135. ((IWorldEventListener)this.field_73021_x.get(i)).func_180442_a(p_175720_1_, p_175720_2_, p_175720_3_, p_175720_5_, p_175720_7_, p_175720_9_, p_175720_11_, p_175720_13_, p_175720_15_);
  21136. }
  21137.  
  21138. }
  21139.  
  21140. public boolean func_72942_c(Entity p_72942_1_) {
  21141. this.field_73007_j.add(p_72942_1_);
  21142. return true;
  21143. }
  21144.  
  21145. public boolean func_72838_d(Entity p_72838_1_) {
  21146. int i = MathHelper.func_76128_c(p_72838_1_.field_70165_t / 16.0D);
  21147. int j = MathHelper.func_76128_c(p_72838_1_.field_70161_v / 16.0D);
  21148. boolean flag = p_72838_1_.field_98038_p;
  21149. if(p_72838_1_ instanceof EntityPlayer) {
  21150. flag = true;
  21151. }
  21152.  
  21153. if(!flag && !this.func_175680_a(i, j, false)) {
  21154. return false;
  21155. } else {
  21156. if(p_72838_1_ instanceof EntityPlayer) {
  21157. EntityPlayer entityplayer = (EntityPlayer)p_72838_1_;
  21158. this.field_73010_i.add(entityplayer);
  21159. this.func_72854_c();
  21160. }
  21161.  
  21162. this.func_72964_e(i, j).func_76612_a(p_72838_1_);
  21163. this.field_72996_f.add(p_72838_1_);
  21164. this.func_72923_a(p_72838_1_);
  21165. return true;
  21166. }
  21167. }
  21168.  
  21169. public void func_72923_a(Entity p_72923_1_) {
  21170. for(int i = 0; i < this.field_73021_x.size(); ++i) {
  21171. ((IWorldEventListener)this.field_73021_x.get(i)).func_72703_a(p_72923_1_);
  21172. }
  21173.  
  21174. }
  21175.  
  21176. public void func_72847_b(Entity p_72847_1_) {
  21177. for(int i = 0; i < this.field_73021_x.size(); ++i) {
  21178. ((IWorldEventListener)this.field_73021_x.get(i)).func_72709_b(p_72847_1_);
  21179. }
  21180.  
  21181. }
  21182.  
  21183. public void func_72900_e(Entity p_72900_1_) {
  21184. if(p_72900_1_.func_184207_aI()) {
  21185. p_72900_1_.func_184226_ay();
  21186. }
  21187.  
  21188. if(p_72900_1_.func_184218_aH()) {
  21189. p_72900_1_.func_184210_p();
  21190. }
  21191.  
  21192. p_72900_1_.func_70106_y();
  21193. if(p_72900_1_ instanceof EntityPlayer) {
  21194. this.field_73010_i.remove(p_72900_1_);
  21195. this.func_72854_c();
  21196. this.func_72847_b(p_72900_1_);
  21197. }
  21198.  
  21199. }
  21200.  
  21201. public void func_72973_f(Entity p_72973_1_) {
  21202. p_72973_1_.func_184174_b(false);
  21203. p_72973_1_.func_70106_y();
  21204. if(p_72973_1_ instanceof EntityPlayer) {
  21205. this.field_73010_i.remove(p_72973_1_);
  21206. this.func_72854_c();
  21207. }
  21208.  
  21209. int i = p_72973_1_.field_70176_ah;
  21210. int j = p_72973_1_.field_70164_aj;
  21211. if(p_72973_1_.field_70175_ag && this.func_175680_a(i, j, true)) {
  21212. this.func_72964_e(i, j).func_76622_b(p_72973_1_);
  21213. }
  21214.  
  21215. this.field_72996_f.remove(p_72973_1_);
  21216. this.func_72847_b(p_72973_1_);
  21217. }
  21218.  
  21219. public void func_72954_a(IWorldEventListener p_72954_1_) {
  21220. this.field_73021_x.add(p_72954_1_);
  21221. }
  21222.  
  21223. private boolean func_191504_a(@Nullable Entity p_191504_1_, AxisAlignedBB p_191504_2_, boolean p_191504_3_, @Nullable List<AxisAlignedBB> p_191504_4_) {
  21224. int i = MathHelper.func_76128_c(p_191504_2_.field_72340_a) - 1;
  21225. int j = MathHelper.func_76143_f(p_191504_2_.field_72336_d) + 1;
  21226. int k = MathHelper.func_76128_c(p_191504_2_.field_72338_b) - 1;
  21227. int l = MathHelper.func_76143_f(p_191504_2_.field_72337_e) + 1;
  21228. int i1 = MathHelper.func_76128_c(p_191504_2_.field_72339_c) - 1;
  21229. int j1 = MathHelper.func_76143_f(p_191504_2_.field_72334_f) + 1;
  21230. WorldBorder worldborder = this.func_175723_af();
  21231. boolean flag = p_191504_1_ != null && p_191504_1_.func_174832_aS();
  21232. boolean flag1 = p_191504_1_ != null && this.func_191503_g(p_191504_1_);
  21233. IBlockState iblockstate = Blocks.field_150348_b.func_176223_P();
  21234. BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
  21235.  
  21236. try {
  21237. for(int k1 = i; k1 < j; ++k1) {
  21238. for(int l1 = i1; l1 < j1; ++l1) {
  21239. boolean flag2 = k1 == i || k1 == j - 1;
  21240. boolean flag3 = l1 == i1 || l1 == j1 - 1;
  21241. if((!flag2 || !flag3) && this.func_175667_e(blockpos$pooledmutableblockpos.func_181079_c(k1, 64, l1))) {
  21242. for(int i2 = k; i2 < l; ++i2) {
  21243. if(!flag2 && !flag3 || i2 != l - 1) {
  21244. if(p_191504_3_) {
  21245. if(k1 < -30000000 || k1 >= 30000000 || l1 < -30000000 || l1 >= 30000000) {
  21246. boolean lvt_21_1_ = true;
  21247. return lvt_21_1_;
  21248. }
  21249. } else if(p_191504_1_ != null && flag == flag1) {
  21250. p_191504_1_.func_174821_h(!flag1);
  21251. }
  21252.  
  21253. blockpos$pooledmutableblockpos.func_181079_c(k1, i2, l1);
  21254. IBlockState iblockstate1;
  21255. if(!p_191504_3_ && !worldborder.func_177746_a(blockpos$pooledmutableblockpos) && flag1) {
  21256. iblockstate1 = iblockstate;
  21257. } else {
  21258. iblockstate1 = this.func_180495_p(blockpos$pooledmutableblockpos);
  21259. }
  21260.  
  21261. iblockstate1.func_185908_a(this, blockpos$pooledmutableblockpos, p_191504_2_, p_191504_4_, p_191504_1_, false);
  21262. if(p_191504_3_ && !p_191504_4_.isEmpty()) {
  21263. boolean flag5 = true;
  21264. return flag5;
  21265. }
  21266. }
  21267. }
  21268. }
  21269. }
  21270. }
  21271. } finally {
  21272. blockpos$pooledmutableblockpos.func_185344_t();
  21273. }
  21274.  
  21275. return !p_191504_4_.isEmpty();
  21276. }
  21277.  
  21278. public List<AxisAlignedBB> func_184144_a(@Nullable Entity p_184144_1_, AxisAlignedBB p_184144_2_) {
  21279. List<AxisAlignedBB> list = Lists.<AxisAlignedBB>newArrayList();
  21280. this.func_191504_a(p_184144_1_, p_184144_2_, false, list);
  21281. if(p_184144_1_ != null) {
  21282. List<Entity> list1 = this.func_72839_b(p_184144_1_, p_184144_2_.func_186662_g(0.25D));
  21283.  
  21284. for(int i = 0; i < list1.size(); ++i) {
  21285. Entity entity = (Entity)list1.get(i);
  21286. if(!p_184144_1_.func_184223_x(entity)) {
  21287. AxisAlignedBB axisalignedbb = entity.func_70046_E();
  21288. if(axisalignedbb != null && axisalignedbb.func_72326_a(p_184144_2_)) {
  21289. list.add(axisalignedbb);
  21290. }
  21291.  
  21292. axisalignedbb = p_184144_1_.func_70114_g(entity);
  21293. if(axisalignedbb != null && axisalignedbb.func_72326_a(p_184144_2_)) {
  21294. list.add(axisalignedbb);
  21295. }
  21296. }
  21297. }
  21298. }
  21299.  
  21300. return list;
  21301. }
  21302.  
  21303. @SideOnly(Side.CLIENT)
  21304. public void func_72848_b(IWorldEventListener p_72848_1_) {
  21305. this.field_73021_x.remove(p_72848_1_);
  21306. }
  21307.  
  21308. public boolean func_191503_g(Entity p_191503_1_) {
  21309. double d0 = this.field_175728_M.func_177726_b();
  21310. double d1 = this.field_175728_M.func_177736_c();
  21311. double d2 = this.field_175728_M.func_177728_d();
  21312. double d3 = this.field_175728_M.func_177733_e();
  21313. if(p_191503_1_.func_174832_aS()) {
  21314. ++d0;
  21315. ++d1;
  21316. --d2;
  21317. --d3;
  21318. } else {
  21319. --d0;
  21320. --d1;
  21321. ++d2;
  21322. ++d3;
  21323. }
  21324.  
  21325. return p_191503_1_.field_70165_t > d0 && p_191503_1_.field_70165_t < d2 && p_191503_1_.field_70161_v > d1 && p_191503_1_.field_70161_v < d3;
  21326. }
  21327.  
  21328. public boolean func_184143_b(AxisAlignedBB p_184143_1_) {
  21329. return this.func_191504_a((Entity)null, p_184143_1_, true, Lists.<AxisAlignedBB>newArrayList());
  21330. }
  21331.  
  21332. public int func_72967_a(float p_72967_1_) {
  21333. float f = this.func_72826_c(p_72967_1_);
  21334. float f1 = 1.0F - (MathHelper.func_76134_b(f * 6.2831855F) * 2.0F + 0.5F);
  21335. f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F);
  21336. f1 = 1.0F - f1;
  21337. f1 = (float)((double)f1 * (1.0D - (double)(this.func_72867_j(p_72967_1_) * 5.0F) / 16.0D));
  21338. f1 = (float)((double)f1 * (1.0D - (double)(this.func_72819_i(p_72967_1_) * 5.0F) / 16.0D));
  21339. f1 = 1.0F - f1;
  21340. return (int)(f1 * 11.0F);
  21341. }
  21342.  
  21343. @SideOnly(Side.CLIENT)
  21344. public float func_72971_b(float p_72971_1_) {
  21345. float f = this.func_72826_c(p_72971_1_);
  21346. float f1 = 1.0F - (MathHelper.func_76134_b(f * 6.2831855F) * 2.0F + 0.2F);
  21347. f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F);
  21348. f1 = 1.0F - f1;
  21349. f1 = (float)((double)f1 * (1.0D - (double)(this.func_72867_j(p_72971_1_) * 5.0F) / 16.0D));
  21350. f1 = (float)((double)f1 * (1.0D - (double)(this.func_72819_i(p_72971_1_) * 5.0F) / 16.0D));
  21351. return f1 * 0.8F + 0.2F;
  21352. }
  21353.  
  21354. @SideOnly(Side.CLIENT)
  21355. public Vec3d func_72833_a(Entity p_72833_1_, float p_72833_2_) {
  21356. float f = this.func_72826_c(p_72833_2_);
  21357. float f1 = MathHelper.func_76134_b(f * 6.2831855F) * 2.0F + 0.5F;
  21358. f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F);
  21359. int i = MathHelper.func_76128_c(p_72833_1_.field_70165_t);
  21360. int j = MathHelper.func_76128_c(p_72833_1_.field_70163_u);
  21361. int k = MathHelper.func_76128_c(p_72833_1_.field_70161_v);
  21362. BlockPos blockpos = new BlockPos(i, j, k);
  21363. Biome biome = this.func_180494_b(blockpos);
  21364. float f2 = biome.func_180626_a(blockpos);
  21365. int l = biome.func_76731_a(f2);
  21366. float f3 = (float)(l >> 16 & 255) / 255.0F;
  21367. float f4 = (float)(l >> 8 & 255) / 255.0F;
  21368. float f5 = (float)(l & 255) / 255.0F;
  21369. f3 = f3 * f1;
  21370. f4 = f4 * f1;
  21371. f5 = f5 * f1;
  21372. float f6 = this.func_72867_j(p_72833_2_);
  21373. if(f6 > 0.0F) {
  21374. float f7 = (f3 * 0.3F + f4 * 0.59F + f5 * 0.11F) * 0.6F;
  21375. float f8 = 1.0F - f6 * 0.75F;
  21376. f3 = f3 * f8 + f7 * (1.0F - f8);
  21377. f4 = f4 * f8 + f7 * (1.0F - f8);
  21378. f5 = f5 * f8 + f7 * (1.0F - f8);
  21379. }
  21380.  
  21381. float f10 = this.func_72819_i(p_72833_2_);
  21382. if(f10 > 0.0F) {
  21383. float f11 = (f3 * 0.3F + f4 * 0.59F + f5 * 0.11F) * 0.2F;
  21384. float f9 = 1.0F - f10 * 0.75F;
  21385. f3 = f3 * f9 + f11 * (1.0F - f9);
  21386. f4 = f4 * f9 + f11 * (1.0F - f9);
  21387. f5 = f5 * f9 + f11 * (1.0F - f9);
  21388. }
  21389.  
  21390. if(this.field_73016_r > 0) {
  21391. float f12 = (float)this.field_73016_r - p_72833_2_;
  21392. if(f12 > 1.0F) {
  21393. f12 = 1.0F;
  21394. }
  21395.  
  21396. f12 = f12 * 0.45F;
  21397. f3 = f3 * (1.0F - f12) + 0.8F * f12;
  21398. f4 = f4 * (1.0F - f12) + 0.8F * f12;
  21399. f5 = f5 * (1.0F - f12) + 1.0F * f12;
  21400. }
  21401.  
  21402. return new Vec3d((double)f3, (double)f4, (double)f5);
  21403. }
  21404.  
  21405. public float func_72826_c(float p_72826_1_) {
  21406. return this.field_73011_w.func_76563_a(this.field_72986_A.func_76073_f(), p_72826_1_);
  21407. }
  21408.  
  21409. @SideOnly(Side.CLIENT)
  21410. public int func_72853_d() {
  21411. return this.field_73011_w.func_76559_b(this.field_72986_A.func_76073_f());
  21412. }
  21413.  
  21414. public float func_130001_d() {
  21415. return WorldProvider.field_111203_a[this.field_73011_w.func_76559_b(this.field_72986_A.func_76073_f())];
  21416. }
  21417.  
  21418. public float func_72929_e(float p_72929_1_) {
  21419. float f = this.func_72826_c(p_72929_1_);
  21420. return f * 6.2831855F;
  21421. }
  21422.  
  21423. @SideOnly(Side.CLIENT)
  21424. public Vec3d func_72824_f(float p_72824_1_) {
  21425. float f = this.func_72826_c(p_72824_1_);
  21426. float f1 = MathHelper.func_76134_b(f * 6.2831855F) * 2.0F + 0.5F;
  21427. f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F);
  21428. float f2 = 1.0F;
  21429. float f3 = 1.0F;
  21430. float f4 = 1.0F;
  21431. float f5 = this.func_72867_j(p_72824_1_);
  21432. if(f5 > 0.0F) {
  21433. float f6 = (f2 * 0.3F + f3 * 0.59F + f4 * 0.11F) * 0.6F;
  21434. float f7 = 1.0F - f5 * 0.95F;
  21435. f2 = f2 * f7 + f6 * (1.0F - f7);
  21436. f3 = f3 * f7 + f6 * (1.0F - f7);
  21437. f4 = f4 * f7 + f6 * (1.0F - f7);
  21438. }
  21439.  
  21440. f2 = f2 * (f1 * 0.9F + 0.1F);
  21441. f3 = f3 * (f1 * 0.9F + 0.1F);
  21442. f4 = f4 * (f1 * 0.85F + 0.15F);
  21443. float f9 = this.func_72819_i(p_72824_1_);
  21444. if(f9 > 0.0F) {
  21445. float f10 = (f2 * 0.3F + f3 * 0.59F + f4 * 0.11F) * 0.2F;
  21446. float f8 = 1.0F - f9 * 0.95F;
  21447. f2 = f2 * f8 + f10 * (1.0F - f8);
  21448. f3 = f3 * f8 + f10 * (1.0F - f8);
  21449. f4 = f4 * f8 + f10 * (1.0F - f8);
  21450. }
  21451.  
  21452. return new Vec3d((double)f2, (double)f3, (double)f4);
  21453. }
  21454.  
  21455. @SideOnly(Side.CLIENT)
  21456. public Vec3d func_72948_g(float p_72948_1_) {
  21457. float f = this.func_72826_c(p_72948_1_);
  21458. return this.field_73011_w.func_76562_b(f, p_72948_1_);
  21459. }
  21460.  
  21461. public BlockPos func_175725_q(BlockPos p_175725_1_) {
  21462. return this.func_175726_f(p_175725_1_).func_177440_h(p_175725_1_);
  21463. }
  21464.  
  21465. public BlockPos func_175672_r(BlockPos p_175672_1_) {
  21466. Chunk chunk = this.func_175726_f(p_175672_1_);
  21467.  
  21468. BlockPos blockpos;
  21469. BlockPos blockpos1;
  21470. for(blockpos = new BlockPos(p_175672_1_.func_177958_n(), chunk.func_76625_h() + 16, p_175672_1_.func_177952_p()); blockpos.func_177956_o() >= 0; blockpos = blockpos1) {
  21471. blockpos1 = blockpos.func_177977_b();
  21472. Material material = chunk.func_177435_g(blockpos1).func_185904_a();
  21473. if(material.func_76230_c() && material != Material.field_151584_j) {
  21474. break;
  21475. }
  21476. }
  21477.  
  21478. return blockpos;
  21479. }
  21480.  
  21481. @SideOnly(Side.CLIENT)
  21482. public float func_72880_h(float p_72880_1_) {
  21483. float f = this.func_72826_c(p_72880_1_);
  21484. float f1 = 1.0F - (MathHelper.func_76134_b(f * 6.2831855F) * 2.0F + 0.25F);
  21485. f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F);
  21486. return f1 * f1 * 0.5F;
  21487. }
  21488.  
  21489. public boolean func_184145_b(BlockPos p_184145_1_, Block p_184145_2_) {
  21490. return true;
  21491. }
  21492.  
  21493. public void func_175684_a(BlockPos p_175684_1_, Block p_175684_2_, int p_175684_3_) {
  21494. }
  21495.  
  21496. public void func_175654_a(BlockPos p_175654_1_, Block p_175654_2_, int p_175654_3_, int p_175654_4_) {
  21497. }
  21498.  
  21499. public void func_180497_b(BlockPos p_180497_1_, Block p_180497_2_, int p_180497_3_, int p_180497_4_) {
  21500. }
  21501.  
  21502. public void func_72939_s() {
  21503. this.field_72984_F.func_76320_a("entities");
  21504. this.field_72984_F.func_76320_a("global");
  21505.  
  21506. for(int i = 0; i < this.field_73007_j.size(); ++i) {
  21507. Entity entity = (Entity)this.field_73007_j.get(i);
  21508.  
  21509. try {
  21510. ++entity.field_70173_aa;
  21511. entity.func_70071_h_();
  21512. } catch (Throwable throwable2) {
  21513. CrashReport crashreport = CrashReport.func_85055_a(throwable2, "Ticking entity");
  21514. CrashReportCategory crashreportcategory = crashreport.func_85058_a("Entity being ticked");
  21515. if(entity == null) {
  21516. crashreportcategory.func_71507_a("Entity", "~~NULL~~");
  21517. } else {
  21518. entity.func_85029_a(crashreportcategory);
  21519. }
  21520.  
  21521. throw new ReportedException(crashreport);
  21522. }
  21523.  
  21524. if(entity.field_70128_L) {
  21525. this.field_73007_j.remove(i--);
  21526. }
  21527. }
  21528.  
  21529. this.field_72984_F.func_76318_c("remove");
  21530. this.field_72996_f.removeAll(this.field_72997_g);
  21531.  
  21532. for(int k = 0; k < this.field_72997_g.size(); ++k) {
  21533. Entity entity1 = (Entity)this.field_72997_g.get(k);
  21534. int j = entity1.field_70176_ah;
  21535. int k1 = entity1.field_70164_aj;
  21536. if(entity1.field_70175_ag && this.func_175680_a(j, k1, true)) {
  21537. this.func_72964_e(j, k1).func_76622_b(entity1);
  21538. }
  21539. }
  21540.  
  21541. for(int l = 0; l < this.field_72997_g.size(); ++l) {
  21542. this.func_72847_b((Entity)this.field_72997_g.get(l));
  21543. }
  21544.  
  21545. this.field_72997_g.clear();
  21546. this.func_184147_l();
  21547. this.field_72984_F.func_76318_c("regular");
  21548.  
  21549. for(int i1 = 0; i1 < this.field_72996_f.size(); ++i1) {
  21550. Entity entity2 = (Entity)this.field_72996_f.get(i1);
  21551. Entity entity3 = entity2.func_184187_bx();
  21552. if(entity3 != null) {
  21553. if(!entity3.field_70128_L && entity3.func_184196_w(entity2)) {
  21554. continue;
  21555. }
  21556.  
  21557. entity2.func_184210_p();
  21558. }
  21559.  
  21560. this.field_72984_F.func_76320_a("tick");
  21561. if(!entity2.field_70128_L && !(entity2 instanceof EntityPlayerMP)) {
  21562. try {
  21563. this.func_72870_g(entity2);
  21564. } catch (Throwable throwable1) {
  21565. CrashReport crashreport1 = CrashReport.func_85055_a(throwable1, "Ticking entity");
  21566. CrashReportCategory crashreportcategory1 = crashreport1.func_85058_a("Entity being ticked");
  21567. entity2.func_85029_a(crashreportcategory1);
  21568. throw new ReportedException(crashreport1);
  21569. }
  21570. }
  21571.  
  21572. this.field_72984_F.func_76319_b();
  21573. this.field_72984_F.func_76320_a("remove");
  21574. if(entity2.field_70128_L) {
  21575. int l1 = entity2.field_70176_ah;
  21576. int i2 = entity2.field_70164_aj;
  21577. if(entity2.field_70175_ag && this.func_175680_a(l1, i2, true)) {
  21578. this.func_72964_e(l1, i2).func_76622_b(entity2);
  21579. }
  21580.  
  21581. this.field_72996_f.remove(i1--);
  21582. this.func_72847_b(entity2);
  21583. }
  21584.  
  21585. this.field_72984_F.func_76319_b();
  21586. }
  21587.  
  21588. this.field_72984_F.func_76318_c("blockEntities");
  21589. this.field_147481_N = true;
  21590. Iterator<TileEntity> iterator = this.field_175730_i.iterator();
  21591.  
  21592. while(iterator.hasNext()) {
  21593. TileEntity tileentity = (TileEntity)iterator.next();
  21594. if(!tileentity.func_145837_r() && tileentity.func_145830_o()) {
  21595. BlockPos blockpos = tileentity.func_174877_v();
  21596. if(this.func_175667_e(blockpos) && this.field_175728_M.func_177746_a(blockpos)) {
  21597. try {
  21598. this.field_72984_F.func_76320_a(tileentity.getClass().getSimpleName());
  21599. ((ITickable)tileentity).func_73660_a();
  21600. this.field_72984_F.func_76319_b();
  21601. } catch (Throwable throwable) {
  21602. CrashReport crashreport2 = CrashReport.func_85055_a(throwable, "Ticking block entity");
  21603. CrashReportCategory crashreportcategory2 = crashreport2.func_85058_a("Block entity being ticked");
  21604. tileentity.func_145828_a(crashreportcategory2);
  21605. throw new ReportedException(crashreport2);
  21606. }
  21607. }
  21608. }
  21609.  
  21610. if(tileentity.func_145837_r()) {
  21611. iterator.remove();
  21612. this.field_147482_g.remove(tileentity);
  21613. if(this.func_175667_e(tileentity.func_174877_v())) {
  21614. this.func_175726_f(tileentity.func_174877_v()).func_177425_e(tileentity.func_174877_v());
  21615. }
  21616. }
  21617. }
  21618.  
  21619. this.field_147481_N = false;
  21620. if(!this.field_147483_b.isEmpty()) {
  21621. this.field_175730_i.removeAll(this.field_147483_b);
  21622. this.field_147482_g.removeAll(this.field_147483_b);
  21623. this.field_147483_b.clear();
  21624. }
  21625.  
  21626. this.field_72984_F.func_76318_c("pendingBlockEntities");
  21627. if(!this.field_147484_a.isEmpty()) {
  21628. for(int j1 = 0; j1 < this.field_147484_a.size(); ++j1) {
  21629. TileEntity tileentity1 = (TileEntity)this.field_147484_a.get(j1);
  21630. if(!tileentity1.func_145837_r()) {
  21631. if(!this.field_147482_g.contains(tileentity1)) {
  21632. this.func_175700_a(tileentity1);
  21633. }
  21634.  
  21635. if(this.func_175667_e(tileentity1.func_174877_v())) {
  21636. Chunk chunk = this.func_175726_f(tileentity1.func_174877_v());
  21637. IBlockState iblockstate = chunk.func_177435_g(tileentity1.func_174877_v());
  21638. chunk.func_177426_a(tileentity1.func_174877_v(), tileentity1);
  21639. this.func_184138_a(tileentity1.func_174877_v(), iblockstate, iblockstate, 3);
  21640. }
  21641. }
  21642. }
  21643.  
  21644. this.field_147484_a.clear();
  21645. }
  21646.  
  21647. this.field_72984_F.func_76319_b();
  21648. this.field_72984_F.func_76319_b();
  21649. }
  21650.  
  21651. protected void func_184147_l() {
  21652. }
  21653.  
  21654. public boolean func_175700_a(TileEntity p_175700_1_) {
  21655. boolean flag = this.field_147482_g.add(p_175700_1_);
  21656. if(flag && p_175700_1_ instanceof ITickable) {
  21657. this.field_175730_i.add(p_175700_1_);
  21658. }
  21659.  
  21660. if(this.field_72995_K) {
  21661. BlockPos blockpos = p_175700_1_.func_174877_v();
  21662. IBlockState iblockstate = this.func_180495_p(blockpos);
  21663. this.func_184138_a(blockpos, iblockstate, iblockstate, 2);
  21664. }
  21665.  
  21666. return flag;
  21667. }
  21668.  
  21669. public void func_147448_a(Collection<TileEntity> p_147448_1_) {
  21670. if(this.field_147481_N) {
  21671. this.field_147484_a.addAll(p_147448_1_);
  21672. } else {
  21673. for(TileEntity tileentity : p_147448_1_) {
  21674. this.func_175700_a(tileentity);
  21675. }
  21676. }
  21677.  
  21678. }
  21679.  
  21680. public void func_72870_g(Entity p_72870_1_) {
  21681. this.func_72866_a(p_72870_1_, true);
  21682. }
  21683.  
  21684. public void func_72866_a(Entity p_72866_1_, boolean p_72866_2_) {
  21685. if(!(p_72866_1_ instanceof EntityPlayer)) {
  21686. int i = MathHelper.func_76128_c(p_72866_1_.field_70165_t);
  21687. int j = MathHelper.func_76128_c(p_72866_1_.field_70161_v);
  21688. int k = 32;
  21689. if(p_72866_2_ && !this.func_175663_a(i - 32, 0, j - 32, i + 32, 0, j + 32, true)) {
  21690. return;
  21691. }
  21692. }
  21693.  
  21694. p_72866_1_.field_70142_S = p_72866_1_.field_70165_t;
  21695. p_72866_1_.field_70137_T = p_72866_1_.field_70163_u;
  21696. p_72866_1_.field_70136_U = p_72866_1_.field_70161_v;
  21697. p_72866_1_.field_70126_B = p_72866_1_.field_70177_z;
  21698. p_72866_1_.field_70127_C = p_72866_1_.field_70125_A;
  21699. if(p_72866_2_ && p_72866_1_.field_70175_ag) {
  21700. ++p_72866_1_.field_70173_aa;
  21701. if(p_72866_1_.func_184218_aH()) {
  21702. p_72866_1_.func_70098_U();
  21703. } else {
  21704. p_72866_1_.func_70071_h_();
  21705. }
  21706. }
  21707.  
  21708. this.field_72984_F.func_76320_a("chunkCheck");
  21709. if(Double.isNaN(p_72866_1_.field_70165_t) || Double.isInfinite(p_72866_1_.field_70165_t)) {
  21710. p_72866_1_.field_70165_t = p_72866_1_.field_70142_S;
  21711. }
  21712.  
  21713. if(Double.isNaN(p_72866_1_.field_70163_u) || Double.isInfinite(p_72866_1_.field_70163_u)) {
  21714. p_72866_1_.field_70163_u = p_72866_1_.field_70137_T;
  21715. }
  21716.  
  21717. if(Double.isNaN(p_72866_1_.field_70161_v) || Double.isInfinite(p_72866_1_.field_70161_v)) {
  21718. p_72866_1_.field_70161_v = p_72866_1_.field_70136_U;
  21719. }
  21720.  
  21721. if(Double.isNaN((double)p_72866_1_.field_70125_A) || Double.isInfinite((double)p_72866_1_.field_70125_A)) {
  21722. p_72866_1_.field_70125_A = p_72866_1_.field_70127_C;
  21723. }
  21724.  
  21725. if(Double.isNaN((double)p_72866_1_.field_70177_z) || Double.isInfinite((double)p_72866_1_.field_70177_z)) {
  21726. p_72866_1_.field_70177_z = p_72866_1_.field_70126_B;
  21727. }
  21728.  
  21729. int l = MathHelper.func_76128_c(p_72866_1_.field_70165_t / 16.0D);
  21730. int i1 = MathHelper.func_76128_c(p_72866_1_.field_70163_u / 16.0D);
  21731. int j1 = MathHelper.func_76128_c(p_72866_1_.field_70161_v / 16.0D);
  21732. if(!p_72866_1_.field_70175_ag || p_72866_1_.field_70176_ah != l || p_72866_1_.field_70162_ai != i1 || p_72866_1_.field_70164_aj != j1) {
  21733. if(p_72866_1_.field_70175_ag && this.func_175680_a(p_72866_1_.field_70176_ah, p_72866_1_.field_70164_aj, true)) {
  21734. this.func_72964_e(p_72866_1_.field_70176_ah, p_72866_1_.field_70164_aj).func_76608_a(p_72866_1_, p_72866_1_.field_70162_ai);
  21735. }
  21736.  
  21737. if(!p_72866_1_.func_184189_br() && !this.func_175680_a(l, j1, true)) {
  21738. p_72866_1_.field_70175_ag = false;
  21739. } else {
  21740. this.func_72964_e(l, j1).func_76612_a(p_72866_1_);
  21741. }
  21742. }
  21743.  
  21744. this.field_72984_F.func_76319_b();
  21745. if(p_72866_2_ && p_72866_1_.field_70175_ag) {
  21746. for(Entity entity : p_72866_1_.func_184188_bt()) {
  21747. if(!entity.field_70128_L && entity.func_184187_bx() == p_72866_1_) {
  21748. this.func_72870_g(entity);
  21749. } else {
  21750. entity.func_184210_p();
  21751. }
  21752. }
  21753. }
  21754.  
  21755. }
  21756.  
  21757. public boolean func_72855_b(AxisAlignedBB p_72855_1_) {
  21758. return this.func_72917_a(p_72855_1_, (Entity)null);
  21759. }
  21760.  
  21761. public boolean func_72917_a(AxisAlignedBB p_72917_1_, @Nullable Entity p_72917_2_) {
  21762. List<Entity> list = this.func_72839_b((Entity)null, p_72917_1_);
  21763.  
  21764. for(int i = 0; i < list.size(); ++i) {
  21765. Entity entity = (Entity)list.get(i);
  21766. if(!entity.field_70128_L && entity.field_70156_m && entity != p_72917_2_ && (p_72917_2_ == null || entity.func_184223_x(p_72917_2_))) {
  21767. return false;
  21768. }
  21769. }
  21770.  
  21771. return true;
  21772. }
  21773.  
  21774. public boolean func_72829_c(AxisAlignedBB p_72829_1_) {
  21775. int i = MathHelper.func_76128_c(p_72829_1_.field_72340_a);
  21776. int j = MathHelper.func_76143_f(p_72829_1_.field_72336_d);
  21777. int k = MathHelper.func_76128_c(p_72829_1_.field_72338_b);
  21778. int l = MathHelper.func_76143_f(p_72829_1_.field_72337_e);
  21779. int i1 = MathHelper.func_76128_c(p_72829_1_.field_72339_c);
  21780. int j1 = MathHelper.func_76143_f(p_72829_1_.field_72334_f);
  21781. BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
  21782.  
  21783. for(int k1 = i; k1 < j; ++k1) {
  21784. for(int l1 = k; l1 < l; ++l1) {
  21785. for(int i2 = i1; i2 < j1; ++i2) {
  21786. IBlockState iblockstate = this.func_180495_p(blockpos$pooledmutableblockpos.func_181079_c(k1, l1, i2));
  21787. if(iblockstate.func_185904_a() != Material.field_151579_a) {
  21788. blockpos$pooledmutableblockpos.func_185344_t();
  21789. return true;
  21790. }
  21791. }
  21792. }
  21793. }
  21794.  
  21795. blockpos$pooledmutableblockpos.func_185344_t();
  21796. return false;
  21797. }
  21798.  
  21799. public boolean func_72953_d(AxisAlignedBB p_72953_1_) {
  21800. int i = MathHelper.func_76128_c(p_72953_1_.field_72340_a);
  21801. int j = MathHelper.func_76143_f(p_72953_1_.field_72336_d);
  21802. int k = MathHelper.func_76128_c(p_72953_1_.field_72338_b);
  21803. int l = MathHelper.func_76143_f(p_72953_1_.field_72337_e);
  21804. int i1 = MathHelper.func_76128_c(p_72953_1_.field_72339_c);
  21805. int j1 = MathHelper.func_76143_f(p_72953_1_.field_72334_f);
  21806. BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
  21807.  
  21808. for(int k1 = i; k1 < j; ++k1) {
  21809. for(int l1 = k; l1 < l; ++l1) {
  21810. for(int i2 = i1; i2 < j1; ++i2) {
  21811. IBlockState iblockstate = this.func_180495_p(blockpos$pooledmutableblockpos.func_181079_c(k1, l1, i2));
  21812. if(iblockstate.func_185904_a().func_76224_d()) {
  21813. blockpos$pooledmutableblockpos.func_185344_t();
  21814. return true;
  21815. }
  21816. }
  21817. }
  21818. }
  21819.  
  21820. blockpos$pooledmutableblockpos.func_185344_t();
  21821. return false;
  21822. }
  21823.  
  21824. public boolean func_147470_e(AxisAlignedBB p_147470_1_) {
  21825. int i = MathHelper.func_76128_c(p_147470_1_.field_72340_a);
  21826. int j = MathHelper.func_76143_f(p_147470_1_.field_72336_d);
  21827. int k = MathHelper.func_76128_c(p_147470_1_.field_72338_b);
  21828. int l = MathHelper.func_76143_f(p_147470_1_.field_72337_e);
  21829. int i1 = MathHelper.func_76128_c(p_147470_1_.field_72339_c);
  21830. int j1 = MathHelper.func_76143_f(p_147470_1_.field_72334_f);
  21831. if(this.func_175663_a(i, k, i1, j, l, j1, true)) {
  21832. BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
  21833.  
  21834. for(int k1 = i; k1 < j; ++k1) {
  21835. for(int l1 = k; l1 < l; ++l1) {
  21836. for(int i2 = i1; i2 < j1; ++i2) {
  21837. Block block = this.func_180495_p(blockpos$pooledmutableblockpos.func_181079_c(k1, l1, i2)).func_177230_c();
  21838. if(block == Blocks.field_150480_ab || block == Blocks.field_150356_k || block == Blocks.field_150353_l) {
  21839. blockpos$pooledmutableblockpos.func_185344_t();
  21840. return true;
  21841. }
  21842. }
  21843. }
  21844. }
  21845.  
  21846. blockpos$pooledmutableblockpos.func_185344_t();
  21847. }
  21848.  
  21849. return false;
  21850. }
  21851.  
  21852. public boolean func_72918_a(AxisAlignedBB p_72918_1_, Material p_72918_2_, Entity p_72918_3_) {
  21853. int i = MathHelper.func_76128_c(p_72918_1_.field_72340_a);
  21854. int j = MathHelper.func_76143_f(p_72918_1_.field_72336_d);
  21855. int k = MathHelper.func_76128_c(p_72918_1_.field_72338_b);
  21856. int l = MathHelper.func_76143_f(p_72918_1_.field_72337_e);
  21857. int i1 = MathHelper.func_76128_c(p_72918_1_.field_72339_c);
  21858. int j1 = MathHelper.func_76143_f(p_72918_1_.field_72334_f);
  21859. if(!this.func_175663_a(i, k, i1, j, l, j1, true)) {
  21860. return false;
  21861. } else {
  21862. boolean flag = false;
  21863. Vec3d vec3d = Vec3d.field_186680_a;
  21864. BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
  21865.  
  21866. for(int k1 = i; k1 < j; ++k1) {
  21867. for(int l1 = k; l1 < l; ++l1) {
  21868. for(int i2 = i1; i2 < j1; ++i2) {
  21869. blockpos$pooledmutableblockpos.func_181079_c(k1, l1, i2);
  21870. IBlockState iblockstate = this.func_180495_p(blockpos$pooledmutableblockpos);
  21871. Block block = iblockstate.func_177230_c();
  21872. if(iblockstate.func_185904_a() == p_72918_2_) {
  21873. double d0 = (double)((float)(l1 + 1) - BlockLiquid.func_149801_b(((Integer)iblockstate.func_177229_b(BlockLiquid.field_176367_b)).intValue()));
  21874. if((double)l >= d0) {
  21875. flag = true;
  21876. vec3d = block.func_176197_a(this, blockpos$pooledmutableblockpos, p_72918_3_, vec3d);
  21877. }
  21878. }
  21879. }
  21880. }
  21881. }
  21882.  
  21883. blockpos$pooledmutableblockpos.func_185344_t();
  21884. if(vec3d.func_72433_c() > 0.0D && p_72918_3_.func_96092_aw()) {
  21885. vec3d = vec3d.func_72432_b();
  21886. double d1 = 0.014D;
  21887. p_72918_3_.field_70159_w += vec3d.field_72450_a * 0.014D;
  21888. p_72918_3_.field_70181_x += vec3d.field_72448_b * 0.014D;
  21889. p_72918_3_.field_70179_y += vec3d.field_72449_c * 0.014D;
  21890. }
  21891.  
  21892. return flag;
  21893. }
  21894. }
  21895.  
  21896. public boolean func_72875_a(AxisAlignedBB p_72875_1_, Material p_72875_2_) {
  21897. int i = MathHelper.func_76128_c(p_72875_1_.field_72340_a);
  21898. int j = MathHelper.func_76143_f(p_72875_1_.field_72336_d);
  21899. int k = MathHelper.func_76128_c(p_72875_1_.field_72338_b);
  21900. int l = MathHelper.func_76143_f(p_72875_1_.field_72337_e);
  21901. int i1 = MathHelper.func_76128_c(p_72875_1_.field_72339_c);
  21902. int j1 = MathHelper.func_76143_f(p_72875_1_.field_72334_f);
  21903. BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
  21904.  
  21905. for(int k1 = i; k1 < j; ++k1) {
  21906. for(int l1 = k; l1 < l; ++l1) {
  21907. for(int i2 = i1; i2 < j1; ++i2) {
  21908. if(this.func_180495_p(blockpos$pooledmutableblockpos.func_181079_c(k1, l1, i2)).func_185904_a() == p_72875_2_) {
  21909. blockpos$pooledmutableblockpos.func_185344_t();
  21910. return true;
  21911. }
  21912. }
  21913. }
  21914. }
  21915.  
  21916. blockpos$pooledmutableblockpos.func_185344_t();
  21917. return false;
  21918. }
  21919.  
  21920. public Explosion func_72876_a(@Nullable Entity p_72876_1_, double p_72876_2_, double p_72876_4_, double p_72876_6_, float p_72876_8_, boolean p_72876_9_) {
  21921. return this.func_72885_a(p_72876_1_, p_72876_2_, p_72876_4_, p_72876_6_, p_72876_8_, false, p_72876_9_);
  21922. }
  21923.  
  21924. public Explosion func_72885_a(@Nullable Entity p_72885_1_, double p_72885_2_, double p_72885_4_, double p_72885_6_, float p_72885_8_, boolean p_72885_9_, boolean p_72885_10_) {
  21925. Explosion explosion = new Explosion(this, p_72885_1_, p_72885_2_, p_72885_4_, p_72885_6_, p_72885_8_, p_72885_9_, p_72885_10_);
  21926. explosion.func_77278_a();
  21927. explosion.func_77279_a(true);
  21928. return explosion;
  21929. }
  21930.  
  21931. public float func_72842_a(Vec3d p_72842_1_, AxisAlignedBB p_72842_2_) {
  21932. double d0 = 1.0D / ((p_72842_2_.field_72336_d - p_72842_2_.field_72340_a) * 2.0D + 1.0D);
  21933. double d1 = 1.0D / ((p_72842_2_.field_72337_e - p_72842_2_.field_72338_b) * 2.0D + 1.0D);
  21934. double d2 = 1.0D / ((p_72842_2_.field_72334_f - p_72842_2_.field_72339_c) * 2.0D + 1.0D);
  21935. double d3 = (1.0D - Math.floor(1.0D / d0) * d0) / 2.0D;
  21936. double d4 = (1.0D - Math.floor(1.0D / d2) * d2) / 2.0D;
  21937. if(d0 >= 0.0D && d1 >= 0.0D && d2 >= 0.0D) {
  21938. int i = 0;
  21939. int j = 0;
  21940.  
  21941. for(float f = 0.0F; f <= 1.0F; f = (float)((double)f + d0)) {
  21942. for(float f1 = 0.0F; f1 <= 1.0F; f1 = (float)((double)f1 + d1)) {
  21943. for(float f2 = 0.0F; f2 <= 1.0F; f2 = (float)((double)f2 + d2)) {
  21944. double d5 = p_72842_2_.field_72340_a + (p_72842_2_.field_72336_d - p_72842_2_.field_72340_a) * (double)f;
  21945. double d6 = p_72842_2_.field_72338_b + (p_72842_2_.field_72337_e - p_72842_2_.field_72338_b) * (double)f1;
  21946. double d7 = p_72842_2_.field_72339_c + (p_72842_2_.field_72334_f - p_72842_2_.field_72339_c) * (double)f2;
  21947. if(this.func_72933_a(new Vec3d(d5 + d3, d6, d7 + d4), p_72842_1_) == null) {
  21948. ++i;
  21949. }
  21950.  
  21951. ++j;
  21952. }
  21953. }
  21954. }
  21955.  
  21956. return (float)i / (float)j;
  21957. } else {
  21958. return 0.0F;
  21959. }
  21960. }
  21961.  
  21962. public boolean func_175719_a(@Nullable EntityPlayer p_175719_1_, BlockPos p_175719_2_, EnumFacing p_175719_3_) {
  21963. p_175719_2_ = p_175719_2_.func_177972_a(p_175719_3_);
  21964. if(this.func_180495_p(p_175719_2_).func_177230_c() == Blocks.field_150480_ab) {
  21965. this.func_180498_a(p_175719_1_, 1009, p_175719_2_, 0);
  21966. this.func_175698_g(p_175719_2_);
  21967. return true;
  21968. } else {
  21969. return false;
  21970. }
  21971. }
  21972.  
  21973. @SideOnly(Side.CLIENT)
  21974. public String func_72981_t() {
  21975. return "All: " + this.field_72996_f.size();
  21976. }
  21977.  
  21978. @SideOnly(Side.CLIENT)
  21979. public String func_72827_u() {
  21980. return this.field_73020_y.func_73148_d();
  21981. }
  21982.  
  21983. @Nullable
  21984. public TileEntity func_175625_s(BlockPos p_175625_1_) {
  21985. if(this.func_189509_E(p_175625_1_)) {
  21986. return null;
  21987. } else {
  21988. TileEntity tileentity = null;
  21989. if(this.field_147481_N) {
  21990. tileentity = this.func_189508_F(p_175625_1_);
  21991. }
  21992.  
  21993. if(tileentity == null) {
  21994. tileentity = this.func_175726_f(p_175625_1_).func_177424_a(p_175625_1_, Chunk.EnumCreateEntityType.IMMEDIATE);
  21995. }
  21996.  
  21997. if(tileentity == null) {
  21998. tileentity = this.func_189508_F(p_175625_1_);
  21999. }
  22000.  
  22001. return tileentity;
  22002. }
  22003. }
  22004.  
  22005. @Nullable
  22006. private TileEntity func_189508_F(BlockPos p_189508_1_) {
  22007. for(int i = 0; i < this.field_147484_a.size(); ++i) {
  22008. TileEntity tileentity = (TileEntity)this.field_147484_a.get(i);
  22009. if(!tileentity.func_145837_r() && tileentity.func_174877_v().equals(p_189508_1_)) {
  22010. return tileentity;
  22011. }
  22012. }
  22013.  
  22014. return null;
  22015. }
  22016.  
  22017. public void func_175690_a(BlockPos p_175690_1_, @Nullable TileEntity p_175690_2_) {
  22018. if(!this.func_189509_E(p_175690_1_)) {
  22019. if(p_175690_2_ != null && !p_175690_2_.func_145837_r()) {
  22020. if(this.field_147481_N) {
  22021. p_175690_2_.func_174878_a(p_175690_1_);
  22022. Iterator<TileEntity> iterator = this.field_147484_a.iterator();
  22023.  
  22024. while(iterator.hasNext()) {
  22025. TileEntity tileentity = (TileEntity)iterator.next();
  22026. if(tileentity.func_174877_v().equals(p_175690_1_)) {
  22027. tileentity.func_145843_s();
  22028. iterator.remove();
  22029. }
  22030. }
  22031.  
  22032. this.field_147484_a.add(p_175690_2_);
  22033. } else {
  22034. this.func_175726_f(p_175690_1_).func_177426_a(p_175690_1_, p_175690_2_);
  22035. this.func_175700_a(p_175690_2_);
  22036. }
  22037. }
  22038.  
  22039. }
  22040. }
  22041.  
  22042. public void func_175713_t(BlockPos p_175713_1_) {
  22043. TileEntity tileentity = this.func_175625_s(p_175713_1_);
  22044. if(tileentity != null && this.field_147481_N) {
  22045. tileentity.func_145843_s();
  22046. this.field_147484_a.remove(tileentity);
  22047. } else {
  22048. if(tileentity != null) {
  22049. this.field_147484_a.remove(tileentity);
  22050. this.field_147482_g.remove(tileentity);
  22051. this.field_175730_i.remove(tileentity);
  22052. }
  22053.  
  22054. this.func_175726_f(p_175713_1_).func_177425_e(p_175713_1_);
  22055. }
  22056.  
  22057. }
  22058.  
  22059. public void func_147457_a(TileEntity p_147457_1_) {
  22060. this.field_147483_b.add(p_147457_1_);
  22061. }
  22062.  
  22063. public boolean func_175665_u(BlockPos p_175665_1_) {
  22064. AxisAlignedBB axisalignedbb = this.func_180495_p(p_175665_1_).func_185890_d(this, p_175665_1_);
  22065. return axisalignedbb != Block.field_185506_k && axisalignedbb.func_72320_b() >= 1.0D;
  22066. }
  22067.  
  22068. public boolean func_175677_d(BlockPos p_175677_1_, boolean p_175677_2_) {
  22069. if(this.func_189509_E(p_175677_1_)) {
  22070. return false;
  22071. } else {
  22072. Chunk chunk = this.field_73020_y.func_186026_b(p_175677_1_.func_177958_n() >> 4, p_175677_1_.func_177952_p() >> 4);
  22073. if(chunk != null && !chunk.func_76621_g()) {
  22074. IBlockState iblockstate = this.func_180495_p(p_175677_1_);
  22075. return iblockstate.func_185904_a().func_76218_k() && iblockstate.func_185917_h();
  22076. } else {
  22077. return p_175677_2_;
  22078. }
  22079. }
  22080. }
  22081.  
  22082. public void func_72966_v() {
  22083. int i = this.func_72967_a(1.0F);
  22084. if(i != this.field_73008_k) {
  22085. this.field_73008_k = i;
  22086. }
  22087.  
  22088. }
  22089.  
  22090. public void func_72891_a(boolean p_72891_1_, boolean p_72891_2_) {
  22091. this.field_72985_G = p_72891_1_;
  22092. this.field_72992_H = p_72891_2_;
  22093. }
  22094.  
  22095. public void func_72835_b() {
  22096. this.func_72979_l();
  22097. }
  22098.  
  22099. protected void func_72947_a() {
  22100. if(this.field_72986_A.func_76059_o()) {
  22101. this.field_73004_o = 1.0F;
  22102. if(this.field_72986_A.func_76061_m()) {
  22103. this.field_73017_q = 1.0F;
  22104. }
  22105. }
  22106.  
  22107. }
  22108.  
  22109. protected void func_72979_l() {
  22110. if(this.field_73011_w.func_191066_m()) {
  22111. if(!this.field_72995_K) {
  22112. boolean flag = this.func_82736_K().func_82766_b("doWeatherCycle");
  22113. if(flag) {
  22114. int i = this.field_72986_A.func_176133_A();
  22115. if(i > 0) {
  22116. --i;
  22117. this.field_72986_A.func_176142_i(i);
  22118. this.field_72986_A.func_76090_f(this.field_72986_A.func_76061_m()?1:2);
  22119. this.field_72986_A.func_76080_g(this.field_72986_A.func_76059_o()?1:2);
  22120. }
  22121.  
  22122. int j = this.field_72986_A.func_76071_n();
  22123. if(j <= 0) {
  22124. if(this.field_72986_A.func_76061_m()) {
  22125. this.field_72986_A.func_76090_f(this.field_73012_v.nextInt(12000) + 3600);
  22126. } else {
  22127. this.field_72986_A.func_76090_f(this.field_73012_v.nextInt(168000) + 12000);
  22128. }
  22129. } else {
  22130. --j;
  22131. this.field_72986_A.func_76090_f(j);
  22132. if(j <= 0) {
  22133. this.field_72986_A.func_76069_a(!this.field_72986_A.func_76061_m());
  22134. }
  22135. }
  22136.  
  22137. int k = this.field_72986_A.func_76083_p();
  22138. if(k <= 0) {
  22139. if(this.field_72986_A.func_76059_o()) {
  22140. this.field_72986_A.func_76080_g(this.field_73012_v.nextInt(12000) + 12000);
  22141. } else {
  22142. this.field_72986_A.func_76080_g(this.field_73012_v.nextInt(168000) + 12000);
  22143. }
  22144. } else {
  22145. --k;
  22146. this.field_72986_A.func_76080_g(k);
  22147. if(k <= 0) {
  22148. this.field_72986_A.func_76084_b(!this.field_72986_A.func_76059_o());
  22149. }
  22150. }
  22151. }
  22152.  
  22153. this.field_73018_p = this.field_73017_q;
  22154. if(this.field_72986_A.func_76061_m()) {
  22155. this.field_73017_q = (float)((double)this.field_73017_q + 0.01D);
  22156. } else {
  22157. this.field_73017_q = (float)((double)this.field_73017_q - 0.01D);
  22158. }
  22159.  
  22160. this.field_73017_q = MathHelper.func_76131_a(this.field_73017_q, 0.0F, 1.0F);
  22161. this.field_73003_n = this.field_73004_o;
  22162. if(this.field_72986_A.func_76059_o()) {
  22163. this.field_73004_o = (float)((double)this.field_73004_o + 0.01D);
  22164. } else {
  22165. this.field_73004_o = (float)((double)this.field_73004_o - 0.01D);
  22166. }
  22167.  
  22168. this.field_73004_o = MathHelper.func_76131_a(this.field_73004_o, 0.0F, 1.0F);
  22169. }
  22170. }
  22171. }
  22172.  
  22173. @SideOnly(Side.CLIENT)
  22174. protected void func_147467_a(int p_147467_1_, int p_147467_2_, Chunk p_147467_3_) {
  22175. p_147467_3_.func_76594_o();
  22176. }
  22177.  
  22178. protected void func_147456_g() {
  22179. }
  22180.  
  22181. public void func_189507_a(BlockPos p_189507_1_, IBlockState p_189507_2_, Random p_189507_3_) {
  22182. this.field_72999_e = true;
  22183. p_189507_2_.func_177230_c().func_180650_b(this, p_189507_1_, p_189507_2_, p_189507_3_);
  22184. this.field_72999_e = false;
  22185. }
  22186.  
  22187. public boolean func_175675_v(BlockPos p_175675_1_) {
  22188. return this.func_175670_e(p_175675_1_, false);
  22189. }
  22190.  
  22191. public boolean func_175662_w(BlockPos p_175662_1_) {
  22192. return this.func_175670_e(p_175662_1_, true);
  22193. }
  22194.  
  22195. public boolean func_175670_e(BlockPos p_175670_1_, boolean p_175670_2_) {
  22196. Biome biome = this.func_180494_b(p_175670_1_);
  22197. float f = biome.func_180626_a(p_175670_1_);
  22198. if(f >= 0.15F) {
  22199. return false;
  22200. } else {
  22201. if(p_175670_1_.func_177956_o() >= 0 && p_175670_1_.func_177956_o() < 256 && this.func_175642_b(EnumSkyBlock.BLOCK, p_175670_1_) < 10) {
  22202. IBlockState iblockstate = this.func_180495_p(p_175670_1_);
  22203. Block block = iblockstate.func_177230_c();
  22204. if((block == Blocks.field_150355_j || block == Blocks.field_150358_i) && ((Integer)iblockstate.func_177229_b(BlockLiquid.field_176367_b)).intValue() == 0) {
  22205. if(!p_175670_2_) {
  22206. return true;
  22207. }
  22208.  
  22209. boolean flag = this.func_175696_F(p_175670_1_.func_177976_e()) && this.func_175696_F(p_175670_1_.func_177974_f()) && this.func_175696_F(p_175670_1_.func_177978_c()) && this.func_175696_F(p_175670_1_.func_177968_d());
  22210. if(!flag) {
  22211. return true;
  22212. }
  22213. }
  22214. }
  22215.  
  22216. return false;
  22217. }
  22218. }
  22219.  
  22220. private boolean func_175696_F(BlockPos p_175696_1_) {
  22221. return this.func_180495_p(p_175696_1_).func_185904_a() == Material.field_151586_h;
  22222. }
  22223.  
  22224. public boolean func_175708_f(BlockPos p_175708_1_, boolean p_175708_2_) {
  22225. Biome biome = this.func_180494_b(p_175708_1_);
  22226. float f = biome.func_180626_a(p_175708_1_);
  22227. if(f >= 0.15F) {
  22228. return false;
  22229. } else if(!p_175708_2_) {
  22230. return true;
  22231. } else {
  22232. if(p_175708_1_.func_177956_o() >= 0 && p_175708_1_.func_177956_o() < 256 && this.func_175642_b(EnumSkyBlock.BLOCK, p_175708_1_) < 10) {
  22233. IBlockState iblockstate = this.func_180495_p(p_175708_1_);
  22234. if(iblockstate.func_185904_a() == Material.field_151579_a && Blocks.field_150431_aC.func_176196_c(this, p_175708_1_)) {
  22235. return true;
  22236. }
  22237. }
  22238.  
  22239. return false;
  22240. }
  22241. }
  22242.  
  22243. public boolean func_175664_x(BlockPos p_175664_1_) {
  22244. boolean flag = false;
  22245. if(this.field_73011_w.func_191066_m()) {
  22246. flag |= this.func_180500_c(EnumSkyBlock.SKY, p_175664_1_);
  22247. }
  22248.  
  22249. flag = flag | this.func_180500_c(EnumSkyBlock.BLOCK, p_175664_1_);
  22250. return flag;
  22251. }
  22252.  
  22253. private int func_175638_a(BlockPos p_175638_1_, EnumSkyBlock p_175638_2_) {
  22254. if(p_175638_2_ == EnumSkyBlock.SKY && this.func_175678_i(p_175638_1_)) {
  22255. return 15;
  22256. } else {
  22257. IBlockState iblockstate = this.func_180495_p(p_175638_1_);
  22258. int i = p_175638_2_ == EnumSkyBlock.SKY?0:iblockstate.func_185906_d();
  22259. int j = iblockstate.func_185891_c();
  22260. if(j >= 15 && iblockstate.func_185906_d() > 0) {
  22261. j = 1;
  22262. }
  22263.  
  22264. if(j < 1) {
  22265. j = 1;
  22266. }
  22267.  
  22268. if(j >= 15) {
  22269. return 0;
  22270. } else if(i >= 14) {
  22271. return i;
  22272. } else {
  22273. BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
  22274.  
  22275. try {
  22276. for(EnumFacing enumfacing : EnumFacing.values()) {
  22277. blockpos$pooledmutableblockpos.func_189533_g(p_175638_1_).func_189536_c(enumfacing);
  22278. int k = this.func_175642_b(p_175638_2_, blockpos$pooledmutableblockpos) - j;
  22279. if(k > i) {
  22280. i = k;
  22281. }
  22282.  
  22283. if(i >= 14) {
  22284. int l = i;
  22285. return l;
  22286. }
  22287. }
  22288.  
  22289. return i;
  22290. } finally {
  22291. blockpos$pooledmutableblockpos.func_185344_t();
  22292. }
  22293. }
  22294. }
  22295. }
  22296.  
  22297. public boolean func_180500_c(EnumSkyBlock p_180500_1_, BlockPos p_180500_2_) {
  22298. if(!this.func_175648_a(p_180500_2_, 17, false)) {
  22299. return false;
  22300. } else {
  22301. int i = 0;
  22302. int j = 0;
  22303. this.field_72984_F.func_76320_a("getBrightness");
  22304. int k = this.func_175642_b(p_180500_1_, p_180500_2_);
  22305. int l = this.func_175638_a(p_180500_2_, p_180500_1_);
  22306. int i1 = p_180500_2_.func_177958_n();
  22307. int j1 = p_180500_2_.func_177956_o();
  22308. int k1 = p_180500_2_.func_177952_p();
  22309. if(l > k) {
  22310. this.field_72994_J[j++] = 133152;
  22311. } else if(l < k) {
  22312. this.field_72994_J[j++] = 133152 | k << 18;
  22313.  
  22314. while(i < j) {
  22315. int l1 = this.field_72994_J[i++];
  22316. int i2 = (l1 & 63) - 32 + i1;
  22317. int j2 = (l1 >> 6 & 63) - 32 + j1;
  22318. int k2 = (l1 >> 12 & 63) - 32 + k1;
  22319. int l2 = l1 >> 18 & 15;
  22320. BlockPos blockpos = new BlockPos(i2, j2, k2);
  22321. int i3 = this.func_175642_b(p_180500_1_, blockpos);
  22322. if(i3 == l2) {
  22323. this.func_175653_a(p_180500_1_, blockpos, 0);
  22324. if(l2 > 0) {
  22325. int j3 = MathHelper.func_76130_a(i2 - i1);
  22326. int k3 = MathHelper.func_76130_a(j2 - j1);
  22327. int l3 = MathHelper.func_76130_a(k2 - k1);
  22328. if(j3 + k3 + l3 < 17) {
  22329. BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
  22330.  
  22331. for(EnumFacing enumfacing : EnumFacing.values()) {
  22332. int i4 = i2 + enumfacing.func_82601_c();
  22333. int j4 = j2 + enumfacing.func_96559_d();
  22334. int k4 = k2 + enumfacing.func_82599_e();
  22335. blockpos$pooledmutableblockpos.func_181079_c(i4, j4, k4);
  22336. int l4 = Math.max(1, this.func_180495_p(blockpos$pooledmutableblockpos).func_185891_c());
  22337. i3 = this.func_175642_b(p_180500_1_, blockpos$pooledmutableblockpos);
  22338. if(i3 == l2 - l4 && j < this.field_72994_J.length) {
  22339. this.field_72994_J[j++] = i4 - i1 + 32 | j4 - j1 + 32 << 6 | k4 - k1 + 32 << 12 | l2 - l4 << 18;
  22340. }
  22341. }
  22342.  
  22343. blockpos$pooledmutableblockpos.func_185344_t();
  22344. }
  22345. }
  22346. }
  22347. }
  22348.  
  22349. i = 0;
  22350. }
  22351.  
  22352. this.field_72984_F.func_76319_b();
  22353. this.field_72984_F.func_76320_a("checkedPosition < toCheckCount");
  22354.  
  22355. while(i < j) {
  22356. int i5 = this.field_72994_J[i++];
  22357. int j5 = (i5 & 63) - 32 + i1;
  22358. int k5 = (i5 >> 6 & 63) - 32 + j1;
  22359. int l5 = (i5 >> 12 & 63) - 32 + k1;
  22360. BlockPos blockpos1 = new BlockPos(j5, k5, l5);
  22361. int i6 = this.func_175642_b(p_180500_1_, blockpos1);
  22362. int j6 = this.func_175638_a(blockpos1, p_180500_1_);
  22363. if(j6 != i6) {
  22364. this.func_175653_a(p_180500_1_, blockpos1, j6);
  22365. if(j6 > i6) {
  22366. int k6 = Math.abs(j5 - i1);
  22367. int l6 = Math.abs(k5 - j1);
  22368. int i7 = Math.abs(l5 - k1);
  22369. boolean flag = j < this.field_72994_J.length - 6;
  22370. if(k6 + l6 + i7 < 17 && flag) {
  22371. if(this.func_175642_b(p_180500_1_, blockpos1.func_177976_e()) < j6) {
  22372. this.field_72994_J[j++] = j5 - 1 - i1 + 32 + (k5 - j1 + 32 << 6) + (l5 - k1 + 32 << 12);
  22373. }
  22374.  
  22375. if(this.func_175642_b(p_180500_1_, blockpos1.func_177974_f()) < j6) {
  22376. this.field_72994_J[j++] = j5 + 1 - i1 + 32 + (k5 - j1 + 32 << 6) + (l5 - k1 + 32 << 12);
  22377. }
  22378.  
  22379. if(this.func_175642_b(p_180500_1_, blockpos1.func_177977_b()) < j6) {
  22380. this.field_72994_J[j++] = j5 - i1 + 32 + (k5 - 1 - j1 + 32 << 6) + (l5 - k1 + 32 << 12);
  22381. }
  22382.  
  22383. if(this.func_175642_b(p_180500_1_, blockpos1.func_177984_a()) < j6) {
  22384. this.field_72994_J[j++] = j5 - i1 + 32 + (k5 + 1 - j1 + 32 << 6) + (l5 - k1 + 32 << 12);
  22385. }
  22386.  
  22387. if(this.func_175642_b(p_180500_1_, blockpos1.func_177978_c()) < j6) {
  22388. this.field_72994_J[j++] = j5 - i1 + 32 + (k5 - j1 + 32 << 6) + (l5 - 1 - k1 + 32 << 12);
  22389. }
  22390.  
  22391. if(this.func_175642_b(p_180500_1_, blockpos1.func_177968_d()) < j6) {
  22392. this.field_72994_J[j++] = j5 - i1 + 32 + (k5 - j1 + 32 << 6) + (l5 + 1 - k1 + 32 << 12);
  22393. }
  22394. }
  22395. }
  22396. }
  22397. }
  22398.  
  22399. this.field_72984_F.func_76319_b();
  22400. return true;
  22401. }
  22402. }
  22403.  
  22404. public boolean func_72955_a(boolean p_72955_1_) {
  22405. return false;
  22406. }
  22407.  
  22408. @Nullable
  22409. public List<NextTickListEntry> func_72920_a(Chunk p_72920_1_, boolean p_72920_2_) {
  22410. return null;
  22411. }
  22412.  
  22413. @Nullable
  22414. public List<NextTickListEntry> func_175712_a(StructureBoundingBox p_175712_1_, boolean p_175712_2_) {
  22415. return null;
  22416. }
  22417.  
  22418. public List<Entity> func_72839_b(@Nullable Entity p_72839_1_, AxisAlignedBB p_72839_2_) {
  22419. return this.func_175674_a(p_72839_1_, p_72839_2_, EntitySelectors.field_180132_d);
  22420. }
  22421.  
  22422. public List<Entity> func_175674_a(@Nullable Entity p_175674_1_, AxisAlignedBB p_175674_2_, @Nullable Predicate<? super Entity> p_175674_3_) {
  22423. List<Entity> list = Lists.<Entity>newArrayList();
  22424. int i = MathHelper.func_76128_c((p_175674_2_.field_72340_a - 2.0D) / 16.0D);
  22425. int j = MathHelper.func_76128_c((p_175674_2_.field_72336_d + 2.0D) / 16.0D);
  22426. int k = MathHelper.func_76128_c((p_175674_2_.field_72339_c - 2.0D) / 16.0D);
  22427. int l = MathHelper.func_76128_c((p_175674_2_.field_72334_f + 2.0D) / 16.0D);
  22428.  
  22429. for(int i1 = i; i1 <= j; ++i1) {
  22430. for(int j1 = k; j1 <= l; ++j1) {
  22431. if(this.func_175680_a(i1, j1, true)) {
  22432. this.func_72964_e(i1, j1).func_177414_a(p_175674_1_, p_175674_2_, list, p_175674_3_);
  22433. }
  22434. }
  22435. }
  22436.  
  22437. return list;
  22438. }
  22439.  
  22440. public <T extends Entity> List<T> func_175644_a(Class<? extends T> p_175644_1_, Predicate<? super T> p_175644_2_) {
  22441. List<T> list = Lists.<T>newArrayList();
  22442.  
  22443. for(Entity entity : this.field_72996_f) {
  22444. if(p_175644_1_.isAssignableFrom(entity.getClass()) && p_175644_2_.apply(entity)) {
  22445. list.add(entity);
  22446. }
  22447. }
  22448.  
  22449. return list;
  22450. }
  22451.  
  22452. public <T extends Entity> List<T> func_175661_b(Class<? extends T> p_175661_1_, Predicate<? super T> p_175661_2_) {
  22453. List<T> list = Lists.<T>newArrayList();
  22454.  
  22455. for(Entity entity : this.field_73010_i) {
  22456. if(p_175661_1_.isAssignableFrom(entity.getClass()) && p_175661_2_.apply(entity)) {
  22457. list.add(entity);
  22458. }
  22459. }
  22460.  
  22461. return list;
  22462. }
  22463.  
  22464. public <T extends Entity> List<T> func_72872_a(Class<? extends T> p_72872_1_, AxisAlignedBB p_72872_2_) {
  22465. return this.<T>func_175647_a(p_72872_1_, p_72872_2_, EntitySelectors.field_180132_d);
  22466. }
  22467.  
  22468. public <T extends Entity> List<T> func_175647_a(Class<? extends T> p_175647_1_, AxisAlignedBB p_175647_2_, @Nullable Predicate<? super T> p_175647_3_) {
  22469. int i = MathHelper.func_76128_c((p_175647_2_.field_72340_a - 2.0D) / 16.0D);
  22470. int j = MathHelper.func_76143_f((p_175647_2_.field_72336_d + 2.0D) / 16.0D);
  22471. int k = MathHelper.func_76128_c((p_175647_2_.field_72339_c - 2.0D) / 16.0D);
  22472. int l = MathHelper.func_76143_f((p_175647_2_.field_72334_f + 2.0D) / 16.0D);
  22473. List<T> list = Lists.<T>newArrayList();
  22474.  
  22475. for(int i1 = i; i1 < j; ++i1) {
  22476. for(int j1 = k; j1 < l; ++j1) {
  22477. if(this.func_175680_a(i1, j1, true)) {
  22478. this.func_72964_e(i1, j1).func_177430_a(p_175647_1_, p_175647_2_, list, p_175647_3_);
  22479. }
  22480. }
  22481. }
  22482.  
  22483. return list;
  22484. }
  22485.  
  22486. @Nullable
  22487. public <T extends Entity> T func_72857_a(Class<? extends T> p_72857_1_, AxisAlignedBB p_72857_2_, T p_72857_3_) {
  22488. List<T> list = this.<T>func_72872_a(p_72857_1_, p_72857_2_);
  22489. T t = null;
  22490. double d0 = Double.MAX_VALUE;
  22491.  
  22492. for(int i = 0; i < list.size(); ++i) {
  22493. T t1 = (Entity)list.get(i);
  22494. if(t1 != p_72857_3_ && EntitySelectors.field_180132_d.apply(t1)) {
  22495. double d1 = p_72857_3_.func_70068_e(t1);
  22496. if(d1 <= d0) {
  22497. t = t1;
  22498. d0 = d1;
  22499. }
  22500. }
  22501. }
  22502.  
  22503. return t;
  22504. }
  22505.  
  22506. @Nullable
  22507. public Entity func_73045_a(int p_73045_1_) {
  22508. return (Entity)this.field_175729_l.func_76041_a(p_73045_1_);
  22509. }
  22510.  
  22511. @SideOnly(Side.CLIENT)
  22512. public List<Entity> func_72910_y() {
  22513. return this.field_72996_f;
  22514. }
  22515.  
  22516. public void func_175646_b(BlockPos p_175646_1_, TileEntity p_175646_2_) {
  22517. if(this.func_175667_e(p_175646_1_)) {
  22518. this.func_175726_f(p_175646_1_).func_76630_e();
  22519. }
  22520.  
  22521. }
  22522.  
  22523. public int func_72907_a(Class<?> p_72907_1_) {
  22524. int i = 0;
  22525.  
  22526. for(Entity entity : this.field_72996_f) {
  22527. if((!(entity instanceof EntityLiving) || !((EntityLiving)entity).func_104002_bU()) && p_72907_1_.isAssignableFrom(entity.getClass())) {
  22528. ++i;
  22529. }
  22530. }
  22531.  
  22532. return i;
  22533. }
  22534.  
  22535. public void func_175650_b(Collection<Entity> p_175650_1_) {
  22536. this.field_72996_f.addAll(p_175650_1_);
  22537.  
  22538. for(Entity entity : p_175650_1_) {
  22539. this.func_72923_a(entity);
  22540. }
  22541.  
  22542. }
  22543.  
  22544. public void func_175681_c(Collection<Entity> p_175681_1_) {
  22545. this.field_72997_g.addAll(p_175681_1_);
  22546. }
  22547.  
  22548. public boolean func_190527_a(Block p_190527_1_, BlockPos p_190527_2_, boolean p_190527_3_, EnumFacing p_190527_4_, @Nullable Entity p_190527_5_) {
  22549. IBlockState iblockstate = this.func_180495_p(p_190527_2_);
  22550. AxisAlignedBB axisalignedbb = p_190527_3_?null:p_190527_1_.func_176223_P().func_185890_d(this, p_190527_2_);
  22551. return axisalignedbb != Block.field_185506_k && !this.func_72917_a(axisalignedbb.func_186670_a(p_190527_2_), p_190527_5_)?false:(iblockstate.func_185904_a() == Material.field_151594_q && p_190527_1_ == Blocks.field_150467_bQ?true:iblockstate.func_185904_a().func_76222_j() && p_190527_1_.func_176198_a(this, p_190527_2_, p_190527_4_));
  22552. }
  22553.  
  22554. public int func_181545_F() {
  22555. return this.field_181546_a;
  22556. }
  22557.  
  22558. public void func_181544_b(int p_181544_1_) {
  22559. this.field_181546_a = p_181544_1_;
  22560. }
  22561.  
  22562. public int func_175627_a(BlockPos p_175627_1_, EnumFacing p_175627_2_) {
  22563. return this.func_180495_p(p_175627_1_).func_185893_b(this, p_175627_1_, p_175627_2_);
  22564. }
  22565.  
  22566. public WorldType func_175624_G() {
  22567. return this.field_72986_A.func_76067_t();
  22568. }
  22569.  
  22570. public int func_175676_y(BlockPos p_175676_1_) {
  22571. int i = 0;
  22572. i = Math.max(i, this.func_175627_a(p_175676_1_.func_177977_b(), EnumFacing.DOWN));
  22573. if(i >= 15) {
  22574. return i;
  22575. } else {
  22576. i = Math.max(i, this.func_175627_a(p_175676_1_.func_177984_a(), EnumFacing.UP));
  22577. if(i >= 15) {
  22578. return i;
  22579. } else {
  22580. i = Math.max(i, this.func_175627_a(p_175676_1_.func_177978_c(), EnumFacing.NORTH));
  22581. if(i >= 15) {
  22582. return i;
  22583. } else {
  22584. i = Math.max(i, this.func_175627_a(p_175676_1_.func_177968_d(), EnumFacing.SOUTH));
  22585. if(i >= 15) {
  22586. return i;
  22587. } else {
  22588. i = Math.max(i, this.func_175627_a(p_175676_1_.func_177976_e(), EnumFacing.WEST));
  22589. if(i >= 15) {
  22590. return i;
  22591. } else {
  22592. i = Math.max(i, this.func_175627_a(p_175676_1_.func_177974_f(), EnumFacing.EAST));
  22593. return i >= 15?i:i;
  22594. }
  22595. }
  22596. }
  22597. }
  22598. }
  22599. }
  22600.  
  22601. public boolean func_175709_b(BlockPos p_175709_1_, EnumFacing p_175709_2_) {
  22602. return this.func_175651_c(p_175709_1_, p_175709_2_) > 0;
  22603. }
  22604.  
  22605. public int func_175651_c(BlockPos p_175651_1_, EnumFacing p_175651_2_) {
  22606. IBlockState iblockstate = this.func_180495_p(p_175651_1_);
  22607. return iblockstate.func_185915_l()?this.func_175676_y(p_175651_1_):iblockstate.func_185911_a(this, p_175651_1_, p_175651_2_);
  22608. }
  22609.  
  22610. public boolean func_175640_z(BlockPos p_175640_1_) {
  22611. return this.func_175651_c(p_175640_1_.func_177977_b(), EnumFacing.DOWN) > 0?true:(this.func_175651_c(p_175640_1_.func_177984_a(), EnumFacing.UP) > 0?true:(this.func_175651_c(p_175640_1_.func_177978_c(), EnumFacing.NORTH) > 0?true:(this.func_175651_c(p_175640_1_.func_177968_d(), EnumFacing.SOUTH) > 0?true:(this.func_175651_c(p_175640_1_.func_177976_e(), EnumFacing.WEST) > 0?true:this.func_175651_c(p_175640_1_.func_177974_f(), EnumFacing.EAST) > 0))));
  22612. }
  22613.  
  22614. public int func_175687_A(BlockPos p_175687_1_) {
  22615. int i = 0;
  22616.  
  22617. for(EnumFacing enumfacing : EnumFacing.values()) {
  22618. int j = this.func_175651_c(p_175687_1_.func_177972_a(enumfacing), enumfacing);
  22619. if(j >= 15) {
  22620. return 15;
  22621. }
  22622.  
  22623. if(j > i) {
  22624. i = j;
  22625. }
  22626. }
  22627.  
  22628. return i;
  22629. }
  22630.  
  22631. @Nullable
  22632. public EntityPlayer func_72890_a(Entity p_72890_1_, double p_72890_2_) {
  22633. return this.func_184137_a(p_72890_1_.field_70165_t, p_72890_1_.field_70163_u, p_72890_1_.field_70161_v, p_72890_2_, false);
  22634. }
  22635.  
  22636. @Nullable
  22637. public EntityPlayer func_184136_b(Entity p_184136_1_, double p_184136_2_) {
  22638. return this.func_184137_a(p_184136_1_.field_70165_t, p_184136_1_.field_70163_u, p_184136_1_.field_70161_v, p_184136_2_, true);
  22639. }
  22640.  
  22641. @Nullable
  22642. public EntityPlayer func_184137_a(double p_184137_1_, double p_184137_3_, double p_184137_5_, double p_184137_7_, boolean p_184137_9_) {
  22643. Predicate<Entity> predicate = p_184137_9_?EntitySelectors.field_188444_d:EntitySelectors.field_180132_d;
  22644. return this.func_190525_a(p_184137_1_, p_184137_3_, p_184137_5_, p_184137_7_, predicate);
  22645. }
  22646.  
  22647. @Nullable
  22648. public EntityPlayer func_190525_a(double p_190525_1_, double p_190525_3_, double p_190525_5_, double p_190525_7_, Predicate<Entity> p_190525_9_) {
  22649. double d0 = -1.0D;
  22650. EntityPlayer entityplayer = null;
  22651.  
  22652. for(int i = 0; i < this.field_73010_i.size(); ++i) {
  22653. EntityPlayer entityplayer1 = (EntityPlayer)this.field_73010_i.get(i);
  22654. if(p_190525_9_.apply(entityplayer1)) {
  22655. double d1 = entityplayer1.func_70092_e(p_190525_1_, p_190525_3_, p_190525_5_);
  22656. if((p_190525_7_ < 0.0D || d1 < p_190525_7_ * p_190525_7_) && (d0 == -1.0D || d1 < d0)) {
  22657. d0 = d1;
  22658. entityplayer = entityplayer1;
  22659. }
  22660. }
  22661. }
  22662.  
  22663. return entityplayer;
  22664. }
  22665.  
  22666. public boolean func_175636_b(double p_175636_1_, double p_175636_3_, double p_175636_5_, double p_175636_7_) {
  22667. for(int i = 0; i < this.field_73010_i.size(); ++i) {
  22668. EntityPlayer entityplayer = (EntityPlayer)this.field_73010_i.get(i);
  22669. if(EntitySelectors.field_180132_d.apply(entityplayer)) {
  22670. double d0 = entityplayer.func_70092_e(p_175636_1_, p_175636_3_, p_175636_5_);
  22671. if(p_175636_7_ < 0.0D || d0 < p_175636_7_ * p_175636_7_) {
  22672. return true;
  22673. }
  22674. }
  22675. }
  22676.  
  22677. return false;
  22678. }
  22679.  
  22680. @Nullable
  22681. public EntityPlayer func_184142_a(Entity p_184142_1_, double p_184142_2_, double p_184142_4_) {
  22682. return this.func_184150_a(p_184142_1_.field_70165_t, p_184142_1_.field_70163_u, p_184142_1_.field_70161_v, p_184142_2_, p_184142_4_, (Function<EntityPlayer, Double>)null, (Predicate<EntityPlayer>)null);
  22683. }
  22684.  
  22685. @Nullable
  22686. public EntityPlayer func_184139_a(BlockPos p_184139_1_, double p_184139_2_, double p_184139_4_) {
  22687. return this.func_184150_a((double)((float)p_184139_1_.func_177958_n() + 0.5F), (double)((float)p_184139_1_.func_177956_o() + 0.5F), (double)((float)p_184139_1_.func_177952_p() + 0.5F), p_184139_2_, p_184139_4_, (Function<EntityPlayer, Double>)null, (Predicate<EntityPlayer>)null);
  22688. }
  22689.  
  22690. @Nullable
  22691. public EntityPlayer func_184150_a(double p_184150_1_, double p_184150_3_, double p_184150_5_, double p_184150_7_, double p_184150_9_, @Nullable Function<EntityPlayer, Double> p_184150_11_, @Nullable Predicate<EntityPlayer> p_184150_12_) {
  22692. double d0 = -1.0D;
  22693. EntityPlayer entityplayer = null;
  22694.  
  22695. for(int i = 0; i < this.field_73010_i.size(); ++i) {
  22696. EntityPlayer entityplayer1 = (EntityPlayer)this.field_73010_i.get(i);
  22697. if(!entityplayer1.field_71075_bZ.field_75102_a && entityplayer1.func_70089_S() && !entityplayer1.func_175149_v() && (p_184150_12_ == null || p_184150_12_.apply(entityplayer1))) {
  22698. double d1 = entityplayer1.func_70092_e(p_184150_1_, entityplayer1.field_70163_u, p_184150_5_);
  22699. double d2 = p_184150_7_;
  22700. if(entityplayer1.func_70093_af()) {
  22701. d2 = p_184150_7_ * 0.800000011920929D;
  22702. }
  22703.  
  22704. if(entityplayer1.func_82150_aj()) {
  22705. float f = entityplayer1.func_82243_bO();
  22706. if(f < 0.1F) {
  22707. f = 0.1F;
  22708. }
  22709.  
  22710. d2 *= (double)(0.7F * f);
  22711. }
  22712.  
  22713. if(p_184150_11_ != null) {
  22714. d2 *= ((Double)MoreObjects.firstNonNull(p_184150_11_.apply(entityplayer1), Double.valueOf(1.0D))).doubleValue();
  22715. }
  22716.  
  22717. if((p_184150_9_ < 0.0D || Math.abs(entityplayer1.field_70163_u - p_184150_3_) < p_184150_9_ * p_184150_9_) && (p_184150_7_ < 0.0D || d1 < d2 * d2) && (d0 == -1.0D || d1 < d0)) {
  22718. d0 = d1;
  22719. entityplayer = entityplayer1;
  22720. }
  22721. }
  22722. }
  22723.  
  22724. return entityplayer;
  22725. }
  22726.  
  22727. @Nullable
  22728. public EntityPlayer func_72924_a(String p_72924_1_) {
  22729. for(int i = 0; i < this.field_73010_i.size(); ++i) {
  22730. EntityPlayer entityplayer = (EntityPlayer)this.field_73010_i.get(i);
  22731. if(p_72924_1_.equals(entityplayer.func_70005_c_())) {
  22732. return entityplayer;
  22733. }
  22734. }
  22735.  
  22736. return null;
  22737. }
  22738.  
  22739. @Nullable
  22740. public EntityPlayer func_152378_a(UUID p_152378_1_) {
  22741. for(int i = 0; i < this.field_73010_i.size(); ++i) {
  22742. EntityPlayer entityplayer = (EntityPlayer)this.field_73010_i.get(i);
  22743. if(p_152378_1_.equals(entityplayer.func_110124_au())) {
  22744. return entityplayer;
  22745. }
  22746. }
  22747.  
  22748. return null;
  22749. }
  22750.  
  22751. @SideOnly(Side.CLIENT)
  22752. public void func_72882_A() {
  22753. }
  22754.  
  22755. public void func_72906_B() throws MinecraftException {
  22756. this.field_73019_z.func_75762_c();
  22757. }
  22758.  
  22759. @SideOnly(Side.CLIENT)
  22760. public void func_82738_a(long p_82738_1_) {
  22761. this.field_72986_A.func_82572_b(p_82738_1_);
  22762. }
  22763.  
  22764. public long func_72905_C() {
  22765. return this.field_72986_A.func_76063_b();
  22766. }
  22767.  
  22768. public long func_82737_E() {
  22769. return this.field_72986_A.func_82573_f();
  22770. }
  22771.  
  22772. public long func_72820_D() {
  22773. return this.field_72986_A.func_76073_f();
  22774. }
  22775.  
  22776. public void func_72877_b(long p_72877_1_) {
  22777. this.field_72986_A.func_76068_b(p_72877_1_);
  22778. }
  22779.  
  22780. public BlockPos func_175694_M() {
  22781. BlockPos blockpos = new BlockPos(this.field_72986_A.func_76079_c(), this.field_72986_A.func_76075_d(), this.field_72986_A.func_76074_e());
  22782. if(!this.func_175723_af().func_177746_a(blockpos)) {
  22783. blockpos = this.func_175645_m(new BlockPos(this.func_175723_af().func_177731_f(), 0.0D, this.func_175723_af().func_177721_g()));
  22784. }
  22785.  
  22786. return blockpos;
  22787. }
  22788.  
  22789. public void func_175652_B(BlockPos p_175652_1_) {
  22790. this.field_72986_A.func_176143_a(p_175652_1_);
  22791. }
  22792.  
  22793. @SideOnly(Side.CLIENT)
  22794. public void func_72897_h(Entity p_72897_1_) {
  22795. int i = MathHelper.func_76128_c(p_72897_1_.field_70165_t / 16.0D);
  22796. int j = MathHelper.func_76128_c(p_72897_1_.field_70161_v / 16.0D);
  22797. int k = 2;
  22798.  
  22799. for(int l = -2; l <= 2; ++l) {
  22800. for(int i1 = -2; i1 <= 2; ++i1) {
  22801. this.func_72964_e(i + l, j + i1);
  22802. }
  22803. }
  22804.  
  22805. if(!this.field_72996_f.contains(p_72897_1_)) {
  22806. this.field_72996_f.add(p_72897_1_);
  22807. }
  22808.  
  22809. }
  22810.  
  22811. public boolean func_175660_a(EntityPlayer p_175660_1_, BlockPos p_175660_2_) {
  22812. return true;
  22813. }
  22814.  
  22815. public void func_72960_a(Entity p_72960_1_, byte p_72960_2_) {
  22816. }
  22817.  
  22818. public IChunkProvider func_72863_F() {
  22819. return this.field_73020_y;
  22820. }
  22821.  
  22822. public void func_175641_c(BlockPos p_175641_1_, Block p_175641_2_, int p_175641_3_, int p_175641_4_) {
  22823. this.func_180495_p(p_175641_1_).func_189547_a(this, p_175641_1_, p_175641_3_, p_175641_4_);
  22824. }
  22825.  
  22826. public ISaveHandler func_72860_G() {
  22827. return this.field_73019_z;
  22828. }
  22829.  
  22830. public WorldInfo func_72912_H() {
  22831. return this.field_72986_A;
  22832. }
  22833.  
  22834. public GameRules func_82736_K() {
  22835. return this.field_72986_A.func_82574_x();
  22836. }
  22837.  
  22838. public void func_72854_c() {
  22839. }
  22840.  
  22841. public float func_72819_i(float p_72819_1_) {
  22842. return (this.field_73018_p + (this.field_73017_q - this.field_73018_p) * p_72819_1_) * this.func_72867_j(p_72819_1_);
  22843. }
  22844.  
  22845. @SideOnly(Side.CLIENT)
  22846. public void func_147442_i(float p_147442_1_) {
  22847. this.field_73018_p = p_147442_1_;
  22848. this.field_73017_q = p_147442_1_;
  22849. }
  22850.  
  22851. public float func_72867_j(float p_72867_1_) {
  22852. return this.field_73003_n + (this.field_73004_o - this.field_73003_n) * p_72867_1_;
  22853. }
  22854.  
  22855. @SideOnly(Side.CLIENT)
  22856. public void func_72894_k(float p_72894_1_) {
  22857. this.field_73003_n = p_72894_1_;
  22858. this.field_73004_o = p_72894_1_;
  22859. }
  22860.  
  22861. public boolean func_72911_I() {
  22862. return (double)this.func_72819_i(1.0F) > 0.9D;
  22863. }
  22864.  
  22865. public boolean func_72896_J() {
  22866. return (double)this.func_72867_j(1.0F) > 0.2D;
  22867. }
  22868.  
  22869. public boolean func_175727_C(BlockPos p_175727_1_) {
  22870. if(!this.func_72896_J()) {
  22871. return false;
  22872. } else if(!this.func_175678_i(p_175727_1_)) {
  22873. return false;
  22874. } else if(this.func_175725_q(p_175727_1_).func_177956_o() > p_175727_1_.func_177956_o()) {
  22875. return false;
  22876. } else {
  22877. Biome biome = this.func_180494_b(p_175727_1_);
  22878. return biome.func_76746_c()?false:(this.func_175708_f(p_175727_1_, false)?false:biome.func_76738_d());
  22879. }
  22880. }
  22881.  
  22882. public boolean func_180502_D(BlockPos p_180502_1_) {
  22883. Biome biome = this.func_180494_b(p_180502_1_);
  22884. return biome.func_76736_e();
  22885. }
  22886.  
  22887. @Nullable
  22888. public MapStorage func_175693_T() {
  22889. return this.field_72988_C;
  22890. }
  22891.  
  22892. public void func_72823_a(String p_72823_1_, WorldSavedData p_72823_2_) {
  22893. this.field_72988_C.func_75745_a(p_72823_1_, p_72823_2_);
  22894. }
  22895.  
  22896. @Nullable
  22897. public WorldSavedData func_72943_a(Class<? extends WorldSavedData> p_72943_1_, String p_72943_2_) {
  22898. return this.field_72988_C.func_75742_a(p_72943_1_, p_72943_2_);
  22899. }
  22900.  
  22901. public int func_72841_b(String p_72841_1_) {
  22902. return this.field_72988_C.func_75743_a(p_72841_1_);
  22903. }
  22904.  
  22905. public void func_175669_a(int p_175669_1_, BlockPos p_175669_2_, int p_175669_3_) {
  22906. for(int i = 0; i < this.field_73021_x.size(); ++i) {
  22907. ((IWorldEventListener)this.field_73021_x.get(i)).func_180440_a(p_175669_1_, p_175669_2_, p_175669_3_);
  22908. }
  22909.  
  22910. }
  22911.  
  22912. public void func_175718_b(int p_175718_1_, BlockPos p_175718_2_, int p_175718_3_) {
  22913. this.func_180498_a((EntityPlayer)null, p_175718_1_, p_175718_2_, p_175718_3_);
  22914. }
  22915.  
  22916. public void func_180498_a(@Nullable EntityPlayer p_180498_1_, int p_180498_2_, BlockPos p_180498_3_, int p_180498_4_) {
  22917. try {
  22918. for(int i = 0; i < this.field_73021_x.size(); ++i) {
  22919. ((IWorldEventListener)this.field_73021_x.get(i)).func_180439_a(p_180498_1_, p_180498_2_, p_180498_3_, p_180498_4_);
  22920. }
  22921.  
  22922. } catch (Throwable throwable) {
  22923. CrashReport crashreport = CrashReport.func_85055_a(throwable, "Playing level event");
  22924. CrashReportCategory crashreportcategory = crashreport.func_85058_a("Level event being played");
  22925. crashreportcategory.func_71507_a("Block coordinates", CrashReportCategory.func_180522_a(p_180498_3_));
  22926. crashreportcategory.func_71507_a("Event source", p_180498_1_);
  22927. crashreportcategory.func_71507_a("Event type", Integer.valueOf(p_180498_2_));
  22928. crashreportcategory.func_71507_a("Event data", Integer.valueOf(p_180498_4_));
  22929. throw new ReportedException(crashreport);
  22930. }
  22931. }
  22932.  
  22933. public int func_72800_K() {
  22934. return 256;
  22935. }
  22936.  
  22937. public int func_72940_L() {
  22938. return this.field_73011_w.func_177495_o()?128:256;
  22939. }
  22940.  
  22941. public Random func_72843_D(int p_72843_1_, int p_72843_2_, int p_72843_3_) {
  22942. long i = (long)p_72843_1_ * 341873128712L + (long)p_72843_2_ * 132897987541L + this.func_72912_H().func_76063_b() + (long)p_72843_3_;
  22943. this.field_73012_v.setSeed(i);
  22944. return this.field_73012_v;
  22945. }
  22946.  
  22947. public CrashReportCategory func_72914_a(CrashReport p_72914_1_) {
  22948. CrashReportCategory crashreportcategory = p_72914_1_.func_85057_a("Affected level", 1);
  22949. crashreportcategory.func_71507_a("Level name", this.field_72986_A == null?"????":this.field_72986_A.func_76065_j());
  22950. crashreportcategory.func_189529_a("All players", new ICrashReportDetail<String>() {
  22951. public String call() {
  22952. return World.this.field_73010_i.size() + " total; " + World.this.field_73010_i;
  22953. }
  22954. });
  22955. crashreportcategory.func_189529_a("Chunk stats", new ICrashReportDetail<String>() {
  22956. public String call() {
  22957. return World.this.field_73020_y.func_73148_d();
  22958. }
  22959. });
  22960.  
  22961. try {
  22962. this.field_72986_A.func_85118_a(crashreportcategory);
  22963. } catch (Throwable throwable) {
  22964. crashreportcategory.func_71499_a("Level Data Unobtainable", throwable);
  22965. }
  22966.  
  22967. return crashreportcategory;
  22968. }
  22969.  
  22970. @SideOnly(Side.CLIENT)
  22971. public double func_72919_O() {
  22972. return this.field_72986_A.func_76067_t() == WorldType.field_77138_c?0.0D:63.0D;
  22973. }
  22974.  
  22975. public void func_175715_c(int p_175715_1_, BlockPos p_175715_2_, int p_175715_3_) {
  22976. for(int i = 0; i < this.field_73021_x.size(); ++i) {
  22977. IWorldEventListener iworldeventlistener = (IWorldEventListener)this.field_73021_x.get(i);
  22978. iworldeventlistener.func_180441_b(p_175715_1_, p_175715_2_, p_175715_3_);
  22979. }
  22980.  
  22981. }
  22982.  
  22983. public Calendar func_83015_S() {
  22984. if(this.func_82737_E() % 600L == 0L) {
  22985. this.field_83016_L.setTimeInMillis(MinecraftServer.func_130071_aq());
  22986. }
  22987.  
  22988. return this.field_83016_L;
  22989. }
  22990.  
  22991. @SideOnly(Side.CLIENT)
  22992. public void func_92088_a(double p_92088_1_, double p_92088_3_, double p_92088_5_, double p_92088_7_, double p_92088_9_, double p_92088_11_, @Nullable NBTTagCompound p_92088_13_) {
  22993. }
  22994.  
  22995. public Scoreboard func_96441_U() {
  22996. return this.field_96442_D;
  22997. }
  22998.  
  22999. public void func_175666_e(BlockPos p_175666_1_, Block p_175666_2_) {
  23000. for(EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) {
  23001. BlockPos blockpos = p_175666_1_.func_177972_a(enumfacing);
  23002. if(this.func_175667_e(blockpos)) {
  23003. IBlockState iblockstate = this.func_180495_p(blockpos);
  23004. if(Blocks.field_150441_bU.func_185547_C(iblockstate)) {
  23005. iblockstate.func_189546_a(this, blockpos, p_175666_2_, p_175666_1_);
  23006. } else if(iblockstate.func_185915_l()) {
  23007. blockpos = blockpos.func_177972_a(enumfacing);
  23008. iblockstate = this.func_180495_p(blockpos);
  23009. if(Blocks.field_150441_bU.func_185547_C(iblockstate)) {
  23010. iblockstate.func_189546_a(this, blockpos, p_175666_2_, p_175666_1_);
  23011. }
  23012. }
  23013. }
  23014. }
  23015.  
  23016. }
  23017.  
  23018. public DifficultyInstance func_175649_E(BlockPos p_175649_1_) {
  23019. long i = 0L;
  23020. float f = 0.0F;
  23021. if(this.func_175667_e(p_175649_1_)) {
  23022. f = this.func_130001_d();
  23023. i = this.func_175726_f(p_175649_1_).func_177416_w();
  23024. }
  23025.  
  23026. return new DifficultyInstance(this.func_175659_aa(), this.func_72820_D(), i, f);
  23027. }
  23028.  
  23029. public EnumDifficulty func_175659_aa() {
  23030. return this.func_72912_H().func_176130_y();
  23031. }
  23032.  
  23033. public int func_175657_ab() {
  23034. return this.field_73008_k;
  23035. }
  23036.  
  23037. public void func_175692_b(int p_175692_1_) {
  23038. this.field_73008_k = p_175692_1_;
  23039. }
  23040.  
  23041. @SideOnly(Side.CLIENT)
  23042. public int func_175658_ac() {
  23043. return this.field_73016_r;
  23044. }
  23045.  
  23046. public void func_175702_c(int p_175702_1_) {
  23047. this.field_73016_r = p_175702_1_;
  23048. }
  23049.  
  23050. public VillageCollection func_175714_ae() {
  23051. return this.field_72982_D;
  23052. }
  23053.  
  23054. public WorldBorder func_175723_af() {
  23055. return this.field_175728_M;
  23056. }
  23057.  
  23058. public boolean func_72916_c(int p_72916_1_, int p_72916_2_) {
  23059. BlockPos blockpos = this.func_175694_M();
  23060. int i = p_72916_1_ * 16 + 8 - blockpos.func_177958_n();
  23061. int j = p_72916_2_ * 16 + 8 - blockpos.func_177952_p();
  23062. int k = 128;
  23063. return i >= -128 && i <= 128 && j >= -128 && j <= 128;
  23064. }
  23065.  
  23066. public void func_184135_a(Packet<?> p_184135_1_) {
  23067. throw new UnsupportedOperationException("Can\'t send packets to server unless you\'re on the client.");
  23068. }
  23069.  
  23070. public LootTableManager func_184146_ak() {
  23071. return this.field_184151_B;
  23072. }
  23073.  
  23074. @Nullable
  23075. public BlockPos func_190528_a(String p_190528_1_, BlockPos p_190528_2_, boolean p_190528_3_) {
  23076. return null;
  23077. }
  23078. }
  23079.  
  23080. Patching failed: minecraft\net\minecraft\block\BlockFurnace.java
  23081. Hunk 1 failed! Cannot find hunk target
  23082. }
  23083.  
  23084. @SideOnly(Side.CLIENT)
  23085. + @SuppressWarnings("incomplete-switch")
  23086. public void func_180655_c(IBlockState p_180655_1_, World p_180655_2_, BlockPos p_180655_3_, Random p_180655_4_) {
  23087. if (this.field_149932_b) {
  23088. EnumFacing enumfacing = (EnumFacing)p_180655_1_.func_177229_b(field_176447_a);
  23089. File state
  23090. package net.minecraft.block;
  23091.  
  23092. import java.util.Random;
  23093. import net.minecraft.block.BlockContainer;
  23094. import net.minecraft.block.BlockHorizontal;
  23095. import net.minecraft.block.material.Material;
  23096. import net.minecraft.block.properties.IProperty;
  23097. import net.minecraft.block.properties.PropertyDirection;
  23098. import net.minecraft.block.state.BlockStateContainer;
  23099. import net.minecraft.block.state.IBlockState;
  23100. import net.minecraft.entity.EntityLivingBase;
  23101. import net.minecraft.entity.player.EntityPlayer;
  23102. import net.minecraft.init.Blocks;
  23103. import net.minecraft.init.SoundEvents;
  23104. import net.minecraft.inventory.Container;
  23105. import net.minecraft.inventory.InventoryHelper;
  23106. import net.minecraft.item.Item;
  23107. import net.minecraft.item.ItemStack;
  23108. import net.minecraft.stats.StatList;
  23109. import net.minecraft.tileentity.TileEntity;
  23110. import net.minecraft.tileentity.TileEntityFurnace;
  23111. import net.minecraft.util.EnumBlockRenderType;
  23112. import net.minecraft.util.EnumFacing;
  23113. import net.minecraft.util.EnumHand;
  23114. import net.minecraft.util.EnumParticleTypes;
  23115. import net.minecraft.util.Mirror;
  23116. import net.minecraft.util.Rotation;
  23117. import net.minecraft.util.SoundCategory;
  23118. import net.minecraft.util.math.BlockPos;
  23119. import net.minecraft.world.World;
  23120. import net.minecraftforge.fml.relauncher.Side;
  23121. import net.minecraftforge.fml.relauncher.SideOnly;
  23122.  
  23123. public class BlockFurnace extends BlockContainer {
  23124. public static final PropertyDirection field_176447_a = BlockHorizontal.field_185512_D;
  23125. private final boolean field_149932_b;
  23126. private static boolean field_149934_M;
  23127.  
  23128. protected BlockFurnace(boolean p_i45407_1_) {
  23129. super(Material.field_151576_e);
  23130. this.func_180632_j(this.field_176227_L.func_177621_b().func_177226_a(field_176447_a, EnumFacing.NORTH));
  23131. this.field_149932_b = p_i45407_1_;
  23132. }
  23133.  
  23134. public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_) {
  23135. return Item.func_150898_a(Blocks.field_150460_al);
  23136. }
  23137.  
  23138. public void func_176213_c(World p_176213_1_, BlockPos p_176213_2_, IBlockState p_176213_3_) {
  23139. this.func_176445_e(p_176213_1_, p_176213_2_, p_176213_3_);
  23140. }
  23141.  
  23142. private void func_176445_e(World p_176445_1_, BlockPos p_176445_2_, IBlockState p_176445_3_) {
  23143. if(!p_176445_1_.field_72995_K) {
  23144. IBlockState iblockstate = p_176445_1_.func_180495_p(p_176445_2_.func_177978_c());
  23145. IBlockState iblockstate1 = p_176445_1_.func_180495_p(p_176445_2_.func_177968_d());
  23146. IBlockState iblockstate2 = p_176445_1_.func_180495_p(p_176445_2_.func_177976_e());
  23147. IBlockState iblockstate3 = p_176445_1_.func_180495_p(p_176445_2_.func_177974_f());
  23148. EnumFacing enumfacing = (EnumFacing)p_176445_3_.func_177229_b(field_176447_a);
  23149. if(enumfacing == EnumFacing.NORTH && iblockstate.func_185913_b() && !iblockstate1.func_185913_b()) {
  23150. enumfacing = EnumFacing.SOUTH;
  23151. } else if(enumfacing == EnumFacing.SOUTH && iblockstate1.func_185913_b() && !iblockstate.func_185913_b()) {
  23152. enumfacing = EnumFacing.NORTH;
  23153. } else if(enumfacing == EnumFacing.WEST && iblockstate2.func_185913_b() && !iblockstate3.func_185913_b()) {
  23154. enumfacing = EnumFacing.EAST;
  23155. } else if(enumfacing == EnumFacing.EAST && iblockstate3.func_185913_b() && !iblockstate2.func_185913_b()) {
  23156. enumfacing = EnumFacing.WEST;
  23157. }
  23158.  
  23159. p_176445_1_.func_180501_a(p_176445_2_, p_176445_3_.func_177226_a(field_176447_a, enumfacing), 2);
  23160. }
  23161. }
  23162.  
  23163. @SideOnly(Side.CLIENT)
  23164. public void func_180655_c(IBlockState p_180655_1_, World p_180655_2_, BlockPos p_180655_3_, Random p_180655_4_) {
  23165. if(this.field_149932_b) {
  23166. EnumFacing enumfacing = (EnumFacing)p_180655_1_.func_177229_b(field_176447_a);
  23167. double d0 = (double)p_180655_3_.func_177958_n() + 0.5D;
  23168. double d1 = (double)p_180655_3_.func_177956_o() + p_180655_4_.nextDouble() * 6.0D / 16.0D;
  23169. double d2 = (double)p_180655_3_.func_177952_p() + 0.5D;
  23170. double d3 = 0.52D;
  23171. double d4 = p_180655_4_.nextDouble() * 0.6D - 0.3D;
  23172. if(p_180655_4_.nextDouble() < 0.1D) {
  23173. p_180655_2_.func_184134_a((double)p_180655_3_.func_177958_n() + 0.5D, (double)p_180655_3_.func_177956_o(), (double)p_180655_3_.func_177952_p() + 0.5D, SoundEvents.field_187652_bv, SoundCategory.BLOCKS, 1.0F, 1.0F, false);
  23174. }
  23175.  
  23176. switch(enumfacing) {
  23177. case WEST:
  23178. p_180655_2_.func_175688_a(EnumParticleTypes.SMOKE_NORMAL, d0 - 0.52D, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]);
  23179. p_180655_2_.func_175688_a(EnumParticleTypes.FLAME, d0 - 0.52D, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]);
  23180. break;
  23181. case EAST:
  23182. p_180655_2_.func_175688_a(EnumParticleTypes.SMOKE_NORMAL, d0 + 0.52D, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]);
  23183. p_180655_2_.func_175688_a(EnumParticleTypes.FLAME, d0 + 0.52D, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]);
  23184. break;
  23185. case NORTH:
  23186. p_180655_2_.func_175688_a(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 - 0.52D, 0.0D, 0.0D, 0.0D, new int[0]);
  23187. p_180655_2_.func_175688_a(EnumParticleTypes.FLAME, d0 + d4, d1, d2 - 0.52D, 0.0D, 0.0D, 0.0D, new int[0]);
  23188. break;
  23189. case SOUTH:
  23190. p_180655_2_.func_175688_a(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 + 0.52D, 0.0D, 0.0D, 0.0D, new int[0]);
  23191. p_180655_2_.func_175688_a(EnumParticleTypes.FLAME, d0 + d4, d1, d2 + 0.52D, 0.0D, 0.0D, 0.0D, new int[0]);
  23192. }
  23193.  
  23194. }
  23195. }
  23196.  
  23197. public boolean func_180639_a(World p_180639_1_, BlockPos p_180639_2_, IBlockState p_180639_3_, EntityPlayer p_180639_4_, EnumHand p_180639_5_, EnumFacing p_180639_6_, float p_180639_7_, float p_180639_8_, float p_180639_9_) {
  23198. if(p_180639_1_.field_72995_K) {
  23199. return true;
  23200. } else {
  23201. TileEntity tileentity = p_180639_1_.func_175625_s(p_180639_2_);
  23202. if(tileentity instanceof TileEntityFurnace) {
  23203. p_180639_4_.func_71007_a((TileEntityFurnace)tileentity);
  23204. p_180639_4_.func_71029_a(StatList.field_188061_aa);
  23205. }
  23206.  
  23207. return true;
  23208. }
  23209. }
  23210.  
  23211. public static void func_176446_a(boolean p_176446_0_, World p_176446_1_, BlockPos p_176446_2_) {
  23212. IBlockState iblockstate = p_176446_1_.func_180495_p(p_176446_2_);
  23213. TileEntity tileentity = p_176446_1_.func_175625_s(p_176446_2_);
  23214. field_149934_M = true;
  23215. if(p_176446_0_) {
  23216. p_176446_1_.func_180501_a(p_176446_2_, Blocks.field_150470_am.func_176223_P().func_177226_a(field_176447_a, iblockstate.func_177229_b(field_176447_a)), 3);
  23217. p_176446_1_.func_180501_a(p_176446_2_, Blocks.field_150470_am.func_176223_P().func_177226_a(field_176447_a, iblockstate.func_177229_b(field_176447_a)), 3);
  23218. } else {
  23219. p_176446_1_.func_180501_a(p_176446_2_, Blocks.field_150460_al.func_176223_P().func_177226_a(field_176447_a, iblockstate.func_177229_b(field_176447_a)), 3);
  23220. p_176446_1_.func_180501_a(p_176446_2_, Blocks.field_150460_al.func_176223_P().func_177226_a(field_176447_a, iblockstate.func_177229_b(field_176447_a)), 3);
  23221. }
  23222.  
  23223. field_149934_M = false;
  23224. if(tileentity != null) {
  23225. tileentity.func_145829_t();
  23226. p_176446_1_.func_175690_a(p_176446_2_, tileentity);
  23227. }
  23228.  
  23229. }
  23230.  
  23231. public TileEntity func_149915_a(World p_149915_1_, int p_149915_2_) {
  23232. return new TileEntityFurnace();
  23233. }
  23234.  
  23235. public IBlockState func_180642_a(World p_180642_1_, BlockPos p_180642_2_, EnumFacing p_180642_3_, float p_180642_4_, float p_180642_5_, float p_180642_6_, int p_180642_7_, EntityLivingBase p_180642_8_) {
  23236. return this.func_176223_P().func_177226_a(field_176447_a, p_180642_8_.func_174811_aO().func_176734_d());
  23237. }
  23238.  
  23239. public void func_180633_a(World p_180633_1_, BlockPos p_180633_2_, IBlockState p_180633_3_, EntityLivingBase p_180633_4_, ItemStack p_180633_5_) {
  23240. p_180633_1_.func_180501_a(p_180633_2_, p_180633_3_.func_177226_a(field_176447_a, p_180633_4_.func_174811_aO().func_176734_d()), 2);
  23241. if(p_180633_5_.func_82837_s()) {
  23242. TileEntity tileentity = p_180633_1_.func_175625_s(p_180633_2_);
  23243. if(tileentity instanceof TileEntityFurnace) {
  23244. ((TileEntityFurnace)tileentity).func_145951_a(p_180633_5_.func_82833_r());
  23245. }
  23246. }
  23247.  
  23248. }
  23249.  
  23250. public void func_180663_b(World p_180663_1_, BlockPos p_180663_2_, IBlockState p_180663_3_) {
  23251. if(!field_149934_M) {
  23252. TileEntity tileentity = p_180663_1_.func_175625_s(p_180663_2_);
  23253. if(tileentity instanceof TileEntityFurnace) {
  23254. InventoryHelper.func_180175_a(p_180663_1_, p_180663_2_, (TileEntityFurnace)tileentity);
  23255. p_180663_1_.func_175666_e(p_180663_2_, this);
  23256. }
  23257. }
  23258.  
  23259. super.func_180663_b(p_180663_1_, p_180663_2_, p_180663_3_);
  23260. }
  23261.  
  23262. public boolean func_149740_M(IBlockState p_149740_1_) {
  23263. return true;
  23264. }
  23265.  
  23266. public int func_180641_l(IBlockState p_180641_1_, World p_180641_2_, BlockPos p_180641_3_) {
  23267. return Container.func_178144_a(p_180641_2_.func_175625_s(p_180641_3_));
  23268. }
  23269.  
  23270. public ItemStack func_185473_a(World p_185473_1_, BlockPos p_185473_2_, IBlockState p_185473_3_) {
  23271. return new ItemStack(Blocks.field_150460_al);
  23272. }
  23273.  
  23274. public EnumBlockRenderType func_149645_b(IBlockState p_149645_1_) {
  23275. return EnumBlockRenderType.MODEL;
  23276. }
  23277.  
  23278. public IBlockState func_176203_a(int p_176203_1_) {
  23279. EnumFacing enumfacing = EnumFacing.func_82600_a(p_176203_1_);
  23280. if(enumfacing.func_176740_k() == EnumFacing.Axis.Y) {
  23281. enumfacing = EnumFacing.NORTH;
  23282. }
  23283.  
  23284. return this.func_176223_P().func_177226_a(field_176447_a, enumfacing);
  23285. }
  23286.  
  23287. public int func_176201_c(IBlockState p_176201_1_) {
  23288. return ((EnumFacing)p_176201_1_.func_177229_b(field_176447_a)).func_176745_a();
  23289. }
  23290.  
  23291. public IBlockState func_185499_a(IBlockState p_185499_1_, Rotation p_185499_2_) {
  23292. return p_185499_1_.func_177226_a(field_176447_a, p_185499_2_.func_185831_a((EnumFacing)p_185499_1_.func_177229_b(field_176447_a)));
  23293. }
  23294.  
  23295. public IBlockState func_185471_a(IBlockState p_185471_1_, Mirror p_185471_2_) {
  23296. return p_185471_1_.func_185907_a(p_185471_2_.func_185800_a((EnumFacing)p_185471_1_.func_177229_b(field_176447_a)));
  23297. }
  23298.  
  23299. protected BlockStateContainer func_180661_e() {
  23300. return new BlockStateContainer(this, new IProperty[]{field_176447_a});
  23301. }
  23302. }
  23303.  
  23304. Patching failed: minecraft\net\minecraft\block\BlockRailPowered.java
  23305. Hunk 1 failed! Cannot find hunk target
  23306. this.func_180632_j(this.field_176227_L.func_177621_b().func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.NORTH_SOUTH).func_177226_a(field_176569_M, Boolean.valueOf(false)));
  23307. }
  23308.  
  23309. + @SuppressWarnings("incomplete-switch")
  23310. protected boolean func_176566_a(World p_176566_1_, BlockPos p_176566_2_, IBlockState p_176566_3_, boolean p_176566_4_, int p_176566_5_) {
  23311. if (p_176566_5_ >= 8) {
  23312. return false;
  23313. File state
  23314. package net.minecraft.block;
  23315.  
  23316. import com.google.common.base.Predicate;
  23317. import javax.annotation.Nullable;
  23318. import net.minecraft.block.Block;
  23319. import net.minecraft.block.BlockRailBase;
  23320. import net.minecraft.block.properties.IProperty;
  23321. import net.minecraft.block.properties.PropertyBool;
  23322. import net.minecraft.block.properties.PropertyEnum;
  23323. import net.minecraft.block.state.BlockStateContainer;
  23324. import net.minecraft.block.state.IBlockState;
  23325. import net.minecraft.util.Mirror;
  23326. import net.minecraft.util.Rotation;
  23327. import net.minecraft.util.math.BlockPos;
  23328. import net.minecraft.world.World;
  23329.  
  23330. public class BlockRailPowered extends BlockRailBase {
  23331. public static final PropertyEnum<BlockRailBase.EnumRailDirection> field_176568_b = PropertyEnum.<BlockRailBase.EnumRailDirection>func_177708_a("shape", BlockRailBase.EnumRailDirection.class, new Predicate<BlockRailBase.EnumRailDirection>() {
  23332. public boolean apply(@Nullable BlockRailBase.EnumRailDirection p_apply_1_) {
  23333. return p_apply_1_ != BlockRailBase.EnumRailDirection.NORTH_EAST && p_apply_1_ != BlockRailBase.EnumRailDirection.NORTH_WEST && p_apply_1_ != BlockRailBase.EnumRailDirection.SOUTH_EAST && p_apply_1_ != BlockRailBase.EnumRailDirection.SOUTH_WEST;
  23334. }
  23335. });
  23336. public static final PropertyBool field_176569_M = PropertyBool.func_177716_a("powered");
  23337.  
  23338. protected BlockRailPowered() {
  23339. super(true);
  23340. this.func_180632_j(this.field_176227_L.func_177621_b().func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.NORTH_SOUTH).func_177226_a(field_176569_M, Boolean.valueOf(false)));
  23341. }
  23342.  
  23343. protected boolean func_176566_a(World p_176566_1_, BlockPos p_176566_2_, IBlockState p_176566_3_, boolean p_176566_4_, int p_176566_5_) {
  23344. if(p_176566_5_ >= 8) {
  23345. return false;
  23346. } else {
  23347. int i = p_176566_2_.func_177958_n();
  23348. int j = p_176566_2_.func_177956_o();
  23349. int k = p_176566_2_.func_177952_p();
  23350. boolean flag = true;
  23351. BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)p_176566_3_.func_177229_b(field_176568_b);
  23352. switch(blockrailbase$enumraildirection) {
  23353. case NORTH_SOUTH:
  23354. if(p_176566_4_) {
  23355. ++k;
  23356. } else {
  23357. --k;
  23358. }
  23359. break;
  23360. case EAST_WEST:
  23361. if(p_176566_4_) {
  23362. --i;
  23363. } else {
  23364. ++i;
  23365. }
  23366. break;
  23367. case ASCENDING_EAST:
  23368. if(p_176566_4_) {
  23369. --i;
  23370. } else {
  23371. ++i;
  23372. ++j;
  23373. flag = false;
  23374. }
  23375.  
  23376. blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.EAST_WEST;
  23377. break;
  23378. case ASCENDING_WEST:
  23379. if(p_176566_4_) {
  23380. --i;
  23381. ++j;
  23382. flag = false;
  23383. } else {
  23384. ++i;
  23385. }
  23386.  
  23387. blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.EAST_WEST;
  23388. break;
  23389. case ASCENDING_NORTH:
  23390. if(p_176566_4_) {
  23391. ++k;
  23392. } else {
  23393. --k;
  23394. ++j;
  23395. flag = false;
  23396. }
  23397.  
  23398. blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_SOUTH;
  23399. break;
  23400. case ASCENDING_SOUTH:
  23401. if(p_176566_4_) {
  23402. ++k;
  23403. ++j;
  23404. flag = false;
  23405. } else {
  23406. --k;
  23407. }
  23408.  
  23409. blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_SOUTH;
  23410. }
  23411.  
  23412. return this.func_176567_a(p_176566_1_, new BlockPos(i, j, k), p_176566_4_, p_176566_5_, blockrailbase$enumraildirection)?true:flag && this.func_176567_a(p_176566_1_, new BlockPos(i, j - 1, k), p_176566_4_, p_176566_5_, blockrailbase$enumraildirection);
  23413. }
  23414. }
  23415.  
  23416. protected boolean func_176567_a(World p_176567_1_, BlockPos p_176567_2_, boolean p_176567_3_, int p_176567_4_, BlockRailBase.EnumRailDirection p_176567_5_) {
  23417. IBlockState iblockstate = p_176567_1_.func_180495_p(p_176567_2_);
  23418. if(iblockstate.func_177230_c() != this) {
  23419. return false;
  23420. } else {
  23421. BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)iblockstate.func_177229_b(field_176568_b);
  23422. return p_176567_5_ != BlockRailBase.EnumRailDirection.EAST_WEST || blockrailbase$enumraildirection != BlockRailBase.EnumRailDirection.NORTH_SOUTH && blockrailbase$enumraildirection != BlockRailBase.EnumRailDirection.ASCENDING_NORTH && blockrailbase$enumraildirection != BlockRailBase.EnumRailDirection.ASCENDING_SOUTH?(p_176567_5_ != BlockRailBase.EnumRailDirection.NORTH_SOUTH || blockrailbase$enumraildirection != BlockRailBase.EnumRailDirection.EAST_WEST && blockrailbase$enumraildirection != BlockRailBase.EnumRailDirection.ASCENDING_EAST && blockrailbase$enumraildirection != BlockRailBase.EnumRailDirection.ASCENDING_WEST?(((Boolean)iblockstate.func_177229_b(field_176569_M)).booleanValue()?(p_176567_1_.func_175640_z(p_176567_2_)?true:this.func_176566_a(p_176567_1_, p_176567_2_, iblockstate, p_176567_3_, p_176567_4_ + 1)):false):false):false;
  23423. }
  23424. }
  23425.  
  23426. protected void func_189541_b(IBlockState p_189541_1_, World p_189541_2_, BlockPos p_189541_3_, Block p_189541_4_) {
  23427. boolean flag = ((Boolean)p_189541_1_.func_177229_b(field_176569_M)).booleanValue();
  23428. boolean flag1 = p_189541_2_.func_175640_z(p_189541_3_) || this.func_176566_a(p_189541_2_, p_189541_3_, p_189541_1_, true, 0) || this.func_176566_a(p_189541_2_, p_189541_3_, p_189541_1_, false, 0);
  23429. if(flag1 != flag) {
  23430. p_189541_2_.func_180501_a(p_189541_3_, p_189541_1_.func_177226_a(field_176569_M, Boolean.valueOf(flag1)), 3);
  23431. p_189541_2_.func_175685_c(p_189541_3_.func_177977_b(), this, false);
  23432. if(((BlockRailBase.EnumRailDirection)p_189541_1_.func_177229_b(field_176568_b)).func_177018_c()) {
  23433. p_189541_2_.func_175685_c(p_189541_3_.func_177984_a(), this, false);
  23434. }
  23435. }
  23436.  
  23437. }
  23438.  
  23439. public IProperty<BlockRailBase.EnumRailDirection> func_176560_l() {
  23440. return field_176568_b;
  23441. }
  23442.  
  23443. public IBlockState func_176203_a(int p_176203_1_) {
  23444. return this.func_176223_P().func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.func_177016_a(p_176203_1_ & 7)).func_177226_a(field_176569_M, Boolean.valueOf((p_176203_1_ & 8) > 0));
  23445. }
  23446.  
  23447. public int func_176201_c(IBlockState p_176201_1_) {
  23448. int i = 0;
  23449. i = i | ((BlockRailBase.EnumRailDirection)p_176201_1_.func_177229_b(field_176568_b)).func_177015_a();
  23450. if(((Boolean)p_176201_1_.func_177229_b(field_176569_M)).booleanValue()) {
  23451. i |= 8;
  23452. }
  23453.  
  23454. return i;
  23455. }
  23456.  
  23457. public IBlockState func_185499_a(IBlockState p_185499_1_, Rotation p_185499_2_) {
  23458. switch(p_185499_2_) {
  23459. case CLOCKWISE_180:
  23460. switch((BlockRailBase.EnumRailDirection)p_185499_1_.func_177229_b(field_176568_b)) {
  23461. case ASCENDING_EAST:
  23462. return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.ASCENDING_WEST);
  23463. case ASCENDING_WEST:
  23464. return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.ASCENDING_EAST);
  23465. case ASCENDING_NORTH:
  23466. return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.ASCENDING_SOUTH);
  23467. case ASCENDING_SOUTH:
  23468. return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.ASCENDING_NORTH);
  23469. case SOUTH_EAST:
  23470. return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.NORTH_WEST);
  23471. case SOUTH_WEST:
  23472. return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.NORTH_EAST);
  23473. case NORTH_WEST:
  23474. return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.SOUTH_EAST);
  23475. case NORTH_EAST:
  23476. return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.SOUTH_WEST);
  23477. }
  23478. case COUNTERCLOCKWISE_90:
  23479. switch((BlockRailBase.EnumRailDirection)p_185499_1_.func_177229_b(field_176568_b)) {
  23480. case NORTH_SOUTH:
  23481. return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.EAST_WEST);
  23482. case EAST_WEST:
  23483. return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.NORTH_SOUTH);
  23484. case ASCENDING_EAST:
  23485. return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.ASCENDING_NORTH);
  23486. case ASCENDING_WEST:
  23487. return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.ASCENDING_SOUTH);
  23488. case ASCENDING_NORTH:
  23489. return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.ASCENDING_WEST);
  23490. case ASCENDING_SOUTH:
  23491. return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.ASCENDING_EAST);
  23492. case SOUTH_EAST:
  23493. return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.NORTH_EAST);
  23494. case SOUTH_WEST:
  23495. return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.SOUTH_EAST);
  23496. case NORTH_WEST:
  23497. return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.SOUTH_WEST);
  23498. case NORTH_EAST:
  23499. return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.NORTH_WEST);
  23500. }
  23501. case CLOCKWISE_90:
  23502. switch((BlockRailBase.EnumRailDirection)p_185499_1_.func_177229_b(field_176568_b)) {
  23503. case NORTH_SOUTH:
  23504. return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.EAST_WEST);
  23505. case EAST_WEST:
  23506. return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.NORTH_SOUTH);
  23507. case ASCENDING_EAST:
  23508. return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.ASCENDING_SOUTH);
  23509. case ASCENDING_WEST:
  23510. return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.ASCENDING_NORTH);
  23511. case ASCENDING_NORTH:
  23512. return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.ASCENDING_EAST);
  23513. case ASCENDING_SOUTH:
  23514. return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.ASCENDING_WEST);
  23515. case SOUTH_EAST:
  23516. return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.SOUTH_WEST);
  23517. case SOUTH_WEST:
  23518. return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.NORTH_WEST);
  23519. case NORTH_WEST:
  23520. return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.NORTH_EAST);
  23521. case NORTH_EAST:
  23522. return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.SOUTH_EAST);
  23523. }
  23524. default:
  23525. return p_185499_1_;
  23526. }
  23527. }
  23528.  
  23529. public IBlockState func_185471_a(IBlockState p_185471_1_, Mirror p_185471_2_) {
  23530. BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)p_185471_1_.func_177229_b(field_176568_b);
  23531. switch(p_185471_2_) {
  23532. case LEFT_RIGHT:
  23533. switch(blockrailbase$enumraildirection) {
  23534. case ASCENDING_NORTH:
  23535. return p_185471_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.ASCENDING_SOUTH);
  23536. case ASCENDING_SOUTH:
  23537. return p_185471_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.ASCENDING_NORTH);
  23538. case SOUTH_EAST:
  23539. return p_185471_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.NORTH_EAST);
  23540. case SOUTH_WEST:
  23541. return p_185471_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.NORTH_WEST);
  23542. case NORTH_WEST:
  23543. return p_185471_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.SOUTH_WEST);
  23544. case NORTH_EAST:
  23545. return p_185471_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.SOUTH_EAST);
  23546. default:
  23547. return super.func_185471_a(p_185471_1_, p_185471_2_);
  23548. }
  23549. case FRONT_BACK:
  23550. switch(blockrailbase$enumraildirection) {
  23551. case ASCENDING_EAST:
  23552. return p_185471_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.ASCENDING_WEST);
  23553. case ASCENDING_WEST:
  23554. return p_185471_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.ASCENDING_EAST);
  23555. case ASCENDING_NORTH:
  23556. case ASCENDING_SOUTH:
  23557. default:
  23558. break;
  23559. case SOUTH_EAST:
  23560. return p_185471_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.SOUTH_WEST);
  23561. case SOUTH_WEST:
  23562. return p_185471_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.SOUTH_EAST);
  23563. case NORTH_WEST:
  23564. return p_185471_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.NORTH_EAST);
  23565. case NORTH_EAST:
  23566. return p_185471_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.NORTH_WEST);
  23567. }
  23568. }
  23569.  
  23570. return super.func_185471_a(p_185471_1_, p_185471_2_);
  23571. }
  23572.  
  23573. protected BlockStateContainer func_180661_e() {
  23574. return new BlockStateContainer(this, new IProperty[]{field_176568_b, field_176569_M});
  23575. }
  23576. }
  23577.  
  23578. Patching failed: minecraft\net\minecraft\tileentity\TileEntityChest.java
  23579. Hunk 1 failed! Cannot find hunk target
  23580. this.field_145984_a = false;
  23581. }
  23582.  
  23583. + @SuppressWarnings("incomplete-switch")
  23584. private void func_174910_a(TileEntityChest p_174910_1_, EnumFacing p_174910_2_) {
  23585. if (p_174910_1_.func_145837_r()) {
  23586. this.field_145984_a = false;
  23587. File state
  23588. package net.minecraft.tileentity;
  23589.  
  23590. import javax.annotation.Nullable;
  23591. import net.minecraft.block.Block;
  23592. import net.minecraft.block.BlockChest;
  23593. import net.minecraft.entity.player.EntityPlayer;
  23594. import net.minecraft.entity.player.InventoryPlayer;
  23595. import net.minecraft.init.SoundEvents;
  23596. import net.minecraft.inventory.Container;
  23597. import net.minecraft.inventory.ContainerChest;
  23598. import net.minecraft.inventory.IInventory;
  23599. import net.minecraft.inventory.InventoryLargeChest;
  23600. import net.minecraft.inventory.ItemStackHelper;
  23601. import net.minecraft.item.ItemStack;
  23602. import net.minecraft.nbt.NBTTagCompound;
  23603. import net.minecraft.tileentity.TileEntity;
  23604. import net.minecraft.tileentity.TileEntityLockableLoot;
  23605. import net.minecraft.util.EnumFacing;
  23606. import net.minecraft.util.ITickable;
  23607. import net.minecraft.util.NonNullList;
  23608. import net.minecraft.util.SoundCategory;
  23609. import net.minecraft.util.datafix.DataFixer;
  23610. import net.minecraft.util.datafix.FixTypes;
  23611. import net.minecraft.util.datafix.walkers.ItemStackDataLists;
  23612. import net.minecraft.util.math.AxisAlignedBB;
  23613. import net.minecraft.util.math.BlockPos;
  23614.  
  23615. public class TileEntityChest extends TileEntityLockableLoot implements ITickable {
  23616. private NonNullList<ItemStack> field_145985_p = NonNullList.<ItemStack>func_191197_a(27, ItemStack.field_190927_a);
  23617. public boolean field_145984_a;
  23618. public TileEntityChest field_145992_i;
  23619. public TileEntityChest field_145990_j;
  23620. public TileEntityChest field_145991_k;
  23621. public TileEntityChest field_145988_l;
  23622. public float field_145989_m;
  23623. public float field_145986_n;
  23624. public int field_145987_o;
  23625. private int field_145983_q;
  23626. private BlockChest.Type field_145982_r;
  23627.  
  23628. public TileEntityChest() {
  23629. }
  23630.  
  23631. public TileEntityChest(BlockChest.Type p_i46677_1_) {
  23632. this.field_145982_r = p_i46677_1_;
  23633. }
  23634.  
  23635. public int func_70302_i_() {
  23636. return 27;
  23637. }
  23638.  
  23639. public boolean func_191420_l() {
  23640. for(ItemStack itemstack : this.field_145985_p) {
  23641. if(!itemstack.func_190926_b()) {
  23642. return false;
  23643. }
  23644. }
  23645.  
  23646. return true;
  23647. }
  23648.  
  23649. public String func_70005_c_() {
  23650. return this.func_145818_k_()?this.field_190577_o:"container.chest";
  23651. }
  23652.  
  23653. public static void func_189677_a(DataFixer p_189677_0_) {
  23654. p_189677_0_.func_188258_a(FixTypes.BLOCK_ENTITY, new ItemStackDataLists(TileEntityChest.class, new String[]{"Items"}));
  23655. }
  23656.  
  23657. public void func_145839_a(NBTTagCompound p_145839_1_) {
  23658. super.func_145839_a(p_145839_1_);
  23659. this.field_145985_p = NonNullList.<ItemStack>func_191197_a(this.func_70302_i_(), ItemStack.field_190927_a);
  23660. if(!this.func_184283_b(p_145839_1_)) {
  23661. ItemStackHelper.func_191283_b(p_145839_1_, this.field_145985_p);
  23662. }
  23663.  
  23664. if(p_145839_1_.func_150297_b("CustomName", 8)) {
  23665. this.field_190577_o = p_145839_1_.func_74779_i("CustomName");
  23666. }
  23667.  
  23668. }
  23669.  
  23670. public NBTTagCompound func_189515_b(NBTTagCompound p_189515_1_) {
  23671. super.func_189515_b(p_189515_1_);
  23672. if(!this.func_184282_c(p_189515_1_)) {
  23673. ItemStackHelper.func_191282_a(p_189515_1_, this.field_145985_p);
  23674. }
  23675.  
  23676. if(this.func_145818_k_()) {
  23677. p_189515_1_.func_74778_a("CustomName", this.field_190577_o);
  23678. }
  23679.  
  23680. return p_189515_1_;
  23681. }
  23682.  
  23683. public int func_70297_j_() {
  23684. return 64;
  23685. }
  23686.  
  23687. public void func_145836_u() {
  23688. super.func_145836_u();
  23689. this.field_145984_a = false;
  23690. }
  23691.  
  23692. private void func_174910_a(TileEntityChest p_174910_1_, EnumFacing p_174910_2_) {
  23693. if(p_174910_1_.func_145837_r()) {
  23694. this.field_145984_a = false;
  23695. } else if(this.field_145984_a) {
  23696. switch(p_174910_2_) {
  23697. case NORTH:
  23698. if(this.field_145992_i != p_174910_1_) {
  23699. this.field_145984_a = false;
  23700. }
  23701. break;
  23702. case SOUTH:
  23703. if(this.field_145988_l != p_174910_1_) {
  23704. this.field_145984_a = false;
  23705. }
  23706. break;
  23707. case EAST:
  23708. if(this.field_145990_j != p_174910_1_) {
  23709. this.field_145984_a = false;
  23710. }
  23711. break;
  23712. case WEST:
  23713. if(this.field_145991_k != p_174910_1_) {
  23714. this.field_145984_a = false;
  23715. }
  23716. }
  23717. }
  23718.  
  23719. }
  23720.  
  23721. public void func_145979_i() {
  23722. if(!this.field_145984_a) {
  23723. this.field_145984_a = true;
  23724. this.field_145991_k = this.func_174911_a(EnumFacing.WEST);
  23725. this.field_145990_j = this.func_174911_a(EnumFacing.EAST);
  23726. this.field_145992_i = this.func_174911_a(EnumFacing.NORTH);
  23727. this.field_145988_l = this.func_174911_a(EnumFacing.SOUTH);
  23728. }
  23729. }
  23730.  
  23731. @Nullable
  23732. protected TileEntityChest func_174911_a(EnumFacing p_174911_1_) {
  23733. BlockPos blockpos = this.field_174879_c.func_177972_a(p_174911_1_);
  23734. if(this.func_174912_b(blockpos)) {
  23735. TileEntity tileentity = this.field_145850_b.func_175625_s(blockpos);
  23736. if(tileentity instanceof TileEntityChest) {
  23737. TileEntityChest tileentitychest = (TileEntityChest)tileentity;
  23738. tileentitychest.func_174910_a(this, p_174911_1_.func_176734_d());
  23739. return tileentitychest;
  23740. }
  23741. }
  23742.  
  23743. return null;
  23744. }
  23745.  
  23746. private boolean func_174912_b(BlockPos p_174912_1_) {
  23747. if(this.field_145850_b == null) {
  23748. return false;
  23749. } else {
  23750. Block block = this.field_145850_b.func_180495_p(p_174912_1_).func_177230_c();
  23751. return block instanceof BlockChest && ((BlockChest)block).field_149956_a == this.func_145980_j();
  23752. }
  23753. }
  23754.  
  23755. public void func_73660_a() {
  23756. this.func_145979_i();
  23757. int i = this.field_174879_c.func_177958_n();
  23758. int j = this.field_174879_c.func_177956_o();
  23759. int k = this.field_174879_c.func_177952_p();
  23760. ++this.field_145983_q;
  23761. if(!this.field_145850_b.field_72995_K && this.field_145987_o != 0 && (this.field_145983_q + i + j + k) % 200 == 0) {
  23762. this.field_145987_o = 0;
  23763. float f = 5.0F;
  23764.  
  23765. for(EntityPlayer entityplayer : this.field_145850_b.func_72872_a(EntityPlayer.class, new AxisAlignedBB((double)((float)i - 5.0F), (double)((float)j - 5.0F), (double)((float)k - 5.0F), (double)((float)(i + 1) + 5.0F), (double)((float)(j + 1) + 5.0F), (double)((float)(k + 1) + 5.0F)))) {
  23766. if(entityplayer.field_71070_bA instanceof ContainerChest) {
  23767. IInventory iinventory = ((ContainerChest)entityplayer.field_71070_bA).func_85151_d();
  23768. if(iinventory == this || iinventory instanceof InventoryLargeChest && ((InventoryLargeChest)iinventory).func_90010_a(this)) {
  23769. ++this.field_145987_o;
  23770. }
  23771. }
  23772. }
  23773. }
  23774.  
  23775. this.field_145986_n = this.field_145989_m;
  23776. float f1 = 0.1F;
  23777. if(this.field_145987_o > 0 && this.field_145989_m == 0.0F && this.field_145992_i == null && this.field_145991_k == null) {
  23778. double d1 = (double)i + 0.5D;
  23779. double d2 = (double)k + 0.5D;
  23780. if(this.field_145988_l != null) {
  23781. d2 += 0.5D;
  23782. }
  23783.  
  23784. if(this.field_145990_j != null) {
  23785. d1 += 0.5D;
  23786. }
  23787.  
  23788. this.field_145850_b.func_184148_a((EntityPlayer)null, d1, (double)j + 0.5D, d2, SoundEvents.field_187657_V, SoundCategory.BLOCKS, 0.5F, this.field_145850_b.field_73012_v.nextFloat() * 0.1F + 0.9F);
  23789. }
  23790.  
  23791. if(this.field_145987_o == 0 && this.field_145989_m > 0.0F || this.field_145987_o > 0 && this.field_145989_m < 1.0F) {
  23792. float f2 = this.field_145989_m;
  23793. if(this.field_145987_o > 0) {
  23794. this.field_145989_m += 0.1F;
  23795. } else {
  23796. this.field_145989_m -= 0.1F;
  23797. }
  23798.  
  23799. if(this.field_145989_m > 1.0F) {
  23800. this.field_145989_m = 1.0F;
  23801. }
  23802.  
  23803. float f3 = 0.5F;
  23804. if(this.field_145989_m < 0.5F && f2 >= 0.5F && this.field_145992_i == null && this.field_145991_k == null) {
  23805. double d3 = (double)i + 0.5D;
  23806. double d0 = (double)k + 0.5D;
  23807. if(this.field_145988_l != null) {
  23808. d0 += 0.5D;
  23809. }
  23810.  
  23811. if(this.field_145990_j != null) {
  23812. d3 += 0.5D;
  23813. }
  23814.  
  23815. this.field_145850_b.func_184148_a((EntityPlayer)null, d3, (double)j + 0.5D, d0, SoundEvents.field_187651_T, SoundCategory.BLOCKS, 0.5F, this.field_145850_b.field_73012_v.nextFloat() * 0.1F + 0.9F);
  23816. }
  23817.  
  23818. if(this.field_145989_m < 0.0F) {
  23819. this.field_145989_m = 0.0F;
  23820. }
  23821. }
  23822.  
  23823. }
  23824.  
  23825. public boolean func_145842_c(int p_145842_1_, int p_145842_2_) {
  23826. if(p_145842_1_ == 1) {
  23827. this.field_145987_o = p_145842_2_;
  23828. return true;
  23829. } else {
  23830. return super.func_145842_c(p_145842_1_, p_145842_2_);
  23831. }
  23832. }
  23833.  
  23834. public void func_174889_b(EntityPlayer p_174889_1_) {
  23835. if(!p_174889_1_.func_175149_v()) {
  23836. if(this.field_145987_o < 0) {
  23837. this.field_145987_o = 0;
  23838. }
  23839.  
  23840. ++this.field_145987_o;
  23841. this.field_145850_b.func_175641_c(this.field_174879_c, this.func_145838_q(), 1, this.field_145987_o);
  23842. this.field_145850_b.func_175685_c(this.field_174879_c, this.func_145838_q(), false);
  23843. if(this.func_145980_j() == BlockChest.Type.TRAP) {
  23844. this.field_145850_b.func_175685_c(this.field_174879_c.func_177977_b(), this.func_145838_q(), false);
  23845. }
  23846. }
  23847.  
  23848. }
  23849.  
  23850. public void func_174886_c(EntityPlayer p_174886_1_) {
  23851. if(!p_174886_1_.func_175149_v() && this.func_145838_q() instanceof BlockChest) {
  23852. --this.field_145987_o;
  23853. this.field_145850_b.func_175641_c(this.field_174879_c, this.func_145838_q(), 1, this.field_145987_o);
  23854. this.field_145850_b.func_175685_c(this.field_174879_c, this.func_145838_q(), false);
  23855. if(this.func_145980_j() == BlockChest.Type.TRAP) {
  23856. this.field_145850_b.func_175685_c(this.field_174879_c.func_177977_b(), this.func_145838_q(), false);
  23857. }
  23858. }
  23859.  
  23860. }
  23861.  
  23862. public void func_145843_s() {
  23863. super.func_145843_s();
  23864. this.func_145836_u();
  23865. this.func_145979_i();
  23866. }
  23867.  
  23868. public BlockChest.Type func_145980_j() {
  23869. if(this.field_145982_r == null) {
  23870. if(this.field_145850_b == null || !(this.func_145838_q() instanceof BlockChest)) {
  23871. return BlockChest.Type.BASIC;
  23872. }
  23873.  
  23874. this.field_145982_r = ((BlockChest)this.func_145838_q()).field_149956_a;
  23875. }
  23876.  
  23877. return this.field_145982_r;
  23878. }
  23879.  
  23880. public String func_174875_k() {
  23881. return "minecraft:chest";
  23882. }
  23883.  
  23884. public Container func_174876_a(InventoryPlayer p_174876_1_, EntityPlayer p_174876_2_) {
  23885. this.func_184281_d(p_174876_2_);
  23886. return new ContainerChest(p_174876_1_, this, p_174876_2_);
  23887. }
  23888.  
  23889. protected NonNullList<ItemStack> func_190576_q() {
  23890. return this.field_145985_p;
  23891. }
  23892. }
  23893.  
  23894. Patching failed: minecraft\net\minecraft\tileentity\TileEntityPiston.java
  23895. Hunk 1 failed! Cannot find hunk target
  23896. d1 = Math.min(d1, d0) + 0.01D;
  23897. field_190613_i.set(enumfacing);
  23898. entity.func_70091_d(MoverType.PISTON, d1 * (double)enumfacing.func_82601_c(), d1 * (double)enumfacing.func_96559_d(), d1 * (double)enumfacing.func_82599_e());
  23899. - field_190613_i.set((Object)null);
  23900. + field_190613_i.set(null);
  23901. if (!this.field_145875_k && this.field_145872_l) {
  23902. this.func_190605_a(entity, enumfacing, d0);
  23903. }
  23904. File state
  23905. package net.minecraft.tileentity;
  23906.  
  23907. import com.google.common.collect.Lists;
  23908. import java.util.List;
  23909. import javax.annotation.Nullable;
  23910. import net.minecraft.block.Block;
  23911. import net.minecraft.block.BlockPistonBase;
  23912. import net.minecraft.block.BlockPistonExtension;
  23913. import net.minecraft.block.material.EnumPushReaction;
  23914. import net.minecraft.block.state.IBlockState;
  23915. import net.minecraft.entity.Entity;
  23916. import net.minecraft.entity.MoverType;
  23917. import net.minecraft.init.Blocks;
  23918. import net.minecraft.nbt.NBTTagCompound;
  23919. import net.minecraft.tileentity.TileEntity;
  23920. import net.minecraft.util.EnumFacing;
  23921. import net.minecraft.util.ITickable;
  23922. import net.minecraft.util.datafix.DataFixer;
  23923. import net.minecraft.util.math.AxisAlignedBB;
  23924. import net.minecraft.util.math.BlockPos;
  23925. import net.minecraft.world.IBlockAccess;
  23926. import net.minecraft.world.World;
  23927. import net.minecraftforge.fml.relauncher.Side;
  23928. import net.minecraftforge.fml.relauncher.SideOnly;
  23929.  
  23930. public class TileEntityPiston extends TileEntity implements ITickable {
  23931. private IBlockState field_174932_a;
  23932. private EnumFacing field_174931_f;
  23933. private boolean field_145875_k;
  23934. private boolean field_145872_l;
  23935. private static final ThreadLocal<EnumFacing> field_190613_i = new ThreadLocal<EnumFacing>() {
  23936. protected EnumFacing initialValue() {
  23937. return null;
  23938. }
  23939. };
  23940. private float field_145873_m;
  23941. private float field_145870_n;
  23942.  
  23943. public TileEntityPiston() {
  23944. }
  23945.  
  23946. public TileEntityPiston(IBlockState p_i45665_1_, EnumFacing p_i45665_2_, boolean p_i45665_3_, boolean p_i45665_4_) {
  23947. this.field_174932_a = p_i45665_1_;
  23948. this.field_174931_f = p_i45665_2_;
  23949. this.field_145875_k = p_i45665_3_;
  23950. this.field_145872_l = p_i45665_4_;
  23951. }
  23952.  
  23953. public IBlockState func_174927_b() {
  23954. return this.field_174932_a;
  23955. }
  23956.  
  23957. public NBTTagCompound func_189517_E_() {
  23958. return this.func_189515_b(new NBTTagCompound());
  23959. }
  23960.  
  23961. public int func_145832_p() {
  23962. return 0;
  23963. }
  23964.  
  23965. public boolean func_145868_b() {
  23966. return this.field_145875_k;
  23967. }
  23968.  
  23969. public EnumFacing func_174930_e() {
  23970. return this.field_174931_f;
  23971. }
  23972.  
  23973. public boolean func_145867_d() {
  23974. return this.field_145872_l;
  23975. }
  23976.  
  23977. @SideOnly(Side.CLIENT)
  23978. public float func_145860_a(float p_145860_1_) {
  23979. if(p_145860_1_ > 1.0F) {
  23980. p_145860_1_ = 1.0F;
  23981. }
  23982.  
  23983. return this.field_145870_n + (this.field_145873_m - this.field_145870_n) * p_145860_1_;
  23984. }
  23985.  
  23986. @SideOnly(Side.CLIENT)
  23987. public float func_174929_b(float p_174929_1_) {
  23988. return (float)this.field_174931_f.func_82601_c() * this.func_184320_e(this.func_145860_a(p_174929_1_));
  23989. }
  23990.  
  23991. @SideOnly(Side.CLIENT)
  23992. public float func_174928_c(float p_174928_1_) {
  23993. return (float)this.field_174931_f.func_96559_d() * this.func_184320_e(this.func_145860_a(p_174928_1_));
  23994. }
  23995.  
  23996. @SideOnly(Side.CLIENT)
  23997. public float func_174926_d(float p_174926_1_) {
  23998. return (float)this.field_174931_f.func_82599_e() * this.func_184320_e(this.func_145860_a(p_174926_1_));
  23999. }
  24000.  
  24001. private float func_184320_e(float p_184320_1_) {
  24002. return this.field_145875_k?p_184320_1_ - 1.0F:1.0F - p_184320_1_;
  24003. }
  24004.  
  24005. public AxisAlignedBB func_184321_a(IBlockAccess p_184321_1_, BlockPos p_184321_2_) {
  24006. return this.func_184319_a(p_184321_1_, p_184321_2_, this.field_145873_m).func_111270_a(this.func_184319_a(p_184321_1_, p_184321_2_, this.field_145870_n));
  24007. }
  24008.  
  24009. public AxisAlignedBB func_184319_a(IBlockAccess p_184319_1_, BlockPos p_184319_2_, float p_184319_3_) {
  24010. p_184319_3_ = this.func_184320_e(p_184319_3_);
  24011. IBlockState iblockstate = this.func_190606_j();
  24012. return iblockstate.func_185900_c(p_184319_1_, p_184319_2_).func_72317_d((double)(p_184319_3_ * (float)this.field_174931_f.func_82601_c()), (double)(p_184319_3_ * (float)this.field_174931_f.func_96559_d()), (double)(p_184319_3_ * (float)this.field_174931_f.func_82599_e()));
  24013. }
  24014.  
  24015. private IBlockState func_190606_j() {
  24016. return !this.func_145868_b() && this.func_145867_d()?Blocks.field_150332_K.func_176223_P().func_177226_a(BlockPistonExtension.field_176325_b, this.field_174932_a.func_177230_c() == Blocks.field_150320_F?BlockPistonExtension.EnumPistonType.STICKY:BlockPistonExtension.EnumPistonType.DEFAULT).func_177226_a(BlockPistonExtension.field_176387_N, this.field_174932_a.func_177229_b(BlockPistonBase.field_176387_N)):this.field_174932_a;
  24017. }
  24018.  
  24019. private void func_184322_i(float p_184322_1_) {
  24020. EnumFacing enumfacing = this.field_145875_k?this.field_174931_f:this.field_174931_f.func_176734_d();
  24021. double d0 = (double)(p_184322_1_ - this.field_145873_m);
  24022. List<AxisAlignedBB> list = Lists.<AxisAlignedBB>newArrayList();
  24023. this.func_190606_j().func_185908_a(this.field_145850_b, BlockPos.field_177992_a, new AxisAlignedBB(BlockPos.field_177992_a), list, (Entity)null, true);
  24024. if(!((List)list).isEmpty()) {
  24025. AxisAlignedBB axisalignedbb = this.func_190607_a(this.func_191515_a(list));
  24026. List<Entity> list1 = this.field_145850_b.func_72839_b((Entity)null, this.func_190610_a(axisalignedbb, enumfacing, d0).func_111270_a(axisalignedbb));
  24027. if(!list1.isEmpty()) {
  24028. boolean flag = this.field_174932_a.func_177230_c() == Blocks.field_180399_cE;
  24029.  
  24030. for(int i = 0; i < list1.size(); ++i) {
  24031. Entity entity = (Entity)list1.get(i);
  24032. if(entity.func_184192_z() != EnumPushReaction.IGNORE) {
  24033. if(flag) {
  24034. switch(enumfacing.func_176740_k()) {
  24035. case X:
  24036. entity.field_70159_w = (double)enumfacing.func_82601_c();
  24037. break;
  24038. case Y:
  24039. entity.field_70181_x = (double)enumfacing.func_96559_d();
  24040. break;
  24041. case Z:
  24042. entity.field_70179_y = (double)enumfacing.func_82599_e();
  24043. }
  24044. }
  24045.  
  24046. double d1 = 0.0D;
  24047.  
  24048. for(int j = 0; j < ((List)list).size(); ++j) {
  24049. AxisAlignedBB axisalignedbb1 = this.func_190610_a(this.func_190607_a((AxisAlignedBB)list.get(j)), enumfacing, d0);
  24050. AxisAlignedBB axisalignedbb2 = entity.func_174813_aQ();
  24051. if(axisalignedbb1.func_72326_a(axisalignedbb2)) {
  24052. d1 = Math.max(d1, this.func_190612_a(axisalignedbb1, enumfacing, axisalignedbb2));
  24053. if(d1 >= d0) {
  24054. break;
  24055. }
  24056. }
  24057. }
  24058.  
  24059. if(d1 > 0.0D) {
  24060. d1 = Math.min(d1, d0) + 0.01D;
  24061. field_190613_i.set(enumfacing);
  24062. entity.func_70091_d(MoverType.PISTON, d1 * (double)enumfacing.func_82601_c(), d1 * (double)enumfacing.func_96559_d(), d1 * (double)enumfacing.func_82599_e());
  24063. field_190613_i.set((EnumFacing)null);
  24064. if(!this.field_145875_k && this.field_145872_l) {
  24065. this.func_190605_a(entity, enumfacing, d0);
  24066. }
  24067. }
  24068. }
  24069. }
  24070.  
  24071. }
  24072. }
  24073. }
  24074.  
  24075. private AxisAlignedBB func_191515_a(List<AxisAlignedBB> p_191515_1_) {
  24076. double d0 = 0.0D;
  24077. double d1 = 0.0D;
  24078. double d2 = 0.0D;
  24079. double d3 = 1.0D;
  24080. double d4 = 1.0D;
  24081. double d5 = 1.0D;
  24082.  
  24083. for(AxisAlignedBB axisalignedbb : p_191515_1_) {
  24084. d0 = Math.min(axisalignedbb.field_72340_a, d0);
  24085. d1 = Math.min(axisalignedbb.field_72338_b, d1);
  24086. d2 = Math.min(axisalignedbb.field_72339_c, d2);
  24087. d3 = Math.max(axisalignedbb.field_72336_d, d3);
  24088. d4 = Math.max(axisalignedbb.field_72337_e, d4);
  24089. d5 = Math.max(axisalignedbb.field_72334_f, d5);
  24090. }
  24091.  
  24092. return new AxisAlignedBB(d0, d1, d2, d3, d4, d5);
  24093. }
  24094.  
  24095. private double func_190612_a(AxisAlignedBB p_190612_1_, EnumFacing p_190612_2_, AxisAlignedBB p_190612_3_) {
  24096. switch(p_190612_2_.func_176740_k()) {
  24097. case X:
  24098. return func_190611_b(p_190612_1_, p_190612_2_, p_190612_3_);
  24099. case Y:
  24100. default:
  24101. return func_190608_c(p_190612_1_, p_190612_2_, p_190612_3_);
  24102. case Z:
  24103. return func_190604_d(p_190612_1_, p_190612_2_, p_190612_3_);
  24104. }
  24105. }
  24106.  
  24107. private AxisAlignedBB func_190607_a(AxisAlignedBB p_190607_1_) {
  24108. double d0 = (double)this.func_184320_e(this.field_145873_m);
  24109. return p_190607_1_.func_72317_d((double)this.field_174879_c.func_177958_n() + d0 * (double)this.field_174931_f.func_82601_c(), (double)this.field_174879_c.func_177956_o() + d0 * (double)this.field_174931_f.func_96559_d(), (double)this.field_174879_c.func_177952_p() + d0 * (double)this.field_174931_f.func_82599_e());
  24110. }
  24111.  
  24112. private AxisAlignedBB func_190610_a(AxisAlignedBB p_190610_1_, EnumFacing p_190610_2_, double p_190610_3_) {
  24113. double d0 = p_190610_3_ * (double)p_190610_2_.func_176743_c().func_179524_a();
  24114. double d1 = Math.min(d0, 0.0D);
  24115. double d2 = Math.max(d0, 0.0D);
  24116. switch(p_190610_2_) {
  24117. case WEST:
  24118. return new AxisAlignedBB(p_190610_1_.field_72340_a + d1, p_190610_1_.field_72338_b, p_190610_1_.field_72339_c, p_190610_1_.field_72340_a + d2, p_190610_1_.field_72337_e, p_190610_1_.field_72334_f);
  24119. case EAST:
  24120. return new AxisAlignedBB(p_190610_1_.field_72336_d + d1, p_190610_1_.field_72338_b, p_190610_1_.field_72339_c, p_190610_1_.field_72336_d + d2, p_190610_1_.field_72337_e, p_190610_1_.field_72334_f);
  24121. case DOWN:
  24122. return new AxisAlignedBB(p_190610_1_.field_72340_a, p_190610_1_.field_72338_b + d1, p_190610_1_.field_72339_c, p_190610_1_.field_72336_d, p_190610_1_.field_72338_b + d2, p_190610_1_.field_72334_f);
  24123. case UP:
  24124. default:
  24125. return new AxisAlignedBB(p_190610_1_.field_72340_a, p_190610_1_.field_72337_e + d1, p_190610_1_.field_72339_c, p_190610_1_.field_72336_d, p_190610_1_.field_72337_e + d2, p_190610_1_.field_72334_f);
  24126. case NORTH:
  24127. return new AxisAlignedBB(p_190610_1_.field_72340_a, p_190610_1_.field_72338_b, p_190610_1_.field_72339_c + d1, p_190610_1_.field_72336_d, p_190610_1_.field_72337_e, p_190610_1_.field_72339_c + d2);
  24128. case SOUTH:
  24129. return new AxisAlignedBB(p_190610_1_.field_72340_a, p_190610_1_.field_72338_b, p_190610_1_.field_72334_f + d1, p_190610_1_.field_72336_d, p_190610_1_.field_72337_e, p_190610_1_.field_72334_f + d2);
  24130. }
  24131. }
  24132.  
  24133. private void func_190605_a(Entity p_190605_1_, EnumFacing p_190605_2_, double p_190605_3_) {
  24134. AxisAlignedBB axisalignedbb = p_190605_1_.func_174813_aQ();
  24135. AxisAlignedBB axisalignedbb1 = Block.field_185505_j.func_186670_a(this.field_174879_c);
  24136. if(axisalignedbb.func_72326_a(axisalignedbb1)) {
  24137. EnumFacing enumfacing = p_190605_2_.func_176734_d();
  24138. double d0 = this.func_190612_a(axisalignedbb1, enumfacing, axisalignedbb) + 0.01D;
  24139. double d1 = this.func_190612_a(axisalignedbb1, enumfacing, axisalignedbb.func_191500_a(axisalignedbb1)) + 0.01D;
  24140. if(Math.abs(d0 - d1) < 0.01D) {
  24141. d0 = Math.min(d0, p_190605_3_) + 0.01D;
  24142. field_190613_i.set(p_190605_2_);
  24143. p_190605_1_.func_70091_d(MoverType.PISTON, d0 * (double)enumfacing.func_82601_c(), d0 * (double)enumfacing.func_96559_d(), d0 * (double)enumfacing.func_82599_e());
  24144. field_190613_i.set((EnumFacing)null);
  24145. }
  24146. }
  24147.  
  24148. }
  24149.  
  24150. private static double func_190611_b(AxisAlignedBB p_190611_0_, EnumFacing p_190611_1_, AxisAlignedBB p_190611_2_) {
  24151. return p_190611_1_.func_176743_c() == EnumFacing.AxisDirection.POSITIVE?p_190611_0_.field_72336_d - p_190611_2_.field_72340_a:p_190611_2_.field_72336_d - p_190611_0_.field_72340_a;
  24152. }
  24153.  
  24154. private static double func_190608_c(AxisAlignedBB p_190608_0_, EnumFacing p_190608_1_, AxisAlignedBB p_190608_2_) {
  24155. return p_190608_1_.func_176743_c() == EnumFacing.AxisDirection.POSITIVE?p_190608_0_.field_72337_e - p_190608_2_.field_72338_b:p_190608_2_.field_72337_e - p_190608_0_.field_72338_b;
  24156. }
  24157.  
  24158. private static double func_190604_d(AxisAlignedBB p_190604_0_, EnumFacing p_190604_1_, AxisAlignedBB p_190604_2_) {
  24159. return p_190604_1_.func_176743_c() == EnumFacing.AxisDirection.POSITIVE?p_190604_0_.field_72334_f - p_190604_2_.field_72339_c:p_190604_2_.field_72334_f - p_190604_0_.field_72339_c;
  24160. }
  24161.  
  24162. public void func_145866_f() {
  24163. if(this.field_145870_n < 1.0F && this.field_145850_b != null) {
  24164. this.field_145873_m = 1.0F;
  24165. this.field_145870_n = this.field_145873_m;
  24166. this.field_145850_b.func_175713_t(this.field_174879_c);
  24167. this.func_145843_s();
  24168. if(this.field_145850_b.func_180495_p(this.field_174879_c).func_177230_c() == Blocks.field_180384_M) {
  24169. this.field_145850_b.func_180501_a(this.field_174879_c, this.field_174932_a, 3);
  24170. this.field_145850_b.func_190524_a(this.field_174879_c, this.field_174932_a.func_177230_c(), this.field_174879_c);
  24171. }
  24172. }
  24173.  
  24174. }
  24175.  
  24176. public void func_73660_a() {
  24177. this.field_145870_n = this.field_145873_m;
  24178. if(this.field_145870_n >= 1.0F) {
  24179. this.field_145850_b.func_175713_t(this.field_174879_c);
  24180. this.func_145843_s();
  24181. if(this.field_145850_b.func_180495_p(this.field_174879_c).func_177230_c() == Blocks.field_180384_M) {
  24182. this.field_145850_b.func_180501_a(this.field_174879_c, this.field_174932_a, 3);
  24183. this.field_145850_b.func_190524_a(this.field_174879_c, this.field_174932_a.func_177230_c(), this.field_174879_c);
  24184. }
  24185.  
  24186. } else {
  24187. float f = this.field_145873_m + 0.5F;
  24188. this.func_184322_i(f);
  24189. this.field_145873_m = f;
  24190. if(this.field_145873_m >= 1.0F) {
  24191. this.field_145873_m = 1.0F;
  24192. }
  24193.  
  24194. }
  24195. }
  24196.  
  24197. public static void func_189685_a(DataFixer p_189685_0_) {
  24198. }
  24199.  
  24200. public void func_145839_a(NBTTagCompound p_145839_1_) {
  24201. super.func_145839_a(p_145839_1_);
  24202. this.field_174932_a = Block.func_149729_e(p_145839_1_.func_74762_e("blockId")).func_176203_a(p_145839_1_.func_74762_e("blockData"));
  24203. this.field_174931_f = EnumFacing.func_82600_a(p_145839_1_.func_74762_e("facing"));
  24204. this.field_145873_m = p_145839_1_.func_74760_g("progress");
  24205. this.field_145870_n = this.field_145873_m;
  24206. this.field_145875_k = p_145839_1_.func_74767_n("extending");
  24207. this.field_145872_l = p_145839_1_.func_74767_n("source");
  24208. }
  24209.  
  24210. public NBTTagCompound func_189515_b(NBTTagCompound p_189515_1_) {
  24211. super.func_189515_b(p_189515_1_);
  24212. p_189515_1_.func_74768_a("blockId", Block.func_149682_b(this.field_174932_a.func_177230_c()));
  24213. p_189515_1_.func_74768_a("blockData", this.field_174932_a.func_177230_c().func_176201_c(this.field_174932_a));
  24214. p_189515_1_.func_74768_a("facing", this.field_174931_f.func_176745_a());
  24215. p_189515_1_.func_74776_a("progress", this.field_145870_n);
  24216. p_189515_1_.func_74757_a("extending", this.field_145875_k);
  24217. p_189515_1_.func_74757_a("source", this.field_145872_l);
  24218. return p_189515_1_;
  24219. }
  24220.  
  24221. public void func_190609_a(World p_190609_1_, BlockPos p_190609_2_, AxisAlignedBB p_190609_3_, List<AxisAlignedBB> p_190609_4_, @Nullable Entity p_190609_5_) {
  24222. if(!this.field_145875_k && this.field_145872_l) {
  24223. this.field_174932_a.func_177226_a(BlockPistonBase.field_176320_b, Boolean.valueOf(true)).func_185908_a(p_190609_1_, p_190609_2_, p_190609_3_, p_190609_4_, p_190609_5_, false);
  24224. }
  24225.  
  24226. EnumFacing enumfacing = (EnumFacing)field_190613_i.get();
  24227. if((double)this.field_145873_m >= 1.0D || enumfacing != (this.field_145875_k?this.field_174931_f:this.field_174931_f.func_176734_d())) {
  24228. int i = p_190609_4_.size();
  24229. IBlockState iblockstate;
  24230. if(this.func_145867_d()) {
  24231. iblockstate = Blocks.field_150332_K.func_176223_P().func_177226_a(BlockPistonExtension.field_176387_N, this.field_174931_f).func_177226_a(BlockPistonExtension.field_176327_M, Boolean.valueOf(this.field_145875_k != 1.0F - this.field_145873_m < 0.25F));
  24232. } else {
  24233. iblockstate = this.field_174932_a;
  24234. }
  24235.  
  24236. float f = this.func_184320_e(this.field_145873_m);
  24237. double d0 = (double)((float)this.field_174931_f.func_82601_c() * f);
  24238. double d1 = (double)((float)this.field_174931_f.func_96559_d() * f);
  24239. double d2 = (double)((float)this.field_174931_f.func_82599_e() * f);
  24240. iblockstate.func_185908_a(p_190609_1_, p_190609_2_, p_190609_3_.func_72317_d(-d0, -d1, -d2), p_190609_4_, p_190609_5_, true);
  24241.  
  24242. for(int j = i; j < p_190609_4_.size(); ++j) {
  24243. p_190609_4_.set(j, ((AxisAlignedBB)p_190609_4_.get(j)).func_72317_d(d0, d1, d2));
  24244. }
  24245.  
  24246. }
  24247. }
  24248. }
  24249.  
  24250. Hunk 2 failed! Cannot find hunk target
  24251. d0 = Math.min(d0, p_190605_3_) + 0.01D;
  24252. field_190613_i.set(p_190605_2_);
  24253. p_190605_1_.func_70091_d(MoverType.PISTON, d0 * (double)enumfacing.func_82601_c(), d0 * (double)enumfacing.func_96559_d(), d0 * (double)enumfacing.func_82599_e());
  24254. - field_190613_i.set((Object)null);
  24255. + field_190613_i.set(null);
  24256. }
  24257. }
  24258.  
  24259. File state
  24260. package net.minecraft.tileentity;
  24261.  
  24262. import com.google.common.collect.Lists;
  24263. import java.util.List;
  24264. import javax.annotation.Nullable;
  24265. import net.minecraft.block.Block;
  24266. import net.minecraft.block.BlockPistonBase;
  24267. import net.minecraft.block.BlockPistonExtension;
  24268. import net.minecraft.block.material.EnumPushReaction;
  24269. import net.minecraft.block.state.IBlockState;
  24270. import net.minecraft.entity.Entity;
  24271. import net.minecraft.entity.MoverType;
  24272. import net.minecraft.init.Blocks;
  24273. import net.minecraft.nbt.NBTTagCompound;
  24274. import net.minecraft.tileentity.TileEntity;
  24275. import net.minecraft.util.EnumFacing;
  24276. import net.minecraft.util.ITickable;
  24277. import net.minecraft.util.datafix.DataFixer;
  24278. import net.minecraft.util.math.AxisAlignedBB;
  24279. import net.minecraft.util.math.BlockPos;
  24280. import net.minecraft.world.IBlockAccess;
  24281. import net.minecraft.world.World;
  24282. import net.minecraftforge.fml.relauncher.Side;
  24283. import net.minecraftforge.fml.relauncher.SideOnly;
  24284.  
  24285. public class TileEntityPiston extends TileEntity implements ITickable {
  24286. private IBlockState field_174932_a;
  24287. private EnumFacing field_174931_f;
  24288. private boolean field_145875_k;
  24289. private boolean field_145872_l;
  24290. private static final ThreadLocal<EnumFacing> field_190613_i = new ThreadLocal<EnumFacing>() {
  24291. protected EnumFacing initialValue() {
  24292. return null;
  24293. }
  24294. };
  24295. private float field_145873_m;
  24296. private float field_145870_n;
  24297.  
  24298. public TileEntityPiston() {
  24299. }
  24300.  
  24301. public TileEntityPiston(IBlockState p_i45665_1_, EnumFacing p_i45665_2_, boolean p_i45665_3_, boolean p_i45665_4_) {
  24302. this.field_174932_a = p_i45665_1_;
  24303. this.field_174931_f = p_i45665_2_;
  24304. this.field_145875_k = p_i45665_3_;
  24305. this.field_145872_l = p_i45665_4_;
  24306. }
  24307.  
  24308. public IBlockState func_174927_b() {
  24309. return this.field_174932_a;
  24310. }
  24311.  
  24312. public NBTTagCompound func_189517_E_() {
  24313. return this.func_189515_b(new NBTTagCompound());
  24314. }
  24315.  
  24316. public int func_145832_p() {
  24317. return 0;
  24318. }
  24319.  
  24320. public boolean func_145868_b() {
  24321. return this.field_145875_k;
  24322. }
  24323.  
  24324. public EnumFacing func_174930_e() {
  24325. return this.field_174931_f;
  24326. }
  24327.  
  24328. public boolean func_145867_d() {
  24329. return this.field_145872_l;
  24330. }
  24331.  
  24332. @SideOnly(Side.CLIENT)
  24333. public float func_145860_a(float p_145860_1_) {
  24334. if(p_145860_1_ > 1.0F) {
  24335. p_145860_1_ = 1.0F;
  24336. }
  24337.  
  24338. return this.field_145870_n + (this.field_145873_m - this.field_145870_n) * p_145860_1_;
  24339. }
  24340.  
  24341. @SideOnly(Side.CLIENT)
  24342. public float func_174929_b(float p_174929_1_) {
  24343. return (float)this.field_174931_f.func_82601_c() * this.func_184320_e(this.func_145860_a(p_174929_1_));
  24344. }
  24345.  
  24346. @SideOnly(Side.CLIENT)
  24347. public float func_174928_c(float p_174928_1_) {
  24348. return (float)this.field_174931_f.func_96559_d() * this.func_184320_e(this.func_145860_a(p_174928_1_));
  24349. }
  24350.  
  24351. @SideOnly(Side.CLIENT)
  24352. public float func_174926_d(float p_174926_1_) {
  24353. return (float)this.field_174931_f.func_82599_e() * this.func_184320_e(this.func_145860_a(p_174926_1_));
  24354. }
  24355.  
  24356. private float func_184320_e(float p_184320_1_) {
  24357. return this.field_145875_k?p_184320_1_ - 1.0F:1.0F - p_184320_1_;
  24358. }
  24359.  
  24360. public AxisAlignedBB func_184321_a(IBlockAccess p_184321_1_, BlockPos p_184321_2_) {
  24361. return this.func_184319_a(p_184321_1_, p_184321_2_, this.field_145873_m).func_111270_a(this.func_184319_a(p_184321_1_, p_184321_2_, this.field_145870_n));
  24362. }
  24363.  
  24364. public AxisAlignedBB func_184319_a(IBlockAccess p_184319_1_, BlockPos p_184319_2_, float p_184319_3_) {
  24365. p_184319_3_ = this.func_184320_e(p_184319_3_);
  24366. IBlockState iblockstate = this.func_190606_j();
  24367. return iblockstate.func_185900_c(p_184319_1_, p_184319_2_).func_72317_d((double)(p_184319_3_ * (float)this.field_174931_f.func_82601_c()), (double)(p_184319_3_ * (float)this.field_174931_f.func_96559_d()), (double)(p_184319_3_ * (float)this.field_174931_f.func_82599_e()));
  24368. }
  24369.  
  24370. private IBlockState func_190606_j() {
  24371. return !this.func_145868_b() && this.func_145867_d()?Blocks.field_150332_K.func_176223_P().func_177226_a(BlockPistonExtension.field_176325_b, this.field_174932_a.func_177230_c() == Blocks.field_150320_F?BlockPistonExtension.EnumPistonType.STICKY:BlockPistonExtension.EnumPistonType.DEFAULT).func_177226_a(BlockPistonExtension.field_176387_N, this.field_174932_a.func_177229_b(BlockPistonBase.field_176387_N)):this.field_174932_a;
  24372. }
  24373.  
  24374. private void func_184322_i(float p_184322_1_) {
  24375. EnumFacing enumfacing = this.field_145875_k?this.field_174931_f:this.field_174931_f.func_176734_d();
  24376. double d0 = (double)(p_184322_1_ - this.field_145873_m);
  24377. List<AxisAlignedBB> list = Lists.<AxisAlignedBB>newArrayList();
  24378. this.func_190606_j().func_185908_a(this.field_145850_b, BlockPos.field_177992_a, new AxisAlignedBB(BlockPos.field_177992_a), list, (Entity)null, true);
  24379. if(!((List)list).isEmpty()) {
  24380. AxisAlignedBB axisalignedbb = this.func_190607_a(this.func_191515_a(list));
  24381. List<Entity> list1 = this.field_145850_b.func_72839_b((Entity)null, this.func_190610_a(axisalignedbb, enumfacing, d0).func_111270_a(axisalignedbb));
  24382. if(!list1.isEmpty()) {
  24383. boolean flag = this.field_174932_a.func_177230_c() == Blocks.field_180399_cE;
  24384.  
  24385. for(int i = 0; i < list1.size(); ++i) {
  24386. Entity entity = (Entity)list1.get(i);
  24387. if(entity.func_184192_z() != EnumPushReaction.IGNORE) {
  24388. if(flag) {
  24389. switch(enumfacing.func_176740_k()) {
  24390. case X:
  24391. entity.field_70159_w = (double)enumfacing.func_82601_c();
  24392. break;
  24393. case Y:
  24394. entity.field_70181_x = (double)enumfacing.func_96559_d();
  24395. break;
  24396. case Z:
  24397. entity.field_70179_y = (double)enumfacing.func_82599_e();
  24398. }
  24399. }
  24400.  
  24401. double d1 = 0.0D;
  24402.  
  24403. for(int j = 0; j < ((List)list).size(); ++j) {
  24404. AxisAlignedBB axisalignedbb1 = this.func_190610_a(this.func_190607_a((AxisAlignedBB)list.get(j)), enumfacing, d0);
  24405. AxisAlignedBB axisalignedbb2 = entity.func_174813_aQ();
  24406. if(axisalignedbb1.func_72326_a(axisalignedbb2)) {
  24407. d1 = Math.max(d1, this.func_190612_a(axisalignedbb1, enumfacing, axisalignedbb2));
  24408. if(d1 >= d0) {
  24409. break;
  24410. }
  24411. }
  24412. }
  24413.  
  24414. if(d1 > 0.0D) {
  24415. d1 = Math.min(d1, d0) + 0.01D;
  24416. field_190613_i.set(enumfacing);
  24417. entity.func_70091_d(MoverType.PISTON, d1 * (double)enumfacing.func_82601_c(), d1 * (double)enumfacing.func_96559_d(), d1 * (double)enumfacing.func_82599_e());
  24418. field_190613_i.set((EnumFacing)null);
  24419. if(!this.field_145875_k && this.field_145872_l) {
  24420. this.func_190605_a(entity, enumfacing, d0);
  24421. }
  24422. }
  24423. }
  24424. }
  24425.  
  24426. }
  24427. }
  24428. }
  24429.  
  24430. private AxisAlignedBB func_191515_a(List<AxisAlignedBB> p_191515_1_) {
  24431. double d0 = 0.0D;
  24432. double d1 = 0.0D;
  24433. double d2 = 0.0D;
  24434. double d3 = 1.0D;
  24435. double d4 = 1.0D;
  24436. double d5 = 1.0D;
  24437.  
  24438. for(AxisAlignedBB axisalignedbb : p_191515_1_) {
  24439. d0 = Math.min(axisalignedbb.field_72340_a, d0);
  24440. d1 = Math.min(axisalignedbb.field_72338_b, d1);
  24441. d2 = Math.min(axisalignedbb.field_72339_c, d2);
  24442. d3 = Math.max(axisalignedbb.field_72336_d, d3);
  24443. d4 = Math.max(axisalignedbb.field_72337_e, d4);
  24444. d5 = Math.max(axisalignedbb.field_72334_f, d5);
  24445. }
  24446.  
  24447. return new AxisAlignedBB(d0, d1, d2, d3, d4, d5);
  24448. }
  24449.  
  24450. private double func_190612_a(AxisAlignedBB p_190612_1_, EnumFacing p_190612_2_, AxisAlignedBB p_190612_3_) {
  24451. switch(p_190612_2_.func_176740_k()) {
  24452. case X:
  24453. return func_190611_b(p_190612_1_, p_190612_2_, p_190612_3_);
  24454. case Y:
  24455. default:
  24456. return func_190608_c(p_190612_1_, p_190612_2_, p_190612_3_);
  24457. case Z:
  24458. return func_190604_d(p_190612_1_, p_190612_2_, p_190612_3_);
  24459. }
  24460. }
  24461.  
  24462. private AxisAlignedBB func_190607_a(AxisAlignedBB p_190607_1_) {
  24463. double d0 = (double)this.func_184320_e(this.field_145873_m);
  24464. return p_190607_1_.func_72317_d((double)this.field_174879_c.func_177958_n() + d0 * (double)this.field_174931_f.func_82601_c(), (double)this.field_174879_c.func_177956_o() + d0 * (double)this.field_174931_f.func_96559_d(), (double)this.field_174879_c.func_177952_p() + d0 * (double)this.field_174931_f.func_82599_e());
  24465. }
  24466.  
  24467. private AxisAlignedBB func_190610_a(AxisAlignedBB p_190610_1_, EnumFacing p_190610_2_, double p_190610_3_) {
  24468. double d0 = p_190610_3_ * (double)p_190610_2_.func_176743_c().func_179524_a();
  24469. double d1 = Math.min(d0, 0.0D);
  24470. double d2 = Math.max(d0, 0.0D);
  24471. switch(p_190610_2_) {
  24472. case WEST:
  24473. return new AxisAlignedBB(p_190610_1_.field_72340_a + d1, p_190610_1_.field_72338_b, p_190610_1_.field_72339_c, p_190610_1_.field_72340_a + d2, p_190610_1_.field_72337_e, p_190610_1_.field_72334_f);
  24474. case EAST:
  24475. return new AxisAlignedBB(p_190610_1_.field_72336_d + d1, p_190610_1_.field_72338_b, p_190610_1_.field_72339_c, p_190610_1_.field_72336_d + d2, p_190610_1_.field_72337_e, p_190610_1_.field_72334_f);
  24476. case DOWN:
  24477. return new AxisAlignedBB(p_190610_1_.field_72340_a, p_190610_1_.field_72338_b + d1, p_190610_1_.field_72339_c, p_190610_1_.field_72336_d, p_190610_1_.field_72338_b + d2, p_190610_1_.field_72334_f);
  24478. case UP:
  24479. default:
  24480. return new AxisAlignedBB(p_190610_1_.field_72340_a, p_190610_1_.field_72337_e + d1, p_190610_1_.field_72339_c, p_190610_1_.field_72336_d, p_190610_1_.field_72337_e + d2, p_190610_1_.field_72334_f);
  24481. case NORTH:
  24482. return new AxisAlignedBB(p_190610_1_.field_72340_a, p_190610_1_.field_72338_b, p_190610_1_.field_72339_c + d1, p_190610_1_.field_72336_d, p_190610_1_.field_72337_e, p_190610_1_.field_72339_c + d2);
  24483. case SOUTH:
  24484. return new AxisAlignedBB(p_190610_1_.field_72340_a, p_190610_1_.field_72338_b, p_190610_1_.field_72334_f + d1, p_190610_1_.field_72336_d, p_190610_1_.field_72337_e, p_190610_1_.field_72334_f + d2);
  24485. }
  24486. }
  24487.  
  24488. private void func_190605_a(Entity p_190605_1_, EnumFacing p_190605_2_, double p_190605_3_) {
  24489. AxisAlignedBB axisalignedbb = p_190605_1_.func_174813_aQ();
  24490. AxisAlignedBB axisalignedbb1 = Block.field_185505_j.func_186670_a(this.field_174879_c);
  24491. if(axisalignedbb.func_72326_a(axisalignedbb1)) {
  24492. EnumFacing enumfacing = p_190605_2_.func_176734_d();
  24493. double d0 = this.func_190612_a(axisalignedbb1, enumfacing, axisalignedbb) + 0.01D;
  24494. double d1 = this.func_190612_a(axisalignedbb1, enumfacing, axisalignedbb.func_191500_a(axisalignedbb1)) + 0.01D;
  24495. if(Math.abs(d0 - d1) < 0.01D) {
  24496. d0 = Math.min(d0, p_190605_3_) + 0.01D;
  24497. field_190613_i.set(p_190605_2_);
  24498. p_190605_1_.func_70091_d(MoverType.PISTON, d0 * (double)enumfacing.func_82601_c(), d0 * (double)enumfacing.func_96559_d(), d0 * (double)enumfacing.func_82599_e());
  24499. field_190613_i.set((EnumFacing)null);
  24500. }
  24501. }
  24502.  
  24503. }
  24504.  
  24505. private static double func_190611_b(AxisAlignedBB p_190611_0_, EnumFacing p_190611_1_, AxisAlignedBB p_190611_2_) {
  24506. return p_190611_1_.func_176743_c() == EnumFacing.AxisDirection.POSITIVE?p_190611_0_.field_72336_d - p_190611_2_.field_72340_a:p_190611_2_.field_72336_d - p_190611_0_.field_72340_a;
  24507. }
  24508.  
  24509. private static double func_190608_c(AxisAlignedBB p_190608_0_, EnumFacing p_190608_1_, AxisAlignedBB p_190608_2_) {
  24510. return p_190608_1_.func_176743_c() == EnumFacing.AxisDirection.POSITIVE?p_190608_0_.field_72337_e - p_190608_2_.field_72338_b:p_190608_2_.field_72337_e - p_190608_0_.field_72338_b;
  24511. }
  24512.  
  24513. private static double func_190604_d(AxisAlignedBB p_190604_0_, EnumFacing p_190604_1_, AxisAlignedBB p_190604_2_) {
  24514. return p_190604_1_.func_176743_c() == EnumFacing.AxisDirection.POSITIVE?p_190604_0_.field_72334_f - p_190604_2_.field_72339_c:p_190604_2_.field_72334_f - p_190604_0_.field_72339_c;
  24515. }
  24516.  
  24517. public void func_145866_f() {
  24518. if(this.field_145870_n < 1.0F && this.field_145850_b != null) {
  24519. this.field_145873_m = 1.0F;
  24520. this.field_145870_n = this.field_145873_m;
  24521. this.field_145850_b.func_175713_t(this.field_174879_c);
  24522. this.func_145843_s();
  24523. if(this.field_145850_b.func_180495_p(this.field_174879_c).func_177230_c() == Blocks.field_180384_M) {
  24524. this.field_145850_b.func_180501_a(this.field_174879_c, this.field_174932_a, 3);
  24525. this.field_145850_b.func_190524_a(this.field_174879_c, this.field_174932_a.func_177230_c(), this.field_174879_c);
  24526. }
  24527. }
  24528.  
  24529. }
  24530.  
  24531. public void func_73660_a() {
  24532. this.field_145870_n = this.field_145873_m;
  24533. if(this.field_145870_n >= 1.0F) {
  24534. this.field_145850_b.func_175713_t(this.field_174879_c);
  24535. this.func_145843_s();
  24536. if(this.field_145850_b.func_180495_p(this.field_174879_c).func_177230_c() == Blocks.field_180384_M) {
  24537. this.field_145850_b.func_180501_a(this.field_174879_c, this.field_174932_a, 3);
  24538. this.field_145850_b.func_190524_a(this.field_174879_c, this.field_174932_a.func_177230_c(), this.field_174879_c);
  24539. }
  24540.  
  24541. } else {
  24542. float f = this.field_145873_m + 0.5F;
  24543. this.func_184322_i(f);
  24544. this.field_145873_m = f;
  24545. if(this.field_145873_m >= 1.0F) {
  24546. this.field_145873_m = 1.0F;
  24547. }
  24548.  
  24549. }
  24550. }
  24551.  
  24552. public static void func_189685_a(DataFixer p_189685_0_) {
  24553. }
  24554.  
  24555. public void func_145839_a(NBTTagCompound p_145839_1_) {
  24556. super.func_145839_a(p_145839_1_);
  24557. this.field_174932_a = Block.func_149729_e(p_145839_1_.func_74762_e("blockId")).func_176203_a(p_145839_1_.func_74762_e("blockData"));
  24558. this.field_174931_f = EnumFacing.func_82600_a(p_145839_1_.func_74762_e("facing"));
  24559. this.field_145873_m = p_145839_1_.func_74760_g("progress");
  24560. this.field_145870_n = this.field_145873_m;
  24561. this.field_145875_k = p_145839_1_.func_74767_n("extending");
  24562. this.field_145872_l = p_145839_1_.func_74767_n("source");
  24563. }
  24564.  
  24565. public NBTTagCompound func_189515_b(NBTTagCompound p_189515_1_) {
  24566. super.func_189515_b(p_189515_1_);
  24567. p_189515_1_.func_74768_a("blockId", Block.func_149682_b(this.field_174932_a.func_177230_c()));
  24568. p_189515_1_.func_74768_a("blockData", this.field_174932_a.func_177230_c().func_176201_c(this.field_174932_a));
  24569. p_189515_1_.func_74768_a("facing", this.field_174931_f.func_176745_a());
  24570. p_189515_1_.func_74776_a("progress", this.field_145870_n);
  24571. p_189515_1_.func_74757_a("extending", this.field_145875_k);
  24572. p_189515_1_.func_74757_a("source", this.field_145872_l);
  24573. return p_189515_1_;
  24574. }
  24575.  
  24576. public void func_190609_a(World p_190609_1_, BlockPos p_190609_2_, AxisAlignedBB p_190609_3_, List<AxisAlignedBB> p_190609_4_, @Nullable Entity p_190609_5_) {
  24577. if(!this.field_145875_k && this.field_145872_l) {
  24578. this.field_174932_a.func_177226_a(BlockPistonBase.field_176320_b, Boolean.valueOf(true)).func_185908_a(p_190609_1_, p_190609_2_, p_190609_3_, p_190609_4_, p_190609_5_, false);
  24579. }
  24580.  
  24581. EnumFacing enumfacing = (EnumFacing)field_190613_i.get();
  24582. if((double)this.field_145873_m >= 1.0D || enumfacing != (this.field_145875_k?this.field_174931_f:this.field_174931_f.func_176734_d())) {
  24583. int i = p_190609_4_.size();
  24584. IBlockState iblockstate;
  24585. if(this.func_145867_d()) {
  24586. iblockstate = Blocks.field_150332_K.func_176223_P().func_177226_a(BlockPistonExtension.field_176387_N, this.field_174931_f).func_177226_a(BlockPistonExtension.field_176327_M, Boolean.valueOf(this.field_145875_k != 1.0F - this.field_145873_m < 0.25F));
  24587. } else {
  24588. iblockstate = this.field_174932_a;
  24589. }
  24590.  
  24591. float f = this.func_184320_e(this.field_145873_m);
  24592. double d0 = (double)((float)this.field_174931_f.func_82601_c() * f);
  24593. double d1 = (double)((float)this.field_174931_f.func_96559_d() * f);
  24594. double d2 = (double)((float)this.field_174931_f.func_82599_e() * f);
  24595. iblockstate.func_185908_a(p_190609_1_, p_190609_2_, p_190609_3_.func_72317_d(-d0, -d1, -d2), p_190609_4_, p_190609_5_, true);
  24596.  
  24597. for(int j = i; j < p_190609_4_.size(); ++j) {
  24598. p_190609_4_.set(j, ((AxisAlignedBB)p_190609_4_.get(j)).func_72317_d(d0, d1, d2));
  24599. }
  24600.  
  24601. }
  24602. }
  24603. }
  24604.  
  24605. Patching failed: minecraft\net\minecraft\block\state\pattern\FactoryBlockPattern.java
  24606. Hunk 1 failed! Cannot find hunk target
  24607.  
  24608. for(char c0 : s.toCharArray()) {
  24609. if (!this.field_177666_c.containsKey(Character.valueOf(c0))) {
  24610. - this.field_177666_c.put(Character.valueOf(c0), (Object)null);
  24611. + this.field_177666_c.put(Character.valueOf(c0), null);
  24612. }
  24613. }
  24614. }
  24615. File state
  24616. package net.minecraft.block.state.pattern;
  24617.  
  24618. import com.google.common.base.Joiner;
  24619. import com.google.common.base.Predicate;
  24620. import com.google.common.base.Predicates;
  24621. import com.google.common.collect.Lists;
  24622. import com.google.common.collect.Maps;
  24623. import java.lang.reflect.Array;
  24624. import java.util.List;
  24625. import java.util.Map;
  24626. import java.util.Map.Entry;
  24627. import net.minecraft.block.state.BlockWorldState;
  24628. import net.minecraft.block.state.pattern.BlockPattern;
  24629. import org.apache.commons.lang3.ArrayUtils;
  24630. import org.apache.commons.lang3.StringUtils;
  24631.  
  24632. public class FactoryBlockPattern {
  24633. private static final Joiner field_177667_a = Joiner.on(",");
  24634. private final List<String[]> field_177665_b = Lists.<String[]>newArrayList();
  24635. private final Map<Character, Predicate<BlockWorldState>> field_177666_c = Maps.<Character, Predicate<BlockWorldState>>newHashMap();
  24636. private int field_177663_d;
  24637. private int field_177664_e;
  24638.  
  24639. private FactoryBlockPattern() {
  24640. this.field_177666_c.put(Character.valueOf(' '), Predicates.<BlockWorldState>alwaysTrue());
  24641. }
  24642.  
  24643. public FactoryBlockPattern func_177659_a(String... p_177659_1_) {
  24644. if(!ArrayUtils.isEmpty((Object[])p_177659_1_) && !StringUtils.isEmpty(p_177659_1_[0])) {
  24645. if(this.field_177665_b.isEmpty()) {
  24646. this.field_177663_d = p_177659_1_.length;
  24647. this.field_177664_e = p_177659_1_[0].length();
  24648. }
  24649.  
  24650. if(p_177659_1_.length != this.field_177663_d) {
  24651. throw new IllegalArgumentException("Expected aisle with height of " + this.field_177663_d + ", but was given one with a height of " + p_177659_1_.length + ")");
  24652. } else {
  24653. for(String s : p_177659_1_) {
  24654. if(s.length() != this.field_177664_e) {
  24655. throw new IllegalArgumentException("Not all rows in the given aisle are the correct width (expected " + this.field_177664_e + ", found one with " + s.length() + ")");
  24656. }
  24657.  
  24658. for(char c0 : s.toCharArray()) {
  24659. if(!this.field_177666_c.containsKey(Character.valueOf(c0))) {
  24660. this.field_177666_c.put(Character.valueOf(c0), (Predicate<BlockWorldState>)null);
  24661. }
  24662. }
  24663. }
  24664.  
  24665. this.field_177665_b.add(p_177659_1_);
  24666. return this;
  24667. }
  24668. } else {
  24669. throw new IllegalArgumentException("Empty pattern for aisle");
  24670. }
  24671. }
  24672.  
  24673. public static FactoryBlockPattern func_177660_a() {
  24674. return new FactoryBlockPattern();
  24675. }
  24676.  
  24677. public FactoryBlockPattern func_177662_a(char p_177662_1_, Predicate<BlockWorldState> p_177662_2_) {
  24678. this.field_177666_c.put(Character.valueOf(p_177662_1_), p_177662_2_);
  24679. return this;
  24680. }
  24681.  
  24682. public BlockPattern func_177661_b() {
  24683. return new BlockPattern(this.func_177658_c());
  24684. }
  24685.  
  24686. private Predicate<BlockWorldState>[][][] func_177658_c() {
  24687. this.func_177657_d();
  24688. Predicate<BlockWorldState>[][][] predicate = (Predicate[][][])((Predicate[][][])Array.newInstance(Predicate.class, new int[]{this.field_177665_b.size(), this.field_177663_d, this.field_177664_e}));
  24689.  
  24690. for(int i = 0; i < this.field_177665_b.size(); ++i) {
  24691. for(int j = 0; j < this.field_177663_d; ++j) {
  24692. for(int k = 0; k < this.field_177664_e; ++k) {
  24693. predicate[i][j][k] = (Predicate)this.field_177666_c.get(Character.valueOf(((String[])this.field_177665_b.get(i))[j].charAt(k)));
  24694. }
  24695. }
  24696. }
  24697.  
  24698. return predicate;
  24699. }
  24700.  
  24701. private void func_177657_d() {
  24702. List<Character> list = Lists.<Character>newArrayList();
  24703.  
  24704. for(Entry<Character, Predicate<BlockWorldState>> entry : this.field_177666_c.entrySet()) {
  24705. if(entry.getValue() == null) {
  24706. list.add(entry.getKey());
  24707. }
  24708. }
  24709.  
  24710. if(!list.isEmpty()) {
  24711. throw new IllegalStateException("Predicates for character(s) " + field_177667_a.join(list) + " are missing");
  24712. }
  24713. }
  24714. }
  24715.  
  24716. Patching failed: minecraft\net\minecraft\block\state\pattern\BlockStateMatcher.java
  24717. Hunk 1 failed! Cannot find hunk target
  24718. return true;
  24719. } else {
  24720. for(Entry<IProperty<?>, Predicate<?>> entry : this.field_177640_b.entrySet()) {
  24721. - if (!this.func_185927_a(p_apply_1_, entry.getKey(), entry.getValue())) {
  24722. + if (!this.func_185927_a(p_apply_1_, (IProperty)entry.getKey(), (Predicate)entry.getValue())) {
  24723. return false;
  24724. }
  24725. }
  24726. File state
  24727. package net.minecraft.block.state.pattern;
  24728.  
  24729. import com.google.common.base.Predicate;
  24730. import com.google.common.collect.Maps;
  24731. import java.util.Map;
  24732. import java.util.Map.Entry;
  24733. import javax.annotation.Nullable;
  24734. import net.minecraft.block.Block;
  24735. import net.minecraft.block.properties.IProperty;
  24736. import net.minecraft.block.state.BlockStateContainer;
  24737. import net.minecraft.block.state.IBlockState;
  24738.  
  24739. public class BlockStateMatcher implements Predicate<IBlockState> {
  24740. public static final Predicate<IBlockState> field_185928_a = new Predicate<IBlockState>() {
  24741. public boolean apply(@Nullable IBlockState p_apply_1_) {
  24742. return true;
  24743. }
  24744. };
  24745. private final BlockStateContainer field_177641_a;
  24746. private final Map<IProperty<?>, Predicate<?>> field_177640_b = Maps.<IProperty<?>, Predicate<?>>newHashMap();
  24747.  
  24748. private BlockStateMatcher(BlockStateContainer p_i45653_1_) {
  24749. this.field_177641_a = p_i45653_1_;
  24750. }
  24751.  
  24752. public static BlockStateMatcher func_177638_a(Block p_177638_0_) {
  24753. return new BlockStateMatcher(p_177638_0_.func_176194_O());
  24754. }
  24755.  
  24756. public boolean apply(@Nullable IBlockState p_apply_1_) {
  24757. if(p_apply_1_ != null && p_apply_1_.func_177230_c().equals(this.field_177641_a.func_177622_c())) {
  24758. if(this.field_177640_b.isEmpty()) {
  24759. return true;
  24760. } else {
  24761. for(Entry<IProperty<?>, Predicate<?>> entry : this.field_177640_b.entrySet()) {
  24762. if(!this.func_185927_a(p_apply_1_, (IProperty)entry.getKey(), (Predicate)entry.getValue())) {
  24763. return false;
  24764. }
  24765. }
  24766.  
  24767. return true;
  24768. }
  24769. } else {
  24770. return false;
  24771. }
  24772. }
  24773.  
  24774. protected <T extends Comparable<T>> boolean func_185927_a(IBlockState p_185927_1_, IProperty<T> p_185927_2_, Predicate<?> p_185927_3_) {
  24775. return p_185927_3_.apply(p_185927_1_.func_177229_b(p_185927_2_));
  24776. }
  24777.  
  24778. public <V extends Comparable<V>> BlockStateMatcher func_177637_a(IProperty<V> p_177637_1_, Predicate<? extends V> p_177637_2_) {
  24779. if(!this.field_177641_a.func_177623_d().contains(p_177637_1_)) {
  24780. throw new IllegalArgumentException(this.field_177641_a + " cannot support property " + p_177637_1_);
  24781. } else {
  24782. this.field_177640_b.put(p_177637_1_, p_177637_2_);
  24783. return this;
  24784. }
  24785. }
  24786. }
  24787.  
  24788. Patching failed: minecraft\net\minecraft\world\chunk\storage\AnvilChunkLoader.java
  24789. Hunk 1 failed! Cannot find hunk target
  24790. try {
  24791. this.field_183014_e = true;
  24792.  
  24793. - while(true) {
  24794. - if (this.func_75814_c()) {
  24795. - continue;
  24796. - }
  24797. - }
  24798. + while(this.func_75814_c());
  24799. } finally {
  24800. this.field_183014_e = false;
  24801. }
  24802. File state
  24803. package net.minecraft.world.chunk.storage;
  24804.  
  24805. import com.google.common.collect.Maps;
  24806. import java.io.DataInputStream;
  24807. import java.io.DataOutputStream;
  24808. import java.io.File;
  24809. import java.io.IOException;
  24810. import java.util.Collections;
  24811. import java.util.List;
  24812. import java.util.Map;
  24813. import java.util.Set;
  24814. import javax.annotation.Nullable;
  24815. import net.minecraft.block.Block;
  24816. import net.minecraft.entity.Entity;
  24817. import net.minecraft.entity.EntityList;
  24818. import net.minecraft.nbt.CompressedStreamTools;
  24819. import net.minecraft.nbt.NBTTagCompound;
  24820. import net.minecraft.nbt.NBTTagList;
  24821. import net.minecraft.tileentity.TileEntity;
  24822. import net.minecraft.util.ResourceLocation;
  24823. import net.minecraft.util.datafix.DataFixer;
  24824. import net.minecraft.util.datafix.FixTypes;
  24825. import net.minecraft.util.datafix.IDataFixer;
  24826. import net.minecraft.util.datafix.IDataWalker;
  24827. import net.minecraft.util.math.BlockPos;
  24828. import net.minecraft.util.math.ChunkPos;
  24829. import net.minecraft.world.MinecraftException;
  24830. import net.minecraft.world.NextTickListEntry;
  24831. import net.minecraft.world.World;
  24832. import net.minecraft.world.chunk.Chunk;
  24833. import net.minecraft.world.chunk.NibbleArray;
  24834. import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
  24835. import net.minecraft.world.chunk.storage.IChunkLoader;
  24836. import net.minecraft.world.chunk.storage.RegionFileCache;
  24837. import net.minecraft.world.storage.IThreadedFileIO;
  24838. import net.minecraft.world.storage.ThreadedFileIOBase;
  24839. import org.apache.logging.log4j.LogManager;
  24840. import org.apache.logging.log4j.Logger;
  24841.  
  24842. public class AnvilChunkLoader implements IChunkLoader, IThreadedFileIO {
  24843. private static final Logger field_151505_a = LogManager.getLogger();
  24844. private final Map<ChunkPos, NBTTagCompound> field_75828_a = Maps.<ChunkPos, NBTTagCompound>newConcurrentMap();
  24845. private final Set<ChunkPos> field_193415_c = Collections.<ChunkPos>newSetFromMap(Maps.<ChunkPos, Boolean>newConcurrentMap());
  24846. public final File field_75825_d;
  24847. private final DataFixer field_193416_e;
  24848. private boolean field_183014_e;
  24849.  
  24850. public AnvilChunkLoader(File p_i46673_1_, DataFixer p_i46673_2_) {
  24851. this.field_75825_d = p_i46673_1_;
  24852. this.field_193416_e = p_i46673_2_;
  24853. }
  24854.  
  24855. @Nullable
  24856. public Chunk func_75815_a(World p_75815_1_, int p_75815_2_, int p_75815_3_) throws IOException {
  24857. ChunkPos chunkpos = new ChunkPos(p_75815_2_, p_75815_3_);
  24858. NBTTagCompound nbttagcompound = (NBTTagCompound)this.field_75828_a.get(chunkpos);
  24859. if(nbttagcompound == null) {
  24860. DataInputStream datainputstream = RegionFileCache.func_76549_c(this.field_75825_d, p_75815_2_, p_75815_3_);
  24861. if(datainputstream == null) {
  24862. return null;
  24863. }
  24864.  
  24865. nbttagcompound = this.field_193416_e.func_188257_a(FixTypes.CHUNK, CompressedStreamTools.func_74794_a(datainputstream));
  24866. }
  24867.  
  24868. return this.func_75822_a(p_75815_1_, p_75815_2_, p_75815_3_, nbttagcompound);
  24869. }
  24870.  
  24871. public boolean func_191063_a(int p_191063_1_, int p_191063_2_) {
  24872. ChunkPos chunkpos = new ChunkPos(p_191063_1_, p_191063_2_);
  24873. NBTTagCompound nbttagcompound = (NBTTagCompound)this.field_75828_a.get(chunkpos);
  24874. return nbttagcompound != null?true:RegionFileCache.func_191064_f(this.field_75825_d, p_191063_1_, p_191063_2_);
  24875. }
  24876.  
  24877. @Nullable
  24878. protected Chunk func_75822_a(World p_75822_1_, int p_75822_2_, int p_75822_3_, NBTTagCompound p_75822_4_) {
  24879. if(!p_75822_4_.func_150297_b("Level", 10)) {
  24880. field_151505_a.error((String)"Chunk file at {},{} is missing level data, skipping", (Object)Integer.valueOf(p_75822_2_), (Object)Integer.valueOf(p_75822_3_));
  24881. return null;
  24882. } else {
  24883. NBTTagCompound nbttagcompound = p_75822_4_.func_74775_l("Level");
  24884. if(!nbttagcompound.func_150297_b("Sections", 9)) {
  24885. field_151505_a.error((String)"Chunk file at {},{} is missing block data, skipping", (Object)Integer.valueOf(p_75822_2_), (Object)Integer.valueOf(p_75822_3_));
  24886. return null;
  24887. } else {
  24888. Chunk chunk = this.func_75823_a(p_75822_1_, nbttagcompound);
  24889. if(!chunk.func_76600_a(p_75822_2_, p_75822_3_)) {
  24890. field_151505_a.error((String)"Chunk file at {},{} is in the wrong location; relocating. (Expected {}, {}, got {}, {})", (Object)Integer.valueOf(p_75822_2_), Integer.valueOf(p_75822_3_), Integer.valueOf(p_75822_2_), Integer.valueOf(p_75822_3_), Integer.valueOf(chunk.field_76635_g), Integer.valueOf(chunk.field_76647_h));
  24891. nbttagcompound.func_74768_a("xPos", p_75822_2_);
  24892. nbttagcompound.func_74768_a("zPos", p_75822_3_);
  24893. chunk = this.func_75823_a(p_75822_1_, nbttagcompound);
  24894. }
  24895.  
  24896. return chunk;
  24897. }
  24898. }
  24899. }
  24900.  
  24901. public void func_75816_a(World p_75816_1_, Chunk p_75816_2_) throws MinecraftException, IOException {
  24902. p_75816_1_.func_72906_B();
  24903.  
  24904. try {
  24905. NBTTagCompound nbttagcompound = new NBTTagCompound();
  24906. NBTTagCompound nbttagcompound1 = new NBTTagCompound();
  24907. nbttagcompound.func_74782_a("Level", nbttagcompound1);
  24908. nbttagcompound.func_74768_a("DataVersion", 1139);
  24909. this.func_75820_a(p_75816_2_, p_75816_1_, nbttagcompound1);
  24910. this.func_75824_a(p_75816_2_.func_76632_l(), nbttagcompound);
  24911. } catch (Exception exception) {
  24912. field_151505_a.error((String)"Failed to save chunk", (Throwable)exception);
  24913. }
  24914.  
  24915. }
  24916.  
  24917. protected void func_75824_a(ChunkPos p_75824_1_, NBTTagCompound p_75824_2_) {
  24918. if(!this.field_193415_c.contains(p_75824_1_)) {
  24919. this.field_75828_a.put(p_75824_1_, p_75824_2_);
  24920. }
  24921.  
  24922. ThreadedFileIOBase.func_178779_a().func_75735_a(this);
  24923. }
  24924.  
  24925. public boolean func_75814_c() {
  24926. if(this.field_75828_a.isEmpty()) {
  24927. if(this.field_183014_e) {
  24928. field_151505_a.info((String)"ThreadedAnvilChunkStorage ({}): All chunks are saved", (Object)this.field_75825_d.getName());
  24929. }
  24930.  
  24931. return false;
  24932. } else {
  24933. ChunkPos chunkpos = (ChunkPos)this.field_75828_a.keySet().iterator().next();
  24934.  
  24935. boolean lvt_3_1_;
  24936. try {
  24937. this.field_193415_c.add(chunkpos);
  24938. NBTTagCompound nbttagcompound = (NBTTagCompound)this.field_75828_a.remove(chunkpos);
  24939. if(nbttagcompound != null) {
  24940. try {
  24941. this.func_183013_b(chunkpos, nbttagcompound);
  24942. } catch (Exception exception) {
  24943. field_151505_a.error((String)"Failed to save chunk", (Throwable)exception);
  24944. }
  24945. }
  24946.  
  24947. lvt_3_1_ = true;
  24948. } finally {
  24949. this.field_193415_c.remove(chunkpos);
  24950. }
  24951.  
  24952. return lvt_3_1_;
  24953. }
  24954. }
  24955.  
  24956. private void func_183013_b(ChunkPos p_183013_1_, NBTTagCompound p_183013_2_) throws IOException {
  24957. DataOutputStream dataoutputstream = RegionFileCache.func_76552_d(this.field_75825_d, p_183013_1_.field_77276_a, p_183013_1_.field_77275_b);
  24958. CompressedStreamTools.func_74800_a(p_183013_2_, dataoutputstream);
  24959. dataoutputstream.close();
  24960. }
  24961.  
  24962. public void func_75819_b(World p_75819_1_, Chunk p_75819_2_) throws IOException {
  24963. }
  24964.  
  24965. public void func_75817_a() {
  24966. }
  24967.  
  24968. public void func_75818_b() {
  24969. try {
  24970. this.field_183014_e = true;
  24971.  
  24972. while(true) {
  24973. if(this.func_75814_c()) {
  24974. continue;
  24975. }
  24976. }
  24977. } finally {
  24978. this.field_183014_e = false;
  24979. }
  24980.  
  24981. }
  24982.  
  24983. public static void func_189889_a(DataFixer p_189889_0_) {
  24984. p_189889_0_.func_188258_a(FixTypes.CHUNK, new IDataWalker() {
  24985. public NBTTagCompound func_188266_a(IDataFixer p_188266_1_, NBTTagCompound p_188266_2_, int p_188266_3_) {
  24986. if(p_188266_2_.func_150297_b("Level", 10)) {
  24987. NBTTagCompound nbttagcompound = p_188266_2_.func_74775_l("Level");
  24988. if(nbttagcompound.func_150297_b("Entities", 9)) {
  24989. NBTTagList nbttaglist = nbttagcompound.func_150295_c("Entities", 10);
  24990.  
  24991. for(int i = 0; i < nbttaglist.func_74745_c(); ++i) {
  24992. nbttaglist.func_150304_a(i, p_188266_1_.func_188251_a(FixTypes.ENTITY, (NBTTagCompound)nbttaglist.func_179238_g(i), p_188266_3_));
  24993. }
  24994. }
  24995.  
  24996. if(nbttagcompound.func_150297_b("TileEntities", 9)) {
  24997. NBTTagList nbttaglist1 = nbttagcompound.func_150295_c("TileEntities", 10);
  24998.  
  24999. for(int j = 0; j < nbttaglist1.func_74745_c(); ++j) {
  25000. nbttaglist1.func_150304_a(j, p_188266_1_.func_188251_a(FixTypes.BLOCK_ENTITY, (NBTTagCompound)nbttaglist1.func_179238_g(j), p_188266_3_));
  25001. }
  25002. }
  25003. }
  25004.  
  25005. return p_188266_2_;
  25006. }
  25007. });
  25008. }
  25009.  
  25010. private void func_75820_a(Chunk p_75820_1_, World p_75820_2_, NBTTagCompound p_75820_3_) {
  25011. p_75820_3_.func_74768_a("xPos", p_75820_1_.field_76635_g);
  25012. p_75820_3_.func_74768_a("zPos", p_75820_1_.field_76647_h);
  25013. p_75820_3_.func_74772_a("LastUpdate", p_75820_2_.func_82737_E());
  25014. p_75820_3_.func_74783_a("HeightMap", p_75820_1_.func_177445_q());
  25015. p_75820_3_.func_74757_a("TerrainPopulated", p_75820_1_.func_177419_t());
  25016. p_75820_3_.func_74757_a("LightPopulated", p_75820_1_.func_177423_u());
  25017. p_75820_3_.func_74772_a("InhabitedTime", p_75820_1_.func_177416_w());
  25018. ExtendedBlockStorage[] aextendedblockstorage = p_75820_1_.func_76587_i();
  25019. NBTTagList nbttaglist = new NBTTagList();
  25020. boolean flag = p_75820_2_.field_73011_w.func_191066_m();
  25021.  
  25022. for(ExtendedBlockStorage extendedblockstorage : aextendedblockstorage) {
  25023. if(extendedblockstorage != Chunk.field_186036_a) {
  25024. NBTTagCompound nbttagcompound = new NBTTagCompound();
  25025. nbttagcompound.func_74774_a("Y", (byte)(extendedblockstorage.func_76662_d() >> 4 & 255));
  25026. byte[] abyte = new byte[4096];
  25027. NibbleArray nibblearray = new NibbleArray();
  25028. NibbleArray nibblearray1 = extendedblockstorage.func_186049_g().func_186017_a(abyte, nibblearray);
  25029. nbttagcompound.func_74773_a("Blocks", abyte);
  25030. nbttagcompound.func_74773_a("Data", nibblearray.func_177481_a());
  25031. if(nibblearray1 != null) {
  25032. nbttagcompound.func_74773_a("Add", nibblearray1.func_177481_a());
  25033. }
  25034.  
  25035. nbttagcompound.func_74773_a("BlockLight", extendedblockstorage.func_76661_k().func_177481_a());
  25036. if(flag) {
  25037. nbttagcompound.func_74773_a("SkyLight", extendedblockstorage.func_76671_l().func_177481_a());
  25038. } else {
  25039. nbttagcompound.func_74773_a("SkyLight", new byte[extendedblockstorage.func_76661_k().func_177481_a().length]);
  25040. }
  25041.  
  25042. nbttaglist.func_74742_a(nbttagcompound);
  25043. }
  25044. }
  25045.  
  25046. p_75820_3_.func_74782_a("Sections", nbttaglist);
  25047. p_75820_3_.func_74773_a("Biomes", p_75820_1_.func_76605_m());
  25048. p_75820_1_.func_177409_g(false);
  25049. NBTTagList nbttaglist1 = new NBTTagList();
  25050.  
  25051. for(int i = 0; i < p_75820_1_.func_177429_s().length; ++i) {
  25052. for(Entity entity : p_75820_1_.func_177429_s()[i]) {
  25053. NBTTagCompound nbttagcompound2 = new NBTTagCompound();
  25054. if(entity.func_70039_c(nbttagcompound2)) {
  25055. p_75820_1_.func_177409_g(true);
  25056. nbttaglist1.func_74742_a(nbttagcompound2);
  25057. }
  25058. }
  25059. }
  25060.  
  25061. p_75820_3_.func_74782_a("Entities", nbttaglist1);
  25062. NBTTagList nbttaglist2 = new NBTTagList();
  25063.  
  25064. for(TileEntity tileentity : p_75820_1_.func_177434_r().values()) {
  25065. NBTTagCompound nbttagcompound3 = tileentity.func_189515_b(new NBTTagCompound());
  25066. nbttaglist2.func_74742_a(nbttagcompound3);
  25067. }
  25068.  
  25069. p_75820_3_.func_74782_a("TileEntities", nbttaglist2);
  25070. List<NextTickListEntry> list = p_75820_2_.func_72920_a(p_75820_1_, false);
  25071. if(list != null) {
  25072. long j = p_75820_2_.func_82737_E();
  25073. NBTTagList nbttaglist3 = new NBTTagList();
  25074.  
  25075. for(NextTickListEntry nextticklistentry : list) {
  25076. NBTTagCompound nbttagcompound1 = new NBTTagCompound();
  25077. ResourceLocation resourcelocation = (ResourceLocation)Block.field_149771_c.func_177774_c(nextticklistentry.func_151351_a());
  25078. nbttagcompound1.func_74778_a("i", resourcelocation == null?"":resourcelocation.toString());
  25079. nbttagcompound1.func_74768_a("x", nextticklistentry.field_180282_a.func_177958_n());
  25080. nbttagcompound1.func_74768_a("y", nextticklistentry.field_180282_a.func_177956_o());
  25081. nbttagcompound1.func_74768_a("z", nextticklistentry.field_180282_a.func_177952_p());
  25082. nbttagcompound1.func_74768_a("t", (int)(nextticklistentry.field_77180_e - j));
  25083. nbttagcompound1.func_74768_a("p", nextticklistentry.field_82754_f);
  25084. nbttaglist3.func_74742_a(nbttagcompound1);
  25085. }
  25086.  
  25087. p_75820_3_.func_74782_a("TileTicks", nbttaglist3);
  25088. }
  25089.  
  25090. }
  25091.  
  25092. private Chunk func_75823_a(World p_75823_1_, NBTTagCompound p_75823_2_) {
  25093. int i = p_75823_2_.func_74762_e("xPos");
  25094. int j = p_75823_2_.func_74762_e("zPos");
  25095. Chunk chunk = new Chunk(p_75823_1_, i, j);
  25096. chunk.func_177420_a(p_75823_2_.func_74759_k("HeightMap"));
  25097. chunk.func_177446_d(p_75823_2_.func_74767_n("TerrainPopulated"));
  25098. chunk.func_177421_e(p_75823_2_.func_74767_n("LightPopulated"));
  25099. chunk.func_177415_c(p_75823_2_.func_74763_f("InhabitedTime"));
  25100. NBTTagList nbttaglist = p_75823_2_.func_150295_c("Sections", 10);
  25101. int k = 16;
  25102. ExtendedBlockStorage[] aextendedblockstorage = new ExtendedBlockStorage[16];
  25103. boolean flag = p_75823_1_.field_73011_w.func_191066_m();
  25104.  
  25105. for(int l = 0; l < nbttaglist.func_74745_c(); ++l) {
  25106. NBTTagCompound nbttagcompound = nbttaglist.func_150305_b(l);
  25107. int i1 = nbttagcompound.func_74771_c("Y");
  25108. ExtendedBlockStorage extendedblockstorage = new ExtendedBlockStorage(i1 << 4, flag);
  25109. byte[] abyte = nbttagcompound.func_74770_j("Blocks");
  25110. NibbleArray nibblearray = new NibbleArray(nbttagcompound.func_74770_j("Data"));
  25111. NibbleArray nibblearray1 = nbttagcompound.func_150297_b("Add", 7)?new NibbleArray(nbttagcompound.func_74770_j("Add")):null;
  25112. extendedblockstorage.func_186049_g().func_186019_a(abyte, nibblearray, nibblearray1);
  25113. extendedblockstorage.func_76659_c(new NibbleArray(nbttagcompound.func_74770_j("BlockLight")));
  25114. if(flag) {
  25115. extendedblockstorage.func_76666_d(new NibbleArray(nbttagcompound.func_74770_j("SkyLight")));
  25116. }
  25117.  
  25118. extendedblockstorage.func_76672_e();
  25119. aextendedblockstorage[i1] = extendedblockstorage;
  25120. }
  25121.  
  25122. chunk.func_76602_a(aextendedblockstorage);
  25123. if(p_75823_2_.func_150297_b("Biomes", 7)) {
  25124. chunk.func_76616_a(p_75823_2_.func_74770_j("Biomes"));
  25125. }
  25126.  
  25127. NBTTagList nbttaglist1 = p_75823_2_.func_150295_c("Entities", 10);
  25128.  
  25129. for(int j1 = 0; j1 < nbttaglist1.func_74745_c(); ++j1) {
  25130. NBTTagCompound nbttagcompound1 = nbttaglist1.func_150305_b(j1);
  25131. func_186050_a(nbttagcompound1, p_75823_1_, chunk);
  25132. chunk.func_177409_g(true);
  25133. }
  25134.  
  25135. NBTTagList nbttaglist2 = p_75823_2_.func_150295_c("TileEntities", 10);
  25136.  
  25137. for(int k1 = 0; k1 < nbttaglist2.func_74745_c(); ++k1) {
  25138. NBTTagCompound nbttagcompound2 = nbttaglist2.func_150305_b(k1);
  25139. TileEntity tileentity = TileEntity.func_190200_a(p_75823_1_, nbttagcompound2);
  25140. if(tileentity != null) {
  25141. chunk.func_150813_a(tileentity);
  25142. }
  25143. }
  25144.  
  25145. if(p_75823_2_.func_150297_b("TileTicks", 9)) {
  25146. NBTTagList nbttaglist3 = p_75823_2_.func_150295_c("TileTicks", 10);
  25147.  
  25148. for(int l1 = 0; l1 < nbttaglist3.func_74745_c(); ++l1) {
  25149. NBTTagCompound nbttagcompound3 = nbttaglist3.func_150305_b(l1);
  25150. Block block;
  25151. if(nbttagcompound3.func_150297_b("i", 8)) {
  25152. block = Block.func_149684_b(nbttagcompound3.func_74779_i("i"));
  25153. } else {
  25154. block = Block.func_149729_e(nbttagcompound3.func_74762_e("i"));
  25155. }
  25156.  
  25157. p_75823_1_.func_180497_b(new BlockPos(nbttagcompound3.func_74762_e("x"), nbttagcompound3.func_74762_e("y"), nbttagcompound3.func_74762_e("z")), block, nbttagcompound3.func_74762_e("t"), nbttagcompound3.func_74762_e("p"));
  25158. }
  25159. }
  25160.  
  25161. return chunk;
  25162. }
  25163.  
  25164. @Nullable
  25165. public static Entity func_186050_a(NBTTagCompound p_186050_0_, World p_186050_1_, Chunk p_186050_2_) {
  25166. Entity entity = func_186053_a(p_186050_0_, p_186050_1_);
  25167. if(entity == null) {
  25168. return null;
  25169. } else {
  25170. p_186050_2_.func_76612_a(entity);
  25171. if(p_186050_0_.func_150297_b("Passengers", 9)) {
  25172. NBTTagList nbttaglist = p_186050_0_.func_150295_c("Passengers", 10);
  25173.  
  25174. for(int i = 0; i < nbttaglist.func_74745_c(); ++i) {
  25175. Entity entity1 = func_186050_a(nbttaglist.func_150305_b(i), p_186050_1_, p_186050_2_);
  25176. if(entity1 != null) {
  25177. entity1.func_184205_a(entity, true);
  25178. }
  25179. }
  25180. }
  25181.  
  25182. return entity;
  25183. }
  25184. }
  25185.  
  25186. @Nullable
  25187. public static Entity func_186054_a(NBTTagCompound p_186054_0_, World p_186054_1_, double p_186054_2_, double p_186054_4_, double p_186054_6_, boolean p_186054_8_) {
  25188. Entity entity = func_186053_a(p_186054_0_, p_186054_1_);
  25189. if(entity == null) {
  25190. return null;
  25191. } else {
  25192. entity.func_70012_b(p_186054_2_, p_186054_4_, p_186054_6_, entity.field_70177_z, entity.field_70125_A);
  25193. if(p_186054_8_ && !p_186054_1_.func_72838_d(entity)) {
  25194. return null;
  25195. } else {
  25196. if(p_186054_0_.func_150297_b("Passengers", 9)) {
  25197. NBTTagList nbttaglist = p_186054_0_.func_150295_c("Passengers", 10);
  25198.  
  25199. for(int i = 0; i < nbttaglist.func_74745_c(); ++i) {
  25200. Entity entity1 = func_186054_a(nbttaglist.func_150305_b(i), p_186054_1_, p_186054_2_, p_186054_4_, p_186054_6_, p_186054_8_);
  25201. if(entity1 != null) {
  25202. entity1.func_184205_a(entity, true);
  25203. }
  25204. }
  25205. }
  25206.  
  25207. return entity;
  25208. }
  25209. }
  25210. }
  25211.  
  25212. @Nullable
  25213. protected static Entity func_186053_a(NBTTagCompound p_186053_0_, World p_186053_1_) {
  25214. try {
  25215. return EntityList.func_75615_a(p_186053_0_, p_186053_1_);
  25216. } catch (RuntimeException var3) {
  25217. return null;
  25218. }
  25219. }
  25220.  
  25221. public static void func_186052_a(Entity p_186052_0_, World p_186052_1_) {
  25222. if(p_186052_1_.func_72838_d(p_186052_0_) && p_186052_0_.func_184207_aI()) {
  25223. for(Entity entity : p_186052_0_.func_184188_bt()) {
  25224. func_186052_a(entity, p_186052_1_);
  25225. }
  25226. }
  25227.  
  25228. }
  25229.  
  25230. @Nullable
  25231. public static Entity func_186051_a(NBTTagCompound p_186051_0_, World p_186051_1_, boolean p_186051_2_) {
  25232. Entity entity = func_186053_a(p_186051_0_, p_186051_1_);
  25233. if(entity == null) {
  25234. return null;
  25235. } else if(p_186051_2_ && !p_186051_1_.func_72838_d(entity)) {
  25236. return null;
  25237. } else {
  25238. if(p_186051_0_.func_150297_b("Passengers", 9)) {
  25239. NBTTagList nbttaglist = p_186051_0_.func_150295_c("Passengers", 10);
  25240.  
  25241. for(int i = 0; i < nbttaglist.func_74745_c(); ++i) {
  25242. Entity entity1 = func_186051_a(nbttaglist.func_150305_b(i), p_186051_1_, p_186051_2_);
  25243. if(entity1 != null) {
  25244. entity1.func_184205_a(entity, true);
  25245. }
  25246. }
  25247. }
  25248.  
  25249. return entity;
  25250. }
  25251. }
  25252. }
  25253.  
  25254. Patching failed: minecraft\net\minecraft\world\gen\structure\StructureMineshaftPieces.java
  25255. Hunk 1 failed! Cannot find hunk target
  25256. }
  25257.  
  25258. int k;
  25259. - for(lvt_5_1_ = 0; k < this.field_74887_e.func_78883_b(); k = k + 4) {
  25260. + for(k = 0; k < this.field_74887_e.func_78883_b(); k = k + 4) {
  25261. k = k + p_74861_3_.nextInt(this.field_74887_e.func_78883_b());
  25262. if (k + 3 > this.field_74887_e.func_78883_b()) {
  25263. break;
  25264. File state
  25265. package net.minecraft.world.gen.structure;
  25266.  
  25267. import com.google.common.collect.Lists;
  25268. import java.util.List;
  25269. import java.util.Random;
  25270. import javax.annotation.Nullable;
  25271. import net.minecraft.block.BlockPlanks;
  25272. import net.minecraft.block.BlockRail;
  25273. import net.minecraft.block.BlockRailBase;
  25274. import net.minecraft.block.BlockTorch;
  25275. import net.minecraft.block.material.Material;
  25276. import net.minecraft.block.state.IBlockState;
  25277. import net.minecraft.entity.EntityList;
  25278. import net.minecraft.entity.item.EntityMinecartChest;
  25279. import net.minecraft.entity.monster.EntityCaveSpider;
  25280. import net.minecraft.init.Blocks;
  25281. import net.minecraft.nbt.NBTTagCompound;
  25282. import net.minecraft.nbt.NBTTagList;
  25283. import net.minecraft.tileentity.TileEntity;
  25284. import net.minecraft.tileentity.TileEntityMobSpawner;
  25285. import net.minecraft.util.EnumFacing;
  25286. import net.minecraft.util.ResourceLocation;
  25287. import net.minecraft.util.math.BlockPos;
  25288. import net.minecraft.world.World;
  25289. import net.minecraft.world.gen.structure.MapGenMineshaft;
  25290. import net.minecraft.world.gen.structure.MapGenStructureIO;
  25291. import net.minecraft.world.gen.structure.StructureBoundingBox;
  25292. import net.minecraft.world.gen.structure.StructureComponent;
  25293. import net.minecraft.world.gen.structure.template.TemplateManager;
  25294. import net.minecraft.world.storage.loot.LootTableList;
  25295.  
  25296. public class StructureMineshaftPieces {
  25297. public static void func_143048_a() {
  25298. MapGenStructureIO.func_143031_a(StructureMineshaftPieces.Corridor.class, "MSCorridor");
  25299. MapGenStructureIO.func_143031_a(StructureMineshaftPieces.Cross.class, "MSCrossing");
  25300. MapGenStructureIO.func_143031_a(StructureMineshaftPieces.Room.class, "MSRoom");
  25301. MapGenStructureIO.func_143031_a(StructureMineshaftPieces.Stairs.class, "MSStairs");
  25302. }
  25303.  
  25304. private static StructureMineshaftPieces.Peice func_189940_a(List<StructureComponent> p_189940_0_, Random p_189940_1_, int p_189940_2_, int p_189940_3_, int p_189940_4_, @Nullable EnumFacing p_189940_5_, int p_189940_6_, MapGenMineshaft.Type p_189940_7_) {
  25305. int i = p_189940_1_.nextInt(100);
  25306. if(i >= 80) {
  25307. StructureBoundingBox structureboundingbox = StructureMineshaftPieces.Cross.func_175813_a(p_189940_0_, p_189940_1_, p_189940_2_, p_189940_3_, p_189940_4_, p_189940_5_);
  25308. if(structureboundingbox != null) {
  25309. return new StructureMineshaftPieces.Cross(p_189940_6_, p_189940_1_, structureboundingbox, p_189940_5_, p_189940_7_);
  25310. }
  25311. } else if(i >= 70) {
  25312. StructureBoundingBox structureboundingbox1 = StructureMineshaftPieces.Stairs.func_175812_a(p_189940_0_, p_189940_1_, p_189940_2_, p_189940_3_, p_189940_4_, p_189940_5_);
  25313. if(structureboundingbox1 != null) {
  25314. return new StructureMineshaftPieces.Stairs(p_189940_6_, p_189940_1_, structureboundingbox1, p_189940_5_, p_189940_7_);
  25315. }
  25316. } else {
  25317. StructureBoundingBox structureboundingbox2 = StructureMineshaftPieces.Corridor.func_175814_a(p_189940_0_, p_189940_1_, p_189940_2_, p_189940_3_, p_189940_4_, p_189940_5_);
  25318. if(structureboundingbox2 != null) {
  25319. return new StructureMineshaftPieces.Corridor(p_189940_6_, p_189940_1_, structureboundingbox2, p_189940_5_, p_189940_7_);
  25320. }
  25321. }
  25322.  
  25323. return null;
  25324. }
  25325.  
  25326. private static StructureMineshaftPieces.Peice func_189938_b(StructureComponent p_189938_0_, List<StructureComponent> p_189938_1_, Random p_189938_2_, int p_189938_3_, int p_189938_4_, int p_189938_5_, EnumFacing p_189938_6_, int p_189938_7_) {
  25327. if(p_189938_7_ > 8) {
  25328. return null;
  25329. } else if(Math.abs(p_189938_3_ - p_189938_0_.func_74874_b().field_78897_a) <= 80 && Math.abs(p_189938_5_ - p_189938_0_.func_74874_b().field_78896_c) <= 80) {
  25330. MapGenMineshaft.Type mapgenmineshaft$type = ((StructureMineshaftPieces.Peice)p_189938_0_).field_189920_a;
  25331. StructureMineshaftPieces.Peice structuremineshaftpieces$peice = func_189940_a(p_189938_1_, p_189938_2_, p_189938_3_, p_189938_4_, p_189938_5_, p_189938_6_, p_189938_7_ + 1, mapgenmineshaft$type);
  25332. if(structuremineshaftpieces$peice != null) {
  25333. p_189938_1_.add(structuremineshaftpieces$peice);
  25334. structuremineshaftpieces$peice.func_74861_a(p_189938_0_, p_189938_1_, p_189938_2_);
  25335. }
  25336.  
  25337. return structuremineshaftpieces$peice;
  25338. } else {
  25339. return null;
  25340. }
  25341. }
  25342.  
  25343. public static class Corridor extends StructureMineshaftPieces.Peice {
  25344. private boolean field_74958_a;
  25345. private boolean field_74956_b;
  25346. private boolean field_74957_c;
  25347. private int field_74955_d;
  25348.  
  25349. public Corridor() {
  25350. }
  25351.  
  25352. protected void func_143012_a(NBTTagCompound p_143012_1_) {
  25353. super.func_143012_a(p_143012_1_);
  25354. p_143012_1_.func_74757_a("hr", this.field_74958_a);
  25355. p_143012_1_.func_74757_a("sc", this.field_74956_b);
  25356. p_143012_1_.func_74757_a("hps", this.field_74957_c);
  25357. p_143012_1_.func_74768_a("Num", this.field_74955_d);
  25358. }
  25359.  
  25360. protected void func_143011_b(NBTTagCompound p_143011_1_, TemplateManager p_143011_2_) {
  25361. super.func_143011_b(p_143011_1_, p_143011_2_);
  25362. this.field_74958_a = p_143011_1_.func_74767_n("hr");
  25363. this.field_74956_b = p_143011_1_.func_74767_n("sc");
  25364. this.field_74957_c = p_143011_1_.func_74767_n("hps");
  25365. this.field_74955_d = p_143011_1_.func_74762_e("Num");
  25366. }
  25367.  
  25368. public Corridor(int p_i47140_1_, Random p_i47140_2_, StructureBoundingBox p_i47140_3_, EnumFacing p_i47140_4_, MapGenMineshaft.Type p_i47140_5_) {
  25369. super(p_i47140_1_, p_i47140_5_);
  25370. this.func_186164_a(p_i47140_4_);
  25371. this.field_74887_e = p_i47140_3_;
  25372. this.field_74958_a = p_i47140_2_.nextInt(3) == 0;
  25373. this.field_74956_b = !this.field_74958_a && p_i47140_2_.nextInt(23) == 0;
  25374. if(this.func_186165_e().func_176740_k() == EnumFacing.Axis.Z) {
  25375. this.field_74955_d = p_i47140_3_.func_78880_d() / 5;
  25376. } else {
  25377. this.field_74955_d = p_i47140_3_.func_78883_b() / 5;
  25378. }
  25379.  
  25380. }
  25381.  
  25382. public static StructureBoundingBox func_175814_a(List<StructureComponent> p_175814_0_, Random p_175814_1_, int p_175814_2_, int p_175814_3_, int p_175814_4_, EnumFacing p_175814_5_) {
  25383. StructureBoundingBox structureboundingbox = new StructureBoundingBox(p_175814_2_, p_175814_3_, p_175814_4_, p_175814_2_, p_175814_3_ + 2, p_175814_4_);
  25384.  
  25385. int i;
  25386. for(i = p_175814_1_.nextInt(3) + 2; i > 0; --i) {
  25387. int j = i * 5;
  25388. switch(p_175814_5_) {
  25389. case NORTH:
  25390. default:
  25391. structureboundingbox.field_78893_d = p_175814_2_ + 2;
  25392. structureboundingbox.field_78896_c = p_175814_4_ - (j - 1);
  25393. break;
  25394. case SOUTH:
  25395. structureboundingbox.field_78893_d = p_175814_2_ + 2;
  25396. structureboundingbox.field_78892_f = p_175814_4_ + (j - 1);
  25397. break;
  25398. case WEST:
  25399. structureboundingbox.field_78897_a = p_175814_2_ - (j - 1);
  25400. structureboundingbox.field_78892_f = p_175814_4_ + 2;
  25401. break;
  25402. case EAST:
  25403. structureboundingbox.field_78893_d = p_175814_2_ + (j - 1);
  25404. structureboundingbox.field_78892_f = p_175814_4_ + 2;
  25405. }
  25406.  
  25407. if(StructureComponent.func_74883_a(p_175814_0_, structureboundingbox) == null) {
  25408. break;
  25409. }
  25410. }
  25411.  
  25412. return i > 0?structureboundingbox:null;
  25413. }
  25414.  
  25415. public void func_74861_a(StructureComponent p_74861_1_, List<StructureComponent> p_74861_2_, Random p_74861_3_) {
  25416. int i = this.func_74877_c();
  25417. int j = p_74861_3_.nextInt(4);
  25418. EnumFacing enumfacing = this.func_186165_e();
  25419. if(enumfacing != null) {
  25420. switch(enumfacing) {
  25421. case NORTH:
  25422. default:
  25423. if(j <= 1) {
  25424. StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, this.field_74887_e.field_78897_a, this.field_74887_e.field_78895_b - 1 + p_74861_3_.nextInt(3), this.field_74887_e.field_78896_c - 1, enumfacing, i);
  25425. } else if(j == 2) {
  25426. StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, this.field_74887_e.field_78897_a - 1, this.field_74887_e.field_78895_b - 1 + p_74861_3_.nextInt(3), this.field_74887_e.field_78896_c, EnumFacing.WEST, i);
  25427. } else {
  25428. StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, this.field_74887_e.field_78893_d + 1, this.field_74887_e.field_78895_b - 1 + p_74861_3_.nextInt(3), this.field_74887_e.field_78896_c, EnumFacing.EAST, i);
  25429. }
  25430. break;
  25431. case SOUTH:
  25432. if(j <= 1) {
  25433. StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, this.field_74887_e.field_78897_a, this.field_74887_e.field_78895_b - 1 + p_74861_3_.nextInt(3), this.field_74887_e.field_78892_f + 1, enumfacing, i);
  25434. } else if(j == 2) {
  25435. StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, this.field_74887_e.field_78897_a - 1, this.field_74887_e.field_78895_b - 1 + p_74861_3_.nextInt(3), this.field_74887_e.field_78892_f - 3, EnumFacing.WEST, i);
  25436. } else {
  25437. StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, this.field_74887_e.field_78893_d + 1, this.field_74887_e.field_78895_b - 1 + p_74861_3_.nextInt(3), this.field_74887_e.field_78892_f - 3, EnumFacing.EAST, i);
  25438. }
  25439. break;
  25440. case WEST:
  25441. if(j <= 1) {
  25442. StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, this.field_74887_e.field_78897_a - 1, this.field_74887_e.field_78895_b - 1 + p_74861_3_.nextInt(3), this.field_74887_e.field_78896_c, enumfacing, i);
  25443. } else if(j == 2) {
  25444. StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, this.field_74887_e.field_78897_a, this.field_74887_e.field_78895_b - 1 + p_74861_3_.nextInt(3), this.field_74887_e.field_78896_c - 1, EnumFacing.NORTH, i);
  25445. } else {
  25446. StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, this.field_74887_e.field_78897_a, this.field_74887_e.field_78895_b - 1 + p_74861_3_.nextInt(3), this.field_74887_e.field_78892_f + 1, EnumFacing.SOUTH, i);
  25447. }
  25448. break;
  25449. case EAST:
  25450. if(j <= 1) {
  25451. StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, this.field_74887_e.field_78893_d + 1, this.field_74887_e.field_78895_b - 1 + p_74861_3_.nextInt(3), this.field_74887_e.field_78896_c, enumfacing, i);
  25452. } else if(j == 2) {
  25453. StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, this.field_74887_e.field_78893_d - 3, this.field_74887_e.field_78895_b - 1 + p_74861_3_.nextInt(3), this.field_74887_e.field_78896_c - 1, EnumFacing.NORTH, i);
  25454. } else {
  25455. StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, this.field_74887_e.field_78893_d - 3, this.field_74887_e.field_78895_b - 1 + p_74861_3_.nextInt(3), this.field_74887_e.field_78892_f + 1, EnumFacing.SOUTH, i);
  25456. }
  25457. }
  25458. }
  25459.  
  25460. if(i < 8) {
  25461. if(enumfacing != EnumFacing.NORTH && enumfacing != EnumFacing.SOUTH) {
  25462. for(int i1 = this.field_74887_e.field_78897_a + 3; i1 + 3 <= this.field_74887_e.field_78893_d; i1 += 5) {
  25463. int j1 = p_74861_3_.nextInt(5);
  25464. if(j1 == 0) {
  25465. StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, i1, this.field_74887_e.field_78895_b, this.field_74887_e.field_78896_c - 1, EnumFacing.NORTH, i + 1);
  25466. } else if(j1 == 1) {
  25467. StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, i1, this.field_74887_e.field_78895_b, this.field_74887_e.field_78892_f + 1, EnumFacing.SOUTH, i + 1);
  25468. }
  25469. }
  25470. } else {
  25471. for(int k = this.field_74887_e.field_78896_c + 3; k + 3 <= this.field_74887_e.field_78892_f; k += 5) {
  25472. int l = p_74861_3_.nextInt(5);
  25473. if(l == 0) {
  25474. StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, this.field_74887_e.field_78897_a - 1, this.field_74887_e.field_78895_b, k, EnumFacing.WEST, i + 1);
  25475. } else if(l == 1) {
  25476. StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, this.field_74887_e.field_78893_d + 1, this.field_74887_e.field_78895_b, k, EnumFacing.EAST, i + 1);
  25477. }
  25478. }
  25479. }
  25480. }
  25481.  
  25482. }
  25483.  
  25484. protected boolean func_186167_a(World p_186167_1_, StructureBoundingBox p_186167_2_, Random p_186167_3_, int p_186167_4_, int p_186167_5_, int p_186167_6_, ResourceLocation p_186167_7_) {
  25485. BlockPos blockpos = new BlockPos(this.func_74865_a(p_186167_4_, p_186167_6_), this.func_74862_a(p_186167_5_), this.func_74873_b(p_186167_4_, p_186167_6_));
  25486. if(p_186167_2_.func_175898_b(blockpos) && p_186167_1_.func_180495_p(blockpos).func_185904_a() == Material.field_151579_a && p_186167_1_.func_180495_p(blockpos.func_177977_b()).func_185904_a() != Material.field_151579_a) {
  25487. IBlockState iblockstate = Blocks.field_150448_aq.func_176223_P().func_177226_a(BlockRail.field_176565_b, p_186167_3_.nextBoolean()?BlockRailBase.EnumRailDirection.NORTH_SOUTH:BlockRailBase.EnumRailDirection.EAST_WEST);
  25488. this.func_175811_a(p_186167_1_, iblockstate, p_186167_4_, p_186167_5_, p_186167_6_, p_186167_2_);
  25489. EntityMinecartChest entityminecartchest = new EntityMinecartChest(p_186167_1_, (double)((float)blockpos.func_177958_n() + 0.5F), (double)((float)blockpos.func_177956_o() + 0.5F), (double)((float)blockpos.func_177952_p() + 0.5F));
  25490. entityminecartchest.func_184289_a(p_186167_7_, p_186167_3_.nextLong());
  25491. p_186167_1_.func_72838_d(entityminecartchest);
  25492. return true;
  25493. } else {
  25494. return false;
  25495. }
  25496. }
  25497.  
  25498. public boolean func_74875_a(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) {
  25499. if(this.func_74860_a(p_74875_1_, p_74875_3_)) {
  25500. return false;
  25501. } else {
  25502. int i = 0;
  25503. int j = 2;
  25504. int k = 0;
  25505. int l = 2;
  25506. int i1 = this.field_74955_d * 5 - 1;
  25507. IBlockState iblockstate = this.func_189917_F_();
  25508. this.func_175804_a(p_74875_1_, p_74875_3_, 0, 0, 0, 2, 1, i1, Blocks.field_150350_a.func_176223_P(), Blocks.field_150350_a.func_176223_P(), false);
  25509. this.func_189914_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.8F, 0, 2, 0, 2, 2, i1, Blocks.field_150350_a.func_176223_P(), Blocks.field_150350_a.func_176223_P(), false, 0);
  25510. if(this.field_74956_b) {
  25511. this.func_189914_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.6F, 0, 0, 0, 2, 1, i1, Blocks.field_150321_G.func_176223_P(), Blocks.field_150350_a.func_176223_P(), false, 8);
  25512. }
  25513.  
  25514. for(int j1 = 0; j1 < this.field_74955_d; ++j1) {
  25515. int k1 = 2 + j1 * 5;
  25516. this.func_189921_a(p_74875_1_, p_74875_3_, 0, 0, k1, 2, 2, p_74875_2_);
  25517. this.func_189922_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.1F, 0, 2, k1 - 1);
  25518. this.func_189922_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.1F, 2, 2, k1 - 1);
  25519. this.func_189922_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.1F, 0, 2, k1 + 1);
  25520. this.func_189922_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.1F, 2, 2, k1 + 1);
  25521. this.func_189922_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.05F, 0, 2, k1 - 2);
  25522. this.func_189922_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.05F, 2, 2, k1 - 2);
  25523. this.func_189922_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.05F, 0, 2, k1 + 2);
  25524. this.func_189922_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.05F, 2, 2, k1 + 2);
  25525. if(p_74875_2_.nextInt(100) == 0) {
  25526. this.func_186167_a(p_74875_1_, p_74875_3_, p_74875_2_, 2, 0, k1 - 1, LootTableList.field_186424_f);
  25527. }
  25528.  
  25529. if(p_74875_2_.nextInt(100) == 0) {
  25530. this.func_186167_a(p_74875_1_, p_74875_3_, p_74875_2_, 0, 0, k1 + 1, LootTableList.field_186424_f);
  25531. }
  25532.  
  25533. if(this.field_74956_b && !this.field_74957_c) {
  25534. int l1 = this.func_74862_a(0);
  25535. int i2 = k1 - 1 + p_74875_2_.nextInt(3);
  25536. int j2 = this.func_74865_a(1, i2);
  25537. int k2 = this.func_74873_b(1, i2);
  25538. BlockPos blockpos = new BlockPos(j2, l1, k2);
  25539. if(p_74875_3_.func_175898_b(blockpos) && this.func_189916_b(p_74875_1_, 1, 0, i2, p_74875_3_) < 8) {
  25540. this.field_74957_c = true;
  25541. p_74875_1_.func_180501_a(blockpos, Blocks.field_150474_ac.func_176223_P(), 2);
  25542. TileEntity tileentity = p_74875_1_.func_175625_s(blockpos);
  25543. if(tileentity instanceof TileEntityMobSpawner) {
  25544. ((TileEntityMobSpawner)tileentity).func_145881_a().func_190894_a(EntityList.func_191306_a(EntityCaveSpider.class));
  25545. }
  25546. }
  25547. }
  25548. }
  25549.  
  25550. for(int l2 = 0; l2 <= 2; ++l2) {
  25551. for(int i3 = 0; i3 <= i1; ++i3) {
  25552. int k3 = -1;
  25553. IBlockState iblockstate3 = this.func_175807_a(p_74875_1_, l2, -1, i3, p_74875_3_);
  25554. if(iblockstate3.func_185904_a() == Material.field_151579_a && this.func_189916_b(p_74875_1_, l2, -1, i3, p_74875_3_) < 8) {
  25555. int l3 = -1;
  25556. this.func_175811_a(p_74875_1_, iblockstate, l2, -1, i3, p_74875_3_);
  25557. }
  25558. }
  25559. }
  25560.  
  25561. if(this.field_74958_a) {
  25562. IBlockState iblockstate1 = Blocks.field_150448_aq.func_176223_P().func_177226_a(BlockRail.field_176565_b, BlockRailBase.EnumRailDirection.NORTH_SOUTH);
  25563.  
  25564. for(int j3 = 0; j3 <= i1; ++j3) {
  25565. IBlockState iblockstate2 = this.func_175807_a(p_74875_1_, 1, -1, j3, p_74875_3_);
  25566. if(iblockstate2.func_185904_a() != Material.field_151579_a && iblockstate2.func_185913_b()) {
  25567. float f = this.func_189916_b(p_74875_1_, 1, 0, j3, p_74875_3_) > 8?0.9F:0.7F;
  25568. this.func_175809_a(p_74875_1_, p_74875_3_, p_74875_2_, f, 1, 0, j3, iblockstate1);
  25569. }
  25570. }
  25571. }
  25572.  
  25573. return true;
  25574. }
  25575. }
  25576.  
  25577. private void func_189921_a(World p_189921_1_, StructureBoundingBox p_189921_2_, int p_189921_3_, int p_189921_4_, int p_189921_5_, int p_189921_6_, int p_189921_7_, Random p_189921_8_) {
  25578. if(this.func_189918_a(p_189921_1_, p_189921_2_, p_189921_3_, p_189921_7_, p_189921_6_, p_189921_5_)) {
  25579. IBlockState iblockstate = this.func_189917_F_();
  25580. IBlockState iblockstate1 = this.func_189919_b();
  25581. IBlockState iblockstate2 = Blocks.field_150350_a.func_176223_P();
  25582. this.func_175804_a(p_189921_1_, p_189921_2_, p_189921_3_, p_189921_4_, p_189921_5_, p_189921_3_, p_189921_6_ - 1, p_189921_5_, iblockstate1, iblockstate2, false);
  25583. this.func_175804_a(p_189921_1_, p_189921_2_, p_189921_7_, p_189921_4_, p_189921_5_, p_189921_7_, p_189921_6_ - 1, p_189921_5_, iblockstate1, iblockstate2, false);
  25584. if(p_189921_8_.nextInt(4) == 0) {
  25585. this.func_175804_a(p_189921_1_, p_189921_2_, p_189921_3_, p_189921_6_, p_189921_5_, p_189921_3_, p_189921_6_, p_189921_5_, iblockstate, iblockstate2, false);
  25586. this.func_175804_a(p_189921_1_, p_189921_2_, p_189921_7_, p_189921_6_, p_189921_5_, p_189921_7_, p_189921_6_, p_189921_5_, iblockstate, iblockstate2, false);
  25587. } else {
  25588. this.func_175804_a(p_189921_1_, p_189921_2_, p_189921_3_, p_189921_6_, p_189921_5_, p_189921_7_, p_189921_6_, p_189921_5_, iblockstate, iblockstate2, false);
  25589. this.func_175809_a(p_189921_1_, p_189921_2_, p_189921_8_, 0.05F, p_189921_3_ + 1, p_189921_6_, p_189921_5_ - 1, Blocks.field_150478_aa.func_176223_P().func_177226_a(BlockTorch.field_176596_a, EnumFacing.NORTH));
  25590. this.func_175809_a(p_189921_1_, p_189921_2_, p_189921_8_, 0.05F, p_189921_3_ + 1, p_189921_6_, p_189921_5_ + 1, Blocks.field_150478_aa.func_176223_P().func_177226_a(BlockTorch.field_176596_a, EnumFacing.SOUTH));
  25591. }
  25592.  
  25593. }
  25594. }
  25595.  
  25596. private void func_189922_a(World p_189922_1_, StructureBoundingBox p_189922_2_, Random p_189922_3_, float p_189922_4_, int p_189922_5_, int p_189922_6_, int p_189922_7_) {
  25597. if(this.func_189916_b(p_189922_1_, p_189922_5_, p_189922_6_, p_189922_7_, p_189922_2_) < 8) {
  25598. this.func_175809_a(p_189922_1_, p_189922_2_, p_189922_3_, p_189922_4_, p_189922_5_, p_189922_6_, p_189922_7_, Blocks.field_150321_G.func_176223_P());
  25599. }
  25600.  
  25601. }
  25602. }
  25603.  
  25604. public static class Cross extends StructureMineshaftPieces.Peice {
  25605. private EnumFacing field_74953_a;
  25606. private boolean field_74952_b;
  25607.  
  25608. public Cross() {
  25609. }
  25610.  
  25611. protected void func_143012_a(NBTTagCompound p_143012_1_) {
  25612. super.func_143012_a(p_143012_1_);
  25613. p_143012_1_.func_74757_a("tf", this.field_74952_b);
  25614. p_143012_1_.func_74768_a("D", this.field_74953_a.func_176736_b());
  25615. }
  25616.  
  25617. protected void func_143011_b(NBTTagCompound p_143011_1_, TemplateManager p_143011_2_) {
  25618. super.func_143011_b(p_143011_1_, p_143011_2_);
  25619. this.field_74952_b = p_143011_1_.func_74767_n("tf");
  25620. this.field_74953_a = EnumFacing.func_176731_b(p_143011_1_.func_74762_e("D"));
  25621. }
  25622.  
  25623. public Cross(int p_i47139_1_, Random p_i47139_2_, StructureBoundingBox p_i47139_3_, @Nullable EnumFacing p_i47139_4_, MapGenMineshaft.Type p_i47139_5_) {
  25624. super(p_i47139_1_, p_i47139_5_);
  25625. this.field_74953_a = p_i47139_4_;
  25626. this.field_74887_e = p_i47139_3_;
  25627. this.field_74952_b = p_i47139_3_.func_78882_c() > 3;
  25628. }
  25629.  
  25630. public static StructureBoundingBox func_175813_a(List<StructureComponent> p_175813_0_, Random p_175813_1_, int p_175813_2_, int p_175813_3_, int p_175813_4_, EnumFacing p_175813_5_) {
  25631. StructureBoundingBox structureboundingbox = new StructureBoundingBox(p_175813_2_, p_175813_3_, p_175813_4_, p_175813_2_, p_175813_3_ + 2, p_175813_4_);
  25632. if(p_175813_1_.nextInt(4) == 0) {
  25633. structureboundingbox.field_78894_e += 4;
  25634. }
  25635.  
  25636. switch(p_175813_5_) {
  25637. case NORTH:
  25638. default:
  25639. structureboundingbox.field_78897_a = p_175813_2_ - 1;
  25640. structureboundingbox.field_78893_d = p_175813_2_ + 3;
  25641. structureboundingbox.field_78896_c = p_175813_4_ - 4;
  25642. break;
  25643. case SOUTH:
  25644. structureboundingbox.field_78897_a = p_175813_2_ - 1;
  25645. structureboundingbox.field_78893_d = p_175813_2_ + 3;
  25646. structureboundingbox.field_78892_f = p_175813_4_ + 3 + 1;
  25647. break;
  25648. case WEST:
  25649. structureboundingbox.field_78897_a = p_175813_2_ - 4;
  25650. structureboundingbox.field_78896_c = p_175813_4_ - 1;
  25651. structureboundingbox.field_78892_f = p_175813_4_ + 3;
  25652. break;
  25653. case EAST:
  25654. structureboundingbox.field_78893_d = p_175813_2_ + 3 + 1;
  25655. structureboundingbox.field_78896_c = p_175813_4_ - 1;
  25656. structureboundingbox.field_78892_f = p_175813_4_ + 3;
  25657. }
  25658.  
  25659. return StructureComponent.func_74883_a(p_175813_0_, structureboundingbox) != null?null:structureboundingbox;
  25660. }
  25661.  
  25662. public void func_74861_a(StructureComponent p_74861_1_, List<StructureComponent> p_74861_2_, Random p_74861_3_) {
  25663. int i = this.func_74877_c();
  25664. switch(this.field_74953_a) {
  25665. case NORTH:
  25666. default:
  25667. StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, this.field_74887_e.field_78897_a + 1, this.field_74887_e.field_78895_b, this.field_74887_e.field_78896_c - 1, EnumFacing.NORTH, i);
  25668. StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, this.field_74887_e.field_78897_a - 1, this.field_74887_e.field_78895_b, this.field_74887_e.field_78896_c + 1, EnumFacing.WEST, i);
  25669. StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, this.field_74887_e.field_78893_d + 1, this.field_74887_e.field_78895_b, this.field_74887_e.field_78896_c + 1, EnumFacing.EAST, i);
  25670. break;
  25671. case SOUTH:
  25672. StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, this.field_74887_e.field_78897_a + 1, this.field_74887_e.field_78895_b, this.field_74887_e.field_78892_f + 1, EnumFacing.SOUTH, i);
  25673. StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, this.field_74887_e.field_78897_a - 1, this.field_74887_e.field_78895_b, this.field_74887_e.field_78896_c + 1, EnumFacing.WEST, i);
  25674. StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, this.field_74887_e.field_78893_d + 1, this.field_74887_e.field_78895_b, this.field_74887_e.field_78896_c + 1, EnumFacing.EAST, i);
  25675. break;
  25676. case WEST:
  25677. StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, this.field_74887_e.field_78897_a + 1, this.field_74887_e.field_78895_b, this.field_74887_e.field_78896_c - 1, EnumFacing.NORTH, i);
  25678. StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, this.field_74887_e.field_78897_a + 1, this.field_74887_e.field_78895_b, this.field_74887_e.field_78892_f + 1, EnumFacing.SOUTH, i);
  25679. StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, this.field_74887_e.field_78897_a - 1, this.field_74887_e.field_78895_b, this.field_74887_e.field_78896_c + 1, EnumFacing.WEST, i);
  25680. break;
  25681. case EAST:
  25682. StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, this.field_74887_e.field_78897_a + 1, this.field_74887_e.field_78895_b, this.field_74887_e.field_78896_c - 1, EnumFacing.NORTH, i);
  25683. StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, this.field_74887_e.field_78897_a + 1, this.field_74887_e.field_78895_b, this.field_74887_e.field_78892_f + 1, EnumFacing.SOUTH, i);
  25684. StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, this.field_74887_e.field_78893_d + 1, this.field_74887_e.field_78895_b, this.field_74887_e.field_78896_c + 1, EnumFacing.EAST, i);
  25685. }
  25686.  
  25687. if(this.field_74952_b) {
  25688. if(p_74861_3_.nextBoolean()) {
  25689. StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, this.field_74887_e.field_78897_a + 1, this.field_74887_e.field_78895_b + 3 + 1, this.field_74887_e.field_78896_c - 1, EnumFacing.NORTH, i);
  25690. }
  25691.  
  25692. if(p_74861_3_.nextBoolean()) {
  25693. StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, this.field_74887_e.field_78897_a - 1, this.field_74887_e.field_78895_b + 3 + 1, this.field_74887_e.field_78896_c + 1, EnumFacing.WEST, i);
  25694. }
  25695.  
  25696. if(p_74861_3_.nextBoolean()) {
  25697. StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, this.field_74887_e.field_78893_d + 1, this.field_74887_e.field_78895_b + 3 + 1, this.field_74887_e.field_78896_c + 1, EnumFacing.EAST, i);
  25698. }
  25699.  
  25700. if(p_74861_3_.nextBoolean()) {
  25701. StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, this.field_74887_e.field_78897_a + 1, this.field_74887_e.field_78895_b + 3 + 1, this.field_74887_e.field_78892_f + 1, EnumFacing.SOUTH, i);
  25702. }
  25703. }
  25704.  
  25705. }
  25706.  
  25707. public boolean func_74875_a(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) {
  25708. if(this.func_74860_a(p_74875_1_, p_74875_3_)) {
  25709. return false;
  25710. } else {
  25711. IBlockState iblockstate = this.func_189917_F_();
  25712. if(this.field_74952_b) {
  25713. this.func_175804_a(p_74875_1_, p_74875_3_, this.field_74887_e.field_78897_a + 1, this.field_74887_e.field_78895_b, this.field_74887_e.field_78896_c, this.field_74887_e.field_78893_d - 1, this.field_74887_e.field_78895_b + 3 - 1, this.field_74887_e.field_78892_f, Blocks.field_150350_a.func_176223_P(), Blocks.field_150350_a.func_176223_P(), false);
  25714. this.func_175804_a(p_74875_1_, p_74875_3_, this.field_74887_e.field_78897_a, this.field_74887_e.field_78895_b, this.field_74887_e.field_78896_c + 1, this.field_74887_e.field_78893_d, this.field_74887_e.field_78895_b + 3 - 1, this.field_74887_e.field_78892_f - 1, Blocks.field_150350_a.func_176223_P(), Blocks.field_150350_a.func_176223_P(), false);
  25715. this.func_175804_a(p_74875_1_, p_74875_3_, this.field_74887_e.field_78897_a + 1, this.field_74887_e.field_78894_e - 2, this.field_74887_e.field_78896_c, this.field_74887_e.field_78893_d - 1, this.field_74887_e.field_78894_e, this.field_74887_e.field_78892_f, Blocks.field_150350_a.func_176223_P(), Blocks.field_150350_a.func_176223_P(), false);
  25716. this.func_175804_a(p_74875_1_, p_74875_3_, this.field_74887_e.field_78897_a, this.field_74887_e.field_78894_e - 2, this.field_74887_e.field_78896_c + 1, this.field_74887_e.field_78893_d, this.field_74887_e.field_78894_e, this.field_74887_e.field_78892_f - 1, Blocks.field_150350_a.func_176223_P(), Blocks.field_150350_a.func_176223_P(), false);
  25717. this.func_175804_a(p_74875_1_, p_74875_3_, this.field_74887_e.field_78897_a + 1, this.field_74887_e.field_78895_b + 3, this.field_74887_e.field_78896_c + 1, this.field_74887_e.field_78893_d - 1, this.field_74887_e.field_78895_b + 3, this.field_74887_e.field_78892_f - 1, Blocks.field_150350_a.func_176223_P(), Blocks.field_150350_a.func_176223_P(), false);
  25718. } else {
  25719. this.func_175804_a(p_74875_1_, p_74875_3_, this.field_74887_e.field_78897_a + 1, this.field_74887_e.field_78895_b, this.field_74887_e.field_78896_c, this.field_74887_e.field_78893_d - 1, this.field_74887_e.field_78894_e, this.field_74887_e.field_78892_f, Blocks.field_150350_a.func_176223_P(), Blocks.field_150350_a.func_176223_P(), false);
  25720. this.func_175804_a(p_74875_1_, p_74875_3_, this.field_74887_e.field_78897_a, this.field_74887_e.field_78895_b, this.field_74887_e.field_78896_c + 1, this.field_74887_e.field_78893_d, this.field_74887_e.field_78894_e, this.field_74887_e.field_78892_f - 1, Blocks.field_150350_a.func_176223_P(), Blocks.field_150350_a.func_176223_P(), false);
  25721. }
  25722.  
  25723. this.func_189923_b(p_74875_1_, p_74875_3_, this.field_74887_e.field_78897_a + 1, this.field_74887_e.field_78895_b, this.field_74887_e.field_78896_c + 1, this.field_74887_e.field_78894_e);
  25724. this.func_189923_b(p_74875_1_, p_74875_3_, this.field_74887_e.field_78897_a + 1, this.field_74887_e.field_78895_b, this.field_74887_e.field_78892_f - 1, this.field_74887_e.field_78894_e);
  25725. this.func_189923_b(p_74875_1_, p_74875_3_, this.field_74887_e.field_78893_d - 1, this.field_74887_e.field_78895_b, this.field_74887_e.field_78896_c + 1, this.field_74887_e.field_78894_e);
  25726. this.func_189923_b(p_74875_1_, p_74875_3_, this.field_74887_e.field_78893_d - 1, this.field_74887_e.field_78895_b, this.field_74887_e.field_78892_f - 1, this.field_74887_e.field_78894_e);
  25727.  
  25728. for(int i = this.field_74887_e.field_78897_a; i <= this.field_74887_e.field_78893_d; ++i) {
  25729. for(int j = this.field_74887_e.field_78896_c; j <= this.field_74887_e.field_78892_f; ++j) {
  25730. if(this.func_175807_a(p_74875_1_, i, this.field_74887_e.field_78895_b - 1, j, p_74875_3_).func_185904_a() == Material.field_151579_a && this.func_189916_b(p_74875_1_, i, this.field_74887_e.field_78895_b - 1, j, p_74875_3_) < 8) {
  25731. this.func_175811_a(p_74875_1_, iblockstate, i, this.field_74887_e.field_78895_b - 1, j, p_74875_3_);
  25732. }
  25733. }
  25734. }
  25735.  
  25736. return true;
  25737. }
  25738. }
  25739.  
  25740. private void func_189923_b(World p_189923_1_, StructureBoundingBox p_189923_2_, int p_189923_3_, int p_189923_4_, int p_189923_5_, int p_189923_6_) {
  25741. if(this.func_175807_a(p_189923_1_, p_189923_3_, p_189923_6_ + 1, p_189923_5_, p_189923_2_).func_185904_a() != Material.field_151579_a) {
  25742. this.func_175804_a(p_189923_1_, p_189923_2_, p_189923_3_, p_189923_4_, p_189923_5_, p_189923_3_, p_189923_6_, p_189923_5_, this.func_189917_F_(), Blocks.field_150350_a.func_176223_P(), false);
  25743. }
  25744.  
  25745. }
  25746. }
  25747.  
  25748. abstract static class Peice extends StructureComponent {
  25749. protected MapGenMineshaft.Type field_189920_a;
  25750.  
  25751. public Peice() {
  25752. }
  25753.  
  25754. public Peice(int p_i47138_1_, MapGenMineshaft.Type p_i47138_2_) {
  25755. super(p_i47138_1_);
  25756. this.field_189920_a = p_i47138_2_;
  25757. }
  25758.  
  25759. protected void func_143012_a(NBTTagCompound p_143012_1_) {
  25760. p_143012_1_.func_74768_a("MST", this.field_189920_a.ordinal());
  25761. }
  25762.  
  25763. protected void func_143011_b(NBTTagCompound p_143011_1_, TemplateManager p_143011_2_) {
  25764. this.field_189920_a = MapGenMineshaft.Type.func_189910_a(p_143011_1_.func_74762_e("MST"));
  25765. }
  25766.  
  25767. protected IBlockState func_189917_F_() {
  25768. switch(this.field_189920_a) {
  25769. case NORMAL:
  25770. default:
  25771. return Blocks.field_150344_f.func_176223_P();
  25772. case MESA:
  25773. return Blocks.field_150344_f.func_176223_P().func_177226_a(BlockPlanks.field_176383_a, BlockPlanks.EnumType.DARK_OAK);
  25774. }
  25775. }
  25776.  
  25777. protected IBlockState func_189919_b() {
  25778. switch(this.field_189920_a) {
  25779. case NORMAL:
  25780. default:
  25781. return Blocks.field_180407_aO.func_176223_P();
  25782. case MESA:
  25783. return Blocks.field_180406_aS.func_176223_P();
  25784. }
  25785. }
  25786.  
  25787. protected boolean func_189918_a(World p_189918_1_, StructureBoundingBox p_189918_2_, int p_189918_3_, int p_189918_4_, int p_189918_5_, int p_189918_6_) {
  25788. for(int i = p_189918_3_; i <= p_189918_4_; ++i) {
  25789. if(this.func_175807_a(p_189918_1_, i, p_189918_5_ + 1, p_189918_6_, p_189918_2_).func_185904_a() == Material.field_151579_a) {
  25790. return false;
  25791. }
  25792. }
  25793.  
  25794. return true;
  25795. }
  25796. }
  25797.  
  25798. public static class Room extends StructureMineshaftPieces.Peice {
  25799. private final List<StructureBoundingBox> field_74949_a = Lists.<StructureBoundingBox>newLinkedList();
  25800.  
  25801. public Room() {
  25802. }
  25803.  
  25804. public Room(int p_i47137_1_, Random p_i47137_2_, int p_i47137_3_, int p_i47137_4_, MapGenMineshaft.Type p_i47137_5_) {
  25805. super(p_i47137_1_, p_i47137_5_);
  25806. this.field_189920_a = p_i47137_5_;
  25807. this.field_74887_e = new StructureBoundingBox(p_i47137_3_, 50, p_i47137_4_, p_i47137_3_ + 7 + p_i47137_2_.nextInt(6), 54 + p_i47137_2_.nextInt(6), p_i47137_4_ + 7 + p_i47137_2_.nextInt(6));
  25808. }
  25809.  
  25810. public void func_74861_a(StructureComponent p_74861_1_, List<StructureComponent> p_74861_2_, Random p_74861_3_) {
  25811. int i = this.func_74877_c();
  25812. int k = this.field_74887_e.func_78882_c() - 3 - 1;
  25813. if(k <= 0) {
  25814. k = 1;
  25815. }
  25816.  
  25817. int l;
  25818. for(int j = 0; j < this.field_74887_e.func_78883_b(); j = l + 4) {
  25819. l = j + p_74861_3_.nextInt(this.field_74887_e.func_78883_b());
  25820. if(l + 3 > this.field_74887_e.func_78883_b()) {
  25821. break;
  25822. }
  25823.  
  25824. StructureMineshaftPieces.Peice structuremineshaftpieces$peice = StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, this.field_74887_e.field_78897_a + l, this.field_74887_e.field_78895_b + p_74861_3_.nextInt(k) + 1, this.field_74887_e.field_78896_c - 1, EnumFacing.NORTH, i);
  25825. if(structuremineshaftpieces$peice != null) {
  25826. StructureBoundingBox structureboundingbox = structuremineshaftpieces$peice.func_74874_b();
  25827. this.field_74949_a.add(new StructureBoundingBox(structureboundingbox.field_78897_a, structureboundingbox.field_78895_b, this.field_74887_e.field_78896_c, structureboundingbox.field_78893_d, structureboundingbox.field_78894_e, this.field_74887_e.field_78896_c + 1));
  25828. }
  25829. }
  25830.  
  25831. for(int i1 = 0; i1 < this.field_74887_e.func_78883_b(); i1 = l + 4) {
  25832. l = i1 + p_74861_3_.nextInt(this.field_74887_e.func_78883_b());
  25833. if(l + 3 > this.field_74887_e.func_78883_b()) {
  25834. break;
  25835. }
  25836.  
  25837. StructureMineshaftPieces.Peice structuremineshaftpieces$peice1 = StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, this.field_74887_e.field_78897_a + l, this.field_74887_e.field_78895_b + p_74861_3_.nextInt(k) + 1, this.field_74887_e.field_78892_f + 1, EnumFacing.SOUTH, i);
  25838. if(structuremineshaftpieces$peice1 != null) {
  25839. StructureBoundingBox structureboundingbox1 = structuremineshaftpieces$peice1.func_74874_b();
  25840. this.field_74949_a.add(new StructureBoundingBox(structureboundingbox1.field_78897_a, structureboundingbox1.field_78895_b, this.field_74887_e.field_78892_f - 1, structureboundingbox1.field_78893_d, structureboundingbox1.field_78894_e, this.field_74887_e.field_78892_f));
  25841. }
  25842. }
  25843.  
  25844. for(int j1 = 0; j1 < this.field_74887_e.func_78880_d(); j1 = l + 4) {
  25845. l = j1 + p_74861_3_.nextInt(this.field_74887_e.func_78880_d());
  25846. if(l + 3 > this.field_74887_e.func_78880_d()) {
  25847. break;
  25848. }
  25849.  
  25850. StructureMineshaftPieces.Peice structuremineshaftpieces$peice2 = StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, this.field_74887_e.field_78897_a - 1, this.field_74887_e.field_78895_b + p_74861_3_.nextInt(k) + 1, this.field_74887_e.field_78896_c + l, EnumFacing.WEST, i);
  25851. if(structuremineshaftpieces$peice2 != null) {
  25852. StructureBoundingBox structureboundingbox2 = structuremineshaftpieces$peice2.func_74874_b();
  25853. this.field_74949_a.add(new StructureBoundingBox(this.field_74887_e.field_78897_a, structureboundingbox2.field_78895_b, structureboundingbox2.field_78896_c, this.field_74887_e.field_78897_a + 1, structureboundingbox2.field_78894_e, structureboundingbox2.field_78892_f));
  25854. }
  25855. }
  25856.  
  25857. for(int k1 = 0; k1 < this.field_74887_e.func_78880_d(); k1 = l + 4) {
  25858. l = k1 + p_74861_3_.nextInt(this.field_74887_e.func_78880_d());
  25859. if(l + 3 > this.field_74887_e.func_78880_d()) {
  25860. break;
  25861. }
  25862.  
  25863. StructureComponent structurecomponent = StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, this.field_74887_e.field_78893_d + 1, this.field_74887_e.field_78895_b + p_74861_3_.nextInt(k) + 1, this.field_74887_e.field_78896_c + l, EnumFacing.EAST, i);
  25864. if(structurecomponent != null) {
  25865. StructureBoundingBox structureboundingbox3 = structurecomponent.func_74874_b();
  25866. this.field_74949_a.add(new StructureBoundingBox(this.field_74887_e.field_78893_d - 1, structureboundingbox3.field_78895_b, structureboundingbox3.field_78896_c, this.field_74887_e.field_78893_d, structureboundingbox3.field_78894_e, structureboundingbox3.field_78892_f));
  25867. }
  25868. }
  25869.  
  25870. }
  25871.  
  25872. public boolean func_74875_a(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) {
  25873. if(this.func_74860_a(p_74875_1_, p_74875_3_)) {
  25874. return false;
  25875. } else {
  25876. this.func_175804_a(p_74875_1_, p_74875_3_, this.field_74887_e.field_78897_a, this.field_74887_e.field_78895_b, this.field_74887_e.field_78896_c, this.field_74887_e.field_78893_d, this.field_74887_e.field_78895_b, this.field_74887_e.field_78892_f, Blocks.field_150346_d.func_176223_P(), Blocks.field_150350_a.func_176223_P(), true);
  25877. this.func_175804_a(p_74875_1_, p_74875_3_, this.field_74887_e.field_78897_a, this.field_74887_e.field_78895_b + 1, this.field_74887_e.field_78896_c, this.field_74887_e.field_78893_d, Math.min(this.field_74887_e.field_78895_b + 3, this.field_74887_e.field_78894_e), this.field_74887_e.field_78892_f, Blocks.field_150350_a.func_176223_P(), Blocks.field_150350_a.func_176223_P(), false);
  25878.  
  25879. for(StructureBoundingBox structureboundingbox : this.field_74949_a) {
  25880. this.func_175804_a(p_74875_1_, p_74875_3_, structureboundingbox.field_78897_a, structureboundingbox.field_78894_e - 2, structureboundingbox.field_78896_c, structureboundingbox.field_78893_d, structureboundingbox.field_78894_e, structureboundingbox.field_78892_f, Blocks.field_150350_a.func_176223_P(), Blocks.field_150350_a.func_176223_P(), false);
  25881. }
  25882.  
  25883. this.func_180777_a(p_74875_1_, p_74875_3_, this.field_74887_e.field_78897_a, this.field_74887_e.field_78895_b + 4, this.field_74887_e.field_78896_c, this.field_74887_e.field_78893_d, this.field_74887_e.field_78894_e, this.field_74887_e.field_78892_f, Blocks.field_150350_a.func_176223_P(), false);
  25884. return true;
  25885. }
  25886. }
  25887.  
  25888. public void func_181138_a(int p_181138_1_, int p_181138_2_, int p_181138_3_) {
  25889. super.func_181138_a(p_181138_1_, p_181138_2_, p_181138_3_);
  25890.  
  25891. for(StructureBoundingBox structureboundingbox : this.field_74949_a) {
  25892. structureboundingbox.func_78886_a(p_181138_1_, p_181138_2_, p_181138_3_);
  25893. }
  25894.  
  25895. }
  25896.  
  25897. protected void func_143012_a(NBTTagCompound p_143012_1_) {
  25898. super.func_143012_a(p_143012_1_);
  25899. NBTTagList nbttaglist = new NBTTagList();
  25900.  
  25901. for(StructureBoundingBox structureboundingbox : this.field_74949_a) {
  25902. nbttaglist.func_74742_a(structureboundingbox.func_151535_h());
  25903. }
  25904.  
  25905. p_143012_1_.func_74782_a("Entrances", nbttaglist);
  25906. }
  25907.  
  25908. protected void func_143011_b(NBTTagCompound p_143011_1_, TemplateManager p_143011_2_) {
  25909. super.func_143011_b(p_143011_1_, p_143011_2_);
  25910. NBTTagList nbttaglist = p_143011_1_.func_150295_c("Entrances", 11);
  25911.  
  25912. for(int i = 0; i < nbttaglist.func_74745_c(); ++i) {
  25913. this.field_74949_a.add(new StructureBoundingBox(nbttaglist.func_150306_c(i)));
  25914. }
  25915.  
  25916. }
  25917. }
  25918.  
  25919. public static class Stairs extends StructureMineshaftPieces.Peice {
  25920. public Stairs() {
  25921. }
  25922.  
  25923. public Stairs(int p_i47136_1_, Random p_i47136_2_, StructureBoundingBox p_i47136_3_, EnumFacing p_i47136_4_, MapGenMineshaft.Type p_i47136_5_) {
  25924. super(p_i47136_1_, p_i47136_5_);
  25925. this.func_186164_a(p_i47136_4_);
  25926. this.field_74887_e = p_i47136_3_;
  25927. }
  25928.  
  25929. public static StructureBoundingBox func_175812_a(List<StructureComponent> p_175812_0_, Random p_175812_1_, int p_175812_2_, int p_175812_3_, int p_175812_4_, EnumFacing p_175812_5_) {
  25930. StructureBoundingBox structureboundingbox = new StructureBoundingBox(p_175812_2_, p_175812_3_ - 5, p_175812_4_, p_175812_2_, p_175812_3_ + 2, p_175812_4_);
  25931. switch(p_175812_5_) {
  25932. case NORTH:
  25933. default:
  25934. structureboundingbox.field_78893_d = p_175812_2_ + 2;
  25935. structureboundingbox.field_78896_c = p_175812_4_ - 8;
  25936. break;
  25937. case SOUTH:
  25938. structureboundingbox.field_78893_d = p_175812_2_ + 2;
  25939. structureboundingbox.field_78892_f = p_175812_4_ + 8;
  25940. break;
  25941. case WEST:
  25942. structureboundingbox.field_78897_a = p_175812_2_ - 8;
  25943. structureboundingbox.field_78892_f = p_175812_4_ + 2;
  25944. break;
  25945. case EAST:
  25946. structureboundingbox.field_78893_d = p_175812_2_ + 8;
  25947. structureboundingbox.field_78892_f = p_175812_4_ + 2;
  25948. }
  25949.  
  25950. return StructureComponent.func_74883_a(p_175812_0_, structureboundingbox) != null?null:structureboundingbox;
  25951. }
  25952.  
  25953. public void func_74861_a(StructureComponent p_74861_1_, List<StructureComponent> p_74861_2_, Random p_74861_3_) {
  25954. int i = this.func_74877_c();
  25955. EnumFacing enumfacing = this.func_186165_e();
  25956. if(enumfacing != null) {
  25957. switch(enumfacing) {
  25958. case NORTH:
  25959. default:
  25960. StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, this.field_74887_e.field_78897_a, this.field_74887_e.field_78895_b, this.field_74887_e.field_78896_c - 1, EnumFacing.NORTH, i);
  25961. break;
  25962. case SOUTH:
  25963. StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, this.field_74887_e.field_78897_a, this.field_74887_e.field_78895_b, this.field_74887_e.field_78892_f + 1, EnumFacing.SOUTH, i);
  25964. break;
  25965. case WEST:
  25966. StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, this.field_74887_e.field_78897_a - 1, this.field_74887_e.field_78895_b, this.field_74887_e.field_78896_c, EnumFacing.WEST, i);
  25967. break;
  25968. case EAST:
  25969. StructureMineshaftPieces.func_189938_b(p_74861_1_, p_74861_2_, p_74861_3_, this.field_74887_e.field_78893_d + 1, this.field_74887_e.field_78895_b, this.field_74887_e.field_78896_c, EnumFacing.EAST, i);
  25970. }
  25971. }
  25972.  
  25973. }
  25974.  
  25975. public boolean func_74875_a(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) {
  25976. if(this.func_74860_a(p_74875_1_, p_74875_3_)) {
  25977. return false;
  25978. } else {
  25979. this.func_175804_a(p_74875_1_, p_74875_3_, 0, 5, 0, 2, 7, 1, Blocks.field_150350_a.func_176223_P(), Blocks.field_150350_a.func_176223_P(), false);
  25980. this.func_175804_a(p_74875_1_, p_74875_3_, 0, 0, 7, 2, 2, 8, Blocks.field_150350_a.func_176223_P(), Blocks.field_150350_a.func_176223_P(), false);
  25981.  
  25982. for(int i = 0; i < 5; ++i) {
  25983. this.func_175804_a(p_74875_1_, p_74875_3_, 0, 5 - i - (i < 4?1:0), 2 + i, 2, 7 - i, 2 + i, Blocks.field_150350_a.func_176223_P(), Blocks.field_150350_a.func_176223_P(), false);
  25984. }
  25985.  
  25986. return true;
  25987. }
  25988. }
  25989. }
  25990. }
  25991.  
  25992. Patching failed: minecraft\net\minecraft\world\storage\loot\functions\LootFunctionManager.java
  25993. Hunk 1 failed! Cannot find hunk target
  25994.  
  25995. public static <T extends LootFunction> void func_186582_a(LootFunction.Serializer<? extends T> p_186582_0_) {
  25996. ResourceLocation resourcelocation = p_186582_0_.func_186529_a();
  25997. - Class<T> oclass = p_186582_0_.func_186531_b();
  25998. + Class<T> oclass = (Class<T>)p_186582_0_.func_186531_b();
  25999. if (field_186584_a.containsKey(resourcelocation)) {
  26000. throw new IllegalArgumentException("Can't re-register item function name " + resourcelocation);
  26001. } else if (field_186585_b.containsKey(oclass)) {
  26002. File state
  26003. package net.minecraft.world.storage.loot.functions;
  26004.  
  26005. import com.google.common.collect.Maps;
  26006. import com.google.gson.JsonDeserializationContext;
  26007. import com.google.gson.JsonDeserializer;
  26008. import com.google.gson.JsonElement;
  26009. import com.google.gson.JsonObject;
  26010. import com.google.gson.JsonParseException;
  26011. import com.google.gson.JsonSerializationContext;
  26012. import com.google.gson.JsonSerializer;
  26013. import com.google.gson.JsonSyntaxException;
  26014. import java.lang.reflect.Type;
  26015. import java.util.Map;
  26016. import net.minecraft.util.JsonUtils;
  26017. import net.minecraft.util.ResourceLocation;
  26018. import net.minecraft.world.storage.loot.conditions.LootCondition;
  26019. import net.minecraft.world.storage.loot.functions.EnchantRandomly;
  26020. import net.minecraft.world.storage.loot.functions.EnchantWithLevels;
  26021. import net.minecraft.world.storage.loot.functions.LootFunction;
  26022. import net.minecraft.world.storage.loot.functions.LootingEnchantBonus;
  26023. import net.minecraft.world.storage.loot.functions.SetAttributes;
  26024. import net.minecraft.world.storage.loot.functions.SetCount;
  26025. import net.minecraft.world.storage.loot.functions.SetDamage;
  26026. import net.minecraft.world.storage.loot.functions.SetMetadata;
  26027. import net.minecraft.world.storage.loot.functions.SetNBT;
  26028. import net.minecraft.world.storage.loot.functions.Smelt;
  26029.  
  26030. public class LootFunctionManager {
  26031. private static final Map<ResourceLocation, LootFunction.Serializer<?>> field_186584_a = Maps.<ResourceLocation, LootFunction.Serializer<?>>newHashMap();
  26032. private static final Map<Class<? extends LootFunction>, LootFunction.Serializer<?>> field_186585_b = Maps.<Class<? extends LootFunction>, LootFunction.Serializer<?>>newHashMap();
  26033.  
  26034. public static <T extends LootFunction> void func_186582_a(LootFunction.Serializer<? extends T> p_186582_0_) {
  26035. ResourceLocation resourcelocation = p_186582_0_.func_186529_a();
  26036. Class<T> oclass = p_186582_0_.func_186531_b();
  26037. if(field_186584_a.containsKey(resourcelocation)) {
  26038. throw new IllegalArgumentException("Can\'t re-register item function name " + resourcelocation);
  26039. } else if(field_186585_b.containsKey(oclass)) {
  26040. throw new IllegalArgumentException("Can\'t re-register item function class " + oclass.getName());
  26041. } else {
  26042. field_186584_a.put(resourcelocation, p_186582_0_);
  26043. field_186585_b.put(oclass, p_186582_0_);
  26044. }
  26045. }
  26046.  
  26047. public static LootFunction.Serializer<?> func_186583_a(ResourceLocation p_186583_0_) {
  26048. LootFunction.Serializer<?> serializer = (LootFunction.Serializer)field_186584_a.get(p_186583_0_);
  26049. if(serializer == null) {
  26050. throw new IllegalArgumentException("Unknown loot item function \'" + p_186583_0_ + "\'");
  26051. } else {
  26052. return serializer;
  26053. }
  26054. }
  26055.  
  26056. public static <T extends LootFunction> LootFunction.Serializer<T> func_186581_a(T p_186581_0_) {
  26057. LootFunction.Serializer<T> serializer = (LootFunction.Serializer)field_186585_b.get(p_186581_0_.getClass());
  26058. if(serializer == null) {
  26059. throw new IllegalArgumentException("Unknown loot item function " + p_186581_0_);
  26060. } else {
  26061. return serializer;
  26062. }
  26063. }
  26064.  
  26065. static {
  26066. func_186582_a(new SetCount.Serializer());
  26067. func_186582_a(new SetMetadata.Serializer());
  26068. func_186582_a(new EnchantWithLevels.Serializer());
  26069. func_186582_a(new EnchantRandomly.Serializer());
  26070. func_186582_a(new SetNBT.Serializer());
  26071. func_186582_a(new Smelt.Serializer());
  26072. func_186582_a(new LootingEnchantBonus.Serializer());
  26073. func_186582_a(new SetDamage.Serializer());
  26074. func_186582_a(new SetAttributes.Serializer());
  26075. }
  26076.  
  26077. public static class Serializer implements JsonDeserializer<LootFunction>, JsonSerializer<LootFunction> {
  26078. public LootFunction deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException {
  26079. JsonObject jsonobject = JsonUtils.func_151210_l(p_deserialize_1_, "function");
  26080. ResourceLocation resourcelocation = new ResourceLocation(JsonUtils.func_151200_h(jsonobject, "function"));
  26081.  
  26082. LootFunction.Serializer<?> serializer;
  26083. try {
  26084. serializer = LootFunctionManager.func_186583_a(resourcelocation);
  26085. } catch (IllegalArgumentException var8) {
  26086. throw new JsonSyntaxException("Unknown function \'" + resourcelocation + "\'");
  26087. }
  26088.  
  26089. return serializer.func_186530_b(jsonobject, p_deserialize_3_, (LootCondition[])JsonUtils.func_188177_a(jsonobject, "conditions", new LootCondition[0], p_deserialize_3_, LootCondition[].class));
  26090. }
  26091.  
  26092. public JsonElement serialize(LootFunction p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) {
  26093. LootFunction.Serializer<LootFunction> serializer = LootFunctionManager.<LootFunction>func_186581_a(p_serialize_1_);
  26094. JsonObject jsonobject = new JsonObject();
  26095. serializer.func_186532_a(jsonobject, p_serialize_1_, p_serialize_3_);
  26096. jsonobject.addProperty("function", serializer.func_186529_a().toString());
  26097. if(p_serialize_1_.func_186554_a() != null && p_serialize_1_.func_186554_a().length > 0) {
  26098. jsonobject.add("conditions", p_serialize_3_.serialize(p_serialize_1_.func_186554_a()));
  26099. }
  26100.  
  26101. return jsonobject;
  26102. }
  26103. }
  26104. }
  26105.  
  26106. Patching failed: minecraft\net\minecraft\world\storage\loot\conditions\LootConditionManager.java
  26107. Hunk 1 failed! Cannot find hunk target
  26108.  
  26109. public static <T extends LootCondition> void func_186639_a(LootCondition.Serializer<? extends T> p_186639_0_) {
  26110. ResourceLocation resourcelocation = p_186639_0_.func_186602_a();
  26111. - Class<T> oclass = p_186639_0_.func_186604_b();
  26112. + Class<T> oclass = (Class<T>)p_186639_0_.func_186604_b();
  26113. if (field_186642_a.containsKey(resourcelocation)) {
  26114. throw new IllegalArgumentException("Can't re-register item condition name " + resourcelocation);
  26115. } else if (field_186643_b.containsKey(oclass)) {
  26116. File state
  26117. package net.minecraft.world.storage.loot.conditions;
  26118.  
  26119. import com.google.common.collect.Maps;
  26120. import com.google.gson.JsonDeserializationContext;
  26121. import com.google.gson.JsonDeserializer;
  26122. import com.google.gson.JsonElement;
  26123. import com.google.gson.JsonObject;
  26124. import com.google.gson.JsonParseException;
  26125. import com.google.gson.JsonSerializationContext;
  26126. import com.google.gson.JsonSerializer;
  26127. import com.google.gson.JsonSyntaxException;
  26128. import java.lang.reflect.Type;
  26129. import java.util.Map;
  26130. import java.util.Random;
  26131. import javax.annotation.Nullable;
  26132. import net.minecraft.util.JsonUtils;
  26133. import net.minecraft.util.ResourceLocation;
  26134. import net.minecraft.world.storage.loot.LootContext;
  26135. import net.minecraft.world.storage.loot.conditions.EntityHasProperty;
  26136. import net.minecraft.world.storage.loot.conditions.EntityHasScore;
  26137. import net.minecraft.world.storage.loot.conditions.KilledByPlayer;
  26138. import net.minecraft.world.storage.loot.conditions.LootCondition;
  26139. import net.minecraft.world.storage.loot.conditions.RandomChance;
  26140. import net.minecraft.world.storage.loot.conditions.RandomChanceWithLooting;
  26141.  
  26142. public class LootConditionManager {
  26143. private static final Map<ResourceLocation, LootCondition.Serializer<?>> field_186642_a = Maps.<ResourceLocation, LootCondition.Serializer<?>>newHashMap();
  26144. private static final Map<Class<? extends LootCondition>, LootCondition.Serializer<?>> field_186643_b = Maps.<Class<? extends LootCondition>, LootCondition.Serializer<?>>newHashMap();
  26145.  
  26146. public static <T extends LootCondition> void func_186639_a(LootCondition.Serializer<? extends T> p_186639_0_) {
  26147. ResourceLocation resourcelocation = p_186639_0_.func_186602_a();
  26148. Class<T> oclass = p_186639_0_.func_186604_b();
  26149. if(field_186642_a.containsKey(resourcelocation)) {
  26150. throw new IllegalArgumentException("Can\'t re-register item condition name " + resourcelocation);
  26151. } else if(field_186643_b.containsKey(oclass)) {
  26152. throw new IllegalArgumentException("Can\'t re-register item condition class " + oclass.getName());
  26153. } else {
  26154. field_186642_a.put(resourcelocation, p_186639_0_);
  26155. field_186643_b.put(oclass, p_186639_0_);
  26156. }
  26157. }
  26158.  
  26159. public static boolean func_186638_a(@Nullable LootCondition[] p_186638_0_, Random p_186638_1_, LootContext p_186638_2_) {
  26160. if(p_186638_0_ == null) {
  26161. return true;
  26162. } else {
  26163. for(LootCondition lootcondition : p_186638_0_) {
  26164. if(!lootcondition.func_186618_a(p_186638_1_, p_186638_2_)) {
  26165. return false;
  26166. }
  26167. }
  26168.  
  26169. return true;
  26170. }
  26171. }
  26172.  
  26173. public static LootCondition.Serializer<?> func_186641_a(ResourceLocation p_186641_0_) {
  26174. LootCondition.Serializer<?> serializer = (LootCondition.Serializer)field_186642_a.get(p_186641_0_);
  26175. if(serializer == null) {
  26176. throw new IllegalArgumentException("Unknown loot item condition \'" + p_186641_0_ + "\'");
  26177. } else {
  26178. return serializer;
  26179. }
  26180. }
  26181.  
  26182. public static <T extends LootCondition> LootCondition.Serializer<T> func_186640_a(T p_186640_0_) {
  26183. LootCondition.Serializer<T> serializer = (LootCondition.Serializer)field_186643_b.get(p_186640_0_.getClass());
  26184. if(serializer == null) {
  26185. throw new IllegalArgumentException("Unknown loot item condition " + p_186640_0_);
  26186. } else {
  26187. return serializer;
  26188. }
  26189. }
  26190.  
  26191. static {
  26192. func_186639_a(new RandomChance.Serializer());
  26193. func_186639_a(new RandomChanceWithLooting.Serializer());
  26194. func_186639_a(new EntityHasProperty.Serializer());
  26195. func_186639_a(new KilledByPlayer.Serializer());
  26196. func_186639_a(new EntityHasScore.Serializer());
  26197. }
  26198.  
  26199. public static class Serializer implements JsonDeserializer<LootCondition>, JsonSerializer<LootCondition> {
  26200. public LootCondition deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException {
  26201. JsonObject jsonobject = JsonUtils.func_151210_l(p_deserialize_1_, "condition");
  26202. ResourceLocation resourcelocation = new ResourceLocation(JsonUtils.func_151200_h(jsonobject, "condition"));
  26203.  
  26204. LootCondition.Serializer<?> serializer;
  26205. try {
  26206. serializer = LootConditionManager.func_186641_a(resourcelocation);
  26207. } catch (IllegalArgumentException var8) {
  26208. throw new JsonSyntaxException("Unknown condition \'" + resourcelocation + "\'");
  26209. }
  26210.  
  26211. return serializer.func_186603_b(jsonobject, p_deserialize_3_);
  26212. }
  26213.  
  26214. public JsonElement serialize(LootCondition p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) {
  26215. LootCondition.Serializer<LootCondition> serializer = LootConditionManager.<LootCondition>func_186640_a(p_serialize_1_);
  26216. JsonObject jsonobject = new JsonObject();
  26217. serializer.func_186605_a(jsonobject, p_serialize_1_, p_serialize_3_);
  26218. jsonobject.addProperty("condition", serializer.func_186602_a().toString());
  26219. return jsonobject;
  26220. }
  26221. }
  26222. }
  26223.  
  26224. Patching failed: minecraft\net\minecraft\world\storage\loot\properties\EntityPropertyManager.java
  26225. Hunk 1 failed! Cannot find hunk target
  26226.  
  26227. public static <T extends EntityProperty> void func_186644_a(EntityProperty.Serializer<? extends T> p_186644_0_) {
  26228. ResourceLocation resourcelocation = p_186644_0_.func_186649_a();
  26229. - Class<T> oclass = p_186644_0_.func_186651_b();
  26230. + Class<T> oclass = (Class<T>)p_186644_0_.func_186651_b();
  26231. if (field_186647_a.containsKey(resourcelocation)) {
  26232. throw new IllegalArgumentException("Can't re-register entity property name " + resourcelocation);
  26233. } else if (field_186648_b.containsKey(oclass)) {
  26234. File state
  26235. package net.minecraft.world.storage.loot.properties;
  26236.  
  26237. import com.google.common.collect.Maps;
  26238. import java.util.Map;
  26239. import net.minecraft.util.ResourceLocation;
  26240. import net.minecraft.world.storage.loot.properties.EntityOnFire;
  26241. import net.minecraft.world.storage.loot.properties.EntityProperty;
  26242.  
  26243. public class EntityPropertyManager {
  26244. private static final Map<ResourceLocation, EntityProperty.Serializer<?>> field_186647_a = Maps.<ResourceLocation, EntityProperty.Serializer<?>>newHashMap();
  26245. private static final Map<Class<? extends EntityProperty>, EntityProperty.Serializer<?>> field_186648_b = Maps.<Class<? extends EntityProperty>, EntityProperty.Serializer<?>>newHashMap();
  26246.  
  26247. public static <T extends EntityProperty> void func_186644_a(EntityProperty.Serializer<? extends T> p_186644_0_) {
  26248. ResourceLocation resourcelocation = p_186644_0_.func_186649_a();
  26249. Class<T> oclass = p_186644_0_.func_186651_b();
  26250. if(field_186647_a.containsKey(resourcelocation)) {
  26251. throw new IllegalArgumentException("Can\'t re-register entity property name " + resourcelocation);
  26252. } else if(field_186648_b.containsKey(oclass)) {
  26253. throw new IllegalArgumentException("Can\'t re-register entity property class " + oclass.getName());
  26254. } else {
  26255. field_186647_a.put(resourcelocation, p_186644_0_);
  26256. field_186648_b.put(oclass, p_186644_0_);
  26257. }
  26258. }
  26259.  
  26260. public static EntityProperty.Serializer<?> func_186646_a(ResourceLocation p_186646_0_) {
  26261. EntityProperty.Serializer<?> serializer = (EntityProperty.Serializer)field_186647_a.get(p_186646_0_);
  26262. if(serializer == null) {
  26263. throw new IllegalArgumentException("Unknown loot entity property \'" + p_186646_0_ + "\'");
  26264. } else {
  26265. return serializer;
  26266. }
  26267. }
  26268.  
  26269. public static <T extends EntityProperty> EntityProperty.Serializer<T> func_186645_a(T p_186645_0_) {
  26270. EntityProperty.Serializer<?> serializer = (EntityProperty.Serializer)field_186648_b.get(p_186645_0_.getClass());
  26271. if(serializer == null) {
  26272. throw new IllegalArgumentException("Unknown loot entity property " + p_186645_0_);
  26273. } else {
  26274. return serializer;
  26275. }
  26276. }
  26277.  
  26278. static {
  26279. func_186644_a(new EntityOnFire.Serializer());
  26280. }
  26281. }
  26282.  
  26283. Hunk 2 failed! Cannot find hunk target
  26284. if (serializer == null) {
  26285. throw new IllegalArgumentException("Unknown loot entity property " + p_186645_0_);
  26286. } else {
  26287. - return serializer;
  26288. + return (EntityProperty.Serializer<T>)serializer;
  26289. }
  26290. }
  26291.  
  26292. File state
  26293. package net.minecraft.world.storage.loot.properties;
  26294.  
  26295. import com.google.common.collect.Maps;
  26296. import java.util.Map;
  26297. import net.minecraft.util.ResourceLocation;
  26298. import net.minecraft.world.storage.loot.properties.EntityOnFire;
  26299. import net.minecraft.world.storage.loot.properties.EntityProperty;
  26300.  
  26301. public class EntityPropertyManager {
  26302. private static final Map<ResourceLocation, EntityProperty.Serializer<?>> field_186647_a = Maps.<ResourceLocation, EntityProperty.Serializer<?>>newHashMap();
  26303. private static final Map<Class<? extends EntityProperty>, EntityProperty.Serializer<?>> field_186648_b = Maps.<Class<? extends EntityProperty>, EntityProperty.Serializer<?>>newHashMap();
  26304.  
  26305. public static <T extends EntityProperty> void func_186644_a(EntityProperty.Serializer<? extends T> p_186644_0_) {
  26306. ResourceLocation resourcelocation = p_186644_0_.func_186649_a();
  26307. Class<T> oclass = p_186644_0_.func_186651_b();
  26308. if(field_186647_a.containsKey(resourcelocation)) {
  26309. throw new IllegalArgumentException("Can\'t re-register entity property name " + resourcelocation);
  26310. } else if(field_186648_b.containsKey(oclass)) {
  26311. throw new IllegalArgumentException("Can\'t re-register entity property class " + oclass.getName());
  26312. } else {
  26313. field_186647_a.put(resourcelocation, p_186644_0_);
  26314. field_186648_b.put(oclass, p_186644_0_);
  26315. }
  26316. }
  26317.  
  26318. public static EntityProperty.Serializer<?> func_186646_a(ResourceLocation p_186646_0_) {
  26319. EntityProperty.Serializer<?> serializer = (EntityProperty.Serializer)field_186647_a.get(p_186646_0_);
  26320. if(serializer == null) {
  26321. throw new IllegalArgumentException("Unknown loot entity property \'" + p_186646_0_ + "\'");
  26322. } else {
  26323. return serializer;
  26324. }
  26325. }
  26326.  
  26327. public static <T extends EntityProperty> EntityProperty.Serializer<T> func_186645_a(T p_186645_0_) {
  26328. EntityProperty.Serializer<?> serializer = (EntityProperty.Serializer)field_186648_b.get(p_186645_0_.getClass());
  26329. if(serializer == null) {
  26330. throw new IllegalArgumentException("Unknown loot entity property " + p_186645_0_);
  26331. } else {
  26332. return serializer;
  26333. }
  26334. }
  26335.  
  26336. static {
  26337. func_186644_a(new EntityOnFire.Serializer());
  26338. }
  26339. }
  26340.  
  26341. Patching failed: minecraft\net\minecraft\client\settings\KeyBinding.java
  26342. Hunk 1 failed! Cannot find hunk target
  26343. public static Supplier<String> func_193626_b(String p_193626_0_) {
  26344. KeyBinding keybinding = field_74516_a.get(p_193626_0_);
  26345. return keybinding == null ? () -> {
  26346. - return p_193624_0_;
  26347. + return p_193626_0_;
  26348. } : () -> {
  26349. - return GameSettings.func_74298_c(p_193625_0_.func_151463_i());
  26350. + return GameSettings.func_74298_c(keybinding.func_151463_i());
  26351. };
  26352. }
  26353.  
  26354. File state
  26355. package net.minecraft.client.settings;
  26356.  
  26357. import com.google.common.collect.Maps;
  26358. import com.google.common.collect.Sets;
  26359. import java.util.Map;
  26360. import java.util.Set;
  26361. import java.util.function.Supplier;
  26362. import net.minecraft.client.resources.I18n;
  26363. import net.minecraft.client.settings.GameSettings;
  26364. import net.minecraft.util.IntHashMap;
  26365. import net.minecraftforge.fml.relauncher.Side;
  26366. import net.minecraftforge.fml.relauncher.SideOnly;
  26367. import org.lwjgl.input.Keyboard;
  26368.  
  26369. @SideOnly(Side.CLIENT)
  26370. public class KeyBinding implements Comparable<KeyBinding> {
  26371. private static final Map<String, KeyBinding> field_74516_a = Maps.<String, KeyBinding>newHashMap();
  26372. private static final IntHashMap<KeyBinding> field_74514_b = new IntHashMap();
  26373. private static final Set<String> field_151473_c = Sets.<String>newHashSet();
  26374. private static final Map<String, Integer> field_193627_d = Maps.<String, Integer>newHashMap();
  26375. private final String field_74515_c;
  26376. private final int field_151472_e;
  26377. private final String field_151471_f;
  26378. private int field_74512_d;
  26379. private boolean field_74513_e;
  26380. private int field_151474_i;
  26381.  
  26382. public static void func_74507_a(int p_74507_0_) {
  26383. if(p_74507_0_ != 0) {
  26384. KeyBinding keybinding = (KeyBinding)field_74514_b.func_76041_a(p_74507_0_);
  26385. if(keybinding != null) {
  26386. ++keybinding.field_151474_i;
  26387. }
  26388.  
  26389. }
  26390. }
  26391.  
  26392. public static void func_74510_a(int p_74510_0_, boolean p_74510_1_) {
  26393. if(p_74510_0_ != 0) {
  26394. KeyBinding keybinding = (KeyBinding)field_74514_b.func_76041_a(p_74510_0_);
  26395. if(keybinding != null) {
  26396. keybinding.field_74513_e = p_74510_1_;
  26397. }
  26398.  
  26399. }
  26400. }
  26401.  
  26402. public static void func_186704_a() {
  26403. for(KeyBinding keybinding : field_74516_a.values()) {
  26404. try {
  26405. func_74510_a(keybinding.field_74512_d, keybinding.field_74512_d < 256 && Keyboard.isKeyDown(keybinding.field_74512_d));
  26406. } catch (IndexOutOfBoundsException var3) {
  26407. ;
  26408. }
  26409. }
  26410.  
  26411. }
  26412.  
  26413. public static void func_74506_a() {
  26414. for(KeyBinding keybinding : field_74516_a.values()) {
  26415. keybinding.func_74505_d();
  26416. }
  26417.  
  26418. }
  26419.  
  26420. public static void func_74508_b() {
  26421. field_74514_b.func_76046_c();
  26422.  
  26423. for(KeyBinding keybinding : field_74516_a.values()) {
  26424. field_74514_b.func_76038_a(keybinding.field_74512_d, keybinding);
  26425. }
  26426.  
  26427. }
  26428.  
  26429. public static Set<String> func_151467_c() {
  26430. return field_151473_c;
  26431. }
  26432.  
  26433. public KeyBinding(String p_i45001_1_, int p_i45001_2_, String p_i45001_3_) {
  26434. this.field_74515_c = p_i45001_1_;
  26435. this.field_74512_d = p_i45001_2_;
  26436. this.field_151472_e = p_i45001_2_;
  26437. this.field_151471_f = p_i45001_3_;
  26438. field_74516_a.put(p_i45001_1_, this);
  26439. field_74514_b.func_76038_a(p_i45001_2_, this);
  26440. field_151473_c.add(p_i45001_3_);
  26441. }
  26442.  
  26443. public boolean func_151470_d() {
  26444. return this.field_74513_e;
  26445. }
  26446.  
  26447. public String func_151466_e() {
  26448. return this.field_151471_f;
  26449. }
  26450.  
  26451. public boolean func_151468_f() {
  26452. if(this.field_151474_i == 0) {
  26453. return false;
  26454. } else {
  26455. --this.field_151474_i;
  26456. return true;
  26457. }
  26458. }
  26459.  
  26460. private void func_74505_d() {
  26461. this.field_151474_i = 0;
  26462. this.field_74513_e = false;
  26463. }
  26464.  
  26465. public String func_151464_g() {
  26466. return this.field_74515_c;
  26467. }
  26468.  
  26469. public int func_151469_h() {
  26470. return this.field_151472_e;
  26471. }
  26472.  
  26473. public int func_151463_i() {
  26474. return this.field_74512_d;
  26475. }
  26476.  
  26477. public void func_151462_b(int p_151462_1_) {
  26478. this.field_74512_d = p_151462_1_;
  26479. }
  26480.  
  26481. public int compareTo(KeyBinding p_compareTo_1_) {
  26482. return this.field_151471_f.equals(p_compareTo_1_.field_151471_f)?I18n.func_135052_a(this.field_74515_c, new Object[0]).compareTo(I18n.func_135052_a(p_compareTo_1_.field_74515_c, new Object[0])):((Integer)field_193627_d.get(this.field_151471_f)).compareTo((Integer)field_193627_d.get(p_compareTo_1_.field_151471_f));
  26483. }
  26484.  
  26485. public static Supplier<String> func_193626_b(String p_193626_0_) {
  26486. KeyBinding keybinding = (KeyBinding)field_74516_a.get(p_193626_0_);
  26487. return keybinding == null?() -> {
  26488. return p_193626_0_;
  26489. }:() -> {
  26490. return GameSettings.func_74298_c(lvt_1_1_.func_151463_i());
  26491. };
  26492. }
  26493.  
  26494. static {
  26495. field_193627_d.put("key.categories.movement", Integer.valueOf(1));
  26496. field_193627_d.put("key.categories.gameplay", Integer.valueOf(2));
  26497. field_193627_d.put("key.categories.inventory", Integer.valueOf(3));
  26498. field_193627_d.put("key.categories.creative", Integer.valueOf(4));
  26499. field_193627_d.put("key.categories.multiplayer", Integer.valueOf(5));
  26500. field_193627_d.put("key.categories.ui", Integer.valueOf(6));
  26501. field_193627_d.put("key.categories.misc", Integer.valueOf(7));
  26502. }
  26503. }
  26504.  
  26505. Patching failed: minecraft\net\minecraft\client\Minecraft.java
  26506. Hunk 1 failed! Cannot find hunk target
  26507.  
  26508. while(true) {
  26509. try {
  26510. - if (!this.field_71425_J) {
  26511. - break;
  26512. - }
  26513. + while (this.field_71425_J) {
  26514.  
  26515. if (!this.field_71434_R || this.field_71433_S == null) {
  26516. try {
  26517. File state
  26518. package net.minecraft.client;
  26519.  
  26520. import com.google.common.collect.Lists;
  26521. import com.google.common.collect.Queues;
  26522. import com.google.common.collect.Sets;
  26523. import com.google.common.hash.Hashing;
  26524. import com.google.common.util.concurrent.Futures;
  26525. import com.google.common.util.concurrent.ListenableFuture;
  26526. import com.google.common.util.concurrent.ListenableFutureTask;
  26527. import com.mojang.authlib.AuthenticationService;
  26528. import com.mojang.authlib.GameProfile;
  26529. import com.mojang.authlib.GameProfileRepository;
  26530. import com.mojang.authlib.minecraft.MinecraftSessionService;
  26531. import com.mojang.authlib.properties.PropertyMap;
  26532. import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService;
  26533. import java.awt.image.BufferedImage;
  26534. import java.io.File;
  26535. import java.io.IOException;
  26536. import java.io.InputStream;
  26537. import java.net.Proxy;
  26538. import java.net.SocketAddress;
  26539. import java.nio.ByteBuffer;
  26540. import java.nio.ByteOrder;
  26541. import java.nio.IntBuffer;
  26542. import java.text.DecimalFormat;
  26543. import java.text.SimpleDateFormat;
  26544. import java.util.Collections;
  26545. import java.util.Date;
  26546. import java.util.Iterator;
  26547. import java.util.List;
  26548. import java.util.Locale;
  26549. import java.util.Queue;
  26550. import java.util.Set;
  26551. import java.util.UUID;
  26552. import java.util.concurrent.Callable;
  26553. import java.util.concurrent.Executors;
  26554. import java.util.concurrent.FutureTask;
  26555. import java.util.function.Consumer;
  26556. import java.util.function.Function;
  26557. import java.util.function.Predicate;
  26558. import java.util.stream.Collectors;
  26559. import javax.annotation.Nullable;
  26560. import javax.imageio.ImageIO;
  26561. import net.minecraft.block.Block;
  26562. import net.minecraft.block.material.Material;
  26563. import net.minecraft.block.state.IBlockState;
  26564. import net.minecraft.client.ClientBrandRetriever;
  26565. import net.minecraft.client.LoadingScreenRenderer;
  26566. import net.minecraft.client.audio.MusicTicker;
  26567. import net.minecraft.client.audio.SoundHandler;
  26568. import net.minecraft.client.entity.EntityPlayerSP;
  26569. import net.minecraft.client.gui.FontRenderer;
  26570. import net.minecraft.client.gui.GuiChat;
  26571. import net.minecraft.client.gui.GuiControls;
  26572. import net.minecraft.client.gui.GuiGameOver;
  26573. import net.minecraft.client.gui.GuiIngame;
  26574. import net.minecraft.client.gui.GuiIngameMenu;
  26575. import net.minecraft.client.gui.GuiMainMenu;
  26576. import net.minecraft.client.gui.GuiMemoryErrorScreen;
  26577. import net.minecraft.client.gui.GuiMultiplayer;
  26578. import net.minecraft.client.gui.GuiNewChat;
  26579. import net.minecraft.client.gui.GuiScreen;
  26580. import net.minecraft.client.gui.GuiScreenWorking;
  26581. import net.minecraft.client.gui.GuiSleepMP;
  26582. import net.minecraft.client.gui.GuiWinGame;
  26583. import net.minecraft.client.gui.ScaledResolution;
  26584. import net.minecraft.client.gui.ScreenChatOptions;
  26585. import net.minecraft.client.gui.advancements.GuiScreenAdvancements;
  26586. import net.minecraft.client.gui.chat.NarratorChatListener;
  26587. import net.minecraft.client.gui.inventory.GuiContainerCreative;
  26588. import net.minecraft.client.gui.inventory.GuiInventory;
  26589. import net.minecraft.client.gui.recipebook.RecipeList;
  26590. import net.minecraft.client.gui.toasts.GuiToast;
  26591. import net.minecraft.client.main.GameConfiguration;
  26592. import net.minecraft.client.multiplayer.GuiConnecting;
  26593. import net.minecraft.client.multiplayer.PlayerControllerMP;
  26594. import net.minecraft.client.multiplayer.ServerData;
  26595. import net.minecraft.client.multiplayer.WorldClient;
  26596. import net.minecraft.client.network.NetHandlerLoginClient;
  26597. import net.minecraft.client.network.NetHandlerPlayClient;
  26598. import net.minecraft.client.particle.ParticleManager;
  26599. import net.minecraft.client.renderer.BlockRendererDispatcher;
  26600. import net.minecraft.client.renderer.BufferBuilder;
  26601. import net.minecraft.client.renderer.EntityRenderer;
  26602. import net.minecraft.client.renderer.GlStateManager;
  26603. import net.minecraft.client.renderer.ItemRenderer;
  26604. import net.minecraft.client.renderer.OpenGlHelper;
  26605. import net.minecraft.client.renderer.RenderGlobal;
  26606. import net.minecraft.client.renderer.RenderItem;
  26607. import net.minecraft.client.renderer.Tessellator;
  26608. import net.minecraft.client.renderer.block.model.ModelManager;
  26609. import net.minecraft.client.renderer.chunk.RenderChunk;
  26610. import net.minecraft.client.renderer.color.BlockColors;
  26611. import net.minecraft.client.renderer.color.ItemColors;
  26612. import net.minecraft.client.renderer.debug.DebugRenderer;
  26613. import net.minecraft.client.renderer.entity.RenderManager;
  26614. import net.minecraft.client.renderer.texture.DynamicTexture;
  26615. import net.minecraft.client.renderer.texture.TextureManager;
  26616. import net.minecraft.client.renderer.texture.TextureMap;
  26617. import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
  26618. import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
  26619. import net.minecraft.client.resources.DefaultResourcePack;
  26620. import net.minecraft.client.resources.FoliageColorReloadListener;
  26621. import net.minecraft.client.resources.GrassColorReloadListener;
  26622. import net.minecraft.client.resources.I18n;
  26623. import net.minecraft.client.resources.IReloadableResourceManager;
  26624. import net.minecraft.client.resources.IResourceManager;
  26625. import net.minecraft.client.resources.IResourcePack;
  26626. import net.minecraft.client.resources.LanguageManager;
  26627. import net.minecraft.client.resources.ResourcePackRepository;
  26628. import net.minecraft.client.resources.SimpleReloadableResourceManager;
  26629. import net.minecraft.client.resources.SkinManager;
  26630. import net.minecraft.client.resources.data.AnimationMetadataSection;
  26631. import net.minecraft.client.resources.data.AnimationMetadataSectionSerializer;
  26632. import net.minecraft.client.resources.data.FontMetadataSection;
  26633. import net.minecraft.client.resources.data.FontMetadataSectionSerializer;
  26634. import net.minecraft.client.resources.data.LanguageMetadataSection;
  26635. import net.minecraft.client.resources.data.LanguageMetadataSectionSerializer;
  26636. import net.minecraft.client.resources.data.MetadataSerializer;
  26637. import net.minecraft.client.resources.data.PackMetadataSection;
  26638. import net.minecraft.client.resources.data.PackMetadataSectionSerializer;
  26639. import net.minecraft.client.resources.data.TextureMetadataSection;
  26640. import net.minecraft.client.resources.data.TextureMetadataSectionSerializer;
  26641. import net.minecraft.client.settings.CreativeSettings;
  26642. import net.minecraft.client.settings.GameSettings;
  26643. import net.minecraft.client.settings.KeyBinding;
  26644. import net.minecraft.client.shader.Framebuffer;
  26645. import net.minecraft.client.tutorial.Tutorial;
  26646. import net.minecraft.client.util.ISearchTree;
  26647. import net.minecraft.client.util.ITooltipFlag;
  26648. import net.minecraft.client.util.RecipeBookClient;
  26649. import net.minecraft.client.util.SearchTree;
  26650. import net.minecraft.client.util.SearchTreeManager;
  26651. import net.minecraft.crash.CrashReport;
  26652. import net.minecraft.crash.CrashReportCategory;
  26653. import net.minecraft.crash.ICrashReportDetail;
  26654. import net.minecraft.creativetab.CreativeTabs;
  26655. import net.minecraft.entity.Entity;
  26656. import net.minecraft.entity.EntityLeashKnot;
  26657. import net.minecraft.entity.EntityList;
  26658. import net.minecraft.entity.item.EntityArmorStand;
  26659. import net.minecraft.entity.item.EntityBoat;
  26660. import net.minecraft.entity.item.EntityEnderCrystal;
  26661. import net.minecraft.entity.item.EntityItemFrame;
  26662. import net.minecraft.entity.item.EntityMinecart;
  26663. import net.minecraft.entity.item.EntityPainting;
  26664. import net.minecraft.entity.player.EntityPlayer;
  26665. import net.minecraft.entity.player.InventoryPlayer;
  26666. import net.minecraft.init.Bootstrap;
  26667. import net.minecraft.init.Items;
  26668. import net.minecraft.item.Item;
  26669. import net.minecraft.item.ItemMonsterPlacer;
  26670. import net.minecraft.item.ItemStack;
  26671. import net.minecraft.nbt.NBTTagCompound;
  26672. import net.minecraft.nbt.NBTTagList;
  26673. import net.minecraft.nbt.NBTTagString;
  26674. import net.minecraft.network.EnumConnectionState;
  26675. import net.minecraft.network.NetworkManager;
  26676. import net.minecraft.network.handshake.client.C00Handshake;
  26677. import net.minecraft.network.login.client.CPacketLoginStart;
  26678. import net.minecraft.network.play.client.CPacketPlayerDigging;
  26679. import net.minecraft.profiler.ISnooperInfo;
  26680. import net.minecraft.profiler.Profiler;
  26681. import net.minecraft.profiler.Snooper;
  26682. import net.minecraft.server.MinecraftServer;
  26683. import net.minecraft.server.integrated.IntegratedServer;
  26684. import net.minecraft.server.management.PlayerProfileCache;
  26685. import net.minecraft.stats.RecipeBook;
  26686. import net.minecraft.stats.StatisticsManager;
  26687. import net.minecraft.tileentity.TileEntity;
  26688. import net.minecraft.tileentity.TileEntitySkull;
  26689. import net.minecraft.util.EnumActionResult;
  26690. import net.minecraft.util.EnumFacing;
  26691. import net.minecraft.util.EnumHand;
  26692. import net.minecraft.util.FrameTimer;
  26693. import net.minecraft.util.IThreadListener;
  26694. import net.minecraft.util.MinecraftError;
  26695. import net.minecraft.util.MouseHelper;
  26696. import net.minecraft.util.MovementInputFromOptions;
  26697. import net.minecraft.util.NonNullList;
  26698. import net.minecraft.util.ReportedException;
  26699. import net.minecraft.util.ResourceLocation;
  26700. import net.minecraft.util.ScreenShotHelper;
  26701. import net.minecraft.util.Session;
  26702. import net.minecraft.util.Timer;
  26703. import net.minecraft.util.Util;
  26704. import net.minecraft.util.datafix.DataFixer;
  26705. import net.minecraft.util.datafix.DataFixesManager;
  26706. import net.minecraft.util.math.BlockPos;
  26707. import net.minecraft.util.math.MathHelper;
  26708. import net.minecraft.util.math.RayTraceResult;
  26709. import net.minecraft.util.text.ITextComponent;
  26710. import net.minecraft.util.text.Style;
  26711. import net.minecraft.util.text.TextComponentKeybind;
  26712. import net.minecraft.util.text.TextComponentString;
  26713. import net.minecraft.util.text.TextComponentTranslation;
  26714. import net.minecraft.util.text.TextFormatting;
  26715. import net.minecraft.world.EnumDifficulty;
  26716. import net.minecraft.world.WorldProviderEnd;
  26717. import net.minecraft.world.WorldProviderHell;
  26718. import net.minecraft.world.WorldSettings;
  26719. import net.minecraft.world.chunk.storage.AnvilSaveConverter;
  26720. import net.minecraft.world.storage.ISaveFormat;
  26721. import net.minecraft.world.storage.ISaveHandler;
  26722. import net.minecraft.world.storage.WorldInfo;
  26723. import net.minecraftforge.fml.relauncher.Side;
  26724. import net.minecraftforge.fml.relauncher.SideOnly;
  26725. import org.apache.commons.io.Charsets;
  26726. import org.apache.commons.io.IOUtils;
  26727. import org.apache.commons.lang3.Validate;
  26728. import org.apache.logging.log4j.LogManager;
  26729. import org.apache.logging.log4j.Logger;
  26730. import org.lwjgl.LWJGLException;
  26731. import org.lwjgl.Sys;
  26732. import org.lwjgl.input.Keyboard;
  26733. import org.lwjgl.input.Mouse;
  26734. import org.lwjgl.opengl.ContextCapabilities;
  26735. import org.lwjgl.opengl.Display;
  26736. import org.lwjgl.opengl.DisplayMode;
  26737. import org.lwjgl.opengl.GLContext;
  26738. import org.lwjgl.opengl.OpenGLException;
  26739. import org.lwjgl.opengl.PixelFormat;
  26740. import org.lwjgl.util.glu.GLU;
  26741.  
  26742. @SideOnly(Side.CLIENT)
  26743. public class Minecraft implements IThreadListener, ISnooperInfo {
  26744. private static final Logger field_147123_G = LogManager.getLogger();
  26745. private static final ResourceLocation field_110444_H = new ResourceLocation("textures/gui/title/mojang.png");
  26746. public static final boolean field_142025_a = Util.func_110647_a() == Util.EnumOS.OSX;
  26747. public static byte[] field_71444_a = new byte[10485760];
  26748. private static final List<DisplayMode> field_110445_I = Lists.newArrayList(new DisplayMode[]{new DisplayMode(2560, 1600), new DisplayMode(2880, 1800)});
  26749. private final File field_130070_K;
  26750. private final PropertyMap field_152356_J;
  26751. private final PropertyMap field_181038_N;
  26752. private ServerData field_71422_O;
  26753. public TextureManager field_71446_o;
  26754. private static Minecraft field_71432_P;
  26755. private final DataFixer field_184131_U;
  26756. public PlayerControllerMP field_71442_b;
  26757. private boolean field_71431_Q;
  26758. private final boolean field_175619_R = true;
  26759. private boolean field_71434_R;
  26760. private CrashReport field_71433_S;
  26761. public int field_71443_c;
  26762. public int field_71440_d;
  26763. private boolean field_181541_X;
  26764. private final Timer field_71428_T = new Timer(20.0F);
  26765. private final Snooper field_71427_U = new Snooper("client", this, MinecraftServer.func_130071_aq());
  26766. public WorldClient field_71441_e;
  26767. public RenderGlobal field_71438_f;
  26768. private RenderManager field_175616_W;
  26769. private RenderItem field_175621_X;
  26770. private ItemRenderer field_175620_Y;
  26771. public EntityPlayerSP field_71439_g;
  26772. @Nullable
  26773. private Entity field_175622_Z;
  26774. public Entity field_147125_j;
  26775. public ParticleManager field_71452_i;
  26776. private SearchTreeManager field_193995_ae = new SearchTreeManager();
  26777. private final Session field_71449_j;
  26778. private boolean field_71445_n;
  26779. private float field_193996_ah;
  26780. public FontRenderer field_71466_p;
  26781. public FontRenderer field_71464_q;
  26782. @Nullable
  26783. public GuiScreen field_71462_r;
  26784. public LoadingScreenRenderer field_71461_s;
  26785. public EntityRenderer field_71460_t;
  26786. public DebugRenderer field_184132_p;
  26787. private int field_71429_W;
  26788. private final int field_71436_X;
  26789. private final int field_71435_Y;
  26790. @Nullable
  26791. private IntegratedServer field_71437_Z;
  26792. public GuiIngame field_71456_v;
  26793. public boolean field_71454_w;
  26794. public RayTraceResult field_71476_x;
  26795. public GameSettings field_71474_y;
  26796. public CreativeSettings field_191950_u;
  26797. public MouseHelper field_71417_B;
  26798. public final File field_71412_D;
  26799. private final File field_110446_Y;
  26800. private final String field_110447_Z;
  26801. private final String field_184130_ao;
  26802. private final Proxy field_110453_aa;
  26803. private ISaveFormat field_71469_aa;
  26804. private static int field_71470_ab;
  26805. private int field_71467_ac;
  26806. private String field_71475_ae;
  26807. private int field_71477_af;
  26808. public boolean field_71415_G;
  26809. long field_71423_H = func_71386_F();
  26810. private int field_71457_ai;
  26811. public final FrameTimer field_181542_y = new FrameTimer();
  26812. long field_181543_z = System.nanoTime();
  26813. private final boolean field_147129_ai;
  26814. private final boolean field_71459_aj;
  26815. @Nullable
  26816. private NetworkManager field_71453_ak;
  26817. private boolean field_71455_al;
  26818. public final Profiler field_71424_I = new Profiler();
  26819. private long field_83002_am = -1L;
  26820. private IReloadableResourceManager field_110451_am;
  26821. private final MetadataSerializer field_110452_an = new MetadataSerializer();
  26822. private final List<IResourcePack> field_110449_ao = Lists.<IResourcePack>newArrayList();
  26823. public final DefaultResourcePack field_110450_ap;
  26824. private ResourcePackRepository field_110448_aq;
  26825. private LanguageManager field_135017_as;
  26826. private BlockColors field_184127_aH;
  26827. private ItemColors field_184128_aI;
  26828. private Framebuffer field_147124_at;
  26829. private TextureMap field_147128_au;
  26830. private SoundHandler field_147127_av;
  26831. private MusicTicker field_147126_aw;
  26832. private ResourceLocation field_152354_ay;
  26833. private final MinecraftSessionService field_152355_az;
  26834. private SkinManager field_152350_aA;
  26835. private final Queue<FutureTask<?>> field_152351_aB = Queues.<FutureTask<?>>newArrayDeque();
  26836. private final Thread field_152352_aC = Thread.currentThread();
  26837. private ModelManager field_175617_aL;
  26838. private BlockRendererDispatcher field_175618_aM;
  26839. private final GuiToast field_193034_aS;
  26840. volatile boolean field_71425_J = true;
  26841. public String field_71426_K = "";
  26842. public boolean field_175612_E = true;
  26843. private long field_71419_L = func_71386_F();
  26844. private int field_71420_M;
  26845. private boolean field_184129_aV;
  26846. private final Tutorial field_193035_aW;
  26847. long field_71421_N = -1L;
  26848. private String field_71465_an = "root";
  26849.  
  26850. public Minecraft(GameConfiguration p_i45547_1_) {
  26851. field_71432_P = this;
  26852. this.field_71412_D = p_i45547_1_.field_178744_c.field_178760_a;
  26853. this.field_110446_Y = p_i45547_1_.field_178744_c.field_178759_c;
  26854. this.field_130070_K = p_i45547_1_.field_178744_c.field_178758_b;
  26855. this.field_110447_Z = p_i45547_1_.field_178741_d.field_178755_b;
  26856. this.field_184130_ao = p_i45547_1_.field_178741_d.field_187053_c;
  26857. this.field_152356_J = p_i45547_1_.field_178745_a.field_178750_b;
  26858. this.field_181038_N = p_i45547_1_.field_178745_a.field_181172_c;
  26859. this.field_110450_ap = new DefaultResourcePack(p_i45547_1_.field_178744_c.func_187052_a());
  26860. this.field_110453_aa = p_i45547_1_.field_178745_a.field_178751_c == null?Proxy.NO_PROXY:p_i45547_1_.field_178745_a.field_178751_c;
  26861. this.field_152355_az = (new YggdrasilAuthenticationService(this.field_110453_aa, UUID.randomUUID().toString())).createMinecraftSessionService();
  26862. this.field_71449_j = p_i45547_1_.field_178745_a.field_178752_a;
  26863. field_147123_G.info((String)"Setting user: {}", (Object)this.field_71449_j.func_111285_a());
  26864. field_147123_G.debug((String)"(Session ID is {})", (Object)this.field_71449_j.func_111286_b());
  26865. this.field_71459_aj = p_i45547_1_.field_178741_d.field_178756_a;
  26866. this.field_71443_c = p_i45547_1_.field_178743_b.field_178764_a > 0?p_i45547_1_.field_178743_b.field_178764_a:1;
  26867. this.field_71440_d = p_i45547_1_.field_178743_b.field_178762_b > 0?p_i45547_1_.field_178743_b.field_178762_b:1;
  26868. this.field_71436_X = p_i45547_1_.field_178743_b.field_178764_a;
  26869. this.field_71435_Y = p_i45547_1_.field_178743_b.field_178762_b;
  26870. this.field_71431_Q = p_i45547_1_.field_178743_b.field_178763_c;
  26871. this.field_147129_ai = func_147122_X();
  26872. this.field_71437_Z = null;
  26873. if(p_i45547_1_.field_178742_e.field_178754_a != null) {
  26874. this.field_71475_ae = p_i45547_1_.field_178742_e.field_178754_a;
  26875. this.field_71477_af = p_i45547_1_.field_178742_e.field_178753_b;
  26876. }
  26877.  
  26878. ImageIO.setUseCache(false);
  26879. Locale.setDefault(Locale.ROOT);
  26880. Bootstrap.func_151354_b();
  26881. TextComponentKeybind.field_193637_b = KeyBinding::func_193626_b;
  26882. this.field_184131_U = DataFixesManager.func_188279_a();
  26883. this.field_193034_aS = new GuiToast(this);
  26884. this.field_193035_aW = new Tutorial(this);
  26885. }
  26886.  
  26887. public void func_99999_d() {
  26888. this.field_71425_J = true;
  26889.  
  26890. try {
  26891. this.func_71384_a();
  26892. } catch (Throwable throwable) {
  26893. CrashReport crashreport = CrashReport.func_85055_a(throwable, "Initializing game");
  26894. crashreport.func_85058_a("Initialization");
  26895. this.func_71377_b(this.func_71396_d(crashreport));
  26896. return;
  26897. }
  26898.  
  26899. while(true) {
  26900. try {
  26901. if(!this.field_71425_J) {
  26902. break;
  26903. }
  26904.  
  26905. if(!this.field_71434_R || this.field_71433_S == null) {
  26906. try {
  26907. this.func_71411_J();
  26908. } catch (OutOfMemoryError var10) {
  26909. this.func_71398_f();
  26910. this.func_147108_a(new GuiMemoryErrorScreen());
  26911. System.gc();
  26912. }
  26913. continue;
  26914. }
  26915.  
  26916. this.func_71377_b(this.field_71433_S);
  26917. } catch (MinecraftError var12) {
  26918. break;
  26919. } catch (ReportedException reportedexception) {
  26920. this.func_71396_d(reportedexception.func_71575_a());
  26921. this.func_71398_f();
  26922. field_147123_G.fatal((String)"Reported exception thrown!", (Throwable)reportedexception);
  26923. this.func_71377_b(reportedexception.func_71575_a());
  26924. break;
  26925. } catch (Throwable throwable1) {
  26926. CrashReport crashreport1 = this.func_71396_d(new CrashReport("Unexpected error", throwable1));
  26927. this.func_71398_f();
  26928. field_147123_G.fatal("Unreported exception thrown!", throwable1);
  26929. this.func_71377_b(crashreport1);
  26930. break;
  26931. } finally {
  26932. this.func_71405_e();
  26933. }
  26934.  
  26935. return;
  26936. }
  26937.  
  26938. }
  26939.  
  26940. private void func_71384_a() throws LWJGLException, IOException {
  26941. this.field_71474_y = new GameSettings(this, this.field_71412_D);
  26942. this.field_191950_u = new CreativeSettings(this, this.field_71412_D);
  26943. this.field_110449_ao.add(this.field_110450_ap);
  26944. this.func_71389_H();
  26945. if(this.field_71474_y.field_92119_C > 0 && this.field_71474_y.field_92118_B > 0) {
  26946. this.field_71443_c = this.field_71474_y.field_92118_B;
  26947. this.field_71440_d = this.field_71474_y.field_92119_C;
  26948. }
  26949.  
  26950. field_147123_G.info((String)"LWJGL Version: {}", (Object)Sys.getVersion());
  26951. this.func_175594_ao();
  26952. this.func_175605_an();
  26953. this.func_175609_am();
  26954. OpenGlHelper.func_77474_a();
  26955. this.field_147124_at = new Framebuffer(this.field_71443_c, this.field_71440_d, true);
  26956. this.field_147124_at.func_147604_a(0.0F, 0.0F, 0.0F, 0.0F);
  26957. this.func_175608_ak();
  26958. this.field_110448_aq = new ResourcePackRepository(this.field_130070_K, new File(this.field_71412_D, "server-resource-packs"), this.field_110450_ap, this.field_110452_an, this.field_71474_y);
  26959. this.field_110451_am = new SimpleReloadableResourceManager(this.field_110452_an);
  26960. this.field_135017_as = new LanguageManager(this.field_110452_an, this.field_71474_y.field_74363_ab);
  26961. this.field_110451_am.func_110542_a(this.field_135017_as);
  26962. this.func_110436_a();
  26963. this.field_71446_o = new TextureManager(this.field_110451_am);
  26964. this.field_110451_am.func_110542_a(this.field_71446_o);
  26965. this.func_180510_a(this.field_71446_o);
  26966. this.field_152350_aA = new SkinManager(this.field_71446_o, new File(this.field_110446_Y, "skins"), this.field_152355_az);
  26967. this.field_71469_aa = new AnvilSaveConverter(new File(this.field_71412_D, "saves"), this.field_184131_U);
  26968. this.field_147127_av = new SoundHandler(this.field_110451_am, this.field_71474_y);
  26969. this.field_110451_am.func_110542_a(this.field_147127_av);
  26970. this.field_147126_aw = new MusicTicker(this);
  26971. this.field_71466_p = new FontRenderer(this.field_71474_y, new ResourceLocation("textures/font/ascii.png"), this.field_71446_o, false);
  26972. if(this.field_71474_y.field_74363_ab != null) {
  26973. this.field_71466_p.func_78264_a(this.func_152349_b());
  26974. this.field_71466_p.func_78275_b(this.field_135017_as.func_135044_b());
  26975. }
  26976.  
  26977. this.field_71464_q = new FontRenderer(this.field_71474_y, new ResourceLocation("textures/font/ascii_sga.png"), this.field_71446_o, false);
  26978. this.field_110451_am.func_110542_a(this.field_71466_p);
  26979. this.field_110451_am.func_110542_a(this.field_71464_q);
  26980. this.field_110451_am.func_110542_a(new GrassColorReloadListener());
  26981. this.field_110451_am.func_110542_a(new FoliageColorReloadListener());
  26982. this.field_71417_B = new MouseHelper();
  26983. this.func_71361_d("Pre startup");
  26984. GlStateManager.func_179098_w();
  26985. GlStateManager.func_179103_j(7425);
  26986. GlStateManager.func_179151_a(1.0D);
  26987. GlStateManager.func_179126_j();
  26988. GlStateManager.func_179143_c(515);
  26989. GlStateManager.func_179141_d();
  26990. GlStateManager.func_179092_a(516, 0.1F);
  26991. GlStateManager.func_187407_a(GlStateManager.CullFace.BACK);
  26992. GlStateManager.func_179128_n(5889);
  26993. GlStateManager.func_179096_D();
  26994. GlStateManager.func_179128_n(5888);
  26995. this.func_71361_d("Startup");
  26996. this.field_147128_au = new TextureMap("textures");
  26997. this.field_147128_au.func_147633_a(this.field_71474_y.field_151442_I);
  26998. this.field_71446_o.func_110580_a(TextureMap.field_110575_b, this.field_147128_au);
  26999. this.field_71446_o.func_110577_a(TextureMap.field_110575_b);
  27000. this.field_147128_au.func_174937_a(false, this.field_71474_y.field_151442_I > 0);
  27001. this.field_175617_aL = new ModelManager(this.field_147128_au);
  27002. this.field_110451_am.func_110542_a(this.field_175617_aL);
  27003. this.field_184127_aH = BlockColors.func_186723_a();
  27004. this.field_184128_aI = ItemColors.func_186729_a(this.field_184127_aH);
  27005. this.field_175621_X = new RenderItem(this.field_71446_o, this.field_175617_aL, this.field_184128_aI);
  27006. this.field_175616_W = new RenderManager(this.field_71446_o, this.field_175621_X);
  27007. this.field_175620_Y = new ItemRenderer(this);
  27008. this.field_110451_am.func_110542_a(this.field_175621_X);
  27009. this.field_71460_t = new EntityRenderer(this, this.field_110451_am);
  27010. this.field_110451_am.func_110542_a(this.field_71460_t);
  27011. this.field_175618_aM = new BlockRendererDispatcher(this.field_175617_aL.func_174954_c(), this.field_184127_aH);
  27012. this.field_110451_am.func_110542_a(this.field_175618_aM);
  27013. this.field_71438_f = new RenderGlobal(this);
  27014. this.field_110451_am.func_110542_a(this.field_71438_f);
  27015. this.func_193986_ar();
  27016. this.field_110451_am.func_110542_a(this.field_193995_ae);
  27017. GlStateManager.func_179083_b(0, 0, this.field_71443_c, this.field_71440_d);
  27018. this.field_71452_i = new ParticleManager(this.field_71441_e, this.field_71446_o);
  27019. this.func_71361_d("Post startup");
  27020. this.field_71456_v = new GuiIngame(this);
  27021. if(this.field_71475_ae != null) {
  27022. this.func_147108_a(new GuiConnecting(new GuiMainMenu(), this, this.field_71475_ae, this.field_71477_af));
  27023. } else {
  27024. this.func_147108_a(new GuiMainMenu());
  27025. }
  27026.  
  27027. this.field_71446_o.func_147645_c(this.field_152354_ay);
  27028. this.field_152354_ay = null;
  27029. this.field_71461_s = new LoadingScreenRenderer(this);
  27030. this.field_184132_p = new DebugRenderer(this);
  27031. if(this.field_71474_y.field_74353_u && !this.field_71431_Q) {
  27032. this.func_71352_k();
  27033. }
  27034.  
  27035. try {
  27036. Display.setVSyncEnabled(this.field_71474_y.field_74352_v);
  27037. } catch (OpenGLException var2) {
  27038. this.field_71474_y.field_74352_v = false;
  27039. this.field_71474_y.func_74303_b();
  27040. }
  27041.  
  27042. this.field_71438_f.func_174966_b();
  27043. }
  27044.  
  27045. private void func_193986_ar() {
  27046. SearchTree<ItemStack> searchtree = new SearchTree((p_193988_0_) -> {
  27047. return (List)p_193988_0_.func_82840_a((EntityPlayer)null, ITooltipFlag.TooltipFlags.NORMAL).stream().map(TextFormatting::func_110646_a).map(String::trim).filter((p_193984_0_) -> {
  27048. return !p_193984_0_.isEmpty();
  27049. }).collect(Collectors.toList());
  27050. }, (p_193985_0_) -> {
  27051. return Collections.singleton(Item.field_150901_e.func_177774_c(p_193985_0_.func_77973_b()));
  27052. });
  27053. NonNullList<ItemStack> nonnulllist = NonNullList.<ItemStack>func_191196_a();
  27054.  
  27055. for(Item item : Item.field_150901_e) {
  27056. item.func_150895_a(CreativeTabs.field_78027_g, nonnulllist);
  27057. }
  27058.  
  27059. nonnulllist.forEach(searchtree::func_194043_a);
  27060. SearchTree<RecipeList> searchtree1 = new SearchTree((p_193990_0_) -> {
  27061. return (List)p_193990_0_.func_192711_b().stream().flatMap((p_193993_0_) -> {
  27062. return p_193993_0_.func_77571_b().func_82840_a((EntityPlayer)null, ITooltipFlag.TooltipFlags.NORMAL).stream();
  27063. }).map(TextFormatting::func_110646_a).map(String::trim).filter((p_193994_0_) -> {
  27064. return !p_193994_0_.isEmpty();
  27065. }).collect(Collectors.toList());
  27066. }, (p_193991_0_) -> {
  27067. return (List)p_193991_0_.func_192711_b().stream().map((p_193992_0_) -> {
  27068. return (ResourceLocation)Item.field_150901_e.func_177774_c(p_193992_0_.func_77571_b().func_77973_b());
  27069. }).collect(Collectors.toList());
  27070. });
  27071. RecipeBookClient.field_194087_f.forEach(searchtree1::func_194043_a);
  27072. this.field_193995_ae.func_194009_a(SearchTreeManager.field_194011_a, searchtree);
  27073. this.field_193995_ae.func_194009_a(SearchTreeManager.field_194012_b, searchtree1);
  27074. }
  27075.  
  27076. private void func_175608_ak() {
  27077. this.field_110452_an.func_110504_a(new TextureMetadataSectionSerializer(), TextureMetadataSection.class);
  27078. this.field_110452_an.func_110504_a(new FontMetadataSectionSerializer(), FontMetadataSection.class);
  27079. this.field_110452_an.func_110504_a(new AnimationMetadataSectionSerializer(), AnimationMetadataSection.class);
  27080. this.field_110452_an.func_110504_a(new PackMetadataSectionSerializer(), PackMetadataSection.class);
  27081. this.field_110452_an.func_110504_a(new LanguageMetadataSectionSerializer(), LanguageMetadataSection.class);
  27082. }
  27083.  
  27084. private void func_175609_am() throws LWJGLException {
  27085. Display.setResizable(true);
  27086. Display.setTitle("Minecraft 1.12");
  27087.  
  27088. try {
  27089. Display.create((new PixelFormat()).withDepthBits(24));
  27090. } catch (LWJGLException lwjglexception) {
  27091. field_147123_G.error((String)"Couldn\'t set pixel format", (Throwable)lwjglexception);
  27092.  
  27093. try {
  27094. Thread.sleep(1000L);
  27095. } catch (InterruptedException var3) {
  27096. ;
  27097. }
  27098.  
  27099. if(this.field_71431_Q) {
  27100. this.func_110441_Q();
  27101. }
  27102.  
  27103. Display.create();
  27104. }
  27105.  
  27106. }
  27107.  
  27108. private void func_175605_an() throws LWJGLException {
  27109. if(this.field_71431_Q) {
  27110. Display.setFullscreen(true);
  27111. DisplayMode displaymode = Display.getDisplayMode();
  27112. this.field_71443_c = Math.max(1, displaymode.getWidth());
  27113. this.field_71440_d = Math.max(1, displaymode.getHeight());
  27114. } else {
  27115. Display.setDisplayMode(new DisplayMode(this.field_71443_c, this.field_71440_d));
  27116. }
  27117.  
  27118. }
  27119.  
  27120. private void func_175594_ao() {
  27121. Util.EnumOS util$enumos = Util.func_110647_a();
  27122. if(util$enumos != Util.EnumOS.OSX) {
  27123. InputStream inputstream = null;
  27124. InputStream inputstream1 = null;
  27125.  
  27126. try {
  27127. inputstream = this.field_110450_ap.func_152780_c(new ResourceLocation("icons/icon_16x16.png"));
  27128. inputstream1 = this.field_110450_ap.func_152780_c(new ResourceLocation("icons/icon_32x32.png"));
  27129. if(inputstream != null && inputstream1 != null) {
  27130. Display.setIcon(new ByteBuffer[]{this.func_152340_a(inputstream), this.func_152340_a(inputstream1)});
  27131. }
  27132. } catch (IOException ioexception) {
  27133. field_147123_G.error((String)"Couldn\'t set icon", (Throwable)ioexception);
  27134. } finally {
  27135. IOUtils.closeQuietly(inputstream);
  27136. IOUtils.closeQuietly(inputstream1);
  27137. }
  27138. }
  27139.  
  27140. }
  27141.  
  27142. private static boolean func_147122_X() {
  27143. String[] astring = new String[]{"sun.arch.data.model", "com.ibm.vm.bitmode", "os.arch"};
  27144.  
  27145. for(String string : astring) {
  27146. String string1 = System.getProperty(string);
  27147. if(string1 != null && string1.contains("64")) {
  27148. return true;
  27149. }
  27150. }
  27151.  
  27152. return false;
  27153. }
  27154.  
  27155. public Framebuffer func_147110_a() {
  27156. return this.field_147124_at;
  27157. }
  27158.  
  27159. public String func_175600_c() {
  27160. return this.field_110447_Z;
  27161. }
  27162.  
  27163. public String func_184123_d() {
  27164. return this.field_184130_ao;
  27165. }
  27166.  
  27167. private void func_71389_H() {
  27168. Thread thread = new Thread("Timer hack thread") {
  27169. public void run() {
  27170. while(Minecraft.this.field_71425_J) {
  27171. try {
  27172. Thread.sleep(2147483647L);
  27173. } catch (InterruptedException var2) {
  27174. ;
  27175. }
  27176. }
  27177.  
  27178. }
  27179. };
  27180. thread.setDaemon(true);
  27181. thread.start();
  27182. }
  27183.  
  27184. public void func_71404_a(CrashReport p_71404_1_) {
  27185. this.field_71434_R = true;
  27186. this.field_71433_S = p_71404_1_;
  27187. }
  27188.  
  27189. public void func_71377_b(CrashReport p_71377_1_) {
  27190. File file = new File(func_71410_x().field_71412_D, "crash-reports");
  27191. File file1 = new File(file, "crash-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + "-client.txt");
  27192. Bootstrap.func_179870_a(p_71377_1_.func_71502_e());
  27193. if(p_71377_1_.func_71497_f() != null) {
  27194. Bootstrap.func_179870_a("#@!@# Game crashed! Crash report saved to: #@!@# " + p_71377_1_.func_71497_f());
  27195. System.exit(-1);
  27196. } else if(p_71377_1_.func_147149_a(file1)) {
  27197. Bootstrap.func_179870_a("#@!@# Game crashed! Crash report saved to: #@!@# " + file1.getAbsolutePath());
  27198. System.exit(-1);
  27199. } else {
  27200. Bootstrap.func_179870_a("#@?@# Game crashed! Crash report could not be saved. #@?@#");
  27201. System.exit(-2);
  27202. }
  27203.  
  27204. }
  27205.  
  27206. public boolean func_152349_b() {
  27207. return this.field_135017_as.func_135042_a() || this.field_71474_y.field_151455_aw;
  27208. }
  27209.  
  27210. public void func_110436_a() {
  27211. List<IResourcePack> list = Lists.newArrayList(this.field_110449_ao);
  27212. if(this.field_71437_Z != null) {
  27213. this.field_71437_Z.func_193031_aM();
  27214. }
  27215.  
  27216. for(ResourcePackRepository.Entry resourcepackrepository$entry : this.field_110448_aq.func_110613_c()) {
  27217. list.add(resourcepackrepository$entry.func_110514_c());
  27218. }
  27219.  
  27220. if(this.field_110448_aq.func_148530_e() != null) {
  27221. list.add(this.field_110448_aq.func_148530_e());
  27222. }
  27223.  
  27224. try {
  27225. this.field_110451_am.func_110541_a(list);
  27226. } catch (RuntimeException runtimeexception) {
  27227. field_147123_G.info((String)"Caught error stitching, removing all assigned resourcepacks", (Throwable)runtimeexception);
  27228. list.clear();
  27229. list.addAll(this.field_110449_ao);
  27230. this.field_110448_aq.func_148527_a(Collections.<ResourcePackRepository.Entry>emptyList());
  27231. this.field_110451_am.func_110541_a(list);
  27232. this.field_71474_y.field_151453_l.clear();
  27233. this.field_71474_y.field_183018_l.clear();
  27234. this.field_71474_y.func_74303_b();
  27235. }
  27236.  
  27237. this.field_135017_as.func_135043_a(list);
  27238. if(this.field_71438_f != null) {
  27239. this.field_71438_f.func_72712_a();
  27240. }
  27241.  
  27242. }
  27243.  
  27244. private ByteBuffer func_152340_a(InputStream p_152340_1_) throws IOException {
  27245. BufferedImage bufferedimage = ImageIO.read(p_152340_1_);
  27246. int[] aint = bufferedimage.getRGB(0, 0, bufferedimage.getWidth(), bufferedimage.getHeight(), (int[])null, 0, bufferedimage.getWidth());
  27247. ByteBuffer bytebuffer = ByteBuffer.allocate(4 * aint.length);
  27248.  
  27249. for(int int : aint) {
  27250. bytebuffer.putInt(int << 8 | int >> 24 & 255);
  27251. }
  27252.  
  27253. bytebuffer.flip();
  27254. return bytebuffer;
  27255. }
  27256.  
  27257. private void func_110441_Q() throws LWJGLException {
  27258. Set<DisplayMode> set = Sets.<DisplayMode>newHashSet();
  27259. Collections.addAll(set, Display.getAvailableDisplayModes());
  27260. DisplayMode displaymode = Display.getDesktopDisplayMode();
  27261. if(!set.contains(displaymode) && Util.func_110647_a() == Util.EnumOS.OSX) {
  27262. label53:
  27263. for(DisplayMode displaymode1 : field_110445_I) {
  27264. boolean boolean = true;
  27265.  
  27266. for(DisplayMode displaymode2 : set) {
  27267. if(displaymode2.getBitsPerPixel() == 32 && displaymode2.getWidth() == displaymode1.getWidth() && displaymode2.getHeight() == displaymode1.getHeight()) {
  27268. boolean = false;
  27269. break;
  27270. }
  27271. }
  27272.  
  27273. if(!boolean) {
  27274. Iterator iterator = set.iterator();
  27275.  
  27276. DisplayMode displaymode3;
  27277. while(true) {
  27278. if(!iterator.hasNext()) {
  27279. continue label53;
  27280. }
  27281.  
  27282. displaymode3 = (DisplayMode)iterator.next();
  27283. if(displaymode3.getBitsPerPixel() == 32 && displaymode3.getWidth() == displaymode1.getWidth() / 2 && displaymode3.getHeight() == displaymode1.getHeight() / 2) {
  27284. break;
  27285. }
  27286. }
  27287.  
  27288. displaymode = displaymode3;
  27289. }
  27290. }
  27291. }
  27292.  
  27293. Display.setDisplayMode(displaymode);
  27294. this.field_71443_c = displaymode.getWidth();
  27295. this.field_71440_d = displaymode.getHeight();
  27296. }
  27297.  
  27298. public void func_180510_a(TextureManager p_180510_1_) throws LWJGLException {
  27299. ScaledResolution scaledresolution = new ScaledResolution(this);
  27300. int int = scaledresolution.func_78325_e();
  27301. Framebuffer framebuffer = new Framebuffer(scaledresolution.func_78326_a() * int, scaledresolution.func_78328_b() * int, true);
  27302. framebuffer.func_147610_a(false);
  27303. GlStateManager.func_179128_n(5889);
  27304. GlStateManager.func_179096_D();
  27305. GlStateManager.func_179130_a(0.0D, (double)scaledresolution.func_78326_a(), (double)scaledresolution.func_78328_b(), 0.0D, 1000.0D, 3000.0D);
  27306. GlStateManager.func_179128_n(5888);
  27307. GlStateManager.func_179096_D();
  27308. GlStateManager.func_179109_b(0.0F, 0.0F, -2000.0F);
  27309. GlStateManager.func_179140_f();
  27310. GlStateManager.func_179106_n();
  27311. GlStateManager.func_179097_i();
  27312. GlStateManager.func_179098_w();
  27313. InputStream inputstream = null;
  27314.  
  27315. try {
  27316. inputstream = this.field_110450_ap.func_110590_a(field_110444_H);
  27317. this.field_152354_ay = p_180510_1_.func_110578_a("logo", new DynamicTexture(ImageIO.read(inputstream)));
  27318. p_180510_1_.func_110577_a(this.field_152354_ay);
  27319. } catch (IOException ioexception) {
  27320. field_147123_G.error((String)"Unable to load logo: {}", (Object)field_110444_H, (Object)ioexception);
  27321. } finally {
  27322. IOUtils.closeQuietly(inputstream);
  27323. }
  27324.  
  27325. Tessellator tessellator = Tessellator.func_178181_a();
  27326. BufferBuilder bufferbuilder = tessellator.func_178180_c();
  27327. bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181709_i);
  27328. bufferbuilder.func_181662_b(0.0D, (double)this.field_71440_d, 0.0D).func_187315_a(0.0D, 0.0D).func_181669_b(255, 255, 255, 255).func_181675_d();
  27329. bufferbuilder.func_181662_b((double)this.field_71443_c, (double)this.field_71440_d, 0.0D).func_187315_a(0.0D, 0.0D).func_181669_b(255, 255, 255, 255).func_181675_d();
  27330. bufferbuilder.func_181662_b((double)this.field_71443_c, 0.0D, 0.0D).func_187315_a(0.0D, 0.0D).func_181669_b(255, 255, 255, 255).func_181675_d();
  27331. bufferbuilder.func_181662_b(0.0D, 0.0D, 0.0D).func_187315_a(0.0D, 0.0D).func_181669_b(255, 255, 255, 255).func_181675_d();
  27332. tessellator.func_78381_a();
  27333. GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
  27334. int int = 256;
  27335. int int = 256;
  27336. this.func_181536_a((scaledresolution.func_78326_a() - 256) / 2, (scaledresolution.func_78328_b() - 256) / 2, 0, 0, 256, 256, 255, 255, 255, 255);
  27337. GlStateManager.func_179140_f();
  27338. GlStateManager.func_179106_n();
  27339. framebuffer.func_147609_e();
  27340. framebuffer.func_147615_c(scaledresolution.func_78326_a() * int, scaledresolution.func_78328_b() * int);
  27341. GlStateManager.func_179141_d();
  27342. GlStateManager.func_179092_a(516, 0.1F);
  27343. this.func_175601_h();
  27344. }
  27345.  
  27346. public void func_181536_a(int p_181536_1_, int p_181536_2_, int p_181536_3_, int p_181536_4_, int p_181536_5_, int p_181536_6_, int p_181536_7_, int p_181536_8_, int p_181536_9_, int p_181536_10_) {
  27347. BufferBuilder bufferbuilder = Tessellator.func_178181_a().func_178180_c();
  27348. bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181709_i);
  27349. float float = 0.00390625F;
  27350. float float = 0.00390625F;
  27351. bufferbuilder.func_181662_b((double)p_181536_1_, (double)(p_181536_2_ + p_181536_6_), 0.0D).func_187315_a((double)((float)p_181536_3_ * 0.00390625F), (double)((float)(p_181536_4_ + p_181536_6_) * 0.00390625F)).func_181669_b(p_181536_7_, p_181536_8_, p_181536_9_, p_181536_10_).func_181675_d();
  27352. bufferbuilder.func_181662_b((double)(p_181536_1_ + p_181536_5_), (double)(p_181536_2_ + p_181536_6_), 0.0D).func_187315_a((double)((float)(p_181536_3_ + p_181536_5_) * 0.00390625F), (double)((float)(p_181536_4_ + p_181536_6_) * 0.00390625F)).func_181669_b(p_181536_7_, p_181536_8_, p_181536_9_, p_181536_10_).func_181675_d();
  27353. bufferbuilder.func_181662_b((double)(p_181536_1_ + p_181536_5_), (double)p_181536_2_, 0.0D).func_187315_a((double)((float)(p_181536_3_ + p_181536_5_) * 0.00390625F), (double)((float)p_181536_4_ * 0.00390625F)).func_181669_b(p_181536_7_, p_181536_8_, p_181536_9_, p_181536_10_).func_181675_d();
  27354. bufferbuilder.func_181662_b((double)p_181536_1_, (double)p_181536_2_, 0.0D).func_187315_a((double)((float)p_181536_3_ * 0.00390625F), (double)((float)p_181536_4_ * 0.00390625F)).func_181669_b(p_181536_7_, p_181536_8_, p_181536_9_, p_181536_10_).func_181675_d();
  27355. Tessellator.func_178181_a().func_78381_a();
  27356. }
  27357.  
  27358. public ISaveFormat func_71359_d() {
  27359. return this.field_71469_aa;
  27360. }
  27361.  
  27362. public void func_147108_a(@Nullable GuiScreen p_147108_1_) {
  27363. if(this.field_71462_r != null) {
  27364. this.field_71462_r.func_146281_b();
  27365. }
  27366.  
  27367. if(p_147108_1_ == null && this.field_71441_e == null) {
  27368. p_147108_1_ = new GuiMainMenu();
  27369. } else if(p_147108_1_ == null && this.field_71439_g.func_110143_aJ() <= 0.0F) {
  27370. p_147108_1_ = new GuiGameOver((ITextComponent)null);
  27371. }
  27372.  
  27373. if(p_147108_1_ instanceof GuiMainMenu || p_147108_1_ instanceof GuiMultiplayer) {
  27374. this.field_71474_y.field_74330_P = false;
  27375. this.field_71456_v.func_146158_b().func_146231_a(true);
  27376. }
  27377.  
  27378. this.field_71462_r = (GuiScreen)p_147108_1_;
  27379. if(p_147108_1_ != null) {
  27380. this.func_71364_i();
  27381. KeyBinding.func_74506_a();
  27382.  
  27383. while(Mouse.next()) {
  27384. ;
  27385. }
  27386.  
  27387. while(Keyboard.next()) {
  27388. ;
  27389. }
  27390.  
  27391. ScaledResolution scaledresolution = new ScaledResolution(this);
  27392. int int = scaledresolution.func_78326_a();
  27393. int int = scaledresolution.func_78328_b();
  27394. ((GuiScreen)p_147108_1_).func_146280_a(this, int, int);
  27395. this.field_71454_w = false;
  27396. } else {
  27397. this.field_147127_av.func_147687_e();
  27398. this.func_71381_h();
  27399. }
  27400.  
  27401. }
  27402.  
  27403. private void func_71361_d(String p_71361_1_) {
  27404. int int = GlStateManager.func_187434_L();
  27405. if(int != 0) {
  27406. String string = GLU.gluErrorString(int);
  27407. field_147123_G.error("########## GL ERROR ##########");
  27408. field_147123_G.error((String)"@ {}", (Object)p_71361_1_);
  27409. field_147123_G.error((String)"{}: {}", (Object)Integer.valueOf(int), (Object)string);
  27410. }
  27411.  
  27412. }
  27413.  
  27414. public void func_71405_e() {
  27415. try {
  27416. field_147123_G.info("Stopping!");
  27417.  
  27418. try {
  27419. this.func_71403_a((WorldClient)null);
  27420. } catch (Throwable var5) {
  27421. ;
  27422. }
  27423.  
  27424. this.field_147127_av.func_147685_d();
  27425. } finally {
  27426. Display.destroy();
  27427. if(!this.field_71434_R) {
  27428. System.exit(0);
  27429. }
  27430.  
  27431. }
  27432.  
  27433. System.gc();
  27434. }
  27435.  
  27436. private void func_71411_J() throws IOException {
  27437. long long = System.nanoTime();
  27438. this.field_71424_I.func_76320_a("root");
  27439. if(Display.isCreated() && Display.isCloseRequested()) {
  27440. this.func_71400_g();
  27441. }
  27442.  
  27443. this.field_71428_T.func_74275_a();
  27444. this.field_71424_I.func_76320_a("scheduledExecutables");
  27445. synchronized(this.field_152351_aB) {
  27446. while(!this.field_152351_aB.isEmpty()) {
  27447. Util.func_181617_a((FutureTask)this.field_152351_aB.poll(), field_147123_G);
  27448. }
  27449. }
  27450.  
  27451. this.field_71424_I.func_76319_b();
  27452. long long = System.nanoTime();
  27453. this.field_71424_I.func_76320_a("tick");
  27454.  
  27455. for(int int = 0; int < Math.min(10, this.field_71428_T.field_74280_b); ++int) {
  27456. this.func_71407_l();
  27457. }
  27458.  
  27459. this.field_71424_I.func_76318_c("preRenderErrors");
  27460. long long = System.nanoTime() - long;
  27461. this.func_71361_d("Pre render");
  27462. this.field_71424_I.func_76318_c("sound");
  27463. this.field_147127_av.func_147691_a(this.field_71439_g, this.field_71428_T.field_194147_b);
  27464. this.field_71424_I.func_76319_b();
  27465. this.field_71424_I.func_76320_a("render");
  27466. GlStateManager.func_179094_E();
  27467. GlStateManager.func_179086_m(16640);
  27468. this.field_147124_at.func_147610_a(true);
  27469. this.field_71424_I.func_76320_a("display");
  27470. GlStateManager.func_179098_w();
  27471. this.field_71424_I.func_76319_b();
  27472. if(!this.field_71454_w) {
  27473. this.field_71424_I.func_76318_c("gameRenderer");
  27474. this.field_71460_t.func_181560_a(this.field_71445_n?this.field_193996_ah:this.field_71428_T.field_194147_b, long);
  27475. this.field_71424_I.func_76318_c("toasts");
  27476. this.field_193034_aS.func_191783_a(new ScaledResolution(this));
  27477. this.field_71424_I.func_76319_b();
  27478. }
  27479.  
  27480. this.field_71424_I.func_76319_b();
  27481. if(this.field_71474_y.field_74330_P && this.field_71474_y.field_74329_Q && !this.field_71474_y.field_74319_N) {
  27482. if(!this.field_71424_I.field_76327_a) {
  27483. this.field_71424_I.func_76317_a();
  27484. }
  27485.  
  27486. this.field_71424_I.field_76327_a = true;
  27487. this.func_71366_a(long);
  27488. } else {
  27489. this.field_71424_I.field_76327_a = false;
  27490. this.field_71421_N = System.nanoTime();
  27491. }
  27492.  
  27493. this.field_147124_at.func_147609_e();
  27494. GlStateManager.func_179121_F();
  27495. GlStateManager.func_179094_E();
  27496. this.field_147124_at.func_147615_c(this.field_71443_c, this.field_71440_d);
  27497. GlStateManager.func_179121_F();
  27498. GlStateManager.func_179094_E();
  27499. this.field_71460_t.func_152430_c(this.field_71428_T.field_194147_b);
  27500. GlStateManager.func_179121_F();
  27501. this.field_71424_I.func_76320_a("root");
  27502. this.func_175601_h();
  27503. Thread.yield();
  27504. this.func_71361_d("Post render");
  27505. ++this.field_71420_M;
  27506. boolean boolean = this.func_71356_B() && this.field_71462_r != null && this.field_71462_r.func_73868_f() && !this.field_71437_Z.func_71344_c();
  27507. if(this.field_71445_n != boolean) {
  27508. if(this.field_71445_n) {
  27509. this.field_193996_ah = this.field_71428_T.field_194147_b;
  27510. } else {
  27511. this.field_71428_T.field_194147_b = this.field_193996_ah;
  27512. }
  27513.  
  27514. this.field_71445_n = boolean;
  27515. }
  27516.  
  27517. long long = System.nanoTime();
  27518. this.field_181542_y.func_181747_a(long - this.field_181543_z);
  27519. this.field_181543_z = long;
  27520.  
  27521. while(func_71386_F() >= this.field_71419_L + 1000L) {
  27522. field_71470_ab = this.field_71420_M;
  27523. this.field_71426_K = String.format("%d fps (%d chunk update%s) T: %s%s%s%s%s", new Object[]{Integer.valueOf(field_71470_ab), Integer.valueOf(RenderChunk.field_178592_a), RenderChunk.field_178592_a == 1?"":"s", (float)this.field_71474_y.field_74350_i == GameSettings.Options.FRAMERATE_LIMIT.func_148267_f()?"inf":Integer.valueOf(this.field_71474_y.field_74350_i), this.field_71474_y.field_74352_v?" vsync":"", this.field_71474_y.field_74347_j?"":" fast", this.field_71474_y.field_74345_l == 0?"":(this.field_71474_y.field_74345_l == 1?" fast-clouds":" fancy-clouds"), OpenGlHelper.func_176075_f()?" vbo":""});
  27524. RenderChunk.field_178592_a = 0;
  27525. this.field_71419_L += 1000L;
  27526. this.field_71420_M = 0;
  27527. this.field_71427_U.func_76471_b();
  27528. if(!this.field_71427_U.func_76468_d()) {
  27529. this.field_71427_U.func_76463_a();
  27530. }
  27531. }
  27532.  
  27533. if(this.func_147107_h()) {
  27534. this.field_71424_I.func_76320_a("fpslimit_wait");
  27535. Display.sync(this.func_90020_K());
  27536. this.field_71424_I.func_76319_b();
  27537. }
  27538.  
  27539. this.field_71424_I.func_76319_b();
  27540. }
  27541.  
  27542. public void func_175601_h() {
  27543. this.field_71424_I.func_76320_a("display_update");
  27544. Display.update();
  27545. this.field_71424_I.func_76319_b();
  27546. this.func_175604_i();
  27547. }
  27548.  
  27549. protected void func_175604_i() {
  27550. if(!this.field_71431_Q && Display.wasResized()) {
  27551. int int = this.field_71443_c;
  27552. int int = this.field_71440_d;
  27553. this.field_71443_c = Display.getWidth();
  27554. this.field_71440_d = Display.getHeight();
  27555. if(this.field_71443_c != int || this.field_71440_d != int) {
  27556. if(this.field_71443_c <= 0) {
  27557. this.field_71443_c = 1;
  27558. }
  27559.  
  27560. if(this.field_71440_d <= 0) {
  27561. this.field_71440_d = 1;
  27562. }
  27563.  
  27564. this.func_71370_a(this.field_71443_c, this.field_71440_d);
  27565. }
  27566. }
  27567.  
  27568. }
  27569.  
  27570. public int func_90020_K() {
  27571. return this.field_71441_e == null && this.field_71462_r != null?30:this.field_71474_y.field_74350_i;
  27572. }
  27573.  
  27574. public boolean func_147107_h() {
  27575. return (float)this.func_90020_K() < GameSettings.Options.FRAMERATE_LIMIT.func_148267_f();
  27576. }
  27577.  
  27578. public void func_71398_f() {
  27579. try {
  27580. field_71444_a = new byte[0];
  27581. this.field_71438_f.func_72728_f();
  27582. } catch (Throwable var3) {
  27583. ;
  27584. }
  27585.  
  27586. try {
  27587. System.gc();
  27588. this.func_71403_a((WorldClient)null);
  27589. } catch (Throwable var2) {
  27590. ;
  27591. }
  27592.  
  27593. System.gc();
  27594. }
  27595.  
  27596. private void func_71383_b(int p_71383_1_) {
  27597. List<Profiler.Result> list = this.field_71424_I.func_76321_b(this.field_71465_an);
  27598. if(!list.isEmpty()) {
  27599. Profiler.Result profiler$result = (Profiler.Result)list.remove(0);
  27600. if(p_71383_1_ == 0) {
  27601. if(!profiler$result.field_76331_c.isEmpty()) {
  27602. int int = this.field_71465_an.lastIndexOf(46);
  27603. if(int >= 0) {
  27604. this.field_71465_an = this.field_71465_an.substring(0, int);
  27605. }
  27606. }
  27607. } else {
  27608. --p_71383_1_;
  27609. if(p_71383_1_ < list.size() && !"unspecified".equals(((Profiler.Result)list.get(p_71383_1_)).field_76331_c)) {
  27610. if(!this.field_71465_an.isEmpty()) {
  27611. this.field_71465_an = this.field_71465_an + ".";
  27612. }
  27613.  
  27614. this.field_71465_an = this.field_71465_an + ((Profiler.Result)list.get(p_71383_1_)).field_76331_c;
  27615. }
  27616. }
  27617.  
  27618. }
  27619. }
  27620.  
  27621. private void func_71366_a(long p_71366_1_) {
  27622. if(this.field_71424_I.field_76327_a) {
  27623. List<Profiler.Result> list = this.field_71424_I.func_76321_b(this.field_71465_an);
  27624. Profiler.Result profiler$result = (Profiler.Result)list.remove(0);
  27625. GlStateManager.func_179086_m(256);
  27626. GlStateManager.func_179128_n(5889);
  27627. GlStateManager.func_179142_g();
  27628. GlStateManager.func_179096_D();
  27629. GlStateManager.func_179130_a(0.0D, (double)this.field_71443_c, (double)this.field_71440_d, 0.0D, 1000.0D, 3000.0D);
  27630. GlStateManager.func_179128_n(5888);
  27631. GlStateManager.func_179096_D();
  27632. GlStateManager.func_179109_b(0.0F, 0.0F, -2000.0F);
  27633. GlStateManager.func_187441_d(1.0F);
  27634. GlStateManager.func_179090_x();
  27635. Tessellator tessellator = Tessellator.func_178181_a();
  27636. BufferBuilder bufferbuilder = tessellator.func_178180_c();
  27637. int int = 160;
  27638. int int = this.field_71443_c - 160 - 10;
  27639. int int = this.field_71440_d - 320;
  27640. GlStateManager.func_179147_l();
  27641. bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181706_f);
  27642. bufferbuilder.func_181662_b((double)((float)int - 176.0F), (double)((float)int - 96.0F - 16.0F), 0.0D).func_181669_b(200, 0, 0, 0).func_181675_d();
  27643. bufferbuilder.func_181662_b((double)((float)int - 176.0F), (double)(int + 320), 0.0D).func_181669_b(200, 0, 0, 0).func_181675_d();
  27644. bufferbuilder.func_181662_b((double)((float)int + 176.0F), (double)(int + 320), 0.0D).func_181669_b(200, 0, 0, 0).func_181675_d();
  27645. bufferbuilder.func_181662_b((double)((float)int + 176.0F), (double)((float)int - 96.0F - 16.0F), 0.0D).func_181669_b(200, 0, 0, 0).func_181675_d();
  27646. tessellator.func_78381_a();
  27647. GlStateManager.func_179084_k();
  27648. double double = 0.0D;
  27649.  
  27650. for(int int = 0; int < list.size(); ++int) {
  27651. Profiler.Result profiler$result1 = (Profiler.Result)list.get(int);
  27652. int int = MathHelper.func_76128_c(profiler$result1.field_76332_a / 4.0D) + 1;
  27653. bufferbuilder.func_181668_a(6, DefaultVertexFormats.field_181706_f);
  27654. int int = profiler$result1.func_76329_a();
  27655. int int = int >> 16 & 255;
  27656. int int = int >> 8 & 255;
  27657. int int = int & 255;
  27658. bufferbuilder.func_181662_b((double)int, (double)int, 0.0D).func_181669_b(int, int, int, 255).func_181675_d();
  27659.  
  27660. for(int int = int; int >= 0; --int) {
  27661. float float = (float)((double + profiler$result1.field_76332_a * (double)int / (double)int) * 6.2831854820251465D / 100.0D);
  27662. float float = MathHelper.func_76126_a(float) * 160.0F;
  27663. float float = MathHelper.func_76134_b(float) * 160.0F * 0.5F;
  27664. bufferbuilder.func_181662_b((double)((float)int + float), (double)((float)int - float), 0.0D).func_181669_b(int, int, int, 255).func_181675_d();
  27665. }
  27666.  
  27667. tessellator.func_78381_a();
  27668. bufferbuilder.func_181668_a(5, DefaultVertexFormats.field_181706_f);
  27669.  
  27670. for(int int = int; int >= 0; --int) {
  27671. float float = (float)((double + profiler$result1.field_76332_a * (double)int / (double)int) * 6.2831854820251465D / 100.0D);
  27672. float float = MathHelper.func_76126_a(float) * 160.0F;
  27673. float float = MathHelper.func_76134_b(float) * 160.0F * 0.5F;
  27674. bufferbuilder.func_181662_b((double)((float)int + float), (double)((float)int - float), 0.0D).func_181669_b(int >> 1, int >> 1, int >> 1, 255).func_181675_d();
  27675. bufferbuilder.func_181662_b((double)((float)int + float), (double)((float)int - float + 10.0F), 0.0D).func_181669_b(int >> 1, int >> 1, int >> 1, 255).func_181675_d();
  27676. }
  27677.  
  27678. tessellator.func_78381_a();
  27679. double += profiler$result1.field_76332_a;
  27680. }
  27681.  
  27682. DecimalFormat decimalformat = new DecimalFormat("##0.00");
  27683. GlStateManager.func_179098_w();
  27684. String string = "";
  27685. if(!"unspecified".equals(profiler$result.field_76331_c)) {
  27686. string = string + "[0] ";
  27687. }
  27688.  
  27689. if(profiler$result.field_76331_c.isEmpty()) {
  27690. string = string + "ROOT ";
  27691. } else {
  27692. string = string + profiler$result.field_76331_c + ' ';
  27693. }
  27694.  
  27695. int int = 16777215;
  27696. this.field_71466_p.func_175063_a(string, (float)(int - 160), (float)(int - 80 - 16), 16777215);
  27697. string = decimalformat.format(profiler$result.field_76330_b) + "%";
  27698. this.field_71466_p.func_175063_a(string, (float)(int + 160 - this.field_71466_p.func_78256_a(string)), (float)(int - 80 - 16), 16777215);
  27699.  
  27700. for(int int = 0; int < list.size(); ++int) {
  27701. Profiler.Result profiler$result2 = (Profiler.Result)list.get(int);
  27702. StringBuilder stringbuilder = new StringBuilder();
  27703. if("unspecified".equals(profiler$result2.field_76331_c)) {
  27704. stringbuilder.append("[?] ");
  27705. } else {
  27706. stringbuilder.append("[").append(int + 1).append("] ");
  27707. }
  27708.  
  27709. String string1 = stringbuilder.append(profiler$result2.field_76331_c).toString();
  27710. this.field_71466_p.func_175063_a(string1, (float)(int - 160), (float)(int + 80 + int * 8 + 20), profiler$result2.func_76329_a());
  27711. string1 = decimalformat.format(profiler$result2.field_76332_a) + "%";
  27712. this.field_71466_p.func_175063_a(string1, (float)(int + 160 - 50 - this.field_71466_p.func_78256_a(string1)), (float)(int + 80 + int * 8 + 20), profiler$result2.func_76329_a());
  27713. string1 = decimalformat.format(profiler$result2.field_76330_b) + "%";
  27714. this.field_71466_p.func_175063_a(string1, (float)(int + 160 - this.field_71466_p.func_78256_a(string1)), (float)(int + 80 + int * 8 + 20), profiler$result2.func_76329_a());
  27715. }
  27716.  
  27717. }
  27718. }
  27719.  
  27720. public void func_71400_g() {
  27721. this.field_71425_J = false;
  27722. }
  27723.  
  27724. public void func_71381_h() {
  27725. if(Display.isActive()) {
  27726. if(!this.field_71415_G) {
  27727. if(!field_142025_a) {
  27728. KeyBinding.func_186704_a();
  27729. }
  27730.  
  27731. this.field_71415_G = true;
  27732. this.field_71417_B.func_74372_a();
  27733. this.func_147108_a((GuiScreen)null);
  27734. this.field_71429_W = 10000;
  27735. }
  27736. }
  27737. }
  27738.  
  27739. public void func_71364_i() {
  27740. if(this.field_71415_G) {
  27741. this.field_71415_G = false;
  27742. this.field_71417_B.func_74373_b();
  27743. }
  27744. }
  27745.  
  27746. public void func_71385_j() {
  27747. if(this.field_71462_r == null) {
  27748. this.func_147108_a(new GuiIngameMenu());
  27749. if(this.func_71356_B() && !this.field_71437_Z.func_71344_c()) {
  27750. this.field_147127_av.func_147689_b();
  27751. }
  27752.  
  27753. }
  27754. }
  27755.  
  27756. private void func_147115_a(boolean p_147115_1_) {
  27757. if(!p_147115_1_) {
  27758. this.field_71429_W = 0;
  27759. }
  27760.  
  27761. if(this.field_71429_W <= 0 && !this.field_71439_g.func_184587_cr()) {
  27762. if(p_147115_1_ && this.field_71476_x != null && this.field_71476_x.field_72313_a == RayTraceResult.Type.BLOCK) {
  27763. BlockPos blockpos = this.field_71476_x.func_178782_a();
  27764. if(this.field_71441_e.func_180495_p(blockpos).func_185904_a() != Material.field_151579_a && this.field_71442_b.func_180512_c(blockpos, this.field_71476_x.field_178784_b)) {
  27765. this.field_71452_i.func_180532_a(blockpos, this.field_71476_x.field_178784_b);
  27766. this.field_71439_g.func_184609_a(EnumHand.MAIN_HAND);
  27767. }
  27768.  
  27769. } else {
  27770. this.field_71442_b.func_78767_c();
  27771. }
  27772. }
  27773. }
  27774.  
  27775. private void func_147116_af() {
  27776. if(this.field_71429_W <= 0) {
  27777. if(this.field_71476_x == null) {
  27778. field_147123_G.error("Null returned as \'hitResult\', this shouldn\'t happen!");
  27779. if(this.field_71442_b.func_78762_g()) {
  27780. this.field_71429_W = 10;
  27781. }
  27782.  
  27783. } else if(!this.field_71439_g.func_184838_M()) {
  27784. switch(this.field_71476_x.field_72313_a) {
  27785. case ENTITY:
  27786. this.field_71442_b.func_78764_a(this.field_71439_g, this.field_71476_x.field_72308_g);
  27787. break;
  27788. case BLOCK:
  27789. BlockPos blockpos = this.field_71476_x.func_178782_a();
  27790. if(this.field_71441_e.func_180495_p(blockpos).func_185904_a() != Material.field_151579_a) {
  27791. this.field_71442_b.func_180511_b(blockpos, this.field_71476_x.field_178784_b);
  27792. break;
  27793. }
  27794. case MISS:
  27795. if(this.field_71442_b.func_78762_g()) {
  27796. this.field_71429_W = 10;
  27797. }
  27798.  
  27799. this.field_71439_g.func_184821_cY();
  27800. }
  27801.  
  27802. this.field_71439_g.func_184609_a(EnumHand.MAIN_HAND);
  27803. }
  27804. }
  27805. }
  27806.  
  27807. private void func_147121_ag() {
  27808. if(!this.field_71442_b.func_181040_m()) {
  27809. this.field_71467_ac = 4;
  27810. if(!this.field_71439_g.func_184838_M()) {
  27811. if(this.field_71476_x == null) {
  27812. field_147123_G.warn("Null returned as \'hitResult\', this shouldn\'t happen!");
  27813. }
  27814.  
  27815. for(EnumHand enumhand : EnumHand.values()) {
  27816. ItemStack itemstack = this.field_71439_g.func_184586_b(enumhand);
  27817. if(this.field_71476_x != null) {
  27818. switch(this.field_71476_x.field_72313_a) {
  27819. case ENTITY:
  27820. if(this.field_71442_b.func_187102_a(this.field_71439_g, this.field_71476_x.field_72308_g, this.field_71476_x, enumhand) == EnumActionResult.SUCCESS) {
  27821. return;
  27822. }
  27823.  
  27824. if(this.field_71442_b.func_187097_a(this.field_71439_g, this.field_71476_x.field_72308_g, enumhand) == EnumActionResult.SUCCESS) {
  27825. return;
  27826. }
  27827. break;
  27828. case BLOCK:
  27829. BlockPos blockpos = this.field_71476_x.func_178782_a();
  27830. if(this.field_71441_e.func_180495_p(blockpos).func_185904_a() != Material.field_151579_a) {
  27831. int int = itemstack.func_190916_E();
  27832. EnumActionResult enumactionresult = this.field_71442_b.func_187099_a(this.field_71439_g, this.field_71441_e, blockpos, this.field_71476_x.field_178784_b, this.field_71476_x.field_72307_f, enumhand);
  27833. if(enumactionresult == EnumActionResult.SUCCESS) {
  27834. this.field_71439_g.func_184609_a(enumhand);
  27835. if(!itemstack.func_190926_b() && (itemstack.func_190916_E() != int || this.field_71442_b.func_78758_h())) {
  27836. this.field_71460_t.field_78516_c.func_187460_a(enumhand);
  27837. }
  27838.  
  27839. return;
  27840. }
  27841. }
  27842. }
  27843. }
  27844.  
  27845. if(!itemstack.func_190926_b() && this.field_71442_b.func_187101_a(this.field_71439_g, this.field_71441_e, enumhand) == EnumActionResult.SUCCESS) {
  27846. this.field_71460_t.field_78516_c.func_187460_a(enumhand);
  27847. return;
  27848. }
  27849. }
  27850.  
  27851. }
  27852. }
  27853. }
  27854.  
  27855. public void func_71352_k() {
  27856. try {
  27857. this.field_71431_Q = !this.field_71431_Q;
  27858. this.field_71474_y.field_74353_u = this.field_71431_Q;
  27859. if(this.field_71431_Q) {
  27860. this.func_110441_Q();
  27861. this.field_71443_c = Display.getDisplayMode().getWidth();
  27862. this.field_71440_d = Display.getDisplayMode().getHeight();
  27863. if(this.field_71443_c <= 0) {
  27864. this.field_71443_c = 1;
  27865. }
  27866.  
  27867. if(this.field_71440_d <= 0) {
  27868. this.field_71440_d = 1;
  27869. }
  27870. } else {
  27871. Display.setDisplayMode(new DisplayMode(this.field_71436_X, this.field_71435_Y));
  27872. this.field_71443_c = this.field_71436_X;
  27873. this.field_71440_d = this.field_71435_Y;
  27874. if(this.field_71443_c <= 0) {
  27875. this.field_71443_c = 1;
  27876. }
  27877.  
  27878. if(this.field_71440_d <= 0) {
  27879. this.field_71440_d = 1;
  27880. }
  27881. }
  27882.  
  27883. if(this.field_71462_r != null) {
  27884. this.func_71370_a(this.field_71443_c, this.field_71440_d);
  27885. } else {
  27886. this.func_147119_ah();
  27887. }
  27888.  
  27889. Display.setFullscreen(this.field_71431_Q);
  27890. Display.setVSyncEnabled(this.field_71474_y.field_74352_v);
  27891. this.func_175601_h();
  27892. } catch (Exception exception) {
  27893. field_147123_G.error((String)"Couldn\'t toggle fullscreen", (Throwable)exception);
  27894. }
  27895.  
  27896. }
  27897.  
  27898. public void func_71370_a(int p_71370_1_, int p_71370_2_) {
  27899. this.field_71443_c = Math.max(1, p_71370_1_);
  27900. this.field_71440_d = Math.max(1, p_71370_2_);
  27901. if(this.field_71462_r != null) {
  27902. ScaledResolution scaledresolution = new ScaledResolution(this);
  27903. this.field_71462_r.func_175273_b(this, scaledresolution.func_78326_a(), scaledresolution.func_78328_b());
  27904. }
  27905.  
  27906. this.field_71461_s = new LoadingScreenRenderer(this);
  27907. this.func_147119_ah();
  27908. }
  27909.  
  27910. private void func_147119_ah() {
  27911. this.field_147124_at.func_147613_a(this.field_71443_c, this.field_71440_d);
  27912. if(this.field_71460_t != null) {
  27913. this.field_71460_t.func_147704_a(this.field_71443_c, this.field_71440_d);
  27914. }
  27915.  
  27916. }
  27917.  
  27918. public MusicTicker func_181535_r() {
  27919. return this.field_147126_aw;
  27920. }
  27921.  
  27922. public void func_71407_l() throws IOException {
  27923. if(this.field_71467_ac > 0) {
  27924. --this.field_71467_ac;
  27925. }
  27926.  
  27927. this.field_71424_I.func_76320_a("gui");
  27928. if(!this.field_71445_n) {
  27929. this.field_71456_v.func_73831_a();
  27930. }
  27931.  
  27932. this.field_71424_I.func_76319_b();
  27933. this.field_71460_t.func_78473_a(1.0F);
  27934. this.field_193035_aW.func_193297_a(this.field_71441_e, this.field_71476_x);
  27935. this.field_71424_I.func_76320_a("gameMode");
  27936. if(!this.field_71445_n && this.field_71441_e != null) {
  27937. this.field_71442_b.func_78765_e();
  27938. }
  27939.  
  27940. this.field_71424_I.func_76318_c("textures");
  27941. if(this.field_71441_e != null) {
  27942. this.field_71446_o.func_110550_d();
  27943. }
  27944.  
  27945. if(this.field_71462_r == null && this.field_71439_g != null) {
  27946. if(this.field_71439_g.func_110143_aJ() <= 0.0F && !(this.field_71462_r instanceof GuiGameOver)) {
  27947. this.func_147108_a((GuiScreen)null);
  27948. } else if(this.field_71439_g.func_70608_bn() && this.field_71441_e != null) {
  27949. this.func_147108_a(new GuiSleepMP());
  27950. }
  27951. } else if(this.field_71462_r != null && this.field_71462_r instanceof GuiSleepMP && !this.field_71439_g.func_70608_bn()) {
  27952. this.func_147108_a((GuiScreen)null);
  27953. }
  27954.  
  27955. if(this.field_71462_r != null) {
  27956. this.field_71429_W = 10000;
  27957. }
  27958.  
  27959. if(this.field_71462_r != null) {
  27960. try {
  27961. this.field_71462_r.func_146269_k();
  27962. } catch (Throwable throwable1) {
  27963. CrashReport crashreport = CrashReport.func_85055_a(throwable1, "Updating screen events");
  27964. CrashReportCategory crashreportcategory = crashreport.func_85058_a("Affected screen");
  27965. crashreportcategory.func_189529_a("Screen name", new ICrashReportDetail<String>() {
  27966. public String call() throws Exception {
  27967. return Minecraft.this.field_71462_r.getClass().getCanonicalName();
  27968. }
  27969. });
  27970. throw new ReportedException(crashreport);
  27971. }
  27972.  
  27973. if(this.field_71462_r != null) {
  27974. try {
  27975. this.field_71462_r.func_73876_c();
  27976. } catch (Throwable throwable) {
  27977. CrashReport crashreport1 = CrashReport.func_85055_a(throwable, "Ticking screen");
  27978. CrashReportCategory crashreportcategory1 = crashreport1.func_85058_a("Affected screen");
  27979. crashreportcategory1.func_189529_a("Screen name", new ICrashReportDetail<String>() {
  27980. public String call() throws Exception {
  27981. return Minecraft.this.field_71462_r.getClass().getCanonicalName();
  27982. }
  27983. });
  27984. throw new ReportedException(crashreport1);
  27985. }
  27986. }
  27987. }
  27988.  
  27989. if(this.field_71462_r == null || this.field_71462_r.field_146291_p) {
  27990. this.field_71424_I.func_76318_c("mouse");
  27991. this.func_184124_aB();
  27992. if(this.field_71429_W > 0) {
  27993. --this.field_71429_W;
  27994. }
  27995.  
  27996. this.field_71424_I.func_76318_c("keyboard");
  27997. this.func_184118_az();
  27998. }
  27999.  
  28000. if(this.field_71441_e != null) {
  28001. if(this.field_71439_g != null) {
  28002. ++this.field_71457_ai;
  28003. if(this.field_71457_ai == 30) {
  28004. this.field_71457_ai = 0;
  28005. this.field_71441_e.func_72897_h(this.field_71439_g);
  28006. }
  28007. }
  28008.  
  28009. this.field_71424_I.func_76318_c("gameRenderer");
  28010. if(!this.field_71445_n) {
  28011. this.field_71460_t.func_78464_a();
  28012. }
  28013.  
  28014. this.field_71424_I.func_76318_c("levelRenderer");
  28015. if(!this.field_71445_n) {
  28016. this.field_71438_f.func_72734_e();
  28017. }
  28018.  
  28019. this.field_71424_I.func_76318_c("level");
  28020. if(!this.field_71445_n) {
  28021. if(this.field_71441_e.func_175658_ac() > 0) {
  28022. this.field_71441_e.func_175702_c(this.field_71441_e.func_175658_ac() - 1);
  28023. }
  28024.  
  28025. this.field_71441_e.func_72939_s();
  28026. }
  28027. } else if(this.field_71460_t.func_147702_a()) {
  28028. this.field_71460_t.func_181022_b();
  28029. }
  28030.  
  28031. if(!this.field_71445_n) {
  28032. this.field_147126_aw.func_73660_a();
  28033. this.field_147127_av.func_73660_a();
  28034. }
  28035.  
  28036. if(this.field_71441_e != null) {
  28037. if(!this.field_71445_n) {
  28038. this.field_71441_e.func_72891_a(this.field_71441_e.func_175659_aa() != EnumDifficulty.PEACEFUL, true);
  28039. this.field_193035_aW.func_193303_d();
  28040.  
  28041. try {
  28042. this.field_71441_e.func_72835_b();
  28043. } catch (Throwable throwable2) {
  28044. CrashReport crashreport2 = CrashReport.func_85055_a(throwable2, "Exception in world tick");
  28045. if(this.field_71441_e == null) {
  28046. CrashReportCategory crashreportcategory2 = crashreport2.func_85058_a("Affected level");
  28047. crashreportcategory2.func_71507_a("Problem", "Level is null!");
  28048. } else {
  28049. this.field_71441_e.func_72914_a(crashreport2);
  28050. }
  28051.  
  28052. throw new ReportedException(crashreport2);
  28053. }
  28054. }
  28055.  
  28056. this.field_71424_I.func_76318_c("animateTick");
  28057. if(!this.field_71445_n && this.field_71441_e != null) {
  28058. this.field_71441_e.func_73029_E(MathHelper.func_76128_c(this.field_71439_g.field_70165_t), MathHelper.func_76128_c(this.field_71439_g.field_70163_u), MathHelper.func_76128_c(this.field_71439_g.field_70161_v));
  28059. }
  28060.  
  28061. this.field_71424_I.func_76318_c("particles");
  28062. if(!this.field_71445_n) {
  28063. this.field_71452_i.func_78868_a();
  28064. }
  28065. } else if(this.field_71453_ak != null) {
  28066. this.field_71424_I.func_76318_c("pendingConnection");
  28067. this.field_71453_ak.func_74428_b();
  28068. }
  28069.  
  28070. this.field_71424_I.func_76319_b();
  28071. this.field_71423_H = func_71386_F();
  28072. }
  28073.  
  28074. private void func_184118_az() throws IOException {
  28075. while(Keyboard.next()) {
  28076. int int = Keyboard.getEventKey() == 0?Keyboard.getEventCharacter() + 256:Keyboard.getEventKey();
  28077. if(this.field_83002_am > 0L) {
  28078. if(func_71386_F() - this.field_83002_am >= 6000L) {
  28079. throw new ReportedException(new CrashReport("Manually triggered debug crash", new Throwable()));
  28080. }
  28081.  
  28082. if(!Keyboard.isKeyDown(46) || !Keyboard.isKeyDown(61)) {
  28083. this.field_83002_am = -1L;
  28084. }
  28085. } else if(Keyboard.isKeyDown(46) && Keyboard.isKeyDown(61)) {
  28086. this.field_184129_aV = true;
  28087. this.field_83002_am = func_71386_F();
  28088. }
  28089.  
  28090. this.func_152348_aa();
  28091. if(this.field_71462_r != null) {
  28092. this.field_71462_r.func_146282_l();
  28093. }
  28094.  
  28095. boolean boolean = Keyboard.getEventKeyState();
  28096. if(boolean) {
  28097. if(int == 62 && this.field_71460_t != null) {
  28098. this.field_71460_t.func_175071_c();
  28099. }
  28100.  
  28101. boolean boolean = false;
  28102. if(this.field_71462_r == null) {
  28103. if(int == 1) {
  28104. this.func_71385_j();
  28105. }
  28106.  
  28107. boolean = Keyboard.isKeyDown(61) && this.func_184122_c(int);
  28108. this.field_184129_aV |= boolean;
  28109. if(int == 59) {
  28110. this.field_71474_y.field_74319_N = !this.field_71474_y.field_74319_N;
  28111. }
  28112. }
  28113.  
  28114. if(boolean) {
  28115. KeyBinding.func_74510_a(int, false);
  28116. } else {
  28117. KeyBinding.func_74510_a(int, true);
  28118. KeyBinding.func_74507_a(int);
  28119. }
  28120.  
  28121. if(this.field_71474_y.field_74329_Q) {
  28122. if(int == 11) {
  28123. this.func_71383_b(0);
  28124. }
  28125.  
  28126. for(int int = 0; int < 9; ++int) {
  28127. if(int == 2 + int) {
  28128. this.func_71383_b(int + 1);
  28129. }
  28130. }
  28131. }
  28132. } else {
  28133. KeyBinding.func_74510_a(int, false);
  28134. if(int == 61) {
  28135. if(this.field_184129_aV) {
  28136. this.field_184129_aV = false;
  28137. } else {
  28138. this.field_71474_y.field_74330_P = !this.field_71474_y.field_74330_P;
  28139. this.field_71474_y.field_74329_Q = this.field_71474_y.field_74330_P && GuiScreen.func_146272_n();
  28140. this.field_71474_y.field_181657_aC = this.field_71474_y.field_74330_P && GuiScreen.func_175283_s();
  28141. }
  28142. }
  28143. }
  28144. }
  28145.  
  28146. this.func_184117_aA();
  28147. }
  28148.  
  28149. private boolean func_184122_c(int p_184122_1_) {
  28150. if(p_184122_1_ == 30) {
  28151. this.field_71438_f.func_72712_a();
  28152. this.func_190521_a("debug.reload_chunks.message", new Object[0]);
  28153. return true;
  28154. } else if(p_184122_1_ == 48) {
  28155. boolean boolean = !this.field_175616_W.func_178634_b();
  28156. this.field_175616_W.func_178629_b(boolean);
  28157. this.func_190521_a(boolean?"debug.show_hitboxes.on":"debug.show_hitboxes.off", new Object[0]);
  28158. return true;
  28159. } else if(p_184122_1_ == 32) {
  28160. if(this.field_71456_v != null) {
  28161. this.field_71456_v.func_146158_b().func_146231_a(false);
  28162. }
  28163.  
  28164. return true;
  28165. } else if(p_184122_1_ == 33) {
  28166. this.field_71474_y.func_74306_a(GameSettings.Options.RENDER_DISTANCE, GuiScreen.func_146272_n()?-1:1);
  28167. this.func_190521_a("debug.cycle_renderdistance.message", new Object[]{Integer.valueOf(this.field_71474_y.field_151451_c)});
  28168. return true;
  28169. } else if(p_184122_1_ == 34) {
  28170. boolean boolean = this.field_184132_p.func_190075_b();
  28171. this.func_190521_a(boolean?"debug.chunk_boundaries.on":"debug.chunk_boundaries.off", new Object[0]);
  28172. return true;
  28173. } else if(p_184122_1_ == 35) {
  28174. this.field_71474_y.field_82882_x = !this.field_71474_y.field_82882_x;
  28175. this.func_190521_a(this.field_71474_y.field_82882_x?"debug.advanced_tooltips.on":"debug.advanced_tooltips.off", new Object[0]);
  28176. this.field_71474_y.func_74303_b();
  28177. return true;
  28178. } else if(p_184122_1_ == 49) {
  28179. if(!this.field_71439_g.func_70003_b(2, "")) {
  28180. this.func_190521_a("debug.creative_spectator.error", new Object[0]);
  28181. } else if(this.field_71439_g.func_184812_l_()) {
  28182. this.field_71439_g.func_71165_d("/gamemode spectator");
  28183. } else if(this.field_71439_g.func_175149_v()) {
  28184. this.field_71439_g.func_71165_d("/gamemode creative");
  28185. }
  28186.  
  28187. return true;
  28188. } else if(p_184122_1_ == 25) {
  28189. this.field_71474_y.field_82881_y = !this.field_71474_y.field_82881_y;
  28190. this.field_71474_y.func_74303_b();
  28191. this.func_190521_a(this.field_71474_y.field_82881_y?"debug.pause_focus.on":"debug.pause_focus.off", new Object[0]);
  28192. return true;
  28193. } else if(p_184122_1_ == 16) {
  28194. this.func_190521_a("debug.help.message", new Object[0]);
  28195. GuiNewChat guinewchat = this.field_71456_v.func_146158_b();
  28196. guinewchat.func_146227_a(new TextComponentTranslation("debug.reload_chunks.help", new Object[0]));
  28197. guinewchat.func_146227_a(new TextComponentTranslation("debug.show_hitboxes.help", new Object[0]));
  28198. guinewchat.func_146227_a(new TextComponentTranslation("debug.clear_chat.help", new Object[0]));
  28199. guinewchat.func_146227_a(new TextComponentTranslation("debug.cycle_renderdistance.help", new Object[0]));
  28200. guinewchat.func_146227_a(new TextComponentTranslation("debug.chunk_boundaries.help", new Object[0]));
  28201. guinewchat.func_146227_a(new TextComponentTranslation("debug.advanced_tooltips.help", new Object[0]));
  28202. guinewchat.func_146227_a(new TextComponentTranslation("debug.creative_spectator.help", new Object[0]));
  28203. guinewchat.func_146227_a(new TextComponentTranslation("debug.pause_focus.help", new Object[0]));
  28204. guinewchat.func_146227_a(new TextComponentTranslation("debug.help.help", new Object[0]));
  28205. guinewchat.func_146227_a(new TextComponentTranslation("debug.reload_resourcepacks.help", new Object[0]));
  28206. return true;
  28207. } else if(p_184122_1_ == 20) {
  28208. this.func_190521_a("debug.reload_resourcepacks.message", new Object[0]);
  28209. this.func_110436_a();
  28210. return true;
  28211. } else {
  28212. return false;
  28213. }
  28214. }
  28215.  
  28216. private void func_184117_aA() {
  28217. for(; this.field_71474_y.field_151457_aa.func_151468_f(); this.field_71438_f.func_174979_m()) {
  28218. ++this.field_71474_y.field_74320_O;
  28219. if(this.field_71474_y.field_74320_O > 2) {
  28220. this.field_71474_y.field_74320_O = 0;
  28221. }
  28222.  
  28223. if(this.field_71474_y.field_74320_O == 0) {
  28224. this.field_71460_t.func_175066_a(this.func_175606_aa());
  28225. } else if(this.field_71474_y.field_74320_O == 1) {
  28226. this.field_71460_t.func_175066_a((Entity)null);
  28227. }
  28228. }
  28229.  
  28230. while(this.field_71474_y.field_151458_ab.func_151468_f()) {
  28231. this.field_71474_y.field_74326_T = !this.field_71474_y.field_74326_T;
  28232. }
  28233.  
  28234. for(int int = 0; int < 9; ++int) {
  28235. boolean boolean = this.field_71474_y.field_193629_ap.func_151470_d();
  28236. boolean boolean = this.field_71474_y.field_193630_aq.func_151470_d();
  28237. if(this.field_71474_y.field_151456_ac[int].func_151468_f()) {
  28238. if(this.field_71439_g.func_175149_v()) {
  28239. this.field_71456_v.func_175187_g().func_175260_a(int);
  28240. } else if(!this.field_71439_g.func_184812_l_() || this.field_71462_r != null || !boolean && !boolean) {
  28241. this.field_71439_g.field_71071_by.field_70461_c = int;
  28242. } else {
  28243. GuiContainerCreative.func_192044_a(this, int, boolean, boolean);
  28244. }
  28245. }
  28246. }
  28247.  
  28248. while(this.field_71474_y.field_151445_Q.func_151468_f()) {
  28249. if(this.field_71442_b.func_110738_j()) {
  28250. this.field_71439_g.func_175163_u();
  28251. } else {
  28252. this.field_193035_aW.func_193296_a();
  28253. this.func_147108_a(new GuiInventory(this.field_71439_g));
  28254. }
  28255. }
  28256.  
  28257. while(this.field_71474_y.field_194146_ao.func_151468_f()) {
  28258. this.func_147108_a(new GuiScreenAdvancements(this.field_71439_g.field_71174_a.func_191982_f()));
  28259. }
  28260.  
  28261. while(this.field_71474_y.field_186718_X.func_151468_f()) {
  28262. if(!this.field_71439_g.func_175149_v()) {
  28263. this.func_147114_u().func_147297_a(new CPacketPlayerDigging(CPacketPlayerDigging.Action.SWAP_HELD_ITEMS, BlockPos.field_177992_a, EnumFacing.DOWN));
  28264. }
  28265. }
  28266.  
  28267. while(this.field_71474_y.field_74316_C.func_151468_f()) {
  28268. if(!this.field_71439_g.func_175149_v()) {
  28269. this.field_71439_g.func_71040_bB(GuiScreen.func_146271_m());
  28270. }
  28271. }
  28272.  
  28273. boolean boolean = this.field_71474_y.field_74343_n != EntityPlayer.EnumChatVisibility.HIDDEN;
  28274. if(boolean) {
  28275. while(this.field_71474_y.field_74310_D.func_151468_f()) {
  28276. this.func_147108_a(new GuiChat());
  28277. }
  28278.  
  28279. if(this.field_71462_r == null && this.field_71474_y.field_74323_J.func_151468_f()) {
  28280. this.func_147108_a(new GuiChat("/"));
  28281. }
  28282. }
  28283.  
  28284. if(this.field_71439_g.func_184587_cr()) {
  28285. if(!this.field_71474_y.field_74313_G.func_151470_d()) {
  28286. this.field_71442_b.func_78766_c(this.field_71439_g);
  28287. }
  28288.  
  28289. label556:
  28290. while(true) {
  28291. if(!this.field_71474_y.field_74312_F.func_151468_f()) {
  28292. while(this.field_71474_y.field_74313_G.func_151468_f()) {
  28293. ;
  28294. }
  28295.  
  28296. while(true) {
  28297. if(this.field_71474_y.field_74322_I.func_151468_f()) {
  28298. continue;
  28299. }
  28300. break label556;
  28301. }
  28302. }
  28303. }
  28304. } else {
  28305. while(this.field_71474_y.field_74312_F.func_151468_f()) {
  28306. this.func_147116_af();
  28307. }
  28308.  
  28309. while(this.field_71474_y.field_74313_G.func_151468_f()) {
  28310. this.func_147121_ag();
  28311. }
  28312.  
  28313. while(this.field_71474_y.field_74322_I.func_151468_f()) {
  28314. this.func_147112_ai();
  28315. }
  28316. }
  28317.  
  28318. if(this.field_71474_y.field_74313_G.func_151470_d() && this.field_71467_ac == 0 && !this.field_71439_g.func_184587_cr()) {
  28319. this.func_147121_ag();
  28320. }
  28321.  
  28322. this.func_147115_a(this.field_71462_r == null && this.field_71474_y.field_74312_F.func_151470_d() && this.field_71415_G);
  28323. }
  28324.  
  28325. private void func_184124_aB() throws IOException {
  28326. while(Mouse.next()) {
  28327. int int = Mouse.getEventButton();
  28328. KeyBinding.func_74510_a(int - 100, Mouse.getEventButtonState());
  28329. if(Mouse.getEventButtonState()) {
  28330. if(this.field_71439_g.func_175149_v() && int == 2) {
  28331. this.field_71456_v.func_175187_g().func_175261_b();
  28332. } else {
  28333. KeyBinding.func_74507_a(int - 100);
  28334. }
  28335. }
  28336.  
  28337. long long = func_71386_F() - this.field_71423_H;
  28338. if(long <= 200L) {
  28339. int int = Mouse.getEventDWheel();
  28340. if(int != 0) {
  28341. if(this.field_71439_g.func_175149_v()) {
  28342. int = int < 0?-1:1;
  28343. if(this.field_71456_v.func_175187_g().func_175262_a()) {
  28344. this.field_71456_v.func_175187_g().func_175259_b(-int);
  28345. } else {
  28346. float float = MathHelper.func_76131_a(this.field_71439_g.field_71075_bZ.func_75093_a() + (float)int * 0.005F, 0.0F, 0.2F);
  28347. this.field_71439_g.field_71075_bZ.func_75092_a(float);
  28348. }
  28349. } else {
  28350. this.field_71439_g.field_71071_by.func_70453_c(int);
  28351. }
  28352. }
  28353.  
  28354. if(this.field_71462_r == null) {
  28355. if(!this.field_71415_G && Mouse.getEventButtonState()) {
  28356. this.func_71381_h();
  28357. }
  28358. } else if(this.field_71462_r != null) {
  28359. this.field_71462_r.func_146274_d();
  28360. }
  28361. }
  28362. }
  28363.  
  28364. }
  28365.  
  28366. private void func_190521_a(String p_190521_1_, Object... p_190521_2_) {
  28367. this.field_71456_v.func_146158_b().func_146227_a((new TextComponentString("")).func_150257_a((new TextComponentTranslation("debug.prefix", new Object[0])).func_150255_a((new Style()).func_150238_a(TextFormatting.YELLOW).func_150227_a(Boolean.valueOf(true)))).func_150258_a(" ").func_150257_a(new TextComponentTranslation(p_190521_1_, p_190521_2_)));
  28368. }
  28369.  
  28370. public void func_71371_a(String p_71371_1_, String p_71371_2_, @Nullable WorldSettings p_71371_3_) {
  28371. this.func_71403_a((WorldClient)null);
  28372. System.gc();
  28373. ISaveHandler isavehandler = this.field_71469_aa.func_75804_a(p_71371_1_, false);
  28374. WorldInfo worldinfo = isavehandler.func_75757_d();
  28375. if(worldinfo == null && p_71371_3_ != null) {
  28376. worldinfo = new WorldInfo(p_71371_3_, p_71371_1_);
  28377. isavehandler.func_75761_a(worldinfo);
  28378. }
  28379.  
  28380. if(p_71371_3_ == null) {
  28381. p_71371_3_ = new WorldSettings(worldinfo);
  28382. }
  28383.  
  28384. try {
  28385. YggdrasilAuthenticationService yggdrasilauthenticationservice = new YggdrasilAuthenticationService(this.field_110453_aa, UUID.randomUUID().toString());
  28386. MinecraftSessionService minecraftsessionservice = yggdrasilauthenticationservice.createMinecraftSessionService();
  28387. GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository();
  28388. PlayerProfileCache playerprofilecache = new PlayerProfileCache(gameprofilerepository, new File(this.field_71412_D, MinecraftServer.field_152367_a.getName()));
  28389. TileEntitySkull.func_184293_a(playerprofilecache);
  28390. TileEntitySkull.func_184294_a(minecraftsessionservice);
  28391. PlayerProfileCache.func_187320_a(false);
  28392. this.field_71437_Z = new IntegratedServer(this, p_71371_1_, p_71371_2_, p_71371_3_, yggdrasilauthenticationservice, minecraftsessionservice, gameprofilerepository, playerprofilecache);
  28393. this.field_71437_Z.func_71256_s();
  28394. this.field_71455_al = true;
  28395. } catch (Throwable throwable) {
  28396. CrashReport crashreport = CrashReport.func_85055_a(throwable, "Starting integrated server");
  28397. CrashReportCategory crashreportcategory = crashreport.func_85058_a("Starting integrated server");
  28398. crashreportcategory.func_71507_a("Level ID", p_71371_1_);
  28399. crashreportcategory.func_71507_a("Level Name", p_71371_2_);
  28400. throw new ReportedException(crashreport);
  28401. }
  28402.  
  28403. this.field_71461_s.func_73720_a(I18n.func_135052_a("menu.loadingLevel", new Object[0]));
  28404.  
  28405. while(!this.field_71437_Z.func_71200_ad()) {
  28406. String string = this.field_71437_Z.func_71195_b_();
  28407. if(string != null) {
  28408. this.field_71461_s.func_73719_c(I18n.func_135052_a(string, new Object[0]));
  28409. } else {
  28410. this.field_71461_s.func_73719_c("");
  28411. }
  28412.  
  28413. try {
  28414. Thread.sleep(200L);
  28415. } catch (InterruptedException var10) {
  28416. ;
  28417. }
  28418. }
  28419.  
  28420. this.func_147108_a(new GuiScreenWorking());
  28421. SocketAddress socketaddress = this.field_71437_Z.func_147137_ag().func_151270_a();
  28422. NetworkManager networkmanager = NetworkManager.func_150722_a(socketaddress);
  28423. networkmanager.func_150719_a(new NetHandlerLoginClient(networkmanager, this, (GuiScreen)null));
  28424. networkmanager.func_179290_a(new C00Handshake(335, socketaddress.toString(), 0, EnumConnectionState.LOGIN));
  28425. networkmanager.func_179290_a(new CPacketLoginStart(this.func_110432_I().func_148256_e()));
  28426. this.field_71453_ak = networkmanager;
  28427. }
  28428.  
  28429. public void func_71403_a(@Nullable WorldClient p_71403_1_) {
  28430. this.func_71353_a(p_71403_1_, "");
  28431. }
  28432.  
  28433. public void func_71353_a(@Nullable WorldClient p_71353_1_, String p_71353_2_) {
  28434. if(p_71353_1_ == null) {
  28435. NetHandlerPlayClient nethandlerplayclient = this.func_147114_u();
  28436. if(nethandlerplayclient != null) {
  28437. nethandlerplayclient.func_147296_c();
  28438. }
  28439.  
  28440. if(this.field_71437_Z != null && this.field_71437_Z.func_175578_N()) {
  28441. this.field_71437_Z.func_71263_m();
  28442. }
  28443.  
  28444. this.field_71437_Z = null;
  28445. this.field_71460_t.func_190564_k();
  28446. this.field_71442_b = null;
  28447. NarratorChatListener.field_193643_a.func_193642_b();
  28448. }
  28449.  
  28450. this.field_175622_Z = null;
  28451. this.field_71453_ak = null;
  28452. if(this.field_71461_s != null) {
  28453. this.field_71461_s.func_73721_b(p_71353_2_);
  28454. this.field_71461_s.func_73719_c("");
  28455. }
  28456.  
  28457. if(p_71353_1_ == null && this.field_71441_e != null) {
  28458. this.field_110448_aq.func_148529_f();
  28459. this.field_71456_v.func_181029_i();
  28460. this.func_71351_a((ServerData)null);
  28461. this.field_71455_al = false;
  28462. }
  28463.  
  28464. this.field_147127_av.func_147690_c();
  28465. this.field_71441_e = p_71353_1_;
  28466. if(this.field_71438_f != null) {
  28467. this.field_71438_f.func_72732_a(p_71353_1_);
  28468. }
  28469.  
  28470. if(this.field_71452_i != null) {
  28471. this.field_71452_i.func_78870_a(p_71353_1_);
  28472. }
  28473.  
  28474. TileEntityRendererDispatcher.field_147556_a.func_147543_a(p_71353_1_);
  28475. if(p_71353_1_ != null) {
  28476. if(!this.field_71455_al) {
  28477. AuthenticationService authenticationservice = new YggdrasilAuthenticationService(this.field_110453_aa, UUID.randomUUID().toString());
  28478. MinecraftSessionService minecraftsessionservice = authenticationservice.createMinecraftSessionService();
  28479. GameProfileRepository gameprofilerepository = authenticationservice.createProfileRepository();
  28480. PlayerProfileCache playerprofilecache = new PlayerProfileCache(gameprofilerepository, new File(this.field_71412_D, MinecraftServer.field_152367_a.getName()));
  28481. TileEntitySkull.func_184293_a(playerprofilecache);
  28482. TileEntitySkull.func_184294_a(minecraftsessionservice);
  28483. PlayerProfileCache.func_187320_a(false);
  28484. }
  28485.  
  28486. if(this.field_71439_g == null) {
  28487. this.field_71439_g = this.field_71442_b.func_192830_a(p_71353_1_, new StatisticsManager(), new RecipeBookClient());
  28488. this.field_71442_b.func_78745_b(this.field_71439_g);
  28489. }
  28490.  
  28491. this.field_71439_g.func_70065_x();
  28492. p_71353_1_.func_72838_d(this.field_71439_g);
  28493. this.field_71439_g.field_71158_b = new MovementInputFromOptions(this.field_71474_y);
  28494. this.field_71442_b.func_78748_a(this.field_71439_g);
  28495. this.field_175622_Z = this.field_71439_g;
  28496. } else {
  28497. this.field_71469_aa.func_75800_d();
  28498. this.field_71439_g = null;
  28499. }
  28500.  
  28501. System.gc();
  28502. this.field_71423_H = 0L;
  28503. }
  28504.  
  28505. public void func_71354_a(int p_71354_1_) {
  28506. this.field_71441_e.func_72974_f();
  28507. this.field_71441_e.func_73022_a();
  28508. int int = 0;
  28509. String string = null;
  28510. if(this.field_71439_g != null) {
  28511. int = this.field_71439_g.func_145782_y();
  28512. this.field_71441_e.func_72900_e(this.field_71439_g);
  28513. string = this.field_71439_g.func_142021_k();
  28514. }
  28515.  
  28516. this.field_175622_Z = null;
  28517. EntityPlayerSP entityplayersp = this.field_71439_g;
  28518. this.field_71439_g = this.field_71442_b.func_192830_a(this.field_71441_e, this.field_71439_g == null?new StatisticsManager():this.field_71439_g.func_146107_m(), this.field_71439_g == null?new RecipeBook():this.field_71439_g.func_192035_E());
  28519. this.field_71439_g.func_184212_Q().func_187218_a(entityplayersp.func_184212_Q().func_187231_c());
  28520. this.field_71439_g.field_71093_bK = p_71354_1_;
  28521. this.field_175622_Z = this.field_71439_g;
  28522. this.field_71439_g.func_70065_x();
  28523. this.field_71439_g.func_175158_f(string);
  28524. this.field_71441_e.func_72838_d(this.field_71439_g);
  28525. this.field_71442_b.func_78745_b(this.field_71439_g);
  28526. this.field_71439_g.field_71158_b = new MovementInputFromOptions(this.field_71474_y);
  28527. this.field_71439_g.func_145769_d(int);
  28528. this.field_71442_b.func_78748_a(this.field_71439_g);
  28529. this.field_71439_g.func_175150_k(entityplayersp.func_175140_cp());
  28530. if(this.field_71462_r instanceof GuiGameOver) {
  28531. this.func_147108_a((GuiScreen)null);
  28532. }
  28533.  
  28534. }
  28535.  
  28536. public final boolean func_71355_q() {
  28537. return this.field_71459_aj;
  28538. }
  28539.  
  28540. @Nullable
  28541. public NetHandlerPlayClient func_147114_u() {
  28542. return this.field_71439_g == null?null:this.field_71439_g.field_71174_a;
  28543. }
  28544.  
  28545. public static boolean func_71382_s() {
  28546. return field_71432_P == null || !field_71432_P.field_71474_y.field_74319_N;
  28547. }
  28548.  
  28549. public static boolean func_71375_t() {
  28550. return field_71432_P != null && field_71432_P.field_71474_y.field_74347_j;
  28551. }
  28552.  
  28553. public static boolean func_71379_u() {
  28554. return field_71432_P != null && field_71432_P.field_71474_y.field_74348_k != 0;
  28555. }
  28556.  
  28557. private void func_147112_ai() {
  28558. if(this.field_71476_x != null && this.field_71476_x.field_72313_a != RayTraceResult.Type.MISS) {
  28559. boolean boolean = this.field_71439_g.field_71075_bZ.field_75098_d;
  28560. TileEntity tileentity = null;
  28561. ItemStack itemstack;
  28562. if(this.field_71476_x.field_72313_a == RayTraceResult.Type.BLOCK) {
  28563. BlockPos blockpos = this.field_71476_x.func_178782_a();
  28564. IBlockState iblockstate = this.field_71441_e.func_180495_p(blockpos);
  28565. Block block = iblockstate.func_177230_c();
  28566. if(iblockstate.func_185904_a() == Material.field_151579_a) {
  28567. return;
  28568. }
  28569.  
  28570. itemstack = block.func_185473_a(this.field_71441_e, blockpos, iblockstate);
  28571. if(itemstack.func_190926_b()) {
  28572. return;
  28573. }
  28574.  
  28575. if(boolean && GuiScreen.func_146271_m() && block.func_149716_u()) {
  28576. tileentity = this.field_71441_e.func_175625_s(blockpos);
  28577. }
  28578. } else {
  28579. if(this.field_71476_x.field_72313_a != RayTraceResult.Type.ENTITY || this.field_71476_x.field_72308_g == null || !boolean) {
  28580. return;
  28581. }
  28582.  
  28583. if(this.field_71476_x.field_72308_g instanceof EntityPainting) {
  28584. itemstack = new ItemStack(Items.field_151159_an);
  28585. } else if(this.field_71476_x.field_72308_g instanceof EntityLeashKnot) {
  28586. itemstack = new ItemStack(Items.field_151058_ca);
  28587. } else if(this.field_71476_x.field_72308_g instanceof EntityItemFrame) {
  28588. EntityItemFrame entityitemframe = (EntityItemFrame)this.field_71476_x.field_72308_g;
  28589. ItemStack itemstack1 = entityitemframe.func_82335_i();
  28590. if(itemstack1.func_190926_b()) {
  28591. itemstack = new ItemStack(Items.field_151160_bD);
  28592. } else {
  28593. itemstack = itemstack1.func_77946_l();
  28594. }
  28595. } else if(this.field_71476_x.field_72308_g instanceof EntityMinecart) {
  28596. EntityMinecart entityminecart = (EntityMinecart)this.field_71476_x.field_72308_g;
  28597. Item item;
  28598. switch(entityminecart.func_184264_v()) {
  28599. case FURNACE:
  28600. item = Items.field_151109_aJ;
  28601. break;
  28602. case CHEST:
  28603. item = Items.field_151108_aI;
  28604. break;
  28605. case TNT:
  28606. item = Items.field_151142_bV;
  28607. break;
  28608. case HOPPER:
  28609. item = Items.field_151140_bW;
  28610. break;
  28611. case COMMAND_BLOCK:
  28612. item = Items.field_151095_cc;
  28613. break;
  28614. default:
  28615. item = Items.field_151143_au;
  28616. }
  28617.  
  28618. itemstack = new ItemStack(item);
  28619. } else if(this.field_71476_x.field_72308_g instanceof EntityBoat) {
  28620. itemstack = new ItemStack(((EntityBoat)this.field_71476_x.field_72308_g).func_184455_j());
  28621. } else if(this.field_71476_x.field_72308_g instanceof EntityArmorStand) {
  28622. itemstack = new ItemStack(Items.field_179565_cj);
  28623. } else if(this.field_71476_x.field_72308_g instanceof EntityEnderCrystal) {
  28624. itemstack = new ItemStack(Items.field_185158_cP);
  28625. } else {
  28626. ResourceLocation resourcelocation = EntityList.func_191301_a(this.field_71476_x.field_72308_g);
  28627. if(resourcelocation == null || !EntityList.field_75627_a.containsKey(resourcelocation)) {
  28628. return;
  28629. }
  28630.  
  28631. itemstack = new ItemStack(Items.field_151063_bx);
  28632. ItemMonsterPlacer.func_185078_a(itemstack, resourcelocation);
  28633. }
  28634. }
  28635.  
  28636. if(itemstack.func_190926_b()) {
  28637. String string = "";
  28638. if(this.field_71476_x.field_72313_a == RayTraceResult.Type.BLOCK) {
  28639. string = ((ResourceLocation)Block.field_149771_c.func_177774_c(this.field_71441_e.func_180495_p(this.field_71476_x.func_178782_a()).func_177230_c())).toString();
  28640. } else if(this.field_71476_x.field_72313_a == RayTraceResult.Type.ENTITY) {
  28641. string = EntityList.func_191301_a(this.field_71476_x.field_72308_g).toString();
  28642. }
  28643.  
  28644. field_147123_G.warn((String)"Picking on: [{}] {} gave null item", (Object)this.field_71476_x.field_72313_a, (Object)string);
  28645. } else {
  28646. InventoryPlayer inventoryplayer = this.field_71439_g.field_71071_by;
  28647. if(tileentity != null) {
  28648. this.func_184119_a(itemstack, tileentity);
  28649. }
  28650.  
  28651. int int = inventoryplayer.func_184429_b(itemstack);
  28652. if(boolean) {
  28653. inventoryplayer.func_184434_a(itemstack);
  28654. this.field_71442_b.func_78761_a(this.field_71439_g.func_184586_b(EnumHand.MAIN_HAND), 36 + inventoryplayer.field_70461_c);
  28655. } else if(int != -1) {
  28656. if(InventoryPlayer.func_184435_e(int)) {
  28657. inventoryplayer.field_70461_c = int;
  28658. } else {
  28659. this.field_71442_b.func_187100_a(int);
  28660. }
  28661. }
  28662.  
  28663. }
  28664. }
  28665. }
  28666.  
  28667. public ItemStack func_184119_a(ItemStack p_184119_1_, TileEntity p_184119_2_) {
  28668. NBTTagCompound nbttagcompound = p_184119_2_.func_189515_b(new NBTTagCompound());
  28669. if(p_184119_1_.func_77973_b() == Items.field_151144_bL && nbttagcompound.func_74764_b("Owner")) {
  28670. NBTTagCompound nbttagcompound2 = nbttagcompound.func_74775_l("Owner");
  28671. NBTTagCompound nbttagcompound3 = new NBTTagCompound();
  28672. nbttagcompound3.func_74782_a("SkullOwner", nbttagcompound2);
  28673. p_184119_1_.func_77982_d(nbttagcompound3);
  28674. return p_184119_1_;
  28675. } else {
  28676. p_184119_1_.func_77983_a("BlockEntityTag", nbttagcompound);
  28677. NBTTagCompound nbttagcompound1 = new NBTTagCompound();
  28678. NBTTagList nbttaglist = new NBTTagList();
  28679. nbttaglist.func_74742_a(new NBTTagString("(+NBT)"));
  28680. nbttagcompound1.func_74782_a("Lore", nbttaglist);
  28681. p_184119_1_.func_77983_a("display", nbttagcompound1);
  28682. return p_184119_1_;
  28683. }
  28684. }
  28685.  
  28686. public CrashReport func_71396_d(CrashReport p_71396_1_) {
  28687. p_71396_1_.func_85056_g().func_189529_a("Launched Version", new ICrashReportDetail<String>() {
  28688. public String call() throws Exception {
  28689. return Minecraft.this.field_110447_Z;
  28690. }
  28691. });
  28692. p_71396_1_.func_85056_g().func_189529_a("LWJGL", new ICrashReportDetail<String>() {
  28693. public String call() throws Exception {
  28694. return Sys.getVersion();
  28695. }
  28696. });
  28697. p_71396_1_.func_85056_g().func_189529_a("OpenGL", new ICrashReportDetail<String>() {
  28698. public String call() {
  28699. return GlStateManager.func_187416_u(7937) + " GL version " + GlStateManager.func_187416_u(7938) + ", " + GlStateManager.func_187416_u(7936);
  28700. }
  28701. });
  28702. p_71396_1_.func_85056_g().func_189529_a("GL Caps", new ICrashReportDetail<String>() {
  28703. public String call() {
  28704. return OpenGlHelper.func_153172_c();
  28705. }
  28706. });
  28707. p_71396_1_.func_85056_g().func_189529_a("Using VBOs", new ICrashReportDetail<String>() {
  28708. public String call() {
  28709. return Minecraft.this.field_71474_y.field_178881_t?"Yes":"No";
  28710. }
  28711. });
  28712. p_71396_1_.func_85056_g().func_189529_a("Is Modded", new ICrashReportDetail<String>() {
  28713. public String call() throws Exception {
  28714. String string = ClientBrandRetriever.getClientModName();
  28715. return !"vanilla".equals(string)?"Definitely; Client brand changed to \'" + string + "\'":(Minecraft.class.getSigners() == null?"Very likely; Jar signature invalidated":"Probably not. Jar signature remains and client brand is untouched.");
  28716. }
  28717. });
  28718. p_71396_1_.func_85056_g().func_189529_a("Type", new ICrashReportDetail<String>() {
  28719. public String call() throws Exception {
  28720. return "Client (map_client.txt)";
  28721. }
  28722. });
  28723. p_71396_1_.func_85056_g().func_189529_a("Resource Packs", new ICrashReportDetail<String>() {
  28724. public String call() throws Exception {
  28725. StringBuilder stringbuilder = new StringBuilder();
  28726.  
  28727. for(String string : Minecraft.this.field_71474_y.field_151453_l) {
  28728. if(stringbuilder.length() > 0) {
  28729. stringbuilder.append(", ");
  28730. }
  28731.  
  28732. stringbuilder.append(string);
  28733. if(Minecraft.this.field_71474_y.field_183018_l.contains(string)) {
  28734. stringbuilder.append(" (incompatible)");
  28735. }
  28736. }
  28737.  
  28738. return stringbuilder.toString();
  28739. }
  28740. });
  28741. p_71396_1_.func_85056_g().func_189529_a("Current Language", new ICrashReportDetail<String>() {
  28742. public String call() throws Exception {
  28743. return Minecraft.this.field_135017_as.func_135041_c().toString();
  28744. }
  28745. });
  28746. p_71396_1_.func_85056_g().func_189529_a("Profiler Position", new ICrashReportDetail<String>() {
  28747. public String call() throws Exception {
  28748. return Minecraft.this.field_71424_I.field_76327_a?Minecraft.this.field_71424_I.func_76322_c():"N/A (disabled)";
  28749. }
  28750. });
  28751. p_71396_1_.func_85056_g().func_189529_a("CPU", new ICrashReportDetail<String>() {
  28752. public String call() throws Exception {
  28753. return OpenGlHelper.func_183029_j();
  28754. }
  28755. });
  28756. if(this.field_71441_e != null) {
  28757. this.field_71441_e.func_72914_a(p_71396_1_);
  28758. }
  28759.  
  28760. return p_71396_1_;
  28761. }
  28762.  
  28763. public static Minecraft func_71410_x() {
  28764. return field_71432_P;
  28765. }
  28766.  
  28767. public ListenableFuture<Object> func_175603_A() {
  28768. return this.func_152344_a(new Runnable() {
  28769. public void run() {
  28770. Minecraft.this.func_110436_a();
  28771. }
  28772. });
  28773. }
  28774.  
  28775. public void func_70000_a(Snooper p_70000_1_) {
  28776. p_70000_1_.func_152768_a("fps", Integer.valueOf(field_71470_ab));
  28777. p_70000_1_.func_152768_a("vsync_enabled", Boolean.valueOf(this.field_71474_y.field_74352_v));
  28778. p_70000_1_.func_152768_a("display_frequency", Integer.valueOf(Display.getDisplayMode().getFrequency()));
  28779. p_70000_1_.func_152768_a("display_type", this.field_71431_Q?"fullscreen":"windowed");
  28780. p_70000_1_.func_152768_a("run_time", Long.valueOf((MinecraftServer.func_130071_aq() - p_70000_1_.func_130105_g()) / 60L * 1000L));
  28781. p_70000_1_.func_152768_a("current_action", this.func_181538_aA());
  28782. p_70000_1_.func_152768_a("language", this.field_71474_y.field_74363_ab == null?"en_us":this.field_71474_y.field_74363_ab);
  28783. String string = ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN?"little":"big";
  28784. p_70000_1_.func_152768_a("endianness", string);
  28785. p_70000_1_.func_152768_a("subtitles", Boolean.valueOf(this.field_71474_y.field_186717_N));
  28786. p_70000_1_.func_152768_a("touch", this.field_71474_y.field_85185_A?"touch":"mouse");
  28787. p_70000_1_.func_152768_a("resource_packs", Integer.valueOf(this.field_110448_aq.func_110613_c().size()));
  28788. int int = 0;
  28789.  
  28790. for(ResourcePackRepository.Entry resourcepackrepository$entry : this.field_110448_aq.func_110613_c()) {
  28791. p_70000_1_.func_152768_a("resource_pack[" + int++ + "]", resourcepackrepository$entry.func_110515_d());
  28792. }
  28793.  
  28794. if(this.field_71437_Z != null && this.field_71437_Z.func_80003_ah() != null) {
  28795. p_70000_1_.func_152768_a("snooper_partner", this.field_71437_Z.func_80003_ah().func_80006_f());
  28796. }
  28797.  
  28798. }
  28799.  
  28800. private String func_181538_aA() {
  28801. return this.field_71437_Z != null?(this.field_71437_Z.func_71344_c()?"hosting_lan":"singleplayer"):(this.field_71422_O != null?(this.field_71422_O.func_181041_d()?"playing_lan":"multiplayer"):"out_of_game");
  28802. }
  28803.  
  28804. public void func_70001_b(Snooper p_70001_1_) {
  28805. p_70001_1_.func_152767_b("opengl_version", GlStateManager.func_187416_u(7938));
  28806. p_70001_1_.func_152767_b("opengl_vendor", GlStateManager.func_187416_u(7936));
  28807. p_70001_1_.func_152767_b("client_brand", ClientBrandRetriever.getClientModName());
  28808. p_70001_1_.func_152767_b("launched_version", this.field_110447_Z);
  28809. ContextCapabilities contextcapabilities = GLContext.getCapabilities();
  28810. p_70001_1_.func_152767_b("gl_caps[ARB_arrays_of_arrays]", Boolean.valueOf(contextcapabilities.GL_ARB_arrays_of_arrays));
  28811. p_70001_1_.func_152767_b("gl_caps[ARB_base_instance]", Boolean.valueOf(contextcapabilities.GL_ARB_base_instance));
  28812. p_70001_1_.func_152767_b("gl_caps[ARB_blend_func_extended]", Boolean.valueOf(contextcapabilities.GL_ARB_blend_func_extended));
  28813. p_70001_1_.func_152767_b("gl_caps[ARB_clear_buffer_object]", Boolean.valueOf(contextcapabilities.GL_ARB_clear_buffer_object));
  28814. p_70001_1_.func_152767_b("gl_caps[ARB_color_buffer_float]", Boolean.valueOf(contextcapabilities.GL_ARB_color_buffer_float));
  28815. p_70001_1_.func_152767_b("gl_caps[ARB_compatibility]", Boolean.valueOf(contextcapabilities.GL_ARB_compatibility));
  28816. p_70001_1_.func_152767_b("gl_caps[ARB_compressed_texture_pixel_storage]", Boolean.valueOf(contextcapabilities.GL_ARB_compressed_texture_pixel_storage));
  28817. p_70001_1_.func_152767_b("gl_caps[ARB_compute_shader]", Boolean.valueOf(contextcapabilities.GL_ARB_compute_shader));
  28818. p_70001_1_.func_152767_b("gl_caps[ARB_copy_buffer]", Boolean.valueOf(contextcapabilities.GL_ARB_copy_buffer));
  28819. p_70001_1_.func_152767_b("gl_caps[ARB_copy_image]", Boolean.valueOf(contextcapabilities.GL_ARB_copy_image));
  28820. p_70001_1_.func_152767_b("gl_caps[ARB_depth_buffer_float]", Boolean.valueOf(contextcapabilities.GL_ARB_depth_buffer_float));
  28821. p_70001_1_.func_152767_b("gl_caps[ARB_compute_shader]", Boolean.valueOf(contextcapabilities.GL_ARB_compute_shader));
  28822. p_70001_1_.func_152767_b("gl_caps[ARB_copy_buffer]", Boolean.valueOf(contextcapabilities.GL_ARB_copy_buffer));
  28823. p_70001_1_.func_152767_b("gl_caps[ARB_copy_image]", Boolean.valueOf(contextcapabilities.GL_ARB_copy_image));
  28824. p_70001_1_.func_152767_b("gl_caps[ARB_depth_buffer_float]", Boolean.valueOf(contextcapabilities.GL_ARB_depth_buffer_float));
  28825. p_70001_1_.func_152767_b("gl_caps[ARB_depth_clamp]", Boolean.valueOf(contextcapabilities.GL_ARB_depth_clamp));
  28826. p_70001_1_.func_152767_b("gl_caps[ARB_depth_texture]", Boolean.valueOf(contextcapabilities.GL_ARB_depth_texture));
  28827. p_70001_1_.func_152767_b("gl_caps[ARB_draw_buffers]", Boolean.valueOf(contextcapabilities.GL_ARB_draw_buffers));
  28828. p_70001_1_.func_152767_b("gl_caps[ARB_draw_buffers_blend]", Boolean.valueOf(contextcapabilities.GL_ARB_draw_buffers_blend));
  28829. p_70001_1_.func_152767_b("gl_caps[ARB_draw_elements_base_vertex]", Boolean.valueOf(contextcapabilities.GL_ARB_draw_elements_base_vertex));
  28830. p_70001_1_.func_152767_b("gl_caps[ARB_draw_indirect]", Boolean.valueOf(contextcapabilities.GL_ARB_draw_indirect));
  28831. p_70001_1_.func_152767_b("gl_caps[ARB_draw_instanced]", Boolean.valueOf(contextcapabilities.GL_ARB_draw_instanced));
  28832. p_70001_1_.func_152767_b("gl_caps[ARB_explicit_attrib_location]", Boolean.valueOf(contextcapabilities.GL_ARB_explicit_attrib_location));
  28833. p_70001_1_.func_152767_b("gl_caps[ARB_explicit_uniform_location]", Boolean.valueOf(contextcapabilities.GL_ARB_explicit_uniform_location));
  28834. p_70001_1_.func_152767_b("gl_caps[ARB_fragment_layer_viewport]", Boolean.valueOf(contextcapabilities.GL_ARB_fragment_layer_viewport));
  28835. p_70001_1_.func_152767_b("gl_caps[ARB_fragment_program]", Boolean.valueOf(contextcapabilities.GL_ARB_fragment_program));
  28836. p_70001_1_.func_152767_b("gl_caps[ARB_fragment_shader]", Boolean.valueOf(contextcapabilities.GL_ARB_fragment_shader));
  28837. p_70001_1_.func_152767_b("gl_caps[ARB_fragment_program_shadow]", Boolean.valueOf(contextcapabilities.GL_ARB_fragment_program_shadow));
  28838. p_70001_1_.func_152767_b("gl_caps[ARB_framebuffer_object]", Boolean.valueOf(contextcapabilities.GL_ARB_framebuffer_object));
  28839. p_70001_1_.func_152767_b("gl_caps[ARB_framebuffer_sRGB]", Boolean.valueOf(contextcapabilities.GL_ARB_framebuffer_sRGB));
  28840. p_70001_1_.func_152767_b("gl_caps[ARB_geometry_shader4]", Boolean.valueOf(contextcapabilities.GL_ARB_geometry_shader4));
  28841. p_70001_1_.func_152767_b("gl_caps[ARB_gpu_shader5]", Boolean.valueOf(contextcapabilities.GL_ARB_gpu_shader5));
  28842. p_70001_1_.func_152767_b("gl_caps[ARB_half_float_pixel]", Boolean.valueOf(contextcapabilities.GL_ARB_half_float_pixel));
  28843. p_70001_1_.func_152767_b("gl_caps[ARB_half_float_vertex]", Boolean.valueOf(contextcapabilities.GL_ARB_half_float_vertex));
  28844. p_70001_1_.func_152767_b("gl_caps[ARB_instanced_arrays]", Boolean.valueOf(contextcapabilities.GL_ARB_instanced_arrays));
  28845. p_70001_1_.func_152767_b("gl_caps[ARB_map_buffer_alignment]", Boolean.valueOf(contextcapabilities.GL_ARB_map_buffer_alignment));
  28846. p_70001_1_.func_152767_b("gl_caps[ARB_map_buffer_range]", Boolean.valueOf(contextcapabilities.GL_ARB_map_buffer_range));
  28847. p_70001_1_.func_152767_b("gl_caps[ARB_multisample]", Boolean.valueOf(contextcapabilities.GL_ARB_multisample));
  28848. p_70001_1_.func_152767_b("gl_caps[ARB_multitexture]", Boolean.valueOf(contextcapabilities.GL_ARB_multitexture));
  28849. p_70001_1_.func_152767_b("gl_caps[ARB_occlusion_query2]", Boolean.valueOf(contextcapabilities.GL_ARB_occlusion_query2));
  28850. p_70001_1_.func_152767_b("gl_caps[ARB_pixel_buffer_object]", Boolean.valueOf(contextcapabilities.GL_ARB_pixel_buffer_object));
  28851. p_70001_1_.func_152767_b("gl_caps[ARB_seamless_cube_map]", Boolean.valueOf(contextcapabilities.GL_ARB_seamless_cube_map));
  28852. p_70001_1_.func_152767_b("gl_caps[ARB_shader_objects]", Boolean.valueOf(contextcapabilities.GL_ARB_shader_objects));
  28853. p_70001_1_.func_152767_b("gl_caps[ARB_shader_stencil_export]", Boolean.valueOf(contextcapabilities.GL_ARB_shader_stencil_export));
  28854. p_70001_1_.func_152767_b("gl_caps[ARB_shader_texture_lod]", Boolean.valueOf(contextcapabilities.GL_ARB_shader_texture_lod));
  28855. p_70001_1_.func_152767_b("gl_caps[ARB_shadow]", Boolean.valueOf(contextcapabilities.GL_ARB_shadow));
  28856. p_70001_1_.func_152767_b("gl_caps[ARB_shadow_ambient]", Boolean.valueOf(contextcapabilities.GL_ARB_shadow_ambient));
  28857. p_70001_1_.func_152767_b("gl_caps[ARB_stencil_texturing]", Boolean.valueOf(contextcapabilities.GL_ARB_stencil_texturing));
  28858. p_70001_1_.func_152767_b("gl_caps[ARB_sync]", Boolean.valueOf(contextcapabilities.GL_ARB_sync));
  28859. p_70001_1_.func_152767_b("gl_caps[ARB_tessellation_shader]", Boolean.valueOf(contextcapabilities.GL_ARB_tessellation_shader));
  28860. p_70001_1_.func_152767_b("gl_caps[ARB_texture_border_clamp]", Boolean.valueOf(contextcapabilities.GL_ARB_texture_border_clamp));
  28861. p_70001_1_.func_152767_b("gl_caps[ARB_texture_buffer_object]", Boolean.valueOf(contextcapabilities.GL_ARB_texture_buffer_object));
  28862. p_70001_1_.func_152767_b("gl_caps[ARB_texture_cube_map]", Boolean.valueOf(contextcapabilities.GL_ARB_texture_cube_map));
  28863. p_70001_1_.func_152767_b("gl_caps[ARB_texture_cube_map_array]", Boolean.valueOf(contextcapabilities.GL_ARB_texture_cube_map_array));
  28864. p_70001_1_.func_152767_b("gl_caps[ARB_texture_non_power_of_two]", Boolean.valueOf(contextcapabilities.GL_ARB_texture_non_power_of_two));
  28865. p_70001_1_.func_152767_b("gl_caps[ARB_uniform_buffer_object]", Boolean.valueOf(contextcapabilities.GL_ARB_uniform_buffer_object));
  28866. p_70001_1_.func_152767_b("gl_caps[ARB_vertex_blend]", Boolean.valueOf(contextcapabilities.GL_ARB_vertex_blend));
  28867. p_70001_1_.func_152767_b("gl_caps[ARB_vertex_buffer_object]", Boolean.valueOf(contextcapabilities.GL_ARB_vertex_buffer_object));
  28868. p_70001_1_.func_152767_b("gl_caps[ARB_vertex_program]", Boolean.valueOf(contextcapabilities.GL_ARB_vertex_program));
  28869. p_70001_1_.func_152767_b("gl_caps[ARB_vertex_shader]", Boolean.valueOf(contextcapabilities.GL_ARB_vertex_shader));
  28870. p_70001_1_.func_152767_b("gl_caps[EXT_bindable_uniform]", Boolean.valueOf(contextcapabilities.GL_EXT_bindable_uniform));
  28871. p_70001_1_.func_152767_b("gl_caps[EXT_blend_equation_separate]", Boolean.valueOf(contextcapabilities.GL_EXT_blend_equation_separate));
  28872. p_70001_1_.func_152767_b("gl_caps[EXT_blend_func_separate]", Boolean.valueOf(contextcapabilities.GL_EXT_blend_func_separate));
  28873. p_70001_1_.func_152767_b("gl_caps[EXT_blend_minmax]", Boolean.valueOf(contextcapabilities.GL_EXT_blend_minmax));
  28874. p_70001_1_.func_152767_b("gl_caps[EXT_blend_subtract]", Boolean.valueOf(contextcapabilities.GL_EXT_blend_subtract));
  28875. p_70001_1_.func_152767_b("gl_caps[EXT_draw_instanced]", Boolean.valueOf(contextcapabilities.GL_EXT_draw_instanced));
  28876. p_70001_1_.func_152767_b("gl_caps[EXT_framebuffer_multisample]", Boolean.valueOf(contextcapabilities.GL_EXT_framebuffer_multisample));
  28877. p_70001_1_.func_152767_b("gl_caps[EXT_framebuffer_object]", Boolean.valueOf(contextcapabilities.GL_EXT_framebuffer_object));
  28878. p_70001_1_.func_152767_b("gl_caps[EXT_framebuffer_sRGB]", Boolean.valueOf(contextcapabilities.GL_EXT_framebuffer_sRGB));
  28879. p_70001_1_.func_152767_b("gl_caps[EXT_geometry_shader4]", Boolean.valueOf(contextcapabilities.GL_EXT_geometry_shader4));
  28880. p_70001_1_.func_152767_b("gl_caps[EXT_gpu_program_parameters]", Boolean.valueOf(contextcapabilities.GL_EXT_gpu_program_parameters));
  28881. p_70001_1_.func_152767_b("gl_caps[EXT_gpu_shader4]", Boolean.valueOf(contextcapabilities.GL_EXT_gpu_shader4));
  28882. p_70001_1_.func_152767_b("gl_caps[EXT_multi_draw_arrays]", Boolean.valueOf(contextcapabilities.GL_EXT_multi_draw_arrays));
  28883. p_70001_1_.func_152767_b("gl_caps[EXT_packed_depth_stencil]", Boolean.valueOf(contextcapabilities.GL_EXT_packed_depth_stencil));
  28884. p_70001_1_.func_152767_b("gl_caps[EXT_paletted_texture]", Boolean.valueOf(contextcapabilities.GL_EXT_paletted_texture));
  28885. p_70001_1_.func_152767_b("gl_caps[EXT_rescale_normal]", Boolean.valueOf(contextcapabilities.GL_EXT_rescale_normal));
  28886. p_70001_1_.func_152767_b("gl_caps[EXT_separate_shader_objects]", Boolean.valueOf(contextcapabilities.GL_EXT_separate_shader_objects));
  28887. p_70001_1_.func_152767_b("gl_caps[EXT_shader_image_load_store]", Boolean.valueOf(contextcapabilities.GL_EXT_shader_image_load_store));
  28888. p_70001_1_.func_152767_b("gl_caps[EXT_shadow_funcs]", Boolean.valueOf(contextcapabilities.GL_EXT_shadow_funcs));
  28889. p_70001_1_.func_152767_b("gl_caps[EXT_shared_texture_palette]", Boolean.valueOf(contextcapabilities.GL_EXT_shared_texture_palette));
  28890. p_70001_1_.func_152767_b("gl_caps[EXT_stencil_clear_tag]", Boolean.valueOf(contextcapabilities.GL_EXT_stencil_clear_tag));
  28891. p_70001_1_.func_152767_b("gl_caps[EXT_stencil_two_side]", Boolean.valueOf(contextcapabilities.GL_EXT_stencil_two_side));
  28892. p_70001_1_.func_152767_b("gl_caps[EXT_stencil_wrap]", Boolean.valueOf(contextcapabilities.GL_EXT_stencil_wrap));
  28893. p_70001_1_.func_152767_b("gl_caps[EXT_texture_3d]", Boolean.valueOf(contextcapabilities.GL_EXT_texture_3d));
  28894. p_70001_1_.func_152767_b("gl_caps[EXT_texture_array]", Boolean.valueOf(contextcapabilities.GL_EXT_texture_array));
  28895. p_70001_1_.func_152767_b("gl_caps[EXT_texture_buffer_object]", Boolean.valueOf(contextcapabilities.GL_EXT_texture_buffer_object));
  28896. p_70001_1_.func_152767_b("gl_caps[EXT_texture_integer]", Boolean.valueOf(contextcapabilities.GL_EXT_texture_integer));
  28897. p_70001_1_.func_152767_b("gl_caps[EXT_texture_lod_bias]", Boolean.valueOf(contextcapabilities.GL_EXT_texture_lod_bias));
  28898. p_70001_1_.func_152767_b("gl_caps[EXT_texture_sRGB]", Boolean.valueOf(contextcapabilities.GL_EXT_texture_sRGB));
  28899. p_70001_1_.func_152767_b("gl_caps[EXT_vertex_shader]", Boolean.valueOf(contextcapabilities.GL_EXT_vertex_shader));
  28900. p_70001_1_.func_152767_b("gl_caps[EXT_vertex_weighting]", Boolean.valueOf(contextcapabilities.GL_EXT_vertex_weighting));
  28901. p_70001_1_.func_152767_b("gl_caps[gl_max_vertex_uniforms]", Integer.valueOf(GlStateManager.func_187397_v('\u8b4a')));
  28902. GlStateManager.func_187434_L();
  28903. p_70001_1_.func_152767_b("gl_caps[gl_max_fragment_uniforms]", Integer.valueOf(GlStateManager.func_187397_v('\u8b49')));
  28904. GlStateManager.func_187434_L();
  28905. p_70001_1_.func_152767_b("gl_caps[gl_max_vertex_attribs]", Integer.valueOf(GlStateManager.func_187397_v('\u8869')));
  28906. GlStateManager.func_187434_L();
  28907. p_70001_1_.func_152767_b("gl_caps[gl_max_vertex_texture_image_units]", Integer.valueOf(GlStateManager.func_187397_v('\u8b4c')));
  28908. GlStateManager.func_187434_L();
  28909. p_70001_1_.func_152767_b("gl_caps[gl_max_texture_image_units]", Integer.valueOf(GlStateManager.func_187397_v('\u8872')));
  28910. GlStateManager.func_187434_L();
  28911. p_70001_1_.func_152767_b("gl_caps[gl_max_array_texture_layers]", Integer.valueOf(GlStateManager.func_187397_v('\u88ff')));
  28912. GlStateManager.func_187434_L();
  28913. p_70001_1_.func_152767_b("gl_max_texture_size", Integer.valueOf(func_71369_N()));
  28914. GameProfile gameprofile = this.field_71449_j.func_148256_e();
  28915. if(gameprofile != null && gameprofile.getId() != null) {
  28916. p_70001_1_.func_152767_b("uuid", Hashing.sha1().hashBytes(gameprofile.getId().toString().getBytes(Charsets.ISO_8859_1)).toString());
  28917. }
  28918.  
  28919. }
  28920.  
  28921. public static int func_71369_N() {
  28922. for(int int = 16384; int > 0; int >>= 1) {
  28923. GlStateManager.func_187419_a('\u8064', 0, 6408, int, int, 0, 6408, 5121, (IntBuffer)null);
  28924. int int = GlStateManager.func_187411_c('\u8064', 0, 4096);
  28925. if(int != 0) {
  28926. return int;
  28927. }
  28928. }
  28929.  
  28930. return -1;
  28931. }
  28932.  
  28933. public boolean func_70002_Q() {
  28934. return this.field_71474_y.field_74355_t;
  28935. }
  28936.  
  28937. public void func_71351_a(ServerData p_71351_1_) {
  28938. this.field_71422_O = p_71351_1_;
  28939. }
  28940.  
  28941. @Nullable
  28942. public ServerData func_147104_D() {
  28943. return this.field_71422_O;
  28944. }
  28945.  
  28946. public boolean func_71387_A() {
  28947. return this.field_71455_al;
  28948. }
  28949.  
  28950. public boolean func_71356_B() {
  28951. return this.field_71455_al && this.field_71437_Z != null;
  28952. }
  28953.  
  28954. @Nullable
  28955. public IntegratedServer func_71401_C() {
  28956. return this.field_71437_Z;
  28957. }
  28958.  
  28959. public static void func_71363_D() {
  28960. if(field_71432_P != null) {
  28961. IntegratedServer integratedserver = field_71432_P.func_71401_C();
  28962. if(integratedserver != null) {
  28963. integratedserver.func_71260_j();
  28964. }
  28965.  
  28966. }
  28967. }
  28968.  
  28969. public Snooper func_71378_E() {
  28970. return this.field_71427_U;
  28971. }
  28972.  
  28973. public static long func_71386_F() {
  28974. return Sys.getTime() * 1000L / Sys.getTimerResolution();
  28975. }
  28976.  
  28977. public boolean func_71372_G() {
  28978. return this.field_71431_Q;
  28979. }
  28980.  
  28981. public Session func_110432_I() {
  28982. return this.field_71449_j;
  28983. }
  28984.  
  28985. public PropertyMap func_181037_M() {
  28986. if(this.field_181038_N.isEmpty()) {
  28987. GameProfile gameprofile = this.func_152347_ac().fillProfileProperties(this.field_71449_j.func_148256_e(), false);
  28988. this.field_181038_N.putAll(gameprofile.getProperties());
  28989. }
  28990.  
  28991. return this.field_181038_N;
  28992. }
  28993.  
  28994. public Proxy func_110437_J() {
  28995. return this.field_110453_aa;
  28996. }
  28997.  
  28998. public TextureManager func_110434_K() {
  28999. return this.field_71446_o;
  29000. }
  29001.  
  29002. public IResourceManager func_110442_L() {
  29003. return this.field_110451_am;
  29004. }
  29005.  
  29006. public ResourcePackRepository func_110438_M() {
  29007. return this.field_110448_aq;
  29008. }
  29009.  
  29010. public LanguageManager func_135016_M() {
  29011. return this.field_135017_as;
  29012. }
  29013.  
  29014. public TextureMap func_147117_R() {
  29015. return this.field_147128_au;
  29016. }
  29017.  
  29018. public boolean func_147111_S() {
  29019. return this.field_147129_ai;
  29020. }
  29021.  
  29022. public boolean func_147113_T() {
  29023. return this.field_71445_n;
  29024. }
  29025.  
  29026. public SoundHandler func_147118_V() {
  29027. return this.field_147127_av;
  29028. }
  29029.  
  29030. public MusicTicker.MusicType func_147109_W() {
  29031. return this.field_71462_r instanceof GuiWinGame?MusicTicker.MusicType.CREDITS:(this.field_71439_g != null?(this.field_71439_g.field_70170_p.field_73011_w instanceof WorldProviderHell?MusicTicker.MusicType.NETHER:(this.field_71439_g.field_70170_p.field_73011_w instanceof WorldProviderEnd?(this.field_71456_v.func_184046_j().func_184054_d()?MusicTicker.MusicType.END_BOSS:MusicTicker.MusicType.END):(this.field_71439_g.field_71075_bZ.field_75098_d && this.field_71439_g.field_71075_bZ.field_75101_c?MusicTicker.MusicType.CREATIVE:MusicTicker.MusicType.GAME))):MusicTicker.MusicType.MENU);
  29032. }
  29033.  
  29034. public void func_152348_aa() {
  29035. int int = Keyboard.getEventKey() == 0?Keyboard.getEventCharacter() + 256:Keyboard.getEventKey();
  29036. if(int != 0 && !Keyboard.isRepeatEvent()) {
  29037. if(!(this.field_71462_r instanceof GuiControls) || ((GuiControls)this.field_71462_r).field_152177_g <= func_71386_F() - 20L) {
  29038. if(Keyboard.getEventKeyState()) {
  29039. if(int == this.field_71474_y.field_152395_am.func_151463_i()) {
  29040. this.func_71352_k();
  29041. } else if(int == this.field_71474_y.field_151447_Z.func_151463_i()) {
  29042. this.field_71456_v.func_146158_b().func_146227_a(ScreenShotHelper.func_148260_a(this.field_71412_D, this.field_71443_c, this.field_71440_d, this.field_147124_at));
  29043. } else if(int == 48 && GuiScreen.func_146271_m() && (this.field_71462_r == null || this.field_71462_r != null && !this.field_71462_r.func_193976_p())) {
  29044. this.field_71474_y.func_74306_a(GameSettings.Options.NARRATOR, 1);
  29045. if(this.field_71462_r instanceof ScreenChatOptions) {
  29046. ((ScreenChatOptions)this.field_71462_r).func_193024_a();
  29047. }
  29048. }
  29049. }
  29050.  
  29051. }
  29052. }
  29053. }
  29054.  
  29055. public MinecraftSessionService func_152347_ac() {
  29056. return this.field_152355_az;
  29057. }
  29058.  
  29059. public SkinManager func_152342_ad() {
  29060. return this.field_152350_aA;
  29061. }
  29062.  
  29063. @Nullable
  29064. public Entity func_175606_aa() {
  29065. return this.field_175622_Z;
  29066. }
  29067.  
  29068. public void func_175607_a(Entity p_175607_1_) {
  29069. this.field_175622_Z = p_175607_1_;
  29070. this.field_71460_t.func_175066_a(p_175607_1_);
  29071. }
  29072.  
  29073. public <V> ListenableFuture<V> func_152343_a(Callable<V> p_152343_1_) {
  29074. Validate.notNull(p_152343_1_);
  29075. if(this.func_152345_ab()) {
  29076. try {
  29077. return Futures.<V>immediateFuture(p_152343_1_.call());
  29078. } catch (Exception exception) {
  29079. return Futures.immediateFailedCheckedFuture(exception);
  29080. }
  29081. } else {
  29082. ListenableFutureTask<V> listenablefuturetask = ListenableFutureTask.<V>create(p_152343_1_);
  29083. synchronized(this.field_152351_aB) {
  29084. this.field_152351_aB.add(listenablefuturetask);
  29085. return listenablefuturetask;
  29086. }
  29087. }
  29088. }
  29089.  
  29090. public ListenableFuture<Object> func_152344_a(Runnable p_152344_1_) {
  29091. Validate.notNull(p_152344_1_);
  29092. return this.<Object>func_152343_a(Executors.callable(p_152344_1_));
  29093. }
  29094.  
  29095. public boolean func_152345_ab() {
  29096. return Thread.currentThread() == this.field_152352_aC;
  29097. }
  29098.  
  29099. public BlockRendererDispatcher func_175602_ab() {
  29100. return this.field_175618_aM;
  29101. }
  29102.  
  29103. public RenderManager func_175598_ae() {
  29104. return this.field_175616_W;
  29105. }
  29106.  
  29107. public RenderItem func_175599_af() {
  29108. return this.field_175621_X;
  29109. }
  29110.  
  29111. public ItemRenderer func_175597_ag() {
  29112. return this.field_175620_Y;
  29113. }
  29114.  
  29115. public <T> ISearchTree<T> func_193987_a(SearchTreeManager.Key<T> p_193987_1_) {
  29116. return this.field_193995_ae.<T>func_194010_a(p_193987_1_);
  29117. }
  29118.  
  29119. public static int func_175610_ah() {
  29120. return field_71470_ab;
  29121. }
  29122.  
  29123. public FrameTimer func_181539_aj() {
  29124. return this.field_181542_y;
  29125. }
  29126.  
  29127. public boolean func_181540_al() {
  29128. return this.field_181541_X;
  29129. }
  29130.  
  29131. public void func_181537_a(boolean p_181537_1_) {
  29132. this.field_181541_X = p_181537_1_;
  29133. }
  29134.  
  29135. public DataFixer func_184126_aj() {
  29136. return this.field_184131_U;
  29137. }
  29138.  
  29139. public float func_184121_ak() {
  29140. return this.field_71428_T.field_194147_b;
  29141. }
  29142.  
  29143. public float func_193989_ak() {
  29144. return this.field_71428_T.field_194148_c;
  29145. }
  29146.  
  29147. public BlockColors func_184125_al() {
  29148. return this.field_184127_aH;
  29149. }
  29150.  
  29151. public boolean func_189648_am() {
  29152. return this.field_71439_g != null && this.field_71439_g.func_175140_cp() || this.field_71474_y.field_178879_v;
  29153. }
  29154.  
  29155. public GuiToast func_193033_an() {
  29156. return this.field_193034_aS;
  29157. }
  29158.  
  29159. public Tutorial func_193032_ao() {
  29160. return this.field_193035_aW;
  29161. }
  29162. }
  29163.  
  29164. Hunk 3 failed! Cannot find hunk target
  29165. }
  29166. }
  29167.  
  29168. + @SuppressWarnings("incomplete-switch")
  29169. private void func_147121_ag() {
  29170. if (!this.field_71442_b.func_181040_m()) {
  29171. this.field_71467_ac = 4;
  29172. File state
  29173. package net.minecraft.client;
  29174.  
  29175. import com.google.common.collect.Lists;
  29176. import com.google.common.collect.Queues;
  29177. import com.google.common.collect.Sets;
  29178. import com.google.common.hash.Hashing;
  29179. import com.google.common.util.concurrent.Futures;
  29180. import com.google.common.util.concurrent.ListenableFuture;
  29181. import com.google.common.util.concurrent.ListenableFutureTask;
  29182. import com.mojang.authlib.AuthenticationService;
  29183. import com.mojang.authlib.GameProfile;
  29184. import com.mojang.authlib.GameProfileRepository;
  29185. import com.mojang.authlib.minecraft.MinecraftSessionService;
  29186. import com.mojang.authlib.properties.PropertyMap;
  29187. import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService;
  29188. import java.awt.image.BufferedImage;
  29189. import java.io.File;
  29190. import java.io.IOException;
  29191. import java.io.InputStream;
  29192. import java.net.Proxy;
  29193. import java.net.SocketAddress;
  29194. import java.nio.ByteBuffer;
  29195. import java.nio.ByteOrder;
  29196. import java.nio.IntBuffer;
  29197. import java.text.DecimalFormat;
  29198. import java.text.SimpleDateFormat;
  29199. import java.util.Collections;
  29200. import java.util.Date;
  29201. import java.util.Iterator;
  29202. import java.util.List;
  29203. import java.util.Locale;
  29204. import java.util.Queue;
  29205. import java.util.Set;
  29206. import java.util.UUID;
  29207. import java.util.concurrent.Callable;
  29208. import java.util.concurrent.Executors;
  29209. import java.util.concurrent.FutureTask;
  29210. import java.util.function.Consumer;
  29211. import java.util.function.Function;
  29212. import java.util.function.Predicate;
  29213. import java.util.stream.Collectors;
  29214. import javax.annotation.Nullable;
  29215. import javax.imageio.ImageIO;
  29216. import net.minecraft.block.Block;
  29217. import net.minecraft.block.material.Material;
  29218. import net.minecraft.block.state.IBlockState;
  29219. import net.minecraft.client.ClientBrandRetriever;
  29220. import net.minecraft.client.LoadingScreenRenderer;
  29221. import net.minecraft.client.audio.MusicTicker;
  29222. import net.minecraft.client.audio.SoundHandler;
  29223. import net.minecraft.client.entity.EntityPlayerSP;
  29224. import net.minecraft.client.gui.FontRenderer;
  29225. import net.minecraft.client.gui.GuiChat;
  29226. import net.minecraft.client.gui.GuiControls;
  29227. import net.minecraft.client.gui.GuiGameOver;
  29228. import net.minecraft.client.gui.GuiIngame;
  29229. import net.minecraft.client.gui.GuiIngameMenu;
  29230. import net.minecraft.client.gui.GuiMainMenu;
  29231. import net.minecraft.client.gui.GuiMemoryErrorScreen;
  29232. import net.minecraft.client.gui.GuiMultiplayer;
  29233. import net.minecraft.client.gui.GuiNewChat;
  29234. import net.minecraft.client.gui.GuiScreen;
  29235. import net.minecraft.client.gui.GuiScreenWorking;
  29236. import net.minecraft.client.gui.GuiSleepMP;
  29237. import net.minecraft.client.gui.GuiWinGame;
  29238. import net.minecraft.client.gui.ScaledResolution;
  29239. import net.minecraft.client.gui.ScreenChatOptions;
  29240. import net.minecraft.client.gui.advancements.GuiScreenAdvancements;
  29241. import net.minecraft.client.gui.chat.NarratorChatListener;
  29242. import net.minecraft.client.gui.inventory.GuiContainerCreative;
  29243. import net.minecraft.client.gui.inventory.GuiInventory;
  29244. import net.minecraft.client.gui.recipebook.RecipeList;
  29245. import net.minecraft.client.gui.toasts.GuiToast;
  29246. import net.minecraft.client.main.GameConfiguration;
  29247. import net.minecraft.client.multiplayer.GuiConnecting;
  29248. import net.minecraft.client.multiplayer.PlayerControllerMP;
  29249. import net.minecraft.client.multiplayer.ServerData;
  29250. import net.minecraft.client.multiplayer.WorldClient;
  29251. import net.minecraft.client.network.NetHandlerLoginClient;
  29252. import net.minecraft.client.network.NetHandlerPlayClient;
  29253. import net.minecraft.client.particle.ParticleManager;
  29254. import net.minecraft.client.renderer.BlockRendererDispatcher;
  29255. import net.minecraft.client.renderer.BufferBuilder;
  29256. import net.minecraft.client.renderer.EntityRenderer;
  29257. import net.minecraft.client.renderer.GlStateManager;
  29258. import net.minecraft.client.renderer.ItemRenderer;
  29259. import net.minecraft.client.renderer.OpenGlHelper;
  29260. import net.minecraft.client.renderer.RenderGlobal;
  29261. import net.minecraft.client.renderer.RenderItem;
  29262. import net.minecraft.client.renderer.Tessellator;
  29263. import net.minecraft.client.renderer.block.model.ModelManager;
  29264. import net.minecraft.client.renderer.chunk.RenderChunk;
  29265. import net.minecraft.client.renderer.color.BlockColors;
  29266. import net.minecraft.client.renderer.color.ItemColors;
  29267. import net.minecraft.client.renderer.debug.DebugRenderer;
  29268. import net.minecraft.client.renderer.entity.RenderManager;
  29269. import net.minecraft.client.renderer.texture.DynamicTexture;
  29270. import net.minecraft.client.renderer.texture.TextureManager;
  29271. import net.minecraft.client.renderer.texture.TextureMap;
  29272. import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
  29273. import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
  29274. import net.minecraft.client.resources.DefaultResourcePack;
  29275. import net.minecraft.client.resources.FoliageColorReloadListener;
  29276. import net.minecraft.client.resources.GrassColorReloadListener;
  29277. import net.minecraft.client.resources.I18n;
  29278. import net.minecraft.client.resources.IReloadableResourceManager;
  29279. import net.minecraft.client.resources.IResourceManager;
  29280. import net.minecraft.client.resources.IResourcePack;
  29281. import net.minecraft.client.resources.LanguageManager;
  29282. import net.minecraft.client.resources.ResourcePackRepository;
  29283. import net.minecraft.client.resources.SimpleReloadableResourceManager;
  29284. import net.minecraft.client.resources.SkinManager;
  29285. import net.minecraft.client.resources.data.AnimationMetadataSection;
  29286. import net.minecraft.client.resources.data.AnimationMetadataSectionSerializer;
  29287. import net.minecraft.client.resources.data.FontMetadataSection;
  29288. import net.minecraft.client.resources.data.FontMetadataSectionSerializer;
  29289. import net.minecraft.client.resources.data.LanguageMetadataSection;
  29290. import net.minecraft.client.resources.data.LanguageMetadataSectionSerializer;
  29291. import net.minecraft.client.resources.data.MetadataSerializer;
  29292. import net.minecraft.client.resources.data.PackMetadataSection;
  29293. import net.minecraft.client.resources.data.PackMetadataSectionSerializer;
  29294. import net.minecraft.client.resources.data.TextureMetadataSection;
  29295. import net.minecraft.client.resources.data.TextureMetadataSectionSerializer;
  29296. import net.minecraft.client.settings.CreativeSettings;
  29297. import net.minecraft.client.settings.GameSettings;
  29298. import net.minecraft.client.settings.KeyBinding;
  29299. import net.minecraft.client.shader.Framebuffer;
  29300. import net.minecraft.client.tutorial.Tutorial;
  29301. import net.minecraft.client.util.ISearchTree;
  29302. import net.minecraft.client.util.ITooltipFlag;
  29303. import net.minecraft.client.util.RecipeBookClient;
  29304. import net.minecraft.client.util.SearchTree;
  29305. import net.minecraft.client.util.SearchTreeManager;
  29306. import net.minecraft.crash.CrashReport;
  29307. import net.minecraft.crash.CrashReportCategory;
  29308. import net.minecraft.crash.ICrashReportDetail;
  29309. import net.minecraft.creativetab.CreativeTabs;
  29310. import net.minecraft.entity.Entity;
  29311. import net.minecraft.entity.EntityLeashKnot;
  29312. import net.minecraft.entity.EntityList;
  29313. import net.minecraft.entity.item.EntityArmorStand;
  29314. import net.minecraft.entity.item.EntityBoat;
  29315. import net.minecraft.entity.item.EntityEnderCrystal;
  29316. import net.minecraft.entity.item.EntityItemFrame;
  29317. import net.minecraft.entity.item.EntityMinecart;
  29318. import net.minecraft.entity.item.EntityPainting;
  29319. import net.minecraft.entity.player.EntityPlayer;
  29320. import net.minecraft.entity.player.InventoryPlayer;
  29321. import net.minecraft.init.Bootstrap;
  29322. import net.minecraft.init.Items;
  29323. import net.minecraft.item.Item;
  29324. import net.minecraft.item.ItemMonsterPlacer;
  29325. import net.minecraft.item.ItemStack;
  29326. import net.minecraft.nbt.NBTTagCompound;
  29327. import net.minecraft.nbt.NBTTagList;
  29328. import net.minecraft.nbt.NBTTagString;
  29329. import net.minecraft.network.EnumConnectionState;
  29330. import net.minecraft.network.NetworkManager;
  29331. import net.minecraft.network.handshake.client.C00Handshake;
  29332. import net.minecraft.network.login.client.CPacketLoginStart;
  29333. import net.minecraft.network.play.client.CPacketPlayerDigging;
  29334. import net.minecraft.profiler.ISnooperInfo;
  29335. import net.minecraft.profiler.Profiler;
  29336. import net.minecraft.profiler.Snooper;
  29337. import net.minecraft.server.MinecraftServer;
  29338. import net.minecraft.server.integrated.IntegratedServer;
  29339. import net.minecraft.server.management.PlayerProfileCache;
  29340. import net.minecraft.stats.RecipeBook;
  29341. import net.minecraft.stats.StatisticsManager;
  29342. import net.minecraft.tileentity.TileEntity;
  29343. import net.minecraft.tileentity.TileEntitySkull;
  29344. import net.minecraft.util.EnumActionResult;
  29345. import net.minecraft.util.EnumFacing;
  29346. import net.minecraft.util.EnumHand;
  29347. import net.minecraft.util.FrameTimer;
  29348. import net.minecraft.util.IThreadListener;
  29349. import net.minecraft.util.MinecraftError;
  29350. import net.minecraft.util.MouseHelper;
  29351. import net.minecraft.util.MovementInputFromOptions;
  29352. import net.minecraft.util.NonNullList;
  29353. import net.minecraft.util.ReportedException;
  29354. import net.minecraft.util.ResourceLocation;
  29355. import net.minecraft.util.ScreenShotHelper;
  29356. import net.minecraft.util.Session;
  29357. import net.minecraft.util.Timer;
  29358. import net.minecraft.util.Util;
  29359. import net.minecraft.util.datafix.DataFixer;
  29360. import net.minecraft.util.datafix.DataFixesManager;
  29361. import net.minecraft.util.math.BlockPos;
  29362. import net.minecraft.util.math.MathHelper;
  29363. import net.minecraft.util.math.RayTraceResult;
  29364. import net.minecraft.util.text.ITextComponent;
  29365. import net.minecraft.util.text.Style;
  29366. import net.minecraft.util.text.TextComponentKeybind;
  29367. import net.minecraft.util.text.TextComponentString;
  29368. import net.minecraft.util.text.TextComponentTranslation;
  29369. import net.minecraft.util.text.TextFormatting;
  29370. import net.minecraft.world.EnumDifficulty;
  29371. import net.minecraft.world.WorldProviderEnd;
  29372. import net.minecraft.world.WorldProviderHell;
  29373. import net.minecraft.world.WorldSettings;
  29374. import net.minecraft.world.chunk.storage.AnvilSaveConverter;
  29375. import net.minecraft.world.storage.ISaveFormat;
  29376. import net.minecraft.world.storage.ISaveHandler;
  29377. import net.minecraft.world.storage.WorldInfo;
  29378. import net.minecraftforge.fml.relauncher.Side;
  29379. import net.minecraftforge.fml.relauncher.SideOnly;
  29380. import org.apache.commons.io.Charsets;
  29381. import org.apache.commons.io.IOUtils;
  29382. import org.apache.commons.lang3.Validate;
  29383. import org.apache.logging.log4j.LogManager;
  29384. import org.apache.logging.log4j.Logger;
  29385. import org.lwjgl.LWJGLException;
  29386. import org.lwjgl.Sys;
  29387. import org.lwjgl.input.Keyboard;
  29388. import org.lwjgl.input.Mouse;
  29389. import org.lwjgl.opengl.ContextCapabilities;
  29390. import org.lwjgl.opengl.Display;
  29391. import org.lwjgl.opengl.DisplayMode;
  29392. import org.lwjgl.opengl.GLContext;
  29393. import org.lwjgl.opengl.OpenGLException;
  29394. import org.lwjgl.opengl.PixelFormat;
  29395. import org.lwjgl.util.glu.GLU;
  29396.  
  29397. @SideOnly(Side.CLIENT)
  29398. public class Minecraft implements IThreadListener, ISnooperInfo {
  29399. private static final Logger field_147123_G = LogManager.getLogger();
  29400. private static final ResourceLocation field_110444_H = new ResourceLocation("textures/gui/title/mojang.png");
  29401. public static final boolean field_142025_a = Util.func_110647_a() == Util.EnumOS.OSX;
  29402. public static byte[] field_71444_a = new byte[10485760];
  29403. private static final List<DisplayMode> field_110445_I = Lists.newArrayList(new DisplayMode[]{new DisplayMode(2560, 1600), new DisplayMode(2880, 1800)});
  29404. private final File field_130070_K;
  29405. private final PropertyMap field_152356_J;
  29406. private final PropertyMap field_181038_N;
  29407. private ServerData field_71422_O;
  29408. public TextureManager field_71446_o;
  29409. private static Minecraft field_71432_P;
  29410. private final DataFixer field_184131_U;
  29411. public PlayerControllerMP field_71442_b;
  29412. private boolean field_71431_Q;
  29413. private final boolean field_175619_R = true;
  29414. private boolean field_71434_R;
  29415. private CrashReport field_71433_S;
  29416. public int field_71443_c;
  29417. public int field_71440_d;
  29418. private boolean field_181541_X;
  29419. private final Timer field_71428_T = new Timer(20.0F);
  29420. private final Snooper field_71427_U = new Snooper("client", this, MinecraftServer.func_130071_aq());
  29421. public WorldClient field_71441_e;
  29422. public RenderGlobal field_71438_f;
  29423. private RenderManager field_175616_W;
  29424. private RenderItem field_175621_X;
  29425. private ItemRenderer field_175620_Y;
  29426. public EntityPlayerSP field_71439_g;
  29427. @Nullable
  29428. private Entity field_175622_Z;
  29429. public Entity field_147125_j;
  29430. public ParticleManager field_71452_i;
  29431. private SearchTreeManager field_193995_ae = new SearchTreeManager();
  29432. private final Session field_71449_j;
  29433. private boolean field_71445_n;
  29434. private float field_193996_ah;
  29435. public FontRenderer field_71466_p;
  29436. public FontRenderer field_71464_q;
  29437. @Nullable
  29438. public GuiScreen field_71462_r;
  29439. public LoadingScreenRenderer field_71461_s;
  29440. public EntityRenderer field_71460_t;
  29441. public DebugRenderer field_184132_p;
  29442. private int field_71429_W;
  29443. private final int field_71436_X;
  29444. private final int field_71435_Y;
  29445. @Nullable
  29446. private IntegratedServer field_71437_Z;
  29447. public GuiIngame field_71456_v;
  29448. public boolean field_71454_w;
  29449. public RayTraceResult field_71476_x;
  29450. public GameSettings field_71474_y;
  29451. public CreativeSettings field_191950_u;
  29452. public MouseHelper field_71417_B;
  29453. public final File field_71412_D;
  29454. private final File field_110446_Y;
  29455. private final String field_110447_Z;
  29456. private final String field_184130_ao;
  29457. private final Proxy field_110453_aa;
  29458. private ISaveFormat field_71469_aa;
  29459. private static int field_71470_ab;
  29460. private int field_71467_ac;
  29461. private String field_71475_ae;
  29462. private int field_71477_af;
  29463. public boolean field_71415_G;
  29464. long field_71423_H = func_71386_F();
  29465. private int field_71457_ai;
  29466. public final FrameTimer field_181542_y = new FrameTimer();
  29467. long field_181543_z = System.nanoTime();
  29468. private final boolean field_147129_ai;
  29469. private final boolean field_71459_aj;
  29470. @Nullable
  29471. private NetworkManager field_71453_ak;
  29472. private boolean field_71455_al;
  29473. public final Profiler field_71424_I = new Profiler();
  29474. private long field_83002_am = -1L;
  29475. private IReloadableResourceManager field_110451_am;
  29476. private final MetadataSerializer field_110452_an = new MetadataSerializer();
  29477. private final List<IResourcePack> field_110449_ao = Lists.<IResourcePack>newArrayList();
  29478. public final DefaultResourcePack field_110450_ap;
  29479. private ResourcePackRepository field_110448_aq;
  29480. private LanguageManager field_135017_as;
  29481. private BlockColors field_184127_aH;
  29482. private ItemColors field_184128_aI;
  29483. private Framebuffer field_147124_at;
  29484. private TextureMap field_147128_au;
  29485. private SoundHandler field_147127_av;
  29486. private MusicTicker field_147126_aw;
  29487. private ResourceLocation field_152354_ay;
  29488. private final MinecraftSessionService field_152355_az;
  29489. private SkinManager field_152350_aA;
  29490. private final Queue<FutureTask<?>> field_152351_aB = Queues.<FutureTask<?>>newArrayDeque();
  29491. private final Thread field_152352_aC = Thread.currentThread();
  29492. private ModelManager field_175617_aL;
  29493. private BlockRendererDispatcher field_175618_aM;
  29494. private final GuiToast field_193034_aS;
  29495. volatile boolean field_71425_J = true;
  29496. public String field_71426_K = "";
  29497. public boolean field_175612_E = true;
  29498. private long field_71419_L = func_71386_F();
  29499. private int field_71420_M;
  29500. private boolean field_184129_aV;
  29501. private final Tutorial field_193035_aW;
  29502. long field_71421_N = -1L;
  29503. private String field_71465_an = "root";
  29504.  
  29505. public Minecraft(GameConfiguration p_i45547_1_) {
  29506. field_71432_P = this;
  29507. this.field_71412_D = p_i45547_1_.field_178744_c.field_178760_a;
  29508. this.field_110446_Y = p_i45547_1_.field_178744_c.field_178759_c;
  29509. this.field_130070_K = p_i45547_1_.field_178744_c.field_178758_b;
  29510. this.field_110447_Z = p_i45547_1_.field_178741_d.field_178755_b;
  29511. this.field_184130_ao = p_i45547_1_.field_178741_d.field_187053_c;
  29512. this.field_152356_J = p_i45547_1_.field_178745_a.field_178750_b;
  29513. this.field_181038_N = p_i45547_1_.field_178745_a.field_181172_c;
  29514. this.field_110450_ap = new DefaultResourcePack(p_i45547_1_.field_178744_c.func_187052_a());
  29515. this.field_110453_aa = p_i45547_1_.field_178745_a.field_178751_c == null?Proxy.NO_PROXY:p_i45547_1_.field_178745_a.field_178751_c;
  29516. this.field_152355_az = (new YggdrasilAuthenticationService(this.field_110453_aa, UUID.randomUUID().toString())).createMinecraftSessionService();
  29517. this.field_71449_j = p_i45547_1_.field_178745_a.field_178752_a;
  29518. field_147123_G.info((String)"Setting user: {}", (Object)this.field_71449_j.func_111285_a());
  29519. field_147123_G.debug((String)"(Session ID is {})", (Object)this.field_71449_j.func_111286_b());
  29520. this.field_71459_aj = p_i45547_1_.field_178741_d.field_178756_a;
  29521. this.field_71443_c = p_i45547_1_.field_178743_b.field_178764_a > 0?p_i45547_1_.field_178743_b.field_178764_a:1;
  29522. this.field_71440_d = p_i45547_1_.field_178743_b.field_178762_b > 0?p_i45547_1_.field_178743_b.field_178762_b:1;
  29523. this.field_71436_X = p_i45547_1_.field_178743_b.field_178764_a;
  29524. this.field_71435_Y = p_i45547_1_.field_178743_b.field_178762_b;
  29525. this.field_71431_Q = p_i45547_1_.field_178743_b.field_178763_c;
  29526. this.field_147129_ai = func_147122_X();
  29527. this.field_71437_Z = null;
  29528. if(p_i45547_1_.field_178742_e.field_178754_a != null) {
  29529. this.field_71475_ae = p_i45547_1_.field_178742_e.field_178754_a;
  29530. this.field_71477_af = p_i45547_1_.field_178742_e.field_178753_b;
  29531. }
  29532.  
  29533. ImageIO.setUseCache(false);
  29534. Locale.setDefault(Locale.ROOT);
  29535. Bootstrap.func_151354_b();
  29536. TextComponentKeybind.field_193637_b = KeyBinding::func_193626_b;
  29537. this.field_184131_U = DataFixesManager.func_188279_a();
  29538. this.field_193034_aS = new GuiToast(this);
  29539. this.field_193035_aW = new Tutorial(this);
  29540. }
  29541.  
  29542. public void func_99999_d() {
  29543. this.field_71425_J = true;
  29544.  
  29545. try {
  29546. this.func_71384_a();
  29547. } catch (Throwable throwable) {
  29548. CrashReport crashreport = CrashReport.func_85055_a(throwable, "Initializing game");
  29549. crashreport.func_85058_a("Initialization");
  29550. this.func_71377_b(this.func_71396_d(crashreport));
  29551. return;
  29552. }
  29553.  
  29554. while(true) {
  29555. try {
  29556. if(!this.field_71425_J) {
  29557. break;
  29558. }
  29559.  
  29560. if(!this.field_71434_R || this.field_71433_S == null) {
  29561. try {
  29562. this.func_71411_J();
  29563. } catch (OutOfMemoryError var10) {
  29564. this.func_71398_f();
  29565. this.func_147108_a(new GuiMemoryErrorScreen());
  29566. System.gc();
  29567. }
  29568. continue;
  29569. }
  29570.  
  29571. this.func_71377_b(this.field_71433_S);
  29572. } catch (MinecraftError var12) {
  29573. break;
  29574. } catch (ReportedException reportedexception) {
  29575. this.func_71396_d(reportedexception.func_71575_a());
  29576. this.func_71398_f();
  29577. field_147123_G.fatal((String)"Reported exception thrown!", (Throwable)reportedexception);
  29578. this.func_71377_b(reportedexception.func_71575_a());
  29579. break;
  29580. } catch (Throwable throwable1) {
  29581. CrashReport crashreport1 = this.func_71396_d(new CrashReport("Unexpected error", throwable1));
  29582. this.func_71398_f();
  29583. field_147123_G.fatal("Unreported exception thrown!", throwable1);
  29584. this.func_71377_b(crashreport1);
  29585. break;
  29586. } finally {
  29587. this.func_71405_e();
  29588. }
  29589.  
  29590. return;
  29591. }
  29592.  
  29593. }
  29594.  
  29595. private void func_71384_a() throws LWJGLException, IOException {
  29596. this.field_71474_y = new GameSettings(this, this.field_71412_D);
  29597. this.field_191950_u = new CreativeSettings(this, this.field_71412_D);
  29598. this.field_110449_ao.add(this.field_110450_ap);
  29599. this.func_71389_H();
  29600. if(this.field_71474_y.field_92119_C > 0 && this.field_71474_y.field_92118_B > 0) {
  29601. this.field_71443_c = this.field_71474_y.field_92118_B;
  29602. this.field_71440_d = this.field_71474_y.field_92119_C;
  29603. }
  29604.  
  29605. field_147123_G.info((String)"LWJGL Version: {}", (Object)Sys.getVersion());
  29606. this.func_175594_ao();
  29607. this.func_175605_an();
  29608. this.func_175609_am();
  29609. OpenGlHelper.func_77474_a();
  29610. this.field_147124_at = new Framebuffer(this.field_71443_c, this.field_71440_d, true);
  29611. this.field_147124_at.func_147604_a(0.0F, 0.0F, 0.0F, 0.0F);
  29612. this.func_175608_ak();
  29613. this.field_110448_aq = new ResourcePackRepository(this.field_130070_K, new File(this.field_71412_D, "server-resource-packs"), this.field_110450_ap, this.field_110452_an, this.field_71474_y);
  29614. this.field_110451_am = new SimpleReloadableResourceManager(this.field_110452_an);
  29615. this.field_135017_as = new LanguageManager(this.field_110452_an, this.field_71474_y.field_74363_ab);
  29616. this.field_110451_am.func_110542_a(this.field_135017_as);
  29617. this.func_110436_a();
  29618. this.field_71446_o = new TextureManager(this.field_110451_am);
  29619. this.field_110451_am.func_110542_a(this.field_71446_o);
  29620. this.func_180510_a(this.field_71446_o);
  29621. this.field_152350_aA = new SkinManager(this.field_71446_o, new File(this.field_110446_Y, "skins"), this.field_152355_az);
  29622. this.field_71469_aa = new AnvilSaveConverter(new File(this.field_71412_D, "saves"), this.field_184131_U);
  29623. this.field_147127_av = new SoundHandler(this.field_110451_am, this.field_71474_y);
  29624. this.field_110451_am.func_110542_a(this.field_147127_av);
  29625. this.field_147126_aw = new MusicTicker(this);
  29626. this.field_71466_p = new FontRenderer(this.field_71474_y, new ResourceLocation("textures/font/ascii.png"), this.field_71446_o, false);
  29627. if(this.field_71474_y.field_74363_ab != null) {
  29628. this.field_71466_p.func_78264_a(this.func_152349_b());
  29629. this.field_71466_p.func_78275_b(this.field_135017_as.func_135044_b());
  29630. }
  29631.  
  29632. this.field_71464_q = new FontRenderer(this.field_71474_y, new ResourceLocation("textures/font/ascii_sga.png"), this.field_71446_o, false);
  29633. this.field_110451_am.func_110542_a(this.field_71466_p);
  29634. this.field_110451_am.func_110542_a(this.field_71464_q);
  29635. this.field_110451_am.func_110542_a(new GrassColorReloadListener());
  29636. this.field_110451_am.func_110542_a(new FoliageColorReloadListener());
  29637. this.field_71417_B = new MouseHelper();
  29638. this.func_71361_d("Pre startup");
  29639. GlStateManager.func_179098_w();
  29640. GlStateManager.func_179103_j(7425);
  29641. GlStateManager.func_179151_a(1.0D);
  29642. GlStateManager.func_179126_j();
  29643. GlStateManager.func_179143_c(515);
  29644. GlStateManager.func_179141_d();
  29645. GlStateManager.func_179092_a(516, 0.1F);
  29646. GlStateManager.func_187407_a(GlStateManager.CullFace.BACK);
  29647. GlStateManager.func_179128_n(5889);
  29648. GlStateManager.func_179096_D();
  29649. GlStateManager.func_179128_n(5888);
  29650. this.func_71361_d("Startup");
  29651. this.field_147128_au = new TextureMap("textures");
  29652. this.field_147128_au.func_147633_a(this.field_71474_y.field_151442_I);
  29653. this.field_71446_o.func_110580_a(TextureMap.field_110575_b, this.field_147128_au);
  29654. this.field_71446_o.func_110577_a(TextureMap.field_110575_b);
  29655. this.field_147128_au.func_174937_a(false, this.field_71474_y.field_151442_I > 0);
  29656. this.field_175617_aL = new ModelManager(this.field_147128_au);
  29657. this.field_110451_am.func_110542_a(this.field_175617_aL);
  29658. this.field_184127_aH = BlockColors.func_186723_a();
  29659. this.field_184128_aI = ItemColors.func_186729_a(this.field_184127_aH);
  29660. this.field_175621_X = new RenderItem(this.field_71446_o, this.field_175617_aL, this.field_184128_aI);
  29661. this.field_175616_W = new RenderManager(this.field_71446_o, this.field_175621_X);
  29662. this.field_175620_Y = new ItemRenderer(this);
  29663. this.field_110451_am.func_110542_a(this.field_175621_X);
  29664. this.field_71460_t = new EntityRenderer(this, this.field_110451_am);
  29665. this.field_110451_am.func_110542_a(this.field_71460_t);
  29666. this.field_175618_aM = new BlockRendererDispatcher(this.field_175617_aL.func_174954_c(), this.field_184127_aH);
  29667. this.field_110451_am.func_110542_a(this.field_175618_aM);
  29668. this.field_71438_f = new RenderGlobal(this);
  29669. this.field_110451_am.func_110542_a(this.field_71438_f);
  29670. this.func_193986_ar();
  29671. this.field_110451_am.func_110542_a(this.field_193995_ae);
  29672. GlStateManager.func_179083_b(0, 0, this.field_71443_c, this.field_71440_d);
  29673. this.field_71452_i = new ParticleManager(this.field_71441_e, this.field_71446_o);
  29674. this.func_71361_d("Post startup");
  29675. this.field_71456_v = new GuiIngame(this);
  29676. if(this.field_71475_ae != null) {
  29677. this.func_147108_a(new GuiConnecting(new GuiMainMenu(), this, this.field_71475_ae, this.field_71477_af));
  29678. } else {
  29679. this.func_147108_a(new GuiMainMenu());
  29680. }
  29681.  
  29682. this.field_71446_o.func_147645_c(this.field_152354_ay);
  29683. this.field_152354_ay = null;
  29684. this.field_71461_s = new LoadingScreenRenderer(this);
  29685. this.field_184132_p = new DebugRenderer(this);
  29686. if(this.field_71474_y.field_74353_u && !this.field_71431_Q) {
  29687. this.func_71352_k();
  29688. }
  29689.  
  29690. try {
  29691. Display.setVSyncEnabled(this.field_71474_y.field_74352_v);
  29692. } catch (OpenGLException var2) {
  29693. this.field_71474_y.field_74352_v = false;
  29694. this.field_71474_y.func_74303_b();
  29695. }
  29696.  
  29697. this.field_71438_f.func_174966_b();
  29698. }
  29699.  
  29700. private void func_193986_ar() {
  29701. SearchTree<ItemStack> searchtree = new SearchTree((p_193988_0_) -> {
  29702. return (List)p_193988_0_.func_82840_a((EntityPlayer)null, ITooltipFlag.TooltipFlags.NORMAL).stream().map(TextFormatting::func_110646_a).map(String::trim).filter((p_193984_0_) -> {
  29703. return !p_193984_0_.isEmpty();
  29704. }).collect(Collectors.toList());
  29705. }, (p_193985_0_) -> {
  29706. return Collections.singleton(Item.field_150901_e.func_177774_c(p_193985_0_.func_77973_b()));
  29707. });
  29708. NonNullList<ItemStack> nonnulllist = NonNullList.<ItemStack>func_191196_a();
  29709.  
  29710. for(Item item : Item.field_150901_e) {
  29711. item.func_150895_a(CreativeTabs.field_78027_g, nonnulllist);
  29712. }
  29713.  
  29714. nonnulllist.forEach(searchtree::func_194043_a);
  29715. SearchTree<RecipeList> searchtree1 = new SearchTree((p_193990_0_) -> {
  29716. return (List)p_193990_0_.func_192711_b().stream().flatMap((p_193993_0_) -> {
  29717. return p_193993_0_.func_77571_b().func_82840_a((EntityPlayer)null, ITooltipFlag.TooltipFlags.NORMAL).stream();
  29718. }).map(TextFormatting::func_110646_a).map(String::trim).filter((p_193994_0_) -> {
  29719. return !p_193994_0_.isEmpty();
  29720. }).collect(Collectors.toList());
  29721. }, (p_193991_0_) -> {
  29722. return (List)p_193991_0_.func_192711_b().stream().map((p_193992_0_) -> {
  29723. return (ResourceLocation)Item.field_150901_e.func_177774_c(p_193992_0_.func_77571_b().func_77973_b());
  29724. }).collect(Collectors.toList());
  29725. });
  29726. RecipeBookClient.field_194087_f.forEach(searchtree1::func_194043_a);
  29727. this.field_193995_ae.func_194009_a(SearchTreeManager.field_194011_a, searchtree);
  29728. this.field_193995_ae.func_194009_a(SearchTreeManager.field_194012_b, searchtree1);
  29729. }
  29730.  
  29731. private void func_175608_ak() {
  29732. this.field_110452_an.func_110504_a(new TextureMetadataSectionSerializer(), TextureMetadataSection.class);
  29733. this.field_110452_an.func_110504_a(new FontMetadataSectionSerializer(), FontMetadataSection.class);
  29734. this.field_110452_an.func_110504_a(new AnimationMetadataSectionSerializer(), AnimationMetadataSection.class);
  29735. this.field_110452_an.func_110504_a(new PackMetadataSectionSerializer(), PackMetadataSection.class);
  29736. this.field_110452_an.func_110504_a(new LanguageMetadataSectionSerializer(), LanguageMetadataSection.class);
  29737. }
  29738.  
  29739. private void func_175609_am() throws LWJGLException {
  29740. Display.setResizable(true);
  29741. Display.setTitle("Minecraft 1.12");
  29742.  
  29743. try {
  29744. Display.create((new PixelFormat()).withDepthBits(24));
  29745. } catch (LWJGLException lwjglexception) {
  29746. field_147123_G.error((String)"Couldn\'t set pixel format", (Throwable)lwjglexception);
  29747.  
  29748. try {
  29749. Thread.sleep(1000L);
  29750. } catch (InterruptedException var3) {
  29751. ;
  29752. }
  29753.  
  29754. if(this.field_71431_Q) {
  29755. this.func_110441_Q();
  29756. }
  29757.  
  29758. Display.create();
  29759. }
  29760.  
  29761. }
  29762.  
  29763. private void func_175605_an() throws LWJGLException {
  29764. if(this.field_71431_Q) {
  29765. Display.setFullscreen(true);
  29766. DisplayMode displaymode = Display.getDisplayMode();
  29767. this.field_71443_c = Math.max(1, displaymode.getWidth());
  29768. this.field_71440_d = Math.max(1, displaymode.getHeight());
  29769. } else {
  29770. Display.setDisplayMode(new DisplayMode(this.field_71443_c, this.field_71440_d));
  29771. }
  29772.  
  29773. }
  29774.  
  29775. private void func_175594_ao() {
  29776. Util.EnumOS util$enumos = Util.func_110647_a();
  29777. if(util$enumos != Util.EnumOS.OSX) {
  29778. InputStream inputstream = null;
  29779. InputStream inputstream1 = null;
  29780.  
  29781. try {
  29782. inputstream = this.field_110450_ap.func_152780_c(new ResourceLocation("icons/icon_16x16.png"));
  29783. inputstream1 = this.field_110450_ap.func_152780_c(new ResourceLocation("icons/icon_32x32.png"));
  29784. if(inputstream != null && inputstream1 != null) {
  29785. Display.setIcon(new ByteBuffer[]{this.func_152340_a(inputstream), this.func_152340_a(inputstream1)});
  29786. }
  29787. } catch (IOException ioexception) {
  29788. field_147123_G.error((String)"Couldn\'t set icon", (Throwable)ioexception);
  29789. } finally {
  29790. IOUtils.closeQuietly(inputstream);
  29791. IOUtils.closeQuietly(inputstream1);
  29792. }
  29793. }
  29794.  
  29795. }
  29796.  
  29797. private static boolean func_147122_X() {
  29798. String[] astring = new String[]{"sun.arch.data.model", "com.ibm.vm.bitmode", "os.arch"};
  29799.  
  29800. for(String string : astring) {
  29801. String string1 = System.getProperty(string);
  29802. if(string1 != null && string1.contains("64")) {
  29803. return true;
  29804. }
  29805. }
  29806.  
  29807. return false;
  29808. }
  29809.  
  29810. public Framebuffer func_147110_a() {
  29811. return this.field_147124_at;
  29812. }
  29813.  
  29814. public String func_175600_c() {
  29815. return this.field_110447_Z;
  29816. }
  29817.  
  29818. public String func_184123_d() {
  29819. return this.field_184130_ao;
  29820. }
  29821.  
  29822. private void func_71389_H() {
  29823. Thread thread = new Thread("Timer hack thread") {
  29824. public void run() {
  29825. while(Minecraft.this.field_71425_J) {
  29826. try {
  29827. Thread.sleep(2147483647L);
  29828. } catch (InterruptedException var2) {
  29829. ;
  29830. }
  29831. }
  29832.  
  29833. }
  29834. };
  29835. thread.setDaemon(true);
  29836. thread.start();
  29837. }
  29838.  
  29839. public void func_71404_a(CrashReport p_71404_1_) {
  29840. this.field_71434_R = true;
  29841. this.field_71433_S = p_71404_1_;
  29842. }
  29843.  
  29844. public void func_71377_b(CrashReport p_71377_1_) {
  29845. File file = new File(func_71410_x().field_71412_D, "crash-reports");
  29846. File file1 = new File(file, "crash-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + "-client.txt");
  29847. Bootstrap.func_179870_a(p_71377_1_.func_71502_e());
  29848. if(p_71377_1_.func_71497_f() != null) {
  29849. Bootstrap.func_179870_a("#@!@# Game crashed! Crash report saved to: #@!@# " + p_71377_1_.func_71497_f());
  29850. System.exit(-1);
  29851. } else if(p_71377_1_.func_147149_a(file1)) {
  29852. Bootstrap.func_179870_a("#@!@# Game crashed! Crash report saved to: #@!@# " + file1.getAbsolutePath());
  29853. System.exit(-1);
  29854. } else {
  29855. Bootstrap.func_179870_a("#@?@# Game crashed! Crash report could not be saved. #@?@#");
  29856. System.exit(-2);
  29857. }
  29858.  
  29859. }
  29860.  
  29861. public boolean func_152349_b() {
  29862. return this.field_135017_as.func_135042_a() || this.field_71474_y.field_151455_aw;
  29863. }
  29864.  
  29865. public void func_110436_a() {
  29866. List<IResourcePack> list = Lists.newArrayList(this.field_110449_ao);
  29867. if(this.field_71437_Z != null) {
  29868. this.field_71437_Z.func_193031_aM();
  29869. }
  29870.  
  29871. for(ResourcePackRepository.Entry resourcepackrepository$entry : this.field_110448_aq.func_110613_c()) {
  29872. list.add(resourcepackrepository$entry.func_110514_c());
  29873. }
  29874.  
  29875. if(this.field_110448_aq.func_148530_e() != null) {
  29876. list.add(this.field_110448_aq.func_148530_e());
  29877. }
  29878.  
  29879. try {
  29880. this.field_110451_am.func_110541_a(list);
  29881. } catch (RuntimeException runtimeexception) {
  29882. field_147123_G.info((String)"Caught error stitching, removing all assigned resourcepacks", (Throwable)runtimeexception);
  29883. list.clear();
  29884. list.addAll(this.field_110449_ao);
  29885. this.field_110448_aq.func_148527_a(Collections.<ResourcePackRepository.Entry>emptyList());
  29886. this.field_110451_am.func_110541_a(list);
  29887. this.field_71474_y.field_151453_l.clear();
  29888. this.field_71474_y.field_183018_l.clear();
  29889. this.field_71474_y.func_74303_b();
  29890. }
  29891.  
  29892. this.field_135017_as.func_135043_a(list);
  29893. if(this.field_71438_f != null) {
  29894. this.field_71438_f.func_72712_a();
  29895. }
  29896.  
  29897. }
  29898.  
  29899. private ByteBuffer func_152340_a(InputStream p_152340_1_) throws IOException {
  29900. BufferedImage bufferedimage = ImageIO.read(p_152340_1_);
  29901. int[] aint = bufferedimage.getRGB(0, 0, bufferedimage.getWidth(), bufferedimage.getHeight(), (int[])null, 0, bufferedimage.getWidth());
  29902. ByteBuffer bytebuffer = ByteBuffer.allocate(4 * aint.length);
  29903.  
  29904. for(int int : aint) {
  29905. bytebuffer.putInt(int << 8 | int >> 24 & 255);
  29906. }
  29907.  
  29908. bytebuffer.flip();
  29909. return bytebuffer;
  29910. }
  29911.  
  29912. private void func_110441_Q() throws LWJGLException {
  29913. Set<DisplayMode> set = Sets.<DisplayMode>newHashSet();
  29914. Collections.addAll(set, Display.getAvailableDisplayModes());
  29915. DisplayMode displaymode = Display.getDesktopDisplayMode();
  29916. if(!set.contains(displaymode) && Util.func_110647_a() == Util.EnumOS.OSX) {
  29917. label53:
  29918. for(DisplayMode displaymode1 : field_110445_I) {
  29919. boolean boolean = true;
  29920.  
  29921. for(DisplayMode displaymode2 : set) {
  29922. if(displaymode2.getBitsPerPixel() == 32 && displaymode2.getWidth() == displaymode1.getWidth() && displaymode2.getHeight() == displaymode1.getHeight()) {
  29923. boolean = false;
  29924. break;
  29925. }
  29926. }
  29927.  
  29928. if(!boolean) {
  29929. Iterator iterator = set.iterator();
  29930.  
  29931. DisplayMode displaymode3;
  29932. while(true) {
  29933. if(!iterator.hasNext()) {
  29934. continue label53;
  29935. }
  29936.  
  29937. displaymode3 = (DisplayMode)iterator.next();
  29938. if(displaymode3.getBitsPerPixel() == 32 && displaymode3.getWidth() == displaymode1.getWidth() / 2 && displaymode3.getHeight() == displaymode1.getHeight() / 2) {
  29939. break;
  29940. }
  29941. }
  29942.  
  29943. displaymode = displaymode3;
  29944. }
  29945. }
  29946. }
  29947.  
  29948. Display.setDisplayMode(displaymode);
  29949. this.field_71443_c = displaymode.getWidth();
  29950. this.field_71440_d = displaymode.getHeight();
  29951. }
  29952.  
  29953. public void func_180510_a(TextureManager p_180510_1_) throws LWJGLException {
  29954. ScaledResolution scaledresolution = new ScaledResolution(this);
  29955. int int = scaledresolution.func_78325_e();
  29956. Framebuffer framebuffer = new Framebuffer(scaledresolution.func_78326_a() * int, scaledresolution.func_78328_b() * int, true);
  29957. framebuffer.func_147610_a(false);
  29958. GlStateManager.func_179128_n(5889);
  29959. GlStateManager.func_179096_D();
  29960. GlStateManager.func_179130_a(0.0D, (double)scaledresolution.func_78326_a(), (double)scaledresolution.func_78328_b(), 0.0D, 1000.0D, 3000.0D);
  29961. GlStateManager.func_179128_n(5888);
  29962. GlStateManager.func_179096_D();
  29963. GlStateManager.func_179109_b(0.0F, 0.0F, -2000.0F);
  29964. GlStateManager.func_179140_f();
  29965. GlStateManager.func_179106_n();
  29966. GlStateManager.func_179097_i();
  29967. GlStateManager.func_179098_w();
  29968. InputStream inputstream = null;
  29969.  
  29970. try {
  29971. inputstream = this.field_110450_ap.func_110590_a(field_110444_H);
  29972. this.field_152354_ay = p_180510_1_.func_110578_a("logo", new DynamicTexture(ImageIO.read(inputstream)));
  29973. p_180510_1_.func_110577_a(this.field_152354_ay);
  29974. } catch (IOException ioexception) {
  29975. field_147123_G.error((String)"Unable to load logo: {}", (Object)field_110444_H, (Object)ioexception);
  29976. } finally {
  29977. IOUtils.closeQuietly(inputstream);
  29978. }
  29979.  
  29980. Tessellator tessellator = Tessellator.func_178181_a();
  29981. BufferBuilder bufferbuilder = tessellator.func_178180_c();
  29982. bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181709_i);
  29983. bufferbuilder.func_181662_b(0.0D, (double)this.field_71440_d, 0.0D).func_187315_a(0.0D, 0.0D).func_181669_b(255, 255, 255, 255).func_181675_d();
  29984. bufferbuilder.func_181662_b((double)this.field_71443_c, (double)this.field_71440_d, 0.0D).func_187315_a(0.0D, 0.0D).func_181669_b(255, 255, 255, 255).func_181675_d();
  29985. bufferbuilder.func_181662_b((double)this.field_71443_c, 0.0D, 0.0D).func_187315_a(0.0D, 0.0D).func_181669_b(255, 255, 255, 255).func_181675_d();
  29986. bufferbuilder.func_181662_b(0.0D, 0.0D, 0.0D).func_187315_a(0.0D, 0.0D).func_181669_b(255, 255, 255, 255).func_181675_d();
  29987. tessellator.func_78381_a();
  29988. GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
  29989. int int = 256;
  29990. int int = 256;
  29991. this.func_181536_a((scaledresolution.func_78326_a() - 256) / 2, (scaledresolution.func_78328_b() - 256) / 2, 0, 0, 256, 256, 255, 255, 255, 255);
  29992. GlStateManager.func_179140_f();
  29993. GlStateManager.func_179106_n();
  29994. framebuffer.func_147609_e();
  29995. framebuffer.func_147615_c(scaledresolution.func_78326_a() * int, scaledresolution.func_78328_b() * int);
  29996. GlStateManager.func_179141_d();
  29997. GlStateManager.func_179092_a(516, 0.1F);
  29998. this.func_175601_h();
  29999. }
  30000.  
  30001. public void func_181536_a(int p_181536_1_, int p_181536_2_, int p_181536_3_, int p_181536_4_, int p_181536_5_, int p_181536_6_, int p_181536_7_, int p_181536_8_, int p_181536_9_, int p_181536_10_) {
  30002. BufferBuilder bufferbuilder = Tessellator.func_178181_a().func_178180_c();
  30003. bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181709_i);
  30004. float float = 0.00390625F;
  30005. float float = 0.00390625F;
  30006. bufferbuilder.func_181662_b((double)p_181536_1_, (double)(p_181536_2_ + p_181536_6_), 0.0D).func_187315_a((double)((float)p_181536_3_ * 0.00390625F), (double)((float)(p_181536_4_ + p_181536_6_) * 0.00390625F)).func_181669_b(p_181536_7_, p_181536_8_, p_181536_9_, p_181536_10_).func_181675_d();
  30007. bufferbuilder.func_181662_b((double)(p_181536_1_ + p_181536_5_), (double)(p_181536_2_ + p_181536_6_), 0.0D).func_187315_a((double)((float)(p_181536_3_ + p_181536_5_) * 0.00390625F), (double)((float)(p_181536_4_ + p_181536_6_) * 0.00390625F)).func_181669_b(p_181536_7_, p_181536_8_, p_181536_9_, p_181536_10_).func_181675_d();
  30008. bufferbuilder.func_181662_b((double)(p_181536_1_ + p_181536_5_), (double)p_181536_2_, 0.0D).func_187315_a((double)((float)(p_181536_3_ + p_181536_5_) * 0.00390625F), (double)((float)p_181536_4_ * 0.00390625F)).func_181669_b(p_181536_7_, p_181536_8_, p_181536_9_, p_181536_10_).func_181675_d();
  30009. bufferbuilder.func_181662_b((double)p_181536_1_, (double)p_181536_2_, 0.0D).func_187315_a((double)((float)p_181536_3_ * 0.00390625F), (double)((float)p_181536_4_ * 0.00390625F)).func_181669_b(p_181536_7_, p_181536_8_, p_181536_9_, p_181536_10_).func_181675_d();
  30010. Tessellator.func_178181_a().func_78381_a();
  30011. }
  30012.  
  30013. public ISaveFormat func_71359_d() {
  30014. return this.field_71469_aa;
  30015. }
  30016.  
  30017. public void func_147108_a(@Nullable GuiScreen p_147108_1_) {
  30018. if(this.field_71462_r != null) {
  30019. this.field_71462_r.func_146281_b();
  30020. }
  30021.  
  30022. if(p_147108_1_ == null && this.field_71441_e == null) {
  30023. p_147108_1_ = new GuiMainMenu();
  30024. } else if(p_147108_1_ == null && this.field_71439_g.func_110143_aJ() <= 0.0F) {
  30025. p_147108_1_ = new GuiGameOver((ITextComponent)null);
  30026. }
  30027.  
  30028. if(p_147108_1_ instanceof GuiMainMenu || p_147108_1_ instanceof GuiMultiplayer) {
  30029. this.field_71474_y.field_74330_P = false;
  30030. this.field_71456_v.func_146158_b().func_146231_a(true);
  30031. }
  30032.  
  30033. this.field_71462_r = (GuiScreen)p_147108_1_;
  30034. if(p_147108_1_ != null) {
  30035. this.func_71364_i();
  30036. KeyBinding.func_74506_a();
  30037.  
  30038. while(Mouse.next()) {
  30039. ;
  30040. }
  30041.  
  30042. while(Keyboard.next()) {
  30043. ;
  30044. }
  30045.  
  30046. ScaledResolution scaledresolution = new ScaledResolution(this);
  30047. int int = scaledresolution.func_78326_a();
  30048. int int = scaledresolution.func_78328_b();
  30049. ((GuiScreen)p_147108_1_).func_146280_a(this, int, int);
  30050. this.field_71454_w = false;
  30051. } else {
  30052. this.field_147127_av.func_147687_e();
  30053. this.func_71381_h();
  30054. }
  30055.  
  30056. }
  30057.  
  30058. private void func_71361_d(String p_71361_1_) {
  30059. int int = GlStateManager.func_187434_L();
  30060. if(int != 0) {
  30061. String string = GLU.gluErrorString(int);
  30062. field_147123_G.error("########## GL ERROR ##########");
  30063. field_147123_G.error((String)"@ {}", (Object)p_71361_1_);
  30064. field_147123_G.error((String)"{}: {}", (Object)Integer.valueOf(int), (Object)string);
  30065. }
  30066.  
  30067. }
  30068.  
  30069. public void func_71405_e() {
  30070. try {
  30071. field_147123_G.info("Stopping!");
  30072.  
  30073. try {
  30074. this.func_71403_a((WorldClient)null);
  30075. } catch (Throwable var5) {
  30076. ;
  30077. }
  30078.  
  30079. this.field_147127_av.func_147685_d();
  30080. } finally {
  30081. Display.destroy();
  30082. if(!this.field_71434_R) {
  30083. System.exit(0);
  30084. }
  30085.  
  30086. }
  30087.  
  30088. System.gc();
  30089. }
  30090.  
  30091. private void func_71411_J() throws IOException {
  30092. long long = System.nanoTime();
  30093. this.field_71424_I.func_76320_a("root");
  30094. if(Display.isCreated() && Display.isCloseRequested()) {
  30095. this.func_71400_g();
  30096. }
  30097.  
  30098. this.field_71428_T.func_74275_a();
  30099. this.field_71424_I.func_76320_a("scheduledExecutables");
  30100. synchronized(this.field_152351_aB) {
  30101. while(!this.field_152351_aB.isEmpty()) {
  30102. Util.func_181617_a((FutureTask)this.field_152351_aB.poll(), field_147123_G);
  30103. }
  30104. }
  30105.  
  30106. this.field_71424_I.func_76319_b();
  30107. long long = System.nanoTime();
  30108. this.field_71424_I.func_76320_a("tick");
  30109.  
  30110. for(int int = 0; int < Math.min(10, this.field_71428_T.field_74280_b); ++int) {
  30111. this.func_71407_l();
  30112. }
  30113.  
  30114. this.field_71424_I.func_76318_c("preRenderErrors");
  30115. long long = System.nanoTime() - long;
  30116. this.func_71361_d("Pre render");
  30117. this.field_71424_I.func_76318_c("sound");
  30118. this.field_147127_av.func_147691_a(this.field_71439_g, this.field_71428_T.field_194147_b);
  30119. this.field_71424_I.func_76319_b();
  30120. this.field_71424_I.func_76320_a("render");
  30121. GlStateManager.func_179094_E();
  30122. GlStateManager.func_179086_m(16640);
  30123. this.field_147124_at.func_147610_a(true);
  30124. this.field_71424_I.func_76320_a("display");
  30125. GlStateManager.func_179098_w();
  30126. this.field_71424_I.func_76319_b();
  30127. if(!this.field_71454_w) {
  30128. this.field_71424_I.func_76318_c("gameRenderer");
  30129. this.field_71460_t.func_181560_a(this.field_71445_n?this.field_193996_ah:this.field_71428_T.field_194147_b, long);
  30130. this.field_71424_I.func_76318_c("toasts");
  30131. this.field_193034_aS.func_191783_a(new ScaledResolution(this));
  30132. this.field_71424_I.func_76319_b();
  30133. }
  30134.  
  30135. this.field_71424_I.func_76319_b();
  30136. if(this.field_71474_y.field_74330_P && this.field_71474_y.field_74329_Q && !this.field_71474_y.field_74319_N) {
  30137. if(!this.field_71424_I.field_76327_a) {
  30138. this.field_71424_I.func_76317_a();
  30139. }
  30140.  
  30141. this.field_71424_I.field_76327_a = true;
  30142. this.func_71366_a(long);
  30143. } else {
  30144. this.field_71424_I.field_76327_a = false;
  30145. this.field_71421_N = System.nanoTime();
  30146. }
  30147.  
  30148. this.field_147124_at.func_147609_e();
  30149. GlStateManager.func_179121_F();
  30150. GlStateManager.func_179094_E();
  30151. this.field_147124_at.func_147615_c(this.field_71443_c, this.field_71440_d);
  30152. GlStateManager.func_179121_F();
  30153. GlStateManager.func_179094_E();
  30154. this.field_71460_t.func_152430_c(this.field_71428_T.field_194147_b);
  30155. GlStateManager.func_179121_F();
  30156. this.field_71424_I.func_76320_a("root");
  30157. this.func_175601_h();
  30158. Thread.yield();
  30159. this.func_71361_d("Post render");
  30160. ++this.field_71420_M;
  30161. boolean boolean = this.func_71356_B() && this.field_71462_r != null && this.field_71462_r.func_73868_f() && !this.field_71437_Z.func_71344_c();
  30162. if(this.field_71445_n != boolean) {
  30163. if(this.field_71445_n) {
  30164. this.field_193996_ah = this.field_71428_T.field_194147_b;
  30165. } else {
  30166. this.field_71428_T.field_194147_b = this.field_193996_ah;
  30167. }
  30168.  
  30169. this.field_71445_n = boolean;
  30170. }
  30171.  
  30172. long long = System.nanoTime();
  30173. this.field_181542_y.func_181747_a(long - this.field_181543_z);
  30174. this.field_181543_z = long;
  30175.  
  30176. while(func_71386_F() >= this.field_71419_L + 1000L) {
  30177. field_71470_ab = this.field_71420_M;
  30178. this.field_71426_K = String.format("%d fps (%d chunk update%s) T: %s%s%s%s%s", new Object[]{Integer.valueOf(field_71470_ab), Integer.valueOf(RenderChunk.field_178592_a), RenderChunk.field_178592_a == 1?"":"s", (float)this.field_71474_y.field_74350_i == GameSettings.Options.FRAMERATE_LIMIT.func_148267_f()?"inf":Integer.valueOf(this.field_71474_y.field_74350_i), this.field_71474_y.field_74352_v?" vsync":"", this.field_71474_y.field_74347_j?"":" fast", this.field_71474_y.field_74345_l == 0?"":(this.field_71474_y.field_74345_l == 1?" fast-clouds":" fancy-clouds"), OpenGlHelper.func_176075_f()?" vbo":""});
  30179. RenderChunk.field_178592_a = 0;
  30180. this.field_71419_L += 1000L;
  30181. this.field_71420_M = 0;
  30182. this.field_71427_U.func_76471_b();
  30183. if(!this.field_71427_U.func_76468_d()) {
  30184. this.field_71427_U.func_76463_a();
  30185. }
  30186. }
  30187.  
  30188. if(this.func_147107_h()) {
  30189. this.field_71424_I.func_76320_a("fpslimit_wait");
  30190. Display.sync(this.func_90020_K());
  30191. this.field_71424_I.func_76319_b();
  30192. }
  30193.  
  30194. this.field_71424_I.func_76319_b();
  30195. }
  30196.  
  30197. public void func_175601_h() {
  30198. this.field_71424_I.func_76320_a("display_update");
  30199. Display.update();
  30200. this.field_71424_I.func_76319_b();
  30201. this.func_175604_i();
  30202. }
  30203.  
  30204. protected void func_175604_i() {
  30205. if(!this.field_71431_Q && Display.wasResized()) {
  30206. int int = this.field_71443_c;
  30207. int int = this.field_71440_d;
  30208. this.field_71443_c = Display.getWidth();
  30209. this.field_71440_d = Display.getHeight();
  30210. if(this.field_71443_c != int || this.field_71440_d != int) {
  30211. if(this.field_71443_c <= 0) {
  30212. this.field_71443_c = 1;
  30213. }
  30214.  
  30215. if(this.field_71440_d <= 0) {
  30216. this.field_71440_d = 1;
  30217. }
  30218.  
  30219. this.func_71370_a(this.field_71443_c, this.field_71440_d);
  30220. }
  30221. }
  30222.  
  30223. }
  30224.  
  30225. public int func_90020_K() {
  30226. return this.field_71441_e == null && this.field_71462_r != null?30:this.field_71474_y.field_74350_i;
  30227. }
  30228.  
  30229. public boolean func_147107_h() {
  30230. return (float)this.func_90020_K() < GameSettings.Options.FRAMERATE_LIMIT.func_148267_f();
  30231. }
  30232.  
  30233. public void func_71398_f() {
  30234. try {
  30235. field_71444_a = new byte[0];
  30236. this.field_71438_f.func_72728_f();
  30237. } catch (Throwable var3) {
  30238. ;
  30239. }
  30240.  
  30241. try {
  30242. System.gc();
  30243. this.func_71403_a((WorldClient)null);
  30244. } catch (Throwable var2) {
  30245. ;
  30246. }
  30247.  
  30248. System.gc();
  30249. }
  30250.  
  30251. private void func_71383_b(int p_71383_1_) {
  30252. List<Profiler.Result> list = this.field_71424_I.func_76321_b(this.field_71465_an);
  30253. if(!list.isEmpty()) {
  30254. Profiler.Result profiler$result = (Profiler.Result)list.remove(0);
  30255. if(p_71383_1_ == 0) {
  30256. if(!profiler$result.field_76331_c.isEmpty()) {
  30257. int int = this.field_71465_an.lastIndexOf(46);
  30258. if(int >= 0) {
  30259. this.field_71465_an = this.field_71465_an.substring(0, int);
  30260. }
  30261. }
  30262. } else {
  30263. --p_71383_1_;
  30264. if(p_71383_1_ < list.size() && !"unspecified".equals(((Profiler.Result)list.get(p_71383_1_)).field_76331_c)) {
  30265. if(!this.field_71465_an.isEmpty()) {
  30266. this.field_71465_an = this.field_71465_an + ".";
  30267. }
  30268.  
  30269. this.field_71465_an = this.field_71465_an + ((Profiler.Result)list.get(p_71383_1_)).field_76331_c;
  30270. }
  30271. }
  30272.  
  30273. }
  30274. }
  30275.  
  30276. private void func_71366_a(long p_71366_1_) {
  30277. if(this.field_71424_I.field_76327_a) {
  30278. List<Profiler.Result> list = this.field_71424_I.func_76321_b(this.field_71465_an);
  30279. Profiler.Result profiler$result = (Profiler.Result)list.remove(0);
  30280. GlStateManager.func_179086_m(256);
  30281. GlStateManager.func_179128_n(5889);
  30282. GlStateManager.func_179142_g();
  30283. GlStateManager.func_179096_D();
  30284. GlStateManager.func_179130_a(0.0D, (double)this.field_71443_c, (double)this.field_71440_d, 0.0D, 1000.0D, 3000.0D);
  30285. GlStateManager.func_179128_n(5888);
  30286. GlStateManager.func_179096_D();
  30287. GlStateManager.func_179109_b(0.0F, 0.0F, -2000.0F);
  30288. GlStateManager.func_187441_d(1.0F);
  30289. GlStateManager.func_179090_x();
  30290. Tessellator tessellator = Tessellator.func_178181_a();
  30291. BufferBuilder bufferbuilder = tessellator.func_178180_c();
  30292. int int = 160;
  30293. int int = this.field_71443_c - 160 - 10;
  30294. int int = this.field_71440_d - 320;
  30295. GlStateManager.func_179147_l();
  30296. bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181706_f);
  30297. bufferbuilder.func_181662_b((double)((float)int - 176.0F), (double)((float)int - 96.0F - 16.0F), 0.0D).func_181669_b(200, 0, 0, 0).func_181675_d();
  30298. bufferbuilder.func_181662_b((double)((float)int - 176.0F), (double)(int + 320), 0.0D).func_181669_b(200, 0, 0, 0).func_181675_d();
  30299. bufferbuilder.func_181662_b((double)((float)int + 176.0F), (double)(int + 320), 0.0D).func_181669_b(200, 0, 0, 0).func_181675_d();
  30300. bufferbuilder.func_181662_b((double)((float)int + 176.0F), (double)((float)int - 96.0F - 16.0F), 0.0D).func_181669_b(200, 0, 0, 0).func_181675_d();
  30301. tessellator.func_78381_a();
  30302. GlStateManager.func_179084_k();
  30303. double double = 0.0D;
  30304.  
  30305. for(int int = 0; int < list.size(); ++int) {
  30306. Profiler.Result profiler$result1 = (Profiler.Result)list.get(int);
  30307. int int = MathHelper.func_76128_c(profiler$result1.field_76332_a / 4.0D) + 1;
  30308. bufferbuilder.func_181668_a(6, DefaultVertexFormats.field_181706_f);
  30309. int int = profiler$result1.func_76329_a();
  30310. int int = int >> 16 & 255;
  30311. int int = int >> 8 & 255;
  30312. int int = int & 255;
  30313. bufferbuilder.func_181662_b((double)int, (double)int, 0.0D).func_181669_b(int, int, int, 255).func_181675_d();
  30314.  
  30315. for(int int = int; int >= 0; --int) {
  30316. float float = (float)((double + profiler$result1.field_76332_a * (double)int / (double)int) * 6.2831854820251465D / 100.0D);
  30317. float float = MathHelper.func_76126_a(float) * 160.0F;
  30318. float float = MathHelper.func_76134_b(float) * 160.0F * 0.5F;
  30319. bufferbuilder.func_181662_b((double)((float)int + float), (double)((float)int - float), 0.0D).func_181669_b(int, int, int, 255).func_181675_d();
  30320. }
  30321.  
  30322. tessellator.func_78381_a();
  30323. bufferbuilder.func_181668_a(5, DefaultVertexFormats.field_181706_f);
  30324.  
  30325. for(int int = int; int >= 0; --int) {
  30326. float float = (float)((double + profiler$result1.field_76332_a * (double)int / (double)int) * 6.2831854820251465D / 100.0D);
  30327. float float = MathHelper.func_76126_a(float) * 160.0F;
  30328. float float = MathHelper.func_76134_b(float) * 160.0F * 0.5F;
  30329. bufferbuilder.func_181662_b((double)((float)int + float), (double)((float)int - float), 0.0D).func_181669_b(int >> 1, int >> 1, int >> 1, 255).func_181675_d();
  30330. bufferbuilder.func_181662_b((double)((float)int + float), (double)((float)int - float + 10.0F), 0.0D).func_181669_b(int >> 1, int >> 1, int >> 1, 255).func_181675_d();
  30331. }
  30332.  
  30333. tessellator.func_78381_a();
  30334. double += profiler$result1.field_76332_a;
  30335. }
  30336.  
  30337. DecimalFormat decimalformat = new DecimalFormat("##0.00");
  30338. GlStateManager.func_179098_w();
  30339. String string = "";
  30340. if(!"unspecified".equals(profiler$result.field_76331_c)) {
  30341. string = string + "[0] ";
  30342. }
  30343.  
  30344. if(profiler$result.field_76331_c.isEmpty()) {
  30345. string = string + "ROOT ";
  30346. } else {
  30347. string = string + profiler$result.field_76331_c + ' ';
  30348. }
  30349.  
  30350. int int = 16777215;
  30351. this.field_71466_p.func_175063_a(string, (float)(int - 160), (float)(int - 80 - 16), 16777215);
  30352. string = decimalformat.format(profiler$result.field_76330_b) + "%";
  30353. this.field_71466_p.func_175063_a(string, (float)(int + 160 - this.field_71466_p.func_78256_a(string)), (float)(int - 80 - 16), 16777215);
  30354.  
  30355. for(int int = 0; int < list.size(); ++int) {
  30356. Profiler.Result profiler$result2 = (Profiler.Result)list.get(int);
  30357. StringBuilder stringbuilder = new StringBuilder();
  30358. if("unspecified".equals(profiler$result2.field_76331_c)) {
  30359. stringbuilder.append("[?] ");
  30360. } else {
  30361. stringbuilder.append("[").append(int + 1).append("] ");
  30362. }
  30363.  
  30364. String string1 = stringbuilder.append(profiler$result2.field_76331_c).toString();
  30365. this.field_71466_p.func_175063_a(string1, (float)(int - 160), (float)(int + 80 + int * 8 + 20), profiler$result2.func_76329_a());
  30366. string1 = decimalformat.format(profiler$result2.field_76332_a) + "%";
  30367. this.field_71466_p.func_175063_a(string1, (float)(int + 160 - 50 - this.field_71466_p.func_78256_a(string1)), (float)(int + 80 + int * 8 + 20), profiler$result2.func_76329_a());
  30368. string1 = decimalformat.format(profiler$result2.field_76330_b) + "%";
  30369. this.field_71466_p.func_175063_a(string1, (float)(int + 160 - this.field_71466_p.func_78256_a(string1)), (float)(int + 80 + int * 8 + 20), profiler$result2.func_76329_a());
  30370. }
  30371.  
  30372. }
  30373. }
  30374.  
  30375. public void func_71400_g() {
  30376. this.field_71425_J = false;
  30377. }
  30378.  
  30379. public void func_71381_h() {
  30380. if(Display.isActive()) {
  30381. if(!this.field_71415_G) {
  30382. if(!field_142025_a) {
  30383. KeyBinding.func_186704_a();
  30384. }
  30385.  
  30386. this.field_71415_G = true;
  30387. this.field_71417_B.func_74372_a();
  30388. this.func_147108_a((GuiScreen)null);
  30389. this.field_71429_W = 10000;
  30390. }
  30391. }
  30392. }
  30393.  
  30394. public void func_71364_i() {
  30395. if(this.field_71415_G) {
  30396. this.field_71415_G = false;
  30397. this.field_71417_B.func_74373_b();
  30398. }
  30399. }
  30400.  
  30401. public void func_71385_j() {
  30402. if(this.field_71462_r == null) {
  30403. this.func_147108_a(new GuiIngameMenu());
  30404. if(this.func_71356_B() && !this.field_71437_Z.func_71344_c()) {
  30405. this.field_147127_av.func_147689_b();
  30406. }
  30407.  
  30408. }
  30409. }
  30410.  
  30411. private void func_147115_a(boolean p_147115_1_) {
  30412. if(!p_147115_1_) {
  30413. this.field_71429_W = 0;
  30414. }
  30415.  
  30416. if(this.field_71429_W <= 0 && !this.field_71439_g.func_184587_cr()) {
  30417. if(p_147115_1_ && this.field_71476_x != null && this.field_71476_x.field_72313_a == RayTraceResult.Type.BLOCK) {
  30418. BlockPos blockpos = this.field_71476_x.func_178782_a();
  30419. if(this.field_71441_e.func_180495_p(blockpos).func_185904_a() != Material.field_151579_a && this.field_71442_b.func_180512_c(blockpos, this.field_71476_x.field_178784_b)) {
  30420. this.field_71452_i.func_180532_a(blockpos, this.field_71476_x.field_178784_b);
  30421. this.field_71439_g.func_184609_a(EnumHand.MAIN_HAND);
  30422. }
  30423.  
  30424. } else {
  30425. this.field_71442_b.func_78767_c();
  30426. }
  30427. }
  30428. }
  30429.  
  30430. private void func_147116_af() {
  30431. if(this.field_71429_W <= 0) {
  30432. if(this.field_71476_x == null) {
  30433. field_147123_G.error("Null returned as \'hitResult\', this shouldn\'t happen!");
  30434. if(this.field_71442_b.func_78762_g()) {
  30435. this.field_71429_W = 10;
  30436. }
  30437.  
  30438. } else if(!this.field_71439_g.func_184838_M()) {
  30439. switch(this.field_71476_x.field_72313_a) {
  30440. case ENTITY:
  30441. this.field_71442_b.func_78764_a(this.field_71439_g, this.field_71476_x.field_72308_g);
  30442. break;
  30443. case BLOCK:
  30444. BlockPos blockpos = this.field_71476_x.func_178782_a();
  30445. if(this.field_71441_e.func_180495_p(blockpos).func_185904_a() != Material.field_151579_a) {
  30446. this.field_71442_b.func_180511_b(blockpos, this.field_71476_x.field_178784_b);
  30447. break;
  30448. }
  30449. case MISS:
  30450. if(this.field_71442_b.func_78762_g()) {
  30451. this.field_71429_W = 10;
  30452. }
  30453.  
  30454. this.field_71439_g.func_184821_cY();
  30455. }
  30456.  
  30457. this.field_71439_g.func_184609_a(EnumHand.MAIN_HAND);
  30458. }
  30459. }
  30460. }
  30461.  
  30462. private void func_147121_ag() {
  30463. if(!this.field_71442_b.func_181040_m()) {
  30464. this.field_71467_ac = 4;
  30465. if(!this.field_71439_g.func_184838_M()) {
  30466. if(this.field_71476_x == null) {
  30467. field_147123_G.warn("Null returned as \'hitResult\', this shouldn\'t happen!");
  30468. }
  30469.  
  30470. for(EnumHand enumhand : EnumHand.values()) {
  30471. ItemStack itemstack = this.field_71439_g.func_184586_b(enumhand);
  30472. if(this.field_71476_x != null) {
  30473. switch(this.field_71476_x.field_72313_a) {
  30474. case ENTITY:
  30475. if(this.field_71442_b.func_187102_a(this.field_71439_g, this.field_71476_x.field_72308_g, this.field_71476_x, enumhand) == EnumActionResult.SUCCESS) {
  30476. return;
  30477. }
  30478.  
  30479. if(this.field_71442_b.func_187097_a(this.field_71439_g, this.field_71476_x.field_72308_g, enumhand) == EnumActionResult.SUCCESS) {
  30480. return;
  30481. }
  30482. break;
  30483. case BLOCK:
  30484. BlockPos blockpos = this.field_71476_x.func_178782_a();
  30485. if(this.field_71441_e.func_180495_p(blockpos).func_185904_a() != Material.field_151579_a) {
  30486. int int = itemstack.func_190916_E();
  30487. EnumActionResult enumactionresult = this.field_71442_b.func_187099_a(this.field_71439_g, this.field_71441_e, blockpos, this.field_71476_x.field_178784_b, this.field_71476_x.field_72307_f, enumhand);
  30488. if(enumactionresult == EnumActionResult.SUCCESS) {
  30489. this.field_71439_g.func_184609_a(enumhand);
  30490. if(!itemstack.func_190926_b() && (itemstack.func_190916_E() != int || this.field_71442_b.func_78758_h())) {
  30491. this.field_71460_t.field_78516_c.func_187460_a(enumhand);
  30492. }
  30493.  
  30494. return;
  30495. }
  30496. }
  30497. }
  30498. }
  30499.  
  30500. if(!itemstack.func_190926_b() && this.field_71442_b.func_187101_a(this.field_71439_g, this.field_71441_e, enumhand) == EnumActionResult.SUCCESS) {
  30501. this.field_71460_t.field_78516_c.func_187460_a(enumhand);
  30502. return;
  30503. }
  30504. }
  30505.  
  30506. }
  30507. }
  30508. }
  30509.  
  30510. public void func_71352_k() {
  30511. try {
  30512. this.field_71431_Q = !this.field_71431_Q;
  30513. this.field_71474_y.field_74353_u = this.field_71431_Q;
  30514. if(this.field_71431_Q) {
  30515. this.func_110441_Q();
  30516. this.field_71443_c = Display.getDisplayMode().getWidth();
  30517. this.field_71440_d = Display.getDisplayMode().getHeight();
  30518. if(this.field_71443_c <= 0) {
  30519. this.field_71443_c = 1;
  30520. }
  30521.  
  30522. if(this.field_71440_d <= 0) {
  30523. this.field_71440_d = 1;
  30524. }
  30525. } else {
  30526. Display.setDisplayMode(new DisplayMode(this.field_71436_X, this.field_71435_Y));
  30527. this.field_71443_c = this.field_71436_X;
  30528. this.field_71440_d = this.field_71435_Y;
  30529. if(this.field_71443_c <= 0) {
  30530. this.field_71443_c = 1;
  30531. }
  30532.  
  30533. if(this.field_71440_d <= 0) {
  30534. this.field_71440_d = 1;
  30535. }
  30536. }
  30537.  
  30538. if(this.field_71462_r != null) {
  30539. this.func_71370_a(this.field_71443_c, this.field_71440_d);
  30540. } else {
  30541. this.func_147119_ah();
  30542. }
  30543.  
  30544. Display.setFullscreen(this.field_71431_Q);
  30545. Display.setVSyncEnabled(this.field_71474_y.field_74352_v);
  30546. this.func_175601_h();
  30547. } catch (Exception exception) {
  30548. field_147123_G.error((String)"Couldn\'t toggle fullscreen", (Throwable)exception);
  30549. }
  30550.  
  30551. }
  30552.  
  30553. public void func_71370_a(int p_71370_1_, int p_71370_2_) {
  30554. this.field_71443_c = Math.max(1, p_71370_1_);
  30555. this.field_71440_d = Math.max(1, p_71370_2_);
  30556. if(this.field_71462_r != null) {
  30557. ScaledResolution scaledresolution = new ScaledResolution(this);
  30558. this.field_71462_r.func_175273_b(this, scaledresolution.func_78326_a(), scaledresolution.func_78328_b());
  30559. }
  30560.  
  30561. this.field_71461_s = new LoadingScreenRenderer(this);
  30562. this.func_147119_ah();
  30563. }
  30564.  
  30565. private void func_147119_ah() {
  30566. this.field_147124_at.func_147613_a(this.field_71443_c, this.field_71440_d);
  30567. if(this.field_71460_t != null) {
  30568. this.field_71460_t.func_147704_a(this.field_71443_c, this.field_71440_d);
  30569. }
  30570.  
  30571. }
  30572.  
  30573. public MusicTicker func_181535_r() {
  30574. return this.field_147126_aw;
  30575. }
  30576.  
  30577. public void func_71407_l() throws IOException {
  30578. if(this.field_71467_ac > 0) {
  30579. --this.field_71467_ac;
  30580. }
  30581.  
  30582. this.field_71424_I.func_76320_a("gui");
  30583. if(!this.field_71445_n) {
  30584. this.field_71456_v.func_73831_a();
  30585. }
  30586.  
  30587. this.field_71424_I.func_76319_b();
  30588. this.field_71460_t.func_78473_a(1.0F);
  30589. this.field_193035_aW.func_193297_a(this.field_71441_e, this.field_71476_x);
  30590. this.field_71424_I.func_76320_a("gameMode");
  30591. if(!this.field_71445_n && this.field_71441_e != null) {
  30592. this.field_71442_b.func_78765_e();
  30593. }
  30594.  
  30595. this.field_71424_I.func_76318_c("textures");
  30596. if(this.field_71441_e != null) {
  30597. this.field_71446_o.func_110550_d();
  30598. }
  30599.  
  30600. if(this.field_71462_r == null && this.field_71439_g != null) {
  30601. if(this.field_71439_g.func_110143_aJ() <= 0.0F && !(this.field_71462_r instanceof GuiGameOver)) {
  30602. this.func_147108_a((GuiScreen)null);
  30603. } else if(this.field_71439_g.func_70608_bn() && this.field_71441_e != null) {
  30604. this.func_147108_a(new GuiSleepMP());
  30605. }
  30606. } else if(this.field_71462_r != null && this.field_71462_r instanceof GuiSleepMP && !this.field_71439_g.func_70608_bn()) {
  30607. this.func_147108_a((GuiScreen)null);
  30608. }
  30609.  
  30610. if(this.field_71462_r != null) {
  30611. this.field_71429_W = 10000;
  30612. }
  30613.  
  30614. if(this.field_71462_r != null) {
  30615. try {
  30616. this.field_71462_r.func_146269_k();
  30617. } catch (Throwable throwable1) {
  30618. CrashReport crashreport = CrashReport.func_85055_a(throwable1, "Updating screen events");
  30619. CrashReportCategory crashreportcategory = crashreport.func_85058_a("Affected screen");
  30620. crashreportcategory.func_189529_a("Screen name", new ICrashReportDetail<String>() {
  30621. public String call() throws Exception {
  30622. return Minecraft.this.field_71462_r.getClass().getCanonicalName();
  30623. }
  30624. });
  30625. throw new ReportedException(crashreport);
  30626. }
  30627.  
  30628. if(this.field_71462_r != null) {
  30629. try {
  30630. this.field_71462_r.func_73876_c();
  30631. } catch (Throwable throwable) {
  30632. CrashReport crashreport1 = CrashReport.func_85055_a(throwable, "Ticking screen");
  30633. CrashReportCategory crashreportcategory1 = crashreport1.func_85058_a("Affected screen");
  30634. crashreportcategory1.func_189529_a("Screen name", new ICrashReportDetail<String>() {
  30635. public String call() throws Exception {
  30636. return Minecraft.this.field_71462_r.getClass().getCanonicalName();
  30637. }
  30638. });
  30639. throw new ReportedException(crashreport1);
  30640. }
  30641. }
  30642. }
  30643.  
  30644. if(this.field_71462_r == null || this.field_71462_r.field_146291_p) {
  30645. this.field_71424_I.func_76318_c("mouse");
  30646. this.func_184124_aB();
  30647. if(this.field_71429_W > 0) {
  30648. --this.field_71429_W;
  30649. }
  30650.  
  30651. this.field_71424_I.func_76318_c("keyboard");
  30652. this.func_184118_az();
  30653. }
  30654.  
  30655. if(this.field_71441_e != null) {
  30656. if(this.field_71439_g != null) {
  30657. ++this.field_71457_ai;
  30658. if(this.field_71457_ai == 30) {
  30659. this.field_71457_ai = 0;
  30660. this.field_71441_e.func_72897_h(this.field_71439_g);
  30661. }
  30662. }
  30663.  
  30664. this.field_71424_I.func_76318_c("gameRenderer");
  30665. if(!this.field_71445_n) {
  30666. this.field_71460_t.func_78464_a();
  30667. }
  30668.  
  30669. this.field_71424_I.func_76318_c("levelRenderer");
  30670. if(!this.field_71445_n) {
  30671. this.field_71438_f.func_72734_e();
  30672. }
  30673.  
  30674. this.field_71424_I.func_76318_c("level");
  30675. if(!this.field_71445_n) {
  30676. if(this.field_71441_e.func_175658_ac() > 0) {
  30677. this.field_71441_e.func_175702_c(this.field_71441_e.func_175658_ac() - 1);
  30678. }
  30679.  
  30680. this.field_71441_e.func_72939_s();
  30681. }
  30682. } else if(this.field_71460_t.func_147702_a()) {
  30683. this.field_71460_t.func_181022_b();
  30684. }
  30685.  
  30686. if(!this.field_71445_n) {
  30687. this.field_147126_aw.func_73660_a();
  30688. this.field_147127_av.func_73660_a();
  30689. }
  30690.  
  30691. if(this.field_71441_e != null) {
  30692. if(!this.field_71445_n) {
  30693. this.field_71441_e.func_72891_a(this.field_71441_e.func_175659_aa() != EnumDifficulty.PEACEFUL, true);
  30694. this.field_193035_aW.func_193303_d();
  30695.  
  30696. try {
  30697. this.field_71441_e.func_72835_b();
  30698. } catch (Throwable throwable2) {
  30699. CrashReport crashreport2 = CrashReport.func_85055_a(throwable2, "Exception in world tick");
  30700. if(this.field_71441_e == null) {
  30701. CrashReportCategory crashreportcategory2 = crashreport2.func_85058_a("Affected level");
  30702. crashreportcategory2.func_71507_a("Problem", "Level is null!");
  30703. } else {
  30704. this.field_71441_e.func_72914_a(crashreport2);
  30705. }
  30706.  
  30707. throw new ReportedException(crashreport2);
  30708. }
  30709. }
  30710.  
  30711. this.field_71424_I.func_76318_c("animateTick");
  30712. if(!this.field_71445_n && this.field_71441_e != null) {
  30713. this.field_71441_e.func_73029_E(MathHelper.func_76128_c(this.field_71439_g.field_70165_t), MathHelper.func_76128_c(this.field_71439_g.field_70163_u), MathHelper.func_76128_c(this.field_71439_g.field_70161_v));
  30714. }
  30715.  
  30716. this.field_71424_I.func_76318_c("particles");
  30717. if(!this.field_71445_n) {
  30718. this.field_71452_i.func_78868_a();
  30719. }
  30720. } else if(this.field_71453_ak != null) {
  30721. this.field_71424_I.func_76318_c("pendingConnection");
  30722. this.field_71453_ak.func_74428_b();
  30723. }
  30724.  
  30725. this.field_71424_I.func_76319_b();
  30726. this.field_71423_H = func_71386_F();
  30727. }
  30728.  
  30729. private void func_184118_az() throws IOException {
  30730. while(Keyboard.next()) {
  30731. int int = Keyboard.getEventKey() == 0?Keyboard.getEventCharacter() + 256:Keyboard.getEventKey();
  30732. if(this.field_83002_am > 0L) {
  30733. if(func_71386_F() - this.field_83002_am >= 6000L) {
  30734. throw new ReportedException(new CrashReport("Manually triggered debug crash", new Throwable()));
  30735. }
  30736.  
  30737. if(!Keyboard.isKeyDown(46) || !Keyboard.isKeyDown(61)) {
  30738. this.field_83002_am = -1L;
  30739. }
  30740. } else if(Keyboard.isKeyDown(46) && Keyboard.isKeyDown(61)) {
  30741. this.field_184129_aV = true;
  30742. this.field_83002_am = func_71386_F();
  30743. }
  30744.  
  30745. this.func_152348_aa();
  30746. if(this.field_71462_r != null) {
  30747. this.field_71462_r.func_146282_l();
  30748. }
  30749.  
  30750. boolean boolean = Keyboard.getEventKeyState();
  30751. if(boolean) {
  30752. if(int == 62 && this.field_71460_t != null) {
  30753. this.field_71460_t.func_175071_c();
  30754. }
  30755.  
  30756. boolean boolean = false;
  30757. if(this.field_71462_r == null) {
  30758. if(int == 1) {
  30759. this.func_71385_j();
  30760. }
  30761.  
  30762. boolean = Keyboard.isKeyDown(61) && this.func_184122_c(int);
  30763. this.field_184129_aV |= boolean;
  30764. if(int == 59) {
  30765. this.field_71474_y.field_74319_N = !this.field_71474_y.field_74319_N;
  30766. }
  30767. }
  30768.  
  30769. if(boolean) {
  30770. KeyBinding.func_74510_a(int, false);
  30771. } else {
  30772. KeyBinding.func_74510_a(int, true);
  30773. KeyBinding.func_74507_a(int);
  30774. }
  30775.  
  30776. if(this.field_71474_y.field_74329_Q) {
  30777. if(int == 11) {
  30778. this.func_71383_b(0);
  30779. }
  30780.  
  30781. for(int int = 0; int < 9; ++int) {
  30782. if(int == 2 + int) {
  30783. this.func_71383_b(int + 1);
  30784. }
  30785. }
  30786. }
  30787. } else {
  30788. KeyBinding.func_74510_a(int, false);
  30789. if(int == 61) {
  30790. if(this.field_184129_aV) {
  30791. this.field_184129_aV = false;
  30792. } else {
  30793. this.field_71474_y.field_74330_P = !this.field_71474_y.field_74330_P;
  30794. this.field_71474_y.field_74329_Q = this.field_71474_y.field_74330_P && GuiScreen.func_146272_n();
  30795. this.field_71474_y.field_181657_aC = this.field_71474_y.field_74330_P && GuiScreen.func_175283_s();
  30796. }
  30797. }
  30798. }
  30799. }
  30800.  
  30801. this.func_184117_aA();
  30802. }
  30803.  
  30804. private boolean func_184122_c(int p_184122_1_) {
  30805. if(p_184122_1_ == 30) {
  30806. this.field_71438_f.func_72712_a();
  30807. this.func_190521_a("debug.reload_chunks.message", new Object[0]);
  30808. return true;
  30809. } else if(p_184122_1_ == 48) {
  30810. boolean boolean = !this.field_175616_W.func_178634_b();
  30811. this.field_175616_W.func_178629_b(boolean);
  30812. this.func_190521_a(boolean?"debug.show_hitboxes.on":"debug.show_hitboxes.off", new Object[0]);
  30813. return true;
  30814. } else if(p_184122_1_ == 32) {
  30815. if(this.field_71456_v != null) {
  30816. this.field_71456_v.func_146158_b().func_146231_a(false);
  30817. }
  30818.  
  30819. return true;
  30820. } else if(p_184122_1_ == 33) {
  30821. this.field_71474_y.func_74306_a(GameSettings.Options.RENDER_DISTANCE, GuiScreen.func_146272_n()?-1:1);
  30822. this.func_190521_a("debug.cycle_renderdistance.message", new Object[]{Integer.valueOf(this.field_71474_y.field_151451_c)});
  30823. return true;
  30824. } else if(p_184122_1_ == 34) {
  30825. boolean boolean = this.field_184132_p.func_190075_b();
  30826. this.func_190521_a(boolean?"debug.chunk_boundaries.on":"debug.chunk_boundaries.off", new Object[0]);
  30827. return true;
  30828. } else if(p_184122_1_ == 35) {
  30829. this.field_71474_y.field_82882_x = !this.field_71474_y.field_82882_x;
  30830. this.func_190521_a(this.field_71474_y.field_82882_x?"debug.advanced_tooltips.on":"debug.advanced_tooltips.off", new Object[0]);
  30831. this.field_71474_y.func_74303_b();
  30832. return true;
  30833. } else if(p_184122_1_ == 49) {
  30834. if(!this.field_71439_g.func_70003_b(2, "")) {
  30835. this.func_190521_a("debug.creative_spectator.error", new Object[0]);
  30836. } else if(this.field_71439_g.func_184812_l_()) {
  30837. this.field_71439_g.func_71165_d("/gamemode spectator");
  30838. } else if(this.field_71439_g.func_175149_v()) {
  30839. this.field_71439_g.func_71165_d("/gamemode creative");
  30840. }
  30841.  
  30842. return true;
  30843. } else if(p_184122_1_ == 25) {
  30844. this.field_71474_y.field_82881_y = !this.field_71474_y.field_82881_y;
  30845. this.field_71474_y.func_74303_b();
  30846. this.func_190521_a(this.field_71474_y.field_82881_y?"debug.pause_focus.on":"debug.pause_focus.off", new Object[0]);
  30847. return true;
  30848. } else if(p_184122_1_ == 16) {
  30849. this.func_190521_a("debug.help.message", new Object[0]);
  30850. GuiNewChat guinewchat = this.field_71456_v.func_146158_b();
  30851. guinewchat.func_146227_a(new TextComponentTranslation("debug.reload_chunks.help", new Object[0]));
  30852. guinewchat.func_146227_a(new TextComponentTranslation("debug.show_hitboxes.help", new Object[0]));
  30853. guinewchat.func_146227_a(new TextComponentTranslation("debug.clear_chat.help", new Object[0]));
  30854. guinewchat.func_146227_a(new TextComponentTranslation("debug.cycle_renderdistance.help", new Object[0]));
  30855. guinewchat.func_146227_a(new TextComponentTranslation("debug.chunk_boundaries.help", new Object[0]));
  30856. guinewchat.func_146227_a(new TextComponentTranslation("debug.advanced_tooltips.help", new Object[0]));
  30857. guinewchat.func_146227_a(new TextComponentTranslation("debug.creative_spectator.help", new Object[0]));
  30858. guinewchat.func_146227_a(new TextComponentTranslation("debug.pause_focus.help", new Object[0]));
  30859. guinewchat.func_146227_a(new TextComponentTranslation("debug.help.help", new Object[0]));
  30860. guinewchat.func_146227_a(new TextComponentTranslation("debug.reload_resourcepacks.help", new Object[0]));
  30861. return true;
  30862. } else if(p_184122_1_ == 20) {
  30863. this.func_190521_a("debug.reload_resourcepacks.message", new Object[0]);
  30864. this.func_110436_a();
  30865. return true;
  30866. } else {
  30867. return false;
  30868. }
  30869. }
  30870.  
  30871. private void func_184117_aA() {
  30872. for(; this.field_71474_y.field_151457_aa.func_151468_f(); this.field_71438_f.func_174979_m()) {
  30873. ++this.field_71474_y.field_74320_O;
  30874. if(this.field_71474_y.field_74320_O > 2) {
  30875. this.field_71474_y.field_74320_O = 0;
  30876. }
  30877.  
  30878. if(this.field_71474_y.field_74320_O == 0) {
  30879. this.field_71460_t.func_175066_a(this.func_175606_aa());
  30880. } else if(this.field_71474_y.field_74320_O == 1) {
  30881. this.field_71460_t.func_175066_a((Entity)null);
  30882. }
  30883. }
  30884.  
  30885. while(this.field_71474_y.field_151458_ab.func_151468_f()) {
  30886. this.field_71474_y.field_74326_T = !this.field_71474_y.field_74326_T;
  30887. }
  30888.  
  30889. for(int int = 0; int < 9; ++int) {
  30890. boolean boolean = this.field_71474_y.field_193629_ap.func_151470_d();
  30891. boolean boolean = this.field_71474_y.field_193630_aq.func_151470_d();
  30892. if(this.field_71474_y.field_151456_ac[int].func_151468_f()) {
  30893. if(this.field_71439_g.func_175149_v()) {
  30894. this.field_71456_v.func_175187_g().func_175260_a(int);
  30895. } else if(!this.field_71439_g.func_184812_l_() || this.field_71462_r != null || !boolean && !boolean) {
  30896. this.field_71439_g.field_71071_by.field_70461_c = int;
  30897. } else {
  30898. GuiContainerCreative.func_192044_a(this, int, boolean, boolean);
  30899. }
  30900. }
  30901. }
  30902.  
  30903. while(this.field_71474_y.field_151445_Q.func_151468_f()) {
  30904. if(this.field_71442_b.func_110738_j()) {
  30905. this.field_71439_g.func_175163_u();
  30906. } else {
  30907. this.field_193035_aW.func_193296_a();
  30908. this.func_147108_a(new GuiInventory(this.field_71439_g));
  30909. }
  30910. }
  30911.  
  30912. while(this.field_71474_y.field_194146_ao.func_151468_f()) {
  30913. this.func_147108_a(new GuiScreenAdvancements(this.field_71439_g.field_71174_a.func_191982_f()));
  30914. }
  30915.  
  30916. while(this.field_71474_y.field_186718_X.func_151468_f()) {
  30917. if(!this.field_71439_g.func_175149_v()) {
  30918. this.func_147114_u().func_147297_a(new CPacketPlayerDigging(CPacketPlayerDigging.Action.SWAP_HELD_ITEMS, BlockPos.field_177992_a, EnumFacing.DOWN));
  30919. }
  30920. }
  30921.  
  30922. while(this.field_71474_y.field_74316_C.func_151468_f()) {
  30923. if(!this.field_71439_g.func_175149_v()) {
  30924. this.field_71439_g.func_71040_bB(GuiScreen.func_146271_m());
  30925. }
  30926. }
  30927.  
  30928. boolean boolean = this.field_71474_y.field_74343_n != EntityPlayer.EnumChatVisibility.HIDDEN;
  30929. if(boolean) {
  30930. while(this.field_71474_y.field_74310_D.func_151468_f()) {
  30931. this.func_147108_a(new GuiChat());
  30932. }
  30933.  
  30934. if(this.field_71462_r == null && this.field_71474_y.field_74323_J.func_151468_f()) {
  30935. this.func_147108_a(new GuiChat("/"));
  30936. }
  30937. }
  30938.  
  30939. if(this.field_71439_g.func_184587_cr()) {
  30940. if(!this.field_71474_y.field_74313_G.func_151470_d()) {
  30941. this.field_71442_b.func_78766_c(this.field_71439_g);
  30942. }
  30943.  
  30944. label556:
  30945. while(true) {
  30946. if(!this.field_71474_y.field_74312_F.func_151468_f()) {
  30947. while(this.field_71474_y.field_74313_G.func_151468_f()) {
  30948. ;
  30949. }
  30950.  
  30951. while(true) {
  30952. if(this.field_71474_y.field_74322_I.func_151468_f()) {
  30953. continue;
  30954. }
  30955. break label556;
  30956. }
  30957. }
  30958. }
  30959. } else {
  30960. while(this.field_71474_y.field_74312_F.func_151468_f()) {
  30961. this.func_147116_af();
  30962. }
  30963.  
  30964. while(this.field_71474_y.field_74313_G.func_151468_f()) {
  30965. this.func_147121_ag();
  30966. }
  30967.  
  30968. while(this.field_71474_y.field_74322_I.func_151468_f()) {
  30969. this.func_147112_ai();
  30970. }
  30971. }
  30972.  
  30973. if(this.field_71474_y.field_74313_G.func_151470_d() && this.field_71467_ac == 0 && !this.field_71439_g.func_184587_cr()) {
  30974. this.func_147121_ag();
  30975. }
  30976.  
  30977. this.func_147115_a(this.field_71462_r == null && this.field_71474_y.field_74312_F.func_151470_d() && this.field_71415_G);
  30978. }
  30979.  
  30980. private void func_184124_aB() throws IOException {
  30981. while(Mouse.next()) {
  30982. int int = Mouse.getEventButton();
  30983. KeyBinding.func_74510_a(int - 100, Mouse.getEventButtonState());
  30984. if(Mouse.getEventButtonState()) {
  30985. if(this.field_71439_g.func_175149_v() && int == 2) {
  30986. this.field_71456_v.func_175187_g().func_175261_b();
  30987. } else {
  30988. KeyBinding.func_74507_a(int - 100);
  30989. }
  30990. }
  30991.  
  30992. long long = func_71386_F() - this.field_71423_H;
  30993. if(long <= 200L) {
  30994. int int = Mouse.getEventDWheel();
  30995. if(int != 0) {
  30996. if(this.field_71439_g.func_175149_v()) {
  30997. int = int < 0?-1:1;
  30998. if(this.field_71456_v.func_175187_g().func_175262_a()) {
  30999. this.field_71456_v.func_175187_g().func_175259_b(-int);
  31000. } else {
  31001. float float = MathHelper.func_76131_a(this.field_71439_g.field_71075_bZ.func_75093_a() + (float)int * 0.005F, 0.0F, 0.2F);
  31002. this.field_71439_g.field_71075_bZ.func_75092_a(float);
  31003. }
  31004. } else {
  31005. this.field_71439_g.field_71071_by.func_70453_c(int);
  31006. }
  31007. }
  31008.  
  31009. if(this.field_71462_r == null) {
  31010. if(!this.field_71415_G && Mouse.getEventButtonState()) {
  31011. this.func_71381_h();
  31012. }
  31013. } else if(this.field_71462_r != null) {
  31014. this.field_71462_r.func_146274_d();
  31015. }
  31016. }
  31017. }
  31018.  
  31019. }
  31020.  
  31021. private void func_190521_a(String p_190521_1_, Object... p_190521_2_) {
  31022. this.field_71456_v.func_146158_b().func_146227_a((new TextComponentString("")).func_150257_a((new TextComponentTranslation("debug.prefix", new Object[0])).func_150255_a((new Style()).func_150238_a(TextFormatting.YELLOW).func_150227_a(Boolean.valueOf(true)))).func_150258_a(" ").func_150257_a(new TextComponentTranslation(p_190521_1_, p_190521_2_)));
  31023. }
  31024.  
  31025. public void func_71371_a(String p_71371_1_, String p_71371_2_, @Nullable WorldSettings p_71371_3_) {
  31026. this.func_71403_a((WorldClient)null);
  31027. System.gc();
  31028. ISaveHandler isavehandler = this.field_71469_aa.func_75804_a(p_71371_1_, false);
  31029. WorldInfo worldinfo = isavehandler.func_75757_d();
  31030. if(worldinfo == null && p_71371_3_ != null) {
  31031. worldinfo = new WorldInfo(p_71371_3_, p_71371_1_);
  31032. isavehandler.func_75761_a(worldinfo);
  31033. }
  31034.  
  31035. if(p_71371_3_ == null) {
  31036. p_71371_3_ = new WorldSettings(worldinfo);
  31037. }
  31038.  
  31039. try {
  31040. YggdrasilAuthenticationService yggdrasilauthenticationservice = new YggdrasilAuthenticationService(this.field_110453_aa, UUID.randomUUID().toString());
  31041. MinecraftSessionService minecraftsessionservice = yggdrasilauthenticationservice.createMinecraftSessionService();
  31042. GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository();
  31043. PlayerProfileCache playerprofilecache = new PlayerProfileCache(gameprofilerepository, new File(this.field_71412_D, MinecraftServer.field_152367_a.getName()));
  31044. TileEntitySkull.func_184293_a(playerprofilecache);
  31045. TileEntitySkull.func_184294_a(minecraftsessionservice);
  31046. PlayerProfileCache.func_187320_a(false);
  31047. this.field_71437_Z = new IntegratedServer(this, p_71371_1_, p_71371_2_, p_71371_3_, yggdrasilauthenticationservice, minecraftsessionservice, gameprofilerepository, playerprofilecache);
  31048. this.field_71437_Z.func_71256_s();
  31049. this.field_71455_al = true;
  31050. } catch (Throwable throwable) {
  31051. CrashReport crashreport = CrashReport.func_85055_a(throwable, "Starting integrated server");
  31052. CrashReportCategory crashreportcategory = crashreport.func_85058_a("Starting integrated server");
  31053. crashreportcategory.func_71507_a("Level ID", p_71371_1_);
  31054. crashreportcategory.func_71507_a("Level Name", p_71371_2_);
  31055. throw new ReportedException(crashreport);
  31056. }
  31057.  
  31058. this.field_71461_s.func_73720_a(I18n.func_135052_a("menu.loadingLevel", new Object[0]));
  31059.  
  31060. while(!this.field_71437_Z.func_71200_ad()) {
  31061. String string = this.field_71437_Z.func_71195_b_();
  31062. if(string != null) {
  31063. this.field_71461_s.func_73719_c(I18n.func_135052_a(string, new Object[0]));
  31064. } else {
  31065. this.field_71461_s.func_73719_c("");
  31066. }
  31067.  
  31068. try {
  31069. Thread.sleep(200L);
  31070. } catch (InterruptedException var10) {
  31071. ;
  31072. }
  31073. }
  31074.  
  31075. this.func_147108_a(new GuiScreenWorking());
  31076. SocketAddress socketaddress = this.field_71437_Z.func_147137_ag().func_151270_a();
  31077. NetworkManager networkmanager = NetworkManager.func_150722_a(socketaddress);
  31078. networkmanager.func_150719_a(new NetHandlerLoginClient(networkmanager, this, (GuiScreen)null));
  31079. networkmanager.func_179290_a(new C00Handshake(335, socketaddress.toString(), 0, EnumConnectionState.LOGIN));
  31080. networkmanager.func_179290_a(new CPacketLoginStart(this.func_110432_I().func_148256_e()));
  31081. this.field_71453_ak = networkmanager;
  31082. }
  31083.  
  31084. public void func_71403_a(@Nullable WorldClient p_71403_1_) {
  31085. this.func_71353_a(p_71403_1_, "");
  31086. }
  31087.  
  31088. public void func_71353_a(@Nullable WorldClient p_71353_1_, String p_71353_2_) {
  31089. if(p_71353_1_ == null) {
  31090. NetHandlerPlayClient nethandlerplayclient = this.func_147114_u();
  31091. if(nethandlerplayclient != null) {
  31092. nethandlerplayclient.func_147296_c();
  31093. }
  31094.  
  31095. if(this.field_71437_Z != null && this.field_71437_Z.func_175578_N()) {
  31096. this.field_71437_Z.func_71263_m();
  31097. }
  31098.  
  31099. this.field_71437_Z = null;
  31100. this.field_71460_t.func_190564_k();
  31101. this.field_71442_b = null;
  31102. NarratorChatListener.field_193643_a.func_193642_b();
  31103. }
  31104.  
  31105. this.field_175622_Z = null;
  31106. this.field_71453_ak = null;
  31107. if(this.field_71461_s != null) {
  31108. this.field_71461_s.func_73721_b(p_71353_2_);
  31109. this.field_71461_s.func_73719_c("");
  31110. }
  31111.  
  31112. if(p_71353_1_ == null && this.field_71441_e != null) {
  31113. this.field_110448_aq.func_148529_f();
  31114. this.field_71456_v.func_181029_i();
  31115. this.func_71351_a((ServerData)null);
  31116. this.field_71455_al = false;
  31117. }
  31118.  
  31119. this.field_147127_av.func_147690_c();
  31120. this.field_71441_e = p_71353_1_;
  31121. if(this.field_71438_f != null) {
  31122. this.field_71438_f.func_72732_a(p_71353_1_);
  31123. }
  31124.  
  31125. if(this.field_71452_i != null) {
  31126. this.field_71452_i.func_78870_a(p_71353_1_);
  31127. }
  31128.  
  31129. TileEntityRendererDispatcher.field_147556_a.func_147543_a(p_71353_1_);
  31130. if(p_71353_1_ != null) {
  31131. if(!this.field_71455_al) {
  31132. AuthenticationService authenticationservice = new YggdrasilAuthenticationService(this.field_110453_aa, UUID.randomUUID().toString());
  31133. MinecraftSessionService minecraftsessionservice = authenticationservice.createMinecraftSessionService();
  31134. GameProfileRepository gameprofilerepository = authenticationservice.createProfileRepository();
  31135. PlayerProfileCache playerprofilecache = new PlayerProfileCache(gameprofilerepository, new File(this.field_71412_D, MinecraftServer.field_152367_a.getName()));
  31136. TileEntitySkull.func_184293_a(playerprofilecache);
  31137. TileEntitySkull.func_184294_a(minecraftsessionservice);
  31138. PlayerProfileCache.func_187320_a(false);
  31139. }
  31140.  
  31141. if(this.field_71439_g == null) {
  31142. this.field_71439_g = this.field_71442_b.func_192830_a(p_71353_1_, new StatisticsManager(), new RecipeBookClient());
  31143. this.field_71442_b.func_78745_b(this.field_71439_g);
  31144. }
  31145.  
  31146. this.field_71439_g.func_70065_x();
  31147. p_71353_1_.func_72838_d(this.field_71439_g);
  31148. this.field_71439_g.field_71158_b = new MovementInputFromOptions(this.field_71474_y);
  31149. this.field_71442_b.func_78748_a(this.field_71439_g);
  31150. this.field_175622_Z = this.field_71439_g;
  31151. } else {
  31152. this.field_71469_aa.func_75800_d();
  31153. this.field_71439_g = null;
  31154. }
  31155.  
  31156. System.gc();
  31157. this.field_71423_H = 0L;
  31158. }
  31159.  
  31160. public void func_71354_a(int p_71354_1_) {
  31161. this.field_71441_e.func_72974_f();
  31162. this.field_71441_e.func_73022_a();
  31163. int int = 0;
  31164. String string = null;
  31165. if(this.field_71439_g != null) {
  31166. int = this.field_71439_g.func_145782_y();
  31167. this.field_71441_e.func_72900_e(this.field_71439_g);
  31168. string = this.field_71439_g.func_142021_k();
  31169. }
  31170.  
  31171. this.field_175622_Z = null;
  31172. EntityPlayerSP entityplayersp = this.field_71439_g;
  31173. this.field_71439_g = this.field_71442_b.func_192830_a(this.field_71441_e, this.field_71439_g == null?new StatisticsManager():this.field_71439_g.func_146107_m(), this.field_71439_g == null?new RecipeBook():this.field_71439_g.func_192035_E());
  31174. this.field_71439_g.func_184212_Q().func_187218_a(entityplayersp.func_184212_Q().func_187231_c());
  31175. this.field_71439_g.field_71093_bK = p_71354_1_;
  31176. this.field_175622_Z = this.field_71439_g;
  31177. this.field_71439_g.func_70065_x();
  31178. this.field_71439_g.func_175158_f(string);
  31179. this.field_71441_e.func_72838_d(this.field_71439_g);
  31180. this.field_71442_b.func_78745_b(this.field_71439_g);
  31181. this.field_71439_g.field_71158_b = new MovementInputFromOptions(this.field_71474_y);
  31182. this.field_71439_g.func_145769_d(int);
  31183. this.field_71442_b.func_78748_a(this.field_71439_g);
  31184. this.field_71439_g.func_175150_k(entityplayersp.func_175140_cp());
  31185. if(this.field_71462_r instanceof GuiGameOver) {
  31186. this.func_147108_a((GuiScreen)null);
  31187. }
  31188.  
  31189. }
  31190.  
  31191. public final boolean func_71355_q() {
  31192. return this.field_71459_aj;
  31193. }
  31194.  
  31195. @Nullable
  31196. public NetHandlerPlayClient func_147114_u() {
  31197. return this.field_71439_g == null?null:this.field_71439_g.field_71174_a;
  31198. }
  31199.  
  31200. public static boolean func_71382_s() {
  31201. return field_71432_P == null || !field_71432_P.field_71474_y.field_74319_N;
  31202. }
  31203.  
  31204. public static boolean func_71375_t() {
  31205. return field_71432_P != null && field_71432_P.field_71474_y.field_74347_j;
  31206. }
  31207.  
  31208. public static boolean func_71379_u() {
  31209. return field_71432_P != null && field_71432_P.field_71474_y.field_74348_k != 0;
  31210. }
  31211.  
  31212. private void func_147112_ai() {
  31213. if(this.field_71476_x != null && this.field_71476_x.field_72313_a != RayTraceResult.Type.MISS) {
  31214. boolean boolean = this.field_71439_g.field_71075_bZ.field_75098_d;
  31215. TileEntity tileentity = null;
  31216. ItemStack itemstack;
  31217. if(this.field_71476_x.field_72313_a == RayTraceResult.Type.BLOCK) {
  31218. BlockPos blockpos = this.field_71476_x.func_178782_a();
  31219. IBlockState iblockstate = this.field_71441_e.func_180495_p(blockpos);
  31220. Block block = iblockstate.func_177230_c();
  31221. if(iblockstate.func_185904_a() == Material.field_151579_a) {
  31222. return;
  31223. }
  31224.  
  31225. itemstack = block.func_185473_a(this.field_71441_e, blockpos, iblockstate);
  31226. if(itemstack.func_190926_b()) {
  31227. return;
  31228. }
  31229.  
  31230. if(boolean && GuiScreen.func_146271_m() && block.func_149716_u()) {
  31231. tileentity = this.field_71441_e.func_175625_s(blockpos);
  31232. }
  31233. } else {
  31234. if(this.field_71476_x.field_72313_a != RayTraceResult.Type.ENTITY || this.field_71476_x.field_72308_g == null || !boolean) {
  31235. return;
  31236. }
  31237.  
  31238. if(this.field_71476_x.field_72308_g instanceof EntityPainting) {
  31239. itemstack = new ItemStack(Items.field_151159_an);
  31240. } else if(this.field_71476_x.field_72308_g instanceof EntityLeashKnot) {
  31241. itemstack = new ItemStack(Items.field_151058_ca);
  31242. } else if(this.field_71476_x.field_72308_g instanceof EntityItemFrame) {
  31243. EntityItemFrame entityitemframe = (EntityItemFrame)this.field_71476_x.field_72308_g;
  31244. ItemStack itemstack1 = entityitemframe.func_82335_i();
  31245. if(itemstack1.func_190926_b()) {
  31246. itemstack = new ItemStack(Items.field_151160_bD);
  31247. } else {
  31248. itemstack = itemstack1.func_77946_l();
  31249. }
  31250. } else if(this.field_71476_x.field_72308_g instanceof EntityMinecart) {
  31251. EntityMinecart entityminecart = (EntityMinecart)this.field_71476_x.field_72308_g;
  31252. Item item;
  31253. switch(entityminecart.func_184264_v()) {
  31254. case FURNACE:
  31255. item = Items.field_151109_aJ;
  31256. break;
  31257. case CHEST:
  31258. item = Items.field_151108_aI;
  31259. break;
  31260. case TNT:
  31261. item = Items.field_151142_bV;
  31262. break;
  31263. case HOPPER:
  31264. item = Items.field_151140_bW;
  31265. break;
  31266. case COMMAND_BLOCK:
  31267. item = Items.field_151095_cc;
  31268. break;
  31269. default:
  31270. item = Items.field_151143_au;
  31271. }
  31272.  
  31273. itemstack = new ItemStack(item);
  31274. } else if(this.field_71476_x.field_72308_g instanceof EntityBoat) {
  31275. itemstack = new ItemStack(((EntityBoat)this.field_71476_x.field_72308_g).func_184455_j());
  31276. } else if(this.field_71476_x.field_72308_g instanceof EntityArmorStand) {
  31277. itemstack = new ItemStack(Items.field_179565_cj);
  31278. } else if(this.field_71476_x.field_72308_g instanceof EntityEnderCrystal) {
  31279. itemstack = new ItemStack(Items.field_185158_cP);
  31280. } else {
  31281. ResourceLocation resourcelocation = EntityList.func_191301_a(this.field_71476_x.field_72308_g);
  31282. if(resourcelocation == null || !EntityList.field_75627_a.containsKey(resourcelocation)) {
  31283. return;
  31284. }
  31285.  
  31286. itemstack = new ItemStack(Items.field_151063_bx);
  31287. ItemMonsterPlacer.func_185078_a(itemstack, resourcelocation);
  31288. }
  31289. }
  31290.  
  31291. if(itemstack.func_190926_b()) {
  31292. String string = "";
  31293. if(this.field_71476_x.field_72313_a == RayTraceResult.Type.BLOCK) {
  31294. string = ((ResourceLocation)Block.field_149771_c.func_177774_c(this.field_71441_e.func_180495_p(this.field_71476_x.func_178782_a()).func_177230_c())).toString();
  31295. } else if(this.field_71476_x.field_72313_a == RayTraceResult.Type.ENTITY) {
  31296. string = EntityList.func_191301_a(this.field_71476_x.field_72308_g).toString();
  31297. }
  31298.  
  31299. field_147123_G.warn((String)"Picking on: [{}] {} gave null item", (Object)this.field_71476_x.field_72313_a, (Object)string);
  31300. } else {
  31301. InventoryPlayer inventoryplayer = this.field_71439_g.field_71071_by;
  31302. if(tileentity != null) {
  31303. this.func_184119_a(itemstack, tileentity);
  31304. }
  31305.  
  31306. int int = inventoryplayer.func_184429_b(itemstack);
  31307. if(boolean) {
  31308. inventoryplayer.func_184434_a(itemstack);
  31309. this.field_71442_b.func_78761_a(this.field_71439_g.func_184586_b(EnumHand.MAIN_HAND), 36 + inventoryplayer.field_70461_c);
  31310. } else if(int != -1) {
  31311. if(InventoryPlayer.func_184435_e(int)) {
  31312. inventoryplayer.field_70461_c = int;
  31313. } else {
  31314. this.field_71442_b.func_187100_a(int);
  31315. }
  31316. }
  31317.  
  31318. }
  31319. }
  31320. }
  31321.  
  31322. public ItemStack func_184119_a(ItemStack p_184119_1_, TileEntity p_184119_2_) {
  31323. NBTTagCompound nbttagcompound = p_184119_2_.func_189515_b(new NBTTagCompound());
  31324. if(p_184119_1_.func_77973_b() == Items.field_151144_bL && nbttagcompound.func_74764_b("Owner")) {
  31325. NBTTagCompound nbttagcompound2 = nbttagcompound.func_74775_l("Owner");
  31326. NBTTagCompound nbttagcompound3 = new NBTTagCompound();
  31327. nbttagcompound3.func_74782_a("SkullOwner", nbttagcompound2);
  31328. p_184119_1_.func_77982_d(nbttagcompound3);
  31329. return p_184119_1_;
  31330. } else {
  31331. p_184119_1_.func_77983_a("BlockEntityTag", nbttagcompound);
  31332. NBTTagCompound nbttagcompound1 = new NBTTagCompound();
  31333. NBTTagList nbttaglist = new NBTTagList();
  31334. nbttaglist.func_74742_a(new NBTTagString("(+NBT)"));
  31335. nbttagcompound1.func_74782_a("Lore", nbttaglist);
  31336. p_184119_1_.func_77983_a("display", nbttagcompound1);
  31337. return p_184119_1_;
  31338. }
  31339. }
  31340.  
  31341. public CrashReport func_71396_d(CrashReport p_71396_1_) {
  31342. p_71396_1_.func_85056_g().func_189529_a("Launched Version", new ICrashReportDetail<String>() {
  31343. public String call() throws Exception {
  31344. return Minecraft.this.field_110447_Z;
  31345. }
  31346. });
  31347. p_71396_1_.func_85056_g().func_189529_a("LWJGL", new ICrashReportDetail<String>() {
  31348. public String call() throws Exception {
  31349. return Sys.getVersion();
  31350. }
  31351. });
  31352. p_71396_1_.func_85056_g().func_189529_a("OpenGL", new ICrashReportDetail<String>() {
  31353. public String call() {
  31354. return GlStateManager.func_187416_u(7937) + " GL version " + GlStateManager.func_187416_u(7938) + ", " + GlStateManager.func_187416_u(7936);
  31355. }
  31356. });
  31357. p_71396_1_.func_85056_g().func_189529_a("GL Caps", new ICrashReportDetail<String>() {
  31358. public String call() {
  31359. return OpenGlHelper.func_153172_c();
  31360. }
  31361. });
  31362. p_71396_1_.func_85056_g().func_189529_a("Using VBOs", new ICrashReportDetail<String>() {
  31363. public String call() {
  31364. return Minecraft.this.field_71474_y.field_178881_t?"Yes":"No";
  31365. }
  31366. });
  31367. p_71396_1_.func_85056_g().func_189529_a("Is Modded", new ICrashReportDetail<String>() {
  31368. public String call() throws Exception {
  31369. String string = ClientBrandRetriever.getClientModName();
  31370. return !"vanilla".equals(string)?"Definitely; Client brand changed to \'" + string + "\'":(Minecraft.class.getSigners() == null?"Very likely; Jar signature invalidated":"Probably not. Jar signature remains and client brand is untouched.");
  31371. }
  31372. });
  31373. p_71396_1_.func_85056_g().func_189529_a("Type", new ICrashReportDetail<String>() {
  31374. public String call() throws Exception {
  31375. return "Client (map_client.txt)";
  31376. }
  31377. });
  31378. p_71396_1_.func_85056_g().func_189529_a("Resource Packs", new ICrashReportDetail<String>() {
  31379. public String call() throws Exception {
  31380. StringBuilder stringbuilder = new StringBuilder();
  31381.  
  31382. for(String string : Minecraft.this.field_71474_y.field_151453_l) {
  31383. if(stringbuilder.length() > 0) {
  31384. stringbuilder.append(", ");
  31385. }
  31386.  
  31387. stringbuilder.append(string);
  31388. if(Minecraft.this.field_71474_y.field_183018_l.contains(string)) {
  31389. stringbuilder.append(" (incompatible)");
  31390. }
  31391. }
  31392.  
  31393. return stringbuilder.toString();
  31394. }
  31395. });
  31396. p_71396_1_.func_85056_g().func_189529_a("Current Language", new ICrashReportDetail<String>() {
  31397. public String call() throws Exception {
  31398. return Minecraft.this.field_135017_as.func_135041_c().toString();
  31399. }
  31400. });
  31401. p_71396_1_.func_85056_g().func_189529_a("Profiler Position", new ICrashReportDetail<String>() {
  31402. public String call() throws Exception {
  31403. return Minecraft.this.field_71424_I.field_76327_a?Minecraft.this.field_71424_I.func_76322_c():"N/A (disabled)";
  31404. }
  31405. });
  31406. p_71396_1_.func_85056_g().func_189529_a("CPU", new ICrashReportDetail<String>() {
  31407. public String call() throws Exception {
  31408. return OpenGlHelper.func_183029_j();
  31409. }
  31410. });
  31411. if(this.field_71441_e != null) {
  31412. this.field_71441_e.func_72914_a(p_71396_1_);
  31413. }
  31414.  
  31415. return p_71396_1_;
  31416. }
  31417.  
  31418. public static Minecraft func_71410_x() {
  31419. return field_71432_P;
  31420. }
  31421.  
  31422. public ListenableFuture<Object> func_175603_A() {
  31423. return this.func_152344_a(new Runnable() {
  31424. public void run() {
  31425. Minecraft.this.func_110436_a();
  31426. }
  31427. });
  31428. }
  31429.  
  31430. public void func_70000_a(Snooper p_70000_1_) {
  31431. p_70000_1_.func_152768_a("fps", Integer.valueOf(field_71470_ab));
  31432. p_70000_1_.func_152768_a("vsync_enabled", Boolean.valueOf(this.field_71474_y.field_74352_v));
  31433. p_70000_1_.func_152768_a("display_frequency", Integer.valueOf(Display.getDisplayMode().getFrequency()));
  31434. p_70000_1_.func_152768_a("display_type", this.field_71431_Q?"fullscreen":"windowed");
  31435. p_70000_1_.func_152768_a("run_time", Long.valueOf((MinecraftServer.func_130071_aq() - p_70000_1_.func_130105_g()) / 60L * 1000L));
  31436. p_70000_1_.func_152768_a("current_action", this.func_181538_aA());
  31437. p_70000_1_.func_152768_a("language", this.field_71474_y.field_74363_ab == null?"en_us":this.field_71474_y.field_74363_ab);
  31438. String string = ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN?"little":"big";
  31439. p_70000_1_.func_152768_a("endianness", string);
  31440. p_70000_1_.func_152768_a("subtitles", Boolean.valueOf(this.field_71474_y.field_186717_N));
  31441. p_70000_1_.func_152768_a("touch", this.field_71474_y.field_85185_A?"touch":"mouse");
  31442. p_70000_1_.func_152768_a("resource_packs", Integer.valueOf(this.field_110448_aq.func_110613_c().size()));
  31443. int int = 0;
  31444.  
  31445. for(ResourcePackRepository.Entry resourcepackrepository$entry : this.field_110448_aq.func_110613_c()) {
  31446. p_70000_1_.func_152768_a("resource_pack[" + int++ + "]", resourcepackrepository$entry.func_110515_d());
  31447. }
  31448.  
  31449. if(this.field_71437_Z != null && this.field_71437_Z.func_80003_ah() != null) {
  31450. p_70000_1_.func_152768_a("snooper_partner", this.field_71437_Z.func_80003_ah().func_80006_f());
  31451. }
  31452.  
  31453. }
  31454.  
  31455. private String func_181538_aA() {
  31456. return this.field_71437_Z != null?(this.field_71437_Z.func_71344_c()?"hosting_lan":"singleplayer"):(this.field_71422_O != null?(this.field_71422_O.func_181041_d()?"playing_lan":"multiplayer"):"out_of_game");
  31457. }
  31458.  
  31459. public void func_70001_b(Snooper p_70001_1_) {
  31460. p_70001_1_.func_152767_b("opengl_version", GlStateManager.func_187416_u(7938));
  31461. p_70001_1_.func_152767_b("opengl_vendor", GlStateManager.func_187416_u(7936));
  31462. p_70001_1_.func_152767_b("client_brand", ClientBrandRetriever.getClientModName());
  31463. p_70001_1_.func_152767_b("launched_version", this.field_110447_Z);
  31464. ContextCapabilities contextcapabilities = GLContext.getCapabilities();
  31465. p_70001_1_.func_152767_b("gl_caps[ARB_arrays_of_arrays]", Boolean.valueOf(contextcapabilities.GL_ARB_arrays_of_arrays));
  31466. p_70001_1_.func_152767_b("gl_caps[ARB_base_instance]", Boolean.valueOf(contextcapabilities.GL_ARB_base_instance));
  31467. p_70001_1_.func_152767_b("gl_caps[ARB_blend_func_extended]", Boolean.valueOf(contextcapabilities.GL_ARB_blend_func_extended));
  31468. p_70001_1_.func_152767_b("gl_caps[ARB_clear_buffer_object]", Boolean.valueOf(contextcapabilities.GL_ARB_clear_buffer_object));
  31469. p_70001_1_.func_152767_b("gl_caps[ARB_color_buffer_float]", Boolean.valueOf(contextcapabilities.GL_ARB_color_buffer_float));
  31470. p_70001_1_.func_152767_b("gl_caps[ARB_compatibility]", Boolean.valueOf(contextcapabilities.GL_ARB_compatibility));
  31471. p_70001_1_.func_152767_b("gl_caps[ARB_compressed_texture_pixel_storage]", Boolean.valueOf(contextcapabilities.GL_ARB_compressed_texture_pixel_storage));
  31472. p_70001_1_.func_152767_b("gl_caps[ARB_compute_shader]", Boolean.valueOf(contextcapabilities.GL_ARB_compute_shader));
  31473. p_70001_1_.func_152767_b("gl_caps[ARB_copy_buffer]", Boolean.valueOf(contextcapabilities.GL_ARB_copy_buffer));
  31474. p_70001_1_.func_152767_b("gl_caps[ARB_copy_image]", Boolean.valueOf(contextcapabilities.GL_ARB_copy_image));
  31475. p_70001_1_.func_152767_b("gl_caps[ARB_depth_buffer_float]", Boolean.valueOf(contextcapabilities.GL_ARB_depth_buffer_float));
  31476. p_70001_1_.func_152767_b("gl_caps[ARB_compute_shader]", Boolean.valueOf(contextcapabilities.GL_ARB_compute_shader));
  31477. p_70001_1_.func_152767_b("gl_caps[ARB_copy_buffer]", Boolean.valueOf(contextcapabilities.GL_ARB_copy_buffer));
  31478. p_70001_1_.func_152767_b("gl_caps[ARB_copy_image]", Boolean.valueOf(contextcapabilities.GL_ARB_copy_image));
  31479. p_70001_1_.func_152767_b("gl_caps[ARB_depth_buffer_float]", Boolean.valueOf(contextcapabilities.GL_ARB_depth_buffer_float));
  31480. p_70001_1_.func_152767_b("gl_caps[ARB_depth_clamp]", Boolean.valueOf(contextcapabilities.GL_ARB_depth_clamp));
  31481. p_70001_1_.func_152767_b("gl_caps[ARB_depth_texture]", Boolean.valueOf(contextcapabilities.GL_ARB_depth_texture));
  31482. p_70001_1_.func_152767_b("gl_caps[ARB_draw_buffers]", Boolean.valueOf(contextcapabilities.GL_ARB_draw_buffers));
  31483. p_70001_1_.func_152767_b("gl_caps[ARB_draw_buffers_blend]", Boolean.valueOf(contextcapabilities.GL_ARB_draw_buffers_blend));
  31484. p_70001_1_.func_152767_b("gl_caps[ARB_draw_elements_base_vertex]", Boolean.valueOf(contextcapabilities.GL_ARB_draw_elements_base_vertex));
  31485. p_70001_1_.func_152767_b("gl_caps[ARB_draw_indirect]", Boolean.valueOf(contextcapabilities.GL_ARB_draw_indirect));
  31486. p_70001_1_.func_152767_b("gl_caps[ARB_draw_instanced]", Boolean.valueOf(contextcapabilities.GL_ARB_draw_instanced));
  31487. p_70001_1_.func_152767_b("gl_caps[ARB_explicit_attrib_location]", Boolean.valueOf(contextcapabilities.GL_ARB_explicit_attrib_location));
  31488. p_70001_1_.func_152767_b("gl_caps[ARB_explicit_uniform_location]", Boolean.valueOf(contextcapabilities.GL_ARB_explicit_uniform_location));
  31489. p_70001_1_.func_152767_b("gl_caps[ARB_fragment_layer_viewport]", Boolean.valueOf(contextcapabilities.GL_ARB_fragment_layer_viewport));
  31490. p_70001_1_.func_152767_b("gl_caps[ARB_fragment_program]", Boolean.valueOf(contextcapabilities.GL_ARB_fragment_program));
  31491. p_70001_1_.func_152767_b("gl_caps[ARB_fragment_shader]", Boolean.valueOf(contextcapabilities.GL_ARB_fragment_shader));
  31492. p_70001_1_.func_152767_b("gl_caps[ARB_fragment_program_shadow]", Boolean.valueOf(contextcapabilities.GL_ARB_fragment_program_shadow));
  31493. p_70001_1_.func_152767_b("gl_caps[ARB_framebuffer_object]", Boolean.valueOf(contextcapabilities.GL_ARB_framebuffer_object));
  31494. p_70001_1_.func_152767_b("gl_caps[ARB_framebuffer_sRGB]", Boolean.valueOf(contextcapabilities.GL_ARB_framebuffer_sRGB));
  31495. p_70001_1_.func_152767_b("gl_caps[ARB_geometry_shader4]", Boolean.valueOf(contextcapabilities.GL_ARB_geometry_shader4));
  31496. p_70001_1_.func_152767_b("gl_caps[ARB_gpu_shader5]", Boolean.valueOf(contextcapabilities.GL_ARB_gpu_shader5));
  31497. p_70001_1_.func_152767_b("gl_caps[ARB_half_float_pixel]", Boolean.valueOf(contextcapabilities.GL_ARB_half_float_pixel));
  31498. p_70001_1_.func_152767_b("gl_caps[ARB_half_float_vertex]", Boolean.valueOf(contextcapabilities.GL_ARB_half_float_vertex));
  31499. p_70001_1_.func_152767_b("gl_caps[ARB_instanced_arrays]", Boolean.valueOf(contextcapabilities.GL_ARB_instanced_arrays));
  31500. p_70001_1_.func_152767_b("gl_caps[ARB_map_buffer_alignment]", Boolean.valueOf(contextcapabilities.GL_ARB_map_buffer_alignment));
  31501. p_70001_1_.func_152767_b("gl_caps[ARB_map_buffer_range]", Boolean.valueOf(contextcapabilities.GL_ARB_map_buffer_range));
  31502. p_70001_1_.func_152767_b("gl_caps[ARB_multisample]", Boolean.valueOf(contextcapabilities.GL_ARB_multisample));
  31503. p_70001_1_.func_152767_b("gl_caps[ARB_multitexture]", Boolean.valueOf(contextcapabilities.GL_ARB_multitexture));
  31504. p_70001_1_.func_152767_b("gl_caps[ARB_occlusion_query2]", Boolean.valueOf(contextcapabilities.GL_ARB_occlusion_query2));
  31505. p_70001_1_.func_152767_b("gl_caps[ARB_pixel_buffer_object]", Boolean.valueOf(contextcapabilities.GL_ARB_pixel_buffer_object));
  31506. p_70001_1_.func_152767_b("gl_caps[ARB_seamless_cube_map]", Boolean.valueOf(contextcapabilities.GL_ARB_seamless_cube_map));
  31507. p_70001_1_.func_152767_b("gl_caps[ARB_shader_objects]", Boolean.valueOf(contextcapabilities.GL_ARB_shader_objects));
  31508. p_70001_1_.func_152767_b("gl_caps[ARB_shader_stencil_export]", Boolean.valueOf(contextcapabilities.GL_ARB_shader_stencil_export));
  31509. p_70001_1_.func_152767_b("gl_caps[ARB_shader_texture_lod]", Boolean.valueOf(contextcapabilities.GL_ARB_shader_texture_lod));
  31510. p_70001_1_.func_152767_b("gl_caps[ARB_shadow]", Boolean.valueOf(contextcapabilities.GL_ARB_shadow));
  31511. p_70001_1_.func_152767_b("gl_caps[ARB_shadow_ambient]", Boolean.valueOf(contextcapabilities.GL_ARB_shadow_ambient));
  31512. p_70001_1_.func_152767_b("gl_caps[ARB_stencil_texturing]", Boolean.valueOf(contextcapabilities.GL_ARB_stencil_texturing));
  31513. p_70001_1_.func_152767_b("gl_caps[ARB_sync]", Boolean.valueOf(contextcapabilities.GL_ARB_sync));
  31514. p_70001_1_.func_152767_b("gl_caps[ARB_tessellation_shader]", Boolean.valueOf(contextcapabilities.GL_ARB_tessellation_shader));
  31515. p_70001_1_.func_152767_b("gl_caps[ARB_texture_border_clamp]", Boolean.valueOf(contextcapabilities.GL_ARB_texture_border_clamp));
  31516. p_70001_1_.func_152767_b("gl_caps[ARB_texture_buffer_object]", Boolean.valueOf(contextcapabilities.GL_ARB_texture_buffer_object));
  31517. p_70001_1_.func_152767_b("gl_caps[ARB_texture_cube_map]", Boolean.valueOf(contextcapabilities.GL_ARB_texture_cube_map));
  31518. p_70001_1_.func_152767_b("gl_caps[ARB_texture_cube_map_array]", Boolean.valueOf(contextcapabilities.GL_ARB_texture_cube_map_array));
  31519. p_70001_1_.func_152767_b("gl_caps[ARB_texture_non_power_of_two]", Boolean.valueOf(contextcapabilities.GL_ARB_texture_non_power_of_two));
  31520. p_70001_1_.func_152767_b("gl_caps[ARB_uniform_buffer_object]", Boolean.valueOf(contextcapabilities.GL_ARB_uniform_buffer_object));
  31521. p_70001_1_.func_152767_b("gl_caps[ARB_vertex_blend]", Boolean.valueOf(contextcapabilities.GL_ARB_vertex_blend));
  31522. p_70001_1_.func_152767_b("gl_caps[ARB_vertex_buffer_object]", Boolean.valueOf(contextcapabilities.GL_ARB_vertex_buffer_object));
  31523. p_70001_1_.func_152767_b("gl_caps[ARB_vertex_program]", Boolean.valueOf(contextcapabilities.GL_ARB_vertex_program));
  31524. p_70001_1_.func_152767_b("gl_caps[ARB_vertex_shader]", Boolean.valueOf(contextcapabilities.GL_ARB_vertex_shader));
  31525. p_70001_1_.func_152767_b("gl_caps[EXT_bindable_uniform]", Boolean.valueOf(contextcapabilities.GL_EXT_bindable_uniform));
  31526. p_70001_1_.func_152767_b("gl_caps[EXT_blend_equation_separate]", Boolean.valueOf(contextcapabilities.GL_EXT_blend_equation_separate));
  31527. p_70001_1_.func_152767_b("gl_caps[EXT_blend_func_separate]", Boolean.valueOf(contextcapabilities.GL_EXT_blend_func_separate));
  31528. p_70001_1_.func_152767_b("gl_caps[EXT_blend_minmax]", Boolean.valueOf(contextcapabilities.GL_EXT_blend_minmax));
  31529. p_70001_1_.func_152767_b("gl_caps[EXT_blend_subtract]", Boolean.valueOf(contextcapabilities.GL_EXT_blend_subtract));
  31530. p_70001_1_.func_152767_b("gl_caps[EXT_draw_instanced]", Boolean.valueOf(contextcapabilities.GL_EXT_draw_instanced));
  31531. p_70001_1_.func_152767_b("gl_caps[EXT_framebuffer_multisample]", Boolean.valueOf(contextcapabilities.GL_EXT_framebuffer_multisample));
  31532. p_70001_1_.func_152767_b("gl_caps[EXT_framebuffer_object]", Boolean.valueOf(contextcapabilities.GL_EXT_framebuffer_object));
  31533. p_70001_1_.func_152767_b("gl_caps[EXT_framebuffer_sRGB]", Boolean.valueOf(contextcapabilities.GL_EXT_framebuffer_sRGB));
  31534. p_70001_1_.func_152767_b("gl_caps[EXT_geometry_shader4]", Boolean.valueOf(contextcapabilities.GL_EXT_geometry_shader4));
  31535. p_70001_1_.func_152767_b("gl_caps[EXT_gpu_program_parameters]", Boolean.valueOf(contextcapabilities.GL_EXT_gpu_program_parameters));
  31536. p_70001_1_.func_152767_b("gl_caps[EXT_gpu_shader4]", Boolean.valueOf(contextcapabilities.GL_EXT_gpu_shader4));
  31537. p_70001_1_.func_152767_b("gl_caps[EXT_multi_draw_arrays]", Boolean.valueOf(contextcapabilities.GL_EXT_multi_draw_arrays));
  31538. p_70001_1_.func_152767_b("gl_caps[EXT_packed_depth_stencil]", Boolean.valueOf(contextcapabilities.GL_EXT_packed_depth_stencil));
  31539. p_70001_1_.func_152767_b("gl_caps[EXT_paletted_texture]", Boolean.valueOf(contextcapabilities.GL_EXT_paletted_texture));
  31540. p_70001_1_.func_152767_b("gl_caps[EXT_rescale_normal]", Boolean.valueOf(contextcapabilities.GL_EXT_rescale_normal));
  31541. p_70001_1_.func_152767_b("gl_caps[EXT_separate_shader_objects]", Boolean.valueOf(contextcapabilities.GL_EXT_separate_shader_objects));
  31542. p_70001_1_.func_152767_b("gl_caps[EXT_shader_image_load_store]", Boolean.valueOf(contextcapabilities.GL_EXT_shader_image_load_store));
  31543. p_70001_1_.func_152767_b("gl_caps[EXT_shadow_funcs]", Boolean.valueOf(contextcapabilities.GL_EXT_shadow_funcs));
  31544. p_70001_1_.func_152767_b("gl_caps[EXT_shared_texture_palette]", Boolean.valueOf(contextcapabilities.GL_EXT_shared_texture_palette));
  31545. p_70001_1_.func_152767_b("gl_caps[EXT_stencil_clear_tag]", Boolean.valueOf(contextcapabilities.GL_EXT_stencil_clear_tag));
  31546. p_70001_1_.func_152767_b("gl_caps[EXT_stencil_two_side]", Boolean.valueOf(contextcapabilities.GL_EXT_stencil_two_side));
  31547. p_70001_1_.func_152767_b("gl_caps[EXT_stencil_wrap]", Boolean.valueOf(contextcapabilities.GL_EXT_stencil_wrap));
  31548. p_70001_1_.func_152767_b("gl_caps[EXT_texture_3d]", Boolean.valueOf(contextcapabilities.GL_EXT_texture_3d));
  31549. p_70001_1_.func_152767_b("gl_caps[EXT_texture_array]", Boolean.valueOf(contextcapabilities.GL_EXT_texture_array));
  31550. p_70001_1_.func_152767_b("gl_caps[EXT_texture_buffer_object]", Boolean.valueOf(contextcapabilities.GL_EXT_texture_buffer_object));
  31551. p_70001_1_.func_152767_b("gl_caps[EXT_texture_integer]", Boolean.valueOf(contextcapabilities.GL_EXT_texture_integer));
  31552. p_70001_1_.func_152767_b("gl_caps[EXT_texture_lod_bias]", Boolean.valueOf(contextcapabilities.GL_EXT_texture_lod_bias));
  31553. p_70001_1_.func_152767_b("gl_caps[EXT_texture_sRGB]", Boolean.valueOf(contextcapabilities.GL_EXT_texture_sRGB));
  31554. p_70001_1_.func_152767_b("gl_caps[EXT_vertex_shader]", Boolean.valueOf(contextcapabilities.GL_EXT_vertex_shader));
  31555. p_70001_1_.func_152767_b("gl_caps[EXT_vertex_weighting]", Boolean.valueOf(contextcapabilities.GL_EXT_vertex_weighting));
  31556. p_70001_1_.func_152767_b("gl_caps[gl_max_vertex_uniforms]", Integer.valueOf(GlStateManager.func_187397_v('\u8b4a')));
  31557. GlStateManager.func_187434_L();
  31558. p_70001_1_.func_152767_b("gl_caps[gl_max_fragment_uniforms]", Integer.valueOf(GlStateManager.func_187397_v('\u8b49')));
  31559. GlStateManager.func_187434_L();
  31560. p_70001_1_.func_152767_b("gl_caps[gl_max_vertex_attribs]", Integer.valueOf(GlStateManager.func_187397_v('\u8869')));
  31561. GlStateManager.func_187434_L();
  31562. p_70001_1_.func_152767_b("gl_caps[gl_max_vertex_texture_image_units]", Integer.valueOf(GlStateManager.func_187397_v('\u8b4c')));
  31563. GlStateManager.func_187434_L();
  31564. p_70001_1_.func_152767_b("gl_caps[gl_max_texture_image_units]", Integer.valueOf(GlStateManager.func_187397_v('\u8872')));
  31565. GlStateManager.func_187434_L();
  31566. p_70001_1_.func_152767_b("gl_caps[gl_max_array_texture_layers]", Integer.valueOf(GlStateManager.func_187397_v('\u88ff')));
  31567. GlStateManager.func_187434_L();
  31568. p_70001_1_.func_152767_b("gl_max_texture_size", Integer.valueOf(func_71369_N()));
  31569. GameProfile gameprofile = this.field_71449_j.func_148256_e();
  31570. if(gameprofile != null && gameprofile.getId() != null) {
  31571. p_70001_1_.func_152767_b("uuid", Hashing.sha1().hashBytes(gameprofile.getId().toString().getBytes(Charsets.ISO_8859_1)).toString());
  31572. }
  31573.  
  31574. }
  31575.  
  31576. public static int func_71369_N() {
  31577. for(int int = 16384; int > 0; int >>= 1) {
  31578. GlStateManager.func_187419_a('\u8064', 0, 6408, int, int, 0, 6408, 5121, (IntBuffer)null);
  31579. int int = GlStateManager.func_187411_c('\u8064', 0, 4096);
  31580. if(int != 0) {
  31581. return int;
  31582. }
  31583. }
  31584.  
  31585. return -1;
  31586. }
  31587.  
  31588. public boolean func_70002_Q() {
  31589. return this.field_71474_y.field_74355_t;
  31590. }
  31591.  
  31592. public void func_71351_a(ServerData p_71351_1_) {
  31593. this.field_71422_O = p_71351_1_;
  31594. }
  31595.  
  31596. @Nullable
  31597. public ServerData func_147104_D() {
  31598. return this.field_71422_O;
  31599. }
  31600.  
  31601. public boolean func_71387_A() {
  31602. return this.field_71455_al;
  31603. }
  31604.  
  31605. public boolean func_71356_B() {
  31606. return this.field_71455_al && this.field_71437_Z != null;
  31607. }
  31608.  
  31609. @Nullable
  31610. public IntegratedServer func_71401_C() {
  31611. return this.field_71437_Z;
  31612. }
  31613.  
  31614. public static void func_71363_D() {
  31615. if(field_71432_P != null) {
  31616. IntegratedServer integratedserver = field_71432_P.func_71401_C();
  31617. if(integratedserver != null) {
  31618. integratedserver.func_71260_j();
  31619. }
  31620.  
  31621. }
  31622. }
  31623.  
  31624. public Snooper func_71378_E() {
  31625. return this.field_71427_U;
  31626. }
  31627.  
  31628. public static long func_71386_F() {
  31629. return Sys.getTime() * 1000L / Sys.getTimerResolution();
  31630. }
  31631.  
  31632. public boolean func_71372_G() {
  31633. return this.field_71431_Q;
  31634. }
  31635.  
  31636. public Session func_110432_I() {
  31637. return this.field_71449_j;
  31638. }
  31639.  
  31640. public PropertyMap func_181037_M() {
  31641. if(this.field_181038_N.isEmpty()) {
  31642. GameProfile gameprofile = this.func_152347_ac().fillProfileProperties(this.field_71449_j.func_148256_e(), false);
  31643. this.field_181038_N.putAll(gameprofile.getProperties());
  31644. }
  31645.  
  31646. return this.field_181038_N;
  31647. }
  31648.  
  31649. public Proxy func_110437_J() {
  31650. return this.field_110453_aa;
  31651. }
  31652.  
  31653. public TextureManager func_110434_K() {
  31654. return this.field_71446_o;
  31655. }
  31656.  
  31657. public IResourceManager func_110442_L() {
  31658. return this.field_110451_am;
  31659. }
  31660.  
  31661. public ResourcePackRepository func_110438_M() {
  31662. return this.field_110448_aq;
  31663. }
  31664.  
  31665. public LanguageManager func_135016_M() {
  31666. return this.field_135017_as;
  31667. }
  31668.  
  31669. public TextureMap func_147117_R() {
  31670. return this.field_147128_au;
  31671. }
  31672.  
  31673. public boolean func_147111_S() {
  31674. return this.field_147129_ai;
  31675. }
  31676.  
  31677. public boolean func_147113_T() {
  31678. return this.field_71445_n;
  31679. }
  31680.  
  31681. public SoundHandler func_147118_V() {
  31682. return this.field_147127_av;
  31683. }
  31684.  
  31685. public MusicTicker.MusicType func_147109_W() {
  31686. return this.field_71462_r instanceof GuiWinGame?MusicTicker.MusicType.CREDITS:(this.field_71439_g != null?(this.field_71439_g.field_70170_p.field_73011_w instanceof WorldProviderHell?MusicTicker.MusicType.NETHER:(this.field_71439_g.field_70170_p.field_73011_w instanceof WorldProviderEnd?(this.field_71456_v.func_184046_j().func_184054_d()?MusicTicker.MusicType.END_BOSS:MusicTicker.MusicType.END):(this.field_71439_g.field_71075_bZ.field_75098_d && this.field_71439_g.field_71075_bZ.field_75101_c?MusicTicker.MusicType.CREATIVE:MusicTicker.MusicType.GAME))):MusicTicker.MusicType.MENU);
  31687. }
  31688.  
  31689. public void func_152348_aa() {
  31690. int int = Keyboard.getEventKey() == 0?Keyboard.getEventCharacter() + 256:Keyboard.getEventKey();
  31691. if(int != 0 && !Keyboard.isRepeatEvent()) {
  31692. if(!(this.field_71462_r instanceof GuiControls) || ((GuiControls)this.field_71462_r).field_152177_g <= func_71386_F() - 20L) {
  31693. if(Keyboard.getEventKeyState()) {
  31694. if(int == this.field_71474_y.field_152395_am.func_151463_i()) {
  31695. this.func_71352_k();
  31696. } else if(int == this.field_71474_y.field_151447_Z.func_151463_i()) {
  31697. this.field_71456_v.func_146158_b().func_146227_a(ScreenShotHelper.func_148260_a(this.field_71412_D, this.field_71443_c, this.field_71440_d, this.field_147124_at));
  31698. } else if(int == 48 && GuiScreen.func_146271_m() && (this.field_71462_r == null || this.field_71462_r != null && !this.field_71462_r.func_193976_p())) {
  31699. this.field_71474_y.func_74306_a(GameSettings.Options.NARRATOR, 1);
  31700. if(this.field_71462_r instanceof ScreenChatOptions) {
  31701. ((ScreenChatOptions)this.field_71462_r).func_193024_a();
  31702. }
  31703. }
  31704. }
  31705.  
  31706. }
  31707. }
  31708. }
  31709.  
  31710. public MinecraftSessionService func_152347_ac() {
  31711. return this.field_152355_az;
  31712. }
  31713.  
  31714. public SkinManager func_152342_ad() {
  31715. return this.field_152350_aA;
  31716. }
  31717.  
  31718. @Nullable
  31719. public Entity func_175606_aa() {
  31720. return this.field_175622_Z;
  31721. }
  31722.  
  31723. public void func_175607_a(Entity p_175607_1_) {
  31724. this.field_175622_Z = p_175607_1_;
  31725. this.field_71460_t.func_175066_a(p_175607_1_);
  31726. }
  31727.  
  31728. public <V> ListenableFuture<V> func_152343_a(Callable<V> p_152343_1_) {
  31729. Validate.notNull(p_152343_1_);
  31730. if(this.func_152345_ab()) {
  31731. try {
  31732. return Futures.<V>immediateFuture(p_152343_1_.call());
  31733. } catch (Exception exception) {
  31734. return Futures.immediateFailedCheckedFuture(exception);
  31735. }
  31736. } else {
  31737. ListenableFutureTask<V> listenablefuturetask = ListenableFutureTask.<V>create(p_152343_1_);
  31738. synchronized(this.field_152351_aB) {
  31739. this.field_152351_aB.add(listenablefuturetask);
  31740. return listenablefuturetask;
  31741. }
  31742. }
  31743. }
  31744.  
  31745. public ListenableFuture<Object> func_152344_a(Runnable p_152344_1_) {
  31746. Validate.notNull(p_152344_1_);
  31747. return this.<Object>func_152343_a(Executors.callable(p_152344_1_));
  31748. }
  31749.  
  31750. public boolean func_152345_ab() {
  31751. return Thread.currentThread() == this.field_152352_aC;
  31752. }
  31753.  
  31754. public BlockRendererDispatcher func_175602_ab() {
  31755. return this.field_175618_aM;
  31756. }
  31757.  
  31758. public RenderManager func_175598_ae() {
  31759. return this.field_175616_W;
  31760. }
  31761.  
  31762. public RenderItem func_175599_af() {
  31763. return this.field_175621_X;
  31764. }
  31765.  
  31766. public ItemRenderer func_175597_ag() {
  31767. return this.field_175620_Y;
  31768. }
  31769.  
  31770. public <T> ISearchTree<T> func_193987_a(SearchTreeManager.Key<T> p_193987_1_) {
  31771. return this.field_193995_ae.<T>func_194010_a(p_193987_1_);
  31772. }
  31773.  
  31774. public static int func_175610_ah() {
  31775. return field_71470_ab;
  31776. }
  31777.  
  31778. public FrameTimer func_181539_aj() {
  31779. return this.field_181542_y;
  31780. }
  31781.  
  31782. public boolean func_181540_al() {
  31783. return this.field_181541_X;
  31784. }
  31785.  
  31786. public void func_181537_a(boolean p_181537_1_) {
  31787. this.field_181541_X = p_181537_1_;
  31788. }
  31789.  
  31790. public DataFixer func_184126_aj() {
  31791. return this.field_184131_U;
  31792. }
  31793.  
  31794. public float func_184121_ak() {
  31795. return this.field_71428_T.field_194147_b;
  31796. }
  31797.  
  31798. public float func_193989_ak() {
  31799. return this.field_71428_T.field_194148_c;
  31800. }
  31801.  
  31802. public BlockColors func_184125_al() {
  31803. return this.field_184127_aH;
  31804. }
  31805.  
  31806. public boolean func_189648_am() {
  31807. return this.field_71439_g != null && this.field_71439_g.func_175140_cp() || this.field_71474_y.field_178879_v;
  31808. }
  31809.  
  31810. public GuiToast func_193033_an() {
  31811. return this.field_193034_aS;
  31812. }
  31813.  
  31814. public Tutorial func_193032_ao() {
  31815. return this.field_193035_aW;
  31816. }
  31817. }
  31818.  
  31819. Patching failed: minecraft\net\minecraft\client\gui\GuiOverlayDebug.java
  31820. Hunk 1 failed! Cannot find hunk target
  31821.  
  31822. }
  31823.  
  31824. + @SuppressWarnings("incomplete-switch")
  31825. protected List<String> call() {
  31826. BlockPos blockpos = new BlockPos(this.field_175242_a.func_175606_aa().field_70165_t, this.field_175242_a.func_175606_aa().func_174813_aQ().field_72338_b, this.field_175242_a.func_175606_aa().field_70161_v);
  31827. if (this.field_175242_a.func_189648_am()) {
  31828. File state
  31829. package net.minecraft.client.gui;
  31830.  
  31831. import com.google.common.base.Strings;
  31832. import com.google.common.collect.Lists;
  31833. import com.google.common.collect.UnmodifiableIterator;
  31834. import java.util.List;
  31835. import java.util.Map.Entry;
  31836. import net.minecraft.block.Block;
  31837. import net.minecraft.block.properties.IProperty;
  31838. import net.minecraft.block.state.IBlockState;
  31839. import net.minecraft.client.ClientBrandRetriever;
  31840. import net.minecraft.client.Minecraft;
  31841. import net.minecraft.client.gui.FontRenderer;
  31842. import net.minecraft.client.gui.Gui;
  31843. import net.minecraft.client.gui.ScaledResolution;
  31844. import net.minecraft.client.renderer.GlStateManager;
  31845. import net.minecraft.client.renderer.OpenGlHelper;
  31846. import net.minecraft.entity.Entity;
  31847. import net.minecraft.entity.player.EntityPlayerMP;
  31848. import net.minecraft.util.EnumFacing;
  31849. import net.minecraft.util.FrameTimer;
  31850. import net.minecraft.util.math.BlockPos;
  31851. import net.minecraft.util.math.MathHelper;
  31852. import net.minecraft.util.math.RayTraceResult;
  31853. import net.minecraft.util.text.TextFormatting;
  31854. import net.minecraft.world.DifficultyInstance;
  31855. import net.minecraft.world.EnumSkyBlock;
  31856. import net.minecraft.world.WorldType;
  31857. import net.minecraft.world.chunk.Chunk;
  31858. import net.minecraftforge.fml.relauncher.Side;
  31859. import net.minecraftforge.fml.relauncher.SideOnly;
  31860. import org.lwjgl.opengl.Display;
  31861.  
  31862. @SideOnly(Side.CLIENT)
  31863. public class GuiOverlayDebug extends Gui {
  31864. private final Minecraft field_175242_a;
  31865. private final FontRenderer field_175241_f;
  31866.  
  31867. public GuiOverlayDebug(Minecraft p_i45543_1_) {
  31868. this.field_175242_a = p_i45543_1_;
  31869. this.field_175241_f = p_i45543_1_.field_71466_p;
  31870. }
  31871.  
  31872. public void func_175237_a(ScaledResolution p_175237_1_) {
  31873. this.field_175242_a.field_71424_I.func_76320_a("debug");
  31874. GlStateManager.func_179094_E();
  31875. this.func_180798_a();
  31876. this.func_175239_b(p_175237_1_);
  31877. GlStateManager.func_179121_F();
  31878. if(this.field_175242_a.field_71474_y.field_181657_aC) {
  31879. this.func_181554_e();
  31880. }
  31881.  
  31882. this.field_175242_a.field_71424_I.func_76319_b();
  31883. }
  31884.  
  31885. protected void func_180798_a() {
  31886. List<String> list = this.call();
  31887. list.add("");
  31888. list.add("Debug: Pie [shift]: " + (this.field_175242_a.field_71474_y.field_74329_Q?"visible":"hidden") + " FPS [alt]: " + (this.field_175242_a.field_71474_y.field_181657_aC?"visible":"hidden"));
  31889. list.add("For help: press F3 + Q");
  31890.  
  31891. for(int i = 0; i < list.size(); ++i) {
  31892. String s = (String)list.get(i);
  31893. if(!Strings.isNullOrEmpty(s)) {
  31894. int j = this.field_175241_f.field_78288_b;
  31895. int k = this.field_175241_f.func_78256_a(s);
  31896. int l = 2;
  31897. int i1 = 2 + j * i;
  31898. func_73734_a(1, i1 - 1, 2 + k + 1, i1 + j - 1, -1873784752);
  31899. this.field_175241_f.func_78276_b(s, 2, i1, 14737632);
  31900. }
  31901. }
  31902.  
  31903. }
  31904.  
  31905. protected void func_175239_b(ScaledResolution p_175239_1_) {
  31906. List<String> list = this.func_175238_c();
  31907.  
  31908. for(int i = 0; i < list.size(); ++i) {
  31909. String s = (String)list.get(i);
  31910. if(!Strings.isNullOrEmpty(s)) {
  31911. int j = this.field_175241_f.field_78288_b;
  31912. int k = this.field_175241_f.func_78256_a(s);
  31913. int l = p_175239_1_.func_78326_a() - 2 - k;
  31914. int i1 = 2 + j * i;
  31915. func_73734_a(l - 1, i1 - 1, l + k + 1, i1 + j - 1, -1873784752);
  31916. this.field_175241_f.func_78276_b(s, l, i1, 14737632);
  31917. }
  31918. }
  31919.  
  31920. }
  31921.  
  31922. protected List<String> call() {
  31923. BlockPos blockpos = new BlockPos(this.field_175242_a.func_175606_aa().field_70165_t, this.field_175242_a.func_175606_aa().func_174813_aQ().field_72338_b, this.field_175242_a.func_175606_aa().field_70161_v);
  31924. if(this.field_175242_a.func_189648_am()) {
  31925. return Lists.newArrayList(new String[]{"Minecraft 1.12 (" + this.field_175242_a.func_175600_c() + "/" + ClientBrandRetriever.getClientModName() + ")", this.field_175242_a.field_71426_K, this.field_175242_a.field_71438_f.func_72735_c(), this.field_175242_a.field_71438_f.func_72723_d(), "P: " + this.field_175242_a.field_71452_i.func_78869_b() + ". T: " + this.field_175242_a.field_71441_e.func_72981_t(), this.field_175242_a.field_71441_e.func_72827_u(), "", String.format("Chunk-relative: %d %d %d", new Object[]{Integer.valueOf(blockpos.func_177958_n() & 15), Integer.valueOf(blockpos.func_177956_o() & 15), Integer.valueOf(blockpos.func_177952_p() & 15)})});
  31926. } else {
  31927. Entity entity = this.field_175242_a.func_175606_aa();
  31928. EnumFacing enumfacing = entity.func_174811_aO();
  31929. String s = "Invalid";
  31930. switch(enumfacing) {
  31931. case NORTH:
  31932. s = "Towards negative Z";
  31933. break;
  31934. case SOUTH:
  31935. s = "Towards positive Z";
  31936. break;
  31937. case WEST:
  31938. s = "Towards negative X";
  31939. break;
  31940. case EAST:
  31941. s = "Towards positive X";
  31942. }
  31943.  
  31944. List<String> list = Lists.newArrayList(new String[]{"Minecraft 1.12 (" + this.field_175242_a.func_175600_c() + "/" + ClientBrandRetriever.getClientModName() + ("release".equalsIgnoreCase(this.field_175242_a.func_184123_d())?"":"/" + this.field_175242_a.func_184123_d()) + ")", this.field_175242_a.field_71426_K, this.field_175242_a.field_71438_f.func_72735_c(), this.field_175242_a.field_71438_f.func_72723_d(), "P: " + this.field_175242_a.field_71452_i.func_78869_b() + ". T: " + this.field_175242_a.field_71441_e.func_72981_t(), this.field_175242_a.field_71441_e.func_72827_u(), "", String.format("XYZ: %.3f / %.5f / %.3f", new Object[]{Double.valueOf(this.field_175242_a.func_175606_aa().field_70165_t), Double.valueOf(this.field_175242_a.func_175606_aa().func_174813_aQ().field_72338_b), Double.valueOf(this.field_175242_a.func_175606_aa().field_70161_v)}), String.format("Block: %d %d %d", new Object[]{Integer.valueOf(blockpos.func_177958_n()), Integer.valueOf(blockpos.func_177956_o()), Integer.valueOf(blockpos.func_177952_p())}), String.format("Chunk: %d %d %d in %d %d %d", new Object[]{Integer.valueOf(blockpos.func_177958_n() & 15), Integer.valueOf(blockpos.func_177956_o() & 15), Integer.valueOf(blockpos.func_177952_p() & 15), Integer.valueOf(blockpos.func_177958_n() >> 4), Integer.valueOf(blockpos.func_177956_o() >> 4), Integer.valueOf(blockpos.func_177952_p() >> 4)}), String.format("Facing: %s (%s) (%.1f / %.1f)", new Object[]{enumfacing, s, Float.valueOf(MathHelper.func_76142_g(entity.field_70177_z)), Float.valueOf(MathHelper.func_76142_g(entity.field_70125_A))})});
  31945. if(this.field_175242_a.field_71441_e != null) {
  31946. Chunk chunk = this.field_175242_a.field_71441_e.func_175726_f(blockpos);
  31947. if(this.field_175242_a.field_71441_e.func_175667_e(blockpos) && blockpos.func_177956_o() >= 0 && blockpos.func_177956_o() < 256) {
  31948. if(!chunk.func_76621_g()) {
  31949. list.add("Biome: " + chunk.func_177411_a(blockpos, this.field_175242_a.field_71441_e.func_72959_q()).func_185359_l());
  31950. list.add("Light: " + chunk.func_177443_a(blockpos, 0) + " (" + chunk.func_177413_a(EnumSkyBlock.SKY, blockpos) + " sky, " + chunk.func_177413_a(EnumSkyBlock.BLOCK, blockpos) + " block)");
  31951. DifficultyInstance difficultyinstance = this.field_175242_a.field_71441_e.func_175649_E(blockpos);
  31952. if(this.field_175242_a.func_71387_A() && this.field_175242_a.func_71401_C() != null) {
  31953. EntityPlayerMP entityplayermp = this.field_175242_a.func_71401_C().func_184103_al().func_177451_a(this.field_175242_a.field_71439_g.func_110124_au());
  31954. if(entityplayermp != null) {
  31955. difficultyinstance = entityplayermp.field_70170_p.func_175649_E(new BlockPos(entityplayermp));
  31956. }
  31957. }
  31958.  
  31959. list.add(String.format("Local Difficulty: %.2f // %.2f (Day %d)", new Object[]{Float.valueOf(difficultyinstance.func_180168_b()), Float.valueOf(difficultyinstance.func_180170_c()), Long.valueOf(this.field_175242_a.field_71441_e.func_72820_D() / 24000L)}));
  31960. } else {
  31961. list.add("Waiting for chunk...");
  31962. }
  31963. } else {
  31964. list.add("Outside of world...");
  31965. }
  31966. }
  31967.  
  31968. if(this.field_175242_a.field_71460_t != null && this.field_175242_a.field_71460_t.func_147702_a()) {
  31969. list.add("Shader: " + this.field_175242_a.field_71460_t.func_147706_e().func_148022_b());
  31970. }
  31971.  
  31972. if(this.field_175242_a.field_71476_x != null && this.field_175242_a.field_71476_x.field_72313_a == RayTraceResult.Type.BLOCK && this.field_175242_a.field_71476_x.func_178782_a() != null) {
  31973. BlockPos blockpos1 = this.field_175242_a.field_71476_x.func_178782_a();
  31974. list.add(String.format("Looking at: %d %d %d", new Object[]{Integer.valueOf(blockpos1.func_177958_n()), Integer.valueOf(blockpos1.func_177956_o()), Integer.valueOf(blockpos1.func_177952_p())}));
  31975. }
  31976.  
  31977. return list;
  31978. }
  31979. }
  31980.  
  31981. protected <T extends Comparable<T>> List<String> func_175238_c() {
  31982. long i = Runtime.getRuntime().maxMemory();
  31983. long j = Runtime.getRuntime().totalMemory();
  31984. long k = Runtime.getRuntime().freeMemory();
  31985. long l = j - k;
  31986. List<String> list = Lists.newArrayList(new String[]{String.format("Java: %s %dbit", new Object[]{System.getProperty("java.version"), Integer.valueOf(this.field_175242_a.func_147111_S()?64:32)}), String.format("Mem: % 2d%% %03d/%03dMB", new Object[]{Long.valueOf(l * 100L / i), Long.valueOf(func_175240_a(l)), Long.valueOf(func_175240_a(i))}), String.format("Allocated: % 2d%% %03dMB", new Object[]{Long.valueOf(j * 100L / i), Long.valueOf(func_175240_a(j))}), "", String.format("CPU: %s", new Object[]{OpenGlHelper.func_183029_j()}), "", String.format("Display: %dx%d (%s)", new Object[]{Integer.valueOf(Display.getWidth()), Integer.valueOf(Display.getHeight()), GlStateManager.func_187416_u(7936)}), GlStateManager.func_187416_u(7937), GlStateManager.func_187416_u(7938)});
  31987. if(this.field_175242_a.func_189648_am()) {
  31988. return list;
  31989. } else {
  31990. if(this.field_175242_a.field_71476_x != null && this.field_175242_a.field_71476_x.field_72313_a == RayTraceResult.Type.BLOCK && this.field_175242_a.field_71476_x.func_178782_a() != null) {
  31991. BlockPos blockpos = this.field_175242_a.field_71476_x.func_178782_a();
  31992. IBlockState iblockstate = this.field_175242_a.field_71441_e.func_180495_p(blockpos);
  31993. if(this.field_175242_a.field_71441_e.func_175624_G() != WorldType.field_180272_g) {
  31994. iblockstate = iblockstate.func_185899_b(this.field_175242_a.field_71441_e, blockpos);
  31995. }
  31996.  
  31997. list.add("");
  31998. list.add(String.valueOf(Block.field_149771_c.func_177774_c(iblockstate.func_177230_c())));
  31999.  
  32000. IProperty<T> iproperty;
  32001. String s;
  32002. for(UnmodifiableIterator unmodifiableiterator = iblockstate.func_177228_b().entrySet().iterator(); unmodifiableiterator.hasNext(); list.add(iproperty.func_177701_a() + ": " + s)) {
  32003. Entry<IProperty<?>, Comparable<?>> entry = (Entry)unmodifiableiterator.next();
  32004. iproperty = (IProperty)entry.getKey();
  32005. T t = (Comparable)entry.getValue();
  32006. s = iproperty.func_177702_a(t);
  32007. if(Boolean.TRUE.equals(t)) {
  32008. s = TextFormatting.GREEN + s;
  32009. } else if(Boolean.FALSE.equals(t)) {
  32010. s = TextFormatting.RED + s;
  32011. }
  32012. }
  32013. }
  32014.  
  32015. return list;
  32016. }
  32017. }
  32018.  
  32019. public void func_181554_e() {
  32020. GlStateManager.func_179097_i();
  32021. FrameTimer frametimer = this.field_175242_a.func_181539_aj();
  32022. int i = frametimer.func_181749_a();
  32023. int j = frametimer.func_181750_b();
  32024. long[] along = frametimer.func_181746_c();
  32025. ScaledResolution scaledresolution = new ScaledResolution(this.field_175242_a);
  32026. int k = i;
  32027. int l = 0;
  32028. func_73734_a(0, scaledresolution.func_78328_b() - 60, 240, scaledresolution.func_78328_b(), -1873784752);
  32029.  
  32030. while(k != j) {
  32031. int i1 = frametimer.func_181748_a(along[k], 30);
  32032. int j1 = this.func_181552_c(MathHelper.func_76125_a(i1, 0, 60), 0, 30, 60);
  32033. this.func_73728_b(l, scaledresolution.func_78328_b(), scaledresolution.func_78328_b() - i1, j1);
  32034. ++l;
  32035. k = frametimer.func_181751_b(k + 1);
  32036. }
  32037.  
  32038. func_73734_a(1, scaledresolution.func_78328_b() - 30 + 1, 14, scaledresolution.func_78328_b() - 30 + 10, -1873784752);
  32039. this.field_175241_f.func_78276_b("60", 2, scaledresolution.func_78328_b() - 30 + 2, 14737632);
  32040. this.func_73730_a(0, 239, scaledresolution.func_78328_b() - 30, -1);
  32041. func_73734_a(1, scaledresolution.func_78328_b() - 60 + 1, 14, scaledresolution.func_78328_b() - 60 + 10, -1873784752);
  32042. this.field_175241_f.func_78276_b("30", 2, scaledresolution.func_78328_b() - 60 + 2, 14737632);
  32043. this.func_73730_a(0, 239, scaledresolution.func_78328_b() - 60, -1);
  32044. this.func_73730_a(0, 239, scaledresolution.func_78328_b() - 1, -1);
  32045. this.func_73728_b(0, scaledresolution.func_78328_b() - 60, scaledresolution.func_78328_b(), -1);
  32046. this.func_73728_b(239, scaledresolution.func_78328_b() - 60, scaledresolution.func_78328_b(), -1);
  32047. if(this.field_175242_a.field_71474_y.field_74350_i <= 120) {
  32048. this.func_73730_a(0, 239, scaledresolution.func_78328_b() - 60 + this.field_175242_a.field_71474_y.field_74350_i / 2, -16711681);
  32049. }
  32050.  
  32051. GlStateManager.func_179126_j();
  32052. }
  32053.  
  32054. private int func_181552_c(int p_181552_1_, int p_181552_2_, int p_181552_3_, int p_181552_4_) {
  32055. return p_181552_1_ < p_181552_3_?this.func_181553_a(-16711936, -256, (float)p_181552_1_ / (float)p_181552_3_):this.func_181553_a(-256, -65536, (float)(p_181552_1_ - p_181552_3_) / (float)(p_181552_4_ - p_181552_3_));
  32056. }
  32057.  
  32058. private int func_181553_a(int p_181553_1_, int p_181553_2_, float p_181553_3_) {
  32059. int i = p_181553_1_ >> 24 & 255;
  32060. int j = p_181553_1_ >> 16 & 255;
  32061. int k = p_181553_1_ >> 8 & 255;
  32062. int l = p_181553_1_ & 255;
  32063. int i1 = p_181553_2_ >> 24 & 255;
  32064. int j1 = p_181553_2_ >> 16 & 255;
  32065. int k1 = p_181553_2_ >> 8 & 255;
  32066. int l1 = p_181553_2_ & 255;
  32067. int i2 = MathHelper.func_76125_a((int)((float)i + (float)(i1 - i) * p_181553_3_), 0, 255);
  32068. int j2 = MathHelper.func_76125_a((int)((float)j + (float)(j1 - j) * p_181553_3_), 0, 255);
  32069. int k2 = MathHelper.func_76125_a((int)((float)k + (float)(k1 - k) * p_181553_3_), 0, 255);
  32070. int l2 = MathHelper.func_76125_a((int)((float)l + (float)(l1 - l) * p_181553_3_), 0, 255);
  32071. return i2 << 24 | j2 << 16 | k2 << 8 | l2;
  32072. }
  32073.  
  32074. private static long func_175240_a(long p_175240_0_) {
  32075. return p_175240_0_ / 1024L / 1024L;
  32076. }
  32077. }
  32078.  
  32079. Hunk 2 failed! Cannot find hunk target
  32080. for(UnmodifiableIterator unmodifiableiterator = iblockstate.func_177228_b().entrySet().iterator(); unmodifiableiterator.hasNext(); list.add(iproperty.func_177701_a() + ": " + s)) {
  32081. Entry<IProperty<?>, Comparable<?>> entry = (Entry)unmodifiableiterator.next();
  32082. iproperty = (IProperty)entry.getKey();
  32083. - T t = entry.getValue();
  32084. + T t = (T)entry.getValue();
  32085. s = iproperty.func_177702_a(t);
  32086. if (Boolean.TRUE.equals(t)) {
  32087. s = TextFormatting.GREEN + s;
  32088. File state
  32089. package net.minecraft.client.gui;
  32090.  
  32091. import com.google.common.base.Strings;
  32092. import com.google.common.collect.Lists;
  32093. import com.google.common.collect.UnmodifiableIterator;
  32094. import java.util.List;
  32095. import java.util.Map.Entry;
  32096. import net.minecraft.block.Block;
  32097. import net.minecraft.block.properties.IProperty;
  32098. import net.minecraft.block.state.IBlockState;
  32099. import net.minecraft.client.ClientBrandRetriever;
  32100. import net.minecraft.client.Minecraft;
  32101. import net.minecraft.client.gui.FontRenderer;
  32102. import net.minecraft.client.gui.Gui;
  32103. import net.minecraft.client.gui.ScaledResolution;
  32104. import net.minecraft.client.renderer.GlStateManager;
  32105. import net.minecraft.client.renderer.OpenGlHelper;
  32106. import net.minecraft.entity.Entity;
  32107. import net.minecraft.entity.player.EntityPlayerMP;
  32108. import net.minecraft.util.EnumFacing;
  32109. import net.minecraft.util.FrameTimer;
  32110. import net.minecraft.util.math.BlockPos;
  32111. import net.minecraft.util.math.MathHelper;
  32112. import net.minecraft.util.math.RayTraceResult;
  32113. import net.minecraft.util.text.TextFormatting;
  32114. import net.minecraft.world.DifficultyInstance;
  32115. import net.minecraft.world.EnumSkyBlock;
  32116. import net.minecraft.world.WorldType;
  32117. import net.minecraft.world.chunk.Chunk;
  32118. import net.minecraftforge.fml.relauncher.Side;
  32119. import net.minecraftforge.fml.relauncher.SideOnly;
  32120. import org.lwjgl.opengl.Display;
  32121.  
  32122. @SideOnly(Side.CLIENT)
  32123. public class GuiOverlayDebug extends Gui {
  32124. private final Minecraft field_175242_a;
  32125. private final FontRenderer field_175241_f;
  32126.  
  32127. public GuiOverlayDebug(Minecraft p_i45543_1_) {
  32128. this.field_175242_a = p_i45543_1_;
  32129. this.field_175241_f = p_i45543_1_.field_71466_p;
  32130. }
  32131.  
  32132. public void func_175237_a(ScaledResolution p_175237_1_) {
  32133. this.field_175242_a.field_71424_I.func_76320_a("debug");
  32134. GlStateManager.func_179094_E();
  32135. this.func_180798_a();
  32136. this.func_175239_b(p_175237_1_);
  32137. GlStateManager.func_179121_F();
  32138. if(this.field_175242_a.field_71474_y.field_181657_aC) {
  32139. this.func_181554_e();
  32140. }
  32141.  
  32142. this.field_175242_a.field_71424_I.func_76319_b();
  32143. }
  32144.  
  32145. protected void func_180798_a() {
  32146. List<String> list = this.call();
  32147. list.add("");
  32148. list.add("Debug: Pie [shift]: " + (this.field_175242_a.field_71474_y.field_74329_Q?"visible":"hidden") + " FPS [alt]: " + (this.field_175242_a.field_71474_y.field_181657_aC?"visible":"hidden"));
  32149. list.add("For help: press F3 + Q");
  32150.  
  32151. for(int i = 0; i < list.size(); ++i) {
  32152. String s = (String)list.get(i);
  32153. if(!Strings.isNullOrEmpty(s)) {
  32154. int j = this.field_175241_f.field_78288_b;
  32155. int k = this.field_175241_f.func_78256_a(s);
  32156. int l = 2;
  32157. int i1 = 2 + j * i;
  32158. func_73734_a(1, i1 - 1, 2 + k + 1, i1 + j - 1, -1873784752);
  32159. this.field_175241_f.func_78276_b(s, 2, i1, 14737632);
  32160. }
  32161. }
  32162.  
  32163. }
  32164.  
  32165. protected void func_175239_b(ScaledResolution p_175239_1_) {
  32166. List<String> list = this.func_175238_c();
  32167.  
  32168. for(int i = 0; i < list.size(); ++i) {
  32169. String s = (String)list.get(i);
  32170. if(!Strings.isNullOrEmpty(s)) {
  32171. int j = this.field_175241_f.field_78288_b;
  32172. int k = this.field_175241_f.func_78256_a(s);
  32173. int l = p_175239_1_.func_78326_a() - 2 - k;
  32174. int i1 = 2 + j * i;
  32175. func_73734_a(l - 1, i1 - 1, l + k + 1, i1 + j - 1, -1873784752);
  32176. this.field_175241_f.func_78276_b(s, l, i1, 14737632);
  32177. }
  32178. }
  32179.  
  32180. }
  32181.  
  32182. protected List<String> call() {
  32183. BlockPos blockpos = new BlockPos(this.field_175242_a.func_175606_aa().field_70165_t, this.field_175242_a.func_175606_aa().func_174813_aQ().field_72338_b, this.field_175242_a.func_175606_aa().field_70161_v);
  32184. if(this.field_175242_a.func_189648_am()) {
  32185. return Lists.newArrayList(new String[]{"Minecraft 1.12 (" + this.field_175242_a.func_175600_c() + "/" + ClientBrandRetriever.getClientModName() + ")", this.field_175242_a.field_71426_K, this.field_175242_a.field_71438_f.func_72735_c(), this.field_175242_a.field_71438_f.func_72723_d(), "P: " + this.field_175242_a.field_71452_i.func_78869_b() + ". T: " + this.field_175242_a.field_71441_e.func_72981_t(), this.field_175242_a.field_71441_e.func_72827_u(), "", String.format("Chunk-relative: %d %d %d", new Object[]{Integer.valueOf(blockpos.func_177958_n() & 15), Integer.valueOf(blockpos.func_177956_o() & 15), Integer.valueOf(blockpos.func_177952_p() & 15)})});
  32186. } else {
  32187. Entity entity = this.field_175242_a.func_175606_aa();
  32188. EnumFacing enumfacing = entity.func_174811_aO();
  32189. String s = "Invalid";
  32190. switch(enumfacing) {
  32191. case NORTH:
  32192. s = "Towards negative Z";
  32193. break;
  32194. case SOUTH:
  32195. s = "Towards positive Z";
  32196. break;
  32197. case WEST:
  32198. s = "Towards negative X";
  32199. break;
  32200. case EAST:
  32201. s = "Towards positive X";
  32202. }
  32203.  
  32204. List<String> list = Lists.newArrayList(new String[]{"Minecraft 1.12 (" + this.field_175242_a.func_175600_c() + "/" + ClientBrandRetriever.getClientModName() + ("release".equalsIgnoreCase(this.field_175242_a.func_184123_d())?"":"/" + this.field_175242_a.func_184123_d()) + ")", this.field_175242_a.field_71426_K, this.field_175242_a.field_71438_f.func_72735_c(), this.field_175242_a.field_71438_f.func_72723_d(), "P: " + this.field_175242_a.field_71452_i.func_78869_b() + ". T: " + this.field_175242_a.field_71441_e.func_72981_t(), this.field_175242_a.field_71441_e.func_72827_u(), "", String.format("XYZ: %.3f / %.5f / %.3f", new Object[]{Double.valueOf(this.field_175242_a.func_175606_aa().field_70165_t), Double.valueOf(this.field_175242_a.func_175606_aa().func_174813_aQ().field_72338_b), Double.valueOf(this.field_175242_a.func_175606_aa().field_70161_v)}), String.format("Block: %d %d %d", new Object[]{Integer.valueOf(blockpos.func_177958_n()), Integer.valueOf(blockpos.func_177956_o()), Integer.valueOf(blockpos.func_177952_p())}), String.format("Chunk: %d %d %d in %d %d %d", new Object[]{Integer.valueOf(blockpos.func_177958_n() & 15), Integer.valueOf(blockpos.func_177956_o() & 15), Integer.valueOf(blockpos.func_177952_p() & 15), Integer.valueOf(blockpos.func_177958_n() >> 4), Integer.valueOf(blockpos.func_177956_o() >> 4), Integer.valueOf(blockpos.func_177952_p() >> 4)}), String.format("Facing: %s (%s) (%.1f / %.1f)", new Object[]{enumfacing, s, Float.valueOf(MathHelper.func_76142_g(entity.field_70177_z)), Float.valueOf(MathHelper.func_76142_g(entity.field_70125_A))})});
  32205. if(this.field_175242_a.field_71441_e != null) {
  32206. Chunk chunk = this.field_175242_a.field_71441_e.func_175726_f(blockpos);
  32207. if(this.field_175242_a.field_71441_e.func_175667_e(blockpos) && blockpos.func_177956_o() >= 0 && blockpos.func_177956_o() < 256) {
  32208. if(!chunk.func_76621_g()) {
  32209. list.add("Biome: " + chunk.func_177411_a(blockpos, this.field_175242_a.field_71441_e.func_72959_q()).func_185359_l());
  32210. list.add("Light: " + chunk.func_177443_a(blockpos, 0) + " (" + chunk.func_177413_a(EnumSkyBlock.SKY, blockpos) + " sky, " + chunk.func_177413_a(EnumSkyBlock.BLOCK, blockpos) + " block)");
  32211. DifficultyInstance difficultyinstance = this.field_175242_a.field_71441_e.func_175649_E(blockpos);
  32212. if(this.field_175242_a.func_71387_A() && this.field_175242_a.func_71401_C() != null) {
  32213. EntityPlayerMP entityplayermp = this.field_175242_a.func_71401_C().func_184103_al().func_177451_a(this.field_175242_a.field_71439_g.func_110124_au());
  32214. if(entityplayermp != null) {
  32215. difficultyinstance = entityplayermp.field_70170_p.func_175649_E(new BlockPos(entityplayermp));
  32216. }
  32217. }
  32218.  
  32219. list.add(String.format("Local Difficulty: %.2f // %.2f (Day %d)", new Object[]{Float.valueOf(difficultyinstance.func_180168_b()), Float.valueOf(difficultyinstance.func_180170_c()), Long.valueOf(this.field_175242_a.field_71441_e.func_72820_D() / 24000L)}));
  32220. } else {
  32221. list.add("Waiting for chunk...");
  32222. }
  32223. } else {
  32224. list.add("Outside of world...");
  32225. }
  32226. }
  32227.  
  32228. if(this.field_175242_a.field_71460_t != null && this.field_175242_a.field_71460_t.func_147702_a()) {
  32229. list.add("Shader: " + this.field_175242_a.field_71460_t.func_147706_e().func_148022_b());
  32230. }
  32231.  
  32232. if(this.field_175242_a.field_71476_x != null && this.field_175242_a.field_71476_x.field_72313_a == RayTraceResult.Type.BLOCK && this.field_175242_a.field_71476_x.func_178782_a() != null) {
  32233. BlockPos blockpos1 = this.field_175242_a.field_71476_x.func_178782_a();
  32234. list.add(String.format("Looking at: %d %d %d", new Object[]{Integer.valueOf(blockpos1.func_177958_n()), Integer.valueOf(blockpos1.func_177956_o()), Integer.valueOf(blockpos1.func_177952_p())}));
  32235. }
  32236.  
  32237. return list;
  32238. }
  32239. }
  32240.  
  32241. protected <T extends Comparable<T>> List<String> func_175238_c() {
  32242. long i = Runtime.getRuntime().maxMemory();
  32243. long j = Runtime.getRuntime().totalMemory();
  32244. long k = Runtime.getRuntime().freeMemory();
  32245. long l = j - k;
  32246. List<String> list = Lists.newArrayList(new String[]{String.format("Java: %s %dbit", new Object[]{System.getProperty("java.version"), Integer.valueOf(this.field_175242_a.func_147111_S()?64:32)}), String.format("Mem: % 2d%% %03d/%03dMB", new Object[]{Long.valueOf(l * 100L / i), Long.valueOf(func_175240_a(l)), Long.valueOf(func_175240_a(i))}), String.format("Allocated: % 2d%% %03dMB", new Object[]{Long.valueOf(j * 100L / i), Long.valueOf(func_175240_a(j))}), "", String.format("CPU: %s", new Object[]{OpenGlHelper.func_183029_j()}), "", String.format("Display: %dx%d (%s)", new Object[]{Integer.valueOf(Display.getWidth()), Integer.valueOf(Display.getHeight()), GlStateManager.func_187416_u(7936)}), GlStateManager.func_187416_u(7937), GlStateManager.func_187416_u(7938)});
  32247. if(this.field_175242_a.func_189648_am()) {
  32248. return list;
  32249. } else {
  32250. if(this.field_175242_a.field_71476_x != null && this.field_175242_a.field_71476_x.field_72313_a == RayTraceResult.Type.BLOCK && this.field_175242_a.field_71476_x.func_178782_a() != null) {
  32251. BlockPos blockpos = this.field_175242_a.field_71476_x.func_178782_a();
  32252. IBlockState iblockstate = this.field_175242_a.field_71441_e.func_180495_p(blockpos);
  32253. if(this.field_175242_a.field_71441_e.func_175624_G() != WorldType.field_180272_g) {
  32254. iblockstate = iblockstate.func_185899_b(this.field_175242_a.field_71441_e, blockpos);
  32255. }
  32256.  
  32257. list.add("");
  32258. list.add(String.valueOf(Block.field_149771_c.func_177774_c(iblockstate.func_177230_c())));
  32259.  
  32260. IProperty<T> iproperty;
  32261. String s;
  32262. for(UnmodifiableIterator unmodifiableiterator = iblockstate.func_177228_b().entrySet().iterator(); unmodifiableiterator.hasNext(); list.add(iproperty.func_177701_a() + ": " + s)) {
  32263. Entry<IProperty<?>, Comparable<?>> entry = (Entry)unmodifiableiterator.next();
  32264. iproperty = (IProperty)entry.getKey();
  32265. T t = (Comparable)entry.getValue();
  32266. s = iproperty.func_177702_a(t);
  32267. if(Boolean.TRUE.equals(t)) {
  32268. s = TextFormatting.GREEN + s;
  32269. } else if(Boolean.FALSE.equals(t)) {
  32270. s = TextFormatting.RED + s;
  32271. }
  32272. }
  32273. }
  32274.  
  32275. return list;
  32276. }
  32277. }
  32278.  
  32279. public void func_181554_e() {
  32280. GlStateManager.func_179097_i();
  32281. FrameTimer frametimer = this.field_175242_a.func_181539_aj();
  32282. int i = frametimer.func_181749_a();
  32283. int j = frametimer.func_181750_b();
  32284. long[] along = frametimer.func_181746_c();
  32285. ScaledResolution scaledresolution = new ScaledResolution(this.field_175242_a);
  32286. int k = i;
  32287. int l = 0;
  32288. func_73734_a(0, scaledresolution.func_78328_b() - 60, 240, scaledresolution.func_78328_b(), -1873784752);
  32289.  
  32290. while(k != j) {
  32291. int i1 = frametimer.func_181748_a(along[k], 30);
  32292. int j1 = this.func_181552_c(MathHelper.func_76125_a(i1, 0, 60), 0, 30, 60);
  32293. this.func_73728_b(l, scaledresolution.func_78328_b(), scaledresolution.func_78328_b() - i1, j1);
  32294. ++l;
  32295. k = frametimer.func_181751_b(k + 1);
  32296. }
  32297.  
  32298. func_73734_a(1, scaledresolution.func_78328_b() - 30 + 1, 14, scaledresolution.func_78328_b() - 30 + 10, -1873784752);
  32299. this.field_175241_f.func_78276_b("60", 2, scaledresolution.func_78328_b() - 30 + 2, 14737632);
  32300. this.func_73730_a(0, 239, scaledresolution.func_78328_b() - 30, -1);
  32301. func_73734_a(1, scaledresolution.func_78328_b() - 60 + 1, 14, scaledresolution.func_78328_b() - 60 + 10, -1873784752);
  32302. this.field_175241_f.func_78276_b("30", 2, scaledresolution.func_78328_b() - 60 + 2, 14737632);
  32303. this.func_73730_a(0, 239, scaledresolution.func_78328_b() - 60, -1);
  32304. this.func_73730_a(0, 239, scaledresolution.func_78328_b() - 1, -1);
  32305. this.func_73728_b(0, scaledresolution.func_78328_b() - 60, scaledresolution.func_78328_b(), -1);
  32306. this.func_73728_b(239, scaledresolution.func_78328_b() - 60, scaledresolution.func_78328_b(), -1);
  32307. if(this.field_175242_a.field_71474_y.field_74350_i <= 120) {
  32308. this.func_73730_a(0, 239, scaledresolution.func_78328_b() - 60 + this.field_175242_a.field_71474_y.field_74350_i / 2, -16711681);
  32309. }
  32310.  
  32311. GlStateManager.func_179126_j();
  32312. }
  32313.  
  32314. private int func_181552_c(int p_181552_1_, int p_181552_2_, int p_181552_3_, int p_181552_4_) {
  32315. return p_181552_1_ < p_181552_3_?this.func_181553_a(-16711936, -256, (float)p_181552_1_ / (float)p_181552_3_):this.func_181553_a(-256, -65536, (float)(p_181552_1_ - p_181552_3_) / (float)(p_181552_4_ - p_181552_3_));
  32316. }
  32317.  
  32318. private int func_181553_a(int p_181553_1_, int p_181553_2_, float p_181553_3_) {
  32319. int i = p_181553_1_ >> 24 & 255;
  32320. int j = p_181553_1_ >> 16 & 255;
  32321. int k = p_181553_1_ >> 8 & 255;
  32322. int l = p_181553_1_ & 255;
  32323. int i1 = p_181553_2_ >> 24 & 255;
  32324. int j1 = p_181553_2_ >> 16 & 255;
  32325. int k1 = p_181553_2_ >> 8 & 255;
  32326. int l1 = p_181553_2_ & 255;
  32327. int i2 = MathHelper.func_76125_a((int)((float)i + (float)(i1 - i) * p_181553_3_), 0, 255);
  32328. int j2 = MathHelper.func_76125_a((int)((float)j + (float)(j1 - j) * p_181553_3_), 0, 255);
  32329. int k2 = MathHelper.func_76125_a((int)((float)k + (float)(k1 - k) * p_181553_3_), 0, 255);
  32330. int l2 = MathHelper.func_76125_a((int)((float)l + (float)(l1 - l) * p_181553_3_), 0, 255);
  32331. return i2 << 24 | j2 << 16 | k2 << 8 | l2;
  32332. }
  32333.  
  32334. private static long func_175240_a(long p_175240_0_) {
  32335. return p_175240_0_ / 1024L / 1024L;
  32336. }
  32337. }
  32338.  
  32339. Patching failed: minecraft\net\minecraft\client\gui\GuiSnooper.java
  32340. Hunk 1 failed! Cannot find hunk target
  32341. this.field_146292_n.add(new GuiButton(2, this.field_146294_l / 2 + 2, this.field_146295_m - 30, 150, 20, I18n.func_135052_a("gui.done")));
  32342. boolean flag = this.field_146297_k.func_71401_C() != null && this.field_146297_k.func_71401_C().func_80003_ah() != null;
  32343.  
  32344. - for(Entry<String, String> entry : (new TreeMap(this.field_146297_k.func_71378_E().func_76465_c())).entrySet()) {
  32345. + for(Entry<String, String> entry : (new TreeMap<String, String>(this.field_146297_k.func_71378_E().func_76465_c())).entrySet()) {
  32346. this.field_146604_g.add((flag ? "C " : "") + (String)entry.getKey());
  32347. this.field_146609_h.add(this.field_146289_q.func_78269_a(entry.getValue(), this.field_146294_l - 220));
  32348. }
  32349.  
  32350. if (flag) {
  32351. - for(Entry<String, String> entry1 : (new TreeMap(this.field_146297_k.func_71401_C().func_80003_ah().func_76465_c())).entrySet()) {
  32352. + for(Entry<String, String> entry1 : (new TreeMap<String, String>(this.field_146297_k.func_71401_C().func_80003_ah().func_76465_c())).entrySet()) {
  32353. this.field_146604_g.add("S " + (String)entry1.getKey());
  32354. this.field_146609_h.add(this.field_146289_q.func_78269_a(entry1.getValue(), this.field_146294_l - 220));
  32355. }
  32356. File state
  32357. package net.minecraft.client.gui;
  32358.  
  32359. import com.google.common.collect.Lists;
  32360. import java.io.IOException;
  32361. import java.util.TreeMap;
  32362. import java.util.Map.Entry;
  32363. import net.minecraft.client.gui.GuiButton;
  32364. import net.minecraft.client.gui.GuiScreen;
  32365. import net.minecraft.client.gui.GuiSlot;
  32366. import net.minecraft.client.resources.I18n;
  32367. import net.minecraft.client.settings.GameSettings;
  32368. import net.minecraftforge.fml.relauncher.Side;
  32369. import net.minecraftforge.fml.relauncher.SideOnly;
  32370.  
  32371. @SideOnly(Side.CLIENT)
  32372. public class GuiSnooper extends GuiScreen {
  32373. private final GuiScreen field_146608_a;
  32374. private final GameSettings field_146603_f;
  32375. private final java.util.List<String> field_146604_g = Lists.<String>newArrayList();
  32376. private final java.util.List<String> field_146609_h = Lists.<String>newArrayList();
  32377. private String field_146610_i;
  32378. private String[] field_146607_r;
  32379. private GuiSnooper.List field_146606_s;
  32380. private GuiButton field_146605_t;
  32381.  
  32382. public GuiSnooper(GuiScreen p_i1061_1_, GameSettings p_i1061_2_) {
  32383. this.field_146608_a = p_i1061_1_;
  32384. this.field_146603_f = p_i1061_2_;
  32385. }
  32386.  
  32387. public void func_73866_w_() {
  32388. this.field_146610_i = I18n.func_135052_a("options.snooper.title", new Object[0]);
  32389. String s = I18n.func_135052_a("options.snooper.desc", new Object[0]);
  32390. java.util.List<String> list = Lists.<String>newArrayList();
  32391.  
  32392. for(String s1 : this.field_146289_q.func_78271_c(s, this.field_146294_l - 30)) {
  32393. list.add(s1);
  32394. }
  32395.  
  32396. this.field_146607_r = (String[])list.toArray(new String[list.size()]);
  32397. this.field_146604_g.clear();
  32398. this.field_146609_h.clear();
  32399. this.field_146605_t = this.func_189646_b(new GuiButton(1, this.field_146294_l / 2 - 152, this.field_146295_m - 30, 150, 20, this.field_146603_f.func_74297_c(GameSettings.Options.SNOOPER_ENABLED)));
  32400. this.field_146292_n.add(new GuiButton(2, this.field_146294_l / 2 + 2, this.field_146295_m - 30, 150, 20, I18n.func_135052_a("gui.done", new Object[0])));
  32401. boolean flag = this.field_146297_k.func_71401_C() != null && this.field_146297_k.func_71401_C().func_80003_ah() != null;
  32402.  
  32403. for(Entry<String, String> entry : (new TreeMap(this.field_146297_k.func_71378_E().func_76465_c())).entrySet()) {
  32404. this.field_146604_g.add((flag?"C ":"") + (String)entry.getKey());
  32405. this.field_146609_h.add(this.field_146289_q.func_78269_a((String)entry.getValue(), this.field_146294_l - 220));
  32406. }
  32407.  
  32408. if(flag) {
  32409. for(Entry<String, String> entry1 : (new TreeMap(this.field_146297_k.func_71401_C().func_80003_ah().func_76465_c())).entrySet()) {
  32410. this.field_146604_g.add("S " + (String)entry1.getKey());
  32411. this.field_146609_h.add(this.field_146289_q.func_78269_a((String)entry1.getValue(), this.field_146294_l - 220));
  32412. }
  32413. }
  32414.  
  32415. this.field_146606_s = new GuiSnooper.List();
  32416. }
  32417.  
  32418. public void func_146274_d() throws IOException {
  32419. super.func_146274_d();
  32420. this.field_146606_s.func_178039_p();
  32421. }
  32422.  
  32423. protected void func_146284_a(GuiButton p_146284_1_) throws IOException {
  32424. if(p_146284_1_.field_146124_l) {
  32425. if(p_146284_1_.field_146127_k == 2) {
  32426. this.field_146603_f.func_74303_b();
  32427. this.field_146603_f.func_74303_b();
  32428. this.field_146297_k.func_147108_a(this.field_146608_a);
  32429. }
  32430.  
  32431. if(p_146284_1_.field_146127_k == 1) {
  32432. this.field_146603_f.func_74306_a(GameSettings.Options.SNOOPER_ENABLED, 1);
  32433. this.field_146605_t.field_146126_j = this.field_146603_f.func_74297_c(GameSettings.Options.SNOOPER_ENABLED);
  32434. }
  32435.  
  32436. }
  32437. }
  32438.  
  32439. public void func_73863_a(int p_73863_1_, int p_73863_2_, float p_73863_3_) {
  32440. this.func_146276_q_();
  32441. this.field_146606_s.func_148128_a(p_73863_1_, p_73863_2_, p_73863_3_);
  32442. this.func_73732_a(this.field_146289_q, this.field_146610_i, this.field_146294_l / 2, 8, 16777215);
  32443. int i = 22;
  32444.  
  32445. for(String s : this.field_146607_r) {
  32446. this.func_73732_a(this.field_146289_q, s, this.field_146294_l / 2, i, 8421504);
  32447. i += this.field_146289_q.field_78288_b;
  32448. }
  32449.  
  32450. super.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_);
  32451. }
  32452.  
  32453. @SideOnly(Side.CLIENT)
  32454. class List extends GuiSlot {
  32455. public List() {
  32456. super(GuiSnooper.this.field_146297_k, GuiSnooper.this.field_146294_l, GuiSnooper.this.field_146295_m, 80, GuiSnooper.this.field_146295_m - 40, GuiSnooper.this.field_146289_q.field_78288_b + 1);
  32457. }
  32458.  
  32459. protected int func_148127_b() {
  32460. return GuiSnooper.this.field_146604_g.size();
  32461. }
  32462.  
  32463. protected void func_148144_a(int p_148144_1_, boolean p_148144_2_, int p_148144_3_, int p_148144_4_) {
  32464. }
  32465.  
  32466. protected boolean func_148131_a(int p_148131_1_) {
  32467. return false;
  32468. }
  32469.  
  32470. protected void func_148123_a() {
  32471. }
  32472.  
  32473. protected void func_192637_a(int p_192637_1_, int p_192637_2_, int p_192637_3_, int p_192637_4_, int p_192637_5_, int p_192637_6_, float p_192637_7_) {
  32474. GuiSnooper.this.field_146289_q.func_78276_b((String)GuiSnooper.this.field_146604_g.get(p_192637_1_), 10, p_192637_3_, 16777215);
  32475. GuiSnooper.this.field_146289_q.func_78276_b((String)GuiSnooper.this.field_146609_h.get(p_192637_1_), 230, p_192637_3_, 16777215);
  32476. }
  32477.  
  32478. protected int func_148137_d() {
  32479. return this.field_148155_a - 10;
  32480. }
  32481. }
  32482. }
  32483.  
  32484. Patching failed: minecraft\net\minecraft\client\gui\recipebook\GuiRecipeBook.java
  32485. Hunk 1 failed! Cannot find hunk target
  32486. if (!s.isEmpty()) {
  32487. ObjectSet<RecipeList> objectset = new ObjectLinkedOpenHashSet<RecipeList>(this.field_191888_F.func_193987_a(SearchTreeManager.field_194012_b).func_194038_a(s.toLowerCase(Locale.ROOT)));
  32488. list1.removeIf((p_193947_1_) -> {
  32489. - return !p_193947_0_.contains(p_193947_1_);
  32490. + return !objectset.contains(p_193947_1_);
  32491. });
  32492. }
  32493.  
  32494. File state
  32495. package net.minecraft.client.gui.recipebook;
  32496.  
  32497. import com.google.common.collect.Lists;
  32498. import it.unimi.dsi.fastutil.ints.IntArrayList;
  32499. import it.unimi.dsi.fastutil.ints.IntList;
  32500. import it.unimi.dsi.fastutil.ints.IntListIterator;
  32501. import it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet;
  32502. import it.unimi.dsi.fastutil.objects.ObjectSet;
  32503. import java.util.Iterator;
  32504. import java.util.List;
  32505. import java.util.Locale;
  32506. import java.util.function.Consumer;
  32507. import java.util.function.Predicate;
  32508. import javax.annotation.Nullable;
  32509. import net.minecraft.client.Minecraft;
  32510. import net.minecraft.client.gui.Gui;
  32511. import net.minecraft.client.gui.GuiButtonToggle;
  32512. import net.minecraft.client.gui.GuiScreen;
  32513. import net.minecraft.client.gui.GuiTextField;
  32514. import net.minecraft.client.gui.recipebook.GhostRecipe;
  32515. import net.minecraft.client.gui.recipebook.GuiButtonRecipeTab;
  32516. import net.minecraft.client.gui.recipebook.IRecipeUpdateListener;
  32517. import net.minecraft.client.gui.recipebook.RecipeBookPage;
  32518. import net.minecraft.client.gui.recipebook.RecipeList;
  32519. import net.minecraft.client.renderer.GlStateManager;
  32520. import net.minecraft.client.renderer.RenderHelper;
  32521. import net.minecraft.client.resources.I18n;
  32522. import net.minecraft.client.resources.Language;
  32523. import net.minecraft.client.resources.LanguageManager;
  32524. import net.minecraft.client.settings.GameSettings;
  32525. import net.minecraft.client.util.RecipeBookClient;
  32526. import net.minecraft.client.util.RecipeItemHelper;
  32527. import net.minecraft.client.util.SearchTreeManager;
  32528. import net.minecraft.creativetab.CreativeTabs;
  32529. import net.minecraft.entity.player.InventoryPlayer;
  32530. import net.minecraft.inventory.Container;
  32531. import net.minecraft.inventory.ContainerPlayer;
  32532. import net.minecraft.inventory.ContainerWorkbench;
  32533. import net.minecraft.inventory.InventoryCraftResult;
  32534. import net.minecraft.inventory.InventoryCrafting;
  32535. import net.minecraft.inventory.Slot;
  32536. import net.minecraft.item.ItemStack;
  32537. import net.minecraft.item.crafting.IRecipe;
  32538. import net.minecraft.item.crafting.Ingredient;
  32539. import net.minecraft.item.crafting.ShapedRecipes;
  32540. import net.minecraft.network.play.client.CPacketRecipeInfo;
  32541. import net.minecraft.network.play.client.CPacketRecipePlacement;
  32542. import net.minecraft.stats.RecipeBook;
  32543. import net.minecraft.util.ResourceLocation;
  32544. import net.minecraftforge.fml.relauncher.Side;
  32545. import net.minecraftforge.fml.relauncher.SideOnly;
  32546. import org.apache.logging.log4j.LogManager;
  32547. import org.apache.logging.log4j.Logger;
  32548. import org.lwjgl.input.Keyboard;
  32549.  
  32550. @SideOnly(Side.CLIENT)
  32551. public class GuiRecipeBook extends Gui implements IRecipeUpdateListener {
  32552. protected static final ResourceLocation field_191894_a = new ResourceLocation("textures/gui/recipe_book.png");
  32553. private int field_191903_n;
  32554. private int field_191904_o;
  32555. private int field_191905_p;
  32556. private static final Logger field_193959_i = LogManager.getLogger();
  32557. private final GhostRecipe field_191915_z = new GhostRecipe();
  32558. private final List<GuiButtonRecipeTab> field_193018_j = Lists.newArrayList(new GuiButtonRecipeTab[]{new GuiButtonRecipeTab(0, CreativeTabs.field_78027_g), new GuiButtonRecipeTab(0, CreativeTabs.field_78040_i), new GuiButtonRecipeTab(0, CreativeTabs.field_78030_b), new GuiButtonRecipeTab(0, CreativeTabs.field_78026_f), new GuiButtonRecipeTab(0, CreativeTabs.field_78028_d)});
  32559. private GuiButtonRecipeTab field_191913_x;
  32560. private GuiButtonToggle field_193960_m;
  32561. private Container field_191908_s;
  32562. private InventoryCrafting field_193961_o;
  32563. private Minecraft field_191888_F;
  32564. private GuiTextField field_193962_q;
  32565. private String field_193963_r = "";
  32566. private RecipeBook field_193964_s;
  32567. private final RecipeBookPage field_193022_s = new RecipeBookPage();
  32568. private RecipeItemHelper field_193965_u = new RecipeItemHelper();
  32569. private int field_193966_v;
  32570.  
  32571. public void func_191856_a(int p_191856_1_, int p_191856_2_, Minecraft p_191856_3_, boolean p_191856_4_, Container p_191856_5_, InventoryCrafting p_191856_6_) {
  32572. this.field_191888_F = p_191856_3_;
  32573. this.field_191904_o = p_191856_1_;
  32574. this.field_191905_p = p_191856_2_;
  32575. this.field_191908_s = p_191856_5_;
  32576. this.field_193961_o = p_191856_6_;
  32577. this.field_193964_s = p_191856_3_.field_71439_g.func_192035_E();
  32578. this.field_193966_v = p_191856_3_.field_71439_g.field_71071_by.func_194015_p();
  32579. this.field_191913_x = (GuiButtonRecipeTab)this.field_193018_j.get(0);
  32580. this.field_191913_x.func_191753_b(true);
  32581. if(this.func_191878_b()) {
  32582. this.func_193014_a(p_191856_4_, p_191856_6_);
  32583. }
  32584.  
  32585. Keyboard.enableRepeatEvents(true);
  32586. }
  32587.  
  32588. public void func_193014_a(boolean p_193014_1_, InventoryCrafting p_193014_2_) {
  32589. this.field_191903_n = p_193014_1_?0:86;
  32590. int i = (this.field_191904_o - 147) / 2 - this.field_191903_n;
  32591. int j = (this.field_191905_p - 166) / 2;
  32592. this.field_193965_u.func_194119_a();
  32593. this.field_191888_F.field_71439_g.field_71071_by.func_194016_a(this.field_193965_u, false);
  32594. p_193014_2_.func_194018_a(this.field_193965_u);
  32595. this.field_193962_q = new GuiTextField(0, this.field_191888_F.field_71466_p, i + 25, j + 14, 80, this.field_191888_F.field_71466_p.field_78288_b + 5);
  32596. this.field_193962_q.func_146203_f(50);
  32597. this.field_193962_q.func_146185_a(false);
  32598. this.field_193962_q.func_146189_e(true);
  32599. this.field_193962_q.func_146193_g(16777215);
  32600. this.field_193022_s.func_194194_a(this.field_191888_F, i, j);
  32601. this.field_193022_s.func_193732_a(this);
  32602. this.field_193960_m = new GuiButtonToggle(0, i + 110, j + 12, 26, 16, this.field_193964_s.func_192815_c());
  32603. this.field_193960_m.func_191751_a(152, 41, 28, 18, field_191894_a);
  32604. this.func_193003_g(false);
  32605. this.func_193949_f();
  32606. }
  32607.  
  32608. public void func_191871_c() {
  32609. Keyboard.enableRepeatEvents(false);
  32610. }
  32611.  
  32612. public int func_193011_a(boolean p_193011_1_, int p_193011_2_, int p_193011_3_) {
  32613. int i;
  32614. if(this.func_191878_b() && !p_193011_1_) {
  32615. i = 177 + (p_193011_2_ - p_193011_3_ - 200) / 2;
  32616. } else {
  32617. i = (p_193011_2_ - p_193011_3_) / 2;
  32618. }
  32619.  
  32620. return i;
  32621. }
  32622.  
  32623. public void func_191866_a() {
  32624. this.func_193006_a(!this.func_191878_b());
  32625. }
  32626.  
  32627. public boolean func_191878_b() {
  32628. return this.field_193964_s.func_192812_b();
  32629. }
  32630.  
  32631. private void func_193006_a(boolean p_193006_1_) {
  32632. this.field_193964_s.func_192813_a(p_193006_1_);
  32633. if(!p_193006_1_) {
  32634. this.field_193022_s.func_194200_c();
  32635. }
  32636.  
  32637. this.func_193956_j();
  32638. }
  32639.  
  32640. public void func_191874_a(@Nullable Slot p_191874_1_) {
  32641. if(p_191874_1_ != null && p_191874_1_.field_75222_d <= 9) {
  32642. this.field_191915_z.func_192682_a();
  32643. if(this.func_191878_b()) {
  32644. this.func_193942_g();
  32645. }
  32646. }
  32647.  
  32648. }
  32649.  
  32650. private void func_193003_g(boolean p_193003_1_) {
  32651. List<RecipeList> list = (List)RecipeBookClient.field_194086_e.get(this.field_191913_x.func_191764_e());
  32652. list.forEach((p_193944_1_) -> {
  32653. p_193944_1_.func_194210_a(this.field_193965_u, this.field_193961_o.func_174922_i(), this.field_193961_o.func_174923_h(), this.field_193964_s);
  32654. });
  32655. List<RecipeList> list1 = Lists.newArrayList(list);
  32656. list1.removeIf((p_193952_0_) -> {
  32657. return !p_193952_0_.func_194209_a();
  32658. });
  32659. list1.removeIf((p_193953_0_) -> {
  32660. return !p_193953_0_.func_194212_c();
  32661. });
  32662. String s = this.field_193962_q.func_146179_b();
  32663. if(!s.isEmpty()) {
  32664. ObjectSet<RecipeList> objectset = new ObjectLinkedOpenHashSet(this.field_191888_F.func_193987_a(SearchTreeManager.field_194012_b).func_194038_a(s.toLowerCase(Locale.ROOT)));
  32665. list1.removeIf((p_193947_1_) -> {
  32666. return !lvt_5_1_.contains(p_193947_1_);
  32667. });
  32668. }
  32669.  
  32670. if(this.field_193964_s.func_192815_c()) {
  32671. list1.removeIf((p_193958_0_) -> {
  32672. return !p_193958_0_.func_192708_c();
  32673. });
  32674. }
  32675.  
  32676. this.field_193022_s.func_194192_a(list1, p_193003_1_);
  32677. }
  32678.  
  32679. private void func_193949_f() {
  32680. int int = (this.field_191904_o - 147) / 2 - this.field_191903_n - 30;
  32681. int int = (this.field_191905_p - 166) / 2 + 3;
  32682. int int = 27;
  32683. int int = 0;
  32684.  
  32685. for(GuiButtonRecipeTab guibuttonrecipetab : this.field_193018_j) {
  32686. CreativeTabs creativetabs = guibuttonrecipetab.func_191764_e();
  32687. if(creativetabs == CreativeTabs.field_78027_g) {
  32688. guibuttonrecipetab.field_146125_m = true;
  32689. guibuttonrecipetab.func_191752_c(int, int + 27 * int++);
  32690. } else if(guibuttonrecipetab.func_193919_e()) {
  32691. guibuttonrecipetab.func_191752_c(int, int + 27 * int++);
  32692. guibuttonrecipetab.func_193918_a(this.field_191888_F);
  32693. }
  32694. }
  32695.  
  32696. }
  32697.  
  32698. public void func_193957_d() {
  32699. if(this.func_191878_b()) {
  32700. if(this.field_193966_v != this.field_191888_F.field_71439_g.field_71071_by.func_194015_p()) {
  32701. this.func_193942_g();
  32702. this.field_193966_v = this.field_191888_F.field_71439_g.field_71071_by.func_194015_p();
  32703. }
  32704.  
  32705. }
  32706. }
  32707.  
  32708. private void func_193942_g() {
  32709. this.field_193965_u.func_194119_a();
  32710. this.field_191888_F.field_71439_g.field_71071_by.func_194016_a(this.field_193965_u, false);
  32711. this.field_193961_o.func_194018_a(this.field_193965_u);
  32712. this.func_193003_g(false);
  32713. }
  32714.  
  32715. public void func_191861_a(int p_191861_1_, int p_191861_2_, float p_191861_3_) {
  32716. if(this.func_191878_b()) {
  32717. RenderHelper.func_74520_c();
  32718. GlStateManager.func_179140_f();
  32719. GlStateManager.func_179094_E();
  32720. GlStateManager.func_179109_b(0.0F, 0.0F, 100.0F);
  32721. this.field_191888_F.func_110434_K().func_110577_a(field_191894_a);
  32722. GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
  32723. int int = (this.field_191904_o - 147) / 2 - this.field_191903_n;
  32724. int int = (this.field_191905_p - 166) / 2;
  32725. this.func_73729_b(int, int, 1, 1, 147, 166);
  32726. this.field_193962_q.func_146194_f();
  32727. RenderHelper.func_74518_a();
  32728.  
  32729. for(GuiButtonRecipeTab guibuttonrecipetab : this.field_193018_j) {
  32730. guibuttonrecipetab.func_191745_a(this.field_191888_F, p_191861_1_, p_191861_2_, p_191861_3_);
  32731. }
  32732.  
  32733. this.field_193960_m.func_191745_a(this.field_191888_F, p_191861_1_, p_191861_2_, p_191861_3_);
  32734. this.field_193022_s.func_194191_a(int, int, p_191861_1_, p_191861_2_, p_191861_3_);
  32735. GlStateManager.func_179121_F();
  32736. }
  32737. }
  32738.  
  32739. public void func_191876_c(int p_191876_1_, int p_191876_2_, int p_191876_3_, int p_191876_4_) {
  32740. if(this.func_191878_b()) {
  32741. this.field_193022_s.func_193721_a(p_191876_3_, p_191876_4_);
  32742. if(this.field_193960_m.func_146115_a()) {
  32743. String string = I18n.func_135052_a(this.field_193960_m.func_191754_c()?"gui.recipebook.toggleRecipes.craftable":"gui.recipebook.toggleRecipes.all", new Object[0]);
  32744. if(this.field_191888_F.field_71462_r != null) {
  32745. this.field_191888_F.field_71462_r.func_146279_a(string, p_191876_3_, p_191876_4_);
  32746. }
  32747. }
  32748.  
  32749. this.func_193015_d(p_191876_1_, p_191876_2_, p_191876_3_, p_191876_4_);
  32750. }
  32751. }
  32752.  
  32753. private void func_193015_d(int p_193015_1_, int p_193015_2_, int p_193015_3_, int p_193015_4_) {
  32754. ItemStack itemstack = null;
  32755.  
  32756. for(int int = 0; int < this.field_191915_z.func_192684_b(); ++int) {
  32757. GhostRecipe.GhostIngredient ghostrecipe$ghostingredient = this.field_191915_z.func_192681_a(int);
  32758. int int = ghostrecipe$ghostingredient.func_193713_b() + p_193015_1_;
  32759. int int = ghostrecipe$ghostingredient.func_193712_c() + p_193015_2_;
  32760. if(p_193015_3_ >= int && p_193015_4_ >= int && p_193015_3_ < int + 16 && p_193015_4_ < int + 16) {
  32761. itemstack = ghostrecipe$ghostingredient.func_194184_c();
  32762. }
  32763. }
  32764.  
  32765. if(itemstack != null && this.field_191888_F.field_71462_r != null) {
  32766. this.field_191888_F.field_71462_r.func_146283_a(this.field_191888_F.field_71462_r.func_191927_a(itemstack), p_193015_3_, p_193015_4_);
  32767. }
  32768.  
  32769. }
  32770.  
  32771. public void func_191864_a(int p_191864_1_, int p_191864_2_, boolean p_191864_3_, float p_191864_4_) {
  32772. this.field_191915_z.func_194188_a(this.field_191888_F, p_191864_1_, p_191864_2_, p_191864_3_, p_191864_4_);
  32773. }
  32774.  
  32775. public boolean func_191862_a(int p_191862_1_, int p_191862_2_, int p_191862_3_) {
  32776. if(this.func_191878_b() && !this.field_191888_F.field_71439_g.func_175149_v()) {
  32777. if(this.field_193022_s.func_194196_a(p_191862_1_, p_191862_2_, p_191862_3_, (this.field_191904_o - 147) / 2 - this.field_191903_n, (this.field_191905_p - 166) / 2, 147, 166)) {
  32778. IRecipe irecipe = this.field_193022_s.func_194193_a();
  32779. RecipeList recipelist = this.field_193022_s.func_194199_b();
  32780. if(irecipe != null && recipelist != null) {
  32781. this.func_193945_a(irecipe, recipelist);
  32782. if(!this.func_191880_f() && p_191862_3_ == 0) {
  32783. this.func_193006_a(false);
  32784. }
  32785. }
  32786.  
  32787. return true;
  32788. } else if(p_191862_3_ != 0) {
  32789. return false;
  32790. } else if(this.field_193962_q.func_146192_a(p_191862_1_, p_191862_2_, p_191862_3_)) {
  32791. return true;
  32792. } else if(this.field_193960_m.func_146116_c(this.field_191888_F, p_191862_1_, p_191862_2_)) {
  32793. boolean boolean = !this.field_193964_s.func_192815_c();
  32794. this.field_193964_s.func_192810_b(boolean);
  32795. this.field_193960_m.func_191753_b(boolean);
  32796. this.field_193960_m.func_146113_a(this.field_191888_F.func_147118_V());
  32797. this.func_193956_j();
  32798. this.func_193003_g(false);
  32799. return true;
  32800. } else {
  32801. for(GuiButtonRecipeTab guibuttonrecipetab : this.field_193018_j) {
  32802. if(guibuttonrecipetab.func_146116_c(this.field_191888_F, p_191862_1_, p_191862_2_)) {
  32803. if(this.field_191913_x != guibuttonrecipetab) {
  32804. guibuttonrecipetab.func_146113_a(this.field_191888_F.func_147118_V());
  32805. this.field_191913_x.func_191753_b(false);
  32806. this.field_191913_x = guibuttonrecipetab;
  32807. this.field_191913_x.func_191753_b(true);
  32808. this.func_193003_g(true);
  32809. }
  32810.  
  32811. return true;
  32812. }
  32813. }
  32814.  
  32815. return false;
  32816. }
  32817. } else {
  32818. return false;
  32819. }
  32820. }
  32821.  
  32822. public boolean func_193955_c(int p_193955_1_, int p_193955_2_, int p_193955_3_, int p_193955_4_, int p_193955_5_, int p_193955_6_) {
  32823. if(!this.func_191878_b()) {
  32824. return true;
  32825. } else {
  32826. boolean boolean = p_193955_1_ < p_193955_3_ || p_193955_2_ < p_193955_4_ || p_193955_1_ >= p_193955_3_ + p_193955_5_ || p_193955_2_ >= p_193955_4_ + p_193955_6_;
  32827. boolean boolean = p_193955_3_ - 147 < p_193955_1_ && p_193955_1_ < p_193955_3_ && p_193955_4_ < p_193955_2_ && p_193955_2_ < p_193955_4_ + p_193955_6_;
  32828. return boolean && !boolean && !this.field_191913_x.func_146116_c(this.field_191888_F, p_193955_1_, p_193955_2_);
  32829. }
  32830. }
  32831.  
  32832. public boolean func_191859_a(char p_191859_1_, int p_191859_2_) {
  32833. if(this.func_191878_b() && !this.field_191888_F.field_71439_g.func_175149_v()) {
  32834. if(p_191859_2_ == 1 && !this.func_191880_f()) {
  32835. this.func_193006_a(false);
  32836. return true;
  32837. } else {
  32838. if(GameSettings.func_100015_a(this.field_191888_F.field_71474_y.field_74310_D) && !this.field_193962_q.func_146206_l()) {
  32839. this.field_193962_q.func_146195_b(true);
  32840. } else if(this.field_193962_q.func_146201_a(p_191859_1_, p_191859_2_)) {
  32841. String string = this.field_193962_q.func_146179_b().toLowerCase(Locale.ROOT);
  32842. this.func_193716_a(string);
  32843. if(!string.equals(this.field_193963_r)) {
  32844. this.func_193003_g(false);
  32845. this.field_193963_r = string;
  32846. }
  32847.  
  32848. return true;
  32849. }
  32850.  
  32851. return false;
  32852. }
  32853. } else {
  32854. return false;
  32855. }
  32856. }
  32857.  
  32858. private void func_193716_a(String p_193716_1_) {
  32859. if("excitedze".equals(p_193716_1_)) {
  32860. LanguageManager languagemanager = this.field_191888_F.func_135016_M();
  32861. Language language = languagemanager.func_191960_a("en_pt");
  32862. if(languagemanager.func_135041_c().compareTo(language) == 0) {
  32863. return;
  32864. }
  32865.  
  32866. languagemanager.func_135045_a(language);
  32867. this.field_191888_F.field_71474_y.field_74363_ab = language.func_135034_a();
  32868. this.field_191888_F.func_110436_a();
  32869. this.field_191888_F.field_71466_p.func_78264_a(this.field_191888_F.func_135016_M().func_135042_a() || this.field_191888_F.field_71474_y.field_151455_aw);
  32870. this.field_191888_F.field_71466_p.func_78275_b(languagemanager.func_135044_b());
  32871. this.field_191888_F.field_71474_y.func_74303_b();
  32872. }
  32873.  
  32874. }
  32875.  
  32876. private boolean func_191880_f() {
  32877. return this.field_191903_n == 86;
  32878. }
  32879.  
  32880. public void func_193948_e() {
  32881. this.func_193949_f();
  32882. if(this.func_191878_b()) {
  32883. this.func_193003_g(false);
  32884. }
  32885.  
  32886. }
  32887.  
  32888. public void func_193001_a(List<IRecipe> p_193001_1_) {
  32889. for(IRecipe irecipe : p_193001_1_) {
  32890. this.field_191888_F.field_71439_g.func_193103_a(irecipe);
  32891. }
  32892.  
  32893. }
  32894.  
  32895. private void func_193945_a(IRecipe p_193945_1_, RecipeList p_193945_2_) {
  32896. boolean boolean = p_193945_2_.func_194213_a(p_193945_1_);
  32897. InventoryCraftResult inventorycraftresult = null;
  32898. if(this.field_191908_s instanceof ContainerWorkbench) {
  32899. inventorycraftresult = ((ContainerWorkbench)this.field_191908_s).field_75160_f;
  32900. } else if(this.field_191908_s instanceof ContainerPlayer) {
  32901. inventorycraftresult = ((ContainerPlayer)this.field_191908_s).field_75179_f;
  32902. }
  32903.  
  32904. if(inventorycraftresult != null) {
  32905. if(!boolean && this.field_191915_z.func_192686_c() == p_193945_1_) {
  32906. return;
  32907. }
  32908.  
  32909. if(!this.func_193941_i() && !this.field_191888_F.field_71439_g.func_184812_l_()) {
  32910. return;
  32911. }
  32912.  
  32913. if(boolean) {
  32914. this.func_193950_a(p_193945_1_, this.field_191908_s.field_75151_b, this.field_191908_s.field_75152_c, inventorycraftresult);
  32915. } else {
  32916. List<CPacketRecipePlacement.ItemMove> list = this.func_193954_a(inventorycraftresult);
  32917. this.func_193951_a(p_193945_1_, this.field_191908_s.field_75151_b);
  32918. if(!list.isEmpty()) {
  32919. this.field_191888_F.field_71442_b.func_192831_a(this.field_191908_s.field_75152_c, list, Lists.<CPacketRecipePlacement.ItemMove>newArrayList(), this.field_191888_F.field_71439_g);
  32920. if(this.field_193964_s.func_192815_c()) {
  32921. this.field_191888_F.field_71439_g.field_71071_by.func_70296_d();
  32922. }
  32923. }
  32924. }
  32925.  
  32926. if(!this.func_191880_f()) {
  32927. this.func_191866_a();
  32928. }
  32929. }
  32930.  
  32931. }
  32932.  
  32933. private void func_193950_a(IRecipe p_193950_1_, List<Slot> p_193950_2_, int p_193950_3_, InventoryCraftResult p_193950_4_) {
  32934. boolean boolean = p_193950_1_.func_77569_a(this.field_193961_o, this.field_191888_F.field_71441_e);
  32935. int int = this.field_193965_u.func_194114_b(p_193950_1_, (IntList)null);
  32936. if(boolean) {
  32937. boolean boolean = true;
  32938.  
  32939. for(int int = 0; int < this.field_193961_o.func_70302_i_(); ++int) {
  32940. ItemStack itemstack = this.field_193961_o.func_70301_a(int);
  32941. if(!itemstack.func_190926_b() && int > itemstack.func_190916_E()) {
  32942. boolean = false;
  32943. }
  32944. }
  32945.  
  32946. if(boolean) {
  32947. return;
  32948. }
  32949. }
  32950.  
  32951. int int = this.func_193943_a(int, boolean);
  32952. IntList intlist = new IntArrayList();
  32953. if(this.field_193965_u.func_194118_a(p_193950_1_, intlist, int)) {
  32954. int int = int;
  32955. IntListIterator lvt_10_1_ = intlist.iterator();
  32956.  
  32957. while(lvt_10_1_.hasNext()) {
  32958. int int = ((Integer)lvt_10_1_.next()).intValue();
  32959. int int = RecipeItemHelper.func_194115_b(int).func_77976_d();
  32960. if(int < int) {
  32961. int = int;
  32962. }
  32963. }
  32964.  
  32965. if(this.field_193965_u.func_194118_a(p_193950_1_, intlist, int)) {
  32966. List<CPacketRecipePlacement.ItemMove> list = this.func_193954_a(p_193950_4_);
  32967. lvt_10_1_ = Lists.<CPacketRecipePlacement.ItemMove>newArrayList();
  32968. this.func_193013_a(p_193950_1_, p_193950_2_, int, intlist, lvt_10_1_);
  32969. this.field_191888_F.field_71442_b.func_192831_a(p_193950_3_, list, lvt_10_1_, this.field_191888_F.field_71439_g);
  32970. this.field_191888_F.field_71439_g.field_71071_by.func_70296_d();
  32971. }
  32972. }
  32973. }
  32974.  
  32975. private List<CPacketRecipePlacement.ItemMove> func_193954_a(InventoryCraftResult p_193954_1_) {
  32976. this.field_191915_z.func_192682_a();
  32977. InventoryPlayer inventoryplayer = this.field_191888_F.field_71439_g.field_71071_by;
  32978. List<CPacketRecipePlacement.ItemMove> list = Lists.<CPacketRecipePlacement.ItemMove>newArrayList();
  32979.  
  32980. for(int int = 0; int < this.field_193961_o.func_70302_i_(); ++int) {
  32981. ItemStack itemstack = this.field_193961_o.func_70301_a(int);
  32982. if(!itemstack.func_190926_b()) {
  32983. while(itemstack.func_190916_E() > 0) {
  32984. int int = inventoryplayer.func_70432_d(itemstack);
  32985. if(int == -1) {
  32986. int = inventoryplayer.func_70447_i();
  32987. }
  32988.  
  32989. ItemStack itemstack1 = itemstack.func_77946_l();
  32990. itemstack1.func_190920_e(1);
  32991. if(inventoryplayer.func_191971_c(int, itemstack1)) {
  32992. itemstack1.func_190917_f(1);
  32993. } else {
  32994. field_193959_i.error("Can\'t find any space for item in inventory");
  32995. }
  32996.  
  32997. this.field_193961_o.func_70298_a(int, 1);
  32998. int int = int + 1;
  32999. list.add(new CPacketRecipePlacement.ItemMove(itemstack1.func_77946_l(), int, int));
  33000. }
  33001. }
  33002. }
  33003.  
  33004. this.field_193961_o.func_174888_l();
  33005. p_193954_1_.func_174888_l();
  33006. return list;
  33007. }
  33008.  
  33009. private int func_193943_a(int p_193943_1_, boolean p_193943_2_) {
  33010. int int = 1;
  33011. if(GuiScreen.func_146272_n()) {
  33012. int = p_193943_1_;
  33013. } else if(p_193943_2_) {
  33014. int = 64;
  33015.  
  33016. for(int int = 0; int < this.field_193961_o.func_70302_i_(); ++int) {
  33017. ItemStack itemstack = this.field_193961_o.func_70301_a(int);
  33018. if(!itemstack.func_190926_b() && int > itemstack.func_190916_E()) {
  33019. int = itemstack.func_190916_E();
  33020. }
  33021. }
  33022.  
  33023. if(int < 64) {
  33024. ++int;
  33025. }
  33026. }
  33027.  
  33028. return int;
  33029. }
  33030.  
  33031. private void func_193013_a(IRecipe p_193013_1_, List<Slot> p_193013_2_, int p_193013_3_, IntList p_193013_4_, List<CPacketRecipePlacement.ItemMove> p_193013_5_) {
  33032. int int = this.field_193961_o.func_174922_i();
  33033. int int = this.field_193961_o.func_174923_h();
  33034. if(p_193013_1_ instanceof ShapedRecipes) {
  33035. ShapedRecipes shapedrecipes = (ShapedRecipes)p_193013_1_;
  33036. int = shapedrecipes.func_192403_f();
  33037. int = shapedrecipes.func_192404_g();
  33038. }
  33039.  
  33040. int int = 1;
  33041. Iterator<Integer> iterator = p_193013_4_.iterator();
  33042.  
  33043. for(int int = 0; int < this.field_193961_o.func_174922_i() && int != int; ++int) {
  33044. for(int int = 0; int < this.field_193961_o.func_174923_h(); ++int) {
  33045. if(int == int || !iterator.hasNext()) {
  33046. int += this.field_193961_o.func_174922_i() - int;
  33047. break;
  33048. }
  33049.  
  33050. Slot slot = (Slot)p_193013_2_.get(int);
  33051. ItemStack itemstack = RecipeItemHelper.func_194115_b(((Integer)iterator.next()).intValue());
  33052. if(itemstack.func_190926_b()) {
  33053. ++int;
  33054. } else {
  33055. for(int int = 0; int < p_193013_3_; ++int) {
  33056. CPacketRecipePlacement.ItemMove cpacketrecipeplacement$itemmove = this.func_193946_a(int, slot, itemstack);
  33057. if(cpacketrecipeplacement$itemmove != null) {
  33058. p_193013_5_.add(cpacketrecipeplacement$itemmove);
  33059. }
  33060. }
  33061.  
  33062. ++int;
  33063. }
  33064. }
  33065.  
  33066. if(!iterator.hasNext()) {
  33067. break;
  33068. }
  33069. }
  33070.  
  33071. }
  33072.  
  33073. @Nullable
  33074. private CPacketRecipePlacement.ItemMove func_193946_a(int p_193946_1_, Slot p_193946_2_, ItemStack p_193946_3_) {
  33075. InventoryPlayer inventoryplayer = this.field_191888_F.field_71439_g.field_71071_by;
  33076. int int = inventoryplayer.func_194014_c(p_193946_3_);
  33077. if(int == -1) {
  33078. return null;
  33079. } else {
  33080. ItemStack itemstack = inventoryplayer.func_70301_a(int).func_77946_l();
  33081. if(itemstack.func_190926_b()) {
  33082. field_193959_i.error("Matched: " + p_193946_3_.func_77977_a() + " with empty item.");
  33083. return null;
  33084. } else {
  33085. if(itemstack.func_190916_E() > 1) {
  33086. inventoryplayer.func_70298_a(int, 1);
  33087. } else {
  33088. inventoryplayer.func_70304_b(int);
  33089. }
  33090.  
  33091. itemstack.func_190920_e(1);
  33092. if(p_193946_2_.func_75211_c().func_190926_b()) {
  33093. p_193946_2_.func_75215_d(itemstack);
  33094. } else {
  33095. p_193946_2_.func_75211_c().func_190917_f(1);
  33096. }
  33097.  
  33098. return new CPacketRecipePlacement.ItemMove(itemstack, p_193946_1_, int);
  33099. }
  33100. }
  33101. }
  33102.  
  33103. private boolean func_193941_i() {
  33104. InventoryPlayer inventoryplayer = this.field_191888_F.field_71439_g.field_71071_by;
  33105.  
  33106. for(int int = 0; int < this.field_193961_o.func_70302_i_(); ++int) {
  33107. ItemStack itemstack = this.field_193961_o.func_70301_a(int);
  33108. if(!itemstack.func_190926_b()) {
  33109. int int = inventoryplayer.func_70432_d(itemstack);
  33110. if(int == -1) {
  33111. int = inventoryplayer.func_70447_i();
  33112. }
  33113.  
  33114. if(int == -1) {
  33115. return false;
  33116. }
  33117. }
  33118. }
  33119.  
  33120. return true;
  33121. }
  33122.  
  33123. private void func_193951_a(IRecipe p_193951_1_, List<Slot> p_193951_2_) {
  33124. ItemStack itemstack = p_193951_1_.func_77571_b();
  33125. this.field_191915_z.func_192685_a(p_193951_1_);
  33126. this.field_191915_z.func_194187_a(Ingredient.func_193369_a(new ItemStack[]{itemstack}), ((Slot)p_193951_2_.get(0)).field_75223_e, ((Slot)p_193951_2_.get(0)).field_75221_f);
  33127. int int = this.field_193961_o.func_174922_i();
  33128. int int = this.field_193961_o.func_174923_h();
  33129. int int = p_193951_1_ instanceof ShapedRecipes?((ShapedRecipes)p_193951_1_).func_192403_f():int;
  33130. int int = 1;
  33131. Iterator<Ingredient> iterator = p_193951_1_.func_192400_c().iterator();
  33132.  
  33133. for(int int = 0; int < int; ++int) {
  33134. for(int int = 0; int < int; ++int) {
  33135. if(!iterator.hasNext()) {
  33136. return;
  33137. }
  33138.  
  33139. Ingredient ingredient = (Ingredient)iterator.next();
  33140. if(ingredient != Ingredient.field_193370_a) {
  33141. Slot slot = (Slot)p_193951_2_.get(int);
  33142. this.field_191915_z.func_194187_a(ingredient, slot.field_75223_e, slot.field_75221_f);
  33143. }
  33144.  
  33145. ++int;
  33146. }
  33147.  
  33148. if(int < int) {
  33149. int += int - int;
  33150. }
  33151. }
  33152.  
  33153. }
  33154.  
  33155. private void func_193956_j() {
  33156. if(this.field_191888_F.func_147114_u() != null) {
  33157. this.field_191888_F.func_147114_u().func_147297_a(new CPacketRecipeInfo(this.func_191878_b(), this.field_193964_s.func_192815_c()));
  33158. }
  33159.  
  33160. }
  33161. }
  33162.  
  33163. Hunk 2 failed! Cannot find hunk target
  33164.  
  33165. if (this.field_193965_u.func_194118_a(p_193950_1_, intlist, j1)) {
  33166. List<CPacketRecipePlacement.ItemMove> list2 = this.func_193954_a(p_193950_4_);
  33167. - lvt_10_1_ = Lists.<CPacketRecipePlacement.ItemMove>newArrayList();
  33168. - this.func_193013_a(p_193950_1_, p_193950_2_, j1, intlist, lvt_10_1_);
  33169. - this.field_191888_F.field_71442_b.func_192831_a(p_193950_3_, list2, lvt_10_1_, this.field_191888_F.field_71439_g);
  33170. + List<CPacketRecipePlacement.ItemMove> list3 = Lists.<CPacketRecipePlacement.ItemMove>newArrayList();
  33171. + this.func_193013_a(p_193950_1_, p_193950_2_, j1, intlist, list3);
  33172. + this.field_191888_F.field_71442_b.func_192831_a(p_193950_3_, list2, list3, this.field_191888_F.field_71439_g);
  33173. this.field_191888_F.field_71439_g.field_71071_by.func_70296_d();
  33174. }
  33175. }
  33176. File state
  33177. package net.minecraft.client.gui.recipebook;
  33178.  
  33179. import com.google.common.collect.Lists;
  33180. import it.unimi.dsi.fastutil.ints.IntArrayList;
  33181. import it.unimi.dsi.fastutil.ints.IntList;
  33182. import it.unimi.dsi.fastutil.ints.IntListIterator;
  33183. import it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet;
  33184. import it.unimi.dsi.fastutil.objects.ObjectSet;
  33185. import java.util.Iterator;
  33186. import java.util.List;
  33187. import java.util.Locale;
  33188. import java.util.function.Consumer;
  33189. import java.util.function.Predicate;
  33190. import javax.annotation.Nullable;
  33191. import net.minecraft.client.Minecraft;
  33192. import net.minecraft.client.gui.Gui;
  33193. import net.minecraft.client.gui.GuiButtonToggle;
  33194. import net.minecraft.client.gui.GuiScreen;
  33195. import net.minecraft.client.gui.GuiTextField;
  33196. import net.minecraft.client.gui.recipebook.GhostRecipe;
  33197. import net.minecraft.client.gui.recipebook.GuiButtonRecipeTab;
  33198. import net.minecraft.client.gui.recipebook.IRecipeUpdateListener;
  33199. import net.minecraft.client.gui.recipebook.RecipeBookPage;
  33200. import net.minecraft.client.gui.recipebook.RecipeList;
  33201. import net.minecraft.client.renderer.GlStateManager;
  33202. import net.minecraft.client.renderer.RenderHelper;
  33203. import net.minecraft.client.resources.I18n;
  33204. import net.minecraft.client.resources.Language;
  33205. import net.minecraft.client.resources.LanguageManager;
  33206. import net.minecraft.client.settings.GameSettings;
  33207. import net.minecraft.client.util.RecipeBookClient;
  33208. import net.minecraft.client.util.RecipeItemHelper;
  33209. import net.minecraft.client.util.SearchTreeManager;
  33210. import net.minecraft.creativetab.CreativeTabs;
  33211. import net.minecraft.entity.player.InventoryPlayer;
  33212. import net.minecraft.inventory.Container;
  33213. import net.minecraft.inventory.ContainerPlayer;
  33214. import net.minecraft.inventory.ContainerWorkbench;
  33215. import net.minecraft.inventory.InventoryCraftResult;
  33216. import net.minecraft.inventory.InventoryCrafting;
  33217. import net.minecraft.inventory.Slot;
  33218. import net.minecraft.item.ItemStack;
  33219. import net.minecraft.item.crafting.IRecipe;
  33220. import net.minecraft.item.crafting.Ingredient;
  33221. import net.minecraft.item.crafting.ShapedRecipes;
  33222. import net.minecraft.network.play.client.CPacketRecipeInfo;
  33223. import net.minecraft.network.play.client.CPacketRecipePlacement;
  33224. import net.minecraft.stats.RecipeBook;
  33225. import net.minecraft.util.ResourceLocation;
  33226. import net.minecraftforge.fml.relauncher.Side;
  33227. import net.minecraftforge.fml.relauncher.SideOnly;
  33228. import org.apache.logging.log4j.LogManager;
  33229. import org.apache.logging.log4j.Logger;
  33230. import org.lwjgl.input.Keyboard;
  33231.  
  33232. @SideOnly(Side.CLIENT)
  33233. public class GuiRecipeBook extends Gui implements IRecipeUpdateListener {
  33234. protected static final ResourceLocation field_191894_a = new ResourceLocation("textures/gui/recipe_book.png");
  33235. private int field_191903_n;
  33236. private int field_191904_o;
  33237. private int field_191905_p;
  33238. private static final Logger field_193959_i = LogManager.getLogger();
  33239. private final GhostRecipe field_191915_z = new GhostRecipe();
  33240. private final List<GuiButtonRecipeTab> field_193018_j = Lists.newArrayList(new GuiButtonRecipeTab[]{new GuiButtonRecipeTab(0, CreativeTabs.field_78027_g), new GuiButtonRecipeTab(0, CreativeTabs.field_78040_i), new GuiButtonRecipeTab(0, CreativeTabs.field_78030_b), new GuiButtonRecipeTab(0, CreativeTabs.field_78026_f), new GuiButtonRecipeTab(0, CreativeTabs.field_78028_d)});
  33241. private GuiButtonRecipeTab field_191913_x;
  33242. private GuiButtonToggle field_193960_m;
  33243. private Container field_191908_s;
  33244. private InventoryCrafting field_193961_o;
  33245. private Minecraft field_191888_F;
  33246. private GuiTextField field_193962_q;
  33247. private String field_193963_r = "";
  33248. private RecipeBook field_193964_s;
  33249. private final RecipeBookPage field_193022_s = new RecipeBookPage();
  33250. private RecipeItemHelper field_193965_u = new RecipeItemHelper();
  33251. private int field_193966_v;
  33252.  
  33253. public void func_191856_a(int p_191856_1_, int p_191856_2_, Minecraft p_191856_3_, boolean p_191856_4_, Container p_191856_5_, InventoryCrafting p_191856_6_) {
  33254. this.field_191888_F = p_191856_3_;
  33255. this.field_191904_o = p_191856_1_;
  33256. this.field_191905_p = p_191856_2_;
  33257. this.field_191908_s = p_191856_5_;
  33258. this.field_193961_o = p_191856_6_;
  33259. this.field_193964_s = p_191856_3_.field_71439_g.func_192035_E();
  33260. this.field_193966_v = p_191856_3_.field_71439_g.field_71071_by.func_194015_p();
  33261. this.field_191913_x = (GuiButtonRecipeTab)this.field_193018_j.get(0);
  33262. this.field_191913_x.func_191753_b(true);
  33263. if(this.func_191878_b()) {
  33264. this.func_193014_a(p_191856_4_, p_191856_6_);
  33265. }
  33266.  
  33267. Keyboard.enableRepeatEvents(true);
  33268. }
  33269.  
  33270. public void func_193014_a(boolean p_193014_1_, InventoryCrafting p_193014_2_) {
  33271. this.field_191903_n = p_193014_1_?0:86;
  33272. int i = (this.field_191904_o - 147) / 2 - this.field_191903_n;
  33273. int j = (this.field_191905_p - 166) / 2;
  33274. this.field_193965_u.func_194119_a();
  33275. this.field_191888_F.field_71439_g.field_71071_by.func_194016_a(this.field_193965_u, false);
  33276. p_193014_2_.func_194018_a(this.field_193965_u);
  33277. this.field_193962_q = new GuiTextField(0, this.field_191888_F.field_71466_p, i + 25, j + 14, 80, this.field_191888_F.field_71466_p.field_78288_b + 5);
  33278. this.field_193962_q.func_146203_f(50);
  33279. this.field_193962_q.func_146185_a(false);
  33280. this.field_193962_q.func_146189_e(true);
  33281. this.field_193962_q.func_146193_g(16777215);
  33282. this.field_193022_s.func_194194_a(this.field_191888_F, i, j);
  33283. this.field_193022_s.func_193732_a(this);
  33284. this.field_193960_m = new GuiButtonToggle(0, i + 110, j + 12, 26, 16, this.field_193964_s.func_192815_c());
  33285. this.field_193960_m.func_191751_a(152, 41, 28, 18, field_191894_a);
  33286. this.func_193003_g(false);
  33287. this.func_193949_f();
  33288. }
  33289.  
  33290. public void func_191871_c() {
  33291. Keyboard.enableRepeatEvents(false);
  33292. }
  33293.  
  33294. public int func_193011_a(boolean p_193011_1_, int p_193011_2_, int p_193011_3_) {
  33295. int i;
  33296. if(this.func_191878_b() && !p_193011_1_) {
  33297. i = 177 + (p_193011_2_ - p_193011_3_ - 200) / 2;
  33298. } else {
  33299. i = (p_193011_2_ - p_193011_3_) / 2;
  33300. }
  33301.  
  33302. return i;
  33303. }
  33304.  
  33305. public void func_191866_a() {
  33306. this.func_193006_a(!this.func_191878_b());
  33307. }
  33308.  
  33309. public boolean func_191878_b() {
  33310. return this.field_193964_s.func_192812_b();
  33311. }
  33312.  
  33313. private void func_193006_a(boolean p_193006_1_) {
  33314. this.field_193964_s.func_192813_a(p_193006_1_);
  33315. if(!p_193006_1_) {
  33316. this.field_193022_s.func_194200_c();
  33317. }
  33318.  
  33319. this.func_193956_j();
  33320. }
  33321.  
  33322. public void func_191874_a(@Nullable Slot p_191874_1_) {
  33323. if(p_191874_1_ != null && p_191874_1_.field_75222_d <= 9) {
  33324. this.field_191915_z.func_192682_a();
  33325. if(this.func_191878_b()) {
  33326. this.func_193942_g();
  33327. }
  33328. }
  33329.  
  33330. }
  33331.  
  33332. private void func_193003_g(boolean p_193003_1_) {
  33333. List<RecipeList> list = (List)RecipeBookClient.field_194086_e.get(this.field_191913_x.func_191764_e());
  33334. list.forEach((p_193944_1_) -> {
  33335. p_193944_1_.func_194210_a(this.field_193965_u, this.field_193961_o.func_174922_i(), this.field_193961_o.func_174923_h(), this.field_193964_s);
  33336. });
  33337. List<RecipeList> list1 = Lists.newArrayList(list);
  33338. list1.removeIf((p_193952_0_) -> {
  33339. return !p_193952_0_.func_194209_a();
  33340. });
  33341. list1.removeIf((p_193953_0_) -> {
  33342. return !p_193953_0_.func_194212_c();
  33343. });
  33344. String s = this.field_193962_q.func_146179_b();
  33345. if(!s.isEmpty()) {
  33346. ObjectSet<RecipeList> objectset = new ObjectLinkedOpenHashSet(this.field_191888_F.func_193987_a(SearchTreeManager.field_194012_b).func_194038_a(s.toLowerCase(Locale.ROOT)));
  33347. list1.removeIf((p_193947_1_) -> {
  33348. return !lvt_5_1_.contains(p_193947_1_);
  33349. });
  33350. }
  33351.  
  33352. if(this.field_193964_s.func_192815_c()) {
  33353. list1.removeIf((p_193958_0_) -> {
  33354. return !p_193958_0_.func_192708_c();
  33355. });
  33356. }
  33357.  
  33358. this.field_193022_s.func_194192_a(list1, p_193003_1_);
  33359. }
  33360.  
  33361. private void func_193949_f() {
  33362. int int = (this.field_191904_o - 147) / 2 - this.field_191903_n - 30;
  33363. int int = (this.field_191905_p - 166) / 2 + 3;
  33364. int int = 27;
  33365. int int = 0;
  33366.  
  33367. for(GuiButtonRecipeTab guibuttonrecipetab : this.field_193018_j) {
  33368. CreativeTabs creativetabs = guibuttonrecipetab.func_191764_e();
  33369. if(creativetabs == CreativeTabs.field_78027_g) {
  33370. guibuttonrecipetab.field_146125_m = true;
  33371. guibuttonrecipetab.func_191752_c(int, int + 27 * int++);
  33372. } else if(guibuttonrecipetab.func_193919_e()) {
  33373. guibuttonrecipetab.func_191752_c(int, int + 27 * int++);
  33374. guibuttonrecipetab.func_193918_a(this.field_191888_F);
  33375. }
  33376. }
  33377.  
  33378. }
  33379.  
  33380. public void func_193957_d() {
  33381. if(this.func_191878_b()) {
  33382. if(this.field_193966_v != this.field_191888_F.field_71439_g.field_71071_by.func_194015_p()) {
  33383. this.func_193942_g();
  33384. this.field_193966_v = this.field_191888_F.field_71439_g.field_71071_by.func_194015_p();
  33385. }
  33386.  
  33387. }
  33388. }
  33389.  
  33390. private void func_193942_g() {
  33391. this.field_193965_u.func_194119_a();
  33392. this.field_191888_F.field_71439_g.field_71071_by.func_194016_a(this.field_193965_u, false);
  33393. this.field_193961_o.func_194018_a(this.field_193965_u);
  33394. this.func_193003_g(false);
  33395. }
  33396.  
  33397. public void func_191861_a(int p_191861_1_, int p_191861_2_, float p_191861_3_) {
  33398. if(this.func_191878_b()) {
  33399. RenderHelper.func_74520_c();
  33400. GlStateManager.func_179140_f();
  33401. GlStateManager.func_179094_E();
  33402. GlStateManager.func_179109_b(0.0F, 0.0F, 100.0F);
  33403. this.field_191888_F.func_110434_K().func_110577_a(field_191894_a);
  33404. GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
  33405. int int = (this.field_191904_o - 147) / 2 - this.field_191903_n;
  33406. int int = (this.field_191905_p - 166) / 2;
  33407. this.func_73729_b(int, int, 1, 1, 147, 166);
  33408. this.field_193962_q.func_146194_f();
  33409. RenderHelper.func_74518_a();
  33410.  
  33411. for(GuiButtonRecipeTab guibuttonrecipetab : this.field_193018_j) {
  33412. guibuttonrecipetab.func_191745_a(this.field_191888_F, p_191861_1_, p_191861_2_, p_191861_3_);
  33413. }
  33414.  
  33415. this.field_193960_m.func_191745_a(this.field_191888_F, p_191861_1_, p_191861_2_, p_191861_3_);
  33416. this.field_193022_s.func_194191_a(int, int, p_191861_1_, p_191861_2_, p_191861_3_);
  33417. GlStateManager.func_179121_F();
  33418. }
  33419. }
  33420.  
  33421. public void func_191876_c(int p_191876_1_, int p_191876_2_, int p_191876_3_, int p_191876_4_) {
  33422. if(this.func_191878_b()) {
  33423. this.field_193022_s.func_193721_a(p_191876_3_, p_191876_4_);
  33424. if(this.field_193960_m.func_146115_a()) {
  33425. String string = I18n.func_135052_a(this.field_193960_m.func_191754_c()?"gui.recipebook.toggleRecipes.craftable":"gui.recipebook.toggleRecipes.all", new Object[0]);
  33426. if(this.field_191888_F.field_71462_r != null) {
  33427. this.field_191888_F.field_71462_r.func_146279_a(string, p_191876_3_, p_191876_4_);
  33428. }
  33429. }
  33430.  
  33431. this.func_193015_d(p_191876_1_, p_191876_2_, p_191876_3_, p_191876_4_);
  33432. }
  33433. }
  33434.  
  33435. private void func_193015_d(int p_193015_1_, int p_193015_2_, int p_193015_3_, int p_193015_4_) {
  33436. ItemStack itemstack = null;
  33437.  
  33438. for(int int = 0; int < this.field_191915_z.func_192684_b(); ++int) {
  33439. GhostRecipe.GhostIngredient ghostrecipe$ghostingredient = this.field_191915_z.func_192681_a(int);
  33440. int int = ghostrecipe$ghostingredient.func_193713_b() + p_193015_1_;
  33441. int int = ghostrecipe$ghostingredient.func_193712_c() + p_193015_2_;
  33442. if(p_193015_3_ >= int && p_193015_4_ >= int && p_193015_3_ < int + 16 && p_193015_4_ < int + 16) {
  33443. itemstack = ghostrecipe$ghostingredient.func_194184_c();
  33444. }
  33445. }
  33446.  
  33447. if(itemstack != null && this.field_191888_F.field_71462_r != null) {
  33448. this.field_191888_F.field_71462_r.func_146283_a(this.field_191888_F.field_71462_r.func_191927_a(itemstack), p_193015_3_, p_193015_4_);
  33449. }
  33450.  
  33451. }
  33452.  
  33453. public void func_191864_a(int p_191864_1_, int p_191864_2_, boolean p_191864_3_, float p_191864_4_) {
  33454. this.field_191915_z.func_194188_a(this.field_191888_F, p_191864_1_, p_191864_2_, p_191864_3_, p_191864_4_);
  33455. }
  33456.  
  33457. public boolean func_191862_a(int p_191862_1_, int p_191862_2_, int p_191862_3_) {
  33458. if(this.func_191878_b() && !this.field_191888_F.field_71439_g.func_175149_v()) {
  33459. if(this.field_193022_s.func_194196_a(p_191862_1_, p_191862_2_, p_191862_3_, (this.field_191904_o - 147) / 2 - this.field_191903_n, (this.field_191905_p - 166) / 2, 147, 166)) {
  33460. IRecipe irecipe = this.field_193022_s.func_194193_a();
  33461. RecipeList recipelist = this.field_193022_s.func_194199_b();
  33462. if(irecipe != null && recipelist != null) {
  33463. this.func_193945_a(irecipe, recipelist);
  33464. if(!this.func_191880_f() && p_191862_3_ == 0) {
  33465. this.func_193006_a(false);
  33466. }
  33467. }
  33468.  
  33469. return true;
  33470. } else if(p_191862_3_ != 0) {
  33471. return false;
  33472. } else if(this.field_193962_q.func_146192_a(p_191862_1_, p_191862_2_, p_191862_3_)) {
  33473. return true;
  33474. } else if(this.field_193960_m.func_146116_c(this.field_191888_F, p_191862_1_, p_191862_2_)) {
  33475. boolean boolean = !this.field_193964_s.func_192815_c();
  33476. this.field_193964_s.func_192810_b(boolean);
  33477. this.field_193960_m.func_191753_b(boolean);
  33478. this.field_193960_m.func_146113_a(this.field_191888_F.func_147118_V());
  33479. this.func_193956_j();
  33480. this.func_193003_g(false);
  33481. return true;
  33482. } else {
  33483. for(GuiButtonRecipeTab guibuttonrecipetab : this.field_193018_j) {
  33484. if(guibuttonrecipetab.func_146116_c(this.field_191888_F, p_191862_1_, p_191862_2_)) {
  33485. if(this.field_191913_x != guibuttonrecipetab) {
  33486. guibuttonrecipetab.func_146113_a(this.field_191888_F.func_147118_V());
  33487. this.field_191913_x.func_191753_b(false);
  33488. this.field_191913_x = guibuttonrecipetab;
  33489. this.field_191913_x.func_191753_b(true);
  33490. this.func_193003_g(true);
  33491. }
  33492.  
  33493. return true;
  33494. }
  33495. }
  33496.  
  33497. return false;
  33498. }
  33499. } else {
  33500. return false;
  33501. }
  33502. }
  33503.  
  33504. public boolean func_193955_c(int p_193955_1_, int p_193955_2_, int p_193955_3_, int p_193955_4_, int p_193955_5_, int p_193955_6_) {
  33505. if(!this.func_191878_b()) {
  33506. return true;
  33507. } else {
  33508. boolean boolean = p_193955_1_ < p_193955_3_ || p_193955_2_ < p_193955_4_ || p_193955_1_ >= p_193955_3_ + p_193955_5_ || p_193955_2_ >= p_193955_4_ + p_193955_6_;
  33509. boolean boolean = p_193955_3_ - 147 < p_193955_1_ && p_193955_1_ < p_193955_3_ && p_193955_4_ < p_193955_2_ && p_193955_2_ < p_193955_4_ + p_193955_6_;
  33510. return boolean && !boolean && !this.field_191913_x.func_146116_c(this.field_191888_F, p_193955_1_, p_193955_2_);
  33511. }
  33512. }
  33513.  
  33514. public boolean func_191859_a(char p_191859_1_, int p_191859_2_) {
  33515. if(this.func_191878_b() && !this.field_191888_F.field_71439_g.func_175149_v()) {
  33516. if(p_191859_2_ == 1 && !this.func_191880_f()) {
  33517. this.func_193006_a(false);
  33518. return true;
  33519. } else {
  33520. if(GameSettings.func_100015_a(this.field_191888_F.field_71474_y.field_74310_D) && !this.field_193962_q.func_146206_l()) {
  33521. this.field_193962_q.func_146195_b(true);
  33522. } else if(this.field_193962_q.func_146201_a(p_191859_1_, p_191859_2_)) {
  33523. String string = this.field_193962_q.func_146179_b().toLowerCase(Locale.ROOT);
  33524. this.func_193716_a(string);
  33525. if(!string.equals(this.field_193963_r)) {
  33526. this.func_193003_g(false);
  33527. this.field_193963_r = string;
  33528. }
  33529.  
  33530. return true;
  33531. }
  33532.  
  33533. return false;
  33534. }
  33535. } else {
  33536. return false;
  33537. }
  33538. }
  33539.  
  33540. private void func_193716_a(String p_193716_1_) {
  33541. if("excitedze".equals(p_193716_1_)) {
  33542. LanguageManager languagemanager = this.field_191888_F.func_135016_M();
  33543. Language language = languagemanager.func_191960_a("en_pt");
  33544. if(languagemanager.func_135041_c().compareTo(language) == 0) {
  33545. return;
  33546. }
  33547.  
  33548. languagemanager.func_135045_a(language);
  33549. this.field_191888_F.field_71474_y.field_74363_ab = language.func_135034_a();
  33550. this.field_191888_F.func_110436_a();
  33551. this.field_191888_F.field_71466_p.func_78264_a(this.field_191888_F.func_135016_M().func_135042_a() || this.field_191888_F.field_71474_y.field_151455_aw);
  33552. this.field_191888_F.field_71466_p.func_78275_b(languagemanager.func_135044_b());
  33553. this.field_191888_F.field_71474_y.func_74303_b();
  33554. }
  33555.  
  33556. }
  33557.  
  33558. private boolean func_191880_f() {
  33559. return this.field_191903_n == 86;
  33560. }
  33561.  
  33562. public void func_193948_e() {
  33563. this.func_193949_f();
  33564. if(this.func_191878_b()) {
  33565. this.func_193003_g(false);
  33566. }
  33567.  
  33568. }
  33569.  
  33570. public void func_193001_a(List<IRecipe> p_193001_1_) {
  33571. for(IRecipe irecipe : p_193001_1_) {
  33572. this.field_191888_F.field_71439_g.func_193103_a(irecipe);
  33573. }
  33574.  
  33575. }
  33576.  
  33577. private void func_193945_a(IRecipe p_193945_1_, RecipeList p_193945_2_) {
  33578. boolean boolean = p_193945_2_.func_194213_a(p_193945_1_);
  33579. InventoryCraftResult inventorycraftresult = null;
  33580. if(this.field_191908_s instanceof ContainerWorkbench) {
  33581. inventorycraftresult = ((ContainerWorkbench)this.field_191908_s).field_75160_f;
  33582. } else if(this.field_191908_s instanceof ContainerPlayer) {
  33583. inventorycraftresult = ((ContainerPlayer)this.field_191908_s).field_75179_f;
  33584. }
  33585.  
  33586. if(inventorycraftresult != null) {
  33587. if(!boolean && this.field_191915_z.func_192686_c() == p_193945_1_) {
  33588. return;
  33589. }
  33590.  
  33591. if(!this.func_193941_i() && !this.field_191888_F.field_71439_g.func_184812_l_()) {
  33592. return;
  33593. }
  33594.  
  33595. if(boolean) {
  33596. this.func_193950_a(p_193945_1_, this.field_191908_s.field_75151_b, this.field_191908_s.field_75152_c, inventorycraftresult);
  33597. } else {
  33598. List<CPacketRecipePlacement.ItemMove> list = this.func_193954_a(inventorycraftresult);
  33599. this.func_193951_a(p_193945_1_, this.field_191908_s.field_75151_b);
  33600. if(!list.isEmpty()) {
  33601. this.field_191888_F.field_71442_b.func_192831_a(this.field_191908_s.field_75152_c, list, Lists.<CPacketRecipePlacement.ItemMove>newArrayList(), this.field_191888_F.field_71439_g);
  33602. if(this.field_193964_s.func_192815_c()) {
  33603. this.field_191888_F.field_71439_g.field_71071_by.func_70296_d();
  33604. }
  33605. }
  33606. }
  33607.  
  33608. if(!this.func_191880_f()) {
  33609. this.func_191866_a();
  33610. }
  33611. }
  33612.  
  33613. }
  33614.  
  33615. private void func_193950_a(IRecipe p_193950_1_, List<Slot> p_193950_2_, int p_193950_3_, InventoryCraftResult p_193950_4_) {
  33616. boolean boolean = p_193950_1_.func_77569_a(this.field_193961_o, this.field_191888_F.field_71441_e);
  33617. int int = this.field_193965_u.func_194114_b(p_193950_1_, (IntList)null);
  33618. if(boolean) {
  33619. boolean boolean = true;
  33620.  
  33621. for(int int = 0; int < this.field_193961_o.func_70302_i_(); ++int) {
  33622. ItemStack itemstack = this.field_193961_o.func_70301_a(int);
  33623. if(!itemstack.func_190926_b() && int > itemstack.func_190916_E()) {
  33624. boolean = false;
  33625. }
  33626. }
  33627.  
  33628. if(boolean) {
  33629. return;
  33630. }
  33631. }
  33632.  
  33633. int int = this.func_193943_a(int, boolean);
  33634. IntList intlist = new IntArrayList();
  33635. if(this.field_193965_u.func_194118_a(p_193950_1_, intlist, int)) {
  33636. int int = int;
  33637. IntListIterator lvt_10_1_ = intlist.iterator();
  33638.  
  33639. while(lvt_10_1_.hasNext()) {
  33640. int int = ((Integer)lvt_10_1_.next()).intValue();
  33641. int int = RecipeItemHelper.func_194115_b(int).func_77976_d();
  33642. if(int < int) {
  33643. int = int;
  33644. }
  33645. }
  33646.  
  33647. if(this.field_193965_u.func_194118_a(p_193950_1_, intlist, int)) {
  33648. List<CPacketRecipePlacement.ItemMove> list = this.func_193954_a(p_193950_4_);
  33649. lvt_10_1_ = Lists.<CPacketRecipePlacement.ItemMove>newArrayList();
  33650. this.func_193013_a(p_193950_1_, p_193950_2_, int, intlist, lvt_10_1_);
  33651. this.field_191888_F.field_71442_b.func_192831_a(p_193950_3_, list, lvt_10_1_, this.field_191888_F.field_71439_g);
  33652. this.field_191888_F.field_71439_g.field_71071_by.func_70296_d();
  33653. }
  33654. }
  33655. }
  33656.  
  33657. private List<CPacketRecipePlacement.ItemMove> func_193954_a(InventoryCraftResult p_193954_1_) {
  33658. this.field_191915_z.func_192682_a();
  33659. InventoryPlayer inventoryplayer = this.field_191888_F.field_71439_g.field_71071_by;
  33660. List<CPacketRecipePlacement.ItemMove> list = Lists.<CPacketRecipePlacement.ItemMove>newArrayList();
  33661.  
  33662. for(int int = 0; int < this.field_193961_o.func_70302_i_(); ++int) {
  33663. ItemStack itemstack = this.field_193961_o.func_70301_a(int);
  33664. if(!itemstack.func_190926_b()) {
  33665. while(itemstack.func_190916_E() > 0) {
  33666. int int = inventoryplayer.func_70432_d(itemstack);
  33667. if(int == -1) {
  33668. int = inventoryplayer.func_70447_i();
  33669. }
  33670.  
  33671. ItemStack itemstack1 = itemstack.func_77946_l();
  33672. itemstack1.func_190920_e(1);
  33673. if(inventoryplayer.func_191971_c(int, itemstack1)) {
  33674. itemstack1.func_190917_f(1);
  33675. } else {
  33676. field_193959_i.error("Can\'t find any space for item in inventory");
  33677. }
  33678.  
  33679. this.field_193961_o.func_70298_a(int, 1);
  33680. int int = int + 1;
  33681. list.add(new CPacketRecipePlacement.ItemMove(itemstack1.func_77946_l(), int, int));
  33682. }
  33683. }
  33684. }
  33685.  
  33686. this.field_193961_o.func_174888_l();
  33687. p_193954_1_.func_174888_l();
  33688. return list;
  33689. }
  33690.  
  33691. private int func_193943_a(int p_193943_1_, boolean p_193943_2_) {
  33692. int int = 1;
  33693. if(GuiScreen.func_146272_n()) {
  33694. int = p_193943_1_;
  33695. } else if(p_193943_2_) {
  33696. int = 64;
  33697.  
  33698. for(int int = 0; int < this.field_193961_o.func_70302_i_(); ++int) {
  33699. ItemStack itemstack = this.field_193961_o.func_70301_a(int);
  33700. if(!itemstack.func_190926_b() && int > itemstack.func_190916_E()) {
  33701. int = itemstack.func_190916_E();
  33702. }
  33703. }
  33704.  
  33705. if(int < 64) {
  33706. ++int;
  33707. }
  33708. }
  33709.  
  33710. return int;
  33711. }
  33712.  
  33713. private void func_193013_a(IRecipe p_193013_1_, List<Slot> p_193013_2_, int p_193013_3_, IntList p_193013_4_, List<CPacketRecipePlacement.ItemMove> p_193013_5_) {
  33714. int int = this.field_193961_o.func_174922_i();
  33715. int int = this.field_193961_o.func_174923_h();
  33716. if(p_193013_1_ instanceof ShapedRecipes) {
  33717. ShapedRecipes shapedrecipes = (ShapedRecipes)p_193013_1_;
  33718. int = shapedrecipes.func_192403_f();
  33719. int = shapedrecipes.func_192404_g();
  33720. }
  33721.  
  33722. int int = 1;
  33723. Iterator<Integer> iterator = p_193013_4_.iterator();
  33724.  
  33725. for(int int = 0; int < this.field_193961_o.func_174922_i() && int != int; ++int) {
  33726. for(int int = 0; int < this.field_193961_o.func_174923_h(); ++int) {
  33727. if(int == int || !iterator.hasNext()) {
  33728. int += this.field_193961_o.func_174922_i() - int;
  33729. break;
  33730. }
  33731.  
  33732. Slot slot = (Slot)p_193013_2_.get(int);
  33733. ItemStack itemstack = RecipeItemHelper.func_194115_b(((Integer)iterator.next()).intValue());
  33734. if(itemstack.func_190926_b()) {
  33735. ++int;
  33736. } else {
  33737. for(int int = 0; int < p_193013_3_; ++int) {
  33738. CPacketRecipePlacement.ItemMove cpacketrecipeplacement$itemmove = this.func_193946_a(int, slot, itemstack);
  33739. if(cpacketrecipeplacement$itemmove != null) {
  33740. p_193013_5_.add(cpacketrecipeplacement$itemmove);
  33741. }
  33742. }
  33743.  
  33744. ++int;
  33745. }
  33746. }
  33747.  
  33748. if(!iterator.hasNext()) {
  33749. break;
  33750. }
  33751. }
  33752.  
  33753. }
  33754.  
  33755. @Nullable
  33756. private CPacketRecipePlacement.ItemMove func_193946_a(int p_193946_1_, Slot p_193946_2_, ItemStack p_193946_3_) {
  33757. InventoryPlayer inventoryplayer = this.field_191888_F.field_71439_g.field_71071_by;
  33758. int int = inventoryplayer.func_194014_c(p_193946_3_);
  33759. if(int == -1) {
  33760. return null;
  33761. } else {
  33762. ItemStack itemstack = inventoryplayer.func_70301_a(int).func_77946_l();
  33763. if(itemstack.func_190926_b()) {
  33764. field_193959_i.error("Matched: " + p_193946_3_.func_77977_a() + " with empty item.");
  33765. return null;
  33766. } else {
  33767. if(itemstack.func_190916_E() > 1) {
  33768. inventoryplayer.func_70298_a(int, 1);
  33769. } else {
  33770. inventoryplayer.func_70304_b(int);
  33771. }
  33772.  
  33773. itemstack.func_190920_e(1);
  33774. if(p_193946_2_.func_75211_c().func_190926_b()) {
  33775. p_193946_2_.func_75215_d(itemstack);
  33776. } else {
  33777. p_193946_2_.func_75211_c().func_190917_f(1);
  33778. }
  33779.  
  33780. return new CPacketRecipePlacement.ItemMove(itemstack, p_193946_1_, int);
  33781. }
  33782. }
  33783. }
  33784.  
  33785. private boolean func_193941_i() {
  33786. InventoryPlayer inventoryplayer = this.field_191888_F.field_71439_g.field_71071_by;
  33787.  
  33788. for(int int = 0; int < this.field_193961_o.func_70302_i_(); ++int) {
  33789. ItemStack itemstack = this.field_193961_o.func_70301_a(int);
  33790. if(!itemstack.func_190926_b()) {
  33791. int int = inventoryplayer.func_70432_d(itemstack);
  33792. if(int == -1) {
  33793. int = inventoryplayer.func_70447_i();
  33794. }
  33795.  
  33796. if(int == -1) {
  33797. return false;
  33798. }
  33799. }
  33800. }
  33801.  
  33802. return true;
  33803. }
  33804.  
  33805. private void func_193951_a(IRecipe p_193951_1_, List<Slot> p_193951_2_) {
  33806. ItemStack itemstack = p_193951_1_.func_77571_b();
  33807. this.field_191915_z.func_192685_a(p_193951_1_);
  33808. this.field_191915_z.func_194187_a(Ingredient.func_193369_a(new ItemStack[]{itemstack}), ((Slot)p_193951_2_.get(0)).field_75223_e, ((Slot)p_193951_2_.get(0)).field_75221_f);
  33809. int int = this.field_193961_o.func_174922_i();
  33810. int int = this.field_193961_o.func_174923_h();
  33811. int int = p_193951_1_ instanceof ShapedRecipes?((ShapedRecipes)p_193951_1_).func_192403_f():int;
  33812. int int = 1;
  33813. Iterator<Ingredient> iterator = p_193951_1_.func_192400_c().iterator();
  33814.  
  33815. for(int int = 0; int < int; ++int) {
  33816. for(int int = 0; int < int; ++int) {
  33817. if(!iterator.hasNext()) {
  33818. return;
  33819. }
  33820.  
  33821. Ingredient ingredient = (Ingredient)iterator.next();
  33822. if(ingredient != Ingredient.field_193370_a) {
  33823. Slot slot = (Slot)p_193951_2_.get(int);
  33824. this.field_191915_z.func_194187_a(ingredient, slot.field_75223_e, slot.field_75221_f);
  33825. }
  33826.  
  33827. ++int;
  33828. }
  33829.  
  33830. if(int < int) {
  33831. int += int - int;
  33832. }
  33833. }
  33834.  
  33835. }
  33836.  
  33837. private void func_193956_j() {
  33838. if(this.field_191888_F.func_147114_u() != null) {
  33839. this.field_191888_F.func_147114_u().func_147297_a(new CPacketRecipeInfo(this.func_191878_b(), this.field_193964_s.func_192815_c()));
  33840. }
  33841.  
  33842. }
  33843. }
  33844.  
  33845. Patching failed: minecraft\net\minecraft\client\network\NetHandlerPlayClient.java
  33846. Hunk 1 failed! Cannot find hunk target
  33847. break;
  33848. case ADD:
  33849. p_191980_1_.func_192595_a().forEach((p_194025_2_) -> {
  33850. - p_194025_1_.func_194073_a(p_194025_2_);
  33851. - p_194025_1_.func_193825_e(p_194025_2_);
  33852. + recipebook.func_194073_a(p_194025_2_);
  33853. + recipebook.func_193825_e(p_194025_2_);
  33854. RecipeToast.func_193665_a(this.field_147299_f.func_193033_an(), p_194025_2_);
  33855. });
  33856. }
  33857.  
  33858. RecipeBookClient.field_194087_f.forEach((p_194023_1_) -> {
  33859. - p_194023_1_.func_194214_a(p_194023_0_);
  33860. + p_194023_1_.func_194214_a(recipebook);
  33861. });
  33862. if (this.field_147299_f.field_71462_r instanceof IRecipeShownListener) {
  33863. ((IRecipeShownListener)this.field_147299_f.field_71462_r).func_192043_J_();
  33864. File state
  33865. package net.minecraft.client.network;
  33866.  
  33867. import com.google.common.collect.Maps;
  33868. import com.google.common.util.concurrent.FutureCallback;
  33869. import com.google.common.util.concurrent.Futures;
  33870. import com.mojang.authlib.GameProfile;
  33871. import io.netty.buffer.Unpooled;
  33872. import java.io.File;
  33873. import java.io.IOException;
  33874. import java.io.UnsupportedEncodingException;
  33875. import java.net.URI;
  33876. import java.net.URISyntaxException;
  33877. import java.net.URLDecoder;
  33878. import java.nio.charset.StandardCharsets;
  33879. import java.util.Arrays;
  33880. import java.util.Collection;
  33881. import java.util.Iterator;
  33882. import java.util.List;
  33883. import java.util.Map;
  33884. import java.util.Random;
  33885. import java.util.UUID;
  33886. import java.util.Map.Entry;
  33887. import java.util.function.Consumer;
  33888. import javax.annotation.Nullable;
  33889. import net.minecraft.advancements.Advancement;
  33890. import net.minecraft.block.Block;
  33891. import net.minecraft.client.ClientBrandRetriever;
  33892. import net.minecraft.client.Minecraft;
  33893. import net.minecraft.client.audio.GuardianSound;
  33894. import net.minecraft.client.audio.ISound;
  33895. import net.minecraft.client.audio.PositionedSoundRecord;
  33896. import net.minecraft.client.entity.EntityOtherPlayerMP;
  33897. import net.minecraft.client.entity.EntityPlayerSP;
  33898. import net.minecraft.client.gui.GuiCommandBlock;
  33899. import net.minecraft.client.gui.GuiDisconnected;
  33900. import net.minecraft.client.gui.GuiDownloadTerrain;
  33901. import net.minecraft.client.gui.GuiGameOver;
  33902. import net.minecraft.client.gui.GuiMainMenu;
  33903. import net.minecraft.client.gui.GuiMerchant;
  33904. import net.minecraft.client.gui.GuiMultiplayer;
  33905. import net.minecraft.client.gui.GuiScreen;
  33906. import net.minecraft.client.gui.GuiScreenBook;
  33907. import net.minecraft.client.gui.GuiScreenDemo;
  33908. import net.minecraft.client.gui.GuiScreenRealmsProxy;
  33909. import net.minecraft.client.gui.GuiWinGame;
  33910. import net.minecraft.client.gui.GuiYesNo;
  33911. import net.minecraft.client.gui.GuiYesNoCallback;
  33912. import net.minecraft.client.gui.IProgressMeter;
  33913. import net.minecraft.client.gui.MapItemRenderer;
  33914. import net.minecraft.client.gui.inventory.GuiContainerCreative;
  33915. import net.minecraft.client.gui.recipebook.IRecipeShownListener;
  33916. import net.minecraft.client.gui.toasts.RecipeToast;
  33917. import net.minecraft.client.multiplayer.ClientAdvancementManager;
  33918. import net.minecraft.client.multiplayer.PlayerControllerMP;
  33919. import net.minecraft.client.multiplayer.ServerData;
  33920. import net.minecraft.client.multiplayer.ServerList;
  33921. import net.minecraft.client.multiplayer.WorldClient;
  33922. import net.minecraft.client.network.NetworkPlayerInfo;
  33923. import net.minecraft.client.particle.ParticleItemPickup;
  33924. import net.minecraft.client.player.inventory.ContainerLocalMenu;
  33925. import net.minecraft.client.player.inventory.LocalBlockIntercommunication;
  33926. import net.minecraft.client.renderer.debug.DebugRendererNeighborsUpdate;
  33927. import net.minecraft.client.renderer.debug.DebugRendererPathfinding;
  33928. import net.minecraft.client.resources.I18n;
  33929. import net.minecraft.client.settings.GameSettings;
  33930. import net.minecraft.client.util.RecipeBookClient;
  33931. import net.minecraft.creativetab.CreativeTabs;
  33932. import net.minecraft.entity.Entity;
  33933. import net.minecraft.entity.EntityAreaEffectCloud;
  33934. import net.minecraft.entity.EntityLeashKnot;
  33935. import net.minecraft.entity.EntityList;
  33936. import net.minecraft.entity.EntityLiving;
  33937. import net.minecraft.entity.EntityLivingBase;
  33938. import net.minecraft.entity.EntityTracker;
  33939. import net.minecraft.entity.IMerchant;
  33940. import net.minecraft.entity.NpcMerchant;
  33941. import net.minecraft.entity.ai.attributes.AbstractAttributeMap;
  33942. import net.minecraft.entity.ai.attributes.AttributeModifier;
  33943. import net.minecraft.entity.ai.attributes.IAttribute;
  33944. import net.minecraft.entity.ai.attributes.IAttributeInstance;
  33945. import net.minecraft.entity.ai.attributes.RangedAttribute;
  33946. import net.minecraft.entity.effect.EntityLightningBolt;
  33947. import net.minecraft.entity.item.EntityArmorStand;
  33948. import net.minecraft.entity.item.EntityBoat;
  33949. import net.minecraft.entity.item.EntityEnderCrystal;
  33950. import net.minecraft.entity.item.EntityEnderEye;
  33951. import net.minecraft.entity.item.EntityEnderPearl;
  33952. import net.minecraft.entity.item.EntityExpBottle;
  33953. import net.minecraft.entity.item.EntityFallingBlock;
  33954. import net.minecraft.entity.item.EntityFireworkRocket;
  33955. import net.minecraft.entity.item.EntityItem;
  33956. import net.minecraft.entity.item.EntityItemFrame;
  33957. import net.minecraft.entity.item.EntityMinecart;
  33958. import net.minecraft.entity.item.EntityPainting;
  33959. import net.minecraft.entity.item.EntityTNTPrimed;
  33960. import net.minecraft.entity.item.EntityXPOrb;
  33961. import net.minecraft.entity.monster.EntityGuardian;
  33962. import net.minecraft.entity.passive.AbstractHorse;
  33963. import net.minecraft.entity.player.EntityPlayer;
  33964. import net.minecraft.entity.player.InventoryPlayer;
  33965. import net.minecraft.entity.projectile.EntityArrow;
  33966. import net.minecraft.entity.projectile.EntityDragonFireball;
  33967. import net.minecraft.entity.projectile.EntityEgg;
  33968. import net.minecraft.entity.projectile.EntityEvokerFangs;
  33969. import net.minecraft.entity.projectile.EntityFishHook;
  33970. import net.minecraft.entity.projectile.EntityLargeFireball;
  33971. import net.minecraft.entity.projectile.EntityLlamaSpit;
  33972. import net.minecraft.entity.projectile.EntityPotion;
  33973. import net.minecraft.entity.projectile.EntityShulkerBullet;
  33974. import net.minecraft.entity.projectile.EntitySmallFireball;
  33975. import net.minecraft.entity.projectile.EntitySnowball;
  33976. import net.minecraft.entity.projectile.EntitySpectralArrow;
  33977. import net.minecraft.entity.projectile.EntityTippedArrow;
  33978. import net.minecraft.entity.projectile.EntityWitherSkull;
  33979. import net.minecraft.init.Items;
  33980. import net.minecraft.init.SoundEvents;
  33981. import net.minecraft.inventory.Container;
  33982. import net.minecraft.inventory.ContainerHorseChest;
  33983. import net.minecraft.inventory.IInventory;
  33984. import net.minecraft.inventory.InventoryBasic;
  33985. import net.minecraft.item.ItemMap;
  33986. import net.minecraft.item.ItemStack;
  33987. import net.minecraft.item.crafting.IRecipe;
  33988. import net.minecraft.nbt.NBTTagCompound;
  33989. import net.minecraft.network.NetworkManager;
  33990. import net.minecraft.network.Packet;
  33991. import net.minecraft.network.PacketBuffer;
  33992. import net.minecraft.network.PacketThreadUtil;
  33993. import net.minecraft.network.datasync.EntityDataManager;
  33994. import net.minecraft.network.play.INetHandlerPlayClient;
  33995. import net.minecraft.network.play.client.CPacketClientStatus;
  33996. import net.minecraft.network.play.client.CPacketConfirmTeleport;
  33997. import net.minecraft.network.play.client.CPacketConfirmTransaction;
  33998. import net.minecraft.network.play.client.CPacketCustomPayload;
  33999. import net.minecraft.network.play.client.CPacketKeepAlive;
  34000. import net.minecraft.network.play.client.CPacketPlayer;
  34001. import net.minecraft.network.play.client.CPacketResourcePackStatus;
  34002. import net.minecraft.network.play.client.CPacketVehicleMove;
  34003. import net.minecraft.network.play.server.SPacketAdvancementInfo;
  34004. import net.minecraft.network.play.server.SPacketAnimation;
  34005. import net.minecraft.network.play.server.SPacketBlockAction;
  34006. import net.minecraft.network.play.server.SPacketBlockBreakAnim;
  34007. import net.minecraft.network.play.server.SPacketBlockChange;
  34008. import net.minecraft.network.play.server.SPacketCamera;
  34009. import net.minecraft.network.play.server.SPacketChangeGameState;
  34010. import net.minecraft.network.play.server.SPacketChat;
  34011. import net.minecraft.network.play.server.SPacketChunkData;
  34012. import net.minecraft.network.play.server.SPacketCloseWindow;
  34013. import net.minecraft.network.play.server.SPacketCollectItem;
  34014. import net.minecraft.network.play.server.SPacketCombatEvent;
  34015. import net.minecraft.network.play.server.SPacketConfirmTransaction;
  34016. import net.minecraft.network.play.server.SPacketCooldown;
  34017. import net.minecraft.network.play.server.SPacketCustomPayload;
  34018. import net.minecraft.network.play.server.SPacketCustomSound;
  34019. import net.minecraft.network.play.server.SPacketDestroyEntities;
  34020. import net.minecraft.network.play.server.SPacketDisconnect;
  34021. import net.minecraft.network.play.server.SPacketDisplayObjective;
  34022. import net.minecraft.network.play.server.SPacketEffect;
  34023. import net.minecraft.network.play.server.SPacketEntity;
  34024. import net.minecraft.network.play.server.SPacketEntityAttach;
  34025. import net.minecraft.network.play.server.SPacketEntityEffect;
  34026. import net.minecraft.network.play.server.SPacketEntityEquipment;
  34027. import net.minecraft.network.play.server.SPacketEntityHeadLook;
  34028. import net.minecraft.network.play.server.SPacketEntityMetadata;
  34029. import net.minecraft.network.play.server.SPacketEntityProperties;
  34030. import net.minecraft.network.play.server.SPacketEntityStatus;
  34031. import net.minecraft.network.play.server.SPacketEntityTeleport;
  34032. import net.minecraft.network.play.server.SPacketEntityVelocity;
  34033. import net.minecraft.network.play.server.SPacketExplosion;
  34034. import net.minecraft.network.play.server.SPacketHeldItemChange;
  34035. import net.minecraft.network.play.server.SPacketJoinGame;
  34036. import net.minecraft.network.play.server.SPacketKeepAlive;
  34037. import net.minecraft.network.play.server.SPacketMaps;
  34038. import net.minecraft.network.play.server.SPacketMoveVehicle;
  34039. import net.minecraft.network.play.server.SPacketMultiBlockChange;
  34040. import net.minecraft.network.play.server.SPacketOpenWindow;
  34041. import net.minecraft.network.play.server.SPacketParticles;
  34042. import net.minecraft.network.play.server.SPacketPlayerAbilities;
  34043. import net.minecraft.network.play.server.SPacketPlayerListHeaderFooter;
  34044. import net.minecraft.network.play.server.SPacketPlayerListItem;
  34045. import net.minecraft.network.play.server.SPacketPlayerPosLook;
  34046. import net.minecraft.network.play.server.SPacketRecipeBook;
  34047. import net.minecraft.network.play.server.SPacketRemoveEntityEffect;
  34048. import net.minecraft.network.play.server.SPacketResourcePackSend;
  34049. import net.minecraft.network.play.server.SPacketRespawn;
  34050. import net.minecraft.network.play.server.SPacketScoreboardObjective;
  34051. import net.minecraft.network.play.server.SPacketSelectAdvancementsTab;
  34052. import net.minecraft.network.play.server.SPacketServerDifficulty;
  34053. import net.minecraft.network.play.server.SPacketSetExperience;
  34054. import net.minecraft.network.play.server.SPacketSetPassengers;
  34055. import net.minecraft.network.play.server.SPacketSetSlot;
  34056. import net.minecraft.network.play.server.SPacketSignEditorOpen;
  34057. import net.minecraft.network.play.server.SPacketSoundEffect;
  34058. import net.minecraft.network.play.server.SPacketSpawnExperienceOrb;
  34059. import net.minecraft.network.play.server.SPacketSpawnGlobalEntity;
  34060. import net.minecraft.network.play.server.SPacketSpawnMob;
  34061. import net.minecraft.network.play.server.SPacketSpawnObject;
  34062. import net.minecraft.network.play.server.SPacketSpawnPainting;
  34063. import net.minecraft.network.play.server.SPacketSpawnPlayer;
  34064. import net.minecraft.network.play.server.SPacketSpawnPosition;
  34065. import net.minecraft.network.play.server.SPacketStatistics;
  34066. import net.minecraft.network.play.server.SPacketTabComplete;
  34067. import net.minecraft.network.play.server.SPacketTeams;
  34068. import net.minecraft.network.play.server.SPacketTimeUpdate;
  34069. import net.minecraft.network.play.server.SPacketTitle;
  34070. import net.minecraft.network.play.server.SPacketUnloadChunk;
  34071. import net.minecraft.network.play.server.SPacketUpdateBossInfo;
  34072. import net.minecraft.network.play.server.SPacketUpdateHealth;
  34073. import net.minecraft.network.play.server.SPacketUpdateScore;
  34074. import net.minecraft.network.play.server.SPacketUpdateTileEntity;
  34075. import net.minecraft.network.play.server.SPacketUseBed;
  34076. import net.minecraft.network.play.server.SPacketWindowItems;
  34077. import net.minecraft.network.play.server.SPacketWindowProperty;
  34078. import net.minecraft.network.play.server.SPacketWorldBorder;
  34079. import net.minecraft.pathfinding.Path;
  34080. import net.minecraft.potion.Potion;
  34081. import net.minecraft.potion.PotionEffect;
  34082. import net.minecraft.realms.DisconnectedRealmsScreen;
  34083. import net.minecraft.scoreboard.IScoreCriteria;
  34084. import net.minecraft.scoreboard.Score;
  34085. import net.minecraft.scoreboard.ScoreObjective;
  34086. import net.minecraft.scoreboard.ScorePlayerTeam;
  34087. import net.minecraft.scoreboard.Scoreboard;
  34088. import net.minecraft.scoreboard.Team;
  34089. import net.minecraft.stats.RecipeBook;
  34090. import net.minecraft.stats.StatBase;
  34091. import net.minecraft.tileentity.TileEntity;
  34092. import net.minecraft.tileentity.TileEntityBanner;
  34093. import net.minecraft.tileentity.TileEntityBeacon;
  34094. import net.minecraft.tileentity.TileEntityBed;
  34095. import net.minecraft.tileentity.TileEntityCommandBlock;
  34096. import net.minecraft.tileentity.TileEntityEndGateway;
  34097. import net.minecraft.tileentity.TileEntityFlowerPot;
  34098. import net.minecraft.tileentity.TileEntityMobSpawner;
  34099. import net.minecraft.tileentity.TileEntityShulkerBox;
  34100. import net.minecraft.tileentity.TileEntitySign;
  34101. import net.minecraft.tileentity.TileEntitySkull;
  34102. import net.minecraft.tileentity.TileEntityStructure;
  34103. import net.minecraft.util.EnumFacing;
  34104. import net.minecraft.util.EnumHand;
  34105. import net.minecraft.util.EnumParticleTypes;
  34106. import net.minecraft.util.ITabCompleter;
  34107. import net.minecraft.util.ResourceLocation;
  34108. import net.minecraft.util.SoundCategory;
  34109. import net.minecraft.util.StringUtils;
  34110. import net.minecraft.util.math.BlockPos;
  34111. import net.minecraft.util.math.MathHelper;
  34112. import net.minecraft.util.text.ITextComponent;
  34113. import net.minecraft.util.text.TextComponentTranslation;
  34114. import net.minecraft.util.text.TextFormatting;
  34115. import net.minecraft.village.MerchantRecipeList;
  34116. import net.minecraft.world.Explosion;
  34117. import net.minecraft.world.GameType;
  34118. import net.minecraft.world.WorldProviderSurface;
  34119. import net.minecraft.world.WorldSettings;
  34120. import net.minecraft.world.chunk.Chunk;
  34121. import net.minecraft.world.storage.MapData;
  34122. import net.minecraftforge.fml.relauncher.Side;
  34123. import net.minecraftforge.fml.relauncher.SideOnly;
  34124. import org.apache.logging.log4j.LogManager;
  34125. import org.apache.logging.log4j.Logger;
  34126.  
  34127. @SideOnly(Side.CLIENT)
  34128. public class NetHandlerPlayClient implements INetHandlerPlayClient {
  34129. private static final Logger field_147301_d = LogManager.getLogger();
  34130. private final NetworkManager field_147302_e;
  34131. private final GameProfile field_175107_d;
  34132. private final GuiScreen field_147307_j;
  34133. private Minecraft field_147299_f;
  34134. private WorldClient field_147300_g;
  34135. private boolean field_147309_h;
  34136. private final Map<UUID, NetworkPlayerInfo> field_147310_i = Maps.<UUID, NetworkPlayerInfo>newHashMap();
  34137. public int field_147304_c = 20;
  34138. private boolean field_147308_k;
  34139. private final ClientAdvancementManager field_191983_k;
  34140. private final Random field_147306_l = new Random();
  34141.  
  34142. public NetHandlerPlayClient(Minecraft p_i46300_1_, GuiScreen p_i46300_2_, NetworkManager p_i46300_3_, GameProfile p_i46300_4_) {
  34143. this.field_147299_f = p_i46300_1_;
  34144. this.field_147307_j = p_i46300_2_;
  34145. this.field_147302_e = p_i46300_3_;
  34146. this.field_175107_d = p_i46300_4_;
  34147. this.field_191983_k = new ClientAdvancementManager(p_i46300_1_);
  34148. }
  34149.  
  34150. public void func_147296_c() {
  34151. this.field_147300_g = null;
  34152. }
  34153.  
  34154. public void func_147282_a(SPacketJoinGame p_147282_1_) {
  34155. PacketThreadUtil.func_180031_a(p_147282_1_, this, this.field_147299_f);
  34156. this.field_147299_f.field_71442_b = new PlayerControllerMP(this.field_147299_f, this);
  34157. this.field_147300_g = new WorldClient(this, new WorldSettings(0L, p_147282_1_.func_149198_e(), false, p_147282_1_.func_149195_d(), p_147282_1_.func_149196_i()), p_147282_1_.func_149194_f(), p_147282_1_.func_149192_g(), this.field_147299_f.field_71424_I);
  34158. this.field_147299_f.field_71474_y.field_74318_M = p_147282_1_.func_149192_g();
  34159. this.field_147299_f.func_71403_a(this.field_147300_g);
  34160. this.field_147299_f.field_71439_g.field_71093_bK = p_147282_1_.func_149194_f();
  34161. this.field_147299_f.func_147108_a(new GuiDownloadTerrain(this));
  34162. this.field_147299_f.field_71439_g.func_145769_d(p_147282_1_.func_149197_c());
  34163. this.field_147304_c = p_147282_1_.func_149193_h();
  34164. this.field_147299_f.field_71439_g.func_175150_k(p_147282_1_.func_179744_h());
  34165. this.field_147299_f.field_71442_b.func_78746_a(p_147282_1_.func_149198_e());
  34166. this.field_147299_f.field_71474_y.func_82879_c();
  34167. this.field_147302_e.func_179290_a(new CPacketCustomPayload("MC|Brand", (new PacketBuffer(Unpooled.buffer())).func_180714_a(ClientBrandRetriever.getClientModName())));
  34168. }
  34169.  
  34170. public void func_147235_a(SPacketSpawnObject p_147235_1_) {
  34171. PacketThreadUtil.func_180031_a(p_147235_1_, this, this.field_147299_f);
  34172. double d0 = p_147235_1_.func_186880_c();
  34173. double d1 = p_147235_1_.func_186882_d();
  34174. double d2 = p_147235_1_.func_186881_e();
  34175. Entity entity = null;
  34176. if(p_147235_1_.func_148993_l() == 10) {
  34177. entity = EntityMinecart.func_184263_a(this.field_147300_g, d0, d1, d2, EntityMinecart.Type.func_184955_a(p_147235_1_.func_149009_m()));
  34178. } else if(p_147235_1_.func_148993_l() == 90) {
  34179. Entity entity1 = this.field_147300_g.func_73045_a(p_147235_1_.func_149009_m());
  34180. if(entity1 instanceof EntityPlayer) {
  34181. entity = new EntityFishHook(this.field_147300_g, (EntityPlayer)entity1, d0, d1, d2);
  34182. }
  34183.  
  34184. p_147235_1_.func_149002_g(0);
  34185. } else if(p_147235_1_.func_148993_l() == 60) {
  34186. entity = new EntityTippedArrow(this.field_147300_g, d0, d1, d2);
  34187. } else if(p_147235_1_.func_148993_l() == 91) {
  34188. entity = new EntitySpectralArrow(this.field_147300_g, d0, d1, d2);
  34189. } else if(p_147235_1_.func_148993_l() == 61) {
  34190. entity = new EntitySnowball(this.field_147300_g, d0, d1, d2);
  34191. } else if(p_147235_1_.func_148993_l() == 68) {
  34192. entity = new EntityLlamaSpit(this.field_147300_g, d0, d1, d2, (double)p_147235_1_.func_149010_g() / 8000.0D, (double)p_147235_1_.func_149004_h() / 8000.0D, (double)p_147235_1_.func_148999_i() / 8000.0D);
  34193. } else if(p_147235_1_.func_148993_l() == 71) {
  34194. entity = new EntityItemFrame(this.field_147300_g, new BlockPos(d0, d1, d2), EnumFacing.func_176731_b(p_147235_1_.func_149009_m()));
  34195. p_147235_1_.func_149002_g(0);
  34196. } else if(p_147235_1_.func_148993_l() == 77) {
  34197. entity = new EntityLeashKnot(this.field_147300_g, new BlockPos(MathHelper.func_76128_c(d0), MathHelper.func_76128_c(d1), MathHelper.func_76128_c(d2)));
  34198. p_147235_1_.func_149002_g(0);
  34199. } else if(p_147235_1_.func_148993_l() == 65) {
  34200. entity = new EntityEnderPearl(this.field_147300_g, d0, d1, d2);
  34201. } else if(p_147235_1_.func_148993_l() == 72) {
  34202. entity = new EntityEnderEye(this.field_147300_g, d0, d1, d2);
  34203. } else if(p_147235_1_.func_148993_l() == 76) {
  34204. entity = new EntityFireworkRocket(this.field_147300_g, d0, d1, d2, ItemStack.field_190927_a);
  34205. } else if(p_147235_1_.func_148993_l() == 63) {
  34206. entity = new EntityLargeFireball(this.field_147300_g, d0, d1, d2, (double)p_147235_1_.func_149010_g() / 8000.0D, (double)p_147235_1_.func_149004_h() / 8000.0D, (double)p_147235_1_.func_148999_i() / 8000.0D);
  34207. p_147235_1_.func_149002_g(0);
  34208. } else if(p_147235_1_.func_148993_l() == 93) {
  34209. entity = new EntityDragonFireball(this.field_147300_g, d0, d1, d2, (double)p_147235_1_.func_149010_g() / 8000.0D, (double)p_147235_1_.func_149004_h() / 8000.0D, (double)p_147235_1_.func_148999_i() / 8000.0D);
  34210. p_147235_1_.func_149002_g(0);
  34211. } else if(p_147235_1_.func_148993_l() == 64) {
  34212. entity = new EntitySmallFireball(this.field_147300_g, d0, d1, d2, (double)p_147235_1_.func_149010_g() / 8000.0D, (double)p_147235_1_.func_149004_h() / 8000.0D, (double)p_147235_1_.func_148999_i() / 8000.0D);
  34213. p_147235_1_.func_149002_g(0);
  34214. } else if(p_147235_1_.func_148993_l() == 66) {
  34215. entity = new EntityWitherSkull(this.field_147300_g, d0, d1, d2, (double)p_147235_1_.func_149010_g() / 8000.0D, (double)p_147235_1_.func_149004_h() / 8000.0D, (double)p_147235_1_.func_148999_i() / 8000.0D);
  34216. p_147235_1_.func_149002_g(0);
  34217. } else if(p_147235_1_.func_148993_l() == 67) {
  34218. entity = new EntityShulkerBullet(this.field_147300_g, d0, d1, d2, (double)p_147235_1_.func_149010_g() / 8000.0D, (double)p_147235_1_.func_149004_h() / 8000.0D, (double)p_147235_1_.func_148999_i() / 8000.0D);
  34219. p_147235_1_.func_149002_g(0);
  34220. } else if(p_147235_1_.func_148993_l() == 62) {
  34221. entity = new EntityEgg(this.field_147300_g, d0, d1, d2);
  34222. } else if(p_147235_1_.func_148993_l() == 79) {
  34223. entity = new EntityEvokerFangs(this.field_147300_g, d0, d1, d2, 0.0F, 0, (EntityLivingBase)null);
  34224. } else if(p_147235_1_.func_148993_l() == 73) {
  34225. entity = new EntityPotion(this.field_147300_g, d0, d1, d2, ItemStack.field_190927_a);
  34226. p_147235_1_.func_149002_g(0);
  34227. } else if(p_147235_1_.func_148993_l() == 75) {
  34228. entity = new EntityExpBottle(this.field_147300_g, d0, d1, d2);
  34229. p_147235_1_.func_149002_g(0);
  34230. } else if(p_147235_1_.func_148993_l() == 1) {
  34231. entity = new EntityBoat(this.field_147300_g, d0, d1, d2);
  34232. } else if(p_147235_1_.func_148993_l() == 50) {
  34233. entity = new EntityTNTPrimed(this.field_147300_g, d0, d1, d2, (EntityLivingBase)null);
  34234. } else if(p_147235_1_.func_148993_l() == 78) {
  34235. entity = new EntityArmorStand(this.field_147300_g, d0, d1, d2);
  34236. } else if(p_147235_1_.func_148993_l() == 51) {
  34237. entity = new EntityEnderCrystal(this.field_147300_g, d0, d1, d2);
  34238. } else if(p_147235_1_.func_148993_l() == 2) {
  34239. entity = new EntityItem(this.field_147300_g, d0, d1, d2);
  34240. } else if(p_147235_1_.func_148993_l() == 70) {
  34241. entity = new EntityFallingBlock(this.field_147300_g, d0, d1, d2, Block.func_176220_d(p_147235_1_.func_149009_m() & '\uffff'));
  34242. p_147235_1_.func_149002_g(0);
  34243. } else if(p_147235_1_.func_148993_l() == 3) {
  34244. entity = new EntityAreaEffectCloud(this.field_147300_g, d0, d1, d2);
  34245. }
  34246.  
  34247. if(entity != null) {
  34248. EntityTracker.func_187254_a(entity, d0, d1, d2);
  34249. entity.field_70125_A = (float)(p_147235_1_.func_149008_j() * 360) / 256.0F;
  34250. entity.field_70177_z = (float)(p_147235_1_.func_149006_k() * 360) / 256.0F;
  34251. Entity[] aentity = entity.func_70021_al();
  34252. if(aentity != null) {
  34253. int i = p_147235_1_.func_149001_c() - entity.func_145782_y();
  34254.  
  34255. for(Entity entity2 : aentity) {
  34256. entity2.func_145769_d(entity2.func_145782_y() + i);
  34257. }
  34258. }
  34259.  
  34260. entity.func_145769_d(p_147235_1_.func_149001_c());
  34261. entity.func_184221_a(p_147235_1_.func_186879_b());
  34262. this.field_147300_g.func_73027_a(p_147235_1_.func_149001_c(), entity);
  34263. if(p_147235_1_.func_149009_m() > 0) {
  34264. if(p_147235_1_.func_148993_l() == 60 || p_147235_1_.func_148993_l() == 91) {
  34265. Entity entity3 = this.field_147300_g.func_73045_a(p_147235_1_.func_149009_m() - 1);
  34266. if(entity3 instanceof EntityLivingBase && entity instanceof EntityArrow) {
  34267. ((EntityArrow)entity).field_70250_c = entity3;
  34268. }
  34269. }
  34270.  
  34271. entity.func_70016_h((double)p_147235_1_.func_149010_g() / 8000.0D, (double)p_147235_1_.func_149004_h() / 8000.0D, (double)p_147235_1_.func_148999_i() / 8000.0D);
  34272. }
  34273. }
  34274.  
  34275. }
  34276.  
  34277. public void func_147286_a(SPacketSpawnExperienceOrb p_147286_1_) {
  34278. PacketThreadUtil.func_180031_a(p_147286_1_, this, this.field_147299_f);
  34279. double d0 = p_147286_1_.func_186885_b();
  34280. double d1 = p_147286_1_.func_186886_c();
  34281. double d2 = p_147286_1_.func_186884_d();
  34282. Entity entity = new EntityXPOrb(this.field_147300_g, d0, d1, d2, p_147286_1_.func_148986_g());
  34283. EntityTracker.func_187254_a(entity, d0, d1, d2);
  34284. entity.field_70177_z = 0.0F;
  34285. entity.field_70125_A = 0.0F;
  34286. entity.func_145769_d(p_147286_1_.func_148985_c());
  34287. this.field_147300_g.func_73027_a(p_147286_1_.func_148985_c(), entity);
  34288. }
  34289.  
  34290. public void func_147292_a(SPacketSpawnGlobalEntity p_147292_1_) {
  34291. PacketThreadUtil.func_180031_a(p_147292_1_, this, this.field_147299_f);
  34292. double d0 = p_147292_1_.func_186888_b();
  34293. double d1 = p_147292_1_.func_186889_c();
  34294. double d2 = p_147292_1_.func_186887_d();
  34295. Entity entity = null;
  34296. if(p_147292_1_.func_149053_g() == 1) {
  34297. entity = new EntityLightningBolt(this.field_147300_g, d0, d1, d2, false);
  34298. }
  34299.  
  34300. if(entity != null) {
  34301. EntityTracker.func_187254_a(entity, d0, d1, d2);
  34302. entity.field_70177_z = 0.0F;
  34303. entity.field_70125_A = 0.0F;
  34304. entity.func_145769_d(p_147292_1_.func_149052_c());
  34305. this.field_147300_g.func_72942_c(entity);
  34306. }
  34307.  
  34308. }
  34309.  
  34310. public void func_147288_a(SPacketSpawnPainting p_147288_1_) {
  34311. PacketThreadUtil.func_180031_a(p_147288_1_, this, this.field_147299_f);
  34312. EntityPainting entitypainting = new EntityPainting(this.field_147300_g, p_147288_1_.func_179837_b(), p_147288_1_.func_179836_c(), p_147288_1_.func_148961_h());
  34313. entitypainting.func_184221_a(p_147288_1_.func_186895_b());
  34314. this.field_147300_g.func_73027_a(p_147288_1_.func_148965_c(), entitypainting);
  34315. }
  34316.  
  34317. public void func_147244_a(SPacketEntityVelocity p_147244_1_) {
  34318. PacketThreadUtil.func_180031_a(p_147244_1_, this, this.field_147299_f);
  34319. Entity entity = this.field_147300_g.func_73045_a(p_147244_1_.func_149412_c());
  34320. if(entity != null) {
  34321. entity.func_70016_h((double)p_147244_1_.func_149411_d() / 8000.0D, (double)p_147244_1_.func_149410_e() / 8000.0D, (double)p_147244_1_.func_149409_f() / 8000.0D);
  34322. }
  34323. }
  34324.  
  34325. public void func_147284_a(SPacketEntityMetadata p_147284_1_) {
  34326. PacketThreadUtil.func_180031_a(p_147284_1_, this, this.field_147299_f);
  34327. Entity entity = this.field_147300_g.func_73045_a(p_147284_1_.func_149375_d());
  34328. if(entity != null && p_147284_1_.func_149376_c() != null) {
  34329. entity.func_184212_Q().func_187218_a(p_147284_1_.func_149376_c());
  34330. }
  34331.  
  34332. }
  34333.  
  34334. public void func_147237_a(SPacketSpawnPlayer p_147237_1_) {
  34335. PacketThreadUtil.func_180031_a(p_147237_1_, this, this.field_147299_f);
  34336. double d0 = p_147237_1_.func_186898_d();
  34337. double d1 = p_147237_1_.func_186897_e();
  34338. double d2 = p_147237_1_.func_186899_f();
  34339. float f = (float)(p_147237_1_.func_148941_i() * 360) / 256.0F;
  34340. float f1 = (float)(p_147237_1_.func_148945_j() * 360) / 256.0F;
  34341. EntityOtherPlayerMP entityotherplayermp = new EntityOtherPlayerMP(this.field_147299_f.field_71441_e, this.func_175102_a(p_147237_1_.func_179819_c()).func_178845_a());
  34342. entityotherplayermp.field_70169_q = d0;
  34343. entityotherplayermp.field_70142_S = d0;
  34344. entityotherplayermp.field_70167_r = d1;
  34345. entityotherplayermp.field_70137_T = d1;
  34346. entityotherplayermp.field_70166_s = d2;
  34347. entityotherplayermp.field_70136_U = d2;
  34348. EntityTracker.func_187254_a(entityotherplayermp, d0, d1, d2);
  34349. entityotherplayermp.func_70080_a(d0, d1, d2, f, f1);
  34350. this.field_147300_g.func_73027_a(p_147237_1_.func_148943_d(), entityotherplayermp);
  34351. List<EntityDataManager.DataEntry<?>> list = p_147237_1_.func_148944_c();
  34352. if(list != null) {
  34353. entityotherplayermp.func_184212_Q().func_187218_a(list);
  34354. }
  34355.  
  34356. }
  34357.  
  34358. public void func_147275_a(SPacketEntityTeleport p_147275_1_) {
  34359. PacketThreadUtil.func_180031_a(p_147275_1_, this, this.field_147299_f);
  34360. Entity entity = this.field_147300_g.func_73045_a(p_147275_1_.func_149451_c());
  34361. if(entity != null) {
  34362. double d0 = p_147275_1_.func_186982_b();
  34363. double d1 = p_147275_1_.func_186983_c();
  34364. double d2 = p_147275_1_.func_186981_d();
  34365. EntityTracker.func_187254_a(entity, d0, d1, d2);
  34366. if(!entity.func_184186_bw()) {
  34367. float f = (float)(p_147275_1_.func_149450_g() * 360) / 256.0F;
  34368. float f1 = (float)(p_147275_1_.func_149447_h() * 360) / 256.0F;
  34369. if(Math.abs(entity.field_70165_t - d0) < 0.03125D && Math.abs(entity.field_70163_u - d1) < 0.015625D && Math.abs(entity.field_70161_v - d2) < 0.03125D) {
  34370. entity.func_180426_a(entity.field_70165_t, entity.field_70163_u, entity.field_70161_v, f, f1, 0, true);
  34371. } else {
  34372. entity.func_180426_a(d0, d1, d2, f, f1, 3, true);
  34373. }
  34374.  
  34375. entity.field_70122_E = p_147275_1_.func_179697_g();
  34376. }
  34377.  
  34378. }
  34379. }
  34380.  
  34381. public void func_147257_a(SPacketHeldItemChange p_147257_1_) {
  34382. PacketThreadUtil.func_180031_a(p_147257_1_, this, this.field_147299_f);
  34383. if(InventoryPlayer.func_184435_e(p_147257_1_.func_149385_c())) {
  34384. this.field_147299_f.field_71439_g.field_71071_by.field_70461_c = p_147257_1_.func_149385_c();
  34385. }
  34386.  
  34387. }
  34388.  
  34389. public void func_147259_a(SPacketEntity p_147259_1_) {
  34390. PacketThreadUtil.func_180031_a(p_147259_1_, this, this.field_147299_f);
  34391. Entity entity = p_147259_1_.func_149065_a(this.field_147300_g);
  34392. if(entity != null) {
  34393. entity.field_70118_ct += (long)p_147259_1_.func_186952_a();
  34394. entity.field_70117_cu += (long)p_147259_1_.func_186953_b();
  34395. entity.field_70116_cv += (long)p_147259_1_.func_186951_c();
  34396. double d0 = (double)entity.field_70118_ct / 4096.0D;
  34397. double d1 = (double)entity.field_70117_cu / 4096.0D;
  34398. double d2 = (double)entity.field_70116_cv / 4096.0D;
  34399. if(!entity.func_184186_bw()) {
  34400. float f = p_147259_1_.func_149060_h()?(float)(p_147259_1_.func_149066_f() * 360) / 256.0F:entity.field_70177_z;
  34401. float f1 = p_147259_1_.func_149060_h()?(float)(p_147259_1_.func_149063_g() * 360) / 256.0F:entity.field_70125_A;
  34402. entity.func_180426_a(d0, d1, d2, f, f1, 3, false);
  34403. entity.field_70122_E = p_147259_1_.func_179742_g();
  34404. }
  34405.  
  34406. }
  34407. }
  34408.  
  34409. public void func_147267_a(SPacketEntityHeadLook p_147267_1_) {
  34410. PacketThreadUtil.func_180031_a(p_147267_1_, this, this.field_147299_f);
  34411. Entity entity = p_147267_1_.func_149381_a(this.field_147300_g);
  34412. if(entity != null) {
  34413. float f = (float)(p_147267_1_.func_149380_c() * 360) / 256.0F;
  34414. entity.func_70034_d(f);
  34415. }
  34416. }
  34417.  
  34418. public void func_147238_a(SPacketDestroyEntities p_147238_1_) {
  34419. PacketThreadUtil.func_180031_a(p_147238_1_, this, this.field_147299_f);
  34420.  
  34421. for(int i = 0; i < p_147238_1_.func_149098_c().length; ++i) {
  34422. this.field_147300_g.func_73028_b(p_147238_1_.func_149098_c()[i]);
  34423. }
  34424.  
  34425. }
  34426.  
  34427. public void func_184330_a(SPacketPlayerPosLook p_184330_1_) {
  34428. PacketThreadUtil.func_180031_a(p_184330_1_, this, this.field_147299_f);
  34429. EntityPlayer entityplayer = this.field_147299_f.field_71439_g;
  34430. double d0 = p_184330_1_.func_148932_c();
  34431. double d1 = p_184330_1_.func_148928_d();
  34432. double d2 = p_184330_1_.func_148933_e();
  34433. float f = p_184330_1_.func_148931_f();
  34434. float f1 = p_184330_1_.func_148930_g();
  34435. if(p_184330_1_.func_179834_f().contains(SPacketPlayerPosLook.EnumFlags.X)) {
  34436. d0 += entityplayer.field_70165_t;
  34437. } else {
  34438. entityplayer.field_70159_w = 0.0D;
  34439. }
  34440.  
  34441. if(p_184330_1_.func_179834_f().contains(SPacketPlayerPosLook.EnumFlags.Y)) {
  34442. d1 += entityplayer.field_70163_u;
  34443. } else {
  34444. entityplayer.field_70181_x = 0.0D;
  34445. }
  34446.  
  34447. if(p_184330_1_.func_179834_f().contains(SPacketPlayerPosLook.EnumFlags.Z)) {
  34448. d2 += entityplayer.field_70161_v;
  34449. } else {
  34450. entityplayer.field_70179_y = 0.0D;
  34451. }
  34452.  
  34453. if(p_184330_1_.func_179834_f().contains(SPacketPlayerPosLook.EnumFlags.X_ROT)) {
  34454. f1 += entityplayer.field_70125_A;
  34455. }
  34456.  
  34457. if(p_184330_1_.func_179834_f().contains(SPacketPlayerPosLook.EnumFlags.Y_ROT)) {
  34458. f += entityplayer.field_70177_z;
  34459. }
  34460.  
  34461. entityplayer.func_70080_a(d0, d1, d2, f, f1);
  34462. this.field_147302_e.func_179290_a(new CPacketConfirmTeleport(p_184330_1_.func_186965_f()));
  34463. this.field_147302_e.func_179290_a(new CPacketPlayer.PositionRotation(entityplayer.field_70165_t, entityplayer.func_174813_aQ().field_72338_b, entityplayer.field_70161_v, entityplayer.field_70177_z, entityplayer.field_70125_A, false));
  34464. if(!this.field_147309_h) {
  34465. this.field_147299_f.field_71439_g.field_70169_q = this.field_147299_f.field_71439_g.field_70165_t;
  34466. this.field_147299_f.field_71439_g.field_70167_r = this.field_147299_f.field_71439_g.field_70163_u;
  34467. this.field_147299_f.field_71439_g.field_70166_s = this.field_147299_f.field_71439_g.field_70161_v;
  34468. this.field_147309_h = true;
  34469. this.field_147299_f.func_147108_a((GuiScreen)null);
  34470. }
  34471.  
  34472. }
  34473.  
  34474. public void func_147287_a(SPacketMultiBlockChange p_147287_1_) {
  34475. PacketThreadUtil.func_180031_a(p_147287_1_, this, this.field_147299_f);
  34476.  
  34477. for(SPacketMultiBlockChange.BlockUpdateData spacketmultiblockchange$blockupdatedata : p_147287_1_.func_179844_a()) {
  34478. this.field_147300_g.func_180503_b(spacketmultiblockchange$blockupdatedata.func_180090_a(), spacketmultiblockchange$blockupdatedata.func_180088_c());
  34479. }
  34480.  
  34481. }
  34482.  
  34483. public void func_147263_a(SPacketChunkData p_147263_1_) {
  34484. PacketThreadUtil.func_180031_a(p_147263_1_, this, this.field_147299_f);
  34485. if(p_147263_1_.func_149274_i()) {
  34486. this.field_147300_g.func_73025_a(p_147263_1_.func_149273_e(), p_147263_1_.func_149271_f(), true);
  34487. }
  34488.  
  34489. this.field_147300_g.func_73031_a(p_147263_1_.func_149273_e() << 4, 0, p_147263_1_.func_149271_f() << 4, (p_147263_1_.func_149273_e() << 4) + 15, 256, (p_147263_1_.func_149271_f() << 4) + 15);
  34490. Chunk chunk = this.field_147300_g.func_72964_e(p_147263_1_.func_149273_e(), p_147263_1_.func_149271_f());
  34491. chunk.func_186033_a(p_147263_1_.func_186946_a(), p_147263_1_.func_149276_g(), p_147263_1_.func_149274_i());
  34492. this.field_147300_g.func_147458_c(p_147263_1_.func_149273_e() << 4, 0, p_147263_1_.func_149271_f() << 4, (p_147263_1_.func_149273_e() << 4) + 15, 256, (p_147263_1_.func_149271_f() << 4) + 15);
  34493. if(!p_147263_1_.func_149274_i() || !(this.field_147300_g.field_73011_w instanceof WorldProviderSurface)) {
  34494. chunk.func_76613_n();
  34495. }
  34496.  
  34497. for(NBTTagCompound nbttagcompound : p_147263_1_.func_189554_f()) {
  34498. BlockPos blockpos = new BlockPos(nbttagcompound.func_74762_e("x"), nbttagcompound.func_74762_e("y"), nbttagcompound.func_74762_e("z"));
  34499. TileEntity tileentity = this.field_147300_g.func_175625_s(blockpos);
  34500. if(tileentity != null) {
  34501. tileentity.func_145839_a(nbttagcompound);
  34502. }
  34503. }
  34504.  
  34505. }
  34506.  
  34507. public void func_184326_a(SPacketUnloadChunk p_184326_1_) {
  34508. PacketThreadUtil.func_180031_a(p_184326_1_, this, this.field_147299_f);
  34509. this.field_147300_g.func_73025_a(p_184326_1_.func_186940_a(), p_184326_1_.func_186941_b(), false);
  34510. }
  34511.  
  34512. public void func_147234_a(SPacketBlockChange p_147234_1_) {
  34513. PacketThreadUtil.func_180031_a(p_147234_1_, this, this.field_147299_f);
  34514. this.field_147300_g.func_180503_b(p_147234_1_.func_179827_b(), p_147234_1_.func_180728_a());
  34515. }
  34516.  
  34517. public void func_147253_a(SPacketDisconnect p_147253_1_) {
  34518. this.field_147302_e.func_150718_a(p_147253_1_.func_149165_c());
  34519. }
  34520.  
  34521. public void func_147231_a(ITextComponent p_147231_1_) {
  34522. this.field_147299_f.func_71403_a((WorldClient)null);
  34523. if(this.field_147307_j != null) {
  34524. if(this.field_147307_j instanceof GuiScreenRealmsProxy) {
  34525. this.field_147299_f.func_147108_a((new DisconnectedRealmsScreen(((GuiScreenRealmsProxy)this.field_147307_j).func_154321_a(), "disconnect.lost", p_147231_1_)).getProxy());
  34526. } else {
  34527. this.field_147299_f.func_147108_a(new GuiDisconnected(this.field_147307_j, "disconnect.lost", p_147231_1_));
  34528. }
  34529. } else {
  34530. this.field_147299_f.func_147108_a(new GuiDisconnected(new GuiMultiplayer(new GuiMainMenu()), "disconnect.lost", p_147231_1_));
  34531. }
  34532.  
  34533. }
  34534.  
  34535. public void func_147297_a(Packet<?> p_147297_1_) {
  34536. this.field_147302_e.func_179290_a(p_147297_1_);
  34537. }
  34538.  
  34539. public void func_147246_a(SPacketCollectItem p_147246_1_) {
  34540. PacketThreadUtil.func_180031_a(p_147246_1_, this, this.field_147299_f);
  34541. Entity entity = this.field_147300_g.func_73045_a(p_147246_1_.func_149354_c());
  34542. EntityLivingBase entitylivingbase = (EntityLivingBase)this.field_147300_g.func_73045_a(p_147246_1_.func_149353_d());
  34543. if(entitylivingbase == null) {
  34544. entitylivingbase = this.field_147299_f.field_71439_g;
  34545. }
  34546.  
  34547. if(entity != null) {
  34548. if(entity instanceof EntityXPOrb) {
  34549. this.field_147300_g.func_184134_a(entity.field_70165_t, entity.field_70163_u, entity.field_70161_v, SoundEvents.field_187604_bf, SoundCategory.PLAYERS, 0.1F, (this.field_147306_l.nextFloat() - this.field_147306_l.nextFloat()) * 0.35F + 0.9F, false);
  34550. } else {
  34551. this.field_147300_g.func_184134_a(entity.field_70165_t, entity.field_70163_u, entity.field_70161_v, SoundEvents.field_187638_cR, SoundCategory.PLAYERS, 0.2F, (this.field_147306_l.nextFloat() - this.field_147306_l.nextFloat()) * 1.4F + 2.0F, false);
  34552. }
  34553.  
  34554. if(entity instanceof EntityItem) {
  34555. ((EntityItem)entity).func_92059_d().func_190920_e(p_147246_1_.func_191208_c());
  34556. }
  34557.  
  34558. this.field_147299_f.field_71452_i.func_78873_a(new ParticleItemPickup(this.field_147300_g, entity, entitylivingbase, 0.5F));
  34559. this.field_147300_g.func_73028_b(p_147246_1_.func_149354_c());
  34560. }
  34561.  
  34562. }
  34563.  
  34564. public void func_147251_a(SPacketChat p_147251_1_) {
  34565. PacketThreadUtil.func_180031_a(p_147251_1_, this, this.field_147299_f);
  34566. this.field_147299_f.field_71456_v.func_191742_a(p_147251_1_.func_192590_c(), p_147251_1_.func_148915_c());
  34567. }
  34568.  
  34569. public void func_147279_a(SPacketAnimation p_147279_1_) {
  34570. PacketThreadUtil.func_180031_a(p_147279_1_, this, this.field_147299_f);
  34571. Entity entity = this.field_147300_g.func_73045_a(p_147279_1_.func_148978_c());
  34572. if(entity != null) {
  34573. if(p_147279_1_.func_148977_d() == 0) {
  34574. EntityLivingBase entitylivingbase = (EntityLivingBase)entity;
  34575. entitylivingbase.func_184609_a(EnumHand.MAIN_HAND);
  34576. } else if(p_147279_1_.func_148977_d() == 3) {
  34577. EntityLivingBase entitylivingbase1 = (EntityLivingBase)entity;
  34578. entitylivingbase1.func_184609_a(EnumHand.OFF_HAND);
  34579. } else if(p_147279_1_.func_148977_d() == 1) {
  34580. entity.func_70057_ab();
  34581. } else if(p_147279_1_.func_148977_d() == 2) {
  34582. EntityPlayer entityplayer = (EntityPlayer)entity;
  34583. entityplayer.func_70999_a(false, false, false);
  34584. } else if(p_147279_1_.func_148977_d() == 4) {
  34585. this.field_147299_f.field_71452_i.func_178926_a(entity, EnumParticleTypes.CRIT);
  34586. } else if(p_147279_1_.func_148977_d() == 5) {
  34587. this.field_147299_f.field_71452_i.func_178926_a(entity, EnumParticleTypes.CRIT_MAGIC);
  34588. }
  34589.  
  34590. }
  34591. }
  34592.  
  34593. public void func_147278_a(SPacketUseBed p_147278_1_) {
  34594. PacketThreadUtil.func_180031_a(p_147278_1_, this, this.field_147299_f);
  34595. p_147278_1_.func_149091_a(this.field_147300_g).func_180469_a(p_147278_1_.func_179798_a());
  34596. }
  34597.  
  34598. public void func_147281_a(SPacketSpawnMob p_147281_1_) {
  34599. PacketThreadUtil.func_180031_a(p_147281_1_, this, this.field_147299_f);
  34600. double d0 = p_147281_1_.func_186891_e();
  34601. double d1 = p_147281_1_.func_186892_f();
  34602. double d2 = p_147281_1_.func_186893_g();
  34603. float f = (float)(p_147281_1_.func_149028_l() * 360) / 256.0F;
  34604. float f1 = (float)(p_147281_1_.func_149030_m() * 360) / 256.0F;
  34605. EntityLivingBase entitylivingbase = (EntityLivingBase)EntityList.func_75616_a(p_147281_1_.func_149025_e(), this.field_147299_f.field_71441_e);
  34606. if(entitylivingbase != null) {
  34607. EntityTracker.func_187254_a(entitylivingbase, d0, d1, d2);
  34608. entitylivingbase.field_70761_aq = (float)(p_147281_1_.func_149032_n() * 360) / 256.0F;
  34609. entitylivingbase.field_70759_as = (float)(p_147281_1_.func_149032_n() * 360) / 256.0F;
  34610. Entity[] aentity = entitylivingbase.func_70021_al();
  34611. if(aentity != null) {
  34612. int i = p_147281_1_.func_149024_d() - entitylivingbase.func_145782_y();
  34613.  
  34614. for(Entity entity : aentity) {
  34615. entity.func_145769_d(entity.func_145782_y() + i);
  34616. }
  34617. }
  34618.  
  34619. entitylivingbase.func_145769_d(p_147281_1_.func_149024_d());
  34620. entitylivingbase.func_184221_a(p_147281_1_.func_186890_c());
  34621. entitylivingbase.func_70080_a(d0, d1, d2, f, f1);
  34622. entitylivingbase.field_70159_w = (double)((float)p_147281_1_.func_149026_i() / 8000.0F);
  34623. entitylivingbase.field_70181_x = (double)((float)p_147281_1_.func_149033_j() / 8000.0F);
  34624. entitylivingbase.field_70179_y = (double)((float)p_147281_1_.func_149031_k() / 8000.0F);
  34625. this.field_147300_g.func_73027_a(p_147281_1_.func_149024_d(), entitylivingbase);
  34626. List<EntityDataManager.DataEntry<?>> list = p_147281_1_.func_149027_c();
  34627. if(list != null) {
  34628. entitylivingbase.func_184212_Q().func_187218_a(list);
  34629. }
  34630. } else {
  34631. field_147301_d.warn((String)"Skipping Entity with id {}", (Object)Integer.valueOf(p_147281_1_.func_149025_e()));
  34632. }
  34633.  
  34634. }
  34635.  
  34636. public void func_147285_a(SPacketTimeUpdate p_147285_1_) {
  34637. PacketThreadUtil.func_180031_a(p_147285_1_, this, this.field_147299_f);
  34638. this.field_147299_f.field_71441_e.func_82738_a(p_147285_1_.func_149366_c());
  34639. this.field_147299_f.field_71441_e.func_72877_b(p_147285_1_.func_149365_d());
  34640. }
  34641.  
  34642. public void func_147271_a(SPacketSpawnPosition p_147271_1_) {
  34643. PacketThreadUtil.func_180031_a(p_147271_1_, this, this.field_147299_f);
  34644. this.field_147299_f.field_71439_g.func_180473_a(p_147271_1_.func_179800_a(), true);
  34645. this.field_147299_f.field_71441_e.func_72912_H().func_176143_a(p_147271_1_.func_179800_a());
  34646. }
  34647.  
  34648. public void func_184328_a(SPacketSetPassengers p_184328_1_) {
  34649. PacketThreadUtil.func_180031_a(p_184328_1_, this, this.field_147299_f);
  34650. Entity entity = this.field_147300_g.func_73045_a(p_184328_1_.func_186972_b());
  34651. if(entity == null) {
  34652. field_147301_d.warn("Received passengers for unknown entity");
  34653. } else {
  34654. boolean flag = entity.func_184215_y(this.field_147299_f.field_71439_g);
  34655. entity.func_184226_ay();
  34656.  
  34657. for(int i : p_184328_1_.func_186971_a()) {
  34658. Entity entity1 = this.field_147300_g.func_73045_a(i);
  34659. if(entity1 != null) {
  34660. entity1.func_184205_a(entity, true);
  34661. if(entity1 == this.field_147299_f.field_71439_g && !flag) {
  34662. this.field_147299_f.field_71456_v.func_110326_a(I18n.func_135052_a("mount.onboard", new Object[]{GameSettings.func_74298_c(this.field_147299_f.field_71474_y.field_74311_E.func_151463_i())}), false);
  34663. }
  34664. }
  34665. }
  34666.  
  34667. }
  34668. }
  34669.  
  34670. public void func_147243_a(SPacketEntityAttach p_147243_1_) {
  34671. PacketThreadUtil.func_180031_a(p_147243_1_, this, this.field_147299_f);
  34672. Entity entity = this.field_147300_g.func_73045_a(p_147243_1_.func_149403_d());
  34673. Entity entity1 = this.field_147300_g.func_73045_a(p_147243_1_.func_149402_e());
  34674. if(entity instanceof EntityLiving) {
  34675. if(entity1 != null) {
  34676. ((EntityLiving)entity).func_110162_b(entity1, false);
  34677. } else {
  34678. ((EntityLiving)entity).func_110160_i(false, false);
  34679. }
  34680. }
  34681.  
  34682. }
  34683.  
  34684. public void func_147236_a(SPacketEntityStatus p_147236_1_) {
  34685. PacketThreadUtil.func_180031_a(p_147236_1_, this, this.field_147299_f);
  34686. Entity entity = p_147236_1_.func_149161_a(this.field_147300_g);
  34687. if(entity != null) {
  34688. if(p_147236_1_.func_149160_c() == 21) {
  34689. this.field_147299_f.func_147118_V().func_147682_a(new GuardianSound((EntityGuardian)entity));
  34690. } else if(p_147236_1_.func_149160_c() == 35) {
  34691. int i = 40;
  34692. this.field_147299_f.field_71452_i.func_191271_a(entity, EnumParticleTypes.TOTEM, 30);
  34693. this.field_147300_g.func_184134_a(entity.field_70165_t, entity.field_70163_u, entity.field_70161_v, SoundEvents.field_191263_gW, entity.func_184176_by(), 1.0F, 1.0F, false);
  34694. if(entity == this.field_147299_f.field_71439_g) {
  34695. this.field_147299_f.field_71460_t.func_190565_a(new ItemStack(Items.field_190929_cY));
  34696. }
  34697. } else {
  34698. entity.func_70103_a(p_147236_1_.func_149160_c());
  34699. }
  34700. }
  34701.  
  34702. }
  34703.  
  34704. public void func_147249_a(SPacketUpdateHealth p_147249_1_) {
  34705. PacketThreadUtil.func_180031_a(p_147249_1_, this, this.field_147299_f);
  34706. this.field_147299_f.field_71439_g.func_71150_b(p_147249_1_.func_149332_c());
  34707. this.field_147299_f.field_71439_g.func_71024_bL().func_75114_a(p_147249_1_.func_149330_d());
  34708. this.field_147299_f.field_71439_g.func_71024_bL().func_75119_b(p_147249_1_.func_149331_e());
  34709. }
  34710.  
  34711. public void func_147295_a(SPacketSetExperience p_147295_1_) {
  34712. PacketThreadUtil.func_180031_a(p_147295_1_, this, this.field_147299_f);
  34713. this.field_147299_f.field_71439_g.func_71152_a(p_147295_1_.func_149397_c(), p_147295_1_.func_149396_d(), p_147295_1_.func_149395_e());
  34714. }
  34715.  
  34716. public void func_147280_a(SPacketRespawn p_147280_1_) {
  34717. PacketThreadUtil.func_180031_a(p_147280_1_, this, this.field_147299_f);
  34718. if(p_147280_1_.func_149082_c() != this.field_147299_f.field_71439_g.field_71093_bK) {
  34719. this.field_147309_h = false;
  34720. Scoreboard scoreboard = this.field_147300_g.func_96441_U();
  34721. this.field_147300_g = new WorldClient(this, new WorldSettings(0L, p_147280_1_.func_149083_e(), false, this.field_147299_f.field_71441_e.func_72912_H().func_76093_s(), p_147280_1_.func_149080_f()), p_147280_1_.func_149082_c(), p_147280_1_.func_149081_d(), this.field_147299_f.field_71424_I);
  34722. this.field_147300_g.func_96443_a(scoreboard);
  34723. this.field_147299_f.func_71403_a(this.field_147300_g);
  34724. this.field_147299_f.field_71439_g.field_71093_bK = p_147280_1_.func_149082_c();
  34725. this.field_147299_f.func_147108_a(new GuiDownloadTerrain(this));
  34726. }
  34727.  
  34728. this.field_147299_f.func_71354_a(p_147280_1_.func_149082_c());
  34729. this.field_147299_f.field_71442_b.func_78746_a(p_147280_1_.func_149083_e());
  34730. }
  34731.  
  34732. public void func_147283_a(SPacketExplosion p_147283_1_) {
  34733. PacketThreadUtil.func_180031_a(p_147283_1_, this, this.field_147299_f);
  34734. Explosion explosion = new Explosion(this.field_147299_f.field_71441_e, (Entity)null, p_147283_1_.func_149148_f(), p_147283_1_.func_149143_g(), p_147283_1_.func_149145_h(), p_147283_1_.func_149146_i(), p_147283_1_.func_149150_j());
  34735. explosion.func_77279_a(true);
  34736. this.field_147299_f.field_71439_g.field_70159_w += (double)p_147283_1_.func_149149_c();
  34737. this.field_147299_f.field_71439_g.field_70181_x += (double)p_147283_1_.func_149144_d();
  34738. this.field_147299_f.field_71439_g.field_70179_y += (double)p_147283_1_.func_149147_e();
  34739. }
  34740.  
  34741. public void func_147265_a(SPacketOpenWindow p_147265_1_) {
  34742. PacketThreadUtil.func_180031_a(p_147265_1_, this, this.field_147299_f);
  34743. EntityPlayerSP entityplayersp = this.field_147299_f.field_71439_g;
  34744. if("minecraft:container".equals(p_147265_1_.func_148902_e())) {
  34745. entityplayersp.func_71007_a(new InventoryBasic(p_147265_1_.func_179840_c(), p_147265_1_.func_148898_f()));
  34746. entityplayersp.field_71070_bA.field_75152_c = p_147265_1_.func_148901_c();
  34747. } else if("minecraft:villager".equals(p_147265_1_.func_148902_e())) {
  34748. entityplayersp.func_180472_a(new NpcMerchant(entityplayersp, p_147265_1_.func_179840_c()));
  34749. entityplayersp.field_71070_bA.field_75152_c = p_147265_1_.func_148901_c();
  34750. } else if("EntityHorse".equals(p_147265_1_.func_148902_e())) {
  34751. Entity entity = this.field_147300_g.func_73045_a(p_147265_1_.func_148897_h());
  34752. if(entity instanceof AbstractHorse) {
  34753. entityplayersp.func_184826_a((AbstractHorse)entity, new ContainerHorseChest(p_147265_1_.func_179840_c(), p_147265_1_.func_148898_f()));
  34754. entityplayersp.field_71070_bA.field_75152_c = p_147265_1_.func_148901_c();
  34755. }
  34756. } else if(!p_147265_1_.func_148900_g()) {
  34757. entityplayersp.func_180468_a(new LocalBlockIntercommunication(p_147265_1_.func_148902_e(), p_147265_1_.func_179840_c()));
  34758. entityplayersp.field_71070_bA.field_75152_c = p_147265_1_.func_148901_c();
  34759. } else {
  34760. IInventory iinventory = new ContainerLocalMenu(p_147265_1_.func_148902_e(), p_147265_1_.func_179840_c(), p_147265_1_.func_148898_f());
  34761. entityplayersp.func_71007_a(iinventory);
  34762. entityplayersp.field_71070_bA.field_75152_c = p_147265_1_.func_148901_c();
  34763. }
  34764.  
  34765. }
  34766.  
  34767. public void func_147266_a(SPacketSetSlot p_147266_1_) {
  34768. PacketThreadUtil.func_180031_a(p_147266_1_, this, this.field_147299_f);
  34769. EntityPlayer entityplayer = this.field_147299_f.field_71439_g;
  34770. ItemStack itemstack = p_147266_1_.func_149174_e();
  34771. int i = p_147266_1_.func_149173_d();
  34772. this.field_147299_f.func_193032_ao().func_193301_a(itemstack);
  34773. if(p_147266_1_.func_149175_c() == -1) {
  34774. entityplayer.field_71071_by.func_70437_b(itemstack);
  34775. } else if(p_147266_1_.func_149175_c() == -2) {
  34776. entityplayer.field_71071_by.func_70299_a(i, itemstack);
  34777. } else {
  34778. boolean flag = false;
  34779. if(this.field_147299_f.field_71462_r instanceof GuiContainerCreative) {
  34780. GuiContainerCreative guicontainercreative = (GuiContainerCreative)this.field_147299_f.field_71462_r;
  34781. flag = guicontainercreative.func_147056_g() != CreativeTabs.field_78036_m.func_78021_a();
  34782. }
  34783.  
  34784. if(p_147266_1_.func_149175_c() == 0 && p_147266_1_.func_149173_d() >= 36 && i < 45) {
  34785. if(!itemstack.func_190926_b()) {
  34786. ItemStack itemstack1 = entityplayer.field_71069_bz.func_75139_a(i).func_75211_c();
  34787. if(itemstack1.func_190926_b() || itemstack1.func_190916_E() < itemstack.func_190916_E()) {
  34788. itemstack.func_190915_d(5);
  34789. }
  34790. }
  34791.  
  34792. entityplayer.field_71069_bz.func_75141_a(i, itemstack);
  34793. } else if(p_147266_1_.func_149175_c() == entityplayer.field_71070_bA.field_75152_c && (p_147266_1_.func_149175_c() != 0 || !flag)) {
  34794. entityplayer.field_71070_bA.func_75141_a(i, itemstack);
  34795. }
  34796. }
  34797.  
  34798. }
  34799.  
  34800. public void func_147239_a(SPacketConfirmTransaction p_147239_1_) {
  34801. PacketThreadUtil.func_180031_a(p_147239_1_, this, this.field_147299_f);
  34802. Container container = null;
  34803. EntityPlayer entityplayer = this.field_147299_f.field_71439_g;
  34804. if(p_147239_1_.func_148889_c() == 0) {
  34805. container = entityplayer.field_71069_bz;
  34806. } else if(p_147239_1_.func_148889_c() == entityplayer.field_71070_bA.field_75152_c) {
  34807. container = entityplayer.field_71070_bA;
  34808. }
  34809.  
  34810. if(container != null && !p_147239_1_.func_148888_e()) {
  34811. this.func_147297_a(new CPacketConfirmTransaction(p_147239_1_.func_148889_c(), p_147239_1_.func_148890_d(), true));
  34812. }
  34813.  
  34814. }
  34815.  
  34816. public void func_147241_a(SPacketWindowItems p_147241_1_) {
  34817. PacketThreadUtil.func_180031_a(p_147241_1_, this, this.field_147299_f);
  34818. EntityPlayer entityplayer = this.field_147299_f.field_71439_g;
  34819. if(p_147241_1_.func_148911_c() == 0) {
  34820. entityplayer.field_71069_bz.func_190896_a(p_147241_1_.func_148910_d());
  34821. } else if(p_147241_1_.func_148911_c() == entityplayer.field_71070_bA.field_75152_c) {
  34822. entityplayer.field_71070_bA.func_190896_a(p_147241_1_.func_148910_d());
  34823. }
  34824.  
  34825. }
  34826.  
  34827. public void func_147268_a(SPacketSignEditorOpen p_147268_1_) {
  34828. PacketThreadUtil.func_180031_a(p_147268_1_, this, this.field_147299_f);
  34829. TileEntity tileentity = this.field_147300_g.func_175625_s(p_147268_1_.func_179777_a());
  34830. if(!(tileentity instanceof TileEntitySign)) {
  34831. tileentity = new TileEntitySign();
  34832. tileentity.func_145834_a(this.field_147300_g);
  34833. tileentity.func_174878_a(p_147268_1_.func_179777_a());
  34834. }
  34835.  
  34836. this.field_147299_f.field_71439_g.func_175141_a((TileEntitySign)tileentity);
  34837. }
  34838.  
  34839. public void func_147273_a(SPacketUpdateTileEntity p_147273_1_) {
  34840. PacketThreadUtil.func_180031_a(p_147273_1_, this, this.field_147299_f);
  34841. if(this.field_147299_f.field_71441_e.func_175667_e(p_147273_1_.func_179823_a())) {
  34842. TileEntity tileentity = this.field_147299_f.field_71441_e.func_175625_s(p_147273_1_.func_179823_a());
  34843. int i = p_147273_1_.func_148853_f();
  34844. boolean flag = i == 2 && tileentity instanceof TileEntityCommandBlock;
  34845. if(i == 1 && tileentity instanceof TileEntityMobSpawner || flag || i == 3 && tileentity instanceof TileEntityBeacon || i == 4 && tileentity instanceof TileEntitySkull || i == 5 && tileentity instanceof TileEntityFlowerPot || i == 6 && tileentity instanceof TileEntityBanner || i == 7 && tileentity instanceof TileEntityStructure || i == 8 && tileentity instanceof TileEntityEndGateway || i == 9 && tileentity instanceof TileEntitySign || i == 10 && tileentity instanceof TileEntityShulkerBox || i == 11 && tileentity instanceof TileEntityBed) {
  34846. tileentity.func_145839_a(p_147273_1_.func_148857_g());
  34847. }
  34848.  
  34849. if(flag && this.field_147299_f.field_71462_r instanceof GuiCommandBlock) {
  34850. ((GuiCommandBlock)this.field_147299_f.field_71462_r).func_184075_a();
  34851. }
  34852. }
  34853.  
  34854. }
  34855.  
  34856. public void func_147245_a(SPacketWindowProperty p_147245_1_) {
  34857. PacketThreadUtil.func_180031_a(p_147245_1_, this, this.field_147299_f);
  34858. EntityPlayer entityplayer = this.field_147299_f.field_71439_g;
  34859. if(entityplayer.field_71070_bA != null && entityplayer.field_71070_bA.field_75152_c == p_147245_1_.func_149182_c()) {
  34860. entityplayer.field_71070_bA.func_75137_b(p_147245_1_.func_149181_d(), p_147245_1_.func_149180_e());
  34861. }
  34862.  
  34863. }
  34864.  
  34865. public void func_147242_a(SPacketEntityEquipment p_147242_1_) {
  34866. PacketThreadUtil.func_180031_a(p_147242_1_, this, this.field_147299_f);
  34867. Entity entity = this.field_147300_g.func_73045_a(p_147242_1_.func_149389_d());
  34868. if(entity != null) {
  34869. entity.func_184201_a(p_147242_1_.func_186969_c(), p_147242_1_.func_149390_c());
  34870. }
  34871.  
  34872. }
  34873.  
  34874. public void func_147276_a(SPacketCloseWindow p_147276_1_) {
  34875. PacketThreadUtil.func_180031_a(p_147276_1_, this, this.field_147299_f);
  34876. this.field_147299_f.field_71439_g.func_175159_q();
  34877. }
  34878.  
  34879. public void func_147261_a(SPacketBlockAction p_147261_1_) {
  34880. PacketThreadUtil.func_180031_a(p_147261_1_, this, this.field_147299_f);
  34881. this.field_147299_f.field_71441_e.func_175641_c(p_147261_1_.func_179825_a(), p_147261_1_.func_148868_c(), p_147261_1_.func_148869_g(), p_147261_1_.func_148864_h());
  34882. }
  34883.  
  34884. public void func_147294_a(SPacketBlockBreakAnim p_147294_1_) {
  34885. PacketThreadUtil.func_180031_a(p_147294_1_, this, this.field_147299_f);
  34886. this.field_147299_f.field_71441_e.func_175715_c(p_147294_1_.func_148845_c(), p_147294_1_.func_179821_b(), p_147294_1_.func_148846_g());
  34887. }
  34888.  
  34889. public void func_147252_a(SPacketChangeGameState p_147252_1_) {
  34890. PacketThreadUtil.func_180031_a(p_147252_1_, this, this.field_147299_f);
  34891. EntityPlayer entityplayer = this.field_147299_f.field_71439_g;
  34892. int i = p_147252_1_.func_149138_c();
  34893. float f = p_147252_1_.func_149137_d();
  34894. int j = MathHelper.func_76141_d(f + 0.5F);
  34895. if(i >= 0 && i < SPacketChangeGameState.field_149142_a.length && SPacketChangeGameState.field_149142_a[i] != null) {
  34896. entityplayer.func_146105_b(new TextComponentTranslation(SPacketChangeGameState.field_149142_a[i], new Object[0]), false);
  34897. }
  34898.  
  34899. if(i == 1) {
  34900. this.field_147300_g.func_72912_H().func_76084_b(true);
  34901. this.field_147300_g.func_72894_k(0.0F);
  34902. } else if(i == 2) {
  34903. this.field_147300_g.func_72912_H().func_76084_b(false);
  34904. this.field_147300_g.func_72894_k(1.0F);
  34905. } else if(i == 3) {
  34906. this.field_147299_f.field_71442_b.func_78746_a(GameType.func_77146_a(j));
  34907. } else if(i == 4) {
  34908. if(j == 0) {
  34909. this.field_147299_f.field_71439_g.field_71174_a.func_147297_a(new CPacketClientStatus(CPacketClientStatus.State.PERFORM_RESPAWN));
  34910. this.field_147299_f.func_147108_a(new GuiDownloadTerrain(this));
  34911. } else if(j == 1) {
  34912. this.field_147299_f.func_147108_a(new GuiWinGame(true, () -> {
  34913. this.field_147299_f.field_71439_g.field_71174_a.func_147297_a(new CPacketClientStatus(CPacketClientStatus.State.PERFORM_RESPAWN));
  34914. }));
  34915. }
  34916. } else if(i == 5) {
  34917. GameSettings gamesettings = this.field_147299_f.field_71474_y;
  34918. if(f == 0.0F) {
  34919. this.field_147299_f.func_147108_a(new GuiScreenDemo());
  34920. } else if(f == 101.0F) {
  34921. this.field_147299_f.field_71456_v.func_146158_b().func_146227_a(new TextComponentTranslation("demo.help.movement", new Object[]{GameSettings.func_74298_c(gamesettings.field_74351_w.func_151463_i()), GameSettings.func_74298_c(gamesettings.field_74370_x.func_151463_i()), GameSettings.func_74298_c(gamesettings.field_74368_y.func_151463_i()), GameSettings.func_74298_c(gamesettings.field_74366_z.func_151463_i())}));
  34922. } else if(f == 102.0F) {
  34923. this.field_147299_f.field_71456_v.func_146158_b().func_146227_a(new TextComponentTranslation("demo.help.jump", new Object[]{GameSettings.func_74298_c(gamesettings.field_74314_A.func_151463_i())}));
  34924. } else if(f == 103.0F) {
  34925. this.field_147299_f.field_71456_v.func_146158_b().func_146227_a(new TextComponentTranslation("demo.help.inventory", new Object[]{GameSettings.func_74298_c(gamesettings.field_151445_Q.func_151463_i())}));
  34926. }
  34927. } else if(i == 6) {
  34928. this.field_147300_g.func_184148_a(entityplayer, entityplayer.field_70165_t, entityplayer.field_70163_u + (double)entityplayer.func_70047_e(), entityplayer.field_70161_v, SoundEvents.field_187734_u, SoundCategory.PLAYERS, 0.18F, 0.45F);
  34929. } else if(i == 7) {
  34930. this.field_147300_g.func_72894_k(f);
  34931. } else if(i == 8) {
  34932. this.field_147300_g.func_147442_i(f);
  34933. } else if(i == 10) {
  34934. this.field_147300_g.func_175688_a(EnumParticleTypes.MOB_APPEARANCE, entityplayer.field_70165_t, entityplayer.field_70163_u, entityplayer.field_70161_v, 0.0D, 0.0D, 0.0D, new int[0]);
  34935. this.field_147300_g.func_184148_a(entityplayer, entityplayer.field_70165_t, entityplayer.field_70163_u, entityplayer.field_70161_v, SoundEvents.field_187514_aD, SoundCategory.HOSTILE, 1.0F, 1.0F);
  34936. }
  34937.  
  34938. }
  34939.  
  34940. public void func_147264_a(SPacketMaps p_147264_1_) {
  34941. PacketThreadUtil.func_180031_a(p_147264_1_, this, this.field_147299_f);
  34942. MapItemRenderer mapitemrenderer = this.field_147299_f.field_71460_t.func_147701_i();
  34943. MapData mapdata = ItemMap.func_150912_a(p_147264_1_.func_149188_c(), this.field_147299_f.field_71441_e);
  34944. if(mapdata == null) {
  34945. String string = "map_" + p_147264_1_.func_149188_c();
  34946. mapdata = new MapData(string);
  34947. if(mapitemrenderer.func_191205_a(string) != null) {
  34948. MapData mapdata1 = mapitemrenderer.func_191207_a(mapitemrenderer.func_191205_a(string));
  34949. if(mapdata1 != null) {
  34950. mapdata = mapdata1;
  34951. }
  34952. }
  34953.  
  34954. this.field_147299_f.field_71441_e.func_72823_a(string, mapdata);
  34955. }
  34956.  
  34957. p_147264_1_.func_179734_a(mapdata);
  34958. mapitemrenderer.func_148246_a(mapdata);
  34959. }
  34960.  
  34961. public void func_147277_a(SPacketEffect p_147277_1_) {
  34962. PacketThreadUtil.func_180031_a(p_147277_1_, this, this.field_147299_f);
  34963. if(p_147277_1_.func_149244_c()) {
  34964. this.field_147299_f.field_71441_e.func_175669_a(p_147277_1_.func_149242_d(), p_147277_1_.func_179746_d(), p_147277_1_.func_149241_e());
  34965. } else {
  34966. this.field_147299_f.field_71441_e.func_175718_b(p_147277_1_.func_149242_d(), p_147277_1_.func_179746_d(), p_147277_1_.func_149241_e());
  34967. }
  34968.  
  34969. }
  34970.  
  34971. public void func_191981_a(SPacketAdvancementInfo p_191981_1_) {
  34972. PacketThreadUtil.func_180031_a(p_191981_1_, this, this.field_147299_f);
  34973. this.field_191983_k.func_192799_a(p_191981_1_);
  34974. }
  34975.  
  34976. public void func_194022_a(SPacketSelectAdvancementsTab p_194022_1_) {
  34977. PacketThreadUtil.func_180031_a(p_194022_1_, this, this.field_147299_f);
  34978. ResourceLocation resourcelocation = p_194022_1_.func_194154_a();
  34979. if(resourcelocation == null) {
  34980. this.field_191983_k.func_194230_a((Advancement)null, false);
  34981. } else {
  34982. Advancement advancement = this.field_191983_k.func_194229_a().func_192084_a(resourcelocation);
  34983. this.field_191983_k.func_194230_a(advancement, false);
  34984. }
  34985.  
  34986. }
  34987.  
  34988. public void func_147293_a(SPacketStatistics p_147293_1_) {
  34989. PacketThreadUtil.func_180031_a(p_147293_1_, this, this.field_147299_f);
  34990.  
  34991. for(Entry<StatBase, Integer> entry : p_147293_1_.func_148974_c().entrySet()) {
  34992. StatBase statbase = (StatBase)entry.getKey();
  34993. int int = ((Integer)entry.getValue()).intValue();
  34994. this.field_147299_f.field_71439_g.func_146107_m().func_150873_a(this.field_147299_f.field_71439_g, statbase, int);
  34995. }
  34996.  
  34997. this.field_147308_k = true;
  34998. if(this.field_147299_f.field_71462_r instanceof IProgressMeter) {
  34999. ((IProgressMeter)this.field_147299_f.field_71462_r).func_193026_g();
  35000. }
  35001.  
  35002. }
  35003.  
  35004. public void func_191980_a(SPacketRecipeBook p_191980_1_) {
  35005. RecipeBook recipebook;
  35006. PacketThreadUtil.func_180031_a(p_191980_1_, this, this.field_147299_f);
  35007. recipebook = this.field_147299_f.field_71439_g.func_192035_E();
  35008. recipebook.func_192813_a(p_191980_1_.func_192593_c());
  35009. recipebook.func_192810_b(p_191980_1_.func_192594_d());
  35010. SPacketRecipeBook.State spacketrecipebook$state = p_191980_1_.func_194151_e();
  35011. label0:
  35012. switch(spacketrecipebook$state) {
  35013. case REMOVE:
  35014. Iterator iterator = p_191980_1_.func_192595_a().iterator();
  35015.  
  35016. while(true) {
  35017. if(!iterator.hasNext()) {
  35018. break label0;
  35019. }
  35020.  
  35021. IRecipe irecipe = (IRecipe)iterator.next();
  35022. recipebook.func_193831_b(irecipe);
  35023. }
  35024. case INIT:
  35025. p_191980_1_.func_192595_a().forEach(recipebook::func_194073_a);
  35026. p_191980_1_.func_193644_b().forEach(recipebook::func_193825_e);
  35027. break;
  35028. case ADD:
  35029. p_191980_1_.func_192595_a().forEach((p_194025_2_) -> {
  35030. lvt_2_1_.func_194073_a(p_194025_2_);
  35031. lvt_2_1_.func_193825_e(p_194025_2_);
  35032. RecipeToast.func_193665_a(this.field_147299_f.func_193033_an(), p_194025_2_);
  35033. });
  35034. }
  35035.  
  35036. RecipeBookClient.field_194087_f.forEach((p_194023_1_) -> {
  35037. p_194023_1_.func_194214_a(lvt_2_1_);
  35038. });
  35039. if(this.field_147299_f.field_71462_r instanceof IRecipeShownListener) {
  35040. ((IRecipeShownListener)this.field_147299_f.field_71462_r).func_192043_J_();
  35041. }
  35042.  
  35043. }
  35044.  
  35045. public void func_147260_a(SPacketEntityEffect p_147260_1_) {
  35046. PacketThreadUtil.func_180031_a(p_147260_1_, this, this.field_147299_f);
  35047. Entity entity = this.field_147300_g.func_73045_a(p_147260_1_.func_149426_d());
  35048. if(entity instanceof EntityLivingBase) {
  35049. Potion potion = Potion.func_188412_a(p_147260_1_.func_149427_e());
  35050. if(potion != null) {
  35051. PotionEffect potioneffect = new PotionEffect(potion, p_147260_1_.func_180755_e(), p_147260_1_.func_149428_f(), p_147260_1_.func_186984_g(), p_147260_1_.func_179707_f());
  35052. potioneffect.func_100012_b(p_147260_1_.func_149429_c());
  35053. ((EntityLivingBase)entity).func_70690_d(potioneffect);
  35054. }
  35055. }
  35056. }
  35057.  
  35058. public void func_175098_a(SPacketCombatEvent p_175098_1_) {
  35059. PacketThreadUtil.func_180031_a(p_175098_1_, this, this.field_147299_f);
  35060. if(p_175098_1_.field_179776_a == SPacketCombatEvent.Event.ENTITY_DIED) {
  35061. Entity entity = this.field_147300_g.func_73045_a(p_175098_1_.field_179774_b);
  35062. if(entity == this.field_147299_f.field_71439_g) {
  35063. this.field_147299_f.func_147108_a(new GuiGameOver(p_175098_1_.field_179773_e));
  35064. }
  35065. }
  35066.  
  35067. }
  35068.  
  35069. public void func_175101_a(SPacketServerDifficulty p_175101_1_) {
  35070. PacketThreadUtil.func_180031_a(p_175101_1_, this, this.field_147299_f);
  35071. this.field_147299_f.field_71441_e.func_72912_H().func_176144_a(p_175101_1_.func_179831_b());
  35072. this.field_147299_f.field_71441_e.func_72912_H().func_180783_e(p_175101_1_.func_179830_a());
  35073. }
  35074.  
  35075. public void func_175094_a(SPacketCamera p_175094_1_) {
  35076. PacketThreadUtil.func_180031_a(p_175094_1_, this, this.field_147299_f);
  35077. Entity entity = p_175094_1_.func_179780_a(this.field_147300_g);
  35078. if(entity != null) {
  35079. this.field_147299_f.func_175607_a(entity);
  35080. }
  35081.  
  35082. }
  35083.  
  35084. public void func_175093_a(SPacketWorldBorder p_175093_1_) {
  35085. PacketThreadUtil.func_180031_a(p_175093_1_, this, this.field_147299_f);
  35086. p_175093_1_.func_179788_a(this.field_147300_g.func_175723_af());
  35087. }
  35088.  
  35089. public void func_175099_a(SPacketTitle p_175099_1_) {
  35090. PacketThreadUtil.func_180031_a(p_175099_1_, this, this.field_147299_f);
  35091. SPacketTitle.Type spackettitle$type = p_175099_1_.func_179807_a();
  35092. String string = null;
  35093. String string1 = null;
  35094. String string2 = p_175099_1_.func_179805_b() != null?p_175099_1_.func_179805_b().func_150254_d():"";
  35095. switch(spackettitle$type) {
  35096. case TITLE:
  35097. string = string2;
  35098. break;
  35099. case SUBTITLE:
  35100. string1 = string2;
  35101. break;
  35102. case ACTIONBAR:
  35103. this.field_147299_f.field_71456_v.func_110326_a(string2, false);
  35104. return;
  35105. case RESET:
  35106. this.field_147299_f.field_71456_v.func_175178_a("", "", -1, -1, -1);
  35107. this.field_147299_f.field_71456_v.func_175177_a();
  35108. return;
  35109. }
  35110.  
  35111. this.field_147299_f.field_71456_v.func_175178_a(string, string1, p_175099_1_.func_179806_c(), p_175099_1_.func_179804_d(), p_175099_1_.func_179803_e());
  35112. }
  35113.  
  35114. public void func_175096_a(SPacketPlayerListHeaderFooter p_175096_1_) {
  35115. this.field_147299_f.field_71456_v.func_175181_h().func_175244_b(p_175096_1_.func_179700_a().func_150254_d().isEmpty()?null:p_175096_1_.func_179700_a());
  35116. this.field_147299_f.field_71456_v.func_175181_h().func_175248_a(p_175096_1_.func_179701_b().func_150254_d().isEmpty()?null:p_175096_1_.func_179701_b());
  35117. }
  35118.  
  35119. public void func_147262_a(SPacketRemoveEntityEffect p_147262_1_) {
  35120. PacketThreadUtil.func_180031_a(p_147262_1_, this, this.field_147299_f);
  35121. Entity entity = p_147262_1_.func_186967_a(this.field_147300_g);
  35122. if(entity instanceof EntityLivingBase) {
  35123. ((EntityLivingBase)entity).func_184596_c(p_147262_1_.func_186968_a());
  35124. }
  35125.  
  35126. }
  35127.  
  35128. public void func_147256_a(SPacketPlayerListItem p_147256_1_) {
  35129. PacketThreadUtil.func_180031_a(p_147256_1_, this, this.field_147299_f);
  35130.  
  35131. for(SPacketPlayerListItem.AddPlayerData spacketplayerlistitem$addplayerdata : p_147256_1_.func_179767_a()) {
  35132. if(p_147256_1_.func_179768_b() == SPacketPlayerListItem.Action.REMOVE_PLAYER) {
  35133. this.field_147310_i.remove(spacketplayerlistitem$addplayerdata.func_179962_a().getId());
  35134. } else {
  35135. NetworkPlayerInfo networkplayerinfo = (NetworkPlayerInfo)this.field_147310_i.get(spacketplayerlistitem$addplayerdata.func_179962_a().getId());
  35136. if(p_147256_1_.func_179768_b() == SPacketPlayerListItem.Action.ADD_PLAYER) {
  35137. networkplayerinfo = new NetworkPlayerInfo(spacketplayerlistitem$addplayerdata);
  35138. this.field_147310_i.put(networkplayerinfo.func_178845_a().getId(), networkplayerinfo);
  35139. }
  35140.  
  35141. if(networkplayerinfo != null) {
  35142. switch(p_147256_1_.func_179768_b()) {
  35143. case ADD_PLAYER:
  35144. networkplayerinfo.func_178839_a(spacketplayerlistitem$addplayerdata.func_179960_c());
  35145. networkplayerinfo.func_178838_a(spacketplayerlistitem$addplayerdata.func_179963_b());
  35146. break;
  35147. case UPDATE_GAME_MODE:
  35148. networkplayerinfo.func_178839_a(spacketplayerlistitem$addplayerdata.func_179960_c());
  35149. break;
  35150. case UPDATE_LATENCY:
  35151. networkplayerinfo.func_178838_a(spacketplayerlistitem$addplayerdata.func_179963_b());
  35152. break;
  35153. case UPDATE_DISPLAY_NAME:
  35154. networkplayerinfo.func_178859_a(spacketplayerlistitem$addplayerdata.func_179961_d());
  35155. }
  35156. }
  35157. }
  35158. }
  35159.  
  35160. }
  35161.  
  35162. public void func_147272_a(SPacketKeepAlive p_147272_1_) {
  35163. this.func_147297_a(new CPacketKeepAlive(p_147272_1_.func_149134_c()));
  35164. }
  35165.  
  35166. public void func_147270_a(SPacketPlayerAbilities p_147270_1_) {
  35167. PacketThreadUtil.func_180031_a(p_147270_1_, this, this.field_147299_f);
  35168. EntityPlayer entityplayer = this.field_147299_f.field_71439_g;
  35169. entityplayer.field_71075_bZ.field_75100_b = p_147270_1_.func_149106_d();
  35170. entityplayer.field_71075_bZ.field_75098_d = p_147270_1_.func_149103_f();
  35171. entityplayer.field_71075_bZ.field_75102_a = p_147270_1_.func_149112_c();
  35172. entityplayer.field_71075_bZ.field_75101_c = p_147270_1_.func_149105_e();
  35173. entityplayer.field_71075_bZ.func_75092_a(p_147270_1_.func_149101_g());
  35174. entityplayer.field_71075_bZ.func_82877_b(p_147270_1_.func_149107_h());
  35175. }
  35176.  
  35177. public void func_147274_a(SPacketTabComplete p_147274_1_) {
  35178. PacketThreadUtil.func_180031_a(p_147274_1_, this, this.field_147299_f);
  35179. String[] astring = p_147274_1_.func_149630_c();
  35180. Arrays.sort((Object[])astring);
  35181. if(this.field_147299_f.field_71462_r instanceof ITabCompleter) {
  35182. ((ITabCompleter)this.field_147299_f.field_71462_r).func_184072_a(astring);
  35183. }
  35184.  
  35185. }
  35186.  
  35187. public void func_184327_a(SPacketSoundEffect p_184327_1_) {
  35188. PacketThreadUtil.func_180031_a(p_184327_1_, this, this.field_147299_f);
  35189. this.field_147299_f.field_71441_e.func_184148_a(this.field_147299_f.field_71439_g, p_184327_1_.func_149207_d(), p_184327_1_.func_149211_e(), p_184327_1_.func_149210_f(), p_184327_1_.func_186978_a(), p_184327_1_.func_186977_b(), p_184327_1_.func_149208_g(), p_184327_1_.func_149209_h());
  35190. }
  35191.  
  35192. public void func_184329_a(SPacketCustomSound p_184329_1_) {
  35193. PacketThreadUtil.func_180031_a(p_184329_1_, this, this.field_147299_f);
  35194. this.field_147299_f.func_147118_V().func_147682_a(new PositionedSoundRecord(new ResourceLocation(p_184329_1_.func_186930_a()), p_184329_1_.func_186929_b(), p_184329_1_.func_186927_f(), p_184329_1_.func_186928_g(), false, 0, ISound.AttenuationType.LINEAR, (float)p_184329_1_.func_186932_c(), (float)p_184329_1_.func_186926_d(), (float)p_184329_1_.func_186925_e()));
  35195. }
  35196.  
  35197. public void func_175095_a(SPacketResourcePackSend p_175095_1_) {
  35198. final String string = p_175095_1_.func_179783_a();
  35199. final String string1 = p_175095_1_.func_179784_b();
  35200. if(this.func_189688_b(string)) {
  35201. if(string.startsWith("level://")) {
  35202. try {
  35203. String string2 = URLDecoder.decode(string.substring("level://".length()), StandardCharsets.UTF_8.toString());
  35204. File file = new File(this.field_147299_f.field_71412_D, "saves");
  35205. File file1 = new File(file, string2);
  35206. if(file1.isFile()) {
  35207. this.field_147302_e.func_179290_a(new CPacketResourcePackStatus(CPacketResourcePackStatus.Action.ACCEPTED));
  35208. Futures.addCallback(this.field_147299_f.func_110438_M().func_177319_a(file1), this.func_189686_f());
  35209. return;
  35210. }
  35211. } catch (UnsupportedEncodingException var7) {
  35212. ;
  35213. }
  35214.  
  35215. this.field_147302_e.func_179290_a(new CPacketResourcePackStatus(CPacketResourcePackStatus.Action.FAILED_DOWNLOAD));
  35216. } else {
  35217. ServerData serverdata = this.field_147299_f.func_147104_D();
  35218. if(serverdata != null && serverdata.func_152586_b() == ServerData.ServerResourceMode.ENABLED) {
  35219. this.field_147302_e.func_179290_a(new CPacketResourcePackStatus(CPacketResourcePackStatus.Action.ACCEPTED));
  35220. Futures.addCallback(this.field_147299_f.func_110438_M().func_180601_a(string, string1), this.func_189686_f());
  35221. } else if(serverdata != null && serverdata.func_152586_b() != ServerData.ServerResourceMode.PROMPT) {
  35222. this.field_147302_e.func_179290_a(new CPacketResourcePackStatus(CPacketResourcePackStatus.Action.DECLINED));
  35223. } else {
  35224. this.field_147299_f.func_152344_a(new Runnable() {
  35225. public void run() {
  35226. NetHandlerPlayClient.this.field_147299_f.func_147108_a(new GuiYesNo(new GuiYesNoCallback() {
  35227. public void func_73878_a(boolean p_73878_1_, int p_73878_2_) {
  35228. NetHandlerPlayClient.this.field_147299_f = Minecraft.func_71410_x();
  35229. ServerData serverdata1 = NetHandlerPlayClient.this.field_147299_f.func_147104_D();
  35230. if(p_73878_1_) {
  35231. if(serverdata1 != null) {
  35232. serverdata1.func_152584_a(ServerData.ServerResourceMode.ENABLED);
  35233. }
  35234.  
  35235. NetHandlerPlayClient.this.field_147302_e.func_179290_a(new CPacketResourcePackStatus(CPacketResourcePackStatus.Action.ACCEPTED));
  35236. Futures.addCallback(NetHandlerPlayClient.this.field_147299_f.func_110438_M().func_180601_a(string, string1), NetHandlerPlayClient.this.func_189686_f());
  35237. } else {
  35238. if(serverdata1 != null) {
  35239. serverdata1.func_152584_a(ServerData.ServerResourceMode.DISABLED);
  35240. }
  35241.  
  35242. NetHandlerPlayClient.this.field_147302_e.func_179290_a(new CPacketResourcePackStatus(CPacketResourcePackStatus.Action.DECLINED));
  35243. }
  35244.  
  35245. ServerList.func_147414_b(serverdata1);
  35246. NetHandlerPlayClient.this.field_147299_f.func_147108_a((GuiScreen)null);
  35247. }
  35248. }, I18n.func_135052_a("multiplayer.texturePrompt.line1", new Object[0]), I18n.func_135052_a("multiplayer.texturePrompt.line2", new Object[0]), 0));
  35249. }
  35250. });
  35251. }
  35252.  
  35253. }
  35254. }
  35255. }
  35256.  
  35257. private boolean func_189688_b(String p_189688_1_) {
  35258. try {
  35259. URI uri = new URI(p_189688_1_);
  35260. String string = uri.getScheme();
  35261. boolean boolean = "level".equals(string);
  35262. if(!"http".equals(string) && !"https".equals(string) && !boolean) {
  35263. throw new URISyntaxException(p_189688_1_, "Wrong protocol");
  35264. } else if(!boolean || !p_189688_1_.contains("..") && p_189688_1_.endsWith("/resources.zip")) {
  35265. return true;
  35266. } else {
  35267. throw new URISyntaxException(p_189688_1_, "Invalid levelstorage resourcepack path");
  35268. }
  35269. } catch (URISyntaxException var5) {
  35270. this.field_147302_e.func_179290_a(new CPacketResourcePackStatus(CPacketResourcePackStatus.Action.FAILED_DOWNLOAD));
  35271. return false;
  35272. }
  35273. }
  35274.  
  35275. private FutureCallback<Object> func_189686_f() {
  35276. return new FutureCallback<Object>() {
  35277. public void onSuccess(@Nullable Object p_onSuccess_1_) {
  35278. NetHandlerPlayClient.this.field_147302_e.func_179290_a(new CPacketResourcePackStatus(CPacketResourcePackStatus.Action.SUCCESSFULLY_LOADED));
  35279. }
  35280.  
  35281. public void onFailure(Throwable p_onFailure_1_) {
  35282. NetHandlerPlayClient.this.field_147302_e.func_179290_a(new CPacketResourcePackStatus(CPacketResourcePackStatus.Action.FAILED_DOWNLOAD));
  35283. }
  35284. };
  35285. }
  35286.  
  35287. public void func_184325_a(SPacketUpdateBossInfo p_184325_1_) {
  35288. PacketThreadUtil.func_180031_a(p_184325_1_, this, this.field_147299_f);
  35289. this.field_147299_f.field_71456_v.func_184046_j().func_184055_a(p_184325_1_);
  35290. }
  35291.  
  35292. public void func_184324_a(SPacketCooldown p_184324_1_) {
  35293. PacketThreadUtil.func_180031_a(p_184324_1_, this, this.field_147299_f);
  35294. if(p_184324_1_.func_186922_b() == 0) {
  35295. this.field_147299_f.field_71439_g.func_184811_cZ().func_185142_b(p_184324_1_.func_186920_a());
  35296. } else {
  35297. this.field_147299_f.field_71439_g.func_184811_cZ().func_185145_a(p_184324_1_.func_186920_a(), p_184324_1_.func_186922_b());
  35298. }
  35299.  
  35300. }
  35301.  
  35302. public void func_184323_a(SPacketMoveVehicle p_184323_1_) {
  35303. PacketThreadUtil.func_180031_a(p_184323_1_, this, this.field_147299_f);
  35304. Entity entity = this.field_147299_f.field_71439_g.func_184208_bv();
  35305. if(entity != this.field_147299_f.field_71439_g && entity.func_184186_bw()) {
  35306. entity.func_70080_a(p_184323_1_.func_186957_a(), p_184323_1_.func_186955_b(), p_184323_1_.func_186956_c(), p_184323_1_.func_186959_d(), p_184323_1_.func_186958_e());
  35307. this.field_147302_e.func_179290_a(new CPacketVehicleMove(entity));
  35308. }
  35309.  
  35310. }
  35311.  
  35312. public void func_147240_a(SPacketCustomPayload p_147240_1_) {
  35313. PacketThreadUtil.func_180031_a(p_147240_1_, this, this.field_147299_f);
  35314. if("MC|TrList".equals(p_147240_1_.func_149169_c())) {
  35315. PacketBuffer packetbuffer = p_147240_1_.func_180735_b();
  35316.  
  35317. try {
  35318. int int = packetbuffer.readInt();
  35319. GuiScreen guiscreen = this.field_147299_f.field_71462_r;
  35320. if(guiscreen != null && guiscreen instanceof GuiMerchant && int == this.field_147299_f.field_71439_g.field_71070_bA.field_75152_c) {
  35321. IMerchant imerchant = ((GuiMerchant)guiscreen).func_147035_g();
  35322. MerchantRecipeList merchantrecipelist = MerchantRecipeList.func_151390_b(packetbuffer);
  35323. imerchant.func_70930_a(merchantrecipelist);
  35324. }
  35325. } catch (IOException ioexception) {
  35326. field_147301_d.error((String)"Couldn\'t load trade info", (Throwable)ioexception);
  35327. } finally {
  35328. packetbuffer.release();
  35329. }
  35330. } else if("MC|Brand".equals(p_147240_1_.func_149169_c())) {
  35331. this.field_147299_f.field_71439_g.func_175158_f(p_147240_1_.func_180735_b().func_150789_c(32767));
  35332. } else if("MC|BOpen".equals(p_147240_1_.func_149169_c())) {
  35333. EnumHand enumhand = (EnumHand)p_147240_1_.func_180735_b().func_179257_a(EnumHand.class);
  35334. ItemStack itemstack = enumhand == EnumHand.OFF_HAND?this.field_147299_f.field_71439_g.func_184592_cb():this.field_147299_f.field_71439_g.func_184614_ca();
  35335. if(itemstack.func_77973_b() == Items.field_151164_bB) {
  35336. this.field_147299_f.func_147108_a(new GuiScreenBook(this.field_147299_f.field_71439_g, itemstack, false));
  35337. }
  35338. } else if("MC|DebugPath".equals(p_147240_1_.func_149169_c())) {
  35339. PacketBuffer packetbuffer1 = p_147240_1_.func_180735_b();
  35340. int int = packetbuffer1.readInt();
  35341. float float = packetbuffer1.readFloat();
  35342. Path path = Path.func_186311_b(packetbuffer1);
  35343. ((DebugRendererPathfinding)this.field_147299_f.field_184132_p.field_188286_a).func_188289_a(int, path, float);
  35344. } else if("MC|DebugNeighborsUpdate".equals(p_147240_1_.func_149169_c())) {
  35345. PacketBuffer packetbuffer2 = p_147240_1_.func_180735_b();
  35346. long long = packetbuffer2.func_179260_f();
  35347. BlockPos blockpos = packetbuffer2.func_179259_c();
  35348. ((DebugRendererNeighborsUpdate)this.field_147299_f.field_184132_p.field_191557_f).func_191553_a(long, blockpos);
  35349. } else if("MC|StopSound".equals(p_147240_1_.func_149169_c())) {
  35350. PacketBuffer packetbuffer3 = p_147240_1_.func_180735_b();
  35351. String string = packetbuffer3.func_150789_c(32767);
  35352. String string1 = packetbuffer3.func_150789_c(256);
  35353. this.field_147299_f.func_147118_V().func_189520_a(string1, SoundCategory.func_187950_a(string));
  35354. }
  35355.  
  35356. }
  35357.  
  35358. public void func_147291_a(SPacketScoreboardObjective p_147291_1_) {
  35359. PacketThreadUtil.func_180031_a(p_147291_1_, this, this.field_147299_f);
  35360. Scoreboard scoreboard = this.field_147300_g.func_96441_U();
  35361. if(p_147291_1_.func_149338_e() == 0) {
  35362. ScoreObjective scoreobjective = scoreboard.func_96535_a(p_147291_1_.func_149339_c(), IScoreCriteria.field_96641_b);
  35363. scoreobjective.func_96681_a(p_147291_1_.func_149337_d());
  35364. scoreobjective.func_178767_a(p_147291_1_.func_179817_d());
  35365. } else {
  35366. ScoreObjective scoreobjective1 = scoreboard.func_96518_b(p_147291_1_.func_149339_c());
  35367. if(p_147291_1_.func_149338_e() == 1) {
  35368. scoreboard.func_96519_k(scoreobjective1);
  35369. } else if(p_147291_1_.func_149338_e() == 2) {
  35370. scoreobjective1.func_96681_a(p_147291_1_.func_149337_d());
  35371. scoreobjective1.func_178767_a(p_147291_1_.func_179817_d());
  35372. }
  35373. }
  35374.  
  35375. }
  35376.  
  35377. public void func_147250_a(SPacketUpdateScore p_147250_1_) {
  35378. PacketThreadUtil.func_180031_a(p_147250_1_, this, this.field_147299_f);
  35379. Scoreboard scoreboard = this.field_147300_g.func_96441_U();
  35380. ScoreObjective scoreobjective = scoreboard.func_96518_b(p_147250_1_.func_149321_d());
  35381. if(p_147250_1_.func_180751_d() == SPacketUpdateScore.Action.CHANGE) {
  35382. Score score = scoreboard.func_96529_a(p_147250_1_.func_149324_c(), scoreobjective);
  35383. score.func_96647_c(p_147250_1_.func_149323_e());
  35384. } else if(p_147250_1_.func_180751_d() == SPacketUpdateScore.Action.REMOVE) {
  35385. if(StringUtils.func_151246_b(p_147250_1_.func_149321_d())) {
  35386. scoreboard.func_178822_d(p_147250_1_.func_149324_c(), (ScoreObjective)null);
  35387. } else if(scoreobjective != null) {
  35388. scoreboard.func_178822_d(p_147250_1_.func_149324_c(), scoreobjective);
  35389. }
  35390. }
  35391.  
  35392. }
  35393.  
  35394. public void func_147254_a(SPacketDisplayObjective p_147254_1_) {
  35395. PacketThreadUtil.func_180031_a(p_147254_1_, this, this.field_147299_f);
  35396. Scoreboard scoreboard = this.field_147300_g.func_96441_U();
  35397. if(p_147254_1_.func_149370_d().isEmpty()) {
  35398. scoreboard.func_96530_a(p_147254_1_.func_149371_c(), (ScoreObjective)null);
  35399. } else {
  35400. ScoreObjective scoreobjective = scoreboard.func_96518_b(p_147254_1_.func_149370_d());
  35401. scoreboard.func_96530_a(p_147254_1_.func_149371_c(), scoreobjective);
  35402. }
  35403.  
  35404. }
  35405.  
  35406. public void func_147247_a(SPacketTeams p_147247_1_) {
  35407. PacketThreadUtil.func_180031_a(p_147247_1_, this, this.field_147299_f);
  35408. Scoreboard scoreboard = this.field_147300_g.func_96441_U();
  35409. ScorePlayerTeam scoreplayerteam;
  35410. if(p_147247_1_.func_149307_h() == 0) {
  35411. scoreplayerteam = scoreboard.func_96527_f(p_147247_1_.func_149312_c());
  35412. } else {
  35413. scoreplayerteam = scoreboard.func_96508_e(p_147247_1_.func_149312_c());
  35414. }
  35415.  
  35416. if(p_147247_1_.func_149307_h() == 0 || p_147247_1_.func_149307_h() == 2) {
  35417. scoreplayerteam.func_96664_a(p_147247_1_.func_149306_d());
  35418. scoreplayerteam.func_96666_b(p_147247_1_.func_149311_e());
  35419. scoreplayerteam.func_96662_c(p_147247_1_.func_149309_f());
  35420. scoreplayerteam.func_178774_a(TextFormatting.func_175744_a(p_147247_1_.func_179813_h()));
  35421. scoreplayerteam.func_98298_a(p_147247_1_.func_149308_i());
  35422. Team.EnumVisible team$enumvisible = Team.EnumVisible.func_178824_a(p_147247_1_.func_179814_i());
  35423. if(team$enumvisible != null) {
  35424. scoreplayerteam.func_178772_a(team$enumvisible);
  35425. }
  35426.  
  35427. Team.CollisionRule team$collisionrule = Team.CollisionRule.func_186686_a(p_147247_1_.func_186975_j());
  35428. if(team$collisionrule != null) {
  35429. scoreplayerteam.func_186682_a(team$collisionrule);
  35430. }
  35431. }
  35432.  
  35433. if(p_147247_1_.func_149307_h() == 0 || p_147247_1_.func_149307_h() == 3) {
  35434. for(String string : p_147247_1_.func_149310_g()) {
  35435. scoreboard.func_151392_a(string, p_147247_1_.func_149312_c());
  35436. }
  35437. }
  35438.  
  35439. if(p_147247_1_.func_149307_h() == 4) {
  35440. for(String string1 : p_147247_1_.func_149310_g()) {
  35441. scoreboard.func_96512_b(string1, scoreplayerteam);
  35442. }
  35443. }
  35444.  
  35445. if(p_147247_1_.func_149307_h() == 1) {
  35446. scoreboard.func_96511_d(scoreplayerteam);
  35447. }
  35448.  
  35449. }
  35450.  
  35451. public void func_147289_a(SPacketParticles p_147289_1_) {
  35452. PacketThreadUtil.func_180031_a(p_147289_1_, this, this.field_147299_f);
  35453. if(p_147289_1_.func_149222_k() == 0) {
  35454. double double = (double)(p_147289_1_.func_149227_j() * p_147289_1_.func_149221_g());
  35455. double double = (double)(p_147289_1_.func_149227_j() * p_147289_1_.func_149224_h());
  35456. double double = (double)(p_147289_1_.func_149227_j() * p_147289_1_.func_149223_i());
  35457.  
  35458. try {
  35459. this.field_147300_g.func_175682_a(p_147289_1_.func_179749_a(), p_147289_1_.func_179750_b(), p_147289_1_.func_149220_d(), p_147289_1_.func_149226_e(), p_147289_1_.func_149225_f(), double, double, double, p_147289_1_.func_179748_k());
  35460. } catch (Throwable var17) {
  35461. field_147301_d.warn((String)"Could not spawn particle effect {}", (Object)p_147289_1_.func_179749_a());
  35462. }
  35463. } else {
  35464. for(int int = 0; int < p_147289_1_.func_149222_k(); ++int) {
  35465. double double = this.field_147306_l.nextGaussian() * (double)p_147289_1_.func_149221_g();
  35466. double double = this.field_147306_l.nextGaussian() * (double)p_147289_1_.func_149224_h();
  35467. double double = this.field_147306_l.nextGaussian() * (double)p_147289_1_.func_149223_i();
  35468. double double = this.field_147306_l.nextGaussian() * (double)p_147289_1_.func_149227_j();
  35469. double double = this.field_147306_l.nextGaussian() * (double)p_147289_1_.func_149227_j();
  35470. double double = this.field_147306_l.nextGaussian() * (double)p_147289_1_.func_149227_j();
  35471.  
  35472. try {
  35473. this.field_147300_g.func_175682_a(p_147289_1_.func_179749_a(), p_147289_1_.func_179750_b(), p_147289_1_.func_149220_d() + double, p_147289_1_.func_149226_e() + double, p_147289_1_.func_149225_f() + double, double, double, double, p_147289_1_.func_179748_k());
  35474. } catch (Throwable var16) {
  35475. field_147301_d.warn((String)"Could not spawn particle effect {}", (Object)p_147289_1_.func_179749_a());
  35476. return;
  35477. }
  35478. }
  35479. }
  35480.  
  35481. }
  35482.  
  35483. public void func_147290_a(SPacketEntityProperties p_147290_1_) {
  35484. PacketThreadUtil.func_180031_a(p_147290_1_, this, this.field_147299_f);
  35485. Entity entity = this.field_147300_g.func_73045_a(p_147290_1_.func_149442_c());
  35486. if(entity != null) {
  35487. if(!(entity instanceof EntityLivingBase)) {
  35488. throw new IllegalStateException("Server tried to update attributes of a non-living entity (actually: " + entity + ")");
  35489. } else {
  35490. AbstractAttributeMap abstractattributemap = ((EntityLivingBase)entity).func_110140_aT();
  35491.  
  35492. for(SPacketEntityProperties.Snapshot spacketentityproperties$snapshot : p_147290_1_.func_149441_d()) {
  35493. IAttributeInstance iattributeinstance = abstractattributemap.func_111152_a(spacketentityproperties$snapshot.func_151409_a());
  35494. if(iattributeinstance == null) {
  35495. iattributeinstance = abstractattributemap.func_111150_b(new RangedAttribute((IAttribute)null, spacketentityproperties$snapshot.func_151409_a(), 0.0D, 2.2250738585072014E-308D, Double.MAX_VALUE));
  35496. }
  35497.  
  35498. iattributeinstance.func_111128_a(spacketentityproperties$snapshot.func_151410_b());
  35499. iattributeinstance.func_142049_d();
  35500.  
  35501. for(AttributeModifier attributemodifier : spacketentityproperties$snapshot.func_151408_c()) {
  35502. iattributeinstance.func_111121_a(attributemodifier);
  35503. }
  35504. }
  35505.  
  35506. }
  35507. }
  35508. }
  35509.  
  35510. public NetworkManager func_147298_b() {
  35511. return this.field_147302_e;
  35512. }
  35513.  
  35514. public Collection<NetworkPlayerInfo> func_175106_d() {
  35515. return this.field_147310_i.values();
  35516. }
  35517.  
  35518. public NetworkPlayerInfo func_175102_a(UUID p_175102_1_) {
  35519. return (NetworkPlayerInfo)this.field_147310_i.get(p_175102_1_);
  35520. }
  35521.  
  35522. @Nullable
  35523. public NetworkPlayerInfo func_175104_a(String p_175104_1_) {
  35524. for(NetworkPlayerInfo networkplayerinfo : this.field_147310_i.values()) {
  35525. if(networkplayerinfo.func_178845_a().getName().equals(p_175104_1_)) {
  35526. return networkplayerinfo;
  35527. }
  35528. }
  35529.  
  35530. return null;
  35531. }
  35532.  
  35533. public GameProfile func_175105_e() {
  35534. return this.field_175107_d;
  35535. }
  35536.  
  35537. public ClientAdvancementManager func_191982_f() {
  35538. return this.field_191983_k;
  35539. }
  35540. }
  35541.  
  35542. Patching failed: minecraft\net\minecraft\client\particle\ParticleManager.java
  35543. Hunk 1 failed! Cannot find hunk target
  35544. GlStateManager.func_187401_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
  35545. GlStateManager.func_179092_a(516, 0.003921569F);
  35546.  
  35547. - for(final int i = 0; i < 3; ++i) {
  35548. + for(int i_nf = 0; i_nf < 3; ++i_nf) {
  35549. + final int i = i_nf;
  35550. for(int j = 0; j < 2; ++j) {
  35551. if (!this.field_78876_b[i][j].isEmpty()) {
  35552. switch(j) {
  35553. File state
  35554. package net.minecraft.client.particle;
  35555.  
  35556. import com.google.common.collect.Lists;
  35557. import com.google.common.collect.Maps;
  35558. import com.google.common.collect.Queues;
  35559. import java.util.ArrayDeque;
  35560. import java.util.Iterator;
  35561. import java.util.List;
  35562. import java.util.Map;
  35563. import java.util.Queue;
  35564. import java.util.Random;
  35565. import javax.annotation.Nullable;
  35566. import net.minecraft.block.material.Material;
  35567. import net.minecraft.block.state.IBlockState;
  35568. import net.minecraft.client.particle.Barrier;
  35569. import net.minecraft.client.particle.IParticleFactory;
  35570. import net.minecraft.client.particle.Particle;
  35571. import net.minecraft.client.particle.ParticleBlockDust;
  35572. import net.minecraft.client.particle.ParticleBreaking;
  35573. import net.minecraft.client.particle.ParticleBubble;
  35574. import net.minecraft.client.particle.ParticleCloud;
  35575. import net.minecraft.client.particle.ParticleCrit;
  35576. import net.minecraft.client.particle.ParticleDigging;
  35577. import net.minecraft.client.particle.ParticleDragonBreath;
  35578. import net.minecraft.client.particle.ParticleDrip;
  35579. import net.minecraft.client.particle.ParticleEmitter;
  35580. import net.minecraft.client.particle.ParticleEnchantmentTable;
  35581. import net.minecraft.client.particle.ParticleEndRod;
  35582. import net.minecraft.client.particle.ParticleExplosion;
  35583. import net.minecraft.client.particle.ParticleExplosionHuge;
  35584. import net.minecraft.client.particle.ParticleExplosionLarge;
  35585. import net.minecraft.client.particle.ParticleFallingDust;
  35586. import net.minecraft.client.particle.ParticleFirework;
  35587. import net.minecraft.client.particle.ParticleFlame;
  35588. import net.minecraft.client.particle.ParticleFootStep;
  35589. import net.minecraft.client.particle.ParticleHeart;
  35590. import net.minecraft.client.particle.ParticleLava;
  35591. import net.minecraft.client.particle.ParticleMobAppearance;
  35592. import net.minecraft.client.particle.ParticleNote;
  35593. import net.minecraft.client.particle.ParticlePortal;
  35594. import net.minecraft.client.particle.ParticleRain;
  35595. import net.minecraft.client.particle.ParticleRedstone;
  35596. import net.minecraft.client.particle.ParticleSmokeLarge;
  35597. import net.minecraft.client.particle.ParticleSmokeNormal;
  35598. import net.minecraft.client.particle.ParticleSnowShovel;
  35599. import net.minecraft.client.particle.ParticleSpell;
  35600. import net.minecraft.client.particle.ParticleSpit;
  35601. import net.minecraft.client.particle.ParticleSplash;
  35602. import net.minecraft.client.particle.ParticleSuspend;
  35603. import net.minecraft.client.particle.ParticleSuspendedTown;
  35604. import net.minecraft.client.particle.ParticleSweepAttack;
  35605. import net.minecraft.client.particle.ParticleTotem;
  35606. import net.minecraft.client.particle.ParticleWaterWake;
  35607. import net.minecraft.client.renderer.ActiveRenderInfo;
  35608. import net.minecraft.client.renderer.BufferBuilder;
  35609. import net.minecraft.client.renderer.GlStateManager;
  35610. import net.minecraft.client.renderer.Tessellator;
  35611. import net.minecraft.client.renderer.texture.TextureManager;
  35612. import net.minecraft.client.renderer.texture.TextureMap;
  35613. import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
  35614. import net.minecraft.crash.CrashReport;
  35615. import net.minecraft.crash.CrashReportCategory;
  35616. import net.minecraft.crash.ICrashReportDetail;
  35617. import net.minecraft.entity.Entity;
  35618. import net.minecraft.util.EnumBlockRenderType;
  35619. import net.minecraft.util.EnumFacing;
  35620. import net.minecraft.util.EnumParticleTypes;
  35621. import net.minecraft.util.ReportedException;
  35622. import net.minecraft.util.ResourceLocation;
  35623. import net.minecraft.util.math.AxisAlignedBB;
  35624. import net.minecraft.util.math.BlockPos;
  35625. import net.minecraft.util.math.MathHelper;
  35626. import net.minecraft.world.World;
  35627. import net.minecraftforge.fml.relauncher.Side;
  35628. import net.minecraftforge.fml.relauncher.SideOnly;
  35629.  
  35630. @SideOnly(Side.CLIENT)
  35631. public class ParticleManager {
  35632. private static final ResourceLocation field_110737_b = new ResourceLocation("textures/particle/particles.png");
  35633. protected World field_78878_a;
  35634. private final ArrayDeque<Particle>[][] field_78876_b = new ArrayDeque[4][];
  35635. private final Queue<ParticleEmitter> field_178933_d = Queues.<ParticleEmitter>newArrayDeque();
  35636. private final TextureManager field_78877_c;
  35637. private final Random field_78875_d = new Random();
  35638. private final Map<Integer, IParticleFactory> field_178932_g = Maps.<Integer, IParticleFactory>newHashMap();
  35639. private final Queue<Particle> field_187241_h = Queues.<Particle>newArrayDeque();
  35640.  
  35641. public ParticleManager(World p_i1220_1_, TextureManager p_i1220_2_) {
  35642. this.field_78878_a = p_i1220_1_;
  35643. this.field_78877_c = p_i1220_2_;
  35644.  
  35645. for(int i = 0; i < 4; ++i) {
  35646. this.field_78876_b[i] = new ArrayDeque[2];
  35647.  
  35648. for(int j = 0; j < 2; ++j) {
  35649. this.field_78876_b[i][j] = Queues.newArrayDeque();
  35650. }
  35651. }
  35652.  
  35653. this.func_178930_c();
  35654. }
  35655.  
  35656. private void func_178930_c() {
  35657. this.func_178929_a(EnumParticleTypes.EXPLOSION_NORMAL.func_179348_c(), new ParticleExplosion.Factory());
  35658. this.func_178929_a(EnumParticleTypes.SPIT.func_179348_c(), new ParticleSpit.Factory());
  35659. this.func_178929_a(EnumParticleTypes.WATER_BUBBLE.func_179348_c(), new ParticleBubble.Factory());
  35660. this.func_178929_a(EnumParticleTypes.WATER_SPLASH.func_179348_c(), new ParticleSplash.Factory());
  35661. this.func_178929_a(EnumParticleTypes.WATER_WAKE.func_179348_c(), new ParticleWaterWake.Factory());
  35662. this.func_178929_a(EnumParticleTypes.WATER_DROP.func_179348_c(), new ParticleRain.Factory());
  35663. this.func_178929_a(EnumParticleTypes.SUSPENDED.func_179348_c(), new ParticleSuspend.Factory());
  35664. this.func_178929_a(EnumParticleTypes.SUSPENDED_DEPTH.func_179348_c(), new ParticleSuspendedTown.Factory());
  35665. this.func_178929_a(EnumParticleTypes.CRIT.func_179348_c(), new ParticleCrit.Factory());
  35666. this.func_178929_a(EnumParticleTypes.CRIT_MAGIC.func_179348_c(), new ParticleCrit.MagicFactory());
  35667. this.func_178929_a(EnumParticleTypes.SMOKE_NORMAL.func_179348_c(), new ParticleSmokeNormal.Factory());
  35668. this.func_178929_a(EnumParticleTypes.SMOKE_LARGE.func_179348_c(), new ParticleSmokeLarge.Factory());
  35669. this.func_178929_a(EnumParticleTypes.SPELL.func_179348_c(), new ParticleSpell.Factory());
  35670. this.func_178929_a(EnumParticleTypes.SPELL_INSTANT.func_179348_c(), new ParticleSpell.InstantFactory());
  35671. this.func_178929_a(EnumParticleTypes.SPELL_MOB.func_179348_c(), new ParticleSpell.MobFactory());
  35672. this.func_178929_a(EnumParticleTypes.SPELL_MOB_AMBIENT.func_179348_c(), new ParticleSpell.AmbientMobFactory());
  35673. this.func_178929_a(EnumParticleTypes.SPELL_WITCH.func_179348_c(), new ParticleSpell.WitchFactory());
  35674. this.func_178929_a(EnumParticleTypes.DRIP_WATER.func_179348_c(), new ParticleDrip.WaterFactory());
  35675. this.func_178929_a(EnumParticleTypes.DRIP_LAVA.func_179348_c(), new ParticleDrip.LavaFactory());
  35676. this.func_178929_a(EnumParticleTypes.VILLAGER_ANGRY.func_179348_c(), new ParticleHeart.AngryVillagerFactory());
  35677. this.func_178929_a(EnumParticleTypes.VILLAGER_HAPPY.func_179348_c(), new ParticleSuspendedTown.HappyVillagerFactory());
  35678. this.func_178929_a(EnumParticleTypes.TOWN_AURA.func_179348_c(), new ParticleSuspendedTown.Factory());
  35679. this.func_178929_a(EnumParticleTypes.NOTE.func_179348_c(), new ParticleNote.Factory());
  35680. this.func_178929_a(EnumParticleTypes.PORTAL.func_179348_c(), new ParticlePortal.Factory());
  35681. this.func_178929_a(EnumParticleTypes.ENCHANTMENT_TABLE.func_179348_c(), new ParticleEnchantmentTable.EnchantmentTable());
  35682. this.func_178929_a(EnumParticleTypes.FLAME.func_179348_c(), new ParticleFlame.Factory());
  35683. this.func_178929_a(EnumParticleTypes.LAVA.func_179348_c(), new ParticleLava.Factory());
  35684. this.func_178929_a(EnumParticleTypes.FOOTSTEP.func_179348_c(), new ParticleFootStep.Factory());
  35685. this.func_178929_a(EnumParticleTypes.CLOUD.func_179348_c(), new ParticleCloud.Factory());
  35686. this.func_178929_a(EnumParticleTypes.REDSTONE.func_179348_c(), new ParticleRedstone.Factory());
  35687. this.func_178929_a(EnumParticleTypes.FALLING_DUST.func_179348_c(), new ParticleFallingDust.Factory());
  35688. this.func_178929_a(EnumParticleTypes.SNOWBALL.func_179348_c(), new ParticleBreaking.SnowballFactory());
  35689. this.func_178929_a(EnumParticleTypes.SNOW_SHOVEL.func_179348_c(), new ParticleSnowShovel.Factory());
  35690. this.func_178929_a(EnumParticleTypes.SLIME.func_179348_c(), new ParticleBreaking.SlimeFactory());
  35691. this.func_178929_a(EnumParticleTypes.HEART.func_179348_c(), new ParticleHeart.Factory());
  35692. this.func_178929_a(EnumParticleTypes.BARRIER.func_179348_c(), new Barrier.Factory());
  35693. this.func_178929_a(EnumParticleTypes.ITEM_CRACK.func_179348_c(), new ParticleBreaking.Factory());
  35694. this.func_178929_a(EnumParticleTypes.BLOCK_CRACK.func_179348_c(), new ParticleDigging.Factory());
  35695. this.func_178929_a(EnumParticleTypes.BLOCK_DUST.func_179348_c(), new ParticleBlockDust.Factory());
  35696. this.func_178929_a(EnumParticleTypes.EXPLOSION_HUGE.func_179348_c(), new ParticleExplosionHuge.Factory());
  35697. this.func_178929_a(EnumParticleTypes.EXPLOSION_LARGE.func_179348_c(), new ParticleExplosionLarge.Factory());
  35698. this.func_178929_a(EnumParticleTypes.FIREWORKS_SPARK.func_179348_c(), new ParticleFirework.Factory());
  35699. this.func_178929_a(EnumParticleTypes.MOB_APPEARANCE.func_179348_c(), new ParticleMobAppearance.Factory());
  35700. this.func_178929_a(EnumParticleTypes.DRAGON_BREATH.func_179348_c(), new ParticleDragonBreath.Factory());
  35701. this.func_178929_a(EnumParticleTypes.END_ROD.func_179348_c(), new ParticleEndRod.Factory());
  35702. this.func_178929_a(EnumParticleTypes.DAMAGE_INDICATOR.func_179348_c(), new ParticleCrit.DamageIndicatorFactory());
  35703. this.func_178929_a(EnumParticleTypes.SWEEP_ATTACK.func_179348_c(), new ParticleSweepAttack.Factory());
  35704. this.func_178929_a(EnumParticleTypes.TOTEM.func_179348_c(), new ParticleTotem.Factory());
  35705. }
  35706.  
  35707. public void func_178929_a(int p_178929_1_, IParticleFactory p_178929_2_) {
  35708. this.field_178932_g.put(Integer.valueOf(p_178929_1_), p_178929_2_);
  35709. }
  35710.  
  35711. public void func_178926_a(Entity p_178926_1_, EnumParticleTypes p_178926_2_) {
  35712. this.field_178933_d.add(new ParticleEmitter(this.field_78878_a, p_178926_1_, p_178926_2_));
  35713. }
  35714.  
  35715. public void func_191271_a(Entity p_191271_1_, EnumParticleTypes p_191271_2_, int p_191271_3_) {
  35716. this.field_178933_d.add(new ParticleEmitter(this.field_78878_a, p_191271_1_, p_191271_2_, p_191271_3_));
  35717. }
  35718.  
  35719. @Nullable
  35720. public Particle func_178927_a(int p_178927_1_, double p_178927_2_, double p_178927_4_, double p_178927_6_, double p_178927_8_, double p_178927_10_, double p_178927_12_, int... p_178927_14_) {
  35721. IParticleFactory iparticlefactory = (IParticleFactory)this.field_178932_g.get(Integer.valueOf(p_178927_1_));
  35722. if(iparticlefactory != null) {
  35723. Particle particle = iparticlefactory.func_178902_a(p_178927_1_, this.field_78878_a, p_178927_2_, p_178927_4_, p_178927_6_, p_178927_8_, p_178927_10_, p_178927_12_, p_178927_14_);
  35724. if(particle != null) {
  35725. this.func_78873_a(particle);
  35726. return particle;
  35727. }
  35728. }
  35729.  
  35730. return null;
  35731. }
  35732.  
  35733. public void func_78873_a(Particle p_78873_1_) {
  35734. this.field_187241_h.add(p_78873_1_);
  35735. }
  35736.  
  35737. public void func_78868_a() {
  35738. for(int i = 0; i < 4; ++i) {
  35739. this.func_178922_a(i);
  35740. }
  35741.  
  35742. if(!this.field_178933_d.isEmpty()) {
  35743. List<ParticleEmitter> list = Lists.<ParticleEmitter>newArrayList();
  35744.  
  35745. for(ParticleEmitter particleemitter : this.field_178933_d) {
  35746. particleemitter.func_189213_a();
  35747. if(!particleemitter.func_187113_k()) {
  35748. list.add(particleemitter);
  35749. }
  35750. }
  35751.  
  35752. this.field_178933_d.removeAll(list);
  35753. }
  35754.  
  35755. if(!this.field_187241_h.isEmpty()) {
  35756. for(Particle particle = (Particle)this.field_187241_h.poll(); particle != null; particle = (Particle)this.field_187241_h.poll()) {
  35757. int j = particle.func_70537_b();
  35758. int k = particle.func_187111_c()?0:1;
  35759. if(this.field_78876_b[j][k].size() >= 16384) {
  35760. this.field_78876_b[j][k].removeFirst();
  35761. }
  35762.  
  35763. this.field_78876_b[j][k].add(particle);
  35764. }
  35765. }
  35766.  
  35767. }
  35768.  
  35769. private void func_178922_a(int p_178922_1_) {
  35770. this.field_78878_a.field_72984_F.func_76320_a(p_178922_1_ + "");
  35771.  
  35772. for(int i = 0; i < 2; ++i) {
  35773. this.field_78878_a.field_72984_F.func_76320_a(i + "");
  35774. this.func_187240_a(this.field_78876_b[p_178922_1_][i]);
  35775. this.field_78878_a.field_72984_F.func_76319_b();
  35776. }
  35777.  
  35778. this.field_78878_a.field_72984_F.func_76319_b();
  35779. }
  35780.  
  35781. private void func_187240_a(Queue<Particle> p_187240_1_) {
  35782. if(!p_187240_1_.isEmpty()) {
  35783. Iterator<Particle> iterator = p_187240_1_.iterator();
  35784.  
  35785. while(iterator.hasNext()) {
  35786. Particle particle = (Particle)iterator.next();
  35787. this.func_178923_d(particle);
  35788. if(!particle.func_187113_k()) {
  35789. iterator.remove();
  35790. }
  35791. }
  35792. }
  35793.  
  35794. }
  35795.  
  35796. private void func_178923_d(final Particle p_178923_1_) {
  35797. try {
  35798. p_178923_1_.func_189213_a();
  35799. } catch (Throwable throwable) {
  35800. CrashReport crashreport = CrashReport.func_85055_a(throwable, "Ticking Particle");
  35801. CrashReportCategory crashreportcategory = crashreport.func_85058_a("Particle being ticked");
  35802. final int i = p_178923_1_.func_70537_b();
  35803. crashreportcategory.func_189529_a("Particle", new ICrashReportDetail<String>() {
  35804. public String call() throws Exception {
  35805. return p_178923_1_.toString();
  35806. }
  35807. });
  35808. crashreportcategory.func_189529_a("Particle Type", new ICrashReportDetail<String>() {
  35809. public String call() throws Exception {
  35810. return i == 0?"MISC_TEXTURE":(i == 1?"TERRAIN_TEXTURE":(i == 3?"ENTITY_PARTICLE_TEXTURE":"Unknown - " + i));
  35811. }
  35812. });
  35813. throw new ReportedException(crashreport);
  35814. }
  35815. }
  35816.  
  35817. public void func_78874_a(Entity p_78874_1_, float p_78874_2_) {
  35818. float f = ActiveRenderInfo.func_178808_b();
  35819. float f1 = ActiveRenderInfo.func_178803_d();
  35820. float f2 = ActiveRenderInfo.func_178805_e();
  35821. float f3 = ActiveRenderInfo.func_178807_f();
  35822. float f4 = ActiveRenderInfo.func_178809_c();
  35823. Particle.field_70556_an = p_78874_1_.field_70142_S + (p_78874_1_.field_70165_t - p_78874_1_.field_70142_S) * (double)p_78874_2_;
  35824. Particle.field_70554_ao = p_78874_1_.field_70137_T + (p_78874_1_.field_70163_u - p_78874_1_.field_70137_T) * (double)p_78874_2_;
  35825. Particle.field_70555_ap = p_78874_1_.field_70136_U + (p_78874_1_.field_70161_v - p_78874_1_.field_70136_U) * (double)p_78874_2_;
  35826. Particle.field_190016_K = p_78874_1_.func_70676_i(p_78874_2_);
  35827. GlStateManager.func_179147_l();
  35828. GlStateManager.func_187401_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
  35829. GlStateManager.func_179092_a(516, 0.003921569F);
  35830.  
  35831. for(final int i = 0; i < 3; ++i) {
  35832. for(int j = 0; j < 2; ++j) {
  35833. if(!this.field_78876_b[i][j].isEmpty()) {
  35834. switch(j) {
  35835. case 0:
  35836. GlStateManager.func_179132_a(false);
  35837. break;
  35838. case 1:
  35839. GlStateManager.func_179132_a(true);
  35840. }
  35841.  
  35842. switch(i) {
  35843. case 0:
  35844. default:
  35845. this.field_78877_c.func_110577_a(field_110737_b);
  35846. break;
  35847. case 1:
  35848. this.field_78877_c.func_110577_a(TextureMap.field_110575_b);
  35849. }
  35850.  
  35851. GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
  35852. Tessellator tessellator = Tessellator.func_178181_a();
  35853. BufferBuilder bufferbuilder = tessellator.func_178180_c();
  35854. bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181704_d);
  35855.  
  35856. for(final Particle particle : this.field_78876_b[i][j]) {
  35857. try {
  35858. particle.func_180434_a(bufferbuilder, p_78874_1_, p_78874_2_, f, f4, f1, f2, f3);
  35859. } catch (Throwable throwable) {
  35860. CrashReport crashreport = CrashReport.func_85055_a(throwable, "Rendering Particle");
  35861. CrashReportCategory crashreportcategory = crashreport.func_85058_a("Particle being rendered");
  35862. crashreportcategory.func_189529_a("Particle", new ICrashReportDetail<String>() {
  35863. public String call() throws Exception {
  35864. return particle.toString();
  35865. }
  35866. });
  35867. crashreportcategory.func_189529_a("Particle Type", new ICrashReportDetail<String>() {
  35868. public String call() throws Exception {
  35869. return i == 0?"MISC_TEXTURE":(i == 1?"TERRAIN_TEXTURE":(i == 3?"ENTITY_PARTICLE_TEXTURE":"Unknown - " + i));
  35870. }
  35871. });
  35872. throw new ReportedException(crashreport);
  35873. }
  35874. }
  35875.  
  35876. tessellator.func_78381_a();
  35877. }
  35878. }
  35879. }
  35880.  
  35881. GlStateManager.func_179132_a(true);
  35882. GlStateManager.func_179084_k();
  35883. GlStateManager.func_179092_a(516, 0.1F);
  35884. }
  35885.  
  35886. public void func_78872_b(Entity p_78872_1_, float p_78872_2_) {
  35887. float f = 0.017453292F;
  35888. float f1 = MathHelper.func_76134_b(p_78872_1_.field_70177_z * 0.017453292F);
  35889. float f2 = MathHelper.func_76126_a(p_78872_1_.field_70177_z * 0.017453292F);
  35890. float f3 = -f2 * MathHelper.func_76126_a(p_78872_1_.field_70125_A * 0.017453292F);
  35891. float f4 = f1 * MathHelper.func_76126_a(p_78872_1_.field_70125_A * 0.017453292F);
  35892. float f5 = MathHelper.func_76134_b(p_78872_1_.field_70125_A * 0.017453292F);
  35893.  
  35894. for(int i = 0; i < 2; ++i) {
  35895. Queue<Particle> queue = this.field_78876_b[3][i];
  35896. if(!queue.isEmpty()) {
  35897. Tessellator tessellator = Tessellator.func_178181_a();
  35898. BufferBuilder bufferbuilder = tessellator.func_178180_c();
  35899.  
  35900. for(Particle particle : queue) {
  35901. particle.func_180434_a(bufferbuilder, p_78872_1_, p_78872_2_, f1, f5, f2, f3, f4);
  35902. }
  35903. }
  35904. }
  35905.  
  35906. }
  35907.  
  35908. public void func_78870_a(@Nullable World p_78870_1_) {
  35909. this.field_78878_a = p_78870_1_;
  35910.  
  35911. for(int i = 0; i < 4; ++i) {
  35912. for(int j = 0; j < 2; ++j) {
  35913. this.field_78876_b[i][j].clear();
  35914. }
  35915. }
  35916.  
  35917. this.field_178933_d.clear();
  35918. }
  35919.  
  35920. public void func_180533_a(BlockPos p_180533_1_, IBlockState p_180533_2_) {
  35921. if(p_180533_2_.func_185904_a() != Material.field_151579_a) {
  35922. p_180533_2_ = p_180533_2_.func_185899_b(this.field_78878_a, p_180533_1_);
  35923. int i = 4;
  35924.  
  35925. for(int j = 0; j < 4; ++j) {
  35926. for(int k = 0; k < 4; ++k) {
  35927. for(int l = 0; l < 4; ++l) {
  35928. double d0 = ((double)j + 0.5D) / 4.0D;
  35929. double d1 = ((double)k + 0.5D) / 4.0D;
  35930. double d2 = ((double)l + 0.5D) / 4.0D;
  35931. this.func_78873_a((new ParticleDigging(this.field_78878_a, (double)p_180533_1_.func_177958_n() + d0, (double)p_180533_1_.func_177956_o() + d1, (double)p_180533_1_.func_177952_p() + d2, d0 - 0.5D, d1 - 0.5D, d2 - 0.5D, p_180533_2_)).func_174846_a(p_180533_1_));
  35932. }
  35933. }
  35934. }
  35935.  
  35936. }
  35937. }
  35938.  
  35939. public void func_180532_a(BlockPos p_180532_1_, EnumFacing p_180532_2_) {
  35940. IBlockState iblockstate = this.field_78878_a.func_180495_p(p_180532_1_);
  35941. if(iblockstate.func_185901_i() != EnumBlockRenderType.INVISIBLE) {
  35942. int i = p_180532_1_.func_177958_n();
  35943. int j = p_180532_1_.func_177956_o();
  35944. int k = p_180532_1_.func_177952_p();
  35945. float f = 0.1F;
  35946. AxisAlignedBB axisalignedbb = iblockstate.func_185900_c(this.field_78878_a, p_180532_1_);
  35947. double d0 = (double)i + this.field_78875_d.nextDouble() * (axisalignedbb.field_72336_d - axisalignedbb.field_72340_a - 0.20000000298023224D) + 0.10000000149011612D + axisalignedbb.field_72340_a;
  35948. double d1 = (double)j + this.field_78875_d.nextDouble() * (axisalignedbb.field_72337_e - axisalignedbb.field_72338_b - 0.20000000298023224D) + 0.10000000149011612D + axisalignedbb.field_72338_b;
  35949. double d2 = (double)k + this.field_78875_d.nextDouble() * (axisalignedbb.field_72334_f - axisalignedbb.field_72339_c - 0.20000000298023224D) + 0.10000000149011612D + axisalignedbb.field_72339_c;
  35950. if(p_180532_2_ == EnumFacing.DOWN) {
  35951. d1 = (double)j + axisalignedbb.field_72338_b - 0.10000000149011612D;
  35952. }
  35953.  
  35954. if(p_180532_2_ == EnumFacing.UP) {
  35955. d1 = (double)j + axisalignedbb.field_72337_e + 0.10000000149011612D;
  35956. }
  35957.  
  35958. if(p_180532_2_ == EnumFacing.NORTH) {
  35959. d2 = (double)k + axisalignedbb.field_72339_c - 0.10000000149011612D;
  35960. }
  35961.  
  35962. if(p_180532_2_ == EnumFacing.SOUTH) {
  35963. d2 = (double)k + axisalignedbb.field_72334_f + 0.10000000149011612D;
  35964. }
  35965.  
  35966. if(p_180532_2_ == EnumFacing.WEST) {
  35967. d0 = (double)i + axisalignedbb.field_72340_a - 0.10000000149011612D;
  35968. }
  35969.  
  35970. if(p_180532_2_ == EnumFacing.EAST) {
  35971. d0 = (double)i + axisalignedbb.field_72336_d + 0.10000000149011612D;
  35972. }
  35973.  
  35974. this.func_78873_a((new ParticleDigging(this.field_78878_a, d0, d1, d2, 0.0D, 0.0D, 0.0D, iblockstate)).func_174846_a(p_180532_1_).func_70543_e(0.2F).func_70541_f(0.6F));
  35975. }
  35976. }
  35977.  
  35978. public String func_78869_b() {
  35979. int i = 0;
  35980.  
  35981. for(int j = 0; j < 4; ++j) {
  35982. for(int k = 0; k < 2; ++k) {
  35983. i += this.field_78876_b[j][k].size();
  35984. }
  35985. }
  35986.  
  35987. return "" + i;
  35988. }
  35989. }
  35990.  
  35991. Patching failed: minecraft\net\minecraft\client\renderer\EntityRenderer.java
  35992. Hunk 1 failed! Cannot find hunk target
  35993. flag = true;
  35994. }
  35995.  
  35996. - d0 = d0;
  35997. +// d0 = d0;
  35998. }
  35999.  
  36000. if (this.field_78531_r.field_71476_x != null) {
  36001. File state
  36002. package net.minecraft.client.renderer;
  36003.  
  36004. import com.google.common.base.Predicate;
  36005. import com.google.common.base.Predicates;
  36006. import com.google.gson.JsonSyntaxException;
  36007. import java.awt.Graphics;
  36008. import java.awt.image.BufferedImage;
  36009. import java.awt.image.ImageObserver;
  36010. import java.io.File;
  36011. import java.io.IOException;
  36012. import java.nio.FloatBuffer;
  36013. import java.util.List;
  36014. import java.util.Random;
  36015. import javax.annotation.Nullable;
  36016. import javax.imageio.ImageIO;
  36017. import net.minecraft.block.Block;
  36018. import net.minecraft.block.BlockBed;
  36019. import net.minecraft.block.material.Material;
  36020. import net.minecraft.block.state.IBlockState;
  36021. import net.minecraft.client.Minecraft;
  36022. import net.minecraft.client.entity.AbstractClientPlayer;
  36023. import net.minecraft.client.gui.FontRenderer;
  36024. import net.minecraft.client.gui.MapItemRenderer;
  36025. import net.minecraft.client.gui.ScaledResolution;
  36026. import net.minecraft.client.particle.ParticleManager;
  36027. import net.minecraft.client.renderer.ActiveRenderInfo;
  36028. import net.minecraft.client.renderer.BufferBuilder;
  36029. import net.minecraft.client.renderer.GLAllocation;
  36030. import net.minecraft.client.renderer.GlStateManager;
  36031. import net.minecraft.client.renderer.ItemRenderer;
  36032. import net.minecraft.client.renderer.OpenGlHelper;
  36033. import net.minecraft.client.renderer.RenderGlobal;
  36034. import net.minecraft.client.renderer.RenderHelper;
  36035. import net.minecraft.client.renderer.Tessellator;
  36036. import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
  36037. import net.minecraft.client.renderer.culling.ClippingHelperImpl;
  36038. import net.minecraft.client.renderer.culling.Frustum;
  36039. import net.minecraft.client.renderer.culling.ICamera;
  36040. import net.minecraft.client.renderer.texture.DynamicTexture;
  36041. import net.minecraft.client.renderer.texture.TextureMap;
  36042. import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
  36043. import net.minecraft.client.resources.IResourceManager;
  36044. import net.minecraft.client.resources.IResourceManagerReloadListener;
  36045. import net.minecraft.client.shader.ShaderGroup;
  36046. import net.minecraft.client.shader.ShaderLinkHelper;
  36047. import net.minecraft.crash.CrashReport;
  36048. import net.minecraft.crash.CrashReportCategory;
  36049. import net.minecraft.crash.ICrashReportDetail;
  36050. import net.minecraft.enchantment.EnchantmentHelper;
  36051. import net.minecraft.entity.Entity;
  36052. import net.minecraft.entity.EntityLivingBase;
  36053. import net.minecraft.entity.item.EntityItemFrame;
  36054. import net.minecraft.entity.monster.EntityCreeper;
  36055. import net.minecraft.entity.monster.EntityEnderman;
  36056. import net.minecraft.entity.monster.EntitySpider;
  36057. import net.minecraft.entity.passive.EntityAnimal;
  36058. import net.minecraft.entity.player.EntityPlayer;
  36059. import net.minecraft.init.Blocks;
  36060. import net.minecraft.init.MobEffects;
  36061. import net.minecraft.init.SoundEvents;
  36062. import net.minecraft.inventory.IInventory;
  36063. import net.minecraft.item.ItemStack;
  36064. import net.minecraft.util.BlockRenderLayer;
  36065. import net.minecraft.util.EntitySelectors;
  36066. import net.minecraft.util.EnumFacing;
  36067. import net.minecraft.util.EnumParticleTypes;
  36068. import net.minecraft.util.MouseFilter;
  36069. import net.minecraft.util.ReportedException;
  36070. import net.minecraft.util.ResourceLocation;
  36071. import net.minecraft.util.ScreenShotHelper;
  36072. import net.minecraft.util.SoundCategory;
  36073. import net.minecraft.util.math.AxisAlignedBB;
  36074. import net.minecraft.util.math.BlockPos;
  36075. import net.minecraft.util.math.MathHelper;
  36076. import net.minecraft.util.math.RayTraceResult;
  36077. import net.minecraft.util.math.Vec3d;
  36078. import net.minecraft.world.GameType;
  36079. import net.minecraft.world.World;
  36080. import net.minecraft.world.biome.Biome;
  36081. import net.minecraftforge.fml.relauncher.Side;
  36082. import net.minecraftforge.fml.relauncher.SideOnly;
  36083. import org.apache.logging.log4j.LogManager;
  36084. import org.apache.logging.log4j.Logger;
  36085. import org.lwjgl.input.Mouse;
  36086. import org.lwjgl.opengl.Display;
  36087. import org.lwjgl.opengl.GLContext;
  36088. import org.lwjgl.util.glu.Project;
  36089.  
  36090. @SideOnly(Side.CLIENT)
  36091. public class EntityRenderer implements IResourceManagerReloadListener {
  36092. private static final Logger field_147710_q = LogManager.getLogger();
  36093. private static final ResourceLocation field_110924_q = new ResourceLocation("textures/environment/rain.png");
  36094. private static final ResourceLocation field_110923_r = new ResourceLocation("textures/environment/snow.png");
  36095. public static boolean field_78517_a;
  36096. public static int field_78515_b;
  36097. private final Minecraft field_78531_r;
  36098. private final IResourceManager field_147711_ac;
  36099. private final Random field_78537_ab = new Random();
  36100. private float field_78530_s;
  36101. public final ItemRenderer field_78516_c;
  36102. private final MapItemRenderer field_147709_v;
  36103. private int field_78529_t;
  36104. private Entity field_78528_u;
  36105. private final MouseFilter field_78527_v = new MouseFilter();
  36106. private final MouseFilter field_78526_w = new MouseFilter();
  36107. private final float field_78490_B = 4.0F;
  36108. private float field_78491_C = 4.0F;
  36109. private float field_78496_H;
  36110. private float field_78497_I;
  36111. private float field_78498_J;
  36112. private float field_78499_K;
  36113. private float field_78492_L;
  36114. private float field_78507_R;
  36115. private float field_78506_S;
  36116. private float field_82831_U;
  36117. private float field_82832_V;
  36118. private boolean field_78500_U;
  36119. private boolean field_175074_C = true;
  36120. private boolean field_175073_D = true;
  36121. private long field_184374_E;
  36122. private long field_78508_Y = Minecraft.func_71386_F();
  36123. private long field_78510_Z;
  36124. private final DynamicTexture field_78513_d;
  36125. private final int[] field_78504_Q;
  36126. private final ResourceLocation field_110922_T;
  36127. private boolean field_78536_aa;
  36128. private float field_78514_e;
  36129. private float field_175075_L;
  36130. private int field_78534_ac;
  36131. private final float[] field_175076_N = new float[1024];
  36132. private final float[] field_175077_O = new float[1024];
  36133. private final FloatBuffer field_78521_m = GLAllocation.func_74529_h(16);
  36134. private float field_175080_Q;
  36135. private float field_175082_R;
  36136. private float field_175081_S;
  36137. private float field_78535_ad;
  36138. private float field_78539_ae;
  36139. private int field_175079_V;
  36140. private boolean field_175078_W;
  36141. private double field_78503_V = 1.0D;
  36142. private double field_78502_W;
  36143. private double field_78509_X;
  36144. private ItemStack field_190566_ab;
  36145. private int field_190567_ac;
  36146. private float field_190568_ad;
  36147. private float field_190569_ae;
  36148. private ShaderGroup field_147707_d;
  36149. private static final ResourceLocation[] field_147712_ad = new ResourceLocation[]{new ResourceLocation("shaders/post/notch.json"), new ResourceLocation("shaders/post/fxaa.json"), new ResourceLocation("shaders/post/art.json"), new ResourceLocation("shaders/post/bumpy.json"), new ResourceLocation("shaders/post/blobs2.json"), new ResourceLocation("shaders/post/pencil.json"), new ResourceLocation("shaders/post/color_convolve.json"), new ResourceLocation("shaders/post/deconverge.json"), new ResourceLocation("shaders/post/flip.json"), new ResourceLocation("shaders/post/invert.json"), new ResourceLocation("shaders/post/ntsc.json"), new ResourceLocation("shaders/post/outline.json"), new ResourceLocation("shaders/post/phosphor.json"), new ResourceLocation("shaders/post/scan_pincushion.json"), new ResourceLocation("shaders/post/sobel.json"), new ResourceLocation("shaders/post/bits.json"), new ResourceLocation("shaders/post/desaturate.json"), new ResourceLocation("shaders/post/green.json"), new ResourceLocation("shaders/post/blur.json"), new ResourceLocation("shaders/post/wobble.json"), new ResourceLocation("shaders/post/blobs.json"), new ResourceLocation("shaders/post/antialias.json"), new ResourceLocation("shaders/post/creeper.json"), new ResourceLocation("shaders/post/spider.json")};
  36150. public static final int field_147708_e = field_147712_ad.length;
  36151. private int field_147713_ae;
  36152. private boolean field_175083_ad;
  36153. private int field_175084_ae;
  36154.  
  36155. public EntityRenderer(Minecraft p_i45076_1_, IResourceManager p_i45076_2_) {
  36156. this.field_147713_ae = field_147708_e;
  36157. this.field_78531_r = p_i45076_1_;
  36158. this.field_147711_ac = p_i45076_2_;
  36159. this.field_78516_c = p_i45076_1_.func_175597_ag();
  36160. this.field_147709_v = new MapItemRenderer(p_i45076_1_.func_110434_K());
  36161. this.field_78513_d = new DynamicTexture(16, 16);
  36162. this.field_110922_T = p_i45076_1_.func_110434_K().func_110578_a("lightMap", this.field_78513_d);
  36163. this.field_78504_Q = this.field_78513_d.func_110565_c();
  36164. this.field_147707_d = null;
  36165.  
  36166. for(int i = 0; i < 32; ++i) {
  36167. for(int j = 0; j < 32; ++j) {
  36168. float f = (float)(j - 16);
  36169. float f1 = (float)(i - 16);
  36170. float f2 = MathHelper.func_76129_c(f * f + f1 * f1);
  36171. this.field_175076_N[i << 5 | j] = -f1 / f2;
  36172. this.field_175077_O[i << 5 | j] = f / f2;
  36173. }
  36174. }
  36175.  
  36176. }
  36177.  
  36178. public boolean func_147702_a() {
  36179. return OpenGlHelper.field_148824_g && this.field_147707_d != null;
  36180. }
  36181.  
  36182. public void func_181022_b() {
  36183. if(this.field_147707_d != null) {
  36184. this.field_147707_d.func_148021_a();
  36185. }
  36186.  
  36187. this.field_147707_d = null;
  36188. this.field_147713_ae = field_147708_e;
  36189. }
  36190.  
  36191. public void func_175071_c() {
  36192. this.field_175083_ad = !this.field_175083_ad;
  36193. }
  36194.  
  36195. public void func_175066_a(@Nullable Entity p_175066_1_) {
  36196. if(OpenGlHelper.field_148824_g) {
  36197. if(this.field_147707_d != null) {
  36198. this.field_147707_d.func_148021_a();
  36199. }
  36200.  
  36201. this.field_147707_d = null;
  36202. if(p_175066_1_ instanceof EntityCreeper) {
  36203. this.func_175069_a(new ResourceLocation("shaders/post/creeper.json"));
  36204. } else if(p_175066_1_ instanceof EntitySpider) {
  36205. this.func_175069_a(new ResourceLocation("shaders/post/spider.json"));
  36206. } else if(p_175066_1_ instanceof EntityEnderman) {
  36207. this.func_175069_a(new ResourceLocation("shaders/post/invert.json"));
  36208. }
  36209.  
  36210. }
  36211. }
  36212.  
  36213. public void func_175069_a(ResourceLocation p_175069_1_) {
  36214. try {
  36215. this.field_147707_d = new ShaderGroup(this.field_78531_r.func_110434_K(), this.field_147711_ac, this.field_78531_r.func_147110_a(), p_175069_1_);
  36216. this.field_147707_d.func_148026_a(this.field_78531_r.field_71443_c, this.field_78531_r.field_71440_d);
  36217. this.field_175083_ad = true;
  36218. } catch (IOException ioexception) {
  36219. field_147710_q.warn((String)"Failed to load shader: {}", (Object)p_175069_1_, (Object)ioexception);
  36220. this.field_147713_ae = field_147708_e;
  36221. this.field_175083_ad = false;
  36222. } catch (JsonSyntaxException jsonsyntaxexception) {
  36223. field_147710_q.warn((String)"Failed to load shader: {}", (Object)p_175069_1_, (Object)jsonsyntaxexception);
  36224. this.field_147713_ae = field_147708_e;
  36225. this.field_175083_ad = false;
  36226. }
  36227.  
  36228. }
  36229.  
  36230. public void func_110549_a(IResourceManager p_110549_1_) {
  36231. if(this.field_147707_d != null) {
  36232. this.field_147707_d.func_148021_a();
  36233. }
  36234.  
  36235. this.field_147707_d = null;
  36236. if(this.field_147713_ae == field_147708_e) {
  36237. this.func_175066_a(this.field_78531_r.func_175606_aa());
  36238. } else {
  36239. this.func_175069_a(field_147712_ad[this.field_147713_ae]);
  36240. }
  36241.  
  36242. }
  36243.  
  36244. public void func_78464_a() {
  36245. if(OpenGlHelper.field_148824_g && ShaderLinkHelper.func_148074_b() == null) {
  36246. ShaderLinkHelper.func_148076_a();
  36247. }
  36248.  
  36249. this.func_78477_e();
  36250. this.func_78470_f();
  36251. this.field_78535_ad = this.field_78539_ae;
  36252. this.field_78491_C = 4.0F;
  36253. if(this.field_78531_r.field_71474_y.field_74326_T) {
  36254. float f = this.field_78531_r.field_71474_y.field_74341_c * 0.6F + 0.2F;
  36255. float f1 = f * f * f * 8.0F;
  36256. this.field_78498_J = this.field_78527_v.func_76333_a(this.field_78496_H, 0.05F * f1);
  36257. this.field_78499_K = this.field_78526_w.func_76333_a(this.field_78497_I, 0.05F * f1);
  36258. this.field_78492_L = 0.0F;
  36259. this.field_78496_H = 0.0F;
  36260. this.field_78497_I = 0.0F;
  36261. } else {
  36262. this.field_78498_J = 0.0F;
  36263. this.field_78499_K = 0.0F;
  36264. this.field_78527_v.func_180179_a();
  36265. this.field_78526_w.func_180179_a();
  36266. }
  36267.  
  36268. if(this.field_78531_r.func_175606_aa() == null) {
  36269. this.field_78531_r.func_175607_a(this.field_78531_r.field_71439_g);
  36270. }
  36271.  
  36272. float f3 = this.field_78531_r.field_71441_e.func_175724_o(new BlockPos(this.field_78531_r.func_175606_aa()));
  36273. float f4 = (float)this.field_78531_r.field_71474_y.field_151451_c / 32.0F;
  36274. float f2 = f3 * (1.0F - f4) + f4;
  36275. this.field_78539_ae += (f2 - this.field_78539_ae) * 0.1F;
  36276. ++this.field_78529_t;
  36277. this.field_78516_c.func_78441_a();
  36278. this.func_78484_h();
  36279. this.field_82832_V = this.field_82831_U;
  36280. if(this.field_78531_r.field_71456_v.func_184046_j().func_184053_e()) {
  36281. this.field_82831_U += 0.05F;
  36282. if(this.field_82831_U > 1.0F) {
  36283. this.field_82831_U = 1.0F;
  36284. }
  36285. } else if(this.field_82831_U > 0.0F) {
  36286. this.field_82831_U -= 0.0125F;
  36287. }
  36288.  
  36289. if(this.field_190567_ac > 0) {
  36290. --this.field_190567_ac;
  36291. if(this.field_190567_ac == 0) {
  36292. this.field_190566_ab = null;
  36293. }
  36294. }
  36295.  
  36296. }
  36297.  
  36298. public ShaderGroup func_147706_e() {
  36299. return this.field_147707_d;
  36300. }
  36301.  
  36302. public void func_147704_a(int p_147704_1_, int p_147704_2_) {
  36303. if(OpenGlHelper.field_148824_g) {
  36304. if(this.field_147707_d != null) {
  36305. this.field_147707_d.func_148026_a(p_147704_1_, p_147704_2_);
  36306. }
  36307.  
  36308. this.field_78531_r.field_71438_f.func_72720_a(p_147704_1_, p_147704_2_);
  36309. }
  36310. }
  36311.  
  36312. public void func_78473_a(float p_78473_1_) {
  36313. Entity entity = this.field_78531_r.func_175606_aa();
  36314. if(entity != null) {
  36315. if(this.field_78531_r.field_71441_e != null) {
  36316. this.field_78531_r.field_71424_I.func_76320_a("pick");
  36317. this.field_78531_r.field_147125_j = null;
  36318. double d0 = (double)this.field_78531_r.field_71442_b.func_78757_d();
  36319. this.field_78531_r.field_71476_x = entity.func_174822_a(d0, p_78473_1_);
  36320. Vec3d vec3d = entity.func_174824_e(p_78473_1_);
  36321. boolean flag = false;
  36322. int i = 3;
  36323. double d1 = d0;
  36324. if(this.field_78531_r.field_71442_b.func_78749_i()) {
  36325. d1 = 6.0D;
  36326. d0 = d1;
  36327. } else {
  36328. if(d0 > 3.0D) {
  36329. flag = true;
  36330. }
  36331.  
  36332. d0 = d0;
  36333. }
  36334.  
  36335. if(this.field_78531_r.field_71476_x != null) {
  36336. d1 = this.field_78531_r.field_71476_x.field_72307_f.func_72438_d(vec3d);
  36337. }
  36338.  
  36339. Vec3d vec3d1 = entity.func_70676_i(1.0F);
  36340. Vec3d vec3d2 = vec3d.func_72441_c(vec3d1.field_72450_a * d0, vec3d1.field_72448_b * d0, vec3d1.field_72449_c * d0);
  36341. this.field_78528_u = null;
  36342. Vec3d vec3d3 = null;
  36343. float f = 1.0F;
  36344. List<Entity> list = this.field_78531_r.field_71441_e.func_175674_a(entity, entity.func_174813_aQ().func_72321_a(vec3d1.field_72450_a * d0, vec3d1.field_72448_b * d0, vec3d1.field_72449_c * d0).func_72314_b(1.0D, 1.0D, 1.0D), Predicates.and(EntitySelectors.field_180132_d, new Predicate<Entity>() {
  36345. public boolean apply(@Nullable Entity p_apply_1_) {
  36346. return p_apply_1_ != null && p_apply_1_.func_70067_L();
  36347. }
  36348. }));
  36349. double d2 = d1;
  36350.  
  36351. for(int j = 0; j < list.size(); ++j) {
  36352. Entity entity1 = (Entity)list.get(j);
  36353. AxisAlignedBB axisalignedbb = entity1.func_174813_aQ().func_186662_g((double)entity1.func_70111_Y());
  36354. RayTraceResult raytraceresult = axisalignedbb.func_72327_a(vec3d, vec3d2);
  36355. if(axisalignedbb.func_72318_a(vec3d)) {
  36356. if(d2 >= 0.0D) {
  36357. this.field_78528_u = entity1;
  36358. vec3d3 = raytraceresult == null?vec3d:raytraceresult.field_72307_f;
  36359. d2 = 0.0D;
  36360. }
  36361. } else if(raytraceresult != null) {
  36362. double d3 = vec3d.func_72438_d(raytraceresult.field_72307_f);
  36363. if(d3 < d2 || d2 == 0.0D) {
  36364. if(entity1.func_184208_bv() == entity.func_184208_bv()) {
  36365. if(d2 == 0.0D) {
  36366. this.field_78528_u = entity1;
  36367. vec3d3 = raytraceresult.field_72307_f;
  36368. }
  36369. } else {
  36370. this.field_78528_u = entity1;
  36371. vec3d3 = raytraceresult.field_72307_f;
  36372. d2 = d3;
  36373. }
  36374. }
  36375. }
  36376. }
  36377.  
  36378. if(this.field_78528_u != null && flag && vec3d.func_72438_d(vec3d3) > 3.0D) {
  36379. this.field_78528_u = null;
  36380. this.field_78531_r.field_71476_x = new RayTraceResult(RayTraceResult.Type.MISS, vec3d3, (EnumFacing)null, new BlockPos(vec3d3));
  36381. }
  36382.  
  36383. if(this.field_78528_u != null && (d2 < d1 || this.field_78531_r.field_71476_x == null)) {
  36384. this.field_78531_r.field_71476_x = new RayTraceResult(this.field_78528_u, vec3d3);
  36385. if(this.field_78528_u instanceof EntityLivingBase || this.field_78528_u instanceof EntityItemFrame) {
  36386. this.field_78531_r.field_147125_j = this.field_78528_u;
  36387. }
  36388. }
  36389.  
  36390. this.field_78531_r.field_71424_I.func_76319_b();
  36391. }
  36392. }
  36393. }
  36394.  
  36395. private void func_78477_e() {
  36396. float f = 1.0F;
  36397. if(this.field_78531_r.func_175606_aa() instanceof AbstractClientPlayer) {
  36398. AbstractClientPlayer abstractclientplayer = (AbstractClientPlayer)this.field_78531_r.func_175606_aa();
  36399. f = abstractclientplayer.func_175156_o();
  36400. }
  36401.  
  36402. this.field_78506_S = this.field_78507_R;
  36403. this.field_78507_R += (f - this.field_78507_R) * 0.5F;
  36404. if(this.field_78507_R > 1.5F) {
  36405. this.field_78507_R = 1.5F;
  36406. }
  36407.  
  36408. if(this.field_78507_R < 0.1F) {
  36409. this.field_78507_R = 0.1F;
  36410. }
  36411.  
  36412. }
  36413.  
  36414. private float func_78481_a(float p_78481_1_, boolean p_78481_2_) {
  36415. if(this.field_175078_W) {
  36416. return 90.0F;
  36417. } else {
  36418. Entity entity = this.field_78531_r.func_175606_aa();
  36419. float f = 70.0F;
  36420. if(p_78481_2_) {
  36421. f = this.field_78531_r.field_71474_y.field_74334_X;
  36422. f = f * (this.field_78506_S + (this.field_78507_R - this.field_78506_S) * p_78481_1_);
  36423. }
  36424.  
  36425. if(entity instanceof EntityLivingBase && ((EntityLivingBase)entity).func_110143_aJ() <= 0.0F) {
  36426. float f1 = (float)((EntityLivingBase)entity).field_70725_aQ + p_78481_1_;
  36427. f /= (1.0F - 500.0F / (f1 + 500.0F)) * 2.0F + 1.0F;
  36428. }
  36429.  
  36430. IBlockState iblockstate = ActiveRenderInfo.func_186703_a(this.field_78531_r.field_71441_e, entity, p_78481_1_);
  36431. if(iblockstate.func_185904_a() == Material.field_151586_h) {
  36432. f = f * 60.0F / 70.0F;
  36433. }
  36434.  
  36435. return f;
  36436. }
  36437. }
  36438.  
  36439. private void func_78482_e(float p_78482_1_) {
  36440. if(this.field_78531_r.func_175606_aa() instanceof EntityLivingBase) {
  36441. EntityLivingBase entitylivingbase = (EntityLivingBase)this.field_78531_r.func_175606_aa();
  36442. float f = (float)entitylivingbase.field_70737_aN - p_78482_1_;
  36443. if(entitylivingbase.func_110143_aJ() <= 0.0F) {
  36444. float f1 = (float)entitylivingbase.field_70725_aQ + p_78482_1_;
  36445. GlStateManager.func_179114_b(40.0F - 8000.0F / (f1 + 200.0F), 0.0F, 0.0F, 1.0F);
  36446. }
  36447.  
  36448. if(f < 0.0F) {
  36449. return;
  36450. }
  36451.  
  36452. f = f / (float)entitylivingbase.field_70738_aO;
  36453. f = MathHelper.func_76126_a(f * f * f * f * 3.1415927F);
  36454. float f2 = entitylivingbase.field_70739_aP;
  36455. GlStateManager.func_179114_b(-f2, 0.0F, 1.0F, 0.0F);
  36456. GlStateManager.func_179114_b(-f * 14.0F, 0.0F, 0.0F, 1.0F);
  36457. GlStateManager.func_179114_b(f2, 0.0F, 1.0F, 0.0F);
  36458. }
  36459.  
  36460. }
  36461.  
  36462. private void func_78475_f(float p_78475_1_) {
  36463. if(this.field_78531_r.func_175606_aa() instanceof EntityPlayer) {
  36464. EntityPlayer entityplayer = (EntityPlayer)this.field_78531_r.func_175606_aa();
  36465. float f = entityplayer.field_70140_Q - entityplayer.field_70141_P;
  36466. float f1 = -(entityplayer.field_70140_Q + f * p_78475_1_);
  36467. float f2 = entityplayer.field_71107_bF + (entityplayer.field_71109_bG - entityplayer.field_71107_bF) * p_78475_1_;
  36468. float f3 = entityplayer.field_70727_aS + (entityplayer.field_70726_aT - entityplayer.field_70727_aS) * p_78475_1_;
  36469. GlStateManager.func_179109_b(MathHelper.func_76126_a(f1 * 3.1415927F) * f2 * 0.5F, -Math.abs(MathHelper.func_76134_b(f1 * 3.1415927F) * f2), 0.0F);
  36470. GlStateManager.func_179114_b(MathHelper.func_76126_a(f1 * 3.1415927F) * f2 * 3.0F, 0.0F, 0.0F, 1.0F);
  36471. GlStateManager.func_179114_b(Math.abs(MathHelper.func_76134_b(f1 * 3.1415927F - 0.2F) * f2) * 5.0F, 1.0F, 0.0F, 0.0F);
  36472. GlStateManager.func_179114_b(f3, 1.0F, 0.0F, 0.0F);
  36473. }
  36474. }
  36475.  
  36476. private void func_78467_g(float p_78467_1_) {
  36477. Entity entity = this.field_78531_r.func_175606_aa();
  36478. float f = entity.func_70047_e();
  36479. double d0 = entity.field_70169_q + (entity.field_70165_t - entity.field_70169_q) * (double)p_78467_1_;
  36480. double d1 = entity.field_70167_r + (entity.field_70163_u - entity.field_70167_r) * (double)p_78467_1_ + (double)f;
  36481. double d2 = entity.field_70166_s + (entity.field_70161_v - entity.field_70166_s) * (double)p_78467_1_;
  36482. if(entity instanceof EntityLivingBase && ((EntityLivingBase)entity).func_70608_bn()) {
  36483. f = (float)((double)f + 1.0D);
  36484. GlStateManager.func_179109_b(0.0F, 0.3F, 0.0F);
  36485. if(!this.field_78531_r.field_71474_y.field_74325_U) {
  36486. BlockPos blockpos = new BlockPos(entity);
  36487. IBlockState iblockstate = this.field_78531_r.field_71441_e.func_180495_p(blockpos);
  36488. Block block = iblockstate.func_177230_c();
  36489. if(block == Blocks.field_150324_C) {
  36490. int j = ((EnumFacing)iblockstate.func_177229_b(BlockBed.field_185512_D)).func_176736_b();
  36491. GlStateManager.func_179114_b((float)(j * 90), 0.0F, 1.0F, 0.0F);
  36492. }
  36493.  
  36494. GlStateManager.func_179114_b(entity.field_70126_B + (entity.field_70177_z - entity.field_70126_B) * p_78467_1_ + 180.0F, 0.0F, -1.0F, 0.0F);
  36495. GlStateManager.func_179114_b(entity.field_70127_C + (entity.field_70125_A - entity.field_70127_C) * p_78467_1_, -1.0F, 0.0F, 0.0F);
  36496. }
  36497. } else if(this.field_78531_r.field_71474_y.field_74320_O > 0) {
  36498. double d3 = (double)(this.field_78491_C + (4.0F - this.field_78491_C) * p_78467_1_);
  36499. if(this.field_78531_r.field_71474_y.field_74325_U) {
  36500. GlStateManager.func_179109_b(0.0F, 0.0F, (float)(-d3));
  36501. } else {
  36502. float f1 = entity.field_70177_z;
  36503. float f2 = entity.field_70125_A;
  36504. if(this.field_78531_r.field_71474_y.field_74320_O == 2) {
  36505. f2 += 180.0F;
  36506. }
  36507.  
  36508. double d4 = (double)(-MathHelper.func_76126_a(f1 * 0.017453292F) * MathHelper.func_76134_b(f2 * 0.017453292F)) * d3;
  36509. double d5 = (double)(MathHelper.func_76134_b(f1 * 0.017453292F) * MathHelper.func_76134_b(f2 * 0.017453292F)) * d3;
  36510. double d6 = (double)(-MathHelper.func_76126_a(f2 * 0.017453292F)) * d3;
  36511.  
  36512. for(int i = 0; i < 8; ++i) {
  36513. float f3 = (float)((i & 1) * 2 - 1);
  36514. float f4 = (float)((i >> 1 & 1) * 2 - 1);
  36515. float f5 = (float)((i >> 2 & 1) * 2 - 1);
  36516. f3 = f3 * 0.1F;
  36517. f4 = f4 * 0.1F;
  36518. f5 = f5 * 0.1F;
  36519. RayTraceResult raytraceresult = this.field_78531_r.field_71441_e.func_72933_a(new Vec3d(d0 + (double)f3, d1 + (double)f4, d2 + (double)f5), new Vec3d(d0 - d4 + (double)f3 + (double)f5, d1 - d6 + (double)f4, d2 - d5 + (double)f5));
  36520. if(raytraceresult != null) {
  36521. double d7 = raytraceresult.field_72307_f.func_72438_d(new Vec3d(d0, d1, d2));
  36522. if(d7 < d3) {
  36523. d3 = d7;
  36524. }
  36525. }
  36526. }
  36527.  
  36528. if(this.field_78531_r.field_71474_y.field_74320_O == 2) {
  36529. GlStateManager.func_179114_b(180.0F, 0.0F, 1.0F, 0.0F);
  36530. }
  36531.  
  36532. GlStateManager.func_179114_b(entity.field_70125_A - f2, 1.0F, 0.0F, 0.0F);
  36533. GlStateManager.func_179114_b(entity.field_70177_z - f1, 0.0F, 1.0F, 0.0F);
  36534. GlStateManager.func_179109_b(0.0F, 0.0F, (float)(-d3));
  36535. GlStateManager.func_179114_b(f1 - entity.field_70177_z, 0.0F, 1.0F, 0.0F);
  36536. GlStateManager.func_179114_b(f2 - entity.field_70125_A, 1.0F, 0.0F, 0.0F);
  36537. }
  36538. } else {
  36539. GlStateManager.func_179109_b(0.0F, 0.0F, 0.05F);
  36540. }
  36541.  
  36542. if(!this.field_78531_r.field_71474_y.field_74325_U) {
  36543. GlStateManager.func_179114_b(entity.field_70127_C + (entity.field_70125_A - entity.field_70127_C) * p_78467_1_, 1.0F, 0.0F, 0.0F);
  36544. if(entity instanceof EntityAnimal) {
  36545. EntityAnimal entityanimal = (EntityAnimal)entity;
  36546. GlStateManager.func_179114_b(entityanimal.field_70758_at + (entityanimal.field_70759_as - entityanimal.field_70758_at) * p_78467_1_ + 180.0F, 0.0F, 1.0F, 0.0F);
  36547. } else {
  36548. GlStateManager.func_179114_b(entity.field_70126_B + (entity.field_70177_z - entity.field_70126_B) * p_78467_1_ + 180.0F, 0.0F, 1.0F, 0.0F);
  36549. }
  36550. }
  36551.  
  36552. GlStateManager.func_179109_b(0.0F, -f, 0.0F);
  36553. d0 = entity.field_70169_q + (entity.field_70165_t - entity.field_70169_q) * (double)p_78467_1_;
  36554. d1 = entity.field_70167_r + (entity.field_70163_u - entity.field_70167_r) * (double)p_78467_1_ + (double)f;
  36555. d2 = entity.field_70166_s + (entity.field_70161_v - entity.field_70166_s) * (double)p_78467_1_;
  36556. this.field_78500_U = this.field_78531_r.field_71438_f.func_72721_a(d0, d1, d2, p_78467_1_);
  36557. }
  36558.  
  36559. private void func_78479_a(float p_78479_1_, int p_78479_2_) {
  36560. this.field_78530_s = (float)(this.field_78531_r.field_71474_y.field_151451_c * 16);
  36561. GlStateManager.func_179128_n(5889);
  36562. GlStateManager.func_179096_D();
  36563. float f = 0.07F;
  36564. if(this.field_78531_r.field_71474_y.field_74337_g) {
  36565. GlStateManager.func_179109_b((float)(-(p_78479_2_ * 2 - 1)) * 0.07F, 0.0F, 0.0F);
  36566. }
  36567.  
  36568. if(this.field_78503_V != 1.0D) {
  36569. GlStateManager.func_179109_b((float)this.field_78502_W, (float)(-this.field_78509_X), 0.0F);
  36570. GlStateManager.func_179139_a(this.field_78503_V, this.field_78503_V, 1.0D);
  36571. }
  36572.  
  36573. Project.gluPerspective(this.func_78481_a(p_78479_1_, true), (float)this.field_78531_r.field_71443_c / (float)this.field_78531_r.field_71440_d, 0.05F, this.field_78530_s * MathHelper.field_180189_a);
  36574. GlStateManager.func_179128_n(5888);
  36575. GlStateManager.func_179096_D();
  36576. if(this.field_78531_r.field_71474_y.field_74337_g) {
  36577. GlStateManager.func_179109_b((float)(p_78479_2_ * 2 - 1) * 0.1F, 0.0F, 0.0F);
  36578. }
  36579.  
  36580. this.func_78482_e(p_78479_1_);
  36581. if(this.field_78531_r.field_71474_y.field_74336_f) {
  36582. this.func_78475_f(p_78479_1_);
  36583. }
  36584.  
  36585. float f1 = this.field_78531_r.field_71439_g.field_71080_cy + (this.field_78531_r.field_71439_g.field_71086_bY - this.field_78531_r.field_71439_g.field_71080_cy) * p_78479_1_;
  36586. if(f1 > 0.0F) {
  36587. int i = 20;
  36588. if(this.field_78531_r.field_71439_g.func_70644_a(MobEffects.field_76431_k)) {
  36589. i = 7;
  36590. }
  36591.  
  36592. float f2 = 5.0F / (f1 * f1 + 5.0F) - f1 * 0.04F;
  36593. f2 = f2 * f2;
  36594. GlStateManager.func_179114_b(((float)this.field_78529_t + p_78479_1_) * (float)i, 0.0F, 1.0F, 1.0F);
  36595. GlStateManager.func_179152_a(1.0F / f2, 1.0F, 1.0F);
  36596. GlStateManager.func_179114_b(-((float)this.field_78529_t + p_78479_1_) * (float)i, 0.0F, 1.0F, 1.0F);
  36597. }
  36598.  
  36599. this.func_78467_g(p_78479_1_);
  36600. if(this.field_175078_W) {
  36601. switch(this.field_175079_V) {
  36602. case 0:
  36603. GlStateManager.func_179114_b(90.0F, 0.0F, 1.0F, 0.0F);
  36604. break;
  36605. case 1:
  36606. GlStateManager.func_179114_b(180.0F, 0.0F, 1.0F, 0.0F);
  36607. break;
  36608. case 2:
  36609. GlStateManager.func_179114_b(-90.0F, 0.0F, 1.0F, 0.0F);
  36610. break;
  36611. case 3:
  36612. GlStateManager.func_179114_b(90.0F, 1.0F, 0.0F, 0.0F);
  36613. break;
  36614. case 4:
  36615. GlStateManager.func_179114_b(-90.0F, 1.0F, 0.0F, 0.0F);
  36616. }
  36617. }
  36618.  
  36619. }
  36620.  
  36621. private void func_78476_b(float p_78476_1_, int p_78476_2_) {
  36622. if(!this.field_175078_W) {
  36623. GlStateManager.func_179128_n(5889);
  36624. GlStateManager.func_179096_D();
  36625. float f = 0.07F;
  36626. if(this.field_78531_r.field_71474_y.field_74337_g) {
  36627. GlStateManager.func_179109_b((float)(-(p_78476_2_ * 2 - 1)) * 0.07F, 0.0F, 0.0F);
  36628. }
  36629.  
  36630. Project.gluPerspective(this.func_78481_a(p_78476_1_, false), (float)this.field_78531_r.field_71443_c / (float)this.field_78531_r.field_71440_d, 0.05F, this.field_78530_s * 2.0F);
  36631. GlStateManager.func_179128_n(5888);
  36632. GlStateManager.func_179096_D();
  36633. if(this.field_78531_r.field_71474_y.field_74337_g) {
  36634. GlStateManager.func_179109_b((float)(p_78476_2_ * 2 - 1) * 0.1F, 0.0F, 0.0F);
  36635. }
  36636.  
  36637. GlStateManager.func_179094_E();
  36638. this.func_78482_e(p_78476_1_);
  36639. if(this.field_78531_r.field_71474_y.field_74336_f) {
  36640. this.func_78475_f(p_78476_1_);
  36641. }
  36642.  
  36643. boolean flag = this.field_78531_r.func_175606_aa() instanceof EntityLivingBase && ((EntityLivingBase)this.field_78531_r.func_175606_aa()).func_70608_bn();
  36644. if(this.field_78531_r.field_71474_y.field_74320_O == 0 && !flag && !this.field_78531_r.field_71474_y.field_74319_N && !this.field_78531_r.field_71442_b.func_78747_a()) {
  36645. this.func_180436_i();
  36646. this.field_78516_c.func_78440_a(p_78476_1_);
  36647. this.func_175072_h();
  36648. }
  36649.  
  36650. GlStateManager.func_179121_F();
  36651. if(this.field_78531_r.field_71474_y.field_74320_O == 0 && !flag) {
  36652. this.field_78516_c.func_78447_b(p_78476_1_);
  36653. this.func_78482_e(p_78476_1_);
  36654. }
  36655.  
  36656. if(this.field_78531_r.field_71474_y.field_74336_f) {
  36657. this.func_78475_f(p_78476_1_);
  36658. }
  36659.  
  36660. }
  36661. }
  36662.  
  36663. public void func_175072_h() {
  36664. GlStateManager.func_179138_g(OpenGlHelper.field_77476_b);
  36665. GlStateManager.func_179090_x();
  36666. GlStateManager.func_179138_g(OpenGlHelper.field_77478_a);
  36667. }
  36668.  
  36669. public void func_180436_i() {
  36670. GlStateManager.func_179138_g(OpenGlHelper.field_77476_b);
  36671. GlStateManager.func_179128_n(5890);
  36672. GlStateManager.func_179096_D();
  36673. float f = 0.00390625F;
  36674. GlStateManager.func_179152_a(0.00390625F, 0.00390625F, 0.00390625F);
  36675. GlStateManager.func_179109_b(8.0F, 8.0F, 8.0F);
  36676. GlStateManager.func_179128_n(5888);
  36677. this.field_78531_r.func_110434_K().func_110577_a(this.field_110922_T);
  36678. GlStateManager.func_187421_b(3553, 10241, 9729);
  36679. GlStateManager.func_187421_b(3553, 10240, 9729);
  36680. GlStateManager.func_187421_b(3553, 10242, 10496);
  36681. GlStateManager.func_187421_b(3553, 10243, 10496);
  36682. GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
  36683. GlStateManager.func_179098_w();
  36684. GlStateManager.func_179138_g(OpenGlHelper.field_77478_a);
  36685. }
  36686.  
  36687. private void func_78470_f() {
  36688. this.field_175075_L = (float)((double)this.field_175075_L + (Math.random() - Math.random()) * Math.random() * Math.random());
  36689. this.field_175075_L = (float)((double)this.field_175075_L * 0.9D);
  36690. this.field_78514_e += this.field_175075_L - this.field_78514_e;
  36691. this.field_78536_aa = true;
  36692. }
  36693.  
  36694. private void func_78472_g(float p_78472_1_) {
  36695. if(this.field_78536_aa) {
  36696. this.field_78531_r.field_71424_I.func_76320_a("lightTex");
  36697. World world = this.field_78531_r.field_71441_e;
  36698. if(world != null) {
  36699. float f = world.func_72971_b(1.0F);
  36700. float f1 = f * 0.95F + 0.05F;
  36701.  
  36702. for(int i = 0; i < 256; ++i) {
  36703. float f2 = world.field_73011_w.func_177497_p()[i / 16] * f1;
  36704. float f3 = world.field_73011_w.func_177497_p()[i % 16] * (this.field_78514_e * 0.1F + 1.5F);
  36705. if(world.func_175658_ac() > 0) {
  36706. f2 = world.field_73011_w.func_177497_p()[i / 16];
  36707. }
  36708.  
  36709. float f4 = f2 * (f * 0.65F + 0.35F);
  36710. float f5 = f2 * (f * 0.65F + 0.35F);
  36711. float f6 = f3 * ((f3 * 0.6F + 0.4F) * 0.6F + 0.4F);
  36712. float f7 = f3 * (f3 * f3 * 0.6F + 0.4F);
  36713. float f8 = f4 + f3;
  36714. float f9 = f5 + f6;
  36715. float f10 = f2 + f7;
  36716. f8 = f8 * 0.96F + 0.03F;
  36717. f9 = f9 * 0.96F + 0.03F;
  36718. f10 = f10 * 0.96F + 0.03F;
  36719. if(this.field_82831_U > 0.0F) {
  36720. float f11 = this.field_82832_V + (this.field_82831_U - this.field_82832_V) * p_78472_1_;
  36721. f8 = f8 * (1.0F - f11) + f8 * 0.7F * f11;
  36722. f9 = f9 * (1.0F - f11) + f9 * 0.6F * f11;
  36723. f10 = f10 * (1.0F - f11) + f10 * 0.6F * f11;
  36724. }
  36725.  
  36726. if(world.field_73011_w.func_186058_p().func_186068_a() == 1) {
  36727. f8 = 0.22F + f3 * 0.75F;
  36728. f9 = 0.28F + f6 * 0.75F;
  36729. f10 = 0.25F + f7 * 0.75F;
  36730. }
  36731.  
  36732. if(this.field_78531_r.field_71439_g.func_70644_a(MobEffects.field_76439_r)) {
  36733. float f15 = this.func_180438_a(this.field_78531_r.field_71439_g, p_78472_1_);
  36734. float f12 = 1.0F / f8;
  36735. if(f12 > 1.0F / f9) {
  36736. f12 = 1.0F / f9;
  36737. }
  36738.  
  36739. if(f12 > 1.0F / f10) {
  36740. f12 = 1.0F / f10;
  36741. }
  36742.  
  36743. f8 = f8 * (1.0F - f15) + f8 * f12 * f15;
  36744. f9 = f9 * (1.0F - f15) + f9 * f12 * f15;
  36745. f10 = f10 * (1.0F - f15) + f10 * f12 * f15;
  36746. }
  36747.  
  36748. if(f8 > 1.0F) {
  36749. f8 = 1.0F;
  36750. }
  36751.  
  36752. if(f9 > 1.0F) {
  36753. f9 = 1.0F;
  36754. }
  36755.  
  36756. if(f10 > 1.0F) {
  36757. f10 = 1.0F;
  36758. }
  36759.  
  36760. float f16 = this.field_78531_r.field_71474_y.field_74333_Y;
  36761. float f17 = 1.0F - f8;
  36762. float f13 = 1.0F - f9;
  36763. float f14 = 1.0F - f10;
  36764. f17 = 1.0F - f17 * f17 * f17 * f17;
  36765. f13 = 1.0F - f13 * f13 * f13 * f13;
  36766. f14 = 1.0F - f14 * f14 * f14 * f14;
  36767. f8 = f8 * (1.0F - f16) + f17 * f16;
  36768. f9 = f9 * (1.0F - f16) + f13 * f16;
  36769. f10 = f10 * (1.0F - f16) + f14 * f16;
  36770. f8 = f8 * 0.96F + 0.03F;
  36771. f9 = f9 * 0.96F + 0.03F;
  36772. f10 = f10 * 0.96F + 0.03F;
  36773. if(f8 > 1.0F) {
  36774. f8 = 1.0F;
  36775. }
  36776.  
  36777. if(f9 > 1.0F) {
  36778. f9 = 1.0F;
  36779. }
  36780.  
  36781. if(f10 > 1.0F) {
  36782. f10 = 1.0F;
  36783. }
  36784.  
  36785. if(f8 < 0.0F) {
  36786. f8 = 0.0F;
  36787. }
  36788.  
  36789. if(f9 < 0.0F) {
  36790. f9 = 0.0F;
  36791. }
  36792.  
  36793. if(f10 < 0.0F) {
  36794. f10 = 0.0F;
  36795. }
  36796.  
  36797. int j = 255;
  36798. int k = (int)(f8 * 255.0F);
  36799. int l = (int)(f9 * 255.0F);
  36800. int i1 = (int)(f10 * 255.0F);
  36801. this.field_78504_Q[i] = -16777216 | k << 16 | l << 8 | i1;
  36802. }
  36803.  
  36804. this.field_78513_d.func_110564_a();
  36805. this.field_78536_aa = false;
  36806. this.field_78531_r.field_71424_I.func_76319_b();
  36807. }
  36808. }
  36809. }
  36810.  
  36811. private float func_180438_a(EntityLivingBase p_180438_1_, float p_180438_2_) {
  36812. int i = p_180438_1_.func_70660_b(MobEffects.field_76439_r).func_76459_b();
  36813. return i > 200?1.0F:0.7F + MathHelper.func_76126_a(((float)i - p_180438_2_) * 3.1415927F * 0.2F) * 0.3F;
  36814. }
  36815.  
  36816. public void func_181560_a(float p_181560_1_, long p_181560_2_) {
  36817. boolean flag = Display.isActive();
  36818. if(!flag && this.field_78531_r.field_71474_y.field_82881_y && (!this.field_78531_r.field_71474_y.field_85185_A || !Mouse.isButtonDown(1))) {
  36819. if(Minecraft.func_71386_F() - this.field_78508_Y > 500L) {
  36820. this.field_78531_r.func_71385_j();
  36821. }
  36822. } else {
  36823. this.field_78508_Y = Minecraft.func_71386_F();
  36824. }
  36825.  
  36826. this.field_78531_r.field_71424_I.func_76320_a("mouse");
  36827. if(flag && Minecraft.field_142025_a && this.field_78531_r.field_71415_G && !Mouse.isInsideWindow()) {
  36828. Mouse.setGrabbed(false);
  36829. Mouse.setCursorPosition(Display.getWidth() / 2, Display.getHeight() / 2 - 20);
  36830. Mouse.setGrabbed(true);
  36831. }
  36832.  
  36833. if(this.field_78531_r.field_71415_G && flag) {
  36834. this.field_78531_r.field_71417_B.func_74374_c();
  36835. this.field_78531_r.func_193032_ao().func_193299_a(this.field_78531_r.field_71417_B);
  36836. float f = this.field_78531_r.field_71474_y.field_74341_c * 0.6F + 0.2F;
  36837. float f1 = f * f * f * 8.0F;
  36838. float f2 = (float)this.field_78531_r.field_71417_B.field_74377_a * f1;
  36839. float f3 = (float)this.field_78531_r.field_71417_B.field_74375_b * f1;
  36840. int i = 1;
  36841. if(this.field_78531_r.field_71474_y.field_74338_d) {
  36842. i = -1;
  36843. }
  36844.  
  36845. if(this.field_78531_r.field_71474_y.field_74326_T) {
  36846. this.field_78496_H += f2;
  36847. this.field_78497_I += f3;
  36848. float f4 = p_181560_1_ - this.field_78492_L;
  36849. this.field_78492_L = p_181560_1_;
  36850. f2 = this.field_78498_J * f4;
  36851. f3 = this.field_78499_K * f4;
  36852. this.field_78531_r.field_71439_g.func_70082_c(f2, f3 * (float)i);
  36853. } else {
  36854. this.field_78496_H = 0.0F;
  36855. this.field_78497_I = 0.0F;
  36856. this.field_78531_r.field_71439_g.func_70082_c(f2, f3 * (float)i);
  36857. }
  36858. }
  36859.  
  36860. this.field_78531_r.field_71424_I.func_76319_b();
  36861. if(!this.field_78531_r.field_71454_w) {
  36862. field_78517_a = this.field_78531_r.field_71474_y.field_74337_g;
  36863. final ScaledResolution scaledresolution = new ScaledResolution(this.field_78531_r);
  36864. int i1 = scaledresolution.func_78326_a();
  36865. int j1 = scaledresolution.func_78328_b();
  36866. final int k1 = Mouse.getX() * i1 / this.field_78531_r.field_71443_c;
  36867. final int l1 = j1 - Mouse.getY() * j1 / this.field_78531_r.field_71440_d - 1;
  36868. int i2 = this.field_78531_r.field_71474_y.field_74350_i;
  36869. if(this.field_78531_r.field_71441_e != null) {
  36870. this.field_78531_r.field_71424_I.func_76320_a("level");
  36871. int j = Math.min(Minecraft.func_175610_ah(), i2);
  36872. j = Math.max(j, 60);
  36873. long k = System.nanoTime() - p_181560_2_;
  36874. long l = Math.max((long)(1000000000 / j / 4) - k, 0L);
  36875. this.func_78471_a(p_181560_1_, System.nanoTime() + l);
  36876. if(this.field_78531_r.func_71356_B() && this.field_184374_E < Minecraft.func_71386_F() - 1000L) {
  36877. this.field_184374_E = Minecraft.func_71386_F();
  36878. if(!this.field_78531_r.func_71401_C().func_184106_y()) {
  36879. this.func_184373_n();
  36880. }
  36881. }
  36882.  
  36883. if(OpenGlHelper.field_148824_g) {
  36884. this.field_78531_r.field_71438_f.func_174975_c();
  36885. if(this.field_147707_d != null && this.field_175083_ad) {
  36886. GlStateManager.func_179128_n(5890);
  36887. GlStateManager.func_179094_E();
  36888. GlStateManager.func_179096_D();
  36889. this.field_147707_d.func_148018_a(p_181560_1_);
  36890. GlStateManager.func_179121_F();
  36891. }
  36892.  
  36893. this.field_78531_r.func_147110_a().func_147610_a(true);
  36894. }
  36895.  
  36896. this.field_78510_Z = System.nanoTime();
  36897. this.field_78531_r.field_71424_I.func_76318_c("gui");
  36898. if(!this.field_78531_r.field_71474_y.field_74319_N || this.field_78531_r.field_71462_r != null) {
  36899. GlStateManager.func_179092_a(516, 0.1F);
  36900. this.func_78478_c();
  36901. this.func_190563_a(i1, j1, p_181560_1_);
  36902. this.field_78531_r.field_71456_v.func_175180_a(p_181560_1_);
  36903. }
  36904.  
  36905. this.field_78531_r.field_71424_I.func_76319_b();
  36906. } else {
  36907. GlStateManager.func_179083_b(0, 0, this.field_78531_r.field_71443_c, this.field_78531_r.field_71440_d);
  36908. GlStateManager.func_179128_n(5889);
  36909. GlStateManager.func_179096_D();
  36910. GlStateManager.func_179128_n(5888);
  36911. GlStateManager.func_179096_D();
  36912. this.func_78478_c();
  36913. this.field_78510_Z = System.nanoTime();
  36914. }
  36915.  
  36916. if(this.field_78531_r.field_71462_r != null) {
  36917. GlStateManager.func_179086_m(256);
  36918.  
  36919. try {
  36920. this.field_78531_r.field_71462_r.func_73863_a(k1, l1, this.field_78531_r.func_193989_ak());
  36921. } catch (Throwable throwable) {
  36922. CrashReport crashreport = CrashReport.func_85055_a(throwable, "Rendering screen");
  36923. CrashReportCategory crashreportcategory = crashreport.func_85058_a("Screen render details");
  36924. crashreportcategory.func_189529_a("Screen name", new ICrashReportDetail<String>() {
  36925. public String call() throws Exception {
  36926. return EntityRenderer.this.field_78531_r.field_71462_r.getClass().getCanonicalName();
  36927. }
  36928. });
  36929. crashreportcategory.func_189529_a("Mouse location", new ICrashReportDetail<String>() {
  36930. public String call() throws Exception {
  36931. return String.format("Scaled: (%d, %d). Absolute: (%d, %d)", new Object[]{Integer.valueOf(k1), Integer.valueOf(l1), Integer.valueOf(Mouse.getX()), Integer.valueOf(Mouse.getY())});
  36932. }
  36933. });
  36934. crashreportcategory.func_189529_a("Screen size", new ICrashReportDetail<String>() {
  36935. public String call() throws Exception {
  36936. return String.format("Scaled: (%d, %d). Absolute: (%d, %d). Scale factor of %d", new Object[]{Integer.valueOf(scaledresolution.func_78326_a()), Integer.valueOf(scaledresolution.func_78328_b()), Integer.valueOf(EntityRenderer.this.field_78531_r.field_71443_c), Integer.valueOf(EntityRenderer.this.field_78531_r.field_71440_d), Integer.valueOf(scaledresolution.func_78325_e())});
  36937. }
  36938. });
  36939. throw new ReportedException(crashreport);
  36940. }
  36941. }
  36942.  
  36943. }
  36944. }
  36945.  
  36946. private void func_184373_n() {
  36947. if(this.field_78531_r.field_71438_f.func_184382_g() > 10 && this.field_78531_r.field_71438_f.func_184384_n() && !this.field_78531_r.func_71401_C().func_184106_y()) {
  36948. BufferedImage bufferedimage = ScreenShotHelper.func_186719_a(this.field_78531_r.field_71443_c, this.field_78531_r.field_71440_d, this.field_78531_r.func_147110_a());
  36949. int i = bufferedimage.getWidth();
  36950. int j = bufferedimage.getHeight();
  36951. int k = 0;
  36952. int l = 0;
  36953. if(i > j) {
  36954. k = (i - j) / 2;
  36955. i = j;
  36956. } else {
  36957. l = (j - i) / 2;
  36958. }
  36959.  
  36960. try {
  36961. BufferedImage bufferedimage1 = new BufferedImage(64, 64, 1);
  36962. Graphics graphics = bufferedimage1.createGraphics();
  36963. graphics.drawImage(bufferedimage, 0, 0, 64, 64, k, l, k + i, l + i, (ImageObserver)null);
  36964. graphics.dispose();
  36965. ImageIO.write(bufferedimage1, "png", (File)this.field_78531_r.func_71401_C().func_184109_z());
  36966. } catch (IOException ioexception) {
  36967. field_147710_q.warn((String)"Couldn\'t save auto screenshot", (Throwable)ioexception);
  36968. }
  36969. }
  36970.  
  36971. }
  36972.  
  36973. public void func_152430_c(float p_152430_1_) {
  36974. this.func_78478_c();
  36975. }
  36976.  
  36977. private boolean func_175070_n() {
  36978. if(!this.field_175073_D) {
  36979. return false;
  36980. } else {
  36981. Entity entity = this.field_78531_r.func_175606_aa();
  36982. boolean flag = entity instanceof EntityPlayer && !this.field_78531_r.field_71474_y.field_74319_N;
  36983. if(flag && !((EntityPlayer)entity).field_71075_bZ.field_75099_e) {
  36984. ItemStack itemstack = ((EntityPlayer)entity).func_184614_ca();
  36985. if(this.field_78531_r.field_71476_x != null && this.field_78531_r.field_71476_x.field_72313_a == RayTraceResult.Type.BLOCK) {
  36986. BlockPos blockpos = this.field_78531_r.field_71476_x.func_178782_a();
  36987. Block block = this.field_78531_r.field_71441_e.func_180495_p(blockpos).func_177230_c();
  36988. if(this.field_78531_r.field_71442_b.func_178889_l() == GameType.SPECTATOR) {
  36989. flag = block.func_149716_u() && this.field_78531_r.field_71441_e.func_175625_s(blockpos) instanceof IInventory;
  36990. } else {
  36991. flag = !itemstack.func_190926_b() && (itemstack.func_179544_c(block) || itemstack.func_179547_d(block));
  36992. }
  36993. }
  36994. }
  36995.  
  36996. return flag;
  36997. }
  36998. }
  36999.  
  37000. public void func_78471_a(float p_78471_1_, long p_78471_2_) {
  37001. this.func_78472_g(p_78471_1_);
  37002. if(this.field_78531_r.func_175606_aa() == null) {
  37003. this.field_78531_r.func_175607_a(this.field_78531_r.field_71439_g);
  37004. }
  37005.  
  37006. this.func_78473_a(p_78471_1_);
  37007. GlStateManager.func_179126_j();
  37008. GlStateManager.func_179141_d();
  37009. GlStateManager.func_179092_a(516, 0.5F);
  37010. this.field_78531_r.field_71424_I.func_76320_a("center");
  37011. if(this.field_78531_r.field_71474_y.field_74337_g) {
  37012. field_78515_b = 0;
  37013. GlStateManager.func_179135_a(false, true, true, false);
  37014. this.func_175068_a(0, p_78471_1_, p_78471_2_);
  37015. field_78515_b = 1;
  37016. GlStateManager.func_179135_a(true, false, false, false);
  37017. this.func_175068_a(1, p_78471_1_, p_78471_2_);
  37018. GlStateManager.func_179135_a(true, true, true, false);
  37019. } else {
  37020. this.func_175068_a(2, p_78471_1_, p_78471_2_);
  37021. }
  37022.  
  37023. this.field_78531_r.field_71424_I.func_76319_b();
  37024. }
  37025.  
  37026. private void func_175068_a(int p_175068_1_, float p_175068_2_, long p_175068_3_) {
  37027. RenderGlobal renderglobal = this.field_78531_r.field_71438_f;
  37028. ParticleManager particlemanager = this.field_78531_r.field_71452_i;
  37029. boolean flag = this.func_175070_n();
  37030. GlStateManager.func_179089_o();
  37031. this.field_78531_r.field_71424_I.func_76318_c("clear");
  37032. GlStateManager.func_179083_b(0, 0, this.field_78531_r.field_71443_c, this.field_78531_r.field_71440_d);
  37033. this.func_78466_h(p_175068_2_);
  37034. GlStateManager.func_179086_m(16640);
  37035. this.field_78531_r.field_71424_I.func_76318_c("camera");
  37036. this.func_78479_a(p_175068_2_, p_175068_1_);
  37037. ActiveRenderInfo.func_74583_a(this.field_78531_r.field_71439_g, this.field_78531_r.field_71474_y.field_74320_O == 2);
  37038. this.field_78531_r.field_71424_I.func_76318_c("frustum");
  37039. ClippingHelperImpl.func_78558_a();
  37040. this.field_78531_r.field_71424_I.func_76318_c("culling");
  37041. ICamera icamera = new Frustum();
  37042. Entity entity = this.field_78531_r.func_175606_aa();
  37043. double d0 = entity.field_70142_S + (entity.field_70165_t - entity.field_70142_S) * (double)p_175068_2_;
  37044. double d1 = entity.field_70137_T + (entity.field_70163_u - entity.field_70137_T) * (double)p_175068_2_;
  37045. double d2 = entity.field_70136_U + (entity.field_70161_v - entity.field_70136_U) * (double)p_175068_2_;
  37046. icamera.func_78547_a(d0, d1, d2);
  37047. if(this.field_78531_r.field_71474_y.field_151451_c >= 4) {
  37048. this.func_78468_a(-1, p_175068_2_);
  37049. this.field_78531_r.field_71424_I.func_76318_c("sky");
  37050. GlStateManager.func_179128_n(5889);
  37051. GlStateManager.func_179096_D();
  37052. Project.gluPerspective(this.func_78481_a(p_175068_2_, true), (float)this.field_78531_r.field_71443_c / (float)this.field_78531_r.field_71440_d, 0.05F, this.field_78530_s * 2.0F);
  37053. GlStateManager.func_179128_n(5888);
  37054. renderglobal.func_174976_a(p_175068_2_, p_175068_1_);
  37055. GlStateManager.func_179128_n(5889);
  37056. GlStateManager.func_179096_D();
  37057. Project.gluPerspective(this.func_78481_a(p_175068_2_, true), (float)this.field_78531_r.field_71443_c / (float)this.field_78531_r.field_71440_d, 0.05F, this.field_78530_s * MathHelper.field_180189_a);
  37058. GlStateManager.func_179128_n(5888);
  37059. }
  37060.  
  37061. this.func_78468_a(0, p_175068_2_);
  37062. GlStateManager.func_179103_j(7425);
  37063. if(entity.field_70163_u + (double)entity.func_70047_e() < 128.0D) {
  37064. this.func_180437_a(renderglobal, p_175068_2_, p_175068_1_, d0, d1, d2);
  37065. }
  37066.  
  37067. this.field_78531_r.field_71424_I.func_76318_c("prepareterrain");
  37068. this.func_78468_a(0, p_175068_2_);
  37069. this.field_78531_r.func_110434_K().func_110577_a(TextureMap.field_110575_b);
  37070. RenderHelper.func_74518_a();
  37071. this.field_78531_r.field_71424_I.func_76318_c("terrain_setup");
  37072. renderglobal.func_174970_a(entity, (double)p_175068_2_, icamera, this.field_175084_ae++, this.field_78531_r.field_71439_g.func_175149_v());
  37073. if(p_175068_1_ == 0 || p_175068_1_ == 2) {
  37074. this.field_78531_r.field_71424_I.func_76318_c("updatechunks");
  37075. this.field_78531_r.field_71438_f.func_174967_a(p_175068_3_);
  37076. }
  37077.  
  37078. this.field_78531_r.field_71424_I.func_76318_c("terrain");
  37079. GlStateManager.func_179128_n(5888);
  37080. GlStateManager.func_179094_E();
  37081. GlStateManager.func_179118_c();
  37082. renderglobal.func_174977_a(BlockRenderLayer.SOLID, (double)p_175068_2_, p_175068_1_, entity);
  37083. GlStateManager.func_179141_d();
  37084. renderglobal.func_174977_a(BlockRenderLayer.CUTOUT_MIPPED, (double)p_175068_2_, p_175068_1_, entity);
  37085. this.field_78531_r.func_110434_K().func_110581_b(TextureMap.field_110575_b).func_174936_b(false, false);
  37086. renderglobal.func_174977_a(BlockRenderLayer.CUTOUT, (double)p_175068_2_, p_175068_1_, entity);
  37087. this.field_78531_r.func_110434_K().func_110581_b(TextureMap.field_110575_b).func_174935_a();
  37088. GlStateManager.func_179103_j(7424);
  37089. GlStateManager.func_179092_a(516, 0.1F);
  37090. if(!this.field_175078_W) {
  37091. GlStateManager.func_179128_n(5888);
  37092. GlStateManager.func_179121_F();
  37093. GlStateManager.func_179094_E();
  37094. RenderHelper.func_74519_b();
  37095. this.field_78531_r.field_71424_I.func_76318_c("entities");
  37096. renderglobal.func_180446_a(entity, icamera, p_175068_2_);
  37097. RenderHelper.func_74518_a();
  37098. this.func_175072_h();
  37099. }
  37100.  
  37101. GlStateManager.func_179128_n(5888);
  37102. GlStateManager.func_179121_F();
  37103. if(flag && this.field_78531_r.field_71476_x != null && !entity.func_70055_a(Material.field_151586_h)) {
  37104. EntityPlayer entityplayer = (EntityPlayer)entity;
  37105. GlStateManager.func_179118_c();
  37106. this.field_78531_r.field_71424_I.func_76318_c("outline");
  37107. renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_175068_2_);
  37108. GlStateManager.func_179141_d();
  37109. }
  37110.  
  37111. if(this.field_78531_r.field_184132_p.func_190074_a()) {
  37112. this.field_78531_r.field_184132_p.func_190073_a(p_175068_2_, p_175068_3_);
  37113. }
  37114.  
  37115. this.field_78531_r.field_71424_I.func_76318_c("destroyProgress");
  37116. GlStateManager.func_179147_l();
  37117. GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
  37118. this.field_78531_r.func_110434_K().func_110581_b(TextureMap.field_110575_b).func_174936_b(false, false);
  37119. renderglobal.func_174981_a(Tessellator.func_178181_a(), Tessellator.func_178181_a().func_178180_c(), entity, p_175068_2_);
  37120. this.field_78531_r.func_110434_K().func_110581_b(TextureMap.field_110575_b).func_174935_a();
  37121. GlStateManager.func_179084_k();
  37122. if(!this.field_175078_W) {
  37123. this.func_180436_i();
  37124. this.field_78531_r.field_71424_I.func_76318_c("litParticles");
  37125. particlemanager.func_78872_b(entity, p_175068_2_);
  37126. RenderHelper.func_74518_a();
  37127. this.func_78468_a(0, p_175068_2_);
  37128. this.field_78531_r.field_71424_I.func_76318_c("particles");
  37129. particlemanager.func_78874_a(entity, p_175068_2_);
  37130. this.func_175072_h();
  37131. }
  37132.  
  37133. GlStateManager.func_179132_a(false);
  37134. GlStateManager.func_179089_o();
  37135. this.field_78531_r.field_71424_I.func_76318_c("weather");
  37136. this.func_78474_d(p_175068_2_);
  37137. GlStateManager.func_179132_a(true);
  37138. renderglobal.func_180449_a(entity, p_175068_2_);
  37139. GlStateManager.func_179084_k();
  37140. GlStateManager.func_179089_o();
  37141. GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
  37142. GlStateManager.func_179092_a(516, 0.1F);
  37143. this.func_78468_a(0, p_175068_2_);
  37144. GlStateManager.func_179147_l();
  37145. GlStateManager.func_179132_a(false);
  37146. this.field_78531_r.func_110434_K().func_110577_a(TextureMap.field_110575_b);
  37147. GlStateManager.func_179103_j(7425);
  37148. this.field_78531_r.field_71424_I.func_76318_c("translucent");
  37149. renderglobal.func_174977_a(BlockRenderLayer.TRANSLUCENT, (double)p_175068_2_, p_175068_1_, entity);
  37150. GlStateManager.func_179103_j(7424);
  37151. GlStateManager.func_179132_a(true);
  37152. GlStateManager.func_179089_o();
  37153. GlStateManager.func_179084_k();
  37154. GlStateManager.func_179106_n();
  37155. if(entity.field_70163_u + (double)entity.func_70047_e() >= 128.0D) {
  37156. this.field_78531_r.field_71424_I.func_76318_c("aboveClouds");
  37157. this.func_180437_a(renderglobal, p_175068_2_, p_175068_1_, d0, d1, d2);
  37158. }
  37159.  
  37160. this.field_78531_r.field_71424_I.func_76318_c("hand");
  37161. if(this.field_175074_C) {
  37162. GlStateManager.func_179086_m(256);
  37163. this.func_78476_b(p_175068_2_, p_175068_1_);
  37164. }
  37165.  
  37166. }
  37167.  
  37168. private void func_180437_a(RenderGlobal p_180437_1_, float p_180437_2_, int p_180437_3_, double p_180437_4_, double p_180437_6_, double p_180437_8_) {
  37169. if(this.field_78531_r.field_71474_y.func_181147_e() != 0) {
  37170. this.field_78531_r.field_71424_I.func_76318_c("clouds");
  37171. GlStateManager.func_179128_n(5889);
  37172. GlStateManager.func_179096_D();
  37173. Project.gluPerspective(this.func_78481_a(p_180437_2_, true), (float)this.field_78531_r.field_71443_c / (float)this.field_78531_r.field_71440_d, 0.05F, this.field_78530_s * 4.0F);
  37174. GlStateManager.func_179128_n(5888);
  37175. GlStateManager.func_179094_E();
  37176. this.func_78468_a(0, p_180437_2_);
  37177. p_180437_1_.func_180447_b(p_180437_2_, p_180437_3_, p_180437_4_, p_180437_6_, p_180437_8_);
  37178. GlStateManager.func_179106_n();
  37179. GlStateManager.func_179121_F();
  37180. GlStateManager.func_179128_n(5889);
  37181. GlStateManager.func_179096_D();
  37182. Project.gluPerspective(this.func_78481_a(p_180437_2_, true), (float)this.field_78531_r.field_71443_c / (float)this.field_78531_r.field_71440_d, 0.05F, this.field_78530_s * MathHelper.field_180189_a);
  37183. GlStateManager.func_179128_n(5888);
  37184. }
  37185.  
  37186. }
  37187.  
  37188. private void func_78484_h() {
  37189. float f = this.field_78531_r.field_71441_e.func_72867_j(1.0F);
  37190. if(!this.field_78531_r.field_71474_y.field_74347_j) {
  37191. f /= 2.0F;
  37192. }
  37193.  
  37194. if(f != 0.0F) {
  37195. this.field_78537_ab.setSeed((long)this.field_78529_t * 312987231L);
  37196. Entity entity = this.field_78531_r.func_175606_aa();
  37197. World world = this.field_78531_r.field_71441_e;
  37198. BlockPos blockpos = new BlockPos(entity);
  37199. int i = 10;
  37200. double d0 = 0.0D;
  37201. double d1 = 0.0D;
  37202. double d2 = 0.0D;
  37203. int j = 0;
  37204. int k = (int)(100.0F * f * f);
  37205. if(this.field_78531_r.field_71474_y.field_74362_aa == 1) {
  37206. k >>= 1;
  37207. } else if(this.field_78531_r.field_71474_y.field_74362_aa == 2) {
  37208. k = 0;
  37209. }
  37210.  
  37211. for(int l = 0; l < k; ++l) {
  37212. BlockPos blockpos1 = world.func_175725_q(blockpos.func_177982_a(this.field_78537_ab.nextInt(10) - this.field_78537_ab.nextInt(10), 0, this.field_78537_ab.nextInt(10) - this.field_78537_ab.nextInt(10)));
  37213. Biome biome = world.func_180494_b(blockpos1);
  37214. BlockPos blockpos2 = blockpos1.func_177977_b();
  37215. IBlockState iblockstate = world.func_180495_p(blockpos2);
  37216. if(blockpos1.func_177956_o() <= blockpos.func_177956_o() + 10 && blockpos1.func_177956_o() >= blockpos.func_177956_o() - 10 && biome.func_76738_d() && biome.func_180626_a(blockpos1) >= 0.15F) {
  37217. double d3 = this.field_78537_ab.nextDouble();
  37218. double d4 = this.field_78537_ab.nextDouble();
  37219. AxisAlignedBB axisalignedbb = iblockstate.func_185900_c(world, blockpos2);
  37220. if(iblockstate.func_185904_a() != Material.field_151587_i && iblockstate.func_177230_c() != Blocks.field_189877_df) {
  37221. if(iblockstate.func_185904_a() != Material.field_151579_a) {
  37222. ++j;
  37223. if(this.field_78537_ab.nextInt(j) == 0) {
  37224. d0 = (double)blockpos2.func_177958_n() + d3;
  37225. d1 = (double)((float)blockpos2.func_177956_o() + 0.1F) + axisalignedbb.field_72337_e - 1.0D;
  37226. d2 = (double)blockpos2.func_177952_p() + d4;
  37227. }
  37228.  
  37229. this.field_78531_r.field_71441_e.func_175688_a(EnumParticleTypes.WATER_DROP, (double)blockpos2.func_177958_n() + d3, (double)((float)blockpos2.func_177956_o() + 0.1F) + axisalignedbb.field_72337_e, (double)blockpos2.func_177952_p() + d4, 0.0D, 0.0D, 0.0D, new int[0]);
  37230. }
  37231. } else {
  37232. this.field_78531_r.field_71441_e.func_175688_a(EnumParticleTypes.SMOKE_NORMAL, (double)blockpos1.func_177958_n() + d3, (double)((float)blockpos1.func_177956_o() + 0.1F) - axisalignedbb.field_72338_b, (double)blockpos1.func_177952_p() + d4, 0.0D, 0.0D, 0.0D, new int[0]);
  37233. }
  37234. }
  37235. }
  37236.  
  37237. if(j > 0 && this.field_78537_ab.nextInt(3) < this.field_78534_ac++) {
  37238. this.field_78534_ac = 0;
  37239. if(d1 > (double)(blockpos.func_177956_o() + 1) && world.func_175725_q(blockpos).func_177956_o() > MathHelper.func_76141_d((float)blockpos.func_177956_o())) {
  37240. this.field_78531_r.field_71441_e.func_184134_a(d0, d1, d2, SoundEvents.field_187919_gs, SoundCategory.WEATHER, 0.1F, 0.5F, false);
  37241. } else {
  37242. this.field_78531_r.field_71441_e.func_184134_a(d0, d1, d2, SoundEvents.field_187918_gr, SoundCategory.WEATHER, 0.2F, 1.0F, false);
  37243. }
  37244. }
  37245.  
  37246. }
  37247. }
  37248.  
  37249. protected void func_78474_d(float p_78474_1_) {
  37250. float f = this.field_78531_r.field_71441_e.func_72867_j(p_78474_1_);
  37251. if(f > 0.0F) {
  37252. this.func_180436_i();
  37253. Entity entity = this.field_78531_r.func_175606_aa();
  37254. World world = this.field_78531_r.field_71441_e;
  37255. int i = MathHelper.func_76128_c(entity.field_70165_t);
  37256. int j = MathHelper.func_76128_c(entity.field_70163_u);
  37257. int k = MathHelper.func_76128_c(entity.field_70161_v);
  37258. Tessellator tessellator = Tessellator.func_178181_a();
  37259. BufferBuilder bufferbuilder = tessellator.func_178180_c();
  37260. GlStateManager.func_179129_p();
  37261. GlStateManager.func_187432_a(0.0F, 1.0F, 0.0F);
  37262. GlStateManager.func_179147_l();
  37263. GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
  37264. GlStateManager.func_179092_a(516, 0.1F);
  37265. double d0 = entity.field_70142_S + (entity.field_70165_t - entity.field_70142_S) * (double)p_78474_1_;
  37266. double d1 = entity.field_70137_T + (entity.field_70163_u - entity.field_70137_T) * (double)p_78474_1_;
  37267. double d2 = entity.field_70136_U + (entity.field_70161_v - entity.field_70136_U) * (double)p_78474_1_;
  37268. int l = MathHelper.func_76128_c(d1);
  37269. int i1 = 5;
  37270. if(this.field_78531_r.field_71474_y.field_74347_j) {
  37271. i1 = 10;
  37272. }
  37273.  
  37274. int j1 = -1;
  37275. float f1 = (float)this.field_78529_t + p_78474_1_;
  37276. bufferbuilder.func_178969_c(-d0, -d1, -d2);
  37277. GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
  37278. BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
  37279.  
  37280. for(int k1 = k - i1; k1 <= k + i1; ++k1) {
  37281. for(int l1 = i - i1; l1 <= i + i1; ++l1) {
  37282. int i2 = (k1 - k + 16) * 32 + l1 - i + 16;
  37283. double d3 = (double)this.field_175076_N[i2] * 0.5D;
  37284. double d4 = (double)this.field_175077_O[i2] * 0.5D;
  37285. blockpos$mutableblockpos.func_181079_c(l1, 0, k1);
  37286. Biome biome = world.func_180494_b(blockpos$mutableblockpos);
  37287. if(biome.func_76738_d() || biome.func_76746_c()) {
  37288. int j2 = world.func_175725_q(blockpos$mutableblockpos).func_177956_o();
  37289. int k2 = j - i1;
  37290. int l2 = j + i1;
  37291. if(k2 < j2) {
  37292. k2 = j2;
  37293. }
  37294.  
  37295. if(l2 < j2) {
  37296. l2 = j2;
  37297. }
  37298.  
  37299. int i3 = j2;
  37300. if(j2 < l) {
  37301. i3 = l;
  37302. }
  37303.  
  37304. if(k2 != l2) {
  37305. this.field_78537_ab.setSeed((long)(l1 * l1 * 3121 + l1 * 45238971 ^ k1 * k1 * 418711 + k1 * 13761));
  37306. blockpos$mutableblockpos.func_181079_c(l1, k2, k1);
  37307. float f2 = biome.func_180626_a(blockpos$mutableblockpos);
  37308. if(world.func_72959_q().func_76939_a(f2, j2) >= 0.15F) {
  37309. if(j1 != 0) {
  37310. if(j1 >= 0) {
  37311. tessellator.func_78381_a();
  37312. }
  37313.  
  37314. j1 = 0;
  37315. this.field_78531_r.func_110434_K().func_110577_a(field_110924_q);
  37316. bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181704_d);
  37317. }
  37318.  
  37319. double d5 = -((double)(this.field_78529_t + l1 * l1 * 3121 + l1 * 45238971 + k1 * k1 * 418711 + k1 * 13761 & 31) + (double)p_78474_1_) / 32.0D * (3.0D + this.field_78537_ab.nextDouble());
  37320. double d6 = (double)((float)l1 + 0.5F) - entity.field_70165_t;
  37321. double d7 = (double)((float)k1 + 0.5F) - entity.field_70161_v;
  37322. float f3 = MathHelper.func_76133_a(d6 * d6 + d7 * d7) / (float)i1;
  37323. float f4 = ((1.0F - f3 * f3) * 0.5F + 0.5F) * f;
  37324. blockpos$mutableblockpos.func_181079_c(l1, i3, k1);
  37325. int j3 = world.func_175626_b(blockpos$mutableblockpos, 0);
  37326. int k3 = j3 >> 16 & '\uffff';
  37327. int l3 = j3 & '\uffff';
  37328. bufferbuilder.func_181662_b((double)l1 - d3 + 0.5D, (double)l2, (double)k1 - d4 + 0.5D).func_187315_a(0.0D, (double)k2 * 0.25D + d5).func_181666_a(1.0F, 1.0F, 1.0F, f4).func_187314_a(k3, l3).func_181675_d();
  37329. bufferbuilder.func_181662_b((double)l1 + d3 + 0.5D, (double)l2, (double)k1 + d4 + 0.5D).func_187315_a(1.0D, (double)k2 * 0.25D + d5).func_181666_a(1.0F, 1.0F, 1.0F, f4).func_187314_a(k3, l3).func_181675_d();
  37330. bufferbuilder.func_181662_b((double)l1 + d3 + 0.5D, (double)k2, (double)k1 + d4 + 0.5D).func_187315_a(1.0D, (double)l2 * 0.25D + d5).func_181666_a(1.0F, 1.0F, 1.0F, f4).func_187314_a(k3, l3).func_181675_d();
  37331. bufferbuilder.func_181662_b((double)l1 - d3 + 0.5D, (double)k2, (double)k1 - d4 + 0.5D).func_187315_a(0.0D, (double)l2 * 0.25D + d5).func_181666_a(1.0F, 1.0F, 1.0F, f4).func_187314_a(k3, l3).func_181675_d();
  37332. } else {
  37333. if(j1 != 1) {
  37334. if(j1 >= 0) {
  37335. tessellator.func_78381_a();
  37336. }
  37337.  
  37338. j1 = 1;
  37339. this.field_78531_r.func_110434_K().func_110577_a(field_110923_r);
  37340. bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181704_d);
  37341. }
  37342.  
  37343. double d8 = (double)(-((float)(this.field_78529_t & 511) + p_78474_1_) / 512.0F);
  37344. double d9 = this.field_78537_ab.nextDouble() + (double)f1 * 0.01D * (double)((float)this.field_78537_ab.nextGaussian());
  37345. double d10 = this.field_78537_ab.nextDouble() + (double)(f1 * (float)this.field_78537_ab.nextGaussian()) * 0.001D;
  37346. double d11 = (double)((float)l1 + 0.5F) - entity.field_70165_t;
  37347. double d12 = (double)((float)k1 + 0.5F) - entity.field_70161_v;
  37348. float f6 = MathHelper.func_76133_a(d11 * d11 + d12 * d12) / (float)i1;
  37349. float f5 = ((1.0F - f6 * f6) * 0.3F + 0.5F) * f;
  37350. blockpos$mutableblockpos.func_181079_c(l1, i3, k1);
  37351. int i4 = (world.func_175626_b(blockpos$mutableblockpos, 0) * 3 + 15728880) / 4;
  37352. int j4 = i4 >> 16 & '\uffff';
  37353. int k4 = i4 & '\uffff';
  37354. bufferbuilder.func_181662_b((double)l1 - d3 + 0.5D, (double)l2, (double)k1 - d4 + 0.5D).func_187315_a(0.0D + d9, (double)k2 * 0.25D + d8 + d10).func_181666_a(1.0F, 1.0F, 1.0F, f5).func_187314_a(j4, k4).func_181675_d();
  37355. bufferbuilder.func_181662_b((double)l1 + d3 + 0.5D, (double)l2, (double)k1 + d4 + 0.5D).func_187315_a(1.0D + d9, (double)k2 * 0.25D + d8 + d10).func_181666_a(1.0F, 1.0F, 1.0F, f5).func_187314_a(j4, k4).func_181675_d();
  37356. bufferbuilder.func_181662_b((double)l1 + d3 + 0.5D, (double)k2, (double)k1 + d4 + 0.5D).func_187315_a(1.0D + d9, (double)l2 * 0.25D + d8 + d10).func_181666_a(1.0F, 1.0F, 1.0F, f5).func_187314_a(j4, k4).func_181675_d();
  37357. bufferbuilder.func_181662_b((double)l1 - d3 + 0.5D, (double)k2, (double)k1 - d4 + 0.5D).func_187315_a(0.0D + d9, (double)l2 * 0.25D + d8 + d10).func_181666_a(1.0F, 1.0F, 1.0F, f5).func_187314_a(j4, k4).func_181675_d();
  37358. }
  37359. }
  37360. }
  37361. }
  37362. }
  37363.  
  37364. if(j1 >= 0) {
  37365. tessellator.func_78381_a();
  37366. }
  37367.  
  37368. bufferbuilder.func_178969_c(0.0D, 0.0D, 0.0D);
  37369. GlStateManager.func_179089_o();
  37370. GlStateManager.func_179084_k();
  37371. GlStateManager.func_179092_a(516, 0.1F);
  37372. this.func_175072_h();
  37373. }
  37374. }
  37375.  
  37376. public void func_78478_c() {
  37377. ScaledResolution scaledresolution = new ScaledResolution(this.field_78531_r);
  37378. GlStateManager.func_179086_m(256);
  37379. GlStateManager.func_179128_n(5889);
  37380. GlStateManager.func_179096_D();
  37381. GlStateManager.func_179130_a(0.0D, scaledresolution.func_78327_c(), scaledresolution.func_78324_d(), 0.0D, 1000.0D, 3000.0D);
  37382. GlStateManager.func_179128_n(5888);
  37383. GlStateManager.func_179096_D();
  37384. GlStateManager.func_179109_b(0.0F, 0.0F, -2000.0F);
  37385. }
  37386.  
  37387. private void func_78466_h(float p_78466_1_) {
  37388. World world = this.field_78531_r.field_71441_e;
  37389. Entity entity = this.field_78531_r.func_175606_aa();
  37390. float f = 0.25F + 0.75F * (float)this.field_78531_r.field_71474_y.field_151451_c / 32.0F;
  37391. f = 1.0F - (float)Math.pow((double)f, 0.25D);
  37392. Vec3d vec3d = world.func_72833_a(this.field_78531_r.func_175606_aa(), p_78466_1_);
  37393. float f1 = (float)vec3d.field_72450_a;
  37394. float f2 = (float)vec3d.field_72448_b;
  37395. float f3 = (float)vec3d.field_72449_c;
  37396. Vec3d vec3d1 = world.func_72948_g(p_78466_1_);
  37397. this.field_175080_Q = (float)vec3d1.field_72450_a;
  37398. this.field_175082_R = (float)vec3d1.field_72448_b;
  37399. this.field_175081_S = (float)vec3d1.field_72449_c;
  37400. if(this.field_78531_r.field_71474_y.field_151451_c >= 4) {
  37401. double d0 = MathHelper.func_76126_a(world.func_72929_e(p_78466_1_)) > 0.0F?-1.0D:1.0D;
  37402. Vec3d vec3d2 = new Vec3d(d0, 0.0D, 0.0D);
  37403. float f5 = (float)entity.func_70676_i(p_78466_1_).func_72430_b(vec3d2);
  37404. if(f5 < 0.0F) {
  37405. f5 = 0.0F;
  37406. }
  37407.  
  37408. if(f5 > 0.0F) {
  37409. float[] afloat = world.field_73011_w.func_76560_a(world.func_72826_c(p_78466_1_), p_78466_1_);
  37410. if(afloat != null) {
  37411. f5 = f5 * afloat[3];
  37412. this.field_175080_Q = this.field_175080_Q * (1.0F - f5) + afloat[0] * f5;
  37413. this.field_175082_R = this.field_175082_R * (1.0F - f5) + afloat[1] * f5;
  37414. this.field_175081_S = this.field_175081_S * (1.0F - f5) + afloat[2] * f5;
  37415. }
  37416. }
  37417. }
  37418.  
  37419. this.field_175080_Q += (f1 - this.field_175080_Q) * f;
  37420. this.field_175082_R += (f2 - this.field_175082_R) * f;
  37421. this.field_175081_S += (f3 - this.field_175081_S) * f;
  37422. float f8 = world.func_72867_j(p_78466_1_);
  37423. if(f8 > 0.0F) {
  37424. float f4 = 1.0F - f8 * 0.5F;
  37425. float f10 = 1.0F - f8 * 0.4F;
  37426. this.field_175080_Q *= f4;
  37427. this.field_175082_R *= f4;
  37428. this.field_175081_S *= f10;
  37429. }
  37430.  
  37431. float f9 = world.func_72819_i(p_78466_1_);
  37432. if(f9 > 0.0F) {
  37433. float f11 = 1.0F - f9 * 0.5F;
  37434. this.field_175080_Q *= f11;
  37435. this.field_175082_R *= f11;
  37436. this.field_175081_S *= f11;
  37437. }
  37438.  
  37439. IBlockState iblockstate = ActiveRenderInfo.func_186703_a(this.field_78531_r.field_71441_e, entity, p_78466_1_);
  37440. if(this.field_78500_U) {
  37441. Vec3d vec3d3 = world.func_72824_f(p_78466_1_);
  37442. this.field_175080_Q = (float)vec3d3.field_72450_a;
  37443. this.field_175082_R = (float)vec3d3.field_72448_b;
  37444. this.field_175081_S = (float)vec3d3.field_72449_c;
  37445. } else if(iblockstate.func_185904_a() == Material.field_151586_h) {
  37446. float f12 = 0.0F;
  37447. if(entity instanceof EntityLivingBase) {
  37448. f12 = (float)EnchantmentHelper.func_185292_c((EntityLivingBase)entity) * 0.2F;
  37449. if(((EntityLivingBase)entity).func_70644_a(MobEffects.field_76427_o)) {
  37450. f12 = f12 * 0.3F + 0.6F;
  37451. }
  37452. }
  37453.  
  37454. this.field_175080_Q = 0.02F + f12;
  37455. this.field_175082_R = 0.02F + f12;
  37456. this.field_175081_S = 0.2F + f12;
  37457. } else if(iblockstate.func_185904_a() == Material.field_151587_i) {
  37458. this.field_175080_Q = 0.6F;
  37459. this.field_175082_R = 0.1F;
  37460. this.field_175081_S = 0.0F;
  37461. }
  37462.  
  37463. float f13 = this.field_78535_ad + (this.field_78539_ae - this.field_78535_ad) * p_78466_1_;
  37464. this.field_175080_Q *= f13;
  37465. this.field_175082_R *= f13;
  37466. this.field_175081_S *= f13;
  37467. double d1 = (entity.field_70137_T + (entity.field_70163_u - entity.field_70137_T) * (double)p_78466_1_) * world.field_73011_w.func_76565_k();
  37468. if(entity instanceof EntityLivingBase && ((EntityLivingBase)entity).func_70644_a(MobEffects.field_76440_q)) {
  37469. int i = ((EntityLivingBase)entity).func_70660_b(MobEffects.field_76440_q).func_76459_b();
  37470. if(i < 20) {
  37471. d1 *= (double)(1.0F - (float)i / 20.0F);
  37472. } else {
  37473. d1 = 0.0D;
  37474. }
  37475. }
  37476.  
  37477. if(d1 < 1.0D) {
  37478. if(d1 < 0.0D) {
  37479. d1 = 0.0D;
  37480. }
  37481.  
  37482. d1 = d1 * d1;
  37483. this.field_175080_Q = (float)((double)this.field_175080_Q * d1);
  37484. this.field_175082_R = (float)((double)this.field_175082_R * d1);
  37485. this.field_175081_S = (float)((double)this.field_175081_S * d1);
  37486. }
  37487.  
  37488. if(this.field_82831_U > 0.0F) {
  37489. float f14 = this.field_82832_V + (this.field_82831_U - this.field_82832_V) * p_78466_1_;
  37490. this.field_175080_Q = this.field_175080_Q * (1.0F - f14) + this.field_175080_Q * 0.7F * f14;
  37491. this.field_175082_R = this.field_175082_R * (1.0F - f14) + this.field_175082_R * 0.6F * f14;
  37492. this.field_175081_S = this.field_175081_S * (1.0F - f14) + this.field_175081_S * 0.6F * f14;
  37493. }
  37494.  
  37495. if(entity instanceof EntityLivingBase && ((EntityLivingBase)entity).func_70644_a(MobEffects.field_76439_r)) {
  37496. float f15 = this.func_180438_a((EntityLivingBase)entity, p_78466_1_);
  37497. float f6 = 1.0F / this.field_175080_Q;
  37498. if(f6 > 1.0F / this.field_175082_R) {
  37499. f6 = 1.0F / this.field_175082_R;
  37500. }
  37501.  
  37502. if(f6 > 1.0F / this.field_175081_S) {
  37503. f6 = 1.0F / this.field_175081_S;
  37504. }
  37505.  
  37506. this.field_175080_Q = this.field_175080_Q * (1.0F - f15) + this.field_175080_Q * f6 * f15;
  37507. this.field_175082_R = this.field_175082_R * (1.0F - f15) + this.field_175082_R * f6 * f15;
  37508. this.field_175081_S = this.field_175081_S * (1.0F - f15) + this.field_175081_S * f6 * f15;
  37509. }
  37510.  
  37511. if(this.field_78531_r.field_71474_y.field_74337_g) {
  37512. float f16 = (this.field_175080_Q * 30.0F + this.field_175082_R * 59.0F + this.field_175081_S * 11.0F) / 100.0F;
  37513. float f17 = (this.field_175080_Q * 30.0F + this.field_175082_R * 70.0F) / 100.0F;
  37514. float f7 = (this.field_175080_Q * 30.0F + this.field_175081_S * 70.0F) / 100.0F;
  37515. this.field_175080_Q = f16;
  37516. this.field_175082_R = f17;
  37517. this.field_175081_S = f7;
  37518. }
  37519.  
  37520. GlStateManager.func_179082_a(this.field_175080_Q, this.field_175082_R, this.field_175081_S, 0.0F);
  37521. }
  37522.  
  37523. private void func_78468_a(int p_78468_1_, float p_78468_2_) {
  37524. Entity entity = this.field_78531_r.func_175606_aa();
  37525. this.func_191514_d(false);
  37526. GlStateManager.func_187432_a(0.0F, -1.0F, 0.0F);
  37527. GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
  37528. IBlockState iblockstate = ActiveRenderInfo.func_186703_a(this.field_78531_r.field_71441_e, entity, p_78468_2_);
  37529. if(entity instanceof EntityLivingBase && ((EntityLivingBase)entity).func_70644_a(MobEffects.field_76440_q)) {
  37530. float f1 = 5.0F;
  37531. int i = ((EntityLivingBase)entity).func_70660_b(MobEffects.field_76440_q).func_76459_b();
  37532. if(i < 20) {
  37533. f1 = 5.0F + (this.field_78530_s - 5.0F) * (1.0F - (float)i / 20.0F);
  37534. }
  37535.  
  37536. GlStateManager.func_187430_a(GlStateManager.FogMode.LINEAR);
  37537. if(p_78468_1_ == -1) {
  37538. GlStateManager.func_179102_b(0.0F);
  37539. GlStateManager.func_179153_c(f1 * 0.8F);
  37540. } else {
  37541. GlStateManager.func_179102_b(f1 * 0.25F);
  37542. GlStateManager.func_179153_c(f1);
  37543. }
  37544.  
  37545. if(GLContext.getCapabilities().GL_NV_fog_distance) {
  37546. GlStateManager.func_187412_c('\u855a', '\u855b');
  37547. }
  37548. } else if(this.field_78500_U) {
  37549. GlStateManager.func_187430_a(GlStateManager.FogMode.EXP);
  37550. GlStateManager.func_179095_a(0.1F);
  37551. } else if(iblockstate.func_185904_a() == Material.field_151586_h) {
  37552. GlStateManager.func_187430_a(GlStateManager.FogMode.EXP);
  37553. if(entity instanceof EntityLivingBase) {
  37554. if(((EntityLivingBase)entity).func_70644_a(MobEffects.field_76427_o)) {
  37555. GlStateManager.func_179095_a(0.01F);
  37556. } else {
  37557. GlStateManager.func_179095_a(0.1F - (float)EnchantmentHelper.func_185292_c((EntityLivingBase)entity) * 0.03F);
  37558. }
  37559. } else {
  37560. GlStateManager.func_179095_a(0.1F);
  37561. }
  37562. } else if(iblockstate.func_185904_a() == Material.field_151587_i) {
  37563. GlStateManager.func_187430_a(GlStateManager.FogMode.EXP);
  37564. GlStateManager.func_179095_a(2.0F);
  37565. } else {
  37566. float f = this.field_78530_s;
  37567. GlStateManager.func_187430_a(GlStateManager.FogMode.LINEAR);
  37568. if(p_78468_1_ == -1) {
  37569. GlStateManager.func_179102_b(0.0F);
  37570. GlStateManager.func_179153_c(f);
  37571. } else {
  37572. GlStateManager.func_179102_b(f * 0.75F);
  37573. GlStateManager.func_179153_c(f);
  37574. }
  37575.  
  37576. if(GLContext.getCapabilities().GL_NV_fog_distance) {
  37577. GlStateManager.func_187412_c('\u855a', '\u855b');
  37578. }
  37579.  
  37580. if(this.field_78531_r.field_71441_e.field_73011_w.func_76568_b((int)entity.field_70165_t, (int)entity.field_70161_v) || this.field_78531_r.field_71456_v.func_184046_j().func_184056_f()) {
  37581. GlStateManager.func_179102_b(f * 0.05F);
  37582. GlStateManager.func_179153_c(Math.min(f, 192.0F) * 0.5F);
  37583. }
  37584. }
  37585.  
  37586. GlStateManager.func_179142_g();
  37587. GlStateManager.func_179127_m();
  37588. GlStateManager.func_179104_a(1028, 4608);
  37589. }
  37590.  
  37591. public void func_191514_d(boolean p_191514_1_) {
  37592. if(p_191514_1_) {
  37593. GlStateManager.func_187402_b(2918, this.func_78469_a(0.0F, 0.0F, 0.0F, 1.0F));
  37594. } else {
  37595. GlStateManager.func_187402_b(2918, this.func_78469_a(this.field_175080_Q, this.field_175082_R, this.field_175081_S, 1.0F));
  37596. }
  37597.  
  37598. }
  37599.  
  37600. private FloatBuffer func_78469_a(float p_78469_1_, float p_78469_2_, float p_78469_3_, float p_78469_4_) {
  37601. this.field_78521_m.clear();
  37602. this.field_78521_m.put(p_78469_1_).put(p_78469_2_).put(p_78469_3_).put(p_78469_4_);
  37603. this.field_78521_m.flip();
  37604. return this.field_78521_m;
  37605. }
  37606.  
  37607. public void func_190564_k() {
  37608. this.field_190566_ab = null;
  37609. this.field_147709_v.func_148249_a();
  37610. }
  37611.  
  37612. public MapItemRenderer func_147701_i() {
  37613. return this.field_147709_v;
  37614. }
  37615.  
  37616. public static void func_189692_a(FontRenderer p_189692_0_, String p_189692_1_, float p_189692_2_, float p_189692_3_, float p_189692_4_, int p_189692_5_, float p_189692_6_, float p_189692_7_, boolean p_189692_8_, boolean p_189692_9_) {
  37617. GlStateManager.func_179094_E();
  37618. GlStateManager.func_179109_b(p_189692_2_, p_189692_3_, p_189692_4_);
  37619. GlStateManager.func_187432_a(0.0F, 1.0F, 0.0F);
  37620. GlStateManager.func_179114_b(-p_189692_6_, 0.0F, 1.0F, 0.0F);
  37621. GlStateManager.func_179114_b((float)(p_189692_8_?-1:1) * p_189692_7_, 1.0F, 0.0F, 0.0F);
  37622. GlStateManager.func_179152_a(-0.025F, -0.025F, 0.025F);
  37623. GlStateManager.func_179140_f();
  37624. GlStateManager.func_179132_a(false);
  37625. if(!p_189692_9_) {
  37626. GlStateManager.func_179097_i();
  37627. }
  37628.  
  37629. GlStateManager.func_179147_l();
  37630. GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
  37631. int i = p_189692_0_.func_78256_a(p_189692_1_) / 2;
  37632. GlStateManager.func_179090_x();
  37633. Tessellator tessellator = Tessellator.func_178181_a();
  37634. BufferBuilder bufferbuilder = tessellator.func_178180_c();
  37635. bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181706_f);
  37636. bufferbuilder.func_181662_b((double)(-i - 1), (double)(-1 + p_189692_5_), 0.0D).func_181666_a(0.0F, 0.0F, 0.0F, 0.25F).func_181675_d();
  37637. bufferbuilder.func_181662_b((double)(-i - 1), (double)(8 + p_189692_5_), 0.0D).func_181666_a(0.0F, 0.0F, 0.0F, 0.25F).func_181675_d();
  37638. bufferbuilder.func_181662_b((double)(i + 1), (double)(8 + p_189692_5_), 0.0D).func_181666_a(0.0F, 0.0F, 0.0F, 0.25F).func_181675_d();
  37639. bufferbuilder.func_181662_b((double)(i + 1), (double)(-1 + p_189692_5_), 0.0D).func_181666_a(0.0F, 0.0F, 0.0F, 0.25F).func_181675_d();
  37640. tessellator.func_78381_a();
  37641. GlStateManager.func_179098_w();
  37642. if(!p_189692_9_) {
  37643. p_189692_0_.func_78276_b(p_189692_1_, -p_189692_0_.func_78256_a(p_189692_1_) / 2, p_189692_5_, 553648127);
  37644. GlStateManager.func_179126_j();
  37645. }
  37646.  
  37647. GlStateManager.func_179132_a(true);
  37648. p_189692_0_.func_78276_b(p_189692_1_, -p_189692_0_.func_78256_a(p_189692_1_) / 2, p_189692_5_, p_189692_9_?553648127:-1);
  37649. GlStateManager.func_179145_e();
  37650. GlStateManager.func_179084_k();
  37651. GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
  37652. GlStateManager.func_179121_F();
  37653. }
  37654.  
  37655. public void func_190565_a(ItemStack p_190565_1_) {
  37656. this.field_190566_ab = p_190565_1_;
  37657. this.field_190567_ac = 40;
  37658. this.field_190568_ad = this.field_78537_ab.nextFloat() * 2.0F - 1.0F;
  37659. this.field_190569_ae = this.field_78537_ab.nextFloat() * 2.0F - 1.0F;
  37660. }
  37661.  
  37662. private void func_190563_a(int p_190563_1_, int p_190563_2_, float p_190563_3_) {
  37663. if(this.field_190566_ab != null && this.field_190567_ac > 0) {
  37664. int i = 40 - this.field_190567_ac;
  37665. float f = ((float)i + p_190563_3_) / 40.0F;
  37666. float f1 = f * f;
  37667. float f2 = f * f1;
  37668. float f3 = 10.25F * f2 * f1 + -24.95F * f1 * f1 + 25.5F * f2 + -13.8F * f1 + 4.0F * f;
  37669. float f4 = f3 * 3.1415927F;
  37670. float f5 = this.field_190568_ad * (float)(p_190563_1_ / 4);
  37671. float f6 = this.field_190569_ae * (float)(p_190563_2_ / 4);
  37672. GlStateManager.func_179141_d();
  37673. GlStateManager.func_179094_E();
  37674. GlStateManager.func_179123_a();
  37675. GlStateManager.func_179126_j();
  37676. GlStateManager.func_179129_p();
  37677. RenderHelper.func_74519_b();
  37678. GlStateManager.func_179109_b((float)(p_190563_1_ / 2) + f5 * MathHelper.func_76135_e(MathHelper.func_76126_a(f4 * 2.0F)), (float)(p_190563_2_ / 2) + f6 * MathHelper.func_76135_e(MathHelper.func_76126_a(f4 * 2.0F)), -50.0F);
  37679. float f7 = 50.0F + 175.0F * MathHelper.func_76126_a(f4);
  37680. GlStateManager.func_179152_a(f7, -f7, f7);
  37681. GlStateManager.func_179114_b(900.0F * MathHelper.func_76135_e(MathHelper.func_76126_a(f4)), 0.0F, 1.0F, 0.0F);
  37682. GlStateManager.func_179114_b(6.0F * MathHelper.func_76134_b(f * 8.0F), 1.0F, 0.0F, 0.0F);
  37683. GlStateManager.func_179114_b(6.0F * MathHelper.func_76134_b(f * 8.0F), 0.0F, 0.0F, 1.0F);
  37684. this.field_78531_r.func_175599_af().func_181564_a(this.field_190566_ab, ItemCameraTransforms.TransformType.FIXED);
  37685. GlStateManager.func_179099_b();
  37686. GlStateManager.func_179121_F();
  37687. RenderHelper.func_74518_a();
  37688. GlStateManager.func_179089_o();
  37689. GlStateManager.func_179097_i();
  37690. }
  37691. }
  37692. }
  37693.  
  37694. Patching failed: minecraft\net\minecraft\client\renderer\ItemRenderer.java
  37695. Hunk 1 failed! Cannot find hunk target
  37696. GlStateManager.func_179114_b(200.0F, 1.0F, 0.0F, 0.0F);
  37697. GlStateManager.func_179114_b(f * -135.0F, 0.0F, 1.0F, 0.0F);
  37698. GlStateManager.func_179109_b(f * 5.6F, 0.0F, 0.0F);
  37699. - RenderPlayer renderplayer = (RenderPlayer)this.field_178111_g.func_78713_a(abstractclientplayer);
  37700. + RenderPlayer renderplayer = (RenderPlayer)this.field_178111_g.<AbstractClientPlayer>func_78713_a(abstractclientplayer);
  37701. GlStateManager.func_179129_p();
  37702. if (flag) {
  37703. renderplayer.func_177138_b(abstractclientplayer);
  37704. File state
  37705. package net.minecraft.client.renderer;
  37706.  
  37707. import com.google.common.base.MoreObjects;
  37708. import java.util.Objects;
  37709. import net.minecraft.block.Block;
  37710. import net.minecraft.block.material.Material;
  37711. import net.minecraft.block.state.IBlockState;
  37712. import net.minecraft.client.Minecraft;
  37713. import net.minecraft.client.entity.AbstractClientPlayer;
  37714. import net.minecraft.client.entity.EntityPlayerSP;
  37715. import net.minecraft.client.renderer.BufferBuilder;
  37716. import net.minecraft.client.renderer.GlStateManager;
  37717. import net.minecraft.client.renderer.OpenGlHelper;
  37718. import net.minecraft.client.renderer.RenderHelper;
  37719. import net.minecraft.client.renderer.RenderItem;
  37720. import net.minecraft.client.renderer.Tessellator;
  37721. import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
  37722. import net.minecraft.client.renderer.entity.Render;
  37723. import net.minecraft.client.renderer.entity.RenderManager;
  37724. import net.minecraft.client.renderer.entity.RenderPlayer;
  37725. import net.minecraft.client.renderer.texture.TextureAtlasSprite;
  37726. import net.minecraft.client.renderer.texture.TextureMap;
  37727. import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
  37728. import net.minecraft.entity.EntityLivingBase;
  37729. import net.minecraft.entity.player.EntityPlayer;
  37730. import net.minecraft.init.Items;
  37731. import net.minecraft.item.Item;
  37732. import net.minecraft.item.ItemStack;
  37733. import net.minecraft.util.BlockRenderLayer;
  37734. import net.minecraft.util.EnumBlockRenderType;
  37735. import net.minecraft.util.EnumHand;
  37736. import net.minecraft.util.EnumHandSide;
  37737. import net.minecraft.util.ResourceLocation;
  37738. import net.minecraft.util.math.BlockPos;
  37739. import net.minecraft.util.math.MathHelper;
  37740. import net.minecraft.world.storage.MapData;
  37741. import net.minecraftforge.fml.relauncher.Side;
  37742. import net.minecraftforge.fml.relauncher.SideOnly;
  37743.  
  37744. @SideOnly(Side.CLIENT)
  37745. public class ItemRenderer {
  37746. private static final ResourceLocation field_110931_c = new ResourceLocation("textures/map/map_background.png");
  37747. private static final ResourceLocation field_110929_d = new ResourceLocation("textures/misc/underwater.png");
  37748. private final Minecraft field_78455_a;
  37749. private ItemStack field_187467_d = ItemStack.field_190927_a;
  37750. private ItemStack field_187468_e = ItemStack.field_190927_a;
  37751. private float field_187469_f;
  37752. private float field_187470_g;
  37753. private float field_187471_h;
  37754. private float field_187472_i;
  37755. private final RenderManager field_178111_g;
  37756. private final RenderItem field_178112_h;
  37757.  
  37758. public ItemRenderer(Minecraft p_i1247_1_) {
  37759. this.field_78455_a = p_i1247_1_;
  37760. this.field_178111_g = p_i1247_1_.func_175598_ae();
  37761. this.field_178112_h = p_i1247_1_.func_175599_af();
  37762. }
  37763.  
  37764. public void func_178099_a(EntityLivingBase p_178099_1_, ItemStack p_178099_2_, ItemCameraTransforms.TransformType p_178099_3_) {
  37765. this.func_187462_a(p_178099_1_, p_178099_2_, p_178099_3_, false);
  37766. }
  37767.  
  37768. public void func_187462_a(EntityLivingBase p_187462_1_, ItemStack p_187462_2_, ItemCameraTransforms.TransformType p_187462_3_, boolean p_187462_4_) {
  37769. if(!p_187462_2_.func_190926_b()) {
  37770. Item item = p_187462_2_.func_77973_b();
  37771. Block block = Block.func_149634_a(item);
  37772. GlStateManager.func_179094_E();
  37773. boolean flag = this.field_178112_h.func_175050_a(p_187462_2_) && block.func_180664_k() == BlockRenderLayer.TRANSLUCENT;
  37774. if(flag) {
  37775. GlStateManager.func_179132_a(false);
  37776. }
  37777.  
  37778. this.field_178112_h.func_184392_a(p_187462_2_, p_187462_1_, p_187462_3_, p_187462_4_);
  37779. if(flag) {
  37780. GlStateManager.func_179132_a(true);
  37781. }
  37782.  
  37783. GlStateManager.func_179121_F();
  37784. }
  37785. }
  37786.  
  37787. private void func_178101_a(float p_178101_1_, float p_178101_2_) {
  37788. GlStateManager.func_179094_E();
  37789. GlStateManager.func_179114_b(p_178101_1_, 1.0F, 0.0F, 0.0F);
  37790. GlStateManager.func_179114_b(p_178101_2_, 0.0F, 1.0F, 0.0F);
  37791. RenderHelper.func_74519_b();
  37792. GlStateManager.func_179121_F();
  37793. }
  37794.  
  37795. private void func_187464_b() {
  37796. AbstractClientPlayer abstractclientplayer = this.field_78455_a.field_71439_g;
  37797. int i = this.field_78455_a.field_71441_e.func_175626_b(new BlockPos(abstractclientplayer.field_70165_t, abstractclientplayer.field_70163_u + (double)abstractclientplayer.func_70047_e(), abstractclientplayer.field_70161_v), 0);
  37798. float f = (float)(i & '\uffff');
  37799. float f1 = (float)(i >> 16);
  37800. OpenGlHelper.func_77475_a(OpenGlHelper.field_77476_b, f, f1);
  37801. }
  37802.  
  37803. private void func_187458_c(float p_187458_1_) {
  37804. EntityPlayerSP entityplayersp = this.field_78455_a.field_71439_g;
  37805. float f = entityplayersp.field_71164_i + (entityplayersp.field_71155_g - entityplayersp.field_71164_i) * p_187458_1_;
  37806. float f1 = entityplayersp.field_71163_h + (entityplayersp.field_71154_f - entityplayersp.field_71163_h) * p_187458_1_;
  37807. GlStateManager.func_179114_b((entityplayersp.field_70125_A - f) * 0.1F, 1.0F, 0.0F, 0.0F);
  37808. GlStateManager.func_179114_b((entityplayersp.field_70177_z - f1) * 0.1F, 0.0F, 1.0F, 0.0F);
  37809. }
  37810.  
  37811. private float func_178100_c(float p_178100_1_) {
  37812. float f = 1.0F - p_178100_1_ / 45.0F + 0.1F;
  37813. f = MathHelper.func_76131_a(f, 0.0F, 1.0F);
  37814. f = -MathHelper.func_76134_b(f * 3.1415927F) * 0.5F + 0.5F;
  37815. return f;
  37816. }
  37817.  
  37818. private void func_187466_c() {
  37819. if(!this.field_78455_a.field_71439_g.func_82150_aj()) {
  37820. GlStateManager.func_179129_p();
  37821. GlStateManager.func_179094_E();
  37822. GlStateManager.func_179114_b(90.0F, 0.0F, 1.0F, 0.0F);
  37823. this.func_187455_a(EnumHandSide.RIGHT);
  37824. this.func_187455_a(EnumHandSide.LEFT);
  37825. GlStateManager.func_179121_F();
  37826. GlStateManager.func_179089_o();
  37827. }
  37828. }
  37829.  
  37830. private void func_187455_a(EnumHandSide p_187455_1_) {
  37831. this.field_78455_a.func_110434_K().func_110577_a(this.field_78455_a.field_71439_g.func_110306_p());
  37832. Render<AbstractClientPlayer> render = this.field_178111_g.<AbstractClientPlayer>func_78713_a(this.field_78455_a.field_71439_g);
  37833. RenderPlayer renderplayer = (RenderPlayer)render;
  37834. GlStateManager.func_179094_E();
  37835. float f = p_187455_1_ == EnumHandSide.RIGHT?1.0F:-1.0F;
  37836. GlStateManager.func_179114_b(92.0F, 0.0F, 1.0F, 0.0F);
  37837. GlStateManager.func_179114_b(45.0F, 1.0F, 0.0F, 0.0F);
  37838. GlStateManager.func_179114_b(f * -41.0F, 0.0F, 0.0F, 1.0F);
  37839. GlStateManager.func_179109_b(f * 0.3F, -1.1F, 0.45F);
  37840. if(p_187455_1_ == EnumHandSide.RIGHT) {
  37841. renderplayer.func_177138_b(this.field_78455_a.field_71439_g);
  37842. } else {
  37843. renderplayer.func_177139_c(this.field_78455_a.field_71439_g);
  37844. }
  37845.  
  37846. GlStateManager.func_179121_F();
  37847. }
  37848.  
  37849. private void func_187465_a(float p_187465_1_, EnumHandSide p_187465_2_, float p_187465_3_, ItemStack p_187465_4_) {
  37850. float f = p_187465_2_ == EnumHandSide.RIGHT?1.0F:-1.0F;
  37851. GlStateManager.func_179109_b(f * 0.125F, -0.125F, 0.0F);
  37852. if(!this.field_78455_a.field_71439_g.func_82150_aj()) {
  37853. GlStateManager.func_179094_E();
  37854. GlStateManager.func_179114_b(f * 10.0F, 0.0F, 0.0F, 1.0F);
  37855. this.func_187456_a(p_187465_1_, p_187465_3_, p_187465_2_);
  37856. GlStateManager.func_179121_F();
  37857. }
  37858.  
  37859. GlStateManager.func_179094_E();
  37860. GlStateManager.func_179109_b(f * 0.51F, -0.08F + p_187465_1_ * -1.2F, -0.75F);
  37861. float f1 = MathHelper.func_76129_c(p_187465_3_);
  37862. float f2 = MathHelper.func_76126_a(f1 * 3.1415927F);
  37863. float f3 = -0.5F * f2;
  37864. float f4 = 0.4F * MathHelper.func_76126_a(f1 * 6.2831855F);
  37865. float f5 = -0.3F * MathHelper.func_76126_a(p_187465_3_ * 3.1415927F);
  37866. GlStateManager.func_179109_b(f * f3, f4 - 0.3F * f2, f5);
  37867. GlStateManager.func_179114_b(f2 * -45.0F, 1.0F, 0.0F, 0.0F);
  37868. GlStateManager.func_179114_b(f * f2 * -30.0F, 0.0F, 1.0F, 0.0F);
  37869. this.func_187461_a(p_187465_4_);
  37870. GlStateManager.func_179121_F();
  37871. }
  37872.  
  37873. private void func_187463_a(float p_187463_1_, float p_187463_2_, float p_187463_3_) {
  37874. float f = MathHelper.func_76129_c(p_187463_3_);
  37875. float f1 = -0.2F * MathHelper.func_76126_a(p_187463_3_ * 3.1415927F);
  37876. float f2 = -0.4F * MathHelper.func_76126_a(f * 3.1415927F);
  37877. GlStateManager.func_179109_b(0.0F, -f1 / 2.0F, f2);
  37878. float f3 = this.func_178100_c(p_187463_1_);
  37879. GlStateManager.func_179109_b(0.0F, 0.04F + p_187463_2_ * -1.2F + f3 * -0.5F, -0.72F);
  37880. GlStateManager.func_179114_b(f3 * -85.0F, 1.0F, 0.0F, 0.0F);
  37881. this.func_187466_c();
  37882. float f4 = MathHelper.func_76126_a(f * 3.1415927F);
  37883. GlStateManager.func_179114_b(f4 * 20.0F, 1.0F, 0.0F, 0.0F);
  37884. GlStateManager.func_179152_a(2.0F, 2.0F, 2.0F);
  37885. this.func_187461_a(this.field_187467_d);
  37886. }
  37887.  
  37888. private void func_187461_a(ItemStack p_187461_1_) {
  37889. GlStateManager.func_179114_b(180.0F, 0.0F, 1.0F, 0.0F);
  37890. GlStateManager.func_179114_b(180.0F, 0.0F, 0.0F, 1.0F);
  37891. GlStateManager.func_179152_a(0.38F, 0.38F, 0.38F);
  37892. GlStateManager.func_179140_f();
  37893. this.field_78455_a.func_110434_K().func_110577_a(field_110931_c);
  37894. Tessellator tessellator = Tessellator.func_178181_a();
  37895. BufferBuilder bufferbuilder = tessellator.func_178180_c();
  37896. GlStateManager.func_179109_b(-0.5F, -0.5F, 0.0F);
  37897. GlStateManager.func_179152_a(0.0078125F, 0.0078125F, 0.0078125F);
  37898. bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181707_g);
  37899. bufferbuilder.func_181662_b(-7.0D, 135.0D, 0.0D).func_187315_a(0.0D, 1.0D).func_181675_d();
  37900. bufferbuilder.func_181662_b(135.0D, 135.0D, 0.0D).func_187315_a(1.0D, 1.0D).func_181675_d();
  37901. bufferbuilder.func_181662_b(135.0D, -7.0D, 0.0D).func_187315_a(1.0D, 0.0D).func_181675_d();
  37902. bufferbuilder.func_181662_b(-7.0D, -7.0D, 0.0D).func_187315_a(0.0D, 0.0D).func_181675_d();
  37903. tessellator.func_78381_a();
  37904. MapData mapdata = Items.field_151098_aY.func_77873_a(p_187461_1_, this.field_78455_a.field_71441_e);
  37905. if(mapdata != null) {
  37906. this.field_78455_a.field_71460_t.func_147701_i().func_148250_a(mapdata, false);
  37907. }
  37908.  
  37909. GlStateManager.func_179145_e();
  37910. }
  37911.  
  37912. private void func_187456_a(float p_187456_1_, float p_187456_2_, EnumHandSide p_187456_3_) {
  37913. boolean flag = p_187456_3_ != EnumHandSide.LEFT;
  37914. float f = flag?1.0F:-1.0F;
  37915. float f1 = MathHelper.func_76129_c(p_187456_2_);
  37916. float f2 = -0.3F * MathHelper.func_76126_a(f1 * 3.1415927F);
  37917. float f3 = 0.4F * MathHelper.func_76126_a(f1 * 6.2831855F);
  37918. float f4 = -0.4F * MathHelper.func_76126_a(p_187456_2_ * 3.1415927F);
  37919. GlStateManager.func_179109_b(f * (f2 + 0.64000005F), f3 + -0.6F + p_187456_1_ * -0.6F, f4 + -0.71999997F);
  37920. GlStateManager.func_179114_b(f * 45.0F, 0.0F, 1.0F, 0.0F);
  37921. float f5 = MathHelper.func_76126_a(p_187456_2_ * p_187456_2_ * 3.1415927F);
  37922. float f6 = MathHelper.func_76126_a(f1 * 3.1415927F);
  37923. GlStateManager.func_179114_b(f * f6 * 70.0F, 0.0F, 1.0F, 0.0F);
  37924. GlStateManager.func_179114_b(f * f5 * -20.0F, 0.0F, 0.0F, 1.0F);
  37925. AbstractClientPlayer abstractclientplayer = this.field_78455_a.field_71439_g;
  37926. this.field_78455_a.func_110434_K().func_110577_a(abstractclientplayer.func_110306_p());
  37927. GlStateManager.func_179109_b(f * -1.0F, 3.6F, 3.5F);
  37928. GlStateManager.func_179114_b(f * 120.0F, 0.0F, 0.0F, 1.0F);
  37929. GlStateManager.func_179114_b(200.0F, 1.0F, 0.0F, 0.0F);
  37930. GlStateManager.func_179114_b(f * -135.0F, 0.0F, 1.0F, 0.0F);
  37931. GlStateManager.func_179109_b(f * 5.6F, 0.0F, 0.0F);
  37932. RenderPlayer renderplayer = (RenderPlayer)this.field_178111_g.func_78713_a(abstractclientplayer);
  37933. GlStateManager.func_179129_p();
  37934. if(flag) {
  37935. renderplayer.func_177138_b(abstractclientplayer);
  37936. } else {
  37937. renderplayer.func_177139_c(abstractclientplayer);
  37938. }
  37939.  
  37940. GlStateManager.func_179089_o();
  37941. }
  37942.  
  37943. private void func_187454_a(float p_187454_1_, EnumHandSide p_187454_2_, ItemStack p_187454_3_) {
  37944. float f = (float)this.field_78455_a.field_71439_g.func_184605_cv() - p_187454_1_ + 1.0F;
  37945. float f1 = f / (float)p_187454_3_.func_77988_m();
  37946. if(f1 < 0.8F) {
  37947. float f2 = MathHelper.func_76135_e(MathHelper.func_76134_b(f / 4.0F * 3.1415927F) * 0.1F);
  37948. GlStateManager.func_179109_b(0.0F, f2, 0.0F);
  37949. }
  37950.  
  37951. float f3 = 1.0F - (float)Math.pow((double)f1, 27.0D);
  37952. int i = p_187454_2_ == EnumHandSide.RIGHT?1:-1;
  37953. GlStateManager.func_179109_b(f3 * 0.6F * (float)i, f3 * -0.5F, f3 * 0.0F);
  37954. GlStateManager.func_179114_b((float)i * f3 * 90.0F, 0.0F, 1.0F, 0.0F);
  37955. GlStateManager.func_179114_b(f3 * 10.0F, 1.0F, 0.0F, 0.0F);
  37956. GlStateManager.func_179114_b((float)i * f3 * 30.0F, 0.0F, 0.0F, 1.0F);
  37957. }
  37958.  
  37959. private void func_187453_a(EnumHandSide p_187453_1_, float p_187453_2_) {
  37960. int i = p_187453_1_ == EnumHandSide.RIGHT?1:-1;
  37961. float f = MathHelper.func_76126_a(p_187453_2_ * p_187453_2_ * 3.1415927F);
  37962. GlStateManager.func_179114_b((float)i * (45.0F + f * -20.0F), 0.0F, 1.0F, 0.0F);
  37963. float f1 = MathHelper.func_76126_a(MathHelper.func_76129_c(p_187453_2_) * 3.1415927F);
  37964. GlStateManager.func_179114_b((float)i * f1 * -20.0F, 0.0F, 0.0F, 1.0F);
  37965. GlStateManager.func_179114_b(f1 * -80.0F, 1.0F, 0.0F, 0.0F);
  37966. GlStateManager.func_179114_b((float)i * -45.0F, 0.0F, 1.0F, 0.0F);
  37967. }
  37968.  
  37969. private void func_187459_b(EnumHandSide p_187459_1_, float p_187459_2_) {
  37970. int i = p_187459_1_ == EnumHandSide.RIGHT?1:-1;
  37971. GlStateManager.func_179109_b((float)i * 0.56F, -0.52F + p_187459_2_ * -0.6F, -0.72F);
  37972. }
  37973.  
  37974. public void func_78440_a(float p_78440_1_) {
  37975. AbstractClientPlayer abstractclientplayer = this.field_78455_a.field_71439_g;
  37976. float f = abstractclientplayer.func_70678_g(p_78440_1_);
  37977. EnumHand enumhand = (EnumHand)MoreObjects.firstNonNull(abstractclientplayer.field_184622_au, EnumHand.MAIN_HAND);
  37978. float f1 = abstractclientplayer.field_70127_C + (abstractclientplayer.field_70125_A - abstractclientplayer.field_70127_C) * p_78440_1_;
  37979. float f2 = abstractclientplayer.field_70126_B + (abstractclientplayer.field_70177_z - abstractclientplayer.field_70126_B) * p_78440_1_;
  37980. boolean flag = true;
  37981. boolean flag1 = true;
  37982. if(abstractclientplayer.func_184587_cr()) {
  37983. ItemStack itemstack = abstractclientplayer.func_184607_cu();
  37984. if(itemstack.func_77973_b() == Items.field_151031_f) {
  37985. EnumHand enumhand1 = abstractclientplayer.func_184600_cs();
  37986. flag = enumhand1 == EnumHand.MAIN_HAND;
  37987. flag1 = !flag;
  37988. }
  37989. }
  37990.  
  37991. this.func_178101_a(f1, f2);
  37992. this.func_187464_b();
  37993. this.func_187458_c(p_78440_1_);
  37994. GlStateManager.func_179091_B();
  37995. if(flag) {
  37996. float f3 = enumhand == EnumHand.MAIN_HAND?f:0.0F;
  37997. float f5 = 1.0F - (this.field_187470_g + (this.field_187469_f - this.field_187470_g) * p_78440_1_);
  37998. this.func_187457_a(abstractclientplayer, p_78440_1_, f1, EnumHand.MAIN_HAND, f3, this.field_187467_d, f5);
  37999. }
  38000.  
  38001. if(flag1) {
  38002. float f4 = enumhand == EnumHand.OFF_HAND?f:0.0F;
  38003. float f6 = 1.0F - (this.field_187472_i + (this.field_187471_h - this.field_187472_i) * p_78440_1_);
  38004. this.func_187457_a(abstractclientplayer, p_78440_1_, f1, EnumHand.OFF_HAND, f4, this.field_187468_e, f6);
  38005. }
  38006.  
  38007. GlStateManager.func_179101_C();
  38008. RenderHelper.func_74518_a();
  38009. }
  38010.  
  38011. public void func_187457_a(AbstractClientPlayer p_187457_1_, float p_187457_2_, float p_187457_3_, EnumHand p_187457_4_, float p_187457_5_, ItemStack p_187457_6_, float p_187457_7_) {
  38012. boolean flag = p_187457_4_ == EnumHand.MAIN_HAND;
  38013. EnumHandSide enumhandside = flag?p_187457_1_.func_184591_cq():p_187457_1_.func_184591_cq().func_188468_a();
  38014. GlStateManager.func_179094_E();
  38015. if(p_187457_6_.func_190926_b()) {
  38016. if(flag && !p_187457_1_.func_82150_aj()) {
  38017. this.func_187456_a(p_187457_7_, p_187457_5_, enumhandside);
  38018. }
  38019. } else if(p_187457_6_.func_77973_b() == Items.field_151098_aY) {
  38020. if(flag && this.field_187468_e.func_190926_b()) {
  38021. this.func_187463_a(p_187457_3_, p_187457_7_, p_187457_5_);
  38022. } else {
  38023. this.func_187465_a(p_187457_7_, enumhandside, p_187457_5_, p_187457_6_);
  38024. }
  38025. } else {
  38026. boolean flag1 = enumhandside == EnumHandSide.RIGHT;
  38027. if(p_187457_1_.func_184587_cr() && p_187457_1_.func_184605_cv() > 0 && p_187457_1_.func_184600_cs() == p_187457_4_) {
  38028. int j = flag1?1:-1;
  38029. switch(p_187457_6_.func_77975_n()) {
  38030. case NONE:
  38031. this.func_187459_b(enumhandside, p_187457_7_);
  38032. break;
  38033. case EAT:
  38034. case DRINK:
  38035. this.func_187454_a(p_187457_2_, enumhandside, p_187457_6_);
  38036. this.func_187459_b(enumhandside, p_187457_7_);
  38037. break;
  38038. case BLOCK:
  38039. this.func_187459_b(enumhandside, p_187457_7_);
  38040. break;
  38041. case BOW:
  38042. this.func_187459_b(enumhandside, p_187457_7_);
  38043. GlStateManager.func_179109_b((float)j * -0.2785682F, 0.18344387F, 0.15731531F);
  38044. GlStateManager.func_179114_b(-13.935F, 1.0F, 0.0F, 0.0F);
  38045. GlStateManager.func_179114_b((float)j * 35.3F, 0.0F, 1.0F, 0.0F);
  38046. GlStateManager.func_179114_b((float)j * -9.785F, 0.0F, 0.0F, 1.0F);
  38047. float f5 = (float)p_187457_6_.func_77988_m() - ((float)this.field_78455_a.field_71439_g.func_184605_cv() - p_187457_2_ + 1.0F);
  38048. float f6 = f5 / 20.0F;
  38049. f6 = (f6 * f6 + f6 * 2.0F) / 3.0F;
  38050. if(f6 > 1.0F) {
  38051. f6 = 1.0F;
  38052. }
  38053.  
  38054. if(f6 > 0.1F) {
  38055. float f7 = MathHelper.func_76126_a((f5 - 0.1F) * 1.3F);
  38056. float f3 = f6 - 0.1F;
  38057. float f4 = f7 * f3;
  38058. GlStateManager.func_179109_b(f4 * 0.0F, f4 * 0.004F, f4 * 0.0F);
  38059. }
  38060.  
  38061. GlStateManager.func_179109_b(f6 * 0.0F, f6 * 0.0F, f6 * 0.04F);
  38062. GlStateManager.func_179152_a(1.0F, 1.0F, 1.0F + f6 * 0.2F);
  38063. GlStateManager.func_179114_b((float)j * 45.0F, 0.0F, -1.0F, 0.0F);
  38064. }
  38065. } else {
  38066. float f = -0.4F * MathHelper.func_76126_a(MathHelper.func_76129_c(p_187457_5_) * 3.1415927F);
  38067. float f1 = 0.2F * MathHelper.func_76126_a(MathHelper.func_76129_c(p_187457_5_) * 6.2831855F);
  38068. float f2 = -0.2F * MathHelper.func_76126_a(p_187457_5_ * 3.1415927F);
  38069. int i = flag1?1:-1;
  38070. GlStateManager.func_179109_b((float)i * f, f1, f2);
  38071. this.func_187459_b(enumhandside, p_187457_7_);
  38072. this.func_187453_a(enumhandside, p_187457_5_);
  38073. }
  38074.  
  38075. this.func_187462_a(p_187457_1_, p_187457_6_, flag1?ItemCameraTransforms.TransformType.FIRST_PERSON_RIGHT_HAND:ItemCameraTransforms.TransformType.FIRST_PERSON_LEFT_HAND, !flag1);
  38076. }
  38077.  
  38078. GlStateManager.func_179121_F();
  38079. }
  38080.  
  38081. public void func_78447_b(float p_78447_1_) {
  38082. GlStateManager.func_179118_c();
  38083. if(this.field_78455_a.field_71439_g.func_70094_T()) {
  38084. IBlockState iblockstate = this.field_78455_a.field_71441_e.func_180495_p(new BlockPos(this.field_78455_a.field_71439_g));
  38085. EntityPlayer entityplayer = this.field_78455_a.field_71439_g;
  38086.  
  38087. for(int i = 0; i < 8; ++i) {
  38088. double d0 = entityplayer.field_70165_t + (double)(((float)((i >> 0) % 2) - 0.5F) * entityplayer.field_70130_N * 0.8F);
  38089. double d1 = entityplayer.field_70163_u + (double)(((float)((i >> 1) % 2) - 0.5F) * 0.1F);
  38090. double d2 = entityplayer.field_70161_v + (double)(((float)((i >> 2) % 2) - 0.5F) * entityplayer.field_70130_N * 0.8F);
  38091. BlockPos blockpos = new BlockPos(d0, d1 + (double)entityplayer.func_70047_e(), d2);
  38092. IBlockState iblockstate1 = this.field_78455_a.field_71441_e.func_180495_p(blockpos);
  38093. if(iblockstate1.func_191058_s()) {
  38094. iblockstate = iblockstate1;
  38095. }
  38096. }
  38097.  
  38098. if(iblockstate.func_185901_i() != EnumBlockRenderType.INVISIBLE) {
  38099. this.func_178108_a(this.field_78455_a.func_175602_ab().func_175023_a().func_178122_a(iblockstate));
  38100. }
  38101. }
  38102.  
  38103. if(!this.field_78455_a.field_71439_g.func_175149_v()) {
  38104. if(this.field_78455_a.field_71439_g.func_70055_a(Material.field_151586_h)) {
  38105. this.func_78448_c(p_78447_1_);
  38106. }
  38107.  
  38108. if(this.field_78455_a.field_71439_g.func_70027_ad()) {
  38109. this.func_78442_d();
  38110. }
  38111. }
  38112.  
  38113. GlStateManager.func_179141_d();
  38114. }
  38115.  
  38116. private void func_178108_a(TextureAtlasSprite p_178108_1_) {
  38117. this.field_78455_a.func_110434_K().func_110577_a(TextureMap.field_110575_b);
  38118. Tessellator tessellator = Tessellator.func_178181_a();
  38119. BufferBuilder bufferbuilder = tessellator.func_178180_c();
  38120. float f = 0.1F;
  38121. GlStateManager.func_179131_c(0.1F, 0.1F, 0.1F, 0.5F);
  38122. GlStateManager.func_179094_E();
  38123. float f1 = -1.0F;
  38124. float f2 = 1.0F;
  38125. float f3 = -1.0F;
  38126. float f4 = 1.0F;
  38127. float f5 = -0.5F;
  38128. float f6 = p_178108_1_.func_94209_e();
  38129. float f7 = p_178108_1_.func_94212_f();
  38130. float f8 = p_178108_1_.func_94206_g();
  38131. float f9 = p_178108_1_.func_94210_h();
  38132. bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181707_g);
  38133. bufferbuilder.func_181662_b(-1.0D, -1.0D, -0.5D).func_187315_a((double)f7, (double)f9).func_181675_d();
  38134. bufferbuilder.func_181662_b(1.0D, -1.0D, -0.5D).func_187315_a((double)f6, (double)f9).func_181675_d();
  38135. bufferbuilder.func_181662_b(1.0D, 1.0D, -0.5D).func_187315_a((double)f6, (double)f8).func_181675_d();
  38136. bufferbuilder.func_181662_b(-1.0D, 1.0D, -0.5D).func_187315_a((double)f7, (double)f8).func_181675_d();
  38137. tessellator.func_78381_a();
  38138. GlStateManager.func_179121_F();
  38139. GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
  38140. }
  38141.  
  38142. private void func_78448_c(float p_78448_1_) {
  38143. this.field_78455_a.func_110434_K().func_110577_a(field_110929_d);
  38144. Tessellator tessellator = Tessellator.func_178181_a();
  38145. BufferBuilder bufferbuilder = tessellator.func_178180_c();
  38146. float f = this.field_78455_a.field_71439_g.func_70013_c();
  38147. GlStateManager.func_179131_c(f, f, f, 0.5F);
  38148. GlStateManager.func_179147_l();
  38149. GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
  38150. GlStateManager.func_179094_E();
  38151. float f1 = 4.0F;
  38152. float f2 = -1.0F;
  38153. float f3 = 1.0F;
  38154. float f4 = -1.0F;
  38155. float f5 = 1.0F;
  38156. float f6 = -0.5F;
  38157. float f7 = -this.field_78455_a.field_71439_g.field_70177_z / 64.0F;
  38158. float f8 = this.field_78455_a.field_71439_g.field_70125_A / 64.0F;
  38159. bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181707_g);
  38160. bufferbuilder.func_181662_b(-1.0D, -1.0D, -0.5D).func_187315_a((double)(4.0F + f7), (double)(4.0F + f8)).func_181675_d();
  38161. bufferbuilder.func_181662_b(1.0D, -1.0D, -0.5D).func_187315_a((double)(0.0F + f7), (double)(4.0F + f8)).func_181675_d();
  38162. bufferbuilder.func_181662_b(1.0D, 1.0D, -0.5D).func_187315_a((double)(0.0F + f7), (double)(0.0F + f8)).func_181675_d();
  38163. bufferbuilder.func_181662_b(-1.0D, 1.0D, -0.5D).func_187315_a((double)(4.0F + f7), (double)(0.0F + f8)).func_181675_d();
  38164. tessellator.func_78381_a();
  38165. GlStateManager.func_179121_F();
  38166. GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
  38167. GlStateManager.func_179084_k();
  38168. }
  38169.  
  38170. private void func_78442_d() {
  38171. Tessellator tessellator = Tessellator.func_178181_a();
  38172. BufferBuilder bufferbuilder = tessellator.func_178180_c();
  38173. GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 0.9F);
  38174. GlStateManager.func_179143_c(519);
  38175. GlStateManager.func_179132_a(false);
  38176. GlStateManager.func_179147_l();
  38177. GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
  38178. float f = 1.0F;
  38179.  
  38180. for(int i = 0; i < 2; ++i) {
  38181. GlStateManager.func_179094_E();
  38182. TextureAtlasSprite textureatlassprite = this.field_78455_a.func_147117_R().func_110572_b("minecraft:blocks/fire_layer_1");
  38183. this.field_78455_a.func_110434_K().func_110577_a(TextureMap.field_110575_b);
  38184. float f1 = textureatlassprite.func_94209_e();
  38185. float f2 = textureatlassprite.func_94212_f();
  38186. float f3 = textureatlassprite.func_94206_g();
  38187. float f4 = textureatlassprite.func_94210_h();
  38188. float f5 = -0.5F;
  38189. float f6 = 0.5F;
  38190. float f7 = -0.5F;
  38191. float f8 = 0.5F;
  38192. float f9 = -0.5F;
  38193. GlStateManager.func_179109_b((float)(-(i * 2 - 1)) * 0.24F, -0.3F, 0.0F);
  38194. GlStateManager.func_179114_b((float)(i * 2 - 1) * 10.0F, 0.0F, 1.0F, 0.0F);
  38195. bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181707_g);
  38196. bufferbuilder.func_181662_b(-0.5D, -0.5D, -0.5D).func_187315_a((double)f2, (double)f4).func_181675_d();
  38197. bufferbuilder.func_181662_b(0.5D, -0.5D, -0.5D).func_187315_a((double)f1, (double)f4).func_181675_d();
  38198. bufferbuilder.func_181662_b(0.5D, 0.5D, -0.5D).func_187315_a((double)f1, (double)f3).func_181675_d();
  38199. bufferbuilder.func_181662_b(-0.5D, 0.5D, -0.5D).func_187315_a((double)f2, (double)f3).func_181675_d();
  38200. tessellator.func_78381_a();
  38201. GlStateManager.func_179121_F();
  38202. }
  38203.  
  38204. GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
  38205. GlStateManager.func_179084_k();
  38206. GlStateManager.func_179132_a(true);
  38207. GlStateManager.func_179143_c(515);
  38208. }
  38209.  
  38210. public void func_78441_a() {
  38211. this.field_187470_g = this.field_187469_f;
  38212. this.field_187472_i = this.field_187471_h;
  38213. EntityPlayerSP entityplayersp = this.field_78455_a.field_71439_g;
  38214. ItemStack itemstack = entityplayersp.func_184614_ca();
  38215. ItemStack itemstack1 = entityplayersp.func_184592_cb();
  38216. if(entityplayersp.func_184838_M()) {
  38217. this.field_187469_f = MathHelper.func_76131_a(this.field_187469_f - 0.4F, 0.0F, 1.0F);
  38218. this.field_187471_h = MathHelper.func_76131_a(this.field_187471_h - 0.4F, 0.0F, 1.0F);
  38219. } else {
  38220. float f = entityplayersp.func_184825_o(1.0F);
  38221. this.field_187469_f += MathHelper.func_76131_a((Objects.equals(this.field_187467_d, itemstack)?f * f * f:0.0F) - this.field_187469_f, -0.4F, 0.4F);
  38222. this.field_187471_h += MathHelper.func_76131_a((float)(Objects.equals(this.field_187468_e, itemstack1)?1:0) - this.field_187471_h, -0.4F, 0.4F);
  38223. }
  38224.  
  38225. if(this.field_187469_f < 0.1F) {
  38226. this.field_187467_d = itemstack;
  38227. }
  38228.  
  38229. if(this.field_187471_h < 0.1F) {
  38230. this.field_187468_e = itemstack1;
  38231. }
  38232.  
  38233. }
  38234.  
  38235. public void func_187460_a(EnumHand p_187460_1_) {
  38236. if(p_187460_1_ == EnumHand.MAIN_HAND) {
  38237. this.field_187469_f = 0.0F;
  38238. } else {
  38239. this.field_187471_h = 0.0F;
  38240. }
  38241.  
  38242. }
  38243. }
  38244.  
  38245. Patching failed: minecraft\net\minecraft\client\renderer\RenderGlobal.java
  38246. Hunk 1 failed! Cannot find hunk target
  38247. return l;
  38248. }
  38249.  
  38250. + @SuppressWarnings("incomplete-switch")
  38251. private void func_174982_a(BlockRenderLayer p_174982_1_) {
  38252. this.field_72777_q.field_71460_t.func_180436_i();
  38253. if (OpenGlHelper.func_176075_f()) {
  38254. File state
  38255. package net.minecraft.client.renderer;
  38256.  
  38257. import com.google.common.collect.Lists;
  38258. import com.google.common.collect.Maps;
  38259. import com.google.common.collect.Queues;
  38260. import com.google.common.collect.Sets;
  38261. import com.google.gson.JsonSyntaxException;
  38262. import java.io.IOException;
  38263. import java.util.Collection;
  38264. import java.util.Iterator;
  38265. import java.util.List;
  38266. import java.util.Map;
  38267. import java.util.Queue;
  38268. import java.util.Random;
  38269. import java.util.Set;
  38270. import javax.annotation.Nullable;
  38271. import net.minecraft.block.Block;
  38272. import net.minecraft.block.BlockChest;
  38273. import net.minecraft.block.BlockEnderChest;
  38274. import net.minecraft.block.BlockSign;
  38275. import net.minecraft.block.BlockSkull;
  38276. import net.minecraft.block.SoundType;
  38277. import net.minecraft.block.material.Material;
  38278. import net.minecraft.block.state.IBlockState;
  38279. import net.minecraft.client.Minecraft;
  38280. import net.minecraft.client.audio.ISound;
  38281. import net.minecraft.client.audio.PositionedSoundRecord;
  38282. import net.minecraft.client.multiplayer.WorldClient;
  38283. import net.minecraft.client.particle.Particle;
  38284. import net.minecraft.client.renderer.BlockRendererDispatcher;
  38285. import net.minecraft.client.renderer.BufferBuilder;
  38286. import net.minecraft.client.renderer.ChunkRenderContainer;
  38287. import net.minecraft.client.renderer.DestroyBlockProgress;
  38288. import net.minecraft.client.renderer.GLAllocation;
  38289. import net.minecraft.client.renderer.GlStateManager;
  38290. import net.minecraft.client.renderer.Matrix4f;
  38291. import net.minecraft.client.renderer.OpenGlHelper;
  38292. import net.minecraft.client.renderer.RenderHelper;
  38293. import net.minecraft.client.renderer.RenderList;
  38294. import net.minecraft.client.renderer.Tessellator;
  38295. import net.minecraft.client.renderer.VboRenderList;
  38296. import net.minecraft.client.renderer.Vector3d;
  38297. import net.minecraft.client.renderer.ViewFrustum;
  38298. import net.minecraft.client.renderer.chunk.ChunkRenderDispatcher;
  38299. import net.minecraft.client.renderer.chunk.CompiledChunk;
  38300. import net.minecraft.client.renderer.chunk.IRenderChunkFactory;
  38301. import net.minecraft.client.renderer.chunk.ListChunkFactory;
  38302. import net.minecraft.client.renderer.chunk.RenderChunk;
  38303. import net.minecraft.client.renderer.chunk.VboChunkFactory;
  38304. import net.minecraft.client.renderer.chunk.VisGraph;
  38305. import net.minecraft.client.renderer.culling.ClippingHelper;
  38306. import net.minecraft.client.renderer.culling.ClippingHelperImpl;
  38307. import net.minecraft.client.renderer.culling.Frustum;
  38308. import net.minecraft.client.renderer.culling.ICamera;
  38309. import net.minecraft.client.renderer.entity.RenderManager;
  38310. import net.minecraft.client.renderer.texture.TextureAtlasSprite;
  38311. import net.minecraft.client.renderer.texture.TextureManager;
  38312. import net.minecraft.client.renderer.texture.TextureMap;
  38313. import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
  38314. import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
  38315. import net.minecraft.client.renderer.vertex.VertexBuffer;
  38316. import net.minecraft.client.renderer.vertex.VertexFormat;
  38317. import net.minecraft.client.renderer.vertex.VertexFormatElement;
  38318. import net.minecraft.client.resources.IResourceManager;
  38319. import net.minecraft.client.resources.IResourceManagerReloadListener;
  38320. import net.minecraft.client.shader.Framebuffer;
  38321. import net.minecraft.client.shader.ShaderGroup;
  38322. import net.minecraft.client.shader.ShaderLinkHelper;
  38323. import net.minecraft.crash.CrashReport;
  38324. import net.minecraft.crash.CrashReportCategory;
  38325. import net.minecraft.crash.ICrashReportDetail;
  38326. import net.minecraft.entity.Entity;
  38327. import net.minecraft.entity.EntityLivingBase;
  38328. import net.minecraft.entity.player.EntityPlayer;
  38329. import net.minecraft.init.Blocks;
  38330. import net.minecraft.init.Items;
  38331. import net.minecraft.init.SoundEvents;
  38332. import net.minecraft.item.Item;
  38333. import net.minecraft.item.ItemDye;
  38334. import net.minecraft.item.ItemRecord;
  38335. import net.minecraft.tileentity.TileEntity;
  38336. import net.minecraft.tileentity.TileEntityChest;
  38337. import net.minecraft.util.BlockRenderLayer;
  38338. import net.minecraft.util.ClassInheritanceMultiMap;
  38339. import net.minecraft.util.EnumFacing;
  38340. import net.minecraft.util.EnumParticleTypes;
  38341. import net.minecraft.util.ReportedException;
  38342. import net.minecraft.util.ResourceLocation;
  38343. import net.minecraft.util.SoundCategory;
  38344. import net.minecraft.util.SoundEvent;
  38345. import net.minecraft.util.math.AxisAlignedBB;
  38346. import net.minecraft.util.math.BlockPos;
  38347. import net.minecraft.util.math.MathHelper;
  38348. import net.minecraft.util.math.RayTraceResult;
  38349. import net.minecraft.util.math.Vec3d;
  38350. import net.minecraft.world.IWorldEventListener;
  38351. import net.minecraft.world.World;
  38352. import net.minecraft.world.border.WorldBorder;
  38353. import net.minecraft.world.chunk.Chunk;
  38354. import net.minecraftforge.fml.relauncher.Side;
  38355. import net.minecraftforge.fml.relauncher.SideOnly;
  38356. import org.apache.logging.log4j.LogManager;
  38357. import org.apache.logging.log4j.Logger;
  38358. import org.lwjgl.util.vector.Vector3f;
  38359. import org.lwjgl.util.vector.Vector4f;
  38360.  
  38361. @SideOnly(Side.CLIENT)
  38362. public class RenderGlobal implements IWorldEventListener, IResourceManagerReloadListener {
  38363. private static final Logger field_147599_m = LogManager.getLogger();
  38364. private static final ResourceLocation field_110927_h = new ResourceLocation("textures/environment/moon_phases.png");
  38365. private static final ResourceLocation field_110928_i = new ResourceLocation("textures/environment/sun.png");
  38366. private static final ResourceLocation field_110925_j = new ResourceLocation("textures/environment/clouds.png");
  38367. private static final ResourceLocation field_110926_k = new ResourceLocation("textures/environment/end_sky.png");
  38368. private static final ResourceLocation field_175006_g = new ResourceLocation("textures/misc/forcefield.png");
  38369. private final Minecraft field_72777_q;
  38370. private final TextureManager field_72770_i;
  38371. private final RenderManager field_175010_j;
  38372. private WorldClient field_72769_h;
  38373. private Set<RenderChunk> field_175009_l = Sets.<RenderChunk>newLinkedHashSet();
  38374. private List<RenderGlobal.ContainerLocalRenderInformation> field_72755_R = Lists.<RenderGlobal.ContainerLocalRenderInformation>newArrayListWithCapacity(69696);
  38375. private final Set<TileEntity> field_181024_n = Sets.<TileEntity>newHashSet();
  38376. private ViewFrustum field_175008_n;
  38377. private int field_72772_v = -1;
  38378. private int field_72771_w = -1;
  38379. private int field_72781_x = -1;
  38380. private final VertexFormat field_175014_r;
  38381. private VertexBuffer field_175013_s;
  38382. private VertexBuffer field_175012_t;
  38383. private VertexBuffer field_175011_u;
  38384. private int field_72773_u;
  38385. private final Map<Integer, DestroyBlockProgress> field_72738_E = Maps.<Integer, DestroyBlockProgress>newHashMap();
  38386. private final Map<BlockPos, ISound> field_147593_P = Maps.<BlockPos, ISound>newHashMap();
  38387. private final TextureAtlasSprite[] field_94141_F = new TextureAtlasSprite[10];
  38388. private Framebuffer field_175015_z;
  38389. private ShaderGroup field_174991_A;
  38390. private double field_174992_B = Double.MIN_VALUE;
  38391. private double field_174993_C = Double.MIN_VALUE;
  38392. private double field_174987_D = Double.MIN_VALUE;
  38393. private int field_174988_E = Integer.MIN_VALUE;
  38394. private int field_174989_F = Integer.MIN_VALUE;
  38395. private int field_174990_G = Integer.MIN_VALUE;
  38396. private double field_174997_H = Double.MIN_VALUE;
  38397. private double field_174998_I = Double.MIN_VALUE;
  38398. private double field_174999_J = Double.MIN_VALUE;
  38399. private double field_175000_K = Double.MIN_VALUE;
  38400. private double field_174994_L = Double.MIN_VALUE;
  38401. private ChunkRenderDispatcher field_174995_M;
  38402. private ChunkRenderContainer field_174996_N;
  38403. private int field_72739_F = -1;
  38404. private int field_72740_G = 2;
  38405. private int field_72748_H;
  38406. private int field_72749_I;
  38407. private int field_72750_J;
  38408. private boolean field_175002_T;
  38409. private ClippingHelper field_175001_U;
  38410. private final Vector4f[] field_175004_V = new Vector4f[8];
  38411. private final Vector3d field_175003_W = new Vector3d();
  38412. private boolean field_175005_X;
  38413. IRenderChunkFactory field_175007_a;
  38414. private double field_147596_f;
  38415. private double field_147597_g;
  38416. private double field_147602_h;
  38417. private boolean field_147595_R = true;
  38418. private boolean field_184386_ad;
  38419. private final Set<BlockPos> field_184387_ae = Sets.<BlockPos>newHashSet();
  38420.  
  38421. public RenderGlobal(Minecraft p_i1249_1_) {
  38422. this.field_72777_q = p_i1249_1_;
  38423. this.field_175010_j = p_i1249_1_.func_175598_ae();
  38424. this.field_72770_i = p_i1249_1_.func_110434_K();
  38425. this.field_72770_i.func_110577_a(field_175006_g);
  38426. GlStateManager.func_187421_b(3553, 10242, 10497);
  38427. GlStateManager.func_187421_b(3553, 10243, 10497);
  38428. GlStateManager.func_179144_i(0);
  38429. this.func_174971_n();
  38430. this.field_175005_X = OpenGlHelper.func_176075_f();
  38431. if(this.field_175005_X) {
  38432. this.field_174996_N = new VboRenderList();
  38433. this.field_175007_a = new VboChunkFactory();
  38434. } else {
  38435. this.field_174996_N = new RenderList();
  38436. this.field_175007_a = new ListChunkFactory();
  38437. }
  38438.  
  38439. this.field_175014_r = new VertexFormat();
  38440. this.field_175014_r.func_181721_a(new VertexFormatElement(0, VertexFormatElement.EnumType.FLOAT, VertexFormatElement.EnumUsage.POSITION, 3));
  38441. this.func_174963_q();
  38442. this.func_174980_p();
  38443. this.func_174964_o();
  38444. }
  38445.  
  38446. public void func_110549_a(IResourceManager p_110549_1_) {
  38447. this.func_174971_n();
  38448. }
  38449.  
  38450. private void func_174971_n() {
  38451. TextureMap texturemap = this.field_72777_q.func_147117_R();
  38452.  
  38453. for(int i = 0; i < this.field_94141_F.length; ++i) {
  38454. this.field_94141_F[i] = texturemap.func_110572_b("minecraft:blocks/destroy_stage_" + i);
  38455. }
  38456.  
  38457. }
  38458.  
  38459. public void func_174966_b() {
  38460. if(OpenGlHelper.field_148824_g) {
  38461. if(ShaderLinkHelper.func_148074_b() == null) {
  38462. ShaderLinkHelper.func_148076_a();
  38463. }
  38464.  
  38465. ResourceLocation resourcelocation = new ResourceLocation("shaders/post/entity_outline.json");
  38466.  
  38467. try {
  38468. this.field_174991_A = new ShaderGroup(this.field_72777_q.func_110434_K(), this.field_72777_q.func_110442_L(), this.field_72777_q.func_147110_a(), resourcelocation);
  38469. this.field_174991_A.func_148026_a(this.field_72777_q.field_71443_c, this.field_72777_q.field_71440_d);
  38470. this.field_175015_z = this.field_174991_A.func_177066_a("final");
  38471. } catch (IOException ioexception) {
  38472. field_147599_m.warn((String)"Failed to load shader: {}", (Object)resourcelocation, (Object)ioexception);
  38473. this.field_174991_A = null;
  38474. this.field_175015_z = null;
  38475. } catch (JsonSyntaxException jsonsyntaxexception) {
  38476. field_147599_m.warn((String)"Failed to load shader: {}", (Object)resourcelocation, (Object)jsonsyntaxexception);
  38477. this.field_174991_A = null;
  38478. this.field_175015_z = null;
  38479. }
  38480. } else {
  38481. this.field_174991_A = null;
  38482. this.field_175015_z = null;
  38483. }
  38484.  
  38485. }
  38486.  
  38487. public void func_174975_c() {
  38488. if(this.func_174985_d()) {
  38489. GlStateManager.func_179147_l();
  38490. GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ZERO, GlStateManager.DestFactor.ONE);
  38491. this.field_175015_z.func_178038_a(this.field_72777_q.field_71443_c, this.field_72777_q.field_71440_d, false);
  38492. GlStateManager.func_179084_k();
  38493. }
  38494.  
  38495. }
  38496.  
  38497. protected boolean func_174985_d() {
  38498. return this.field_175015_z != null && this.field_174991_A != null && this.field_72777_q.field_71439_g != null;
  38499. }
  38500.  
  38501. private void func_174964_o() {
  38502. Tessellator tessellator = Tessellator.func_178181_a();
  38503. BufferBuilder bufferbuilder = tessellator.func_178180_c();
  38504. if(this.field_175011_u != null) {
  38505. this.field_175011_u.func_177362_c();
  38506. }
  38507.  
  38508. if(this.field_72781_x >= 0) {
  38509. GLAllocation.func_74523_b(this.field_72781_x);
  38510. this.field_72781_x = -1;
  38511. }
  38512.  
  38513. if(this.field_175005_X) {
  38514. this.field_175011_u = new VertexBuffer(this.field_175014_r);
  38515. this.func_174968_a(bufferbuilder, -16.0F, true);
  38516. bufferbuilder.func_178977_d();
  38517. bufferbuilder.func_178965_a();
  38518. this.field_175011_u.func_181722_a(bufferbuilder.func_178966_f());
  38519. } else {
  38520. this.field_72781_x = GLAllocation.func_74526_a(1);
  38521. GlStateManager.func_187423_f(this.field_72781_x, 4864);
  38522. this.func_174968_a(bufferbuilder, -16.0F, true);
  38523. tessellator.func_78381_a();
  38524. GlStateManager.func_187415_K();
  38525. }
  38526.  
  38527. }
  38528.  
  38529. private void func_174980_p() {
  38530. Tessellator tessellator = Tessellator.func_178181_a();
  38531. BufferBuilder bufferbuilder = tessellator.func_178180_c();
  38532. if(this.field_175012_t != null) {
  38533. this.field_175012_t.func_177362_c();
  38534. }
  38535.  
  38536. if(this.field_72771_w >= 0) {
  38537. GLAllocation.func_74523_b(this.field_72771_w);
  38538. this.field_72771_w = -1;
  38539. }
  38540.  
  38541. if(this.field_175005_X) {
  38542. this.field_175012_t = new VertexBuffer(this.field_175014_r);
  38543. this.func_174968_a(bufferbuilder, 16.0F, false);
  38544. bufferbuilder.func_178977_d();
  38545. bufferbuilder.func_178965_a();
  38546. this.field_175012_t.func_181722_a(bufferbuilder.func_178966_f());
  38547. } else {
  38548. this.field_72771_w = GLAllocation.func_74526_a(1);
  38549. GlStateManager.func_187423_f(this.field_72771_w, 4864);
  38550. this.func_174968_a(bufferbuilder, 16.0F, false);
  38551. tessellator.func_78381_a();
  38552. GlStateManager.func_187415_K();
  38553. }
  38554.  
  38555. }
  38556.  
  38557. private void func_174968_a(BufferBuilder p_174968_1_, float p_174968_2_, boolean p_174968_3_) {
  38558. int i = 64;
  38559. int j = 6;
  38560. p_174968_1_.func_181668_a(7, DefaultVertexFormats.field_181705_e);
  38561.  
  38562. for(int k = -384; k <= 384; k += 64) {
  38563. for(int l = -384; l <= 384; l += 64) {
  38564. float f = (float)k;
  38565. float f1 = (float)(k + 64);
  38566. if(p_174968_3_) {
  38567. f1 = (float)k;
  38568. f = (float)(k + 64);
  38569. }
  38570.  
  38571. p_174968_1_.func_181662_b((double)f, (double)p_174968_2_, (double)l).func_181675_d();
  38572. p_174968_1_.func_181662_b((double)f1, (double)p_174968_2_, (double)l).func_181675_d();
  38573. p_174968_1_.func_181662_b((double)f1, (double)p_174968_2_, (double)(l + 64)).func_181675_d();
  38574. p_174968_1_.func_181662_b((double)f, (double)p_174968_2_, (double)(l + 64)).func_181675_d();
  38575. }
  38576. }
  38577.  
  38578. }
  38579.  
  38580. private void func_174963_q() {
  38581. Tessellator tessellator = Tessellator.func_178181_a();
  38582. BufferBuilder bufferbuilder = tessellator.func_178180_c();
  38583. if(this.field_175013_s != null) {
  38584. this.field_175013_s.func_177362_c();
  38585. }
  38586.  
  38587. if(this.field_72772_v >= 0) {
  38588. GLAllocation.func_74523_b(this.field_72772_v);
  38589. this.field_72772_v = -1;
  38590. }
  38591.  
  38592. if(this.field_175005_X) {
  38593. this.field_175013_s = new VertexBuffer(this.field_175014_r);
  38594. this.func_180444_a(bufferbuilder);
  38595. bufferbuilder.func_178977_d();
  38596. bufferbuilder.func_178965_a();
  38597. this.field_175013_s.func_181722_a(bufferbuilder.func_178966_f());
  38598. } else {
  38599. this.field_72772_v = GLAllocation.func_74526_a(1);
  38600. GlStateManager.func_179094_E();
  38601. GlStateManager.func_187423_f(this.field_72772_v, 4864);
  38602. this.func_180444_a(bufferbuilder);
  38603. tessellator.func_78381_a();
  38604. GlStateManager.func_187415_K();
  38605. GlStateManager.func_179121_F();
  38606. }
  38607.  
  38608. }
  38609.  
  38610. private void func_180444_a(BufferBuilder p_180444_1_) {
  38611. Random random = new Random(10842L);
  38612. p_180444_1_.func_181668_a(7, DefaultVertexFormats.field_181705_e);
  38613.  
  38614. for(int i = 0; i < 1500; ++i) {
  38615. double d0 = (double)(random.nextFloat() * 2.0F - 1.0F);
  38616. double d1 = (double)(random.nextFloat() * 2.0F - 1.0F);
  38617. double d2 = (double)(random.nextFloat() * 2.0F - 1.0F);
  38618. double d3 = (double)(0.15F + random.nextFloat() * 0.1F);
  38619. double d4 = d0 * d0 + d1 * d1 + d2 * d2;
  38620. if(d4 < 1.0D && d4 > 0.01D) {
  38621. d4 = 1.0D / Math.sqrt(d4);
  38622. d0 = d0 * d4;
  38623. d1 = d1 * d4;
  38624. d2 = d2 * d4;
  38625. double d5 = d0 * 100.0D;
  38626. double d6 = d1 * 100.0D;
  38627. double d7 = d2 * 100.0D;
  38628. double d8 = Math.atan2(d0, d2);
  38629. double d9 = Math.sin(d8);
  38630. double d10 = Math.cos(d8);
  38631. double d11 = Math.atan2(Math.sqrt(d0 * d0 + d2 * d2), d1);
  38632. double d12 = Math.sin(d11);
  38633. double d13 = Math.cos(d11);
  38634. double d14 = random.nextDouble() * 3.141592653589793D * 2.0D;
  38635. double d15 = Math.sin(d14);
  38636. double d16 = Math.cos(d14);
  38637.  
  38638. for(int j = 0; j < 4; ++j) {
  38639. double d17 = 0.0D;
  38640. double d18 = (double)((j & 2) - 1) * d3;
  38641. double d19 = (double)((j + 1 & 2) - 1) * d3;
  38642. double d20 = 0.0D;
  38643. double d21 = d18 * d16 - d19 * d15;
  38644. double d22 = d19 * d16 + d18 * d15;
  38645. double d23 = d21 * d12 + 0.0D * d13;
  38646. double d24 = 0.0D * d12 - d21 * d13;
  38647. double d25 = d24 * d9 - d22 * d10;
  38648. double d26 = d22 * d9 + d24 * d10;
  38649. p_180444_1_.func_181662_b(d5 + d25, d6 + d23, d7 + d26).func_181675_d();
  38650. }
  38651. }
  38652. }
  38653.  
  38654. }
  38655.  
  38656. public void func_72732_a(@Nullable WorldClient p_72732_1_) {
  38657. if(this.field_72769_h != null) {
  38658. this.field_72769_h.func_72848_b(this);
  38659. }
  38660.  
  38661. this.field_174992_B = Double.MIN_VALUE;
  38662. this.field_174993_C = Double.MIN_VALUE;
  38663. this.field_174987_D = Double.MIN_VALUE;
  38664. this.field_174988_E = Integer.MIN_VALUE;
  38665. this.field_174989_F = Integer.MIN_VALUE;
  38666. this.field_174990_G = Integer.MIN_VALUE;
  38667. this.field_175010_j.func_78717_a(p_72732_1_);
  38668. this.field_72769_h = p_72732_1_;
  38669. if(p_72732_1_ != null) {
  38670. p_72732_1_.func_72954_a(this);
  38671. this.func_72712_a();
  38672. } else {
  38673. this.field_175009_l.clear();
  38674. this.field_72755_R.clear();
  38675. if(this.field_175008_n != null) {
  38676. this.field_175008_n.func_178160_a();
  38677. this.field_175008_n = null;
  38678. }
  38679.  
  38680. if(this.field_174995_M != null) {
  38681. this.field_174995_M.func_188244_g();
  38682. }
  38683.  
  38684. this.field_174995_M = null;
  38685. }
  38686.  
  38687. }
  38688.  
  38689. public void func_72712_a() {
  38690. if(this.field_72769_h != null) {
  38691. if(this.field_174995_M == null) {
  38692. this.field_174995_M = new ChunkRenderDispatcher();
  38693. }
  38694.  
  38695. this.field_147595_R = true;
  38696. Blocks.field_150362_t.func_150122_b(this.field_72777_q.field_71474_y.field_74347_j);
  38697. Blocks.field_150361_u.func_150122_b(this.field_72777_q.field_71474_y.field_74347_j);
  38698. this.field_72739_F = this.field_72777_q.field_71474_y.field_151451_c;
  38699. boolean flag = this.field_175005_X;
  38700. this.field_175005_X = OpenGlHelper.func_176075_f();
  38701. if(flag && !this.field_175005_X) {
  38702. this.field_174996_N = new RenderList();
  38703. this.field_175007_a = new ListChunkFactory();
  38704. } else if(!flag && this.field_175005_X) {
  38705. this.field_174996_N = new VboRenderList();
  38706. this.field_175007_a = new VboChunkFactory();
  38707. }
  38708.  
  38709. if(flag != this.field_175005_X) {
  38710. this.func_174963_q();
  38711. this.func_174980_p();
  38712. this.func_174964_o();
  38713. }
  38714.  
  38715. if(this.field_175008_n != null) {
  38716. this.field_175008_n.func_178160_a();
  38717. }
  38718.  
  38719. this.func_174986_e();
  38720. synchronized(this.field_181024_n) {
  38721. this.field_181024_n.clear();
  38722. }
  38723.  
  38724. this.field_175008_n = new ViewFrustum(this.field_72769_h, this.field_72777_q.field_71474_y.field_151451_c, this, this.field_175007_a);
  38725. if(this.field_72769_h != null) {
  38726. Entity entity = this.field_72777_q.func_175606_aa();
  38727. if(entity != null) {
  38728. this.field_175008_n.func_178163_a(entity.field_70165_t, entity.field_70161_v);
  38729. }
  38730. }
  38731.  
  38732. this.field_72740_G = 2;
  38733. }
  38734. }
  38735.  
  38736. protected void func_174986_e() {
  38737. this.field_175009_l.clear();
  38738. this.field_174995_M.func_178514_b();
  38739. }
  38740.  
  38741. public void func_72720_a(int p_72720_1_, int p_72720_2_) {
  38742. if(OpenGlHelper.field_148824_g) {
  38743. if(this.field_174991_A != null) {
  38744. this.field_174991_A.func_148026_a(p_72720_1_, p_72720_2_);
  38745. }
  38746.  
  38747. }
  38748. }
  38749.  
  38750. public void func_180446_a(Entity p_180446_1_, ICamera p_180446_2_, float p_180446_3_) {
  38751. if(this.field_72740_G > 0) {
  38752. --this.field_72740_G;
  38753. } else {
  38754. double d0 = p_180446_1_.field_70169_q + (p_180446_1_.field_70165_t - p_180446_1_.field_70169_q) * (double)p_180446_3_;
  38755. double d1 = p_180446_1_.field_70167_r + (p_180446_1_.field_70163_u - p_180446_1_.field_70167_r) * (double)p_180446_3_;
  38756. double d2 = p_180446_1_.field_70166_s + (p_180446_1_.field_70161_v - p_180446_1_.field_70166_s) * (double)p_180446_3_;
  38757. this.field_72769_h.field_72984_F.func_76320_a("prepare");
  38758. TileEntityRendererDispatcher.field_147556_a.func_190056_a(this.field_72769_h, this.field_72777_q.func_110434_K(), this.field_72777_q.field_71466_p, this.field_72777_q.func_175606_aa(), this.field_72777_q.field_71476_x, p_180446_3_);
  38759. this.field_175010_j.func_180597_a(this.field_72769_h, this.field_72777_q.field_71466_p, this.field_72777_q.func_175606_aa(), this.field_72777_q.field_147125_j, this.field_72777_q.field_71474_y, p_180446_3_);
  38760. this.field_72748_H = 0;
  38761. this.field_72749_I = 0;
  38762. this.field_72750_J = 0;
  38763. Entity entity = this.field_72777_q.func_175606_aa();
  38764. double d3 = entity.field_70142_S + (entity.field_70165_t - entity.field_70142_S) * (double)p_180446_3_;
  38765. double d4 = entity.field_70137_T + (entity.field_70163_u - entity.field_70137_T) * (double)p_180446_3_;
  38766. double d5 = entity.field_70136_U + (entity.field_70161_v - entity.field_70136_U) * (double)p_180446_3_;
  38767. TileEntityRendererDispatcher.field_147554_b = d3;
  38768. TileEntityRendererDispatcher.field_147555_c = d4;
  38769. TileEntityRendererDispatcher.field_147552_d = d5;
  38770. this.field_175010_j.func_178628_a(d3, d4, d5);
  38771. this.field_72777_q.field_71460_t.func_180436_i();
  38772. this.field_72769_h.field_72984_F.func_76318_c("global");
  38773. List<Entity> list = this.field_72769_h.func_72910_y();
  38774. this.field_72748_H = list.size();
  38775.  
  38776. for(int i = 0; i < this.field_72769_h.field_73007_j.size(); ++i) {
  38777. Entity entity1 = (Entity)this.field_72769_h.field_73007_j.get(i);
  38778. ++this.field_72749_I;
  38779. if(entity1.func_145770_h(d0, d1, d2)) {
  38780. this.field_175010_j.func_188388_a(entity1, p_180446_3_, false);
  38781. }
  38782. }
  38783.  
  38784. this.field_72769_h.field_72984_F.func_76318_c("entities");
  38785. List<Entity> list1 = Lists.<Entity>newArrayList();
  38786. List<Entity> list2 = Lists.<Entity>newArrayList();
  38787. BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
  38788.  
  38789. for(RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation : this.field_72755_R) {
  38790. Chunk chunk = this.field_72769_h.func_175726_f(renderglobal$containerlocalrenderinformation.field_178036_a.func_178568_j());
  38791. ClassInheritanceMultiMap<Entity> classinheritancemultimap = chunk.func_177429_s()[renderglobal$containerlocalrenderinformation.field_178036_a.func_178568_j().func_177956_o() / 16];
  38792. if(!classinheritancemultimap.isEmpty()) {
  38793. for(Entity entity2 : classinheritancemultimap) {
  38794. boolean flag = this.field_175010_j.func_178635_a(entity2, p_180446_2_, d0, d1, d2) || entity2.func_184215_y(this.field_72777_q.field_71439_g);
  38795. if(flag) {
  38796. boolean flag1 = this.field_72777_q.func_175606_aa() instanceof EntityLivingBase?((EntityLivingBase)this.field_72777_q.func_175606_aa()).func_70608_bn():false;
  38797. if((entity2 != this.field_72777_q.func_175606_aa() || this.field_72777_q.field_71474_y.field_74320_O != 0 || flag1) && (entity2.field_70163_u < 0.0D || entity2.field_70163_u >= 256.0D || this.field_72769_h.func_175667_e(blockpos$pooledmutableblockpos.func_189535_a(entity2)))) {
  38798. ++this.field_72749_I;
  38799. this.field_175010_j.func_188388_a(entity2, p_180446_3_, false);
  38800. if(this.func_184383_a(entity2, entity, p_180446_2_)) {
  38801. list1.add(entity2);
  38802. }
  38803.  
  38804. if(this.field_175010_j.func_188390_b(entity2)) {
  38805. list2.add(entity2);
  38806. }
  38807. }
  38808. }
  38809. }
  38810. }
  38811. }
  38812.  
  38813. blockpos$pooledmutableblockpos.func_185344_t();
  38814. if(!list2.isEmpty()) {
  38815. for(Entity entity3 : list2) {
  38816. this.field_175010_j.func_188389_a(entity3, p_180446_3_);
  38817. }
  38818. }
  38819.  
  38820. if(this.func_174985_d() && (!list1.isEmpty() || this.field_184386_ad)) {
  38821. this.field_72769_h.field_72984_F.func_76318_c("entityOutlines");
  38822. this.field_175015_z.func_147614_f();
  38823. this.field_184386_ad = !list1.isEmpty();
  38824. if(!list1.isEmpty()) {
  38825. GlStateManager.func_179143_c(519);
  38826. GlStateManager.func_179106_n();
  38827. this.field_175015_z.func_147610_a(false);
  38828. RenderHelper.func_74518_a();
  38829. this.field_175010_j.func_178632_c(true);
  38830.  
  38831. for(int j = 0; j < ((List)list1).size(); ++j) {
  38832. this.field_175010_j.func_188388_a((Entity)list1.get(j), p_180446_3_, false);
  38833. }
  38834.  
  38835. this.field_175010_j.func_178632_c(false);
  38836. RenderHelper.func_74519_b();
  38837. GlStateManager.func_179132_a(false);
  38838. this.field_174991_A.func_148018_a(p_180446_3_);
  38839. GlStateManager.func_179145_e();
  38840. GlStateManager.func_179132_a(true);
  38841. GlStateManager.func_179127_m();
  38842. GlStateManager.func_179147_l();
  38843. GlStateManager.func_179142_g();
  38844. GlStateManager.func_179143_c(515);
  38845. GlStateManager.func_179126_j();
  38846. GlStateManager.func_179141_d();
  38847. }
  38848.  
  38849. this.field_72777_q.func_147110_a().func_147610_a(false);
  38850. }
  38851.  
  38852. this.field_72769_h.field_72984_F.func_76318_c("blockentities");
  38853. RenderHelper.func_74519_b();
  38854.  
  38855. for(RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation1 : this.field_72755_R) {
  38856. List<TileEntity> list3 = renderglobal$containerlocalrenderinformation1.field_178036_a.func_178571_g().func_178485_b();
  38857. if(!list3.isEmpty()) {
  38858. for(TileEntity tileentity2 : list3) {
  38859. TileEntityRendererDispatcher.field_147556_a.func_180546_a(tileentity2, p_180446_3_, -1);
  38860. }
  38861. }
  38862. }
  38863.  
  38864. synchronized(this.field_181024_n) {
  38865. for(TileEntity tileentity : this.field_181024_n) {
  38866. TileEntityRendererDispatcher.field_147556_a.func_180546_a(tileentity, p_180446_3_, -1);
  38867. }
  38868. }
  38869.  
  38870. this.func_180443_s();
  38871.  
  38872. for(DestroyBlockProgress destroyblockprogress : this.field_72738_E.values()) {
  38873. BlockPos blockpos = destroyblockprogress.func_180246_b();
  38874. if(this.field_72769_h.func_180495_p(blockpos).func_177230_c().func_149716_u()) {
  38875. TileEntity tileentity1 = this.field_72769_h.func_175625_s(blockpos);
  38876. if(tileentity1 instanceof TileEntityChest) {
  38877. TileEntityChest tileentitychest = (TileEntityChest)tileentity1;
  38878. if(tileentitychest.field_145991_k != null) {
  38879. blockpos = blockpos.func_177972_a(EnumFacing.WEST);
  38880. tileentity1 = this.field_72769_h.func_175625_s(blockpos);
  38881. } else if(tileentitychest.field_145992_i != null) {
  38882. blockpos = blockpos.func_177972_a(EnumFacing.NORTH);
  38883. tileentity1 = this.field_72769_h.func_175625_s(blockpos);
  38884. }
  38885. }
  38886.  
  38887. IBlockState iblockstate = this.field_72769_h.func_180495_p(blockpos);
  38888. if(tileentity1 != null && iblockstate.func_191057_i()) {
  38889. TileEntityRendererDispatcher.field_147556_a.func_180546_a(tileentity1, p_180446_3_, destroyblockprogress.func_73106_e());
  38890. }
  38891. }
  38892. }
  38893.  
  38894. this.func_174969_t();
  38895. this.field_72777_q.field_71460_t.func_175072_h();
  38896. this.field_72777_q.field_71424_I.func_76319_b();
  38897. }
  38898. }
  38899.  
  38900. private boolean func_184383_a(Entity p_184383_1_, Entity p_184383_2_, ICamera p_184383_3_) {
  38901. boolean flag = p_184383_2_ instanceof EntityLivingBase && ((EntityLivingBase)p_184383_2_).func_70608_bn();
  38902. return p_184383_1_ == p_184383_2_ && this.field_72777_q.field_71474_y.field_74320_O == 0 && !flag?false:(p_184383_1_.func_184202_aL()?true:(this.field_72777_q.field_71439_g.func_175149_v() && this.field_72777_q.field_71474_y.field_178883_an.func_151470_d() && p_184383_1_ instanceof EntityPlayer?p_184383_1_.field_70158_ak || p_184383_3_.func_78546_a(p_184383_1_.func_174813_aQ()) || p_184383_1_.func_184215_y(this.field_72777_q.field_71439_g):false));
  38903. }
  38904.  
  38905. public String func_72735_c() {
  38906. int i = this.field_175008_n.field_178164_f.length;
  38907. int j = this.func_184382_g();
  38908. return String.format("C: %d/%d %sD: %d, L: %d, %s", new Object[]{Integer.valueOf(j), Integer.valueOf(i), this.field_72777_q.field_175612_E?"(s) ":"", Integer.valueOf(this.field_72739_F), Integer.valueOf(this.field_184387_ae.size()), this.field_174995_M == null?"null":this.field_174995_M.func_178504_a()});
  38909. }
  38910.  
  38911. protected int func_184382_g() {
  38912. int i = 0;
  38913.  
  38914. for(RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation : this.field_72755_R) {
  38915. CompiledChunk compiledchunk = renderglobal$containerlocalrenderinformation.field_178036_a.field_178590_b;
  38916. if(compiledchunk != CompiledChunk.field_178502_a && !compiledchunk.func_178489_a()) {
  38917. ++i;
  38918. }
  38919. }
  38920.  
  38921. return i;
  38922. }
  38923.  
  38924. public String func_72723_d() {
  38925. return "E: " + this.field_72749_I + "/" + this.field_72748_H + ", B: " + this.field_72750_J;
  38926. }
  38927.  
  38928. public void func_174970_a(Entity p_174970_1_, double p_174970_2_, ICamera p_174970_4_, int p_174970_5_, boolean p_174970_6_) {
  38929. if(this.field_72777_q.field_71474_y.field_151451_c != this.field_72739_F) {
  38930. this.func_72712_a();
  38931. }
  38932.  
  38933. this.field_72769_h.field_72984_F.func_76320_a("camera");
  38934. double d0 = p_174970_1_.field_70165_t - this.field_174992_B;
  38935. double d1 = p_174970_1_.field_70163_u - this.field_174993_C;
  38936. double d2 = p_174970_1_.field_70161_v - this.field_174987_D;
  38937. if(this.field_174988_E != p_174970_1_.field_70176_ah || this.field_174989_F != p_174970_1_.field_70162_ai || this.field_174990_G != p_174970_1_.field_70164_aj || d0 * d0 + d1 * d1 + d2 * d2 > 16.0D) {
  38938. this.field_174992_B = p_174970_1_.field_70165_t;
  38939. this.field_174993_C = p_174970_1_.field_70163_u;
  38940. this.field_174987_D = p_174970_1_.field_70161_v;
  38941. this.field_174988_E = p_174970_1_.field_70176_ah;
  38942. this.field_174989_F = p_174970_1_.field_70162_ai;
  38943. this.field_174990_G = p_174970_1_.field_70164_aj;
  38944. this.field_175008_n.func_178163_a(p_174970_1_.field_70165_t, p_174970_1_.field_70161_v);
  38945. }
  38946.  
  38947. this.field_72769_h.field_72984_F.func_76318_c("renderlistcamera");
  38948. double d3 = p_174970_1_.field_70142_S + (p_174970_1_.field_70165_t - p_174970_1_.field_70142_S) * p_174970_2_;
  38949. double d4 = p_174970_1_.field_70137_T + (p_174970_1_.field_70163_u - p_174970_1_.field_70137_T) * p_174970_2_;
  38950. double d5 = p_174970_1_.field_70136_U + (p_174970_1_.field_70161_v - p_174970_1_.field_70136_U) * p_174970_2_;
  38951. this.field_174996_N.func_178004_a(d3, d4, d5);
  38952. this.field_72769_h.field_72984_F.func_76318_c("cull");
  38953. if(this.field_175001_U != null) {
  38954. Frustum frustum = new Frustum(this.field_175001_U);
  38955. frustum.func_78547_a(this.field_175003_W.field_181059_a, this.field_175003_W.field_181060_b, this.field_175003_W.field_181061_c);
  38956. p_174970_4_ = frustum;
  38957. }
  38958.  
  38959. this.field_72777_q.field_71424_I.func_76318_c("culling");
  38960. BlockPos blockpos1 = new BlockPos(d3, d4 + (double)p_174970_1_.func_70047_e(), d5);
  38961. RenderChunk renderchunk = this.field_175008_n.func_178161_a(blockpos1);
  38962. BlockPos blockpos = new BlockPos(MathHelper.func_76128_c(d3 / 16.0D) * 16, MathHelper.func_76128_c(d4 / 16.0D) * 16, MathHelper.func_76128_c(d5 / 16.0D) * 16);
  38963. this.field_147595_R = this.field_147595_R || !this.field_175009_l.isEmpty() || p_174970_1_.field_70165_t != this.field_174997_H || p_174970_1_.field_70163_u != this.field_174998_I || p_174970_1_.field_70161_v != this.field_174999_J || (double)p_174970_1_.field_70125_A != this.field_175000_K || (double)p_174970_1_.field_70177_z != this.field_174994_L;
  38964. this.field_174997_H = p_174970_1_.field_70165_t;
  38965. this.field_174998_I = p_174970_1_.field_70163_u;
  38966. this.field_174999_J = p_174970_1_.field_70161_v;
  38967. this.field_175000_K = (double)p_174970_1_.field_70125_A;
  38968. this.field_174994_L = (double)p_174970_1_.field_70177_z;
  38969. boolean flag = this.field_175001_U != null;
  38970. this.field_72777_q.field_71424_I.func_76318_c("update");
  38971. if(!flag && this.field_147595_R) {
  38972. this.field_147595_R = false;
  38973. this.field_72755_R = Lists.<RenderGlobal.ContainerLocalRenderInformation>newArrayList();
  38974. Queue<RenderGlobal.ContainerLocalRenderInformation> queue = Queues.<RenderGlobal.ContainerLocalRenderInformation>newArrayDeque();
  38975. Entity.func_184227_b(MathHelper.func_151237_a((double)this.field_72777_q.field_71474_y.field_151451_c / 8.0D, 1.0D, 2.5D));
  38976. boolean flag1 = this.field_72777_q.field_175612_E;
  38977. if(renderchunk != null) {
  38978. boolean flag2 = false;
  38979. RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation3 = new RenderGlobal.ContainerLocalRenderInformation(renderchunk, (EnumFacing)null, 0);
  38980. Set<EnumFacing> set1 = this.func_174978_c(blockpos1);
  38981. if(set1.size() == 1) {
  38982. Vector3f vector3f = this.func_174962_a(p_174970_1_, p_174970_2_);
  38983. EnumFacing enumfacing = EnumFacing.func_176737_a(vector3f.x, vector3f.y, vector3f.z).func_176734_d();
  38984. set1.remove(enumfacing);
  38985. }
  38986.  
  38987. if(set1.isEmpty()) {
  38988. flag2 = true;
  38989. }
  38990.  
  38991. if(flag2 && !p_174970_6_) {
  38992. this.field_72755_R.add(renderglobal$containerlocalrenderinformation3);
  38993. } else {
  38994. if(p_174970_6_ && this.field_72769_h.func_180495_p(blockpos1).func_185914_p()) {
  38995. flag1 = false;
  38996. }
  38997.  
  38998. renderchunk.func_178577_a(p_174970_5_);
  38999. queue.add(renderglobal$containerlocalrenderinformation3);
  39000. }
  39001. } else {
  39002. int i = blockpos1.func_177956_o() > 0?248:8;
  39003.  
  39004. for(int j = -this.field_72739_F; j <= this.field_72739_F; ++j) {
  39005. for(int k = -this.field_72739_F; k <= this.field_72739_F; ++k) {
  39006. RenderChunk renderchunk1 = this.field_175008_n.func_178161_a(new BlockPos((j << 4) + 8, i, (k << 4) + 8));
  39007. if(renderchunk1 != null && ((ICamera)p_174970_4_).func_78546_a(renderchunk1.field_178591_c)) {
  39008. renderchunk1.func_178577_a(p_174970_5_);
  39009. queue.add(new RenderGlobal.ContainerLocalRenderInformation(renderchunk1, (EnumFacing)null, 0));
  39010. }
  39011. }
  39012. }
  39013. }
  39014.  
  39015. this.field_72777_q.field_71424_I.func_76320_a("iteration");
  39016.  
  39017. while(!((Queue)queue).isEmpty()) {
  39018. RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation1 = (RenderGlobal.ContainerLocalRenderInformation)queue.poll();
  39019. RenderChunk renderchunk3 = renderglobal$containerlocalrenderinformation1.field_178036_a;
  39020. EnumFacing enumfacing2 = renderglobal$containerlocalrenderinformation1.field_178034_b;
  39021. this.field_72755_R.add(renderglobal$containerlocalrenderinformation1);
  39022.  
  39023. for(EnumFacing enumfacing1 : EnumFacing.values()) {
  39024. RenderChunk renderchunk2 = this.func_181562_a(blockpos, renderchunk3, enumfacing1);
  39025. if((!flag1 || !renderglobal$containerlocalrenderinformation1.func_189560_a(enumfacing1.func_176734_d())) && (!flag1 || enumfacing2 == null || renderchunk3.func_178571_g().func_178495_a(enumfacing2.func_176734_d(), enumfacing1)) && renderchunk2 != null && renderchunk2.func_178577_a(p_174970_5_) && ((ICamera)p_174970_4_).func_78546_a(renderchunk2.field_178591_c)) {
  39026. RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation = new RenderGlobal.ContainerLocalRenderInformation(renderchunk2, enumfacing1, renderglobal$containerlocalrenderinformation1.field_178032_d + 1);
  39027. renderglobal$containerlocalrenderinformation.func_189561_a(renderglobal$containerlocalrenderinformation1.field_178035_c, enumfacing1);
  39028. queue.add(renderglobal$containerlocalrenderinformation);
  39029. }
  39030. }
  39031. }
  39032.  
  39033. this.field_72777_q.field_71424_I.func_76319_b();
  39034. }
  39035.  
  39036. this.field_72777_q.field_71424_I.func_76318_c("captureFrustum");
  39037. if(this.field_175002_T) {
  39038. this.func_174984_a(d3, d4, d5);
  39039. this.field_175002_T = false;
  39040. }
  39041.  
  39042. this.field_72777_q.field_71424_I.func_76318_c("rebuildNear");
  39043. Set<RenderChunk> set = this.field_175009_l;
  39044. this.field_175009_l = Sets.<RenderChunk>newLinkedHashSet();
  39045.  
  39046. for(RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation2 : this.field_72755_R) {
  39047. RenderChunk renderchunk4 = renderglobal$containerlocalrenderinformation2.field_178036_a;
  39048. if(renderchunk4.func_178569_m() || set.contains(renderchunk4)) {
  39049. this.field_147595_R = true;
  39050. BlockPos blockpos2 = renderchunk4.func_178568_j().func_177982_a(8, 8, 8);
  39051. boolean flag3 = blockpos2.func_177951_i(blockpos1) < 768.0D;
  39052. if(!renderchunk4.func_188281_o() && !flag3) {
  39053. this.field_175009_l.add(renderchunk4);
  39054. } else {
  39055. this.field_72777_q.field_71424_I.func_76320_a("build near");
  39056. this.field_174995_M.func_178505_b(renderchunk4);
  39057. renderchunk4.func_188282_m();
  39058. this.field_72777_q.field_71424_I.func_76319_b();
  39059. }
  39060. }
  39061. }
  39062.  
  39063. this.field_175009_l.addAll(set);
  39064. this.field_72777_q.field_71424_I.func_76319_b();
  39065. }
  39066.  
  39067. private Set<EnumFacing> func_174978_c(BlockPos p_174978_1_) {
  39068. VisGraph visgraph = new VisGraph();
  39069. BlockPos blockpos = new BlockPos(p_174978_1_.func_177958_n() >> 4 << 4, p_174978_1_.func_177956_o() >> 4 << 4, p_174978_1_.func_177952_p() >> 4 << 4);
  39070. Chunk chunk = this.field_72769_h.func_175726_f(blockpos);
  39071.  
  39072. for(BlockPos.MutableBlockPos blockpos$mutableblockpos : BlockPos.func_177975_b(blockpos, blockpos.func_177982_a(15, 15, 15))) {
  39073. if(chunk.func_177435_g(blockpos$mutableblockpos).func_185914_p()) {
  39074. visgraph.func_178606_a(blockpos$mutableblockpos);
  39075. }
  39076. }
  39077.  
  39078. return visgraph.func_178609_b(p_174978_1_);
  39079. }
  39080.  
  39081. @Nullable
  39082. private RenderChunk func_181562_a(BlockPos p_181562_1_, RenderChunk p_181562_2_, EnumFacing p_181562_3_) {
  39083. BlockPos blockpos = p_181562_2_.func_181701_a(p_181562_3_);
  39084. return MathHelper.func_76130_a(p_181562_1_.func_177958_n() - blockpos.func_177958_n()) > this.field_72739_F * 16?null:(blockpos.func_177956_o() >= 0 && blockpos.func_177956_o() < 256?(MathHelper.func_76130_a(p_181562_1_.func_177952_p() - blockpos.func_177952_p()) > this.field_72739_F * 16?null:this.field_175008_n.func_178161_a(blockpos)):null);
  39085. }
  39086.  
  39087. private void func_174984_a(double p_174984_1_, double p_174984_3_, double p_174984_5_) {
  39088. this.field_175001_U = new ClippingHelperImpl();
  39089. ((ClippingHelperImpl)this.field_175001_U).func_78560_b();
  39090. Matrix4f matrix4f = new Matrix4f(this.field_175001_U.field_178626_c);
  39091. matrix4f.transpose();
  39092. Matrix4f matrix4f1 = new Matrix4f(this.field_175001_U.field_178625_b);
  39093. matrix4f1.transpose();
  39094. Matrix4f matrix4f2 = new Matrix4f();
  39095. Matrix4f.mul(matrix4f1, matrix4f, matrix4f2);
  39096. matrix4f2.invert();
  39097. this.field_175003_W.field_181059_a = p_174984_1_;
  39098. this.field_175003_W.field_181060_b = p_174984_3_;
  39099. this.field_175003_W.field_181061_c = p_174984_5_;
  39100. this.field_175004_V[0] = new Vector4f(-1.0F, -1.0F, -1.0F, 1.0F);
  39101. this.field_175004_V[1] = new Vector4f(1.0F, -1.0F, -1.0F, 1.0F);
  39102. this.field_175004_V[2] = new Vector4f(1.0F, 1.0F, -1.0F, 1.0F);
  39103. this.field_175004_V[3] = new Vector4f(-1.0F, 1.0F, -1.0F, 1.0F);
  39104. this.field_175004_V[4] = new Vector4f(-1.0F, -1.0F, 1.0F, 1.0F);
  39105. this.field_175004_V[5] = new Vector4f(1.0F, -1.0F, 1.0F, 1.0F);
  39106. this.field_175004_V[6] = new Vector4f(1.0F, 1.0F, 1.0F, 1.0F);
  39107. this.field_175004_V[7] = new Vector4f(-1.0F, 1.0F, 1.0F, 1.0F);
  39108.  
  39109. for(int i = 0; i < 8; ++i) {
  39110. Matrix4f.transform(matrix4f2, this.field_175004_V[i], this.field_175004_V[i]);
  39111. this.field_175004_V[i].x /= this.field_175004_V[i].w;
  39112. this.field_175004_V[i].y /= this.field_175004_V[i].w;
  39113. this.field_175004_V[i].z /= this.field_175004_V[i].w;
  39114. this.field_175004_V[i].w = 1.0F;
  39115. }
  39116.  
  39117. }
  39118.  
  39119. protected Vector3f func_174962_a(Entity p_174962_1_, double p_174962_2_) {
  39120. float f = (float)((double)p_174962_1_.field_70127_C + (double)(p_174962_1_.field_70125_A - p_174962_1_.field_70127_C) * p_174962_2_);
  39121. float f1 = (float)((double)p_174962_1_.field_70126_B + (double)(p_174962_1_.field_70177_z - p_174962_1_.field_70126_B) * p_174962_2_);
  39122. if(Minecraft.func_71410_x().field_71474_y.field_74320_O == 2) {
  39123. f += 180.0F;
  39124. }
  39125.  
  39126. float f2 = MathHelper.func_76134_b(-f1 * 0.017453292F - 3.1415927F);
  39127. float f3 = MathHelper.func_76126_a(-f1 * 0.017453292F - 3.1415927F);
  39128. float f4 = -MathHelper.func_76134_b(-f * 0.017453292F);
  39129. float f5 = MathHelper.func_76126_a(-f * 0.017453292F);
  39130. return new Vector3f(f3 * f4, f5, f2 * f4);
  39131. }
  39132.  
  39133. public int func_174977_a(BlockRenderLayer p_174977_1_, double p_174977_2_, int p_174977_4_, Entity p_174977_5_) {
  39134. RenderHelper.func_74518_a();
  39135. if(p_174977_1_ == BlockRenderLayer.TRANSLUCENT) {
  39136. this.field_72777_q.field_71424_I.func_76320_a("translucent_sort");
  39137. double d0 = p_174977_5_.field_70165_t - this.field_147596_f;
  39138. double d1 = p_174977_5_.field_70163_u - this.field_147597_g;
  39139. double d2 = p_174977_5_.field_70161_v - this.field_147602_h;
  39140. if(d0 * d0 + d1 * d1 + d2 * d2 > 1.0D) {
  39141. this.field_147596_f = p_174977_5_.field_70165_t;
  39142. this.field_147597_g = p_174977_5_.field_70163_u;
  39143. this.field_147602_h = p_174977_5_.field_70161_v;
  39144. int k = 0;
  39145.  
  39146. for(RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation : this.field_72755_R) {
  39147. if(renderglobal$containerlocalrenderinformation.field_178036_a.field_178590_b.func_178492_d(p_174977_1_) && k++ < 15) {
  39148. this.field_174995_M.func_178509_c(renderglobal$containerlocalrenderinformation.field_178036_a);
  39149. }
  39150. }
  39151. }
  39152.  
  39153. this.field_72777_q.field_71424_I.func_76319_b();
  39154. }
  39155.  
  39156. this.field_72777_q.field_71424_I.func_76320_a("filterempty");
  39157. int l = 0;
  39158. boolean flag = p_174977_1_ == BlockRenderLayer.TRANSLUCENT;
  39159. int i1 = flag?this.field_72755_R.size() - 1:0;
  39160. int i = flag?-1:this.field_72755_R.size();
  39161. int j1 = flag?-1:1;
  39162.  
  39163. for(int j = i1; j != i; j += j1) {
  39164. RenderChunk renderchunk = ((RenderGlobal.ContainerLocalRenderInformation)this.field_72755_R.get(j)).field_178036_a;
  39165. if(!renderchunk.func_178571_g().func_178491_b(p_174977_1_)) {
  39166. ++l;
  39167. this.field_174996_N.func_178002_a(renderchunk, p_174977_1_);
  39168. }
  39169. }
  39170.  
  39171. this.field_72777_q.field_71424_I.func_76318_c("render_" + p_174977_1_);
  39172. this.func_174982_a(p_174977_1_);
  39173. this.field_72777_q.field_71424_I.func_76319_b();
  39174. return l;
  39175. }
  39176.  
  39177. private void func_174982_a(BlockRenderLayer p_174982_1_) {
  39178. this.field_72777_q.field_71460_t.func_180436_i();
  39179. if(OpenGlHelper.func_176075_f()) {
  39180. GlStateManager.func_187410_q('\u8074');
  39181. OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a);
  39182. GlStateManager.func_187410_q('\u8078');
  39183. OpenGlHelper.func_77472_b(OpenGlHelper.field_77476_b);
  39184. GlStateManager.func_187410_q('\u8078');
  39185. OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a);
  39186. GlStateManager.func_187410_q('\u8076');
  39187. }
  39188.  
  39189. this.field_174996_N.func_178001_a(p_174982_1_);
  39190. if(OpenGlHelper.func_176075_f()) {
  39191. for(VertexFormatElement vertexformatelement : DefaultVertexFormats.field_176600_a.func_177343_g()) {
  39192. VertexFormatElement.EnumUsage vertexformatelement$enumusage = vertexformatelement.func_177375_c();
  39193. int i = vertexformatelement.func_177369_e();
  39194. switch(vertexformatelement$enumusage) {
  39195. case POSITION:
  39196. GlStateManager.func_187429_p('\u8074');
  39197. break;
  39198. case UV:
  39199. OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a + i);
  39200. GlStateManager.func_187429_p('\u8078');
  39201. OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a);
  39202. break;
  39203. case COLOR:
  39204. GlStateManager.func_187429_p('\u8076');
  39205. GlStateManager.func_179117_G();
  39206. }
  39207. }
  39208. }
  39209.  
  39210. this.field_72777_q.field_71460_t.func_175072_h();
  39211. }
  39212.  
  39213. private void func_174965_a(Iterator<DestroyBlockProgress> p_174965_1_) {
  39214. while(p_174965_1_.hasNext()) {
  39215. DestroyBlockProgress destroyblockprogress = (DestroyBlockProgress)p_174965_1_.next();
  39216. int i = destroyblockprogress.func_82743_f();
  39217. if(this.field_72773_u - i > 400) {
  39218. p_174965_1_.remove();
  39219. }
  39220. }
  39221.  
  39222. }
  39223.  
  39224. public void func_72734_e() {
  39225. ++this.field_72773_u;
  39226. if(this.field_72773_u % 20 == 0) {
  39227. this.func_174965_a(this.field_72738_E.values().iterator());
  39228. }
  39229.  
  39230. if(!this.field_184387_ae.isEmpty() && !this.field_174995_M.func_188248_h() && this.field_175009_l.isEmpty()) {
  39231. Iterator<BlockPos> iterator = this.field_184387_ae.iterator();
  39232.  
  39233. while(iterator.hasNext()) {
  39234. BlockPos blockpos = (BlockPos)iterator.next();
  39235. iterator.remove();
  39236. int i = blockpos.func_177958_n();
  39237. int j = blockpos.func_177956_o();
  39238. int k = blockpos.func_177952_p();
  39239. this.func_184385_a(i - 1, j - 1, k - 1, i + 1, j + 1, k + 1, false);
  39240. }
  39241. }
  39242.  
  39243. }
  39244.  
  39245. private void func_180448_r() {
  39246. GlStateManager.func_179106_n();
  39247. GlStateManager.func_179118_c();
  39248. GlStateManager.func_179147_l();
  39249. GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
  39250. RenderHelper.func_74518_a();
  39251. GlStateManager.func_179132_a(false);
  39252. this.field_72770_i.func_110577_a(field_110926_k);
  39253. Tessellator tessellator = Tessellator.func_178181_a();
  39254. BufferBuilder bufferbuilder = tessellator.func_178180_c();
  39255.  
  39256. for(int i = 0; i < 6; ++i) {
  39257. GlStateManager.func_179094_E();
  39258. if(i == 1) {
  39259. GlStateManager.func_179114_b(90.0F, 1.0F, 0.0F, 0.0F);
  39260. }
  39261.  
  39262. if(i == 2) {
  39263. GlStateManager.func_179114_b(-90.0F, 1.0F, 0.0F, 0.0F);
  39264. }
  39265.  
  39266. if(i == 3) {
  39267. GlStateManager.func_179114_b(180.0F, 1.0F, 0.0F, 0.0F);
  39268. }
  39269.  
  39270. if(i == 4) {
  39271. GlStateManager.func_179114_b(90.0F, 0.0F, 0.0F, 1.0F);
  39272. }
  39273.  
  39274. if(i == 5) {
  39275. GlStateManager.func_179114_b(-90.0F, 0.0F, 0.0F, 1.0F);
  39276. }
  39277.  
  39278. bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181709_i);
  39279. bufferbuilder.func_181662_b(-100.0D, -100.0D, -100.0D).func_187315_a(0.0D, 0.0D).func_181669_b(40, 40, 40, 255).func_181675_d();
  39280. bufferbuilder.func_181662_b(-100.0D, -100.0D, 100.0D).func_187315_a(0.0D, 16.0D).func_181669_b(40, 40, 40, 255).func_181675_d();
  39281. bufferbuilder.func_181662_b(100.0D, -100.0D, 100.0D).func_187315_a(16.0D, 16.0D).func_181669_b(40, 40, 40, 255).func_181675_d();
  39282. bufferbuilder.func_181662_b(100.0D, -100.0D, -100.0D).func_187315_a(16.0D, 0.0D).func_181669_b(40, 40, 40, 255).func_181675_d();
  39283. tessellator.func_78381_a();
  39284. GlStateManager.func_179121_F();
  39285. }
  39286.  
  39287. GlStateManager.func_179132_a(true);
  39288. GlStateManager.func_179098_w();
  39289. GlStateManager.func_179141_d();
  39290. }
  39291.  
  39292. public void func_174976_a(float p_174976_1_, int p_174976_2_) {
  39293. if(this.field_72777_q.field_71441_e.field_73011_w.func_186058_p().func_186068_a() == 1) {
  39294. this.func_180448_r();
  39295. } else if(this.field_72777_q.field_71441_e.field_73011_w.func_76569_d()) {
  39296. GlStateManager.func_179090_x();
  39297. Vec3d vec3d = this.field_72769_h.func_72833_a(this.field_72777_q.func_175606_aa(), p_174976_1_);
  39298. float f = (float)vec3d.field_72450_a;
  39299. float f1 = (float)vec3d.field_72448_b;
  39300. float f2 = (float)vec3d.field_72449_c;
  39301. if(p_174976_2_ != 2) {
  39302. float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F;
  39303. float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F;
  39304. float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F;
  39305. f = f3;
  39306. f1 = f4;
  39307. f2 = f5;
  39308. }
  39309.  
  39310. GlStateManager.func_179124_c(f, f1, f2);
  39311. Tessellator tessellator = Tessellator.func_178181_a();
  39312. BufferBuilder bufferbuilder = tessellator.func_178180_c();
  39313. GlStateManager.func_179132_a(false);
  39314. GlStateManager.func_179127_m();
  39315. GlStateManager.func_179124_c(f, f1, f2);
  39316. if(this.field_175005_X) {
  39317. this.field_175012_t.func_177359_a();
  39318. GlStateManager.func_187410_q('\u8074');
  39319. GlStateManager.func_187420_d(3, 5126, 12, 0);
  39320. this.field_175012_t.func_177358_a(7);
  39321. this.field_175012_t.func_177361_b();
  39322. GlStateManager.func_187429_p('\u8074');
  39323. } else {
  39324. GlStateManager.func_179148_o(this.field_72771_w);
  39325. }
  39326.  
  39327. GlStateManager.func_179106_n();
  39328. GlStateManager.func_179118_c();
  39329. GlStateManager.func_179147_l();
  39330. GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
  39331. RenderHelper.func_74518_a();
  39332. float[] afloat = this.field_72769_h.field_73011_w.func_76560_a(this.field_72769_h.func_72826_c(p_174976_1_), p_174976_1_);
  39333. if(afloat != null) {
  39334. GlStateManager.func_179090_x();
  39335. GlStateManager.func_179103_j(7425);
  39336. GlStateManager.func_179094_E();
  39337. GlStateManager.func_179114_b(90.0F, 1.0F, 0.0F, 0.0F);
  39338. GlStateManager.func_179114_b(MathHelper.func_76126_a(this.field_72769_h.func_72929_e(p_174976_1_)) < 0.0F?180.0F:0.0F, 0.0F, 0.0F, 1.0F);
  39339. GlStateManager.func_179114_b(90.0F, 0.0F, 0.0F, 1.0F);
  39340. float f6 = afloat[0];
  39341. float f7 = afloat[1];
  39342. float f8 = afloat[2];
  39343. if(p_174976_2_ != 2) {
  39344. float f9 = (f6 * 30.0F + f7 * 59.0F + f8 * 11.0F) / 100.0F;
  39345. float f10 = (f6 * 30.0F + f7 * 70.0F) / 100.0F;
  39346. float f11 = (f6 * 30.0F + f8 * 70.0F) / 100.0F;
  39347. f6 = f9;
  39348. f7 = f10;
  39349. f8 = f11;
  39350. }
  39351.  
  39352. bufferbuilder.func_181668_a(6, DefaultVertexFormats.field_181706_f);
  39353. bufferbuilder.func_181662_b(0.0D, 100.0D, 0.0D).func_181666_a(f6, f7, f8, afloat[3]).func_181675_d();
  39354. int j = 16;
  39355.  
  39356. for(int l = 0; l <= 16; ++l) {
  39357. float f21 = (float)l * 6.2831855F / 16.0F;
  39358. float f12 = MathHelper.func_76126_a(f21);
  39359. float f13 = MathHelper.func_76134_b(f21);
  39360. bufferbuilder.func_181662_b((double)(f12 * 120.0F), (double)(f13 * 120.0F), (double)(-f13 * 40.0F * afloat[3])).func_181666_a(afloat[0], afloat[1], afloat[2], 0.0F).func_181675_d();
  39361. }
  39362.  
  39363. tessellator.func_78381_a();
  39364. GlStateManager.func_179121_F();
  39365. GlStateManager.func_179103_j(7424);
  39366. }
  39367.  
  39368. GlStateManager.func_179098_w();
  39369. GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
  39370. GlStateManager.func_179094_E();
  39371. float f16 = 1.0F - this.field_72769_h.func_72867_j(p_174976_1_);
  39372. GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, f16);
  39373. GlStateManager.func_179114_b(-90.0F, 0.0F, 1.0F, 0.0F);
  39374. GlStateManager.func_179114_b(this.field_72769_h.func_72826_c(p_174976_1_) * 360.0F, 1.0F, 0.0F, 0.0F);
  39375. float f17 = 30.0F;
  39376. this.field_72770_i.func_110577_a(field_110928_i);
  39377. bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181707_g);
  39378. bufferbuilder.func_181662_b((double)(-f17), 100.0D, (double)(-f17)).func_187315_a(0.0D, 0.0D).func_181675_d();
  39379. bufferbuilder.func_181662_b((double)f17, 100.0D, (double)(-f17)).func_187315_a(1.0D, 0.0D).func_181675_d();
  39380. bufferbuilder.func_181662_b((double)f17, 100.0D, (double)f17).func_187315_a(1.0D, 1.0D).func_181675_d();
  39381. bufferbuilder.func_181662_b((double)(-f17), 100.0D, (double)f17).func_187315_a(0.0D, 1.0D).func_181675_d();
  39382. tessellator.func_78381_a();
  39383. f17 = 20.0F;
  39384. this.field_72770_i.func_110577_a(field_110927_h);
  39385. int i = this.field_72769_h.func_72853_d();
  39386. int k = i % 4;
  39387. int i1 = i / 4 % 2;
  39388. float f22 = (float)(k + 0) / 4.0F;
  39389. float f23 = (float)(i1 + 0) / 2.0F;
  39390. float f24 = (float)(k + 1) / 4.0F;
  39391. float f14 = (float)(i1 + 1) / 2.0F;
  39392. bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181707_g);
  39393. bufferbuilder.func_181662_b((double)(-f17), -100.0D, (double)f17).func_187315_a((double)f24, (double)f14).func_181675_d();
  39394. bufferbuilder.func_181662_b((double)f17, -100.0D, (double)f17).func_187315_a((double)f22, (double)f14).func_181675_d();
  39395. bufferbuilder.func_181662_b((double)f17, -100.0D, (double)(-f17)).func_187315_a((double)f22, (double)f23).func_181675_d();
  39396. bufferbuilder.func_181662_b((double)(-f17), -100.0D, (double)(-f17)).func_187315_a((double)f24, (double)f23).func_181675_d();
  39397. tessellator.func_78381_a();
  39398. GlStateManager.func_179090_x();
  39399. float f15 = this.field_72769_h.func_72880_h(p_174976_1_) * f16;
  39400. if(f15 > 0.0F) {
  39401. GlStateManager.func_179131_c(f15, f15, f15, f15);
  39402. if(this.field_175005_X) {
  39403. this.field_175013_s.func_177359_a();
  39404. GlStateManager.func_187410_q('\u8074');
  39405. GlStateManager.func_187420_d(3, 5126, 12, 0);
  39406. this.field_175013_s.func_177358_a(7);
  39407. this.field_175013_s.func_177361_b();
  39408. GlStateManager.func_187429_p('\u8074');
  39409. } else {
  39410. GlStateManager.func_179148_o(this.field_72772_v);
  39411. }
  39412. }
  39413.  
  39414. GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
  39415. GlStateManager.func_179084_k();
  39416. GlStateManager.func_179141_d();
  39417. GlStateManager.func_179127_m();
  39418. GlStateManager.func_179121_F();
  39419. GlStateManager.func_179090_x();
  39420. GlStateManager.func_179124_c(0.0F, 0.0F, 0.0F);
  39421. double d0 = this.field_72777_q.field_71439_g.func_174824_e(p_174976_1_).field_72448_b - this.field_72769_h.func_72919_O();
  39422. if(d0 < 0.0D) {
  39423. GlStateManager.func_179094_E();
  39424. GlStateManager.func_179109_b(0.0F, 12.0F, 0.0F);
  39425. if(this.field_175005_X) {
  39426. this.field_175011_u.func_177359_a();
  39427. GlStateManager.func_187410_q('\u8074');
  39428. GlStateManager.func_187420_d(3, 5126, 12, 0);
  39429. this.field_175011_u.func_177358_a(7);
  39430. this.field_175011_u.func_177361_b();
  39431. GlStateManager.func_187429_p('\u8074');
  39432. } else {
  39433. GlStateManager.func_179148_o(this.field_72781_x);
  39434. }
  39435.  
  39436. GlStateManager.func_179121_F();
  39437. float f18 = 1.0F;
  39438. float f19 = -((float)(d0 + 65.0D));
  39439. float f20 = -1.0F;
  39440. bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181706_f);
  39441. bufferbuilder.func_181662_b(-1.0D, (double)f19, 1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
  39442. bufferbuilder.func_181662_b(1.0D, (double)f19, 1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
  39443. bufferbuilder.func_181662_b(1.0D, -1.0D, 1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
  39444. bufferbuilder.func_181662_b(-1.0D, -1.0D, 1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
  39445. bufferbuilder.func_181662_b(-1.0D, -1.0D, -1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
  39446. bufferbuilder.func_181662_b(1.0D, -1.0D, -1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
  39447. bufferbuilder.func_181662_b(1.0D, (double)f19, -1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
  39448. bufferbuilder.func_181662_b(-1.0D, (double)f19, -1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
  39449. bufferbuilder.func_181662_b(1.0D, -1.0D, -1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
  39450. bufferbuilder.func_181662_b(1.0D, -1.0D, 1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
  39451. bufferbuilder.func_181662_b(1.0D, (double)f19, 1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
  39452. bufferbuilder.func_181662_b(1.0D, (double)f19, -1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
  39453. bufferbuilder.func_181662_b(-1.0D, (double)f19, -1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
  39454. bufferbuilder.func_181662_b(-1.0D, (double)f19, 1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
  39455. bufferbuilder.func_181662_b(-1.0D, -1.0D, 1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
  39456. bufferbuilder.func_181662_b(-1.0D, -1.0D, -1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
  39457. bufferbuilder.func_181662_b(-1.0D, -1.0D, -1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
  39458. bufferbuilder.func_181662_b(-1.0D, -1.0D, 1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
  39459. bufferbuilder.func_181662_b(1.0D, -1.0D, 1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
  39460. bufferbuilder.func_181662_b(1.0D, -1.0D, -1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
  39461. tessellator.func_78381_a();
  39462. }
  39463.  
  39464. if(this.field_72769_h.field_73011_w.func_76561_g()) {
  39465. GlStateManager.func_179124_c(f * 0.2F + 0.04F, f1 * 0.2F + 0.04F, f2 * 0.6F + 0.1F);
  39466. } else {
  39467. GlStateManager.func_179124_c(f, f1, f2);
  39468. }
  39469.  
  39470. GlStateManager.func_179094_E();
  39471. GlStateManager.func_179109_b(0.0F, -((float)(d0 - 16.0D)), 0.0F);
  39472. GlStateManager.func_179148_o(this.field_72781_x);
  39473. GlStateManager.func_179121_F();
  39474. GlStateManager.func_179098_w();
  39475. GlStateManager.func_179132_a(true);
  39476. }
  39477. }
  39478.  
  39479. public void func_180447_b(float p_180447_1_, int p_180447_2_, double p_180447_3_, double p_180447_5_, double p_180447_7_) {
  39480. if(this.field_72777_q.field_71441_e.field_73011_w.func_76569_d()) {
  39481. if(this.field_72777_q.field_71474_y.func_181147_e() == 2) {
  39482. this.func_180445_c(p_180447_1_, p_180447_2_, p_180447_3_, p_180447_5_, p_180447_7_);
  39483. } else {
  39484. GlStateManager.func_179129_p();
  39485. int i = 32;
  39486. int j = 8;
  39487. Tessellator tessellator = Tessellator.func_178181_a();
  39488. BufferBuilder bufferbuilder = tessellator.func_178180_c();
  39489. this.field_72770_i.func_110577_a(field_110925_j);
  39490. GlStateManager.func_179147_l();
  39491. GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
  39492. Vec3d vec3d = this.field_72769_h.func_72824_f(p_180447_1_);
  39493. float f = (float)vec3d.field_72450_a;
  39494. float f1 = (float)vec3d.field_72448_b;
  39495. float f2 = (float)vec3d.field_72449_c;
  39496. if(p_180447_2_ != 2) {
  39497. float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F;
  39498. float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F;
  39499. float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F;
  39500. f = f3;
  39501. f1 = f4;
  39502. f2 = f5;
  39503. }
  39504.  
  39505. float f9 = 4.8828125E-4F;
  39506. double d2 = (double)((float)this.field_72773_u + p_180447_1_);
  39507. double d0 = p_180447_3_ + d2 * 0.029999999329447746D;
  39508. int k = MathHelper.func_76128_c(d0 / 2048.0D);
  39509. int l = MathHelper.func_76128_c(p_180447_7_ / 2048.0D);
  39510. d0 = d0 - (double)(k * 2048);
  39511. double lvt_22_1_ = p_180447_7_ - (double)(l * 2048);
  39512. float f6 = this.field_72769_h.field_73011_w.func_76571_f() - (float)p_180447_5_ + 0.33F;
  39513. float f7 = (float)(d0 * 4.8828125E-4D);
  39514. float f8 = (float)(lvt_22_1_ * 4.8828125E-4D);
  39515. bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181709_i);
  39516.  
  39517. for(int i1 = -256; i1 < 256; i1 += 32) {
  39518. for(int j1 = -256; j1 < 256; j1 += 32) {
  39519. bufferbuilder.func_181662_b((double)(i1 + 0), (double)f6, (double)(j1 + 32)).func_187315_a((double)((float)(i1 + 0) * 4.8828125E-4F + f7), (double)((float)(j1 + 32) * 4.8828125E-4F + f8)).func_181666_a(f, f1, f2, 0.8F).func_181675_d();
  39520. bufferbuilder.func_181662_b((double)(i1 + 32), (double)f6, (double)(j1 + 32)).func_187315_a((double)((float)(i1 + 32) * 4.8828125E-4F + f7), (double)((float)(j1 + 32) * 4.8828125E-4F + f8)).func_181666_a(f, f1, f2, 0.8F).func_181675_d();
  39521. bufferbuilder.func_181662_b((double)(i1 + 32), (double)f6, (double)(j1 + 0)).func_187315_a((double)((float)(i1 + 32) * 4.8828125E-4F + f7), (double)((float)(j1 + 0) * 4.8828125E-4F + f8)).func_181666_a(f, f1, f2, 0.8F).func_181675_d();
  39522. bufferbuilder.func_181662_b((double)(i1 + 0), (double)f6, (double)(j1 + 0)).func_187315_a((double)((float)(i1 + 0) * 4.8828125E-4F + f7), (double)((float)(j1 + 0) * 4.8828125E-4F + f8)).func_181666_a(f, f1, f2, 0.8F).func_181675_d();
  39523. }
  39524. }
  39525.  
  39526. tessellator.func_78381_a();
  39527. GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
  39528. GlStateManager.func_179084_k();
  39529. GlStateManager.func_179089_o();
  39530. }
  39531. }
  39532. }
  39533.  
  39534. public boolean func_72721_a(double p_72721_1_, double p_72721_3_, double p_72721_5_, float p_72721_7_) {
  39535. return false;
  39536. }
  39537.  
  39538. private void func_180445_c(float p_180445_1_, int p_180445_2_, double p_180445_3_, double p_180445_5_, double p_180445_7_) {
  39539. GlStateManager.func_179129_p();
  39540. Tessellator tessellator = Tessellator.func_178181_a();
  39541. BufferBuilder bufferbuilder = tessellator.func_178180_c();
  39542. float f = 12.0F;
  39543. float f1 = 4.0F;
  39544. double d0 = (double)((float)this.field_72773_u + p_180445_1_);
  39545. double d1 = (p_180445_3_ + d0 * 0.029999999329447746D) / 12.0D;
  39546. double d2 = p_180445_7_ / 12.0D + 0.33000001311302185D;
  39547. float f2 = this.field_72769_h.field_73011_w.func_76571_f() - (float)p_180445_5_ + 0.33F;
  39548. int i = MathHelper.func_76128_c(d1 / 2048.0D);
  39549. int j = MathHelper.func_76128_c(d2 / 2048.0D);
  39550. d1 = d1 - (double)(i * 2048);
  39551. d2 = d2 - (double)(j * 2048);
  39552. this.field_72770_i.func_110577_a(field_110925_j);
  39553. GlStateManager.func_179147_l();
  39554. GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
  39555. Vec3d vec3d = this.field_72769_h.func_72824_f(p_180445_1_);
  39556. float f3 = (float)vec3d.field_72450_a;
  39557. float f4 = (float)vec3d.field_72448_b;
  39558. float f5 = (float)vec3d.field_72449_c;
  39559. if(p_180445_2_ != 2) {
  39560. float f6 = (f3 * 30.0F + f4 * 59.0F + f5 * 11.0F) / 100.0F;
  39561. float f7 = (f3 * 30.0F + f4 * 70.0F) / 100.0F;
  39562. float f8 = (f3 * 30.0F + f5 * 70.0F) / 100.0F;
  39563. f3 = f6;
  39564. f4 = f7;
  39565. f5 = f8;
  39566. }
  39567.  
  39568. float f25 = f3 * 0.9F;
  39569. float f26 = f4 * 0.9F;
  39570. float f27 = f5 * 0.9F;
  39571. float f9 = f3 * 0.7F;
  39572. float f10 = f4 * 0.7F;
  39573. float f11 = f5 * 0.7F;
  39574. float f12 = f3 * 0.8F;
  39575. float f13 = f4 * 0.8F;
  39576. float f14 = f5 * 0.8F;
  39577. float f15 = 0.00390625F;
  39578. float f16 = (float)MathHelper.func_76128_c(d1) * 0.00390625F;
  39579. float f17 = (float)MathHelper.func_76128_c(d2) * 0.00390625F;
  39580. float f18 = (float)(d1 - (double)MathHelper.func_76128_c(d1));
  39581. float f19 = (float)(d2 - (double)MathHelper.func_76128_c(d2));
  39582. int k = 8;
  39583. int l = 4;
  39584. float f20 = 9.765625E-4F;
  39585. GlStateManager.func_179152_a(12.0F, 1.0F, 12.0F);
  39586.  
  39587. for(int i1 = 0; i1 < 2; ++i1) {
  39588. if(i1 == 0) {
  39589. GlStateManager.func_179135_a(false, false, false, false);
  39590. } else {
  39591. switch(p_180445_2_) {
  39592. case 0:
  39593. GlStateManager.func_179135_a(false, true, true, true);
  39594. break;
  39595. case 1:
  39596. GlStateManager.func_179135_a(true, false, false, true);
  39597. break;
  39598. case 2:
  39599. GlStateManager.func_179135_a(true, true, true, true);
  39600. }
  39601. }
  39602.  
  39603. for(int j1 = -3; j1 <= 4; ++j1) {
  39604. for(int k1 = -3; k1 <= 4; ++k1) {
  39605. bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181712_l);
  39606. float f21 = (float)(j1 * 8);
  39607. float f22 = (float)(k1 * 8);
  39608. float f23 = f21 - f18;
  39609. float f24 = f22 - f19;
  39610. if(f2 > -5.0F) {
  39611. bufferbuilder.func_181662_b((double)(f23 + 0.0F), (double)(f2 + 0.0F), (double)(f24 + 8.0F)).func_187315_a((double)((f21 + 0.0F) * 0.00390625F + f16), (double)((f22 + 8.0F) * 0.00390625F + f17)).func_181666_a(f9, f10, f11, 0.8F).func_181663_c(0.0F, -1.0F, 0.0F).func_181675_d();
  39612. bufferbuilder.func_181662_b((double)(f23 + 8.0F), (double)(f2 + 0.0F), (double)(f24 + 8.0F)).func_187315_a((double)((f21 + 8.0F) * 0.00390625F + f16), (double)((f22 + 8.0F) * 0.00390625F + f17)).func_181666_a(f9, f10, f11, 0.8F).func_181663_c(0.0F, -1.0F, 0.0F).func_181675_d();
  39613. bufferbuilder.func_181662_b((double)(f23 + 8.0F), (double)(f2 + 0.0F), (double)(f24 + 0.0F)).func_187315_a((double)((f21 + 8.0F) * 0.00390625F + f16), (double)((f22 + 0.0F) * 0.00390625F + f17)).func_181666_a(f9, f10, f11, 0.8F).func_181663_c(0.0F, -1.0F, 0.0F).func_181675_d();
  39614. bufferbuilder.func_181662_b((double)(f23 + 0.0F), (double)(f2 + 0.0F), (double)(f24 + 0.0F)).func_187315_a((double)((f21 + 0.0F) * 0.00390625F + f16), (double)((f22 + 0.0F) * 0.00390625F + f17)).func_181666_a(f9, f10, f11, 0.8F).func_181663_c(0.0F, -1.0F, 0.0F).func_181675_d();
  39615. }
  39616.  
  39617. if(f2 <= 5.0F) {
  39618. bufferbuilder.func_181662_b((double)(f23 + 0.0F), (double)(f2 + 4.0F - 9.765625E-4F), (double)(f24 + 8.0F)).func_187315_a((double)((f21 + 0.0F) * 0.00390625F + f16), (double)((f22 + 8.0F) * 0.00390625F + f17)).func_181666_a(f3, f4, f5, 0.8F).func_181663_c(0.0F, 1.0F, 0.0F).func_181675_d();
  39619. bufferbuilder.func_181662_b((double)(f23 + 8.0F), (double)(f2 + 4.0F - 9.765625E-4F), (double)(f24 + 8.0F)).func_187315_a((double)((f21 + 8.0F) * 0.00390625F + f16), (double)((f22 + 8.0F) * 0.00390625F + f17)).func_181666_a(f3, f4, f5, 0.8F).func_181663_c(0.0F, 1.0F, 0.0F).func_181675_d();
  39620. bufferbuilder.func_181662_b((double)(f23 + 8.0F), (double)(f2 + 4.0F - 9.765625E-4F), (double)(f24 + 0.0F)).func_187315_a((double)((f21 + 8.0F) * 0.00390625F + f16), (double)((f22 + 0.0F) * 0.00390625F + f17)).func_181666_a(f3, f4, f5, 0.8F).func_181663_c(0.0F, 1.0F, 0.0F).func_181675_d();
  39621. bufferbuilder.func_181662_b((double)(f23 + 0.0F), (double)(f2 + 4.0F - 9.765625E-4F), (double)(f24 + 0.0F)).func_187315_a((double)((f21 + 0.0F) * 0.00390625F + f16), (double)((f22 + 0.0F) * 0.00390625F + f17)).func_181666_a(f3, f4, f5, 0.8F).func_181663_c(0.0F, 1.0F, 0.0F).func_181675_d();
  39622. }
  39623.  
  39624. if(j1 > -1) {
  39625. for(int l1 = 0; l1 < 8; ++l1) {
  39626. bufferbuilder.func_181662_b((double)(f23 + (float)l1 + 0.0F), (double)(f2 + 0.0F), (double)(f24 + 8.0F)).func_187315_a((double)((f21 + (float)l1 + 0.5F) * 0.00390625F + f16), (double)((f22 + 8.0F) * 0.00390625F + f17)).func_181666_a(f25, f26, f27, 0.8F).func_181663_c(-1.0F, 0.0F, 0.0F).func_181675_d();
  39627. bufferbuilder.func_181662_b((double)(f23 + (float)l1 + 0.0F), (double)(f2 + 4.0F), (double)(f24 + 8.0F)).func_187315_a((double)((f21 + (float)l1 + 0.5F) * 0.00390625F + f16), (double)((f22 + 8.0F) * 0.00390625F + f17)).func_181666_a(f25, f26, f27, 0.8F).func_181663_c(-1.0F, 0.0F, 0.0F).func_181675_d();
  39628. bufferbuilder.func_181662_b((double)(f23 + (float)l1 + 0.0F), (double)(f2 + 4.0F), (double)(f24 + 0.0F)).func_187315_a((double)((f21 + (float)l1 + 0.5F) * 0.00390625F + f16), (double)((f22 + 0.0F) * 0.00390625F + f17)).func_181666_a(f25, f26, f27, 0.8F).func_181663_c(-1.0F, 0.0F, 0.0F).func_181675_d();
  39629. bufferbuilder.func_181662_b((double)(f23 + (float)l1 + 0.0F), (double)(f2 + 0.0F), (double)(f24 + 0.0F)).func_187315_a((double)((f21 + (float)l1 + 0.5F) * 0.00390625F + f16), (double)((f22 + 0.0F) * 0.00390625F + f17)).func_181666_a(f25, f26, f27, 0.8F).func_181663_c(-1.0F, 0.0F, 0.0F).func_181675_d();
  39630. }
  39631. }
  39632.  
  39633. if(j1 <= 1) {
  39634. for(int i2 = 0; i2 < 8; ++i2) {
  39635. bufferbuilder.func_181662_b((double)(f23 + (float)i2 + 1.0F - 9.765625E-4F), (double)(f2 + 0.0F), (double)(f24 + 8.0F)).func_187315_a((double)((f21 + (float)i2 + 0.5F) * 0.00390625F + f16), (double)((f22 + 8.0F) * 0.00390625F + f17)).func_181666_a(f25, f26, f27, 0.8F).func_181663_c(1.0F, 0.0F, 0.0F).func_181675_d();
  39636. bufferbuilder.func_181662_b((double)(f23 + (float)i2 + 1.0F - 9.765625E-4F), (double)(f2 + 4.0F), (double)(f24 + 8.0F)).func_187315_a((double)((f21 + (float)i2 + 0.5F) * 0.00390625F + f16), (double)((f22 + 8.0F) * 0.00390625F + f17)).func_181666_a(f25, f26, f27, 0.8F).func_181663_c(1.0F, 0.0F, 0.0F).func_181675_d();
  39637. bufferbuilder.func_181662_b((double)(f23 + (float)i2 + 1.0F - 9.765625E-4F), (double)(f2 + 4.0F), (double)(f24 + 0.0F)).func_187315_a((double)((f21 + (float)i2 + 0.5F) * 0.00390625F + f16), (double)((f22 + 0.0F) * 0.00390625F + f17)).func_181666_a(f25, f26, f27, 0.8F).func_181663_c(1.0F, 0.0F, 0.0F).func_181675_d();
  39638. bufferbuilder.func_181662_b((double)(f23 + (float)i2 + 1.0F - 9.765625E-4F), (double)(f2 + 0.0F), (double)(f24 + 0.0F)).func_187315_a((double)((f21 + (float)i2 + 0.5F) * 0.00390625F + f16), (double)((f22 + 0.0F) * 0.00390625F + f17)).func_181666_a(f25, f26, f27, 0.8F).func_181663_c(1.0F, 0.0F, 0.0F).func_181675_d();
  39639. }
  39640. }
  39641.  
  39642. if(k1 > -1) {
  39643. for(int j2 = 0; j2 < 8; ++j2) {
  39644. bufferbuilder.func_181662_b((double)(f23 + 0.0F), (double)(f2 + 4.0F), (double)(f24 + (float)j2 + 0.0F)).func_187315_a((double)((f21 + 0.0F) * 0.00390625F + f16), (double)((f22 + (float)j2 + 0.5F) * 0.00390625F + f17)).func_181666_a(f12, f13, f14, 0.8F).func_181663_c(0.0F, 0.0F, -1.0F).func_181675_d();
  39645. bufferbuilder.func_181662_b((double)(f23 + 8.0F), (double)(f2 + 4.0F), (double)(f24 + (float)j2 + 0.0F)).func_187315_a((double)((f21 + 8.0F) * 0.00390625F + f16), (double)((f22 + (float)j2 + 0.5F) * 0.00390625F + f17)).func_181666_a(f12, f13, f14, 0.8F).func_181663_c(0.0F, 0.0F, -1.0F).func_181675_d();
  39646. bufferbuilder.func_181662_b((double)(f23 + 8.0F), (double)(f2 + 0.0F), (double)(f24 + (float)j2 + 0.0F)).func_187315_a((double)((f21 + 8.0F) * 0.00390625F + f16), (double)((f22 + (float)j2 + 0.5F) * 0.00390625F + f17)).func_181666_a(f12, f13, f14, 0.8F).func_181663_c(0.0F, 0.0F, -1.0F).func_181675_d();
  39647. bufferbuilder.func_181662_b((double)(f23 + 0.0F), (double)(f2 + 0.0F), (double)(f24 + (float)j2 + 0.0F)).func_187315_a((double)((f21 + 0.0F) * 0.00390625F + f16), (double)((f22 + (float)j2 + 0.5F) * 0.00390625F + f17)).func_181666_a(f12, f13, f14, 0.8F).func_181663_c(0.0F, 0.0F, -1.0F).func_181675_d();
  39648. }
  39649. }
  39650.  
  39651. if(k1 <= 1) {
  39652. for(int k2 = 0; k2 < 8; ++k2) {
  39653. bufferbuilder.func_181662_b((double)(f23 + 0.0F), (double)(f2 + 4.0F), (double)(f24 + (float)k2 + 1.0F - 9.765625E-4F)).func_187315_a((double)((f21 + 0.0F) * 0.00390625F + f16), (double)((f22 + (float)k2 + 0.5F) * 0.00390625F + f17)).func_181666_a(f12, f13, f14, 0.8F).func_181663_c(0.0F, 0.0F, 1.0F).func_181675_d();
  39654. bufferbuilder.func_181662_b((double)(f23 + 8.0F), (double)(f2 + 4.0F), (double)(f24 + (float)k2 + 1.0F - 9.765625E-4F)).func_187315_a((double)((f21 + 8.0F) * 0.00390625F + f16), (double)((f22 + (float)k2 + 0.5F) * 0.00390625F + f17)).func_181666_a(f12, f13, f14, 0.8F).func_181663_c(0.0F, 0.0F, 1.0F).func_181675_d();
  39655. bufferbuilder.func_181662_b((double)(f23 + 8.0F), (double)(f2 + 0.0F), (double)(f24 + (float)k2 + 1.0F - 9.765625E-4F)).func_187315_a((double)((f21 + 8.0F) * 0.00390625F + f16), (double)((f22 + (float)k2 + 0.5F) * 0.00390625F + f17)).func_181666_a(f12, f13, f14, 0.8F).func_181663_c(0.0F, 0.0F, 1.0F).func_181675_d();
  39656. bufferbuilder.func_181662_b((double)(f23 + 0.0F), (double)(f2 + 0.0F), (double)(f24 + (float)k2 + 1.0F - 9.765625E-4F)).func_187315_a((double)((f21 + 0.0F) * 0.00390625F + f16), (double)((f22 + (float)k2 + 0.5F) * 0.00390625F + f17)).func_181666_a(f12, f13, f14, 0.8F).func_181663_c(0.0F, 0.0F, 1.0F).func_181675_d();
  39657. }
  39658. }
  39659.  
  39660. tessellator.func_78381_a();
  39661. }
  39662. }
  39663. }
  39664.  
  39665. GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
  39666. GlStateManager.func_179084_k();
  39667. GlStateManager.func_179089_o();
  39668. }
  39669.  
  39670. public void func_174967_a(long p_174967_1_) {
  39671. this.field_147595_R |= this.field_174995_M.func_178516_a(p_174967_1_);
  39672. if(!this.field_175009_l.isEmpty()) {
  39673. Iterator<RenderChunk> iterator = this.field_175009_l.iterator();
  39674.  
  39675. while(iterator.hasNext()) {
  39676. RenderChunk renderchunk = (RenderChunk)iterator.next();
  39677. boolean flag;
  39678. if(renderchunk.func_188281_o()) {
  39679. flag = this.field_174995_M.func_178505_b(renderchunk);
  39680. } else {
  39681. flag = this.field_174995_M.func_178507_a(renderchunk);
  39682. }
  39683.  
  39684. if(!flag) {
  39685. break;
  39686. }
  39687.  
  39688. renderchunk.func_188282_m();
  39689. iterator.remove();
  39690. long i = p_174967_1_ - System.nanoTime();
  39691. if(i < 0L) {
  39692. break;
  39693. }
  39694. }
  39695. }
  39696.  
  39697. }
  39698.  
  39699. public void func_180449_a(Entity p_180449_1_, float p_180449_2_) {
  39700. Tessellator tessellator = Tessellator.func_178181_a();
  39701. BufferBuilder bufferbuilder = tessellator.func_178180_c();
  39702. WorldBorder worldborder = this.field_72769_h.func_175723_af();
  39703. double d0 = (double)(this.field_72777_q.field_71474_y.field_151451_c * 16);
  39704. if(p_180449_1_.field_70165_t >= worldborder.func_177728_d() - d0 || p_180449_1_.field_70165_t <= worldborder.func_177726_b() + d0 || p_180449_1_.field_70161_v >= worldborder.func_177733_e() - d0 || p_180449_1_.field_70161_v <= worldborder.func_177736_c() + d0) {
  39705. double d1 = 1.0D - worldborder.func_177745_a(p_180449_1_) / d0;
  39706. d1 = Math.pow(d1, 4.0D);
  39707. double d2 = p_180449_1_.field_70142_S + (p_180449_1_.field_70165_t - p_180449_1_.field_70142_S) * (double)p_180449_2_;
  39708. double d3 = p_180449_1_.field_70137_T + (p_180449_1_.field_70163_u - p_180449_1_.field_70137_T) * (double)p_180449_2_;
  39709. double d4 = p_180449_1_.field_70136_U + (p_180449_1_.field_70161_v - p_180449_1_.field_70136_U) * (double)p_180449_2_;
  39710. GlStateManager.func_179147_l();
  39711. GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
  39712. this.field_72770_i.func_110577_a(field_175006_g);
  39713. GlStateManager.func_179132_a(false);
  39714. GlStateManager.func_179094_E();
  39715. int i = worldborder.func_177734_a().func_177766_a();
  39716. float f = (float)(i >> 16 & 255) / 255.0F;
  39717. float f1 = (float)(i >> 8 & 255) / 255.0F;
  39718. float f2 = (float)(i & 255) / 255.0F;
  39719. GlStateManager.func_179131_c(f, f1, f2, (float)d1);
  39720. GlStateManager.func_179136_a(-3.0F, -3.0F);
  39721. GlStateManager.func_179088_q();
  39722. GlStateManager.func_179092_a(516, 0.1F);
  39723. GlStateManager.func_179141_d();
  39724. GlStateManager.func_179129_p();
  39725. float f3 = (float)(Minecraft.func_71386_F() % 3000L) / 3000.0F;
  39726. float f4 = 0.0F;
  39727. float f5 = 0.0F;
  39728. float f6 = 128.0F;
  39729. bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181707_g);
  39730. bufferbuilder.func_178969_c(-d2, -d3, -d4);
  39731. double d5 = Math.max((double)MathHelper.func_76128_c(d4 - d0), worldborder.func_177736_c());
  39732. double d6 = Math.min((double)MathHelper.func_76143_f(d4 + d0), worldborder.func_177733_e());
  39733. if(d2 > worldborder.func_177728_d() - d0) {
  39734. float f7 = 0.0F;
  39735.  
  39736. for(double d7 = d5; d7 < d6; f7 += 0.5F) {
  39737. double d8 = Math.min(1.0D, d6 - d7);
  39738. float f8 = (float)d8 * 0.5F;
  39739. bufferbuilder.func_181662_b(worldborder.func_177728_d(), 256.0D, d7).func_187315_a((double)(f3 + f7), (double)(f3 + 0.0F)).func_181675_d();
  39740. bufferbuilder.func_181662_b(worldborder.func_177728_d(), 256.0D, d7 + d8).func_187315_a((double)(f3 + f8 + f7), (double)(f3 + 0.0F)).func_181675_d();
  39741. bufferbuilder.func_181662_b(worldborder.func_177728_d(), 0.0D, d7 + d8).func_187315_a((double)(f3 + f8 + f7), (double)(f3 + 128.0F)).func_181675_d();
  39742. bufferbuilder.func_181662_b(worldborder.func_177728_d(), 0.0D, d7).func_187315_a((double)(f3 + f7), (double)(f3 + 128.0F)).func_181675_d();
  39743. ++d7;
  39744. }
  39745. }
  39746.  
  39747. if(d2 < worldborder.func_177726_b() + d0) {
  39748. float f9 = 0.0F;
  39749.  
  39750. for(double d9 = d5; d9 < d6; f9 += 0.5F) {
  39751. double d12 = Math.min(1.0D, d6 - d9);
  39752. float f12 = (float)d12 * 0.5F;
  39753. bufferbuilder.func_181662_b(worldborder.func_177726_b(), 256.0D, d9).func_187315_a((double)(f3 + f9), (double)(f3 + 0.0F)).func_181675_d();
  39754. bufferbuilder.func_181662_b(worldborder.func_177726_b(), 256.0D, d9 + d12).func_187315_a((double)(f3 + f12 + f9), (double)(f3 + 0.0F)).func_181675_d();
  39755. bufferbuilder.func_181662_b(worldborder.func_177726_b(), 0.0D, d9 + d12).func_187315_a((double)(f3 + f12 + f9), (double)(f3 + 128.0F)).func_181675_d();
  39756. bufferbuilder.func_181662_b(worldborder.func_177726_b(), 0.0D, d9).func_187315_a((double)(f3 + f9), (double)(f3 + 128.0F)).func_181675_d();
  39757. ++d9;
  39758. }
  39759. }
  39760.  
  39761. d5 = Math.max((double)MathHelper.func_76128_c(d2 - d0), worldborder.func_177726_b());
  39762. d6 = Math.min((double)MathHelper.func_76143_f(d2 + d0), worldborder.func_177728_d());
  39763. if(d4 > worldborder.func_177733_e() - d0) {
  39764. float f10 = 0.0F;
  39765.  
  39766. for(double d10 = d5; d10 < d6; f10 += 0.5F) {
  39767. double d13 = Math.min(1.0D, d6 - d10);
  39768. float f13 = (float)d13 * 0.5F;
  39769. bufferbuilder.func_181662_b(d10, 256.0D, worldborder.func_177733_e()).func_187315_a((double)(f3 + f10), (double)(f3 + 0.0F)).func_181675_d();
  39770. bufferbuilder.func_181662_b(d10 + d13, 256.0D, worldborder.func_177733_e()).func_187315_a((double)(f3 + f13 + f10), (double)(f3 + 0.0F)).func_181675_d();
  39771. bufferbuilder.func_181662_b(d10 + d13, 0.0D, worldborder.func_177733_e()).func_187315_a((double)(f3 + f13 + f10), (double)(f3 + 128.0F)).func_181675_d();
  39772. bufferbuilder.func_181662_b(d10, 0.0D, worldborder.func_177733_e()).func_187315_a((double)(f3 + f10), (double)(f3 + 128.0F)).func_181675_d();
  39773. ++d10;
  39774. }
  39775. }
  39776.  
  39777. if(d4 < worldborder.func_177736_c() + d0) {
  39778. float f11 = 0.0F;
  39779.  
  39780. for(double d11 = d5; d11 < d6; f11 += 0.5F) {
  39781. double d14 = Math.min(1.0D, d6 - d11);
  39782. float f14 = (float)d14 * 0.5F;
  39783. bufferbuilder.func_181662_b(d11, 256.0D, worldborder.func_177736_c()).func_187315_a((double)(f3 + f11), (double)(f3 + 0.0F)).func_181675_d();
  39784. bufferbuilder.func_181662_b(d11 + d14, 256.0D, worldborder.func_177736_c()).func_187315_a((double)(f3 + f14 + f11), (double)(f3 + 0.0F)).func_181675_d();
  39785. bufferbuilder.func_181662_b(d11 + d14, 0.0D, worldborder.func_177736_c()).func_187315_a((double)(f3 + f14 + f11), (double)(f3 + 128.0F)).func_181675_d();
  39786. bufferbuilder.func_181662_b(d11, 0.0D, worldborder.func_177736_c()).func_187315_a((double)(f3 + f11), (double)(f3 + 128.0F)).func_181675_d();
  39787. ++d11;
  39788. }
  39789. }
  39790.  
  39791. tessellator.func_78381_a();
  39792. bufferbuilder.func_178969_c(0.0D, 0.0D, 0.0D);
  39793. GlStateManager.func_179089_o();
  39794. GlStateManager.func_179118_c();
  39795. GlStateManager.func_179136_a(0.0F, 0.0F);
  39796. GlStateManager.func_179113_r();
  39797. GlStateManager.func_179141_d();
  39798. GlStateManager.func_179084_k();
  39799. GlStateManager.func_179121_F();
  39800. GlStateManager.func_179132_a(true);
  39801. }
  39802. }
  39803.  
  39804. private void func_180443_s() {
  39805. GlStateManager.func_187428_a(GlStateManager.SourceFactor.DST_COLOR, GlStateManager.DestFactor.SRC_COLOR, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
  39806. GlStateManager.func_179147_l();
  39807. GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 0.5F);
  39808. GlStateManager.func_179136_a(-3.0F, -3.0F);
  39809. GlStateManager.func_179088_q();
  39810. GlStateManager.func_179092_a(516, 0.1F);
  39811. GlStateManager.func_179141_d();
  39812. GlStateManager.func_179094_E();
  39813. }
  39814.  
  39815. private void func_174969_t() {
  39816. GlStateManager.func_179118_c();
  39817. GlStateManager.func_179136_a(0.0F, 0.0F);
  39818. GlStateManager.func_179113_r();
  39819. GlStateManager.func_179141_d();
  39820. GlStateManager.func_179132_a(true);
  39821. GlStateManager.func_179121_F();
  39822. }
  39823.  
  39824. public void func_174981_a(Tessellator p_174981_1_, BufferBuilder p_174981_2_, Entity p_174981_3_, float p_174981_4_) {
  39825. double d0 = p_174981_3_.field_70142_S + (p_174981_3_.field_70165_t - p_174981_3_.field_70142_S) * (double)p_174981_4_;
  39826. double d1 = p_174981_3_.field_70137_T + (p_174981_3_.field_70163_u - p_174981_3_.field_70137_T) * (double)p_174981_4_;
  39827. double d2 = p_174981_3_.field_70136_U + (p_174981_3_.field_70161_v - p_174981_3_.field_70136_U) * (double)p_174981_4_;
  39828. if(!this.field_72738_E.isEmpty()) {
  39829. this.field_72770_i.func_110577_a(TextureMap.field_110575_b);
  39830. this.func_180443_s();
  39831. p_174981_2_.func_181668_a(7, DefaultVertexFormats.field_176600_a);
  39832. p_174981_2_.func_178969_c(-d0, -d1, -d2);
  39833. p_174981_2_.func_78914_f();
  39834. Iterator<DestroyBlockProgress> iterator = this.field_72738_E.values().iterator();
  39835.  
  39836. while(iterator.hasNext()) {
  39837. DestroyBlockProgress destroyblockprogress = (DestroyBlockProgress)iterator.next();
  39838. BlockPos blockpos = destroyblockprogress.func_180246_b();
  39839. double d3 = (double)blockpos.func_177958_n() - d0;
  39840. double d4 = (double)blockpos.func_177956_o() - d1;
  39841. double d5 = (double)blockpos.func_177952_p() - d2;
  39842. Block block = this.field_72769_h.func_180495_p(blockpos).func_177230_c();
  39843. if(!(block instanceof BlockChest) && !(block instanceof BlockEnderChest) && !(block instanceof BlockSign) && !(block instanceof BlockSkull)) {
  39844. if(d3 * d3 + d4 * d4 + d5 * d5 > 1024.0D) {
  39845. iterator.remove();
  39846. } else {
  39847. IBlockState iblockstate = this.field_72769_h.func_180495_p(blockpos);
  39848. if(iblockstate.func_185904_a() != Material.field_151579_a) {
  39849. int i = destroyblockprogress.func_73106_e();
  39850. TextureAtlasSprite textureatlassprite = this.field_94141_F[i];
  39851. BlockRendererDispatcher blockrendererdispatcher = this.field_72777_q.func_175602_ab();
  39852. blockrendererdispatcher.func_175020_a(iblockstate, blockpos, textureatlassprite, this.field_72769_h);
  39853. }
  39854. }
  39855. }
  39856. }
  39857.  
  39858. p_174981_1_.func_78381_a();
  39859. p_174981_2_.func_178969_c(0.0D, 0.0D, 0.0D);
  39860. this.func_174969_t();
  39861. }
  39862.  
  39863. }
  39864.  
  39865. public void func_72731_b(EntityPlayer p_72731_1_, RayTraceResult p_72731_2_, int p_72731_3_, float p_72731_4_) {
  39866. if(p_72731_3_ == 0 && p_72731_2_.field_72313_a == RayTraceResult.Type.BLOCK) {
  39867. GlStateManager.func_179147_l();
  39868. GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
  39869. GlStateManager.func_187441_d(2.0F);
  39870. GlStateManager.func_179090_x();
  39871. GlStateManager.func_179132_a(false);
  39872. BlockPos blockpos = p_72731_2_.func_178782_a();
  39873. IBlockState iblockstate = this.field_72769_h.func_180495_p(blockpos);
  39874. if(iblockstate.func_185904_a() != Material.field_151579_a && this.field_72769_h.func_175723_af().func_177746_a(blockpos)) {
  39875. double d0 = p_72731_1_.field_70142_S + (p_72731_1_.field_70165_t - p_72731_1_.field_70142_S) * (double)p_72731_4_;
  39876. double d1 = p_72731_1_.field_70137_T + (p_72731_1_.field_70163_u - p_72731_1_.field_70137_T) * (double)p_72731_4_;
  39877. double d2 = p_72731_1_.field_70136_U + (p_72731_1_.field_70161_v - p_72731_1_.field_70136_U) * (double)p_72731_4_;
  39878. func_189697_a(iblockstate.func_185918_c(this.field_72769_h, blockpos).func_186662_g(0.0020000000949949026D).func_72317_d(-d0, -d1, -d2), 0.0F, 0.0F, 0.0F, 0.4F);
  39879. }
  39880.  
  39881. GlStateManager.func_179132_a(true);
  39882. GlStateManager.func_179098_w();
  39883. GlStateManager.func_179084_k();
  39884. }
  39885.  
  39886. }
  39887.  
  39888. public static void func_189697_a(AxisAlignedBB p_189697_0_, float p_189697_1_, float p_189697_2_, float p_189697_3_, float p_189697_4_) {
  39889. func_189694_a(p_189697_0_.field_72340_a, p_189697_0_.field_72338_b, p_189697_0_.field_72339_c, p_189697_0_.field_72336_d, p_189697_0_.field_72337_e, p_189697_0_.field_72334_f, p_189697_1_, p_189697_2_, p_189697_3_, p_189697_4_);
  39890. }
  39891.  
  39892. public static void func_189694_a(double p_189694_0_, double p_189694_2_, double p_189694_4_, double p_189694_6_, double p_189694_8_, double p_189694_10_, float p_189694_12_, float p_189694_13_, float p_189694_14_, float p_189694_15_) {
  39893. Tessellator tessellator = Tessellator.func_178181_a();
  39894. BufferBuilder bufferbuilder = tessellator.func_178180_c();
  39895. bufferbuilder.func_181668_a(3, DefaultVertexFormats.field_181706_f);
  39896. func_189698_a(bufferbuilder, p_189694_0_, p_189694_2_, p_189694_4_, p_189694_6_, p_189694_8_, p_189694_10_, p_189694_12_, p_189694_13_, p_189694_14_, p_189694_15_);
  39897. tessellator.func_78381_a();
  39898. }
  39899.  
  39900. public static void func_189698_a(BufferBuilder p_189698_0_, double p_189698_1_, double p_189698_3_, double p_189698_5_, double p_189698_7_, double p_189698_9_, double p_189698_11_, float p_189698_13_, float p_189698_14_, float p_189698_15_, float p_189698_16_) {
  39901. p_189698_0_.func_181662_b(p_189698_1_, p_189698_3_, p_189698_5_).func_181666_a(p_189698_13_, p_189698_14_, p_189698_15_, 0.0F).func_181675_d();
  39902. p_189698_0_.func_181662_b(p_189698_1_, p_189698_3_, p_189698_5_).func_181666_a(p_189698_13_, p_189698_14_, p_189698_15_, p_189698_16_).func_181675_d();
  39903. p_189698_0_.func_181662_b(p_189698_7_, p_189698_3_, p_189698_5_).func_181666_a(p_189698_13_, p_189698_14_, p_189698_15_, p_189698_16_).func_181675_d();
  39904. p_189698_0_.func_181662_b(p_189698_7_, p_189698_3_, p_189698_11_).func_181666_a(p_189698_13_, p_189698_14_, p_189698_15_, p_189698_16_).func_181675_d();
  39905. p_189698_0_.func_181662_b(p_189698_1_, p_189698_3_, p_189698_11_).func_181666_a(p_189698_13_, p_189698_14_, p_189698_15_, p_189698_16_).func_181675_d();
  39906. p_189698_0_.func_181662_b(p_189698_1_, p_189698_3_, p_189698_5_).func_181666_a(p_189698_13_, p_189698_14_, p_189698_15_, p_189698_16_).func_181675_d();
  39907. p_189698_0_.func_181662_b(p_189698_1_, p_189698_9_, p_189698_5_).func_181666_a(p_189698_13_, p_189698_14_, p_189698_15_, p_189698_16_).func_181675_d();
  39908. p_189698_0_.func_181662_b(p_189698_7_, p_189698_9_, p_189698_5_).func_181666_a(p_189698_13_, p_189698_14_, p_189698_15_, p_189698_16_).func_181675_d();
  39909. p_189698_0_.func_181662_b(p_189698_7_, p_189698_9_, p_189698_11_).func_181666_a(p_189698_13_, p_189698_14_, p_189698_15_, p_189698_16_).func_181675_d();
  39910. p_189698_0_.func_181662_b(p_189698_1_, p_189698_9_, p_189698_11_).func_181666_a(p_189698_13_, p_189698_14_, p_189698_15_, p_189698_16_).func_181675_d();
  39911. p_189698_0_.func_181662_b(p_189698_1_, p_189698_9_, p_189698_5_).func_181666_a(p_189698_13_, p_189698_14_, p_189698_15_, p_189698_16_).func_181675_d();
  39912. p_189698_0_.func_181662_b(p_189698_1_, p_189698_9_, p_189698_11_).func_181666_a(p_189698_13_, p_189698_14_, p_189698_15_, 0.0F).func_181675_d();
  39913. p_189698_0_.func_181662_b(p_189698_1_, p_189698_3_, p_189698_11_).func_181666_a(p_189698_13_, p_189698_14_, p_189698_15_, p_189698_16_).func_181675_d();
  39914. p_189698_0_.func_181662_b(p_189698_7_, p_189698_9_, p_189698_11_).func_181666_a(p_189698_13_, p_189698_14_, p_189698_15_, 0.0F).func_181675_d();
  39915. p_189698_0_.func_181662_b(p_189698_7_, p_189698_3_, p_189698_11_).func_181666_a(p_189698_13_, p_189698_14_, p_189698_15_, p_189698_16_).func_181675_d();
  39916. p_189698_0_.func_181662_b(p_189698_7_, p_189698_9_, p_189698_5_).func_181666_a(p_189698_13_, p_189698_14_, p_189698_15_, 0.0F).func_181675_d();
  39917. p_189698_0_.func_181662_b(p_189698_7_, p_189698_3_, p_189698_5_).func_181666_a(p_189698_13_, p_189698_14_, p_189698_15_, p_189698_16_).func_181675_d();
  39918. p_189698_0_.func_181662_b(p_189698_7_, p_189698_3_, p_189698_5_).func_181666_a(p_189698_13_, p_189698_14_, p_189698_15_, 0.0F).func_181675_d();
  39919. }
  39920.  
  39921. public static void func_189696_b(AxisAlignedBB p_189696_0_, float p_189696_1_, float p_189696_2_, float p_189696_3_, float p_189696_4_) {
  39922. func_189695_b(p_189696_0_.field_72340_a, p_189696_0_.field_72338_b, p_189696_0_.field_72339_c, p_189696_0_.field_72336_d, p_189696_0_.field_72337_e, p_189696_0_.field_72334_f, p_189696_1_, p_189696_2_, p_189696_3_, p_189696_4_);
  39923. }
  39924.  
  39925. public static void func_189695_b(double p_189695_0_, double p_189695_2_, double p_189695_4_, double p_189695_6_, double p_189695_8_, double p_189695_10_, float p_189695_12_, float p_189695_13_, float p_189695_14_, float p_189695_15_) {
  39926. Tessellator tessellator = Tessellator.func_178181_a();
  39927. BufferBuilder bufferbuilder = tessellator.func_178180_c();
  39928. bufferbuilder.func_181668_a(5, DefaultVertexFormats.field_181706_f);
  39929. func_189693_b(bufferbuilder, p_189695_0_, p_189695_2_, p_189695_4_, p_189695_6_, p_189695_8_, p_189695_10_, p_189695_12_, p_189695_13_, p_189695_14_, p_189695_15_);
  39930. tessellator.func_78381_a();
  39931. }
  39932.  
  39933. public static void func_189693_b(BufferBuilder p_189693_0_, double p_189693_1_, double p_189693_3_, double p_189693_5_, double p_189693_7_, double p_189693_9_, double p_189693_11_, float p_189693_13_, float p_189693_14_, float p_189693_15_, float p_189693_16_) {
  39934. p_189693_0_.func_181662_b(p_189693_1_, p_189693_3_, p_189693_5_).func_181666_a(p_189693_13_, p_189693_14_, p_189693_15_, p_189693_16_).func_181675_d();
  39935. p_189693_0_.func_181662_b(p_189693_1_, p_189693_3_, p_189693_5_).func_181666_a(p_189693_13_, p_189693_14_, p_189693_15_, p_189693_16_).func_181675_d();
  39936. p_189693_0_.func_181662_b(p_189693_1_, p_189693_3_, p_189693_5_).func_181666_a(p_189693_13_, p_189693_14_, p_189693_15_, p_189693_16_).func_181675_d();
  39937. p_189693_0_.func_181662_b(p_189693_1_, p_189693_3_, p_189693_11_).func_181666_a(p_189693_13_, p_189693_14_, p_189693_15_, p_189693_16_).func_181675_d();
  39938. p_189693_0_.func_181662_b(p_189693_1_, p_189693_9_, p_189693_5_).func_181666_a(p_189693_13_, p_189693_14_, p_189693_15_, p_189693_16_).func_181675_d();
  39939. p_189693_0_.func_181662_b(p_189693_1_, p_189693_9_, p_189693_11_).func_181666_a(p_189693_13_, p_189693_14_, p_189693_15_, p_189693_16_).func_181675_d();
  39940. p_189693_0_.func_181662_b(p_189693_1_, p_189693_9_, p_189693_11_).func_181666_a(p_189693_13_, p_189693_14_, p_189693_15_, p_189693_16_).func_181675_d();
  39941. p_189693_0_.func_181662_b(p_189693_1_, p_189693_3_, p_189693_11_).func_181666_a(p_189693_13_, p_189693_14_, p_189693_15_, p_189693_16_).func_181675_d();
  39942. p_189693_0_.func_181662_b(p_189693_7_, p_189693_9_, p_189693_11_).func_181666_a(p_189693_13_, p_189693_14_, p_189693_15_, p_189693_16_).func_181675_d();
  39943. p_189693_0_.func_181662_b(p_189693_7_, p_189693_3_, p_189693_11_).func_181666_a(p_189693_13_, p_189693_14_, p_189693_15_, p_189693_16_).func_181675_d();
  39944. p_189693_0_.func_181662_b(p_189693_7_, p_189693_3_, p_189693_11_).func_181666_a(p_189693_13_, p_189693_14_, p_189693_15_, p_189693_16_).func_181675_d();
  39945. p_189693_0_.func_181662_b(p_189693_7_, p_189693_3_, p_189693_5_).func_181666_a(p_189693_13_, p_189693_14_, p_189693_15_, p_189693_16_).func_181675_d();
  39946. p_189693_0_.func_181662_b(p_189693_7_, p_189693_9_, p_189693_11_).func_181666_a(p_189693_13_, p_189693_14_, p_189693_15_, p_189693_16_).func_181675_d();
  39947. p_189693_0_.func_181662_b(p_189693_7_, p_189693_9_, p_189693_5_).func_181666_a(p_189693_13_, p_189693_14_, p_189693_15_, p_189693_16_).func_181675_d();
  39948. p_189693_0_.func_181662_b(p_189693_7_, p_189693_9_, p_189693_5_).func_181666_a(p_189693_13_, p_189693_14_, p_189693_15_, p_189693_16_).func_181675_d();
  39949. p_189693_0_.func_181662_b(p_189693_7_, p_189693_3_, p_189693_5_).func_181666_a(p_189693_13_, p_189693_14_, p_189693_15_, p_189693_16_).func_181675_d();
  39950. p_189693_0_.func_181662_b(p_189693_1_, p_189693_9_, p_189693_5_).func_181666_a(p_189693_13_, p_189693_14_, p_189693_15_, p_189693_16_).func_181675_d();
  39951. p_189693_0_.func_181662_b(p_189693_1_, p_189693_3_, p_189693_5_).func_181666_a(p_189693_13_, p_189693_14_, p_189693_15_, p_189693_16_).func_181675_d();
  39952. p_189693_0_.func_181662_b(p_189693_1_, p_189693_3_, p_189693_5_).func_181666_a(p_189693_13_, p_189693_14_, p_189693_15_, p_189693_16_).func_181675_d();
  39953. p_189693_0_.func_181662_b(p_189693_7_, p_189693_3_, p_189693_5_).func_181666_a(p_189693_13_, p_189693_14_, p_189693_15_, p_189693_16_).func_181675_d();
  39954. p_189693_0_.func_181662_b(p_189693_1_, p_189693_3_, p_189693_11_).func_181666_a(p_189693_13_, p_189693_14_, p_189693_15_, p_189693_16_).func_181675_d();
  39955. p_189693_0_.func_181662_b(p_189693_7_, p_189693_3_, p_189693_11_).func_181666_a(p_189693_13_, p_189693_14_, p_189693_15_, p_189693_16_).func_181675_d();
  39956. p_189693_0_.func_181662_b(p_189693_7_, p_189693_3_, p_189693_11_).func_181666_a(p_189693_13_, p_189693_14_, p_189693_15_, p_189693_16_).func_181675_d();
  39957. p_189693_0_.func_181662_b(p_189693_1_, p_189693_9_, p_189693_5_).func_181666_a(p_189693_13_, p_189693_14_, p_189693_15_, p_189693_16_).func_181675_d();
  39958. p_189693_0_.func_181662_b(p_189693_1_, p_189693_9_, p_189693_5_).func_181666_a(p_189693_13_, p_189693_14_, p_189693_15_, p_189693_16_).func_181675_d();
  39959. p_189693_0_.func_181662_b(p_189693_1_, p_189693_9_, p_189693_11_).func_181666_a(p_189693_13_, p_189693_14_, p_189693_15_, p_189693_16_).func_181675_d();
  39960. p_189693_0_.func_181662_b(p_189693_7_, p_189693_9_, p_189693_5_).func_181666_a(p_189693_13_, p_189693_14_, p_189693_15_, p_189693_16_).func_181675_d();
  39961. p_189693_0_.func_181662_b(p_189693_7_, p_189693_9_, p_189693_11_).func_181666_a(p_189693_13_, p_189693_14_, p_189693_15_, p_189693_16_).func_181675_d();
  39962. p_189693_0_.func_181662_b(p_189693_7_, p_189693_9_, p_189693_11_).func_181666_a(p_189693_13_, p_189693_14_, p_189693_15_, p_189693_16_).func_181675_d();
  39963. p_189693_0_.func_181662_b(p_189693_7_, p_189693_9_, p_189693_11_).func_181666_a(p_189693_13_, p_189693_14_, p_189693_15_, p_189693_16_).func_181675_d();
  39964. }
  39965.  
  39966. private void func_184385_a(int p_184385_1_, int p_184385_2_, int p_184385_3_, int p_184385_4_, int p_184385_5_, int p_184385_6_, boolean p_184385_7_) {
  39967. this.field_175008_n.func_187474_a(p_184385_1_, p_184385_2_, p_184385_3_, p_184385_4_, p_184385_5_, p_184385_6_, p_184385_7_);
  39968. }
  39969.  
  39970. public void func_184376_a(World p_184376_1_, BlockPos p_184376_2_, IBlockState p_184376_3_, IBlockState p_184376_4_, int p_184376_5_) {
  39971. int i = p_184376_2_.func_177958_n();
  39972. int j = p_184376_2_.func_177956_o();
  39973. int k = p_184376_2_.func_177952_p();
  39974. this.func_184385_a(i - 1, j - 1, k - 1, i + 1, j + 1, k + 1, (p_184376_5_ & 8) != 0);
  39975. }
  39976.  
  39977. public void func_174959_b(BlockPos p_174959_1_) {
  39978. this.field_184387_ae.add(p_174959_1_.func_185334_h());
  39979. }
  39980.  
  39981. public void func_147585_a(int p_147585_1_, int p_147585_2_, int p_147585_3_, int p_147585_4_, int p_147585_5_, int p_147585_6_) {
  39982. this.func_184385_a(p_147585_1_ - 1, p_147585_2_ - 1, p_147585_3_ - 1, p_147585_4_ + 1, p_147585_5_ + 1, p_147585_6_ + 1, false);
  39983. }
  39984.  
  39985. public void func_184377_a(@Nullable SoundEvent p_184377_1_, BlockPos p_184377_2_) {
  39986. ISound isound = (ISound)this.field_147593_P.get(p_184377_2_);
  39987. if(isound != null) {
  39988. this.field_72777_q.func_147118_V().func_147683_b(isound);
  39989. this.field_147593_P.remove(p_184377_2_);
  39990. }
  39991.  
  39992. if(p_184377_1_ != null) {
  39993. ItemRecord itemrecord = ItemRecord.func_185074_a(p_184377_1_);
  39994. if(itemrecord != null) {
  39995. this.field_72777_q.field_71456_v.func_73833_a(itemrecord.func_150927_i());
  39996. }
  39997.  
  39998. PositionedSoundRecord positionedsoundrecord = PositionedSoundRecord.func_184372_a(p_184377_1_, (float)p_184377_2_.func_177958_n(), (float)p_184377_2_.func_177956_o(), (float)p_184377_2_.func_177952_p());
  39999. this.field_147593_P.put(p_184377_2_, positionedsoundrecord);
  40000. this.field_72777_q.func_147118_V().func_147682_a(positionedsoundrecord);
  40001. }
  40002.  
  40003. this.func_193054_a(this.field_72769_h, p_184377_2_, p_184377_1_ != null);
  40004. }
  40005.  
  40006. private void func_193054_a(World p_193054_1_, BlockPos p_193054_2_, boolean p_193054_3_) {
  40007. for(EntityLivingBase entitylivingbase : p_193054_1_.func_72872_a(EntityLivingBase.class, (new AxisAlignedBB(p_193054_2_)).func_186662_g(3.0D))) {
  40008. entitylivingbase.func_191987_a(p_193054_2_, p_193054_3_);
  40009. }
  40010.  
  40011. }
  40012.  
  40013. public void func_184375_a(@Nullable EntityPlayer p_184375_1_, SoundEvent p_184375_2_, SoundCategory p_184375_3_, double p_184375_4_, double p_184375_6_, double p_184375_8_, float p_184375_10_, float p_184375_11_) {
  40014. }
  40015.  
  40016. public void func_180442_a(int p_180442_1_, boolean p_180442_2_, double p_180442_3_, double p_180442_5_, double p_180442_7_, double p_180442_9_, double p_180442_11_, double p_180442_13_, int... p_180442_15_) {
  40017. this.func_190570_a(p_180442_1_, p_180442_2_, false, p_180442_3_, p_180442_5_, p_180442_7_, p_180442_9_, p_180442_11_, p_180442_13_, p_180442_15_);
  40018. }
  40019.  
  40020. public void func_190570_a(int p_190570_1_, boolean p_190570_2_, boolean p_190570_3_, final double p_190570_4_, final double p_190570_6_, final double p_190570_8_, double p_190570_10_, double p_190570_12_, double p_190570_14_, int... p_190570_16_) {
  40021. try {
  40022. this.func_190571_b(p_190570_1_, p_190570_2_, p_190570_3_, p_190570_4_, p_190570_6_, p_190570_8_, p_190570_10_, p_190570_12_, p_190570_14_, p_190570_16_);
  40023. } catch (Throwable throwable) {
  40024. CrashReport crashreport = CrashReport.func_85055_a(throwable, "Exception while adding particle");
  40025. CrashReportCategory crashreportcategory = crashreport.func_85058_a("Particle being added");
  40026. crashreportcategory.func_71507_a("ID", Integer.valueOf(p_190570_1_));
  40027. if(p_190570_16_ != null) {
  40028. crashreportcategory.func_71507_a("Parameters", p_190570_16_);
  40029. }
  40030.  
  40031. crashreportcategory.func_189529_a("Position", new ICrashReportDetail<String>() {
  40032. public String call() throws Exception {
  40033. return CrashReportCategory.func_85074_a(p_190570_4_, p_190570_6_, p_190570_8_);
  40034. }
  40035. });
  40036. throw new ReportedException(crashreport);
  40037. }
  40038. }
  40039.  
  40040. private void func_174972_a(EnumParticleTypes p_174972_1_, double p_174972_2_, double p_174972_4_, double p_174972_6_, double p_174972_8_, double p_174972_10_, double p_174972_12_, int... p_174972_14_) {
  40041. this.func_180442_a(p_174972_1_.func_179348_c(), p_174972_1_.func_179344_e(), p_174972_2_, p_174972_4_, p_174972_6_, p_174972_8_, p_174972_10_, p_174972_12_, p_174972_14_);
  40042. }
  40043.  
  40044. @Nullable
  40045. private Particle func_174974_b(int p_174974_1_, boolean p_174974_2_, double p_174974_3_, double p_174974_5_, double p_174974_7_, double p_174974_9_, double p_174974_11_, double p_174974_13_, int... p_174974_15_) {
  40046. return this.func_190571_b(p_174974_1_, p_174974_2_, false, p_174974_3_, p_174974_5_, p_174974_7_, p_174974_9_, p_174974_11_, p_174974_13_, p_174974_15_);
  40047. }
  40048.  
  40049. @Nullable
  40050. private Particle func_190571_b(int p_190571_1_, boolean p_190571_2_, boolean p_190571_3_, double p_190571_4_, double p_190571_6_, double p_190571_8_, double p_190571_10_, double p_190571_12_, double p_190571_14_, int... p_190571_16_) {
  40051. Entity entity = this.field_72777_q.func_175606_aa();
  40052. if(this.field_72777_q != null && entity != null && this.field_72777_q.field_71452_i != null) {
  40053. int i = this.func_190572_a(p_190571_3_);
  40054. double d0 = entity.field_70165_t - p_190571_4_;
  40055. double d1 = entity.field_70163_u - p_190571_6_;
  40056. double d2 = entity.field_70161_v - p_190571_8_;
  40057. return p_190571_2_?this.field_72777_q.field_71452_i.func_178927_a(p_190571_1_, p_190571_4_, p_190571_6_, p_190571_8_, p_190571_10_, p_190571_12_, p_190571_14_, p_190571_16_):(d0 * d0 + d1 * d1 + d2 * d2 > 1024.0D?null:(i > 1?null:this.field_72777_q.field_71452_i.func_178927_a(p_190571_1_, p_190571_4_, p_190571_6_, p_190571_8_, p_190571_10_, p_190571_12_, p_190571_14_, p_190571_16_)));
  40058. } else {
  40059. return null;
  40060. }
  40061. }
  40062.  
  40063. private int func_190572_a(boolean p_190572_1_) {
  40064. int i = this.field_72777_q.field_71474_y.field_74362_aa;
  40065. if(p_190572_1_ && i == 2 && this.field_72769_h.field_73012_v.nextInt(10) == 0) {
  40066. i = 1;
  40067. }
  40068.  
  40069. if(i == 1 && this.field_72769_h.field_73012_v.nextInt(3) == 0) {
  40070. i = 2;
  40071. }
  40072.  
  40073. return i;
  40074. }
  40075.  
  40076. public void func_72703_a(Entity p_72703_1_) {
  40077. }
  40078.  
  40079. public void func_72709_b(Entity p_72709_1_) {
  40080. }
  40081.  
  40082. public void func_72728_f() {
  40083. }
  40084.  
  40085. public void func_180440_a(int p_180440_1_, BlockPos p_180440_2_, int p_180440_3_) {
  40086. switch(p_180440_1_) {
  40087. case 1023:
  40088. case 1028:
  40089. case 1038:
  40090. Entity entity = this.field_72777_q.func_175606_aa();
  40091. if(entity != null) {
  40092. double d0 = (double)p_180440_2_.func_177958_n() - entity.field_70165_t;
  40093. double d1 = (double)p_180440_2_.func_177956_o() - entity.field_70163_u;
  40094. double d2 = (double)p_180440_2_.func_177952_p() - entity.field_70161_v;
  40095. double d3 = Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2);
  40096. double d4 = entity.field_70165_t;
  40097. double d5 = entity.field_70163_u;
  40098. double d6 = entity.field_70161_v;
  40099. if(d3 > 0.0D) {
  40100. d4 += d0 / d3 * 2.0D;
  40101. d5 += d1 / d3 * 2.0D;
  40102. d6 += d2 / d3 * 2.0D;
  40103. }
  40104.  
  40105. if(p_180440_1_ == 1023) {
  40106. this.field_72769_h.func_184134_a(d4, d5, d6, SoundEvents.field_187855_gD, SoundCategory.HOSTILE, 1.0F, 1.0F, false);
  40107. } else if(p_180440_1_ == 1038) {
  40108. this.field_72769_h.func_184134_a(d4, d5, d6, SoundEvents.field_193782_bq, SoundCategory.HOSTILE, 1.0F, 1.0F, false);
  40109. } else {
  40110. this.field_72769_h.func_184134_a(d4, d5, d6, SoundEvents.field_187522_aL, SoundCategory.HOSTILE, 5.0F, 1.0F, false);
  40111. }
  40112. }
  40113. default:
  40114. }
  40115. }
  40116.  
  40117. public void func_180439_a(EntityPlayer p_180439_1_, int p_180439_2_, BlockPos p_180439_3_, int p_180439_4_) {
  40118. Random random = this.field_72769_h.field_73012_v;
  40119. switch(p_180439_2_) {
  40120. case 1000:
  40121. this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187574_as, SoundCategory.BLOCKS, 1.0F, 1.0F, false);
  40122. break;
  40123. case 1001:
  40124. this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187576_at, SoundCategory.BLOCKS, 1.0F, 1.2F, false);
  40125. break;
  40126. case 1002:
  40127. this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187578_au, SoundCategory.BLOCKS, 1.0F, 1.2F, false);
  40128. break;
  40129. case 1003:
  40130. this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187528_aR, SoundCategory.NEUTRAL, 1.0F, 1.2F, false);
  40131. break;
  40132. case 1004:
  40133. this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187634_bp, SoundCategory.NEUTRAL, 1.0F, 1.2F, false);
  40134. break;
  40135. case 1005:
  40136. this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187611_cI, SoundCategory.BLOCKS, 1.0F, this.field_72769_h.field_73012_v.nextFloat() * 0.1F + 0.9F, false);
  40137. break;
  40138. case 1006:
  40139. this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187875_gN, SoundCategory.BLOCKS, 1.0F, this.field_72769_h.field_73012_v.nextFloat() * 0.1F + 0.9F, false);
  40140. break;
  40141. case 1007:
  40142. this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187879_gP, SoundCategory.BLOCKS, 1.0F, this.field_72769_h.field_73012_v.nextFloat() * 0.1F + 0.9F, false);
  40143. break;
  40144. case 1008:
  40145. this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187613_bi, SoundCategory.BLOCKS, 1.0F, this.field_72769_h.field_73012_v.nextFloat() * 0.1F + 0.9F, false);
  40146. break;
  40147. case 1009:
  40148. this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187646_bt, SoundCategory.BLOCKS, 0.5F, 2.6F + (random.nextFloat() - random.nextFloat()) * 0.8F, false);
  40149. break;
  40150. case 1010:
  40151. if(Item.func_150899_d(p_180439_4_) instanceof ItemRecord) {
  40152. this.field_72769_h.func_184149_a(p_180439_3_, ((ItemRecord)Item.func_150899_d(p_180439_4_)).func_185075_h());
  40153. } else {
  40154. this.field_72769_h.func_184149_a(p_180439_3_, (SoundEvent)null);
  40155. }
  40156. break;
  40157. case 1011:
  40158. this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187608_cH, SoundCategory.BLOCKS, 1.0F, this.field_72769_h.field_73012_v.nextFloat() * 0.1F + 0.9F, false);
  40159. break;
  40160. case 1012:
  40161. this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187873_gM, SoundCategory.BLOCKS, 1.0F, this.field_72769_h.field_73012_v.nextFloat() * 0.1F + 0.9F, false);
  40162. break;
  40163. case 1013:
  40164. this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187877_gO, SoundCategory.BLOCKS, 1.0F, this.field_72769_h.field_73012_v.nextFloat() * 0.1F + 0.9F, false);
  40165. break;
  40166. case 1014:
  40167. this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187610_bh, SoundCategory.BLOCKS, 1.0F, this.field_72769_h.field_73012_v.nextFloat() * 0.1F + 0.9F, false);
  40168. break;
  40169. case 1015:
  40170. this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187559_bL, SoundCategory.HOSTILE, 10.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false);
  40171. break;
  40172. case 1016:
  40173. this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187557_bK, SoundCategory.HOSTILE, 10.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false);
  40174. break;
  40175. case 1017:
  40176. this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187527_aQ, SoundCategory.HOSTILE, 10.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false);
  40177. break;
  40178. case 1018:
  40179. this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187606_E, SoundCategory.HOSTILE, 2.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false);
  40180. break;
  40181. case 1019:
  40182. this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187927_ha, SoundCategory.HOSTILE, 2.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false);
  40183. break;
  40184. case 1020:
  40185. this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187928_hb, SoundCategory.HOSTILE, 2.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false);
  40186. break;
  40187. case 1021:
  40188. this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187929_hc, SoundCategory.HOSTILE, 2.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false);
  40189. break;
  40190. case 1022:
  40191. this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187926_gz, SoundCategory.HOSTILE, 2.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false);
  40192. break;
  40193. case 1024:
  40194. this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187853_gC, SoundCategory.HOSTILE, 2.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false);
  40195. break;
  40196. case 1025:
  40197. this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187744_z, SoundCategory.NEUTRAL, 0.05F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false);
  40198. break;
  40199. case 1026:
  40200. this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187945_hs, SoundCategory.HOSTILE, 2.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false);
  40201. break;
  40202. case 1027:
  40203. this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187941_ho, SoundCategory.NEUTRAL, 2.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false);
  40204. break;
  40205. case 1029:
  40206. this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187680_c, SoundCategory.BLOCKS, 1.0F, this.field_72769_h.field_73012_v.nextFloat() * 0.1F + 0.9F, false);
  40207. break;
  40208. case 1030:
  40209. this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187698_i, SoundCategory.BLOCKS, 1.0F, this.field_72769_h.field_73012_v.nextFloat() * 0.1F + 0.9F, false);
  40210. break;
  40211. case 1031:
  40212. this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187689_f, SoundCategory.BLOCKS, 0.3F, this.field_72769_h.field_73012_v.nextFloat() * 0.1F + 0.9F, false);
  40213. break;
  40214. case 1032:
  40215. this.field_72777_q.func_147118_V().func_147682_a(PositionedSoundRecord.func_184371_a(SoundEvents.field_187812_eh, random.nextFloat() * 0.4F + 0.8F));
  40216. break;
  40217. case 1033:
  40218. this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187542_ac, SoundCategory.BLOCKS, 1.0F, 1.0F, false);
  40219. break;
  40220. case 1034:
  40221. this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187540_ab, SoundCategory.BLOCKS, 1.0F, 1.0F, false);
  40222. break;
  40223. case 1035:
  40224. this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187621_J, SoundCategory.BLOCKS, 1.0F, 1.0F, false);
  40225. break;
  40226. case 1036:
  40227. this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187614_cJ, SoundCategory.BLOCKS, 1.0F, this.field_72769_h.field_73012_v.nextFloat() * 0.1F + 0.9F, false);
  40228. break;
  40229. case 1037:
  40230. this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187617_cK, SoundCategory.BLOCKS, 1.0F, this.field_72769_h.field_73012_v.nextFloat() * 0.1F + 0.9F, false);
  40231. break;
  40232. case 2000:
  40233. int l = p_180439_4_ % 3 - 1;
  40234. int i = p_180439_4_ / 3 % 3 - 1;
  40235. double d8 = (double)p_180439_3_.func_177958_n() + (double)l * 0.6D + 0.5D;
  40236. double d10 = (double)p_180439_3_.func_177956_o() + 0.5D;
  40237. double d12 = (double)p_180439_3_.func_177952_p() + (double)i * 0.6D + 0.5D;
  40238.  
  40239. for(int j1 = 0; j1 < 10; ++j1) {
  40240. double d13 = random.nextDouble() * 0.2D + 0.01D;
  40241. double d16 = d8 + (double)l * 0.01D + (random.nextDouble() - 0.5D) * (double)i * 0.5D;
  40242. double d19 = d10 + (random.nextDouble() - 0.5D) * 0.5D;
  40243. double d22 = d12 + (double)i * 0.01D + (random.nextDouble() - 0.5D) * (double)l * 0.5D;
  40244. double d24 = (double)l * d13 + random.nextGaussian() * 0.01D;
  40245. double d26 = -0.03D + random.nextGaussian() * 0.01D;
  40246. double d27 = (double)i * d13 + random.nextGaussian() * 0.01D;
  40247. this.func_174972_a(EnumParticleTypes.SMOKE_NORMAL, d16, d19, d22, d24, d26, d27, new int[0]);
  40248. }
  40249.  
  40250. return;
  40251. case 2001:
  40252. Block block = Block.func_149729_e(p_180439_4_ & 4095);
  40253. if(block.func_176223_P().func_185904_a() != Material.field_151579_a) {
  40254. SoundType soundtype = block.func_185467_w();
  40255. this.field_72769_h.func_184156_a(p_180439_3_, soundtype.func_185845_c(), SoundCategory.BLOCKS, (soundtype.func_185843_a() + 1.0F) / 2.0F, soundtype.func_185847_b() * 0.8F, false);
  40256. }
  40257.  
  40258. this.field_72777_q.field_71452_i.func_180533_a(p_180439_3_, block.func_176203_a(p_180439_4_ >> 12 & 255));
  40259. break;
  40260. case 2002:
  40261. case 2007:
  40262. double d6 = (double)p_180439_3_.func_177958_n();
  40263. double d7 = (double)p_180439_3_.func_177956_o();
  40264. double d9 = (double)p_180439_3_.func_177952_p();
  40265.  
  40266. for(int i1 = 0; i1 < 8; ++i1) {
  40267. this.func_174972_a(EnumParticleTypes.ITEM_CRACK, d6, d7, d9, random.nextGaussian() * 0.15D, random.nextDouble() * 0.2D, random.nextGaussian() * 0.15D, new int[]{Item.func_150891_b(Items.field_185155_bH)});
  40268. }
  40269.  
  40270. float f5 = (float)(p_180439_4_ >> 16 & 255) / 255.0F;
  40271. float f = (float)(p_180439_4_ >> 8 & 255) / 255.0F;
  40272. float f1 = (float)(p_180439_4_ >> 0 & 255) / 255.0F;
  40273. EnumParticleTypes enumparticletypes = p_180439_2_ == 2007?EnumParticleTypes.SPELL_INSTANT:EnumParticleTypes.SPELL;
  40274.  
  40275. for(int l1 = 0; l1 < 100; ++l1) {
  40276. double d15 = random.nextDouble() * 4.0D;
  40277. double d18 = random.nextDouble() * 3.141592653589793D * 2.0D;
  40278. double d21 = Math.cos(d18) * d15;
  40279. double d23 = 0.01D + random.nextDouble() * 0.5D;
  40280. double d25 = Math.sin(d18) * d15;
  40281. Particle particle1 = this.func_174974_b(enumparticletypes.func_179348_c(), enumparticletypes.func_179344_e(), d6 + d21 * 0.1D, d7 + 0.3D, d9 + d25 * 0.1D, d21, d23, d25, new int[0]);
  40282. if(particle1 != null) {
  40283. float f4 = 0.75F + random.nextFloat() * 0.25F;
  40284. particle1.func_70538_b(f5 * f4, f * f4, f1 * f4);
  40285. particle1.func_70543_e((float)d15);
  40286. }
  40287. }
  40288.  
  40289. this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187825_fO, SoundCategory.NEUTRAL, 1.0F, this.field_72769_h.field_73012_v.nextFloat() * 0.1F + 0.9F, false);
  40290. break;
  40291. case 2003:
  40292. double d0 = (double)p_180439_3_.func_177958_n() + 0.5D;
  40293. double d1 = (double)p_180439_3_.func_177956_o();
  40294. double d2 = (double)p_180439_3_.func_177952_p() + 0.5D;
  40295.  
  40296. for(int j = 0; j < 8; ++j) {
  40297. this.func_174972_a(EnumParticleTypes.ITEM_CRACK, d0, d1, d2, random.nextGaussian() * 0.15D, random.nextDouble() * 0.2D, random.nextGaussian() * 0.15D, new int[]{Item.func_150891_b(Items.field_151061_bv)});
  40298. }
  40299.  
  40300. for(double d11 = 0.0D; d11 < 6.283185307179586D; d11 += 0.15707963267948966D) {
  40301. this.func_174972_a(EnumParticleTypes.PORTAL, d0 + Math.cos(d11) * 5.0D, d1 - 0.4D, d2 + Math.sin(d11) * 5.0D, Math.cos(d11) * -5.0D, 0.0D, Math.sin(d11) * -5.0D, new int[0]);
  40302. this.func_174972_a(EnumParticleTypes.PORTAL, d0 + Math.cos(d11) * 5.0D, d1 - 0.4D, d2 + Math.sin(d11) * 5.0D, Math.cos(d11) * -7.0D, 0.0D, Math.sin(d11) * -7.0D, new int[0]);
  40303. }
  40304.  
  40305. return;
  40306. case 2004:
  40307. for(int k1 = 0; k1 < 20; ++k1) {
  40308. double d14 = (double)p_180439_3_.func_177958_n() + 0.5D + ((double)this.field_72769_h.field_73012_v.nextFloat() - 0.5D) * 2.0D;
  40309. double d17 = (double)p_180439_3_.func_177956_o() + 0.5D + ((double)this.field_72769_h.field_73012_v.nextFloat() - 0.5D) * 2.0D;
  40310. double d20 = (double)p_180439_3_.func_177952_p() + 0.5D + ((double)this.field_72769_h.field_73012_v.nextFloat() - 0.5D) * 2.0D;
  40311. this.field_72769_h.func_175688_a(EnumParticleTypes.SMOKE_NORMAL, d14, d17, d20, 0.0D, 0.0D, 0.0D, new int[0]);
  40312. this.field_72769_h.func_175688_a(EnumParticleTypes.FLAME, d14, d17, d20, 0.0D, 0.0D, 0.0D, new int[0]);
  40313. }
  40314.  
  40315. return;
  40316. case 2005:
  40317. ItemDye.func_180617_a(this.field_72769_h, p_180439_3_, p_180439_4_);
  40318. break;
  40319. case 2006:
  40320. for(int k = 0; k < 200; ++k) {
  40321. float f2 = random.nextFloat() * 4.0F;
  40322. float f3 = random.nextFloat() * 6.2831855F;
  40323. double d3 = (double)(MathHelper.func_76134_b(f3) * f2);
  40324. double d4 = 0.01D + random.nextDouble() * 0.5D;
  40325. double d5 = (double)(MathHelper.func_76126_a(f3) * f2);
  40326. Particle particle = this.func_174974_b(EnumParticleTypes.DRAGON_BREATH.func_179348_c(), false, (double)p_180439_3_.func_177958_n() + d3 * 0.1D, (double)p_180439_3_.func_177956_o() + 0.3D, (double)p_180439_3_.func_177952_p() + d5 * 0.1D, d3, d4, d5, new int[0]);
  40327. if(particle != null) {
  40328. particle.func_70543_e(f2);
  40329. }
  40330. }
  40331.  
  40332. this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187523_aM, SoundCategory.HOSTILE, 1.0F, this.field_72769_h.field_73012_v.nextFloat() * 0.1F + 0.9F, false);
  40333. break;
  40334. case 3000:
  40335. this.field_72769_h.func_175682_a(EnumParticleTypes.EXPLOSION_HUGE, true, (double)p_180439_3_.func_177958_n() + 0.5D, (double)p_180439_3_.func_177956_o() + 0.5D, (double)p_180439_3_.func_177952_p() + 0.5D, 0.0D, 0.0D, 0.0D, new int[0]);
  40336. this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187598_bd, SoundCategory.BLOCKS, 10.0F, (1.0F + (this.field_72769_h.field_73012_v.nextFloat() - this.field_72769_h.field_73012_v.nextFloat()) * 0.2F) * 0.7F, false);
  40337. break;
  40338. case 3001:
  40339. this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187525_aO, SoundCategory.HOSTILE, 64.0F, 0.8F + this.field_72769_h.field_73012_v.nextFloat() * 0.3F, false);
  40340. }
  40341.  
  40342. }
  40343.  
  40344. public void func_180441_b(int p_180441_1_, BlockPos p_180441_2_, int p_180441_3_) {
  40345. if(p_180441_3_ >= 0 && p_180441_3_ < 10) {
  40346. DestroyBlockProgress destroyblockprogress = (DestroyBlockProgress)this.field_72738_E.get(Integer.valueOf(p_180441_1_));
  40347. if(destroyblockprogress == null || destroyblockprogress.func_180246_b().func_177958_n() != p_180441_2_.func_177958_n() || destroyblockprogress.func_180246_b().func_177956_o() != p_180441_2_.func_177956_o() || destroyblockprogress.func_180246_b().func_177952_p() != p_180441_2_.func_177952_p()) {
  40348. destroyblockprogress = new DestroyBlockProgress(p_180441_1_, p_180441_2_);
  40349. this.field_72738_E.put(Integer.valueOf(p_180441_1_), destroyblockprogress);
  40350. }
  40351.  
  40352. destroyblockprogress.func_73107_a(p_180441_3_);
  40353. destroyblockprogress.func_82744_b(this.field_72773_u);
  40354. } else {
  40355. this.field_72738_E.remove(Integer.valueOf(p_180441_1_));
  40356. }
  40357.  
  40358. }
  40359.  
  40360. public boolean func_184384_n() {
  40361. return this.field_175009_l.isEmpty() && this.field_174995_M.func_188247_f();
  40362. }
  40363.  
  40364. public void func_174979_m() {
  40365. this.field_147595_R = true;
  40366. }
  40367.  
  40368. public void func_181023_a(Collection<TileEntity> p_181023_1_, Collection<TileEntity> p_181023_2_) {
  40369. synchronized(this.field_181024_n) {
  40370. this.field_181024_n.removeAll(p_181023_1_);
  40371. this.field_181024_n.addAll(p_181023_2_);
  40372. }
  40373. }
  40374.  
  40375. @SideOnly(Side.CLIENT)
  40376. class ContainerLocalRenderInformation {
  40377. final RenderChunk field_178036_a;
  40378. final EnumFacing field_178034_b;
  40379. byte field_178035_c;
  40380. final int field_178032_d;
  40381.  
  40382. private ContainerLocalRenderInformation(RenderChunk p_i46248_2_, EnumFacing p_i46248_3_, @Nullable int p_i46248_4_) {
  40383. this.field_178036_a = p_i46248_2_;
  40384. this.field_178034_b = p_i46248_3_;
  40385. this.field_178032_d = p_i46248_4_;
  40386. }
  40387.  
  40388. public void func_189561_a(byte p_189561_1_, EnumFacing p_189561_2_) {
  40389. this.field_178035_c = (byte)(this.field_178035_c | p_189561_1_ | 1 << p_189561_2_.ordinal());
  40390. }
  40391.  
  40392. public boolean func_189560_a(EnumFacing p_189560_1_) {
  40393. return (this.field_178035_c & 1 << p_189560_1_.ordinal()) > 0;
  40394. }
  40395. }
  40396. }
  40397.  
  40398. Patching failed: minecraft\net\minecraft\client\renderer\BlockRendererDispatcher.java
  40399. Hunk 1 failed! Cannot find hunk target
  40400. return this.field_175028_a.func_178125_b(p_184389_1_);
  40401. }
  40402.  
  40403. + @SuppressWarnings("incomplete-switch")
  40404. public void func_175016_a(IBlockState p_175016_1_, float p_175016_2_) {
  40405. EnumBlockRenderType enumblockrendertype = p_175016_1_.func_185901_i();
  40406. if (enumblockrendertype != EnumBlockRenderType.INVISIBLE) {
  40407. File state
  40408. package net.minecraft.client.renderer;
  40409.  
  40410. import net.minecraft.block.state.IBlockState;
  40411. import net.minecraft.client.renderer.BlockFluidRenderer;
  40412. import net.minecraft.client.renderer.BlockModelRenderer;
  40413. import net.minecraft.client.renderer.BlockModelShapes;
  40414. import net.minecraft.client.renderer.BufferBuilder;
  40415. import net.minecraft.client.renderer.ChestRenderer;
  40416. import net.minecraft.client.renderer.Tessellator;
  40417. import net.minecraft.client.renderer.block.model.IBakedModel;
  40418. import net.minecraft.client.renderer.block.model.SimpleBakedModel;
  40419. import net.minecraft.client.renderer.color.BlockColors;
  40420. import net.minecraft.client.renderer.texture.TextureAtlasSprite;
  40421. import net.minecraft.client.resources.IResourceManager;
  40422. import net.minecraft.client.resources.IResourceManagerReloadListener;
  40423. import net.minecraft.crash.CrashReport;
  40424. import net.minecraft.crash.CrashReportCategory;
  40425. import net.minecraft.util.EnumBlockRenderType;
  40426. import net.minecraft.util.ReportedException;
  40427. import net.minecraft.util.math.BlockPos;
  40428. import net.minecraft.world.IBlockAccess;
  40429. import net.minecraft.world.WorldType;
  40430. import net.minecraftforge.fml.relauncher.Side;
  40431. import net.minecraftforge.fml.relauncher.SideOnly;
  40432.  
  40433. @SideOnly(Side.CLIENT)
  40434. public class BlockRendererDispatcher implements IResourceManagerReloadListener {
  40435. private final BlockModelShapes field_175028_a;
  40436. private final BlockModelRenderer field_175027_c;
  40437. private final ChestRenderer field_175024_d = new ChestRenderer();
  40438. private final BlockFluidRenderer field_175025_e;
  40439.  
  40440. public BlockRendererDispatcher(BlockModelShapes p_i46577_1_, BlockColors p_i46577_2_) {
  40441. this.field_175028_a = p_i46577_1_;
  40442. this.field_175027_c = new BlockModelRenderer(p_i46577_2_);
  40443. this.field_175025_e = new BlockFluidRenderer(p_i46577_2_);
  40444. }
  40445.  
  40446. public BlockModelShapes func_175023_a() {
  40447. return this.field_175028_a;
  40448. }
  40449.  
  40450. public void func_175020_a(IBlockState p_175020_1_, BlockPos p_175020_2_, TextureAtlasSprite p_175020_3_, IBlockAccess p_175020_4_) {
  40451. if(p_175020_1_.func_185901_i() == EnumBlockRenderType.MODEL) {
  40452. p_175020_1_ = p_175020_1_.func_185899_b(p_175020_4_, p_175020_2_);
  40453. IBakedModel ibakedmodel = this.field_175028_a.func_178125_b(p_175020_1_);
  40454. IBakedModel ibakedmodel1 = (new SimpleBakedModel.Builder(p_175020_1_, ibakedmodel, p_175020_3_, p_175020_2_)).func_177645_b();
  40455. this.field_175027_c.func_178267_a(p_175020_4_, ibakedmodel1, p_175020_1_, p_175020_2_, Tessellator.func_178181_a().func_178180_c(), true);
  40456. }
  40457. }
  40458.  
  40459. public boolean func_175018_a(IBlockState p_175018_1_, BlockPos p_175018_2_, IBlockAccess p_175018_3_, BufferBuilder p_175018_4_) {
  40460. try {
  40461. EnumBlockRenderType enumblockrendertype = p_175018_1_.func_185901_i();
  40462. if(enumblockrendertype == EnumBlockRenderType.INVISIBLE) {
  40463. return false;
  40464. } else {
  40465. if(p_175018_3_.func_175624_G() != WorldType.field_180272_g) {
  40466. try {
  40467. p_175018_1_ = p_175018_1_.func_185899_b(p_175018_3_, p_175018_2_);
  40468. } catch (Exception var8) {
  40469. ;
  40470. }
  40471. }
  40472.  
  40473. switch(enumblockrendertype) {
  40474. case MODEL:
  40475. return this.field_175027_c.func_178267_a(p_175018_3_, this.func_184389_a(p_175018_1_), p_175018_1_, p_175018_2_, p_175018_4_, true);
  40476. case ENTITYBLOCK_ANIMATED:
  40477. return false;
  40478. case LIQUID:
  40479. return this.field_175025_e.func_178270_a(p_175018_3_, p_175018_1_, p_175018_2_, p_175018_4_);
  40480. default:
  40481. return false;
  40482. }
  40483. }
  40484. } catch (Throwable throwable) {
  40485. CrashReport crashreport = CrashReport.func_85055_a(throwable, "Tesselating block in world");
  40486. CrashReportCategory crashreportcategory = crashreport.func_85058_a("Block being tesselated");
  40487. CrashReportCategory.func_180523_a(crashreportcategory, p_175018_2_, p_175018_1_.func_177230_c(), p_175018_1_.func_177230_c().func_176201_c(p_175018_1_));
  40488. throw new ReportedException(crashreport);
  40489. }
  40490. }
  40491.  
  40492. public BlockModelRenderer func_175019_b() {
  40493. return this.field_175027_c;
  40494. }
  40495.  
  40496. public IBakedModel func_184389_a(IBlockState p_184389_1_) {
  40497. return this.field_175028_a.func_178125_b(p_184389_1_);
  40498. }
  40499.  
  40500. public void func_175016_a(IBlockState p_175016_1_, float p_175016_2_) {
  40501. EnumBlockRenderType enumblockrendertype = p_175016_1_.func_185901_i();
  40502. if(enumblockrendertype != EnumBlockRenderType.INVISIBLE) {
  40503. switch(enumblockrendertype) {
  40504. case MODEL:
  40505. IBakedModel ibakedmodel = this.func_184389_a(p_175016_1_);
  40506. this.field_175027_c.func_178266_a(ibakedmodel, p_175016_1_, p_175016_2_, true);
  40507. break;
  40508. case ENTITYBLOCK_ANIMATED:
  40509. this.field_175024_d.func_178175_a(p_175016_1_.func_177230_c(), p_175016_2_);
  40510. case LIQUID:
  40511. }
  40512.  
  40513. }
  40514. }
  40515.  
  40516. public void func_110549_a(IResourceManager p_110549_1_) {
  40517. this.field_175025_e.func_178268_a();
  40518. }
  40519. }
  40520.  
  40521. Patching failed: minecraft\net\minecraft\client\renderer\block\model\Variant.java
  40522. Hunk 1 failed! Cannot find hunk target
  40523. public int hashCode() {
  40524. int i = this.field_188050_a.hashCode();
  40525. i = 31 * i + this.field_188051_b.hashCode();
  40526. - i = 31 * i + this.field_188052_c.hashCode();
  40527. + i = 31 * i + Boolean.valueOf(this.field_188052_c).hashCode();
  40528. i = 31 * i + this.field_188053_d;
  40529. return i;
  40530. }
  40531. File state
  40532. package net.minecraft.client.renderer.block.model;
  40533.  
  40534. import com.google.gson.JsonDeserializationContext;
  40535. import com.google.gson.JsonDeserializer;
  40536. import com.google.gson.JsonElement;
  40537. import com.google.gson.JsonObject;
  40538. import com.google.gson.JsonParseException;
  40539. import java.lang.reflect.Type;
  40540. import net.minecraft.client.renderer.block.model.ModelRotation;
  40541. import net.minecraft.util.JsonUtils;
  40542. import net.minecraft.util.ResourceLocation;
  40543. import net.minecraftforge.fml.relauncher.Side;
  40544. import net.minecraftforge.fml.relauncher.SideOnly;
  40545.  
  40546. @SideOnly(Side.CLIENT)
  40547. public class Variant {
  40548. private final ResourceLocation field_188050_a;
  40549. private final ModelRotation field_188051_b;
  40550. private final boolean field_188052_c;
  40551. private final int field_188053_d;
  40552.  
  40553. public Variant(ResourceLocation p_i46567_1_, ModelRotation p_i46567_2_, boolean p_i46567_3_, int p_i46567_4_) {
  40554. this.field_188050_a = p_i46567_1_;
  40555. this.field_188051_b = p_i46567_2_;
  40556. this.field_188052_c = p_i46567_3_;
  40557. this.field_188053_d = p_i46567_4_;
  40558. }
  40559.  
  40560. public ResourceLocation func_188046_a() {
  40561. return this.field_188050_a;
  40562. }
  40563.  
  40564. public ModelRotation func_188048_b() {
  40565. return this.field_188051_b;
  40566. }
  40567.  
  40568. public boolean func_188049_c() {
  40569. return this.field_188052_c;
  40570. }
  40571.  
  40572. public int func_188047_d() {
  40573. return this.field_188053_d;
  40574. }
  40575.  
  40576. public String toString() {
  40577. return "Variant{modelLocation=" + this.field_188050_a + ", rotation=" + this.field_188051_b + ", uvLock=" + this.field_188052_c + ", weight=" + this.field_188053_d + '}';
  40578. }
  40579.  
  40580. public boolean equals(Object p_equals_1_) {
  40581. if(this == p_equals_1_) {
  40582. return true;
  40583. } else if(!(p_equals_1_ instanceof Variant)) {
  40584. return false;
  40585. } else {
  40586. Variant variant = (Variant)p_equals_1_;
  40587. return this.field_188050_a.equals(variant.field_188050_a) && this.field_188051_b == variant.field_188051_b && this.field_188052_c == variant.field_188052_c && this.field_188053_d == variant.field_188053_d;
  40588. }
  40589. }
  40590.  
  40591. public int hashCode() {
  40592. int i = this.field_188050_a.hashCode();
  40593. i = 31 * i + this.field_188051_b.hashCode();
  40594. i = 31 * i + Boolean.valueOf(this.field_188052_c).hashCode();
  40595. i = 31 * i + this.field_188053_d;
  40596. return i;
  40597. }
  40598.  
  40599. @SideOnly(Side.CLIENT)
  40600. public static class Deserializer implements JsonDeserializer<Variant> {
  40601. public Variant deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException {
  40602. JsonObject jsonobject = p_deserialize_1_.getAsJsonObject();
  40603. String s = this.func_188043_b(jsonobject);
  40604. ModelRotation modelrotation = this.func_188042_a(jsonobject);
  40605. boolean flag = this.func_188044_d(jsonobject);
  40606. int i = this.func_188045_c(jsonobject);
  40607. return new Variant(this.func_188041_a(s), modelrotation, flag, i);
  40608. }
  40609.  
  40610. private ResourceLocation func_188041_a(String p_188041_1_) {
  40611. ResourceLocation resourcelocation = new ResourceLocation(p_188041_1_);
  40612. resourcelocation = new ResourceLocation(resourcelocation.func_110624_b(), "block/" + resourcelocation.func_110623_a());
  40613. return resourcelocation;
  40614. }
  40615.  
  40616. private boolean func_188044_d(JsonObject p_188044_1_) {
  40617. return JsonUtils.func_151209_a(p_188044_1_, "uvlock", false);
  40618. }
  40619.  
  40620. protected ModelRotation func_188042_a(JsonObject p_188042_1_) {
  40621. int i = JsonUtils.func_151208_a(p_188042_1_, "x", 0);
  40622. int j = JsonUtils.func_151208_a(p_188042_1_, "y", 0);
  40623. ModelRotation modelrotation = ModelRotation.func_177524_a(i, j);
  40624. if(modelrotation == null) {
  40625. throw new JsonParseException("Invalid BlockModelRotation x: " + i + ", y: " + j);
  40626. } else {
  40627. return modelrotation;
  40628. }
  40629. }
  40630.  
  40631. protected String func_188043_b(JsonObject p_188043_1_) {
  40632. return JsonUtils.func_151200_h(p_188043_1_, "model");
  40633. }
  40634.  
  40635. protected int func_188045_c(JsonObject p_188045_1_) {
  40636. int i = JsonUtils.func_151208_a(p_188045_1_, "weight", 1);
  40637. if(i < 1) {
  40638. throw new JsonParseException("Invalid weight " + i + " found, expected integer >= 1");
  40639. } else {
  40640. return i;
  40641. }
  40642. }
  40643. }
  40644. }
  40645.  
  40646. Patching failed: minecraft\net\minecraft\client\renderer\block\statemap\StateMap.java
  40647. Hunk 1 failed! Cannot find hunk target
  40648. }
  40649.  
  40650. private <T extends Comparable<T>> String func_187490_a(IProperty<T> p_187490_1_, Map<IProperty<?>, Comparable<?>> p_187490_2_) {
  40651. - return p_187490_1_.func_177702_a(p_187490_2_.remove(this.field_178142_a));
  40652. + return p_187490_1_.func_177702_a((T)p_187490_2_.remove(this.field_178142_a));
  40653. }
  40654.  
  40655. @SideOnly(Side.CLIENT)
  40656. File state
  40657. package net.minecraft.client.renderer.block.statemap;
  40658.  
  40659. import com.google.common.collect.Lists;
  40660. import com.google.common.collect.Maps;
  40661. import java.util.Collections;
  40662. import java.util.List;
  40663. import java.util.Map;
  40664. import javax.annotation.Nullable;
  40665. import net.minecraft.block.Block;
  40666. import net.minecraft.block.properties.IProperty;
  40667. import net.minecraft.block.state.IBlockState;
  40668. import net.minecraft.client.renderer.block.model.ModelResourceLocation;
  40669. import net.minecraft.client.renderer.block.statemap.StateMapperBase;
  40670. import net.minecraft.util.ResourceLocation;
  40671. import net.minecraftforge.fml.relauncher.Side;
  40672. import net.minecraftforge.fml.relauncher.SideOnly;
  40673.  
  40674. @SideOnly(Side.CLIENT)
  40675. public class StateMap extends StateMapperBase {
  40676. private final IProperty<?> field_178142_a;
  40677. private final String field_178141_c;
  40678. private final List<IProperty<?>> field_178140_d;
  40679.  
  40680. private StateMap(@Nullable IProperty<?> p_i46210_1_, @Nullable String p_i46210_2_, List<IProperty<?>> p_i46210_3_) {
  40681. this.field_178142_a = p_i46210_1_;
  40682. this.field_178141_c = p_i46210_2_;
  40683. this.field_178140_d = p_i46210_3_;
  40684. }
  40685.  
  40686. protected ModelResourceLocation func_178132_a(IBlockState p_178132_1_) {
  40687. Map<IProperty<?>, Comparable<?>> map = Maps.<IProperty<?>, Comparable<?>>newLinkedHashMap(p_178132_1_.func_177228_b());
  40688. String s;
  40689. if(this.field_178142_a == null) {
  40690. s = ((ResourceLocation)Block.field_149771_c.func_177774_c(p_178132_1_.func_177230_c())).toString();
  40691. } else {
  40692. s = this.func_187490_a(this.field_178142_a, map);
  40693. }
  40694.  
  40695. if(this.field_178141_c != null) {
  40696. s = s + this.field_178141_c;
  40697. }
  40698.  
  40699. for(IProperty<?> iproperty : this.field_178140_d) {
  40700. map.remove(iproperty);
  40701. }
  40702.  
  40703. return new ModelResourceLocation(s, this.func_178131_a(map));
  40704. }
  40705.  
  40706. private <T extends Comparable<T>> String func_187490_a(IProperty<T> p_187490_1_, Map<IProperty<?>, Comparable<?>> p_187490_2_) {
  40707. return p_187490_1_.func_177702_a((Comparable)p_187490_2_.remove(this.field_178142_a));
  40708. }
  40709.  
  40710. @SideOnly(Side.CLIENT)
  40711. public static class Builder {
  40712. private IProperty<?> field_178445_a;
  40713. private String field_178443_b;
  40714. private final List<IProperty<?>> field_178444_c = Lists.<IProperty<?>>newArrayList();
  40715.  
  40716. public StateMap.Builder func_178440_a(IProperty<?> p_178440_1_) {
  40717. this.field_178445_a = p_178440_1_;
  40718. return this;
  40719. }
  40720.  
  40721. public StateMap.Builder func_178439_a(String p_178439_1_) {
  40722. this.field_178443_b = p_178439_1_;
  40723. return this;
  40724. }
  40725.  
  40726. public StateMap.Builder func_178442_a(IProperty<?>... p_178442_1_) {
  40727. Collections.addAll(this.field_178444_c, p_178442_1_);
  40728. return this;
  40729. }
  40730.  
  40731. public StateMap func_178441_a() {
  40732. return new StateMap(this.field_178445_a, this.field_178443_b, this.field_178444_c);
  40733. }
  40734. }
  40735. }
  40736.  
  40737. Patching failed: minecraft\net\minecraft\client\renderer\tileentity\TileEntityRendererDispatcher.java
  40738. Hunk 1 failed! Cannot find hunk target
  40739. }
  40740.  
  40741. public <T extends TileEntity> TileEntitySpecialRenderer<T> func_147546_a(Class<? extends TileEntity> p_147546_1_) {
  40742. - TileEntitySpecialRenderer<? extends TileEntity> tileentityspecialrenderer = (TileEntitySpecialRenderer)this.field_147559_m.get(p_147546_1_);
  40743. + TileEntitySpecialRenderer<T> tileentityspecialrenderer = (TileEntitySpecialRenderer)this.field_147559_m.get(p_147546_1_);
  40744. if (tileentityspecialrenderer == null && p_147546_1_ != TileEntity.class) {
  40745. - tileentityspecialrenderer = this.<TileEntity>func_147546_a(p_147546_1_.getSuperclass());
  40746. + tileentityspecialrenderer = this.func_147546_a((Class<? extends TileEntity>)p_147546_1_.getSuperclass());
  40747. this.field_147559_m.put(p_147546_1_, tileentityspecialrenderer);
  40748. }
  40749.  
  40750. File state
  40751. package net.minecraft.client.renderer.tileentity;
  40752.  
  40753. import com.google.common.collect.Maps;
  40754. import java.util.Map;
  40755. import javax.annotation.Nullable;
  40756. import net.minecraft.client.gui.FontRenderer;
  40757. import net.minecraft.client.model.ModelShulker;
  40758. import net.minecraft.client.renderer.GlStateManager;
  40759. import net.minecraft.client.renderer.OpenGlHelper;
  40760. import net.minecraft.client.renderer.RenderHelper;
  40761. import net.minecraft.client.renderer.texture.TextureManager;
  40762. import net.minecraft.client.renderer.tileentity.TileEntityBannerRenderer;
  40763. import net.minecraft.client.renderer.tileentity.TileEntityBeaconRenderer;
  40764. import net.minecraft.client.renderer.tileentity.TileEntityBedRenderer;
  40765. import net.minecraft.client.renderer.tileentity.TileEntityChestRenderer;
  40766. import net.minecraft.client.renderer.tileentity.TileEntityEnchantmentTableRenderer;
  40767. import net.minecraft.client.renderer.tileentity.TileEntityEndGatewayRenderer;
  40768. import net.minecraft.client.renderer.tileentity.TileEntityEndPortalRenderer;
  40769. import net.minecraft.client.renderer.tileentity.TileEntityEnderChestRenderer;
  40770. import net.minecraft.client.renderer.tileentity.TileEntityMobSpawnerRenderer;
  40771. import net.minecraft.client.renderer.tileentity.TileEntityPistonRenderer;
  40772. import net.minecraft.client.renderer.tileentity.TileEntityShulkerBoxRenderer;
  40773. import net.minecraft.client.renderer.tileentity.TileEntitySignRenderer;
  40774. import net.minecraft.client.renderer.tileentity.TileEntitySkullRenderer;
  40775. import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
  40776. import net.minecraft.client.renderer.tileentity.TileEntityStructureRenderer;
  40777. import net.minecraft.crash.CrashReport;
  40778. import net.minecraft.crash.CrashReportCategory;
  40779. import net.minecraft.entity.Entity;
  40780. import net.minecraft.tileentity.TileEntity;
  40781. import net.minecraft.tileentity.TileEntityBanner;
  40782. import net.minecraft.tileentity.TileEntityBeacon;
  40783. import net.minecraft.tileentity.TileEntityBed;
  40784. import net.minecraft.tileentity.TileEntityChest;
  40785. import net.minecraft.tileentity.TileEntityEnchantmentTable;
  40786. import net.minecraft.tileentity.TileEntityEndGateway;
  40787. import net.minecraft.tileentity.TileEntityEndPortal;
  40788. import net.minecraft.tileentity.TileEntityEnderChest;
  40789. import net.minecraft.tileentity.TileEntityMobSpawner;
  40790. import net.minecraft.tileentity.TileEntityPiston;
  40791. import net.minecraft.tileentity.TileEntityShulkerBox;
  40792. import net.minecraft.tileentity.TileEntitySign;
  40793. import net.minecraft.tileentity.TileEntitySkull;
  40794. import net.minecraft.tileentity.TileEntityStructure;
  40795. import net.minecraft.util.ReportedException;
  40796. import net.minecraft.util.math.BlockPos;
  40797. import net.minecraft.util.math.RayTraceResult;
  40798. import net.minecraft.world.World;
  40799. import net.minecraftforge.fml.relauncher.Side;
  40800. import net.minecraftforge.fml.relauncher.SideOnly;
  40801.  
  40802. @SideOnly(Side.CLIENT)
  40803. public class TileEntityRendererDispatcher {
  40804. public final Map<Class<? extends TileEntity>, TileEntitySpecialRenderer<? extends TileEntity>> field_147559_m = Maps.<Class<? extends TileEntity>, TileEntitySpecialRenderer<? extends TileEntity>>newHashMap();
  40805. public static TileEntityRendererDispatcher field_147556_a = new TileEntityRendererDispatcher();
  40806. public FontRenderer field_147557_n;
  40807. public static double field_147554_b;
  40808. public static double field_147555_c;
  40809. public static double field_147552_d;
  40810. public TextureManager field_147553_e;
  40811. public World field_147550_f;
  40812. public Entity field_147551_g;
  40813. public float field_147562_h;
  40814. public float field_147563_i;
  40815. public RayTraceResult field_190057_j;
  40816. public double field_147560_j;
  40817. public double field_147561_k;
  40818. public double field_147558_l;
  40819.  
  40820. private TileEntityRendererDispatcher() {
  40821. this.field_147559_m.put(TileEntitySign.class, new TileEntitySignRenderer());
  40822. this.field_147559_m.put(TileEntityMobSpawner.class, new TileEntityMobSpawnerRenderer());
  40823. this.field_147559_m.put(TileEntityPiston.class, new TileEntityPistonRenderer());
  40824. this.field_147559_m.put(TileEntityChest.class, new TileEntityChestRenderer());
  40825. this.field_147559_m.put(TileEntityEnderChest.class, new TileEntityEnderChestRenderer());
  40826. this.field_147559_m.put(TileEntityEnchantmentTable.class, new TileEntityEnchantmentTableRenderer());
  40827. this.field_147559_m.put(TileEntityEndPortal.class, new TileEntityEndPortalRenderer());
  40828. this.field_147559_m.put(TileEntityEndGateway.class, new TileEntityEndGatewayRenderer());
  40829. this.field_147559_m.put(TileEntityBeacon.class, new TileEntityBeaconRenderer());
  40830. this.field_147559_m.put(TileEntitySkull.class, new TileEntitySkullRenderer());
  40831. this.field_147559_m.put(TileEntityBanner.class, new TileEntityBannerRenderer());
  40832. this.field_147559_m.put(TileEntityStructure.class, new TileEntityStructureRenderer());
  40833. this.field_147559_m.put(TileEntityShulkerBox.class, new TileEntityShulkerBoxRenderer(new ModelShulker()));
  40834. this.field_147559_m.put(TileEntityBed.class, new TileEntityBedRenderer());
  40835.  
  40836. for(TileEntitySpecialRenderer<?> tileentityspecialrenderer : this.field_147559_m.values()) {
  40837. tileentityspecialrenderer.func_147497_a(this);
  40838. }
  40839.  
  40840. }
  40841.  
  40842. public <T extends TileEntity> TileEntitySpecialRenderer<T> func_147546_a(Class<? extends TileEntity> p_147546_1_) {
  40843. TileEntitySpecialRenderer<? extends TileEntity> tileentityspecialrenderer = (TileEntitySpecialRenderer)this.field_147559_m.get(p_147546_1_);
  40844. if(tileentityspecialrenderer == null && p_147546_1_ != TileEntity.class) {
  40845. tileentityspecialrenderer = this.<TileEntity>func_147546_a(p_147546_1_.getSuperclass());
  40846. this.field_147559_m.put(p_147546_1_, tileentityspecialrenderer);
  40847. }
  40848.  
  40849. return tileentityspecialrenderer;
  40850. }
  40851.  
  40852. @Nullable
  40853. public <T extends TileEntity> TileEntitySpecialRenderer<T> func_147547_b(@Nullable TileEntity p_147547_1_) {
  40854. return p_147547_1_ == null?null:this.func_147546_a(p_147547_1_.getClass());
  40855. }
  40856.  
  40857. public void func_190056_a(World p_190056_1_, TextureManager p_190056_2_, FontRenderer p_190056_3_, Entity p_190056_4_, RayTraceResult p_190056_5_, float p_190056_6_) {
  40858. if(this.field_147550_f != p_190056_1_) {
  40859. this.func_147543_a(p_190056_1_);
  40860. }
  40861.  
  40862. this.field_147553_e = p_190056_2_;
  40863. this.field_147551_g = p_190056_4_;
  40864. this.field_147557_n = p_190056_3_;
  40865. this.field_190057_j = p_190056_5_;
  40866. this.field_147562_h = p_190056_4_.field_70126_B + (p_190056_4_.field_70177_z - p_190056_4_.field_70126_B) * p_190056_6_;
  40867. this.field_147563_i = p_190056_4_.field_70127_C + (p_190056_4_.field_70125_A - p_190056_4_.field_70127_C) * p_190056_6_;
  40868. this.field_147560_j = p_190056_4_.field_70142_S + (p_190056_4_.field_70165_t - p_190056_4_.field_70142_S) * (double)p_190056_6_;
  40869. this.field_147561_k = p_190056_4_.field_70137_T + (p_190056_4_.field_70163_u - p_190056_4_.field_70137_T) * (double)p_190056_6_;
  40870. this.field_147558_l = p_190056_4_.field_70136_U + (p_190056_4_.field_70161_v - p_190056_4_.field_70136_U) * (double)p_190056_6_;
  40871. }
  40872.  
  40873. public void func_180546_a(TileEntity p_180546_1_, float p_180546_2_, int p_180546_3_) {
  40874. if(p_180546_1_.func_145835_a(this.field_147560_j, this.field_147561_k, this.field_147558_l) < p_180546_1_.func_145833_n()) {
  40875. RenderHelper.func_74519_b();
  40876. int i = this.field_147550_f.func_175626_b(p_180546_1_.func_174877_v(), 0);
  40877. int j = i % 65536;
  40878. int k = i / 65536;
  40879. OpenGlHelper.func_77475_a(OpenGlHelper.field_77476_b, (float)j, (float)k);
  40880. GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
  40881. BlockPos blockpos = p_180546_1_.func_174877_v();
  40882. this.func_192854_a(p_180546_1_, (double)blockpos.func_177958_n() - field_147554_b, (double)blockpos.func_177956_o() - field_147555_c, (double)blockpos.func_177952_p() - field_147552_d, p_180546_2_, p_180546_3_, 1.0F);
  40883. }
  40884.  
  40885. }
  40886.  
  40887. public void func_147549_a(TileEntity p_147549_1_, double p_147549_2_, double p_147549_4_, double p_147549_6_, float p_147549_8_) {
  40888. this.func_192855_a(p_147549_1_, p_147549_2_, p_147549_4_, p_147549_6_, p_147549_8_, 1.0F);
  40889. }
  40890.  
  40891. public void func_192855_a(TileEntity p_192855_1_, double p_192855_2_, double p_192855_4_, double p_192855_6_, float p_192855_8_, float p_192855_9_) {
  40892. this.func_192854_a(p_192855_1_, p_192855_2_, p_192855_4_, p_192855_6_, p_192855_8_, -1, p_192855_9_);
  40893. }
  40894.  
  40895. public void func_192854_a(TileEntity p_192854_1_, double p_192854_2_, double p_192854_4_, double p_192854_6_, float p_192854_8_, int p_192854_9_, float p_192854_10_) {
  40896. TileEntitySpecialRenderer<TileEntity> tileentityspecialrenderer = this.<TileEntity>func_147547_b(p_192854_1_);
  40897. if(tileentityspecialrenderer != null) {
  40898. try {
  40899. tileentityspecialrenderer.func_192841_a(p_192854_1_, p_192854_2_, p_192854_4_, p_192854_6_, p_192854_8_, p_192854_9_, p_192854_10_);
  40900. } catch (Throwable throwable) {
  40901. CrashReport crashreport = CrashReport.func_85055_a(throwable, "Rendering Block Entity");
  40902. CrashReportCategory crashreportcategory = crashreport.func_85058_a("Block Entity Details");
  40903. p_192854_1_.func_145828_a(crashreportcategory);
  40904. throw new ReportedException(crashreport);
  40905. }
  40906. }
  40907.  
  40908. }
  40909.  
  40910. public void func_147543_a(@Nullable World p_147543_1_) {
  40911. this.field_147550_f = p_147543_1_;
  40912. if(p_147543_1_ == null) {
  40913. this.field_147551_g = null;
  40914. }
  40915.  
  40916. }
  40917.  
  40918. public FontRenderer func_147548_a() {
  40919. return this.field_147557_n;
  40920. }
  40921. }
  40922.  
  40923. Patching failed: minecraft\net\minecraft\client\renderer\chunk\ChunkRenderWorker.java
  40924. Hunk 1 failed! Cannot find hunk target
  40925. }
  40926.  
  40927. Entity entity = Minecraft.func_71410_x().func_175606_aa();
  40928. - if (lvt_2_2_ == null) {
  40929. + if (entity == null) {
  40930. p_178474_1_.func_178542_e();
  40931. } else {
  40932. p_178474_1_.func_178541_a(this.func_178475_b());
  40933. File state
  40934. package net.minecraft.client.renderer.chunk;
  40935.  
  40936. import com.google.common.collect.Lists;
  40937. import com.google.common.util.concurrent.FutureCallback;
  40938. import com.google.common.util.concurrent.Futures;
  40939. import com.google.common.util.concurrent.ListenableFuture;
  40940. import java.util.ArrayList;
  40941. import java.util.List;
  40942. import java.util.concurrent.CancellationException;
  40943. import javax.annotation.Nullable;
  40944. import net.minecraft.client.Minecraft;
  40945. import net.minecraft.client.renderer.RegionRenderCacheBuilder;
  40946. import net.minecraft.client.renderer.chunk.ChunkCompileTaskGenerator;
  40947. import net.minecraft.client.renderer.chunk.ChunkRenderDispatcher;
  40948. import net.minecraft.client.renderer.chunk.CompiledChunk;
  40949. import net.minecraft.crash.CrashReport;
  40950. import net.minecraft.entity.Entity;
  40951. import net.minecraft.util.BlockRenderLayer;
  40952. import net.minecraft.util.EnumFacing;
  40953. import net.minecraft.util.math.BlockPos;
  40954. import net.minecraft.world.World;
  40955. import net.minecraftforge.fml.relauncher.Side;
  40956. import net.minecraftforge.fml.relauncher.SideOnly;
  40957. import org.apache.logging.log4j.LogManager;
  40958. import org.apache.logging.log4j.Logger;
  40959.  
  40960. @SideOnly(Side.CLIENT)
  40961. public class ChunkRenderWorker implements Runnable {
  40962. private static final Logger field_152478_a = LogManager.getLogger();
  40963. private final ChunkRenderDispatcher field_178477_b;
  40964. private final RegionRenderCacheBuilder field_178478_c;
  40965. private boolean field_188265_d;
  40966.  
  40967. public ChunkRenderWorker(ChunkRenderDispatcher p_i46201_1_) {
  40968. this(p_i46201_1_, (RegionRenderCacheBuilder)null);
  40969. }
  40970.  
  40971. public ChunkRenderWorker(ChunkRenderDispatcher p_i46202_1_, @Nullable RegionRenderCacheBuilder p_i46202_2_) {
  40972. this.field_188265_d = true;
  40973. this.field_178477_b = p_i46202_1_;
  40974. this.field_178478_c = p_i46202_2_;
  40975. }
  40976.  
  40977. public void run() {
  40978. while(this.field_188265_d) {
  40979. try {
  40980. this.func_178474_a(this.field_178477_b.func_178511_d());
  40981. } catch (InterruptedException var3) {
  40982. field_152478_a.debug("Stopping chunk worker due to interrupt");
  40983. return;
  40984. } catch (Throwable throwable) {
  40985. CrashReport crashreport = CrashReport.func_85055_a(throwable, "Batching chunks");
  40986. Minecraft.func_71410_x().func_71404_a(Minecraft.func_71410_x().func_71396_d(crashreport));
  40987. return;
  40988. }
  40989. }
  40990.  
  40991. }
  40992.  
  40993. protected void func_178474_a(final ChunkCompileTaskGenerator p_178474_1_) throws InterruptedException {
  40994. p_178474_1_.func_178540_f().lock();
  40995.  
  40996. try {
  40997. if(p_178474_1_.func_178546_a() != ChunkCompileTaskGenerator.Status.PENDING) {
  40998. if(!p_178474_1_.func_178537_h()) {
  40999. field_152478_a.warn((String)"Chunk render task was {} when I expected it to be pending; ignoring task", (Object)p_178474_1_.func_178546_a());
  41000. }
  41001.  
  41002. return;
  41003. }
  41004.  
  41005. BlockPos blockpos = new BlockPos(Minecraft.func_71410_x().field_71439_g);
  41006. BlockPos blockpos1 = p_178474_1_.func_178536_b().func_178568_j();
  41007. int i = 16;
  41008. int j = 8;
  41009. int k = 24;
  41010. if(blockpos1.func_177982_a(8, 8, 8).func_177951_i(blockpos) > 576.0D) {
  41011. World world = p_178474_1_.func_178536_b().func_188283_p();
  41012. BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(blockpos1);
  41013. if(!this.func_188263_a(blockpos$mutableblockpos.func_189533_g(blockpos1).func_189534_c(EnumFacing.WEST, 16), world) || !this.func_188263_a(blockpos$mutableblockpos.func_189533_g(blockpos1).func_189534_c(EnumFacing.NORTH, 16), world) || !this.func_188263_a(blockpos$mutableblockpos.func_189533_g(blockpos1).func_189534_c(EnumFacing.EAST, 16), world) || !this.func_188263_a(blockpos$mutableblockpos.func_189533_g(blockpos1).func_189534_c(EnumFacing.SOUTH, 16), world)) {
  41014. return;
  41015. }
  41016. }
  41017.  
  41018. p_178474_1_.func_178535_a(ChunkCompileTaskGenerator.Status.COMPILING);
  41019. } finally {
  41020. p_178474_1_.func_178540_f().unlock();
  41021. }
  41022.  
  41023. Entity lvt_2_2_ = Minecraft.func_71410_x().func_175606_aa();
  41024. if(lvt_2_2_ == null) {
  41025. p_178474_1_.func_178542_e();
  41026. } else {
  41027. p_178474_1_.func_178541_a(this.func_178475_b());
  41028. float f = (float)lvt_2_2_.field_70165_t;
  41029. float f1 = (float)lvt_2_2_.field_70163_u + lvt_2_2_.func_70047_e();
  41030. float f2 = (float)lvt_2_2_.field_70161_v;
  41031. ChunkCompileTaskGenerator.Type chunkcompiletaskgenerator$type = p_178474_1_.func_178538_g();
  41032. if(chunkcompiletaskgenerator$type == ChunkCompileTaskGenerator.Type.REBUILD_CHUNK) {
  41033. p_178474_1_.func_178536_b().func_178581_b(f, f1, f2, p_178474_1_);
  41034. } else if(chunkcompiletaskgenerator$type == ChunkCompileTaskGenerator.Type.RESORT_TRANSPARENCY) {
  41035. p_178474_1_.func_178536_b().func_178570_a(f, f1, f2, p_178474_1_);
  41036. }
  41037.  
  41038. p_178474_1_.func_178540_f().lock();
  41039.  
  41040. try {
  41041. if(p_178474_1_.func_178546_a() != ChunkCompileTaskGenerator.Status.COMPILING) {
  41042. if(!p_178474_1_.func_178537_h()) {
  41043. field_152478_a.warn((String)"Chunk render task was {} when I expected it to be compiling; aborting task", (Object)p_178474_1_.func_178546_a());
  41044. }
  41045.  
  41046. this.func_178473_b(p_178474_1_);
  41047. return;
  41048. }
  41049.  
  41050. p_178474_1_.func_178535_a(ChunkCompileTaskGenerator.Status.UPLOADING);
  41051. } finally {
  41052. p_178474_1_.func_178540_f().unlock();
  41053. }
  41054.  
  41055. final CompiledChunk lvt_7_2_ = p_178474_1_.func_178544_c();
  41056. ArrayList lvt_8_2_ = Lists.newArrayList();
  41057. if(chunkcompiletaskgenerator$type == ChunkCompileTaskGenerator.Type.REBUILD_CHUNK) {
  41058. for(BlockRenderLayer blockrenderlayer : BlockRenderLayer.values()) {
  41059. if(lvt_7_2_.func_178492_d(blockrenderlayer)) {
  41060. lvt_8_2_.add(this.field_178477_b.func_188245_a(blockrenderlayer, p_178474_1_.func_178545_d().func_179038_a(blockrenderlayer), p_178474_1_.func_178536_b(), lvt_7_2_, p_178474_1_.func_188228_i()));
  41061. }
  41062. }
  41063. } else if(chunkcompiletaskgenerator$type == ChunkCompileTaskGenerator.Type.RESORT_TRANSPARENCY) {
  41064. lvt_8_2_.add(this.field_178477_b.func_188245_a(BlockRenderLayer.TRANSLUCENT, p_178474_1_.func_178545_d().func_179038_a(BlockRenderLayer.TRANSLUCENT), p_178474_1_.func_178536_b(), lvt_7_2_, p_178474_1_.func_188228_i()));
  41065. }
  41066.  
  41067. final ListenableFuture<List<Object>> listenablefuture = Futures.allAsList(lvt_8_2_);
  41068. p_178474_1_.func_178539_a(new Runnable() {
  41069. public void run() {
  41070. listenablefuture.cancel(false);
  41071. }
  41072. });
  41073. Futures.addCallback(listenablefuture, new FutureCallback<List<Object>>() {
  41074. public void onSuccess(@Nullable List<Object> p_onSuccess_1_) {
  41075. ChunkRenderWorker.this.func_178473_b(p_178474_1_);
  41076. p_178474_1_.func_178540_f().lock();
  41077.  
  41078. label21: {
  41079. try {
  41080. if(p_178474_1_.func_178546_a() == ChunkCompileTaskGenerator.Status.UPLOADING) {
  41081. p_178474_1_.func_178535_a(ChunkCompileTaskGenerator.Status.DONE);
  41082. break label21;
  41083. }
  41084.  
  41085. if(!p_178474_1_.func_178537_h()) {
  41086. ChunkRenderWorker.field_152478_a.warn((String)"Chunk render task was {} when I expected it to be uploading; aborting task", (Object)p_178474_1_.func_178546_a());
  41087. }
  41088. } finally {
  41089. p_178474_1_.func_178540_f().unlock();
  41090. }
  41091.  
  41092. return;
  41093. }
  41094.  
  41095. p_178474_1_.func_178536_b().func_178580_a(lvt_7_2_);
  41096. }
  41097.  
  41098. public void onFailure(Throwable p_onFailure_1_) {
  41099. ChunkRenderWorker.this.func_178473_b(p_178474_1_);
  41100. if(!(p_onFailure_1_ instanceof CancellationException) && !(p_onFailure_1_ instanceof InterruptedException)) {
  41101. Minecraft.func_71410_x().func_71404_a(CrashReport.func_85055_a(p_onFailure_1_, "Rendering chunk"));
  41102. }
  41103.  
  41104. }
  41105. });
  41106. }
  41107. }
  41108.  
  41109. private boolean func_188263_a(BlockPos p_188263_1_, World p_188263_2_) {
  41110. return !p_188263_2_.func_72964_e(p_188263_1_.func_177958_n() >> 4, p_188263_1_.func_177952_p() >> 4).func_76621_g();
  41111. }
  41112.  
  41113. private RegionRenderCacheBuilder func_178475_b() throws InterruptedException {
  41114. return this.field_178478_c != null?this.field_178478_c:this.field_178477_b.func_178515_c();
  41115. }
  41116.  
  41117. private void func_178473_b(ChunkCompileTaskGenerator p_178473_1_) {
  41118. if(this.field_178478_c == null) {
  41119. this.field_178477_b.func_178512_a(p_178473_1_.func_178545_d());
  41120. }
  41121.  
  41122. }
  41123.  
  41124. public void func_188264_a() {
  41125. this.field_188265_d = false;
  41126. }
  41127. }
  41128.  
  41129. Patching failed: minecraft\net\minecraft\client\renderer\entity\RenderArmorStand.java
  41130. Hunk 1 failed! Cannot find hunk target
  41131. super(p_i46195_1_, new ModelArmorStand(), 0.0F);
  41132. LayerBipedArmor layerbipedarmor = new LayerBipedArmor(this) {
  41133. protected void func_177177_a() {
  41134. - this.field_177189_c = (T)(new ModelArmorStandArmor(0.5F));
  41135. - this.field_177186_d = (T)(new ModelArmorStandArmor(1.0F));
  41136. + this.field_177189_c = new ModelArmorStandArmor(0.5F);
  41137. + this.field_177186_d = new ModelArmorStandArmor(1.0F);
  41138. }
  41139. };
  41140. this.func_177094_a(layerbipedarmor);
  41141. File state
  41142. package net.minecraft.client.renderer.entity;
  41143.  
  41144. import net.minecraft.client.model.ModelArmorStand;
  41145. import net.minecraft.client.model.ModelArmorStandArmor;
  41146. import net.minecraft.client.renderer.GlStateManager;
  41147. import net.minecraft.client.renderer.entity.RenderLivingBase;
  41148. import net.minecraft.client.renderer.entity.RenderManager;
  41149. import net.minecraft.client.renderer.entity.layers.LayerBipedArmor;
  41150. import net.minecraft.client.renderer.entity.layers.LayerCustomHead;
  41151. import net.minecraft.client.renderer.entity.layers.LayerElytra;
  41152. import net.minecraft.client.renderer.entity.layers.LayerHeldItem;
  41153. import net.minecraft.entity.item.EntityArmorStand;
  41154. import net.minecraft.util.ResourceLocation;
  41155. import net.minecraft.util.math.MathHelper;
  41156. import net.minecraftforge.fml.relauncher.Side;
  41157. import net.minecraftforge.fml.relauncher.SideOnly;
  41158.  
  41159. @SideOnly(Side.CLIENT)
  41160. public class RenderArmorStand extends RenderLivingBase<EntityArmorStand> {
  41161. public static final ResourceLocation field_177103_a = new ResourceLocation("textures/entity/armorstand/wood.png");
  41162.  
  41163. public RenderArmorStand(RenderManager p_i46195_1_) {
  41164. super(p_i46195_1_, new ModelArmorStand(), 0.0F);
  41165. LayerBipedArmor layerbipedarmor = new LayerBipedArmor(this) {
  41166. protected void func_177177_a() {
  41167. this.field_177189_c = new ModelArmorStandArmor(0.5F);
  41168. this.field_177186_d = new ModelArmorStandArmor(1.0F);
  41169. }
  41170. };
  41171. this.func_177094_a(layerbipedarmor);
  41172. this.func_177094_a(new LayerHeldItem(this));
  41173. this.func_177094_a(new LayerElytra(this));
  41174. this.func_177094_a(new LayerCustomHead(this.func_177087_b().field_78116_c));
  41175. }
  41176.  
  41177. protected ResourceLocation func_110775_a(EntityArmorStand p_110775_1_) {
  41178. return field_177103_a;
  41179. }
  41180.  
  41181. public ModelArmorStand func_177087_b() {
  41182. return (ModelArmorStand)super.func_177087_b();
  41183. }
  41184.  
  41185. protected void func_77043_a(EntityArmorStand p_77043_1_, float p_77043_2_, float p_77043_3_, float p_77043_4_) {
  41186. GlStateManager.func_179114_b(180.0F - p_77043_3_, 0.0F, 1.0F, 0.0F);
  41187. float f = (float)(p_77043_1_.field_70170_p.func_82737_E() - p_77043_1_.field_175437_i) + p_77043_4_;
  41188. if(f < 5.0F) {
  41189. GlStateManager.func_179114_b(MathHelper.func_76126_a(f / 1.5F * 3.1415927F) * 3.0F, 0.0F, 1.0F, 0.0F);
  41190. }
  41191.  
  41192. }
  41193.  
  41194. protected boolean func_177070_b(EntityArmorStand p_177070_1_) {
  41195. return p_177070_1_.func_174833_aM();
  41196. }
  41197.  
  41198. public void func_76986_a(EntityArmorStand p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) {
  41199. if(p_76986_1_.func_181026_s()) {
  41200. this.field_188323_j = true;
  41201. }
  41202.  
  41203. super.func_76986_a(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
  41204. if(p_76986_1_.func_181026_s()) {
  41205. this.field_188323_j = false;
  41206. }
  41207.  
  41208. }
  41209. }
  41210.  
  41211. Patching failed: minecraft\net\minecraft\client\renderer\entity\RenderManager.java
  41212. Hunk 1 failed! Cannot find hunk target
  41213. }
  41214.  
  41215. public <T extends Entity> Render<T> func_78715_a(Class<? extends Entity> p_78715_1_) {
  41216. - Render<? extends Entity> render = (Render)this.field_78729_o.get(p_78715_1_);
  41217. + Render<T> render = (Render)this.field_78729_o.get(p_78715_1_);
  41218. if (render == null && p_78715_1_ != Entity.class) {
  41219. - render = this.<Entity>func_78715_a(p_78715_1_.getSuperclass());
  41220. + render = this.func_78715_a((Class<? extends Entity>)p_78715_1_.getSuperclass());
  41221. this.field_78729_o.put(p_78715_1_, render);
  41222. }
  41223.  
  41224. File state
  41225. package net.minecraft.client.renderer.entity;
  41226.  
  41227. import com.google.common.collect.Maps;
  41228. import java.util.Map;
  41229. import javax.annotation.Nullable;
  41230. import net.minecraft.block.Block;
  41231. import net.minecraft.block.BlockBed;
  41232. import net.minecraft.block.state.IBlockState;
  41233. import net.minecraft.client.Minecraft;
  41234. import net.minecraft.client.entity.AbstractClientPlayer;
  41235. import net.minecraft.client.gui.FontRenderer;
  41236. import net.minecraft.client.renderer.BufferBuilder;
  41237. import net.minecraft.client.renderer.GlStateManager;
  41238. import net.minecraft.client.renderer.OpenGlHelper;
  41239. import net.minecraft.client.renderer.RenderGlobal;
  41240. import net.minecraft.client.renderer.RenderItem;
  41241. import net.minecraft.client.renderer.Tessellator;
  41242. import net.minecraft.client.renderer.culling.ICamera;
  41243. import net.minecraft.client.renderer.entity.Render;
  41244. import net.minecraft.client.renderer.entity.RenderAbstractHorse;
  41245. import net.minecraft.client.renderer.entity.RenderAreaEffectCloud;
  41246. import net.minecraft.client.renderer.entity.RenderArmorStand;
  41247. import net.minecraft.client.renderer.entity.RenderBat;
  41248. import net.minecraft.client.renderer.entity.RenderBlaze;
  41249. import net.minecraft.client.renderer.entity.RenderBoat;
  41250. import net.minecraft.client.renderer.entity.RenderCaveSpider;
  41251. import net.minecraft.client.renderer.entity.RenderChicken;
  41252. import net.minecraft.client.renderer.entity.RenderCow;
  41253. import net.minecraft.client.renderer.entity.RenderCreeper;
  41254. import net.minecraft.client.renderer.entity.RenderDragon;
  41255. import net.minecraft.client.renderer.entity.RenderDragonFireball;
  41256. import net.minecraft.client.renderer.entity.RenderElderGuardian;
  41257. import net.minecraft.client.renderer.entity.RenderEnderCrystal;
  41258. import net.minecraft.client.renderer.entity.RenderEnderman;
  41259. import net.minecraft.client.renderer.entity.RenderEndermite;
  41260. import net.minecraft.client.renderer.entity.RenderEntity;
  41261. import net.minecraft.client.renderer.entity.RenderEntityItem;
  41262. import net.minecraft.client.renderer.entity.RenderEvoker;
  41263. import net.minecraft.client.renderer.entity.RenderEvokerFangs;
  41264. import net.minecraft.client.renderer.entity.RenderFallingBlock;
  41265. import net.minecraft.client.renderer.entity.RenderFireball;
  41266. import net.minecraft.client.renderer.entity.RenderFish;
  41267. import net.minecraft.client.renderer.entity.RenderGhast;
  41268. import net.minecraft.client.renderer.entity.RenderGiantZombie;
  41269. import net.minecraft.client.renderer.entity.RenderGuardian;
  41270. import net.minecraft.client.renderer.entity.RenderHorse;
  41271. import net.minecraft.client.renderer.entity.RenderHusk;
  41272. import net.minecraft.client.renderer.entity.RenderIllusionIllager;
  41273. import net.minecraft.client.renderer.entity.RenderIronGolem;
  41274. import net.minecraft.client.renderer.entity.RenderItemFrame;
  41275. import net.minecraft.client.renderer.entity.RenderLeashKnot;
  41276. import net.minecraft.client.renderer.entity.RenderLightningBolt;
  41277. import net.minecraft.client.renderer.entity.RenderLlama;
  41278. import net.minecraft.client.renderer.entity.RenderLlamaSpit;
  41279. import net.minecraft.client.renderer.entity.RenderMagmaCube;
  41280. import net.minecraft.client.renderer.entity.RenderMinecart;
  41281. import net.minecraft.client.renderer.entity.RenderMinecartMobSpawner;
  41282. import net.minecraft.client.renderer.entity.RenderMooshroom;
  41283. import net.minecraft.client.renderer.entity.RenderOcelot;
  41284. import net.minecraft.client.renderer.entity.RenderPainting;
  41285. import net.minecraft.client.renderer.entity.RenderParrot;
  41286. import net.minecraft.client.renderer.entity.RenderPig;
  41287. import net.minecraft.client.renderer.entity.RenderPigZombie;
  41288. import net.minecraft.client.renderer.entity.RenderPlayer;
  41289. import net.minecraft.client.renderer.entity.RenderPolarBear;
  41290. import net.minecraft.client.renderer.entity.RenderPotion;
  41291. import net.minecraft.client.renderer.entity.RenderRabbit;
  41292. import net.minecraft.client.renderer.entity.RenderSheep;
  41293. import net.minecraft.client.renderer.entity.RenderShulker;
  41294. import net.minecraft.client.renderer.entity.RenderShulkerBullet;
  41295. import net.minecraft.client.renderer.entity.RenderSilverfish;
  41296. import net.minecraft.client.renderer.entity.RenderSkeleton;
  41297. import net.minecraft.client.renderer.entity.RenderSlime;
  41298. import net.minecraft.client.renderer.entity.RenderSnowMan;
  41299. import net.minecraft.client.renderer.entity.RenderSnowball;
  41300. import net.minecraft.client.renderer.entity.RenderSpectralArrow;
  41301. import net.minecraft.client.renderer.entity.RenderSpider;
  41302. import net.minecraft.client.renderer.entity.RenderSquid;
  41303. import net.minecraft.client.renderer.entity.RenderStray;
  41304. import net.minecraft.client.renderer.entity.RenderTNTPrimed;
  41305. import net.minecraft.client.renderer.entity.RenderTippedArrow;
  41306. import net.minecraft.client.renderer.entity.RenderTntMinecart;
  41307. import net.minecraft.client.renderer.entity.RenderVex;
  41308. import net.minecraft.client.renderer.entity.RenderVillager;
  41309. import net.minecraft.client.renderer.entity.RenderVindicator;
  41310. import net.minecraft.client.renderer.entity.RenderWitch;
  41311. import net.minecraft.client.renderer.entity.RenderWither;
  41312. import net.minecraft.client.renderer.entity.RenderWitherSkeleton;
  41313. import net.minecraft.client.renderer.entity.RenderWitherSkull;
  41314. import net.minecraft.client.renderer.entity.RenderWolf;
  41315. import net.minecraft.client.renderer.entity.RenderXPOrb;
  41316. import net.minecraft.client.renderer.entity.RenderZombie;
  41317. import net.minecraft.client.renderer.entity.RenderZombieVillager;
  41318. import net.minecraft.client.renderer.texture.TextureManager;
  41319. import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
  41320. import net.minecraft.client.settings.GameSettings;
  41321. import net.minecraft.crash.CrashReport;
  41322. import net.minecraft.crash.CrashReportCategory;
  41323. import net.minecraft.entity.Entity;
  41324. import net.minecraft.entity.EntityAreaEffectCloud;
  41325. import net.minecraft.entity.EntityLeashKnot;
  41326. import net.minecraft.entity.EntityLivingBase;
  41327. import net.minecraft.entity.boss.EntityDragon;
  41328. import net.minecraft.entity.boss.EntityWither;
  41329. import net.minecraft.entity.effect.EntityLightningBolt;
  41330. import net.minecraft.entity.item.EntityArmorStand;
  41331. import net.minecraft.entity.item.EntityBoat;
  41332. import net.minecraft.entity.item.EntityEnderCrystal;
  41333. import net.minecraft.entity.item.EntityEnderEye;
  41334. import net.minecraft.entity.item.EntityEnderPearl;
  41335. import net.minecraft.entity.item.EntityExpBottle;
  41336. import net.minecraft.entity.item.EntityFallingBlock;
  41337. import net.minecraft.entity.item.EntityFireworkRocket;
  41338. import net.minecraft.entity.item.EntityItem;
  41339. import net.minecraft.entity.item.EntityItemFrame;
  41340. import net.minecraft.entity.item.EntityMinecart;
  41341. import net.minecraft.entity.item.EntityMinecartMobSpawner;
  41342. import net.minecraft.entity.item.EntityMinecartTNT;
  41343. import net.minecraft.entity.item.EntityPainting;
  41344. import net.minecraft.entity.item.EntityTNTPrimed;
  41345. import net.minecraft.entity.item.EntityXPOrb;
  41346. import net.minecraft.entity.monster.EntityBlaze;
  41347. import net.minecraft.entity.monster.EntityCaveSpider;
  41348. import net.minecraft.entity.monster.EntityCreeper;
  41349. import net.minecraft.entity.monster.EntityElderGuardian;
  41350. import net.minecraft.entity.monster.EntityEnderman;
  41351. import net.minecraft.entity.monster.EntityEndermite;
  41352. import net.minecraft.entity.monster.EntityEvoker;
  41353. import net.minecraft.entity.monster.EntityGhast;
  41354. import net.minecraft.entity.monster.EntityGiantZombie;
  41355. import net.minecraft.entity.monster.EntityGuardian;
  41356. import net.minecraft.entity.monster.EntityHusk;
  41357. import net.minecraft.entity.monster.EntityIllusionIllager;
  41358. import net.minecraft.entity.monster.EntityIronGolem;
  41359. import net.minecraft.entity.monster.EntityMagmaCube;
  41360. import net.minecraft.entity.monster.EntityPigZombie;
  41361. import net.minecraft.entity.monster.EntityPolarBear;
  41362. import net.minecraft.entity.monster.EntityShulker;
  41363. import net.minecraft.entity.monster.EntitySilverfish;
  41364. import net.minecraft.entity.monster.EntitySkeleton;
  41365. import net.minecraft.entity.monster.EntitySlime;
  41366. import net.minecraft.entity.monster.EntitySnowman;
  41367. import net.minecraft.entity.monster.EntitySpider;
  41368. import net.minecraft.entity.monster.EntityStray;
  41369. import net.minecraft.entity.monster.EntityVex;
  41370. import net.minecraft.entity.monster.EntityVindicator;
  41371. import net.minecraft.entity.monster.EntityWitch;
  41372. import net.minecraft.entity.monster.EntityWitherSkeleton;
  41373. import net.minecraft.entity.monster.EntityZombie;
  41374. import net.minecraft.entity.monster.EntityZombieVillager;
  41375. import net.minecraft.entity.passive.EntityBat;
  41376. import net.minecraft.entity.passive.EntityChicken;
  41377. import net.minecraft.entity.passive.EntityCow;
  41378. import net.minecraft.entity.passive.EntityDonkey;
  41379. import net.minecraft.entity.passive.EntityHorse;
  41380. import net.minecraft.entity.passive.EntityLlama;
  41381. import net.minecraft.entity.passive.EntityMooshroom;
  41382. import net.minecraft.entity.passive.EntityMule;
  41383. import net.minecraft.entity.passive.EntityOcelot;
  41384. import net.minecraft.entity.passive.EntityParrot;
  41385. import net.minecraft.entity.passive.EntityPig;
  41386. import net.minecraft.entity.passive.EntityRabbit;
  41387. import net.minecraft.entity.passive.EntitySheep;
  41388. import net.minecraft.entity.passive.EntitySkeletonHorse;
  41389. import net.minecraft.entity.passive.EntitySquid;
  41390. import net.minecraft.entity.passive.EntityVillager;
  41391. import net.minecraft.entity.passive.EntityWolf;
  41392. import net.minecraft.entity.passive.EntityZombieHorse;
  41393. import net.minecraft.entity.projectile.EntityDragonFireball;
  41394. import net.minecraft.entity.projectile.EntityEgg;
  41395. import net.minecraft.entity.projectile.EntityEvokerFangs;
  41396. import net.minecraft.entity.projectile.EntityFishHook;
  41397. import net.minecraft.entity.projectile.EntityLargeFireball;
  41398. import net.minecraft.entity.projectile.EntityLlamaSpit;
  41399. import net.minecraft.entity.projectile.EntityPotion;
  41400. import net.minecraft.entity.projectile.EntityShulkerBullet;
  41401. import net.minecraft.entity.projectile.EntitySmallFireball;
  41402. import net.minecraft.entity.projectile.EntitySnowball;
  41403. import net.minecraft.entity.projectile.EntitySpectralArrow;
  41404. import net.minecraft.entity.projectile.EntityTippedArrow;
  41405. import net.minecraft.entity.projectile.EntityWitherSkull;
  41406. import net.minecraft.init.Blocks;
  41407. import net.minecraft.init.Items;
  41408. import net.minecraft.util.EnumFacing;
  41409. import net.minecraft.util.ReportedException;
  41410. import net.minecraft.util.math.AxisAlignedBB;
  41411. import net.minecraft.util.math.BlockPos;
  41412. import net.minecraft.util.math.Vec3d;
  41413. import net.minecraft.world.World;
  41414. import net.minecraftforge.fml.relauncher.Side;
  41415. import net.minecraftforge.fml.relauncher.SideOnly;
  41416.  
  41417. @SideOnly(Side.CLIENT)
  41418. public class RenderManager {
  41419. public final Map<Class<? extends Entity>, Render<? extends Entity>> field_78729_o = Maps.<Class<? extends Entity>, Render<? extends Entity>>newHashMap();
  41420. private final Map<String, RenderPlayer> field_178636_l = Maps.<String, RenderPlayer>newHashMap();
  41421. private final RenderPlayer field_178637_m;
  41422. private FontRenderer field_78736_p;
  41423. private double field_78725_b;
  41424. private double field_78726_c;
  41425. private double field_78723_d;
  41426. public TextureManager field_78724_e;
  41427. public World field_78722_g;
  41428. public Entity field_78734_h;
  41429. public Entity field_147941_i;
  41430. public float field_78735_i;
  41431. public float field_78732_j;
  41432. public GameSettings field_78733_k;
  41433. public double field_78730_l;
  41434. public double field_78731_m;
  41435. public double field_78728_n;
  41436. private boolean field_178639_r;
  41437. private boolean field_178638_s = true;
  41438. private boolean field_85095_o;
  41439.  
  41440. public RenderManager(TextureManager p_i46180_1_, RenderItem p_i46180_2_) {
  41441. this.field_78724_e = p_i46180_1_;
  41442. this.field_78729_o.put(EntityCaveSpider.class, new RenderCaveSpider(this));
  41443. this.field_78729_o.put(EntitySpider.class, new RenderSpider(this));
  41444. this.field_78729_o.put(EntityPig.class, new RenderPig(this));
  41445. this.field_78729_o.put(EntitySheep.class, new RenderSheep(this));
  41446. this.field_78729_o.put(EntityCow.class, new RenderCow(this));
  41447. this.field_78729_o.put(EntityMooshroom.class, new RenderMooshroom(this));
  41448. this.field_78729_o.put(EntityWolf.class, new RenderWolf(this));
  41449. this.field_78729_o.put(EntityChicken.class, new RenderChicken(this));
  41450. this.field_78729_o.put(EntityOcelot.class, new RenderOcelot(this));
  41451. this.field_78729_o.put(EntityRabbit.class, new RenderRabbit(this));
  41452. this.field_78729_o.put(EntityParrot.class, new RenderParrot(this));
  41453. this.field_78729_o.put(EntitySilverfish.class, new RenderSilverfish(this));
  41454. this.field_78729_o.put(EntityEndermite.class, new RenderEndermite(this));
  41455. this.field_78729_o.put(EntityCreeper.class, new RenderCreeper(this));
  41456. this.field_78729_o.put(EntityEnderman.class, new RenderEnderman(this));
  41457. this.field_78729_o.put(EntitySnowman.class, new RenderSnowMan(this));
  41458. this.field_78729_o.put(EntitySkeleton.class, new RenderSkeleton(this));
  41459. this.field_78729_o.put(EntityWitherSkeleton.class, new RenderWitherSkeleton(this));
  41460. this.field_78729_o.put(EntityStray.class, new RenderStray(this));
  41461. this.field_78729_o.put(EntityWitch.class, new RenderWitch(this));
  41462. this.field_78729_o.put(EntityBlaze.class, new RenderBlaze(this));
  41463. this.field_78729_o.put(EntityPigZombie.class, new RenderPigZombie(this));
  41464. this.field_78729_o.put(EntityZombie.class, new RenderZombie(this));
  41465. this.field_78729_o.put(EntityZombieVillager.class, new RenderZombieVillager(this));
  41466. this.field_78729_o.put(EntityHusk.class, new RenderHusk(this));
  41467. this.field_78729_o.put(EntitySlime.class, new RenderSlime(this));
  41468. this.field_78729_o.put(EntityMagmaCube.class, new RenderMagmaCube(this));
  41469. this.field_78729_o.put(EntityGiantZombie.class, new RenderGiantZombie(this, 6.0F));
  41470. this.field_78729_o.put(EntityGhast.class, new RenderGhast(this));
  41471. this.field_78729_o.put(EntitySquid.class, new RenderSquid(this));
  41472. this.field_78729_o.put(EntityVillager.class, new RenderVillager(this));
  41473. this.field_78729_o.put(EntityIronGolem.class, new RenderIronGolem(this));
  41474. this.field_78729_o.put(EntityBat.class, new RenderBat(this));
  41475. this.field_78729_o.put(EntityGuardian.class, new RenderGuardian(this));
  41476. this.field_78729_o.put(EntityElderGuardian.class, new RenderElderGuardian(this));
  41477. this.field_78729_o.put(EntityShulker.class, new RenderShulker(this));
  41478. this.field_78729_o.put(EntityPolarBear.class, new RenderPolarBear(this));
  41479. this.field_78729_o.put(EntityEvoker.class, new RenderEvoker(this));
  41480. this.field_78729_o.put(EntityVindicator.class, new RenderVindicator(this));
  41481. this.field_78729_o.put(EntityVex.class, new RenderVex(this));
  41482. this.field_78729_o.put(EntityIllusionIllager.class, new RenderIllusionIllager(this));
  41483. this.field_78729_o.put(EntityDragon.class, new RenderDragon(this));
  41484. this.field_78729_o.put(EntityEnderCrystal.class, new RenderEnderCrystal(this));
  41485. this.field_78729_o.put(EntityWither.class, new RenderWither(this));
  41486. this.field_78729_o.put(Entity.class, new RenderEntity(this));
  41487. this.field_78729_o.put(EntityPainting.class, new RenderPainting(this));
  41488. this.field_78729_o.put(EntityItemFrame.class, new RenderItemFrame(this, p_i46180_2_));
  41489. this.field_78729_o.put(EntityLeashKnot.class, new RenderLeashKnot(this));
  41490. this.field_78729_o.put(EntityTippedArrow.class, new RenderTippedArrow(this));
  41491. this.field_78729_o.put(EntitySpectralArrow.class, new RenderSpectralArrow(this));
  41492. this.field_78729_o.put(EntitySnowball.class, new RenderSnowball(this, Items.field_151126_ay, p_i46180_2_));
  41493. this.field_78729_o.put(EntityEnderPearl.class, new RenderSnowball(this, Items.field_151079_bi, p_i46180_2_));
  41494. this.field_78729_o.put(EntityEnderEye.class, new RenderSnowball(this, Items.field_151061_bv, p_i46180_2_));
  41495. this.field_78729_o.put(EntityEgg.class, new RenderSnowball(this, Items.field_151110_aK, p_i46180_2_));
  41496. this.field_78729_o.put(EntityPotion.class, new RenderPotion(this, p_i46180_2_));
  41497. this.field_78729_o.put(EntityExpBottle.class, new RenderSnowball(this, Items.field_151062_by, p_i46180_2_));
  41498. this.field_78729_o.put(EntityFireworkRocket.class, new RenderSnowball(this, Items.field_151152_bP, p_i46180_2_));
  41499. this.field_78729_o.put(EntityLargeFireball.class, new RenderFireball(this, 2.0F));
  41500. this.field_78729_o.put(EntitySmallFireball.class, new RenderFireball(this, 0.5F));
  41501. this.field_78729_o.put(EntityDragonFireball.class, new RenderDragonFireball(this));
  41502. this.field_78729_o.put(EntityWitherSkull.class, new RenderWitherSkull(this));
  41503. this.field_78729_o.put(EntityShulkerBullet.class, new RenderShulkerBullet(this));
  41504. this.field_78729_o.put(EntityItem.class, new RenderEntityItem(this, p_i46180_2_));
  41505. this.field_78729_o.put(EntityXPOrb.class, new RenderXPOrb(this));
  41506. this.field_78729_o.put(EntityTNTPrimed.class, new RenderTNTPrimed(this));
  41507. this.field_78729_o.put(EntityFallingBlock.class, new RenderFallingBlock(this));
  41508. this.field_78729_o.put(EntityArmorStand.class, new RenderArmorStand(this));
  41509. this.field_78729_o.put(EntityEvokerFangs.class, new RenderEvokerFangs(this));
  41510. this.field_78729_o.put(EntityMinecartTNT.class, new RenderTntMinecart(this));
  41511. this.field_78729_o.put(EntityMinecartMobSpawner.class, new RenderMinecartMobSpawner(this));
  41512. this.field_78729_o.put(EntityMinecart.class, new RenderMinecart(this));
  41513. this.field_78729_o.put(EntityBoat.class, new RenderBoat(this));
  41514. this.field_78729_o.put(EntityFishHook.class, new RenderFish(this));
  41515. this.field_78729_o.put(EntityAreaEffectCloud.class, new RenderAreaEffectCloud(this));
  41516. this.field_78729_o.put(EntityHorse.class, new RenderHorse(this));
  41517. this.field_78729_o.put(EntitySkeletonHorse.class, new RenderAbstractHorse(this));
  41518. this.field_78729_o.put(EntityZombieHorse.class, new RenderAbstractHorse(this));
  41519. this.field_78729_o.put(EntityMule.class, new RenderAbstractHorse(this, 0.92F));
  41520. this.field_78729_o.put(EntityDonkey.class, new RenderAbstractHorse(this, 0.87F));
  41521. this.field_78729_o.put(EntityLlama.class, new RenderLlama(this));
  41522. this.field_78729_o.put(EntityLlamaSpit.class, new RenderLlamaSpit(this));
  41523. this.field_78729_o.put(EntityLightningBolt.class, new RenderLightningBolt(this));
  41524. this.field_178637_m = new RenderPlayer(this);
  41525. this.field_178636_l.put("default", this.field_178637_m);
  41526. this.field_178636_l.put("slim", new RenderPlayer(this, true));
  41527. }
  41528.  
  41529. public void func_178628_a(double p_178628_1_, double p_178628_3_, double p_178628_5_) {
  41530. this.field_78725_b = p_178628_1_;
  41531. this.field_78726_c = p_178628_3_;
  41532. this.field_78723_d = p_178628_5_;
  41533. }
  41534.  
  41535. public <T extends Entity> Render<T> func_78715_a(Class<? extends Entity> p_78715_1_) {
  41536. Render<? extends Entity> render = (Render)this.field_78729_o.get(p_78715_1_);
  41537. if(render == null && p_78715_1_ != Entity.class) {
  41538. render = this.<Entity>func_78715_a(p_78715_1_.getSuperclass());
  41539. this.field_78729_o.put(p_78715_1_, render);
  41540. }
  41541.  
  41542. return render;
  41543. }
  41544.  
  41545. @Nullable
  41546. public <T extends Entity> Render<T> func_78713_a(Entity p_78713_1_) {
  41547. if(p_78713_1_ instanceof AbstractClientPlayer) {
  41548. String s = ((AbstractClientPlayer)p_78713_1_).func_175154_l();
  41549. RenderPlayer renderplayer = (RenderPlayer)this.field_178636_l.get(s);
  41550. return renderplayer != null?renderplayer:this.field_178637_m;
  41551. } else {
  41552. return this.<T>func_78715_a(p_78713_1_.getClass());
  41553. }
  41554. }
  41555.  
  41556. public void func_180597_a(World p_180597_1_, FontRenderer p_180597_2_, Entity p_180597_3_, Entity p_180597_4_, GameSettings p_180597_5_, float p_180597_6_) {
  41557. this.field_78722_g = p_180597_1_;
  41558. this.field_78733_k = p_180597_5_;
  41559. this.field_78734_h = p_180597_3_;
  41560. this.field_147941_i = p_180597_4_;
  41561. this.field_78736_p = p_180597_2_;
  41562. if(p_180597_3_ instanceof EntityLivingBase && ((EntityLivingBase)p_180597_3_).func_70608_bn()) {
  41563. IBlockState iblockstate = p_180597_1_.func_180495_p(new BlockPos(p_180597_3_));
  41564. Block block = iblockstate.func_177230_c();
  41565. if(block == Blocks.field_150324_C) {
  41566. int i = ((EnumFacing)iblockstate.func_177229_b(BlockBed.field_185512_D)).func_176736_b();
  41567. this.field_78735_i = (float)(i * 90 + 180);
  41568. this.field_78732_j = 0.0F;
  41569. }
  41570. } else {
  41571. this.field_78735_i = p_180597_3_.field_70126_B + (p_180597_3_.field_70177_z - p_180597_3_.field_70126_B) * p_180597_6_;
  41572. this.field_78732_j = p_180597_3_.field_70127_C + (p_180597_3_.field_70125_A - p_180597_3_.field_70127_C) * p_180597_6_;
  41573. }
  41574.  
  41575. if(p_180597_5_.field_74320_O == 2) {
  41576. this.field_78735_i += 180.0F;
  41577. }
  41578.  
  41579. this.field_78730_l = p_180597_3_.field_70142_S + (p_180597_3_.field_70165_t - p_180597_3_.field_70142_S) * (double)p_180597_6_;
  41580. this.field_78731_m = p_180597_3_.field_70137_T + (p_180597_3_.field_70163_u - p_180597_3_.field_70137_T) * (double)p_180597_6_;
  41581. this.field_78728_n = p_180597_3_.field_70136_U + (p_180597_3_.field_70161_v - p_180597_3_.field_70136_U) * (double)p_180597_6_;
  41582. }
  41583.  
  41584. public void func_178631_a(float p_178631_1_) {
  41585. this.field_78735_i = p_178631_1_;
  41586. }
  41587.  
  41588. public boolean func_178627_a() {
  41589. return this.field_178638_s;
  41590. }
  41591.  
  41592. public void func_178633_a(boolean p_178633_1_) {
  41593. this.field_178638_s = p_178633_1_;
  41594. }
  41595.  
  41596. public void func_178629_b(boolean p_178629_1_) {
  41597. this.field_85095_o = p_178629_1_;
  41598. }
  41599.  
  41600. public boolean func_178634_b() {
  41601. return this.field_85095_o;
  41602. }
  41603.  
  41604. public boolean func_188390_b(Entity p_188390_1_) {
  41605. return this.func_78713_a(p_188390_1_).func_188295_H_();
  41606. }
  41607.  
  41608. public boolean func_178635_a(Entity p_178635_1_, ICamera p_178635_2_, double p_178635_3_, double p_178635_5_, double p_178635_7_) {
  41609. Render<Entity> render = this.<Entity>func_78713_a(p_178635_1_);
  41610. return render != null && render.func_177071_a(p_178635_1_, p_178635_2_, p_178635_3_, p_178635_5_, p_178635_7_);
  41611. }
  41612.  
  41613. public void func_188388_a(Entity p_188388_1_, float p_188388_2_, boolean p_188388_3_) {
  41614. if(p_188388_1_.field_70173_aa == 0) {
  41615. p_188388_1_.field_70142_S = p_188388_1_.field_70165_t;
  41616. p_188388_1_.field_70137_T = p_188388_1_.field_70163_u;
  41617. p_188388_1_.field_70136_U = p_188388_1_.field_70161_v;
  41618. }
  41619.  
  41620. double d0 = p_188388_1_.field_70142_S + (p_188388_1_.field_70165_t - p_188388_1_.field_70142_S) * (double)p_188388_2_;
  41621. double d1 = p_188388_1_.field_70137_T + (p_188388_1_.field_70163_u - p_188388_1_.field_70137_T) * (double)p_188388_2_;
  41622. double d2 = p_188388_1_.field_70136_U + (p_188388_1_.field_70161_v - p_188388_1_.field_70136_U) * (double)p_188388_2_;
  41623. float f = p_188388_1_.field_70126_B + (p_188388_1_.field_70177_z - p_188388_1_.field_70126_B) * p_188388_2_;
  41624. int i = p_188388_1_.func_70070_b();
  41625. if(p_188388_1_.func_70027_ad()) {
  41626. i = 15728880;
  41627. }
  41628.  
  41629. int j = i % 65536;
  41630. int k = i / 65536;
  41631. OpenGlHelper.func_77475_a(OpenGlHelper.field_77476_b, (float)j, (float)k);
  41632. GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
  41633. this.func_188391_a(p_188388_1_, d0 - this.field_78725_b, d1 - this.field_78726_c, d2 - this.field_78723_d, f, p_188388_2_, p_188388_3_);
  41634. }
  41635.  
  41636. public void func_188391_a(Entity p_188391_1_, double p_188391_2_, double p_188391_4_, double p_188391_6_, float p_188391_8_, float p_188391_9_, boolean p_188391_10_) {
  41637. Render<Entity> render = null;
  41638.  
  41639. try {
  41640. render = this.<Entity>func_78713_a(p_188391_1_);
  41641. if(render != null && this.field_78724_e != null) {
  41642. try {
  41643. render.func_188297_a(this.field_178639_r);
  41644. render.func_76986_a(p_188391_1_, p_188391_2_, p_188391_4_, p_188391_6_, p_188391_8_, p_188391_9_);
  41645. } catch (Throwable throwable1) {
  41646. throw new ReportedException(CrashReport.func_85055_a(throwable1, "Rendering entity in world"));
  41647. }
  41648.  
  41649. try {
  41650. if(!this.field_178639_r) {
  41651. render.func_76979_b(p_188391_1_, p_188391_2_, p_188391_4_, p_188391_6_, p_188391_8_, p_188391_9_);
  41652. }
  41653. } catch (Throwable throwable2) {
  41654. throw new ReportedException(CrashReport.func_85055_a(throwable2, "Post-rendering entity in world"));
  41655. }
  41656.  
  41657. if(this.field_85095_o && !p_188391_1_.func_82150_aj() && !p_188391_10_ && !Minecraft.func_71410_x().func_189648_am()) {
  41658. try {
  41659. this.func_85094_b(p_188391_1_, p_188391_2_, p_188391_4_, p_188391_6_, p_188391_8_, p_188391_9_);
  41660. } catch (Throwable throwable) {
  41661. throw new ReportedException(CrashReport.func_85055_a(throwable, "Rendering entity hitbox in world"));
  41662. }
  41663. }
  41664. }
  41665.  
  41666. } catch (Throwable throwable3) {
  41667. CrashReport crashreport = CrashReport.func_85055_a(throwable3, "Rendering entity in world");
  41668. CrashReportCategory crashreportcategory = crashreport.func_85058_a("Entity being rendered");
  41669. p_188391_1_.func_85029_a(crashreportcategory);
  41670. CrashReportCategory crashreportcategory1 = crashreport.func_85058_a("Renderer details");
  41671. crashreportcategory1.func_71507_a("Assigned renderer", render);
  41672. crashreportcategory1.func_71507_a("Location", CrashReportCategory.func_85074_a(p_188391_2_, p_188391_4_, p_188391_6_));
  41673. crashreportcategory1.func_71507_a("Rotation", Float.valueOf(p_188391_8_));
  41674. crashreportcategory1.func_71507_a("Delta", Float.valueOf(p_188391_9_));
  41675. throw new ReportedException(crashreport);
  41676. }
  41677. }
  41678.  
  41679. public void func_188389_a(Entity p_188389_1_, float p_188389_2_) {
  41680. if(p_188389_1_.field_70173_aa == 0) {
  41681. p_188389_1_.field_70142_S = p_188389_1_.field_70165_t;
  41682. p_188389_1_.field_70137_T = p_188389_1_.field_70163_u;
  41683. p_188389_1_.field_70136_U = p_188389_1_.field_70161_v;
  41684. }
  41685.  
  41686. double d0 = p_188389_1_.field_70142_S + (p_188389_1_.field_70165_t - p_188389_1_.field_70142_S) * (double)p_188389_2_;
  41687. double d1 = p_188389_1_.field_70137_T + (p_188389_1_.field_70163_u - p_188389_1_.field_70137_T) * (double)p_188389_2_;
  41688. double d2 = p_188389_1_.field_70136_U + (p_188389_1_.field_70161_v - p_188389_1_.field_70136_U) * (double)p_188389_2_;
  41689. float f = p_188389_1_.field_70126_B + (p_188389_1_.field_70177_z - p_188389_1_.field_70126_B) * p_188389_2_;
  41690. int i = p_188389_1_.func_70070_b();
  41691. if(p_188389_1_.func_70027_ad()) {
  41692. i = 15728880;
  41693. }
  41694.  
  41695. int j = i % 65536;
  41696. int k = i / 65536;
  41697. OpenGlHelper.func_77475_a(OpenGlHelper.field_77476_b, (float)j, (float)k);
  41698. GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
  41699. Render<Entity> render = this.<Entity>func_78713_a(p_188389_1_);
  41700. if(render != null && this.field_78724_e != null) {
  41701. render.func_188300_b(p_188389_1_, d0 - this.field_78725_b, d1 - this.field_78726_c, d2 - this.field_78723_d, f, p_188389_2_);
  41702. }
  41703.  
  41704. }
  41705.  
  41706. private void func_85094_b(Entity p_85094_1_, double p_85094_2_, double p_85094_4_, double p_85094_6_, float p_85094_8_, float p_85094_9_) {
  41707. GlStateManager.func_179132_a(false);
  41708. GlStateManager.func_179090_x();
  41709. GlStateManager.func_179140_f();
  41710. GlStateManager.func_179129_p();
  41711. GlStateManager.func_179084_k();
  41712. float f = p_85094_1_.field_70130_N / 2.0F;
  41713. AxisAlignedBB axisalignedbb = p_85094_1_.func_174813_aQ();
  41714. RenderGlobal.func_189694_a(axisalignedbb.field_72340_a - p_85094_1_.field_70165_t + p_85094_2_, axisalignedbb.field_72338_b - p_85094_1_.field_70163_u + p_85094_4_, axisalignedbb.field_72339_c - p_85094_1_.field_70161_v + p_85094_6_, axisalignedbb.field_72336_d - p_85094_1_.field_70165_t + p_85094_2_, axisalignedbb.field_72337_e - p_85094_1_.field_70163_u + p_85094_4_, axisalignedbb.field_72334_f - p_85094_1_.field_70161_v + p_85094_6_, 1.0F, 1.0F, 1.0F, 1.0F);
  41715. Entity[] aentity = p_85094_1_.func_70021_al();
  41716. if(aentity != null) {
  41717. for(Entity entity : aentity) {
  41718. double d0 = (entity.field_70165_t - entity.field_70169_q) * (double)p_85094_9_;
  41719. double d1 = (entity.field_70163_u - entity.field_70167_r) * (double)p_85094_9_;
  41720. double d2 = (entity.field_70161_v - entity.field_70166_s) * (double)p_85094_9_;
  41721. AxisAlignedBB axisalignedbb1 = entity.func_174813_aQ();
  41722. RenderGlobal.func_189694_a(axisalignedbb1.field_72340_a - this.field_78725_b + d0, axisalignedbb1.field_72338_b - this.field_78726_c + d1, axisalignedbb1.field_72339_c - this.field_78723_d + d2, axisalignedbb1.field_72336_d - this.field_78725_b + d0, axisalignedbb1.field_72337_e - this.field_78726_c + d1, axisalignedbb1.field_72334_f - this.field_78723_d + d2, 0.25F, 1.0F, 0.0F, 1.0F);
  41723. }
  41724. }
  41725.  
  41726. if(p_85094_1_ instanceof EntityLivingBase) {
  41727. float f1 = 0.01F;
  41728. RenderGlobal.func_189694_a(p_85094_2_ - (double)f, p_85094_4_ + (double)p_85094_1_.func_70047_e() - 0.009999999776482582D, p_85094_6_ - (double)f, p_85094_2_ + (double)f, p_85094_4_ + (double)p_85094_1_.func_70047_e() + 0.009999999776482582D, p_85094_6_ + (double)f, 1.0F, 0.0F, 0.0F, 1.0F);
  41729. }
  41730.  
  41731. Tessellator tessellator = Tessellator.func_178181_a();
  41732. BufferBuilder bufferbuilder = tessellator.func_178180_c();
  41733. Vec3d vec3d = p_85094_1_.func_70676_i(p_85094_9_);
  41734. bufferbuilder.func_181668_a(3, DefaultVertexFormats.field_181706_f);
  41735. bufferbuilder.func_181662_b(p_85094_2_, p_85094_4_ + (double)p_85094_1_.func_70047_e(), p_85094_6_).func_181669_b(0, 0, 255, 255).func_181675_d();
  41736. bufferbuilder.func_181662_b(p_85094_2_ + vec3d.field_72450_a * 2.0D, p_85094_4_ + (double)p_85094_1_.func_70047_e() + vec3d.field_72448_b * 2.0D, p_85094_6_ + vec3d.field_72449_c * 2.0D).func_181669_b(0, 0, 255, 255).func_181675_d();
  41737. tessellator.func_78381_a();
  41738. GlStateManager.func_179098_w();
  41739. GlStateManager.func_179145_e();
  41740. GlStateManager.func_179089_o();
  41741. GlStateManager.func_179084_k();
  41742. GlStateManager.func_179132_a(true);
  41743. }
  41744.  
  41745. public void func_78717_a(@Nullable World p_78717_1_) {
  41746. this.field_78722_g = p_78717_1_;
  41747. if(p_78717_1_ == null) {
  41748. this.field_78734_h = null;
  41749. }
  41750.  
  41751. }
  41752.  
  41753. public double func_78714_a(double p_78714_1_, double p_78714_3_, double p_78714_5_) {
  41754. double d0 = p_78714_1_ - this.field_78730_l;
  41755. double d1 = p_78714_3_ - this.field_78731_m;
  41756. double d2 = p_78714_5_ - this.field_78728_n;
  41757. return d0 * d0 + d1 * d1 + d2 * d2;
  41758. }
  41759.  
  41760. public FontRenderer func_78716_a() {
  41761. return this.field_78736_p;
  41762. }
  41763.  
  41764. public void func_178632_c(boolean p_178632_1_) {
  41765. this.field_178639_r = p_178632_1_;
  41766. }
  41767. }
  41768.  
  41769. Hunk 2 failed! Cannot find hunk target
  41770. if (p_78713_1_ instanceof AbstractClientPlayer) {
  41771. String s = ((AbstractClientPlayer)p_78713_1_).func_175154_l();
  41772. RenderPlayer renderplayer = this.field_178636_l.get(s);
  41773. - return renderplayer != null ? renderplayer : this.field_178637_m;
  41774. + return (Render<T>)(renderplayer != null ? renderplayer : this.field_178637_m);
  41775. } else {
  41776. return this.<T>func_78715_a(p_78713_1_.getClass());
  41777. }
  41778. File state
  41779. package net.minecraft.client.renderer.entity;
  41780.  
  41781. import com.google.common.collect.Maps;
  41782. import java.util.Map;
  41783. import javax.annotation.Nullable;
  41784. import net.minecraft.block.Block;
  41785. import net.minecraft.block.BlockBed;
  41786. import net.minecraft.block.state.IBlockState;
  41787. import net.minecraft.client.Minecraft;
  41788. import net.minecraft.client.entity.AbstractClientPlayer;
  41789. import net.minecraft.client.gui.FontRenderer;
  41790. import net.minecraft.client.renderer.BufferBuilder;
  41791. import net.minecraft.client.renderer.GlStateManager;
  41792. import net.minecraft.client.renderer.OpenGlHelper;
  41793. import net.minecraft.client.renderer.RenderGlobal;
  41794. import net.minecraft.client.renderer.RenderItem;
  41795. import net.minecraft.client.renderer.Tessellator;
  41796. import net.minecraft.client.renderer.culling.ICamera;
  41797. import net.minecraft.client.renderer.entity.Render;
  41798. import net.minecraft.client.renderer.entity.RenderAbstractHorse;
  41799. import net.minecraft.client.renderer.entity.RenderAreaEffectCloud;
  41800. import net.minecraft.client.renderer.entity.RenderArmorStand;
  41801. import net.minecraft.client.renderer.entity.RenderBat;
  41802. import net.minecraft.client.renderer.entity.RenderBlaze;
  41803. import net.minecraft.client.renderer.entity.RenderBoat;
  41804. import net.minecraft.client.renderer.entity.RenderCaveSpider;
  41805. import net.minecraft.client.renderer.entity.RenderChicken;
  41806. import net.minecraft.client.renderer.entity.RenderCow;
  41807. import net.minecraft.client.renderer.entity.RenderCreeper;
  41808. import net.minecraft.client.renderer.entity.RenderDragon;
  41809. import net.minecraft.client.renderer.entity.RenderDragonFireball;
  41810. import net.minecraft.client.renderer.entity.RenderElderGuardian;
  41811. import net.minecraft.client.renderer.entity.RenderEnderCrystal;
  41812. import net.minecraft.client.renderer.entity.RenderEnderman;
  41813. import net.minecraft.client.renderer.entity.RenderEndermite;
  41814. import net.minecraft.client.renderer.entity.RenderEntity;
  41815. import net.minecraft.client.renderer.entity.RenderEntityItem;
  41816. import net.minecraft.client.renderer.entity.RenderEvoker;
  41817. import net.minecraft.client.renderer.entity.RenderEvokerFangs;
  41818. import net.minecraft.client.renderer.entity.RenderFallingBlock;
  41819. import net.minecraft.client.renderer.entity.RenderFireball;
  41820. import net.minecraft.client.renderer.entity.RenderFish;
  41821. import net.minecraft.client.renderer.entity.RenderGhast;
  41822. import net.minecraft.client.renderer.entity.RenderGiantZombie;
  41823. import net.minecraft.client.renderer.entity.RenderGuardian;
  41824. import net.minecraft.client.renderer.entity.RenderHorse;
  41825. import net.minecraft.client.renderer.entity.RenderHusk;
  41826. import net.minecraft.client.renderer.entity.RenderIllusionIllager;
  41827. import net.minecraft.client.renderer.entity.RenderIronGolem;
  41828. import net.minecraft.client.renderer.entity.RenderItemFrame;
  41829. import net.minecraft.client.renderer.entity.RenderLeashKnot;
  41830. import net.minecraft.client.renderer.entity.RenderLightningBolt;
  41831. import net.minecraft.client.renderer.entity.RenderLlama;
  41832. import net.minecraft.client.renderer.entity.RenderLlamaSpit;
  41833. import net.minecraft.client.renderer.entity.RenderMagmaCube;
  41834. import net.minecraft.client.renderer.entity.RenderMinecart;
  41835. import net.minecraft.client.renderer.entity.RenderMinecartMobSpawner;
  41836. import net.minecraft.client.renderer.entity.RenderMooshroom;
  41837. import net.minecraft.client.renderer.entity.RenderOcelot;
  41838. import net.minecraft.client.renderer.entity.RenderPainting;
  41839. import net.minecraft.client.renderer.entity.RenderParrot;
  41840. import net.minecraft.client.renderer.entity.RenderPig;
  41841. import net.minecraft.client.renderer.entity.RenderPigZombie;
  41842. import net.minecraft.client.renderer.entity.RenderPlayer;
  41843. import net.minecraft.client.renderer.entity.RenderPolarBear;
  41844. import net.minecraft.client.renderer.entity.RenderPotion;
  41845. import net.minecraft.client.renderer.entity.RenderRabbit;
  41846. import net.minecraft.client.renderer.entity.RenderSheep;
  41847. import net.minecraft.client.renderer.entity.RenderShulker;
  41848. import net.minecraft.client.renderer.entity.RenderShulkerBullet;
  41849. import net.minecraft.client.renderer.entity.RenderSilverfish;
  41850. import net.minecraft.client.renderer.entity.RenderSkeleton;
  41851. import net.minecraft.client.renderer.entity.RenderSlime;
  41852. import net.minecraft.client.renderer.entity.RenderSnowMan;
  41853. import net.minecraft.client.renderer.entity.RenderSnowball;
  41854. import net.minecraft.client.renderer.entity.RenderSpectralArrow;
  41855. import net.minecraft.client.renderer.entity.RenderSpider;
  41856. import net.minecraft.client.renderer.entity.RenderSquid;
  41857. import net.minecraft.client.renderer.entity.RenderStray;
  41858. import net.minecraft.client.renderer.entity.RenderTNTPrimed;
  41859. import net.minecraft.client.renderer.entity.RenderTippedArrow;
  41860. import net.minecraft.client.renderer.entity.RenderTntMinecart;
  41861. import net.minecraft.client.renderer.entity.RenderVex;
  41862. import net.minecraft.client.renderer.entity.RenderVillager;
  41863. import net.minecraft.client.renderer.entity.RenderVindicator;
  41864. import net.minecraft.client.renderer.entity.RenderWitch;
  41865. import net.minecraft.client.renderer.entity.RenderWither;
  41866. import net.minecraft.client.renderer.entity.RenderWitherSkeleton;
  41867. import net.minecraft.client.renderer.entity.RenderWitherSkull;
  41868. import net.minecraft.client.renderer.entity.RenderWolf;
  41869. import net.minecraft.client.renderer.entity.RenderXPOrb;
  41870. import net.minecraft.client.renderer.entity.RenderZombie;
  41871. import net.minecraft.client.renderer.entity.RenderZombieVillager;
  41872. import net.minecraft.client.renderer.texture.TextureManager;
  41873. import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
  41874. import net.minecraft.client.settings.GameSettings;
  41875. import net.minecraft.crash.CrashReport;
  41876. import net.minecraft.crash.CrashReportCategory;
  41877. import net.minecraft.entity.Entity;
  41878. import net.minecraft.entity.EntityAreaEffectCloud;
  41879. import net.minecraft.entity.EntityLeashKnot;
  41880. import net.minecraft.entity.EntityLivingBase;
  41881. import net.minecraft.entity.boss.EntityDragon;
  41882. import net.minecraft.entity.boss.EntityWither;
  41883. import net.minecraft.entity.effect.EntityLightningBolt;
  41884. import net.minecraft.entity.item.EntityArmorStand;
  41885. import net.minecraft.entity.item.EntityBoat;
  41886. import net.minecraft.entity.item.EntityEnderCrystal;
  41887. import net.minecraft.entity.item.EntityEnderEye;
  41888. import net.minecraft.entity.item.EntityEnderPearl;
  41889. import net.minecraft.entity.item.EntityExpBottle;
  41890. import net.minecraft.entity.item.EntityFallingBlock;
  41891. import net.minecraft.entity.item.EntityFireworkRocket;
  41892. import net.minecraft.entity.item.EntityItem;
  41893. import net.minecraft.entity.item.EntityItemFrame;
  41894. import net.minecraft.entity.item.EntityMinecart;
  41895. import net.minecraft.entity.item.EntityMinecartMobSpawner;
  41896. import net.minecraft.entity.item.EntityMinecartTNT;
  41897. import net.minecraft.entity.item.EntityPainting;
  41898. import net.minecraft.entity.item.EntityTNTPrimed;
  41899. import net.minecraft.entity.item.EntityXPOrb;
  41900. import net.minecraft.entity.monster.EntityBlaze;
  41901. import net.minecraft.entity.monster.EntityCaveSpider;
  41902. import net.minecraft.entity.monster.EntityCreeper;
  41903. import net.minecraft.entity.monster.EntityElderGuardian;
  41904. import net.minecraft.entity.monster.EntityEnderman;
  41905. import net.minecraft.entity.monster.EntityEndermite;
  41906. import net.minecraft.entity.monster.EntityEvoker;
  41907. import net.minecraft.entity.monster.EntityGhast;
  41908. import net.minecraft.entity.monster.EntityGiantZombie;
  41909. import net.minecraft.entity.monster.EntityGuardian;
  41910. import net.minecraft.entity.monster.EntityHusk;
  41911. import net.minecraft.entity.monster.EntityIllusionIllager;
  41912. import net.minecraft.entity.monster.EntityIronGolem;
  41913. import net.minecraft.entity.monster.EntityMagmaCube;
  41914. import net.minecraft.entity.monster.EntityPigZombie;
  41915. import net.minecraft.entity.monster.EntityPolarBear;
  41916. import net.minecraft.entity.monster.EntityShulker;
  41917. import net.minecraft.entity.monster.EntitySilverfish;
  41918. import net.minecraft.entity.monster.EntitySkeleton;
  41919. import net.minecraft.entity.monster.EntitySlime;
  41920. import net.minecraft.entity.monster.EntitySnowman;
  41921. import net.minecraft.entity.monster.EntitySpider;
  41922. import net.minecraft.entity.monster.EntityStray;
  41923. import net.minecraft.entity.monster.EntityVex;
  41924. import net.minecraft.entity.monster.EntityVindicator;
  41925. import net.minecraft.entity.monster.EntityWitch;
  41926. import net.minecraft.entity.monster.EntityWitherSkeleton;
  41927. import net.minecraft.entity.monster.EntityZombie;
  41928. import net.minecraft.entity.monster.EntityZombieVillager;
  41929. import net.minecraft.entity.passive.EntityBat;
  41930. import net.minecraft.entity.passive.EntityChicken;
  41931. import net.minecraft.entity.passive.EntityCow;
  41932. import net.minecraft.entity.passive.EntityDonkey;
  41933. import net.minecraft.entity.passive.EntityHorse;
  41934. import net.minecraft.entity.passive.EntityLlama;
  41935. import net.minecraft.entity.passive.EntityMooshroom;
  41936. import net.minecraft.entity.passive.EntityMule;
  41937. import net.minecraft.entity.passive.EntityOcelot;
  41938. import net.minecraft.entity.passive.EntityParrot;
  41939. import net.minecraft.entity.passive.EntityPig;
  41940. import net.minecraft.entity.passive.EntityRabbit;
  41941. import net.minecraft.entity.passive.EntitySheep;
  41942. import net.minecraft.entity.passive.EntitySkeletonHorse;
  41943. import net.minecraft.entity.passive.EntitySquid;
  41944. import net.minecraft.entity.passive.EntityVillager;
  41945. import net.minecraft.entity.passive.EntityWolf;
  41946. import net.minecraft.entity.passive.EntityZombieHorse;
  41947. import net.minecraft.entity.projectile.EntityDragonFireball;
  41948. import net.minecraft.entity.projectile.EntityEgg;
  41949. import net.minecraft.entity.projectile.EntityEvokerFangs;
  41950. import net.minecraft.entity.projectile.EntityFishHook;
  41951. import net.minecraft.entity.projectile.EntityLargeFireball;
  41952. import net.minecraft.entity.projectile.EntityLlamaSpit;
  41953. import net.minecraft.entity.projectile.EntityPotion;
  41954. import net.minecraft.entity.projectile.EntityShulkerBullet;
  41955. import net.minecraft.entity.projectile.EntitySmallFireball;
  41956. import net.minecraft.entity.projectile.EntitySnowball;
  41957. import net.minecraft.entity.projectile.EntitySpectralArrow;
  41958. import net.minecraft.entity.projectile.EntityTippedArrow;
  41959. import net.minecraft.entity.projectile.EntityWitherSkull;
  41960. import net.minecraft.init.Blocks;
  41961. import net.minecraft.init.Items;
  41962. import net.minecraft.util.EnumFacing;
  41963. import net.minecraft.util.ReportedException;
  41964. import net.minecraft.util.math.AxisAlignedBB;
  41965. import net.minecraft.util.math.BlockPos;
  41966. import net.minecraft.util.math.Vec3d;
  41967. import net.minecraft.world.World;
  41968. import net.minecraftforge.fml.relauncher.Side;
  41969. import net.minecraftforge.fml.relauncher.SideOnly;
  41970.  
  41971. @SideOnly(Side.CLIENT)
  41972. public class RenderManager {
  41973. public final Map<Class<? extends Entity>, Render<? extends Entity>> field_78729_o = Maps.<Class<? extends Entity>, Render<? extends Entity>>newHashMap();
  41974. private final Map<String, RenderPlayer> field_178636_l = Maps.<String, RenderPlayer>newHashMap();
  41975. private final RenderPlayer field_178637_m;
  41976. private FontRenderer field_78736_p;
  41977. private double field_78725_b;
  41978. private double field_78726_c;
  41979. private double field_78723_d;
  41980. public TextureManager field_78724_e;
  41981. public World field_78722_g;
  41982. public Entity field_78734_h;
  41983. public Entity field_147941_i;
  41984. public float field_78735_i;
  41985. public float field_78732_j;
  41986. public GameSettings field_78733_k;
  41987. public double field_78730_l;
  41988. public double field_78731_m;
  41989. public double field_78728_n;
  41990. private boolean field_178639_r;
  41991. private boolean field_178638_s = true;
  41992. private boolean field_85095_o;
  41993.  
  41994. public RenderManager(TextureManager p_i46180_1_, RenderItem p_i46180_2_) {
  41995. this.field_78724_e = p_i46180_1_;
  41996. this.field_78729_o.put(EntityCaveSpider.class, new RenderCaveSpider(this));
  41997. this.field_78729_o.put(EntitySpider.class, new RenderSpider(this));
  41998. this.field_78729_o.put(EntityPig.class, new RenderPig(this));
  41999. this.field_78729_o.put(EntitySheep.class, new RenderSheep(this));
  42000. this.field_78729_o.put(EntityCow.class, new RenderCow(this));
  42001. this.field_78729_o.put(EntityMooshroom.class, new RenderMooshroom(this));
  42002. this.field_78729_o.put(EntityWolf.class, new RenderWolf(this));
  42003. this.field_78729_o.put(EntityChicken.class, new RenderChicken(this));
  42004. this.field_78729_o.put(EntityOcelot.class, new RenderOcelot(this));
  42005. this.field_78729_o.put(EntityRabbit.class, new RenderRabbit(this));
  42006. this.field_78729_o.put(EntityParrot.class, new RenderParrot(this));
  42007. this.field_78729_o.put(EntitySilverfish.class, new RenderSilverfish(this));
  42008. this.field_78729_o.put(EntityEndermite.class, new RenderEndermite(this));
  42009. this.field_78729_o.put(EntityCreeper.class, new RenderCreeper(this));
  42010. this.field_78729_o.put(EntityEnderman.class, new RenderEnderman(this));
  42011. this.field_78729_o.put(EntitySnowman.class, new RenderSnowMan(this));
  42012. this.field_78729_o.put(EntitySkeleton.class, new RenderSkeleton(this));
  42013. this.field_78729_o.put(EntityWitherSkeleton.class, new RenderWitherSkeleton(this));
  42014. this.field_78729_o.put(EntityStray.class, new RenderStray(this));
  42015. this.field_78729_o.put(EntityWitch.class, new RenderWitch(this));
  42016. this.field_78729_o.put(EntityBlaze.class, new RenderBlaze(this));
  42017. this.field_78729_o.put(EntityPigZombie.class, new RenderPigZombie(this));
  42018. this.field_78729_o.put(EntityZombie.class, new RenderZombie(this));
  42019. this.field_78729_o.put(EntityZombieVillager.class, new RenderZombieVillager(this));
  42020. this.field_78729_o.put(EntityHusk.class, new RenderHusk(this));
  42021. this.field_78729_o.put(EntitySlime.class, new RenderSlime(this));
  42022. this.field_78729_o.put(EntityMagmaCube.class, new RenderMagmaCube(this));
  42023. this.field_78729_o.put(EntityGiantZombie.class, new RenderGiantZombie(this, 6.0F));
  42024. this.field_78729_o.put(EntityGhast.class, new RenderGhast(this));
  42025. this.field_78729_o.put(EntitySquid.class, new RenderSquid(this));
  42026. this.field_78729_o.put(EntityVillager.class, new RenderVillager(this));
  42027. this.field_78729_o.put(EntityIronGolem.class, new RenderIronGolem(this));
  42028. this.field_78729_o.put(EntityBat.class, new RenderBat(this));
  42029. this.field_78729_o.put(EntityGuardian.class, new RenderGuardian(this));
  42030. this.field_78729_o.put(EntityElderGuardian.class, new RenderElderGuardian(this));
  42031. this.field_78729_o.put(EntityShulker.class, new RenderShulker(this));
  42032. this.field_78729_o.put(EntityPolarBear.class, new RenderPolarBear(this));
  42033. this.field_78729_o.put(EntityEvoker.class, new RenderEvoker(this));
  42034. this.field_78729_o.put(EntityVindicator.class, new RenderVindicator(this));
  42035. this.field_78729_o.put(EntityVex.class, new RenderVex(this));
  42036. this.field_78729_o.put(EntityIllusionIllager.class, new RenderIllusionIllager(this));
  42037. this.field_78729_o.put(EntityDragon.class, new RenderDragon(this));
  42038. this.field_78729_o.put(EntityEnderCrystal.class, new RenderEnderCrystal(this));
  42039. this.field_78729_o.put(EntityWither.class, new RenderWither(this));
  42040. this.field_78729_o.put(Entity.class, new RenderEntity(this));
  42041. this.field_78729_o.put(EntityPainting.class, new RenderPainting(this));
  42042. this.field_78729_o.put(EntityItemFrame.class, new RenderItemFrame(this, p_i46180_2_));
  42043. this.field_78729_o.put(EntityLeashKnot.class, new RenderLeashKnot(this));
  42044. this.field_78729_o.put(EntityTippedArrow.class, new RenderTippedArrow(this));
  42045. this.field_78729_o.put(EntitySpectralArrow.class, new RenderSpectralArrow(this));
  42046. this.field_78729_o.put(EntitySnowball.class, new RenderSnowball(this, Items.field_151126_ay, p_i46180_2_));
  42047. this.field_78729_o.put(EntityEnderPearl.class, new RenderSnowball(this, Items.field_151079_bi, p_i46180_2_));
  42048. this.field_78729_o.put(EntityEnderEye.class, new RenderSnowball(this, Items.field_151061_bv, p_i46180_2_));
  42049. this.field_78729_o.put(EntityEgg.class, new RenderSnowball(this, Items.field_151110_aK, p_i46180_2_));
  42050. this.field_78729_o.put(EntityPotion.class, new RenderPotion(this, p_i46180_2_));
  42051. this.field_78729_o.put(EntityExpBottle.class, new RenderSnowball(this, Items.field_151062_by, p_i46180_2_));
  42052. this.field_78729_o.put(EntityFireworkRocket.class, new RenderSnowball(this, Items.field_151152_bP, p_i46180_2_));
  42053. this.field_78729_o.put(EntityLargeFireball.class, new RenderFireball(this, 2.0F));
  42054. this.field_78729_o.put(EntitySmallFireball.class, new RenderFireball(this, 0.5F));
  42055. this.field_78729_o.put(EntityDragonFireball.class, new RenderDragonFireball(this));
  42056. this.field_78729_o.put(EntityWitherSkull.class, new RenderWitherSkull(this));
  42057. this.field_78729_o.put(EntityShulkerBullet.class, new RenderShulkerBullet(this));
  42058. this.field_78729_o.put(EntityItem.class, new RenderEntityItem(this, p_i46180_2_));
  42059. this.field_78729_o.put(EntityXPOrb.class, new RenderXPOrb(this));
  42060. this.field_78729_o.put(EntityTNTPrimed.class, new RenderTNTPrimed(this));
  42061. this.field_78729_o.put(EntityFallingBlock.class, new RenderFallingBlock(this));
  42062. this.field_78729_o.put(EntityArmorStand.class, new RenderArmorStand(this));
  42063. this.field_78729_o.put(EntityEvokerFangs.class, new RenderEvokerFangs(this));
  42064. this.field_78729_o.put(EntityMinecartTNT.class, new RenderTntMinecart(this));
  42065. this.field_78729_o.put(EntityMinecartMobSpawner.class, new RenderMinecartMobSpawner(this));
  42066. this.field_78729_o.put(EntityMinecart.class, new RenderMinecart(this));
  42067. this.field_78729_o.put(EntityBoat.class, new RenderBoat(this));
  42068. this.field_78729_o.put(EntityFishHook.class, new RenderFish(this));
  42069. this.field_78729_o.put(EntityAreaEffectCloud.class, new RenderAreaEffectCloud(this));
  42070. this.field_78729_o.put(EntityHorse.class, new RenderHorse(this));
  42071. this.field_78729_o.put(EntitySkeletonHorse.class, new RenderAbstractHorse(this));
  42072. this.field_78729_o.put(EntityZombieHorse.class, new RenderAbstractHorse(this));
  42073. this.field_78729_o.put(EntityMule.class, new RenderAbstractHorse(this, 0.92F));
  42074. this.field_78729_o.put(EntityDonkey.class, new RenderAbstractHorse(this, 0.87F));
  42075. this.field_78729_o.put(EntityLlama.class, new RenderLlama(this));
  42076. this.field_78729_o.put(EntityLlamaSpit.class, new RenderLlamaSpit(this));
  42077. this.field_78729_o.put(EntityLightningBolt.class, new RenderLightningBolt(this));
  42078. this.field_178637_m = new RenderPlayer(this);
  42079. this.field_178636_l.put("default", this.field_178637_m);
  42080. this.field_178636_l.put("slim", new RenderPlayer(this, true));
  42081. }
  42082.  
  42083. public void func_178628_a(double p_178628_1_, double p_178628_3_, double p_178628_5_) {
  42084. this.field_78725_b = p_178628_1_;
  42085. this.field_78726_c = p_178628_3_;
  42086. this.field_78723_d = p_178628_5_;
  42087. }
  42088.  
  42089. public <T extends Entity> Render<T> func_78715_a(Class<? extends Entity> p_78715_1_) {
  42090. Render<? extends Entity> render = (Render)this.field_78729_o.get(p_78715_1_);
  42091. if(render == null && p_78715_1_ != Entity.class) {
  42092. render = this.<Entity>func_78715_a(p_78715_1_.getSuperclass());
  42093. this.field_78729_o.put(p_78715_1_, render);
  42094. }
  42095.  
  42096. return render;
  42097. }
  42098.  
  42099. @Nullable
  42100. public <T extends Entity> Render<T> func_78713_a(Entity p_78713_1_) {
  42101. if(p_78713_1_ instanceof AbstractClientPlayer) {
  42102. String s = ((AbstractClientPlayer)p_78713_1_).func_175154_l();
  42103. RenderPlayer renderplayer = (RenderPlayer)this.field_178636_l.get(s);
  42104. return renderplayer != null?renderplayer:this.field_178637_m;
  42105. } else {
  42106. return this.<T>func_78715_a(p_78713_1_.getClass());
  42107. }
  42108. }
  42109.  
  42110. public void func_180597_a(World p_180597_1_, FontRenderer p_180597_2_, Entity p_180597_3_, Entity p_180597_4_, GameSettings p_180597_5_, float p_180597_6_) {
  42111. this.field_78722_g = p_180597_1_;
  42112. this.field_78733_k = p_180597_5_;
  42113. this.field_78734_h = p_180597_3_;
  42114. this.field_147941_i = p_180597_4_;
  42115. this.field_78736_p = p_180597_2_;
  42116. if(p_180597_3_ instanceof EntityLivingBase && ((EntityLivingBase)p_180597_3_).func_70608_bn()) {
  42117. IBlockState iblockstate = p_180597_1_.func_180495_p(new BlockPos(p_180597_3_));
  42118. Block block = iblockstate.func_177230_c();
  42119. if(block == Blocks.field_150324_C) {
  42120. int i = ((EnumFacing)iblockstate.func_177229_b(BlockBed.field_185512_D)).func_176736_b();
  42121. this.field_78735_i = (float)(i * 90 + 180);
  42122. this.field_78732_j = 0.0F;
  42123. }
  42124. } else {
  42125. this.field_78735_i = p_180597_3_.field_70126_B + (p_180597_3_.field_70177_z - p_180597_3_.field_70126_B) * p_180597_6_;
  42126. this.field_78732_j = p_180597_3_.field_70127_C + (p_180597_3_.field_70125_A - p_180597_3_.field_70127_C) * p_180597_6_;
  42127. }
  42128.  
  42129. if(p_180597_5_.field_74320_O == 2) {
  42130. this.field_78735_i += 180.0F;
  42131. }
  42132.  
  42133. this.field_78730_l = p_180597_3_.field_70142_S + (p_180597_3_.field_70165_t - p_180597_3_.field_70142_S) * (double)p_180597_6_;
  42134. this.field_78731_m = p_180597_3_.field_70137_T + (p_180597_3_.field_70163_u - p_180597_3_.field_70137_T) * (double)p_180597_6_;
  42135. this.field_78728_n = p_180597_3_.field_70136_U + (p_180597_3_.field_70161_v - p_180597_3_.field_70136_U) * (double)p_180597_6_;
  42136. }
  42137.  
  42138. public void func_178631_a(float p_178631_1_) {
  42139. this.field_78735_i = p_178631_1_;
  42140. }
  42141.  
  42142. public boolean func_178627_a() {
  42143. return this.field_178638_s;
  42144. }
  42145.  
  42146. public void func_178633_a(boolean p_178633_1_) {
  42147. this.field_178638_s = p_178633_1_;
  42148. }
  42149.  
  42150. public void func_178629_b(boolean p_178629_1_) {
  42151. this.field_85095_o = p_178629_1_;
  42152. }
  42153.  
  42154. public boolean func_178634_b() {
  42155. return this.field_85095_o;
  42156. }
  42157.  
  42158. public boolean func_188390_b(Entity p_188390_1_) {
  42159. return this.func_78713_a(p_188390_1_).func_188295_H_();
  42160. }
  42161.  
  42162. public boolean func_178635_a(Entity p_178635_1_, ICamera p_178635_2_, double p_178635_3_, double p_178635_5_, double p_178635_7_) {
  42163. Render<Entity> render = this.<Entity>func_78713_a(p_178635_1_);
  42164. return render != null && render.func_177071_a(p_178635_1_, p_178635_2_, p_178635_3_, p_178635_5_, p_178635_7_);
  42165. }
  42166.  
  42167. public void func_188388_a(Entity p_188388_1_, float p_188388_2_, boolean p_188388_3_) {
  42168. if(p_188388_1_.field_70173_aa == 0) {
  42169. p_188388_1_.field_70142_S = p_188388_1_.field_70165_t;
  42170. p_188388_1_.field_70137_T = p_188388_1_.field_70163_u;
  42171. p_188388_1_.field_70136_U = p_188388_1_.field_70161_v;
  42172. }
  42173.  
  42174. double d0 = p_188388_1_.field_70142_S + (p_188388_1_.field_70165_t - p_188388_1_.field_70142_S) * (double)p_188388_2_;
  42175. double d1 = p_188388_1_.field_70137_T + (p_188388_1_.field_70163_u - p_188388_1_.field_70137_T) * (double)p_188388_2_;
  42176. double d2 = p_188388_1_.field_70136_U + (p_188388_1_.field_70161_v - p_188388_1_.field_70136_U) * (double)p_188388_2_;
  42177. float f = p_188388_1_.field_70126_B + (p_188388_1_.field_70177_z - p_188388_1_.field_70126_B) * p_188388_2_;
  42178. int i = p_188388_1_.func_70070_b();
  42179. if(p_188388_1_.func_70027_ad()) {
  42180. i = 15728880;
  42181. }
  42182.  
  42183. int j = i % 65536;
  42184. int k = i / 65536;
  42185. OpenGlHelper.func_77475_a(OpenGlHelper.field_77476_b, (float)j, (float)k);
  42186. GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
  42187. this.func_188391_a(p_188388_1_, d0 - this.field_78725_b, d1 - this.field_78726_c, d2 - this.field_78723_d, f, p_188388_2_, p_188388_3_);
  42188. }
  42189.  
  42190. public void func_188391_a(Entity p_188391_1_, double p_188391_2_, double p_188391_4_, double p_188391_6_, float p_188391_8_, float p_188391_9_, boolean p_188391_10_) {
  42191. Render<Entity> render = null;
  42192.  
  42193. try {
  42194. render = this.<Entity>func_78713_a(p_188391_1_);
  42195. if(render != null && this.field_78724_e != null) {
  42196. try {
  42197. render.func_188297_a(this.field_178639_r);
  42198. render.func_76986_a(p_188391_1_, p_188391_2_, p_188391_4_, p_188391_6_, p_188391_8_, p_188391_9_);
  42199. } catch (Throwable throwable1) {
  42200. throw new ReportedException(CrashReport.func_85055_a(throwable1, "Rendering entity in world"));
  42201. }
  42202.  
  42203. try {
  42204. if(!this.field_178639_r) {
  42205. render.func_76979_b(p_188391_1_, p_188391_2_, p_188391_4_, p_188391_6_, p_188391_8_, p_188391_9_);
  42206. }
  42207. } catch (Throwable throwable2) {
  42208. throw new ReportedException(CrashReport.func_85055_a(throwable2, "Post-rendering entity in world"));
  42209. }
  42210.  
  42211. if(this.field_85095_o && !p_188391_1_.func_82150_aj() && !p_188391_10_ && !Minecraft.func_71410_x().func_189648_am()) {
  42212. try {
  42213. this.func_85094_b(p_188391_1_, p_188391_2_, p_188391_4_, p_188391_6_, p_188391_8_, p_188391_9_);
  42214. } catch (Throwable throwable) {
  42215. throw new ReportedException(CrashReport.func_85055_a(throwable, "Rendering entity hitbox in world"));
  42216. }
  42217. }
  42218. }
  42219.  
  42220. } catch (Throwable throwable3) {
  42221. CrashReport crashreport = CrashReport.func_85055_a(throwable3, "Rendering entity in world");
  42222. CrashReportCategory crashreportcategory = crashreport.func_85058_a("Entity being rendered");
  42223. p_188391_1_.func_85029_a(crashreportcategory);
  42224. CrashReportCategory crashreportcategory1 = crashreport.func_85058_a("Renderer details");
  42225. crashreportcategory1.func_71507_a("Assigned renderer", render);
  42226. crashreportcategory1.func_71507_a("Location", CrashReportCategory.func_85074_a(p_188391_2_, p_188391_4_, p_188391_6_));
  42227. crashreportcategory1.func_71507_a("Rotation", Float.valueOf(p_188391_8_));
  42228. crashreportcategory1.func_71507_a("Delta", Float.valueOf(p_188391_9_));
  42229. throw new ReportedException(crashreport);
  42230. }
  42231. }
  42232.  
  42233. public void func_188389_a(Entity p_188389_1_, float p_188389_2_) {
  42234. if(p_188389_1_.field_70173_aa == 0) {
  42235. p_188389_1_.field_70142_S = p_188389_1_.field_70165_t;
  42236. p_188389_1_.field_70137_T = p_188389_1_.field_70163_u;
  42237. p_188389_1_.field_70136_U = p_188389_1_.field_70161_v;
  42238. }
  42239.  
  42240. double d0 = p_188389_1_.field_70142_S + (p_188389_1_.field_70165_t - p_188389_1_.field_70142_S) * (double)p_188389_2_;
  42241. double d1 = p_188389_1_.field_70137_T + (p_188389_1_.field_70163_u - p_188389_1_.field_70137_T) * (double)p_188389_2_;
  42242. double d2 = p_188389_1_.field_70136_U + (p_188389_1_.field_70161_v - p_188389_1_.field_70136_U) * (double)p_188389_2_;
  42243. float f = p_188389_1_.field_70126_B + (p_188389_1_.field_70177_z - p_188389_1_.field_70126_B) * p_188389_2_;
  42244. int i = p_188389_1_.func_70070_b();
  42245. if(p_188389_1_.func_70027_ad()) {
  42246. i = 15728880;
  42247. }
  42248.  
  42249. int j = i % 65536;
  42250. int k = i / 65536;
  42251. OpenGlHelper.func_77475_a(OpenGlHelper.field_77476_b, (float)j, (float)k);
  42252. GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
  42253. Render<Entity> render = this.<Entity>func_78713_a(p_188389_1_);
  42254. if(render != null && this.field_78724_e != null) {
  42255. render.func_188300_b(p_188389_1_, d0 - this.field_78725_b, d1 - this.field_78726_c, d2 - this.field_78723_d, f, p_188389_2_);
  42256. }
  42257.  
  42258. }
  42259.  
  42260. private void func_85094_b(Entity p_85094_1_, double p_85094_2_, double p_85094_4_, double p_85094_6_, float p_85094_8_, float p_85094_9_) {
  42261. GlStateManager.func_179132_a(false);
  42262. GlStateManager.func_179090_x();
  42263. GlStateManager.func_179140_f();
  42264. GlStateManager.func_179129_p();
  42265. GlStateManager.func_179084_k();
  42266. float f = p_85094_1_.field_70130_N / 2.0F;
  42267. AxisAlignedBB axisalignedbb = p_85094_1_.func_174813_aQ();
  42268. RenderGlobal.func_189694_a(axisalignedbb.field_72340_a - p_85094_1_.field_70165_t + p_85094_2_, axisalignedbb.field_72338_b - p_85094_1_.field_70163_u + p_85094_4_, axisalignedbb.field_72339_c - p_85094_1_.field_70161_v + p_85094_6_, axisalignedbb.field_72336_d - p_85094_1_.field_70165_t + p_85094_2_, axisalignedbb.field_72337_e - p_85094_1_.field_70163_u + p_85094_4_, axisalignedbb.field_72334_f - p_85094_1_.field_70161_v + p_85094_6_, 1.0F, 1.0F, 1.0F, 1.0F);
  42269. Entity[] aentity = p_85094_1_.func_70021_al();
  42270. if(aentity != null) {
  42271. for(Entity entity : aentity) {
  42272. double d0 = (entity.field_70165_t - entity.field_70169_q) * (double)p_85094_9_;
  42273. double d1 = (entity.field_70163_u - entity.field_70167_r) * (double)p_85094_9_;
  42274. double d2 = (entity.field_70161_v - entity.field_70166_s) * (double)p_85094_9_;
  42275. AxisAlignedBB axisalignedbb1 = entity.func_174813_aQ();
  42276. RenderGlobal.func_189694_a(axisalignedbb1.field_72340_a - this.field_78725_b + d0, axisalignedbb1.field_72338_b - this.field_78726_c + d1, axisalignedbb1.field_72339_c - this.field_78723_d + d2, axisalignedbb1.field_72336_d - this.field_78725_b + d0, axisalignedbb1.field_72337_e - this.field_78726_c + d1, axisalignedbb1.field_72334_f - this.field_78723_d + d2, 0.25F, 1.0F, 0.0F, 1.0F);
  42277. }
  42278. }
  42279.  
  42280. if(p_85094_1_ instanceof EntityLivingBase) {
  42281. float f1 = 0.01F;
  42282. RenderGlobal.func_189694_a(p_85094_2_ - (double)f, p_85094_4_ + (double)p_85094_1_.func_70047_e() - 0.009999999776482582D, p_85094_6_ - (double)f, p_85094_2_ + (double)f, p_85094_4_ + (double)p_85094_1_.func_70047_e() + 0.009999999776482582D, p_85094_6_ + (double)f, 1.0F, 0.0F, 0.0F, 1.0F);
  42283. }
  42284.  
  42285. Tessellator tessellator = Tessellator.func_178181_a();
  42286. BufferBuilder bufferbuilder = tessellator.func_178180_c();
  42287. Vec3d vec3d = p_85094_1_.func_70676_i(p_85094_9_);
  42288. bufferbuilder.func_181668_a(3, DefaultVertexFormats.field_181706_f);
  42289. bufferbuilder.func_181662_b(p_85094_2_, p_85094_4_ + (double)p_85094_1_.func_70047_e(), p_85094_6_).func_181669_b(0, 0, 255, 255).func_181675_d();
  42290. bufferbuilder.func_181662_b(p_85094_2_ + vec3d.field_72450_a * 2.0D, p_85094_4_ + (double)p_85094_1_.func_70047_e() + vec3d.field_72448_b * 2.0D, p_85094_6_ + vec3d.field_72449_c * 2.0D).func_181669_b(0, 0, 255, 255).func_181675_d();
  42291. tessellator.func_78381_a();
  42292. GlStateManager.func_179098_w();
  42293. GlStateManager.func_179145_e();
  42294. GlStateManager.func_179089_o();
  42295. GlStateManager.func_179084_k();
  42296. GlStateManager.func_179132_a(true);
  42297. }
  42298.  
  42299. public void func_78717_a(@Nullable World p_78717_1_) {
  42300. this.field_78722_g = p_78717_1_;
  42301. if(p_78717_1_ == null) {
  42302. this.field_78734_h = null;
  42303. }
  42304.  
  42305. }
  42306.  
  42307. public double func_78714_a(double p_78714_1_, double p_78714_3_, double p_78714_5_) {
  42308. double d0 = p_78714_1_ - this.field_78730_l;
  42309. double d1 = p_78714_3_ - this.field_78731_m;
  42310. double d2 = p_78714_5_ - this.field_78728_n;
  42311. return d0 * d0 + d1 * d1 + d2 * d2;
  42312. }
  42313.  
  42314. public FontRenderer func_78716_a() {
  42315. return this.field_78736_p;
  42316. }
  42317.  
  42318. public void func_178632_c(boolean p_178632_1_) {
  42319. this.field_178639_r = p_178632_1_;
  42320. }
  42321. }
  42322.  
  42323. Patching failed: minecraft\net\minecraft\client\renderer\entity\RenderGiantZombie.java
  42324. Hunk 1 failed! Cannot find hunk target
  42325. this.func_177094_a(new LayerHeldItem(this));
  42326. this.func_177094_a(new LayerBipedArmor(this) {
  42327. protected void func_177177_a() {
  42328. - this.field_177189_c = (T)(new ModelZombie(0.5F, true));
  42329. - this.field_177186_d = (T)(new ModelZombie(1.0F, true));
  42330. + this.field_177189_c = new ModelZombie(0.5F, true);
  42331. + this.field_177186_d = new ModelZombie(1.0F, true);
  42332. }
  42333. });
  42334. }
  42335. File state
  42336. package net.minecraft.client.renderer.entity;
  42337.  
  42338. import net.minecraft.client.model.ModelZombie;
  42339. import net.minecraft.client.renderer.GlStateManager;
  42340. import net.minecraft.client.renderer.entity.RenderLiving;
  42341. import net.minecraft.client.renderer.entity.RenderManager;
  42342. import net.minecraft.client.renderer.entity.layers.LayerBipedArmor;
  42343. import net.minecraft.client.renderer.entity.layers.LayerHeldItem;
  42344. import net.minecraft.entity.monster.EntityGiantZombie;
  42345. import net.minecraft.util.ResourceLocation;
  42346. import net.minecraftforge.fml.relauncher.Side;
  42347. import net.minecraftforge.fml.relauncher.SideOnly;
  42348.  
  42349. @SideOnly(Side.CLIENT)
  42350. public class RenderGiantZombie extends RenderLiving<EntityGiantZombie> {
  42351. private static final ResourceLocation field_110871_a = new ResourceLocation("textures/entity/zombie/zombie.png");
  42352. private final float field_77073_a;
  42353.  
  42354. public RenderGiantZombie(RenderManager p_i47206_1_, float p_i47206_2_) {
  42355. super(p_i47206_1_, new ModelZombie(), 0.5F * p_i47206_2_);
  42356. this.field_77073_a = p_i47206_2_;
  42357. this.func_177094_a(new LayerHeldItem(this));
  42358. this.func_177094_a(new LayerBipedArmor(this) {
  42359. protected void func_177177_a() {
  42360. this.field_177189_c = new ModelZombie(0.5F, true);
  42361. this.field_177186_d = new ModelZombie(1.0F, true);
  42362. }
  42363. });
  42364. }
  42365.  
  42366. public void func_82422_c() {
  42367. GlStateManager.func_179109_b(0.0F, 0.1875F, 0.0F);
  42368. }
  42369.  
  42370. protected void func_77041_b(EntityGiantZombie p_77041_1_, float p_77041_2_) {
  42371. GlStateManager.func_179152_a(this.field_77073_a, this.field_77073_a, this.field_77073_a);
  42372. }
  42373.  
  42374. protected ResourceLocation func_110775_a(EntityGiantZombie p_110775_1_) {
  42375. return field_110871_a;
  42376. }
  42377. }
  42378.  
  42379. Patching failed: minecraft\net\minecraft\client\renderer\entity\RenderPigZombie.java
  42380. Hunk 1 failed! Cannot find hunk target
  42381. super(p_i46148_1_, new ModelZombie(), 0.5F);
  42382. this.func_177094_a(new LayerBipedArmor(this) {
  42383. protected void func_177177_a() {
  42384. - this.field_177189_c = (T)(new ModelZombie(0.5F, true));
  42385. - this.field_177186_d = (T)(new ModelZombie(1.0F, true));
  42386. + this.field_177189_c = new ModelZombie(0.5F, true);
  42387. + this.field_177186_d = new ModelZombie(1.0F, true);
  42388. }
  42389. });
  42390. }
  42391. File state
  42392. package net.minecraft.client.renderer.entity;
  42393.  
  42394. import net.minecraft.client.model.ModelZombie;
  42395. import net.minecraft.client.renderer.entity.RenderBiped;
  42396. import net.minecraft.client.renderer.entity.RenderManager;
  42397. import net.minecraft.client.renderer.entity.layers.LayerBipedArmor;
  42398. import net.minecraft.entity.monster.EntityPigZombie;
  42399. import net.minecraft.util.ResourceLocation;
  42400. import net.minecraftforge.fml.relauncher.Side;
  42401. import net.minecraftforge.fml.relauncher.SideOnly;
  42402.  
  42403. @SideOnly(Side.CLIENT)
  42404. public class RenderPigZombie extends RenderBiped<EntityPigZombie> {
  42405. private static final ResourceLocation field_177120_j = new ResourceLocation("textures/entity/zombie_pigman.png");
  42406.  
  42407. public RenderPigZombie(RenderManager p_i46148_1_) {
  42408. super(p_i46148_1_, new ModelZombie(), 0.5F);
  42409. this.func_177094_a(new LayerBipedArmor(this) {
  42410. protected void func_177177_a() {
  42411. this.field_177189_c = new ModelZombie(0.5F, true);
  42412. this.field_177186_d = new ModelZombie(1.0F, true);
  42413. }
  42414. });
  42415. }
  42416.  
  42417. protected ResourceLocation func_110775_a(EntityPigZombie p_110775_1_) {
  42418. return field_177120_j;
  42419. }
  42420. }
  42421.  
  42422. Patching failed: minecraft\net\minecraft\client\renderer\entity\RenderSkeleton.java
  42423. Hunk 1 failed! Cannot find hunk target
  42424. this.func_177094_a(new LayerHeldItem(this));
  42425. this.func_177094_a(new LayerBipedArmor(this) {
  42426. protected void func_177177_a() {
  42427. - this.field_177189_c = (T)(new ModelSkeleton(0.5F, true));
  42428. - this.field_177186_d = (T)(new ModelSkeleton(1.0F, true));
  42429. + this.field_177189_c = new ModelSkeleton(0.5F, true);
  42430. + this.field_177186_d = new ModelSkeleton(1.0F, true);
  42431. }
  42432. });
  42433. }
  42434. File state
  42435. package net.minecraft.client.renderer.entity;
  42436.  
  42437. import net.minecraft.client.model.ModelSkeleton;
  42438. import net.minecraft.client.renderer.GlStateManager;
  42439. import net.minecraft.client.renderer.entity.RenderBiped;
  42440. import net.minecraft.client.renderer.entity.RenderManager;
  42441. import net.minecraft.client.renderer.entity.layers.LayerBipedArmor;
  42442. import net.minecraft.client.renderer.entity.layers.LayerHeldItem;
  42443. import net.minecraft.entity.monster.AbstractSkeleton;
  42444. import net.minecraft.util.ResourceLocation;
  42445. import net.minecraftforge.fml.relauncher.Side;
  42446. import net.minecraftforge.fml.relauncher.SideOnly;
  42447.  
  42448. @SideOnly(Side.CLIENT)
  42449. public class RenderSkeleton extends RenderBiped<AbstractSkeleton> {
  42450. private static final ResourceLocation field_110862_k = new ResourceLocation("textures/entity/skeleton/skeleton.png");
  42451.  
  42452. public RenderSkeleton(RenderManager p_i46143_1_) {
  42453. super(p_i46143_1_, new ModelSkeleton(), 0.5F);
  42454. this.func_177094_a(new LayerHeldItem(this));
  42455. this.func_177094_a(new LayerBipedArmor(this) {
  42456. protected void func_177177_a() {
  42457. this.field_177189_c = new ModelSkeleton(0.5F, true);
  42458. this.field_177186_d = new ModelSkeleton(1.0F, true);
  42459. }
  42460. });
  42461. }
  42462.  
  42463. public void func_82422_c() {
  42464. GlStateManager.func_179109_b(0.09375F, 0.1875F, 0.0F);
  42465. }
  42466.  
  42467. protected ResourceLocation func_110775_a(AbstractSkeleton p_110775_1_) {
  42468. return field_110862_k;
  42469. }
  42470. }
  42471.  
  42472. Patching failed: minecraft\net\minecraft\client\renderer\entity\RenderZombie.java
  42473. Hunk 1 failed! Cannot find hunk target
  42474. super(p_i46127_1_, new ModelZombie(), 0.5F);
  42475. LayerBipedArmor layerbipedarmor = new LayerBipedArmor(this) {
  42476. protected void func_177177_a() {
  42477. - this.field_177189_c = (T)(new ModelZombie(0.5F, true));
  42478. - this.field_177186_d = (T)(new ModelZombie(1.0F, true));
  42479. + this.field_177189_c = new ModelZombie(0.5F, true);
  42480. + this.field_177186_d = new ModelZombie(1.0F, true);
  42481. }
  42482. };
  42483. this.func_177094_a(layerbipedarmor);
  42484. File state
  42485. package net.minecraft.client.renderer.entity;
  42486.  
  42487. import net.minecraft.client.model.ModelZombie;
  42488. import net.minecraft.client.renderer.entity.RenderBiped;
  42489. import net.minecraft.client.renderer.entity.RenderManager;
  42490. import net.minecraft.client.renderer.entity.layers.LayerBipedArmor;
  42491. import net.minecraft.entity.monster.EntityZombie;
  42492. import net.minecraft.util.ResourceLocation;
  42493. import net.minecraftforge.fml.relauncher.Side;
  42494. import net.minecraftforge.fml.relauncher.SideOnly;
  42495.  
  42496. @SideOnly(Side.CLIENT)
  42497. public class RenderZombie extends RenderBiped<EntityZombie> {
  42498. private static final ResourceLocation field_110865_p = new ResourceLocation("textures/entity/zombie/zombie.png");
  42499.  
  42500. public RenderZombie(RenderManager p_i46127_1_) {
  42501. super(p_i46127_1_, new ModelZombie(), 0.5F);
  42502. LayerBipedArmor layerbipedarmor = new LayerBipedArmor(this) {
  42503. protected void func_177177_a() {
  42504. this.field_177189_c = new ModelZombie(0.5F, true);
  42505. this.field_177186_d = new ModelZombie(1.0F, true);
  42506. }
  42507. };
  42508. this.func_177094_a(layerbipedarmor);
  42509. }
  42510.  
  42511. protected ResourceLocation func_110775_a(EntityZombie p_110775_1_) {
  42512. return field_110865_p;
  42513. }
  42514. }
  42515.  
  42516. Patching failed: minecraft\net\minecraft\client\renderer\entity\layers\LayerBipedArmor.java
  42517. Hunk 1 failed! Cannot find hunk target
  42518. }
  42519.  
  42520. protected void func_177177_a() {
  42521. - this.field_177189_c = (T)(new ModelBiped(0.5F));
  42522. - this.field_177186_d = (T)(new ModelBiped(1.0F));
  42523. + this.field_177189_c = new ModelBiped(0.5F);
  42524. + this.field_177186_d = new ModelBiped(1.0F);
  42525. }
  42526.  
  42527. + @SuppressWarnings("incomplete-switch")
  42528. protected void func_188359_a(ModelBiped p_188359_1_, EntityEquipmentSlot p_188359_2_) {
  42529. this.func_177194_a(p_188359_1_);
  42530. switch(p_188359_2_) {
  42531. File state
  42532. package net.minecraft.client.renderer.entity.layers;
  42533.  
  42534. import net.minecraft.client.model.ModelBiped;
  42535. import net.minecraft.client.renderer.entity.RenderLivingBase;
  42536. import net.minecraft.client.renderer.entity.layers.LayerArmorBase;
  42537. import net.minecraft.inventory.EntityEquipmentSlot;
  42538. import net.minecraftforge.fml.relauncher.Side;
  42539. import net.minecraftforge.fml.relauncher.SideOnly;
  42540.  
  42541. @SideOnly(Side.CLIENT)
  42542. public class LayerBipedArmor extends LayerArmorBase<ModelBiped> {
  42543. public LayerBipedArmor(RenderLivingBase<?> p_i46116_1_) {
  42544. super(p_i46116_1_);
  42545. }
  42546.  
  42547. protected void func_177177_a() {
  42548. this.field_177189_c = new ModelBiped(0.5F);
  42549. this.field_177186_d = new ModelBiped(1.0F);
  42550. }
  42551.  
  42552. protected void func_188359_a(ModelBiped p_188359_1_, EntityEquipmentSlot p_188359_2_) {
  42553. this.func_177194_a(p_188359_1_);
  42554. switch(p_188359_2_) {
  42555. case HEAD:
  42556. p_188359_1_.field_78116_c.field_78806_j = true;
  42557. p_188359_1_.field_178720_f.field_78806_j = true;
  42558. break;
  42559. case CHEST:
  42560. p_188359_1_.field_78115_e.field_78806_j = true;
  42561. p_188359_1_.field_178723_h.field_78806_j = true;
  42562. p_188359_1_.field_178724_i.field_78806_j = true;
  42563. break;
  42564. case LEGS:
  42565. p_188359_1_.field_78115_e.field_78806_j = true;
  42566. p_188359_1_.field_178721_j.field_78806_j = true;
  42567. p_188359_1_.field_178722_k.field_78806_j = true;
  42568. break;
  42569. case FEET:
  42570. p_188359_1_.field_178721_j.field_78806_j = true;
  42571. p_188359_1_.field_178722_k.field_78806_j = true;
  42572. }
  42573.  
  42574. }
  42575.  
  42576. protected void func_177194_a(ModelBiped p_177194_1_) {
  42577. p_177194_1_.func_178719_a(false);
  42578. }
  42579. }
  42580.  
  42581. FAILED
  42582.  
  42583. FAILURE: Build failed with an exception.
  42584.  
  42585. * What went wrong:
  42586. Execution failed for task ':fixMcSources'.
  42587. > com.cloudbees.diff.PatchException: Cannot find hunk target
  42588.  
  42589. * Try:
  42590. Run with --info or --debug option to get more log output.
  42591.  
  42592. * Exception is:
  42593. org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':fixMcSources'.
  42594. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
  42595. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
  42596. at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
  42597. at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:66)
  42598. at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
  42599. at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
  42600. at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
  42601. at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
  42602. at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
  42603. at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
  42604. at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
  42605. at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
  42606. at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
  42607. at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)
  42608. at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110)
  42609. at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
  42610. at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
  42611. at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
  42612. at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
  42613. at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
  42614. at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
  42615. at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
  42616. at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:153)
  42617. at org.gradle.internal.Factories$1.create(Factories.java:22)
  42618. at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
  42619. at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:53)
  42620. at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:150)
  42621. at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
  42622. at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:98)
  42623. at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:92)
  42624. at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
  42625. at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:63)
  42626. at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:92)
  42627. at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:83)
  42628. at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:99)
  42629. at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
  42630. at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
  42631. at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:48)
  42632. at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
  42633. at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:81)
  42634. at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:46)
  42635. at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:51)
  42636. at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:28)
  42637. at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43)
  42638. at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:173)
  42639. at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:239)
  42640. at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:212)
  42641. at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
  42642. at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
  42643. at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
  42644. at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
  42645. at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:205)
  42646. at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
  42647. at org.gradle.launcher.Main.doAction(Main.java:33)
  42648. at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
  42649. at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:55)
  42650. at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:36)
  42651. at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
  42652. at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30)
  42653. at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:127)
  42654. at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
  42655. Caused by: java.lang.RuntimeException: com.cloudbees.diff.PatchException: Cannot find hunk target
  42656. at com.google.common.base.Throwables.propagate(Throwables.java:160)
  42657. at net.minecraftforge.gradle.tasks.PostDecompileTask.doStuffAfter(PostDecompileTask.java:254)
  42658. at net.minecraftforge.gradle.tasks.AbstractEditJarTask.doTask(AbstractEditJarTask.java:86)
  42659. at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
  42660. at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:228)
  42661. at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:221)
  42662. at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:210)
  42663. at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:621)
  42664. at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:604)
  42665. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
  42666. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
  42667. ... 60 more
  42668. Caused by: com.cloudbees.diff.PatchException: Cannot find hunk target
  42669. at net.minecraftforge.gradle.util.patching.ContextualPatch.applyHunk(ContextualPatch.java:434)
  42670. at net.minecraftforge.gradle.util.patching.ContextualPatch.applyPatch(ContextualPatch.java:255)
  42671. at net.minecraftforge.gradle.util.patching.ContextualPatch.patch(ContextualPatch.java:161)
  42672. at net.minecraftforge.gradle.tasks.PostDecompileTask.asRead(PostDecompileTask.java:136)
  42673. at net.minecraftforge.gradle.tasks.AbstractEditJarTask.copyJar(AbstractEditJarTask.java:235)
  42674. at net.minecraftforge.gradle.tasks.AbstractEditJarTask.doTask(AbstractEditJarTask.java:83)
  42675. ... 68 more
  42676.  
  42677.  
  42678. BUILD FAILED
  42679.  
  42680. Total time: 55.104 secs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement