Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #################################################
- ForgeGradle 2.2-SNAPSHOT-eb2e450
- https://github.com/MinecraftForge/ForgeGradle
- #################################################
- Powered by MCP unknown
- http://modcoderpack.com
- by: Searge, ProfMobius, Fesh0r,
- R4wk, ZeuX, IngisKahn, bspkrs
- #################################################
- :deobfCompileDummyTask
- :deobfProvidedDummyTask
- :getVersionJson
- :extractUserdev UP-TO-DATE
- :extractDependencyATs SKIPPED
- :extractMcpData SKIPPED
- :extractMcpMappings
- :genSrgs SKIPPED
- :downloadClient SKIPPED
- :downloadServer SKIPPED
- :splitServerJar SKIPPED
- :mergeJars SKIPPED
- :deobfMcSRG SKIPPED
- :decompileMc SKIPPED
- :fixMcSourcesPatching failed: minecraft\net\minecraft\client\renderer\entity\layers\LayerVillagerArmor.java
- Hunk 1 failed! Cannot find hunk target
- }
- protected void func_177177_a() {
- - this.field_177189_c = (T)(new ModelZombieVillager(0.5F, 0.0F, true));
- - this.field_177186_d = (T)(new ModelZombieVillager(1.0F, 0.0F, true));
- + this.field_177189_c = new ModelZombieVillager(0.5F, 0.0F, true);
- + this.field_177186_d = new ModelZombieVillager(1.0F, 0.0F, true);
- }
- }
- File state
- package net.minecraft.client.renderer.entity.layers;
- import net.minecraft.client.model.ModelZombieVillager;
- import net.minecraft.client.renderer.entity.RenderLivingBase;
- import net.minecraft.client.renderer.entity.layers.LayerBipedArmor;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- @SideOnly(Side.CLIENT)
- public class LayerVillagerArmor extends LayerBipedArmor {
- public LayerVillagerArmor(RenderLivingBase<?> p_i46108_1_) {
- super(p_i46108_1_);
- }
- protected void func_177177_a() {
- this.field_177189_c = new ModelZombieVillager(0.5F, 0.0F, true);
- this.field_177186_d = new ModelZombieVillager(1.0F, 0.0F, true);
- }
- }
- Patching failed: minecraft\net\minecraft\client\renderer\texture\TextureMap.java
- Hunk 1 failed! Cannot find hunk target
- this.field_94249_f.func_110969_c(16);
- int[][] aint1 = new int[this.field_147636_j + 1][];
- aint1[0] = aint;
- - this.field_94249_f.func_110968_a(Lists.newArrayList(aint1));
- + this.field_94249_f.func_110968_a(Lists.<int[][]>newArrayList(aint1));
- }
- public void func_110551_a(IResourceManager p_110551_1_) throws IOException {
- File state
- package net.minecraft.client.renderer.texture;
- import com.google.common.collect.Lists;
- import com.google.common.collect.Maps;
- import java.io.Closeable;
- import java.io.IOException;
- import java.util.List;
- import java.util.Map;
- import java.util.Map.Entry;
- import javax.annotation.Nullable;
- import net.minecraft.client.Minecraft;
- import net.minecraft.client.renderer.StitcherException;
- import net.minecraft.client.renderer.texture.AbstractTexture;
- import net.minecraft.client.renderer.texture.ITextureMapPopulator;
- import net.minecraft.client.renderer.texture.ITickableTextureObject;
- import net.minecraft.client.renderer.texture.PngSizeInfo;
- import net.minecraft.client.renderer.texture.Stitcher;
- import net.minecraft.client.renderer.texture.TextureAtlasSprite;
- import net.minecraft.client.renderer.texture.TextureUtil;
- import net.minecraft.client.resources.IResource;
- import net.minecraft.client.resources.IResourceManager;
- import net.minecraft.crash.CrashReport;
- import net.minecraft.crash.CrashReportCategory;
- import net.minecraft.crash.ICrashReportDetail;
- import net.minecraft.util.ReportedException;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.util.math.MathHelper;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- import org.apache.commons.io.IOUtils;
- import org.apache.logging.log4j.LogManager;
- import org.apache.logging.log4j.Logger;
- @SideOnly(Side.CLIENT)
- public class TextureMap extends AbstractTexture implements ITickableTextureObject {
- private static final Logger field_147635_d = LogManager.getLogger();
- public static final ResourceLocation field_174945_f = new ResourceLocation("missingno");
- public static final ResourceLocation field_110575_b = new ResourceLocation("textures/atlas/blocks.png");
- private final List<TextureAtlasSprite> field_94258_i;
- private final Map<String, TextureAtlasSprite> field_110574_e;
- private final Map<String, TextureAtlasSprite> field_94252_e;
- private final String field_94254_c;
- private final ITextureMapPopulator field_174946_m;
- private int field_147636_j;
- private final TextureAtlasSprite field_94249_f;
- public TextureMap(String p_i46099_1_) {
- this(p_i46099_1_, (ITextureMapPopulator)null);
- }
- public TextureMap(String p_i46100_1_, @Nullable ITextureMapPopulator p_i46100_2_) {
- this.field_94258_i = Lists.<TextureAtlasSprite>newArrayList();
- this.field_110574_e = Maps.<String, TextureAtlasSprite>newHashMap();
- this.field_94252_e = Maps.<String, TextureAtlasSprite>newHashMap();
- this.field_94249_f = new TextureAtlasSprite("missingno");
- this.field_94254_c = p_i46100_1_;
- this.field_174946_m = p_i46100_2_;
- }
- private void func_110569_e() {
- int[] aint = TextureUtil.field_110999_b;
- this.field_94249_f.func_110966_b(16);
- this.field_94249_f.func_110969_c(16);
- int[][] aint1 = new int[this.field_147636_j + 1][];
- aint1[0] = aint;
- this.field_94249_f.func_110968_a(Lists.newArrayList(new int[][][]{aint1}));
- }
- public void func_110551_a(IResourceManager p_110551_1_) throws IOException {
- if(this.field_174946_m != null) {
- this.func_174943_a(p_110551_1_, this.field_174946_m);
- }
- }
- public void func_174943_a(IResourceManager p_174943_1_, ITextureMapPopulator p_174943_2_) {
- this.field_110574_e.clear();
- p_174943_2_.func_177059_a(this);
- this.func_110569_e();
- this.func_147631_c();
- this.func_110571_b(p_174943_1_);
- }
- public void func_110571_b(IResourceManager p_110571_1_) {
- int i = Minecraft.func_71369_N();
- Stitcher stitcher = new Stitcher(i, i, 0, this.field_147636_j);
- this.field_94252_e.clear();
- this.field_94258_i.clear();
- int j = Integer.MAX_VALUE;
- int k = 1 << this.field_147636_j;
- for(Entry<String, TextureAtlasSprite> entry : this.field_110574_e.entrySet()) {
- TextureAtlasSprite textureatlassprite = (TextureAtlasSprite)entry.getValue();
- ResourceLocation resourcelocation = this.func_184396_a(textureatlassprite);
- IResource iresource = null;
- try {
- PngSizeInfo pngsizeinfo = PngSizeInfo.func_188532_a(p_110571_1_.func_110536_a(resourcelocation));
- iresource = p_110571_1_.func_110536_a(resourcelocation);
- boolean flag = iresource.func_110526_a("animation") != null;
- textureatlassprite.func_188538_a(pngsizeinfo, flag);
- } catch (RuntimeException runtimeexception) {
- field_147635_d.error((String)"Unable to parse metadata from {}", (Object)resourcelocation, (Object)runtimeexception);
- continue;
- } catch (IOException ioexception) {
- field_147635_d.error((String)"Using missing texture, unable to load {}", (Object)resourcelocation, (Object)ioexception);
- continue;
- } finally {
- IOUtils.closeQuietly((Closeable)iresource);
- }
- j = Math.min(j, Math.min(textureatlassprite.func_94211_a(), textureatlassprite.func_94216_b()));
- int lvt_11_2_ = Math.min(Integer.lowestOneBit(textureatlassprite.func_94211_a()), Integer.lowestOneBit(textureatlassprite.func_94216_b()));
- if(lvt_11_4_ < k) {
- 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_)));
- k = lvt_11_2_;
- }
- stitcher.func_110934_a(textureatlassprite);
- }
- int l = Math.min(j, k);
- int i1 = MathHelper.func_151239_c(l);
- if(i1 < this.field_147636_j) {
- 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));
- this.field_147636_j = i1;
- }
- this.field_94249_f.func_147963_d(this.field_147636_j);
- stitcher.func_110934_a(this.field_94249_f);
- try {
- stitcher.func_94305_f();
- } catch (StitcherException stitcherexception) {
- throw stitcherexception;
- }
- 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);
- TextureUtil.func_180600_a(this.func_110552_b(), this.field_147636_j, stitcher.func_110935_a(), stitcher.func_110936_b());
- Map<String, TextureAtlasSprite> map = Maps.<String, TextureAtlasSprite>newHashMap(this.field_110574_e);
- for(TextureAtlasSprite textureatlassprite1 : stitcher.func_94309_g()) {
- if(textureatlassprite1 == this.field_94249_f || this.func_184397_a(p_110571_1_, textureatlassprite1)) {
- String s = textureatlassprite1.func_94215_i();
- map.remove(s);
- this.field_94252_e.put(s, textureatlassprite1);
- try {
- 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);
- } catch (Throwable throwable) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable, "Stitching texture atlas");
- CrashReportCategory crashreportcategory = crashreport.func_85058_a("Texture being stitched together");
- crashreportcategory.func_71507_a("Atlas path", this.field_94254_c);
- crashreportcategory.func_71507_a("Sprite", textureatlassprite1);
- throw new ReportedException(crashreport);
- }
- if(textureatlassprite1.func_130098_m()) {
- this.field_94258_i.add(textureatlassprite1);
- }
- }
- }
- for(TextureAtlasSprite textureatlassprite2 : map.values()) {
- textureatlassprite2.func_94217_a(this.field_94249_f);
- }
- }
- private boolean func_184397_a(IResourceManager p_184397_1_, final TextureAtlasSprite p_184397_2_) {
- ResourceLocation resourcelocation = this.func_184396_a(p_184397_2_);
- IResource iresource = null;
- label9: {
- boolean flag;
- try {
- iresource = p_184397_1_.func_110536_a(resourcelocation);
- p_184397_2_.func_188539_a(iresource, this.field_147636_j + 1);
- break label9;
- } catch (RuntimeException runtimeexception) {
- field_147635_d.error((String)"Unable to parse metadata from {}", (Object)resourcelocation, (Object)runtimeexception);
- flag = false;
- } catch (IOException ioexception) {
- field_147635_d.error((String)"Using missing texture, unable to load {}", (Object)resourcelocation, (Object)ioexception);
- flag = false;
- return flag;
- } finally {
- IOUtils.closeQuietly((Closeable)iresource);
- }
- return flag;
- }
- try {
- p_184397_2_.func_147963_d(this.field_147636_j);
- return true;
- } catch (Throwable throwable) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable, "Applying mipmap");
- CrashReportCategory crashreportcategory = crashreport.func_85058_a("Sprite being mipmapped");
- crashreportcategory.func_189529_a("Sprite name", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return p_184397_2_.func_94215_i();
- }
- });
- crashreportcategory.func_189529_a("Sprite size", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return p_184397_2_.func_94211_a() + " x " + p_184397_2_.func_94216_b();
- }
- });
- crashreportcategory.func_189529_a("Sprite frames", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return p_184397_2_.func_110970_k() + " frames";
- }
- });
- crashreportcategory.func_71507_a("Mipmap levels", Integer.valueOf(this.field_147636_j));
- throw new ReportedException(crashreport);
- }
- }
- private ResourceLocation func_184396_a(TextureAtlasSprite p_184396_1_) {
- ResourceLocation resourcelocation = new ResourceLocation(p_184396_1_.func_94215_i());
- return new ResourceLocation(resourcelocation.func_110624_b(), String.format("%s/%s%s", new Object[]{this.field_94254_c, resourcelocation.func_110623_a(), ".png"}));
- }
- public TextureAtlasSprite func_110572_b(String p_110572_1_) {
- TextureAtlasSprite textureatlassprite = (TextureAtlasSprite)this.field_94252_e.get(p_110572_1_);
- if(textureatlassprite == null) {
- textureatlassprite = this.field_94249_f;
- }
- return textureatlassprite;
- }
- public void func_94248_c() {
- TextureUtil.func_94277_a(this.func_110552_b());
- for(TextureAtlasSprite textureatlassprite : this.field_94258_i) {
- textureatlassprite.func_94219_l();
- }
- }
- public TextureAtlasSprite func_174942_a(ResourceLocation p_174942_1_) {
- if(p_174942_1_ == null) {
- throw new IllegalArgumentException("Location cannot be null!");
- } else {
- TextureAtlasSprite textureatlassprite = (TextureAtlasSprite)this.field_110574_e.get(p_174942_1_);
- if(textureatlassprite == null) {
- textureatlassprite = TextureAtlasSprite.func_176604_a(p_174942_1_);
- this.field_110574_e.put(p_174942_1_.toString(), textureatlassprite);
- }
- return textureatlassprite;
- }
- }
- public void func_110550_d() {
- this.func_94248_c();
- }
- public void func_147633_a(int p_147633_1_) {
- this.field_147636_j = p_147633_1_;
- }
- public TextureAtlasSprite func_174944_f() {
- return this.field_94249_f;
- }
- }
- Hunk 2 failed! Cannot find hunk target
- j = Math.min(j, Math.min(textureatlassprite.func_94211_a(), textureatlassprite.func_94216_b()));
- int j1 = Math.min(Integer.lowestOneBit(textureatlassprite.func_94211_a()), Integer.lowestOneBit(textureatlassprite.func_94216_b()));
- - if (lvt_11_4_ < k) {
- + if (j1 < k) {
- 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)));
- k = j1;
- }
- File state
- package net.minecraft.client.renderer.texture;
- import com.google.common.collect.Lists;
- import com.google.common.collect.Maps;
- import java.io.Closeable;
- import java.io.IOException;
- import java.util.List;
- import java.util.Map;
- import java.util.Map.Entry;
- import javax.annotation.Nullable;
- import net.minecraft.client.Minecraft;
- import net.minecraft.client.renderer.StitcherException;
- import net.minecraft.client.renderer.texture.AbstractTexture;
- import net.minecraft.client.renderer.texture.ITextureMapPopulator;
- import net.minecraft.client.renderer.texture.ITickableTextureObject;
- import net.minecraft.client.renderer.texture.PngSizeInfo;
- import net.minecraft.client.renderer.texture.Stitcher;
- import net.minecraft.client.renderer.texture.TextureAtlasSprite;
- import net.minecraft.client.renderer.texture.TextureUtil;
- import net.minecraft.client.resources.IResource;
- import net.minecraft.client.resources.IResourceManager;
- import net.minecraft.crash.CrashReport;
- import net.minecraft.crash.CrashReportCategory;
- import net.minecraft.crash.ICrashReportDetail;
- import net.minecraft.util.ReportedException;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.util.math.MathHelper;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- import org.apache.commons.io.IOUtils;
- import org.apache.logging.log4j.LogManager;
- import org.apache.logging.log4j.Logger;
- @SideOnly(Side.CLIENT)
- public class TextureMap extends AbstractTexture implements ITickableTextureObject {
- private static final Logger field_147635_d = LogManager.getLogger();
- public static final ResourceLocation field_174945_f = new ResourceLocation("missingno");
- public static final ResourceLocation field_110575_b = new ResourceLocation("textures/atlas/blocks.png");
- private final List<TextureAtlasSprite> field_94258_i;
- private final Map<String, TextureAtlasSprite> field_110574_e;
- private final Map<String, TextureAtlasSprite> field_94252_e;
- private final String field_94254_c;
- private final ITextureMapPopulator field_174946_m;
- private int field_147636_j;
- private final TextureAtlasSprite field_94249_f;
- public TextureMap(String p_i46099_1_) {
- this(p_i46099_1_, (ITextureMapPopulator)null);
- }
- public TextureMap(String p_i46100_1_, @Nullable ITextureMapPopulator p_i46100_2_) {
- this.field_94258_i = Lists.<TextureAtlasSprite>newArrayList();
- this.field_110574_e = Maps.<String, TextureAtlasSprite>newHashMap();
- this.field_94252_e = Maps.<String, TextureAtlasSprite>newHashMap();
- this.field_94249_f = new TextureAtlasSprite("missingno");
- this.field_94254_c = p_i46100_1_;
- this.field_174946_m = p_i46100_2_;
- }
- private void func_110569_e() {
- int[] aint = TextureUtil.field_110999_b;
- this.field_94249_f.func_110966_b(16);
- this.field_94249_f.func_110969_c(16);
- int[][] aint1 = new int[this.field_147636_j + 1][];
- aint1[0] = aint;
- this.field_94249_f.func_110968_a(Lists.newArrayList(new int[][][]{aint1}));
- }
- public void func_110551_a(IResourceManager p_110551_1_) throws IOException {
- if(this.field_174946_m != null) {
- this.func_174943_a(p_110551_1_, this.field_174946_m);
- }
- }
- public void func_174943_a(IResourceManager p_174943_1_, ITextureMapPopulator p_174943_2_) {
- this.field_110574_e.clear();
- p_174943_2_.func_177059_a(this);
- this.func_110569_e();
- this.func_147631_c();
- this.func_110571_b(p_174943_1_);
- }
- public void func_110571_b(IResourceManager p_110571_1_) {
- int i = Minecraft.func_71369_N();
- Stitcher stitcher = new Stitcher(i, i, 0, this.field_147636_j);
- this.field_94252_e.clear();
- this.field_94258_i.clear();
- int j = Integer.MAX_VALUE;
- int k = 1 << this.field_147636_j;
- for(Entry<String, TextureAtlasSprite> entry : this.field_110574_e.entrySet()) {
- TextureAtlasSprite textureatlassprite = (TextureAtlasSprite)entry.getValue();
- ResourceLocation resourcelocation = this.func_184396_a(textureatlassprite);
- IResource iresource = null;
- try {
- PngSizeInfo pngsizeinfo = PngSizeInfo.func_188532_a(p_110571_1_.func_110536_a(resourcelocation));
- iresource = p_110571_1_.func_110536_a(resourcelocation);
- boolean flag = iresource.func_110526_a("animation") != null;
- textureatlassprite.func_188538_a(pngsizeinfo, flag);
- } catch (RuntimeException runtimeexception) {
- field_147635_d.error((String)"Unable to parse metadata from {}", (Object)resourcelocation, (Object)runtimeexception);
- continue;
- } catch (IOException ioexception) {
- field_147635_d.error((String)"Using missing texture, unable to load {}", (Object)resourcelocation, (Object)ioexception);
- continue;
- } finally {
- IOUtils.closeQuietly((Closeable)iresource);
- }
- j = Math.min(j, Math.min(textureatlassprite.func_94211_a(), textureatlassprite.func_94216_b()));
- int lvt_11_2_ = Math.min(Integer.lowestOneBit(textureatlassprite.func_94211_a()), Integer.lowestOneBit(textureatlassprite.func_94216_b()));
- if(lvt_11_4_ < k) {
- 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_)));
- k = lvt_11_2_;
- }
- stitcher.func_110934_a(textureatlassprite);
- }
- int l = Math.min(j, k);
- int i1 = MathHelper.func_151239_c(l);
- if(i1 < this.field_147636_j) {
- 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));
- this.field_147636_j = i1;
- }
- this.field_94249_f.func_147963_d(this.field_147636_j);
- stitcher.func_110934_a(this.field_94249_f);
- try {
- stitcher.func_94305_f();
- } catch (StitcherException stitcherexception) {
- throw stitcherexception;
- }
- 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);
- TextureUtil.func_180600_a(this.func_110552_b(), this.field_147636_j, stitcher.func_110935_a(), stitcher.func_110936_b());
- Map<String, TextureAtlasSprite> map = Maps.<String, TextureAtlasSprite>newHashMap(this.field_110574_e);
- for(TextureAtlasSprite textureatlassprite1 : stitcher.func_94309_g()) {
- if(textureatlassprite1 == this.field_94249_f || this.func_184397_a(p_110571_1_, textureatlassprite1)) {
- String s = textureatlassprite1.func_94215_i();
- map.remove(s);
- this.field_94252_e.put(s, textureatlassprite1);
- try {
- 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);
- } catch (Throwable throwable) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable, "Stitching texture atlas");
- CrashReportCategory crashreportcategory = crashreport.func_85058_a("Texture being stitched together");
- crashreportcategory.func_71507_a("Atlas path", this.field_94254_c);
- crashreportcategory.func_71507_a("Sprite", textureatlassprite1);
- throw new ReportedException(crashreport);
- }
- if(textureatlassprite1.func_130098_m()) {
- this.field_94258_i.add(textureatlassprite1);
- }
- }
- }
- for(TextureAtlasSprite textureatlassprite2 : map.values()) {
- textureatlassprite2.func_94217_a(this.field_94249_f);
- }
- }
- private boolean func_184397_a(IResourceManager p_184397_1_, final TextureAtlasSprite p_184397_2_) {
- ResourceLocation resourcelocation = this.func_184396_a(p_184397_2_);
- IResource iresource = null;
- label9: {
- boolean flag;
- try {
- iresource = p_184397_1_.func_110536_a(resourcelocation);
- p_184397_2_.func_188539_a(iresource, this.field_147636_j + 1);
- break label9;
- } catch (RuntimeException runtimeexception) {
- field_147635_d.error((String)"Unable to parse metadata from {}", (Object)resourcelocation, (Object)runtimeexception);
- flag = false;
- } catch (IOException ioexception) {
- field_147635_d.error((String)"Using missing texture, unable to load {}", (Object)resourcelocation, (Object)ioexception);
- flag = false;
- return flag;
- } finally {
- IOUtils.closeQuietly((Closeable)iresource);
- }
- return flag;
- }
- try {
- p_184397_2_.func_147963_d(this.field_147636_j);
- return true;
- } catch (Throwable throwable) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable, "Applying mipmap");
- CrashReportCategory crashreportcategory = crashreport.func_85058_a("Sprite being mipmapped");
- crashreportcategory.func_189529_a("Sprite name", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return p_184397_2_.func_94215_i();
- }
- });
- crashreportcategory.func_189529_a("Sprite size", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return p_184397_2_.func_94211_a() + " x " + p_184397_2_.func_94216_b();
- }
- });
- crashreportcategory.func_189529_a("Sprite frames", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return p_184397_2_.func_110970_k() + " frames";
- }
- });
- crashreportcategory.func_71507_a("Mipmap levels", Integer.valueOf(this.field_147636_j));
- throw new ReportedException(crashreport);
- }
- }
- private ResourceLocation func_184396_a(TextureAtlasSprite p_184396_1_) {
- ResourceLocation resourcelocation = new ResourceLocation(p_184396_1_.func_94215_i());
- return new ResourceLocation(resourcelocation.func_110624_b(), String.format("%s/%s%s", new Object[]{this.field_94254_c, resourcelocation.func_110623_a(), ".png"}));
- }
- public TextureAtlasSprite func_110572_b(String p_110572_1_) {
- TextureAtlasSprite textureatlassprite = (TextureAtlasSprite)this.field_94252_e.get(p_110572_1_);
- if(textureatlassprite == null) {
- textureatlassprite = this.field_94249_f;
- }
- return textureatlassprite;
- }
- public void func_94248_c() {
- TextureUtil.func_94277_a(this.func_110552_b());
- for(TextureAtlasSprite textureatlassprite : this.field_94258_i) {
- textureatlassprite.func_94219_l();
- }
- }
- public TextureAtlasSprite func_174942_a(ResourceLocation p_174942_1_) {
- if(p_174942_1_ == null) {
- throw new IllegalArgumentException("Location cannot be null!");
- } else {
- TextureAtlasSprite textureatlassprite = (TextureAtlasSprite)this.field_110574_e.get(p_174942_1_);
- if(textureatlassprite == null) {
- textureatlassprite = TextureAtlasSprite.func_176604_a(p_174942_1_);
- this.field_110574_e.put(p_174942_1_.toString(), textureatlassprite);
- }
- return textureatlassprite;
- }
- }
- public void func_110550_d() {
- this.func_94248_c();
- }
- public void func_147633_a(int p_147633_1_) {
- this.field_147636_j = p_147633_1_;
- }
- public TextureAtlasSprite func_174944_f() {
- return this.field_94249_f;
- }
- }
- Patching failed: minecraft\net\minecraft\client\renderer\texture\TextureManager.java
- Hunk 2 failed! Cannot find hunk target
- this.field_110585_a.put(p_110579_1_, p_110579_2_);
- flag = false;
- } catch (Throwable throwable) {
- + final ITextureObject p_110579_2_f = p_110579_2_;
- CrashReport crashreport = CrashReport.func_85055_a(throwable, "Registering texture");
- CrashReportCategory crashreportcategory = crashreport.func_85058_a("Resource location being registered");
- crashreportcategory.func_71507_a("Resource location", p_110579_1_);
- crashreportcategory.func_189529_a("Texture object class", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- - return p_110579_2_.getClass().getName();
- + return p_110579_2_f.getClass().getName();
- }
- });
- throw new ReportedException(crashreport);
- File state
- package net.minecraft.client.renderer.texture;
- import com.google.common.collect.Lists;
- import com.google.common.collect.Maps;
- import java.io.IOException;
- import java.util.Iterator;
- import java.util.List;
- import java.util.Map;
- import java.util.Map.Entry;
- import net.minecraft.client.renderer.texture.DynamicTexture;
- import net.minecraft.client.renderer.texture.ITextureObject;
- import net.minecraft.client.renderer.texture.ITickable;
- import net.minecraft.client.renderer.texture.ITickableTextureObject;
- import net.minecraft.client.renderer.texture.SimpleTexture;
- import net.minecraft.client.renderer.texture.TextureUtil;
- import net.minecraft.client.resources.IResourceManager;
- import net.minecraft.client.resources.IResourceManagerReloadListener;
- import net.minecraft.crash.CrashReport;
- import net.minecraft.crash.CrashReportCategory;
- import net.minecraft.crash.ICrashReportDetail;
- import net.minecraft.util.ReportedException;
- import net.minecraft.util.ResourceLocation;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- import org.apache.logging.log4j.LogManager;
- import org.apache.logging.log4j.Logger;
- @SideOnly(Side.CLIENT)
- public class TextureManager implements ITickable, IResourceManagerReloadListener {
- private static final Logger field_147646_a = LogManager.getLogger();
- public static final ResourceLocation field_194008_a = new ResourceLocation("");
- private final Map<ResourceLocation, ITextureObject> field_110585_a = Maps.<ResourceLocation, ITextureObject>newHashMap();
- private final List<ITickable> field_110583_b = Lists.<ITickable>newArrayList();
- private final Map<String, Integer> field_110584_c = Maps.<String, Integer>newHashMap();
- private final IResourceManager field_110582_d;
- public TextureManager(IResourceManager p_i1284_1_) {
- this.field_110582_d = p_i1284_1_;
- }
- public void func_110577_a(ResourceLocation p_110577_1_) {
- ITextureObject itextureobject = (ITextureObject)this.field_110585_a.get(p_110577_1_);
- if(itextureobject == null) {
- itextureobject = new SimpleTexture(p_110577_1_);
- this.func_110579_a(p_110577_1_, itextureobject);
- }
- TextureUtil.func_94277_a(itextureobject.func_110552_b());
- }
- public boolean func_110580_a(ResourceLocation p_110580_1_, ITickableTextureObject p_110580_2_) {
- if(this.func_110579_a(p_110580_1_, p_110580_2_)) {
- this.field_110583_b.add(p_110580_2_);
- return true;
- } else {
- return false;
- }
- }
- public boolean func_110579_a(ResourceLocation p_110579_1_, final ITextureObject p_110579_2_) {
- boolean flag = true;
- try {
- ((ITextureObject)p_110579_2_).func_110551_a(this.field_110582_d);
- } catch (IOException ioexception) {
- if(p_110579_1_ != field_194008_a) {
- field_147646_a.warn((String)"Failed to load texture: {}", (Object)p_110579_1_, (Object)ioexception);
- }
- p_110579_2_ = TextureUtil.field_111001_a;
- this.field_110585_a.put(p_110579_1_, (ITextureObject)p_110579_2_);
- flag = false;
- } catch (Throwable throwable) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable, "Registering texture");
- CrashReportCategory crashreportcategory = crashreport.func_85058_a("Resource location being registered");
- crashreportcategory.func_71507_a("Resource location", p_110579_1_);
- crashreportcategory.func_189529_a("Texture object class", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return p_110579_2_.getClass().getName();
- }
- });
- throw new ReportedException(crashreport);
- }
- this.field_110585_a.put(p_110579_1_, (ITextureObject)p_110579_2_);
- return flag;
- }
- public ITextureObject func_110581_b(ResourceLocation p_110581_1_) {
- return (ITextureObject)this.field_110585_a.get(p_110581_1_);
- }
- public ResourceLocation func_110578_a(String p_110578_1_, DynamicTexture p_110578_2_) {
- Integer integer = (Integer)this.field_110584_c.get(p_110578_1_);
- if(integer == null) {
- integer = Integer.valueOf(1);
- } else {
- integer = Integer.valueOf(integer.intValue() + 1);
- }
- this.field_110584_c.put(p_110578_1_, integer);
- ResourceLocation resourcelocation = new ResourceLocation(String.format("dynamic/%s_%d", new Object[]{p_110578_1_, integer}));
- this.func_110579_a(resourcelocation, p_110578_2_);
- return resourcelocation;
- }
- public void func_110550_d() {
- for(ITickable itickable : this.field_110583_b) {
- itickable.func_110550_d();
- }
- }
- public void func_147645_c(ResourceLocation p_147645_1_) {
- ITextureObject itextureobject = this.func_110581_b(p_147645_1_);
- if(itextureobject != null) {
- TextureUtil.func_147942_a(itextureobject.func_110552_b());
- }
- }
- public void func_110549_a(IResourceManager p_110549_1_) {
- Iterator<Entry<ResourceLocation, ITextureObject>> iterator = this.field_110585_a.entrySet().iterator();
- while(iterator.hasNext()) {
- Entry<ResourceLocation, ITextureObject> entry = (Entry)iterator.next();
- ITextureObject itextureobject = (ITextureObject)entry.getValue();
- if(itextureobject == TextureUtil.field_111001_a) {
- iterator.remove();
- } else {
- this.func_110579_a((ResourceLocation)entry.getKey(), itextureobject);
- }
- }
- }
- }
- Patching failed: minecraft\net\minecraft\client\renderer\texture\TextureAtlasSprite.java
- Hunk 1 failed! Cannot find hunk target
- private void func_130099_d(int p_130099_1_) {
- if (this.field_110976_a.size() <= p_130099_1_) {
- for(int i = this.field_110976_a.size(); i <= p_130099_1_; ++i) {
- - this.field_110976_a.add((Object)null);
- + this.field_110976_a.add(null);
- }
- }
- File state
- package net.minecraft.client.renderer.texture;
- import com.google.common.collect.Lists;
- import java.awt.image.BufferedImage;
- import java.io.IOException;
- import java.util.Iterator;
- import java.util.List;
- import net.minecraft.client.renderer.texture.PngSizeInfo;
- import net.minecraft.client.renderer.texture.TextureUtil;
- import net.minecraft.client.resources.IResource;
- import net.minecraft.client.resources.data.AnimationFrame;
- import net.minecraft.client.resources.data.AnimationMetadataSection;
- import net.minecraft.crash.CrashReport;
- import net.minecraft.crash.CrashReportCategory;
- import net.minecraft.crash.ICrashReportDetail;
- import net.minecraft.util.ReportedException;
- import net.minecraft.util.ResourceLocation;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- @SideOnly(Side.CLIENT)
- public class TextureAtlasSprite {
- private final String field_110984_i;
- protected List<int[][]> field_110976_a = Lists.<int[][]>newArrayList();
- protected int[][] field_176605_b;
- private AnimationMetadataSection field_110982_k;
- protected boolean field_130222_e;
- protected int field_110975_c;
- protected int field_110974_d;
- protected int field_130223_c;
- protected int field_130224_d;
- private float field_110979_l;
- private float field_110980_m;
- private float field_110977_n;
- private float field_110978_o;
- protected int field_110973_g;
- protected int field_110983_h;
- protected TextureAtlasSprite(String p_i1282_1_) {
- this.field_110984_i = p_i1282_1_;
- }
- protected static TextureAtlasSprite func_176604_a(ResourceLocation p_176604_0_) {
- return new TextureAtlasSprite(p_176604_0_.toString());
- }
- 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_) {
- this.field_110975_c = p_110971_3_;
- this.field_110974_d = p_110971_4_;
- this.field_130222_e = p_110971_5_;
- float f = (float)(0.009999999776482582D / (double)p_110971_1_);
- float f1 = (float)(0.009999999776482582D / (double)p_110971_2_);
- this.field_110979_l = (float)p_110971_3_ / (float)((double)p_110971_1_) + f;
- this.field_110980_m = (float)(p_110971_3_ + this.field_130223_c) / (float)((double)p_110971_1_) - f;
- this.field_110977_n = (float)p_110971_4_ / (float)p_110971_2_ + f1;
- this.field_110978_o = (float)(p_110971_4_ + this.field_130224_d) / (float)p_110971_2_ - f1;
- }
- public void func_94217_a(TextureAtlasSprite p_94217_1_) {
- this.field_110975_c = p_94217_1_.field_110975_c;
- this.field_110974_d = p_94217_1_.field_110974_d;
- this.field_130223_c = p_94217_1_.field_130223_c;
- this.field_130224_d = p_94217_1_.field_130224_d;
- this.field_130222_e = p_94217_1_.field_130222_e;
- this.field_110979_l = p_94217_1_.field_110979_l;
- this.field_110980_m = p_94217_1_.field_110980_m;
- this.field_110977_n = p_94217_1_.field_110977_n;
- this.field_110978_o = p_94217_1_.field_110978_o;
- }
- public int func_130010_a() {
- return this.field_110975_c;
- }
- public int func_110967_i() {
- return this.field_110974_d;
- }
- public int func_94211_a() {
- return this.field_130223_c;
- }
- public int func_94216_b() {
- return this.field_130224_d;
- }
- public float func_94209_e() {
- return this.field_110979_l;
- }
- public float func_94212_f() {
- return this.field_110980_m;
- }
- public float func_94214_a(double p_94214_1_) {
- float f = this.field_110980_m - this.field_110979_l;
- return this.field_110979_l + f * (float)p_94214_1_ / 16.0F;
- }
- public float func_188537_a(float p_188537_1_) {
- float f = this.field_110980_m - this.field_110979_l;
- return (p_188537_1_ - this.field_110979_l) / f * 16.0F;
- }
- public float func_94206_g() {
- return this.field_110977_n;
- }
- public float func_94210_h() {
- return this.field_110978_o;
- }
- public float func_94207_b(double p_94207_1_) {
- float f = this.field_110978_o - this.field_110977_n;
- return this.field_110977_n + f * (float)p_94207_1_ / 16.0F;
- }
- public float func_188536_b(float p_188536_1_) {
- float f = this.field_110978_o - this.field_110977_n;
- return (p_188536_1_ - this.field_110977_n) / f * 16.0F;
- }
- public String func_94215_i() {
- return this.field_110984_i;
- }
- public void func_94219_l() {
- ++this.field_110983_h;
- if(this.field_110983_h >= this.field_110982_k.func_110472_a(this.field_110973_g)) {
- int i = this.field_110982_k.func_110468_c(this.field_110973_g);
- int j = this.field_110982_k.func_110473_c() == 0?this.field_110976_a.size():this.field_110982_k.func_110473_c();
- this.field_110973_g = (this.field_110973_g + 1) % j;
- this.field_110983_h = 0;
- int k = this.field_110982_k.func_110468_c(this.field_110973_g);
- if(i != k && k >= 0 && k < this.field_110976_a.size()) {
- 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);
- }
- } else if(this.field_110982_k.func_177219_e()) {
- this.func_180599_n();
- }
- }
- private void func_180599_n() {
- double d0 = 1.0D - (double)this.field_110983_h / (double)this.field_110982_k.func_110472_a(this.field_110973_g);
- int i = this.field_110982_k.func_110468_c(this.field_110973_g);
- int j = this.field_110982_k.func_110473_c() == 0?this.field_110976_a.size():this.field_110982_k.func_110473_c();
- int k = this.field_110982_k.func_110468_c((this.field_110973_g + 1) % j);
- if(i != k && k >= 0 && k < this.field_110976_a.size()) {
- int[][] aint = (int[][])this.field_110976_a.get(i);
- int[][] aint1 = (int[][])this.field_110976_a.get(k);
- if(this.field_176605_b == null || this.field_176605_b.length != aint.length) {
- this.field_176605_b = new int[aint.length][];
- }
- for(int l = 0; l < aint.length; ++l) {
- if(this.field_176605_b[l] == null) {
- this.field_176605_b[l] = new int[aint[l].length];
- }
- if(l < aint1.length && aint1[l].length == aint[l].length) {
- for(int i1 = 0; i1 < aint[l].length; ++i1) {
- int j1 = aint[l][i1];
- int k1 = aint1[l][i1];
- int l1 = this.func_188535_a(d0, j1 >> 16 & 255, k1 >> 16 & 255);
- int i2 = this.func_188535_a(d0, j1 >> 8 & 255, k1 >> 8 & 255);
- int j2 = this.func_188535_a(d0, j1 & 255, k1 & 255);
- this.field_176605_b[l][i1] = j1 & -16777216 | l1 << 16 | i2 << 8 | j2;
- }
- }
- }
- 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);
- }
- }
- private int func_188535_a(double p_188535_1_, int p_188535_3_, int p_188535_4_) {
- return (int)(p_188535_1_ * (double)p_188535_3_ + (1.0D - p_188535_1_) * (double)p_188535_4_);
- }
- public int[][] func_147965_a(int p_147965_1_) {
- return (int[][])this.field_110976_a.get(p_147965_1_);
- }
- public int func_110970_k() {
- return this.field_110976_a.size();
- }
- public void func_110966_b(int p_110966_1_) {
- this.field_130223_c = p_110966_1_;
- }
- public void func_110969_c(int p_110969_1_) {
- this.field_130224_d = p_110969_1_;
- }
- public void func_188538_a(PngSizeInfo p_188538_1_, boolean p_188538_2_) throws IOException {
- this.func_130102_n();
- this.field_130223_c = p_188538_1_.field_188533_a;
- this.field_130224_d = p_188538_1_.field_188534_b;
- if(p_188538_2_) {
- this.field_130224_d = this.field_130223_c;
- } else if(p_188538_1_.field_188534_b != p_188538_1_.field_188533_a) {
- throw new RuntimeException("broken aspect ratio and not an animation");
- }
- }
- public void func_188539_a(IResource p_188539_1_, int p_188539_2_) throws IOException {
- BufferedImage bufferedimage = TextureUtil.func_177053_a(p_188539_1_.func_110527_b());
- AnimationMetadataSection animationmetadatasection = (AnimationMetadataSection)p_188539_1_.func_110526_a("animation");
- int[][] aint = new int[p_188539_2_][];
- aint[0] = new int[bufferedimage.getWidth() * bufferedimage.getHeight()];
- bufferedimage.getRGB(0, 0, bufferedimage.getWidth(), bufferedimage.getHeight(), aint[0], 0, bufferedimage.getWidth());
- if(animationmetadatasection == null) {
- this.field_110976_a.add(aint);
- } else {
- int i = bufferedimage.getHeight() / this.field_130223_c;
- if(animationmetadatasection.func_110473_c() > 0) {
- Iterator lvt_7_1_ = animationmetadatasection.func_130073_e().iterator();
- while(lvt_7_1_.hasNext()) {
- int j = ((Integer)lvt_7_1_.next()).intValue();
- if(j >= i) {
- throw new RuntimeException("invalid frameindex " + j);
- }
- this.func_130099_d(j);
- this.field_110976_a.set(j, func_147962_a(aint, this.field_130223_c, this.field_130223_c, j));
- }
- this.field_110982_k = animationmetadatasection;
- } else {
- List<AnimationFrame> list = Lists.<AnimationFrame>newArrayList();
- for(int k = 0; k < i; ++k) {
- this.field_110976_a.add(func_147962_a(aint, this.field_130223_c, this.field_130223_c, k));
- list.add(new AnimationFrame(k, -1));
- }
- this.field_110982_k = new AnimationMetadataSection(list, this.field_130223_c, this.field_130224_d, animationmetadatasection.func_110469_d(), animationmetadatasection.func_177219_e());
- }
- }
- }
- public void func_147963_d(int p_147963_1_) {
- List<int[][]> list = Lists.<int[][]>newArrayList();
- for(int i = 0; i < this.field_110976_a.size(); ++i) {
- final int[][] aint = (int[][])this.field_110976_a.get(i);
- if(aint != null) {
- try {
- list.add(TextureUtil.func_147949_a(p_147963_1_, this.field_130223_c, aint));
- } catch (Throwable throwable) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable, "Generating mipmaps for frame");
- CrashReportCategory crashreportcategory = crashreport.func_85058_a("Frame being iterated");
- crashreportcategory.func_71507_a("Frame index", Integer.valueOf(i));
- crashreportcategory.func_189529_a("Frame sizes", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- StringBuilder stringbuilder = new StringBuilder();
- for(int[] aint1 : aint) {
- if(stringbuilder.length() > 0) {
- stringbuilder.append(", ");
- }
- stringbuilder.append(aint1 == null?"null":Integer.valueOf(aint1.length));
- }
- return stringbuilder.toString();
- }
- });
- throw new ReportedException(crashreport);
- }
- }
- }
- this.func_110968_a(list);
- }
- private void func_130099_d(int p_130099_1_) {
- if(this.field_110976_a.size() <= p_130099_1_) {
- for(int i = this.field_110976_a.size(); i <= p_130099_1_; ++i) {
- this.field_110976_a.add((int[][])null);
- }
- }
- }
- private static int[][] func_147962_a(int[][] p_147962_0_, int p_147962_1_, int p_147962_2_, int p_147962_3_) {
- int[][] aint = new int[p_147962_0_.length][];
- for(int i = 0; i < p_147962_0_.length; ++i) {
- int[] aint1 = p_147962_0_[i];
- if(aint1 != null) {
- aint[i] = new int[(p_147962_1_ >> i) * (p_147962_2_ >> i)];
- System.arraycopy(aint1, p_147962_3_ * aint[i].length, aint[i], 0, aint[i].length);
- }
- }
- return aint;
- }
- public void func_130103_l() {
- this.field_110976_a.clear();
- }
- public boolean func_130098_m() {
- return this.field_110982_k != null;
- }
- public void func_110968_a(List<int[][]> p_110968_1_) {
- this.field_110976_a = p_110968_1_;
- }
- private void func_130102_n() {
- this.field_110982_k = null;
- this.func_110968_a(Lists.<int[][]>newArrayList());
- this.field_110973_g = 0;
- this.field_110983_h = 0;
- }
- public String toString() {
- 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 + '}';
- }
- }
- Patching failed: minecraft\net\minecraft\client\renderer\vertex\VertexFormat.java
- Hunk 1 failed! Cannot find hunk target
- this.field_177353_d = 0;
- }
- + @SuppressWarnings("incomplete-switch")
- public VertexFormat func_181721_a(VertexFormatElement p_181721_1_) {
- if (p_181721_1_.func_177374_g() && this.func_177341_i()) {
- field_177357_a.warn("VertexFormat error: Trying to add a position VertexFormatElement when one already exists, ignoring.");
- File state
- package net.minecraft.client.renderer.vertex;
- import com.google.common.collect.Lists;
- import java.util.List;
- import net.minecraft.client.renderer.vertex.VertexFormatElement;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- import org.apache.logging.log4j.LogManager;
- import org.apache.logging.log4j.Logger;
- @SideOnly(Side.CLIENT)
- public class VertexFormat {
- private static final Logger field_177357_a = LogManager.getLogger();
- private final List<VertexFormatElement> field_177355_b;
- private final List<Integer> field_177356_c;
- private int field_177353_d;
- private int field_177354_e;
- private final List<Integer> field_177351_f;
- private int field_177352_g;
- public VertexFormat(VertexFormat p_i46097_1_) {
- this();
- for(int i = 0; i < p_i46097_1_.func_177345_h(); ++i) {
- this.func_181721_a(p_i46097_1_.func_177348_c(i));
- }
- this.field_177353_d = p_i46097_1_.func_177338_f();
- }
- public VertexFormat() {
- this.field_177355_b = Lists.<VertexFormatElement>newArrayList();
- this.field_177356_c = Lists.<Integer>newArrayList();
- this.field_177354_e = -1;
- this.field_177351_f = Lists.<Integer>newArrayList();
- this.field_177352_g = -1;
- }
- public void func_177339_a() {
- this.field_177355_b.clear();
- this.field_177356_c.clear();
- this.field_177354_e = -1;
- this.field_177351_f.clear();
- this.field_177352_g = -1;
- this.field_177353_d = 0;
- }
- public VertexFormat func_181721_a(VertexFormatElement p_181721_1_) {
- if(p_181721_1_.func_177374_g() && this.func_177341_i()) {
- field_177357_a.warn("VertexFormat error: Trying to add a position VertexFormatElement when one already exists, ignoring.");
- return this;
- } else {
- this.field_177355_b.add(p_181721_1_);
- this.field_177356_c.add(Integer.valueOf(this.field_177353_d));
- switch(p_181721_1_.func_177375_c()) {
- case NORMAL:
- this.field_177352_g = this.field_177353_d;
- break;
- case COLOR:
- this.field_177354_e = this.field_177353_d;
- break;
- case UV:
- this.field_177351_f.add(p_181721_1_.func_177369_e(), Integer.valueOf(this.field_177353_d));
- }
- this.field_177353_d += p_181721_1_.func_177368_f();
- return this;
- }
- }
- public boolean func_177350_b() {
- return this.field_177352_g >= 0;
- }
- public int func_177342_c() {
- return this.field_177352_g;
- }
- public boolean func_177346_d() {
- return this.field_177354_e >= 0;
- }
- public int func_177340_e() {
- return this.field_177354_e;
- }
- public boolean func_177347_a(int p_177347_1_) {
- return this.field_177351_f.size() - 1 >= p_177347_1_;
- }
- public int func_177344_b(int p_177344_1_) {
- return ((Integer)this.field_177351_f.get(p_177344_1_)).intValue();
- }
- public String toString() {
- String s = "format: " + this.field_177355_b.size() + " elements: ";
- for(int i = 0; i < this.field_177355_b.size(); ++i) {
- s = s + ((VertexFormatElement)this.field_177355_b.get(i)).toString();
- if(i != this.field_177355_b.size() - 1) {
- s = s + " ";
- }
- }
- return s;
- }
- private boolean func_177341_i() {
- int i = 0;
- for(int j = this.field_177355_b.size(); i < j; ++i) {
- VertexFormatElement vertexformatelement = (VertexFormatElement)this.field_177355_b.get(i);
- if(vertexformatelement.func_177374_g()) {
- return true;
- }
- }
- return false;
- }
- public int func_181719_f() {
- return this.func_177338_f() / 4;
- }
- public int func_177338_f() {
- return this.field_177353_d;
- }
- public List<VertexFormatElement> func_177343_g() {
- return this.field_177355_b;
- }
- public int func_177345_h() {
- return this.field_177355_b.size();
- }
- public VertexFormatElement func_177348_c(int p_177348_1_) {
- return (VertexFormatElement)this.field_177355_b.get(p_177348_1_);
- }
- public int func_181720_d(int p_181720_1_) {
- return ((Integer)this.field_177356_c.get(p_181720_1_)).intValue();
- }
- public boolean equals(Object p_equals_1_) {
- if(this == p_equals_1_) {
- return true;
- } else if(p_equals_1_ != null && this.getClass() == p_equals_1_.getClass()) {
- VertexFormat vertexformat = (VertexFormat)p_equals_1_;
- 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));
- } else {
- return false;
- }
- }
- public int hashCode() {
- int i = this.field_177355_b.hashCode();
- i = 31 * i + this.field_177356_c.hashCode();
- i = 31 * i + this.field_177353_d;
- return i;
- }
- }
- Patching failed: minecraft\net\minecraft\client\resources\SimpleResource.java
- Hunk 1 failed! Cannot find hunk target
- }
- }
- - T t = this.field_110535_a.get(p_110526_1_);
- + T t = (T)this.field_110535_a.get(p_110526_1_);
- if (t == null) {
- t = this.field_110532_e.func_110503_a(p_110526_1_, this.field_110530_g);
- }
- File state
- package net.minecraft.client.resources;
- import com.google.common.collect.Maps;
- import com.google.gson.JsonObject;
- import com.google.gson.JsonParser;
- import java.io.BufferedReader;
- import java.io.IOException;
- import java.io.InputStream;
- import java.io.InputStreamReader;
- import java.io.Reader;
- import java.nio.charset.StandardCharsets;
- import java.util.Map;
- import javax.annotation.Nullable;
- import net.minecraft.client.resources.IResource;
- import net.minecraft.client.resources.data.IMetadataSection;
- import net.minecraft.client.resources.data.MetadataSerializer;
- import net.minecraft.util.ResourceLocation;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- import org.apache.commons.io.IOUtils;
- @SideOnly(Side.CLIENT)
- public class SimpleResource implements IResource {
- private final Map<String, IMetadataSection> field_110535_a = Maps.<String, IMetadataSection>newHashMap();
- private final String field_177242_b;
- private final ResourceLocation field_110533_b;
- private final InputStream field_110534_c;
- private final InputStream field_110531_d;
- private final MetadataSerializer field_110532_e;
- private boolean field_110529_f;
- private JsonObject field_110530_g;
- public SimpleResource(String p_i46090_1_, ResourceLocation p_i46090_2_, InputStream p_i46090_3_, InputStream p_i46090_4_, MetadataSerializer p_i46090_5_) {
- this.field_177242_b = p_i46090_1_;
- this.field_110533_b = p_i46090_2_;
- this.field_110534_c = p_i46090_3_;
- this.field_110531_d = p_i46090_4_;
- this.field_110532_e = p_i46090_5_;
- }
- public ResourceLocation func_177241_a() {
- return this.field_110533_b;
- }
- public InputStream func_110527_b() {
- return this.field_110534_c;
- }
- public boolean func_110528_c() {
- return this.field_110531_d != null;
- }
- @Nullable
- public <T extends IMetadataSection> T func_110526_a(String p_110526_1_) {
- if(!this.func_110528_c()) {
- return (T)null;
- } else {
- if(this.field_110530_g == null && !this.field_110529_f) {
- this.field_110529_f = true;
- BufferedReader bufferedreader = null;
- try {
- bufferedreader = new BufferedReader(new InputStreamReader(this.field_110531_d, StandardCharsets.UTF_8));
- this.field_110530_g = (new JsonParser()).parse((Reader)bufferedreader).getAsJsonObject();
- } finally {
- IOUtils.closeQuietly((Reader)bufferedreader);
- }
- }
- T t = (IMetadataSection)this.field_110535_a.get(p_110526_1_);
- if(t == null) {
- t = this.field_110532_e.func_110503_a(p_110526_1_, this.field_110530_g);
- }
- return t;
- }
- }
- public String func_177240_d() {
- return this.field_177242_b;
- }
- public boolean equals(Object p_equals_1_) {
- if(this == p_equals_1_) {
- return true;
- } else if(!(p_equals_1_ instanceof SimpleResource)) {
- return false;
- } else {
- SimpleResource simpleresource = (SimpleResource)p_equals_1_;
- if(this.field_110533_b != null) {
- if(!this.field_110533_b.equals(simpleresource.field_110533_b)) {
- return false;
- }
- } else if(simpleresource.field_110533_b != null) {
- return false;
- }
- if(this.field_177242_b != null) {
- if(!this.field_177242_b.equals(simpleresource.field_177242_b)) {
- return false;
- }
- } else if(simpleresource.field_177242_b != null) {
- return false;
- }
- return true;
- }
- }
- public int hashCode() {
- int i = this.field_177242_b != null?this.field_177242_b.hashCode():0;
- i = 31 * i + (this.field_110533_b != null?this.field_110533_b.hashCode():0);
- return i;
- }
- public void close() throws IOException {
- this.field_110534_c.close();
- if(this.field_110531_d != null) {
- this.field_110531_d.close();
- }
- }
- }
- Patching failed: minecraft\net\minecraft\advancements\AdvancementList.java
- Hunk 1 failed! Cannot find hunk target
- }
- public void func_192083_a(Map<ResourceLocation, Advancement.Builder> p_192083_1_) {
- - Function<ResourceLocation, Advancement> function = Functions.<ResourceLocation, Advancement>forMap(this.field_192092_b, (Object)null);
- + Function<ResourceLocation, Advancement> function = Functions.<ResourceLocation, Advancement>forMap(this.field_192092_b, null);
- label42:
- while(!p_192083_1_.isEmpty()) {
- File state
- package net.minecraft.advancements;
- import com.google.common.base.Functions;
- import com.google.common.collect.Maps;
- import com.google.common.collect.Sets;
- import java.util.Iterator;
- import java.util.Map;
- import java.util.Set;
- import java.util.Map.Entry;
- import java.util.function.Function;
- import javax.annotation.Nullable;
- import net.minecraft.advancements.Advancement;
- import net.minecraft.util.ResourceLocation;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- import org.apache.logging.log4j.LogManager;
- import org.apache.logging.log4j.Logger;
- public class AdvancementList {
- private static final Logger field_192091_a = LogManager.getLogger();
- private final Map<ResourceLocation, Advancement> field_192092_b = Maps.<ResourceLocation, Advancement>newHashMap();
- private final Set<Advancement> field_192093_c = Sets.<Advancement>newLinkedHashSet();
- private final Set<Advancement> field_192094_d = Sets.<Advancement>newLinkedHashSet();
- private AdvancementList.Listener field_192095_e;
- @SideOnly(Side.CLIENT)
- private void func_192090_a(Advancement p_192090_1_) {
- for(Advancement advancement : p_192090_1_.func_192069_e()) {
- this.func_192090_a(advancement);
- }
- field_192091_a.info("Forgot about advancement " + p_192090_1_.func_192067_g());
- this.field_192092_b.remove(p_192090_1_.func_192067_g());
- if(p_192090_1_.func_192070_b() == null) {
- this.field_192093_c.remove(p_192090_1_);
- if(this.field_192095_e != null) {
- this.field_192095_e.func_191928_b(p_192090_1_);
- }
- } else {
- this.field_192094_d.remove(p_192090_1_);
- if(this.field_192095_e != null) {
- this.field_192095_e.func_191929_d(p_192090_1_);
- }
- }
- }
- @SideOnly(Side.CLIENT)
- public void func_192085_a(Set<ResourceLocation> p_192085_1_) {
- for(ResourceLocation resourcelocation : p_192085_1_) {
- Advancement advancement = (Advancement)this.field_192092_b.get(resourcelocation);
- if(advancement == null) {
- field_192091_a.warn("Told to remove advancement " + resourcelocation + " but I don\'t know what that is");
- } else {
- this.func_192090_a(advancement);
- }
- }
- }
- public void func_192083_a(Map<ResourceLocation, Advancement.Builder> p_192083_1_) {
- Function<ResourceLocation, Advancement> function = Functions.<ResourceLocation, Advancement>forMap(this.field_192092_b, (Advancement)null);
- label18:
- while(!p_192083_1_.isEmpty()) {
- boolean flag = false;
- Iterator<Entry<ResourceLocation, Advancement.Builder>> iterator = p_192083_1_.entrySet().iterator();
- while(iterator.hasNext()) {
- Entry<ResourceLocation, Advancement.Builder> entry = (Entry)iterator.next();
- ResourceLocation resourcelocation = (ResourceLocation)entry.getKey();
- Advancement.Builder advancement$builder = (Advancement.Builder)entry.getValue();
- if(advancement$builder.func_192058_a(function)) {
- Advancement advancement = advancement$builder.func_192056_a(resourcelocation);
- this.field_192092_b.put(resourcelocation, advancement);
- flag = true;
- iterator.remove();
- if(advancement.func_192070_b() == null) {
- this.field_192093_c.add(advancement);
- if(this.field_192095_e != null) {
- this.field_192095_e.func_191931_a(advancement);
- }
- } else {
- this.field_192094_d.add(advancement);
- if(this.field_192095_e != null) {
- this.field_192095_e.func_191932_c(advancement);
- }
- }
- }
- }
- if(!flag) {
- iterator = p_192083_1_.entrySet().iterator();
- while(true) {
- if(!iterator.hasNext()) {
- break label18;
- }
- Entry<ResourceLocation, Advancement.Builder> entry1 = (Entry)iterator.next();
- field_192091_a.error("Couldn\'t load advancement " + entry1.getKey() + ": " + entry1.getValue());
- }
- }
- }
- field_192091_a.info("Loaded " + this.field_192092_b.size() + " advancements");
- }
- public void func_192087_a() {
- this.field_192092_b.clear();
- this.field_192093_c.clear();
- this.field_192094_d.clear();
- if(this.field_192095_e != null) {
- this.field_192095_e.func_191930_a();
- }
- }
- public Iterable<Advancement> func_192088_b() {
- return this.field_192093_c;
- }
- public Iterable<Advancement> func_192089_c() {
- return this.field_192092_b.values();
- }
- @Nullable
- public Advancement func_192084_a(ResourceLocation p_192084_1_) {
- return (Advancement)this.field_192092_b.get(p_192084_1_);
- }
- @SideOnly(Side.CLIENT)
- public void func_192086_a(@Nullable AdvancementList.Listener p_192086_1_) {
- this.field_192095_e = p_192086_1_;
- if(p_192086_1_ != null) {
- for(Advancement advancement : this.field_192093_c) {
- p_192086_1_.func_191931_a(advancement);
- }
- for(Advancement advancement1 : this.field_192094_d) {
- p_192086_1_.func_191932_c(advancement1);
- }
- }
- }
- public interface Listener {
- void func_191931_a(Advancement p_191931_1_);
- @SideOnly(Side.CLIENT)
- void func_191928_b(Advancement p_191928_1_);
- void func_191932_c(Advancement p_191932_1_);
- @SideOnly(Side.CLIENT)
- void func_191929_d(Advancement p_191929_1_);
- void func_191930_a();
- }
- }
- Patching failed: minecraft\net\minecraft\client\util\SearchTree.java
- Hunk 1 failed! Cannot find hunk target
- private void func_194042_b(T p_194042_1_) {
- (this.field_194047_d.apply(p_194042_1_)).forEach((p_194039_2_) -> {
- - this.field_194045_b.func_194057_a(p_194039_1_, p_194039_2_.toString().toLowerCase(Locale.ROOT));
- + this.field_194045_b.func_194057_a(p_194042_1_, p_194039_2_.toString().toLowerCase(Locale.ROOT));
- });
- (this.field_194046_c.apply(p_194042_1_)).forEach((p_194041_2_) -> {
- - this.field_194044_a.func_194057_a(p_194041_1_, p_194041_2_.toLowerCase(Locale.ROOT));
- + this.field_194044_a.func_194057_a(p_194042_1_, p_194041_2_.toLowerCase(Locale.ROOT));
- });
- }
- File state
- package net.minecraft.client.util;
- import com.google.common.collect.AbstractIterator;
- import com.google.common.collect.Lists;
- import it.unimi.dsi.fastutil.objects.Object2IntMap;
- import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
- import java.util.Iterator;
- import java.util.List;
- import java.util.Locale;
- import java.util.function.Consumer;
- import java.util.function.Function;
- import net.minecraft.client.util.ISearchTree;
- import net.minecraft.client.util.SuffixArray;
- import net.minecraft.util.ResourceLocation;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- @SideOnly(Side.CLIENT)
- public class SearchTree<T> implements ISearchTree<T> {
- protected SuffixArray<T> field_194044_a = new SuffixArray();
- protected SuffixArray<T> field_194045_b = new SuffixArray();
- private final Function<T, Iterable<String>> field_194046_c;
- private final Function<T, Iterable<ResourceLocation>> field_194047_d;
- private final List<T> field_194048_e = Lists.<T>newArrayList();
- private Object2IntMap<T> field_194049_f = new Object2IntOpenHashMap();
- public SearchTree(Function<T, Iterable<String>> p_i47612_1_, Function<T, Iterable<ResourceLocation>> p_i47612_2_) {
- this.field_194046_c = p_i47612_1_;
- this.field_194047_d = p_i47612_2_;
- }
- public void func_194040_a() {
- this.field_194044_a = new SuffixArray();
- this.field_194045_b = new SuffixArray();
- for(T t : this.field_194048_e) {
- this.func_194042_b(t);
- }
- this.field_194044_a.func_194058_a();
- this.field_194045_b.func_194058_a();
- }
- public void func_194043_a(T p_194043_1_) {
- this.field_194049_f.put(p_194043_1_, this.field_194048_e.size());
- this.field_194048_e.add(p_194043_1_);
- this.func_194042_b(p_194043_1_);
- }
- private void func_194042_b(T p_194042_1_) {
- ((Iterable)this.field_194047_d.apply(p_194042_1_)).forEach((p_194039_2_) -> {
- this.field_194045_b.func_194057_a(p_194042_1_, p_194039_2_.toString().toLowerCase(Locale.ROOT));
- });
- ((Iterable)this.field_194046_c.apply(p_194042_1_)).forEach((p_194041_2_) -> {
- this.field_194044_a.func_194057_a(p_194042_1_, p_194041_2_.toLowerCase(Locale.ROOT));
- });
- }
- public List<T> func_194038_a(String p_194038_1_) {
- List<T> list = this.field_194044_a.func_194055_a(p_194038_1_);
- if(p_194038_1_.indexOf(58) < 0) {
- return list;
- } else {
- List<T> list1 = this.field_194045_b.func_194055_a(p_194038_1_);
- return (List<T>)(list1.isEmpty()?list:Lists.newArrayList(new SearchTree.MergingIterator(list.iterator(), list1.iterator(), this.field_194049_f)));
- }
- }
- @SideOnly(Side.CLIENT)
- static class MergingIterator<T> extends AbstractIterator<T> {
- private final Iterator<T> field_194033_a;
- private final Iterator<T> field_194034_b;
- private final Object2IntMap<T> field_194035_c;
- private T field_194036_d;
- private T field_194037_e;
- public MergingIterator(Iterator<T> p_i47606_1_, Iterator<T> p_i47606_2_, Object2IntMap<T> p_i47606_3_) {
- this.field_194033_a = p_i47606_1_;
- this.field_194034_b = p_i47606_2_;
- this.field_194035_c = p_i47606_3_;
- this.field_194036_d = p_i47606_1_.hasNext()?p_i47606_1_.next():null;
- this.field_194037_e = p_i47606_2_.hasNext()?p_i47606_2_.next():null;
- }
- protected T computeNext() {
- if(this.field_194036_d == null && this.field_194037_e == null) {
- return (T)this.endOfData();
- } else {
- int i;
- if(this.field_194036_d == this.field_194037_e) {
- i = 0;
- } else if(this.field_194036_d == null) {
- i = 1;
- } else if(this.field_194037_e == null) {
- i = -1;
- } else {
- i = Integer.compare(this.field_194035_c.getInt(this.field_194036_d), this.field_194035_c.getInt(this.field_194037_e));
- }
- T t = i <= 0?this.field_194036_d:this.field_194037_e;
- if(i <= 0) {
- this.field_194036_d = this.field_194033_a.hasNext()?this.field_194033_a.next():null;
- }
- if(i >= 0) {
- this.field_194037_e = this.field_194034_b.hasNext()?this.field_194034_b.next():null;
- }
- return t;
- }
- }
- }
- }
- Patching failed: minecraft\net\minecraft\client\util\SuffixArray.java
- Hunk 1 failed! Cannot find hunk target
- };
- Swapper swapper = (p_194054_3_, p_194054_4_) -> {
- if (p_194054_3_ != p_194054_4_) {
- - int i2 = p_194054_0_[p_194054_3_];
- - p_194054_0_[p_194054_3_] = p_194054_0_[p_194054_4_];
- - p_194054_0_[p_194054_4_] = i2;
- - i2 = p_194054_1_[p_194054_3_];
- - p_194054_1_[p_194054_3_] = p_194054_1_[p_194054_4_];
- - p_194054_1_[p_194054_4_] = i2;
- - i2 = p_194054_2_[p_194054_3_];
- - p_194054_2_[p_194054_3_] = p_194054_2_[p_194054_4_];
- - p_194054_2_[p_194054_4_] = i2;
- + int i2 = aint1[p_194054_3_];
- + aint1[p_194054_3_] = aint1[p_194054_4_];
- + aint1[p_194054_4_] = i2;
- + i2 = aint2[p_194054_3_];
- + aint2[p_194054_3_] = aint2[p_194054_4_];
- + aint2[p_194054_4_] = i2;
- + i2 = aint3[p_194054_3_];
- + aint3[p_194054_3_] = aint3[p_194054_4_];
- + aint3[p_194054_4_] = i2;
- }
- };
- File state
- package net.minecraft.client.util;
- import com.google.common.collect.Lists;
- import com.google.common.collect.Sets;
- import it.unimi.dsi.fastutil.Arrays;
- import it.unimi.dsi.fastutil.Swapper;
- import it.unimi.dsi.fastutil.ints.IntArrayList;
- import it.unimi.dsi.fastutil.ints.IntComparator;
- import it.unimi.dsi.fastutil.ints.IntList;
- import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
- import it.unimi.dsi.fastutil.ints.IntSet;
- import java.util.Collections;
- import java.util.List;
- import java.util.Set;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- import org.apache.logging.log4j.LogManager;
- import org.apache.logging.log4j.Logger;
- @SideOnly(Side.CLIENT)
- public class SuffixArray<T> {
- private static final boolean field_194062_b = Boolean.parseBoolean(System.getProperty("SuffixArray.printComparisons", "false"));
- private static final boolean field_194063_c = Boolean.parseBoolean(System.getProperty("SuffixArray.printArray", "false"));
- private static final Logger field_194064_d = LogManager.getLogger();
- protected final List<T> field_194061_a = Lists.<T>newArrayList();
- private final IntList field_194065_e = new IntArrayList();
- private final IntList field_194066_f = new IntArrayList();
- private IntList field_194067_g = new IntArrayList();
- private IntList field_194068_h = new IntArrayList();
- private int field_194069_i;
- public void func_194057_a(T p_194057_1_, String p_194057_2_) {
- this.field_194069_i = Math.max(this.field_194069_i, p_194057_2_.length());
- int i = this.field_194061_a.size();
- this.field_194061_a.add(p_194057_1_);
- this.field_194066_f.add(this.field_194065_e.size());
- for(int j = 0; j < p_194057_2_.length(); ++j) {
- this.field_194067_g.add(i);
- this.field_194068_h.add(j);
- this.field_194065_e.add(p_194057_2_.charAt(j));
- }
- this.field_194067_g.add(i);
- this.field_194068_h.add(p_194057_2_.length());
- this.field_194065_e.add(-1);
- }
- public void func_194058_a() {
- int i = this.field_194065_e.size();
- int[] aint = new int[i];
- final int[] aint1 = new int[i];
- final int[] aint2 = new int[i];
- int[] aint3 = new int[i];
- IntComparator intcomparator = new IntComparator() {
- public int compare(int p_compare_1_, int p_compare_2_) {
- 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_]);
- }
- public int compare(Integer p_compare_1_, Integer p_compare_2_) {
- return this.compare(p_compare_1_.intValue(), p_compare_2_.intValue());
- }
- };
- Swapper swapper = (p_194054_3_, p_194054_4_) -> {
- if(p_194054_3_ != p_194054_4_) {
- int int = lvt_3_1_[p_194054_3_];
- lvt_3_1_[p_194054_3_] = lvt_3_1_[p_194054_4_];
- lvt_3_1_[p_194054_4_] = int;
- int = lvt_4_1_[p_194054_3_];
- lvt_4_1_[p_194054_3_] = lvt_4_1_[p_194054_4_];
- lvt_4_1_[p_194054_4_] = int;
- int = lvt_5_1_[p_194054_3_];
- lvt_5_1_[p_194054_3_] = lvt_5_1_[p_194054_4_];
- lvt_5_1_[p_194054_4_] = int;
- }
- };
- for(int j = 0; j < i; ++j) {
- aint[j] = this.field_194065_e.getInt(j);
- }
- int k1 = 1;
- for(int k = Math.min(i, this.field_194069_i); k1 * 2 < k; k1 *= 2) {
- for(int l = 0; l < i; aint3[l] = l++) {
- aint1[l] = aint[l];
- aint2[l] = l + k1 < i?aint[l + k1]:-2;
- }
- Arrays.quickSort(0, i, intcomparator, swapper);
- for(int l1 = 0; l1 < i; ++l1) {
- if(l1 > 0 && aint1[l1] == aint1[l1 - 1] && aint2[l1] == aint2[l1 - 1]) {
- aint[aint3[l1]] = aint[aint3[l1 - 1]];
- } else {
- aint[aint3[l1]] = l1;
- }
- }
- }
- IntList intlist1 = this.field_194067_g;
- IntList intlist = this.field_194068_h;
- this.field_194067_g = new IntArrayList(intlist1.size());
- this.field_194068_h = new IntArrayList(intlist.size());
- for(int i1 = 0; i1 < i; ++i1) {
- int j1 = aint3[i1];
- this.field_194067_g.add(intlist1.getInt(j1));
- this.field_194068_h.add(intlist.getInt(j1));
- }
- if(field_194063_c) {
- this.func_194060_b();
- }
- }
- private void func_194060_b() {
- for(int int = 0; int < this.field_194067_g.size(); ++int) {
- field_194064_d.debug((String)"{} {}", (Object)Integer.valueOf(int), (Object)this.func_194059_a(int));
- }
- field_194064_d.debug("");
- }
- private String func_194059_a(int p_194059_1_) {
- int int = this.field_194068_h.getInt(p_194059_1_);
- int int = this.field_194066_f.getInt(this.field_194067_g.getInt(p_194059_1_));
- StringBuilder stringbuilder = new StringBuilder();
- for(int int = 0; int + int < this.field_194065_e.size(); ++int) {
- if(int == int) {
- stringbuilder.append('^');
- }
- int int = ((Integer)this.field_194065_e.get(int + int)).intValue();
- if(int == -1) {
- break;
- }
- stringbuilder.append((char)int);
- }
- return stringbuilder.toString();
- }
- private int func_194056_a(String p_194056_1_, int p_194056_2_) {
- int int = this.field_194066_f.getInt(this.field_194067_g.getInt(p_194056_2_));
- int int = this.field_194068_h.getInt(p_194056_2_);
- for(int int = 0; int < p_194056_1_.length(); ++int) {
- int int = this.field_194065_e.getInt(int + int + int);
- if(int == -1) {
- return 1;
- }
- char char = p_194056_1_.charAt(int);
- char char = (char)int;
- if(char < char) {
- return -1;
- }
- if(char > char) {
- return 1;
- }
- }
- return 0;
- }
- public List<T> func_194055_a(String p_194055_1_) {
- int int = this.field_194067_g.size();
- int int = 0;
- int int = int;
- while(int < int) {
- int int = int + (int - int) / 2;
- int int = this.func_194056_a(p_194055_1_, int);
- if(field_194062_b) {
- field_194064_d.debug((String)"comparing lower \"{}\" with {} \"{}\": {}", (Object)p_194055_1_, Integer.valueOf(int), this.func_194059_a(int), Integer.valueOf(int));
- }
- if(int > 0) {
- int = int + 1;
- } else {
- int = int;
- }
- }
- if(int >= 0 && int < int) {
- int int = int;
- int = int;
- while(int < int) {
- int int = int + (int - int) / 2;
- int int = this.func_194056_a(p_194055_1_, int);
- if(field_194062_b) {
- field_194064_d.debug((String)"comparing upper \"{}\" with {} \"{}\": {}", (Object)p_194055_1_, Integer.valueOf(int), this.func_194059_a(int), Integer.valueOf(int));
- }
- if(int >= 0) {
- int = int + 1;
- } else {
- int = int;
- }
- }
- int int = int;
- IntSet intset = new IntOpenHashSet();
- for(int int = int; int < int; ++int) {
- intset.add(this.field_194067_g.getInt(int));
- }
- int[] aint = intset.toIntArray();
- java.util.Arrays.sort(aint);
- Set<T> set = Sets.<T>newLinkedHashSet();
- for(int int : aint) {
- set.add(this.field_194061_a.get(int));
- }
- return Lists.newArrayList(set);
- } else {
- return Collections.<T>emptyList();
- }
- }
- }
- Patching failed: minecraft\net\minecraft\command\EntitySelector.java
- Hunk 1 failed! Cannot find hunk target
- }
- }
- - return Lists.newArrayList(entity);
- + return Lists.newArrayList((T)entity);
- }
- return Collections.<T>emptyList();
- File state
- package net.minecraft.command;
- import com.google.common.base.Predicate;
- import com.google.common.base.Predicates;
- import com.google.common.base.Splitter;
- import com.google.common.collect.ComparisonChain;
- import com.google.common.collect.Lists;
- import com.google.common.collect.Maps;
- import com.google.common.collect.Sets;
- import java.util.Collections;
- import java.util.Comparator;
- import java.util.Iterator;
- import java.util.List;
- import java.util.Map;
- import java.util.Set;
- import java.util.Map.Entry;
- import java.util.regex.Matcher;
- import java.util.regex.Pattern;
- import javax.annotation.Nullable;
- import net.minecraft.command.CommandBase;
- import net.minecraft.command.CommandException;
- import net.minecraft.command.ICommandSender;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.EntityList;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.entity.player.EntityPlayerMP;
- import net.minecraft.scoreboard.Score;
- import net.minecraft.scoreboard.ScoreObjective;
- import net.minecraft.scoreboard.Scoreboard;
- import net.minecraft.scoreboard.Team;
- import net.minecraft.util.EntitySelectors;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.util.math.AxisAlignedBB;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.util.math.MathHelper;
- import net.minecraft.util.math.Vec3d;
- import net.minecraft.util.text.ITextComponent;
- import net.minecraft.util.text.TextComponentTranslation;
- import net.minecraft.util.text.TextFormatting;
- import net.minecraft.world.GameType;
- import net.minecraft.world.World;
- public class EntitySelector {
- private static final Pattern field_82389_a = Pattern.compile("^@([pares])(?:\\[([^ ]*)\\])?$");
- private static final Splitter field_190828_b = Splitter.on(',').omitEmptyStrings();
- private static final Splitter field_190829_c = Splitter.on('=').limit(2);
- private static final Set<String> field_190830_d = Sets.<String>newHashSet();
- private static final String field_190831_e = func_190826_c("r");
- private static final String field_190832_f = func_190826_c("rm");
- private static final String field_190833_g = func_190826_c("l");
- private static final String field_190834_h = func_190826_c("lm");
- private static final String field_190835_i = func_190826_c("x");
- private static final String field_190836_j = func_190826_c("y");
- private static final String field_190837_k = func_190826_c("z");
- private static final String field_190838_l = func_190826_c("dx");
- private static final String field_190839_m = func_190826_c("dy");
- private static final String field_190840_n = func_190826_c("dz");
- private static final String field_190841_o = func_190826_c("rx");
- private static final String field_190842_p = func_190826_c("rxm");
- private static final String field_190843_q = func_190826_c("ry");
- private static final String field_190844_r = func_190826_c("rym");
- private static final String field_190845_s = func_190826_c("c");
- private static final String field_190846_t = func_190826_c("m");
- private static final String field_190847_u = func_190826_c("team");
- private static final String field_190848_v = func_190826_c("name");
- private static final String field_190849_w = func_190826_c("type");
- private static final String field_190850_x = func_190826_c("tag");
- private static final Predicate<String> field_190851_y = new Predicate<String>() {
- public boolean apply(@Nullable String p_apply_1_) {
- return p_apply_1_ != null && (EntitySelector.field_190830_d.contains(p_apply_1_) || p_apply_1_.length() > "score_".length() && p_apply_1_.startsWith("score_"));
- }
- };
- 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});
- public static String func_190826_c(String p_190826_0_) {
- field_190830_d.add(p_190826_0_);
- return p_190826_0_;
- }
- @Nullable
- public static EntityPlayerMP func_82386_a(ICommandSender p_82386_0_, String p_82386_1_) throws CommandException {
- return (EntityPlayerMP)func_179652_a(p_82386_0_, p_82386_1_, EntityPlayerMP.class);
- }
- public static List<EntityPlayerMP> func_193531_b(ICommandSender p_193531_0_, String p_193531_1_) throws CommandException {
- return func_179656_b(p_193531_0_, p_193531_1_, EntityPlayerMP.class);
- }
- @Nullable
- 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 {
- List<T> list = func_179656_b(p_179652_0_, p_179652_1_, p_179652_2_);
- return (T)(list.size() == 1?(Entity)list.get(0):null);
- }
- @Nullable
- public static ITextComponent func_150869_b(ICommandSender p_150869_0_, String p_150869_1_) throws CommandException {
- List<Entity> list = func_179656_b(p_150869_0_, p_150869_1_, Entity.class);
- if(list.isEmpty()) {
- return null;
- } else {
- List<ITextComponent> list1 = Lists.<ITextComponent>newArrayList();
- for(Entity entity : list) {
- list1.add(entity.func_145748_c_());
- }
- return CommandBase.func_180530_a(list1);
- }
- }
- 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 {
- Matcher matcher = field_82389_a.matcher(p_179656_1_);
- if(matcher.matches() && p_179656_0_.func_70003_b(1, "@")) {
- Map<String, String> map = func_82381_h(matcher.group(2));
- if(!func_179655_b(p_179656_0_, map)) {
- return Collections.<T>emptyList();
- } else {
- String s = matcher.group(1);
- BlockPos blockpos = func_179664_b(map, p_179656_0_.func_180425_c());
- Vec3d vec3d = func_189210_b(map, p_179656_0_.func_174791_d());
- List<World> list = func_179654_a(p_179656_0_, map);
- List<T> list1 = Lists.<T>newArrayList();
- for(World world : list) {
- if(world != null) {
- List<Predicate<Entity>> list2 = Lists.<Predicate<Entity>>newArrayList();
- list2.addAll(func_179663_a(map, s));
- list2.addAll(func_179648_b(map));
- list2.addAll(func_179649_c(map));
- list2.addAll(func_179659_d(map));
- list2.addAll(func_184952_c(p_179656_0_, map));
- list2.addAll(func_179647_f(map));
- list2.addAll(func_184951_f(map));
- list2.addAll(func_180698_a(map, vec3d));
- list2.addAll(func_179662_g(map));
- if("s".equalsIgnoreCase(s)) {
- Entity entity = p_179656_0_.func_174793_f();
- if(entity != null && p_179656_2_.isAssignableFrom(entity.getClass())) {
- if(map.containsKey(field_190838_l) || map.containsKey(field_190839_m) || map.containsKey(field_190840_n)) {
- int i = func_179653_a(map, field_190838_l, 0);
- int j = func_179653_a(map, field_190839_m, 0);
- int k = func_179653_a(map, field_190840_n, 0);
- AxisAlignedBB axisalignedbb = func_179661_a(blockpos, i, j, k);
- if(!axisalignedbb.func_72326_a(entity.func_174813_aQ())) {
- return Collections.<T>emptyList();
- }
- }
- for(Predicate<Entity> predicate : list2) {
- if(!predicate.apply(entity)) {
- return Collections.<T>emptyList();
- }
- }
- return Lists.newArrayList(new Entity[]{entity});
- }
- return Collections.<T>emptyList();
- }
- list1.addAll(func_179660_a(map, p_179656_2_, list2, s, world, blockpos));
- }
- }
- return func_179658_a(list1, map, p_179656_0_, p_179656_2_, s, vec3d);
- }
- } else {
- return Collections.<T>emptyList();
- }
- }
- private static List<World> func_179654_a(ICommandSender p_179654_0_, Map<String, String> p_179654_1_) {
- List<World> list = Lists.<World>newArrayList();
- if(func_179665_h(p_179654_1_)) {
- list.add(p_179654_0_.func_130014_f_());
- } else {
- Collections.addAll(list, p_179654_0_.func_184102_h().field_71305_c);
- }
- return list;
- }
- private static <T extends Entity> boolean func_179655_b(ICommandSender p_179655_0_, Map<String, String> p_179655_1_) {
- String s = func_179651_b(p_179655_1_, field_190849_w);
- if(s == null) {
- return true;
- } else {
- ResourceLocation resourcelocation = new ResourceLocation(s.startsWith("!")?s.substring(1):s);
- if(EntityList.func_180125_b(resourcelocation)) {
- return true;
- } else {
- TextComponentTranslation textcomponenttranslation = new TextComponentTranslation("commands.generic.entity.invalidType", new Object[]{resourcelocation});
- textcomponenttranslation.func_150256_b().func_150238_a(TextFormatting.RED);
- p_179655_0_.func_145747_a(textcomponenttranslation);
- return false;
- }
- }
- }
- private static List<Predicate<Entity>> func_179663_a(Map<String, String> p_179663_0_, String p_179663_1_) {
- String s = func_179651_b(p_179663_0_, field_190849_w);
- if(s == null || !p_179663_1_.equals("e") && !p_179663_1_.equals("r") && !p_179663_1_.equals("s")) {
- return !p_179663_1_.equals("e") && !p_179663_1_.equals("s")?Collections.singletonList(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return p_apply_1_ instanceof EntityPlayer;
- }
- }):Collections.emptyList();
- } else {
- final boolean flag = s.startsWith("!");
- final ResourceLocation resourcelocation = new ResourceLocation(flag?s.substring(1):s);
- return Collections.singletonList(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return EntityList.func_180123_a(p_apply_1_, resourcelocation) != flag;
- }
- });
- }
- }
- private static List<Predicate<Entity>> func_179648_b(Map<String, String> p_179648_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- final int i = func_179653_a(p_179648_0_, field_190834_h, -1);
- final int j = func_179653_a(p_179648_0_, field_190833_g, -1);
- if(i > -1 || j > -1) {
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(!(p_apply_1_ instanceof EntityPlayerMP)) {
- return false;
- } else {
- EntityPlayerMP entityplayermp = (EntityPlayerMP)p_apply_1_;
- return (i <= -1 || entityplayermp.field_71068_ca >= i) && (j <= -1 || entityplayermp.field_71068_ca <= j);
- }
- }
- });
- }
- return list;
- }
- private static List<Predicate<Entity>> func_179649_c(Map<String, String> p_179649_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- String s = func_179651_b(p_179649_0_, field_190846_t);
- if(s == null) {
- return list;
- } else {
- final boolean flag = s.startsWith("!");
- if(flag) {
- s = s.substring(1);
- }
- final GameType gametype;
- try {
- int i = Integer.parseInt(s);
- gametype = GameType.func_185329_a(i, GameType.NOT_SET);
- } catch (Throwable var6) {
- gametype = GameType.func_185328_a(s, GameType.NOT_SET);
- }
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(!(p_apply_1_ instanceof EntityPlayerMP)) {
- return false;
- } else {
- EntityPlayerMP entityplayermp = (EntityPlayerMP)p_apply_1_;
- GameType gametype1 = entityplayermp.field_71134_c.func_73081_b();
- return flag?gametype1 != gametype:gametype1 == gametype;
- }
- }
- });
- return list;
- }
- }
- private static List<Predicate<Entity>> func_179659_d(Map<String, String> p_179659_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- final String s = func_179651_b(p_179659_0_, field_190847_u);
- final boolean flag = s != null && s.startsWith("!");
- if(flag) {
- s = s.substring(1);
- }
- if(s != null) {
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(!(p_apply_1_ instanceof EntityLivingBase)) {
- return false;
- } else {
- EntityLivingBase entitylivingbase = (EntityLivingBase)p_apply_1_;
- Team team = entitylivingbase.func_96124_cp();
- String s1 = team == null?"":team.func_96661_b();
- return s1.equals(s) != flag;
- }
- }
- });
- }
- return list;
- }
- private static List<Predicate<Entity>> func_184952_c(final ICommandSender p_184952_0_, Map<String, String> p_184952_1_) {
- final Map<String, Integer> map = func_96560_a(p_184952_1_);
- return (List<Predicate<Entity>>)(map.isEmpty()?Collections.emptyList():Lists.newArrayList(new Predicate[]{new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(p_apply_1_ == null) {
- return false;
- } else {
- Scoreboard scoreboard = p_184952_0_.func_184102_h().func_71218_a(0).func_96441_U();
- for(Entry<String, Integer> entry : map.entrySet()) {
- String s = (String)entry.getKey();
- boolean flag = false;
- if(s.endsWith("_min") && s.length() > 4) {
- flag = true;
- s = s.substring(0, s.length() - 4);
- }
- ScoreObjective scoreobjective = scoreboard.func_96518_b(s);
- if(scoreobjective == null) {
- return false;
- }
- String s1 = p_apply_1_ instanceof EntityPlayerMP?p_apply_1_.func_70005_c_():p_apply_1_.func_189512_bd();
- if(!scoreboard.func_178819_b(s1, scoreobjective)) {
- return false;
- }
- Score score = scoreboard.func_96529_a(s1, scoreobjective);
- int i = score.func_96652_c();
- if(i < ((Integer)entry.getValue()).intValue() && flag) {
- return false;
- }
- if(i > ((Integer)entry.getValue()).intValue() && !flag) {
- return false;
- }
- }
- return true;
- }
- }
- }}));
- }
- private static List<Predicate<Entity>> func_179647_f(Map<String, String> p_179647_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- final String s = func_179651_b(p_179647_0_, field_190848_v);
- final boolean flag = s != null && s.startsWith("!");
- if(flag) {
- s = s.substring(1);
- }
- if(s != null) {
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return p_apply_1_ != null && p_apply_1_.func_70005_c_().equals(s) != flag;
- }
- });
- }
- return list;
- }
- private static List<Predicate<Entity>> func_184951_f(Map<String, String> p_184951_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- final String s = func_179651_b(p_184951_0_, field_190850_x);
- final boolean flag = s != null && s.startsWith("!");
- if(flag) {
- s = s.substring(1);
- }
- if(s != null) {
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- 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);
- }
- });
- }
- return list;
- }
- private static List<Predicate<Entity>> func_180698_a(Map<String, String> p_180698_0_, final Vec3d p_180698_1_) {
- double d0 = (double)func_179653_a(p_180698_0_, field_190832_f, -1);
- double d1 = (double)func_179653_a(p_180698_0_, field_190831_e, -1);
- final boolean flag = d0 < -0.5D;
- final boolean flag1 = d1 < -0.5D;
- if(flag && flag1) {
- return Collections.<Predicate<Entity>>emptyList();
- } else {
- double d2 = Math.max(d0, 1.0E-4D);
- final double d3 = d2 * d2;
- double d4 = Math.max(d1, 1.0E-4D);
- final double d5 = d4 * d4;
- return Lists.newArrayList(new Predicate[]{new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(p_apply_1_ == null) {
- return false;
- } else {
- 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);
- return (flag || d6 >= d3) && (flag1 || d6 <= d5);
- }
- }
- }});
- }
- }
- private static List<Predicate<Entity>> func_179662_g(Map<String, String> p_179662_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- if(p_179662_0_.containsKey(field_190844_r) || p_179662_0_.containsKey(field_190843_q)) {
- final int i = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190844_r, 0));
- final int j = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190843_q, 359));
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(p_apply_1_ == null) {
- return false;
- } else {
- int i1 = MathHelper.func_188209_b(MathHelper.func_76141_d(p_apply_1_.field_70177_z));
- return i > j?i1 >= i || i1 <= j:i1 >= i && i1 <= j;
- }
- }
- });
- }
- if(p_179662_0_.containsKey(field_190842_p) || p_179662_0_.containsKey(field_190841_o)) {
- final int k = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190842_p, 0));
- final int l = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190841_o, 359));
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(p_apply_1_ == null) {
- return false;
- } else {
- int i1 = MathHelper.func_188209_b(MathHelper.func_76141_d(p_apply_1_.field_70125_A));
- return k > l?i1 >= k || i1 <= l:i1 >= k && i1 <= l;
- }
- }
- });
- }
- return list;
- }
- 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_) {
- List<T> list = Lists.<T>newArrayList();
- String s = func_179651_b(p_179660_0_, field_190849_w);
- s = s != null && s.startsWith("!")?s.substring(1):s;
- boolean flag = !p_179660_3_.equals("e");
- boolean flag1 = p_179660_3_.equals("r") && s != null;
- int i = func_179653_a(p_179660_0_, field_190838_l, 0);
- int j = func_179653_a(p_179660_0_, field_190839_m, 0);
- int k = func_179653_a(p_179660_0_, field_190840_n, 0);
- int l = func_179653_a(p_179660_0_, field_190831_e, -1);
- Predicate<Entity> predicate = Predicates.and(p_179660_2_);
- Predicate<Entity> predicate1 = Predicates.<Entity>and(EntitySelectors.field_94557_a, predicate);
- if(!p_179660_0_.containsKey(field_190838_l) && !p_179660_0_.containsKey(field_190839_m) && !p_179660_0_.containsKey(field_190840_n)) {
- if(l >= 0) {
- 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));
- if(flag && !flag1) {
- list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate1));
- } else {
- list.addAll(p_179660_4_.<T>func_175647_a(p_179660_1_, axisalignedbb1, predicate1));
- }
- } else if(p_179660_3_.equals("a")) {
- list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate));
- } else if(!p_179660_3_.equals("p") && (!p_179660_3_.equals("r") || flag1)) {
- list.addAll(p_179660_4_.<T>func_175644_a(p_179660_1_, predicate1));
- } else {
- list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate1));
- }
- } else {
- final AxisAlignedBB axisalignedbb = func_179661_a(p_179660_5_, i, j, k);
- if(flag && !flag1) {
- Predicate<Entity> predicate2 = new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return p_apply_1_ != null && axisalignedbb.func_72326_a(p_apply_1_.func_174813_aQ());
- }
- };
- list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, Predicates.<T>and(predicate1, predicate2)));
- } else {
- list.addAll(p_179660_4_.<T>func_175647_a(p_179660_1_, axisalignedbb, predicate1));
- }
- }
- return list;
- }
- 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_) {
- int i = func_179653_a(p_179658_1_, field_190845_s, !p_179658_4_.equals("a") && !p_179658_4_.equals("e")?1:0);
- if(!p_179658_4_.equals("p") && !p_179658_4_.equals("a") && !p_179658_4_.equals("e")) {
- if(p_179658_4_.equals("r")) {
- Collections.shuffle((List<?>)p_179658_0_);
- }
- } else {
- Collections.sort((List<T>)p_179658_0_, new Comparator<Entity>() {
- public int compare(Entity p_compare_1_, Entity p_compare_2_) {
- 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();
- }
- });
- }
- Entity entity = p_179658_2_.func_174793_f();
- if(entity != null && p_179658_3_.isAssignableFrom(entity.getClass()) && i == 1 && ((List)p_179658_0_).contains(entity) && !"r".equals(p_179658_4_)) {
- p_179658_0_ = Lists.newArrayList(new Entity[]{entity});
- }
- if(i != 0) {
- if(i < 0) {
- Collections.reverse((List<?>)p_179658_0_);
- }
- p_179658_0_ = ((List)p_179658_0_).subList(0, Math.min(Math.abs(i), ((List)p_179658_0_).size()));
- }
- return (List)p_179658_0_;
- }
- private static AxisAlignedBB func_179661_a(BlockPos p_179661_0_, int p_179661_1_, int p_179661_2_, int p_179661_3_) {
- boolean flag = p_179661_1_ < 0;
- boolean flag1 = p_179661_2_ < 0;
- boolean flag2 = p_179661_3_ < 0;
- int i = p_179661_0_.func_177958_n() + (flag?p_179661_1_:0);
- int j = p_179661_0_.func_177956_o() + (flag1?p_179661_2_:0);
- int k = p_179661_0_.func_177952_p() + (flag2?p_179661_3_:0);
- int l = p_179661_0_.func_177958_n() + (flag?0:p_179661_1_) + 1;
- int i1 = p_179661_0_.func_177956_o() + (flag1?0:p_179661_2_) + 1;
- int j1 = p_179661_0_.func_177952_p() + (flag2?0:p_179661_3_) + 1;
- return new AxisAlignedBB((double)i, (double)j, (double)k, (double)l, (double)i1, (double)j1);
- }
- private static BlockPos func_179664_b(Map<String, String> p_179664_0_, BlockPos p_179664_1_) {
- 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()));
- }
- private static Vec3d func_189210_b(Map<String, String> p_189210_0_, Vec3d p_189210_1_) {
- 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));
- }
- private static double func_189211_a(Map<String, String> p_189211_0_, String p_189211_1_, double p_189211_2_, boolean p_189211_4_) {
- 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_;
- }
- private static boolean func_179665_h(Map<String, String> p_179665_0_) {
- for(String s : field_179666_d) {
- if(p_179665_0_.containsKey(s)) {
- return true;
- }
- }
- return false;
- }
- private static int func_179653_a(Map<String, String> p_179653_0_, String p_179653_1_, int p_179653_2_) {
- 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_;
- }
- @Nullable
- private static String func_179651_b(Map<String, String> p_179651_0_, String p_179651_1_) {
- return (String)p_179651_0_.get(p_179651_1_);
- }
- public static Map<String, Integer> func_96560_a(Map<String, String> p_96560_0_) {
- Map<String, Integer> map = Maps.<String, Integer>newHashMap();
- for(String s : p_96560_0_.keySet()) {
- if(s.startsWith("score_") && s.length() > "score_".length()) {
- map.put(s.substring("score_".length()), Integer.valueOf(MathHelper.func_82715_a((String)p_96560_0_.get(s), 1)));
- }
- }
- return map;
- }
- public static boolean func_82377_a(String p_82377_0_) throws CommandException {
- Matcher matcher = field_82389_a.matcher(p_82377_0_);
- if(!matcher.matches()) {
- return false;
- } else {
- Map<String, String> map = func_82381_h(matcher.group(2));
- String s = matcher.group(1);
- int i = !"a".equals(s) && !"e".equals(s)?1:0;
- return func_179653_a(map, field_190845_s, i) != 1;
- }
- }
- public static boolean func_82378_b(String p_82378_0_) {
- return field_82389_a.matcher(p_82378_0_).matches();
- }
- private static Map<String, String> func_82381_h(@Nullable String p_82381_0_) throws CommandException {
- Map<String, String> map = Maps.<String, String>newHashMap();
- if(p_82381_0_ == null) {
- return map;
- } else {
- for(String s : field_190828_b.split(p_82381_0_)) {
- Iterator<String> iterator = field_190829_c.split(s).iterator();
- String s1 = (String)iterator.next();
- if(!field_190851_y.apply(s1)) {
- throw new CommandException("commands.generic.selector_argument", new Object[]{s});
- }
- map.put(s1, iterator.hasNext()?(String)iterator.next():"");
- }
- return map;
- }
- }
- }
- Hunk 3 failed! Cannot find hunk target
- gametype = GameType.func_185328_a(s, GameType.NOT_SET);
- }
- + final GameType type = gametype;
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if (!(p_apply_1_ instanceof EntityPlayerMP)) {
- File state
- package net.minecraft.command;
- import com.google.common.base.Predicate;
- import com.google.common.base.Predicates;
- import com.google.common.base.Splitter;
- import com.google.common.collect.ComparisonChain;
- import com.google.common.collect.Lists;
- import com.google.common.collect.Maps;
- import com.google.common.collect.Sets;
- import java.util.Collections;
- import java.util.Comparator;
- import java.util.Iterator;
- import java.util.List;
- import java.util.Map;
- import java.util.Set;
- import java.util.Map.Entry;
- import java.util.regex.Matcher;
- import java.util.regex.Pattern;
- import javax.annotation.Nullable;
- import net.minecraft.command.CommandBase;
- import net.minecraft.command.CommandException;
- import net.minecraft.command.ICommandSender;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.EntityList;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.entity.player.EntityPlayerMP;
- import net.minecraft.scoreboard.Score;
- import net.minecraft.scoreboard.ScoreObjective;
- import net.minecraft.scoreboard.Scoreboard;
- import net.minecraft.scoreboard.Team;
- import net.minecraft.util.EntitySelectors;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.util.math.AxisAlignedBB;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.util.math.MathHelper;
- import net.minecraft.util.math.Vec3d;
- import net.minecraft.util.text.ITextComponent;
- import net.minecraft.util.text.TextComponentTranslation;
- import net.minecraft.util.text.TextFormatting;
- import net.minecraft.world.GameType;
- import net.minecraft.world.World;
- public class EntitySelector {
- private static final Pattern field_82389_a = Pattern.compile("^@([pares])(?:\\[([^ ]*)\\])?$");
- private static final Splitter field_190828_b = Splitter.on(',').omitEmptyStrings();
- private static final Splitter field_190829_c = Splitter.on('=').limit(2);
- private static final Set<String> field_190830_d = Sets.<String>newHashSet();
- private static final String field_190831_e = func_190826_c("r");
- private static final String field_190832_f = func_190826_c("rm");
- private static final String field_190833_g = func_190826_c("l");
- private static final String field_190834_h = func_190826_c("lm");
- private static final String field_190835_i = func_190826_c("x");
- private static final String field_190836_j = func_190826_c("y");
- private static final String field_190837_k = func_190826_c("z");
- private static final String field_190838_l = func_190826_c("dx");
- private static final String field_190839_m = func_190826_c("dy");
- private static final String field_190840_n = func_190826_c("dz");
- private static final String field_190841_o = func_190826_c("rx");
- private static final String field_190842_p = func_190826_c("rxm");
- private static final String field_190843_q = func_190826_c("ry");
- private static final String field_190844_r = func_190826_c("rym");
- private static final String field_190845_s = func_190826_c("c");
- private static final String field_190846_t = func_190826_c("m");
- private static final String field_190847_u = func_190826_c("team");
- private static final String field_190848_v = func_190826_c("name");
- private static final String field_190849_w = func_190826_c("type");
- private static final String field_190850_x = func_190826_c("tag");
- private static final Predicate<String> field_190851_y = new Predicate<String>() {
- public boolean apply(@Nullable String p_apply_1_) {
- return p_apply_1_ != null && (EntitySelector.field_190830_d.contains(p_apply_1_) || p_apply_1_.length() > "score_".length() && p_apply_1_.startsWith("score_"));
- }
- };
- 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});
- public static String func_190826_c(String p_190826_0_) {
- field_190830_d.add(p_190826_0_);
- return p_190826_0_;
- }
- @Nullable
- public static EntityPlayerMP func_82386_a(ICommandSender p_82386_0_, String p_82386_1_) throws CommandException {
- return (EntityPlayerMP)func_179652_a(p_82386_0_, p_82386_1_, EntityPlayerMP.class);
- }
- public static List<EntityPlayerMP> func_193531_b(ICommandSender p_193531_0_, String p_193531_1_) throws CommandException {
- return func_179656_b(p_193531_0_, p_193531_1_, EntityPlayerMP.class);
- }
- @Nullable
- 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 {
- List<T> list = func_179656_b(p_179652_0_, p_179652_1_, p_179652_2_);
- return (T)(list.size() == 1?(Entity)list.get(0):null);
- }
- @Nullable
- public static ITextComponent func_150869_b(ICommandSender p_150869_0_, String p_150869_1_) throws CommandException {
- List<Entity> list = func_179656_b(p_150869_0_, p_150869_1_, Entity.class);
- if(list.isEmpty()) {
- return null;
- } else {
- List<ITextComponent> list1 = Lists.<ITextComponent>newArrayList();
- for(Entity entity : list) {
- list1.add(entity.func_145748_c_());
- }
- return CommandBase.func_180530_a(list1);
- }
- }
- 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 {
- Matcher matcher = field_82389_a.matcher(p_179656_1_);
- if(matcher.matches() && p_179656_0_.func_70003_b(1, "@")) {
- Map<String, String> map = func_82381_h(matcher.group(2));
- if(!func_179655_b(p_179656_0_, map)) {
- return Collections.<T>emptyList();
- } else {
- String s = matcher.group(1);
- BlockPos blockpos = func_179664_b(map, p_179656_0_.func_180425_c());
- Vec3d vec3d = func_189210_b(map, p_179656_0_.func_174791_d());
- List<World> list = func_179654_a(p_179656_0_, map);
- List<T> list1 = Lists.<T>newArrayList();
- for(World world : list) {
- if(world != null) {
- List<Predicate<Entity>> list2 = Lists.<Predicate<Entity>>newArrayList();
- list2.addAll(func_179663_a(map, s));
- list2.addAll(func_179648_b(map));
- list2.addAll(func_179649_c(map));
- list2.addAll(func_179659_d(map));
- list2.addAll(func_184952_c(p_179656_0_, map));
- list2.addAll(func_179647_f(map));
- list2.addAll(func_184951_f(map));
- list2.addAll(func_180698_a(map, vec3d));
- list2.addAll(func_179662_g(map));
- if("s".equalsIgnoreCase(s)) {
- Entity entity = p_179656_0_.func_174793_f();
- if(entity != null && p_179656_2_.isAssignableFrom(entity.getClass())) {
- if(map.containsKey(field_190838_l) || map.containsKey(field_190839_m) || map.containsKey(field_190840_n)) {
- int i = func_179653_a(map, field_190838_l, 0);
- int j = func_179653_a(map, field_190839_m, 0);
- int k = func_179653_a(map, field_190840_n, 0);
- AxisAlignedBB axisalignedbb = func_179661_a(blockpos, i, j, k);
- if(!axisalignedbb.func_72326_a(entity.func_174813_aQ())) {
- return Collections.<T>emptyList();
- }
- }
- for(Predicate<Entity> predicate : list2) {
- if(!predicate.apply(entity)) {
- return Collections.<T>emptyList();
- }
- }
- return Lists.newArrayList(new Entity[]{entity});
- }
- return Collections.<T>emptyList();
- }
- list1.addAll(func_179660_a(map, p_179656_2_, list2, s, world, blockpos));
- }
- }
- return func_179658_a(list1, map, p_179656_0_, p_179656_2_, s, vec3d);
- }
- } else {
- return Collections.<T>emptyList();
- }
- }
- private static List<World> func_179654_a(ICommandSender p_179654_0_, Map<String, String> p_179654_1_) {
- List<World> list = Lists.<World>newArrayList();
- if(func_179665_h(p_179654_1_)) {
- list.add(p_179654_0_.func_130014_f_());
- } else {
- Collections.addAll(list, p_179654_0_.func_184102_h().field_71305_c);
- }
- return list;
- }
- private static <T extends Entity> boolean func_179655_b(ICommandSender p_179655_0_, Map<String, String> p_179655_1_) {
- String s = func_179651_b(p_179655_1_, field_190849_w);
- if(s == null) {
- return true;
- } else {
- ResourceLocation resourcelocation = new ResourceLocation(s.startsWith("!")?s.substring(1):s);
- if(EntityList.func_180125_b(resourcelocation)) {
- return true;
- } else {
- TextComponentTranslation textcomponenttranslation = new TextComponentTranslation("commands.generic.entity.invalidType", new Object[]{resourcelocation});
- textcomponenttranslation.func_150256_b().func_150238_a(TextFormatting.RED);
- p_179655_0_.func_145747_a(textcomponenttranslation);
- return false;
- }
- }
- }
- private static List<Predicate<Entity>> func_179663_a(Map<String, String> p_179663_0_, String p_179663_1_) {
- String s = func_179651_b(p_179663_0_, field_190849_w);
- if(s == null || !p_179663_1_.equals("e") && !p_179663_1_.equals("r") && !p_179663_1_.equals("s")) {
- return !p_179663_1_.equals("e") && !p_179663_1_.equals("s")?Collections.singletonList(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return p_apply_1_ instanceof EntityPlayer;
- }
- }):Collections.emptyList();
- } else {
- final boolean flag = s.startsWith("!");
- final ResourceLocation resourcelocation = new ResourceLocation(flag?s.substring(1):s);
- return Collections.singletonList(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return EntityList.func_180123_a(p_apply_1_, resourcelocation) != flag;
- }
- });
- }
- }
- private static List<Predicate<Entity>> func_179648_b(Map<String, String> p_179648_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- final int i = func_179653_a(p_179648_0_, field_190834_h, -1);
- final int j = func_179653_a(p_179648_0_, field_190833_g, -1);
- if(i > -1 || j > -1) {
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(!(p_apply_1_ instanceof EntityPlayerMP)) {
- return false;
- } else {
- EntityPlayerMP entityplayermp = (EntityPlayerMP)p_apply_1_;
- return (i <= -1 || entityplayermp.field_71068_ca >= i) && (j <= -1 || entityplayermp.field_71068_ca <= j);
- }
- }
- });
- }
- return list;
- }
- private static List<Predicate<Entity>> func_179649_c(Map<String, String> p_179649_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- String s = func_179651_b(p_179649_0_, field_190846_t);
- if(s == null) {
- return list;
- } else {
- final boolean flag = s.startsWith("!");
- if(flag) {
- s = s.substring(1);
- }
- final GameType gametype;
- try {
- int i = Integer.parseInt(s);
- gametype = GameType.func_185329_a(i, GameType.NOT_SET);
- } catch (Throwable var6) {
- gametype = GameType.func_185328_a(s, GameType.NOT_SET);
- }
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(!(p_apply_1_ instanceof EntityPlayerMP)) {
- return false;
- } else {
- EntityPlayerMP entityplayermp = (EntityPlayerMP)p_apply_1_;
- GameType gametype1 = entityplayermp.field_71134_c.func_73081_b();
- return flag?gametype1 != gametype:gametype1 == gametype;
- }
- }
- });
- return list;
- }
- }
- private static List<Predicate<Entity>> func_179659_d(Map<String, String> p_179659_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- final String s = func_179651_b(p_179659_0_, field_190847_u);
- final boolean flag = s != null && s.startsWith("!");
- if(flag) {
- s = s.substring(1);
- }
- if(s != null) {
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(!(p_apply_1_ instanceof EntityLivingBase)) {
- return false;
- } else {
- EntityLivingBase entitylivingbase = (EntityLivingBase)p_apply_1_;
- Team team = entitylivingbase.func_96124_cp();
- String s1 = team == null?"":team.func_96661_b();
- return s1.equals(s) != flag;
- }
- }
- });
- }
- return list;
- }
- private static List<Predicate<Entity>> func_184952_c(final ICommandSender p_184952_0_, Map<String, String> p_184952_1_) {
- final Map<String, Integer> map = func_96560_a(p_184952_1_);
- return (List<Predicate<Entity>>)(map.isEmpty()?Collections.emptyList():Lists.newArrayList(new Predicate[]{new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(p_apply_1_ == null) {
- return false;
- } else {
- Scoreboard scoreboard = p_184952_0_.func_184102_h().func_71218_a(0).func_96441_U();
- for(Entry<String, Integer> entry : map.entrySet()) {
- String s = (String)entry.getKey();
- boolean flag = false;
- if(s.endsWith("_min") && s.length() > 4) {
- flag = true;
- s = s.substring(0, s.length() - 4);
- }
- ScoreObjective scoreobjective = scoreboard.func_96518_b(s);
- if(scoreobjective == null) {
- return false;
- }
- String s1 = p_apply_1_ instanceof EntityPlayerMP?p_apply_1_.func_70005_c_():p_apply_1_.func_189512_bd();
- if(!scoreboard.func_178819_b(s1, scoreobjective)) {
- return false;
- }
- Score score = scoreboard.func_96529_a(s1, scoreobjective);
- int i = score.func_96652_c();
- if(i < ((Integer)entry.getValue()).intValue() && flag) {
- return false;
- }
- if(i > ((Integer)entry.getValue()).intValue() && !flag) {
- return false;
- }
- }
- return true;
- }
- }
- }}));
- }
- private static List<Predicate<Entity>> func_179647_f(Map<String, String> p_179647_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- final String s = func_179651_b(p_179647_0_, field_190848_v);
- final boolean flag = s != null && s.startsWith("!");
- if(flag) {
- s = s.substring(1);
- }
- if(s != null) {
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return p_apply_1_ != null && p_apply_1_.func_70005_c_().equals(s) != flag;
- }
- });
- }
- return list;
- }
- private static List<Predicate<Entity>> func_184951_f(Map<String, String> p_184951_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- final String s = func_179651_b(p_184951_0_, field_190850_x);
- final boolean flag = s != null && s.startsWith("!");
- if(flag) {
- s = s.substring(1);
- }
- if(s != null) {
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- 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);
- }
- });
- }
- return list;
- }
- private static List<Predicate<Entity>> func_180698_a(Map<String, String> p_180698_0_, final Vec3d p_180698_1_) {
- double d0 = (double)func_179653_a(p_180698_0_, field_190832_f, -1);
- double d1 = (double)func_179653_a(p_180698_0_, field_190831_e, -1);
- final boolean flag = d0 < -0.5D;
- final boolean flag1 = d1 < -0.5D;
- if(flag && flag1) {
- return Collections.<Predicate<Entity>>emptyList();
- } else {
- double d2 = Math.max(d0, 1.0E-4D);
- final double d3 = d2 * d2;
- double d4 = Math.max(d1, 1.0E-4D);
- final double d5 = d4 * d4;
- return Lists.newArrayList(new Predicate[]{new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(p_apply_1_ == null) {
- return false;
- } else {
- 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);
- return (flag || d6 >= d3) && (flag1 || d6 <= d5);
- }
- }
- }});
- }
- }
- private static List<Predicate<Entity>> func_179662_g(Map<String, String> p_179662_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- if(p_179662_0_.containsKey(field_190844_r) || p_179662_0_.containsKey(field_190843_q)) {
- final int i = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190844_r, 0));
- final int j = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190843_q, 359));
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(p_apply_1_ == null) {
- return false;
- } else {
- int i1 = MathHelper.func_188209_b(MathHelper.func_76141_d(p_apply_1_.field_70177_z));
- return i > j?i1 >= i || i1 <= j:i1 >= i && i1 <= j;
- }
- }
- });
- }
- if(p_179662_0_.containsKey(field_190842_p) || p_179662_0_.containsKey(field_190841_o)) {
- final int k = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190842_p, 0));
- final int l = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190841_o, 359));
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(p_apply_1_ == null) {
- return false;
- } else {
- int i1 = MathHelper.func_188209_b(MathHelper.func_76141_d(p_apply_1_.field_70125_A));
- return k > l?i1 >= k || i1 <= l:i1 >= k && i1 <= l;
- }
- }
- });
- }
- return list;
- }
- 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_) {
- List<T> list = Lists.<T>newArrayList();
- String s = func_179651_b(p_179660_0_, field_190849_w);
- s = s != null && s.startsWith("!")?s.substring(1):s;
- boolean flag = !p_179660_3_.equals("e");
- boolean flag1 = p_179660_3_.equals("r") && s != null;
- int i = func_179653_a(p_179660_0_, field_190838_l, 0);
- int j = func_179653_a(p_179660_0_, field_190839_m, 0);
- int k = func_179653_a(p_179660_0_, field_190840_n, 0);
- int l = func_179653_a(p_179660_0_, field_190831_e, -1);
- Predicate<Entity> predicate = Predicates.and(p_179660_2_);
- Predicate<Entity> predicate1 = Predicates.<Entity>and(EntitySelectors.field_94557_a, predicate);
- if(!p_179660_0_.containsKey(field_190838_l) && !p_179660_0_.containsKey(field_190839_m) && !p_179660_0_.containsKey(field_190840_n)) {
- if(l >= 0) {
- 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));
- if(flag && !flag1) {
- list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate1));
- } else {
- list.addAll(p_179660_4_.<T>func_175647_a(p_179660_1_, axisalignedbb1, predicate1));
- }
- } else if(p_179660_3_.equals("a")) {
- list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate));
- } else if(!p_179660_3_.equals("p") && (!p_179660_3_.equals("r") || flag1)) {
- list.addAll(p_179660_4_.<T>func_175644_a(p_179660_1_, predicate1));
- } else {
- list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate1));
- }
- } else {
- final AxisAlignedBB axisalignedbb = func_179661_a(p_179660_5_, i, j, k);
- if(flag && !flag1) {
- Predicate<Entity> predicate2 = new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return p_apply_1_ != null && axisalignedbb.func_72326_a(p_apply_1_.func_174813_aQ());
- }
- };
- list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, Predicates.<T>and(predicate1, predicate2)));
- } else {
- list.addAll(p_179660_4_.<T>func_175647_a(p_179660_1_, axisalignedbb, predicate1));
- }
- }
- return list;
- }
- 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_) {
- int i = func_179653_a(p_179658_1_, field_190845_s, !p_179658_4_.equals("a") && !p_179658_4_.equals("e")?1:0);
- if(!p_179658_4_.equals("p") && !p_179658_4_.equals("a") && !p_179658_4_.equals("e")) {
- if(p_179658_4_.equals("r")) {
- Collections.shuffle((List<?>)p_179658_0_);
- }
- } else {
- Collections.sort((List<T>)p_179658_0_, new Comparator<Entity>() {
- public int compare(Entity p_compare_1_, Entity p_compare_2_) {
- 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();
- }
- });
- }
- Entity entity = p_179658_2_.func_174793_f();
- if(entity != null && p_179658_3_.isAssignableFrom(entity.getClass()) && i == 1 && ((List)p_179658_0_).contains(entity) && !"r".equals(p_179658_4_)) {
- p_179658_0_ = Lists.newArrayList(new Entity[]{entity});
- }
- if(i != 0) {
- if(i < 0) {
- Collections.reverse((List<?>)p_179658_0_);
- }
- p_179658_0_ = ((List)p_179658_0_).subList(0, Math.min(Math.abs(i), ((List)p_179658_0_).size()));
- }
- return (List)p_179658_0_;
- }
- private static AxisAlignedBB func_179661_a(BlockPos p_179661_0_, int p_179661_1_, int p_179661_2_, int p_179661_3_) {
- boolean flag = p_179661_1_ < 0;
- boolean flag1 = p_179661_2_ < 0;
- boolean flag2 = p_179661_3_ < 0;
- int i = p_179661_0_.func_177958_n() + (flag?p_179661_1_:0);
- int j = p_179661_0_.func_177956_o() + (flag1?p_179661_2_:0);
- int k = p_179661_0_.func_177952_p() + (flag2?p_179661_3_:0);
- int l = p_179661_0_.func_177958_n() + (flag?0:p_179661_1_) + 1;
- int i1 = p_179661_0_.func_177956_o() + (flag1?0:p_179661_2_) + 1;
- int j1 = p_179661_0_.func_177952_p() + (flag2?0:p_179661_3_) + 1;
- return new AxisAlignedBB((double)i, (double)j, (double)k, (double)l, (double)i1, (double)j1);
- }
- private static BlockPos func_179664_b(Map<String, String> p_179664_0_, BlockPos p_179664_1_) {
- 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()));
- }
- private static Vec3d func_189210_b(Map<String, String> p_189210_0_, Vec3d p_189210_1_) {
- 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));
- }
- private static double func_189211_a(Map<String, String> p_189211_0_, String p_189211_1_, double p_189211_2_, boolean p_189211_4_) {
- 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_;
- }
- private static boolean func_179665_h(Map<String, String> p_179665_0_) {
- for(String s : field_179666_d) {
- if(p_179665_0_.containsKey(s)) {
- return true;
- }
- }
- return false;
- }
- private static int func_179653_a(Map<String, String> p_179653_0_, String p_179653_1_, int p_179653_2_) {
- 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_;
- }
- @Nullable
- private static String func_179651_b(Map<String, String> p_179651_0_, String p_179651_1_) {
- return (String)p_179651_0_.get(p_179651_1_);
- }
- public static Map<String, Integer> func_96560_a(Map<String, String> p_96560_0_) {
- Map<String, Integer> map = Maps.<String, Integer>newHashMap();
- for(String s : p_96560_0_.keySet()) {
- if(s.startsWith("score_") && s.length() > "score_".length()) {
- map.put(s.substring("score_".length()), Integer.valueOf(MathHelper.func_82715_a((String)p_96560_0_.get(s), 1)));
- }
- }
- return map;
- }
- public static boolean func_82377_a(String p_82377_0_) throws CommandException {
- Matcher matcher = field_82389_a.matcher(p_82377_0_);
- if(!matcher.matches()) {
- return false;
- } else {
- Map<String, String> map = func_82381_h(matcher.group(2));
- String s = matcher.group(1);
- int i = !"a".equals(s) && !"e".equals(s)?1:0;
- return func_179653_a(map, field_190845_s, i) != 1;
- }
- }
- public static boolean func_82378_b(String p_82378_0_) {
- return field_82389_a.matcher(p_82378_0_).matches();
- }
- private static Map<String, String> func_82381_h(@Nullable String p_82381_0_) throws CommandException {
- Map<String, String> map = Maps.<String, String>newHashMap();
- if(p_82381_0_ == null) {
- return map;
- } else {
- for(String s : field_190828_b.split(p_82381_0_)) {
- Iterator<String> iterator = field_190829_c.split(s).iterator();
- String s1 = (String)iterator.next();
- if(!field_190851_y.apply(s1)) {
- throw new CommandException("commands.generic.selector_argument", new Object[]{s});
- }
- map.put(s1, iterator.hasNext()?(String)iterator.next():"");
- }
- return map;
- }
- }
- }
- Hunk 4 failed! Cannot find hunk target
- } else {
- EntityPlayerMP entityplayermp = (EntityPlayerMP)p_apply_1_;
- GameType gametype1 = entityplayermp.field_71134_c.func_73081_b();
- - return flag ? gametype1 != gametype : gametype1 == gametype;
- + return flag ? gametype1 != type : gametype1 == type;
- }
- }
- });
- File state
- package net.minecraft.command;
- import com.google.common.base.Predicate;
- import com.google.common.base.Predicates;
- import com.google.common.base.Splitter;
- import com.google.common.collect.ComparisonChain;
- import com.google.common.collect.Lists;
- import com.google.common.collect.Maps;
- import com.google.common.collect.Sets;
- import java.util.Collections;
- import java.util.Comparator;
- import java.util.Iterator;
- import java.util.List;
- import java.util.Map;
- import java.util.Set;
- import java.util.Map.Entry;
- import java.util.regex.Matcher;
- import java.util.regex.Pattern;
- import javax.annotation.Nullable;
- import net.minecraft.command.CommandBase;
- import net.minecraft.command.CommandException;
- import net.minecraft.command.ICommandSender;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.EntityList;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.entity.player.EntityPlayerMP;
- import net.minecraft.scoreboard.Score;
- import net.minecraft.scoreboard.ScoreObjective;
- import net.minecraft.scoreboard.Scoreboard;
- import net.minecraft.scoreboard.Team;
- import net.minecraft.util.EntitySelectors;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.util.math.AxisAlignedBB;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.util.math.MathHelper;
- import net.minecraft.util.math.Vec3d;
- import net.minecraft.util.text.ITextComponent;
- import net.minecraft.util.text.TextComponentTranslation;
- import net.minecraft.util.text.TextFormatting;
- import net.minecraft.world.GameType;
- import net.minecraft.world.World;
- public class EntitySelector {
- private static final Pattern field_82389_a = Pattern.compile("^@([pares])(?:\\[([^ ]*)\\])?$");
- private static final Splitter field_190828_b = Splitter.on(',').omitEmptyStrings();
- private static final Splitter field_190829_c = Splitter.on('=').limit(2);
- private static final Set<String> field_190830_d = Sets.<String>newHashSet();
- private static final String field_190831_e = func_190826_c("r");
- private static final String field_190832_f = func_190826_c("rm");
- private static final String field_190833_g = func_190826_c("l");
- private static final String field_190834_h = func_190826_c("lm");
- private static final String field_190835_i = func_190826_c("x");
- private static final String field_190836_j = func_190826_c("y");
- private static final String field_190837_k = func_190826_c("z");
- private static final String field_190838_l = func_190826_c("dx");
- private static final String field_190839_m = func_190826_c("dy");
- private static final String field_190840_n = func_190826_c("dz");
- private static final String field_190841_o = func_190826_c("rx");
- private static final String field_190842_p = func_190826_c("rxm");
- private static final String field_190843_q = func_190826_c("ry");
- private static final String field_190844_r = func_190826_c("rym");
- private static final String field_190845_s = func_190826_c("c");
- private static final String field_190846_t = func_190826_c("m");
- private static final String field_190847_u = func_190826_c("team");
- private static final String field_190848_v = func_190826_c("name");
- private static final String field_190849_w = func_190826_c("type");
- private static final String field_190850_x = func_190826_c("tag");
- private static final Predicate<String> field_190851_y = new Predicate<String>() {
- public boolean apply(@Nullable String p_apply_1_) {
- return p_apply_1_ != null && (EntitySelector.field_190830_d.contains(p_apply_1_) || p_apply_1_.length() > "score_".length() && p_apply_1_.startsWith("score_"));
- }
- };
- 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});
- public static String func_190826_c(String p_190826_0_) {
- field_190830_d.add(p_190826_0_);
- return p_190826_0_;
- }
- @Nullable
- public static EntityPlayerMP func_82386_a(ICommandSender p_82386_0_, String p_82386_1_) throws CommandException {
- return (EntityPlayerMP)func_179652_a(p_82386_0_, p_82386_1_, EntityPlayerMP.class);
- }
- public static List<EntityPlayerMP> func_193531_b(ICommandSender p_193531_0_, String p_193531_1_) throws CommandException {
- return func_179656_b(p_193531_0_, p_193531_1_, EntityPlayerMP.class);
- }
- @Nullable
- 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 {
- List<T> list = func_179656_b(p_179652_0_, p_179652_1_, p_179652_2_);
- return (T)(list.size() == 1?(Entity)list.get(0):null);
- }
- @Nullable
- public static ITextComponent func_150869_b(ICommandSender p_150869_0_, String p_150869_1_) throws CommandException {
- List<Entity> list = func_179656_b(p_150869_0_, p_150869_1_, Entity.class);
- if(list.isEmpty()) {
- return null;
- } else {
- List<ITextComponent> list1 = Lists.<ITextComponent>newArrayList();
- for(Entity entity : list) {
- list1.add(entity.func_145748_c_());
- }
- return CommandBase.func_180530_a(list1);
- }
- }
- 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 {
- Matcher matcher = field_82389_a.matcher(p_179656_1_);
- if(matcher.matches() && p_179656_0_.func_70003_b(1, "@")) {
- Map<String, String> map = func_82381_h(matcher.group(2));
- if(!func_179655_b(p_179656_0_, map)) {
- return Collections.<T>emptyList();
- } else {
- String s = matcher.group(1);
- BlockPos blockpos = func_179664_b(map, p_179656_0_.func_180425_c());
- Vec3d vec3d = func_189210_b(map, p_179656_0_.func_174791_d());
- List<World> list = func_179654_a(p_179656_0_, map);
- List<T> list1 = Lists.<T>newArrayList();
- for(World world : list) {
- if(world != null) {
- List<Predicate<Entity>> list2 = Lists.<Predicate<Entity>>newArrayList();
- list2.addAll(func_179663_a(map, s));
- list2.addAll(func_179648_b(map));
- list2.addAll(func_179649_c(map));
- list2.addAll(func_179659_d(map));
- list2.addAll(func_184952_c(p_179656_0_, map));
- list2.addAll(func_179647_f(map));
- list2.addAll(func_184951_f(map));
- list2.addAll(func_180698_a(map, vec3d));
- list2.addAll(func_179662_g(map));
- if("s".equalsIgnoreCase(s)) {
- Entity entity = p_179656_0_.func_174793_f();
- if(entity != null && p_179656_2_.isAssignableFrom(entity.getClass())) {
- if(map.containsKey(field_190838_l) || map.containsKey(field_190839_m) || map.containsKey(field_190840_n)) {
- int i = func_179653_a(map, field_190838_l, 0);
- int j = func_179653_a(map, field_190839_m, 0);
- int k = func_179653_a(map, field_190840_n, 0);
- AxisAlignedBB axisalignedbb = func_179661_a(blockpos, i, j, k);
- if(!axisalignedbb.func_72326_a(entity.func_174813_aQ())) {
- return Collections.<T>emptyList();
- }
- }
- for(Predicate<Entity> predicate : list2) {
- if(!predicate.apply(entity)) {
- return Collections.<T>emptyList();
- }
- }
- return Lists.newArrayList(new Entity[]{entity});
- }
- return Collections.<T>emptyList();
- }
- list1.addAll(func_179660_a(map, p_179656_2_, list2, s, world, blockpos));
- }
- }
- return func_179658_a(list1, map, p_179656_0_, p_179656_2_, s, vec3d);
- }
- } else {
- return Collections.<T>emptyList();
- }
- }
- private static List<World> func_179654_a(ICommandSender p_179654_0_, Map<String, String> p_179654_1_) {
- List<World> list = Lists.<World>newArrayList();
- if(func_179665_h(p_179654_1_)) {
- list.add(p_179654_0_.func_130014_f_());
- } else {
- Collections.addAll(list, p_179654_0_.func_184102_h().field_71305_c);
- }
- return list;
- }
- private static <T extends Entity> boolean func_179655_b(ICommandSender p_179655_0_, Map<String, String> p_179655_1_) {
- String s = func_179651_b(p_179655_1_, field_190849_w);
- if(s == null) {
- return true;
- } else {
- ResourceLocation resourcelocation = new ResourceLocation(s.startsWith("!")?s.substring(1):s);
- if(EntityList.func_180125_b(resourcelocation)) {
- return true;
- } else {
- TextComponentTranslation textcomponenttranslation = new TextComponentTranslation("commands.generic.entity.invalidType", new Object[]{resourcelocation});
- textcomponenttranslation.func_150256_b().func_150238_a(TextFormatting.RED);
- p_179655_0_.func_145747_a(textcomponenttranslation);
- return false;
- }
- }
- }
- private static List<Predicate<Entity>> func_179663_a(Map<String, String> p_179663_0_, String p_179663_1_) {
- String s = func_179651_b(p_179663_0_, field_190849_w);
- if(s == null || !p_179663_1_.equals("e") && !p_179663_1_.equals("r") && !p_179663_1_.equals("s")) {
- return !p_179663_1_.equals("e") && !p_179663_1_.equals("s")?Collections.singletonList(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return p_apply_1_ instanceof EntityPlayer;
- }
- }):Collections.emptyList();
- } else {
- final boolean flag = s.startsWith("!");
- final ResourceLocation resourcelocation = new ResourceLocation(flag?s.substring(1):s);
- return Collections.singletonList(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return EntityList.func_180123_a(p_apply_1_, resourcelocation) != flag;
- }
- });
- }
- }
- private static List<Predicate<Entity>> func_179648_b(Map<String, String> p_179648_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- final int i = func_179653_a(p_179648_0_, field_190834_h, -1);
- final int j = func_179653_a(p_179648_0_, field_190833_g, -1);
- if(i > -1 || j > -1) {
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(!(p_apply_1_ instanceof EntityPlayerMP)) {
- return false;
- } else {
- EntityPlayerMP entityplayermp = (EntityPlayerMP)p_apply_1_;
- return (i <= -1 || entityplayermp.field_71068_ca >= i) && (j <= -1 || entityplayermp.field_71068_ca <= j);
- }
- }
- });
- }
- return list;
- }
- private static List<Predicate<Entity>> func_179649_c(Map<String, String> p_179649_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- String s = func_179651_b(p_179649_0_, field_190846_t);
- if(s == null) {
- return list;
- } else {
- final boolean flag = s.startsWith("!");
- if(flag) {
- s = s.substring(1);
- }
- final GameType gametype;
- try {
- int i = Integer.parseInt(s);
- gametype = GameType.func_185329_a(i, GameType.NOT_SET);
- } catch (Throwable var6) {
- gametype = GameType.func_185328_a(s, GameType.NOT_SET);
- }
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(!(p_apply_1_ instanceof EntityPlayerMP)) {
- return false;
- } else {
- EntityPlayerMP entityplayermp = (EntityPlayerMP)p_apply_1_;
- GameType gametype1 = entityplayermp.field_71134_c.func_73081_b();
- return flag?gametype1 != gametype:gametype1 == gametype;
- }
- }
- });
- return list;
- }
- }
- private static List<Predicate<Entity>> func_179659_d(Map<String, String> p_179659_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- final String s = func_179651_b(p_179659_0_, field_190847_u);
- final boolean flag = s != null && s.startsWith("!");
- if(flag) {
- s = s.substring(1);
- }
- if(s != null) {
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(!(p_apply_1_ instanceof EntityLivingBase)) {
- return false;
- } else {
- EntityLivingBase entitylivingbase = (EntityLivingBase)p_apply_1_;
- Team team = entitylivingbase.func_96124_cp();
- String s1 = team == null?"":team.func_96661_b();
- return s1.equals(s) != flag;
- }
- }
- });
- }
- return list;
- }
- private static List<Predicate<Entity>> func_184952_c(final ICommandSender p_184952_0_, Map<String, String> p_184952_1_) {
- final Map<String, Integer> map = func_96560_a(p_184952_1_);
- return (List<Predicate<Entity>>)(map.isEmpty()?Collections.emptyList():Lists.newArrayList(new Predicate[]{new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(p_apply_1_ == null) {
- return false;
- } else {
- Scoreboard scoreboard = p_184952_0_.func_184102_h().func_71218_a(0).func_96441_U();
- for(Entry<String, Integer> entry : map.entrySet()) {
- String s = (String)entry.getKey();
- boolean flag = false;
- if(s.endsWith("_min") && s.length() > 4) {
- flag = true;
- s = s.substring(0, s.length() - 4);
- }
- ScoreObjective scoreobjective = scoreboard.func_96518_b(s);
- if(scoreobjective == null) {
- return false;
- }
- String s1 = p_apply_1_ instanceof EntityPlayerMP?p_apply_1_.func_70005_c_():p_apply_1_.func_189512_bd();
- if(!scoreboard.func_178819_b(s1, scoreobjective)) {
- return false;
- }
- Score score = scoreboard.func_96529_a(s1, scoreobjective);
- int i = score.func_96652_c();
- if(i < ((Integer)entry.getValue()).intValue() && flag) {
- return false;
- }
- if(i > ((Integer)entry.getValue()).intValue() && !flag) {
- return false;
- }
- }
- return true;
- }
- }
- }}));
- }
- private static List<Predicate<Entity>> func_179647_f(Map<String, String> p_179647_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- final String s = func_179651_b(p_179647_0_, field_190848_v);
- final boolean flag = s != null && s.startsWith("!");
- if(flag) {
- s = s.substring(1);
- }
- if(s != null) {
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return p_apply_1_ != null && p_apply_1_.func_70005_c_().equals(s) != flag;
- }
- });
- }
- return list;
- }
- private static List<Predicate<Entity>> func_184951_f(Map<String, String> p_184951_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- final String s = func_179651_b(p_184951_0_, field_190850_x);
- final boolean flag = s != null && s.startsWith("!");
- if(flag) {
- s = s.substring(1);
- }
- if(s != null) {
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- 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);
- }
- });
- }
- return list;
- }
- private static List<Predicate<Entity>> func_180698_a(Map<String, String> p_180698_0_, final Vec3d p_180698_1_) {
- double d0 = (double)func_179653_a(p_180698_0_, field_190832_f, -1);
- double d1 = (double)func_179653_a(p_180698_0_, field_190831_e, -1);
- final boolean flag = d0 < -0.5D;
- final boolean flag1 = d1 < -0.5D;
- if(flag && flag1) {
- return Collections.<Predicate<Entity>>emptyList();
- } else {
- double d2 = Math.max(d0, 1.0E-4D);
- final double d3 = d2 * d2;
- double d4 = Math.max(d1, 1.0E-4D);
- final double d5 = d4 * d4;
- return Lists.newArrayList(new Predicate[]{new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(p_apply_1_ == null) {
- return false;
- } else {
- 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);
- return (flag || d6 >= d3) && (flag1 || d6 <= d5);
- }
- }
- }});
- }
- }
- private static List<Predicate<Entity>> func_179662_g(Map<String, String> p_179662_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- if(p_179662_0_.containsKey(field_190844_r) || p_179662_0_.containsKey(field_190843_q)) {
- final int i = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190844_r, 0));
- final int j = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190843_q, 359));
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(p_apply_1_ == null) {
- return false;
- } else {
- int i1 = MathHelper.func_188209_b(MathHelper.func_76141_d(p_apply_1_.field_70177_z));
- return i > j?i1 >= i || i1 <= j:i1 >= i && i1 <= j;
- }
- }
- });
- }
- if(p_179662_0_.containsKey(field_190842_p) || p_179662_0_.containsKey(field_190841_o)) {
- final int k = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190842_p, 0));
- final int l = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190841_o, 359));
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(p_apply_1_ == null) {
- return false;
- } else {
- int i1 = MathHelper.func_188209_b(MathHelper.func_76141_d(p_apply_1_.field_70125_A));
- return k > l?i1 >= k || i1 <= l:i1 >= k && i1 <= l;
- }
- }
- });
- }
- return list;
- }
- 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_) {
- List<T> list = Lists.<T>newArrayList();
- String s = func_179651_b(p_179660_0_, field_190849_w);
- s = s != null && s.startsWith("!")?s.substring(1):s;
- boolean flag = !p_179660_3_.equals("e");
- boolean flag1 = p_179660_3_.equals("r") && s != null;
- int i = func_179653_a(p_179660_0_, field_190838_l, 0);
- int j = func_179653_a(p_179660_0_, field_190839_m, 0);
- int k = func_179653_a(p_179660_0_, field_190840_n, 0);
- int l = func_179653_a(p_179660_0_, field_190831_e, -1);
- Predicate<Entity> predicate = Predicates.and(p_179660_2_);
- Predicate<Entity> predicate1 = Predicates.<Entity>and(EntitySelectors.field_94557_a, predicate);
- if(!p_179660_0_.containsKey(field_190838_l) && !p_179660_0_.containsKey(field_190839_m) && !p_179660_0_.containsKey(field_190840_n)) {
- if(l >= 0) {
- 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));
- if(flag && !flag1) {
- list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate1));
- } else {
- list.addAll(p_179660_4_.<T>func_175647_a(p_179660_1_, axisalignedbb1, predicate1));
- }
- } else if(p_179660_3_.equals("a")) {
- list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate));
- } else if(!p_179660_3_.equals("p") && (!p_179660_3_.equals("r") || flag1)) {
- list.addAll(p_179660_4_.<T>func_175644_a(p_179660_1_, predicate1));
- } else {
- list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate1));
- }
- } else {
- final AxisAlignedBB axisalignedbb = func_179661_a(p_179660_5_, i, j, k);
- if(flag && !flag1) {
- Predicate<Entity> predicate2 = new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return p_apply_1_ != null && axisalignedbb.func_72326_a(p_apply_1_.func_174813_aQ());
- }
- };
- list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, Predicates.<T>and(predicate1, predicate2)));
- } else {
- list.addAll(p_179660_4_.<T>func_175647_a(p_179660_1_, axisalignedbb, predicate1));
- }
- }
- return list;
- }
- 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_) {
- int i = func_179653_a(p_179658_1_, field_190845_s, !p_179658_4_.equals("a") && !p_179658_4_.equals("e")?1:0);
- if(!p_179658_4_.equals("p") && !p_179658_4_.equals("a") && !p_179658_4_.equals("e")) {
- if(p_179658_4_.equals("r")) {
- Collections.shuffle((List<?>)p_179658_0_);
- }
- } else {
- Collections.sort((List<T>)p_179658_0_, new Comparator<Entity>() {
- public int compare(Entity p_compare_1_, Entity p_compare_2_) {
- 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();
- }
- });
- }
- Entity entity = p_179658_2_.func_174793_f();
- if(entity != null && p_179658_3_.isAssignableFrom(entity.getClass()) && i == 1 && ((List)p_179658_0_).contains(entity) && !"r".equals(p_179658_4_)) {
- p_179658_0_ = Lists.newArrayList(new Entity[]{entity});
- }
- if(i != 0) {
- if(i < 0) {
- Collections.reverse((List<?>)p_179658_0_);
- }
- p_179658_0_ = ((List)p_179658_0_).subList(0, Math.min(Math.abs(i), ((List)p_179658_0_).size()));
- }
- return (List)p_179658_0_;
- }
- private static AxisAlignedBB func_179661_a(BlockPos p_179661_0_, int p_179661_1_, int p_179661_2_, int p_179661_3_) {
- boolean flag = p_179661_1_ < 0;
- boolean flag1 = p_179661_2_ < 0;
- boolean flag2 = p_179661_3_ < 0;
- int i = p_179661_0_.func_177958_n() + (flag?p_179661_1_:0);
- int j = p_179661_0_.func_177956_o() + (flag1?p_179661_2_:0);
- int k = p_179661_0_.func_177952_p() + (flag2?p_179661_3_:0);
- int l = p_179661_0_.func_177958_n() + (flag?0:p_179661_1_) + 1;
- int i1 = p_179661_0_.func_177956_o() + (flag1?0:p_179661_2_) + 1;
- int j1 = p_179661_0_.func_177952_p() + (flag2?0:p_179661_3_) + 1;
- return new AxisAlignedBB((double)i, (double)j, (double)k, (double)l, (double)i1, (double)j1);
- }
- private static BlockPos func_179664_b(Map<String, String> p_179664_0_, BlockPos p_179664_1_) {
- 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()));
- }
- private static Vec3d func_189210_b(Map<String, String> p_189210_0_, Vec3d p_189210_1_) {
- 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));
- }
- private static double func_189211_a(Map<String, String> p_189211_0_, String p_189211_1_, double p_189211_2_, boolean p_189211_4_) {
- 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_;
- }
- private static boolean func_179665_h(Map<String, String> p_179665_0_) {
- for(String s : field_179666_d) {
- if(p_179665_0_.containsKey(s)) {
- return true;
- }
- }
- return false;
- }
- private static int func_179653_a(Map<String, String> p_179653_0_, String p_179653_1_, int p_179653_2_) {
- 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_;
- }
- @Nullable
- private static String func_179651_b(Map<String, String> p_179651_0_, String p_179651_1_) {
- return (String)p_179651_0_.get(p_179651_1_);
- }
- public static Map<String, Integer> func_96560_a(Map<String, String> p_96560_0_) {
- Map<String, Integer> map = Maps.<String, Integer>newHashMap();
- for(String s : p_96560_0_.keySet()) {
- if(s.startsWith("score_") && s.length() > "score_".length()) {
- map.put(s.substring("score_".length()), Integer.valueOf(MathHelper.func_82715_a((String)p_96560_0_.get(s), 1)));
- }
- }
- return map;
- }
- public static boolean func_82377_a(String p_82377_0_) throws CommandException {
- Matcher matcher = field_82389_a.matcher(p_82377_0_);
- if(!matcher.matches()) {
- return false;
- } else {
- Map<String, String> map = func_82381_h(matcher.group(2));
- String s = matcher.group(1);
- int i = !"a".equals(s) && !"e".equals(s)?1:0;
- return func_179653_a(map, field_190845_s, i) != 1;
- }
- }
- public static boolean func_82378_b(String p_82378_0_) {
- return field_82389_a.matcher(p_82378_0_).matches();
- }
- private static Map<String, String> func_82381_h(@Nullable String p_82381_0_) throws CommandException {
- Map<String, String> map = Maps.<String, String>newHashMap();
- if(p_82381_0_ == null) {
- return map;
- } else {
- for(String s : field_190828_b.split(p_82381_0_)) {
- Iterator<String> iterator = field_190829_c.split(s).iterator();
- String s1 = (String)iterator.next();
- if(!field_190851_y.apply(s1)) {
- throw new CommandException("commands.generic.selector_argument", new Object[]{s});
- }
- map.put(s1, iterator.hasNext()?(String)iterator.next():"");
- }
- return map;
- }
- }
- }
- Hunk 5 failed! Cannot find hunk target
- private static List<Predicate<Entity>> func_179659_d(Map<String, String> p_179659_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- - final String s = func_179651_b(p_179659_0_, field_190847_u);
- + String s = func_179651_b(p_179659_0_, field_190847_u);
- final boolean flag = s != null && s.startsWith("!");
- if (flag) {
- s = s.substring(1);
- }
- if (s != null) {
- + final String s_f_ = s;
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if (!(p_apply_1_ instanceof EntityLivingBase)) {
- File state
- package net.minecraft.command;
- import com.google.common.base.Predicate;
- import com.google.common.base.Predicates;
- import com.google.common.base.Splitter;
- import com.google.common.collect.ComparisonChain;
- import com.google.common.collect.Lists;
- import com.google.common.collect.Maps;
- import com.google.common.collect.Sets;
- import java.util.Collections;
- import java.util.Comparator;
- import java.util.Iterator;
- import java.util.List;
- import java.util.Map;
- import java.util.Set;
- import java.util.Map.Entry;
- import java.util.regex.Matcher;
- import java.util.regex.Pattern;
- import javax.annotation.Nullable;
- import net.minecraft.command.CommandBase;
- import net.minecraft.command.CommandException;
- import net.minecraft.command.ICommandSender;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.EntityList;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.entity.player.EntityPlayerMP;
- import net.minecraft.scoreboard.Score;
- import net.minecraft.scoreboard.ScoreObjective;
- import net.minecraft.scoreboard.Scoreboard;
- import net.minecraft.scoreboard.Team;
- import net.minecraft.util.EntitySelectors;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.util.math.AxisAlignedBB;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.util.math.MathHelper;
- import net.minecraft.util.math.Vec3d;
- import net.minecraft.util.text.ITextComponent;
- import net.minecraft.util.text.TextComponentTranslation;
- import net.minecraft.util.text.TextFormatting;
- import net.minecraft.world.GameType;
- import net.minecraft.world.World;
- public class EntitySelector {
- private static final Pattern field_82389_a = Pattern.compile("^@([pares])(?:\\[([^ ]*)\\])?$");
- private static final Splitter field_190828_b = Splitter.on(',').omitEmptyStrings();
- private static final Splitter field_190829_c = Splitter.on('=').limit(2);
- private static final Set<String> field_190830_d = Sets.<String>newHashSet();
- private static final String field_190831_e = func_190826_c("r");
- private static final String field_190832_f = func_190826_c("rm");
- private static final String field_190833_g = func_190826_c("l");
- private static final String field_190834_h = func_190826_c("lm");
- private static final String field_190835_i = func_190826_c("x");
- private static final String field_190836_j = func_190826_c("y");
- private static final String field_190837_k = func_190826_c("z");
- private static final String field_190838_l = func_190826_c("dx");
- private static final String field_190839_m = func_190826_c("dy");
- private static final String field_190840_n = func_190826_c("dz");
- private static final String field_190841_o = func_190826_c("rx");
- private static final String field_190842_p = func_190826_c("rxm");
- private static final String field_190843_q = func_190826_c("ry");
- private static final String field_190844_r = func_190826_c("rym");
- private static final String field_190845_s = func_190826_c("c");
- private static final String field_190846_t = func_190826_c("m");
- private static final String field_190847_u = func_190826_c("team");
- private static final String field_190848_v = func_190826_c("name");
- private static final String field_190849_w = func_190826_c("type");
- private static final String field_190850_x = func_190826_c("tag");
- private static final Predicate<String> field_190851_y = new Predicate<String>() {
- public boolean apply(@Nullable String p_apply_1_) {
- return p_apply_1_ != null && (EntitySelector.field_190830_d.contains(p_apply_1_) || p_apply_1_.length() > "score_".length() && p_apply_1_.startsWith("score_"));
- }
- };
- 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});
- public static String func_190826_c(String p_190826_0_) {
- field_190830_d.add(p_190826_0_);
- return p_190826_0_;
- }
- @Nullable
- public static EntityPlayerMP func_82386_a(ICommandSender p_82386_0_, String p_82386_1_) throws CommandException {
- return (EntityPlayerMP)func_179652_a(p_82386_0_, p_82386_1_, EntityPlayerMP.class);
- }
- public static List<EntityPlayerMP> func_193531_b(ICommandSender p_193531_0_, String p_193531_1_) throws CommandException {
- return func_179656_b(p_193531_0_, p_193531_1_, EntityPlayerMP.class);
- }
- @Nullable
- 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 {
- List<T> list = func_179656_b(p_179652_0_, p_179652_1_, p_179652_2_);
- return (T)(list.size() == 1?(Entity)list.get(0):null);
- }
- @Nullable
- public static ITextComponent func_150869_b(ICommandSender p_150869_0_, String p_150869_1_) throws CommandException {
- List<Entity> list = func_179656_b(p_150869_0_, p_150869_1_, Entity.class);
- if(list.isEmpty()) {
- return null;
- } else {
- List<ITextComponent> list1 = Lists.<ITextComponent>newArrayList();
- for(Entity entity : list) {
- list1.add(entity.func_145748_c_());
- }
- return CommandBase.func_180530_a(list1);
- }
- }
- 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 {
- Matcher matcher = field_82389_a.matcher(p_179656_1_);
- if(matcher.matches() && p_179656_0_.func_70003_b(1, "@")) {
- Map<String, String> map = func_82381_h(matcher.group(2));
- if(!func_179655_b(p_179656_0_, map)) {
- return Collections.<T>emptyList();
- } else {
- String s = matcher.group(1);
- BlockPos blockpos = func_179664_b(map, p_179656_0_.func_180425_c());
- Vec3d vec3d = func_189210_b(map, p_179656_0_.func_174791_d());
- List<World> list = func_179654_a(p_179656_0_, map);
- List<T> list1 = Lists.<T>newArrayList();
- for(World world : list) {
- if(world != null) {
- List<Predicate<Entity>> list2 = Lists.<Predicate<Entity>>newArrayList();
- list2.addAll(func_179663_a(map, s));
- list2.addAll(func_179648_b(map));
- list2.addAll(func_179649_c(map));
- list2.addAll(func_179659_d(map));
- list2.addAll(func_184952_c(p_179656_0_, map));
- list2.addAll(func_179647_f(map));
- list2.addAll(func_184951_f(map));
- list2.addAll(func_180698_a(map, vec3d));
- list2.addAll(func_179662_g(map));
- if("s".equalsIgnoreCase(s)) {
- Entity entity = p_179656_0_.func_174793_f();
- if(entity != null && p_179656_2_.isAssignableFrom(entity.getClass())) {
- if(map.containsKey(field_190838_l) || map.containsKey(field_190839_m) || map.containsKey(field_190840_n)) {
- int i = func_179653_a(map, field_190838_l, 0);
- int j = func_179653_a(map, field_190839_m, 0);
- int k = func_179653_a(map, field_190840_n, 0);
- AxisAlignedBB axisalignedbb = func_179661_a(blockpos, i, j, k);
- if(!axisalignedbb.func_72326_a(entity.func_174813_aQ())) {
- return Collections.<T>emptyList();
- }
- }
- for(Predicate<Entity> predicate : list2) {
- if(!predicate.apply(entity)) {
- return Collections.<T>emptyList();
- }
- }
- return Lists.newArrayList(new Entity[]{entity});
- }
- return Collections.<T>emptyList();
- }
- list1.addAll(func_179660_a(map, p_179656_2_, list2, s, world, blockpos));
- }
- }
- return func_179658_a(list1, map, p_179656_0_, p_179656_2_, s, vec3d);
- }
- } else {
- return Collections.<T>emptyList();
- }
- }
- private static List<World> func_179654_a(ICommandSender p_179654_0_, Map<String, String> p_179654_1_) {
- List<World> list = Lists.<World>newArrayList();
- if(func_179665_h(p_179654_1_)) {
- list.add(p_179654_0_.func_130014_f_());
- } else {
- Collections.addAll(list, p_179654_0_.func_184102_h().field_71305_c);
- }
- return list;
- }
- private static <T extends Entity> boolean func_179655_b(ICommandSender p_179655_0_, Map<String, String> p_179655_1_) {
- String s = func_179651_b(p_179655_1_, field_190849_w);
- if(s == null) {
- return true;
- } else {
- ResourceLocation resourcelocation = new ResourceLocation(s.startsWith("!")?s.substring(1):s);
- if(EntityList.func_180125_b(resourcelocation)) {
- return true;
- } else {
- TextComponentTranslation textcomponenttranslation = new TextComponentTranslation("commands.generic.entity.invalidType", new Object[]{resourcelocation});
- textcomponenttranslation.func_150256_b().func_150238_a(TextFormatting.RED);
- p_179655_0_.func_145747_a(textcomponenttranslation);
- return false;
- }
- }
- }
- private static List<Predicate<Entity>> func_179663_a(Map<String, String> p_179663_0_, String p_179663_1_) {
- String s = func_179651_b(p_179663_0_, field_190849_w);
- if(s == null || !p_179663_1_.equals("e") && !p_179663_1_.equals("r") && !p_179663_1_.equals("s")) {
- return !p_179663_1_.equals("e") && !p_179663_1_.equals("s")?Collections.singletonList(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return p_apply_1_ instanceof EntityPlayer;
- }
- }):Collections.emptyList();
- } else {
- final boolean flag = s.startsWith("!");
- final ResourceLocation resourcelocation = new ResourceLocation(flag?s.substring(1):s);
- return Collections.singletonList(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return EntityList.func_180123_a(p_apply_1_, resourcelocation) != flag;
- }
- });
- }
- }
- private static List<Predicate<Entity>> func_179648_b(Map<String, String> p_179648_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- final int i = func_179653_a(p_179648_0_, field_190834_h, -1);
- final int j = func_179653_a(p_179648_0_, field_190833_g, -1);
- if(i > -1 || j > -1) {
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(!(p_apply_1_ instanceof EntityPlayerMP)) {
- return false;
- } else {
- EntityPlayerMP entityplayermp = (EntityPlayerMP)p_apply_1_;
- return (i <= -1 || entityplayermp.field_71068_ca >= i) && (j <= -1 || entityplayermp.field_71068_ca <= j);
- }
- }
- });
- }
- return list;
- }
- private static List<Predicate<Entity>> func_179649_c(Map<String, String> p_179649_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- String s = func_179651_b(p_179649_0_, field_190846_t);
- if(s == null) {
- return list;
- } else {
- final boolean flag = s.startsWith("!");
- if(flag) {
- s = s.substring(1);
- }
- final GameType gametype;
- try {
- int i = Integer.parseInt(s);
- gametype = GameType.func_185329_a(i, GameType.NOT_SET);
- } catch (Throwable var6) {
- gametype = GameType.func_185328_a(s, GameType.NOT_SET);
- }
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(!(p_apply_1_ instanceof EntityPlayerMP)) {
- return false;
- } else {
- EntityPlayerMP entityplayermp = (EntityPlayerMP)p_apply_1_;
- GameType gametype1 = entityplayermp.field_71134_c.func_73081_b();
- return flag?gametype1 != gametype:gametype1 == gametype;
- }
- }
- });
- return list;
- }
- }
- private static List<Predicate<Entity>> func_179659_d(Map<String, String> p_179659_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- final String s = func_179651_b(p_179659_0_, field_190847_u);
- final boolean flag = s != null && s.startsWith("!");
- if(flag) {
- s = s.substring(1);
- }
- if(s != null) {
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(!(p_apply_1_ instanceof EntityLivingBase)) {
- return false;
- } else {
- EntityLivingBase entitylivingbase = (EntityLivingBase)p_apply_1_;
- Team team = entitylivingbase.func_96124_cp();
- String s1 = team == null?"":team.func_96661_b();
- return s1.equals(s) != flag;
- }
- }
- });
- }
- return list;
- }
- private static List<Predicate<Entity>> func_184952_c(final ICommandSender p_184952_0_, Map<String, String> p_184952_1_) {
- final Map<String, Integer> map = func_96560_a(p_184952_1_);
- return (List<Predicate<Entity>>)(map.isEmpty()?Collections.emptyList():Lists.newArrayList(new Predicate[]{new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(p_apply_1_ == null) {
- return false;
- } else {
- Scoreboard scoreboard = p_184952_0_.func_184102_h().func_71218_a(0).func_96441_U();
- for(Entry<String, Integer> entry : map.entrySet()) {
- String s = (String)entry.getKey();
- boolean flag = false;
- if(s.endsWith("_min") && s.length() > 4) {
- flag = true;
- s = s.substring(0, s.length() - 4);
- }
- ScoreObjective scoreobjective = scoreboard.func_96518_b(s);
- if(scoreobjective == null) {
- return false;
- }
- String s1 = p_apply_1_ instanceof EntityPlayerMP?p_apply_1_.func_70005_c_():p_apply_1_.func_189512_bd();
- if(!scoreboard.func_178819_b(s1, scoreobjective)) {
- return false;
- }
- Score score = scoreboard.func_96529_a(s1, scoreobjective);
- int i = score.func_96652_c();
- if(i < ((Integer)entry.getValue()).intValue() && flag) {
- return false;
- }
- if(i > ((Integer)entry.getValue()).intValue() && !flag) {
- return false;
- }
- }
- return true;
- }
- }
- }}));
- }
- private static List<Predicate<Entity>> func_179647_f(Map<String, String> p_179647_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- final String s = func_179651_b(p_179647_0_, field_190848_v);
- final boolean flag = s != null && s.startsWith("!");
- if(flag) {
- s = s.substring(1);
- }
- if(s != null) {
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return p_apply_1_ != null && p_apply_1_.func_70005_c_().equals(s) != flag;
- }
- });
- }
- return list;
- }
- private static List<Predicate<Entity>> func_184951_f(Map<String, String> p_184951_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- final String s = func_179651_b(p_184951_0_, field_190850_x);
- final boolean flag = s != null && s.startsWith("!");
- if(flag) {
- s = s.substring(1);
- }
- if(s != null) {
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- 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);
- }
- });
- }
- return list;
- }
- private static List<Predicate<Entity>> func_180698_a(Map<String, String> p_180698_0_, final Vec3d p_180698_1_) {
- double d0 = (double)func_179653_a(p_180698_0_, field_190832_f, -1);
- double d1 = (double)func_179653_a(p_180698_0_, field_190831_e, -1);
- final boolean flag = d0 < -0.5D;
- final boolean flag1 = d1 < -0.5D;
- if(flag && flag1) {
- return Collections.<Predicate<Entity>>emptyList();
- } else {
- double d2 = Math.max(d0, 1.0E-4D);
- final double d3 = d2 * d2;
- double d4 = Math.max(d1, 1.0E-4D);
- final double d5 = d4 * d4;
- return Lists.newArrayList(new Predicate[]{new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(p_apply_1_ == null) {
- return false;
- } else {
- 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);
- return (flag || d6 >= d3) && (flag1 || d6 <= d5);
- }
- }
- }});
- }
- }
- private static List<Predicate<Entity>> func_179662_g(Map<String, String> p_179662_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- if(p_179662_0_.containsKey(field_190844_r) || p_179662_0_.containsKey(field_190843_q)) {
- final int i = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190844_r, 0));
- final int j = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190843_q, 359));
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(p_apply_1_ == null) {
- return false;
- } else {
- int i1 = MathHelper.func_188209_b(MathHelper.func_76141_d(p_apply_1_.field_70177_z));
- return i > j?i1 >= i || i1 <= j:i1 >= i && i1 <= j;
- }
- }
- });
- }
- if(p_179662_0_.containsKey(field_190842_p) || p_179662_0_.containsKey(field_190841_o)) {
- final int k = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190842_p, 0));
- final int l = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190841_o, 359));
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(p_apply_1_ == null) {
- return false;
- } else {
- int i1 = MathHelper.func_188209_b(MathHelper.func_76141_d(p_apply_1_.field_70125_A));
- return k > l?i1 >= k || i1 <= l:i1 >= k && i1 <= l;
- }
- }
- });
- }
- return list;
- }
- 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_) {
- List<T> list = Lists.<T>newArrayList();
- String s = func_179651_b(p_179660_0_, field_190849_w);
- s = s != null && s.startsWith("!")?s.substring(1):s;
- boolean flag = !p_179660_3_.equals("e");
- boolean flag1 = p_179660_3_.equals("r") && s != null;
- int i = func_179653_a(p_179660_0_, field_190838_l, 0);
- int j = func_179653_a(p_179660_0_, field_190839_m, 0);
- int k = func_179653_a(p_179660_0_, field_190840_n, 0);
- int l = func_179653_a(p_179660_0_, field_190831_e, -1);
- Predicate<Entity> predicate = Predicates.and(p_179660_2_);
- Predicate<Entity> predicate1 = Predicates.<Entity>and(EntitySelectors.field_94557_a, predicate);
- if(!p_179660_0_.containsKey(field_190838_l) && !p_179660_0_.containsKey(field_190839_m) && !p_179660_0_.containsKey(field_190840_n)) {
- if(l >= 0) {
- 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));
- if(flag && !flag1) {
- list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate1));
- } else {
- list.addAll(p_179660_4_.<T>func_175647_a(p_179660_1_, axisalignedbb1, predicate1));
- }
- } else if(p_179660_3_.equals("a")) {
- list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate));
- } else if(!p_179660_3_.equals("p") && (!p_179660_3_.equals("r") || flag1)) {
- list.addAll(p_179660_4_.<T>func_175644_a(p_179660_1_, predicate1));
- } else {
- list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate1));
- }
- } else {
- final AxisAlignedBB axisalignedbb = func_179661_a(p_179660_5_, i, j, k);
- if(flag && !flag1) {
- Predicate<Entity> predicate2 = new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return p_apply_1_ != null && axisalignedbb.func_72326_a(p_apply_1_.func_174813_aQ());
- }
- };
- list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, Predicates.<T>and(predicate1, predicate2)));
- } else {
- list.addAll(p_179660_4_.<T>func_175647_a(p_179660_1_, axisalignedbb, predicate1));
- }
- }
- return list;
- }
- 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_) {
- int i = func_179653_a(p_179658_1_, field_190845_s, !p_179658_4_.equals("a") && !p_179658_4_.equals("e")?1:0);
- if(!p_179658_4_.equals("p") && !p_179658_4_.equals("a") && !p_179658_4_.equals("e")) {
- if(p_179658_4_.equals("r")) {
- Collections.shuffle((List<?>)p_179658_0_);
- }
- } else {
- Collections.sort((List<T>)p_179658_0_, new Comparator<Entity>() {
- public int compare(Entity p_compare_1_, Entity p_compare_2_) {
- 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();
- }
- });
- }
- Entity entity = p_179658_2_.func_174793_f();
- if(entity != null && p_179658_3_.isAssignableFrom(entity.getClass()) && i == 1 && ((List)p_179658_0_).contains(entity) && !"r".equals(p_179658_4_)) {
- p_179658_0_ = Lists.newArrayList(new Entity[]{entity});
- }
- if(i != 0) {
- if(i < 0) {
- Collections.reverse((List<?>)p_179658_0_);
- }
- p_179658_0_ = ((List)p_179658_0_).subList(0, Math.min(Math.abs(i), ((List)p_179658_0_).size()));
- }
- return (List)p_179658_0_;
- }
- private static AxisAlignedBB func_179661_a(BlockPos p_179661_0_, int p_179661_1_, int p_179661_2_, int p_179661_3_) {
- boolean flag = p_179661_1_ < 0;
- boolean flag1 = p_179661_2_ < 0;
- boolean flag2 = p_179661_3_ < 0;
- int i = p_179661_0_.func_177958_n() + (flag?p_179661_1_:0);
- int j = p_179661_0_.func_177956_o() + (flag1?p_179661_2_:0);
- int k = p_179661_0_.func_177952_p() + (flag2?p_179661_3_:0);
- int l = p_179661_0_.func_177958_n() + (flag?0:p_179661_1_) + 1;
- int i1 = p_179661_0_.func_177956_o() + (flag1?0:p_179661_2_) + 1;
- int j1 = p_179661_0_.func_177952_p() + (flag2?0:p_179661_3_) + 1;
- return new AxisAlignedBB((double)i, (double)j, (double)k, (double)l, (double)i1, (double)j1);
- }
- private static BlockPos func_179664_b(Map<String, String> p_179664_0_, BlockPos p_179664_1_) {
- 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()));
- }
- private static Vec3d func_189210_b(Map<String, String> p_189210_0_, Vec3d p_189210_1_) {
- 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));
- }
- private static double func_189211_a(Map<String, String> p_189211_0_, String p_189211_1_, double p_189211_2_, boolean p_189211_4_) {
- 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_;
- }
- private static boolean func_179665_h(Map<String, String> p_179665_0_) {
- for(String s : field_179666_d) {
- if(p_179665_0_.containsKey(s)) {
- return true;
- }
- }
- return false;
- }
- private static int func_179653_a(Map<String, String> p_179653_0_, String p_179653_1_, int p_179653_2_) {
- 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_;
- }
- @Nullable
- private static String func_179651_b(Map<String, String> p_179651_0_, String p_179651_1_) {
- return (String)p_179651_0_.get(p_179651_1_);
- }
- public static Map<String, Integer> func_96560_a(Map<String, String> p_96560_0_) {
- Map<String, Integer> map = Maps.<String, Integer>newHashMap();
- for(String s : p_96560_0_.keySet()) {
- if(s.startsWith("score_") && s.length() > "score_".length()) {
- map.put(s.substring("score_".length()), Integer.valueOf(MathHelper.func_82715_a((String)p_96560_0_.get(s), 1)));
- }
- }
- return map;
- }
- public static boolean func_82377_a(String p_82377_0_) throws CommandException {
- Matcher matcher = field_82389_a.matcher(p_82377_0_);
- if(!matcher.matches()) {
- return false;
- } else {
- Map<String, String> map = func_82381_h(matcher.group(2));
- String s = matcher.group(1);
- int i = !"a".equals(s) && !"e".equals(s)?1:0;
- return func_179653_a(map, field_190845_s, i) != 1;
- }
- }
- public static boolean func_82378_b(String p_82378_0_) {
- return field_82389_a.matcher(p_82378_0_).matches();
- }
- private static Map<String, String> func_82381_h(@Nullable String p_82381_0_) throws CommandException {
- Map<String, String> map = Maps.<String, String>newHashMap();
- if(p_82381_0_ == null) {
- return map;
- } else {
- for(String s : field_190828_b.split(p_82381_0_)) {
- Iterator<String> iterator = field_190829_c.split(s).iterator();
- String s1 = (String)iterator.next();
- if(!field_190851_y.apply(s1)) {
- throw new CommandException("commands.generic.selector_argument", new Object[]{s});
- }
- map.put(s1, iterator.hasNext()?(String)iterator.next():"");
- }
- return map;
- }
- }
- }
- Hunk 6 failed! Cannot find hunk target
- EntityLivingBase entitylivingbase = (EntityLivingBase)p_apply_1_;
- Team team = entitylivingbase.func_96124_cp();
- String s1 = team == null ? "" : team.func_96661_b();
- - return s1.equals(s) != flag;
- + return s1.equals(s_f_) != flag;
- }
- }
- });
- File state
- package net.minecraft.command;
- import com.google.common.base.Predicate;
- import com.google.common.base.Predicates;
- import com.google.common.base.Splitter;
- import com.google.common.collect.ComparisonChain;
- import com.google.common.collect.Lists;
- import com.google.common.collect.Maps;
- import com.google.common.collect.Sets;
- import java.util.Collections;
- import java.util.Comparator;
- import java.util.Iterator;
- import java.util.List;
- import java.util.Map;
- import java.util.Set;
- import java.util.Map.Entry;
- import java.util.regex.Matcher;
- import java.util.regex.Pattern;
- import javax.annotation.Nullable;
- import net.minecraft.command.CommandBase;
- import net.minecraft.command.CommandException;
- import net.minecraft.command.ICommandSender;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.EntityList;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.entity.player.EntityPlayerMP;
- import net.minecraft.scoreboard.Score;
- import net.minecraft.scoreboard.ScoreObjective;
- import net.minecraft.scoreboard.Scoreboard;
- import net.minecraft.scoreboard.Team;
- import net.minecraft.util.EntitySelectors;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.util.math.AxisAlignedBB;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.util.math.MathHelper;
- import net.minecraft.util.math.Vec3d;
- import net.minecraft.util.text.ITextComponent;
- import net.minecraft.util.text.TextComponentTranslation;
- import net.minecraft.util.text.TextFormatting;
- import net.minecraft.world.GameType;
- import net.minecraft.world.World;
- public class EntitySelector {
- private static final Pattern field_82389_a = Pattern.compile("^@([pares])(?:\\[([^ ]*)\\])?$");
- private static final Splitter field_190828_b = Splitter.on(',').omitEmptyStrings();
- private static final Splitter field_190829_c = Splitter.on('=').limit(2);
- private static final Set<String> field_190830_d = Sets.<String>newHashSet();
- private static final String field_190831_e = func_190826_c("r");
- private static final String field_190832_f = func_190826_c("rm");
- private static final String field_190833_g = func_190826_c("l");
- private static final String field_190834_h = func_190826_c("lm");
- private static final String field_190835_i = func_190826_c("x");
- private static final String field_190836_j = func_190826_c("y");
- private static final String field_190837_k = func_190826_c("z");
- private static final String field_190838_l = func_190826_c("dx");
- private static final String field_190839_m = func_190826_c("dy");
- private static final String field_190840_n = func_190826_c("dz");
- private static final String field_190841_o = func_190826_c("rx");
- private static final String field_190842_p = func_190826_c("rxm");
- private static final String field_190843_q = func_190826_c("ry");
- private static final String field_190844_r = func_190826_c("rym");
- private static final String field_190845_s = func_190826_c("c");
- private static final String field_190846_t = func_190826_c("m");
- private static final String field_190847_u = func_190826_c("team");
- private static final String field_190848_v = func_190826_c("name");
- private static final String field_190849_w = func_190826_c("type");
- private static final String field_190850_x = func_190826_c("tag");
- private static final Predicate<String> field_190851_y = new Predicate<String>() {
- public boolean apply(@Nullable String p_apply_1_) {
- return p_apply_1_ != null && (EntitySelector.field_190830_d.contains(p_apply_1_) || p_apply_1_.length() > "score_".length() && p_apply_1_.startsWith("score_"));
- }
- };
- 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});
- public static String func_190826_c(String p_190826_0_) {
- field_190830_d.add(p_190826_0_);
- return p_190826_0_;
- }
- @Nullable
- public static EntityPlayerMP func_82386_a(ICommandSender p_82386_0_, String p_82386_1_) throws CommandException {
- return (EntityPlayerMP)func_179652_a(p_82386_0_, p_82386_1_, EntityPlayerMP.class);
- }
- public static List<EntityPlayerMP> func_193531_b(ICommandSender p_193531_0_, String p_193531_1_) throws CommandException {
- return func_179656_b(p_193531_0_, p_193531_1_, EntityPlayerMP.class);
- }
- @Nullable
- 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 {
- List<T> list = func_179656_b(p_179652_0_, p_179652_1_, p_179652_2_);
- return (T)(list.size() == 1?(Entity)list.get(0):null);
- }
- @Nullable
- public static ITextComponent func_150869_b(ICommandSender p_150869_0_, String p_150869_1_) throws CommandException {
- List<Entity> list = func_179656_b(p_150869_0_, p_150869_1_, Entity.class);
- if(list.isEmpty()) {
- return null;
- } else {
- List<ITextComponent> list1 = Lists.<ITextComponent>newArrayList();
- for(Entity entity : list) {
- list1.add(entity.func_145748_c_());
- }
- return CommandBase.func_180530_a(list1);
- }
- }
- 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 {
- Matcher matcher = field_82389_a.matcher(p_179656_1_);
- if(matcher.matches() && p_179656_0_.func_70003_b(1, "@")) {
- Map<String, String> map = func_82381_h(matcher.group(2));
- if(!func_179655_b(p_179656_0_, map)) {
- return Collections.<T>emptyList();
- } else {
- String s = matcher.group(1);
- BlockPos blockpos = func_179664_b(map, p_179656_0_.func_180425_c());
- Vec3d vec3d = func_189210_b(map, p_179656_0_.func_174791_d());
- List<World> list = func_179654_a(p_179656_0_, map);
- List<T> list1 = Lists.<T>newArrayList();
- for(World world : list) {
- if(world != null) {
- List<Predicate<Entity>> list2 = Lists.<Predicate<Entity>>newArrayList();
- list2.addAll(func_179663_a(map, s));
- list2.addAll(func_179648_b(map));
- list2.addAll(func_179649_c(map));
- list2.addAll(func_179659_d(map));
- list2.addAll(func_184952_c(p_179656_0_, map));
- list2.addAll(func_179647_f(map));
- list2.addAll(func_184951_f(map));
- list2.addAll(func_180698_a(map, vec3d));
- list2.addAll(func_179662_g(map));
- if("s".equalsIgnoreCase(s)) {
- Entity entity = p_179656_0_.func_174793_f();
- if(entity != null && p_179656_2_.isAssignableFrom(entity.getClass())) {
- if(map.containsKey(field_190838_l) || map.containsKey(field_190839_m) || map.containsKey(field_190840_n)) {
- int i = func_179653_a(map, field_190838_l, 0);
- int j = func_179653_a(map, field_190839_m, 0);
- int k = func_179653_a(map, field_190840_n, 0);
- AxisAlignedBB axisalignedbb = func_179661_a(blockpos, i, j, k);
- if(!axisalignedbb.func_72326_a(entity.func_174813_aQ())) {
- return Collections.<T>emptyList();
- }
- }
- for(Predicate<Entity> predicate : list2) {
- if(!predicate.apply(entity)) {
- return Collections.<T>emptyList();
- }
- }
- return Lists.newArrayList(new Entity[]{entity});
- }
- return Collections.<T>emptyList();
- }
- list1.addAll(func_179660_a(map, p_179656_2_, list2, s, world, blockpos));
- }
- }
- return func_179658_a(list1, map, p_179656_0_, p_179656_2_, s, vec3d);
- }
- } else {
- return Collections.<T>emptyList();
- }
- }
- private static List<World> func_179654_a(ICommandSender p_179654_0_, Map<String, String> p_179654_1_) {
- List<World> list = Lists.<World>newArrayList();
- if(func_179665_h(p_179654_1_)) {
- list.add(p_179654_0_.func_130014_f_());
- } else {
- Collections.addAll(list, p_179654_0_.func_184102_h().field_71305_c);
- }
- return list;
- }
- private static <T extends Entity> boolean func_179655_b(ICommandSender p_179655_0_, Map<String, String> p_179655_1_) {
- String s = func_179651_b(p_179655_1_, field_190849_w);
- if(s == null) {
- return true;
- } else {
- ResourceLocation resourcelocation = new ResourceLocation(s.startsWith("!")?s.substring(1):s);
- if(EntityList.func_180125_b(resourcelocation)) {
- return true;
- } else {
- TextComponentTranslation textcomponenttranslation = new TextComponentTranslation("commands.generic.entity.invalidType", new Object[]{resourcelocation});
- textcomponenttranslation.func_150256_b().func_150238_a(TextFormatting.RED);
- p_179655_0_.func_145747_a(textcomponenttranslation);
- return false;
- }
- }
- }
- private static List<Predicate<Entity>> func_179663_a(Map<String, String> p_179663_0_, String p_179663_1_) {
- String s = func_179651_b(p_179663_0_, field_190849_w);
- if(s == null || !p_179663_1_.equals("e") && !p_179663_1_.equals("r") && !p_179663_1_.equals("s")) {
- return !p_179663_1_.equals("e") && !p_179663_1_.equals("s")?Collections.singletonList(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return p_apply_1_ instanceof EntityPlayer;
- }
- }):Collections.emptyList();
- } else {
- final boolean flag = s.startsWith("!");
- final ResourceLocation resourcelocation = new ResourceLocation(flag?s.substring(1):s);
- return Collections.singletonList(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return EntityList.func_180123_a(p_apply_1_, resourcelocation) != flag;
- }
- });
- }
- }
- private static List<Predicate<Entity>> func_179648_b(Map<String, String> p_179648_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- final int i = func_179653_a(p_179648_0_, field_190834_h, -1);
- final int j = func_179653_a(p_179648_0_, field_190833_g, -1);
- if(i > -1 || j > -1) {
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(!(p_apply_1_ instanceof EntityPlayerMP)) {
- return false;
- } else {
- EntityPlayerMP entityplayermp = (EntityPlayerMP)p_apply_1_;
- return (i <= -1 || entityplayermp.field_71068_ca >= i) && (j <= -1 || entityplayermp.field_71068_ca <= j);
- }
- }
- });
- }
- return list;
- }
- private static List<Predicate<Entity>> func_179649_c(Map<String, String> p_179649_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- String s = func_179651_b(p_179649_0_, field_190846_t);
- if(s == null) {
- return list;
- } else {
- final boolean flag = s.startsWith("!");
- if(flag) {
- s = s.substring(1);
- }
- final GameType gametype;
- try {
- int i = Integer.parseInt(s);
- gametype = GameType.func_185329_a(i, GameType.NOT_SET);
- } catch (Throwable var6) {
- gametype = GameType.func_185328_a(s, GameType.NOT_SET);
- }
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(!(p_apply_1_ instanceof EntityPlayerMP)) {
- return false;
- } else {
- EntityPlayerMP entityplayermp = (EntityPlayerMP)p_apply_1_;
- GameType gametype1 = entityplayermp.field_71134_c.func_73081_b();
- return flag?gametype1 != gametype:gametype1 == gametype;
- }
- }
- });
- return list;
- }
- }
- private static List<Predicate<Entity>> func_179659_d(Map<String, String> p_179659_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- final String s = func_179651_b(p_179659_0_, field_190847_u);
- final boolean flag = s != null && s.startsWith("!");
- if(flag) {
- s = s.substring(1);
- }
- if(s != null) {
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(!(p_apply_1_ instanceof EntityLivingBase)) {
- return false;
- } else {
- EntityLivingBase entitylivingbase = (EntityLivingBase)p_apply_1_;
- Team team = entitylivingbase.func_96124_cp();
- String s1 = team == null?"":team.func_96661_b();
- return s1.equals(s) != flag;
- }
- }
- });
- }
- return list;
- }
- private static List<Predicate<Entity>> func_184952_c(final ICommandSender p_184952_0_, Map<String, String> p_184952_1_) {
- final Map<String, Integer> map = func_96560_a(p_184952_1_);
- return (List<Predicate<Entity>>)(map.isEmpty()?Collections.emptyList():Lists.newArrayList(new Predicate[]{new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(p_apply_1_ == null) {
- return false;
- } else {
- Scoreboard scoreboard = p_184952_0_.func_184102_h().func_71218_a(0).func_96441_U();
- for(Entry<String, Integer> entry : map.entrySet()) {
- String s = (String)entry.getKey();
- boolean flag = false;
- if(s.endsWith("_min") && s.length() > 4) {
- flag = true;
- s = s.substring(0, s.length() - 4);
- }
- ScoreObjective scoreobjective = scoreboard.func_96518_b(s);
- if(scoreobjective == null) {
- return false;
- }
- String s1 = p_apply_1_ instanceof EntityPlayerMP?p_apply_1_.func_70005_c_():p_apply_1_.func_189512_bd();
- if(!scoreboard.func_178819_b(s1, scoreobjective)) {
- return false;
- }
- Score score = scoreboard.func_96529_a(s1, scoreobjective);
- int i = score.func_96652_c();
- if(i < ((Integer)entry.getValue()).intValue() && flag) {
- return false;
- }
- if(i > ((Integer)entry.getValue()).intValue() && !flag) {
- return false;
- }
- }
- return true;
- }
- }
- }}));
- }
- private static List<Predicate<Entity>> func_179647_f(Map<String, String> p_179647_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- final String s = func_179651_b(p_179647_0_, field_190848_v);
- final boolean flag = s != null && s.startsWith("!");
- if(flag) {
- s = s.substring(1);
- }
- if(s != null) {
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return p_apply_1_ != null && p_apply_1_.func_70005_c_().equals(s) != flag;
- }
- });
- }
- return list;
- }
- private static List<Predicate<Entity>> func_184951_f(Map<String, String> p_184951_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- final String s = func_179651_b(p_184951_0_, field_190850_x);
- final boolean flag = s != null && s.startsWith("!");
- if(flag) {
- s = s.substring(1);
- }
- if(s != null) {
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- 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);
- }
- });
- }
- return list;
- }
- private static List<Predicate<Entity>> func_180698_a(Map<String, String> p_180698_0_, final Vec3d p_180698_1_) {
- double d0 = (double)func_179653_a(p_180698_0_, field_190832_f, -1);
- double d1 = (double)func_179653_a(p_180698_0_, field_190831_e, -1);
- final boolean flag = d0 < -0.5D;
- final boolean flag1 = d1 < -0.5D;
- if(flag && flag1) {
- return Collections.<Predicate<Entity>>emptyList();
- } else {
- double d2 = Math.max(d0, 1.0E-4D);
- final double d3 = d2 * d2;
- double d4 = Math.max(d1, 1.0E-4D);
- final double d5 = d4 * d4;
- return Lists.newArrayList(new Predicate[]{new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(p_apply_1_ == null) {
- return false;
- } else {
- 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);
- return (flag || d6 >= d3) && (flag1 || d6 <= d5);
- }
- }
- }});
- }
- }
- private static List<Predicate<Entity>> func_179662_g(Map<String, String> p_179662_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- if(p_179662_0_.containsKey(field_190844_r) || p_179662_0_.containsKey(field_190843_q)) {
- final int i = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190844_r, 0));
- final int j = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190843_q, 359));
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(p_apply_1_ == null) {
- return false;
- } else {
- int i1 = MathHelper.func_188209_b(MathHelper.func_76141_d(p_apply_1_.field_70177_z));
- return i > j?i1 >= i || i1 <= j:i1 >= i && i1 <= j;
- }
- }
- });
- }
- if(p_179662_0_.containsKey(field_190842_p) || p_179662_0_.containsKey(field_190841_o)) {
- final int k = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190842_p, 0));
- final int l = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190841_o, 359));
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(p_apply_1_ == null) {
- return false;
- } else {
- int i1 = MathHelper.func_188209_b(MathHelper.func_76141_d(p_apply_1_.field_70125_A));
- return k > l?i1 >= k || i1 <= l:i1 >= k && i1 <= l;
- }
- }
- });
- }
- return list;
- }
- 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_) {
- List<T> list = Lists.<T>newArrayList();
- String s = func_179651_b(p_179660_0_, field_190849_w);
- s = s != null && s.startsWith("!")?s.substring(1):s;
- boolean flag = !p_179660_3_.equals("e");
- boolean flag1 = p_179660_3_.equals("r") && s != null;
- int i = func_179653_a(p_179660_0_, field_190838_l, 0);
- int j = func_179653_a(p_179660_0_, field_190839_m, 0);
- int k = func_179653_a(p_179660_0_, field_190840_n, 0);
- int l = func_179653_a(p_179660_0_, field_190831_e, -1);
- Predicate<Entity> predicate = Predicates.and(p_179660_2_);
- Predicate<Entity> predicate1 = Predicates.<Entity>and(EntitySelectors.field_94557_a, predicate);
- if(!p_179660_0_.containsKey(field_190838_l) && !p_179660_0_.containsKey(field_190839_m) && !p_179660_0_.containsKey(field_190840_n)) {
- if(l >= 0) {
- 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));
- if(flag && !flag1) {
- list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate1));
- } else {
- list.addAll(p_179660_4_.<T>func_175647_a(p_179660_1_, axisalignedbb1, predicate1));
- }
- } else if(p_179660_3_.equals("a")) {
- list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate));
- } else if(!p_179660_3_.equals("p") && (!p_179660_3_.equals("r") || flag1)) {
- list.addAll(p_179660_4_.<T>func_175644_a(p_179660_1_, predicate1));
- } else {
- list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate1));
- }
- } else {
- final AxisAlignedBB axisalignedbb = func_179661_a(p_179660_5_, i, j, k);
- if(flag && !flag1) {
- Predicate<Entity> predicate2 = new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return p_apply_1_ != null && axisalignedbb.func_72326_a(p_apply_1_.func_174813_aQ());
- }
- };
- list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, Predicates.<T>and(predicate1, predicate2)));
- } else {
- list.addAll(p_179660_4_.<T>func_175647_a(p_179660_1_, axisalignedbb, predicate1));
- }
- }
- return list;
- }
- 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_) {
- int i = func_179653_a(p_179658_1_, field_190845_s, !p_179658_4_.equals("a") && !p_179658_4_.equals("e")?1:0);
- if(!p_179658_4_.equals("p") && !p_179658_4_.equals("a") && !p_179658_4_.equals("e")) {
- if(p_179658_4_.equals("r")) {
- Collections.shuffle((List<?>)p_179658_0_);
- }
- } else {
- Collections.sort((List<T>)p_179658_0_, new Comparator<Entity>() {
- public int compare(Entity p_compare_1_, Entity p_compare_2_) {
- 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();
- }
- });
- }
- Entity entity = p_179658_2_.func_174793_f();
- if(entity != null && p_179658_3_.isAssignableFrom(entity.getClass()) && i == 1 && ((List)p_179658_0_).contains(entity) && !"r".equals(p_179658_4_)) {
- p_179658_0_ = Lists.newArrayList(new Entity[]{entity});
- }
- if(i != 0) {
- if(i < 0) {
- Collections.reverse((List<?>)p_179658_0_);
- }
- p_179658_0_ = ((List)p_179658_0_).subList(0, Math.min(Math.abs(i), ((List)p_179658_0_).size()));
- }
- return (List)p_179658_0_;
- }
- private static AxisAlignedBB func_179661_a(BlockPos p_179661_0_, int p_179661_1_, int p_179661_2_, int p_179661_3_) {
- boolean flag = p_179661_1_ < 0;
- boolean flag1 = p_179661_2_ < 0;
- boolean flag2 = p_179661_3_ < 0;
- int i = p_179661_0_.func_177958_n() + (flag?p_179661_1_:0);
- int j = p_179661_0_.func_177956_o() + (flag1?p_179661_2_:0);
- int k = p_179661_0_.func_177952_p() + (flag2?p_179661_3_:0);
- int l = p_179661_0_.func_177958_n() + (flag?0:p_179661_1_) + 1;
- int i1 = p_179661_0_.func_177956_o() + (flag1?0:p_179661_2_) + 1;
- int j1 = p_179661_0_.func_177952_p() + (flag2?0:p_179661_3_) + 1;
- return new AxisAlignedBB((double)i, (double)j, (double)k, (double)l, (double)i1, (double)j1);
- }
- private static BlockPos func_179664_b(Map<String, String> p_179664_0_, BlockPos p_179664_1_) {
- 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()));
- }
- private static Vec3d func_189210_b(Map<String, String> p_189210_0_, Vec3d p_189210_1_) {
- 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));
- }
- private static double func_189211_a(Map<String, String> p_189211_0_, String p_189211_1_, double p_189211_2_, boolean p_189211_4_) {
- 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_;
- }
- private static boolean func_179665_h(Map<String, String> p_179665_0_) {
- for(String s : field_179666_d) {
- if(p_179665_0_.containsKey(s)) {
- return true;
- }
- }
- return false;
- }
- private static int func_179653_a(Map<String, String> p_179653_0_, String p_179653_1_, int p_179653_2_) {
- 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_;
- }
- @Nullable
- private static String func_179651_b(Map<String, String> p_179651_0_, String p_179651_1_) {
- return (String)p_179651_0_.get(p_179651_1_);
- }
- public static Map<String, Integer> func_96560_a(Map<String, String> p_96560_0_) {
- Map<String, Integer> map = Maps.<String, Integer>newHashMap();
- for(String s : p_96560_0_.keySet()) {
- if(s.startsWith("score_") && s.length() > "score_".length()) {
- map.put(s.substring("score_".length()), Integer.valueOf(MathHelper.func_82715_a((String)p_96560_0_.get(s), 1)));
- }
- }
- return map;
- }
- public static boolean func_82377_a(String p_82377_0_) throws CommandException {
- Matcher matcher = field_82389_a.matcher(p_82377_0_);
- if(!matcher.matches()) {
- return false;
- } else {
- Map<String, String> map = func_82381_h(matcher.group(2));
- String s = matcher.group(1);
- int i = !"a".equals(s) && !"e".equals(s)?1:0;
- return func_179653_a(map, field_190845_s, i) != 1;
- }
- }
- public static boolean func_82378_b(String p_82378_0_) {
- return field_82389_a.matcher(p_82378_0_).matches();
- }
- private static Map<String, String> func_82381_h(@Nullable String p_82381_0_) throws CommandException {
- Map<String, String> map = Maps.<String, String>newHashMap();
- if(p_82381_0_ == null) {
- return map;
- } else {
- for(String s : field_190828_b.split(p_82381_0_)) {
- Iterator<String> iterator = field_190829_c.split(s).iterator();
- String s1 = (String)iterator.next();
- if(!field_190851_y.apply(s1)) {
- throw new CommandException("commands.generic.selector_argument", new Object[]{s});
- }
- map.put(s1, iterator.hasNext()?(String)iterator.next():"");
- }
- return map;
- }
- }
- }
- Hunk 7 failed! Cannot find hunk target
- private static List<Predicate<Entity>> func_179647_f(Map<String, String> p_179647_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- - final String s = func_179651_b(p_179647_0_, field_190848_v);
- + String s = func_179651_b(p_179647_0_, field_190848_v);
- final boolean flag = s != null && s.startsWith("!");
- if (flag) {
- s = s.substring(1);
- }
- if (s != null) {
- + final String s_f_ = s;
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- - return p_apply_1_ != null && p_apply_1_.func_70005_c_().equals(s) != flag;
- + return p_apply_1_ != null && p_apply_1_.func_70005_c_().equals(s_f_) != flag;
- }
- });
- }
- File state
- package net.minecraft.command;
- import com.google.common.base.Predicate;
- import com.google.common.base.Predicates;
- import com.google.common.base.Splitter;
- import com.google.common.collect.ComparisonChain;
- import com.google.common.collect.Lists;
- import com.google.common.collect.Maps;
- import com.google.common.collect.Sets;
- import java.util.Collections;
- import java.util.Comparator;
- import java.util.Iterator;
- import java.util.List;
- import java.util.Map;
- import java.util.Set;
- import java.util.Map.Entry;
- import java.util.regex.Matcher;
- import java.util.regex.Pattern;
- import javax.annotation.Nullable;
- import net.minecraft.command.CommandBase;
- import net.minecraft.command.CommandException;
- import net.minecraft.command.ICommandSender;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.EntityList;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.entity.player.EntityPlayerMP;
- import net.minecraft.scoreboard.Score;
- import net.minecraft.scoreboard.ScoreObjective;
- import net.minecraft.scoreboard.Scoreboard;
- import net.minecraft.scoreboard.Team;
- import net.minecraft.util.EntitySelectors;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.util.math.AxisAlignedBB;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.util.math.MathHelper;
- import net.minecraft.util.math.Vec3d;
- import net.minecraft.util.text.ITextComponent;
- import net.minecraft.util.text.TextComponentTranslation;
- import net.minecraft.util.text.TextFormatting;
- import net.minecraft.world.GameType;
- import net.minecraft.world.World;
- public class EntitySelector {
- private static final Pattern field_82389_a = Pattern.compile("^@([pares])(?:\\[([^ ]*)\\])?$");
- private static final Splitter field_190828_b = Splitter.on(',').omitEmptyStrings();
- private static final Splitter field_190829_c = Splitter.on('=').limit(2);
- private static final Set<String> field_190830_d = Sets.<String>newHashSet();
- private static final String field_190831_e = func_190826_c("r");
- private static final String field_190832_f = func_190826_c("rm");
- private static final String field_190833_g = func_190826_c("l");
- private static final String field_190834_h = func_190826_c("lm");
- private static final String field_190835_i = func_190826_c("x");
- private static final String field_190836_j = func_190826_c("y");
- private static final String field_190837_k = func_190826_c("z");
- private static final String field_190838_l = func_190826_c("dx");
- private static final String field_190839_m = func_190826_c("dy");
- private static final String field_190840_n = func_190826_c("dz");
- private static final String field_190841_o = func_190826_c("rx");
- private static final String field_190842_p = func_190826_c("rxm");
- private static final String field_190843_q = func_190826_c("ry");
- private static final String field_190844_r = func_190826_c("rym");
- private static final String field_190845_s = func_190826_c("c");
- private static final String field_190846_t = func_190826_c("m");
- private static final String field_190847_u = func_190826_c("team");
- private static final String field_190848_v = func_190826_c("name");
- private static final String field_190849_w = func_190826_c("type");
- private static final String field_190850_x = func_190826_c("tag");
- private static final Predicate<String> field_190851_y = new Predicate<String>() {
- public boolean apply(@Nullable String p_apply_1_) {
- return p_apply_1_ != null && (EntitySelector.field_190830_d.contains(p_apply_1_) || p_apply_1_.length() > "score_".length() && p_apply_1_.startsWith("score_"));
- }
- };
- 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});
- public static String func_190826_c(String p_190826_0_) {
- field_190830_d.add(p_190826_0_);
- return p_190826_0_;
- }
- @Nullable
- public static EntityPlayerMP func_82386_a(ICommandSender p_82386_0_, String p_82386_1_) throws CommandException {
- return (EntityPlayerMP)func_179652_a(p_82386_0_, p_82386_1_, EntityPlayerMP.class);
- }
- public static List<EntityPlayerMP> func_193531_b(ICommandSender p_193531_0_, String p_193531_1_) throws CommandException {
- return func_179656_b(p_193531_0_, p_193531_1_, EntityPlayerMP.class);
- }
- @Nullable
- 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 {
- List<T> list = func_179656_b(p_179652_0_, p_179652_1_, p_179652_2_);
- return (T)(list.size() == 1?(Entity)list.get(0):null);
- }
- @Nullable
- public static ITextComponent func_150869_b(ICommandSender p_150869_0_, String p_150869_1_) throws CommandException {
- List<Entity> list = func_179656_b(p_150869_0_, p_150869_1_, Entity.class);
- if(list.isEmpty()) {
- return null;
- } else {
- List<ITextComponent> list1 = Lists.<ITextComponent>newArrayList();
- for(Entity entity : list) {
- list1.add(entity.func_145748_c_());
- }
- return CommandBase.func_180530_a(list1);
- }
- }
- 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 {
- Matcher matcher = field_82389_a.matcher(p_179656_1_);
- if(matcher.matches() && p_179656_0_.func_70003_b(1, "@")) {
- Map<String, String> map = func_82381_h(matcher.group(2));
- if(!func_179655_b(p_179656_0_, map)) {
- return Collections.<T>emptyList();
- } else {
- String s = matcher.group(1);
- BlockPos blockpos = func_179664_b(map, p_179656_0_.func_180425_c());
- Vec3d vec3d = func_189210_b(map, p_179656_0_.func_174791_d());
- List<World> list = func_179654_a(p_179656_0_, map);
- List<T> list1 = Lists.<T>newArrayList();
- for(World world : list) {
- if(world != null) {
- List<Predicate<Entity>> list2 = Lists.<Predicate<Entity>>newArrayList();
- list2.addAll(func_179663_a(map, s));
- list2.addAll(func_179648_b(map));
- list2.addAll(func_179649_c(map));
- list2.addAll(func_179659_d(map));
- list2.addAll(func_184952_c(p_179656_0_, map));
- list2.addAll(func_179647_f(map));
- list2.addAll(func_184951_f(map));
- list2.addAll(func_180698_a(map, vec3d));
- list2.addAll(func_179662_g(map));
- if("s".equalsIgnoreCase(s)) {
- Entity entity = p_179656_0_.func_174793_f();
- if(entity != null && p_179656_2_.isAssignableFrom(entity.getClass())) {
- if(map.containsKey(field_190838_l) || map.containsKey(field_190839_m) || map.containsKey(field_190840_n)) {
- int i = func_179653_a(map, field_190838_l, 0);
- int j = func_179653_a(map, field_190839_m, 0);
- int k = func_179653_a(map, field_190840_n, 0);
- AxisAlignedBB axisalignedbb = func_179661_a(blockpos, i, j, k);
- if(!axisalignedbb.func_72326_a(entity.func_174813_aQ())) {
- return Collections.<T>emptyList();
- }
- }
- for(Predicate<Entity> predicate : list2) {
- if(!predicate.apply(entity)) {
- return Collections.<T>emptyList();
- }
- }
- return Lists.newArrayList(new Entity[]{entity});
- }
- return Collections.<T>emptyList();
- }
- list1.addAll(func_179660_a(map, p_179656_2_, list2, s, world, blockpos));
- }
- }
- return func_179658_a(list1, map, p_179656_0_, p_179656_2_, s, vec3d);
- }
- } else {
- return Collections.<T>emptyList();
- }
- }
- private static List<World> func_179654_a(ICommandSender p_179654_0_, Map<String, String> p_179654_1_) {
- List<World> list = Lists.<World>newArrayList();
- if(func_179665_h(p_179654_1_)) {
- list.add(p_179654_0_.func_130014_f_());
- } else {
- Collections.addAll(list, p_179654_0_.func_184102_h().field_71305_c);
- }
- return list;
- }
- private static <T extends Entity> boolean func_179655_b(ICommandSender p_179655_0_, Map<String, String> p_179655_1_) {
- String s = func_179651_b(p_179655_1_, field_190849_w);
- if(s == null) {
- return true;
- } else {
- ResourceLocation resourcelocation = new ResourceLocation(s.startsWith("!")?s.substring(1):s);
- if(EntityList.func_180125_b(resourcelocation)) {
- return true;
- } else {
- TextComponentTranslation textcomponenttranslation = new TextComponentTranslation("commands.generic.entity.invalidType", new Object[]{resourcelocation});
- textcomponenttranslation.func_150256_b().func_150238_a(TextFormatting.RED);
- p_179655_0_.func_145747_a(textcomponenttranslation);
- return false;
- }
- }
- }
- private static List<Predicate<Entity>> func_179663_a(Map<String, String> p_179663_0_, String p_179663_1_) {
- String s = func_179651_b(p_179663_0_, field_190849_w);
- if(s == null || !p_179663_1_.equals("e") && !p_179663_1_.equals("r") && !p_179663_1_.equals("s")) {
- return !p_179663_1_.equals("e") && !p_179663_1_.equals("s")?Collections.singletonList(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return p_apply_1_ instanceof EntityPlayer;
- }
- }):Collections.emptyList();
- } else {
- final boolean flag = s.startsWith("!");
- final ResourceLocation resourcelocation = new ResourceLocation(flag?s.substring(1):s);
- return Collections.singletonList(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return EntityList.func_180123_a(p_apply_1_, resourcelocation) != flag;
- }
- });
- }
- }
- private static List<Predicate<Entity>> func_179648_b(Map<String, String> p_179648_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- final int i = func_179653_a(p_179648_0_, field_190834_h, -1);
- final int j = func_179653_a(p_179648_0_, field_190833_g, -1);
- if(i > -1 || j > -1) {
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(!(p_apply_1_ instanceof EntityPlayerMP)) {
- return false;
- } else {
- EntityPlayerMP entityplayermp = (EntityPlayerMP)p_apply_1_;
- return (i <= -1 || entityplayermp.field_71068_ca >= i) && (j <= -1 || entityplayermp.field_71068_ca <= j);
- }
- }
- });
- }
- return list;
- }
- private static List<Predicate<Entity>> func_179649_c(Map<String, String> p_179649_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- String s = func_179651_b(p_179649_0_, field_190846_t);
- if(s == null) {
- return list;
- } else {
- final boolean flag = s.startsWith("!");
- if(flag) {
- s = s.substring(1);
- }
- final GameType gametype;
- try {
- int i = Integer.parseInt(s);
- gametype = GameType.func_185329_a(i, GameType.NOT_SET);
- } catch (Throwable var6) {
- gametype = GameType.func_185328_a(s, GameType.NOT_SET);
- }
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(!(p_apply_1_ instanceof EntityPlayerMP)) {
- return false;
- } else {
- EntityPlayerMP entityplayermp = (EntityPlayerMP)p_apply_1_;
- GameType gametype1 = entityplayermp.field_71134_c.func_73081_b();
- return flag?gametype1 != gametype:gametype1 == gametype;
- }
- }
- });
- return list;
- }
- }
- private static List<Predicate<Entity>> func_179659_d(Map<String, String> p_179659_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- final String s = func_179651_b(p_179659_0_, field_190847_u);
- final boolean flag = s != null && s.startsWith("!");
- if(flag) {
- s = s.substring(1);
- }
- if(s != null) {
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(!(p_apply_1_ instanceof EntityLivingBase)) {
- return false;
- } else {
- EntityLivingBase entitylivingbase = (EntityLivingBase)p_apply_1_;
- Team team = entitylivingbase.func_96124_cp();
- String s1 = team == null?"":team.func_96661_b();
- return s1.equals(s) != flag;
- }
- }
- });
- }
- return list;
- }
- private static List<Predicate<Entity>> func_184952_c(final ICommandSender p_184952_0_, Map<String, String> p_184952_1_) {
- final Map<String, Integer> map = func_96560_a(p_184952_1_);
- return (List<Predicate<Entity>>)(map.isEmpty()?Collections.emptyList():Lists.newArrayList(new Predicate[]{new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(p_apply_1_ == null) {
- return false;
- } else {
- Scoreboard scoreboard = p_184952_0_.func_184102_h().func_71218_a(0).func_96441_U();
- for(Entry<String, Integer> entry : map.entrySet()) {
- String s = (String)entry.getKey();
- boolean flag = false;
- if(s.endsWith("_min") && s.length() > 4) {
- flag = true;
- s = s.substring(0, s.length() - 4);
- }
- ScoreObjective scoreobjective = scoreboard.func_96518_b(s);
- if(scoreobjective == null) {
- return false;
- }
- String s1 = p_apply_1_ instanceof EntityPlayerMP?p_apply_1_.func_70005_c_():p_apply_1_.func_189512_bd();
- if(!scoreboard.func_178819_b(s1, scoreobjective)) {
- return false;
- }
- Score score = scoreboard.func_96529_a(s1, scoreobjective);
- int i = score.func_96652_c();
- if(i < ((Integer)entry.getValue()).intValue() && flag) {
- return false;
- }
- if(i > ((Integer)entry.getValue()).intValue() && !flag) {
- return false;
- }
- }
- return true;
- }
- }
- }}));
- }
- private static List<Predicate<Entity>> func_179647_f(Map<String, String> p_179647_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- final String s = func_179651_b(p_179647_0_, field_190848_v);
- final boolean flag = s != null && s.startsWith("!");
- if(flag) {
- s = s.substring(1);
- }
- if(s != null) {
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return p_apply_1_ != null && p_apply_1_.func_70005_c_().equals(s) != flag;
- }
- });
- }
- return list;
- }
- private static List<Predicate<Entity>> func_184951_f(Map<String, String> p_184951_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- final String s = func_179651_b(p_184951_0_, field_190850_x);
- final boolean flag = s != null && s.startsWith("!");
- if(flag) {
- s = s.substring(1);
- }
- if(s != null) {
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- 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);
- }
- });
- }
- return list;
- }
- private static List<Predicate<Entity>> func_180698_a(Map<String, String> p_180698_0_, final Vec3d p_180698_1_) {
- double d0 = (double)func_179653_a(p_180698_0_, field_190832_f, -1);
- double d1 = (double)func_179653_a(p_180698_0_, field_190831_e, -1);
- final boolean flag = d0 < -0.5D;
- final boolean flag1 = d1 < -0.5D;
- if(flag && flag1) {
- return Collections.<Predicate<Entity>>emptyList();
- } else {
- double d2 = Math.max(d0, 1.0E-4D);
- final double d3 = d2 * d2;
- double d4 = Math.max(d1, 1.0E-4D);
- final double d5 = d4 * d4;
- return Lists.newArrayList(new Predicate[]{new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(p_apply_1_ == null) {
- return false;
- } else {
- 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);
- return (flag || d6 >= d3) && (flag1 || d6 <= d5);
- }
- }
- }});
- }
- }
- private static List<Predicate<Entity>> func_179662_g(Map<String, String> p_179662_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- if(p_179662_0_.containsKey(field_190844_r) || p_179662_0_.containsKey(field_190843_q)) {
- final int i = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190844_r, 0));
- final int j = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190843_q, 359));
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(p_apply_1_ == null) {
- return false;
- } else {
- int i1 = MathHelper.func_188209_b(MathHelper.func_76141_d(p_apply_1_.field_70177_z));
- return i > j?i1 >= i || i1 <= j:i1 >= i && i1 <= j;
- }
- }
- });
- }
- if(p_179662_0_.containsKey(field_190842_p) || p_179662_0_.containsKey(field_190841_o)) {
- final int k = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190842_p, 0));
- final int l = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190841_o, 359));
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(p_apply_1_ == null) {
- return false;
- } else {
- int i1 = MathHelper.func_188209_b(MathHelper.func_76141_d(p_apply_1_.field_70125_A));
- return k > l?i1 >= k || i1 <= l:i1 >= k && i1 <= l;
- }
- }
- });
- }
- return list;
- }
- 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_) {
- List<T> list = Lists.<T>newArrayList();
- String s = func_179651_b(p_179660_0_, field_190849_w);
- s = s != null && s.startsWith("!")?s.substring(1):s;
- boolean flag = !p_179660_3_.equals("e");
- boolean flag1 = p_179660_3_.equals("r") && s != null;
- int i = func_179653_a(p_179660_0_, field_190838_l, 0);
- int j = func_179653_a(p_179660_0_, field_190839_m, 0);
- int k = func_179653_a(p_179660_0_, field_190840_n, 0);
- int l = func_179653_a(p_179660_0_, field_190831_e, -1);
- Predicate<Entity> predicate = Predicates.and(p_179660_2_);
- Predicate<Entity> predicate1 = Predicates.<Entity>and(EntitySelectors.field_94557_a, predicate);
- if(!p_179660_0_.containsKey(field_190838_l) && !p_179660_0_.containsKey(field_190839_m) && !p_179660_0_.containsKey(field_190840_n)) {
- if(l >= 0) {
- 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));
- if(flag && !flag1) {
- list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate1));
- } else {
- list.addAll(p_179660_4_.<T>func_175647_a(p_179660_1_, axisalignedbb1, predicate1));
- }
- } else if(p_179660_3_.equals("a")) {
- list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate));
- } else if(!p_179660_3_.equals("p") && (!p_179660_3_.equals("r") || flag1)) {
- list.addAll(p_179660_4_.<T>func_175644_a(p_179660_1_, predicate1));
- } else {
- list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate1));
- }
- } else {
- final AxisAlignedBB axisalignedbb = func_179661_a(p_179660_5_, i, j, k);
- if(flag && !flag1) {
- Predicate<Entity> predicate2 = new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return p_apply_1_ != null && axisalignedbb.func_72326_a(p_apply_1_.func_174813_aQ());
- }
- };
- list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, Predicates.<T>and(predicate1, predicate2)));
- } else {
- list.addAll(p_179660_4_.<T>func_175647_a(p_179660_1_, axisalignedbb, predicate1));
- }
- }
- return list;
- }
- 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_) {
- int i = func_179653_a(p_179658_1_, field_190845_s, !p_179658_4_.equals("a") && !p_179658_4_.equals("e")?1:0);
- if(!p_179658_4_.equals("p") && !p_179658_4_.equals("a") && !p_179658_4_.equals("e")) {
- if(p_179658_4_.equals("r")) {
- Collections.shuffle((List<?>)p_179658_0_);
- }
- } else {
- Collections.sort((List<T>)p_179658_0_, new Comparator<Entity>() {
- public int compare(Entity p_compare_1_, Entity p_compare_2_) {
- 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();
- }
- });
- }
- Entity entity = p_179658_2_.func_174793_f();
- if(entity != null && p_179658_3_.isAssignableFrom(entity.getClass()) && i == 1 && ((List)p_179658_0_).contains(entity) && !"r".equals(p_179658_4_)) {
- p_179658_0_ = Lists.newArrayList(new Entity[]{entity});
- }
- if(i != 0) {
- if(i < 0) {
- Collections.reverse((List<?>)p_179658_0_);
- }
- p_179658_0_ = ((List)p_179658_0_).subList(0, Math.min(Math.abs(i), ((List)p_179658_0_).size()));
- }
- return (List)p_179658_0_;
- }
- private static AxisAlignedBB func_179661_a(BlockPos p_179661_0_, int p_179661_1_, int p_179661_2_, int p_179661_3_) {
- boolean flag = p_179661_1_ < 0;
- boolean flag1 = p_179661_2_ < 0;
- boolean flag2 = p_179661_3_ < 0;
- int i = p_179661_0_.func_177958_n() + (flag?p_179661_1_:0);
- int j = p_179661_0_.func_177956_o() + (flag1?p_179661_2_:0);
- int k = p_179661_0_.func_177952_p() + (flag2?p_179661_3_:0);
- int l = p_179661_0_.func_177958_n() + (flag?0:p_179661_1_) + 1;
- int i1 = p_179661_0_.func_177956_o() + (flag1?0:p_179661_2_) + 1;
- int j1 = p_179661_0_.func_177952_p() + (flag2?0:p_179661_3_) + 1;
- return new AxisAlignedBB((double)i, (double)j, (double)k, (double)l, (double)i1, (double)j1);
- }
- private static BlockPos func_179664_b(Map<String, String> p_179664_0_, BlockPos p_179664_1_) {
- 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()));
- }
- private static Vec3d func_189210_b(Map<String, String> p_189210_0_, Vec3d p_189210_1_) {
- 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));
- }
- private static double func_189211_a(Map<String, String> p_189211_0_, String p_189211_1_, double p_189211_2_, boolean p_189211_4_) {
- 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_;
- }
- private static boolean func_179665_h(Map<String, String> p_179665_0_) {
- for(String s : field_179666_d) {
- if(p_179665_0_.containsKey(s)) {
- return true;
- }
- }
- return false;
- }
- private static int func_179653_a(Map<String, String> p_179653_0_, String p_179653_1_, int p_179653_2_) {
- 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_;
- }
- @Nullable
- private static String func_179651_b(Map<String, String> p_179651_0_, String p_179651_1_) {
- return (String)p_179651_0_.get(p_179651_1_);
- }
- public static Map<String, Integer> func_96560_a(Map<String, String> p_96560_0_) {
- Map<String, Integer> map = Maps.<String, Integer>newHashMap();
- for(String s : p_96560_0_.keySet()) {
- if(s.startsWith("score_") && s.length() > "score_".length()) {
- map.put(s.substring("score_".length()), Integer.valueOf(MathHelper.func_82715_a((String)p_96560_0_.get(s), 1)));
- }
- }
- return map;
- }
- public static boolean func_82377_a(String p_82377_0_) throws CommandException {
- Matcher matcher = field_82389_a.matcher(p_82377_0_);
- if(!matcher.matches()) {
- return false;
- } else {
- Map<String, String> map = func_82381_h(matcher.group(2));
- String s = matcher.group(1);
- int i = !"a".equals(s) && !"e".equals(s)?1:0;
- return func_179653_a(map, field_190845_s, i) != 1;
- }
- }
- public static boolean func_82378_b(String p_82378_0_) {
- return field_82389_a.matcher(p_82378_0_).matches();
- }
- private static Map<String, String> func_82381_h(@Nullable String p_82381_0_) throws CommandException {
- Map<String, String> map = Maps.<String, String>newHashMap();
- if(p_82381_0_ == null) {
- return map;
- } else {
- for(String s : field_190828_b.split(p_82381_0_)) {
- Iterator<String> iterator = field_190829_c.split(s).iterator();
- String s1 = (String)iterator.next();
- if(!field_190851_y.apply(s1)) {
- throw new CommandException("commands.generic.selector_argument", new Object[]{s});
- }
- map.put(s1, iterator.hasNext()?(String)iterator.next():"");
- }
- return map;
- }
- }
- }
- Hunk 8 failed! Cannot find hunk target
- private static List<Predicate<Entity>> func_184951_f(Map<String, String> p_184951_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- - final String s = func_179651_b(p_184951_0_, field_190850_x);
- + String s = func_179651_b(p_184951_0_, field_190850_x);
- final boolean flag = s != null && s.startsWith("!");
- if (flag) {
- s = s.substring(1);
- }
- if (s != null) {
- + final String s_f_ = s;
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if (p_apply_1_ == null) {
- return false;
- - } else if ("".equals(s)) {
- + } else if ("".equals(s_f_)) {
- return p_apply_1_.func_184216_O().isEmpty() != flag;
- } else {
- - return p_apply_1_.func_184216_O().contains(s) != flag;
- + return p_apply_1_.func_184216_O().contains(s_f_) != flag;
- }
- }
- });
- File state
- package net.minecraft.command;
- import com.google.common.base.Predicate;
- import com.google.common.base.Predicates;
- import com.google.common.base.Splitter;
- import com.google.common.collect.ComparisonChain;
- import com.google.common.collect.Lists;
- import com.google.common.collect.Maps;
- import com.google.common.collect.Sets;
- import java.util.Collections;
- import java.util.Comparator;
- import java.util.Iterator;
- import java.util.List;
- import java.util.Map;
- import java.util.Set;
- import java.util.Map.Entry;
- import java.util.regex.Matcher;
- import java.util.regex.Pattern;
- import javax.annotation.Nullable;
- import net.minecraft.command.CommandBase;
- import net.minecraft.command.CommandException;
- import net.minecraft.command.ICommandSender;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.EntityList;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.entity.player.EntityPlayerMP;
- import net.minecraft.scoreboard.Score;
- import net.minecraft.scoreboard.ScoreObjective;
- import net.minecraft.scoreboard.Scoreboard;
- import net.minecraft.scoreboard.Team;
- import net.minecraft.util.EntitySelectors;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.util.math.AxisAlignedBB;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.util.math.MathHelper;
- import net.minecraft.util.math.Vec3d;
- import net.minecraft.util.text.ITextComponent;
- import net.minecraft.util.text.TextComponentTranslation;
- import net.minecraft.util.text.TextFormatting;
- import net.minecraft.world.GameType;
- import net.minecraft.world.World;
- public class EntitySelector {
- private static final Pattern field_82389_a = Pattern.compile("^@([pares])(?:\\[([^ ]*)\\])?$");
- private static final Splitter field_190828_b = Splitter.on(',').omitEmptyStrings();
- private static final Splitter field_190829_c = Splitter.on('=').limit(2);
- private static final Set<String> field_190830_d = Sets.<String>newHashSet();
- private static final String field_190831_e = func_190826_c("r");
- private static final String field_190832_f = func_190826_c("rm");
- private static final String field_190833_g = func_190826_c("l");
- private static final String field_190834_h = func_190826_c("lm");
- private static final String field_190835_i = func_190826_c("x");
- private static final String field_190836_j = func_190826_c("y");
- private static final String field_190837_k = func_190826_c("z");
- private static final String field_190838_l = func_190826_c("dx");
- private static final String field_190839_m = func_190826_c("dy");
- private static final String field_190840_n = func_190826_c("dz");
- private static final String field_190841_o = func_190826_c("rx");
- private static final String field_190842_p = func_190826_c("rxm");
- private static final String field_190843_q = func_190826_c("ry");
- private static final String field_190844_r = func_190826_c("rym");
- private static final String field_190845_s = func_190826_c("c");
- private static final String field_190846_t = func_190826_c("m");
- private static final String field_190847_u = func_190826_c("team");
- private static final String field_190848_v = func_190826_c("name");
- private static final String field_190849_w = func_190826_c("type");
- private static final String field_190850_x = func_190826_c("tag");
- private static final Predicate<String> field_190851_y = new Predicate<String>() {
- public boolean apply(@Nullable String p_apply_1_) {
- return p_apply_1_ != null && (EntitySelector.field_190830_d.contains(p_apply_1_) || p_apply_1_.length() > "score_".length() && p_apply_1_.startsWith("score_"));
- }
- };
- 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});
- public static String func_190826_c(String p_190826_0_) {
- field_190830_d.add(p_190826_0_);
- return p_190826_0_;
- }
- @Nullable
- public static EntityPlayerMP func_82386_a(ICommandSender p_82386_0_, String p_82386_1_) throws CommandException {
- return (EntityPlayerMP)func_179652_a(p_82386_0_, p_82386_1_, EntityPlayerMP.class);
- }
- public static List<EntityPlayerMP> func_193531_b(ICommandSender p_193531_0_, String p_193531_1_) throws CommandException {
- return func_179656_b(p_193531_0_, p_193531_1_, EntityPlayerMP.class);
- }
- @Nullable
- 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 {
- List<T> list = func_179656_b(p_179652_0_, p_179652_1_, p_179652_2_);
- return (T)(list.size() == 1?(Entity)list.get(0):null);
- }
- @Nullable
- public static ITextComponent func_150869_b(ICommandSender p_150869_0_, String p_150869_1_) throws CommandException {
- List<Entity> list = func_179656_b(p_150869_0_, p_150869_1_, Entity.class);
- if(list.isEmpty()) {
- return null;
- } else {
- List<ITextComponent> list1 = Lists.<ITextComponent>newArrayList();
- for(Entity entity : list) {
- list1.add(entity.func_145748_c_());
- }
- return CommandBase.func_180530_a(list1);
- }
- }
- 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 {
- Matcher matcher = field_82389_a.matcher(p_179656_1_);
- if(matcher.matches() && p_179656_0_.func_70003_b(1, "@")) {
- Map<String, String> map = func_82381_h(matcher.group(2));
- if(!func_179655_b(p_179656_0_, map)) {
- return Collections.<T>emptyList();
- } else {
- String s = matcher.group(1);
- BlockPos blockpos = func_179664_b(map, p_179656_0_.func_180425_c());
- Vec3d vec3d = func_189210_b(map, p_179656_0_.func_174791_d());
- List<World> list = func_179654_a(p_179656_0_, map);
- List<T> list1 = Lists.<T>newArrayList();
- for(World world : list) {
- if(world != null) {
- List<Predicate<Entity>> list2 = Lists.<Predicate<Entity>>newArrayList();
- list2.addAll(func_179663_a(map, s));
- list2.addAll(func_179648_b(map));
- list2.addAll(func_179649_c(map));
- list2.addAll(func_179659_d(map));
- list2.addAll(func_184952_c(p_179656_0_, map));
- list2.addAll(func_179647_f(map));
- list2.addAll(func_184951_f(map));
- list2.addAll(func_180698_a(map, vec3d));
- list2.addAll(func_179662_g(map));
- if("s".equalsIgnoreCase(s)) {
- Entity entity = p_179656_0_.func_174793_f();
- if(entity != null && p_179656_2_.isAssignableFrom(entity.getClass())) {
- if(map.containsKey(field_190838_l) || map.containsKey(field_190839_m) || map.containsKey(field_190840_n)) {
- int i = func_179653_a(map, field_190838_l, 0);
- int j = func_179653_a(map, field_190839_m, 0);
- int k = func_179653_a(map, field_190840_n, 0);
- AxisAlignedBB axisalignedbb = func_179661_a(blockpos, i, j, k);
- if(!axisalignedbb.func_72326_a(entity.func_174813_aQ())) {
- return Collections.<T>emptyList();
- }
- }
- for(Predicate<Entity> predicate : list2) {
- if(!predicate.apply(entity)) {
- return Collections.<T>emptyList();
- }
- }
- return Lists.newArrayList(new Entity[]{entity});
- }
- return Collections.<T>emptyList();
- }
- list1.addAll(func_179660_a(map, p_179656_2_, list2, s, world, blockpos));
- }
- }
- return func_179658_a(list1, map, p_179656_0_, p_179656_2_, s, vec3d);
- }
- } else {
- return Collections.<T>emptyList();
- }
- }
- private static List<World> func_179654_a(ICommandSender p_179654_0_, Map<String, String> p_179654_1_) {
- List<World> list = Lists.<World>newArrayList();
- if(func_179665_h(p_179654_1_)) {
- list.add(p_179654_0_.func_130014_f_());
- } else {
- Collections.addAll(list, p_179654_0_.func_184102_h().field_71305_c);
- }
- return list;
- }
- private static <T extends Entity> boolean func_179655_b(ICommandSender p_179655_0_, Map<String, String> p_179655_1_) {
- String s = func_179651_b(p_179655_1_, field_190849_w);
- if(s == null) {
- return true;
- } else {
- ResourceLocation resourcelocation = new ResourceLocation(s.startsWith("!")?s.substring(1):s);
- if(EntityList.func_180125_b(resourcelocation)) {
- return true;
- } else {
- TextComponentTranslation textcomponenttranslation = new TextComponentTranslation("commands.generic.entity.invalidType", new Object[]{resourcelocation});
- textcomponenttranslation.func_150256_b().func_150238_a(TextFormatting.RED);
- p_179655_0_.func_145747_a(textcomponenttranslation);
- return false;
- }
- }
- }
- private static List<Predicate<Entity>> func_179663_a(Map<String, String> p_179663_0_, String p_179663_1_) {
- String s = func_179651_b(p_179663_0_, field_190849_w);
- if(s == null || !p_179663_1_.equals("e") && !p_179663_1_.equals("r") && !p_179663_1_.equals("s")) {
- return !p_179663_1_.equals("e") && !p_179663_1_.equals("s")?Collections.singletonList(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return p_apply_1_ instanceof EntityPlayer;
- }
- }):Collections.emptyList();
- } else {
- final boolean flag = s.startsWith("!");
- final ResourceLocation resourcelocation = new ResourceLocation(flag?s.substring(1):s);
- return Collections.singletonList(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return EntityList.func_180123_a(p_apply_1_, resourcelocation) != flag;
- }
- });
- }
- }
- private static List<Predicate<Entity>> func_179648_b(Map<String, String> p_179648_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- final int i = func_179653_a(p_179648_0_, field_190834_h, -1);
- final int j = func_179653_a(p_179648_0_, field_190833_g, -1);
- if(i > -1 || j > -1) {
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(!(p_apply_1_ instanceof EntityPlayerMP)) {
- return false;
- } else {
- EntityPlayerMP entityplayermp = (EntityPlayerMP)p_apply_1_;
- return (i <= -1 || entityplayermp.field_71068_ca >= i) && (j <= -1 || entityplayermp.field_71068_ca <= j);
- }
- }
- });
- }
- return list;
- }
- private static List<Predicate<Entity>> func_179649_c(Map<String, String> p_179649_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- String s = func_179651_b(p_179649_0_, field_190846_t);
- if(s == null) {
- return list;
- } else {
- final boolean flag = s.startsWith("!");
- if(flag) {
- s = s.substring(1);
- }
- final GameType gametype;
- try {
- int i = Integer.parseInt(s);
- gametype = GameType.func_185329_a(i, GameType.NOT_SET);
- } catch (Throwable var6) {
- gametype = GameType.func_185328_a(s, GameType.NOT_SET);
- }
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(!(p_apply_1_ instanceof EntityPlayerMP)) {
- return false;
- } else {
- EntityPlayerMP entityplayermp = (EntityPlayerMP)p_apply_1_;
- GameType gametype1 = entityplayermp.field_71134_c.func_73081_b();
- return flag?gametype1 != gametype:gametype1 == gametype;
- }
- }
- });
- return list;
- }
- }
- private static List<Predicate<Entity>> func_179659_d(Map<String, String> p_179659_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- final String s = func_179651_b(p_179659_0_, field_190847_u);
- final boolean flag = s != null && s.startsWith("!");
- if(flag) {
- s = s.substring(1);
- }
- if(s != null) {
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(!(p_apply_1_ instanceof EntityLivingBase)) {
- return false;
- } else {
- EntityLivingBase entitylivingbase = (EntityLivingBase)p_apply_1_;
- Team team = entitylivingbase.func_96124_cp();
- String s1 = team == null?"":team.func_96661_b();
- return s1.equals(s) != flag;
- }
- }
- });
- }
- return list;
- }
- private static List<Predicate<Entity>> func_184952_c(final ICommandSender p_184952_0_, Map<String, String> p_184952_1_) {
- final Map<String, Integer> map = func_96560_a(p_184952_1_);
- return (List<Predicate<Entity>>)(map.isEmpty()?Collections.emptyList():Lists.newArrayList(new Predicate[]{new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(p_apply_1_ == null) {
- return false;
- } else {
- Scoreboard scoreboard = p_184952_0_.func_184102_h().func_71218_a(0).func_96441_U();
- for(Entry<String, Integer> entry : map.entrySet()) {
- String s = (String)entry.getKey();
- boolean flag = false;
- if(s.endsWith("_min") && s.length() > 4) {
- flag = true;
- s = s.substring(0, s.length() - 4);
- }
- ScoreObjective scoreobjective = scoreboard.func_96518_b(s);
- if(scoreobjective == null) {
- return false;
- }
- String s1 = p_apply_1_ instanceof EntityPlayerMP?p_apply_1_.func_70005_c_():p_apply_1_.func_189512_bd();
- if(!scoreboard.func_178819_b(s1, scoreobjective)) {
- return false;
- }
- Score score = scoreboard.func_96529_a(s1, scoreobjective);
- int i = score.func_96652_c();
- if(i < ((Integer)entry.getValue()).intValue() && flag) {
- return false;
- }
- if(i > ((Integer)entry.getValue()).intValue() && !flag) {
- return false;
- }
- }
- return true;
- }
- }
- }}));
- }
- private static List<Predicate<Entity>> func_179647_f(Map<String, String> p_179647_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- final String s = func_179651_b(p_179647_0_, field_190848_v);
- final boolean flag = s != null && s.startsWith("!");
- if(flag) {
- s = s.substring(1);
- }
- if(s != null) {
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return p_apply_1_ != null && p_apply_1_.func_70005_c_().equals(s) != flag;
- }
- });
- }
- return list;
- }
- private static List<Predicate<Entity>> func_184951_f(Map<String, String> p_184951_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- final String s = func_179651_b(p_184951_0_, field_190850_x);
- final boolean flag = s != null && s.startsWith("!");
- if(flag) {
- s = s.substring(1);
- }
- if(s != null) {
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- 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);
- }
- });
- }
- return list;
- }
- private static List<Predicate<Entity>> func_180698_a(Map<String, String> p_180698_0_, final Vec3d p_180698_1_) {
- double d0 = (double)func_179653_a(p_180698_0_, field_190832_f, -1);
- double d1 = (double)func_179653_a(p_180698_0_, field_190831_e, -1);
- final boolean flag = d0 < -0.5D;
- final boolean flag1 = d1 < -0.5D;
- if(flag && flag1) {
- return Collections.<Predicate<Entity>>emptyList();
- } else {
- double d2 = Math.max(d0, 1.0E-4D);
- final double d3 = d2 * d2;
- double d4 = Math.max(d1, 1.0E-4D);
- final double d5 = d4 * d4;
- return Lists.newArrayList(new Predicate[]{new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(p_apply_1_ == null) {
- return false;
- } else {
- 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);
- return (flag || d6 >= d3) && (flag1 || d6 <= d5);
- }
- }
- }});
- }
- }
- private static List<Predicate<Entity>> func_179662_g(Map<String, String> p_179662_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- if(p_179662_0_.containsKey(field_190844_r) || p_179662_0_.containsKey(field_190843_q)) {
- final int i = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190844_r, 0));
- final int j = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190843_q, 359));
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(p_apply_1_ == null) {
- return false;
- } else {
- int i1 = MathHelper.func_188209_b(MathHelper.func_76141_d(p_apply_1_.field_70177_z));
- return i > j?i1 >= i || i1 <= j:i1 >= i && i1 <= j;
- }
- }
- });
- }
- if(p_179662_0_.containsKey(field_190842_p) || p_179662_0_.containsKey(field_190841_o)) {
- final int k = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190842_p, 0));
- final int l = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190841_o, 359));
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(p_apply_1_ == null) {
- return false;
- } else {
- int i1 = MathHelper.func_188209_b(MathHelper.func_76141_d(p_apply_1_.field_70125_A));
- return k > l?i1 >= k || i1 <= l:i1 >= k && i1 <= l;
- }
- }
- });
- }
- return list;
- }
- 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_) {
- List<T> list = Lists.<T>newArrayList();
- String s = func_179651_b(p_179660_0_, field_190849_w);
- s = s != null && s.startsWith("!")?s.substring(1):s;
- boolean flag = !p_179660_3_.equals("e");
- boolean flag1 = p_179660_3_.equals("r") && s != null;
- int i = func_179653_a(p_179660_0_, field_190838_l, 0);
- int j = func_179653_a(p_179660_0_, field_190839_m, 0);
- int k = func_179653_a(p_179660_0_, field_190840_n, 0);
- int l = func_179653_a(p_179660_0_, field_190831_e, -1);
- Predicate<Entity> predicate = Predicates.and(p_179660_2_);
- Predicate<Entity> predicate1 = Predicates.<Entity>and(EntitySelectors.field_94557_a, predicate);
- if(!p_179660_0_.containsKey(field_190838_l) && !p_179660_0_.containsKey(field_190839_m) && !p_179660_0_.containsKey(field_190840_n)) {
- if(l >= 0) {
- 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));
- if(flag && !flag1) {
- list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate1));
- } else {
- list.addAll(p_179660_4_.<T>func_175647_a(p_179660_1_, axisalignedbb1, predicate1));
- }
- } else if(p_179660_3_.equals("a")) {
- list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate));
- } else if(!p_179660_3_.equals("p") && (!p_179660_3_.equals("r") || flag1)) {
- list.addAll(p_179660_4_.<T>func_175644_a(p_179660_1_, predicate1));
- } else {
- list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate1));
- }
- } else {
- final AxisAlignedBB axisalignedbb = func_179661_a(p_179660_5_, i, j, k);
- if(flag && !flag1) {
- Predicate<Entity> predicate2 = new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return p_apply_1_ != null && axisalignedbb.func_72326_a(p_apply_1_.func_174813_aQ());
- }
- };
- list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, Predicates.<T>and(predicate1, predicate2)));
- } else {
- list.addAll(p_179660_4_.<T>func_175647_a(p_179660_1_, axisalignedbb, predicate1));
- }
- }
- return list;
- }
- 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_) {
- int i = func_179653_a(p_179658_1_, field_190845_s, !p_179658_4_.equals("a") && !p_179658_4_.equals("e")?1:0);
- if(!p_179658_4_.equals("p") && !p_179658_4_.equals("a") && !p_179658_4_.equals("e")) {
- if(p_179658_4_.equals("r")) {
- Collections.shuffle((List<?>)p_179658_0_);
- }
- } else {
- Collections.sort((List<T>)p_179658_0_, new Comparator<Entity>() {
- public int compare(Entity p_compare_1_, Entity p_compare_2_) {
- 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();
- }
- });
- }
- Entity entity = p_179658_2_.func_174793_f();
- if(entity != null && p_179658_3_.isAssignableFrom(entity.getClass()) && i == 1 && ((List)p_179658_0_).contains(entity) && !"r".equals(p_179658_4_)) {
- p_179658_0_ = Lists.newArrayList(new Entity[]{entity});
- }
- if(i != 0) {
- if(i < 0) {
- Collections.reverse((List<?>)p_179658_0_);
- }
- p_179658_0_ = ((List)p_179658_0_).subList(0, Math.min(Math.abs(i), ((List)p_179658_0_).size()));
- }
- return (List)p_179658_0_;
- }
- private static AxisAlignedBB func_179661_a(BlockPos p_179661_0_, int p_179661_1_, int p_179661_2_, int p_179661_3_) {
- boolean flag = p_179661_1_ < 0;
- boolean flag1 = p_179661_2_ < 0;
- boolean flag2 = p_179661_3_ < 0;
- int i = p_179661_0_.func_177958_n() + (flag?p_179661_1_:0);
- int j = p_179661_0_.func_177956_o() + (flag1?p_179661_2_:0);
- int k = p_179661_0_.func_177952_p() + (flag2?p_179661_3_:0);
- int l = p_179661_0_.func_177958_n() + (flag?0:p_179661_1_) + 1;
- int i1 = p_179661_0_.func_177956_o() + (flag1?0:p_179661_2_) + 1;
- int j1 = p_179661_0_.func_177952_p() + (flag2?0:p_179661_3_) + 1;
- return new AxisAlignedBB((double)i, (double)j, (double)k, (double)l, (double)i1, (double)j1);
- }
- private static BlockPos func_179664_b(Map<String, String> p_179664_0_, BlockPos p_179664_1_) {
- 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()));
- }
- private static Vec3d func_189210_b(Map<String, String> p_189210_0_, Vec3d p_189210_1_) {
- 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));
- }
- private static double func_189211_a(Map<String, String> p_189211_0_, String p_189211_1_, double p_189211_2_, boolean p_189211_4_) {
- 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_;
- }
- private static boolean func_179665_h(Map<String, String> p_179665_0_) {
- for(String s : field_179666_d) {
- if(p_179665_0_.containsKey(s)) {
- return true;
- }
- }
- return false;
- }
- private static int func_179653_a(Map<String, String> p_179653_0_, String p_179653_1_, int p_179653_2_) {
- 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_;
- }
- @Nullable
- private static String func_179651_b(Map<String, String> p_179651_0_, String p_179651_1_) {
- return (String)p_179651_0_.get(p_179651_1_);
- }
- public static Map<String, Integer> func_96560_a(Map<String, String> p_96560_0_) {
- Map<String, Integer> map = Maps.<String, Integer>newHashMap();
- for(String s : p_96560_0_.keySet()) {
- if(s.startsWith("score_") && s.length() > "score_".length()) {
- map.put(s.substring("score_".length()), Integer.valueOf(MathHelper.func_82715_a((String)p_96560_0_.get(s), 1)));
- }
- }
- return map;
- }
- public static boolean func_82377_a(String p_82377_0_) throws CommandException {
- Matcher matcher = field_82389_a.matcher(p_82377_0_);
- if(!matcher.matches()) {
- return false;
- } else {
- Map<String, String> map = func_82381_h(matcher.group(2));
- String s = matcher.group(1);
- int i = !"a".equals(s) && !"e".equals(s)?1:0;
- return func_179653_a(map, field_190845_s, i) != 1;
- }
- }
- public static boolean func_82378_b(String p_82378_0_) {
- return field_82389_a.matcher(p_82378_0_).matches();
- }
- private static Map<String, String> func_82381_h(@Nullable String p_82381_0_) throws CommandException {
- Map<String, String> map = Maps.<String, String>newHashMap();
- if(p_82381_0_ == null) {
- return map;
- } else {
- for(String s : field_190828_b.split(p_82381_0_)) {
- Iterator<String> iterator = field_190829_c.split(s).iterator();
- String s1 = (String)iterator.next();
- if(!field_190851_y.apply(s1)) {
- throw new CommandException("commands.generic.selector_argument", new Object[]{s});
- }
- map.put(s1, iterator.hasNext()?(String)iterator.next():"");
- }
- return map;
- }
- }
- }
- Hunk 9 failed! Cannot find hunk target
- Entity entity = p_179658_2_.func_174793_f();
- if (entity != null && p_179658_3_.isAssignableFrom(entity.getClass()) && i == 1 && p_179658_0_.contains(entity) && !"r".equals(p_179658_4_)) {
- - p_179658_0_ = Lists.newArrayList(entity);
- + p_179658_0_ = Lists.newArrayList((T)entity);
- }
- if (i != 0) {
- File state
- package net.minecraft.command;
- import com.google.common.base.Predicate;
- import com.google.common.base.Predicates;
- import com.google.common.base.Splitter;
- import com.google.common.collect.ComparisonChain;
- import com.google.common.collect.Lists;
- import com.google.common.collect.Maps;
- import com.google.common.collect.Sets;
- import java.util.Collections;
- import java.util.Comparator;
- import java.util.Iterator;
- import java.util.List;
- import java.util.Map;
- import java.util.Set;
- import java.util.Map.Entry;
- import java.util.regex.Matcher;
- import java.util.regex.Pattern;
- import javax.annotation.Nullable;
- import net.minecraft.command.CommandBase;
- import net.minecraft.command.CommandException;
- import net.minecraft.command.ICommandSender;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.EntityList;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.entity.player.EntityPlayerMP;
- import net.minecraft.scoreboard.Score;
- import net.minecraft.scoreboard.ScoreObjective;
- import net.minecraft.scoreboard.Scoreboard;
- import net.minecraft.scoreboard.Team;
- import net.minecraft.util.EntitySelectors;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.util.math.AxisAlignedBB;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.util.math.MathHelper;
- import net.minecraft.util.math.Vec3d;
- import net.minecraft.util.text.ITextComponent;
- import net.minecraft.util.text.TextComponentTranslation;
- import net.minecraft.util.text.TextFormatting;
- import net.minecraft.world.GameType;
- import net.minecraft.world.World;
- public class EntitySelector {
- private static final Pattern field_82389_a = Pattern.compile("^@([pares])(?:\\[([^ ]*)\\])?$");
- private static final Splitter field_190828_b = Splitter.on(',').omitEmptyStrings();
- private static final Splitter field_190829_c = Splitter.on('=').limit(2);
- private static final Set<String> field_190830_d = Sets.<String>newHashSet();
- private static final String field_190831_e = func_190826_c("r");
- private static final String field_190832_f = func_190826_c("rm");
- private static final String field_190833_g = func_190826_c("l");
- private static final String field_190834_h = func_190826_c("lm");
- private static final String field_190835_i = func_190826_c("x");
- private static final String field_190836_j = func_190826_c("y");
- private static final String field_190837_k = func_190826_c("z");
- private static final String field_190838_l = func_190826_c("dx");
- private static final String field_190839_m = func_190826_c("dy");
- private static final String field_190840_n = func_190826_c("dz");
- private static final String field_190841_o = func_190826_c("rx");
- private static final String field_190842_p = func_190826_c("rxm");
- private static final String field_190843_q = func_190826_c("ry");
- private static final String field_190844_r = func_190826_c("rym");
- private static final String field_190845_s = func_190826_c("c");
- private static final String field_190846_t = func_190826_c("m");
- private static final String field_190847_u = func_190826_c("team");
- private static final String field_190848_v = func_190826_c("name");
- private static final String field_190849_w = func_190826_c("type");
- private static final String field_190850_x = func_190826_c("tag");
- private static final Predicate<String> field_190851_y = new Predicate<String>() {
- public boolean apply(@Nullable String p_apply_1_) {
- return p_apply_1_ != null && (EntitySelector.field_190830_d.contains(p_apply_1_) || p_apply_1_.length() > "score_".length() && p_apply_1_.startsWith("score_"));
- }
- };
- 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});
- public static String func_190826_c(String p_190826_0_) {
- field_190830_d.add(p_190826_0_);
- return p_190826_0_;
- }
- @Nullable
- public static EntityPlayerMP func_82386_a(ICommandSender p_82386_0_, String p_82386_1_) throws CommandException {
- return (EntityPlayerMP)func_179652_a(p_82386_0_, p_82386_1_, EntityPlayerMP.class);
- }
- public static List<EntityPlayerMP> func_193531_b(ICommandSender p_193531_0_, String p_193531_1_) throws CommandException {
- return func_179656_b(p_193531_0_, p_193531_1_, EntityPlayerMP.class);
- }
- @Nullable
- 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 {
- List<T> list = func_179656_b(p_179652_0_, p_179652_1_, p_179652_2_);
- return (T)(list.size() == 1?(Entity)list.get(0):null);
- }
- @Nullable
- public static ITextComponent func_150869_b(ICommandSender p_150869_0_, String p_150869_1_) throws CommandException {
- List<Entity> list = func_179656_b(p_150869_0_, p_150869_1_, Entity.class);
- if(list.isEmpty()) {
- return null;
- } else {
- List<ITextComponent> list1 = Lists.<ITextComponent>newArrayList();
- for(Entity entity : list) {
- list1.add(entity.func_145748_c_());
- }
- return CommandBase.func_180530_a(list1);
- }
- }
- 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 {
- Matcher matcher = field_82389_a.matcher(p_179656_1_);
- if(matcher.matches() && p_179656_0_.func_70003_b(1, "@")) {
- Map<String, String> map = func_82381_h(matcher.group(2));
- if(!func_179655_b(p_179656_0_, map)) {
- return Collections.<T>emptyList();
- } else {
- String s = matcher.group(1);
- BlockPos blockpos = func_179664_b(map, p_179656_0_.func_180425_c());
- Vec3d vec3d = func_189210_b(map, p_179656_0_.func_174791_d());
- List<World> list = func_179654_a(p_179656_0_, map);
- List<T> list1 = Lists.<T>newArrayList();
- for(World world : list) {
- if(world != null) {
- List<Predicate<Entity>> list2 = Lists.<Predicate<Entity>>newArrayList();
- list2.addAll(func_179663_a(map, s));
- list2.addAll(func_179648_b(map));
- list2.addAll(func_179649_c(map));
- list2.addAll(func_179659_d(map));
- list2.addAll(func_184952_c(p_179656_0_, map));
- list2.addAll(func_179647_f(map));
- list2.addAll(func_184951_f(map));
- list2.addAll(func_180698_a(map, vec3d));
- list2.addAll(func_179662_g(map));
- if("s".equalsIgnoreCase(s)) {
- Entity entity = p_179656_0_.func_174793_f();
- if(entity != null && p_179656_2_.isAssignableFrom(entity.getClass())) {
- if(map.containsKey(field_190838_l) || map.containsKey(field_190839_m) || map.containsKey(field_190840_n)) {
- int i = func_179653_a(map, field_190838_l, 0);
- int j = func_179653_a(map, field_190839_m, 0);
- int k = func_179653_a(map, field_190840_n, 0);
- AxisAlignedBB axisalignedbb = func_179661_a(blockpos, i, j, k);
- if(!axisalignedbb.func_72326_a(entity.func_174813_aQ())) {
- return Collections.<T>emptyList();
- }
- }
- for(Predicate<Entity> predicate : list2) {
- if(!predicate.apply(entity)) {
- return Collections.<T>emptyList();
- }
- }
- return Lists.newArrayList(new Entity[]{entity});
- }
- return Collections.<T>emptyList();
- }
- list1.addAll(func_179660_a(map, p_179656_2_, list2, s, world, blockpos));
- }
- }
- return func_179658_a(list1, map, p_179656_0_, p_179656_2_, s, vec3d);
- }
- } else {
- return Collections.<T>emptyList();
- }
- }
- private static List<World> func_179654_a(ICommandSender p_179654_0_, Map<String, String> p_179654_1_) {
- List<World> list = Lists.<World>newArrayList();
- if(func_179665_h(p_179654_1_)) {
- list.add(p_179654_0_.func_130014_f_());
- } else {
- Collections.addAll(list, p_179654_0_.func_184102_h().field_71305_c);
- }
- return list;
- }
- private static <T extends Entity> boolean func_179655_b(ICommandSender p_179655_0_, Map<String, String> p_179655_1_) {
- String s = func_179651_b(p_179655_1_, field_190849_w);
- if(s == null) {
- return true;
- } else {
- ResourceLocation resourcelocation = new ResourceLocation(s.startsWith("!")?s.substring(1):s);
- if(EntityList.func_180125_b(resourcelocation)) {
- return true;
- } else {
- TextComponentTranslation textcomponenttranslation = new TextComponentTranslation("commands.generic.entity.invalidType", new Object[]{resourcelocation});
- textcomponenttranslation.func_150256_b().func_150238_a(TextFormatting.RED);
- p_179655_0_.func_145747_a(textcomponenttranslation);
- return false;
- }
- }
- }
- private static List<Predicate<Entity>> func_179663_a(Map<String, String> p_179663_0_, String p_179663_1_) {
- String s = func_179651_b(p_179663_0_, field_190849_w);
- if(s == null || !p_179663_1_.equals("e") && !p_179663_1_.equals("r") && !p_179663_1_.equals("s")) {
- return !p_179663_1_.equals("e") && !p_179663_1_.equals("s")?Collections.singletonList(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return p_apply_1_ instanceof EntityPlayer;
- }
- }):Collections.emptyList();
- } else {
- final boolean flag = s.startsWith("!");
- final ResourceLocation resourcelocation = new ResourceLocation(flag?s.substring(1):s);
- return Collections.singletonList(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return EntityList.func_180123_a(p_apply_1_, resourcelocation) != flag;
- }
- });
- }
- }
- private static List<Predicate<Entity>> func_179648_b(Map<String, String> p_179648_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- final int i = func_179653_a(p_179648_0_, field_190834_h, -1);
- final int j = func_179653_a(p_179648_0_, field_190833_g, -1);
- if(i > -1 || j > -1) {
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(!(p_apply_1_ instanceof EntityPlayerMP)) {
- return false;
- } else {
- EntityPlayerMP entityplayermp = (EntityPlayerMP)p_apply_1_;
- return (i <= -1 || entityplayermp.field_71068_ca >= i) && (j <= -1 || entityplayermp.field_71068_ca <= j);
- }
- }
- });
- }
- return list;
- }
- private static List<Predicate<Entity>> func_179649_c(Map<String, String> p_179649_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- String s = func_179651_b(p_179649_0_, field_190846_t);
- if(s == null) {
- return list;
- } else {
- final boolean flag = s.startsWith("!");
- if(flag) {
- s = s.substring(1);
- }
- final GameType gametype;
- try {
- int i = Integer.parseInt(s);
- gametype = GameType.func_185329_a(i, GameType.NOT_SET);
- } catch (Throwable var6) {
- gametype = GameType.func_185328_a(s, GameType.NOT_SET);
- }
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(!(p_apply_1_ instanceof EntityPlayerMP)) {
- return false;
- } else {
- EntityPlayerMP entityplayermp = (EntityPlayerMP)p_apply_1_;
- GameType gametype1 = entityplayermp.field_71134_c.func_73081_b();
- return flag?gametype1 != gametype:gametype1 == gametype;
- }
- }
- });
- return list;
- }
- }
- private static List<Predicate<Entity>> func_179659_d(Map<String, String> p_179659_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- final String s = func_179651_b(p_179659_0_, field_190847_u);
- final boolean flag = s != null && s.startsWith("!");
- if(flag) {
- s = s.substring(1);
- }
- if(s != null) {
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(!(p_apply_1_ instanceof EntityLivingBase)) {
- return false;
- } else {
- EntityLivingBase entitylivingbase = (EntityLivingBase)p_apply_1_;
- Team team = entitylivingbase.func_96124_cp();
- String s1 = team == null?"":team.func_96661_b();
- return s1.equals(s) != flag;
- }
- }
- });
- }
- return list;
- }
- private static List<Predicate<Entity>> func_184952_c(final ICommandSender p_184952_0_, Map<String, String> p_184952_1_) {
- final Map<String, Integer> map = func_96560_a(p_184952_1_);
- return (List<Predicate<Entity>>)(map.isEmpty()?Collections.emptyList():Lists.newArrayList(new Predicate[]{new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(p_apply_1_ == null) {
- return false;
- } else {
- Scoreboard scoreboard = p_184952_0_.func_184102_h().func_71218_a(0).func_96441_U();
- for(Entry<String, Integer> entry : map.entrySet()) {
- String s = (String)entry.getKey();
- boolean flag = false;
- if(s.endsWith("_min") && s.length() > 4) {
- flag = true;
- s = s.substring(0, s.length() - 4);
- }
- ScoreObjective scoreobjective = scoreboard.func_96518_b(s);
- if(scoreobjective == null) {
- return false;
- }
- String s1 = p_apply_1_ instanceof EntityPlayerMP?p_apply_1_.func_70005_c_():p_apply_1_.func_189512_bd();
- if(!scoreboard.func_178819_b(s1, scoreobjective)) {
- return false;
- }
- Score score = scoreboard.func_96529_a(s1, scoreobjective);
- int i = score.func_96652_c();
- if(i < ((Integer)entry.getValue()).intValue() && flag) {
- return false;
- }
- if(i > ((Integer)entry.getValue()).intValue() && !flag) {
- return false;
- }
- }
- return true;
- }
- }
- }}));
- }
- private static List<Predicate<Entity>> func_179647_f(Map<String, String> p_179647_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- final String s = func_179651_b(p_179647_0_, field_190848_v);
- final boolean flag = s != null && s.startsWith("!");
- if(flag) {
- s = s.substring(1);
- }
- if(s != null) {
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return p_apply_1_ != null && p_apply_1_.func_70005_c_().equals(s) != flag;
- }
- });
- }
- return list;
- }
- private static List<Predicate<Entity>> func_184951_f(Map<String, String> p_184951_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- final String s = func_179651_b(p_184951_0_, field_190850_x);
- final boolean flag = s != null && s.startsWith("!");
- if(flag) {
- s = s.substring(1);
- }
- if(s != null) {
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- 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);
- }
- });
- }
- return list;
- }
- private static List<Predicate<Entity>> func_180698_a(Map<String, String> p_180698_0_, final Vec3d p_180698_1_) {
- double d0 = (double)func_179653_a(p_180698_0_, field_190832_f, -1);
- double d1 = (double)func_179653_a(p_180698_0_, field_190831_e, -1);
- final boolean flag = d0 < -0.5D;
- final boolean flag1 = d1 < -0.5D;
- if(flag && flag1) {
- return Collections.<Predicate<Entity>>emptyList();
- } else {
- double d2 = Math.max(d0, 1.0E-4D);
- final double d3 = d2 * d2;
- double d4 = Math.max(d1, 1.0E-4D);
- final double d5 = d4 * d4;
- return Lists.newArrayList(new Predicate[]{new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(p_apply_1_ == null) {
- return false;
- } else {
- 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);
- return (flag || d6 >= d3) && (flag1 || d6 <= d5);
- }
- }
- }});
- }
- }
- private static List<Predicate<Entity>> func_179662_g(Map<String, String> p_179662_0_) {
- List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
- if(p_179662_0_.containsKey(field_190844_r) || p_179662_0_.containsKey(field_190843_q)) {
- final int i = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190844_r, 0));
- final int j = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190843_q, 359));
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(p_apply_1_ == null) {
- return false;
- } else {
- int i1 = MathHelper.func_188209_b(MathHelper.func_76141_d(p_apply_1_.field_70177_z));
- return i > j?i1 >= i || i1 <= j:i1 >= i && i1 <= j;
- }
- }
- });
- }
- if(p_179662_0_.containsKey(field_190842_p) || p_179662_0_.containsKey(field_190841_o)) {
- final int k = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190842_p, 0));
- final int l = MathHelper.func_188209_b(func_179653_a(p_179662_0_, field_190841_o, 359));
- list.add(new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(p_apply_1_ == null) {
- return false;
- } else {
- int i1 = MathHelper.func_188209_b(MathHelper.func_76141_d(p_apply_1_.field_70125_A));
- return k > l?i1 >= k || i1 <= l:i1 >= k && i1 <= l;
- }
- }
- });
- }
- return list;
- }
- 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_) {
- List<T> list = Lists.<T>newArrayList();
- String s = func_179651_b(p_179660_0_, field_190849_w);
- s = s != null && s.startsWith("!")?s.substring(1):s;
- boolean flag = !p_179660_3_.equals("e");
- boolean flag1 = p_179660_3_.equals("r") && s != null;
- int i = func_179653_a(p_179660_0_, field_190838_l, 0);
- int j = func_179653_a(p_179660_0_, field_190839_m, 0);
- int k = func_179653_a(p_179660_0_, field_190840_n, 0);
- int l = func_179653_a(p_179660_0_, field_190831_e, -1);
- Predicate<Entity> predicate = Predicates.and(p_179660_2_);
- Predicate<Entity> predicate1 = Predicates.<Entity>and(EntitySelectors.field_94557_a, predicate);
- if(!p_179660_0_.containsKey(field_190838_l) && !p_179660_0_.containsKey(field_190839_m) && !p_179660_0_.containsKey(field_190840_n)) {
- if(l >= 0) {
- 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));
- if(flag && !flag1) {
- list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate1));
- } else {
- list.addAll(p_179660_4_.<T>func_175647_a(p_179660_1_, axisalignedbb1, predicate1));
- }
- } else if(p_179660_3_.equals("a")) {
- list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate));
- } else if(!p_179660_3_.equals("p") && (!p_179660_3_.equals("r") || flag1)) {
- list.addAll(p_179660_4_.<T>func_175644_a(p_179660_1_, predicate1));
- } else {
- list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, predicate1));
- }
- } else {
- final AxisAlignedBB axisalignedbb = func_179661_a(p_179660_5_, i, j, k);
- if(flag && !flag1) {
- Predicate<Entity> predicate2 = new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return p_apply_1_ != null && axisalignedbb.func_72326_a(p_apply_1_.func_174813_aQ());
- }
- };
- list.addAll(p_179660_4_.<T>func_175661_b(p_179660_1_, Predicates.<T>and(predicate1, predicate2)));
- } else {
- list.addAll(p_179660_4_.<T>func_175647_a(p_179660_1_, axisalignedbb, predicate1));
- }
- }
- return list;
- }
- 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_) {
- int i = func_179653_a(p_179658_1_, field_190845_s, !p_179658_4_.equals("a") && !p_179658_4_.equals("e")?1:0);
- if(!p_179658_4_.equals("p") && !p_179658_4_.equals("a") && !p_179658_4_.equals("e")) {
- if(p_179658_4_.equals("r")) {
- Collections.shuffle((List<?>)p_179658_0_);
- }
- } else {
- Collections.sort((List<T>)p_179658_0_, new Comparator<Entity>() {
- public int compare(Entity p_compare_1_, Entity p_compare_2_) {
- 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();
- }
- });
- }
- Entity entity = p_179658_2_.func_174793_f();
- if(entity != null && p_179658_3_.isAssignableFrom(entity.getClass()) && i == 1 && ((List)p_179658_0_).contains(entity) && !"r".equals(p_179658_4_)) {
- p_179658_0_ = Lists.newArrayList(new Entity[]{entity});
- }
- if(i != 0) {
- if(i < 0) {
- Collections.reverse((List<?>)p_179658_0_);
- }
- p_179658_0_ = ((List)p_179658_0_).subList(0, Math.min(Math.abs(i), ((List)p_179658_0_).size()));
- }
- return (List)p_179658_0_;
- }
- private static AxisAlignedBB func_179661_a(BlockPos p_179661_0_, int p_179661_1_, int p_179661_2_, int p_179661_3_) {
- boolean flag = p_179661_1_ < 0;
- boolean flag1 = p_179661_2_ < 0;
- boolean flag2 = p_179661_3_ < 0;
- int i = p_179661_0_.func_177958_n() + (flag?p_179661_1_:0);
- int j = p_179661_0_.func_177956_o() + (flag1?p_179661_2_:0);
- int k = p_179661_0_.func_177952_p() + (flag2?p_179661_3_:0);
- int l = p_179661_0_.func_177958_n() + (flag?0:p_179661_1_) + 1;
- int i1 = p_179661_0_.func_177956_o() + (flag1?0:p_179661_2_) + 1;
- int j1 = p_179661_0_.func_177952_p() + (flag2?0:p_179661_3_) + 1;
- return new AxisAlignedBB((double)i, (double)j, (double)k, (double)l, (double)i1, (double)j1);
- }
- private static BlockPos func_179664_b(Map<String, String> p_179664_0_, BlockPos p_179664_1_) {
- 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()));
- }
- private static Vec3d func_189210_b(Map<String, String> p_189210_0_, Vec3d p_189210_1_) {
- 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));
- }
- private static double func_189211_a(Map<String, String> p_189211_0_, String p_189211_1_, double p_189211_2_, boolean p_189211_4_) {
- 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_;
- }
- private static boolean func_179665_h(Map<String, String> p_179665_0_) {
- for(String s : field_179666_d) {
- if(p_179665_0_.containsKey(s)) {
- return true;
- }
- }
- return false;
- }
- private static int func_179653_a(Map<String, String> p_179653_0_, String p_179653_1_, int p_179653_2_) {
- 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_;
- }
- @Nullable
- private static String func_179651_b(Map<String, String> p_179651_0_, String p_179651_1_) {
- return (String)p_179651_0_.get(p_179651_1_);
- }
- public static Map<String, Integer> func_96560_a(Map<String, String> p_96560_0_) {
- Map<String, Integer> map = Maps.<String, Integer>newHashMap();
- for(String s : p_96560_0_.keySet()) {
- if(s.startsWith("score_") && s.length() > "score_".length()) {
- map.put(s.substring("score_".length()), Integer.valueOf(MathHelper.func_82715_a((String)p_96560_0_.get(s), 1)));
- }
- }
- return map;
- }
- public static boolean func_82377_a(String p_82377_0_) throws CommandException {
- Matcher matcher = field_82389_a.matcher(p_82377_0_);
- if(!matcher.matches()) {
- return false;
- } else {
- Map<String, String> map = func_82381_h(matcher.group(2));
- String s = matcher.group(1);
- int i = !"a".equals(s) && !"e".equals(s)?1:0;
- return func_179653_a(map, field_190845_s, i) != 1;
- }
- }
- public static boolean func_82378_b(String p_82378_0_) {
- return field_82389_a.matcher(p_82378_0_).matches();
- }
- private static Map<String, String> func_82381_h(@Nullable String p_82381_0_) throws CommandException {
- Map<String, String> map = Maps.<String, String>newHashMap();
- if(p_82381_0_ == null) {
- return map;
- } else {
- for(String s : field_190828_b.split(p_82381_0_)) {
- Iterator<String> iterator = field_190829_c.split(s).iterator();
- String s1 = (String)iterator.next();
- if(!field_190851_y.apply(s1)) {
- throw new CommandException("commands.generic.selector_argument", new Object[]{s});
- }
- map.put(s1, iterator.hasNext()?(String)iterator.next():"");
- }
- return map;
- }
- }
- }
- Patching failed: minecraft\net\minecraft\command\CommandSpreadPlayers.java
- Hunk 1 failed! Cannot find hunk target
- if (entity instanceof EntityPlayer) {
- set.add(entity.func_96124_cp());
- } else {
- - set.add((Object)null);
- + set.add(null);
- }
- }
- File state
- package net.minecraft.command;
- import com.google.common.collect.Lists;
- import com.google.common.collect.Maps;
- import com.google.common.collect.Sets;
- import java.util.Collections;
- import java.util.List;
- import java.util.Map;
- import java.util.Random;
- import java.util.Set;
- import javax.annotation.Nullable;
- import net.minecraft.block.material.Material;
- import net.minecraft.command.CommandBase;
- import net.minecraft.command.CommandException;
- import net.minecraft.command.CommandResultStats;
- import net.minecraft.command.EntityNotFoundException;
- import net.minecraft.command.EntitySelector;
- import net.minecraft.command.ICommandSender;
- import net.minecraft.command.PlayerNotFoundException;
- import net.minecraft.command.WrongUsageException;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.scoreboard.Team;
- import net.minecraft.server.MinecraftServer;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.util.math.MathHelper;
- import net.minecraft.util.text.TextComponentTranslation;
- import net.minecraft.world.World;
- public class CommandSpreadPlayers extends CommandBase {
- public String func_71517_b() {
- return "spreadplayers";
- }
- public int func_82362_a() {
- return 2;
- }
- public String func_71518_a(ICommandSender p_71518_1_) {
- return "commands.spreadplayers.usage";
- }
- public void func_184881_a(MinecraftServer p_184881_1_, ICommandSender p_184881_2_, String[] p_184881_3_) throws CommandException {
- if(p_184881_3_.length < 6) {
- throw new WrongUsageException("commands.spreadplayers.usage", new Object[0]);
- } else {
- int i = 0;
- BlockPos blockpos = p_184881_2_.func_180425_c();
- double d0 = func_175761_b((double)blockpos.func_177958_n(), p_184881_3_[i++], true);
- double d1 = func_175761_b((double)blockpos.func_177952_p(), p_184881_3_[i++], true);
- double d2 = func_180526_a(p_184881_3_[i++], 0.0D);
- double d3 = func_180526_a(p_184881_3_[i++], d2 + 1.0D);
- boolean flag = func_180527_d(p_184881_3_[i++]);
- List<Entity> list = Lists.<Entity>newArrayList();
- while(i < p_184881_3_.length) {
- String s = p_184881_3_[i++];
- if(EntitySelector.func_82378_b(s)) {
- List<Entity> list1 = EntitySelector.<Entity>func_179656_b(p_184881_2_, s, Entity.class);
- if(list1.isEmpty()) {
- throw new EntityNotFoundException("commands.generic.selector.notFound", new Object[]{s});
- }
- list.addAll(list1);
- } else {
- EntityPlayer entityplayer = p_184881_1_.func_184103_al().func_152612_a(s);
- if(entityplayer == null) {
- throw new PlayerNotFoundException("commands.generic.player.notFound", new Object[]{s});
- }
- list.add(entityplayer);
- }
- }
- p_184881_2_.func_174794_a(CommandResultStats.Type.AFFECTED_ENTITIES, list.size());
- if(list.isEmpty()) {
- throw new EntityNotFoundException("commands.spreadplayers.noop");
- } else {
- 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)}));
- this.func_110669_a(p_184881_2_, list, new CommandSpreadPlayers.Position(d0, d1), d2, d3, ((Entity)list.get(0)).field_70170_p, flag);
- }
- }
- }
- 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 {
- Random random = new Random();
- double d0 = p_110669_3_.field_111101_a - p_110669_6_;
- double d1 = p_110669_3_.field_111100_b - p_110669_6_;
- double d2 = p_110669_3_.field_111101_a + p_110669_6_;
- double d3 = p_110669_3_.field_111100_b + p_110669_6_;
- 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);
- 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_);
- double d4 = this.func_110671_a(p_110669_2_, p_110669_8_, acommandspreadplayers$position, p_110669_9_);
- 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)});
- if(acommandspreadplayers$position.length > 1) {
- 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)}));
- }
- }
- private int func_110667_a(List<Entity> p_110667_1_) {
- Set<Team> set = Sets.<Team>newHashSet();
- for(Entity entity : p_110667_1_) {
- if(entity instanceof EntityPlayer) {
- set.add(entity.func_96124_cp());
- } else {
- set.add((Team)null);
- }
- }
- return set.size();
- }
- 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 {
- boolean flag = true;
- double d0 = 3.4028234663852886E38D;
- int i;
- for(i = 0; i < 10000 && flag; ++i) {
- flag = false;
- d0 = 3.4028234663852886E38D;
- for(int j = 0; j < p_110668_14_.length; ++j) {
- CommandSpreadPlayers.Position commandspreadplayers$position = p_110668_14_[j];
- int k = 0;
- CommandSpreadPlayers.Position commandspreadplayers$position1 = new CommandSpreadPlayers.Position();
- for(int l = 0; l < p_110668_14_.length; ++l) {
- if(j != l) {
- CommandSpreadPlayers.Position commandspreadplayers$position2 = p_110668_14_[l];
- double d1 = commandspreadplayers$position.func_111099_a(commandspreadplayers$position2);
- d0 = Math.min(d1, d0);
- if(d1 < p_110668_2_) {
- ++k;
- commandspreadplayers$position1.field_111101_a += commandspreadplayers$position2.field_111101_a - commandspreadplayers$position.field_111101_a;
- commandspreadplayers$position1.field_111100_b += commandspreadplayers$position2.field_111100_b - commandspreadplayers$position.field_111100_b;
- }
- }
- }
- if(k > 0) {
- commandspreadplayers$position1.field_111101_a /= (double)k;
- commandspreadplayers$position1.field_111100_b /= (double)k;
- double d2 = (double)commandspreadplayers$position1.func_111096_b();
- if(d2 > 0.0D) {
- commandspreadplayers$position1.func_111095_a();
- commandspreadplayers$position.func_111094_b(commandspreadplayers$position1);
- } else {
- commandspreadplayers$position.func_111097_a(p_110668_5_, p_110668_6_, p_110668_8_, p_110668_10_, p_110668_12_);
- }
- flag = true;
- }
- if(commandspreadplayers$position.func_111093_a(p_110668_6_, p_110668_8_, p_110668_10_, p_110668_12_)) {
- flag = true;
- }
- }
- if(!flag) {
- for(CommandSpreadPlayers.Position commandspreadplayers$position3 : p_110668_14_) {
- if(!commandspreadplayers$position3.func_111098_b(p_110668_4_)) {
- commandspreadplayers$position3.func_111097_a(p_110668_5_, p_110668_6_, p_110668_8_, p_110668_10_, p_110668_12_);
- flag = true;
- }
- }
- }
- }
- if(i >= 10000) {
- 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)})});
- } else {
- return i;
- }
- }
- private double func_110671_a(List<Entity> p_110671_1_, World p_110671_2_, CommandSpreadPlayers.Position[] p_110671_3_, boolean p_110671_4_) {
- double d0 = 0.0D;
- int i = 0;
- Map<Team, CommandSpreadPlayers.Position> map = Maps.<Team, CommandSpreadPlayers.Position>newHashMap();
- for(int j = 0; j < p_110671_1_.size(); ++j) {
- Entity entity = (Entity)p_110671_1_.get(j);
- CommandSpreadPlayers.Position commandspreadplayers$position;
- if(p_110671_4_) {
- Team team = entity instanceof EntityPlayer?entity.func_96124_cp():null;
- if(!map.containsKey(team)) {
- map.put(team, p_110671_3_[i++]);
- }
- commandspreadplayers$position = (CommandSpreadPlayers.Position)map.get(team);
- } else {
- commandspreadplayers$position = p_110671_3_[i++];
- }
- 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);
- double d2 = Double.MAX_VALUE;
- for(CommandSpreadPlayers.Position commandspreadplayers$position1 : p_110671_3_) {
- if(commandspreadplayers$position != commandspreadplayers$position1) {
- double d1 = commandspreadplayers$position.func_111099_a(commandspreadplayers$position1);
- d2 = Math.min(d1, d2);
- }
- }
- d0 += d2;
- }
- d0 = d0 / (double)p_110671_1_.size();
- return d0;
- }
- 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_) {
- CommandSpreadPlayers.Position[] acommandspreadplayers$position = new CommandSpreadPlayers.Position[p_110670_2_];
- for(int i = 0; i < acommandspreadplayers$position.length; ++i) {
- CommandSpreadPlayers.Position commandspreadplayers$position = new CommandSpreadPlayers.Position();
- commandspreadplayers$position.func_111097_a(p_110670_1_, p_110670_3_, p_110670_5_, p_110670_7_, p_110670_9_);
- acommandspreadplayers$position[i] = commandspreadplayers$position;
- }
- return acommandspreadplayers$position;
- }
- public List<String> func_184883_a(MinecraftServer p_184883_1_, ICommandSender p_184883_2_, String[] p_184883_3_, @Nullable BlockPos p_184883_4_) {
- return p_184883_3_.length >= 1 && p_184883_3_.length <= 2?func_181043_b(p_184883_3_, 0, p_184883_4_):Collections.emptyList();
- }
- static class Position {
- double field_111101_a;
- double field_111100_b;
- Position() {
- }
- Position(double p_i1358_1_, double p_i1358_3_) {
- this.field_111101_a = p_i1358_1_;
- this.field_111100_b = p_i1358_3_;
- }
- double func_111099_a(CommandSpreadPlayers.Position p_111099_1_) {
- double d0 = this.field_111101_a - p_111099_1_.field_111101_a;
- double d1 = this.field_111100_b - p_111099_1_.field_111100_b;
- return Math.sqrt(d0 * d0 + d1 * d1);
- }
- void func_111095_a() {
- double d0 = (double)this.func_111096_b();
- this.field_111101_a /= d0;
- this.field_111100_b /= d0;
- }
- float func_111096_b() {
- return MathHelper.func_76133_a(this.field_111101_a * this.field_111101_a + this.field_111100_b * this.field_111100_b);
- }
- public void func_111094_b(CommandSpreadPlayers.Position p_111094_1_) {
- this.field_111101_a -= p_111094_1_.field_111101_a;
- this.field_111100_b -= p_111094_1_.field_111100_b;
- }
- public boolean func_111093_a(double p_111093_1_, double p_111093_3_, double p_111093_5_, double p_111093_7_) {
- boolean flag = false;
- if(this.field_111101_a < p_111093_1_) {
- this.field_111101_a = p_111093_1_;
- flag = true;
- } else if(this.field_111101_a > p_111093_5_) {
- this.field_111101_a = p_111093_5_;
- flag = true;
- }
- if(this.field_111100_b < p_111093_3_) {
- this.field_111100_b = p_111093_3_;
- flag = true;
- } else if(this.field_111100_b > p_111093_7_) {
- this.field_111100_b = p_111093_7_;
- flag = true;
- }
- return flag;
- }
- public int func_111092_a(World p_111092_1_) {
- BlockPos blockpos = new BlockPos(this.field_111101_a, 256.0D, this.field_111100_b);
- while(blockpos.func_177956_o() > 0) {
- blockpos = blockpos.func_177977_b();
- if(p_111092_1_.func_180495_p(blockpos).func_185904_a() != Material.field_151579_a) {
- return blockpos.func_177956_o() + 1;
- }
- }
- return 257;
- }
- public boolean func_111098_b(World p_111098_1_) {
- BlockPos blockpos = new BlockPos(this.field_111101_a, 256.0D, this.field_111100_b);
- while(blockpos.func_177956_o() > 0) {
- blockpos = blockpos.func_177977_b();
- Material material = p_111098_1_.func_180495_p(blockpos).func_185904_a();
- if(material != Material.field_151579_a) {
- return !material.func_76224_d() && material != Material.field_151581_o;
- }
- }
- return false;
- }
- 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_) {
- this.field_111101_a = MathHelper.func_82716_a(p_111097_1_, p_111097_2_, p_111097_6_);
- this.field_111100_b = MathHelper.func_82716_a(p_111097_1_, p_111097_4_, p_111097_8_);
- }
- }
- }
- Patching failed: minecraft\net\minecraft\util\math\Cartesian.java
- Hunk 1 failed! Cannot find hunk target
- public class Cartesian {
- public static <T> Iterable<T[]> func_179318_a(Class<T> p_179318_0_, Iterable<? extends Iterable<? extends T>> p_179318_1_) {
- - return new Cartesian.Product<T[]>(p_179318_0_, (Iterable[])func_179322_b(Iterable.class, p_179318_1_));
- + return new Cartesian.Product(p_179318_0_, (Iterable[])func_179322_b(Iterable.class, p_179318_1_));
- }
- public static <T> Iterable<List<T>> func_179321_a(Iterable<? extends Iterable<? extends T>> p_179321_0_) {
- File state
- package net.minecraft.util.math;
- import com.google.common.base.Function;
- import com.google.common.collect.Iterables;
- import com.google.common.collect.Lists;
- import com.google.common.collect.UnmodifiableIterator;
- import java.lang.reflect.Array;
- import java.util.Arrays;
- import java.util.Collections;
- import java.util.Iterator;
- import java.util.List;
- import java.util.NoSuchElementException;
- import javax.annotation.Nullable;
- public class Cartesian {
- public static <T> Iterable<T[]> func_179318_a(Class<T> p_179318_0_, Iterable<? extends Iterable<? extends T>> p_179318_1_) {
- return new Cartesian.Product(p_179318_0_, (Iterable[])func_179322_b(Iterable.class, p_179318_1_));
- }
- public static <T> Iterable<List<T>> func_179321_a(Iterable<? extends Iterable<? extends T>> p_179321_0_) {
- return func_179323_b(func_179318_a(Object.class, p_179321_0_));
- }
- private static <T> Iterable<List<T>> func_179323_b(Iterable<Object[]> p_179323_0_) {
- return Iterables.transform(p_179323_0_, new Cartesian.GetList());
- }
- private static <T> T[] func_179322_b(Class<? super T> p_179322_0_, Iterable<? extends T> p_179322_1_) {
- List<T> list = Lists.<T>newArrayList();
- for(T t : p_179322_1_) {
- list.add(t);
- }
- return (T[])((Object[])list.toArray(func_179319_b(p_179322_0_, list.size())));
- }
- private static <T> T[] func_179319_b(Class<? super T> p_179319_0_, int p_179319_1_) {
- return (T[])((Object[])((Object[])Array.newInstance(p_179319_0_, p_179319_1_)));
- }
- static class GetList<T> implements Function<Object[], List<T>> {
- private GetList() {
- }
- public List<T> apply(@Nullable Object[] p_apply_1_) {
- return Arrays.<T>asList((Object[])p_apply_1_);
- }
- }
- static class Product<T> implements Iterable<T[]> {
- private final Class<T> field_179429_a;
- private final Iterable<? extends T>[] field_179428_b;
- private Product(Class<T> p_i46020_1_, Iterable<? extends T>[] p_i46020_2_) {
- this.field_179429_a = p_i46020_1_;
- this.field_179428_b = p_i46020_2_;
- }
- public Iterator<T[]> iterator() {
- 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));
- }
- static class ProductIterator<T> extends UnmodifiableIterator<T[]> {
- private int field_179426_a;
- private final Iterable<? extends T>[] field_179424_b;
- private final Iterator<? extends T>[] field_179425_c;
- private final T[] field_179423_d;
- private ProductIterator(Class<T> p_i46018_1_, Iterable<? extends T>[] p_i46018_2_) {
- this.field_179426_a = -2;
- this.field_179424_b = p_i46018_2_;
- this.field_179425_c = (Iterator[])Cartesian.func_179319_b(Iterator.class, this.field_179424_b.length);
- for(int i = 0; i < this.field_179424_b.length; ++i) {
- this.field_179425_c[i] = p_i46018_2_[i].iterator();
- }
- this.field_179423_d = Cartesian.func_179319_b(p_i46018_1_, this.field_179425_c.length);
- }
- private void func_179422_b() {
- this.field_179426_a = -1;
- Arrays.fill(this.field_179425_c, (Object)null);
- Arrays.fill(this.field_179423_d, (Object)null);
- }
- public boolean hasNext() {
- if(this.field_179426_a == -2) {
- this.field_179426_a = 0;
- for(Iterator<? extends T> iterator1 : this.field_179425_c) {
- if(!iterator1.hasNext()) {
- this.func_179422_b();
- break;
- }
- }
- return true;
- } else {
- if(this.field_179426_a >= this.field_179425_c.length) {
- for(this.field_179426_a = this.field_179425_c.length - 1; this.field_179426_a >= 0; --this.field_179426_a) {
- Iterator<? extends T> iterator = this.field_179425_c[this.field_179426_a];
- if(iterator.hasNext()) {
- break;
- }
- if(this.field_179426_a == 0) {
- this.func_179422_b();
- break;
- }
- iterator = this.field_179424_b[this.field_179426_a].iterator();
- this.field_179425_c[this.field_179426_a] = iterator;
- if(!iterator.hasNext()) {
- this.func_179422_b();
- break;
- }
- }
- }
- return this.field_179426_a >= 0;
- }
- }
- public T[] next() {
- if(!this.hasNext()) {
- throw new NoSuchElementException();
- } else {
- while(this.field_179426_a < this.field_179425_c.length) {
- this.field_179423_d[this.field_179426_a] = this.field_179425_c[this.field_179426_a].next();
- ++this.field_179426_a;
- }
- return (T[])((Object[])this.field_179423_d.clone());
- }
- }
- }
- }
- }
- Hunk 2 failed! Cannot find hunk target
- }
- public List<T> apply(@Nullable Object[] p_apply_1_) {
- - return Arrays.<T>asList(p_apply_1_);
- + return Arrays.<T>asList((T[])p_apply_1_);
- }
- }
- File state
- package net.minecraft.util.math;
- import com.google.common.base.Function;
- import com.google.common.collect.Iterables;
- import com.google.common.collect.Lists;
- import com.google.common.collect.UnmodifiableIterator;
- import java.lang.reflect.Array;
- import java.util.Arrays;
- import java.util.Collections;
- import java.util.Iterator;
- import java.util.List;
- import java.util.NoSuchElementException;
- import javax.annotation.Nullable;
- public class Cartesian {
- public static <T> Iterable<T[]> func_179318_a(Class<T> p_179318_0_, Iterable<? extends Iterable<? extends T>> p_179318_1_) {
- return new Cartesian.Product(p_179318_0_, (Iterable[])func_179322_b(Iterable.class, p_179318_1_));
- }
- public static <T> Iterable<List<T>> func_179321_a(Iterable<? extends Iterable<? extends T>> p_179321_0_) {
- return func_179323_b(func_179318_a(Object.class, p_179321_0_));
- }
- private static <T> Iterable<List<T>> func_179323_b(Iterable<Object[]> p_179323_0_) {
- return Iterables.transform(p_179323_0_, new Cartesian.GetList());
- }
- private static <T> T[] func_179322_b(Class<? super T> p_179322_0_, Iterable<? extends T> p_179322_1_) {
- List<T> list = Lists.<T>newArrayList();
- for(T t : p_179322_1_) {
- list.add(t);
- }
- return (T[])((Object[])list.toArray(func_179319_b(p_179322_0_, list.size())));
- }
- private static <T> T[] func_179319_b(Class<? super T> p_179319_0_, int p_179319_1_) {
- return (T[])((Object[])((Object[])Array.newInstance(p_179319_0_, p_179319_1_)));
- }
- static class GetList<T> implements Function<Object[], List<T>> {
- private GetList() {
- }
- public List<T> apply(@Nullable Object[] p_apply_1_) {
- return Arrays.<T>asList((Object[])p_apply_1_);
- }
- }
- static class Product<T> implements Iterable<T[]> {
- private final Class<T> field_179429_a;
- private final Iterable<? extends T>[] field_179428_b;
- private Product(Class<T> p_i46020_1_, Iterable<? extends T>[] p_i46020_2_) {
- this.field_179429_a = p_i46020_1_;
- this.field_179428_b = p_i46020_2_;
- }
- public Iterator<T[]> iterator() {
- 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));
- }
- static class ProductIterator<T> extends UnmodifiableIterator<T[]> {
- private int field_179426_a;
- private final Iterable<? extends T>[] field_179424_b;
- private final Iterator<? extends T>[] field_179425_c;
- private final T[] field_179423_d;
- private ProductIterator(Class<T> p_i46018_1_, Iterable<? extends T>[] p_i46018_2_) {
- this.field_179426_a = -2;
- this.field_179424_b = p_i46018_2_;
- this.field_179425_c = (Iterator[])Cartesian.func_179319_b(Iterator.class, this.field_179424_b.length);
- for(int i = 0; i < this.field_179424_b.length; ++i) {
- this.field_179425_c[i] = p_i46018_2_[i].iterator();
- }
- this.field_179423_d = Cartesian.func_179319_b(p_i46018_1_, this.field_179425_c.length);
- }
- private void func_179422_b() {
- this.field_179426_a = -1;
- Arrays.fill(this.field_179425_c, (Object)null);
- Arrays.fill(this.field_179423_d, (Object)null);
- }
- public boolean hasNext() {
- if(this.field_179426_a == -2) {
- this.field_179426_a = 0;
- for(Iterator<? extends T> iterator1 : this.field_179425_c) {
- if(!iterator1.hasNext()) {
- this.func_179422_b();
- break;
- }
- }
- return true;
- } else {
- if(this.field_179426_a >= this.field_179425_c.length) {
- for(this.field_179426_a = this.field_179425_c.length - 1; this.field_179426_a >= 0; --this.field_179426_a) {
- Iterator<? extends T> iterator = this.field_179425_c[this.field_179426_a];
- if(iterator.hasNext()) {
- break;
- }
- if(this.field_179426_a == 0) {
- this.func_179422_b();
- break;
- }
- iterator = this.field_179424_b[this.field_179426_a].iterator();
- this.field_179425_c[this.field_179426_a] = iterator;
- if(!iterator.hasNext()) {
- this.func_179422_b();
- break;
- }
- }
- }
- return this.field_179426_a >= 0;
- }
- }
- public T[] next() {
- if(!this.hasNext()) {
- throw new NoSuchElementException();
- } else {
- while(this.field_179426_a < this.field_179425_c.length) {
- this.field_179423_d[this.field_179426_a] = this.field_179425_c[this.field_179426_a].next();
- ++this.field_179426_a;
- }
- return (T[])((Object[])this.field_179423_d.clone());
- }
- }
- }
- }
- }
- Patching failed: minecraft\net\minecraft\util\ObjectIntIdentityMap.java
- Hunk 1 failed! Cannot find hunk target
- this.field_148749_a.put(p_148746_1_, Integer.valueOf(p_148746_2_));
- while(this.field_148748_b.size() <= p_148746_2_) {
- - this.field_148748_b.add((Object)null);
- + this.field_148748_b.add(null);
- }
- this.field_148748_b.set(p_148746_2_, p_148746_1_);
- File state
- package net.minecraft.util;
- import com.google.common.base.Predicates;
- import com.google.common.collect.Iterators;
- import com.google.common.collect.Lists;
- import java.util.IdentityHashMap;
- import java.util.Iterator;
- import java.util.List;
- import javax.annotation.Nullable;
- import net.minecraft.util.IObjectIntIterable;
- public class ObjectIntIdentityMap<T> implements IObjectIntIterable<T> {
- protected final IdentityHashMap<T, Integer> field_148749_a;
- protected final List<T> field_148748_b;
- public ObjectIntIdentityMap() {
- this(512);
- }
- public ObjectIntIdentityMap(int p_i46984_1_) {
- this.field_148748_b = Lists.<T>newArrayListWithExpectedSize(p_i46984_1_);
- this.field_148749_a = new IdentityHashMap(p_i46984_1_);
- }
- public void func_148746_a(T p_148746_1_, int p_148746_2_) {
- this.field_148749_a.put(p_148746_1_, Integer.valueOf(p_148746_2_));
- while(this.field_148748_b.size() <= p_148746_2_) {
- this.field_148748_b.add(null);
- }
- this.field_148748_b.set(p_148746_2_, p_148746_1_);
- }
- public int func_148747_b(T p_148747_1_) {
- Integer integer = (Integer)this.field_148749_a.get(p_148747_1_);
- return integer == null?-1:integer.intValue();
- }
- @Nullable
- public final T func_148745_a(int p_148745_1_) {
- return (T)(p_148745_1_ >= 0 && p_148745_1_ < this.field_148748_b.size()?this.field_148748_b.get(p_148745_1_):null);
- }
- public Iterator<T> iterator() {
- return Iterators.filter(this.field_148748_b.iterator(), Predicates.notNull());
- }
- public int func_186804_a() {
- return this.field_148749_a.size();
- }
- }
- Patching failed: minecraft\net\minecraft\util\NonNullList.java
- Hunk 1 failed! Cannot find hunk target
- Validate.notNull(p_191197_1_);
- Object[] aobject = new Object[p_191197_0_];
- Arrays.fill(aobject, p_191197_1_);
- - return new NonNullList<E>(Arrays.asList(aobject), p_191197_1_);
- + return new NonNullList<E>(Arrays.asList((E[])aobject), p_191197_1_);
- }
- public static <E> NonNullList<E> func_193580_a(E p_193580_0_, E... p_193580_1_) {
- File state
- package net.minecraft.util;
- import java.util.AbstractList;
- import java.util.ArrayList;
- import java.util.Arrays;
- import java.util.List;
- import javax.annotation.Nonnull;
- import javax.annotation.Nullable;
- import org.apache.commons.lang3.Validate;
- public class NonNullList<E> extends AbstractList<E> {
- private final List<E> field_191198_a;
- private final E field_191199_b;
- public static <E> NonNullList<E> func_191196_a() {
- return new NonNullList();
- }
- public static <E> NonNullList<E> func_191197_a(int p_191197_0_, E p_191197_1_) {
- Validate.notNull(p_191197_1_);
- Object[] aobject = new Object[p_191197_0_];
- Arrays.fill(aobject, p_191197_1_);
- return new NonNullList(Arrays.asList(aobject), p_191197_1_);
- }
- public static <E> NonNullList<E> func_193580_a(E p_193580_0_, E... p_193580_1_) {
- return new NonNullList(Arrays.asList(p_193580_1_), p_193580_0_);
- }
- protected NonNullList() {
- this(new ArrayList(), null);
- }
- protected NonNullList(List<E> p_i47327_1_, @Nullable E p_i47327_2_) {
- this.field_191198_a = p_i47327_1_;
- this.field_191199_b = p_i47327_2_;
- }
- @Nonnull
- public E get(int p_get_1_) {
- return this.field_191198_a.get(p_get_1_);
- }
- public E set(int p_set_1_, E p_set_2_) {
- Validate.notNull(p_set_2_);
- return this.field_191198_a.set(p_set_1_, p_set_2_);
- }
- public void add(int p_add_1_, E p_add_2_) {
- Validate.notNull(p_add_2_);
- this.field_191198_a.add(p_add_1_, p_add_2_);
- }
- public E remove(int p_remove_1_) {
- return this.field_191198_a.remove(p_remove_1_);
- }
- public int size() {
- return this.field_191198_a.size();
- }
- public void clear() {
- if(this.field_191199_b == null) {
- super.clear();
- } else {
- for(int i = 0; i < this.size(); ++i) {
- this.set(i, this.field_191199_b);
- }
- }
- }
- }
- Hunk 2 failed! Cannot find hunk target
- }
- protected NonNullList() {
- - this(new ArrayList(), (Object)null);
- + this(new ArrayList(), null);
- }
- protected NonNullList(List<E> p_i47327_1_, @Nullable E p_i47327_2_) {
- File state
- package net.minecraft.util;
- import java.util.AbstractList;
- import java.util.ArrayList;
- import java.util.Arrays;
- import java.util.List;
- import javax.annotation.Nonnull;
- import javax.annotation.Nullable;
- import org.apache.commons.lang3.Validate;
- public class NonNullList<E> extends AbstractList<E> {
- private final List<E> field_191198_a;
- private final E field_191199_b;
- public static <E> NonNullList<E> func_191196_a() {
- return new NonNullList();
- }
- public static <E> NonNullList<E> func_191197_a(int p_191197_0_, E p_191197_1_) {
- Validate.notNull(p_191197_1_);
- Object[] aobject = new Object[p_191197_0_];
- Arrays.fill(aobject, p_191197_1_);
- return new NonNullList(Arrays.asList(aobject), p_191197_1_);
- }
- public static <E> NonNullList<E> func_193580_a(E p_193580_0_, E... p_193580_1_) {
- return new NonNullList(Arrays.asList(p_193580_1_), p_193580_0_);
- }
- protected NonNullList() {
- this(new ArrayList(), null);
- }
- protected NonNullList(List<E> p_i47327_1_, @Nullable E p_i47327_2_) {
- this.field_191198_a = p_i47327_1_;
- this.field_191199_b = p_i47327_2_;
- }
- @Nonnull
- public E get(int p_get_1_) {
- return this.field_191198_a.get(p_get_1_);
- }
- public E set(int p_set_1_, E p_set_2_) {
- Validate.notNull(p_set_2_);
- return this.field_191198_a.set(p_set_1_, p_set_2_);
- }
- public void add(int p_add_1_, E p_add_2_) {
- Validate.notNull(p_add_2_);
- this.field_191198_a.add(p_add_1_, p_add_2_);
- }
- public E remove(int p_remove_1_) {
- return this.field_191198_a.remove(p_remove_1_);
- }
- public int size() {
- return this.field_191198_a.size();
- }
- public void clear() {
- if(this.field_191199_b == null) {
- super.clear();
- } else {
- for(int i = 0; i < this.size(); ++i) {
- this.set(i, this.field_191199_b);
- }
- }
- }
- }
- Patching failed: minecraft\net\minecraft\nbt\NBTUtil.java
- Hunk 1 failed! Cannot find hunk target
- 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_) {
- Optional<T> optional = p_193590_1_.func_185929_b(p_193590_3_.func_74779_i(p_193590_2_));
- if (optional.isPresent()) {
- - return p_193590_0_.func_177226_a(p_193590_1_, (Comparable)optional.get());
- + return p_193590_0_.func_177226_a(p_193590_1_, optional.get());
- } else {
- 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());
- return p_193590_0_;
- File state
- package net.minecraft.nbt;
- import com.google.common.annotations.VisibleForTesting;
- import com.google.common.base.Optional;
- import com.google.common.collect.UnmodifiableIterator;
- import com.mojang.authlib.GameProfile;
- import com.mojang.authlib.properties.Property;
- import java.util.UUID;
- import java.util.Map.Entry;
- import javax.annotation.Nullable;
- import net.minecraft.block.Block;
- import net.minecraft.block.properties.IProperty;
- import net.minecraft.block.state.BlockStateContainer;
- import net.minecraft.block.state.IBlockState;
- import net.minecraft.init.Blocks;
- import net.minecraft.nbt.NBTBase;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.nbt.NBTTagList;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.util.StringUtils;
- import net.minecraft.util.math.BlockPos;
- import org.apache.logging.log4j.LogManager;
- import org.apache.logging.log4j.Logger;
- public final class NBTUtil {
- private static final Logger field_193591_a = LogManager.getLogger();
- @Nullable
- public static GameProfile func_152459_a(NBTTagCompound p_152459_0_) {
- String s = null;
- String s1 = null;
- if(p_152459_0_.func_150297_b("Name", 8)) {
- s = p_152459_0_.func_74779_i("Name");
- }
- if(p_152459_0_.func_150297_b("Id", 8)) {
- s1 = p_152459_0_.func_74779_i("Id");
- }
- try {
- UUID uuid;
- try {
- uuid = UUID.fromString(s1);
- } catch (Throwable var12) {
- uuid = null;
- }
- GameProfile gameprofile = new GameProfile(uuid, s);
- if(p_152459_0_.func_150297_b("Properties", 10)) {
- NBTTagCompound nbttagcompound = p_152459_0_.func_74775_l("Properties");
- for(String s2 : nbttagcompound.func_150296_c()) {
- NBTTagList nbttaglist = nbttagcompound.func_150295_c(s2, 10);
- for(int i = 0; i < nbttaglist.func_74745_c(); ++i) {
- NBTTagCompound nbttagcompound1 = nbttaglist.func_150305_b(i);
- String s3 = nbttagcompound1.func_74779_i("Value");
- if(nbttagcompound1.func_150297_b("Signature", 8)) {
- gameprofile.getProperties().put(s2, new Property(s2, s3, nbttagcompound1.func_74779_i("Signature")));
- } else {
- gameprofile.getProperties().put(s2, new Property(s2, s3));
- }
- }
- }
- }
- return gameprofile;
- } catch (Throwable var13) {
- return null;
- }
- }
- public static NBTTagCompound func_180708_a(NBTTagCompound p_180708_0_, GameProfile p_180708_1_) {
- if(!StringUtils.func_151246_b(p_180708_1_.getName())) {
- p_180708_0_.func_74778_a("Name", p_180708_1_.getName());
- }
- if(p_180708_1_.getId() != null) {
- p_180708_0_.func_74778_a("Id", p_180708_1_.getId().toString());
- }
- if(!p_180708_1_.getProperties().isEmpty()) {
- NBTTagCompound nbttagcompound = new NBTTagCompound();
- for(String s : p_180708_1_.getProperties().keySet()) {
- NBTTagList nbttaglist = new NBTTagList();
- for(Property property : p_180708_1_.getProperties().get(s)) {
- NBTTagCompound nbttagcompound1 = new NBTTagCompound();
- nbttagcompound1.func_74778_a("Value", property.getValue());
- if(property.hasSignature()) {
- nbttagcompound1.func_74778_a("Signature", property.getSignature());
- }
- nbttaglist.func_74742_a(nbttagcompound1);
- }
- nbttagcompound.func_74782_a(s, nbttaglist);
- }
- p_180708_0_.func_74782_a("Properties", nbttagcompound);
- }
- return p_180708_0_;
- }
- @VisibleForTesting
- public static boolean func_181123_a(NBTBase p_181123_0_, NBTBase p_181123_1_, boolean p_181123_2_) {
- if(p_181123_0_ == p_181123_1_) {
- return true;
- } else if(p_181123_0_ == null) {
- return true;
- } else if(p_181123_1_ == null) {
- return false;
- } else if(!p_181123_0_.getClass().equals(p_181123_1_.getClass())) {
- return false;
- } else if(p_181123_0_ instanceof NBTTagCompound) {
- NBTTagCompound nbttagcompound = (NBTTagCompound)p_181123_0_;
- NBTTagCompound nbttagcompound1 = (NBTTagCompound)p_181123_1_;
- for(String s : nbttagcompound.func_150296_c()) {
- NBTBase nbtbase1 = nbttagcompound.func_74781_a(s);
- if(!func_181123_a(nbtbase1, nbttagcompound1.func_74781_a(s), p_181123_2_)) {
- return false;
- }
- }
- return true;
- } else if(p_181123_0_ instanceof NBTTagList && p_181123_2_) {
- NBTTagList nbttaglist = (NBTTagList)p_181123_0_;
- NBTTagList nbttaglist1 = (NBTTagList)p_181123_1_;
- if(nbttaglist.func_82582_d()) {
- return nbttaglist1.func_82582_d();
- } else {
- for(int i = 0; i < nbttaglist.func_74745_c(); ++i) {
- NBTBase nbtbase = nbttaglist.func_179238_g(i);
- boolean flag = false;
- for(int j = 0; j < nbttaglist1.func_74745_c(); ++j) {
- if(func_181123_a(nbtbase, nbttaglist1.func_179238_g(j), p_181123_2_)) {
- flag = true;
- break;
- }
- }
- if(!flag) {
- return false;
- }
- }
- return true;
- }
- } else {
- return p_181123_0_.equals(p_181123_1_);
- }
- }
- public static NBTTagCompound func_186862_a(UUID p_186862_0_) {
- NBTTagCompound nbttagcompound = new NBTTagCompound();
- nbttagcompound.func_74772_a("M", p_186862_0_.getMostSignificantBits());
- nbttagcompound.func_74772_a("L", p_186862_0_.getLeastSignificantBits());
- return nbttagcompound;
- }
- public static UUID func_186860_b(NBTTagCompound p_186860_0_) {
- return new UUID(p_186860_0_.func_74763_f("M"), p_186860_0_.func_74763_f("L"));
- }
- public static BlockPos func_186861_c(NBTTagCompound p_186861_0_) {
- return new BlockPos(p_186861_0_.func_74762_e("X"), p_186861_0_.func_74762_e("Y"), p_186861_0_.func_74762_e("Z"));
- }
- public static NBTTagCompound func_186859_a(BlockPos p_186859_0_) {
- NBTTagCompound nbttagcompound = new NBTTagCompound();
- nbttagcompound.func_74768_a("X", p_186859_0_.func_177958_n());
- nbttagcompound.func_74768_a("Y", p_186859_0_.func_177956_o());
- nbttagcompound.func_74768_a("Z", p_186859_0_.func_177952_p());
- return nbttagcompound;
- }
- public static IBlockState func_190008_d(NBTTagCompound p_190008_0_) {
- if(!p_190008_0_.func_150297_b("Name", 8)) {
- return Blocks.field_150350_a.func_176223_P();
- } else {
- Block block = (Block)Block.field_149771_c.func_82594_a(new ResourceLocation(p_190008_0_.func_74779_i("Name")));
- IBlockState iblockstate = block.func_176223_P();
- if(p_190008_0_.func_150297_b("Properties", 10)) {
- NBTTagCompound nbttagcompound = p_190008_0_.func_74775_l("Properties");
- BlockStateContainer blockstatecontainer = block.func_176194_O();
- for(String s : nbttagcompound.func_150296_c()) {
- IProperty<?> iproperty = blockstatecontainer.func_185920_a(s);
- if(iproperty != null) {
- iblockstate = func_193590_a(iblockstate, iproperty, s, nbttagcompound, p_190008_0_);
- }
- }
- }
- return iblockstate;
- }
- }
- 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_) {
- Optional<T> optional = p_193590_1_.func_185929_b(p_193590_3_.func_74779_i(p_193590_2_));
- if(optional.isPresent()) {
- return p_193590_0_.func_177226_a(p_193590_1_, (Comparable)optional.get());
- } else {
- 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());
- return p_193590_0_;
- }
- }
- public static NBTTagCompound func_190009_a(NBTTagCompound p_190009_0_, IBlockState p_190009_1_) {
- p_190009_0_.func_74778_a("Name", ((ResourceLocation)Block.field_149771_c.func_177774_c(p_190009_1_.func_177230_c())).toString());
- if(!p_190009_1_.func_177228_b().isEmpty()) {
- NBTTagCompound nbttagcompound = new NBTTagCompound();
- UnmodifiableIterator unmodifiableiterator = p_190009_1_.func_177228_b().entrySet().iterator();
- while(unmodifiableiterator.hasNext()) {
- Entry<IProperty<?>, Comparable<?>> entry = (Entry)unmodifiableiterator.next();
- IProperty<?> iproperty = (IProperty)entry.getKey();
- nbttagcompound.func_74778_a(iproperty.func_177701_a(), func_190010_a(iproperty, (Comparable)entry.getValue()));
- }
- p_190009_0_.func_74782_a("Properties", nbttagcompound);
- }
- return p_190009_0_;
- }
- private static <T extends Comparable<T>> String func_190010_a(IProperty<T> p_190010_0_, Comparable<?> p_190010_1_) {
- return p_190010_0_.func_177702_a(p_190010_1_);
- }
- }
- Patching failed: minecraft\net\minecraft\nbt\JsonToNBT.java
- Hunk 1 failed! Cannot find hunk target
- }
- if (p_193603_2_ == 1) {
- - list.add(Byte.valueOf(((NBTPrimitive)nbtbase).func_150290_f()));
- + list.add((T)Byte.valueOf(((NBTPrimitive)nbtbase).func_150290_f()));
- } else if (p_193603_2_ == 4) {
- - list.add(Long.valueOf(((NBTPrimitive)nbtbase).func_150291_c()));
- + list.add((T)Long.valueOf(((NBTPrimitive)nbtbase).func_150291_c()));
- } else {
- - list.add(Integer.valueOf(((NBTPrimitive)nbtbase).func_150287_d()));
- + list.add((T)Integer.valueOf(((NBTPrimitive)nbtbase).func_150287_d()));
- }
- if (this.func_193613_m()) {
- File state
- package net.minecraft.nbt;
- import com.google.common.annotations.VisibleForTesting;
- import com.google.common.collect.Lists;
- import java.util.List;
- import java.util.regex.Pattern;
- import net.minecraft.nbt.NBTBase;
- import net.minecraft.nbt.NBTException;
- import net.minecraft.nbt.NBTPrimitive;
- import net.minecraft.nbt.NBTTagByte;
- import net.minecraft.nbt.NBTTagByteArray;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.nbt.NBTTagDouble;
- import net.minecraft.nbt.NBTTagFloat;
- import net.minecraft.nbt.NBTTagInt;
- import net.minecraft.nbt.NBTTagIntArray;
- import net.minecraft.nbt.NBTTagList;
- import net.minecraft.nbt.NBTTagLong;
- import net.minecraft.nbt.NBTTagLongArray;
- import net.minecraft.nbt.NBTTagShort;
- import net.minecraft.nbt.NBTTagString;
- public class JsonToNBT {
- private static final Pattern field_193615_a = Pattern.compile("[-+]?(?:[0-9]+[.]|[0-9]*[.][0-9]+)(?:e[-+]?[0-9]+)?", 2);
- private static final Pattern field_193616_b = Pattern.compile("[-+]?(?:[0-9]+[.]?|[0-9]*[.][0-9]+)(?:e[-+]?[0-9]+)?d", 2);
- private static final Pattern field_193617_c = Pattern.compile("[-+]?(?:[0-9]+[.]?|[0-9]*[.][0-9]+)(?:e[-+]?[0-9]+)?f", 2);
- private static final Pattern field_193618_d = Pattern.compile("[-+]?(?:0|[1-9][0-9]*)b", 2);
- private static final Pattern field_193619_e = Pattern.compile("[-+]?(?:0|[1-9][0-9]*)l", 2);
- private static final Pattern field_193620_f = Pattern.compile("[-+]?(?:0|[1-9][0-9]*)s", 2);
- private static final Pattern field_193621_g = Pattern.compile("[-+]?(?:0|[1-9][0-9]*)");
- private final String field_193622_h;
- private int field_193623_i;
- public static NBTTagCompound func_180713_a(String p_180713_0_) throws NBTException {
- return (new JsonToNBT(p_180713_0_)).func_193609_a();
- }
- @VisibleForTesting
- NBTTagCompound func_193609_a() throws NBTException {
- NBTTagCompound nbttagcompound = this.func_193593_f();
- this.func_193607_l();
- if(this.func_193612_g()) {
- ++this.field_193623_i;
- throw this.func_193602_b("Trailing data found");
- } else {
- return nbttagcompound;
- }
- }
- @VisibleForTesting
- JsonToNBT(String p_i47522_1_) {
- this.field_193622_h = p_i47522_1_;
- }
- protected String func_193601_b() throws NBTException {
- this.func_193607_l();
- if(!this.func_193612_g()) {
- throw this.func_193602_b("Expected key");
- } else {
- return this.func_193598_n() == 34?this.func_193595_h():this.func_193614_i();
- }
- }
- private NBTException func_193602_b(String p_193602_1_) {
- return new NBTException(p_193602_1_, this.field_193622_h, this.field_193623_i);
- }
- protected NBTBase func_193611_c() throws NBTException {
- this.func_193607_l();
- if(this.func_193598_n() == 34) {
- return new NBTTagString(this.func_193595_h());
- } else {
- String s = this.func_193614_i();
- if(s.isEmpty()) {
- throw this.func_193602_b("Expected value");
- } else {
- return this.func_193596_c(s);
- }
- }
- }
- private NBTBase func_193596_c(String p_193596_1_) {
- try {
- if(field_193617_c.matcher(p_193596_1_).matches()) {
- return new NBTTagFloat(Float.parseFloat(p_193596_1_.substring(0, p_193596_1_.length() - 1)));
- }
- if(field_193618_d.matcher(p_193596_1_).matches()) {
- return new NBTTagByte(Byte.parseByte(p_193596_1_.substring(0, p_193596_1_.length() - 1)));
- }
- if(field_193619_e.matcher(p_193596_1_).matches()) {
- return new NBTTagLong(Long.parseLong(p_193596_1_.substring(0, p_193596_1_.length() - 1)));
- }
- if(field_193620_f.matcher(p_193596_1_).matches()) {
- return new NBTTagShort(Short.parseShort(p_193596_1_.substring(0, p_193596_1_.length() - 1)));
- }
- if(field_193621_g.matcher(p_193596_1_).matches()) {
- return new NBTTagInt(Integer.parseInt(p_193596_1_));
- }
- if(field_193616_b.matcher(p_193596_1_).matches()) {
- return new NBTTagDouble(Double.parseDouble(p_193596_1_.substring(0, p_193596_1_.length() - 1)));
- }
- if(field_193615_a.matcher(p_193596_1_).matches()) {
- return new NBTTagDouble(Double.parseDouble(p_193596_1_));
- }
- if("true".equalsIgnoreCase(p_193596_1_)) {
- return new NBTTagByte((byte)1);
- }
- if("false".equalsIgnoreCase(p_193596_1_)) {
- return new NBTTagByte((byte)0);
- }
- } catch (NumberFormatException var3) {
- ;
- }
- return new NBTTagString(p_193596_1_);
- }
- private String func_193595_h() throws NBTException {
- int i = ++this.field_193623_i;
- StringBuilder stringbuilder = null;
- boolean flag = false;
- while(this.func_193612_g()) {
- char c0 = this.func_193594_o();
- if(flag) {
- if(c0 != 92 && c0 != 34) {
- throw this.func_193602_b("Invalid escape of \'" + c0 + "\'");
- }
- flag = false;
- } else {
- if(c0 == 92) {
- flag = true;
- if(stringbuilder == null) {
- stringbuilder = new StringBuilder(this.field_193622_h.substring(i, this.field_193623_i - 1));
- }
- continue;
- }
- if(c0 == 34) {
- return stringbuilder == null?this.field_193622_h.substring(i, this.field_193623_i - 1):stringbuilder.toString();
- }
- }
- if(stringbuilder != null) {
- stringbuilder.append(c0);
- }
- }
- throw this.func_193602_b("Missing termination quote");
- }
- private String func_193614_i() {
- int i;
- for(i = this.field_193623_i; this.func_193612_g() && this.func_193599_a(this.func_193598_n()); ++this.field_193623_i) {
- ;
- }
- return this.field_193622_h.substring(i, this.field_193623_i);
- }
- protected NBTBase func_193610_d() throws NBTException {
- this.func_193607_l();
- if(!this.func_193612_g()) {
- throw this.func_193602_b("Expected value");
- } else {
- char c0 = this.func_193598_n();
- return (NBTBase)(c0 == 123?this.func_193593_f():(c0 == 91?this.func_193605_e():this.func_193611_c()));
- }
- }
- protected NBTBase func_193605_e() throws NBTException {
- 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();
- }
- protected NBTTagCompound func_193593_f() throws NBTException {
- this.func_193604_b('{');
- NBTTagCompound nbttagcompound = new NBTTagCompound();
- this.func_193607_l();
- while(this.func_193612_g() && this.func_193598_n() != 125) {
- String s = this.func_193601_b();
- if(s.isEmpty()) {
- throw this.func_193602_b("Expected non-empty key");
- }
- this.func_193604_b(':');
- nbttagcompound.func_74782_a(s, this.func_193610_d());
- if(!this.func_193613_m()) {
- break;
- }
- if(!this.func_193612_g()) {
- throw this.func_193602_b("Expected key");
- }
- }
- this.func_193604_b('}');
- return nbttagcompound;
- }
- private NBTBase func_193600_j() throws NBTException {
- this.func_193604_b('[');
- this.func_193607_l();
- if(!this.func_193612_g()) {
- throw this.func_193602_b("Expected value");
- } else {
- NBTTagList nbttaglist = new NBTTagList();
- int i = -1;
- while(this.func_193598_n() != 93) {
- NBTBase nbtbase = this.func_193610_d();
- int j = nbtbase.func_74732_a();
- if(i < 0) {
- i = j;
- } else if(j != i) {
- throw this.func_193602_b("Unable to insert " + NBTBase.func_193581_j(j) + " into ListTag of type " + NBTBase.func_193581_j(i));
- }
- nbttaglist.func_74742_a(nbtbase);
- if(!this.func_193613_m()) {
- break;
- }
- if(!this.func_193612_g()) {
- throw this.func_193602_b("Expected value");
- }
- }
- this.func_193604_b(']');
- return nbttaglist;
- }
- }
- private NBTBase func_193606_k() throws NBTException {
- this.func_193604_b('[');
- char c0 = this.func_193594_o();
- this.func_193594_o();
- this.func_193607_l();
- if(!this.func_193612_g()) {
- throw this.func_193602_b("Expected value");
- } else if(c0 == 66) {
- return new NBTTagByteArray(this.func_193603_a((byte)7, (byte)1));
- } else if(c0 == 76) {
- return new NBTTagLongArray(this.func_193603_a((byte)12, (byte)4));
- } else if(c0 == 73) {
- return new NBTTagIntArray(this.func_193603_a((byte)11, (byte)3));
- } else {
- throw this.func_193602_b("Invalid array type \'" + c0 + "\' found");
- }
- }
- private <T extends Number> List<T> func_193603_a(byte p_193603_1_, byte p_193603_2_) throws NBTException {
- List<T> list = Lists.<T>newArrayList();
- while(true) {
- if(this.func_193598_n() != 93) {
- NBTBase nbtbase = this.func_193610_d();
- int i = nbtbase.func_74732_a();
- if(i != p_193603_2_) {
- throw this.func_193602_b("Unable to insert " + NBTBase.func_193581_j(i) + " into " + NBTBase.func_193581_j(p_193603_1_));
- }
- if(p_193603_2_ == 1) {
- list.add(Byte.valueOf(((NBTPrimitive)nbtbase).func_150290_f()));
- } else if(p_193603_2_ == 4) {
- list.add(Long.valueOf(((NBTPrimitive)nbtbase).func_150291_c()));
- } else {
- list.add(Integer.valueOf(((NBTPrimitive)nbtbase).func_150287_d()));
- }
- if(this.func_193613_m()) {
- if(!this.func_193612_g()) {
- throw this.func_193602_b("Expected value");
- }
- continue;
- }
- }
- this.func_193604_b(']');
- return list;
- }
- }
- private void func_193607_l() {
- while(this.func_193612_g() && Character.isWhitespace(this.func_193598_n())) {
- ++this.field_193623_i;
- }
- }
- private boolean func_193613_m() {
- this.func_193607_l();
- if(this.func_193612_g() && this.func_193598_n() == 44) {
- ++this.field_193623_i;
- this.func_193607_l();
- return true;
- } else {
- return false;
- }
- }
- private void func_193604_b(char p_193604_1_) throws NBTException {
- this.func_193607_l();
- boolean flag = this.func_193612_g();
- if(flag && this.func_193598_n() == p_193604_1_) {
- ++this.field_193623_i;
- } else {
- 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);
- }
- }
- protected boolean func_193599_a(char p_193599_1_) {
- 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;
- }
- private boolean func_193608_a(int p_193608_1_) {
- return this.field_193623_i + p_193608_1_ < this.field_193622_h.length();
- }
- boolean func_193612_g() {
- return this.func_193608_a(0);
- }
- private char func_193597_b(int p_193597_1_) {
- return this.field_193622_h.charAt(this.field_193623_i + p_193597_1_);
- }
- private char func_193598_n() {
- return this.func_193597_b(0);
- }
- private char func_193594_o() {
- return this.field_193622_h.charAt(this.field_193623_i++);
- }
- }
- Patching failed: minecraft\net\minecraft\network\NetworkManager.java
- Hunk 1 failed! Cannot find hunk target
- protected void channelRead0(ChannelHandlerContext p_channelRead0_1_, Packet<?> p_channelRead0_2_) throws Exception {
- if (this.field_150746_k.isOpen()) {
- try {
- - p_channelRead0_2_.func_148833_a(this.field_150744_m);
- + ((Packet<INetHandler>)p_channelRead0_2_).func_148833_a(this.field_150744_m);
- } catch (ThreadQuickExitException var4) {
- ;
- }
- File state
- package net.minecraft.network;
- import com.google.common.collect.Queues;
- import com.google.common.util.concurrent.ThreadFactoryBuilder;
- import io.netty.bootstrap.Bootstrap;
- import io.netty.channel.Channel;
- import io.netty.channel.ChannelException;
- import io.netty.channel.ChannelFuture;
- import io.netty.channel.ChannelFutureListener;
- import io.netty.channel.ChannelHandler;
- import io.netty.channel.ChannelHandlerContext;
- import io.netty.channel.ChannelInitializer;
- import io.netty.channel.ChannelOption;
- import io.netty.channel.EventLoopGroup;
- import io.netty.channel.SimpleChannelInboundHandler;
- import io.netty.channel.epoll.Epoll;
- import io.netty.channel.epoll.EpollEventLoopGroup;
- import io.netty.channel.epoll.EpollSocketChannel;
- import io.netty.channel.local.LocalChannel;
- import io.netty.channel.local.LocalEventLoopGroup;
- import io.netty.channel.local.LocalServerChannel;
- import io.netty.channel.nio.NioEventLoopGroup;
- import io.netty.channel.socket.SocketChannel;
- import io.netty.channel.socket.nio.NioSocketChannel;
- import io.netty.handler.timeout.ReadTimeoutHandler;
- import io.netty.handler.timeout.TimeoutException;
- import io.netty.util.AttributeKey;
- import io.netty.util.concurrent.Future;
- import io.netty.util.concurrent.GenericFutureListener;
- import java.net.InetAddress;
- import java.net.SocketAddress;
- import java.util.Queue;
- import java.util.concurrent.locks.ReentrantReadWriteLock;
- import javax.annotation.Nullable;
- import javax.crypto.SecretKey;
- import net.minecraft.network.EnumConnectionState;
- import net.minecraft.network.EnumPacketDirection;
- import net.minecraft.network.INetHandler;
- import net.minecraft.network.NettyCompressionDecoder;
- import net.minecraft.network.NettyCompressionEncoder;
- import net.minecraft.network.NettyEncryptingDecoder;
- import net.minecraft.network.NettyEncryptingEncoder;
- import net.minecraft.network.NettyPacketDecoder;
- import net.minecraft.network.NettyPacketEncoder;
- import net.minecraft.network.NettyVarint21FrameDecoder;
- import net.minecraft.network.NettyVarint21FrameEncoder;
- import net.minecraft.network.Packet;
- import net.minecraft.network.ThreadQuickExitException;
- import net.minecraft.util.CryptManager;
- import net.minecraft.util.ITickable;
- import net.minecraft.util.LazyLoadBase;
- import net.minecraft.util.text.ITextComponent;
- import net.minecraft.util.text.TextComponentTranslation;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- import org.apache.commons.lang3.ArrayUtils;
- import org.apache.commons.lang3.Validate;
- import org.apache.logging.log4j.LogManager;
- import org.apache.logging.log4j.Logger;
- import org.apache.logging.log4j.Marker;
- import org.apache.logging.log4j.MarkerManager;
- public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
- private static final Logger field_150735_g = LogManager.getLogger();
- public static final Marker field_150740_a = MarkerManager.getMarker("NETWORK");
- public static final Marker field_150738_b = MarkerManager.getMarker("NETWORK_PACKETS", field_150740_a);
- public static final AttributeKey<EnumConnectionState> field_150739_c = AttributeKey.<EnumConnectionState>valueOf("protocol");
- public static final LazyLoadBase<NioEventLoopGroup> field_179295_d = new LazyLoadBase<NioEventLoopGroup>() {
- protected NioEventLoopGroup func_179280_b() {
- return new NioEventLoopGroup(0, (new ThreadFactoryBuilder()).setNameFormat("Netty Client IO #%d").setDaemon(true).build());
- }
- };
- public static final LazyLoadBase<EpollEventLoopGroup> field_181125_e = new LazyLoadBase<EpollEventLoopGroup>() {
- protected EpollEventLoopGroup func_179280_b() {
- return new EpollEventLoopGroup(0, (new ThreadFactoryBuilder()).setNameFormat("Netty Epoll Client IO #%d").setDaemon(true).build());
- }
- };
- public static final LazyLoadBase<LocalEventLoopGroup> field_179296_e = new LazyLoadBase<LocalEventLoopGroup>() {
- protected LocalEventLoopGroup func_179280_b() {
- return new LocalEventLoopGroup(0, (new ThreadFactoryBuilder()).setNameFormat("Netty Local Client IO #%d").setDaemon(true).build());
- }
- };
- private final EnumPacketDirection field_179294_g;
- private final Queue<NetworkManager.InboundHandlerTuplePacketListener> field_150745_j = Queues.<NetworkManager.InboundHandlerTuplePacketListener>newConcurrentLinkedQueue();
- private final ReentrantReadWriteLock field_181680_j = new ReentrantReadWriteLock();
- private Channel field_150746_k;
- private SocketAddress field_150743_l;
- private INetHandler field_150744_m;
- private ITextComponent field_150742_o;
- private boolean field_152463_r;
- private boolean field_179297_n;
- public NetworkManager(EnumPacketDirection p_i46004_1_) {
- this.field_179294_g = p_i46004_1_;
- }
- public void channelActive(ChannelHandlerContext p_channelActive_1_) throws Exception {
- super.channelActive(p_channelActive_1_);
- this.field_150746_k = p_channelActive_1_.channel();
- this.field_150743_l = this.field_150746_k.remoteAddress();
- try {
- this.func_150723_a(EnumConnectionState.HANDSHAKING);
- } catch (Throwable throwable) {
- field_150735_g.fatal((Object)throwable);
- }
- }
- public void func_150723_a(EnumConnectionState p_150723_1_) {
- this.field_150746_k.attr(field_150739_c).set(p_150723_1_);
- this.field_150746_k.config().setAutoRead(true);
- field_150735_g.debug("Enabled auto read");
- }
- public void channelInactive(ChannelHandlerContext p_channelInactive_1_) throws Exception {
- this.func_150718_a(new TextComponentTranslation("disconnect.endOfStream", new Object[0]));
- }
- public void exceptionCaught(ChannelHandlerContext p_exceptionCaught_1_, Throwable p_exceptionCaught_2_) throws Exception {
- TextComponentTranslation textcomponenttranslation;
- if(p_exceptionCaught_2_ instanceof TimeoutException) {
- textcomponenttranslation = new TextComponentTranslation("disconnect.timeout", new Object[0]);
- } else {
- textcomponenttranslation = new TextComponentTranslation("disconnect.genericReason", new Object[]{"Internal Exception: " + p_exceptionCaught_2_});
- }
- field_150735_g.debug(textcomponenttranslation.func_150260_c(), p_exceptionCaught_2_);
- this.func_150718_a(textcomponenttranslation);
- }
- protected void channelRead0(ChannelHandlerContext p_channelRead0_1_, Packet<?> p_channelRead0_2_) throws Exception {
- if(this.field_150746_k.isOpen()) {
- try {
- p_channelRead0_2_.func_148833_a(this.field_150744_m);
- } catch (ThreadQuickExitException var4) {
- ;
- }
- }
- }
- public void func_150719_a(INetHandler p_150719_1_) {
- Validate.notNull(p_150719_1_, "packetListener", new Object[0]);
- field_150735_g.debug((String)"Set listener of {} to {}", (Object)this, (Object)p_150719_1_);
- this.field_150744_m = p_150719_1_;
- }
- public void func_179290_a(Packet<?> p_179290_1_) {
- if(this.func_150724_d()) {
- this.func_150733_h();
- this.func_150732_b(p_179290_1_, (GenericFutureListener<? extends Future<? super Void>>[])null);
- } else {
- this.field_181680_j.writeLock().lock();
- try {
- this.field_150745_j.add(new NetworkManager.InboundHandlerTuplePacketListener(p_179290_1_, new GenericFutureListener[0]));
- } finally {
- this.field_181680_j.writeLock().unlock();
- }
- }
- }
- 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_) {
- if(this.func_150724_d()) {
- this.func_150733_h();
- this.func_150732_b(p_179288_1_, (GenericFutureListener[])ArrayUtils.add(p_179288_3_, 0, p_179288_2_));
- } else {
- this.field_181680_j.writeLock().lock();
- try {
- this.field_150745_j.add(new NetworkManager.InboundHandlerTuplePacketListener(p_179288_1_, (GenericFutureListener[])ArrayUtils.add(p_179288_3_, 0, p_179288_2_)));
- } finally {
- this.field_181680_j.writeLock().unlock();
- }
- }
- }
- private void func_150732_b(final Packet<?> p_150732_1_, @Nullable final GenericFutureListener<? extends Future<? super Void>>[] p_150732_2_) {
- final EnumConnectionState enumconnectionstate = EnumConnectionState.func_150752_a(p_150732_1_);
- final EnumConnectionState enumconnectionstate1 = (EnumConnectionState)this.field_150746_k.attr(field_150739_c).get();
- if(enumconnectionstate1 != enumconnectionstate) {
- field_150735_g.debug("Disabled auto read");
- this.field_150746_k.config().setAutoRead(false);
- }
- if(this.field_150746_k.eventLoop().inEventLoop()) {
- if(enumconnectionstate != enumconnectionstate1) {
- this.func_150723_a(enumconnectionstate);
- }
- ChannelFuture channelfuture = this.field_150746_k.writeAndFlush(p_150732_1_);
- if(p_150732_2_ != null) {
- channelfuture.addListeners(p_150732_2_);
- }
- channelfuture.addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE);
- } else {
- this.field_150746_k.eventLoop().execute(new Runnable() {
- public void run() {
- if(enumconnectionstate != enumconnectionstate1) {
- NetworkManager.this.func_150723_a(enumconnectionstate);
- }
- ChannelFuture channelfuture1 = NetworkManager.this.field_150746_k.writeAndFlush(p_150732_1_);
- if(p_150732_2_ != null) {
- channelfuture1.addListeners(p_150732_2_);
- }
- channelfuture1.addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE);
- }
- });
- }
- }
- private void func_150733_h() {
- if(this.field_150746_k != null && this.field_150746_k.isOpen()) {
- this.field_181680_j.readLock().lock();
- try {
- while(!this.field_150745_j.isEmpty()) {
- NetworkManager.InboundHandlerTuplePacketListener networkmanager$inboundhandlertuplepacketlistener = (NetworkManager.InboundHandlerTuplePacketListener)this.field_150745_j.poll();
- this.func_150732_b(networkmanager$inboundhandlertuplepacketlistener.field_150774_a, networkmanager$inboundhandlertuplepacketlistener.field_150773_b);
- }
- } finally {
- this.field_181680_j.readLock().unlock();
- }
- }
- }
- public void func_74428_b() {
- this.func_150733_h();
- if(this.field_150744_m instanceof ITickable) {
- ((ITickable)this.field_150744_m).func_73660_a();
- }
- if(this.field_150746_k != null) {
- this.field_150746_k.flush();
- }
- }
- public SocketAddress func_74430_c() {
- return this.field_150743_l;
- }
- public void func_150718_a(ITextComponent p_150718_1_) {
- if(this.field_150746_k.isOpen()) {
- this.field_150746_k.close().awaitUninterruptibly();
- this.field_150742_o = p_150718_1_;
- }
- }
- public boolean func_150731_c() {
- return this.field_150746_k instanceof LocalChannel || this.field_150746_k instanceof LocalServerChannel;
- }
- @SideOnly(Side.CLIENT)
- public static NetworkManager func_181124_a(InetAddress p_181124_0_, int p_181124_1_, boolean p_181124_2_) {
- final NetworkManager networkmanager = new NetworkManager(EnumPacketDirection.CLIENTBOUND);
- Class<? extends SocketChannel> oclass;
- LazyLoadBase<? extends EventLoopGroup> lazyloadbase;
- if(Epoll.isAvailable() && p_181124_2_) {
- oclass = EpollSocketChannel.class;
- lazyloadbase = field_181125_e;
- } else {
- oclass = NioSocketChannel.class;
- lazyloadbase = field_179295_d;
- }
- ((Bootstrap)((Bootstrap)((Bootstrap)(new Bootstrap()).group((EventLoopGroup)lazyloadbase.func_179281_c())).handler(new ChannelInitializer<Channel>() {
- protected void initChannel(Channel p_initChannel_1_) throws Exception {
- try {
- p_initChannel_1_.config().setOption(ChannelOption.TCP_NODELAY, Boolean.valueOf(true));
- } catch (ChannelException var3) {
- ;
- }
- 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);
- }
- })).channel(oclass)).connect(p_181124_0_, p_181124_1_).syncUninterruptibly();
- return networkmanager;
- }
- @SideOnly(Side.CLIENT)
- public static NetworkManager func_150722_a(SocketAddress p_150722_0_) {
- final NetworkManager networkmanager = new NetworkManager(EnumPacketDirection.CLIENTBOUND);
- ((Bootstrap)((Bootstrap)((Bootstrap)(new Bootstrap()).group((EventLoopGroup)field_179296_e.func_179281_c())).handler(new ChannelInitializer<Channel>() {
- protected void initChannel(Channel p_initChannel_1_) throws Exception {
- p_initChannel_1_.pipeline().addLast((String)"packet_handler", (ChannelHandler)networkmanager);
- }
- })).channel(LocalChannel.class)).connect(p_150722_0_).syncUninterruptibly();
- return networkmanager;
- }
- public void func_150727_a(SecretKey p_150727_1_) {
- this.field_152463_r = true;
- this.field_150746_k.pipeline().addBefore("splitter", "decrypt", new NettyEncryptingDecoder(CryptManager.func_151229_a(2, p_150727_1_)));
- this.field_150746_k.pipeline().addBefore("prepender", "encrypt", new NettyEncryptingEncoder(CryptManager.func_151229_a(1, p_150727_1_)));
- }
- @SideOnly(Side.CLIENT)
- public boolean func_179292_f() {
- return this.field_152463_r;
- }
- public boolean func_150724_d() {
- return this.field_150746_k != null && this.field_150746_k.isOpen();
- }
- public boolean func_179291_h() {
- return this.field_150746_k == null;
- }
- public INetHandler func_150729_e() {
- return this.field_150744_m;
- }
- public ITextComponent func_150730_f() {
- return this.field_150742_o;
- }
- public void func_150721_g() {
- this.field_150746_k.config().setAutoRead(false);
- }
- public void func_179289_a(int p_179289_1_) {
- if(p_179289_1_ >= 0) {
- if(this.field_150746_k.pipeline().get("decompress") instanceof NettyCompressionDecoder) {
- ((NettyCompressionDecoder)this.field_150746_k.pipeline().get("decompress")).func_179303_a(p_179289_1_);
- } else {
- this.field_150746_k.pipeline().addBefore("decoder", "decompress", new NettyCompressionDecoder(p_179289_1_));
- }
- if(this.field_150746_k.pipeline().get("compress") instanceof NettyCompressionEncoder) {
- ((NettyCompressionEncoder)this.field_150746_k.pipeline().get("compress")).func_179299_a(p_179289_1_);
- } else {
- this.field_150746_k.pipeline().addBefore("encoder", "compress", new NettyCompressionEncoder(p_179289_1_));
- }
- } else {
- if(this.field_150746_k.pipeline().get("decompress") instanceof NettyCompressionDecoder) {
- this.field_150746_k.pipeline().remove("decompress");
- }
- if(this.field_150746_k.pipeline().get("compress") instanceof NettyCompressionEncoder) {
- this.field_150746_k.pipeline().remove("compress");
- }
- }
- }
- public void func_179293_l() {
- if(this.field_150746_k != null && !this.field_150746_k.isOpen()) {
- if(this.field_179297_n) {
- field_150735_g.warn("handleDisconnection() called twice");
- } else {
- this.field_179297_n = true;
- if(this.func_150730_f() != null) {
- this.func_150729_e().func_147231_a(this.func_150730_f());
- } else if(this.func_150729_e() != null) {
- this.func_150729_e().func_147231_a(new TextComponentTranslation("multiplayer.disconnect.generic", new Object[0]));
- }
- }
- }
- }
- static class InboundHandlerTuplePacketListener {
- private final Packet<?> field_150774_a;
- private final GenericFutureListener<? extends Future<? super Void>>[] field_150773_b;
- public InboundHandlerTuplePacketListener(Packet<?> p_i45146_1_, GenericFutureListener<? extends Future<? super Void>>... p_i45146_2_) {
- this.field_150774_a = p_i45146_1_;
- this.field_150773_b = p_i45146_2_;
- }
- }
- }
- Patching failed: minecraft\net\minecraft\network\EnumConnectionState.java
- Hunk 1 failed! Cannot find hunk target
- field_150764_e[i - -1] = enumconnectionstate;
- for(EnumPacketDirection enumpacketdirection : enumconnectionstate.field_179247_h.keySet()) {
- - for(Class<? extends Packet<?>> oclass : ((BiMap)enumconnectionstate.field_179247_h.get(enumpacketdirection)).values()) {
- + for(Class<? extends Packet<?>> oclass : enumconnectionstate.field_179247_h.get(enumpacketdirection).values()) {
- if (field_150761_f.containsKey(oclass) && field_150761_f.get(oclass) != enumconnectionstate) {
- throw new Error("Packet " + oclass + " is already assigned to protocol " + field_150761_f.get(oclass) + " - can't reassign to " + enumconnectionstate);
- }
- File state
- package net.minecraft.network;
- import com.google.common.collect.BiMap;
- import com.google.common.collect.HashBiMap;
- import com.google.common.collect.Maps;
- import java.util.Map;
- import javax.annotation.Nullable;
- import net.minecraft.network.EnumPacketDirection;
- import net.minecraft.network.Packet;
- import net.minecraft.network.handshake.client.C00Handshake;
- import net.minecraft.network.login.client.CPacketEncryptionResponse;
- import net.minecraft.network.login.client.CPacketLoginStart;
- import net.minecraft.network.login.server.SPacketEnableCompression;
- import net.minecraft.network.login.server.SPacketEncryptionRequest;
- import net.minecraft.network.login.server.SPacketLoginSuccess;
- import net.minecraft.network.play.client.CPacketAnimation;
- import net.minecraft.network.play.client.CPacketChatMessage;
- import net.minecraft.network.play.client.CPacketClickWindow;
- import net.minecraft.network.play.client.CPacketClientSettings;
- import net.minecraft.network.play.client.CPacketClientStatus;
- import net.minecraft.network.play.client.CPacketCloseWindow;
- import net.minecraft.network.play.client.CPacketConfirmTeleport;
- import net.minecraft.network.play.client.CPacketConfirmTransaction;
- import net.minecraft.network.play.client.CPacketCreativeInventoryAction;
- import net.minecraft.network.play.client.CPacketCustomPayload;
- import net.minecraft.network.play.client.CPacketEnchantItem;
- import net.minecraft.network.play.client.CPacketEntityAction;
- import net.minecraft.network.play.client.CPacketHeldItemChange;
- import net.minecraft.network.play.client.CPacketInput;
- import net.minecraft.network.play.client.CPacketKeepAlive;
- import net.minecraft.network.play.client.CPacketPlayer;
- import net.minecraft.network.play.client.CPacketPlayerAbilities;
- import net.minecraft.network.play.client.CPacketPlayerDigging;
- import net.minecraft.network.play.client.CPacketPlayerTryUseItem;
- import net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock;
- import net.minecraft.network.play.client.CPacketRecipeInfo;
- import net.minecraft.network.play.client.CPacketRecipePlacement;
- import net.minecraft.network.play.client.CPacketResourcePackStatus;
- import net.minecraft.network.play.client.CPacketSeenAdvancements;
- import net.minecraft.network.play.client.CPacketSpectate;
- import net.minecraft.network.play.client.CPacketSteerBoat;
- import net.minecraft.network.play.client.CPacketTabComplete;
- import net.minecraft.network.play.client.CPacketUpdateSign;
- import net.minecraft.network.play.client.CPacketUseEntity;
- import net.minecraft.network.play.client.CPacketVehicleMove;
- import net.minecraft.network.play.server.SPacketAdvancementInfo;
- import net.minecraft.network.play.server.SPacketAnimation;
- import net.minecraft.network.play.server.SPacketBlockAction;
- import net.minecraft.network.play.server.SPacketBlockBreakAnim;
- import net.minecraft.network.play.server.SPacketBlockChange;
- import net.minecraft.network.play.server.SPacketCamera;
- import net.minecraft.network.play.server.SPacketChangeGameState;
- import net.minecraft.network.play.server.SPacketChat;
- import net.minecraft.network.play.server.SPacketChunkData;
- import net.minecraft.network.play.server.SPacketCloseWindow;
- import net.minecraft.network.play.server.SPacketCollectItem;
- import net.minecraft.network.play.server.SPacketCombatEvent;
- import net.minecraft.network.play.server.SPacketConfirmTransaction;
- import net.minecraft.network.play.server.SPacketCooldown;
- import net.minecraft.network.play.server.SPacketCustomPayload;
- import net.minecraft.network.play.server.SPacketCustomSound;
- import net.minecraft.network.play.server.SPacketDestroyEntities;
- import net.minecraft.network.play.server.SPacketDisconnect;
- import net.minecraft.network.play.server.SPacketDisplayObjective;
- import net.minecraft.network.play.server.SPacketEffect;
- import net.minecraft.network.play.server.SPacketEntity;
- import net.minecraft.network.play.server.SPacketEntityAttach;
- import net.minecraft.network.play.server.SPacketEntityEffect;
- import net.minecraft.network.play.server.SPacketEntityEquipment;
- import net.minecraft.network.play.server.SPacketEntityHeadLook;
- import net.minecraft.network.play.server.SPacketEntityMetadata;
- import net.minecraft.network.play.server.SPacketEntityProperties;
- import net.minecraft.network.play.server.SPacketEntityStatus;
- import net.minecraft.network.play.server.SPacketEntityTeleport;
- import net.minecraft.network.play.server.SPacketEntityVelocity;
- import net.minecraft.network.play.server.SPacketExplosion;
- import net.minecraft.network.play.server.SPacketHeldItemChange;
- import net.minecraft.network.play.server.SPacketJoinGame;
- import net.minecraft.network.play.server.SPacketKeepAlive;
- import net.minecraft.network.play.server.SPacketMaps;
- import net.minecraft.network.play.server.SPacketMoveVehicle;
- import net.minecraft.network.play.server.SPacketMultiBlockChange;
- import net.minecraft.network.play.server.SPacketOpenWindow;
- import net.minecraft.network.play.server.SPacketParticles;
- import net.minecraft.network.play.server.SPacketPlayerAbilities;
- import net.minecraft.network.play.server.SPacketPlayerListHeaderFooter;
- import net.minecraft.network.play.server.SPacketPlayerListItem;
- import net.minecraft.network.play.server.SPacketPlayerPosLook;
- import net.minecraft.network.play.server.SPacketRecipeBook;
- import net.minecraft.network.play.server.SPacketRemoveEntityEffect;
- import net.minecraft.network.play.server.SPacketResourcePackSend;
- import net.minecraft.network.play.server.SPacketRespawn;
- import net.minecraft.network.play.server.SPacketScoreboardObjective;
- import net.minecraft.network.play.server.SPacketSelectAdvancementsTab;
- import net.minecraft.network.play.server.SPacketServerDifficulty;
- import net.minecraft.network.play.server.SPacketSetExperience;
- import net.minecraft.network.play.server.SPacketSetPassengers;
- import net.minecraft.network.play.server.SPacketSetSlot;
- import net.minecraft.network.play.server.SPacketSignEditorOpen;
- import net.minecraft.network.play.server.SPacketSoundEffect;
- import net.minecraft.network.play.server.SPacketSpawnExperienceOrb;
- import net.minecraft.network.play.server.SPacketSpawnGlobalEntity;
- import net.minecraft.network.play.server.SPacketSpawnMob;
- import net.minecraft.network.play.server.SPacketSpawnObject;
- import net.minecraft.network.play.server.SPacketSpawnPainting;
- import net.minecraft.network.play.server.SPacketSpawnPlayer;
- import net.minecraft.network.play.server.SPacketSpawnPosition;
- import net.minecraft.network.play.server.SPacketStatistics;
- import net.minecraft.network.play.server.SPacketTabComplete;
- import net.minecraft.network.play.server.SPacketTeams;
- import net.minecraft.network.play.server.SPacketTimeUpdate;
- import net.minecraft.network.play.server.SPacketTitle;
- import net.minecraft.network.play.server.SPacketUnloadChunk;
- import net.minecraft.network.play.server.SPacketUpdateBossInfo;
- import net.minecraft.network.play.server.SPacketUpdateHealth;
- import net.minecraft.network.play.server.SPacketUpdateScore;
- import net.minecraft.network.play.server.SPacketUpdateTileEntity;
- import net.minecraft.network.play.server.SPacketUseBed;
- import net.minecraft.network.play.server.SPacketWindowItems;
- import net.minecraft.network.play.server.SPacketWindowProperty;
- import net.minecraft.network.play.server.SPacketWorldBorder;
- import net.minecraft.network.status.client.CPacketPing;
- import net.minecraft.network.status.client.CPacketServerQuery;
- import net.minecraft.network.status.server.SPacketPong;
- import net.minecraft.network.status.server.SPacketServerInfo;
- import org.apache.logging.log4j.LogManager;
- public enum EnumConnectionState {
- HANDSHAKING(-1) {
- {
- this.func_179245_a(EnumPacketDirection.SERVERBOUND, C00Handshake.class);
- }
- },
- PLAY(0) {
- {
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketSpawnObject.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketSpawnExperienceOrb.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketSpawnGlobalEntity.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketSpawnMob.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketSpawnPainting.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketSpawnPlayer.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketAnimation.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketStatistics.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketBlockBreakAnim.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketUpdateTileEntity.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketBlockAction.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketBlockChange.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketUpdateBossInfo.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketServerDifficulty.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketTabComplete.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketChat.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketMultiBlockChange.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketConfirmTransaction.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketCloseWindow.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketOpenWindow.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketWindowItems.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketWindowProperty.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketSetSlot.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketCooldown.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketCustomPayload.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketCustomSound.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketDisconnect.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketEntityStatus.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketExplosion.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketUnloadChunk.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketChangeGameState.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketKeepAlive.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketChunkData.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketEffect.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketParticles.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketJoinGame.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketMaps.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketEntity.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketEntity.S15PacketEntityRelMove.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketEntity.S17PacketEntityLookMove.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketEntity.S16PacketEntityLook.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketMoveVehicle.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketSignEditorOpen.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketPlayerAbilities.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketCombatEvent.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketPlayerListItem.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketPlayerPosLook.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketUseBed.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketRecipeBook.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketDestroyEntities.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketRemoveEntityEffect.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketResourcePackSend.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketRespawn.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketEntityHeadLook.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketSelectAdvancementsTab.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketWorldBorder.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketCamera.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketHeldItemChange.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketDisplayObjective.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketEntityMetadata.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketEntityAttach.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketEntityVelocity.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketEntityEquipment.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketSetExperience.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketUpdateHealth.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketScoreboardObjective.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketSetPassengers.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketTeams.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketUpdateScore.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketSpawnPosition.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketTimeUpdate.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketTitle.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketSoundEffect.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketPlayerListHeaderFooter.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketCollectItem.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketEntityTeleport.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketAdvancementInfo.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketEntityProperties.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketEntityEffect.class);
- this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketConfirmTeleport.class);
- this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketRecipePlacement.class);
- this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketTabComplete.class);
- this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketChatMessage.class);
- this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketClientStatus.class);
- this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketClientSettings.class);
- this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketConfirmTransaction.class);
- this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketEnchantItem.class);
- this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketClickWindow.class);
- this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketCloseWindow.class);
- this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketCustomPayload.class);
- this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketUseEntity.class);
- this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketKeepAlive.class);
- this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketPlayer.class);
- this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketPlayer.Position.class);
- this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketPlayer.PositionRotation.class);
- this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketPlayer.Rotation.class);
- this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketVehicleMove.class);
- this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketSteerBoat.class);
- this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketPlayerAbilities.class);
- this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketPlayerDigging.class);
- this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketEntityAction.class);
- this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketInput.class);
- this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketRecipeInfo.class);
- this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketResourcePackStatus.class);
- this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketSeenAdvancements.class);
- this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketHeldItemChange.class);
- this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketCreativeInventoryAction.class);
- this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketUpdateSign.class);
- this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketAnimation.class);
- this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketSpectate.class);
- this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketPlayerTryUseItemOnBlock.class);
- this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketPlayerTryUseItem.class);
- }
- },
- STATUS(1) {
- {
- this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketServerQuery.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketServerInfo.class);
- this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketPing.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketPong.class);
- }
- },
- LOGIN(2) {
- {
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, net.minecraft.network.login.server.SPacketDisconnect.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketEncryptionRequest.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketLoginSuccess.class);
- this.func_179245_a(EnumPacketDirection.CLIENTBOUND, SPacketEnableCompression.class);
- this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketLoginStart.class);
- this.func_179245_a(EnumPacketDirection.SERVERBOUND, CPacketEncryptionResponse.class);
- }
- };
- private static final EnumConnectionState[] field_150764_e = new EnumConnectionState[4];
- private static final Map<Class<? extends Packet<?>>, EnumConnectionState> field_150761_f = Maps.<Class<? extends Packet<?>>, EnumConnectionState>newHashMap();
- private final int field_150762_g;
- private final Map<EnumPacketDirection, BiMap<Integer, Class<? extends Packet<?>>>> field_179247_h;
- private EnumConnectionState(int p_i45152_3_) {
- this.field_179247_h = Maps.newEnumMap(EnumPacketDirection.class);
- this.field_150762_g = p_i45152_3_;
- }
- protected EnumConnectionState func_179245_a(EnumPacketDirection p_179245_1_, Class<? extends Packet<?>> p_179245_2_) {
- BiMap<Integer, Class<? extends Packet<?>>> bimap = (BiMap)this.field_179247_h.get(p_179245_1_);
- if(bimap == null) {
- bimap = HashBiMap.<Integer, Class<? extends Packet<?>>>create();
- this.field_179247_h.put(p_179245_1_, bimap);
- }
- if(bimap.containsValue(p_179245_2_)) {
- String s = p_179245_1_ + " packet " + p_179245_2_ + " is already known to ID " + bimap.inverse().get(p_179245_2_);
- LogManager.getLogger().fatal(s);
- throw new IllegalArgumentException(s);
- } else {
- bimap.put(Integer.valueOf(bimap.size()), p_179245_2_);
- return this;
- }
- }
- public Integer func_179246_a(EnumPacketDirection p_179246_1_, Packet<?> p_179246_2_) throws Exception {
- return (Integer)((BiMap)this.field_179247_h.get(p_179246_1_)).inverse().get(p_179246_2_.getClass());
- }
- @Nullable
- public Packet<?> func_179244_a(EnumPacketDirection p_179244_1_, int p_179244_2_) throws InstantiationException, IllegalAccessException {
- Class<? extends Packet<?>> oclass = (Class)((BiMap)this.field_179247_h.get(p_179244_1_)).get(Integer.valueOf(p_179244_2_));
- return oclass == null?null:(Packet)oclass.newInstance();
- }
- public int func_150759_c() {
- return this.field_150762_g;
- }
- public static EnumConnectionState func_150760_a(int p_150760_0_) {
- return p_150760_0_ >= -1 && p_150760_0_ <= 2?field_150764_e[p_150760_0_ - -1]:null;
- }
- public static EnumConnectionState func_150752_a(Packet<?> p_150752_0_) {
- return (EnumConnectionState)field_150761_f.get(p_150752_0_.getClass());
- }
- static {
- for(EnumConnectionState enumconnectionstate : values()) {
- int i = enumconnectionstate.func_150759_c();
- if(i < -1 || i > 2) {
- throw new Error("Invalid protocol ID " + Integer.toString(i));
- }
- field_150764_e[i - -1] = enumconnectionstate;
- for(EnumPacketDirection enumpacketdirection : enumconnectionstate.field_179247_h.keySet()) {
- for(Class<? extends Packet<?>> oclass : ((BiMap)enumconnectionstate.field_179247_h.get(enumpacketdirection)).values()) {
- if(field_150761_f.containsKey(oclass) && field_150761_f.get(oclass) != enumconnectionstate) {
- throw new Error("Packet " + oclass + " is already assigned to protocol " + field_150761_f.get(oclass) + " - can\'t reassign to " + enumconnectionstate);
- }
- try {
- oclass.newInstance();
- } catch (Throwable var10) {
- throw new Error("Packet " + oclass + " fails instantiation checks! " + oclass);
- }
- field_150761_f.put(oclass, enumconnectionstate);
- }
- }
- }
- }
- }
- Patching failed: minecraft\net\minecraft\util\text\TextComponentKeybind.java
- Hunk 1 failed! Cannot find hunk target
- public class TextComponentKeybind extends TextComponentBase {
- public static Function<String, Supplier<String>> field_193637_b = (p_193635_0_) -> {
- return () -> {
- - return p_193634_0_;
- + return p_193635_0_;
- };
- };
- private final String field_193638_c;
- File state
- package net.minecraft.util.text;
- import java.util.function.Function;
- import java.util.function.Supplier;
- import net.minecraft.util.text.ITextComponent;
- import net.minecraft.util.text.TextComponentBase;
- public class TextComponentKeybind extends TextComponentBase {
- public static Function<String, Supplier<String>> field_193637_b = (p_193635_0_) -> {
- return () -> {
- return p_193635_0_;
- };
- };
- private final String field_193638_c;
- private Supplier<String> field_193639_d;
- public TextComponentKeybind(String p_i47521_1_) {
- this.field_193638_c = p_i47521_1_;
- }
- public String func_150261_e() {
- if(this.field_193639_d == null) {
- this.field_193639_d = (Supplier)field_193637_b.apply(this.field_193638_c);
- }
- return (String)this.field_193639_d.get();
- }
- public TextComponentKeybind func_150259_f() {
- TextComponentKeybind textcomponentkeybind = new TextComponentKeybind(this.field_193638_c);
- textcomponentkeybind.func_150255_a(this.func_150256_b().func_150232_l());
- for(ITextComponent itextcomponent : this.func_150253_a()) {
- textcomponentkeybind.func_150257_a(itextcomponent.func_150259_f());
- }
- return textcomponentkeybind;
- }
- public boolean equals(Object p_equals_1_) {
- if(this == p_equals_1_) {
- return true;
- } else if(!(p_equals_1_ instanceof TextComponentKeybind)) {
- return false;
- } else {
- TextComponentKeybind textcomponentkeybind = (TextComponentKeybind)p_equals_1_;
- return this.field_193638_c.equals(textcomponentkeybind.field_193638_c) && super.equals(p_equals_1_);
- }
- }
- public String toString() {
- return "KeybindComponent{keybind=\'" + this.field_193638_c + '\'' + ", siblings=" + this.field_150264_a + ", style=" + this.func_150256_b() + '}';
- }
- public String func_193633_h() {
- return this.field_193638_c;
- }
- }
- Patching failed: minecraft\net\minecraft\advancements\PlayerAdvancements.java
- Hunk 1 failed! Cannot find hunk target
- Stream<Entry<ResourceLocation, AdvancementProgress>> stream = map.entrySet().stream().sorted(Comparator.comparing(Entry::getValue));
- - for(Entry<ResourceLocation, AdvancementProgress> entry : (List)stream.collect(Collectors.toList())) {
- + for(Entry<ResourceLocation, AdvancementProgress> entry : stream.collect(Collectors.toList())) {
- Advancement advancement = this.field_192756_d.func_191949_aK().func_192778_a(entry.getKey());
- if (advancement == null) {
- field_192753_a.warn("Ignored advancement '" + entry.getKey() + "' in progress file " + this.field_192757_e + " - it doesn't exist anymore?");
- File state
- package net.minecraft.advancements;
- import com.google.common.collect.Lists;
- import com.google.common.collect.Maps;
- import com.google.common.collect.Sets;
- import com.google.common.io.Files;
- import com.google.gson.Gson;
- import com.google.gson.GsonBuilder;
- import com.google.gson.JsonParseException;
- import com.google.gson.reflect.TypeToken;
- import java.io.File;
- import java.io.IOException;
- import java.nio.charset.StandardCharsets;
- import java.util.Comparator;
- import java.util.List;
- import java.util.Map;
- import java.util.Set;
- import java.util.Map.Entry;
- import java.util.function.Function;
- import java.util.stream.Collectors;
- import java.util.stream.Stream;
- import javax.annotation.Nullable;
- import net.minecraft.advancements.Advancement;
- import net.minecraft.advancements.AdvancementProgress;
- import net.minecraft.advancements.CriteriaTriggers;
- import net.minecraft.advancements.Criterion;
- import net.minecraft.advancements.CriterionProgress;
- import net.minecraft.advancements.ICriterionInstance;
- import net.minecraft.advancements.ICriterionTrigger;
- import net.minecraft.entity.player.EntityPlayerMP;
- import net.minecraft.network.play.server.SPacketAdvancementInfo;
- import net.minecraft.network.play.server.SPacketSelectAdvancementsTab;
- import net.minecraft.server.MinecraftServer;
- import net.minecraft.util.JsonUtils;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.util.text.TextComponentTranslation;
- import org.apache.logging.log4j.LogManager;
- import org.apache.logging.log4j.Logger;
- public class PlayerAdvancements {
- private static final Logger field_192753_a = LogManager.getLogger();
- private static final Gson field_192754_b = (new GsonBuilder()).registerTypeAdapter(AdvancementProgress.class, new AdvancementProgress.Serializer()).registerTypeAdapter(ResourceLocation.class, new ResourceLocation.Serializer()).setPrettyPrinting().create();
- private static final TypeToken<Map<ResourceLocation, AdvancementProgress>> field_192755_c = new TypeToken<Map<ResourceLocation, AdvancementProgress>>() {
- };
- private final MinecraftServer field_192756_d;
- private final File field_192757_e;
- private final Map<Advancement, AdvancementProgress> field_192758_f = Maps.<Advancement, AdvancementProgress>newLinkedHashMap();
- private final Set<Advancement> field_192759_g = Sets.<Advancement>newLinkedHashSet();
- private final Set<Advancement> field_192760_h = Sets.<Advancement>newLinkedHashSet();
- private final Set<Advancement> field_192761_i = Sets.<Advancement>newLinkedHashSet();
- private EntityPlayerMP field_192762_j;
- @Nullable
- private Advancement field_194221_k;
- private boolean field_192763_k = true;
- public PlayerAdvancements(MinecraftServer p_i47422_1_, File p_i47422_2_, EntityPlayerMP p_i47422_3_) {
- this.field_192756_d = p_i47422_1_;
- this.field_192757_e = p_i47422_2_;
- this.field_192762_j = p_i47422_3_;
- this.func_192740_f();
- }
- public void func_192739_a(EntityPlayerMP p_192739_1_) {
- this.field_192762_j = p_192739_1_;
- }
- public void func_192745_a() {
- for(ICriterionTrigger<?> icriteriontrigger : CriteriaTriggers.func_192120_a()) {
- icriteriontrigger.func_192167_a(this);
- }
- }
- public void func_193766_b() {
- this.func_192745_a();
- this.field_192758_f.clear();
- this.field_192759_g.clear();
- this.field_192760_h.clear();
- this.field_192761_i.clear();
- this.field_192763_k = true;
- this.field_194221_k = null;
- this.func_192740_f();
- }
- private void func_192751_c() {
- for(Advancement advancement : this.field_192756_d.func_191949_aK().func_192780_b()) {
- this.func_193764_b(advancement);
- }
- }
- private void func_192752_d() {
- List<Advancement> list = Lists.<Advancement>newArrayList();
- for(Entry<Advancement, AdvancementProgress> entry : this.field_192758_f.entrySet()) {
- if(((AdvancementProgress)entry.getValue()).func_192105_a()) {
- list.add(entry.getKey());
- this.field_192761_i.add(entry.getKey());
- }
- }
- for(Advancement advancement : list) {
- this.func_192742_b(advancement);
- }
- }
- private void func_192748_e() {
- for(Advancement advancement : this.field_192756_d.func_191949_aK().func_192780_b()) {
- if(advancement.func_192073_f().isEmpty()) {
- this.func_192750_a(advancement, "");
- advancement.func_192072_d().func_192113_a(this.field_192762_j);
- }
- }
- }
- private void func_192740_f() {
- if(this.field_192757_e.isFile()) {
- try {
- String s = Files.toString(this.field_192757_e, StandardCharsets.UTF_8);
- Map<ResourceLocation, AdvancementProgress> map = (Map)JsonUtils.func_193840_a(field_192754_b, s, field_192755_c.getType());
- if(map == null) {
- throw new JsonParseException("Found null for advancements");
- }
- Stream<Entry<ResourceLocation, AdvancementProgress>> stream = map.entrySet().stream().sorted(Comparator.comparing(Entry::getValue));
- for(Entry<ResourceLocation, AdvancementProgress> entry : (List)stream.collect(Collectors.toList())) {
- Advancement advancement = this.field_192756_d.func_191949_aK().func_192778_a((ResourceLocation)entry.getKey());
- if(advancement == null) {
- field_192753_a.warn("Ignored advancement \'" + entry.getKey() + "\' in progress file " + this.field_192757_e + " - it doesn\'t exist anymore?");
- } else {
- this.func_192743_a(advancement, (AdvancementProgress)entry.getValue());
- }
- }
- } catch (JsonParseException jsonparseexception) {
- field_192753_a.error((String)("Couldn\'t parse player advancements in " + this.field_192757_e), (Throwable)jsonparseexception);
- } catch (IOException ioexception) {
- field_192753_a.error((String)("Couldn\'t access player advancements in " + this.field_192757_e), (Throwable)ioexception);
- }
- }
- this.func_192748_e();
- this.func_192752_d();
- this.func_192751_c();
- }
- public void func_192749_b() {
- Map<ResourceLocation, AdvancementProgress> map = Maps.<ResourceLocation, AdvancementProgress>newHashMap();
- for(Entry<Advancement, AdvancementProgress> entry : this.field_192758_f.entrySet()) {
- AdvancementProgress advancementprogress = (AdvancementProgress)entry.getValue();
- if(advancementprogress.func_192108_b()) {
- map.put(((Advancement)entry.getKey()).func_192067_g(), advancementprogress);
- }
- }
- if(this.field_192757_e.getParentFile() != null) {
- this.field_192757_e.getParentFile().mkdirs();
- }
- try {
- Files.write(field_192754_b.toJson((Object)map), this.field_192757_e, StandardCharsets.UTF_8);
- } catch (IOException ioexception) {
- field_192753_a.error((String)("Couldn\'t save player advancements to " + this.field_192757_e), (Throwable)ioexception);
- }
- }
- public boolean func_192750_a(Advancement p_192750_1_, String p_192750_2_) {
- boolean boolean = false;
- AdvancementProgress advancementprogress = this.func_192747_a(p_192750_1_);
- boolean boolean = advancementprogress.func_192105_a();
- if(advancementprogress.func_192109_a(p_192750_2_)) {
- this.func_193765_c(p_192750_1_);
- this.field_192761_i.add(p_192750_1_);
- boolean = true;
- if(!boolean && advancementprogress.func_192105_a()) {
- p_192750_1_.func_192072_d().func_192113_a(this.field_192762_j);
- 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")) {
- 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()}));
- }
- }
- }
- if(advancementprogress.func_192105_a()) {
- this.func_192742_b(p_192750_1_);
- }
- return boolean;
- }
- public boolean func_192744_b(Advancement p_192744_1_, String p_192744_2_) {
- boolean boolean = false;
- AdvancementProgress advancementprogress = this.func_192747_a(p_192744_1_);
- if(advancementprogress.func_192101_b(p_192744_2_)) {
- this.func_193764_b(p_192744_1_);
- this.field_192761_i.add(p_192744_1_);
- boolean = true;
- }
- if(!advancementprogress.func_192108_b()) {
- this.func_192742_b(p_192744_1_);
- }
- return boolean;
- }
- private void func_193764_b(Advancement p_193764_1_) {
- AdvancementProgress advancementprogress = this.func_192747_a(p_193764_1_);
- if(!advancementprogress.func_192105_a()) {
- for(Entry<String, Criterion> entry : p_193764_1_.func_192073_f().entrySet()) {
- CriterionProgress criterionprogress = advancementprogress.func_192106_c((String)entry.getKey());
- if(criterionprogress != null && !criterionprogress.func_192151_a()) {
- ICriterionInstance icriterioninstance = ((Criterion)entry.getValue()).func_192143_a();
- if(icriterioninstance != null) {
- ICriterionTrigger<ICriterionInstance> icriteriontrigger = CriteriaTriggers.<ICriterionInstance>func_192119_a(icriterioninstance.func_192244_a());
- if(icriteriontrigger != null) {
- icriteriontrigger.func_192165_a(this, new ICriterionTrigger.Listener(icriterioninstance, p_193764_1_, (String)entry.getKey()));
- }
- }
- }
- }
- }
- }
- private void func_193765_c(Advancement p_193765_1_) {
- AdvancementProgress advancementprogress = this.func_192747_a(p_193765_1_);
- for(Entry<String, Criterion> entry : p_193765_1_.func_192073_f().entrySet()) {
- CriterionProgress criterionprogress = advancementprogress.func_192106_c((String)entry.getKey());
- if(criterionprogress != null && (criterionprogress.func_192151_a() || advancementprogress.func_192105_a())) {
- ICriterionInstance icriterioninstance = ((Criterion)entry.getValue()).func_192143_a();
- if(icriterioninstance != null) {
- ICriterionTrigger<ICriterionInstance> icriteriontrigger = CriteriaTriggers.<ICriterionInstance>func_192119_a(icriterioninstance.func_192244_a());
- if(icriteriontrigger != null) {
- icriteriontrigger.func_192164_b(this, new ICriterionTrigger.Listener(icriterioninstance, p_193765_1_, (String)entry.getKey()));
- }
- }
- }
- }
- }
- public void func_192741_b(EntityPlayerMP p_192741_1_) {
- if(!this.field_192760_h.isEmpty() || !this.field_192761_i.isEmpty()) {
- Map<ResourceLocation, AdvancementProgress> map = Maps.<ResourceLocation, AdvancementProgress>newHashMap();
- Set<Advancement> set = Sets.<Advancement>newLinkedHashSet();
- Set<ResourceLocation> set1 = Sets.<ResourceLocation>newLinkedHashSet();
- for(Advancement advancement : this.field_192761_i) {
- if(this.field_192759_g.contains(advancement)) {
- map.put(advancement.func_192067_g(), this.field_192758_f.get(advancement));
- }
- }
- for(Advancement advancement1 : this.field_192760_h) {
- if(this.field_192759_g.contains(advancement1)) {
- set.add(advancement1);
- } else {
- set1.add(advancement1.func_192067_g());
- }
- }
- if(!map.isEmpty() || !set.isEmpty() || !set1.isEmpty()) {
- p_192741_1_.field_71135_a.func_147359_a(new SPacketAdvancementInfo(this.field_192763_k, set, set1, map));
- this.field_192760_h.clear();
- this.field_192761_i.clear();
- }
- }
- this.field_192763_k = false;
- }
- public void func_194220_a(@Nullable Advancement p_194220_1_) {
- Advancement advancement = this.field_194221_k;
- if(p_194220_1_ != null && p_194220_1_.func_192070_b() == null && p_194220_1_.func_192068_c() != null) {
- this.field_194221_k = p_194220_1_;
- } else {
- this.field_194221_k = null;
- }
- if(advancement != this.field_194221_k) {
- 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()));
- }
- }
- public AdvancementProgress func_192747_a(Advancement p_192747_1_) {
- AdvancementProgress advancementprogress = (AdvancementProgress)this.field_192758_f.get(p_192747_1_);
- if(advancementprogress == null) {
- advancementprogress = new AdvancementProgress();
- this.func_192743_a(p_192747_1_, advancementprogress);
- }
- return advancementprogress;
- }
- private void func_192743_a(Advancement p_192743_1_, AdvancementProgress p_192743_2_) {
- p_192743_2_.func_192099_a(p_192743_1_.func_192073_f(), p_192743_1_.func_192074_h());
- this.field_192758_f.put(p_192743_1_, p_192743_2_);
- }
- private void func_192742_b(Advancement p_192742_1_) {
- boolean boolean = this.func_192738_c(p_192742_1_);
- boolean boolean = this.field_192759_g.contains(p_192742_1_);
- if(boolean && !boolean) {
- this.field_192759_g.add(p_192742_1_);
- this.field_192760_h.add(p_192742_1_);
- if(this.field_192758_f.containsKey(p_192742_1_)) {
- this.field_192761_i.add(p_192742_1_);
- }
- } else if(!boolean && boolean) {
- this.field_192759_g.remove(p_192742_1_);
- this.field_192760_h.add(p_192742_1_);
- }
- if(boolean != boolean && p_192742_1_.func_192070_b() != null) {
- this.func_192742_b(p_192742_1_.func_192070_b());
- }
- for(Advancement advancement : p_192742_1_.func_192069_e()) {
- this.func_192742_b(advancement);
- }
- }
- private boolean func_192738_c(Advancement p_192738_1_) {
- for(int int = 0; p_192738_1_ != null && int <= 2; ++int) {
- if(int == 0 && this.func_192746_d(p_192738_1_)) {
- return true;
- }
- if(p_192738_1_.func_192068_c() == null) {
- return false;
- }
- AdvancementProgress advancementprogress = this.func_192747_a(p_192738_1_);
- if(advancementprogress.func_192105_a()) {
- return true;
- }
- if(p_192738_1_.func_192068_c().func_193224_j()) {
- return false;
- }
- p_192738_1_ = p_192738_1_.func_192070_b();
- }
- return false;
- }
- private boolean func_192746_d(Advancement p_192746_1_) {
- AdvancementProgress advancementprogress = this.func_192747_a(p_192746_1_);
- if(advancementprogress.func_192105_a()) {
- return true;
- } else {
- for(Advancement advancement : p_192746_1_.func_192069_e()) {
- if(this.func_192746_d(advancement)) {
- return true;
- }
- }
- return false;
- }
- }
- }
- Patching failed: minecraft\net\minecraft\server\management\UserList.java
- Hunk 1 failed! Cannot find hunk target
- }
- protected UserListEntry<K> func_152682_a(JsonObject p_152682_1_) {
- - return new UserListEntry<K>((Object)null, p_152682_1_);
- + return new UserListEntry<K>(null, p_152682_1_);
- }
- protected Map<String, V> func_152688_e() {
- File state
- package net.minecraft.server.management;
- import com.google.common.collect.Lists;
- import com.google.common.collect.Maps;
- import com.google.common.io.Files;
- import com.google.gson.Gson;
- import com.google.gson.GsonBuilder;
- import com.google.gson.JsonDeserializationContext;
- import com.google.gson.JsonDeserializer;
- import com.google.gson.JsonElement;
- import com.google.gson.JsonObject;
- import com.google.gson.JsonParseException;
- import com.google.gson.JsonSerializationContext;
- import com.google.gson.JsonSerializer;
- import java.io.BufferedReader;
- import java.io.BufferedWriter;
- import java.io.File;
- import java.io.FileNotFoundException;
- import java.io.IOException;
- import java.io.Reader;
- import java.io.Writer;
- import java.lang.reflect.ParameterizedType;
- import java.lang.reflect.Type;
- import java.nio.charset.StandardCharsets;
- import java.util.Collection;
- import java.util.List;
- import java.util.Map;
- import net.minecraft.server.management.UserListEntry;
- import net.minecraft.util.JsonUtils;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- import org.apache.commons.io.IOUtils;
- import org.apache.logging.log4j.LogManager;
- import org.apache.logging.log4j.Logger;
- public class UserList<K, V extends UserListEntry<K>> {
- protected static final Logger field_152693_a = LogManager.getLogger();
- protected final Gson field_152694_b;
- private final File field_152695_c;
- private final Map<String, V> field_152696_d = Maps.<String, V>newHashMap();
- private boolean field_152697_e = true;
- private static final ParameterizedType field_152698_f = new ParameterizedType() {
- public Type[] getActualTypeArguments() {
- return new Type[]{UserListEntry.class};
- }
- public Type getRawType() {
- return List.class;
- }
- public Type getOwnerType() {
- return null;
- }
- };
- public UserList(File p_i1144_1_) {
- this.field_152695_c = p_i1144_1_;
- GsonBuilder gsonbuilder = (new GsonBuilder()).setPrettyPrinting();
- gsonbuilder.registerTypeHierarchyAdapter(UserListEntry.class, new UserList.Serializer());
- this.field_152694_b = gsonbuilder.create();
- }
- public boolean func_152689_b() {
- return this.field_152697_e;
- }
- public void func_152686_a(boolean p_152686_1_) {
- this.field_152697_e = p_152686_1_;
- }
- public void func_152687_a(V p_152687_1_) {
- this.field_152696_d.put(this.func_152681_a(p_152687_1_.func_152640_f()), p_152687_1_);
- try {
- this.func_152678_f();
- } catch (IOException ioexception) {
- field_152693_a.warn((String)"Could not save the list after adding a user.", (Throwable)ioexception);
- }
- }
- public V func_152683_b(K p_152683_1_) {
- this.func_152680_h();
- return (V)((UserListEntry)this.field_152696_d.get(this.func_152681_a(p_152683_1_)));
- }
- public void func_152684_c(K p_152684_1_) {
- this.field_152696_d.remove(this.func_152681_a(p_152684_1_));
- try {
- this.func_152678_f();
- } catch (IOException ioexception) {
- field_152693_a.warn((String)"Could not save the list after removing a user.", (Throwable)ioexception);
- }
- }
- @SideOnly(Side.SERVER)
- public File func_152691_c() {
- return this.field_152695_c;
- }
- public String[] func_152685_a() {
- return (String[])this.field_152696_d.keySet().toArray(new String[this.field_152696_d.size()]);
- }
- protected String func_152681_a(K p_152681_1_) {
- return p_152681_1_.toString();
- }
- protected boolean func_152692_d(K p_152692_1_) {
- return this.field_152696_d.containsKey(this.func_152681_a(p_152692_1_));
- }
- private void func_152680_h() {
- List<K> list = Lists.<K>newArrayList();
- for(V v : this.field_152696_d.values()) {
- if(v.func_73682_e()) {
- list.add(v.func_152640_f());
- }
- }
- for(K k : list) {
- this.field_152696_d.remove(k);
- }
- }
- protected UserListEntry<K> func_152682_a(JsonObject p_152682_1_) {
- return new UserListEntry((Object)null, p_152682_1_);
- }
- protected Map<String, V> func_152688_e() {
- return this.field_152696_d;
- }
- public void func_152678_f() throws IOException {
- Collection<V> collection = this.field_152696_d.values();
- String s = this.field_152694_b.toJson((Object)collection);
- BufferedWriter bufferedwriter = null;
- try {
- bufferedwriter = Files.newWriter(this.field_152695_c, StandardCharsets.UTF_8);
- bufferedwriter.write(s);
- } finally {
- IOUtils.closeQuietly((Writer)bufferedwriter);
- }
- }
- @SideOnly(Side.SERVER)
- public boolean func_152690_d() {
- return this.field_152696_d.size() < 1;
- }
- @SideOnly(Side.SERVER)
- public void func_152679_g() throws IOException, FileNotFoundException {
- if(this.field_152695_c.exists()) {
- Collection<UserListEntry<K>> collection = null;
- BufferedReader bufferedreader = null;
- try {
- bufferedreader = Files.newReader(this.field_152695_c, StandardCharsets.UTF_8);
- collection = (Collection)JsonUtils.func_193841_a(this.field_152694_b, bufferedreader, field_152698_f);
- } finally {
- IOUtils.closeQuietly((Reader)bufferedreader);
- }
- if(collection != null) {
- this.field_152696_d.clear();
- for(UserListEntry<K> userlistentry : collection) {
- if(userlistentry.func_152640_f() != null) {
- this.field_152696_d.put(this.func_152681_a(userlistentry.func_152640_f()), userlistentry);
- }
- }
- }
- }
- }
- class Serializer implements JsonDeserializer<UserListEntry<K>>, JsonSerializer<UserListEntry<K>> {
- private Serializer() {
- }
- public JsonElement serialize(UserListEntry<K> p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) {
- JsonObject jsonobject = new JsonObject();
- p_serialize_1_.func_152641_a(jsonobject);
- return jsonobject;
- }
- public UserListEntry<K> deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException {
- if(p_deserialize_1_.isJsonObject()) {
- JsonObject jsonobject = p_deserialize_1_.getAsJsonObject();
- return UserList.this.func_152682_a(jsonobject);
- } else {
- return null;
- }
- }
- }
- }
- Hunk 2 failed! Cannot find hunk target
- for(UserListEntry<K> userlistentry : collection) {
- if (userlistentry.func_152640_f() != null) {
- - this.field_152696_d.put(this.func_152681_a(userlistentry.func_152640_f()), userlistentry);
- + this.field_152696_d.put(this.func_152681_a(userlistentry.func_152640_f()), (V)userlistentry);
- }
- }
- }
- File state
- package net.minecraft.server.management;
- import com.google.common.collect.Lists;
- import com.google.common.collect.Maps;
- import com.google.common.io.Files;
- import com.google.gson.Gson;
- import com.google.gson.GsonBuilder;
- import com.google.gson.JsonDeserializationContext;
- import com.google.gson.JsonDeserializer;
- import com.google.gson.JsonElement;
- import com.google.gson.JsonObject;
- import com.google.gson.JsonParseException;
- import com.google.gson.JsonSerializationContext;
- import com.google.gson.JsonSerializer;
- import java.io.BufferedReader;
- import java.io.BufferedWriter;
- import java.io.File;
- import java.io.FileNotFoundException;
- import java.io.IOException;
- import java.io.Reader;
- import java.io.Writer;
- import java.lang.reflect.ParameterizedType;
- import java.lang.reflect.Type;
- import java.nio.charset.StandardCharsets;
- import java.util.Collection;
- import java.util.List;
- import java.util.Map;
- import net.minecraft.server.management.UserListEntry;
- import net.minecraft.util.JsonUtils;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- import org.apache.commons.io.IOUtils;
- import org.apache.logging.log4j.LogManager;
- import org.apache.logging.log4j.Logger;
- public class UserList<K, V extends UserListEntry<K>> {
- protected static final Logger field_152693_a = LogManager.getLogger();
- protected final Gson field_152694_b;
- private final File field_152695_c;
- private final Map<String, V> field_152696_d = Maps.<String, V>newHashMap();
- private boolean field_152697_e = true;
- private static final ParameterizedType field_152698_f = new ParameterizedType() {
- public Type[] getActualTypeArguments() {
- return new Type[]{UserListEntry.class};
- }
- public Type getRawType() {
- return List.class;
- }
- public Type getOwnerType() {
- return null;
- }
- };
- public UserList(File p_i1144_1_) {
- this.field_152695_c = p_i1144_1_;
- GsonBuilder gsonbuilder = (new GsonBuilder()).setPrettyPrinting();
- gsonbuilder.registerTypeHierarchyAdapter(UserListEntry.class, new UserList.Serializer());
- this.field_152694_b = gsonbuilder.create();
- }
- public boolean func_152689_b() {
- return this.field_152697_e;
- }
- public void func_152686_a(boolean p_152686_1_) {
- this.field_152697_e = p_152686_1_;
- }
- public void func_152687_a(V p_152687_1_) {
- this.field_152696_d.put(this.func_152681_a(p_152687_1_.func_152640_f()), p_152687_1_);
- try {
- this.func_152678_f();
- } catch (IOException ioexception) {
- field_152693_a.warn((String)"Could not save the list after adding a user.", (Throwable)ioexception);
- }
- }
- public V func_152683_b(K p_152683_1_) {
- this.func_152680_h();
- return (V)((UserListEntry)this.field_152696_d.get(this.func_152681_a(p_152683_1_)));
- }
- public void func_152684_c(K p_152684_1_) {
- this.field_152696_d.remove(this.func_152681_a(p_152684_1_));
- try {
- this.func_152678_f();
- } catch (IOException ioexception) {
- field_152693_a.warn((String)"Could not save the list after removing a user.", (Throwable)ioexception);
- }
- }
- @SideOnly(Side.SERVER)
- public File func_152691_c() {
- return this.field_152695_c;
- }
- public String[] func_152685_a() {
- return (String[])this.field_152696_d.keySet().toArray(new String[this.field_152696_d.size()]);
- }
- protected String func_152681_a(K p_152681_1_) {
- return p_152681_1_.toString();
- }
- protected boolean func_152692_d(K p_152692_1_) {
- return this.field_152696_d.containsKey(this.func_152681_a(p_152692_1_));
- }
- private void func_152680_h() {
- List<K> list = Lists.<K>newArrayList();
- for(V v : this.field_152696_d.values()) {
- if(v.func_73682_e()) {
- list.add(v.func_152640_f());
- }
- }
- for(K k : list) {
- this.field_152696_d.remove(k);
- }
- }
- protected UserListEntry<K> func_152682_a(JsonObject p_152682_1_) {
- return new UserListEntry((Object)null, p_152682_1_);
- }
- protected Map<String, V> func_152688_e() {
- return this.field_152696_d;
- }
- public void func_152678_f() throws IOException {
- Collection<V> collection = this.field_152696_d.values();
- String s = this.field_152694_b.toJson((Object)collection);
- BufferedWriter bufferedwriter = null;
- try {
- bufferedwriter = Files.newWriter(this.field_152695_c, StandardCharsets.UTF_8);
- bufferedwriter.write(s);
- } finally {
- IOUtils.closeQuietly((Writer)bufferedwriter);
- }
- }
- @SideOnly(Side.SERVER)
- public boolean func_152690_d() {
- return this.field_152696_d.size() < 1;
- }
- @SideOnly(Side.SERVER)
- public void func_152679_g() throws IOException, FileNotFoundException {
- if(this.field_152695_c.exists()) {
- Collection<UserListEntry<K>> collection = null;
- BufferedReader bufferedreader = null;
- try {
- bufferedreader = Files.newReader(this.field_152695_c, StandardCharsets.UTF_8);
- collection = (Collection)JsonUtils.func_193841_a(this.field_152694_b, bufferedreader, field_152698_f);
- } finally {
- IOUtils.closeQuietly((Reader)bufferedreader);
- }
- if(collection != null) {
- this.field_152696_d.clear();
- for(UserListEntry<K> userlistentry : collection) {
- if(userlistentry.func_152640_f() != null) {
- this.field_152696_d.put(this.func_152681_a(userlistentry.func_152640_f()), userlistentry);
- }
- }
- }
- }
- }
- class Serializer implements JsonDeserializer<UserListEntry<K>>, JsonSerializer<UserListEntry<K>> {
- private Serializer() {
- }
- public JsonElement serialize(UserListEntry<K> p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) {
- JsonObject jsonobject = new JsonObject();
- p_serialize_1_.func_152641_a(jsonobject);
- return jsonobject;
- }
- public UserListEntry<K> deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException {
- if(p_deserialize_1_.isJsonObject()) {
- JsonObject jsonobject = p_deserialize_1_.getAsJsonObject();
- return UserList.this.func_152682_a(jsonobject);
- } else {
- return null;
- }
- }
- }
- }
- Patching failed: minecraft\net\minecraft\util\EnumTypeAdapterFactory.java
- Hunk 1 failed! Cannot find hunk target
- public class EnumTypeAdapterFactory implements TypeAdapterFactory {
- @Nullable
- public <T> TypeAdapter<T> create(Gson p_create_1_, TypeToken<T> p_create_2_) {
- - Class<T> oclass = p_create_2_.getRawType();
- + Class<T> oclass = (Class<T>)p_create_2_.getRawType();
- if (!oclass.isEnum()) {
- return null;
- } else {
- File state
- package net.minecraft.util;
- import com.google.common.collect.Maps;
- import com.google.gson.Gson;
- import com.google.gson.TypeAdapter;
- import com.google.gson.TypeAdapterFactory;
- import com.google.gson.reflect.TypeToken;
- import com.google.gson.stream.JsonReader;
- import com.google.gson.stream.JsonToken;
- import com.google.gson.stream.JsonWriter;
- import java.io.IOException;
- import java.util.Locale;
- import java.util.Map;
- import javax.annotation.Nullable;
- public class EnumTypeAdapterFactory implements TypeAdapterFactory {
- @Nullable
- public <T> TypeAdapter<T> create(Gson p_create_1_, TypeToken<T> p_create_2_) {
- Class<T> oclass = p_create_2_.getRawType();
- if(!oclass.isEnum()) {
- return null;
- } else {
- final Map<String, T> map = Maps.<String, T>newHashMap();
- for(T t : oclass.getEnumConstants()) {
- map.put(this.func_151232_a(t), t);
- }
- return new TypeAdapter<T>() {
- public void write(JsonWriter p_write_1_, T p_write_2_) throws IOException {
- if(p_write_2_ == null) {
- p_write_1_.nullValue();
- } else {
- p_write_1_.value(EnumTypeAdapterFactory.this.func_151232_a(p_write_2_));
- }
- }
- @Nullable
- public T read(JsonReader p_read_1_) throws IOException {
- if(p_read_1_.peek() == JsonToken.NULL) {
- p_read_1_.nextNull();
- return (T)null;
- } else {
- return (T)map.get(p_read_1_.nextString());
- }
- }
- };
- }
- }
- private String func_151232_a(Object p_151232_1_) {
- return p_151232_1_ instanceof Enum?((Enum)p_151232_1_).name().toLowerCase(Locale.ROOT):p_151232_1_.toString().toLowerCase(Locale.ROOT);
- }
- }
- Patching failed: minecraft\net\minecraft\util\datafix\walkers\Filtered.java
- Hunk 1 failed! Cannot find hunk target
- public Filtered(Class<?> p_i47309_1_) {
- if (Entity.class.isAssignableFrom(p_i47309_1_)) {
- - this.field_188272_a = EntityList.func_191306_a(p_i47309_1_);
- + this.field_188272_a = EntityList.func_191306_a((Class<Entity>)p_i47309_1_);
- } else if (TileEntity.class.isAssignableFrom(p_i47309_1_)) {
- - this.field_188272_a = TileEntity.func_190559_a(p_i47309_1_);
- + this.field_188272_a = TileEntity.func_190559_a((Class<TileEntity>)p_i47309_1_);
- } else {
- this.field_188272_a = null;
- }
- File state
- package net.minecraft.util.datafix.walkers;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.EntityList;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.tileentity.TileEntity;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.util.datafix.IDataFixer;
- import net.minecraft.util.datafix.IDataWalker;
- public abstract class Filtered implements IDataWalker {
- private final ResourceLocation field_188272_a;
- public Filtered(Class<?> p_i47309_1_) {
- if(Entity.class.isAssignableFrom(p_i47309_1_)) {
- this.field_188272_a = EntityList.func_191306_a(p_i47309_1_);
- } else if(TileEntity.class.isAssignableFrom(p_i47309_1_)) {
- this.field_188272_a = TileEntity.func_190559_a(p_i47309_1_);
- } else {
- this.field_188272_a = null;
- }
- }
- public NBTTagCompound func_188266_a(IDataFixer p_188266_1_, NBTTagCompound p_188266_2_, int p_188266_3_) {
- if((new ResourceLocation(p_188266_2_.func_74779_i("id"))).equals(this.field_188272_a)) {
- p_188266_2_ = this.func_188271_b(p_188266_1_, p_188266_2_, p_188266_3_);
- }
- return p_188266_2_;
- }
- abstract NBTTagCompound func_188271_b(IDataFixer p_188271_1_, NBTTagCompound p_188271_2_, int p_188271_3_);
- }
- Patching failed: minecraft\net\minecraft\entity\EntityAreaEffectCloud.java
- Hunk 1 failed! Cannot find hunk target
- }
- }
- - iterator = Lists.<Entry<Entity, Integer>>newArrayList();
- + List<PotionEffect> potions = Lists.<PotionEffect>newArrayList();
- for(PotionEffect potioneffect1 : this.field_184502_e.func_185170_a()) {
- - 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()));
- - }
- -
- - iterator.addAll(this.field_184503_f);
- - if (iterator.isEmpty()) {
- + 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()));
- + }
- +
- + potions.addAll(this.field_184503_f);
- + if (potions.isEmpty()) {
- this.field_184504_g.clear();
- } else {
- List<EntityLivingBase> list = this.field_70170_p.<EntityLivingBase>func_72872_a(EntityLivingBase.class, this.func_174813_aQ());
- File state
- package net.minecraft.entity;
- import com.google.common.collect.Lists;
- import com.google.common.collect.Maps;
- import java.util.Iterator;
- import java.util.List;
- import java.util.Map;
- import java.util.UUID;
- import java.util.Map.Entry;
- import javax.annotation.Nullable;
- import net.minecraft.block.material.EnumPushReaction;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.init.PotionTypes;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.nbt.NBTTagList;
- import net.minecraft.network.datasync.DataParameter;
- import net.minecraft.network.datasync.DataSerializers;
- import net.minecraft.network.datasync.EntityDataManager;
- import net.minecraft.potion.PotionEffect;
- import net.minecraft.potion.PotionType;
- import net.minecraft.potion.PotionUtils;
- import net.minecraft.util.EnumParticleTypes;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.util.math.MathHelper;
- import net.minecraft.world.World;
- import net.minecraft.world.WorldServer;
- public class EntityAreaEffectCloud extends Entity {
- private static final DataParameter<Float> field_184498_a = EntityDataManager.<Float>func_187226_a(EntityAreaEffectCloud.class, DataSerializers.field_187193_c);
- private static final DataParameter<Integer> field_184499_b = EntityDataManager.<Integer>func_187226_a(EntityAreaEffectCloud.class, DataSerializers.field_187192_b);
- private static final DataParameter<Boolean> field_184500_c = EntityDataManager.<Boolean>func_187226_a(EntityAreaEffectCloud.class, DataSerializers.field_187198_h);
- private static final DataParameter<Integer> field_184501_d = EntityDataManager.<Integer>func_187226_a(EntityAreaEffectCloud.class, DataSerializers.field_187192_b);
- private static final DataParameter<Integer> field_189736_e = EntityDataManager.<Integer>func_187226_a(EntityAreaEffectCloud.class, DataSerializers.field_187192_b);
- private static final DataParameter<Integer> field_189737_f = EntityDataManager.<Integer>func_187226_a(EntityAreaEffectCloud.class, DataSerializers.field_187192_b);
- private PotionType field_184502_e;
- private final List<PotionEffect> field_184503_f;
- private final Map<Entity, Integer> field_184504_g;
- private int field_184505_h;
- private int field_184506_as;
- private int field_184507_at;
- private boolean field_184508_au;
- private int field_184509_av;
- private float field_184510_aw;
- private float field_184511_ax;
- private EntityLivingBase field_184512_ay;
- private UUID field_184513_az;
- public EntityAreaEffectCloud(World p_i46809_1_) {
- super(p_i46809_1_);
- this.field_184502_e = PotionTypes.field_185229_a;
- this.field_184503_f = Lists.<PotionEffect>newArrayList();
- this.field_184504_g = Maps.<Entity, Integer>newHashMap();
- this.field_184505_h = 600;
- this.field_184506_as = 20;
- this.field_184507_at = 20;
- this.field_70145_X = true;
- this.field_70178_ae = true;
- this.func_184483_a(3.0F);
- }
- public EntityAreaEffectCloud(World p_i46810_1_, double p_i46810_2_, double p_i46810_4_, double p_i46810_6_) {
- this(p_i46810_1_);
- this.func_70107_b(p_i46810_2_, p_i46810_4_, p_i46810_6_);
- }
- protected void func_70088_a() {
- this.func_184212_Q().func_187214_a(field_184499_b, Integer.valueOf(0));
- this.func_184212_Q().func_187214_a(field_184498_a, Float.valueOf(0.5F));
- this.func_184212_Q().func_187214_a(field_184500_c, Boolean.valueOf(false));
- this.func_184212_Q().func_187214_a(field_184501_d, Integer.valueOf(EnumParticleTypes.SPELL_MOB.func_179348_c()));
- this.func_184212_Q().func_187214_a(field_189736_e, Integer.valueOf(0));
- this.func_184212_Q().func_187214_a(field_189737_f, Integer.valueOf(0));
- }
- public void func_184483_a(float p_184483_1_) {
- double d0 = this.field_70165_t;
- double d1 = this.field_70163_u;
- double d2 = this.field_70161_v;
- this.func_70105_a(p_184483_1_ * 2.0F, 0.5F);
- this.func_70107_b(d0, d1, d2);
- if(!this.field_70170_p.field_72995_K) {
- this.func_184212_Q().func_187227_b(field_184498_a, Float.valueOf(p_184483_1_));
- }
- }
- public float func_184490_j() {
- return ((Float)this.func_184212_Q().func_187225_a(field_184498_a)).floatValue();
- }
- public void func_184484_a(PotionType p_184484_1_) {
- this.field_184502_e = p_184484_1_;
- if(!this.field_184508_au) {
- this.func_190618_C();
- }
- }
- private void func_190618_C() {
- if(this.field_184502_e == PotionTypes.field_185229_a && this.field_184503_f.isEmpty()) {
- this.func_184212_Q().func_187227_b(field_184499_b, Integer.valueOf(0));
- } else {
- 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))));
- }
- }
- public void func_184496_a(PotionEffect p_184496_1_) {
- this.field_184503_f.add(p_184496_1_);
- if(!this.field_184508_au) {
- this.func_190618_C();
- }
- }
- public int func_184492_k() {
- return ((Integer)this.func_184212_Q().func_187225_a(field_184499_b)).intValue();
- }
- public void func_184482_a(int p_184482_1_) {
- this.field_184508_au = true;
- this.func_184212_Q().func_187227_b(field_184499_b, Integer.valueOf(p_184482_1_));
- }
- public EnumParticleTypes func_184493_l() {
- return EnumParticleTypes.func_179342_a(((Integer)this.func_184212_Q().func_187225_a(field_184501_d)).intValue());
- }
- public void func_184491_a(EnumParticleTypes p_184491_1_) {
- this.func_184212_Q().func_187227_b(field_184501_d, Integer.valueOf(p_184491_1_.func_179348_c()));
- }
- public int func_189733_n() {
- return ((Integer)this.func_184212_Q().func_187225_a(field_189736_e)).intValue();
- }
- public void func_189734_b(int p_189734_1_) {
- this.func_184212_Q().func_187227_b(field_189736_e, Integer.valueOf(p_189734_1_));
- }
- public int func_189735_o() {
- return ((Integer)this.func_184212_Q().func_187225_a(field_189737_f)).intValue();
- }
- public void func_189732_d(int p_189732_1_) {
- this.func_184212_Q().func_187227_b(field_189737_f, Integer.valueOf(p_189732_1_));
- }
- protected void func_184488_a(boolean p_184488_1_) {
- this.func_184212_Q().func_187227_b(field_184500_c, Boolean.valueOf(p_184488_1_));
- }
- public boolean func_184497_n() {
- return ((Boolean)this.func_184212_Q().func_187225_a(field_184500_c)).booleanValue();
- }
- public int func_184489_o() {
- return this.field_184505_h;
- }
- public void func_184486_b(int p_184486_1_) {
- this.field_184505_h = p_184486_1_;
- }
- public void func_70071_h_() {
- super.func_70071_h_();
- boolean flag = this.func_184497_n();
- float f = this.func_184490_j();
- if(this.field_70170_p.field_72995_K) {
- EnumParticleTypes enumparticletypes = this.func_184493_l();
- int[] aint = new int[enumparticletypes.func_179345_d()];
- if(aint.length > 0) {
- aint[0] = this.func_189733_n();
- }
- if(aint.length > 1) {
- aint[1] = this.func_189735_o();
- }
- if(flag) {
- if(this.field_70146_Z.nextBoolean()) {
- for(int i = 0; i < 2; ++i) {
- float f1 = this.field_70146_Z.nextFloat() * 6.2831855F;
- float f2 = MathHelper.func_76129_c(this.field_70146_Z.nextFloat()) * 0.2F;
- float f3 = MathHelper.func_76134_b(f1) * f2;
- float f4 = MathHelper.func_76126_a(f1) * f2;
- if(enumparticletypes == EnumParticleTypes.SPELL_MOB) {
- int j = this.field_70146_Z.nextBoolean()?16777215:this.func_184492_k();
- int k = j >> 16 & 255;
- int l = j >> 8 & 255;
- int i1 = j & 255;
- 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]);
- } else {
- 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);
- }
- }
- }
- } else {
- float f5 = 3.1415927F * f * f;
- for(int k1 = 0; (float)k1 < f5; ++k1) {
- float f6 = this.field_70146_Z.nextFloat() * 6.2831855F;
- float f7 = MathHelper.func_76129_c(this.field_70146_Z.nextFloat()) * f;
- float f8 = MathHelper.func_76134_b(f6) * f7;
- float f9 = MathHelper.func_76126_a(f6) * f7;
- if(enumparticletypes == EnumParticleTypes.SPELL_MOB) {
- int l1 = this.func_184492_k();
- int i2 = l1 >> 16 & 255;
- int j2 = l1 >> 8 & 255;
- int j1 = l1 & 255;
- 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]);
- } else {
- 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);
- }
- }
- }
- } else {
- if(this.field_70173_aa >= this.field_184506_as + this.field_184505_h) {
- this.func_70106_y();
- return;
- }
- boolean flag1 = this.field_70173_aa < this.field_184506_as;
- if(flag != flag1) {
- this.func_184488_a(flag1);
- }
- if(flag1) {
- return;
- }
- if(this.field_184511_ax != 0.0F) {
- f += this.field_184511_ax;
- if(f < 0.5F) {
- this.func_70106_y();
- return;
- }
- this.func_184483_a(f);
- }
- if(this.field_70173_aa % 5 == 0) {
- Iterator<Entry<Entity, Integer>> iterator = this.field_184504_g.entrySet().iterator();
- while(iterator.hasNext()) {
- Entry<Entity, Integer> entry = (Entry)iterator.next();
- if(this.field_70173_aa >= ((Integer)entry.getValue()).intValue()) {
- iterator.remove();
- }
- }
- iterator = Lists.<Entry<Entity, Integer>>newArrayList();
- for(PotionEffect potioneffect1 : this.field_184502_e.func_185170_a()) {
- 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()));
- }
- iterator.addAll(this.field_184503_f);
- if(iterator.isEmpty()) {
- this.field_184504_g.clear();
- } else {
- List<EntityLivingBase> list = this.field_70170_p.<EntityLivingBase>func_72872_a(EntityLivingBase.class, this.func_174813_aQ());
- if(!list.isEmpty()) {
- for(EntityLivingBase entitylivingbase : list) {
- if(!this.field_184504_g.containsKey(entitylivingbase) && entitylivingbase.func_184603_cC()) {
- double d0 = entitylivingbase.field_70165_t - this.field_70165_t;
- double d1 = entitylivingbase.field_70161_v - this.field_70161_v;
- double d2 = d0 * d0 + d1 * d1;
- if(d2 <= (double)(f * f)) {
- this.field_184504_g.put(entitylivingbase, Integer.valueOf(this.field_70173_aa + this.field_184507_at));
- for(PotionEffect potioneffect : iterator) {
- if(potioneffect.func_188419_a().func_76403_b()) {
- potioneffect.func_188419_a().func_180793_a(this, this.func_184494_w(), entitylivingbase, potioneffect.func_76458_c(), 0.5D);
- } else {
- entitylivingbase.func_70690_d(new PotionEffect(potioneffect));
- }
- }
- if(this.field_184510_aw != 0.0F) {
- f += this.field_184510_aw;
- if(f < 0.5F) {
- this.func_70106_y();
- return;
- }
- this.func_184483_a(f);
- }
- if(this.field_184509_av != 0) {
- this.field_184505_h += this.field_184509_av;
- if(this.field_184505_h <= 0) {
- this.func_70106_y();
- return;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- public void func_184495_b(float p_184495_1_) {
- this.field_184510_aw = p_184495_1_;
- }
- public void func_184487_c(float p_184487_1_) {
- this.field_184511_ax = p_184487_1_;
- }
- public void func_184485_d(int p_184485_1_) {
- this.field_184506_as = p_184485_1_;
- }
- public void func_184481_a(@Nullable EntityLivingBase p_184481_1_) {
- this.field_184512_ay = p_184481_1_;
- this.field_184513_az = p_184481_1_ == null?null:p_184481_1_.func_110124_au();
- }
- @Nullable
- public EntityLivingBase func_184494_w() {
- if(this.field_184512_ay == null && this.field_184513_az != null && this.field_70170_p instanceof WorldServer) {
- Entity entity = ((WorldServer)this.field_70170_p).func_175733_a(this.field_184513_az);
- if(entity instanceof EntityLivingBase) {
- this.field_184512_ay = (EntityLivingBase)entity;
- }
- }
- return this.field_184512_ay;
- }
- protected void func_70037_a(NBTTagCompound p_70037_1_) {
- this.field_70173_aa = p_70037_1_.func_74762_e("Age");
- this.field_184505_h = p_70037_1_.func_74762_e("Duration");
- this.field_184506_as = p_70037_1_.func_74762_e("WaitTime");
- this.field_184507_at = p_70037_1_.func_74762_e("ReapplicationDelay");
- this.field_184509_av = p_70037_1_.func_74762_e("DurationOnUse");
- this.field_184510_aw = p_70037_1_.func_74760_g("RadiusOnUse");
- this.field_184511_ax = p_70037_1_.func_74760_g("RadiusPerTick");
- this.func_184483_a(p_70037_1_.func_74760_g("Radius"));
- this.field_184513_az = p_70037_1_.func_186857_a("OwnerUUID");
- if(p_70037_1_.func_150297_b("Particle", 8)) {
- EnumParticleTypes enumparticletypes = EnumParticleTypes.func_186831_a(p_70037_1_.func_74779_i("Particle"));
- if(enumparticletypes != null) {
- this.func_184491_a(enumparticletypes);
- this.func_189734_b(p_70037_1_.func_74762_e("ParticleParam1"));
- this.func_189732_d(p_70037_1_.func_74762_e("ParticleParam2"));
- }
- }
- if(p_70037_1_.func_150297_b("Color", 99)) {
- this.func_184482_a(p_70037_1_.func_74762_e("Color"));
- }
- if(p_70037_1_.func_150297_b("Potion", 8)) {
- this.func_184484_a(PotionUtils.func_185187_c(p_70037_1_));
- }
- if(p_70037_1_.func_150297_b("Effects", 9)) {
- NBTTagList nbttaglist = p_70037_1_.func_150295_c("Effects", 10);
- this.field_184503_f.clear();
- for(int i = 0; i < nbttaglist.func_74745_c(); ++i) {
- PotionEffect potioneffect = PotionEffect.func_82722_b(nbttaglist.func_150305_b(i));
- if(potioneffect != null) {
- this.func_184496_a(potioneffect);
- }
- }
- }
- }
- protected void func_70014_b(NBTTagCompound p_70014_1_) {
- p_70014_1_.func_74768_a("Age", this.field_70173_aa);
- p_70014_1_.func_74768_a("Duration", this.field_184505_h);
- p_70014_1_.func_74768_a("WaitTime", this.field_184506_as);
- p_70014_1_.func_74768_a("ReapplicationDelay", this.field_184507_at);
- p_70014_1_.func_74768_a("DurationOnUse", this.field_184509_av);
- p_70014_1_.func_74776_a("RadiusOnUse", this.field_184510_aw);
- p_70014_1_.func_74776_a("RadiusPerTick", this.field_184511_ax);
- p_70014_1_.func_74776_a("Radius", this.func_184490_j());
- p_70014_1_.func_74778_a("Particle", this.func_184493_l().func_179346_b());
- p_70014_1_.func_74768_a("ParticleParam1", this.func_189733_n());
- p_70014_1_.func_74768_a("ParticleParam2", this.func_189735_o());
- if(this.field_184513_az != null) {
- p_70014_1_.func_186854_a("OwnerUUID", this.field_184513_az);
- }
- if(this.field_184508_au) {
- p_70014_1_.func_74768_a("Color", this.func_184492_k());
- }
- if(this.field_184502_e != PotionTypes.field_185229_a && this.field_184502_e != null) {
- p_70014_1_.func_74778_a("Potion", ((ResourceLocation)PotionType.field_185176_a.func_177774_c(this.field_184502_e)).toString());
- }
- if(!this.field_184503_f.isEmpty()) {
- NBTTagList nbttaglist = new NBTTagList();
- for(PotionEffect potioneffect : this.field_184503_f) {
- nbttaglist.func_74742_a(potioneffect.func_82719_a(new NBTTagCompound()));
- }
- p_70014_1_.func_74782_a("Effects", nbttaglist);
- }
- }
- public void func_184206_a(DataParameter<?> p_184206_1_) {
- if(field_184498_a.equals(p_184206_1_)) {
- this.func_184483_a(this.func_184490_j());
- }
- super.func_184206_a(p_184206_1_);
- }
- public EnumPushReaction func_184192_z() {
- return EnumPushReaction.IGNORE;
- }
- }
- Hunk 2 failed! Cannot find hunk target
- if (d2 <= (double)(f * f)) {
- this.field_184504_g.put(entitylivingbase, Integer.valueOf(this.field_70173_aa + this.field_184507_at));
- - for(PotionEffect potioneffect : iterator) {
- + for(PotionEffect potioneffect : potions) {
- if (potioneffect.func_188419_a().func_76403_b()) {
- potioneffect.func_188419_a().func_180793_a(this, this.func_184494_w(), entitylivingbase, potioneffect.func_76458_c(), 0.5D);
- } else {
- File state
- package net.minecraft.entity;
- import com.google.common.collect.Lists;
- import com.google.common.collect.Maps;
- import java.util.Iterator;
- import java.util.List;
- import java.util.Map;
- import java.util.UUID;
- import java.util.Map.Entry;
- import javax.annotation.Nullable;
- import net.minecraft.block.material.EnumPushReaction;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.init.PotionTypes;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.nbt.NBTTagList;
- import net.minecraft.network.datasync.DataParameter;
- import net.minecraft.network.datasync.DataSerializers;
- import net.minecraft.network.datasync.EntityDataManager;
- import net.minecraft.potion.PotionEffect;
- import net.minecraft.potion.PotionType;
- import net.minecraft.potion.PotionUtils;
- import net.minecraft.util.EnumParticleTypes;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.util.math.MathHelper;
- import net.minecraft.world.World;
- import net.minecraft.world.WorldServer;
- public class EntityAreaEffectCloud extends Entity {
- private static final DataParameter<Float> field_184498_a = EntityDataManager.<Float>func_187226_a(EntityAreaEffectCloud.class, DataSerializers.field_187193_c);
- private static final DataParameter<Integer> field_184499_b = EntityDataManager.<Integer>func_187226_a(EntityAreaEffectCloud.class, DataSerializers.field_187192_b);
- private static final DataParameter<Boolean> field_184500_c = EntityDataManager.<Boolean>func_187226_a(EntityAreaEffectCloud.class, DataSerializers.field_187198_h);
- private static final DataParameter<Integer> field_184501_d = EntityDataManager.<Integer>func_187226_a(EntityAreaEffectCloud.class, DataSerializers.field_187192_b);
- private static final DataParameter<Integer> field_189736_e = EntityDataManager.<Integer>func_187226_a(EntityAreaEffectCloud.class, DataSerializers.field_187192_b);
- private static final DataParameter<Integer> field_189737_f = EntityDataManager.<Integer>func_187226_a(EntityAreaEffectCloud.class, DataSerializers.field_187192_b);
- private PotionType field_184502_e;
- private final List<PotionEffect> field_184503_f;
- private final Map<Entity, Integer> field_184504_g;
- private int field_184505_h;
- private int field_184506_as;
- private int field_184507_at;
- private boolean field_184508_au;
- private int field_184509_av;
- private float field_184510_aw;
- private float field_184511_ax;
- private EntityLivingBase field_184512_ay;
- private UUID field_184513_az;
- public EntityAreaEffectCloud(World p_i46809_1_) {
- super(p_i46809_1_);
- this.field_184502_e = PotionTypes.field_185229_a;
- this.field_184503_f = Lists.<PotionEffect>newArrayList();
- this.field_184504_g = Maps.<Entity, Integer>newHashMap();
- this.field_184505_h = 600;
- this.field_184506_as = 20;
- this.field_184507_at = 20;
- this.field_70145_X = true;
- this.field_70178_ae = true;
- this.func_184483_a(3.0F);
- }
- public EntityAreaEffectCloud(World p_i46810_1_, double p_i46810_2_, double p_i46810_4_, double p_i46810_6_) {
- this(p_i46810_1_);
- this.func_70107_b(p_i46810_2_, p_i46810_4_, p_i46810_6_);
- }
- protected void func_70088_a() {
- this.func_184212_Q().func_187214_a(field_184499_b, Integer.valueOf(0));
- this.func_184212_Q().func_187214_a(field_184498_a, Float.valueOf(0.5F));
- this.func_184212_Q().func_187214_a(field_184500_c, Boolean.valueOf(false));
- this.func_184212_Q().func_187214_a(field_184501_d, Integer.valueOf(EnumParticleTypes.SPELL_MOB.func_179348_c()));
- this.func_184212_Q().func_187214_a(field_189736_e, Integer.valueOf(0));
- this.func_184212_Q().func_187214_a(field_189737_f, Integer.valueOf(0));
- }
- public void func_184483_a(float p_184483_1_) {
- double d0 = this.field_70165_t;
- double d1 = this.field_70163_u;
- double d2 = this.field_70161_v;
- this.func_70105_a(p_184483_1_ * 2.0F, 0.5F);
- this.func_70107_b(d0, d1, d2);
- if(!this.field_70170_p.field_72995_K) {
- this.func_184212_Q().func_187227_b(field_184498_a, Float.valueOf(p_184483_1_));
- }
- }
- public float func_184490_j() {
- return ((Float)this.func_184212_Q().func_187225_a(field_184498_a)).floatValue();
- }
- public void func_184484_a(PotionType p_184484_1_) {
- this.field_184502_e = p_184484_1_;
- if(!this.field_184508_au) {
- this.func_190618_C();
- }
- }
- private void func_190618_C() {
- if(this.field_184502_e == PotionTypes.field_185229_a && this.field_184503_f.isEmpty()) {
- this.func_184212_Q().func_187227_b(field_184499_b, Integer.valueOf(0));
- } else {
- 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))));
- }
- }
- public void func_184496_a(PotionEffect p_184496_1_) {
- this.field_184503_f.add(p_184496_1_);
- if(!this.field_184508_au) {
- this.func_190618_C();
- }
- }
- public int func_184492_k() {
- return ((Integer)this.func_184212_Q().func_187225_a(field_184499_b)).intValue();
- }
- public void func_184482_a(int p_184482_1_) {
- this.field_184508_au = true;
- this.func_184212_Q().func_187227_b(field_184499_b, Integer.valueOf(p_184482_1_));
- }
- public EnumParticleTypes func_184493_l() {
- return EnumParticleTypes.func_179342_a(((Integer)this.func_184212_Q().func_187225_a(field_184501_d)).intValue());
- }
- public void func_184491_a(EnumParticleTypes p_184491_1_) {
- this.func_184212_Q().func_187227_b(field_184501_d, Integer.valueOf(p_184491_1_.func_179348_c()));
- }
- public int func_189733_n() {
- return ((Integer)this.func_184212_Q().func_187225_a(field_189736_e)).intValue();
- }
- public void func_189734_b(int p_189734_1_) {
- this.func_184212_Q().func_187227_b(field_189736_e, Integer.valueOf(p_189734_1_));
- }
- public int func_189735_o() {
- return ((Integer)this.func_184212_Q().func_187225_a(field_189737_f)).intValue();
- }
- public void func_189732_d(int p_189732_1_) {
- this.func_184212_Q().func_187227_b(field_189737_f, Integer.valueOf(p_189732_1_));
- }
- protected void func_184488_a(boolean p_184488_1_) {
- this.func_184212_Q().func_187227_b(field_184500_c, Boolean.valueOf(p_184488_1_));
- }
- public boolean func_184497_n() {
- return ((Boolean)this.func_184212_Q().func_187225_a(field_184500_c)).booleanValue();
- }
- public int func_184489_o() {
- return this.field_184505_h;
- }
- public void func_184486_b(int p_184486_1_) {
- this.field_184505_h = p_184486_1_;
- }
- public void func_70071_h_() {
- super.func_70071_h_();
- boolean flag = this.func_184497_n();
- float f = this.func_184490_j();
- if(this.field_70170_p.field_72995_K) {
- EnumParticleTypes enumparticletypes = this.func_184493_l();
- int[] aint = new int[enumparticletypes.func_179345_d()];
- if(aint.length > 0) {
- aint[0] = this.func_189733_n();
- }
- if(aint.length > 1) {
- aint[1] = this.func_189735_o();
- }
- if(flag) {
- if(this.field_70146_Z.nextBoolean()) {
- for(int i = 0; i < 2; ++i) {
- float f1 = this.field_70146_Z.nextFloat() * 6.2831855F;
- float f2 = MathHelper.func_76129_c(this.field_70146_Z.nextFloat()) * 0.2F;
- float f3 = MathHelper.func_76134_b(f1) * f2;
- float f4 = MathHelper.func_76126_a(f1) * f2;
- if(enumparticletypes == EnumParticleTypes.SPELL_MOB) {
- int j = this.field_70146_Z.nextBoolean()?16777215:this.func_184492_k();
- int k = j >> 16 & 255;
- int l = j >> 8 & 255;
- int i1 = j & 255;
- 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]);
- } else {
- 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);
- }
- }
- }
- } else {
- float f5 = 3.1415927F * f * f;
- for(int k1 = 0; (float)k1 < f5; ++k1) {
- float f6 = this.field_70146_Z.nextFloat() * 6.2831855F;
- float f7 = MathHelper.func_76129_c(this.field_70146_Z.nextFloat()) * f;
- float f8 = MathHelper.func_76134_b(f6) * f7;
- float f9 = MathHelper.func_76126_a(f6) * f7;
- if(enumparticletypes == EnumParticleTypes.SPELL_MOB) {
- int l1 = this.func_184492_k();
- int i2 = l1 >> 16 & 255;
- int j2 = l1 >> 8 & 255;
- int j1 = l1 & 255;
- 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]);
- } else {
- 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);
- }
- }
- }
- } else {
- if(this.field_70173_aa >= this.field_184506_as + this.field_184505_h) {
- this.func_70106_y();
- return;
- }
- boolean flag1 = this.field_70173_aa < this.field_184506_as;
- if(flag != flag1) {
- this.func_184488_a(flag1);
- }
- if(flag1) {
- return;
- }
- if(this.field_184511_ax != 0.0F) {
- f += this.field_184511_ax;
- if(f < 0.5F) {
- this.func_70106_y();
- return;
- }
- this.func_184483_a(f);
- }
- if(this.field_70173_aa % 5 == 0) {
- Iterator<Entry<Entity, Integer>> iterator = this.field_184504_g.entrySet().iterator();
- while(iterator.hasNext()) {
- Entry<Entity, Integer> entry = (Entry)iterator.next();
- if(this.field_70173_aa >= ((Integer)entry.getValue()).intValue()) {
- iterator.remove();
- }
- }
- iterator = Lists.<Entry<Entity, Integer>>newArrayList();
- for(PotionEffect potioneffect1 : this.field_184502_e.func_185170_a()) {
- 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()));
- }
- iterator.addAll(this.field_184503_f);
- if(iterator.isEmpty()) {
- this.field_184504_g.clear();
- } else {
- List<EntityLivingBase> list = this.field_70170_p.<EntityLivingBase>func_72872_a(EntityLivingBase.class, this.func_174813_aQ());
- if(!list.isEmpty()) {
- for(EntityLivingBase entitylivingbase : list) {
- if(!this.field_184504_g.containsKey(entitylivingbase) && entitylivingbase.func_184603_cC()) {
- double d0 = entitylivingbase.field_70165_t - this.field_70165_t;
- double d1 = entitylivingbase.field_70161_v - this.field_70161_v;
- double d2 = d0 * d0 + d1 * d1;
- if(d2 <= (double)(f * f)) {
- this.field_184504_g.put(entitylivingbase, Integer.valueOf(this.field_70173_aa + this.field_184507_at));
- for(PotionEffect potioneffect : iterator) {
- if(potioneffect.func_188419_a().func_76403_b()) {
- potioneffect.func_188419_a().func_180793_a(this, this.func_184494_w(), entitylivingbase, potioneffect.func_76458_c(), 0.5D);
- } else {
- entitylivingbase.func_70690_d(new PotionEffect(potioneffect));
- }
- }
- if(this.field_184510_aw != 0.0F) {
- f += this.field_184510_aw;
- if(f < 0.5F) {
- this.func_70106_y();
- return;
- }
- this.func_184483_a(f);
- }
- if(this.field_184509_av != 0) {
- this.field_184505_h += this.field_184509_av;
- if(this.field_184505_h <= 0) {
- this.func_70106_y();
- return;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- public void func_184495_b(float p_184495_1_) {
- this.field_184510_aw = p_184495_1_;
- }
- public void func_184487_c(float p_184487_1_) {
- this.field_184511_ax = p_184487_1_;
- }
- public void func_184485_d(int p_184485_1_) {
- this.field_184506_as = p_184485_1_;
- }
- public void func_184481_a(@Nullable EntityLivingBase p_184481_1_) {
- this.field_184512_ay = p_184481_1_;
- this.field_184513_az = p_184481_1_ == null?null:p_184481_1_.func_110124_au();
- }
- @Nullable
- public EntityLivingBase func_184494_w() {
- if(this.field_184512_ay == null && this.field_184513_az != null && this.field_70170_p instanceof WorldServer) {
- Entity entity = ((WorldServer)this.field_70170_p).func_175733_a(this.field_184513_az);
- if(entity instanceof EntityLivingBase) {
- this.field_184512_ay = (EntityLivingBase)entity;
- }
- }
- return this.field_184512_ay;
- }
- protected void func_70037_a(NBTTagCompound p_70037_1_) {
- this.field_70173_aa = p_70037_1_.func_74762_e("Age");
- this.field_184505_h = p_70037_1_.func_74762_e("Duration");
- this.field_184506_as = p_70037_1_.func_74762_e("WaitTime");
- this.field_184507_at = p_70037_1_.func_74762_e("ReapplicationDelay");
- this.field_184509_av = p_70037_1_.func_74762_e("DurationOnUse");
- this.field_184510_aw = p_70037_1_.func_74760_g("RadiusOnUse");
- this.field_184511_ax = p_70037_1_.func_74760_g("RadiusPerTick");
- this.func_184483_a(p_70037_1_.func_74760_g("Radius"));
- this.field_184513_az = p_70037_1_.func_186857_a("OwnerUUID");
- if(p_70037_1_.func_150297_b("Particle", 8)) {
- EnumParticleTypes enumparticletypes = EnumParticleTypes.func_186831_a(p_70037_1_.func_74779_i("Particle"));
- if(enumparticletypes != null) {
- this.func_184491_a(enumparticletypes);
- this.func_189734_b(p_70037_1_.func_74762_e("ParticleParam1"));
- this.func_189732_d(p_70037_1_.func_74762_e("ParticleParam2"));
- }
- }
- if(p_70037_1_.func_150297_b("Color", 99)) {
- this.func_184482_a(p_70037_1_.func_74762_e("Color"));
- }
- if(p_70037_1_.func_150297_b("Potion", 8)) {
- this.func_184484_a(PotionUtils.func_185187_c(p_70037_1_));
- }
- if(p_70037_1_.func_150297_b("Effects", 9)) {
- NBTTagList nbttaglist = p_70037_1_.func_150295_c("Effects", 10);
- this.field_184503_f.clear();
- for(int i = 0; i < nbttaglist.func_74745_c(); ++i) {
- PotionEffect potioneffect = PotionEffect.func_82722_b(nbttaglist.func_150305_b(i));
- if(potioneffect != null) {
- this.func_184496_a(potioneffect);
- }
- }
- }
- }
- protected void func_70014_b(NBTTagCompound p_70014_1_) {
- p_70014_1_.func_74768_a("Age", this.field_70173_aa);
- p_70014_1_.func_74768_a("Duration", this.field_184505_h);
- p_70014_1_.func_74768_a("WaitTime", this.field_184506_as);
- p_70014_1_.func_74768_a("ReapplicationDelay", this.field_184507_at);
- p_70014_1_.func_74768_a("DurationOnUse", this.field_184509_av);
- p_70014_1_.func_74776_a("RadiusOnUse", this.field_184510_aw);
- p_70014_1_.func_74776_a("RadiusPerTick", this.field_184511_ax);
- p_70014_1_.func_74776_a("Radius", this.func_184490_j());
- p_70014_1_.func_74778_a("Particle", this.func_184493_l().func_179346_b());
- p_70014_1_.func_74768_a("ParticleParam1", this.func_189733_n());
- p_70014_1_.func_74768_a("ParticleParam2", this.func_189735_o());
- if(this.field_184513_az != null) {
- p_70014_1_.func_186854_a("OwnerUUID", this.field_184513_az);
- }
- if(this.field_184508_au) {
- p_70014_1_.func_74768_a("Color", this.func_184492_k());
- }
- if(this.field_184502_e != PotionTypes.field_185229_a && this.field_184502_e != null) {
- p_70014_1_.func_74778_a("Potion", ((ResourceLocation)PotionType.field_185176_a.func_177774_c(this.field_184502_e)).toString());
- }
- if(!this.field_184503_f.isEmpty()) {
- NBTTagList nbttaglist = new NBTTagList();
- for(PotionEffect potioneffect : this.field_184503_f) {
- nbttaglist.func_74742_a(potioneffect.func_82719_a(new NBTTagCompound()));
- }
- p_70014_1_.func_74782_a("Effects", nbttaglist);
- }
- }
- public void func_184206_a(DataParameter<?> p_184206_1_) {
- if(field_184498_a.equals(p_184206_1_)) {
- this.func_184483_a(this.func_184490_j());
- }
- super.func_184206_a(p_184206_1_);
- }
- public EnumPushReaction func_184192_z() {
- return EnumPushReaction.IGNORE;
- }
- }
- Patching failed: minecraft\net\minecraft\entity\Entity.java
- Hunk 1 failed! Cannot find hunk target
- }
- }
- - boolean flag = this.field_70122_E || p_70091_4_ != p_70091_4_ && p_70091_4_ < 0.0D;
- + boolean flag = this.field_70122_E || d3 != p_70091_4_ && d3 < 0.0D;
- if (this.field_70138_W > 0.0F && flag && (d2 != p_70091_2_ || d4 != p_70091_6_)) {
- double d14 = p_70091_2_;
- double d6 = p_70091_4_;
- File state
- package net.minecraft.entity;
- import com.google.common.collect.Iterables;
- import com.google.common.collect.Lists;
- import com.google.common.collect.Sets;
- import java.util.Arrays;
- import java.util.Collection;
- import java.util.Collections;
- import java.util.List;
- import java.util.Random;
- import java.util.Set;
- import java.util.UUID;
- import javax.annotation.Nullable;
- import net.minecraft.advancements.CriteriaTriggers;
- import net.minecraft.block.Block;
- import net.minecraft.block.BlockFence;
- import net.minecraft.block.BlockFenceGate;
- import net.minecraft.block.BlockLiquid;
- import net.minecraft.block.BlockWall;
- import net.minecraft.block.SoundType;
- import net.minecraft.block.material.EnumPushReaction;
- import net.minecraft.block.material.Material;
- import net.minecraft.block.state.IBlockState;
- import net.minecraft.block.state.pattern.BlockPattern;
- import net.minecraft.command.CommandResultStats;
- import net.minecraft.command.ICommandSender;
- import net.minecraft.crash.CrashReport;
- import net.minecraft.crash.CrashReportCategory;
- import net.minecraft.crash.ICrashReportDetail;
- import net.minecraft.enchantment.EnchantmentHelper;
- import net.minecraft.enchantment.EnchantmentProtection;
- import net.minecraft.entity.EntityList;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.entity.MoverType;
- import net.minecraft.entity.effect.EntityLightningBolt;
- import net.minecraft.entity.item.EntityBoat;
- import net.minecraft.entity.item.EntityItem;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.entity.player.EntityPlayerMP;
- import net.minecraft.init.Blocks;
- import net.minecraft.init.SoundEvents;
- import net.minecraft.inventory.EntityEquipmentSlot;
- import net.minecraft.item.Item;
- import net.minecraft.item.ItemStack;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.nbt.NBTTagDouble;
- import net.minecraft.nbt.NBTTagFloat;
- import net.minecraft.nbt.NBTTagList;
- import net.minecraft.nbt.NBTTagString;
- import net.minecraft.network.datasync.DataParameter;
- import net.minecraft.network.datasync.DataSerializers;
- import net.minecraft.network.datasync.EntityDataManager;
- import net.minecraft.scoreboard.ScorePlayerTeam;
- import net.minecraft.scoreboard.Team;
- import net.minecraft.server.MinecraftServer;
- import net.minecraft.util.DamageSource;
- import net.minecraft.util.EnumActionResult;
- import net.minecraft.util.EnumBlockRenderType;
- import net.minecraft.util.EnumFacing;
- import net.minecraft.util.EnumHand;
- import net.minecraft.util.EnumParticleTypes;
- import net.minecraft.util.Mirror;
- import net.minecraft.util.ReportedException;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.util.Rotation;
- import net.minecraft.util.SoundCategory;
- import net.minecraft.util.SoundEvent;
- import net.minecraft.util.datafix.DataFixer;
- import net.minecraft.util.datafix.FixTypes;
- import net.minecraft.util.datafix.IDataFixer;
- import net.minecraft.util.datafix.IDataWalker;
- import net.minecraft.util.math.AxisAlignedBB;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.util.math.MathHelper;
- import net.minecraft.util.math.RayTraceResult;
- import net.minecraft.util.math.Vec2f;
- import net.minecraft.util.math.Vec3d;
- import net.minecraft.util.text.ITextComponent;
- import net.minecraft.util.text.TextComponentString;
- import net.minecraft.util.text.event.HoverEvent;
- import net.minecraft.util.text.translation.I18n;
- import net.minecraft.world.Explosion;
- import net.minecraft.world.Teleporter;
- import net.minecraft.world.World;
- import net.minecraft.world.WorldServer;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- import org.apache.logging.log4j.LogManager;
- import org.apache.logging.log4j.Logger;
- public abstract class Entity implements ICommandSender {
- private static final Logger field_184243_a = LogManager.getLogger();
- private static final List<ItemStack> field_190535_b = Collections.<ItemStack>emptyList();
- private static final AxisAlignedBB field_174836_a = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
- private static double field_70155_l = 1.0D;
- private static int field_70152_a;
- private int field_145783_c;
- public boolean field_70156_m;
- private final List<Entity> field_184244_h;
- protected int field_184245_j;
- private Entity field_184239_as;
- public boolean field_98038_p;
- public World field_70170_p;
- public double field_70169_q;
- public double field_70167_r;
- public double field_70166_s;
- public double field_70165_t;
- public double field_70163_u;
- public double field_70161_v;
- public double field_70159_w;
- public double field_70181_x;
- public double field_70179_y;
- public float field_70177_z;
- public float field_70125_A;
- public float field_70126_B;
- public float field_70127_C;
- private AxisAlignedBB field_70121_D;
- public boolean field_70122_E;
- public boolean field_70123_F;
- public boolean field_70124_G;
- public boolean field_70132_H;
- public boolean field_70133_I;
- protected boolean field_70134_J;
- private boolean field_174835_g;
- public boolean field_70128_L;
- public float field_70130_N;
- public float field_70131_O;
- public float field_70141_P;
- public float field_70140_Q;
- public float field_82151_R;
- public float field_70143_R;
- private int field_70150_b;
- private float field_191959_ay;
- public double field_70142_S;
- public double field_70137_T;
- public double field_70136_U;
- public float field_70138_W;
- public boolean field_70145_X;
- public float field_70144_Y;
- protected Random field_70146_Z;
- public int field_70173_aa;
- private int field_190534_ay;
- protected boolean field_70171_ac;
- public int field_70172_ad;
- protected boolean field_70148_d;
- protected boolean field_70178_ae;
- protected EntityDataManager field_70180_af;
- protected static final DataParameter<Byte> field_184240_ax = EntityDataManager.<Byte>func_187226_a(Entity.class, DataSerializers.field_187191_a);
- private static final DataParameter<Integer> field_184241_ay = EntityDataManager.<Integer>func_187226_a(Entity.class, DataSerializers.field_187192_b);
- private static final DataParameter<String> field_184242_az = EntityDataManager.<String>func_187226_a(Entity.class, DataSerializers.field_187194_d);
- private static final DataParameter<Boolean> field_184233_aA = EntityDataManager.<Boolean>func_187226_a(Entity.class, DataSerializers.field_187198_h);
- private static final DataParameter<Boolean> field_184234_aB = EntityDataManager.<Boolean>func_187226_a(Entity.class, DataSerializers.field_187198_h);
- private static final DataParameter<Boolean> field_189655_aD = EntityDataManager.<Boolean>func_187226_a(Entity.class, DataSerializers.field_187198_h);
- public boolean field_70175_ag;
- public int field_70176_ah;
- public int field_70162_ai;
- public int field_70164_aj;
- @SideOnly(Side.CLIENT)
- public long field_70118_ct;
- @SideOnly(Side.CLIENT)
- public long field_70117_cu;
- @SideOnly(Side.CLIENT)
- public long field_70116_cv;
- public boolean field_70158_ak;
- public boolean field_70160_al;
- public int field_71088_bW;
- protected boolean field_71087_bX;
- protected int field_82153_h;
- public int field_71093_bK;
- protected BlockPos field_181016_an;
- protected Vec3d field_181017_ao;
- protected EnumFacing field_181018_ap;
- private boolean field_83001_bt;
- protected UUID field_96093_i;
- protected String field_189513_ar;
- private final CommandResultStats field_174837_as;
- protected boolean field_184238_ar;
- private final Set<String> field_184236_aF;
- private boolean field_184237_aG;
- private final double[] field_191505_aI;
- private long field_191506_aJ;
- public Entity(World p_i1582_1_) {
- this.field_145783_c = field_70152_a++;
- this.field_184244_h = Lists.<Entity>newArrayList();
- this.field_70121_D = field_174836_a;
- this.field_70130_N = 0.6F;
- this.field_70131_O = 1.8F;
- this.field_70150_b = 1;
- this.field_191959_ay = 1.0F;
- this.field_70146_Z = new Random();
- this.field_190534_ay = -this.func_190531_bD();
- this.field_70148_d = true;
- this.field_96093_i = MathHelper.func_180182_a(this.field_70146_Z);
- this.field_189513_ar = this.field_96093_i.toString();
- this.field_174837_as = new CommandResultStats();
- this.field_184236_aF = Sets.<String>newHashSet();
- this.field_191505_aI = new double[]{0.0D, 0.0D, 0.0D};
- this.field_70170_p = p_i1582_1_;
- this.func_70107_b(0.0D, 0.0D, 0.0D);
- if(p_i1582_1_ != null) {
- this.field_71093_bK = p_i1582_1_.field_73011_w.func_186058_p().func_186068_a();
- }
- this.field_70180_af = new EntityDataManager(this);
- this.field_70180_af.func_187214_a(field_184240_ax, Byte.valueOf((byte)0));
- this.field_70180_af.func_187214_a(field_184241_ay, Integer.valueOf(300));
- this.field_70180_af.func_187214_a(field_184233_aA, Boolean.valueOf(false));
- this.field_70180_af.func_187214_a(field_184242_az, "");
- this.field_70180_af.func_187214_a(field_184234_aB, Boolean.valueOf(false));
- this.field_70180_af.func_187214_a(field_189655_aD, Boolean.valueOf(false));
- this.func_70088_a();
- }
- public int func_145782_y() {
- return this.field_145783_c;
- }
- public void func_145769_d(int p_145769_1_) {
- this.field_145783_c = p_145769_1_;
- }
- public Set<String> func_184216_O() {
- return this.field_184236_aF;
- }
- public boolean func_184211_a(String p_184211_1_) {
- if(this.field_184236_aF.size() >= 1024) {
- return false;
- } else {
- this.field_184236_aF.add(p_184211_1_);
- return true;
- }
- }
- public boolean func_184197_b(String p_184197_1_) {
- return this.field_184236_aF.remove(p_184197_1_);
- }
- public void func_174812_G() {
- this.func_70106_y();
- }
- protected abstract void func_70088_a();
- public EntityDataManager func_184212_Q() {
- return this.field_70180_af;
- }
- public boolean equals(Object p_equals_1_) {
- return p_equals_1_ instanceof Entity?((Entity)p_equals_1_).field_145783_c == this.field_145783_c:false;
- }
- public int hashCode() {
- return this.field_145783_c;
- }
- @SideOnly(Side.CLIENT)
- protected void func_70065_x() {
- if(this.field_70170_p != null) {
- while(this.field_70163_u > 0.0D && this.field_70163_u < 256.0D) {
- this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v);
- if(this.field_70170_p.func_184144_a(this, this.func_174813_aQ()).isEmpty()) {
- break;
- }
- ++this.field_70163_u;
- }
- this.field_70159_w = 0.0D;
- this.field_70181_x = 0.0D;
- this.field_70179_y = 0.0D;
- this.field_70125_A = 0.0F;
- }
- }
- public void func_70106_y() {
- this.field_70128_L = true;
- }
- public void func_184174_b(boolean p_184174_1_) {
- }
- protected void func_70105_a(float p_70105_1_, float p_70105_2_) {
- if(p_70105_1_ != this.field_70130_N || p_70105_2_ != this.field_70131_O) {
- float f = this.field_70130_N;
- this.field_70130_N = p_70105_1_;
- this.field_70131_O = p_70105_2_;
- if(this.field_70130_N < f) {
- double d0 = (double)p_70105_1_ / 2.0D;
- 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));
- return;
- }
- AxisAlignedBB axisalignedbb = this.func_174813_aQ();
- 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));
- if(this.field_70130_N > f && !this.field_70148_d && !this.field_70170_p.field_72995_K) {
- this.func_70091_d(MoverType.SELF, (double)(f - this.field_70130_N), 0.0D, (double)(f - this.field_70130_N));
- }
- }
- }
- protected void func_70101_b(float p_70101_1_, float p_70101_2_) {
- this.field_70177_z = p_70101_1_ % 360.0F;
- this.field_70125_A = p_70101_2_ % 360.0F;
- }
- public void func_70107_b(double p_70107_1_, double p_70107_3_, double p_70107_5_) {
- this.field_70165_t = p_70107_1_;
- this.field_70163_u = p_70107_3_;
- this.field_70161_v = p_70107_5_;
- float f = this.field_70130_N / 2.0F;
- float f1 = this.field_70131_O;
- 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));
- }
- @SideOnly(Side.CLIENT)
- public void func_70082_c(float p_70082_1_, float p_70082_2_) {
- float f = this.field_70125_A;
- float f1 = this.field_70177_z;
- this.field_70177_z = (float)((double)this.field_70177_z + (double)p_70082_1_ * 0.15D);
- this.field_70125_A = (float)((double)this.field_70125_A - (double)p_70082_2_ * 0.15D);
- this.field_70125_A = MathHelper.func_76131_a(this.field_70125_A, -90.0F, 90.0F);
- this.field_70127_C += this.field_70125_A - f;
- this.field_70126_B += this.field_70177_z - f1;
- if(this.field_184239_as != null) {
- this.field_184239_as.func_184190_l(this);
- }
- }
- public void func_70071_h_() {
- if(!this.field_70170_p.field_72995_K) {
- this.func_70052_a(6, this.func_184202_aL());
- }
- this.func_70030_z();
- }
- public void func_70030_z() {
- this.field_70170_p.field_72984_F.func_76320_a("entityBaseTick");
- if(this.func_184218_aH() && this.func_184187_bx().field_70128_L) {
- this.func_184210_p();
- }
- if(this.field_184245_j > 0) {
- --this.field_184245_j;
- }
- this.field_70141_P = this.field_70140_Q;
- this.field_70169_q = this.field_70165_t;
- this.field_70167_r = this.field_70163_u;
- this.field_70166_s = this.field_70161_v;
- this.field_70127_C = this.field_70125_A;
- this.field_70126_B = this.field_70177_z;
- if(!this.field_70170_p.field_72995_K && this.field_70170_p instanceof WorldServer) {
- this.field_70170_p.field_72984_F.func_76320_a("portal");
- if(this.field_71087_bX) {
- MinecraftServer minecraftserver = this.field_70170_p.func_73046_m();
- if(minecraftserver.func_71255_r()) {
- if(!this.func_184218_aH()) {
- int i = this.func_82145_z();
- if(this.field_82153_h++ >= i) {
- this.field_82153_h = i;
- this.field_71088_bW = this.func_82147_ab();
- int j;
- if(this.field_70170_p.field_73011_w.func_186058_p().func_186068_a() == -1) {
- j = 0;
- } else {
- j = -1;
- }
- this.func_184204_a(j);
- }
- }
- this.field_71087_bX = false;
- }
- } else {
- if(this.field_82153_h > 0) {
- this.field_82153_h -= 4;
- }
- if(this.field_82153_h < 0) {
- this.field_82153_h = 0;
- }
- }
- this.func_184173_H();
- this.field_70170_p.field_72984_F.func_76319_b();
- }
- this.func_174830_Y();
- this.func_70072_I();
- if(this.field_70170_p.field_72995_K) {
- this.func_70066_B();
- } else if(this.field_190534_ay > 0) {
- if(this.field_70178_ae) {
- this.field_190534_ay -= 4;
- if(this.field_190534_ay < 0) {
- this.func_70066_B();
- }
- } else {
- if(this.field_190534_ay % 20 == 0) {
- this.func_70097_a(DamageSource.field_76370_b, 1.0F);
- }
- --this.field_190534_ay;
- }
- }
- if(this.func_180799_ab()) {
- this.func_70044_A();
- this.field_70143_R *= 0.5F;
- }
- if(this.field_70163_u < -64.0D) {
- this.func_70076_C();
- }
- if(!this.field_70170_p.field_72995_K) {
- this.func_70052_a(0, this.field_190534_ay > 0);
- }
- this.field_70148_d = false;
- this.field_70170_p.field_72984_F.func_76319_b();
- }
- protected void func_184173_H() {
- if(this.field_71088_bW > 0) {
- --this.field_71088_bW;
- }
- }
- public int func_82145_z() {
- return 1;
- }
- protected void func_70044_A() {
- if(!this.field_70178_ae) {
- this.func_70097_a(DamageSource.field_76371_c, 4.0F);
- this.func_70015_d(15);
- }
- }
- public void func_70015_d(int p_70015_1_) {
- int i = p_70015_1_ * 20;
- if(this instanceof EntityLivingBase) {
- i = EnchantmentProtection.func_92093_a((EntityLivingBase)this, i);
- }
- if(this.field_190534_ay < i) {
- this.field_190534_ay = i;
- }
- }
- public void func_70066_B() {
- this.field_190534_ay = 0;
- }
- protected void func_70076_C() {
- this.func_70106_y();
- }
- public boolean func_70038_c(double p_70038_1_, double p_70038_3_, double p_70038_5_) {
- AxisAlignedBB axisalignedbb = this.func_174813_aQ().func_72317_d(p_70038_1_, p_70038_3_, p_70038_5_);
- return this.func_174809_b(axisalignedbb);
- }
- private boolean func_174809_b(AxisAlignedBB p_174809_1_) {
- return this.field_70170_p.func_184144_a(this, p_174809_1_).isEmpty() && !this.field_70170_p.func_72953_d(p_174809_1_);
- }
- public void func_70091_d(MoverType p_70091_1_, double p_70091_2_, double p_70091_4_, double p_70091_6_) {
- if(this.field_70145_X) {
- this.func_174826_a(this.func_174813_aQ().func_72317_d(p_70091_2_, p_70091_4_, p_70091_6_));
- this.func_174829_m();
- } else {
- if(p_70091_1_ == MoverType.PISTON) {
- long i = this.field_70170_p.func_82737_E();
- if(i != this.field_191506_aJ) {
- Arrays.fill(this.field_191505_aI, 0.0D);
- this.field_191506_aJ = i;
- }
- if(p_70091_2_ != 0.0D) {
- int j = EnumFacing.Axis.X.ordinal();
- double d0 = MathHelper.func_151237_a(p_70091_2_ + this.field_191505_aI[j], -0.51D, 0.51D);
- p_70091_2_ = d0 - this.field_191505_aI[j];
- this.field_191505_aI[j] = d0;
- if(Math.abs(p_70091_2_) <= 9.999999747378752E-6D) {
- return;
- }
- } else if(p_70091_4_ != 0.0D) {
- int l4 = EnumFacing.Axis.Y.ordinal();
- double d12 = MathHelper.func_151237_a(p_70091_4_ + this.field_191505_aI[l4], -0.51D, 0.51D);
- p_70091_4_ = d12 - this.field_191505_aI[l4];
- this.field_191505_aI[l4] = d12;
- if(Math.abs(p_70091_4_) <= 9.999999747378752E-6D) {
- return;
- }
- } else {
- if(p_70091_6_ == 0.0D) {
- return;
- }
- int i5 = EnumFacing.Axis.Z.ordinal();
- double d13 = MathHelper.func_151237_a(p_70091_6_ + this.field_191505_aI[i5], -0.51D, 0.51D);
- p_70091_6_ = d13 - this.field_191505_aI[i5];
- this.field_191505_aI[i5] = d13;
- if(Math.abs(p_70091_6_) <= 9.999999747378752E-6D) {
- return;
- }
- }
- }
- this.field_70170_p.field_72984_F.func_76320_a("move");
- double d10 = this.field_70165_t;
- double d11 = this.field_70163_u;
- double d1 = this.field_70161_v;
- if(this.field_70134_J) {
- this.field_70134_J = false;
- p_70091_2_ *= 0.25D;
- p_70091_4_ *= 0.05000000074505806D;
- p_70091_6_ *= 0.25D;
- this.field_70159_w = 0.0D;
- this.field_70181_x = 0.0D;
- this.field_70179_y = 0.0D;
- }
- double d2 = p_70091_2_;
- double d3 = p_70091_4_;
- double d4 = p_70091_6_;
- if((p_70091_1_ == MoverType.SELF || p_70091_1_ == MoverType.PLAYER) && this.field_70122_E && this.func_70093_af() && this instanceof EntityPlayer) {
- 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_) {
- if(p_70091_2_ < 0.05D && p_70091_2_ >= -0.05D) {
- p_70091_2_ = 0.0D;
- } else if(p_70091_2_ > 0.0D) {
- p_70091_2_ -= 0.05D;
- } else {
- p_70091_2_ += 0.05D;
- }
- }
- 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_) {
- if(p_70091_6_ < 0.05D && p_70091_6_ >= -0.05D) {
- p_70091_6_ = 0.0D;
- } else if(p_70091_6_ > 0.0D) {
- p_70091_6_ -= 0.05D;
- } else {
- p_70091_6_ += 0.05D;
- }
- }
- 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_) {
- if(p_70091_2_ < 0.05D && p_70091_2_ >= -0.05D) {
- p_70091_2_ = 0.0D;
- } else if(p_70091_2_ > 0.0D) {
- p_70091_2_ -= 0.05D;
- } else {
- p_70091_2_ += 0.05D;
- }
- d2 = p_70091_2_;
- if(p_70091_6_ < 0.05D && p_70091_6_ >= -0.05D) {
- p_70091_6_ = 0.0D;
- } else if(p_70091_6_ > 0.0D) {
- p_70091_6_ -= 0.05D;
- } else {
- p_70091_6_ += 0.05D;
- }
- }
- }
- 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_));
- AxisAlignedBB axisalignedbb = this.func_174813_aQ();
- if(p_70091_4_ != 0.0D) {
- int k = 0;
- for(int l = list1.size(); k < l; ++k) {
- p_70091_4_ = ((AxisAlignedBB)list1.get(k)).func_72323_b(this.func_174813_aQ(), p_70091_4_);
- }
- this.func_174826_a(this.func_174813_aQ().func_72317_d(0.0D, p_70091_4_, 0.0D));
- }
- if(p_70091_2_ != 0.0D) {
- int j5 = 0;
- for(int l5 = list1.size(); j5 < l5; ++j5) {
- p_70091_2_ = ((AxisAlignedBB)list1.get(j5)).func_72316_a(this.func_174813_aQ(), p_70091_2_);
- }
- if(p_70091_2_ != 0.0D) {
- this.func_174826_a(this.func_174813_aQ().func_72317_d(p_70091_2_, 0.0D, 0.0D));
- }
- }
- if(p_70091_6_ != 0.0D) {
- int k5 = 0;
- for(int i6 = list1.size(); k5 < i6; ++k5) {
- p_70091_6_ = ((AxisAlignedBB)list1.get(k5)).func_72322_c(this.func_174813_aQ(), p_70091_6_);
- }
- if(p_70091_6_ != 0.0D) {
- this.func_174826_a(this.func_174813_aQ().func_72317_d(0.0D, 0.0D, p_70091_6_));
- }
- }
- boolean flag = this.field_70122_E || p_70091_4_ != p_70091_4_ && p_70091_4_ < 0.0D;
- if(this.field_70138_W > 0.0F && flag && (d2 != p_70091_2_ || d4 != p_70091_6_)) {
- double d14 = p_70091_2_;
- double d6 = p_70091_4_;
- double d7 = p_70091_6_;
- AxisAlignedBB axisalignedbb1 = this.func_174813_aQ();
- this.func_174826_a(axisalignedbb);
- p_70091_4_ = (double)this.field_70138_W;
- List<AxisAlignedBB> list = this.field_70170_p.func_184144_a(this, this.func_174813_aQ().func_72321_a(d2, p_70091_4_, d4));
- AxisAlignedBB axisalignedbb2 = this.func_174813_aQ();
- AxisAlignedBB axisalignedbb3 = axisalignedbb2.func_72321_a(d2, 0.0D, d4);
- double d8 = p_70091_4_;
- int j1 = 0;
- for(int k1 = list.size(); j1 < k1; ++j1) {
- d8 = ((AxisAlignedBB)list.get(j1)).func_72323_b(axisalignedbb3, d8);
- }
- axisalignedbb2 = axisalignedbb2.func_72317_d(0.0D, d8, 0.0D);
- double d18 = d2;
- int l1 = 0;
- for(int i2 = list.size(); l1 < i2; ++l1) {
- d18 = ((AxisAlignedBB)list.get(l1)).func_72316_a(axisalignedbb2, d18);
- }
- axisalignedbb2 = axisalignedbb2.func_72317_d(d18, 0.0D, 0.0D);
- double d19 = d4;
- int j2 = 0;
- for(int k2 = list.size(); j2 < k2; ++j2) {
- d19 = ((AxisAlignedBB)list.get(j2)).func_72322_c(axisalignedbb2, d19);
- }
- axisalignedbb2 = axisalignedbb2.func_72317_d(0.0D, 0.0D, d19);
- AxisAlignedBB axisalignedbb4 = this.func_174813_aQ();
- double d20 = p_70091_4_;
- int l2 = 0;
- for(int i3 = list.size(); l2 < i3; ++l2) {
- d20 = ((AxisAlignedBB)list.get(l2)).func_72323_b(axisalignedbb4, d20);
- }
- axisalignedbb4 = axisalignedbb4.func_72317_d(0.0D, d20, 0.0D);
- double d21 = d2;
- int j3 = 0;
- for(int k3 = list.size(); j3 < k3; ++j3) {
- d21 = ((AxisAlignedBB)list.get(j3)).func_72316_a(axisalignedbb4, d21);
- }
- axisalignedbb4 = axisalignedbb4.func_72317_d(d21, 0.0D, 0.0D);
- double d22 = d4;
- int l3 = 0;
- for(int i4 = list.size(); l3 < i4; ++l3) {
- d22 = ((AxisAlignedBB)list.get(l3)).func_72322_c(axisalignedbb4, d22);
- }
- axisalignedbb4 = axisalignedbb4.func_72317_d(0.0D, 0.0D, d22);
- double d23 = d18 * d18 + d19 * d19;
- double d9 = d21 * d21 + d22 * d22;
- if(d23 > d9) {
- p_70091_2_ = d18;
- p_70091_6_ = d19;
- p_70091_4_ = -d8;
- this.func_174826_a(axisalignedbb2);
- } else {
- p_70091_2_ = d21;
- p_70091_6_ = d22;
- p_70091_4_ = -d20;
- this.func_174826_a(axisalignedbb4);
- }
- int j4 = 0;
- for(int k4 = list.size(); j4 < k4; ++j4) {
- p_70091_4_ = ((AxisAlignedBB)list.get(j4)).func_72323_b(this.func_174813_aQ(), p_70091_4_);
- }
- this.func_174826_a(this.func_174813_aQ().func_72317_d(0.0D, p_70091_4_, 0.0D));
- if(d14 * d14 + d7 * d7 >= p_70091_2_ * p_70091_2_ + p_70091_6_ * p_70091_6_) {
- p_70091_2_ = d14;
- p_70091_4_ = d6;
- p_70091_6_ = d7;
- this.func_174826_a(axisalignedbb1);
- }
- }
- this.field_70170_p.field_72984_F.func_76319_b();
- this.field_70170_p.field_72984_F.func_76320_a("rest");
- this.func_174829_m();
- this.field_70123_F = d2 != p_70091_2_ || d4 != p_70091_6_;
- this.field_70124_G = p_70091_4_ != p_70091_4_;
- this.field_70122_E = this.field_70124_G && d3 < 0.0D;
- this.field_70132_H = this.field_70123_F || this.field_70124_G;
- int j6 = MathHelper.func_76128_c(this.field_70165_t);
- int i1 = MathHelper.func_76128_c(this.field_70163_u - 0.20000000298023224D);
- int k6 = MathHelper.func_76128_c(this.field_70161_v);
- BlockPos blockpos = new BlockPos(j6, i1, k6);
- IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos);
- if(iblockstate.func_185904_a() == Material.field_151579_a) {
- BlockPos blockpos1 = blockpos.func_177977_b();
- IBlockState iblockstate1 = this.field_70170_p.func_180495_p(blockpos1);
- Block block1 = iblockstate1.func_177230_c();
- if(block1 instanceof BlockFence || block1 instanceof BlockWall || block1 instanceof BlockFenceGate) {
- iblockstate = iblockstate1;
- blockpos = blockpos1;
- }
- }
- this.func_184231_a(p_70091_4_, this.field_70122_E, iblockstate, blockpos);
- if(d2 != p_70091_2_) {
- this.field_70159_w = 0.0D;
- }
- if(d4 != p_70091_6_) {
- this.field_70179_y = 0.0D;
- }
- Block block = iblockstate.func_177230_c();
- if(d3 != p_70091_4_) {
- block.func_176216_a(this.field_70170_p, this);
- }
- if(this.func_70041_e_() && (!this.field_70122_E || !this.func_70093_af() || !(this instanceof EntityPlayer)) && !this.func_184218_aH()) {
- double d15 = this.field_70165_t - d10;
- double d16 = this.field_70163_u - d11;
- double d17 = this.field_70161_v - d1;
- if(block != Blocks.field_150468_ap) {
- d16 = 0.0D;
- }
- if(block != null && this.field_70122_E) {
- block.func_176199_a(this.field_70170_p, blockpos, this);
- }
- this.field_70140_Q = (float)((double)this.field_70140_Q + (double)MathHelper.func_76133_a(d15 * d15 + d17 * d17) * 0.6D);
- this.field_82151_R = (float)((double)this.field_82151_R + (double)MathHelper.func_76133_a(d15 * d15 + d16 * d16 + d17 * d17) * 0.6D);
- if(this.field_82151_R > (float)this.field_70150_b && iblockstate.func_185904_a() != Material.field_151579_a) {
- this.field_70150_b = (int)this.field_82151_R + 1;
- if(this.func_70090_H()) {
- Entity entity = this.func_184207_aI() && this.func_184179_bs() != null?this.func_184179_bs():this;
- float f = entity == this?0.35F:0.4F;
- 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;
- if(f1 > 1.0F) {
- f1 = 1.0F;
- }
- this.func_184185_a(this.func_184184_Z(), f1, 1.0F + (this.field_70146_Z.nextFloat() - this.field_70146_Z.nextFloat()) * 0.4F);
- } else {
- this.func_180429_a(blockpos, block);
- }
- } else if(this.field_82151_R > this.field_191959_ay && this.func_191957_ae() && iblockstate.func_185904_a() == Material.field_151579_a) {
- this.field_191959_ay = this.func_191954_d(this.field_82151_R);
- }
- }
- try {
- this.func_145775_I();
- } catch (Throwable throwable) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable, "Checking entity block collision");
- CrashReportCategory crashreportcategory = crashreport.func_85058_a("Entity being checked for collision");
- this.func_85029_a(crashreportcategory);
- throw new ReportedException(crashreport);
- }
- boolean flag1 = this.func_70026_G();
- if(this.field_70170_p.func_147470_e(this.func_174813_aQ().func_186664_h(0.001D))) {
- this.func_70081_e(1);
- if(!flag1) {
- ++this.field_190534_ay;
- if(this.field_190534_ay == 0) {
- this.func_70015_d(8);
- }
- }
- } else if(this.field_190534_ay <= 0) {
- this.field_190534_ay = -this.func_190531_bD();
- }
- if(flag1 && this.func_70027_ad()) {
- this.func_184185_a(SoundEvents.field_187541_bC, 0.7F, 1.6F + (this.field_70146_Z.nextFloat() - this.field_70146_Z.nextFloat()) * 0.4F);
- this.field_190534_ay = -this.func_190531_bD();
- }
- this.field_70170_p.field_72984_F.func_76319_b();
- }
- }
- public void func_174829_m() {
- AxisAlignedBB axisalignedbb = this.func_174813_aQ();
- this.field_70165_t = (axisalignedbb.field_72340_a + axisalignedbb.field_72336_d) / 2.0D;
- this.field_70163_u = axisalignedbb.field_72338_b;
- this.field_70161_v = (axisalignedbb.field_72339_c + axisalignedbb.field_72334_f) / 2.0D;
- }
- protected SoundEvent func_184184_Z() {
- return SoundEvents.field_187549_bG;
- }
- protected SoundEvent func_184181_aa() {
- return SoundEvents.field_187547_bF;
- }
- protected void func_145775_I() {
- AxisAlignedBB axisalignedbb = this.func_174813_aQ();
- 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);
- 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);
- BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos2 = BlockPos.PooledMutableBlockPos.func_185346_s();
- if(this.field_70170_p.func_175707_a(blockpos$pooledmutableblockpos, blockpos$pooledmutableblockpos1)) {
- for(int i = blockpos$pooledmutableblockpos.func_177958_n(); i <= blockpos$pooledmutableblockpos1.func_177958_n(); ++i) {
- for(int j = blockpos$pooledmutableblockpos.func_177956_o(); j <= blockpos$pooledmutableblockpos1.func_177956_o(); ++j) {
- for(int k = blockpos$pooledmutableblockpos.func_177952_p(); k <= blockpos$pooledmutableblockpos1.func_177952_p(); ++k) {
- blockpos$pooledmutableblockpos2.func_181079_c(i, j, k);
- IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos$pooledmutableblockpos2);
- try {
- iblockstate.func_177230_c().func_180634_a(this.field_70170_p, blockpos$pooledmutableblockpos2, iblockstate, this);
- this.func_191955_a(iblockstate);
- } catch (Throwable throwable) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable, "Colliding entity with block");
- CrashReportCategory crashreportcategory = crashreport.func_85058_a("Block being collided with");
- CrashReportCategory.func_175750_a(crashreportcategory, blockpos$pooledmutableblockpos2, iblockstate);
- throw new ReportedException(crashreport);
- }
- }
- }
- }
- }
- blockpos$pooledmutableblockpos.func_185344_t();
- blockpos$pooledmutableblockpos1.func_185344_t();
- blockpos$pooledmutableblockpos2.func_185344_t();
- }
- protected void func_191955_a(IBlockState p_191955_1_) {
- }
- protected void func_180429_a(BlockPos p_180429_1_, Block p_180429_2_) {
- SoundType soundtype = p_180429_2_.func_185467_w();
- if(this.field_70170_p.func_180495_p(p_180429_1_.func_177984_a()).func_177230_c() == Blocks.field_150431_aC) {
- soundtype = Blocks.field_150431_aC.func_185467_w();
- this.func_184185_a(soundtype.func_185844_d(), soundtype.func_185843_a() * 0.15F, soundtype.func_185847_b());
- } else if(!p_180429_2_.func_176223_P().func_185904_a().func_76224_d()) {
- this.func_184185_a(soundtype.func_185844_d(), soundtype.func_185843_a() * 0.15F, soundtype.func_185847_b());
- }
- }
- protected float func_191954_d(float p_191954_1_) {
- return 0.0F;
- }
- protected boolean func_191957_ae() {
- return false;
- }
- public void func_184185_a(SoundEvent p_184185_1_, float p_184185_2_, float p_184185_3_) {
- if(!this.func_174814_R()) {
- 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_);
- }
- }
- public boolean func_174814_R() {
- return ((Boolean)this.field_70180_af.func_187225_a(field_184234_aB)).booleanValue();
- }
- public void func_174810_b(boolean p_174810_1_) {
- this.field_70180_af.func_187227_b(field_184234_aB, Boolean.valueOf(p_174810_1_));
- }
- public boolean func_189652_ae() {
- return ((Boolean)this.field_70180_af.func_187225_a(field_189655_aD)).booleanValue();
- }
- public void func_189654_d(boolean p_189654_1_) {
- this.field_70180_af.func_187227_b(field_189655_aD, Boolean.valueOf(p_189654_1_));
- }
- protected boolean func_70041_e_() {
- return true;
- }
- protected void func_184231_a(double p_184231_1_, boolean p_184231_3_, IBlockState p_184231_4_, BlockPos p_184231_5_) {
- if(p_184231_3_) {
- if(this.field_70143_R > 0.0F) {
- p_184231_4_.func_177230_c().func_180658_a(this.field_70170_p, p_184231_5_, this, this.field_70143_R);
- }
- this.field_70143_R = 0.0F;
- } else if(p_184231_1_ < 0.0D) {
- this.field_70143_R = (float)((double)this.field_70143_R - p_184231_1_);
- }
- }
- @Nullable
- public AxisAlignedBB func_70046_E() {
- return null;
- }
- protected void func_70081_e(int p_70081_1_) {
- if(!this.field_70178_ae) {
- this.func_70097_a(DamageSource.field_76372_a, (float)p_70081_1_);
- }
- }
- public final boolean func_70045_F() {
- return this.field_70178_ae;
- }
- public void func_180430_e(float p_180430_1_, float p_180430_2_) {
- if(this.func_184207_aI()) {
- for(Entity entity : this.func_184188_bt()) {
- entity.func_180430_e(p_180430_1_, p_180430_2_);
- }
- }
- }
- public boolean func_70026_G() {
- if(this.field_70171_ac) {
- return true;
- } else {
- BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185345_c(this.field_70165_t, this.field_70163_u, this.field_70161_v);
- 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))) {
- blockpos$pooledmutableblockpos.func_185344_t();
- return false;
- } else {
- blockpos$pooledmutableblockpos.func_185344_t();
- return true;
- }
- }
- }
- public boolean func_70090_H() {
- return this.field_70171_ac;
- }
- public boolean func_191953_am() {
- 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);
- }
- public boolean func_70072_I() {
- if(this.func_184187_bx() instanceof EntityBoat) {
- this.field_70171_ac = false;
- } 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)) {
- if(!this.field_70171_ac && !this.field_70148_d) {
- this.func_71061_d_();
- }
- this.field_70143_R = 0.0F;
- this.field_70171_ac = true;
- this.func_70066_B();
- } else {
- this.field_70171_ac = false;
- }
- return this.field_70171_ac;
- }
- protected void func_71061_d_() {
- Entity entity = this.func_184207_aI() && this.func_184179_bs() != null?this.func_184179_bs():this;
- float f = entity == this?0.2F:0.9F;
- 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;
- if(f1 > 1.0F) {
- f1 = 1.0F;
- }
- this.func_184185_a(this.func_184181_aa(), f1, 1.0F + (this.field_70146_Z.nextFloat() - this.field_70146_Z.nextFloat()) * 0.4F);
- float f2 = (float)MathHelper.func_76128_c(this.func_174813_aQ().field_72338_b);
- for(int i = 0; (float)i < 1.0F + this.field_70130_N * 20.0F; ++i) {
- float f3 = (this.field_70146_Z.nextFloat() * 2.0F - 1.0F) * this.field_70130_N;
- float f4 = (this.field_70146_Z.nextFloat() * 2.0F - 1.0F) * this.field_70130_N;
- 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]);
- }
- for(int j = 0; (float)j < 1.0F + this.field_70130_N * 20.0F; ++j) {
- float f5 = (this.field_70146_Z.nextFloat() * 2.0F - 1.0F) * this.field_70130_N;
- float f6 = (this.field_70146_Z.nextFloat() * 2.0F - 1.0F) * this.field_70130_N;
- 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]);
- }
- }
- public void func_174830_Y() {
- if(this.func_70051_ag() && !this.func_70090_H()) {
- this.func_174808_Z();
- }
- }
- protected void func_174808_Z() {
- int i = MathHelper.func_76128_c(this.field_70165_t);
- int j = MathHelper.func_76128_c(this.field_70163_u - 0.20000000298023224D);
- int k = MathHelper.func_76128_c(this.field_70161_v);
- BlockPos blockpos = new BlockPos(i, j, k);
- IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos);
- if(iblockstate.func_185901_i() != EnumBlockRenderType.INVISIBLE) {
- 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)});
- }
- }
- public boolean func_70055_a(Material p_70055_1_) {
- if(this.func_184187_bx() instanceof EntityBoat) {
- return false;
- } else {
- double d0 = this.field_70163_u + (double)this.func_70047_e();
- BlockPos blockpos = new BlockPos(this.field_70165_t, d0, this.field_70161_v);
- IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos);
- if(iblockstate.func_185904_a() == p_70055_1_) {
- float f = BlockLiquid.func_149801_b(iblockstate.func_177230_c().func_176201_c(iblockstate)) - 0.11111111F;
- float f1 = (float)(blockpos.func_177956_o() + 1) - f;
- boolean flag = d0 < (double)f1;
- return !flag && this instanceof EntityPlayer?false:flag;
- } else {
- return false;
- }
- }
- }
- public boolean func_180799_ab() {
- 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);
- }
- public void func_191958_b(float p_191958_1_, float p_191958_2_, float p_191958_3_, float p_191958_4_) {
- float f = p_191958_1_ * p_191958_1_ + p_191958_2_ * p_191958_2_ + p_191958_3_ * p_191958_3_;
- if(f >= 1.0E-4F) {
- f = MathHelper.func_76129_c(f);
- if(f < 1.0F) {
- f = 1.0F;
- }
- f = p_191958_4_ / f;
- p_191958_1_ = p_191958_1_ * f;
- p_191958_2_ = p_191958_2_ * f;
- p_191958_3_ = p_191958_3_ * f;
- float f1 = MathHelper.func_76126_a(this.field_70177_z * 0.017453292F);
- float f2 = MathHelper.func_76134_b(this.field_70177_z * 0.017453292F);
- this.field_70159_w += (double)(p_191958_1_ * f2 - p_191958_3_ * f1);
- this.field_70181_x += (double)p_191958_2_;
- this.field_70179_y += (double)(p_191958_3_ * f2 + p_191958_1_ * f1);
- }
- }
- @SideOnly(Side.CLIENT)
- public int func_70070_b() {
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(MathHelper.func_76128_c(this.field_70165_t), 0, MathHelper.func_76128_c(this.field_70161_v));
- if(this.field_70170_p.func_175667_e(blockpos$mutableblockpos)) {
- blockpos$mutableblockpos.func_185336_p(MathHelper.func_76128_c(this.field_70163_u + (double)this.func_70047_e()));
- return this.field_70170_p.func_175626_b(blockpos$mutableblockpos, 0);
- } else {
- return 0;
- }
- }
- public float func_70013_c() {
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(MathHelper.func_76128_c(this.field_70165_t), 0, MathHelper.func_76128_c(this.field_70161_v));
- if(this.field_70170_p.func_175667_e(blockpos$mutableblockpos)) {
- blockpos$mutableblockpos.func_185336_p(MathHelper.func_76128_c(this.field_70163_u + (double)this.func_70047_e()));
- return this.field_70170_p.func_175724_o(blockpos$mutableblockpos);
- } else {
- return 0.0F;
- }
- }
- public void func_70029_a(World p_70029_1_) {
- this.field_70170_p = p_70029_1_;
- }
- 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_) {
- this.field_70165_t = MathHelper.func_151237_a(p_70080_1_, -3.0E7D, 3.0E7D);
- this.field_70163_u = p_70080_3_;
- this.field_70161_v = MathHelper.func_151237_a(p_70080_5_, -3.0E7D, 3.0E7D);
- this.field_70169_q = this.field_70165_t;
- this.field_70167_r = this.field_70163_u;
- this.field_70166_s = this.field_70161_v;
- p_70080_8_ = MathHelper.func_76131_a(p_70080_8_, -90.0F, 90.0F);
- this.field_70177_z = p_70080_7_;
- this.field_70125_A = p_70080_8_;
- this.field_70126_B = this.field_70177_z;
- this.field_70127_C = this.field_70125_A;
- double d0 = (double)(this.field_70126_B - p_70080_7_);
- if(d0 < -180.0D) {
- this.field_70126_B += 360.0F;
- }
- if(d0 >= 180.0D) {
- this.field_70126_B -= 360.0F;
- }
- this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v);
- this.func_70101_b(p_70080_7_, p_70080_8_);
- }
- public void func_174828_a(BlockPos p_174828_1_, float p_174828_2_, float p_174828_3_) {
- 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_);
- }
- 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_) {
- this.field_70165_t = p_70012_1_;
- this.field_70163_u = p_70012_3_;
- this.field_70161_v = p_70012_5_;
- this.field_70169_q = this.field_70165_t;
- this.field_70167_r = this.field_70163_u;
- this.field_70166_s = this.field_70161_v;
- this.field_70142_S = this.field_70165_t;
- this.field_70137_T = this.field_70163_u;
- this.field_70136_U = this.field_70161_v;
- this.field_70177_z = p_70012_7_;
- this.field_70125_A = p_70012_8_;
- this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v);
- }
- public float func_70032_d(Entity p_70032_1_) {
- float f = (float)(this.field_70165_t - p_70032_1_.field_70165_t);
- float f1 = (float)(this.field_70163_u - p_70032_1_.field_70163_u);
- float f2 = (float)(this.field_70161_v - p_70032_1_.field_70161_v);
- return MathHelper.func_76129_c(f * f + f1 * f1 + f2 * f2);
- }
- public double func_70092_e(double p_70092_1_, double p_70092_3_, double p_70092_5_) {
- double d0 = this.field_70165_t - p_70092_1_;
- double d1 = this.field_70163_u - p_70092_3_;
- double d2 = this.field_70161_v - p_70092_5_;
- return d0 * d0 + d1 * d1 + d2 * d2;
- }
- public double func_174818_b(BlockPos p_174818_1_) {
- return p_174818_1_.func_177954_c(this.field_70165_t, this.field_70163_u, this.field_70161_v);
- }
- public double func_174831_c(BlockPos p_174831_1_) {
- return p_174831_1_.func_177957_d(this.field_70165_t, this.field_70163_u, this.field_70161_v);
- }
- public double func_70011_f(double p_70011_1_, double p_70011_3_, double p_70011_5_) {
- double d0 = this.field_70165_t - p_70011_1_;
- double d1 = this.field_70163_u - p_70011_3_;
- double d2 = this.field_70161_v - p_70011_5_;
- return (double)MathHelper.func_76133_a(d0 * d0 + d1 * d1 + d2 * d2);
- }
- public double func_70068_e(Entity p_70068_1_) {
- double d0 = this.field_70165_t - p_70068_1_.field_70165_t;
- double d1 = this.field_70163_u - p_70068_1_.field_70163_u;
- double d2 = this.field_70161_v - p_70068_1_.field_70161_v;
- return d0 * d0 + d1 * d1 + d2 * d2;
- }
- public void func_70100_b_(EntityPlayer p_70100_1_) {
- }
- public void func_70108_f(Entity p_70108_1_) {
- if(!this.func_184223_x(p_70108_1_)) {
- if(!p_70108_1_.field_70145_X && !this.field_70145_X) {
- double d0 = p_70108_1_.field_70165_t - this.field_70165_t;
- double d1 = p_70108_1_.field_70161_v - this.field_70161_v;
- double d2 = MathHelper.func_76132_a(d0, d1);
- if(d2 >= 0.009999999776482582D) {
- d2 = (double)MathHelper.func_76133_a(d2);
- d0 = d0 / d2;
- d1 = d1 / d2;
- double d3 = 1.0D / d2;
- if(d3 > 1.0D) {
- d3 = 1.0D;
- }
- d0 = d0 * d3;
- d1 = d1 * d3;
- d0 = d0 * 0.05000000074505806D;
- d1 = d1 * 0.05000000074505806D;
- d0 = d0 * (double)(1.0F - this.field_70144_Y);
- d1 = d1 * (double)(1.0F - this.field_70144_Y);
- if(!this.func_184207_aI()) {
- this.func_70024_g(-d0, 0.0D, -d1);
- }
- if(!p_70108_1_.func_184207_aI()) {
- p_70108_1_.func_70024_g(d0, 0.0D, d1);
- }
- }
- }
- }
- }
- public void func_70024_g(double p_70024_1_, double p_70024_3_, double p_70024_5_) {
- this.field_70159_w += p_70024_1_;
- this.field_70181_x += p_70024_3_;
- this.field_70179_y += p_70024_5_;
- this.field_70160_al = true;
- }
- protected void func_70018_K() {
- this.field_70133_I = true;
- }
- public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) {
- if(this.func_180431_b(p_70097_1_)) {
- return false;
- } else {
- this.func_70018_K();
- return false;
- }
- }
- public Vec3d func_70676_i(float p_70676_1_) {
- if(p_70676_1_ == 1.0F) {
- return this.func_174806_f(this.field_70125_A, this.field_70177_z);
- } else {
- float f = this.field_70127_C + (this.field_70125_A - this.field_70127_C) * p_70676_1_;
- float f1 = this.field_70126_B + (this.field_70177_z - this.field_70126_B) * p_70676_1_;
- return this.func_174806_f(f, f1);
- }
- }
- protected final Vec3d func_174806_f(float p_174806_1_, float p_174806_2_) {
- float f = MathHelper.func_76134_b(-p_174806_2_ * 0.017453292F - 3.1415927F);
- float f1 = MathHelper.func_76126_a(-p_174806_2_ * 0.017453292F - 3.1415927F);
- float f2 = -MathHelper.func_76134_b(-p_174806_1_ * 0.017453292F);
- float f3 = MathHelper.func_76126_a(-p_174806_1_ * 0.017453292F);
- return new Vec3d((double)(f1 * f2), (double)f3, (double)(f * f2));
- }
- public Vec3d func_174824_e(float p_174824_1_) {
- if(p_174824_1_ == 1.0F) {
- return new Vec3d(this.field_70165_t, this.field_70163_u + (double)this.func_70047_e(), this.field_70161_v);
- } else {
- double d0 = this.field_70169_q + (this.field_70165_t - this.field_70169_q) * (double)p_174824_1_;
- double d1 = this.field_70167_r + (this.field_70163_u - this.field_70167_r) * (double)p_174824_1_ + (double)this.func_70047_e();
- double d2 = this.field_70166_s + (this.field_70161_v - this.field_70166_s) * (double)p_174824_1_;
- return new Vec3d(d0, d1, d2);
- }
- }
- @Nullable
- @SideOnly(Side.CLIENT)
- public RayTraceResult func_174822_a(double p_174822_1_, float p_174822_3_) {
- Vec3d vec3d = this.func_174824_e(p_174822_3_);
- Vec3d vec3d1 = this.func_70676_i(p_174822_3_);
- 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_);
- return this.field_70170_p.func_147447_a(vec3d, vec3d2, false, false, true);
- }
- public boolean func_70067_L() {
- return false;
- }
- public boolean func_70104_M() {
- return false;
- }
- public void func_191956_a(Entity p_191956_1_, int p_191956_2_, DamageSource p_191956_3_) {
- if(p_191956_1_ instanceof EntityPlayerMP) {
- CriteriaTriggers.field_192123_c.func_192211_a((EntityPlayerMP)p_191956_1_, this, p_191956_3_);
- }
- }
- @SideOnly(Side.CLIENT)
- public boolean func_145770_h(double p_145770_1_, double p_145770_3_, double p_145770_5_) {
- double d0 = this.field_70165_t - p_145770_1_;
- double d1 = this.field_70163_u - p_145770_3_;
- double d2 = this.field_70161_v - p_145770_5_;
- double d3 = d0 * d0 + d1 * d1 + d2 * d2;
- return this.func_70112_a(d3);
- }
- @SideOnly(Side.CLIENT)
- public boolean func_70112_a(double p_70112_1_) {
- double d0 = this.func_174813_aQ().func_72320_b();
- if(Double.isNaN(d0)) {
- d0 = 1.0D;
- }
- d0 = d0 * 64.0D * field_70155_l;
- return p_70112_1_ < d0 * d0;
- }
- public boolean func_184198_c(NBTTagCompound p_184198_1_) {
- String s = this.func_70022_Q();
- if(!this.field_70128_L && s != null) {
- p_184198_1_.func_74778_a("id", s);
- this.func_189511_e(p_184198_1_);
- return true;
- } else {
- return false;
- }
- }
- public boolean func_70039_c(NBTTagCompound p_70039_1_) {
- String s = this.func_70022_Q();
- if(!this.field_70128_L && s != null && !this.func_184218_aH()) {
- p_70039_1_.func_74778_a("id", s);
- this.func_189511_e(p_70039_1_);
- return true;
- } else {
- return false;
- }
- }
- public static void func_190533_a(DataFixer p_190533_0_) {
- p_190533_0_.func_188258_a(FixTypes.ENTITY, new IDataWalker() {
- public NBTTagCompound func_188266_a(IDataFixer p_188266_1_, NBTTagCompound p_188266_2_, int p_188266_3_) {
- if(p_188266_2_.func_150297_b("Passengers", 9)) {
- NBTTagList nbttaglist = p_188266_2_.func_150295_c("Passengers", 10);
- for(int i = 0; i < nbttaglist.func_74745_c(); ++i) {
- nbttaglist.func_150304_a(i, p_188266_1_.func_188251_a(FixTypes.ENTITY, nbttaglist.func_150305_b(i), p_188266_3_));
- }
- }
- return p_188266_2_;
- }
- });
- }
- public NBTTagCompound func_189511_e(NBTTagCompound p_189511_1_) {
- try {
- 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}));
- 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}));
- p_189511_1_.func_74782_a("Rotation", this.func_70049_a(new float[]{this.field_70177_z, this.field_70125_A}));
- p_189511_1_.func_74776_a("FallDistance", this.field_70143_R);
- p_189511_1_.func_74777_a("Fire", (short)this.field_190534_ay);
- p_189511_1_.func_74777_a("Air", (short)this.func_70086_ai());
- p_189511_1_.func_74757_a("OnGround", this.field_70122_E);
- p_189511_1_.func_74768_a("Dimension", this.field_71093_bK);
- p_189511_1_.func_74757_a("Invulnerable", this.field_83001_bt);
- p_189511_1_.func_74768_a("PortalCooldown", this.field_71088_bW);
- p_189511_1_.func_186854_a("UUID", this.func_110124_au());
- if(this.func_145818_k_()) {
- p_189511_1_.func_74778_a("CustomName", this.func_95999_t());
- }
- if(this.func_174833_aM()) {
- p_189511_1_.func_74757_a("CustomNameVisible", this.func_174833_aM());
- }
- this.field_174837_as.func_179670_b(p_189511_1_);
- if(this.func_174814_R()) {
- p_189511_1_.func_74757_a("Silent", this.func_174814_R());
- }
- if(this.func_189652_ae()) {
- p_189511_1_.func_74757_a("NoGravity", this.func_189652_ae());
- }
- if(this.field_184238_ar) {
- p_189511_1_.func_74757_a("Glowing", this.field_184238_ar);
- }
- if(!this.field_184236_aF.isEmpty()) {
- NBTTagList nbttaglist = new NBTTagList();
- for(String s : this.field_184236_aF) {
- nbttaglist.func_74742_a(new NBTTagString(s));
- }
- p_189511_1_.func_74782_a("Tags", nbttaglist);
- }
- this.func_70014_b(p_189511_1_);
- if(this.func_184207_aI()) {
- NBTTagList nbttaglist1 = new NBTTagList();
- for(Entity entity : this.func_184188_bt()) {
- NBTTagCompound nbttagcompound = new NBTTagCompound();
- if(entity.func_184198_c(nbttagcompound)) {
- nbttaglist1.func_74742_a(nbttagcompound);
- }
- }
- if(!nbttaglist1.func_82582_d()) {
- p_189511_1_.func_74782_a("Passengers", nbttaglist1);
- }
- }
- return p_189511_1_;
- } catch (Throwable throwable) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable, "Saving entity NBT");
- CrashReportCategory crashreportcategory = crashreport.func_85058_a("Entity being saved");
- this.func_85029_a(crashreportcategory);
- throw new ReportedException(crashreport);
- }
- }
- public void func_70020_e(NBTTagCompound p_70020_1_) {
- try {
- NBTTagList nbttaglist = p_70020_1_.func_150295_c("Pos", 6);
- NBTTagList nbttaglist2 = p_70020_1_.func_150295_c("Motion", 6);
- NBTTagList nbttaglist3 = p_70020_1_.func_150295_c("Rotation", 5);
- this.field_70159_w = nbttaglist2.func_150309_d(0);
- this.field_70181_x = nbttaglist2.func_150309_d(1);
- this.field_70179_y = nbttaglist2.func_150309_d(2);
- if(Math.abs(this.field_70159_w) > 10.0D) {
- this.field_70159_w = 0.0D;
- }
- if(Math.abs(this.field_70181_x) > 10.0D) {
- this.field_70181_x = 0.0D;
- }
- if(Math.abs(this.field_70179_y) > 10.0D) {
- this.field_70179_y = 0.0D;
- }
- this.field_70165_t = nbttaglist.func_150309_d(0);
- this.field_70163_u = nbttaglist.func_150309_d(1);
- this.field_70161_v = nbttaglist.func_150309_d(2);
- this.field_70142_S = this.field_70165_t;
- this.field_70137_T = this.field_70163_u;
- this.field_70136_U = this.field_70161_v;
- this.field_70169_q = this.field_70165_t;
- this.field_70167_r = this.field_70163_u;
- this.field_70166_s = this.field_70161_v;
- this.field_70177_z = nbttaglist3.func_150308_e(0);
- this.field_70125_A = nbttaglist3.func_150308_e(1);
- this.field_70126_B = this.field_70177_z;
- this.field_70127_C = this.field_70125_A;
- this.func_70034_d(this.field_70177_z);
- this.func_181013_g(this.field_70177_z);
- this.field_70143_R = p_70020_1_.func_74760_g("FallDistance");
- this.field_190534_ay = p_70020_1_.func_74765_d("Fire");
- this.func_70050_g(p_70020_1_.func_74765_d("Air"));
- this.field_70122_E = p_70020_1_.func_74767_n("OnGround");
- if(p_70020_1_.func_74764_b("Dimension")) {
- this.field_71093_bK = p_70020_1_.func_74762_e("Dimension");
- }
- this.field_83001_bt = p_70020_1_.func_74767_n("Invulnerable");
- this.field_71088_bW = p_70020_1_.func_74762_e("PortalCooldown");
- if(p_70020_1_.func_186855_b("UUID")) {
- this.field_96093_i = p_70020_1_.func_186857_a("UUID");
- this.field_189513_ar = this.field_96093_i.toString();
- }
- this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v);
- this.func_70101_b(this.field_70177_z, this.field_70125_A);
- if(p_70020_1_.func_150297_b("CustomName", 8)) {
- this.func_96094_a(p_70020_1_.func_74779_i("CustomName"));
- }
- this.func_174805_g(p_70020_1_.func_74767_n("CustomNameVisible"));
- this.field_174837_as.func_179668_a(p_70020_1_);
- this.func_174810_b(p_70020_1_.func_74767_n("Silent"));
- this.func_189654_d(p_70020_1_.func_74767_n("NoGravity"));
- this.func_184195_f(p_70020_1_.func_74767_n("Glowing"));
- if(p_70020_1_.func_150297_b("Tags", 9)) {
- this.field_184236_aF.clear();
- NBTTagList nbttaglist1 = p_70020_1_.func_150295_c("Tags", 8);
- int i = Math.min(nbttaglist1.func_74745_c(), 1024);
- for(int j = 0; j < i; ++j) {
- this.field_184236_aF.add(nbttaglist1.func_150307_f(j));
- }
- }
- this.func_70037_a(p_70020_1_);
- if(this.func_142008_O()) {
- this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v);
- }
- } catch (Throwable throwable) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable, "Loading entity NBT");
- CrashReportCategory crashreportcategory = crashreport.func_85058_a("Entity being loaded");
- this.func_85029_a(crashreportcategory);
- throw new ReportedException(crashreport);
- }
- }
- protected boolean func_142008_O() {
- return true;
- }
- @Nullable
- protected final String func_70022_Q() {
- ResourceLocation resourcelocation = EntityList.func_191301_a(this);
- return resourcelocation == null?null:resourcelocation.toString();
- }
- protected abstract void func_70037_a(NBTTagCompound p_70037_1_);
- protected abstract void func_70014_b(NBTTagCompound p_70014_1_);
- protected NBTTagList func_70087_a(double... p_70087_1_) {
- NBTTagList nbttaglist = new NBTTagList();
- for(double d0 : p_70087_1_) {
- nbttaglist.func_74742_a(new NBTTagDouble(d0));
- }
- return nbttaglist;
- }
- protected NBTTagList func_70049_a(float... p_70049_1_) {
- NBTTagList nbttaglist = new NBTTagList();
- for(float f : p_70049_1_) {
- nbttaglist.func_74742_a(new NBTTagFloat(f));
- }
- return nbttaglist;
- }
- @Nullable
- public EntityItem func_145779_a(Item p_145779_1_, int p_145779_2_) {
- return this.func_145778_a(p_145779_1_, p_145779_2_, 0.0F);
- }
- @Nullable
- public EntityItem func_145778_a(Item p_145778_1_, int p_145778_2_, float p_145778_3_) {
- return this.func_70099_a(new ItemStack(p_145778_1_, p_145778_2_, 0), p_145778_3_);
- }
- @Nullable
- public EntityItem func_70099_a(ItemStack p_70099_1_, float p_70099_2_) {
- if(p_70099_1_.func_190926_b()) {
- return null;
- } else {
- 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_);
- entityitem.func_174869_p();
- this.field_70170_p.func_72838_d(entityitem);
- return entityitem;
- }
- }
- public boolean func_70089_S() {
- return !this.field_70128_L;
- }
- public boolean func_70094_T() {
- if(this.field_70145_X) {
- return false;
- } else {
- BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
- for(int i = 0; i < 8; ++i) {
- int j = MathHelper.func_76128_c(this.field_70163_u + (double)(((float)((i >> 0) % 2) - 0.5F) * 0.1F) + (double)this.func_70047_e());
- int k = MathHelper.func_76128_c(this.field_70165_t + (double)(((float)((i >> 1) % 2) - 0.5F) * this.field_70130_N * 0.8F));
- int l = MathHelper.func_76128_c(this.field_70161_v + (double)(((float)((i >> 2) % 2) - 0.5F) * this.field_70130_N * 0.8F));
- if(blockpos$pooledmutableblockpos.func_177958_n() != k || blockpos$pooledmutableblockpos.func_177956_o() != j || blockpos$pooledmutableblockpos.func_177952_p() != l) {
- blockpos$pooledmutableblockpos.func_181079_c(k, j, l);
- if(this.field_70170_p.func_180495_p(blockpos$pooledmutableblockpos).func_191058_s()) {
- blockpos$pooledmutableblockpos.func_185344_t();
- return true;
- }
- }
- }
- blockpos$pooledmutableblockpos.func_185344_t();
- return false;
- }
- }
- public boolean func_184230_a(EntityPlayer p_184230_1_, EnumHand p_184230_2_) {
- return false;
- }
- @Nullable
- public AxisAlignedBB func_70114_g(Entity p_70114_1_) {
- return null;
- }
- public void func_70098_U() {
- Entity entity = this.func_184187_bx();
- if(this.func_184218_aH() && entity.field_70128_L) {
- this.func_184210_p();
- } else {
- this.field_70159_w = 0.0D;
- this.field_70181_x = 0.0D;
- this.field_70179_y = 0.0D;
- this.func_70071_h_();
- if(this.func_184218_aH()) {
- entity.func_184232_k(this);
- }
- }
- }
- public void func_184232_k(Entity p_184232_1_) {
- if(this.func_184196_w(p_184232_1_)) {
- 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);
- }
- }
- @SideOnly(Side.CLIENT)
- public void func_184190_l(Entity p_184190_1_) {
- }
- public double func_70033_W() {
- return 0.0D;
- }
- public double func_70042_X() {
- return (double)this.field_70131_O * 0.75D;
- }
- public boolean func_184220_m(Entity p_184220_1_) {
- return this.func_184205_a(p_184220_1_, false);
- }
- public boolean func_184205_a(Entity p_184205_1_, boolean p_184205_2_) {
- for(Entity entity = p_184205_1_; entity.field_184239_as != null; entity = entity.field_184239_as) {
- if(entity.field_184239_as == this) {
- return false;
- }
- }
- if(p_184205_2_ || this.func_184228_n(p_184205_1_) && p_184205_1_.func_184219_q(this)) {
- if(this.func_184218_aH()) {
- this.func_184210_p();
- }
- this.field_184239_as = p_184205_1_;
- this.field_184239_as.func_184200_o(this);
- return true;
- } else {
- return false;
- }
- }
- protected boolean func_184228_n(Entity p_184228_1_) {
- return this.field_184245_j <= 0;
- }
- public void func_184226_ay() {
- for(int i = this.field_184244_h.size() - 1; i >= 0; --i) {
- ((Entity)this.field_184244_h.get(i)).func_184210_p();
- }
- }
- public void func_184210_p() {
- if(this.field_184239_as != null) {
- Entity entity = this.field_184239_as;
- this.field_184239_as = null;
- entity.func_184225_p(this);
- }
- }
- protected void func_184200_o(Entity p_184200_1_) {
- if(p_184200_1_.func_184187_bx() != this) {
- throw new IllegalStateException("Use x.startRiding(y), not y.addPassenger(x)");
- } else {
- if(!this.field_70170_p.field_72995_K && p_184200_1_ instanceof EntityPlayer && !(this.func_184179_bs() instanceof EntityPlayer)) {
- this.field_184244_h.add(0, p_184200_1_);
- } else {
- this.field_184244_h.add(p_184200_1_);
- }
- }
- }
- protected void func_184225_p(Entity p_184225_1_) {
- if(p_184225_1_.func_184187_bx() == this) {
- throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)");
- } else {
- this.field_184244_h.remove(p_184225_1_);
- p_184225_1_.field_184245_j = 60;
- }
- }
- protected boolean func_184219_q(Entity p_184219_1_) {
- return this.func_184188_bt().size() < 1;
- }
- @SideOnly(Side.CLIENT)
- 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_) {
- this.func_70107_b(p_180426_1_, p_180426_3_, p_180426_5_);
- this.func_70101_b(p_180426_7_, p_180426_8_);
- }
- public float func_70111_Y() {
- return 0.0F;
- }
- public Vec3d func_70040_Z() {
- return this.func_174806_f(this.field_70125_A, this.field_70177_z);
- }
- @SideOnly(Side.CLIENT)
- public Vec2f func_189653_aC() {
- return new Vec2f(this.field_70125_A, this.field_70177_z);
- }
- @SideOnly(Side.CLIENT)
- public Vec3d func_189651_aD() {
- return Vec3d.func_189984_a(this.func_189653_aC());
- }
- public void func_181015_d(BlockPos p_181015_1_) {
- if(this.field_71088_bW > 0) {
- this.field_71088_bW = this.func_82147_ab();
- } else {
- if(!this.field_70170_p.field_72995_K && !p_181015_1_.equals(this.field_181016_an)) {
- this.field_181016_an = new BlockPos(p_181015_1_);
- BlockPattern.PatternHelper blockpattern$patternhelper = Blocks.field_150427_aO.func_181089_f(this.field_70170_p, this.field_181016_an);
- 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();
- double d1 = blockpattern$patternhelper.func_177669_b().func_176740_k() == EnumFacing.Axis.X?this.field_70161_v:this.field_70165_t;
- 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()));
- 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()));
- this.field_181017_ao = new Vec3d(d1, d2, 0.0D);
- this.field_181018_ap = blockpattern$patternhelper.func_177669_b();
- }
- this.field_71087_bX = true;
- }
- }
- public int func_82147_ab() {
- return 300;
- }
- @SideOnly(Side.CLIENT)
- public void func_70016_h(double p_70016_1_, double p_70016_3_, double p_70016_5_) {
- this.field_70159_w = p_70016_1_;
- this.field_70181_x = p_70016_3_;
- this.field_70179_y = p_70016_5_;
- }
- @SideOnly(Side.CLIENT)
- public void func_70103_a(byte p_70103_1_) {
- }
- @SideOnly(Side.CLIENT)
- public void func_70057_ab() {
- }
- public Iterable<ItemStack> func_184214_aD() {
- return field_190535_b;
- }
- public Iterable<ItemStack> func_184193_aE() {
- return field_190535_b;
- }
- public Iterable<ItemStack> func_184209_aF() {
- return Iterables.<ItemStack>concat(this.func_184214_aD(), this.func_184193_aE());
- }
- public void func_184201_a(EntityEquipmentSlot p_184201_1_, ItemStack p_184201_2_) {
- }
- public boolean func_70027_ad() {
- boolean flag = this.field_70170_p != null && this.field_70170_p.field_72995_K;
- return !this.field_70178_ae && (this.field_190534_ay > 0 || flag && this.func_70083_f(0));
- }
- public boolean func_184218_aH() {
- return this.func_184187_bx() != null;
- }
- public boolean func_184207_aI() {
- return !this.func_184188_bt().isEmpty();
- }
- public boolean func_70093_af() {
- return this.func_70083_f(1);
- }
- public void func_70095_a(boolean p_70095_1_) {
- this.func_70052_a(1, p_70095_1_);
- }
- public boolean func_70051_ag() {
- return this.func_70083_f(3);
- }
- public void func_70031_b(boolean p_70031_1_) {
- this.func_70052_a(3, p_70031_1_);
- }
- public boolean func_184202_aL() {
- return this.field_184238_ar || this.field_70170_p.field_72995_K && this.func_70083_f(6);
- }
- public void func_184195_f(boolean p_184195_1_) {
- this.field_184238_ar = p_184195_1_;
- if(!this.field_70170_p.field_72995_K) {
- this.func_70052_a(6, this.field_184238_ar);
- }
- }
- public boolean func_82150_aj() {
- return this.func_70083_f(5);
- }
- @SideOnly(Side.CLIENT)
- public boolean func_98034_c(EntityPlayer p_98034_1_) {
- if(p_98034_1_.func_175149_v()) {
- return false;
- } else {
- Team team = this.func_96124_cp();
- return team != null && p_98034_1_ != null && p_98034_1_.func_96124_cp() == team && team.func_98297_h()?false:this.func_82150_aj();
- }
- }
- @Nullable
- public Team func_96124_cp() {
- return this.field_70170_p.func_96441_U().func_96509_i(this.func_189512_bd());
- }
- public boolean func_184191_r(Entity p_184191_1_) {
- return this.func_184194_a(p_184191_1_.func_96124_cp());
- }
- public boolean func_184194_a(Team p_184194_1_) {
- return this.func_96124_cp() != null?this.func_96124_cp().func_142054_a(p_184194_1_):false;
- }
- public void func_82142_c(boolean p_82142_1_) {
- this.func_70052_a(5, p_82142_1_);
- }
- protected boolean func_70083_f(int p_70083_1_) {
- return (((Byte)this.field_70180_af.func_187225_a(field_184240_ax)).byteValue() & 1 << p_70083_1_) != 0;
- }
- protected void func_70052_a(int p_70052_1_, boolean p_70052_2_) {
- byte b0 = ((Byte)this.field_70180_af.func_187225_a(field_184240_ax)).byteValue();
- if(p_70052_2_) {
- this.field_70180_af.func_187227_b(field_184240_ax, Byte.valueOf((byte)(b0 | 1 << p_70052_1_)));
- } else {
- this.field_70180_af.func_187227_b(field_184240_ax, Byte.valueOf((byte)(b0 & ~(1 << p_70052_1_))));
- }
- }
- public int func_70086_ai() {
- return ((Integer)this.field_70180_af.func_187225_a(field_184241_ay)).intValue();
- }
- public void func_70050_g(int p_70050_1_) {
- this.field_70180_af.func_187227_b(field_184241_ay, Integer.valueOf(p_70050_1_));
- }
- public void func_70077_a(EntityLightningBolt p_70077_1_) {
- this.func_70097_a(DamageSource.field_180137_b, 5.0F);
- ++this.field_190534_ay;
- if(this.field_190534_ay == 0) {
- this.func_70015_d(8);
- }
- }
- public void func_70074_a(EntityLivingBase p_70074_1_) {
- }
- protected boolean func_145771_j(double p_145771_1_, double p_145771_3_, double p_145771_5_) {
- BlockPos blockpos = new BlockPos(p_145771_1_, p_145771_3_, p_145771_5_);
- double d0 = p_145771_1_ - (double)blockpos.func_177958_n();
- double d1 = p_145771_3_ - (double)blockpos.func_177956_o();
- double d2 = p_145771_5_ - (double)blockpos.func_177952_p();
- if(!this.field_70170_p.func_184143_b(this.func_174813_aQ())) {
- return false;
- } else {
- EnumFacing enumfacing = EnumFacing.UP;
- double d3 = Double.MAX_VALUE;
- if(!this.field_70170_p.func_175665_u(blockpos.func_177976_e()) && d0 < d3) {
- d3 = d0;
- enumfacing = EnumFacing.WEST;
- }
- if(!this.field_70170_p.func_175665_u(blockpos.func_177974_f()) && 1.0D - d0 < d3) {
- d3 = 1.0D - d0;
- enumfacing = EnumFacing.EAST;
- }
- if(!this.field_70170_p.func_175665_u(blockpos.func_177978_c()) && d2 < d3) {
- d3 = d2;
- enumfacing = EnumFacing.NORTH;
- }
- if(!this.field_70170_p.func_175665_u(blockpos.func_177968_d()) && 1.0D - d2 < d3) {
- d3 = 1.0D - d2;
- enumfacing = EnumFacing.SOUTH;
- }
- if(!this.field_70170_p.func_175665_u(blockpos.func_177984_a()) && 1.0D - d1 < d3) {
- d3 = 1.0D - d1;
- enumfacing = EnumFacing.UP;
- }
- float f = this.field_70146_Z.nextFloat() * 0.2F + 0.1F;
- float f1 = (float)enumfacing.func_176743_c().func_179524_a();
- if(enumfacing.func_176740_k() == EnumFacing.Axis.X) {
- this.field_70159_w = (double)(f1 * f);
- this.field_70181_x *= 0.75D;
- this.field_70179_y *= 0.75D;
- } else if(enumfacing.func_176740_k() == EnumFacing.Axis.Y) {
- this.field_70159_w *= 0.75D;
- this.field_70181_x = (double)(f1 * f);
- this.field_70179_y *= 0.75D;
- } else if(enumfacing.func_176740_k() == EnumFacing.Axis.Z) {
- this.field_70159_w *= 0.75D;
- this.field_70181_x *= 0.75D;
- this.field_70179_y = (double)(f1 * f);
- }
- return true;
- }
- }
- public void func_70110_aj() {
- this.field_70134_J = true;
- this.field_70143_R = 0.0F;
- }
- public String func_70005_c_() {
- if(this.func_145818_k_()) {
- return this.func_95999_t();
- } else {
- String s = EntityList.func_75621_b(this);
- if(s == null) {
- s = "generic";
- }
- return I18n.func_74838_a("entity." + s + ".name");
- }
- }
- @Nullable
- public Entity[] func_70021_al() {
- return null;
- }
- public boolean func_70028_i(Entity p_70028_1_) {
- return this == p_70028_1_;
- }
- public float func_70079_am() {
- return 0.0F;
- }
- public void func_70034_d(float p_70034_1_) {
- }
- public void func_181013_g(float p_181013_1_) {
- }
- public boolean func_70075_an() {
- return true;
- }
- public boolean func_85031_j(Entity p_85031_1_) {
- return false;
- }
- public String toString() {
- 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)});
- }
- public boolean func_180431_b(DamageSource p_180431_1_) {
- return this.field_83001_bt && p_180431_1_ != DamageSource.field_76380_i && !p_180431_1_.func_180136_u();
- }
- public boolean func_190530_aW() {
- return this.field_83001_bt;
- }
- public void func_184224_h(boolean p_184224_1_) {
- this.field_83001_bt = p_184224_1_;
- }
- public void func_82149_j(Entity p_82149_1_) {
- 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);
- }
- private void func_180432_n(Entity p_180432_1_) {
- NBTTagCompound nbttagcompound = p_180432_1_.func_189511_e(new NBTTagCompound());
- nbttagcompound.func_82580_o("Dimension");
- this.func_70020_e(nbttagcompound);
- this.field_71088_bW = p_180432_1_.field_71088_bW;
- this.field_181016_an = p_180432_1_.field_181016_an;
- this.field_181017_ao = p_180432_1_.field_181017_ao;
- this.field_181018_ap = p_180432_1_.field_181018_ap;
- }
- @Nullable
- public Entity func_184204_a(int p_184204_1_) {
- if(!this.field_70170_p.field_72995_K && !this.field_70128_L) {
- this.field_70170_p.field_72984_F.func_76320_a("changeDimension");
- MinecraftServer minecraftserver = this.func_184102_h();
- int i = this.field_71093_bK;
- WorldServer worldserver = minecraftserver.func_71218_a(i);
- WorldServer worldserver1 = minecraftserver.func_71218_a(p_184204_1_);
- this.field_71093_bK = p_184204_1_;
- if(i == 1 && p_184204_1_ == 1) {
- worldserver1 = minecraftserver.func_71218_a(0);
- this.field_71093_bK = 0;
- }
- this.field_70170_p.func_72900_e(this);
- this.field_70128_L = false;
- this.field_70170_p.field_72984_F.func_76320_a("reposition");
- BlockPos blockpos;
- if(p_184204_1_ == 1) {
- blockpos = worldserver1.func_180504_m();
- } else {
- double d0 = this.field_70165_t;
- double d1 = this.field_70161_v;
- double d2 = 8.0D;
- if(p_184204_1_ == -1) {
- 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);
- 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);
- } else if(p_184204_1_ == 0) {
- 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);
- 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);
- }
- d0 = (double)MathHelper.func_76125_a((int)d0, -29999872, 29999872);
- d1 = (double)MathHelper.func_76125_a((int)d1, -29999872, 29999872);
- float f = this.field_70177_z;
- this.func_70012_b(d0, this.field_70163_u, d1, 90.0F, 0.0F);
- Teleporter teleporter = worldserver1.func_85176_s();
- teleporter.func_180620_b(this, f);
- blockpos = new BlockPos(this);
- }
- worldserver.func_72866_a(this, false);
- this.field_70170_p.field_72984_F.func_76318_c("reloading");
- Entity entity = EntityList.func_191304_a(this.getClass(), worldserver1);
- if(entity != null) {
- entity.func_180432_n(this);
- if(i == 1 && p_184204_1_ == 1) {
- BlockPos blockpos1 = worldserver1.func_175672_r(worldserver1.func_175694_M());
- entity.func_174828_a(blockpos1, entity.field_70177_z, entity.field_70125_A);
- } else {
- entity.func_174828_a(blockpos, entity.field_70177_z, entity.field_70125_A);
- }
- boolean flag = entity.field_98038_p;
- entity.field_98038_p = true;
- worldserver1.func_72838_d(entity);
- entity.field_98038_p = flag;
- worldserver1.func_72866_a(entity, false);
- }
- this.field_70128_L = true;
- this.field_70170_p.field_72984_F.func_76319_b();
- worldserver.func_82742_i();
- worldserver1.func_82742_i();
- this.field_70170_p.field_72984_F.func_76319_b();
- return entity;
- } else {
- return null;
- }
- }
- public boolean func_184222_aU() {
- return true;
- }
- public float func_180428_a(Explosion p_180428_1_, World p_180428_2_, BlockPos p_180428_3_, IBlockState p_180428_4_) {
- return p_180428_4_.func_177230_c().func_149638_a(this);
- }
- 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_) {
- return true;
- }
- public int func_82143_as() {
- return 3;
- }
- public Vec3d func_181014_aG() {
- return this.field_181017_ao;
- }
- public EnumFacing func_181012_aH() {
- return this.field_181018_ap;
- }
- public boolean func_145773_az() {
- return false;
- }
- public void func_85029_a(CrashReportCategory p_85029_1_) {
- p_85029_1_.func_189529_a("Entity Type", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return EntityList.func_191301_a(Entity.this) + " (" + Entity.this.getClass().getCanonicalName() + ")";
- }
- });
- p_85029_1_.func_71507_a("Entity ID", Integer.valueOf(this.field_145783_c));
- p_85029_1_.func_189529_a("Entity Name", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return Entity.this.func_70005_c_();
- }
- });
- 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)}));
- 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)));
- 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)}));
- p_85029_1_.func_189529_a("Entity\'s Passengers", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return Entity.this.func_184188_bt().toString();
- }
- });
- p_85029_1_.func_189529_a("Entity\'s Vehicle", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return Entity.this.func_184187_bx().toString();
- }
- });
- }
- public void func_184221_a(UUID p_184221_1_) {
- this.field_96093_i = p_184221_1_;
- this.field_189513_ar = this.field_96093_i.toString();
- }
- @SideOnly(Side.CLIENT)
- public boolean func_90999_ad() {
- return this.func_70027_ad();
- }
- public UUID func_110124_au() {
- return this.field_96093_i;
- }
- public String func_189512_bd() {
- return this.field_189513_ar;
- }
- public boolean func_96092_aw() {
- return true;
- }
- @SideOnly(Side.CLIENT)
- public static double func_184183_bd() {
- return field_70155_l;
- }
- @SideOnly(Side.CLIENT)
- public static void func_184227_b(double p_184227_0_) {
- field_70155_l = p_184227_0_;
- }
- public ITextComponent func_145748_c_() {
- TextComponentString textcomponentstring = new TextComponentString(ScorePlayerTeam.func_96667_a(this.func_96124_cp(), this.func_70005_c_()));
- textcomponentstring.func_150256_b().func_150209_a(this.func_174823_aP());
- textcomponentstring.func_150256_b().func_179989_a(this.func_189512_bd());
- return textcomponentstring;
- }
- public void func_96094_a(String p_96094_1_) {
- this.field_70180_af.func_187227_b(field_184242_az, p_96094_1_);
- }
- public String func_95999_t() {
- return (String)this.field_70180_af.func_187225_a(field_184242_az);
- }
- public boolean func_145818_k_() {
- return !((String)this.field_70180_af.func_187225_a(field_184242_az)).isEmpty();
- }
- public void func_174805_g(boolean p_174805_1_) {
- this.field_70180_af.func_187227_b(field_184233_aA, Boolean.valueOf(p_174805_1_));
- }
- public boolean func_174833_aM() {
- return ((Boolean)this.field_70180_af.func_187225_a(field_184233_aA)).booleanValue();
- }
- public void func_70634_a(double p_70634_1_, double p_70634_3_, double p_70634_5_) {
- this.field_184237_aG = true;
- this.func_70012_b(p_70634_1_, p_70634_3_, p_70634_5_, this.field_70177_z, this.field_70125_A);
- this.field_70170_p.func_72866_a(this, false);
- }
- public void func_184206_a(DataParameter<?> p_184206_1_) {
- }
- @SideOnly(Side.CLIENT)
- public boolean func_94059_bO() {
- return this.func_174833_aM();
- }
- public EnumFacing func_174811_aO() {
- return EnumFacing.func_176731_b(MathHelper.func_76128_c((double)(this.field_70177_z * 4.0F / 360.0F) + 0.5D) & 3);
- }
- public EnumFacing func_184172_bi() {
- return this.func_174811_aO();
- }
- protected HoverEvent func_174823_aP() {
- NBTTagCompound nbttagcompound = new NBTTagCompound();
- ResourceLocation resourcelocation = EntityList.func_191301_a(this);
- nbttagcompound.func_74778_a("id", this.func_189512_bd());
- if(resourcelocation != null) {
- nbttagcompound.func_74778_a("type", resourcelocation.toString());
- }
- nbttagcompound.func_74778_a("name", this.func_70005_c_());
- return new HoverEvent(HoverEvent.Action.SHOW_ENTITY, new TextComponentString(nbttagcompound.toString()));
- }
- public boolean func_174827_a(EntityPlayerMP p_174827_1_) {
- return true;
- }
- public AxisAlignedBB func_174813_aQ() {
- return this.field_70121_D;
- }
- @SideOnly(Side.CLIENT)
- public AxisAlignedBB func_184177_bl() {
- return this.func_174813_aQ();
- }
- public void func_174826_a(AxisAlignedBB p_174826_1_) {
- this.field_70121_D = p_174826_1_;
- }
- public float func_70047_e() {
- return this.field_70131_O * 0.85F;
- }
- public boolean func_174832_aS() {
- return this.field_174835_g;
- }
- public void func_174821_h(boolean p_174821_1_) {
- this.field_174835_g = p_174821_1_;
- }
- public boolean func_174820_d(int p_174820_1_, ItemStack p_174820_2_) {
- return false;
- }
- public void func_145747_a(ITextComponent p_145747_1_) {
- }
- public boolean func_70003_b(int p_70003_1_, String p_70003_2_) {
- return true;
- }
- public BlockPos func_180425_c() {
- return new BlockPos(this.field_70165_t, this.field_70163_u + 0.5D, this.field_70161_v);
- }
- public Vec3d func_174791_d() {
- return new Vec3d(this.field_70165_t, this.field_70163_u, this.field_70161_v);
- }
- public World func_130014_f_() {
- return this.field_70170_p;
- }
- public Entity func_174793_f() {
- return this;
- }
- public boolean func_174792_t_() {
- return false;
- }
- public void func_174794_a(CommandResultStats.Type p_174794_1_, int p_174794_2_) {
- if(this.field_70170_p != null && !this.field_70170_p.field_72995_K) {
- this.field_174837_as.func_184932_a(this.field_70170_p.func_73046_m(), this, p_174794_1_, p_174794_2_);
- }
- }
- @Nullable
- public MinecraftServer func_184102_h() {
- return this.field_70170_p.func_73046_m();
- }
- public CommandResultStats func_174807_aT() {
- return this.field_174837_as;
- }
- public void func_174817_o(Entity p_174817_1_) {
- this.field_174837_as.func_179671_a(p_174817_1_.func_174807_aT());
- }
- public EnumActionResult func_184199_a(EntityPlayer p_184199_1_, Vec3d p_184199_2_, EnumHand p_184199_3_) {
- return EnumActionResult.PASS;
- }
- public boolean func_180427_aV() {
- return false;
- }
- protected void func_174815_a(EntityLivingBase p_174815_1_, Entity p_174815_2_) {
- if(p_174815_2_ instanceof EntityLivingBase) {
- EnchantmentHelper.func_151384_a((EntityLivingBase)p_174815_2_, p_174815_1_);
- }
- EnchantmentHelper.func_151385_b(p_174815_1_, p_174815_2_);
- }
- public void func_184178_b(EntityPlayerMP p_184178_1_) {
- }
- public void func_184203_c(EntityPlayerMP p_184203_1_) {
- }
- public float func_184229_a(Rotation p_184229_1_) {
- float f = MathHelper.func_76142_g(this.field_70177_z);
- switch(p_184229_1_) {
- case CLOCKWISE_180:
- return f + 180.0F;
- case COUNTERCLOCKWISE_90:
- return f + 270.0F;
- case CLOCKWISE_90:
- return f + 90.0F;
- default:
- return f;
- }
- }
- public float func_184217_a(Mirror p_184217_1_) {
- float f = MathHelper.func_76142_g(this.field_70177_z);
- switch(p_184217_1_) {
- case LEFT_RIGHT:
- return -f;
- case FRONT_BACK:
- return 180.0F - f;
- default:
- return f;
- }
- }
- public boolean func_184213_bq() {
- return false;
- }
- public boolean func_184189_br() {
- boolean flag = this.field_184237_aG;
- this.field_184237_aG = false;
- return flag;
- }
- @Nullable
- public Entity func_184179_bs() {
- return null;
- }
- public List<Entity> func_184188_bt() {
- return (List<Entity>)(this.field_184244_h.isEmpty()?Collections.emptyList():Lists.newArrayList(this.field_184244_h));
- }
- public boolean func_184196_w(Entity p_184196_1_) {
- for(Entity entity : this.func_184188_bt()) {
- if(entity.equals(p_184196_1_)) {
- return true;
- }
- }
- return false;
- }
- public Collection<Entity> func_184182_bu() {
- Set<Entity> set = Sets.<Entity>newHashSet();
- this.func_184175_a(Entity.class, set);
- return set;
- }
- public <T extends Entity> Collection<T> func_184180_b(Class<T> p_184180_1_) {
- Set<T> set = Sets.<T>newHashSet();
- this.func_184175_a(p_184180_1_, set);
- return set;
- }
- private <T extends Entity> void func_184175_a(Class<T> p_184175_1_, Set<T> p_184175_2_) {
- for(Entity entity : this.func_184188_bt()) {
- if(p_184175_1_.isAssignableFrom(entity.getClass())) {
- p_184175_2_.add(entity);
- }
- entity.func_184175_a(p_184175_1_, p_184175_2_);
- }
- }
- public Entity func_184208_bv() {
- Entity entity;
- for(entity = this; entity.func_184218_aH(); entity = entity.func_184187_bx()) {
- ;
- }
- return entity;
- }
- public boolean func_184223_x(Entity p_184223_1_) {
- return this.func_184208_bv() == p_184223_1_.func_184208_bv();
- }
- public boolean func_184215_y(Entity p_184215_1_) {
- for(Entity entity : this.func_184188_bt()) {
- if(entity.equals(p_184215_1_)) {
- return true;
- }
- if(entity.func_184215_y(p_184215_1_)) {
- return true;
- }
- }
- return false;
- }
- public boolean func_184186_bw() {
- Entity entity = this.func_184179_bs();
- return entity instanceof EntityPlayer?((EntityPlayer)entity).func_175144_cb():!this.field_70170_p.field_72995_K;
- }
- @Nullable
- public Entity func_184187_bx() {
- return this.field_184239_as;
- }
- public EnumPushReaction func_184192_z() {
- return EnumPushReaction.NORMAL;
- }
- public SoundCategory func_184176_by() {
- return SoundCategory.NEUTRAL;
- }
- protected int func_190531_bD() {
- return 1;
- }
- }
- Hunk 3 failed! Cannot find hunk target
- private <T extends Entity> void func_184175_a(Class<T> p_184175_1_, Set<T> p_184175_2_) {
- for(Entity entity : this.func_184188_bt()) {
- if (p_184175_1_.isAssignableFrom(entity.getClass())) {
- - p_184175_2_.add(entity);
- + p_184175_2_.add((T)entity);
- }
- entity.func_184175_a(p_184175_1_, p_184175_2_);
- File state
- package net.minecraft.entity;
- import com.google.common.collect.Iterables;
- import com.google.common.collect.Lists;
- import com.google.common.collect.Sets;
- import java.util.Arrays;
- import java.util.Collection;
- import java.util.Collections;
- import java.util.List;
- import java.util.Random;
- import java.util.Set;
- import java.util.UUID;
- import javax.annotation.Nullable;
- import net.minecraft.advancements.CriteriaTriggers;
- import net.minecraft.block.Block;
- import net.minecraft.block.BlockFence;
- import net.minecraft.block.BlockFenceGate;
- import net.minecraft.block.BlockLiquid;
- import net.minecraft.block.BlockWall;
- import net.minecraft.block.SoundType;
- import net.minecraft.block.material.EnumPushReaction;
- import net.minecraft.block.material.Material;
- import net.minecraft.block.state.IBlockState;
- import net.minecraft.block.state.pattern.BlockPattern;
- import net.minecraft.command.CommandResultStats;
- import net.minecraft.command.ICommandSender;
- import net.minecraft.crash.CrashReport;
- import net.minecraft.crash.CrashReportCategory;
- import net.minecraft.crash.ICrashReportDetail;
- import net.minecraft.enchantment.EnchantmentHelper;
- import net.minecraft.enchantment.EnchantmentProtection;
- import net.minecraft.entity.EntityList;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.entity.MoverType;
- import net.minecraft.entity.effect.EntityLightningBolt;
- import net.minecraft.entity.item.EntityBoat;
- import net.minecraft.entity.item.EntityItem;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.entity.player.EntityPlayerMP;
- import net.minecraft.init.Blocks;
- import net.minecraft.init.SoundEvents;
- import net.minecraft.inventory.EntityEquipmentSlot;
- import net.minecraft.item.Item;
- import net.minecraft.item.ItemStack;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.nbt.NBTTagDouble;
- import net.minecraft.nbt.NBTTagFloat;
- import net.minecraft.nbt.NBTTagList;
- import net.minecraft.nbt.NBTTagString;
- import net.minecraft.network.datasync.DataParameter;
- import net.minecraft.network.datasync.DataSerializers;
- import net.minecraft.network.datasync.EntityDataManager;
- import net.minecraft.scoreboard.ScorePlayerTeam;
- import net.minecraft.scoreboard.Team;
- import net.minecraft.server.MinecraftServer;
- import net.minecraft.util.DamageSource;
- import net.minecraft.util.EnumActionResult;
- import net.minecraft.util.EnumBlockRenderType;
- import net.minecraft.util.EnumFacing;
- import net.minecraft.util.EnumHand;
- import net.minecraft.util.EnumParticleTypes;
- import net.minecraft.util.Mirror;
- import net.minecraft.util.ReportedException;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.util.Rotation;
- import net.minecraft.util.SoundCategory;
- import net.minecraft.util.SoundEvent;
- import net.minecraft.util.datafix.DataFixer;
- import net.minecraft.util.datafix.FixTypes;
- import net.minecraft.util.datafix.IDataFixer;
- import net.minecraft.util.datafix.IDataWalker;
- import net.minecraft.util.math.AxisAlignedBB;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.util.math.MathHelper;
- import net.minecraft.util.math.RayTraceResult;
- import net.minecraft.util.math.Vec2f;
- import net.minecraft.util.math.Vec3d;
- import net.minecraft.util.text.ITextComponent;
- import net.minecraft.util.text.TextComponentString;
- import net.minecraft.util.text.event.HoverEvent;
- import net.minecraft.util.text.translation.I18n;
- import net.minecraft.world.Explosion;
- import net.minecraft.world.Teleporter;
- import net.minecraft.world.World;
- import net.minecraft.world.WorldServer;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- import org.apache.logging.log4j.LogManager;
- import org.apache.logging.log4j.Logger;
- public abstract class Entity implements ICommandSender {
- private static final Logger field_184243_a = LogManager.getLogger();
- private static final List<ItemStack> field_190535_b = Collections.<ItemStack>emptyList();
- private static final AxisAlignedBB field_174836_a = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
- private static double field_70155_l = 1.0D;
- private static int field_70152_a;
- private int field_145783_c;
- public boolean field_70156_m;
- private final List<Entity> field_184244_h;
- protected int field_184245_j;
- private Entity field_184239_as;
- public boolean field_98038_p;
- public World field_70170_p;
- public double field_70169_q;
- public double field_70167_r;
- public double field_70166_s;
- public double field_70165_t;
- public double field_70163_u;
- public double field_70161_v;
- public double field_70159_w;
- public double field_70181_x;
- public double field_70179_y;
- public float field_70177_z;
- public float field_70125_A;
- public float field_70126_B;
- public float field_70127_C;
- private AxisAlignedBB field_70121_D;
- public boolean field_70122_E;
- public boolean field_70123_F;
- public boolean field_70124_G;
- public boolean field_70132_H;
- public boolean field_70133_I;
- protected boolean field_70134_J;
- private boolean field_174835_g;
- public boolean field_70128_L;
- public float field_70130_N;
- public float field_70131_O;
- public float field_70141_P;
- public float field_70140_Q;
- public float field_82151_R;
- public float field_70143_R;
- private int field_70150_b;
- private float field_191959_ay;
- public double field_70142_S;
- public double field_70137_T;
- public double field_70136_U;
- public float field_70138_W;
- public boolean field_70145_X;
- public float field_70144_Y;
- protected Random field_70146_Z;
- public int field_70173_aa;
- private int field_190534_ay;
- protected boolean field_70171_ac;
- public int field_70172_ad;
- protected boolean field_70148_d;
- protected boolean field_70178_ae;
- protected EntityDataManager field_70180_af;
- protected static final DataParameter<Byte> field_184240_ax = EntityDataManager.<Byte>func_187226_a(Entity.class, DataSerializers.field_187191_a);
- private static final DataParameter<Integer> field_184241_ay = EntityDataManager.<Integer>func_187226_a(Entity.class, DataSerializers.field_187192_b);
- private static final DataParameter<String> field_184242_az = EntityDataManager.<String>func_187226_a(Entity.class, DataSerializers.field_187194_d);
- private static final DataParameter<Boolean> field_184233_aA = EntityDataManager.<Boolean>func_187226_a(Entity.class, DataSerializers.field_187198_h);
- private static final DataParameter<Boolean> field_184234_aB = EntityDataManager.<Boolean>func_187226_a(Entity.class, DataSerializers.field_187198_h);
- private static final DataParameter<Boolean> field_189655_aD = EntityDataManager.<Boolean>func_187226_a(Entity.class, DataSerializers.field_187198_h);
- public boolean field_70175_ag;
- public int field_70176_ah;
- public int field_70162_ai;
- public int field_70164_aj;
- @SideOnly(Side.CLIENT)
- public long field_70118_ct;
- @SideOnly(Side.CLIENT)
- public long field_70117_cu;
- @SideOnly(Side.CLIENT)
- public long field_70116_cv;
- public boolean field_70158_ak;
- public boolean field_70160_al;
- public int field_71088_bW;
- protected boolean field_71087_bX;
- protected int field_82153_h;
- public int field_71093_bK;
- protected BlockPos field_181016_an;
- protected Vec3d field_181017_ao;
- protected EnumFacing field_181018_ap;
- private boolean field_83001_bt;
- protected UUID field_96093_i;
- protected String field_189513_ar;
- private final CommandResultStats field_174837_as;
- protected boolean field_184238_ar;
- private final Set<String> field_184236_aF;
- private boolean field_184237_aG;
- private final double[] field_191505_aI;
- private long field_191506_aJ;
- public Entity(World p_i1582_1_) {
- this.field_145783_c = field_70152_a++;
- this.field_184244_h = Lists.<Entity>newArrayList();
- this.field_70121_D = field_174836_a;
- this.field_70130_N = 0.6F;
- this.field_70131_O = 1.8F;
- this.field_70150_b = 1;
- this.field_191959_ay = 1.0F;
- this.field_70146_Z = new Random();
- this.field_190534_ay = -this.func_190531_bD();
- this.field_70148_d = true;
- this.field_96093_i = MathHelper.func_180182_a(this.field_70146_Z);
- this.field_189513_ar = this.field_96093_i.toString();
- this.field_174837_as = new CommandResultStats();
- this.field_184236_aF = Sets.<String>newHashSet();
- this.field_191505_aI = new double[]{0.0D, 0.0D, 0.0D};
- this.field_70170_p = p_i1582_1_;
- this.func_70107_b(0.0D, 0.0D, 0.0D);
- if(p_i1582_1_ != null) {
- this.field_71093_bK = p_i1582_1_.field_73011_w.func_186058_p().func_186068_a();
- }
- this.field_70180_af = new EntityDataManager(this);
- this.field_70180_af.func_187214_a(field_184240_ax, Byte.valueOf((byte)0));
- this.field_70180_af.func_187214_a(field_184241_ay, Integer.valueOf(300));
- this.field_70180_af.func_187214_a(field_184233_aA, Boolean.valueOf(false));
- this.field_70180_af.func_187214_a(field_184242_az, "");
- this.field_70180_af.func_187214_a(field_184234_aB, Boolean.valueOf(false));
- this.field_70180_af.func_187214_a(field_189655_aD, Boolean.valueOf(false));
- this.func_70088_a();
- }
- public int func_145782_y() {
- return this.field_145783_c;
- }
- public void func_145769_d(int p_145769_1_) {
- this.field_145783_c = p_145769_1_;
- }
- public Set<String> func_184216_O() {
- return this.field_184236_aF;
- }
- public boolean func_184211_a(String p_184211_1_) {
- if(this.field_184236_aF.size() >= 1024) {
- return false;
- } else {
- this.field_184236_aF.add(p_184211_1_);
- return true;
- }
- }
- public boolean func_184197_b(String p_184197_1_) {
- return this.field_184236_aF.remove(p_184197_1_);
- }
- public void func_174812_G() {
- this.func_70106_y();
- }
- protected abstract void func_70088_a();
- public EntityDataManager func_184212_Q() {
- return this.field_70180_af;
- }
- public boolean equals(Object p_equals_1_) {
- return p_equals_1_ instanceof Entity?((Entity)p_equals_1_).field_145783_c == this.field_145783_c:false;
- }
- public int hashCode() {
- return this.field_145783_c;
- }
- @SideOnly(Side.CLIENT)
- protected void func_70065_x() {
- if(this.field_70170_p != null) {
- while(this.field_70163_u > 0.0D && this.field_70163_u < 256.0D) {
- this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v);
- if(this.field_70170_p.func_184144_a(this, this.func_174813_aQ()).isEmpty()) {
- break;
- }
- ++this.field_70163_u;
- }
- this.field_70159_w = 0.0D;
- this.field_70181_x = 0.0D;
- this.field_70179_y = 0.0D;
- this.field_70125_A = 0.0F;
- }
- }
- public void func_70106_y() {
- this.field_70128_L = true;
- }
- public void func_184174_b(boolean p_184174_1_) {
- }
- protected void func_70105_a(float p_70105_1_, float p_70105_2_) {
- if(p_70105_1_ != this.field_70130_N || p_70105_2_ != this.field_70131_O) {
- float f = this.field_70130_N;
- this.field_70130_N = p_70105_1_;
- this.field_70131_O = p_70105_2_;
- if(this.field_70130_N < f) {
- double d0 = (double)p_70105_1_ / 2.0D;
- 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));
- return;
- }
- AxisAlignedBB axisalignedbb = this.func_174813_aQ();
- 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));
- if(this.field_70130_N > f && !this.field_70148_d && !this.field_70170_p.field_72995_K) {
- this.func_70091_d(MoverType.SELF, (double)(f - this.field_70130_N), 0.0D, (double)(f - this.field_70130_N));
- }
- }
- }
- protected void func_70101_b(float p_70101_1_, float p_70101_2_) {
- this.field_70177_z = p_70101_1_ % 360.0F;
- this.field_70125_A = p_70101_2_ % 360.0F;
- }
- public void func_70107_b(double p_70107_1_, double p_70107_3_, double p_70107_5_) {
- this.field_70165_t = p_70107_1_;
- this.field_70163_u = p_70107_3_;
- this.field_70161_v = p_70107_5_;
- float f = this.field_70130_N / 2.0F;
- float f1 = this.field_70131_O;
- 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));
- }
- @SideOnly(Side.CLIENT)
- public void func_70082_c(float p_70082_1_, float p_70082_2_) {
- float f = this.field_70125_A;
- float f1 = this.field_70177_z;
- this.field_70177_z = (float)((double)this.field_70177_z + (double)p_70082_1_ * 0.15D);
- this.field_70125_A = (float)((double)this.field_70125_A - (double)p_70082_2_ * 0.15D);
- this.field_70125_A = MathHelper.func_76131_a(this.field_70125_A, -90.0F, 90.0F);
- this.field_70127_C += this.field_70125_A - f;
- this.field_70126_B += this.field_70177_z - f1;
- if(this.field_184239_as != null) {
- this.field_184239_as.func_184190_l(this);
- }
- }
- public void func_70071_h_() {
- if(!this.field_70170_p.field_72995_K) {
- this.func_70052_a(6, this.func_184202_aL());
- }
- this.func_70030_z();
- }
- public void func_70030_z() {
- this.field_70170_p.field_72984_F.func_76320_a("entityBaseTick");
- if(this.func_184218_aH() && this.func_184187_bx().field_70128_L) {
- this.func_184210_p();
- }
- if(this.field_184245_j > 0) {
- --this.field_184245_j;
- }
- this.field_70141_P = this.field_70140_Q;
- this.field_70169_q = this.field_70165_t;
- this.field_70167_r = this.field_70163_u;
- this.field_70166_s = this.field_70161_v;
- this.field_70127_C = this.field_70125_A;
- this.field_70126_B = this.field_70177_z;
- if(!this.field_70170_p.field_72995_K && this.field_70170_p instanceof WorldServer) {
- this.field_70170_p.field_72984_F.func_76320_a("portal");
- if(this.field_71087_bX) {
- MinecraftServer minecraftserver = this.field_70170_p.func_73046_m();
- if(minecraftserver.func_71255_r()) {
- if(!this.func_184218_aH()) {
- int i = this.func_82145_z();
- if(this.field_82153_h++ >= i) {
- this.field_82153_h = i;
- this.field_71088_bW = this.func_82147_ab();
- int j;
- if(this.field_70170_p.field_73011_w.func_186058_p().func_186068_a() == -1) {
- j = 0;
- } else {
- j = -1;
- }
- this.func_184204_a(j);
- }
- }
- this.field_71087_bX = false;
- }
- } else {
- if(this.field_82153_h > 0) {
- this.field_82153_h -= 4;
- }
- if(this.field_82153_h < 0) {
- this.field_82153_h = 0;
- }
- }
- this.func_184173_H();
- this.field_70170_p.field_72984_F.func_76319_b();
- }
- this.func_174830_Y();
- this.func_70072_I();
- if(this.field_70170_p.field_72995_K) {
- this.func_70066_B();
- } else if(this.field_190534_ay > 0) {
- if(this.field_70178_ae) {
- this.field_190534_ay -= 4;
- if(this.field_190534_ay < 0) {
- this.func_70066_B();
- }
- } else {
- if(this.field_190534_ay % 20 == 0) {
- this.func_70097_a(DamageSource.field_76370_b, 1.0F);
- }
- --this.field_190534_ay;
- }
- }
- if(this.func_180799_ab()) {
- this.func_70044_A();
- this.field_70143_R *= 0.5F;
- }
- if(this.field_70163_u < -64.0D) {
- this.func_70076_C();
- }
- if(!this.field_70170_p.field_72995_K) {
- this.func_70052_a(0, this.field_190534_ay > 0);
- }
- this.field_70148_d = false;
- this.field_70170_p.field_72984_F.func_76319_b();
- }
- protected void func_184173_H() {
- if(this.field_71088_bW > 0) {
- --this.field_71088_bW;
- }
- }
- public int func_82145_z() {
- return 1;
- }
- protected void func_70044_A() {
- if(!this.field_70178_ae) {
- this.func_70097_a(DamageSource.field_76371_c, 4.0F);
- this.func_70015_d(15);
- }
- }
- public void func_70015_d(int p_70015_1_) {
- int i = p_70015_1_ * 20;
- if(this instanceof EntityLivingBase) {
- i = EnchantmentProtection.func_92093_a((EntityLivingBase)this, i);
- }
- if(this.field_190534_ay < i) {
- this.field_190534_ay = i;
- }
- }
- public void func_70066_B() {
- this.field_190534_ay = 0;
- }
- protected void func_70076_C() {
- this.func_70106_y();
- }
- public boolean func_70038_c(double p_70038_1_, double p_70038_3_, double p_70038_5_) {
- AxisAlignedBB axisalignedbb = this.func_174813_aQ().func_72317_d(p_70038_1_, p_70038_3_, p_70038_5_);
- return this.func_174809_b(axisalignedbb);
- }
- private boolean func_174809_b(AxisAlignedBB p_174809_1_) {
- return this.field_70170_p.func_184144_a(this, p_174809_1_).isEmpty() && !this.field_70170_p.func_72953_d(p_174809_1_);
- }
- public void func_70091_d(MoverType p_70091_1_, double p_70091_2_, double p_70091_4_, double p_70091_6_) {
- if(this.field_70145_X) {
- this.func_174826_a(this.func_174813_aQ().func_72317_d(p_70091_2_, p_70091_4_, p_70091_6_));
- this.func_174829_m();
- } else {
- if(p_70091_1_ == MoverType.PISTON) {
- long i = this.field_70170_p.func_82737_E();
- if(i != this.field_191506_aJ) {
- Arrays.fill(this.field_191505_aI, 0.0D);
- this.field_191506_aJ = i;
- }
- if(p_70091_2_ != 0.0D) {
- int j = EnumFacing.Axis.X.ordinal();
- double d0 = MathHelper.func_151237_a(p_70091_2_ + this.field_191505_aI[j], -0.51D, 0.51D);
- p_70091_2_ = d0 - this.field_191505_aI[j];
- this.field_191505_aI[j] = d0;
- if(Math.abs(p_70091_2_) <= 9.999999747378752E-6D) {
- return;
- }
- } else if(p_70091_4_ != 0.0D) {
- int l4 = EnumFacing.Axis.Y.ordinal();
- double d12 = MathHelper.func_151237_a(p_70091_4_ + this.field_191505_aI[l4], -0.51D, 0.51D);
- p_70091_4_ = d12 - this.field_191505_aI[l4];
- this.field_191505_aI[l4] = d12;
- if(Math.abs(p_70091_4_) <= 9.999999747378752E-6D) {
- return;
- }
- } else {
- if(p_70091_6_ == 0.0D) {
- return;
- }
- int i5 = EnumFacing.Axis.Z.ordinal();
- double d13 = MathHelper.func_151237_a(p_70091_6_ + this.field_191505_aI[i5], -0.51D, 0.51D);
- p_70091_6_ = d13 - this.field_191505_aI[i5];
- this.field_191505_aI[i5] = d13;
- if(Math.abs(p_70091_6_) <= 9.999999747378752E-6D) {
- return;
- }
- }
- }
- this.field_70170_p.field_72984_F.func_76320_a("move");
- double d10 = this.field_70165_t;
- double d11 = this.field_70163_u;
- double d1 = this.field_70161_v;
- if(this.field_70134_J) {
- this.field_70134_J = false;
- p_70091_2_ *= 0.25D;
- p_70091_4_ *= 0.05000000074505806D;
- p_70091_6_ *= 0.25D;
- this.field_70159_w = 0.0D;
- this.field_70181_x = 0.0D;
- this.field_70179_y = 0.0D;
- }
- double d2 = p_70091_2_;
- double d3 = p_70091_4_;
- double d4 = p_70091_6_;
- if((p_70091_1_ == MoverType.SELF || p_70091_1_ == MoverType.PLAYER) && this.field_70122_E && this.func_70093_af() && this instanceof EntityPlayer) {
- 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_) {
- if(p_70091_2_ < 0.05D && p_70091_2_ >= -0.05D) {
- p_70091_2_ = 0.0D;
- } else if(p_70091_2_ > 0.0D) {
- p_70091_2_ -= 0.05D;
- } else {
- p_70091_2_ += 0.05D;
- }
- }
- 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_) {
- if(p_70091_6_ < 0.05D && p_70091_6_ >= -0.05D) {
- p_70091_6_ = 0.0D;
- } else if(p_70091_6_ > 0.0D) {
- p_70091_6_ -= 0.05D;
- } else {
- p_70091_6_ += 0.05D;
- }
- }
- 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_) {
- if(p_70091_2_ < 0.05D && p_70091_2_ >= -0.05D) {
- p_70091_2_ = 0.0D;
- } else if(p_70091_2_ > 0.0D) {
- p_70091_2_ -= 0.05D;
- } else {
- p_70091_2_ += 0.05D;
- }
- d2 = p_70091_2_;
- if(p_70091_6_ < 0.05D && p_70091_6_ >= -0.05D) {
- p_70091_6_ = 0.0D;
- } else if(p_70091_6_ > 0.0D) {
- p_70091_6_ -= 0.05D;
- } else {
- p_70091_6_ += 0.05D;
- }
- }
- }
- 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_));
- AxisAlignedBB axisalignedbb = this.func_174813_aQ();
- if(p_70091_4_ != 0.0D) {
- int k = 0;
- for(int l = list1.size(); k < l; ++k) {
- p_70091_4_ = ((AxisAlignedBB)list1.get(k)).func_72323_b(this.func_174813_aQ(), p_70091_4_);
- }
- this.func_174826_a(this.func_174813_aQ().func_72317_d(0.0D, p_70091_4_, 0.0D));
- }
- if(p_70091_2_ != 0.0D) {
- int j5 = 0;
- for(int l5 = list1.size(); j5 < l5; ++j5) {
- p_70091_2_ = ((AxisAlignedBB)list1.get(j5)).func_72316_a(this.func_174813_aQ(), p_70091_2_);
- }
- if(p_70091_2_ != 0.0D) {
- this.func_174826_a(this.func_174813_aQ().func_72317_d(p_70091_2_, 0.0D, 0.0D));
- }
- }
- if(p_70091_6_ != 0.0D) {
- int k5 = 0;
- for(int i6 = list1.size(); k5 < i6; ++k5) {
- p_70091_6_ = ((AxisAlignedBB)list1.get(k5)).func_72322_c(this.func_174813_aQ(), p_70091_6_);
- }
- if(p_70091_6_ != 0.0D) {
- this.func_174826_a(this.func_174813_aQ().func_72317_d(0.0D, 0.0D, p_70091_6_));
- }
- }
- boolean flag = this.field_70122_E || p_70091_4_ != p_70091_4_ && p_70091_4_ < 0.0D;
- if(this.field_70138_W > 0.0F && flag && (d2 != p_70091_2_ || d4 != p_70091_6_)) {
- double d14 = p_70091_2_;
- double d6 = p_70091_4_;
- double d7 = p_70091_6_;
- AxisAlignedBB axisalignedbb1 = this.func_174813_aQ();
- this.func_174826_a(axisalignedbb);
- p_70091_4_ = (double)this.field_70138_W;
- List<AxisAlignedBB> list = this.field_70170_p.func_184144_a(this, this.func_174813_aQ().func_72321_a(d2, p_70091_4_, d4));
- AxisAlignedBB axisalignedbb2 = this.func_174813_aQ();
- AxisAlignedBB axisalignedbb3 = axisalignedbb2.func_72321_a(d2, 0.0D, d4);
- double d8 = p_70091_4_;
- int j1 = 0;
- for(int k1 = list.size(); j1 < k1; ++j1) {
- d8 = ((AxisAlignedBB)list.get(j1)).func_72323_b(axisalignedbb3, d8);
- }
- axisalignedbb2 = axisalignedbb2.func_72317_d(0.0D, d8, 0.0D);
- double d18 = d2;
- int l1 = 0;
- for(int i2 = list.size(); l1 < i2; ++l1) {
- d18 = ((AxisAlignedBB)list.get(l1)).func_72316_a(axisalignedbb2, d18);
- }
- axisalignedbb2 = axisalignedbb2.func_72317_d(d18, 0.0D, 0.0D);
- double d19 = d4;
- int j2 = 0;
- for(int k2 = list.size(); j2 < k2; ++j2) {
- d19 = ((AxisAlignedBB)list.get(j2)).func_72322_c(axisalignedbb2, d19);
- }
- axisalignedbb2 = axisalignedbb2.func_72317_d(0.0D, 0.0D, d19);
- AxisAlignedBB axisalignedbb4 = this.func_174813_aQ();
- double d20 = p_70091_4_;
- int l2 = 0;
- for(int i3 = list.size(); l2 < i3; ++l2) {
- d20 = ((AxisAlignedBB)list.get(l2)).func_72323_b(axisalignedbb4, d20);
- }
- axisalignedbb4 = axisalignedbb4.func_72317_d(0.0D, d20, 0.0D);
- double d21 = d2;
- int j3 = 0;
- for(int k3 = list.size(); j3 < k3; ++j3) {
- d21 = ((AxisAlignedBB)list.get(j3)).func_72316_a(axisalignedbb4, d21);
- }
- axisalignedbb4 = axisalignedbb4.func_72317_d(d21, 0.0D, 0.0D);
- double d22 = d4;
- int l3 = 0;
- for(int i4 = list.size(); l3 < i4; ++l3) {
- d22 = ((AxisAlignedBB)list.get(l3)).func_72322_c(axisalignedbb4, d22);
- }
- axisalignedbb4 = axisalignedbb4.func_72317_d(0.0D, 0.0D, d22);
- double d23 = d18 * d18 + d19 * d19;
- double d9 = d21 * d21 + d22 * d22;
- if(d23 > d9) {
- p_70091_2_ = d18;
- p_70091_6_ = d19;
- p_70091_4_ = -d8;
- this.func_174826_a(axisalignedbb2);
- } else {
- p_70091_2_ = d21;
- p_70091_6_ = d22;
- p_70091_4_ = -d20;
- this.func_174826_a(axisalignedbb4);
- }
- int j4 = 0;
- for(int k4 = list.size(); j4 < k4; ++j4) {
- p_70091_4_ = ((AxisAlignedBB)list.get(j4)).func_72323_b(this.func_174813_aQ(), p_70091_4_);
- }
- this.func_174826_a(this.func_174813_aQ().func_72317_d(0.0D, p_70091_4_, 0.0D));
- if(d14 * d14 + d7 * d7 >= p_70091_2_ * p_70091_2_ + p_70091_6_ * p_70091_6_) {
- p_70091_2_ = d14;
- p_70091_4_ = d6;
- p_70091_6_ = d7;
- this.func_174826_a(axisalignedbb1);
- }
- }
- this.field_70170_p.field_72984_F.func_76319_b();
- this.field_70170_p.field_72984_F.func_76320_a("rest");
- this.func_174829_m();
- this.field_70123_F = d2 != p_70091_2_ || d4 != p_70091_6_;
- this.field_70124_G = p_70091_4_ != p_70091_4_;
- this.field_70122_E = this.field_70124_G && d3 < 0.0D;
- this.field_70132_H = this.field_70123_F || this.field_70124_G;
- int j6 = MathHelper.func_76128_c(this.field_70165_t);
- int i1 = MathHelper.func_76128_c(this.field_70163_u - 0.20000000298023224D);
- int k6 = MathHelper.func_76128_c(this.field_70161_v);
- BlockPos blockpos = new BlockPos(j6, i1, k6);
- IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos);
- if(iblockstate.func_185904_a() == Material.field_151579_a) {
- BlockPos blockpos1 = blockpos.func_177977_b();
- IBlockState iblockstate1 = this.field_70170_p.func_180495_p(blockpos1);
- Block block1 = iblockstate1.func_177230_c();
- if(block1 instanceof BlockFence || block1 instanceof BlockWall || block1 instanceof BlockFenceGate) {
- iblockstate = iblockstate1;
- blockpos = blockpos1;
- }
- }
- this.func_184231_a(p_70091_4_, this.field_70122_E, iblockstate, blockpos);
- if(d2 != p_70091_2_) {
- this.field_70159_w = 0.0D;
- }
- if(d4 != p_70091_6_) {
- this.field_70179_y = 0.0D;
- }
- Block block = iblockstate.func_177230_c();
- if(d3 != p_70091_4_) {
- block.func_176216_a(this.field_70170_p, this);
- }
- if(this.func_70041_e_() && (!this.field_70122_E || !this.func_70093_af() || !(this instanceof EntityPlayer)) && !this.func_184218_aH()) {
- double d15 = this.field_70165_t - d10;
- double d16 = this.field_70163_u - d11;
- double d17 = this.field_70161_v - d1;
- if(block != Blocks.field_150468_ap) {
- d16 = 0.0D;
- }
- if(block != null && this.field_70122_E) {
- block.func_176199_a(this.field_70170_p, blockpos, this);
- }
- this.field_70140_Q = (float)((double)this.field_70140_Q + (double)MathHelper.func_76133_a(d15 * d15 + d17 * d17) * 0.6D);
- this.field_82151_R = (float)((double)this.field_82151_R + (double)MathHelper.func_76133_a(d15 * d15 + d16 * d16 + d17 * d17) * 0.6D);
- if(this.field_82151_R > (float)this.field_70150_b && iblockstate.func_185904_a() != Material.field_151579_a) {
- this.field_70150_b = (int)this.field_82151_R + 1;
- if(this.func_70090_H()) {
- Entity entity = this.func_184207_aI() && this.func_184179_bs() != null?this.func_184179_bs():this;
- float f = entity == this?0.35F:0.4F;
- 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;
- if(f1 > 1.0F) {
- f1 = 1.0F;
- }
- this.func_184185_a(this.func_184184_Z(), f1, 1.0F + (this.field_70146_Z.nextFloat() - this.field_70146_Z.nextFloat()) * 0.4F);
- } else {
- this.func_180429_a(blockpos, block);
- }
- } else if(this.field_82151_R > this.field_191959_ay && this.func_191957_ae() && iblockstate.func_185904_a() == Material.field_151579_a) {
- this.field_191959_ay = this.func_191954_d(this.field_82151_R);
- }
- }
- try {
- this.func_145775_I();
- } catch (Throwable throwable) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable, "Checking entity block collision");
- CrashReportCategory crashreportcategory = crashreport.func_85058_a("Entity being checked for collision");
- this.func_85029_a(crashreportcategory);
- throw new ReportedException(crashreport);
- }
- boolean flag1 = this.func_70026_G();
- if(this.field_70170_p.func_147470_e(this.func_174813_aQ().func_186664_h(0.001D))) {
- this.func_70081_e(1);
- if(!flag1) {
- ++this.field_190534_ay;
- if(this.field_190534_ay == 0) {
- this.func_70015_d(8);
- }
- }
- } else if(this.field_190534_ay <= 0) {
- this.field_190534_ay = -this.func_190531_bD();
- }
- if(flag1 && this.func_70027_ad()) {
- this.func_184185_a(SoundEvents.field_187541_bC, 0.7F, 1.6F + (this.field_70146_Z.nextFloat() - this.field_70146_Z.nextFloat()) * 0.4F);
- this.field_190534_ay = -this.func_190531_bD();
- }
- this.field_70170_p.field_72984_F.func_76319_b();
- }
- }
- public void func_174829_m() {
- AxisAlignedBB axisalignedbb = this.func_174813_aQ();
- this.field_70165_t = (axisalignedbb.field_72340_a + axisalignedbb.field_72336_d) / 2.0D;
- this.field_70163_u = axisalignedbb.field_72338_b;
- this.field_70161_v = (axisalignedbb.field_72339_c + axisalignedbb.field_72334_f) / 2.0D;
- }
- protected SoundEvent func_184184_Z() {
- return SoundEvents.field_187549_bG;
- }
- protected SoundEvent func_184181_aa() {
- return SoundEvents.field_187547_bF;
- }
- protected void func_145775_I() {
- AxisAlignedBB axisalignedbb = this.func_174813_aQ();
- 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);
- 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);
- BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos2 = BlockPos.PooledMutableBlockPos.func_185346_s();
- if(this.field_70170_p.func_175707_a(blockpos$pooledmutableblockpos, blockpos$pooledmutableblockpos1)) {
- for(int i = blockpos$pooledmutableblockpos.func_177958_n(); i <= blockpos$pooledmutableblockpos1.func_177958_n(); ++i) {
- for(int j = blockpos$pooledmutableblockpos.func_177956_o(); j <= blockpos$pooledmutableblockpos1.func_177956_o(); ++j) {
- for(int k = blockpos$pooledmutableblockpos.func_177952_p(); k <= blockpos$pooledmutableblockpos1.func_177952_p(); ++k) {
- blockpos$pooledmutableblockpos2.func_181079_c(i, j, k);
- IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos$pooledmutableblockpos2);
- try {
- iblockstate.func_177230_c().func_180634_a(this.field_70170_p, blockpos$pooledmutableblockpos2, iblockstate, this);
- this.func_191955_a(iblockstate);
- } catch (Throwable throwable) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable, "Colliding entity with block");
- CrashReportCategory crashreportcategory = crashreport.func_85058_a("Block being collided with");
- CrashReportCategory.func_175750_a(crashreportcategory, blockpos$pooledmutableblockpos2, iblockstate);
- throw new ReportedException(crashreport);
- }
- }
- }
- }
- }
- blockpos$pooledmutableblockpos.func_185344_t();
- blockpos$pooledmutableblockpos1.func_185344_t();
- blockpos$pooledmutableblockpos2.func_185344_t();
- }
- protected void func_191955_a(IBlockState p_191955_1_) {
- }
- protected void func_180429_a(BlockPos p_180429_1_, Block p_180429_2_) {
- SoundType soundtype = p_180429_2_.func_185467_w();
- if(this.field_70170_p.func_180495_p(p_180429_1_.func_177984_a()).func_177230_c() == Blocks.field_150431_aC) {
- soundtype = Blocks.field_150431_aC.func_185467_w();
- this.func_184185_a(soundtype.func_185844_d(), soundtype.func_185843_a() * 0.15F, soundtype.func_185847_b());
- } else if(!p_180429_2_.func_176223_P().func_185904_a().func_76224_d()) {
- this.func_184185_a(soundtype.func_185844_d(), soundtype.func_185843_a() * 0.15F, soundtype.func_185847_b());
- }
- }
- protected float func_191954_d(float p_191954_1_) {
- return 0.0F;
- }
- protected boolean func_191957_ae() {
- return false;
- }
- public void func_184185_a(SoundEvent p_184185_1_, float p_184185_2_, float p_184185_3_) {
- if(!this.func_174814_R()) {
- 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_);
- }
- }
- public boolean func_174814_R() {
- return ((Boolean)this.field_70180_af.func_187225_a(field_184234_aB)).booleanValue();
- }
- public void func_174810_b(boolean p_174810_1_) {
- this.field_70180_af.func_187227_b(field_184234_aB, Boolean.valueOf(p_174810_1_));
- }
- public boolean func_189652_ae() {
- return ((Boolean)this.field_70180_af.func_187225_a(field_189655_aD)).booleanValue();
- }
- public void func_189654_d(boolean p_189654_1_) {
- this.field_70180_af.func_187227_b(field_189655_aD, Boolean.valueOf(p_189654_1_));
- }
- protected boolean func_70041_e_() {
- return true;
- }
- protected void func_184231_a(double p_184231_1_, boolean p_184231_3_, IBlockState p_184231_4_, BlockPos p_184231_5_) {
- if(p_184231_3_) {
- if(this.field_70143_R > 0.0F) {
- p_184231_4_.func_177230_c().func_180658_a(this.field_70170_p, p_184231_5_, this, this.field_70143_R);
- }
- this.field_70143_R = 0.0F;
- } else if(p_184231_1_ < 0.0D) {
- this.field_70143_R = (float)((double)this.field_70143_R - p_184231_1_);
- }
- }
- @Nullable
- public AxisAlignedBB func_70046_E() {
- return null;
- }
- protected void func_70081_e(int p_70081_1_) {
- if(!this.field_70178_ae) {
- this.func_70097_a(DamageSource.field_76372_a, (float)p_70081_1_);
- }
- }
- public final boolean func_70045_F() {
- return this.field_70178_ae;
- }
- public void func_180430_e(float p_180430_1_, float p_180430_2_) {
- if(this.func_184207_aI()) {
- for(Entity entity : this.func_184188_bt()) {
- entity.func_180430_e(p_180430_1_, p_180430_2_);
- }
- }
- }
- public boolean func_70026_G() {
- if(this.field_70171_ac) {
- return true;
- } else {
- BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185345_c(this.field_70165_t, this.field_70163_u, this.field_70161_v);
- 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))) {
- blockpos$pooledmutableblockpos.func_185344_t();
- return false;
- } else {
- blockpos$pooledmutableblockpos.func_185344_t();
- return true;
- }
- }
- }
- public boolean func_70090_H() {
- return this.field_70171_ac;
- }
- public boolean func_191953_am() {
- 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);
- }
- public boolean func_70072_I() {
- if(this.func_184187_bx() instanceof EntityBoat) {
- this.field_70171_ac = false;
- } 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)) {
- if(!this.field_70171_ac && !this.field_70148_d) {
- this.func_71061_d_();
- }
- this.field_70143_R = 0.0F;
- this.field_70171_ac = true;
- this.func_70066_B();
- } else {
- this.field_70171_ac = false;
- }
- return this.field_70171_ac;
- }
- protected void func_71061_d_() {
- Entity entity = this.func_184207_aI() && this.func_184179_bs() != null?this.func_184179_bs():this;
- float f = entity == this?0.2F:0.9F;
- 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;
- if(f1 > 1.0F) {
- f1 = 1.0F;
- }
- this.func_184185_a(this.func_184181_aa(), f1, 1.0F + (this.field_70146_Z.nextFloat() - this.field_70146_Z.nextFloat()) * 0.4F);
- float f2 = (float)MathHelper.func_76128_c(this.func_174813_aQ().field_72338_b);
- for(int i = 0; (float)i < 1.0F + this.field_70130_N * 20.0F; ++i) {
- float f3 = (this.field_70146_Z.nextFloat() * 2.0F - 1.0F) * this.field_70130_N;
- float f4 = (this.field_70146_Z.nextFloat() * 2.0F - 1.0F) * this.field_70130_N;
- 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]);
- }
- for(int j = 0; (float)j < 1.0F + this.field_70130_N * 20.0F; ++j) {
- float f5 = (this.field_70146_Z.nextFloat() * 2.0F - 1.0F) * this.field_70130_N;
- float f6 = (this.field_70146_Z.nextFloat() * 2.0F - 1.0F) * this.field_70130_N;
- 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]);
- }
- }
- public void func_174830_Y() {
- if(this.func_70051_ag() && !this.func_70090_H()) {
- this.func_174808_Z();
- }
- }
- protected void func_174808_Z() {
- int i = MathHelper.func_76128_c(this.field_70165_t);
- int j = MathHelper.func_76128_c(this.field_70163_u - 0.20000000298023224D);
- int k = MathHelper.func_76128_c(this.field_70161_v);
- BlockPos blockpos = new BlockPos(i, j, k);
- IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos);
- if(iblockstate.func_185901_i() != EnumBlockRenderType.INVISIBLE) {
- 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)});
- }
- }
- public boolean func_70055_a(Material p_70055_1_) {
- if(this.func_184187_bx() instanceof EntityBoat) {
- return false;
- } else {
- double d0 = this.field_70163_u + (double)this.func_70047_e();
- BlockPos blockpos = new BlockPos(this.field_70165_t, d0, this.field_70161_v);
- IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos);
- if(iblockstate.func_185904_a() == p_70055_1_) {
- float f = BlockLiquid.func_149801_b(iblockstate.func_177230_c().func_176201_c(iblockstate)) - 0.11111111F;
- float f1 = (float)(blockpos.func_177956_o() + 1) - f;
- boolean flag = d0 < (double)f1;
- return !flag && this instanceof EntityPlayer?false:flag;
- } else {
- return false;
- }
- }
- }
- public boolean func_180799_ab() {
- 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);
- }
- public void func_191958_b(float p_191958_1_, float p_191958_2_, float p_191958_3_, float p_191958_4_) {
- float f = p_191958_1_ * p_191958_1_ + p_191958_2_ * p_191958_2_ + p_191958_3_ * p_191958_3_;
- if(f >= 1.0E-4F) {
- f = MathHelper.func_76129_c(f);
- if(f < 1.0F) {
- f = 1.0F;
- }
- f = p_191958_4_ / f;
- p_191958_1_ = p_191958_1_ * f;
- p_191958_2_ = p_191958_2_ * f;
- p_191958_3_ = p_191958_3_ * f;
- float f1 = MathHelper.func_76126_a(this.field_70177_z * 0.017453292F);
- float f2 = MathHelper.func_76134_b(this.field_70177_z * 0.017453292F);
- this.field_70159_w += (double)(p_191958_1_ * f2 - p_191958_3_ * f1);
- this.field_70181_x += (double)p_191958_2_;
- this.field_70179_y += (double)(p_191958_3_ * f2 + p_191958_1_ * f1);
- }
- }
- @SideOnly(Side.CLIENT)
- public int func_70070_b() {
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(MathHelper.func_76128_c(this.field_70165_t), 0, MathHelper.func_76128_c(this.field_70161_v));
- if(this.field_70170_p.func_175667_e(blockpos$mutableblockpos)) {
- blockpos$mutableblockpos.func_185336_p(MathHelper.func_76128_c(this.field_70163_u + (double)this.func_70047_e()));
- return this.field_70170_p.func_175626_b(blockpos$mutableblockpos, 0);
- } else {
- return 0;
- }
- }
- public float func_70013_c() {
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(MathHelper.func_76128_c(this.field_70165_t), 0, MathHelper.func_76128_c(this.field_70161_v));
- if(this.field_70170_p.func_175667_e(blockpos$mutableblockpos)) {
- blockpos$mutableblockpos.func_185336_p(MathHelper.func_76128_c(this.field_70163_u + (double)this.func_70047_e()));
- return this.field_70170_p.func_175724_o(blockpos$mutableblockpos);
- } else {
- return 0.0F;
- }
- }
- public void func_70029_a(World p_70029_1_) {
- this.field_70170_p = p_70029_1_;
- }
- 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_) {
- this.field_70165_t = MathHelper.func_151237_a(p_70080_1_, -3.0E7D, 3.0E7D);
- this.field_70163_u = p_70080_3_;
- this.field_70161_v = MathHelper.func_151237_a(p_70080_5_, -3.0E7D, 3.0E7D);
- this.field_70169_q = this.field_70165_t;
- this.field_70167_r = this.field_70163_u;
- this.field_70166_s = this.field_70161_v;
- p_70080_8_ = MathHelper.func_76131_a(p_70080_8_, -90.0F, 90.0F);
- this.field_70177_z = p_70080_7_;
- this.field_70125_A = p_70080_8_;
- this.field_70126_B = this.field_70177_z;
- this.field_70127_C = this.field_70125_A;
- double d0 = (double)(this.field_70126_B - p_70080_7_);
- if(d0 < -180.0D) {
- this.field_70126_B += 360.0F;
- }
- if(d0 >= 180.0D) {
- this.field_70126_B -= 360.0F;
- }
- this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v);
- this.func_70101_b(p_70080_7_, p_70080_8_);
- }
- public void func_174828_a(BlockPos p_174828_1_, float p_174828_2_, float p_174828_3_) {
- 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_);
- }
- 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_) {
- this.field_70165_t = p_70012_1_;
- this.field_70163_u = p_70012_3_;
- this.field_70161_v = p_70012_5_;
- this.field_70169_q = this.field_70165_t;
- this.field_70167_r = this.field_70163_u;
- this.field_70166_s = this.field_70161_v;
- this.field_70142_S = this.field_70165_t;
- this.field_70137_T = this.field_70163_u;
- this.field_70136_U = this.field_70161_v;
- this.field_70177_z = p_70012_7_;
- this.field_70125_A = p_70012_8_;
- this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v);
- }
- public float func_70032_d(Entity p_70032_1_) {
- float f = (float)(this.field_70165_t - p_70032_1_.field_70165_t);
- float f1 = (float)(this.field_70163_u - p_70032_1_.field_70163_u);
- float f2 = (float)(this.field_70161_v - p_70032_1_.field_70161_v);
- return MathHelper.func_76129_c(f * f + f1 * f1 + f2 * f2);
- }
- public double func_70092_e(double p_70092_1_, double p_70092_3_, double p_70092_5_) {
- double d0 = this.field_70165_t - p_70092_1_;
- double d1 = this.field_70163_u - p_70092_3_;
- double d2 = this.field_70161_v - p_70092_5_;
- return d0 * d0 + d1 * d1 + d2 * d2;
- }
- public double func_174818_b(BlockPos p_174818_1_) {
- return p_174818_1_.func_177954_c(this.field_70165_t, this.field_70163_u, this.field_70161_v);
- }
- public double func_174831_c(BlockPos p_174831_1_) {
- return p_174831_1_.func_177957_d(this.field_70165_t, this.field_70163_u, this.field_70161_v);
- }
- public double func_70011_f(double p_70011_1_, double p_70011_3_, double p_70011_5_) {
- double d0 = this.field_70165_t - p_70011_1_;
- double d1 = this.field_70163_u - p_70011_3_;
- double d2 = this.field_70161_v - p_70011_5_;
- return (double)MathHelper.func_76133_a(d0 * d0 + d1 * d1 + d2 * d2);
- }
- public double func_70068_e(Entity p_70068_1_) {
- double d0 = this.field_70165_t - p_70068_1_.field_70165_t;
- double d1 = this.field_70163_u - p_70068_1_.field_70163_u;
- double d2 = this.field_70161_v - p_70068_1_.field_70161_v;
- return d0 * d0 + d1 * d1 + d2 * d2;
- }
- public void func_70100_b_(EntityPlayer p_70100_1_) {
- }
- public void func_70108_f(Entity p_70108_1_) {
- if(!this.func_184223_x(p_70108_1_)) {
- if(!p_70108_1_.field_70145_X && !this.field_70145_X) {
- double d0 = p_70108_1_.field_70165_t - this.field_70165_t;
- double d1 = p_70108_1_.field_70161_v - this.field_70161_v;
- double d2 = MathHelper.func_76132_a(d0, d1);
- if(d2 >= 0.009999999776482582D) {
- d2 = (double)MathHelper.func_76133_a(d2);
- d0 = d0 / d2;
- d1 = d1 / d2;
- double d3 = 1.0D / d2;
- if(d3 > 1.0D) {
- d3 = 1.0D;
- }
- d0 = d0 * d3;
- d1 = d1 * d3;
- d0 = d0 * 0.05000000074505806D;
- d1 = d1 * 0.05000000074505806D;
- d0 = d0 * (double)(1.0F - this.field_70144_Y);
- d1 = d1 * (double)(1.0F - this.field_70144_Y);
- if(!this.func_184207_aI()) {
- this.func_70024_g(-d0, 0.0D, -d1);
- }
- if(!p_70108_1_.func_184207_aI()) {
- p_70108_1_.func_70024_g(d0, 0.0D, d1);
- }
- }
- }
- }
- }
- public void func_70024_g(double p_70024_1_, double p_70024_3_, double p_70024_5_) {
- this.field_70159_w += p_70024_1_;
- this.field_70181_x += p_70024_3_;
- this.field_70179_y += p_70024_5_;
- this.field_70160_al = true;
- }
- protected void func_70018_K() {
- this.field_70133_I = true;
- }
- public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) {
- if(this.func_180431_b(p_70097_1_)) {
- return false;
- } else {
- this.func_70018_K();
- return false;
- }
- }
- public Vec3d func_70676_i(float p_70676_1_) {
- if(p_70676_1_ == 1.0F) {
- return this.func_174806_f(this.field_70125_A, this.field_70177_z);
- } else {
- float f = this.field_70127_C + (this.field_70125_A - this.field_70127_C) * p_70676_1_;
- float f1 = this.field_70126_B + (this.field_70177_z - this.field_70126_B) * p_70676_1_;
- return this.func_174806_f(f, f1);
- }
- }
- protected final Vec3d func_174806_f(float p_174806_1_, float p_174806_2_) {
- float f = MathHelper.func_76134_b(-p_174806_2_ * 0.017453292F - 3.1415927F);
- float f1 = MathHelper.func_76126_a(-p_174806_2_ * 0.017453292F - 3.1415927F);
- float f2 = -MathHelper.func_76134_b(-p_174806_1_ * 0.017453292F);
- float f3 = MathHelper.func_76126_a(-p_174806_1_ * 0.017453292F);
- return new Vec3d((double)(f1 * f2), (double)f3, (double)(f * f2));
- }
- public Vec3d func_174824_e(float p_174824_1_) {
- if(p_174824_1_ == 1.0F) {
- return new Vec3d(this.field_70165_t, this.field_70163_u + (double)this.func_70047_e(), this.field_70161_v);
- } else {
- double d0 = this.field_70169_q + (this.field_70165_t - this.field_70169_q) * (double)p_174824_1_;
- double d1 = this.field_70167_r + (this.field_70163_u - this.field_70167_r) * (double)p_174824_1_ + (double)this.func_70047_e();
- double d2 = this.field_70166_s + (this.field_70161_v - this.field_70166_s) * (double)p_174824_1_;
- return new Vec3d(d0, d1, d2);
- }
- }
- @Nullable
- @SideOnly(Side.CLIENT)
- public RayTraceResult func_174822_a(double p_174822_1_, float p_174822_3_) {
- Vec3d vec3d = this.func_174824_e(p_174822_3_);
- Vec3d vec3d1 = this.func_70676_i(p_174822_3_);
- 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_);
- return this.field_70170_p.func_147447_a(vec3d, vec3d2, false, false, true);
- }
- public boolean func_70067_L() {
- return false;
- }
- public boolean func_70104_M() {
- return false;
- }
- public void func_191956_a(Entity p_191956_1_, int p_191956_2_, DamageSource p_191956_3_) {
- if(p_191956_1_ instanceof EntityPlayerMP) {
- CriteriaTriggers.field_192123_c.func_192211_a((EntityPlayerMP)p_191956_1_, this, p_191956_3_);
- }
- }
- @SideOnly(Side.CLIENT)
- public boolean func_145770_h(double p_145770_1_, double p_145770_3_, double p_145770_5_) {
- double d0 = this.field_70165_t - p_145770_1_;
- double d1 = this.field_70163_u - p_145770_3_;
- double d2 = this.field_70161_v - p_145770_5_;
- double d3 = d0 * d0 + d1 * d1 + d2 * d2;
- return this.func_70112_a(d3);
- }
- @SideOnly(Side.CLIENT)
- public boolean func_70112_a(double p_70112_1_) {
- double d0 = this.func_174813_aQ().func_72320_b();
- if(Double.isNaN(d0)) {
- d0 = 1.0D;
- }
- d0 = d0 * 64.0D * field_70155_l;
- return p_70112_1_ < d0 * d0;
- }
- public boolean func_184198_c(NBTTagCompound p_184198_1_) {
- String s = this.func_70022_Q();
- if(!this.field_70128_L && s != null) {
- p_184198_1_.func_74778_a("id", s);
- this.func_189511_e(p_184198_1_);
- return true;
- } else {
- return false;
- }
- }
- public boolean func_70039_c(NBTTagCompound p_70039_1_) {
- String s = this.func_70022_Q();
- if(!this.field_70128_L && s != null && !this.func_184218_aH()) {
- p_70039_1_.func_74778_a("id", s);
- this.func_189511_e(p_70039_1_);
- return true;
- } else {
- return false;
- }
- }
- public static void func_190533_a(DataFixer p_190533_0_) {
- p_190533_0_.func_188258_a(FixTypes.ENTITY, new IDataWalker() {
- public NBTTagCompound func_188266_a(IDataFixer p_188266_1_, NBTTagCompound p_188266_2_, int p_188266_3_) {
- if(p_188266_2_.func_150297_b("Passengers", 9)) {
- NBTTagList nbttaglist = p_188266_2_.func_150295_c("Passengers", 10);
- for(int i = 0; i < nbttaglist.func_74745_c(); ++i) {
- nbttaglist.func_150304_a(i, p_188266_1_.func_188251_a(FixTypes.ENTITY, nbttaglist.func_150305_b(i), p_188266_3_));
- }
- }
- return p_188266_2_;
- }
- });
- }
- public NBTTagCompound func_189511_e(NBTTagCompound p_189511_1_) {
- try {
- 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}));
- 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}));
- p_189511_1_.func_74782_a("Rotation", this.func_70049_a(new float[]{this.field_70177_z, this.field_70125_A}));
- p_189511_1_.func_74776_a("FallDistance", this.field_70143_R);
- p_189511_1_.func_74777_a("Fire", (short)this.field_190534_ay);
- p_189511_1_.func_74777_a("Air", (short)this.func_70086_ai());
- p_189511_1_.func_74757_a("OnGround", this.field_70122_E);
- p_189511_1_.func_74768_a("Dimension", this.field_71093_bK);
- p_189511_1_.func_74757_a("Invulnerable", this.field_83001_bt);
- p_189511_1_.func_74768_a("PortalCooldown", this.field_71088_bW);
- p_189511_1_.func_186854_a("UUID", this.func_110124_au());
- if(this.func_145818_k_()) {
- p_189511_1_.func_74778_a("CustomName", this.func_95999_t());
- }
- if(this.func_174833_aM()) {
- p_189511_1_.func_74757_a("CustomNameVisible", this.func_174833_aM());
- }
- this.field_174837_as.func_179670_b(p_189511_1_);
- if(this.func_174814_R()) {
- p_189511_1_.func_74757_a("Silent", this.func_174814_R());
- }
- if(this.func_189652_ae()) {
- p_189511_1_.func_74757_a("NoGravity", this.func_189652_ae());
- }
- if(this.field_184238_ar) {
- p_189511_1_.func_74757_a("Glowing", this.field_184238_ar);
- }
- if(!this.field_184236_aF.isEmpty()) {
- NBTTagList nbttaglist = new NBTTagList();
- for(String s : this.field_184236_aF) {
- nbttaglist.func_74742_a(new NBTTagString(s));
- }
- p_189511_1_.func_74782_a("Tags", nbttaglist);
- }
- this.func_70014_b(p_189511_1_);
- if(this.func_184207_aI()) {
- NBTTagList nbttaglist1 = new NBTTagList();
- for(Entity entity : this.func_184188_bt()) {
- NBTTagCompound nbttagcompound = new NBTTagCompound();
- if(entity.func_184198_c(nbttagcompound)) {
- nbttaglist1.func_74742_a(nbttagcompound);
- }
- }
- if(!nbttaglist1.func_82582_d()) {
- p_189511_1_.func_74782_a("Passengers", nbttaglist1);
- }
- }
- return p_189511_1_;
- } catch (Throwable throwable) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable, "Saving entity NBT");
- CrashReportCategory crashreportcategory = crashreport.func_85058_a("Entity being saved");
- this.func_85029_a(crashreportcategory);
- throw new ReportedException(crashreport);
- }
- }
- public void func_70020_e(NBTTagCompound p_70020_1_) {
- try {
- NBTTagList nbttaglist = p_70020_1_.func_150295_c("Pos", 6);
- NBTTagList nbttaglist2 = p_70020_1_.func_150295_c("Motion", 6);
- NBTTagList nbttaglist3 = p_70020_1_.func_150295_c("Rotation", 5);
- this.field_70159_w = nbttaglist2.func_150309_d(0);
- this.field_70181_x = nbttaglist2.func_150309_d(1);
- this.field_70179_y = nbttaglist2.func_150309_d(2);
- if(Math.abs(this.field_70159_w) > 10.0D) {
- this.field_70159_w = 0.0D;
- }
- if(Math.abs(this.field_70181_x) > 10.0D) {
- this.field_70181_x = 0.0D;
- }
- if(Math.abs(this.field_70179_y) > 10.0D) {
- this.field_70179_y = 0.0D;
- }
- this.field_70165_t = nbttaglist.func_150309_d(0);
- this.field_70163_u = nbttaglist.func_150309_d(1);
- this.field_70161_v = nbttaglist.func_150309_d(2);
- this.field_70142_S = this.field_70165_t;
- this.field_70137_T = this.field_70163_u;
- this.field_70136_U = this.field_70161_v;
- this.field_70169_q = this.field_70165_t;
- this.field_70167_r = this.field_70163_u;
- this.field_70166_s = this.field_70161_v;
- this.field_70177_z = nbttaglist3.func_150308_e(0);
- this.field_70125_A = nbttaglist3.func_150308_e(1);
- this.field_70126_B = this.field_70177_z;
- this.field_70127_C = this.field_70125_A;
- this.func_70034_d(this.field_70177_z);
- this.func_181013_g(this.field_70177_z);
- this.field_70143_R = p_70020_1_.func_74760_g("FallDistance");
- this.field_190534_ay = p_70020_1_.func_74765_d("Fire");
- this.func_70050_g(p_70020_1_.func_74765_d("Air"));
- this.field_70122_E = p_70020_1_.func_74767_n("OnGround");
- if(p_70020_1_.func_74764_b("Dimension")) {
- this.field_71093_bK = p_70020_1_.func_74762_e("Dimension");
- }
- this.field_83001_bt = p_70020_1_.func_74767_n("Invulnerable");
- this.field_71088_bW = p_70020_1_.func_74762_e("PortalCooldown");
- if(p_70020_1_.func_186855_b("UUID")) {
- this.field_96093_i = p_70020_1_.func_186857_a("UUID");
- this.field_189513_ar = this.field_96093_i.toString();
- }
- this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v);
- this.func_70101_b(this.field_70177_z, this.field_70125_A);
- if(p_70020_1_.func_150297_b("CustomName", 8)) {
- this.func_96094_a(p_70020_1_.func_74779_i("CustomName"));
- }
- this.func_174805_g(p_70020_1_.func_74767_n("CustomNameVisible"));
- this.field_174837_as.func_179668_a(p_70020_1_);
- this.func_174810_b(p_70020_1_.func_74767_n("Silent"));
- this.func_189654_d(p_70020_1_.func_74767_n("NoGravity"));
- this.func_184195_f(p_70020_1_.func_74767_n("Glowing"));
- if(p_70020_1_.func_150297_b("Tags", 9)) {
- this.field_184236_aF.clear();
- NBTTagList nbttaglist1 = p_70020_1_.func_150295_c("Tags", 8);
- int i = Math.min(nbttaglist1.func_74745_c(), 1024);
- for(int j = 0; j < i; ++j) {
- this.field_184236_aF.add(nbttaglist1.func_150307_f(j));
- }
- }
- this.func_70037_a(p_70020_1_);
- if(this.func_142008_O()) {
- this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v);
- }
- } catch (Throwable throwable) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable, "Loading entity NBT");
- CrashReportCategory crashreportcategory = crashreport.func_85058_a("Entity being loaded");
- this.func_85029_a(crashreportcategory);
- throw new ReportedException(crashreport);
- }
- }
- protected boolean func_142008_O() {
- return true;
- }
- @Nullable
- protected final String func_70022_Q() {
- ResourceLocation resourcelocation = EntityList.func_191301_a(this);
- return resourcelocation == null?null:resourcelocation.toString();
- }
- protected abstract void func_70037_a(NBTTagCompound p_70037_1_);
- protected abstract void func_70014_b(NBTTagCompound p_70014_1_);
- protected NBTTagList func_70087_a(double... p_70087_1_) {
- NBTTagList nbttaglist = new NBTTagList();
- for(double d0 : p_70087_1_) {
- nbttaglist.func_74742_a(new NBTTagDouble(d0));
- }
- return nbttaglist;
- }
- protected NBTTagList func_70049_a(float... p_70049_1_) {
- NBTTagList nbttaglist = new NBTTagList();
- for(float f : p_70049_1_) {
- nbttaglist.func_74742_a(new NBTTagFloat(f));
- }
- return nbttaglist;
- }
- @Nullable
- public EntityItem func_145779_a(Item p_145779_1_, int p_145779_2_) {
- return this.func_145778_a(p_145779_1_, p_145779_2_, 0.0F);
- }
- @Nullable
- public EntityItem func_145778_a(Item p_145778_1_, int p_145778_2_, float p_145778_3_) {
- return this.func_70099_a(new ItemStack(p_145778_1_, p_145778_2_, 0), p_145778_3_);
- }
- @Nullable
- public EntityItem func_70099_a(ItemStack p_70099_1_, float p_70099_2_) {
- if(p_70099_1_.func_190926_b()) {
- return null;
- } else {
- 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_);
- entityitem.func_174869_p();
- this.field_70170_p.func_72838_d(entityitem);
- return entityitem;
- }
- }
- public boolean func_70089_S() {
- return !this.field_70128_L;
- }
- public boolean func_70094_T() {
- if(this.field_70145_X) {
- return false;
- } else {
- BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
- for(int i = 0; i < 8; ++i) {
- int j = MathHelper.func_76128_c(this.field_70163_u + (double)(((float)((i >> 0) % 2) - 0.5F) * 0.1F) + (double)this.func_70047_e());
- int k = MathHelper.func_76128_c(this.field_70165_t + (double)(((float)((i >> 1) % 2) - 0.5F) * this.field_70130_N * 0.8F));
- int l = MathHelper.func_76128_c(this.field_70161_v + (double)(((float)((i >> 2) % 2) - 0.5F) * this.field_70130_N * 0.8F));
- if(blockpos$pooledmutableblockpos.func_177958_n() != k || blockpos$pooledmutableblockpos.func_177956_o() != j || blockpos$pooledmutableblockpos.func_177952_p() != l) {
- blockpos$pooledmutableblockpos.func_181079_c(k, j, l);
- if(this.field_70170_p.func_180495_p(blockpos$pooledmutableblockpos).func_191058_s()) {
- blockpos$pooledmutableblockpos.func_185344_t();
- return true;
- }
- }
- }
- blockpos$pooledmutableblockpos.func_185344_t();
- return false;
- }
- }
- public boolean func_184230_a(EntityPlayer p_184230_1_, EnumHand p_184230_2_) {
- return false;
- }
- @Nullable
- public AxisAlignedBB func_70114_g(Entity p_70114_1_) {
- return null;
- }
- public void func_70098_U() {
- Entity entity = this.func_184187_bx();
- if(this.func_184218_aH() && entity.field_70128_L) {
- this.func_184210_p();
- } else {
- this.field_70159_w = 0.0D;
- this.field_70181_x = 0.0D;
- this.field_70179_y = 0.0D;
- this.func_70071_h_();
- if(this.func_184218_aH()) {
- entity.func_184232_k(this);
- }
- }
- }
- public void func_184232_k(Entity p_184232_1_) {
- if(this.func_184196_w(p_184232_1_)) {
- 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);
- }
- }
- @SideOnly(Side.CLIENT)
- public void func_184190_l(Entity p_184190_1_) {
- }
- public double func_70033_W() {
- return 0.0D;
- }
- public double func_70042_X() {
- return (double)this.field_70131_O * 0.75D;
- }
- public boolean func_184220_m(Entity p_184220_1_) {
- return this.func_184205_a(p_184220_1_, false);
- }
- public boolean func_184205_a(Entity p_184205_1_, boolean p_184205_2_) {
- for(Entity entity = p_184205_1_; entity.field_184239_as != null; entity = entity.field_184239_as) {
- if(entity.field_184239_as == this) {
- return false;
- }
- }
- if(p_184205_2_ || this.func_184228_n(p_184205_1_) && p_184205_1_.func_184219_q(this)) {
- if(this.func_184218_aH()) {
- this.func_184210_p();
- }
- this.field_184239_as = p_184205_1_;
- this.field_184239_as.func_184200_o(this);
- return true;
- } else {
- return false;
- }
- }
- protected boolean func_184228_n(Entity p_184228_1_) {
- return this.field_184245_j <= 0;
- }
- public void func_184226_ay() {
- for(int i = this.field_184244_h.size() - 1; i >= 0; --i) {
- ((Entity)this.field_184244_h.get(i)).func_184210_p();
- }
- }
- public void func_184210_p() {
- if(this.field_184239_as != null) {
- Entity entity = this.field_184239_as;
- this.field_184239_as = null;
- entity.func_184225_p(this);
- }
- }
- protected void func_184200_o(Entity p_184200_1_) {
- if(p_184200_1_.func_184187_bx() != this) {
- throw new IllegalStateException("Use x.startRiding(y), not y.addPassenger(x)");
- } else {
- if(!this.field_70170_p.field_72995_K && p_184200_1_ instanceof EntityPlayer && !(this.func_184179_bs() instanceof EntityPlayer)) {
- this.field_184244_h.add(0, p_184200_1_);
- } else {
- this.field_184244_h.add(p_184200_1_);
- }
- }
- }
- protected void func_184225_p(Entity p_184225_1_) {
- if(p_184225_1_.func_184187_bx() == this) {
- throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)");
- } else {
- this.field_184244_h.remove(p_184225_1_);
- p_184225_1_.field_184245_j = 60;
- }
- }
- protected boolean func_184219_q(Entity p_184219_1_) {
- return this.func_184188_bt().size() < 1;
- }
- @SideOnly(Side.CLIENT)
- 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_) {
- this.func_70107_b(p_180426_1_, p_180426_3_, p_180426_5_);
- this.func_70101_b(p_180426_7_, p_180426_8_);
- }
- public float func_70111_Y() {
- return 0.0F;
- }
- public Vec3d func_70040_Z() {
- return this.func_174806_f(this.field_70125_A, this.field_70177_z);
- }
- @SideOnly(Side.CLIENT)
- public Vec2f func_189653_aC() {
- return new Vec2f(this.field_70125_A, this.field_70177_z);
- }
- @SideOnly(Side.CLIENT)
- public Vec3d func_189651_aD() {
- return Vec3d.func_189984_a(this.func_189653_aC());
- }
- public void func_181015_d(BlockPos p_181015_1_) {
- if(this.field_71088_bW > 0) {
- this.field_71088_bW = this.func_82147_ab();
- } else {
- if(!this.field_70170_p.field_72995_K && !p_181015_1_.equals(this.field_181016_an)) {
- this.field_181016_an = new BlockPos(p_181015_1_);
- BlockPattern.PatternHelper blockpattern$patternhelper = Blocks.field_150427_aO.func_181089_f(this.field_70170_p, this.field_181016_an);
- 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();
- double d1 = blockpattern$patternhelper.func_177669_b().func_176740_k() == EnumFacing.Axis.X?this.field_70161_v:this.field_70165_t;
- 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()));
- 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()));
- this.field_181017_ao = new Vec3d(d1, d2, 0.0D);
- this.field_181018_ap = blockpattern$patternhelper.func_177669_b();
- }
- this.field_71087_bX = true;
- }
- }
- public int func_82147_ab() {
- return 300;
- }
- @SideOnly(Side.CLIENT)
- public void func_70016_h(double p_70016_1_, double p_70016_3_, double p_70016_5_) {
- this.field_70159_w = p_70016_1_;
- this.field_70181_x = p_70016_3_;
- this.field_70179_y = p_70016_5_;
- }
- @SideOnly(Side.CLIENT)
- public void func_70103_a(byte p_70103_1_) {
- }
- @SideOnly(Side.CLIENT)
- public void func_70057_ab() {
- }
- public Iterable<ItemStack> func_184214_aD() {
- return field_190535_b;
- }
- public Iterable<ItemStack> func_184193_aE() {
- return field_190535_b;
- }
- public Iterable<ItemStack> func_184209_aF() {
- return Iterables.<ItemStack>concat(this.func_184214_aD(), this.func_184193_aE());
- }
- public void func_184201_a(EntityEquipmentSlot p_184201_1_, ItemStack p_184201_2_) {
- }
- public boolean func_70027_ad() {
- boolean flag = this.field_70170_p != null && this.field_70170_p.field_72995_K;
- return !this.field_70178_ae && (this.field_190534_ay > 0 || flag && this.func_70083_f(0));
- }
- public boolean func_184218_aH() {
- return this.func_184187_bx() != null;
- }
- public boolean func_184207_aI() {
- return !this.func_184188_bt().isEmpty();
- }
- public boolean func_70093_af() {
- return this.func_70083_f(1);
- }
- public void func_70095_a(boolean p_70095_1_) {
- this.func_70052_a(1, p_70095_1_);
- }
- public boolean func_70051_ag() {
- return this.func_70083_f(3);
- }
- public void func_70031_b(boolean p_70031_1_) {
- this.func_70052_a(3, p_70031_1_);
- }
- public boolean func_184202_aL() {
- return this.field_184238_ar || this.field_70170_p.field_72995_K && this.func_70083_f(6);
- }
- public void func_184195_f(boolean p_184195_1_) {
- this.field_184238_ar = p_184195_1_;
- if(!this.field_70170_p.field_72995_K) {
- this.func_70052_a(6, this.field_184238_ar);
- }
- }
- public boolean func_82150_aj() {
- return this.func_70083_f(5);
- }
- @SideOnly(Side.CLIENT)
- public boolean func_98034_c(EntityPlayer p_98034_1_) {
- if(p_98034_1_.func_175149_v()) {
- return false;
- } else {
- Team team = this.func_96124_cp();
- return team != null && p_98034_1_ != null && p_98034_1_.func_96124_cp() == team && team.func_98297_h()?false:this.func_82150_aj();
- }
- }
- @Nullable
- public Team func_96124_cp() {
- return this.field_70170_p.func_96441_U().func_96509_i(this.func_189512_bd());
- }
- public boolean func_184191_r(Entity p_184191_1_) {
- return this.func_184194_a(p_184191_1_.func_96124_cp());
- }
- public boolean func_184194_a(Team p_184194_1_) {
- return this.func_96124_cp() != null?this.func_96124_cp().func_142054_a(p_184194_1_):false;
- }
- public void func_82142_c(boolean p_82142_1_) {
- this.func_70052_a(5, p_82142_1_);
- }
- protected boolean func_70083_f(int p_70083_1_) {
- return (((Byte)this.field_70180_af.func_187225_a(field_184240_ax)).byteValue() & 1 << p_70083_1_) != 0;
- }
- protected void func_70052_a(int p_70052_1_, boolean p_70052_2_) {
- byte b0 = ((Byte)this.field_70180_af.func_187225_a(field_184240_ax)).byteValue();
- if(p_70052_2_) {
- this.field_70180_af.func_187227_b(field_184240_ax, Byte.valueOf((byte)(b0 | 1 << p_70052_1_)));
- } else {
- this.field_70180_af.func_187227_b(field_184240_ax, Byte.valueOf((byte)(b0 & ~(1 << p_70052_1_))));
- }
- }
- public int func_70086_ai() {
- return ((Integer)this.field_70180_af.func_187225_a(field_184241_ay)).intValue();
- }
- public void func_70050_g(int p_70050_1_) {
- this.field_70180_af.func_187227_b(field_184241_ay, Integer.valueOf(p_70050_1_));
- }
- public void func_70077_a(EntityLightningBolt p_70077_1_) {
- this.func_70097_a(DamageSource.field_180137_b, 5.0F);
- ++this.field_190534_ay;
- if(this.field_190534_ay == 0) {
- this.func_70015_d(8);
- }
- }
- public void func_70074_a(EntityLivingBase p_70074_1_) {
- }
- protected boolean func_145771_j(double p_145771_1_, double p_145771_3_, double p_145771_5_) {
- BlockPos blockpos = new BlockPos(p_145771_1_, p_145771_3_, p_145771_5_);
- double d0 = p_145771_1_ - (double)blockpos.func_177958_n();
- double d1 = p_145771_3_ - (double)blockpos.func_177956_o();
- double d2 = p_145771_5_ - (double)blockpos.func_177952_p();
- if(!this.field_70170_p.func_184143_b(this.func_174813_aQ())) {
- return false;
- } else {
- EnumFacing enumfacing = EnumFacing.UP;
- double d3 = Double.MAX_VALUE;
- if(!this.field_70170_p.func_175665_u(blockpos.func_177976_e()) && d0 < d3) {
- d3 = d0;
- enumfacing = EnumFacing.WEST;
- }
- if(!this.field_70170_p.func_175665_u(blockpos.func_177974_f()) && 1.0D - d0 < d3) {
- d3 = 1.0D - d0;
- enumfacing = EnumFacing.EAST;
- }
- if(!this.field_70170_p.func_175665_u(blockpos.func_177978_c()) && d2 < d3) {
- d3 = d2;
- enumfacing = EnumFacing.NORTH;
- }
- if(!this.field_70170_p.func_175665_u(blockpos.func_177968_d()) && 1.0D - d2 < d3) {
- d3 = 1.0D - d2;
- enumfacing = EnumFacing.SOUTH;
- }
- if(!this.field_70170_p.func_175665_u(blockpos.func_177984_a()) && 1.0D - d1 < d3) {
- d3 = 1.0D - d1;
- enumfacing = EnumFacing.UP;
- }
- float f = this.field_70146_Z.nextFloat() * 0.2F + 0.1F;
- float f1 = (float)enumfacing.func_176743_c().func_179524_a();
- if(enumfacing.func_176740_k() == EnumFacing.Axis.X) {
- this.field_70159_w = (double)(f1 * f);
- this.field_70181_x *= 0.75D;
- this.field_70179_y *= 0.75D;
- } else if(enumfacing.func_176740_k() == EnumFacing.Axis.Y) {
- this.field_70159_w *= 0.75D;
- this.field_70181_x = (double)(f1 * f);
- this.field_70179_y *= 0.75D;
- } else if(enumfacing.func_176740_k() == EnumFacing.Axis.Z) {
- this.field_70159_w *= 0.75D;
- this.field_70181_x *= 0.75D;
- this.field_70179_y = (double)(f1 * f);
- }
- return true;
- }
- }
- public void func_70110_aj() {
- this.field_70134_J = true;
- this.field_70143_R = 0.0F;
- }
- public String func_70005_c_() {
- if(this.func_145818_k_()) {
- return this.func_95999_t();
- } else {
- String s = EntityList.func_75621_b(this);
- if(s == null) {
- s = "generic";
- }
- return I18n.func_74838_a("entity." + s + ".name");
- }
- }
- @Nullable
- public Entity[] func_70021_al() {
- return null;
- }
- public boolean func_70028_i(Entity p_70028_1_) {
- return this == p_70028_1_;
- }
- public float func_70079_am() {
- return 0.0F;
- }
- public void func_70034_d(float p_70034_1_) {
- }
- public void func_181013_g(float p_181013_1_) {
- }
- public boolean func_70075_an() {
- return true;
- }
- public boolean func_85031_j(Entity p_85031_1_) {
- return false;
- }
- public String toString() {
- 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)});
- }
- public boolean func_180431_b(DamageSource p_180431_1_) {
- return this.field_83001_bt && p_180431_1_ != DamageSource.field_76380_i && !p_180431_1_.func_180136_u();
- }
- public boolean func_190530_aW() {
- return this.field_83001_bt;
- }
- public void func_184224_h(boolean p_184224_1_) {
- this.field_83001_bt = p_184224_1_;
- }
- public void func_82149_j(Entity p_82149_1_) {
- 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);
- }
- private void func_180432_n(Entity p_180432_1_) {
- NBTTagCompound nbttagcompound = p_180432_1_.func_189511_e(new NBTTagCompound());
- nbttagcompound.func_82580_o("Dimension");
- this.func_70020_e(nbttagcompound);
- this.field_71088_bW = p_180432_1_.field_71088_bW;
- this.field_181016_an = p_180432_1_.field_181016_an;
- this.field_181017_ao = p_180432_1_.field_181017_ao;
- this.field_181018_ap = p_180432_1_.field_181018_ap;
- }
- @Nullable
- public Entity func_184204_a(int p_184204_1_) {
- if(!this.field_70170_p.field_72995_K && !this.field_70128_L) {
- this.field_70170_p.field_72984_F.func_76320_a("changeDimension");
- MinecraftServer minecraftserver = this.func_184102_h();
- int i = this.field_71093_bK;
- WorldServer worldserver = minecraftserver.func_71218_a(i);
- WorldServer worldserver1 = minecraftserver.func_71218_a(p_184204_1_);
- this.field_71093_bK = p_184204_1_;
- if(i == 1 && p_184204_1_ == 1) {
- worldserver1 = minecraftserver.func_71218_a(0);
- this.field_71093_bK = 0;
- }
- this.field_70170_p.func_72900_e(this);
- this.field_70128_L = false;
- this.field_70170_p.field_72984_F.func_76320_a("reposition");
- BlockPos blockpos;
- if(p_184204_1_ == 1) {
- blockpos = worldserver1.func_180504_m();
- } else {
- double d0 = this.field_70165_t;
- double d1 = this.field_70161_v;
- double d2 = 8.0D;
- if(p_184204_1_ == -1) {
- 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);
- 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);
- } else if(p_184204_1_ == 0) {
- 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);
- 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);
- }
- d0 = (double)MathHelper.func_76125_a((int)d0, -29999872, 29999872);
- d1 = (double)MathHelper.func_76125_a((int)d1, -29999872, 29999872);
- float f = this.field_70177_z;
- this.func_70012_b(d0, this.field_70163_u, d1, 90.0F, 0.0F);
- Teleporter teleporter = worldserver1.func_85176_s();
- teleporter.func_180620_b(this, f);
- blockpos = new BlockPos(this);
- }
- worldserver.func_72866_a(this, false);
- this.field_70170_p.field_72984_F.func_76318_c("reloading");
- Entity entity = EntityList.func_191304_a(this.getClass(), worldserver1);
- if(entity != null) {
- entity.func_180432_n(this);
- if(i == 1 && p_184204_1_ == 1) {
- BlockPos blockpos1 = worldserver1.func_175672_r(worldserver1.func_175694_M());
- entity.func_174828_a(blockpos1, entity.field_70177_z, entity.field_70125_A);
- } else {
- entity.func_174828_a(blockpos, entity.field_70177_z, entity.field_70125_A);
- }
- boolean flag = entity.field_98038_p;
- entity.field_98038_p = true;
- worldserver1.func_72838_d(entity);
- entity.field_98038_p = flag;
- worldserver1.func_72866_a(entity, false);
- }
- this.field_70128_L = true;
- this.field_70170_p.field_72984_F.func_76319_b();
- worldserver.func_82742_i();
- worldserver1.func_82742_i();
- this.field_70170_p.field_72984_F.func_76319_b();
- return entity;
- } else {
- return null;
- }
- }
- public boolean func_184222_aU() {
- return true;
- }
- public float func_180428_a(Explosion p_180428_1_, World p_180428_2_, BlockPos p_180428_3_, IBlockState p_180428_4_) {
- return p_180428_4_.func_177230_c().func_149638_a(this);
- }
- 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_) {
- return true;
- }
- public int func_82143_as() {
- return 3;
- }
- public Vec3d func_181014_aG() {
- return this.field_181017_ao;
- }
- public EnumFacing func_181012_aH() {
- return this.field_181018_ap;
- }
- public boolean func_145773_az() {
- return false;
- }
- public void func_85029_a(CrashReportCategory p_85029_1_) {
- p_85029_1_.func_189529_a("Entity Type", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return EntityList.func_191301_a(Entity.this) + " (" + Entity.this.getClass().getCanonicalName() + ")";
- }
- });
- p_85029_1_.func_71507_a("Entity ID", Integer.valueOf(this.field_145783_c));
- p_85029_1_.func_189529_a("Entity Name", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return Entity.this.func_70005_c_();
- }
- });
- 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)}));
- 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)));
- 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)}));
- p_85029_1_.func_189529_a("Entity\'s Passengers", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return Entity.this.func_184188_bt().toString();
- }
- });
- p_85029_1_.func_189529_a("Entity\'s Vehicle", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return Entity.this.func_184187_bx().toString();
- }
- });
- }
- public void func_184221_a(UUID p_184221_1_) {
- this.field_96093_i = p_184221_1_;
- this.field_189513_ar = this.field_96093_i.toString();
- }
- @SideOnly(Side.CLIENT)
- public boolean func_90999_ad() {
- return this.func_70027_ad();
- }
- public UUID func_110124_au() {
- return this.field_96093_i;
- }
- public String func_189512_bd() {
- return this.field_189513_ar;
- }
- public boolean func_96092_aw() {
- return true;
- }
- @SideOnly(Side.CLIENT)
- public static double func_184183_bd() {
- return field_70155_l;
- }
- @SideOnly(Side.CLIENT)
- public static void func_184227_b(double p_184227_0_) {
- field_70155_l = p_184227_0_;
- }
- public ITextComponent func_145748_c_() {
- TextComponentString textcomponentstring = new TextComponentString(ScorePlayerTeam.func_96667_a(this.func_96124_cp(), this.func_70005_c_()));
- textcomponentstring.func_150256_b().func_150209_a(this.func_174823_aP());
- textcomponentstring.func_150256_b().func_179989_a(this.func_189512_bd());
- return textcomponentstring;
- }
- public void func_96094_a(String p_96094_1_) {
- this.field_70180_af.func_187227_b(field_184242_az, p_96094_1_);
- }
- public String func_95999_t() {
- return (String)this.field_70180_af.func_187225_a(field_184242_az);
- }
- public boolean func_145818_k_() {
- return !((String)this.field_70180_af.func_187225_a(field_184242_az)).isEmpty();
- }
- public void func_174805_g(boolean p_174805_1_) {
- this.field_70180_af.func_187227_b(field_184233_aA, Boolean.valueOf(p_174805_1_));
- }
- public boolean func_174833_aM() {
- return ((Boolean)this.field_70180_af.func_187225_a(field_184233_aA)).booleanValue();
- }
- public void func_70634_a(double p_70634_1_, double p_70634_3_, double p_70634_5_) {
- this.field_184237_aG = true;
- this.func_70012_b(p_70634_1_, p_70634_3_, p_70634_5_, this.field_70177_z, this.field_70125_A);
- this.field_70170_p.func_72866_a(this, false);
- }
- public void func_184206_a(DataParameter<?> p_184206_1_) {
- }
- @SideOnly(Side.CLIENT)
- public boolean func_94059_bO() {
- return this.func_174833_aM();
- }
- public EnumFacing func_174811_aO() {
- return EnumFacing.func_176731_b(MathHelper.func_76128_c((double)(this.field_70177_z * 4.0F / 360.0F) + 0.5D) & 3);
- }
- public EnumFacing func_184172_bi() {
- return this.func_174811_aO();
- }
- protected HoverEvent func_174823_aP() {
- NBTTagCompound nbttagcompound = new NBTTagCompound();
- ResourceLocation resourcelocation = EntityList.func_191301_a(this);
- nbttagcompound.func_74778_a("id", this.func_189512_bd());
- if(resourcelocation != null) {
- nbttagcompound.func_74778_a("type", resourcelocation.toString());
- }
- nbttagcompound.func_74778_a("name", this.func_70005_c_());
- return new HoverEvent(HoverEvent.Action.SHOW_ENTITY, new TextComponentString(nbttagcompound.toString()));
- }
- public boolean func_174827_a(EntityPlayerMP p_174827_1_) {
- return true;
- }
- public AxisAlignedBB func_174813_aQ() {
- return this.field_70121_D;
- }
- @SideOnly(Side.CLIENT)
- public AxisAlignedBB func_184177_bl() {
- return this.func_174813_aQ();
- }
- public void func_174826_a(AxisAlignedBB p_174826_1_) {
- this.field_70121_D = p_174826_1_;
- }
- public float func_70047_e() {
- return this.field_70131_O * 0.85F;
- }
- public boolean func_174832_aS() {
- return this.field_174835_g;
- }
- public void func_174821_h(boolean p_174821_1_) {
- this.field_174835_g = p_174821_1_;
- }
- public boolean func_174820_d(int p_174820_1_, ItemStack p_174820_2_) {
- return false;
- }
- public void func_145747_a(ITextComponent p_145747_1_) {
- }
- public boolean func_70003_b(int p_70003_1_, String p_70003_2_) {
- return true;
- }
- public BlockPos func_180425_c() {
- return new BlockPos(this.field_70165_t, this.field_70163_u + 0.5D, this.field_70161_v);
- }
- public Vec3d func_174791_d() {
- return new Vec3d(this.field_70165_t, this.field_70163_u, this.field_70161_v);
- }
- public World func_130014_f_() {
- return this.field_70170_p;
- }
- public Entity func_174793_f() {
- return this;
- }
- public boolean func_174792_t_() {
- return false;
- }
- public void func_174794_a(CommandResultStats.Type p_174794_1_, int p_174794_2_) {
- if(this.field_70170_p != null && !this.field_70170_p.field_72995_K) {
- this.field_174837_as.func_184932_a(this.field_70170_p.func_73046_m(), this, p_174794_1_, p_174794_2_);
- }
- }
- @Nullable
- public MinecraftServer func_184102_h() {
- return this.field_70170_p.func_73046_m();
- }
- public CommandResultStats func_174807_aT() {
- return this.field_174837_as;
- }
- public void func_174817_o(Entity p_174817_1_) {
- this.field_174837_as.func_179671_a(p_174817_1_.func_174807_aT());
- }
- public EnumActionResult func_184199_a(EntityPlayer p_184199_1_, Vec3d p_184199_2_, EnumHand p_184199_3_) {
- return EnumActionResult.PASS;
- }
- public boolean func_180427_aV() {
- return false;
- }
- protected void func_174815_a(EntityLivingBase p_174815_1_, Entity p_174815_2_) {
- if(p_174815_2_ instanceof EntityLivingBase) {
- EnchantmentHelper.func_151384_a((EntityLivingBase)p_174815_2_, p_174815_1_);
- }
- EnchantmentHelper.func_151385_b(p_174815_1_, p_174815_2_);
- }
- public void func_184178_b(EntityPlayerMP p_184178_1_) {
- }
- public void func_184203_c(EntityPlayerMP p_184203_1_) {
- }
- public float func_184229_a(Rotation p_184229_1_) {
- float f = MathHelper.func_76142_g(this.field_70177_z);
- switch(p_184229_1_) {
- case CLOCKWISE_180:
- return f + 180.0F;
- case COUNTERCLOCKWISE_90:
- return f + 270.0F;
- case CLOCKWISE_90:
- return f + 90.0F;
- default:
- return f;
- }
- }
- public float func_184217_a(Mirror p_184217_1_) {
- float f = MathHelper.func_76142_g(this.field_70177_z);
- switch(p_184217_1_) {
- case LEFT_RIGHT:
- return -f;
- case FRONT_BACK:
- return 180.0F - f;
- default:
- return f;
- }
- }
- public boolean func_184213_bq() {
- return false;
- }
- public boolean func_184189_br() {
- boolean flag = this.field_184237_aG;
- this.field_184237_aG = false;
- return flag;
- }
- @Nullable
- public Entity func_184179_bs() {
- return null;
- }
- public List<Entity> func_184188_bt() {
- return (List<Entity>)(this.field_184244_h.isEmpty()?Collections.emptyList():Lists.newArrayList(this.field_184244_h));
- }
- public boolean func_184196_w(Entity p_184196_1_) {
- for(Entity entity : this.func_184188_bt()) {
- if(entity.equals(p_184196_1_)) {
- return true;
- }
- }
- return false;
- }
- public Collection<Entity> func_184182_bu() {
- Set<Entity> set = Sets.<Entity>newHashSet();
- this.func_184175_a(Entity.class, set);
- return set;
- }
- public <T extends Entity> Collection<T> func_184180_b(Class<T> p_184180_1_) {
- Set<T> set = Sets.<T>newHashSet();
- this.func_184175_a(p_184180_1_, set);
- return set;
- }
- private <T extends Entity> void func_184175_a(Class<T> p_184175_1_, Set<T> p_184175_2_) {
- for(Entity entity : this.func_184188_bt()) {
- if(p_184175_1_.isAssignableFrom(entity.getClass())) {
- p_184175_2_.add(entity);
- }
- entity.func_184175_a(p_184175_1_, p_184175_2_);
- }
- }
- public Entity func_184208_bv() {
- Entity entity;
- for(entity = this; entity.func_184218_aH(); entity = entity.func_184187_bx()) {
- ;
- }
- return entity;
- }
- public boolean func_184223_x(Entity p_184223_1_) {
- return this.func_184208_bv() == p_184223_1_.func_184208_bv();
- }
- public boolean func_184215_y(Entity p_184215_1_) {
- for(Entity entity : this.func_184188_bt()) {
- if(entity.equals(p_184215_1_)) {
- return true;
- }
- if(entity.func_184215_y(p_184215_1_)) {
- return true;
- }
- }
- return false;
- }
- public boolean func_184186_bw() {
- Entity entity = this.func_184179_bs();
- return entity instanceof EntityPlayer?((EntityPlayer)entity).func_175144_cb():!this.field_70170_p.field_72995_K;
- }
- @Nullable
- public Entity func_184187_bx() {
- return this.field_184239_as;
- }
- public EnumPushReaction func_184192_z() {
- return EnumPushReaction.NORMAL;
- }
- public SoundCategory func_184176_by() {
- return SoundCategory.NEUTRAL;
- }
- protected int func_190531_bD() {
- return 1;
- }
- }
- Patching failed: minecraft\net\minecraft\entity\EntityList.java
- Hunk 1 failed! Cannot find hunk target
- field_191309_d.add(resourcelocation);
- while(field_191311_g.size() <= p_191303_0_) {
- - field_191311_g.add((Object)null);
- + field_191311_g.add(null);
- }
- field_191311_g.set(p_191303_0_, p_191303_3_);
- File state
- package net.minecraft.entity;
- import com.google.common.collect.Lists;
- import com.google.common.collect.Maps;
- import com.google.common.collect.Sets;
- import java.util.List;
- import java.util.Map;
- import java.util.Set;
- import javax.annotation.Nullable;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.EntityAreaEffectCloud;
- import net.minecraft.entity.EntityLeashKnot;
- import net.minecraft.entity.boss.EntityDragon;
- import net.minecraft.entity.boss.EntityWither;
- import net.minecraft.entity.effect.EntityLightningBolt;
- import net.minecraft.entity.item.EntityArmorStand;
- import net.minecraft.entity.item.EntityBoat;
- import net.minecraft.entity.item.EntityEnderCrystal;
- import net.minecraft.entity.item.EntityEnderEye;
- import net.minecraft.entity.item.EntityEnderPearl;
- import net.minecraft.entity.item.EntityExpBottle;
- import net.minecraft.entity.item.EntityFallingBlock;
- import net.minecraft.entity.item.EntityFireworkRocket;
- import net.minecraft.entity.item.EntityItem;
- import net.minecraft.entity.item.EntityItemFrame;
- import net.minecraft.entity.item.EntityMinecart;
- import net.minecraft.entity.item.EntityMinecartChest;
- import net.minecraft.entity.item.EntityMinecartCommandBlock;
- import net.minecraft.entity.item.EntityMinecartEmpty;
- import net.minecraft.entity.item.EntityMinecartFurnace;
- import net.minecraft.entity.item.EntityMinecartHopper;
- import net.minecraft.entity.item.EntityMinecartMobSpawner;
- import net.minecraft.entity.item.EntityMinecartTNT;
- import net.minecraft.entity.item.EntityPainting;
- import net.minecraft.entity.item.EntityTNTPrimed;
- import net.minecraft.entity.item.EntityXPOrb;
- import net.minecraft.entity.monster.EntityBlaze;
- import net.minecraft.entity.monster.EntityCaveSpider;
- import net.minecraft.entity.monster.EntityCreeper;
- import net.minecraft.entity.monster.EntityElderGuardian;
- import net.minecraft.entity.monster.EntityEnderman;
- import net.minecraft.entity.monster.EntityEndermite;
- import net.minecraft.entity.monster.EntityEvoker;
- import net.minecraft.entity.monster.EntityGhast;
- import net.minecraft.entity.monster.EntityGiantZombie;
- import net.minecraft.entity.monster.EntityGuardian;
- import net.minecraft.entity.monster.EntityHusk;
- import net.minecraft.entity.monster.EntityIllusionIllager;
- import net.minecraft.entity.monster.EntityIronGolem;
- import net.minecraft.entity.monster.EntityMagmaCube;
- import net.minecraft.entity.monster.EntityPigZombie;
- import net.minecraft.entity.monster.EntityPolarBear;
- import net.minecraft.entity.monster.EntityShulker;
- import net.minecraft.entity.monster.EntitySilverfish;
- import net.minecraft.entity.monster.EntitySkeleton;
- import net.minecraft.entity.monster.EntitySlime;
- import net.minecraft.entity.monster.EntitySnowman;
- import net.minecraft.entity.monster.EntitySpider;
- import net.minecraft.entity.monster.EntityStray;
- import net.minecraft.entity.monster.EntityVex;
- import net.minecraft.entity.monster.EntityVindicator;
- import net.minecraft.entity.monster.EntityWitch;
- import net.minecraft.entity.monster.EntityWitherSkeleton;
- import net.minecraft.entity.monster.EntityZombie;
- import net.minecraft.entity.monster.EntityZombieVillager;
- import net.minecraft.entity.passive.EntityBat;
- import net.minecraft.entity.passive.EntityChicken;
- import net.minecraft.entity.passive.EntityCow;
- import net.minecraft.entity.passive.EntityDonkey;
- import net.minecraft.entity.passive.EntityHorse;
- import net.minecraft.entity.passive.EntityLlama;
- import net.minecraft.entity.passive.EntityMooshroom;
- import net.minecraft.entity.passive.EntityMule;
- import net.minecraft.entity.passive.EntityOcelot;
- import net.minecraft.entity.passive.EntityParrot;
- import net.minecraft.entity.passive.EntityPig;
- import net.minecraft.entity.passive.EntityRabbit;
- import net.minecraft.entity.passive.EntitySheep;
- import net.minecraft.entity.passive.EntitySkeletonHorse;
- import net.minecraft.entity.passive.EntitySquid;
- import net.minecraft.entity.passive.EntityVillager;
- import net.minecraft.entity.passive.EntityWolf;
- import net.minecraft.entity.passive.EntityZombieHorse;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.entity.projectile.EntityDragonFireball;
- import net.minecraft.entity.projectile.EntityEgg;
- import net.minecraft.entity.projectile.EntityEvokerFangs;
- import net.minecraft.entity.projectile.EntityLargeFireball;
- import net.minecraft.entity.projectile.EntityLlamaSpit;
- import net.minecraft.entity.projectile.EntityPotion;
- import net.minecraft.entity.projectile.EntityShulkerBullet;
- import net.minecraft.entity.projectile.EntitySmallFireball;
- import net.minecraft.entity.projectile.EntitySnowball;
- import net.minecraft.entity.projectile.EntitySpectralArrow;
- import net.minecraft.entity.projectile.EntityTippedArrow;
- import net.minecraft.entity.projectile.EntityWitherSkull;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.stats.StatBase;
- import net.minecraft.stats.StatList;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.util.registry.RegistryNamespaced;
- import net.minecraft.world.World;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- import org.apache.logging.log4j.LogManager;
- import org.apache.logging.log4j.Logger;
- public class EntityList {
- public static final ResourceLocation field_191307_a = new ResourceLocation("lightning_bolt");
- private static final ResourceLocation field_191310_e = new ResourceLocation("player");
- private static final Logger field_151516_b = LogManager.getLogger();
- public static final RegistryNamespaced<ResourceLocation, Class<? extends Entity>> field_191308_b = new RegistryNamespaced();
- public static final Map<ResourceLocation, EntityList.EntityEggInfo> field_75627_a = Maps.<ResourceLocation, EntityList.EntityEggInfo>newLinkedHashMap();
- public static final Set<ResourceLocation> field_191309_d = Sets.<ResourceLocation>newHashSet();
- private static final List<String> field_191311_g = Lists.<String>newArrayList();
- @Nullable
- public static ResourceLocation func_191301_a(Entity p_191301_0_) {
- return func_191306_a(p_191301_0_.getClass());
- }
- @Nullable
- public static ResourceLocation func_191306_a(Class<? extends Entity> p_191306_0_) {
- return (ResourceLocation)field_191308_b.func_177774_c(p_191306_0_);
- }
- @Nullable
- public static String func_75621_b(Entity p_75621_0_) {
- int i = field_191308_b.func_148757_b(p_75621_0_.getClass());
- return i == -1?null:(String)field_191311_g.get(i);
- }
- @Nullable
- public static String func_191302_a(@Nullable ResourceLocation p_191302_0_) {
- int i = field_191308_b.func_148757_b(field_191308_b.func_82594_a(p_191302_0_));
- return i == -1?null:(String)field_191311_g.get(i);
- }
- @Nullable
- @SideOnly(Side.CLIENT)
- public static Class<? extends Entity> func_90035_a(int p_90035_0_) {
- return (Class)field_191308_b.func_148754_a(p_90035_0_);
- }
- @Nullable
- @SideOnly(Side.CLIENT)
- public static Class<? extends Entity> func_192839_a(String p_192839_0_) {
- return (Class)field_191308_b.func_82594_a(new ResourceLocation(p_192839_0_));
- }
- @Nullable
- public static Entity func_191304_a(@Nullable Class<? extends Entity> p_191304_0_, World p_191304_1_) {
- if(p_191304_0_ == null) {
- return null;
- } else {
- try {
- return (Entity)p_191304_0_.getConstructor(new Class[]{World.class}).newInstance(new Object[]{p_191304_1_});
- } catch (Exception exception) {
- exception.printStackTrace();
- return null;
- }
- }
- }
- @Nullable
- @SideOnly(Side.CLIENT)
- public static Entity func_75616_a(int p_75616_0_, World p_75616_1_) {
- return func_191304_a(func_90035_a(p_75616_0_), p_75616_1_);
- }
- @Nullable
- public static Entity func_188429_b(ResourceLocation p_188429_0_, World p_188429_1_) {
- return func_191304_a((Class)field_191308_b.func_82594_a(p_188429_0_), p_188429_1_);
- }
- @Nullable
- public static Entity func_75615_a(NBTTagCompound p_75615_0_, World p_75615_1_) {
- ResourceLocation resourcelocation = new ResourceLocation(p_75615_0_.func_74779_i("id"));
- Entity entity = func_188429_b(resourcelocation, p_75615_1_);
- if(entity == null) {
- field_151516_b.warn((String)"Skipping Entity with id {}", (Object)resourcelocation);
- } else {
- entity.func_70020_e(p_75615_0_);
- }
- return entity;
- }
- public static Set<ResourceLocation> func_180124_b() {
- return field_191309_d;
- }
- public static boolean func_180123_a(Entity p_180123_0_, ResourceLocation p_180123_1_) {
- ResourceLocation resourcelocation = func_191306_a(p_180123_0_.getClass());
- 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));
- }
- public static boolean func_180125_b(ResourceLocation p_180125_0_) {
- return field_191310_e.equals(p_180125_0_) || func_180124_b().contains(p_180125_0_);
- }
- public static String func_192840_b() {
- StringBuilder stringbuilder = new StringBuilder();
- for(ResourceLocation resourcelocation : func_180124_b()) {
- stringbuilder.append((Object)resourcelocation).append(", ");
- }
- stringbuilder.append((Object)field_191310_e);
- return stringbuilder.toString();
- }
- public static void func_151514_a() {
- func_191303_a(1, "item", EntityItem.class, "Item");
- func_191303_a(2, "xp_orb", EntityXPOrb.class, "XPOrb");
- func_191303_a(3, "area_effect_cloud", EntityAreaEffectCloud.class, "AreaEffectCloud");
- func_191303_a(4, "elder_guardian", EntityElderGuardian.class, "ElderGuardian");
- func_191303_a(5, "wither_skeleton", EntityWitherSkeleton.class, "WitherSkeleton");
- func_191303_a(6, "stray", EntityStray.class, "Stray");
- func_191303_a(7, "egg", EntityEgg.class, "ThrownEgg");
- func_191303_a(8, "leash_knot", EntityLeashKnot.class, "LeashKnot");
- func_191303_a(9, "painting", EntityPainting.class, "Painting");
- func_191303_a(10, "arrow", EntityTippedArrow.class, "Arrow");
- func_191303_a(11, "snowball", EntitySnowball.class, "Snowball");
- func_191303_a(12, "fireball", EntityLargeFireball.class, "Fireball");
- func_191303_a(13, "small_fireball", EntitySmallFireball.class, "SmallFireball");
- func_191303_a(14, "ender_pearl", EntityEnderPearl.class, "ThrownEnderpearl");
- func_191303_a(15, "eye_of_ender_signal", EntityEnderEye.class, "EyeOfEnderSignal");
- func_191303_a(16, "potion", EntityPotion.class, "ThrownPotion");
- func_191303_a(17, "xp_bottle", EntityExpBottle.class, "ThrownExpBottle");
- func_191303_a(18, "item_frame", EntityItemFrame.class, "ItemFrame");
- func_191303_a(19, "wither_skull", EntityWitherSkull.class, "WitherSkull");
- func_191303_a(20, "tnt", EntityTNTPrimed.class, "PrimedTnt");
- func_191303_a(21, "falling_block", EntityFallingBlock.class, "FallingSand");
- func_191303_a(22, "fireworks_rocket", EntityFireworkRocket.class, "FireworksRocketEntity");
- func_191303_a(23, "husk", EntityHusk.class, "Husk");
- func_191303_a(24, "spectral_arrow", EntitySpectralArrow.class, "SpectralArrow");
- func_191303_a(25, "shulker_bullet", EntityShulkerBullet.class, "ShulkerBullet");
- func_191303_a(26, "dragon_fireball", EntityDragonFireball.class, "DragonFireball");
- func_191303_a(27, "zombie_villager", EntityZombieVillager.class, "ZombieVillager");
- func_191303_a(28, "skeleton_horse", EntitySkeletonHorse.class, "SkeletonHorse");
- func_191303_a(29, "zombie_horse", EntityZombieHorse.class, "ZombieHorse");
- func_191303_a(30, "armor_stand", EntityArmorStand.class, "ArmorStand");
- func_191303_a(31, "donkey", EntityDonkey.class, "Donkey");
- func_191303_a(32, "mule", EntityMule.class, "Mule");
- func_191303_a(33, "evocation_fangs", EntityEvokerFangs.class, "EvocationFangs");
- func_191303_a(34, "evocation_illager", EntityEvoker.class, "EvocationIllager");
- func_191303_a(35, "vex", EntityVex.class, "Vex");
- func_191303_a(36, "vindication_illager", EntityVindicator.class, "VindicationIllager");
- func_191303_a(37, "illusion_illager", EntityIllusionIllager.class, "IllusionIllager");
- func_191303_a(40, "commandblock_minecart", EntityMinecartCommandBlock.class, EntityMinecart.Type.COMMAND_BLOCK.func_184954_b());
- func_191303_a(41, "boat", EntityBoat.class, "Boat");
- func_191303_a(42, "minecart", EntityMinecartEmpty.class, EntityMinecart.Type.RIDEABLE.func_184954_b());
- func_191303_a(43, "chest_minecart", EntityMinecartChest.class, EntityMinecart.Type.CHEST.func_184954_b());
- func_191303_a(44, "furnace_minecart", EntityMinecartFurnace.class, EntityMinecart.Type.FURNACE.func_184954_b());
- func_191303_a(45, "tnt_minecart", EntityMinecartTNT.class, EntityMinecart.Type.TNT.func_184954_b());
- func_191303_a(46, "hopper_minecart", EntityMinecartHopper.class, EntityMinecart.Type.HOPPER.func_184954_b());
- func_191303_a(47, "spawner_minecart", EntityMinecartMobSpawner.class, EntityMinecart.Type.SPAWNER.func_184954_b());
- func_191303_a(50, "creeper", EntityCreeper.class, "Creeper");
- func_191303_a(51, "skeleton", EntitySkeleton.class, "Skeleton");
- func_191303_a(52, "spider", EntitySpider.class, "Spider");
- func_191303_a(53, "giant", EntityGiantZombie.class, "Giant");
- func_191303_a(54, "zombie", EntityZombie.class, "Zombie");
- func_191303_a(55, "slime", EntitySlime.class, "Slime");
- func_191303_a(56, "ghast", EntityGhast.class, "Ghast");
- func_191303_a(57, "zombie_pigman", EntityPigZombie.class, "PigZombie");
- func_191303_a(58, "enderman", EntityEnderman.class, "Enderman");
- func_191303_a(59, "cave_spider", EntityCaveSpider.class, "CaveSpider");
- func_191303_a(60, "silverfish", EntitySilverfish.class, "Silverfish");
- func_191303_a(61, "blaze", EntityBlaze.class, "Blaze");
- func_191303_a(62, "magma_cube", EntityMagmaCube.class, "LavaSlime");
- func_191303_a(63, "ender_dragon", EntityDragon.class, "EnderDragon");
- func_191303_a(64, "wither", EntityWither.class, "WitherBoss");
- func_191303_a(65, "bat", EntityBat.class, "Bat");
- func_191303_a(66, "witch", EntityWitch.class, "Witch");
- func_191303_a(67, "endermite", EntityEndermite.class, "Endermite");
- func_191303_a(68, "guardian", EntityGuardian.class, "Guardian");
- func_191303_a(69, "shulker", EntityShulker.class, "Shulker");
- func_191303_a(90, "pig", EntityPig.class, "Pig");
- func_191303_a(91, "sheep", EntitySheep.class, "Sheep");
- func_191303_a(92, "cow", EntityCow.class, "Cow");
- func_191303_a(93, "chicken", EntityChicken.class, "Chicken");
- func_191303_a(94, "squid", EntitySquid.class, "Squid");
- func_191303_a(95, "wolf", EntityWolf.class, "Wolf");
- func_191303_a(96, "mooshroom", EntityMooshroom.class, "MushroomCow");
- func_191303_a(97, "snowman", EntitySnowman.class, "SnowMan");
- func_191303_a(98, "ocelot", EntityOcelot.class, "Ozelot");
- func_191303_a(99, "villager_golem", EntityIronGolem.class, "VillagerGolem");
- func_191303_a(100, "horse", EntityHorse.class, "Horse");
- func_191303_a(101, "rabbit", EntityRabbit.class, "Rabbit");
- func_191303_a(102, "polar_bear", EntityPolarBear.class, "PolarBear");
- func_191303_a(103, "llama", EntityLlama.class, "Llama");
- func_191303_a(104, "llama_spit", EntityLlamaSpit.class, "LlamaSpit");
- func_191303_a(105, "parrot", EntityParrot.class, "Parrot");
- func_191303_a(120, "villager", EntityVillager.class, "Villager");
- func_191303_a(200, "ender_crystal", EntityEnderCrystal.class, "EnderCrystal");
- func_191305_a("bat", 4996656, 986895);
- func_191305_a("blaze", 16167425, 16775294);
- func_191305_a("cave_spider", 803406, 11013646);
- func_191305_a("chicken", 10592673, 16711680);
- func_191305_a("cow", 4470310, 10592673);
- func_191305_a("creeper", 894731, 0);
- func_191305_a("donkey", 5457209, 8811878);
- func_191305_a("elder_guardian", 13552826, 7632531);
- func_191305_a("enderman", 1447446, 0);
- func_191305_a("endermite", 1447446, 7237230);
- func_191305_a("evocation_illager", 9804699, 1973274);
- func_191305_a("ghast", 16382457, 12369084);
- func_191305_a("guardian", 5931634, 15826224);
- func_191305_a("horse", 12623485, 15656192);
- func_191305_a("husk", 7958625, 15125652);
- func_191305_a("llama", 12623485, 10051392);
- func_191305_a("magma_cube", 3407872, 16579584);
- func_191305_a("mooshroom", 10489616, 12040119);
- func_191305_a("mule", 1769984, 5321501);
- func_191305_a("ocelot", 15720061, 5653556);
- func_191305_a("parrot", 894731, 16711680);
- func_191305_a("pig", 15771042, 14377823);
- func_191305_a("polar_bear", 15921906, 9803152);
- func_191305_a("rabbit", 10051392, 7555121);
- func_191305_a("sheep", 15198183, 16758197);
- func_191305_a("shulker", 9725844, 5060690);
- func_191305_a("silverfish", 7237230, 3158064);
- func_191305_a("skeleton", 12698049, 4802889);
- func_191305_a("skeleton_horse", 6842447, 15066584);
- func_191305_a("slime", 5349438, 8306542);
- func_191305_a("spider", 3419431, 11013646);
- func_191305_a("squid", 2243405, 7375001);
- func_191305_a("stray", 6387319, 14543594);
- func_191305_a("vex", 8032420, 15265265);
- func_191305_a("villager", 5651507, 12422002);
- func_191305_a("vindication_illager", 9804699, 2580065);
- func_191305_a("witch", 3407872, 5349438);
- func_191305_a("wither_skeleton", 1315860, 4672845);
- func_191305_a("wolf", 14144467, 13545366);
- func_191305_a("zombie", '\uafaf', 7969893);
- func_191305_a("zombie_horse", 3232308, 9945732);
- func_191305_a("zombie_pigman", 15373203, 5009705);
- func_191305_a("zombie_villager", 5651507, 7969893);
- field_191309_d.add(field_191307_a);
- }
- private static void func_191303_a(int p_191303_0_, String p_191303_1_, Class<? extends Entity> p_191303_2_, String p_191303_3_) {
- try {
- p_191303_2_.getConstructor(new Class[]{World.class});
- } catch (NoSuchMethodException var5) {
- throw new RuntimeException("Invalid class " + p_191303_2_ + " no constructor taking " + World.class.getName());
- }
- if((p_191303_2_.getModifiers() & 1024) == 1024) {
- throw new RuntimeException("Invalid abstract class " + p_191303_2_);
- } else {
- ResourceLocation resourcelocation = new ResourceLocation(p_191303_1_);
- field_191308_b.func_177775_a(p_191303_0_, resourcelocation, p_191303_2_);
- field_191309_d.add(resourcelocation);
- while(field_191311_g.size() <= p_191303_0_) {
- field_191311_g.add((String)null);
- }
- field_191311_g.set(p_191303_0_, p_191303_3_);
- }
- }
- protected static EntityList.EntityEggInfo func_191305_a(String p_191305_0_, int p_191305_1_, int p_191305_2_) {
- ResourceLocation resourcelocation = new ResourceLocation(p_191305_0_);
- return (EntityList.EntityEggInfo)field_75627_a.put(resourcelocation, new EntityList.EntityEggInfo(resourcelocation, p_191305_1_, p_191305_2_));
- }
- public static class EntityEggInfo {
- public final ResourceLocation field_75613_a;
- public final int field_75611_b;
- public final int field_75612_c;
- public final StatBase field_151512_d;
- public final StatBase field_151513_e;
- public EntityEggInfo(ResourceLocation p_i47341_1_, int p_i47341_2_, int p_i47341_3_) {
- this.field_75613_a = p_i47341_1_;
- this.field_75611_b = p_i47341_2_;
- this.field_75612_c = p_i47341_3_;
- this.field_151512_d = StatList.func_151182_a(this);
- this.field_151513_e = StatList.func_151176_b(this);
- }
- }
- }
- Patching failed: minecraft\net\minecraft\util\EntitySelectors.java
- Hunk 1 failed! Cannot find hunk target
- public static <T extends Entity> Predicate<T> func_188442_a(final Entity p_188442_0_) {
- final Team team = p_188442_0_.func_96124_cp();
- final Team.CollisionRule team$collisionrule = team == null ? Team.CollisionRule.ALWAYS : team.func_186681_k();
- - return team$collisionrule == Team.CollisionRule.NEVER ? Predicates.alwaysFalse() : Predicates.and(field_180132_d, new Predicate<Entity>() {
- + Predicate<?> ret = team$collisionrule == Team.CollisionRule.NEVER ? Predicates.alwaysFalse() : Predicates.and(field_180132_d, new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if (!p_apply_1_.func_70104_M()) {
- return false;
- File state
- package net.minecraft.util;
- import com.google.common.base.Predicate;
- import com.google.common.base.Predicates;
- import javax.annotation.Nullable;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.EntityLiving;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.entity.item.EntityArmorStand;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.inventory.IInventory;
- import net.minecraft.item.ItemStack;
- import net.minecraft.scoreboard.Team;
- public final class EntitySelectors {
- public static final Predicate<Entity> field_94557_a = new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return p_apply_1_.func_70089_S();
- }
- };
- public static final Predicate<Entity> field_152785_b = new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return p_apply_1_.func_70089_S() && !p_apply_1_.func_184207_aI() && !p_apply_1_.func_184218_aH();
- }
- };
- public static final Predicate<Entity> field_96566_b = new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return p_apply_1_ instanceof IInventory && p_apply_1_.func_70089_S();
- }
- };
- public static final Predicate<Entity> field_188444_d = new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return !(p_apply_1_ instanceof EntityPlayer) || !((EntityPlayer)p_apply_1_).func_175149_v() && !((EntityPlayer)p_apply_1_).func_184812_l_();
- }
- };
- public static final Predicate<Entity> field_180132_d = new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return !(p_apply_1_ instanceof EntityPlayer) || !((EntityPlayer)p_apply_1_).func_175149_v();
- }
- };
- 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_) {
- final double d0 = p_188443_6_ * p_188443_6_;
- return new Predicate<T>() {
- public boolean apply(@Nullable T p_apply_1_) {
- return p_apply_1_ != null && p_apply_1_.func_70092_e(p_188443_0_, p_188443_2_, p_188443_4_) <= d0;
- }
- };
- }
- public static <T extends Entity> Predicate<T> func_188442_a(final Entity p_188442_0_) {
- final Team team = p_188442_0_.func_96124_cp();
- final Team.CollisionRule team$collisionrule = team == null?Team.CollisionRule.ALWAYS:team.func_186681_k();
- return team$collisionrule == Team.CollisionRule.NEVER?Predicates.alwaysFalse():Predicates.and(field_180132_d, new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(!p_apply_1_.func_70104_M()) {
- return false;
- } else if(!p_188442_0_.field_70170_p.field_72995_K || p_apply_1_ instanceof EntityPlayer && ((EntityPlayer)p_apply_1_).func_175144_cb()) {
- Team team1 = p_apply_1_.func_96124_cp();
- Team.CollisionRule team$collisionrule1 = team1 == null?Team.CollisionRule.ALWAYS:team1.func_186681_k();
- if(team$collisionrule1 == Team.CollisionRule.NEVER) {
- return false;
- } else {
- boolean flag = team != null && team.func_142054_a(team1);
- 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;
- }
- } else {
- return false;
- }
- }
- });
- }
- public static Predicate<Entity> func_191324_b(final Entity p_191324_0_) {
- return new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- while(true) {
- if(p_apply_1_.func_184218_aH()) {
- p_apply_1_ = p_apply_1_.func_184187_bx();
- if(p_apply_1_ != p_191324_0_) {
- continue;
- }
- return false;
- }
- return true;
- }
- }
- };
- }
- public static class ArmoredMob implements Predicate<Entity> {
- private final ItemStack field_96567_c;
- public ArmoredMob(ItemStack p_i1584_1_) {
- this.field_96567_c = p_i1584_1_;
- }
- public boolean apply(@Nullable Entity p_apply_1_) {
- if(!p_apply_1_.func_70089_S()) {
- return false;
- } else if(!(p_apply_1_ instanceof EntityLivingBase)) {
- return false;
- } else {
- EntityLivingBase entitylivingbase = (EntityLivingBase)p_apply_1_;
- 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));
- }
- }
- }
- }
- Patching failed: minecraft\net\minecraft\entity\ai\EntityAINearestAttackableTarget.java
- Hunk 2 failed! Cannot find hunk target
- return 1.0D;
- }
- - }, this.field_82643_g);
- + }, (Predicate<EntityPlayer>)this.field_82643_g);
- return this.field_75309_a != null;
- }
- }
- File state
- package net.minecraft.entity.ai;
- import com.google.common.base.Function;
- import com.google.common.base.Predicate;
- import java.util.Collections;
- import java.util.Comparator;
- import java.util.List;
- import javax.annotation.Nullable;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.EntityCreature;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.entity.ai.EntityAITarget;
- import net.minecraft.entity.monster.EntityCreeper;
- import net.minecraft.entity.monster.EntitySkeleton;
- import net.minecraft.entity.monster.EntityZombie;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.entity.player.EntityPlayerMP;
- import net.minecraft.init.Items;
- import net.minecraft.inventory.EntityEquipmentSlot;
- import net.minecraft.item.ItemStack;
- import net.minecraft.util.EntitySelectors;
- import net.minecraft.util.math.AxisAlignedBB;
- public class EntityAINearestAttackableTarget<T extends EntityLivingBase> extends EntityAITarget {
- protected final Class<T> field_75307_b;
- private final int field_75308_c;
- protected final EntityAINearestAttackableTarget.Sorter field_75306_g;
- protected final Predicate<? super T> field_82643_g;
- protected T field_75309_a;
- public EntityAINearestAttackableTarget(EntityCreature p_i45878_1_, Class<T> p_i45878_2_, boolean p_i45878_3_) {
- this(p_i45878_1_, p_i45878_2_, p_i45878_3_, false);
- }
- public EntityAINearestAttackableTarget(EntityCreature p_i45879_1_, Class<T> p_i45879_2_, boolean p_i45879_3_, boolean p_i45879_4_) {
- this(p_i45879_1_, p_i45879_2_, 10, p_i45879_3_, p_i45879_4_, (Predicate<? super T>)null);
- }
- 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_) {
- super(p_i45880_1_, p_i45880_4_, p_i45880_5_);
- this.field_75307_b = p_i45880_2_;
- this.field_75308_c = p_i45880_3_;
- this.field_75306_g = new EntityAINearestAttackableTarget.Sorter(p_i45880_1_);
- this.func_75248_a(1);
- this.field_82643_g = new Predicate<T>() {
- public boolean apply(@Nullable T p_apply_1_) {
- 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)));
- }
- };
- }
- public boolean func_75250_a() {
- if(this.field_75308_c > 0 && this.field_75299_d.func_70681_au().nextInt(this.field_75308_c) != 0) {
- return false;
- } else if(this.field_75307_b != EntityPlayer.class && this.field_75307_b != EntityPlayerMP.class) {
- 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);
- if(list.isEmpty()) {
- return false;
- } else {
- Collections.sort(list, this.field_75306_g);
- this.field_75309_a = (EntityLivingBase)list.get(0);
- return true;
- }
- } else {
- 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>() {
- @Nullable
- public Double apply(@Nullable EntityPlayer p_apply_1_) {
- ItemStack itemstack = p_apply_1_.func_184582_a(EntityEquipmentSlot.HEAD);
- if(itemstack.func_77973_b() == Items.field_151144_bL) {
- int i = itemstack.func_77952_i();
- boolean flag = EntityAINearestAttackableTarget.this.field_75299_d instanceof EntitySkeleton && i == 0;
- boolean flag1 = EntityAINearestAttackableTarget.this.field_75299_d instanceof EntityZombie && i == 2;
- boolean flag2 = EntityAINearestAttackableTarget.this.field_75299_d instanceof EntityCreeper && i == 4;
- if(flag || flag1 || flag2) {
- return Double.valueOf(0.5D);
- }
- }
- return Double.valueOf(1.0D);
- }
- }, this.field_82643_g);
- return this.field_75309_a != null;
- }
- }
- protected AxisAlignedBB func_188511_a(double p_188511_1_) {
- return this.field_75299_d.func_174813_aQ().func_72314_b(p_188511_1_, 4.0D, p_188511_1_);
- }
- public void func_75249_e() {
- this.field_75299_d.func_70624_b(this.field_75309_a);
- super.func_75249_e();
- }
- public static class Sorter implements Comparator<Entity> {
- private final Entity field_75459_b;
- public Sorter(Entity p_i1662_1_) {
- this.field_75459_b = p_i1662_1_;
- }
- public int compare(Entity p_compare_1_, Entity p_compare_2_) {
- double d0 = this.field_75459_b.func_70068_e(p_compare_1_);
- double d1 = this.field_75459_b.func_70068_e(p_compare_2_);
- return d0 < d1?-1:(d0 > d1?1:0);
- }
- }
- }
- Patching failed: minecraft\net\minecraft\entity\EntityHanging.java
- Hunk 1 failed! Cannot find hunk target
- return this.field_174861_a;
- }
- + @SuppressWarnings("incomplete-switch")
- public float func_184229_a(Rotation p_184229_1_) {
- if (this.field_174860_b != null && this.field_174860_b.func_176740_k() != EnumFacing.Axis.Y) {
- switch(p_184229_1_) {
- File state
- package net.minecraft.entity;
- import com.google.common.base.Predicate;
- import javax.annotation.Nullable;
- import net.minecraft.block.BlockRedstoneDiode;
- import net.minecraft.block.state.IBlockState;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.MoverType;
- import net.minecraft.entity.effect.EntityLightningBolt;
- import net.minecraft.entity.item.EntityItem;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.item.ItemStack;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.util.DamageSource;
- import net.minecraft.util.EnumFacing;
- import net.minecraft.util.Mirror;
- import net.minecraft.util.Rotation;
- import net.minecraft.util.math.AxisAlignedBB;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.util.math.MathHelper;
- import net.minecraft.world.World;
- import org.apache.commons.lang3.Validate;
- public abstract class EntityHanging extends Entity {
- private static final Predicate<Entity> field_184524_c = new Predicate<Entity>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return p_apply_1_ instanceof EntityHanging;
- }
- };
- private int field_70520_f;
- protected BlockPos field_174861_a;
- @Nullable
- public EnumFacing field_174860_b;
- public EntityHanging(World p_i1588_1_) {
- super(p_i1588_1_);
- this.func_70105_a(0.5F, 0.5F);
- }
- public EntityHanging(World p_i45853_1_, BlockPos p_i45853_2_) {
- this(p_i45853_1_);
- this.field_174861_a = p_i45853_2_;
- }
- protected void func_70088_a() {
- }
- protected void func_174859_a(EnumFacing p_174859_1_) {
- Validate.notNull(p_174859_1_);
- Validate.isTrue(p_174859_1_.func_176740_k().func_176722_c());
- this.field_174860_b = p_174859_1_;
- this.field_70177_z = (float)(this.field_174860_b.func_176736_b() * 90);
- this.field_70126_B = this.field_70177_z;
- this.func_174856_o();
- }
- protected void func_174856_o() {
- if(this.field_174860_b != null) {
- double d0 = (double)this.field_174861_a.func_177958_n() + 0.5D;
- double d1 = (double)this.field_174861_a.func_177956_o() + 0.5D;
- double d2 = (double)this.field_174861_a.func_177952_p() + 0.5D;
- double d3 = 0.46875D;
- double d4 = this.func_190202_a(this.func_82329_d());
- double d5 = this.func_190202_a(this.func_82330_g());
- d0 = d0 - (double)this.field_174860_b.func_82601_c() * 0.46875D;
- d2 = d2 - (double)this.field_174860_b.func_82599_e() * 0.46875D;
- d1 = d1 + d5;
- EnumFacing enumfacing = this.field_174860_b.func_176735_f();
- d0 = d0 + d4 * (double)enumfacing.func_82601_c();
- d2 = d2 + d4 * (double)enumfacing.func_82599_e();
- this.field_70165_t = d0;
- this.field_70163_u = d1;
- this.field_70161_v = d2;
- double d6 = (double)this.func_82329_d();
- double d7 = (double)this.func_82330_g();
- double d8 = (double)this.func_82329_d();
- if(this.field_174860_b.func_176740_k() == EnumFacing.Axis.Z) {
- d8 = 1.0D;
- } else {
- d6 = 1.0D;
- }
- d6 = d6 / 32.0D;
- d7 = d7 / 32.0D;
- d8 = d8 / 32.0D;
- this.func_174826_a(new AxisAlignedBB(d0 - d6, d1 - d7, d2 - d8, d0 + d6, d1 + d7, d2 + d8));
- }
- }
- private double func_190202_a(int p_190202_1_) {
- return p_190202_1_ % 32 == 0?0.5D:0.0D;
- }
- public void func_70071_h_() {
- this.field_70169_q = this.field_70165_t;
- this.field_70167_r = this.field_70163_u;
- this.field_70166_s = this.field_70161_v;
- if(this.field_70520_f++ == 100 && !this.field_70170_p.field_72995_K) {
- this.field_70520_f = 0;
- if(!this.field_70128_L && !this.func_70518_d()) {
- this.func_70106_y();
- this.func_110128_b((Entity)null);
- }
- }
- }
- public boolean func_70518_d() {
- if(!this.field_70170_p.func_184144_a(this, this.func_174813_aQ()).isEmpty()) {
- return false;
- } else {
- int i = Math.max(1, this.func_82329_d() / 16);
- int j = Math.max(1, this.func_82330_g() / 16);
- BlockPos blockpos = this.field_174861_a.func_177972_a(this.field_174860_b.func_176734_d());
- EnumFacing enumfacing = this.field_174860_b.func_176735_f();
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
- for(int k = 0; k < i; ++k) {
- for(int l = 0; l < j; ++l) {
- int i1 = (i - 1) / -2;
- int j1 = (j - 1) / -2;
- blockpos$mutableblockpos.func_189533_g(blockpos).func_189534_c(enumfacing, k + i1).func_189534_c(EnumFacing.UP, l + j1);
- IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos$mutableblockpos);
- if(!iblockstate.func_185904_a().func_76220_a() && !BlockRedstoneDiode.func_185546_B(iblockstate)) {
- return false;
- }
- }
- }
- return this.field_70170_p.func_175674_a(this, this.func_174813_aQ(), field_184524_c).isEmpty();
- }
- }
- public boolean func_70067_L() {
- return true;
- }
- public boolean func_85031_j(Entity p_85031_1_) {
- return p_85031_1_ instanceof EntityPlayer?this.func_70097_a(DamageSource.func_76365_a((EntityPlayer)p_85031_1_), 0.0F):false;
- }
- public EnumFacing func_174811_aO() {
- return this.field_174860_b;
- }
- public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) {
- if(this.func_180431_b(p_70097_1_)) {
- return false;
- } else {
- if(!this.field_70128_L && !this.field_70170_p.field_72995_K) {
- this.func_70106_y();
- this.func_70018_K();
- this.func_110128_b(p_70097_1_.func_76346_g());
- }
- return true;
- }
- }
- public void func_70091_d(MoverType p_70091_1_, double p_70091_2_, double p_70091_4_, double p_70091_6_) {
- 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) {
- this.func_70106_y();
- this.func_110128_b((Entity)null);
- }
- }
- public void func_70024_g(double p_70024_1_, double p_70024_3_, double p_70024_5_) {
- 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) {
- this.func_70106_y();
- this.func_110128_b((Entity)null);
- }
- }
- public void func_70014_b(NBTTagCompound p_70014_1_) {
- p_70014_1_.func_74774_a("Facing", (byte)this.field_174860_b.func_176736_b());
- BlockPos blockpos = this.func_174857_n();
- p_70014_1_.func_74768_a("TileX", blockpos.func_177958_n());
- p_70014_1_.func_74768_a("TileY", blockpos.func_177956_o());
- p_70014_1_.func_74768_a("TileZ", blockpos.func_177952_p());
- }
- public void func_70037_a(NBTTagCompound p_70037_1_) {
- 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"));
- this.func_174859_a(EnumFacing.func_176731_b(p_70037_1_.func_74771_c("Facing")));
- }
- public abstract int func_82329_d();
- public abstract int func_82330_g();
- public abstract void func_110128_b(@Nullable Entity p_110128_1_);
- public abstract void func_184523_o();
- public EntityItem func_70099_a(ItemStack p_70099_1_, float p_70099_2_) {
- 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_);
- entityitem.func_174869_p();
- this.field_70170_p.func_72838_d(entityitem);
- return entityitem;
- }
- protected boolean func_142008_O() {
- return false;
- }
- public void func_70107_b(double p_70107_1_, double p_70107_3_, double p_70107_5_) {
- this.field_174861_a = new BlockPos(p_70107_1_, p_70107_3_, p_70107_5_);
- this.func_174856_o();
- this.field_70160_al = true;
- }
- public BlockPos func_174857_n() {
- return this.field_174861_a;
- }
- public float func_184229_a(Rotation p_184229_1_) {
- if(this.field_174860_b != null && this.field_174860_b.func_176740_k() != EnumFacing.Axis.Y) {
- switch(p_184229_1_) {
- case CLOCKWISE_180:
- this.field_174860_b = this.field_174860_b.func_176734_d();
- break;
- case COUNTERCLOCKWISE_90:
- this.field_174860_b = this.field_174860_b.func_176735_f();
- break;
- case CLOCKWISE_90:
- this.field_174860_b = this.field_174860_b.func_176746_e();
- }
- }
- float f = MathHelper.func_76142_g(this.field_70177_z);
- switch(p_184229_1_) {
- case CLOCKWISE_180:
- return f + 180.0F;
- case COUNTERCLOCKWISE_90:
- return f + 90.0F;
- case CLOCKWISE_90:
- return f + 270.0F;
- default:
- return f;
- }
- }
- public float func_184217_a(Mirror p_184217_1_) {
- return this.func_184229_a(p_184217_1_.func_185800_a(this.field_174860_b));
- }
- public void func_70077_a(EntityLightningBolt p_70077_1_) {
- }
- }
- Patching failed: minecraft\net\minecraft\entity\monster\EntityEnderman.java
- Hunk 1 failed! Cannot find hunk target
- public void func_75246_d() {
- if (this.field_179448_g != null) {
- if (--this.field_179450_h <= 0) {
- - this.field_75309_a = (T)this.field_179448_g;
- + this.field_75309_a = this.field_179448_g;
- this.field_179448_g = null;
- super.func_75249_e();
- }
- File state
- package net.minecraft.entity.monster;
- import com.google.common.base.Function;
- import com.google.common.base.Optional;
- import com.google.common.base.Predicate;
- import com.google.common.collect.Sets;
- import java.util.Random;
- import java.util.Set;
- import java.util.UUID;
- import javax.annotation.Nullable;
- import net.minecraft.block.Block;
- import net.minecraft.block.material.Material;
- import net.minecraft.block.state.IBlockState;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.EntityLiving;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.entity.SharedMonsterAttributes;
- import net.minecraft.entity.ai.EntityAIAttackMelee;
- import net.minecraft.entity.ai.EntityAIBase;
- import net.minecraft.entity.ai.EntityAIHurtByTarget;
- import net.minecraft.entity.ai.EntityAILookIdle;
- import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
- import net.minecraft.entity.ai.EntityAISwimming;
- import net.minecraft.entity.ai.EntityAIWanderAvoidWater;
- import net.minecraft.entity.ai.EntityAIWatchClosest;
- import net.minecraft.entity.ai.attributes.AttributeModifier;
- import net.minecraft.entity.ai.attributes.IAttributeInstance;
- import net.minecraft.entity.monster.EntityEndermite;
- import net.minecraft.entity.monster.EntityMob;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.init.Blocks;
- import net.minecraft.init.SoundEvents;
- import net.minecraft.item.Item;
- import net.minecraft.item.ItemStack;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.network.datasync.DataParameter;
- import net.minecraft.network.datasync.DataSerializers;
- import net.minecraft.network.datasync.EntityDataManager;
- import net.minecraft.pathfinding.PathNodeType;
- import net.minecraft.util.DamageSource;
- import net.minecraft.util.EntityDamageSourceIndirect;
- import net.minecraft.util.EnumParticleTypes;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.util.SoundEvent;
- import net.minecraft.util.datafix.DataFixer;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.util.math.MathHelper;
- import net.minecraft.util.math.RayTraceResult;
- import net.minecraft.util.math.Vec3d;
- import net.minecraft.world.World;
- import net.minecraft.world.storage.loot.LootTableList;
- public class EntityEnderman extends EntityMob {
- private static final UUID field_110192_bp = UUID.fromString("020E0DFB-87AE-4653-9556-831010E291A0");
- private static final AttributeModifier field_110193_bq = (new AttributeModifier(field_110192_bp, "Attacking speed boost", 0.15000000596046448D, 0)).func_111168_a(false);
- private static final Set<Block> field_70827_d = Sets.<Block>newIdentityHashSet();
- private static final DataParameter<Optional<IBlockState>> field_184718_bv = EntityDataManager.<Optional<IBlockState>>func_187226_a(EntityEnderman.class, DataSerializers.field_187197_g);
- private static final DataParameter<Boolean> field_184719_bw = EntityDataManager.<Boolean>func_187226_a(EntityEnderman.class, DataSerializers.field_187198_h);
- private int field_184720_bx;
- private int field_184721_by;
- public EntityEnderman(World p_i1734_1_) {
- super(p_i1734_1_);
- this.func_70105_a(0.6F, 2.9F);
- this.field_70138_W = 1.0F;
- this.func_184644_a(PathNodeType.WATER, -1.0F);
- }
- protected void func_184651_r() {
- this.field_70714_bg.func_75776_a(0, new EntityAISwimming(this));
- this.field_70714_bg.func_75776_a(2, new EntityAIAttackMelee(this, 1.0D, false));
- this.field_70714_bg.func_75776_a(7, new EntityAIWanderAvoidWater(this, 1.0D, 0.0F));
- this.field_70714_bg.func_75776_a(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
- this.field_70714_bg.func_75776_a(8, new EntityAILookIdle(this));
- this.field_70714_bg.func_75776_a(10, new EntityEnderman.AIPlaceBlock(this));
- this.field_70714_bg.func_75776_a(11, new EntityEnderman.AITakeBlock(this));
- this.field_70715_bh.func_75776_a(1, new EntityEnderman.AIFindPlayer(this));
- this.field_70715_bh.func_75776_a(2, new EntityAIHurtByTarget(this, false, new Class[0]));
- this.field_70715_bh.func_75776_a(3, new EntityAINearestAttackableTarget(this, EntityEndermite.class, 10, true, false, new Predicate<EntityEndermite>() {
- public boolean apply(@Nullable EntityEndermite p_apply_1_) {
- return p_apply_1_.func_175495_n();
- }
- }));
- }
- protected void func_110147_ax() {
- super.func_110147_ax();
- this.func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(40.0D);
- this.func_110148_a(SharedMonsterAttributes.field_111263_d).func_111128_a(0.30000001192092896D);
- this.func_110148_a(SharedMonsterAttributes.field_111264_e).func_111128_a(7.0D);
- this.func_110148_a(SharedMonsterAttributes.field_111265_b).func_111128_a(64.0D);
- }
- public void func_70624_b(@Nullable EntityLivingBase p_70624_1_) {
- super.func_70624_b(p_70624_1_);
- IAttributeInstance iattributeinstance = this.func_110148_a(SharedMonsterAttributes.field_111263_d);
- if(p_70624_1_ == null) {
- this.field_184721_by = 0;
- this.field_70180_af.func_187227_b(field_184719_bw, Boolean.valueOf(false));
- iattributeinstance.func_111124_b(field_110193_bq);
- } else {
- this.field_184721_by = this.field_70173_aa;
- this.field_70180_af.func_187227_b(field_184719_bw, Boolean.valueOf(true));
- if(!iattributeinstance.func_180374_a(field_110193_bq)) {
- iattributeinstance.func_111121_a(field_110193_bq);
- }
- }
- }
- protected void func_70088_a() {
- super.func_70088_a();
- this.field_70180_af.func_187214_a(field_184718_bv, Optional.<T>absent());
- this.field_70180_af.func_187214_a(field_184719_bw, Boolean.valueOf(false));
- }
- public void func_184716_o() {
- if(this.field_70173_aa >= this.field_184720_bx + 400) {
- this.field_184720_bx = this.field_70173_aa;
- if(!this.func_174814_R()) {
- 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);
- }
- }
- }
- public void func_184206_a(DataParameter<?> p_184206_1_) {
- if(field_184719_bw.equals(p_184206_1_) && this.func_70823_r() && this.field_70170_p.field_72995_K) {
- this.func_184716_o();
- }
- super.func_184206_a(p_184206_1_);
- }
- public static void func_189763_b(DataFixer p_189763_0_) {
- EntityLiving.func_189752_a(p_189763_0_, EntityEnderman.class);
- }
- public void func_70014_b(NBTTagCompound p_70014_1_) {
- super.func_70014_b(p_70014_1_);
- IBlockState iblockstate = this.func_175489_ck();
- if(iblockstate != null) {
- p_70014_1_.func_74777_a("carried", (short)Block.func_149682_b(iblockstate.func_177230_c()));
- p_70014_1_.func_74777_a("carriedData", (short)iblockstate.func_177230_c().func_176201_c(iblockstate));
- }
- }
- public void func_70037_a(NBTTagCompound p_70037_1_) {
- super.func_70037_a(p_70037_1_);
- IBlockState iblockstate;
- if(p_70037_1_.func_150297_b("carried", 8)) {
- iblockstate = Block.func_149684_b(p_70037_1_.func_74779_i("carried")).func_176203_a(p_70037_1_.func_74765_d("carriedData") & '\uffff');
- } else {
- iblockstate = Block.func_149729_e(p_70037_1_.func_74765_d("carried")).func_176203_a(p_70037_1_.func_74765_d("carriedData") & '\uffff');
- }
- if(iblockstate == null || iblockstate.func_177230_c() == null || iblockstate.func_185904_a() == Material.field_151579_a) {
- iblockstate = null;
- }
- this.func_175490_a(iblockstate);
- }
- private boolean func_70821_d(EntityPlayer p_70821_1_) {
- ItemStack itemstack = (ItemStack)p_70821_1_.field_71071_by.field_70460_b.get(3);
- if(itemstack.func_77973_b() == Item.func_150898_a(Blocks.field_150423_aK)) {
- return false;
- } else {
- Vec3d vec3d = p_70821_1_.func_70676_i(1.0F).func_72432_b();
- 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);
- double d0 = vec3d1.func_72433_c();
- vec3d1 = vec3d1.func_72432_b();
- double d1 = vec3d.func_72430_b(vec3d1);
- return d1 > 1.0D - 0.025D / d0?p_70821_1_.func_70685_l(this):false;
- }
- }
- public float func_70047_e() {
- return 2.55F;
- }
- public void func_70636_d() {
- if(this.field_70170_p.field_72995_K) {
- for(int i = 0; i < 2; ++i) {
- 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]);
- }
- }
- this.field_70703_bu = false;
- super.func_70636_d();
- }
- protected void func_70619_bc() {
- if(this.func_70026_G()) {
- this.func_70097_a(DamageSource.field_76369_e, 1.0F);
- }
- if(this.field_70170_p.func_72935_r() && this.field_70173_aa >= this.field_184721_by + 600) {
- float f = this.func_70013_c();
- 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) {
- this.func_70624_b((EntityLivingBase)null);
- this.func_70820_n();
- }
- }
- super.func_70619_bc();
- }
- protected boolean func_70820_n() {
- double d0 = this.field_70165_t + (this.field_70146_Z.nextDouble() - 0.5D) * 64.0D;
- double d1 = this.field_70163_u + (double)(this.field_70146_Z.nextInt(64) - 32);
- double d2 = this.field_70161_v + (this.field_70146_Z.nextDouble() - 0.5D) * 64.0D;
- return this.func_70825_j(d0, d1, d2);
- }
- protected boolean func_70816_c(Entity p_70816_1_) {
- 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);
- vec3d = vec3d.func_72432_b();
- double d0 = 16.0D;
- double d1 = this.field_70165_t + (this.field_70146_Z.nextDouble() - 0.5D) * 8.0D - vec3d.field_72450_a * 16.0D;
- double d2 = this.field_70163_u + (double)(this.field_70146_Z.nextInt(16) - 8) - vec3d.field_72448_b * 16.0D;
- double d3 = this.field_70161_v + (this.field_70146_Z.nextDouble() - 0.5D) * 8.0D - vec3d.field_72449_c * 16.0D;
- return this.func_70825_j(d1, d2, d3);
- }
- private boolean func_70825_j(double p_70825_1_, double p_70825_3_, double p_70825_5_) {
- boolean flag = this.func_184595_k(p_70825_1_, p_70825_3_, p_70825_5_);
- if(flag) {
- 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);
- this.func_184185_a(SoundEvents.field_187534_aX, 1.0F, 1.0F);
- }
- return flag;
- }
- protected SoundEvent func_184639_G() {
- return this.func_70823_r()?SoundEvents.field_187532_aV:SoundEvents.field_187529_aS;
- }
- protected SoundEvent func_184601_bQ(DamageSource p_184601_1_) {
- return SoundEvents.field_187531_aU;
- }
- protected SoundEvent func_184615_bR() {
- return SoundEvents.field_187530_aT;
- }
- protected void func_82160_b(boolean p_82160_1_, int p_82160_2_) {
- super.func_82160_b(p_82160_1_, p_82160_2_);
- IBlockState iblockstate = this.func_175489_ck();
- if(iblockstate != null) {
- Item item = Item.func_150898_a(iblockstate.func_177230_c());
- int i = item.func_77614_k()?iblockstate.func_177230_c().func_176201_c(iblockstate):0;
- this.func_70099_a(new ItemStack(item, 1, i), 0.0F);
- }
- }
- @Nullable
- protected ResourceLocation func_184647_J() {
- return LootTableList.field_186439_u;
- }
- public void func_175490_a(@Nullable IBlockState p_175490_1_) {
- this.field_70180_af.func_187227_b(field_184718_bv, Optional.<T>fromNullable(p_175490_1_));
- }
- @Nullable
- public IBlockState func_175489_ck() {
- return (IBlockState)((Optional)this.field_70180_af.func_187225_a(field_184718_bv)).orNull();
- }
- public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) {
- if(this.func_180431_b(p_70097_1_)) {
- return false;
- } else if(p_70097_1_ instanceof EntityDamageSourceIndirect) {
- for(int i = 0; i < 64; ++i) {
- if(this.func_70820_n()) {
- return true;
- }
- }
- return false;
- } else {
- boolean flag = super.func_70097_a(p_70097_1_, p_70097_2_);
- if(p_70097_1_.func_76363_c() && this.field_70146_Z.nextInt(10) != 0) {
- this.func_70820_n();
- }
- return flag;
- }
- }
- public boolean func_70823_r() {
- return ((Boolean)this.field_70180_af.func_187225_a(field_184719_bw)).booleanValue();
- }
- static {
- field_70827_d.add(Blocks.field_150349_c);
- field_70827_d.add(Blocks.field_150346_d);
- field_70827_d.add(Blocks.field_150354_m);
- field_70827_d.add(Blocks.field_150351_n);
- field_70827_d.add(Blocks.field_150327_N);
- field_70827_d.add(Blocks.field_150328_O);
- field_70827_d.add(Blocks.field_150338_P);
- field_70827_d.add(Blocks.field_150337_Q);
- field_70827_d.add(Blocks.field_150335_W);
- field_70827_d.add(Blocks.field_150434_aF);
- field_70827_d.add(Blocks.field_150435_aG);
- field_70827_d.add(Blocks.field_150423_aK);
- field_70827_d.add(Blocks.field_150440_ba);
- field_70827_d.add(Blocks.field_150391_bh);
- field_70827_d.add(Blocks.field_150424_aL);
- }
- static class AIFindPlayer extends EntityAINearestAttackableTarget<EntityPlayer> {
- private final EntityEnderman field_179449_j;
- private EntityPlayer field_179448_g;
- private int field_179450_h;
- private int field_179451_i;
- public AIFindPlayer(EntityEnderman p_i45842_1_) {
- super(p_i45842_1_, EntityPlayer.class, false);
- this.field_179449_j = p_i45842_1_;
- }
- public boolean func_75250_a() {
- double d0 = this.func_111175_f();
- 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>() {
- public boolean apply(@Nullable EntityPlayer p_apply_1_) {
- return p_apply_1_ != null && AIFindPlayer.this.field_179449_j.func_70821_d(p_apply_1_);
- }
- });
- return this.field_179448_g != null;
- }
- public void func_75249_e() {
- this.field_179450_h = 5;
- this.field_179451_i = 0;
- }
- public void func_75251_c() {
- this.field_179448_g = null;
- super.func_75251_c();
- }
- public boolean func_75253_b() {
- if(this.field_179448_g != null) {
- if(!this.field_179449_j.func_70821_d(this.field_179448_g)) {
- return false;
- } else {
- this.field_179449_j.func_70625_a(this.field_179448_g, 10.0F, 10.0F);
- return true;
- }
- } else {
- return this.field_75309_a != null && ((EntityPlayer)this.field_75309_a).func_70089_S()?true:super.func_75253_b();
- }
- }
- public void func_75246_d() {
- if(this.field_179448_g != null) {
- if(--this.field_179450_h <= 0) {
- this.field_75309_a = this.field_179448_g;
- this.field_179448_g = null;
- super.func_75249_e();
- }
- } else {
- if(this.field_75309_a != null) {
- if(this.field_179449_j.func_70821_d((EntityPlayer)this.field_75309_a)) {
- if(((EntityPlayer)this.field_75309_a).func_70068_e(this.field_179449_j) < 16.0D) {
- this.field_179449_j.func_70820_n();
- }
- this.field_179451_i = 0;
- } 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)) {
- this.field_179451_i = 0;
- }
- }
- super.func_75246_d();
- }
- }
- }
- static class AIPlaceBlock extends EntityAIBase {
- private final EntityEnderman field_179475_a;
- public AIPlaceBlock(EntityEnderman p_i45843_1_) {
- this.field_179475_a = p_i45843_1_;
- }
- public boolean func_75250_a() {
- 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);
- }
- public void func_75246_d() {
- Random random = this.field_179475_a.func_70681_au();
- World world = this.field_179475_a.field_70170_p;
- int i = MathHelper.func_76128_c(this.field_179475_a.field_70165_t - 1.0D + random.nextDouble() * 2.0D);
- int j = MathHelper.func_76128_c(this.field_179475_a.field_70163_u + random.nextDouble() * 2.0D);
- int k = MathHelper.func_76128_c(this.field_179475_a.field_70161_v - 1.0D + random.nextDouble() * 2.0D);
- BlockPos blockpos = new BlockPos(i, j, k);
- IBlockState iblockstate = world.func_180495_p(blockpos);
- IBlockState iblockstate1 = world.func_180495_p(blockpos.func_177977_b());
- IBlockState iblockstate2 = this.field_179475_a.func_175489_ck();
- if(iblockstate2 != null && this.func_188518_a(world, blockpos, iblockstate2.func_177230_c(), iblockstate, iblockstate1)) {
- world.func_180501_a(blockpos, iblockstate2, 3);
- this.field_179475_a.func_175490_a((IBlockState)null);
- }
- }
- 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_) {
- 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()));
- }
- }
- static class AITakeBlock extends EntityAIBase {
- private final EntityEnderman field_179473_a;
- public AITakeBlock(EntityEnderman p_i45841_1_) {
- this.field_179473_a = p_i45841_1_;
- }
- public boolean func_75250_a() {
- 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);
- }
- public void func_75246_d() {
- Random random = this.field_179473_a.func_70681_au();
- World world = this.field_179473_a.field_70170_p;
- int i = MathHelper.func_76128_c(this.field_179473_a.field_70165_t - 2.0D + random.nextDouble() * 4.0D);
- int j = MathHelper.func_76128_c(this.field_179473_a.field_70163_u + random.nextDouble() * 3.0D);
- int k = MathHelper.func_76128_c(this.field_179473_a.field_70161_v - 2.0D + random.nextDouble() * 4.0D);
- BlockPos blockpos = new BlockPos(i, j, k);
- IBlockState iblockstate = world.func_180495_p(blockpos);
- Block block = iblockstate.func_177230_c();
- 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);
- boolean flag = raytraceresult != null && raytraceresult.func_178782_a().equals(blockpos);
- if(EntityEnderman.field_70827_d.contains(block) && flag) {
- this.field_179473_a.func_175490_a(iblockstate);
- world.func_175698_g(blockpos);
- }
- }
- }
- }
- Patching failed: minecraft\net\minecraft\item\ItemHoe.java
- Hunk 1 failed! Cannot find hunk target
- this.field_185072_b = p_i45343_1_.func_78000_c() + 1.0F;
- }
- + @SuppressWarnings("incomplete-switch")
- 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_) {
- ItemStack itemstack = p_180614_1_.func_184586_b(p_180614_4_);
- if (!p_180614_1_.func_175151_a(p_180614_3_.func_177972_a(p_180614_5_), p_180614_5_, itemstack)) {
- File state
- package net.minecraft.item;
- import com.google.common.collect.Multimap;
- import net.minecraft.block.Block;
- import net.minecraft.block.BlockDirt;
- import net.minecraft.block.material.Material;
- import net.minecraft.block.state.IBlockState;
- import net.minecraft.creativetab.CreativeTabs;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.entity.SharedMonsterAttributes;
- import net.minecraft.entity.ai.attributes.AttributeModifier;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.init.Blocks;
- import net.minecraft.init.SoundEvents;
- import net.minecraft.inventory.EntityEquipmentSlot;
- import net.minecraft.item.Item;
- import net.minecraft.item.ItemStack;
- import net.minecraft.util.EnumActionResult;
- import net.minecraft.util.EnumFacing;
- import net.minecraft.util.EnumHand;
- import net.minecraft.util.SoundCategory;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.world.World;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- public class ItemHoe extends Item {
- private final float field_185072_b;
- protected Item.ToolMaterial field_77843_a;
- public ItemHoe(Item.ToolMaterial p_i45343_1_) {
- this.field_77843_a = p_i45343_1_;
- this.field_77777_bU = 1;
- this.func_77656_e(p_i45343_1_.func_77997_a());
- this.func_77637_a(CreativeTabs.field_78040_i);
- this.field_185072_b = p_i45343_1_.func_78000_c() + 1.0F;
- }
- 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_) {
- ItemStack itemstack = p_180614_1_.func_184586_b(p_180614_4_);
- if(!p_180614_1_.func_175151_a(p_180614_3_.func_177972_a(p_180614_5_), p_180614_5_, itemstack)) {
- return EnumActionResult.FAIL;
- } else {
- IBlockState iblockstate = p_180614_2_.func_180495_p(p_180614_3_);
- Block block = iblockstate.func_177230_c();
- 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) {
- if(block == Blocks.field_150349_c || block == Blocks.field_185774_da) {
- this.func_185071_a(itemstack, p_180614_1_, p_180614_2_, p_180614_3_, Blocks.field_150458_ak.func_176223_P());
- return EnumActionResult.SUCCESS;
- }
- if(block == Blocks.field_150346_d) {
- switch((BlockDirt.DirtType)iblockstate.func_177229_b(BlockDirt.field_176386_a)) {
- case DIRT:
- this.func_185071_a(itemstack, p_180614_1_, p_180614_2_, p_180614_3_, Blocks.field_150458_ak.func_176223_P());
- return EnumActionResult.SUCCESS;
- case COARSE_DIRT:
- 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));
- return EnumActionResult.SUCCESS;
- }
- }
- }
- return EnumActionResult.PASS;
- }
- }
- public boolean func_77644_a(ItemStack p_77644_1_, EntityLivingBase p_77644_2_, EntityLivingBase p_77644_3_) {
- p_77644_1_.func_77972_a(1, p_77644_3_);
- return true;
- }
- 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_) {
- p_185071_3_.func_184133_a(p_185071_2_, p_185071_4_, SoundEvents.field_187693_cj, SoundCategory.BLOCKS, 1.0F, 1.0F);
- if(!p_185071_3_.field_72995_K) {
- p_185071_3_.func_180501_a(p_185071_4_, p_185071_5_, 11);
- p_185071_1_.func_77972_a(1, p_185071_2_);
- }
- }
- @SideOnly(Side.CLIENT)
- public boolean func_77662_d() {
- return true;
- }
- public String func_77842_f() {
- return this.field_77843_a.toString();
- }
- public Multimap<String, AttributeModifier> func_111205_h(EntityEquipmentSlot p_111205_1_) {
- Multimap<String, AttributeModifier> multimap = super.func_111205_h(p_111205_1_);
- if(p_111205_1_ == EntityEquipmentSlot.MAINHAND) {
- multimap.put(SharedMonsterAttributes.field_111264_e.func_111108_a(), new AttributeModifier(field_111210_e, "Weapon modifier", 0.0D, 0));
- multimap.put(SharedMonsterAttributes.field_188790_f.func_111108_a(), new AttributeModifier(field_185050_h, "Weapon modifier", (double)(this.field_185072_b - 4.0F), 0));
- }
- return multimap;
- }
- }
- Patching failed: minecraft\net\minecraft\world\World.java
- Hunk 1 failed! Cannot find hunk target
- List<T> list = Lists.<T>newArrayList();
- for(Entity entity : this.field_72996_f) {
- - if (p_175644_1_.isAssignableFrom(entity.getClass()) && p_175644_2_.apply(entity)) {
- - list.add(entity);
- + if (p_175644_1_.isAssignableFrom(entity.getClass()) && p_175644_2_.apply((T)entity)) {
- + list.add((T)entity);
- }
- }
- File state
- package net.minecraft.world;
- import com.google.common.base.Function;
- import com.google.common.base.MoreObjects;
- import com.google.common.base.Predicate;
- import com.google.common.collect.Lists;
- import java.util.Calendar;
- import java.util.Collection;
- import java.util.Iterator;
- import java.util.List;
- import java.util.Random;
- import java.util.UUID;
- import javax.annotation.Nullable;
- import net.minecraft.advancements.AdvancementManager;
- import net.minecraft.advancements.FunctionManager;
- import net.minecraft.block.Block;
- import net.minecraft.block.BlockLiquid;
- import net.minecraft.block.BlockObserver;
- import net.minecraft.block.material.Material;
- import net.minecraft.block.state.IBlockState;
- import net.minecraft.crash.CrashReport;
- import net.minecraft.crash.CrashReportCategory;
- import net.minecraft.crash.ICrashReportDetail;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.EntityLiving;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.entity.player.EntityPlayerMP;
- import net.minecraft.init.Biomes;
- import net.minecraft.init.Blocks;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.network.Packet;
- import net.minecraft.pathfinding.PathWorldListener;
- import net.minecraft.profiler.Profiler;
- import net.minecraft.scoreboard.Scoreboard;
- import net.minecraft.server.MinecraftServer;
- import net.minecraft.tileentity.TileEntity;
- import net.minecraft.util.EntitySelectors;
- import net.minecraft.util.EnumFacing;
- import net.minecraft.util.EnumParticleTypes;
- import net.minecraft.util.ITickable;
- import net.minecraft.util.IntHashMap;
- import net.minecraft.util.ReportedException;
- import net.minecraft.util.SoundCategory;
- import net.minecraft.util.SoundEvent;
- import net.minecraft.util.math.AxisAlignedBB;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.util.math.MathHelper;
- import net.minecraft.util.math.RayTraceResult;
- import net.minecraft.util.math.Vec3d;
- import net.minecraft.village.VillageCollection;
- import net.minecraft.world.DifficultyInstance;
- import net.minecraft.world.EnumDifficulty;
- import net.minecraft.world.EnumSkyBlock;
- import net.minecraft.world.Explosion;
- import net.minecraft.world.GameRules;
- import net.minecraft.world.IBlockAccess;
- import net.minecraft.world.IWorldEventListener;
- import net.minecraft.world.MinecraftException;
- import net.minecraft.world.NextTickListEntry;
- import net.minecraft.world.WorldProvider;
- import net.minecraft.world.WorldSettings;
- import net.minecraft.world.WorldType;
- import net.minecraft.world.biome.Biome;
- import net.minecraft.world.biome.BiomeProvider;
- import net.minecraft.world.border.WorldBorder;
- import net.minecraft.world.chunk.Chunk;
- import net.minecraft.world.chunk.IChunkProvider;
- import net.minecraft.world.gen.structure.StructureBoundingBox;
- import net.minecraft.world.storage.ISaveHandler;
- import net.minecraft.world.storage.MapStorage;
- import net.minecraft.world.storage.WorldInfo;
- import net.minecraft.world.storage.WorldSavedData;
- import net.minecraft.world.storage.loot.LootTableManager;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- public abstract class World implements IBlockAccess {
- private int field_181546_a = 63;
- protected boolean field_72999_e;
- public final List<Entity> field_72996_f = Lists.<Entity>newArrayList();
- protected final List<Entity> field_72997_g = Lists.<Entity>newArrayList();
- public final List<TileEntity> field_147482_g = Lists.<TileEntity>newArrayList();
- public final List<TileEntity> field_175730_i = Lists.<TileEntity>newArrayList();
- private final List<TileEntity> field_147484_a = Lists.<TileEntity>newArrayList();
- private final List<TileEntity> field_147483_b = Lists.<TileEntity>newArrayList();
- public final List<EntityPlayer> field_73010_i = Lists.<EntityPlayer>newArrayList();
- public final List<Entity> field_73007_j = Lists.<Entity>newArrayList();
- protected final IntHashMap<Entity> field_175729_l = new IntHashMap();
- private final long field_73001_c = 16777215L;
- private int field_73008_k;
- protected int field_73005_l = (new Random()).nextInt();
- protected final int field_73006_m = 1013904223;
- public float field_73003_n;
- public float field_73004_o;
- public float field_73018_p;
- public float field_73017_q;
- private int field_73016_r;
- public final Random field_73012_v = new Random();
- public final WorldProvider field_73011_w;
- protected PathWorldListener field_184152_t = new PathWorldListener();
- protected List<IWorldEventListener> field_73021_x;
- protected IChunkProvider field_73020_y;
- protected final ISaveHandler field_73019_z;
- protected WorldInfo field_72986_A;
- protected boolean field_72987_B;
- protected MapStorage field_72988_C;
- public VillageCollection field_72982_D;
- protected LootTableManager field_184151_B;
- protected AdvancementManager field_191951_C;
- protected FunctionManager field_193036_D;
- public final Profiler field_72984_F;
- private final Calendar field_83016_L;
- protected Scoreboard field_96442_D;
- public final boolean field_72995_K;
- protected boolean field_72985_G;
- protected boolean field_72992_H;
- private boolean field_147481_N;
- private final WorldBorder field_175728_M;
- int[] field_72994_J;
- protected World(ISaveHandler p_i45749_1_, WorldInfo p_i45749_2_, WorldProvider p_i45749_3_, Profiler p_i45749_4_, boolean p_i45749_5_) {
- this.field_73021_x = Lists.newArrayList(new IWorldEventListener[]{this.field_184152_t});
- this.field_83016_L = Calendar.getInstance();
- this.field_96442_D = new Scoreboard();
- this.field_72985_G = true;
- this.field_72992_H = true;
- this.field_72994_J = new int['\u8000'];
- this.field_73019_z = p_i45749_1_;
- this.field_72984_F = p_i45749_4_;
- this.field_72986_A = p_i45749_2_;
- this.field_73011_w = p_i45749_3_;
- this.field_72995_K = p_i45749_5_;
- this.field_175728_M = p_i45749_3_.func_177501_r();
- }
- public World func_175643_b() {
- return this;
- }
- public Biome func_180494_b(final BlockPos p_180494_1_) {
- if(this.func_175667_e(p_180494_1_)) {
- Chunk chunk = this.func_175726_f(p_180494_1_);
- try {
- return chunk.func_177411_a(p_180494_1_, this.field_73011_w.func_177499_m());
- } catch (Throwable throwable) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable, "Getting biome");
- CrashReportCategory crashreportcategory = crashreport.func_85058_a("Coordinates of biome request");
- crashreportcategory.func_189529_a("Location", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return CrashReportCategory.func_180522_a(p_180494_1_);
- }
- });
- throw new ReportedException(crashreport);
- }
- } else {
- return this.field_73011_w.func_177499_m().func_180300_a(p_180494_1_, Biomes.field_76772_c);
- }
- }
- public BiomeProvider func_72959_q() {
- return this.field_73011_w.func_177499_m();
- }
- protected abstract IChunkProvider func_72970_h();
- public void func_72963_a(WorldSettings p_72963_1_) {
- this.field_72986_A.func_76091_d(true);
- }
- @Nullable
- public MinecraftServer func_73046_m() {
- return null;
- }
- @SideOnly(Side.CLIENT)
- public void func_72974_f() {
- this.func_175652_B(new BlockPos(8, 64, 8));
- }
- public IBlockState func_184141_c(BlockPos p_184141_1_) {
- BlockPos blockpos;
- 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()) {
- ;
- }
- return this.func_180495_p(blockpos);
- }
- public boolean func_175701_a(BlockPos p_175701_1_) {
- 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;
- }
- public boolean func_189509_E(BlockPos p_189509_1_) {
- return p_189509_1_.func_177956_o() < 0 || p_189509_1_.func_177956_o() >= 256;
- }
- public boolean func_175623_d(BlockPos p_175623_1_) {
- return this.func_180495_p(p_175623_1_).func_185904_a() == Material.field_151579_a;
- }
- public boolean func_175667_e(BlockPos p_175667_1_) {
- return this.func_175668_a(p_175667_1_, true);
- }
- public boolean func_175668_a(BlockPos p_175668_1_, boolean p_175668_2_) {
- return this.func_175680_a(p_175668_1_.func_177958_n() >> 4, p_175668_1_.func_177952_p() >> 4, p_175668_2_);
- }
- public boolean func_175697_a(BlockPos p_175697_1_, int p_175697_2_) {
- return this.func_175648_a(p_175697_1_, p_175697_2_, true);
- }
- public boolean func_175648_a(BlockPos p_175648_1_, int p_175648_2_, boolean p_175648_3_) {
- 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_);
- }
- public boolean func_175707_a(BlockPos p_175707_1_, BlockPos p_175707_2_) {
- return this.func_175706_a(p_175707_1_, p_175707_2_, true);
- }
- public boolean func_175706_a(BlockPos p_175706_1_, BlockPos p_175706_2_, boolean p_175706_3_) {
- 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_);
- }
- public boolean func_175711_a(StructureBoundingBox p_175711_1_) {
- return this.func_175639_b(p_175711_1_, true);
- }
- public boolean func_175639_b(StructureBoundingBox p_175639_1_, boolean p_175639_2_) {
- 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_);
- }
- 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_) {
- if(p_175663_5_ >= 0 && p_175663_2_ < 256) {
- p_175663_1_ = p_175663_1_ >> 4;
- p_175663_3_ = p_175663_3_ >> 4;
- p_175663_4_ = p_175663_4_ >> 4;
- p_175663_6_ = p_175663_6_ >> 4;
- for(int i = p_175663_1_; i <= p_175663_4_; ++i) {
- for(int j = p_175663_3_; j <= p_175663_6_; ++j) {
- if(!this.func_175680_a(i, j, p_175663_7_)) {
- return false;
- }
- }
- }
- return true;
- } else {
- return false;
- }
- }
- protected abstract boolean func_175680_a(int p_175680_1_, int p_175680_2_, boolean p_175680_3_);
- public Chunk func_175726_f(BlockPos p_175726_1_) {
- return this.func_72964_e(p_175726_1_.func_177958_n() >> 4, p_175726_1_.func_177952_p() >> 4);
- }
- public Chunk func_72964_e(int p_72964_1_, int p_72964_2_) {
- return this.field_73020_y.func_186025_d(p_72964_1_, p_72964_2_);
- }
- public boolean func_190526_b(int p_190526_1_, int p_190526_2_) {
- 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_);
- }
- public boolean func_180501_a(BlockPos p_180501_1_, IBlockState p_180501_2_, int p_180501_3_) {
- if(this.func_189509_E(p_180501_1_)) {
- return false;
- } else if(!this.field_72995_K && this.field_72986_A.func_76067_t() == WorldType.field_180272_g) {
- return false;
- } else {
- Chunk chunk = this.func_175726_f(p_180501_1_);
- Block block = p_180501_2_.func_177230_c();
- IBlockState iblockstate = chunk.func_177436_a(p_180501_1_, p_180501_2_);
- if(iblockstate == null) {
- return false;
- } else {
- if(p_180501_2_.func_185891_c() != iblockstate.func_185891_c() || p_180501_2_.func_185906_d() != iblockstate.func_185906_d()) {
- this.field_72984_F.func_76320_a("checkLight");
- this.func_175664_x(p_180501_1_);
- this.field_72984_F.func_76319_b();
- }
- if((p_180501_3_ & 2) != 0 && (!this.field_72995_K || (p_180501_3_ & 4) == 0) && chunk.func_150802_k()) {
- this.func_184138_a(p_180501_1_, iblockstate, p_180501_2_, p_180501_3_);
- }
- if(!this.field_72995_K && (p_180501_3_ & 1) != 0) {
- this.func_175722_b(p_180501_1_, iblockstate.func_177230_c(), true);
- if(p_180501_2_.func_185912_n()) {
- this.func_175666_e(p_180501_1_, block);
- }
- } else if(!this.field_72995_K && (p_180501_3_ & 16) == 0) {
- this.func_190522_c(p_180501_1_, block);
- }
- return true;
- }
- }
- }
- public boolean func_175698_g(BlockPos p_175698_1_) {
- return this.func_180501_a(p_175698_1_, Blocks.field_150350_a.func_176223_P(), 3);
- }
- public boolean func_175655_b(BlockPos p_175655_1_, boolean p_175655_2_) {
- IBlockState iblockstate = this.func_180495_p(p_175655_1_);
- Block block = iblockstate.func_177230_c();
- if(iblockstate.func_185904_a() == Material.field_151579_a) {
- return false;
- } else {
- this.func_175718_b(2001, p_175655_1_, Block.func_176210_f(iblockstate));
- if(p_175655_2_) {
- block.func_176226_b(this, p_175655_1_, iblockstate, 0);
- }
- return this.func_180501_a(p_175655_1_, Blocks.field_150350_a.func_176223_P(), 3);
- }
- }
- public boolean func_175656_a(BlockPos p_175656_1_, IBlockState p_175656_2_) {
- return this.func_180501_a(p_175656_1_, p_175656_2_, 3);
- }
- public void func_184138_a(BlockPos p_184138_1_, IBlockState p_184138_2_, IBlockState p_184138_3_, int p_184138_4_) {
- for(int i = 0; i < this.field_73021_x.size(); ++i) {
- ((IWorldEventListener)this.field_73021_x.get(i)).func_184376_a(this, p_184138_1_, p_184138_2_, p_184138_3_, p_184138_4_);
- }
- }
- public void func_175722_b(BlockPos p_175722_1_, Block p_175722_2_, boolean p_175722_3_) {
- if(this.field_72986_A.func_76067_t() != WorldType.field_180272_g) {
- this.func_175685_c(p_175722_1_, p_175722_2_, p_175722_3_);
- }
- }
- public void func_72975_g(int p_72975_1_, int p_72975_2_, int p_72975_3_, int p_72975_4_) {
- if(p_72975_3_ > p_72975_4_) {
- int i = p_72975_4_;
- p_72975_4_ = p_72975_3_;
- p_72975_3_ = i;
- }
- if(this.field_73011_w.func_191066_m()) {
- for(int j = p_72975_3_; j <= p_72975_4_; ++j) {
- this.func_180500_c(EnumSkyBlock.SKY, new BlockPos(p_72975_1_, j, p_72975_2_));
- }
- }
- this.func_147458_c(p_72975_1_, p_72975_3_, p_72975_2_, p_72975_1_, p_72975_4_, p_72975_2_);
- }
- public void func_175704_b(BlockPos p_175704_1_, BlockPos p_175704_2_) {
- 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());
- }
- 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_) {
- for(int i = 0; i < this.field_73021_x.size(); ++i) {
- ((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_);
- }
- }
- public void func_190522_c(BlockPos p_190522_1_, Block p_190522_2_) {
- this.func_190529_b(p_190522_1_.func_177976_e(), p_190522_2_, p_190522_1_);
- this.func_190529_b(p_190522_1_.func_177974_f(), p_190522_2_, p_190522_1_);
- this.func_190529_b(p_190522_1_.func_177977_b(), p_190522_2_, p_190522_1_);
- this.func_190529_b(p_190522_1_.func_177984_a(), p_190522_2_, p_190522_1_);
- this.func_190529_b(p_190522_1_.func_177978_c(), p_190522_2_, p_190522_1_);
- this.func_190529_b(p_190522_1_.func_177968_d(), p_190522_2_, p_190522_1_);
- }
- public void func_175685_c(BlockPos p_175685_1_, Block p_175685_2_, boolean p_175685_3_) {
- this.func_190524_a(p_175685_1_.func_177976_e(), p_175685_2_, p_175685_1_);
- this.func_190524_a(p_175685_1_.func_177974_f(), p_175685_2_, p_175685_1_);
- this.func_190524_a(p_175685_1_.func_177977_b(), p_175685_2_, p_175685_1_);
- this.func_190524_a(p_175685_1_.func_177984_a(), p_175685_2_, p_175685_1_);
- this.func_190524_a(p_175685_1_.func_177978_c(), p_175685_2_, p_175685_1_);
- this.func_190524_a(p_175685_1_.func_177968_d(), p_175685_2_, p_175685_1_);
- if(p_175685_3_) {
- this.func_190522_c(p_175685_1_, p_175685_2_);
- }
- }
- public void func_175695_a(BlockPos p_175695_1_, Block p_175695_2_, EnumFacing p_175695_3_) {
- if(p_175695_3_ != EnumFacing.WEST) {
- this.func_190524_a(p_175695_1_.func_177976_e(), p_175695_2_, p_175695_1_);
- }
- if(p_175695_3_ != EnumFacing.EAST) {
- this.func_190524_a(p_175695_1_.func_177974_f(), p_175695_2_, p_175695_1_);
- }
- if(p_175695_3_ != EnumFacing.DOWN) {
- this.func_190524_a(p_175695_1_.func_177977_b(), p_175695_2_, p_175695_1_);
- }
- if(p_175695_3_ != EnumFacing.UP) {
- this.func_190524_a(p_175695_1_.func_177984_a(), p_175695_2_, p_175695_1_);
- }
- if(p_175695_3_ != EnumFacing.NORTH) {
- this.func_190524_a(p_175695_1_.func_177978_c(), p_175695_2_, p_175695_1_);
- }
- if(p_175695_3_ != EnumFacing.SOUTH) {
- this.func_190524_a(p_175695_1_.func_177968_d(), p_175695_2_, p_175695_1_);
- }
- }
- public void func_190524_a(BlockPos p_190524_1_, final Block p_190524_2_, BlockPos p_190524_3_) {
- if(!this.field_72995_K) {
- IBlockState iblockstate = this.func_180495_p(p_190524_1_);
- try {
- iblockstate.func_189546_a(this, p_190524_1_, p_190524_2_, p_190524_3_);
- } catch (Throwable throwable) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable, "Exception while updating neighbours");
- CrashReportCategory crashreportcategory = crashreport.func_85058_a("Block being updated");
- crashreportcategory.func_189529_a("Source block type", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- try {
- 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()});
- } catch (Throwable var2) {
- return "ID #" + Block.func_149682_b(p_190524_2_);
- }
- }
- });
- CrashReportCategory.func_175750_a(crashreportcategory, p_190524_1_, iblockstate);
- throw new ReportedException(crashreport);
- }
- }
- }
- public void func_190529_b(BlockPos p_190529_1_, final Block p_190529_2_, BlockPos p_190529_3_) {
- if(!this.field_72995_K) {
- IBlockState iblockstate = this.func_180495_p(p_190529_1_);
- if(iblockstate.func_177230_c() == Blocks.field_190976_dk) {
- try {
- ((BlockObserver)iblockstate.func_177230_c()).func_190962_b(iblockstate, this, p_190529_1_, p_190529_2_, p_190529_3_);
- } catch (Throwable throwable) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable, "Exception while updating neighbours");
- CrashReportCategory crashreportcategory = crashreport.func_85058_a("Block being updated");
- crashreportcategory.func_189529_a("Source block type", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- try {
- 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()});
- } catch (Throwable var2) {
- return "ID #" + Block.func_149682_b(p_190529_2_);
- }
- }
- });
- CrashReportCategory.func_175750_a(crashreportcategory, p_190529_1_, iblockstate);
- throw new ReportedException(crashreport);
- }
- }
- }
- }
- public boolean func_175691_a(BlockPos p_175691_1_, Block p_175691_2_) {
- return false;
- }
- public boolean func_175678_i(BlockPos p_175678_1_) {
- return this.func_175726_f(p_175678_1_).func_177444_d(p_175678_1_);
- }
- public boolean func_175710_j(BlockPos p_175710_1_) {
- if(p_175710_1_.func_177956_o() >= this.func_181545_F()) {
- return this.func_175678_i(p_175710_1_);
- } else {
- BlockPos blockpos = new BlockPos(p_175710_1_.func_177958_n(), this.func_181545_F(), p_175710_1_.func_177952_p());
- if(!this.func_175678_i(blockpos)) {
- return false;
- } else {
- for(blockpos = blockpos.func_177977_b(); blockpos.func_177956_o() > p_175710_1_.func_177956_o(); blockpos = blockpos.func_177977_b()) {
- IBlockState iblockstate = this.func_180495_p(blockpos);
- if(iblockstate.func_185891_c() > 0 && !iblockstate.func_185904_a().func_76224_d()) {
- return false;
- }
- }
- return true;
- }
- }
- }
- public int func_175699_k(BlockPos p_175699_1_) {
- if(p_175699_1_.func_177956_o() < 0) {
- return 0;
- } else {
- if(p_175699_1_.func_177956_o() >= 256) {
- p_175699_1_ = new BlockPos(p_175699_1_.func_177958_n(), 255, p_175699_1_.func_177952_p());
- }
- return this.func_175726_f(p_175699_1_).func_177443_a(p_175699_1_, 0);
- }
- }
- public int func_175671_l(BlockPos p_175671_1_) {
- return this.func_175721_c(p_175671_1_, true);
- }
- public int func_175721_c(BlockPos p_175721_1_, boolean p_175721_2_) {
- 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) {
- if(p_175721_2_ && this.func_180495_p(p_175721_1_).func_185916_f()) {
- int i1 = this.func_175721_c(p_175721_1_.func_177984_a(), false);
- int i = this.func_175721_c(p_175721_1_.func_177974_f(), false);
- int j = this.func_175721_c(p_175721_1_.func_177976_e(), false);
- int k = this.func_175721_c(p_175721_1_.func_177968_d(), false);
- int l = this.func_175721_c(p_175721_1_.func_177978_c(), false);
- if(i > i1) {
- i1 = i;
- }
- if(j > i1) {
- i1 = j;
- }
- if(k > i1) {
- i1 = k;
- }
- if(l > i1) {
- i1 = l;
- }
- return i1;
- } else if(p_175721_1_.func_177956_o() < 0) {
- return 0;
- } else {
- if(p_175721_1_.func_177956_o() >= 256) {
- p_175721_1_ = new BlockPos(p_175721_1_.func_177958_n(), 255, p_175721_1_.func_177952_p());
- }
- Chunk chunk = this.func_175726_f(p_175721_1_);
- return chunk.func_177443_a(p_175721_1_, this.field_73008_k);
- }
- } else {
- return 15;
- }
- }
- public BlockPos func_175645_m(BlockPos p_175645_1_) {
- 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());
- }
- public int func_189649_b(int p_189649_1_, int p_189649_2_) {
- int i;
- if(p_189649_1_ >= -30000000 && p_189649_2_ >= -30000000 && p_189649_1_ < 30000000 && p_189649_2_ < 30000000) {
- if(this.func_175680_a(p_189649_1_ >> 4, p_189649_2_ >> 4, true)) {
- i = this.func_72964_e(p_189649_1_ >> 4, p_189649_2_ >> 4).func_76611_b(p_189649_1_ & 15, p_189649_2_ & 15);
- } else {
- i = 0;
- }
- } else {
- i = this.func_181545_F() + 1;
- }
- return i;
- }
- @Deprecated
- public int func_82734_g(int p_82734_1_, int p_82734_2_) {
- if(p_82734_1_ >= -30000000 && p_82734_2_ >= -30000000 && p_82734_1_ < 30000000 && p_82734_2_ < 30000000) {
- if(!this.func_175680_a(p_82734_1_ >> 4, p_82734_2_ >> 4, true)) {
- return 0;
- } else {
- Chunk chunk = this.func_72964_e(p_82734_1_ >> 4, p_82734_2_ >> 4);
- return chunk.func_177442_v();
- }
- } else {
- return this.func_181545_F() + 1;
- }
- }
- @SideOnly(Side.CLIENT)
- public int func_175705_a(EnumSkyBlock p_175705_1_, BlockPos p_175705_2_) {
- if(!this.field_73011_w.func_191066_m() && p_175705_1_ == EnumSkyBlock.SKY) {
- return 0;
- } else {
- if(p_175705_2_.func_177956_o() < 0) {
- p_175705_2_ = new BlockPos(p_175705_2_.func_177958_n(), 0, p_175705_2_.func_177952_p());
- }
- if(!this.func_175701_a(p_175705_2_)) {
- return p_175705_1_.field_77198_c;
- } else if(!this.func_175667_e(p_175705_2_)) {
- return p_175705_1_.field_77198_c;
- } else if(this.func_180495_p(p_175705_2_).func_185916_f()) {
- int i1 = this.func_175642_b(p_175705_1_, p_175705_2_.func_177984_a());
- int i = this.func_175642_b(p_175705_1_, p_175705_2_.func_177974_f());
- int j = this.func_175642_b(p_175705_1_, p_175705_2_.func_177976_e());
- int k = this.func_175642_b(p_175705_1_, p_175705_2_.func_177968_d());
- int l = this.func_175642_b(p_175705_1_, p_175705_2_.func_177978_c());
- if(i > i1) {
- i1 = i;
- }
- if(j > i1) {
- i1 = j;
- }
- if(k > i1) {
- i1 = k;
- }
- if(l > i1) {
- i1 = l;
- }
- return i1;
- } else {
- Chunk chunk = this.func_175726_f(p_175705_2_);
- return chunk.func_177413_a(p_175705_1_, p_175705_2_);
- }
- }
- }
- public int func_175642_b(EnumSkyBlock p_175642_1_, BlockPos p_175642_2_) {
- if(p_175642_2_.func_177956_o() < 0) {
- p_175642_2_ = new BlockPos(p_175642_2_.func_177958_n(), 0, p_175642_2_.func_177952_p());
- }
- if(!this.func_175701_a(p_175642_2_)) {
- return p_175642_1_.field_77198_c;
- } else if(!this.func_175667_e(p_175642_2_)) {
- return p_175642_1_.field_77198_c;
- } else {
- Chunk chunk = this.func_175726_f(p_175642_2_);
- return chunk.func_177413_a(p_175642_1_, p_175642_2_);
- }
- }
- public void func_175653_a(EnumSkyBlock p_175653_1_, BlockPos p_175653_2_, int p_175653_3_) {
- if(this.func_175701_a(p_175653_2_)) {
- if(this.func_175667_e(p_175653_2_)) {
- Chunk chunk = this.func_175726_f(p_175653_2_);
- chunk.func_177431_a(p_175653_1_, p_175653_2_, p_175653_3_);
- this.func_175679_n(p_175653_2_);
- }
- }
- }
- public void func_175679_n(BlockPos p_175679_1_) {
- for(int i = 0; i < this.field_73021_x.size(); ++i) {
- ((IWorldEventListener)this.field_73021_x.get(i)).func_174959_b(p_175679_1_);
- }
- }
- @SideOnly(Side.CLIENT)
- public int func_175626_b(BlockPos p_175626_1_, int p_175626_2_) {
- int i = this.func_175705_a(EnumSkyBlock.SKY, p_175626_1_);
- int j = this.func_175705_a(EnumSkyBlock.BLOCK, p_175626_1_);
- if(j < p_175626_2_) {
- j = p_175626_2_;
- }
- return i << 20 | j << 4;
- }
- public float func_175724_o(BlockPos p_175724_1_) {
- return this.field_73011_w.func_177497_p()[this.func_175671_l(p_175724_1_)];
- }
- public IBlockState func_180495_p(BlockPos p_180495_1_) {
- if(this.func_189509_E(p_180495_1_)) {
- return Blocks.field_150350_a.func_176223_P();
- } else {
- Chunk chunk = this.func_175726_f(p_180495_1_);
- return chunk.func_177435_g(p_180495_1_);
- }
- }
- public boolean func_72935_r() {
- return this.field_73008_k < 4;
- }
- @Nullable
- public RayTraceResult func_72933_a(Vec3d p_72933_1_, Vec3d p_72933_2_) {
- return this.func_147447_a(p_72933_1_, p_72933_2_, false, false, false);
- }
- @Nullable
- public RayTraceResult func_72901_a(Vec3d p_72901_1_, Vec3d p_72901_2_, boolean p_72901_3_) {
- return this.func_147447_a(p_72901_1_, p_72901_2_, p_72901_3_, false, false);
- }
- @Nullable
- 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_) {
- 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)) {
- 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)) {
- int i = MathHelper.func_76128_c(p_147447_2_.field_72450_a);
- int j = MathHelper.func_76128_c(p_147447_2_.field_72448_b);
- int k = MathHelper.func_76128_c(p_147447_2_.field_72449_c);
- int l = MathHelper.func_76128_c(p_147447_1_.field_72450_a);
- int i1 = MathHelper.func_76128_c(p_147447_1_.field_72448_b);
- int j1 = MathHelper.func_76128_c(p_147447_1_.field_72449_c);
- BlockPos blockpos = new BlockPos(l, i1, j1);
- IBlockState iblockstate = this.func_180495_p(blockpos);
- Block block = iblockstate.func_177230_c();
- if((!p_147447_4_ || iblockstate.func_185890_d(this, blockpos) != Block.field_185506_k) && block.func_176209_a(iblockstate, p_147447_3_)) {
- RayTraceResult raytraceresult = iblockstate.func_185910_a(this, blockpos, p_147447_1_, p_147447_2_);
- if(raytraceresult != null) {
- return raytraceresult;
- }
- }
- RayTraceResult raytraceresult2 = null;
- int k1 = 200;
- while(k1-- >= 0) {
- 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)) {
- return null;
- }
- if(l == i && i1 == j && j1 == k) {
- return p_147447_5_?raytraceresult2:null;
- }
- boolean flag2 = true;
- boolean flag = true;
- boolean flag1 = true;
- double d0 = 999.0D;
- double d1 = 999.0D;
- double d2 = 999.0D;
- if(i > l) {
- d0 = (double)l + 1.0D;
- } else if(i < l) {
- d0 = (double)l + 0.0D;
- } else {
- flag2 = false;
- }
- if(j > i1) {
- d1 = (double)i1 + 1.0D;
- } else if(j < i1) {
- d1 = (double)i1 + 0.0D;
- } else {
- flag = false;
- }
- if(k > j1) {
- d2 = (double)j1 + 1.0D;
- } else if(k < j1) {
- d2 = (double)j1 + 0.0D;
- } else {
- flag1 = false;
- }
- double d3 = 999.0D;
- double d4 = 999.0D;
- double d5 = 999.0D;
- double d6 = p_147447_2_.field_72450_a - p_147447_1_.field_72450_a;
- double d7 = p_147447_2_.field_72448_b - p_147447_1_.field_72448_b;
- double d8 = p_147447_2_.field_72449_c - p_147447_1_.field_72449_c;
- if(flag2) {
- d3 = (d0 - p_147447_1_.field_72450_a) / d6;
- }
- if(flag) {
- d4 = (d1 - p_147447_1_.field_72448_b) / d7;
- }
- if(flag1) {
- d5 = (d2 - p_147447_1_.field_72449_c) / d8;
- }
- if(d3 == -0.0D) {
- d3 = -1.0E-4D;
- }
- if(d4 == -0.0D) {
- d4 = -1.0E-4D;
- }
- if(d5 == -0.0D) {
- d5 = -1.0E-4D;
- }
- EnumFacing enumfacing;
- if(d3 < d4 && d3 < d5) {
- enumfacing = i > l?EnumFacing.WEST:EnumFacing.EAST;
- p_147447_1_ = new Vec3d(d0, p_147447_1_.field_72448_b + d7 * d3, p_147447_1_.field_72449_c + d8 * d3);
- } else if(d4 < d5) {
- enumfacing = j > i1?EnumFacing.DOWN:EnumFacing.UP;
- p_147447_1_ = new Vec3d(p_147447_1_.field_72450_a + d6 * d4, d1, p_147447_1_.field_72449_c + d8 * d4);
- } else {
- enumfacing = k > j1?EnumFacing.NORTH:EnumFacing.SOUTH;
- p_147447_1_ = new Vec3d(p_147447_1_.field_72450_a + d6 * d5, p_147447_1_.field_72448_b + d7 * d5, d2);
- }
- l = MathHelper.func_76128_c(p_147447_1_.field_72450_a) - (enumfacing == EnumFacing.EAST?1:0);
- i1 = MathHelper.func_76128_c(p_147447_1_.field_72448_b) - (enumfacing == EnumFacing.UP?1:0);
- j1 = MathHelper.func_76128_c(p_147447_1_.field_72449_c) - (enumfacing == EnumFacing.SOUTH?1:0);
- blockpos = new BlockPos(l, i1, j1);
- IBlockState iblockstate1 = this.func_180495_p(blockpos);
- Block block1 = iblockstate1.func_177230_c();
- if(!p_147447_4_ || iblockstate1.func_185904_a() == Material.field_151567_E || iblockstate1.func_185890_d(this, blockpos) != Block.field_185506_k) {
- if(block1.func_176209_a(iblockstate1, p_147447_3_)) {
- RayTraceResult raytraceresult1 = iblockstate1.func_185910_a(this, blockpos, p_147447_1_, p_147447_2_);
- if(raytraceresult1 != null) {
- return raytraceresult1;
- }
- } else {
- raytraceresult2 = new RayTraceResult(RayTraceResult.Type.MISS, p_147447_1_, enumfacing, blockpos);
- }
- }
- }
- return p_147447_5_?raytraceresult2:null;
- } else {
- return null;
- }
- } else {
- return null;
- }
- }
- 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_) {
- 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_);
- }
- 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_) {
- for(int i = 0; i < this.field_73021_x.size(); ++i) {
- ((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_);
- }
- }
- 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_) {
- }
- public void func_184149_a(BlockPos p_184149_1_, @Nullable SoundEvent p_184149_2_) {
- for(int i = 0; i < this.field_73021_x.size(); ++i) {
- ((IWorldEventListener)this.field_73021_x.get(i)).func_184377_a(p_184149_2_, p_184149_1_);
- }
- }
- 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_) {
- 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_);
- }
- 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_) {
- for(int i = 0; i < this.field_73021_x.size(); ++i) {
- ((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_);
- }
- }
- @SideOnly(Side.CLIENT)
- 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_) {
- 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_);
- }
- 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_) {
- for(int i = 0; i < this.field_73021_x.size(); ++i) {
- ((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_);
- }
- }
- public boolean func_72942_c(Entity p_72942_1_) {
- this.field_73007_j.add(p_72942_1_);
- return true;
- }
- public boolean func_72838_d(Entity p_72838_1_) {
- int i = MathHelper.func_76128_c(p_72838_1_.field_70165_t / 16.0D);
- int j = MathHelper.func_76128_c(p_72838_1_.field_70161_v / 16.0D);
- boolean flag = p_72838_1_.field_98038_p;
- if(p_72838_1_ instanceof EntityPlayer) {
- flag = true;
- }
- if(!flag && !this.func_175680_a(i, j, false)) {
- return false;
- } else {
- if(p_72838_1_ instanceof EntityPlayer) {
- EntityPlayer entityplayer = (EntityPlayer)p_72838_1_;
- this.field_73010_i.add(entityplayer);
- this.func_72854_c();
- }
- this.func_72964_e(i, j).func_76612_a(p_72838_1_);
- this.field_72996_f.add(p_72838_1_);
- this.func_72923_a(p_72838_1_);
- return true;
- }
- }
- public void func_72923_a(Entity p_72923_1_) {
- for(int i = 0; i < this.field_73021_x.size(); ++i) {
- ((IWorldEventListener)this.field_73021_x.get(i)).func_72703_a(p_72923_1_);
- }
- }
- public void func_72847_b(Entity p_72847_1_) {
- for(int i = 0; i < this.field_73021_x.size(); ++i) {
- ((IWorldEventListener)this.field_73021_x.get(i)).func_72709_b(p_72847_1_);
- }
- }
- public void func_72900_e(Entity p_72900_1_) {
- if(p_72900_1_.func_184207_aI()) {
- p_72900_1_.func_184226_ay();
- }
- if(p_72900_1_.func_184218_aH()) {
- p_72900_1_.func_184210_p();
- }
- p_72900_1_.func_70106_y();
- if(p_72900_1_ instanceof EntityPlayer) {
- this.field_73010_i.remove(p_72900_1_);
- this.func_72854_c();
- this.func_72847_b(p_72900_1_);
- }
- }
- public void func_72973_f(Entity p_72973_1_) {
- p_72973_1_.func_184174_b(false);
- p_72973_1_.func_70106_y();
- if(p_72973_1_ instanceof EntityPlayer) {
- this.field_73010_i.remove(p_72973_1_);
- this.func_72854_c();
- }
- int i = p_72973_1_.field_70176_ah;
- int j = p_72973_1_.field_70164_aj;
- if(p_72973_1_.field_70175_ag && this.func_175680_a(i, j, true)) {
- this.func_72964_e(i, j).func_76622_b(p_72973_1_);
- }
- this.field_72996_f.remove(p_72973_1_);
- this.func_72847_b(p_72973_1_);
- }
- public void func_72954_a(IWorldEventListener p_72954_1_) {
- this.field_73021_x.add(p_72954_1_);
- }
- private boolean func_191504_a(@Nullable Entity p_191504_1_, AxisAlignedBB p_191504_2_, boolean p_191504_3_, @Nullable List<AxisAlignedBB> p_191504_4_) {
- int i = MathHelper.func_76128_c(p_191504_2_.field_72340_a) - 1;
- int j = MathHelper.func_76143_f(p_191504_2_.field_72336_d) + 1;
- int k = MathHelper.func_76128_c(p_191504_2_.field_72338_b) - 1;
- int l = MathHelper.func_76143_f(p_191504_2_.field_72337_e) + 1;
- int i1 = MathHelper.func_76128_c(p_191504_2_.field_72339_c) - 1;
- int j1 = MathHelper.func_76143_f(p_191504_2_.field_72334_f) + 1;
- WorldBorder worldborder = this.func_175723_af();
- boolean flag = p_191504_1_ != null && p_191504_1_.func_174832_aS();
- boolean flag1 = p_191504_1_ != null && this.func_191503_g(p_191504_1_);
- IBlockState iblockstate = Blocks.field_150348_b.func_176223_P();
- BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
- try {
- for(int k1 = i; k1 < j; ++k1) {
- for(int l1 = i1; l1 < j1; ++l1) {
- boolean flag2 = k1 == i || k1 == j - 1;
- boolean flag3 = l1 == i1 || l1 == j1 - 1;
- if((!flag2 || !flag3) && this.func_175667_e(blockpos$pooledmutableblockpos.func_181079_c(k1, 64, l1))) {
- for(int i2 = k; i2 < l; ++i2) {
- if(!flag2 && !flag3 || i2 != l - 1) {
- if(p_191504_3_) {
- if(k1 < -30000000 || k1 >= 30000000 || l1 < -30000000 || l1 >= 30000000) {
- boolean lvt_21_1_ = true;
- return lvt_21_1_;
- }
- } else if(p_191504_1_ != null && flag == flag1) {
- p_191504_1_.func_174821_h(!flag1);
- }
- blockpos$pooledmutableblockpos.func_181079_c(k1, i2, l1);
- IBlockState iblockstate1;
- if(!p_191504_3_ && !worldborder.func_177746_a(blockpos$pooledmutableblockpos) && flag1) {
- iblockstate1 = iblockstate;
- } else {
- iblockstate1 = this.func_180495_p(blockpos$pooledmutableblockpos);
- }
- iblockstate1.func_185908_a(this, blockpos$pooledmutableblockpos, p_191504_2_, p_191504_4_, p_191504_1_, false);
- if(p_191504_3_ && !p_191504_4_.isEmpty()) {
- boolean flag5 = true;
- return flag5;
- }
- }
- }
- }
- }
- }
- } finally {
- blockpos$pooledmutableblockpos.func_185344_t();
- }
- return !p_191504_4_.isEmpty();
- }
- public List<AxisAlignedBB> func_184144_a(@Nullable Entity p_184144_1_, AxisAlignedBB p_184144_2_) {
- List<AxisAlignedBB> list = Lists.<AxisAlignedBB>newArrayList();
- this.func_191504_a(p_184144_1_, p_184144_2_, false, list);
- if(p_184144_1_ != null) {
- List<Entity> list1 = this.func_72839_b(p_184144_1_, p_184144_2_.func_186662_g(0.25D));
- for(int i = 0; i < list1.size(); ++i) {
- Entity entity = (Entity)list1.get(i);
- if(!p_184144_1_.func_184223_x(entity)) {
- AxisAlignedBB axisalignedbb = entity.func_70046_E();
- if(axisalignedbb != null && axisalignedbb.func_72326_a(p_184144_2_)) {
- list.add(axisalignedbb);
- }
- axisalignedbb = p_184144_1_.func_70114_g(entity);
- if(axisalignedbb != null && axisalignedbb.func_72326_a(p_184144_2_)) {
- list.add(axisalignedbb);
- }
- }
- }
- }
- return list;
- }
- @SideOnly(Side.CLIENT)
- public void func_72848_b(IWorldEventListener p_72848_1_) {
- this.field_73021_x.remove(p_72848_1_);
- }
- public boolean func_191503_g(Entity p_191503_1_) {
- double d0 = this.field_175728_M.func_177726_b();
- double d1 = this.field_175728_M.func_177736_c();
- double d2 = this.field_175728_M.func_177728_d();
- double d3 = this.field_175728_M.func_177733_e();
- if(p_191503_1_.func_174832_aS()) {
- ++d0;
- ++d1;
- --d2;
- --d3;
- } else {
- --d0;
- --d1;
- ++d2;
- ++d3;
- }
- 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;
- }
- public boolean func_184143_b(AxisAlignedBB p_184143_1_) {
- return this.func_191504_a((Entity)null, p_184143_1_, true, Lists.<AxisAlignedBB>newArrayList());
- }
- public int func_72967_a(float p_72967_1_) {
- float f = this.func_72826_c(p_72967_1_);
- float f1 = 1.0F - (MathHelper.func_76134_b(f * 6.2831855F) * 2.0F + 0.5F);
- f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F);
- f1 = 1.0F - f1;
- f1 = (float)((double)f1 * (1.0D - (double)(this.func_72867_j(p_72967_1_) * 5.0F) / 16.0D));
- f1 = (float)((double)f1 * (1.0D - (double)(this.func_72819_i(p_72967_1_) * 5.0F) / 16.0D));
- f1 = 1.0F - f1;
- return (int)(f1 * 11.0F);
- }
- @SideOnly(Side.CLIENT)
- public float func_72971_b(float p_72971_1_) {
- float f = this.func_72826_c(p_72971_1_);
- float f1 = 1.0F - (MathHelper.func_76134_b(f * 6.2831855F) * 2.0F + 0.2F);
- f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F);
- f1 = 1.0F - f1;
- f1 = (float)((double)f1 * (1.0D - (double)(this.func_72867_j(p_72971_1_) * 5.0F) / 16.0D));
- f1 = (float)((double)f1 * (1.0D - (double)(this.func_72819_i(p_72971_1_) * 5.0F) / 16.0D));
- return f1 * 0.8F + 0.2F;
- }
- @SideOnly(Side.CLIENT)
- public Vec3d func_72833_a(Entity p_72833_1_, float p_72833_2_) {
- float f = this.func_72826_c(p_72833_2_);
- float f1 = MathHelper.func_76134_b(f * 6.2831855F) * 2.0F + 0.5F;
- f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F);
- int i = MathHelper.func_76128_c(p_72833_1_.field_70165_t);
- int j = MathHelper.func_76128_c(p_72833_1_.field_70163_u);
- int k = MathHelper.func_76128_c(p_72833_1_.field_70161_v);
- BlockPos blockpos = new BlockPos(i, j, k);
- Biome biome = this.func_180494_b(blockpos);
- float f2 = biome.func_180626_a(blockpos);
- int l = biome.func_76731_a(f2);
- float f3 = (float)(l >> 16 & 255) / 255.0F;
- float f4 = (float)(l >> 8 & 255) / 255.0F;
- float f5 = (float)(l & 255) / 255.0F;
- f3 = f3 * f1;
- f4 = f4 * f1;
- f5 = f5 * f1;
- float f6 = this.func_72867_j(p_72833_2_);
- if(f6 > 0.0F) {
- float f7 = (f3 * 0.3F + f4 * 0.59F + f5 * 0.11F) * 0.6F;
- float f8 = 1.0F - f6 * 0.75F;
- f3 = f3 * f8 + f7 * (1.0F - f8);
- f4 = f4 * f8 + f7 * (1.0F - f8);
- f5 = f5 * f8 + f7 * (1.0F - f8);
- }
- float f10 = this.func_72819_i(p_72833_2_);
- if(f10 > 0.0F) {
- float f11 = (f3 * 0.3F + f4 * 0.59F + f5 * 0.11F) * 0.2F;
- float f9 = 1.0F - f10 * 0.75F;
- f3 = f3 * f9 + f11 * (1.0F - f9);
- f4 = f4 * f9 + f11 * (1.0F - f9);
- f5 = f5 * f9 + f11 * (1.0F - f9);
- }
- if(this.field_73016_r > 0) {
- float f12 = (float)this.field_73016_r - p_72833_2_;
- if(f12 > 1.0F) {
- f12 = 1.0F;
- }
- f12 = f12 * 0.45F;
- f3 = f3 * (1.0F - f12) + 0.8F * f12;
- f4 = f4 * (1.0F - f12) + 0.8F * f12;
- f5 = f5 * (1.0F - f12) + 1.0F * f12;
- }
- return new Vec3d((double)f3, (double)f4, (double)f5);
- }
- public float func_72826_c(float p_72826_1_) {
- return this.field_73011_w.func_76563_a(this.field_72986_A.func_76073_f(), p_72826_1_);
- }
- @SideOnly(Side.CLIENT)
- public int func_72853_d() {
- return this.field_73011_w.func_76559_b(this.field_72986_A.func_76073_f());
- }
- public float func_130001_d() {
- return WorldProvider.field_111203_a[this.field_73011_w.func_76559_b(this.field_72986_A.func_76073_f())];
- }
- public float func_72929_e(float p_72929_1_) {
- float f = this.func_72826_c(p_72929_1_);
- return f * 6.2831855F;
- }
- @SideOnly(Side.CLIENT)
- public Vec3d func_72824_f(float p_72824_1_) {
- float f = this.func_72826_c(p_72824_1_);
- float f1 = MathHelper.func_76134_b(f * 6.2831855F) * 2.0F + 0.5F;
- f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F);
- float f2 = 1.0F;
- float f3 = 1.0F;
- float f4 = 1.0F;
- float f5 = this.func_72867_j(p_72824_1_);
- if(f5 > 0.0F) {
- float f6 = (f2 * 0.3F + f3 * 0.59F + f4 * 0.11F) * 0.6F;
- float f7 = 1.0F - f5 * 0.95F;
- f2 = f2 * f7 + f6 * (1.0F - f7);
- f3 = f3 * f7 + f6 * (1.0F - f7);
- f4 = f4 * f7 + f6 * (1.0F - f7);
- }
- f2 = f2 * (f1 * 0.9F + 0.1F);
- f3 = f3 * (f1 * 0.9F + 0.1F);
- f4 = f4 * (f1 * 0.85F + 0.15F);
- float f9 = this.func_72819_i(p_72824_1_);
- if(f9 > 0.0F) {
- float f10 = (f2 * 0.3F + f3 * 0.59F + f4 * 0.11F) * 0.2F;
- float f8 = 1.0F - f9 * 0.95F;
- f2 = f2 * f8 + f10 * (1.0F - f8);
- f3 = f3 * f8 + f10 * (1.0F - f8);
- f4 = f4 * f8 + f10 * (1.0F - f8);
- }
- return new Vec3d((double)f2, (double)f3, (double)f4);
- }
- @SideOnly(Side.CLIENT)
- public Vec3d func_72948_g(float p_72948_1_) {
- float f = this.func_72826_c(p_72948_1_);
- return this.field_73011_w.func_76562_b(f, p_72948_1_);
- }
- public BlockPos func_175725_q(BlockPos p_175725_1_) {
- return this.func_175726_f(p_175725_1_).func_177440_h(p_175725_1_);
- }
- public BlockPos func_175672_r(BlockPos p_175672_1_) {
- Chunk chunk = this.func_175726_f(p_175672_1_);
- BlockPos blockpos;
- BlockPos blockpos1;
- 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) {
- blockpos1 = blockpos.func_177977_b();
- Material material = chunk.func_177435_g(blockpos1).func_185904_a();
- if(material.func_76230_c() && material != Material.field_151584_j) {
- break;
- }
- }
- return blockpos;
- }
- @SideOnly(Side.CLIENT)
- public float func_72880_h(float p_72880_1_) {
- float f = this.func_72826_c(p_72880_1_);
- float f1 = 1.0F - (MathHelper.func_76134_b(f * 6.2831855F) * 2.0F + 0.25F);
- f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F);
- return f1 * f1 * 0.5F;
- }
- public boolean func_184145_b(BlockPos p_184145_1_, Block p_184145_2_) {
- return true;
- }
- public void func_175684_a(BlockPos p_175684_1_, Block p_175684_2_, int p_175684_3_) {
- }
- public void func_175654_a(BlockPos p_175654_1_, Block p_175654_2_, int p_175654_3_, int p_175654_4_) {
- }
- public void func_180497_b(BlockPos p_180497_1_, Block p_180497_2_, int p_180497_3_, int p_180497_4_) {
- }
- public void func_72939_s() {
- this.field_72984_F.func_76320_a("entities");
- this.field_72984_F.func_76320_a("global");
- for(int i = 0; i < this.field_73007_j.size(); ++i) {
- Entity entity = (Entity)this.field_73007_j.get(i);
- try {
- ++entity.field_70173_aa;
- entity.func_70071_h_();
- } catch (Throwable throwable2) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable2, "Ticking entity");
- CrashReportCategory crashreportcategory = crashreport.func_85058_a("Entity being ticked");
- if(entity == null) {
- crashreportcategory.func_71507_a("Entity", "~~NULL~~");
- } else {
- entity.func_85029_a(crashreportcategory);
- }
- throw new ReportedException(crashreport);
- }
- if(entity.field_70128_L) {
- this.field_73007_j.remove(i--);
- }
- }
- this.field_72984_F.func_76318_c("remove");
- this.field_72996_f.removeAll(this.field_72997_g);
- for(int k = 0; k < this.field_72997_g.size(); ++k) {
- Entity entity1 = (Entity)this.field_72997_g.get(k);
- int j = entity1.field_70176_ah;
- int k1 = entity1.field_70164_aj;
- if(entity1.field_70175_ag && this.func_175680_a(j, k1, true)) {
- this.func_72964_e(j, k1).func_76622_b(entity1);
- }
- }
- for(int l = 0; l < this.field_72997_g.size(); ++l) {
- this.func_72847_b((Entity)this.field_72997_g.get(l));
- }
- this.field_72997_g.clear();
- this.func_184147_l();
- this.field_72984_F.func_76318_c("regular");
- for(int i1 = 0; i1 < this.field_72996_f.size(); ++i1) {
- Entity entity2 = (Entity)this.field_72996_f.get(i1);
- Entity entity3 = entity2.func_184187_bx();
- if(entity3 != null) {
- if(!entity3.field_70128_L && entity3.func_184196_w(entity2)) {
- continue;
- }
- entity2.func_184210_p();
- }
- this.field_72984_F.func_76320_a("tick");
- if(!entity2.field_70128_L && !(entity2 instanceof EntityPlayerMP)) {
- try {
- this.func_72870_g(entity2);
- } catch (Throwable throwable1) {
- CrashReport crashreport1 = CrashReport.func_85055_a(throwable1, "Ticking entity");
- CrashReportCategory crashreportcategory1 = crashreport1.func_85058_a("Entity being ticked");
- entity2.func_85029_a(crashreportcategory1);
- throw new ReportedException(crashreport1);
- }
- }
- this.field_72984_F.func_76319_b();
- this.field_72984_F.func_76320_a("remove");
- if(entity2.field_70128_L) {
- int l1 = entity2.field_70176_ah;
- int i2 = entity2.field_70164_aj;
- if(entity2.field_70175_ag && this.func_175680_a(l1, i2, true)) {
- this.func_72964_e(l1, i2).func_76622_b(entity2);
- }
- this.field_72996_f.remove(i1--);
- this.func_72847_b(entity2);
- }
- this.field_72984_F.func_76319_b();
- }
- this.field_72984_F.func_76318_c("blockEntities");
- this.field_147481_N = true;
- Iterator<TileEntity> iterator = this.field_175730_i.iterator();
- while(iterator.hasNext()) {
- TileEntity tileentity = (TileEntity)iterator.next();
- if(!tileentity.func_145837_r() && tileentity.func_145830_o()) {
- BlockPos blockpos = tileentity.func_174877_v();
- if(this.func_175667_e(blockpos) && this.field_175728_M.func_177746_a(blockpos)) {
- try {
- this.field_72984_F.func_76320_a(tileentity.getClass().getSimpleName());
- ((ITickable)tileentity).func_73660_a();
- this.field_72984_F.func_76319_b();
- } catch (Throwable throwable) {
- CrashReport crashreport2 = CrashReport.func_85055_a(throwable, "Ticking block entity");
- CrashReportCategory crashreportcategory2 = crashreport2.func_85058_a("Block entity being ticked");
- tileentity.func_145828_a(crashreportcategory2);
- throw new ReportedException(crashreport2);
- }
- }
- }
- if(tileentity.func_145837_r()) {
- iterator.remove();
- this.field_147482_g.remove(tileentity);
- if(this.func_175667_e(tileentity.func_174877_v())) {
- this.func_175726_f(tileentity.func_174877_v()).func_177425_e(tileentity.func_174877_v());
- }
- }
- }
- this.field_147481_N = false;
- if(!this.field_147483_b.isEmpty()) {
- this.field_175730_i.removeAll(this.field_147483_b);
- this.field_147482_g.removeAll(this.field_147483_b);
- this.field_147483_b.clear();
- }
- this.field_72984_F.func_76318_c("pendingBlockEntities");
- if(!this.field_147484_a.isEmpty()) {
- for(int j1 = 0; j1 < this.field_147484_a.size(); ++j1) {
- TileEntity tileentity1 = (TileEntity)this.field_147484_a.get(j1);
- if(!tileentity1.func_145837_r()) {
- if(!this.field_147482_g.contains(tileentity1)) {
- this.func_175700_a(tileentity1);
- }
- if(this.func_175667_e(tileentity1.func_174877_v())) {
- Chunk chunk = this.func_175726_f(tileentity1.func_174877_v());
- IBlockState iblockstate = chunk.func_177435_g(tileentity1.func_174877_v());
- chunk.func_177426_a(tileentity1.func_174877_v(), tileentity1);
- this.func_184138_a(tileentity1.func_174877_v(), iblockstate, iblockstate, 3);
- }
- }
- }
- this.field_147484_a.clear();
- }
- this.field_72984_F.func_76319_b();
- this.field_72984_F.func_76319_b();
- }
- protected void func_184147_l() {
- }
- public boolean func_175700_a(TileEntity p_175700_1_) {
- boolean flag = this.field_147482_g.add(p_175700_1_);
- if(flag && p_175700_1_ instanceof ITickable) {
- this.field_175730_i.add(p_175700_1_);
- }
- if(this.field_72995_K) {
- BlockPos blockpos = p_175700_1_.func_174877_v();
- IBlockState iblockstate = this.func_180495_p(blockpos);
- this.func_184138_a(blockpos, iblockstate, iblockstate, 2);
- }
- return flag;
- }
- public void func_147448_a(Collection<TileEntity> p_147448_1_) {
- if(this.field_147481_N) {
- this.field_147484_a.addAll(p_147448_1_);
- } else {
- for(TileEntity tileentity : p_147448_1_) {
- this.func_175700_a(tileentity);
- }
- }
- }
- public void func_72870_g(Entity p_72870_1_) {
- this.func_72866_a(p_72870_1_, true);
- }
- public void func_72866_a(Entity p_72866_1_, boolean p_72866_2_) {
- if(!(p_72866_1_ instanceof EntityPlayer)) {
- int i = MathHelper.func_76128_c(p_72866_1_.field_70165_t);
- int j = MathHelper.func_76128_c(p_72866_1_.field_70161_v);
- int k = 32;
- if(p_72866_2_ && !this.func_175663_a(i - 32, 0, j - 32, i + 32, 0, j + 32, true)) {
- return;
- }
- }
- p_72866_1_.field_70142_S = p_72866_1_.field_70165_t;
- p_72866_1_.field_70137_T = p_72866_1_.field_70163_u;
- p_72866_1_.field_70136_U = p_72866_1_.field_70161_v;
- p_72866_1_.field_70126_B = p_72866_1_.field_70177_z;
- p_72866_1_.field_70127_C = p_72866_1_.field_70125_A;
- if(p_72866_2_ && p_72866_1_.field_70175_ag) {
- ++p_72866_1_.field_70173_aa;
- if(p_72866_1_.func_184218_aH()) {
- p_72866_1_.func_70098_U();
- } else {
- p_72866_1_.func_70071_h_();
- }
- }
- this.field_72984_F.func_76320_a("chunkCheck");
- if(Double.isNaN(p_72866_1_.field_70165_t) || Double.isInfinite(p_72866_1_.field_70165_t)) {
- p_72866_1_.field_70165_t = p_72866_1_.field_70142_S;
- }
- if(Double.isNaN(p_72866_1_.field_70163_u) || Double.isInfinite(p_72866_1_.field_70163_u)) {
- p_72866_1_.field_70163_u = p_72866_1_.field_70137_T;
- }
- if(Double.isNaN(p_72866_1_.field_70161_v) || Double.isInfinite(p_72866_1_.field_70161_v)) {
- p_72866_1_.field_70161_v = p_72866_1_.field_70136_U;
- }
- if(Double.isNaN((double)p_72866_1_.field_70125_A) || Double.isInfinite((double)p_72866_1_.field_70125_A)) {
- p_72866_1_.field_70125_A = p_72866_1_.field_70127_C;
- }
- if(Double.isNaN((double)p_72866_1_.field_70177_z) || Double.isInfinite((double)p_72866_1_.field_70177_z)) {
- p_72866_1_.field_70177_z = p_72866_1_.field_70126_B;
- }
- int l = MathHelper.func_76128_c(p_72866_1_.field_70165_t / 16.0D);
- int i1 = MathHelper.func_76128_c(p_72866_1_.field_70163_u / 16.0D);
- int j1 = MathHelper.func_76128_c(p_72866_1_.field_70161_v / 16.0D);
- 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) {
- if(p_72866_1_.field_70175_ag && this.func_175680_a(p_72866_1_.field_70176_ah, p_72866_1_.field_70164_aj, true)) {
- 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);
- }
- if(!p_72866_1_.func_184189_br() && !this.func_175680_a(l, j1, true)) {
- p_72866_1_.field_70175_ag = false;
- } else {
- this.func_72964_e(l, j1).func_76612_a(p_72866_1_);
- }
- }
- this.field_72984_F.func_76319_b();
- if(p_72866_2_ && p_72866_1_.field_70175_ag) {
- for(Entity entity : p_72866_1_.func_184188_bt()) {
- if(!entity.field_70128_L && entity.func_184187_bx() == p_72866_1_) {
- this.func_72870_g(entity);
- } else {
- entity.func_184210_p();
- }
- }
- }
- }
- public boolean func_72855_b(AxisAlignedBB p_72855_1_) {
- return this.func_72917_a(p_72855_1_, (Entity)null);
- }
- public boolean func_72917_a(AxisAlignedBB p_72917_1_, @Nullable Entity p_72917_2_) {
- List<Entity> list = this.func_72839_b((Entity)null, p_72917_1_);
- for(int i = 0; i < list.size(); ++i) {
- Entity entity = (Entity)list.get(i);
- if(!entity.field_70128_L && entity.field_70156_m && entity != p_72917_2_ && (p_72917_2_ == null || entity.func_184223_x(p_72917_2_))) {
- return false;
- }
- }
- return true;
- }
- public boolean func_72829_c(AxisAlignedBB p_72829_1_) {
- int i = MathHelper.func_76128_c(p_72829_1_.field_72340_a);
- int j = MathHelper.func_76143_f(p_72829_1_.field_72336_d);
- int k = MathHelper.func_76128_c(p_72829_1_.field_72338_b);
- int l = MathHelper.func_76143_f(p_72829_1_.field_72337_e);
- int i1 = MathHelper.func_76128_c(p_72829_1_.field_72339_c);
- int j1 = MathHelper.func_76143_f(p_72829_1_.field_72334_f);
- BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
- for(int k1 = i; k1 < j; ++k1) {
- for(int l1 = k; l1 < l; ++l1) {
- for(int i2 = i1; i2 < j1; ++i2) {
- IBlockState iblockstate = this.func_180495_p(blockpos$pooledmutableblockpos.func_181079_c(k1, l1, i2));
- if(iblockstate.func_185904_a() != Material.field_151579_a) {
- blockpos$pooledmutableblockpos.func_185344_t();
- return true;
- }
- }
- }
- }
- blockpos$pooledmutableblockpos.func_185344_t();
- return false;
- }
- public boolean func_72953_d(AxisAlignedBB p_72953_1_) {
- int i = MathHelper.func_76128_c(p_72953_1_.field_72340_a);
- int j = MathHelper.func_76143_f(p_72953_1_.field_72336_d);
- int k = MathHelper.func_76128_c(p_72953_1_.field_72338_b);
- int l = MathHelper.func_76143_f(p_72953_1_.field_72337_e);
- int i1 = MathHelper.func_76128_c(p_72953_1_.field_72339_c);
- int j1 = MathHelper.func_76143_f(p_72953_1_.field_72334_f);
- BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
- for(int k1 = i; k1 < j; ++k1) {
- for(int l1 = k; l1 < l; ++l1) {
- for(int i2 = i1; i2 < j1; ++i2) {
- IBlockState iblockstate = this.func_180495_p(blockpos$pooledmutableblockpos.func_181079_c(k1, l1, i2));
- if(iblockstate.func_185904_a().func_76224_d()) {
- blockpos$pooledmutableblockpos.func_185344_t();
- return true;
- }
- }
- }
- }
- blockpos$pooledmutableblockpos.func_185344_t();
- return false;
- }
- public boolean func_147470_e(AxisAlignedBB p_147470_1_) {
- int i = MathHelper.func_76128_c(p_147470_1_.field_72340_a);
- int j = MathHelper.func_76143_f(p_147470_1_.field_72336_d);
- int k = MathHelper.func_76128_c(p_147470_1_.field_72338_b);
- int l = MathHelper.func_76143_f(p_147470_1_.field_72337_e);
- int i1 = MathHelper.func_76128_c(p_147470_1_.field_72339_c);
- int j1 = MathHelper.func_76143_f(p_147470_1_.field_72334_f);
- if(this.func_175663_a(i, k, i1, j, l, j1, true)) {
- BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
- for(int k1 = i; k1 < j; ++k1) {
- for(int l1 = k; l1 < l; ++l1) {
- for(int i2 = i1; i2 < j1; ++i2) {
- Block block = this.func_180495_p(blockpos$pooledmutableblockpos.func_181079_c(k1, l1, i2)).func_177230_c();
- if(block == Blocks.field_150480_ab || block == Blocks.field_150356_k || block == Blocks.field_150353_l) {
- blockpos$pooledmutableblockpos.func_185344_t();
- return true;
- }
- }
- }
- }
- blockpos$pooledmutableblockpos.func_185344_t();
- }
- return false;
- }
- public boolean func_72918_a(AxisAlignedBB p_72918_1_, Material p_72918_2_, Entity p_72918_3_) {
- int i = MathHelper.func_76128_c(p_72918_1_.field_72340_a);
- int j = MathHelper.func_76143_f(p_72918_1_.field_72336_d);
- int k = MathHelper.func_76128_c(p_72918_1_.field_72338_b);
- int l = MathHelper.func_76143_f(p_72918_1_.field_72337_e);
- int i1 = MathHelper.func_76128_c(p_72918_1_.field_72339_c);
- int j1 = MathHelper.func_76143_f(p_72918_1_.field_72334_f);
- if(!this.func_175663_a(i, k, i1, j, l, j1, true)) {
- return false;
- } else {
- boolean flag = false;
- Vec3d vec3d = Vec3d.field_186680_a;
- BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
- for(int k1 = i; k1 < j; ++k1) {
- for(int l1 = k; l1 < l; ++l1) {
- for(int i2 = i1; i2 < j1; ++i2) {
- blockpos$pooledmutableblockpos.func_181079_c(k1, l1, i2);
- IBlockState iblockstate = this.func_180495_p(blockpos$pooledmutableblockpos);
- Block block = iblockstate.func_177230_c();
- if(iblockstate.func_185904_a() == p_72918_2_) {
- double d0 = (double)((float)(l1 + 1) - BlockLiquid.func_149801_b(((Integer)iblockstate.func_177229_b(BlockLiquid.field_176367_b)).intValue()));
- if((double)l >= d0) {
- flag = true;
- vec3d = block.func_176197_a(this, blockpos$pooledmutableblockpos, p_72918_3_, vec3d);
- }
- }
- }
- }
- }
- blockpos$pooledmutableblockpos.func_185344_t();
- if(vec3d.func_72433_c() > 0.0D && p_72918_3_.func_96092_aw()) {
- vec3d = vec3d.func_72432_b();
- double d1 = 0.014D;
- p_72918_3_.field_70159_w += vec3d.field_72450_a * 0.014D;
- p_72918_3_.field_70181_x += vec3d.field_72448_b * 0.014D;
- p_72918_3_.field_70179_y += vec3d.field_72449_c * 0.014D;
- }
- return flag;
- }
- }
- public boolean func_72875_a(AxisAlignedBB p_72875_1_, Material p_72875_2_) {
- int i = MathHelper.func_76128_c(p_72875_1_.field_72340_a);
- int j = MathHelper.func_76143_f(p_72875_1_.field_72336_d);
- int k = MathHelper.func_76128_c(p_72875_1_.field_72338_b);
- int l = MathHelper.func_76143_f(p_72875_1_.field_72337_e);
- int i1 = MathHelper.func_76128_c(p_72875_1_.field_72339_c);
- int j1 = MathHelper.func_76143_f(p_72875_1_.field_72334_f);
- BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
- for(int k1 = i; k1 < j; ++k1) {
- for(int l1 = k; l1 < l; ++l1) {
- for(int i2 = i1; i2 < j1; ++i2) {
- if(this.func_180495_p(blockpos$pooledmutableblockpos.func_181079_c(k1, l1, i2)).func_185904_a() == p_72875_2_) {
- blockpos$pooledmutableblockpos.func_185344_t();
- return true;
- }
- }
- }
- }
- blockpos$pooledmutableblockpos.func_185344_t();
- return false;
- }
- 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_) {
- return this.func_72885_a(p_72876_1_, p_72876_2_, p_72876_4_, p_72876_6_, p_72876_8_, false, p_72876_9_);
- }
- 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_) {
- 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_);
- explosion.func_77278_a();
- explosion.func_77279_a(true);
- return explosion;
- }
- public float func_72842_a(Vec3d p_72842_1_, AxisAlignedBB p_72842_2_) {
- double d0 = 1.0D / ((p_72842_2_.field_72336_d - p_72842_2_.field_72340_a) * 2.0D + 1.0D);
- double d1 = 1.0D / ((p_72842_2_.field_72337_e - p_72842_2_.field_72338_b) * 2.0D + 1.0D);
- double d2 = 1.0D / ((p_72842_2_.field_72334_f - p_72842_2_.field_72339_c) * 2.0D + 1.0D);
- double d3 = (1.0D - Math.floor(1.0D / d0) * d0) / 2.0D;
- double d4 = (1.0D - Math.floor(1.0D / d2) * d2) / 2.0D;
- if(d0 >= 0.0D && d1 >= 0.0D && d2 >= 0.0D) {
- int i = 0;
- int j = 0;
- for(float f = 0.0F; f <= 1.0F; f = (float)((double)f + d0)) {
- for(float f1 = 0.0F; f1 <= 1.0F; f1 = (float)((double)f1 + d1)) {
- for(float f2 = 0.0F; f2 <= 1.0F; f2 = (float)((double)f2 + d2)) {
- double d5 = p_72842_2_.field_72340_a + (p_72842_2_.field_72336_d - p_72842_2_.field_72340_a) * (double)f;
- double d6 = p_72842_2_.field_72338_b + (p_72842_2_.field_72337_e - p_72842_2_.field_72338_b) * (double)f1;
- double d7 = p_72842_2_.field_72339_c + (p_72842_2_.field_72334_f - p_72842_2_.field_72339_c) * (double)f2;
- if(this.func_72933_a(new Vec3d(d5 + d3, d6, d7 + d4), p_72842_1_) == null) {
- ++i;
- }
- ++j;
- }
- }
- }
- return (float)i / (float)j;
- } else {
- return 0.0F;
- }
- }
- public boolean func_175719_a(@Nullable EntityPlayer p_175719_1_, BlockPos p_175719_2_, EnumFacing p_175719_3_) {
- p_175719_2_ = p_175719_2_.func_177972_a(p_175719_3_);
- if(this.func_180495_p(p_175719_2_).func_177230_c() == Blocks.field_150480_ab) {
- this.func_180498_a(p_175719_1_, 1009, p_175719_2_, 0);
- this.func_175698_g(p_175719_2_);
- return true;
- } else {
- return false;
- }
- }
- @SideOnly(Side.CLIENT)
- public String func_72981_t() {
- return "All: " + this.field_72996_f.size();
- }
- @SideOnly(Side.CLIENT)
- public String func_72827_u() {
- return this.field_73020_y.func_73148_d();
- }
- @Nullable
- public TileEntity func_175625_s(BlockPos p_175625_1_) {
- if(this.func_189509_E(p_175625_1_)) {
- return null;
- } else {
- TileEntity tileentity = null;
- if(this.field_147481_N) {
- tileentity = this.func_189508_F(p_175625_1_);
- }
- if(tileentity == null) {
- tileentity = this.func_175726_f(p_175625_1_).func_177424_a(p_175625_1_, Chunk.EnumCreateEntityType.IMMEDIATE);
- }
- if(tileentity == null) {
- tileentity = this.func_189508_F(p_175625_1_);
- }
- return tileentity;
- }
- }
- @Nullable
- private TileEntity func_189508_F(BlockPos p_189508_1_) {
- for(int i = 0; i < this.field_147484_a.size(); ++i) {
- TileEntity tileentity = (TileEntity)this.field_147484_a.get(i);
- if(!tileentity.func_145837_r() && tileentity.func_174877_v().equals(p_189508_1_)) {
- return tileentity;
- }
- }
- return null;
- }
- public void func_175690_a(BlockPos p_175690_1_, @Nullable TileEntity p_175690_2_) {
- if(!this.func_189509_E(p_175690_1_)) {
- if(p_175690_2_ != null && !p_175690_2_.func_145837_r()) {
- if(this.field_147481_N) {
- p_175690_2_.func_174878_a(p_175690_1_);
- Iterator<TileEntity> iterator = this.field_147484_a.iterator();
- while(iterator.hasNext()) {
- TileEntity tileentity = (TileEntity)iterator.next();
- if(tileentity.func_174877_v().equals(p_175690_1_)) {
- tileentity.func_145843_s();
- iterator.remove();
- }
- }
- this.field_147484_a.add(p_175690_2_);
- } else {
- this.func_175726_f(p_175690_1_).func_177426_a(p_175690_1_, p_175690_2_);
- this.func_175700_a(p_175690_2_);
- }
- }
- }
- }
- public void func_175713_t(BlockPos p_175713_1_) {
- TileEntity tileentity = this.func_175625_s(p_175713_1_);
- if(tileentity != null && this.field_147481_N) {
- tileentity.func_145843_s();
- this.field_147484_a.remove(tileentity);
- } else {
- if(tileentity != null) {
- this.field_147484_a.remove(tileentity);
- this.field_147482_g.remove(tileentity);
- this.field_175730_i.remove(tileentity);
- }
- this.func_175726_f(p_175713_1_).func_177425_e(p_175713_1_);
- }
- }
- public void func_147457_a(TileEntity p_147457_1_) {
- this.field_147483_b.add(p_147457_1_);
- }
- public boolean func_175665_u(BlockPos p_175665_1_) {
- AxisAlignedBB axisalignedbb = this.func_180495_p(p_175665_1_).func_185890_d(this, p_175665_1_);
- return axisalignedbb != Block.field_185506_k && axisalignedbb.func_72320_b() >= 1.0D;
- }
- public boolean func_175677_d(BlockPos p_175677_1_, boolean p_175677_2_) {
- if(this.func_189509_E(p_175677_1_)) {
- return false;
- } else {
- Chunk chunk = this.field_73020_y.func_186026_b(p_175677_1_.func_177958_n() >> 4, p_175677_1_.func_177952_p() >> 4);
- if(chunk != null && !chunk.func_76621_g()) {
- IBlockState iblockstate = this.func_180495_p(p_175677_1_);
- return iblockstate.func_185904_a().func_76218_k() && iblockstate.func_185917_h();
- } else {
- return p_175677_2_;
- }
- }
- }
- public void func_72966_v() {
- int i = this.func_72967_a(1.0F);
- if(i != this.field_73008_k) {
- this.field_73008_k = i;
- }
- }
- public void func_72891_a(boolean p_72891_1_, boolean p_72891_2_) {
- this.field_72985_G = p_72891_1_;
- this.field_72992_H = p_72891_2_;
- }
- public void func_72835_b() {
- this.func_72979_l();
- }
- protected void func_72947_a() {
- if(this.field_72986_A.func_76059_o()) {
- this.field_73004_o = 1.0F;
- if(this.field_72986_A.func_76061_m()) {
- this.field_73017_q = 1.0F;
- }
- }
- }
- protected void func_72979_l() {
- if(this.field_73011_w.func_191066_m()) {
- if(!this.field_72995_K) {
- boolean flag = this.func_82736_K().func_82766_b("doWeatherCycle");
- if(flag) {
- int i = this.field_72986_A.func_176133_A();
- if(i > 0) {
- --i;
- this.field_72986_A.func_176142_i(i);
- this.field_72986_A.func_76090_f(this.field_72986_A.func_76061_m()?1:2);
- this.field_72986_A.func_76080_g(this.field_72986_A.func_76059_o()?1:2);
- }
- int j = this.field_72986_A.func_76071_n();
- if(j <= 0) {
- if(this.field_72986_A.func_76061_m()) {
- this.field_72986_A.func_76090_f(this.field_73012_v.nextInt(12000) + 3600);
- } else {
- this.field_72986_A.func_76090_f(this.field_73012_v.nextInt(168000) + 12000);
- }
- } else {
- --j;
- this.field_72986_A.func_76090_f(j);
- if(j <= 0) {
- this.field_72986_A.func_76069_a(!this.field_72986_A.func_76061_m());
- }
- }
- int k = this.field_72986_A.func_76083_p();
- if(k <= 0) {
- if(this.field_72986_A.func_76059_o()) {
- this.field_72986_A.func_76080_g(this.field_73012_v.nextInt(12000) + 12000);
- } else {
- this.field_72986_A.func_76080_g(this.field_73012_v.nextInt(168000) + 12000);
- }
- } else {
- --k;
- this.field_72986_A.func_76080_g(k);
- if(k <= 0) {
- this.field_72986_A.func_76084_b(!this.field_72986_A.func_76059_o());
- }
- }
- }
- this.field_73018_p = this.field_73017_q;
- if(this.field_72986_A.func_76061_m()) {
- this.field_73017_q = (float)((double)this.field_73017_q + 0.01D);
- } else {
- this.field_73017_q = (float)((double)this.field_73017_q - 0.01D);
- }
- this.field_73017_q = MathHelper.func_76131_a(this.field_73017_q, 0.0F, 1.0F);
- this.field_73003_n = this.field_73004_o;
- if(this.field_72986_A.func_76059_o()) {
- this.field_73004_o = (float)((double)this.field_73004_o + 0.01D);
- } else {
- this.field_73004_o = (float)((double)this.field_73004_o - 0.01D);
- }
- this.field_73004_o = MathHelper.func_76131_a(this.field_73004_o, 0.0F, 1.0F);
- }
- }
- }
- @SideOnly(Side.CLIENT)
- protected void func_147467_a(int p_147467_1_, int p_147467_2_, Chunk p_147467_3_) {
- p_147467_3_.func_76594_o();
- }
- protected void func_147456_g() {
- }
- public void func_189507_a(BlockPos p_189507_1_, IBlockState p_189507_2_, Random p_189507_3_) {
- this.field_72999_e = true;
- p_189507_2_.func_177230_c().func_180650_b(this, p_189507_1_, p_189507_2_, p_189507_3_);
- this.field_72999_e = false;
- }
- public boolean func_175675_v(BlockPos p_175675_1_) {
- return this.func_175670_e(p_175675_1_, false);
- }
- public boolean func_175662_w(BlockPos p_175662_1_) {
- return this.func_175670_e(p_175662_1_, true);
- }
- public boolean func_175670_e(BlockPos p_175670_1_, boolean p_175670_2_) {
- Biome biome = this.func_180494_b(p_175670_1_);
- float f = biome.func_180626_a(p_175670_1_);
- if(f >= 0.15F) {
- return false;
- } else {
- 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) {
- IBlockState iblockstate = this.func_180495_p(p_175670_1_);
- Block block = iblockstate.func_177230_c();
- if((block == Blocks.field_150355_j || block == Blocks.field_150358_i) && ((Integer)iblockstate.func_177229_b(BlockLiquid.field_176367_b)).intValue() == 0) {
- if(!p_175670_2_) {
- return true;
- }
- 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());
- if(!flag) {
- return true;
- }
- }
- }
- return false;
- }
- }
- private boolean func_175696_F(BlockPos p_175696_1_) {
- return this.func_180495_p(p_175696_1_).func_185904_a() == Material.field_151586_h;
- }
- public boolean func_175708_f(BlockPos p_175708_1_, boolean p_175708_2_) {
- Biome biome = this.func_180494_b(p_175708_1_);
- float f = biome.func_180626_a(p_175708_1_);
- if(f >= 0.15F) {
- return false;
- } else if(!p_175708_2_) {
- return true;
- } else {
- 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) {
- IBlockState iblockstate = this.func_180495_p(p_175708_1_);
- if(iblockstate.func_185904_a() == Material.field_151579_a && Blocks.field_150431_aC.func_176196_c(this, p_175708_1_)) {
- return true;
- }
- }
- return false;
- }
- }
- public boolean func_175664_x(BlockPos p_175664_1_) {
- boolean flag = false;
- if(this.field_73011_w.func_191066_m()) {
- flag |= this.func_180500_c(EnumSkyBlock.SKY, p_175664_1_);
- }
- flag = flag | this.func_180500_c(EnumSkyBlock.BLOCK, p_175664_1_);
- return flag;
- }
- private int func_175638_a(BlockPos p_175638_1_, EnumSkyBlock p_175638_2_) {
- if(p_175638_2_ == EnumSkyBlock.SKY && this.func_175678_i(p_175638_1_)) {
- return 15;
- } else {
- IBlockState iblockstate = this.func_180495_p(p_175638_1_);
- int i = p_175638_2_ == EnumSkyBlock.SKY?0:iblockstate.func_185906_d();
- int j = iblockstate.func_185891_c();
- if(j >= 15 && iblockstate.func_185906_d() > 0) {
- j = 1;
- }
- if(j < 1) {
- j = 1;
- }
- if(j >= 15) {
- return 0;
- } else if(i >= 14) {
- return i;
- } else {
- BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
- try {
- for(EnumFacing enumfacing : EnumFacing.values()) {
- blockpos$pooledmutableblockpos.func_189533_g(p_175638_1_).func_189536_c(enumfacing);
- int k = this.func_175642_b(p_175638_2_, blockpos$pooledmutableblockpos) - j;
- if(k > i) {
- i = k;
- }
- if(i >= 14) {
- int l = i;
- return l;
- }
- }
- return i;
- } finally {
- blockpos$pooledmutableblockpos.func_185344_t();
- }
- }
- }
- }
- public boolean func_180500_c(EnumSkyBlock p_180500_1_, BlockPos p_180500_2_) {
- if(!this.func_175648_a(p_180500_2_, 17, false)) {
- return false;
- } else {
- int i = 0;
- int j = 0;
- this.field_72984_F.func_76320_a("getBrightness");
- int k = this.func_175642_b(p_180500_1_, p_180500_2_);
- int l = this.func_175638_a(p_180500_2_, p_180500_1_);
- int i1 = p_180500_2_.func_177958_n();
- int j1 = p_180500_2_.func_177956_o();
- int k1 = p_180500_2_.func_177952_p();
- if(l > k) {
- this.field_72994_J[j++] = 133152;
- } else if(l < k) {
- this.field_72994_J[j++] = 133152 | k << 18;
- while(i < j) {
- int l1 = this.field_72994_J[i++];
- int i2 = (l1 & 63) - 32 + i1;
- int j2 = (l1 >> 6 & 63) - 32 + j1;
- int k2 = (l1 >> 12 & 63) - 32 + k1;
- int l2 = l1 >> 18 & 15;
- BlockPos blockpos = new BlockPos(i2, j2, k2);
- int i3 = this.func_175642_b(p_180500_1_, blockpos);
- if(i3 == l2) {
- this.func_175653_a(p_180500_1_, blockpos, 0);
- if(l2 > 0) {
- int j3 = MathHelper.func_76130_a(i2 - i1);
- int k3 = MathHelper.func_76130_a(j2 - j1);
- int l3 = MathHelper.func_76130_a(k2 - k1);
- if(j3 + k3 + l3 < 17) {
- BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
- for(EnumFacing enumfacing : EnumFacing.values()) {
- int i4 = i2 + enumfacing.func_82601_c();
- int j4 = j2 + enumfacing.func_96559_d();
- int k4 = k2 + enumfacing.func_82599_e();
- blockpos$pooledmutableblockpos.func_181079_c(i4, j4, k4);
- int l4 = Math.max(1, this.func_180495_p(blockpos$pooledmutableblockpos).func_185891_c());
- i3 = this.func_175642_b(p_180500_1_, blockpos$pooledmutableblockpos);
- if(i3 == l2 - l4 && j < this.field_72994_J.length) {
- this.field_72994_J[j++] = i4 - i1 + 32 | j4 - j1 + 32 << 6 | k4 - k1 + 32 << 12 | l2 - l4 << 18;
- }
- }
- blockpos$pooledmutableblockpos.func_185344_t();
- }
- }
- }
- }
- i = 0;
- }
- this.field_72984_F.func_76319_b();
- this.field_72984_F.func_76320_a("checkedPosition < toCheckCount");
- while(i < j) {
- int i5 = this.field_72994_J[i++];
- int j5 = (i5 & 63) - 32 + i1;
- int k5 = (i5 >> 6 & 63) - 32 + j1;
- int l5 = (i5 >> 12 & 63) - 32 + k1;
- BlockPos blockpos1 = new BlockPos(j5, k5, l5);
- int i6 = this.func_175642_b(p_180500_1_, blockpos1);
- int j6 = this.func_175638_a(blockpos1, p_180500_1_);
- if(j6 != i6) {
- this.func_175653_a(p_180500_1_, blockpos1, j6);
- if(j6 > i6) {
- int k6 = Math.abs(j5 - i1);
- int l6 = Math.abs(k5 - j1);
- int i7 = Math.abs(l5 - k1);
- boolean flag = j < this.field_72994_J.length - 6;
- if(k6 + l6 + i7 < 17 && flag) {
- if(this.func_175642_b(p_180500_1_, blockpos1.func_177976_e()) < j6) {
- this.field_72994_J[j++] = j5 - 1 - i1 + 32 + (k5 - j1 + 32 << 6) + (l5 - k1 + 32 << 12);
- }
- if(this.func_175642_b(p_180500_1_, blockpos1.func_177974_f()) < j6) {
- this.field_72994_J[j++] = j5 + 1 - i1 + 32 + (k5 - j1 + 32 << 6) + (l5 - k1 + 32 << 12);
- }
- if(this.func_175642_b(p_180500_1_, blockpos1.func_177977_b()) < j6) {
- this.field_72994_J[j++] = j5 - i1 + 32 + (k5 - 1 - j1 + 32 << 6) + (l5 - k1 + 32 << 12);
- }
- if(this.func_175642_b(p_180500_1_, blockpos1.func_177984_a()) < j6) {
- this.field_72994_J[j++] = j5 - i1 + 32 + (k5 + 1 - j1 + 32 << 6) + (l5 - k1 + 32 << 12);
- }
- if(this.func_175642_b(p_180500_1_, blockpos1.func_177978_c()) < j6) {
- this.field_72994_J[j++] = j5 - i1 + 32 + (k5 - j1 + 32 << 6) + (l5 - 1 - k1 + 32 << 12);
- }
- if(this.func_175642_b(p_180500_1_, blockpos1.func_177968_d()) < j6) {
- this.field_72994_J[j++] = j5 - i1 + 32 + (k5 - j1 + 32 << 6) + (l5 + 1 - k1 + 32 << 12);
- }
- }
- }
- }
- }
- this.field_72984_F.func_76319_b();
- return true;
- }
- }
- public boolean func_72955_a(boolean p_72955_1_) {
- return false;
- }
- @Nullable
- public List<NextTickListEntry> func_72920_a(Chunk p_72920_1_, boolean p_72920_2_) {
- return null;
- }
- @Nullable
- public List<NextTickListEntry> func_175712_a(StructureBoundingBox p_175712_1_, boolean p_175712_2_) {
- return null;
- }
- public List<Entity> func_72839_b(@Nullable Entity p_72839_1_, AxisAlignedBB p_72839_2_) {
- return this.func_175674_a(p_72839_1_, p_72839_2_, EntitySelectors.field_180132_d);
- }
- public List<Entity> func_175674_a(@Nullable Entity p_175674_1_, AxisAlignedBB p_175674_2_, @Nullable Predicate<? super Entity> p_175674_3_) {
- List<Entity> list = Lists.<Entity>newArrayList();
- int i = MathHelper.func_76128_c((p_175674_2_.field_72340_a - 2.0D) / 16.0D);
- int j = MathHelper.func_76128_c((p_175674_2_.field_72336_d + 2.0D) / 16.0D);
- int k = MathHelper.func_76128_c((p_175674_2_.field_72339_c - 2.0D) / 16.0D);
- int l = MathHelper.func_76128_c((p_175674_2_.field_72334_f + 2.0D) / 16.0D);
- for(int i1 = i; i1 <= j; ++i1) {
- for(int j1 = k; j1 <= l; ++j1) {
- if(this.func_175680_a(i1, j1, true)) {
- this.func_72964_e(i1, j1).func_177414_a(p_175674_1_, p_175674_2_, list, p_175674_3_);
- }
- }
- }
- return list;
- }
- public <T extends Entity> List<T> func_175644_a(Class<? extends T> p_175644_1_, Predicate<? super T> p_175644_2_) {
- List<T> list = Lists.<T>newArrayList();
- for(Entity entity : this.field_72996_f) {
- if(p_175644_1_.isAssignableFrom(entity.getClass()) && p_175644_2_.apply(entity)) {
- list.add(entity);
- }
- }
- return list;
- }
- public <T extends Entity> List<T> func_175661_b(Class<? extends T> p_175661_1_, Predicate<? super T> p_175661_2_) {
- List<T> list = Lists.<T>newArrayList();
- for(Entity entity : this.field_73010_i) {
- if(p_175661_1_.isAssignableFrom(entity.getClass()) && p_175661_2_.apply(entity)) {
- list.add(entity);
- }
- }
- return list;
- }
- public <T extends Entity> List<T> func_72872_a(Class<? extends T> p_72872_1_, AxisAlignedBB p_72872_2_) {
- return this.<T>func_175647_a(p_72872_1_, p_72872_2_, EntitySelectors.field_180132_d);
- }
- 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_) {
- int i = MathHelper.func_76128_c((p_175647_2_.field_72340_a - 2.0D) / 16.0D);
- int j = MathHelper.func_76143_f((p_175647_2_.field_72336_d + 2.0D) / 16.0D);
- int k = MathHelper.func_76128_c((p_175647_2_.field_72339_c - 2.0D) / 16.0D);
- int l = MathHelper.func_76143_f((p_175647_2_.field_72334_f + 2.0D) / 16.0D);
- List<T> list = Lists.<T>newArrayList();
- for(int i1 = i; i1 < j; ++i1) {
- for(int j1 = k; j1 < l; ++j1) {
- if(this.func_175680_a(i1, j1, true)) {
- this.func_72964_e(i1, j1).func_177430_a(p_175647_1_, p_175647_2_, list, p_175647_3_);
- }
- }
- }
- return list;
- }
- @Nullable
- public <T extends Entity> T func_72857_a(Class<? extends T> p_72857_1_, AxisAlignedBB p_72857_2_, T p_72857_3_) {
- List<T> list = this.<T>func_72872_a(p_72857_1_, p_72857_2_);
- T t = null;
- double d0 = Double.MAX_VALUE;
- for(int i = 0; i < list.size(); ++i) {
- T t1 = (Entity)list.get(i);
- if(t1 != p_72857_3_ && EntitySelectors.field_180132_d.apply(t1)) {
- double d1 = p_72857_3_.func_70068_e(t1);
- if(d1 <= d0) {
- t = t1;
- d0 = d1;
- }
- }
- }
- return t;
- }
- @Nullable
- public Entity func_73045_a(int p_73045_1_) {
- return (Entity)this.field_175729_l.func_76041_a(p_73045_1_);
- }
- @SideOnly(Side.CLIENT)
- public List<Entity> func_72910_y() {
- return this.field_72996_f;
- }
- public void func_175646_b(BlockPos p_175646_1_, TileEntity p_175646_2_) {
- if(this.func_175667_e(p_175646_1_)) {
- this.func_175726_f(p_175646_1_).func_76630_e();
- }
- }
- public int func_72907_a(Class<?> p_72907_1_) {
- int i = 0;
- for(Entity entity : this.field_72996_f) {
- if((!(entity instanceof EntityLiving) || !((EntityLiving)entity).func_104002_bU()) && p_72907_1_.isAssignableFrom(entity.getClass())) {
- ++i;
- }
- }
- return i;
- }
- public void func_175650_b(Collection<Entity> p_175650_1_) {
- this.field_72996_f.addAll(p_175650_1_);
- for(Entity entity : p_175650_1_) {
- this.func_72923_a(entity);
- }
- }
- public void func_175681_c(Collection<Entity> p_175681_1_) {
- this.field_72997_g.addAll(p_175681_1_);
- }
- 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_) {
- IBlockState iblockstate = this.func_180495_p(p_190527_2_);
- AxisAlignedBB axisalignedbb = p_190527_3_?null:p_190527_1_.func_176223_P().func_185890_d(this, p_190527_2_);
- 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_));
- }
- public int func_181545_F() {
- return this.field_181546_a;
- }
- public void func_181544_b(int p_181544_1_) {
- this.field_181546_a = p_181544_1_;
- }
- public int func_175627_a(BlockPos p_175627_1_, EnumFacing p_175627_2_) {
- return this.func_180495_p(p_175627_1_).func_185893_b(this, p_175627_1_, p_175627_2_);
- }
- public WorldType func_175624_G() {
- return this.field_72986_A.func_76067_t();
- }
- public int func_175676_y(BlockPos p_175676_1_) {
- int i = 0;
- i = Math.max(i, this.func_175627_a(p_175676_1_.func_177977_b(), EnumFacing.DOWN));
- if(i >= 15) {
- return i;
- } else {
- i = Math.max(i, this.func_175627_a(p_175676_1_.func_177984_a(), EnumFacing.UP));
- if(i >= 15) {
- return i;
- } else {
- i = Math.max(i, this.func_175627_a(p_175676_1_.func_177978_c(), EnumFacing.NORTH));
- if(i >= 15) {
- return i;
- } else {
- i = Math.max(i, this.func_175627_a(p_175676_1_.func_177968_d(), EnumFacing.SOUTH));
- if(i >= 15) {
- return i;
- } else {
- i = Math.max(i, this.func_175627_a(p_175676_1_.func_177976_e(), EnumFacing.WEST));
- if(i >= 15) {
- return i;
- } else {
- i = Math.max(i, this.func_175627_a(p_175676_1_.func_177974_f(), EnumFacing.EAST));
- return i >= 15?i:i;
- }
- }
- }
- }
- }
- }
- public boolean func_175709_b(BlockPos p_175709_1_, EnumFacing p_175709_2_) {
- return this.func_175651_c(p_175709_1_, p_175709_2_) > 0;
- }
- public int func_175651_c(BlockPos p_175651_1_, EnumFacing p_175651_2_) {
- IBlockState iblockstate = this.func_180495_p(p_175651_1_);
- return iblockstate.func_185915_l()?this.func_175676_y(p_175651_1_):iblockstate.func_185911_a(this, p_175651_1_, p_175651_2_);
- }
- public boolean func_175640_z(BlockPos p_175640_1_) {
- 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))));
- }
- public int func_175687_A(BlockPos p_175687_1_) {
- int i = 0;
- for(EnumFacing enumfacing : EnumFacing.values()) {
- int j = this.func_175651_c(p_175687_1_.func_177972_a(enumfacing), enumfacing);
- if(j >= 15) {
- return 15;
- }
- if(j > i) {
- i = j;
- }
- }
- return i;
- }
- @Nullable
- public EntityPlayer func_72890_a(Entity p_72890_1_, double p_72890_2_) {
- 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);
- }
- @Nullable
- public EntityPlayer func_184136_b(Entity p_184136_1_, double p_184136_2_) {
- 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);
- }
- @Nullable
- 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_) {
- Predicate<Entity> predicate = p_184137_9_?EntitySelectors.field_188444_d:EntitySelectors.field_180132_d;
- return this.func_190525_a(p_184137_1_, p_184137_3_, p_184137_5_, p_184137_7_, predicate);
- }
- @Nullable
- 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_) {
- double d0 = -1.0D;
- EntityPlayer entityplayer = null;
- for(int i = 0; i < this.field_73010_i.size(); ++i) {
- EntityPlayer entityplayer1 = (EntityPlayer)this.field_73010_i.get(i);
- if(p_190525_9_.apply(entityplayer1)) {
- double d1 = entityplayer1.func_70092_e(p_190525_1_, p_190525_3_, p_190525_5_);
- if((p_190525_7_ < 0.0D || d1 < p_190525_7_ * p_190525_7_) && (d0 == -1.0D || d1 < d0)) {
- d0 = d1;
- entityplayer = entityplayer1;
- }
- }
- }
- return entityplayer;
- }
- public boolean func_175636_b(double p_175636_1_, double p_175636_3_, double p_175636_5_, double p_175636_7_) {
- for(int i = 0; i < this.field_73010_i.size(); ++i) {
- EntityPlayer entityplayer = (EntityPlayer)this.field_73010_i.get(i);
- if(EntitySelectors.field_180132_d.apply(entityplayer)) {
- double d0 = entityplayer.func_70092_e(p_175636_1_, p_175636_3_, p_175636_5_);
- if(p_175636_7_ < 0.0D || d0 < p_175636_7_ * p_175636_7_) {
- return true;
- }
- }
- }
- return false;
- }
- @Nullable
- public EntityPlayer func_184142_a(Entity p_184142_1_, double p_184142_2_, double p_184142_4_) {
- 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);
- }
- @Nullable
- public EntityPlayer func_184139_a(BlockPos p_184139_1_, double p_184139_2_, double p_184139_4_) {
- 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);
- }
- @Nullable
- 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_) {
- double d0 = -1.0D;
- EntityPlayer entityplayer = null;
- for(int i = 0; i < this.field_73010_i.size(); ++i) {
- EntityPlayer entityplayer1 = (EntityPlayer)this.field_73010_i.get(i);
- 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))) {
- double d1 = entityplayer1.func_70092_e(p_184150_1_, entityplayer1.field_70163_u, p_184150_5_);
- double d2 = p_184150_7_;
- if(entityplayer1.func_70093_af()) {
- d2 = p_184150_7_ * 0.800000011920929D;
- }
- if(entityplayer1.func_82150_aj()) {
- float f = entityplayer1.func_82243_bO();
- if(f < 0.1F) {
- f = 0.1F;
- }
- d2 *= (double)(0.7F * f);
- }
- if(p_184150_11_ != null) {
- d2 *= ((Double)MoreObjects.firstNonNull(p_184150_11_.apply(entityplayer1), Double.valueOf(1.0D))).doubleValue();
- }
- 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)) {
- d0 = d1;
- entityplayer = entityplayer1;
- }
- }
- }
- return entityplayer;
- }
- @Nullable
- public EntityPlayer func_72924_a(String p_72924_1_) {
- for(int i = 0; i < this.field_73010_i.size(); ++i) {
- EntityPlayer entityplayer = (EntityPlayer)this.field_73010_i.get(i);
- if(p_72924_1_.equals(entityplayer.func_70005_c_())) {
- return entityplayer;
- }
- }
- return null;
- }
- @Nullable
- public EntityPlayer func_152378_a(UUID p_152378_1_) {
- for(int i = 0; i < this.field_73010_i.size(); ++i) {
- EntityPlayer entityplayer = (EntityPlayer)this.field_73010_i.get(i);
- if(p_152378_1_.equals(entityplayer.func_110124_au())) {
- return entityplayer;
- }
- }
- return null;
- }
- @SideOnly(Side.CLIENT)
- public void func_72882_A() {
- }
- public void func_72906_B() throws MinecraftException {
- this.field_73019_z.func_75762_c();
- }
- @SideOnly(Side.CLIENT)
- public void func_82738_a(long p_82738_1_) {
- this.field_72986_A.func_82572_b(p_82738_1_);
- }
- public long func_72905_C() {
- return this.field_72986_A.func_76063_b();
- }
- public long func_82737_E() {
- return this.field_72986_A.func_82573_f();
- }
- public long func_72820_D() {
- return this.field_72986_A.func_76073_f();
- }
- public void func_72877_b(long p_72877_1_) {
- this.field_72986_A.func_76068_b(p_72877_1_);
- }
- public BlockPos func_175694_M() {
- 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());
- if(!this.func_175723_af().func_177746_a(blockpos)) {
- blockpos = this.func_175645_m(new BlockPos(this.func_175723_af().func_177731_f(), 0.0D, this.func_175723_af().func_177721_g()));
- }
- return blockpos;
- }
- public void func_175652_B(BlockPos p_175652_1_) {
- this.field_72986_A.func_176143_a(p_175652_1_);
- }
- @SideOnly(Side.CLIENT)
- public void func_72897_h(Entity p_72897_1_) {
- int i = MathHelper.func_76128_c(p_72897_1_.field_70165_t / 16.0D);
- int j = MathHelper.func_76128_c(p_72897_1_.field_70161_v / 16.0D);
- int k = 2;
- for(int l = -2; l <= 2; ++l) {
- for(int i1 = -2; i1 <= 2; ++i1) {
- this.func_72964_e(i + l, j + i1);
- }
- }
- if(!this.field_72996_f.contains(p_72897_1_)) {
- this.field_72996_f.add(p_72897_1_);
- }
- }
- public boolean func_175660_a(EntityPlayer p_175660_1_, BlockPos p_175660_2_) {
- return true;
- }
- public void func_72960_a(Entity p_72960_1_, byte p_72960_2_) {
- }
- public IChunkProvider func_72863_F() {
- return this.field_73020_y;
- }
- public void func_175641_c(BlockPos p_175641_1_, Block p_175641_2_, int p_175641_3_, int p_175641_4_) {
- this.func_180495_p(p_175641_1_).func_189547_a(this, p_175641_1_, p_175641_3_, p_175641_4_);
- }
- public ISaveHandler func_72860_G() {
- return this.field_73019_z;
- }
- public WorldInfo func_72912_H() {
- return this.field_72986_A;
- }
- public GameRules func_82736_K() {
- return this.field_72986_A.func_82574_x();
- }
- public void func_72854_c() {
- }
- public float func_72819_i(float p_72819_1_) {
- return (this.field_73018_p + (this.field_73017_q - this.field_73018_p) * p_72819_1_) * this.func_72867_j(p_72819_1_);
- }
- @SideOnly(Side.CLIENT)
- public void func_147442_i(float p_147442_1_) {
- this.field_73018_p = p_147442_1_;
- this.field_73017_q = p_147442_1_;
- }
- public float func_72867_j(float p_72867_1_) {
- return this.field_73003_n + (this.field_73004_o - this.field_73003_n) * p_72867_1_;
- }
- @SideOnly(Side.CLIENT)
- public void func_72894_k(float p_72894_1_) {
- this.field_73003_n = p_72894_1_;
- this.field_73004_o = p_72894_1_;
- }
- public boolean func_72911_I() {
- return (double)this.func_72819_i(1.0F) > 0.9D;
- }
- public boolean func_72896_J() {
- return (double)this.func_72867_j(1.0F) > 0.2D;
- }
- public boolean func_175727_C(BlockPos p_175727_1_) {
- if(!this.func_72896_J()) {
- return false;
- } else if(!this.func_175678_i(p_175727_1_)) {
- return false;
- } else if(this.func_175725_q(p_175727_1_).func_177956_o() > p_175727_1_.func_177956_o()) {
- return false;
- } else {
- Biome biome = this.func_180494_b(p_175727_1_);
- return biome.func_76746_c()?false:(this.func_175708_f(p_175727_1_, false)?false:biome.func_76738_d());
- }
- }
- public boolean func_180502_D(BlockPos p_180502_1_) {
- Biome biome = this.func_180494_b(p_180502_1_);
- return biome.func_76736_e();
- }
- @Nullable
- public MapStorage func_175693_T() {
- return this.field_72988_C;
- }
- public void func_72823_a(String p_72823_1_, WorldSavedData p_72823_2_) {
- this.field_72988_C.func_75745_a(p_72823_1_, p_72823_2_);
- }
- @Nullable
- public WorldSavedData func_72943_a(Class<? extends WorldSavedData> p_72943_1_, String p_72943_2_) {
- return this.field_72988_C.func_75742_a(p_72943_1_, p_72943_2_);
- }
- public int func_72841_b(String p_72841_1_) {
- return this.field_72988_C.func_75743_a(p_72841_1_);
- }
- public void func_175669_a(int p_175669_1_, BlockPos p_175669_2_, int p_175669_3_) {
- for(int i = 0; i < this.field_73021_x.size(); ++i) {
- ((IWorldEventListener)this.field_73021_x.get(i)).func_180440_a(p_175669_1_, p_175669_2_, p_175669_3_);
- }
- }
- public void func_175718_b(int p_175718_1_, BlockPos p_175718_2_, int p_175718_3_) {
- this.func_180498_a((EntityPlayer)null, p_175718_1_, p_175718_2_, p_175718_3_);
- }
- public void func_180498_a(@Nullable EntityPlayer p_180498_1_, int p_180498_2_, BlockPos p_180498_3_, int p_180498_4_) {
- try {
- for(int i = 0; i < this.field_73021_x.size(); ++i) {
- ((IWorldEventListener)this.field_73021_x.get(i)).func_180439_a(p_180498_1_, p_180498_2_, p_180498_3_, p_180498_4_);
- }
- } catch (Throwable throwable) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable, "Playing level event");
- CrashReportCategory crashreportcategory = crashreport.func_85058_a("Level event being played");
- crashreportcategory.func_71507_a("Block coordinates", CrashReportCategory.func_180522_a(p_180498_3_));
- crashreportcategory.func_71507_a("Event source", p_180498_1_);
- crashreportcategory.func_71507_a("Event type", Integer.valueOf(p_180498_2_));
- crashreportcategory.func_71507_a("Event data", Integer.valueOf(p_180498_4_));
- throw new ReportedException(crashreport);
- }
- }
- public int func_72800_K() {
- return 256;
- }
- public int func_72940_L() {
- return this.field_73011_w.func_177495_o()?128:256;
- }
- public Random func_72843_D(int p_72843_1_, int p_72843_2_, int p_72843_3_) {
- long i = (long)p_72843_1_ * 341873128712L + (long)p_72843_2_ * 132897987541L + this.func_72912_H().func_76063_b() + (long)p_72843_3_;
- this.field_73012_v.setSeed(i);
- return this.field_73012_v;
- }
- public CrashReportCategory func_72914_a(CrashReport p_72914_1_) {
- CrashReportCategory crashreportcategory = p_72914_1_.func_85057_a("Affected level", 1);
- crashreportcategory.func_71507_a("Level name", this.field_72986_A == null?"????":this.field_72986_A.func_76065_j());
- crashreportcategory.func_189529_a("All players", new ICrashReportDetail<String>() {
- public String call() {
- return World.this.field_73010_i.size() + " total; " + World.this.field_73010_i;
- }
- });
- crashreportcategory.func_189529_a("Chunk stats", new ICrashReportDetail<String>() {
- public String call() {
- return World.this.field_73020_y.func_73148_d();
- }
- });
- try {
- this.field_72986_A.func_85118_a(crashreportcategory);
- } catch (Throwable throwable) {
- crashreportcategory.func_71499_a("Level Data Unobtainable", throwable);
- }
- return crashreportcategory;
- }
- @SideOnly(Side.CLIENT)
- public double func_72919_O() {
- return this.field_72986_A.func_76067_t() == WorldType.field_77138_c?0.0D:63.0D;
- }
- public void func_175715_c(int p_175715_1_, BlockPos p_175715_2_, int p_175715_3_) {
- for(int i = 0; i < this.field_73021_x.size(); ++i) {
- IWorldEventListener iworldeventlistener = (IWorldEventListener)this.field_73021_x.get(i);
- iworldeventlistener.func_180441_b(p_175715_1_, p_175715_2_, p_175715_3_);
- }
- }
- public Calendar func_83015_S() {
- if(this.func_82737_E() % 600L == 0L) {
- this.field_83016_L.setTimeInMillis(MinecraftServer.func_130071_aq());
- }
- return this.field_83016_L;
- }
- @SideOnly(Side.CLIENT)
- 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_) {
- }
- public Scoreboard func_96441_U() {
- return this.field_96442_D;
- }
- public void func_175666_e(BlockPos p_175666_1_, Block p_175666_2_) {
- for(EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) {
- BlockPos blockpos = p_175666_1_.func_177972_a(enumfacing);
- if(this.func_175667_e(blockpos)) {
- IBlockState iblockstate = this.func_180495_p(blockpos);
- if(Blocks.field_150441_bU.func_185547_C(iblockstate)) {
- iblockstate.func_189546_a(this, blockpos, p_175666_2_, p_175666_1_);
- } else if(iblockstate.func_185915_l()) {
- blockpos = blockpos.func_177972_a(enumfacing);
- iblockstate = this.func_180495_p(blockpos);
- if(Blocks.field_150441_bU.func_185547_C(iblockstate)) {
- iblockstate.func_189546_a(this, blockpos, p_175666_2_, p_175666_1_);
- }
- }
- }
- }
- }
- public DifficultyInstance func_175649_E(BlockPos p_175649_1_) {
- long i = 0L;
- float f = 0.0F;
- if(this.func_175667_e(p_175649_1_)) {
- f = this.func_130001_d();
- i = this.func_175726_f(p_175649_1_).func_177416_w();
- }
- return new DifficultyInstance(this.func_175659_aa(), this.func_72820_D(), i, f);
- }
- public EnumDifficulty func_175659_aa() {
- return this.func_72912_H().func_176130_y();
- }
- public int func_175657_ab() {
- return this.field_73008_k;
- }
- public void func_175692_b(int p_175692_1_) {
- this.field_73008_k = p_175692_1_;
- }
- @SideOnly(Side.CLIENT)
- public int func_175658_ac() {
- return this.field_73016_r;
- }
- public void func_175702_c(int p_175702_1_) {
- this.field_73016_r = p_175702_1_;
- }
- public VillageCollection func_175714_ae() {
- return this.field_72982_D;
- }
- public WorldBorder func_175723_af() {
- return this.field_175728_M;
- }
- public boolean func_72916_c(int p_72916_1_, int p_72916_2_) {
- BlockPos blockpos = this.func_175694_M();
- int i = p_72916_1_ * 16 + 8 - blockpos.func_177958_n();
- int j = p_72916_2_ * 16 + 8 - blockpos.func_177952_p();
- int k = 128;
- return i >= -128 && i <= 128 && j >= -128 && j <= 128;
- }
- public void func_184135_a(Packet<?> p_184135_1_) {
- throw new UnsupportedOperationException("Can\'t send packets to server unless you\'re on the client.");
- }
- public LootTableManager func_184146_ak() {
- return this.field_184151_B;
- }
- @Nullable
- public BlockPos func_190528_a(String p_190528_1_, BlockPos p_190528_2_, boolean p_190528_3_) {
- return null;
- }
- }
- Hunk 2 failed! Cannot find hunk target
- List<T> list = Lists.<T>newArrayList();
- for(Entity entity : this.field_73010_i) {
- - if (p_175661_1_.isAssignableFrom(entity.getClass()) && p_175661_2_.apply(entity)) {
- - list.add(entity);
- + if (p_175661_1_.isAssignableFrom(entity.getClass()) && p_175661_2_.apply((T)entity)) {
- + list.add((T)entity);
- }
- }
- File state
- package net.minecraft.world;
- import com.google.common.base.Function;
- import com.google.common.base.MoreObjects;
- import com.google.common.base.Predicate;
- import com.google.common.collect.Lists;
- import java.util.Calendar;
- import java.util.Collection;
- import java.util.Iterator;
- import java.util.List;
- import java.util.Random;
- import java.util.UUID;
- import javax.annotation.Nullable;
- import net.minecraft.advancements.AdvancementManager;
- import net.minecraft.advancements.FunctionManager;
- import net.minecraft.block.Block;
- import net.minecraft.block.BlockLiquid;
- import net.minecraft.block.BlockObserver;
- import net.minecraft.block.material.Material;
- import net.minecraft.block.state.IBlockState;
- import net.minecraft.crash.CrashReport;
- import net.minecraft.crash.CrashReportCategory;
- import net.minecraft.crash.ICrashReportDetail;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.EntityLiving;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.entity.player.EntityPlayerMP;
- import net.minecraft.init.Biomes;
- import net.minecraft.init.Blocks;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.network.Packet;
- import net.minecraft.pathfinding.PathWorldListener;
- import net.minecraft.profiler.Profiler;
- import net.minecraft.scoreboard.Scoreboard;
- import net.minecraft.server.MinecraftServer;
- import net.minecraft.tileentity.TileEntity;
- import net.minecraft.util.EntitySelectors;
- import net.minecraft.util.EnumFacing;
- import net.minecraft.util.EnumParticleTypes;
- import net.minecraft.util.ITickable;
- import net.minecraft.util.IntHashMap;
- import net.minecraft.util.ReportedException;
- import net.minecraft.util.SoundCategory;
- import net.minecraft.util.SoundEvent;
- import net.minecraft.util.math.AxisAlignedBB;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.util.math.MathHelper;
- import net.minecraft.util.math.RayTraceResult;
- import net.minecraft.util.math.Vec3d;
- import net.minecraft.village.VillageCollection;
- import net.minecraft.world.DifficultyInstance;
- import net.minecraft.world.EnumDifficulty;
- import net.minecraft.world.EnumSkyBlock;
- import net.minecraft.world.Explosion;
- import net.minecraft.world.GameRules;
- import net.minecraft.world.IBlockAccess;
- import net.minecraft.world.IWorldEventListener;
- import net.minecraft.world.MinecraftException;
- import net.minecraft.world.NextTickListEntry;
- import net.minecraft.world.WorldProvider;
- import net.minecraft.world.WorldSettings;
- import net.minecraft.world.WorldType;
- import net.minecraft.world.biome.Biome;
- import net.minecraft.world.biome.BiomeProvider;
- import net.minecraft.world.border.WorldBorder;
- import net.minecraft.world.chunk.Chunk;
- import net.minecraft.world.chunk.IChunkProvider;
- import net.minecraft.world.gen.structure.StructureBoundingBox;
- import net.minecraft.world.storage.ISaveHandler;
- import net.minecraft.world.storage.MapStorage;
- import net.minecraft.world.storage.WorldInfo;
- import net.minecraft.world.storage.WorldSavedData;
- import net.minecraft.world.storage.loot.LootTableManager;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- public abstract class World implements IBlockAccess {
- private int field_181546_a = 63;
- protected boolean field_72999_e;
- public final List<Entity> field_72996_f = Lists.<Entity>newArrayList();
- protected final List<Entity> field_72997_g = Lists.<Entity>newArrayList();
- public final List<TileEntity> field_147482_g = Lists.<TileEntity>newArrayList();
- public final List<TileEntity> field_175730_i = Lists.<TileEntity>newArrayList();
- private final List<TileEntity> field_147484_a = Lists.<TileEntity>newArrayList();
- private final List<TileEntity> field_147483_b = Lists.<TileEntity>newArrayList();
- public final List<EntityPlayer> field_73010_i = Lists.<EntityPlayer>newArrayList();
- public final List<Entity> field_73007_j = Lists.<Entity>newArrayList();
- protected final IntHashMap<Entity> field_175729_l = new IntHashMap();
- private final long field_73001_c = 16777215L;
- private int field_73008_k;
- protected int field_73005_l = (new Random()).nextInt();
- protected final int field_73006_m = 1013904223;
- public float field_73003_n;
- public float field_73004_o;
- public float field_73018_p;
- public float field_73017_q;
- private int field_73016_r;
- public final Random field_73012_v = new Random();
- public final WorldProvider field_73011_w;
- protected PathWorldListener field_184152_t = new PathWorldListener();
- protected List<IWorldEventListener> field_73021_x;
- protected IChunkProvider field_73020_y;
- protected final ISaveHandler field_73019_z;
- protected WorldInfo field_72986_A;
- protected boolean field_72987_B;
- protected MapStorage field_72988_C;
- public VillageCollection field_72982_D;
- protected LootTableManager field_184151_B;
- protected AdvancementManager field_191951_C;
- protected FunctionManager field_193036_D;
- public final Profiler field_72984_F;
- private final Calendar field_83016_L;
- protected Scoreboard field_96442_D;
- public final boolean field_72995_K;
- protected boolean field_72985_G;
- protected boolean field_72992_H;
- private boolean field_147481_N;
- private final WorldBorder field_175728_M;
- int[] field_72994_J;
- protected World(ISaveHandler p_i45749_1_, WorldInfo p_i45749_2_, WorldProvider p_i45749_3_, Profiler p_i45749_4_, boolean p_i45749_5_) {
- this.field_73021_x = Lists.newArrayList(new IWorldEventListener[]{this.field_184152_t});
- this.field_83016_L = Calendar.getInstance();
- this.field_96442_D = new Scoreboard();
- this.field_72985_G = true;
- this.field_72992_H = true;
- this.field_72994_J = new int['\u8000'];
- this.field_73019_z = p_i45749_1_;
- this.field_72984_F = p_i45749_4_;
- this.field_72986_A = p_i45749_2_;
- this.field_73011_w = p_i45749_3_;
- this.field_72995_K = p_i45749_5_;
- this.field_175728_M = p_i45749_3_.func_177501_r();
- }
- public World func_175643_b() {
- return this;
- }
- public Biome func_180494_b(final BlockPos p_180494_1_) {
- if(this.func_175667_e(p_180494_1_)) {
- Chunk chunk = this.func_175726_f(p_180494_1_);
- try {
- return chunk.func_177411_a(p_180494_1_, this.field_73011_w.func_177499_m());
- } catch (Throwable throwable) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable, "Getting biome");
- CrashReportCategory crashreportcategory = crashreport.func_85058_a("Coordinates of biome request");
- crashreportcategory.func_189529_a("Location", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return CrashReportCategory.func_180522_a(p_180494_1_);
- }
- });
- throw new ReportedException(crashreport);
- }
- } else {
- return this.field_73011_w.func_177499_m().func_180300_a(p_180494_1_, Biomes.field_76772_c);
- }
- }
- public BiomeProvider func_72959_q() {
- return this.field_73011_w.func_177499_m();
- }
- protected abstract IChunkProvider func_72970_h();
- public void func_72963_a(WorldSettings p_72963_1_) {
- this.field_72986_A.func_76091_d(true);
- }
- @Nullable
- public MinecraftServer func_73046_m() {
- return null;
- }
- @SideOnly(Side.CLIENT)
- public void func_72974_f() {
- this.func_175652_B(new BlockPos(8, 64, 8));
- }
- public IBlockState func_184141_c(BlockPos p_184141_1_) {
- BlockPos blockpos;
- 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()) {
- ;
- }
- return this.func_180495_p(blockpos);
- }
- public boolean func_175701_a(BlockPos p_175701_1_) {
- 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;
- }
- public boolean func_189509_E(BlockPos p_189509_1_) {
- return p_189509_1_.func_177956_o() < 0 || p_189509_1_.func_177956_o() >= 256;
- }
- public boolean func_175623_d(BlockPos p_175623_1_) {
- return this.func_180495_p(p_175623_1_).func_185904_a() == Material.field_151579_a;
- }
- public boolean func_175667_e(BlockPos p_175667_1_) {
- return this.func_175668_a(p_175667_1_, true);
- }
- public boolean func_175668_a(BlockPos p_175668_1_, boolean p_175668_2_) {
- return this.func_175680_a(p_175668_1_.func_177958_n() >> 4, p_175668_1_.func_177952_p() >> 4, p_175668_2_);
- }
- public boolean func_175697_a(BlockPos p_175697_1_, int p_175697_2_) {
- return this.func_175648_a(p_175697_1_, p_175697_2_, true);
- }
- public boolean func_175648_a(BlockPos p_175648_1_, int p_175648_2_, boolean p_175648_3_) {
- 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_);
- }
- public boolean func_175707_a(BlockPos p_175707_1_, BlockPos p_175707_2_) {
- return this.func_175706_a(p_175707_1_, p_175707_2_, true);
- }
- public boolean func_175706_a(BlockPos p_175706_1_, BlockPos p_175706_2_, boolean p_175706_3_) {
- 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_);
- }
- public boolean func_175711_a(StructureBoundingBox p_175711_1_) {
- return this.func_175639_b(p_175711_1_, true);
- }
- public boolean func_175639_b(StructureBoundingBox p_175639_1_, boolean p_175639_2_) {
- 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_);
- }
- 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_) {
- if(p_175663_5_ >= 0 && p_175663_2_ < 256) {
- p_175663_1_ = p_175663_1_ >> 4;
- p_175663_3_ = p_175663_3_ >> 4;
- p_175663_4_ = p_175663_4_ >> 4;
- p_175663_6_ = p_175663_6_ >> 4;
- for(int i = p_175663_1_; i <= p_175663_4_; ++i) {
- for(int j = p_175663_3_; j <= p_175663_6_; ++j) {
- if(!this.func_175680_a(i, j, p_175663_7_)) {
- return false;
- }
- }
- }
- return true;
- } else {
- return false;
- }
- }
- protected abstract boolean func_175680_a(int p_175680_1_, int p_175680_2_, boolean p_175680_3_);
- public Chunk func_175726_f(BlockPos p_175726_1_) {
- return this.func_72964_e(p_175726_1_.func_177958_n() >> 4, p_175726_1_.func_177952_p() >> 4);
- }
- public Chunk func_72964_e(int p_72964_1_, int p_72964_2_) {
- return this.field_73020_y.func_186025_d(p_72964_1_, p_72964_2_);
- }
- public boolean func_190526_b(int p_190526_1_, int p_190526_2_) {
- 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_);
- }
- public boolean func_180501_a(BlockPos p_180501_1_, IBlockState p_180501_2_, int p_180501_3_) {
- if(this.func_189509_E(p_180501_1_)) {
- return false;
- } else if(!this.field_72995_K && this.field_72986_A.func_76067_t() == WorldType.field_180272_g) {
- return false;
- } else {
- Chunk chunk = this.func_175726_f(p_180501_1_);
- Block block = p_180501_2_.func_177230_c();
- IBlockState iblockstate = chunk.func_177436_a(p_180501_1_, p_180501_2_);
- if(iblockstate == null) {
- return false;
- } else {
- if(p_180501_2_.func_185891_c() != iblockstate.func_185891_c() || p_180501_2_.func_185906_d() != iblockstate.func_185906_d()) {
- this.field_72984_F.func_76320_a("checkLight");
- this.func_175664_x(p_180501_1_);
- this.field_72984_F.func_76319_b();
- }
- if((p_180501_3_ & 2) != 0 && (!this.field_72995_K || (p_180501_3_ & 4) == 0) && chunk.func_150802_k()) {
- this.func_184138_a(p_180501_1_, iblockstate, p_180501_2_, p_180501_3_);
- }
- if(!this.field_72995_K && (p_180501_3_ & 1) != 0) {
- this.func_175722_b(p_180501_1_, iblockstate.func_177230_c(), true);
- if(p_180501_2_.func_185912_n()) {
- this.func_175666_e(p_180501_1_, block);
- }
- } else if(!this.field_72995_K && (p_180501_3_ & 16) == 0) {
- this.func_190522_c(p_180501_1_, block);
- }
- return true;
- }
- }
- }
- public boolean func_175698_g(BlockPos p_175698_1_) {
- return this.func_180501_a(p_175698_1_, Blocks.field_150350_a.func_176223_P(), 3);
- }
- public boolean func_175655_b(BlockPos p_175655_1_, boolean p_175655_2_) {
- IBlockState iblockstate = this.func_180495_p(p_175655_1_);
- Block block = iblockstate.func_177230_c();
- if(iblockstate.func_185904_a() == Material.field_151579_a) {
- return false;
- } else {
- this.func_175718_b(2001, p_175655_1_, Block.func_176210_f(iblockstate));
- if(p_175655_2_) {
- block.func_176226_b(this, p_175655_1_, iblockstate, 0);
- }
- return this.func_180501_a(p_175655_1_, Blocks.field_150350_a.func_176223_P(), 3);
- }
- }
- public boolean func_175656_a(BlockPos p_175656_1_, IBlockState p_175656_2_) {
- return this.func_180501_a(p_175656_1_, p_175656_2_, 3);
- }
- public void func_184138_a(BlockPos p_184138_1_, IBlockState p_184138_2_, IBlockState p_184138_3_, int p_184138_4_) {
- for(int i = 0; i < this.field_73021_x.size(); ++i) {
- ((IWorldEventListener)this.field_73021_x.get(i)).func_184376_a(this, p_184138_1_, p_184138_2_, p_184138_3_, p_184138_4_);
- }
- }
- public void func_175722_b(BlockPos p_175722_1_, Block p_175722_2_, boolean p_175722_3_) {
- if(this.field_72986_A.func_76067_t() != WorldType.field_180272_g) {
- this.func_175685_c(p_175722_1_, p_175722_2_, p_175722_3_);
- }
- }
- public void func_72975_g(int p_72975_1_, int p_72975_2_, int p_72975_3_, int p_72975_4_) {
- if(p_72975_3_ > p_72975_4_) {
- int i = p_72975_4_;
- p_72975_4_ = p_72975_3_;
- p_72975_3_ = i;
- }
- if(this.field_73011_w.func_191066_m()) {
- for(int j = p_72975_3_; j <= p_72975_4_; ++j) {
- this.func_180500_c(EnumSkyBlock.SKY, new BlockPos(p_72975_1_, j, p_72975_2_));
- }
- }
- this.func_147458_c(p_72975_1_, p_72975_3_, p_72975_2_, p_72975_1_, p_72975_4_, p_72975_2_);
- }
- public void func_175704_b(BlockPos p_175704_1_, BlockPos p_175704_2_) {
- 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());
- }
- 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_) {
- for(int i = 0; i < this.field_73021_x.size(); ++i) {
- ((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_);
- }
- }
- public void func_190522_c(BlockPos p_190522_1_, Block p_190522_2_) {
- this.func_190529_b(p_190522_1_.func_177976_e(), p_190522_2_, p_190522_1_);
- this.func_190529_b(p_190522_1_.func_177974_f(), p_190522_2_, p_190522_1_);
- this.func_190529_b(p_190522_1_.func_177977_b(), p_190522_2_, p_190522_1_);
- this.func_190529_b(p_190522_1_.func_177984_a(), p_190522_2_, p_190522_1_);
- this.func_190529_b(p_190522_1_.func_177978_c(), p_190522_2_, p_190522_1_);
- this.func_190529_b(p_190522_1_.func_177968_d(), p_190522_2_, p_190522_1_);
- }
- public void func_175685_c(BlockPos p_175685_1_, Block p_175685_2_, boolean p_175685_3_) {
- this.func_190524_a(p_175685_1_.func_177976_e(), p_175685_2_, p_175685_1_);
- this.func_190524_a(p_175685_1_.func_177974_f(), p_175685_2_, p_175685_1_);
- this.func_190524_a(p_175685_1_.func_177977_b(), p_175685_2_, p_175685_1_);
- this.func_190524_a(p_175685_1_.func_177984_a(), p_175685_2_, p_175685_1_);
- this.func_190524_a(p_175685_1_.func_177978_c(), p_175685_2_, p_175685_1_);
- this.func_190524_a(p_175685_1_.func_177968_d(), p_175685_2_, p_175685_1_);
- if(p_175685_3_) {
- this.func_190522_c(p_175685_1_, p_175685_2_);
- }
- }
- public void func_175695_a(BlockPos p_175695_1_, Block p_175695_2_, EnumFacing p_175695_3_) {
- if(p_175695_3_ != EnumFacing.WEST) {
- this.func_190524_a(p_175695_1_.func_177976_e(), p_175695_2_, p_175695_1_);
- }
- if(p_175695_3_ != EnumFacing.EAST) {
- this.func_190524_a(p_175695_1_.func_177974_f(), p_175695_2_, p_175695_1_);
- }
- if(p_175695_3_ != EnumFacing.DOWN) {
- this.func_190524_a(p_175695_1_.func_177977_b(), p_175695_2_, p_175695_1_);
- }
- if(p_175695_3_ != EnumFacing.UP) {
- this.func_190524_a(p_175695_1_.func_177984_a(), p_175695_2_, p_175695_1_);
- }
- if(p_175695_3_ != EnumFacing.NORTH) {
- this.func_190524_a(p_175695_1_.func_177978_c(), p_175695_2_, p_175695_1_);
- }
- if(p_175695_3_ != EnumFacing.SOUTH) {
- this.func_190524_a(p_175695_1_.func_177968_d(), p_175695_2_, p_175695_1_);
- }
- }
- public void func_190524_a(BlockPos p_190524_1_, final Block p_190524_2_, BlockPos p_190524_3_) {
- if(!this.field_72995_K) {
- IBlockState iblockstate = this.func_180495_p(p_190524_1_);
- try {
- iblockstate.func_189546_a(this, p_190524_1_, p_190524_2_, p_190524_3_);
- } catch (Throwable throwable) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable, "Exception while updating neighbours");
- CrashReportCategory crashreportcategory = crashreport.func_85058_a("Block being updated");
- crashreportcategory.func_189529_a("Source block type", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- try {
- 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()});
- } catch (Throwable var2) {
- return "ID #" + Block.func_149682_b(p_190524_2_);
- }
- }
- });
- CrashReportCategory.func_175750_a(crashreportcategory, p_190524_1_, iblockstate);
- throw new ReportedException(crashreport);
- }
- }
- }
- public void func_190529_b(BlockPos p_190529_1_, final Block p_190529_2_, BlockPos p_190529_3_) {
- if(!this.field_72995_K) {
- IBlockState iblockstate = this.func_180495_p(p_190529_1_);
- if(iblockstate.func_177230_c() == Blocks.field_190976_dk) {
- try {
- ((BlockObserver)iblockstate.func_177230_c()).func_190962_b(iblockstate, this, p_190529_1_, p_190529_2_, p_190529_3_);
- } catch (Throwable throwable) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable, "Exception while updating neighbours");
- CrashReportCategory crashreportcategory = crashreport.func_85058_a("Block being updated");
- crashreportcategory.func_189529_a("Source block type", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- try {
- 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()});
- } catch (Throwable var2) {
- return "ID #" + Block.func_149682_b(p_190529_2_);
- }
- }
- });
- CrashReportCategory.func_175750_a(crashreportcategory, p_190529_1_, iblockstate);
- throw new ReportedException(crashreport);
- }
- }
- }
- }
- public boolean func_175691_a(BlockPos p_175691_1_, Block p_175691_2_) {
- return false;
- }
- public boolean func_175678_i(BlockPos p_175678_1_) {
- return this.func_175726_f(p_175678_1_).func_177444_d(p_175678_1_);
- }
- public boolean func_175710_j(BlockPos p_175710_1_) {
- if(p_175710_1_.func_177956_o() >= this.func_181545_F()) {
- return this.func_175678_i(p_175710_1_);
- } else {
- BlockPos blockpos = new BlockPos(p_175710_1_.func_177958_n(), this.func_181545_F(), p_175710_1_.func_177952_p());
- if(!this.func_175678_i(blockpos)) {
- return false;
- } else {
- for(blockpos = blockpos.func_177977_b(); blockpos.func_177956_o() > p_175710_1_.func_177956_o(); blockpos = blockpos.func_177977_b()) {
- IBlockState iblockstate = this.func_180495_p(blockpos);
- if(iblockstate.func_185891_c() > 0 && !iblockstate.func_185904_a().func_76224_d()) {
- return false;
- }
- }
- return true;
- }
- }
- }
- public int func_175699_k(BlockPos p_175699_1_) {
- if(p_175699_1_.func_177956_o() < 0) {
- return 0;
- } else {
- if(p_175699_1_.func_177956_o() >= 256) {
- p_175699_1_ = new BlockPos(p_175699_1_.func_177958_n(), 255, p_175699_1_.func_177952_p());
- }
- return this.func_175726_f(p_175699_1_).func_177443_a(p_175699_1_, 0);
- }
- }
- public int func_175671_l(BlockPos p_175671_1_) {
- return this.func_175721_c(p_175671_1_, true);
- }
- public int func_175721_c(BlockPos p_175721_1_, boolean p_175721_2_) {
- 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) {
- if(p_175721_2_ && this.func_180495_p(p_175721_1_).func_185916_f()) {
- int i1 = this.func_175721_c(p_175721_1_.func_177984_a(), false);
- int i = this.func_175721_c(p_175721_1_.func_177974_f(), false);
- int j = this.func_175721_c(p_175721_1_.func_177976_e(), false);
- int k = this.func_175721_c(p_175721_1_.func_177968_d(), false);
- int l = this.func_175721_c(p_175721_1_.func_177978_c(), false);
- if(i > i1) {
- i1 = i;
- }
- if(j > i1) {
- i1 = j;
- }
- if(k > i1) {
- i1 = k;
- }
- if(l > i1) {
- i1 = l;
- }
- return i1;
- } else if(p_175721_1_.func_177956_o() < 0) {
- return 0;
- } else {
- if(p_175721_1_.func_177956_o() >= 256) {
- p_175721_1_ = new BlockPos(p_175721_1_.func_177958_n(), 255, p_175721_1_.func_177952_p());
- }
- Chunk chunk = this.func_175726_f(p_175721_1_);
- return chunk.func_177443_a(p_175721_1_, this.field_73008_k);
- }
- } else {
- return 15;
- }
- }
- public BlockPos func_175645_m(BlockPos p_175645_1_) {
- 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());
- }
- public int func_189649_b(int p_189649_1_, int p_189649_2_) {
- int i;
- if(p_189649_1_ >= -30000000 && p_189649_2_ >= -30000000 && p_189649_1_ < 30000000 && p_189649_2_ < 30000000) {
- if(this.func_175680_a(p_189649_1_ >> 4, p_189649_2_ >> 4, true)) {
- i = this.func_72964_e(p_189649_1_ >> 4, p_189649_2_ >> 4).func_76611_b(p_189649_1_ & 15, p_189649_2_ & 15);
- } else {
- i = 0;
- }
- } else {
- i = this.func_181545_F() + 1;
- }
- return i;
- }
- @Deprecated
- public int func_82734_g(int p_82734_1_, int p_82734_2_) {
- if(p_82734_1_ >= -30000000 && p_82734_2_ >= -30000000 && p_82734_1_ < 30000000 && p_82734_2_ < 30000000) {
- if(!this.func_175680_a(p_82734_1_ >> 4, p_82734_2_ >> 4, true)) {
- return 0;
- } else {
- Chunk chunk = this.func_72964_e(p_82734_1_ >> 4, p_82734_2_ >> 4);
- return chunk.func_177442_v();
- }
- } else {
- return this.func_181545_F() + 1;
- }
- }
- @SideOnly(Side.CLIENT)
- public int func_175705_a(EnumSkyBlock p_175705_1_, BlockPos p_175705_2_) {
- if(!this.field_73011_w.func_191066_m() && p_175705_1_ == EnumSkyBlock.SKY) {
- return 0;
- } else {
- if(p_175705_2_.func_177956_o() < 0) {
- p_175705_2_ = new BlockPos(p_175705_2_.func_177958_n(), 0, p_175705_2_.func_177952_p());
- }
- if(!this.func_175701_a(p_175705_2_)) {
- return p_175705_1_.field_77198_c;
- } else if(!this.func_175667_e(p_175705_2_)) {
- return p_175705_1_.field_77198_c;
- } else if(this.func_180495_p(p_175705_2_).func_185916_f()) {
- int i1 = this.func_175642_b(p_175705_1_, p_175705_2_.func_177984_a());
- int i = this.func_175642_b(p_175705_1_, p_175705_2_.func_177974_f());
- int j = this.func_175642_b(p_175705_1_, p_175705_2_.func_177976_e());
- int k = this.func_175642_b(p_175705_1_, p_175705_2_.func_177968_d());
- int l = this.func_175642_b(p_175705_1_, p_175705_2_.func_177978_c());
- if(i > i1) {
- i1 = i;
- }
- if(j > i1) {
- i1 = j;
- }
- if(k > i1) {
- i1 = k;
- }
- if(l > i1) {
- i1 = l;
- }
- return i1;
- } else {
- Chunk chunk = this.func_175726_f(p_175705_2_);
- return chunk.func_177413_a(p_175705_1_, p_175705_2_);
- }
- }
- }
- public int func_175642_b(EnumSkyBlock p_175642_1_, BlockPos p_175642_2_) {
- if(p_175642_2_.func_177956_o() < 0) {
- p_175642_2_ = new BlockPos(p_175642_2_.func_177958_n(), 0, p_175642_2_.func_177952_p());
- }
- if(!this.func_175701_a(p_175642_2_)) {
- return p_175642_1_.field_77198_c;
- } else if(!this.func_175667_e(p_175642_2_)) {
- return p_175642_1_.field_77198_c;
- } else {
- Chunk chunk = this.func_175726_f(p_175642_2_);
- return chunk.func_177413_a(p_175642_1_, p_175642_2_);
- }
- }
- public void func_175653_a(EnumSkyBlock p_175653_1_, BlockPos p_175653_2_, int p_175653_3_) {
- if(this.func_175701_a(p_175653_2_)) {
- if(this.func_175667_e(p_175653_2_)) {
- Chunk chunk = this.func_175726_f(p_175653_2_);
- chunk.func_177431_a(p_175653_1_, p_175653_2_, p_175653_3_);
- this.func_175679_n(p_175653_2_);
- }
- }
- }
- public void func_175679_n(BlockPos p_175679_1_) {
- for(int i = 0; i < this.field_73021_x.size(); ++i) {
- ((IWorldEventListener)this.field_73021_x.get(i)).func_174959_b(p_175679_1_);
- }
- }
- @SideOnly(Side.CLIENT)
- public int func_175626_b(BlockPos p_175626_1_, int p_175626_2_) {
- int i = this.func_175705_a(EnumSkyBlock.SKY, p_175626_1_);
- int j = this.func_175705_a(EnumSkyBlock.BLOCK, p_175626_1_);
- if(j < p_175626_2_) {
- j = p_175626_2_;
- }
- return i << 20 | j << 4;
- }
- public float func_175724_o(BlockPos p_175724_1_) {
- return this.field_73011_w.func_177497_p()[this.func_175671_l(p_175724_1_)];
- }
- public IBlockState func_180495_p(BlockPos p_180495_1_) {
- if(this.func_189509_E(p_180495_1_)) {
- return Blocks.field_150350_a.func_176223_P();
- } else {
- Chunk chunk = this.func_175726_f(p_180495_1_);
- return chunk.func_177435_g(p_180495_1_);
- }
- }
- public boolean func_72935_r() {
- return this.field_73008_k < 4;
- }
- @Nullable
- public RayTraceResult func_72933_a(Vec3d p_72933_1_, Vec3d p_72933_2_) {
- return this.func_147447_a(p_72933_1_, p_72933_2_, false, false, false);
- }
- @Nullable
- public RayTraceResult func_72901_a(Vec3d p_72901_1_, Vec3d p_72901_2_, boolean p_72901_3_) {
- return this.func_147447_a(p_72901_1_, p_72901_2_, p_72901_3_, false, false);
- }
- @Nullable
- 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_) {
- 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)) {
- 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)) {
- int i = MathHelper.func_76128_c(p_147447_2_.field_72450_a);
- int j = MathHelper.func_76128_c(p_147447_2_.field_72448_b);
- int k = MathHelper.func_76128_c(p_147447_2_.field_72449_c);
- int l = MathHelper.func_76128_c(p_147447_1_.field_72450_a);
- int i1 = MathHelper.func_76128_c(p_147447_1_.field_72448_b);
- int j1 = MathHelper.func_76128_c(p_147447_1_.field_72449_c);
- BlockPos blockpos = new BlockPos(l, i1, j1);
- IBlockState iblockstate = this.func_180495_p(blockpos);
- Block block = iblockstate.func_177230_c();
- if((!p_147447_4_ || iblockstate.func_185890_d(this, blockpos) != Block.field_185506_k) && block.func_176209_a(iblockstate, p_147447_3_)) {
- RayTraceResult raytraceresult = iblockstate.func_185910_a(this, blockpos, p_147447_1_, p_147447_2_);
- if(raytraceresult != null) {
- return raytraceresult;
- }
- }
- RayTraceResult raytraceresult2 = null;
- int k1 = 200;
- while(k1-- >= 0) {
- 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)) {
- return null;
- }
- if(l == i && i1 == j && j1 == k) {
- return p_147447_5_?raytraceresult2:null;
- }
- boolean flag2 = true;
- boolean flag = true;
- boolean flag1 = true;
- double d0 = 999.0D;
- double d1 = 999.0D;
- double d2 = 999.0D;
- if(i > l) {
- d0 = (double)l + 1.0D;
- } else if(i < l) {
- d0 = (double)l + 0.0D;
- } else {
- flag2 = false;
- }
- if(j > i1) {
- d1 = (double)i1 + 1.0D;
- } else if(j < i1) {
- d1 = (double)i1 + 0.0D;
- } else {
- flag = false;
- }
- if(k > j1) {
- d2 = (double)j1 + 1.0D;
- } else if(k < j1) {
- d2 = (double)j1 + 0.0D;
- } else {
- flag1 = false;
- }
- double d3 = 999.0D;
- double d4 = 999.0D;
- double d5 = 999.0D;
- double d6 = p_147447_2_.field_72450_a - p_147447_1_.field_72450_a;
- double d7 = p_147447_2_.field_72448_b - p_147447_1_.field_72448_b;
- double d8 = p_147447_2_.field_72449_c - p_147447_1_.field_72449_c;
- if(flag2) {
- d3 = (d0 - p_147447_1_.field_72450_a) / d6;
- }
- if(flag) {
- d4 = (d1 - p_147447_1_.field_72448_b) / d7;
- }
- if(flag1) {
- d5 = (d2 - p_147447_1_.field_72449_c) / d8;
- }
- if(d3 == -0.0D) {
- d3 = -1.0E-4D;
- }
- if(d4 == -0.0D) {
- d4 = -1.0E-4D;
- }
- if(d5 == -0.0D) {
- d5 = -1.0E-4D;
- }
- EnumFacing enumfacing;
- if(d3 < d4 && d3 < d5) {
- enumfacing = i > l?EnumFacing.WEST:EnumFacing.EAST;
- p_147447_1_ = new Vec3d(d0, p_147447_1_.field_72448_b + d7 * d3, p_147447_1_.field_72449_c + d8 * d3);
- } else if(d4 < d5) {
- enumfacing = j > i1?EnumFacing.DOWN:EnumFacing.UP;
- p_147447_1_ = new Vec3d(p_147447_1_.field_72450_a + d6 * d4, d1, p_147447_1_.field_72449_c + d8 * d4);
- } else {
- enumfacing = k > j1?EnumFacing.NORTH:EnumFacing.SOUTH;
- p_147447_1_ = new Vec3d(p_147447_1_.field_72450_a + d6 * d5, p_147447_1_.field_72448_b + d7 * d5, d2);
- }
- l = MathHelper.func_76128_c(p_147447_1_.field_72450_a) - (enumfacing == EnumFacing.EAST?1:0);
- i1 = MathHelper.func_76128_c(p_147447_1_.field_72448_b) - (enumfacing == EnumFacing.UP?1:0);
- j1 = MathHelper.func_76128_c(p_147447_1_.field_72449_c) - (enumfacing == EnumFacing.SOUTH?1:0);
- blockpos = new BlockPos(l, i1, j1);
- IBlockState iblockstate1 = this.func_180495_p(blockpos);
- Block block1 = iblockstate1.func_177230_c();
- if(!p_147447_4_ || iblockstate1.func_185904_a() == Material.field_151567_E || iblockstate1.func_185890_d(this, blockpos) != Block.field_185506_k) {
- if(block1.func_176209_a(iblockstate1, p_147447_3_)) {
- RayTraceResult raytraceresult1 = iblockstate1.func_185910_a(this, blockpos, p_147447_1_, p_147447_2_);
- if(raytraceresult1 != null) {
- return raytraceresult1;
- }
- } else {
- raytraceresult2 = new RayTraceResult(RayTraceResult.Type.MISS, p_147447_1_, enumfacing, blockpos);
- }
- }
- }
- return p_147447_5_?raytraceresult2:null;
- } else {
- return null;
- }
- } else {
- return null;
- }
- }
- 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_) {
- 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_);
- }
- 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_) {
- for(int i = 0; i < this.field_73021_x.size(); ++i) {
- ((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_);
- }
- }
- 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_) {
- }
- public void func_184149_a(BlockPos p_184149_1_, @Nullable SoundEvent p_184149_2_) {
- for(int i = 0; i < this.field_73021_x.size(); ++i) {
- ((IWorldEventListener)this.field_73021_x.get(i)).func_184377_a(p_184149_2_, p_184149_1_);
- }
- }
- 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_) {
- 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_);
- }
- 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_) {
- for(int i = 0; i < this.field_73021_x.size(); ++i) {
- ((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_);
- }
- }
- @SideOnly(Side.CLIENT)
- 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_) {
- 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_);
- }
- 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_) {
- for(int i = 0; i < this.field_73021_x.size(); ++i) {
- ((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_);
- }
- }
- public boolean func_72942_c(Entity p_72942_1_) {
- this.field_73007_j.add(p_72942_1_);
- return true;
- }
- public boolean func_72838_d(Entity p_72838_1_) {
- int i = MathHelper.func_76128_c(p_72838_1_.field_70165_t / 16.0D);
- int j = MathHelper.func_76128_c(p_72838_1_.field_70161_v / 16.0D);
- boolean flag = p_72838_1_.field_98038_p;
- if(p_72838_1_ instanceof EntityPlayer) {
- flag = true;
- }
- if(!flag && !this.func_175680_a(i, j, false)) {
- return false;
- } else {
- if(p_72838_1_ instanceof EntityPlayer) {
- EntityPlayer entityplayer = (EntityPlayer)p_72838_1_;
- this.field_73010_i.add(entityplayer);
- this.func_72854_c();
- }
- this.func_72964_e(i, j).func_76612_a(p_72838_1_);
- this.field_72996_f.add(p_72838_1_);
- this.func_72923_a(p_72838_1_);
- return true;
- }
- }
- public void func_72923_a(Entity p_72923_1_) {
- for(int i = 0; i < this.field_73021_x.size(); ++i) {
- ((IWorldEventListener)this.field_73021_x.get(i)).func_72703_a(p_72923_1_);
- }
- }
- public void func_72847_b(Entity p_72847_1_) {
- for(int i = 0; i < this.field_73021_x.size(); ++i) {
- ((IWorldEventListener)this.field_73021_x.get(i)).func_72709_b(p_72847_1_);
- }
- }
- public void func_72900_e(Entity p_72900_1_) {
- if(p_72900_1_.func_184207_aI()) {
- p_72900_1_.func_184226_ay();
- }
- if(p_72900_1_.func_184218_aH()) {
- p_72900_1_.func_184210_p();
- }
- p_72900_1_.func_70106_y();
- if(p_72900_1_ instanceof EntityPlayer) {
- this.field_73010_i.remove(p_72900_1_);
- this.func_72854_c();
- this.func_72847_b(p_72900_1_);
- }
- }
- public void func_72973_f(Entity p_72973_1_) {
- p_72973_1_.func_184174_b(false);
- p_72973_1_.func_70106_y();
- if(p_72973_1_ instanceof EntityPlayer) {
- this.field_73010_i.remove(p_72973_1_);
- this.func_72854_c();
- }
- int i = p_72973_1_.field_70176_ah;
- int j = p_72973_1_.field_70164_aj;
- if(p_72973_1_.field_70175_ag && this.func_175680_a(i, j, true)) {
- this.func_72964_e(i, j).func_76622_b(p_72973_1_);
- }
- this.field_72996_f.remove(p_72973_1_);
- this.func_72847_b(p_72973_1_);
- }
- public void func_72954_a(IWorldEventListener p_72954_1_) {
- this.field_73021_x.add(p_72954_1_);
- }
- private boolean func_191504_a(@Nullable Entity p_191504_1_, AxisAlignedBB p_191504_2_, boolean p_191504_3_, @Nullable List<AxisAlignedBB> p_191504_4_) {
- int i = MathHelper.func_76128_c(p_191504_2_.field_72340_a) - 1;
- int j = MathHelper.func_76143_f(p_191504_2_.field_72336_d) + 1;
- int k = MathHelper.func_76128_c(p_191504_2_.field_72338_b) - 1;
- int l = MathHelper.func_76143_f(p_191504_2_.field_72337_e) + 1;
- int i1 = MathHelper.func_76128_c(p_191504_2_.field_72339_c) - 1;
- int j1 = MathHelper.func_76143_f(p_191504_2_.field_72334_f) + 1;
- WorldBorder worldborder = this.func_175723_af();
- boolean flag = p_191504_1_ != null && p_191504_1_.func_174832_aS();
- boolean flag1 = p_191504_1_ != null && this.func_191503_g(p_191504_1_);
- IBlockState iblockstate = Blocks.field_150348_b.func_176223_P();
- BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
- try {
- for(int k1 = i; k1 < j; ++k1) {
- for(int l1 = i1; l1 < j1; ++l1) {
- boolean flag2 = k1 == i || k1 == j - 1;
- boolean flag3 = l1 == i1 || l1 == j1 - 1;
- if((!flag2 || !flag3) && this.func_175667_e(blockpos$pooledmutableblockpos.func_181079_c(k1, 64, l1))) {
- for(int i2 = k; i2 < l; ++i2) {
- if(!flag2 && !flag3 || i2 != l - 1) {
- if(p_191504_3_) {
- if(k1 < -30000000 || k1 >= 30000000 || l1 < -30000000 || l1 >= 30000000) {
- boolean lvt_21_1_ = true;
- return lvt_21_1_;
- }
- } else if(p_191504_1_ != null && flag == flag1) {
- p_191504_1_.func_174821_h(!flag1);
- }
- blockpos$pooledmutableblockpos.func_181079_c(k1, i2, l1);
- IBlockState iblockstate1;
- if(!p_191504_3_ && !worldborder.func_177746_a(blockpos$pooledmutableblockpos) && flag1) {
- iblockstate1 = iblockstate;
- } else {
- iblockstate1 = this.func_180495_p(blockpos$pooledmutableblockpos);
- }
- iblockstate1.func_185908_a(this, blockpos$pooledmutableblockpos, p_191504_2_, p_191504_4_, p_191504_1_, false);
- if(p_191504_3_ && !p_191504_4_.isEmpty()) {
- boolean flag5 = true;
- return flag5;
- }
- }
- }
- }
- }
- }
- } finally {
- blockpos$pooledmutableblockpos.func_185344_t();
- }
- return !p_191504_4_.isEmpty();
- }
- public List<AxisAlignedBB> func_184144_a(@Nullable Entity p_184144_1_, AxisAlignedBB p_184144_2_) {
- List<AxisAlignedBB> list = Lists.<AxisAlignedBB>newArrayList();
- this.func_191504_a(p_184144_1_, p_184144_2_, false, list);
- if(p_184144_1_ != null) {
- List<Entity> list1 = this.func_72839_b(p_184144_1_, p_184144_2_.func_186662_g(0.25D));
- for(int i = 0; i < list1.size(); ++i) {
- Entity entity = (Entity)list1.get(i);
- if(!p_184144_1_.func_184223_x(entity)) {
- AxisAlignedBB axisalignedbb = entity.func_70046_E();
- if(axisalignedbb != null && axisalignedbb.func_72326_a(p_184144_2_)) {
- list.add(axisalignedbb);
- }
- axisalignedbb = p_184144_1_.func_70114_g(entity);
- if(axisalignedbb != null && axisalignedbb.func_72326_a(p_184144_2_)) {
- list.add(axisalignedbb);
- }
- }
- }
- }
- return list;
- }
- @SideOnly(Side.CLIENT)
- public void func_72848_b(IWorldEventListener p_72848_1_) {
- this.field_73021_x.remove(p_72848_1_);
- }
- public boolean func_191503_g(Entity p_191503_1_) {
- double d0 = this.field_175728_M.func_177726_b();
- double d1 = this.field_175728_M.func_177736_c();
- double d2 = this.field_175728_M.func_177728_d();
- double d3 = this.field_175728_M.func_177733_e();
- if(p_191503_1_.func_174832_aS()) {
- ++d0;
- ++d1;
- --d2;
- --d3;
- } else {
- --d0;
- --d1;
- ++d2;
- ++d3;
- }
- 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;
- }
- public boolean func_184143_b(AxisAlignedBB p_184143_1_) {
- return this.func_191504_a((Entity)null, p_184143_1_, true, Lists.<AxisAlignedBB>newArrayList());
- }
- public int func_72967_a(float p_72967_1_) {
- float f = this.func_72826_c(p_72967_1_);
- float f1 = 1.0F - (MathHelper.func_76134_b(f * 6.2831855F) * 2.0F + 0.5F);
- f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F);
- f1 = 1.0F - f1;
- f1 = (float)((double)f1 * (1.0D - (double)(this.func_72867_j(p_72967_1_) * 5.0F) / 16.0D));
- f1 = (float)((double)f1 * (1.0D - (double)(this.func_72819_i(p_72967_1_) * 5.0F) / 16.0D));
- f1 = 1.0F - f1;
- return (int)(f1 * 11.0F);
- }
- @SideOnly(Side.CLIENT)
- public float func_72971_b(float p_72971_1_) {
- float f = this.func_72826_c(p_72971_1_);
- float f1 = 1.0F - (MathHelper.func_76134_b(f * 6.2831855F) * 2.0F + 0.2F);
- f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F);
- f1 = 1.0F - f1;
- f1 = (float)((double)f1 * (1.0D - (double)(this.func_72867_j(p_72971_1_) * 5.0F) / 16.0D));
- f1 = (float)((double)f1 * (1.0D - (double)(this.func_72819_i(p_72971_1_) * 5.0F) / 16.0D));
- return f1 * 0.8F + 0.2F;
- }
- @SideOnly(Side.CLIENT)
- public Vec3d func_72833_a(Entity p_72833_1_, float p_72833_2_) {
- float f = this.func_72826_c(p_72833_2_);
- float f1 = MathHelper.func_76134_b(f * 6.2831855F) * 2.0F + 0.5F;
- f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F);
- int i = MathHelper.func_76128_c(p_72833_1_.field_70165_t);
- int j = MathHelper.func_76128_c(p_72833_1_.field_70163_u);
- int k = MathHelper.func_76128_c(p_72833_1_.field_70161_v);
- BlockPos blockpos = new BlockPos(i, j, k);
- Biome biome = this.func_180494_b(blockpos);
- float f2 = biome.func_180626_a(blockpos);
- int l = biome.func_76731_a(f2);
- float f3 = (float)(l >> 16 & 255) / 255.0F;
- float f4 = (float)(l >> 8 & 255) / 255.0F;
- float f5 = (float)(l & 255) / 255.0F;
- f3 = f3 * f1;
- f4 = f4 * f1;
- f5 = f5 * f1;
- float f6 = this.func_72867_j(p_72833_2_);
- if(f6 > 0.0F) {
- float f7 = (f3 * 0.3F + f4 * 0.59F + f5 * 0.11F) * 0.6F;
- float f8 = 1.0F - f6 * 0.75F;
- f3 = f3 * f8 + f7 * (1.0F - f8);
- f4 = f4 * f8 + f7 * (1.0F - f8);
- f5 = f5 * f8 + f7 * (1.0F - f8);
- }
- float f10 = this.func_72819_i(p_72833_2_);
- if(f10 > 0.0F) {
- float f11 = (f3 * 0.3F + f4 * 0.59F + f5 * 0.11F) * 0.2F;
- float f9 = 1.0F - f10 * 0.75F;
- f3 = f3 * f9 + f11 * (1.0F - f9);
- f4 = f4 * f9 + f11 * (1.0F - f9);
- f5 = f5 * f9 + f11 * (1.0F - f9);
- }
- if(this.field_73016_r > 0) {
- float f12 = (float)this.field_73016_r - p_72833_2_;
- if(f12 > 1.0F) {
- f12 = 1.0F;
- }
- f12 = f12 * 0.45F;
- f3 = f3 * (1.0F - f12) + 0.8F * f12;
- f4 = f4 * (1.0F - f12) + 0.8F * f12;
- f5 = f5 * (1.0F - f12) + 1.0F * f12;
- }
- return new Vec3d((double)f3, (double)f4, (double)f5);
- }
- public float func_72826_c(float p_72826_1_) {
- return this.field_73011_w.func_76563_a(this.field_72986_A.func_76073_f(), p_72826_1_);
- }
- @SideOnly(Side.CLIENT)
- public int func_72853_d() {
- return this.field_73011_w.func_76559_b(this.field_72986_A.func_76073_f());
- }
- public float func_130001_d() {
- return WorldProvider.field_111203_a[this.field_73011_w.func_76559_b(this.field_72986_A.func_76073_f())];
- }
- public float func_72929_e(float p_72929_1_) {
- float f = this.func_72826_c(p_72929_1_);
- return f * 6.2831855F;
- }
- @SideOnly(Side.CLIENT)
- public Vec3d func_72824_f(float p_72824_1_) {
- float f = this.func_72826_c(p_72824_1_);
- float f1 = MathHelper.func_76134_b(f * 6.2831855F) * 2.0F + 0.5F;
- f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F);
- float f2 = 1.0F;
- float f3 = 1.0F;
- float f4 = 1.0F;
- float f5 = this.func_72867_j(p_72824_1_);
- if(f5 > 0.0F) {
- float f6 = (f2 * 0.3F + f3 * 0.59F + f4 * 0.11F) * 0.6F;
- float f7 = 1.0F - f5 * 0.95F;
- f2 = f2 * f7 + f6 * (1.0F - f7);
- f3 = f3 * f7 + f6 * (1.0F - f7);
- f4 = f4 * f7 + f6 * (1.0F - f7);
- }
- f2 = f2 * (f1 * 0.9F + 0.1F);
- f3 = f3 * (f1 * 0.9F + 0.1F);
- f4 = f4 * (f1 * 0.85F + 0.15F);
- float f9 = this.func_72819_i(p_72824_1_);
- if(f9 > 0.0F) {
- float f10 = (f2 * 0.3F + f3 * 0.59F + f4 * 0.11F) * 0.2F;
- float f8 = 1.0F - f9 * 0.95F;
- f2 = f2 * f8 + f10 * (1.0F - f8);
- f3 = f3 * f8 + f10 * (1.0F - f8);
- f4 = f4 * f8 + f10 * (1.0F - f8);
- }
- return new Vec3d((double)f2, (double)f3, (double)f4);
- }
- @SideOnly(Side.CLIENT)
- public Vec3d func_72948_g(float p_72948_1_) {
- float f = this.func_72826_c(p_72948_1_);
- return this.field_73011_w.func_76562_b(f, p_72948_1_);
- }
- public BlockPos func_175725_q(BlockPos p_175725_1_) {
- return this.func_175726_f(p_175725_1_).func_177440_h(p_175725_1_);
- }
- public BlockPos func_175672_r(BlockPos p_175672_1_) {
- Chunk chunk = this.func_175726_f(p_175672_1_);
- BlockPos blockpos;
- BlockPos blockpos1;
- 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) {
- blockpos1 = blockpos.func_177977_b();
- Material material = chunk.func_177435_g(blockpos1).func_185904_a();
- if(material.func_76230_c() && material != Material.field_151584_j) {
- break;
- }
- }
- return blockpos;
- }
- @SideOnly(Side.CLIENT)
- public float func_72880_h(float p_72880_1_) {
- float f = this.func_72826_c(p_72880_1_);
- float f1 = 1.0F - (MathHelper.func_76134_b(f * 6.2831855F) * 2.0F + 0.25F);
- f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F);
- return f1 * f1 * 0.5F;
- }
- public boolean func_184145_b(BlockPos p_184145_1_, Block p_184145_2_) {
- return true;
- }
- public void func_175684_a(BlockPos p_175684_1_, Block p_175684_2_, int p_175684_3_) {
- }
- public void func_175654_a(BlockPos p_175654_1_, Block p_175654_2_, int p_175654_3_, int p_175654_4_) {
- }
- public void func_180497_b(BlockPos p_180497_1_, Block p_180497_2_, int p_180497_3_, int p_180497_4_) {
- }
- public void func_72939_s() {
- this.field_72984_F.func_76320_a("entities");
- this.field_72984_F.func_76320_a("global");
- for(int i = 0; i < this.field_73007_j.size(); ++i) {
- Entity entity = (Entity)this.field_73007_j.get(i);
- try {
- ++entity.field_70173_aa;
- entity.func_70071_h_();
- } catch (Throwable throwable2) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable2, "Ticking entity");
- CrashReportCategory crashreportcategory = crashreport.func_85058_a("Entity being ticked");
- if(entity == null) {
- crashreportcategory.func_71507_a("Entity", "~~NULL~~");
- } else {
- entity.func_85029_a(crashreportcategory);
- }
- throw new ReportedException(crashreport);
- }
- if(entity.field_70128_L) {
- this.field_73007_j.remove(i--);
- }
- }
- this.field_72984_F.func_76318_c("remove");
- this.field_72996_f.removeAll(this.field_72997_g);
- for(int k = 0; k < this.field_72997_g.size(); ++k) {
- Entity entity1 = (Entity)this.field_72997_g.get(k);
- int j = entity1.field_70176_ah;
- int k1 = entity1.field_70164_aj;
- if(entity1.field_70175_ag && this.func_175680_a(j, k1, true)) {
- this.func_72964_e(j, k1).func_76622_b(entity1);
- }
- }
- for(int l = 0; l < this.field_72997_g.size(); ++l) {
- this.func_72847_b((Entity)this.field_72997_g.get(l));
- }
- this.field_72997_g.clear();
- this.func_184147_l();
- this.field_72984_F.func_76318_c("regular");
- for(int i1 = 0; i1 < this.field_72996_f.size(); ++i1) {
- Entity entity2 = (Entity)this.field_72996_f.get(i1);
- Entity entity3 = entity2.func_184187_bx();
- if(entity3 != null) {
- if(!entity3.field_70128_L && entity3.func_184196_w(entity2)) {
- continue;
- }
- entity2.func_184210_p();
- }
- this.field_72984_F.func_76320_a("tick");
- if(!entity2.field_70128_L && !(entity2 instanceof EntityPlayerMP)) {
- try {
- this.func_72870_g(entity2);
- } catch (Throwable throwable1) {
- CrashReport crashreport1 = CrashReport.func_85055_a(throwable1, "Ticking entity");
- CrashReportCategory crashreportcategory1 = crashreport1.func_85058_a("Entity being ticked");
- entity2.func_85029_a(crashreportcategory1);
- throw new ReportedException(crashreport1);
- }
- }
- this.field_72984_F.func_76319_b();
- this.field_72984_F.func_76320_a("remove");
- if(entity2.field_70128_L) {
- int l1 = entity2.field_70176_ah;
- int i2 = entity2.field_70164_aj;
- if(entity2.field_70175_ag && this.func_175680_a(l1, i2, true)) {
- this.func_72964_e(l1, i2).func_76622_b(entity2);
- }
- this.field_72996_f.remove(i1--);
- this.func_72847_b(entity2);
- }
- this.field_72984_F.func_76319_b();
- }
- this.field_72984_F.func_76318_c("blockEntities");
- this.field_147481_N = true;
- Iterator<TileEntity> iterator = this.field_175730_i.iterator();
- while(iterator.hasNext()) {
- TileEntity tileentity = (TileEntity)iterator.next();
- if(!tileentity.func_145837_r() && tileentity.func_145830_o()) {
- BlockPos blockpos = tileentity.func_174877_v();
- if(this.func_175667_e(blockpos) && this.field_175728_M.func_177746_a(blockpos)) {
- try {
- this.field_72984_F.func_76320_a(tileentity.getClass().getSimpleName());
- ((ITickable)tileentity).func_73660_a();
- this.field_72984_F.func_76319_b();
- } catch (Throwable throwable) {
- CrashReport crashreport2 = CrashReport.func_85055_a(throwable, "Ticking block entity");
- CrashReportCategory crashreportcategory2 = crashreport2.func_85058_a("Block entity being ticked");
- tileentity.func_145828_a(crashreportcategory2);
- throw new ReportedException(crashreport2);
- }
- }
- }
- if(tileentity.func_145837_r()) {
- iterator.remove();
- this.field_147482_g.remove(tileentity);
- if(this.func_175667_e(tileentity.func_174877_v())) {
- this.func_175726_f(tileentity.func_174877_v()).func_177425_e(tileentity.func_174877_v());
- }
- }
- }
- this.field_147481_N = false;
- if(!this.field_147483_b.isEmpty()) {
- this.field_175730_i.removeAll(this.field_147483_b);
- this.field_147482_g.removeAll(this.field_147483_b);
- this.field_147483_b.clear();
- }
- this.field_72984_F.func_76318_c("pendingBlockEntities");
- if(!this.field_147484_a.isEmpty()) {
- for(int j1 = 0; j1 < this.field_147484_a.size(); ++j1) {
- TileEntity tileentity1 = (TileEntity)this.field_147484_a.get(j1);
- if(!tileentity1.func_145837_r()) {
- if(!this.field_147482_g.contains(tileentity1)) {
- this.func_175700_a(tileentity1);
- }
- if(this.func_175667_e(tileentity1.func_174877_v())) {
- Chunk chunk = this.func_175726_f(tileentity1.func_174877_v());
- IBlockState iblockstate = chunk.func_177435_g(tileentity1.func_174877_v());
- chunk.func_177426_a(tileentity1.func_174877_v(), tileentity1);
- this.func_184138_a(tileentity1.func_174877_v(), iblockstate, iblockstate, 3);
- }
- }
- }
- this.field_147484_a.clear();
- }
- this.field_72984_F.func_76319_b();
- this.field_72984_F.func_76319_b();
- }
- protected void func_184147_l() {
- }
- public boolean func_175700_a(TileEntity p_175700_1_) {
- boolean flag = this.field_147482_g.add(p_175700_1_);
- if(flag && p_175700_1_ instanceof ITickable) {
- this.field_175730_i.add(p_175700_1_);
- }
- if(this.field_72995_K) {
- BlockPos blockpos = p_175700_1_.func_174877_v();
- IBlockState iblockstate = this.func_180495_p(blockpos);
- this.func_184138_a(blockpos, iblockstate, iblockstate, 2);
- }
- return flag;
- }
- public void func_147448_a(Collection<TileEntity> p_147448_1_) {
- if(this.field_147481_N) {
- this.field_147484_a.addAll(p_147448_1_);
- } else {
- for(TileEntity tileentity : p_147448_1_) {
- this.func_175700_a(tileentity);
- }
- }
- }
- public void func_72870_g(Entity p_72870_1_) {
- this.func_72866_a(p_72870_1_, true);
- }
- public void func_72866_a(Entity p_72866_1_, boolean p_72866_2_) {
- if(!(p_72866_1_ instanceof EntityPlayer)) {
- int i = MathHelper.func_76128_c(p_72866_1_.field_70165_t);
- int j = MathHelper.func_76128_c(p_72866_1_.field_70161_v);
- int k = 32;
- if(p_72866_2_ && !this.func_175663_a(i - 32, 0, j - 32, i + 32, 0, j + 32, true)) {
- return;
- }
- }
- p_72866_1_.field_70142_S = p_72866_1_.field_70165_t;
- p_72866_1_.field_70137_T = p_72866_1_.field_70163_u;
- p_72866_1_.field_70136_U = p_72866_1_.field_70161_v;
- p_72866_1_.field_70126_B = p_72866_1_.field_70177_z;
- p_72866_1_.field_70127_C = p_72866_1_.field_70125_A;
- if(p_72866_2_ && p_72866_1_.field_70175_ag) {
- ++p_72866_1_.field_70173_aa;
- if(p_72866_1_.func_184218_aH()) {
- p_72866_1_.func_70098_U();
- } else {
- p_72866_1_.func_70071_h_();
- }
- }
- this.field_72984_F.func_76320_a("chunkCheck");
- if(Double.isNaN(p_72866_1_.field_70165_t) || Double.isInfinite(p_72866_1_.field_70165_t)) {
- p_72866_1_.field_70165_t = p_72866_1_.field_70142_S;
- }
- if(Double.isNaN(p_72866_1_.field_70163_u) || Double.isInfinite(p_72866_1_.field_70163_u)) {
- p_72866_1_.field_70163_u = p_72866_1_.field_70137_T;
- }
- if(Double.isNaN(p_72866_1_.field_70161_v) || Double.isInfinite(p_72866_1_.field_70161_v)) {
- p_72866_1_.field_70161_v = p_72866_1_.field_70136_U;
- }
- if(Double.isNaN((double)p_72866_1_.field_70125_A) || Double.isInfinite((double)p_72866_1_.field_70125_A)) {
- p_72866_1_.field_70125_A = p_72866_1_.field_70127_C;
- }
- if(Double.isNaN((double)p_72866_1_.field_70177_z) || Double.isInfinite((double)p_72866_1_.field_70177_z)) {
- p_72866_1_.field_70177_z = p_72866_1_.field_70126_B;
- }
- int l = MathHelper.func_76128_c(p_72866_1_.field_70165_t / 16.0D);
- int i1 = MathHelper.func_76128_c(p_72866_1_.field_70163_u / 16.0D);
- int j1 = MathHelper.func_76128_c(p_72866_1_.field_70161_v / 16.0D);
- 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) {
- if(p_72866_1_.field_70175_ag && this.func_175680_a(p_72866_1_.field_70176_ah, p_72866_1_.field_70164_aj, true)) {
- 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);
- }
- if(!p_72866_1_.func_184189_br() && !this.func_175680_a(l, j1, true)) {
- p_72866_1_.field_70175_ag = false;
- } else {
- this.func_72964_e(l, j1).func_76612_a(p_72866_1_);
- }
- }
- this.field_72984_F.func_76319_b();
- if(p_72866_2_ && p_72866_1_.field_70175_ag) {
- for(Entity entity : p_72866_1_.func_184188_bt()) {
- if(!entity.field_70128_L && entity.func_184187_bx() == p_72866_1_) {
- this.func_72870_g(entity);
- } else {
- entity.func_184210_p();
- }
- }
- }
- }
- public boolean func_72855_b(AxisAlignedBB p_72855_1_) {
- return this.func_72917_a(p_72855_1_, (Entity)null);
- }
- public boolean func_72917_a(AxisAlignedBB p_72917_1_, @Nullable Entity p_72917_2_) {
- List<Entity> list = this.func_72839_b((Entity)null, p_72917_1_);
- for(int i = 0; i < list.size(); ++i) {
- Entity entity = (Entity)list.get(i);
- if(!entity.field_70128_L && entity.field_70156_m && entity != p_72917_2_ && (p_72917_2_ == null || entity.func_184223_x(p_72917_2_))) {
- return false;
- }
- }
- return true;
- }
- public boolean func_72829_c(AxisAlignedBB p_72829_1_) {
- int i = MathHelper.func_76128_c(p_72829_1_.field_72340_a);
- int j = MathHelper.func_76143_f(p_72829_1_.field_72336_d);
- int k = MathHelper.func_76128_c(p_72829_1_.field_72338_b);
- int l = MathHelper.func_76143_f(p_72829_1_.field_72337_e);
- int i1 = MathHelper.func_76128_c(p_72829_1_.field_72339_c);
- int j1 = MathHelper.func_76143_f(p_72829_1_.field_72334_f);
- BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
- for(int k1 = i; k1 < j; ++k1) {
- for(int l1 = k; l1 < l; ++l1) {
- for(int i2 = i1; i2 < j1; ++i2) {
- IBlockState iblockstate = this.func_180495_p(blockpos$pooledmutableblockpos.func_181079_c(k1, l1, i2));
- if(iblockstate.func_185904_a() != Material.field_151579_a) {
- blockpos$pooledmutableblockpos.func_185344_t();
- return true;
- }
- }
- }
- }
- blockpos$pooledmutableblockpos.func_185344_t();
- return false;
- }
- public boolean func_72953_d(AxisAlignedBB p_72953_1_) {
- int i = MathHelper.func_76128_c(p_72953_1_.field_72340_a);
- int j = MathHelper.func_76143_f(p_72953_1_.field_72336_d);
- int k = MathHelper.func_76128_c(p_72953_1_.field_72338_b);
- int l = MathHelper.func_76143_f(p_72953_1_.field_72337_e);
- int i1 = MathHelper.func_76128_c(p_72953_1_.field_72339_c);
- int j1 = MathHelper.func_76143_f(p_72953_1_.field_72334_f);
- BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
- for(int k1 = i; k1 < j; ++k1) {
- for(int l1 = k; l1 < l; ++l1) {
- for(int i2 = i1; i2 < j1; ++i2) {
- IBlockState iblockstate = this.func_180495_p(blockpos$pooledmutableblockpos.func_181079_c(k1, l1, i2));
- if(iblockstate.func_185904_a().func_76224_d()) {
- blockpos$pooledmutableblockpos.func_185344_t();
- return true;
- }
- }
- }
- }
- blockpos$pooledmutableblockpos.func_185344_t();
- return false;
- }
- public boolean func_147470_e(AxisAlignedBB p_147470_1_) {
- int i = MathHelper.func_76128_c(p_147470_1_.field_72340_a);
- int j = MathHelper.func_76143_f(p_147470_1_.field_72336_d);
- int k = MathHelper.func_76128_c(p_147470_1_.field_72338_b);
- int l = MathHelper.func_76143_f(p_147470_1_.field_72337_e);
- int i1 = MathHelper.func_76128_c(p_147470_1_.field_72339_c);
- int j1 = MathHelper.func_76143_f(p_147470_1_.field_72334_f);
- if(this.func_175663_a(i, k, i1, j, l, j1, true)) {
- BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
- for(int k1 = i; k1 < j; ++k1) {
- for(int l1 = k; l1 < l; ++l1) {
- for(int i2 = i1; i2 < j1; ++i2) {
- Block block = this.func_180495_p(blockpos$pooledmutableblockpos.func_181079_c(k1, l1, i2)).func_177230_c();
- if(block == Blocks.field_150480_ab || block == Blocks.field_150356_k || block == Blocks.field_150353_l) {
- blockpos$pooledmutableblockpos.func_185344_t();
- return true;
- }
- }
- }
- }
- blockpos$pooledmutableblockpos.func_185344_t();
- }
- return false;
- }
- public boolean func_72918_a(AxisAlignedBB p_72918_1_, Material p_72918_2_, Entity p_72918_3_) {
- int i = MathHelper.func_76128_c(p_72918_1_.field_72340_a);
- int j = MathHelper.func_76143_f(p_72918_1_.field_72336_d);
- int k = MathHelper.func_76128_c(p_72918_1_.field_72338_b);
- int l = MathHelper.func_76143_f(p_72918_1_.field_72337_e);
- int i1 = MathHelper.func_76128_c(p_72918_1_.field_72339_c);
- int j1 = MathHelper.func_76143_f(p_72918_1_.field_72334_f);
- if(!this.func_175663_a(i, k, i1, j, l, j1, true)) {
- return false;
- } else {
- boolean flag = false;
- Vec3d vec3d = Vec3d.field_186680_a;
- BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
- for(int k1 = i; k1 < j; ++k1) {
- for(int l1 = k; l1 < l; ++l1) {
- for(int i2 = i1; i2 < j1; ++i2) {
- blockpos$pooledmutableblockpos.func_181079_c(k1, l1, i2);
- IBlockState iblockstate = this.func_180495_p(blockpos$pooledmutableblockpos);
- Block block = iblockstate.func_177230_c();
- if(iblockstate.func_185904_a() == p_72918_2_) {
- double d0 = (double)((float)(l1 + 1) - BlockLiquid.func_149801_b(((Integer)iblockstate.func_177229_b(BlockLiquid.field_176367_b)).intValue()));
- if((double)l >= d0) {
- flag = true;
- vec3d = block.func_176197_a(this, blockpos$pooledmutableblockpos, p_72918_3_, vec3d);
- }
- }
- }
- }
- }
- blockpos$pooledmutableblockpos.func_185344_t();
- if(vec3d.func_72433_c() > 0.0D && p_72918_3_.func_96092_aw()) {
- vec3d = vec3d.func_72432_b();
- double d1 = 0.014D;
- p_72918_3_.field_70159_w += vec3d.field_72450_a * 0.014D;
- p_72918_3_.field_70181_x += vec3d.field_72448_b * 0.014D;
- p_72918_3_.field_70179_y += vec3d.field_72449_c * 0.014D;
- }
- return flag;
- }
- }
- public boolean func_72875_a(AxisAlignedBB p_72875_1_, Material p_72875_2_) {
- int i = MathHelper.func_76128_c(p_72875_1_.field_72340_a);
- int j = MathHelper.func_76143_f(p_72875_1_.field_72336_d);
- int k = MathHelper.func_76128_c(p_72875_1_.field_72338_b);
- int l = MathHelper.func_76143_f(p_72875_1_.field_72337_e);
- int i1 = MathHelper.func_76128_c(p_72875_1_.field_72339_c);
- int j1 = MathHelper.func_76143_f(p_72875_1_.field_72334_f);
- BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
- for(int k1 = i; k1 < j; ++k1) {
- for(int l1 = k; l1 < l; ++l1) {
- for(int i2 = i1; i2 < j1; ++i2) {
- if(this.func_180495_p(blockpos$pooledmutableblockpos.func_181079_c(k1, l1, i2)).func_185904_a() == p_72875_2_) {
- blockpos$pooledmutableblockpos.func_185344_t();
- return true;
- }
- }
- }
- }
- blockpos$pooledmutableblockpos.func_185344_t();
- return false;
- }
- 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_) {
- return this.func_72885_a(p_72876_1_, p_72876_2_, p_72876_4_, p_72876_6_, p_72876_8_, false, p_72876_9_);
- }
- 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_) {
- 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_);
- explosion.func_77278_a();
- explosion.func_77279_a(true);
- return explosion;
- }
- public float func_72842_a(Vec3d p_72842_1_, AxisAlignedBB p_72842_2_) {
- double d0 = 1.0D / ((p_72842_2_.field_72336_d - p_72842_2_.field_72340_a) * 2.0D + 1.0D);
- double d1 = 1.0D / ((p_72842_2_.field_72337_e - p_72842_2_.field_72338_b) * 2.0D + 1.0D);
- double d2 = 1.0D / ((p_72842_2_.field_72334_f - p_72842_2_.field_72339_c) * 2.0D + 1.0D);
- double d3 = (1.0D - Math.floor(1.0D / d0) * d0) / 2.0D;
- double d4 = (1.0D - Math.floor(1.0D / d2) * d2) / 2.0D;
- if(d0 >= 0.0D && d1 >= 0.0D && d2 >= 0.0D) {
- int i = 0;
- int j = 0;
- for(float f = 0.0F; f <= 1.0F; f = (float)((double)f + d0)) {
- for(float f1 = 0.0F; f1 <= 1.0F; f1 = (float)((double)f1 + d1)) {
- for(float f2 = 0.0F; f2 <= 1.0F; f2 = (float)((double)f2 + d2)) {
- double d5 = p_72842_2_.field_72340_a + (p_72842_2_.field_72336_d - p_72842_2_.field_72340_a) * (double)f;
- double d6 = p_72842_2_.field_72338_b + (p_72842_2_.field_72337_e - p_72842_2_.field_72338_b) * (double)f1;
- double d7 = p_72842_2_.field_72339_c + (p_72842_2_.field_72334_f - p_72842_2_.field_72339_c) * (double)f2;
- if(this.func_72933_a(new Vec3d(d5 + d3, d6, d7 + d4), p_72842_1_) == null) {
- ++i;
- }
- ++j;
- }
- }
- }
- return (float)i / (float)j;
- } else {
- return 0.0F;
- }
- }
- public boolean func_175719_a(@Nullable EntityPlayer p_175719_1_, BlockPos p_175719_2_, EnumFacing p_175719_3_) {
- p_175719_2_ = p_175719_2_.func_177972_a(p_175719_3_);
- if(this.func_180495_p(p_175719_2_).func_177230_c() == Blocks.field_150480_ab) {
- this.func_180498_a(p_175719_1_, 1009, p_175719_2_, 0);
- this.func_175698_g(p_175719_2_);
- return true;
- } else {
- return false;
- }
- }
- @SideOnly(Side.CLIENT)
- public String func_72981_t() {
- return "All: " + this.field_72996_f.size();
- }
- @SideOnly(Side.CLIENT)
- public String func_72827_u() {
- return this.field_73020_y.func_73148_d();
- }
- @Nullable
- public TileEntity func_175625_s(BlockPos p_175625_1_) {
- if(this.func_189509_E(p_175625_1_)) {
- return null;
- } else {
- TileEntity tileentity = null;
- if(this.field_147481_N) {
- tileentity = this.func_189508_F(p_175625_1_);
- }
- if(tileentity == null) {
- tileentity = this.func_175726_f(p_175625_1_).func_177424_a(p_175625_1_, Chunk.EnumCreateEntityType.IMMEDIATE);
- }
- if(tileentity == null) {
- tileentity = this.func_189508_F(p_175625_1_);
- }
- return tileentity;
- }
- }
- @Nullable
- private TileEntity func_189508_F(BlockPos p_189508_1_) {
- for(int i = 0; i < this.field_147484_a.size(); ++i) {
- TileEntity tileentity = (TileEntity)this.field_147484_a.get(i);
- if(!tileentity.func_145837_r() && tileentity.func_174877_v().equals(p_189508_1_)) {
- return tileentity;
- }
- }
- return null;
- }
- public void func_175690_a(BlockPos p_175690_1_, @Nullable TileEntity p_175690_2_) {
- if(!this.func_189509_E(p_175690_1_)) {
- if(p_175690_2_ != null && !p_175690_2_.func_145837_r()) {
- if(this.field_147481_N) {
- p_175690_2_.func_174878_a(p_175690_1_);
- Iterator<TileEntity> iterator = this.field_147484_a.iterator();
- while(iterator.hasNext()) {
- TileEntity tileentity = (TileEntity)iterator.next();
- if(tileentity.func_174877_v().equals(p_175690_1_)) {
- tileentity.func_145843_s();
- iterator.remove();
- }
- }
- this.field_147484_a.add(p_175690_2_);
- } else {
- this.func_175726_f(p_175690_1_).func_177426_a(p_175690_1_, p_175690_2_);
- this.func_175700_a(p_175690_2_);
- }
- }
- }
- }
- public void func_175713_t(BlockPos p_175713_1_) {
- TileEntity tileentity = this.func_175625_s(p_175713_1_);
- if(tileentity != null && this.field_147481_N) {
- tileentity.func_145843_s();
- this.field_147484_a.remove(tileentity);
- } else {
- if(tileentity != null) {
- this.field_147484_a.remove(tileentity);
- this.field_147482_g.remove(tileentity);
- this.field_175730_i.remove(tileentity);
- }
- this.func_175726_f(p_175713_1_).func_177425_e(p_175713_1_);
- }
- }
- public void func_147457_a(TileEntity p_147457_1_) {
- this.field_147483_b.add(p_147457_1_);
- }
- public boolean func_175665_u(BlockPos p_175665_1_) {
- AxisAlignedBB axisalignedbb = this.func_180495_p(p_175665_1_).func_185890_d(this, p_175665_1_);
- return axisalignedbb != Block.field_185506_k && axisalignedbb.func_72320_b() >= 1.0D;
- }
- public boolean func_175677_d(BlockPos p_175677_1_, boolean p_175677_2_) {
- if(this.func_189509_E(p_175677_1_)) {
- return false;
- } else {
- Chunk chunk = this.field_73020_y.func_186026_b(p_175677_1_.func_177958_n() >> 4, p_175677_1_.func_177952_p() >> 4);
- if(chunk != null && !chunk.func_76621_g()) {
- IBlockState iblockstate = this.func_180495_p(p_175677_1_);
- return iblockstate.func_185904_a().func_76218_k() && iblockstate.func_185917_h();
- } else {
- return p_175677_2_;
- }
- }
- }
- public void func_72966_v() {
- int i = this.func_72967_a(1.0F);
- if(i != this.field_73008_k) {
- this.field_73008_k = i;
- }
- }
- public void func_72891_a(boolean p_72891_1_, boolean p_72891_2_) {
- this.field_72985_G = p_72891_1_;
- this.field_72992_H = p_72891_2_;
- }
- public void func_72835_b() {
- this.func_72979_l();
- }
- protected void func_72947_a() {
- if(this.field_72986_A.func_76059_o()) {
- this.field_73004_o = 1.0F;
- if(this.field_72986_A.func_76061_m()) {
- this.field_73017_q = 1.0F;
- }
- }
- }
- protected void func_72979_l() {
- if(this.field_73011_w.func_191066_m()) {
- if(!this.field_72995_K) {
- boolean flag = this.func_82736_K().func_82766_b("doWeatherCycle");
- if(flag) {
- int i = this.field_72986_A.func_176133_A();
- if(i > 0) {
- --i;
- this.field_72986_A.func_176142_i(i);
- this.field_72986_A.func_76090_f(this.field_72986_A.func_76061_m()?1:2);
- this.field_72986_A.func_76080_g(this.field_72986_A.func_76059_o()?1:2);
- }
- int j = this.field_72986_A.func_76071_n();
- if(j <= 0) {
- if(this.field_72986_A.func_76061_m()) {
- this.field_72986_A.func_76090_f(this.field_73012_v.nextInt(12000) + 3600);
- } else {
- this.field_72986_A.func_76090_f(this.field_73012_v.nextInt(168000) + 12000);
- }
- } else {
- --j;
- this.field_72986_A.func_76090_f(j);
- if(j <= 0) {
- this.field_72986_A.func_76069_a(!this.field_72986_A.func_76061_m());
- }
- }
- int k = this.field_72986_A.func_76083_p();
- if(k <= 0) {
- if(this.field_72986_A.func_76059_o()) {
- this.field_72986_A.func_76080_g(this.field_73012_v.nextInt(12000) + 12000);
- } else {
- this.field_72986_A.func_76080_g(this.field_73012_v.nextInt(168000) + 12000);
- }
- } else {
- --k;
- this.field_72986_A.func_76080_g(k);
- if(k <= 0) {
- this.field_72986_A.func_76084_b(!this.field_72986_A.func_76059_o());
- }
- }
- }
- this.field_73018_p = this.field_73017_q;
- if(this.field_72986_A.func_76061_m()) {
- this.field_73017_q = (float)((double)this.field_73017_q + 0.01D);
- } else {
- this.field_73017_q = (float)((double)this.field_73017_q - 0.01D);
- }
- this.field_73017_q = MathHelper.func_76131_a(this.field_73017_q, 0.0F, 1.0F);
- this.field_73003_n = this.field_73004_o;
- if(this.field_72986_A.func_76059_o()) {
- this.field_73004_o = (float)((double)this.field_73004_o + 0.01D);
- } else {
- this.field_73004_o = (float)((double)this.field_73004_o - 0.01D);
- }
- this.field_73004_o = MathHelper.func_76131_a(this.field_73004_o, 0.0F, 1.0F);
- }
- }
- }
- @SideOnly(Side.CLIENT)
- protected void func_147467_a(int p_147467_1_, int p_147467_2_, Chunk p_147467_3_) {
- p_147467_3_.func_76594_o();
- }
- protected void func_147456_g() {
- }
- public void func_189507_a(BlockPos p_189507_1_, IBlockState p_189507_2_, Random p_189507_3_) {
- this.field_72999_e = true;
- p_189507_2_.func_177230_c().func_180650_b(this, p_189507_1_, p_189507_2_, p_189507_3_);
- this.field_72999_e = false;
- }
- public boolean func_175675_v(BlockPos p_175675_1_) {
- return this.func_175670_e(p_175675_1_, false);
- }
- public boolean func_175662_w(BlockPos p_175662_1_) {
- return this.func_175670_e(p_175662_1_, true);
- }
- public boolean func_175670_e(BlockPos p_175670_1_, boolean p_175670_2_) {
- Biome biome = this.func_180494_b(p_175670_1_);
- float f = biome.func_180626_a(p_175670_1_);
- if(f >= 0.15F) {
- return false;
- } else {
- 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) {
- IBlockState iblockstate = this.func_180495_p(p_175670_1_);
- Block block = iblockstate.func_177230_c();
- if((block == Blocks.field_150355_j || block == Blocks.field_150358_i) && ((Integer)iblockstate.func_177229_b(BlockLiquid.field_176367_b)).intValue() == 0) {
- if(!p_175670_2_) {
- return true;
- }
- 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());
- if(!flag) {
- return true;
- }
- }
- }
- return false;
- }
- }
- private boolean func_175696_F(BlockPos p_175696_1_) {
- return this.func_180495_p(p_175696_1_).func_185904_a() == Material.field_151586_h;
- }
- public boolean func_175708_f(BlockPos p_175708_1_, boolean p_175708_2_) {
- Biome biome = this.func_180494_b(p_175708_1_);
- float f = biome.func_180626_a(p_175708_1_);
- if(f >= 0.15F) {
- return false;
- } else if(!p_175708_2_) {
- return true;
- } else {
- 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) {
- IBlockState iblockstate = this.func_180495_p(p_175708_1_);
- if(iblockstate.func_185904_a() == Material.field_151579_a && Blocks.field_150431_aC.func_176196_c(this, p_175708_1_)) {
- return true;
- }
- }
- return false;
- }
- }
- public boolean func_175664_x(BlockPos p_175664_1_) {
- boolean flag = false;
- if(this.field_73011_w.func_191066_m()) {
- flag |= this.func_180500_c(EnumSkyBlock.SKY, p_175664_1_);
- }
- flag = flag | this.func_180500_c(EnumSkyBlock.BLOCK, p_175664_1_);
- return flag;
- }
- private int func_175638_a(BlockPos p_175638_1_, EnumSkyBlock p_175638_2_) {
- if(p_175638_2_ == EnumSkyBlock.SKY && this.func_175678_i(p_175638_1_)) {
- return 15;
- } else {
- IBlockState iblockstate = this.func_180495_p(p_175638_1_);
- int i = p_175638_2_ == EnumSkyBlock.SKY?0:iblockstate.func_185906_d();
- int j = iblockstate.func_185891_c();
- if(j >= 15 && iblockstate.func_185906_d() > 0) {
- j = 1;
- }
- if(j < 1) {
- j = 1;
- }
- if(j >= 15) {
- return 0;
- } else if(i >= 14) {
- return i;
- } else {
- BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
- try {
- for(EnumFacing enumfacing : EnumFacing.values()) {
- blockpos$pooledmutableblockpos.func_189533_g(p_175638_1_).func_189536_c(enumfacing);
- int k = this.func_175642_b(p_175638_2_, blockpos$pooledmutableblockpos) - j;
- if(k > i) {
- i = k;
- }
- if(i >= 14) {
- int l = i;
- return l;
- }
- }
- return i;
- } finally {
- blockpos$pooledmutableblockpos.func_185344_t();
- }
- }
- }
- }
- public boolean func_180500_c(EnumSkyBlock p_180500_1_, BlockPos p_180500_2_) {
- if(!this.func_175648_a(p_180500_2_, 17, false)) {
- return false;
- } else {
- int i = 0;
- int j = 0;
- this.field_72984_F.func_76320_a("getBrightness");
- int k = this.func_175642_b(p_180500_1_, p_180500_2_);
- int l = this.func_175638_a(p_180500_2_, p_180500_1_);
- int i1 = p_180500_2_.func_177958_n();
- int j1 = p_180500_2_.func_177956_o();
- int k1 = p_180500_2_.func_177952_p();
- if(l > k) {
- this.field_72994_J[j++] = 133152;
- } else if(l < k) {
- this.field_72994_J[j++] = 133152 | k << 18;
- while(i < j) {
- int l1 = this.field_72994_J[i++];
- int i2 = (l1 & 63) - 32 + i1;
- int j2 = (l1 >> 6 & 63) - 32 + j1;
- int k2 = (l1 >> 12 & 63) - 32 + k1;
- int l2 = l1 >> 18 & 15;
- BlockPos blockpos = new BlockPos(i2, j2, k2);
- int i3 = this.func_175642_b(p_180500_1_, blockpos);
- if(i3 == l2) {
- this.func_175653_a(p_180500_1_, blockpos, 0);
- if(l2 > 0) {
- int j3 = MathHelper.func_76130_a(i2 - i1);
- int k3 = MathHelper.func_76130_a(j2 - j1);
- int l3 = MathHelper.func_76130_a(k2 - k1);
- if(j3 + k3 + l3 < 17) {
- BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
- for(EnumFacing enumfacing : EnumFacing.values()) {
- int i4 = i2 + enumfacing.func_82601_c();
- int j4 = j2 + enumfacing.func_96559_d();
- int k4 = k2 + enumfacing.func_82599_e();
- blockpos$pooledmutableblockpos.func_181079_c(i4, j4, k4);
- int l4 = Math.max(1, this.func_180495_p(blockpos$pooledmutableblockpos).func_185891_c());
- i3 = this.func_175642_b(p_180500_1_, blockpos$pooledmutableblockpos);
- if(i3 == l2 - l4 && j < this.field_72994_J.length) {
- this.field_72994_J[j++] = i4 - i1 + 32 | j4 - j1 + 32 << 6 | k4 - k1 + 32 << 12 | l2 - l4 << 18;
- }
- }
- blockpos$pooledmutableblockpos.func_185344_t();
- }
- }
- }
- }
- i = 0;
- }
- this.field_72984_F.func_76319_b();
- this.field_72984_F.func_76320_a("checkedPosition < toCheckCount");
- while(i < j) {
- int i5 = this.field_72994_J[i++];
- int j5 = (i5 & 63) - 32 + i1;
- int k5 = (i5 >> 6 & 63) - 32 + j1;
- int l5 = (i5 >> 12 & 63) - 32 + k1;
- BlockPos blockpos1 = new BlockPos(j5, k5, l5);
- int i6 = this.func_175642_b(p_180500_1_, blockpos1);
- int j6 = this.func_175638_a(blockpos1, p_180500_1_);
- if(j6 != i6) {
- this.func_175653_a(p_180500_1_, blockpos1, j6);
- if(j6 > i6) {
- int k6 = Math.abs(j5 - i1);
- int l6 = Math.abs(k5 - j1);
- int i7 = Math.abs(l5 - k1);
- boolean flag = j < this.field_72994_J.length - 6;
- if(k6 + l6 + i7 < 17 && flag) {
- if(this.func_175642_b(p_180500_1_, blockpos1.func_177976_e()) < j6) {
- this.field_72994_J[j++] = j5 - 1 - i1 + 32 + (k5 - j1 + 32 << 6) + (l5 - k1 + 32 << 12);
- }
- if(this.func_175642_b(p_180500_1_, blockpos1.func_177974_f()) < j6) {
- this.field_72994_J[j++] = j5 + 1 - i1 + 32 + (k5 - j1 + 32 << 6) + (l5 - k1 + 32 << 12);
- }
- if(this.func_175642_b(p_180500_1_, blockpos1.func_177977_b()) < j6) {
- this.field_72994_J[j++] = j5 - i1 + 32 + (k5 - 1 - j1 + 32 << 6) + (l5 - k1 + 32 << 12);
- }
- if(this.func_175642_b(p_180500_1_, blockpos1.func_177984_a()) < j6) {
- this.field_72994_J[j++] = j5 - i1 + 32 + (k5 + 1 - j1 + 32 << 6) + (l5 - k1 + 32 << 12);
- }
- if(this.func_175642_b(p_180500_1_, blockpos1.func_177978_c()) < j6) {
- this.field_72994_J[j++] = j5 - i1 + 32 + (k5 - j1 + 32 << 6) + (l5 - 1 - k1 + 32 << 12);
- }
- if(this.func_175642_b(p_180500_1_, blockpos1.func_177968_d()) < j6) {
- this.field_72994_J[j++] = j5 - i1 + 32 + (k5 - j1 + 32 << 6) + (l5 + 1 - k1 + 32 << 12);
- }
- }
- }
- }
- }
- this.field_72984_F.func_76319_b();
- return true;
- }
- }
- public boolean func_72955_a(boolean p_72955_1_) {
- return false;
- }
- @Nullable
- public List<NextTickListEntry> func_72920_a(Chunk p_72920_1_, boolean p_72920_2_) {
- return null;
- }
- @Nullable
- public List<NextTickListEntry> func_175712_a(StructureBoundingBox p_175712_1_, boolean p_175712_2_) {
- return null;
- }
- public List<Entity> func_72839_b(@Nullable Entity p_72839_1_, AxisAlignedBB p_72839_2_) {
- return this.func_175674_a(p_72839_1_, p_72839_2_, EntitySelectors.field_180132_d);
- }
- public List<Entity> func_175674_a(@Nullable Entity p_175674_1_, AxisAlignedBB p_175674_2_, @Nullable Predicate<? super Entity> p_175674_3_) {
- List<Entity> list = Lists.<Entity>newArrayList();
- int i = MathHelper.func_76128_c((p_175674_2_.field_72340_a - 2.0D) / 16.0D);
- int j = MathHelper.func_76128_c((p_175674_2_.field_72336_d + 2.0D) / 16.0D);
- int k = MathHelper.func_76128_c((p_175674_2_.field_72339_c - 2.0D) / 16.0D);
- int l = MathHelper.func_76128_c((p_175674_2_.field_72334_f + 2.0D) / 16.0D);
- for(int i1 = i; i1 <= j; ++i1) {
- for(int j1 = k; j1 <= l; ++j1) {
- if(this.func_175680_a(i1, j1, true)) {
- this.func_72964_e(i1, j1).func_177414_a(p_175674_1_, p_175674_2_, list, p_175674_3_);
- }
- }
- }
- return list;
- }
- public <T extends Entity> List<T> func_175644_a(Class<? extends T> p_175644_1_, Predicate<? super T> p_175644_2_) {
- List<T> list = Lists.<T>newArrayList();
- for(Entity entity : this.field_72996_f) {
- if(p_175644_1_.isAssignableFrom(entity.getClass()) && p_175644_2_.apply(entity)) {
- list.add(entity);
- }
- }
- return list;
- }
- public <T extends Entity> List<T> func_175661_b(Class<? extends T> p_175661_1_, Predicate<? super T> p_175661_2_) {
- List<T> list = Lists.<T>newArrayList();
- for(Entity entity : this.field_73010_i) {
- if(p_175661_1_.isAssignableFrom(entity.getClass()) && p_175661_2_.apply(entity)) {
- list.add(entity);
- }
- }
- return list;
- }
- public <T extends Entity> List<T> func_72872_a(Class<? extends T> p_72872_1_, AxisAlignedBB p_72872_2_) {
- return this.<T>func_175647_a(p_72872_1_, p_72872_2_, EntitySelectors.field_180132_d);
- }
- 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_) {
- int i = MathHelper.func_76128_c((p_175647_2_.field_72340_a - 2.0D) / 16.0D);
- int j = MathHelper.func_76143_f((p_175647_2_.field_72336_d + 2.0D) / 16.0D);
- int k = MathHelper.func_76128_c((p_175647_2_.field_72339_c - 2.0D) / 16.0D);
- int l = MathHelper.func_76143_f((p_175647_2_.field_72334_f + 2.0D) / 16.0D);
- List<T> list = Lists.<T>newArrayList();
- for(int i1 = i; i1 < j; ++i1) {
- for(int j1 = k; j1 < l; ++j1) {
- if(this.func_175680_a(i1, j1, true)) {
- this.func_72964_e(i1, j1).func_177430_a(p_175647_1_, p_175647_2_, list, p_175647_3_);
- }
- }
- }
- return list;
- }
- @Nullable
- public <T extends Entity> T func_72857_a(Class<? extends T> p_72857_1_, AxisAlignedBB p_72857_2_, T p_72857_3_) {
- List<T> list = this.<T>func_72872_a(p_72857_1_, p_72857_2_);
- T t = null;
- double d0 = Double.MAX_VALUE;
- for(int i = 0; i < list.size(); ++i) {
- T t1 = (Entity)list.get(i);
- if(t1 != p_72857_3_ && EntitySelectors.field_180132_d.apply(t1)) {
- double d1 = p_72857_3_.func_70068_e(t1);
- if(d1 <= d0) {
- t = t1;
- d0 = d1;
- }
- }
- }
- return t;
- }
- @Nullable
- public Entity func_73045_a(int p_73045_1_) {
- return (Entity)this.field_175729_l.func_76041_a(p_73045_1_);
- }
- @SideOnly(Side.CLIENT)
- public List<Entity> func_72910_y() {
- return this.field_72996_f;
- }
- public void func_175646_b(BlockPos p_175646_1_, TileEntity p_175646_2_) {
- if(this.func_175667_e(p_175646_1_)) {
- this.func_175726_f(p_175646_1_).func_76630_e();
- }
- }
- public int func_72907_a(Class<?> p_72907_1_) {
- int i = 0;
- for(Entity entity : this.field_72996_f) {
- if((!(entity instanceof EntityLiving) || !((EntityLiving)entity).func_104002_bU()) && p_72907_1_.isAssignableFrom(entity.getClass())) {
- ++i;
- }
- }
- return i;
- }
- public void func_175650_b(Collection<Entity> p_175650_1_) {
- this.field_72996_f.addAll(p_175650_1_);
- for(Entity entity : p_175650_1_) {
- this.func_72923_a(entity);
- }
- }
- public void func_175681_c(Collection<Entity> p_175681_1_) {
- this.field_72997_g.addAll(p_175681_1_);
- }
- 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_) {
- IBlockState iblockstate = this.func_180495_p(p_190527_2_);
- AxisAlignedBB axisalignedbb = p_190527_3_?null:p_190527_1_.func_176223_P().func_185890_d(this, p_190527_2_);
- 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_));
- }
- public int func_181545_F() {
- return this.field_181546_a;
- }
- public void func_181544_b(int p_181544_1_) {
- this.field_181546_a = p_181544_1_;
- }
- public int func_175627_a(BlockPos p_175627_1_, EnumFacing p_175627_2_) {
- return this.func_180495_p(p_175627_1_).func_185893_b(this, p_175627_1_, p_175627_2_);
- }
- public WorldType func_175624_G() {
- return this.field_72986_A.func_76067_t();
- }
- public int func_175676_y(BlockPos p_175676_1_) {
- int i = 0;
- i = Math.max(i, this.func_175627_a(p_175676_1_.func_177977_b(), EnumFacing.DOWN));
- if(i >= 15) {
- return i;
- } else {
- i = Math.max(i, this.func_175627_a(p_175676_1_.func_177984_a(), EnumFacing.UP));
- if(i >= 15) {
- return i;
- } else {
- i = Math.max(i, this.func_175627_a(p_175676_1_.func_177978_c(), EnumFacing.NORTH));
- if(i >= 15) {
- return i;
- } else {
- i = Math.max(i, this.func_175627_a(p_175676_1_.func_177968_d(), EnumFacing.SOUTH));
- if(i >= 15) {
- return i;
- } else {
- i = Math.max(i, this.func_175627_a(p_175676_1_.func_177976_e(), EnumFacing.WEST));
- if(i >= 15) {
- return i;
- } else {
- i = Math.max(i, this.func_175627_a(p_175676_1_.func_177974_f(), EnumFacing.EAST));
- return i >= 15?i:i;
- }
- }
- }
- }
- }
- }
- public boolean func_175709_b(BlockPos p_175709_1_, EnumFacing p_175709_2_) {
- return this.func_175651_c(p_175709_1_, p_175709_2_) > 0;
- }
- public int func_175651_c(BlockPos p_175651_1_, EnumFacing p_175651_2_) {
- IBlockState iblockstate = this.func_180495_p(p_175651_1_);
- return iblockstate.func_185915_l()?this.func_175676_y(p_175651_1_):iblockstate.func_185911_a(this, p_175651_1_, p_175651_2_);
- }
- public boolean func_175640_z(BlockPos p_175640_1_) {
- 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))));
- }
- public int func_175687_A(BlockPos p_175687_1_) {
- int i = 0;
- for(EnumFacing enumfacing : EnumFacing.values()) {
- int j = this.func_175651_c(p_175687_1_.func_177972_a(enumfacing), enumfacing);
- if(j >= 15) {
- return 15;
- }
- if(j > i) {
- i = j;
- }
- }
- return i;
- }
- @Nullable
- public EntityPlayer func_72890_a(Entity p_72890_1_, double p_72890_2_) {
- 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);
- }
- @Nullable
- public EntityPlayer func_184136_b(Entity p_184136_1_, double p_184136_2_) {
- 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);
- }
- @Nullable
- 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_) {
- Predicate<Entity> predicate = p_184137_9_?EntitySelectors.field_188444_d:EntitySelectors.field_180132_d;
- return this.func_190525_a(p_184137_1_, p_184137_3_, p_184137_5_, p_184137_7_, predicate);
- }
- @Nullable
- 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_) {
- double d0 = -1.0D;
- EntityPlayer entityplayer = null;
- for(int i = 0; i < this.field_73010_i.size(); ++i) {
- EntityPlayer entityplayer1 = (EntityPlayer)this.field_73010_i.get(i);
- if(p_190525_9_.apply(entityplayer1)) {
- double d1 = entityplayer1.func_70092_e(p_190525_1_, p_190525_3_, p_190525_5_);
- if((p_190525_7_ < 0.0D || d1 < p_190525_7_ * p_190525_7_) && (d0 == -1.0D || d1 < d0)) {
- d0 = d1;
- entityplayer = entityplayer1;
- }
- }
- }
- return entityplayer;
- }
- public boolean func_175636_b(double p_175636_1_, double p_175636_3_, double p_175636_5_, double p_175636_7_) {
- for(int i = 0; i < this.field_73010_i.size(); ++i) {
- EntityPlayer entityplayer = (EntityPlayer)this.field_73010_i.get(i);
- if(EntitySelectors.field_180132_d.apply(entityplayer)) {
- double d0 = entityplayer.func_70092_e(p_175636_1_, p_175636_3_, p_175636_5_);
- if(p_175636_7_ < 0.0D || d0 < p_175636_7_ * p_175636_7_) {
- return true;
- }
- }
- }
- return false;
- }
- @Nullable
- public EntityPlayer func_184142_a(Entity p_184142_1_, double p_184142_2_, double p_184142_4_) {
- 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);
- }
- @Nullable
- public EntityPlayer func_184139_a(BlockPos p_184139_1_, double p_184139_2_, double p_184139_4_) {
- 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);
- }
- @Nullable
- 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_) {
- double d0 = -1.0D;
- EntityPlayer entityplayer = null;
- for(int i = 0; i < this.field_73010_i.size(); ++i) {
- EntityPlayer entityplayer1 = (EntityPlayer)this.field_73010_i.get(i);
- 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))) {
- double d1 = entityplayer1.func_70092_e(p_184150_1_, entityplayer1.field_70163_u, p_184150_5_);
- double d2 = p_184150_7_;
- if(entityplayer1.func_70093_af()) {
- d2 = p_184150_7_ * 0.800000011920929D;
- }
- if(entityplayer1.func_82150_aj()) {
- float f = entityplayer1.func_82243_bO();
- if(f < 0.1F) {
- f = 0.1F;
- }
- d2 *= (double)(0.7F * f);
- }
- if(p_184150_11_ != null) {
- d2 *= ((Double)MoreObjects.firstNonNull(p_184150_11_.apply(entityplayer1), Double.valueOf(1.0D))).doubleValue();
- }
- 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)) {
- d0 = d1;
- entityplayer = entityplayer1;
- }
- }
- }
- return entityplayer;
- }
- @Nullable
- public EntityPlayer func_72924_a(String p_72924_1_) {
- for(int i = 0; i < this.field_73010_i.size(); ++i) {
- EntityPlayer entityplayer = (EntityPlayer)this.field_73010_i.get(i);
- if(p_72924_1_.equals(entityplayer.func_70005_c_())) {
- return entityplayer;
- }
- }
- return null;
- }
- @Nullable
- public EntityPlayer func_152378_a(UUID p_152378_1_) {
- for(int i = 0; i < this.field_73010_i.size(); ++i) {
- EntityPlayer entityplayer = (EntityPlayer)this.field_73010_i.get(i);
- if(p_152378_1_.equals(entityplayer.func_110124_au())) {
- return entityplayer;
- }
- }
- return null;
- }
- @SideOnly(Side.CLIENT)
- public void func_72882_A() {
- }
- public void func_72906_B() throws MinecraftException {
- this.field_73019_z.func_75762_c();
- }
- @SideOnly(Side.CLIENT)
- public void func_82738_a(long p_82738_1_) {
- this.field_72986_A.func_82572_b(p_82738_1_);
- }
- public long func_72905_C() {
- return this.field_72986_A.func_76063_b();
- }
- public long func_82737_E() {
- return this.field_72986_A.func_82573_f();
- }
- public long func_72820_D() {
- return this.field_72986_A.func_76073_f();
- }
- public void func_72877_b(long p_72877_1_) {
- this.field_72986_A.func_76068_b(p_72877_1_);
- }
- public BlockPos func_175694_M() {
- 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());
- if(!this.func_175723_af().func_177746_a(blockpos)) {
- blockpos = this.func_175645_m(new BlockPos(this.func_175723_af().func_177731_f(), 0.0D, this.func_175723_af().func_177721_g()));
- }
- return blockpos;
- }
- public void func_175652_B(BlockPos p_175652_1_) {
- this.field_72986_A.func_176143_a(p_175652_1_);
- }
- @SideOnly(Side.CLIENT)
- public void func_72897_h(Entity p_72897_1_) {
- int i = MathHelper.func_76128_c(p_72897_1_.field_70165_t / 16.0D);
- int j = MathHelper.func_76128_c(p_72897_1_.field_70161_v / 16.0D);
- int k = 2;
- for(int l = -2; l <= 2; ++l) {
- for(int i1 = -2; i1 <= 2; ++i1) {
- this.func_72964_e(i + l, j + i1);
- }
- }
- if(!this.field_72996_f.contains(p_72897_1_)) {
- this.field_72996_f.add(p_72897_1_);
- }
- }
- public boolean func_175660_a(EntityPlayer p_175660_1_, BlockPos p_175660_2_) {
- return true;
- }
- public void func_72960_a(Entity p_72960_1_, byte p_72960_2_) {
- }
- public IChunkProvider func_72863_F() {
- return this.field_73020_y;
- }
- public void func_175641_c(BlockPos p_175641_1_, Block p_175641_2_, int p_175641_3_, int p_175641_4_) {
- this.func_180495_p(p_175641_1_).func_189547_a(this, p_175641_1_, p_175641_3_, p_175641_4_);
- }
- public ISaveHandler func_72860_G() {
- return this.field_73019_z;
- }
- public WorldInfo func_72912_H() {
- return this.field_72986_A;
- }
- public GameRules func_82736_K() {
- return this.field_72986_A.func_82574_x();
- }
- public void func_72854_c() {
- }
- public float func_72819_i(float p_72819_1_) {
- return (this.field_73018_p + (this.field_73017_q - this.field_73018_p) * p_72819_1_) * this.func_72867_j(p_72819_1_);
- }
- @SideOnly(Side.CLIENT)
- public void func_147442_i(float p_147442_1_) {
- this.field_73018_p = p_147442_1_;
- this.field_73017_q = p_147442_1_;
- }
- public float func_72867_j(float p_72867_1_) {
- return this.field_73003_n + (this.field_73004_o - this.field_73003_n) * p_72867_1_;
- }
- @SideOnly(Side.CLIENT)
- public void func_72894_k(float p_72894_1_) {
- this.field_73003_n = p_72894_1_;
- this.field_73004_o = p_72894_1_;
- }
- public boolean func_72911_I() {
- return (double)this.func_72819_i(1.0F) > 0.9D;
- }
- public boolean func_72896_J() {
- return (double)this.func_72867_j(1.0F) > 0.2D;
- }
- public boolean func_175727_C(BlockPos p_175727_1_) {
- if(!this.func_72896_J()) {
- return false;
- } else if(!this.func_175678_i(p_175727_1_)) {
- return false;
- } else if(this.func_175725_q(p_175727_1_).func_177956_o() > p_175727_1_.func_177956_o()) {
- return false;
- } else {
- Biome biome = this.func_180494_b(p_175727_1_);
- return biome.func_76746_c()?false:(this.func_175708_f(p_175727_1_, false)?false:biome.func_76738_d());
- }
- }
- public boolean func_180502_D(BlockPos p_180502_1_) {
- Biome biome = this.func_180494_b(p_180502_1_);
- return biome.func_76736_e();
- }
- @Nullable
- public MapStorage func_175693_T() {
- return this.field_72988_C;
- }
- public void func_72823_a(String p_72823_1_, WorldSavedData p_72823_2_) {
- this.field_72988_C.func_75745_a(p_72823_1_, p_72823_2_);
- }
- @Nullable
- public WorldSavedData func_72943_a(Class<? extends WorldSavedData> p_72943_1_, String p_72943_2_) {
- return this.field_72988_C.func_75742_a(p_72943_1_, p_72943_2_);
- }
- public int func_72841_b(String p_72841_1_) {
- return this.field_72988_C.func_75743_a(p_72841_1_);
- }
- public void func_175669_a(int p_175669_1_, BlockPos p_175669_2_, int p_175669_3_) {
- for(int i = 0; i < this.field_73021_x.size(); ++i) {
- ((IWorldEventListener)this.field_73021_x.get(i)).func_180440_a(p_175669_1_, p_175669_2_, p_175669_3_);
- }
- }
- public void func_175718_b(int p_175718_1_, BlockPos p_175718_2_, int p_175718_3_) {
- this.func_180498_a((EntityPlayer)null, p_175718_1_, p_175718_2_, p_175718_3_);
- }
- public void func_180498_a(@Nullable EntityPlayer p_180498_1_, int p_180498_2_, BlockPos p_180498_3_, int p_180498_4_) {
- try {
- for(int i = 0; i < this.field_73021_x.size(); ++i) {
- ((IWorldEventListener)this.field_73021_x.get(i)).func_180439_a(p_180498_1_, p_180498_2_, p_180498_3_, p_180498_4_);
- }
- } catch (Throwable throwable) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable, "Playing level event");
- CrashReportCategory crashreportcategory = crashreport.func_85058_a("Level event being played");
- crashreportcategory.func_71507_a("Block coordinates", CrashReportCategory.func_180522_a(p_180498_3_));
- crashreportcategory.func_71507_a("Event source", p_180498_1_);
- crashreportcategory.func_71507_a("Event type", Integer.valueOf(p_180498_2_));
- crashreportcategory.func_71507_a("Event data", Integer.valueOf(p_180498_4_));
- throw new ReportedException(crashreport);
- }
- }
- public int func_72800_K() {
- return 256;
- }
- public int func_72940_L() {
- return this.field_73011_w.func_177495_o()?128:256;
- }
- public Random func_72843_D(int p_72843_1_, int p_72843_2_, int p_72843_3_) {
- long i = (long)p_72843_1_ * 341873128712L + (long)p_72843_2_ * 132897987541L + this.func_72912_H().func_76063_b() + (long)p_72843_3_;
- this.field_73012_v.setSeed(i);
- return this.field_73012_v;
- }
- public CrashReportCategory func_72914_a(CrashReport p_72914_1_) {
- CrashReportCategory crashreportcategory = p_72914_1_.func_85057_a("Affected level", 1);
- crashreportcategory.func_71507_a("Level name", this.field_72986_A == null?"????":this.field_72986_A.func_76065_j());
- crashreportcategory.func_189529_a("All players", new ICrashReportDetail<String>() {
- public String call() {
- return World.this.field_73010_i.size() + " total; " + World.this.field_73010_i;
- }
- });
- crashreportcategory.func_189529_a("Chunk stats", new ICrashReportDetail<String>() {
- public String call() {
- return World.this.field_73020_y.func_73148_d();
- }
- });
- try {
- this.field_72986_A.func_85118_a(crashreportcategory);
- } catch (Throwable throwable) {
- crashreportcategory.func_71499_a("Level Data Unobtainable", throwable);
- }
- return crashreportcategory;
- }
- @SideOnly(Side.CLIENT)
- public double func_72919_O() {
- return this.field_72986_A.func_76067_t() == WorldType.field_77138_c?0.0D:63.0D;
- }
- public void func_175715_c(int p_175715_1_, BlockPos p_175715_2_, int p_175715_3_) {
- for(int i = 0; i < this.field_73021_x.size(); ++i) {
- IWorldEventListener iworldeventlistener = (IWorldEventListener)this.field_73021_x.get(i);
- iworldeventlistener.func_180441_b(p_175715_1_, p_175715_2_, p_175715_3_);
- }
- }
- public Calendar func_83015_S() {
- if(this.func_82737_E() % 600L == 0L) {
- this.field_83016_L.setTimeInMillis(MinecraftServer.func_130071_aq());
- }
- return this.field_83016_L;
- }
- @SideOnly(Side.CLIENT)
- 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_) {
- }
- public Scoreboard func_96441_U() {
- return this.field_96442_D;
- }
- public void func_175666_e(BlockPos p_175666_1_, Block p_175666_2_) {
- for(EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) {
- BlockPos blockpos = p_175666_1_.func_177972_a(enumfacing);
- if(this.func_175667_e(blockpos)) {
- IBlockState iblockstate = this.func_180495_p(blockpos);
- if(Blocks.field_150441_bU.func_185547_C(iblockstate)) {
- iblockstate.func_189546_a(this, blockpos, p_175666_2_, p_175666_1_);
- } else if(iblockstate.func_185915_l()) {
- blockpos = blockpos.func_177972_a(enumfacing);
- iblockstate = this.func_180495_p(blockpos);
- if(Blocks.field_150441_bU.func_185547_C(iblockstate)) {
- iblockstate.func_189546_a(this, blockpos, p_175666_2_, p_175666_1_);
- }
- }
- }
- }
- }
- public DifficultyInstance func_175649_E(BlockPos p_175649_1_) {
- long i = 0L;
- float f = 0.0F;
- if(this.func_175667_e(p_175649_1_)) {
- f = this.func_130001_d();
- i = this.func_175726_f(p_175649_1_).func_177416_w();
- }
- return new DifficultyInstance(this.func_175659_aa(), this.func_72820_D(), i, f);
- }
- public EnumDifficulty func_175659_aa() {
- return this.func_72912_H().func_176130_y();
- }
- public int func_175657_ab() {
- return this.field_73008_k;
- }
- public void func_175692_b(int p_175692_1_) {
- this.field_73008_k = p_175692_1_;
- }
- @SideOnly(Side.CLIENT)
- public int func_175658_ac() {
- return this.field_73016_r;
- }
- public void func_175702_c(int p_175702_1_) {
- this.field_73016_r = p_175702_1_;
- }
- public VillageCollection func_175714_ae() {
- return this.field_72982_D;
- }
- public WorldBorder func_175723_af() {
- return this.field_175728_M;
- }
- public boolean func_72916_c(int p_72916_1_, int p_72916_2_) {
- BlockPos blockpos = this.func_175694_M();
- int i = p_72916_1_ * 16 + 8 - blockpos.func_177958_n();
- int j = p_72916_2_ * 16 + 8 - blockpos.func_177952_p();
- int k = 128;
- return i >= -128 && i <= 128 && j >= -128 && j <= 128;
- }
- public void func_184135_a(Packet<?> p_184135_1_) {
- throw new UnsupportedOperationException("Can\'t send packets to server unless you\'re on the client.");
- }
- public LootTableManager func_184146_ak() {
- return this.field_184151_B;
- }
- @Nullable
- public BlockPos func_190528_a(String p_190528_1_, BlockPos p_190528_2_, boolean p_190528_3_) {
- return null;
- }
- }
- Patching failed: minecraft\net\minecraft\block\BlockFurnace.java
- Hunk 1 failed! Cannot find hunk target
- }
- @SideOnly(Side.CLIENT)
- + @SuppressWarnings("incomplete-switch")
- public void func_180655_c(IBlockState p_180655_1_, World p_180655_2_, BlockPos p_180655_3_, Random p_180655_4_) {
- if (this.field_149932_b) {
- EnumFacing enumfacing = (EnumFacing)p_180655_1_.func_177229_b(field_176447_a);
- File state
- package net.minecraft.block;
- import java.util.Random;
- import net.minecraft.block.BlockContainer;
- import net.minecraft.block.BlockHorizontal;
- import net.minecraft.block.material.Material;
- import net.minecraft.block.properties.IProperty;
- import net.minecraft.block.properties.PropertyDirection;
- import net.minecraft.block.state.BlockStateContainer;
- import net.minecraft.block.state.IBlockState;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.init.Blocks;
- import net.minecraft.init.SoundEvents;
- import net.minecraft.inventory.Container;
- import net.minecraft.inventory.InventoryHelper;
- import net.minecraft.item.Item;
- import net.minecraft.item.ItemStack;
- import net.minecraft.stats.StatList;
- import net.minecraft.tileentity.TileEntity;
- import net.minecraft.tileentity.TileEntityFurnace;
- import net.minecraft.util.EnumBlockRenderType;
- import net.minecraft.util.EnumFacing;
- import net.minecraft.util.EnumHand;
- import net.minecraft.util.EnumParticleTypes;
- import net.minecraft.util.Mirror;
- import net.minecraft.util.Rotation;
- import net.minecraft.util.SoundCategory;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.world.World;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- public class BlockFurnace extends BlockContainer {
- public static final PropertyDirection field_176447_a = BlockHorizontal.field_185512_D;
- private final boolean field_149932_b;
- private static boolean field_149934_M;
- protected BlockFurnace(boolean p_i45407_1_) {
- super(Material.field_151576_e);
- this.func_180632_j(this.field_176227_L.func_177621_b().func_177226_a(field_176447_a, EnumFacing.NORTH));
- this.field_149932_b = p_i45407_1_;
- }
- public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_) {
- return Item.func_150898_a(Blocks.field_150460_al);
- }
- public void func_176213_c(World p_176213_1_, BlockPos p_176213_2_, IBlockState p_176213_3_) {
- this.func_176445_e(p_176213_1_, p_176213_2_, p_176213_3_);
- }
- private void func_176445_e(World p_176445_1_, BlockPos p_176445_2_, IBlockState p_176445_3_) {
- if(!p_176445_1_.field_72995_K) {
- IBlockState iblockstate = p_176445_1_.func_180495_p(p_176445_2_.func_177978_c());
- IBlockState iblockstate1 = p_176445_1_.func_180495_p(p_176445_2_.func_177968_d());
- IBlockState iblockstate2 = p_176445_1_.func_180495_p(p_176445_2_.func_177976_e());
- IBlockState iblockstate3 = p_176445_1_.func_180495_p(p_176445_2_.func_177974_f());
- EnumFacing enumfacing = (EnumFacing)p_176445_3_.func_177229_b(field_176447_a);
- if(enumfacing == EnumFacing.NORTH && iblockstate.func_185913_b() && !iblockstate1.func_185913_b()) {
- enumfacing = EnumFacing.SOUTH;
- } else if(enumfacing == EnumFacing.SOUTH && iblockstate1.func_185913_b() && !iblockstate.func_185913_b()) {
- enumfacing = EnumFacing.NORTH;
- } else if(enumfacing == EnumFacing.WEST && iblockstate2.func_185913_b() && !iblockstate3.func_185913_b()) {
- enumfacing = EnumFacing.EAST;
- } else if(enumfacing == EnumFacing.EAST && iblockstate3.func_185913_b() && !iblockstate2.func_185913_b()) {
- enumfacing = EnumFacing.WEST;
- }
- p_176445_1_.func_180501_a(p_176445_2_, p_176445_3_.func_177226_a(field_176447_a, enumfacing), 2);
- }
- }
- @SideOnly(Side.CLIENT)
- public void func_180655_c(IBlockState p_180655_1_, World p_180655_2_, BlockPos p_180655_3_, Random p_180655_4_) {
- if(this.field_149932_b) {
- EnumFacing enumfacing = (EnumFacing)p_180655_1_.func_177229_b(field_176447_a);
- double d0 = (double)p_180655_3_.func_177958_n() + 0.5D;
- double d1 = (double)p_180655_3_.func_177956_o() + p_180655_4_.nextDouble() * 6.0D / 16.0D;
- double d2 = (double)p_180655_3_.func_177952_p() + 0.5D;
- double d3 = 0.52D;
- double d4 = p_180655_4_.nextDouble() * 0.6D - 0.3D;
- if(p_180655_4_.nextDouble() < 0.1D) {
- 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);
- }
- switch(enumfacing) {
- case WEST:
- p_180655_2_.func_175688_a(EnumParticleTypes.SMOKE_NORMAL, d0 - 0.52D, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]);
- p_180655_2_.func_175688_a(EnumParticleTypes.FLAME, d0 - 0.52D, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]);
- break;
- case EAST:
- p_180655_2_.func_175688_a(EnumParticleTypes.SMOKE_NORMAL, d0 + 0.52D, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]);
- p_180655_2_.func_175688_a(EnumParticleTypes.FLAME, d0 + 0.52D, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]);
- break;
- case NORTH:
- p_180655_2_.func_175688_a(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 - 0.52D, 0.0D, 0.0D, 0.0D, new int[0]);
- p_180655_2_.func_175688_a(EnumParticleTypes.FLAME, d0 + d4, d1, d2 - 0.52D, 0.0D, 0.0D, 0.0D, new int[0]);
- break;
- case SOUTH:
- p_180655_2_.func_175688_a(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 + 0.52D, 0.0D, 0.0D, 0.0D, new int[0]);
- p_180655_2_.func_175688_a(EnumParticleTypes.FLAME, d0 + d4, d1, d2 + 0.52D, 0.0D, 0.0D, 0.0D, new int[0]);
- }
- }
- }
- 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_) {
- if(p_180639_1_.field_72995_K) {
- return true;
- } else {
- TileEntity tileentity = p_180639_1_.func_175625_s(p_180639_2_);
- if(tileentity instanceof TileEntityFurnace) {
- p_180639_4_.func_71007_a((TileEntityFurnace)tileentity);
- p_180639_4_.func_71029_a(StatList.field_188061_aa);
- }
- return true;
- }
- }
- public static void func_176446_a(boolean p_176446_0_, World p_176446_1_, BlockPos p_176446_2_) {
- IBlockState iblockstate = p_176446_1_.func_180495_p(p_176446_2_);
- TileEntity tileentity = p_176446_1_.func_175625_s(p_176446_2_);
- field_149934_M = true;
- if(p_176446_0_) {
- 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);
- 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);
- } else {
- 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);
- 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);
- }
- field_149934_M = false;
- if(tileentity != null) {
- tileentity.func_145829_t();
- p_176446_1_.func_175690_a(p_176446_2_, tileentity);
- }
- }
- public TileEntity func_149915_a(World p_149915_1_, int p_149915_2_) {
- return new TileEntityFurnace();
- }
- 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_) {
- return this.func_176223_P().func_177226_a(field_176447_a, p_180642_8_.func_174811_aO().func_176734_d());
- }
- 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_) {
- 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);
- if(p_180633_5_.func_82837_s()) {
- TileEntity tileentity = p_180633_1_.func_175625_s(p_180633_2_);
- if(tileentity instanceof TileEntityFurnace) {
- ((TileEntityFurnace)tileentity).func_145951_a(p_180633_5_.func_82833_r());
- }
- }
- }
- public void func_180663_b(World p_180663_1_, BlockPos p_180663_2_, IBlockState p_180663_3_) {
- if(!field_149934_M) {
- TileEntity tileentity = p_180663_1_.func_175625_s(p_180663_2_);
- if(tileentity instanceof TileEntityFurnace) {
- InventoryHelper.func_180175_a(p_180663_1_, p_180663_2_, (TileEntityFurnace)tileentity);
- p_180663_1_.func_175666_e(p_180663_2_, this);
- }
- }
- super.func_180663_b(p_180663_1_, p_180663_2_, p_180663_3_);
- }
- public boolean func_149740_M(IBlockState p_149740_1_) {
- return true;
- }
- public int func_180641_l(IBlockState p_180641_1_, World p_180641_2_, BlockPos p_180641_3_) {
- return Container.func_178144_a(p_180641_2_.func_175625_s(p_180641_3_));
- }
- public ItemStack func_185473_a(World p_185473_1_, BlockPos p_185473_2_, IBlockState p_185473_3_) {
- return new ItemStack(Blocks.field_150460_al);
- }
- public EnumBlockRenderType func_149645_b(IBlockState p_149645_1_) {
- return EnumBlockRenderType.MODEL;
- }
- public IBlockState func_176203_a(int p_176203_1_) {
- EnumFacing enumfacing = EnumFacing.func_82600_a(p_176203_1_);
- if(enumfacing.func_176740_k() == EnumFacing.Axis.Y) {
- enumfacing = EnumFacing.NORTH;
- }
- return this.func_176223_P().func_177226_a(field_176447_a, enumfacing);
- }
- public int func_176201_c(IBlockState p_176201_1_) {
- return ((EnumFacing)p_176201_1_.func_177229_b(field_176447_a)).func_176745_a();
- }
- public IBlockState func_185499_a(IBlockState p_185499_1_, Rotation p_185499_2_) {
- 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)));
- }
- public IBlockState func_185471_a(IBlockState p_185471_1_, Mirror p_185471_2_) {
- return p_185471_1_.func_185907_a(p_185471_2_.func_185800_a((EnumFacing)p_185471_1_.func_177229_b(field_176447_a)));
- }
- protected BlockStateContainer func_180661_e() {
- return new BlockStateContainer(this, new IProperty[]{field_176447_a});
- }
- }
- Patching failed: minecraft\net\minecraft\block\BlockRailPowered.java
- Hunk 1 failed! Cannot find hunk target
- 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)));
- }
- + @SuppressWarnings("incomplete-switch")
- 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_) {
- if (p_176566_5_ >= 8) {
- return false;
- File state
- package net.minecraft.block;
- import com.google.common.base.Predicate;
- import javax.annotation.Nullable;
- import net.minecraft.block.Block;
- import net.minecraft.block.BlockRailBase;
- import net.minecraft.block.properties.IProperty;
- import net.minecraft.block.properties.PropertyBool;
- import net.minecraft.block.properties.PropertyEnum;
- import net.minecraft.block.state.BlockStateContainer;
- import net.minecraft.block.state.IBlockState;
- import net.minecraft.util.Mirror;
- import net.minecraft.util.Rotation;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.world.World;
- public class BlockRailPowered extends BlockRailBase {
- public static final PropertyEnum<BlockRailBase.EnumRailDirection> field_176568_b = PropertyEnum.<BlockRailBase.EnumRailDirection>func_177708_a("shape", BlockRailBase.EnumRailDirection.class, new Predicate<BlockRailBase.EnumRailDirection>() {
- public boolean apply(@Nullable BlockRailBase.EnumRailDirection p_apply_1_) {
- 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;
- }
- });
- public static final PropertyBool field_176569_M = PropertyBool.func_177716_a("powered");
- protected BlockRailPowered() {
- super(true);
- 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)));
- }
- 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_) {
- if(p_176566_5_ >= 8) {
- return false;
- } else {
- int i = p_176566_2_.func_177958_n();
- int j = p_176566_2_.func_177956_o();
- int k = p_176566_2_.func_177952_p();
- boolean flag = true;
- BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)p_176566_3_.func_177229_b(field_176568_b);
- switch(blockrailbase$enumraildirection) {
- case NORTH_SOUTH:
- if(p_176566_4_) {
- ++k;
- } else {
- --k;
- }
- break;
- case EAST_WEST:
- if(p_176566_4_) {
- --i;
- } else {
- ++i;
- }
- break;
- case ASCENDING_EAST:
- if(p_176566_4_) {
- --i;
- } else {
- ++i;
- ++j;
- flag = false;
- }
- blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.EAST_WEST;
- break;
- case ASCENDING_WEST:
- if(p_176566_4_) {
- --i;
- ++j;
- flag = false;
- } else {
- ++i;
- }
- blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.EAST_WEST;
- break;
- case ASCENDING_NORTH:
- if(p_176566_4_) {
- ++k;
- } else {
- --k;
- ++j;
- flag = false;
- }
- blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_SOUTH;
- break;
- case ASCENDING_SOUTH:
- if(p_176566_4_) {
- ++k;
- ++j;
- flag = false;
- } else {
- --k;
- }
- blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_SOUTH;
- }
- 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);
- }
- }
- 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_) {
- IBlockState iblockstate = p_176567_1_.func_180495_p(p_176567_2_);
- if(iblockstate.func_177230_c() != this) {
- return false;
- } else {
- BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)iblockstate.func_177229_b(field_176568_b);
- 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;
- }
- }
- protected void func_189541_b(IBlockState p_189541_1_, World p_189541_2_, BlockPos p_189541_3_, Block p_189541_4_) {
- boolean flag = ((Boolean)p_189541_1_.func_177229_b(field_176569_M)).booleanValue();
- 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);
- if(flag1 != flag) {
- p_189541_2_.func_180501_a(p_189541_3_, p_189541_1_.func_177226_a(field_176569_M, Boolean.valueOf(flag1)), 3);
- p_189541_2_.func_175685_c(p_189541_3_.func_177977_b(), this, false);
- if(((BlockRailBase.EnumRailDirection)p_189541_1_.func_177229_b(field_176568_b)).func_177018_c()) {
- p_189541_2_.func_175685_c(p_189541_3_.func_177984_a(), this, false);
- }
- }
- }
- public IProperty<BlockRailBase.EnumRailDirection> func_176560_l() {
- return field_176568_b;
- }
- public IBlockState func_176203_a(int p_176203_1_) {
- 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));
- }
- public int func_176201_c(IBlockState p_176201_1_) {
- int i = 0;
- i = i | ((BlockRailBase.EnumRailDirection)p_176201_1_.func_177229_b(field_176568_b)).func_177015_a();
- if(((Boolean)p_176201_1_.func_177229_b(field_176569_M)).booleanValue()) {
- i |= 8;
- }
- return i;
- }
- public IBlockState func_185499_a(IBlockState p_185499_1_, Rotation p_185499_2_) {
- switch(p_185499_2_) {
- case CLOCKWISE_180:
- switch((BlockRailBase.EnumRailDirection)p_185499_1_.func_177229_b(field_176568_b)) {
- case ASCENDING_EAST:
- return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.ASCENDING_WEST);
- case ASCENDING_WEST:
- return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.ASCENDING_EAST);
- case ASCENDING_NORTH:
- return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.ASCENDING_SOUTH);
- case ASCENDING_SOUTH:
- return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.ASCENDING_NORTH);
- case SOUTH_EAST:
- return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.NORTH_WEST);
- case SOUTH_WEST:
- return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.NORTH_EAST);
- case NORTH_WEST:
- return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.SOUTH_EAST);
- case NORTH_EAST:
- return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.SOUTH_WEST);
- }
- case COUNTERCLOCKWISE_90:
- switch((BlockRailBase.EnumRailDirection)p_185499_1_.func_177229_b(field_176568_b)) {
- case NORTH_SOUTH:
- return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.EAST_WEST);
- case EAST_WEST:
- return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.NORTH_SOUTH);
- case ASCENDING_EAST:
- return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.ASCENDING_NORTH);
- case ASCENDING_WEST:
- return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.ASCENDING_SOUTH);
- case ASCENDING_NORTH:
- return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.ASCENDING_WEST);
- case ASCENDING_SOUTH:
- return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.ASCENDING_EAST);
- case SOUTH_EAST:
- return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.NORTH_EAST);
- case SOUTH_WEST:
- return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.SOUTH_EAST);
- case NORTH_WEST:
- return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.SOUTH_WEST);
- case NORTH_EAST:
- return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.NORTH_WEST);
- }
- case CLOCKWISE_90:
- switch((BlockRailBase.EnumRailDirection)p_185499_1_.func_177229_b(field_176568_b)) {
- case NORTH_SOUTH:
- return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.EAST_WEST);
- case EAST_WEST:
- return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.NORTH_SOUTH);
- case ASCENDING_EAST:
- return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.ASCENDING_SOUTH);
- case ASCENDING_WEST:
- return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.ASCENDING_NORTH);
- case ASCENDING_NORTH:
- return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.ASCENDING_EAST);
- case ASCENDING_SOUTH:
- return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.ASCENDING_WEST);
- case SOUTH_EAST:
- return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.SOUTH_WEST);
- case SOUTH_WEST:
- return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.NORTH_WEST);
- case NORTH_WEST:
- return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.NORTH_EAST);
- case NORTH_EAST:
- return p_185499_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.SOUTH_EAST);
- }
- default:
- return p_185499_1_;
- }
- }
- public IBlockState func_185471_a(IBlockState p_185471_1_, Mirror p_185471_2_) {
- BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)p_185471_1_.func_177229_b(field_176568_b);
- switch(p_185471_2_) {
- case LEFT_RIGHT:
- switch(blockrailbase$enumraildirection) {
- case ASCENDING_NORTH:
- return p_185471_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.ASCENDING_SOUTH);
- case ASCENDING_SOUTH:
- return p_185471_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.ASCENDING_NORTH);
- case SOUTH_EAST:
- return p_185471_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.NORTH_EAST);
- case SOUTH_WEST:
- return p_185471_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.NORTH_WEST);
- case NORTH_WEST:
- return p_185471_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.SOUTH_WEST);
- case NORTH_EAST:
- return p_185471_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.SOUTH_EAST);
- default:
- return super.func_185471_a(p_185471_1_, p_185471_2_);
- }
- case FRONT_BACK:
- switch(blockrailbase$enumraildirection) {
- case ASCENDING_EAST:
- return p_185471_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.ASCENDING_WEST);
- case ASCENDING_WEST:
- return p_185471_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.ASCENDING_EAST);
- case ASCENDING_NORTH:
- case ASCENDING_SOUTH:
- default:
- break;
- case SOUTH_EAST:
- return p_185471_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.SOUTH_WEST);
- case SOUTH_WEST:
- return p_185471_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.SOUTH_EAST);
- case NORTH_WEST:
- return p_185471_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.NORTH_EAST);
- case NORTH_EAST:
- return p_185471_1_.func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.NORTH_WEST);
- }
- }
- return super.func_185471_a(p_185471_1_, p_185471_2_);
- }
- protected BlockStateContainer func_180661_e() {
- return new BlockStateContainer(this, new IProperty[]{field_176568_b, field_176569_M});
- }
- }
- Patching failed: minecraft\net\minecraft\tileentity\TileEntityChest.java
- Hunk 1 failed! Cannot find hunk target
- this.field_145984_a = false;
- }
- + @SuppressWarnings("incomplete-switch")
- private void func_174910_a(TileEntityChest p_174910_1_, EnumFacing p_174910_2_) {
- if (p_174910_1_.func_145837_r()) {
- this.field_145984_a = false;
- File state
- package net.minecraft.tileentity;
- import javax.annotation.Nullable;
- import net.minecraft.block.Block;
- import net.minecraft.block.BlockChest;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.entity.player.InventoryPlayer;
- import net.minecraft.init.SoundEvents;
- import net.minecraft.inventory.Container;
- import net.minecraft.inventory.ContainerChest;
- import net.minecraft.inventory.IInventory;
- import net.minecraft.inventory.InventoryLargeChest;
- import net.minecraft.inventory.ItemStackHelper;
- import net.minecraft.item.ItemStack;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.tileentity.TileEntity;
- import net.minecraft.tileentity.TileEntityLockableLoot;
- import net.minecraft.util.EnumFacing;
- import net.minecraft.util.ITickable;
- import net.minecraft.util.NonNullList;
- import net.minecraft.util.SoundCategory;
- import net.minecraft.util.datafix.DataFixer;
- import net.minecraft.util.datafix.FixTypes;
- import net.minecraft.util.datafix.walkers.ItemStackDataLists;
- import net.minecraft.util.math.AxisAlignedBB;
- import net.minecraft.util.math.BlockPos;
- public class TileEntityChest extends TileEntityLockableLoot implements ITickable {
- private NonNullList<ItemStack> field_145985_p = NonNullList.<ItemStack>func_191197_a(27, ItemStack.field_190927_a);
- public boolean field_145984_a;
- public TileEntityChest field_145992_i;
- public TileEntityChest field_145990_j;
- public TileEntityChest field_145991_k;
- public TileEntityChest field_145988_l;
- public float field_145989_m;
- public float field_145986_n;
- public int field_145987_o;
- private int field_145983_q;
- private BlockChest.Type field_145982_r;
- public TileEntityChest() {
- }
- public TileEntityChest(BlockChest.Type p_i46677_1_) {
- this.field_145982_r = p_i46677_1_;
- }
- public int func_70302_i_() {
- return 27;
- }
- public boolean func_191420_l() {
- for(ItemStack itemstack : this.field_145985_p) {
- if(!itemstack.func_190926_b()) {
- return false;
- }
- }
- return true;
- }
- public String func_70005_c_() {
- return this.func_145818_k_()?this.field_190577_o:"container.chest";
- }
- public static void func_189677_a(DataFixer p_189677_0_) {
- p_189677_0_.func_188258_a(FixTypes.BLOCK_ENTITY, new ItemStackDataLists(TileEntityChest.class, new String[]{"Items"}));
- }
- public void func_145839_a(NBTTagCompound p_145839_1_) {
- super.func_145839_a(p_145839_1_);
- this.field_145985_p = NonNullList.<ItemStack>func_191197_a(this.func_70302_i_(), ItemStack.field_190927_a);
- if(!this.func_184283_b(p_145839_1_)) {
- ItemStackHelper.func_191283_b(p_145839_1_, this.field_145985_p);
- }
- if(p_145839_1_.func_150297_b("CustomName", 8)) {
- this.field_190577_o = p_145839_1_.func_74779_i("CustomName");
- }
- }
- public NBTTagCompound func_189515_b(NBTTagCompound p_189515_1_) {
- super.func_189515_b(p_189515_1_);
- if(!this.func_184282_c(p_189515_1_)) {
- ItemStackHelper.func_191282_a(p_189515_1_, this.field_145985_p);
- }
- if(this.func_145818_k_()) {
- p_189515_1_.func_74778_a("CustomName", this.field_190577_o);
- }
- return p_189515_1_;
- }
- public int func_70297_j_() {
- return 64;
- }
- public void func_145836_u() {
- super.func_145836_u();
- this.field_145984_a = false;
- }
- private void func_174910_a(TileEntityChest p_174910_1_, EnumFacing p_174910_2_) {
- if(p_174910_1_.func_145837_r()) {
- this.field_145984_a = false;
- } else if(this.field_145984_a) {
- switch(p_174910_2_) {
- case NORTH:
- if(this.field_145992_i != p_174910_1_) {
- this.field_145984_a = false;
- }
- break;
- case SOUTH:
- if(this.field_145988_l != p_174910_1_) {
- this.field_145984_a = false;
- }
- break;
- case EAST:
- if(this.field_145990_j != p_174910_1_) {
- this.field_145984_a = false;
- }
- break;
- case WEST:
- if(this.field_145991_k != p_174910_1_) {
- this.field_145984_a = false;
- }
- }
- }
- }
- public void func_145979_i() {
- if(!this.field_145984_a) {
- this.field_145984_a = true;
- this.field_145991_k = this.func_174911_a(EnumFacing.WEST);
- this.field_145990_j = this.func_174911_a(EnumFacing.EAST);
- this.field_145992_i = this.func_174911_a(EnumFacing.NORTH);
- this.field_145988_l = this.func_174911_a(EnumFacing.SOUTH);
- }
- }
- @Nullable
- protected TileEntityChest func_174911_a(EnumFacing p_174911_1_) {
- BlockPos blockpos = this.field_174879_c.func_177972_a(p_174911_1_);
- if(this.func_174912_b(blockpos)) {
- TileEntity tileentity = this.field_145850_b.func_175625_s(blockpos);
- if(tileentity instanceof TileEntityChest) {
- TileEntityChest tileentitychest = (TileEntityChest)tileentity;
- tileentitychest.func_174910_a(this, p_174911_1_.func_176734_d());
- return tileentitychest;
- }
- }
- return null;
- }
- private boolean func_174912_b(BlockPos p_174912_1_) {
- if(this.field_145850_b == null) {
- return false;
- } else {
- Block block = this.field_145850_b.func_180495_p(p_174912_1_).func_177230_c();
- return block instanceof BlockChest && ((BlockChest)block).field_149956_a == this.func_145980_j();
- }
- }
- public void func_73660_a() {
- this.func_145979_i();
- int i = this.field_174879_c.func_177958_n();
- int j = this.field_174879_c.func_177956_o();
- int k = this.field_174879_c.func_177952_p();
- ++this.field_145983_q;
- if(!this.field_145850_b.field_72995_K && this.field_145987_o != 0 && (this.field_145983_q + i + j + k) % 200 == 0) {
- this.field_145987_o = 0;
- float f = 5.0F;
- 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)))) {
- if(entityplayer.field_71070_bA instanceof ContainerChest) {
- IInventory iinventory = ((ContainerChest)entityplayer.field_71070_bA).func_85151_d();
- if(iinventory == this || iinventory instanceof InventoryLargeChest && ((InventoryLargeChest)iinventory).func_90010_a(this)) {
- ++this.field_145987_o;
- }
- }
- }
- }
- this.field_145986_n = this.field_145989_m;
- float f1 = 0.1F;
- if(this.field_145987_o > 0 && this.field_145989_m == 0.0F && this.field_145992_i == null && this.field_145991_k == null) {
- double d1 = (double)i + 0.5D;
- double d2 = (double)k + 0.5D;
- if(this.field_145988_l != null) {
- d2 += 0.5D;
- }
- if(this.field_145990_j != null) {
- d1 += 0.5D;
- }
- 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);
- }
- if(this.field_145987_o == 0 && this.field_145989_m > 0.0F || this.field_145987_o > 0 && this.field_145989_m < 1.0F) {
- float f2 = this.field_145989_m;
- if(this.field_145987_o > 0) {
- this.field_145989_m += 0.1F;
- } else {
- this.field_145989_m -= 0.1F;
- }
- if(this.field_145989_m > 1.0F) {
- this.field_145989_m = 1.0F;
- }
- float f3 = 0.5F;
- if(this.field_145989_m < 0.5F && f2 >= 0.5F && this.field_145992_i == null && this.field_145991_k == null) {
- double d3 = (double)i + 0.5D;
- double d0 = (double)k + 0.5D;
- if(this.field_145988_l != null) {
- d0 += 0.5D;
- }
- if(this.field_145990_j != null) {
- d3 += 0.5D;
- }
- 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);
- }
- if(this.field_145989_m < 0.0F) {
- this.field_145989_m = 0.0F;
- }
- }
- }
- public boolean func_145842_c(int p_145842_1_, int p_145842_2_) {
- if(p_145842_1_ == 1) {
- this.field_145987_o = p_145842_2_;
- return true;
- } else {
- return super.func_145842_c(p_145842_1_, p_145842_2_);
- }
- }
- public void func_174889_b(EntityPlayer p_174889_1_) {
- if(!p_174889_1_.func_175149_v()) {
- if(this.field_145987_o < 0) {
- this.field_145987_o = 0;
- }
- ++this.field_145987_o;
- this.field_145850_b.func_175641_c(this.field_174879_c, this.func_145838_q(), 1, this.field_145987_o);
- this.field_145850_b.func_175685_c(this.field_174879_c, this.func_145838_q(), false);
- if(this.func_145980_j() == BlockChest.Type.TRAP) {
- this.field_145850_b.func_175685_c(this.field_174879_c.func_177977_b(), this.func_145838_q(), false);
- }
- }
- }
- public void func_174886_c(EntityPlayer p_174886_1_) {
- if(!p_174886_1_.func_175149_v() && this.func_145838_q() instanceof BlockChest) {
- --this.field_145987_o;
- this.field_145850_b.func_175641_c(this.field_174879_c, this.func_145838_q(), 1, this.field_145987_o);
- this.field_145850_b.func_175685_c(this.field_174879_c, this.func_145838_q(), false);
- if(this.func_145980_j() == BlockChest.Type.TRAP) {
- this.field_145850_b.func_175685_c(this.field_174879_c.func_177977_b(), this.func_145838_q(), false);
- }
- }
- }
- public void func_145843_s() {
- super.func_145843_s();
- this.func_145836_u();
- this.func_145979_i();
- }
- public BlockChest.Type func_145980_j() {
- if(this.field_145982_r == null) {
- if(this.field_145850_b == null || !(this.func_145838_q() instanceof BlockChest)) {
- return BlockChest.Type.BASIC;
- }
- this.field_145982_r = ((BlockChest)this.func_145838_q()).field_149956_a;
- }
- return this.field_145982_r;
- }
- public String func_174875_k() {
- return "minecraft:chest";
- }
- public Container func_174876_a(InventoryPlayer p_174876_1_, EntityPlayer p_174876_2_) {
- this.func_184281_d(p_174876_2_);
- return new ContainerChest(p_174876_1_, this, p_174876_2_);
- }
- protected NonNullList<ItemStack> func_190576_q() {
- return this.field_145985_p;
- }
- }
- Patching failed: minecraft\net\minecraft\tileentity\TileEntityPiston.java
- Hunk 1 failed! Cannot find hunk target
- d1 = Math.min(d1, d0) + 0.01D;
- field_190613_i.set(enumfacing);
- entity.func_70091_d(MoverType.PISTON, d1 * (double)enumfacing.func_82601_c(), d1 * (double)enumfacing.func_96559_d(), d1 * (double)enumfacing.func_82599_e());
- - field_190613_i.set((Object)null);
- + field_190613_i.set(null);
- if (!this.field_145875_k && this.field_145872_l) {
- this.func_190605_a(entity, enumfacing, d0);
- }
- File state
- package net.minecraft.tileentity;
- import com.google.common.collect.Lists;
- import java.util.List;
- import javax.annotation.Nullable;
- import net.minecraft.block.Block;
- import net.minecraft.block.BlockPistonBase;
- import net.minecraft.block.BlockPistonExtension;
- import net.minecraft.block.material.EnumPushReaction;
- import net.minecraft.block.state.IBlockState;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.MoverType;
- import net.minecraft.init.Blocks;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.tileentity.TileEntity;
- import net.minecraft.util.EnumFacing;
- import net.minecraft.util.ITickable;
- import net.minecraft.util.datafix.DataFixer;
- import net.minecraft.util.math.AxisAlignedBB;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.world.IBlockAccess;
- import net.minecraft.world.World;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- public class TileEntityPiston extends TileEntity implements ITickable {
- private IBlockState field_174932_a;
- private EnumFacing field_174931_f;
- private boolean field_145875_k;
- private boolean field_145872_l;
- private static final ThreadLocal<EnumFacing> field_190613_i = new ThreadLocal<EnumFacing>() {
- protected EnumFacing initialValue() {
- return null;
- }
- };
- private float field_145873_m;
- private float field_145870_n;
- public TileEntityPiston() {
- }
- public TileEntityPiston(IBlockState p_i45665_1_, EnumFacing p_i45665_2_, boolean p_i45665_3_, boolean p_i45665_4_) {
- this.field_174932_a = p_i45665_1_;
- this.field_174931_f = p_i45665_2_;
- this.field_145875_k = p_i45665_3_;
- this.field_145872_l = p_i45665_4_;
- }
- public IBlockState func_174927_b() {
- return this.field_174932_a;
- }
- public NBTTagCompound func_189517_E_() {
- return this.func_189515_b(new NBTTagCompound());
- }
- public int func_145832_p() {
- return 0;
- }
- public boolean func_145868_b() {
- return this.field_145875_k;
- }
- public EnumFacing func_174930_e() {
- return this.field_174931_f;
- }
- public boolean func_145867_d() {
- return this.field_145872_l;
- }
- @SideOnly(Side.CLIENT)
- public float func_145860_a(float p_145860_1_) {
- if(p_145860_1_ > 1.0F) {
- p_145860_1_ = 1.0F;
- }
- return this.field_145870_n + (this.field_145873_m - this.field_145870_n) * p_145860_1_;
- }
- @SideOnly(Side.CLIENT)
- public float func_174929_b(float p_174929_1_) {
- return (float)this.field_174931_f.func_82601_c() * this.func_184320_e(this.func_145860_a(p_174929_1_));
- }
- @SideOnly(Side.CLIENT)
- public float func_174928_c(float p_174928_1_) {
- return (float)this.field_174931_f.func_96559_d() * this.func_184320_e(this.func_145860_a(p_174928_1_));
- }
- @SideOnly(Side.CLIENT)
- public float func_174926_d(float p_174926_1_) {
- return (float)this.field_174931_f.func_82599_e() * this.func_184320_e(this.func_145860_a(p_174926_1_));
- }
- private float func_184320_e(float p_184320_1_) {
- return this.field_145875_k?p_184320_1_ - 1.0F:1.0F - p_184320_1_;
- }
- public AxisAlignedBB func_184321_a(IBlockAccess p_184321_1_, BlockPos p_184321_2_) {
- 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));
- }
- public AxisAlignedBB func_184319_a(IBlockAccess p_184319_1_, BlockPos p_184319_2_, float p_184319_3_) {
- p_184319_3_ = this.func_184320_e(p_184319_3_);
- IBlockState iblockstate = this.func_190606_j();
- 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()));
- }
- private IBlockState func_190606_j() {
- 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;
- }
- private void func_184322_i(float p_184322_1_) {
- EnumFacing enumfacing = this.field_145875_k?this.field_174931_f:this.field_174931_f.func_176734_d();
- double d0 = (double)(p_184322_1_ - this.field_145873_m);
- List<AxisAlignedBB> list = Lists.<AxisAlignedBB>newArrayList();
- 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);
- if(!((List)list).isEmpty()) {
- AxisAlignedBB axisalignedbb = this.func_190607_a(this.func_191515_a(list));
- List<Entity> list1 = this.field_145850_b.func_72839_b((Entity)null, this.func_190610_a(axisalignedbb, enumfacing, d0).func_111270_a(axisalignedbb));
- if(!list1.isEmpty()) {
- boolean flag = this.field_174932_a.func_177230_c() == Blocks.field_180399_cE;
- for(int i = 0; i < list1.size(); ++i) {
- Entity entity = (Entity)list1.get(i);
- if(entity.func_184192_z() != EnumPushReaction.IGNORE) {
- if(flag) {
- switch(enumfacing.func_176740_k()) {
- case X:
- entity.field_70159_w = (double)enumfacing.func_82601_c();
- break;
- case Y:
- entity.field_70181_x = (double)enumfacing.func_96559_d();
- break;
- case Z:
- entity.field_70179_y = (double)enumfacing.func_82599_e();
- }
- }
- double d1 = 0.0D;
- for(int j = 0; j < ((List)list).size(); ++j) {
- AxisAlignedBB axisalignedbb1 = this.func_190610_a(this.func_190607_a((AxisAlignedBB)list.get(j)), enumfacing, d0);
- AxisAlignedBB axisalignedbb2 = entity.func_174813_aQ();
- if(axisalignedbb1.func_72326_a(axisalignedbb2)) {
- d1 = Math.max(d1, this.func_190612_a(axisalignedbb1, enumfacing, axisalignedbb2));
- if(d1 >= d0) {
- break;
- }
- }
- }
- if(d1 > 0.0D) {
- d1 = Math.min(d1, d0) + 0.01D;
- field_190613_i.set(enumfacing);
- entity.func_70091_d(MoverType.PISTON, d1 * (double)enumfacing.func_82601_c(), d1 * (double)enumfacing.func_96559_d(), d1 * (double)enumfacing.func_82599_e());
- field_190613_i.set((EnumFacing)null);
- if(!this.field_145875_k && this.field_145872_l) {
- this.func_190605_a(entity, enumfacing, d0);
- }
- }
- }
- }
- }
- }
- }
- private AxisAlignedBB func_191515_a(List<AxisAlignedBB> p_191515_1_) {
- double d0 = 0.0D;
- double d1 = 0.0D;
- double d2 = 0.0D;
- double d3 = 1.0D;
- double d4 = 1.0D;
- double d5 = 1.0D;
- for(AxisAlignedBB axisalignedbb : p_191515_1_) {
- d0 = Math.min(axisalignedbb.field_72340_a, d0);
- d1 = Math.min(axisalignedbb.field_72338_b, d1);
- d2 = Math.min(axisalignedbb.field_72339_c, d2);
- d3 = Math.max(axisalignedbb.field_72336_d, d3);
- d4 = Math.max(axisalignedbb.field_72337_e, d4);
- d5 = Math.max(axisalignedbb.field_72334_f, d5);
- }
- return new AxisAlignedBB(d0, d1, d2, d3, d4, d5);
- }
- private double func_190612_a(AxisAlignedBB p_190612_1_, EnumFacing p_190612_2_, AxisAlignedBB p_190612_3_) {
- switch(p_190612_2_.func_176740_k()) {
- case X:
- return func_190611_b(p_190612_1_, p_190612_2_, p_190612_3_);
- case Y:
- default:
- return func_190608_c(p_190612_1_, p_190612_2_, p_190612_3_);
- case Z:
- return func_190604_d(p_190612_1_, p_190612_2_, p_190612_3_);
- }
- }
- private AxisAlignedBB func_190607_a(AxisAlignedBB p_190607_1_) {
- double d0 = (double)this.func_184320_e(this.field_145873_m);
- 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());
- }
- private AxisAlignedBB func_190610_a(AxisAlignedBB p_190610_1_, EnumFacing p_190610_2_, double p_190610_3_) {
- double d0 = p_190610_3_ * (double)p_190610_2_.func_176743_c().func_179524_a();
- double d1 = Math.min(d0, 0.0D);
- double d2 = Math.max(d0, 0.0D);
- switch(p_190610_2_) {
- case WEST:
- 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);
- case EAST:
- 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);
- case DOWN:
- 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);
- case UP:
- default:
- 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);
- case NORTH:
- 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);
- case SOUTH:
- 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);
- }
- }
- private void func_190605_a(Entity p_190605_1_, EnumFacing p_190605_2_, double p_190605_3_) {
- AxisAlignedBB axisalignedbb = p_190605_1_.func_174813_aQ();
- AxisAlignedBB axisalignedbb1 = Block.field_185505_j.func_186670_a(this.field_174879_c);
- if(axisalignedbb.func_72326_a(axisalignedbb1)) {
- EnumFacing enumfacing = p_190605_2_.func_176734_d();
- double d0 = this.func_190612_a(axisalignedbb1, enumfacing, axisalignedbb) + 0.01D;
- double d1 = this.func_190612_a(axisalignedbb1, enumfacing, axisalignedbb.func_191500_a(axisalignedbb1)) + 0.01D;
- if(Math.abs(d0 - d1) < 0.01D) {
- d0 = Math.min(d0, p_190605_3_) + 0.01D;
- field_190613_i.set(p_190605_2_);
- 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());
- field_190613_i.set((EnumFacing)null);
- }
- }
- }
- private static double func_190611_b(AxisAlignedBB p_190611_0_, EnumFacing p_190611_1_, AxisAlignedBB p_190611_2_) {
- 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;
- }
- private static double func_190608_c(AxisAlignedBB p_190608_0_, EnumFacing p_190608_1_, AxisAlignedBB p_190608_2_) {
- 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;
- }
- private static double func_190604_d(AxisAlignedBB p_190604_0_, EnumFacing p_190604_1_, AxisAlignedBB p_190604_2_) {
- 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;
- }
- public void func_145866_f() {
- if(this.field_145870_n < 1.0F && this.field_145850_b != null) {
- this.field_145873_m = 1.0F;
- this.field_145870_n = this.field_145873_m;
- this.field_145850_b.func_175713_t(this.field_174879_c);
- this.func_145843_s();
- if(this.field_145850_b.func_180495_p(this.field_174879_c).func_177230_c() == Blocks.field_180384_M) {
- this.field_145850_b.func_180501_a(this.field_174879_c, this.field_174932_a, 3);
- this.field_145850_b.func_190524_a(this.field_174879_c, this.field_174932_a.func_177230_c(), this.field_174879_c);
- }
- }
- }
- public void func_73660_a() {
- this.field_145870_n = this.field_145873_m;
- if(this.field_145870_n >= 1.0F) {
- this.field_145850_b.func_175713_t(this.field_174879_c);
- this.func_145843_s();
- if(this.field_145850_b.func_180495_p(this.field_174879_c).func_177230_c() == Blocks.field_180384_M) {
- this.field_145850_b.func_180501_a(this.field_174879_c, this.field_174932_a, 3);
- this.field_145850_b.func_190524_a(this.field_174879_c, this.field_174932_a.func_177230_c(), this.field_174879_c);
- }
- } else {
- float f = this.field_145873_m + 0.5F;
- this.func_184322_i(f);
- this.field_145873_m = f;
- if(this.field_145873_m >= 1.0F) {
- this.field_145873_m = 1.0F;
- }
- }
- }
- public static void func_189685_a(DataFixer p_189685_0_) {
- }
- public void func_145839_a(NBTTagCompound p_145839_1_) {
- super.func_145839_a(p_145839_1_);
- 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"));
- this.field_174931_f = EnumFacing.func_82600_a(p_145839_1_.func_74762_e("facing"));
- this.field_145873_m = p_145839_1_.func_74760_g("progress");
- this.field_145870_n = this.field_145873_m;
- this.field_145875_k = p_145839_1_.func_74767_n("extending");
- this.field_145872_l = p_145839_1_.func_74767_n("source");
- }
- public NBTTagCompound func_189515_b(NBTTagCompound p_189515_1_) {
- super.func_189515_b(p_189515_1_);
- p_189515_1_.func_74768_a("blockId", Block.func_149682_b(this.field_174932_a.func_177230_c()));
- p_189515_1_.func_74768_a("blockData", this.field_174932_a.func_177230_c().func_176201_c(this.field_174932_a));
- p_189515_1_.func_74768_a("facing", this.field_174931_f.func_176745_a());
- p_189515_1_.func_74776_a("progress", this.field_145870_n);
- p_189515_1_.func_74757_a("extending", this.field_145875_k);
- p_189515_1_.func_74757_a("source", this.field_145872_l);
- return p_189515_1_;
- }
- 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_) {
- if(!this.field_145875_k && this.field_145872_l) {
- 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);
- }
- EnumFacing enumfacing = (EnumFacing)field_190613_i.get();
- if((double)this.field_145873_m >= 1.0D || enumfacing != (this.field_145875_k?this.field_174931_f:this.field_174931_f.func_176734_d())) {
- int i = p_190609_4_.size();
- IBlockState iblockstate;
- if(this.func_145867_d()) {
- 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));
- } else {
- iblockstate = this.field_174932_a;
- }
- float f = this.func_184320_e(this.field_145873_m);
- double d0 = (double)((float)this.field_174931_f.func_82601_c() * f);
- double d1 = (double)((float)this.field_174931_f.func_96559_d() * f);
- double d2 = (double)((float)this.field_174931_f.func_82599_e() * f);
- 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);
- for(int j = i; j < p_190609_4_.size(); ++j) {
- p_190609_4_.set(j, ((AxisAlignedBB)p_190609_4_.get(j)).func_72317_d(d0, d1, d2));
- }
- }
- }
- }
- Hunk 2 failed! Cannot find hunk target
- d0 = Math.min(d0, p_190605_3_) + 0.01D;
- field_190613_i.set(p_190605_2_);
- 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());
- - field_190613_i.set((Object)null);
- + field_190613_i.set(null);
- }
- }
- File state
- package net.minecraft.tileentity;
- import com.google.common.collect.Lists;
- import java.util.List;
- import javax.annotation.Nullable;
- import net.minecraft.block.Block;
- import net.minecraft.block.BlockPistonBase;
- import net.minecraft.block.BlockPistonExtension;
- import net.minecraft.block.material.EnumPushReaction;
- import net.minecraft.block.state.IBlockState;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.MoverType;
- import net.minecraft.init.Blocks;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.tileentity.TileEntity;
- import net.minecraft.util.EnumFacing;
- import net.minecraft.util.ITickable;
- import net.minecraft.util.datafix.DataFixer;
- import net.minecraft.util.math.AxisAlignedBB;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.world.IBlockAccess;
- import net.minecraft.world.World;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- public class TileEntityPiston extends TileEntity implements ITickable {
- private IBlockState field_174932_a;
- private EnumFacing field_174931_f;
- private boolean field_145875_k;
- private boolean field_145872_l;
- private static final ThreadLocal<EnumFacing> field_190613_i = new ThreadLocal<EnumFacing>() {
- protected EnumFacing initialValue() {
- return null;
- }
- };
- private float field_145873_m;
- private float field_145870_n;
- public TileEntityPiston() {
- }
- public TileEntityPiston(IBlockState p_i45665_1_, EnumFacing p_i45665_2_, boolean p_i45665_3_, boolean p_i45665_4_) {
- this.field_174932_a = p_i45665_1_;
- this.field_174931_f = p_i45665_2_;
- this.field_145875_k = p_i45665_3_;
- this.field_145872_l = p_i45665_4_;
- }
- public IBlockState func_174927_b() {
- return this.field_174932_a;
- }
- public NBTTagCompound func_189517_E_() {
- return this.func_189515_b(new NBTTagCompound());
- }
- public int func_145832_p() {
- return 0;
- }
- public boolean func_145868_b() {
- return this.field_145875_k;
- }
- public EnumFacing func_174930_e() {
- return this.field_174931_f;
- }
- public boolean func_145867_d() {
- return this.field_145872_l;
- }
- @SideOnly(Side.CLIENT)
- public float func_145860_a(float p_145860_1_) {
- if(p_145860_1_ > 1.0F) {
- p_145860_1_ = 1.0F;
- }
- return this.field_145870_n + (this.field_145873_m - this.field_145870_n) * p_145860_1_;
- }
- @SideOnly(Side.CLIENT)
- public float func_174929_b(float p_174929_1_) {
- return (float)this.field_174931_f.func_82601_c() * this.func_184320_e(this.func_145860_a(p_174929_1_));
- }
- @SideOnly(Side.CLIENT)
- public float func_174928_c(float p_174928_1_) {
- return (float)this.field_174931_f.func_96559_d() * this.func_184320_e(this.func_145860_a(p_174928_1_));
- }
- @SideOnly(Side.CLIENT)
- public float func_174926_d(float p_174926_1_) {
- return (float)this.field_174931_f.func_82599_e() * this.func_184320_e(this.func_145860_a(p_174926_1_));
- }
- private float func_184320_e(float p_184320_1_) {
- return this.field_145875_k?p_184320_1_ - 1.0F:1.0F - p_184320_1_;
- }
- public AxisAlignedBB func_184321_a(IBlockAccess p_184321_1_, BlockPos p_184321_2_) {
- 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));
- }
- public AxisAlignedBB func_184319_a(IBlockAccess p_184319_1_, BlockPos p_184319_2_, float p_184319_3_) {
- p_184319_3_ = this.func_184320_e(p_184319_3_);
- IBlockState iblockstate = this.func_190606_j();
- 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()));
- }
- private IBlockState func_190606_j() {
- 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;
- }
- private void func_184322_i(float p_184322_1_) {
- EnumFacing enumfacing = this.field_145875_k?this.field_174931_f:this.field_174931_f.func_176734_d();
- double d0 = (double)(p_184322_1_ - this.field_145873_m);
- List<AxisAlignedBB> list = Lists.<AxisAlignedBB>newArrayList();
- 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);
- if(!((List)list).isEmpty()) {
- AxisAlignedBB axisalignedbb = this.func_190607_a(this.func_191515_a(list));
- List<Entity> list1 = this.field_145850_b.func_72839_b((Entity)null, this.func_190610_a(axisalignedbb, enumfacing, d0).func_111270_a(axisalignedbb));
- if(!list1.isEmpty()) {
- boolean flag = this.field_174932_a.func_177230_c() == Blocks.field_180399_cE;
- for(int i = 0; i < list1.size(); ++i) {
- Entity entity = (Entity)list1.get(i);
- if(entity.func_184192_z() != EnumPushReaction.IGNORE) {
- if(flag) {
- switch(enumfacing.func_176740_k()) {
- case X:
- entity.field_70159_w = (double)enumfacing.func_82601_c();
- break;
- case Y:
- entity.field_70181_x = (double)enumfacing.func_96559_d();
- break;
- case Z:
- entity.field_70179_y = (double)enumfacing.func_82599_e();
- }
- }
- double d1 = 0.0D;
- for(int j = 0; j < ((List)list).size(); ++j) {
- AxisAlignedBB axisalignedbb1 = this.func_190610_a(this.func_190607_a((AxisAlignedBB)list.get(j)), enumfacing, d0);
- AxisAlignedBB axisalignedbb2 = entity.func_174813_aQ();
- if(axisalignedbb1.func_72326_a(axisalignedbb2)) {
- d1 = Math.max(d1, this.func_190612_a(axisalignedbb1, enumfacing, axisalignedbb2));
- if(d1 >= d0) {
- break;
- }
- }
- }
- if(d1 > 0.0D) {
- d1 = Math.min(d1, d0) + 0.01D;
- field_190613_i.set(enumfacing);
- entity.func_70091_d(MoverType.PISTON, d1 * (double)enumfacing.func_82601_c(), d1 * (double)enumfacing.func_96559_d(), d1 * (double)enumfacing.func_82599_e());
- field_190613_i.set((EnumFacing)null);
- if(!this.field_145875_k && this.field_145872_l) {
- this.func_190605_a(entity, enumfacing, d0);
- }
- }
- }
- }
- }
- }
- }
- private AxisAlignedBB func_191515_a(List<AxisAlignedBB> p_191515_1_) {
- double d0 = 0.0D;
- double d1 = 0.0D;
- double d2 = 0.0D;
- double d3 = 1.0D;
- double d4 = 1.0D;
- double d5 = 1.0D;
- for(AxisAlignedBB axisalignedbb : p_191515_1_) {
- d0 = Math.min(axisalignedbb.field_72340_a, d0);
- d1 = Math.min(axisalignedbb.field_72338_b, d1);
- d2 = Math.min(axisalignedbb.field_72339_c, d2);
- d3 = Math.max(axisalignedbb.field_72336_d, d3);
- d4 = Math.max(axisalignedbb.field_72337_e, d4);
- d5 = Math.max(axisalignedbb.field_72334_f, d5);
- }
- return new AxisAlignedBB(d0, d1, d2, d3, d4, d5);
- }
- private double func_190612_a(AxisAlignedBB p_190612_1_, EnumFacing p_190612_2_, AxisAlignedBB p_190612_3_) {
- switch(p_190612_2_.func_176740_k()) {
- case X:
- return func_190611_b(p_190612_1_, p_190612_2_, p_190612_3_);
- case Y:
- default:
- return func_190608_c(p_190612_1_, p_190612_2_, p_190612_3_);
- case Z:
- return func_190604_d(p_190612_1_, p_190612_2_, p_190612_3_);
- }
- }
- private AxisAlignedBB func_190607_a(AxisAlignedBB p_190607_1_) {
- double d0 = (double)this.func_184320_e(this.field_145873_m);
- 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());
- }
- private AxisAlignedBB func_190610_a(AxisAlignedBB p_190610_1_, EnumFacing p_190610_2_, double p_190610_3_) {
- double d0 = p_190610_3_ * (double)p_190610_2_.func_176743_c().func_179524_a();
- double d1 = Math.min(d0, 0.0D);
- double d2 = Math.max(d0, 0.0D);
- switch(p_190610_2_) {
- case WEST:
- 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);
- case EAST:
- 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);
- case DOWN:
- 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);
- case UP:
- default:
- 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);
- case NORTH:
- 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);
- case SOUTH:
- 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);
- }
- }
- private void func_190605_a(Entity p_190605_1_, EnumFacing p_190605_2_, double p_190605_3_) {
- AxisAlignedBB axisalignedbb = p_190605_1_.func_174813_aQ();
- AxisAlignedBB axisalignedbb1 = Block.field_185505_j.func_186670_a(this.field_174879_c);
- if(axisalignedbb.func_72326_a(axisalignedbb1)) {
- EnumFacing enumfacing = p_190605_2_.func_176734_d();
- double d0 = this.func_190612_a(axisalignedbb1, enumfacing, axisalignedbb) + 0.01D;
- double d1 = this.func_190612_a(axisalignedbb1, enumfacing, axisalignedbb.func_191500_a(axisalignedbb1)) + 0.01D;
- if(Math.abs(d0 - d1) < 0.01D) {
- d0 = Math.min(d0, p_190605_3_) + 0.01D;
- field_190613_i.set(p_190605_2_);
- 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());
- field_190613_i.set((EnumFacing)null);
- }
- }
- }
- private static double func_190611_b(AxisAlignedBB p_190611_0_, EnumFacing p_190611_1_, AxisAlignedBB p_190611_2_) {
- 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;
- }
- private static double func_190608_c(AxisAlignedBB p_190608_0_, EnumFacing p_190608_1_, AxisAlignedBB p_190608_2_) {
- 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;
- }
- private static double func_190604_d(AxisAlignedBB p_190604_0_, EnumFacing p_190604_1_, AxisAlignedBB p_190604_2_) {
- 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;
- }
- public void func_145866_f() {
- if(this.field_145870_n < 1.0F && this.field_145850_b != null) {
- this.field_145873_m = 1.0F;
- this.field_145870_n = this.field_145873_m;
- this.field_145850_b.func_175713_t(this.field_174879_c);
- this.func_145843_s();
- if(this.field_145850_b.func_180495_p(this.field_174879_c).func_177230_c() == Blocks.field_180384_M) {
- this.field_145850_b.func_180501_a(this.field_174879_c, this.field_174932_a, 3);
- this.field_145850_b.func_190524_a(this.field_174879_c, this.field_174932_a.func_177230_c(), this.field_174879_c);
- }
- }
- }
- public void func_73660_a() {
- this.field_145870_n = this.field_145873_m;
- if(this.field_145870_n >= 1.0F) {
- this.field_145850_b.func_175713_t(this.field_174879_c);
- this.func_145843_s();
- if(this.field_145850_b.func_180495_p(this.field_174879_c).func_177230_c() == Blocks.field_180384_M) {
- this.field_145850_b.func_180501_a(this.field_174879_c, this.field_174932_a, 3);
- this.field_145850_b.func_190524_a(this.field_174879_c, this.field_174932_a.func_177230_c(), this.field_174879_c);
- }
- } else {
- float f = this.field_145873_m + 0.5F;
- this.func_184322_i(f);
- this.field_145873_m = f;
- if(this.field_145873_m >= 1.0F) {
- this.field_145873_m = 1.0F;
- }
- }
- }
- public static void func_189685_a(DataFixer p_189685_0_) {
- }
- public void func_145839_a(NBTTagCompound p_145839_1_) {
- super.func_145839_a(p_145839_1_);
- 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"));
- this.field_174931_f = EnumFacing.func_82600_a(p_145839_1_.func_74762_e("facing"));
- this.field_145873_m = p_145839_1_.func_74760_g("progress");
- this.field_145870_n = this.field_145873_m;
- this.field_145875_k = p_145839_1_.func_74767_n("extending");
- this.field_145872_l = p_145839_1_.func_74767_n("source");
- }
- public NBTTagCompound func_189515_b(NBTTagCompound p_189515_1_) {
- super.func_189515_b(p_189515_1_);
- p_189515_1_.func_74768_a("blockId", Block.func_149682_b(this.field_174932_a.func_177230_c()));
- p_189515_1_.func_74768_a("blockData", this.field_174932_a.func_177230_c().func_176201_c(this.field_174932_a));
- p_189515_1_.func_74768_a("facing", this.field_174931_f.func_176745_a());
- p_189515_1_.func_74776_a("progress", this.field_145870_n);
- p_189515_1_.func_74757_a("extending", this.field_145875_k);
- p_189515_1_.func_74757_a("source", this.field_145872_l);
- return p_189515_1_;
- }
- 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_) {
- if(!this.field_145875_k && this.field_145872_l) {
- 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);
- }
- EnumFacing enumfacing = (EnumFacing)field_190613_i.get();
- if((double)this.field_145873_m >= 1.0D || enumfacing != (this.field_145875_k?this.field_174931_f:this.field_174931_f.func_176734_d())) {
- int i = p_190609_4_.size();
- IBlockState iblockstate;
- if(this.func_145867_d()) {
- 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));
- } else {
- iblockstate = this.field_174932_a;
- }
- float f = this.func_184320_e(this.field_145873_m);
- double d0 = (double)((float)this.field_174931_f.func_82601_c() * f);
- double d1 = (double)((float)this.field_174931_f.func_96559_d() * f);
- double d2 = (double)((float)this.field_174931_f.func_82599_e() * f);
- 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);
- for(int j = i; j < p_190609_4_.size(); ++j) {
- p_190609_4_.set(j, ((AxisAlignedBB)p_190609_4_.get(j)).func_72317_d(d0, d1, d2));
- }
- }
- }
- }
- Patching failed: minecraft\net\minecraft\block\state\pattern\FactoryBlockPattern.java
- Hunk 1 failed! Cannot find hunk target
- for(char c0 : s.toCharArray()) {
- if (!this.field_177666_c.containsKey(Character.valueOf(c0))) {
- - this.field_177666_c.put(Character.valueOf(c0), (Object)null);
- + this.field_177666_c.put(Character.valueOf(c0), null);
- }
- }
- }
- File state
- package net.minecraft.block.state.pattern;
- import com.google.common.base.Joiner;
- import com.google.common.base.Predicate;
- import com.google.common.base.Predicates;
- import com.google.common.collect.Lists;
- import com.google.common.collect.Maps;
- import java.lang.reflect.Array;
- import java.util.List;
- import java.util.Map;
- import java.util.Map.Entry;
- import net.minecraft.block.state.BlockWorldState;
- import net.minecraft.block.state.pattern.BlockPattern;
- import org.apache.commons.lang3.ArrayUtils;
- import org.apache.commons.lang3.StringUtils;
- public class FactoryBlockPattern {
- private static final Joiner field_177667_a = Joiner.on(",");
- private final List<String[]> field_177665_b = Lists.<String[]>newArrayList();
- private final Map<Character, Predicate<BlockWorldState>> field_177666_c = Maps.<Character, Predicate<BlockWorldState>>newHashMap();
- private int field_177663_d;
- private int field_177664_e;
- private FactoryBlockPattern() {
- this.field_177666_c.put(Character.valueOf(' '), Predicates.<BlockWorldState>alwaysTrue());
- }
- public FactoryBlockPattern func_177659_a(String... p_177659_1_) {
- if(!ArrayUtils.isEmpty((Object[])p_177659_1_) && !StringUtils.isEmpty(p_177659_1_[0])) {
- if(this.field_177665_b.isEmpty()) {
- this.field_177663_d = p_177659_1_.length;
- this.field_177664_e = p_177659_1_[0].length();
- }
- if(p_177659_1_.length != this.field_177663_d) {
- throw new IllegalArgumentException("Expected aisle with height of " + this.field_177663_d + ", but was given one with a height of " + p_177659_1_.length + ")");
- } else {
- for(String s : p_177659_1_) {
- if(s.length() != this.field_177664_e) {
- throw new IllegalArgumentException("Not all rows in the given aisle are the correct width (expected " + this.field_177664_e + ", found one with " + s.length() + ")");
- }
- for(char c0 : s.toCharArray()) {
- if(!this.field_177666_c.containsKey(Character.valueOf(c0))) {
- this.field_177666_c.put(Character.valueOf(c0), (Predicate<BlockWorldState>)null);
- }
- }
- }
- this.field_177665_b.add(p_177659_1_);
- return this;
- }
- } else {
- throw new IllegalArgumentException("Empty pattern for aisle");
- }
- }
- public static FactoryBlockPattern func_177660_a() {
- return new FactoryBlockPattern();
- }
- public FactoryBlockPattern func_177662_a(char p_177662_1_, Predicate<BlockWorldState> p_177662_2_) {
- this.field_177666_c.put(Character.valueOf(p_177662_1_), p_177662_2_);
- return this;
- }
- public BlockPattern func_177661_b() {
- return new BlockPattern(this.func_177658_c());
- }
- private Predicate<BlockWorldState>[][][] func_177658_c() {
- this.func_177657_d();
- Predicate<BlockWorldState>[][][] predicate = (Predicate[][][])((Predicate[][][])Array.newInstance(Predicate.class, new int[]{this.field_177665_b.size(), this.field_177663_d, this.field_177664_e}));
- for(int i = 0; i < this.field_177665_b.size(); ++i) {
- for(int j = 0; j < this.field_177663_d; ++j) {
- for(int k = 0; k < this.field_177664_e; ++k) {
- predicate[i][j][k] = (Predicate)this.field_177666_c.get(Character.valueOf(((String[])this.field_177665_b.get(i))[j].charAt(k)));
- }
- }
- }
- return predicate;
- }
- private void func_177657_d() {
- List<Character> list = Lists.<Character>newArrayList();
- for(Entry<Character, Predicate<BlockWorldState>> entry : this.field_177666_c.entrySet()) {
- if(entry.getValue() == null) {
- list.add(entry.getKey());
- }
- }
- if(!list.isEmpty()) {
- throw new IllegalStateException("Predicates for character(s) " + field_177667_a.join(list) + " are missing");
- }
- }
- }
- Patching failed: minecraft\net\minecraft\block\state\pattern\BlockStateMatcher.java
- Hunk 1 failed! Cannot find hunk target
- return true;
- } else {
- for(Entry<IProperty<?>, Predicate<?>> entry : this.field_177640_b.entrySet()) {
- - if (!this.func_185927_a(p_apply_1_, entry.getKey(), entry.getValue())) {
- + if (!this.func_185927_a(p_apply_1_, (IProperty)entry.getKey(), (Predicate)entry.getValue())) {
- return false;
- }
- }
- File state
- package net.minecraft.block.state.pattern;
- import com.google.common.base.Predicate;
- import com.google.common.collect.Maps;
- import java.util.Map;
- import java.util.Map.Entry;
- import javax.annotation.Nullable;
- import net.minecraft.block.Block;
- import net.minecraft.block.properties.IProperty;
- import net.minecraft.block.state.BlockStateContainer;
- import net.minecraft.block.state.IBlockState;
- public class BlockStateMatcher implements Predicate<IBlockState> {
- public static final Predicate<IBlockState> field_185928_a = new Predicate<IBlockState>() {
- public boolean apply(@Nullable IBlockState p_apply_1_) {
- return true;
- }
- };
- private final BlockStateContainer field_177641_a;
- private final Map<IProperty<?>, Predicate<?>> field_177640_b = Maps.<IProperty<?>, Predicate<?>>newHashMap();
- private BlockStateMatcher(BlockStateContainer p_i45653_1_) {
- this.field_177641_a = p_i45653_1_;
- }
- public static BlockStateMatcher func_177638_a(Block p_177638_0_) {
- return new BlockStateMatcher(p_177638_0_.func_176194_O());
- }
- public boolean apply(@Nullable IBlockState p_apply_1_) {
- if(p_apply_1_ != null && p_apply_1_.func_177230_c().equals(this.field_177641_a.func_177622_c())) {
- if(this.field_177640_b.isEmpty()) {
- return true;
- } else {
- for(Entry<IProperty<?>, Predicate<?>> entry : this.field_177640_b.entrySet()) {
- if(!this.func_185927_a(p_apply_1_, (IProperty)entry.getKey(), (Predicate)entry.getValue())) {
- return false;
- }
- }
- return true;
- }
- } else {
- return false;
- }
- }
- protected <T extends Comparable<T>> boolean func_185927_a(IBlockState p_185927_1_, IProperty<T> p_185927_2_, Predicate<?> p_185927_3_) {
- return p_185927_3_.apply(p_185927_1_.func_177229_b(p_185927_2_));
- }
- public <V extends Comparable<V>> BlockStateMatcher func_177637_a(IProperty<V> p_177637_1_, Predicate<? extends V> p_177637_2_) {
- if(!this.field_177641_a.func_177623_d().contains(p_177637_1_)) {
- throw new IllegalArgumentException(this.field_177641_a + " cannot support property " + p_177637_1_);
- } else {
- this.field_177640_b.put(p_177637_1_, p_177637_2_);
- return this;
- }
- }
- }
- Patching failed: minecraft\net\minecraft\world\chunk\storage\AnvilChunkLoader.java
- Hunk 1 failed! Cannot find hunk target
- try {
- this.field_183014_e = true;
- - while(true) {
- - if (this.func_75814_c()) {
- - continue;
- - }
- - }
- + while(this.func_75814_c());
- } finally {
- this.field_183014_e = false;
- }
- File state
- package net.minecraft.world.chunk.storage;
- import com.google.common.collect.Maps;
- import java.io.DataInputStream;
- import java.io.DataOutputStream;
- import java.io.File;
- import java.io.IOException;
- import java.util.Collections;
- import java.util.List;
- import java.util.Map;
- import java.util.Set;
- import javax.annotation.Nullable;
- import net.minecraft.block.Block;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.EntityList;
- import net.minecraft.nbt.CompressedStreamTools;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.nbt.NBTTagList;
- import net.minecraft.tileentity.TileEntity;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.util.datafix.DataFixer;
- import net.minecraft.util.datafix.FixTypes;
- import net.minecraft.util.datafix.IDataFixer;
- import net.minecraft.util.datafix.IDataWalker;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.util.math.ChunkPos;
- import net.minecraft.world.MinecraftException;
- import net.minecraft.world.NextTickListEntry;
- import net.minecraft.world.World;
- import net.minecraft.world.chunk.Chunk;
- import net.minecraft.world.chunk.NibbleArray;
- import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
- import net.minecraft.world.chunk.storage.IChunkLoader;
- import net.minecraft.world.chunk.storage.RegionFileCache;
- import net.minecraft.world.storage.IThreadedFileIO;
- import net.minecraft.world.storage.ThreadedFileIOBase;
- import org.apache.logging.log4j.LogManager;
- import org.apache.logging.log4j.Logger;
- public class AnvilChunkLoader implements IChunkLoader, IThreadedFileIO {
- private static final Logger field_151505_a = LogManager.getLogger();
- private final Map<ChunkPos, NBTTagCompound> field_75828_a = Maps.<ChunkPos, NBTTagCompound>newConcurrentMap();
- private final Set<ChunkPos> field_193415_c = Collections.<ChunkPos>newSetFromMap(Maps.<ChunkPos, Boolean>newConcurrentMap());
- public final File field_75825_d;
- private final DataFixer field_193416_e;
- private boolean field_183014_e;
- public AnvilChunkLoader(File p_i46673_1_, DataFixer p_i46673_2_) {
- this.field_75825_d = p_i46673_1_;
- this.field_193416_e = p_i46673_2_;
- }
- @Nullable
- public Chunk func_75815_a(World p_75815_1_, int p_75815_2_, int p_75815_3_) throws IOException {
- ChunkPos chunkpos = new ChunkPos(p_75815_2_, p_75815_3_);
- NBTTagCompound nbttagcompound = (NBTTagCompound)this.field_75828_a.get(chunkpos);
- if(nbttagcompound == null) {
- DataInputStream datainputstream = RegionFileCache.func_76549_c(this.field_75825_d, p_75815_2_, p_75815_3_);
- if(datainputstream == null) {
- return null;
- }
- nbttagcompound = this.field_193416_e.func_188257_a(FixTypes.CHUNK, CompressedStreamTools.func_74794_a(datainputstream));
- }
- return this.func_75822_a(p_75815_1_, p_75815_2_, p_75815_3_, nbttagcompound);
- }
- public boolean func_191063_a(int p_191063_1_, int p_191063_2_) {
- ChunkPos chunkpos = new ChunkPos(p_191063_1_, p_191063_2_);
- NBTTagCompound nbttagcompound = (NBTTagCompound)this.field_75828_a.get(chunkpos);
- return nbttagcompound != null?true:RegionFileCache.func_191064_f(this.field_75825_d, p_191063_1_, p_191063_2_);
- }
- @Nullable
- protected Chunk func_75822_a(World p_75822_1_, int p_75822_2_, int p_75822_3_, NBTTagCompound p_75822_4_) {
- if(!p_75822_4_.func_150297_b("Level", 10)) {
- 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_));
- return null;
- } else {
- NBTTagCompound nbttagcompound = p_75822_4_.func_74775_l("Level");
- if(!nbttagcompound.func_150297_b("Sections", 9)) {
- 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_));
- return null;
- } else {
- Chunk chunk = this.func_75823_a(p_75822_1_, nbttagcompound);
- if(!chunk.func_76600_a(p_75822_2_, p_75822_3_)) {
- 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));
- nbttagcompound.func_74768_a("xPos", p_75822_2_);
- nbttagcompound.func_74768_a("zPos", p_75822_3_);
- chunk = this.func_75823_a(p_75822_1_, nbttagcompound);
- }
- return chunk;
- }
- }
- }
- public void func_75816_a(World p_75816_1_, Chunk p_75816_2_) throws MinecraftException, IOException {
- p_75816_1_.func_72906_B();
- try {
- NBTTagCompound nbttagcompound = new NBTTagCompound();
- NBTTagCompound nbttagcompound1 = new NBTTagCompound();
- nbttagcompound.func_74782_a("Level", nbttagcompound1);
- nbttagcompound.func_74768_a("DataVersion", 1139);
- this.func_75820_a(p_75816_2_, p_75816_1_, nbttagcompound1);
- this.func_75824_a(p_75816_2_.func_76632_l(), nbttagcompound);
- } catch (Exception exception) {
- field_151505_a.error((String)"Failed to save chunk", (Throwable)exception);
- }
- }
- protected void func_75824_a(ChunkPos p_75824_1_, NBTTagCompound p_75824_2_) {
- if(!this.field_193415_c.contains(p_75824_1_)) {
- this.field_75828_a.put(p_75824_1_, p_75824_2_);
- }
- ThreadedFileIOBase.func_178779_a().func_75735_a(this);
- }
- public boolean func_75814_c() {
- if(this.field_75828_a.isEmpty()) {
- if(this.field_183014_e) {
- field_151505_a.info((String)"ThreadedAnvilChunkStorage ({}): All chunks are saved", (Object)this.field_75825_d.getName());
- }
- return false;
- } else {
- ChunkPos chunkpos = (ChunkPos)this.field_75828_a.keySet().iterator().next();
- boolean lvt_3_1_;
- try {
- this.field_193415_c.add(chunkpos);
- NBTTagCompound nbttagcompound = (NBTTagCompound)this.field_75828_a.remove(chunkpos);
- if(nbttagcompound != null) {
- try {
- this.func_183013_b(chunkpos, nbttagcompound);
- } catch (Exception exception) {
- field_151505_a.error((String)"Failed to save chunk", (Throwable)exception);
- }
- }
- lvt_3_1_ = true;
- } finally {
- this.field_193415_c.remove(chunkpos);
- }
- return lvt_3_1_;
- }
- }
- private void func_183013_b(ChunkPos p_183013_1_, NBTTagCompound p_183013_2_) throws IOException {
- DataOutputStream dataoutputstream = RegionFileCache.func_76552_d(this.field_75825_d, p_183013_1_.field_77276_a, p_183013_1_.field_77275_b);
- CompressedStreamTools.func_74800_a(p_183013_2_, dataoutputstream);
- dataoutputstream.close();
- }
- public void func_75819_b(World p_75819_1_, Chunk p_75819_2_) throws IOException {
- }
- public void func_75817_a() {
- }
- public void func_75818_b() {
- try {
- this.field_183014_e = true;
- while(true) {
- if(this.func_75814_c()) {
- continue;
- }
- }
- } finally {
- this.field_183014_e = false;
- }
- }
- public static void func_189889_a(DataFixer p_189889_0_) {
- p_189889_0_.func_188258_a(FixTypes.CHUNK, new IDataWalker() {
- public NBTTagCompound func_188266_a(IDataFixer p_188266_1_, NBTTagCompound p_188266_2_, int p_188266_3_) {
- if(p_188266_2_.func_150297_b("Level", 10)) {
- NBTTagCompound nbttagcompound = p_188266_2_.func_74775_l("Level");
- if(nbttagcompound.func_150297_b("Entities", 9)) {
- NBTTagList nbttaglist = nbttagcompound.func_150295_c("Entities", 10);
- for(int i = 0; i < nbttaglist.func_74745_c(); ++i) {
- nbttaglist.func_150304_a(i, p_188266_1_.func_188251_a(FixTypes.ENTITY, (NBTTagCompound)nbttaglist.func_179238_g(i), p_188266_3_));
- }
- }
- if(nbttagcompound.func_150297_b("TileEntities", 9)) {
- NBTTagList nbttaglist1 = nbttagcompound.func_150295_c("TileEntities", 10);
- for(int j = 0; j < nbttaglist1.func_74745_c(); ++j) {
- nbttaglist1.func_150304_a(j, p_188266_1_.func_188251_a(FixTypes.BLOCK_ENTITY, (NBTTagCompound)nbttaglist1.func_179238_g(j), p_188266_3_));
- }
- }
- }
- return p_188266_2_;
- }
- });
- }
- private void func_75820_a(Chunk p_75820_1_, World p_75820_2_, NBTTagCompound p_75820_3_) {
- p_75820_3_.func_74768_a("xPos", p_75820_1_.field_76635_g);
- p_75820_3_.func_74768_a("zPos", p_75820_1_.field_76647_h);
- p_75820_3_.func_74772_a("LastUpdate", p_75820_2_.func_82737_E());
- p_75820_3_.func_74783_a("HeightMap", p_75820_1_.func_177445_q());
- p_75820_3_.func_74757_a("TerrainPopulated", p_75820_1_.func_177419_t());
- p_75820_3_.func_74757_a("LightPopulated", p_75820_1_.func_177423_u());
- p_75820_3_.func_74772_a("InhabitedTime", p_75820_1_.func_177416_w());
- ExtendedBlockStorage[] aextendedblockstorage = p_75820_1_.func_76587_i();
- NBTTagList nbttaglist = new NBTTagList();
- boolean flag = p_75820_2_.field_73011_w.func_191066_m();
- for(ExtendedBlockStorage extendedblockstorage : aextendedblockstorage) {
- if(extendedblockstorage != Chunk.field_186036_a) {
- NBTTagCompound nbttagcompound = new NBTTagCompound();
- nbttagcompound.func_74774_a("Y", (byte)(extendedblockstorage.func_76662_d() >> 4 & 255));
- byte[] abyte = new byte[4096];
- NibbleArray nibblearray = new NibbleArray();
- NibbleArray nibblearray1 = extendedblockstorage.func_186049_g().func_186017_a(abyte, nibblearray);
- nbttagcompound.func_74773_a("Blocks", abyte);
- nbttagcompound.func_74773_a("Data", nibblearray.func_177481_a());
- if(nibblearray1 != null) {
- nbttagcompound.func_74773_a("Add", nibblearray1.func_177481_a());
- }
- nbttagcompound.func_74773_a("BlockLight", extendedblockstorage.func_76661_k().func_177481_a());
- if(flag) {
- nbttagcompound.func_74773_a("SkyLight", extendedblockstorage.func_76671_l().func_177481_a());
- } else {
- nbttagcompound.func_74773_a("SkyLight", new byte[extendedblockstorage.func_76661_k().func_177481_a().length]);
- }
- nbttaglist.func_74742_a(nbttagcompound);
- }
- }
- p_75820_3_.func_74782_a("Sections", nbttaglist);
- p_75820_3_.func_74773_a("Biomes", p_75820_1_.func_76605_m());
- p_75820_1_.func_177409_g(false);
- NBTTagList nbttaglist1 = new NBTTagList();
- for(int i = 0; i < p_75820_1_.func_177429_s().length; ++i) {
- for(Entity entity : p_75820_1_.func_177429_s()[i]) {
- NBTTagCompound nbttagcompound2 = new NBTTagCompound();
- if(entity.func_70039_c(nbttagcompound2)) {
- p_75820_1_.func_177409_g(true);
- nbttaglist1.func_74742_a(nbttagcompound2);
- }
- }
- }
- p_75820_3_.func_74782_a("Entities", nbttaglist1);
- NBTTagList nbttaglist2 = new NBTTagList();
- for(TileEntity tileentity : p_75820_1_.func_177434_r().values()) {
- NBTTagCompound nbttagcompound3 = tileentity.func_189515_b(new NBTTagCompound());
- nbttaglist2.func_74742_a(nbttagcompound3);
- }
- p_75820_3_.func_74782_a("TileEntities", nbttaglist2);
- List<NextTickListEntry> list = p_75820_2_.func_72920_a(p_75820_1_, false);
- if(list != null) {
- long j = p_75820_2_.func_82737_E();
- NBTTagList nbttaglist3 = new NBTTagList();
- for(NextTickListEntry nextticklistentry : list) {
- NBTTagCompound nbttagcompound1 = new NBTTagCompound();
- ResourceLocation resourcelocation = (ResourceLocation)Block.field_149771_c.func_177774_c(nextticklistentry.func_151351_a());
- nbttagcompound1.func_74778_a("i", resourcelocation == null?"":resourcelocation.toString());
- nbttagcompound1.func_74768_a("x", nextticklistentry.field_180282_a.func_177958_n());
- nbttagcompound1.func_74768_a("y", nextticklistentry.field_180282_a.func_177956_o());
- nbttagcompound1.func_74768_a("z", nextticklistentry.field_180282_a.func_177952_p());
- nbttagcompound1.func_74768_a("t", (int)(nextticklistentry.field_77180_e - j));
- nbttagcompound1.func_74768_a("p", nextticklistentry.field_82754_f);
- nbttaglist3.func_74742_a(nbttagcompound1);
- }
- p_75820_3_.func_74782_a("TileTicks", nbttaglist3);
- }
- }
- private Chunk func_75823_a(World p_75823_1_, NBTTagCompound p_75823_2_) {
- int i = p_75823_2_.func_74762_e("xPos");
- int j = p_75823_2_.func_74762_e("zPos");
- Chunk chunk = new Chunk(p_75823_1_, i, j);
- chunk.func_177420_a(p_75823_2_.func_74759_k("HeightMap"));
- chunk.func_177446_d(p_75823_2_.func_74767_n("TerrainPopulated"));
- chunk.func_177421_e(p_75823_2_.func_74767_n("LightPopulated"));
- chunk.func_177415_c(p_75823_2_.func_74763_f("InhabitedTime"));
- NBTTagList nbttaglist = p_75823_2_.func_150295_c("Sections", 10);
- int k = 16;
- ExtendedBlockStorage[] aextendedblockstorage = new ExtendedBlockStorage[16];
- boolean flag = p_75823_1_.field_73011_w.func_191066_m();
- for(int l = 0; l < nbttaglist.func_74745_c(); ++l) {
- NBTTagCompound nbttagcompound = nbttaglist.func_150305_b(l);
- int i1 = nbttagcompound.func_74771_c("Y");
- ExtendedBlockStorage extendedblockstorage = new ExtendedBlockStorage(i1 << 4, flag);
- byte[] abyte = nbttagcompound.func_74770_j("Blocks");
- NibbleArray nibblearray = new NibbleArray(nbttagcompound.func_74770_j("Data"));
- NibbleArray nibblearray1 = nbttagcompound.func_150297_b("Add", 7)?new NibbleArray(nbttagcompound.func_74770_j("Add")):null;
- extendedblockstorage.func_186049_g().func_186019_a(abyte, nibblearray, nibblearray1);
- extendedblockstorage.func_76659_c(new NibbleArray(nbttagcompound.func_74770_j("BlockLight")));
- if(flag) {
- extendedblockstorage.func_76666_d(new NibbleArray(nbttagcompound.func_74770_j("SkyLight")));
- }
- extendedblockstorage.func_76672_e();
- aextendedblockstorage[i1] = extendedblockstorage;
- }
- chunk.func_76602_a(aextendedblockstorage);
- if(p_75823_2_.func_150297_b("Biomes", 7)) {
- chunk.func_76616_a(p_75823_2_.func_74770_j("Biomes"));
- }
- NBTTagList nbttaglist1 = p_75823_2_.func_150295_c("Entities", 10);
- for(int j1 = 0; j1 < nbttaglist1.func_74745_c(); ++j1) {
- NBTTagCompound nbttagcompound1 = nbttaglist1.func_150305_b(j1);
- func_186050_a(nbttagcompound1, p_75823_1_, chunk);
- chunk.func_177409_g(true);
- }
- NBTTagList nbttaglist2 = p_75823_2_.func_150295_c("TileEntities", 10);
- for(int k1 = 0; k1 < nbttaglist2.func_74745_c(); ++k1) {
- NBTTagCompound nbttagcompound2 = nbttaglist2.func_150305_b(k1);
- TileEntity tileentity = TileEntity.func_190200_a(p_75823_1_, nbttagcompound2);
- if(tileentity != null) {
- chunk.func_150813_a(tileentity);
- }
- }
- if(p_75823_2_.func_150297_b("TileTicks", 9)) {
- NBTTagList nbttaglist3 = p_75823_2_.func_150295_c("TileTicks", 10);
- for(int l1 = 0; l1 < nbttaglist3.func_74745_c(); ++l1) {
- NBTTagCompound nbttagcompound3 = nbttaglist3.func_150305_b(l1);
- Block block;
- if(nbttagcompound3.func_150297_b("i", 8)) {
- block = Block.func_149684_b(nbttagcompound3.func_74779_i("i"));
- } else {
- block = Block.func_149729_e(nbttagcompound3.func_74762_e("i"));
- }
- 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"));
- }
- }
- return chunk;
- }
- @Nullable
- public static Entity func_186050_a(NBTTagCompound p_186050_0_, World p_186050_1_, Chunk p_186050_2_) {
- Entity entity = func_186053_a(p_186050_0_, p_186050_1_);
- if(entity == null) {
- return null;
- } else {
- p_186050_2_.func_76612_a(entity);
- if(p_186050_0_.func_150297_b("Passengers", 9)) {
- NBTTagList nbttaglist = p_186050_0_.func_150295_c("Passengers", 10);
- for(int i = 0; i < nbttaglist.func_74745_c(); ++i) {
- Entity entity1 = func_186050_a(nbttaglist.func_150305_b(i), p_186050_1_, p_186050_2_);
- if(entity1 != null) {
- entity1.func_184205_a(entity, true);
- }
- }
- }
- return entity;
- }
- }
- @Nullable
- 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_) {
- Entity entity = func_186053_a(p_186054_0_, p_186054_1_);
- if(entity == null) {
- return null;
- } else {
- entity.func_70012_b(p_186054_2_, p_186054_4_, p_186054_6_, entity.field_70177_z, entity.field_70125_A);
- if(p_186054_8_ && !p_186054_1_.func_72838_d(entity)) {
- return null;
- } else {
- if(p_186054_0_.func_150297_b("Passengers", 9)) {
- NBTTagList nbttaglist = p_186054_0_.func_150295_c("Passengers", 10);
- for(int i = 0; i < nbttaglist.func_74745_c(); ++i) {
- 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_);
- if(entity1 != null) {
- entity1.func_184205_a(entity, true);
- }
- }
- }
- return entity;
- }
- }
- }
- @Nullable
- protected static Entity func_186053_a(NBTTagCompound p_186053_0_, World p_186053_1_) {
- try {
- return EntityList.func_75615_a(p_186053_0_, p_186053_1_);
- } catch (RuntimeException var3) {
- return null;
- }
- }
- public static void func_186052_a(Entity p_186052_0_, World p_186052_1_) {
- if(p_186052_1_.func_72838_d(p_186052_0_) && p_186052_0_.func_184207_aI()) {
- for(Entity entity : p_186052_0_.func_184188_bt()) {
- func_186052_a(entity, p_186052_1_);
- }
- }
- }
- @Nullable
- public static Entity func_186051_a(NBTTagCompound p_186051_0_, World p_186051_1_, boolean p_186051_2_) {
- Entity entity = func_186053_a(p_186051_0_, p_186051_1_);
- if(entity == null) {
- return null;
- } else if(p_186051_2_ && !p_186051_1_.func_72838_d(entity)) {
- return null;
- } else {
- if(p_186051_0_.func_150297_b("Passengers", 9)) {
- NBTTagList nbttaglist = p_186051_0_.func_150295_c("Passengers", 10);
- for(int i = 0; i < nbttaglist.func_74745_c(); ++i) {
- Entity entity1 = func_186051_a(nbttaglist.func_150305_b(i), p_186051_1_, p_186051_2_);
- if(entity1 != null) {
- entity1.func_184205_a(entity, true);
- }
- }
- }
- return entity;
- }
- }
- }
- Patching failed: minecraft\net\minecraft\world\gen\structure\StructureMineshaftPieces.java
- Hunk 1 failed! Cannot find hunk target
- }
- int k;
- - for(lvt_5_1_ = 0; k < this.field_74887_e.func_78883_b(); k = k + 4) {
- + for(k = 0; k < this.field_74887_e.func_78883_b(); k = k + 4) {
- k = k + p_74861_3_.nextInt(this.field_74887_e.func_78883_b());
- if (k + 3 > this.field_74887_e.func_78883_b()) {
- break;
- File state
- package net.minecraft.world.gen.structure;
- import com.google.common.collect.Lists;
- import java.util.List;
- import java.util.Random;
- import javax.annotation.Nullable;
- import net.minecraft.block.BlockPlanks;
- import net.minecraft.block.BlockRail;
- import net.minecraft.block.BlockRailBase;
- import net.minecraft.block.BlockTorch;
- import net.minecraft.block.material.Material;
- import net.minecraft.block.state.IBlockState;
- import net.minecraft.entity.EntityList;
- import net.minecraft.entity.item.EntityMinecartChest;
- import net.minecraft.entity.monster.EntityCaveSpider;
- import net.minecraft.init.Blocks;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.nbt.NBTTagList;
- import net.minecraft.tileentity.TileEntity;
- import net.minecraft.tileentity.TileEntityMobSpawner;
- import net.minecraft.util.EnumFacing;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.world.World;
- import net.minecraft.world.gen.structure.MapGenMineshaft;
- import net.minecraft.world.gen.structure.MapGenStructureIO;
- import net.minecraft.world.gen.structure.StructureBoundingBox;
- import net.minecraft.world.gen.structure.StructureComponent;
- import net.minecraft.world.gen.structure.template.TemplateManager;
- import net.minecraft.world.storage.loot.LootTableList;
- public class StructureMineshaftPieces {
- public static void func_143048_a() {
- MapGenStructureIO.func_143031_a(StructureMineshaftPieces.Corridor.class, "MSCorridor");
- MapGenStructureIO.func_143031_a(StructureMineshaftPieces.Cross.class, "MSCrossing");
- MapGenStructureIO.func_143031_a(StructureMineshaftPieces.Room.class, "MSRoom");
- MapGenStructureIO.func_143031_a(StructureMineshaftPieces.Stairs.class, "MSStairs");
- }
- 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_) {
- int i = p_189940_1_.nextInt(100);
- if(i >= 80) {
- 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_);
- if(structureboundingbox != null) {
- return new StructureMineshaftPieces.Cross(p_189940_6_, p_189940_1_, structureboundingbox, p_189940_5_, p_189940_7_);
- }
- } else if(i >= 70) {
- 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_);
- if(structureboundingbox1 != null) {
- return new StructureMineshaftPieces.Stairs(p_189940_6_, p_189940_1_, structureboundingbox1, p_189940_5_, p_189940_7_);
- }
- } else {
- 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_);
- if(structureboundingbox2 != null) {
- return new StructureMineshaftPieces.Corridor(p_189940_6_, p_189940_1_, structureboundingbox2, p_189940_5_, p_189940_7_);
- }
- }
- return null;
- }
- 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_) {
- if(p_189938_7_ > 8) {
- return null;
- } 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) {
- MapGenMineshaft.Type mapgenmineshaft$type = ((StructureMineshaftPieces.Peice)p_189938_0_).field_189920_a;
- 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);
- if(structuremineshaftpieces$peice != null) {
- p_189938_1_.add(structuremineshaftpieces$peice);
- structuremineshaftpieces$peice.func_74861_a(p_189938_0_, p_189938_1_, p_189938_2_);
- }
- return structuremineshaftpieces$peice;
- } else {
- return null;
- }
- }
- public static class Corridor extends StructureMineshaftPieces.Peice {
- private boolean field_74958_a;
- private boolean field_74956_b;
- private boolean field_74957_c;
- private int field_74955_d;
- public Corridor() {
- }
- protected void func_143012_a(NBTTagCompound p_143012_1_) {
- super.func_143012_a(p_143012_1_);
- p_143012_1_.func_74757_a("hr", this.field_74958_a);
- p_143012_1_.func_74757_a("sc", this.field_74956_b);
- p_143012_1_.func_74757_a("hps", this.field_74957_c);
- p_143012_1_.func_74768_a("Num", this.field_74955_d);
- }
- protected void func_143011_b(NBTTagCompound p_143011_1_, TemplateManager p_143011_2_) {
- super.func_143011_b(p_143011_1_, p_143011_2_);
- this.field_74958_a = p_143011_1_.func_74767_n("hr");
- this.field_74956_b = p_143011_1_.func_74767_n("sc");
- this.field_74957_c = p_143011_1_.func_74767_n("hps");
- this.field_74955_d = p_143011_1_.func_74762_e("Num");
- }
- public Corridor(int p_i47140_1_, Random p_i47140_2_, StructureBoundingBox p_i47140_3_, EnumFacing p_i47140_4_, MapGenMineshaft.Type p_i47140_5_) {
- super(p_i47140_1_, p_i47140_5_);
- this.func_186164_a(p_i47140_4_);
- this.field_74887_e = p_i47140_3_;
- this.field_74958_a = p_i47140_2_.nextInt(3) == 0;
- this.field_74956_b = !this.field_74958_a && p_i47140_2_.nextInt(23) == 0;
- if(this.func_186165_e().func_176740_k() == EnumFacing.Axis.Z) {
- this.field_74955_d = p_i47140_3_.func_78880_d() / 5;
- } else {
- this.field_74955_d = p_i47140_3_.func_78883_b() / 5;
- }
- }
- 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_) {
- StructureBoundingBox structureboundingbox = new StructureBoundingBox(p_175814_2_, p_175814_3_, p_175814_4_, p_175814_2_, p_175814_3_ + 2, p_175814_4_);
- int i;
- for(i = p_175814_1_.nextInt(3) + 2; i > 0; --i) {
- int j = i * 5;
- switch(p_175814_5_) {
- case NORTH:
- default:
- structureboundingbox.field_78893_d = p_175814_2_ + 2;
- structureboundingbox.field_78896_c = p_175814_4_ - (j - 1);
- break;
- case SOUTH:
- structureboundingbox.field_78893_d = p_175814_2_ + 2;
- structureboundingbox.field_78892_f = p_175814_4_ + (j - 1);
- break;
- case WEST:
- structureboundingbox.field_78897_a = p_175814_2_ - (j - 1);
- structureboundingbox.field_78892_f = p_175814_4_ + 2;
- break;
- case EAST:
- structureboundingbox.field_78893_d = p_175814_2_ + (j - 1);
- structureboundingbox.field_78892_f = p_175814_4_ + 2;
- }
- if(StructureComponent.func_74883_a(p_175814_0_, structureboundingbox) == null) {
- break;
- }
- }
- return i > 0?structureboundingbox:null;
- }
- public void func_74861_a(StructureComponent p_74861_1_, List<StructureComponent> p_74861_2_, Random p_74861_3_) {
- int i = this.func_74877_c();
- int j = p_74861_3_.nextInt(4);
- EnumFacing enumfacing = this.func_186165_e();
- if(enumfacing != null) {
- switch(enumfacing) {
- case NORTH:
- default:
- if(j <= 1) {
- 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);
- } else if(j == 2) {
- 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);
- } else {
- 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);
- }
- break;
- case SOUTH:
- if(j <= 1) {
- 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);
- } else if(j == 2) {
- 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);
- } else {
- 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);
- }
- break;
- case WEST:
- if(j <= 1) {
- 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);
- } else if(j == 2) {
- 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);
- } else {
- 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);
- }
- break;
- case EAST:
- if(j <= 1) {
- 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);
- } else if(j == 2) {
- 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);
- } else {
- 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);
- }
- }
- }
- if(i < 8) {
- if(enumfacing != EnumFacing.NORTH && enumfacing != EnumFacing.SOUTH) {
- for(int i1 = this.field_74887_e.field_78897_a + 3; i1 + 3 <= this.field_74887_e.field_78893_d; i1 += 5) {
- int j1 = p_74861_3_.nextInt(5);
- if(j1 == 0) {
- 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);
- } else if(j1 == 1) {
- 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);
- }
- }
- } else {
- for(int k = this.field_74887_e.field_78896_c + 3; k + 3 <= this.field_74887_e.field_78892_f; k += 5) {
- int l = p_74861_3_.nextInt(5);
- if(l == 0) {
- 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);
- } else if(l == 1) {
- 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);
- }
- }
- }
- }
- }
- 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_) {
- 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_));
- 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) {
- 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);
- this.func_175811_a(p_186167_1_, iblockstate, p_186167_4_, p_186167_5_, p_186167_6_, p_186167_2_);
- 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));
- entityminecartchest.func_184289_a(p_186167_7_, p_186167_3_.nextLong());
- p_186167_1_.func_72838_d(entityminecartchest);
- return true;
- } else {
- return false;
- }
- }
- public boolean func_74875_a(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) {
- if(this.func_74860_a(p_74875_1_, p_74875_3_)) {
- return false;
- } else {
- int i = 0;
- int j = 2;
- int k = 0;
- int l = 2;
- int i1 = this.field_74955_d * 5 - 1;
- IBlockState iblockstate = this.func_189917_F_();
- 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);
- 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);
- if(this.field_74956_b) {
- 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);
- }
- for(int j1 = 0; j1 < this.field_74955_d; ++j1) {
- int k1 = 2 + j1 * 5;
- this.func_189921_a(p_74875_1_, p_74875_3_, 0, 0, k1, 2, 2, p_74875_2_);
- this.func_189922_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.1F, 0, 2, k1 - 1);
- this.func_189922_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.1F, 2, 2, k1 - 1);
- this.func_189922_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.1F, 0, 2, k1 + 1);
- this.func_189922_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.1F, 2, 2, k1 + 1);
- this.func_189922_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.05F, 0, 2, k1 - 2);
- this.func_189922_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.05F, 2, 2, k1 - 2);
- this.func_189922_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.05F, 0, 2, k1 + 2);
- this.func_189922_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.05F, 2, 2, k1 + 2);
- if(p_74875_2_.nextInt(100) == 0) {
- this.func_186167_a(p_74875_1_, p_74875_3_, p_74875_2_, 2, 0, k1 - 1, LootTableList.field_186424_f);
- }
- if(p_74875_2_.nextInt(100) == 0) {
- this.func_186167_a(p_74875_1_, p_74875_3_, p_74875_2_, 0, 0, k1 + 1, LootTableList.field_186424_f);
- }
- if(this.field_74956_b && !this.field_74957_c) {
- int l1 = this.func_74862_a(0);
- int i2 = k1 - 1 + p_74875_2_.nextInt(3);
- int j2 = this.func_74865_a(1, i2);
- int k2 = this.func_74873_b(1, i2);
- BlockPos blockpos = new BlockPos(j2, l1, k2);
- if(p_74875_3_.func_175898_b(blockpos) && this.func_189916_b(p_74875_1_, 1, 0, i2, p_74875_3_) < 8) {
- this.field_74957_c = true;
- p_74875_1_.func_180501_a(blockpos, Blocks.field_150474_ac.func_176223_P(), 2);
- TileEntity tileentity = p_74875_1_.func_175625_s(blockpos);
- if(tileentity instanceof TileEntityMobSpawner) {
- ((TileEntityMobSpawner)tileentity).func_145881_a().func_190894_a(EntityList.func_191306_a(EntityCaveSpider.class));
- }
- }
- }
- }
- for(int l2 = 0; l2 <= 2; ++l2) {
- for(int i3 = 0; i3 <= i1; ++i3) {
- int k3 = -1;
- IBlockState iblockstate3 = this.func_175807_a(p_74875_1_, l2, -1, i3, p_74875_3_);
- if(iblockstate3.func_185904_a() == Material.field_151579_a && this.func_189916_b(p_74875_1_, l2, -1, i3, p_74875_3_) < 8) {
- int l3 = -1;
- this.func_175811_a(p_74875_1_, iblockstate, l2, -1, i3, p_74875_3_);
- }
- }
- }
- if(this.field_74958_a) {
- IBlockState iblockstate1 = Blocks.field_150448_aq.func_176223_P().func_177226_a(BlockRail.field_176565_b, BlockRailBase.EnumRailDirection.NORTH_SOUTH);
- for(int j3 = 0; j3 <= i1; ++j3) {
- IBlockState iblockstate2 = this.func_175807_a(p_74875_1_, 1, -1, j3, p_74875_3_);
- if(iblockstate2.func_185904_a() != Material.field_151579_a && iblockstate2.func_185913_b()) {
- float f = this.func_189916_b(p_74875_1_, 1, 0, j3, p_74875_3_) > 8?0.9F:0.7F;
- this.func_175809_a(p_74875_1_, p_74875_3_, p_74875_2_, f, 1, 0, j3, iblockstate1);
- }
- }
- }
- return true;
- }
- }
- 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_) {
- if(this.func_189918_a(p_189921_1_, p_189921_2_, p_189921_3_, p_189921_7_, p_189921_6_, p_189921_5_)) {
- IBlockState iblockstate = this.func_189917_F_();
- IBlockState iblockstate1 = this.func_189919_b();
- IBlockState iblockstate2 = Blocks.field_150350_a.func_176223_P();
- 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);
- 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);
- if(p_189921_8_.nextInt(4) == 0) {
- 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);
- 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);
- } else {
- 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);
- 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));
- 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));
- }
- }
- }
- 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_) {
- if(this.func_189916_b(p_189922_1_, p_189922_5_, p_189922_6_, p_189922_7_, p_189922_2_) < 8) {
- 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());
- }
- }
- }
- public static class Cross extends StructureMineshaftPieces.Peice {
- private EnumFacing field_74953_a;
- private boolean field_74952_b;
- public Cross() {
- }
- protected void func_143012_a(NBTTagCompound p_143012_1_) {
- super.func_143012_a(p_143012_1_);
- p_143012_1_.func_74757_a("tf", this.field_74952_b);
- p_143012_1_.func_74768_a("D", this.field_74953_a.func_176736_b());
- }
- protected void func_143011_b(NBTTagCompound p_143011_1_, TemplateManager p_143011_2_) {
- super.func_143011_b(p_143011_1_, p_143011_2_);
- this.field_74952_b = p_143011_1_.func_74767_n("tf");
- this.field_74953_a = EnumFacing.func_176731_b(p_143011_1_.func_74762_e("D"));
- }
- public Cross(int p_i47139_1_, Random p_i47139_2_, StructureBoundingBox p_i47139_3_, @Nullable EnumFacing p_i47139_4_, MapGenMineshaft.Type p_i47139_5_) {
- super(p_i47139_1_, p_i47139_5_);
- this.field_74953_a = p_i47139_4_;
- this.field_74887_e = p_i47139_3_;
- this.field_74952_b = p_i47139_3_.func_78882_c() > 3;
- }
- 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_) {
- StructureBoundingBox structureboundingbox = new StructureBoundingBox(p_175813_2_, p_175813_3_, p_175813_4_, p_175813_2_, p_175813_3_ + 2, p_175813_4_);
- if(p_175813_1_.nextInt(4) == 0) {
- structureboundingbox.field_78894_e += 4;
- }
- switch(p_175813_5_) {
- case NORTH:
- default:
- structureboundingbox.field_78897_a = p_175813_2_ - 1;
- structureboundingbox.field_78893_d = p_175813_2_ + 3;
- structureboundingbox.field_78896_c = p_175813_4_ - 4;
- break;
- case SOUTH:
- structureboundingbox.field_78897_a = p_175813_2_ - 1;
- structureboundingbox.field_78893_d = p_175813_2_ + 3;
- structureboundingbox.field_78892_f = p_175813_4_ + 3 + 1;
- break;
- case WEST:
- structureboundingbox.field_78897_a = p_175813_2_ - 4;
- structureboundingbox.field_78896_c = p_175813_4_ - 1;
- structureboundingbox.field_78892_f = p_175813_4_ + 3;
- break;
- case EAST:
- structureboundingbox.field_78893_d = p_175813_2_ + 3 + 1;
- structureboundingbox.field_78896_c = p_175813_4_ - 1;
- structureboundingbox.field_78892_f = p_175813_4_ + 3;
- }
- return StructureComponent.func_74883_a(p_175813_0_, structureboundingbox) != null?null:structureboundingbox;
- }
- public void func_74861_a(StructureComponent p_74861_1_, List<StructureComponent> p_74861_2_, Random p_74861_3_) {
- int i = this.func_74877_c();
- switch(this.field_74953_a) {
- case NORTH:
- default:
- 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);
- 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);
- 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);
- break;
- case SOUTH:
- 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);
- 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);
- 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);
- break;
- case WEST:
- 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);
- 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);
- 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);
- break;
- case EAST:
- 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);
- 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);
- 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);
- }
- if(this.field_74952_b) {
- if(p_74861_3_.nextBoolean()) {
- 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);
- }
- if(p_74861_3_.nextBoolean()) {
- 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);
- }
- if(p_74861_3_.nextBoolean()) {
- 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);
- }
- if(p_74861_3_.nextBoolean()) {
- 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);
- }
- }
- }
- public boolean func_74875_a(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) {
- if(this.func_74860_a(p_74875_1_, p_74875_3_)) {
- return false;
- } else {
- IBlockState iblockstate = this.func_189917_F_();
- if(this.field_74952_b) {
- 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);
- 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);
- 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);
- 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);
- 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);
- } else {
- 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);
- 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);
- }
- 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);
- 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);
- 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);
- 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);
- for(int i = this.field_74887_e.field_78897_a; i <= this.field_74887_e.field_78893_d; ++i) {
- for(int j = this.field_74887_e.field_78896_c; j <= this.field_74887_e.field_78892_f; ++j) {
- 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) {
- this.func_175811_a(p_74875_1_, iblockstate, i, this.field_74887_e.field_78895_b - 1, j, p_74875_3_);
- }
- }
- }
- return true;
- }
- }
- 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_) {
- 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) {
- 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);
- }
- }
- }
- abstract static class Peice extends StructureComponent {
- protected MapGenMineshaft.Type field_189920_a;
- public Peice() {
- }
- public Peice(int p_i47138_1_, MapGenMineshaft.Type p_i47138_2_) {
- super(p_i47138_1_);
- this.field_189920_a = p_i47138_2_;
- }
- protected void func_143012_a(NBTTagCompound p_143012_1_) {
- p_143012_1_.func_74768_a("MST", this.field_189920_a.ordinal());
- }
- protected void func_143011_b(NBTTagCompound p_143011_1_, TemplateManager p_143011_2_) {
- this.field_189920_a = MapGenMineshaft.Type.func_189910_a(p_143011_1_.func_74762_e("MST"));
- }
- protected IBlockState func_189917_F_() {
- switch(this.field_189920_a) {
- case NORMAL:
- default:
- return Blocks.field_150344_f.func_176223_P();
- case MESA:
- return Blocks.field_150344_f.func_176223_P().func_177226_a(BlockPlanks.field_176383_a, BlockPlanks.EnumType.DARK_OAK);
- }
- }
- protected IBlockState func_189919_b() {
- switch(this.field_189920_a) {
- case NORMAL:
- default:
- return Blocks.field_180407_aO.func_176223_P();
- case MESA:
- return Blocks.field_180406_aS.func_176223_P();
- }
- }
- 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_) {
- for(int i = p_189918_3_; i <= p_189918_4_; ++i) {
- 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) {
- return false;
- }
- }
- return true;
- }
- }
- public static class Room extends StructureMineshaftPieces.Peice {
- private final List<StructureBoundingBox> field_74949_a = Lists.<StructureBoundingBox>newLinkedList();
- public Room() {
- }
- public Room(int p_i47137_1_, Random p_i47137_2_, int p_i47137_3_, int p_i47137_4_, MapGenMineshaft.Type p_i47137_5_) {
- super(p_i47137_1_, p_i47137_5_);
- this.field_189920_a = p_i47137_5_;
- 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));
- }
- public void func_74861_a(StructureComponent p_74861_1_, List<StructureComponent> p_74861_2_, Random p_74861_3_) {
- int i = this.func_74877_c();
- int k = this.field_74887_e.func_78882_c() - 3 - 1;
- if(k <= 0) {
- k = 1;
- }
- int l;
- for(int j = 0; j < this.field_74887_e.func_78883_b(); j = l + 4) {
- l = j + p_74861_3_.nextInt(this.field_74887_e.func_78883_b());
- if(l + 3 > this.field_74887_e.func_78883_b()) {
- break;
- }
- 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);
- if(structuremineshaftpieces$peice != null) {
- StructureBoundingBox structureboundingbox = structuremineshaftpieces$peice.func_74874_b();
- 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));
- }
- }
- for(int i1 = 0; i1 < this.field_74887_e.func_78883_b(); i1 = l + 4) {
- l = i1 + p_74861_3_.nextInt(this.field_74887_e.func_78883_b());
- if(l + 3 > this.field_74887_e.func_78883_b()) {
- break;
- }
- 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);
- if(structuremineshaftpieces$peice1 != null) {
- StructureBoundingBox structureboundingbox1 = structuremineshaftpieces$peice1.func_74874_b();
- 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));
- }
- }
- for(int j1 = 0; j1 < this.field_74887_e.func_78880_d(); j1 = l + 4) {
- l = j1 + p_74861_3_.nextInt(this.field_74887_e.func_78880_d());
- if(l + 3 > this.field_74887_e.func_78880_d()) {
- break;
- }
- 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);
- if(structuremineshaftpieces$peice2 != null) {
- StructureBoundingBox structureboundingbox2 = structuremineshaftpieces$peice2.func_74874_b();
- 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));
- }
- }
- for(int k1 = 0; k1 < this.field_74887_e.func_78880_d(); k1 = l + 4) {
- l = k1 + p_74861_3_.nextInt(this.field_74887_e.func_78880_d());
- if(l + 3 > this.field_74887_e.func_78880_d()) {
- break;
- }
- 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);
- if(structurecomponent != null) {
- StructureBoundingBox structureboundingbox3 = structurecomponent.func_74874_b();
- 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));
- }
- }
- }
- public boolean func_74875_a(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) {
- if(this.func_74860_a(p_74875_1_, p_74875_3_)) {
- return false;
- } else {
- 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);
- 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);
- for(StructureBoundingBox structureboundingbox : this.field_74949_a) {
- 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);
- }
- 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);
- return true;
- }
- }
- public void func_181138_a(int p_181138_1_, int p_181138_2_, int p_181138_3_) {
- super.func_181138_a(p_181138_1_, p_181138_2_, p_181138_3_);
- for(StructureBoundingBox structureboundingbox : this.field_74949_a) {
- structureboundingbox.func_78886_a(p_181138_1_, p_181138_2_, p_181138_3_);
- }
- }
- protected void func_143012_a(NBTTagCompound p_143012_1_) {
- super.func_143012_a(p_143012_1_);
- NBTTagList nbttaglist = new NBTTagList();
- for(StructureBoundingBox structureboundingbox : this.field_74949_a) {
- nbttaglist.func_74742_a(structureboundingbox.func_151535_h());
- }
- p_143012_1_.func_74782_a("Entrances", nbttaglist);
- }
- protected void func_143011_b(NBTTagCompound p_143011_1_, TemplateManager p_143011_2_) {
- super.func_143011_b(p_143011_1_, p_143011_2_);
- NBTTagList nbttaglist = p_143011_1_.func_150295_c("Entrances", 11);
- for(int i = 0; i < nbttaglist.func_74745_c(); ++i) {
- this.field_74949_a.add(new StructureBoundingBox(nbttaglist.func_150306_c(i)));
- }
- }
- }
- public static class Stairs extends StructureMineshaftPieces.Peice {
- public Stairs() {
- }
- public Stairs(int p_i47136_1_, Random p_i47136_2_, StructureBoundingBox p_i47136_3_, EnumFacing p_i47136_4_, MapGenMineshaft.Type p_i47136_5_) {
- super(p_i47136_1_, p_i47136_5_);
- this.func_186164_a(p_i47136_4_);
- this.field_74887_e = p_i47136_3_;
- }
- 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_) {
- StructureBoundingBox structureboundingbox = new StructureBoundingBox(p_175812_2_, p_175812_3_ - 5, p_175812_4_, p_175812_2_, p_175812_3_ + 2, p_175812_4_);
- switch(p_175812_5_) {
- case NORTH:
- default:
- structureboundingbox.field_78893_d = p_175812_2_ + 2;
- structureboundingbox.field_78896_c = p_175812_4_ - 8;
- break;
- case SOUTH:
- structureboundingbox.field_78893_d = p_175812_2_ + 2;
- structureboundingbox.field_78892_f = p_175812_4_ + 8;
- break;
- case WEST:
- structureboundingbox.field_78897_a = p_175812_2_ - 8;
- structureboundingbox.field_78892_f = p_175812_4_ + 2;
- break;
- case EAST:
- structureboundingbox.field_78893_d = p_175812_2_ + 8;
- structureboundingbox.field_78892_f = p_175812_4_ + 2;
- }
- return StructureComponent.func_74883_a(p_175812_0_, structureboundingbox) != null?null:structureboundingbox;
- }
- public void func_74861_a(StructureComponent p_74861_1_, List<StructureComponent> p_74861_2_, Random p_74861_3_) {
- int i = this.func_74877_c();
- EnumFacing enumfacing = this.func_186165_e();
- if(enumfacing != null) {
- switch(enumfacing) {
- case NORTH:
- default:
- 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);
- break;
- case SOUTH:
- 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);
- break;
- case WEST:
- 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);
- break;
- case EAST:
- 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);
- }
- }
- }
- public boolean func_74875_a(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) {
- if(this.func_74860_a(p_74875_1_, p_74875_3_)) {
- return false;
- } else {
- 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);
- 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);
- for(int i = 0; i < 5; ++i) {
- 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);
- }
- return true;
- }
- }
- }
- }
- Patching failed: minecraft\net\minecraft\world\storage\loot\functions\LootFunctionManager.java
- Hunk 1 failed! Cannot find hunk target
- public static <T extends LootFunction> void func_186582_a(LootFunction.Serializer<? extends T> p_186582_0_) {
- ResourceLocation resourcelocation = p_186582_0_.func_186529_a();
- - Class<T> oclass = p_186582_0_.func_186531_b();
- + Class<T> oclass = (Class<T>)p_186582_0_.func_186531_b();
- if (field_186584_a.containsKey(resourcelocation)) {
- throw new IllegalArgumentException("Can't re-register item function name " + resourcelocation);
- } else if (field_186585_b.containsKey(oclass)) {
- File state
- package net.minecraft.world.storage.loot.functions;
- import com.google.common.collect.Maps;
- import com.google.gson.JsonDeserializationContext;
- import com.google.gson.JsonDeserializer;
- import com.google.gson.JsonElement;
- import com.google.gson.JsonObject;
- import com.google.gson.JsonParseException;
- import com.google.gson.JsonSerializationContext;
- import com.google.gson.JsonSerializer;
- import com.google.gson.JsonSyntaxException;
- import java.lang.reflect.Type;
- import java.util.Map;
- import net.minecraft.util.JsonUtils;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.world.storage.loot.conditions.LootCondition;
- import net.minecraft.world.storage.loot.functions.EnchantRandomly;
- import net.minecraft.world.storage.loot.functions.EnchantWithLevels;
- import net.minecraft.world.storage.loot.functions.LootFunction;
- import net.minecraft.world.storage.loot.functions.LootingEnchantBonus;
- import net.minecraft.world.storage.loot.functions.SetAttributes;
- import net.minecraft.world.storage.loot.functions.SetCount;
- import net.minecraft.world.storage.loot.functions.SetDamage;
- import net.minecraft.world.storage.loot.functions.SetMetadata;
- import net.minecraft.world.storage.loot.functions.SetNBT;
- import net.minecraft.world.storage.loot.functions.Smelt;
- public class LootFunctionManager {
- private static final Map<ResourceLocation, LootFunction.Serializer<?>> field_186584_a = Maps.<ResourceLocation, LootFunction.Serializer<?>>newHashMap();
- private static final Map<Class<? extends LootFunction>, LootFunction.Serializer<?>> field_186585_b = Maps.<Class<? extends LootFunction>, LootFunction.Serializer<?>>newHashMap();
- public static <T extends LootFunction> void func_186582_a(LootFunction.Serializer<? extends T> p_186582_0_) {
- ResourceLocation resourcelocation = p_186582_0_.func_186529_a();
- Class<T> oclass = p_186582_0_.func_186531_b();
- if(field_186584_a.containsKey(resourcelocation)) {
- throw new IllegalArgumentException("Can\'t re-register item function name " + resourcelocation);
- } else if(field_186585_b.containsKey(oclass)) {
- throw new IllegalArgumentException("Can\'t re-register item function class " + oclass.getName());
- } else {
- field_186584_a.put(resourcelocation, p_186582_0_);
- field_186585_b.put(oclass, p_186582_0_);
- }
- }
- public static LootFunction.Serializer<?> func_186583_a(ResourceLocation p_186583_0_) {
- LootFunction.Serializer<?> serializer = (LootFunction.Serializer)field_186584_a.get(p_186583_0_);
- if(serializer == null) {
- throw new IllegalArgumentException("Unknown loot item function \'" + p_186583_0_ + "\'");
- } else {
- return serializer;
- }
- }
- public static <T extends LootFunction> LootFunction.Serializer<T> func_186581_a(T p_186581_0_) {
- LootFunction.Serializer<T> serializer = (LootFunction.Serializer)field_186585_b.get(p_186581_0_.getClass());
- if(serializer == null) {
- throw new IllegalArgumentException("Unknown loot item function " + p_186581_0_);
- } else {
- return serializer;
- }
- }
- static {
- func_186582_a(new SetCount.Serializer());
- func_186582_a(new SetMetadata.Serializer());
- func_186582_a(new EnchantWithLevels.Serializer());
- func_186582_a(new EnchantRandomly.Serializer());
- func_186582_a(new SetNBT.Serializer());
- func_186582_a(new Smelt.Serializer());
- func_186582_a(new LootingEnchantBonus.Serializer());
- func_186582_a(new SetDamage.Serializer());
- func_186582_a(new SetAttributes.Serializer());
- }
- public static class Serializer implements JsonDeserializer<LootFunction>, JsonSerializer<LootFunction> {
- public LootFunction deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException {
- JsonObject jsonobject = JsonUtils.func_151210_l(p_deserialize_1_, "function");
- ResourceLocation resourcelocation = new ResourceLocation(JsonUtils.func_151200_h(jsonobject, "function"));
- LootFunction.Serializer<?> serializer;
- try {
- serializer = LootFunctionManager.func_186583_a(resourcelocation);
- } catch (IllegalArgumentException var8) {
- throw new JsonSyntaxException("Unknown function \'" + resourcelocation + "\'");
- }
- return serializer.func_186530_b(jsonobject, p_deserialize_3_, (LootCondition[])JsonUtils.func_188177_a(jsonobject, "conditions", new LootCondition[0], p_deserialize_3_, LootCondition[].class));
- }
- public JsonElement serialize(LootFunction p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) {
- LootFunction.Serializer<LootFunction> serializer = LootFunctionManager.<LootFunction>func_186581_a(p_serialize_1_);
- JsonObject jsonobject = new JsonObject();
- serializer.func_186532_a(jsonobject, p_serialize_1_, p_serialize_3_);
- jsonobject.addProperty("function", serializer.func_186529_a().toString());
- if(p_serialize_1_.func_186554_a() != null && p_serialize_1_.func_186554_a().length > 0) {
- jsonobject.add("conditions", p_serialize_3_.serialize(p_serialize_1_.func_186554_a()));
- }
- return jsonobject;
- }
- }
- }
- Patching failed: minecraft\net\minecraft\world\storage\loot\conditions\LootConditionManager.java
- Hunk 1 failed! Cannot find hunk target
- public static <T extends LootCondition> void func_186639_a(LootCondition.Serializer<? extends T> p_186639_0_) {
- ResourceLocation resourcelocation = p_186639_0_.func_186602_a();
- - Class<T> oclass = p_186639_0_.func_186604_b();
- + Class<T> oclass = (Class<T>)p_186639_0_.func_186604_b();
- if (field_186642_a.containsKey(resourcelocation)) {
- throw new IllegalArgumentException("Can't re-register item condition name " + resourcelocation);
- } else if (field_186643_b.containsKey(oclass)) {
- File state
- package net.minecraft.world.storage.loot.conditions;
- import com.google.common.collect.Maps;
- import com.google.gson.JsonDeserializationContext;
- import com.google.gson.JsonDeserializer;
- import com.google.gson.JsonElement;
- import com.google.gson.JsonObject;
- import com.google.gson.JsonParseException;
- import com.google.gson.JsonSerializationContext;
- import com.google.gson.JsonSerializer;
- import com.google.gson.JsonSyntaxException;
- import java.lang.reflect.Type;
- import java.util.Map;
- import java.util.Random;
- import javax.annotation.Nullable;
- import net.minecraft.util.JsonUtils;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.world.storage.loot.LootContext;
- import net.minecraft.world.storage.loot.conditions.EntityHasProperty;
- import net.minecraft.world.storage.loot.conditions.EntityHasScore;
- import net.minecraft.world.storage.loot.conditions.KilledByPlayer;
- import net.minecraft.world.storage.loot.conditions.LootCondition;
- import net.minecraft.world.storage.loot.conditions.RandomChance;
- import net.minecraft.world.storage.loot.conditions.RandomChanceWithLooting;
- public class LootConditionManager {
- private static final Map<ResourceLocation, LootCondition.Serializer<?>> field_186642_a = Maps.<ResourceLocation, LootCondition.Serializer<?>>newHashMap();
- private static final Map<Class<? extends LootCondition>, LootCondition.Serializer<?>> field_186643_b = Maps.<Class<? extends LootCondition>, LootCondition.Serializer<?>>newHashMap();
- public static <T extends LootCondition> void func_186639_a(LootCondition.Serializer<? extends T> p_186639_0_) {
- ResourceLocation resourcelocation = p_186639_0_.func_186602_a();
- Class<T> oclass = p_186639_0_.func_186604_b();
- if(field_186642_a.containsKey(resourcelocation)) {
- throw new IllegalArgumentException("Can\'t re-register item condition name " + resourcelocation);
- } else if(field_186643_b.containsKey(oclass)) {
- throw new IllegalArgumentException("Can\'t re-register item condition class " + oclass.getName());
- } else {
- field_186642_a.put(resourcelocation, p_186639_0_);
- field_186643_b.put(oclass, p_186639_0_);
- }
- }
- public static boolean func_186638_a(@Nullable LootCondition[] p_186638_0_, Random p_186638_1_, LootContext p_186638_2_) {
- if(p_186638_0_ == null) {
- return true;
- } else {
- for(LootCondition lootcondition : p_186638_0_) {
- if(!lootcondition.func_186618_a(p_186638_1_, p_186638_2_)) {
- return false;
- }
- }
- return true;
- }
- }
- public static LootCondition.Serializer<?> func_186641_a(ResourceLocation p_186641_0_) {
- LootCondition.Serializer<?> serializer = (LootCondition.Serializer)field_186642_a.get(p_186641_0_);
- if(serializer == null) {
- throw new IllegalArgumentException("Unknown loot item condition \'" + p_186641_0_ + "\'");
- } else {
- return serializer;
- }
- }
- public static <T extends LootCondition> LootCondition.Serializer<T> func_186640_a(T p_186640_0_) {
- LootCondition.Serializer<T> serializer = (LootCondition.Serializer)field_186643_b.get(p_186640_0_.getClass());
- if(serializer == null) {
- throw new IllegalArgumentException("Unknown loot item condition " + p_186640_0_);
- } else {
- return serializer;
- }
- }
- static {
- func_186639_a(new RandomChance.Serializer());
- func_186639_a(new RandomChanceWithLooting.Serializer());
- func_186639_a(new EntityHasProperty.Serializer());
- func_186639_a(new KilledByPlayer.Serializer());
- func_186639_a(new EntityHasScore.Serializer());
- }
- public static class Serializer implements JsonDeserializer<LootCondition>, JsonSerializer<LootCondition> {
- public LootCondition deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException {
- JsonObject jsonobject = JsonUtils.func_151210_l(p_deserialize_1_, "condition");
- ResourceLocation resourcelocation = new ResourceLocation(JsonUtils.func_151200_h(jsonobject, "condition"));
- LootCondition.Serializer<?> serializer;
- try {
- serializer = LootConditionManager.func_186641_a(resourcelocation);
- } catch (IllegalArgumentException var8) {
- throw new JsonSyntaxException("Unknown condition \'" + resourcelocation + "\'");
- }
- return serializer.func_186603_b(jsonobject, p_deserialize_3_);
- }
- public JsonElement serialize(LootCondition p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) {
- LootCondition.Serializer<LootCondition> serializer = LootConditionManager.<LootCondition>func_186640_a(p_serialize_1_);
- JsonObject jsonobject = new JsonObject();
- serializer.func_186605_a(jsonobject, p_serialize_1_, p_serialize_3_);
- jsonobject.addProperty("condition", serializer.func_186602_a().toString());
- return jsonobject;
- }
- }
- }
- Patching failed: minecraft\net\minecraft\world\storage\loot\properties\EntityPropertyManager.java
- Hunk 1 failed! Cannot find hunk target
- public static <T extends EntityProperty> void func_186644_a(EntityProperty.Serializer<? extends T> p_186644_0_) {
- ResourceLocation resourcelocation = p_186644_0_.func_186649_a();
- - Class<T> oclass = p_186644_0_.func_186651_b();
- + Class<T> oclass = (Class<T>)p_186644_0_.func_186651_b();
- if (field_186647_a.containsKey(resourcelocation)) {
- throw new IllegalArgumentException("Can't re-register entity property name " + resourcelocation);
- } else if (field_186648_b.containsKey(oclass)) {
- File state
- package net.minecraft.world.storage.loot.properties;
- import com.google.common.collect.Maps;
- import java.util.Map;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.world.storage.loot.properties.EntityOnFire;
- import net.minecraft.world.storage.loot.properties.EntityProperty;
- public class EntityPropertyManager {
- private static final Map<ResourceLocation, EntityProperty.Serializer<?>> field_186647_a = Maps.<ResourceLocation, EntityProperty.Serializer<?>>newHashMap();
- private static final Map<Class<? extends EntityProperty>, EntityProperty.Serializer<?>> field_186648_b = Maps.<Class<? extends EntityProperty>, EntityProperty.Serializer<?>>newHashMap();
- public static <T extends EntityProperty> void func_186644_a(EntityProperty.Serializer<? extends T> p_186644_0_) {
- ResourceLocation resourcelocation = p_186644_0_.func_186649_a();
- Class<T> oclass = p_186644_0_.func_186651_b();
- if(field_186647_a.containsKey(resourcelocation)) {
- throw new IllegalArgumentException("Can\'t re-register entity property name " + resourcelocation);
- } else if(field_186648_b.containsKey(oclass)) {
- throw new IllegalArgumentException("Can\'t re-register entity property class " + oclass.getName());
- } else {
- field_186647_a.put(resourcelocation, p_186644_0_);
- field_186648_b.put(oclass, p_186644_0_);
- }
- }
- public static EntityProperty.Serializer<?> func_186646_a(ResourceLocation p_186646_0_) {
- EntityProperty.Serializer<?> serializer = (EntityProperty.Serializer)field_186647_a.get(p_186646_0_);
- if(serializer == null) {
- throw new IllegalArgumentException("Unknown loot entity property \'" + p_186646_0_ + "\'");
- } else {
- return serializer;
- }
- }
- public static <T extends EntityProperty> EntityProperty.Serializer<T> func_186645_a(T p_186645_0_) {
- EntityProperty.Serializer<?> serializer = (EntityProperty.Serializer)field_186648_b.get(p_186645_0_.getClass());
- if(serializer == null) {
- throw new IllegalArgumentException("Unknown loot entity property " + p_186645_0_);
- } else {
- return serializer;
- }
- }
- static {
- func_186644_a(new EntityOnFire.Serializer());
- }
- }
- Hunk 2 failed! Cannot find hunk target
- if (serializer == null) {
- throw new IllegalArgumentException("Unknown loot entity property " + p_186645_0_);
- } else {
- - return serializer;
- + return (EntityProperty.Serializer<T>)serializer;
- }
- }
- File state
- package net.minecraft.world.storage.loot.properties;
- import com.google.common.collect.Maps;
- import java.util.Map;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.world.storage.loot.properties.EntityOnFire;
- import net.minecraft.world.storage.loot.properties.EntityProperty;
- public class EntityPropertyManager {
- private static final Map<ResourceLocation, EntityProperty.Serializer<?>> field_186647_a = Maps.<ResourceLocation, EntityProperty.Serializer<?>>newHashMap();
- private static final Map<Class<? extends EntityProperty>, EntityProperty.Serializer<?>> field_186648_b = Maps.<Class<? extends EntityProperty>, EntityProperty.Serializer<?>>newHashMap();
- public static <T extends EntityProperty> void func_186644_a(EntityProperty.Serializer<? extends T> p_186644_0_) {
- ResourceLocation resourcelocation = p_186644_0_.func_186649_a();
- Class<T> oclass = p_186644_0_.func_186651_b();
- if(field_186647_a.containsKey(resourcelocation)) {
- throw new IllegalArgumentException("Can\'t re-register entity property name " + resourcelocation);
- } else if(field_186648_b.containsKey(oclass)) {
- throw new IllegalArgumentException("Can\'t re-register entity property class " + oclass.getName());
- } else {
- field_186647_a.put(resourcelocation, p_186644_0_);
- field_186648_b.put(oclass, p_186644_0_);
- }
- }
- public static EntityProperty.Serializer<?> func_186646_a(ResourceLocation p_186646_0_) {
- EntityProperty.Serializer<?> serializer = (EntityProperty.Serializer)field_186647_a.get(p_186646_0_);
- if(serializer == null) {
- throw new IllegalArgumentException("Unknown loot entity property \'" + p_186646_0_ + "\'");
- } else {
- return serializer;
- }
- }
- public static <T extends EntityProperty> EntityProperty.Serializer<T> func_186645_a(T p_186645_0_) {
- EntityProperty.Serializer<?> serializer = (EntityProperty.Serializer)field_186648_b.get(p_186645_0_.getClass());
- if(serializer == null) {
- throw new IllegalArgumentException("Unknown loot entity property " + p_186645_0_);
- } else {
- return serializer;
- }
- }
- static {
- func_186644_a(new EntityOnFire.Serializer());
- }
- }
- Patching failed: minecraft\net\minecraft\client\settings\KeyBinding.java
- Hunk 1 failed! Cannot find hunk target
- public static Supplier<String> func_193626_b(String p_193626_0_) {
- KeyBinding keybinding = field_74516_a.get(p_193626_0_);
- return keybinding == null ? () -> {
- - return p_193624_0_;
- + return p_193626_0_;
- } : () -> {
- - return GameSettings.func_74298_c(p_193625_0_.func_151463_i());
- + return GameSettings.func_74298_c(keybinding.func_151463_i());
- };
- }
- File state
- package net.minecraft.client.settings;
- import com.google.common.collect.Maps;
- import com.google.common.collect.Sets;
- import java.util.Map;
- import java.util.Set;
- import java.util.function.Supplier;
- import net.minecraft.client.resources.I18n;
- import net.minecraft.client.settings.GameSettings;
- import net.minecraft.util.IntHashMap;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- import org.lwjgl.input.Keyboard;
- @SideOnly(Side.CLIENT)
- public class KeyBinding implements Comparable<KeyBinding> {
- private static final Map<String, KeyBinding> field_74516_a = Maps.<String, KeyBinding>newHashMap();
- private static final IntHashMap<KeyBinding> field_74514_b = new IntHashMap();
- private static final Set<String> field_151473_c = Sets.<String>newHashSet();
- private static final Map<String, Integer> field_193627_d = Maps.<String, Integer>newHashMap();
- private final String field_74515_c;
- private final int field_151472_e;
- private final String field_151471_f;
- private int field_74512_d;
- private boolean field_74513_e;
- private int field_151474_i;
- public static void func_74507_a(int p_74507_0_) {
- if(p_74507_0_ != 0) {
- KeyBinding keybinding = (KeyBinding)field_74514_b.func_76041_a(p_74507_0_);
- if(keybinding != null) {
- ++keybinding.field_151474_i;
- }
- }
- }
- public static void func_74510_a(int p_74510_0_, boolean p_74510_1_) {
- if(p_74510_0_ != 0) {
- KeyBinding keybinding = (KeyBinding)field_74514_b.func_76041_a(p_74510_0_);
- if(keybinding != null) {
- keybinding.field_74513_e = p_74510_1_;
- }
- }
- }
- public static void func_186704_a() {
- for(KeyBinding keybinding : field_74516_a.values()) {
- try {
- func_74510_a(keybinding.field_74512_d, keybinding.field_74512_d < 256 && Keyboard.isKeyDown(keybinding.field_74512_d));
- } catch (IndexOutOfBoundsException var3) {
- ;
- }
- }
- }
- public static void func_74506_a() {
- for(KeyBinding keybinding : field_74516_a.values()) {
- keybinding.func_74505_d();
- }
- }
- public static void func_74508_b() {
- field_74514_b.func_76046_c();
- for(KeyBinding keybinding : field_74516_a.values()) {
- field_74514_b.func_76038_a(keybinding.field_74512_d, keybinding);
- }
- }
- public static Set<String> func_151467_c() {
- return field_151473_c;
- }
- public KeyBinding(String p_i45001_1_, int p_i45001_2_, String p_i45001_3_) {
- this.field_74515_c = p_i45001_1_;
- this.field_74512_d = p_i45001_2_;
- this.field_151472_e = p_i45001_2_;
- this.field_151471_f = p_i45001_3_;
- field_74516_a.put(p_i45001_1_, this);
- field_74514_b.func_76038_a(p_i45001_2_, this);
- field_151473_c.add(p_i45001_3_);
- }
- public boolean func_151470_d() {
- return this.field_74513_e;
- }
- public String func_151466_e() {
- return this.field_151471_f;
- }
- public boolean func_151468_f() {
- if(this.field_151474_i == 0) {
- return false;
- } else {
- --this.field_151474_i;
- return true;
- }
- }
- private void func_74505_d() {
- this.field_151474_i = 0;
- this.field_74513_e = false;
- }
- public String func_151464_g() {
- return this.field_74515_c;
- }
- public int func_151469_h() {
- return this.field_151472_e;
- }
- public int func_151463_i() {
- return this.field_74512_d;
- }
- public void func_151462_b(int p_151462_1_) {
- this.field_74512_d = p_151462_1_;
- }
- public int compareTo(KeyBinding p_compareTo_1_) {
- 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));
- }
- public static Supplier<String> func_193626_b(String p_193626_0_) {
- KeyBinding keybinding = (KeyBinding)field_74516_a.get(p_193626_0_);
- return keybinding == null?() -> {
- return p_193626_0_;
- }:() -> {
- return GameSettings.func_74298_c(lvt_1_1_.func_151463_i());
- };
- }
- static {
- field_193627_d.put("key.categories.movement", Integer.valueOf(1));
- field_193627_d.put("key.categories.gameplay", Integer.valueOf(2));
- field_193627_d.put("key.categories.inventory", Integer.valueOf(3));
- field_193627_d.put("key.categories.creative", Integer.valueOf(4));
- field_193627_d.put("key.categories.multiplayer", Integer.valueOf(5));
- field_193627_d.put("key.categories.ui", Integer.valueOf(6));
- field_193627_d.put("key.categories.misc", Integer.valueOf(7));
- }
- }
- Patching failed: minecraft\net\minecraft\client\Minecraft.java
- Hunk 1 failed! Cannot find hunk target
- while(true) {
- try {
- - if (!this.field_71425_J) {
- - break;
- - }
- + while (this.field_71425_J) {
- if (!this.field_71434_R || this.field_71433_S == null) {
- try {
- File state
- package net.minecraft.client;
- import com.google.common.collect.Lists;
- import com.google.common.collect.Queues;
- import com.google.common.collect.Sets;
- import com.google.common.hash.Hashing;
- import com.google.common.util.concurrent.Futures;
- import com.google.common.util.concurrent.ListenableFuture;
- import com.google.common.util.concurrent.ListenableFutureTask;
- import com.mojang.authlib.AuthenticationService;
- import com.mojang.authlib.GameProfile;
- import com.mojang.authlib.GameProfileRepository;
- import com.mojang.authlib.minecraft.MinecraftSessionService;
- import com.mojang.authlib.properties.PropertyMap;
- import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService;
- import java.awt.image.BufferedImage;
- import java.io.File;
- import java.io.IOException;
- import java.io.InputStream;
- import java.net.Proxy;
- import java.net.SocketAddress;
- import java.nio.ByteBuffer;
- import java.nio.ByteOrder;
- import java.nio.IntBuffer;
- import java.text.DecimalFormat;
- import java.text.SimpleDateFormat;
- import java.util.Collections;
- import java.util.Date;
- import java.util.Iterator;
- import java.util.List;
- import java.util.Locale;
- import java.util.Queue;
- import java.util.Set;
- import java.util.UUID;
- import java.util.concurrent.Callable;
- import java.util.concurrent.Executors;
- import java.util.concurrent.FutureTask;
- import java.util.function.Consumer;
- import java.util.function.Function;
- import java.util.function.Predicate;
- import java.util.stream.Collectors;
- import javax.annotation.Nullable;
- import javax.imageio.ImageIO;
- import net.minecraft.block.Block;
- import net.minecraft.block.material.Material;
- import net.minecraft.block.state.IBlockState;
- import net.minecraft.client.ClientBrandRetriever;
- import net.minecraft.client.LoadingScreenRenderer;
- import net.minecraft.client.audio.MusicTicker;
- import net.minecraft.client.audio.SoundHandler;
- import net.minecraft.client.entity.EntityPlayerSP;
- import net.minecraft.client.gui.FontRenderer;
- import net.minecraft.client.gui.GuiChat;
- import net.minecraft.client.gui.GuiControls;
- import net.minecraft.client.gui.GuiGameOver;
- import net.minecraft.client.gui.GuiIngame;
- import net.minecraft.client.gui.GuiIngameMenu;
- import net.minecraft.client.gui.GuiMainMenu;
- import net.minecraft.client.gui.GuiMemoryErrorScreen;
- import net.minecraft.client.gui.GuiMultiplayer;
- import net.minecraft.client.gui.GuiNewChat;
- import net.minecraft.client.gui.GuiScreen;
- import net.minecraft.client.gui.GuiScreenWorking;
- import net.minecraft.client.gui.GuiSleepMP;
- import net.minecraft.client.gui.GuiWinGame;
- import net.minecraft.client.gui.ScaledResolution;
- import net.minecraft.client.gui.ScreenChatOptions;
- import net.minecraft.client.gui.advancements.GuiScreenAdvancements;
- import net.minecraft.client.gui.chat.NarratorChatListener;
- import net.minecraft.client.gui.inventory.GuiContainerCreative;
- import net.minecraft.client.gui.inventory.GuiInventory;
- import net.minecraft.client.gui.recipebook.RecipeList;
- import net.minecraft.client.gui.toasts.GuiToast;
- import net.minecraft.client.main.GameConfiguration;
- import net.minecraft.client.multiplayer.GuiConnecting;
- import net.minecraft.client.multiplayer.PlayerControllerMP;
- import net.minecraft.client.multiplayer.ServerData;
- import net.minecraft.client.multiplayer.WorldClient;
- import net.minecraft.client.network.NetHandlerLoginClient;
- import net.minecraft.client.network.NetHandlerPlayClient;
- import net.minecraft.client.particle.ParticleManager;
- import net.minecraft.client.renderer.BlockRendererDispatcher;
- import net.minecraft.client.renderer.BufferBuilder;
- import net.minecraft.client.renderer.EntityRenderer;
- import net.minecraft.client.renderer.GlStateManager;
- import net.minecraft.client.renderer.ItemRenderer;
- import net.minecraft.client.renderer.OpenGlHelper;
- import net.minecraft.client.renderer.RenderGlobal;
- import net.minecraft.client.renderer.RenderItem;
- import net.minecraft.client.renderer.Tessellator;
- import net.minecraft.client.renderer.block.model.ModelManager;
- import net.minecraft.client.renderer.chunk.RenderChunk;
- import net.minecraft.client.renderer.color.BlockColors;
- import net.minecraft.client.renderer.color.ItemColors;
- import net.minecraft.client.renderer.debug.DebugRenderer;
- import net.minecraft.client.renderer.entity.RenderManager;
- import net.minecraft.client.renderer.texture.DynamicTexture;
- import net.minecraft.client.renderer.texture.TextureManager;
- import net.minecraft.client.renderer.texture.TextureMap;
- import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
- import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
- import net.minecraft.client.resources.DefaultResourcePack;
- import net.minecraft.client.resources.FoliageColorReloadListener;
- import net.minecraft.client.resources.GrassColorReloadListener;
- import net.minecraft.client.resources.I18n;
- import net.minecraft.client.resources.IReloadableResourceManager;
- import net.minecraft.client.resources.IResourceManager;
- import net.minecraft.client.resources.IResourcePack;
- import net.minecraft.client.resources.LanguageManager;
- import net.minecraft.client.resources.ResourcePackRepository;
- import net.minecraft.client.resources.SimpleReloadableResourceManager;
- import net.minecraft.client.resources.SkinManager;
- import net.minecraft.client.resources.data.AnimationMetadataSection;
- import net.minecraft.client.resources.data.AnimationMetadataSectionSerializer;
- import net.minecraft.client.resources.data.FontMetadataSection;
- import net.minecraft.client.resources.data.FontMetadataSectionSerializer;
- import net.minecraft.client.resources.data.LanguageMetadataSection;
- import net.minecraft.client.resources.data.LanguageMetadataSectionSerializer;
- import net.minecraft.client.resources.data.MetadataSerializer;
- import net.minecraft.client.resources.data.PackMetadataSection;
- import net.minecraft.client.resources.data.PackMetadataSectionSerializer;
- import net.minecraft.client.resources.data.TextureMetadataSection;
- import net.minecraft.client.resources.data.TextureMetadataSectionSerializer;
- import net.minecraft.client.settings.CreativeSettings;
- import net.minecraft.client.settings.GameSettings;
- import net.minecraft.client.settings.KeyBinding;
- import net.minecraft.client.shader.Framebuffer;
- import net.minecraft.client.tutorial.Tutorial;
- import net.minecraft.client.util.ISearchTree;
- import net.minecraft.client.util.ITooltipFlag;
- import net.minecraft.client.util.RecipeBookClient;
- import net.minecraft.client.util.SearchTree;
- import net.minecraft.client.util.SearchTreeManager;
- import net.minecraft.crash.CrashReport;
- import net.minecraft.crash.CrashReportCategory;
- import net.minecraft.crash.ICrashReportDetail;
- import net.minecraft.creativetab.CreativeTabs;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.EntityLeashKnot;
- import net.minecraft.entity.EntityList;
- import net.minecraft.entity.item.EntityArmorStand;
- import net.minecraft.entity.item.EntityBoat;
- import net.minecraft.entity.item.EntityEnderCrystal;
- import net.minecraft.entity.item.EntityItemFrame;
- import net.minecraft.entity.item.EntityMinecart;
- import net.minecraft.entity.item.EntityPainting;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.entity.player.InventoryPlayer;
- import net.minecraft.init.Bootstrap;
- import net.minecraft.init.Items;
- import net.minecraft.item.Item;
- import net.minecraft.item.ItemMonsterPlacer;
- import net.minecraft.item.ItemStack;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.nbt.NBTTagList;
- import net.minecraft.nbt.NBTTagString;
- import net.minecraft.network.EnumConnectionState;
- import net.minecraft.network.NetworkManager;
- import net.minecraft.network.handshake.client.C00Handshake;
- import net.minecraft.network.login.client.CPacketLoginStart;
- import net.minecraft.network.play.client.CPacketPlayerDigging;
- import net.minecraft.profiler.ISnooperInfo;
- import net.minecraft.profiler.Profiler;
- import net.minecraft.profiler.Snooper;
- import net.minecraft.server.MinecraftServer;
- import net.minecraft.server.integrated.IntegratedServer;
- import net.minecraft.server.management.PlayerProfileCache;
- import net.minecraft.stats.RecipeBook;
- import net.minecraft.stats.StatisticsManager;
- import net.minecraft.tileentity.TileEntity;
- import net.minecraft.tileentity.TileEntitySkull;
- import net.minecraft.util.EnumActionResult;
- import net.minecraft.util.EnumFacing;
- import net.minecraft.util.EnumHand;
- import net.minecraft.util.FrameTimer;
- import net.minecraft.util.IThreadListener;
- import net.minecraft.util.MinecraftError;
- import net.minecraft.util.MouseHelper;
- import net.minecraft.util.MovementInputFromOptions;
- import net.minecraft.util.NonNullList;
- import net.minecraft.util.ReportedException;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.util.ScreenShotHelper;
- import net.minecraft.util.Session;
- import net.minecraft.util.Timer;
- import net.minecraft.util.Util;
- import net.minecraft.util.datafix.DataFixer;
- import net.minecraft.util.datafix.DataFixesManager;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.util.math.MathHelper;
- import net.minecraft.util.math.RayTraceResult;
- import net.minecraft.util.text.ITextComponent;
- import net.minecraft.util.text.Style;
- import net.minecraft.util.text.TextComponentKeybind;
- import net.minecraft.util.text.TextComponentString;
- import net.minecraft.util.text.TextComponentTranslation;
- import net.minecraft.util.text.TextFormatting;
- import net.minecraft.world.EnumDifficulty;
- import net.minecraft.world.WorldProviderEnd;
- import net.minecraft.world.WorldProviderHell;
- import net.minecraft.world.WorldSettings;
- import net.minecraft.world.chunk.storage.AnvilSaveConverter;
- import net.minecraft.world.storage.ISaveFormat;
- import net.minecraft.world.storage.ISaveHandler;
- import net.minecraft.world.storage.WorldInfo;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- import org.apache.commons.io.Charsets;
- import org.apache.commons.io.IOUtils;
- import org.apache.commons.lang3.Validate;
- import org.apache.logging.log4j.LogManager;
- import org.apache.logging.log4j.Logger;
- import org.lwjgl.LWJGLException;
- import org.lwjgl.Sys;
- import org.lwjgl.input.Keyboard;
- import org.lwjgl.input.Mouse;
- import org.lwjgl.opengl.ContextCapabilities;
- import org.lwjgl.opengl.Display;
- import org.lwjgl.opengl.DisplayMode;
- import org.lwjgl.opengl.GLContext;
- import org.lwjgl.opengl.OpenGLException;
- import org.lwjgl.opengl.PixelFormat;
- import org.lwjgl.util.glu.GLU;
- @SideOnly(Side.CLIENT)
- public class Minecraft implements IThreadListener, ISnooperInfo {
- private static final Logger field_147123_G = LogManager.getLogger();
- private static final ResourceLocation field_110444_H = new ResourceLocation("textures/gui/title/mojang.png");
- public static final boolean field_142025_a = Util.func_110647_a() == Util.EnumOS.OSX;
- public static byte[] field_71444_a = new byte[10485760];
- private static final List<DisplayMode> field_110445_I = Lists.newArrayList(new DisplayMode[]{new DisplayMode(2560, 1600), new DisplayMode(2880, 1800)});
- private final File field_130070_K;
- private final PropertyMap field_152356_J;
- private final PropertyMap field_181038_N;
- private ServerData field_71422_O;
- public TextureManager field_71446_o;
- private static Minecraft field_71432_P;
- private final DataFixer field_184131_U;
- public PlayerControllerMP field_71442_b;
- private boolean field_71431_Q;
- private final boolean field_175619_R = true;
- private boolean field_71434_R;
- private CrashReport field_71433_S;
- public int field_71443_c;
- public int field_71440_d;
- private boolean field_181541_X;
- private final Timer field_71428_T = new Timer(20.0F);
- private final Snooper field_71427_U = new Snooper("client", this, MinecraftServer.func_130071_aq());
- public WorldClient field_71441_e;
- public RenderGlobal field_71438_f;
- private RenderManager field_175616_W;
- private RenderItem field_175621_X;
- private ItemRenderer field_175620_Y;
- public EntityPlayerSP field_71439_g;
- @Nullable
- private Entity field_175622_Z;
- public Entity field_147125_j;
- public ParticleManager field_71452_i;
- private SearchTreeManager field_193995_ae = new SearchTreeManager();
- private final Session field_71449_j;
- private boolean field_71445_n;
- private float field_193996_ah;
- public FontRenderer field_71466_p;
- public FontRenderer field_71464_q;
- @Nullable
- public GuiScreen field_71462_r;
- public LoadingScreenRenderer field_71461_s;
- public EntityRenderer field_71460_t;
- public DebugRenderer field_184132_p;
- private int field_71429_W;
- private final int field_71436_X;
- private final int field_71435_Y;
- @Nullable
- private IntegratedServer field_71437_Z;
- public GuiIngame field_71456_v;
- public boolean field_71454_w;
- public RayTraceResult field_71476_x;
- public GameSettings field_71474_y;
- public CreativeSettings field_191950_u;
- public MouseHelper field_71417_B;
- public final File field_71412_D;
- private final File field_110446_Y;
- private final String field_110447_Z;
- private final String field_184130_ao;
- private final Proxy field_110453_aa;
- private ISaveFormat field_71469_aa;
- private static int field_71470_ab;
- private int field_71467_ac;
- private String field_71475_ae;
- private int field_71477_af;
- public boolean field_71415_G;
- long field_71423_H = func_71386_F();
- private int field_71457_ai;
- public final FrameTimer field_181542_y = new FrameTimer();
- long field_181543_z = System.nanoTime();
- private final boolean field_147129_ai;
- private final boolean field_71459_aj;
- @Nullable
- private NetworkManager field_71453_ak;
- private boolean field_71455_al;
- public final Profiler field_71424_I = new Profiler();
- private long field_83002_am = -1L;
- private IReloadableResourceManager field_110451_am;
- private final MetadataSerializer field_110452_an = new MetadataSerializer();
- private final List<IResourcePack> field_110449_ao = Lists.<IResourcePack>newArrayList();
- public final DefaultResourcePack field_110450_ap;
- private ResourcePackRepository field_110448_aq;
- private LanguageManager field_135017_as;
- private BlockColors field_184127_aH;
- private ItemColors field_184128_aI;
- private Framebuffer field_147124_at;
- private TextureMap field_147128_au;
- private SoundHandler field_147127_av;
- private MusicTicker field_147126_aw;
- private ResourceLocation field_152354_ay;
- private final MinecraftSessionService field_152355_az;
- private SkinManager field_152350_aA;
- private final Queue<FutureTask<?>> field_152351_aB = Queues.<FutureTask<?>>newArrayDeque();
- private final Thread field_152352_aC = Thread.currentThread();
- private ModelManager field_175617_aL;
- private BlockRendererDispatcher field_175618_aM;
- private final GuiToast field_193034_aS;
- volatile boolean field_71425_J = true;
- public String field_71426_K = "";
- public boolean field_175612_E = true;
- private long field_71419_L = func_71386_F();
- private int field_71420_M;
- private boolean field_184129_aV;
- private final Tutorial field_193035_aW;
- long field_71421_N = -1L;
- private String field_71465_an = "root";
- public Minecraft(GameConfiguration p_i45547_1_) {
- field_71432_P = this;
- this.field_71412_D = p_i45547_1_.field_178744_c.field_178760_a;
- this.field_110446_Y = p_i45547_1_.field_178744_c.field_178759_c;
- this.field_130070_K = p_i45547_1_.field_178744_c.field_178758_b;
- this.field_110447_Z = p_i45547_1_.field_178741_d.field_178755_b;
- this.field_184130_ao = p_i45547_1_.field_178741_d.field_187053_c;
- this.field_152356_J = p_i45547_1_.field_178745_a.field_178750_b;
- this.field_181038_N = p_i45547_1_.field_178745_a.field_181172_c;
- this.field_110450_ap = new DefaultResourcePack(p_i45547_1_.field_178744_c.func_187052_a());
- 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;
- this.field_152355_az = (new YggdrasilAuthenticationService(this.field_110453_aa, UUID.randomUUID().toString())).createMinecraftSessionService();
- this.field_71449_j = p_i45547_1_.field_178745_a.field_178752_a;
- field_147123_G.info((String)"Setting user: {}", (Object)this.field_71449_j.func_111285_a());
- field_147123_G.debug((String)"(Session ID is {})", (Object)this.field_71449_j.func_111286_b());
- this.field_71459_aj = p_i45547_1_.field_178741_d.field_178756_a;
- this.field_71443_c = p_i45547_1_.field_178743_b.field_178764_a > 0?p_i45547_1_.field_178743_b.field_178764_a:1;
- this.field_71440_d = p_i45547_1_.field_178743_b.field_178762_b > 0?p_i45547_1_.field_178743_b.field_178762_b:1;
- this.field_71436_X = p_i45547_1_.field_178743_b.field_178764_a;
- this.field_71435_Y = p_i45547_1_.field_178743_b.field_178762_b;
- this.field_71431_Q = p_i45547_1_.field_178743_b.field_178763_c;
- this.field_147129_ai = func_147122_X();
- this.field_71437_Z = null;
- if(p_i45547_1_.field_178742_e.field_178754_a != null) {
- this.field_71475_ae = p_i45547_1_.field_178742_e.field_178754_a;
- this.field_71477_af = p_i45547_1_.field_178742_e.field_178753_b;
- }
- ImageIO.setUseCache(false);
- Locale.setDefault(Locale.ROOT);
- Bootstrap.func_151354_b();
- TextComponentKeybind.field_193637_b = KeyBinding::func_193626_b;
- this.field_184131_U = DataFixesManager.func_188279_a();
- this.field_193034_aS = new GuiToast(this);
- this.field_193035_aW = new Tutorial(this);
- }
- public void func_99999_d() {
- this.field_71425_J = true;
- try {
- this.func_71384_a();
- } catch (Throwable throwable) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable, "Initializing game");
- crashreport.func_85058_a("Initialization");
- this.func_71377_b(this.func_71396_d(crashreport));
- return;
- }
- while(true) {
- try {
- if(!this.field_71425_J) {
- break;
- }
- if(!this.field_71434_R || this.field_71433_S == null) {
- try {
- this.func_71411_J();
- } catch (OutOfMemoryError var10) {
- this.func_71398_f();
- this.func_147108_a(new GuiMemoryErrorScreen());
- System.gc();
- }
- continue;
- }
- this.func_71377_b(this.field_71433_S);
- } catch (MinecraftError var12) {
- break;
- } catch (ReportedException reportedexception) {
- this.func_71396_d(reportedexception.func_71575_a());
- this.func_71398_f();
- field_147123_G.fatal((String)"Reported exception thrown!", (Throwable)reportedexception);
- this.func_71377_b(reportedexception.func_71575_a());
- break;
- } catch (Throwable throwable1) {
- CrashReport crashreport1 = this.func_71396_d(new CrashReport("Unexpected error", throwable1));
- this.func_71398_f();
- field_147123_G.fatal("Unreported exception thrown!", throwable1);
- this.func_71377_b(crashreport1);
- break;
- } finally {
- this.func_71405_e();
- }
- return;
- }
- }
- private void func_71384_a() throws LWJGLException, IOException {
- this.field_71474_y = new GameSettings(this, this.field_71412_D);
- this.field_191950_u = new CreativeSettings(this, this.field_71412_D);
- this.field_110449_ao.add(this.field_110450_ap);
- this.func_71389_H();
- if(this.field_71474_y.field_92119_C > 0 && this.field_71474_y.field_92118_B > 0) {
- this.field_71443_c = this.field_71474_y.field_92118_B;
- this.field_71440_d = this.field_71474_y.field_92119_C;
- }
- field_147123_G.info((String)"LWJGL Version: {}", (Object)Sys.getVersion());
- this.func_175594_ao();
- this.func_175605_an();
- this.func_175609_am();
- OpenGlHelper.func_77474_a();
- this.field_147124_at = new Framebuffer(this.field_71443_c, this.field_71440_d, true);
- this.field_147124_at.func_147604_a(0.0F, 0.0F, 0.0F, 0.0F);
- this.func_175608_ak();
- 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);
- this.field_110451_am = new SimpleReloadableResourceManager(this.field_110452_an);
- this.field_135017_as = new LanguageManager(this.field_110452_an, this.field_71474_y.field_74363_ab);
- this.field_110451_am.func_110542_a(this.field_135017_as);
- this.func_110436_a();
- this.field_71446_o = new TextureManager(this.field_110451_am);
- this.field_110451_am.func_110542_a(this.field_71446_o);
- this.func_180510_a(this.field_71446_o);
- this.field_152350_aA = new SkinManager(this.field_71446_o, new File(this.field_110446_Y, "skins"), this.field_152355_az);
- this.field_71469_aa = new AnvilSaveConverter(new File(this.field_71412_D, "saves"), this.field_184131_U);
- this.field_147127_av = new SoundHandler(this.field_110451_am, this.field_71474_y);
- this.field_110451_am.func_110542_a(this.field_147127_av);
- this.field_147126_aw = new MusicTicker(this);
- this.field_71466_p = new FontRenderer(this.field_71474_y, new ResourceLocation("textures/font/ascii.png"), this.field_71446_o, false);
- if(this.field_71474_y.field_74363_ab != null) {
- this.field_71466_p.func_78264_a(this.func_152349_b());
- this.field_71466_p.func_78275_b(this.field_135017_as.func_135044_b());
- }
- this.field_71464_q = new FontRenderer(this.field_71474_y, new ResourceLocation("textures/font/ascii_sga.png"), this.field_71446_o, false);
- this.field_110451_am.func_110542_a(this.field_71466_p);
- this.field_110451_am.func_110542_a(this.field_71464_q);
- this.field_110451_am.func_110542_a(new GrassColorReloadListener());
- this.field_110451_am.func_110542_a(new FoliageColorReloadListener());
- this.field_71417_B = new MouseHelper();
- this.func_71361_d("Pre startup");
- GlStateManager.func_179098_w();
- GlStateManager.func_179103_j(7425);
- GlStateManager.func_179151_a(1.0D);
- GlStateManager.func_179126_j();
- GlStateManager.func_179143_c(515);
- GlStateManager.func_179141_d();
- GlStateManager.func_179092_a(516, 0.1F);
- GlStateManager.func_187407_a(GlStateManager.CullFace.BACK);
- GlStateManager.func_179128_n(5889);
- GlStateManager.func_179096_D();
- GlStateManager.func_179128_n(5888);
- this.func_71361_d("Startup");
- this.field_147128_au = new TextureMap("textures");
- this.field_147128_au.func_147633_a(this.field_71474_y.field_151442_I);
- this.field_71446_o.func_110580_a(TextureMap.field_110575_b, this.field_147128_au);
- this.field_71446_o.func_110577_a(TextureMap.field_110575_b);
- this.field_147128_au.func_174937_a(false, this.field_71474_y.field_151442_I > 0);
- this.field_175617_aL = new ModelManager(this.field_147128_au);
- this.field_110451_am.func_110542_a(this.field_175617_aL);
- this.field_184127_aH = BlockColors.func_186723_a();
- this.field_184128_aI = ItemColors.func_186729_a(this.field_184127_aH);
- this.field_175621_X = new RenderItem(this.field_71446_o, this.field_175617_aL, this.field_184128_aI);
- this.field_175616_W = new RenderManager(this.field_71446_o, this.field_175621_X);
- this.field_175620_Y = new ItemRenderer(this);
- this.field_110451_am.func_110542_a(this.field_175621_X);
- this.field_71460_t = new EntityRenderer(this, this.field_110451_am);
- this.field_110451_am.func_110542_a(this.field_71460_t);
- this.field_175618_aM = new BlockRendererDispatcher(this.field_175617_aL.func_174954_c(), this.field_184127_aH);
- this.field_110451_am.func_110542_a(this.field_175618_aM);
- this.field_71438_f = new RenderGlobal(this);
- this.field_110451_am.func_110542_a(this.field_71438_f);
- this.func_193986_ar();
- this.field_110451_am.func_110542_a(this.field_193995_ae);
- GlStateManager.func_179083_b(0, 0, this.field_71443_c, this.field_71440_d);
- this.field_71452_i = new ParticleManager(this.field_71441_e, this.field_71446_o);
- this.func_71361_d("Post startup");
- this.field_71456_v = new GuiIngame(this);
- if(this.field_71475_ae != null) {
- this.func_147108_a(new GuiConnecting(new GuiMainMenu(), this, this.field_71475_ae, this.field_71477_af));
- } else {
- this.func_147108_a(new GuiMainMenu());
- }
- this.field_71446_o.func_147645_c(this.field_152354_ay);
- this.field_152354_ay = null;
- this.field_71461_s = new LoadingScreenRenderer(this);
- this.field_184132_p = new DebugRenderer(this);
- if(this.field_71474_y.field_74353_u && !this.field_71431_Q) {
- this.func_71352_k();
- }
- try {
- Display.setVSyncEnabled(this.field_71474_y.field_74352_v);
- } catch (OpenGLException var2) {
- this.field_71474_y.field_74352_v = false;
- this.field_71474_y.func_74303_b();
- }
- this.field_71438_f.func_174966_b();
- }
- private void func_193986_ar() {
- SearchTree<ItemStack> searchtree = new SearchTree((p_193988_0_) -> {
- 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_) -> {
- return !p_193984_0_.isEmpty();
- }).collect(Collectors.toList());
- }, (p_193985_0_) -> {
- return Collections.singleton(Item.field_150901_e.func_177774_c(p_193985_0_.func_77973_b()));
- });
- NonNullList<ItemStack> nonnulllist = NonNullList.<ItemStack>func_191196_a();
- for(Item item : Item.field_150901_e) {
- item.func_150895_a(CreativeTabs.field_78027_g, nonnulllist);
- }
- nonnulllist.forEach(searchtree::func_194043_a);
- SearchTree<RecipeList> searchtree1 = new SearchTree((p_193990_0_) -> {
- return (List)p_193990_0_.func_192711_b().stream().flatMap((p_193993_0_) -> {
- return p_193993_0_.func_77571_b().func_82840_a((EntityPlayer)null, ITooltipFlag.TooltipFlags.NORMAL).stream();
- }).map(TextFormatting::func_110646_a).map(String::trim).filter((p_193994_0_) -> {
- return !p_193994_0_.isEmpty();
- }).collect(Collectors.toList());
- }, (p_193991_0_) -> {
- return (List)p_193991_0_.func_192711_b().stream().map((p_193992_0_) -> {
- return (ResourceLocation)Item.field_150901_e.func_177774_c(p_193992_0_.func_77571_b().func_77973_b());
- }).collect(Collectors.toList());
- });
- RecipeBookClient.field_194087_f.forEach(searchtree1::func_194043_a);
- this.field_193995_ae.func_194009_a(SearchTreeManager.field_194011_a, searchtree);
- this.field_193995_ae.func_194009_a(SearchTreeManager.field_194012_b, searchtree1);
- }
- private void func_175608_ak() {
- this.field_110452_an.func_110504_a(new TextureMetadataSectionSerializer(), TextureMetadataSection.class);
- this.field_110452_an.func_110504_a(new FontMetadataSectionSerializer(), FontMetadataSection.class);
- this.field_110452_an.func_110504_a(new AnimationMetadataSectionSerializer(), AnimationMetadataSection.class);
- this.field_110452_an.func_110504_a(new PackMetadataSectionSerializer(), PackMetadataSection.class);
- this.field_110452_an.func_110504_a(new LanguageMetadataSectionSerializer(), LanguageMetadataSection.class);
- }
- private void func_175609_am() throws LWJGLException {
- Display.setResizable(true);
- Display.setTitle("Minecraft 1.12");
- try {
- Display.create((new PixelFormat()).withDepthBits(24));
- } catch (LWJGLException lwjglexception) {
- field_147123_G.error((String)"Couldn\'t set pixel format", (Throwable)lwjglexception);
- try {
- Thread.sleep(1000L);
- } catch (InterruptedException var3) {
- ;
- }
- if(this.field_71431_Q) {
- this.func_110441_Q();
- }
- Display.create();
- }
- }
- private void func_175605_an() throws LWJGLException {
- if(this.field_71431_Q) {
- Display.setFullscreen(true);
- DisplayMode displaymode = Display.getDisplayMode();
- this.field_71443_c = Math.max(1, displaymode.getWidth());
- this.field_71440_d = Math.max(1, displaymode.getHeight());
- } else {
- Display.setDisplayMode(new DisplayMode(this.field_71443_c, this.field_71440_d));
- }
- }
- private void func_175594_ao() {
- Util.EnumOS util$enumos = Util.func_110647_a();
- if(util$enumos != Util.EnumOS.OSX) {
- InputStream inputstream = null;
- InputStream inputstream1 = null;
- try {
- inputstream = this.field_110450_ap.func_152780_c(new ResourceLocation("icons/icon_16x16.png"));
- inputstream1 = this.field_110450_ap.func_152780_c(new ResourceLocation("icons/icon_32x32.png"));
- if(inputstream != null && inputstream1 != null) {
- Display.setIcon(new ByteBuffer[]{this.func_152340_a(inputstream), this.func_152340_a(inputstream1)});
- }
- } catch (IOException ioexception) {
- field_147123_G.error((String)"Couldn\'t set icon", (Throwable)ioexception);
- } finally {
- IOUtils.closeQuietly(inputstream);
- IOUtils.closeQuietly(inputstream1);
- }
- }
- }
- private static boolean func_147122_X() {
- String[] astring = new String[]{"sun.arch.data.model", "com.ibm.vm.bitmode", "os.arch"};
- for(String string : astring) {
- String string1 = System.getProperty(string);
- if(string1 != null && string1.contains("64")) {
- return true;
- }
- }
- return false;
- }
- public Framebuffer func_147110_a() {
- return this.field_147124_at;
- }
- public String func_175600_c() {
- return this.field_110447_Z;
- }
- public String func_184123_d() {
- return this.field_184130_ao;
- }
- private void func_71389_H() {
- Thread thread = new Thread("Timer hack thread") {
- public void run() {
- while(Minecraft.this.field_71425_J) {
- try {
- Thread.sleep(2147483647L);
- } catch (InterruptedException var2) {
- ;
- }
- }
- }
- };
- thread.setDaemon(true);
- thread.start();
- }
- public void func_71404_a(CrashReport p_71404_1_) {
- this.field_71434_R = true;
- this.field_71433_S = p_71404_1_;
- }
- public void func_71377_b(CrashReport p_71377_1_) {
- File file = new File(func_71410_x().field_71412_D, "crash-reports");
- File file1 = new File(file, "crash-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + "-client.txt");
- Bootstrap.func_179870_a(p_71377_1_.func_71502_e());
- if(p_71377_1_.func_71497_f() != null) {
- Bootstrap.func_179870_a("#@!@# Game crashed! Crash report saved to: #@!@# " + p_71377_1_.func_71497_f());
- System.exit(-1);
- } else if(p_71377_1_.func_147149_a(file1)) {
- Bootstrap.func_179870_a("#@!@# Game crashed! Crash report saved to: #@!@# " + file1.getAbsolutePath());
- System.exit(-1);
- } else {
- Bootstrap.func_179870_a("#@?@# Game crashed! Crash report could not be saved. #@?@#");
- System.exit(-2);
- }
- }
- public boolean func_152349_b() {
- return this.field_135017_as.func_135042_a() || this.field_71474_y.field_151455_aw;
- }
- public void func_110436_a() {
- List<IResourcePack> list = Lists.newArrayList(this.field_110449_ao);
- if(this.field_71437_Z != null) {
- this.field_71437_Z.func_193031_aM();
- }
- for(ResourcePackRepository.Entry resourcepackrepository$entry : this.field_110448_aq.func_110613_c()) {
- list.add(resourcepackrepository$entry.func_110514_c());
- }
- if(this.field_110448_aq.func_148530_e() != null) {
- list.add(this.field_110448_aq.func_148530_e());
- }
- try {
- this.field_110451_am.func_110541_a(list);
- } catch (RuntimeException runtimeexception) {
- field_147123_G.info((String)"Caught error stitching, removing all assigned resourcepacks", (Throwable)runtimeexception);
- list.clear();
- list.addAll(this.field_110449_ao);
- this.field_110448_aq.func_148527_a(Collections.<ResourcePackRepository.Entry>emptyList());
- this.field_110451_am.func_110541_a(list);
- this.field_71474_y.field_151453_l.clear();
- this.field_71474_y.field_183018_l.clear();
- this.field_71474_y.func_74303_b();
- }
- this.field_135017_as.func_135043_a(list);
- if(this.field_71438_f != null) {
- this.field_71438_f.func_72712_a();
- }
- }
- private ByteBuffer func_152340_a(InputStream p_152340_1_) throws IOException {
- BufferedImage bufferedimage = ImageIO.read(p_152340_1_);
- int[] aint = bufferedimage.getRGB(0, 0, bufferedimage.getWidth(), bufferedimage.getHeight(), (int[])null, 0, bufferedimage.getWidth());
- ByteBuffer bytebuffer = ByteBuffer.allocate(4 * aint.length);
- for(int int : aint) {
- bytebuffer.putInt(int << 8 | int >> 24 & 255);
- }
- bytebuffer.flip();
- return bytebuffer;
- }
- private void func_110441_Q() throws LWJGLException {
- Set<DisplayMode> set = Sets.<DisplayMode>newHashSet();
- Collections.addAll(set, Display.getAvailableDisplayModes());
- DisplayMode displaymode = Display.getDesktopDisplayMode();
- if(!set.contains(displaymode) && Util.func_110647_a() == Util.EnumOS.OSX) {
- label53:
- for(DisplayMode displaymode1 : field_110445_I) {
- boolean boolean = true;
- for(DisplayMode displaymode2 : set) {
- if(displaymode2.getBitsPerPixel() == 32 && displaymode2.getWidth() == displaymode1.getWidth() && displaymode2.getHeight() == displaymode1.getHeight()) {
- boolean = false;
- break;
- }
- }
- if(!boolean) {
- Iterator iterator = set.iterator();
- DisplayMode displaymode3;
- while(true) {
- if(!iterator.hasNext()) {
- continue label53;
- }
- displaymode3 = (DisplayMode)iterator.next();
- if(displaymode3.getBitsPerPixel() == 32 && displaymode3.getWidth() == displaymode1.getWidth() / 2 && displaymode3.getHeight() == displaymode1.getHeight() / 2) {
- break;
- }
- }
- displaymode = displaymode3;
- }
- }
- }
- Display.setDisplayMode(displaymode);
- this.field_71443_c = displaymode.getWidth();
- this.field_71440_d = displaymode.getHeight();
- }
- public void func_180510_a(TextureManager p_180510_1_) throws LWJGLException {
- ScaledResolution scaledresolution = new ScaledResolution(this);
- int int = scaledresolution.func_78325_e();
- Framebuffer framebuffer = new Framebuffer(scaledresolution.func_78326_a() * int, scaledresolution.func_78328_b() * int, true);
- framebuffer.func_147610_a(false);
- GlStateManager.func_179128_n(5889);
- GlStateManager.func_179096_D();
- GlStateManager.func_179130_a(0.0D, (double)scaledresolution.func_78326_a(), (double)scaledresolution.func_78328_b(), 0.0D, 1000.0D, 3000.0D);
- GlStateManager.func_179128_n(5888);
- GlStateManager.func_179096_D();
- GlStateManager.func_179109_b(0.0F, 0.0F, -2000.0F);
- GlStateManager.func_179140_f();
- GlStateManager.func_179106_n();
- GlStateManager.func_179097_i();
- GlStateManager.func_179098_w();
- InputStream inputstream = null;
- try {
- inputstream = this.field_110450_ap.func_110590_a(field_110444_H);
- this.field_152354_ay = p_180510_1_.func_110578_a("logo", new DynamicTexture(ImageIO.read(inputstream)));
- p_180510_1_.func_110577_a(this.field_152354_ay);
- } catch (IOException ioexception) {
- field_147123_G.error((String)"Unable to load logo: {}", (Object)field_110444_H, (Object)ioexception);
- } finally {
- IOUtils.closeQuietly(inputstream);
- }
- Tessellator tessellator = Tessellator.func_178181_a();
- BufferBuilder bufferbuilder = tessellator.func_178180_c();
- bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181709_i);
- 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();
- 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();
- 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();
- 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();
- tessellator.func_78381_a();
- GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
- int int = 256;
- int int = 256;
- this.func_181536_a((scaledresolution.func_78326_a() - 256) / 2, (scaledresolution.func_78328_b() - 256) / 2, 0, 0, 256, 256, 255, 255, 255, 255);
- GlStateManager.func_179140_f();
- GlStateManager.func_179106_n();
- framebuffer.func_147609_e();
- framebuffer.func_147615_c(scaledresolution.func_78326_a() * int, scaledresolution.func_78328_b() * int);
- GlStateManager.func_179141_d();
- GlStateManager.func_179092_a(516, 0.1F);
- this.func_175601_h();
- }
- 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_) {
- BufferBuilder bufferbuilder = Tessellator.func_178181_a().func_178180_c();
- bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181709_i);
- float float = 0.00390625F;
- float float = 0.00390625F;
- 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();
- 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();
- 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();
- 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();
- Tessellator.func_178181_a().func_78381_a();
- }
- public ISaveFormat func_71359_d() {
- return this.field_71469_aa;
- }
- public void func_147108_a(@Nullable GuiScreen p_147108_1_) {
- if(this.field_71462_r != null) {
- this.field_71462_r.func_146281_b();
- }
- if(p_147108_1_ == null && this.field_71441_e == null) {
- p_147108_1_ = new GuiMainMenu();
- } else if(p_147108_1_ == null && this.field_71439_g.func_110143_aJ() <= 0.0F) {
- p_147108_1_ = new GuiGameOver((ITextComponent)null);
- }
- if(p_147108_1_ instanceof GuiMainMenu || p_147108_1_ instanceof GuiMultiplayer) {
- this.field_71474_y.field_74330_P = false;
- this.field_71456_v.func_146158_b().func_146231_a(true);
- }
- this.field_71462_r = (GuiScreen)p_147108_1_;
- if(p_147108_1_ != null) {
- this.func_71364_i();
- KeyBinding.func_74506_a();
- while(Mouse.next()) {
- ;
- }
- while(Keyboard.next()) {
- ;
- }
- ScaledResolution scaledresolution = new ScaledResolution(this);
- int int = scaledresolution.func_78326_a();
- int int = scaledresolution.func_78328_b();
- ((GuiScreen)p_147108_1_).func_146280_a(this, int, int);
- this.field_71454_w = false;
- } else {
- this.field_147127_av.func_147687_e();
- this.func_71381_h();
- }
- }
- private void func_71361_d(String p_71361_1_) {
- int int = GlStateManager.func_187434_L();
- if(int != 0) {
- String string = GLU.gluErrorString(int);
- field_147123_G.error("########## GL ERROR ##########");
- field_147123_G.error((String)"@ {}", (Object)p_71361_1_);
- field_147123_G.error((String)"{}: {}", (Object)Integer.valueOf(int), (Object)string);
- }
- }
- public void func_71405_e() {
- try {
- field_147123_G.info("Stopping!");
- try {
- this.func_71403_a((WorldClient)null);
- } catch (Throwable var5) {
- ;
- }
- this.field_147127_av.func_147685_d();
- } finally {
- Display.destroy();
- if(!this.field_71434_R) {
- System.exit(0);
- }
- }
- System.gc();
- }
- private void func_71411_J() throws IOException {
- long long = System.nanoTime();
- this.field_71424_I.func_76320_a("root");
- if(Display.isCreated() && Display.isCloseRequested()) {
- this.func_71400_g();
- }
- this.field_71428_T.func_74275_a();
- this.field_71424_I.func_76320_a("scheduledExecutables");
- synchronized(this.field_152351_aB) {
- while(!this.field_152351_aB.isEmpty()) {
- Util.func_181617_a((FutureTask)this.field_152351_aB.poll(), field_147123_G);
- }
- }
- this.field_71424_I.func_76319_b();
- long long = System.nanoTime();
- this.field_71424_I.func_76320_a("tick");
- for(int int = 0; int < Math.min(10, this.field_71428_T.field_74280_b); ++int) {
- this.func_71407_l();
- }
- this.field_71424_I.func_76318_c("preRenderErrors");
- long long = System.nanoTime() - long;
- this.func_71361_d("Pre render");
- this.field_71424_I.func_76318_c("sound");
- this.field_147127_av.func_147691_a(this.field_71439_g, this.field_71428_T.field_194147_b);
- this.field_71424_I.func_76319_b();
- this.field_71424_I.func_76320_a("render");
- GlStateManager.func_179094_E();
- GlStateManager.func_179086_m(16640);
- this.field_147124_at.func_147610_a(true);
- this.field_71424_I.func_76320_a("display");
- GlStateManager.func_179098_w();
- this.field_71424_I.func_76319_b();
- if(!this.field_71454_w) {
- this.field_71424_I.func_76318_c("gameRenderer");
- this.field_71460_t.func_181560_a(this.field_71445_n?this.field_193996_ah:this.field_71428_T.field_194147_b, long);
- this.field_71424_I.func_76318_c("toasts");
- this.field_193034_aS.func_191783_a(new ScaledResolution(this));
- this.field_71424_I.func_76319_b();
- }
- this.field_71424_I.func_76319_b();
- if(this.field_71474_y.field_74330_P && this.field_71474_y.field_74329_Q && !this.field_71474_y.field_74319_N) {
- if(!this.field_71424_I.field_76327_a) {
- this.field_71424_I.func_76317_a();
- }
- this.field_71424_I.field_76327_a = true;
- this.func_71366_a(long);
- } else {
- this.field_71424_I.field_76327_a = false;
- this.field_71421_N = System.nanoTime();
- }
- this.field_147124_at.func_147609_e();
- GlStateManager.func_179121_F();
- GlStateManager.func_179094_E();
- this.field_147124_at.func_147615_c(this.field_71443_c, this.field_71440_d);
- GlStateManager.func_179121_F();
- GlStateManager.func_179094_E();
- this.field_71460_t.func_152430_c(this.field_71428_T.field_194147_b);
- GlStateManager.func_179121_F();
- this.field_71424_I.func_76320_a("root");
- this.func_175601_h();
- Thread.yield();
- this.func_71361_d("Post render");
- ++this.field_71420_M;
- 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();
- if(this.field_71445_n != boolean) {
- if(this.field_71445_n) {
- this.field_193996_ah = this.field_71428_T.field_194147_b;
- } else {
- this.field_71428_T.field_194147_b = this.field_193996_ah;
- }
- this.field_71445_n = boolean;
- }
- long long = System.nanoTime();
- this.field_181542_y.func_181747_a(long - this.field_181543_z);
- this.field_181543_z = long;
- while(func_71386_F() >= this.field_71419_L + 1000L) {
- field_71470_ab = this.field_71420_M;
- 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":""});
- RenderChunk.field_178592_a = 0;
- this.field_71419_L += 1000L;
- this.field_71420_M = 0;
- this.field_71427_U.func_76471_b();
- if(!this.field_71427_U.func_76468_d()) {
- this.field_71427_U.func_76463_a();
- }
- }
- if(this.func_147107_h()) {
- this.field_71424_I.func_76320_a("fpslimit_wait");
- Display.sync(this.func_90020_K());
- this.field_71424_I.func_76319_b();
- }
- this.field_71424_I.func_76319_b();
- }
- public void func_175601_h() {
- this.field_71424_I.func_76320_a("display_update");
- Display.update();
- this.field_71424_I.func_76319_b();
- this.func_175604_i();
- }
- protected void func_175604_i() {
- if(!this.field_71431_Q && Display.wasResized()) {
- int int = this.field_71443_c;
- int int = this.field_71440_d;
- this.field_71443_c = Display.getWidth();
- this.field_71440_d = Display.getHeight();
- if(this.field_71443_c != int || this.field_71440_d != int) {
- if(this.field_71443_c <= 0) {
- this.field_71443_c = 1;
- }
- if(this.field_71440_d <= 0) {
- this.field_71440_d = 1;
- }
- this.func_71370_a(this.field_71443_c, this.field_71440_d);
- }
- }
- }
- public int func_90020_K() {
- return this.field_71441_e == null && this.field_71462_r != null?30:this.field_71474_y.field_74350_i;
- }
- public boolean func_147107_h() {
- return (float)this.func_90020_K() < GameSettings.Options.FRAMERATE_LIMIT.func_148267_f();
- }
- public void func_71398_f() {
- try {
- field_71444_a = new byte[0];
- this.field_71438_f.func_72728_f();
- } catch (Throwable var3) {
- ;
- }
- try {
- System.gc();
- this.func_71403_a((WorldClient)null);
- } catch (Throwable var2) {
- ;
- }
- System.gc();
- }
- private void func_71383_b(int p_71383_1_) {
- List<Profiler.Result> list = this.field_71424_I.func_76321_b(this.field_71465_an);
- if(!list.isEmpty()) {
- Profiler.Result profiler$result = (Profiler.Result)list.remove(0);
- if(p_71383_1_ == 0) {
- if(!profiler$result.field_76331_c.isEmpty()) {
- int int = this.field_71465_an.lastIndexOf(46);
- if(int >= 0) {
- this.field_71465_an = this.field_71465_an.substring(0, int);
- }
- }
- } else {
- --p_71383_1_;
- if(p_71383_1_ < list.size() && !"unspecified".equals(((Profiler.Result)list.get(p_71383_1_)).field_76331_c)) {
- if(!this.field_71465_an.isEmpty()) {
- this.field_71465_an = this.field_71465_an + ".";
- }
- this.field_71465_an = this.field_71465_an + ((Profiler.Result)list.get(p_71383_1_)).field_76331_c;
- }
- }
- }
- }
- private void func_71366_a(long p_71366_1_) {
- if(this.field_71424_I.field_76327_a) {
- List<Profiler.Result> list = this.field_71424_I.func_76321_b(this.field_71465_an);
- Profiler.Result profiler$result = (Profiler.Result)list.remove(0);
- GlStateManager.func_179086_m(256);
- GlStateManager.func_179128_n(5889);
- GlStateManager.func_179142_g();
- GlStateManager.func_179096_D();
- GlStateManager.func_179130_a(0.0D, (double)this.field_71443_c, (double)this.field_71440_d, 0.0D, 1000.0D, 3000.0D);
- GlStateManager.func_179128_n(5888);
- GlStateManager.func_179096_D();
- GlStateManager.func_179109_b(0.0F, 0.0F, -2000.0F);
- GlStateManager.func_187441_d(1.0F);
- GlStateManager.func_179090_x();
- Tessellator tessellator = Tessellator.func_178181_a();
- BufferBuilder bufferbuilder = tessellator.func_178180_c();
- int int = 160;
- int int = this.field_71443_c - 160 - 10;
- int int = this.field_71440_d - 320;
- GlStateManager.func_179147_l();
- bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181706_f);
- 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();
- bufferbuilder.func_181662_b((double)((float)int - 176.0F), (double)(int + 320), 0.0D).func_181669_b(200, 0, 0, 0).func_181675_d();
- bufferbuilder.func_181662_b((double)((float)int + 176.0F), (double)(int + 320), 0.0D).func_181669_b(200, 0, 0, 0).func_181675_d();
- 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();
- tessellator.func_78381_a();
- GlStateManager.func_179084_k();
- double double = 0.0D;
- for(int int = 0; int < list.size(); ++int) {
- Profiler.Result profiler$result1 = (Profiler.Result)list.get(int);
- int int = MathHelper.func_76128_c(profiler$result1.field_76332_a / 4.0D) + 1;
- bufferbuilder.func_181668_a(6, DefaultVertexFormats.field_181706_f);
- int int = profiler$result1.func_76329_a();
- int int = int >> 16 & 255;
- int int = int >> 8 & 255;
- int int = int & 255;
- bufferbuilder.func_181662_b((double)int, (double)int, 0.0D).func_181669_b(int, int, int, 255).func_181675_d();
- for(int int = int; int >= 0; --int) {
- float float = (float)((double + profiler$result1.field_76332_a * (double)int / (double)int) * 6.2831854820251465D / 100.0D);
- float float = MathHelper.func_76126_a(float) * 160.0F;
- float float = MathHelper.func_76134_b(float) * 160.0F * 0.5F;
- bufferbuilder.func_181662_b((double)((float)int + float), (double)((float)int - float), 0.0D).func_181669_b(int, int, int, 255).func_181675_d();
- }
- tessellator.func_78381_a();
- bufferbuilder.func_181668_a(5, DefaultVertexFormats.field_181706_f);
- for(int int = int; int >= 0; --int) {
- float float = (float)((double + profiler$result1.field_76332_a * (double)int / (double)int) * 6.2831854820251465D / 100.0D);
- float float = MathHelper.func_76126_a(float) * 160.0F;
- float float = MathHelper.func_76134_b(float) * 160.0F * 0.5F;
- 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();
- 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();
- }
- tessellator.func_78381_a();
- double += profiler$result1.field_76332_a;
- }
- DecimalFormat decimalformat = new DecimalFormat("##0.00");
- GlStateManager.func_179098_w();
- String string = "";
- if(!"unspecified".equals(profiler$result.field_76331_c)) {
- string = string + "[0] ";
- }
- if(profiler$result.field_76331_c.isEmpty()) {
- string = string + "ROOT ";
- } else {
- string = string + profiler$result.field_76331_c + ' ';
- }
- int int = 16777215;
- this.field_71466_p.func_175063_a(string, (float)(int - 160), (float)(int - 80 - 16), 16777215);
- string = decimalformat.format(profiler$result.field_76330_b) + "%";
- this.field_71466_p.func_175063_a(string, (float)(int + 160 - this.field_71466_p.func_78256_a(string)), (float)(int - 80 - 16), 16777215);
- for(int int = 0; int < list.size(); ++int) {
- Profiler.Result profiler$result2 = (Profiler.Result)list.get(int);
- StringBuilder stringbuilder = new StringBuilder();
- if("unspecified".equals(profiler$result2.field_76331_c)) {
- stringbuilder.append("[?] ");
- } else {
- stringbuilder.append("[").append(int + 1).append("] ");
- }
- String string1 = stringbuilder.append(profiler$result2.field_76331_c).toString();
- this.field_71466_p.func_175063_a(string1, (float)(int - 160), (float)(int + 80 + int * 8 + 20), profiler$result2.func_76329_a());
- string1 = decimalformat.format(profiler$result2.field_76332_a) + "%";
- 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());
- string1 = decimalformat.format(profiler$result2.field_76330_b) + "%";
- 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());
- }
- }
- }
- public void func_71400_g() {
- this.field_71425_J = false;
- }
- public void func_71381_h() {
- if(Display.isActive()) {
- if(!this.field_71415_G) {
- if(!field_142025_a) {
- KeyBinding.func_186704_a();
- }
- this.field_71415_G = true;
- this.field_71417_B.func_74372_a();
- this.func_147108_a((GuiScreen)null);
- this.field_71429_W = 10000;
- }
- }
- }
- public void func_71364_i() {
- if(this.field_71415_G) {
- this.field_71415_G = false;
- this.field_71417_B.func_74373_b();
- }
- }
- public void func_71385_j() {
- if(this.field_71462_r == null) {
- this.func_147108_a(new GuiIngameMenu());
- if(this.func_71356_B() && !this.field_71437_Z.func_71344_c()) {
- this.field_147127_av.func_147689_b();
- }
- }
- }
- private void func_147115_a(boolean p_147115_1_) {
- if(!p_147115_1_) {
- this.field_71429_W = 0;
- }
- if(this.field_71429_W <= 0 && !this.field_71439_g.func_184587_cr()) {
- if(p_147115_1_ && this.field_71476_x != null && this.field_71476_x.field_72313_a == RayTraceResult.Type.BLOCK) {
- BlockPos blockpos = this.field_71476_x.func_178782_a();
- 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)) {
- this.field_71452_i.func_180532_a(blockpos, this.field_71476_x.field_178784_b);
- this.field_71439_g.func_184609_a(EnumHand.MAIN_HAND);
- }
- } else {
- this.field_71442_b.func_78767_c();
- }
- }
- }
- private void func_147116_af() {
- if(this.field_71429_W <= 0) {
- if(this.field_71476_x == null) {
- field_147123_G.error("Null returned as \'hitResult\', this shouldn\'t happen!");
- if(this.field_71442_b.func_78762_g()) {
- this.field_71429_W = 10;
- }
- } else if(!this.field_71439_g.func_184838_M()) {
- switch(this.field_71476_x.field_72313_a) {
- case ENTITY:
- this.field_71442_b.func_78764_a(this.field_71439_g, this.field_71476_x.field_72308_g);
- break;
- case BLOCK:
- BlockPos blockpos = this.field_71476_x.func_178782_a();
- if(this.field_71441_e.func_180495_p(blockpos).func_185904_a() != Material.field_151579_a) {
- this.field_71442_b.func_180511_b(blockpos, this.field_71476_x.field_178784_b);
- break;
- }
- case MISS:
- if(this.field_71442_b.func_78762_g()) {
- this.field_71429_W = 10;
- }
- this.field_71439_g.func_184821_cY();
- }
- this.field_71439_g.func_184609_a(EnumHand.MAIN_HAND);
- }
- }
- }
- private void func_147121_ag() {
- if(!this.field_71442_b.func_181040_m()) {
- this.field_71467_ac = 4;
- if(!this.field_71439_g.func_184838_M()) {
- if(this.field_71476_x == null) {
- field_147123_G.warn("Null returned as \'hitResult\', this shouldn\'t happen!");
- }
- for(EnumHand enumhand : EnumHand.values()) {
- ItemStack itemstack = this.field_71439_g.func_184586_b(enumhand);
- if(this.field_71476_x != null) {
- switch(this.field_71476_x.field_72313_a) {
- case ENTITY:
- 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) {
- return;
- }
- if(this.field_71442_b.func_187097_a(this.field_71439_g, this.field_71476_x.field_72308_g, enumhand) == EnumActionResult.SUCCESS) {
- return;
- }
- break;
- case BLOCK:
- BlockPos blockpos = this.field_71476_x.func_178782_a();
- if(this.field_71441_e.func_180495_p(blockpos).func_185904_a() != Material.field_151579_a) {
- int int = itemstack.func_190916_E();
- 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);
- if(enumactionresult == EnumActionResult.SUCCESS) {
- this.field_71439_g.func_184609_a(enumhand);
- if(!itemstack.func_190926_b() && (itemstack.func_190916_E() != int || this.field_71442_b.func_78758_h())) {
- this.field_71460_t.field_78516_c.func_187460_a(enumhand);
- }
- return;
- }
- }
- }
- }
- if(!itemstack.func_190926_b() && this.field_71442_b.func_187101_a(this.field_71439_g, this.field_71441_e, enumhand) == EnumActionResult.SUCCESS) {
- this.field_71460_t.field_78516_c.func_187460_a(enumhand);
- return;
- }
- }
- }
- }
- }
- public void func_71352_k() {
- try {
- this.field_71431_Q = !this.field_71431_Q;
- this.field_71474_y.field_74353_u = this.field_71431_Q;
- if(this.field_71431_Q) {
- this.func_110441_Q();
- this.field_71443_c = Display.getDisplayMode().getWidth();
- this.field_71440_d = Display.getDisplayMode().getHeight();
- if(this.field_71443_c <= 0) {
- this.field_71443_c = 1;
- }
- if(this.field_71440_d <= 0) {
- this.field_71440_d = 1;
- }
- } else {
- Display.setDisplayMode(new DisplayMode(this.field_71436_X, this.field_71435_Y));
- this.field_71443_c = this.field_71436_X;
- this.field_71440_d = this.field_71435_Y;
- if(this.field_71443_c <= 0) {
- this.field_71443_c = 1;
- }
- if(this.field_71440_d <= 0) {
- this.field_71440_d = 1;
- }
- }
- if(this.field_71462_r != null) {
- this.func_71370_a(this.field_71443_c, this.field_71440_d);
- } else {
- this.func_147119_ah();
- }
- Display.setFullscreen(this.field_71431_Q);
- Display.setVSyncEnabled(this.field_71474_y.field_74352_v);
- this.func_175601_h();
- } catch (Exception exception) {
- field_147123_G.error((String)"Couldn\'t toggle fullscreen", (Throwable)exception);
- }
- }
- public void func_71370_a(int p_71370_1_, int p_71370_2_) {
- this.field_71443_c = Math.max(1, p_71370_1_);
- this.field_71440_d = Math.max(1, p_71370_2_);
- if(this.field_71462_r != null) {
- ScaledResolution scaledresolution = new ScaledResolution(this);
- this.field_71462_r.func_175273_b(this, scaledresolution.func_78326_a(), scaledresolution.func_78328_b());
- }
- this.field_71461_s = new LoadingScreenRenderer(this);
- this.func_147119_ah();
- }
- private void func_147119_ah() {
- this.field_147124_at.func_147613_a(this.field_71443_c, this.field_71440_d);
- if(this.field_71460_t != null) {
- this.field_71460_t.func_147704_a(this.field_71443_c, this.field_71440_d);
- }
- }
- public MusicTicker func_181535_r() {
- return this.field_147126_aw;
- }
- public void func_71407_l() throws IOException {
- if(this.field_71467_ac > 0) {
- --this.field_71467_ac;
- }
- this.field_71424_I.func_76320_a("gui");
- if(!this.field_71445_n) {
- this.field_71456_v.func_73831_a();
- }
- this.field_71424_I.func_76319_b();
- this.field_71460_t.func_78473_a(1.0F);
- this.field_193035_aW.func_193297_a(this.field_71441_e, this.field_71476_x);
- this.field_71424_I.func_76320_a("gameMode");
- if(!this.field_71445_n && this.field_71441_e != null) {
- this.field_71442_b.func_78765_e();
- }
- this.field_71424_I.func_76318_c("textures");
- if(this.field_71441_e != null) {
- this.field_71446_o.func_110550_d();
- }
- if(this.field_71462_r == null && this.field_71439_g != null) {
- if(this.field_71439_g.func_110143_aJ() <= 0.0F && !(this.field_71462_r instanceof GuiGameOver)) {
- this.func_147108_a((GuiScreen)null);
- } else if(this.field_71439_g.func_70608_bn() && this.field_71441_e != null) {
- this.func_147108_a(new GuiSleepMP());
- }
- } else if(this.field_71462_r != null && this.field_71462_r instanceof GuiSleepMP && !this.field_71439_g.func_70608_bn()) {
- this.func_147108_a((GuiScreen)null);
- }
- if(this.field_71462_r != null) {
- this.field_71429_W = 10000;
- }
- if(this.field_71462_r != null) {
- try {
- this.field_71462_r.func_146269_k();
- } catch (Throwable throwable1) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable1, "Updating screen events");
- CrashReportCategory crashreportcategory = crashreport.func_85058_a("Affected screen");
- crashreportcategory.func_189529_a("Screen name", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return Minecraft.this.field_71462_r.getClass().getCanonicalName();
- }
- });
- throw new ReportedException(crashreport);
- }
- if(this.field_71462_r != null) {
- try {
- this.field_71462_r.func_73876_c();
- } catch (Throwable throwable) {
- CrashReport crashreport1 = CrashReport.func_85055_a(throwable, "Ticking screen");
- CrashReportCategory crashreportcategory1 = crashreport1.func_85058_a("Affected screen");
- crashreportcategory1.func_189529_a("Screen name", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return Minecraft.this.field_71462_r.getClass().getCanonicalName();
- }
- });
- throw new ReportedException(crashreport1);
- }
- }
- }
- if(this.field_71462_r == null || this.field_71462_r.field_146291_p) {
- this.field_71424_I.func_76318_c("mouse");
- this.func_184124_aB();
- if(this.field_71429_W > 0) {
- --this.field_71429_W;
- }
- this.field_71424_I.func_76318_c("keyboard");
- this.func_184118_az();
- }
- if(this.field_71441_e != null) {
- if(this.field_71439_g != null) {
- ++this.field_71457_ai;
- if(this.field_71457_ai == 30) {
- this.field_71457_ai = 0;
- this.field_71441_e.func_72897_h(this.field_71439_g);
- }
- }
- this.field_71424_I.func_76318_c("gameRenderer");
- if(!this.field_71445_n) {
- this.field_71460_t.func_78464_a();
- }
- this.field_71424_I.func_76318_c("levelRenderer");
- if(!this.field_71445_n) {
- this.field_71438_f.func_72734_e();
- }
- this.field_71424_I.func_76318_c("level");
- if(!this.field_71445_n) {
- if(this.field_71441_e.func_175658_ac() > 0) {
- this.field_71441_e.func_175702_c(this.field_71441_e.func_175658_ac() - 1);
- }
- this.field_71441_e.func_72939_s();
- }
- } else if(this.field_71460_t.func_147702_a()) {
- this.field_71460_t.func_181022_b();
- }
- if(!this.field_71445_n) {
- this.field_147126_aw.func_73660_a();
- this.field_147127_av.func_73660_a();
- }
- if(this.field_71441_e != null) {
- if(!this.field_71445_n) {
- this.field_71441_e.func_72891_a(this.field_71441_e.func_175659_aa() != EnumDifficulty.PEACEFUL, true);
- this.field_193035_aW.func_193303_d();
- try {
- this.field_71441_e.func_72835_b();
- } catch (Throwable throwable2) {
- CrashReport crashreport2 = CrashReport.func_85055_a(throwable2, "Exception in world tick");
- if(this.field_71441_e == null) {
- CrashReportCategory crashreportcategory2 = crashreport2.func_85058_a("Affected level");
- crashreportcategory2.func_71507_a("Problem", "Level is null!");
- } else {
- this.field_71441_e.func_72914_a(crashreport2);
- }
- throw new ReportedException(crashreport2);
- }
- }
- this.field_71424_I.func_76318_c("animateTick");
- if(!this.field_71445_n && this.field_71441_e != null) {
- 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));
- }
- this.field_71424_I.func_76318_c("particles");
- if(!this.field_71445_n) {
- this.field_71452_i.func_78868_a();
- }
- } else if(this.field_71453_ak != null) {
- this.field_71424_I.func_76318_c("pendingConnection");
- this.field_71453_ak.func_74428_b();
- }
- this.field_71424_I.func_76319_b();
- this.field_71423_H = func_71386_F();
- }
- private void func_184118_az() throws IOException {
- while(Keyboard.next()) {
- int int = Keyboard.getEventKey() == 0?Keyboard.getEventCharacter() + 256:Keyboard.getEventKey();
- if(this.field_83002_am > 0L) {
- if(func_71386_F() - this.field_83002_am >= 6000L) {
- throw new ReportedException(new CrashReport("Manually triggered debug crash", new Throwable()));
- }
- if(!Keyboard.isKeyDown(46) || !Keyboard.isKeyDown(61)) {
- this.field_83002_am = -1L;
- }
- } else if(Keyboard.isKeyDown(46) && Keyboard.isKeyDown(61)) {
- this.field_184129_aV = true;
- this.field_83002_am = func_71386_F();
- }
- this.func_152348_aa();
- if(this.field_71462_r != null) {
- this.field_71462_r.func_146282_l();
- }
- boolean boolean = Keyboard.getEventKeyState();
- if(boolean) {
- if(int == 62 && this.field_71460_t != null) {
- this.field_71460_t.func_175071_c();
- }
- boolean boolean = false;
- if(this.field_71462_r == null) {
- if(int == 1) {
- this.func_71385_j();
- }
- boolean = Keyboard.isKeyDown(61) && this.func_184122_c(int);
- this.field_184129_aV |= boolean;
- if(int == 59) {
- this.field_71474_y.field_74319_N = !this.field_71474_y.field_74319_N;
- }
- }
- if(boolean) {
- KeyBinding.func_74510_a(int, false);
- } else {
- KeyBinding.func_74510_a(int, true);
- KeyBinding.func_74507_a(int);
- }
- if(this.field_71474_y.field_74329_Q) {
- if(int == 11) {
- this.func_71383_b(0);
- }
- for(int int = 0; int < 9; ++int) {
- if(int == 2 + int) {
- this.func_71383_b(int + 1);
- }
- }
- }
- } else {
- KeyBinding.func_74510_a(int, false);
- if(int == 61) {
- if(this.field_184129_aV) {
- this.field_184129_aV = false;
- } else {
- this.field_71474_y.field_74330_P = !this.field_71474_y.field_74330_P;
- this.field_71474_y.field_74329_Q = this.field_71474_y.field_74330_P && GuiScreen.func_146272_n();
- this.field_71474_y.field_181657_aC = this.field_71474_y.field_74330_P && GuiScreen.func_175283_s();
- }
- }
- }
- }
- this.func_184117_aA();
- }
- private boolean func_184122_c(int p_184122_1_) {
- if(p_184122_1_ == 30) {
- this.field_71438_f.func_72712_a();
- this.func_190521_a("debug.reload_chunks.message", new Object[0]);
- return true;
- } else if(p_184122_1_ == 48) {
- boolean boolean = !this.field_175616_W.func_178634_b();
- this.field_175616_W.func_178629_b(boolean);
- this.func_190521_a(boolean?"debug.show_hitboxes.on":"debug.show_hitboxes.off", new Object[0]);
- return true;
- } else if(p_184122_1_ == 32) {
- if(this.field_71456_v != null) {
- this.field_71456_v.func_146158_b().func_146231_a(false);
- }
- return true;
- } else if(p_184122_1_ == 33) {
- this.field_71474_y.func_74306_a(GameSettings.Options.RENDER_DISTANCE, GuiScreen.func_146272_n()?-1:1);
- this.func_190521_a("debug.cycle_renderdistance.message", new Object[]{Integer.valueOf(this.field_71474_y.field_151451_c)});
- return true;
- } else if(p_184122_1_ == 34) {
- boolean boolean = this.field_184132_p.func_190075_b();
- this.func_190521_a(boolean?"debug.chunk_boundaries.on":"debug.chunk_boundaries.off", new Object[0]);
- return true;
- } else if(p_184122_1_ == 35) {
- this.field_71474_y.field_82882_x = !this.field_71474_y.field_82882_x;
- this.func_190521_a(this.field_71474_y.field_82882_x?"debug.advanced_tooltips.on":"debug.advanced_tooltips.off", new Object[0]);
- this.field_71474_y.func_74303_b();
- return true;
- } else if(p_184122_1_ == 49) {
- if(!this.field_71439_g.func_70003_b(2, "")) {
- this.func_190521_a("debug.creative_spectator.error", new Object[0]);
- } else if(this.field_71439_g.func_184812_l_()) {
- this.field_71439_g.func_71165_d("/gamemode spectator");
- } else if(this.field_71439_g.func_175149_v()) {
- this.field_71439_g.func_71165_d("/gamemode creative");
- }
- return true;
- } else if(p_184122_1_ == 25) {
- this.field_71474_y.field_82881_y = !this.field_71474_y.field_82881_y;
- this.field_71474_y.func_74303_b();
- this.func_190521_a(this.field_71474_y.field_82881_y?"debug.pause_focus.on":"debug.pause_focus.off", new Object[0]);
- return true;
- } else if(p_184122_1_ == 16) {
- this.func_190521_a("debug.help.message", new Object[0]);
- GuiNewChat guinewchat = this.field_71456_v.func_146158_b();
- guinewchat.func_146227_a(new TextComponentTranslation("debug.reload_chunks.help", new Object[0]));
- guinewchat.func_146227_a(new TextComponentTranslation("debug.show_hitboxes.help", new Object[0]));
- guinewchat.func_146227_a(new TextComponentTranslation("debug.clear_chat.help", new Object[0]));
- guinewchat.func_146227_a(new TextComponentTranslation("debug.cycle_renderdistance.help", new Object[0]));
- guinewchat.func_146227_a(new TextComponentTranslation("debug.chunk_boundaries.help", new Object[0]));
- guinewchat.func_146227_a(new TextComponentTranslation("debug.advanced_tooltips.help", new Object[0]));
- guinewchat.func_146227_a(new TextComponentTranslation("debug.creative_spectator.help", new Object[0]));
- guinewchat.func_146227_a(new TextComponentTranslation("debug.pause_focus.help", new Object[0]));
- guinewchat.func_146227_a(new TextComponentTranslation("debug.help.help", new Object[0]));
- guinewchat.func_146227_a(new TextComponentTranslation("debug.reload_resourcepacks.help", new Object[0]));
- return true;
- } else if(p_184122_1_ == 20) {
- this.func_190521_a("debug.reload_resourcepacks.message", new Object[0]);
- this.func_110436_a();
- return true;
- } else {
- return false;
- }
- }
- private void func_184117_aA() {
- for(; this.field_71474_y.field_151457_aa.func_151468_f(); this.field_71438_f.func_174979_m()) {
- ++this.field_71474_y.field_74320_O;
- if(this.field_71474_y.field_74320_O > 2) {
- this.field_71474_y.field_74320_O = 0;
- }
- if(this.field_71474_y.field_74320_O == 0) {
- this.field_71460_t.func_175066_a(this.func_175606_aa());
- } else if(this.field_71474_y.field_74320_O == 1) {
- this.field_71460_t.func_175066_a((Entity)null);
- }
- }
- while(this.field_71474_y.field_151458_ab.func_151468_f()) {
- this.field_71474_y.field_74326_T = !this.field_71474_y.field_74326_T;
- }
- for(int int = 0; int < 9; ++int) {
- boolean boolean = this.field_71474_y.field_193629_ap.func_151470_d();
- boolean boolean = this.field_71474_y.field_193630_aq.func_151470_d();
- if(this.field_71474_y.field_151456_ac[int].func_151468_f()) {
- if(this.field_71439_g.func_175149_v()) {
- this.field_71456_v.func_175187_g().func_175260_a(int);
- } else if(!this.field_71439_g.func_184812_l_() || this.field_71462_r != null || !boolean && !boolean) {
- this.field_71439_g.field_71071_by.field_70461_c = int;
- } else {
- GuiContainerCreative.func_192044_a(this, int, boolean, boolean);
- }
- }
- }
- while(this.field_71474_y.field_151445_Q.func_151468_f()) {
- if(this.field_71442_b.func_110738_j()) {
- this.field_71439_g.func_175163_u();
- } else {
- this.field_193035_aW.func_193296_a();
- this.func_147108_a(new GuiInventory(this.field_71439_g));
- }
- }
- while(this.field_71474_y.field_194146_ao.func_151468_f()) {
- this.func_147108_a(new GuiScreenAdvancements(this.field_71439_g.field_71174_a.func_191982_f()));
- }
- while(this.field_71474_y.field_186718_X.func_151468_f()) {
- if(!this.field_71439_g.func_175149_v()) {
- this.func_147114_u().func_147297_a(new CPacketPlayerDigging(CPacketPlayerDigging.Action.SWAP_HELD_ITEMS, BlockPos.field_177992_a, EnumFacing.DOWN));
- }
- }
- while(this.field_71474_y.field_74316_C.func_151468_f()) {
- if(!this.field_71439_g.func_175149_v()) {
- this.field_71439_g.func_71040_bB(GuiScreen.func_146271_m());
- }
- }
- boolean boolean = this.field_71474_y.field_74343_n != EntityPlayer.EnumChatVisibility.HIDDEN;
- if(boolean) {
- while(this.field_71474_y.field_74310_D.func_151468_f()) {
- this.func_147108_a(new GuiChat());
- }
- if(this.field_71462_r == null && this.field_71474_y.field_74323_J.func_151468_f()) {
- this.func_147108_a(new GuiChat("/"));
- }
- }
- if(this.field_71439_g.func_184587_cr()) {
- if(!this.field_71474_y.field_74313_G.func_151470_d()) {
- this.field_71442_b.func_78766_c(this.field_71439_g);
- }
- label556:
- while(true) {
- if(!this.field_71474_y.field_74312_F.func_151468_f()) {
- while(this.field_71474_y.field_74313_G.func_151468_f()) {
- ;
- }
- while(true) {
- if(this.field_71474_y.field_74322_I.func_151468_f()) {
- continue;
- }
- break label556;
- }
- }
- }
- } else {
- while(this.field_71474_y.field_74312_F.func_151468_f()) {
- this.func_147116_af();
- }
- while(this.field_71474_y.field_74313_G.func_151468_f()) {
- this.func_147121_ag();
- }
- while(this.field_71474_y.field_74322_I.func_151468_f()) {
- this.func_147112_ai();
- }
- }
- if(this.field_71474_y.field_74313_G.func_151470_d() && this.field_71467_ac == 0 && !this.field_71439_g.func_184587_cr()) {
- this.func_147121_ag();
- }
- this.func_147115_a(this.field_71462_r == null && this.field_71474_y.field_74312_F.func_151470_d() && this.field_71415_G);
- }
- private void func_184124_aB() throws IOException {
- while(Mouse.next()) {
- int int = Mouse.getEventButton();
- KeyBinding.func_74510_a(int - 100, Mouse.getEventButtonState());
- if(Mouse.getEventButtonState()) {
- if(this.field_71439_g.func_175149_v() && int == 2) {
- this.field_71456_v.func_175187_g().func_175261_b();
- } else {
- KeyBinding.func_74507_a(int - 100);
- }
- }
- long long = func_71386_F() - this.field_71423_H;
- if(long <= 200L) {
- int int = Mouse.getEventDWheel();
- if(int != 0) {
- if(this.field_71439_g.func_175149_v()) {
- int = int < 0?-1:1;
- if(this.field_71456_v.func_175187_g().func_175262_a()) {
- this.field_71456_v.func_175187_g().func_175259_b(-int);
- } else {
- float float = MathHelper.func_76131_a(this.field_71439_g.field_71075_bZ.func_75093_a() + (float)int * 0.005F, 0.0F, 0.2F);
- this.field_71439_g.field_71075_bZ.func_75092_a(float);
- }
- } else {
- this.field_71439_g.field_71071_by.func_70453_c(int);
- }
- }
- if(this.field_71462_r == null) {
- if(!this.field_71415_G && Mouse.getEventButtonState()) {
- this.func_71381_h();
- }
- } else if(this.field_71462_r != null) {
- this.field_71462_r.func_146274_d();
- }
- }
- }
- }
- private void func_190521_a(String p_190521_1_, Object... p_190521_2_) {
- 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_)));
- }
- public void func_71371_a(String p_71371_1_, String p_71371_2_, @Nullable WorldSettings p_71371_3_) {
- this.func_71403_a((WorldClient)null);
- System.gc();
- ISaveHandler isavehandler = this.field_71469_aa.func_75804_a(p_71371_1_, false);
- WorldInfo worldinfo = isavehandler.func_75757_d();
- if(worldinfo == null && p_71371_3_ != null) {
- worldinfo = new WorldInfo(p_71371_3_, p_71371_1_);
- isavehandler.func_75761_a(worldinfo);
- }
- if(p_71371_3_ == null) {
- p_71371_3_ = new WorldSettings(worldinfo);
- }
- try {
- YggdrasilAuthenticationService yggdrasilauthenticationservice = new YggdrasilAuthenticationService(this.field_110453_aa, UUID.randomUUID().toString());
- MinecraftSessionService minecraftsessionservice = yggdrasilauthenticationservice.createMinecraftSessionService();
- GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository();
- PlayerProfileCache playerprofilecache = new PlayerProfileCache(gameprofilerepository, new File(this.field_71412_D, MinecraftServer.field_152367_a.getName()));
- TileEntitySkull.func_184293_a(playerprofilecache);
- TileEntitySkull.func_184294_a(minecraftsessionservice);
- PlayerProfileCache.func_187320_a(false);
- this.field_71437_Z = new IntegratedServer(this, p_71371_1_, p_71371_2_, p_71371_3_, yggdrasilauthenticationservice, minecraftsessionservice, gameprofilerepository, playerprofilecache);
- this.field_71437_Z.func_71256_s();
- this.field_71455_al = true;
- } catch (Throwable throwable) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable, "Starting integrated server");
- CrashReportCategory crashreportcategory = crashreport.func_85058_a("Starting integrated server");
- crashreportcategory.func_71507_a("Level ID", p_71371_1_);
- crashreportcategory.func_71507_a("Level Name", p_71371_2_);
- throw new ReportedException(crashreport);
- }
- this.field_71461_s.func_73720_a(I18n.func_135052_a("menu.loadingLevel", new Object[0]));
- while(!this.field_71437_Z.func_71200_ad()) {
- String string = this.field_71437_Z.func_71195_b_();
- if(string != null) {
- this.field_71461_s.func_73719_c(I18n.func_135052_a(string, new Object[0]));
- } else {
- this.field_71461_s.func_73719_c("");
- }
- try {
- Thread.sleep(200L);
- } catch (InterruptedException var10) {
- ;
- }
- }
- this.func_147108_a(new GuiScreenWorking());
- SocketAddress socketaddress = this.field_71437_Z.func_147137_ag().func_151270_a();
- NetworkManager networkmanager = NetworkManager.func_150722_a(socketaddress);
- networkmanager.func_150719_a(new NetHandlerLoginClient(networkmanager, this, (GuiScreen)null));
- networkmanager.func_179290_a(new C00Handshake(335, socketaddress.toString(), 0, EnumConnectionState.LOGIN));
- networkmanager.func_179290_a(new CPacketLoginStart(this.func_110432_I().func_148256_e()));
- this.field_71453_ak = networkmanager;
- }
- public void func_71403_a(@Nullable WorldClient p_71403_1_) {
- this.func_71353_a(p_71403_1_, "");
- }
- public void func_71353_a(@Nullable WorldClient p_71353_1_, String p_71353_2_) {
- if(p_71353_1_ == null) {
- NetHandlerPlayClient nethandlerplayclient = this.func_147114_u();
- if(nethandlerplayclient != null) {
- nethandlerplayclient.func_147296_c();
- }
- if(this.field_71437_Z != null && this.field_71437_Z.func_175578_N()) {
- this.field_71437_Z.func_71263_m();
- }
- this.field_71437_Z = null;
- this.field_71460_t.func_190564_k();
- this.field_71442_b = null;
- NarratorChatListener.field_193643_a.func_193642_b();
- }
- this.field_175622_Z = null;
- this.field_71453_ak = null;
- if(this.field_71461_s != null) {
- this.field_71461_s.func_73721_b(p_71353_2_);
- this.field_71461_s.func_73719_c("");
- }
- if(p_71353_1_ == null && this.field_71441_e != null) {
- this.field_110448_aq.func_148529_f();
- this.field_71456_v.func_181029_i();
- this.func_71351_a((ServerData)null);
- this.field_71455_al = false;
- }
- this.field_147127_av.func_147690_c();
- this.field_71441_e = p_71353_1_;
- if(this.field_71438_f != null) {
- this.field_71438_f.func_72732_a(p_71353_1_);
- }
- if(this.field_71452_i != null) {
- this.field_71452_i.func_78870_a(p_71353_1_);
- }
- TileEntityRendererDispatcher.field_147556_a.func_147543_a(p_71353_1_);
- if(p_71353_1_ != null) {
- if(!this.field_71455_al) {
- AuthenticationService authenticationservice = new YggdrasilAuthenticationService(this.field_110453_aa, UUID.randomUUID().toString());
- MinecraftSessionService minecraftsessionservice = authenticationservice.createMinecraftSessionService();
- GameProfileRepository gameprofilerepository = authenticationservice.createProfileRepository();
- PlayerProfileCache playerprofilecache = new PlayerProfileCache(gameprofilerepository, new File(this.field_71412_D, MinecraftServer.field_152367_a.getName()));
- TileEntitySkull.func_184293_a(playerprofilecache);
- TileEntitySkull.func_184294_a(minecraftsessionservice);
- PlayerProfileCache.func_187320_a(false);
- }
- if(this.field_71439_g == null) {
- this.field_71439_g = this.field_71442_b.func_192830_a(p_71353_1_, new StatisticsManager(), new RecipeBookClient());
- this.field_71442_b.func_78745_b(this.field_71439_g);
- }
- this.field_71439_g.func_70065_x();
- p_71353_1_.func_72838_d(this.field_71439_g);
- this.field_71439_g.field_71158_b = new MovementInputFromOptions(this.field_71474_y);
- this.field_71442_b.func_78748_a(this.field_71439_g);
- this.field_175622_Z = this.field_71439_g;
- } else {
- this.field_71469_aa.func_75800_d();
- this.field_71439_g = null;
- }
- System.gc();
- this.field_71423_H = 0L;
- }
- public void func_71354_a(int p_71354_1_) {
- this.field_71441_e.func_72974_f();
- this.field_71441_e.func_73022_a();
- int int = 0;
- String string = null;
- if(this.field_71439_g != null) {
- int = this.field_71439_g.func_145782_y();
- this.field_71441_e.func_72900_e(this.field_71439_g);
- string = this.field_71439_g.func_142021_k();
- }
- this.field_175622_Z = null;
- EntityPlayerSP entityplayersp = this.field_71439_g;
- 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());
- this.field_71439_g.func_184212_Q().func_187218_a(entityplayersp.func_184212_Q().func_187231_c());
- this.field_71439_g.field_71093_bK = p_71354_1_;
- this.field_175622_Z = this.field_71439_g;
- this.field_71439_g.func_70065_x();
- this.field_71439_g.func_175158_f(string);
- this.field_71441_e.func_72838_d(this.field_71439_g);
- this.field_71442_b.func_78745_b(this.field_71439_g);
- this.field_71439_g.field_71158_b = new MovementInputFromOptions(this.field_71474_y);
- this.field_71439_g.func_145769_d(int);
- this.field_71442_b.func_78748_a(this.field_71439_g);
- this.field_71439_g.func_175150_k(entityplayersp.func_175140_cp());
- if(this.field_71462_r instanceof GuiGameOver) {
- this.func_147108_a((GuiScreen)null);
- }
- }
- public final boolean func_71355_q() {
- return this.field_71459_aj;
- }
- @Nullable
- public NetHandlerPlayClient func_147114_u() {
- return this.field_71439_g == null?null:this.field_71439_g.field_71174_a;
- }
- public static boolean func_71382_s() {
- return field_71432_P == null || !field_71432_P.field_71474_y.field_74319_N;
- }
- public static boolean func_71375_t() {
- return field_71432_P != null && field_71432_P.field_71474_y.field_74347_j;
- }
- public static boolean func_71379_u() {
- return field_71432_P != null && field_71432_P.field_71474_y.field_74348_k != 0;
- }
- private void func_147112_ai() {
- if(this.field_71476_x != null && this.field_71476_x.field_72313_a != RayTraceResult.Type.MISS) {
- boolean boolean = this.field_71439_g.field_71075_bZ.field_75098_d;
- TileEntity tileentity = null;
- ItemStack itemstack;
- if(this.field_71476_x.field_72313_a == RayTraceResult.Type.BLOCK) {
- BlockPos blockpos = this.field_71476_x.func_178782_a();
- IBlockState iblockstate = this.field_71441_e.func_180495_p(blockpos);
- Block block = iblockstate.func_177230_c();
- if(iblockstate.func_185904_a() == Material.field_151579_a) {
- return;
- }
- itemstack = block.func_185473_a(this.field_71441_e, blockpos, iblockstate);
- if(itemstack.func_190926_b()) {
- return;
- }
- if(boolean && GuiScreen.func_146271_m() && block.func_149716_u()) {
- tileentity = this.field_71441_e.func_175625_s(blockpos);
- }
- } else {
- if(this.field_71476_x.field_72313_a != RayTraceResult.Type.ENTITY || this.field_71476_x.field_72308_g == null || !boolean) {
- return;
- }
- if(this.field_71476_x.field_72308_g instanceof EntityPainting) {
- itemstack = new ItemStack(Items.field_151159_an);
- } else if(this.field_71476_x.field_72308_g instanceof EntityLeashKnot) {
- itemstack = new ItemStack(Items.field_151058_ca);
- } else if(this.field_71476_x.field_72308_g instanceof EntityItemFrame) {
- EntityItemFrame entityitemframe = (EntityItemFrame)this.field_71476_x.field_72308_g;
- ItemStack itemstack1 = entityitemframe.func_82335_i();
- if(itemstack1.func_190926_b()) {
- itemstack = new ItemStack(Items.field_151160_bD);
- } else {
- itemstack = itemstack1.func_77946_l();
- }
- } else if(this.field_71476_x.field_72308_g instanceof EntityMinecart) {
- EntityMinecart entityminecart = (EntityMinecart)this.field_71476_x.field_72308_g;
- Item item;
- switch(entityminecart.func_184264_v()) {
- case FURNACE:
- item = Items.field_151109_aJ;
- break;
- case CHEST:
- item = Items.field_151108_aI;
- break;
- case TNT:
- item = Items.field_151142_bV;
- break;
- case HOPPER:
- item = Items.field_151140_bW;
- break;
- case COMMAND_BLOCK:
- item = Items.field_151095_cc;
- break;
- default:
- item = Items.field_151143_au;
- }
- itemstack = new ItemStack(item);
- } else if(this.field_71476_x.field_72308_g instanceof EntityBoat) {
- itemstack = new ItemStack(((EntityBoat)this.field_71476_x.field_72308_g).func_184455_j());
- } else if(this.field_71476_x.field_72308_g instanceof EntityArmorStand) {
- itemstack = new ItemStack(Items.field_179565_cj);
- } else if(this.field_71476_x.field_72308_g instanceof EntityEnderCrystal) {
- itemstack = new ItemStack(Items.field_185158_cP);
- } else {
- ResourceLocation resourcelocation = EntityList.func_191301_a(this.field_71476_x.field_72308_g);
- if(resourcelocation == null || !EntityList.field_75627_a.containsKey(resourcelocation)) {
- return;
- }
- itemstack = new ItemStack(Items.field_151063_bx);
- ItemMonsterPlacer.func_185078_a(itemstack, resourcelocation);
- }
- }
- if(itemstack.func_190926_b()) {
- String string = "";
- if(this.field_71476_x.field_72313_a == RayTraceResult.Type.BLOCK) {
- 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();
- } else if(this.field_71476_x.field_72313_a == RayTraceResult.Type.ENTITY) {
- string = EntityList.func_191301_a(this.field_71476_x.field_72308_g).toString();
- }
- field_147123_G.warn((String)"Picking on: [{}] {} gave null item", (Object)this.field_71476_x.field_72313_a, (Object)string);
- } else {
- InventoryPlayer inventoryplayer = this.field_71439_g.field_71071_by;
- if(tileentity != null) {
- this.func_184119_a(itemstack, tileentity);
- }
- int int = inventoryplayer.func_184429_b(itemstack);
- if(boolean) {
- inventoryplayer.func_184434_a(itemstack);
- this.field_71442_b.func_78761_a(this.field_71439_g.func_184586_b(EnumHand.MAIN_HAND), 36 + inventoryplayer.field_70461_c);
- } else if(int != -1) {
- if(InventoryPlayer.func_184435_e(int)) {
- inventoryplayer.field_70461_c = int;
- } else {
- this.field_71442_b.func_187100_a(int);
- }
- }
- }
- }
- }
- public ItemStack func_184119_a(ItemStack p_184119_1_, TileEntity p_184119_2_) {
- NBTTagCompound nbttagcompound = p_184119_2_.func_189515_b(new NBTTagCompound());
- if(p_184119_1_.func_77973_b() == Items.field_151144_bL && nbttagcompound.func_74764_b("Owner")) {
- NBTTagCompound nbttagcompound2 = nbttagcompound.func_74775_l("Owner");
- NBTTagCompound nbttagcompound3 = new NBTTagCompound();
- nbttagcompound3.func_74782_a("SkullOwner", nbttagcompound2);
- p_184119_1_.func_77982_d(nbttagcompound3);
- return p_184119_1_;
- } else {
- p_184119_1_.func_77983_a("BlockEntityTag", nbttagcompound);
- NBTTagCompound nbttagcompound1 = new NBTTagCompound();
- NBTTagList nbttaglist = new NBTTagList();
- nbttaglist.func_74742_a(new NBTTagString("(+NBT)"));
- nbttagcompound1.func_74782_a("Lore", nbttaglist);
- p_184119_1_.func_77983_a("display", nbttagcompound1);
- return p_184119_1_;
- }
- }
- public CrashReport func_71396_d(CrashReport p_71396_1_) {
- p_71396_1_.func_85056_g().func_189529_a("Launched Version", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return Minecraft.this.field_110447_Z;
- }
- });
- p_71396_1_.func_85056_g().func_189529_a("LWJGL", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return Sys.getVersion();
- }
- });
- p_71396_1_.func_85056_g().func_189529_a("OpenGL", new ICrashReportDetail<String>() {
- public String call() {
- return GlStateManager.func_187416_u(7937) + " GL version " + GlStateManager.func_187416_u(7938) + ", " + GlStateManager.func_187416_u(7936);
- }
- });
- p_71396_1_.func_85056_g().func_189529_a("GL Caps", new ICrashReportDetail<String>() {
- public String call() {
- return OpenGlHelper.func_153172_c();
- }
- });
- p_71396_1_.func_85056_g().func_189529_a("Using VBOs", new ICrashReportDetail<String>() {
- public String call() {
- return Minecraft.this.field_71474_y.field_178881_t?"Yes":"No";
- }
- });
- p_71396_1_.func_85056_g().func_189529_a("Is Modded", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- String string = ClientBrandRetriever.getClientModName();
- 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.");
- }
- });
- p_71396_1_.func_85056_g().func_189529_a("Type", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return "Client (map_client.txt)";
- }
- });
- p_71396_1_.func_85056_g().func_189529_a("Resource Packs", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- StringBuilder stringbuilder = new StringBuilder();
- for(String string : Minecraft.this.field_71474_y.field_151453_l) {
- if(stringbuilder.length() > 0) {
- stringbuilder.append(", ");
- }
- stringbuilder.append(string);
- if(Minecraft.this.field_71474_y.field_183018_l.contains(string)) {
- stringbuilder.append(" (incompatible)");
- }
- }
- return stringbuilder.toString();
- }
- });
- p_71396_1_.func_85056_g().func_189529_a("Current Language", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return Minecraft.this.field_135017_as.func_135041_c().toString();
- }
- });
- p_71396_1_.func_85056_g().func_189529_a("Profiler Position", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return Minecraft.this.field_71424_I.field_76327_a?Minecraft.this.field_71424_I.func_76322_c():"N/A (disabled)";
- }
- });
- p_71396_1_.func_85056_g().func_189529_a("CPU", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return OpenGlHelper.func_183029_j();
- }
- });
- if(this.field_71441_e != null) {
- this.field_71441_e.func_72914_a(p_71396_1_);
- }
- return p_71396_1_;
- }
- public static Minecraft func_71410_x() {
- return field_71432_P;
- }
- public ListenableFuture<Object> func_175603_A() {
- return this.func_152344_a(new Runnable() {
- public void run() {
- Minecraft.this.func_110436_a();
- }
- });
- }
- public void func_70000_a(Snooper p_70000_1_) {
- p_70000_1_.func_152768_a("fps", Integer.valueOf(field_71470_ab));
- p_70000_1_.func_152768_a("vsync_enabled", Boolean.valueOf(this.field_71474_y.field_74352_v));
- p_70000_1_.func_152768_a("display_frequency", Integer.valueOf(Display.getDisplayMode().getFrequency()));
- p_70000_1_.func_152768_a("display_type", this.field_71431_Q?"fullscreen":"windowed");
- p_70000_1_.func_152768_a("run_time", Long.valueOf((MinecraftServer.func_130071_aq() - p_70000_1_.func_130105_g()) / 60L * 1000L));
- p_70000_1_.func_152768_a("current_action", this.func_181538_aA());
- p_70000_1_.func_152768_a("language", this.field_71474_y.field_74363_ab == null?"en_us":this.field_71474_y.field_74363_ab);
- String string = ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN?"little":"big";
- p_70000_1_.func_152768_a("endianness", string);
- p_70000_1_.func_152768_a("subtitles", Boolean.valueOf(this.field_71474_y.field_186717_N));
- p_70000_1_.func_152768_a("touch", this.field_71474_y.field_85185_A?"touch":"mouse");
- p_70000_1_.func_152768_a("resource_packs", Integer.valueOf(this.field_110448_aq.func_110613_c().size()));
- int int = 0;
- for(ResourcePackRepository.Entry resourcepackrepository$entry : this.field_110448_aq.func_110613_c()) {
- p_70000_1_.func_152768_a("resource_pack[" + int++ + "]", resourcepackrepository$entry.func_110515_d());
- }
- if(this.field_71437_Z != null && this.field_71437_Z.func_80003_ah() != null) {
- p_70000_1_.func_152768_a("snooper_partner", this.field_71437_Z.func_80003_ah().func_80006_f());
- }
- }
- private String func_181538_aA() {
- 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");
- }
- public void func_70001_b(Snooper p_70001_1_) {
- p_70001_1_.func_152767_b("opengl_version", GlStateManager.func_187416_u(7938));
- p_70001_1_.func_152767_b("opengl_vendor", GlStateManager.func_187416_u(7936));
- p_70001_1_.func_152767_b("client_brand", ClientBrandRetriever.getClientModName());
- p_70001_1_.func_152767_b("launched_version", this.field_110447_Z);
- ContextCapabilities contextcapabilities = GLContext.getCapabilities();
- p_70001_1_.func_152767_b("gl_caps[ARB_arrays_of_arrays]", Boolean.valueOf(contextcapabilities.GL_ARB_arrays_of_arrays));
- p_70001_1_.func_152767_b("gl_caps[ARB_base_instance]", Boolean.valueOf(contextcapabilities.GL_ARB_base_instance));
- p_70001_1_.func_152767_b("gl_caps[ARB_blend_func_extended]", Boolean.valueOf(contextcapabilities.GL_ARB_blend_func_extended));
- p_70001_1_.func_152767_b("gl_caps[ARB_clear_buffer_object]", Boolean.valueOf(contextcapabilities.GL_ARB_clear_buffer_object));
- p_70001_1_.func_152767_b("gl_caps[ARB_color_buffer_float]", Boolean.valueOf(contextcapabilities.GL_ARB_color_buffer_float));
- p_70001_1_.func_152767_b("gl_caps[ARB_compatibility]", Boolean.valueOf(contextcapabilities.GL_ARB_compatibility));
- p_70001_1_.func_152767_b("gl_caps[ARB_compressed_texture_pixel_storage]", Boolean.valueOf(contextcapabilities.GL_ARB_compressed_texture_pixel_storage));
- p_70001_1_.func_152767_b("gl_caps[ARB_compute_shader]", Boolean.valueOf(contextcapabilities.GL_ARB_compute_shader));
- p_70001_1_.func_152767_b("gl_caps[ARB_copy_buffer]", Boolean.valueOf(contextcapabilities.GL_ARB_copy_buffer));
- p_70001_1_.func_152767_b("gl_caps[ARB_copy_image]", Boolean.valueOf(contextcapabilities.GL_ARB_copy_image));
- p_70001_1_.func_152767_b("gl_caps[ARB_depth_buffer_float]", Boolean.valueOf(contextcapabilities.GL_ARB_depth_buffer_float));
- p_70001_1_.func_152767_b("gl_caps[ARB_compute_shader]", Boolean.valueOf(contextcapabilities.GL_ARB_compute_shader));
- p_70001_1_.func_152767_b("gl_caps[ARB_copy_buffer]", Boolean.valueOf(contextcapabilities.GL_ARB_copy_buffer));
- p_70001_1_.func_152767_b("gl_caps[ARB_copy_image]", Boolean.valueOf(contextcapabilities.GL_ARB_copy_image));
- p_70001_1_.func_152767_b("gl_caps[ARB_depth_buffer_float]", Boolean.valueOf(contextcapabilities.GL_ARB_depth_buffer_float));
- p_70001_1_.func_152767_b("gl_caps[ARB_depth_clamp]", Boolean.valueOf(contextcapabilities.GL_ARB_depth_clamp));
- p_70001_1_.func_152767_b("gl_caps[ARB_depth_texture]", Boolean.valueOf(contextcapabilities.GL_ARB_depth_texture));
- p_70001_1_.func_152767_b("gl_caps[ARB_draw_buffers]", Boolean.valueOf(contextcapabilities.GL_ARB_draw_buffers));
- p_70001_1_.func_152767_b("gl_caps[ARB_draw_buffers_blend]", Boolean.valueOf(contextcapabilities.GL_ARB_draw_buffers_blend));
- p_70001_1_.func_152767_b("gl_caps[ARB_draw_elements_base_vertex]", Boolean.valueOf(contextcapabilities.GL_ARB_draw_elements_base_vertex));
- p_70001_1_.func_152767_b("gl_caps[ARB_draw_indirect]", Boolean.valueOf(contextcapabilities.GL_ARB_draw_indirect));
- p_70001_1_.func_152767_b("gl_caps[ARB_draw_instanced]", Boolean.valueOf(contextcapabilities.GL_ARB_draw_instanced));
- p_70001_1_.func_152767_b("gl_caps[ARB_explicit_attrib_location]", Boolean.valueOf(contextcapabilities.GL_ARB_explicit_attrib_location));
- p_70001_1_.func_152767_b("gl_caps[ARB_explicit_uniform_location]", Boolean.valueOf(contextcapabilities.GL_ARB_explicit_uniform_location));
- p_70001_1_.func_152767_b("gl_caps[ARB_fragment_layer_viewport]", Boolean.valueOf(contextcapabilities.GL_ARB_fragment_layer_viewport));
- p_70001_1_.func_152767_b("gl_caps[ARB_fragment_program]", Boolean.valueOf(contextcapabilities.GL_ARB_fragment_program));
- p_70001_1_.func_152767_b("gl_caps[ARB_fragment_shader]", Boolean.valueOf(contextcapabilities.GL_ARB_fragment_shader));
- p_70001_1_.func_152767_b("gl_caps[ARB_fragment_program_shadow]", Boolean.valueOf(contextcapabilities.GL_ARB_fragment_program_shadow));
- p_70001_1_.func_152767_b("gl_caps[ARB_framebuffer_object]", Boolean.valueOf(contextcapabilities.GL_ARB_framebuffer_object));
- p_70001_1_.func_152767_b("gl_caps[ARB_framebuffer_sRGB]", Boolean.valueOf(contextcapabilities.GL_ARB_framebuffer_sRGB));
- p_70001_1_.func_152767_b("gl_caps[ARB_geometry_shader4]", Boolean.valueOf(contextcapabilities.GL_ARB_geometry_shader4));
- p_70001_1_.func_152767_b("gl_caps[ARB_gpu_shader5]", Boolean.valueOf(contextcapabilities.GL_ARB_gpu_shader5));
- p_70001_1_.func_152767_b("gl_caps[ARB_half_float_pixel]", Boolean.valueOf(contextcapabilities.GL_ARB_half_float_pixel));
- p_70001_1_.func_152767_b("gl_caps[ARB_half_float_vertex]", Boolean.valueOf(contextcapabilities.GL_ARB_half_float_vertex));
- p_70001_1_.func_152767_b("gl_caps[ARB_instanced_arrays]", Boolean.valueOf(contextcapabilities.GL_ARB_instanced_arrays));
- p_70001_1_.func_152767_b("gl_caps[ARB_map_buffer_alignment]", Boolean.valueOf(contextcapabilities.GL_ARB_map_buffer_alignment));
- p_70001_1_.func_152767_b("gl_caps[ARB_map_buffer_range]", Boolean.valueOf(contextcapabilities.GL_ARB_map_buffer_range));
- p_70001_1_.func_152767_b("gl_caps[ARB_multisample]", Boolean.valueOf(contextcapabilities.GL_ARB_multisample));
- p_70001_1_.func_152767_b("gl_caps[ARB_multitexture]", Boolean.valueOf(contextcapabilities.GL_ARB_multitexture));
- p_70001_1_.func_152767_b("gl_caps[ARB_occlusion_query2]", Boolean.valueOf(contextcapabilities.GL_ARB_occlusion_query2));
- p_70001_1_.func_152767_b("gl_caps[ARB_pixel_buffer_object]", Boolean.valueOf(contextcapabilities.GL_ARB_pixel_buffer_object));
- p_70001_1_.func_152767_b("gl_caps[ARB_seamless_cube_map]", Boolean.valueOf(contextcapabilities.GL_ARB_seamless_cube_map));
- p_70001_1_.func_152767_b("gl_caps[ARB_shader_objects]", Boolean.valueOf(contextcapabilities.GL_ARB_shader_objects));
- p_70001_1_.func_152767_b("gl_caps[ARB_shader_stencil_export]", Boolean.valueOf(contextcapabilities.GL_ARB_shader_stencil_export));
- p_70001_1_.func_152767_b("gl_caps[ARB_shader_texture_lod]", Boolean.valueOf(contextcapabilities.GL_ARB_shader_texture_lod));
- p_70001_1_.func_152767_b("gl_caps[ARB_shadow]", Boolean.valueOf(contextcapabilities.GL_ARB_shadow));
- p_70001_1_.func_152767_b("gl_caps[ARB_shadow_ambient]", Boolean.valueOf(contextcapabilities.GL_ARB_shadow_ambient));
- p_70001_1_.func_152767_b("gl_caps[ARB_stencil_texturing]", Boolean.valueOf(contextcapabilities.GL_ARB_stencil_texturing));
- p_70001_1_.func_152767_b("gl_caps[ARB_sync]", Boolean.valueOf(contextcapabilities.GL_ARB_sync));
- p_70001_1_.func_152767_b("gl_caps[ARB_tessellation_shader]", Boolean.valueOf(contextcapabilities.GL_ARB_tessellation_shader));
- p_70001_1_.func_152767_b("gl_caps[ARB_texture_border_clamp]", Boolean.valueOf(contextcapabilities.GL_ARB_texture_border_clamp));
- p_70001_1_.func_152767_b("gl_caps[ARB_texture_buffer_object]", Boolean.valueOf(contextcapabilities.GL_ARB_texture_buffer_object));
- p_70001_1_.func_152767_b("gl_caps[ARB_texture_cube_map]", Boolean.valueOf(contextcapabilities.GL_ARB_texture_cube_map));
- p_70001_1_.func_152767_b("gl_caps[ARB_texture_cube_map_array]", Boolean.valueOf(contextcapabilities.GL_ARB_texture_cube_map_array));
- p_70001_1_.func_152767_b("gl_caps[ARB_texture_non_power_of_two]", Boolean.valueOf(contextcapabilities.GL_ARB_texture_non_power_of_two));
- p_70001_1_.func_152767_b("gl_caps[ARB_uniform_buffer_object]", Boolean.valueOf(contextcapabilities.GL_ARB_uniform_buffer_object));
- p_70001_1_.func_152767_b("gl_caps[ARB_vertex_blend]", Boolean.valueOf(contextcapabilities.GL_ARB_vertex_blend));
- p_70001_1_.func_152767_b("gl_caps[ARB_vertex_buffer_object]", Boolean.valueOf(contextcapabilities.GL_ARB_vertex_buffer_object));
- p_70001_1_.func_152767_b("gl_caps[ARB_vertex_program]", Boolean.valueOf(contextcapabilities.GL_ARB_vertex_program));
- p_70001_1_.func_152767_b("gl_caps[ARB_vertex_shader]", Boolean.valueOf(contextcapabilities.GL_ARB_vertex_shader));
- p_70001_1_.func_152767_b("gl_caps[EXT_bindable_uniform]", Boolean.valueOf(contextcapabilities.GL_EXT_bindable_uniform));
- p_70001_1_.func_152767_b("gl_caps[EXT_blend_equation_separate]", Boolean.valueOf(contextcapabilities.GL_EXT_blend_equation_separate));
- p_70001_1_.func_152767_b("gl_caps[EXT_blend_func_separate]", Boolean.valueOf(contextcapabilities.GL_EXT_blend_func_separate));
- p_70001_1_.func_152767_b("gl_caps[EXT_blend_minmax]", Boolean.valueOf(contextcapabilities.GL_EXT_blend_minmax));
- p_70001_1_.func_152767_b("gl_caps[EXT_blend_subtract]", Boolean.valueOf(contextcapabilities.GL_EXT_blend_subtract));
- p_70001_1_.func_152767_b("gl_caps[EXT_draw_instanced]", Boolean.valueOf(contextcapabilities.GL_EXT_draw_instanced));
- p_70001_1_.func_152767_b("gl_caps[EXT_framebuffer_multisample]", Boolean.valueOf(contextcapabilities.GL_EXT_framebuffer_multisample));
- p_70001_1_.func_152767_b("gl_caps[EXT_framebuffer_object]", Boolean.valueOf(contextcapabilities.GL_EXT_framebuffer_object));
- p_70001_1_.func_152767_b("gl_caps[EXT_framebuffer_sRGB]", Boolean.valueOf(contextcapabilities.GL_EXT_framebuffer_sRGB));
- p_70001_1_.func_152767_b("gl_caps[EXT_geometry_shader4]", Boolean.valueOf(contextcapabilities.GL_EXT_geometry_shader4));
- p_70001_1_.func_152767_b("gl_caps[EXT_gpu_program_parameters]", Boolean.valueOf(contextcapabilities.GL_EXT_gpu_program_parameters));
- p_70001_1_.func_152767_b("gl_caps[EXT_gpu_shader4]", Boolean.valueOf(contextcapabilities.GL_EXT_gpu_shader4));
- p_70001_1_.func_152767_b("gl_caps[EXT_multi_draw_arrays]", Boolean.valueOf(contextcapabilities.GL_EXT_multi_draw_arrays));
- p_70001_1_.func_152767_b("gl_caps[EXT_packed_depth_stencil]", Boolean.valueOf(contextcapabilities.GL_EXT_packed_depth_stencil));
- p_70001_1_.func_152767_b("gl_caps[EXT_paletted_texture]", Boolean.valueOf(contextcapabilities.GL_EXT_paletted_texture));
- p_70001_1_.func_152767_b("gl_caps[EXT_rescale_normal]", Boolean.valueOf(contextcapabilities.GL_EXT_rescale_normal));
- p_70001_1_.func_152767_b("gl_caps[EXT_separate_shader_objects]", Boolean.valueOf(contextcapabilities.GL_EXT_separate_shader_objects));
- p_70001_1_.func_152767_b("gl_caps[EXT_shader_image_load_store]", Boolean.valueOf(contextcapabilities.GL_EXT_shader_image_load_store));
- p_70001_1_.func_152767_b("gl_caps[EXT_shadow_funcs]", Boolean.valueOf(contextcapabilities.GL_EXT_shadow_funcs));
- p_70001_1_.func_152767_b("gl_caps[EXT_shared_texture_palette]", Boolean.valueOf(contextcapabilities.GL_EXT_shared_texture_palette));
- p_70001_1_.func_152767_b("gl_caps[EXT_stencil_clear_tag]", Boolean.valueOf(contextcapabilities.GL_EXT_stencil_clear_tag));
- p_70001_1_.func_152767_b("gl_caps[EXT_stencil_two_side]", Boolean.valueOf(contextcapabilities.GL_EXT_stencil_two_side));
- p_70001_1_.func_152767_b("gl_caps[EXT_stencil_wrap]", Boolean.valueOf(contextcapabilities.GL_EXT_stencil_wrap));
- p_70001_1_.func_152767_b("gl_caps[EXT_texture_3d]", Boolean.valueOf(contextcapabilities.GL_EXT_texture_3d));
- p_70001_1_.func_152767_b("gl_caps[EXT_texture_array]", Boolean.valueOf(contextcapabilities.GL_EXT_texture_array));
- p_70001_1_.func_152767_b("gl_caps[EXT_texture_buffer_object]", Boolean.valueOf(contextcapabilities.GL_EXT_texture_buffer_object));
- p_70001_1_.func_152767_b("gl_caps[EXT_texture_integer]", Boolean.valueOf(contextcapabilities.GL_EXT_texture_integer));
- p_70001_1_.func_152767_b("gl_caps[EXT_texture_lod_bias]", Boolean.valueOf(contextcapabilities.GL_EXT_texture_lod_bias));
- p_70001_1_.func_152767_b("gl_caps[EXT_texture_sRGB]", Boolean.valueOf(contextcapabilities.GL_EXT_texture_sRGB));
- p_70001_1_.func_152767_b("gl_caps[EXT_vertex_shader]", Boolean.valueOf(contextcapabilities.GL_EXT_vertex_shader));
- p_70001_1_.func_152767_b("gl_caps[EXT_vertex_weighting]", Boolean.valueOf(contextcapabilities.GL_EXT_vertex_weighting));
- p_70001_1_.func_152767_b("gl_caps[gl_max_vertex_uniforms]", Integer.valueOf(GlStateManager.func_187397_v('\u8b4a')));
- GlStateManager.func_187434_L();
- p_70001_1_.func_152767_b("gl_caps[gl_max_fragment_uniforms]", Integer.valueOf(GlStateManager.func_187397_v('\u8b49')));
- GlStateManager.func_187434_L();
- p_70001_1_.func_152767_b("gl_caps[gl_max_vertex_attribs]", Integer.valueOf(GlStateManager.func_187397_v('\u8869')));
- GlStateManager.func_187434_L();
- p_70001_1_.func_152767_b("gl_caps[gl_max_vertex_texture_image_units]", Integer.valueOf(GlStateManager.func_187397_v('\u8b4c')));
- GlStateManager.func_187434_L();
- p_70001_1_.func_152767_b("gl_caps[gl_max_texture_image_units]", Integer.valueOf(GlStateManager.func_187397_v('\u8872')));
- GlStateManager.func_187434_L();
- p_70001_1_.func_152767_b("gl_caps[gl_max_array_texture_layers]", Integer.valueOf(GlStateManager.func_187397_v('\u88ff')));
- GlStateManager.func_187434_L();
- p_70001_1_.func_152767_b("gl_max_texture_size", Integer.valueOf(func_71369_N()));
- GameProfile gameprofile = this.field_71449_j.func_148256_e();
- if(gameprofile != null && gameprofile.getId() != null) {
- p_70001_1_.func_152767_b("uuid", Hashing.sha1().hashBytes(gameprofile.getId().toString().getBytes(Charsets.ISO_8859_1)).toString());
- }
- }
- public static int func_71369_N() {
- for(int int = 16384; int > 0; int >>= 1) {
- GlStateManager.func_187419_a('\u8064', 0, 6408, int, int, 0, 6408, 5121, (IntBuffer)null);
- int int = GlStateManager.func_187411_c('\u8064', 0, 4096);
- if(int != 0) {
- return int;
- }
- }
- return -1;
- }
- public boolean func_70002_Q() {
- return this.field_71474_y.field_74355_t;
- }
- public void func_71351_a(ServerData p_71351_1_) {
- this.field_71422_O = p_71351_1_;
- }
- @Nullable
- public ServerData func_147104_D() {
- return this.field_71422_O;
- }
- public boolean func_71387_A() {
- return this.field_71455_al;
- }
- public boolean func_71356_B() {
- return this.field_71455_al && this.field_71437_Z != null;
- }
- @Nullable
- public IntegratedServer func_71401_C() {
- return this.field_71437_Z;
- }
- public static void func_71363_D() {
- if(field_71432_P != null) {
- IntegratedServer integratedserver = field_71432_P.func_71401_C();
- if(integratedserver != null) {
- integratedserver.func_71260_j();
- }
- }
- }
- public Snooper func_71378_E() {
- return this.field_71427_U;
- }
- public static long func_71386_F() {
- return Sys.getTime() * 1000L / Sys.getTimerResolution();
- }
- public boolean func_71372_G() {
- return this.field_71431_Q;
- }
- public Session func_110432_I() {
- return this.field_71449_j;
- }
- public PropertyMap func_181037_M() {
- if(this.field_181038_N.isEmpty()) {
- GameProfile gameprofile = this.func_152347_ac().fillProfileProperties(this.field_71449_j.func_148256_e(), false);
- this.field_181038_N.putAll(gameprofile.getProperties());
- }
- return this.field_181038_N;
- }
- public Proxy func_110437_J() {
- return this.field_110453_aa;
- }
- public TextureManager func_110434_K() {
- return this.field_71446_o;
- }
- public IResourceManager func_110442_L() {
- return this.field_110451_am;
- }
- public ResourcePackRepository func_110438_M() {
- return this.field_110448_aq;
- }
- public LanguageManager func_135016_M() {
- return this.field_135017_as;
- }
- public TextureMap func_147117_R() {
- return this.field_147128_au;
- }
- public boolean func_147111_S() {
- return this.field_147129_ai;
- }
- public boolean func_147113_T() {
- return this.field_71445_n;
- }
- public SoundHandler func_147118_V() {
- return this.field_147127_av;
- }
- public MusicTicker.MusicType func_147109_W() {
- 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);
- }
- public void func_152348_aa() {
- int int = Keyboard.getEventKey() == 0?Keyboard.getEventCharacter() + 256:Keyboard.getEventKey();
- if(int != 0 && !Keyboard.isRepeatEvent()) {
- if(!(this.field_71462_r instanceof GuiControls) || ((GuiControls)this.field_71462_r).field_152177_g <= func_71386_F() - 20L) {
- if(Keyboard.getEventKeyState()) {
- if(int == this.field_71474_y.field_152395_am.func_151463_i()) {
- this.func_71352_k();
- } else if(int == this.field_71474_y.field_151447_Z.func_151463_i()) {
- 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));
- } 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())) {
- this.field_71474_y.func_74306_a(GameSettings.Options.NARRATOR, 1);
- if(this.field_71462_r instanceof ScreenChatOptions) {
- ((ScreenChatOptions)this.field_71462_r).func_193024_a();
- }
- }
- }
- }
- }
- }
- public MinecraftSessionService func_152347_ac() {
- return this.field_152355_az;
- }
- public SkinManager func_152342_ad() {
- return this.field_152350_aA;
- }
- @Nullable
- public Entity func_175606_aa() {
- return this.field_175622_Z;
- }
- public void func_175607_a(Entity p_175607_1_) {
- this.field_175622_Z = p_175607_1_;
- this.field_71460_t.func_175066_a(p_175607_1_);
- }
- public <V> ListenableFuture<V> func_152343_a(Callable<V> p_152343_1_) {
- Validate.notNull(p_152343_1_);
- if(this.func_152345_ab()) {
- try {
- return Futures.<V>immediateFuture(p_152343_1_.call());
- } catch (Exception exception) {
- return Futures.immediateFailedCheckedFuture(exception);
- }
- } else {
- ListenableFutureTask<V> listenablefuturetask = ListenableFutureTask.<V>create(p_152343_1_);
- synchronized(this.field_152351_aB) {
- this.field_152351_aB.add(listenablefuturetask);
- return listenablefuturetask;
- }
- }
- }
- public ListenableFuture<Object> func_152344_a(Runnable p_152344_1_) {
- Validate.notNull(p_152344_1_);
- return this.<Object>func_152343_a(Executors.callable(p_152344_1_));
- }
- public boolean func_152345_ab() {
- return Thread.currentThread() == this.field_152352_aC;
- }
- public BlockRendererDispatcher func_175602_ab() {
- return this.field_175618_aM;
- }
- public RenderManager func_175598_ae() {
- return this.field_175616_W;
- }
- public RenderItem func_175599_af() {
- return this.field_175621_X;
- }
- public ItemRenderer func_175597_ag() {
- return this.field_175620_Y;
- }
- public <T> ISearchTree<T> func_193987_a(SearchTreeManager.Key<T> p_193987_1_) {
- return this.field_193995_ae.<T>func_194010_a(p_193987_1_);
- }
- public static int func_175610_ah() {
- return field_71470_ab;
- }
- public FrameTimer func_181539_aj() {
- return this.field_181542_y;
- }
- public boolean func_181540_al() {
- return this.field_181541_X;
- }
- public void func_181537_a(boolean p_181537_1_) {
- this.field_181541_X = p_181537_1_;
- }
- public DataFixer func_184126_aj() {
- return this.field_184131_U;
- }
- public float func_184121_ak() {
- return this.field_71428_T.field_194147_b;
- }
- public float func_193989_ak() {
- return this.field_71428_T.field_194148_c;
- }
- public BlockColors func_184125_al() {
- return this.field_184127_aH;
- }
- public boolean func_189648_am() {
- return this.field_71439_g != null && this.field_71439_g.func_175140_cp() || this.field_71474_y.field_178879_v;
- }
- public GuiToast func_193033_an() {
- return this.field_193034_aS;
- }
- public Tutorial func_193032_ao() {
- return this.field_193035_aW;
- }
- }
- Hunk 3 failed! Cannot find hunk target
- }
- }
- + @SuppressWarnings("incomplete-switch")
- private void func_147121_ag() {
- if (!this.field_71442_b.func_181040_m()) {
- this.field_71467_ac = 4;
- File state
- package net.minecraft.client;
- import com.google.common.collect.Lists;
- import com.google.common.collect.Queues;
- import com.google.common.collect.Sets;
- import com.google.common.hash.Hashing;
- import com.google.common.util.concurrent.Futures;
- import com.google.common.util.concurrent.ListenableFuture;
- import com.google.common.util.concurrent.ListenableFutureTask;
- import com.mojang.authlib.AuthenticationService;
- import com.mojang.authlib.GameProfile;
- import com.mojang.authlib.GameProfileRepository;
- import com.mojang.authlib.minecraft.MinecraftSessionService;
- import com.mojang.authlib.properties.PropertyMap;
- import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService;
- import java.awt.image.BufferedImage;
- import java.io.File;
- import java.io.IOException;
- import java.io.InputStream;
- import java.net.Proxy;
- import java.net.SocketAddress;
- import java.nio.ByteBuffer;
- import java.nio.ByteOrder;
- import java.nio.IntBuffer;
- import java.text.DecimalFormat;
- import java.text.SimpleDateFormat;
- import java.util.Collections;
- import java.util.Date;
- import java.util.Iterator;
- import java.util.List;
- import java.util.Locale;
- import java.util.Queue;
- import java.util.Set;
- import java.util.UUID;
- import java.util.concurrent.Callable;
- import java.util.concurrent.Executors;
- import java.util.concurrent.FutureTask;
- import java.util.function.Consumer;
- import java.util.function.Function;
- import java.util.function.Predicate;
- import java.util.stream.Collectors;
- import javax.annotation.Nullable;
- import javax.imageio.ImageIO;
- import net.minecraft.block.Block;
- import net.minecraft.block.material.Material;
- import net.minecraft.block.state.IBlockState;
- import net.minecraft.client.ClientBrandRetriever;
- import net.minecraft.client.LoadingScreenRenderer;
- import net.minecraft.client.audio.MusicTicker;
- import net.minecraft.client.audio.SoundHandler;
- import net.minecraft.client.entity.EntityPlayerSP;
- import net.minecraft.client.gui.FontRenderer;
- import net.minecraft.client.gui.GuiChat;
- import net.minecraft.client.gui.GuiControls;
- import net.minecraft.client.gui.GuiGameOver;
- import net.minecraft.client.gui.GuiIngame;
- import net.minecraft.client.gui.GuiIngameMenu;
- import net.minecraft.client.gui.GuiMainMenu;
- import net.minecraft.client.gui.GuiMemoryErrorScreen;
- import net.minecraft.client.gui.GuiMultiplayer;
- import net.minecraft.client.gui.GuiNewChat;
- import net.minecraft.client.gui.GuiScreen;
- import net.minecraft.client.gui.GuiScreenWorking;
- import net.minecraft.client.gui.GuiSleepMP;
- import net.minecraft.client.gui.GuiWinGame;
- import net.minecraft.client.gui.ScaledResolution;
- import net.minecraft.client.gui.ScreenChatOptions;
- import net.minecraft.client.gui.advancements.GuiScreenAdvancements;
- import net.minecraft.client.gui.chat.NarratorChatListener;
- import net.minecraft.client.gui.inventory.GuiContainerCreative;
- import net.minecraft.client.gui.inventory.GuiInventory;
- import net.minecraft.client.gui.recipebook.RecipeList;
- import net.minecraft.client.gui.toasts.GuiToast;
- import net.minecraft.client.main.GameConfiguration;
- import net.minecraft.client.multiplayer.GuiConnecting;
- import net.minecraft.client.multiplayer.PlayerControllerMP;
- import net.minecraft.client.multiplayer.ServerData;
- import net.minecraft.client.multiplayer.WorldClient;
- import net.minecraft.client.network.NetHandlerLoginClient;
- import net.minecraft.client.network.NetHandlerPlayClient;
- import net.minecraft.client.particle.ParticleManager;
- import net.minecraft.client.renderer.BlockRendererDispatcher;
- import net.minecraft.client.renderer.BufferBuilder;
- import net.minecraft.client.renderer.EntityRenderer;
- import net.minecraft.client.renderer.GlStateManager;
- import net.minecraft.client.renderer.ItemRenderer;
- import net.minecraft.client.renderer.OpenGlHelper;
- import net.minecraft.client.renderer.RenderGlobal;
- import net.minecraft.client.renderer.RenderItem;
- import net.minecraft.client.renderer.Tessellator;
- import net.minecraft.client.renderer.block.model.ModelManager;
- import net.minecraft.client.renderer.chunk.RenderChunk;
- import net.minecraft.client.renderer.color.BlockColors;
- import net.minecraft.client.renderer.color.ItemColors;
- import net.minecraft.client.renderer.debug.DebugRenderer;
- import net.minecraft.client.renderer.entity.RenderManager;
- import net.minecraft.client.renderer.texture.DynamicTexture;
- import net.minecraft.client.renderer.texture.TextureManager;
- import net.minecraft.client.renderer.texture.TextureMap;
- import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
- import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
- import net.minecraft.client.resources.DefaultResourcePack;
- import net.minecraft.client.resources.FoliageColorReloadListener;
- import net.minecraft.client.resources.GrassColorReloadListener;
- import net.minecraft.client.resources.I18n;
- import net.minecraft.client.resources.IReloadableResourceManager;
- import net.minecraft.client.resources.IResourceManager;
- import net.minecraft.client.resources.IResourcePack;
- import net.minecraft.client.resources.LanguageManager;
- import net.minecraft.client.resources.ResourcePackRepository;
- import net.minecraft.client.resources.SimpleReloadableResourceManager;
- import net.minecraft.client.resources.SkinManager;
- import net.minecraft.client.resources.data.AnimationMetadataSection;
- import net.minecraft.client.resources.data.AnimationMetadataSectionSerializer;
- import net.minecraft.client.resources.data.FontMetadataSection;
- import net.minecraft.client.resources.data.FontMetadataSectionSerializer;
- import net.minecraft.client.resources.data.LanguageMetadataSection;
- import net.minecraft.client.resources.data.LanguageMetadataSectionSerializer;
- import net.minecraft.client.resources.data.MetadataSerializer;
- import net.minecraft.client.resources.data.PackMetadataSection;
- import net.minecraft.client.resources.data.PackMetadataSectionSerializer;
- import net.minecraft.client.resources.data.TextureMetadataSection;
- import net.minecraft.client.resources.data.TextureMetadataSectionSerializer;
- import net.minecraft.client.settings.CreativeSettings;
- import net.minecraft.client.settings.GameSettings;
- import net.minecraft.client.settings.KeyBinding;
- import net.minecraft.client.shader.Framebuffer;
- import net.minecraft.client.tutorial.Tutorial;
- import net.minecraft.client.util.ISearchTree;
- import net.minecraft.client.util.ITooltipFlag;
- import net.minecraft.client.util.RecipeBookClient;
- import net.minecraft.client.util.SearchTree;
- import net.minecraft.client.util.SearchTreeManager;
- import net.minecraft.crash.CrashReport;
- import net.minecraft.crash.CrashReportCategory;
- import net.minecraft.crash.ICrashReportDetail;
- import net.minecraft.creativetab.CreativeTabs;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.EntityLeashKnot;
- import net.minecraft.entity.EntityList;
- import net.minecraft.entity.item.EntityArmorStand;
- import net.minecraft.entity.item.EntityBoat;
- import net.minecraft.entity.item.EntityEnderCrystal;
- import net.minecraft.entity.item.EntityItemFrame;
- import net.minecraft.entity.item.EntityMinecart;
- import net.minecraft.entity.item.EntityPainting;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.entity.player.InventoryPlayer;
- import net.minecraft.init.Bootstrap;
- import net.minecraft.init.Items;
- import net.minecraft.item.Item;
- import net.minecraft.item.ItemMonsterPlacer;
- import net.minecraft.item.ItemStack;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.nbt.NBTTagList;
- import net.minecraft.nbt.NBTTagString;
- import net.minecraft.network.EnumConnectionState;
- import net.minecraft.network.NetworkManager;
- import net.minecraft.network.handshake.client.C00Handshake;
- import net.minecraft.network.login.client.CPacketLoginStart;
- import net.minecraft.network.play.client.CPacketPlayerDigging;
- import net.minecraft.profiler.ISnooperInfo;
- import net.minecraft.profiler.Profiler;
- import net.minecraft.profiler.Snooper;
- import net.minecraft.server.MinecraftServer;
- import net.minecraft.server.integrated.IntegratedServer;
- import net.minecraft.server.management.PlayerProfileCache;
- import net.minecraft.stats.RecipeBook;
- import net.minecraft.stats.StatisticsManager;
- import net.minecraft.tileentity.TileEntity;
- import net.minecraft.tileentity.TileEntitySkull;
- import net.minecraft.util.EnumActionResult;
- import net.minecraft.util.EnumFacing;
- import net.minecraft.util.EnumHand;
- import net.minecraft.util.FrameTimer;
- import net.minecraft.util.IThreadListener;
- import net.minecraft.util.MinecraftError;
- import net.minecraft.util.MouseHelper;
- import net.minecraft.util.MovementInputFromOptions;
- import net.minecraft.util.NonNullList;
- import net.minecraft.util.ReportedException;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.util.ScreenShotHelper;
- import net.minecraft.util.Session;
- import net.minecraft.util.Timer;
- import net.minecraft.util.Util;
- import net.minecraft.util.datafix.DataFixer;
- import net.minecraft.util.datafix.DataFixesManager;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.util.math.MathHelper;
- import net.minecraft.util.math.RayTraceResult;
- import net.minecraft.util.text.ITextComponent;
- import net.minecraft.util.text.Style;
- import net.minecraft.util.text.TextComponentKeybind;
- import net.minecraft.util.text.TextComponentString;
- import net.minecraft.util.text.TextComponentTranslation;
- import net.minecraft.util.text.TextFormatting;
- import net.minecraft.world.EnumDifficulty;
- import net.minecraft.world.WorldProviderEnd;
- import net.minecraft.world.WorldProviderHell;
- import net.minecraft.world.WorldSettings;
- import net.minecraft.world.chunk.storage.AnvilSaveConverter;
- import net.minecraft.world.storage.ISaveFormat;
- import net.minecraft.world.storage.ISaveHandler;
- import net.minecraft.world.storage.WorldInfo;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- import org.apache.commons.io.Charsets;
- import org.apache.commons.io.IOUtils;
- import org.apache.commons.lang3.Validate;
- import org.apache.logging.log4j.LogManager;
- import org.apache.logging.log4j.Logger;
- import org.lwjgl.LWJGLException;
- import org.lwjgl.Sys;
- import org.lwjgl.input.Keyboard;
- import org.lwjgl.input.Mouse;
- import org.lwjgl.opengl.ContextCapabilities;
- import org.lwjgl.opengl.Display;
- import org.lwjgl.opengl.DisplayMode;
- import org.lwjgl.opengl.GLContext;
- import org.lwjgl.opengl.OpenGLException;
- import org.lwjgl.opengl.PixelFormat;
- import org.lwjgl.util.glu.GLU;
- @SideOnly(Side.CLIENT)
- public class Minecraft implements IThreadListener, ISnooperInfo {
- private static final Logger field_147123_G = LogManager.getLogger();
- private static final ResourceLocation field_110444_H = new ResourceLocation("textures/gui/title/mojang.png");
- public static final boolean field_142025_a = Util.func_110647_a() == Util.EnumOS.OSX;
- public static byte[] field_71444_a = new byte[10485760];
- private static final List<DisplayMode> field_110445_I = Lists.newArrayList(new DisplayMode[]{new DisplayMode(2560, 1600), new DisplayMode(2880, 1800)});
- private final File field_130070_K;
- private final PropertyMap field_152356_J;
- private final PropertyMap field_181038_N;
- private ServerData field_71422_O;
- public TextureManager field_71446_o;
- private static Minecraft field_71432_P;
- private final DataFixer field_184131_U;
- public PlayerControllerMP field_71442_b;
- private boolean field_71431_Q;
- private final boolean field_175619_R = true;
- private boolean field_71434_R;
- private CrashReport field_71433_S;
- public int field_71443_c;
- public int field_71440_d;
- private boolean field_181541_X;
- private final Timer field_71428_T = new Timer(20.0F);
- private final Snooper field_71427_U = new Snooper("client", this, MinecraftServer.func_130071_aq());
- public WorldClient field_71441_e;
- public RenderGlobal field_71438_f;
- private RenderManager field_175616_W;
- private RenderItem field_175621_X;
- private ItemRenderer field_175620_Y;
- public EntityPlayerSP field_71439_g;
- @Nullable
- private Entity field_175622_Z;
- public Entity field_147125_j;
- public ParticleManager field_71452_i;
- private SearchTreeManager field_193995_ae = new SearchTreeManager();
- private final Session field_71449_j;
- private boolean field_71445_n;
- private float field_193996_ah;
- public FontRenderer field_71466_p;
- public FontRenderer field_71464_q;
- @Nullable
- public GuiScreen field_71462_r;
- public LoadingScreenRenderer field_71461_s;
- public EntityRenderer field_71460_t;
- public DebugRenderer field_184132_p;
- private int field_71429_W;
- private final int field_71436_X;
- private final int field_71435_Y;
- @Nullable
- private IntegratedServer field_71437_Z;
- public GuiIngame field_71456_v;
- public boolean field_71454_w;
- public RayTraceResult field_71476_x;
- public GameSettings field_71474_y;
- public CreativeSettings field_191950_u;
- public MouseHelper field_71417_B;
- public final File field_71412_D;
- private final File field_110446_Y;
- private final String field_110447_Z;
- private final String field_184130_ao;
- private final Proxy field_110453_aa;
- private ISaveFormat field_71469_aa;
- private static int field_71470_ab;
- private int field_71467_ac;
- private String field_71475_ae;
- private int field_71477_af;
- public boolean field_71415_G;
- long field_71423_H = func_71386_F();
- private int field_71457_ai;
- public final FrameTimer field_181542_y = new FrameTimer();
- long field_181543_z = System.nanoTime();
- private final boolean field_147129_ai;
- private final boolean field_71459_aj;
- @Nullable
- private NetworkManager field_71453_ak;
- private boolean field_71455_al;
- public final Profiler field_71424_I = new Profiler();
- private long field_83002_am = -1L;
- private IReloadableResourceManager field_110451_am;
- private final MetadataSerializer field_110452_an = new MetadataSerializer();
- private final List<IResourcePack> field_110449_ao = Lists.<IResourcePack>newArrayList();
- public final DefaultResourcePack field_110450_ap;
- private ResourcePackRepository field_110448_aq;
- private LanguageManager field_135017_as;
- private BlockColors field_184127_aH;
- private ItemColors field_184128_aI;
- private Framebuffer field_147124_at;
- private TextureMap field_147128_au;
- private SoundHandler field_147127_av;
- private MusicTicker field_147126_aw;
- private ResourceLocation field_152354_ay;
- private final MinecraftSessionService field_152355_az;
- private SkinManager field_152350_aA;
- private final Queue<FutureTask<?>> field_152351_aB = Queues.<FutureTask<?>>newArrayDeque();
- private final Thread field_152352_aC = Thread.currentThread();
- private ModelManager field_175617_aL;
- private BlockRendererDispatcher field_175618_aM;
- private final GuiToast field_193034_aS;
- volatile boolean field_71425_J = true;
- public String field_71426_K = "";
- public boolean field_175612_E = true;
- private long field_71419_L = func_71386_F();
- private int field_71420_M;
- private boolean field_184129_aV;
- private final Tutorial field_193035_aW;
- long field_71421_N = -1L;
- private String field_71465_an = "root";
- public Minecraft(GameConfiguration p_i45547_1_) {
- field_71432_P = this;
- this.field_71412_D = p_i45547_1_.field_178744_c.field_178760_a;
- this.field_110446_Y = p_i45547_1_.field_178744_c.field_178759_c;
- this.field_130070_K = p_i45547_1_.field_178744_c.field_178758_b;
- this.field_110447_Z = p_i45547_1_.field_178741_d.field_178755_b;
- this.field_184130_ao = p_i45547_1_.field_178741_d.field_187053_c;
- this.field_152356_J = p_i45547_1_.field_178745_a.field_178750_b;
- this.field_181038_N = p_i45547_1_.field_178745_a.field_181172_c;
- this.field_110450_ap = new DefaultResourcePack(p_i45547_1_.field_178744_c.func_187052_a());
- 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;
- this.field_152355_az = (new YggdrasilAuthenticationService(this.field_110453_aa, UUID.randomUUID().toString())).createMinecraftSessionService();
- this.field_71449_j = p_i45547_1_.field_178745_a.field_178752_a;
- field_147123_G.info((String)"Setting user: {}", (Object)this.field_71449_j.func_111285_a());
- field_147123_G.debug((String)"(Session ID is {})", (Object)this.field_71449_j.func_111286_b());
- this.field_71459_aj = p_i45547_1_.field_178741_d.field_178756_a;
- this.field_71443_c = p_i45547_1_.field_178743_b.field_178764_a > 0?p_i45547_1_.field_178743_b.field_178764_a:1;
- this.field_71440_d = p_i45547_1_.field_178743_b.field_178762_b > 0?p_i45547_1_.field_178743_b.field_178762_b:1;
- this.field_71436_X = p_i45547_1_.field_178743_b.field_178764_a;
- this.field_71435_Y = p_i45547_1_.field_178743_b.field_178762_b;
- this.field_71431_Q = p_i45547_1_.field_178743_b.field_178763_c;
- this.field_147129_ai = func_147122_X();
- this.field_71437_Z = null;
- if(p_i45547_1_.field_178742_e.field_178754_a != null) {
- this.field_71475_ae = p_i45547_1_.field_178742_e.field_178754_a;
- this.field_71477_af = p_i45547_1_.field_178742_e.field_178753_b;
- }
- ImageIO.setUseCache(false);
- Locale.setDefault(Locale.ROOT);
- Bootstrap.func_151354_b();
- TextComponentKeybind.field_193637_b = KeyBinding::func_193626_b;
- this.field_184131_U = DataFixesManager.func_188279_a();
- this.field_193034_aS = new GuiToast(this);
- this.field_193035_aW = new Tutorial(this);
- }
- public void func_99999_d() {
- this.field_71425_J = true;
- try {
- this.func_71384_a();
- } catch (Throwable throwable) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable, "Initializing game");
- crashreport.func_85058_a("Initialization");
- this.func_71377_b(this.func_71396_d(crashreport));
- return;
- }
- while(true) {
- try {
- if(!this.field_71425_J) {
- break;
- }
- if(!this.field_71434_R || this.field_71433_S == null) {
- try {
- this.func_71411_J();
- } catch (OutOfMemoryError var10) {
- this.func_71398_f();
- this.func_147108_a(new GuiMemoryErrorScreen());
- System.gc();
- }
- continue;
- }
- this.func_71377_b(this.field_71433_S);
- } catch (MinecraftError var12) {
- break;
- } catch (ReportedException reportedexception) {
- this.func_71396_d(reportedexception.func_71575_a());
- this.func_71398_f();
- field_147123_G.fatal((String)"Reported exception thrown!", (Throwable)reportedexception);
- this.func_71377_b(reportedexception.func_71575_a());
- break;
- } catch (Throwable throwable1) {
- CrashReport crashreport1 = this.func_71396_d(new CrashReport("Unexpected error", throwable1));
- this.func_71398_f();
- field_147123_G.fatal("Unreported exception thrown!", throwable1);
- this.func_71377_b(crashreport1);
- break;
- } finally {
- this.func_71405_e();
- }
- return;
- }
- }
- private void func_71384_a() throws LWJGLException, IOException {
- this.field_71474_y = new GameSettings(this, this.field_71412_D);
- this.field_191950_u = new CreativeSettings(this, this.field_71412_D);
- this.field_110449_ao.add(this.field_110450_ap);
- this.func_71389_H();
- if(this.field_71474_y.field_92119_C > 0 && this.field_71474_y.field_92118_B > 0) {
- this.field_71443_c = this.field_71474_y.field_92118_B;
- this.field_71440_d = this.field_71474_y.field_92119_C;
- }
- field_147123_G.info((String)"LWJGL Version: {}", (Object)Sys.getVersion());
- this.func_175594_ao();
- this.func_175605_an();
- this.func_175609_am();
- OpenGlHelper.func_77474_a();
- this.field_147124_at = new Framebuffer(this.field_71443_c, this.field_71440_d, true);
- this.field_147124_at.func_147604_a(0.0F, 0.0F, 0.0F, 0.0F);
- this.func_175608_ak();
- 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);
- this.field_110451_am = new SimpleReloadableResourceManager(this.field_110452_an);
- this.field_135017_as = new LanguageManager(this.field_110452_an, this.field_71474_y.field_74363_ab);
- this.field_110451_am.func_110542_a(this.field_135017_as);
- this.func_110436_a();
- this.field_71446_o = new TextureManager(this.field_110451_am);
- this.field_110451_am.func_110542_a(this.field_71446_o);
- this.func_180510_a(this.field_71446_o);
- this.field_152350_aA = new SkinManager(this.field_71446_o, new File(this.field_110446_Y, "skins"), this.field_152355_az);
- this.field_71469_aa = new AnvilSaveConverter(new File(this.field_71412_D, "saves"), this.field_184131_U);
- this.field_147127_av = new SoundHandler(this.field_110451_am, this.field_71474_y);
- this.field_110451_am.func_110542_a(this.field_147127_av);
- this.field_147126_aw = new MusicTicker(this);
- this.field_71466_p = new FontRenderer(this.field_71474_y, new ResourceLocation("textures/font/ascii.png"), this.field_71446_o, false);
- if(this.field_71474_y.field_74363_ab != null) {
- this.field_71466_p.func_78264_a(this.func_152349_b());
- this.field_71466_p.func_78275_b(this.field_135017_as.func_135044_b());
- }
- this.field_71464_q = new FontRenderer(this.field_71474_y, new ResourceLocation("textures/font/ascii_sga.png"), this.field_71446_o, false);
- this.field_110451_am.func_110542_a(this.field_71466_p);
- this.field_110451_am.func_110542_a(this.field_71464_q);
- this.field_110451_am.func_110542_a(new GrassColorReloadListener());
- this.field_110451_am.func_110542_a(new FoliageColorReloadListener());
- this.field_71417_B = new MouseHelper();
- this.func_71361_d("Pre startup");
- GlStateManager.func_179098_w();
- GlStateManager.func_179103_j(7425);
- GlStateManager.func_179151_a(1.0D);
- GlStateManager.func_179126_j();
- GlStateManager.func_179143_c(515);
- GlStateManager.func_179141_d();
- GlStateManager.func_179092_a(516, 0.1F);
- GlStateManager.func_187407_a(GlStateManager.CullFace.BACK);
- GlStateManager.func_179128_n(5889);
- GlStateManager.func_179096_D();
- GlStateManager.func_179128_n(5888);
- this.func_71361_d("Startup");
- this.field_147128_au = new TextureMap("textures");
- this.field_147128_au.func_147633_a(this.field_71474_y.field_151442_I);
- this.field_71446_o.func_110580_a(TextureMap.field_110575_b, this.field_147128_au);
- this.field_71446_o.func_110577_a(TextureMap.field_110575_b);
- this.field_147128_au.func_174937_a(false, this.field_71474_y.field_151442_I > 0);
- this.field_175617_aL = new ModelManager(this.field_147128_au);
- this.field_110451_am.func_110542_a(this.field_175617_aL);
- this.field_184127_aH = BlockColors.func_186723_a();
- this.field_184128_aI = ItemColors.func_186729_a(this.field_184127_aH);
- this.field_175621_X = new RenderItem(this.field_71446_o, this.field_175617_aL, this.field_184128_aI);
- this.field_175616_W = new RenderManager(this.field_71446_o, this.field_175621_X);
- this.field_175620_Y = new ItemRenderer(this);
- this.field_110451_am.func_110542_a(this.field_175621_X);
- this.field_71460_t = new EntityRenderer(this, this.field_110451_am);
- this.field_110451_am.func_110542_a(this.field_71460_t);
- this.field_175618_aM = new BlockRendererDispatcher(this.field_175617_aL.func_174954_c(), this.field_184127_aH);
- this.field_110451_am.func_110542_a(this.field_175618_aM);
- this.field_71438_f = new RenderGlobal(this);
- this.field_110451_am.func_110542_a(this.field_71438_f);
- this.func_193986_ar();
- this.field_110451_am.func_110542_a(this.field_193995_ae);
- GlStateManager.func_179083_b(0, 0, this.field_71443_c, this.field_71440_d);
- this.field_71452_i = new ParticleManager(this.field_71441_e, this.field_71446_o);
- this.func_71361_d("Post startup");
- this.field_71456_v = new GuiIngame(this);
- if(this.field_71475_ae != null) {
- this.func_147108_a(new GuiConnecting(new GuiMainMenu(), this, this.field_71475_ae, this.field_71477_af));
- } else {
- this.func_147108_a(new GuiMainMenu());
- }
- this.field_71446_o.func_147645_c(this.field_152354_ay);
- this.field_152354_ay = null;
- this.field_71461_s = new LoadingScreenRenderer(this);
- this.field_184132_p = new DebugRenderer(this);
- if(this.field_71474_y.field_74353_u && !this.field_71431_Q) {
- this.func_71352_k();
- }
- try {
- Display.setVSyncEnabled(this.field_71474_y.field_74352_v);
- } catch (OpenGLException var2) {
- this.field_71474_y.field_74352_v = false;
- this.field_71474_y.func_74303_b();
- }
- this.field_71438_f.func_174966_b();
- }
- private void func_193986_ar() {
- SearchTree<ItemStack> searchtree = new SearchTree((p_193988_0_) -> {
- 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_) -> {
- return !p_193984_0_.isEmpty();
- }).collect(Collectors.toList());
- }, (p_193985_0_) -> {
- return Collections.singleton(Item.field_150901_e.func_177774_c(p_193985_0_.func_77973_b()));
- });
- NonNullList<ItemStack> nonnulllist = NonNullList.<ItemStack>func_191196_a();
- for(Item item : Item.field_150901_e) {
- item.func_150895_a(CreativeTabs.field_78027_g, nonnulllist);
- }
- nonnulllist.forEach(searchtree::func_194043_a);
- SearchTree<RecipeList> searchtree1 = new SearchTree((p_193990_0_) -> {
- return (List)p_193990_0_.func_192711_b().stream().flatMap((p_193993_0_) -> {
- return p_193993_0_.func_77571_b().func_82840_a((EntityPlayer)null, ITooltipFlag.TooltipFlags.NORMAL).stream();
- }).map(TextFormatting::func_110646_a).map(String::trim).filter((p_193994_0_) -> {
- return !p_193994_0_.isEmpty();
- }).collect(Collectors.toList());
- }, (p_193991_0_) -> {
- return (List)p_193991_0_.func_192711_b().stream().map((p_193992_0_) -> {
- return (ResourceLocation)Item.field_150901_e.func_177774_c(p_193992_0_.func_77571_b().func_77973_b());
- }).collect(Collectors.toList());
- });
- RecipeBookClient.field_194087_f.forEach(searchtree1::func_194043_a);
- this.field_193995_ae.func_194009_a(SearchTreeManager.field_194011_a, searchtree);
- this.field_193995_ae.func_194009_a(SearchTreeManager.field_194012_b, searchtree1);
- }
- private void func_175608_ak() {
- this.field_110452_an.func_110504_a(new TextureMetadataSectionSerializer(), TextureMetadataSection.class);
- this.field_110452_an.func_110504_a(new FontMetadataSectionSerializer(), FontMetadataSection.class);
- this.field_110452_an.func_110504_a(new AnimationMetadataSectionSerializer(), AnimationMetadataSection.class);
- this.field_110452_an.func_110504_a(new PackMetadataSectionSerializer(), PackMetadataSection.class);
- this.field_110452_an.func_110504_a(new LanguageMetadataSectionSerializer(), LanguageMetadataSection.class);
- }
- private void func_175609_am() throws LWJGLException {
- Display.setResizable(true);
- Display.setTitle("Minecraft 1.12");
- try {
- Display.create((new PixelFormat()).withDepthBits(24));
- } catch (LWJGLException lwjglexception) {
- field_147123_G.error((String)"Couldn\'t set pixel format", (Throwable)lwjglexception);
- try {
- Thread.sleep(1000L);
- } catch (InterruptedException var3) {
- ;
- }
- if(this.field_71431_Q) {
- this.func_110441_Q();
- }
- Display.create();
- }
- }
- private void func_175605_an() throws LWJGLException {
- if(this.field_71431_Q) {
- Display.setFullscreen(true);
- DisplayMode displaymode = Display.getDisplayMode();
- this.field_71443_c = Math.max(1, displaymode.getWidth());
- this.field_71440_d = Math.max(1, displaymode.getHeight());
- } else {
- Display.setDisplayMode(new DisplayMode(this.field_71443_c, this.field_71440_d));
- }
- }
- private void func_175594_ao() {
- Util.EnumOS util$enumos = Util.func_110647_a();
- if(util$enumos != Util.EnumOS.OSX) {
- InputStream inputstream = null;
- InputStream inputstream1 = null;
- try {
- inputstream = this.field_110450_ap.func_152780_c(new ResourceLocation("icons/icon_16x16.png"));
- inputstream1 = this.field_110450_ap.func_152780_c(new ResourceLocation("icons/icon_32x32.png"));
- if(inputstream != null && inputstream1 != null) {
- Display.setIcon(new ByteBuffer[]{this.func_152340_a(inputstream), this.func_152340_a(inputstream1)});
- }
- } catch (IOException ioexception) {
- field_147123_G.error((String)"Couldn\'t set icon", (Throwable)ioexception);
- } finally {
- IOUtils.closeQuietly(inputstream);
- IOUtils.closeQuietly(inputstream1);
- }
- }
- }
- private static boolean func_147122_X() {
- String[] astring = new String[]{"sun.arch.data.model", "com.ibm.vm.bitmode", "os.arch"};
- for(String string : astring) {
- String string1 = System.getProperty(string);
- if(string1 != null && string1.contains("64")) {
- return true;
- }
- }
- return false;
- }
- public Framebuffer func_147110_a() {
- return this.field_147124_at;
- }
- public String func_175600_c() {
- return this.field_110447_Z;
- }
- public String func_184123_d() {
- return this.field_184130_ao;
- }
- private void func_71389_H() {
- Thread thread = new Thread("Timer hack thread") {
- public void run() {
- while(Minecraft.this.field_71425_J) {
- try {
- Thread.sleep(2147483647L);
- } catch (InterruptedException var2) {
- ;
- }
- }
- }
- };
- thread.setDaemon(true);
- thread.start();
- }
- public void func_71404_a(CrashReport p_71404_1_) {
- this.field_71434_R = true;
- this.field_71433_S = p_71404_1_;
- }
- public void func_71377_b(CrashReport p_71377_1_) {
- File file = new File(func_71410_x().field_71412_D, "crash-reports");
- File file1 = new File(file, "crash-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + "-client.txt");
- Bootstrap.func_179870_a(p_71377_1_.func_71502_e());
- if(p_71377_1_.func_71497_f() != null) {
- Bootstrap.func_179870_a("#@!@# Game crashed! Crash report saved to: #@!@# " + p_71377_1_.func_71497_f());
- System.exit(-1);
- } else if(p_71377_1_.func_147149_a(file1)) {
- Bootstrap.func_179870_a("#@!@# Game crashed! Crash report saved to: #@!@# " + file1.getAbsolutePath());
- System.exit(-1);
- } else {
- Bootstrap.func_179870_a("#@?@# Game crashed! Crash report could not be saved. #@?@#");
- System.exit(-2);
- }
- }
- public boolean func_152349_b() {
- return this.field_135017_as.func_135042_a() || this.field_71474_y.field_151455_aw;
- }
- public void func_110436_a() {
- List<IResourcePack> list = Lists.newArrayList(this.field_110449_ao);
- if(this.field_71437_Z != null) {
- this.field_71437_Z.func_193031_aM();
- }
- for(ResourcePackRepository.Entry resourcepackrepository$entry : this.field_110448_aq.func_110613_c()) {
- list.add(resourcepackrepository$entry.func_110514_c());
- }
- if(this.field_110448_aq.func_148530_e() != null) {
- list.add(this.field_110448_aq.func_148530_e());
- }
- try {
- this.field_110451_am.func_110541_a(list);
- } catch (RuntimeException runtimeexception) {
- field_147123_G.info((String)"Caught error stitching, removing all assigned resourcepacks", (Throwable)runtimeexception);
- list.clear();
- list.addAll(this.field_110449_ao);
- this.field_110448_aq.func_148527_a(Collections.<ResourcePackRepository.Entry>emptyList());
- this.field_110451_am.func_110541_a(list);
- this.field_71474_y.field_151453_l.clear();
- this.field_71474_y.field_183018_l.clear();
- this.field_71474_y.func_74303_b();
- }
- this.field_135017_as.func_135043_a(list);
- if(this.field_71438_f != null) {
- this.field_71438_f.func_72712_a();
- }
- }
- private ByteBuffer func_152340_a(InputStream p_152340_1_) throws IOException {
- BufferedImage bufferedimage = ImageIO.read(p_152340_1_);
- int[] aint = bufferedimage.getRGB(0, 0, bufferedimage.getWidth(), bufferedimage.getHeight(), (int[])null, 0, bufferedimage.getWidth());
- ByteBuffer bytebuffer = ByteBuffer.allocate(4 * aint.length);
- for(int int : aint) {
- bytebuffer.putInt(int << 8 | int >> 24 & 255);
- }
- bytebuffer.flip();
- return bytebuffer;
- }
- private void func_110441_Q() throws LWJGLException {
- Set<DisplayMode> set = Sets.<DisplayMode>newHashSet();
- Collections.addAll(set, Display.getAvailableDisplayModes());
- DisplayMode displaymode = Display.getDesktopDisplayMode();
- if(!set.contains(displaymode) && Util.func_110647_a() == Util.EnumOS.OSX) {
- label53:
- for(DisplayMode displaymode1 : field_110445_I) {
- boolean boolean = true;
- for(DisplayMode displaymode2 : set) {
- if(displaymode2.getBitsPerPixel() == 32 && displaymode2.getWidth() == displaymode1.getWidth() && displaymode2.getHeight() == displaymode1.getHeight()) {
- boolean = false;
- break;
- }
- }
- if(!boolean) {
- Iterator iterator = set.iterator();
- DisplayMode displaymode3;
- while(true) {
- if(!iterator.hasNext()) {
- continue label53;
- }
- displaymode3 = (DisplayMode)iterator.next();
- if(displaymode3.getBitsPerPixel() == 32 && displaymode3.getWidth() == displaymode1.getWidth() / 2 && displaymode3.getHeight() == displaymode1.getHeight() / 2) {
- break;
- }
- }
- displaymode = displaymode3;
- }
- }
- }
- Display.setDisplayMode(displaymode);
- this.field_71443_c = displaymode.getWidth();
- this.field_71440_d = displaymode.getHeight();
- }
- public void func_180510_a(TextureManager p_180510_1_) throws LWJGLException {
- ScaledResolution scaledresolution = new ScaledResolution(this);
- int int = scaledresolution.func_78325_e();
- Framebuffer framebuffer = new Framebuffer(scaledresolution.func_78326_a() * int, scaledresolution.func_78328_b() * int, true);
- framebuffer.func_147610_a(false);
- GlStateManager.func_179128_n(5889);
- GlStateManager.func_179096_D();
- GlStateManager.func_179130_a(0.0D, (double)scaledresolution.func_78326_a(), (double)scaledresolution.func_78328_b(), 0.0D, 1000.0D, 3000.0D);
- GlStateManager.func_179128_n(5888);
- GlStateManager.func_179096_D();
- GlStateManager.func_179109_b(0.0F, 0.0F, -2000.0F);
- GlStateManager.func_179140_f();
- GlStateManager.func_179106_n();
- GlStateManager.func_179097_i();
- GlStateManager.func_179098_w();
- InputStream inputstream = null;
- try {
- inputstream = this.field_110450_ap.func_110590_a(field_110444_H);
- this.field_152354_ay = p_180510_1_.func_110578_a("logo", new DynamicTexture(ImageIO.read(inputstream)));
- p_180510_1_.func_110577_a(this.field_152354_ay);
- } catch (IOException ioexception) {
- field_147123_G.error((String)"Unable to load logo: {}", (Object)field_110444_H, (Object)ioexception);
- } finally {
- IOUtils.closeQuietly(inputstream);
- }
- Tessellator tessellator = Tessellator.func_178181_a();
- BufferBuilder bufferbuilder = tessellator.func_178180_c();
- bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181709_i);
- 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();
- 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();
- 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();
- 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();
- tessellator.func_78381_a();
- GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
- int int = 256;
- int int = 256;
- this.func_181536_a((scaledresolution.func_78326_a() - 256) / 2, (scaledresolution.func_78328_b() - 256) / 2, 0, 0, 256, 256, 255, 255, 255, 255);
- GlStateManager.func_179140_f();
- GlStateManager.func_179106_n();
- framebuffer.func_147609_e();
- framebuffer.func_147615_c(scaledresolution.func_78326_a() * int, scaledresolution.func_78328_b() * int);
- GlStateManager.func_179141_d();
- GlStateManager.func_179092_a(516, 0.1F);
- this.func_175601_h();
- }
- 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_) {
- BufferBuilder bufferbuilder = Tessellator.func_178181_a().func_178180_c();
- bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181709_i);
- float float = 0.00390625F;
- float float = 0.00390625F;
- 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();
- 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();
- 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();
- 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();
- Tessellator.func_178181_a().func_78381_a();
- }
- public ISaveFormat func_71359_d() {
- return this.field_71469_aa;
- }
- public void func_147108_a(@Nullable GuiScreen p_147108_1_) {
- if(this.field_71462_r != null) {
- this.field_71462_r.func_146281_b();
- }
- if(p_147108_1_ == null && this.field_71441_e == null) {
- p_147108_1_ = new GuiMainMenu();
- } else if(p_147108_1_ == null && this.field_71439_g.func_110143_aJ() <= 0.0F) {
- p_147108_1_ = new GuiGameOver((ITextComponent)null);
- }
- if(p_147108_1_ instanceof GuiMainMenu || p_147108_1_ instanceof GuiMultiplayer) {
- this.field_71474_y.field_74330_P = false;
- this.field_71456_v.func_146158_b().func_146231_a(true);
- }
- this.field_71462_r = (GuiScreen)p_147108_1_;
- if(p_147108_1_ != null) {
- this.func_71364_i();
- KeyBinding.func_74506_a();
- while(Mouse.next()) {
- ;
- }
- while(Keyboard.next()) {
- ;
- }
- ScaledResolution scaledresolution = new ScaledResolution(this);
- int int = scaledresolution.func_78326_a();
- int int = scaledresolution.func_78328_b();
- ((GuiScreen)p_147108_1_).func_146280_a(this, int, int);
- this.field_71454_w = false;
- } else {
- this.field_147127_av.func_147687_e();
- this.func_71381_h();
- }
- }
- private void func_71361_d(String p_71361_1_) {
- int int = GlStateManager.func_187434_L();
- if(int != 0) {
- String string = GLU.gluErrorString(int);
- field_147123_G.error("########## GL ERROR ##########");
- field_147123_G.error((String)"@ {}", (Object)p_71361_1_);
- field_147123_G.error((String)"{}: {}", (Object)Integer.valueOf(int), (Object)string);
- }
- }
- public void func_71405_e() {
- try {
- field_147123_G.info("Stopping!");
- try {
- this.func_71403_a((WorldClient)null);
- } catch (Throwable var5) {
- ;
- }
- this.field_147127_av.func_147685_d();
- } finally {
- Display.destroy();
- if(!this.field_71434_R) {
- System.exit(0);
- }
- }
- System.gc();
- }
- private void func_71411_J() throws IOException {
- long long = System.nanoTime();
- this.field_71424_I.func_76320_a("root");
- if(Display.isCreated() && Display.isCloseRequested()) {
- this.func_71400_g();
- }
- this.field_71428_T.func_74275_a();
- this.field_71424_I.func_76320_a("scheduledExecutables");
- synchronized(this.field_152351_aB) {
- while(!this.field_152351_aB.isEmpty()) {
- Util.func_181617_a((FutureTask)this.field_152351_aB.poll(), field_147123_G);
- }
- }
- this.field_71424_I.func_76319_b();
- long long = System.nanoTime();
- this.field_71424_I.func_76320_a("tick");
- for(int int = 0; int < Math.min(10, this.field_71428_T.field_74280_b); ++int) {
- this.func_71407_l();
- }
- this.field_71424_I.func_76318_c("preRenderErrors");
- long long = System.nanoTime() - long;
- this.func_71361_d("Pre render");
- this.field_71424_I.func_76318_c("sound");
- this.field_147127_av.func_147691_a(this.field_71439_g, this.field_71428_T.field_194147_b);
- this.field_71424_I.func_76319_b();
- this.field_71424_I.func_76320_a("render");
- GlStateManager.func_179094_E();
- GlStateManager.func_179086_m(16640);
- this.field_147124_at.func_147610_a(true);
- this.field_71424_I.func_76320_a("display");
- GlStateManager.func_179098_w();
- this.field_71424_I.func_76319_b();
- if(!this.field_71454_w) {
- this.field_71424_I.func_76318_c("gameRenderer");
- this.field_71460_t.func_181560_a(this.field_71445_n?this.field_193996_ah:this.field_71428_T.field_194147_b, long);
- this.field_71424_I.func_76318_c("toasts");
- this.field_193034_aS.func_191783_a(new ScaledResolution(this));
- this.field_71424_I.func_76319_b();
- }
- this.field_71424_I.func_76319_b();
- if(this.field_71474_y.field_74330_P && this.field_71474_y.field_74329_Q && !this.field_71474_y.field_74319_N) {
- if(!this.field_71424_I.field_76327_a) {
- this.field_71424_I.func_76317_a();
- }
- this.field_71424_I.field_76327_a = true;
- this.func_71366_a(long);
- } else {
- this.field_71424_I.field_76327_a = false;
- this.field_71421_N = System.nanoTime();
- }
- this.field_147124_at.func_147609_e();
- GlStateManager.func_179121_F();
- GlStateManager.func_179094_E();
- this.field_147124_at.func_147615_c(this.field_71443_c, this.field_71440_d);
- GlStateManager.func_179121_F();
- GlStateManager.func_179094_E();
- this.field_71460_t.func_152430_c(this.field_71428_T.field_194147_b);
- GlStateManager.func_179121_F();
- this.field_71424_I.func_76320_a("root");
- this.func_175601_h();
- Thread.yield();
- this.func_71361_d("Post render");
- ++this.field_71420_M;
- 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();
- if(this.field_71445_n != boolean) {
- if(this.field_71445_n) {
- this.field_193996_ah = this.field_71428_T.field_194147_b;
- } else {
- this.field_71428_T.field_194147_b = this.field_193996_ah;
- }
- this.field_71445_n = boolean;
- }
- long long = System.nanoTime();
- this.field_181542_y.func_181747_a(long - this.field_181543_z);
- this.field_181543_z = long;
- while(func_71386_F() >= this.field_71419_L + 1000L) {
- field_71470_ab = this.field_71420_M;
- 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":""});
- RenderChunk.field_178592_a = 0;
- this.field_71419_L += 1000L;
- this.field_71420_M = 0;
- this.field_71427_U.func_76471_b();
- if(!this.field_71427_U.func_76468_d()) {
- this.field_71427_U.func_76463_a();
- }
- }
- if(this.func_147107_h()) {
- this.field_71424_I.func_76320_a("fpslimit_wait");
- Display.sync(this.func_90020_K());
- this.field_71424_I.func_76319_b();
- }
- this.field_71424_I.func_76319_b();
- }
- public void func_175601_h() {
- this.field_71424_I.func_76320_a("display_update");
- Display.update();
- this.field_71424_I.func_76319_b();
- this.func_175604_i();
- }
- protected void func_175604_i() {
- if(!this.field_71431_Q && Display.wasResized()) {
- int int = this.field_71443_c;
- int int = this.field_71440_d;
- this.field_71443_c = Display.getWidth();
- this.field_71440_d = Display.getHeight();
- if(this.field_71443_c != int || this.field_71440_d != int) {
- if(this.field_71443_c <= 0) {
- this.field_71443_c = 1;
- }
- if(this.field_71440_d <= 0) {
- this.field_71440_d = 1;
- }
- this.func_71370_a(this.field_71443_c, this.field_71440_d);
- }
- }
- }
- public int func_90020_K() {
- return this.field_71441_e == null && this.field_71462_r != null?30:this.field_71474_y.field_74350_i;
- }
- public boolean func_147107_h() {
- return (float)this.func_90020_K() < GameSettings.Options.FRAMERATE_LIMIT.func_148267_f();
- }
- public void func_71398_f() {
- try {
- field_71444_a = new byte[0];
- this.field_71438_f.func_72728_f();
- } catch (Throwable var3) {
- ;
- }
- try {
- System.gc();
- this.func_71403_a((WorldClient)null);
- } catch (Throwable var2) {
- ;
- }
- System.gc();
- }
- private void func_71383_b(int p_71383_1_) {
- List<Profiler.Result> list = this.field_71424_I.func_76321_b(this.field_71465_an);
- if(!list.isEmpty()) {
- Profiler.Result profiler$result = (Profiler.Result)list.remove(0);
- if(p_71383_1_ == 0) {
- if(!profiler$result.field_76331_c.isEmpty()) {
- int int = this.field_71465_an.lastIndexOf(46);
- if(int >= 0) {
- this.field_71465_an = this.field_71465_an.substring(0, int);
- }
- }
- } else {
- --p_71383_1_;
- if(p_71383_1_ < list.size() && !"unspecified".equals(((Profiler.Result)list.get(p_71383_1_)).field_76331_c)) {
- if(!this.field_71465_an.isEmpty()) {
- this.field_71465_an = this.field_71465_an + ".";
- }
- this.field_71465_an = this.field_71465_an + ((Profiler.Result)list.get(p_71383_1_)).field_76331_c;
- }
- }
- }
- }
- private void func_71366_a(long p_71366_1_) {
- if(this.field_71424_I.field_76327_a) {
- List<Profiler.Result> list = this.field_71424_I.func_76321_b(this.field_71465_an);
- Profiler.Result profiler$result = (Profiler.Result)list.remove(0);
- GlStateManager.func_179086_m(256);
- GlStateManager.func_179128_n(5889);
- GlStateManager.func_179142_g();
- GlStateManager.func_179096_D();
- GlStateManager.func_179130_a(0.0D, (double)this.field_71443_c, (double)this.field_71440_d, 0.0D, 1000.0D, 3000.0D);
- GlStateManager.func_179128_n(5888);
- GlStateManager.func_179096_D();
- GlStateManager.func_179109_b(0.0F, 0.0F, -2000.0F);
- GlStateManager.func_187441_d(1.0F);
- GlStateManager.func_179090_x();
- Tessellator tessellator = Tessellator.func_178181_a();
- BufferBuilder bufferbuilder = tessellator.func_178180_c();
- int int = 160;
- int int = this.field_71443_c - 160 - 10;
- int int = this.field_71440_d - 320;
- GlStateManager.func_179147_l();
- bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181706_f);
- 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();
- bufferbuilder.func_181662_b((double)((float)int - 176.0F), (double)(int + 320), 0.0D).func_181669_b(200, 0, 0, 0).func_181675_d();
- bufferbuilder.func_181662_b((double)((float)int + 176.0F), (double)(int + 320), 0.0D).func_181669_b(200, 0, 0, 0).func_181675_d();
- 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();
- tessellator.func_78381_a();
- GlStateManager.func_179084_k();
- double double = 0.0D;
- for(int int = 0; int < list.size(); ++int) {
- Profiler.Result profiler$result1 = (Profiler.Result)list.get(int);
- int int = MathHelper.func_76128_c(profiler$result1.field_76332_a / 4.0D) + 1;
- bufferbuilder.func_181668_a(6, DefaultVertexFormats.field_181706_f);
- int int = profiler$result1.func_76329_a();
- int int = int >> 16 & 255;
- int int = int >> 8 & 255;
- int int = int & 255;
- bufferbuilder.func_181662_b((double)int, (double)int, 0.0D).func_181669_b(int, int, int, 255).func_181675_d();
- for(int int = int; int >= 0; --int) {
- float float = (float)((double + profiler$result1.field_76332_a * (double)int / (double)int) * 6.2831854820251465D / 100.0D);
- float float = MathHelper.func_76126_a(float) * 160.0F;
- float float = MathHelper.func_76134_b(float) * 160.0F * 0.5F;
- bufferbuilder.func_181662_b((double)((float)int + float), (double)((float)int - float), 0.0D).func_181669_b(int, int, int, 255).func_181675_d();
- }
- tessellator.func_78381_a();
- bufferbuilder.func_181668_a(5, DefaultVertexFormats.field_181706_f);
- for(int int = int; int >= 0; --int) {
- float float = (float)((double + profiler$result1.field_76332_a * (double)int / (double)int) * 6.2831854820251465D / 100.0D);
- float float = MathHelper.func_76126_a(float) * 160.0F;
- float float = MathHelper.func_76134_b(float) * 160.0F * 0.5F;
- 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();
- 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();
- }
- tessellator.func_78381_a();
- double += profiler$result1.field_76332_a;
- }
- DecimalFormat decimalformat = new DecimalFormat("##0.00");
- GlStateManager.func_179098_w();
- String string = "";
- if(!"unspecified".equals(profiler$result.field_76331_c)) {
- string = string + "[0] ";
- }
- if(profiler$result.field_76331_c.isEmpty()) {
- string = string + "ROOT ";
- } else {
- string = string + profiler$result.field_76331_c + ' ';
- }
- int int = 16777215;
- this.field_71466_p.func_175063_a(string, (float)(int - 160), (float)(int - 80 - 16), 16777215);
- string = decimalformat.format(profiler$result.field_76330_b) + "%";
- this.field_71466_p.func_175063_a(string, (float)(int + 160 - this.field_71466_p.func_78256_a(string)), (float)(int - 80 - 16), 16777215);
- for(int int = 0; int < list.size(); ++int) {
- Profiler.Result profiler$result2 = (Profiler.Result)list.get(int);
- StringBuilder stringbuilder = new StringBuilder();
- if("unspecified".equals(profiler$result2.field_76331_c)) {
- stringbuilder.append("[?] ");
- } else {
- stringbuilder.append("[").append(int + 1).append("] ");
- }
- String string1 = stringbuilder.append(profiler$result2.field_76331_c).toString();
- this.field_71466_p.func_175063_a(string1, (float)(int - 160), (float)(int + 80 + int * 8 + 20), profiler$result2.func_76329_a());
- string1 = decimalformat.format(profiler$result2.field_76332_a) + "%";
- 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());
- string1 = decimalformat.format(profiler$result2.field_76330_b) + "%";
- 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());
- }
- }
- }
- public void func_71400_g() {
- this.field_71425_J = false;
- }
- public void func_71381_h() {
- if(Display.isActive()) {
- if(!this.field_71415_G) {
- if(!field_142025_a) {
- KeyBinding.func_186704_a();
- }
- this.field_71415_G = true;
- this.field_71417_B.func_74372_a();
- this.func_147108_a((GuiScreen)null);
- this.field_71429_W = 10000;
- }
- }
- }
- public void func_71364_i() {
- if(this.field_71415_G) {
- this.field_71415_G = false;
- this.field_71417_B.func_74373_b();
- }
- }
- public void func_71385_j() {
- if(this.field_71462_r == null) {
- this.func_147108_a(new GuiIngameMenu());
- if(this.func_71356_B() && !this.field_71437_Z.func_71344_c()) {
- this.field_147127_av.func_147689_b();
- }
- }
- }
- private void func_147115_a(boolean p_147115_1_) {
- if(!p_147115_1_) {
- this.field_71429_W = 0;
- }
- if(this.field_71429_W <= 0 && !this.field_71439_g.func_184587_cr()) {
- if(p_147115_1_ && this.field_71476_x != null && this.field_71476_x.field_72313_a == RayTraceResult.Type.BLOCK) {
- BlockPos blockpos = this.field_71476_x.func_178782_a();
- 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)) {
- this.field_71452_i.func_180532_a(blockpos, this.field_71476_x.field_178784_b);
- this.field_71439_g.func_184609_a(EnumHand.MAIN_HAND);
- }
- } else {
- this.field_71442_b.func_78767_c();
- }
- }
- }
- private void func_147116_af() {
- if(this.field_71429_W <= 0) {
- if(this.field_71476_x == null) {
- field_147123_G.error("Null returned as \'hitResult\', this shouldn\'t happen!");
- if(this.field_71442_b.func_78762_g()) {
- this.field_71429_W = 10;
- }
- } else if(!this.field_71439_g.func_184838_M()) {
- switch(this.field_71476_x.field_72313_a) {
- case ENTITY:
- this.field_71442_b.func_78764_a(this.field_71439_g, this.field_71476_x.field_72308_g);
- break;
- case BLOCK:
- BlockPos blockpos = this.field_71476_x.func_178782_a();
- if(this.field_71441_e.func_180495_p(blockpos).func_185904_a() != Material.field_151579_a) {
- this.field_71442_b.func_180511_b(blockpos, this.field_71476_x.field_178784_b);
- break;
- }
- case MISS:
- if(this.field_71442_b.func_78762_g()) {
- this.field_71429_W = 10;
- }
- this.field_71439_g.func_184821_cY();
- }
- this.field_71439_g.func_184609_a(EnumHand.MAIN_HAND);
- }
- }
- }
- private void func_147121_ag() {
- if(!this.field_71442_b.func_181040_m()) {
- this.field_71467_ac = 4;
- if(!this.field_71439_g.func_184838_M()) {
- if(this.field_71476_x == null) {
- field_147123_G.warn("Null returned as \'hitResult\', this shouldn\'t happen!");
- }
- for(EnumHand enumhand : EnumHand.values()) {
- ItemStack itemstack = this.field_71439_g.func_184586_b(enumhand);
- if(this.field_71476_x != null) {
- switch(this.field_71476_x.field_72313_a) {
- case ENTITY:
- 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) {
- return;
- }
- if(this.field_71442_b.func_187097_a(this.field_71439_g, this.field_71476_x.field_72308_g, enumhand) == EnumActionResult.SUCCESS) {
- return;
- }
- break;
- case BLOCK:
- BlockPos blockpos = this.field_71476_x.func_178782_a();
- if(this.field_71441_e.func_180495_p(blockpos).func_185904_a() != Material.field_151579_a) {
- int int = itemstack.func_190916_E();
- 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);
- if(enumactionresult == EnumActionResult.SUCCESS) {
- this.field_71439_g.func_184609_a(enumhand);
- if(!itemstack.func_190926_b() && (itemstack.func_190916_E() != int || this.field_71442_b.func_78758_h())) {
- this.field_71460_t.field_78516_c.func_187460_a(enumhand);
- }
- return;
- }
- }
- }
- }
- if(!itemstack.func_190926_b() && this.field_71442_b.func_187101_a(this.field_71439_g, this.field_71441_e, enumhand) == EnumActionResult.SUCCESS) {
- this.field_71460_t.field_78516_c.func_187460_a(enumhand);
- return;
- }
- }
- }
- }
- }
- public void func_71352_k() {
- try {
- this.field_71431_Q = !this.field_71431_Q;
- this.field_71474_y.field_74353_u = this.field_71431_Q;
- if(this.field_71431_Q) {
- this.func_110441_Q();
- this.field_71443_c = Display.getDisplayMode().getWidth();
- this.field_71440_d = Display.getDisplayMode().getHeight();
- if(this.field_71443_c <= 0) {
- this.field_71443_c = 1;
- }
- if(this.field_71440_d <= 0) {
- this.field_71440_d = 1;
- }
- } else {
- Display.setDisplayMode(new DisplayMode(this.field_71436_X, this.field_71435_Y));
- this.field_71443_c = this.field_71436_X;
- this.field_71440_d = this.field_71435_Y;
- if(this.field_71443_c <= 0) {
- this.field_71443_c = 1;
- }
- if(this.field_71440_d <= 0) {
- this.field_71440_d = 1;
- }
- }
- if(this.field_71462_r != null) {
- this.func_71370_a(this.field_71443_c, this.field_71440_d);
- } else {
- this.func_147119_ah();
- }
- Display.setFullscreen(this.field_71431_Q);
- Display.setVSyncEnabled(this.field_71474_y.field_74352_v);
- this.func_175601_h();
- } catch (Exception exception) {
- field_147123_G.error((String)"Couldn\'t toggle fullscreen", (Throwable)exception);
- }
- }
- public void func_71370_a(int p_71370_1_, int p_71370_2_) {
- this.field_71443_c = Math.max(1, p_71370_1_);
- this.field_71440_d = Math.max(1, p_71370_2_);
- if(this.field_71462_r != null) {
- ScaledResolution scaledresolution = new ScaledResolution(this);
- this.field_71462_r.func_175273_b(this, scaledresolution.func_78326_a(), scaledresolution.func_78328_b());
- }
- this.field_71461_s = new LoadingScreenRenderer(this);
- this.func_147119_ah();
- }
- private void func_147119_ah() {
- this.field_147124_at.func_147613_a(this.field_71443_c, this.field_71440_d);
- if(this.field_71460_t != null) {
- this.field_71460_t.func_147704_a(this.field_71443_c, this.field_71440_d);
- }
- }
- public MusicTicker func_181535_r() {
- return this.field_147126_aw;
- }
- public void func_71407_l() throws IOException {
- if(this.field_71467_ac > 0) {
- --this.field_71467_ac;
- }
- this.field_71424_I.func_76320_a("gui");
- if(!this.field_71445_n) {
- this.field_71456_v.func_73831_a();
- }
- this.field_71424_I.func_76319_b();
- this.field_71460_t.func_78473_a(1.0F);
- this.field_193035_aW.func_193297_a(this.field_71441_e, this.field_71476_x);
- this.field_71424_I.func_76320_a("gameMode");
- if(!this.field_71445_n && this.field_71441_e != null) {
- this.field_71442_b.func_78765_e();
- }
- this.field_71424_I.func_76318_c("textures");
- if(this.field_71441_e != null) {
- this.field_71446_o.func_110550_d();
- }
- if(this.field_71462_r == null && this.field_71439_g != null) {
- if(this.field_71439_g.func_110143_aJ() <= 0.0F && !(this.field_71462_r instanceof GuiGameOver)) {
- this.func_147108_a((GuiScreen)null);
- } else if(this.field_71439_g.func_70608_bn() && this.field_71441_e != null) {
- this.func_147108_a(new GuiSleepMP());
- }
- } else if(this.field_71462_r != null && this.field_71462_r instanceof GuiSleepMP && !this.field_71439_g.func_70608_bn()) {
- this.func_147108_a((GuiScreen)null);
- }
- if(this.field_71462_r != null) {
- this.field_71429_W = 10000;
- }
- if(this.field_71462_r != null) {
- try {
- this.field_71462_r.func_146269_k();
- } catch (Throwable throwable1) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable1, "Updating screen events");
- CrashReportCategory crashreportcategory = crashreport.func_85058_a("Affected screen");
- crashreportcategory.func_189529_a("Screen name", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return Minecraft.this.field_71462_r.getClass().getCanonicalName();
- }
- });
- throw new ReportedException(crashreport);
- }
- if(this.field_71462_r != null) {
- try {
- this.field_71462_r.func_73876_c();
- } catch (Throwable throwable) {
- CrashReport crashreport1 = CrashReport.func_85055_a(throwable, "Ticking screen");
- CrashReportCategory crashreportcategory1 = crashreport1.func_85058_a("Affected screen");
- crashreportcategory1.func_189529_a("Screen name", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return Minecraft.this.field_71462_r.getClass().getCanonicalName();
- }
- });
- throw new ReportedException(crashreport1);
- }
- }
- }
- if(this.field_71462_r == null || this.field_71462_r.field_146291_p) {
- this.field_71424_I.func_76318_c("mouse");
- this.func_184124_aB();
- if(this.field_71429_W > 0) {
- --this.field_71429_W;
- }
- this.field_71424_I.func_76318_c("keyboard");
- this.func_184118_az();
- }
- if(this.field_71441_e != null) {
- if(this.field_71439_g != null) {
- ++this.field_71457_ai;
- if(this.field_71457_ai == 30) {
- this.field_71457_ai = 0;
- this.field_71441_e.func_72897_h(this.field_71439_g);
- }
- }
- this.field_71424_I.func_76318_c("gameRenderer");
- if(!this.field_71445_n) {
- this.field_71460_t.func_78464_a();
- }
- this.field_71424_I.func_76318_c("levelRenderer");
- if(!this.field_71445_n) {
- this.field_71438_f.func_72734_e();
- }
- this.field_71424_I.func_76318_c("level");
- if(!this.field_71445_n) {
- if(this.field_71441_e.func_175658_ac() > 0) {
- this.field_71441_e.func_175702_c(this.field_71441_e.func_175658_ac() - 1);
- }
- this.field_71441_e.func_72939_s();
- }
- } else if(this.field_71460_t.func_147702_a()) {
- this.field_71460_t.func_181022_b();
- }
- if(!this.field_71445_n) {
- this.field_147126_aw.func_73660_a();
- this.field_147127_av.func_73660_a();
- }
- if(this.field_71441_e != null) {
- if(!this.field_71445_n) {
- this.field_71441_e.func_72891_a(this.field_71441_e.func_175659_aa() != EnumDifficulty.PEACEFUL, true);
- this.field_193035_aW.func_193303_d();
- try {
- this.field_71441_e.func_72835_b();
- } catch (Throwable throwable2) {
- CrashReport crashreport2 = CrashReport.func_85055_a(throwable2, "Exception in world tick");
- if(this.field_71441_e == null) {
- CrashReportCategory crashreportcategory2 = crashreport2.func_85058_a("Affected level");
- crashreportcategory2.func_71507_a("Problem", "Level is null!");
- } else {
- this.field_71441_e.func_72914_a(crashreport2);
- }
- throw new ReportedException(crashreport2);
- }
- }
- this.field_71424_I.func_76318_c("animateTick");
- if(!this.field_71445_n && this.field_71441_e != null) {
- 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));
- }
- this.field_71424_I.func_76318_c("particles");
- if(!this.field_71445_n) {
- this.field_71452_i.func_78868_a();
- }
- } else if(this.field_71453_ak != null) {
- this.field_71424_I.func_76318_c("pendingConnection");
- this.field_71453_ak.func_74428_b();
- }
- this.field_71424_I.func_76319_b();
- this.field_71423_H = func_71386_F();
- }
- private void func_184118_az() throws IOException {
- while(Keyboard.next()) {
- int int = Keyboard.getEventKey() == 0?Keyboard.getEventCharacter() + 256:Keyboard.getEventKey();
- if(this.field_83002_am > 0L) {
- if(func_71386_F() - this.field_83002_am >= 6000L) {
- throw new ReportedException(new CrashReport("Manually triggered debug crash", new Throwable()));
- }
- if(!Keyboard.isKeyDown(46) || !Keyboard.isKeyDown(61)) {
- this.field_83002_am = -1L;
- }
- } else if(Keyboard.isKeyDown(46) && Keyboard.isKeyDown(61)) {
- this.field_184129_aV = true;
- this.field_83002_am = func_71386_F();
- }
- this.func_152348_aa();
- if(this.field_71462_r != null) {
- this.field_71462_r.func_146282_l();
- }
- boolean boolean = Keyboard.getEventKeyState();
- if(boolean) {
- if(int == 62 && this.field_71460_t != null) {
- this.field_71460_t.func_175071_c();
- }
- boolean boolean = false;
- if(this.field_71462_r == null) {
- if(int == 1) {
- this.func_71385_j();
- }
- boolean = Keyboard.isKeyDown(61) && this.func_184122_c(int);
- this.field_184129_aV |= boolean;
- if(int == 59) {
- this.field_71474_y.field_74319_N = !this.field_71474_y.field_74319_N;
- }
- }
- if(boolean) {
- KeyBinding.func_74510_a(int, false);
- } else {
- KeyBinding.func_74510_a(int, true);
- KeyBinding.func_74507_a(int);
- }
- if(this.field_71474_y.field_74329_Q) {
- if(int == 11) {
- this.func_71383_b(0);
- }
- for(int int = 0; int < 9; ++int) {
- if(int == 2 + int) {
- this.func_71383_b(int + 1);
- }
- }
- }
- } else {
- KeyBinding.func_74510_a(int, false);
- if(int == 61) {
- if(this.field_184129_aV) {
- this.field_184129_aV = false;
- } else {
- this.field_71474_y.field_74330_P = !this.field_71474_y.field_74330_P;
- this.field_71474_y.field_74329_Q = this.field_71474_y.field_74330_P && GuiScreen.func_146272_n();
- this.field_71474_y.field_181657_aC = this.field_71474_y.field_74330_P && GuiScreen.func_175283_s();
- }
- }
- }
- }
- this.func_184117_aA();
- }
- private boolean func_184122_c(int p_184122_1_) {
- if(p_184122_1_ == 30) {
- this.field_71438_f.func_72712_a();
- this.func_190521_a("debug.reload_chunks.message", new Object[0]);
- return true;
- } else if(p_184122_1_ == 48) {
- boolean boolean = !this.field_175616_W.func_178634_b();
- this.field_175616_W.func_178629_b(boolean);
- this.func_190521_a(boolean?"debug.show_hitboxes.on":"debug.show_hitboxes.off", new Object[0]);
- return true;
- } else if(p_184122_1_ == 32) {
- if(this.field_71456_v != null) {
- this.field_71456_v.func_146158_b().func_146231_a(false);
- }
- return true;
- } else if(p_184122_1_ == 33) {
- this.field_71474_y.func_74306_a(GameSettings.Options.RENDER_DISTANCE, GuiScreen.func_146272_n()?-1:1);
- this.func_190521_a("debug.cycle_renderdistance.message", new Object[]{Integer.valueOf(this.field_71474_y.field_151451_c)});
- return true;
- } else if(p_184122_1_ == 34) {
- boolean boolean = this.field_184132_p.func_190075_b();
- this.func_190521_a(boolean?"debug.chunk_boundaries.on":"debug.chunk_boundaries.off", new Object[0]);
- return true;
- } else if(p_184122_1_ == 35) {
- this.field_71474_y.field_82882_x = !this.field_71474_y.field_82882_x;
- this.func_190521_a(this.field_71474_y.field_82882_x?"debug.advanced_tooltips.on":"debug.advanced_tooltips.off", new Object[0]);
- this.field_71474_y.func_74303_b();
- return true;
- } else if(p_184122_1_ == 49) {
- if(!this.field_71439_g.func_70003_b(2, "")) {
- this.func_190521_a("debug.creative_spectator.error", new Object[0]);
- } else if(this.field_71439_g.func_184812_l_()) {
- this.field_71439_g.func_71165_d("/gamemode spectator");
- } else if(this.field_71439_g.func_175149_v()) {
- this.field_71439_g.func_71165_d("/gamemode creative");
- }
- return true;
- } else if(p_184122_1_ == 25) {
- this.field_71474_y.field_82881_y = !this.field_71474_y.field_82881_y;
- this.field_71474_y.func_74303_b();
- this.func_190521_a(this.field_71474_y.field_82881_y?"debug.pause_focus.on":"debug.pause_focus.off", new Object[0]);
- return true;
- } else if(p_184122_1_ == 16) {
- this.func_190521_a("debug.help.message", new Object[0]);
- GuiNewChat guinewchat = this.field_71456_v.func_146158_b();
- guinewchat.func_146227_a(new TextComponentTranslation("debug.reload_chunks.help", new Object[0]));
- guinewchat.func_146227_a(new TextComponentTranslation("debug.show_hitboxes.help", new Object[0]));
- guinewchat.func_146227_a(new TextComponentTranslation("debug.clear_chat.help", new Object[0]));
- guinewchat.func_146227_a(new TextComponentTranslation("debug.cycle_renderdistance.help", new Object[0]));
- guinewchat.func_146227_a(new TextComponentTranslation("debug.chunk_boundaries.help", new Object[0]));
- guinewchat.func_146227_a(new TextComponentTranslation("debug.advanced_tooltips.help", new Object[0]));
- guinewchat.func_146227_a(new TextComponentTranslation("debug.creative_spectator.help", new Object[0]));
- guinewchat.func_146227_a(new TextComponentTranslation("debug.pause_focus.help", new Object[0]));
- guinewchat.func_146227_a(new TextComponentTranslation("debug.help.help", new Object[0]));
- guinewchat.func_146227_a(new TextComponentTranslation("debug.reload_resourcepacks.help", new Object[0]));
- return true;
- } else if(p_184122_1_ == 20) {
- this.func_190521_a("debug.reload_resourcepacks.message", new Object[0]);
- this.func_110436_a();
- return true;
- } else {
- return false;
- }
- }
- private void func_184117_aA() {
- for(; this.field_71474_y.field_151457_aa.func_151468_f(); this.field_71438_f.func_174979_m()) {
- ++this.field_71474_y.field_74320_O;
- if(this.field_71474_y.field_74320_O > 2) {
- this.field_71474_y.field_74320_O = 0;
- }
- if(this.field_71474_y.field_74320_O == 0) {
- this.field_71460_t.func_175066_a(this.func_175606_aa());
- } else if(this.field_71474_y.field_74320_O == 1) {
- this.field_71460_t.func_175066_a((Entity)null);
- }
- }
- while(this.field_71474_y.field_151458_ab.func_151468_f()) {
- this.field_71474_y.field_74326_T = !this.field_71474_y.field_74326_T;
- }
- for(int int = 0; int < 9; ++int) {
- boolean boolean = this.field_71474_y.field_193629_ap.func_151470_d();
- boolean boolean = this.field_71474_y.field_193630_aq.func_151470_d();
- if(this.field_71474_y.field_151456_ac[int].func_151468_f()) {
- if(this.field_71439_g.func_175149_v()) {
- this.field_71456_v.func_175187_g().func_175260_a(int);
- } else if(!this.field_71439_g.func_184812_l_() || this.field_71462_r != null || !boolean && !boolean) {
- this.field_71439_g.field_71071_by.field_70461_c = int;
- } else {
- GuiContainerCreative.func_192044_a(this, int, boolean, boolean);
- }
- }
- }
- while(this.field_71474_y.field_151445_Q.func_151468_f()) {
- if(this.field_71442_b.func_110738_j()) {
- this.field_71439_g.func_175163_u();
- } else {
- this.field_193035_aW.func_193296_a();
- this.func_147108_a(new GuiInventory(this.field_71439_g));
- }
- }
- while(this.field_71474_y.field_194146_ao.func_151468_f()) {
- this.func_147108_a(new GuiScreenAdvancements(this.field_71439_g.field_71174_a.func_191982_f()));
- }
- while(this.field_71474_y.field_186718_X.func_151468_f()) {
- if(!this.field_71439_g.func_175149_v()) {
- this.func_147114_u().func_147297_a(new CPacketPlayerDigging(CPacketPlayerDigging.Action.SWAP_HELD_ITEMS, BlockPos.field_177992_a, EnumFacing.DOWN));
- }
- }
- while(this.field_71474_y.field_74316_C.func_151468_f()) {
- if(!this.field_71439_g.func_175149_v()) {
- this.field_71439_g.func_71040_bB(GuiScreen.func_146271_m());
- }
- }
- boolean boolean = this.field_71474_y.field_74343_n != EntityPlayer.EnumChatVisibility.HIDDEN;
- if(boolean) {
- while(this.field_71474_y.field_74310_D.func_151468_f()) {
- this.func_147108_a(new GuiChat());
- }
- if(this.field_71462_r == null && this.field_71474_y.field_74323_J.func_151468_f()) {
- this.func_147108_a(new GuiChat("/"));
- }
- }
- if(this.field_71439_g.func_184587_cr()) {
- if(!this.field_71474_y.field_74313_G.func_151470_d()) {
- this.field_71442_b.func_78766_c(this.field_71439_g);
- }
- label556:
- while(true) {
- if(!this.field_71474_y.field_74312_F.func_151468_f()) {
- while(this.field_71474_y.field_74313_G.func_151468_f()) {
- ;
- }
- while(true) {
- if(this.field_71474_y.field_74322_I.func_151468_f()) {
- continue;
- }
- break label556;
- }
- }
- }
- } else {
- while(this.field_71474_y.field_74312_F.func_151468_f()) {
- this.func_147116_af();
- }
- while(this.field_71474_y.field_74313_G.func_151468_f()) {
- this.func_147121_ag();
- }
- while(this.field_71474_y.field_74322_I.func_151468_f()) {
- this.func_147112_ai();
- }
- }
- if(this.field_71474_y.field_74313_G.func_151470_d() && this.field_71467_ac == 0 && !this.field_71439_g.func_184587_cr()) {
- this.func_147121_ag();
- }
- this.func_147115_a(this.field_71462_r == null && this.field_71474_y.field_74312_F.func_151470_d() && this.field_71415_G);
- }
- private void func_184124_aB() throws IOException {
- while(Mouse.next()) {
- int int = Mouse.getEventButton();
- KeyBinding.func_74510_a(int - 100, Mouse.getEventButtonState());
- if(Mouse.getEventButtonState()) {
- if(this.field_71439_g.func_175149_v() && int == 2) {
- this.field_71456_v.func_175187_g().func_175261_b();
- } else {
- KeyBinding.func_74507_a(int - 100);
- }
- }
- long long = func_71386_F() - this.field_71423_H;
- if(long <= 200L) {
- int int = Mouse.getEventDWheel();
- if(int != 0) {
- if(this.field_71439_g.func_175149_v()) {
- int = int < 0?-1:1;
- if(this.field_71456_v.func_175187_g().func_175262_a()) {
- this.field_71456_v.func_175187_g().func_175259_b(-int);
- } else {
- float float = MathHelper.func_76131_a(this.field_71439_g.field_71075_bZ.func_75093_a() + (float)int * 0.005F, 0.0F, 0.2F);
- this.field_71439_g.field_71075_bZ.func_75092_a(float);
- }
- } else {
- this.field_71439_g.field_71071_by.func_70453_c(int);
- }
- }
- if(this.field_71462_r == null) {
- if(!this.field_71415_G && Mouse.getEventButtonState()) {
- this.func_71381_h();
- }
- } else if(this.field_71462_r != null) {
- this.field_71462_r.func_146274_d();
- }
- }
- }
- }
- private void func_190521_a(String p_190521_1_, Object... p_190521_2_) {
- 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_)));
- }
- public void func_71371_a(String p_71371_1_, String p_71371_2_, @Nullable WorldSettings p_71371_3_) {
- this.func_71403_a((WorldClient)null);
- System.gc();
- ISaveHandler isavehandler = this.field_71469_aa.func_75804_a(p_71371_1_, false);
- WorldInfo worldinfo = isavehandler.func_75757_d();
- if(worldinfo == null && p_71371_3_ != null) {
- worldinfo = new WorldInfo(p_71371_3_, p_71371_1_);
- isavehandler.func_75761_a(worldinfo);
- }
- if(p_71371_3_ == null) {
- p_71371_3_ = new WorldSettings(worldinfo);
- }
- try {
- YggdrasilAuthenticationService yggdrasilauthenticationservice = new YggdrasilAuthenticationService(this.field_110453_aa, UUID.randomUUID().toString());
- MinecraftSessionService minecraftsessionservice = yggdrasilauthenticationservice.createMinecraftSessionService();
- GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository();
- PlayerProfileCache playerprofilecache = new PlayerProfileCache(gameprofilerepository, new File(this.field_71412_D, MinecraftServer.field_152367_a.getName()));
- TileEntitySkull.func_184293_a(playerprofilecache);
- TileEntitySkull.func_184294_a(minecraftsessionservice);
- PlayerProfileCache.func_187320_a(false);
- this.field_71437_Z = new IntegratedServer(this, p_71371_1_, p_71371_2_, p_71371_3_, yggdrasilauthenticationservice, minecraftsessionservice, gameprofilerepository, playerprofilecache);
- this.field_71437_Z.func_71256_s();
- this.field_71455_al = true;
- } catch (Throwable throwable) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable, "Starting integrated server");
- CrashReportCategory crashreportcategory = crashreport.func_85058_a("Starting integrated server");
- crashreportcategory.func_71507_a("Level ID", p_71371_1_);
- crashreportcategory.func_71507_a("Level Name", p_71371_2_);
- throw new ReportedException(crashreport);
- }
- this.field_71461_s.func_73720_a(I18n.func_135052_a("menu.loadingLevel", new Object[0]));
- while(!this.field_71437_Z.func_71200_ad()) {
- String string = this.field_71437_Z.func_71195_b_();
- if(string != null) {
- this.field_71461_s.func_73719_c(I18n.func_135052_a(string, new Object[0]));
- } else {
- this.field_71461_s.func_73719_c("");
- }
- try {
- Thread.sleep(200L);
- } catch (InterruptedException var10) {
- ;
- }
- }
- this.func_147108_a(new GuiScreenWorking());
- SocketAddress socketaddress = this.field_71437_Z.func_147137_ag().func_151270_a();
- NetworkManager networkmanager = NetworkManager.func_150722_a(socketaddress);
- networkmanager.func_150719_a(new NetHandlerLoginClient(networkmanager, this, (GuiScreen)null));
- networkmanager.func_179290_a(new C00Handshake(335, socketaddress.toString(), 0, EnumConnectionState.LOGIN));
- networkmanager.func_179290_a(new CPacketLoginStart(this.func_110432_I().func_148256_e()));
- this.field_71453_ak = networkmanager;
- }
- public void func_71403_a(@Nullable WorldClient p_71403_1_) {
- this.func_71353_a(p_71403_1_, "");
- }
- public void func_71353_a(@Nullable WorldClient p_71353_1_, String p_71353_2_) {
- if(p_71353_1_ == null) {
- NetHandlerPlayClient nethandlerplayclient = this.func_147114_u();
- if(nethandlerplayclient != null) {
- nethandlerplayclient.func_147296_c();
- }
- if(this.field_71437_Z != null && this.field_71437_Z.func_175578_N()) {
- this.field_71437_Z.func_71263_m();
- }
- this.field_71437_Z = null;
- this.field_71460_t.func_190564_k();
- this.field_71442_b = null;
- NarratorChatListener.field_193643_a.func_193642_b();
- }
- this.field_175622_Z = null;
- this.field_71453_ak = null;
- if(this.field_71461_s != null) {
- this.field_71461_s.func_73721_b(p_71353_2_);
- this.field_71461_s.func_73719_c("");
- }
- if(p_71353_1_ == null && this.field_71441_e != null) {
- this.field_110448_aq.func_148529_f();
- this.field_71456_v.func_181029_i();
- this.func_71351_a((ServerData)null);
- this.field_71455_al = false;
- }
- this.field_147127_av.func_147690_c();
- this.field_71441_e = p_71353_1_;
- if(this.field_71438_f != null) {
- this.field_71438_f.func_72732_a(p_71353_1_);
- }
- if(this.field_71452_i != null) {
- this.field_71452_i.func_78870_a(p_71353_1_);
- }
- TileEntityRendererDispatcher.field_147556_a.func_147543_a(p_71353_1_);
- if(p_71353_1_ != null) {
- if(!this.field_71455_al) {
- AuthenticationService authenticationservice = new YggdrasilAuthenticationService(this.field_110453_aa, UUID.randomUUID().toString());
- MinecraftSessionService minecraftsessionservice = authenticationservice.createMinecraftSessionService();
- GameProfileRepository gameprofilerepository = authenticationservice.createProfileRepository();
- PlayerProfileCache playerprofilecache = new PlayerProfileCache(gameprofilerepository, new File(this.field_71412_D, MinecraftServer.field_152367_a.getName()));
- TileEntitySkull.func_184293_a(playerprofilecache);
- TileEntitySkull.func_184294_a(minecraftsessionservice);
- PlayerProfileCache.func_187320_a(false);
- }
- if(this.field_71439_g == null) {
- this.field_71439_g = this.field_71442_b.func_192830_a(p_71353_1_, new StatisticsManager(), new RecipeBookClient());
- this.field_71442_b.func_78745_b(this.field_71439_g);
- }
- this.field_71439_g.func_70065_x();
- p_71353_1_.func_72838_d(this.field_71439_g);
- this.field_71439_g.field_71158_b = new MovementInputFromOptions(this.field_71474_y);
- this.field_71442_b.func_78748_a(this.field_71439_g);
- this.field_175622_Z = this.field_71439_g;
- } else {
- this.field_71469_aa.func_75800_d();
- this.field_71439_g = null;
- }
- System.gc();
- this.field_71423_H = 0L;
- }
- public void func_71354_a(int p_71354_1_) {
- this.field_71441_e.func_72974_f();
- this.field_71441_e.func_73022_a();
- int int = 0;
- String string = null;
- if(this.field_71439_g != null) {
- int = this.field_71439_g.func_145782_y();
- this.field_71441_e.func_72900_e(this.field_71439_g);
- string = this.field_71439_g.func_142021_k();
- }
- this.field_175622_Z = null;
- EntityPlayerSP entityplayersp = this.field_71439_g;
- 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());
- this.field_71439_g.func_184212_Q().func_187218_a(entityplayersp.func_184212_Q().func_187231_c());
- this.field_71439_g.field_71093_bK = p_71354_1_;
- this.field_175622_Z = this.field_71439_g;
- this.field_71439_g.func_70065_x();
- this.field_71439_g.func_175158_f(string);
- this.field_71441_e.func_72838_d(this.field_71439_g);
- this.field_71442_b.func_78745_b(this.field_71439_g);
- this.field_71439_g.field_71158_b = new MovementInputFromOptions(this.field_71474_y);
- this.field_71439_g.func_145769_d(int);
- this.field_71442_b.func_78748_a(this.field_71439_g);
- this.field_71439_g.func_175150_k(entityplayersp.func_175140_cp());
- if(this.field_71462_r instanceof GuiGameOver) {
- this.func_147108_a((GuiScreen)null);
- }
- }
- public final boolean func_71355_q() {
- return this.field_71459_aj;
- }
- @Nullable
- public NetHandlerPlayClient func_147114_u() {
- return this.field_71439_g == null?null:this.field_71439_g.field_71174_a;
- }
- public static boolean func_71382_s() {
- return field_71432_P == null || !field_71432_P.field_71474_y.field_74319_N;
- }
- public static boolean func_71375_t() {
- return field_71432_P != null && field_71432_P.field_71474_y.field_74347_j;
- }
- public static boolean func_71379_u() {
- return field_71432_P != null && field_71432_P.field_71474_y.field_74348_k != 0;
- }
- private void func_147112_ai() {
- if(this.field_71476_x != null && this.field_71476_x.field_72313_a != RayTraceResult.Type.MISS) {
- boolean boolean = this.field_71439_g.field_71075_bZ.field_75098_d;
- TileEntity tileentity = null;
- ItemStack itemstack;
- if(this.field_71476_x.field_72313_a == RayTraceResult.Type.BLOCK) {
- BlockPos blockpos = this.field_71476_x.func_178782_a();
- IBlockState iblockstate = this.field_71441_e.func_180495_p(blockpos);
- Block block = iblockstate.func_177230_c();
- if(iblockstate.func_185904_a() == Material.field_151579_a) {
- return;
- }
- itemstack = block.func_185473_a(this.field_71441_e, blockpos, iblockstate);
- if(itemstack.func_190926_b()) {
- return;
- }
- if(boolean && GuiScreen.func_146271_m() && block.func_149716_u()) {
- tileentity = this.field_71441_e.func_175625_s(blockpos);
- }
- } else {
- if(this.field_71476_x.field_72313_a != RayTraceResult.Type.ENTITY || this.field_71476_x.field_72308_g == null || !boolean) {
- return;
- }
- if(this.field_71476_x.field_72308_g instanceof EntityPainting) {
- itemstack = new ItemStack(Items.field_151159_an);
- } else if(this.field_71476_x.field_72308_g instanceof EntityLeashKnot) {
- itemstack = new ItemStack(Items.field_151058_ca);
- } else if(this.field_71476_x.field_72308_g instanceof EntityItemFrame) {
- EntityItemFrame entityitemframe = (EntityItemFrame)this.field_71476_x.field_72308_g;
- ItemStack itemstack1 = entityitemframe.func_82335_i();
- if(itemstack1.func_190926_b()) {
- itemstack = new ItemStack(Items.field_151160_bD);
- } else {
- itemstack = itemstack1.func_77946_l();
- }
- } else if(this.field_71476_x.field_72308_g instanceof EntityMinecart) {
- EntityMinecart entityminecart = (EntityMinecart)this.field_71476_x.field_72308_g;
- Item item;
- switch(entityminecart.func_184264_v()) {
- case FURNACE:
- item = Items.field_151109_aJ;
- break;
- case CHEST:
- item = Items.field_151108_aI;
- break;
- case TNT:
- item = Items.field_151142_bV;
- break;
- case HOPPER:
- item = Items.field_151140_bW;
- break;
- case COMMAND_BLOCK:
- item = Items.field_151095_cc;
- break;
- default:
- item = Items.field_151143_au;
- }
- itemstack = new ItemStack(item);
- } else if(this.field_71476_x.field_72308_g instanceof EntityBoat) {
- itemstack = new ItemStack(((EntityBoat)this.field_71476_x.field_72308_g).func_184455_j());
- } else if(this.field_71476_x.field_72308_g instanceof EntityArmorStand) {
- itemstack = new ItemStack(Items.field_179565_cj);
- } else if(this.field_71476_x.field_72308_g instanceof EntityEnderCrystal) {
- itemstack = new ItemStack(Items.field_185158_cP);
- } else {
- ResourceLocation resourcelocation = EntityList.func_191301_a(this.field_71476_x.field_72308_g);
- if(resourcelocation == null || !EntityList.field_75627_a.containsKey(resourcelocation)) {
- return;
- }
- itemstack = new ItemStack(Items.field_151063_bx);
- ItemMonsterPlacer.func_185078_a(itemstack, resourcelocation);
- }
- }
- if(itemstack.func_190926_b()) {
- String string = "";
- if(this.field_71476_x.field_72313_a == RayTraceResult.Type.BLOCK) {
- 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();
- } else if(this.field_71476_x.field_72313_a == RayTraceResult.Type.ENTITY) {
- string = EntityList.func_191301_a(this.field_71476_x.field_72308_g).toString();
- }
- field_147123_G.warn((String)"Picking on: [{}] {} gave null item", (Object)this.field_71476_x.field_72313_a, (Object)string);
- } else {
- InventoryPlayer inventoryplayer = this.field_71439_g.field_71071_by;
- if(tileentity != null) {
- this.func_184119_a(itemstack, tileentity);
- }
- int int = inventoryplayer.func_184429_b(itemstack);
- if(boolean) {
- inventoryplayer.func_184434_a(itemstack);
- this.field_71442_b.func_78761_a(this.field_71439_g.func_184586_b(EnumHand.MAIN_HAND), 36 + inventoryplayer.field_70461_c);
- } else if(int != -1) {
- if(InventoryPlayer.func_184435_e(int)) {
- inventoryplayer.field_70461_c = int;
- } else {
- this.field_71442_b.func_187100_a(int);
- }
- }
- }
- }
- }
- public ItemStack func_184119_a(ItemStack p_184119_1_, TileEntity p_184119_2_) {
- NBTTagCompound nbttagcompound = p_184119_2_.func_189515_b(new NBTTagCompound());
- if(p_184119_1_.func_77973_b() == Items.field_151144_bL && nbttagcompound.func_74764_b("Owner")) {
- NBTTagCompound nbttagcompound2 = nbttagcompound.func_74775_l("Owner");
- NBTTagCompound nbttagcompound3 = new NBTTagCompound();
- nbttagcompound3.func_74782_a("SkullOwner", nbttagcompound2);
- p_184119_1_.func_77982_d(nbttagcompound3);
- return p_184119_1_;
- } else {
- p_184119_1_.func_77983_a("BlockEntityTag", nbttagcompound);
- NBTTagCompound nbttagcompound1 = new NBTTagCompound();
- NBTTagList nbttaglist = new NBTTagList();
- nbttaglist.func_74742_a(new NBTTagString("(+NBT)"));
- nbttagcompound1.func_74782_a("Lore", nbttaglist);
- p_184119_1_.func_77983_a("display", nbttagcompound1);
- return p_184119_1_;
- }
- }
- public CrashReport func_71396_d(CrashReport p_71396_1_) {
- p_71396_1_.func_85056_g().func_189529_a("Launched Version", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return Minecraft.this.field_110447_Z;
- }
- });
- p_71396_1_.func_85056_g().func_189529_a("LWJGL", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return Sys.getVersion();
- }
- });
- p_71396_1_.func_85056_g().func_189529_a("OpenGL", new ICrashReportDetail<String>() {
- public String call() {
- return GlStateManager.func_187416_u(7937) + " GL version " + GlStateManager.func_187416_u(7938) + ", " + GlStateManager.func_187416_u(7936);
- }
- });
- p_71396_1_.func_85056_g().func_189529_a("GL Caps", new ICrashReportDetail<String>() {
- public String call() {
- return OpenGlHelper.func_153172_c();
- }
- });
- p_71396_1_.func_85056_g().func_189529_a("Using VBOs", new ICrashReportDetail<String>() {
- public String call() {
- return Minecraft.this.field_71474_y.field_178881_t?"Yes":"No";
- }
- });
- p_71396_1_.func_85056_g().func_189529_a("Is Modded", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- String string = ClientBrandRetriever.getClientModName();
- 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.");
- }
- });
- p_71396_1_.func_85056_g().func_189529_a("Type", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return "Client (map_client.txt)";
- }
- });
- p_71396_1_.func_85056_g().func_189529_a("Resource Packs", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- StringBuilder stringbuilder = new StringBuilder();
- for(String string : Minecraft.this.field_71474_y.field_151453_l) {
- if(stringbuilder.length() > 0) {
- stringbuilder.append(", ");
- }
- stringbuilder.append(string);
- if(Minecraft.this.field_71474_y.field_183018_l.contains(string)) {
- stringbuilder.append(" (incompatible)");
- }
- }
- return stringbuilder.toString();
- }
- });
- p_71396_1_.func_85056_g().func_189529_a("Current Language", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return Minecraft.this.field_135017_as.func_135041_c().toString();
- }
- });
- p_71396_1_.func_85056_g().func_189529_a("Profiler Position", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return Minecraft.this.field_71424_I.field_76327_a?Minecraft.this.field_71424_I.func_76322_c():"N/A (disabled)";
- }
- });
- p_71396_1_.func_85056_g().func_189529_a("CPU", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return OpenGlHelper.func_183029_j();
- }
- });
- if(this.field_71441_e != null) {
- this.field_71441_e.func_72914_a(p_71396_1_);
- }
- return p_71396_1_;
- }
- public static Minecraft func_71410_x() {
- return field_71432_P;
- }
- public ListenableFuture<Object> func_175603_A() {
- return this.func_152344_a(new Runnable() {
- public void run() {
- Minecraft.this.func_110436_a();
- }
- });
- }
- public void func_70000_a(Snooper p_70000_1_) {
- p_70000_1_.func_152768_a("fps", Integer.valueOf(field_71470_ab));
- p_70000_1_.func_152768_a("vsync_enabled", Boolean.valueOf(this.field_71474_y.field_74352_v));
- p_70000_1_.func_152768_a("display_frequency", Integer.valueOf(Display.getDisplayMode().getFrequency()));
- p_70000_1_.func_152768_a("display_type", this.field_71431_Q?"fullscreen":"windowed");
- p_70000_1_.func_152768_a("run_time", Long.valueOf((MinecraftServer.func_130071_aq() - p_70000_1_.func_130105_g()) / 60L * 1000L));
- p_70000_1_.func_152768_a("current_action", this.func_181538_aA());
- p_70000_1_.func_152768_a("language", this.field_71474_y.field_74363_ab == null?"en_us":this.field_71474_y.field_74363_ab);
- String string = ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN?"little":"big";
- p_70000_1_.func_152768_a("endianness", string);
- p_70000_1_.func_152768_a("subtitles", Boolean.valueOf(this.field_71474_y.field_186717_N));
- p_70000_1_.func_152768_a("touch", this.field_71474_y.field_85185_A?"touch":"mouse");
- p_70000_1_.func_152768_a("resource_packs", Integer.valueOf(this.field_110448_aq.func_110613_c().size()));
- int int = 0;
- for(ResourcePackRepository.Entry resourcepackrepository$entry : this.field_110448_aq.func_110613_c()) {
- p_70000_1_.func_152768_a("resource_pack[" + int++ + "]", resourcepackrepository$entry.func_110515_d());
- }
- if(this.field_71437_Z != null && this.field_71437_Z.func_80003_ah() != null) {
- p_70000_1_.func_152768_a("snooper_partner", this.field_71437_Z.func_80003_ah().func_80006_f());
- }
- }
- private String func_181538_aA() {
- 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");
- }
- public void func_70001_b(Snooper p_70001_1_) {
- p_70001_1_.func_152767_b("opengl_version", GlStateManager.func_187416_u(7938));
- p_70001_1_.func_152767_b("opengl_vendor", GlStateManager.func_187416_u(7936));
- p_70001_1_.func_152767_b("client_brand", ClientBrandRetriever.getClientModName());
- p_70001_1_.func_152767_b("launched_version", this.field_110447_Z);
- ContextCapabilities contextcapabilities = GLContext.getCapabilities();
- p_70001_1_.func_152767_b("gl_caps[ARB_arrays_of_arrays]", Boolean.valueOf(contextcapabilities.GL_ARB_arrays_of_arrays));
- p_70001_1_.func_152767_b("gl_caps[ARB_base_instance]", Boolean.valueOf(contextcapabilities.GL_ARB_base_instance));
- p_70001_1_.func_152767_b("gl_caps[ARB_blend_func_extended]", Boolean.valueOf(contextcapabilities.GL_ARB_blend_func_extended));
- p_70001_1_.func_152767_b("gl_caps[ARB_clear_buffer_object]", Boolean.valueOf(contextcapabilities.GL_ARB_clear_buffer_object));
- p_70001_1_.func_152767_b("gl_caps[ARB_color_buffer_float]", Boolean.valueOf(contextcapabilities.GL_ARB_color_buffer_float));
- p_70001_1_.func_152767_b("gl_caps[ARB_compatibility]", Boolean.valueOf(contextcapabilities.GL_ARB_compatibility));
- p_70001_1_.func_152767_b("gl_caps[ARB_compressed_texture_pixel_storage]", Boolean.valueOf(contextcapabilities.GL_ARB_compressed_texture_pixel_storage));
- p_70001_1_.func_152767_b("gl_caps[ARB_compute_shader]", Boolean.valueOf(contextcapabilities.GL_ARB_compute_shader));
- p_70001_1_.func_152767_b("gl_caps[ARB_copy_buffer]", Boolean.valueOf(contextcapabilities.GL_ARB_copy_buffer));
- p_70001_1_.func_152767_b("gl_caps[ARB_copy_image]", Boolean.valueOf(contextcapabilities.GL_ARB_copy_image));
- p_70001_1_.func_152767_b("gl_caps[ARB_depth_buffer_float]", Boolean.valueOf(contextcapabilities.GL_ARB_depth_buffer_float));
- p_70001_1_.func_152767_b("gl_caps[ARB_compute_shader]", Boolean.valueOf(contextcapabilities.GL_ARB_compute_shader));
- p_70001_1_.func_152767_b("gl_caps[ARB_copy_buffer]", Boolean.valueOf(contextcapabilities.GL_ARB_copy_buffer));
- p_70001_1_.func_152767_b("gl_caps[ARB_copy_image]", Boolean.valueOf(contextcapabilities.GL_ARB_copy_image));
- p_70001_1_.func_152767_b("gl_caps[ARB_depth_buffer_float]", Boolean.valueOf(contextcapabilities.GL_ARB_depth_buffer_float));
- p_70001_1_.func_152767_b("gl_caps[ARB_depth_clamp]", Boolean.valueOf(contextcapabilities.GL_ARB_depth_clamp));
- p_70001_1_.func_152767_b("gl_caps[ARB_depth_texture]", Boolean.valueOf(contextcapabilities.GL_ARB_depth_texture));
- p_70001_1_.func_152767_b("gl_caps[ARB_draw_buffers]", Boolean.valueOf(contextcapabilities.GL_ARB_draw_buffers));
- p_70001_1_.func_152767_b("gl_caps[ARB_draw_buffers_blend]", Boolean.valueOf(contextcapabilities.GL_ARB_draw_buffers_blend));
- p_70001_1_.func_152767_b("gl_caps[ARB_draw_elements_base_vertex]", Boolean.valueOf(contextcapabilities.GL_ARB_draw_elements_base_vertex));
- p_70001_1_.func_152767_b("gl_caps[ARB_draw_indirect]", Boolean.valueOf(contextcapabilities.GL_ARB_draw_indirect));
- p_70001_1_.func_152767_b("gl_caps[ARB_draw_instanced]", Boolean.valueOf(contextcapabilities.GL_ARB_draw_instanced));
- p_70001_1_.func_152767_b("gl_caps[ARB_explicit_attrib_location]", Boolean.valueOf(contextcapabilities.GL_ARB_explicit_attrib_location));
- p_70001_1_.func_152767_b("gl_caps[ARB_explicit_uniform_location]", Boolean.valueOf(contextcapabilities.GL_ARB_explicit_uniform_location));
- p_70001_1_.func_152767_b("gl_caps[ARB_fragment_layer_viewport]", Boolean.valueOf(contextcapabilities.GL_ARB_fragment_layer_viewport));
- p_70001_1_.func_152767_b("gl_caps[ARB_fragment_program]", Boolean.valueOf(contextcapabilities.GL_ARB_fragment_program));
- p_70001_1_.func_152767_b("gl_caps[ARB_fragment_shader]", Boolean.valueOf(contextcapabilities.GL_ARB_fragment_shader));
- p_70001_1_.func_152767_b("gl_caps[ARB_fragment_program_shadow]", Boolean.valueOf(contextcapabilities.GL_ARB_fragment_program_shadow));
- p_70001_1_.func_152767_b("gl_caps[ARB_framebuffer_object]", Boolean.valueOf(contextcapabilities.GL_ARB_framebuffer_object));
- p_70001_1_.func_152767_b("gl_caps[ARB_framebuffer_sRGB]", Boolean.valueOf(contextcapabilities.GL_ARB_framebuffer_sRGB));
- p_70001_1_.func_152767_b("gl_caps[ARB_geometry_shader4]", Boolean.valueOf(contextcapabilities.GL_ARB_geometry_shader4));
- p_70001_1_.func_152767_b("gl_caps[ARB_gpu_shader5]", Boolean.valueOf(contextcapabilities.GL_ARB_gpu_shader5));
- p_70001_1_.func_152767_b("gl_caps[ARB_half_float_pixel]", Boolean.valueOf(contextcapabilities.GL_ARB_half_float_pixel));
- p_70001_1_.func_152767_b("gl_caps[ARB_half_float_vertex]", Boolean.valueOf(contextcapabilities.GL_ARB_half_float_vertex));
- p_70001_1_.func_152767_b("gl_caps[ARB_instanced_arrays]", Boolean.valueOf(contextcapabilities.GL_ARB_instanced_arrays));
- p_70001_1_.func_152767_b("gl_caps[ARB_map_buffer_alignment]", Boolean.valueOf(contextcapabilities.GL_ARB_map_buffer_alignment));
- p_70001_1_.func_152767_b("gl_caps[ARB_map_buffer_range]", Boolean.valueOf(contextcapabilities.GL_ARB_map_buffer_range));
- p_70001_1_.func_152767_b("gl_caps[ARB_multisample]", Boolean.valueOf(contextcapabilities.GL_ARB_multisample));
- p_70001_1_.func_152767_b("gl_caps[ARB_multitexture]", Boolean.valueOf(contextcapabilities.GL_ARB_multitexture));
- p_70001_1_.func_152767_b("gl_caps[ARB_occlusion_query2]", Boolean.valueOf(contextcapabilities.GL_ARB_occlusion_query2));
- p_70001_1_.func_152767_b("gl_caps[ARB_pixel_buffer_object]", Boolean.valueOf(contextcapabilities.GL_ARB_pixel_buffer_object));
- p_70001_1_.func_152767_b("gl_caps[ARB_seamless_cube_map]", Boolean.valueOf(contextcapabilities.GL_ARB_seamless_cube_map));
- p_70001_1_.func_152767_b("gl_caps[ARB_shader_objects]", Boolean.valueOf(contextcapabilities.GL_ARB_shader_objects));
- p_70001_1_.func_152767_b("gl_caps[ARB_shader_stencil_export]", Boolean.valueOf(contextcapabilities.GL_ARB_shader_stencil_export));
- p_70001_1_.func_152767_b("gl_caps[ARB_shader_texture_lod]", Boolean.valueOf(contextcapabilities.GL_ARB_shader_texture_lod));
- p_70001_1_.func_152767_b("gl_caps[ARB_shadow]", Boolean.valueOf(contextcapabilities.GL_ARB_shadow));
- p_70001_1_.func_152767_b("gl_caps[ARB_shadow_ambient]", Boolean.valueOf(contextcapabilities.GL_ARB_shadow_ambient));
- p_70001_1_.func_152767_b("gl_caps[ARB_stencil_texturing]", Boolean.valueOf(contextcapabilities.GL_ARB_stencil_texturing));
- p_70001_1_.func_152767_b("gl_caps[ARB_sync]", Boolean.valueOf(contextcapabilities.GL_ARB_sync));
- p_70001_1_.func_152767_b("gl_caps[ARB_tessellation_shader]", Boolean.valueOf(contextcapabilities.GL_ARB_tessellation_shader));
- p_70001_1_.func_152767_b("gl_caps[ARB_texture_border_clamp]", Boolean.valueOf(contextcapabilities.GL_ARB_texture_border_clamp));
- p_70001_1_.func_152767_b("gl_caps[ARB_texture_buffer_object]", Boolean.valueOf(contextcapabilities.GL_ARB_texture_buffer_object));
- p_70001_1_.func_152767_b("gl_caps[ARB_texture_cube_map]", Boolean.valueOf(contextcapabilities.GL_ARB_texture_cube_map));
- p_70001_1_.func_152767_b("gl_caps[ARB_texture_cube_map_array]", Boolean.valueOf(contextcapabilities.GL_ARB_texture_cube_map_array));
- p_70001_1_.func_152767_b("gl_caps[ARB_texture_non_power_of_two]", Boolean.valueOf(contextcapabilities.GL_ARB_texture_non_power_of_two));
- p_70001_1_.func_152767_b("gl_caps[ARB_uniform_buffer_object]", Boolean.valueOf(contextcapabilities.GL_ARB_uniform_buffer_object));
- p_70001_1_.func_152767_b("gl_caps[ARB_vertex_blend]", Boolean.valueOf(contextcapabilities.GL_ARB_vertex_blend));
- p_70001_1_.func_152767_b("gl_caps[ARB_vertex_buffer_object]", Boolean.valueOf(contextcapabilities.GL_ARB_vertex_buffer_object));
- p_70001_1_.func_152767_b("gl_caps[ARB_vertex_program]", Boolean.valueOf(contextcapabilities.GL_ARB_vertex_program));
- p_70001_1_.func_152767_b("gl_caps[ARB_vertex_shader]", Boolean.valueOf(contextcapabilities.GL_ARB_vertex_shader));
- p_70001_1_.func_152767_b("gl_caps[EXT_bindable_uniform]", Boolean.valueOf(contextcapabilities.GL_EXT_bindable_uniform));
- p_70001_1_.func_152767_b("gl_caps[EXT_blend_equation_separate]", Boolean.valueOf(contextcapabilities.GL_EXT_blend_equation_separate));
- p_70001_1_.func_152767_b("gl_caps[EXT_blend_func_separate]", Boolean.valueOf(contextcapabilities.GL_EXT_blend_func_separate));
- p_70001_1_.func_152767_b("gl_caps[EXT_blend_minmax]", Boolean.valueOf(contextcapabilities.GL_EXT_blend_minmax));
- p_70001_1_.func_152767_b("gl_caps[EXT_blend_subtract]", Boolean.valueOf(contextcapabilities.GL_EXT_blend_subtract));
- p_70001_1_.func_152767_b("gl_caps[EXT_draw_instanced]", Boolean.valueOf(contextcapabilities.GL_EXT_draw_instanced));
- p_70001_1_.func_152767_b("gl_caps[EXT_framebuffer_multisample]", Boolean.valueOf(contextcapabilities.GL_EXT_framebuffer_multisample));
- p_70001_1_.func_152767_b("gl_caps[EXT_framebuffer_object]", Boolean.valueOf(contextcapabilities.GL_EXT_framebuffer_object));
- p_70001_1_.func_152767_b("gl_caps[EXT_framebuffer_sRGB]", Boolean.valueOf(contextcapabilities.GL_EXT_framebuffer_sRGB));
- p_70001_1_.func_152767_b("gl_caps[EXT_geometry_shader4]", Boolean.valueOf(contextcapabilities.GL_EXT_geometry_shader4));
- p_70001_1_.func_152767_b("gl_caps[EXT_gpu_program_parameters]", Boolean.valueOf(contextcapabilities.GL_EXT_gpu_program_parameters));
- p_70001_1_.func_152767_b("gl_caps[EXT_gpu_shader4]", Boolean.valueOf(contextcapabilities.GL_EXT_gpu_shader4));
- p_70001_1_.func_152767_b("gl_caps[EXT_multi_draw_arrays]", Boolean.valueOf(contextcapabilities.GL_EXT_multi_draw_arrays));
- p_70001_1_.func_152767_b("gl_caps[EXT_packed_depth_stencil]", Boolean.valueOf(contextcapabilities.GL_EXT_packed_depth_stencil));
- p_70001_1_.func_152767_b("gl_caps[EXT_paletted_texture]", Boolean.valueOf(contextcapabilities.GL_EXT_paletted_texture));
- p_70001_1_.func_152767_b("gl_caps[EXT_rescale_normal]", Boolean.valueOf(contextcapabilities.GL_EXT_rescale_normal));
- p_70001_1_.func_152767_b("gl_caps[EXT_separate_shader_objects]", Boolean.valueOf(contextcapabilities.GL_EXT_separate_shader_objects));
- p_70001_1_.func_152767_b("gl_caps[EXT_shader_image_load_store]", Boolean.valueOf(contextcapabilities.GL_EXT_shader_image_load_store));
- p_70001_1_.func_152767_b("gl_caps[EXT_shadow_funcs]", Boolean.valueOf(contextcapabilities.GL_EXT_shadow_funcs));
- p_70001_1_.func_152767_b("gl_caps[EXT_shared_texture_palette]", Boolean.valueOf(contextcapabilities.GL_EXT_shared_texture_palette));
- p_70001_1_.func_152767_b("gl_caps[EXT_stencil_clear_tag]", Boolean.valueOf(contextcapabilities.GL_EXT_stencil_clear_tag));
- p_70001_1_.func_152767_b("gl_caps[EXT_stencil_two_side]", Boolean.valueOf(contextcapabilities.GL_EXT_stencil_two_side));
- p_70001_1_.func_152767_b("gl_caps[EXT_stencil_wrap]", Boolean.valueOf(contextcapabilities.GL_EXT_stencil_wrap));
- p_70001_1_.func_152767_b("gl_caps[EXT_texture_3d]", Boolean.valueOf(contextcapabilities.GL_EXT_texture_3d));
- p_70001_1_.func_152767_b("gl_caps[EXT_texture_array]", Boolean.valueOf(contextcapabilities.GL_EXT_texture_array));
- p_70001_1_.func_152767_b("gl_caps[EXT_texture_buffer_object]", Boolean.valueOf(contextcapabilities.GL_EXT_texture_buffer_object));
- p_70001_1_.func_152767_b("gl_caps[EXT_texture_integer]", Boolean.valueOf(contextcapabilities.GL_EXT_texture_integer));
- p_70001_1_.func_152767_b("gl_caps[EXT_texture_lod_bias]", Boolean.valueOf(contextcapabilities.GL_EXT_texture_lod_bias));
- p_70001_1_.func_152767_b("gl_caps[EXT_texture_sRGB]", Boolean.valueOf(contextcapabilities.GL_EXT_texture_sRGB));
- p_70001_1_.func_152767_b("gl_caps[EXT_vertex_shader]", Boolean.valueOf(contextcapabilities.GL_EXT_vertex_shader));
- p_70001_1_.func_152767_b("gl_caps[EXT_vertex_weighting]", Boolean.valueOf(contextcapabilities.GL_EXT_vertex_weighting));
- p_70001_1_.func_152767_b("gl_caps[gl_max_vertex_uniforms]", Integer.valueOf(GlStateManager.func_187397_v('\u8b4a')));
- GlStateManager.func_187434_L();
- p_70001_1_.func_152767_b("gl_caps[gl_max_fragment_uniforms]", Integer.valueOf(GlStateManager.func_187397_v('\u8b49')));
- GlStateManager.func_187434_L();
- p_70001_1_.func_152767_b("gl_caps[gl_max_vertex_attribs]", Integer.valueOf(GlStateManager.func_187397_v('\u8869')));
- GlStateManager.func_187434_L();
- p_70001_1_.func_152767_b("gl_caps[gl_max_vertex_texture_image_units]", Integer.valueOf(GlStateManager.func_187397_v('\u8b4c')));
- GlStateManager.func_187434_L();
- p_70001_1_.func_152767_b("gl_caps[gl_max_texture_image_units]", Integer.valueOf(GlStateManager.func_187397_v('\u8872')));
- GlStateManager.func_187434_L();
- p_70001_1_.func_152767_b("gl_caps[gl_max_array_texture_layers]", Integer.valueOf(GlStateManager.func_187397_v('\u88ff')));
- GlStateManager.func_187434_L();
- p_70001_1_.func_152767_b("gl_max_texture_size", Integer.valueOf(func_71369_N()));
- GameProfile gameprofile = this.field_71449_j.func_148256_e();
- if(gameprofile != null && gameprofile.getId() != null) {
- p_70001_1_.func_152767_b("uuid", Hashing.sha1().hashBytes(gameprofile.getId().toString().getBytes(Charsets.ISO_8859_1)).toString());
- }
- }
- public static int func_71369_N() {
- for(int int = 16384; int > 0; int >>= 1) {
- GlStateManager.func_187419_a('\u8064', 0, 6408, int, int, 0, 6408, 5121, (IntBuffer)null);
- int int = GlStateManager.func_187411_c('\u8064', 0, 4096);
- if(int != 0) {
- return int;
- }
- }
- return -1;
- }
- public boolean func_70002_Q() {
- return this.field_71474_y.field_74355_t;
- }
- public void func_71351_a(ServerData p_71351_1_) {
- this.field_71422_O = p_71351_1_;
- }
- @Nullable
- public ServerData func_147104_D() {
- return this.field_71422_O;
- }
- public boolean func_71387_A() {
- return this.field_71455_al;
- }
- public boolean func_71356_B() {
- return this.field_71455_al && this.field_71437_Z != null;
- }
- @Nullable
- public IntegratedServer func_71401_C() {
- return this.field_71437_Z;
- }
- public static void func_71363_D() {
- if(field_71432_P != null) {
- IntegratedServer integratedserver = field_71432_P.func_71401_C();
- if(integratedserver != null) {
- integratedserver.func_71260_j();
- }
- }
- }
- public Snooper func_71378_E() {
- return this.field_71427_U;
- }
- public static long func_71386_F() {
- return Sys.getTime() * 1000L / Sys.getTimerResolution();
- }
- public boolean func_71372_G() {
- return this.field_71431_Q;
- }
- public Session func_110432_I() {
- return this.field_71449_j;
- }
- public PropertyMap func_181037_M() {
- if(this.field_181038_N.isEmpty()) {
- GameProfile gameprofile = this.func_152347_ac().fillProfileProperties(this.field_71449_j.func_148256_e(), false);
- this.field_181038_N.putAll(gameprofile.getProperties());
- }
- return this.field_181038_N;
- }
- public Proxy func_110437_J() {
- return this.field_110453_aa;
- }
- public TextureManager func_110434_K() {
- return this.field_71446_o;
- }
- public IResourceManager func_110442_L() {
- return this.field_110451_am;
- }
- public ResourcePackRepository func_110438_M() {
- return this.field_110448_aq;
- }
- public LanguageManager func_135016_M() {
- return this.field_135017_as;
- }
- public TextureMap func_147117_R() {
- return this.field_147128_au;
- }
- public boolean func_147111_S() {
- return this.field_147129_ai;
- }
- public boolean func_147113_T() {
- return this.field_71445_n;
- }
- public SoundHandler func_147118_V() {
- return this.field_147127_av;
- }
- public MusicTicker.MusicType func_147109_W() {
- 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);
- }
- public void func_152348_aa() {
- int int = Keyboard.getEventKey() == 0?Keyboard.getEventCharacter() + 256:Keyboard.getEventKey();
- if(int != 0 && !Keyboard.isRepeatEvent()) {
- if(!(this.field_71462_r instanceof GuiControls) || ((GuiControls)this.field_71462_r).field_152177_g <= func_71386_F() - 20L) {
- if(Keyboard.getEventKeyState()) {
- if(int == this.field_71474_y.field_152395_am.func_151463_i()) {
- this.func_71352_k();
- } else if(int == this.field_71474_y.field_151447_Z.func_151463_i()) {
- 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));
- } 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())) {
- this.field_71474_y.func_74306_a(GameSettings.Options.NARRATOR, 1);
- if(this.field_71462_r instanceof ScreenChatOptions) {
- ((ScreenChatOptions)this.field_71462_r).func_193024_a();
- }
- }
- }
- }
- }
- }
- public MinecraftSessionService func_152347_ac() {
- return this.field_152355_az;
- }
- public SkinManager func_152342_ad() {
- return this.field_152350_aA;
- }
- @Nullable
- public Entity func_175606_aa() {
- return this.field_175622_Z;
- }
- public void func_175607_a(Entity p_175607_1_) {
- this.field_175622_Z = p_175607_1_;
- this.field_71460_t.func_175066_a(p_175607_1_);
- }
- public <V> ListenableFuture<V> func_152343_a(Callable<V> p_152343_1_) {
- Validate.notNull(p_152343_1_);
- if(this.func_152345_ab()) {
- try {
- return Futures.<V>immediateFuture(p_152343_1_.call());
- } catch (Exception exception) {
- return Futures.immediateFailedCheckedFuture(exception);
- }
- } else {
- ListenableFutureTask<V> listenablefuturetask = ListenableFutureTask.<V>create(p_152343_1_);
- synchronized(this.field_152351_aB) {
- this.field_152351_aB.add(listenablefuturetask);
- return listenablefuturetask;
- }
- }
- }
- public ListenableFuture<Object> func_152344_a(Runnable p_152344_1_) {
- Validate.notNull(p_152344_1_);
- return this.<Object>func_152343_a(Executors.callable(p_152344_1_));
- }
- public boolean func_152345_ab() {
- return Thread.currentThread() == this.field_152352_aC;
- }
- public BlockRendererDispatcher func_175602_ab() {
- return this.field_175618_aM;
- }
- public RenderManager func_175598_ae() {
- return this.field_175616_W;
- }
- public RenderItem func_175599_af() {
- return this.field_175621_X;
- }
- public ItemRenderer func_175597_ag() {
- return this.field_175620_Y;
- }
- public <T> ISearchTree<T> func_193987_a(SearchTreeManager.Key<T> p_193987_1_) {
- return this.field_193995_ae.<T>func_194010_a(p_193987_1_);
- }
- public static int func_175610_ah() {
- return field_71470_ab;
- }
- public FrameTimer func_181539_aj() {
- return this.field_181542_y;
- }
- public boolean func_181540_al() {
- return this.field_181541_X;
- }
- public void func_181537_a(boolean p_181537_1_) {
- this.field_181541_X = p_181537_1_;
- }
- public DataFixer func_184126_aj() {
- return this.field_184131_U;
- }
- public float func_184121_ak() {
- return this.field_71428_T.field_194147_b;
- }
- public float func_193989_ak() {
- return this.field_71428_T.field_194148_c;
- }
- public BlockColors func_184125_al() {
- return this.field_184127_aH;
- }
- public boolean func_189648_am() {
- return this.field_71439_g != null && this.field_71439_g.func_175140_cp() || this.field_71474_y.field_178879_v;
- }
- public GuiToast func_193033_an() {
- return this.field_193034_aS;
- }
- public Tutorial func_193032_ao() {
- return this.field_193035_aW;
- }
- }
- Patching failed: minecraft\net\minecraft\client\gui\GuiOverlayDebug.java
- Hunk 1 failed! Cannot find hunk target
- }
- + @SuppressWarnings("incomplete-switch")
- protected List<String> call() {
- 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);
- if (this.field_175242_a.func_189648_am()) {
- File state
- package net.minecraft.client.gui;
- import com.google.common.base.Strings;
- import com.google.common.collect.Lists;
- import com.google.common.collect.UnmodifiableIterator;
- import java.util.List;
- import java.util.Map.Entry;
- import net.minecraft.block.Block;
- import net.minecraft.block.properties.IProperty;
- import net.minecraft.block.state.IBlockState;
- import net.minecraft.client.ClientBrandRetriever;
- import net.minecraft.client.Minecraft;
- import net.minecraft.client.gui.FontRenderer;
- import net.minecraft.client.gui.Gui;
- import net.minecraft.client.gui.ScaledResolution;
- import net.minecraft.client.renderer.GlStateManager;
- import net.minecraft.client.renderer.OpenGlHelper;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.player.EntityPlayerMP;
- import net.minecraft.util.EnumFacing;
- import net.minecraft.util.FrameTimer;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.util.math.MathHelper;
- import net.minecraft.util.math.RayTraceResult;
- import net.minecraft.util.text.TextFormatting;
- import net.minecraft.world.DifficultyInstance;
- import net.minecraft.world.EnumSkyBlock;
- import net.minecraft.world.WorldType;
- import net.minecraft.world.chunk.Chunk;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- import org.lwjgl.opengl.Display;
- @SideOnly(Side.CLIENT)
- public class GuiOverlayDebug extends Gui {
- private final Minecraft field_175242_a;
- private final FontRenderer field_175241_f;
- public GuiOverlayDebug(Minecraft p_i45543_1_) {
- this.field_175242_a = p_i45543_1_;
- this.field_175241_f = p_i45543_1_.field_71466_p;
- }
- public void func_175237_a(ScaledResolution p_175237_1_) {
- this.field_175242_a.field_71424_I.func_76320_a("debug");
- GlStateManager.func_179094_E();
- this.func_180798_a();
- this.func_175239_b(p_175237_1_);
- GlStateManager.func_179121_F();
- if(this.field_175242_a.field_71474_y.field_181657_aC) {
- this.func_181554_e();
- }
- this.field_175242_a.field_71424_I.func_76319_b();
- }
- protected void func_180798_a() {
- List<String> list = this.call();
- list.add("");
- 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"));
- list.add("For help: press F3 + Q");
- for(int i = 0; i < list.size(); ++i) {
- String s = (String)list.get(i);
- if(!Strings.isNullOrEmpty(s)) {
- int j = this.field_175241_f.field_78288_b;
- int k = this.field_175241_f.func_78256_a(s);
- int l = 2;
- int i1 = 2 + j * i;
- func_73734_a(1, i1 - 1, 2 + k + 1, i1 + j - 1, -1873784752);
- this.field_175241_f.func_78276_b(s, 2, i1, 14737632);
- }
- }
- }
- protected void func_175239_b(ScaledResolution p_175239_1_) {
- List<String> list = this.func_175238_c();
- for(int i = 0; i < list.size(); ++i) {
- String s = (String)list.get(i);
- if(!Strings.isNullOrEmpty(s)) {
- int j = this.field_175241_f.field_78288_b;
- int k = this.field_175241_f.func_78256_a(s);
- int l = p_175239_1_.func_78326_a() - 2 - k;
- int i1 = 2 + j * i;
- func_73734_a(l - 1, i1 - 1, l + k + 1, i1 + j - 1, -1873784752);
- this.field_175241_f.func_78276_b(s, l, i1, 14737632);
- }
- }
- }
- protected List<String> call() {
- 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);
- if(this.field_175242_a.func_189648_am()) {
- 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)})});
- } else {
- Entity entity = this.field_175242_a.func_175606_aa();
- EnumFacing enumfacing = entity.func_174811_aO();
- String s = "Invalid";
- switch(enumfacing) {
- case NORTH:
- s = "Towards negative Z";
- break;
- case SOUTH:
- s = "Towards positive Z";
- break;
- case WEST:
- s = "Towards negative X";
- break;
- case EAST:
- s = "Towards positive X";
- }
- 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))})});
- if(this.field_175242_a.field_71441_e != null) {
- Chunk chunk = this.field_175242_a.field_71441_e.func_175726_f(blockpos);
- if(this.field_175242_a.field_71441_e.func_175667_e(blockpos) && blockpos.func_177956_o() >= 0 && blockpos.func_177956_o() < 256) {
- if(!chunk.func_76621_g()) {
- list.add("Biome: " + chunk.func_177411_a(blockpos, this.field_175242_a.field_71441_e.func_72959_q()).func_185359_l());
- 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)");
- DifficultyInstance difficultyinstance = this.field_175242_a.field_71441_e.func_175649_E(blockpos);
- if(this.field_175242_a.func_71387_A() && this.field_175242_a.func_71401_C() != null) {
- 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());
- if(entityplayermp != null) {
- difficultyinstance = entityplayermp.field_70170_p.func_175649_E(new BlockPos(entityplayermp));
- }
- }
- 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)}));
- } else {
- list.add("Waiting for chunk...");
- }
- } else {
- list.add("Outside of world...");
- }
- }
- if(this.field_175242_a.field_71460_t != null && this.field_175242_a.field_71460_t.func_147702_a()) {
- list.add("Shader: " + this.field_175242_a.field_71460_t.func_147706_e().func_148022_b());
- }
- 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) {
- BlockPos blockpos1 = this.field_175242_a.field_71476_x.func_178782_a();
- 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())}));
- }
- return list;
- }
- }
- protected <T extends Comparable<T>> List<String> func_175238_c() {
- long i = Runtime.getRuntime().maxMemory();
- long j = Runtime.getRuntime().totalMemory();
- long k = Runtime.getRuntime().freeMemory();
- long l = j - k;
- 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)});
- if(this.field_175242_a.func_189648_am()) {
- return list;
- } else {
- 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) {
- BlockPos blockpos = this.field_175242_a.field_71476_x.func_178782_a();
- IBlockState iblockstate = this.field_175242_a.field_71441_e.func_180495_p(blockpos);
- if(this.field_175242_a.field_71441_e.func_175624_G() != WorldType.field_180272_g) {
- iblockstate = iblockstate.func_185899_b(this.field_175242_a.field_71441_e, blockpos);
- }
- list.add("");
- list.add(String.valueOf(Block.field_149771_c.func_177774_c(iblockstate.func_177230_c())));
- IProperty<T> iproperty;
- String s;
- for(UnmodifiableIterator unmodifiableiterator = iblockstate.func_177228_b().entrySet().iterator(); unmodifiableiterator.hasNext(); list.add(iproperty.func_177701_a() + ": " + s)) {
- Entry<IProperty<?>, Comparable<?>> entry = (Entry)unmodifiableiterator.next();
- iproperty = (IProperty)entry.getKey();
- T t = (Comparable)entry.getValue();
- s = iproperty.func_177702_a(t);
- if(Boolean.TRUE.equals(t)) {
- s = TextFormatting.GREEN + s;
- } else if(Boolean.FALSE.equals(t)) {
- s = TextFormatting.RED + s;
- }
- }
- }
- return list;
- }
- }
- public void func_181554_e() {
- GlStateManager.func_179097_i();
- FrameTimer frametimer = this.field_175242_a.func_181539_aj();
- int i = frametimer.func_181749_a();
- int j = frametimer.func_181750_b();
- long[] along = frametimer.func_181746_c();
- ScaledResolution scaledresolution = new ScaledResolution(this.field_175242_a);
- int k = i;
- int l = 0;
- func_73734_a(0, scaledresolution.func_78328_b() - 60, 240, scaledresolution.func_78328_b(), -1873784752);
- while(k != j) {
- int i1 = frametimer.func_181748_a(along[k], 30);
- int j1 = this.func_181552_c(MathHelper.func_76125_a(i1, 0, 60), 0, 30, 60);
- this.func_73728_b(l, scaledresolution.func_78328_b(), scaledresolution.func_78328_b() - i1, j1);
- ++l;
- k = frametimer.func_181751_b(k + 1);
- }
- func_73734_a(1, scaledresolution.func_78328_b() - 30 + 1, 14, scaledresolution.func_78328_b() - 30 + 10, -1873784752);
- this.field_175241_f.func_78276_b("60", 2, scaledresolution.func_78328_b() - 30 + 2, 14737632);
- this.func_73730_a(0, 239, scaledresolution.func_78328_b() - 30, -1);
- func_73734_a(1, scaledresolution.func_78328_b() - 60 + 1, 14, scaledresolution.func_78328_b() - 60 + 10, -1873784752);
- this.field_175241_f.func_78276_b("30", 2, scaledresolution.func_78328_b() - 60 + 2, 14737632);
- this.func_73730_a(0, 239, scaledresolution.func_78328_b() - 60, -1);
- this.func_73730_a(0, 239, scaledresolution.func_78328_b() - 1, -1);
- this.func_73728_b(0, scaledresolution.func_78328_b() - 60, scaledresolution.func_78328_b(), -1);
- this.func_73728_b(239, scaledresolution.func_78328_b() - 60, scaledresolution.func_78328_b(), -1);
- if(this.field_175242_a.field_71474_y.field_74350_i <= 120) {
- this.func_73730_a(0, 239, scaledresolution.func_78328_b() - 60 + this.field_175242_a.field_71474_y.field_74350_i / 2, -16711681);
- }
- GlStateManager.func_179126_j();
- }
- private int func_181552_c(int p_181552_1_, int p_181552_2_, int p_181552_3_, int p_181552_4_) {
- 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_));
- }
- private int func_181553_a(int p_181553_1_, int p_181553_2_, float p_181553_3_) {
- int i = p_181553_1_ >> 24 & 255;
- int j = p_181553_1_ >> 16 & 255;
- int k = p_181553_1_ >> 8 & 255;
- int l = p_181553_1_ & 255;
- int i1 = p_181553_2_ >> 24 & 255;
- int j1 = p_181553_2_ >> 16 & 255;
- int k1 = p_181553_2_ >> 8 & 255;
- int l1 = p_181553_2_ & 255;
- int i2 = MathHelper.func_76125_a((int)((float)i + (float)(i1 - i) * p_181553_3_), 0, 255);
- int j2 = MathHelper.func_76125_a((int)((float)j + (float)(j1 - j) * p_181553_3_), 0, 255);
- int k2 = MathHelper.func_76125_a((int)((float)k + (float)(k1 - k) * p_181553_3_), 0, 255);
- int l2 = MathHelper.func_76125_a((int)((float)l + (float)(l1 - l) * p_181553_3_), 0, 255);
- return i2 << 24 | j2 << 16 | k2 << 8 | l2;
- }
- private static long func_175240_a(long p_175240_0_) {
- return p_175240_0_ / 1024L / 1024L;
- }
- }
- Hunk 2 failed! Cannot find hunk target
- for(UnmodifiableIterator unmodifiableiterator = iblockstate.func_177228_b().entrySet().iterator(); unmodifiableiterator.hasNext(); list.add(iproperty.func_177701_a() + ": " + s)) {
- Entry<IProperty<?>, Comparable<?>> entry = (Entry)unmodifiableiterator.next();
- iproperty = (IProperty)entry.getKey();
- - T t = entry.getValue();
- + T t = (T)entry.getValue();
- s = iproperty.func_177702_a(t);
- if (Boolean.TRUE.equals(t)) {
- s = TextFormatting.GREEN + s;
- File state
- package net.minecraft.client.gui;
- import com.google.common.base.Strings;
- import com.google.common.collect.Lists;
- import com.google.common.collect.UnmodifiableIterator;
- import java.util.List;
- import java.util.Map.Entry;
- import net.minecraft.block.Block;
- import net.minecraft.block.properties.IProperty;
- import net.minecraft.block.state.IBlockState;
- import net.minecraft.client.ClientBrandRetriever;
- import net.minecraft.client.Minecraft;
- import net.minecraft.client.gui.FontRenderer;
- import net.minecraft.client.gui.Gui;
- import net.minecraft.client.gui.ScaledResolution;
- import net.minecraft.client.renderer.GlStateManager;
- import net.minecraft.client.renderer.OpenGlHelper;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.player.EntityPlayerMP;
- import net.minecraft.util.EnumFacing;
- import net.minecraft.util.FrameTimer;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.util.math.MathHelper;
- import net.minecraft.util.math.RayTraceResult;
- import net.minecraft.util.text.TextFormatting;
- import net.minecraft.world.DifficultyInstance;
- import net.minecraft.world.EnumSkyBlock;
- import net.minecraft.world.WorldType;
- import net.minecraft.world.chunk.Chunk;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- import org.lwjgl.opengl.Display;
- @SideOnly(Side.CLIENT)
- public class GuiOverlayDebug extends Gui {
- private final Minecraft field_175242_a;
- private final FontRenderer field_175241_f;
- public GuiOverlayDebug(Minecraft p_i45543_1_) {
- this.field_175242_a = p_i45543_1_;
- this.field_175241_f = p_i45543_1_.field_71466_p;
- }
- public void func_175237_a(ScaledResolution p_175237_1_) {
- this.field_175242_a.field_71424_I.func_76320_a("debug");
- GlStateManager.func_179094_E();
- this.func_180798_a();
- this.func_175239_b(p_175237_1_);
- GlStateManager.func_179121_F();
- if(this.field_175242_a.field_71474_y.field_181657_aC) {
- this.func_181554_e();
- }
- this.field_175242_a.field_71424_I.func_76319_b();
- }
- protected void func_180798_a() {
- List<String> list = this.call();
- list.add("");
- 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"));
- list.add("For help: press F3 + Q");
- for(int i = 0; i < list.size(); ++i) {
- String s = (String)list.get(i);
- if(!Strings.isNullOrEmpty(s)) {
- int j = this.field_175241_f.field_78288_b;
- int k = this.field_175241_f.func_78256_a(s);
- int l = 2;
- int i1 = 2 + j * i;
- func_73734_a(1, i1 - 1, 2 + k + 1, i1 + j - 1, -1873784752);
- this.field_175241_f.func_78276_b(s, 2, i1, 14737632);
- }
- }
- }
- protected void func_175239_b(ScaledResolution p_175239_1_) {
- List<String> list = this.func_175238_c();
- for(int i = 0; i < list.size(); ++i) {
- String s = (String)list.get(i);
- if(!Strings.isNullOrEmpty(s)) {
- int j = this.field_175241_f.field_78288_b;
- int k = this.field_175241_f.func_78256_a(s);
- int l = p_175239_1_.func_78326_a() - 2 - k;
- int i1 = 2 + j * i;
- func_73734_a(l - 1, i1 - 1, l + k + 1, i1 + j - 1, -1873784752);
- this.field_175241_f.func_78276_b(s, l, i1, 14737632);
- }
- }
- }
- protected List<String> call() {
- 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);
- if(this.field_175242_a.func_189648_am()) {
- 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)})});
- } else {
- Entity entity = this.field_175242_a.func_175606_aa();
- EnumFacing enumfacing = entity.func_174811_aO();
- String s = "Invalid";
- switch(enumfacing) {
- case NORTH:
- s = "Towards negative Z";
- break;
- case SOUTH:
- s = "Towards positive Z";
- break;
- case WEST:
- s = "Towards negative X";
- break;
- case EAST:
- s = "Towards positive X";
- }
- 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))})});
- if(this.field_175242_a.field_71441_e != null) {
- Chunk chunk = this.field_175242_a.field_71441_e.func_175726_f(blockpos);
- if(this.field_175242_a.field_71441_e.func_175667_e(blockpos) && blockpos.func_177956_o() >= 0 && blockpos.func_177956_o() < 256) {
- if(!chunk.func_76621_g()) {
- list.add("Biome: " + chunk.func_177411_a(blockpos, this.field_175242_a.field_71441_e.func_72959_q()).func_185359_l());
- 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)");
- DifficultyInstance difficultyinstance = this.field_175242_a.field_71441_e.func_175649_E(blockpos);
- if(this.field_175242_a.func_71387_A() && this.field_175242_a.func_71401_C() != null) {
- 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());
- if(entityplayermp != null) {
- difficultyinstance = entityplayermp.field_70170_p.func_175649_E(new BlockPos(entityplayermp));
- }
- }
- 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)}));
- } else {
- list.add("Waiting for chunk...");
- }
- } else {
- list.add("Outside of world...");
- }
- }
- if(this.field_175242_a.field_71460_t != null && this.field_175242_a.field_71460_t.func_147702_a()) {
- list.add("Shader: " + this.field_175242_a.field_71460_t.func_147706_e().func_148022_b());
- }
- 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) {
- BlockPos blockpos1 = this.field_175242_a.field_71476_x.func_178782_a();
- 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())}));
- }
- return list;
- }
- }
- protected <T extends Comparable<T>> List<String> func_175238_c() {
- long i = Runtime.getRuntime().maxMemory();
- long j = Runtime.getRuntime().totalMemory();
- long k = Runtime.getRuntime().freeMemory();
- long l = j - k;
- 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)});
- if(this.field_175242_a.func_189648_am()) {
- return list;
- } else {
- 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) {
- BlockPos blockpos = this.field_175242_a.field_71476_x.func_178782_a();
- IBlockState iblockstate = this.field_175242_a.field_71441_e.func_180495_p(blockpos);
- if(this.field_175242_a.field_71441_e.func_175624_G() != WorldType.field_180272_g) {
- iblockstate = iblockstate.func_185899_b(this.field_175242_a.field_71441_e, blockpos);
- }
- list.add("");
- list.add(String.valueOf(Block.field_149771_c.func_177774_c(iblockstate.func_177230_c())));
- IProperty<T> iproperty;
- String s;
- for(UnmodifiableIterator unmodifiableiterator = iblockstate.func_177228_b().entrySet().iterator(); unmodifiableiterator.hasNext(); list.add(iproperty.func_177701_a() + ": " + s)) {
- Entry<IProperty<?>, Comparable<?>> entry = (Entry)unmodifiableiterator.next();
- iproperty = (IProperty)entry.getKey();
- T t = (Comparable)entry.getValue();
- s = iproperty.func_177702_a(t);
- if(Boolean.TRUE.equals(t)) {
- s = TextFormatting.GREEN + s;
- } else if(Boolean.FALSE.equals(t)) {
- s = TextFormatting.RED + s;
- }
- }
- }
- return list;
- }
- }
- public void func_181554_e() {
- GlStateManager.func_179097_i();
- FrameTimer frametimer = this.field_175242_a.func_181539_aj();
- int i = frametimer.func_181749_a();
- int j = frametimer.func_181750_b();
- long[] along = frametimer.func_181746_c();
- ScaledResolution scaledresolution = new ScaledResolution(this.field_175242_a);
- int k = i;
- int l = 0;
- func_73734_a(0, scaledresolution.func_78328_b() - 60, 240, scaledresolution.func_78328_b(), -1873784752);
- while(k != j) {
- int i1 = frametimer.func_181748_a(along[k], 30);
- int j1 = this.func_181552_c(MathHelper.func_76125_a(i1, 0, 60), 0, 30, 60);
- this.func_73728_b(l, scaledresolution.func_78328_b(), scaledresolution.func_78328_b() - i1, j1);
- ++l;
- k = frametimer.func_181751_b(k + 1);
- }
- func_73734_a(1, scaledresolution.func_78328_b() - 30 + 1, 14, scaledresolution.func_78328_b() - 30 + 10, -1873784752);
- this.field_175241_f.func_78276_b("60", 2, scaledresolution.func_78328_b() - 30 + 2, 14737632);
- this.func_73730_a(0, 239, scaledresolution.func_78328_b() - 30, -1);
- func_73734_a(1, scaledresolution.func_78328_b() - 60 + 1, 14, scaledresolution.func_78328_b() - 60 + 10, -1873784752);
- this.field_175241_f.func_78276_b("30", 2, scaledresolution.func_78328_b() - 60 + 2, 14737632);
- this.func_73730_a(0, 239, scaledresolution.func_78328_b() - 60, -1);
- this.func_73730_a(0, 239, scaledresolution.func_78328_b() - 1, -1);
- this.func_73728_b(0, scaledresolution.func_78328_b() - 60, scaledresolution.func_78328_b(), -1);
- this.func_73728_b(239, scaledresolution.func_78328_b() - 60, scaledresolution.func_78328_b(), -1);
- if(this.field_175242_a.field_71474_y.field_74350_i <= 120) {
- this.func_73730_a(0, 239, scaledresolution.func_78328_b() - 60 + this.field_175242_a.field_71474_y.field_74350_i / 2, -16711681);
- }
- GlStateManager.func_179126_j();
- }
- private int func_181552_c(int p_181552_1_, int p_181552_2_, int p_181552_3_, int p_181552_4_) {
- 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_));
- }
- private int func_181553_a(int p_181553_1_, int p_181553_2_, float p_181553_3_) {
- int i = p_181553_1_ >> 24 & 255;
- int j = p_181553_1_ >> 16 & 255;
- int k = p_181553_1_ >> 8 & 255;
- int l = p_181553_1_ & 255;
- int i1 = p_181553_2_ >> 24 & 255;
- int j1 = p_181553_2_ >> 16 & 255;
- int k1 = p_181553_2_ >> 8 & 255;
- int l1 = p_181553_2_ & 255;
- int i2 = MathHelper.func_76125_a((int)((float)i + (float)(i1 - i) * p_181553_3_), 0, 255);
- int j2 = MathHelper.func_76125_a((int)((float)j + (float)(j1 - j) * p_181553_3_), 0, 255);
- int k2 = MathHelper.func_76125_a((int)((float)k + (float)(k1 - k) * p_181553_3_), 0, 255);
- int l2 = MathHelper.func_76125_a((int)((float)l + (float)(l1 - l) * p_181553_3_), 0, 255);
- return i2 << 24 | j2 << 16 | k2 << 8 | l2;
- }
- private static long func_175240_a(long p_175240_0_) {
- return p_175240_0_ / 1024L / 1024L;
- }
- }
- Patching failed: minecraft\net\minecraft\client\gui\GuiSnooper.java
- Hunk 1 failed! Cannot find hunk target
- 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")));
- boolean flag = this.field_146297_k.func_71401_C() != null && this.field_146297_k.func_71401_C().func_80003_ah() != null;
- - for(Entry<String, String> entry : (new TreeMap(this.field_146297_k.func_71378_E().func_76465_c())).entrySet()) {
- + for(Entry<String, String> entry : (new TreeMap<String, String>(this.field_146297_k.func_71378_E().func_76465_c())).entrySet()) {
- this.field_146604_g.add((flag ? "C " : "") + (String)entry.getKey());
- this.field_146609_h.add(this.field_146289_q.func_78269_a(entry.getValue(), this.field_146294_l - 220));
- }
- if (flag) {
- - for(Entry<String, String> entry1 : (new TreeMap(this.field_146297_k.func_71401_C().func_80003_ah().func_76465_c())).entrySet()) {
- + for(Entry<String, String> entry1 : (new TreeMap<String, String>(this.field_146297_k.func_71401_C().func_80003_ah().func_76465_c())).entrySet()) {
- this.field_146604_g.add("S " + (String)entry1.getKey());
- this.field_146609_h.add(this.field_146289_q.func_78269_a(entry1.getValue(), this.field_146294_l - 220));
- }
- File state
- package net.minecraft.client.gui;
- import com.google.common.collect.Lists;
- import java.io.IOException;
- import java.util.TreeMap;
- import java.util.Map.Entry;
- import net.minecraft.client.gui.GuiButton;
- import net.minecraft.client.gui.GuiScreen;
- import net.minecraft.client.gui.GuiSlot;
- import net.minecraft.client.resources.I18n;
- import net.minecraft.client.settings.GameSettings;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- @SideOnly(Side.CLIENT)
- public class GuiSnooper extends GuiScreen {
- private final GuiScreen field_146608_a;
- private final GameSettings field_146603_f;
- private final java.util.List<String> field_146604_g = Lists.<String>newArrayList();
- private final java.util.List<String> field_146609_h = Lists.<String>newArrayList();
- private String field_146610_i;
- private String[] field_146607_r;
- private GuiSnooper.List field_146606_s;
- private GuiButton field_146605_t;
- public GuiSnooper(GuiScreen p_i1061_1_, GameSettings p_i1061_2_) {
- this.field_146608_a = p_i1061_1_;
- this.field_146603_f = p_i1061_2_;
- }
- public void func_73866_w_() {
- this.field_146610_i = I18n.func_135052_a("options.snooper.title", new Object[0]);
- String s = I18n.func_135052_a("options.snooper.desc", new Object[0]);
- java.util.List<String> list = Lists.<String>newArrayList();
- for(String s1 : this.field_146289_q.func_78271_c(s, this.field_146294_l - 30)) {
- list.add(s1);
- }
- this.field_146607_r = (String[])list.toArray(new String[list.size()]);
- this.field_146604_g.clear();
- this.field_146609_h.clear();
- 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)));
- 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])));
- boolean flag = this.field_146297_k.func_71401_C() != null && this.field_146297_k.func_71401_C().func_80003_ah() != null;
- for(Entry<String, String> entry : (new TreeMap(this.field_146297_k.func_71378_E().func_76465_c())).entrySet()) {
- this.field_146604_g.add((flag?"C ":"") + (String)entry.getKey());
- this.field_146609_h.add(this.field_146289_q.func_78269_a((String)entry.getValue(), this.field_146294_l - 220));
- }
- if(flag) {
- for(Entry<String, String> entry1 : (new TreeMap(this.field_146297_k.func_71401_C().func_80003_ah().func_76465_c())).entrySet()) {
- this.field_146604_g.add("S " + (String)entry1.getKey());
- this.field_146609_h.add(this.field_146289_q.func_78269_a((String)entry1.getValue(), this.field_146294_l - 220));
- }
- }
- this.field_146606_s = new GuiSnooper.List();
- }
- public void func_146274_d() throws IOException {
- super.func_146274_d();
- this.field_146606_s.func_178039_p();
- }
- protected void func_146284_a(GuiButton p_146284_1_) throws IOException {
- if(p_146284_1_.field_146124_l) {
- if(p_146284_1_.field_146127_k == 2) {
- this.field_146603_f.func_74303_b();
- this.field_146603_f.func_74303_b();
- this.field_146297_k.func_147108_a(this.field_146608_a);
- }
- if(p_146284_1_.field_146127_k == 1) {
- this.field_146603_f.func_74306_a(GameSettings.Options.SNOOPER_ENABLED, 1);
- this.field_146605_t.field_146126_j = this.field_146603_f.func_74297_c(GameSettings.Options.SNOOPER_ENABLED);
- }
- }
- }
- public void func_73863_a(int p_73863_1_, int p_73863_2_, float p_73863_3_) {
- this.func_146276_q_();
- this.field_146606_s.func_148128_a(p_73863_1_, p_73863_2_, p_73863_3_);
- this.func_73732_a(this.field_146289_q, this.field_146610_i, this.field_146294_l / 2, 8, 16777215);
- int i = 22;
- for(String s : this.field_146607_r) {
- this.func_73732_a(this.field_146289_q, s, this.field_146294_l / 2, i, 8421504);
- i += this.field_146289_q.field_78288_b;
- }
- super.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_);
- }
- @SideOnly(Side.CLIENT)
- class List extends GuiSlot {
- public List() {
- 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);
- }
- protected int func_148127_b() {
- return GuiSnooper.this.field_146604_g.size();
- }
- protected void func_148144_a(int p_148144_1_, boolean p_148144_2_, int p_148144_3_, int p_148144_4_) {
- }
- protected boolean func_148131_a(int p_148131_1_) {
- return false;
- }
- protected void func_148123_a() {
- }
- 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_) {
- GuiSnooper.this.field_146289_q.func_78276_b((String)GuiSnooper.this.field_146604_g.get(p_192637_1_), 10, p_192637_3_, 16777215);
- GuiSnooper.this.field_146289_q.func_78276_b((String)GuiSnooper.this.field_146609_h.get(p_192637_1_), 230, p_192637_3_, 16777215);
- }
- protected int func_148137_d() {
- return this.field_148155_a - 10;
- }
- }
- }
- Patching failed: minecraft\net\minecraft\client\gui\recipebook\GuiRecipeBook.java
- Hunk 1 failed! Cannot find hunk target
- if (!s.isEmpty()) {
- ObjectSet<RecipeList> objectset = new ObjectLinkedOpenHashSet<RecipeList>(this.field_191888_F.func_193987_a(SearchTreeManager.field_194012_b).func_194038_a(s.toLowerCase(Locale.ROOT)));
- list1.removeIf((p_193947_1_) -> {
- - return !p_193947_0_.contains(p_193947_1_);
- + return !objectset.contains(p_193947_1_);
- });
- }
- File state
- package net.minecraft.client.gui.recipebook;
- import com.google.common.collect.Lists;
- import it.unimi.dsi.fastutil.ints.IntArrayList;
- import it.unimi.dsi.fastutil.ints.IntList;
- import it.unimi.dsi.fastutil.ints.IntListIterator;
- import it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet;
- import it.unimi.dsi.fastutil.objects.ObjectSet;
- import java.util.Iterator;
- import java.util.List;
- import java.util.Locale;
- import java.util.function.Consumer;
- import java.util.function.Predicate;
- import javax.annotation.Nullable;
- import net.minecraft.client.Minecraft;
- import net.minecraft.client.gui.Gui;
- import net.minecraft.client.gui.GuiButtonToggle;
- import net.minecraft.client.gui.GuiScreen;
- import net.minecraft.client.gui.GuiTextField;
- import net.minecraft.client.gui.recipebook.GhostRecipe;
- import net.minecraft.client.gui.recipebook.GuiButtonRecipeTab;
- import net.minecraft.client.gui.recipebook.IRecipeUpdateListener;
- import net.minecraft.client.gui.recipebook.RecipeBookPage;
- import net.minecraft.client.gui.recipebook.RecipeList;
- import net.minecraft.client.renderer.GlStateManager;
- import net.minecraft.client.renderer.RenderHelper;
- import net.minecraft.client.resources.I18n;
- import net.minecraft.client.resources.Language;
- import net.minecraft.client.resources.LanguageManager;
- import net.minecraft.client.settings.GameSettings;
- import net.minecraft.client.util.RecipeBookClient;
- import net.minecraft.client.util.RecipeItemHelper;
- import net.minecraft.client.util.SearchTreeManager;
- import net.minecraft.creativetab.CreativeTabs;
- import net.minecraft.entity.player.InventoryPlayer;
- import net.minecraft.inventory.Container;
- import net.minecraft.inventory.ContainerPlayer;
- import net.minecraft.inventory.ContainerWorkbench;
- import net.minecraft.inventory.InventoryCraftResult;
- import net.minecraft.inventory.InventoryCrafting;
- import net.minecraft.inventory.Slot;
- import net.minecraft.item.ItemStack;
- import net.minecraft.item.crafting.IRecipe;
- import net.minecraft.item.crafting.Ingredient;
- import net.minecraft.item.crafting.ShapedRecipes;
- import net.minecraft.network.play.client.CPacketRecipeInfo;
- import net.minecraft.network.play.client.CPacketRecipePlacement;
- import net.minecraft.stats.RecipeBook;
- import net.minecraft.util.ResourceLocation;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- import org.apache.logging.log4j.LogManager;
- import org.apache.logging.log4j.Logger;
- import org.lwjgl.input.Keyboard;
- @SideOnly(Side.CLIENT)
- public class GuiRecipeBook extends Gui implements IRecipeUpdateListener {
- protected static final ResourceLocation field_191894_a = new ResourceLocation("textures/gui/recipe_book.png");
- private int field_191903_n;
- private int field_191904_o;
- private int field_191905_p;
- private static final Logger field_193959_i = LogManager.getLogger();
- private final GhostRecipe field_191915_z = new GhostRecipe();
- 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)});
- private GuiButtonRecipeTab field_191913_x;
- private GuiButtonToggle field_193960_m;
- private Container field_191908_s;
- private InventoryCrafting field_193961_o;
- private Minecraft field_191888_F;
- private GuiTextField field_193962_q;
- private String field_193963_r = "";
- private RecipeBook field_193964_s;
- private final RecipeBookPage field_193022_s = new RecipeBookPage();
- private RecipeItemHelper field_193965_u = new RecipeItemHelper();
- private int field_193966_v;
- 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_) {
- this.field_191888_F = p_191856_3_;
- this.field_191904_o = p_191856_1_;
- this.field_191905_p = p_191856_2_;
- this.field_191908_s = p_191856_5_;
- this.field_193961_o = p_191856_6_;
- this.field_193964_s = p_191856_3_.field_71439_g.func_192035_E();
- this.field_193966_v = p_191856_3_.field_71439_g.field_71071_by.func_194015_p();
- this.field_191913_x = (GuiButtonRecipeTab)this.field_193018_j.get(0);
- this.field_191913_x.func_191753_b(true);
- if(this.func_191878_b()) {
- this.func_193014_a(p_191856_4_, p_191856_6_);
- }
- Keyboard.enableRepeatEvents(true);
- }
- public void func_193014_a(boolean p_193014_1_, InventoryCrafting p_193014_2_) {
- this.field_191903_n = p_193014_1_?0:86;
- int i = (this.field_191904_o - 147) / 2 - this.field_191903_n;
- int j = (this.field_191905_p - 166) / 2;
- this.field_193965_u.func_194119_a();
- this.field_191888_F.field_71439_g.field_71071_by.func_194016_a(this.field_193965_u, false);
- p_193014_2_.func_194018_a(this.field_193965_u);
- 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);
- this.field_193962_q.func_146203_f(50);
- this.field_193962_q.func_146185_a(false);
- this.field_193962_q.func_146189_e(true);
- this.field_193962_q.func_146193_g(16777215);
- this.field_193022_s.func_194194_a(this.field_191888_F, i, j);
- this.field_193022_s.func_193732_a(this);
- this.field_193960_m = new GuiButtonToggle(0, i + 110, j + 12, 26, 16, this.field_193964_s.func_192815_c());
- this.field_193960_m.func_191751_a(152, 41, 28, 18, field_191894_a);
- this.func_193003_g(false);
- this.func_193949_f();
- }
- public void func_191871_c() {
- Keyboard.enableRepeatEvents(false);
- }
- public int func_193011_a(boolean p_193011_1_, int p_193011_2_, int p_193011_3_) {
- int i;
- if(this.func_191878_b() && !p_193011_1_) {
- i = 177 + (p_193011_2_ - p_193011_3_ - 200) / 2;
- } else {
- i = (p_193011_2_ - p_193011_3_) / 2;
- }
- return i;
- }
- public void func_191866_a() {
- this.func_193006_a(!this.func_191878_b());
- }
- public boolean func_191878_b() {
- return this.field_193964_s.func_192812_b();
- }
- private void func_193006_a(boolean p_193006_1_) {
- this.field_193964_s.func_192813_a(p_193006_1_);
- if(!p_193006_1_) {
- this.field_193022_s.func_194200_c();
- }
- this.func_193956_j();
- }
- public void func_191874_a(@Nullable Slot p_191874_1_) {
- if(p_191874_1_ != null && p_191874_1_.field_75222_d <= 9) {
- this.field_191915_z.func_192682_a();
- if(this.func_191878_b()) {
- this.func_193942_g();
- }
- }
- }
- private void func_193003_g(boolean p_193003_1_) {
- List<RecipeList> list = (List)RecipeBookClient.field_194086_e.get(this.field_191913_x.func_191764_e());
- list.forEach((p_193944_1_) -> {
- 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);
- });
- List<RecipeList> list1 = Lists.newArrayList(list);
- list1.removeIf((p_193952_0_) -> {
- return !p_193952_0_.func_194209_a();
- });
- list1.removeIf((p_193953_0_) -> {
- return !p_193953_0_.func_194212_c();
- });
- String s = this.field_193962_q.func_146179_b();
- if(!s.isEmpty()) {
- ObjectSet<RecipeList> objectset = new ObjectLinkedOpenHashSet(this.field_191888_F.func_193987_a(SearchTreeManager.field_194012_b).func_194038_a(s.toLowerCase(Locale.ROOT)));
- list1.removeIf((p_193947_1_) -> {
- return !lvt_5_1_.contains(p_193947_1_);
- });
- }
- if(this.field_193964_s.func_192815_c()) {
- list1.removeIf((p_193958_0_) -> {
- return !p_193958_0_.func_192708_c();
- });
- }
- this.field_193022_s.func_194192_a(list1, p_193003_1_);
- }
- private void func_193949_f() {
- int int = (this.field_191904_o - 147) / 2 - this.field_191903_n - 30;
- int int = (this.field_191905_p - 166) / 2 + 3;
- int int = 27;
- int int = 0;
- for(GuiButtonRecipeTab guibuttonrecipetab : this.field_193018_j) {
- CreativeTabs creativetabs = guibuttonrecipetab.func_191764_e();
- if(creativetabs == CreativeTabs.field_78027_g) {
- guibuttonrecipetab.field_146125_m = true;
- guibuttonrecipetab.func_191752_c(int, int + 27 * int++);
- } else if(guibuttonrecipetab.func_193919_e()) {
- guibuttonrecipetab.func_191752_c(int, int + 27 * int++);
- guibuttonrecipetab.func_193918_a(this.field_191888_F);
- }
- }
- }
- public void func_193957_d() {
- if(this.func_191878_b()) {
- if(this.field_193966_v != this.field_191888_F.field_71439_g.field_71071_by.func_194015_p()) {
- this.func_193942_g();
- this.field_193966_v = this.field_191888_F.field_71439_g.field_71071_by.func_194015_p();
- }
- }
- }
- private void func_193942_g() {
- this.field_193965_u.func_194119_a();
- this.field_191888_F.field_71439_g.field_71071_by.func_194016_a(this.field_193965_u, false);
- this.field_193961_o.func_194018_a(this.field_193965_u);
- this.func_193003_g(false);
- }
- public void func_191861_a(int p_191861_1_, int p_191861_2_, float p_191861_3_) {
- if(this.func_191878_b()) {
- RenderHelper.func_74520_c();
- GlStateManager.func_179140_f();
- GlStateManager.func_179094_E();
- GlStateManager.func_179109_b(0.0F, 0.0F, 100.0F);
- this.field_191888_F.func_110434_K().func_110577_a(field_191894_a);
- GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
- int int = (this.field_191904_o - 147) / 2 - this.field_191903_n;
- int int = (this.field_191905_p - 166) / 2;
- this.func_73729_b(int, int, 1, 1, 147, 166);
- this.field_193962_q.func_146194_f();
- RenderHelper.func_74518_a();
- for(GuiButtonRecipeTab guibuttonrecipetab : this.field_193018_j) {
- guibuttonrecipetab.func_191745_a(this.field_191888_F, p_191861_1_, p_191861_2_, p_191861_3_);
- }
- this.field_193960_m.func_191745_a(this.field_191888_F, p_191861_1_, p_191861_2_, p_191861_3_);
- this.field_193022_s.func_194191_a(int, int, p_191861_1_, p_191861_2_, p_191861_3_);
- GlStateManager.func_179121_F();
- }
- }
- public void func_191876_c(int p_191876_1_, int p_191876_2_, int p_191876_3_, int p_191876_4_) {
- if(this.func_191878_b()) {
- this.field_193022_s.func_193721_a(p_191876_3_, p_191876_4_);
- if(this.field_193960_m.func_146115_a()) {
- String string = I18n.func_135052_a(this.field_193960_m.func_191754_c()?"gui.recipebook.toggleRecipes.craftable":"gui.recipebook.toggleRecipes.all", new Object[0]);
- if(this.field_191888_F.field_71462_r != null) {
- this.field_191888_F.field_71462_r.func_146279_a(string, p_191876_3_, p_191876_4_);
- }
- }
- this.func_193015_d(p_191876_1_, p_191876_2_, p_191876_3_, p_191876_4_);
- }
- }
- private void func_193015_d(int p_193015_1_, int p_193015_2_, int p_193015_3_, int p_193015_4_) {
- ItemStack itemstack = null;
- for(int int = 0; int < this.field_191915_z.func_192684_b(); ++int) {
- GhostRecipe.GhostIngredient ghostrecipe$ghostingredient = this.field_191915_z.func_192681_a(int);
- int int = ghostrecipe$ghostingredient.func_193713_b() + p_193015_1_;
- int int = ghostrecipe$ghostingredient.func_193712_c() + p_193015_2_;
- if(p_193015_3_ >= int && p_193015_4_ >= int && p_193015_3_ < int + 16 && p_193015_4_ < int + 16) {
- itemstack = ghostrecipe$ghostingredient.func_194184_c();
- }
- }
- if(itemstack != null && this.field_191888_F.field_71462_r != null) {
- 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_);
- }
- }
- public void func_191864_a(int p_191864_1_, int p_191864_2_, boolean p_191864_3_, float p_191864_4_) {
- this.field_191915_z.func_194188_a(this.field_191888_F, p_191864_1_, p_191864_2_, p_191864_3_, p_191864_4_);
- }
- public boolean func_191862_a(int p_191862_1_, int p_191862_2_, int p_191862_3_) {
- if(this.func_191878_b() && !this.field_191888_F.field_71439_g.func_175149_v()) {
- 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)) {
- IRecipe irecipe = this.field_193022_s.func_194193_a();
- RecipeList recipelist = this.field_193022_s.func_194199_b();
- if(irecipe != null && recipelist != null) {
- this.func_193945_a(irecipe, recipelist);
- if(!this.func_191880_f() && p_191862_3_ == 0) {
- this.func_193006_a(false);
- }
- }
- return true;
- } else if(p_191862_3_ != 0) {
- return false;
- } else if(this.field_193962_q.func_146192_a(p_191862_1_, p_191862_2_, p_191862_3_)) {
- return true;
- } else if(this.field_193960_m.func_146116_c(this.field_191888_F, p_191862_1_, p_191862_2_)) {
- boolean boolean = !this.field_193964_s.func_192815_c();
- this.field_193964_s.func_192810_b(boolean);
- this.field_193960_m.func_191753_b(boolean);
- this.field_193960_m.func_146113_a(this.field_191888_F.func_147118_V());
- this.func_193956_j();
- this.func_193003_g(false);
- return true;
- } else {
- for(GuiButtonRecipeTab guibuttonrecipetab : this.field_193018_j) {
- if(guibuttonrecipetab.func_146116_c(this.field_191888_F, p_191862_1_, p_191862_2_)) {
- if(this.field_191913_x != guibuttonrecipetab) {
- guibuttonrecipetab.func_146113_a(this.field_191888_F.func_147118_V());
- this.field_191913_x.func_191753_b(false);
- this.field_191913_x = guibuttonrecipetab;
- this.field_191913_x.func_191753_b(true);
- this.func_193003_g(true);
- }
- return true;
- }
- }
- return false;
- }
- } else {
- return false;
- }
- }
- 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_) {
- if(!this.func_191878_b()) {
- return true;
- } else {
- 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_;
- 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_;
- return boolean && !boolean && !this.field_191913_x.func_146116_c(this.field_191888_F, p_193955_1_, p_193955_2_);
- }
- }
- public boolean func_191859_a(char p_191859_1_, int p_191859_2_) {
- if(this.func_191878_b() && !this.field_191888_F.field_71439_g.func_175149_v()) {
- if(p_191859_2_ == 1 && !this.func_191880_f()) {
- this.func_193006_a(false);
- return true;
- } else {
- if(GameSettings.func_100015_a(this.field_191888_F.field_71474_y.field_74310_D) && !this.field_193962_q.func_146206_l()) {
- this.field_193962_q.func_146195_b(true);
- } else if(this.field_193962_q.func_146201_a(p_191859_1_, p_191859_2_)) {
- String string = this.field_193962_q.func_146179_b().toLowerCase(Locale.ROOT);
- this.func_193716_a(string);
- if(!string.equals(this.field_193963_r)) {
- this.func_193003_g(false);
- this.field_193963_r = string;
- }
- return true;
- }
- return false;
- }
- } else {
- return false;
- }
- }
- private void func_193716_a(String p_193716_1_) {
- if("excitedze".equals(p_193716_1_)) {
- LanguageManager languagemanager = this.field_191888_F.func_135016_M();
- Language language = languagemanager.func_191960_a("en_pt");
- if(languagemanager.func_135041_c().compareTo(language) == 0) {
- return;
- }
- languagemanager.func_135045_a(language);
- this.field_191888_F.field_71474_y.field_74363_ab = language.func_135034_a();
- this.field_191888_F.func_110436_a();
- 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);
- this.field_191888_F.field_71466_p.func_78275_b(languagemanager.func_135044_b());
- this.field_191888_F.field_71474_y.func_74303_b();
- }
- }
- private boolean func_191880_f() {
- return this.field_191903_n == 86;
- }
- public void func_193948_e() {
- this.func_193949_f();
- if(this.func_191878_b()) {
- this.func_193003_g(false);
- }
- }
- public void func_193001_a(List<IRecipe> p_193001_1_) {
- for(IRecipe irecipe : p_193001_1_) {
- this.field_191888_F.field_71439_g.func_193103_a(irecipe);
- }
- }
- private void func_193945_a(IRecipe p_193945_1_, RecipeList p_193945_2_) {
- boolean boolean = p_193945_2_.func_194213_a(p_193945_1_);
- InventoryCraftResult inventorycraftresult = null;
- if(this.field_191908_s instanceof ContainerWorkbench) {
- inventorycraftresult = ((ContainerWorkbench)this.field_191908_s).field_75160_f;
- } else if(this.field_191908_s instanceof ContainerPlayer) {
- inventorycraftresult = ((ContainerPlayer)this.field_191908_s).field_75179_f;
- }
- if(inventorycraftresult != null) {
- if(!boolean && this.field_191915_z.func_192686_c() == p_193945_1_) {
- return;
- }
- if(!this.func_193941_i() && !this.field_191888_F.field_71439_g.func_184812_l_()) {
- return;
- }
- if(boolean) {
- this.func_193950_a(p_193945_1_, this.field_191908_s.field_75151_b, this.field_191908_s.field_75152_c, inventorycraftresult);
- } else {
- List<CPacketRecipePlacement.ItemMove> list = this.func_193954_a(inventorycraftresult);
- this.func_193951_a(p_193945_1_, this.field_191908_s.field_75151_b);
- if(!list.isEmpty()) {
- 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);
- if(this.field_193964_s.func_192815_c()) {
- this.field_191888_F.field_71439_g.field_71071_by.func_70296_d();
- }
- }
- }
- if(!this.func_191880_f()) {
- this.func_191866_a();
- }
- }
- }
- private void func_193950_a(IRecipe p_193950_1_, List<Slot> p_193950_2_, int p_193950_3_, InventoryCraftResult p_193950_4_) {
- boolean boolean = p_193950_1_.func_77569_a(this.field_193961_o, this.field_191888_F.field_71441_e);
- int int = this.field_193965_u.func_194114_b(p_193950_1_, (IntList)null);
- if(boolean) {
- boolean boolean = true;
- for(int int = 0; int < this.field_193961_o.func_70302_i_(); ++int) {
- ItemStack itemstack = this.field_193961_o.func_70301_a(int);
- if(!itemstack.func_190926_b() && int > itemstack.func_190916_E()) {
- boolean = false;
- }
- }
- if(boolean) {
- return;
- }
- }
- int int = this.func_193943_a(int, boolean);
- IntList intlist = new IntArrayList();
- if(this.field_193965_u.func_194118_a(p_193950_1_, intlist, int)) {
- int int = int;
- IntListIterator lvt_10_1_ = intlist.iterator();
- while(lvt_10_1_.hasNext()) {
- int int = ((Integer)lvt_10_1_.next()).intValue();
- int int = RecipeItemHelper.func_194115_b(int).func_77976_d();
- if(int < int) {
- int = int;
- }
- }
- if(this.field_193965_u.func_194118_a(p_193950_1_, intlist, int)) {
- List<CPacketRecipePlacement.ItemMove> list = this.func_193954_a(p_193950_4_);
- lvt_10_1_ = Lists.<CPacketRecipePlacement.ItemMove>newArrayList();
- this.func_193013_a(p_193950_1_, p_193950_2_, int, intlist, lvt_10_1_);
- this.field_191888_F.field_71442_b.func_192831_a(p_193950_3_, list, lvt_10_1_, this.field_191888_F.field_71439_g);
- this.field_191888_F.field_71439_g.field_71071_by.func_70296_d();
- }
- }
- }
- private List<CPacketRecipePlacement.ItemMove> func_193954_a(InventoryCraftResult p_193954_1_) {
- this.field_191915_z.func_192682_a();
- InventoryPlayer inventoryplayer = this.field_191888_F.field_71439_g.field_71071_by;
- List<CPacketRecipePlacement.ItemMove> list = Lists.<CPacketRecipePlacement.ItemMove>newArrayList();
- for(int int = 0; int < this.field_193961_o.func_70302_i_(); ++int) {
- ItemStack itemstack = this.field_193961_o.func_70301_a(int);
- if(!itemstack.func_190926_b()) {
- while(itemstack.func_190916_E() > 0) {
- int int = inventoryplayer.func_70432_d(itemstack);
- if(int == -1) {
- int = inventoryplayer.func_70447_i();
- }
- ItemStack itemstack1 = itemstack.func_77946_l();
- itemstack1.func_190920_e(1);
- if(inventoryplayer.func_191971_c(int, itemstack1)) {
- itemstack1.func_190917_f(1);
- } else {
- field_193959_i.error("Can\'t find any space for item in inventory");
- }
- this.field_193961_o.func_70298_a(int, 1);
- int int = int + 1;
- list.add(new CPacketRecipePlacement.ItemMove(itemstack1.func_77946_l(), int, int));
- }
- }
- }
- this.field_193961_o.func_174888_l();
- p_193954_1_.func_174888_l();
- return list;
- }
- private int func_193943_a(int p_193943_1_, boolean p_193943_2_) {
- int int = 1;
- if(GuiScreen.func_146272_n()) {
- int = p_193943_1_;
- } else if(p_193943_2_) {
- int = 64;
- for(int int = 0; int < this.field_193961_o.func_70302_i_(); ++int) {
- ItemStack itemstack = this.field_193961_o.func_70301_a(int);
- if(!itemstack.func_190926_b() && int > itemstack.func_190916_E()) {
- int = itemstack.func_190916_E();
- }
- }
- if(int < 64) {
- ++int;
- }
- }
- return int;
- }
- 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_) {
- int int = this.field_193961_o.func_174922_i();
- int int = this.field_193961_o.func_174923_h();
- if(p_193013_1_ instanceof ShapedRecipes) {
- ShapedRecipes shapedrecipes = (ShapedRecipes)p_193013_1_;
- int = shapedrecipes.func_192403_f();
- int = shapedrecipes.func_192404_g();
- }
- int int = 1;
- Iterator<Integer> iterator = p_193013_4_.iterator();
- for(int int = 0; int < this.field_193961_o.func_174922_i() && int != int; ++int) {
- for(int int = 0; int < this.field_193961_o.func_174923_h(); ++int) {
- if(int == int || !iterator.hasNext()) {
- int += this.field_193961_o.func_174922_i() - int;
- break;
- }
- Slot slot = (Slot)p_193013_2_.get(int);
- ItemStack itemstack = RecipeItemHelper.func_194115_b(((Integer)iterator.next()).intValue());
- if(itemstack.func_190926_b()) {
- ++int;
- } else {
- for(int int = 0; int < p_193013_3_; ++int) {
- CPacketRecipePlacement.ItemMove cpacketrecipeplacement$itemmove = this.func_193946_a(int, slot, itemstack);
- if(cpacketrecipeplacement$itemmove != null) {
- p_193013_5_.add(cpacketrecipeplacement$itemmove);
- }
- }
- ++int;
- }
- }
- if(!iterator.hasNext()) {
- break;
- }
- }
- }
- @Nullable
- private CPacketRecipePlacement.ItemMove func_193946_a(int p_193946_1_, Slot p_193946_2_, ItemStack p_193946_3_) {
- InventoryPlayer inventoryplayer = this.field_191888_F.field_71439_g.field_71071_by;
- int int = inventoryplayer.func_194014_c(p_193946_3_);
- if(int == -1) {
- return null;
- } else {
- ItemStack itemstack = inventoryplayer.func_70301_a(int).func_77946_l();
- if(itemstack.func_190926_b()) {
- field_193959_i.error("Matched: " + p_193946_3_.func_77977_a() + " with empty item.");
- return null;
- } else {
- if(itemstack.func_190916_E() > 1) {
- inventoryplayer.func_70298_a(int, 1);
- } else {
- inventoryplayer.func_70304_b(int);
- }
- itemstack.func_190920_e(1);
- if(p_193946_2_.func_75211_c().func_190926_b()) {
- p_193946_2_.func_75215_d(itemstack);
- } else {
- p_193946_2_.func_75211_c().func_190917_f(1);
- }
- return new CPacketRecipePlacement.ItemMove(itemstack, p_193946_1_, int);
- }
- }
- }
- private boolean func_193941_i() {
- InventoryPlayer inventoryplayer = this.field_191888_F.field_71439_g.field_71071_by;
- for(int int = 0; int < this.field_193961_o.func_70302_i_(); ++int) {
- ItemStack itemstack = this.field_193961_o.func_70301_a(int);
- if(!itemstack.func_190926_b()) {
- int int = inventoryplayer.func_70432_d(itemstack);
- if(int == -1) {
- int = inventoryplayer.func_70447_i();
- }
- if(int == -1) {
- return false;
- }
- }
- }
- return true;
- }
- private void func_193951_a(IRecipe p_193951_1_, List<Slot> p_193951_2_) {
- ItemStack itemstack = p_193951_1_.func_77571_b();
- this.field_191915_z.func_192685_a(p_193951_1_);
- 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);
- int int = this.field_193961_o.func_174922_i();
- int int = this.field_193961_o.func_174923_h();
- int int = p_193951_1_ instanceof ShapedRecipes?((ShapedRecipes)p_193951_1_).func_192403_f():int;
- int int = 1;
- Iterator<Ingredient> iterator = p_193951_1_.func_192400_c().iterator();
- for(int int = 0; int < int; ++int) {
- for(int int = 0; int < int; ++int) {
- if(!iterator.hasNext()) {
- return;
- }
- Ingredient ingredient = (Ingredient)iterator.next();
- if(ingredient != Ingredient.field_193370_a) {
- Slot slot = (Slot)p_193951_2_.get(int);
- this.field_191915_z.func_194187_a(ingredient, slot.field_75223_e, slot.field_75221_f);
- }
- ++int;
- }
- if(int < int) {
- int += int - int;
- }
- }
- }
- private void func_193956_j() {
- if(this.field_191888_F.func_147114_u() != null) {
- this.field_191888_F.func_147114_u().func_147297_a(new CPacketRecipeInfo(this.func_191878_b(), this.field_193964_s.func_192815_c()));
- }
- }
- }
- Hunk 2 failed! Cannot find hunk target
- if (this.field_193965_u.func_194118_a(p_193950_1_, intlist, j1)) {
- List<CPacketRecipePlacement.ItemMove> list2 = this.func_193954_a(p_193950_4_);
- - lvt_10_1_ = Lists.<CPacketRecipePlacement.ItemMove>newArrayList();
- - this.func_193013_a(p_193950_1_, p_193950_2_, j1, intlist, lvt_10_1_);
- - this.field_191888_F.field_71442_b.func_192831_a(p_193950_3_, list2, lvt_10_1_, this.field_191888_F.field_71439_g);
- + List<CPacketRecipePlacement.ItemMove> list3 = Lists.<CPacketRecipePlacement.ItemMove>newArrayList();
- + this.func_193013_a(p_193950_1_, p_193950_2_, j1, intlist, list3);
- + this.field_191888_F.field_71442_b.func_192831_a(p_193950_3_, list2, list3, this.field_191888_F.field_71439_g);
- this.field_191888_F.field_71439_g.field_71071_by.func_70296_d();
- }
- }
- File state
- package net.minecraft.client.gui.recipebook;
- import com.google.common.collect.Lists;
- import it.unimi.dsi.fastutil.ints.IntArrayList;
- import it.unimi.dsi.fastutil.ints.IntList;
- import it.unimi.dsi.fastutil.ints.IntListIterator;
- import it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet;
- import it.unimi.dsi.fastutil.objects.ObjectSet;
- import java.util.Iterator;
- import java.util.List;
- import java.util.Locale;
- import java.util.function.Consumer;
- import java.util.function.Predicate;
- import javax.annotation.Nullable;
- import net.minecraft.client.Minecraft;
- import net.minecraft.client.gui.Gui;
- import net.minecraft.client.gui.GuiButtonToggle;
- import net.minecraft.client.gui.GuiScreen;
- import net.minecraft.client.gui.GuiTextField;
- import net.minecraft.client.gui.recipebook.GhostRecipe;
- import net.minecraft.client.gui.recipebook.GuiButtonRecipeTab;
- import net.minecraft.client.gui.recipebook.IRecipeUpdateListener;
- import net.minecraft.client.gui.recipebook.RecipeBookPage;
- import net.minecraft.client.gui.recipebook.RecipeList;
- import net.minecraft.client.renderer.GlStateManager;
- import net.minecraft.client.renderer.RenderHelper;
- import net.minecraft.client.resources.I18n;
- import net.minecraft.client.resources.Language;
- import net.minecraft.client.resources.LanguageManager;
- import net.minecraft.client.settings.GameSettings;
- import net.minecraft.client.util.RecipeBookClient;
- import net.minecraft.client.util.RecipeItemHelper;
- import net.minecraft.client.util.SearchTreeManager;
- import net.minecraft.creativetab.CreativeTabs;
- import net.minecraft.entity.player.InventoryPlayer;
- import net.minecraft.inventory.Container;
- import net.minecraft.inventory.ContainerPlayer;
- import net.minecraft.inventory.ContainerWorkbench;
- import net.minecraft.inventory.InventoryCraftResult;
- import net.minecraft.inventory.InventoryCrafting;
- import net.minecraft.inventory.Slot;
- import net.minecraft.item.ItemStack;
- import net.minecraft.item.crafting.IRecipe;
- import net.minecraft.item.crafting.Ingredient;
- import net.minecraft.item.crafting.ShapedRecipes;
- import net.minecraft.network.play.client.CPacketRecipeInfo;
- import net.minecraft.network.play.client.CPacketRecipePlacement;
- import net.minecraft.stats.RecipeBook;
- import net.minecraft.util.ResourceLocation;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- import org.apache.logging.log4j.LogManager;
- import org.apache.logging.log4j.Logger;
- import org.lwjgl.input.Keyboard;
- @SideOnly(Side.CLIENT)
- public class GuiRecipeBook extends Gui implements IRecipeUpdateListener {
- protected static final ResourceLocation field_191894_a = new ResourceLocation("textures/gui/recipe_book.png");
- private int field_191903_n;
- private int field_191904_o;
- private int field_191905_p;
- private static final Logger field_193959_i = LogManager.getLogger();
- private final GhostRecipe field_191915_z = new GhostRecipe();
- 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)});
- private GuiButtonRecipeTab field_191913_x;
- private GuiButtonToggle field_193960_m;
- private Container field_191908_s;
- private InventoryCrafting field_193961_o;
- private Minecraft field_191888_F;
- private GuiTextField field_193962_q;
- private String field_193963_r = "";
- private RecipeBook field_193964_s;
- private final RecipeBookPage field_193022_s = new RecipeBookPage();
- private RecipeItemHelper field_193965_u = new RecipeItemHelper();
- private int field_193966_v;
- 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_) {
- this.field_191888_F = p_191856_3_;
- this.field_191904_o = p_191856_1_;
- this.field_191905_p = p_191856_2_;
- this.field_191908_s = p_191856_5_;
- this.field_193961_o = p_191856_6_;
- this.field_193964_s = p_191856_3_.field_71439_g.func_192035_E();
- this.field_193966_v = p_191856_3_.field_71439_g.field_71071_by.func_194015_p();
- this.field_191913_x = (GuiButtonRecipeTab)this.field_193018_j.get(0);
- this.field_191913_x.func_191753_b(true);
- if(this.func_191878_b()) {
- this.func_193014_a(p_191856_4_, p_191856_6_);
- }
- Keyboard.enableRepeatEvents(true);
- }
- public void func_193014_a(boolean p_193014_1_, InventoryCrafting p_193014_2_) {
- this.field_191903_n = p_193014_1_?0:86;
- int i = (this.field_191904_o - 147) / 2 - this.field_191903_n;
- int j = (this.field_191905_p - 166) / 2;
- this.field_193965_u.func_194119_a();
- this.field_191888_F.field_71439_g.field_71071_by.func_194016_a(this.field_193965_u, false);
- p_193014_2_.func_194018_a(this.field_193965_u);
- 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);
- this.field_193962_q.func_146203_f(50);
- this.field_193962_q.func_146185_a(false);
- this.field_193962_q.func_146189_e(true);
- this.field_193962_q.func_146193_g(16777215);
- this.field_193022_s.func_194194_a(this.field_191888_F, i, j);
- this.field_193022_s.func_193732_a(this);
- this.field_193960_m = new GuiButtonToggle(0, i + 110, j + 12, 26, 16, this.field_193964_s.func_192815_c());
- this.field_193960_m.func_191751_a(152, 41, 28, 18, field_191894_a);
- this.func_193003_g(false);
- this.func_193949_f();
- }
- public void func_191871_c() {
- Keyboard.enableRepeatEvents(false);
- }
- public int func_193011_a(boolean p_193011_1_, int p_193011_2_, int p_193011_3_) {
- int i;
- if(this.func_191878_b() && !p_193011_1_) {
- i = 177 + (p_193011_2_ - p_193011_3_ - 200) / 2;
- } else {
- i = (p_193011_2_ - p_193011_3_) / 2;
- }
- return i;
- }
- public void func_191866_a() {
- this.func_193006_a(!this.func_191878_b());
- }
- public boolean func_191878_b() {
- return this.field_193964_s.func_192812_b();
- }
- private void func_193006_a(boolean p_193006_1_) {
- this.field_193964_s.func_192813_a(p_193006_1_);
- if(!p_193006_1_) {
- this.field_193022_s.func_194200_c();
- }
- this.func_193956_j();
- }
- public void func_191874_a(@Nullable Slot p_191874_1_) {
- if(p_191874_1_ != null && p_191874_1_.field_75222_d <= 9) {
- this.field_191915_z.func_192682_a();
- if(this.func_191878_b()) {
- this.func_193942_g();
- }
- }
- }
- private void func_193003_g(boolean p_193003_1_) {
- List<RecipeList> list = (List)RecipeBookClient.field_194086_e.get(this.field_191913_x.func_191764_e());
- list.forEach((p_193944_1_) -> {
- 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);
- });
- List<RecipeList> list1 = Lists.newArrayList(list);
- list1.removeIf((p_193952_0_) -> {
- return !p_193952_0_.func_194209_a();
- });
- list1.removeIf((p_193953_0_) -> {
- return !p_193953_0_.func_194212_c();
- });
- String s = this.field_193962_q.func_146179_b();
- if(!s.isEmpty()) {
- ObjectSet<RecipeList> objectset = new ObjectLinkedOpenHashSet(this.field_191888_F.func_193987_a(SearchTreeManager.field_194012_b).func_194038_a(s.toLowerCase(Locale.ROOT)));
- list1.removeIf((p_193947_1_) -> {
- return !lvt_5_1_.contains(p_193947_1_);
- });
- }
- if(this.field_193964_s.func_192815_c()) {
- list1.removeIf((p_193958_0_) -> {
- return !p_193958_0_.func_192708_c();
- });
- }
- this.field_193022_s.func_194192_a(list1, p_193003_1_);
- }
- private void func_193949_f() {
- int int = (this.field_191904_o - 147) / 2 - this.field_191903_n - 30;
- int int = (this.field_191905_p - 166) / 2 + 3;
- int int = 27;
- int int = 0;
- for(GuiButtonRecipeTab guibuttonrecipetab : this.field_193018_j) {
- CreativeTabs creativetabs = guibuttonrecipetab.func_191764_e();
- if(creativetabs == CreativeTabs.field_78027_g) {
- guibuttonrecipetab.field_146125_m = true;
- guibuttonrecipetab.func_191752_c(int, int + 27 * int++);
- } else if(guibuttonrecipetab.func_193919_e()) {
- guibuttonrecipetab.func_191752_c(int, int + 27 * int++);
- guibuttonrecipetab.func_193918_a(this.field_191888_F);
- }
- }
- }
- public void func_193957_d() {
- if(this.func_191878_b()) {
- if(this.field_193966_v != this.field_191888_F.field_71439_g.field_71071_by.func_194015_p()) {
- this.func_193942_g();
- this.field_193966_v = this.field_191888_F.field_71439_g.field_71071_by.func_194015_p();
- }
- }
- }
- private void func_193942_g() {
- this.field_193965_u.func_194119_a();
- this.field_191888_F.field_71439_g.field_71071_by.func_194016_a(this.field_193965_u, false);
- this.field_193961_o.func_194018_a(this.field_193965_u);
- this.func_193003_g(false);
- }
- public void func_191861_a(int p_191861_1_, int p_191861_2_, float p_191861_3_) {
- if(this.func_191878_b()) {
- RenderHelper.func_74520_c();
- GlStateManager.func_179140_f();
- GlStateManager.func_179094_E();
- GlStateManager.func_179109_b(0.0F, 0.0F, 100.0F);
- this.field_191888_F.func_110434_K().func_110577_a(field_191894_a);
- GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
- int int = (this.field_191904_o - 147) / 2 - this.field_191903_n;
- int int = (this.field_191905_p - 166) / 2;
- this.func_73729_b(int, int, 1, 1, 147, 166);
- this.field_193962_q.func_146194_f();
- RenderHelper.func_74518_a();
- for(GuiButtonRecipeTab guibuttonrecipetab : this.field_193018_j) {
- guibuttonrecipetab.func_191745_a(this.field_191888_F, p_191861_1_, p_191861_2_, p_191861_3_);
- }
- this.field_193960_m.func_191745_a(this.field_191888_F, p_191861_1_, p_191861_2_, p_191861_3_);
- this.field_193022_s.func_194191_a(int, int, p_191861_1_, p_191861_2_, p_191861_3_);
- GlStateManager.func_179121_F();
- }
- }
- public void func_191876_c(int p_191876_1_, int p_191876_2_, int p_191876_3_, int p_191876_4_) {
- if(this.func_191878_b()) {
- this.field_193022_s.func_193721_a(p_191876_3_, p_191876_4_);
- if(this.field_193960_m.func_146115_a()) {
- String string = I18n.func_135052_a(this.field_193960_m.func_191754_c()?"gui.recipebook.toggleRecipes.craftable":"gui.recipebook.toggleRecipes.all", new Object[0]);
- if(this.field_191888_F.field_71462_r != null) {
- this.field_191888_F.field_71462_r.func_146279_a(string, p_191876_3_, p_191876_4_);
- }
- }
- this.func_193015_d(p_191876_1_, p_191876_2_, p_191876_3_, p_191876_4_);
- }
- }
- private void func_193015_d(int p_193015_1_, int p_193015_2_, int p_193015_3_, int p_193015_4_) {
- ItemStack itemstack = null;
- for(int int = 0; int < this.field_191915_z.func_192684_b(); ++int) {
- GhostRecipe.GhostIngredient ghostrecipe$ghostingredient = this.field_191915_z.func_192681_a(int);
- int int = ghostrecipe$ghostingredient.func_193713_b() + p_193015_1_;
- int int = ghostrecipe$ghostingredient.func_193712_c() + p_193015_2_;
- if(p_193015_3_ >= int && p_193015_4_ >= int && p_193015_3_ < int + 16 && p_193015_4_ < int + 16) {
- itemstack = ghostrecipe$ghostingredient.func_194184_c();
- }
- }
- if(itemstack != null && this.field_191888_F.field_71462_r != null) {
- 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_);
- }
- }
- public void func_191864_a(int p_191864_1_, int p_191864_2_, boolean p_191864_3_, float p_191864_4_) {
- this.field_191915_z.func_194188_a(this.field_191888_F, p_191864_1_, p_191864_2_, p_191864_3_, p_191864_4_);
- }
- public boolean func_191862_a(int p_191862_1_, int p_191862_2_, int p_191862_3_) {
- if(this.func_191878_b() && !this.field_191888_F.field_71439_g.func_175149_v()) {
- 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)) {
- IRecipe irecipe = this.field_193022_s.func_194193_a();
- RecipeList recipelist = this.field_193022_s.func_194199_b();
- if(irecipe != null && recipelist != null) {
- this.func_193945_a(irecipe, recipelist);
- if(!this.func_191880_f() && p_191862_3_ == 0) {
- this.func_193006_a(false);
- }
- }
- return true;
- } else if(p_191862_3_ != 0) {
- return false;
- } else if(this.field_193962_q.func_146192_a(p_191862_1_, p_191862_2_, p_191862_3_)) {
- return true;
- } else if(this.field_193960_m.func_146116_c(this.field_191888_F, p_191862_1_, p_191862_2_)) {
- boolean boolean = !this.field_193964_s.func_192815_c();
- this.field_193964_s.func_192810_b(boolean);
- this.field_193960_m.func_191753_b(boolean);
- this.field_193960_m.func_146113_a(this.field_191888_F.func_147118_V());
- this.func_193956_j();
- this.func_193003_g(false);
- return true;
- } else {
- for(GuiButtonRecipeTab guibuttonrecipetab : this.field_193018_j) {
- if(guibuttonrecipetab.func_146116_c(this.field_191888_F, p_191862_1_, p_191862_2_)) {
- if(this.field_191913_x != guibuttonrecipetab) {
- guibuttonrecipetab.func_146113_a(this.field_191888_F.func_147118_V());
- this.field_191913_x.func_191753_b(false);
- this.field_191913_x = guibuttonrecipetab;
- this.field_191913_x.func_191753_b(true);
- this.func_193003_g(true);
- }
- return true;
- }
- }
- return false;
- }
- } else {
- return false;
- }
- }
- 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_) {
- if(!this.func_191878_b()) {
- return true;
- } else {
- 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_;
- 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_;
- return boolean && !boolean && !this.field_191913_x.func_146116_c(this.field_191888_F, p_193955_1_, p_193955_2_);
- }
- }
- public boolean func_191859_a(char p_191859_1_, int p_191859_2_) {
- if(this.func_191878_b() && !this.field_191888_F.field_71439_g.func_175149_v()) {
- if(p_191859_2_ == 1 && !this.func_191880_f()) {
- this.func_193006_a(false);
- return true;
- } else {
- if(GameSettings.func_100015_a(this.field_191888_F.field_71474_y.field_74310_D) && !this.field_193962_q.func_146206_l()) {
- this.field_193962_q.func_146195_b(true);
- } else if(this.field_193962_q.func_146201_a(p_191859_1_, p_191859_2_)) {
- String string = this.field_193962_q.func_146179_b().toLowerCase(Locale.ROOT);
- this.func_193716_a(string);
- if(!string.equals(this.field_193963_r)) {
- this.func_193003_g(false);
- this.field_193963_r = string;
- }
- return true;
- }
- return false;
- }
- } else {
- return false;
- }
- }
- private void func_193716_a(String p_193716_1_) {
- if("excitedze".equals(p_193716_1_)) {
- LanguageManager languagemanager = this.field_191888_F.func_135016_M();
- Language language = languagemanager.func_191960_a("en_pt");
- if(languagemanager.func_135041_c().compareTo(language) == 0) {
- return;
- }
- languagemanager.func_135045_a(language);
- this.field_191888_F.field_71474_y.field_74363_ab = language.func_135034_a();
- this.field_191888_F.func_110436_a();
- 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);
- this.field_191888_F.field_71466_p.func_78275_b(languagemanager.func_135044_b());
- this.field_191888_F.field_71474_y.func_74303_b();
- }
- }
- private boolean func_191880_f() {
- return this.field_191903_n == 86;
- }
- public void func_193948_e() {
- this.func_193949_f();
- if(this.func_191878_b()) {
- this.func_193003_g(false);
- }
- }
- public void func_193001_a(List<IRecipe> p_193001_1_) {
- for(IRecipe irecipe : p_193001_1_) {
- this.field_191888_F.field_71439_g.func_193103_a(irecipe);
- }
- }
- private void func_193945_a(IRecipe p_193945_1_, RecipeList p_193945_2_) {
- boolean boolean = p_193945_2_.func_194213_a(p_193945_1_);
- InventoryCraftResult inventorycraftresult = null;
- if(this.field_191908_s instanceof ContainerWorkbench) {
- inventorycraftresult = ((ContainerWorkbench)this.field_191908_s).field_75160_f;
- } else if(this.field_191908_s instanceof ContainerPlayer) {
- inventorycraftresult = ((ContainerPlayer)this.field_191908_s).field_75179_f;
- }
- if(inventorycraftresult != null) {
- if(!boolean && this.field_191915_z.func_192686_c() == p_193945_1_) {
- return;
- }
- if(!this.func_193941_i() && !this.field_191888_F.field_71439_g.func_184812_l_()) {
- return;
- }
- if(boolean) {
- this.func_193950_a(p_193945_1_, this.field_191908_s.field_75151_b, this.field_191908_s.field_75152_c, inventorycraftresult);
- } else {
- List<CPacketRecipePlacement.ItemMove> list = this.func_193954_a(inventorycraftresult);
- this.func_193951_a(p_193945_1_, this.field_191908_s.field_75151_b);
- if(!list.isEmpty()) {
- 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);
- if(this.field_193964_s.func_192815_c()) {
- this.field_191888_F.field_71439_g.field_71071_by.func_70296_d();
- }
- }
- }
- if(!this.func_191880_f()) {
- this.func_191866_a();
- }
- }
- }
- private void func_193950_a(IRecipe p_193950_1_, List<Slot> p_193950_2_, int p_193950_3_, InventoryCraftResult p_193950_4_) {
- boolean boolean = p_193950_1_.func_77569_a(this.field_193961_o, this.field_191888_F.field_71441_e);
- int int = this.field_193965_u.func_194114_b(p_193950_1_, (IntList)null);
- if(boolean) {
- boolean boolean = true;
- for(int int = 0; int < this.field_193961_o.func_70302_i_(); ++int) {
- ItemStack itemstack = this.field_193961_o.func_70301_a(int);
- if(!itemstack.func_190926_b() && int > itemstack.func_190916_E()) {
- boolean = false;
- }
- }
- if(boolean) {
- return;
- }
- }
- int int = this.func_193943_a(int, boolean);
- IntList intlist = new IntArrayList();
- if(this.field_193965_u.func_194118_a(p_193950_1_, intlist, int)) {
- int int = int;
- IntListIterator lvt_10_1_ = intlist.iterator();
- while(lvt_10_1_.hasNext()) {
- int int = ((Integer)lvt_10_1_.next()).intValue();
- int int = RecipeItemHelper.func_194115_b(int).func_77976_d();
- if(int < int) {
- int = int;
- }
- }
- if(this.field_193965_u.func_194118_a(p_193950_1_, intlist, int)) {
- List<CPacketRecipePlacement.ItemMove> list = this.func_193954_a(p_193950_4_);
- lvt_10_1_ = Lists.<CPacketRecipePlacement.ItemMove>newArrayList();
- this.func_193013_a(p_193950_1_, p_193950_2_, int, intlist, lvt_10_1_);
- this.field_191888_F.field_71442_b.func_192831_a(p_193950_3_, list, lvt_10_1_, this.field_191888_F.field_71439_g);
- this.field_191888_F.field_71439_g.field_71071_by.func_70296_d();
- }
- }
- }
- private List<CPacketRecipePlacement.ItemMove> func_193954_a(InventoryCraftResult p_193954_1_) {
- this.field_191915_z.func_192682_a();
- InventoryPlayer inventoryplayer = this.field_191888_F.field_71439_g.field_71071_by;
- List<CPacketRecipePlacement.ItemMove> list = Lists.<CPacketRecipePlacement.ItemMove>newArrayList();
- for(int int = 0; int < this.field_193961_o.func_70302_i_(); ++int) {
- ItemStack itemstack = this.field_193961_o.func_70301_a(int);
- if(!itemstack.func_190926_b()) {
- while(itemstack.func_190916_E() > 0) {
- int int = inventoryplayer.func_70432_d(itemstack);
- if(int == -1) {
- int = inventoryplayer.func_70447_i();
- }
- ItemStack itemstack1 = itemstack.func_77946_l();
- itemstack1.func_190920_e(1);
- if(inventoryplayer.func_191971_c(int, itemstack1)) {
- itemstack1.func_190917_f(1);
- } else {
- field_193959_i.error("Can\'t find any space for item in inventory");
- }
- this.field_193961_o.func_70298_a(int, 1);
- int int = int + 1;
- list.add(new CPacketRecipePlacement.ItemMove(itemstack1.func_77946_l(), int, int));
- }
- }
- }
- this.field_193961_o.func_174888_l();
- p_193954_1_.func_174888_l();
- return list;
- }
- private int func_193943_a(int p_193943_1_, boolean p_193943_2_) {
- int int = 1;
- if(GuiScreen.func_146272_n()) {
- int = p_193943_1_;
- } else if(p_193943_2_) {
- int = 64;
- for(int int = 0; int < this.field_193961_o.func_70302_i_(); ++int) {
- ItemStack itemstack = this.field_193961_o.func_70301_a(int);
- if(!itemstack.func_190926_b() && int > itemstack.func_190916_E()) {
- int = itemstack.func_190916_E();
- }
- }
- if(int < 64) {
- ++int;
- }
- }
- return int;
- }
- 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_) {
- int int = this.field_193961_o.func_174922_i();
- int int = this.field_193961_o.func_174923_h();
- if(p_193013_1_ instanceof ShapedRecipes) {
- ShapedRecipes shapedrecipes = (ShapedRecipes)p_193013_1_;
- int = shapedrecipes.func_192403_f();
- int = shapedrecipes.func_192404_g();
- }
- int int = 1;
- Iterator<Integer> iterator = p_193013_4_.iterator();
- for(int int = 0; int < this.field_193961_o.func_174922_i() && int != int; ++int) {
- for(int int = 0; int < this.field_193961_o.func_174923_h(); ++int) {
- if(int == int || !iterator.hasNext()) {
- int += this.field_193961_o.func_174922_i() - int;
- break;
- }
- Slot slot = (Slot)p_193013_2_.get(int);
- ItemStack itemstack = RecipeItemHelper.func_194115_b(((Integer)iterator.next()).intValue());
- if(itemstack.func_190926_b()) {
- ++int;
- } else {
- for(int int = 0; int < p_193013_3_; ++int) {
- CPacketRecipePlacement.ItemMove cpacketrecipeplacement$itemmove = this.func_193946_a(int, slot, itemstack);
- if(cpacketrecipeplacement$itemmove != null) {
- p_193013_5_.add(cpacketrecipeplacement$itemmove);
- }
- }
- ++int;
- }
- }
- if(!iterator.hasNext()) {
- break;
- }
- }
- }
- @Nullable
- private CPacketRecipePlacement.ItemMove func_193946_a(int p_193946_1_, Slot p_193946_2_, ItemStack p_193946_3_) {
- InventoryPlayer inventoryplayer = this.field_191888_F.field_71439_g.field_71071_by;
- int int = inventoryplayer.func_194014_c(p_193946_3_);
- if(int == -1) {
- return null;
- } else {
- ItemStack itemstack = inventoryplayer.func_70301_a(int).func_77946_l();
- if(itemstack.func_190926_b()) {
- field_193959_i.error("Matched: " + p_193946_3_.func_77977_a() + " with empty item.");
- return null;
- } else {
- if(itemstack.func_190916_E() > 1) {
- inventoryplayer.func_70298_a(int, 1);
- } else {
- inventoryplayer.func_70304_b(int);
- }
- itemstack.func_190920_e(1);
- if(p_193946_2_.func_75211_c().func_190926_b()) {
- p_193946_2_.func_75215_d(itemstack);
- } else {
- p_193946_2_.func_75211_c().func_190917_f(1);
- }
- return new CPacketRecipePlacement.ItemMove(itemstack, p_193946_1_, int);
- }
- }
- }
- private boolean func_193941_i() {
- InventoryPlayer inventoryplayer = this.field_191888_F.field_71439_g.field_71071_by;
- for(int int = 0; int < this.field_193961_o.func_70302_i_(); ++int) {
- ItemStack itemstack = this.field_193961_o.func_70301_a(int);
- if(!itemstack.func_190926_b()) {
- int int = inventoryplayer.func_70432_d(itemstack);
- if(int == -1) {
- int = inventoryplayer.func_70447_i();
- }
- if(int == -1) {
- return false;
- }
- }
- }
- return true;
- }
- private void func_193951_a(IRecipe p_193951_1_, List<Slot> p_193951_2_) {
- ItemStack itemstack = p_193951_1_.func_77571_b();
- this.field_191915_z.func_192685_a(p_193951_1_);
- 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);
- int int = this.field_193961_o.func_174922_i();
- int int = this.field_193961_o.func_174923_h();
- int int = p_193951_1_ instanceof ShapedRecipes?((ShapedRecipes)p_193951_1_).func_192403_f():int;
- int int = 1;
- Iterator<Ingredient> iterator = p_193951_1_.func_192400_c().iterator();
- for(int int = 0; int < int; ++int) {
- for(int int = 0; int < int; ++int) {
- if(!iterator.hasNext()) {
- return;
- }
- Ingredient ingredient = (Ingredient)iterator.next();
- if(ingredient != Ingredient.field_193370_a) {
- Slot slot = (Slot)p_193951_2_.get(int);
- this.field_191915_z.func_194187_a(ingredient, slot.field_75223_e, slot.field_75221_f);
- }
- ++int;
- }
- if(int < int) {
- int += int - int;
- }
- }
- }
- private void func_193956_j() {
- if(this.field_191888_F.func_147114_u() != null) {
- this.field_191888_F.func_147114_u().func_147297_a(new CPacketRecipeInfo(this.func_191878_b(), this.field_193964_s.func_192815_c()));
- }
- }
- }
- Patching failed: minecraft\net\minecraft\client\network\NetHandlerPlayClient.java
- Hunk 1 failed! Cannot find hunk target
- break;
- case ADD:
- p_191980_1_.func_192595_a().forEach((p_194025_2_) -> {
- - p_194025_1_.func_194073_a(p_194025_2_);
- - p_194025_1_.func_193825_e(p_194025_2_);
- + recipebook.func_194073_a(p_194025_2_);
- + recipebook.func_193825_e(p_194025_2_);
- RecipeToast.func_193665_a(this.field_147299_f.func_193033_an(), p_194025_2_);
- });
- }
- RecipeBookClient.field_194087_f.forEach((p_194023_1_) -> {
- - p_194023_1_.func_194214_a(p_194023_0_);
- + p_194023_1_.func_194214_a(recipebook);
- });
- if (this.field_147299_f.field_71462_r instanceof IRecipeShownListener) {
- ((IRecipeShownListener)this.field_147299_f.field_71462_r).func_192043_J_();
- File state
- package net.minecraft.client.network;
- import com.google.common.collect.Maps;
- import com.google.common.util.concurrent.FutureCallback;
- import com.google.common.util.concurrent.Futures;
- import com.mojang.authlib.GameProfile;
- import io.netty.buffer.Unpooled;
- import java.io.File;
- import java.io.IOException;
- import java.io.UnsupportedEncodingException;
- import java.net.URI;
- import java.net.URISyntaxException;
- import java.net.URLDecoder;
- import java.nio.charset.StandardCharsets;
- import java.util.Arrays;
- import java.util.Collection;
- import java.util.Iterator;
- import java.util.List;
- import java.util.Map;
- import java.util.Random;
- import java.util.UUID;
- import java.util.Map.Entry;
- import java.util.function.Consumer;
- import javax.annotation.Nullable;
- import net.minecraft.advancements.Advancement;
- import net.minecraft.block.Block;
- import net.minecraft.client.ClientBrandRetriever;
- import net.minecraft.client.Minecraft;
- import net.minecraft.client.audio.GuardianSound;
- import net.minecraft.client.audio.ISound;
- import net.minecraft.client.audio.PositionedSoundRecord;
- import net.minecraft.client.entity.EntityOtherPlayerMP;
- import net.minecraft.client.entity.EntityPlayerSP;
- import net.minecraft.client.gui.GuiCommandBlock;
- import net.minecraft.client.gui.GuiDisconnected;
- import net.minecraft.client.gui.GuiDownloadTerrain;
- import net.minecraft.client.gui.GuiGameOver;
- import net.minecraft.client.gui.GuiMainMenu;
- import net.minecraft.client.gui.GuiMerchant;
- import net.minecraft.client.gui.GuiMultiplayer;
- import net.minecraft.client.gui.GuiScreen;
- import net.minecraft.client.gui.GuiScreenBook;
- import net.minecraft.client.gui.GuiScreenDemo;
- import net.minecraft.client.gui.GuiScreenRealmsProxy;
- import net.minecraft.client.gui.GuiWinGame;
- import net.minecraft.client.gui.GuiYesNo;
- import net.minecraft.client.gui.GuiYesNoCallback;
- import net.minecraft.client.gui.IProgressMeter;
- import net.minecraft.client.gui.MapItemRenderer;
- import net.minecraft.client.gui.inventory.GuiContainerCreative;
- import net.minecraft.client.gui.recipebook.IRecipeShownListener;
- import net.minecraft.client.gui.toasts.RecipeToast;
- import net.minecraft.client.multiplayer.ClientAdvancementManager;
- import net.minecraft.client.multiplayer.PlayerControllerMP;
- import net.minecraft.client.multiplayer.ServerData;
- import net.minecraft.client.multiplayer.ServerList;
- import net.minecraft.client.multiplayer.WorldClient;
- import net.minecraft.client.network.NetworkPlayerInfo;
- import net.minecraft.client.particle.ParticleItemPickup;
- import net.minecraft.client.player.inventory.ContainerLocalMenu;
- import net.minecraft.client.player.inventory.LocalBlockIntercommunication;
- import net.minecraft.client.renderer.debug.DebugRendererNeighborsUpdate;
- import net.minecraft.client.renderer.debug.DebugRendererPathfinding;
- import net.minecraft.client.resources.I18n;
- import net.minecraft.client.settings.GameSettings;
- import net.minecraft.client.util.RecipeBookClient;
- import net.minecraft.creativetab.CreativeTabs;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.EntityAreaEffectCloud;
- import net.minecraft.entity.EntityLeashKnot;
- import net.minecraft.entity.EntityList;
- import net.minecraft.entity.EntityLiving;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.entity.EntityTracker;
- import net.minecraft.entity.IMerchant;
- import net.minecraft.entity.NpcMerchant;
- import net.minecraft.entity.ai.attributes.AbstractAttributeMap;
- import net.minecraft.entity.ai.attributes.AttributeModifier;
- import net.minecraft.entity.ai.attributes.IAttribute;
- import net.minecraft.entity.ai.attributes.IAttributeInstance;
- import net.minecraft.entity.ai.attributes.RangedAttribute;
- import net.minecraft.entity.effect.EntityLightningBolt;
- import net.minecraft.entity.item.EntityArmorStand;
- import net.minecraft.entity.item.EntityBoat;
- import net.minecraft.entity.item.EntityEnderCrystal;
- import net.minecraft.entity.item.EntityEnderEye;
- import net.minecraft.entity.item.EntityEnderPearl;
- import net.minecraft.entity.item.EntityExpBottle;
- import net.minecraft.entity.item.EntityFallingBlock;
- import net.minecraft.entity.item.EntityFireworkRocket;
- import net.minecraft.entity.item.EntityItem;
- import net.minecraft.entity.item.EntityItemFrame;
- import net.minecraft.entity.item.EntityMinecart;
- import net.minecraft.entity.item.EntityPainting;
- import net.minecraft.entity.item.EntityTNTPrimed;
- import net.minecraft.entity.item.EntityXPOrb;
- import net.minecraft.entity.monster.EntityGuardian;
- import net.minecraft.entity.passive.AbstractHorse;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.entity.player.InventoryPlayer;
- import net.minecraft.entity.projectile.EntityArrow;
- import net.minecraft.entity.projectile.EntityDragonFireball;
- import net.minecraft.entity.projectile.EntityEgg;
- import net.minecraft.entity.projectile.EntityEvokerFangs;
- import net.minecraft.entity.projectile.EntityFishHook;
- import net.minecraft.entity.projectile.EntityLargeFireball;
- import net.minecraft.entity.projectile.EntityLlamaSpit;
- import net.minecraft.entity.projectile.EntityPotion;
- import net.minecraft.entity.projectile.EntityShulkerBullet;
- import net.minecraft.entity.projectile.EntitySmallFireball;
- import net.minecraft.entity.projectile.EntitySnowball;
- import net.minecraft.entity.projectile.EntitySpectralArrow;
- import net.minecraft.entity.projectile.EntityTippedArrow;
- import net.minecraft.entity.projectile.EntityWitherSkull;
- import net.minecraft.init.Items;
- import net.minecraft.init.SoundEvents;
- import net.minecraft.inventory.Container;
- import net.minecraft.inventory.ContainerHorseChest;
- import net.minecraft.inventory.IInventory;
- import net.minecraft.inventory.InventoryBasic;
- import net.minecraft.item.ItemMap;
- import net.minecraft.item.ItemStack;
- import net.minecraft.item.crafting.IRecipe;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.network.NetworkManager;
- import net.minecraft.network.Packet;
- import net.minecraft.network.PacketBuffer;
- import net.minecraft.network.PacketThreadUtil;
- import net.minecraft.network.datasync.EntityDataManager;
- import net.minecraft.network.play.INetHandlerPlayClient;
- import net.minecraft.network.play.client.CPacketClientStatus;
- import net.minecraft.network.play.client.CPacketConfirmTeleport;
- import net.minecraft.network.play.client.CPacketConfirmTransaction;
- import net.minecraft.network.play.client.CPacketCustomPayload;
- import net.minecraft.network.play.client.CPacketKeepAlive;
- import net.minecraft.network.play.client.CPacketPlayer;
- import net.minecraft.network.play.client.CPacketResourcePackStatus;
- import net.minecraft.network.play.client.CPacketVehicleMove;
- import net.minecraft.network.play.server.SPacketAdvancementInfo;
- import net.minecraft.network.play.server.SPacketAnimation;
- import net.minecraft.network.play.server.SPacketBlockAction;
- import net.minecraft.network.play.server.SPacketBlockBreakAnim;
- import net.minecraft.network.play.server.SPacketBlockChange;
- import net.minecraft.network.play.server.SPacketCamera;
- import net.minecraft.network.play.server.SPacketChangeGameState;
- import net.minecraft.network.play.server.SPacketChat;
- import net.minecraft.network.play.server.SPacketChunkData;
- import net.minecraft.network.play.server.SPacketCloseWindow;
- import net.minecraft.network.play.server.SPacketCollectItem;
- import net.minecraft.network.play.server.SPacketCombatEvent;
- import net.minecraft.network.play.server.SPacketConfirmTransaction;
- import net.minecraft.network.play.server.SPacketCooldown;
- import net.minecraft.network.play.server.SPacketCustomPayload;
- import net.minecraft.network.play.server.SPacketCustomSound;
- import net.minecraft.network.play.server.SPacketDestroyEntities;
- import net.minecraft.network.play.server.SPacketDisconnect;
- import net.minecraft.network.play.server.SPacketDisplayObjective;
- import net.minecraft.network.play.server.SPacketEffect;
- import net.minecraft.network.play.server.SPacketEntity;
- import net.minecraft.network.play.server.SPacketEntityAttach;
- import net.minecraft.network.play.server.SPacketEntityEffect;
- import net.minecraft.network.play.server.SPacketEntityEquipment;
- import net.minecraft.network.play.server.SPacketEntityHeadLook;
- import net.minecraft.network.play.server.SPacketEntityMetadata;
- import net.minecraft.network.play.server.SPacketEntityProperties;
- import net.minecraft.network.play.server.SPacketEntityStatus;
- import net.minecraft.network.play.server.SPacketEntityTeleport;
- import net.minecraft.network.play.server.SPacketEntityVelocity;
- import net.minecraft.network.play.server.SPacketExplosion;
- import net.minecraft.network.play.server.SPacketHeldItemChange;
- import net.minecraft.network.play.server.SPacketJoinGame;
- import net.minecraft.network.play.server.SPacketKeepAlive;
- import net.minecraft.network.play.server.SPacketMaps;
- import net.minecraft.network.play.server.SPacketMoveVehicle;
- import net.minecraft.network.play.server.SPacketMultiBlockChange;
- import net.minecraft.network.play.server.SPacketOpenWindow;
- import net.minecraft.network.play.server.SPacketParticles;
- import net.minecraft.network.play.server.SPacketPlayerAbilities;
- import net.minecraft.network.play.server.SPacketPlayerListHeaderFooter;
- import net.minecraft.network.play.server.SPacketPlayerListItem;
- import net.minecraft.network.play.server.SPacketPlayerPosLook;
- import net.minecraft.network.play.server.SPacketRecipeBook;
- import net.minecraft.network.play.server.SPacketRemoveEntityEffect;
- import net.minecraft.network.play.server.SPacketResourcePackSend;
- import net.minecraft.network.play.server.SPacketRespawn;
- import net.minecraft.network.play.server.SPacketScoreboardObjective;
- import net.minecraft.network.play.server.SPacketSelectAdvancementsTab;
- import net.minecraft.network.play.server.SPacketServerDifficulty;
- import net.minecraft.network.play.server.SPacketSetExperience;
- import net.minecraft.network.play.server.SPacketSetPassengers;
- import net.minecraft.network.play.server.SPacketSetSlot;
- import net.minecraft.network.play.server.SPacketSignEditorOpen;
- import net.minecraft.network.play.server.SPacketSoundEffect;
- import net.minecraft.network.play.server.SPacketSpawnExperienceOrb;
- import net.minecraft.network.play.server.SPacketSpawnGlobalEntity;
- import net.minecraft.network.play.server.SPacketSpawnMob;
- import net.minecraft.network.play.server.SPacketSpawnObject;
- import net.minecraft.network.play.server.SPacketSpawnPainting;
- import net.minecraft.network.play.server.SPacketSpawnPlayer;
- import net.minecraft.network.play.server.SPacketSpawnPosition;
- import net.minecraft.network.play.server.SPacketStatistics;
- import net.minecraft.network.play.server.SPacketTabComplete;
- import net.minecraft.network.play.server.SPacketTeams;
- import net.minecraft.network.play.server.SPacketTimeUpdate;
- import net.minecraft.network.play.server.SPacketTitle;
- import net.minecraft.network.play.server.SPacketUnloadChunk;
- import net.minecraft.network.play.server.SPacketUpdateBossInfo;
- import net.minecraft.network.play.server.SPacketUpdateHealth;
- import net.minecraft.network.play.server.SPacketUpdateScore;
- import net.minecraft.network.play.server.SPacketUpdateTileEntity;
- import net.minecraft.network.play.server.SPacketUseBed;
- import net.minecraft.network.play.server.SPacketWindowItems;
- import net.minecraft.network.play.server.SPacketWindowProperty;
- import net.minecraft.network.play.server.SPacketWorldBorder;
- import net.minecraft.pathfinding.Path;
- import net.minecraft.potion.Potion;
- import net.minecraft.potion.PotionEffect;
- import net.minecraft.realms.DisconnectedRealmsScreen;
- import net.minecraft.scoreboard.IScoreCriteria;
- import net.minecraft.scoreboard.Score;
- import net.minecraft.scoreboard.ScoreObjective;
- import net.minecraft.scoreboard.ScorePlayerTeam;
- import net.minecraft.scoreboard.Scoreboard;
- import net.minecraft.scoreboard.Team;
- import net.minecraft.stats.RecipeBook;
- import net.minecraft.stats.StatBase;
- import net.minecraft.tileentity.TileEntity;
- import net.minecraft.tileentity.TileEntityBanner;
- import net.minecraft.tileentity.TileEntityBeacon;
- import net.minecraft.tileentity.TileEntityBed;
- import net.minecraft.tileentity.TileEntityCommandBlock;
- import net.minecraft.tileentity.TileEntityEndGateway;
- import net.minecraft.tileentity.TileEntityFlowerPot;
- import net.minecraft.tileentity.TileEntityMobSpawner;
- import net.minecraft.tileentity.TileEntityShulkerBox;
- import net.minecraft.tileentity.TileEntitySign;
- import net.minecraft.tileentity.TileEntitySkull;
- import net.minecraft.tileentity.TileEntityStructure;
- import net.minecraft.util.EnumFacing;
- import net.minecraft.util.EnumHand;
- import net.minecraft.util.EnumParticleTypes;
- import net.minecraft.util.ITabCompleter;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.util.SoundCategory;
- import net.minecraft.util.StringUtils;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.util.math.MathHelper;
- import net.minecraft.util.text.ITextComponent;
- import net.minecraft.util.text.TextComponentTranslation;
- import net.minecraft.util.text.TextFormatting;
- import net.minecraft.village.MerchantRecipeList;
- import net.minecraft.world.Explosion;
- import net.minecraft.world.GameType;
- import net.minecraft.world.WorldProviderSurface;
- import net.minecraft.world.WorldSettings;
- import net.minecraft.world.chunk.Chunk;
- import net.minecraft.world.storage.MapData;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- import org.apache.logging.log4j.LogManager;
- import org.apache.logging.log4j.Logger;
- @SideOnly(Side.CLIENT)
- public class NetHandlerPlayClient implements INetHandlerPlayClient {
- private static final Logger field_147301_d = LogManager.getLogger();
- private final NetworkManager field_147302_e;
- private final GameProfile field_175107_d;
- private final GuiScreen field_147307_j;
- private Minecraft field_147299_f;
- private WorldClient field_147300_g;
- private boolean field_147309_h;
- private final Map<UUID, NetworkPlayerInfo> field_147310_i = Maps.<UUID, NetworkPlayerInfo>newHashMap();
- public int field_147304_c = 20;
- private boolean field_147308_k;
- private final ClientAdvancementManager field_191983_k;
- private final Random field_147306_l = new Random();
- public NetHandlerPlayClient(Minecraft p_i46300_1_, GuiScreen p_i46300_2_, NetworkManager p_i46300_3_, GameProfile p_i46300_4_) {
- this.field_147299_f = p_i46300_1_;
- this.field_147307_j = p_i46300_2_;
- this.field_147302_e = p_i46300_3_;
- this.field_175107_d = p_i46300_4_;
- this.field_191983_k = new ClientAdvancementManager(p_i46300_1_);
- }
- public void func_147296_c() {
- this.field_147300_g = null;
- }
- public void func_147282_a(SPacketJoinGame p_147282_1_) {
- PacketThreadUtil.func_180031_a(p_147282_1_, this, this.field_147299_f);
- this.field_147299_f.field_71442_b = new PlayerControllerMP(this.field_147299_f, this);
- 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);
- this.field_147299_f.field_71474_y.field_74318_M = p_147282_1_.func_149192_g();
- this.field_147299_f.func_71403_a(this.field_147300_g);
- this.field_147299_f.field_71439_g.field_71093_bK = p_147282_1_.func_149194_f();
- this.field_147299_f.func_147108_a(new GuiDownloadTerrain(this));
- this.field_147299_f.field_71439_g.func_145769_d(p_147282_1_.func_149197_c());
- this.field_147304_c = p_147282_1_.func_149193_h();
- this.field_147299_f.field_71439_g.func_175150_k(p_147282_1_.func_179744_h());
- this.field_147299_f.field_71442_b.func_78746_a(p_147282_1_.func_149198_e());
- this.field_147299_f.field_71474_y.func_82879_c();
- this.field_147302_e.func_179290_a(new CPacketCustomPayload("MC|Brand", (new PacketBuffer(Unpooled.buffer())).func_180714_a(ClientBrandRetriever.getClientModName())));
- }
- public void func_147235_a(SPacketSpawnObject p_147235_1_) {
- PacketThreadUtil.func_180031_a(p_147235_1_, this, this.field_147299_f);
- double d0 = p_147235_1_.func_186880_c();
- double d1 = p_147235_1_.func_186882_d();
- double d2 = p_147235_1_.func_186881_e();
- Entity entity = null;
- if(p_147235_1_.func_148993_l() == 10) {
- entity = EntityMinecart.func_184263_a(this.field_147300_g, d0, d1, d2, EntityMinecart.Type.func_184955_a(p_147235_1_.func_149009_m()));
- } else if(p_147235_1_.func_148993_l() == 90) {
- Entity entity1 = this.field_147300_g.func_73045_a(p_147235_1_.func_149009_m());
- if(entity1 instanceof EntityPlayer) {
- entity = new EntityFishHook(this.field_147300_g, (EntityPlayer)entity1, d0, d1, d2);
- }
- p_147235_1_.func_149002_g(0);
- } else if(p_147235_1_.func_148993_l() == 60) {
- entity = new EntityTippedArrow(this.field_147300_g, d0, d1, d2);
- } else if(p_147235_1_.func_148993_l() == 91) {
- entity = new EntitySpectralArrow(this.field_147300_g, d0, d1, d2);
- } else if(p_147235_1_.func_148993_l() == 61) {
- entity = new EntitySnowball(this.field_147300_g, d0, d1, d2);
- } else if(p_147235_1_.func_148993_l() == 68) {
- 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);
- } else if(p_147235_1_.func_148993_l() == 71) {
- entity = new EntityItemFrame(this.field_147300_g, new BlockPos(d0, d1, d2), EnumFacing.func_176731_b(p_147235_1_.func_149009_m()));
- p_147235_1_.func_149002_g(0);
- } else if(p_147235_1_.func_148993_l() == 77) {
- entity = new EntityLeashKnot(this.field_147300_g, new BlockPos(MathHelper.func_76128_c(d0), MathHelper.func_76128_c(d1), MathHelper.func_76128_c(d2)));
- p_147235_1_.func_149002_g(0);
- } else if(p_147235_1_.func_148993_l() == 65) {
- entity = new EntityEnderPearl(this.field_147300_g, d0, d1, d2);
- } else if(p_147235_1_.func_148993_l() == 72) {
- entity = new EntityEnderEye(this.field_147300_g, d0, d1, d2);
- } else if(p_147235_1_.func_148993_l() == 76) {
- entity = new EntityFireworkRocket(this.field_147300_g, d0, d1, d2, ItemStack.field_190927_a);
- } else if(p_147235_1_.func_148993_l() == 63) {
- 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);
- p_147235_1_.func_149002_g(0);
- } else if(p_147235_1_.func_148993_l() == 93) {
- 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);
- p_147235_1_.func_149002_g(0);
- } else if(p_147235_1_.func_148993_l() == 64) {
- 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);
- p_147235_1_.func_149002_g(0);
- } else if(p_147235_1_.func_148993_l() == 66) {
- 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);
- p_147235_1_.func_149002_g(0);
- } else if(p_147235_1_.func_148993_l() == 67) {
- 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);
- p_147235_1_.func_149002_g(0);
- } else if(p_147235_1_.func_148993_l() == 62) {
- entity = new EntityEgg(this.field_147300_g, d0, d1, d2);
- } else if(p_147235_1_.func_148993_l() == 79) {
- entity = new EntityEvokerFangs(this.field_147300_g, d0, d1, d2, 0.0F, 0, (EntityLivingBase)null);
- } else if(p_147235_1_.func_148993_l() == 73) {
- entity = new EntityPotion(this.field_147300_g, d0, d1, d2, ItemStack.field_190927_a);
- p_147235_1_.func_149002_g(0);
- } else if(p_147235_1_.func_148993_l() == 75) {
- entity = new EntityExpBottle(this.field_147300_g, d0, d1, d2);
- p_147235_1_.func_149002_g(0);
- } else if(p_147235_1_.func_148993_l() == 1) {
- entity = new EntityBoat(this.field_147300_g, d0, d1, d2);
- } else if(p_147235_1_.func_148993_l() == 50) {
- entity = new EntityTNTPrimed(this.field_147300_g, d0, d1, d2, (EntityLivingBase)null);
- } else if(p_147235_1_.func_148993_l() == 78) {
- entity = new EntityArmorStand(this.field_147300_g, d0, d1, d2);
- } else if(p_147235_1_.func_148993_l() == 51) {
- entity = new EntityEnderCrystal(this.field_147300_g, d0, d1, d2);
- } else if(p_147235_1_.func_148993_l() == 2) {
- entity = new EntityItem(this.field_147300_g, d0, d1, d2);
- } else if(p_147235_1_.func_148993_l() == 70) {
- entity = new EntityFallingBlock(this.field_147300_g, d0, d1, d2, Block.func_176220_d(p_147235_1_.func_149009_m() & '\uffff'));
- p_147235_1_.func_149002_g(0);
- } else if(p_147235_1_.func_148993_l() == 3) {
- entity = new EntityAreaEffectCloud(this.field_147300_g, d0, d1, d2);
- }
- if(entity != null) {
- EntityTracker.func_187254_a(entity, d0, d1, d2);
- entity.field_70125_A = (float)(p_147235_1_.func_149008_j() * 360) / 256.0F;
- entity.field_70177_z = (float)(p_147235_1_.func_149006_k() * 360) / 256.0F;
- Entity[] aentity = entity.func_70021_al();
- if(aentity != null) {
- int i = p_147235_1_.func_149001_c() - entity.func_145782_y();
- for(Entity entity2 : aentity) {
- entity2.func_145769_d(entity2.func_145782_y() + i);
- }
- }
- entity.func_145769_d(p_147235_1_.func_149001_c());
- entity.func_184221_a(p_147235_1_.func_186879_b());
- this.field_147300_g.func_73027_a(p_147235_1_.func_149001_c(), entity);
- if(p_147235_1_.func_149009_m() > 0) {
- if(p_147235_1_.func_148993_l() == 60 || p_147235_1_.func_148993_l() == 91) {
- Entity entity3 = this.field_147300_g.func_73045_a(p_147235_1_.func_149009_m() - 1);
- if(entity3 instanceof EntityLivingBase && entity instanceof EntityArrow) {
- ((EntityArrow)entity).field_70250_c = entity3;
- }
- }
- 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);
- }
- }
- }
- public void func_147286_a(SPacketSpawnExperienceOrb p_147286_1_) {
- PacketThreadUtil.func_180031_a(p_147286_1_, this, this.field_147299_f);
- double d0 = p_147286_1_.func_186885_b();
- double d1 = p_147286_1_.func_186886_c();
- double d2 = p_147286_1_.func_186884_d();
- Entity entity = new EntityXPOrb(this.field_147300_g, d0, d1, d2, p_147286_1_.func_148986_g());
- EntityTracker.func_187254_a(entity, d0, d1, d2);
- entity.field_70177_z = 0.0F;
- entity.field_70125_A = 0.0F;
- entity.func_145769_d(p_147286_1_.func_148985_c());
- this.field_147300_g.func_73027_a(p_147286_1_.func_148985_c(), entity);
- }
- public void func_147292_a(SPacketSpawnGlobalEntity p_147292_1_) {
- PacketThreadUtil.func_180031_a(p_147292_1_, this, this.field_147299_f);
- double d0 = p_147292_1_.func_186888_b();
- double d1 = p_147292_1_.func_186889_c();
- double d2 = p_147292_1_.func_186887_d();
- Entity entity = null;
- if(p_147292_1_.func_149053_g() == 1) {
- entity = new EntityLightningBolt(this.field_147300_g, d0, d1, d2, false);
- }
- if(entity != null) {
- EntityTracker.func_187254_a(entity, d0, d1, d2);
- entity.field_70177_z = 0.0F;
- entity.field_70125_A = 0.0F;
- entity.func_145769_d(p_147292_1_.func_149052_c());
- this.field_147300_g.func_72942_c(entity);
- }
- }
- public void func_147288_a(SPacketSpawnPainting p_147288_1_) {
- PacketThreadUtil.func_180031_a(p_147288_1_, this, this.field_147299_f);
- 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());
- entitypainting.func_184221_a(p_147288_1_.func_186895_b());
- this.field_147300_g.func_73027_a(p_147288_1_.func_148965_c(), entitypainting);
- }
- public void func_147244_a(SPacketEntityVelocity p_147244_1_) {
- PacketThreadUtil.func_180031_a(p_147244_1_, this, this.field_147299_f);
- Entity entity = this.field_147300_g.func_73045_a(p_147244_1_.func_149412_c());
- if(entity != null) {
- 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);
- }
- }
- public void func_147284_a(SPacketEntityMetadata p_147284_1_) {
- PacketThreadUtil.func_180031_a(p_147284_1_, this, this.field_147299_f);
- Entity entity = this.field_147300_g.func_73045_a(p_147284_1_.func_149375_d());
- if(entity != null && p_147284_1_.func_149376_c() != null) {
- entity.func_184212_Q().func_187218_a(p_147284_1_.func_149376_c());
- }
- }
- public void func_147237_a(SPacketSpawnPlayer p_147237_1_) {
- PacketThreadUtil.func_180031_a(p_147237_1_, this, this.field_147299_f);
- double d0 = p_147237_1_.func_186898_d();
- double d1 = p_147237_1_.func_186897_e();
- double d2 = p_147237_1_.func_186899_f();
- float f = (float)(p_147237_1_.func_148941_i() * 360) / 256.0F;
- float f1 = (float)(p_147237_1_.func_148945_j() * 360) / 256.0F;
- EntityOtherPlayerMP entityotherplayermp = new EntityOtherPlayerMP(this.field_147299_f.field_71441_e, this.func_175102_a(p_147237_1_.func_179819_c()).func_178845_a());
- entityotherplayermp.field_70169_q = d0;
- entityotherplayermp.field_70142_S = d0;
- entityotherplayermp.field_70167_r = d1;
- entityotherplayermp.field_70137_T = d1;
- entityotherplayermp.field_70166_s = d2;
- entityotherplayermp.field_70136_U = d2;
- EntityTracker.func_187254_a(entityotherplayermp, d0, d1, d2);
- entityotherplayermp.func_70080_a(d0, d1, d2, f, f1);
- this.field_147300_g.func_73027_a(p_147237_1_.func_148943_d(), entityotherplayermp);
- List<EntityDataManager.DataEntry<?>> list = p_147237_1_.func_148944_c();
- if(list != null) {
- entityotherplayermp.func_184212_Q().func_187218_a(list);
- }
- }
- public void func_147275_a(SPacketEntityTeleport p_147275_1_) {
- PacketThreadUtil.func_180031_a(p_147275_1_, this, this.field_147299_f);
- Entity entity = this.field_147300_g.func_73045_a(p_147275_1_.func_149451_c());
- if(entity != null) {
- double d0 = p_147275_1_.func_186982_b();
- double d1 = p_147275_1_.func_186983_c();
- double d2 = p_147275_1_.func_186981_d();
- EntityTracker.func_187254_a(entity, d0, d1, d2);
- if(!entity.func_184186_bw()) {
- float f = (float)(p_147275_1_.func_149450_g() * 360) / 256.0F;
- float f1 = (float)(p_147275_1_.func_149447_h() * 360) / 256.0F;
- 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) {
- entity.func_180426_a(entity.field_70165_t, entity.field_70163_u, entity.field_70161_v, f, f1, 0, true);
- } else {
- entity.func_180426_a(d0, d1, d2, f, f1, 3, true);
- }
- entity.field_70122_E = p_147275_1_.func_179697_g();
- }
- }
- }
- public void func_147257_a(SPacketHeldItemChange p_147257_1_) {
- PacketThreadUtil.func_180031_a(p_147257_1_, this, this.field_147299_f);
- if(InventoryPlayer.func_184435_e(p_147257_1_.func_149385_c())) {
- this.field_147299_f.field_71439_g.field_71071_by.field_70461_c = p_147257_1_.func_149385_c();
- }
- }
- public void func_147259_a(SPacketEntity p_147259_1_) {
- PacketThreadUtil.func_180031_a(p_147259_1_, this, this.field_147299_f);
- Entity entity = p_147259_1_.func_149065_a(this.field_147300_g);
- if(entity != null) {
- entity.field_70118_ct += (long)p_147259_1_.func_186952_a();
- entity.field_70117_cu += (long)p_147259_1_.func_186953_b();
- entity.field_70116_cv += (long)p_147259_1_.func_186951_c();
- double d0 = (double)entity.field_70118_ct / 4096.0D;
- double d1 = (double)entity.field_70117_cu / 4096.0D;
- double d2 = (double)entity.field_70116_cv / 4096.0D;
- if(!entity.func_184186_bw()) {
- float f = p_147259_1_.func_149060_h()?(float)(p_147259_1_.func_149066_f() * 360) / 256.0F:entity.field_70177_z;
- float f1 = p_147259_1_.func_149060_h()?(float)(p_147259_1_.func_149063_g() * 360) / 256.0F:entity.field_70125_A;
- entity.func_180426_a(d0, d1, d2, f, f1, 3, false);
- entity.field_70122_E = p_147259_1_.func_179742_g();
- }
- }
- }
- public void func_147267_a(SPacketEntityHeadLook p_147267_1_) {
- PacketThreadUtil.func_180031_a(p_147267_1_, this, this.field_147299_f);
- Entity entity = p_147267_1_.func_149381_a(this.field_147300_g);
- if(entity != null) {
- float f = (float)(p_147267_1_.func_149380_c() * 360) / 256.0F;
- entity.func_70034_d(f);
- }
- }
- public void func_147238_a(SPacketDestroyEntities p_147238_1_) {
- PacketThreadUtil.func_180031_a(p_147238_1_, this, this.field_147299_f);
- for(int i = 0; i < p_147238_1_.func_149098_c().length; ++i) {
- this.field_147300_g.func_73028_b(p_147238_1_.func_149098_c()[i]);
- }
- }
- public void func_184330_a(SPacketPlayerPosLook p_184330_1_) {
- PacketThreadUtil.func_180031_a(p_184330_1_, this, this.field_147299_f);
- EntityPlayer entityplayer = this.field_147299_f.field_71439_g;
- double d0 = p_184330_1_.func_148932_c();
- double d1 = p_184330_1_.func_148928_d();
- double d2 = p_184330_1_.func_148933_e();
- float f = p_184330_1_.func_148931_f();
- float f1 = p_184330_1_.func_148930_g();
- if(p_184330_1_.func_179834_f().contains(SPacketPlayerPosLook.EnumFlags.X)) {
- d0 += entityplayer.field_70165_t;
- } else {
- entityplayer.field_70159_w = 0.0D;
- }
- if(p_184330_1_.func_179834_f().contains(SPacketPlayerPosLook.EnumFlags.Y)) {
- d1 += entityplayer.field_70163_u;
- } else {
- entityplayer.field_70181_x = 0.0D;
- }
- if(p_184330_1_.func_179834_f().contains(SPacketPlayerPosLook.EnumFlags.Z)) {
- d2 += entityplayer.field_70161_v;
- } else {
- entityplayer.field_70179_y = 0.0D;
- }
- if(p_184330_1_.func_179834_f().contains(SPacketPlayerPosLook.EnumFlags.X_ROT)) {
- f1 += entityplayer.field_70125_A;
- }
- if(p_184330_1_.func_179834_f().contains(SPacketPlayerPosLook.EnumFlags.Y_ROT)) {
- f += entityplayer.field_70177_z;
- }
- entityplayer.func_70080_a(d0, d1, d2, f, f1);
- this.field_147302_e.func_179290_a(new CPacketConfirmTeleport(p_184330_1_.func_186965_f()));
- 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));
- if(!this.field_147309_h) {
- this.field_147299_f.field_71439_g.field_70169_q = this.field_147299_f.field_71439_g.field_70165_t;
- this.field_147299_f.field_71439_g.field_70167_r = this.field_147299_f.field_71439_g.field_70163_u;
- this.field_147299_f.field_71439_g.field_70166_s = this.field_147299_f.field_71439_g.field_70161_v;
- this.field_147309_h = true;
- this.field_147299_f.func_147108_a((GuiScreen)null);
- }
- }
- public void func_147287_a(SPacketMultiBlockChange p_147287_1_) {
- PacketThreadUtil.func_180031_a(p_147287_1_, this, this.field_147299_f);
- for(SPacketMultiBlockChange.BlockUpdateData spacketmultiblockchange$blockupdatedata : p_147287_1_.func_179844_a()) {
- this.field_147300_g.func_180503_b(spacketmultiblockchange$blockupdatedata.func_180090_a(), spacketmultiblockchange$blockupdatedata.func_180088_c());
- }
- }
- public void func_147263_a(SPacketChunkData p_147263_1_) {
- PacketThreadUtil.func_180031_a(p_147263_1_, this, this.field_147299_f);
- if(p_147263_1_.func_149274_i()) {
- this.field_147300_g.func_73025_a(p_147263_1_.func_149273_e(), p_147263_1_.func_149271_f(), true);
- }
- 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);
- Chunk chunk = this.field_147300_g.func_72964_e(p_147263_1_.func_149273_e(), p_147263_1_.func_149271_f());
- chunk.func_186033_a(p_147263_1_.func_186946_a(), p_147263_1_.func_149276_g(), p_147263_1_.func_149274_i());
- 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);
- if(!p_147263_1_.func_149274_i() || !(this.field_147300_g.field_73011_w instanceof WorldProviderSurface)) {
- chunk.func_76613_n();
- }
- for(NBTTagCompound nbttagcompound : p_147263_1_.func_189554_f()) {
- BlockPos blockpos = new BlockPos(nbttagcompound.func_74762_e("x"), nbttagcompound.func_74762_e("y"), nbttagcompound.func_74762_e("z"));
- TileEntity tileentity = this.field_147300_g.func_175625_s(blockpos);
- if(tileentity != null) {
- tileentity.func_145839_a(nbttagcompound);
- }
- }
- }
- public void func_184326_a(SPacketUnloadChunk p_184326_1_) {
- PacketThreadUtil.func_180031_a(p_184326_1_, this, this.field_147299_f);
- this.field_147300_g.func_73025_a(p_184326_1_.func_186940_a(), p_184326_1_.func_186941_b(), false);
- }
- public void func_147234_a(SPacketBlockChange p_147234_1_) {
- PacketThreadUtil.func_180031_a(p_147234_1_, this, this.field_147299_f);
- this.field_147300_g.func_180503_b(p_147234_1_.func_179827_b(), p_147234_1_.func_180728_a());
- }
- public void func_147253_a(SPacketDisconnect p_147253_1_) {
- this.field_147302_e.func_150718_a(p_147253_1_.func_149165_c());
- }
- public void func_147231_a(ITextComponent p_147231_1_) {
- this.field_147299_f.func_71403_a((WorldClient)null);
- if(this.field_147307_j != null) {
- if(this.field_147307_j instanceof GuiScreenRealmsProxy) {
- this.field_147299_f.func_147108_a((new DisconnectedRealmsScreen(((GuiScreenRealmsProxy)this.field_147307_j).func_154321_a(), "disconnect.lost", p_147231_1_)).getProxy());
- } else {
- this.field_147299_f.func_147108_a(new GuiDisconnected(this.field_147307_j, "disconnect.lost", p_147231_1_));
- }
- } else {
- this.field_147299_f.func_147108_a(new GuiDisconnected(new GuiMultiplayer(new GuiMainMenu()), "disconnect.lost", p_147231_1_));
- }
- }
- public void func_147297_a(Packet<?> p_147297_1_) {
- this.field_147302_e.func_179290_a(p_147297_1_);
- }
- public void func_147246_a(SPacketCollectItem p_147246_1_) {
- PacketThreadUtil.func_180031_a(p_147246_1_, this, this.field_147299_f);
- Entity entity = this.field_147300_g.func_73045_a(p_147246_1_.func_149354_c());
- EntityLivingBase entitylivingbase = (EntityLivingBase)this.field_147300_g.func_73045_a(p_147246_1_.func_149353_d());
- if(entitylivingbase == null) {
- entitylivingbase = this.field_147299_f.field_71439_g;
- }
- if(entity != null) {
- if(entity instanceof EntityXPOrb) {
- 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);
- } else {
- 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);
- }
- if(entity instanceof EntityItem) {
- ((EntityItem)entity).func_92059_d().func_190920_e(p_147246_1_.func_191208_c());
- }
- this.field_147299_f.field_71452_i.func_78873_a(new ParticleItemPickup(this.field_147300_g, entity, entitylivingbase, 0.5F));
- this.field_147300_g.func_73028_b(p_147246_1_.func_149354_c());
- }
- }
- public void func_147251_a(SPacketChat p_147251_1_) {
- PacketThreadUtil.func_180031_a(p_147251_1_, this, this.field_147299_f);
- this.field_147299_f.field_71456_v.func_191742_a(p_147251_1_.func_192590_c(), p_147251_1_.func_148915_c());
- }
- public void func_147279_a(SPacketAnimation p_147279_1_) {
- PacketThreadUtil.func_180031_a(p_147279_1_, this, this.field_147299_f);
- Entity entity = this.field_147300_g.func_73045_a(p_147279_1_.func_148978_c());
- if(entity != null) {
- if(p_147279_1_.func_148977_d() == 0) {
- EntityLivingBase entitylivingbase = (EntityLivingBase)entity;
- entitylivingbase.func_184609_a(EnumHand.MAIN_HAND);
- } else if(p_147279_1_.func_148977_d() == 3) {
- EntityLivingBase entitylivingbase1 = (EntityLivingBase)entity;
- entitylivingbase1.func_184609_a(EnumHand.OFF_HAND);
- } else if(p_147279_1_.func_148977_d() == 1) {
- entity.func_70057_ab();
- } else if(p_147279_1_.func_148977_d() == 2) {
- EntityPlayer entityplayer = (EntityPlayer)entity;
- entityplayer.func_70999_a(false, false, false);
- } else if(p_147279_1_.func_148977_d() == 4) {
- this.field_147299_f.field_71452_i.func_178926_a(entity, EnumParticleTypes.CRIT);
- } else if(p_147279_1_.func_148977_d() == 5) {
- this.field_147299_f.field_71452_i.func_178926_a(entity, EnumParticleTypes.CRIT_MAGIC);
- }
- }
- }
- public void func_147278_a(SPacketUseBed p_147278_1_) {
- PacketThreadUtil.func_180031_a(p_147278_1_, this, this.field_147299_f);
- p_147278_1_.func_149091_a(this.field_147300_g).func_180469_a(p_147278_1_.func_179798_a());
- }
- public void func_147281_a(SPacketSpawnMob p_147281_1_) {
- PacketThreadUtil.func_180031_a(p_147281_1_, this, this.field_147299_f);
- double d0 = p_147281_1_.func_186891_e();
- double d1 = p_147281_1_.func_186892_f();
- double d2 = p_147281_1_.func_186893_g();
- float f = (float)(p_147281_1_.func_149028_l() * 360) / 256.0F;
- float f1 = (float)(p_147281_1_.func_149030_m() * 360) / 256.0F;
- EntityLivingBase entitylivingbase = (EntityLivingBase)EntityList.func_75616_a(p_147281_1_.func_149025_e(), this.field_147299_f.field_71441_e);
- if(entitylivingbase != null) {
- EntityTracker.func_187254_a(entitylivingbase, d0, d1, d2);
- entitylivingbase.field_70761_aq = (float)(p_147281_1_.func_149032_n() * 360) / 256.0F;
- entitylivingbase.field_70759_as = (float)(p_147281_1_.func_149032_n() * 360) / 256.0F;
- Entity[] aentity = entitylivingbase.func_70021_al();
- if(aentity != null) {
- int i = p_147281_1_.func_149024_d() - entitylivingbase.func_145782_y();
- for(Entity entity : aentity) {
- entity.func_145769_d(entity.func_145782_y() + i);
- }
- }
- entitylivingbase.func_145769_d(p_147281_1_.func_149024_d());
- entitylivingbase.func_184221_a(p_147281_1_.func_186890_c());
- entitylivingbase.func_70080_a(d0, d1, d2, f, f1);
- entitylivingbase.field_70159_w = (double)((float)p_147281_1_.func_149026_i() / 8000.0F);
- entitylivingbase.field_70181_x = (double)((float)p_147281_1_.func_149033_j() / 8000.0F);
- entitylivingbase.field_70179_y = (double)((float)p_147281_1_.func_149031_k() / 8000.0F);
- this.field_147300_g.func_73027_a(p_147281_1_.func_149024_d(), entitylivingbase);
- List<EntityDataManager.DataEntry<?>> list = p_147281_1_.func_149027_c();
- if(list != null) {
- entitylivingbase.func_184212_Q().func_187218_a(list);
- }
- } else {
- field_147301_d.warn((String)"Skipping Entity with id {}", (Object)Integer.valueOf(p_147281_1_.func_149025_e()));
- }
- }
- public void func_147285_a(SPacketTimeUpdate p_147285_1_) {
- PacketThreadUtil.func_180031_a(p_147285_1_, this, this.field_147299_f);
- this.field_147299_f.field_71441_e.func_82738_a(p_147285_1_.func_149366_c());
- this.field_147299_f.field_71441_e.func_72877_b(p_147285_1_.func_149365_d());
- }
- public void func_147271_a(SPacketSpawnPosition p_147271_1_) {
- PacketThreadUtil.func_180031_a(p_147271_1_, this, this.field_147299_f);
- this.field_147299_f.field_71439_g.func_180473_a(p_147271_1_.func_179800_a(), true);
- this.field_147299_f.field_71441_e.func_72912_H().func_176143_a(p_147271_1_.func_179800_a());
- }
- public void func_184328_a(SPacketSetPassengers p_184328_1_) {
- PacketThreadUtil.func_180031_a(p_184328_1_, this, this.field_147299_f);
- Entity entity = this.field_147300_g.func_73045_a(p_184328_1_.func_186972_b());
- if(entity == null) {
- field_147301_d.warn("Received passengers for unknown entity");
- } else {
- boolean flag = entity.func_184215_y(this.field_147299_f.field_71439_g);
- entity.func_184226_ay();
- for(int i : p_184328_1_.func_186971_a()) {
- Entity entity1 = this.field_147300_g.func_73045_a(i);
- if(entity1 != null) {
- entity1.func_184205_a(entity, true);
- if(entity1 == this.field_147299_f.field_71439_g && !flag) {
- 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);
- }
- }
- }
- }
- }
- public void func_147243_a(SPacketEntityAttach p_147243_1_) {
- PacketThreadUtil.func_180031_a(p_147243_1_, this, this.field_147299_f);
- Entity entity = this.field_147300_g.func_73045_a(p_147243_1_.func_149403_d());
- Entity entity1 = this.field_147300_g.func_73045_a(p_147243_1_.func_149402_e());
- if(entity instanceof EntityLiving) {
- if(entity1 != null) {
- ((EntityLiving)entity).func_110162_b(entity1, false);
- } else {
- ((EntityLiving)entity).func_110160_i(false, false);
- }
- }
- }
- public void func_147236_a(SPacketEntityStatus p_147236_1_) {
- PacketThreadUtil.func_180031_a(p_147236_1_, this, this.field_147299_f);
- Entity entity = p_147236_1_.func_149161_a(this.field_147300_g);
- if(entity != null) {
- if(p_147236_1_.func_149160_c() == 21) {
- this.field_147299_f.func_147118_V().func_147682_a(new GuardianSound((EntityGuardian)entity));
- } else if(p_147236_1_.func_149160_c() == 35) {
- int i = 40;
- this.field_147299_f.field_71452_i.func_191271_a(entity, EnumParticleTypes.TOTEM, 30);
- 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);
- if(entity == this.field_147299_f.field_71439_g) {
- this.field_147299_f.field_71460_t.func_190565_a(new ItemStack(Items.field_190929_cY));
- }
- } else {
- entity.func_70103_a(p_147236_1_.func_149160_c());
- }
- }
- }
- public void func_147249_a(SPacketUpdateHealth p_147249_1_) {
- PacketThreadUtil.func_180031_a(p_147249_1_, this, this.field_147299_f);
- this.field_147299_f.field_71439_g.func_71150_b(p_147249_1_.func_149332_c());
- this.field_147299_f.field_71439_g.func_71024_bL().func_75114_a(p_147249_1_.func_149330_d());
- this.field_147299_f.field_71439_g.func_71024_bL().func_75119_b(p_147249_1_.func_149331_e());
- }
- public void func_147295_a(SPacketSetExperience p_147295_1_) {
- PacketThreadUtil.func_180031_a(p_147295_1_, this, this.field_147299_f);
- 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());
- }
- public void func_147280_a(SPacketRespawn p_147280_1_) {
- PacketThreadUtil.func_180031_a(p_147280_1_, this, this.field_147299_f);
- if(p_147280_1_.func_149082_c() != this.field_147299_f.field_71439_g.field_71093_bK) {
- this.field_147309_h = false;
- Scoreboard scoreboard = this.field_147300_g.func_96441_U();
- 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);
- this.field_147300_g.func_96443_a(scoreboard);
- this.field_147299_f.func_71403_a(this.field_147300_g);
- this.field_147299_f.field_71439_g.field_71093_bK = p_147280_1_.func_149082_c();
- this.field_147299_f.func_147108_a(new GuiDownloadTerrain(this));
- }
- this.field_147299_f.func_71354_a(p_147280_1_.func_149082_c());
- this.field_147299_f.field_71442_b.func_78746_a(p_147280_1_.func_149083_e());
- }
- public void func_147283_a(SPacketExplosion p_147283_1_) {
- PacketThreadUtil.func_180031_a(p_147283_1_, this, this.field_147299_f);
- 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());
- explosion.func_77279_a(true);
- this.field_147299_f.field_71439_g.field_70159_w += (double)p_147283_1_.func_149149_c();
- this.field_147299_f.field_71439_g.field_70181_x += (double)p_147283_1_.func_149144_d();
- this.field_147299_f.field_71439_g.field_70179_y += (double)p_147283_1_.func_149147_e();
- }
- public void func_147265_a(SPacketOpenWindow p_147265_1_) {
- PacketThreadUtil.func_180031_a(p_147265_1_, this, this.field_147299_f);
- EntityPlayerSP entityplayersp = this.field_147299_f.field_71439_g;
- if("minecraft:container".equals(p_147265_1_.func_148902_e())) {
- entityplayersp.func_71007_a(new InventoryBasic(p_147265_1_.func_179840_c(), p_147265_1_.func_148898_f()));
- entityplayersp.field_71070_bA.field_75152_c = p_147265_1_.func_148901_c();
- } else if("minecraft:villager".equals(p_147265_1_.func_148902_e())) {
- entityplayersp.func_180472_a(new NpcMerchant(entityplayersp, p_147265_1_.func_179840_c()));
- entityplayersp.field_71070_bA.field_75152_c = p_147265_1_.func_148901_c();
- } else if("EntityHorse".equals(p_147265_1_.func_148902_e())) {
- Entity entity = this.field_147300_g.func_73045_a(p_147265_1_.func_148897_h());
- if(entity instanceof AbstractHorse) {
- entityplayersp.func_184826_a((AbstractHorse)entity, new ContainerHorseChest(p_147265_1_.func_179840_c(), p_147265_1_.func_148898_f()));
- entityplayersp.field_71070_bA.field_75152_c = p_147265_1_.func_148901_c();
- }
- } else if(!p_147265_1_.func_148900_g()) {
- entityplayersp.func_180468_a(new LocalBlockIntercommunication(p_147265_1_.func_148902_e(), p_147265_1_.func_179840_c()));
- entityplayersp.field_71070_bA.field_75152_c = p_147265_1_.func_148901_c();
- } else {
- IInventory iinventory = new ContainerLocalMenu(p_147265_1_.func_148902_e(), p_147265_1_.func_179840_c(), p_147265_1_.func_148898_f());
- entityplayersp.func_71007_a(iinventory);
- entityplayersp.field_71070_bA.field_75152_c = p_147265_1_.func_148901_c();
- }
- }
- public void func_147266_a(SPacketSetSlot p_147266_1_) {
- PacketThreadUtil.func_180031_a(p_147266_1_, this, this.field_147299_f);
- EntityPlayer entityplayer = this.field_147299_f.field_71439_g;
- ItemStack itemstack = p_147266_1_.func_149174_e();
- int i = p_147266_1_.func_149173_d();
- this.field_147299_f.func_193032_ao().func_193301_a(itemstack);
- if(p_147266_1_.func_149175_c() == -1) {
- entityplayer.field_71071_by.func_70437_b(itemstack);
- } else if(p_147266_1_.func_149175_c() == -2) {
- entityplayer.field_71071_by.func_70299_a(i, itemstack);
- } else {
- boolean flag = false;
- if(this.field_147299_f.field_71462_r instanceof GuiContainerCreative) {
- GuiContainerCreative guicontainercreative = (GuiContainerCreative)this.field_147299_f.field_71462_r;
- flag = guicontainercreative.func_147056_g() != CreativeTabs.field_78036_m.func_78021_a();
- }
- if(p_147266_1_.func_149175_c() == 0 && p_147266_1_.func_149173_d() >= 36 && i < 45) {
- if(!itemstack.func_190926_b()) {
- ItemStack itemstack1 = entityplayer.field_71069_bz.func_75139_a(i).func_75211_c();
- if(itemstack1.func_190926_b() || itemstack1.func_190916_E() < itemstack.func_190916_E()) {
- itemstack.func_190915_d(5);
- }
- }
- entityplayer.field_71069_bz.func_75141_a(i, itemstack);
- } else if(p_147266_1_.func_149175_c() == entityplayer.field_71070_bA.field_75152_c && (p_147266_1_.func_149175_c() != 0 || !flag)) {
- entityplayer.field_71070_bA.func_75141_a(i, itemstack);
- }
- }
- }
- public void func_147239_a(SPacketConfirmTransaction p_147239_1_) {
- PacketThreadUtil.func_180031_a(p_147239_1_, this, this.field_147299_f);
- Container container = null;
- EntityPlayer entityplayer = this.field_147299_f.field_71439_g;
- if(p_147239_1_.func_148889_c() == 0) {
- container = entityplayer.field_71069_bz;
- } else if(p_147239_1_.func_148889_c() == entityplayer.field_71070_bA.field_75152_c) {
- container = entityplayer.field_71070_bA;
- }
- if(container != null && !p_147239_1_.func_148888_e()) {
- this.func_147297_a(new CPacketConfirmTransaction(p_147239_1_.func_148889_c(), p_147239_1_.func_148890_d(), true));
- }
- }
- public void func_147241_a(SPacketWindowItems p_147241_1_) {
- PacketThreadUtil.func_180031_a(p_147241_1_, this, this.field_147299_f);
- EntityPlayer entityplayer = this.field_147299_f.field_71439_g;
- if(p_147241_1_.func_148911_c() == 0) {
- entityplayer.field_71069_bz.func_190896_a(p_147241_1_.func_148910_d());
- } else if(p_147241_1_.func_148911_c() == entityplayer.field_71070_bA.field_75152_c) {
- entityplayer.field_71070_bA.func_190896_a(p_147241_1_.func_148910_d());
- }
- }
- public void func_147268_a(SPacketSignEditorOpen p_147268_1_) {
- PacketThreadUtil.func_180031_a(p_147268_1_, this, this.field_147299_f);
- TileEntity tileentity = this.field_147300_g.func_175625_s(p_147268_1_.func_179777_a());
- if(!(tileentity instanceof TileEntitySign)) {
- tileentity = new TileEntitySign();
- tileentity.func_145834_a(this.field_147300_g);
- tileentity.func_174878_a(p_147268_1_.func_179777_a());
- }
- this.field_147299_f.field_71439_g.func_175141_a((TileEntitySign)tileentity);
- }
- public void func_147273_a(SPacketUpdateTileEntity p_147273_1_) {
- PacketThreadUtil.func_180031_a(p_147273_1_, this, this.field_147299_f);
- if(this.field_147299_f.field_71441_e.func_175667_e(p_147273_1_.func_179823_a())) {
- TileEntity tileentity = this.field_147299_f.field_71441_e.func_175625_s(p_147273_1_.func_179823_a());
- int i = p_147273_1_.func_148853_f();
- boolean flag = i == 2 && tileentity instanceof TileEntityCommandBlock;
- 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) {
- tileentity.func_145839_a(p_147273_1_.func_148857_g());
- }
- if(flag && this.field_147299_f.field_71462_r instanceof GuiCommandBlock) {
- ((GuiCommandBlock)this.field_147299_f.field_71462_r).func_184075_a();
- }
- }
- }
- public void func_147245_a(SPacketWindowProperty p_147245_1_) {
- PacketThreadUtil.func_180031_a(p_147245_1_, this, this.field_147299_f);
- EntityPlayer entityplayer = this.field_147299_f.field_71439_g;
- if(entityplayer.field_71070_bA != null && entityplayer.field_71070_bA.field_75152_c == p_147245_1_.func_149182_c()) {
- entityplayer.field_71070_bA.func_75137_b(p_147245_1_.func_149181_d(), p_147245_1_.func_149180_e());
- }
- }
- public void func_147242_a(SPacketEntityEquipment p_147242_1_) {
- PacketThreadUtil.func_180031_a(p_147242_1_, this, this.field_147299_f);
- Entity entity = this.field_147300_g.func_73045_a(p_147242_1_.func_149389_d());
- if(entity != null) {
- entity.func_184201_a(p_147242_1_.func_186969_c(), p_147242_1_.func_149390_c());
- }
- }
- public void func_147276_a(SPacketCloseWindow p_147276_1_) {
- PacketThreadUtil.func_180031_a(p_147276_1_, this, this.field_147299_f);
- this.field_147299_f.field_71439_g.func_175159_q();
- }
- public void func_147261_a(SPacketBlockAction p_147261_1_) {
- PacketThreadUtil.func_180031_a(p_147261_1_, this, this.field_147299_f);
- 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());
- }
- public void func_147294_a(SPacketBlockBreakAnim p_147294_1_) {
- PacketThreadUtil.func_180031_a(p_147294_1_, this, this.field_147299_f);
- 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());
- }
- public void func_147252_a(SPacketChangeGameState p_147252_1_) {
- PacketThreadUtil.func_180031_a(p_147252_1_, this, this.field_147299_f);
- EntityPlayer entityplayer = this.field_147299_f.field_71439_g;
- int i = p_147252_1_.func_149138_c();
- float f = p_147252_1_.func_149137_d();
- int j = MathHelper.func_76141_d(f + 0.5F);
- if(i >= 0 && i < SPacketChangeGameState.field_149142_a.length && SPacketChangeGameState.field_149142_a[i] != null) {
- entityplayer.func_146105_b(new TextComponentTranslation(SPacketChangeGameState.field_149142_a[i], new Object[0]), false);
- }
- if(i == 1) {
- this.field_147300_g.func_72912_H().func_76084_b(true);
- this.field_147300_g.func_72894_k(0.0F);
- } else if(i == 2) {
- this.field_147300_g.func_72912_H().func_76084_b(false);
- this.field_147300_g.func_72894_k(1.0F);
- } else if(i == 3) {
- this.field_147299_f.field_71442_b.func_78746_a(GameType.func_77146_a(j));
- } else if(i == 4) {
- if(j == 0) {
- this.field_147299_f.field_71439_g.field_71174_a.func_147297_a(new CPacketClientStatus(CPacketClientStatus.State.PERFORM_RESPAWN));
- this.field_147299_f.func_147108_a(new GuiDownloadTerrain(this));
- } else if(j == 1) {
- this.field_147299_f.func_147108_a(new GuiWinGame(true, () -> {
- this.field_147299_f.field_71439_g.field_71174_a.func_147297_a(new CPacketClientStatus(CPacketClientStatus.State.PERFORM_RESPAWN));
- }));
- }
- } else if(i == 5) {
- GameSettings gamesettings = this.field_147299_f.field_71474_y;
- if(f == 0.0F) {
- this.field_147299_f.func_147108_a(new GuiScreenDemo());
- } else if(f == 101.0F) {
- 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())}));
- } else if(f == 102.0F) {
- 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())}));
- } else if(f == 103.0F) {
- 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())}));
- }
- } else if(i == 6) {
- 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);
- } else if(i == 7) {
- this.field_147300_g.func_72894_k(f);
- } else if(i == 8) {
- this.field_147300_g.func_147442_i(f);
- } else if(i == 10) {
- 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]);
- 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);
- }
- }
- public void func_147264_a(SPacketMaps p_147264_1_) {
- PacketThreadUtil.func_180031_a(p_147264_1_, this, this.field_147299_f);
- MapItemRenderer mapitemrenderer = this.field_147299_f.field_71460_t.func_147701_i();
- MapData mapdata = ItemMap.func_150912_a(p_147264_1_.func_149188_c(), this.field_147299_f.field_71441_e);
- if(mapdata == null) {
- String string = "map_" + p_147264_1_.func_149188_c();
- mapdata = new MapData(string);
- if(mapitemrenderer.func_191205_a(string) != null) {
- MapData mapdata1 = mapitemrenderer.func_191207_a(mapitemrenderer.func_191205_a(string));
- if(mapdata1 != null) {
- mapdata = mapdata1;
- }
- }
- this.field_147299_f.field_71441_e.func_72823_a(string, mapdata);
- }
- p_147264_1_.func_179734_a(mapdata);
- mapitemrenderer.func_148246_a(mapdata);
- }
- public void func_147277_a(SPacketEffect p_147277_1_) {
- PacketThreadUtil.func_180031_a(p_147277_1_, this, this.field_147299_f);
- if(p_147277_1_.func_149244_c()) {
- 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());
- } else {
- 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());
- }
- }
- public void func_191981_a(SPacketAdvancementInfo p_191981_1_) {
- PacketThreadUtil.func_180031_a(p_191981_1_, this, this.field_147299_f);
- this.field_191983_k.func_192799_a(p_191981_1_);
- }
- public void func_194022_a(SPacketSelectAdvancementsTab p_194022_1_) {
- PacketThreadUtil.func_180031_a(p_194022_1_, this, this.field_147299_f);
- ResourceLocation resourcelocation = p_194022_1_.func_194154_a();
- if(resourcelocation == null) {
- this.field_191983_k.func_194230_a((Advancement)null, false);
- } else {
- Advancement advancement = this.field_191983_k.func_194229_a().func_192084_a(resourcelocation);
- this.field_191983_k.func_194230_a(advancement, false);
- }
- }
- public void func_147293_a(SPacketStatistics p_147293_1_) {
- PacketThreadUtil.func_180031_a(p_147293_1_, this, this.field_147299_f);
- for(Entry<StatBase, Integer> entry : p_147293_1_.func_148974_c().entrySet()) {
- StatBase statbase = (StatBase)entry.getKey();
- int int = ((Integer)entry.getValue()).intValue();
- this.field_147299_f.field_71439_g.func_146107_m().func_150873_a(this.field_147299_f.field_71439_g, statbase, int);
- }
- this.field_147308_k = true;
- if(this.field_147299_f.field_71462_r instanceof IProgressMeter) {
- ((IProgressMeter)this.field_147299_f.field_71462_r).func_193026_g();
- }
- }
- public void func_191980_a(SPacketRecipeBook p_191980_1_) {
- RecipeBook recipebook;
- PacketThreadUtil.func_180031_a(p_191980_1_, this, this.field_147299_f);
- recipebook = this.field_147299_f.field_71439_g.func_192035_E();
- recipebook.func_192813_a(p_191980_1_.func_192593_c());
- recipebook.func_192810_b(p_191980_1_.func_192594_d());
- SPacketRecipeBook.State spacketrecipebook$state = p_191980_1_.func_194151_e();
- label0:
- switch(spacketrecipebook$state) {
- case REMOVE:
- Iterator iterator = p_191980_1_.func_192595_a().iterator();
- while(true) {
- if(!iterator.hasNext()) {
- break label0;
- }
- IRecipe irecipe = (IRecipe)iterator.next();
- recipebook.func_193831_b(irecipe);
- }
- case INIT:
- p_191980_1_.func_192595_a().forEach(recipebook::func_194073_a);
- p_191980_1_.func_193644_b().forEach(recipebook::func_193825_e);
- break;
- case ADD:
- p_191980_1_.func_192595_a().forEach((p_194025_2_) -> {
- lvt_2_1_.func_194073_a(p_194025_2_);
- lvt_2_1_.func_193825_e(p_194025_2_);
- RecipeToast.func_193665_a(this.field_147299_f.func_193033_an(), p_194025_2_);
- });
- }
- RecipeBookClient.field_194087_f.forEach((p_194023_1_) -> {
- p_194023_1_.func_194214_a(lvt_2_1_);
- });
- if(this.field_147299_f.field_71462_r instanceof IRecipeShownListener) {
- ((IRecipeShownListener)this.field_147299_f.field_71462_r).func_192043_J_();
- }
- }
- public void func_147260_a(SPacketEntityEffect p_147260_1_) {
- PacketThreadUtil.func_180031_a(p_147260_1_, this, this.field_147299_f);
- Entity entity = this.field_147300_g.func_73045_a(p_147260_1_.func_149426_d());
- if(entity instanceof EntityLivingBase) {
- Potion potion = Potion.func_188412_a(p_147260_1_.func_149427_e());
- if(potion != null) {
- 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());
- potioneffect.func_100012_b(p_147260_1_.func_149429_c());
- ((EntityLivingBase)entity).func_70690_d(potioneffect);
- }
- }
- }
- public void func_175098_a(SPacketCombatEvent p_175098_1_) {
- PacketThreadUtil.func_180031_a(p_175098_1_, this, this.field_147299_f);
- if(p_175098_1_.field_179776_a == SPacketCombatEvent.Event.ENTITY_DIED) {
- Entity entity = this.field_147300_g.func_73045_a(p_175098_1_.field_179774_b);
- if(entity == this.field_147299_f.field_71439_g) {
- this.field_147299_f.func_147108_a(new GuiGameOver(p_175098_1_.field_179773_e));
- }
- }
- }
- public void func_175101_a(SPacketServerDifficulty p_175101_1_) {
- PacketThreadUtil.func_180031_a(p_175101_1_, this, this.field_147299_f);
- this.field_147299_f.field_71441_e.func_72912_H().func_176144_a(p_175101_1_.func_179831_b());
- this.field_147299_f.field_71441_e.func_72912_H().func_180783_e(p_175101_1_.func_179830_a());
- }
- public void func_175094_a(SPacketCamera p_175094_1_) {
- PacketThreadUtil.func_180031_a(p_175094_1_, this, this.field_147299_f);
- Entity entity = p_175094_1_.func_179780_a(this.field_147300_g);
- if(entity != null) {
- this.field_147299_f.func_175607_a(entity);
- }
- }
- public void func_175093_a(SPacketWorldBorder p_175093_1_) {
- PacketThreadUtil.func_180031_a(p_175093_1_, this, this.field_147299_f);
- p_175093_1_.func_179788_a(this.field_147300_g.func_175723_af());
- }
- public void func_175099_a(SPacketTitle p_175099_1_) {
- PacketThreadUtil.func_180031_a(p_175099_1_, this, this.field_147299_f);
- SPacketTitle.Type spackettitle$type = p_175099_1_.func_179807_a();
- String string = null;
- String string1 = null;
- String string2 = p_175099_1_.func_179805_b() != null?p_175099_1_.func_179805_b().func_150254_d():"";
- switch(spackettitle$type) {
- case TITLE:
- string = string2;
- break;
- case SUBTITLE:
- string1 = string2;
- break;
- case ACTIONBAR:
- this.field_147299_f.field_71456_v.func_110326_a(string2, false);
- return;
- case RESET:
- this.field_147299_f.field_71456_v.func_175178_a("", "", -1, -1, -1);
- this.field_147299_f.field_71456_v.func_175177_a();
- return;
- }
- 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());
- }
- public void func_175096_a(SPacketPlayerListHeaderFooter p_175096_1_) {
- 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());
- 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());
- }
- public void func_147262_a(SPacketRemoveEntityEffect p_147262_1_) {
- PacketThreadUtil.func_180031_a(p_147262_1_, this, this.field_147299_f);
- Entity entity = p_147262_1_.func_186967_a(this.field_147300_g);
- if(entity instanceof EntityLivingBase) {
- ((EntityLivingBase)entity).func_184596_c(p_147262_1_.func_186968_a());
- }
- }
- public void func_147256_a(SPacketPlayerListItem p_147256_1_) {
- PacketThreadUtil.func_180031_a(p_147256_1_, this, this.field_147299_f);
- for(SPacketPlayerListItem.AddPlayerData spacketplayerlistitem$addplayerdata : p_147256_1_.func_179767_a()) {
- if(p_147256_1_.func_179768_b() == SPacketPlayerListItem.Action.REMOVE_PLAYER) {
- this.field_147310_i.remove(spacketplayerlistitem$addplayerdata.func_179962_a().getId());
- } else {
- NetworkPlayerInfo networkplayerinfo = (NetworkPlayerInfo)this.field_147310_i.get(spacketplayerlistitem$addplayerdata.func_179962_a().getId());
- if(p_147256_1_.func_179768_b() == SPacketPlayerListItem.Action.ADD_PLAYER) {
- networkplayerinfo = new NetworkPlayerInfo(spacketplayerlistitem$addplayerdata);
- this.field_147310_i.put(networkplayerinfo.func_178845_a().getId(), networkplayerinfo);
- }
- if(networkplayerinfo != null) {
- switch(p_147256_1_.func_179768_b()) {
- case ADD_PLAYER:
- networkplayerinfo.func_178839_a(spacketplayerlistitem$addplayerdata.func_179960_c());
- networkplayerinfo.func_178838_a(spacketplayerlistitem$addplayerdata.func_179963_b());
- break;
- case UPDATE_GAME_MODE:
- networkplayerinfo.func_178839_a(spacketplayerlistitem$addplayerdata.func_179960_c());
- break;
- case UPDATE_LATENCY:
- networkplayerinfo.func_178838_a(spacketplayerlistitem$addplayerdata.func_179963_b());
- break;
- case UPDATE_DISPLAY_NAME:
- networkplayerinfo.func_178859_a(spacketplayerlistitem$addplayerdata.func_179961_d());
- }
- }
- }
- }
- }
- public void func_147272_a(SPacketKeepAlive p_147272_1_) {
- this.func_147297_a(new CPacketKeepAlive(p_147272_1_.func_149134_c()));
- }
- public void func_147270_a(SPacketPlayerAbilities p_147270_1_) {
- PacketThreadUtil.func_180031_a(p_147270_1_, this, this.field_147299_f);
- EntityPlayer entityplayer = this.field_147299_f.field_71439_g;
- entityplayer.field_71075_bZ.field_75100_b = p_147270_1_.func_149106_d();
- entityplayer.field_71075_bZ.field_75098_d = p_147270_1_.func_149103_f();
- entityplayer.field_71075_bZ.field_75102_a = p_147270_1_.func_149112_c();
- entityplayer.field_71075_bZ.field_75101_c = p_147270_1_.func_149105_e();
- entityplayer.field_71075_bZ.func_75092_a(p_147270_1_.func_149101_g());
- entityplayer.field_71075_bZ.func_82877_b(p_147270_1_.func_149107_h());
- }
- public void func_147274_a(SPacketTabComplete p_147274_1_) {
- PacketThreadUtil.func_180031_a(p_147274_1_, this, this.field_147299_f);
- String[] astring = p_147274_1_.func_149630_c();
- Arrays.sort((Object[])astring);
- if(this.field_147299_f.field_71462_r instanceof ITabCompleter) {
- ((ITabCompleter)this.field_147299_f.field_71462_r).func_184072_a(astring);
- }
- }
- public void func_184327_a(SPacketSoundEffect p_184327_1_) {
- PacketThreadUtil.func_180031_a(p_184327_1_, this, this.field_147299_f);
- 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());
- }
- public void func_184329_a(SPacketCustomSound p_184329_1_) {
- PacketThreadUtil.func_180031_a(p_184329_1_, this, this.field_147299_f);
- 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()));
- }
- public void func_175095_a(SPacketResourcePackSend p_175095_1_) {
- final String string = p_175095_1_.func_179783_a();
- final String string1 = p_175095_1_.func_179784_b();
- if(this.func_189688_b(string)) {
- if(string.startsWith("level://")) {
- try {
- String string2 = URLDecoder.decode(string.substring("level://".length()), StandardCharsets.UTF_8.toString());
- File file = new File(this.field_147299_f.field_71412_D, "saves");
- File file1 = new File(file, string2);
- if(file1.isFile()) {
- this.field_147302_e.func_179290_a(new CPacketResourcePackStatus(CPacketResourcePackStatus.Action.ACCEPTED));
- Futures.addCallback(this.field_147299_f.func_110438_M().func_177319_a(file1), this.func_189686_f());
- return;
- }
- } catch (UnsupportedEncodingException var7) {
- ;
- }
- this.field_147302_e.func_179290_a(new CPacketResourcePackStatus(CPacketResourcePackStatus.Action.FAILED_DOWNLOAD));
- } else {
- ServerData serverdata = this.field_147299_f.func_147104_D();
- if(serverdata != null && serverdata.func_152586_b() == ServerData.ServerResourceMode.ENABLED) {
- this.field_147302_e.func_179290_a(new CPacketResourcePackStatus(CPacketResourcePackStatus.Action.ACCEPTED));
- Futures.addCallback(this.field_147299_f.func_110438_M().func_180601_a(string, string1), this.func_189686_f());
- } else if(serverdata != null && serverdata.func_152586_b() != ServerData.ServerResourceMode.PROMPT) {
- this.field_147302_e.func_179290_a(new CPacketResourcePackStatus(CPacketResourcePackStatus.Action.DECLINED));
- } else {
- this.field_147299_f.func_152344_a(new Runnable() {
- public void run() {
- NetHandlerPlayClient.this.field_147299_f.func_147108_a(new GuiYesNo(new GuiYesNoCallback() {
- public void func_73878_a(boolean p_73878_1_, int p_73878_2_) {
- NetHandlerPlayClient.this.field_147299_f = Minecraft.func_71410_x();
- ServerData serverdata1 = NetHandlerPlayClient.this.field_147299_f.func_147104_D();
- if(p_73878_1_) {
- if(serverdata1 != null) {
- serverdata1.func_152584_a(ServerData.ServerResourceMode.ENABLED);
- }
- NetHandlerPlayClient.this.field_147302_e.func_179290_a(new CPacketResourcePackStatus(CPacketResourcePackStatus.Action.ACCEPTED));
- Futures.addCallback(NetHandlerPlayClient.this.field_147299_f.func_110438_M().func_180601_a(string, string1), NetHandlerPlayClient.this.func_189686_f());
- } else {
- if(serverdata1 != null) {
- serverdata1.func_152584_a(ServerData.ServerResourceMode.DISABLED);
- }
- NetHandlerPlayClient.this.field_147302_e.func_179290_a(new CPacketResourcePackStatus(CPacketResourcePackStatus.Action.DECLINED));
- }
- ServerList.func_147414_b(serverdata1);
- NetHandlerPlayClient.this.field_147299_f.func_147108_a((GuiScreen)null);
- }
- }, I18n.func_135052_a("multiplayer.texturePrompt.line1", new Object[0]), I18n.func_135052_a("multiplayer.texturePrompt.line2", new Object[0]), 0));
- }
- });
- }
- }
- }
- }
- private boolean func_189688_b(String p_189688_1_) {
- try {
- URI uri = new URI(p_189688_1_);
- String string = uri.getScheme();
- boolean boolean = "level".equals(string);
- if(!"http".equals(string) && !"https".equals(string) && !boolean) {
- throw new URISyntaxException(p_189688_1_, "Wrong protocol");
- } else if(!boolean || !p_189688_1_.contains("..") && p_189688_1_.endsWith("/resources.zip")) {
- return true;
- } else {
- throw new URISyntaxException(p_189688_1_, "Invalid levelstorage resourcepack path");
- }
- } catch (URISyntaxException var5) {
- this.field_147302_e.func_179290_a(new CPacketResourcePackStatus(CPacketResourcePackStatus.Action.FAILED_DOWNLOAD));
- return false;
- }
- }
- private FutureCallback<Object> func_189686_f() {
- return new FutureCallback<Object>() {
- public void onSuccess(@Nullable Object p_onSuccess_1_) {
- NetHandlerPlayClient.this.field_147302_e.func_179290_a(new CPacketResourcePackStatus(CPacketResourcePackStatus.Action.SUCCESSFULLY_LOADED));
- }
- public void onFailure(Throwable p_onFailure_1_) {
- NetHandlerPlayClient.this.field_147302_e.func_179290_a(new CPacketResourcePackStatus(CPacketResourcePackStatus.Action.FAILED_DOWNLOAD));
- }
- };
- }
- public void func_184325_a(SPacketUpdateBossInfo p_184325_1_) {
- PacketThreadUtil.func_180031_a(p_184325_1_, this, this.field_147299_f);
- this.field_147299_f.field_71456_v.func_184046_j().func_184055_a(p_184325_1_);
- }
- public void func_184324_a(SPacketCooldown p_184324_1_) {
- PacketThreadUtil.func_180031_a(p_184324_1_, this, this.field_147299_f);
- if(p_184324_1_.func_186922_b() == 0) {
- this.field_147299_f.field_71439_g.func_184811_cZ().func_185142_b(p_184324_1_.func_186920_a());
- } else {
- 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());
- }
- }
- public void func_184323_a(SPacketMoveVehicle p_184323_1_) {
- PacketThreadUtil.func_180031_a(p_184323_1_, this, this.field_147299_f);
- Entity entity = this.field_147299_f.field_71439_g.func_184208_bv();
- if(entity != this.field_147299_f.field_71439_g && entity.func_184186_bw()) {
- 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());
- this.field_147302_e.func_179290_a(new CPacketVehicleMove(entity));
- }
- }
- public void func_147240_a(SPacketCustomPayload p_147240_1_) {
- PacketThreadUtil.func_180031_a(p_147240_1_, this, this.field_147299_f);
- if("MC|TrList".equals(p_147240_1_.func_149169_c())) {
- PacketBuffer packetbuffer = p_147240_1_.func_180735_b();
- try {
- int int = packetbuffer.readInt();
- GuiScreen guiscreen = this.field_147299_f.field_71462_r;
- if(guiscreen != null && guiscreen instanceof GuiMerchant && int == this.field_147299_f.field_71439_g.field_71070_bA.field_75152_c) {
- IMerchant imerchant = ((GuiMerchant)guiscreen).func_147035_g();
- MerchantRecipeList merchantrecipelist = MerchantRecipeList.func_151390_b(packetbuffer);
- imerchant.func_70930_a(merchantrecipelist);
- }
- } catch (IOException ioexception) {
- field_147301_d.error((String)"Couldn\'t load trade info", (Throwable)ioexception);
- } finally {
- packetbuffer.release();
- }
- } else if("MC|Brand".equals(p_147240_1_.func_149169_c())) {
- this.field_147299_f.field_71439_g.func_175158_f(p_147240_1_.func_180735_b().func_150789_c(32767));
- } else if("MC|BOpen".equals(p_147240_1_.func_149169_c())) {
- EnumHand enumhand = (EnumHand)p_147240_1_.func_180735_b().func_179257_a(EnumHand.class);
- 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();
- if(itemstack.func_77973_b() == Items.field_151164_bB) {
- this.field_147299_f.func_147108_a(new GuiScreenBook(this.field_147299_f.field_71439_g, itemstack, false));
- }
- } else if("MC|DebugPath".equals(p_147240_1_.func_149169_c())) {
- PacketBuffer packetbuffer1 = p_147240_1_.func_180735_b();
- int int = packetbuffer1.readInt();
- float float = packetbuffer1.readFloat();
- Path path = Path.func_186311_b(packetbuffer1);
- ((DebugRendererPathfinding)this.field_147299_f.field_184132_p.field_188286_a).func_188289_a(int, path, float);
- } else if("MC|DebugNeighborsUpdate".equals(p_147240_1_.func_149169_c())) {
- PacketBuffer packetbuffer2 = p_147240_1_.func_180735_b();
- long long = packetbuffer2.func_179260_f();
- BlockPos blockpos = packetbuffer2.func_179259_c();
- ((DebugRendererNeighborsUpdate)this.field_147299_f.field_184132_p.field_191557_f).func_191553_a(long, blockpos);
- } else if("MC|StopSound".equals(p_147240_1_.func_149169_c())) {
- PacketBuffer packetbuffer3 = p_147240_1_.func_180735_b();
- String string = packetbuffer3.func_150789_c(32767);
- String string1 = packetbuffer3.func_150789_c(256);
- this.field_147299_f.func_147118_V().func_189520_a(string1, SoundCategory.func_187950_a(string));
- }
- }
- public void func_147291_a(SPacketScoreboardObjective p_147291_1_) {
- PacketThreadUtil.func_180031_a(p_147291_1_, this, this.field_147299_f);
- Scoreboard scoreboard = this.field_147300_g.func_96441_U();
- if(p_147291_1_.func_149338_e() == 0) {
- ScoreObjective scoreobjective = scoreboard.func_96535_a(p_147291_1_.func_149339_c(), IScoreCriteria.field_96641_b);
- scoreobjective.func_96681_a(p_147291_1_.func_149337_d());
- scoreobjective.func_178767_a(p_147291_1_.func_179817_d());
- } else {
- ScoreObjective scoreobjective1 = scoreboard.func_96518_b(p_147291_1_.func_149339_c());
- if(p_147291_1_.func_149338_e() == 1) {
- scoreboard.func_96519_k(scoreobjective1);
- } else if(p_147291_1_.func_149338_e() == 2) {
- scoreobjective1.func_96681_a(p_147291_1_.func_149337_d());
- scoreobjective1.func_178767_a(p_147291_1_.func_179817_d());
- }
- }
- }
- public void func_147250_a(SPacketUpdateScore p_147250_1_) {
- PacketThreadUtil.func_180031_a(p_147250_1_, this, this.field_147299_f);
- Scoreboard scoreboard = this.field_147300_g.func_96441_U();
- ScoreObjective scoreobjective = scoreboard.func_96518_b(p_147250_1_.func_149321_d());
- if(p_147250_1_.func_180751_d() == SPacketUpdateScore.Action.CHANGE) {
- Score score = scoreboard.func_96529_a(p_147250_1_.func_149324_c(), scoreobjective);
- score.func_96647_c(p_147250_1_.func_149323_e());
- } else if(p_147250_1_.func_180751_d() == SPacketUpdateScore.Action.REMOVE) {
- if(StringUtils.func_151246_b(p_147250_1_.func_149321_d())) {
- scoreboard.func_178822_d(p_147250_1_.func_149324_c(), (ScoreObjective)null);
- } else if(scoreobjective != null) {
- scoreboard.func_178822_d(p_147250_1_.func_149324_c(), scoreobjective);
- }
- }
- }
- public void func_147254_a(SPacketDisplayObjective p_147254_1_) {
- PacketThreadUtil.func_180031_a(p_147254_1_, this, this.field_147299_f);
- Scoreboard scoreboard = this.field_147300_g.func_96441_U();
- if(p_147254_1_.func_149370_d().isEmpty()) {
- scoreboard.func_96530_a(p_147254_1_.func_149371_c(), (ScoreObjective)null);
- } else {
- ScoreObjective scoreobjective = scoreboard.func_96518_b(p_147254_1_.func_149370_d());
- scoreboard.func_96530_a(p_147254_1_.func_149371_c(), scoreobjective);
- }
- }
- public void func_147247_a(SPacketTeams p_147247_1_) {
- PacketThreadUtil.func_180031_a(p_147247_1_, this, this.field_147299_f);
- Scoreboard scoreboard = this.field_147300_g.func_96441_U();
- ScorePlayerTeam scoreplayerteam;
- if(p_147247_1_.func_149307_h() == 0) {
- scoreplayerteam = scoreboard.func_96527_f(p_147247_1_.func_149312_c());
- } else {
- scoreplayerteam = scoreboard.func_96508_e(p_147247_1_.func_149312_c());
- }
- if(p_147247_1_.func_149307_h() == 0 || p_147247_1_.func_149307_h() == 2) {
- scoreplayerteam.func_96664_a(p_147247_1_.func_149306_d());
- scoreplayerteam.func_96666_b(p_147247_1_.func_149311_e());
- scoreplayerteam.func_96662_c(p_147247_1_.func_149309_f());
- scoreplayerteam.func_178774_a(TextFormatting.func_175744_a(p_147247_1_.func_179813_h()));
- scoreplayerteam.func_98298_a(p_147247_1_.func_149308_i());
- Team.EnumVisible team$enumvisible = Team.EnumVisible.func_178824_a(p_147247_1_.func_179814_i());
- if(team$enumvisible != null) {
- scoreplayerteam.func_178772_a(team$enumvisible);
- }
- Team.CollisionRule team$collisionrule = Team.CollisionRule.func_186686_a(p_147247_1_.func_186975_j());
- if(team$collisionrule != null) {
- scoreplayerteam.func_186682_a(team$collisionrule);
- }
- }
- if(p_147247_1_.func_149307_h() == 0 || p_147247_1_.func_149307_h() == 3) {
- for(String string : p_147247_1_.func_149310_g()) {
- scoreboard.func_151392_a(string, p_147247_1_.func_149312_c());
- }
- }
- if(p_147247_1_.func_149307_h() == 4) {
- for(String string1 : p_147247_1_.func_149310_g()) {
- scoreboard.func_96512_b(string1, scoreplayerteam);
- }
- }
- if(p_147247_1_.func_149307_h() == 1) {
- scoreboard.func_96511_d(scoreplayerteam);
- }
- }
- public void func_147289_a(SPacketParticles p_147289_1_) {
- PacketThreadUtil.func_180031_a(p_147289_1_, this, this.field_147299_f);
- if(p_147289_1_.func_149222_k() == 0) {
- double double = (double)(p_147289_1_.func_149227_j() * p_147289_1_.func_149221_g());
- double double = (double)(p_147289_1_.func_149227_j() * p_147289_1_.func_149224_h());
- double double = (double)(p_147289_1_.func_149227_j() * p_147289_1_.func_149223_i());
- try {
- 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());
- } catch (Throwable var17) {
- field_147301_d.warn((String)"Could not spawn particle effect {}", (Object)p_147289_1_.func_179749_a());
- }
- } else {
- for(int int = 0; int < p_147289_1_.func_149222_k(); ++int) {
- double double = this.field_147306_l.nextGaussian() * (double)p_147289_1_.func_149221_g();
- double double = this.field_147306_l.nextGaussian() * (double)p_147289_1_.func_149224_h();
- double double = this.field_147306_l.nextGaussian() * (double)p_147289_1_.func_149223_i();
- double double = this.field_147306_l.nextGaussian() * (double)p_147289_1_.func_149227_j();
- double double = this.field_147306_l.nextGaussian() * (double)p_147289_1_.func_149227_j();
- double double = this.field_147306_l.nextGaussian() * (double)p_147289_1_.func_149227_j();
- try {
- 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());
- } catch (Throwable var16) {
- field_147301_d.warn((String)"Could not spawn particle effect {}", (Object)p_147289_1_.func_179749_a());
- return;
- }
- }
- }
- }
- public void func_147290_a(SPacketEntityProperties p_147290_1_) {
- PacketThreadUtil.func_180031_a(p_147290_1_, this, this.field_147299_f);
- Entity entity = this.field_147300_g.func_73045_a(p_147290_1_.func_149442_c());
- if(entity != null) {
- if(!(entity instanceof EntityLivingBase)) {
- throw new IllegalStateException("Server tried to update attributes of a non-living entity (actually: " + entity + ")");
- } else {
- AbstractAttributeMap abstractattributemap = ((EntityLivingBase)entity).func_110140_aT();
- for(SPacketEntityProperties.Snapshot spacketentityproperties$snapshot : p_147290_1_.func_149441_d()) {
- IAttributeInstance iattributeinstance = abstractattributemap.func_111152_a(spacketentityproperties$snapshot.func_151409_a());
- if(iattributeinstance == null) {
- iattributeinstance = abstractattributemap.func_111150_b(new RangedAttribute((IAttribute)null, spacketentityproperties$snapshot.func_151409_a(), 0.0D, 2.2250738585072014E-308D, Double.MAX_VALUE));
- }
- iattributeinstance.func_111128_a(spacketentityproperties$snapshot.func_151410_b());
- iattributeinstance.func_142049_d();
- for(AttributeModifier attributemodifier : spacketentityproperties$snapshot.func_151408_c()) {
- iattributeinstance.func_111121_a(attributemodifier);
- }
- }
- }
- }
- }
- public NetworkManager func_147298_b() {
- return this.field_147302_e;
- }
- public Collection<NetworkPlayerInfo> func_175106_d() {
- return this.field_147310_i.values();
- }
- public NetworkPlayerInfo func_175102_a(UUID p_175102_1_) {
- return (NetworkPlayerInfo)this.field_147310_i.get(p_175102_1_);
- }
- @Nullable
- public NetworkPlayerInfo func_175104_a(String p_175104_1_) {
- for(NetworkPlayerInfo networkplayerinfo : this.field_147310_i.values()) {
- if(networkplayerinfo.func_178845_a().getName().equals(p_175104_1_)) {
- return networkplayerinfo;
- }
- }
- return null;
- }
- public GameProfile func_175105_e() {
- return this.field_175107_d;
- }
- public ClientAdvancementManager func_191982_f() {
- return this.field_191983_k;
- }
- }
- Patching failed: minecraft\net\minecraft\client\particle\ParticleManager.java
- Hunk 1 failed! Cannot find hunk target
- GlStateManager.func_187401_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
- GlStateManager.func_179092_a(516, 0.003921569F);
- - for(final int i = 0; i < 3; ++i) {
- + for(int i_nf = 0; i_nf < 3; ++i_nf) {
- + final int i = i_nf;
- for(int j = 0; j < 2; ++j) {
- if (!this.field_78876_b[i][j].isEmpty()) {
- switch(j) {
- File state
- package net.minecraft.client.particle;
- import com.google.common.collect.Lists;
- import com.google.common.collect.Maps;
- import com.google.common.collect.Queues;
- import java.util.ArrayDeque;
- import java.util.Iterator;
- import java.util.List;
- import java.util.Map;
- import java.util.Queue;
- import java.util.Random;
- import javax.annotation.Nullable;
- import net.minecraft.block.material.Material;
- import net.minecraft.block.state.IBlockState;
- import net.minecraft.client.particle.Barrier;
- import net.minecraft.client.particle.IParticleFactory;
- import net.minecraft.client.particle.Particle;
- import net.minecraft.client.particle.ParticleBlockDust;
- import net.minecraft.client.particle.ParticleBreaking;
- import net.minecraft.client.particle.ParticleBubble;
- import net.minecraft.client.particle.ParticleCloud;
- import net.minecraft.client.particle.ParticleCrit;
- import net.minecraft.client.particle.ParticleDigging;
- import net.minecraft.client.particle.ParticleDragonBreath;
- import net.minecraft.client.particle.ParticleDrip;
- import net.minecraft.client.particle.ParticleEmitter;
- import net.minecraft.client.particle.ParticleEnchantmentTable;
- import net.minecraft.client.particle.ParticleEndRod;
- import net.minecraft.client.particle.ParticleExplosion;
- import net.minecraft.client.particle.ParticleExplosionHuge;
- import net.minecraft.client.particle.ParticleExplosionLarge;
- import net.minecraft.client.particle.ParticleFallingDust;
- import net.minecraft.client.particle.ParticleFirework;
- import net.minecraft.client.particle.ParticleFlame;
- import net.minecraft.client.particle.ParticleFootStep;
- import net.minecraft.client.particle.ParticleHeart;
- import net.minecraft.client.particle.ParticleLava;
- import net.minecraft.client.particle.ParticleMobAppearance;
- import net.minecraft.client.particle.ParticleNote;
- import net.minecraft.client.particle.ParticlePortal;
- import net.minecraft.client.particle.ParticleRain;
- import net.minecraft.client.particle.ParticleRedstone;
- import net.minecraft.client.particle.ParticleSmokeLarge;
- import net.minecraft.client.particle.ParticleSmokeNormal;
- import net.minecraft.client.particle.ParticleSnowShovel;
- import net.minecraft.client.particle.ParticleSpell;
- import net.minecraft.client.particle.ParticleSpit;
- import net.minecraft.client.particle.ParticleSplash;
- import net.minecraft.client.particle.ParticleSuspend;
- import net.minecraft.client.particle.ParticleSuspendedTown;
- import net.minecraft.client.particle.ParticleSweepAttack;
- import net.minecraft.client.particle.ParticleTotem;
- import net.minecraft.client.particle.ParticleWaterWake;
- import net.minecraft.client.renderer.ActiveRenderInfo;
- import net.minecraft.client.renderer.BufferBuilder;
- import net.minecraft.client.renderer.GlStateManager;
- import net.minecraft.client.renderer.Tessellator;
- import net.minecraft.client.renderer.texture.TextureManager;
- import net.minecraft.client.renderer.texture.TextureMap;
- import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
- import net.minecraft.crash.CrashReport;
- import net.minecraft.crash.CrashReportCategory;
- import net.minecraft.crash.ICrashReportDetail;
- import net.minecraft.entity.Entity;
- import net.minecraft.util.EnumBlockRenderType;
- import net.minecraft.util.EnumFacing;
- import net.minecraft.util.EnumParticleTypes;
- import net.minecraft.util.ReportedException;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.util.math.AxisAlignedBB;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.util.math.MathHelper;
- import net.minecraft.world.World;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- @SideOnly(Side.CLIENT)
- public class ParticleManager {
- private static final ResourceLocation field_110737_b = new ResourceLocation("textures/particle/particles.png");
- protected World field_78878_a;
- private final ArrayDeque<Particle>[][] field_78876_b = new ArrayDeque[4][];
- private final Queue<ParticleEmitter> field_178933_d = Queues.<ParticleEmitter>newArrayDeque();
- private final TextureManager field_78877_c;
- private final Random field_78875_d = new Random();
- private final Map<Integer, IParticleFactory> field_178932_g = Maps.<Integer, IParticleFactory>newHashMap();
- private final Queue<Particle> field_187241_h = Queues.<Particle>newArrayDeque();
- public ParticleManager(World p_i1220_1_, TextureManager p_i1220_2_) {
- this.field_78878_a = p_i1220_1_;
- this.field_78877_c = p_i1220_2_;
- for(int i = 0; i < 4; ++i) {
- this.field_78876_b[i] = new ArrayDeque[2];
- for(int j = 0; j < 2; ++j) {
- this.field_78876_b[i][j] = Queues.newArrayDeque();
- }
- }
- this.func_178930_c();
- }
- private void func_178930_c() {
- this.func_178929_a(EnumParticleTypes.EXPLOSION_NORMAL.func_179348_c(), new ParticleExplosion.Factory());
- this.func_178929_a(EnumParticleTypes.SPIT.func_179348_c(), new ParticleSpit.Factory());
- this.func_178929_a(EnumParticleTypes.WATER_BUBBLE.func_179348_c(), new ParticleBubble.Factory());
- this.func_178929_a(EnumParticleTypes.WATER_SPLASH.func_179348_c(), new ParticleSplash.Factory());
- this.func_178929_a(EnumParticleTypes.WATER_WAKE.func_179348_c(), new ParticleWaterWake.Factory());
- this.func_178929_a(EnumParticleTypes.WATER_DROP.func_179348_c(), new ParticleRain.Factory());
- this.func_178929_a(EnumParticleTypes.SUSPENDED.func_179348_c(), new ParticleSuspend.Factory());
- this.func_178929_a(EnumParticleTypes.SUSPENDED_DEPTH.func_179348_c(), new ParticleSuspendedTown.Factory());
- this.func_178929_a(EnumParticleTypes.CRIT.func_179348_c(), new ParticleCrit.Factory());
- this.func_178929_a(EnumParticleTypes.CRIT_MAGIC.func_179348_c(), new ParticleCrit.MagicFactory());
- this.func_178929_a(EnumParticleTypes.SMOKE_NORMAL.func_179348_c(), new ParticleSmokeNormal.Factory());
- this.func_178929_a(EnumParticleTypes.SMOKE_LARGE.func_179348_c(), new ParticleSmokeLarge.Factory());
- this.func_178929_a(EnumParticleTypes.SPELL.func_179348_c(), new ParticleSpell.Factory());
- this.func_178929_a(EnumParticleTypes.SPELL_INSTANT.func_179348_c(), new ParticleSpell.InstantFactory());
- this.func_178929_a(EnumParticleTypes.SPELL_MOB.func_179348_c(), new ParticleSpell.MobFactory());
- this.func_178929_a(EnumParticleTypes.SPELL_MOB_AMBIENT.func_179348_c(), new ParticleSpell.AmbientMobFactory());
- this.func_178929_a(EnumParticleTypes.SPELL_WITCH.func_179348_c(), new ParticleSpell.WitchFactory());
- this.func_178929_a(EnumParticleTypes.DRIP_WATER.func_179348_c(), new ParticleDrip.WaterFactory());
- this.func_178929_a(EnumParticleTypes.DRIP_LAVA.func_179348_c(), new ParticleDrip.LavaFactory());
- this.func_178929_a(EnumParticleTypes.VILLAGER_ANGRY.func_179348_c(), new ParticleHeart.AngryVillagerFactory());
- this.func_178929_a(EnumParticleTypes.VILLAGER_HAPPY.func_179348_c(), new ParticleSuspendedTown.HappyVillagerFactory());
- this.func_178929_a(EnumParticleTypes.TOWN_AURA.func_179348_c(), new ParticleSuspendedTown.Factory());
- this.func_178929_a(EnumParticleTypes.NOTE.func_179348_c(), new ParticleNote.Factory());
- this.func_178929_a(EnumParticleTypes.PORTAL.func_179348_c(), new ParticlePortal.Factory());
- this.func_178929_a(EnumParticleTypes.ENCHANTMENT_TABLE.func_179348_c(), new ParticleEnchantmentTable.EnchantmentTable());
- this.func_178929_a(EnumParticleTypes.FLAME.func_179348_c(), new ParticleFlame.Factory());
- this.func_178929_a(EnumParticleTypes.LAVA.func_179348_c(), new ParticleLava.Factory());
- this.func_178929_a(EnumParticleTypes.FOOTSTEP.func_179348_c(), new ParticleFootStep.Factory());
- this.func_178929_a(EnumParticleTypes.CLOUD.func_179348_c(), new ParticleCloud.Factory());
- this.func_178929_a(EnumParticleTypes.REDSTONE.func_179348_c(), new ParticleRedstone.Factory());
- this.func_178929_a(EnumParticleTypes.FALLING_DUST.func_179348_c(), new ParticleFallingDust.Factory());
- this.func_178929_a(EnumParticleTypes.SNOWBALL.func_179348_c(), new ParticleBreaking.SnowballFactory());
- this.func_178929_a(EnumParticleTypes.SNOW_SHOVEL.func_179348_c(), new ParticleSnowShovel.Factory());
- this.func_178929_a(EnumParticleTypes.SLIME.func_179348_c(), new ParticleBreaking.SlimeFactory());
- this.func_178929_a(EnumParticleTypes.HEART.func_179348_c(), new ParticleHeart.Factory());
- this.func_178929_a(EnumParticleTypes.BARRIER.func_179348_c(), new Barrier.Factory());
- this.func_178929_a(EnumParticleTypes.ITEM_CRACK.func_179348_c(), new ParticleBreaking.Factory());
- this.func_178929_a(EnumParticleTypes.BLOCK_CRACK.func_179348_c(), new ParticleDigging.Factory());
- this.func_178929_a(EnumParticleTypes.BLOCK_DUST.func_179348_c(), new ParticleBlockDust.Factory());
- this.func_178929_a(EnumParticleTypes.EXPLOSION_HUGE.func_179348_c(), new ParticleExplosionHuge.Factory());
- this.func_178929_a(EnumParticleTypes.EXPLOSION_LARGE.func_179348_c(), new ParticleExplosionLarge.Factory());
- this.func_178929_a(EnumParticleTypes.FIREWORKS_SPARK.func_179348_c(), new ParticleFirework.Factory());
- this.func_178929_a(EnumParticleTypes.MOB_APPEARANCE.func_179348_c(), new ParticleMobAppearance.Factory());
- this.func_178929_a(EnumParticleTypes.DRAGON_BREATH.func_179348_c(), new ParticleDragonBreath.Factory());
- this.func_178929_a(EnumParticleTypes.END_ROD.func_179348_c(), new ParticleEndRod.Factory());
- this.func_178929_a(EnumParticleTypes.DAMAGE_INDICATOR.func_179348_c(), new ParticleCrit.DamageIndicatorFactory());
- this.func_178929_a(EnumParticleTypes.SWEEP_ATTACK.func_179348_c(), new ParticleSweepAttack.Factory());
- this.func_178929_a(EnumParticleTypes.TOTEM.func_179348_c(), new ParticleTotem.Factory());
- }
- public void func_178929_a(int p_178929_1_, IParticleFactory p_178929_2_) {
- this.field_178932_g.put(Integer.valueOf(p_178929_1_), p_178929_2_);
- }
- public void func_178926_a(Entity p_178926_1_, EnumParticleTypes p_178926_2_) {
- this.field_178933_d.add(new ParticleEmitter(this.field_78878_a, p_178926_1_, p_178926_2_));
- }
- public void func_191271_a(Entity p_191271_1_, EnumParticleTypes p_191271_2_, int p_191271_3_) {
- this.field_178933_d.add(new ParticleEmitter(this.field_78878_a, p_191271_1_, p_191271_2_, p_191271_3_));
- }
- @Nullable
- 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_) {
- IParticleFactory iparticlefactory = (IParticleFactory)this.field_178932_g.get(Integer.valueOf(p_178927_1_));
- if(iparticlefactory != null) {
- 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_);
- if(particle != null) {
- this.func_78873_a(particle);
- return particle;
- }
- }
- return null;
- }
- public void func_78873_a(Particle p_78873_1_) {
- this.field_187241_h.add(p_78873_1_);
- }
- public void func_78868_a() {
- for(int i = 0; i < 4; ++i) {
- this.func_178922_a(i);
- }
- if(!this.field_178933_d.isEmpty()) {
- List<ParticleEmitter> list = Lists.<ParticleEmitter>newArrayList();
- for(ParticleEmitter particleemitter : this.field_178933_d) {
- particleemitter.func_189213_a();
- if(!particleemitter.func_187113_k()) {
- list.add(particleemitter);
- }
- }
- this.field_178933_d.removeAll(list);
- }
- if(!this.field_187241_h.isEmpty()) {
- for(Particle particle = (Particle)this.field_187241_h.poll(); particle != null; particle = (Particle)this.field_187241_h.poll()) {
- int j = particle.func_70537_b();
- int k = particle.func_187111_c()?0:1;
- if(this.field_78876_b[j][k].size() >= 16384) {
- this.field_78876_b[j][k].removeFirst();
- }
- this.field_78876_b[j][k].add(particle);
- }
- }
- }
- private void func_178922_a(int p_178922_1_) {
- this.field_78878_a.field_72984_F.func_76320_a(p_178922_1_ + "");
- for(int i = 0; i < 2; ++i) {
- this.field_78878_a.field_72984_F.func_76320_a(i + "");
- this.func_187240_a(this.field_78876_b[p_178922_1_][i]);
- this.field_78878_a.field_72984_F.func_76319_b();
- }
- this.field_78878_a.field_72984_F.func_76319_b();
- }
- private void func_187240_a(Queue<Particle> p_187240_1_) {
- if(!p_187240_1_.isEmpty()) {
- Iterator<Particle> iterator = p_187240_1_.iterator();
- while(iterator.hasNext()) {
- Particle particle = (Particle)iterator.next();
- this.func_178923_d(particle);
- if(!particle.func_187113_k()) {
- iterator.remove();
- }
- }
- }
- }
- private void func_178923_d(final Particle p_178923_1_) {
- try {
- p_178923_1_.func_189213_a();
- } catch (Throwable throwable) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable, "Ticking Particle");
- CrashReportCategory crashreportcategory = crashreport.func_85058_a("Particle being ticked");
- final int i = p_178923_1_.func_70537_b();
- crashreportcategory.func_189529_a("Particle", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return p_178923_1_.toString();
- }
- });
- crashreportcategory.func_189529_a("Particle Type", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return i == 0?"MISC_TEXTURE":(i == 1?"TERRAIN_TEXTURE":(i == 3?"ENTITY_PARTICLE_TEXTURE":"Unknown - " + i));
- }
- });
- throw new ReportedException(crashreport);
- }
- }
- public void func_78874_a(Entity p_78874_1_, float p_78874_2_) {
- float f = ActiveRenderInfo.func_178808_b();
- float f1 = ActiveRenderInfo.func_178803_d();
- float f2 = ActiveRenderInfo.func_178805_e();
- float f3 = ActiveRenderInfo.func_178807_f();
- float f4 = ActiveRenderInfo.func_178809_c();
- 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_;
- 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_;
- 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_;
- Particle.field_190016_K = p_78874_1_.func_70676_i(p_78874_2_);
- GlStateManager.func_179147_l();
- GlStateManager.func_187401_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
- GlStateManager.func_179092_a(516, 0.003921569F);
- for(final int i = 0; i < 3; ++i) {
- for(int j = 0; j < 2; ++j) {
- if(!this.field_78876_b[i][j].isEmpty()) {
- switch(j) {
- case 0:
- GlStateManager.func_179132_a(false);
- break;
- case 1:
- GlStateManager.func_179132_a(true);
- }
- switch(i) {
- case 0:
- default:
- this.field_78877_c.func_110577_a(field_110737_b);
- break;
- case 1:
- this.field_78877_c.func_110577_a(TextureMap.field_110575_b);
- }
- GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
- Tessellator tessellator = Tessellator.func_178181_a();
- BufferBuilder bufferbuilder = tessellator.func_178180_c();
- bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181704_d);
- for(final Particle particle : this.field_78876_b[i][j]) {
- try {
- particle.func_180434_a(bufferbuilder, p_78874_1_, p_78874_2_, f, f4, f1, f2, f3);
- } catch (Throwable throwable) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable, "Rendering Particle");
- CrashReportCategory crashreportcategory = crashreport.func_85058_a("Particle being rendered");
- crashreportcategory.func_189529_a("Particle", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return particle.toString();
- }
- });
- crashreportcategory.func_189529_a("Particle Type", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return i == 0?"MISC_TEXTURE":(i == 1?"TERRAIN_TEXTURE":(i == 3?"ENTITY_PARTICLE_TEXTURE":"Unknown - " + i));
- }
- });
- throw new ReportedException(crashreport);
- }
- }
- tessellator.func_78381_a();
- }
- }
- }
- GlStateManager.func_179132_a(true);
- GlStateManager.func_179084_k();
- GlStateManager.func_179092_a(516, 0.1F);
- }
- public void func_78872_b(Entity p_78872_1_, float p_78872_2_) {
- float f = 0.017453292F;
- float f1 = MathHelper.func_76134_b(p_78872_1_.field_70177_z * 0.017453292F);
- float f2 = MathHelper.func_76126_a(p_78872_1_.field_70177_z * 0.017453292F);
- float f3 = -f2 * MathHelper.func_76126_a(p_78872_1_.field_70125_A * 0.017453292F);
- float f4 = f1 * MathHelper.func_76126_a(p_78872_1_.field_70125_A * 0.017453292F);
- float f5 = MathHelper.func_76134_b(p_78872_1_.field_70125_A * 0.017453292F);
- for(int i = 0; i < 2; ++i) {
- Queue<Particle> queue = this.field_78876_b[3][i];
- if(!queue.isEmpty()) {
- Tessellator tessellator = Tessellator.func_178181_a();
- BufferBuilder bufferbuilder = tessellator.func_178180_c();
- for(Particle particle : queue) {
- particle.func_180434_a(bufferbuilder, p_78872_1_, p_78872_2_, f1, f5, f2, f3, f4);
- }
- }
- }
- }
- public void func_78870_a(@Nullable World p_78870_1_) {
- this.field_78878_a = p_78870_1_;
- for(int i = 0; i < 4; ++i) {
- for(int j = 0; j < 2; ++j) {
- this.field_78876_b[i][j].clear();
- }
- }
- this.field_178933_d.clear();
- }
- public void func_180533_a(BlockPos p_180533_1_, IBlockState p_180533_2_) {
- if(p_180533_2_.func_185904_a() != Material.field_151579_a) {
- p_180533_2_ = p_180533_2_.func_185899_b(this.field_78878_a, p_180533_1_);
- int i = 4;
- for(int j = 0; j < 4; ++j) {
- for(int k = 0; k < 4; ++k) {
- for(int l = 0; l < 4; ++l) {
- double d0 = ((double)j + 0.5D) / 4.0D;
- double d1 = ((double)k + 0.5D) / 4.0D;
- double d2 = ((double)l + 0.5D) / 4.0D;
- 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_));
- }
- }
- }
- }
- }
- public void func_180532_a(BlockPos p_180532_1_, EnumFacing p_180532_2_) {
- IBlockState iblockstate = this.field_78878_a.func_180495_p(p_180532_1_);
- if(iblockstate.func_185901_i() != EnumBlockRenderType.INVISIBLE) {
- int i = p_180532_1_.func_177958_n();
- int j = p_180532_1_.func_177956_o();
- int k = p_180532_1_.func_177952_p();
- float f = 0.1F;
- AxisAlignedBB axisalignedbb = iblockstate.func_185900_c(this.field_78878_a, p_180532_1_);
- 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;
- 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;
- 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;
- if(p_180532_2_ == EnumFacing.DOWN) {
- d1 = (double)j + axisalignedbb.field_72338_b - 0.10000000149011612D;
- }
- if(p_180532_2_ == EnumFacing.UP) {
- d1 = (double)j + axisalignedbb.field_72337_e + 0.10000000149011612D;
- }
- if(p_180532_2_ == EnumFacing.NORTH) {
- d2 = (double)k + axisalignedbb.field_72339_c - 0.10000000149011612D;
- }
- if(p_180532_2_ == EnumFacing.SOUTH) {
- d2 = (double)k + axisalignedbb.field_72334_f + 0.10000000149011612D;
- }
- if(p_180532_2_ == EnumFacing.WEST) {
- d0 = (double)i + axisalignedbb.field_72340_a - 0.10000000149011612D;
- }
- if(p_180532_2_ == EnumFacing.EAST) {
- d0 = (double)i + axisalignedbb.field_72336_d + 0.10000000149011612D;
- }
- 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));
- }
- }
- public String func_78869_b() {
- int i = 0;
- for(int j = 0; j < 4; ++j) {
- for(int k = 0; k < 2; ++k) {
- i += this.field_78876_b[j][k].size();
- }
- }
- return "" + i;
- }
- }
- Patching failed: minecraft\net\minecraft\client\renderer\EntityRenderer.java
- Hunk 1 failed! Cannot find hunk target
- flag = true;
- }
- - d0 = d0;
- +// d0 = d0;
- }
- if (this.field_78531_r.field_71476_x != null) {
- File state
- package net.minecraft.client.renderer;
- import com.google.common.base.Predicate;
- import com.google.common.base.Predicates;
- import com.google.gson.JsonSyntaxException;
- import java.awt.Graphics;
- import java.awt.image.BufferedImage;
- import java.awt.image.ImageObserver;
- import java.io.File;
- import java.io.IOException;
- import java.nio.FloatBuffer;
- import java.util.List;
- import java.util.Random;
- import javax.annotation.Nullable;
- import javax.imageio.ImageIO;
- import net.minecraft.block.Block;
- import net.minecraft.block.BlockBed;
- import net.minecraft.block.material.Material;
- import net.minecraft.block.state.IBlockState;
- import net.minecraft.client.Minecraft;
- import net.minecraft.client.entity.AbstractClientPlayer;
- import net.minecraft.client.gui.FontRenderer;
- import net.minecraft.client.gui.MapItemRenderer;
- import net.minecraft.client.gui.ScaledResolution;
- import net.minecraft.client.particle.ParticleManager;
- import net.minecraft.client.renderer.ActiveRenderInfo;
- import net.minecraft.client.renderer.BufferBuilder;
- import net.minecraft.client.renderer.GLAllocation;
- import net.minecraft.client.renderer.GlStateManager;
- import net.minecraft.client.renderer.ItemRenderer;
- import net.minecraft.client.renderer.OpenGlHelper;
- import net.minecraft.client.renderer.RenderGlobal;
- import net.minecraft.client.renderer.RenderHelper;
- import net.minecraft.client.renderer.Tessellator;
- import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
- import net.minecraft.client.renderer.culling.ClippingHelperImpl;
- import net.minecraft.client.renderer.culling.Frustum;
- import net.minecraft.client.renderer.culling.ICamera;
- import net.minecraft.client.renderer.texture.DynamicTexture;
- import net.minecraft.client.renderer.texture.TextureMap;
- import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
- import net.minecraft.client.resources.IResourceManager;
- import net.minecraft.client.resources.IResourceManagerReloadListener;
- import net.minecraft.client.shader.ShaderGroup;
- import net.minecraft.client.shader.ShaderLinkHelper;
- import net.minecraft.crash.CrashReport;
- import net.minecraft.crash.CrashReportCategory;
- import net.minecraft.crash.ICrashReportDetail;
- import net.minecraft.enchantment.EnchantmentHelper;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.entity.item.EntityItemFrame;
- import net.minecraft.entity.monster.EntityCreeper;
- import net.minecraft.entity.monster.EntityEnderman;
- import net.minecraft.entity.monster.EntitySpider;
- import net.minecraft.entity.passive.EntityAnimal;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.init.Blocks;
- import net.minecraft.init.MobEffects;
- import net.minecraft.init.SoundEvents;
- import net.minecraft.inventory.IInventory;
- import net.minecraft.item.ItemStack;
- import net.minecraft.util.BlockRenderLayer;
- import net.minecraft.util.EntitySelectors;
- import net.minecraft.util.EnumFacing;
- import net.minecraft.util.EnumParticleTypes;
- import net.minecraft.util.MouseFilter;
- import net.minecraft.util.ReportedException;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.util.ScreenShotHelper;
- import net.minecraft.util.SoundCategory;
- import net.minecraft.util.math.AxisAlignedBB;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.util.math.MathHelper;
- import net.minecraft.util.math.RayTraceResult;
- import net.minecraft.util.math.Vec3d;
- import net.minecraft.world.GameType;
- import net.minecraft.world.World;
- import net.minecraft.world.biome.Biome;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- import org.apache.logging.log4j.LogManager;
- import org.apache.logging.log4j.Logger;
- import org.lwjgl.input.Mouse;
- import org.lwjgl.opengl.Display;
- import org.lwjgl.opengl.GLContext;
- import org.lwjgl.util.glu.Project;
- @SideOnly(Side.CLIENT)
- public class EntityRenderer implements IResourceManagerReloadListener {
- private static final Logger field_147710_q = LogManager.getLogger();
- private static final ResourceLocation field_110924_q = new ResourceLocation("textures/environment/rain.png");
- private static final ResourceLocation field_110923_r = new ResourceLocation("textures/environment/snow.png");
- public static boolean field_78517_a;
- public static int field_78515_b;
- private final Minecraft field_78531_r;
- private final IResourceManager field_147711_ac;
- private final Random field_78537_ab = new Random();
- private float field_78530_s;
- public final ItemRenderer field_78516_c;
- private final MapItemRenderer field_147709_v;
- private int field_78529_t;
- private Entity field_78528_u;
- private final MouseFilter field_78527_v = new MouseFilter();
- private final MouseFilter field_78526_w = new MouseFilter();
- private final float field_78490_B = 4.0F;
- private float field_78491_C = 4.0F;
- private float field_78496_H;
- private float field_78497_I;
- private float field_78498_J;
- private float field_78499_K;
- private float field_78492_L;
- private float field_78507_R;
- private float field_78506_S;
- private float field_82831_U;
- private float field_82832_V;
- private boolean field_78500_U;
- private boolean field_175074_C = true;
- private boolean field_175073_D = true;
- private long field_184374_E;
- private long field_78508_Y = Minecraft.func_71386_F();
- private long field_78510_Z;
- private final DynamicTexture field_78513_d;
- private final int[] field_78504_Q;
- private final ResourceLocation field_110922_T;
- private boolean field_78536_aa;
- private float field_78514_e;
- private float field_175075_L;
- private int field_78534_ac;
- private final float[] field_175076_N = new float[1024];
- private final float[] field_175077_O = new float[1024];
- private final FloatBuffer field_78521_m = GLAllocation.func_74529_h(16);
- private float field_175080_Q;
- private float field_175082_R;
- private float field_175081_S;
- private float field_78535_ad;
- private float field_78539_ae;
- private int field_175079_V;
- private boolean field_175078_W;
- private double field_78503_V = 1.0D;
- private double field_78502_W;
- private double field_78509_X;
- private ItemStack field_190566_ab;
- private int field_190567_ac;
- private float field_190568_ad;
- private float field_190569_ae;
- private ShaderGroup field_147707_d;
- 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")};
- public static final int field_147708_e = field_147712_ad.length;
- private int field_147713_ae;
- private boolean field_175083_ad;
- private int field_175084_ae;
- public EntityRenderer(Minecraft p_i45076_1_, IResourceManager p_i45076_2_) {
- this.field_147713_ae = field_147708_e;
- this.field_78531_r = p_i45076_1_;
- this.field_147711_ac = p_i45076_2_;
- this.field_78516_c = p_i45076_1_.func_175597_ag();
- this.field_147709_v = new MapItemRenderer(p_i45076_1_.func_110434_K());
- this.field_78513_d = new DynamicTexture(16, 16);
- this.field_110922_T = p_i45076_1_.func_110434_K().func_110578_a("lightMap", this.field_78513_d);
- this.field_78504_Q = this.field_78513_d.func_110565_c();
- this.field_147707_d = null;
- for(int i = 0; i < 32; ++i) {
- for(int j = 0; j < 32; ++j) {
- float f = (float)(j - 16);
- float f1 = (float)(i - 16);
- float f2 = MathHelper.func_76129_c(f * f + f1 * f1);
- this.field_175076_N[i << 5 | j] = -f1 / f2;
- this.field_175077_O[i << 5 | j] = f / f2;
- }
- }
- }
- public boolean func_147702_a() {
- return OpenGlHelper.field_148824_g && this.field_147707_d != null;
- }
- public void func_181022_b() {
- if(this.field_147707_d != null) {
- this.field_147707_d.func_148021_a();
- }
- this.field_147707_d = null;
- this.field_147713_ae = field_147708_e;
- }
- public void func_175071_c() {
- this.field_175083_ad = !this.field_175083_ad;
- }
- public void func_175066_a(@Nullable Entity p_175066_1_) {
- if(OpenGlHelper.field_148824_g) {
- if(this.field_147707_d != null) {
- this.field_147707_d.func_148021_a();
- }
- this.field_147707_d = null;
- if(p_175066_1_ instanceof EntityCreeper) {
- this.func_175069_a(new ResourceLocation("shaders/post/creeper.json"));
- } else if(p_175066_1_ instanceof EntitySpider) {
- this.func_175069_a(new ResourceLocation("shaders/post/spider.json"));
- } else if(p_175066_1_ instanceof EntityEnderman) {
- this.func_175069_a(new ResourceLocation("shaders/post/invert.json"));
- }
- }
- }
- public void func_175069_a(ResourceLocation p_175069_1_) {
- try {
- 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_);
- this.field_147707_d.func_148026_a(this.field_78531_r.field_71443_c, this.field_78531_r.field_71440_d);
- this.field_175083_ad = true;
- } catch (IOException ioexception) {
- field_147710_q.warn((String)"Failed to load shader: {}", (Object)p_175069_1_, (Object)ioexception);
- this.field_147713_ae = field_147708_e;
- this.field_175083_ad = false;
- } catch (JsonSyntaxException jsonsyntaxexception) {
- field_147710_q.warn((String)"Failed to load shader: {}", (Object)p_175069_1_, (Object)jsonsyntaxexception);
- this.field_147713_ae = field_147708_e;
- this.field_175083_ad = false;
- }
- }
- public void func_110549_a(IResourceManager p_110549_1_) {
- if(this.field_147707_d != null) {
- this.field_147707_d.func_148021_a();
- }
- this.field_147707_d = null;
- if(this.field_147713_ae == field_147708_e) {
- this.func_175066_a(this.field_78531_r.func_175606_aa());
- } else {
- this.func_175069_a(field_147712_ad[this.field_147713_ae]);
- }
- }
- public void func_78464_a() {
- if(OpenGlHelper.field_148824_g && ShaderLinkHelper.func_148074_b() == null) {
- ShaderLinkHelper.func_148076_a();
- }
- this.func_78477_e();
- this.func_78470_f();
- this.field_78535_ad = this.field_78539_ae;
- this.field_78491_C = 4.0F;
- if(this.field_78531_r.field_71474_y.field_74326_T) {
- float f = this.field_78531_r.field_71474_y.field_74341_c * 0.6F + 0.2F;
- float f1 = f * f * f * 8.0F;
- this.field_78498_J = this.field_78527_v.func_76333_a(this.field_78496_H, 0.05F * f1);
- this.field_78499_K = this.field_78526_w.func_76333_a(this.field_78497_I, 0.05F * f1);
- this.field_78492_L = 0.0F;
- this.field_78496_H = 0.0F;
- this.field_78497_I = 0.0F;
- } else {
- this.field_78498_J = 0.0F;
- this.field_78499_K = 0.0F;
- this.field_78527_v.func_180179_a();
- this.field_78526_w.func_180179_a();
- }
- if(this.field_78531_r.func_175606_aa() == null) {
- this.field_78531_r.func_175607_a(this.field_78531_r.field_71439_g);
- }
- float f3 = this.field_78531_r.field_71441_e.func_175724_o(new BlockPos(this.field_78531_r.func_175606_aa()));
- float f4 = (float)this.field_78531_r.field_71474_y.field_151451_c / 32.0F;
- float f2 = f3 * (1.0F - f4) + f4;
- this.field_78539_ae += (f2 - this.field_78539_ae) * 0.1F;
- ++this.field_78529_t;
- this.field_78516_c.func_78441_a();
- this.func_78484_h();
- this.field_82832_V = this.field_82831_U;
- if(this.field_78531_r.field_71456_v.func_184046_j().func_184053_e()) {
- this.field_82831_U += 0.05F;
- if(this.field_82831_U > 1.0F) {
- this.field_82831_U = 1.0F;
- }
- } else if(this.field_82831_U > 0.0F) {
- this.field_82831_U -= 0.0125F;
- }
- if(this.field_190567_ac > 0) {
- --this.field_190567_ac;
- if(this.field_190567_ac == 0) {
- this.field_190566_ab = null;
- }
- }
- }
- public ShaderGroup func_147706_e() {
- return this.field_147707_d;
- }
- public void func_147704_a(int p_147704_1_, int p_147704_2_) {
- if(OpenGlHelper.field_148824_g) {
- if(this.field_147707_d != null) {
- this.field_147707_d.func_148026_a(p_147704_1_, p_147704_2_);
- }
- this.field_78531_r.field_71438_f.func_72720_a(p_147704_1_, p_147704_2_);
- }
- }
- public void func_78473_a(float p_78473_1_) {
- Entity entity = this.field_78531_r.func_175606_aa();
- if(entity != null) {
- if(this.field_78531_r.field_71441_e != null) {
- this.field_78531_r.field_71424_I.func_76320_a("pick");
- this.field_78531_r.field_147125_j = null;
- double d0 = (double)this.field_78531_r.field_71442_b.func_78757_d();
- this.field_78531_r.field_71476_x = entity.func_174822_a(d0, p_78473_1_);
- Vec3d vec3d = entity.func_174824_e(p_78473_1_);
- boolean flag = false;
- int i = 3;
- double d1 = d0;
- if(this.field_78531_r.field_71442_b.func_78749_i()) {
- d1 = 6.0D;
- d0 = d1;
- } else {
- if(d0 > 3.0D) {
- flag = true;
- }
- d0 = d0;
- }
- if(this.field_78531_r.field_71476_x != null) {
- d1 = this.field_78531_r.field_71476_x.field_72307_f.func_72438_d(vec3d);
- }
- Vec3d vec3d1 = entity.func_70676_i(1.0F);
- Vec3d vec3d2 = vec3d.func_72441_c(vec3d1.field_72450_a * d0, vec3d1.field_72448_b * d0, vec3d1.field_72449_c * d0);
- this.field_78528_u = null;
- Vec3d vec3d3 = null;
- float f = 1.0F;
- 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>() {
- public boolean apply(@Nullable Entity p_apply_1_) {
- return p_apply_1_ != null && p_apply_1_.func_70067_L();
- }
- }));
- double d2 = d1;
- for(int j = 0; j < list.size(); ++j) {
- Entity entity1 = (Entity)list.get(j);
- AxisAlignedBB axisalignedbb = entity1.func_174813_aQ().func_186662_g((double)entity1.func_70111_Y());
- RayTraceResult raytraceresult = axisalignedbb.func_72327_a(vec3d, vec3d2);
- if(axisalignedbb.func_72318_a(vec3d)) {
- if(d2 >= 0.0D) {
- this.field_78528_u = entity1;
- vec3d3 = raytraceresult == null?vec3d:raytraceresult.field_72307_f;
- d2 = 0.0D;
- }
- } else if(raytraceresult != null) {
- double d3 = vec3d.func_72438_d(raytraceresult.field_72307_f);
- if(d3 < d2 || d2 == 0.0D) {
- if(entity1.func_184208_bv() == entity.func_184208_bv()) {
- if(d2 == 0.0D) {
- this.field_78528_u = entity1;
- vec3d3 = raytraceresult.field_72307_f;
- }
- } else {
- this.field_78528_u = entity1;
- vec3d3 = raytraceresult.field_72307_f;
- d2 = d3;
- }
- }
- }
- }
- if(this.field_78528_u != null && flag && vec3d.func_72438_d(vec3d3) > 3.0D) {
- this.field_78528_u = null;
- this.field_78531_r.field_71476_x = new RayTraceResult(RayTraceResult.Type.MISS, vec3d3, (EnumFacing)null, new BlockPos(vec3d3));
- }
- if(this.field_78528_u != null && (d2 < d1 || this.field_78531_r.field_71476_x == null)) {
- this.field_78531_r.field_71476_x = new RayTraceResult(this.field_78528_u, vec3d3);
- if(this.field_78528_u instanceof EntityLivingBase || this.field_78528_u instanceof EntityItemFrame) {
- this.field_78531_r.field_147125_j = this.field_78528_u;
- }
- }
- this.field_78531_r.field_71424_I.func_76319_b();
- }
- }
- }
- private void func_78477_e() {
- float f = 1.0F;
- if(this.field_78531_r.func_175606_aa() instanceof AbstractClientPlayer) {
- AbstractClientPlayer abstractclientplayer = (AbstractClientPlayer)this.field_78531_r.func_175606_aa();
- f = abstractclientplayer.func_175156_o();
- }
- this.field_78506_S = this.field_78507_R;
- this.field_78507_R += (f - this.field_78507_R) * 0.5F;
- if(this.field_78507_R > 1.5F) {
- this.field_78507_R = 1.5F;
- }
- if(this.field_78507_R < 0.1F) {
- this.field_78507_R = 0.1F;
- }
- }
- private float func_78481_a(float p_78481_1_, boolean p_78481_2_) {
- if(this.field_175078_W) {
- return 90.0F;
- } else {
- Entity entity = this.field_78531_r.func_175606_aa();
- float f = 70.0F;
- if(p_78481_2_) {
- f = this.field_78531_r.field_71474_y.field_74334_X;
- f = f * (this.field_78506_S + (this.field_78507_R - this.field_78506_S) * p_78481_1_);
- }
- if(entity instanceof EntityLivingBase && ((EntityLivingBase)entity).func_110143_aJ() <= 0.0F) {
- float f1 = (float)((EntityLivingBase)entity).field_70725_aQ + p_78481_1_;
- f /= (1.0F - 500.0F / (f1 + 500.0F)) * 2.0F + 1.0F;
- }
- IBlockState iblockstate = ActiveRenderInfo.func_186703_a(this.field_78531_r.field_71441_e, entity, p_78481_1_);
- if(iblockstate.func_185904_a() == Material.field_151586_h) {
- f = f * 60.0F / 70.0F;
- }
- return f;
- }
- }
- private void func_78482_e(float p_78482_1_) {
- if(this.field_78531_r.func_175606_aa() instanceof EntityLivingBase) {
- EntityLivingBase entitylivingbase = (EntityLivingBase)this.field_78531_r.func_175606_aa();
- float f = (float)entitylivingbase.field_70737_aN - p_78482_1_;
- if(entitylivingbase.func_110143_aJ() <= 0.0F) {
- float f1 = (float)entitylivingbase.field_70725_aQ + p_78482_1_;
- GlStateManager.func_179114_b(40.0F - 8000.0F / (f1 + 200.0F), 0.0F, 0.0F, 1.0F);
- }
- if(f < 0.0F) {
- return;
- }
- f = f / (float)entitylivingbase.field_70738_aO;
- f = MathHelper.func_76126_a(f * f * f * f * 3.1415927F);
- float f2 = entitylivingbase.field_70739_aP;
- GlStateManager.func_179114_b(-f2, 0.0F, 1.0F, 0.0F);
- GlStateManager.func_179114_b(-f * 14.0F, 0.0F, 0.0F, 1.0F);
- GlStateManager.func_179114_b(f2, 0.0F, 1.0F, 0.0F);
- }
- }
- private void func_78475_f(float p_78475_1_) {
- if(this.field_78531_r.func_175606_aa() instanceof EntityPlayer) {
- EntityPlayer entityplayer = (EntityPlayer)this.field_78531_r.func_175606_aa();
- float f = entityplayer.field_70140_Q - entityplayer.field_70141_P;
- float f1 = -(entityplayer.field_70140_Q + f * p_78475_1_);
- float f2 = entityplayer.field_71107_bF + (entityplayer.field_71109_bG - entityplayer.field_71107_bF) * p_78475_1_;
- float f3 = entityplayer.field_70727_aS + (entityplayer.field_70726_aT - entityplayer.field_70727_aS) * p_78475_1_;
- 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);
- GlStateManager.func_179114_b(MathHelper.func_76126_a(f1 * 3.1415927F) * f2 * 3.0F, 0.0F, 0.0F, 1.0F);
- GlStateManager.func_179114_b(Math.abs(MathHelper.func_76134_b(f1 * 3.1415927F - 0.2F) * f2) * 5.0F, 1.0F, 0.0F, 0.0F);
- GlStateManager.func_179114_b(f3, 1.0F, 0.0F, 0.0F);
- }
- }
- private void func_78467_g(float p_78467_1_) {
- Entity entity = this.field_78531_r.func_175606_aa();
- float f = entity.func_70047_e();
- double d0 = entity.field_70169_q + (entity.field_70165_t - entity.field_70169_q) * (double)p_78467_1_;
- double d1 = entity.field_70167_r + (entity.field_70163_u - entity.field_70167_r) * (double)p_78467_1_ + (double)f;
- double d2 = entity.field_70166_s + (entity.field_70161_v - entity.field_70166_s) * (double)p_78467_1_;
- if(entity instanceof EntityLivingBase && ((EntityLivingBase)entity).func_70608_bn()) {
- f = (float)((double)f + 1.0D);
- GlStateManager.func_179109_b(0.0F, 0.3F, 0.0F);
- if(!this.field_78531_r.field_71474_y.field_74325_U) {
- BlockPos blockpos = new BlockPos(entity);
- IBlockState iblockstate = this.field_78531_r.field_71441_e.func_180495_p(blockpos);
- Block block = iblockstate.func_177230_c();
- if(block == Blocks.field_150324_C) {
- int j = ((EnumFacing)iblockstate.func_177229_b(BlockBed.field_185512_D)).func_176736_b();
- GlStateManager.func_179114_b((float)(j * 90), 0.0F, 1.0F, 0.0F);
- }
- 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);
- 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);
- }
- } else if(this.field_78531_r.field_71474_y.field_74320_O > 0) {
- double d3 = (double)(this.field_78491_C + (4.0F - this.field_78491_C) * p_78467_1_);
- if(this.field_78531_r.field_71474_y.field_74325_U) {
- GlStateManager.func_179109_b(0.0F, 0.0F, (float)(-d3));
- } else {
- float f1 = entity.field_70177_z;
- float f2 = entity.field_70125_A;
- if(this.field_78531_r.field_71474_y.field_74320_O == 2) {
- f2 += 180.0F;
- }
- double d4 = (double)(-MathHelper.func_76126_a(f1 * 0.017453292F) * MathHelper.func_76134_b(f2 * 0.017453292F)) * d3;
- double d5 = (double)(MathHelper.func_76134_b(f1 * 0.017453292F) * MathHelper.func_76134_b(f2 * 0.017453292F)) * d3;
- double d6 = (double)(-MathHelper.func_76126_a(f2 * 0.017453292F)) * d3;
- for(int i = 0; i < 8; ++i) {
- float f3 = (float)((i & 1) * 2 - 1);
- float f4 = (float)((i >> 1 & 1) * 2 - 1);
- float f5 = (float)((i >> 2 & 1) * 2 - 1);
- f3 = f3 * 0.1F;
- f4 = f4 * 0.1F;
- f5 = f5 * 0.1F;
- 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));
- if(raytraceresult != null) {
- double d7 = raytraceresult.field_72307_f.func_72438_d(new Vec3d(d0, d1, d2));
- if(d7 < d3) {
- d3 = d7;
- }
- }
- }
- if(this.field_78531_r.field_71474_y.field_74320_O == 2) {
- GlStateManager.func_179114_b(180.0F, 0.0F, 1.0F, 0.0F);
- }
- GlStateManager.func_179114_b(entity.field_70125_A - f2, 1.0F, 0.0F, 0.0F);
- GlStateManager.func_179114_b(entity.field_70177_z - f1, 0.0F, 1.0F, 0.0F);
- GlStateManager.func_179109_b(0.0F, 0.0F, (float)(-d3));
- GlStateManager.func_179114_b(f1 - entity.field_70177_z, 0.0F, 1.0F, 0.0F);
- GlStateManager.func_179114_b(f2 - entity.field_70125_A, 1.0F, 0.0F, 0.0F);
- }
- } else {
- GlStateManager.func_179109_b(0.0F, 0.0F, 0.05F);
- }
- if(!this.field_78531_r.field_71474_y.field_74325_U) {
- 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);
- if(entity instanceof EntityAnimal) {
- EntityAnimal entityanimal = (EntityAnimal)entity;
- 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);
- } else {
- 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);
- }
- }
- GlStateManager.func_179109_b(0.0F, -f, 0.0F);
- d0 = entity.field_70169_q + (entity.field_70165_t - entity.field_70169_q) * (double)p_78467_1_;
- d1 = entity.field_70167_r + (entity.field_70163_u - entity.field_70167_r) * (double)p_78467_1_ + (double)f;
- d2 = entity.field_70166_s + (entity.field_70161_v - entity.field_70166_s) * (double)p_78467_1_;
- this.field_78500_U = this.field_78531_r.field_71438_f.func_72721_a(d0, d1, d2, p_78467_1_);
- }
- private void func_78479_a(float p_78479_1_, int p_78479_2_) {
- this.field_78530_s = (float)(this.field_78531_r.field_71474_y.field_151451_c * 16);
- GlStateManager.func_179128_n(5889);
- GlStateManager.func_179096_D();
- float f = 0.07F;
- if(this.field_78531_r.field_71474_y.field_74337_g) {
- GlStateManager.func_179109_b((float)(-(p_78479_2_ * 2 - 1)) * 0.07F, 0.0F, 0.0F);
- }
- if(this.field_78503_V != 1.0D) {
- GlStateManager.func_179109_b((float)this.field_78502_W, (float)(-this.field_78509_X), 0.0F);
- GlStateManager.func_179139_a(this.field_78503_V, this.field_78503_V, 1.0D);
- }
- 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);
- GlStateManager.func_179128_n(5888);
- GlStateManager.func_179096_D();
- if(this.field_78531_r.field_71474_y.field_74337_g) {
- GlStateManager.func_179109_b((float)(p_78479_2_ * 2 - 1) * 0.1F, 0.0F, 0.0F);
- }
- this.func_78482_e(p_78479_1_);
- if(this.field_78531_r.field_71474_y.field_74336_f) {
- this.func_78475_f(p_78479_1_);
- }
- 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_;
- if(f1 > 0.0F) {
- int i = 20;
- if(this.field_78531_r.field_71439_g.func_70644_a(MobEffects.field_76431_k)) {
- i = 7;
- }
- float f2 = 5.0F / (f1 * f1 + 5.0F) - f1 * 0.04F;
- f2 = f2 * f2;
- GlStateManager.func_179114_b(((float)this.field_78529_t + p_78479_1_) * (float)i, 0.0F, 1.0F, 1.0F);
- GlStateManager.func_179152_a(1.0F / f2, 1.0F, 1.0F);
- GlStateManager.func_179114_b(-((float)this.field_78529_t + p_78479_1_) * (float)i, 0.0F, 1.0F, 1.0F);
- }
- this.func_78467_g(p_78479_1_);
- if(this.field_175078_W) {
- switch(this.field_175079_V) {
- case 0:
- GlStateManager.func_179114_b(90.0F, 0.0F, 1.0F, 0.0F);
- break;
- case 1:
- GlStateManager.func_179114_b(180.0F, 0.0F, 1.0F, 0.0F);
- break;
- case 2:
- GlStateManager.func_179114_b(-90.0F, 0.0F, 1.0F, 0.0F);
- break;
- case 3:
- GlStateManager.func_179114_b(90.0F, 1.0F, 0.0F, 0.0F);
- break;
- case 4:
- GlStateManager.func_179114_b(-90.0F, 1.0F, 0.0F, 0.0F);
- }
- }
- }
- private void func_78476_b(float p_78476_1_, int p_78476_2_) {
- if(!this.field_175078_W) {
- GlStateManager.func_179128_n(5889);
- GlStateManager.func_179096_D();
- float f = 0.07F;
- if(this.field_78531_r.field_71474_y.field_74337_g) {
- GlStateManager.func_179109_b((float)(-(p_78476_2_ * 2 - 1)) * 0.07F, 0.0F, 0.0F);
- }
- 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);
- GlStateManager.func_179128_n(5888);
- GlStateManager.func_179096_D();
- if(this.field_78531_r.field_71474_y.field_74337_g) {
- GlStateManager.func_179109_b((float)(p_78476_2_ * 2 - 1) * 0.1F, 0.0F, 0.0F);
- }
- GlStateManager.func_179094_E();
- this.func_78482_e(p_78476_1_);
- if(this.field_78531_r.field_71474_y.field_74336_f) {
- this.func_78475_f(p_78476_1_);
- }
- boolean flag = this.field_78531_r.func_175606_aa() instanceof EntityLivingBase && ((EntityLivingBase)this.field_78531_r.func_175606_aa()).func_70608_bn();
- 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()) {
- this.func_180436_i();
- this.field_78516_c.func_78440_a(p_78476_1_);
- this.func_175072_h();
- }
- GlStateManager.func_179121_F();
- if(this.field_78531_r.field_71474_y.field_74320_O == 0 && !flag) {
- this.field_78516_c.func_78447_b(p_78476_1_);
- this.func_78482_e(p_78476_1_);
- }
- if(this.field_78531_r.field_71474_y.field_74336_f) {
- this.func_78475_f(p_78476_1_);
- }
- }
- }
- public void func_175072_h() {
- GlStateManager.func_179138_g(OpenGlHelper.field_77476_b);
- GlStateManager.func_179090_x();
- GlStateManager.func_179138_g(OpenGlHelper.field_77478_a);
- }
- public void func_180436_i() {
- GlStateManager.func_179138_g(OpenGlHelper.field_77476_b);
- GlStateManager.func_179128_n(5890);
- GlStateManager.func_179096_D();
- float f = 0.00390625F;
- GlStateManager.func_179152_a(0.00390625F, 0.00390625F, 0.00390625F);
- GlStateManager.func_179109_b(8.0F, 8.0F, 8.0F);
- GlStateManager.func_179128_n(5888);
- this.field_78531_r.func_110434_K().func_110577_a(this.field_110922_T);
- GlStateManager.func_187421_b(3553, 10241, 9729);
- GlStateManager.func_187421_b(3553, 10240, 9729);
- GlStateManager.func_187421_b(3553, 10242, 10496);
- GlStateManager.func_187421_b(3553, 10243, 10496);
- GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
- GlStateManager.func_179098_w();
- GlStateManager.func_179138_g(OpenGlHelper.field_77478_a);
- }
- private void func_78470_f() {
- this.field_175075_L = (float)((double)this.field_175075_L + (Math.random() - Math.random()) * Math.random() * Math.random());
- this.field_175075_L = (float)((double)this.field_175075_L * 0.9D);
- this.field_78514_e += this.field_175075_L - this.field_78514_e;
- this.field_78536_aa = true;
- }
- private void func_78472_g(float p_78472_1_) {
- if(this.field_78536_aa) {
- this.field_78531_r.field_71424_I.func_76320_a("lightTex");
- World world = this.field_78531_r.field_71441_e;
- if(world != null) {
- float f = world.func_72971_b(1.0F);
- float f1 = f * 0.95F + 0.05F;
- for(int i = 0; i < 256; ++i) {
- float f2 = world.field_73011_w.func_177497_p()[i / 16] * f1;
- float f3 = world.field_73011_w.func_177497_p()[i % 16] * (this.field_78514_e * 0.1F + 1.5F);
- if(world.func_175658_ac() > 0) {
- f2 = world.field_73011_w.func_177497_p()[i / 16];
- }
- float f4 = f2 * (f * 0.65F + 0.35F);
- float f5 = f2 * (f * 0.65F + 0.35F);
- float f6 = f3 * ((f3 * 0.6F + 0.4F) * 0.6F + 0.4F);
- float f7 = f3 * (f3 * f3 * 0.6F + 0.4F);
- float f8 = f4 + f3;
- float f9 = f5 + f6;
- float f10 = f2 + f7;
- f8 = f8 * 0.96F + 0.03F;
- f9 = f9 * 0.96F + 0.03F;
- f10 = f10 * 0.96F + 0.03F;
- if(this.field_82831_U > 0.0F) {
- float f11 = this.field_82832_V + (this.field_82831_U - this.field_82832_V) * p_78472_1_;
- f8 = f8 * (1.0F - f11) + f8 * 0.7F * f11;
- f9 = f9 * (1.0F - f11) + f9 * 0.6F * f11;
- f10 = f10 * (1.0F - f11) + f10 * 0.6F * f11;
- }
- if(world.field_73011_w.func_186058_p().func_186068_a() == 1) {
- f8 = 0.22F + f3 * 0.75F;
- f9 = 0.28F + f6 * 0.75F;
- f10 = 0.25F + f7 * 0.75F;
- }
- if(this.field_78531_r.field_71439_g.func_70644_a(MobEffects.field_76439_r)) {
- float f15 = this.func_180438_a(this.field_78531_r.field_71439_g, p_78472_1_);
- float f12 = 1.0F / f8;
- if(f12 > 1.0F / f9) {
- f12 = 1.0F / f9;
- }
- if(f12 > 1.0F / f10) {
- f12 = 1.0F / f10;
- }
- f8 = f8 * (1.0F - f15) + f8 * f12 * f15;
- f9 = f9 * (1.0F - f15) + f9 * f12 * f15;
- f10 = f10 * (1.0F - f15) + f10 * f12 * f15;
- }
- if(f8 > 1.0F) {
- f8 = 1.0F;
- }
- if(f9 > 1.0F) {
- f9 = 1.0F;
- }
- if(f10 > 1.0F) {
- f10 = 1.0F;
- }
- float f16 = this.field_78531_r.field_71474_y.field_74333_Y;
- float f17 = 1.0F - f8;
- float f13 = 1.0F - f9;
- float f14 = 1.0F - f10;
- f17 = 1.0F - f17 * f17 * f17 * f17;
- f13 = 1.0F - f13 * f13 * f13 * f13;
- f14 = 1.0F - f14 * f14 * f14 * f14;
- f8 = f8 * (1.0F - f16) + f17 * f16;
- f9 = f9 * (1.0F - f16) + f13 * f16;
- f10 = f10 * (1.0F - f16) + f14 * f16;
- f8 = f8 * 0.96F + 0.03F;
- f9 = f9 * 0.96F + 0.03F;
- f10 = f10 * 0.96F + 0.03F;
- if(f8 > 1.0F) {
- f8 = 1.0F;
- }
- if(f9 > 1.0F) {
- f9 = 1.0F;
- }
- if(f10 > 1.0F) {
- f10 = 1.0F;
- }
- if(f8 < 0.0F) {
- f8 = 0.0F;
- }
- if(f9 < 0.0F) {
- f9 = 0.0F;
- }
- if(f10 < 0.0F) {
- f10 = 0.0F;
- }
- int j = 255;
- int k = (int)(f8 * 255.0F);
- int l = (int)(f9 * 255.0F);
- int i1 = (int)(f10 * 255.0F);
- this.field_78504_Q[i] = -16777216 | k << 16 | l << 8 | i1;
- }
- this.field_78513_d.func_110564_a();
- this.field_78536_aa = false;
- this.field_78531_r.field_71424_I.func_76319_b();
- }
- }
- }
- private float func_180438_a(EntityLivingBase p_180438_1_, float p_180438_2_) {
- int i = p_180438_1_.func_70660_b(MobEffects.field_76439_r).func_76459_b();
- return i > 200?1.0F:0.7F + MathHelper.func_76126_a(((float)i - p_180438_2_) * 3.1415927F * 0.2F) * 0.3F;
- }
- public void func_181560_a(float p_181560_1_, long p_181560_2_) {
- boolean flag = Display.isActive();
- 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))) {
- if(Minecraft.func_71386_F() - this.field_78508_Y > 500L) {
- this.field_78531_r.func_71385_j();
- }
- } else {
- this.field_78508_Y = Minecraft.func_71386_F();
- }
- this.field_78531_r.field_71424_I.func_76320_a("mouse");
- if(flag && Minecraft.field_142025_a && this.field_78531_r.field_71415_G && !Mouse.isInsideWindow()) {
- Mouse.setGrabbed(false);
- Mouse.setCursorPosition(Display.getWidth() / 2, Display.getHeight() / 2 - 20);
- Mouse.setGrabbed(true);
- }
- if(this.field_78531_r.field_71415_G && flag) {
- this.field_78531_r.field_71417_B.func_74374_c();
- this.field_78531_r.func_193032_ao().func_193299_a(this.field_78531_r.field_71417_B);
- float f = this.field_78531_r.field_71474_y.field_74341_c * 0.6F + 0.2F;
- float f1 = f * f * f * 8.0F;
- float f2 = (float)this.field_78531_r.field_71417_B.field_74377_a * f1;
- float f3 = (float)this.field_78531_r.field_71417_B.field_74375_b * f1;
- int i = 1;
- if(this.field_78531_r.field_71474_y.field_74338_d) {
- i = -1;
- }
- if(this.field_78531_r.field_71474_y.field_74326_T) {
- this.field_78496_H += f2;
- this.field_78497_I += f3;
- float f4 = p_181560_1_ - this.field_78492_L;
- this.field_78492_L = p_181560_1_;
- f2 = this.field_78498_J * f4;
- f3 = this.field_78499_K * f4;
- this.field_78531_r.field_71439_g.func_70082_c(f2, f3 * (float)i);
- } else {
- this.field_78496_H = 0.0F;
- this.field_78497_I = 0.0F;
- this.field_78531_r.field_71439_g.func_70082_c(f2, f3 * (float)i);
- }
- }
- this.field_78531_r.field_71424_I.func_76319_b();
- if(!this.field_78531_r.field_71454_w) {
- field_78517_a = this.field_78531_r.field_71474_y.field_74337_g;
- final ScaledResolution scaledresolution = new ScaledResolution(this.field_78531_r);
- int i1 = scaledresolution.func_78326_a();
- int j1 = scaledresolution.func_78328_b();
- final int k1 = Mouse.getX() * i1 / this.field_78531_r.field_71443_c;
- final int l1 = j1 - Mouse.getY() * j1 / this.field_78531_r.field_71440_d - 1;
- int i2 = this.field_78531_r.field_71474_y.field_74350_i;
- if(this.field_78531_r.field_71441_e != null) {
- this.field_78531_r.field_71424_I.func_76320_a("level");
- int j = Math.min(Minecraft.func_175610_ah(), i2);
- j = Math.max(j, 60);
- long k = System.nanoTime() - p_181560_2_;
- long l = Math.max((long)(1000000000 / j / 4) - k, 0L);
- this.func_78471_a(p_181560_1_, System.nanoTime() + l);
- if(this.field_78531_r.func_71356_B() && this.field_184374_E < Minecraft.func_71386_F() - 1000L) {
- this.field_184374_E = Minecraft.func_71386_F();
- if(!this.field_78531_r.func_71401_C().func_184106_y()) {
- this.func_184373_n();
- }
- }
- if(OpenGlHelper.field_148824_g) {
- this.field_78531_r.field_71438_f.func_174975_c();
- if(this.field_147707_d != null && this.field_175083_ad) {
- GlStateManager.func_179128_n(5890);
- GlStateManager.func_179094_E();
- GlStateManager.func_179096_D();
- this.field_147707_d.func_148018_a(p_181560_1_);
- GlStateManager.func_179121_F();
- }
- this.field_78531_r.func_147110_a().func_147610_a(true);
- }
- this.field_78510_Z = System.nanoTime();
- this.field_78531_r.field_71424_I.func_76318_c("gui");
- if(!this.field_78531_r.field_71474_y.field_74319_N || this.field_78531_r.field_71462_r != null) {
- GlStateManager.func_179092_a(516, 0.1F);
- this.func_78478_c();
- this.func_190563_a(i1, j1, p_181560_1_);
- this.field_78531_r.field_71456_v.func_175180_a(p_181560_1_);
- }
- this.field_78531_r.field_71424_I.func_76319_b();
- } else {
- GlStateManager.func_179083_b(0, 0, this.field_78531_r.field_71443_c, this.field_78531_r.field_71440_d);
- GlStateManager.func_179128_n(5889);
- GlStateManager.func_179096_D();
- GlStateManager.func_179128_n(5888);
- GlStateManager.func_179096_D();
- this.func_78478_c();
- this.field_78510_Z = System.nanoTime();
- }
- if(this.field_78531_r.field_71462_r != null) {
- GlStateManager.func_179086_m(256);
- try {
- this.field_78531_r.field_71462_r.func_73863_a(k1, l1, this.field_78531_r.func_193989_ak());
- } catch (Throwable throwable) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable, "Rendering screen");
- CrashReportCategory crashreportcategory = crashreport.func_85058_a("Screen render details");
- crashreportcategory.func_189529_a("Screen name", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return EntityRenderer.this.field_78531_r.field_71462_r.getClass().getCanonicalName();
- }
- });
- crashreportcategory.func_189529_a("Mouse location", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- 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())});
- }
- });
- crashreportcategory.func_189529_a("Screen size", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- 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())});
- }
- });
- throw new ReportedException(crashreport);
- }
- }
- }
- }
- private void func_184373_n() {
- 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()) {
- 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());
- int i = bufferedimage.getWidth();
- int j = bufferedimage.getHeight();
- int k = 0;
- int l = 0;
- if(i > j) {
- k = (i - j) / 2;
- i = j;
- } else {
- l = (j - i) / 2;
- }
- try {
- BufferedImage bufferedimage1 = new BufferedImage(64, 64, 1);
- Graphics graphics = bufferedimage1.createGraphics();
- graphics.drawImage(bufferedimage, 0, 0, 64, 64, k, l, k + i, l + i, (ImageObserver)null);
- graphics.dispose();
- ImageIO.write(bufferedimage1, "png", (File)this.field_78531_r.func_71401_C().func_184109_z());
- } catch (IOException ioexception) {
- field_147710_q.warn((String)"Couldn\'t save auto screenshot", (Throwable)ioexception);
- }
- }
- }
- public void func_152430_c(float p_152430_1_) {
- this.func_78478_c();
- }
- private boolean func_175070_n() {
- if(!this.field_175073_D) {
- return false;
- } else {
- Entity entity = this.field_78531_r.func_175606_aa();
- boolean flag = entity instanceof EntityPlayer && !this.field_78531_r.field_71474_y.field_74319_N;
- if(flag && !((EntityPlayer)entity).field_71075_bZ.field_75099_e) {
- ItemStack itemstack = ((EntityPlayer)entity).func_184614_ca();
- if(this.field_78531_r.field_71476_x != null && this.field_78531_r.field_71476_x.field_72313_a == RayTraceResult.Type.BLOCK) {
- BlockPos blockpos = this.field_78531_r.field_71476_x.func_178782_a();
- Block block = this.field_78531_r.field_71441_e.func_180495_p(blockpos).func_177230_c();
- if(this.field_78531_r.field_71442_b.func_178889_l() == GameType.SPECTATOR) {
- flag = block.func_149716_u() && this.field_78531_r.field_71441_e.func_175625_s(blockpos) instanceof IInventory;
- } else {
- flag = !itemstack.func_190926_b() && (itemstack.func_179544_c(block) || itemstack.func_179547_d(block));
- }
- }
- }
- return flag;
- }
- }
- public void func_78471_a(float p_78471_1_, long p_78471_2_) {
- this.func_78472_g(p_78471_1_);
- if(this.field_78531_r.func_175606_aa() == null) {
- this.field_78531_r.func_175607_a(this.field_78531_r.field_71439_g);
- }
- this.func_78473_a(p_78471_1_);
- GlStateManager.func_179126_j();
- GlStateManager.func_179141_d();
- GlStateManager.func_179092_a(516, 0.5F);
- this.field_78531_r.field_71424_I.func_76320_a("center");
- if(this.field_78531_r.field_71474_y.field_74337_g) {
- field_78515_b = 0;
- GlStateManager.func_179135_a(false, true, true, false);
- this.func_175068_a(0, p_78471_1_, p_78471_2_);
- field_78515_b = 1;
- GlStateManager.func_179135_a(true, false, false, false);
- this.func_175068_a(1, p_78471_1_, p_78471_2_);
- GlStateManager.func_179135_a(true, true, true, false);
- } else {
- this.func_175068_a(2, p_78471_1_, p_78471_2_);
- }
- this.field_78531_r.field_71424_I.func_76319_b();
- }
- private void func_175068_a(int p_175068_1_, float p_175068_2_, long p_175068_3_) {
- RenderGlobal renderglobal = this.field_78531_r.field_71438_f;
- ParticleManager particlemanager = this.field_78531_r.field_71452_i;
- boolean flag = this.func_175070_n();
- GlStateManager.func_179089_o();
- this.field_78531_r.field_71424_I.func_76318_c("clear");
- GlStateManager.func_179083_b(0, 0, this.field_78531_r.field_71443_c, this.field_78531_r.field_71440_d);
- this.func_78466_h(p_175068_2_);
- GlStateManager.func_179086_m(16640);
- this.field_78531_r.field_71424_I.func_76318_c("camera");
- this.func_78479_a(p_175068_2_, p_175068_1_);
- ActiveRenderInfo.func_74583_a(this.field_78531_r.field_71439_g, this.field_78531_r.field_71474_y.field_74320_O == 2);
- this.field_78531_r.field_71424_I.func_76318_c("frustum");
- ClippingHelperImpl.func_78558_a();
- this.field_78531_r.field_71424_I.func_76318_c("culling");
- ICamera icamera = new Frustum();
- Entity entity = this.field_78531_r.func_175606_aa();
- double d0 = entity.field_70142_S + (entity.field_70165_t - entity.field_70142_S) * (double)p_175068_2_;
- double d1 = entity.field_70137_T + (entity.field_70163_u - entity.field_70137_T) * (double)p_175068_2_;
- double d2 = entity.field_70136_U + (entity.field_70161_v - entity.field_70136_U) * (double)p_175068_2_;
- icamera.func_78547_a(d0, d1, d2);
- if(this.field_78531_r.field_71474_y.field_151451_c >= 4) {
- this.func_78468_a(-1, p_175068_2_);
- this.field_78531_r.field_71424_I.func_76318_c("sky");
- GlStateManager.func_179128_n(5889);
- GlStateManager.func_179096_D();
- 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);
- GlStateManager.func_179128_n(5888);
- renderglobal.func_174976_a(p_175068_2_, p_175068_1_);
- GlStateManager.func_179128_n(5889);
- GlStateManager.func_179096_D();
- 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);
- GlStateManager.func_179128_n(5888);
- }
- this.func_78468_a(0, p_175068_2_);
- GlStateManager.func_179103_j(7425);
- if(entity.field_70163_u + (double)entity.func_70047_e() < 128.0D) {
- this.func_180437_a(renderglobal, p_175068_2_, p_175068_1_, d0, d1, d2);
- }
- this.field_78531_r.field_71424_I.func_76318_c("prepareterrain");
- this.func_78468_a(0, p_175068_2_);
- this.field_78531_r.func_110434_K().func_110577_a(TextureMap.field_110575_b);
- RenderHelper.func_74518_a();
- this.field_78531_r.field_71424_I.func_76318_c("terrain_setup");
- renderglobal.func_174970_a(entity, (double)p_175068_2_, icamera, this.field_175084_ae++, this.field_78531_r.field_71439_g.func_175149_v());
- if(p_175068_1_ == 0 || p_175068_1_ == 2) {
- this.field_78531_r.field_71424_I.func_76318_c("updatechunks");
- this.field_78531_r.field_71438_f.func_174967_a(p_175068_3_);
- }
- this.field_78531_r.field_71424_I.func_76318_c("terrain");
- GlStateManager.func_179128_n(5888);
- GlStateManager.func_179094_E();
- GlStateManager.func_179118_c();
- renderglobal.func_174977_a(BlockRenderLayer.SOLID, (double)p_175068_2_, p_175068_1_, entity);
- GlStateManager.func_179141_d();
- renderglobal.func_174977_a(BlockRenderLayer.CUTOUT_MIPPED, (double)p_175068_2_, p_175068_1_, entity);
- this.field_78531_r.func_110434_K().func_110581_b(TextureMap.field_110575_b).func_174936_b(false, false);
- renderglobal.func_174977_a(BlockRenderLayer.CUTOUT, (double)p_175068_2_, p_175068_1_, entity);
- this.field_78531_r.func_110434_K().func_110581_b(TextureMap.field_110575_b).func_174935_a();
- GlStateManager.func_179103_j(7424);
- GlStateManager.func_179092_a(516, 0.1F);
- if(!this.field_175078_W) {
- GlStateManager.func_179128_n(5888);
- GlStateManager.func_179121_F();
- GlStateManager.func_179094_E();
- RenderHelper.func_74519_b();
- this.field_78531_r.field_71424_I.func_76318_c("entities");
- renderglobal.func_180446_a(entity, icamera, p_175068_2_);
- RenderHelper.func_74518_a();
- this.func_175072_h();
- }
- GlStateManager.func_179128_n(5888);
- GlStateManager.func_179121_F();
- if(flag && this.field_78531_r.field_71476_x != null && !entity.func_70055_a(Material.field_151586_h)) {
- EntityPlayer entityplayer = (EntityPlayer)entity;
- GlStateManager.func_179118_c();
- this.field_78531_r.field_71424_I.func_76318_c("outline");
- renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_175068_2_);
- GlStateManager.func_179141_d();
- }
- if(this.field_78531_r.field_184132_p.func_190074_a()) {
- this.field_78531_r.field_184132_p.func_190073_a(p_175068_2_, p_175068_3_);
- }
- this.field_78531_r.field_71424_I.func_76318_c("destroyProgress");
- GlStateManager.func_179147_l();
- GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
- this.field_78531_r.func_110434_K().func_110581_b(TextureMap.field_110575_b).func_174936_b(false, false);
- renderglobal.func_174981_a(Tessellator.func_178181_a(), Tessellator.func_178181_a().func_178180_c(), entity, p_175068_2_);
- this.field_78531_r.func_110434_K().func_110581_b(TextureMap.field_110575_b).func_174935_a();
- GlStateManager.func_179084_k();
- if(!this.field_175078_W) {
- this.func_180436_i();
- this.field_78531_r.field_71424_I.func_76318_c("litParticles");
- particlemanager.func_78872_b(entity, p_175068_2_);
- RenderHelper.func_74518_a();
- this.func_78468_a(0, p_175068_2_);
- this.field_78531_r.field_71424_I.func_76318_c("particles");
- particlemanager.func_78874_a(entity, p_175068_2_);
- this.func_175072_h();
- }
- GlStateManager.func_179132_a(false);
- GlStateManager.func_179089_o();
- this.field_78531_r.field_71424_I.func_76318_c("weather");
- this.func_78474_d(p_175068_2_);
- GlStateManager.func_179132_a(true);
- renderglobal.func_180449_a(entity, p_175068_2_);
- GlStateManager.func_179084_k();
- GlStateManager.func_179089_o();
- GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
- GlStateManager.func_179092_a(516, 0.1F);
- this.func_78468_a(0, p_175068_2_);
- GlStateManager.func_179147_l();
- GlStateManager.func_179132_a(false);
- this.field_78531_r.func_110434_K().func_110577_a(TextureMap.field_110575_b);
- GlStateManager.func_179103_j(7425);
- this.field_78531_r.field_71424_I.func_76318_c("translucent");
- renderglobal.func_174977_a(BlockRenderLayer.TRANSLUCENT, (double)p_175068_2_, p_175068_1_, entity);
- GlStateManager.func_179103_j(7424);
- GlStateManager.func_179132_a(true);
- GlStateManager.func_179089_o();
- GlStateManager.func_179084_k();
- GlStateManager.func_179106_n();
- if(entity.field_70163_u + (double)entity.func_70047_e() >= 128.0D) {
- this.field_78531_r.field_71424_I.func_76318_c("aboveClouds");
- this.func_180437_a(renderglobal, p_175068_2_, p_175068_1_, d0, d1, d2);
- }
- this.field_78531_r.field_71424_I.func_76318_c("hand");
- if(this.field_175074_C) {
- GlStateManager.func_179086_m(256);
- this.func_78476_b(p_175068_2_, p_175068_1_);
- }
- }
- 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_) {
- if(this.field_78531_r.field_71474_y.func_181147_e() != 0) {
- this.field_78531_r.field_71424_I.func_76318_c("clouds");
- GlStateManager.func_179128_n(5889);
- GlStateManager.func_179096_D();
- 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);
- GlStateManager.func_179128_n(5888);
- GlStateManager.func_179094_E();
- this.func_78468_a(0, p_180437_2_);
- p_180437_1_.func_180447_b(p_180437_2_, p_180437_3_, p_180437_4_, p_180437_6_, p_180437_8_);
- GlStateManager.func_179106_n();
- GlStateManager.func_179121_F();
- GlStateManager.func_179128_n(5889);
- GlStateManager.func_179096_D();
- 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);
- GlStateManager.func_179128_n(5888);
- }
- }
- private void func_78484_h() {
- float f = this.field_78531_r.field_71441_e.func_72867_j(1.0F);
- if(!this.field_78531_r.field_71474_y.field_74347_j) {
- f /= 2.0F;
- }
- if(f != 0.0F) {
- this.field_78537_ab.setSeed((long)this.field_78529_t * 312987231L);
- Entity entity = this.field_78531_r.func_175606_aa();
- World world = this.field_78531_r.field_71441_e;
- BlockPos blockpos = new BlockPos(entity);
- int i = 10;
- double d0 = 0.0D;
- double d1 = 0.0D;
- double d2 = 0.0D;
- int j = 0;
- int k = (int)(100.0F * f * f);
- if(this.field_78531_r.field_71474_y.field_74362_aa == 1) {
- k >>= 1;
- } else if(this.field_78531_r.field_71474_y.field_74362_aa == 2) {
- k = 0;
- }
- for(int l = 0; l < k; ++l) {
- 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)));
- Biome biome = world.func_180494_b(blockpos1);
- BlockPos blockpos2 = blockpos1.func_177977_b();
- IBlockState iblockstate = world.func_180495_p(blockpos2);
- 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) {
- double d3 = this.field_78537_ab.nextDouble();
- double d4 = this.field_78537_ab.nextDouble();
- AxisAlignedBB axisalignedbb = iblockstate.func_185900_c(world, blockpos2);
- if(iblockstate.func_185904_a() != Material.field_151587_i && iblockstate.func_177230_c() != Blocks.field_189877_df) {
- if(iblockstate.func_185904_a() != Material.field_151579_a) {
- ++j;
- if(this.field_78537_ab.nextInt(j) == 0) {
- d0 = (double)blockpos2.func_177958_n() + d3;
- d1 = (double)((float)blockpos2.func_177956_o() + 0.1F) + axisalignedbb.field_72337_e - 1.0D;
- d2 = (double)blockpos2.func_177952_p() + d4;
- }
- 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]);
- }
- } else {
- 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]);
- }
- }
- }
- if(j > 0 && this.field_78537_ab.nextInt(3) < this.field_78534_ac++) {
- this.field_78534_ac = 0;
- 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())) {
- this.field_78531_r.field_71441_e.func_184134_a(d0, d1, d2, SoundEvents.field_187919_gs, SoundCategory.WEATHER, 0.1F, 0.5F, false);
- } else {
- this.field_78531_r.field_71441_e.func_184134_a(d0, d1, d2, SoundEvents.field_187918_gr, SoundCategory.WEATHER, 0.2F, 1.0F, false);
- }
- }
- }
- }
- protected void func_78474_d(float p_78474_1_) {
- float f = this.field_78531_r.field_71441_e.func_72867_j(p_78474_1_);
- if(f > 0.0F) {
- this.func_180436_i();
- Entity entity = this.field_78531_r.func_175606_aa();
- World world = this.field_78531_r.field_71441_e;
- int i = MathHelper.func_76128_c(entity.field_70165_t);
- int j = MathHelper.func_76128_c(entity.field_70163_u);
- int k = MathHelper.func_76128_c(entity.field_70161_v);
- Tessellator tessellator = Tessellator.func_178181_a();
- BufferBuilder bufferbuilder = tessellator.func_178180_c();
- GlStateManager.func_179129_p();
- GlStateManager.func_187432_a(0.0F, 1.0F, 0.0F);
- GlStateManager.func_179147_l();
- GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
- GlStateManager.func_179092_a(516, 0.1F);
- double d0 = entity.field_70142_S + (entity.field_70165_t - entity.field_70142_S) * (double)p_78474_1_;
- double d1 = entity.field_70137_T + (entity.field_70163_u - entity.field_70137_T) * (double)p_78474_1_;
- double d2 = entity.field_70136_U + (entity.field_70161_v - entity.field_70136_U) * (double)p_78474_1_;
- int l = MathHelper.func_76128_c(d1);
- int i1 = 5;
- if(this.field_78531_r.field_71474_y.field_74347_j) {
- i1 = 10;
- }
- int j1 = -1;
- float f1 = (float)this.field_78529_t + p_78474_1_;
- bufferbuilder.func_178969_c(-d0, -d1, -d2);
- GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
- for(int k1 = k - i1; k1 <= k + i1; ++k1) {
- for(int l1 = i - i1; l1 <= i + i1; ++l1) {
- int i2 = (k1 - k + 16) * 32 + l1 - i + 16;
- double d3 = (double)this.field_175076_N[i2] * 0.5D;
- double d4 = (double)this.field_175077_O[i2] * 0.5D;
- blockpos$mutableblockpos.func_181079_c(l1, 0, k1);
- Biome biome = world.func_180494_b(blockpos$mutableblockpos);
- if(biome.func_76738_d() || biome.func_76746_c()) {
- int j2 = world.func_175725_q(blockpos$mutableblockpos).func_177956_o();
- int k2 = j - i1;
- int l2 = j + i1;
- if(k2 < j2) {
- k2 = j2;
- }
- if(l2 < j2) {
- l2 = j2;
- }
- int i3 = j2;
- if(j2 < l) {
- i3 = l;
- }
- if(k2 != l2) {
- this.field_78537_ab.setSeed((long)(l1 * l1 * 3121 + l1 * 45238971 ^ k1 * k1 * 418711 + k1 * 13761));
- blockpos$mutableblockpos.func_181079_c(l1, k2, k1);
- float f2 = biome.func_180626_a(blockpos$mutableblockpos);
- if(world.func_72959_q().func_76939_a(f2, j2) >= 0.15F) {
- if(j1 != 0) {
- if(j1 >= 0) {
- tessellator.func_78381_a();
- }
- j1 = 0;
- this.field_78531_r.func_110434_K().func_110577_a(field_110924_q);
- bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181704_d);
- }
- 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());
- double d6 = (double)((float)l1 + 0.5F) - entity.field_70165_t;
- double d7 = (double)((float)k1 + 0.5F) - entity.field_70161_v;
- float f3 = MathHelper.func_76133_a(d6 * d6 + d7 * d7) / (float)i1;
- float f4 = ((1.0F - f3 * f3) * 0.5F + 0.5F) * f;
- blockpos$mutableblockpos.func_181079_c(l1, i3, k1);
- int j3 = world.func_175626_b(blockpos$mutableblockpos, 0);
- int k3 = j3 >> 16 & '\uffff';
- int l3 = j3 & '\uffff';
- 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();
- 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();
- 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();
- 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();
- } else {
- if(j1 != 1) {
- if(j1 >= 0) {
- tessellator.func_78381_a();
- }
- j1 = 1;
- this.field_78531_r.func_110434_K().func_110577_a(field_110923_r);
- bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181704_d);
- }
- double d8 = (double)(-((float)(this.field_78529_t & 511) + p_78474_1_) / 512.0F);
- double d9 = this.field_78537_ab.nextDouble() + (double)f1 * 0.01D * (double)((float)this.field_78537_ab.nextGaussian());
- double d10 = this.field_78537_ab.nextDouble() + (double)(f1 * (float)this.field_78537_ab.nextGaussian()) * 0.001D;
- double d11 = (double)((float)l1 + 0.5F) - entity.field_70165_t;
- double d12 = (double)((float)k1 + 0.5F) - entity.field_70161_v;
- float f6 = MathHelper.func_76133_a(d11 * d11 + d12 * d12) / (float)i1;
- float f5 = ((1.0F - f6 * f6) * 0.3F + 0.5F) * f;
- blockpos$mutableblockpos.func_181079_c(l1, i3, k1);
- int i4 = (world.func_175626_b(blockpos$mutableblockpos, 0) * 3 + 15728880) / 4;
- int j4 = i4 >> 16 & '\uffff';
- int k4 = i4 & '\uffff';
- 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();
- 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();
- 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();
- 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();
- }
- }
- }
- }
- }
- if(j1 >= 0) {
- tessellator.func_78381_a();
- }
- bufferbuilder.func_178969_c(0.0D, 0.0D, 0.0D);
- GlStateManager.func_179089_o();
- GlStateManager.func_179084_k();
- GlStateManager.func_179092_a(516, 0.1F);
- this.func_175072_h();
- }
- }
- public void func_78478_c() {
- ScaledResolution scaledresolution = new ScaledResolution(this.field_78531_r);
- GlStateManager.func_179086_m(256);
- GlStateManager.func_179128_n(5889);
- GlStateManager.func_179096_D();
- GlStateManager.func_179130_a(0.0D, scaledresolution.func_78327_c(), scaledresolution.func_78324_d(), 0.0D, 1000.0D, 3000.0D);
- GlStateManager.func_179128_n(5888);
- GlStateManager.func_179096_D();
- GlStateManager.func_179109_b(0.0F, 0.0F, -2000.0F);
- }
- private void func_78466_h(float p_78466_1_) {
- World world = this.field_78531_r.field_71441_e;
- Entity entity = this.field_78531_r.func_175606_aa();
- float f = 0.25F + 0.75F * (float)this.field_78531_r.field_71474_y.field_151451_c / 32.0F;
- f = 1.0F - (float)Math.pow((double)f, 0.25D);
- Vec3d vec3d = world.func_72833_a(this.field_78531_r.func_175606_aa(), p_78466_1_);
- float f1 = (float)vec3d.field_72450_a;
- float f2 = (float)vec3d.field_72448_b;
- float f3 = (float)vec3d.field_72449_c;
- Vec3d vec3d1 = world.func_72948_g(p_78466_1_);
- this.field_175080_Q = (float)vec3d1.field_72450_a;
- this.field_175082_R = (float)vec3d1.field_72448_b;
- this.field_175081_S = (float)vec3d1.field_72449_c;
- if(this.field_78531_r.field_71474_y.field_151451_c >= 4) {
- double d0 = MathHelper.func_76126_a(world.func_72929_e(p_78466_1_)) > 0.0F?-1.0D:1.0D;
- Vec3d vec3d2 = new Vec3d(d0, 0.0D, 0.0D);
- float f5 = (float)entity.func_70676_i(p_78466_1_).func_72430_b(vec3d2);
- if(f5 < 0.0F) {
- f5 = 0.0F;
- }
- if(f5 > 0.0F) {
- float[] afloat = world.field_73011_w.func_76560_a(world.func_72826_c(p_78466_1_), p_78466_1_);
- if(afloat != null) {
- f5 = f5 * afloat[3];
- this.field_175080_Q = this.field_175080_Q * (1.0F - f5) + afloat[0] * f5;
- this.field_175082_R = this.field_175082_R * (1.0F - f5) + afloat[1] * f5;
- this.field_175081_S = this.field_175081_S * (1.0F - f5) + afloat[2] * f5;
- }
- }
- }
- this.field_175080_Q += (f1 - this.field_175080_Q) * f;
- this.field_175082_R += (f2 - this.field_175082_R) * f;
- this.field_175081_S += (f3 - this.field_175081_S) * f;
- float f8 = world.func_72867_j(p_78466_1_);
- if(f8 > 0.0F) {
- float f4 = 1.0F - f8 * 0.5F;
- float f10 = 1.0F - f8 * 0.4F;
- this.field_175080_Q *= f4;
- this.field_175082_R *= f4;
- this.field_175081_S *= f10;
- }
- float f9 = world.func_72819_i(p_78466_1_);
- if(f9 > 0.0F) {
- float f11 = 1.0F - f9 * 0.5F;
- this.field_175080_Q *= f11;
- this.field_175082_R *= f11;
- this.field_175081_S *= f11;
- }
- IBlockState iblockstate = ActiveRenderInfo.func_186703_a(this.field_78531_r.field_71441_e, entity, p_78466_1_);
- if(this.field_78500_U) {
- Vec3d vec3d3 = world.func_72824_f(p_78466_1_);
- this.field_175080_Q = (float)vec3d3.field_72450_a;
- this.field_175082_R = (float)vec3d3.field_72448_b;
- this.field_175081_S = (float)vec3d3.field_72449_c;
- } else if(iblockstate.func_185904_a() == Material.field_151586_h) {
- float f12 = 0.0F;
- if(entity instanceof EntityLivingBase) {
- f12 = (float)EnchantmentHelper.func_185292_c((EntityLivingBase)entity) * 0.2F;
- if(((EntityLivingBase)entity).func_70644_a(MobEffects.field_76427_o)) {
- f12 = f12 * 0.3F + 0.6F;
- }
- }
- this.field_175080_Q = 0.02F + f12;
- this.field_175082_R = 0.02F + f12;
- this.field_175081_S = 0.2F + f12;
- } else if(iblockstate.func_185904_a() == Material.field_151587_i) {
- this.field_175080_Q = 0.6F;
- this.field_175082_R = 0.1F;
- this.field_175081_S = 0.0F;
- }
- float f13 = this.field_78535_ad + (this.field_78539_ae - this.field_78535_ad) * p_78466_1_;
- this.field_175080_Q *= f13;
- this.field_175082_R *= f13;
- this.field_175081_S *= f13;
- 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();
- if(entity instanceof EntityLivingBase && ((EntityLivingBase)entity).func_70644_a(MobEffects.field_76440_q)) {
- int i = ((EntityLivingBase)entity).func_70660_b(MobEffects.field_76440_q).func_76459_b();
- if(i < 20) {
- d1 *= (double)(1.0F - (float)i / 20.0F);
- } else {
- d1 = 0.0D;
- }
- }
- if(d1 < 1.0D) {
- if(d1 < 0.0D) {
- d1 = 0.0D;
- }
- d1 = d1 * d1;
- this.field_175080_Q = (float)((double)this.field_175080_Q * d1);
- this.field_175082_R = (float)((double)this.field_175082_R * d1);
- this.field_175081_S = (float)((double)this.field_175081_S * d1);
- }
- if(this.field_82831_U > 0.0F) {
- float f14 = this.field_82832_V + (this.field_82831_U - this.field_82832_V) * p_78466_1_;
- this.field_175080_Q = this.field_175080_Q * (1.0F - f14) + this.field_175080_Q * 0.7F * f14;
- this.field_175082_R = this.field_175082_R * (1.0F - f14) + this.field_175082_R * 0.6F * f14;
- this.field_175081_S = this.field_175081_S * (1.0F - f14) + this.field_175081_S * 0.6F * f14;
- }
- if(entity instanceof EntityLivingBase && ((EntityLivingBase)entity).func_70644_a(MobEffects.field_76439_r)) {
- float f15 = this.func_180438_a((EntityLivingBase)entity, p_78466_1_);
- float f6 = 1.0F / this.field_175080_Q;
- if(f6 > 1.0F / this.field_175082_R) {
- f6 = 1.0F / this.field_175082_R;
- }
- if(f6 > 1.0F / this.field_175081_S) {
- f6 = 1.0F / this.field_175081_S;
- }
- this.field_175080_Q = this.field_175080_Q * (1.0F - f15) + this.field_175080_Q * f6 * f15;
- this.field_175082_R = this.field_175082_R * (1.0F - f15) + this.field_175082_R * f6 * f15;
- this.field_175081_S = this.field_175081_S * (1.0F - f15) + this.field_175081_S * f6 * f15;
- }
- if(this.field_78531_r.field_71474_y.field_74337_g) {
- float f16 = (this.field_175080_Q * 30.0F + this.field_175082_R * 59.0F + this.field_175081_S * 11.0F) / 100.0F;
- float f17 = (this.field_175080_Q * 30.0F + this.field_175082_R * 70.0F) / 100.0F;
- float f7 = (this.field_175080_Q * 30.0F + this.field_175081_S * 70.0F) / 100.0F;
- this.field_175080_Q = f16;
- this.field_175082_R = f17;
- this.field_175081_S = f7;
- }
- GlStateManager.func_179082_a(this.field_175080_Q, this.field_175082_R, this.field_175081_S, 0.0F);
- }
- private void func_78468_a(int p_78468_1_, float p_78468_2_) {
- Entity entity = this.field_78531_r.func_175606_aa();
- this.func_191514_d(false);
- GlStateManager.func_187432_a(0.0F, -1.0F, 0.0F);
- GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
- IBlockState iblockstate = ActiveRenderInfo.func_186703_a(this.field_78531_r.field_71441_e, entity, p_78468_2_);
- if(entity instanceof EntityLivingBase && ((EntityLivingBase)entity).func_70644_a(MobEffects.field_76440_q)) {
- float f1 = 5.0F;
- int i = ((EntityLivingBase)entity).func_70660_b(MobEffects.field_76440_q).func_76459_b();
- if(i < 20) {
- f1 = 5.0F + (this.field_78530_s - 5.0F) * (1.0F - (float)i / 20.0F);
- }
- GlStateManager.func_187430_a(GlStateManager.FogMode.LINEAR);
- if(p_78468_1_ == -1) {
- GlStateManager.func_179102_b(0.0F);
- GlStateManager.func_179153_c(f1 * 0.8F);
- } else {
- GlStateManager.func_179102_b(f1 * 0.25F);
- GlStateManager.func_179153_c(f1);
- }
- if(GLContext.getCapabilities().GL_NV_fog_distance) {
- GlStateManager.func_187412_c('\u855a', '\u855b');
- }
- } else if(this.field_78500_U) {
- GlStateManager.func_187430_a(GlStateManager.FogMode.EXP);
- GlStateManager.func_179095_a(0.1F);
- } else if(iblockstate.func_185904_a() == Material.field_151586_h) {
- GlStateManager.func_187430_a(GlStateManager.FogMode.EXP);
- if(entity instanceof EntityLivingBase) {
- if(((EntityLivingBase)entity).func_70644_a(MobEffects.field_76427_o)) {
- GlStateManager.func_179095_a(0.01F);
- } else {
- GlStateManager.func_179095_a(0.1F - (float)EnchantmentHelper.func_185292_c((EntityLivingBase)entity) * 0.03F);
- }
- } else {
- GlStateManager.func_179095_a(0.1F);
- }
- } else if(iblockstate.func_185904_a() == Material.field_151587_i) {
- GlStateManager.func_187430_a(GlStateManager.FogMode.EXP);
- GlStateManager.func_179095_a(2.0F);
- } else {
- float f = this.field_78530_s;
- GlStateManager.func_187430_a(GlStateManager.FogMode.LINEAR);
- if(p_78468_1_ == -1) {
- GlStateManager.func_179102_b(0.0F);
- GlStateManager.func_179153_c(f);
- } else {
- GlStateManager.func_179102_b(f * 0.75F);
- GlStateManager.func_179153_c(f);
- }
- if(GLContext.getCapabilities().GL_NV_fog_distance) {
- GlStateManager.func_187412_c('\u855a', '\u855b');
- }
- 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()) {
- GlStateManager.func_179102_b(f * 0.05F);
- GlStateManager.func_179153_c(Math.min(f, 192.0F) * 0.5F);
- }
- }
- GlStateManager.func_179142_g();
- GlStateManager.func_179127_m();
- GlStateManager.func_179104_a(1028, 4608);
- }
- public void func_191514_d(boolean p_191514_1_) {
- if(p_191514_1_) {
- GlStateManager.func_187402_b(2918, this.func_78469_a(0.0F, 0.0F, 0.0F, 1.0F));
- } else {
- GlStateManager.func_187402_b(2918, this.func_78469_a(this.field_175080_Q, this.field_175082_R, this.field_175081_S, 1.0F));
- }
- }
- private FloatBuffer func_78469_a(float p_78469_1_, float p_78469_2_, float p_78469_3_, float p_78469_4_) {
- this.field_78521_m.clear();
- this.field_78521_m.put(p_78469_1_).put(p_78469_2_).put(p_78469_3_).put(p_78469_4_);
- this.field_78521_m.flip();
- return this.field_78521_m;
- }
- public void func_190564_k() {
- this.field_190566_ab = null;
- this.field_147709_v.func_148249_a();
- }
- public MapItemRenderer func_147701_i() {
- return this.field_147709_v;
- }
- 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_) {
- GlStateManager.func_179094_E();
- GlStateManager.func_179109_b(p_189692_2_, p_189692_3_, p_189692_4_);
- GlStateManager.func_187432_a(0.0F, 1.0F, 0.0F);
- GlStateManager.func_179114_b(-p_189692_6_, 0.0F, 1.0F, 0.0F);
- GlStateManager.func_179114_b((float)(p_189692_8_?-1:1) * p_189692_7_, 1.0F, 0.0F, 0.0F);
- GlStateManager.func_179152_a(-0.025F, -0.025F, 0.025F);
- GlStateManager.func_179140_f();
- GlStateManager.func_179132_a(false);
- if(!p_189692_9_) {
- GlStateManager.func_179097_i();
- }
- GlStateManager.func_179147_l();
- GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
- int i = p_189692_0_.func_78256_a(p_189692_1_) / 2;
- GlStateManager.func_179090_x();
- Tessellator tessellator = Tessellator.func_178181_a();
- BufferBuilder bufferbuilder = tessellator.func_178180_c();
- bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181706_f);
- 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();
- 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();
- 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();
- 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();
- tessellator.func_78381_a();
- GlStateManager.func_179098_w();
- if(!p_189692_9_) {
- p_189692_0_.func_78276_b(p_189692_1_, -p_189692_0_.func_78256_a(p_189692_1_) / 2, p_189692_5_, 553648127);
- GlStateManager.func_179126_j();
- }
- GlStateManager.func_179132_a(true);
- 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);
- GlStateManager.func_179145_e();
- GlStateManager.func_179084_k();
- GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
- GlStateManager.func_179121_F();
- }
- public void func_190565_a(ItemStack p_190565_1_) {
- this.field_190566_ab = p_190565_1_;
- this.field_190567_ac = 40;
- this.field_190568_ad = this.field_78537_ab.nextFloat() * 2.0F - 1.0F;
- this.field_190569_ae = this.field_78537_ab.nextFloat() * 2.0F - 1.0F;
- }
- private void func_190563_a(int p_190563_1_, int p_190563_2_, float p_190563_3_) {
- if(this.field_190566_ab != null && this.field_190567_ac > 0) {
- int i = 40 - this.field_190567_ac;
- float f = ((float)i + p_190563_3_) / 40.0F;
- float f1 = f * f;
- float f2 = f * f1;
- float f3 = 10.25F * f2 * f1 + -24.95F * f1 * f1 + 25.5F * f2 + -13.8F * f1 + 4.0F * f;
- float f4 = f3 * 3.1415927F;
- float f5 = this.field_190568_ad * (float)(p_190563_1_ / 4);
- float f6 = this.field_190569_ae * (float)(p_190563_2_ / 4);
- GlStateManager.func_179141_d();
- GlStateManager.func_179094_E();
- GlStateManager.func_179123_a();
- GlStateManager.func_179126_j();
- GlStateManager.func_179129_p();
- RenderHelper.func_74519_b();
- 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);
- float f7 = 50.0F + 175.0F * MathHelper.func_76126_a(f4);
- GlStateManager.func_179152_a(f7, -f7, f7);
- GlStateManager.func_179114_b(900.0F * MathHelper.func_76135_e(MathHelper.func_76126_a(f4)), 0.0F, 1.0F, 0.0F);
- GlStateManager.func_179114_b(6.0F * MathHelper.func_76134_b(f * 8.0F), 1.0F, 0.0F, 0.0F);
- GlStateManager.func_179114_b(6.0F * MathHelper.func_76134_b(f * 8.0F), 0.0F, 0.0F, 1.0F);
- this.field_78531_r.func_175599_af().func_181564_a(this.field_190566_ab, ItemCameraTransforms.TransformType.FIXED);
- GlStateManager.func_179099_b();
- GlStateManager.func_179121_F();
- RenderHelper.func_74518_a();
- GlStateManager.func_179089_o();
- GlStateManager.func_179097_i();
- }
- }
- }
- Patching failed: minecraft\net\minecraft\client\renderer\ItemRenderer.java
- Hunk 1 failed! Cannot find hunk target
- GlStateManager.func_179114_b(200.0F, 1.0F, 0.0F, 0.0F);
- GlStateManager.func_179114_b(f * -135.0F, 0.0F, 1.0F, 0.0F);
- GlStateManager.func_179109_b(f * 5.6F, 0.0F, 0.0F);
- - RenderPlayer renderplayer = (RenderPlayer)this.field_178111_g.func_78713_a(abstractclientplayer);
- + RenderPlayer renderplayer = (RenderPlayer)this.field_178111_g.<AbstractClientPlayer>func_78713_a(abstractclientplayer);
- GlStateManager.func_179129_p();
- if (flag) {
- renderplayer.func_177138_b(abstractclientplayer);
- File state
- package net.minecraft.client.renderer;
- import com.google.common.base.MoreObjects;
- import java.util.Objects;
- import net.minecraft.block.Block;
- import net.minecraft.block.material.Material;
- import net.minecraft.block.state.IBlockState;
- import net.minecraft.client.Minecraft;
- import net.minecraft.client.entity.AbstractClientPlayer;
- import net.minecraft.client.entity.EntityPlayerSP;
- import net.minecraft.client.renderer.BufferBuilder;
- import net.minecraft.client.renderer.GlStateManager;
- import net.minecraft.client.renderer.OpenGlHelper;
- import net.minecraft.client.renderer.RenderHelper;
- import net.minecraft.client.renderer.RenderItem;
- import net.minecraft.client.renderer.Tessellator;
- import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
- import net.minecraft.client.renderer.entity.Render;
- import net.minecraft.client.renderer.entity.RenderManager;
- import net.minecraft.client.renderer.entity.RenderPlayer;
- import net.minecraft.client.renderer.texture.TextureAtlasSprite;
- import net.minecraft.client.renderer.texture.TextureMap;
- import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.init.Items;
- import net.minecraft.item.Item;
- import net.minecraft.item.ItemStack;
- import net.minecraft.util.BlockRenderLayer;
- import net.minecraft.util.EnumBlockRenderType;
- import net.minecraft.util.EnumHand;
- import net.minecraft.util.EnumHandSide;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.util.math.MathHelper;
- import net.minecraft.world.storage.MapData;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- @SideOnly(Side.CLIENT)
- public class ItemRenderer {
- private static final ResourceLocation field_110931_c = new ResourceLocation("textures/map/map_background.png");
- private static final ResourceLocation field_110929_d = new ResourceLocation("textures/misc/underwater.png");
- private final Minecraft field_78455_a;
- private ItemStack field_187467_d = ItemStack.field_190927_a;
- private ItemStack field_187468_e = ItemStack.field_190927_a;
- private float field_187469_f;
- private float field_187470_g;
- private float field_187471_h;
- private float field_187472_i;
- private final RenderManager field_178111_g;
- private final RenderItem field_178112_h;
- public ItemRenderer(Minecraft p_i1247_1_) {
- this.field_78455_a = p_i1247_1_;
- this.field_178111_g = p_i1247_1_.func_175598_ae();
- this.field_178112_h = p_i1247_1_.func_175599_af();
- }
- public void func_178099_a(EntityLivingBase p_178099_1_, ItemStack p_178099_2_, ItemCameraTransforms.TransformType p_178099_3_) {
- this.func_187462_a(p_178099_1_, p_178099_2_, p_178099_3_, false);
- }
- public void func_187462_a(EntityLivingBase p_187462_1_, ItemStack p_187462_2_, ItemCameraTransforms.TransformType p_187462_3_, boolean p_187462_4_) {
- if(!p_187462_2_.func_190926_b()) {
- Item item = p_187462_2_.func_77973_b();
- Block block = Block.func_149634_a(item);
- GlStateManager.func_179094_E();
- boolean flag = this.field_178112_h.func_175050_a(p_187462_2_) && block.func_180664_k() == BlockRenderLayer.TRANSLUCENT;
- if(flag) {
- GlStateManager.func_179132_a(false);
- }
- this.field_178112_h.func_184392_a(p_187462_2_, p_187462_1_, p_187462_3_, p_187462_4_);
- if(flag) {
- GlStateManager.func_179132_a(true);
- }
- GlStateManager.func_179121_F();
- }
- }
- private void func_178101_a(float p_178101_1_, float p_178101_2_) {
- GlStateManager.func_179094_E();
- GlStateManager.func_179114_b(p_178101_1_, 1.0F, 0.0F, 0.0F);
- GlStateManager.func_179114_b(p_178101_2_, 0.0F, 1.0F, 0.0F);
- RenderHelper.func_74519_b();
- GlStateManager.func_179121_F();
- }
- private void func_187464_b() {
- AbstractClientPlayer abstractclientplayer = this.field_78455_a.field_71439_g;
- 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);
- float f = (float)(i & '\uffff');
- float f1 = (float)(i >> 16);
- OpenGlHelper.func_77475_a(OpenGlHelper.field_77476_b, f, f1);
- }
- private void func_187458_c(float p_187458_1_) {
- EntityPlayerSP entityplayersp = this.field_78455_a.field_71439_g;
- float f = entityplayersp.field_71164_i + (entityplayersp.field_71155_g - entityplayersp.field_71164_i) * p_187458_1_;
- float f1 = entityplayersp.field_71163_h + (entityplayersp.field_71154_f - entityplayersp.field_71163_h) * p_187458_1_;
- GlStateManager.func_179114_b((entityplayersp.field_70125_A - f) * 0.1F, 1.0F, 0.0F, 0.0F);
- GlStateManager.func_179114_b((entityplayersp.field_70177_z - f1) * 0.1F, 0.0F, 1.0F, 0.0F);
- }
- private float func_178100_c(float p_178100_1_) {
- float f = 1.0F - p_178100_1_ / 45.0F + 0.1F;
- f = MathHelper.func_76131_a(f, 0.0F, 1.0F);
- f = -MathHelper.func_76134_b(f * 3.1415927F) * 0.5F + 0.5F;
- return f;
- }
- private void func_187466_c() {
- if(!this.field_78455_a.field_71439_g.func_82150_aj()) {
- GlStateManager.func_179129_p();
- GlStateManager.func_179094_E();
- GlStateManager.func_179114_b(90.0F, 0.0F, 1.0F, 0.0F);
- this.func_187455_a(EnumHandSide.RIGHT);
- this.func_187455_a(EnumHandSide.LEFT);
- GlStateManager.func_179121_F();
- GlStateManager.func_179089_o();
- }
- }
- private void func_187455_a(EnumHandSide p_187455_1_) {
- this.field_78455_a.func_110434_K().func_110577_a(this.field_78455_a.field_71439_g.func_110306_p());
- Render<AbstractClientPlayer> render = this.field_178111_g.<AbstractClientPlayer>func_78713_a(this.field_78455_a.field_71439_g);
- RenderPlayer renderplayer = (RenderPlayer)render;
- GlStateManager.func_179094_E();
- float f = p_187455_1_ == EnumHandSide.RIGHT?1.0F:-1.0F;
- GlStateManager.func_179114_b(92.0F, 0.0F, 1.0F, 0.0F);
- GlStateManager.func_179114_b(45.0F, 1.0F, 0.0F, 0.0F);
- GlStateManager.func_179114_b(f * -41.0F, 0.0F, 0.0F, 1.0F);
- GlStateManager.func_179109_b(f * 0.3F, -1.1F, 0.45F);
- if(p_187455_1_ == EnumHandSide.RIGHT) {
- renderplayer.func_177138_b(this.field_78455_a.field_71439_g);
- } else {
- renderplayer.func_177139_c(this.field_78455_a.field_71439_g);
- }
- GlStateManager.func_179121_F();
- }
- private void func_187465_a(float p_187465_1_, EnumHandSide p_187465_2_, float p_187465_3_, ItemStack p_187465_4_) {
- float f = p_187465_2_ == EnumHandSide.RIGHT?1.0F:-1.0F;
- GlStateManager.func_179109_b(f * 0.125F, -0.125F, 0.0F);
- if(!this.field_78455_a.field_71439_g.func_82150_aj()) {
- GlStateManager.func_179094_E();
- GlStateManager.func_179114_b(f * 10.0F, 0.0F, 0.0F, 1.0F);
- this.func_187456_a(p_187465_1_, p_187465_3_, p_187465_2_);
- GlStateManager.func_179121_F();
- }
- GlStateManager.func_179094_E();
- GlStateManager.func_179109_b(f * 0.51F, -0.08F + p_187465_1_ * -1.2F, -0.75F);
- float f1 = MathHelper.func_76129_c(p_187465_3_);
- float f2 = MathHelper.func_76126_a(f1 * 3.1415927F);
- float f3 = -0.5F * f2;
- float f4 = 0.4F * MathHelper.func_76126_a(f1 * 6.2831855F);
- float f5 = -0.3F * MathHelper.func_76126_a(p_187465_3_ * 3.1415927F);
- GlStateManager.func_179109_b(f * f3, f4 - 0.3F * f2, f5);
- GlStateManager.func_179114_b(f2 * -45.0F, 1.0F, 0.0F, 0.0F);
- GlStateManager.func_179114_b(f * f2 * -30.0F, 0.0F, 1.0F, 0.0F);
- this.func_187461_a(p_187465_4_);
- GlStateManager.func_179121_F();
- }
- private void func_187463_a(float p_187463_1_, float p_187463_2_, float p_187463_3_) {
- float f = MathHelper.func_76129_c(p_187463_3_);
- float f1 = -0.2F * MathHelper.func_76126_a(p_187463_3_ * 3.1415927F);
- float f2 = -0.4F * MathHelper.func_76126_a(f * 3.1415927F);
- GlStateManager.func_179109_b(0.0F, -f1 / 2.0F, f2);
- float f3 = this.func_178100_c(p_187463_1_);
- GlStateManager.func_179109_b(0.0F, 0.04F + p_187463_2_ * -1.2F + f3 * -0.5F, -0.72F);
- GlStateManager.func_179114_b(f3 * -85.0F, 1.0F, 0.0F, 0.0F);
- this.func_187466_c();
- float f4 = MathHelper.func_76126_a(f * 3.1415927F);
- GlStateManager.func_179114_b(f4 * 20.0F, 1.0F, 0.0F, 0.0F);
- GlStateManager.func_179152_a(2.0F, 2.0F, 2.0F);
- this.func_187461_a(this.field_187467_d);
- }
- private void func_187461_a(ItemStack p_187461_1_) {
- GlStateManager.func_179114_b(180.0F, 0.0F, 1.0F, 0.0F);
- GlStateManager.func_179114_b(180.0F, 0.0F, 0.0F, 1.0F);
- GlStateManager.func_179152_a(0.38F, 0.38F, 0.38F);
- GlStateManager.func_179140_f();
- this.field_78455_a.func_110434_K().func_110577_a(field_110931_c);
- Tessellator tessellator = Tessellator.func_178181_a();
- BufferBuilder bufferbuilder = tessellator.func_178180_c();
- GlStateManager.func_179109_b(-0.5F, -0.5F, 0.0F);
- GlStateManager.func_179152_a(0.0078125F, 0.0078125F, 0.0078125F);
- bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181707_g);
- bufferbuilder.func_181662_b(-7.0D, 135.0D, 0.0D).func_187315_a(0.0D, 1.0D).func_181675_d();
- bufferbuilder.func_181662_b(135.0D, 135.0D, 0.0D).func_187315_a(1.0D, 1.0D).func_181675_d();
- bufferbuilder.func_181662_b(135.0D, -7.0D, 0.0D).func_187315_a(1.0D, 0.0D).func_181675_d();
- bufferbuilder.func_181662_b(-7.0D, -7.0D, 0.0D).func_187315_a(0.0D, 0.0D).func_181675_d();
- tessellator.func_78381_a();
- MapData mapdata = Items.field_151098_aY.func_77873_a(p_187461_1_, this.field_78455_a.field_71441_e);
- if(mapdata != null) {
- this.field_78455_a.field_71460_t.func_147701_i().func_148250_a(mapdata, false);
- }
- GlStateManager.func_179145_e();
- }
- private void func_187456_a(float p_187456_1_, float p_187456_2_, EnumHandSide p_187456_3_) {
- boolean flag = p_187456_3_ != EnumHandSide.LEFT;
- float f = flag?1.0F:-1.0F;
- float f1 = MathHelper.func_76129_c(p_187456_2_);
- float f2 = -0.3F * MathHelper.func_76126_a(f1 * 3.1415927F);
- float f3 = 0.4F * MathHelper.func_76126_a(f1 * 6.2831855F);
- float f4 = -0.4F * MathHelper.func_76126_a(p_187456_2_ * 3.1415927F);
- GlStateManager.func_179109_b(f * (f2 + 0.64000005F), f3 + -0.6F + p_187456_1_ * -0.6F, f4 + -0.71999997F);
- GlStateManager.func_179114_b(f * 45.0F, 0.0F, 1.0F, 0.0F);
- float f5 = MathHelper.func_76126_a(p_187456_2_ * p_187456_2_ * 3.1415927F);
- float f6 = MathHelper.func_76126_a(f1 * 3.1415927F);
- GlStateManager.func_179114_b(f * f6 * 70.0F, 0.0F, 1.0F, 0.0F);
- GlStateManager.func_179114_b(f * f5 * -20.0F, 0.0F, 0.0F, 1.0F);
- AbstractClientPlayer abstractclientplayer = this.field_78455_a.field_71439_g;
- this.field_78455_a.func_110434_K().func_110577_a(abstractclientplayer.func_110306_p());
- GlStateManager.func_179109_b(f * -1.0F, 3.6F, 3.5F);
- GlStateManager.func_179114_b(f * 120.0F, 0.0F, 0.0F, 1.0F);
- GlStateManager.func_179114_b(200.0F, 1.0F, 0.0F, 0.0F);
- GlStateManager.func_179114_b(f * -135.0F, 0.0F, 1.0F, 0.0F);
- GlStateManager.func_179109_b(f * 5.6F, 0.0F, 0.0F);
- RenderPlayer renderplayer = (RenderPlayer)this.field_178111_g.func_78713_a(abstractclientplayer);
- GlStateManager.func_179129_p();
- if(flag) {
- renderplayer.func_177138_b(abstractclientplayer);
- } else {
- renderplayer.func_177139_c(abstractclientplayer);
- }
- GlStateManager.func_179089_o();
- }
- private void func_187454_a(float p_187454_1_, EnumHandSide p_187454_2_, ItemStack p_187454_3_) {
- float f = (float)this.field_78455_a.field_71439_g.func_184605_cv() - p_187454_1_ + 1.0F;
- float f1 = f / (float)p_187454_3_.func_77988_m();
- if(f1 < 0.8F) {
- float f2 = MathHelper.func_76135_e(MathHelper.func_76134_b(f / 4.0F * 3.1415927F) * 0.1F);
- GlStateManager.func_179109_b(0.0F, f2, 0.0F);
- }
- float f3 = 1.0F - (float)Math.pow((double)f1, 27.0D);
- int i = p_187454_2_ == EnumHandSide.RIGHT?1:-1;
- GlStateManager.func_179109_b(f3 * 0.6F * (float)i, f3 * -0.5F, f3 * 0.0F);
- GlStateManager.func_179114_b((float)i * f3 * 90.0F, 0.0F, 1.0F, 0.0F);
- GlStateManager.func_179114_b(f3 * 10.0F, 1.0F, 0.0F, 0.0F);
- GlStateManager.func_179114_b((float)i * f3 * 30.0F, 0.0F, 0.0F, 1.0F);
- }
- private void func_187453_a(EnumHandSide p_187453_1_, float p_187453_2_) {
- int i = p_187453_1_ == EnumHandSide.RIGHT?1:-1;
- float f = MathHelper.func_76126_a(p_187453_2_ * p_187453_2_ * 3.1415927F);
- GlStateManager.func_179114_b((float)i * (45.0F + f * -20.0F), 0.0F, 1.0F, 0.0F);
- float f1 = MathHelper.func_76126_a(MathHelper.func_76129_c(p_187453_2_) * 3.1415927F);
- GlStateManager.func_179114_b((float)i * f1 * -20.0F, 0.0F, 0.0F, 1.0F);
- GlStateManager.func_179114_b(f1 * -80.0F, 1.0F, 0.0F, 0.0F);
- GlStateManager.func_179114_b((float)i * -45.0F, 0.0F, 1.0F, 0.0F);
- }
- private void func_187459_b(EnumHandSide p_187459_1_, float p_187459_2_) {
- int i = p_187459_1_ == EnumHandSide.RIGHT?1:-1;
- GlStateManager.func_179109_b((float)i * 0.56F, -0.52F + p_187459_2_ * -0.6F, -0.72F);
- }
- public void func_78440_a(float p_78440_1_) {
- AbstractClientPlayer abstractclientplayer = this.field_78455_a.field_71439_g;
- float f = abstractclientplayer.func_70678_g(p_78440_1_);
- EnumHand enumhand = (EnumHand)MoreObjects.firstNonNull(abstractclientplayer.field_184622_au, EnumHand.MAIN_HAND);
- float f1 = abstractclientplayer.field_70127_C + (abstractclientplayer.field_70125_A - abstractclientplayer.field_70127_C) * p_78440_1_;
- float f2 = abstractclientplayer.field_70126_B + (abstractclientplayer.field_70177_z - abstractclientplayer.field_70126_B) * p_78440_1_;
- boolean flag = true;
- boolean flag1 = true;
- if(abstractclientplayer.func_184587_cr()) {
- ItemStack itemstack = abstractclientplayer.func_184607_cu();
- if(itemstack.func_77973_b() == Items.field_151031_f) {
- EnumHand enumhand1 = abstractclientplayer.func_184600_cs();
- flag = enumhand1 == EnumHand.MAIN_HAND;
- flag1 = !flag;
- }
- }
- this.func_178101_a(f1, f2);
- this.func_187464_b();
- this.func_187458_c(p_78440_1_);
- GlStateManager.func_179091_B();
- if(flag) {
- float f3 = enumhand == EnumHand.MAIN_HAND?f:0.0F;
- float f5 = 1.0F - (this.field_187470_g + (this.field_187469_f - this.field_187470_g) * p_78440_1_);
- this.func_187457_a(abstractclientplayer, p_78440_1_, f1, EnumHand.MAIN_HAND, f3, this.field_187467_d, f5);
- }
- if(flag1) {
- float f4 = enumhand == EnumHand.OFF_HAND?f:0.0F;
- float f6 = 1.0F - (this.field_187472_i + (this.field_187471_h - this.field_187472_i) * p_78440_1_);
- this.func_187457_a(abstractclientplayer, p_78440_1_, f1, EnumHand.OFF_HAND, f4, this.field_187468_e, f6);
- }
- GlStateManager.func_179101_C();
- RenderHelper.func_74518_a();
- }
- 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_) {
- boolean flag = p_187457_4_ == EnumHand.MAIN_HAND;
- EnumHandSide enumhandside = flag?p_187457_1_.func_184591_cq():p_187457_1_.func_184591_cq().func_188468_a();
- GlStateManager.func_179094_E();
- if(p_187457_6_.func_190926_b()) {
- if(flag && !p_187457_1_.func_82150_aj()) {
- this.func_187456_a(p_187457_7_, p_187457_5_, enumhandside);
- }
- } else if(p_187457_6_.func_77973_b() == Items.field_151098_aY) {
- if(flag && this.field_187468_e.func_190926_b()) {
- this.func_187463_a(p_187457_3_, p_187457_7_, p_187457_5_);
- } else {
- this.func_187465_a(p_187457_7_, enumhandside, p_187457_5_, p_187457_6_);
- }
- } else {
- boolean flag1 = enumhandside == EnumHandSide.RIGHT;
- if(p_187457_1_.func_184587_cr() && p_187457_1_.func_184605_cv() > 0 && p_187457_1_.func_184600_cs() == p_187457_4_) {
- int j = flag1?1:-1;
- switch(p_187457_6_.func_77975_n()) {
- case NONE:
- this.func_187459_b(enumhandside, p_187457_7_);
- break;
- case EAT:
- case DRINK:
- this.func_187454_a(p_187457_2_, enumhandside, p_187457_6_);
- this.func_187459_b(enumhandside, p_187457_7_);
- break;
- case BLOCK:
- this.func_187459_b(enumhandside, p_187457_7_);
- break;
- case BOW:
- this.func_187459_b(enumhandside, p_187457_7_);
- GlStateManager.func_179109_b((float)j * -0.2785682F, 0.18344387F, 0.15731531F);
- GlStateManager.func_179114_b(-13.935F, 1.0F, 0.0F, 0.0F);
- GlStateManager.func_179114_b((float)j * 35.3F, 0.0F, 1.0F, 0.0F);
- GlStateManager.func_179114_b((float)j * -9.785F, 0.0F, 0.0F, 1.0F);
- 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);
- float f6 = f5 / 20.0F;
- f6 = (f6 * f6 + f6 * 2.0F) / 3.0F;
- if(f6 > 1.0F) {
- f6 = 1.0F;
- }
- if(f6 > 0.1F) {
- float f7 = MathHelper.func_76126_a((f5 - 0.1F) * 1.3F);
- float f3 = f6 - 0.1F;
- float f4 = f7 * f3;
- GlStateManager.func_179109_b(f4 * 0.0F, f4 * 0.004F, f4 * 0.0F);
- }
- GlStateManager.func_179109_b(f6 * 0.0F, f6 * 0.0F, f6 * 0.04F);
- GlStateManager.func_179152_a(1.0F, 1.0F, 1.0F + f6 * 0.2F);
- GlStateManager.func_179114_b((float)j * 45.0F, 0.0F, -1.0F, 0.0F);
- }
- } else {
- float f = -0.4F * MathHelper.func_76126_a(MathHelper.func_76129_c(p_187457_5_) * 3.1415927F);
- float f1 = 0.2F * MathHelper.func_76126_a(MathHelper.func_76129_c(p_187457_5_) * 6.2831855F);
- float f2 = -0.2F * MathHelper.func_76126_a(p_187457_5_ * 3.1415927F);
- int i = flag1?1:-1;
- GlStateManager.func_179109_b((float)i * f, f1, f2);
- this.func_187459_b(enumhandside, p_187457_7_);
- this.func_187453_a(enumhandside, p_187457_5_);
- }
- this.func_187462_a(p_187457_1_, p_187457_6_, flag1?ItemCameraTransforms.TransformType.FIRST_PERSON_RIGHT_HAND:ItemCameraTransforms.TransformType.FIRST_PERSON_LEFT_HAND, !flag1);
- }
- GlStateManager.func_179121_F();
- }
- public void func_78447_b(float p_78447_1_) {
- GlStateManager.func_179118_c();
- if(this.field_78455_a.field_71439_g.func_70094_T()) {
- IBlockState iblockstate = this.field_78455_a.field_71441_e.func_180495_p(new BlockPos(this.field_78455_a.field_71439_g));
- EntityPlayer entityplayer = this.field_78455_a.field_71439_g;
- for(int i = 0; i < 8; ++i) {
- double d0 = entityplayer.field_70165_t + (double)(((float)((i >> 0) % 2) - 0.5F) * entityplayer.field_70130_N * 0.8F);
- double d1 = entityplayer.field_70163_u + (double)(((float)((i >> 1) % 2) - 0.5F) * 0.1F);
- double d2 = entityplayer.field_70161_v + (double)(((float)((i >> 2) % 2) - 0.5F) * entityplayer.field_70130_N * 0.8F);
- BlockPos blockpos = new BlockPos(d0, d1 + (double)entityplayer.func_70047_e(), d2);
- IBlockState iblockstate1 = this.field_78455_a.field_71441_e.func_180495_p(blockpos);
- if(iblockstate1.func_191058_s()) {
- iblockstate = iblockstate1;
- }
- }
- if(iblockstate.func_185901_i() != EnumBlockRenderType.INVISIBLE) {
- this.func_178108_a(this.field_78455_a.func_175602_ab().func_175023_a().func_178122_a(iblockstate));
- }
- }
- if(!this.field_78455_a.field_71439_g.func_175149_v()) {
- if(this.field_78455_a.field_71439_g.func_70055_a(Material.field_151586_h)) {
- this.func_78448_c(p_78447_1_);
- }
- if(this.field_78455_a.field_71439_g.func_70027_ad()) {
- this.func_78442_d();
- }
- }
- GlStateManager.func_179141_d();
- }
- private void func_178108_a(TextureAtlasSprite p_178108_1_) {
- this.field_78455_a.func_110434_K().func_110577_a(TextureMap.field_110575_b);
- Tessellator tessellator = Tessellator.func_178181_a();
- BufferBuilder bufferbuilder = tessellator.func_178180_c();
- float f = 0.1F;
- GlStateManager.func_179131_c(0.1F, 0.1F, 0.1F, 0.5F);
- GlStateManager.func_179094_E();
- float f1 = -1.0F;
- float f2 = 1.0F;
- float f3 = -1.0F;
- float f4 = 1.0F;
- float f5 = -0.5F;
- float f6 = p_178108_1_.func_94209_e();
- float f7 = p_178108_1_.func_94212_f();
- float f8 = p_178108_1_.func_94206_g();
- float f9 = p_178108_1_.func_94210_h();
- bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181707_g);
- bufferbuilder.func_181662_b(-1.0D, -1.0D, -0.5D).func_187315_a((double)f7, (double)f9).func_181675_d();
- bufferbuilder.func_181662_b(1.0D, -1.0D, -0.5D).func_187315_a((double)f6, (double)f9).func_181675_d();
- bufferbuilder.func_181662_b(1.0D, 1.0D, -0.5D).func_187315_a((double)f6, (double)f8).func_181675_d();
- bufferbuilder.func_181662_b(-1.0D, 1.0D, -0.5D).func_187315_a((double)f7, (double)f8).func_181675_d();
- tessellator.func_78381_a();
- GlStateManager.func_179121_F();
- GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
- }
- private void func_78448_c(float p_78448_1_) {
- this.field_78455_a.func_110434_K().func_110577_a(field_110929_d);
- Tessellator tessellator = Tessellator.func_178181_a();
- BufferBuilder bufferbuilder = tessellator.func_178180_c();
- float f = this.field_78455_a.field_71439_g.func_70013_c();
- GlStateManager.func_179131_c(f, f, f, 0.5F);
- GlStateManager.func_179147_l();
- GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
- GlStateManager.func_179094_E();
- float f1 = 4.0F;
- float f2 = -1.0F;
- float f3 = 1.0F;
- float f4 = -1.0F;
- float f5 = 1.0F;
- float f6 = -0.5F;
- float f7 = -this.field_78455_a.field_71439_g.field_70177_z / 64.0F;
- float f8 = this.field_78455_a.field_71439_g.field_70125_A / 64.0F;
- bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181707_g);
- bufferbuilder.func_181662_b(-1.0D, -1.0D, -0.5D).func_187315_a((double)(4.0F + f7), (double)(4.0F + f8)).func_181675_d();
- bufferbuilder.func_181662_b(1.0D, -1.0D, -0.5D).func_187315_a((double)(0.0F + f7), (double)(4.0F + f8)).func_181675_d();
- bufferbuilder.func_181662_b(1.0D, 1.0D, -0.5D).func_187315_a((double)(0.0F + f7), (double)(0.0F + f8)).func_181675_d();
- bufferbuilder.func_181662_b(-1.0D, 1.0D, -0.5D).func_187315_a((double)(4.0F + f7), (double)(0.0F + f8)).func_181675_d();
- tessellator.func_78381_a();
- GlStateManager.func_179121_F();
- GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
- GlStateManager.func_179084_k();
- }
- private void func_78442_d() {
- Tessellator tessellator = Tessellator.func_178181_a();
- BufferBuilder bufferbuilder = tessellator.func_178180_c();
- GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 0.9F);
- GlStateManager.func_179143_c(519);
- GlStateManager.func_179132_a(false);
- GlStateManager.func_179147_l();
- GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
- float f = 1.0F;
- for(int i = 0; i < 2; ++i) {
- GlStateManager.func_179094_E();
- TextureAtlasSprite textureatlassprite = this.field_78455_a.func_147117_R().func_110572_b("minecraft:blocks/fire_layer_1");
- this.field_78455_a.func_110434_K().func_110577_a(TextureMap.field_110575_b);
- float f1 = textureatlassprite.func_94209_e();
- float f2 = textureatlassprite.func_94212_f();
- float f3 = textureatlassprite.func_94206_g();
- float f4 = textureatlassprite.func_94210_h();
- float f5 = -0.5F;
- float f6 = 0.5F;
- float f7 = -0.5F;
- float f8 = 0.5F;
- float f9 = -0.5F;
- GlStateManager.func_179109_b((float)(-(i * 2 - 1)) * 0.24F, -0.3F, 0.0F);
- GlStateManager.func_179114_b((float)(i * 2 - 1) * 10.0F, 0.0F, 1.0F, 0.0F);
- bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181707_g);
- bufferbuilder.func_181662_b(-0.5D, -0.5D, -0.5D).func_187315_a((double)f2, (double)f4).func_181675_d();
- bufferbuilder.func_181662_b(0.5D, -0.5D, -0.5D).func_187315_a((double)f1, (double)f4).func_181675_d();
- bufferbuilder.func_181662_b(0.5D, 0.5D, -0.5D).func_187315_a((double)f1, (double)f3).func_181675_d();
- bufferbuilder.func_181662_b(-0.5D, 0.5D, -0.5D).func_187315_a((double)f2, (double)f3).func_181675_d();
- tessellator.func_78381_a();
- GlStateManager.func_179121_F();
- }
- GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
- GlStateManager.func_179084_k();
- GlStateManager.func_179132_a(true);
- GlStateManager.func_179143_c(515);
- }
- public void func_78441_a() {
- this.field_187470_g = this.field_187469_f;
- this.field_187472_i = this.field_187471_h;
- EntityPlayerSP entityplayersp = this.field_78455_a.field_71439_g;
- ItemStack itemstack = entityplayersp.func_184614_ca();
- ItemStack itemstack1 = entityplayersp.func_184592_cb();
- if(entityplayersp.func_184838_M()) {
- this.field_187469_f = MathHelper.func_76131_a(this.field_187469_f - 0.4F, 0.0F, 1.0F);
- this.field_187471_h = MathHelper.func_76131_a(this.field_187471_h - 0.4F, 0.0F, 1.0F);
- } else {
- float f = entityplayersp.func_184825_o(1.0F);
- 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);
- 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);
- }
- if(this.field_187469_f < 0.1F) {
- this.field_187467_d = itemstack;
- }
- if(this.field_187471_h < 0.1F) {
- this.field_187468_e = itemstack1;
- }
- }
- public void func_187460_a(EnumHand p_187460_1_) {
- if(p_187460_1_ == EnumHand.MAIN_HAND) {
- this.field_187469_f = 0.0F;
- } else {
- this.field_187471_h = 0.0F;
- }
- }
- }
- Patching failed: minecraft\net\minecraft\client\renderer\RenderGlobal.java
- Hunk 1 failed! Cannot find hunk target
- return l;
- }
- + @SuppressWarnings("incomplete-switch")
- private void func_174982_a(BlockRenderLayer p_174982_1_) {
- this.field_72777_q.field_71460_t.func_180436_i();
- if (OpenGlHelper.func_176075_f()) {
- File state
- package net.minecraft.client.renderer;
- import com.google.common.collect.Lists;
- import com.google.common.collect.Maps;
- import com.google.common.collect.Queues;
- import com.google.common.collect.Sets;
- import com.google.gson.JsonSyntaxException;
- import java.io.IOException;
- import java.util.Collection;
- import java.util.Iterator;
- import java.util.List;
- import java.util.Map;
- import java.util.Queue;
- import java.util.Random;
- import java.util.Set;
- import javax.annotation.Nullable;
- import net.minecraft.block.Block;
- import net.minecraft.block.BlockChest;
- import net.minecraft.block.BlockEnderChest;
- import net.minecraft.block.BlockSign;
- import net.minecraft.block.BlockSkull;
- import net.minecraft.block.SoundType;
- import net.minecraft.block.material.Material;
- import net.minecraft.block.state.IBlockState;
- import net.minecraft.client.Minecraft;
- import net.minecraft.client.audio.ISound;
- import net.minecraft.client.audio.PositionedSoundRecord;
- import net.minecraft.client.multiplayer.WorldClient;
- import net.minecraft.client.particle.Particle;
- import net.minecraft.client.renderer.BlockRendererDispatcher;
- import net.minecraft.client.renderer.BufferBuilder;
- import net.minecraft.client.renderer.ChunkRenderContainer;
- import net.minecraft.client.renderer.DestroyBlockProgress;
- import net.minecraft.client.renderer.GLAllocation;
- import net.minecraft.client.renderer.GlStateManager;
- import net.minecraft.client.renderer.Matrix4f;
- import net.minecraft.client.renderer.OpenGlHelper;
- import net.minecraft.client.renderer.RenderHelper;
- import net.minecraft.client.renderer.RenderList;
- import net.minecraft.client.renderer.Tessellator;
- import net.minecraft.client.renderer.VboRenderList;
- import net.minecraft.client.renderer.Vector3d;
- import net.minecraft.client.renderer.ViewFrustum;
- import net.minecraft.client.renderer.chunk.ChunkRenderDispatcher;
- import net.minecraft.client.renderer.chunk.CompiledChunk;
- import net.minecraft.client.renderer.chunk.IRenderChunkFactory;
- import net.minecraft.client.renderer.chunk.ListChunkFactory;
- import net.minecraft.client.renderer.chunk.RenderChunk;
- import net.minecraft.client.renderer.chunk.VboChunkFactory;
- import net.minecraft.client.renderer.chunk.VisGraph;
- import net.minecraft.client.renderer.culling.ClippingHelper;
- import net.minecraft.client.renderer.culling.ClippingHelperImpl;
- import net.minecraft.client.renderer.culling.Frustum;
- import net.minecraft.client.renderer.culling.ICamera;
- import net.minecraft.client.renderer.entity.RenderManager;
- import net.minecraft.client.renderer.texture.TextureAtlasSprite;
- import net.minecraft.client.renderer.texture.TextureManager;
- import net.minecraft.client.renderer.texture.TextureMap;
- import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
- import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
- import net.minecraft.client.renderer.vertex.VertexBuffer;
- import net.minecraft.client.renderer.vertex.VertexFormat;
- import net.minecraft.client.renderer.vertex.VertexFormatElement;
- import net.minecraft.client.resources.IResourceManager;
- import net.minecraft.client.resources.IResourceManagerReloadListener;
- import net.minecraft.client.shader.Framebuffer;
- import net.minecraft.client.shader.ShaderGroup;
- import net.minecraft.client.shader.ShaderLinkHelper;
- import net.minecraft.crash.CrashReport;
- import net.minecraft.crash.CrashReportCategory;
- import net.minecraft.crash.ICrashReportDetail;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.init.Blocks;
- import net.minecraft.init.Items;
- import net.minecraft.init.SoundEvents;
- import net.minecraft.item.Item;
- import net.minecraft.item.ItemDye;
- import net.minecraft.item.ItemRecord;
- import net.minecraft.tileentity.TileEntity;
- import net.minecraft.tileentity.TileEntityChest;
- import net.minecraft.util.BlockRenderLayer;
- import net.minecraft.util.ClassInheritanceMultiMap;
- import net.minecraft.util.EnumFacing;
- import net.minecraft.util.EnumParticleTypes;
- import net.minecraft.util.ReportedException;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.util.SoundCategory;
- import net.minecraft.util.SoundEvent;
- import net.minecraft.util.math.AxisAlignedBB;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.util.math.MathHelper;
- import net.minecraft.util.math.RayTraceResult;
- import net.minecraft.util.math.Vec3d;
- import net.minecraft.world.IWorldEventListener;
- import net.minecraft.world.World;
- import net.minecraft.world.border.WorldBorder;
- import net.minecraft.world.chunk.Chunk;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- import org.apache.logging.log4j.LogManager;
- import org.apache.logging.log4j.Logger;
- import org.lwjgl.util.vector.Vector3f;
- import org.lwjgl.util.vector.Vector4f;
- @SideOnly(Side.CLIENT)
- public class RenderGlobal implements IWorldEventListener, IResourceManagerReloadListener {
- private static final Logger field_147599_m = LogManager.getLogger();
- private static final ResourceLocation field_110927_h = new ResourceLocation("textures/environment/moon_phases.png");
- private static final ResourceLocation field_110928_i = new ResourceLocation("textures/environment/sun.png");
- private static final ResourceLocation field_110925_j = new ResourceLocation("textures/environment/clouds.png");
- private static final ResourceLocation field_110926_k = new ResourceLocation("textures/environment/end_sky.png");
- private static final ResourceLocation field_175006_g = new ResourceLocation("textures/misc/forcefield.png");
- private final Minecraft field_72777_q;
- private final TextureManager field_72770_i;
- private final RenderManager field_175010_j;
- private WorldClient field_72769_h;
- private Set<RenderChunk> field_175009_l = Sets.<RenderChunk>newLinkedHashSet();
- private List<RenderGlobal.ContainerLocalRenderInformation> field_72755_R = Lists.<RenderGlobal.ContainerLocalRenderInformation>newArrayListWithCapacity(69696);
- private final Set<TileEntity> field_181024_n = Sets.<TileEntity>newHashSet();
- private ViewFrustum field_175008_n;
- private int field_72772_v = -1;
- private int field_72771_w = -1;
- private int field_72781_x = -1;
- private final VertexFormat field_175014_r;
- private VertexBuffer field_175013_s;
- private VertexBuffer field_175012_t;
- private VertexBuffer field_175011_u;
- private int field_72773_u;
- private final Map<Integer, DestroyBlockProgress> field_72738_E = Maps.<Integer, DestroyBlockProgress>newHashMap();
- private final Map<BlockPos, ISound> field_147593_P = Maps.<BlockPos, ISound>newHashMap();
- private final TextureAtlasSprite[] field_94141_F = new TextureAtlasSprite[10];
- private Framebuffer field_175015_z;
- private ShaderGroup field_174991_A;
- private double field_174992_B = Double.MIN_VALUE;
- private double field_174993_C = Double.MIN_VALUE;
- private double field_174987_D = Double.MIN_VALUE;
- private int field_174988_E = Integer.MIN_VALUE;
- private int field_174989_F = Integer.MIN_VALUE;
- private int field_174990_G = Integer.MIN_VALUE;
- private double field_174997_H = Double.MIN_VALUE;
- private double field_174998_I = Double.MIN_VALUE;
- private double field_174999_J = Double.MIN_VALUE;
- private double field_175000_K = Double.MIN_VALUE;
- private double field_174994_L = Double.MIN_VALUE;
- private ChunkRenderDispatcher field_174995_M;
- private ChunkRenderContainer field_174996_N;
- private int field_72739_F = -1;
- private int field_72740_G = 2;
- private int field_72748_H;
- private int field_72749_I;
- private int field_72750_J;
- private boolean field_175002_T;
- private ClippingHelper field_175001_U;
- private final Vector4f[] field_175004_V = new Vector4f[8];
- private final Vector3d field_175003_W = new Vector3d();
- private boolean field_175005_X;
- IRenderChunkFactory field_175007_a;
- private double field_147596_f;
- private double field_147597_g;
- private double field_147602_h;
- private boolean field_147595_R = true;
- private boolean field_184386_ad;
- private final Set<BlockPos> field_184387_ae = Sets.<BlockPos>newHashSet();
- public RenderGlobal(Minecraft p_i1249_1_) {
- this.field_72777_q = p_i1249_1_;
- this.field_175010_j = p_i1249_1_.func_175598_ae();
- this.field_72770_i = p_i1249_1_.func_110434_K();
- this.field_72770_i.func_110577_a(field_175006_g);
- GlStateManager.func_187421_b(3553, 10242, 10497);
- GlStateManager.func_187421_b(3553, 10243, 10497);
- GlStateManager.func_179144_i(0);
- this.func_174971_n();
- this.field_175005_X = OpenGlHelper.func_176075_f();
- if(this.field_175005_X) {
- this.field_174996_N = new VboRenderList();
- this.field_175007_a = new VboChunkFactory();
- } else {
- this.field_174996_N = new RenderList();
- this.field_175007_a = new ListChunkFactory();
- }
- this.field_175014_r = new VertexFormat();
- this.field_175014_r.func_181721_a(new VertexFormatElement(0, VertexFormatElement.EnumType.FLOAT, VertexFormatElement.EnumUsage.POSITION, 3));
- this.func_174963_q();
- this.func_174980_p();
- this.func_174964_o();
- }
- public void func_110549_a(IResourceManager p_110549_1_) {
- this.func_174971_n();
- }
- private void func_174971_n() {
- TextureMap texturemap = this.field_72777_q.func_147117_R();
- for(int i = 0; i < this.field_94141_F.length; ++i) {
- this.field_94141_F[i] = texturemap.func_110572_b("minecraft:blocks/destroy_stage_" + i);
- }
- }
- public void func_174966_b() {
- if(OpenGlHelper.field_148824_g) {
- if(ShaderLinkHelper.func_148074_b() == null) {
- ShaderLinkHelper.func_148076_a();
- }
- ResourceLocation resourcelocation = new ResourceLocation("shaders/post/entity_outline.json");
- try {
- 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);
- this.field_174991_A.func_148026_a(this.field_72777_q.field_71443_c, this.field_72777_q.field_71440_d);
- this.field_175015_z = this.field_174991_A.func_177066_a("final");
- } catch (IOException ioexception) {
- field_147599_m.warn((String)"Failed to load shader: {}", (Object)resourcelocation, (Object)ioexception);
- this.field_174991_A = null;
- this.field_175015_z = null;
- } catch (JsonSyntaxException jsonsyntaxexception) {
- field_147599_m.warn((String)"Failed to load shader: {}", (Object)resourcelocation, (Object)jsonsyntaxexception);
- this.field_174991_A = null;
- this.field_175015_z = null;
- }
- } else {
- this.field_174991_A = null;
- this.field_175015_z = null;
- }
- }
- public void func_174975_c() {
- if(this.func_174985_d()) {
- GlStateManager.func_179147_l();
- GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ZERO, GlStateManager.DestFactor.ONE);
- this.field_175015_z.func_178038_a(this.field_72777_q.field_71443_c, this.field_72777_q.field_71440_d, false);
- GlStateManager.func_179084_k();
- }
- }
- protected boolean func_174985_d() {
- return this.field_175015_z != null && this.field_174991_A != null && this.field_72777_q.field_71439_g != null;
- }
- private void func_174964_o() {
- Tessellator tessellator = Tessellator.func_178181_a();
- BufferBuilder bufferbuilder = tessellator.func_178180_c();
- if(this.field_175011_u != null) {
- this.field_175011_u.func_177362_c();
- }
- if(this.field_72781_x >= 0) {
- GLAllocation.func_74523_b(this.field_72781_x);
- this.field_72781_x = -1;
- }
- if(this.field_175005_X) {
- this.field_175011_u = new VertexBuffer(this.field_175014_r);
- this.func_174968_a(bufferbuilder, -16.0F, true);
- bufferbuilder.func_178977_d();
- bufferbuilder.func_178965_a();
- this.field_175011_u.func_181722_a(bufferbuilder.func_178966_f());
- } else {
- this.field_72781_x = GLAllocation.func_74526_a(1);
- GlStateManager.func_187423_f(this.field_72781_x, 4864);
- this.func_174968_a(bufferbuilder, -16.0F, true);
- tessellator.func_78381_a();
- GlStateManager.func_187415_K();
- }
- }
- private void func_174980_p() {
- Tessellator tessellator = Tessellator.func_178181_a();
- BufferBuilder bufferbuilder = tessellator.func_178180_c();
- if(this.field_175012_t != null) {
- this.field_175012_t.func_177362_c();
- }
- if(this.field_72771_w >= 0) {
- GLAllocation.func_74523_b(this.field_72771_w);
- this.field_72771_w = -1;
- }
- if(this.field_175005_X) {
- this.field_175012_t = new VertexBuffer(this.field_175014_r);
- this.func_174968_a(bufferbuilder, 16.0F, false);
- bufferbuilder.func_178977_d();
- bufferbuilder.func_178965_a();
- this.field_175012_t.func_181722_a(bufferbuilder.func_178966_f());
- } else {
- this.field_72771_w = GLAllocation.func_74526_a(1);
- GlStateManager.func_187423_f(this.field_72771_w, 4864);
- this.func_174968_a(bufferbuilder, 16.0F, false);
- tessellator.func_78381_a();
- GlStateManager.func_187415_K();
- }
- }
- private void func_174968_a(BufferBuilder p_174968_1_, float p_174968_2_, boolean p_174968_3_) {
- int i = 64;
- int j = 6;
- p_174968_1_.func_181668_a(7, DefaultVertexFormats.field_181705_e);
- for(int k = -384; k <= 384; k += 64) {
- for(int l = -384; l <= 384; l += 64) {
- float f = (float)k;
- float f1 = (float)(k + 64);
- if(p_174968_3_) {
- f1 = (float)k;
- f = (float)(k + 64);
- }
- p_174968_1_.func_181662_b((double)f, (double)p_174968_2_, (double)l).func_181675_d();
- p_174968_1_.func_181662_b((double)f1, (double)p_174968_2_, (double)l).func_181675_d();
- p_174968_1_.func_181662_b((double)f1, (double)p_174968_2_, (double)(l + 64)).func_181675_d();
- p_174968_1_.func_181662_b((double)f, (double)p_174968_2_, (double)(l + 64)).func_181675_d();
- }
- }
- }
- private void func_174963_q() {
- Tessellator tessellator = Tessellator.func_178181_a();
- BufferBuilder bufferbuilder = tessellator.func_178180_c();
- if(this.field_175013_s != null) {
- this.field_175013_s.func_177362_c();
- }
- if(this.field_72772_v >= 0) {
- GLAllocation.func_74523_b(this.field_72772_v);
- this.field_72772_v = -1;
- }
- if(this.field_175005_X) {
- this.field_175013_s = new VertexBuffer(this.field_175014_r);
- this.func_180444_a(bufferbuilder);
- bufferbuilder.func_178977_d();
- bufferbuilder.func_178965_a();
- this.field_175013_s.func_181722_a(bufferbuilder.func_178966_f());
- } else {
- this.field_72772_v = GLAllocation.func_74526_a(1);
- GlStateManager.func_179094_E();
- GlStateManager.func_187423_f(this.field_72772_v, 4864);
- this.func_180444_a(bufferbuilder);
- tessellator.func_78381_a();
- GlStateManager.func_187415_K();
- GlStateManager.func_179121_F();
- }
- }
- private void func_180444_a(BufferBuilder p_180444_1_) {
- Random random = new Random(10842L);
- p_180444_1_.func_181668_a(7, DefaultVertexFormats.field_181705_e);
- for(int i = 0; i < 1500; ++i) {
- double d0 = (double)(random.nextFloat() * 2.0F - 1.0F);
- double d1 = (double)(random.nextFloat() * 2.0F - 1.0F);
- double d2 = (double)(random.nextFloat() * 2.0F - 1.0F);
- double d3 = (double)(0.15F + random.nextFloat() * 0.1F);
- double d4 = d0 * d0 + d1 * d1 + d2 * d2;
- if(d4 < 1.0D && d4 > 0.01D) {
- d4 = 1.0D / Math.sqrt(d4);
- d0 = d0 * d4;
- d1 = d1 * d4;
- d2 = d2 * d4;
- double d5 = d0 * 100.0D;
- double d6 = d1 * 100.0D;
- double d7 = d2 * 100.0D;
- double d8 = Math.atan2(d0, d2);
- double d9 = Math.sin(d8);
- double d10 = Math.cos(d8);
- double d11 = Math.atan2(Math.sqrt(d0 * d0 + d2 * d2), d1);
- double d12 = Math.sin(d11);
- double d13 = Math.cos(d11);
- double d14 = random.nextDouble() * 3.141592653589793D * 2.0D;
- double d15 = Math.sin(d14);
- double d16 = Math.cos(d14);
- for(int j = 0; j < 4; ++j) {
- double d17 = 0.0D;
- double d18 = (double)((j & 2) - 1) * d3;
- double d19 = (double)((j + 1 & 2) - 1) * d3;
- double d20 = 0.0D;
- double d21 = d18 * d16 - d19 * d15;
- double d22 = d19 * d16 + d18 * d15;
- double d23 = d21 * d12 + 0.0D * d13;
- double d24 = 0.0D * d12 - d21 * d13;
- double d25 = d24 * d9 - d22 * d10;
- double d26 = d22 * d9 + d24 * d10;
- p_180444_1_.func_181662_b(d5 + d25, d6 + d23, d7 + d26).func_181675_d();
- }
- }
- }
- }
- public void func_72732_a(@Nullable WorldClient p_72732_1_) {
- if(this.field_72769_h != null) {
- this.field_72769_h.func_72848_b(this);
- }
- this.field_174992_B = Double.MIN_VALUE;
- this.field_174993_C = Double.MIN_VALUE;
- this.field_174987_D = Double.MIN_VALUE;
- this.field_174988_E = Integer.MIN_VALUE;
- this.field_174989_F = Integer.MIN_VALUE;
- this.field_174990_G = Integer.MIN_VALUE;
- this.field_175010_j.func_78717_a(p_72732_1_);
- this.field_72769_h = p_72732_1_;
- if(p_72732_1_ != null) {
- p_72732_1_.func_72954_a(this);
- this.func_72712_a();
- } else {
- this.field_175009_l.clear();
- this.field_72755_R.clear();
- if(this.field_175008_n != null) {
- this.field_175008_n.func_178160_a();
- this.field_175008_n = null;
- }
- if(this.field_174995_M != null) {
- this.field_174995_M.func_188244_g();
- }
- this.field_174995_M = null;
- }
- }
- public void func_72712_a() {
- if(this.field_72769_h != null) {
- if(this.field_174995_M == null) {
- this.field_174995_M = new ChunkRenderDispatcher();
- }
- this.field_147595_R = true;
- Blocks.field_150362_t.func_150122_b(this.field_72777_q.field_71474_y.field_74347_j);
- Blocks.field_150361_u.func_150122_b(this.field_72777_q.field_71474_y.field_74347_j);
- this.field_72739_F = this.field_72777_q.field_71474_y.field_151451_c;
- boolean flag = this.field_175005_X;
- this.field_175005_X = OpenGlHelper.func_176075_f();
- if(flag && !this.field_175005_X) {
- this.field_174996_N = new RenderList();
- this.field_175007_a = new ListChunkFactory();
- } else if(!flag && this.field_175005_X) {
- this.field_174996_N = new VboRenderList();
- this.field_175007_a = new VboChunkFactory();
- }
- if(flag != this.field_175005_X) {
- this.func_174963_q();
- this.func_174980_p();
- this.func_174964_o();
- }
- if(this.field_175008_n != null) {
- this.field_175008_n.func_178160_a();
- }
- this.func_174986_e();
- synchronized(this.field_181024_n) {
- this.field_181024_n.clear();
- }
- 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);
- if(this.field_72769_h != null) {
- Entity entity = this.field_72777_q.func_175606_aa();
- if(entity != null) {
- this.field_175008_n.func_178163_a(entity.field_70165_t, entity.field_70161_v);
- }
- }
- this.field_72740_G = 2;
- }
- }
- protected void func_174986_e() {
- this.field_175009_l.clear();
- this.field_174995_M.func_178514_b();
- }
- public void func_72720_a(int p_72720_1_, int p_72720_2_) {
- if(OpenGlHelper.field_148824_g) {
- if(this.field_174991_A != null) {
- this.field_174991_A.func_148026_a(p_72720_1_, p_72720_2_);
- }
- }
- }
- public void func_180446_a(Entity p_180446_1_, ICamera p_180446_2_, float p_180446_3_) {
- if(this.field_72740_G > 0) {
- --this.field_72740_G;
- } else {
- double d0 = p_180446_1_.field_70169_q + (p_180446_1_.field_70165_t - p_180446_1_.field_70169_q) * (double)p_180446_3_;
- double d1 = p_180446_1_.field_70167_r + (p_180446_1_.field_70163_u - p_180446_1_.field_70167_r) * (double)p_180446_3_;
- double d2 = p_180446_1_.field_70166_s + (p_180446_1_.field_70161_v - p_180446_1_.field_70166_s) * (double)p_180446_3_;
- this.field_72769_h.field_72984_F.func_76320_a("prepare");
- 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_);
- 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_);
- this.field_72748_H = 0;
- this.field_72749_I = 0;
- this.field_72750_J = 0;
- Entity entity = this.field_72777_q.func_175606_aa();
- double d3 = entity.field_70142_S + (entity.field_70165_t - entity.field_70142_S) * (double)p_180446_3_;
- double d4 = entity.field_70137_T + (entity.field_70163_u - entity.field_70137_T) * (double)p_180446_3_;
- double d5 = entity.field_70136_U + (entity.field_70161_v - entity.field_70136_U) * (double)p_180446_3_;
- TileEntityRendererDispatcher.field_147554_b = d3;
- TileEntityRendererDispatcher.field_147555_c = d4;
- TileEntityRendererDispatcher.field_147552_d = d5;
- this.field_175010_j.func_178628_a(d3, d4, d5);
- this.field_72777_q.field_71460_t.func_180436_i();
- this.field_72769_h.field_72984_F.func_76318_c("global");
- List<Entity> list = this.field_72769_h.func_72910_y();
- this.field_72748_H = list.size();
- for(int i = 0; i < this.field_72769_h.field_73007_j.size(); ++i) {
- Entity entity1 = (Entity)this.field_72769_h.field_73007_j.get(i);
- ++this.field_72749_I;
- if(entity1.func_145770_h(d0, d1, d2)) {
- this.field_175010_j.func_188388_a(entity1, p_180446_3_, false);
- }
- }
- this.field_72769_h.field_72984_F.func_76318_c("entities");
- List<Entity> list1 = Lists.<Entity>newArrayList();
- List<Entity> list2 = Lists.<Entity>newArrayList();
- BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
- for(RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation : this.field_72755_R) {
- Chunk chunk = this.field_72769_h.func_175726_f(renderglobal$containerlocalrenderinformation.field_178036_a.func_178568_j());
- ClassInheritanceMultiMap<Entity> classinheritancemultimap = chunk.func_177429_s()[renderglobal$containerlocalrenderinformation.field_178036_a.func_178568_j().func_177956_o() / 16];
- if(!classinheritancemultimap.isEmpty()) {
- for(Entity entity2 : classinheritancemultimap) {
- 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);
- if(flag) {
- boolean flag1 = this.field_72777_q.func_175606_aa() instanceof EntityLivingBase?((EntityLivingBase)this.field_72777_q.func_175606_aa()).func_70608_bn():false;
- 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)))) {
- ++this.field_72749_I;
- this.field_175010_j.func_188388_a(entity2, p_180446_3_, false);
- if(this.func_184383_a(entity2, entity, p_180446_2_)) {
- list1.add(entity2);
- }
- if(this.field_175010_j.func_188390_b(entity2)) {
- list2.add(entity2);
- }
- }
- }
- }
- }
- }
- blockpos$pooledmutableblockpos.func_185344_t();
- if(!list2.isEmpty()) {
- for(Entity entity3 : list2) {
- this.field_175010_j.func_188389_a(entity3, p_180446_3_);
- }
- }
- if(this.func_174985_d() && (!list1.isEmpty() || this.field_184386_ad)) {
- this.field_72769_h.field_72984_F.func_76318_c("entityOutlines");
- this.field_175015_z.func_147614_f();
- this.field_184386_ad = !list1.isEmpty();
- if(!list1.isEmpty()) {
- GlStateManager.func_179143_c(519);
- GlStateManager.func_179106_n();
- this.field_175015_z.func_147610_a(false);
- RenderHelper.func_74518_a();
- this.field_175010_j.func_178632_c(true);
- for(int j = 0; j < ((List)list1).size(); ++j) {
- this.field_175010_j.func_188388_a((Entity)list1.get(j), p_180446_3_, false);
- }
- this.field_175010_j.func_178632_c(false);
- RenderHelper.func_74519_b();
- GlStateManager.func_179132_a(false);
- this.field_174991_A.func_148018_a(p_180446_3_);
- GlStateManager.func_179145_e();
- GlStateManager.func_179132_a(true);
- GlStateManager.func_179127_m();
- GlStateManager.func_179147_l();
- GlStateManager.func_179142_g();
- GlStateManager.func_179143_c(515);
- GlStateManager.func_179126_j();
- GlStateManager.func_179141_d();
- }
- this.field_72777_q.func_147110_a().func_147610_a(false);
- }
- this.field_72769_h.field_72984_F.func_76318_c("blockentities");
- RenderHelper.func_74519_b();
- for(RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation1 : this.field_72755_R) {
- List<TileEntity> list3 = renderglobal$containerlocalrenderinformation1.field_178036_a.func_178571_g().func_178485_b();
- if(!list3.isEmpty()) {
- for(TileEntity tileentity2 : list3) {
- TileEntityRendererDispatcher.field_147556_a.func_180546_a(tileentity2, p_180446_3_, -1);
- }
- }
- }
- synchronized(this.field_181024_n) {
- for(TileEntity tileentity : this.field_181024_n) {
- TileEntityRendererDispatcher.field_147556_a.func_180546_a(tileentity, p_180446_3_, -1);
- }
- }
- this.func_180443_s();
- for(DestroyBlockProgress destroyblockprogress : this.field_72738_E.values()) {
- BlockPos blockpos = destroyblockprogress.func_180246_b();
- if(this.field_72769_h.func_180495_p(blockpos).func_177230_c().func_149716_u()) {
- TileEntity tileentity1 = this.field_72769_h.func_175625_s(blockpos);
- if(tileentity1 instanceof TileEntityChest) {
- TileEntityChest tileentitychest = (TileEntityChest)tileentity1;
- if(tileentitychest.field_145991_k != null) {
- blockpos = blockpos.func_177972_a(EnumFacing.WEST);
- tileentity1 = this.field_72769_h.func_175625_s(blockpos);
- } else if(tileentitychest.field_145992_i != null) {
- blockpos = blockpos.func_177972_a(EnumFacing.NORTH);
- tileentity1 = this.field_72769_h.func_175625_s(blockpos);
- }
- }
- IBlockState iblockstate = this.field_72769_h.func_180495_p(blockpos);
- if(tileentity1 != null && iblockstate.func_191057_i()) {
- TileEntityRendererDispatcher.field_147556_a.func_180546_a(tileentity1, p_180446_3_, destroyblockprogress.func_73106_e());
- }
- }
- }
- this.func_174969_t();
- this.field_72777_q.field_71460_t.func_175072_h();
- this.field_72777_q.field_71424_I.func_76319_b();
- }
- }
- private boolean func_184383_a(Entity p_184383_1_, Entity p_184383_2_, ICamera p_184383_3_) {
- boolean flag = p_184383_2_ instanceof EntityLivingBase && ((EntityLivingBase)p_184383_2_).func_70608_bn();
- 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));
- }
- public String func_72735_c() {
- int i = this.field_175008_n.field_178164_f.length;
- int j = this.func_184382_g();
- 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()});
- }
- protected int func_184382_g() {
- int i = 0;
- for(RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation : this.field_72755_R) {
- CompiledChunk compiledchunk = renderglobal$containerlocalrenderinformation.field_178036_a.field_178590_b;
- if(compiledchunk != CompiledChunk.field_178502_a && !compiledchunk.func_178489_a()) {
- ++i;
- }
- }
- return i;
- }
- public String func_72723_d() {
- return "E: " + this.field_72749_I + "/" + this.field_72748_H + ", B: " + this.field_72750_J;
- }
- 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_) {
- if(this.field_72777_q.field_71474_y.field_151451_c != this.field_72739_F) {
- this.func_72712_a();
- }
- this.field_72769_h.field_72984_F.func_76320_a("camera");
- double d0 = p_174970_1_.field_70165_t - this.field_174992_B;
- double d1 = p_174970_1_.field_70163_u - this.field_174993_C;
- double d2 = p_174970_1_.field_70161_v - this.field_174987_D;
- 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) {
- this.field_174992_B = p_174970_1_.field_70165_t;
- this.field_174993_C = p_174970_1_.field_70163_u;
- this.field_174987_D = p_174970_1_.field_70161_v;
- 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;
- this.field_175008_n.func_178163_a(p_174970_1_.field_70165_t, p_174970_1_.field_70161_v);
- }
- this.field_72769_h.field_72984_F.func_76318_c("renderlistcamera");
- double d3 = p_174970_1_.field_70142_S + (p_174970_1_.field_70165_t - p_174970_1_.field_70142_S) * p_174970_2_;
- double d4 = p_174970_1_.field_70137_T + (p_174970_1_.field_70163_u - p_174970_1_.field_70137_T) * p_174970_2_;
- double d5 = p_174970_1_.field_70136_U + (p_174970_1_.field_70161_v - p_174970_1_.field_70136_U) * p_174970_2_;
- this.field_174996_N.func_178004_a(d3, d4, d5);
- this.field_72769_h.field_72984_F.func_76318_c("cull");
- if(this.field_175001_U != null) {
- Frustum frustum = new Frustum(this.field_175001_U);
- 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);
- p_174970_4_ = frustum;
- }
- this.field_72777_q.field_71424_I.func_76318_c("culling");
- BlockPos blockpos1 = new BlockPos(d3, d4 + (double)p_174970_1_.func_70047_e(), d5);
- RenderChunk renderchunk = this.field_175008_n.func_178161_a(blockpos1);
- 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);
- 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;
- this.field_174997_H = p_174970_1_.field_70165_t;
- this.field_174998_I = p_174970_1_.field_70163_u;
- this.field_174999_J = p_174970_1_.field_70161_v;
- this.field_175000_K = (double)p_174970_1_.field_70125_A;
- this.field_174994_L = (double)p_174970_1_.field_70177_z;
- boolean flag = this.field_175001_U != null;
- this.field_72777_q.field_71424_I.func_76318_c("update");
- if(!flag && this.field_147595_R) {
- this.field_147595_R = false;
- this.field_72755_R = Lists.<RenderGlobal.ContainerLocalRenderInformation>newArrayList();
- Queue<RenderGlobal.ContainerLocalRenderInformation> queue = Queues.<RenderGlobal.ContainerLocalRenderInformation>newArrayDeque();
- 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));
- boolean flag1 = this.field_72777_q.field_175612_E;
- if(renderchunk != null) {
- boolean flag2 = false;
- RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation3 = new RenderGlobal.ContainerLocalRenderInformation(renderchunk, (EnumFacing)null, 0);
- Set<EnumFacing> set1 = this.func_174978_c(blockpos1);
- if(set1.size() == 1) {
- Vector3f vector3f = this.func_174962_a(p_174970_1_, p_174970_2_);
- EnumFacing enumfacing = EnumFacing.func_176737_a(vector3f.x, vector3f.y, vector3f.z).func_176734_d();
- set1.remove(enumfacing);
- }
- if(set1.isEmpty()) {
- flag2 = true;
- }
- if(flag2 && !p_174970_6_) {
- this.field_72755_R.add(renderglobal$containerlocalrenderinformation3);
- } else {
- if(p_174970_6_ && this.field_72769_h.func_180495_p(blockpos1).func_185914_p()) {
- flag1 = false;
- }
- renderchunk.func_178577_a(p_174970_5_);
- queue.add(renderglobal$containerlocalrenderinformation3);
- }
- } else {
- int i = blockpos1.func_177956_o() > 0?248:8;
- for(int j = -this.field_72739_F; j <= this.field_72739_F; ++j) {
- for(int k = -this.field_72739_F; k <= this.field_72739_F; ++k) {
- RenderChunk renderchunk1 = this.field_175008_n.func_178161_a(new BlockPos((j << 4) + 8, i, (k << 4) + 8));
- if(renderchunk1 != null && ((ICamera)p_174970_4_).func_78546_a(renderchunk1.field_178591_c)) {
- renderchunk1.func_178577_a(p_174970_5_);
- queue.add(new RenderGlobal.ContainerLocalRenderInformation(renderchunk1, (EnumFacing)null, 0));
- }
- }
- }
- }
- this.field_72777_q.field_71424_I.func_76320_a("iteration");
- while(!((Queue)queue).isEmpty()) {
- RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation1 = (RenderGlobal.ContainerLocalRenderInformation)queue.poll();
- RenderChunk renderchunk3 = renderglobal$containerlocalrenderinformation1.field_178036_a;
- EnumFacing enumfacing2 = renderglobal$containerlocalrenderinformation1.field_178034_b;
- this.field_72755_R.add(renderglobal$containerlocalrenderinformation1);
- for(EnumFacing enumfacing1 : EnumFacing.values()) {
- RenderChunk renderchunk2 = this.func_181562_a(blockpos, renderchunk3, enumfacing1);
- 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)) {
- RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation = new RenderGlobal.ContainerLocalRenderInformation(renderchunk2, enumfacing1, renderglobal$containerlocalrenderinformation1.field_178032_d + 1);
- renderglobal$containerlocalrenderinformation.func_189561_a(renderglobal$containerlocalrenderinformation1.field_178035_c, enumfacing1);
- queue.add(renderglobal$containerlocalrenderinformation);
- }
- }
- }
- this.field_72777_q.field_71424_I.func_76319_b();
- }
- this.field_72777_q.field_71424_I.func_76318_c("captureFrustum");
- if(this.field_175002_T) {
- this.func_174984_a(d3, d4, d5);
- this.field_175002_T = false;
- }
- this.field_72777_q.field_71424_I.func_76318_c("rebuildNear");
- Set<RenderChunk> set = this.field_175009_l;
- this.field_175009_l = Sets.<RenderChunk>newLinkedHashSet();
- for(RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation2 : this.field_72755_R) {
- RenderChunk renderchunk4 = renderglobal$containerlocalrenderinformation2.field_178036_a;
- if(renderchunk4.func_178569_m() || set.contains(renderchunk4)) {
- this.field_147595_R = true;
- BlockPos blockpos2 = renderchunk4.func_178568_j().func_177982_a(8, 8, 8);
- boolean flag3 = blockpos2.func_177951_i(blockpos1) < 768.0D;
- if(!renderchunk4.func_188281_o() && !flag3) {
- this.field_175009_l.add(renderchunk4);
- } else {
- this.field_72777_q.field_71424_I.func_76320_a("build near");
- this.field_174995_M.func_178505_b(renderchunk4);
- renderchunk4.func_188282_m();
- this.field_72777_q.field_71424_I.func_76319_b();
- }
- }
- }
- this.field_175009_l.addAll(set);
- this.field_72777_q.field_71424_I.func_76319_b();
- }
- private Set<EnumFacing> func_174978_c(BlockPos p_174978_1_) {
- VisGraph visgraph = new VisGraph();
- 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);
- Chunk chunk = this.field_72769_h.func_175726_f(blockpos);
- for(BlockPos.MutableBlockPos blockpos$mutableblockpos : BlockPos.func_177975_b(blockpos, blockpos.func_177982_a(15, 15, 15))) {
- if(chunk.func_177435_g(blockpos$mutableblockpos).func_185914_p()) {
- visgraph.func_178606_a(blockpos$mutableblockpos);
- }
- }
- return visgraph.func_178609_b(p_174978_1_);
- }
- @Nullable
- private RenderChunk func_181562_a(BlockPos p_181562_1_, RenderChunk p_181562_2_, EnumFacing p_181562_3_) {
- BlockPos blockpos = p_181562_2_.func_181701_a(p_181562_3_);
- 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);
- }
- private void func_174984_a(double p_174984_1_, double p_174984_3_, double p_174984_5_) {
- this.field_175001_U = new ClippingHelperImpl();
- ((ClippingHelperImpl)this.field_175001_U).func_78560_b();
- Matrix4f matrix4f = new Matrix4f(this.field_175001_U.field_178626_c);
- matrix4f.transpose();
- Matrix4f matrix4f1 = new Matrix4f(this.field_175001_U.field_178625_b);
- matrix4f1.transpose();
- Matrix4f matrix4f2 = new Matrix4f();
- Matrix4f.mul(matrix4f1, matrix4f, matrix4f2);
- matrix4f2.invert();
- this.field_175003_W.field_181059_a = p_174984_1_;
- this.field_175003_W.field_181060_b = p_174984_3_;
- this.field_175003_W.field_181061_c = p_174984_5_;
- this.field_175004_V[0] = new Vector4f(-1.0F, -1.0F, -1.0F, 1.0F);
- this.field_175004_V[1] = new Vector4f(1.0F, -1.0F, -1.0F, 1.0F);
- this.field_175004_V[2] = new Vector4f(1.0F, 1.0F, -1.0F, 1.0F);
- this.field_175004_V[3] = new Vector4f(-1.0F, 1.0F, -1.0F, 1.0F);
- this.field_175004_V[4] = new Vector4f(-1.0F, -1.0F, 1.0F, 1.0F);
- this.field_175004_V[5] = new Vector4f(1.0F, -1.0F, 1.0F, 1.0F);
- this.field_175004_V[6] = new Vector4f(1.0F, 1.0F, 1.0F, 1.0F);
- this.field_175004_V[7] = new Vector4f(-1.0F, 1.0F, 1.0F, 1.0F);
- for(int i = 0; i < 8; ++i) {
- Matrix4f.transform(matrix4f2, this.field_175004_V[i], this.field_175004_V[i]);
- this.field_175004_V[i].x /= this.field_175004_V[i].w;
- this.field_175004_V[i].y /= this.field_175004_V[i].w;
- this.field_175004_V[i].z /= this.field_175004_V[i].w;
- this.field_175004_V[i].w = 1.0F;
- }
- }
- protected Vector3f func_174962_a(Entity p_174962_1_, double p_174962_2_) {
- 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_);
- 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_);
- if(Minecraft.func_71410_x().field_71474_y.field_74320_O == 2) {
- f += 180.0F;
- }
- float f2 = MathHelper.func_76134_b(-f1 * 0.017453292F - 3.1415927F);
- float f3 = MathHelper.func_76126_a(-f1 * 0.017453292F - 3.1415927F);
- float f4 = -MathHelper.func_76134_b(-f * 0.017453292F);
- float f5 = MathHelper.func_76126_a(-f * 0.017453292F);
- return new Vector3f(f3 * f4, f5, f2 * f4);
- }
- public int func_174977_a(BlockRenderLayer p_174977_1_, double p_174977_2_, int p_174977_4_, Entity p_174977_5_) {
- RenderHelper.func_74518_a();
- if(p_174977_1_ == BlockRenderLayer.TRANSLUCENT) {
- this.field_72777_q.field_71424_I.func_76320_a("translucent_sort");
- double d0 = p_174977_5_.field_70165_t - this.field_147596_f;
- double d1 = p_174977_5_.field_70163_u - this.field_147597_g;
- double d2 = p_174977_5_.field_70161_v - this.field_147602_h;
- if(d0 * d0 + d1 * d1 + d2 * d2 > 1.0D) {
- this.field_147596_f = p_174977_5_.field_70165_t;
- this.field_147597_g = p_174977_5_.field_70163_u;
- this.field_147602_h = p_174977_5_.field_70161_v;
- int k = 0;
- for(RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation : this.field_72755_R) {
- if(renderglobal$containerlocalrenderinformation.field_178036_a.field_178590_b.func_178492_d(p_174977_1_) && k++ < 15) {
- this.field_174995_M.func_178509_c(renderglobal$containerlocalrenderinformation.field_178036_a);
- }
- }
- }
- this.field_72777_q.field_71424_I.func_76319_b();
- }
- this.field_72777_q.field_71424_I.func_76320_a("filterempty");
- int l = 0;
- boolean flag = p_174977_1_ == BlockRenderLayer.TRANSLUCENT;
- int i1 = flag?this.field_72755_R.size() - 1:0;
- int i = flag?-1:this.field_72755_R.size();
- int j1 = flag?-1:1;
- for(int j = i1; j != i; j += j1) {
- RenderChunk renderchunk = ((RenderGlobal.ContainerLocalRenderInformation)this.field_72755_R.get(j)).field_178036_a;
- if(!renderchunk.func_178571_g().func_178491_b(p_174977_1_)) {
- ++l;
- this.field_174996_N.func_178002_a(renderchunk, p_174977_1_);
- }
- }
- this.field_72777_q.field_71424_I.func_76318_c("render_" + p_174977_1_);
- this.func_174982_a(p_174977_1_);
- this.field_72777_q.field_71424_I.func_76319_b();
- return l;
- }
- private void func_174982_a(BlockRenderLayer p_174982_1_) {
- this.field_72777_q.field_71460_t.func_180436_i();
- if(OpenGlHelper.func_176075_f()) {
- GlStateManager.func_187410_q('\u8074');
- OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a);
- GlStateManager.func_187410_q('\u8078');
- OpenGlHelper.func_77472_b(OpenGlHelper.field_77476_b);
- GlStateManager.func_187410_q('\u8078');
- OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a);
- GlStateManager.func_187410_q('\u8076');
- }
- this.field_174996_N.func_178001_a(p_174982_1_);
- if(OpenGlHelper.func_176075_f()) {
- for(VertexFormatElement vertexformatelement : DefaultVertexFormats.field_176600_a.func_177343_g()) {
- VertexFormatElement.EnumUsage vertexformatelement$enumusage = vertexformatelement.func_177375_c();
- int i = vertexformatelement.func_177369_e();
- switch(vertexformatelement$enumusage) {
- case POSITION:
- GlStateManager.func_187429_p('\u8074');
- break;
- case UV:
- OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a + i);
- GlStateManager.func_187429_p('\u8078');
- OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a);
- break;
- case COLOR:
- GlStateManager.func_187429_p('\u8076');
- GlStateManager.func_179117_G();
- }
- }
- }
- this.field_72777_q.field_71460_t.func_175072_h();
- }
- private void func_174965_a(Iterator<DestroyBlockProgress> p_174965_1_) {
- while(p_174965_1_.hasNext()) {
- DestroyBlockProgress destroyblockprogress = (DestroyBlockProgress)p_174965_1_.next();
- int i = destroyblockprogress.func_82743_f();
- if(this.field_72773_u - i > 400) {
- p_174965_1_.remove();
- }
- }
- }
- public void func_72734_e() {
- ++this.field_72773_u;
- if(this.field_72773_u % 20 == 0) {
- this.func_174965_a(this.field_72738_E.values().iterator());
- }
- if(!this.field_184387_ae.isEmpty() && !this.field_174995_M.func_188248_h() && this.field_175009_l.isEmpty()) {
- Iterator<BlockPos> iterator = this.field_184387_ae.iterator();
- while(iterator.hasNext()) {
- BlockPos blockpos = (BlockPos)iterator.next();
- iterator.remove();
- int i = blockpos.func_177958_n();
- int j = blockpos.func_177956_o();
- int k = blockpos.func_177952_p();
- this.func_184385_a(i - 1, j - 1, k - 1, i + 1, j + 1, k + 1, false);
- }
- }
- }
- private void func_180448_r() {
- GlStateManager.func_179106_n();
- GlStateManager.func_179118_c();
- GlStateManager.func_179147_l();
- GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
- RenderHelper.func_74518_a();
- GlStateManager.func_179132_a(false);
- this.field_72770_i.func_110577_a(field_110926_k);
- Tessellator tessellator = Tessellator.func_178181_a();
- BufferBuilder bufferbuilder = tessellator.func_178180_c();
- for(int i = 0; i < 6; ++i) {
- GlStateManager.func_179094_E();
- if(i == 1) {
- GlStateManager.func_179114_b(90.0F, 1.0F, 0.0F, 0.0F);
- }
- if(i == 2) {
- GlStateManager.func_179114_b(-90.0F, 1.0F, 0.0F, 0.0F);
- }
- if(i == 3) {
- GlStateManager.func_179114_b(180.0F, 1.0F, 0.0F, 0.0F);
- }
- if(i == 4) {
- GlStateManager.func_179114_b(90.0F, 0.0F, 0.0F, 1.0F);
- }
- if(i == 5) {
- GlStateManager.func_179114_b(-90.0F, 0.0F, 0.0F, 1.0F);
- }
- bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181709_i);
- 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();
- 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();
- 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();
- 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();
- tessellator.func_78381_a();
- GlStateManager.func_179121_F();
- }
- GlStateManager.func_179132_a(true);
- GlStateManager.func_179098_w();
- GlStateManager.func_179141_d();
- }
- public void func_174976_a(float p_174976_1_, int p_174976_2_) {
- if(this.field_72777_q.field_71441_e.field_73011_w.func_186058_p().func_186068_a() == 1) {
- this.func_180448_r();
- } else if(this.field_72777_q.field_71441_e.field_73011_w.func_76569_d()) {
- GlStateManager.func_179090_x();
- Vec3d vec3d = this.field_72769_h.func_72833_a(this.field_72777_q.func_175606_aa(), p_174976_1_);
- float f = (float)vec3d.field_72450_a;
- float f1 = (float)vec3d.field_72448_b;
- float f2 = (float)vec3d.field_72449_c;
- if(p_174976_2_ != 2) {
- float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F;
- float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F;
- float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F;
- f = f3;
- f1 = f4;
- f2 = f5;
- }
- GlStateManager.func_179124_c(f, f1, f2);
- Tessellator tessellator = Tessellator.func_178181_a();
- BufferBuilder bufferbuilder = tessellator.func_178180_c();
- GlStateManager.func_179132_a(false);
- GlStateManager.func_179127_m();
- GlStateManager.func_179124_c(f, f1, f2);
- if(this.field_175005_X) {
- this.field_175012_t.func_177359_a();
- GlStateManager.func_187410_q('\u8074');
- GlStateManager.func_187420_d(3, 5126, 12, 0);
- this.field_175012_t.func_177358_a(7);
- this.field_175012_t.func_177361_b();
- GlStateManager.func_187429_p('\u8074');
- } else {
- GlStateManager.func_179148_o(this.field_72771_w);
- }
- GlStateManager.func_179106_n();
- GlStateManager.func_179118_c();
- GlStateManager.func_179147_l();
- GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
- RenderHelper.func_74518_a();
- 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_);
- if(afloat != null) {
- GlStateManager.func_179090_x();
- GlStateManager.func_179103_j(7425);
- GlStateManager.func_179094_E();
- GlStateManager.func_179114_b(90.0F, 1.0F, 0.0F, 0.0F);
- 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);
- GlStateManager.func_179114_b(90.0F, 0.0F, 0.0F, 1.0F);
- float f6 = afloat[0];
- float f7 = afloat[1];
- float f8 = afloat[2];
- if(p_174976_2_ != 2) {
- float f9 = (f6 * 30.0F + f7 * 59.0F + f8 * 11.0F) / 100.0F;
- float f10 = (f6 * 30.0F + f7 * 70.0F) / 100.0F;
- float f11 = (f6 * 30.0F + f8 * 70.0F) / 100.0F;
- f6 = f9;
- f7 = f10;
- f8 = f11;
- }
- bufferbuilder.func_181668_a(6, DefaultVertexFormats.field_181706_f);
- bufferbuilder.func_181662_b(0.0D, 100.0D, 0.0D).func_181666_a(f6, f7, f8, afloat[3]).func_181675_d();
- int j = 16;
- for(int l = 0; l <= 16; ++l) {
- float f21 = (float)l * 6.2831855F / 16.0F;
- float f12 = MathHelper.func_76126_a(f21);
- float f13 = MathHelper.func_76134_b(f21);
- 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();
- }
- tessellator.func_78381_a();
- GlStateManager.func_179121_F();
- GlStateManager.func_179103_j(7424);
- }
- GlStateManager.func_179098_w();
- GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
- GlStateManager.func_179094_E();
- float f16 = 1.0F - this.field_72769_h.func_72867_j(p_174976_1_);
- GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, f16);
- GlStateManager.func_179114_b(-90.0F, 0.0F, 1.0F, 0.0F);
- GlStateManager.func_179114_b(this.field_72769_h.func_72826_c(p_174976_1_) * 360.0F, 1.0F, 0.0F, 0.0F);
- float f17 = 30.0F;
- this.field_72770_i.func_110577_a(field_110928_i);
- bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181707_g);
- bufferbuilder.func_181662_b((double)(-f17), 100.0D, (double)(-f17)).func_187315_a(0.0D, 0.0D).func_181675_d();
- bufferbuilder.func_181662_b((double)f17, 100.0D, (double)(-f17)).func_187315_a(1.0D, 0.0D).func_181675_d();
- bufferbuilder.func_181662_b((double)f17, 100.0D, (double)f17).func_187315_a(1.0D, 1.0D).func_181675_d();
- bufferbuilder.func_181662_b((double)(-f17), 100.0D, (double)f17).func_187315_a(0.0D, 1.0D).func_181675_d();
- tessellator.func_78381_a();
- f17 = 20.0F;
- this.field_72770_i.func_110577_a(field_110927_h);
- int i = this.field_72769_h.func_72853_d();
- int k = i % 4;
- int i1 = i / 4 % 2;
- float f22 = (float)(k + 0) / 4.0F;
- float f23 = (float)(i1 + 0) / 2.0F;
- float f24 = (float)(k + 1) / 4.0F;
- float f14 = (float)(i1 + 1) / 2.0F;
- bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181707_g);
- bufferbuilder.func_181662_b((double)(-f17), -100.0D, (double)f17).func_187315_a((double)f24, (double)f14).func_181675_d();
- bufferbuilder.func_181662_b((double)f17, -100.0D, (double)f17).func_187315_a((double)f22, (double)f14).func_181675_d();
- bufferbuilder.func_181662_b((double)f17, -100.0D, (double)(-f17)).func_187315_a((double)f22, (double)f23).func_181675_d();
- bufferbuilder.func_181662_b((double)(-f17), -100.0D, (double)(-f17)).func_187315_a((double)f24, (double)f23).func_181675_d();
- tessellator.func_78381_a();
- GlStateManager.func_179090_x();
- float f15 = this.field_72769_h.func_72880_h(p_174976_1_) * f16;
- if(f15 > 0.0F) {
- GlStateManager.func_179131_c(f15, f15, f15, f15);
- if(this.field_175005_X) {
- this.field_175013_s.func_177359_a();
- GlStateManager.func_187410_q('\u8074');
- GlStateManager.func_187420_d(3, 5126, 12, 0);
- this.field_175013_s.func_177358_a(7);
- this.field_175013_s.func_177361_b();
- GlStateManager.func_187429_p('\u8074');
- } else {
- GlStateManager.func_179148_o(this.field_72772_v);
- }
- }
- GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
- GlStateManager.func_179084_k();
- GlStateManager.func_179141_d();
- GlStateManager.func_179127_m();
- GlStateManager.func_179121_F();
- GlStateManager.func_179090_x();
- GlStateManager.func_179124_c(0.0F, 0.0F, 0.0F);
- 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();
- if(d0 < 0.0D) {
- GlStateManager.func_179094_E();
- GlStateManager.func_179109_b(0.0F, 12.0F, 0.0F);
- if(this.field_175005_X) {
- this.field_175011_u.func_177359_a();
- GlStateManager.func_187410_q('\u8074');
- GlStateManager.func_187420_d(3, 5126, 12, 0);
- this.field_175011_u.func_177358_a(7);
- this.field_175011_u.func_177361_b();
- GlStateManager.func_187429_p('\u8074');
- } else {
- GlStateManager.func_179148_o(this.field_72781_x);
- }
- GlStateManager.func_179121_F();
- float f18 = 1.0F;
- float f19 = -((float)(d0 + 65.0D));
- float f20 = -1.0F;
- bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181706_f);
- bufferbuilder.func_181662_b(-1.0D, (double)f19, 1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
- bufferbuilder.func_181662_b(1.0D, (double)f19, 1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
- bufferbuilder.func_181662_b(1.0D, -1.0D, 1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
- bufferbuilder.func_181662_b(-1.0D, -1.0D, 1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
- bufferbuilder.func_181662_b(-1.0D, -1.0D, -1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
- bufferbuilder.func_181662_b(1.0D, -1.0D, -1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
- bufferbuilder.func_181662_b(1.0D, (double)f19, -1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
- bufferbuilder.func_181662_b(-1.0D, (double)f19, -1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
- bufferbuilder.func_181662_b(1.0D, -1.0D, -1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
- bufferbuilder.func_181662_b(1.0D, -1.0D, 1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
- bufferbuilder.func_181662_b(1.0D, (double)f19, 1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
- bufferbuilder.func_181662_b(1.0D, (double)f19, -1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
- bufferbuilder.func_181662_b(-1.0D, (double)f19, -1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
- bufferbuilder.func_181662_b(-1.0D, (double)f19, 1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
- bufferbuilder.func_181662_b(-1.0D, -1.0D, 1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
- bufferbuilder.func_181662_b(-1.0D, -1.0D, -1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
- bufferbuilder.func_181662_b(-1.0D, -1.0D, -1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
- bufferbuilder.func_181662_b(-1.0D, -1.0D, 1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
- bufferbuilder.func_181662_b(1.0D, -1.0D, 1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
- bufferbuilder.func_181662_b(1.0D, -1.0D, -1.0D).func_181669_b(0, 0, 0, 255).func_181675_d();
- tessellator.func_78381_a();
- }
- if(this.field_72769_h.field_73011_w.func_76561_g()) {
- GlStateManager.func_179124_c(f * 0.2F + 0.04F, f1 * 0.2F + 0.04F, f2 * 0.6F + 0.1F);
- } else {
- GlStateManager.func_179124_c(f, f1, f2);
- }
- GlStateManager.func_179094_E();
- GlStateManager.func_179109_b(0.0F, -((float)(d0 - 16.0D)), 0.0F);
- GlStateManager.func_179148_o(this.field_72781_x);
- GlStateManager.func_179121_F();
- GlStateManager.func_179098_w();
- GlStateManager.func_179132_a(true);
- }
- }
- 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_) {
- if(this.field_72777_q.field_71441_e.field_73011_w.func_76569_d()) {
- if(this.field_72777_q.field_71474_y.func_181147_e() == 2) {
- this.func_180445_c(p_180447_1_, p_180447_2_, p_180447_3_, p_180447_5_, p_180447_7_);
- } else {
- GlStateManager.func_179129_p();
- int i = 32;
- int j = 8;
- Tessellator tessellator = Tessellator.func_178181_a();
- BufferBuilder bufferbuilder = tessellator.func_178180_c();
- this.field_72770_i.func_110577_a(field_110925_j);
- GlStateManager.func_179147_l();
- GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
- Vec3d vec3d = this.field_72769_h.func_72824_f(p_180447_1_);
- float f = (float)vec3d.field_72450_a;
- float f1 = (float)vec3d.field_72448_b;
- float f2 = (float)vec3d.field_72449_c;
- if(p_180447_2_ != 2) {
- float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F;
- float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F;
- float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F;
- f = f3;
- f1 = f4;
- f2 = f5;
- }
- float f9 = 4.8828125E-4F;
- double d2 = (double)((float)this.field_72773_u + p_180447_1_);
- double d0 = p_180447_3_ + d2 * 0.029999999329447746D;
- int k = MathHelper.func_76128_c(d0 / 2048.0D);
- int l = MathHelper.func_76128_c(p_180447_7_ / 2048.0D);
- d0 = d0 - (double)(k * 2048);
- double lvt_22_1_ = p_180447_7_ - (double)(l * 2048);
- float f6 = this.field_72769_h.field_73011_w.func_76571_f() - (float)p_180447_5_ + 0.33F;
- float f7 = (float)(d0 * 4.8828125E-4D);
- float f8 = (float)(lvt_22_1_ * 4.8828125E-4D);
- bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181709_i);
- for(int i1 = -256; i1 < 256; i1 += 32) {
- for(int j1 = -256; j1 < 256; j1 += 32) {
- 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();
- 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();
- 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();
- 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();
- }
- }
- tessellator.func_78381_a();
- GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
- GlStateManager.func_179084_k();
- GlStateManager.func_179089_o();
- }
- }
- }
- public boolean func_72721_a(double p_72721_1_, double p_72721_3_, double p_72721_5_, float p_72721_7_) {
- return false;
- }
- 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_) {
- GlStateManager.func_179129_p();
- Tessellator tessellator = Tessellator.func_178181_a();
- BufferBuilder bufferbuilder = tessellator.func_178180_c();
- float f = 12.0F;
- float f1 = 4.0F;
- double d0 = (double)((float)this.field_72773_u + p_180445_1_);
- double d1 = (p_180445_3_ + d0 * 0.029999999329447746D) / 12.0D;
- double d2 = p_180445_7_ / 12.0D + 0.33000001311302185D;
- float f2 = this.field_72769_h.field_73011_w.func_76571_f() - (float)p_180445_5_ + 0.33F;
- int i = MathHelper.func_76128_c(d1 / 2048.0D);
- int j = MathHelper.func_76128_c(d2 / 2048.0D);
- d1 = d1 - (double)(i * 2048);
- d2 = d2 - (double)(j * 2048);
- this.field_72770_i.func_110577_a(field_110925_j);
- GlStateManager.func_179147_l();
- GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
- Vec3d vec3d = this.field_72769_h.func_72824_f(p_180445_1_);
- float f3 = (float)vec3d.field_72450_a;
- float f4 = (float)vec3d.field_72448_b;
- float f5 = (float)vec3d.field_72449_c;
- if(p_180445_2_ != 2) {
- float f6 = (f3 * 30.0F + f4 * 59.0F + f5 * 11.0F) / 100.0F;
- float f7 = (f3 * 30.0F + f4 * 70.0F) / 100.0F;
- float f8 = (f3 * 30.0F + f5 * 70.0F) / 100.0F;
- f3 = f6;
- f4 = f7;
- f5 = f8;
- }
- float f25 = f3 * 0.9F;
- float f26 = f4 * 0.9F;
- float f27 = f5 * 0.9F;
- float f9 = f3 * 0.7F;
- float f10 = f4 * 0.7F;
- float f11 = f5 * 0.7F;
- float f12 = f3 * 0.8F;
- float f13 = f4 * 0.8F;
- float f14 = f5 * 0.8F;
- float f15 = 0.00390625F;
- float f16 = (float)MathHelper.func_76128_c(d1) * 0.00390625F;
- float f17 = (float)MathHelper.func_76128_c(d2) * 0.00390625F;
- float f18 = (float)(d1 - (double)MathHelper.func_76128_c(d1));
- float f19 = (float)(d2 - (double)MathHelper.func_76128_c(d2));
- int k = 8;
- int l = 4;
- float f20 = 9.765625E-4F;
- GlStateManager.func_179152_a(12.0F, 1.0F, 12.0F);
- for(int i1 = 0; i1 < 2; ++i1) {
- if(i1 == 0) {
- GlStateManager.func_179135_a(false, false, false, false);
- } else {
- switch(p_180445_2_) {
- case 0:
- GlStateManager.func_179135_a(false, true, true, true);
- break;
- case 1:
- GlStateManager.func_179135_a(true, false, false, true);
- break;
- case 2:
- GlStateManager.func_179135_a(true, true, true, true);
- }
- }
- for(int j1 = -3; j1 <= 4; ++j1) {
- for(int k1 = -3; k1 <= 4; ++k1) {
- bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181712_l);
- float f21 = (float)(j1 * 8);
- float f22 = (float)(k1 * 8);
- float f23 = f21 - f18;
- float f24 = f22 - f19;
- if(f2 > -5.0F) {
- 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();
- 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();
- 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();
- 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();
- }
- if(f2 <= 5.0F) {
- 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();
- 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();
- 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();
- 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();
- }
- if(j1 > -1) {
- for(int l1 = 0; l1 < 8; ++l1) {
- 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();
- 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();
- 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();
- 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();
- }
- }
- if(j1 <= 1) {
- for(int i2 = 0; i2 < 8; ++i2) {
- 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();
- 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();
- 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();
- 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();
- }
- }
- if(k1 > -1) {
- for(int j2 = 0; j2 < 8; ++j2) {
- 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();
- 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();
- 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();
- 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();
- }
- }
- if(k1 <= 1) {
- for(int k2 = 0; k2 < 8; ++k2) {
- 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();
- 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();
- 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();
- 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();
- }
- }
- tessellator.func_78381_a();
- }
- }
- }
- GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
- GlStateManager.func_179084_k();
- GlStateManager.func_179089_o();
- }
- public void func_174967_a(long p_174967_1_) {
- this.field_147595_R |= this.field_174995_M.func_178516_a(p_174967_1_);
- if(!this.field_175009_l.isEmpty()) {
- Iterator<RenderChunk> iterator = this.field_175009_l.iterator();
- while(iterator.hasNext()) {
- RenderChunk renderchunk = (RenderChunk)iterator.next();
- boolean flag;
- if(renderchunk.func_188281_o()) {
- flag = this.field_174995_M.func_178505_b(renderchunk);
- } else {
- flag = this.field_174995_M.func_178507_a(renderchunk);
- }
- if(!flag) {
- break;
- }
- renderchunk.func_188282_m();
- iterator.remove();
- long i = p_174967_1_ - System.nanoTime();
- if(i < 0L) {
- break;
- }
- }
- }
- }
- public void func_180449_a(Entity p_180449_1_, float p_180449_2_) {
- Tessellator tessellator = Tessellator.func_178181_a();
- BufferBuilder bufferbuilder = tessellator.func_178180_c();
- WorldBorder worldborder = this.field_72769_h.func_175723_af();
- double d0 = (double)(this.field_72777_q.field_71474_y.field_151451_c * 16);
- 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) {
- double d1 = 1.0D - worldborder.func_177745_a(p_180449_1_) / d0;
- d1 = Math.pow(d1, 4.0D);
- double d2 = p_180449_1_.field_70142_S + (p_180449_1_.field_70165_t - p_180449_1_.field_70142_S) * (double)p_180449_2_;
- double d3 = p_180449_1_.field_70137_T + (p_180449_1_.field_70163_u - p_180449_1_.field_70137_T) * (double)p_180449_2_;
- double d4 = p_180449_1_.field_70136_U + (p_180449_1_.field_70161_v - p_180449_1_.field_70136_U) * (double)p_180449_2_;
- GlStateManager.func_179147_l();
- GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
- this.field_72770_i.func_110577_a(field_175006_g);
- GlStateManager.func_179132_a(false);
- GlStateManager.func_179094_E();
- int i = worldborder.func_177734_a().func_177766_a();
- float f = (float)(i >> 16 & 255) / 255.0F;
- float f1 = (float)(i >> 8 & 255) / 255.0F;
- float f2 = (float)(i & 255) / 255.0F;
- GlStateManager.func_179131_c(f, f1, f2, (float)d1);
- GlStateManager.func_179136_a(-3.0F, -3.0F);
- GlStateManager.func_179088_q();
- GlStateManager.func_179092_a(516, 0.1F);
- GlStateManager.func_179141_d();
- GlStateManager.func_179129_p();
- float f3 = (float)(Minecraft.func_71386_F() % 3000L) / 3000.0F;
- float f4 = 0.0F;
- float f5 = 0.0F;
- float f6 = 128.0F;
- bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181707_g);
- bufferbuilder.func_178969_c(-d2, -d3, -d4);
- double d5 = Math.max((double)MathHelper.func_76128_c(d4 - d0), worldborder.func_177736_c());
- double d6 = Math.min((double)MathHelper.func_76143_f(d4 + d0), worldborder.func_177733_e());
- if(d2 > worldborder.func_177728_d() - d0) {
- float f7 = 0.0F;
- for(double d7 = d5; d7 < d6; f7 += 0.5F) {
- double d8 = Math.min(1.0D, d6 - d7);
- float f8 = (float)d8 * 0.5F;
- bufferbuilder.func_181662_b(worldborder.func_177728_d(), 256.0D, d7).func_187315_a((double)(f3 + f7), (double)(f3 + 0.0F)).func_181675_d();
- 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();
- 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();
- bufferbuilder.func_181662_b(worldborder.func_177728_d(), 0.0D, d7).func_187315_a((double)(f3 + f7), (double)(f3 + 128.0F)).func_181675_d();
- ++d7;
- }
- }
- if(d2 < worldborder.func_177726_b() + d0) {
- float f9 = 0.0F;
- for(double d9 = d5; d9 < d6; f9 += 0.5F) {
- double d12 = Math.min(1.0D, d6 - d9);
- float f12 = (float)d12 * 0.5F;
- bufferbuilder.func_181662_b(worldborder.func_177726_b(), 256.0D, d9).func_187315_a((double)(f3 + f9), (double)(f3 + 0.0F)).func_181675_d();
- 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();
- 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();
- bufferbuilder.func_181662_b(worldborder.func_177726_b(), 0.0D, d9).func_187315_a((double)(f3 + f9), (double)(f3 + 128.0F)).func_181675_d();
- ++d9;
- }
- }
- d5 = Math.max((double)MathHelper.func_76128_c(d2 - d0), worldborder.func_177726_b());
- d6 = Math.min((double)MathHelper.func_76143_f(d2 + d0), worldborder.func_177728_d());
- if(d4 > worldborder.func_177733_e() - d0) {
- float f10 = 0.0F;
- for(double d10 = d5; d10 < d6; f10 += 0.5F) {
- double d13 = Math.min(1.0D, d6 - d10);
- float f13 = (float)d13 * 0.5F;
- bufferbuilder.func_181662_b(d10, 256.0D, worldborder.func_177733_e()).func_187315_a((double)(f3 + f10), (double)(f3 + 0.0F)).func_181675_d();
- 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();
- 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();
- bufferbuilder.func_181662_b(d10, 0.0D, worldborder.func_177733_e()).func_187315_a((double)(f3 + f10), (double)(f3 + 128.0F)).func_181675_d();
- ++d10;
- }
- }
- if(d4 < worldborder.func_177736_c() + d0) {
- float f11 = 0.0F;
- for(double d11 = d5; d11 < d6; f11 += 0.5F) {
- double d14 = Math.min(1.0D, d6 - d11);
- float f14 = (float)d14 * 0.5F;
- bufferbuilder.func_181662_b(d11, 256.0D, worldborder.func_177736_c()).func_187315_a((double)(f3 + f11), (double)(f3 + 0.0F)).func_181675_d();
- 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();
- 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();
- bufferbuilder.func_181662_b(d11, 0.0D, worldborder.func_177736_c()).func_187315_a((double)(f3 + f11), (double)(f3 + 128.0F)).func_181675_d();
- ++d11;
- }
- }
- tessellator.func_78381_a();
- bufferbuilder.func_178969_c(0.0D, 0.0D, 0.0D);
- GlStateManager.func_179089_o();
- GlStateManager.func_179118_c();
- GlStateManager.func_179136_a(0.0F, 0.0F);
- GlStateManager.func_179113_r();
- GlStateManager.func_179141_d();
- GlStateManager.func_179084_k();
- GlStateManager.func_179121_F();
- GlStateManager.func_179132_a(true);
- }
- }
- private void func_180443_s() {
- GlStateManager.func_187428_a(GlStateManager.SourceFactor.DST_COLOR, GlStateManager.DestFactor.SRC_COLOR, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
- GlStateManager.func_179147_l();
- GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 0.5F);
- GlStateManager.func_179136_a(-3.0F, -3.0F);
- GlStateManager.func_179088_q();
- GlStateManager.func_179092_a(516, 0.1F);
- GlStateManager.func_179141_d();
- GlStateManager.func_179094_E();
- }
- private void func_174969_t() {
- GlStateManager.func_179118_c();
- GlStateManager.func_179136_a(0.0F, 0.0F);
- GlStateManager.func_179113_r();
- GlStateManager.func_179141_d();
- GlStateManager.func_179132_a(true);
- GlStateManager.func_179121_F();
- }
- public void func_174981_a(Tessellator p_174981_1_, BufferBuilder p_174981_2_, Entity p_174981_3_, float p_174981_4_) {
- double d0 = p_174981_3_.field_70142_S + (p_174981_3_.field_70165_t - p_174981_3_.field_70142_S) * (double)p_174981_4_;
- double d1 = p_174981_3_.field_70137_T + (p_174981_3_.field_70163_u - p_174981_3_.field_70137_T) * (double)p_174981_4_;
- double d2 = p_174981_3_.field_70136_U + (p_174981_3_.field_70161_v - p_174981_3_.field_70136_U) * (double)p_174981_4_;
- if(!this.field_72738_E.isEmpty()) {
- this.field_72770_i.func_110577_a(TextureMap.field_110575_b);
- this.func_180443_s();
- p_174981_2_.func_181668_a(7, DefaultVertexFormats.field_176600_a);
- p_174981_2_.func_178969_c(-d0, -d1, -d2);
- p_174981_2_.func_78914_f();
- Iterator<DestroyBlockProgress> iterator = this.field_72738_E.values().iterator();
- while(iterator.hasNext()) {
- DestroyBlockProgress destroyblockprogress = (DestroyBlockProgress)iterator.next();
- BlockPos blockpos = destroyblockprogress.func_180246_b();
- double d3 = (double)blockpos.func_177958_n() - d0;
- double d4 = (double)blockpos.func_177956_o() - d1;
- double d5 = (double)blockpos.func_177952_p() - d2;
- Block block = this.field_72769_h.func_180495_p(blockpos).func_177230_c();
- if(!(block instanceof BlockChest) && !(block instanceof BlockEnderChest) && !(block instanceof BlockSign) && !(block instanceof BlockSkull)) {
- if(d3 * d3 + d4 * d4 + d5 * d5 > 1024.0D) {
- iterator.remove();
- } else {
- IBlockState iblockstate = this.field_72769_h.func_180495_p(blockpos);
- if(iblockstate.func_185904_a() != Material.field_151579_a) {
- int i = destroyblockprogress.func_73106_e();
- TextureAtlasSprite textureatlassprite = this.field_94141_F[i];
- BlockRendererDispatcher blockrendererdispatcher = this.field_72777_q.func_175602_ab();
- blockrendererdispatcher.func_175020_a(iblockstate, blockpos, textureatlassprite, this.field_72769_h);
- }
- }
- }
- }
- p_174981_1_.func_78381_a();
- p_174981_2_.func_178969_c(0.0D, 0.0D, 0.0D);
- this.func_174969_t();
- }
- }
- public void func_72731_b(EntityPlayer p_72731_1_, RayTraceResult p_72731_2_, int p_72731_3_, float p_72731_4_) {
- if(p_72731_3_ == 0 && p_72731_2_.field_72313_a == RayTraceResult.Type.BLOCK) {
- GlStateManager.func_179147_l();
- GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
- GlStateManager.func_187441_d(2.0F);
- GlStateManager.func_179090_x();
- GlStateManager.func_179132_a(false);
- BlockPos blockpos = p_72731_2_.func_178782_a();
- IBlockState iblockstate = this.field_72769_h.func_180495_p(blockpos);
- if(iblockstate.func_185904_a() != Material.field_151579_a && this.field_72769_h.func_175723_af().func_177746_a(blockpos)) {
- double d0 = p_72731_1_.field_70142_S + (p_72731_1_.field_70165_t - p_72731_1_.field_70142_S) * (double)p_72731_4_;
- double d1 = p_72731_1_.field_70137_T + (p_72731_1_.field_70163_u - p_72731_1_.field_70137_T) * (double)p_72731_4_;
- double d2 = p_72731_1_.field_70136_U + (p_72731_1_.field_70161_v - p_72731_1_.field_70136_U) * (double)p_72731_4_;
- 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);
- }
- GlStateManager.func_179132_a(true);
- GlStateManager.func_179098_w();
- GlStateManager.func_179084_k();
- }
- }
- 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_) {
- 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_);
- }
- 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_) {
- Tessellator tessellator = Tessellator.func_178181_a();
- BufferBuilder bufferbuilder = tessellator.func_178180_c();
- bufferbuilder.func_181668_a(3, DefaultVertexFormats.field_181706_f);
- 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_);
- tessellator.func_78381_a();
- }
- 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_) {
- 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();
- 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();
- 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();
- 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();
- 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();
- 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();
- 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();
- 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();
- 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();
- 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();
- 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();
- 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();
- 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();
- 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();
- 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();
- 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();
- 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();
- 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();
- }
- 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_) {
- 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_);
- }
- 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_) {
- Tessellator tessellator = Tessellator.func_178181_a();
- BufferBuilder bufferbuilder = tessellator.func_178180_c();
- bufferbuilder.func_181668_a(5, DefaultVertexFormats.field_181706_f);
- 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_);
- tessellator.func_78381_a();
- }
- 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_) {
- 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();
- 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();
- 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();
- 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();
- 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();
- 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();
- 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();
- 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();
- 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();
- 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();
- 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();
- 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();
- 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();
- 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();
- 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();
- 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();
- 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();
- 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();
- 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();
- 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();
- 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();
- 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();
- 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();
- 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();
- 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();
- 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();
- 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();
- 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();
- 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();
- 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();
- }
- 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_) {
- 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_);
- }
- 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_) {
- int i = p_184376_2_.func_177958_n();
- int j = p_184376_2_.func_177956_o();
- int k = p_184376_2_.func_177952_p();
- this.func_184385_a(i - 1, j - 1, k - 1, i + 1, j + 1, k + 1, (p_184376_5_ & 8) != 0);
- }
- public void func_174959_b(BlockPos p_174959_1_) {
- this.field_184387_ae.add(p_174959_1_.func_185334_h());
- }
- 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_) {
- 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);
- }
- public void func_184377_a(@Nullable SoundEvent p_184377_1_, BlockPos p_184377_2_) {
- ISound isound = (ISound)this.field_147593_P.get(p_184377_2_);
- if(isound != null) {
- this.field_72777_q.func_147118_V().func_147683_b(isound);
- this.field_147593_P.remove(p_184377_2_);
- }
- if(p_184377_1_ != null) {
- ItemRecord itemrecord = ItemRecord.func_185074_a(p_184377_1_);
- if(itemrecord != null) {
- this.field_72777_q.field_71456_v.func_73833_a(itemrecord.func_150927_i());
- }
- 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());
- this.field_147593_P.put(p_184377_2_, positionedsoundrecord);
- this.field_72777_q.func_147118_V().func_147682_a(positionedsoundrecord);
- }
- this.func_193054_a(this.field_72769_h, p_184377_2_, p_184377_1_ != null);
- }
- private void func_193054_a(World p_193054_1_, BlockPos p_193054_2_, boolean p_193054_3_) {
- for(EntityLivingBase entitylivingbase : p_193054_1_.func_72872_a(EntityLivingBase.class, (new AxisAlignedBB(p_193054_2_)).func_186662_g(3.0D))) {
- entitylivingbase.func_191987_a(p_193054_2_, p_193054_3_);
- }
- }
- 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_) {
- }
- 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_) {
- 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_);
- }
- 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_) {
- try {
- 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_);
- } catch (Throwable throwable) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable, "Exception while adding particle");
- CrashReportCategory crashreportcategory = crashreport.func_85058_a("Particle being added");
- crashreportcategory.func_71507_a("ID", Integer.valueOf(p_190570_1_));
- if(p_190570_16_ != null) {
- crashreportcategory.func_71507_a("Parameters", p_190570_16_);
- }
- crashreportcategory.func_189529_a("Position", new ICrashReportDetail<String>() {
- public String call() throws Exception {
- return CrashReportCategory.func_85074_a(p_190570_4_, p_190570_6_, p_190570_8_);
- }
- });
- throw new ReportedException(crashreport);
- }
- }
- 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_) {
- 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_);
- }
- @Nullable
- 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_) {
- 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_);
- }
- @Nullable
- 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_) {
- Entity entity = this.field_72777_q.func_175606_aa();
- if(this.field_72777_q != null && entity != null && this.field_72777_q.field_71452_i != null) {
- int i = this.func_190572_a(p_190571_3_);
- double d0 = entity.field_70165_t - p_190571_4_;
- double d1 = entity.field_70163_u - p_190571_6_;
- double d2 = entity.field_70161_v - p_190571_8_;
- 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_)));
- } else {
- return null;
- }
- }
- private int func_190572_a(boolean p_190572_1_) {
- int i = this.field_72777_q.field_71474_y.field_74362_aa;
- if(p_190572_1_ && i == 2 && this.field_72769_h.field_73012_v.nextInt(10) == 0) {
- i = 1;
- }
- if(i == 1 && this.field_72769_h.field_73012_v.nextInt(3) == 0) {
- i = 2;
- }
- return i;
- }
- public void func_72703_a(Entity p_72703_1_) {
- }
- public void func_72709_b(Entity p_72709_1_) {
- }
- public void func_72728_f() {
- }
- public void func_180440_a(int p_180440_1_, BlockPos p_180440_2_, int p_180440_3_) {
- switch(p_180440_1_) {
- case 1023:
- case 1028:
- case 1038:
- Entity entity = this.field_72777_q.func_175606_aa();
- if(entity != null) {
- double d0 = (double)p_180440_2_.func_177958_n() - entity.field_70165_t;
- double d1 = (double)p_180440_2_.func_177956_o() - entity.field_70163_u;
- double d2 = (double)p_180440_2_.func_177952_p() - entity.field_70161_v;
- double d3 = Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2);
- double d4 = entity.field_70165_t;
- double d5 = entity.field_70163_u;
- double d6 = entity.field_70161_v;
- if(d3 > 0.0D) {
- d4 += d0 / d3 * 2.0D;
- d5 += d1 / d3 * 2.0D;
- d6 += d2 / d3 * 2.0D;
- }
- if(p_180440_1_ == 1023) {
- this.field_72769_h.func_184134_a(d4, d5, d6, SoundEvents.field_187855_gD, SoundCategory.HOSTILE, 1.0F, 1.0F, false);
- } else if(p_180440_1_ == 1038) {
- this.field_72769_h.func_184134_a(d4, d5, d6, SoundEvents.field_193782_bq, SoundCategory.HOSTILE, 1.0F, 1.0F, false);
- } else {
- this.field_72769_h.func_184134_a(d4, d5, d6, SoundEvents.field_187522_aL, SoundCategory.HOSTILE, 5.0F, 1.0F, false);
- }
- }
- default:
- }
- }
- public void func_180439_a(EntityPlayer p_180439_1_, int p_180439_2_, BlockPos p_180439_3_, int p_180439_4_) {
- Random random = this.field_72769_h.field_73012_v;
- switch(p_180439_2_) {
- case 1000:
- this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187574_as, SoundCategory.BLOCKS, 1.0F, 1.0F, false);
- break;
- case 1001:
- this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187576_at, SoundCategory.BLOCKS, 1.0F, 1.2F, false);
- break;
- case 1002:
- this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187578_au, SoundCategory.BLOCKS, 1.0F, 1.2F, false);
- break;
- case 1003:
- this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187528_aR, SoundCategory.NEUTRAL, 1.0F, 1.2F, false);
- break;
- case 1004:
- this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187634_bp, SoundCategory.NEUTRAL, 1.0F, 1.2F, false);
- break;
- case 1005:
- 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);
- break;
- case 1006:
- 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);
- break;
- case 1007:
- 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);
- break;
- case 1008:
- 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);
- break;
- case 1009:
- 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);
- break;
- case 1010:
- if(Item.func_150899_d(p_180439_4_) instanceof ItemRecord) {
- this.field_72769_h.func_184149_a(p_180439_3_, ((ItemRecord)Item.func_150899_d(p_180439_4_)).func_185075_h());
- } else {
- this.field_72769_h.func_184149_a(p_180439_3_, (SoundEvent)null);
- }
- break;
- case 1011:
- 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);
- break;
- case 1012:
- 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);
- break;
- case 1013:
- 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);
- break;
- case 1014:
- 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);
- break;
- case 1015:
- 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);
- break;
- case 1016:
- 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);
- break;
- case 1017:
- 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);
- break;
- case 1018:
- 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);
- break;
- case 1019:
- 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);
- break;
- case 1020:
- 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);
- break;
- case 1021:
- 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);
- break;
- case 1022:
- 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);
- break;
- case 1024:
- 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);
- break;
- case 1025:
- 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);
- break;
- case 1026:
- 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);
- break;
- case 1027:
- 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);
- break;
- case 1029:
- 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);
- break;
- case 1030:
- 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);
- break;
- case 1031:
- 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);
- break;
- case 1032:
- this.field_72777_q.func_147118_V().func_147682_a(PositionedSoundRecord.func_184371_a(SoundEvents.field_187812_eh, random.nextFloat() * 0.4F + 0.8F));
- break;
- case 1033:
- this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187542_ac, SoundCategory.BLOCKS, 1.0F, 1.0F, false);
- break;
- case 1034:
- this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187540_ab, SoundCategory.BLOCKS, 1.0F, 1.0F, false);
- break;
- case 1035:
- this.field_72769_h.func_184156_a(p_180439_3_, SoundEvents.field_187621_J, SoundCategory.BLOCKS, 1.0F, 1.0F, false);
- break;
- case 1036:
- 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);
- break;
- case 1037:
- 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);
- break;
- case 2000:
- int l = p_180439_4_ % 3 - 1;
- int i = p_180439_4_ / 3 % 3 - 1;
- double d8 = (double)p_180439_3_.func_177958_n() + (double)l * 0.6D + 0.5D;
- double d10 = (double)p_180439_3_.func_177956_o() + 0.5D;
- double d12 = (double)p_180439_3_.func_177952_p() + (double)i * 0.6D + 0.5D;
- for(int j1 = 0; j1 < 10; ++j1) {
- double d13 = random.nextDouble() * 0.2D + 0.01D;
- double d16 = d8 + (double)l * 0.01D + (random.nextDouble() - 0.5D) * (double)i * 0.5D;
- double d19 = d10 + (random.nextDouble() - 0.5D) * 0.5D;
- double d22 = d12 + (double)i * 0.01D + (random.nextDouble() - 0.5D) * (double)l * 0.5D;
- double d24 = (double)l * d13 + random.nextGaussian() * 0.01D;
- double d26 = -0.03D + random.nextGaussian() * 0.01D;
- double d27 = (double)i * d13 + random.nextGaussian() * 0.01D;
- this.func_174972_a(EnumParticleTypes.SMOKE_NORMAL, d16, d19, d22, d24, d26, d27, new int[0]);
- }
- return;
- case 2001:
- Block block = Block.func_149729_e(p_180439_4_ & 4095);
- if(block.func_176223_P().func_185904_a() != Material.field_151579_a) {
- SoundType soundtype = block.func_185467_w();
- 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);
- }
- this.field_72777_q.field_71452_i.func_180533_a(p_180439_3_, block.func_176203_a(p_180439_4_ >> 12 & 255));
- break;
- case 2002:
- case 2007:
- double d6 = (double)p_180439_3_.func_177958_n();
- double d7 = (double)p_180439_3_.func_177956_o();
- double d9 = (double)p_180439_3_.func_177952_p();
- for(int i1 = 0; i1 < 8; ++i1) {
- 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)});
- }
- float f5 = (float)(p_180439_4_ >> 16 & 255) / 255.0F;
- float f = (float)(p_180439_4_ >> 8 & 255) / 255.0F;
- float f1 = (float)(p_180439_4_ >> 0 & 255) / 255.0F;
- EnumParticleTypes enumparticletypes = p_180439_2_ == 2007?EnumParticleTypes.SPELL_INSTANT:EnumParticleTypes.SPELL;
- for(int l1 = 0; l1 < 100; ++l1) {
- double d15 = random.nextDouble() * 4.0D;
- double d18 = random.nextDouble() * 3.141592653589793D * 2.0D;
- double d21 = Math.cos(d18) * d15;
- double d23 = 0.01D + random.nextDouble() * 0.5D;
- double d25 = Math.sin(d18) * d15;
- 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]);
- if(particle1 != null) {
- float f4 = 0.75F + random.nextFloat() * 0.25F;
- particle1.func_70538_b(f5 * f4, f * f4, f1 * f4);
- particle1.func_70543_e((float)d15);
- }
- }
- 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);
- break;
- case 2003:
- double d0 = (double)p_180439_3_.func_177958_n() + 0.5D;
- double d1 = (double)p_180439_3_.func_177956_o();
- double d2 = (double)p_180439_3_.func_177952_p() + 0.5D;
- for(int j = 0; j < 8; ++j) {
- 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)});
- }
- for(double d11 = 0.0D; d11 < 6.283185307179586D; d11 += 0.15707963267948966D) {
- 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]);
- 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]);
- }
- return;
- case 2004:
- for(int k1 = 0; k1 < 20; ++k1) {
- double d14 = (double)p_180439_3_.func_177958_n() + 0.5D + ((double)this.field_72769_h.field_73012_v.nextFloat() - 0.5D) * 2.0D;
- double d17 = (double)p_180439_3_.func_177956_o() + 0.5D + ((double)this.field_72769_h.field_73012_v.nextFloat() - 0.5D) * 2.0D;
- double d20 = (double)p_180439_3_.func_177952_p() + 0.5D + ((double)this.field_72769_h.field_73012_v.nextFloat() - 0.5D) * 2.0D;
- this.field_72769_h.func_175688_a(EnumParticleTypes.SMOKE_NORMAL, d14, d17, d20, 0.0D, 0.0D, 0.0D, new int[0]);
- this.field_72769_h.func_175688_a(EnumParticleTypes.FLAME, d14, d17, d20, 0.0D, 0.0D, 0.0D, new int[0]);
- }
- return;
- case 2005:
- ItemDye.func_180617_a(this.field_72769_h, p_180439_3_, p_180439_4_);
- break;
- case 2006:
- for(int k = 0; k < 200; ++k) {
- float f2 = random.nextFloat() * 4.0F;
- float f3 = random.nextFloat() * 6.2831855F;
- double d3 = (double)(MathHelper.func_76134_b(f3) * f2);
- double d4 = 0.01D + random.nextDouble() * 0.5D;
- double d5 = (double)(MathHelper.func_76126_a(f3) * f2);
- 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]);
- if(particle != null) {
- particle.func_70543_e(f2);
- }
- }
- 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);
- break;
- case 3000:
- 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]);
- 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);
- break;
- case 3001:
- 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);
- }
- }
- public void func_180441_b(int p_180441_1_, BlockPos p_180441_2_, int p_180441_3_) {
- if(p_180441_3_ >= 0 && p_180441_3_ < 10) {
- DestroyBlockProgress destroyblockprogress = (DestroyBlockProgress)this.field_72738_E.get(Integer.valueOf(p_180441_1_));
- 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()) {
- destroyblockprogress = new DestroyBlockProgress(p_180441_1_, p_180441_2_);
- this.field_72738_E.put(Integer.valueOf(p_180441_1_), destroyblockprogress);
- }
- destroyblockprogress.func_73107_a(p_180441_3_);
- destroyblockprogress.func_82744_b(this.field_72773_u);
- } else {
- this.field_72738_E.remove(Integer.valueOf(p_180441_1_));
- }
- }
- public boolean func_184384_n() {
- return this.field_175009_l.isEmpty() && this.field_174995_M.func_188247_f();
- }
- public void func_174979_m() {
- this.field_147595_R = true;
- }
- public void func_181023_a(Collection<TileEntity> p_181023_1_, Collection<TileEntity> p_181023_2_) {
- synchronized(this.field_181024_n) {
- this.field_181024_n.removeAll(p_181023_1_);
- this.field_181024_n.addAll(p_181023_2_);
- }
- }
- @SideOnly(Side.CLIENT)
- class ContainerLocalRenderInformation {
- final RenderChunk field_178036_a;
- final EnumFacing field_178034_b;
- byte field_178035_c;
- final int field_178032_d;
- private ContainerLocalRenderInformation(RenderChunk p_i46248_2_, EnumFacing p_i46248_3_, @Nullable int p_i46248_4_) {
- this.field_178036_a = p_i46248_2_;
- this.field_178034_b = p_i46248_3_;
- this.field_178032_d = p_i46248_4_;
- }
- public void func_189561_a(byte p_189561_1_, EnumFacing p_189561_2_) {
- this.field_178035_c = (byte)(this.field_178035_c | p_189561_1_ | 1 << p_189561_2_.ordinal());
- }
- public boolean func_189560_a(EnumFacing p_189560_1_) {
- return (this.field_178035_c & 1 << p_189560_1_.ordinal()) > 0;
- }
- }
- }
- Patching failed: minecraft\net\minecraft\client\renderer\BlockRendererDispatcher.java
- Hunk 1 failed! Cannot find hunk target
- return this.field_175028_a.func_178125_b(p_184389_1_);
- }
- + @SuppressWarnings("incomplete-switch")
- public void func_175016_a(IBlockState p_175016_1_, float p_175016_2_) {
- EnumBlockRenderType enumblockrendertype = p_175016_1_.func_185901_i();
- if (enumblockrendertype != EnumBlockRenderType.INVISIBLE) {
- File state
- package net.minecraft.client.renderer;
- import net.minecraft.block.state.IBlockState;
- import net.minecraft.client.renderer.BlockFluidRenderer;
- import net.minecraft.client.renderer.BlockModelRenderer;
- import net.minecraft.client.renderer.BlockModelShapes;
- import net.minecraft.client.renderer.BufferBuilder;
- import net.minecraft.client.renderer.ChestRenderer;
- import net.minecraft.client.renderer.Tessellator;
- import net.minecraft.client.renderer.block.model.IBakedModel;
- import net.minecraft.client.renderer.block.model.SimpleBakedModel;
- import net.minecraft.client.renderer.color.BlockColors;
- import net.minecraft.client.renderer.texture.TextureAtlasSprite;
- import net.minecraft.client.resources.IResourceManager;
- import net.minecraft.client.resources.IResourceManagerReloadListener;
- import net.minecraft.crash.CrashReport;
- import net.minecraft.crash.CrashReportCategory;
- import net.minecraft.util.EnumBlockRenderType;
- import net.minecraft.util.ReportedException;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.world.IBlockAccess;
- import net.minecraft.world.WorldType;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- @SideOnly(Side.CLIENT)
- public class BlockRendererDispatcher implements IResourceManagerReloadListener {
- private final BlockModelShapes field_175028_a;
- private final BlockModelRenderer field_175027_c;
- private final ChestRenderer field_175024_d = new ChestRenderer();
- private final BlockFluidRenderer field_175025_e;
- public BlockRendererDispatcher(BlockModelShapes p_i46577_1_, BlockColors p_i46577_2_) {
- this.field_175028_a = p_i46577_1_;
- this.field_175027_c = new BlockModelRenderer(p_i46577_2_);
- this.field_175025_e = new BlockFluidRenderer(p_i46577_2_);
- }
- public BlockModelShapes func_175023_a() {
- return this.field_175028_a;
- }
- public void func_175020_a(IBlockState p_175020_1_, BlockPos p_175020_2_, TextureAtlasSprite p_175020_3_, IBlockAccess p_175020_4_) {
- if(p_175020_1_.func_185901_i() == EnumBlockRenderType.MODEL) {
- p_175020_1_ = p_175020_1_.func_185899_b(p_175020_4_, p_175020_2_);
- IBakedModel ibakedmodel = this.field_175028_a.func_178125_b(p_175020_1_);
- IBakedModel ibakedmodel1 = (new SimpleBakedModel.Builder(p_175020_1_, ibakedmodel, p_175020_3_, p_175020_2_)).func_177645_b();
- 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);
- }
- }
- public boolean func_175018_a(IBlockState p_175018_1_, BlockPos p_175018_2_, IBlockAccess p_175018_3_, BufferBuilder p_175018_4_) {
- try {
- EnumBlockRenderType enumblockrendertype = p_175018_1_.func_185901_i();
- if(enumblockrendertype == EnumBlockRenderType.INVISIBLE) {
- return false;
- } else {
- if(p_175018_3_.func_175624_G() != WorldType.field_180272_g) {
- try {
- p_175018_1_ = p_175018_1_.func_185899_b(p_175018_3_, p_175018_2_);
- } catch (Exception var8) {
- ;
- }
- }
- switch(enumblockrendertype) {
- case MODEL:
- 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);
- case ENTITYBLOCK_ANIMATED:
- return false;
- case LIQUID:
- return this.field_175025_e.func_178270_a(p_175018_3_, p_175018_1_, p_175018_2_, p_175018_4_);
- default:
- return false;
- }
- }
- } catch (Throwable throwable) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable, "Tesselating block in world");
- CrashReportCategory crashreportcategory = crashreport.func_85058_a("Block being tesselated");
- 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_));
- throw new ReportedException(crashreport);
- }
- }
- public BlockModelRenderer func_175019_b() {
- return this.field_175027_c;
- }
- public IBakedModel func_184389_a(IBlockState p_184389_1_) {
- return this.field_175028_a.func_178125_b(p_184389_1_);
- }
- public void func_175016_a(IBlockState p_175016_1_, float p_175016_2_) {
- EnumBlockRenderType enumblockrendertype = p_175016_1_.func_185901_i();
- if(enumblockrendertype != EnumBlockRenderType.INVISIBLE) {
- switch(enumblockrendertype) {
- case MODEL:
- IBakedModel ibakedmodel = this.func_184389_a(p_175016_1_);
- this.field_175027_c.func_178266_a(ibakedmodel, p_175016_1_, p_175016_2_, true);
- break;
- case ENTITYBLOCK_ANIMATED:
- this.field_175024_d.func_178175_a(p_175016_1_.func_177230_c(), p_175016_2_);
- case LIQUID:
- }
- }
- }
- public void func_110549_a(IResourceManager p_110549_1_) {
- this.field_175025_e.func_178268_a();
- }
- }
- Patching failed: minecraft\net\minecraft\client\renderer\block\model\Variant.java
- Hunk 1 failed! Cannot find hunk target
- public int hashCode() {
- int i = this.field_188050_a.hashCode();
- i = 31 * i + this.field_188051_b.hashCode();
- - i = 31 * i + this.field_188052_c.hashCode();
- + i = 31 * i + Boolean.valueOf(this.field_188052_c).hashCode();
- i = 31 * i + this.field_188053_d;
- return i;
- }
- File state
- package net.minecraft.client.renderer.block.model;
- import com.google.gson.JsonDeserializationContext;
- import com.google.gson.JsonDeserializer;
- import com.google.gson.JsonElement;
- import com.google.gson.JsonObject;
- import com.google.gson.JsonParseException;
- import java.lang.reflect.Type;
- import net.minecraft.client.renderer.block.model.ModelRotation;
- import net.minecraft.util.JsonUtils;
- import net.minecraft.util.ResourceLocation;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- @SideOnly(Side.CLIENT)
- public class Variant {
- private final ResourceLocation field_188050_a;
- private final ModelRotation field_188051_b;
- private final boolean field_188052_c;
- private final int field_188053_d;
- public Variant(ResourceLocation p_i46567_1_, ModelRotation p_i46567_2_, boolean p_i46567_3_, int p_i46567_4_) {
- this.field_188050_a = p_i46567_1_;
- this.field_188051_b = p_i46567_2_;
- this.field_188052_c = p_i46567_3_;
- this.field_188053_d = p_i46567_4_;
- }
- public ResourceLocation func_188046_a() {
- return this.field_188050_a;
- }
- public ModelRotation func_188048_b() {
- return this.field_188051_b;
- }
- public boolean func_188049_c() {
- return this.field_188052_c;
- }
- public int func_188047_d() {
- return this.field_188053_d;
- }
- public String toString() {
- return "Variant{modelLocation=" + this.field_188050_a + ", rotation=" + this.field_188051_b + ", uvLock=" + this.field_188052_c + ", weight=" + this.field_188053_d + '}';
- }
- public boolean equals(Object p_equals_1_) {
- if(this == p_equals_1_) {
- return true;
- } else if(!(p_equals_1_ instanceof Variant)) {
- return false;
- } else {
- Variant variant = (Variant)p_equals_1_;
- 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;
- }
- }
- public int hashCode() {
- int i = this.field_188050_a.hashCode();
- i = 31 * i + this.field_188051_b.hashCode();
- i = 31 * i + Boolean.valueOf(this.field_188052_c).hashCode();
- i = 31 * i + this.field_188053_d;
- return i;
- }
- @SideOnly(Side.CLIENT)
- public static class Deserializer implements JsonDeserializer<Variant> {
- public Variant deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException {
- JsonObject jsonobject = p_deserialize_1_.getAsJsonObject();
- String s = this.func_188043_b(jsonobject);
- ModelRotation modelrotation = this.func_188042_a(jsonobject);
- boolean flag = this.func_188044_d(jsonobject);
- int i = this.func_188045_c(jsonobject);
- return new Variant(this.func_188041_a(s), modelrotation, flag, i);
- }
- private ResourceLocation func_188041_a(String p_188041_1_) {
- ResourceLocation resourcelocation = new ResourceLocation(p_188041_1_);
- resourcelocation = new ResourceLocation(resourcelocation.func_110624_b(), "block/" + resourcelocation.func_110623_a());
- return resourcelocation;
- }
- private boolean func_188044_d(JsonObject p_188044_1_) {
- return JsonUtils.func_151209_a(p_188044_1_, "uvlock", false);
- }
- protected ModelRotation func_188042_a(JsonObject p_188042_1_) {
- int i = JsonUtils.func_151208_a(p_188042_1_, "x", 0);
- int j = JsonUtils.func_151208_a(p_188042_1_, "y", 0);
- ModelRotation modelrotation = ModelRotation.func_177524_a(i, j);
- if(modelrotation == null) {
- throw new JsonParseException("Invalid BlockModelRotation x: " + i + ", y: " + j);
- } else {
- return modelrotation;
- }
- }
- protected String func_188043_b(JsonObject p_188043_1_) {
- return JsonUtils.func_151200_h(p_188043_1_, "model");
- }
- protected int func_188045_c(JsonObject p_188045_1_) {
- int i = JsonUtils.func_151208_a(p_188045_1_, "weight", 1);
- if(i < 1) {
- throw new JsonParseException("Invalid weight " + i + " found, expected integer >= 1");
- } else {
- return i;
- }
- }
- }
- }
- Patching failed: minecraft\net\minecraft\client\renderer\block\statemap\StateMap.java
- Hunk 1 failed! Cannot find hunk target
- }
- private <T extends Comparable<T>> String func_187490_a(IProperty<T> p_187490_1_, Map<IProperty<?>, Comparable<?>> p_187490_2_) {
- - return p_187490_1_.func_177702_a(p_187490_2_.remove(this.field_178142_a));
- + return p_187490_1_.func_177702_a((T)p_187490_2_.remove(this.field_178142_a));
- }
- @SideOnly(Side.CLIENT)
- File state
- package net.minecraft.client.renderer.block.statemap;
- import com.google.common.collect.Lists;
- import com.google.common.collect.Maps;
- import java.util.Collections;
- import java.util.List;
- import java.util.Map;
- import javax.annotation.Nullable;
- import net.minecraft.block.Block;
- import net.minecraft.block.properties.IProperty;
- import net.minecraft.block.state.IBlockState;
- import net.minecraft.client.renderer.block.model.ModelResourceLocation;
- import net.minecraft.client.renderer.block.statemap.StateMapperBase;
- import net.minecraft.util.ResourceLocation;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- @SideOnly(Side.CLIENT)
- public class StateMap extends StateMapperBase {
- private final IProperty<?> field_178142_a;
- private final String field_178141_c;
- private final List<IProperty<?>> field_178140_d;
- private StateMap(@Nullable IProperty<?> p_i46210_1_, @Nullable String p_i46210_2_, List<IProperty<?>> p_i46210_3_) {
- this.field_178142_a = p_i46210_1_;
- this.field_178141_c = p_i46210_2_;
- this.field_178140_d = p_i46210_3_;
- }
- protected ModelResourceLocation func_178132_a(IBlockState p_178132_1_) {
- Map<IProperty<?>, Comparable<?>> map = Maps.<IProperty<?>, Comparable<?>>newLinkedHashMap(p_178132_1_.func_177228_b());
- String s;
- if(this.field_178142_a == null) {
- s = ((ResourceLocation)Block.field_149771_c.func_177774_c(p_178132_1_.func_177230_c())).toString();
- } else {
- s = this.func_187490_a(this.field_178142_a, map);
- }
- if(this.field_178141_c != null) {
- s = s + this.field_178141_c;
- }
- for(IProperty<?> iproperty : this.field_178140_d) {
- map.remove(iproperty);
- }
- return new ModelResourceLocation(s, this.func_178131_a(map));
- }
- private <T extends Comparable<T>> String func_187490_a(IProperty<T> p_187490_1_, Map<IProperty<?>, Comparable<?>> p_187490_2_) {
- return p_187490_1_.func_177702_a((Comparable)p_187490_2_.remove(this.field_178142_a));
- }
- @SideOnly(Side.CLIENT)
- public static class Builder {
- private IProperty<?> field_178445_a;
- private String field_178443_b;
- private final List<IProperty<?>> field_178444_c = Lists.<IProperty<?>>newArrayList();
- public StateMap.Builder func_178440_a(IProperty<?> p_178440_1_) {
- this.field_178445_a = p_178440_1_;
- return this;
- }
- public StateMap.Builder func_178439_a(String p_178439_1_) {
- this.field_178443_b = p_178439_1_;
- return this;
- }
- public StateMap.Builder func_178442_a(IProperty<?>... p_178442_1_) {
- Collections.addAll(this.field_178444_c, p_178442_1_);
- return this;
- }
- public StateMap func_178441_a() {
- return new StateMap(this.field_178445_a, this.field_178443_b, this.field_178444_c);
- }
- }
- }
- Patching failed: minecraft\net\minecraft\client\renderer\tileentity\TileEntityRendererDispatcher.java
- Hunk 1 failed! Cannot find hunk target
- }
- public <T extends TileEntity> TileEntitySpecialRenderer<T> func_147546_a(Class<? extends TileEntity> p_147546_1_) {
- - TileEntitySpecialRenderer<? extends TileEntity> tileentityspecialrenderer = (TileEntitySpecialRenderer)this.field_147559_m.get(p_147546_1_);
- + TileEntitySpecialRenderer<T> tileentityspecialrenderer = (TileEntitySpecialRenderer)this.field_147559_m.get(p_147546_1_);
- if (tileentityspecialrenderer == null && p_147546_1_ != TileEntity.class) {
- - tileentityspecialrenderer = this.<TileEntity>func_147546_a(p_147546_1_.getSuperclass());
- + tileentityspecialrenderer = this.func_147546_a((Class<? extends TileEntity>)p_147546_1_.getSuperclass());
- this.field_147559_m.put(p_147546_1_, tileentityspecialrenderer);
- }
- File state
- package net.minecraft.client.renderer.tileentity;
- import com.google.common.collect.Maps;
- import java.util.Map;
- import javax.annotation.Nullable;
- import net.minecraft.client.gui.FontRenderer;
- import net.minecraft.client.model.ModelShulker;
- import net.minecraft.client.renderer.GlStateManager;
- import net.minecraft.client.renderer.OpenGlHelper;
- import net.minecraft.client.renderer.RenderHelper;
- import net.minecraft.client.renderer.texture.TextureManager;
- import net.minecraft.client.renderer.tileentity.TileEntityBannerRenderer;
- import net.minecraft.client.renderer.tileentity.TileEntityBeaconRenderer;
- import net.minecraft.client.renderer.tileentity.TileEntityBedRenderer;
- import net.minecraft.client.renderer.tileentity.TileEntityChestRenderer;
- import net.minecraft.client.renderer.tileentity.TileEntityEnchantmentTableRenderer;
- import net.minecraft.client.renderer.tileentity.TileEntityEndGatewayRenderer;
- import net.minecraft.client.renderer.tileentity.TileEntityEndPortalRenderer;
- import net.minecraft.client.renderer.tileentity.TileEntityEnderChestRenderer;
- import net.minecraft.client.renderer.tileentity.TileEntityMobSpawnerRenderer;
- import net.minecraft.client.renderer.tileentity.TileEntityPistonRenderer;
- import net.minecraft.client.renderer.tileentity.TileEntityShulkerBoxRenderer;
- import net.minecraft.client.renderer.tileentity.TileEntitySignRenderer;
- import net.minecraft.client.renderer.tileentity.TileEntitySkullRenderer;
- import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
- import net.minecraft.client.renderer.tileentity.TileEntityStructureRenderer;
- import net.minecraft.crash.CrashReport;
- import net.minecraft.crash.CrashReportCategory;
- import net.minecraft.entity.Entity;
- import net.minecraft.tileentity.TileEntity;
- import net.minecraft.tileentity.TileEntityBanner;
- import net.minecraft.tileentity.TileEntityBeacon;
- import net.minecraft.tileentity.TileEntityBed;
- import net.minecraft.tileentity.TileEntityChest;
- import net.minecraft.tileentity.TileEntityEnchantmentTable;
- import net.minecraft.tileentity.TileEntityEndGateway;
- import net.minecraft.tileentity.TileEntityEndPortal;
- import net.minecraft.tileentity.TileEntityEnderChest;
- import net.minecraft.tileentity.TileEntityMobSpawner;
- import net.minecraft.tileentity.TileEntityPiston;
- import net.minecraft.tileentity.TileEntityShulkerBox;
- import net.minecraft.tileentity.TileEntitySign;
- import net.minecraft.tileentity.TileEntitySkull;
- import net.minecraft.tileentity.TileEntityStructure;
- import net.minecraft.util.ReportedException;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.util.math.RayTraceResult;
- import net.minecraft.world.World;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- @SideOnly(Side.CLIENT)
- public class TileEntityRendererDispatcher {
- public final Map<Class<? extends TileEntity>, TileEntitySpecialRenderer<? extends TileEntity>> field_147559_m = Maps.<Class<? extends TileEntity>, TileEntitySpecialRenderer<? extends TileEntity>>newHashMap();
- public static TileEntityRendererDispatcher field_147556_a = new TileEntityRendererDispatcher();
- public FontRenderer field_147557_n;
- public static double field_147554_b;
- public static double field_147555_c;
- public static double field_147552_d;
- public TextureManager field_147553_e;
- public World field_147550_f;
- public Entity field_147551_g;
- public float field_147562_h;
- public float field_147563_i;
- public RayTraceResult field_190057_j;
- public double field_147560_j;
- public double field_147561_k;
- public double field_147558_l;
- private TileEntityRendererDispatcher() {
- this.field_147559_m.put(TileEntitySign.class, new TileEntitySignRenderer());
- this.field_147559_m.put(TileEntityMobSpawner.class, new TileEntityMobSpawnerRenderer());
- this.field_147559_m.put(TileEntityPiston.class, new TileEntityPistonRenderer());
- this.field_147559_m.put(TileEntityChest.class, new TileEntityChestRenderer());
- this.field_147559_m.put(TileEntityEnderChest.class, new TileEntityEnderChestRenderer());
- this.field_147559_m.put(TileEntityEnchantmentTable.class, new TileEntityEnchantmentTableRenderer());
- this.field_147559_m.put(TileEntityEndPortal.class, new TileEntityEndPortalRenderer());
- this.field_147559_m.put(TileEntityEndGateway.class, new TileEntityEndGatewayRenderer());
- this.field_147559_m.put(TileEntityBeacon.class, new TileEntityBeaconRenderer());
- this.field_147559_m.put(TileEntitySkull.class, new TileEntitySkullRenderer());
- this.field_147559_m.put(TileEntityBanner.class, new TileEntityBannerRenderer());
- this.field_147559_m.put(TileEntityStructure.class, new TileEntityStructureRenderer());
- this.field_147559_m.put(TileEntityShulkerBox.class, new TileEntityShulkerBoxRenderer(new ModelShulker()));
- this.field_147559_m.put(TileEntityBed.class, new TileEntityBedRenderer());
- for(TileEntitySpecialRenderer<?> tileentityspecialrenderer : this.field_147559_m.values()) {
- tileentityspecialrenderer.func_147497_a(this);
- }
- }
- public <T extends TileEntity> TileEntitySpecialRenderer<T> func_147546_a(Class<? extends TileEntity> p_147546_1_) {
- TileEntitySpecialRenderer<? extends TileEntity> tileentityspecialrenderer = (TileEntitySpecialRenderer)this.field_147559_m.get(p_147546_1_);
- if(tileentityspecialrenderer == null && p_147546_1_ != TileEntity.class) {
- tileentityspecialrenderer = this.<TileEntity>func_147546_a(p_147546_1_.getSuperclass());
- this.field_147559_m.put(p_147546_1_, tileentityspecialrenderer);
- }
- return tileentityspecialrenderer;
- }
- @Nullable
- public <T extends TileEntity> TileEntitySpecialRenderer<T> func_147547_b(@Nullable TileEntity p_147547_1_) {
- return p_147547_1_ == null?null:this.func_147546_a(p_147547_1_.getClass());
- }
- 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_) {
- if(this.field_147550_f != p_190056_1_) {
- this.func_147543_a(p_190056_1_);
- }
- this.field_147553_e = p_190056_2_;
- this.field_147551_g = p_190056_4_;
- this.field_147557_n = p_190056_3_;
- this.field_190057_j = p_190056_5_;
- 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_;
- 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_;
- 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_;
- 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_;
- 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_;
- }
- public void func_180546_a(TileEntity p_180546_1_, float p_180546_2_, int p_180546_3_) {
- 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()) {
- RenderHelper.func_74519_b();
- int i = this.field_147550_f.func_175626_b(p_180546_1_.func_174877_v(), 0);
- int j = i % 65536;
- int k = i / 65536;
- OpenGlHelper.func_77475_a(OpenGlHelper.field_77476_b, (float)j, (float)k);
- GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
- BlockPos blockpos = p_180546_1_.func_174877_v();
- 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);
- }
- }
- 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_) {
- this.func_192855_a(p_147549_1_, p_147549_2_, p_147549_4_, p_147549_6_, p_147549_8_, 1.0F);
- }
- 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_) {
- this.func_192854_a(p_192855_1_, p_192855_2_, p_192855_4_, p_192855_6_, p_192855_8_, -1, p_192855_9_);
- }
- 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_) {
- TileEntitySpecialRenderer<TileEntity> tileentityspecialrenderer = this.<TileEntity>func_147547_b(p_192854_1_);
- if(tileentityspecialrenderer != null) {
- try {
- 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_);
- } catch (Throwable throwable) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable, "Rendering Block Entity");
- CrashReportCategory crashreportcategory = crashreport.func_85058_a("Block Entity Details");
- p_192854_1_.func_145828_a(crashreportcategory);
- throw new ReportedException(crashreport);
- }
- }
- }
- public void func_147543_a(@Nullable World p_147543_1_) {
- this.field_147550_f = p_147543_1_;
- if(p_147543_1_ == null) {
- this.field_147551_g = null;
- }
- }
- public FontRenderer func_147548_a() {
- return this.field_147557_n;
- }
- }
- Patching failed: minecraft\net\minecraft\client\renderer\chunk\ChunkRenderWorker.java
- Hunk 1 failed! Cannot find hunk target
- }
- Entity entity = Minecraft.func_71410_x().func_175606_aa();
- - if (lvt_2_2_ == null) {
- + if (entity == null) {
- p_178474_1_.func_178542_e();
- } else {
- p_178474_1_.func_178541_a(this.func_178475_b());
- File state
- package net.minecraft.client.renderer.chunk;
- import com.google.common.collect.Lists;
- import com.google.common.util.concurrent.FutureCallback;
- import com.google.common.util.concurrent.Futures;
- import com.google.common.util.concurrent.ListenableFuture;
- import java.util.ArrayList;
- import java.util.List;
- import java.util.concurrent.CancellationException;
- import javax.annotation.Nullable;
- import net.minecraft.client.Minecraft;
- import net.minecraft.client.renderer.RegionRenderCacheBuilder;
- import net.minecraft.client.renderer.chunk.ChunkCompileTaskGenerator;
- import net.minecraft.client.renderer.chunk.ChunkRenderDispatcher;
- import net.minecraft.client.renderer.chunk.CompiledChunk;
- import net.minecraft.crash.CrashReport;
- import net.minecraft.entity.Entity;
- import net.minecraft.util.BlockRenderLayer;
- import net.minecraft.util.EnumFacing;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.world.World;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- import org.apache.logging.log4j.LogManager;
- import org.apache.logging.log4j.Logger;
- @SideOnly(Side.CLIENT)
- public class ChunkRenderWorker implements Runnable {
- private static final Logger field_152478_a = LogManager.getLogger();
- private final ChunkRenderDispatcher field_178477_b;
- private final RegionRenderCacheBuilder field_178478_c;
- private boolean field_188265_d;
- public ChunkRenderWorker(ChunkRenderDispatcher p_i46201_1_) {
- this(p_i46201_1_, (RegionRenderCacheBuilder)null);
- }
- public ChunkRenderWorker(ChunkRenderDispatcher p_i46202_1_, @Nullable RegionRenderCacheBuilder p_i46202_2_) {
- this.field_188265_d = true;
- this.field_178477_b = p_i46202_1_;
- this.field_178478_c = p_i46202_2_;
- }
- public void run() {
- while(this.field_188265_d) {
- try {
- this.func_178474_a(this.field_178477_b.func_178511_d());
- } catch (InterruptedException var3) {
- field_152478_a.debug("Stopping chunk worker due to interrupt");
- return;
- } catch (Throwable throwable) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable, "Batching chunks");
- Minecraft.func_71410_x().func_71404_a(Minecraft.func_71410_x().func_71396_d(crashreport));
- return;
- }
- }
- }
- protected void func_178474_a(final ChunkCompileTaskGenerator p_178474_1_) throws InterruptedException {
- p_178474_1_.func_178540_f().lock();
- try {
- if(p_178474_1_.func_178546_a() != ChunkCompileTaskGenerator.Status.PENDING) {
- if(!p_178474_1_.func_178537_h()) {
- 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());
- }
- return;
- }
- BlockPos blockpos = new BlockPos(Minecraft.func_71410_x().field_71439_g);
- BlockPos blockpos1 = p_178474_1_.func_178536_b().func_178568_j();
- int i = 16;
- int j = 8;
- int k = 24;
- if(blockpos1.func_177982_a(8, 8, 8).func_177951_i(blockpos) > 576.0D) {
- World world = p_178474_1_.func_178536_b().func_188283_p();
- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(blockpos1);
- 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)) {
- return;
- }
- }
- p_178474_1_.func_178535_a(ChunkCompileTaskGenerator.Status.COMPILING);
- } finally {
- p_178474_1_.func_178540_f().unlock();
- }
- Entity lvt_2_2_ = Minecraft.func_71410_x().func_175606_aa();
- if(lvt_2_2_ == null) {
- p_178474_1_.func_178542_e();
- } else {
- p_178474_1_.func_178541_a(this.func_178475_b());
- float f = (float)lvt_2_2_.field_70165_t;
- float f1 = (float)lvt_2_2_.field_70163_u + lvt_2_2_.func_70047_e();
- float f2 = (float)lvt_2_2_.field_70161_v;
- ChunkCompileTaskGenerator.Type chunkcompiletaskgenerator$type = p_178474_1_.func_178538_g();
- if(chunkcompiletaskgenerator$type == ChunkCompileTaskGenerator.Type.REBUILD_CHUNK) {
- p_178474_1_.func_178536_b().func_178581_b(f, f1, f2, p_178474_1_);
- } else if(chunkcompiletaskgenerator$type == ChunkCompileTaskGenerator.Type.RESORT_TRANSPARENCY) {
- p_178474_1_.func_178536_b().func_178570_a(f, f1, f2, p_178474_1_);
- }
- p_178474_1_.func_178540_f().lock();
- try {
- if(p_178474_1_.func_178546_a() != ChunkCompileTaskGenerator.Status.COMPILING) {
- if(!p_178474_1_.func_178537_h()) {
- 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());
- }
- this.func_178473_b(p_178474_1_);
- return;
- }
- p_178474_1_.func_178535_a(ChunkCompileTaskGenerator.Status.UPLOADING);
- } finally {
- p_178474_1_.func_178540_f().unlock();
- }
- final CompiledChunk lvt_7_2_ = p_178474_1_.func_178544_c();
- ArrayList lvt_8_2_ = Lists.newArrayList();
- if(chunkcompiletaskgenerator$type == ChunkCompileTaskGenerator.Type.REBUILD_CHUNK) {
- for(BlockRenderLayer blockrenderlayer : BlockRenderLayer.values()) {
- if(lvt_7_2_.func_178492_d(blockrenderlayer)) {
- 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()));
- }
- }
- } else if(chunkcompiletaskgenerator$type == ChunkCompileTaskGenerator.Type.RESORT_TRANSPARENCY) {
- 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()));
- }
- final ListenableFuture<List<Object>> listenablefuture = Futures.allAsList(lvt_8_2_);
- p_178474_1_.func_178539_a(new Runnable() {
- public void run() {
- listenablefuture.cancel(false);
- }
- });
- Futures.addCallback(listenablefuture, new FutureCallback<List<Object>>() {
- public void onSuccess(@Nullable List<Object> p_onSuccess_1_) {
- ChunkRenderWorker.this.func_178473_b(p_178474_1_);
- p_178474_1_.func_178540_f().lock();
- label21: {
- try {
- if(p_178474_1_.func_178546_a() == ChunkCompileTaskGenerator.Status.UPLOADING) {
- p_178474_1_.func_178535_a(ChunkCompileTaskGenerator.Status.DONE);
- break label21;
- }
- if(!p_178474_1_.func_178537_h()) {
- 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());
- }
- } finally {
- p_178474_1_.func_178540_f().unlock();
- }
- return;
- }
- p_178474_1_.func_178536_b().func_178580_a(lvt_7_2_);
- }
- public void onFailure(Throwable p_onFailure_1_) {
- ChunkRenderWorker.this.func_178473_b(p_178474_1_);
- if(!(p_onFailure_1_ instanceof CancellationException) && !(p_onFailure_1_ instanceof InterruptedException)) {
- Minecraft.func_71410_x().func_71404_a(CrashReport.func_85055_a(p_onFailure_1_, "Rendering chunk"));
- }
- }
- });
- }
- }
- private boolean func_188263_a(BlockPos p_188263_1_, World p_188263_2_) {
- return !p_188263_2_.func_72964_e(p_188263_1_.func_177958_n() >> 4, p_188263_1_.func_177952_p() >> 4).func_76621_g();
- }
- private RegionRenderCacheBuilder func_178475_b() throws InterruptedException {
- return this.field_178478_c != null?this.field_178478_c:this.field_178477_b.func_178515_c();
- }
- private void func_178473_b(ChunkCompileTaskGenerator p_178473_1_) {
- if(this.field_178478_c == null) {
- this.field_178477_b.func_178512_a(p_178473_1_.func_178545_d());
- }
- }
- public void func_188264_a() {
- this.field_188265_d = false;
- }
- }
- Patching failed: minecraft\net\minecraft\client\renderer\entity\RenderArmorStand.java
- Hunk 1 failed! Cannot find hunk target
- super(p_i46195_1_, new ModelArmorStand(), 0.0F);
- LayerBipedArmor layerbipedarmor = new LayerBipedArmor(this) {
- protected void func_177177_a() {
- - this.field_177189_c = (T)(new ModelArmorStandArmor(0.5F));
- - this.field_177186_d = (T)(new ModelArmorStandArmor(1.0F));
- + this.field_177189_c = new ModelArmorStandArmor(0.5F);
- + this.field_177186_d = new ModelArmorStandArmor(1.0F);
- }
- };
- this.func_177094_a(layerbipedarmor);
- File state
- package net.minecraft.client.renderer.entity;
- import net.minecraft.client.model.ModelArmorStand;
- import net.minecraft.client.model.ModelArmorStandArmor;
- import net.minecraft.client.renderer.GlStateManager;
- import net.minecraft.client.renderer.entity.RenderLivingBase;
- import net.minecraft.client.renderer.entity.RenderManager;
- import net.minecraft.client.renderer.entity.layers.LayerBipedArmor;
- import net.minecraft.client.renderer.entity.layers.LayerCustomHead;
- import net.minecraft.client.renderer.entity.layers.LayerElytra;
- import net.minecraft.client.renderer.entity.layers.LayerHeldItem;
- import net.minecraft.entity.item.EntityArmorStand;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.util.math.MathHelper;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- @SideOnly(Side.CLIENT)
- public class RenderArmorStand extends RenderLivingBase<EntityArmorStand> {
- public static final ResourceLocation field_177103_a = new ResourceLocation("textures/entity/armorstand/wood.png");
- public RenderArmorStand(RenderManager p_i46195_1_) {
- super(p_i46195_1_, new ModelArmorStand(), 0.0F);
- LayerBipedArmor layerbipedarmor = new LayerBipedArmor(this) {
- protected void func_177177_a() {
- this.field_177189_c = new ModelArmorStandArmor(0.5F);
- this.field_177186_d = new ModelArmorStandArmor(1.0F);
- }
- };
- this.func_177094_a(layerbipedarmor);
- this.func_177094_a(new LayerHeldItem(this));
- this.func_177094_a(new LayerElytra(this));
- this.func_177094_a(new LayerCustomHead(this.func_177087_b().field_78116_c));
- }
- protected ResourceLocation func_110775_a(EntityArmorStand p_110775_1_) {
- return field_177103_a;
- }
- public ModelArmorStand func_177087_b() {
- return (ModelArmorStand)super.func_177087_b();
- }
- protected void func_77043_a(EntityArmorStand p_77043_1_, float p_77043_2_, float p_77043_3_, float p_77043_4_) {
- GlStateManager.func_179114_b(180.0F - p_77043_3_, 0.0F, 1.0F, 0.0F);
- float f = (float)(p_77043_1_.field_70170_p.func_82737_E() - p_77043_1_.field_175437_i) + p_77043_4_;
- if(f < 5.0F) {
- GlStateManager.func_179114_b(MathHelper.func_76126_a(f / 1.5F * 3.1415927F) * 3.0F, 0.0F, 1.0F, 0.0F);
- }
- }
- protected boolean func_177070_b(EntityArmorStand p_177070_1_) {
- return p_177070_1_.func_174833_aM();
- }
- 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_) {
- if(p_76986_1_.func_181026_s()) {
- this.field_188323_j = true;
- }
- super.func_76986_a(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
- if(p_76986_1_.func_181026_s()) {
- this.field_188323_j = false;
- }
- }
- }
- Patching failed: minecraft\net\minecraft\client\renderer\entity\RenderManager.java
- Hunk 1 failed! Cannot find hunk target
- }
- public <T extends Entity> Render<T> func_78715_a(Class<? extends Entity> p_78715_1_) {
- - Render<? extends Entity> render = (Render)this.field_78729_o.get(p_78715_1_);
- + Render<T> render = (Render)this.field_78729_o.get(p_78715_1_);
- if (render == null && p_78715_1_ != Entity.class) {
- - render = this.<Entity>func_78715_a(p_78715_1_.getSuperclass());
- + render = this.func_78715_a((Class<? extends Entity>)p_78715_1_.getSuperclass());
- this.field_78729_o.put(p_78715_1_, render);
- }
- File state
- package net.minecraft.client.renderer.entity;
- import com.google.common.collect.Maps;
- import java.util.Map;
- import javax.annotation.Nullable;
- import net.minecraft.block.Block;
- import net.minecraft.block.BlockBed;
- import net.minecraft.block.state.IBlockState;
- import net.minecraft.client.Minecraft;
- import net.minecraft.client.entity.AbstractClientPlayer;
- import net.minecraft.client.gui.FontRenderer;
- import net.minecraft.client.renderer.BufferBuilder;
- import net.minecraft.client.renderer.GlStateManager;
- import net.minecraft.client.renderer.OpenGlHelper;
- import net.minecraft.client.renderer.RenderGlobal;
- import net.minecraft.client.renderer.RenderItem;
- import net.minecraft.client.renderer.Tessellator;
- import net.minecraft.client.renderer.culling.ICamera;
- import net.minecraft.client.renderer.entity.Render;
- import net.minecraft.client.renderer.entity.RenderAbstractHorse;
- import net.minecraft.client.renderer.entity.RenderAreaEffectCloud;
- import net.minecraft.client.renderer.entity.RenderArmorStand;
- import net.minecraft.client.renderer.entity.RenderBat;
- import net.minecraft.client.renderer.entity.RenderBlaze;
- import net.minecraft.client.renderer.entity.RenderBoat;
- import net.minecraft.client.renderer.entity.RenderCaveSpider;
- import net.minecraft.client.renderer.entity.RenderChicken;
- import net.minecraft.client.renderer.entity.RenderCow;
- import net.minecraft.client.renderer.entity.RenderCreeper;
- import net.minecraft.client.renderer.entity.RenderDragon;
- import net.minecraft.client.renderer.entity.RenderDragonFireball;
- import net.minecraft.client.renderer.entity.RenderElderGuardian;
- import net.minecraft.client.renderer.entity.RenderEnderCrystal;
- import net.minecraft.client.renderer.entity.RenderEnderman;
- import net.minecraft.client.renderer.entity.RenderEndermite;
- import net.minecraft.client.renderer.entity.RenderEntity;
- import net.minecraft.client.renderer.entity.RenderEntityItem;
- import net.minecraft.client.renderer.entity.RenderEvoker;
- import net.minecraft.client.renderer.entity.RenderEvokerFangs;
- import net.minecraft.client.renderer.entity.RenderFallingBlock;
- import net.minecraft.client.renderer.entity.RenderFireball;
- import net.minecraft.client.renderer.entity.RenderFish;
- import net.minecraft.client.renderer.entity.RenderGhast;
- import net.minecraft.client.renderer.entity.RenderGiantZombie;
- import net.minecraft.client.renderer.entity.RenderGuardian;
- import net.minecraft.client.renderer.entity.RenderHorse;
- import net.minecraft.client.renderer.entity.RenderHusk;
- import net.minecraft.client.renderer.entity.RenderIllusionIllager;
- import net.minecraft.client.renderer.entity.RenderIronGolem;
- import net.minecraft.client.renderer.entity.RenderItemFrame;
- import net.minecraft.client.renderer.entity.RenderLeashKnot;
- import net.minecraft.client.renderer.entity.RenderLightningBolt;
- import net.minecraft.client.renderer.entity.RenderLlama;
- import net.minecraft.client.renderer.entity.RenderLlamaSpit;
- import net.minecraft.client.renderer.entity.RenderMagmaCube;
- import net.minecraft.client.renderer.entity.RenderMinecart;
- import net.minecraft.client.renderer.entity.RenderMinecartMobSpawner;
- import net.minecraft.client.renderer.entity.RenderMooshroom;
- import net.minecraft.client.renderer.entity.RenderOcelot;
- import net.minecraft.client.renderer.entity.RenderPainting;
- import net.minecraft.client.renderer.entity.RenderParrot;
- import net.minecraft.client.renderer.entity.RenderPig;
- import net.minecraft.client.renderer.entity.RenderPigZombie;
- import net.minecraft.client.renderer.entity.RenderPlayer;
- import net.minecraft.client.renderer.entity.RenderPolarBear;
- import net.minecraft.client.renderer.entity.RenderPotion;
- import net.minecraft.client.renderer.entity.RenderRabbit;
- import net.minecraft.client.renderer.entity.RenderSheep;
- import net.minecraft.client.renderer.entity.RenderShulker;
- import net.minecraft.client.renderer.entity.RenderShulkerBullet;
- import net.minecraft.client.renderer.entity.RenderSilverfish;
- import net.minecraft.client.renderer.entity.RenderSkeleton;
- import net.minecraft.client.renderer.entity.RenderSlime;
- import net.minecraft.client.renderer.entity.RenderSnowMan;
- import net.minecraft.client.renderer.entity.RenderSnowball;
- import net.minecraft.client.renderer.entity.RenderSpectralArrow;
- import net.minecraft.client.renderer.entity.RenderSpider;
- import net.minecraft.client.renderer.entity.RenderSquid;
- import net.minecraft.client.renderer.entity.RenderStray;
- import net.minecraft.client.renderer.entity.RenderTNTPrimed;
- import net.minecraft.client.renderer.entity.RenderTippedArrow;
- import net.minecraft.client.renderer.entity.RenderTntMinecart;
- import net.minecraft.client.renderer.entity.RenderVex;
- import net.minecraft.client.renderer.entity.RenderVillager;
- import net.minecraft.client.renderer.entity.RenderVindicator;
- import net.minecraft.client.renderer.entity.RenderWitch;
- import net.minecraft.client.renderer.entity.RenderWither;
- import net.minecraft.client.renderer.entity.RenderWitherSkeleton;
- import net.minecraft.client.renderer.entity.RenderWitherSkull;
- import net.minecraft.client.renderer.entity.RenderWolf;
- import net.minecraft.client.renderer.entity.RenderXPOrb;
- import net.minecraft.client.renderer.entity.RenderZombie;
- import net.minecraft.client.renderer.entity.RenderZombieVillager;
- import net.minecraft.client.renderer.texture.TextureManager;
- import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
- import net.minecraft.client.settings.GameSettings;
- import net.minecraft.crash.CrashReport;
- import net.minecraft.crash.CrashReportCategory;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.EntityAreaEffectCloud;
- import net.minecraft.entity.EntityLeashKnot;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.entity.boss.EntityDragon;
- import net.minecraft.entity.boss.EntityWither;
- import net.minecraft.entity.effect.EntityLightningBolt;
- import net.minecraft.entity.item.EntityArmorStand;
- import net.minecraft.entity.item.EntityBoat;
- import net.minecraft.entity.item.EntityEnderCrystal;
- import net.minecraft.entity.item.EntityEnderEye;
- import net.minecraft.entity.item.EntityEnderPearl;
- import net.minecraft.entity.item.EntityExpBottle;
- import net.minecraft.entity.item.EntityFallingBlock;
- import net.minecraft.entity.item.EntityFireworkRocket;
- import net.minecraft.entity.item.EntityItem;
- import net.minecraft.entity.item.EntityItemFrame;
- import net.minecraft.entity.item.EntityMinecart;
- import net.minecraft.entity.item.EntityMinecartMobSpawner;
- import net.minecraft.entity.item.EntityMinecartTNT;
- import net.minecraft.entity.item.EntityPainting;
- import net.minecraft.entity.item.EntityTNTPrimed;
- import net.minecraft.entity.item.EntityXPOrb;
- import net.minecraft.entity.monster.EntityBlaze;
- import net.minecraft.entity.monster.EntityCaveSpider;
- import net.minecraft.entity.monster.EntityCreeper;
- import net.minecraft.entity.monster.EntityElderGuardian;
- import net.minecraft.entity.monster.EntityEnderman;
- import net.minecraft.entity.monster.EntityEndermite;
- import net.minecraft.entity.monster.EntityEvoker;
- import net.minecraft.entity.monster.EntityGhast;
- import net.minecraft.entity.monster.EntityGiantZombie;
- import net.minecraft.entity.monster.EntityGuardian;
- import net.minecraft.entity.monster.EntityHusk;
- import net.minecraft.entity.monster.EntityIllusionIllager;
- import net.minecraft.entity.monster.EntityIronGolem;
- import net.minecraft.entity.monster.EntityMagmaCube;
- import net.minecraft.entity.monster.EntityPigZombie;
- import net.minecraft.entity.monster.EntityPolarBear;
- import net.minecraft.entity.monster.EntityShulker;
- import net.minecraft.entity.monster.EntitySilverfish;
- import net.minecraft.entity.monster.EntitySkeleton;
- import net.minecraft.entity.monster.EntitySlime;
- import net.minecraft.entity.monster.EntitySnowman;
- import net.minecraft.entity.monster.EntitySpider;
- import net.minecraft.entity.monster.EntityStray;
- import net.minecraft.entity.monster.EntityVex;
- import net.minecraft.entity.monster.EntityVindicator;
- import net.minecraft.entity.monster.EntityWitch;
- import net.minecraft.entity.monster.EntityWitherSkeleton;
- import net.minecraft.entity.monster.EntityZombie;
- import net.minecraft.entity.monster.EntityZombieVillager;
- import net.minecraft.entity.passive.EntityBat;
- import net.minecraft.entity.passive.EntityChicken;
- import net.minecraft.entity.passive.EntityCow;
- import net.minecraft.entity.passive.EntityDonkey;
- import net.minecraft.entity.passive.EntityHorse;
- import net.minecraft.entity.passive.EntityLlama;
- import net.minecraft.entity.passive.EntityMooshroom;
- import net.minecraft.entity.passive.EntityMule;
- import net.minecraft.entity.passive.EntityOcelot;
- import net.minecraft.entity.passive.EntityParrot;
- import net.minecraft.entity.passive.EntityPig;
- import net.minecraft.entity.passive.EntityRabbit;
- import net.minecraft.entity.passive.EntitySheep;
- import net.minecraft.entity.passive.EntitySkeletonHorse;
- import net.minecraft.entity.passive.EntitySquid;
- import net.minecraft.entity.passive.EntityVillager;
- import net.minecraft.entity.passive.EntityWolf;
- import net.minecraft.entity.passive.EntityZombieHorse;
- import net.minecraft.entity.projectile.EntityDragonFireball;
- import net.minecraft.entity.projectile.EntityEgg;
- import net.minecraft.entity.projectile.EntityEvokerFangs;
- import net.minecraft.entity.projectile.EntityFishHook;
- import net.minecraft.entity.projectile.EntityLargeFireball;
- import net.minecraft.entity.projectile.EntityLlamaSpit;
- import net.minecraft.entity.projectile.EntityPotion;
- import net.minecraft.entity.projectile.EntityShulkerBullet;
- import net.minecraft.entity.projectile.EntitySmallFireball;
- import net.minecraft.entity.projectile.EntitySnowball;
- import net.minecraft.entity.projectile.EntitySpectralArrow;
- import net.minecraft.entity.projectile.EntityTippedArrow;
- import net.minecraft.entity.projectile.EntityWitherSkull;
- import net.minecraft.init.Blocks;
- import net.minecraft.init.Items;
- import net.minecraft.util.EnumFacing;
- import net.minecraft.util.ReportedException;
- import net.minecraft.util.math.AxisAlignedBB;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.util.math.Vec3d;
- import net.minecraft.world.World;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- @SideOnly(Side.CLIENT)
- public class RenderManager {
- public final Map<Class<? extends Entity>, Render<? extends Entity>> field_78729_o = Maps.<Class<? extends Entity>, Render<? extends Entity>>newHashMap();
- private final Map<String, RenderPlayer> field_178636_l = Maps.<String, RenderPlayer>newHashMap();
- private final RenderPlayer field_178637_m;
- private FontRenderer field_78736_p;
- private double field_78725_b;
- private double field_78726_c;
- private double field_78723_d;
- public TextureManager field_78724_e;
- public World field_78722_g;
- public Entity field_78734_h;
- public Entity field_147941_i;
- public float field_78735_i;
- public float field_78732_j;
- public GameSettings field_78733_k;
- public double field_78730_l;
- public double field_78731_m;
- public double field_78728_n;
- private boolean field_178639_r;
- private boolean field_178638_s = true;
- private boolean field_85095_o;
- public RenderManager(TextureManager p_i46180_1_, RenderItem p_i46180_2_) {
- this.field_78724_e = p_i46180_1_;
- this.field_78729_o.put(EntityCaveSpider.class, new RenderCaveSpider(this));
- this.field_78729_o.put(EntitySpider.class, new RenderSpider(this));
- this.field_78729_o.put(EntityPig.class, new RenderPig(this));
- this.field_78729_o.put(EntitySheep.class, new RenderSheep(this));
- this.field_78729_o.put(EntityCow.class, new RenderCow(this));
- this.field_78729_o.put(EntityMooshroom.class, new RenderMooshroom(this));
- this.field_78729_o.put(EntityWolf.class, new RenderWolf(this));
- this.field_78729_o.put(EntityChicken.class, new RenderChicken(this));
- this.field_78729_o.put(EntityOcelot.class, new RenderOcelot(this));
- this.field_78729_o.put(EntityRabbit.class, new RenderRabbit(this));
- this.field_78729_o.put(EntityParrot.class, new RenderParrot(this));
- this.field_78729_o.put(EntitySilverfish.class, new RenderSilverfish(this));
- this.field_78729_o.put(EntityEndermite.class, new RenderEndermite(this));
- this.field_78729_o.put(EntityCreeper.class, new RenderCreeper(this));
- this.field_78729_o.put(EntityEnderman.class, new RenderEnderman(this));
- this.field_78729_o.put(EntitySnowman.class, new RenderSnowMan(this));
- this.field_78729_o.put(EntitySkeleton.class, new RenderSkeleton(this));
- this.field_78729_o.put(EntityWitherSkeleton.class, new RenderWitherSkeleton(this));
- this.field_78729_o.put(EntityStray.class, new RenderStray(this));
- this.field_78729_o.put(EntityWitch.class, new RenderWitch(this));
- this.field_78729_o.put(EntityBlaze.class, new RenderBlaze(this));
- this.field_78729_o.put(EntityPigZombie.class, new RenderPigZombie(this));
- this.field_78729_o.put(EntityZombie.class, new RenderZombie(this));
- this.field_78729_o.put(EntityZombieVillager.class, new RenderZombieVillager(this));
- this.field_78729_o.put(EntityHusk.class, new RenderHusk(this));
- this.field_78729_o.put(EntitySlime.class, new RenderSlime(this));
- this.field_78729_o.put(EntityMagmaCube.class, new RenderMagmaCube(this));
- this.field_78729_o.put(EntityGiantZombie.class, new RenderGiantZombie(this, 6.0F));
- this.field_78729_o.put(EntityGhast.class, new RenderGhast(this));
- this.field_78729_o.put(EntitySquid.class, new RenderSquid(this));
- this.field_78729_o.put(EntityVillager.class, new RenderVillager(this));
- this.field_78729_o.put(EntityIronGolem.class, new RenderIronGolem(this));
- this.field_78729_o.put(EntityBat.class, new RenderBat(this));
- this.field_78729_o.put(EntityGuardian.class, new RenderGuardian(this));
- this.field_78729_o.put(EntityElderGuardian.class, new RenderElderGuardian(this));
- this.field_78729_o.put(EntityShulker.class, new RenderShulker(this));
- this.field_78729_o.put(EntityPolarBear.class, new RenderPolarBear(this));
- this.field_78729_o.put(EntityEvoker.class, new RenderEvoker(this));
- this.field_78729_o.put(EntityVindicator.class, new RenderVindicator(this));
- this.field_78729_o.put(EntityVex.class, new RenderVex(this));
- this.field_78729_o.put(EntityIllusionIllager.class, new RenderIllusionIllager(this));
- this.field_78729_o.put(EntityDragon.class, new RenderDragon(this));
- this.field_78729_o.put(EntityEnderCrystal.class, new RenderEnderCrystal(this));
- this.field_78729_o.put(EntityWither.class, new RenderWither(this));
- this.field_78729_o.put(Entity.class, new RenderEntity(this));
- this.field_78729_o.put(EntityPainting.class, new RenderPainting(this));
- this.field_78729_o.put(EntityItemFrame.class, new RenderItemFrame(this, p_i46180_2_));
- this.field_78729_o.put(EntityLeashKnot.class, new RenderLeashKnot(this));
- this.field_78729_o.put(EntityTippedArrow.class, new RenderTippedArrow(this));
- this.field_78729_o.put(EntitySpectralArrow.class, new RenderSpectralArrow(this));
- this.field_78729_o.put(EntitySnowball.class, new RenderSnowball(this, Items.field_151126_ay, p_i46180_2_));
- this.field_78729_o.put(EntityEnderPearl.class, new RenderSnowball(this, Items.field_151079_bi, p_i46180_2_));
- this.field_78729_o.put(EntityEnderEye.class, new RenderSnowball(this, Items.field_151061_bv, p_i46180_2_));
- this.field_78729_o.put(EntityEgg.class, new RenderSnowball(this, Items.field_151110_aK, p_i46180_2_));
- this.field_78729_o.put(EntityPotion.class, new RenderPotion(this, p_i46180_2_));
- this.field_78729_o.put(EntityExpBottle.class, new RenderSnowball(this, Items.field_151062_by, p_i46180_2_));
- this.field_78729_o.put(EntityFireworkRocket.class, new RenderSnowball(this, Items.field_151152_bP, p_i46180_2_));
- this.field_78729_o.put(EntityLargeFireball.class, new RenderFireball(this, 2.0F));
- this.field_78729_o.put(EntitySmallFireball.class, new RenderFireball(this, 0.5F));
- this.field_78729_o.put(EntityDragonFireball.class, new RenderDragonFireball(this));
- this.field_78729_o.put(EntityWitherSkull.class, new RenderWitherSkull(this));
- this.field_78729_o.put(EntityShulkerBullet.class, new RenderShulkerBullet(this));
- this.field_78729_o.put(EntityItem.class, new RenderEntityItem(this, p_i46180_2_));
- this.field_78729_o.put(EntityXPOrb.class, new RenderXPOrb(this));
- this.field_78729_o.put(EntityTNTPrimed.class, new RenderTNTPrimed(this));
- this.field_78729_o.put(EntityFallingBlock.class, new RenderFallingBlock(this));
- this.field_78729_o.put(EntityArmorStand.class, new RenderArmorStand(this));
- this.field_78729_o.put(EntityEvokerFangs.class, new RenderEvokerFangs(this));
- this.field_78729_o.put(EntityMinecartTNT.class, new RenderTntMinecart(this));
- this.field_78729_o.put(EntityMinecartMobSpawner.class, new RenderMinecartMobSpawner(this));
- this.field_78729_o.put(EntityMinecart.class, new RenderMinecart(this));
- this.field_78729_o.put(EntityBoat.class, new RenderBoat(this));
- this.field_78729_o.put(EntityFishHook.class, new RenderFish(this));
- this.field_78729_o.put(EntityAreaEffectCloud.class, new RenderAreaEffectCloud(this));
- this.field_78729_o.put(EntityHorse.class, new RenderHorse(this));
- this.field_78729_o.put(EntitySkeletonHorse.class, new RenderAbstractHorse(this));
- this.field_78729_o.put(EntityZombieHorse.class, new RenderAbstractHorse(this));
- this.field_78729_o.put(EntityMule.class, new RenderAbstractHorse(this, 0.92F));
- this.field_78729_o.put(EntityDonkey.class, new RenderAbstractHorse(this, 0.87F));
- this.field_78729_o.put(EntityLlama.class, new RenderLlama(this));
- this.field_78729_o.put(EntityLlamaSpit.class, new RenderLlamaSpit(this));
- this.field_78729_o.put(EntityLightningBolt.class, new RenderLightningBolt(this));
- this.field_178637_m = new RenderPlayer(this);
- this.field_178636_l.put("default", this.field_178637_m);
- this.field_178636_l.put("slim", new RenderPlayer(this, true));
- }
- public void func_178628_a(double p_178628_1_, double p_178628_3_, double p_178628_5_) {
- this.field_78725_b = p_178628_1_;
- this.field_78726_c = p_178628_3_;
- this.field_78723_d = p_178628_5_;
- }
- public <T extends Entity> Render<T> func_78715_a(Class<? extends Entity> p_78715_1_) {
- Render<? extends Entity> render = (Render)this.field_78729_o.get(p_78715_1_);
- if(render == null && p_78715_1_ != Entity.class) {
- render = this.<Entity>func_78715_a(p_78715_1_.getSuperclass());
- this.field_78729_o.put(p_78715_1_, render);
- }
- return render;
- }
- @Nullable
- public <T extends Entity> Render<T> func_78713_a(Entity p_78713_1_) {
- if(p_78713_1_ instanceof AbstractClientPlayer) {
- String s = ((AbstractClientPlayer)p_78713_1_).func_175154_l();
- RenderPlayer renderplayer = (RenderPlayer)this.field_178636_l.get(s);
- return renderplayer != null?renderplayer:this.field_178637_m;
- } else {
- return this.<T>func_78715_a(p_78713_1_.getClass());
- }
- }
- 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_) {
- this.field_78722_g = p_180597_1_;
- this.field_78733_k = p_180597_5_;
- this.field_78734_h = p_180597_3_;
- this.field_147941_i = p_180597_4_;
- this.field_78736_p = p_180597_2_;
- if(p_180597_3_ instanceof EntityLivingBase && ((EntityLivingBase)p_180597_3_).func_70608_bn()) {
- IBlockState iblockstate = p_180597_1_.func_180495_p(new BlockPos(p_180597_3_));
- Block block = iblockstate.func_177230_c();
- if(block == Blocks.field_150324_C) {
- int i = ((EnumFacing)iblockstate.func_177229_b(BlockBed.field_185512_D)).func_176736_b();
- this.field_78735_i = (float)(i * 90 + 180);
- this.field_78732_j = 0.0F;
- }
- } else {
- 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_;
- 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_;
- }
- if(p_180597_5_.field_74320_O == 2) {
- this.field_78735_i += 180.0F;
- }
- 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_;
- 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_;
- 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_;
- }
- public void func_178631_a(float p_178631_1_) {
- this.field_78735_i = p_178631_1_;
- }
- public boolean func_178627_a() {
- return this.field_178638_s;
- }
- public void func_178633_a(boolean p_178633_1_) {
- this.field_178638_s = p_178633_1_;
- }
- public void func_178629_b(boolean p_178629_1_) {
- this.field_85095_o = p_178629_1_;
- }
- public boolean func_178634_b() {
- return this.field_85095_o;
- }
- public boolean func_188390_b(Entity p_188390_1_) {
- return this.func_78713_a(p_188390_1_).func_188295_H_();
- }
- 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_) {
- Render<Entity> render = this.<Entity>func_78713_a(p_178635_1_);
- return render != null && render.func_177071_a(p_178635_1_, p_178635_2_, p_178635_3_, p_178635_5_, p_178635_7_);
- }
- public void func_188388_a(Entity p_188388_1_, float p_188388_2_, boolean p_188388_3_) {
- if(p_188388_1_.field_70173_aa == 0) {
- p_188388_1_.field_70142_S = p_188388_1_.field_70165_t;
- p_188388_1_.field_70137_T = p_188388_1_.field_70163_u;
- p_188388_1_.field_70136_U = p_188388_1_.field_70161_v;
- }
- double d0 = p_188388_1_.field_70142_S + (p_188388_1_.field_70165_t - p_188388_1_.field_70142_S) * (double)p_188388_2_;
- double d1 = p_188388_1_.field_70137_T + (p_188388_1_.field_70163_u - p_188388_1_.field_70137_T) * (double)p_188388_2_;
- double d2 = p_188388_1_.field_70136_U + (p_188388_1_.field_70161_v - p_188388_1_.field_70136_U) * (double)p_188388_2_;
- float f = p_188388_1_.field_70126_B + (p_188388_1_.field_70177_z - p_188388_1_.field_70126_B) * p_188388_2_;
- int i = p_188388_1_.func_70070_b();
- if(p_188388_1_.func_70027_ad()) {
- i = 15728880;
- }
- int j = i % 65536;
- int k = i / 65536;
- OpenGlHelper.func_77475_a(OpenGlHelper.field_77476_b, (float)j, (float)k);
- GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
- 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_);
- }
- 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_) {
- Render<Entity> render = null;
- try {
- render = this.<Entity>func_78713_a(p_188391_1_);
- if(render != null && this.field_78724_e != null) {
- try {
- render.func_188297_a(this.field_178639_r);
- render.func_76986_a(p_188391_1_, p_188391_2_, p_188391_4_, p_188391_6_, p_188391_8_, p_188391_9_);
- } catch (Throwable throwable1) {
- throw new ReportedException(CrashReport.func_85055_a(throwable1, "Rendering entity in world"));
- }
- try {
- if(!this.field_178639_r) {
- render.func_76979_b(p_188391_1_, p_188391_2_, p_188391_4_, p_188391_6_, p_188391_8_, p_188391_9_);
- }
- } catch (Throwable throwable2) {
- throw new ReportedException(CrashReport.func_85055_a(throwable2, "Post-rendering entity in world"));
- }
- if(this.field_85095_o && !p_188391_1_.func_82150_aj() && !p_188391_10_ && !Minecraft.func_71410_x().func_189648_am()) {
- try {
- this.func_85094_b(p_188391_1_, p_188391_2_, p_188391_4_, p_188391_6_, p_188391_8_, p_188391_9_);
- } catch (Throwable throwable) {
- throw new ReportedException(CrashReport.func_85055_a(throwable, "Rendering entity hitbox in world"));
- }
- }
- }
- } catch (Throwable throwable3) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable3, "Rendering entity in world");
- CrashReportCategory crashreportcategory = crashreport.func_85058_a("Entity being rendered");
- p_188391_1_.func_85029_a(crashreportcategory);
- CrashReportCategory crashreportcategory1 = crashreport.func_85058_a("Renderer details");
- crashreportcategory1.func_71507_a("Assigned renderer", render);
- crashreportcategory1.func_71507_a("Location", CrashReportCategory.func_85074_a(p_188391_2_, p_188391_4_, p_188391_6_));
- crashreportcategory1.func_71507_a("Rotation", Float.valueOf(p_188391_8_));
- crashreportcategory1.func_71507_a("Delta", Float.valueOf(p_188391_9_));
- throw new ReportedException(crashreport);
- }
- }
- public void func_188389_a(Entity p_188389_1_, float p_188389_2_) {
- if(p_188389_1_.field_70173_aa == 0) {
- p_188389_1_.field_70142_S = p_188389_1_.field_70165_t;
- p_188389_1_.field_70137_T = p_188389_1_.field_70163_u;
- p_188389_1_.field_70136_U = p_188389_1_.field_70161_v;
- }
- double d0 = p_188389_1_.field_70142_S + (p_188389_1_.field_70165_t - p_188389_1_.field_70142_S) * (double)p_188389_2_;
- double d1 = p_188389_1_.field_70137_T + (p_188389_1_.field_70163_u - p_188389_1_.field_70137_T) * (double)p_188389_2_;
- double d2 = p_188389_1_.field_70136_U + (p_188389_1_.field_70161_v - p_188389_1_.field_70136_U) * (double)p_188389_2_;
- float f = p_188389_1_.field_70126_B + (p_188389_1_.field_70177_z - p_188389_1_.field_70126_B) * p_188389_2_;
- int i = p_188389_1_.func_70070_b();
- if(p_188389_1_.func_70027_ad()) {
- i = 15728880;
- }
- int j = i % 65536;
- int k = i / 65536;
- OpenGlHelper.func_77475_a(OpenGlHelper.field_77476_b, (float)j, (float)k);
- GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
- Render<Entity> render = this.<Entity>func_78713_a(p_188389_1_);
- if(render != null && this.field_78724_e != null) {
- 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_);
- }
- }
- 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_) {
- GlStateManager.func_179132_a(false);
- GlStateManager.func_179090_x();
- GlStateManager.func_179140_f();
- GlStateManager.func_179129_p();
- GlStateManager.func_179084_k();
- float f = p_85094_1_.field_70130_N / 2.0F;
- AxisAlignedBB axisalignedbb = p_85094_1_.func_174813_aQ();
- 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);
- Entity[] aentity = p_85094_1_.func_70021_al();
- if(aentity != null) {
- for(Entity entity : aentity) {
- double d0 = (entity.field_70165_t - entity.field_70169_q) * (double)p_85094_9_;
- double d1 = (entity.field_70163_u - entity.field_70167_r) * (double)p_85094_9_;
- double d2 = (entity.field_70161_v - entity.field_70166_s) * (double)p_85094_9_;
- AxisAlignedBB axisalignedbb1 = entity.func_174813_aQ();
- 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);
- }
- }
- if(p_85094_1_ instanceof EntityLivingBase) {
- float f1 = 0.01F;
- 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);
- }
- Tessellator tessellator = Tessellator.func_178181_a();
- BufferBuilder bufferbuilder = tessellator.func_178180_c();
- Vec3d vec3d = p_85094_1_.func_70676_i(p_85094_9_);
- bufferbuilder.func_181668_a(3, DefaultVertexFormats.field_181706_f);
- 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();
- 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();
- tessellator.func_78381_a();
- GlStateManager.func_179098_w();
- GlStateManager.func_179145_e();
- GlStateManager.func_179089_o();
- GlStateManager.func_179084_k();
- GlStateManager.func_179132_a(true);
- }
- public void func_78717_a(@Nullable World p_78717_1_) {
- this.field_78722_g = p_78717_1_;
- if(p_78717_1_ == null) {
- this.field_78734_h = null;
- }
- }
- public double func_78714_a(double p_78714_1_, double p_78714_3_, double p_78714_5_) {
- double d0 = p_78714_1_ - this.field_78730_l;
- double d1 = p_78714_3_ - this.field_78731_m;
- double d2 = p_78714_5_ - this.field_78728_n;
- return d0 * d0 + d1 * d1 + d2 * d2;
- }
- public FontRenderer func_78716_a() {
- return this.field_78736_p;
- }
- public void func_178632_c(boolean p_178632_1_) {
- this.field_178639_r = p_178632_1_;
- }
- }
- Hunk 2 failed! Cannot find hunk target
- if (p_78713_1_ instanceof AbstractClientPlayer) {
- String s = ((AbstractClientPlayer)p_78713_1_).func_175154_l();
- RenderPlayer renderplayer = this.field_178636_l.get(s);
- - return renderplayer != null ? renderplayer : this.field_178637_m;
- + return (Render<T>)(renderplayer != null ? renderplayer : this.field_178637_m);
- } else {
- return this.<T>func_78715_a(p_78713_1_.getClass());
- }
- File state
- package net.minecraft.client.renderer.entity;
- import com.google.common.collect.Maps;
- import java.util.Map;
- import javax.annotation.Nullable;
- import net.minecraft.block.Block;
- import net.minecraft.block.BlockBed;
- import net.minecraft.block.state.IBlockState;
- import net.minecraft.client.Minecraft;
- import net.minecraft.client.entity.AbstractClientPlayer;
- import net.minecraft.client.gui.FontRenderer;
- import net.minecraft.client.renderer.BufferBuilder;
- import net.minecraft.client.renderer.GlStateManager;
- import net.minecraft.client.renderer.OpenGlHelper;
- import net.minecraft.client.renderer.RenderGlobal;
- import net.minecraft.client.renderer.RenderItem;
- import net.minecraft.client.renderer.Tessellator;
- import net.minecraft.client.renderer.culling.ICamera;
- import net.minecraft.client.renderer.entity.Render;
- import net.minecraft.client.renderer.entity.RenderAbstractHorse;
- import net.minecraft.client.renderer.entity.RenderAreaEffectCloud;
- import net.minecraft.client.renderer.entity.RenderArmorStand;
- import net.minecraft.client.renderer.entity.RenderBat;
- import net.minecraft.client.renderer.entity.RenderBlaze;
- import net.minecraft.client.renderer.entity.RenderBoat;
- import net.minecraft.client.renderer.entity.RenderCaveSpider;
- import net.minecraft.client.renderer.entity.RenderChicken;
- import net.minecraft.client.renderer.entity.RenderCow;
- import net.minecraft.client.renderer.entity.RenderCreeper;
- import net.minecraft.client.renderer.entity.RenderDragon;
- import net.minecraft.client.renderer.entity.RenderDragonFireball;
- import net.minecraft.client.renderer.entity.RenderElderGuardian;
- import net.minecraft.client.renderer.entity.RenderEnderCrystal;
- import net.minecraft.client.renderer.entity.RenderEnderman;
- import net.minecraft.client.renderer.entity.RenderEndermite;
- import net.minecraft.client.renderer.entity.RenderEntity;
- import net.minecraft.client.renderer.entity.RenderEntityItem;
- import net.minecraft.client.renderer.entity.RenderEvoker;
- import net.minecraft.client.renderer.entity.RenderEvokerFangs;
- import net.minecraft.client.renderer.entity.RenderFallingBlock;
- import net.minecraft.client.renderer.entity.RenderFireball;
- import net.minecraft.client.renderer.entity.RenderFish;
- import net.minecraft.client.renderer.entity.RenderGhast;
- import net.minecraft.client.renderer.entity.RenderGiantZombie;
- import net.minecraft.client.renderer.entity.RenderGuardian;
- import net.minecraft.client.renderer.entity.RenderHorse;
- import net.minecraft.client.renderer.entity.RenderHusk;
- import net.minecraft.client.renderer.entity.RenderIllusionIllager;
- import net.minecraft.client.renderer.entity.RenderIronGolem;
- import net.minecraft.client.renderer.entity.RenderItemFrame;
- import net.minecraft.client.renderer.entity.RenderLeashKnot;
- import net.minecraft.client.renderer.entity.RenderLightningBolt;
- import net.minecraft.client.renderer.entity.RenderLlama;
- import net.minecraft.client.renderer.entity.RenderLlamaSpit;
- import net.minecraft.client.renderer.entity.RenderMagmaCube;
- import net.minecraft.client.renderer.entity.RenderMinecart;
- import net.minecraft.client.renderer.entity.RenderMinecartMobSpawner;
- import net.minecraft.client.renderer.entity.RenderMooshroom;
- import net.minecraft.client.renderer.entity.RenderOcelot;
- import net.minecraft.client.renderer.entity.RenderPainting;
- import net.minecraft.client.renderer.entity.RenderParrot;
- import net.minecraft.client.renderer.entity.RenderPig;
- import net.minecraft.client.renderer.entity.RenderPigZombie;
- import net.minecraft.client.renderer.entity.RenderPlayer;
- import net.minecraft.client.renderer.entity.RenderPolarBear;
- import net.minecraft.client.renderer.entity.RenderPotion;
- import net.minecraft.client.renderer.entity.RenderRabbit;
- import net.minecraft.client.renderer.entity.RenderSheep;
- import net.minecraft.client.renderer.entity.RenderShulker;
- import net.minecraft.client.renderer.entity.RenderShulkerBullet;
- import net.minecraft.client.renderer.entity.RenderSilverfish;
- import net.minecraft.client.renderer.entity.RenderSkeleton;
- import net.minecraft.client.renderer.entity.RenderSlime;
- import net.minecraft.client.renderer.entity.RenderSnowMan;
- import net.minecraft.client.renderer.entity.RenderSnowball;
- import net.minecraft.client.renderer.entity.RenderSpectralArrow;
- import net.minecraft.client.renderer.entity.RenderSpider;
- import net.minecraft.client.renderer.entity.RenderSquid;
- import net.minecraft.client.renderer.entity.RenderStray;
- import net.minecraft.client.renderer.entity.RenderTNTPrimed;
- import net.minecraft.client.renderer.entity.RenderTippedArrow;
- import net.minecraft.client.renderer.entity.RenderTntMinecart;
- import net.minecraft.client.renderer.entity.RenderVex;
- import net.minecraft.client.renderer.entity.RenderVillager;
- import net.minecraft.client.renderer.entity.RenderVindicator;
- import net.minecraft.client.renderer.entity.RenderWitch;
- import net.minecraft.client.renderer.entity.RenderWither;
- import net.minecraft.client.renderer.entity.RenderWitherSkeleton;
- import net.minecraft.client.renderer.entity.RenderWitherSkull;
- import net.minecraft.client.renderer.entity.RenderWolf;
- import net.minecraft.client.renderer.entity.RenderXPOrb;
- import net.minecraft.client.renderer.entity.RenderZombie;
- import net.minecraft.client.renderer.entity.RenderZombieVillager;
- import net.minecraft.client.renderer.texture.TextureManager;
- import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
- import net.minecraft.client.settings.GameSettings;
- import net.minecraft.crash.CrashReport;
- import net.minecraft.crash.CrashReportCategory;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.EntityAreaEffectCloud;
- import net.minecraft.entity.EntityLeashKnot;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.entity.boss.EntityDragon;
- import net.minecraft.entity.boss.EntityWither;
- import net.minecraft.entity.effect.EntityLightningBolt;
- import net.minecraft.entity.item.EntityArmorStand;
- import net.minecraft.entity.item.EntityBoat;
- import net.minecraft.entity.item.EntityEnderCrystal;
- import net.minecraft.entity.item.EntityEnderEye;
- import net.minecraft.entity.item.EntityEnderPearl;
- import net.minecraft.entity.item.EntityExpBottle;
- import net.minecraft.entity.item.EntityFallingBlock;
- import net.minecraft.entity.item.EntityFireworkRocket;
- import net.minecraft.entity.item.EntityItem;
- import net.minecraft.entity.item.EntityItemFrame;
- import net.minecraft.entity.item.EntityMinecart;
- import net.minecraft.entity.item.EntityMinecartMobSpawner;
- import net.minecraft.entity.item.EntityMinecartTNT;
- import net.minecraft.entity.item.EntityPainting;
- import net.minecraft.entity.item.EntityTNTPrimed;
- import net.minecraft.entity.item.EntityXPOrb;
- import net.minecraft.entity.monster.EntityBlaze;
- import net.minecraft.entity.monster.EntityCaveSpider;
- import net.minecraft.entity.monster.EntityCreeper;
- import net.minecraft.entity.monster.EntityElderGuardian;
- import net.minecraft.entity.monster.EntityEnderman;
- import net.minecraft.entity.monster.EntityEndermite;
- import net.minecraft.entity.monster.EntityEvoker;
- import net.minecraft.entity.monster.EntityGhast;
- import net.minecraft.entity.monster.EntityGiantZombie;
- import net.minecraft.entity.monster.EntityGuardian;
- import net.minecraft.entity.monster.EntityHusk;
- import net.minecraft.entity.monster.EntityIllusionIllager;
- import net.minecraft.entity.monster.EntityIronGolem;
- import net.minecraft.entity.monster.EntityMagmaCube;
- import net.minecraft.entity.monster.EntityPigZombie;
- import net.minecraft.entity.monster.EntityPolarBear;
- import net.minecraft.entity.monster.EntityShulker;
- import net.minecraft.entity.monster.EntitySilverfish;
- import net.minecraft.entity.monster.EntitySkeleton;
- import net.minecraft.entity.monster.EntitySlime;
- import net.minecraft.entity.monster.EntitySnowman;
- import net.minecraft.entity.monster.EntitySpider;
- import net.minecraft.entity.monster.EntityStray;
- import net.minecraft.entity.monster.EntityVex;
- import net.minecraft.entity.monster.EntityVindicator;
- import net.minecraft.entity.monster.EntityWitch;
- import net.minecraft.entity.monster.EntityWitherSkeleton;
- import net.minecraft.entity.monster.EntityZombie;
- import net.minecraft.entity.monster.EntityZombieVillager;
- import net.minecraft.entity.passive.EntityBat;
- import net.minecraft.entity.passive.EntityChicken;
- import net.minecraft.entity.passive.EntityCow;
- import net.minecraft.entity.passive.EntityDonkey;
- import net.minecraft.entity.passive.EntityHorse;
- import net.minecraft.entity.passive.EntityLlama;
- import net.minecraft.entity.passive.EntityMooshroom;
- import net.minecraft.entity.passive.EntityMule;
- import net.minecraft.entity.passive.EntityOcelot;
- import net.minecraft.entity.passive.EntityParrot;
- import net.minecraft.entity.passive.EntityPig;
- import net.minecraft.entity.passive.EntityRabbit;
- import net.minecraft.entity.passive.EntitySheep;
- import net.minecraft.entity.passive.EntitySkeletonHorse;
- import net.minecraft.entity.passive.EntitySquid;
- import net.minecraft.entity.passive.EntityVillager;
- import net.minecraft.entity.passive.EntityWolf;
- import net.minecraft.entity.passive.EntityZombieHorse;
- import net.minecraft.entity.projectile.EntityDragonFireball;
- import net.minecraft.entity.projectile.EntityEgg;
- import net.minecraft.entity.projectile.EntityEvokerFangs;
- import net.minecraft.entity.projectile.EntityFishHook;
- import net.minecraft.entity.projectile.EntityLargeFireball;
- import net.minecraft.entity.projectile.EntityLlamaSpit;
- import net.minecraft.entity.projectile.EntityPotion;
- import net.minecraft.entity.projectile.EntityShulkerBullet;
- import net.minecraft.entity.projectile.EntitySmallFireball;
- import net.minecraft.entity.projectile.EntitySnowball;
- import net.minecraft.entity.projectile.EntitySpectralArrow;
- import net.minecraft.entity.projectile.EntityTippedArrow;
- import net.minecraft.entity.projectile.EntityWitherSkull;
- import net.minecraft.init.Blocks;
- import net.minecraft.init.Items;
- import net.minecraft.util.EnumFacing;
- import net.minecraft.util.ReportedException;
- import net.minecraft.util.math.AxisAlignedBB;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.util.math.Vec3d;
- import net.minecraft.world.World;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- @SideOnly(Side.CLIENT)
- public class RenderManager {
- public final Map<Class<? extends Entity>, Render<? extends Entity>> field_78729_o = Maps.<Class<? extends Entity>, Render<? extends Entity>>newHashMap();
- private final Map<String, RenderPlayer> field_178636_l = Maps.<String, RenderPlayer>newHashMap();
- private final RenderPlayer field_178637_m;
- private FontRenderer field_78736_p;
- private double field_78725_b;
- private double field_78726_c;
- private double field_78723_d;
- public TextureManager field_78724_e;
- public World field_78722_g;
- public Entity field_78734_h;
- public Entity field_147941_i;
- public float field_78735_i;
- public float field_78732_j;
- public GameSettings field_78733_k;
- public double field_78730_l;
- public double field_78731_m;
- public double field_78728_n;
- private boolean field_178639_r;
- private boolean field_178638_s = true;
- private boolean field_85095_o;
- public RenderManager(TextureManager p_i46180_1_, RenderItem p_i46180_2_) {
- this.field_78724_e = p_i46180_1_;
- this.field_78729_o.put(EntityCaveSpider.class, new RenderCaveSpider(this));
- this.field_78729_o.put(EntitySpider.class, new RenderSpider(this));
- this.field_78729_o.put(EntityPig.class, new RenderPig(this));
- this.field_78729_o.put(EntitySheep.class, new RenderSheep(this));
- this.field_78729_o.put(EntityCow.class, new RenderCow(this));
- this.field_78729_o.put(EntityMooshroom.class, new RenderMooshroom(this));
- this.field_78729_o.put(EntityWolf.class, new RenderWolf(this));
- this.field_78729_o.put(EntityChicken.class, new RenderChicken(this));
- this.field_78729_o.put(EntityOcelot.class, new RenderOcelot(this));
- this.field_78729_o.put(EntityRabbit.class, new RenderRabbit(this));
- this.field_78729_o.put(EntityParrot.class, new RenderParrot(this));
- this.field_78729_o.put(EntitySilverfish.class, new RenderSilverfish(this));
- this.field_78729_o.put(EntityEndermite.class, new RenderEndermite(this));
- this.field_78729_o.put(EntityCreeper.class, new RenderCreeper(this));
- this.field_78729_o.put(EntityEnderman.class, new RenderEnderman(this));
- this.field_78729_o.put(EntitySnowman.class, new RenderSnowMan(this));
- this.field_78729_o.put(EntitySkeleton.class, new RenderSkeleton(this));
- this.field_78729_o.put(EntityWitherSkeleton.class, new RenderWitherSkeleton(this));
- this.field_78729_o.put(EntityStray.class, new RenderStray(this));
- this.field_78729_o.put(EntityWitch.class, new RenderWitch(this));
- this.field_78729_o.put(EntityBlaze.class, new RenderBlaze(this));
- this.field_78729_o.put(EntityPigZombie.class, new RenderPigZombie(this));
- this.field_78729_o.put(EntityZombie.class, new RenderZombie(this));
- this.field_78729_o.put(EntityZombieVillager.class, new RenderZombieVillager(this));
- this.field_78729_o.put(EntityHusk.class, new RenderHusk(this));
- this.field_78729_o.put(EntitySlime.class, new RenderSlime(this));
- this.field_78729_o.put(EntityMagmaCube.class, new RenderMagmaCube(this));
- this.field_78729_o.put(EntityGiantZombie.class, new RenderGiantZombie(this, 6.0F));
- this.field_78729_o.put(EntityGhast.class, new RenderGhast(this));
- this.field_78729_o.put(EntitySquid.class, new RenderSquid(this));
- this.field_78729_o.put(EntityVillager.class, new RenderVillager(this));
- this.field_78729_o.put(EntityIronGolem.class, new RenderIronGolem(this));
- this.field_78729_o.put(EntityBat.class, new RenderBat(this));
- this.field_78729_o.put(EntityGuardian.class, new RenderGuardian(this));
- this.field_78729_o.put(EntityElderGuardian.class, new RenderElderGuardian(this));
- this.field_78729_o.put(EntityShulker.class, new RenderShulker(this));
- this.field_78729_o.put(EntityPolarBear.class, new RenderPolarBear(this));
- this.field_78729_o.put(EntityEvoker.class, new RenderEvoker(this));
- this.field_78729_o.put(EntityVindicator.class, new RenderVindicator(this));
- this.field_78729_o.put(EntityVex.class, new RenderVex(this));
- this.field_78729_o.put(EntityIllusionIllager.class, new RenderIllusionIllager(this));
- this.field_78729_o.put(EntityDragon.class, new RenderDragon(this));
- this.field_78729_o.put(EntityEnderCrystal.class, new RenderEnderCrystal(this));
- this.field_78729_o.put(EntityWither.class, new RenderWither(this));
- this.field_78729_o.put(Entity.class, new RenderEntity(this));
- this.field_78729_o.put(EntityPainting.class, new RenderPainting(this));
- this.field_78729_o.put(EntityItemFrame.class, new RenderItemFrame(this, p_i46180_2_));
- this.field_78729_o.put(EntityLeashKnot.class, new RenderLeashKnot(this));
- this.field_78729_o.put(EntityTippedArrow.class, new RenderTippedArrow(this));
- this.field_78729_o.put(EntitySpectralArrow.class, new RenderSpectralArrow(this));
- this.field_78729_o.put(EntitySnowball.class, new RenderSnowball(this, Items.field_151126_ay, p_i46180_2_));
- this.field_78729_o.put(EntityEnderPearl.class, new RenderSnowball(this, Items.field_151079_bi, p_i46180_2_));
- this.field_78729_o.put(EntityEnderEye.class, new RenderSnowball(this, Items.field_151061_bv, p_i46180_2_));
- this.field_78729_o.put(EntityEgg.class, new RenderSnowball(this, Items.field_151110_aK, p_i46180_2_));
- this.field_78729_o.put(EntityPotion.class, new RenderPotion(this, p_i46180_2_));
- this.field_78729_o.put(EntityExpBottle.class, new RenderSnowball(this, Items.field_151062_by, p_i46180_2_));
- this.field_78729_o.put(EntityFireworkRocket.class, new RenderSnowball(this, Items.field_151152_bP, p_i46180_2_));
- this.field_78729_o.put(EntityLargeFireball.class, new RenderFireball(this, 2.0F));
- this.field_78729_o.put(EntitySmallFireball.class, new RenderFireball(this, 0.5F));
- this.field_78729_o.put(EntityDragonFireball.class, new RenderDragonFireball(this));
- this.field_78729_o.put(EntityWitherSkull.class, new RenderWitherSkull(this));
- this.field_78729_o.put(EntityShulkerBullet.class, new RenderShulkerBullet(this));
- this.field_78729_o.put(EntityItem.class, new RenderEntityItem(this, p_i46180_2_));
- this.field_78729_o.put(EntityXPOrb.class, new RenderXPOrb(this));
- this.field_78729_o.put(EntityTNTPrimed.class, new RenderTNTPrimed(this));
- this.field_78729_o.put(EntityFallingBlock.class, new RenderFallingBlock(this));
- this.field_78729_o.put(EntityArmorStand.class, new RenderArmorStand(this));
- this.field_78729_o.put(EntityEvokerFangs.class, new RenderEvokerFangs(this));
- this.field_78729_o.put(EntityMinecartTNT.class, new RenderTntMinecart(this));
- this.field_78729_o.put(EntityMinecartMobSpawner.class, new RenderMinecartMobSpawner(this));
- this.field_78729_o.put(EntityMinecart.class, new RenderMinecart(this));
- this.field_78729_o.put(EntityBoat.class, new RenderBoat(this));
- this.field_78729_o.put(EntityFishHook.class, new RenderFish(this));
- this.field_78729_o.put(EntityAreaEffectCloud.class, new RenderAreaEffectCloud(this));
- this.field_78729_o.put(EntityHorse.class, new RenderHorse(this));
- this.field_78729_o.put(EntitySkeletonHorse.class, new RenderAbstractHorse(this));
- this.field_78729_o.put(EntityZombieHorse.class, new RenderAbstractHorse(this));
- this.field_78729_o.put(EntityMule.class, new RenderAbstractHorse(this, 0.92F));
- this.field_78729_o.put(EntityDonkey.class, new RenderAbstractHorse(this, 0.87F));
- this.field_78729_o.put(EntityLlama.class, new RenderLlama(this));
- this.field_78729_o.put(EntityLlamaSpit.class, new RenderLlamaSpit(this));
- this.field_78729_o.put(EntityLightningBolt.class, new RenderLightningBolt(this));
- this.field_178637_m = new RenderPlayer(this);
- this.field_178636_l.put("default", this.field_178637_m);
- this.field_178636_l.put("slim", new RenderPlayer(this, true));
- }
- public void func_178628_a(double p_178628_1_, double p_178628_3_, double p_178628_5_) {
- this.field_78725_b = p_178628_1_;
- this.field_78726_c = p_178628_3_;
- this.field_78723_d = p_178628_5_;
- }
- public <T extends Entity> Render<T> func_78715_a(Class<? extends Entity> p_78715_1_) {
- Render<? extends Entity> render = (Render)this.field_78729_o.get(p_78715_1_);
- if(render == null && p_78715_1_ != Entity.class) {
- render = this.<Entity>func_78715_a(p_78715_1_.getSuperclass());
- this.field_78729_o.put(p_78715_1_, render);
- }
- return render;
- }
- @Nullable
- public <T extends Entity> Render<T> func_78713_a(Entity p_78713_1_) {
- if(p_78713_1_ instanceof AbstractClientPlayer) {
- String s = ((AbstractClientPlayer)p_78713_1_).func_175154_l();
- RenderPlayer renderplayer = (RenderPlayer)this.field_178636_l.get(s);
- return renderplayer != null?renderplayer:this.field_178637_m;
- } else {
- return this.<T>func_78715_a(p_78713_1_.getClass());
- }
- }
- 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_) {
- this.field_78722_g = p_180597_1_;
- this.field_78733_k = p_180597_5_;
- this.field_78734_h = p_180597_3_;
- this.field_147941_i = p_180597_4_;
- this.field_78736_p = p_180597_2_;
- if(p_180597_3_ instanceof EntityLivingBase && ((EntityLivingBase)p_180597_3_).func_70608_bn()) {
- IBlockState iblockstate = p_180597_1_.func_180495_p(new BlockPos(p_180597_3_));
- Block block = iblockstate.func_177230_c();
- if(block == Blocks.field_150324_C) {
- int i = ((EnumFacing)iblockstate.func_177229_b(BlockBed.field_185512_D)).func_176736_b();
- this.field_78735_i = (float)(i * 90 + 180);
- this.field_78732_j = 0.0F;
- }
- } else {
- 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_;
- 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_;
- }
- if(p_180597_5_.field_74320_O == 2) {
- this.field_78735_i += 180.0F;
- }
- 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_;
- 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_;
- 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_;
- }
- public void func_178631_a(float p_178631_1_) {
- this.field_78735_i = p_178631_1_;
- }
- public boolean func_178627_a() {
- return this.field_178638_s;
- }
- public void func_178633_a(boolean p_178633_1_) {
- this.field_178638_s = p_178633_1_;
- }
- public void func_178629_b(boolean p_178629_1_) {
- this.field_85095_o = p_178629_1_;
- }
- public boolean func_178634_b() {
- return this.field_85095_o;
- }
- public boolean func_188390_b(Entity p_188390_1_) {
- return this.func_78713_a(p_188390_1_).func_188295_H_();
- }
- 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_) {
- Render<Entity> render = this.<Entity>func_78713_a(p_178635_1_);
- return render != null && render.func_177071_a(p_178635_1_, p_178635_2_, p_178635_3_, p_178635_5_, p_178635_7_);
- }
- public void func_188388_a(Entity p_188388_1_, float p_188388_2_, boolean p_188388_3_) {
- if(p_188388_1_.field_70173_aa == 0) {
- p_188388_1_.field_70142_S = p_188388_1_.field_70165_t;
- p_188388_1_.field_70137_T = p_188388_1_.field_70163_u;
- p_188388_1_.field_70136_U = p_188388_1_.field_70161_v;
- }
- double d0 = p_188388_1_.field_70142_S + (p_188388_1_.field_70165_t - p_188388_1_.field_70142_S) * (double)p_188388_2_;
- double d1 = p_188388_1_.field_70137_T + (p_188388_1_.field_70163_u - p_188388_1_.field_70137_T) * (double)p_188388_2_;
- double d2 = p_188388_1_.field_70136_U + (p_188388_1_.field_70161_v - p_188388_1_.field_70136_U) * (double)p_188388_2_;
- float f = p_188388_1_.field_70126_B + (p_188388_1_.field_70177_z - p_188388_1_.field_70126_B) * p_188388_2_;
- int i = p_188388_1_.func_70070_b();
- if(p_188388_1_.func_70027_ad()) {
- i = 15728880;
- }
- int j = i % 65536;
- int k = i / 65536;
- OpenGlHelper.func_77475_a(OpenGlHelper.field_77476_b, (float)j, (float)k);
- GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
- 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_);
- }
- 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_) {
- Render<Entity> render = null;
- try {
- render = this.<Entity>func_78713_a(p_188391_1_);
- if(render != null && this.field_78724_e != null) {
- try {
- render.func_188297_a(this.field_178639_r);
- render.func_76986_a(p_188391_1_, p_188391_2_, p_188391_4_, p_188391_6_, p_188391_8_, p_188391_9_);
- } catch (Throwable throwable1) {
- throw new ReportedException(CrashReport.func_85055_a(throwable1, "Rendering entity in world"));
- }
- try {
- if(!this.field_178639_r) {
- render.func_76979_b(p_188391_1_, p_188391_2_, p_188391_4_, p_188391_6_, p_188391_8_, p_188391_9_);
- }
- } catch (Throwable throwable2) {
- throw new ReportedException(CrashReport.func_85055_a(throwable2, "Post-rendering entity in world"));
- }
- if(this.field_85095_o && !p_188391_1_.func_82150_aj() && !p_188391_10_ && !Minecraft.func_71410_x().func_189648_am()) {
- try {
- this.func_85094_b(p_188391_1_, p_188391_2_, p_188391_4_, p_188391_6_, p_188391_8_, p_188391_9_);
- } catch (Throwable throwable) {
- throw new ReportedException(CrashReport.func_85055_a(throwable, "Rendering entity hitbox in world"));
- }
- }
- }
- } catch (Throwable throwable3) {
- CrashReport crashreport = CrashReport.func_85055_a(throwable3, "Rendering entity in world");
- CrashReportCategory crashreportcategory = crashreport.func_85058_a("Entity being rendered");
- p_188391_1_.func_85029_a(crashreportcategory);
- CrashReportCategory crashreportcategory1 = crashreport.func_85058_a("Renderer details");
- crashreportcategory1.func_71507_a("Assigned renderer", render);
- crashreportcategory1.func_71507_a("Location", CrashReportCategory.func_85074_a(p_188391_2_, p_188391_4_, p_188391_6_));
- crashreportcategory1.func_71507_a("Rotation", Float.valueOf(p_188391_8_));
- crashreportcategory1.func_71507_a("Delta", Float.valueOf(p_188391_9_));
- throw new ReportedException(crashreport);
- }
- }
- public void func_188389_a(Entity p_188389_1_, float p_188389_2_) {
- if(p_188389_1_.field_70173_aa == 0) {
- p_188389_1_.field_70142_S = p_188389_1_.field_70165_t;
- p_188389_1_.field_70137_T = p_188389_1_.field_70163_u;
- p_188389_1_.field_70136_U = p_188389_1_.field_70161_v;
- }
- double d0 = p_188389_1_.field_70142_S + (p_188389_1_.field_70165_t - p_188389_1_.field_70142_S) * (double)p_188389_2_;
- double d1 = p_188389_1_.field_70137_T + (p_188389_1_.field_70163_u - p_188389_1_.field_70137_T) * (double)p_188389_2_;
- double d2 = p_188389_1_.field_70136_U + (p_188389_1_.field_70161_v - p_188389_1_.field_70136_U) * (double)p_188389_2_;
- float f = p_188389_1_.field_70126_B + (p_188389_1_.field_70177_z - p_188389_1_.field_70126_B) * p_188389_2_;
- int i = p_188389_1_.func_70070_b();
- if(p_188389_1_.func_70027_ad()) {
- i = 15728880;
- }
- int j = i % 65536;
- int k = i / 65536;
- OpenGlHelper.func_77475_a(OpenGlHelper.field_77476_b, (float)j, (float)k);
- GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
- Render<Entity> render = this.<Entity>func_78713_a(p_188389_1_);
- if(render != null && this.field_78724_e != null) {
- 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_);
- }
- }
- 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_) {
- GlStateManager.func_179132_a(false);
- GlStateManager.func_179090_x();
- GlStateManager.func_179140_f();
- GlStateManager.func_179129_p();
- GlStateManager.func_179084_k();
- float f = p_85094_1_.field_70130_N / 2.0F;
- AxisAlignedBB axisalignedbb = p_85094_1_.func_174813_aQ();
- 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);
- Entity[] aentity = p_85094_1_.func_70021_al();
- if(aentity != null) {
- for(Entity entity : aentity) {
- double d0 = (entity.field_70165_t - entity.field_70169_q) * (double)p_85094_9_;
- double d1 = (entity.field_70163_u - entity.field_70167_r) * (double)p_85094_9_;
- double d2 = (entity.field_70161_v - entity.field_70166_s) * (double)p_85094_9_;
- AxisAlignedBB axisalignedbb1 = entity.func_174813_aQ();
- 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);
- }
- }
- if(p_85094_1_ instanceof EntityLivingBase) {
- float f1 = 0.01F;
- 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);
- }
- Tessellator tessellator = Tessellator.func_178181_a();
- BufferBuilder bufferbuilder = tessellator.func_178180_c();
- Vec3d vec3d = p_85094_1_.func_70676_i(p_85094_9_);
- bufferbuilder.func_181668_a(3, DefaultVertexFormats.field_181706_f);
- 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();
- 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();
- tessellator.func_78381_a();
- GlStateManager.func_179098_w();
- GlStateManager.func_179145_e();
- GlStateManager.func_179089_o();
- GlStateManager.func_179084_k();
- GlStateManager.func_179132_a(true);
- }
- public void func_78717_a(@Nullable World p_78717_1_) {
- this.field_78722_g = p_78717_1_;
- if(p_78717_1_ == null) {
- this.field_78734_h = null;
- }
- }
- public double func_78714_a(double p_78714_1_, double p_78714_3_, double p_78714_5_) {
- double d0 = p_78714_1_ - this.field_78730_l;
- double d1 = p_78714_3_ - this.field_78731_m;
- double d2 = p_78714_5_ - this.field_78728_n;
- return d0 * d0 + d1 * d1 + d2 * d2;
- }
- public FontRenderer func_78716_a() {
- return this.field_78736_p;
- }
- public void func_178632_c(boolean p_178632_1_) {
- this.field_178639_r = p_178632_1_;
- }
- }
- Patching failed: minecraft\net\minecraft\client\renderer\entity\RenderGiantZombie.java
- Hunk 1 failed! Cannot find hunk target
- this.func_177094_a(new LayerHeldItem(this));
- this.func_177094_a(new LayerBipedArmor(this) {
- protected void func_177177_a() {
- - this.field_177189_c = (T)(new ModelZombie(0.5F, true));
- - this.field_177186_d = (T)(new ModelZombie(1.0F, true));
- + this.field_177189_c = new ModelZombie(0.5F, true);
- + this.field_177186_d = new ModelZombie(1.0F, true);
- }
- });
- }
- File state
- package net.minecraft.client.renderer.entity;
- import net.minecraft.client.model.ModelZombie;
- import net.minecraft.client.renderer.GlStateManager;
- import net.minecraft.client.renderer.entity.RenderLiving;
- import net.minecraft.client.renderer.entity.RenderManager;
- import net.minecraft.client.renderer.entity.layers.LayerBipedArmor;
- import net.minecraft.client.renderer.entity.layers.LayerHeldItem;
- import net.minecraft.entity.monster.EntityGiantZombie;
- import net.minecraft.util.ResourceLocation;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- @SideOnly(Side.CLIENT)
- public class RenderGiantZombie extends RenderLiving<EntityGiantZombie> {
- private static final ResourceLocation field_110871_a = new ResourceLocation("textures/entity/zombie/zombie.png");
- private final float field_77073_a;
- public RenderGiantZombie(RenderManager p_i47206_1_, float p_i47206_2_) {
- super(p_i47206_1_, new ModelZombie(), 0.5F * p_i47206_2_);
- this.field_77073_a = p_i47206_2_;
- this.func_177094_a(new LayerHeldItem(this));
- this.func_177094_a(new LayerBipedArmor(this) {
- protected void func_177177_a() {
- this.field_177189_c = new ModelZombie(0.5F, true);
- this.field_177186_d = new ModelZombie(1.0F, true);
- }
- });
- }
- public void func_82422_c() {
- GlStateManager.func_179109_b(0.0F, 0.1875F, 0.0F);
- }
- protected void func_77041_b(EntityGiantZombie p_77041_1_, float p_77041_2_) {
- GlStateManager.func_179152_a(this.field_77073_a, this.field_77073_a, this.field_77073_a);
- }
- protected ResourceLocation func_110775_a(EntityGiantZombie p_110775_1_) {
- return field_110871_a;
- }
- }
- Patching failed: minecraft\net\minecraft\client\renderer\entity\RenderPigZombie.java
- Hunk 1 failed! Cannot find hunk target
- super(p_i46148_1_, new ModelZombie(), 0.5F);
- this.func_177094_a(new LayerBipedArmor(this) {
- protected void func_177177_a() {
- - this.field_177189_c = (T)(new ModelZombie(0.5F, true));
- - this.field_177186_d = (T)(new ModelZombie(1.0F, true));
- + this.field_177189_c = new ModelZombie(0.5F, true);
- + this.field_177186_d = new ModelZombie(1.0F, true);
- }
- });
- }
- File state
- package net.minecraft.client.renderer.entity;
- import net.minecraft.client.model.ModelZombie;
- import net.minecraft.client.renderer.entity.RenderBiped;
- import net.minecraft.client.renderer.entity.RenderManager;
- import net.minecraft.client.renderer.entity.layers.LayerBipedArmor;
- import net.minecraft.entity.monster.EntityPigZombie;
- import net.minecraft.util.ResourceLocation;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- @SideOnly(Side.CLIENT)
- public class RenderPigZombie extends RenderBiped<EntityPigZombie> {
- private static final ResourceLocation field_177120_j = new ResourceLocation("textures/entity/zombie_pigman.png");
- public RenderPigZombie(RenderManager p_i46148_1_) {
- super(p_i46148_1_, new ModelZombie(), 0.5F);
- this.func_177094_a(new LayerBipedArmor(this) {
- protected void func_177177_a() {
- this.field_177189_c = new ModelZombie(0.5F, true);
- this.field_177186_d = new ModelZombie(1.0F, true);
- }
- });
- }
- protected ResourceLocation func_110775_a(EntityPigZombie p_110775_1_) {
- return field_177120_j;
- }
- }
- Patching failed: minecraft\net\minecraft\client\renderer\entity\RenderSkeleton.java
- Hunk 1 failed! Cannot find hunk target
- this.func_177094_a(new LayerHeldItem(this));
- this.func_177094_a(new LayerBipedArmor(this) {
- protected void func_177177_a() {
- - this.field_177189_c = (T)(new ModelSkeleton(0.5F, true));
- - this.field_177186_d = (T)(new ModelSkeleton(1.0F, true));
- + this.field_177189_c = new ModelSkeleton(0.5F, true);
- + this.field_177186_d = new ModelSkeleton(1.0F, true);
- }
- });
- }
- File state
- package net.minecraft.client.renderer.entity;
- import net.minecraft.client.model.ModelSkeleton;
- import net.minecraft.client.renderer.GlStateManager;
- import net.minecraft.client.renderer.entity.RenderBiped;
- import net.minecraft.client.renderer.entity.RenderManager;
- import net.minecraft.client.renderer.entity.layers.LayerBipedArmor;
- import net.minecraft.client.renderer.entity.layers.LayerHeldItem;
- import net.minecraft.entity.monster.AbstractSkeleton;
- import net.minecraft.util.ResourceLocation;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- @SideOnly(Side.CLIENT)
- public class RenderSkeleton extends RenderBiped<AbstractSkeleton> {
- private static final ResourceLocation field_110862_k = new ResourceLocation("textures/entity/skeleton/skeleton.png");
- public RenderSkeleton(RenderManager p_i46143_1_) {
- super(p_i46143_1_, new ModelSkeleton(), 0.5F);
- this.func_177094_a(new LayerHeldItem(this));
- this.func_177094_a(new LayerBipedArmor(this) {
- protected void func_177177_a() {
- this.field_177189_c = new ModelSkeleton(0.5F, true);
- this.field_177186_d = new ModelSkeleton(1.0F, true);
- }
- });
- }
- public void func_82422_c() {
- GlStateManager.func_179109_b(0.09375F, 0.1875F, 0.0F);
- }
- protected ResourceLocation func_110775_a(AbstractSkeleton p_110775_1_) {
- return field_110862_k;
- }
- }
- Patching failed: minecraft\net\minecraft\client\renderer\entity\RenderZombie.java
- Hunk 1 failed! Cannot find hunk target
- super(p_i46127_1_, new ModelZombie(), 0.5F);
- LayerBipedArmor layerbipedarmor = new LayerBipedArmor(this) {
- protected void func_177177_a() {
- - this.field_177189_c = (T)(new ModelZombie(0.5F, true));
- - this.field_177186_d = (T)(new ModelZombie(1.0F, true));
- + this.field_177189_c = new ModelZombie(0.5F, true);
- + this.field_177186_d = new ModelZombie(1.0F, true);
- }
- };
- this.func_177094_a(layerbipedarmor);
- File state
- package net.minecraft.client.renderer.entity;
- import net.minecraft.client.model.ModelZombie;
- import net.minecraft.client.renderer.entity.RenderBiped;
- import net.minecraft.client.renderer.entity.RenderManager;
- import net.minecraft.client.renderer.entity.layers.LayerBipedArmor;
- import net.minecraft.entity.monster.EntityZombie;
- import net.minecraft.util.ResourceLocation;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- @SideOnly(Side.CLIENT)
- public class RenderZombie extends RenderBiped<EntityZombie> {
- private static final ResourceLocation field_110865_p = new ResourceLocation("textures/entity/zombie/zombie.png");
- public RenderZombie(RenderManager p_i46127_1_) {
- super(p_i46127_1_, new ModelZombie(), 0.5F);
- LayerBipedArmor layerbipedarmor = new LayerBipedArmor(this) {
- protected void func_177177_a() {
- this.field_177189_c = new ModelZombie(0.5F, true);
- this.field_177186_d = new ModelZombie(1.0F, true);
- }
- };
- this.func_177094_a(layerbipedarmor);
- }
- protected ResourceLocation func_110775_a(EntityZombie p_110775_1_) {
- return field_110865_p;
- }
- }
- Patching failed: minecraft\net\minecraft\client\renderer\entity\layers\LayerBipedArmor.java
- Hunk 1 failed! Cannot find hunk target
- }
- protected void func_177177_a() {
- - this.field_177189_c = (T)(new ModelBiped(0.5F));
- - this.field_177186_d = (T)(new ModelBiped(1.0F));
- + this.field_177189_c = new ModelBiped(0.5F);
- + this.field_177186_d = new ModelBiped(1.0F);
- }
- + @SuppressWarnings("incomplete-switch")
- protected void func_188359_a(ModelBiped p_188359_1_, EntityEquipmentSlot p_188359_2_) {
- this.func_177194_a(p_188359_1_);
- switch(p_188359_2_) {
- File state
- package net.minecraft.client.renderer.entity.layers;
- import net.minecraft.client.model.ModelBiped;
- import net.minecraft.client.renderer.entity.RenderLivingBase;
- import net.minecraft.client.renderer.entity.layers.LayerArmorBase;
- import net.minecraft.inventory.EntityEquipmentSlot;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- @SideOnly(Side.CLIENT)
- public class LayerBipedArmor extends LayerArmorBase<ModelBiped> {
- public LayerBipedArmor(RenderLivingBase<?> p_i46116_1_) {
- super(p_i46116_1_);
- }
- protected void func_177177_a() {
- this.field_177189_c = new ModelBiped(0.5F);
- this.field_177186_d = new ModelBiped(1.0F);
- }
- protected void func_188359_a(ModelBiped p_188359_1_, EntityEquipmentSlot p_188359_2_) {
- this.func_177194_a(p_188359_1_);
- switch(p_188359_2_) {
- case HEAD:
- p_188359_1_.field_78116_c.field_78806_j = true;
- p_188359_1_.field_178720_f.field_78806_j = true;
- break;
- case CHEST:
- p_188359_1_.field_78115_e.field_78806_j = true;
- p_188359_1_.field_178723_h.field_78806_j = true;
- p_188359_1_.field_178724_i.field_78806_j = true;
- break;
- case LEGS:
- p_188359_1_.field_78115_e.field_78806_j = true;
- p_188359_1_.field_178721_j.field_78806_j = true;
- p_188359_1_.field_178722_k.field_78806_j = true;
- break;
- case FEET:
- p_188359_1_.field_178721_j.field_78806_j = true;
- p_188359_1_.field_178722_k.field_78806_j = true;
- }
- }
- protected void func_177194_a(ModelBiped p_177194_1_) {
- p_177194_1_.func_178719_a(false);
- }
- }
- FAILED
- FAILURE: Build failed with an exception.
- * What went wrong:
- Execution failed for task ':fixMcSources'.
- > com.cloudbees.diff.PatchException: Cannot find hunk target
- * Try:
- Run with --info or --debug option to get more log output.
- * Exception is:
- org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':fixMcSources'.
- at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
- at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
- at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
- at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:66)
- at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
- at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
- at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
- at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
- at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
- at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
- at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
- at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
- at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
- at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)
- at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110)
- at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
- at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
- at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
- at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
- at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
- at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
- at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
- at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:153)
- at org.gradle.internal.Factories$1.create(Factories.java:22)
- at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
- at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:53)
- at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:150)
- at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
- at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:98)
- at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:92)
- at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
- at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:63)
- at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:92)
- at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:83)
- at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:99)
- at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
- at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
- at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:48)
- at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
- at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:81)
- at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:46)
- at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:51)
- at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:28)
- at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43)
- at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:173)
- at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:239)
- at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:212)
- at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
- at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
- at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
- at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
- at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:205)
- at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
- at org.gradle.launcher.Main.doAction(Main.java:33)
- at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
- at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:55)
- at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:36)
- at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
- at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30)
- at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:127)
- at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
- Caused by: java.lang.RuntimeException: com.cloudbees.diff.PatchException: Cannot find hunk target
- at com.google.common.base.Throwables.propagate(Throwables.java:160)
- at net.minecraftforge.gradle.tasks.PostDecompileTask.doStuffAfter(PostDecompileTask.java:254)
- at net.minecraftforge.gradle.tasks.AbstractEditJarTask.doTask(AbstractEditJarTask.java:86)
- at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
- at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:228)
- at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:221)
- at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:210)
- at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:621)
- at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:604)
- at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
- at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
- ... 60 more
- Caused by: com.cloudbees.diff.PatchException: Cannot find hunk target
- at net.minecraftforge.gradle.util.patching.ContextualPatch.applyHunk(ContextualPatch.java:434)
- at net.minecraftforge.gradle.util.patching.ContextualPatch.applyPatch(ContextualPatch.java:255)
- at net.minecraftforge.gradle.util.patching.ContextualPatch.patch(ContextualPatch.java:161)
- at net.minecraftforge.gradle.tasks.PostDecompileTask.asRead(PostDecompileTask.java:136)
- at net.minecraftforge.gradle.tasks.AbstractEditJarTask.copyJar(AbstractEditJarTask.java:235)
- at net.minecraftforge.gradle.tasks.AbstractEditJarTask.doTask(AbstractEditJarTask.java:83)
- ... 68 more
- BUILD FAILED
- Total time: 55.104 secs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement